22 lines
723 B
PHP
22 lines
723 B
PHP
<?php
|
|
class T_auto_calc extends MY_Controller
|
|
{
|
|
function do($nolab)
|
|
{
|
|
$sql = "select * from t_orderheader where T_OrderHeaderLabNumber = ?";
|
|
$qry = $this->db->query($sql, [$nolab]);
|
|
if (!$qry) {
|
|
echo json_encode(["status" => "ERR", "message" => $this->db->errror()], JSON_PRETTY_PRINT);
|
|
exit;
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
echo json_encode(["status" => "ERR", "message" => "Nolab $nolab, not found."], JSON_PRETTY_PRINT);
|
|
exit;
|
|
}
|
|
$order_id = $rows[0]["T_OrderHeaderID"];
|
|
$this->load->library("Resultcalc");
|
|
$this->resultcalc->auto($order_id,"debug");
|
|
}
|
|
}
|