Files
BE_IBL/application/controllers/v1/su/Checktest.php
2026-04-15 15:23:57 +07:00

253 lines
9.0 KiB
PHP

<?php
class Checktest extends MY_Controller
{
function testing(){
$config['hostname'] = 'https://mobile.pramita.co.id';
$config['username'] = 'admin';
$config['password'] = 'pramita!102938';
$config['database'] = 'onelite';
$config['dbdriver'] = 'mysqli';
$config['dbprefix'] = '';
$config['pconnect'] = FALSE;
$config['db_debug'] = TRUE;
$config['cache_on'] = FALSE;
$config['cachedir'] = '';
$config['char_set'] = 'utf8';
$config['dbcollat'] = 'utf8_general_ci';
$db_now = $this->load->database($config);
if($db_now){
$qry = "SELECT * FROM m_branch";
$array_data = $db_now->query($qry)->result_array();
print_r($array_data);
}else{
echo "error";
}
}
function donow(){
$array_db = array(
'riau',
'pajajaran',
'toha',
'cimahi',
'ngagel',
'aditya',
'jemur',
'mulyo',
'parkus',
'hrm',
'cikditiro',
'sultan_agung',
'matraman',
'bonjer',
'samanhudi',
'ragunan',
'cirebon',
'veteran',
'dahlan',
'plaju',
'diponegoro',
'yamin',
'padang',
'tegal',
'manado',
'pontianak',
'sudirman',
'magelang',
'salatiga',
'semarang',
'balikpapan',
'madiun',
'makasar',
'denpasar',
'tasik',
'dupang',
'wonokusumo',
'tangkuban_perahu',
'ciliwung',
'kediri',
'jember',
'simokerto',
'hertasning',
'tulungagung',
'hasyim'
);
/*$array_db = array(
'riau',
'pajajaran',
'toha',
'cimahi',
'ngagel',
'aditya',
'jemur',
'mulyo',
'parkus',
'hrm',
'matraman',
'bonjer',
'samanhudi',
'ragunan'
);*/
foreach($array_db as $k => $v){
$this->dbx = $this->load->database($v, true);
//$this->dbx->trans_start();
//$this->dbx->trans_strict(FALSE);
//$sql ="UPDATE `s_menu` SET `S_MenuUrl` = 'test/vuex/one-fo-registration-v25'
//WHERE `S_MenuUrl` LIKE '%test/vuex/one-fo-registration-v%'";
//$query = $this->dbx->query($sql);
//$sql="UPDATE m_usergroup SET M_UserGroupDashboard = 'one-ui/test/vuex/one-fo-registration-v25'
//WHERE M_UserGroupDashboard LIKE '%one-ui/test/vuex/one-fo-registration-v%'";
//$query = $this->dbx->query($sql);
$sql = "UPDATE `s_menu` SET `S_MenuUrl` = 'test/vuex/one-fo-cashier-new-payment-v23'
WHERE `S_MenuUrl` LIKE '%test/vuex/one-fo-cashier-new-payment-v%'";
//$query = $this->dbx->query($sql);
$sql="UPDATE m_usergroup SET M_UserGroupDashboard = 'one-ui/test/vuex/one-fo-cashier-new-payment-v23'
WHERE M_UserGroupDashboard LIKE '%one-ui/test/vuex/one-fo-cashier-new-payment-v%'";
//$query = $this->dbx->query($sql);
//$sql ="UPDATE `s_menu` SET `S_MenuUrl` = 'test/vuex/one-md-patient-v5'
//WHERE `S_MenuUrl` LIKE '%test/vuex/one-md-patient-v%'";
//$query = $this->dbx->query($sql);
//$sql="UPDATE m_usergroup SET M_UserGroupDashboard = 'one-ui/test/vuex/one-md-patient-v5'
//WHERE M_UserGroupDashboard LIKE '%one-ui/test/vuex/one-md-patient-v%'";
//$query = $this->dbx->query($sql);
//$sql="UPDATE `s_menu` SET `S_MenuUrl` = 'test/vuex/one-sample-storage-destroy-v4/' WHERE `S_MenuUrl` LIKE '%one-sample-storage-destroy%' ";
//$query = $this->dbx->query($sql);
/*$sql ="CREATE TABLE `m_patientsuspend` (
`M_PatientSuspendID` int(11) NOT NULL AUTO_INCREMENT,
`M_PatientSuspendM_PatientID` int(11) DEFAULT NULL,
`M_PatientSuspendIsActive` char(1) NOT NULL DEFAULT 'Y',
`M_PatientSuspendCreated` datetime DEFAULT NULL,
`M_PatientSuspendCreatedBy` int(11) DEFAULT NULL,
`M_PatientSuspendLastUpdated` datetime DEFAULT NULL,
`M_PatientSuspendUserID` int(11) DEFAULT NULL,
PRIMARY KEY (`M_PatientSuspendID`),
KEY `M_PatientSuspendM_PatientID` (`M_PatientSuspendM_PatientID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;";*/
//$query = $this->dbx->query($sql);
$sql = "CREATE TABLE `t_orderlocationsampling` (
`T_OrderLocationSamplingID` int(11) NOT NULL AUTO_INCREMENT,
`T_OrderLocationSamplingM_LocationID` int(11) DEFAULT NULL,
`T_OrderLocationSamplingT_SamplingStationID` int(11) DEFAULT NULL,
`T_OrderLocationSamplingTotal` int(11) DEFAULT NULL,
`T_OrderLocationSamplingTotalProcess` int(11) DEFAULT NULL,
`T_OrderLocationSamplingTotalWaiting` int(11) DEFAULT NULL,
`T_OrderLocationSamplingJSON` text DEFAULT NULL,
`T_OrderLocationSamplingLastUpdated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`T_OrderLocationSamplingID`),
KEY `T_OrderLocationSamplingM_LocationID` (`T_OrderLocationSamplingM_LocationID`),
KEY `T_OrderLocationSamplingT_SamplingStationID` (`T_OrderLocationSamplingT_SamplingStationID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
";
//$query = $this->dbx->query($sql);
$sql = "CREATE TABLE `antrian_samplestation` (
`AntrianSampleStationID` int(11) NOT NULL AUTO_INCREMENT,
`AntrianSampleStationT_OrderLocationID` int(11) DEFAULT NULL,
`AntrianSampleStationTime` datetime DEFAULT NULL,
`AntrianSampleStationIsActive` char(1) DEFAULT 'Y',
`AntrianSampleStationUserID` int(11) DEFAULT NULL,
`AntrianSampleStationCreated` datetime DEFAULT NULL,
PRIMARY KEY (`AntrianSampleStationID`),
KEY `AntrianSampleStationT_SampleStationID` (`AntrianSampleStationT_OrderLocationID`),
KEY `AntrianSampleStationUserID` (`AntrianSampleStationUserID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
";
//$query = $this->dbx->query($sql);
$sql = "CREATE FUNCTION `fn_sampling_queue_status_name` (`POrderID` int, `PStationID` int) RETURNS varchar(35) CHARACTER SET 'latin1'
READS SQL DATA
BEGIN
DECLARE RST VARCHAR(35);
SET RST = 'New';
SELECT T_SamplingQueueStatusName INTO RST
FROM t_sampling_queue_last_status
JOIN t_sampling_queue_status ON T_SamplingQueueLastStatusT_SamplingQueueStatusID = T_SamplingQueueStatusID
WHERE
T_SamplingQueueLastStatusT_OrderHeaderID = POrderID AND T_SamplingQueueLastStatusT_SampleStationID = PStationID;
RETURN RST;
END;;
";
//$query = $this->dbx->query($sql);
$sql = "UPDATE `mcu_statusresult` SET
`Mcu_StatusResultName` = 'BI_RAD',
`Mcu_StatusResultIsDefault` = 'N',
`Mcu_StatusResultJson` = '[{\"id\":\"BR0\",\"name\":\"BI-RADS 0\"},{\"id\":\"BR1\",\"name\":\"BI-RADS 1\"},{\"id\":\"BR2\",\"name\":\"BI-RADS 2\"},{\"id\":\"BR3\",\"name\":\"BI-RADS 3\"},\r\n{\"id\":\"BR4\",\"name\":\"BI-RADS 4\"},{\"id\":\"BR5\",\"name\":\"BI-RADS 5\"},{\"id\":\"BR6\",\"name\":\"BI-RADS 6\"}]',
`Mcu_StatusResultIsActive` = 'Y',
`Mcu_StatusResultUserID` = '1',
`Mcu_StatusResultCreated` = now(),
`Mcu_StatusResultLastUpdated` = '2022-11-25 11:22:50'
WHERE `Mcu_StatusResultID` = '8';";
//$query = $this->dbx->query($sql);
/*$sql = "UPDATE `mcu_statusresult_value` SET `Mcu_StatusResultValueName` = 'BI-RADS 0' WHERE `Mcu_StatusResultValueCode` = 'BR0'";
$query = $this->dbx->query($sql);
$sql = "UPDATE `mcu_statusresult_value` SET `Mcu_StatusResultValueName` = 'BI-RADS 1' WHERE `Mcu_StatusResultValueCode` = 'BR1'";
$query = $this->dbx->query($sql);
$sql = "UPDATE `mcu_statusresult_value` SET `Mcu_StatusResultValueName` = 'BI-RADS 2' WHERE `Mcu_StatusResultValueCode` = 'BR2'";
$query = $this->dbx->query($sql);
$sql = "UPDATE `mcu_statusresult_value` SET `Mcu_StatusResultValueName` = 'BI-RADS 3' WHERE `Mcu_StatusResultValueCode` = 'BR3'";
$query = $this->dbx->query($sql);
$sql = "UPDATE `mcu_statusresult_value` SET `Mcu_StatusResultValueName` = 'BI-RADS 4' WHERE `Mcu_StatusResultValueCode` = 'BR4'";
$query = $this->dbx->query($sql);
$sql = "UPDATE `mcu_statusresult_value` SET `Mcu_StatusResultValueName` = 'BI-RADS 5' WHERE `Mcu_StatusResultValueCode` = 'BR5'";
$query = $this->dbx->query($sql);
$sql = "UPDATE `mcu_statusresult_value` SET `Mcu_StatusResultValueName` = 'BI-RADS 6' WHERE `Mcu_StatusResultValueCode` = 'BR6'";
$query = $this->dbx->query($sql);*/
/*$sql = "SELECT
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH AS MAX_LENGTH
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 't_packet'
AND COLUMN_NAME = 'T_PacketSasCode'";
$query = $this->dbx->query($sql);
$row_data = $query->row_array();
if($row_data){
if(intval($row_data['MAX_LENGTH']) <> 10){
echo $v." Belum Update";
}
}*/
$sql = "UPDATE `s_menu` SET `S_MenuUrl` = 'test/vuex/one-fo-supervisor-v8/' WHERE `S_MenuName` = 'Supervisor' ; ";
//$query = $this->dbx->query($sql);
$sql = "SELECT COUNT(*) as xcount FROM nat_test_loinc";
//$query = $this->dbx->query($sql);
$sql ="UPDATE `s_menu` SET `S_MenuUrl` = 'test/vuex/one-fo-registration-v26'
WHERE `S_MenuUrl` LIKE '%test/vuex/one-fo-registration-v%'";
//$query = $this->dbx->query($sql);
$sql="UPDATE m_usergroup SET M_UserGroupDashboard = 'one-ui/test/vuex/one-fo-registration-v26'
WHERE M_UserGroupDashboard LIKE '%one-ui/test/vuex/one-fo-registration-v%'";
//$query = $this->dbx->query($sql);
//$this->dbx->trans_complete();
if ($query) {
echo $v."-OK";
}
else{
echo $v."-ERROR ";
}
}
}
}
?>