Browse Source

first iteration of search functionality - likely to fail hard

master
jk 3 years ago
parent
commit
3c55315f79
  1. 5
      app/Http/Controllers/SearchController.php

5
app/Http/Controllers/SearchController.php

@ -106,10 +106,11 @@ class SearchController extends Controller
$fermentarr = array(); $fermentarr = array();
$i = 0; $i = 0;
foreach ($fermentations as $fermentation){ foreach ($fermentations as $fermentation){
$j = $i + 1;
if ($i == 0){ if ($i == 0){
$fermentarr = array('stage'=>$i + 1, 'temp'=>$fermentation->temperature, 'duration'=>$fermentation->duration);
$fermentarr = array('stage'=>$j, 'temp'=>$fermentation->temperature, 'duration'=>$fermentation->duration);
} else { } else {
array_push($fermentarr, array('stage'=>$i + 1, 'temp'=>$fermentation->temperature, 'duration'=>$fermentation->duration));
array_push($fermentarr, array('stage'=>$j, 'temp'=>$fermentation->temperature, 'duration'=>$fermentation->duration));
}; };
$i++; $i++;
}; };

Loading…
Cancel
Save