325 $brews[] = array( |
325 $brews[] = array( |
326 'record' => $row['record'], |
326 'record' => $row['record'], |
327 'name' => $row['name'], |
327 'name' => $row['name'], |
328 'code' => $row['code'], |
328 'code' => $row['code'], |
329 'birth' => $row['birth'], |
329 'birth' => $row['birth'], |
|
330 'stage' => $row['stage'] |
|
331 ); |
|
332 } |
|
333 echo json_encode($brews); |
|
334 return; |
|
335 } |
|
336 |
|
337 /* |
|
338 * SELECT, produce a list of products that can be fermented. |
|
339 */ |
|
340 if (isset($_GET['select']) && ($_GET['select'] == "ferment")) { |
|
341 $query = "SELECT code,name,stage FROM products WHERE "; |
|
342 $query .= "stage='Wait' OR stage='Brew' OR stage='Primary' OR stage='Secondary' OR stage='Tertiary' OR stage='Carbonation' ORDER BY code;"; |
|
343 $result = mysqli_query($connect, $query) or die("SQL Error 1: " . mysqli_error($connect)); |
|
344 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
|
345 $brews[] = array( |
|
346 'code' => $row['code'], |
|
347 'name' => $row['name'], |
330 'stage' => $row['stage'] |
348 'stage' => $row['stage'] |
331 ); |
349 ); |
332 } |
350 } |
333 echo json_encode($brews); |
351 echo json_encode($brews); |
334 return; |
352 return; |