Files
BE_IBL/application/controllers/tools/Awb.php
2026-04-15 15:23:57 +07:00

33 lines
849 B
PHP

<?php
class Awb extends MY_Controller {
function __construct() {
parent::__construct();
}
function show($db,$id) {
$sql = "select * from $db.inbox
where id = $id";
$qry = $this->db->query($sql);
if(!$qry) {
echo "Err : " . $this->db->error()["message"];
exit;
}
$rows = $qry->result_array();
if (count($rows) == 0) {
echo "No record for $db.inbox id : $id ";
exit;
}
$data = $rows[0]["data"];
echo "tanggal : " . $rows[0]["tgl"] . "<br/>\n";
echo $this->hexToString($data);
}
function hexToString($data) {
$result = "";
$arr = explode(" ",$data);
foreach($arr as $hex) {
if ( trim($hex) == "" ) continue;
$result = $result . chr(hexdec(trim($hex)));
}
return $result;
}
}