Initial import

This commit is contained in:
sas.fajri
2026-04-27 10:26:26 +07:00
commit bf9b9097ee
2388 changed files with 3002242 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?php
class Mou extends MY_Controller
{
function __construct() {
parent::__construct();
}
function fix_id($mouID) {
$this->load->library("SsPriceMou");
$rst = $this->sspricemou->create($mouID);
print_r($rst);
echo "\n";
}
function fix_all() {
$this->load->library("SsPriceMouPx");
$sql = "select * from m_mou where M_MouIsActive = 'Y' ";
$qry = $this->db->query($sql);
$rows = $qry->result_array();
foreach($rows as $idx => $r ) {
echo "$idx. Proses : " . $r["M_MouName"] . "\n";
$this->sspricemoupx->create($r["M_MouID"]);
}
}
}

View File

@@ -0,0 +1,23 @@
<?php
class MouPx extends MY_Controller
{
function __construct() {
parent::__construct();
}
function fix_id($mouID) {
$this->load->library("SsPriceMouPx");
$rst = $this->sspricemoupx->create($mouID);
print_r($rst);
echo "\n";
}
function fix_all() {
$this->load->library("SsPriceMouPx");
$sql = "select * from m_mou where M_MouIsActive = 'Y' ";
$qry = $this->db->query($sql);
$rows = $qry->result_array();
foreach($rows as $idx => $r ) {
echo "$idx. Proses : " . $r["M_MouName"] . "\n";
$this->sspricemoupx->create($r["M_MouID"]);
}
}
}

View File

@@ -0,0 +1,49 @@
<?php
class OutgoingRef_v2 extends MY_Controller
{
function __construct() {
parent::__construct();
$this->db = $this->load->database("onedev", true);
}
function debug($no) {
$sql = "select tx_branch_status.*, M_BranchName
from tx_branch_status
join m_branch on TxBranchStatusM_BranchID = M_BranchID
where TxBranchStatusID=?";
$qry = $this->db->query($sql,$no);
if ($qry) {
$rows = $qry->result_array();
foreach($rows as $r) {
$param = $r["TxBranchStatusJson"];
$stage = $r["TxBranchStatusStage"];
$ipAddress = $r["TxBranchStatusM_BranchIP"];
$branchName = $r["M_BranchName"];
$txID = $r["TxBranchStatusID"];
$url = "http://$ipAddress/one-api/tools/xstatusbranch_v2/update";
echo "URL: $url \n";
print_r($param);
//$rst = $this->post($url,$param);
}
} else {
$this->xlog("Err: " . print_r($this->db->error(),true));
}
}
function xlog($message) {
$dt = date("Y-m-d H:i:s");
echo "$dt $message\n";
}
function post($url,$data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data))
);
$result = curl_exec($ch);
return json_decode($result,true);
}
}