72 syslog(LOG_NOTICE, "Updated ".$changed." products to stage 9 (Taste)"); |
72 syslog(LOG_NOTICE, "Updated ".$changed." products to stage 9 (Taste)"); |
73 } |
73 } |
74 |
74 |
75 |
75 |
76 /* |
76 /* |
77 * Check fementation logs. |
77 * Check several logs. |
78 */ |
78 */ |
79 $query = "SELECT record,code,name,log_brew,log_fermentation,log_ispindel FROM products;"; |
79 $query = "SELECT record,code,name,log_brew,log_fermentation,log_ispindel,log_co2pressure FROM products;"; |
80 $result = mysqli_query($connect, $query); |
80 $result = mysqli_query($connect, $query); |
81 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
81 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
82 $logfile = "log/fermentation/" . $row['code'] . " " . $row['name'] . ".log"; |
82 $logfile = "log/fermentation/" . $row['code'] . " " . $row['name'] . ".log"; |
83 if (file_exists($logfile)) |
83 if (file_exists($logfile)) |
84 $ok = 1; |
84 $ok = 1; |
97 if ($ok != $row['log_ispindel']) { |
97 if ($ok != $row['log_ispindel']) { |
98 $query = "UPDATE products SET log_ispindel='" . $ok . "' WHERE record='" . $row['record'] . "';"; |
98 $query = "UPDATE products SET log_ispindel='" . $ok . "' WHERE record='" . $row['record'] . "';"; |
99 syslog(LOG_NOTICE, $query); |
99 syslog(LOG_NOTICE, $query); |
100 $result1 = mysqli_query($connect, $query); |
100 $result1 = mysqli_query($connect, $query); |
101 } |
101 } |
|
102 $logfile = "log/co2pressure/" . $row['code'] . " " . $row['name'] . ".log"; |
|
103 if (file_exists($logfile)) |
|
104 $ok = 1; |
|
105 else |
|
106 $ok = 0; |
|
107 if ($ok != $row['log_co2pressure']) { |
|
108 $query = "UPDATE products SET log_co2pressure='" . $ok . "' WHERE record='" . $row['record'] . "';"; |
|
109 syslog(LOG_NOTICE, $query); |
|
110 $result1 = mysqli_query($connect, $query); |
|
111 } |
102 } |
112 } |
103 |
113 |
104 |
114 |
105 /* |
115 /* |
106 * Check and update secondary_end_sg |
116 * Check and update secondary_end_sg |