Initial import
This commit is contained in:
75
application/controllers/fix/Serumkuningmerah.php
Normal file
75
application/controllers/fix/Serumkuningmerah.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
class Serumkuningmerah extends MY_Controller
|
||||
{
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
function cek_order($order) {
|
||||
$sql = "select * from t_orderheader where T_OrderHeaderLabNumber like ?";
|
||||
$qry = $this->db->query($sql, array("%" . $order . "%"));
|
||||
if (! $qry) {
|
||||
echo "ERR : \n" ;
|
||||
print_r($this->db->error());
|
||||
exit;
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
foreach($rows as $r) {
|
||||
echo "{$r['T_OrderHeaderID']}\t{$r['T_OrderHeaderDate']}\t{$r['T_OrderHeaderLabNumber']}\n";
|
||||
}
|
||||
}
|
||||
function cek($headerID) {
|
||||
$sql ="select *
|
||||
from t_ordersample
|
||||
join t_sampletype on T_OrderSampleT_SampleTypeID = T_SampleTypeID
|
||||
where T_OrderSampleIsActive = 'Y' and T_OrderSampleT_OrderHeaderID=? order by T_OrderSampleID";
|
||||
$qry = $this->db->query($sql,array($headerID));
|
||||
if (! $qry) {
|
||||
echo "ERR : \n" ;
|
||||
print_r($this->db->error());
|
||||
exit;
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
foreach($rows as $r) {
|
||||
echo "{$r['T_OrderSampleID']}\t{$r['T_OrderSampleBarcode']}\t{$r['T_SampleTypeName']}\t{$r['T_OrderSampleWorklistReceive']}\t" .
|
||||
"{$r['T_OrderSampleWorklistReceiveDatetime']}\t{$r['T_OrderSampleWorklistReceiveUserID']}\n";
|
||||
}
|
||||
}
|
||||
function cek_kuning($headerID) {
|
||||
$sql ="select a.T_OrderSampleWorklistReceive , b.T_OrderSampleWorklistReceive bRcv,
|
||||
a.T_OrderSampleWorklistReceiveDatetime, b.T_OrderSampleWorklistReceiveDatetime bDate,
|
||||
a.T_OrderSampleWorklistReceiveUserID, b.T_OrderSampleWorklistReceiveUserID bUser
|
||||
from t_ordersample a
|
||||
join t_ordersample b on a.T_OrderSampleT_OrderHeaderID = b.T_OrderSampleT_OrderHeaderID
|
||||
and a.T_OrderSampleBarcode like '%SK%' and b.T_OrderSampleBarcode like '%SP%'
|
||||
and a.T_OrderSampleIsActive = 'Y' and b.T_OrderSampleIsActive = 'Y'
|
||||
and a.T_OrderSampleT_OrderHeaderID = ?";
|
||||
$qry = $this->db->query($sql,array($headerID));
|
||||
if (! $qry) {
|
||||
echo "ERR : \n" ;
|
||||
print_r($this->db->error());
|
||||
exit;
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
print_r($rows);
|
||||
}
|
||||
|
||||
function update_kuning($headerID) {
|
||||
$sql = "update t_ordersample a
|
||||
join t_ordersample b on a.T_OrderSampleT_OrderHeaderID = b.T_OrderSampleT_OrderHeaderID
|
||||
and a.T_OrderSampleBarcode like '%SK%' and b.T_OrderSampleBarcode like '%SP%'
|
||||
and a.T_OrderSampleIsActive = 'Y' and b.T_OrderSampleIsActive = 'Y'
|
||||
and a.T_OrderSampleT_OrderHeaderID = ?
|
||||
set
|
||||
a.T_OrderSampleWorklistReceive = b.T_OrderSampleWorklistReceive ,
|
||||
a.T_OrderSampleWorklistReceiveDatetime = b.T_OrderSampleWorklistReceiveDatetime ,
|
||||
a.T_OrderSampleWorklistReceiveUserID = b.T_OrderSampleWorklistReceiveUserID
|
||||
";
|
||||
$qry = $this->db->query($sql,array($headerID));
|
||||
if (! $qry) {
|
||||
echo "ERR : \n" ;
|
||||
print_r($this->db->error());
|
||||
exit;
|
||||
}
|
||||
echo "Serum Kuning di update";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user