419 } else { |
419 } else { |
420 /* |
420 /* |
421 * SELECT, produce a list of products that are not yet Closed. |
421 * SELECT, produce a list of products that are not yet Closed. |
422 */ |
422 */ |
423 if (isset($_GET['select']) && ($_GET['select'] == "inprod")) { |
423 if (isset($_GET['select']) && ($_GET['select'] == "inprod")) { |
424 $query = "SELECT record,name,code,birth,stage FROM products WHERE stage != '11' ORDER BY birth,code;"; |
424 $query = "SELECT record,name,code,birth,stage,brew_date_start,package_date FROM products WHERE stage != '11' ORDER BY birth,code;"; |
425 $result = mysqli_query($connect, $query) or die("SQL Error 1: " . mysqli_error($connect)); |
425 $result = mysqli_query($connect, $query) or die("SQL Error 1: " . mysqli_error($connect)); |
426 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
426 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
427 $brews[] = array( |
427 $brews[] = array( |
428 'record' => $row['record'], |
428 'record' => $row['record'], |
429 'name' => $row['name'], |
429 'name' => $row['name'], |
430 'code' => $row['code'], |
430 'code' => $row['code'], |
431 'birth' => $row['birth'], |
431 'birth' => $row['birth'], |
432 'stage' => $row['stage'] |
432 'stage' => $row['stage'], |
|
433 'brew_date' => substr($row['brew_date_start'], 0, 10), |
|
434 'package_date' => $row['package_date'] |
433 ); |
435 ); |
434 } |
436 } |
435 header("Content-type: application/json"); |
437 header("Content-type: application/json"); |
436 echo json_encode($brews, JSON_UNESCAPED_UNICODE); |
438 echo json_encode($brews, JSON_UNESCAPED_UNICODE); |
437 return; |
439 return; |