www/includes/db_divides.php

changeset 774
92e1e8f175a2
parent 754
30abc8024afe
equal deleted inserted replaced
773:f4161330ed01 774:92e1e8f175a2
352 // syslog(LOG_NOTICE, "db_divide: " . str_replace($rescapers,$rreplacements,json_encode($yeasts, JSON_UNESCAPED_UNICODE))); 352 // syslog(LOG_NOTICE, "db_divide: " . str_replace($rescapers,$rreplacements,json_encode($yeasts, JSON_UNESCAPED_UNICODE)));
353 $sql .= "', json_yeasts='" . str_replace($rescapers,$rreplacements,json_encode($yeasts, JSON_UNESCAPED_UNICODE)); 353 $sql .= "', json_yeasts='" . str_replace($rescapers,$rreplacements,json_encode($yeasts, JSON_UNESCAPED_UNICODE));
354 354
355 $mashs = json_decode($row['json_mashs'], true); 355 $mashs = json_decode($row['json_mashs'], true);
356 for ($i = 0; $i < count($mashs); $i++) { 356 for ($i = 0; $i < count($mashs); $i++) {
357 $mashs[$i]['step_volume'] = sprintf("%.5f", $mashs[$i]['step_volume'] * $factor);
357 $mashs[$i]['step_infuse_amount'] = sprintf("%.5f", $mashs[$i]['step_infuse_amount'] * $factor); 358 $mashs[$i]['step_infuse_amount'] = sprintf("%.5f", $mashs[$i]['step_infuse_amount'] * $factor);
358 } 359 }
359 // syslog(LOG_NOTICE, "db_divide: " . str_replace($rescapers,$rreplacements,json_encode($mashs, JSON_UNESCAPED_UNICODE))); 360 // syslog(LOG_NOTICE, "db_divide: " . str_replace($rescapers,$rreplacements,json_encode($mashs, JSON_UNESCAPED_UNICODE)));
360 $sql .= "', json_mashs='" . str_replace($rescapers,$rreplacements,json_encode($mashs, JSON_UNESCAPED_UNICODE)); 361 $sql .= "', json_mashs='" . str_replace($rescapers,$rreplacements,json_encode($mashs, JSON_UNESCAPED_UNICODE));
361 362
392 $sql3 .= "', version='" . $row3['version']; 393 $sql3 .= "', version='" . $row3['version'];
393 $sql3 .= "', uuid='" . $uuid; 394 $sql3 .= "', uuid='" . $uuid;
394 $sql3 .= "', code='" . mysqli_real_escape_string($link, $split['code']); 395 $sql3 .= "', code='" . mysqli_real_escape_string($link, $split['code']);
395 $sql3 .= "', name='" . mysqli_real_escape_string($link, $split['name']); 396 $sql3 .= "', name='" . mysqli_real_escape_string($link, $split['name']);
396 $sql3 .= "', pv_mlt='" . $row3['pv_mlt']; 397 $sql3 .= "', pv_mlt='" . $row3['pv_mlt'];
397 $sql3 .= "', pv_hlt='" . $row3['pv_hlt']; 398 if (strlen($row3['pv_hlt']))
398 $sql3 .= "', pv_room='" . $row3['pv_room']; 399 $sql3 .= "', pv_hlt='" . $row3['pv_hlt'];
400 if (strlen($row3['pv_room']))
401 $sql3 .= "', pv_room='" . $row3['pv_room'];
399 $sql3 .= "', sp_mlt='" . $row3['sp_mlt']; 402 $sql3 .= "', sp_mlt='" . $row3['sp_mlt'];
400 $sql3 .= "', sp_hlt='" . $row3['sp_hlt']; 403 if (strlen($row3['sp_hlt']))
404 $sql3 .= "', sp_hlt='" . $row3['sp_hlt'];
401 $sql3 .= "', pwm_mlt='" . $row3['pwm_mlt']; 405 $sql3 .= "', pwm_mlt='" . $row3['pwm_mlt'];
402 $sql3 .= "', pwm_hlt='" . $row3['pwm_hlt']; 406 if (strlen($row3['pwm_hlt']))
407 $sql3 .= "', pwm_hlt='" . $row3['pwm_hlt'];
403 $sql3 .= "', event='" . $row3['event'] . "';"; 408 $sql3 .= "', event='" . $row3['event'] . "';";
404 $result4 = mysqli_query($link, $sql3); 409 $result4 = mysqli_query($link, $sql3);
405 if (! $result4) { 410 if (! $result4) {
406 syslog(LOG_NOTICE, "db_divide: result4: ".mysqli_error($link)." ".$sql3); 411 syslog(LOG_NOTICE, "db_divide: result4: ".mysqli_error($link)." ".$sql3);
407 } 412 }

mercurial