44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
class Populate_hasil extends MY_Controller
|
|
{
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
function get_regionalID()
|
|
{
|
|
$sql = "select M_BranchS_RegionalID,M_BranchID,M_BranchCode
|
|
from m_branch
|
|
where M_BranchIsActive = 'Y' and M_BranchIsDefault = 'Y'
|
|
";
|
|
$qry = $this->db->query($sql);
|
|
if (!$qry) {
|
|
print_r($this->db->error());
|
|
echo $this->db->last_query();
|
|
exit;
|
|
}
|
|
$rows = $qry->result_array();
|
|
|
|
return $rows[0];
|
|
}
|
|
function populate($dokterID)
|
|
{
|
|
$regs = $this->get_regionalID();
|
|
$sql = "select T_OrderHeaderID from t_orderheader where T_OrderHeaderM_DoctorID =
|
|
? and T_OrderHeaderIsActive = 'Y'
|
|
and T_OrderHeaderDate + interval 7 day < now()
|
|
order by T_OrderHeaderID desc limit 0,50";
|
|
echo "Date : " . Date() . "\n";
|
|
$qry = $this->db->query($sql, [$dokterID]);
|
|
if (!$qry) {
|
|
print_r($this->db->error());
|
|
echo $this->db->last_query();
|
|
exit;
|
|
}
|
|
print_r($regs);
|
|
$rows = $qry->result_array();
|
|
print_r($rows);
|
|
echo "Date : " . Date() . "\n";
|
|
}
|
|
}
|