www/crontasks.php

changeset 602
10b61aacb1c1
parent 460
046ff5fdc96c
child 615
9034e65b0d7a
equal deleted inserted replaced
601:112c278be803 602:10b61aacb1c1
74 74
75 75
76 /* 76 /*
77 * Check fementation logs. 77 * Check fementation logs.
78 */ 78 */
79 $query = "SELECT record,code,name,log_brew,log_fermentation FROM products;"; 79 $query = "SELECT record,code,name,log_brew,log_fermentation,log_ispindel 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;
87 if ($ok != $row['log_fermentation']) { 87 if ($ok != $row['log_fermentation']) {
88 $query = "UPDATE products SET log_fermentation='" . $ok . "' WHERE record='" . $row['record'] . "';"; 88 $query = "UPDATE products SET log_fermentation='" . $ok . "' WHERE record='" . $row['record'] . "';";
89 syslog(LOG_NOTICE, $query); 89 syslog(LOG_NOTICE, $query);
90 $result1 = mysqli_query($connect, $query); 90 $result1 = mysqli_query($connect, $query);
91 } 91 }
92 $logfile = "log/ispindel/" . $row['code'] . " " . $row['name'] . ".log";
93 if (file_exists($logfile))
94 $ok = 1;
95 else
96 $ok = 0;
97 if ($ok != $row['log_ispindel']) {
98 $query = "UPDATE products SET log_ispindel='" . $ok . "' WHERE record='" . $row['record'] . "';";
99 syslog(LOG_NOTICE, $query);
100 $result1 = mysqli_query($connect, $query);
101 }
92 } 102 }
93 103
94 104
95 /* 105 /*
96 * Check and update secondary_end_sg 106 * Check and update secondary_end_sg

mercurial