Files
REG_IBL/one-api/application/controllers/tools/Adhoc.php
2026-05-25 20:01:37 +07:00

33 lines
1.1 KiB
PHP

<?php
class Adhoc extends MY_Controller
{
function __construct() {
parent::__construct();
$this->db = $this->load->database('regional', true);
}
function status($branchCode) {
$sql = "select * from req_rerun where Req_ReRunM_BranchCode = '{$branchCode}' AND Req_ReRunStatus = 'N'";
$qry = $this->db->query($sql);
$rows = $qry->result_array();
foreach($rows as $idx => $r ) {
echo $r["Req_ReRunDateSchedule"] . " ";
}
}
function update() {
$prm = $this->sys_input;
$branchCode = $prm['branch'];
$date = explode("^", $prm['date']);
foreach($date as $r) {
$sql = "UPDATE req_rerun SET Req_ReRunStatus = 'Y', Req_ReRunRetry = Req_ReRunRetry + 1 where Req_ReRunM_BranchCode = '{$branchCode}' AND Req_ReRunDateSchedule = '{$r}'";
$qry = $this->db->query($sql);
if (! $qry) {
print_r($this->db->error());
}else{
echo $branchCode . " ". $r ." telah di download ". "\n";
}
}
}
}