Initial import
This commit is contained in:
32
one-api/application/controllers/tools/Adhoc.php
Normal file
32
one-api/application/controllers/tools/Adhoc.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user