www/includes/db_profile_fermentation.php

changeset 189
6470e5c6a001
parent 186
a7c2c61a01ad
child 217
318aab371497
equal deleted inserted replaced
188:0ef62ec2d5b0 189:6470e5c6a001
24 $sql = "UPDATE `profile_fermentation` SET "; 24 $sql = "UPDATE `profile_fermentation` SET ";
25 } 25 }
26 26
27 if (isset($_GET['uuid']) && (strlen($_GET['uuid']) == 36)) { 27 if (isset($_GET['uuid']) && (strlen($_GET['uuid']) == 36)) {
28 $sql .= "uuid='" . $_GET['uuid']; 28 $sql .= "uuid='" . $_GET['uuid'];
29 // syslog(LOG_NOTICE, 'Keep uuid ');
30 } else { 29 } else {
31 $uuid = str_replace("\n", "", file_get_contents('/proc/sys/kernel/random/uuid')); 30 $uuid = str_replace("\n", "", file_get_contents('/proc/sys/kernel/random/uuid'));
32 $sql .= "uuid='" . $uuid; 31 $sql .= "uuid='" . $uuid;
33 // syslog(LOG_NOTICE, 'New uuid ');
34 } 32 }
35 33
36 $sql .= "', name='" . mysqli_real_escape_string($connect, $_GET['name']); 34 $sql .= "', name='" . mysqli_real_escape_string($connect, $_GET['name']);
37 $sql .= "', inittemp_lo='" . floatval($_GET['inittemp_lo']); 35 $sql .= "', inittemp_lo='" . floatval($_GET['inittemp_lo']);
38 $sql .= "', inittemp_hi='" . floatval($_GET['inittemp_hi']); 36 $sql .= "', inittemp_hi='" . floatval($_GET['inittemp_hi']);
105 $profiles .= ',"duration":' . $row['duration']; 103 $profiles .= ',"duration":' . $row['duration'];
106 $profiles .= ',"steps":' . $row['steps']; 104 $profiles .= ',"steps":' . $row['steps'];
107 $profiles .= '}'; 105 $profiles .= '}';
108 } 106 }
109 $profiles .= ']'; 107 $profiles .= ']';
110 // syslog(LOG_NOTICE, $profiles); 108 syslog(LOG_NOTICE, $profiles);
111 header("Content-type: application/json"); 109 header("Content-type: application/json");
112 echo $profiles; 110 echo $profiles;
113 } 111 }
114 ?> 112 ?>

mercurial