Files
2026-04-15 15:23:57 +07:00

49 lines
1.3 KiB
PHP

<?php
class Rujukan extends MY_Controller
{
function __construct() {
parent::__construct();
}
function index() {
echo <<<EOF
pending
Listing Pending Hari ini
reset/kodeCabang/date/validationOnly
Reset Retry
EOF
;
}
function pending($date = "") {
$sql ="select M_BranchCode, TxBranchStatusM_BranchIP, Tx_BranchStatusJson
from tx_branch_status
join m_branch on Tx_BranchStatusM_BranchID = M_BranchID and M_BranchIsActive = 'Y'
where TxBranchStatusCreated = ?
and TxBranchStatusIsSent = 'N'
and TxBranchStatusRetry >= 20";
$qry = $this->db->query($sql, array($date));
if (! $qry ) print_r($this->db->error());
$rows = $qry->result_array();
$header = array ( "M_BranchCode" => "Branch",
"TxBranchStatusM_BranchIP" => "IP Address",
"TxBranchStatusJson" => "JSON"
);
$this->show_result($rows,$header);
}
function show_result($rows,$header) {
echo "<table>";
echo "<tr>";
foreach($header as $h -> $t) {
echo "<th>{$t}</th>";
}
echo "<tr>\n";
foreach($rows as $r) {
echo "<tr>";
foreach($header as $h -> $t) {
echo "<td>{$r[$h]}</td>";
}
echo "<tr>\n";
}
echo "</table>";
}
}