Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php set_time_limit(0); ini_set('mysql.connect_timeout', -1); ini_set('default_socket..
Decoded Output download
<?php
set_time_limit(0);
ini_set('mysql.connect_timeout', -1);
ini_set('default_socket_timeout', -1);
ini_set('mysqli.reconnect', 'On');
ini_set("max_execution_time", "-1");
ini_set("max_allowed_packet", "2180M");
ini_set("memory_limit", "-1");
include_once ("utkPosisi.php");
$username_slave = "hva_slave";
$password_slave = "admin@**";
$database_slave = "hva";
$username_offline = "hva_slave";
$password_offline = "admin@**";
$database_offline = "hva_offline";
if ($database_slave == "gaudi") $port_server = '2278';
else $port_server = '2276';
$menit_mulai = date("i");
$jam_duabelas = '12' . ':' . $menit_mulai;
$jam_limabelas = '15' . ':' . $menit_mulai;
if (!file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd")))
{
$isi_q = 'md ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd");
$hasil_system = system($isi_q, $retval);
}
echo "\n";
echo 'Mulai...' . $IpT35;
echo "\n";
if ($database_slave == "bnb" || $database_slave == "hwr") $ip_tes = 'vrimas.ddns.net';
else
{
$ip_tes = '123.100.226.179';
$username_nc9r0up = 'root';
$password_nc9r0up = '3hqF%KGT47^g';
}
echo "\n";
echo $IpT35;
echo "\n";
$xi = 0;
$xi_total = 3;
while (true)
{
$xi++;
echo 'Waiting ...' . str_pad($xi, strlen($xi_total) , "0", STR_PAD_LEFT) . '/' . $xi_total;
echo "\n";
if ($xi >= $xi_total)
{
if (isset($koneksi_slave)) mysqli_close($koneksi_slave);
if (isset($koneksi_offline)) mysqli_close($koneksi_offline);
$koneksi_slave = mysqli_connect($ip_slave, $username_slave, $password_slave, $database_slave) or $err_msg = mysqli_connect_error();
$koneksi_offline = mysqli_connect($ip_offline, $username_offline, $password_offline, $database_offline) or $err_msg = mysqli_connect_error();
if (mysqli_ping($koneksi_offline) && mysqli_ping($koneksi_slave)) break;
}
sleep(1);
}
if (isset($_POST['koneksi' . $database_slave])) mysqli_close($_POST['koneksi' . $database_slave]);
if (isset($_POST['koneksi' . $database_offline])) mysqli_close($_POST['koneksi' . $database_offline]);
$_POST['koneksi' . $database_slave] = mysqli_connect($ip_slave, $username_slave, $password_slave, $database_slave) or $err_msg = mysqli_connect_error();
$_POST['koneksi' . $database_offline] = mysqli_connect($ip_offline, $username_offline, $password_offline, $database_offline) or $err_msg = mysqli_connect_error();
mysqli_autocommit($_POST['koneksi' . $database_slave], false);
mysqli_autocommit($_POST['koneksi' . $database_offline], false);
$id_file = strtolower($database) . (date("dYm") + 9032202);
echo "\n";
echo $id_file;
echo "\n";
$ORDINAL_POSITION_transferouth_edit_time = 0;
$sql_kcu = "SELECT ORDINAL_POSITION FROM information_schema.KEY_COLUMN_USAGE WHERE CONSTRAINT_SCHEMA = '" . $database_offline . "' AND TABLE_NAME = 'transferouth_header' AND COLUMN_NAME = 'transferouth_edit_time';";
$result_kcu = mysqli_query($_POST['koneksi' . $database_offline], $sql_kcu) or $err_msg = mysqli_error($_POST['koneksi' . $database_offline]);
while ($row_kcu = mysqli_fetch_array($result_kcu, MYSQLI_ASSOC))
{
$ORDINAL_POSITION_transferouth_edit_time = $row_kcu['ORDINAL_POSITION'];
}
mysqli_free_result($result_kcu);
if ($ORDINAL_POSITION_transferouth_edit_time == 0)
{
$query_altertable = "ALTER TABLE " . $database_offline . ".transferouth_header DROP INDEX transferouth_ReferenceNo, ADD UNIQUE INDEX transferouth_ReferenceNo (transferouth_ReferenceNo, transferouth_create_user, transferouth_edit_time, transferouth_ip, transferouth__dihapus_time, transferouth_create_time); ";
mysqli_query($_POST['koneksi' . $database_offline], $query_altertable) or $err_msg = mysqli_error($_POST['koneksi' . $database_offline]);
mysqli_commit($_POST['koneksi' . $database_offline]);
}
$ORDINAL_POSITION_salesmand_edit_time = 0;
$sql_kcu = "SELECT ORDINAL_POSITION FROM information_schema.KEY_COLUMN_USAGE WHERE CONSTRAINT_SCHEMA = '" . $database_slave . "' AND TABLE_NAME = 'salesmand_detail' AND COLUMN_NAME = 'salesmand_edit_time';";
$result_kcu = mysqli_query($_POST['koneksi' . $database_slave], $sql_kcu) or $err_msg = mysqli_error($_POST['koneksi' . $database_slave]);
while ($row_kcu = mysqli_fetch_array($result_kcu, MYSQLI_ASSOC))
{
$ORDINAL_POSITION_salesmand_edit_time = $row_kcu['ORDINAL_POSITION'];
}
mysqli_free_result($result_kcu);
if ($ORDINAL_POSITION_salesmand_edit_time == 0)
{
$query_altertable = "ALTER TABLE salesmand_detail DROP INDEX salesmand_idx, ADD UNIQUE INDEX salesmand_idx (salesmand_SalesmanContactCd, salesmand_LocationCd, salesmand_edit_time, salesmand__dihapus_time);";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $err_msg = mysqli_error($_POST['koneksi' . $database_slave]);
mysqli_commit($_POST['koneksi' . $database_slave]);
}
$ORDINAL_POSITION_contact_code_vd = 0;
$sql_kcu = "SELECT ORDINAL_POSITION FROM information_schema.KEY_COLUMN_USAGE WHERE CONSTRAINT_SCHEMA = '" . $database_slave . "' AND TABLE_NAME = 'contact_mstr' AND COLUMN_NAME = 'contact_code_vd';";
$result_kcu = mysqli_query($_POST['koneksi' . $database_slave], $sql_kcu) or $err_msg = mysqli_error($_POST['koneksi' . $database_slave]);
while ($row_kcu = mysqli_fetch_array($result_kcu, MYSQLI_ASSOC))
{
$ORDINAL_POSITION_contact_code_vd = $row_kcu['ORDINAL_POSITION'];
}
mysqli_free_result($result_kcu);
if ($ORDINAL_POSITION_contact_code_vd == 0)
{
$query_altertable = "TRUNCATE TABLE contact_mstr;";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $err_msg = mysqli_error($_POST['koneksi' . $database_slave]);
$query_altertable = "ALTER TABLE contact_mstr DROP INDEX contact_ContactName, ADD UNIQUE INDEX contact_ContactName (contact_ContactName, contact_code_vd, contact_create_user, contact_create_time, contact__dihapus_time, contact_BirthPlaceCityCd, contact_BirthDate, contact_Owner, contact_Supplier, contact_Customer, contact_Employee);";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $err_msg = mysqli_error($_POST['koneksi' . $database_slave]);
mysqli_commit($_POST['koneksi' . $database_slave]);
}
$tidak_ada_contact_BirthDateMom = '';
$sql_koneksi = "SELECT contact_ContactNameMom FROM contact_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_slave], $sql_koneksi) or $tidak_ada_contact_BirthDateMom = mysqli_error($_POST['koneksi' . $database_slave]);
if ($tidak_ada_contact_BirthDateMom != '')
{
$query_altertable = "ALTER TABLE `contact_mstr` ADD COLUMN `contact_ContactNameMom` VARCHAR(200) NULL;";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $tidak_ada_contact_BirthDateMom = mysqli_error($_POST['koneksi' . $database_slave]);
mysqli_commit($_POST['koneksi' . $database_slave]);
}
$tidak_ada_online_Date = '';
$sql_koneksi = "SELECT contact_BirthDateMom FROM contact_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_slave], $sql_koneksi) or $tidak_ada_online_Date = mysqli_error($_POST['koneksi' . $database_slave]);
if ($tidak_ada_online_Date != '')
{
$query_altertable = "ALTER TABLE `contact_mstr` ADD COLUMN `contact_BirthDateMom` DATE DEFAULT '1900-01-01' NULL; ";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $tidak_ada_online_Date = mysqli_error($_POST['koneksi' . $database_slave]);
mysqli_commit($_POST['koneksi' . $database_slave]);
}
$tidak_ada_online_status = '';
$sql_koneksi = "SELECT online_status FROM online_tab limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_offline], $sql_koneksi) or $tidak_ada_online_status = mysqli_error($_POST['koneksi' . $database_offline]);
if ($tidak_ada_online_status != '')
{
$query_altertable = "ALTER TABLE `online_tab` ADD COLUMN `online_status` VARCHAR(50) NULL;";
mysqli_query($_POST['koneksi' . $database_offline], $query_altertable) or $tidak_ada_online_status = mysqli_error($_POST['koneksi' . $database_offline]);
mysqli_commit($_POST['koneksi' . $database_offline]);
}
$tidak_ada_online_user = '';
$sql_koneksi = "SELECT online_user FROM online_tab limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_offline], $sql_koneksi) or $tidak_ada_online_user = mysqli_error($_POST['koneksi' . $database_offline]);
if ($tidak_ada_online_user != '')
{
$query_altertable = "ALTER TABLE `online_tab` ADD COLUMN `online_user` VARCHAR(200) NULL; ";
mysqli_query($_POST['koneksi' . $database_offline], $query_altertable) or $tidak_ada_online_user = mysqli_error($_POST['koneksi' . $database_offline]);
mysqli_commit($_POST['koneksi' . $database_offline]);
}
$tidak_ada_online_ID = '';
$sql_koneksi = "SELECT online_ID FROM online_tab limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_offline], $sql_koneksi) or $tidak_ada_online_ID = mysqli_error($_POST['koneksi' . $database_offline]);
if ($tidak_ada_online_ID != '')
{
$query_altertable = "ALTER TABLE `online_tab` ADD COLUMN `online_ID` VARCHAR(48) NULL; ";
mysqli_query($_POST['koneksi' . $database_offline], $query_altertable) or $tidak_ada_online_ID = mysqli_error($_POST['koneksi' . $database_offline]);
mysqli_commit($_POST['koneksi' . $database_offline]);
}
$tidak_ada_online_Date = '';
$sql_koneksi = "SELECT online_Date FROM online_tab limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_offline], $sql_koneksi) or $tidak_ada_online_Date = mysqli_error($_POST['koneksi' . $database_offline]);
if ($tidak_ada_online_Date != '')
{
$query_altertable = "ALTER TABLE `online_tab` ADD COLUMN `online_Date` DATE DEFAULT '1900-01-01' NULL; ";
mysqli_query($_POST['koneksi' . $database_offline], $query_altertable) or $tidak_ada_online_Date = mysqli_error($_POST['koneksi' . $database_offline]);
mysqli_commit($_POST['koneksi' . $database_offline]);
}
if ($database_slave == "bnb" || $database_slave == "hwr") $ip_publik = 'vrimas.ddns.net';
else $ip_publik = 'grimas.ddns.net';
echo "\n";
echo $ip_publik;
$P455300RD = date("dY") + 201610370708;
//mulai
while (true)
{
$toko = '';
$LocationCd = '';
$LocationName = '';
$user_pos_loc = 0;
if (isset($koneksi_slave)) mysqli_close($koneksi_slave);
if (isset($koneksi_offline)) mysqli_close($koneksi_offline);
$koneksi_slave = mysqli_connect($ip_slave, $username_slave, $password_slave, $database_slave) or $err_msg = mysqli_connect_error();
$koneksi_offline = mysqli_connect($ip_offline, $username_offline, $password_offline, $database_offline) or $err_msg = mysqli_connect_error();
if (mysqli_ping($koneksi_offline) && mysqli_ping($koneksi_slave))
{
$sql = "SELECT _user_pos_loc, _user_MachineName, _user_ip
FROM _user_mstr where _user_pos_loc > 0 ORDER BY _user_mstrID DESC";
$result = mysqli_query($koneksi_offline, $sql) or $err_msg = mysqli_error($koneksi_offline);
echo "\n";
echo $err_msg . ' ==>' . $sql;
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
$user_pos_loc = $row['_user_pos_loc'];
$user_IPAddress = $row['_user_ip'];
$user_MachineName = $row['_user_MachineName'];
$computerassignd_DBTypeCd = '';
$computerassignd_LocationCd = 'computerassignd_LocationCd';
$sql_loc = "SELECT loc_LocationCd, loc_LocationName, loc_LocationInitial FROM loc_mstr where loc_mstrID = " . $user_pos_loc;
$result_loc = mysqli_query($koneksi_slave, $sql_loc) or $err_msg = mysqli_error($koneksi_slave);
while ($row_loc = mysqli_fetch_array($result_loc, MYSQLI_ASSOC))
{
if (!file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd")))
{
$isi_q = 'md ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd");
$hasil_system = system($isi_q, $retval);
}
$iplokalstore = '';
$isi_q = 'ipconfig > ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd") . '\\iplokal.txt';
$hasil_system = system($isi_q, $retval);
if (file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd") . '\\iplokal.txt'))
{
$file = fopen(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd") . '\\iplokal.txt', "r");
$sudah_LAN_adapter_Local_Area_Connection = 'No';
while (!feof($file))
{
$baris_ke++;
$line = trim(fgets($file));
if (strpos($line, 'Local Area Connection') !== false) $sudah_LAN_adapter_Local_Area_Connection = 'Yes';
//if ($sudah_LAN_adapter_Local_Area_Connection == 'Yes' && substr($line,0,45)== 'IPv4 Address. . . . . . . . . . . : 192.168.1') $iplokalstore = substr($line,36);
if (substr($line, 0, 44) == 'IPv4 Address. . . . . . . . . . . : 192.168.') $iplokalstore = substr($line, 36);
}
fclose($file);
}
//if (date("Y-m-d") == '2018-10-28' && $iplokalstore == '192.168.100.2'){
//$user_IPAddress='127.0.0.1';
//testing
//$user_MachineName='HVMB-ONEPRICE';
//testing
//$user_pos_loc=64;
//testing
//}
echo "\n";
echo 'iplokalstore==>' . $iplokalstore . ' user_MachineName==>' . $user_MachineName;
echo "\n";
$toko = $row_loc['loc_LocationInitial'];
$LocationCd = $row_loc['loc_LocationCd'];
$LocationName = $row_loc['loc_LocationName'];
$url = 'http://' . $ip_publik . ':176/Compu7erass1gnD_C3k.php';
array_splice($data_Compu7erass1gnDxyz, 0, count($data_Compu7erass1gnDxyz));
$data_Compu7erass1gnDxyz[] = array(
"D4tab453" => $database,
"P455300RD" => $P455300RD,
"user_pos_loc" => $user_pos_loc,
"user_IPAddress" => $user_IPAddress,
"user_MachineName" => $user_MachineName,
"iplokalstore" => $iplokalstore
);
$ch = curl_init($url);
$data_string = urlencode(json_encode($data_Compu7erass1gnDxyz));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"OrderOnline" => $data_string
));
curl_setopt($ch, CURLOPT_TIMEOUT, 50000);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 50000);
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 50000);
$data_Compu7erass1gnD = curl_exec($ch);
$asObjects = json_decode($data_Compu7erass1gnD, true);
$computerassignd_LocationCd = $asObjects['data_Compu7erass1gnD'][0]['computerassignd_LocationCd'];
$computerassignd_DBTypeCd = $asObjects['data_Compu7erass1gnD'][0]['computerassignd_DBTypeCd'];
curl_close($ch);
echo "\n";
echo $err_msg . ' ==>' . $data_Compu7erass1gnD;
sleep(1);
}
mysqli_free_result($result_loc);
echo "\n";
echo $user_MachineName;
echo "\n";
$laptop_yanto = 'No';
if ($user_MachineName == 'LAPTOP-CS8OEIPP' && date('Y-m-d') >= '2018-10-28')
{
$laptop_yanto = 'Yes';
//$computerassignd_LocationCd='G50';
}
//yanto
//echo "\n";
//echo $err_msg . ' ==>laptop_yanto=' . $laptop_yanto . ' ==>' . $computerassignd_LocationCd;
//sleep(30);
if ($computerassignd_LocationCd != 'computerassignd_LocationCd') break;
}
mysqli_free_result($result);
}
if ($user_pos_loc == '') $user_pos_loc = 0;
if ($user_pos_loc > 0) break;
else sleep(1);
}
echo "\n";
echo $database . ' ==>' . $P455300RD . ' ==>' . $user_pos_loc . ' ==>' . $user_IPAddress . ' ==>' . $user_MachineName . ' ==>' . $computerassignd_LocationCd;
//echo "\n";
//sleep(3000);
if ($database == 'BNB' || $database == 'HWR')
{
$PORT_H0 = '3376';
$IP_H0 = $ip_publik;
$username_H0 = 'rim45hwbnb';
$password_H0 = '201809r730DBhwbnb';
}
else if ($database == 'gaudi')
{
$PORT_H0 = '3308';
$IP_H0 = $ip_publik;
$username_H0 = 'newgaudi';
$password_H0 = 'f4shiongaudi';
}
else
{
$PORT_H0 = '3306';
$IP_H0 = $ip_publik;
$username_H0 = 'nanat73n';
$password_H0 = '201409201444n4n4tren5group';
}
$ulang_ke = 0;
while (true)
{
echo "\n";
echo 'xyzXXX' . $err_msg;
echo "\n";
$hari_ini = date('Y-m-d');
$tujuh_hari_lalu = date('Y-m-d', strtotime("$hari_ini -7 day"));
$lewatBiznet = 'No';
//if ($computerassignd_LocationCd == 'G40') $lewatBiznet = 'Yes';
//else $lewatBiznet = 'No';
if (isset($koneksi_public)) mysqli_close($koneksi_public);
if (isset($koneksi_offline)) mysqli_close($koneksi_offline);
if (isset($koneksi_slave)) mysqli_close($koneksi_slave);
$koneksi_slave = mysqli_connect($ip_slave, $username_slave, $password_slave, $database_slave) or $err_msg = mysqli_connect_error();
$koneksi_offline = mysqli_connect($ip_offline, $username_offline, $password_offline, $database_offline) or $err_msg = mysqli_connect_error();
if ($database == "BNB" || $database == "HWR") $koneksi_public = mysqli_connect($ip_tes, $username, $password, $database, 3376) or $err_msg = mysqli_connect_error();
else $koneksi_public = mysqli_connect($ip_tes, $username_nc9r0up, $password_nc9r0up, $databas_nc9r0upe) or $err_msg = mysqli_connect_error();
if (mysqli_ping($koneksi_offline) && mysqli_ping($koneksi_public) && $laptop_yanto == 'No')
{
$dir_tmp = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
if (!file_exists($dir_tmp)) mkdir($dir_tmp, 0777);
$dir_edit_structure = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure';
if (!file_exists($dir_edit_structure)) mkdir($dir_edit_structure, 0777);
$online_tabID = 0;
$online_time = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT online_tabID, online_time FROM online_tab force index (online_table) where online_table = 'strdboffline_tab'";
$result_koneksi = mysqli_query($koneksi_offline, $sql_koneksi);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$online_tabID = $row_koneksi['online_tabID'];
$online_time = $row_koneksi['online_time'];
}
mysqli_free_result($result_koneksi);
$sql_online = "SELECT * FROM strdboffline_tab
where strdboffline_Brand = '" . $database_slave . "' and
strdboffline_LastUpdateStamp >= '" . $tujuh_hari_lalu . "' and
strdboffline_LastUpdateStamp > '" . $online_time . "'
order by strdboffline_Brand, strdboffline_LastUpdateStamp";
$result_online = mysqli_query($koneksi_public, $sql_online) or $err_msg = mysqli_error($koneksi_public);
while ($row_online = mysqli_fetch_array($result_online, MYSQLI_ASSOC))
{
if ($row_online['strdboffline_file'] != 'phpqrcode-master.php.zip' || ($row_online['strdboffline_file'] == 'phpqrcode-master.php.zip' && !file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\phpqrcode-master')))
{
$strdboffline_tabID = $row_online['strdboffline_tabID'];
if (strpos($row_online['strdboffline_file'], '.sqlG') !== false)
{
//contohnya strdboffline_file isinya 201209111157
if (substr($row_online['strdboffline_file'], 0, 1) < 5 && strpos($row_online['strdboffline_file'], '.sql' . $computerassignd_LocationCd) !== false)
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\';
$hasil_system = system($isi_q, $retval);
$isi_q = 'copy ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".zip", "", $row_online['strdboffline_file']) . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\';
$hasil_system = system($isi_q, $retval);
if (substr($row_online['strdboffline_file'], 0, 1) == 1 || substr($row_online['strdboffline_file'], 0, 1) == 3)
{
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\mysql\\bin\\mysql -u root -p' . $password_root . ' ' . $database_offline . ' < ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
}
if (substr($row_online['strdboffline_file'], 0, 1) == 2 || substr($row_online['strdboffline_file'], 0, 1) == 3)
{
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\mysql\\bin\\mysql -u root -p' . $password_root . ' ' . $database_slave . ' < ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
}
echo 'Get Structure... --- ' . str_replace(".zip", "", $row_online['strdboffline_file']);
echo "\n";
//}
}
}
else if (substr($row_online['strdboffline_file'], 0, 1) < 5 && is_numeric(str_replace(".sql.zip", "", $row_online['strdboffline_file'])))
{
//contohnya strdboffline_file isinya 201209111157
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\';
$hasil_system = system($isi_q, $retval);
$isi_q = 'copy ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".zip", "", $row_online['strdboffline_file']) . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\';
$hasil_system = system($isi_q, $retval);
if (substr($row_online['strdboffline_file'], 0, 1) == 1 || substr($row_online['strdboffline_file'], 0, 1) == 3)
{
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\mysql\\bin\\mysql -u root -p' . $password_root . ' ' . $database_offline . ' < ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
}
if (substr($row_online['strdboffline_file'], 0, 1) == 2 || substr($row_online['strdboffline_file'], 0, 1) == 3)
{
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\mysql\\bin\\mysql -u root -p' . $password_root . ' ' . $database_slave . ' < ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
}
echo 'Get Structure... --- ' . str_replace(".zip", "", $row_online['strdboffline_file']);
echo "\n";
//}
}
//////////////////////////////
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 11) == 'hva.script.')
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\script\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 11));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\script\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 11));
echo "\n";
//}
}
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 13) == 'hva.termasuk.')
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\termasuk\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 13));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\termasuk\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 13));
echo "\n";
//}
}
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 4) == 'hva.' && strpos($row_online['strdboffline_file'], '.php.zip') !== false)
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 4));
echo 'Cek... --- ' . $isi_q;
echo "\n";
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\';
echo 'Cek... --- ' . $isi_q;
echo "\n";
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 4));
echo "\n";
//}
}
///////////////////////////////////////
else if (substr($row_online['strdboffline_file'], 0, 14) == 'opname.script.')
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\script\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 14));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\script\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 14));
echo "\n";
//}
}
else if (substr($row_online['strdboffline_file'], 0, 16) == 'opname.termasuk.')
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\termasuk\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 16));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\termasuk\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 16));
echo "\n";
//}
}
else if (substr($row_online['strdboffline_file'], 0, 7) == 'opname.' && strpos($row_online['strdboffline_file'], '.php.zip') !== false)
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 7));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\';
echo 'Cek... --- ' . $isi_q;
echo "\n";
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 7));
echo "\n";
//}
}
///////////////////////////////////////
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 14) == 'hva.opname.script.')
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\opname\\script\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 18));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\opname\\script\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 18));
echo "\n";
//}
}
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 16) == 'hva.opname.termasuk.')
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\opname\\termasuk\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 20));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\opname\\termasuk\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 20));
echo "\n";
//}
}
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 7) == 'hva.opname.' && strpos($row_online['strdboffline_file'], '.php.zip') !== false)
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\opname\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 11));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\';
echo 'Cek... --- ' . $isi_q;
echo "\n";
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 11));
echo "\n";
//}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
else if (substr($row_online['strdboffline_file'], 0, 7) == 'script.')
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\script\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 7));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\script\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 7));
echo "\n";
//}
}
else if (substr($row_online['strdboffline_file'], 0, 9) == 'termasuk.')
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\termasuk\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 9));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\termasuk\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 9));
echo "\n";
//}
}
else if (strpos($row_online['strdboffline_file'], '.php.zip') !== false)
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".php.zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\';
echo 'Cek... --- ' . $isi_q;
echo "\n";
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", $row_online['strdboffline_file']);
echo "\n";
//}
}
if ($err_msg == '')
{
if ($online_tabID == 0)
{
$sql_insert = "INSERT INTO online_tab SET online_time = '" . $row_online['strdboffline_LastUpdateStamp'] . "', online_table = 'strdboffline_tab'";
mysqli_query($koneksi_offline, $sql_insert) or $err_msg = mysqli_error($koneksi_offline);
$sql_koneksi = "SELECT online_tabID, online_time FROM online_tab force index (online_table) where online_table = 'strdboffline_tab'";
$result_koneksi = mysqli_query($koneksi_offline, $sql_koneksi);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$online_tabID = $row_koneksi['online_tabID'];
}
mysqli_free_result($result_koneksi);
}
else
{
$sql_update = "UPDATE online_tab SET online_time = '" . $row_online['strdboffline_LastUpdateStamp'] . "' where online_tabID = " . $online_tabID;
mysqli_query($koneksi_offline, $sql_update) or $err_msg = mysqli_error($koneksi_offline);
}
}
if ($err_msg == '') mysqli_commit($koneksi_offline);
else
{
mysqli_rollback($koneksi_offline);
echo 'Proses Syncronize to HO gagal, Silahkan Hubungi Administrator...' . $err_msg . ' --- ' . $sql_insert . $sql_update;
break;
}
}
}
mysqli_free_result($result_online);
}
echo "\n";
echo 'xyzAAA' . $err_msg;
echo "\n";
if (isset($_POST['koneksi' . $database_slave])) mysqli_close($_POST['koneksi' . $database_slave]);
if (isset($_POST['koneksi' . $database_offline])) mysqli_close($_POST['koneksi' . $database_offline]);
$_POST['koneksi' . $database_slave] = mysqli_connect($ip_slave, $username_slave, $password_slave, $database_slave) or $err_msg = mysqli_connect_error();
$_POST['koneksi' . $database_offline] = mysqli_connect($ip_offline, $username_offline, $password_offline, $database_offline) or $err_msg = mysqli_connect_error();
mysqli_autocommit($_POST['koneksi' . $database_slave], false);
mysqli_autocommit($_POST['koneksi' . $database_offline], false);
//echo "\n";
// echo 'xyzBBB' . $err_msg;
//echo "\n";
$tidak_ada_add_Jabatan = '';
$sql_koneksi = "SELECT add_Jabatan FROM add_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_slave], $sql_koneksi) or $tidak_ada_add_Jabatan = mysqli_error($_POST['koneksi' . $database_slave]);
if ($tidak_ada_add_Jabatan != '')
{
$query_altertable = "ALTER TABLE add_mstr ADD COLUMN add_Jabatan VARCHAR(100) NULL;";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $tidak_ada_add_Jabatan = mysqli_error($_POST['koneksi' . $database_slave]);
mysqli_commit($_POST['koneksi' . $database_slave]);
}
//echo "\n";
// echo 'xyzCCC' . $err_msg;
//echo "\n";
echo '=>Selesai cek dulu 111...' . $err_msg;
echo "\n";
//sleep(30000);
//exit;
for ($table_ke = 1;$table_ke <= 51;$table_ke++)
{
if ($table_ke == 1)
{
$t4973 = 'kuncitoko_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 2)
{
$t4973 = 'itemsku_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 3)
{
$t4973 = 'prosesbg_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 4)
{
$t4973 = 'acc_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
if ($database == 'gaudi') $server_db = $database;
else $server_db = 'nana-tren';
}
else if ($table_ke == 5)
{
$t4973 = 'promotiond_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 6)
{
$t4973 = 'promotionh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 7)
{
$t4973 = 'promogroup1_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 8)
{
$t4973 = 'promotionl_location';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 9)
{
$t4973 = 'sellprice_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " sellprice_PLNo = 1 ";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 10)
{
$t4973 = 'barcode_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 11)
{
$t4973 = 'productitem_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 12)
{
$t4973 = 'voucherd_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 13)
{
$t4973 = 'voucherh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 14)
{
$t4973 = 'add_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 15)
{
$t4973 = 'stockadjh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 16)
{
$t4973 = 'transferh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " transferh_Fromloc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 17)
{
$t4973 = 'transferd_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " transferd_Fromloc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 18)
{
$t4973 = 'transferoutd_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " ( transferoutd_Fromloc_mstrID = " . $user_pos_loc . " or transferoutd_Toloc_mstrID = " . $user_pos_loc . ") ";
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 19)
{
$t4973 = 'transferouth_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " ( transferouth_Fromloc_mstrID = " . $user_pos_loc . " or transferouth_Toloc_mstrID = " . $user_pos_loc . ") ";
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 20)
{
$t4973 = 'transferind_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " transferind_loc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 21)
{
$t4973 = 'transferinh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " transferinh_loc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 22)
{
$t4973 = 'bankmap_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 23)
{
$t4973 = 'group1_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 24)
{
$t4973 = 'pricesp_tbl';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 25)
{
$t4973 = 'paymentmaptoedc_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
if ($database == 'bnb') $filter_sql = "";
else $filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 26)
{
$t4973 = 'salesmand_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 27)
{
$t4973 = 'salesmanh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 28)
{
$t4973 = 'computerassignd_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 29)
{
$t4973 = 'brand_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 30)
{
$t4973 = 'struck_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 31)
{
$t4973 = 'pos_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 32)
{
$t4973 = 'subprogram_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 33)
{
$t4973 = 'plistassign_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 34)
{
$t4973 = 'stockrunning_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " stockrunning_loc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
if ($database == 'gaudi') $server_db = $database . $computerassignd_LocationCd;
else $server_db = $computerassignd_LocationCd;
}
else if ($table_ke == 35)
{
$t4973 = 'stockadjd_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " stockadjd_loc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 36)
{
$t4973 = 'monthendclosing_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " monthendclosing_loc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
if ($database == 'gaudi') $server_db = $database . $computerassignd_LocationCd;
else $server_db = $computerassignd_LocationCd;
}
else if ($table_ke == 37)
{
$t4973 = 'discount_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 38)
{
$t4973 = 'edc_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 39)
{
$t4973 = 'edcassign_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 40)
{
$t4973 = 'userassign_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 41)
{
$t4973 = 'membert_type';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 42)
{
$t4973 = 'contact_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 43)
{
$t4973 = 'hjbarud_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 44)
{
$t4973 = 'returartikel_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 45)
{
$t4973 = 'sodexo_authorization';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 46)
{
$t4973 = 'rebranding_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 47)
{
$t4973 = 'appf_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 48)
{
$t4973 = 'app_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 49)
{
$t4973 = 'loc_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 50)
{
$t4973 = 'member_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 51 && ($computerassignd_LocationCd == 'BNB0001' || $computerassignd_LocationCd == 'BNB0012'))
{
$t4973 = 'var2_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_offline;
$server_db = $database;
}
$TABLE_NAME = '';
$sql_cektable = "SELECT TABLE_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . $koneksi_db . "' AND TABLE_NAME = '" . $t4973 . "' limit 1;";
$result_cektable = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_cektable) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_cektable = mysqli_fetch_array($result_cektable, MYSQLI_ASSOC))
{
$TABLE_NAME = $row_cektable['TABLE_NAME'];
}
mysqli_free_result($result_cektable);
if ($TABLE_NAME == '')
{
if (!file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd")))
{
$isi_q = 'md ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd");
$hasil_system = system($isi_q, $retval);
}
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $t4973 . '_str.sql';
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $t4973 . '_str.sql ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$output_filename = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $t4973 . '_str.sql';
$mulai_baca = 'No';
$isi_filename = '';
$handle = fopen($output_filename, "r");
if ($handle)
{
while (($line = fgets($handle)) !== false)
{
if (strpos($line, "CREATE TABLE") !== false || $mulai_baca == 'Yes')
{
$mulai_baca = 'Yes';
$isi_filename .= $line;
if (strpos($line, "ENGINE") !== false) break;
}
}
fclose($handle);
}
if ($TABLE_NAME == '')
{
mysqli_query($_POST['koneksi' . $koneksi_db], $isi_filename) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg == '') mysqli_commit($_POST['koneksi' . $koneksi_db]);
else mysqli_rollback($_POST['koneksi' . $koneksi_db]);
}
echo "\n";
echo $err_msg;
echo "\n";
echo $isi_filename;
echo "\n";
}
$tidak_ada_member_tgl_lahir = '';
$sql_koneksi = "SELECT member_tgl_lahir FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_tgl_lahir = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_tgl_lahir != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_tgl_lahir DATE DEFAULT '1900-01-01' NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_tgl_lahir = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_Whatsapp = '';
$sql_koneksi = "SELECT member_Whatsapp FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_Whatsapp = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_Whatsapp != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_Whatsapp VARCHAR(40) NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_Whatsapp = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_email = '';
$sql_koneksi = "SELECT member_email FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_email = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_email != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_email VARCHAR(200) NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_email = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_nama = '';
$sql_koneksi = "SELECT member_nama FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_nama = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_nama != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_nama VARCHAR(200) NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_nama = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_password = '';
$sql_koneksi = "SELECT member_password FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_password = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_password != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_password VARCHAR(50) NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_password = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_email_cek = '';
$sql_koneksi = "SELECT member_email_cek FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_email_cek = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_email_cek != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_email_cek ENUM('No','Yes','DNS','Valid','Send','Invalid') DEFAULT 'No' NULL COMMENT 'No -> Belum Cek; Yes -> Sudah Cek tidak Valid; Valid -> Sudah Cek dan Valid; Send -> if (member_email_lama <> member_email_api) {sudan kirim email belum cek di tolak atau belum} else {sudan kirim email atau cek API tidak di tolak}; Invalid -> Sudah kirim email atau cek API di tolak;';";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_email_cek = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_email_lama = '';
$sql_koneksi = "SELECT member_email_lama FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_email_lama = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_email_lama != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_email_lama VARCHAR(200) NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_email_lama = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_email_api = '';
$sql_koneksi = "SELECT member_email_api FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_email_api = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_email_api != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_email_api VARCHAR(200) NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_email_api = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
echo "\n";
echo 'Mulai...' . $err_msg;
echo "\n";
if ($database_slave == "bnb" || $database_slave == "hwr") $url = 'http://vrimas.ddns.net:176/C3kmodifiedNukuran_20181231.php';
else if ($database_slave == "hva") $url = 'http://grimas.ddns.net:176/C3kmodifiedNukuran_20181231.php';
else $url = 'http://grimas.ddns.net:178/C3kmodifiedNukuran_20181231.php';
array_splice($data_t4973xyz, 0, count($data_t4973xyz));
$data_t4973xyz[] = array(
"D4tab453" => $database,
"computerassignd_LocationCd" => $computerassignd_LocationCd,
"t4973" => $t4973
);
$ch = curl_init($url);
$data_string = urlencode(json_encode($data_t4973xyz));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"OrderOnline" => $data_string
));
curl_setopt($ch, CURLOPT_TIMEOUT, 50000);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 50000);
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 50000);
$data_t4973 = curl_exec($ch);
$asObjects = json_decode($data_t4973, true);
$filesize_server = $asObjects['data_t4973'][0]['filesize'];
$filemtime_server = $asObjects['data_t4973'][0]['filemtime'];
$filesize_dump = $asObjects['data_t4973'][0]['filesize_dump'];
$filemtime_dump = $asObjects['data_t4973'][0]['filemtime_dump'];
curl_close($ch);
//data_Compu7erass1gnD menjadi
echo "\n";
echo ' D4tab453=>' . $database . ' computerassignd_LocationCd=>' . $computerassignd_LocationCd . ' t4973=>' . $t4973;
//echo "\n";
//echo $data_t4973;
//echo "\n";
//echo $t4973 . ' ==>filesize_dump=' . $filesize_dump . ' != && filemtime_dump= ' . $filemtime_dump;
//echo "\n";
//sleep(3000);
$proses = 'No';
$proses_LastUpdateStamp = 'No';
$online_tabID = 0;
$sql_koneksi = "SELECT online_tabID, online_ID, online_headerID
FROM online_tab where online_status = 'Dump' and online_table = '" . $t4973 . "'";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_offline], $sql_koneksi);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$online_tabID = $row_koneksi['online_tabID'];
$online_ID = $row_koneksi['online_ID'];
$online_headerID = $row_koneksi['online_headerID'];
}
mysqli_free_result($result_koneksi);
//if ($t4973=='loc_mstr'){
//if ($filesize_server != '' && $filemtime_server != ''){
// echo "\n";
//echo 'Benar tidak Blank...';
//echo "\n";
//echo "\n";
// echo 'online_ID - filemtime_server = ' . ($online_ID - $filemtime_server);
//echo "\n";
//echo "\n";
// echo $online_ID . ' ==>' . 'online_ID';
//echo "\n";
//echo "\n";
// echo $filemtime_server . ' ==>' . 'filemtime_server';
//echo "\n";
//echo "\n";
// echo 'online_headerID - filesize_server = ' . ($online_headerID - $filesize_server);
// echo "\n";
// echo "\n";
// echo $online_headerID . ' ==>' . 'online_headerID';
//echo "\n";
//echo "\n";
//echo $filesize_server . ' ==>' . 'filesize_server';
//echo "\n";
//sleep(2);
//}
//if (($online_ID != $filemtime_server || $online_headerID != $filesize_server)){
//echo "\n";
//echo 'Benar BEDA...' . $online_ID . ' != ' . $filemtime_server . ' || ' . $online_headerID . ' != ' . $filesize_server;
//echo "\n";
//sleep(2);
//}
//echo "\n";
//echo 'SELESAI...';
//echo "\n";
//sleep(20);
//}
if ($online_tabID == 0 && $filesize_server != '' && $filemtime_server != '')
{
$proses = 'Yes';
$sql_insert = "INSERT INTO online_tab SET
online_status = 'Dump',
online_headerID = " . $filesize_server . ",
online_ID = '" . $filemtime_server . "',
online_table = '" . $t4973 . "'";
mysqli_query($_POST['koneksi' . $database_offline], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $database_offline]);
//if ($t4973=='loc_mstr'){
//echo "\n";
//echo $err_msg . ' ==>proses='. $proses . ' ==>' . $sql_insert;
//echo "\n";
//sleep(5);
//}
}
else if ($filesize_server != '' && $filemtime_server != '' && ($online_ID != $filemtime_server || $online_headerID != $filesize_server))
{
$proses = 'Yes';
$sql_insert = "UPDATE online_tab SET
online_headerID = " . $filesize_server . ",
online_ID = '" . $filemtime_server . "'
where online_tabID = " . $online_tabID;
mysqli_query($_POST['koneksi' . $database_offline], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $database_offline]);
//if ($t4973=='loc_mstr'){
//echo "\n";
//echo $err_msg . ' ==>proses='. $proses . ' ==>' . $sql_insert;
//echo "\n";
//sleep(2);
//}
}
else
{
//if ($t4973=='loc_mstr'){
//echo "\n";
//echo $err_msg . ' ==>prosesxxxxxxxxxxxxxxxxxxxxx='. $proses;
//echo "\n";
//sleep(2);
//}
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT " . $sub_t4973 . "_LastUpdateStamp FROM " . $t4973 . " order by " . $sub_t4973 . "_LastUpdateStamp desc limit 1;";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$LastUpdateStamp = $row_koneksi[$sub_t4973 . '_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
$LastUpdateStampID = '1900-01-01 00:00:0000000000000';
$sql_koneksi = "SELECT CONCAT(" . $sub_t4973 . "_LastUpdateStamp, LPAD(" . $t4973 . "ID, 11, '0')) as '" . $sub_t4973 . "_LastUpdateStampID'
FROM " . $t4973 . " where " . $sub_t4973 . "_LastUpdateStamp >= '" . $LastUpdateStamp . "'
order by CONCAT(" . $sub_t4973 . "_LastUpdateStamp, LPAD(" . $t4973 . "ID, 11, '0')) desc limit 1;";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$LastUpdateStampID = $row_koneksi[$sub_t4973 . '_LastUpdateStampID'];
}
mysqli_free_result($result_koneksi);
if ($database_slave == "bnb" || $database_slave == "hwr") $url = 'http://vrimas.ddns.net:176/C3kLastUpdateStamp.php';
else if ($database_slave == "hva") $url = 'http://grimas.ddns.net:176/C3kLastUpdateStamp.php';
else $url = 'http://grimas.ddns.net:178/C3kLastUpdateStamp.php';
array_splice($data_t4973xyz, 0, count($data_t4973xyz));
$data_t4973xyz[] = array(
"D4tab453" => $database,
"computerassignd_LocationCd" => $computerassignd_LocationCd,
"t4973" => $t4973,
"LastUpdateStamp" => $LastUpdateStamp,
"LastUpdateStampID" => $LastUpdateStampID
);
$ch = curl_init($url);
$data_string = urlencode(json_encode($data_t4973xyz));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"OrderOnline" => $data_string
));
curl_setopt($ch, CURLOPT_TIMEOUT, 50000);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 50000);
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 50000);
$data_LastUpdateStamp = curl_exec($ch);
$asObjects_LastUpdateStamp = json_decode($data_LastUpdateStamp, true);
$filesize_server = $asObjects_LastUpdateStamp['data_LastUpdateStamp'][0]['filesize'];
$filemtime_server = $asObjects_LastUpdateStamp['data_LastUpdateStamp'][0]['filemtime'];
curl_close($ch);
if ($t4973 == 'productitem_mstr')
{
$fp_stockopname = fopen('/xampp/htdocs/xampp/productitem_mstr.html', "w+");
fwrite($fp_stockopname, $url . ' ==>' . $data_LastUpdateStamp . "\n");
fwrite($fp_stockopname, $err_msg . "\n" . "D4tab453 => " . $database . ' ,
computerassignd_LocationCd => ' . $computerassignd_LocationCd . ',
t4973 => ' . $t4973 . ' ,
LastUpdateStamp => ' . $LastUpdateStamp . ' ,
LastUpdateStampID => ' . $LastUpdateStampID . ' ,
filesize_server => ' . $filesize_server . ' ,
filemtime_server => ' . $filemtime_server . "\n");
fclose($fp_stockopname);
}
$online_tabID = 0;
$sql_koneksi = "SELECT online_tabID, online_ID, online_headerID
FROM online_tab where online_status = 'LastUpdateStamp' and online_table = '" . $t4973 . "'";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_offline], $sql_koneksi);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$online_tabID = $row_koneksi['online_tabID'];
$online_ID = $row_koneksi['online_ID'];
$online_headerID = $row_koneksi['online_headerID'];
}
mysqli_free_result($result_koneksi);
if ($online_tabID == 0 && $filesize_server != '' && $filemtime_server != '')
{
$proses_LastUpdateStamp = 'Yes';
$sql_insert = "INSERT INTO online_tab SET
online_status = 'LastUpdateStamp',
online_headerID = " . $filesize_server . ",
online_ID = '" . $filemtime_server . "',
online_table = '" . $t4973 . "'";
mysqli_query($_POST['koneksi' . $database_offline], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $database_offline]);
}
else if ($filesize_server != '' && $filemtime_server != '' && ($online_ID != $filemtime_server || $online_headerID != $filesize_server))
{
$proses_LastUpdateStamp = 'Yes';
$sql_insert = "UPDATE online_tab SET
online_headerID = " . $filesize_server . ",
online_ID = '" . $filemtime_server . "'
where online_tabID = " . $online_tabID;
mysqli_query($_POST['koneksi' . $database_offline], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $database_offline]);
}
//if ($t4973=='loc_mstr'){
// echo "\n";
//echo $t4973 . ' ==>LastUpdateStamp=' . $LastUpdateStamp . ' ==>LastUpdateStampID= ' . $LastUpdateStampID;
//echo "\n";
//echo "\n";
//echo $t4973 . ' ==>filesize_server=' . $filesize_server . ' != && filemtime_server= ' . $filemtime_server . ' != && (online_ID=' .
// $online_ID . ' != filemtime_server=' . $filemtime_server . ' || online_headerID=' . $online_headerID . ' != filesize_server=' . $filesize_server . ')';
//echo "\n";
//sleep(10);
//}
}
echo "\n";
echo $t4973 . ' ==>proses=' . $proses . ' ==>proses_LastUpdateStamp= ' . $proses_LastUpdateStamp;
echo "\n";
//if ($t4973=='loc_mstr'){
//sleep(100);
//}
if ($proses == 'Yes' || $proses_LastUpdateStamp == 'Yes')
{
if ($t4973 == 'itemsku_mstr' || $t4973 == 'acc_mstr' || $t4973 == 'voucherd_detail' || $t4973 == 'voucherh_header' || $t4973 == 'sellprice_mstr' || $t4973 == 'productitem_mstr' || $t4973 == 'barcode_mstr' || $t4973 == 'prosesbg_mstr' || $t4973 == 'add_mstr' || $t4973 == 'member_mstr' || $t4973 == 'group1_mstr' || $t4973 == 'pricesp_tbl' || $t4973 == 'paymentmaptoedc_mstr' || $t4973 == 'brand_mstr' || $t4973 == 'subprogram_det' || $t4973 == 'returartikel_mstr' || $t4973 == 'discount_mstr' || $t4973 == 'edc_mstr' || $t4973 == 'contact_mstr' || $t4973 == 'hjbarud_detail' || $t4973 == 'appf_det' || $t4973 == 'app_mstr' || $t4973 == 'membert_type' || $t4973 == 'rebranding_mstr' || $t4973 == 'salesmanh_header' || $t4973 == 'stockadjh_header')
{
if ($proses == 'Yes') $file_LastUpdateStamp = '.sql';
else $file_LastUpdateStamp = '.sql_LastUpdateStamp';
if ($proses == 'Yes')
{
if ($filesize_dump == $filesize_server && $filemtime_dump == $filemtime_server)
{
if (file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $computerassignd_LocationCd . '_' . $t4973 . '.sql'))
{
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $computerassignd_LocationCd . '_' . $t4973 . '.sql';
$hasil_system = system($isi_q, $retval);
}
if ($port_server = '2278') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/var/www/html/files_excel/' . $computerassignd_LocationCd . '_' . $t4973 . '.sql.zip ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/html/files_excel/' . $computerassignd_LocationCd . '_' . $t4973 . '.sql.zip ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $computerassignd_LocationCd . '_' . $t4973 . '.sql.zip -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$output_filename = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $computerassignd_LocationCd . '_' . $t4973 . '.sql';
}
else
{
if (file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $t4973 . '.sql'))
{
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $t4973 . '.sql';
$hasil_system = system($isi_q, $retval);
}
if ($port_server = '2278') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/var/www/html/files_excel/' . $database . '_' . $t4973 . '.sql.zip ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/html/files_excel/' . $database . '_' . $t4973 . '.sql.zip ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $t4973 . '.sql.zip -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$output_filename = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $t4973 . '.sql';
}
}
else
{
if (file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql_LastUpdateStamp'))
{
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql_LastUpdateStamp';
$hasil_system = system($isi_q, $retval);
}
if ($port_server = '2278') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/var/www/html/files_excel/' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql_LastUpdateStamp ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/html/files_excel/' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql_LastUpdateStamp ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$output_filename = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql_LastUpdateStamp';
}
}
else
{
if ($proses == 'Yes')
{
if ($filesize_dump == $filesize_server && $filemtime_dump == $filemtime_server)
{
if (file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $computerassignd_LocationCd . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql'))
{
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $computerassignd_LocationCd . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql';
$hasil_system = system($isi_q, $retval);
}
if ($port_server = '2278') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/var/www/html/files_excel/' . $computerassignd_LocationCd . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql.zip ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/html/files_excel/' . $computerassignd_LocationCd . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql.zip ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $computerassignd_LocationCd . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql.zip -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$output_filename = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $computerassignd_LocationCd . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql';
}
else
{
if (file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql'))
{
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql';
$hasil_system = system($isi_q, $retval);
}
if ($port_server = '2278') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/var/www/html/files_excel/' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql.zip ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/html/files_excel/' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql.zip ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql.zip -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$output_filename = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql';
}
}
else
{
if (file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql_LastUpdateStamp'))
{
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql_LastUpdateStamp';
$hasil_system = system($isi_q, $retval);
}
if ($port_server = '2278') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/var/www/html/files_excel/' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql_LastUpdateStamp' . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P ' . $port_server . ' -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/html/files_excel/' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql_LastUpdateStamp' . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$output_filename = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $database . '_' . $computerassignd_LocationCd . '_' . $t4973 . '.sql_LastUpdateStamp';
}
}
$handle = fopen($output_filename, "r");
if ($handle)
{
$isi_baris = '';
while (($line = fgets($handle)) !== false)
{
$isi_baris .= $line;
if (strpos($isi_baris, "`~(EOR)") !== false)
{
echo "\n";
echo $isi_baris;
echo "\n";
$line = $isi_baris;
$isi_baris = '';
if ($t4973 == 'kuncitoko_mstr')
{
list($server_kuncitoko_mstrID, $server_kuncitoko__dihapus_time, $server_kuncitoko__dihapus, $server_kuncitoko_LastUpdateStamp, $server_kuncitoko_loc_mstrID, $server_kuncitoko_LocationCd, $server_kuncitoko_LocationInitial, $server_kuncitoko_date) = explode('`', $line);
if ($server_kuncitoko_loc_mstrID == '') $server_kuncitoko_loc_mstrID = 0;
if ($server_kuncitoko_date == '') $server_kuncitoko_date = '1900-01-01';
$kuncitoko_mstrID = 0;
$koneksi_kuncitoko_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT kuncitoko_mstrID, kuncitoko_LastUpdateStamp FROM kuncitoko_mstr where kuncitoko_mstrID = " . $server_kuncitoko_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$kuncitoko_mstrID = $row_koneksi['kuncitoko_mstrID'];
$koneksi_kuncitoko_LastUpdateStamp = $row_koneksi['kuncitoko_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($kuncitoko_mstrID == 0)
{
$sql_insert = "INSERT INTO kuncitoko_mstr SET
kuncitoko_mstrID = '" . addslashes($server_kuncitoko_mstrID) . "',
kuncitoko__dihapus_time = '" . addslashes($server_kuncitoko__dihapus_time) . "',
kuncitoko__dihapus = '" . addslashes($server_kuncitoko__dihapus) . "',
kuncitoko_LastUpdateStamp = '" . addslashes($server_kuncitoko_LastUpdateStamp) . "',
kuncitoko_loc_mstrID = '" . addslashes($server_kuncitoko_loc_mstrID) . "',
kuncitoko_LocationCd = '" . addslashes($server_kuncitoko_LocationCd) . "',
kuncitoko_LocationInitial = '" . addslashes($server_kuncitoko_LocationInitial) . "',
kuncitoko_date = '" . addslashes($server_kuncitoko_date) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
ELSE
{
$sql_update = "UPDATE kuncitoko_mstr SET
kuncitoko__dihapus_time = '" . addslashes($server_kuncitoko__dihapus_time) . "',
kuncitoko__dihapus = '" . addslashes($server_kuncitoko__dihapus) . "',
kuncitoko_LastUpdateStamp = '" . addslashes($server_kuncitoko_LastUpdateStamp) . "',
kuncitoko_loc_mstrID = '" . addslashes($server_kuncitoko_loc_mstrID) . "',
kuncitoko_LocationCd = '" . addslashes($server_kuncitoko_LocationCd) . "',
kuncitoko_LocationInitial = '" . addslashes($server_kuncitoko_LocationInitial) . "',
kuncitoko_date = '" . addslashes($server_kuncitoko_date) . "'
WHERE kuncitoko_mstrID = " . $server_kuncitoko_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
}
else if ($t4973 == 'app_mstr')
{
echo "\n";
echo 'Sebelum app_mstr=>' . $err_msg;
echo "\n";
list($server_app_mstrID, $server_app_create_user, $server_app_create_time, $server_app_edit_user, $server_app_edit_time, $server_app_ip, $server_app_SysTrxId, $server_app_Active, $server_app_Approve, $server_app_SyncronizeDate, $server_app_LastExportDate, $server_app_TotalImported, $server_app_TotalExported, $server_app_SF_yapp, $server_app_Deleteable, $server_app_Forensic, $server_app_PortfolioCd, $server_app_Sub_PortfolioCd, $server_app__dihapus_time, $server_app__dihapus, $server_app_LastUpdateStamp, $server_app_name, $server_app_label, $server_app_type, $server_app_query, $server_app_master, $server_app_anbr, $server_app_left, $server_app_grid, $server_app_save_for, $server_app_width_label, $server_app_seq, $server_app_gnormal, $server_app_proses, $server_app_detail, $server_app_summary_on, $server_app_with_new, $server_app_print_doc, $server_app_total_for, $server_app_button1, $server_app_button2, $server_app_button3, $server_app_button1_type, $server_app_button2_type, $server_app_button3_type, $server_app_auto_starting, $server_app_from_pos, $server_app_relation_table, $server_app_group_by, $server_app_order_by, $server_app_with_Sub_PortfolioCd, $server_app_hide_field, $server_app_cek_errorlog, $server_app_delayForm, $server_app_loading, $server_app_with_del, $server_app_filter_HeaderID, $server_app_passDate1, $server_app_passDate2, $server_app_passStr1, $server_app_passStr2) = explode('`', $line);
if ($server_app_Active == '') $server_app_Active = 'No';
if ($server_app_Approve == '') $server_app_Approve = 0;
if ($server_app_TotalImported == '') $server_app_TotalImported = 0;
if ($server_app_TotalExported == '') $server_app_TotalExported = 0;
if ($server_app_Deleteable == '') $server_app_Deleteable = 'No';
if ($server_app__dihapus == '') $server_app__dihapus = 'No';
if ($server_app_type == '') $server_app_type = 'applikasi';
if ($server_app_left == '') $server_app_left = 0;
if ($server_app_width_label == '') $server_app_width_label = 0;
if ($server_app_seq == '') $server_app_seq = 0;
if ($server_app_detail == '') $server_app_detail = 'No';
if ($server_app_with_new == '') $server_app_with_new = 'No';
if ($server_app_print_doc == '') $server_app_print_doc = 'No';
if ($server_app_button1_type == '') $server_app_button1_type = 'none';
if ($server_app_button2_type == '') $server_app_button2_type = 'none';
if ($server_app_button3_type == '') $server_app_button3_type = 'none';
if ($server_app_auto_starting == '') $server_app_auto_starting = 'No';
if ($server_app_from_pos == '') $server_app_from_pos = 'No';
if ($server_app_with_Sub_PortfolioCd == '') $server_app_with_Sub_PortfolioCd = 'No';
if ($server_app_hide_field == '') $server_app_hide_field = '(none)';
if ($server_app_cek_errorlog == '') $server_app_cek_errorlog = 'No';
if ($server_app_delayForm == '') $server_app_delayForm = 0;
if ($server_app_loading == '') $server_app_loading = 'No';
if ($server_app_with_del == '') $server_app_with_del = 'No';
if ($server_app_filter_HeaderID == '') $server_app_filter_HeaderID = 'No';
$app_mstrID = 0;
$koneksi_app_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT app_mstrID, app_LastUpdateStamp FROM app_mstr where app_mstrID = " . $server_app_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$app_mstrID = $row_koneksi['app_mstrID'];
$koneksi_app_LastUpdateStamp = $row_koneksi['app_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($app_mstrID == 0)
{
$sql_insert = "INSERT INTO app_mstr SET
app_mstrID = '" . addslashes($server_app_mstrID) . "',
app_create_user = '" . addslashes($server_app_create_user) . "',
app_create_time = '" . addslashes($server_app_create_time) . "',
app_edit_user = '" . addslashes($server_app_edit_user) . "',
app_edit_time = '" . addslashes($server_app_edit_time) . "',
app_ip = '" . addslashes($server_app_ip) . "',
app_SysTrxId = '" . addslashes($server_app_SysTrxId) . "',
app_Active = '" . addslashes($server_app_Active) . "',
app_Approve = '" . addslashes($server_app_Approve) . "',
app_SyncronizeDate = '" . addslashes($server_app_SyncronizeDate) . "',
app_LastExportDate = '" . addslashes($server_app_LastExportDate) . "',
app_TotalImported = '" . addslashes($server_app_TotalImported) . "',
app_TotalExported = '" . addslashes($server_app_TotalExported) . "',
app_SF_yapp = '" . addslashes($server_app_SF_yapp) . "',
app_Deleteable = '" . addslashes($server_app_Deleteable) . "',
app_Forensic = '" . addslashes($server_app_Forensic) . "',
app_PortfolioCd = '" . addslashes($server_app_PortfolioCd) . "',
app_Sub_PortfolioCd = '" . addslashes($server_app_Sub_PortfolioCd) . "',
app__dihapus_time = '" . addslashes($server_app__dihapus_time) . "',
app__dihapus = '" . addslashes($server_app__dihapus) . "',
app_LastUpdateStamp = '" . addslashes($server_app_LastUpdateStamp) . "',
app_name = '" . addslashes($server_app_name) . "',
app_label = '" . addslashes($server_app_label) . "',
app_type = '" . addslashes($server_app_type) . "',
app_query = '" . addslashes($server_app_query) . "',
app_master = '" . addslashes($server_app_master) . "',
app_anbr = '" . addslashes($server_app_anbr) . "',
app_left = '" . addslashes($server_app_left) . "',
app_grid = '" . addslashes($server_app_grid) . "',
app_save_for = '" . addslashes($server_app_save_for) . "',
app_width_label = '" . addslashes($server_app_width_label) . "',
app_seq = '" . addslashes($server_app_seq) . "',
app_gnormal = '" . addslashes($server_app_gnormal) . "',
app_proses = '" . addslashes($server_app_proses) . "',
app_detail = '" . addslashes($server_app_detail) . "',
app_summary_on = '" . addslashes($server_app_summary_on) . "',
app_with_new = '" . addslashes($server_app_with_new) . "',
app_print_doc = '" . addslashes($server_app_print_doc) . "',
app_total_for = '" . addslashes($server_app_total_for) . "',
app_button1 = '" . addslashes($server_app_button1) . "',
app_button2 = '" . addslashes($server_app_button2) . "',
app_button3 = '" . addslashes($server_app_button3) . "',
app_button1_type = '" . addslashes($server_app_button1_type) . "',
app_button2_type = '" . addslashes($server_app_button2_type) . "',
app_button3_type = '" . addslashes($server_app_button3_type) . "',
app_auto_starting = '" . addslashes($server_app_auto_starting) . "',
app_from_pos = '" . addslashes($server_app_from_pos) . "',
app_relation_table = '" . addslashes($server_app_relation_table) . "',
app_group_by = '" . addslashes($server_app_group_by) . "',
app_order_by = '" . addslashes($server_app_order_by) . "',
app_with_Sub_PortfolioCd = '" . addslashes($server_app_with_Sub_PortfolioCd) . "',
app_hide_field = '" . addslashes($server_app_hide_field) . "',
app_cek_errorlog = '" . addslashes($server_app_cek_errorlog) . "',
app_delayForm = '" . addslashes($server_app_delayForm) . "',
app_loading = '" . addslashes($server_app_loading) . "',
app_with_del = '" . addslashes($server_app_with_del) . "',
app_filter_HeaderID = '" . addslashes($server_app_filter_HeaderID) . "',
app_passDate1 = '" . addslashes($server_app_passDate1) . "',
app_passDate2 = '" . addslashes($server_app_passDate2) . "',
app_passStr1 = '" . addslashes($server_app_passStr1) . "',
app_passStr2 = '" . addslashes($server_app_passStr2) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert app_mstr=>' . $err_msg;
echo "\n";
echo 'server_app_mstrID=>' . $server_app_mstrID;
echo "\n";
echo 'Insert app_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE app_mstr SET
app_create_user = '" . addslashes($server_app_create_user) . "',
app_create_time = '" . addslashes($server_app_create_time) . "',
app_edit_user = '" . addslashes($server_app_edit_user) . "',
app_edit_time = '" . addslashes($server_app_edit_time) . "',
app_ip = '" . addslashes($server_app_ip) . "',
app_SysTrxId = '" . addslashes($server_app_SysTrxId) . "',
app_Active = '" . addslashes($server_app_Active) . "',
app_Approve = '" . addslashes($server_app_Approve) . "',
app_SyncronizeDate = '" . addslashes($server_app_SyncronizeDate) . "',
app_LastExportDate = '" . addslashes($server_app_LastExportDate) . "',
app_TotalImported = '" . addslashes($server_app_TotalImported) . "',
app_TotalExported = '" . addslashes($server_app_TotalExported) . "',
app_SF_yapp = '" . addslashes($server_app_SF_yapp) . "',
app_Deleteable = '" . addslashes($server_app_Deleteable) . "',
app_Forensic = '" . addslashes($server_app_Forensic) . "',
app_PortfolioCd = '" . addslashes($server_app_PortfolioCd) . "',
app_Sub_PortfolioCd = '" . addslashes($server_app_Sub_PortfolioCd) . "',
app__dihapus_time = '" . addslashes($server_app__dihapus_time) . "',
app__dihapus = '" . addslashes($server_app__dihapus) . "',
app_LastUpdateStamp = '" . addslashes($server_app_LastUpdateStamp) . "',
app_name = '" . addslashes($server_app_name) . "',
app_label = '" . addslashes($server_app_label) . "',
app_type = '" . addslashes($server_app_type) . "',
app_query = '" . addslashes($server_app_query) . "',
app_master = '" . addslashes($server_app_master) . "',
app_anbr = '" . addslashes($server_app_anbr) . "',
app_left = '" . addslashes($server_app_left) . "',
app_grid = '" . addslashes($server_app_grid) . "',
app_save_for = '" . addslashes($server_app_save_for) . "',
app_width_label = '" . addslashes($server_app_width_label) . "',
app_seq = '" . addslashes($server_app_seq) . "',
app_gnormal = '" . addslashes($server_app_gnormal) . "',
app_proses = '" . addslashes($server_app_proses) . "',
app_detail = '" . addslashes($server_app_detail) . "',
app_summary_on = '" . addslashes($server_app_summary_on) . "',
app_with_new = '" . addslashes($server_app_with_new) . "',
app_print_doc = '" . addslashes($server_app_print_doc) . "',
app_total_for = '" . addslashes($server_app_total_for) . "',
app_button1 = '" . addslashes($server_app_button1) . "',
app_button2 = '" . addslashes($server_app_button2) . "',
app_button3 = '" . addslashes($server_app_button3) . "',
app_button1_type = '" . addslashes($server_app_button1_type) . "',
app_button2_type = '" . addslashes($server_app_button2_type) . "',
app_button3_type = '" . addslashes($server_app_button3_type) . "',
app_auto_starting = '" . addslashes($server_app_auto_starting) . "',
app_from_pos = '" . addslashes($server_app_from_pos) . "',
app_relation_table = '" . addslashes($server_app_relation_table) . "',
app_group_by = '" . addslashes($server_app_group_by) . "',
app_order_by = '" . addslashes($server_app_order_by) . "',
app_with_Sub_PortfolioCd = '" . addslashes($server_app_with_Sub_PortfolioCd) . "',
app_hide_field = '" . addslashes($server_app_hide_field) . "',
app_cek_errorlog = '" . addslashes($server_app_cek_errorlog) . "',
app_delayForm = '" . addslashes($server_app_delayForm) . "',
app_loading = '" . addslashes($server_app_loading) . "',
app_with_del = '" . addslashes($server_app_with_del) . "',
app_filter_HeaderID = '" . addslashes($server_app_filter_HeaderID) . "',
app_passDate1 = '" . addslashes($server_app_passDate1) . "',
app_passDate2 = '" . addslashes($server_app_passDate2) . "',
app_passStr1 = '" . addslashes($server_app_passStr1) . "',
app_passStr2 = '" . addslashes($server_app_passStr2) . "'
WHERE app_mstrID = " . $server_app_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE app_mstr=>' . $err_msg;
echo "\n";
echo 'server_app_mstrID=>' . $server_app_mstrID;
echo "\n";
echo 'UPDATE app_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'appf_det')
{
echo "\n";
echo 'Sebelum appf_det=>' . $err_msg;
echo "\n";
list($server_appf_detID, $server_appf_create_user, $server_appf_create_time, $server_appf_edit_user, $server_appf_edit_time, $server_appf_ip, $server_appf_SysTrxId, $server_appf_Active, $server_appf_Approve, $server_appf_SyncronizeDate, $server_appf_LastExportDate, $server_appf_TotalImported, $server_appf_TotalExported, $server_appf_SF_yappf, $server_appf_Deleteable, $server_appf_Forensic, $server_appf_PortfolioCd, $server_appf_Sub_PortfolioCd, $server_appf__dihapus_time, $server_appf__dihapus, $server_appf_LastUpdateStamp, $server_appf_app_mstrID, $server_appf_field, $server_appf_label, $server_appf_width, $server_appf_help, $server_appf_seq, $server_appf_mlength, $server_appf_not_blank, $server_appf_anbr, $server_appf_type_input, $server_appf_textarea_cols, $server_appf_textarea_rows, $server_appf_display_grid, $server_appf_display_maintenance, $server_appf_fields_type, $server_appf_fields_decimals, $server_appf_readonly, $server_appf_position, $server_appf_space_position, $server_appf_grid_type, $server_appf_as_group, $server_appf_formula, $server_appf_reset_on, $server_appf_value_continue, $server_appf_display_on_bottom, $server_appf_percentage_value, $server_appf_as_subtotal, $server_appf_var_or_result, $server_appf_total_for, $server_appf_allow_min, $server_appf_parent_field, $server_appf_from_pos, $server_appf_default, $server_appf_grid_caption, $server_appf_display_analytical, $server_appf_plus_day, $server_appf_public_var) = explode('`', $line);
if ($server_appf_Active == '') $server_appf_Active = 'No';
if ($server_appf_Approve == '') $server_appf_Approve = 0;
if ($server_appf_TotalImported == '') $server_appf_TotalImported = 0;
if ($server_appf_TotalExported == '') $server_appf_TotalExported = 0;
if ($server_appf_Deleteable == '') $server_appf_Deleteable = 'No';
if ($server_appf__dihapus == '') $server_appf__dihapus = 'No';
if ($server_appf_app_mstrID == '') $server_appf_app_mstrID = 0;
if ($server_appf_width == '') $server_appf_width = 0;
if ($server_appf_help == '') $server_appf_help = 0;
if ($server_appf_seq == '') $server_appf_seq = 0;
if ($server_appf_mlength == '') $server_appf_mlength = 0;
if ($server_appf_not_blank == '') $server_appf_not_blank = 'No';
if ($server_appf_textarea_cols == '') $server_appf_textarea_cols = 0;
if ($server_appf_textarea_rows == '') $server_appf_textarea_rows = 0;
if ($server_appf_fields_type == '') $server_appf_fields_type = 0;
if ($server_appf_fields_decimals == '') $server_appf_fields_decimals = 0;
if ($server_appf_as_group == '') $server_appf_as_group = 'No';
if ($server_appf_value_continue == '') $server_appf_value_continue = 'No';
if ($server_appf_percentage_value == '') $server_appf_percentage_value = 'No';
if ($server_appf_as_subtotal == '') $server_appf_as_subtotal = 'No';
if ($server_appf_allow_min == '') $server_appf_allow_min = 'No';
if ($server_appf_from_pos == '') $server_appf_from_pos = 'No';
if ($server_appf_display_analytical == '') $server_appf_display_analytical = '1';
if ($server_appf_plus_day == '') $server_appf_plus_day = 0;
if ($server_appf_public_var == '') $server_appf_public_var = 'No';
$appf_detID = 0;
$koneksi_appf_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT appf_detID, appf_LastUpdateStamp FROM appf_det where appf_detID = " . $server_appf_detID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$appf_detID = $row_koneksi['appf_detID'];
$koneksi_appf_LastUpdateStamp = $row_koneksi['appf_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($appf_detID == 0)
{
$sql_insert = "INSERT INTO appf_det SET
appf_detID = '" . addslashes($server_appf_detID) . "',
appf_create_user = '" . addslashes($server_appf_create_user) . "',
appf_create_time = '" . addslashes($server_appf_create_time) . "',
appf_edit_user = '" . addslashes($server_appf_edit_user) . "',
appf_edit_time = '" . addslashes($server_appf_edit_time) . "',
appf_ip = '" . addslashes($server_appf_ip) . "',
appf_SysTrxId = '" . addslashes($server_appf_SysTrxId) . "',
appf_Active = '" . addslashes($server_appf_Active) . "',
appf_Approve = '" . addslashes($server_appf_Approve) . "',
appf_SyncronizeDate = '" . addslashes($server_appf_SyncronizeDate) . "',
appf_LastExportDate = '" . addslashes($server_appf_LastExportDate) . "',
appf_TotalImported = '" . addslashes($server_appf_TotalImported) . "',
appf_TotalExported = '" . addslashes($server_appf_TotalExported) . "',
appf_SF_yappf = '" . addslashes($server_appf_SF_yappf) . "',
appf_Deleteable = '" . addslashes($server_appf_Deleteable) . "',
appf_Forensic = '" . addslashes($server_appf_Forensic) . "',
appf_PortfolioCd = '" . addslashes($server_appf_PortfolioCd) . "',
appf_Sub_PortfolioCd = '" . addslashes($server_appf_Sub_PortfolioCd) . "',
appf__dihapus_time = '" . addslashes($server_appf__dihapus_time) . "',
appf__dihapus = '" . addslashes($server_appf__dihapus) . "',
appf_LastUpdateStamp = '" . addslashes($server_appf_LastUpdateStamp) . "',
appf_app_mstrID = '" . addslashes($server_appf_app_mstrID) . "',
appf_field = '" . addslashes($server_appf_field) . "',
appf_label = '" . addslashes($server_appf_label) . "',
appf_width = '" . addslashes($server_appf_width) . "',
appf_help = '" . addslashes($server_appf_help) . "',
appf_seq = '" . addslashes($server_appf_seq) . "',
appf_mlength = '" . addslashes($server_appf_mlength) . "',
appf_not_blank = '" . addslashes($server_appf_not_blank) . "',
appf_anbr = '" . addslashes($server_appf_anbr) . "',
appf_type_input = '" . addslashes($server_appf_type_input) . "',
appf_textarea_cols = '" . addslashes($server_appf_textarea_cols) . "',
appf_textarea_rows = '" . addslashes($server_appf_textarea_rows) . "',
appf_display_grid = '" . addslashes($server_appf_display_grid) . "',
appf_display_maintenance = '" . addslashes($server_appf_display_maintenance) . "',
appf_fields_type = '" . addslashes($server_appf_fields_type) . "',
appf_fields_decimals = '" . addslashes($server_appf_fields_decimals) . "',
appf_readonly = '" . addslashes($server_appf_readonly) . "',
appf_position = '" . addslashes($server_appf_position) . "',
appf_space_position = '" . addslashes($server_appf_space_position) . "',
appf_grid_type = '" . addslashes($server_appf_grid_type) . "',
appf_as_group = '" . addslashes($server_appf_as_group) . "',
appf_formula = '" . addslashes($server_appf_formula) . "',
appf_reset_on = '" . addslashes($server_appf_reset_on) . "',
appf_value_continue = '" . addslashes($server_appf_value_continue) . "',
appf_display_on_bottom = '" . addslashes($server_appf_display_on_bottom) . "',
appf_percentage_value = '" . addslashes($server_appf_percentage_value) . "',
appf_as_subtotal = '" . addslashes($server_appf_as_subtotal) . "',
appf_var_or_result = '" . addslashes($server_appf_var_or_result) . "',
appf_total_for = '" . addslashes($server_appf_total_for) . "',
appf_allow_min = '" . addslashes($server_appf_allow_min) . "',
appf_parent_field = '" . addslashes($server_appf_parent_field) . "',
appf_from_pos = '" . addslashes($server_appf_from_pos) . "',
appf_default = '" . addslashes($server_appf_default) . "',
appf_grid_caption = '" . addslashes($server_appf_grid_caption) . "',
appf_display_analytical = '" . addslashes($server_appf_display_analytical) . "',
appf_plus_day = '" . addslashes($server_appf_plus_day) . "',
appf_public_var = '" . addslashes($server_appf_public_var) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert appf_det=>' . $err_msg;
echo "\n";
echo 'server_appf_detID=>' . $server_appf_detID;
echo "\n";
echo 'Insert appf_det=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE appf_det SET
appf_create_user = '" . addslashes($server_appf_create_user) . "',
appf_create_time = '" . addslashes($server_appf_create_time) . "',
appf_edit_user = '" . addslashes($server_appf_edit_user) . "',
appf_edit_time = '" . addslashes($server_appf_edit_time) . "',
appf_ip = '" . addslashes($server_appf_ip) . "',
appf_SysTrxId = '" . addslashes($server_appf_SysTrxId) . "',
appf_Active = '" . addslashes($server_appf_Active) . "',
appf_Approve = '" . addslashes($server_appf_Approve) . "',
appf_SyncronizeDate = '" . addslashes($server_appf_SyncronizeDate) . "',
appf_LastExportDate = '" . addslashes($server_appf_LastExportDate) . "',
appf_TotalImported = '" . addslashes($server_appf_TotalImported) . "',
appf_TotalExported = '" . addslashes($server_appf_TotalExported) . "',
appf_SF_yappf = '" . addslashes($server_appf_SF_yappf) . "',
appf_Deleteable = '" . addslashes($server_appf_Deleteable) . "',
appf_Forensic = '" . addslashes($server_appf_Forensic) . "',
appf_PortfolioCd = '" . addslashes($server_appf_PortfolioCd) . "',
appf_Sub_PortfolioCd = '" . addslashes($server_appf_Sub_PortfolioCd) . "',
appf__dihapus_time = '" . addslashes($server_appf__dihapus_time) . "',
appf__dihapus = '" . addslashes($server_appf__dihapus) . "',
appf_LastUpdateStamp = '" . addslashes($server_appf_LastUpdateStamp) . "',
appf_app_mstrID = '" . addslashes($server_appf_app_mstrID) . "',
appf_field = '" . addslashes($server_appf_field) . "',
appf_label = '" . addslashes($server_appf_label) . "',
appf_width = '" . addslashes($server_appf_width) . "',
appf_help = '" . addslashes($server_appf_help) . "',
appf_seq = '" . addslashes($server_appf_seq) . "',
appf_mlength = '" . addslashes($server_appf_mlength) . "',
appf_not_blank = '" . addslashes($server_appf_not_blank) . "',
appf_anbr = '" . addslashes($server_appf_anbr) . "',
appf_type_input = '" . addslashes($server_appf_type_input) . "',
appf_textarea_cols = '" . addslashes($server_appf_textarea_cols) . "',
appf_textarea_rows = '" . addslashes($server_appf_textarea_rows) . "',
appf_display_grid = '" . addslashes($server_appf_display_grid) . "',
appf_display_maintenance = '" . addslashes($server_appf_display_maintenance) . "',
appf_fields_type = '" . addslashes($server_appf_fields_type) . "',
appf_fields_decimals = '" . addslashes($server_appf_fields_decimals) . "',
appf_readonly = '" . addslashes($server_appf_readonly) . "',
appf_position = '" . addslashes($server_appf_position) . "',
appf_space_position = '" . addslashes($server_appf_space_position) . "',
appf_grid_type = '" . addslashes($server_appf_grid_type) . "',
appf_as_group = '" . addslashes($server_appf_as_group) . "',
appf_formula = '" . addslashes($server_appf_formula) . "',
appf_reset_on = '" . addslashes($server_appf_reset_on) . "',
appf_value_continue = '" . addslashes($server_appf_value_continue) . "',
appf_display_on_bottom = '" . addslashes($server_appf_display_on_bottom) . "',
appf_percentage_value = '" . addslashes($server_appf_percentage_value) . "',
appf_as_subtotal = '" . addslashes($server_appf_as_subtotal) . "',
appf_var_or_result = '" . addslashes($server_appf_var_or_result) . "',
appf_total_for = '" . addslashes($server_appf_total_for) . "',
appf_allow_min = '" . addslashes($server_appf_allow_min) . "',
appf_parent_field = '" . addslashes($server_appf_parent_field) . "',
appf_from_pos = '" . addslashes($server_appf_from_pos) . "',
appf_default = '" . addslashes($server_appf_default) . "',
appf_grid_caption = '" . addslashes($server_appf_grid_caption) . "',
appf_display_analytical = '" . addslashes($server_appf_display_analytical) . "',
appf_plus_day = '" . addslashes($server_appf_plus_day) . "',
appf_public_var = '" . addslashes($server_appf_public_var) . "'
WHERE appf_detID = " . $server_appf_detID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE appf_det=>' . $err_msg;
echo "\n";
echo 'server_appf_detID=>' . $server_appf_detID;
echo "\n";
echo 'UPDATE appf_det=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'loc_mstr')
{
echo "\n";
echo 'Sebelum loc_mstr=>' . $err_msg;
echo "\n";
list($server_loc_mstrID, $server_loc_create_user, $server_loc_create_time, $server_loc_edit_user, $server_loc_edit_time, $server_loc_ip, $server_loc_SysTrxId, $server_loc_Active, $server_loc_Approve, $server_loc_SyncronizeDate, $server_loc_LastExportDate, $server_loc_TotalImported, $server_loc_TotalExported, $server_loc_LastUpdateStamp, $server_loc_idRow, $server_loc_ContactCd, $server_loc_AddressCd, $server_loc_LocationCd, $server_loc_LocationTypeCd, $server_loc_LocationName, $server_loc_PriceListCD, $server_loc_Description, $server_loc_LocationInitial, $server_loc_OperatorCd, $server_loc_Phoneno, $server_loc_Faxno, $server_loc_ContactPersonacc_mstrID, $server_loc_ContactPersonemail, $server_loc_SquareMetric, $server_loc_IsStock, $server_loc_LeadTime, $server_loc_SF_ContactAddressLocation, $server_loc_Sub_PortfolioCd, $server_loc_PortfolioCd, $server_loc_Forensic, $server_loc_Deleteable, $server_loc_contact_mstrID, $server_loc_add_mstrID, $server_loc_loctype_mstrID, $server_loc__dihapus, $server_loc__dihapus_time, $server_loc_gross, $server_loc_contribution, $server_loc_RptIn, $server_loc_RptOut, $server_loc_RptSaldo, $server_loc_poslocalhost, $server_loc_CreateStockRunning, $server_loc_targetValue, $server_loc_targetQty, $server_loc_vendorname, $server_loc_vendornpwp, $server_loc_vendoradd, $server_loc_vendorbilladd, $server_loc_vendorphone, $server_loc_Email) = explode('`', $line);
if ($server_loc_Active == '') $server_loc_Active = 'No';
if ($server_loc_Approve == '') $server_loc_Approve = 0;
if ($server_loc_TotalImported == '') $server_loc_TotalImported = 0;
if ($server_loc_TotalExported == '') $server_loc_TotalExported = 0;
if ($server_loc_idRow == '') $server_loc_idRow = 0;
if ($server_loc_ContactPersonacc_mstrID == '') $server_loc_ContactPersonacc_mstrID = 0;
if ($server_loc_SquareMetric == '') $server_loc_SquareMetric = 0;
if ($server_loc_IsStock == '') $server_loc_IsStock = 'No';
if ($server_loc_LeadTime == '') $server_loc_LeadTime = 0;
if ($server_loc_Deleteable == '') $server_loc_Deleteable = 'No';
if ($server_loc_contact_mstrID == '') $server_loc_contact_mstrID = 0;
if ($server_loc_add_mstrID == '') $server_loc_add_mstrID = 0;
if ($server_loc_loctype_mstrID == '') $server_loc_loctype_mstrID = 0;
if ($server_loc__dihapus == '') $server_loc__dihapus = 'No';
if ($server_loc_gross == '') $server_loc_gross = 0;
if ($server_loc_contribution == '') $server_loc_contribution = 0;
if ($server_loc_RptIn == '') $server_loc_RptIn = 0;
if ($server_loc_RptOut == '') $server_loc_RptOut = 0;
if ($server_loc_RptSaldo == '') $server_loc_RptSaldo = 0;
if ($server_loc_poslocalhost == '') $server_loc_poslocalhost = 'No';
if ($server_loc_CreateStockRunning == '') $server_loc_CreateStockRunning = 'No';
if ($server_loc_targetValue == '') $server_loc_targetValue = 0;
if ($server_loc_targetQty == '') $server_loc_targetQty = 0;
$loc_mstrID = 0;
$koneksi_loc_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT loc_mstrID, loc_LastUpdateStamp FROM loc_mstr where loc_mstrID = " . $server_loc_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$loc_mstrID = $row_koneksi['loc_mstrID'];
$koneksi_loc_LastUpdateStamp = $row_koneksi['loc_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($loc_mstrID == 0)
{
$sql_insert = "INSERT INTO loc_mstr SET
loc_mstrID = '" . addslashes($server_loc_mstrID) . "',
loc_create_user = '" . addslashes($server_loc_create_user) . "',
loc_create_time = '" . addslashes($server_loc_create_time) . "',
loc_edit_user = '" . addslashes($server_loc_edit_user) . "',
loc_edit_time = '" . addslashes($server_loc_edit_time) . "',
loc_ip = '" . addslashes($server_loc_ip) . "',
loc_SysTrxId = '" . addslashes($server_loc_SysTrxId) . "',
loc_Active = '" . addslashes($server_loc_Active) . "',
loc_Approve = '" . addslashes($server_loc_Approve) . "',
loc_SyncronizeDate = '" . addslashes($server_loc_SyncronizeDate) . "',
loc_LastExportDate = '" . addslashes($server_loc_LastExportDate) . "',
loc_TotalImported = '" . addslashes($server_loc_TotalImported) . "',
loc_TotalExported = '" . addslashes($server_loc_TotalExported) . "',
loc_LastUpdateStamp = '" . addslashes($server_loc_LastUpdateStamp) . "',
loc_idRow = '" . addslashes($server_loc_idRow) . "',
loc_ContactCd = '" . addslashes($server_loc_ContactCd) . "',
loc_AddressCd = '" . addslashes($server_loc_AddressCd) . "',
loc_LocationCd = '" . addslashes($server_loc_LocationCd) . "',
loc_LocationTypeCd = '" . addslashes($server_loc_LocationTypeCd) . "',
loc_LocationName = '" . addslashes($server_loc_LocationName) . "',
loc_PriceListCD = '" . addslashes($server_loc_PriceListCD) . "',
loc_Description = '" . addslashes($server_loc_Description) . "',
loc_LocationInitial = '" . addslashes($server_loc_LocationInitial) . "',
loc_OperatorCd = '" . addslashes($server_loc_OperatorCd) . "',
loc_Phoneno = '" . addslashes($server_loc_Phoneno) . "',
loc_Faxno = '" . addslashes($server_loc_Faxno) . "',
loc_ContactPersonacc_mstrID = '" . addslashes($server_loc_ContactPersonacc_mstrID) . "',
loc_ContactPersonemail = '" . addslashes($server_loc_ContactPersonemail) . "',
loc_SquareMetric = '" . addslashes($server_loc_SquareMetric) . "',
loc_IsStock = '" . addslashes($server_loc_IsStock) . "',
loc_LeadTime = '" . addslashes($server_loc_LeadTime) . "',
loc_SF_ContactAddressLocation = '" . addslashes($server_loc_SF_ContactAddressLocation) . "',
loc_Sub_PortfolioCd = '" . addslashes($server_loc_Sub_PortfolioCd) . "',
loc_PortfolioCd = '" . addslashes($server_loc_PortfolioCd) . "',
loc_Forensic = '" . addslashes($server_loc_Forensic) . "',
loc_Deleteable = '" . addslashes($server_loc_Deleteable) . "',
loc_contact_mstrID = '" . addslashes($server_loc_contact_mstrID) . "',
loc_add_mstrID = '" . addslashes($server_loc_add_mstrID) . "',
loc_loctype_mstrID = '" . addslashes($server_loc_loctype_mstrID) . "',
loc__dihapus = '" . addslashes($server_loc__dihapus) . "',
loc__dihapus_time = '" . addslashes($server_loc__dihapus_time) . "',
loc_gross = '" . addslashes($server_loc_gross) . "',
loc_contribution = '" . addslashes($server_loc_contribution) . "',
loc_RptIn = '" . addslashes($server_loc_RptIn) . "',
loc_RptOut = '" . addslashes($server_loc_RptOut) . "',
loc_RptSaldo = '" . addslashes($server_loc_RptSaldo) . "',
loc_poslocalhost = '" . addslashes($server_loc_poslocalhost) . "',
loc_CreateStockRunning = '" . addslashes($server_loc_CreateStockRunning) . "',
loc_targetValue = '" . addslashes($server_loc_targetValue) . "',
loc_targetQty = '" . addslashes($server_loc_targetQty) . "',
loc_vendorname = '" . addslashes($server_loc_vendorname) . "',
loc_vendornpwp = '" . addslashes($server_loc_vendornpwp) . "',
loc_vendoradd = '" . addslashes($server_loc_vendoradd) . "',
loc_vendorbilladd = '" . addslashes($server_loc_vendorbilladd) . "',
loc_vendorphone = '" . addslashes($server_loc_vendorphone) . "',
loc_Email = '" . addslashes($server_loc_Email) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert loc_mstr=>' . $err_msg;
echo "\n";
echo 'server_loc_mstrID=>' . $server_loc_mstrID;
echo "\n";
echo 'Insert loc_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE loc_mstr SET
loc_create_user = '" . addslashes($server_loc_create_user) . "',
loc_create_time = '" . addslashes($server_loc_create_time) . "',
loc_edit_user = '" . addslashes($server_loc_edit_user) . "',
loc_edit_time = '" . addslashes($server_loc_edit_time) . "',
loc_ip = '" . addslashes($server_loc_ip) . "',
loc_SysTrxId = '" . addslashes($server_loc_SysTrxId) . "',
loc_Active = '" . addslashes($server_loc_Active) . "',
loc_Approve = '" . addslashes($server_loc_Approve) . "',
loc_SyncronizeDate = '" . addslashes($server_loc_SyncronizeDate) . "',
loc_LastExportDate = '" . addslashes($server_loc_LastExportDate) . "',
loc_TotalImported = '" . addslashes($server_loc_TotalImported) . "',
loc_TotalExported = '" . addslashes($server_loc_TotalExported) . "',
loc_LastUpdateStamp = '" . addslashes($server_loc_LastUpdateStamp) . "',
loc_idRow = '" . addslashes($server_loc_idRow) . "',
loc_ContactCd = '" . addslashes($server_loc_ContactCd) . "',
loc_AddressCd = '" . addslashes($server_loc_AddressCd) . "',
loc_LocationCd = '" . addslashes($server_loc_LocationCd) . "',
loc_LocationTypeCd = '" . addslashes($server_loc_LocationTypeCd) . "',
loc_LocationName = '" . addslashes($server_loc_LocationName) . "',
loc_PriceListCD = '" . addslashes($server_loc_PriceListCD) . "',
loc_Description = '" . addslashes($server_loc_Description) . "',
loc_LocationInitial = '" . addslashes($server_loc_LocationInitial) . "',
loc_OperatorCd = '" . addslashes($server_loc_OperatorCd) . "',
loc_Phoneno = '" . addslashes($server_loc_Phoneno) . "',
loc_Faxno = '" . addslashes($server_loc_Faxno) . "',
loc_ContactPersonacc_mstrID = '" . addslashes($server_loc_ContactPersonacc_mstrID) . "',
loc_ContactPersonemail = '" . addslashes($server_loc_ContactPersonemail) . "',
loc_SquareMetric = '" . addslashes($server_loc_SquareMetric) . "',
loc_IsStock = '" . addslashes($server_loc_IsStock) . "',
loc_LeadTime = '" . addslashes($server_loc_LeadTime) . "',
loc_SF_ContactAddressLocation = '" . addslashes($server_loc_SF_ContactAddressLocation) . "',
loc_Sub_PortfolioCd = '" . addslashes($server_loc_Sub_PortfolioCd) . "',
loc_PortfolioCd = '" . addslashes($server_loc_PortfolioCd) . "',
loc_Forensic = '" . addslashes($server_loc_Forensic) . "',
loc_Deleteable = '" . addslashes($server_loc_Deleteable) . "',
loc_contact_mstrID = '" . addslashes($server_loc_contact_mstrID) . "',
loc_add_mstrID = '" . addslashes($server_loc_add_mstrID) . "',
loc_loctype_mstrID = '" . addslashes($server_loc_loctype_mstrID) . "',
loc__dihapus = '" . addslashes($server_loc__dihapus) . "',
loc__dihapus_time = '" . addslashes($server_loc__dihapus_time) . "',
loc_gross = '" . addslashes($server_loc_gross) . "',
loc_contribution = '" . addslashes($server_loc_contribution) . "',
loc_RptIn = '" . addslashes($server_loc_RptIn) . "',
loc_RptOut = '" . addslashes($server_loc_RptOut) . "',
loc_RptSaldo = '" . addslashes($server_loc_RptSaldo) . "',
loc_poslocalhost = '" . addslashes($server_loc_poslocalhost) . "',
loc_CreateStockRunning = '" . addslashes($server_loc_CreateStockRunning) . "',
loc_targetValue = '" . addslashes($server_loc_targetValue) . "',
loc_targetQty = '" . addslashes($server_loc_targetQty) . "',
loc_vendorname = '" . addslashes($server_loc_vendorname) . "',
loc_vendornpwp = '" . addslashes($server_loc_vendornpwp) . "',
loc_vendoradd = '" . addslashes($server_loc_vendoradd) . "',
loc_vendorbilladd = '" . addslashes($server_loc_vendorbilladd) . "',
loc_vendorphone = '" . addslashes($server_loc_vendorphone) . "',
loc_Email = '" . addslashes($server_loc_Email) . "'
WHERE loc_mstrID = " . $server_loc_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE loc_mstr=>' . $err_msg;
echo "\n";
echo 'server_loc_mstrID=>' . $server_loc_mstrID;
echo "\n";
echo 'UPDATE loc_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'rebranding_mstr')
{
echo "\n";
echo 'Sebelum rebranding_mstr=>' . $err_msg;
echo "\n";
list($server_rebranding_mstrID, $server_rebranding_create_user, $server_rebranding_create_time, $server_rebranding_edit_user, $server_rebranding_edit_time, $server_rebranding_ip, $server_rebranding_SysTrxId, $server_rebranding_Active, $server_rebranding_Approve, $server_rebranding_SyncronizeDate, $server_rebranding_LastExportDate, $server_rebranding_TotalImported, $server_rebranding_TotalExported, $server_rebranding_SF_rebranding, $server_rebranding_Deleteable, $server_rebranding_Forensic, $server_rebranding_PortfolioCd, $server_rebranding_Sub_PortfolioCd, $server_rebranding__dihapus_time, $server_rebranding__dihapus, $server_rebranding_LastUpdateStamp, $server_rebranding_ClassPrice, $server_rebranding_PriceFor2, $server_rebranding_FromDate, $server_rebranding_ToDate) = explode('`', $line);
if ($server_rebranding_Active == '') $server_rebranding_Active = 'No';
if ($server_rebranding_Approve == '') $server_rebranding_Approve = 0;
if ($server_rebranding_TotalImported == '') $server_rebranding_TotalImported = 0;
if ($server_rebranding_TotalExported == '') $server_rebranding_TotalExported = 0;
if ($server_rebranding_Deleteable == '') $server_rebranding_Deleteable = 'No';
if ($server_rebranding__dihapus == '') $server_rebranding__dihapus = 'No';
if ($server_rebranding_PriceFor2 == '') $server_rebranding_PriceFor2 = 0;
if ($server_rebranding_FromDate == '') $server_rebranding_FromDate = '1900-01-01';
if ($server_rebranding_ToDate == '') $server_rebranding_ToDate = '2999-01-01';
$rebranding_mstrID = 0;
$koneksi_rebranding_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT rebranding_mstrID, rebranding_LastUpdateStamp FROM rebranding_mstr where rebranding_mstrID = " . $server_rebranding_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$rebranding_mstrID = $row_koneksi['rebranding_mstrID'];
$koneksi_rebranding_LastUpdateStamp = $row_koneksi['rebranding_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($rebranding_mstrID == 0)
{
$sql_insert = "INSERT INTO rebranding_mstr SET
rebranding_mstrID = '" . addslashes($server_rebranding_mstrID) . "',
rebranding_create_user = '" . addslashes($server_rebranding_create_user) . "',
rebranding_create_time = '" . addslashes($server_rebranding_create_time) . "',
rebranding_edit_user = '" . addslashes($server_rebranding_edit_user) . "',
rebranding_edit_time = '" . addslashes($server_rebranding_edit_time) . "',
rebranding_ip = '" . addslashes($server_rebranding_ip) . "',
rebranding_SysTrxId = '" . addslashes($server_rebranding_SysTrxId) . "',
rebranding_Active = '" . addslashes($server_rebranding_Active) . "',
rebranding_Approve = '" . addslashes($server_rebranding_Approve) . "',
rebranding_SyncronizeDate = '" . addslashes($server_rebranding_SyncronizeDate) . "',
rebranding_LastExportDate = '" . addslashes($server_rebranding_LastExportDate) . "',
rebranding_TotalImported = '" . addslashes($server_rebranding_TotalImported) . "',
rebranding_TotalExported = '" . addslashes($server_rebranding_TotalExported) . "',
rebranding_SF_rebranding = '" . addslashes($server_rebranding_SF_rebranding) . "',
rebranding_Deleteable = '" . addslashes($server_rebranding_Deleteable) . "',
rebranding_Forensic = '" . addslashes($server_rebranding_Forensic) . "',
rebranding_PortfolioCd = '" . addslashes($server_rebranding_PortfolioCd) . "',
rebranding_Sub_PortfolioCd = '" . addslashes($server_rebranding_Sub_PortfolioCd) . "',
rebranding__dihapus_time = '" . addslashes($server_rebranding__dihapus_time) . "',
rebranding__dihapus = '" . addslashes($server_rebranding__dihapus) . "',
rebranding_LastUpdateStamp = '" . addslashes($server_rebranding_LastUpdateStamp) . "',
rebranding_ClassPrice = '" . addslashes($server_rebranding_ClassPrice) . "',
rebranding_PriceFor2 = '" . addslashes($server_rebranding_PriceFor2) . "',
rebranding_FromDate = '" . addslashes($server_rebranding_FromDate) . "',
rebranding_ToDate = '" . addslashes($server_rebranding_ToDate) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert rebranding_mstr=>' . $err_msg;
echo "\n";
echo 'server_rebranding_mstrID=>' . $server_rebranding_mstrID;
echo "\n";
echo 'Insert rebranding_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE rebranding_mstr SET
rebranding_create_user = '" . addslashes($server_rebranding_create_user) . "',
rebranding_create_time = '" . addslashes($server_rebranding_create_time) . "',
rebranding_edit_user = '" . addslashes($server_rebranding_edit_user) . "',
rebranding_edit_time = '" . addslashes($server_rebranding_edit_time) . "',
rebranding_ip = '" . addslashes($server_rebranding_ip) . "',
rebranding_SysTrxId = '" . addslashes($server_rebranding_SysTrxId) . "',
rebranding_Active = '" . addslashes($server_rebranding_Active) . "',
rebranding_Approve = '" . addslashes($server_rebranding_Approve) . "',
rebranding_SyncronizeDate = '" . addslashes($server_rebranding_SyncronizeDate) . "',
rebranding_LastExportDate = '" . addslashes($server_rebranding_LastExportDate) . "',
rebranding_TotalImported = '" . addslashes($server_rebranding_TotalImported) . "',
rebranding_TotalExported = '" . addslashes($server_rebranding_TotalExported) . "',
rebranding_SF_rebranding = '" . addslashes($server_rebranding_SF_rebranding) . "',
rebranding_Deleteable = '" . addslashes($server_rebranding_Deleteable) . "',
rebranding_Forensic = '" . addslashes($server_rebranding_Forensic) . "',
rebranding_PortfolioCd = '" . addslashes($server_rebranding_PortfolioCd) . "',
rebranding_Sub_PortfolioCd = '" . addslashes($server_rebranding_Sub_PortfolioCd) . "',
rebranding__dihapus_time = '" . addslashes($server_rebranding__dihapus_time) . "',
rebranding__dihapus = '" . addslashes($server_rebranding__dihapus) . "',
rebranding_LastUpdateStamp = '" . addslashes($server_rebranding_LastUpdateStamp) . "',
rebranding_ClassPrice = '" . addslashes($server_rebranding_ClassPrice) . "',
rebranding_PriceFor2 = '" . addslashes($server_rebranding_PriceFor2) . "',
rebranding_FromDate = '" . addslashes($server_rebranding_FromDate) . "',
rebranding_ToDate = '" . addslashes($server_rebranding_ToDate) . "'
WHERE rebranding_mstrID = " . $server_rebranding_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE rebranding_mstr=>' . $err_msg;
echo "\n";
echo 'server_rebranding_mstrID=>' . $server_rebranding_mstrID;
echo "\n";
echo 'UPDATE rebranding_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'sodexo_authorization')
{
echo "\n";
echo 'Sebelum sodexo_authorization=>' . $err_msg;
echo "\n";
list($server_sodexo_authorizationID, $server_sodexo_create_user, $server_sodexo_create_time, $server_sodexo_edit_user, $server_sodexo_edit_time, $server_sodexo_ip, $server_sodexo_SysTrxId, $server_sodexo_Active, $server_sodexo_Approve, $server_sodexo_SyncronizeDate, $server_sodexo_LastExportDate, $server_sodexo_TotalImported, $server_sodexo_TotalExported, $server_sodexo_SF_sodexo, $server_sodexo_Deleteable, $server_sodexo_Forensic, $server_sodexo_PortfolioCd, $server_sodexo_Sub_PortfolioCd, $server_sodexo__dihapus_time, $server_sodexo__dihapus, $server_sodexo_LastUpdateStamp, $server_sodexo_loc_mstrID, $server_sodexo_LocationCd, $server_sodexo_LocationInitial, $server_sodexo_Merchant, $server_sodexo_Branch, $server_sodexo_Pos, $server_sodexo_Authorization) = explode('`', $line);
if ($server_sodexo_Active == '') $server_sodexo_Active = 'No';
if ($server_sodexo_Approve == '') $server_sodexo_Approve = 0;
if ($server_sodexo_TotalImported == '') $server_sodexo_TotalImported = 0;
if ($server_sodexo_TotalExported == '') $server_sodexo_TotalExported = 0;
if ($server_sodexo_Deleteable == '') $server_sodexo_Deleteable = 'No';
if ($server_sodexo__dihapus == '') $server_sodexo__dihapus = 'No';
if ($server_sodexo_loc_mstrID == '') $server_sodexo_loc_mstrID = 0;
$sodexo_authorizationID = 0;
$koneksi_sodexo_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT sodexo_authorizationID, sodexo_LastUpdateStamp FROM sodexo_authorization where sodexo_authorizationID = " . $server_sodexo_authorizationID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$sodexo_authorizationID = $row_koneksi['sodexo_authorizationID'];
$koneksi_sodexo_LastUpdateStamp = $row_koneksi['sodexo_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($sodexo_authorizationID == 0)
{
$sql_insert = "INSERT INTO sodexo_authorization SET
sodexo_authorizationID = '" . addslashes($server_sodexo_authorizationID) . "',
sodexo_create_user = '" . addslashes($server_sodexo_create_user) . "',
sodexo_create_time = '" . addslashes($server_sodexo_create_time) . "',
sodexo_edit_user = '" . addslashes($server_sodexo_edit_user) . "',
sodexo_edit_time = '" . addslashes($server_sodexo_edit_time) . "',
sodexo_ip = '" . addslashes($server_sodexo_ip) . "',
sodexo_SysTrxId = '" . addslashes($server_sodexo_SysTrxId) . "',
sodexo_Active = '" . addslashes($server_sodexo_Active) . "',
sodexo_Approve = '" . addslashes($server_sodexo_Approve) . "',
sodexo_SyncronizeDate = '" . addslashes($server_sodexo_SyncronizeDate) . "',
sodexo_LastExportDate = '" . addslashes($server_sodexo_LastExportDate) . "',
sodexo_TotalImported = '" . addslashes($server_sodexo_TotalImported) . "',
sodexo_TotalExported = '" . addslashes($server_sodexo_TotalExported) . "',
sodexo_SF_sodexo = '" . addslashes($server_sodexo_SF_sodexo) . "',
sodexo_Deleteable = '" . addslashes($server_sodexo_Deleteable) . "',
sodexo_Forensic = '" . addslashes($server_sodexo_Forensic) . "',
sodexo_PortfolioCd = '" . addslashes($server_sodexo_PortfolioCd) . "',
sodexo_Sub_PortfolioCd = '" . addslashes($server_sodexo_Sub_PortfolioCd) . "',
sodexo__dihapus_time = '" . addslashes($server_sodexo__dihapus_time) . "',
sodexo__dihapus = '" . addslashes($server_sodexo__dihapus) . "',
sodexo_LastUpdateStamp = '" . addslashes($server_sodexo_LastUpdateStamp) . "',
sodexo_loc_mstrID = '" . addslashes($server_sodexo_loc_mstrID) . "',
sodexo_LocationCd = '" . addslashes($server_sodexo_LocationCd) . "',
sodexo_LocationInitial = '" . addslashes($server_sodexo_LocationInitial) . "',
sodexo_Merchant = '" . addslashes($server_sodexo_Merchant) . "',
sodexo_Branch = '" . addslashes($server_sodexo_Branch) . "',
sodexo_Pos = '" . addslashes($server_sodexo_Pos) . "',
sodexo_Authorization = '" . addslashes($server_sodexo_Authorization) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert sodexo_authorization=>' . $err_msg;
echo "\n";
echo 'server_sodexo_authorizationID=>' . $server_sodexo_authorizationID;
echo "\n";
echo 'Insert sodexo_authorization=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE sodexo_authorization SET
sodexo_create_user = '" . addslashes($server_sodexo_create_user) . "',
sodexo_create_time = '" . addslashes($server_sodexo_create_time) . "',
sodexo_edit_user = '" . addslashes($server_sodexo_edit_user) . "',
sodexo_edit_time = '" . addslashes($server_sodexo_edit_time) . "',
sodexo_ip = '" . addslashes($server_sodexo_ip) . "',
sodexo_SysTrxId = '" . addslashes($server_sodexo_SysTrxId) . "',
sodexo_Active = '" . addslashes($server_sodexo_Active) . "',
sodexo_Approve = '" . addslashes($server_sodexo_Approve) . "',
sodexo_SyncronizeDate = '" . addslashes($server_sodexo_SyncronizeDate) . "',
sodexo_LastExportDate = '" . addslashes($server_sodexo_LastExportDate) . "',
sodexo_TotalImported = '" . addslashes($server_sodexo_TotalImported) . "',
sodexo_TotalExported = '" . addslashes($server_sodexo_TotalExported) . "',
sodexo_SF_sodexo = '" . addslashes($server_sodexo_SF_sodexo) . "',
sodexo_Deleteable = '" . addslashes($server_sodexo_Deleteable) . "',
sodexo_Forensic = '" . addslashes($server_sodexo_Forensic) . "',
sodexo_PortfolioCd = '" . addslashes($server_sodexo_PortfolioCd) . "',
sodexo_Sub_PortfolioCd = '" . addslashes($server_sodexo_Sub_PortfolioCd) . "',
sodexo__dihapus_time = '" . addslashes($server_sodexo__dihapus_time) . "',
sodexo__dihapus = '" . addslashes($server_sodexo__dihapus) . "',
sodexo_LastUpdateStamp = '" . addslashes($server_sodexo_LastUpdateStamp) . "',
sodexo_loc_mstrID = '" . addslashes($server_sodexo_loc_mstrID) . "',
sodexo_LocationCd = '" . addslashes($server_sodexo_LocationCd) . "',
sodexo_LocationInitial = '" . addslashes($server_sodexo_LocationInitial) . "',
sodexo_Merchant = '" . addslashes($server_sodexo_Merchant) . "',
sodexo_Branch = '" . addslashes($server_sodexo_Branch) . "',
sodexo_Pos = '" . addslashes($server_sodexo_Pos) . "',
sodexo_Authorization = '" . addslashes($server_sodexo_Authorization) . "'
WHERE sodexo_authorizationID = " . $server_sodexo_authorizationID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE sodexo_authorization=>' . $err_msg;
echo "\n";
echo 'server_sodexo_authorizationID=>' . $server_sodexo_authorizationID;
echo "\n";
echo 'UPDATE sodexo_authorization=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'returartikel_mstr')
{
echo "\n";
echo 'Sebelum returartikel_mstr=>' . $err_msg;
echo "\n";
list($server_returartikel_mstrID, $server_returartikel_create_user, $server_returartikel_create_time, $server_returartikel_edit_user, $server_returartikel_edit_time, $server_returartikel_ip, $server_returartikel_SysTrxId, $server_returartikel_Active, $server_returartikel_Approve, $server_returartikel_SyncronizeDate, $server_returartikel_LastExportDate, $server_returartikel_TotalImported, $server_returartikel_TotalExported, $server_returartikel_SF_returartikel, $server_returartikel_Deleteable, $server_returartikel_Forensic, $server_returartikel_PortfolioCd, $server_returartikel_Sub_PortfolioCd, $server_returartikel__dihapus_time, $server_returartikel__dihapus, $server_returartikel_LastUpdateStamp, $server_returartikel_productitem_mstrID, $server_returartikel_ItemName, $server_returartikel_date, $server_returartikel_PStatus) = explode('`', $line);
if ($server_returartikel_Active == '') $server_returartikel_Active = 'No';
if ($server_returartikel_Approve == '') $server_returartikel_Approve = 0;
if ($server_returartikel_TotalImported == '') $server_returartikel_TotalImported = 0;
if ($server_returartikel_TotalExported == '') $server_returartikel_TotalExported = 0;
if ($server_returartikel_Deleteable == '') $server_returartikel_Deleteable = 'No';
if ($server_returartikel__dihapus == '') $server_returartikel__dihapus = 'No';
if ($server_returartikel_productitem_mstrID == '') $server_returartikel_productitem_mstrID = 0;
if ($server_returartikel_date == '') $server_returartikel_date = '1900-01-01';
$returartikel_mstrID = 0;
$koneksi_returartikel_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT returartikel_mstrID, returartikel_LastUpdateStamp FROM returartikel_mstr where returartikel_mstrID = " . $server_returartikel_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$returartikel_mstrID = $row_koneksi['returartikel_mstrID'];
$koneksi_returartikel_LastUpdateStamp = $row_koneksi['returartikel_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($returartikel_mstrID == 0)
{
$sql_insert = "INSERT INTO returartikel_mstr SET
returartikel_mstrID = '" . addslashes($server_returartikel_mstrID) . "',
returartikel_create_user = '" . addslashes($server_returartikel_create_user) . "',
returartikel_create_time = '" . addslashes($server_returartikel_create_time) . "',
returartikel_edit_user = '" . addslashes($server_returartikel_edit_user) . "',
returartikel_edit_time = '" . addslashes($server_returartikel_edit_time) . "',
returartikel_ip = '" . addslashes($server_returartikel_ip) . "',
returartikel_SysTrxId = '" . addslashes($server_returartikel_SysTrxId) . "',
returartikel_Active = '" . addslashes($server_returartikel_Active) . "',
returartikel_Approve = '" . addslashes($server_returartikel_Approve) . "',
returartikel_SyncronizeDate = '" . addslashes($server_returartikel_SyncronizeDate) . "',
returartikel_LastExportDate = '" . addslashes($server_returartikel_LastExportDate) . "',
returartikel_TotalImported = '" . addslashes($server_returartikel_TotalImported) . "',
returartikel_TotalExported = '" . addslashes($server_returartikel_TotalExported) . "',
returartikel_SF_returartikel = '" . addslashes($server_returartikel_SF_returartikel) . "',
returartikel_Deleteable = '" . addslashes($server_returartikel_Deleteable) . "',
returartikel_Forensic = '" . addslashes($server_returartikel_Forensic) . "',
returartikel_PortfolioCd = '" . addslashes($server_returartikel_PortfolioCd) . "',
returartikel_Sub_PortfolioCd = '" . addslashes($server_returartikel_Sub_PortfolioCd) . "',
returartikel__dihapus_time = '" . addslashes($server_returartikel__dihapus_time) . "',
returartikel__dihapus = '" . addslashes($server_returartikel__dihapus) . "',
returartikel_LastUpdateStamp = '" . addslashes($server_returartikel_LastUpdateStamp) . "',
returartikel_productitem_mstrID = '" . addslashes($server_returartikel_productitem_mstrID) . "',
returartikel_ItemName = '" . addslashes($server_returartikel_ItemName) . "',
returartikel_date = '" . addslashes($server_returartikel_date) . "',
returartikel_PStatus = '" . addslashes($server_returartikel_PStatus) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert returartikel_mstr=>' . $err_msg;
echo "\n";
echo 'server_returartikel_mstrID=>' . $server_returartikel_mstrID;
echo "\n";
echo 'Insert returartikel_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE returartikel_mstr SET
returartikel_create_user = '" . addslashes($server_returartikel_create_user) . "',
returartikel_create_time = '" . addslashes($server_returartikel_create_time) . "',
returartikel_edit_user = '" . addslashes($server_returartikel_edit_user) . "',
returartikel_edit_time = '" . addslashes($server_returartikel_edit_time) . "',
returartikel_ip = '" . addslashes($server_returartikel_ip) . "',
returartikel_SysTrxId = '" . addslashes($server_returartikel_SysTrxId) . "',
returartikel_Active = '" . addslashes($server_returartikel_Active) . "',
returartikel_Approve = '" . addslashes($server_returartikel_Approve) . "',
returartikel_SyncronizeDate = '" . addslashes($server_returartikel_SyncronizeDate) . "',
returartikel_LastExportDate = '" . addslashes($server_returartikel_LastExportDate) . "',
returartikel_TotalImported = '" . addslashes($server_returartikel_TotalImported) . "',
returartikel_TotalExported = '" . addslashes($server_returartikel_TotalExported) . "',
returartikel_SF_returartikel = '" . addslashes($server_returartikel_SF_returartikel) . "',
returartikel_Deleteable = '" . addslashes($server_returartikel_Deleteable) . "',
returartikel_Forensic = '" . addslashes($server_returartikel_Forensic) . "',
returartikel_PortfolioCd = '" . addslashes($server_returartikel_PortfolioCd) . "',
returartikel_Sub_PortfolioCd = '" . addslashes($server_returartikel_Sub_PortfolioCd) . "',
returartikel__dihapus_time = '" . addslashes($server_returartikel__dihapus_time) . "',
returartikel__dihapus = '" . addslashes($server_returartikel__dihapus) . "',
returartikel_LastUpdateStamp = '" . addslashes($server_returartikel_LastUpdateStamp) . "',
returartikel_productitem_mstrID = '" . addslashes($server_returartikel_productitem_mstrID) . "',
returartikel_ItemName = '" . addslashes($server_returartikel_ItemName) . "',
returartikel_date = '" . addslashes($server_returartikel_date) . "',
returartikel_PStatus = '" . addslashes($server_returartikel_PStatus) . "'
WHERE returartikel_mstrID = " . $server_returartikel_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE returartikel_mstr=>' . $err_msg;
echo "\n";
echo 'server_returartikel_mstrID=>' . $server_returartikel_mstrID;
echo "\n";
echo 'UPDATE returartikel_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'hjbarud_detail')
{
echo "\n";
echo 'Sebelum hjbarud_detail=>' . $err_msg;
echo "\n";
list($server_hjbarud_detailID, $server_hjbarud_create_user, $server_hjbarud_create_time, $server_hjbarud_edit_user, $server_hjbarud_edit_time, $server_hjbarud_ip, $server_hjbarud_SysTrxId, $server_hjbarud_Active, $server_hjbarud_Approve, $server_hjbarud_SyncronizeDate, $server_hjbarud_LastExportDate, $server_hjbarud_TotalImported, $server_hjbarud_TotalExported, $server_hjbarud_SF_hjbarud, $server_hjbarud_Deleteable, $server_hjbarud_Forensic, $server_hjbarud_PortfolioCd, $server_hjbarud_Sub_PortfolioCd, $server_hjbarud__dihapus_time, $server_hjbarud__dihapus, $server_hjbarud_LastUpdateStamp, $server_hjbarud_hjbaruh_headerID, $server_hjbarud_Artikel, $server_hjbarud_month, $server_hjbarud_year, $server_hjbarud_oldcode_tabID, $server_hjbarud_Cost, $server_hjbarud_Price, $server_hjbarud_ReceiveNoteDate, $server_hjbarud_print) = explode('`', $line);
if ($server_hjbarud_Active == '') $server_hjbarud_Active = 'No';
if ($server_hjbarud_Approve == '') $server_hjbarud_Approve = 0;
if ($server_hjbarud_TotalImported == '') $server_hjbarud_TotalImported = 0;
if ($server_hjbarud_TotalExported == '') $server_hjbarud_TotalExported = 0;
if ($server_hjbarud_Deleteable == '') $server_hjbarud_Deleteable = 'No';
if ($server_hjbarud__dihapus == '') $server_hjbarud__dihapus = 'No';
if ($server_hjbarud_hjbaruh_headerID == '') $server_hjbarud_hjbaruh_headerID = 0;
if ($server_hjbarud_oldcode_tabID == '') $server_hjbarud_oldcode_tabID = 0;
if ($server_hjbarud_Cost == '') $server_hjbarud_Cost = 0;
if ($server_hjbarud_Price == '') $server_hjbarud_Price = 0;
if ($server_hjbarud_ReceiveNoteDate == '') $server_hjbarud_ReceiveNoteDate = '1900-01-01';
if ($server_hjbarud_print == '') $server_hjbarud_print = 0;
$hjbarud_detailID = 0;
$koneksi_hjbarud_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT hjbarud_detailID, hjbarud_LastUpdateStamp FROM hjbarud_detail where hjbarud_detailID = " . $server_hjbarud_detailID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$hjbarud_detailID = $row_koneksi['hjbarud_detailID'];
$koneksi_hjbarud_LastUpdateStamp = $row_koneksi['hjbarud_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($hjbarud_detailID == 0)
{
$sql_insert = "INSERT INTO hjbarud_detail SET
hjbarud_detailID = '" . addslashes($server_hjbarud_detailID) . "',
hjbarud_create_user = '" . addslashes($server_hjbarud_create_user) . "',
hjbarud_create_time = '" . addslashes($server_hjbarud_create_time) . "',
hjbarud_edit_user = '" . addslashes($server_hjbarud_edit_user) . "',
hjbarud_edit_time = '" . addslashes($server_hjbarud_edit_time) . "',
hjbarud_ip = '" . addslashes($server_hjbarud_ip) . "',
hjbarud_SysTrxId = '" . addslashes($server_hjbarud_SysTrxId) . "',
hjbarud_Active = '" . addslashes($server_hjbarud_Active) . "',
hjbarud_Approve = '" . addslashes($server_hjbarud_Approve) . "',
hjbarud_SyncronizeDate = '" . addslashes($server_hjbarud_SyncronizeDate) . "',
hjbarud_LastExportDate = '" . addslashes($server_hjbarud_LastExportDate) . "',
hjbarud_TotalImported = '" . addslashes($server_hjbarud_TotalImported) . "',
hjbarud_TotalExported = '" . addslashes($server_hjbarud_TotalExported) . "',
hjbarud_SF_hjbarud = '" . addslashes($server_hjbarud_SF_hjbarud) . "',
hjbarud_Deleteable = '" . addslashes($server_hjbarud_Deleteable) . "',
hjbarud_Forensic = '" . addslashes($server_hjbarud_Forensic) . "',
hjbarud_PortfolioCd = '" . addslashes($server_hjbarud_PortfolioCd) . "',
hjbarud_Sub_PortfolioCd = '" . addslashes($server_hjbarud_Sub_PortfolioCd) . "',
hjbarud__dihapus_time = '" . addslashes($server_hjbarud__dihapus_time) . "',
hjbarud__dihapus = '" . addslashes($server_hjbarud__dihapus) . "',
hjbarud_LastUpdateStamp = '" . addslashes($server_hjbarud_LastUpdateStamp) . "',
hjbarud_hjbaruh_headerID = '" . addslashes($server_hjbarud_hjbaruh_headerID) . "',
hjbarud_Artikel = '" . addslashes($server_hjbarud_Artikel) . "',
hjbarud_month = '" . addslashes($server_hjbarud_month) . "',
hjbarud_year = '" . addslashes($server_hjbarud_year) . "',
hjbarud_oldcode_tabID = '" . addslashes($server_hjbarud_oldcode_tabID) . "',
hjbarud_Cost = '" . addslashes($server_hjbarud_Cost) . "',
hjbarud_Price = '" . addslashes($server_hjbarud_Price) . "',
hjbarud_ReceiveNoteDate = '" . addslashes($server_hjbarud_ReceiveNoteDate) . "',
hjbarud_print = '" . addslashes($server_hjbarud_print) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert hjbarud_detail=>' . $err_msg;
echo "\n";
echo 'server_hjbarud_detailID=>' . $server_hjbarud_detailID;
echo "\n";
echo 'Insert hjbarud_detail=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE hjbarud_detail SET
hjbarud_create_user = '" . addslashes($server_hjbarud_create_user) . "',
hjbarud_create_time = '" . addslashes($server_hjbarud_create_time) . "',
hjbarud_edit_user = '" . addslashes($server_hjbarud_edit_user) . "',
hjbarud_edit_time = '" . addslashes($server_hjbarud_edit_time) . "',
hjbarud_ip = '" . addslashes($server_hjbarud_ip) . "',
hjbarud_SysTrxId = '" . addslashes($server_hjbarud_SysTrxId) . "',
hjbarud_Active = '" . addslashes($server_hjbarud_Active) . "',
hjbarud_Approve = '" . addslashes($server_hjbarud_Approve) . "',
hjbarud_SyncronizeDate = '" . addslashes($server_hjbarud_SyncronizeDate) . "',
hjbarud_LastExportDate = '" . addslashes($server_hjbarud_LastExportDate) . "',
hjbarud_TotalImported = '" . addslashes($server_hjbarud_TotalImported) . "',
hjbarud_TotalExported = '" . addslashes($server_hjbarud_TotalExported) . "',
hjbarud_SF_hjbarud = '" . addslashes($server_hjbarud_SF_hjbarud) . "',
hjbarud_Deleteable = '" . addslashes($server_hjbarud_Deleteable) . "',
hjbarud_Forensic = '" . addslashes($server_hjbarud_Forensic) . "',
hjbarud_PortfolioCd = '" . addslashes($server_hjbarud_PortfolioCd) . "',
hjbarud_Sub_PortfolioCd = '" . addslashes($server_hjbarud_Sub_PortfolioCd) . "',
hjbarud__dihapus_time = '" . addslashes($server_hjbarud__dihapus_time) . "',
hjbarud__dihapus = '" . addslashes($server_hjbarud__dihapus) . "',
hjbarud_LastUpdateStamp = '" . addslashes($server_hjbarud_LastUpdateStamp) . "',
hjbarud_hjbaruh_headerID = '" . addslashes($server_hjbarud_hjbaruh_headerID) . "',
hjbarud_Artikel = '" . addslashes($server_hjbarud_Artikel) . "',
hjbarud_month = '" . addslashes($server_hjbarud_month) . "',
hjbarud_year = '" . addslashes($server_hjbarud_year) . "',
hjbarud_oldcode_tabID = '" . addslashes($server_hjbarud_oldcode_tabID) . "',
hjbarud_Cost = '" . addslashes($server_hjbarud_Cost) . "',
hjbarud_Price = '" . addslashes($server_hjbarud_Price) . "',
hjbarud_ReceiveNoteDate = '" . addslashes($server_hjbarud_ReceiveNoteDate) . "',
hjbarud_print = '" . addslashes($server_hjbarud_print) . "'
WHERE hjbarud_detailID = " . $server_hjbarud_detailID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE hjbarud_detail=>' . $err_msg;
echo "\n";
echo 'server_hjbarud_detailID=>' . $server_hjbarud_detailID;
echo "\n";
echo 'UPDATE hjbarud_detail=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'contact_mstr')
{
echo "\n";
echo 'Sebelum contact_mstr=>' . $err_msg;
echo "\n";
list($server_contact_mstrID, $server_contact_create_user, $server_contact_create_time, $server_contact_edit_user, $server_contact_edit_time, $server_contact_ip, $server_contact_SysTrxId, $server_contact_Active, $server_contact_Approve, $server_contact_SyncronizeDate, $server_contact_LastExportDate, $server_contact_TotalImported, $server_contact_TotalExported, $server_contact_LastUpdateStamp, $server_contact_idRow, $server_contact_ContactCd, $server_contact_ContactName, $server_contact_ContactInitial, $server_contact_ReferenceNo, $server_contact_NIK, $server_contact_NPWP, $server_contact_PKP, $server_contact_ContactStartDate, $server_contact_ContactEndDate, $server_contact_ContactClassCd, $server_contact_ContactTypeCd, $server_contact_Title, $server_contact_isMale, $server_contact_isMarried, $server_contact_Height, $server_contact_HeightUOMCd, $server_contact_Weight, $server_contact_WeightUOMCd, $server_contact_BloodTypeCd, $server_contact_BirthPlacehierarchicallandci_cityID, $server_contact_BirthPlaceCityCd, $server_contact_BirthDate, $server_contact_isAlive, $server_contact_RaceCd, $server_contact_NationalityCd, $server_contact_ReligionCd, $server_contact_hierarchicallandc_coutryID, $server_contact_CountryCd, $server_contact_ShirtSize, $server_contact_ShirtUOMCd, $server_contact_ShoesSize, $server_contact_ShoesUOMCd, $server_contact_Government, $server_contact_Website, $server_contact_FixMargin, $server_contact_Owner, $server_contact_Principal, $server_contact_Supplier, $server_contact_Customer, $server_contact_Competitor, $server_contact_Employee, $server_contact_Prospect, $server_contact_Bank, $server_contact_SuppPurchaseType, $server_contact_SOTOPCd, $server_contact_POTOPCd, $server_contact_AlternateContactCd, $server_contact_EmployeeCd, $server_contact_IsGrosir, $server_contact_IsMember, $server_contact_IsFullConsignment, $server_contact_IsBranch, $server_contact_StatusApproval, $server_contact_SF_Contact, $server_contact_Forensic, $server_contact_Deleteable, $server_contact_PortfolioCd, $server_contact_Sub_PortfolioCd, $server_contact_Description, $server_contact_contactt_typeID, $server_contact_religion_mstrID, $server_contact_blood_typeID, $server_contact_race_mstrID, $server_contact_pilih, $server_contact_nationality_mstrID, $server_contact_Weightmeasurement_uomID, $server_contact_Heightmeasurement_uomID, $server_contact_Shirtmeasurement_uomID, $server_contact_Shoesmeasurement_uomID, $server_contact_SOtop_mstrID, $server_contact_POtop_mstrID, $server_contact__dihapus, $server_contact__dihapus_time, $server_contact_Courier, $server_contact_Islocal, $server_contact_Picture, $server_contact_code_vd, $server_contact_Reseller, $server_contact_tax_mstrID, $server_contact_TaxCd, $server_contact_Designer, $server_contact_ContactNameMom, $server_contact_BirthDateMom) = explode('`', $line);
if ($server_contact_Active == '') $server_contact_Active = 'No';
if ($server_contact_Approve == '') $server_contact_Approve = 0;
if ($server_contact_TotalImported == '') $server_contact_TotalImported = 0;
if ($server_contact_TotalExported == '') $server_contact_TotalExported = 0;
if ($server_contact_idRow == '') $server_contact_idRow = 0;
if ($server_contact_ContactStartDate == '') $server_contact_ContactStartDate = '1900-01-01';
if ($server_contact_ContactEndDate == '') $server_contact_ContactEndDate = '1900-01-01';
if ($server_contact_isMale == '') $server_contact_isMale = 'No';
if ($server_contact_isMarried == '') $server_contact_isMarried = 'No';
if ($server_contact_Height == '') $server_contact_Height = 0;
if ($server_contact_Weight == '') $server_contact_Weight = 0;
if ($server_contact_BirthPlacehierarchicallandci_cityID == '') $server_contact_BirthPlacehierarchicallandci_cityID = 0;
if ($server_contact_BirthDate == '') $server_contact_BirthDate = '1900-01-01';
if ($server_contact_isAlive == '') $server_contact_isAlive = 'No';
if ($server_contact_hierarchicallandc_coutryID == '') $server_contact_hierarchicallandc_coutryID = 0;
if ($server_contact_ShirtSize == '') $server_contact_ShirtSize = 0;
if ($server_contact_ShoesSize == '') $server_contact_ShoesSize = 0;
if ($server_contact_FixMargin == '') $server_contact_FixMargin = 0;
if ($server_contact_Owner == '') $server_contact_Owner = 'No';
if ($server_contact_Principal == '') $server_contact_Principal = 'No';
if ($server_contact_Supplier == '') $server_contact_Supplier = 'No';
if ($server_contact_Customer == '') $server_contact_Customer = 'No';
if ($server_contact_Competitor == '') $server_contact_Competitor = 'No';
if ($server_contact_Employee == '') $server_contact_Employee = 'No';
if ($server_contact_Prospect == '') $server_contact_Prospect = 'No';
if ($server_contact_Bank == '') $server_contact_Bank = 'No';
if ($server_contact_IsGrosir == '') $server_contact_IsGrosir = 'No';
if ($server_contact_IsMember == '') $server_contact_IsMember = 'No';
if ($server_contact_IsFullConsignment == '') $server_contact_IsFullConsignment = 'No';
if ($server_contact_IsBranch == '') $server_contact_IsBranch = 'No';
if ($server_contact_Deleteable == '') $server_contact_Deleteable = 'No';
if ($server_contact_contactt_typeID == '') $server_contact_contactt_typeID = 0;
if ($server_contact_religion_mstrID == '') $server_contact_religion_mstrID = 0;
if ($server_contact_blood_typeID == '') $server_contact_blood_typeID = 0;
if ($server_contact_race_mstrID == '') $server_contact_race_mstrID = 0;
if ($server_contact_pilih == '') $server_contact_pilih = 'No';
if ($server_contact_nationality_mstrID == '') $server_contact_nationality_mstrID = 0;
if ($server_contact_Weightmeasurement_uomID == '') $server_contact_Weightmeasurement_uomID = 0;
if ($server_contact_Heightmeasurement_uomID == '') $server_contact_Heightmeasurement_uomID = 0;
if ($server_contact_Shirtmeasurement_uomID == '') $server_contact_Shirtmeasurement_uomID = 0;
if ($server_contact_Shoesmeasurement_uomID == '') $server_contact_Shoesmeasurement_uomID = 0;
if ($server_contact_SOtop_mstrID == '') $server_contact_SOtop_mstrID = 0;
if ($server_contact_POtop_mstrID == '') $server_contact_POtop_mstrID = 0;
if ($server_contact__dihapus == '') $server_contact__dihapus = 'No';
if ($server_contact_Islocal == '') $server_contact_Islocal = 'No';
if ($server_contact_Reseller == '') $server_contact_Reseller = 'No';
if ($server_contact_tax_mstrID == '') $server_contact_tax_mstrID = 0;
if ($server_contact_Designer == '') $server_contact_Designer = 'No';
if ($server_contact_BirthDateMom == '') $server_contact_BirthDateMom = '1900-01-01';
$contact_mstrID = 0;
$koneksi_contact_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT contact_mstrID, contact_LastUpdateStamp FROM contact_mstr where contact_mstrID = " . $server_contact_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$contact_mstrID = $row_koneksi['contact_mstrID'];
$koneksi_contact_LastUpdateStamp = $row_koneksi['contact_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($contact_mstrID == 0)
{
$sql_delete = "DELETE FROM contact_mstr where
contact_ContactCd = '" . addslashes($server_contact_ContactCd) . "' and
contact_contactt_typeID = " . addslashes($server_contact_contactt_typeID) . " and
contact__dihapus_time = '" . addslashes($server_contact__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_delete = "DELETE FROM contact_mstr where
contact_ContactName = '" . addslashes($server_contact_ContactName) . "' and
contact_code_vd = '" . addslashes($server_contact_code_vd) . "' and
contact_create_user = '" . addslashes($server_contact_create_user) . "' and
contact_create_time = '" . addslashes($server_contact_create_time) . "' and
contact__dihapus_time = '" . addslashes($server_contact__dihapus_time) . "' and
contact_BirthPlaceCityCd = '" . addslashes($server_contact_BirthPlaceCityCd) . "' and
contact_BirthDate = '" . addslashes($server_contact_BirthDate) . "' and
contact_Owner = '" . addslashes($server_contact_Owner) . "' and
contact_Supplier = '" . addslashes($server_contact_Supplier) . "' and
contact_Customer = '" . addslashes($server_contact_Customer) . "' and
contact_Employee = '" . addslashes($server_contact_Employee) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_insert = "INSERT INTO contact_mstr SET
contact_mstrID = '" . addslashes($server_contact_mstrID) . "',
contact_create_user = '" . addslashes($server_contact_create_user) . "',
contact_create_time = '" . addslashes($server_contact_create_time) . "',
contact_edit_user = '" . addslashes($server_contact_edit_user) . "',
contact_edit_time = '" . addslashes($server_contact_edit_time) . "',
contact_ip = '" . addslashes($server_contact_ip) . "',
contact_SysTrxId = '" . addslashes($server_contact_SysTrxId) . "',
contact_Active = '" . addslashes($server_contact_Active) . "',
contact_Approve = '" . addslashes($server_contact_Approve) . "',
contact_SyncronizeDate = '" . addslashes($server_contact_SyncronizeDate) . "',
contact_LastExportDate = '" . addslashes($server_contact_LastExportDate) . "',
contact_TotalImported = '" . addslashes($server_contact_TotalImported) . "',
contact_TotalExported = '" . addslashes($server_contact_TotalExported) . "',
contact_LastUpdateStamp = '" . addslashes($server_contact_LastUpdateStamp) . "',
contact_idRow = '" . addslashes($server_contact_idRow) . "',
contact_ContactCd = '" . addslashes($server_contact_ContactCd) . "',
contact_ContactName = '" . addslashes($server_contact_ContactName) . "',
contact_ContactInitial = '" . addslashes($server_contact_ContactInitial) . "',
contact_ReferenceNo = '" . addslashes($server_contact_ReferenceNo) . "',
contact_NIK = '" . addslashes($server_contact_NIK) . "',
contact_NPWP = '" . addslashes($server_contact_NPWP) . "',
contact_PKP = '" . addslashes($server_contact_PKP) . "',
contact_ContactStartDate = '" . addslashes($server_contact_ContactStartDate) . "',
contact_ContactEndDate = '" . addslashes($server_contact_ContactEndDate) . "',
contact_ContactClassCd = '" . addslashes($server_contact_ContactClassCd) . "',
contact_ContactTypeCd = '" . addslashes($server_contact_ContactTypeCd) . "',
contact_Title = '" . addslashes($server_contact_Title) . "',
contact_isMale = '" . addslashes($server_contact_isMale) . "',
contact_isMarried = '" . addslashes($server_contact_isMarried) . "',
contact_Height = '" . addslashes($server_contact_Height) . "',
contact_HeightUOMCd = '" . addslashes($server_contact_HeightUOMCd) . "',
contact_Weight = '" . addslashes($server_contact_Weight) . "',
contact_WeightUOMCd = '" . addslashes($server_contact_WeightUOMCd) . "',
contact_BloodTypeCd = '" . addslashes($server_contact_BloodTypeCd) . "',
contact_BirthPlacehierarchicallandci_cityID = '" . addslashes($server_contact_BirthPlacehierarchicallandci_cityID) . "',
contact_BirthPlaceCityCd = '" . addslashes($server_contact_BirthPlaceCityCd) . "',
contact_BirthDate = '" . addslashes($server_contact_BirthDate) . "',
contact_isAlive = '" . addslashes($server_contact_isAlive) . "',
contact_RaceCd = '" . addslashes($server_contact_RaceCd) . "',
contact_NationalityCd = '" . addslashes($server_contact_NationalityCd) . "',
contact_ReligionCd = '" . addslashes($server_contact_ReligionCd) . "',
contact_hierarchicallandc_coutryID = '" . addslashes($server_contact_hierarchicallandc_coutryID) . "',
contact_CountryCd = '" . addslashes($server_contact_CountryCd) . "',
contact_ShirtSize = '" . addslashes($server_contact_ShirtSize) . "',
contact_ShirtUOMCd = '" . addslashes($server_contact_ShirtUOMCd) . "',
contact_ShoesSize = '" . addslashes($server_contact_ShoesSize) . "',
contact_ShoesUOMCd = '" . addslashes($server_contact_ShoesUOMCd) . "',
contact_Government = '" . addslashes($server_contact_Government) . "',
contact_Website = '" . addslashes($server_contact_Website) . "',
contact_FixMargin = '" . addslashes($server_contact_FixMargin) . "',
contact_Owner = '" . addslashes($server_contact_Owner) . "',
contact_Principal = '" . addslashes($server_contact_Principal) . "',
contact_Supplier = '" . addslashes($server_contact_Supplier) . "',
contact_Customer = '" . addslashes($server_contact_Customer) . "',
contact_Competitor = '" . addslashes($server_contact_Competitor) . "',
contact_Employee = '" . addslashes($server_contact_Employee) . "',
contact_Prospect = '" . addslashes($server_contact_Prospect) . "',
contact_Bank = '" . addslashes($server_contact_Bank) . "',
contact_SuppPurchaseType = '" . addslashes($server_contact_SuppPurchaseType) . "',
contact_SOTOPCd = '" . addslashes($server_contact_SOTOPCd) . "',
contact_POTOPCd = '" . addslashes($server_contact_POTOPCd) . "',
contact_AlternateContactCd = '" . addslashes($server_contact_AlternateContactCd) . "',
contact_EmployeeCd = '" . addslashes($server_contact_EmployeeCd) . "',
contact_IsGrosir = '" . addslashes($server_contact_IsGrosir) . "',
contact_IsMember = '" . addslashes($server_contact_IsMember) . "',
contact_IsFullConsignment = '" . addslashes($server_contact_IsFullConsignment) . "',
contact_IsBranch = '" . addslashes($server_contact_IsBranch) . "',
contact_StatusApproval = '" . addslashes($server_contact_StatusApproval) . "',
contact_SF_Contact = '" . addslashes($server_contact_SF_Contact) . "',
contact_Forensic = '" . addslashes($server_contact_Forensic) . "',
contact_Deleteable = '" . addslashes($server_contact_Deleteable) . "',
contact_PortfolioCd = '" . addslashes($server_contact_PortfolioCd) . "',
contact_Sub_PortfolioCd = '" . addslashes($server_contact_Sub_PortfolioCd) . "',
contact_Description = '" . addslashes($server_contact_Description) . "',
contact_contactt_typeID = '" . addslashes($server_contact_contactt_typeID) . "',
contact_religion_mstrID = '" . addslashes($server_contact_religion_mstrID) . "',
contact_blood_typeID = '" . addslashes($server_contact_blood_typeID) . "',
contact_race_mstrID = '" . addslashes($server_contact_race_mstrID) . "',
contact_pilih = '" . addslashes($server_contact_pilih) . "',
contact_nationality_mstrID = '" . addslashes($server_contact_nationality_mstrID) . "',
contact_Weightmeasurement_uomID = '" . addslashes($server_contact_Weightmeasurement_uomID) . "',
contact_Heightmeasurement_uomID = '" . addslashes($server_contact_Heightmeasurement_uomID) . "',
contact_Shirtmeasurement_uomID = '" . addslashes($server_contact_Shirtmeasurement_uomID) . "',
contact_Shoesmeasurement_uomID = '" . addslashes($server_contact_Shoesmeasurement_uomID) . "',
contact_SOtop_mstrID = '" . addslashes($server_contact_SOtop_mstrID) . "',
contact_POtop_mstrID = '" . addslashes($server_contact_POtop_mstrID) . "',
contact__dihapus = '" . addslashes($server_contact__dihapus) . "',
contact__dihapus_time = '" . addslashes($server_contact__dihapus_time) . "',
contact_Courier = '" . addslashes($server_contact_Courier) . "',
contact_Islocal = '" . addslashes($server_contact_Islocal) . "',
contact_Picture = '" . addslashes($server_contact_Picture) . "',
contact_code_vd = '" . addslashes($server_contact_code_vd) . "',
contact_Reseller = '" . addslashes($server_contact_Reseller) . "',
contact_tax_mstrID = '" . addslashes($server_contact_tax_mstrID) . "',
contact_TaxCd = '" . addslashes($server_contact_TaxCd) . "',
contact_Designer = '" . addslashes($server_contact_Designer) . "',
contact_ContactNameMom = '" . addslashes($server_contact_ContactNameMom) . "',
contact_BirthDateMom = '" . addslashes($server_contact_BirthDateMom) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert contact_mstr=>' . $err_msg;
echo "\n";
echo 'server_contact_mstrID=>' . $server_contact_mstrID;
echo "\n";
echo 'Insert contact_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_delete = "DELETE FROM contact_mstr where
contact_mstrID <> " . $server_contact_mstrID . " and
contact_ContactCd = '" . addslashes($server_contact_ContactCd) . "' and
contact_contactt_typeID = " . addslashes($server_contact_contactt_typeID) . " and
contact__dihapus_time = '" . addslashes($server_contact__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_delete = "DELETE FROM contact_mstr where
contact_mstrID <> " . $server_contact_mstrID . " and
contact_ContactName = '" . addslashes($server_contact_ContactName) . "' and
contact_code_vd = '" . addslashes($server_contact_code_vd) . "' and
contact_create_user = '" . addslashes($server_contact_create_user) . "' and
contact_create_time = '" . addslashes($server_contact_create_time) . "' and
contact__dihapus_time = '" . addslashes($server_contact__dihapus_time) . "' and
contact_BirthPlaceCityCd = '" . addslashes($server_contact_BirthPlaceCityCd) . "' and
contact_BirthDate = '" . addslashes($server_contact_BirthDate) . "' and
contact_Owner = '" . addslashes($server_contact_Owner) . "' and
contact_Supplier = '" . addslashes($server_contact_Supplier) . "' and
contact_Customer = '" . addslashes($server_contact_Customer) . "' and
contact_Employee = '" . addslashes($server_contact_Employee) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_update = "UPDATE contact_mstr SET
contact_create_user = '" . addslashes($server_contact_create_user) . "',
contact_create_time = '" . addslashes($server_contact_create_time) . "',
contact_edit_user = '" . addslashes($server_contact_edit_user) . "',
contact_edit_time = '" . addslashes($server_contact_edit_time) . "',
contact_ip = '" . addslashes($server_contact_ip) . "',
contact_SysTrxId = '" . addslashes($server_contact_SysTrxId) . "',
contact_Active = '" . addslashes($server_contact_Active) . "',
contact_Approve = '" . addslashes($server_contact_Approve) . "',
contact_SyncronizeDate = '" . addslashes($server_contact_SyncronizeDate) . "',
contact_LastExportDate = '" . addslashes($server_contact_LastExportDate) . "',
contact_TotalImported = '" . addslashes($server_contact_TotalImported) . "',
contact_TotalExported = '" . addslashes($server_contact_TotalExported) . "',
contact_LastUpdateStamp = '" . addslashes($server_contact_LastUpdateStamp) . "',
contact_idRow = '" . addslashes($server_contact_idRow) . "',
contact_ContactCd = '" . addslashes($server_contact_ContactCd) . "',
contact_ContactName = '" . addslashes($server_contact_ContactName) . "',
contact_ContactInitial = '" . addslashes($server_contact_ContactInitial) . "',
contact_ReferenceNo = '" . addslashes($server_contact_ReferenceNo) . "',
contact_NIK = '" . addslashes($server_contact_NIK) . "',
contact_NPWP = '" . addslashes($server_contact_NPWP) . "',
contact_PKP = '" . addslashes($server_contact_PKP) . "',
contact_ContactStartDate = '" . addslashes($server_contact_ContactStartDate) . "',
contact_ContactEndDate = '" . addslashes($server_contact_ContactEndDate) . "',
contact_ContactClassCd = '" . addslashes($server_contact_ContactClassCd) . "',
contact_ContactTypeCd = '" . addslashes($server_contact_ContactTypeCd) . "',
contact_Title = '" . addslashes($server_contact_Title) . "',
contact_isMale = '" . addslashes($server_contact_isMale) . "',
contact_isMarried = '" . addslashes($server_contact_isMarried) . "',
contact_Height = '" . addslashes($server_contact_Height) . "',
contact_HeightUOMCd = '" . addslashes($server_contact_HeightUOMCd) . "',
contact_Weight = '" . addslashes($server_contact_Weight) . "',
contact_WeightUOMCd = '" . addslashes($server_contact_WeightUOMCd) . "',
contact_BloodTypeCd = '" . addslashes($server_contact_BloodTypeCd) . "',
contact_BirthPlacehierarchicallandci_cityID = '" . addslashes($server_contact_BirthPlacehierarchicallandci_cityID) . "',
contact_BirthPlaceCityCd = '" . addslashes($server_contact_BirthPlaceCityCd) . "',
contact_BirthDate = '" . addslashes($server_contact_BirthDate) . "',
contact_isAlive = '" . addslashes($server_contact_isAlive) . "',
contact_RaceCd = '" . addslashes($server_contact_RaceCd) . "',
contact_NationalityCd = '" . addslashes($server_contact_NationalityCd) . "',
contact_ReligionCd = '" . addslashes($server_contact_ReligionCd) . "',
contact_hierarchicallandc_coutryID = '" . addslashes($server_contact_hierarchicallandc_coutryID) . "',
contact_CountryCd = '" . addslashes($server_contact_CountryCd) . "',
contact_ShirtSize = '" . addslashes($server_contact_ShirtSize) . "',
contact_ShirtUOMCd = '" . addslashes($server_contact_ShirtUOMCd) . "',
contact_ShoesSize = '" . addslashes($server_contact_ShoesSize) . "',
contact_ShoesUOMCd = '" . addslashes($server_contact_ShoesUOMCd) . "',
contact_Government = '" . addslashes($server_contact_Government) . "',
contact_Website = '" . addslashes($server_contact_Website) . "',
contact_FixMargin = '" . addslashes($server_contact_FixMargin) . "',
contact_Owner = '" . addslashes($server_contact_Owner) . "',
contact_Principal = '" . addslashes($server_contact_Principal) . "',
contact_Supplier = '" . addslashes($server_contact_Supplier) . "',
contact_Customer = '" . addslashes($server_contact_Customer) . "',
contact_Competitor = '" . addslashes($server_contact_Competitor) . "',
contact_Employee = '" . addslashes($server_contact_Employee) . "',
contact_Prospect = '" . addslashes($server_contact_Prospect) . "',
contact_Bank = '" . addslashes($server_contact_Bank) . "',
contact_SuppPurchaseType = '" . addslashes($server_contact_SuppPurchaseType) . "',
contact_SOTOPCd = '" . addslashes($server_contact_SOTOPCd) . "',
contact_POTOPCd = '" . addslashes($server_contact_POTOPCd) . "',
contact_AlternateContactCd = '" . addslashes($server_contact_AlternateContactCd) . "',
contact_EmployeeCd = '" . addslashes($server_contact_EmployeeCd) . "',
contact_IsGrosir = '" . addslashes($server_contact_IsGrosir) . "',
contact_IsMember = '" . addslashes($server_contact_IsMember) . "',
contact_IsFullConsignment = '" . addslashes($server_contact_IsFullConsignment) . "',
contact_IsBranch = '" . addslashes($server_contact_IsBranch) . "',
contact_StatusApproval = '" . addslashes($server_contact_StatusApproval) . "',
contact_SF_Contact = '" . addslashes($server_contact_SF_Contact) . "',
contact_Forensic = '" . addslashes($server_contact_Forensic) . "',
contact_Deleteable = '" . addslashes($server_contact_Deleteable) . "',
contact_PortfolioCd = '" . addslashes($server_contact_PortfolioCd) . "',
contact_Sub_PortfolioCd = '" . addslashes($server_contact_Sub_PortfolioCd) . "',
contact_Description = '" . addslashes($server_contact_Description) . "',
contact_contactt_typeID = '" . addslashes($server_contact_contactt_typeID) . "',
contact_religion_mstrID = '" . addslashes($server_contact_religion_mstrID) . "',
contact_blood_typeID = '" . addslashes($server_contact_blood_typeID) . "',
contact_race_mstrID = '" . addslashes($server_contact_race_mstrID) . "',
contact_pilih = '" . addslashes($server_contact_pilih) . "',
contact_nationality_mstrID = '" . addslashes($server_contact_nationality_mstrID) . "',
contact_Weightmeasurement_uomID = '" . addslashes($server_contact_Weightmeasurement_uomID) . "',
contact_Heightmeasurement_uomID = '" . addslashes($server_contact_Heightmeasurement_uomID) . "',
contact_Shirtmeasurement_uomID = '" . addslashes($server_contact_Shirtmeasurement_uomID) . "',
contact_Shoesmeasurement_uomID = '" . addslashes($server_contact_Shoesmeasurement_uomID) . "',
contact_SOtop_mstrID = '" . addslashes($server_contact_SOtop_mstrID) . "',
contact_POtop_mstrID = '" . addslashes($server_contact_POtop_mstrID) . "',
contact__dihapus = '" . addslashes($server_contact__dihapus) . "',
contact__dihapus_time = '" . addslashes($server_contact__dihapus_time) . "',
contact_Courier = '" . addslashes($server_contact_Courier) . "',
contact_Islocal = '" . addslashes($server_contact_Islocal) . "',
contact_Picture = '" . addslashes($server_contact_Picture) . "',
contact_code_vd = '" . addslashes($server_contact_code_vd) . "',
contact_Reseller = '" . addslashes($server_contact_Reseller) . "',
contact_tax_mstrID = '" . addslashes($server_contact_tax_mstrID) . "',
contact_TaxCd = '" . addslashes($server_contact_TaxCd) . "',
contact_Designer = '" . addslashes($server_contact_Designer) . "',
contact_ContactNameMom = '" . addslashes($server_contact_ContactNameMom) . "',
contact_BirthDateMom = '" . addslashes($server_contact_BirthDateMom) . "'
WHERE contact_mstrID = " . $server_contact_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE contact_mstr=>' . $err_msg;
echo "\n";
echo 'server_contact_mstrID=>' . $server_contact_mstrID . ' ==>' . addslashes($server_contact_code_vd);
echo "\n";
$fp_stockopname = fopen('/xampp/htdocs/xampp/contact_mstr.html', "w+");
fwrite($fp_stockopname, $err_msg . "\n" . $sql_update . "\n");
fclose($fp_stockopname);
echo 'UPDATE contact_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'membert_type')
{
echo "\n";
echo 'Sebelum membert_type=>' . $err_msg;
echo "\n";
list($server_membert_typeID, $server_membert_create_user, $server_membert_create_time, $server_membert_edit_user, $server_membert_edit_time, $server_membert_ip, $server_membert_SysTrxId, $server_membert_Active, $server_membert_Approve, $server_membert_SyncronizeDate, $server_membert_LastExportDate, $server_membert_TotalImported, $server_membert_TotalExported, $server_membert_LastUpdateStamp, $server_membert_idRow, $server_membert_MemberTypeCd, $server_membert_MemberTypeName, $server_membert_FixPrice, $server_membert_Discdiscount_mstrID, $server_membert_DiscDiscountCd, $server_membert_SF_MemberType, $server_membert_Deleteable, $server_membert_Forensic, $server_membert_PortfolioCd, $server_membert_Sub_PortfolioCd, $server_membert_membert_typeID, $server_membert__dihapus, $server_membert__dihapus_time, $server_membert_NumberofMonthValid, $server_membert_Birthdaydiscount_mstrID, $server_membert_BirthdayDiscountCd, $server_membert_BeforeExpDay, $server_membert_BeforeExpShop, $server_membert_AfterExpDay, $server_membert_AfterExpShop, $server_membert_MinShop, $server_membert_RedeemPoint, $server_membert_RedeemValue, $server_membert_FromDate, $server_membert_ToDate) = explode('`', $line);
if ($server_membert_Active == '') $server_membert_Active = 'No';
if ($server_membert_Approve == '') $server_membert_Approve = 0;
if ($server_membert_TotalImported == '') $server_membert_TotalImported = 0;
if ($server_membert_TotalExported == '') $server_membert_TotalExported = 0;
if ($server_membert_idRow == '') $server_membert_idRow = 0;
if ($server_membert_FixPrice == '') $server_membert_FixPrice = 0;
if ($server_membert_Discdiscount_mstrID == '') $server_membert_Discdiscount_mstrID = 0;
if ($server_membert_Deleteable == '') $server_membert_Deleteable = 'No';
if ($server_membert_membert_typeID == '') $server_membert_membert_typeID = 0;
if ($server_membert__dihapus == '') $server_membert__dihapus = 'No';
if ($server_membert_NumberofMonthValid == '') $server_membert_NumberofMonthValid = 0;
if ($server_membert_Birthdaydiscount_mstrID == '') $server_membert_Birthdaydiscount_mstrID = 0;
if ($server_membert_BeforeExpDay == '') $server_membert_BeforeExpDay = 0;
if ($server_membert_BeforeExpShop == '') $server_membert_BeforeExpShop = 0;
if ($server_membert_AfterExpDay == '') $server_membert_AfterExpDay = 0;
if ($server_membert_AfterExpShop == '') $server_membert_AfterExpShop = 0;
if ($server_membert_MinShop == '') $server_membert_MinShop = 0;
if ($server_membert_RedeemPoint == '') $server_membert_RedeemPoint = 0;
if ($server_membert_RedeemValue == '') $server_membert_RedeemValue = 0;
if ($server_membert_FromDate == '') $server_membert_FromDate = '1900-01-01';
if ($server_membert_ToDate == '') $server_membert_ToDate = '2999-01-01';
$membert_typeID = 0;
$koneksi_membert_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT membert_typeID, membert_LastUpdateStamp FROM membert_type where membert_typeID = " . $server_membert_typeID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$membert_typeID = $row_koneksi['membert_typeID'];
$koneksi_membert_LastUpdateStamp = $row_koneksi['membert_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($membert_typeID == 0)
{
$sql_insert = "INSERT INTO membert_type SET
membert_typeID = '" . addslashes($server_membert_typeID) . "',
membert_create_user = '" . addslashes($server_membert_create_user) . "',
membert_create_time = '" . addslashes($server_membert_create_time) . "',
membert_edit_user = '" . addslashes($server_membert_edit_user) . "',
membert_edit_time = '" . addslashes($server_membert_edit_time) . "',
membert_ip = '" . addslashes($server_membert_ip) . "',
membert_SysTrxId = '" . addslashes($server_membert_SysTrxId) . "',
membert_Active = '" . addslashes($server_membert_Active) . "',
membert_Approve = '" . addslashes($server_membert_Approve) . "',
membert_SyncronizeDate = '" . addslashes($server_membert_SyncronizeDate) . "',
membert_LastExportDate = '" . addslashes($server_membert_LastExportDate) . "',
membert_TotalImported = '" . addslashes($server_membert_TotalImported) . "',
membert_TotalExported = '" . addslashes($server_membert_TotalExported) . "',
membert_LastUpdateStamp = '" . addslashes($server_membert_LastUpdateStamp) . "',
membert_idRow = '" . addslashes($server_membert_idRow) . "',
membert_MemberTypeCd = '" . addslashes($server_membert_MemberTypeCd) . "',
membert_MemberTypeName = '" . addslashes($server_membert_MemberTypeName) . "',
membert_FixPrice = '" . addslashes($server_membert_FixPrice) . "',
membert_Discdiscount_mstrID = '" . addslashes($server_membert_Discdiscount_mstrID) . "',
membert_DiscDiscountCd = '" . addslashes($server_membert_DiscDiscountCd) . "',
membert_SF_MemberType = '" . addslashes($server_membert_SF_MemberType) . "',
membert_Deleteable = '" . addslashes($server_membert_Deleteable) . "',
membert_Forensic = '" . addslashes($server_membert_Forensic) . "',
membert_PortfolioCd = '" . addslashes($server_membert_PortfolioCd) . "',
membert_Sub_PortfolioCd = '" . addslashes($server_membert_Sub_PortfolioCd) . "',
membert_membert_typeID = '" . addslashes($server_membert_membert_typeID) . "',
membert__dihapus = '" . addslashes($server_membert__dihapus) . "',
membert__dihapus_time = '" . addslashes($server_membert__dihapus_time) . "',
membert_NumberofMonthValid = '" . addslashes($server_membert_NumberofMonthValid) . "',
membert_Birthdaydiscount_mstrID = '" . addslashes($server_membert_Birthdaydiscount_mstrID) . "',
membert_BirthdayDiscountCd = '" . addslashes($server_membert_BirthdayDiscountCd) . "',
membert_BeforeExpDay = '" . addslashes($server_membert_BeforeExpDay) . "',
membert_BeforeExpShop = '" . addslashes($server_membert_BeforeExpShop) . "',
membert_AfterExpDay = '" . addslashes($server_membert_AfterExpDay) . "',
membert_AfterExpShop = '" . addslashes($server_membert_AfterExpShop) . "',
membert_MinShop = '" . addslashes($server_membert_MinShop) . "',
membert_RedeemPoint = '" . addslashes($server_membert_RedeemPoint) . "',
membert_RedeemValue = '" . addslashes($server_membert_RedeemValue) . "',
membert_FromDate = '" . addslashes($server_membert_FromDate) . "',
membert_ToDate = '" . addslashes($server_membert_ToDate) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert membert_type=>' . $err_msg;
echo "\n";
echo 'server_membert_typeID=>' . $server_membert_typeID;
echo "\n";
echo 'Insert membert_type=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE membert_type SET
membert_create_user = '" . addslashes($server_membert_create_user) . "',
membert_create_time = '" . addslashes($server_membert_create_time) . "',
membert_edit_user = '" . addslashes($server_membert_edit_user) . "',
membert_edit_time = '" . addslashes($server_membert_edit_time) . "',
membert_ip = '" . addslashes($server_membert_ip) . "',
membert_SysTrxId = '" . addslashes($server_membert_SysTrxId) . "',
membert_Active = '" . addslashes($server_membert_Active) . "',
membert_Approve = '" . addslashes($server_membert_Approve) . "',
membert_SyncronizeDate = '" . addslashes($server_membert_SyncronizeDate) . "',
membert_LastExportDate = '" . addslashes($server_membert_LastExportDate) . "',
membert_TotalImported = '" . addslashes($server_membert_TotalImported) . "',
membert_TotalExported = '" . addslashes($server_membert_TotalExported) . "',
membert_LastUpdateStamp = '" . addslashes($server_membert_LastUpdateStamp) . "',
membert_idRow = '" . addslashes($server_membert_idRow) . "',
membert_MemberTypeCd = '" . addslashes($server_membert_MemberTypeCd) . "',
membert_MemberTypeName = '" . addslashes($server_membert_MemberTypeName) . "',
membert_FixPrice = '" . addslashes($server_membert_FixPrice) . "',
membert_Discdiscount_mstrID = '" . addslashes($server_membert_Discdiscount_mstrID) . "',
membert_DiscDiscountCd = '" . addslashes($server_membert_DiscDiscountCd) . "',
membert_SF_MemberType = '" . addslashes($server_membert_SF_MemberType) . "',
membert_Deleteable = '" . addslashes($server_membert_Deleteable) . "',
membert_Forensic = '" . addslashes($server_membert_Forensic) . "',
membert_PortfolioCd = '" . addslashes($server_membert_PortfolioCd) . "',
membert_Sub_PortfolioCd = '" . addslashes($server_membert_Sub_PortfolioCd) . "',
membert_membert_typeID = '" . addslashes($server_membert_membert_typeID) . "',
membert__dihapus = '" . addslashes($server_membert__dihapus) . "',
membert__dihapus_time = '" . addslashes($server_membert__dihapus_time) . "',
membert_NumberofMonthValid = '" . addslashes($server_membert_NumberofMonthValid) . "',
membert_Birthdaydiscount_mstrID = '" . addslashes($server_membert_Birthdaydiscount_mstrID) . "',
membert_BirthdayDiscountCd = '" . addslashes($server_membert_BirthdayDiscountCd) . "',
membert_BeforeExpDay = '" . addslashes($server_membert_BeforeExpDay) . "',
membert_BeforeExpShop = '" . addslashes($server_membert_BeforeExpShop) . "',
membert_AfterExpDay = '" . addslashes($server_membert_AfterExpDay) . "',
membert_AfterExpShop = '" . addslashes($server_membert_AfterExpShop) . "',
membert_MinShop = '" . addslashes($server_membert_MinShop) . "',
membert_RedeemPoint = '" . addslashes($server_membert_RedeemPoint) . "',
membert_RedeemValue = '" . addslashes($server_membert_RedeemValue) . "',
membert_FromDate = '" . addslashes($server_membert_FromDate) . "',
membert_ToDate = '" . addslashes($server_membert_ToDate) . "'
WHERE membert_typeID = " . $server_membert_typeID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE membert_type=>' . $err_msg;
echo "\n";
echo 'server_membert_typeID=>' . $server_membert_typeID;
echo "\n";
echo 'UPDATE membert_type=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'discount_mstr')
{
echo "\n";
echo 'Sebelum discount_mstr=>' . $err_msg;
echo "\n";
list($server_discount_mstrID, $server_discount_create_user, $server_discount_create_time, $server_discount_edit_user, $server_discount_edit_time, $server_discount_ip, $server_discount_SysTrxId, $server_discount_Active, $server_discount_Approve, $server_discount_SyncronizeDate, $server_discount_LastExportDate, $server_discount_TotalImported, $server_discount_TotalExported, $server_discount_LastUpdateStamp, $server_discount_idRow, $server_discount_DiscountCd, $server_discount_BusinessUnitCd, $server_discount_DiscountName, $server_discount_Description, $server_discount_Percentage, $server_discount_Percentagextra, $server_discount_SF_Discount, $server_discount_Deleteable, $server_discount_Forensic, $server_discount_PortfolioCd, $server_discount_Sub_PortfolioCd, $server_discount_businessunit_mstrID, $server_discount__dihapus, $server_discount__dihapus_time) = explode('`', $line);
if ($server_discount_Active == '') $server_discount_Active = 'No';
if ($server_discount_Approve == '') $server_discount_Approve = 0;
if ($server_discount_TotalImported == '') $server_discount_TotalImported = 0;
if ($server_discount_TotalExported == '') $server_discount_TotalExported = 0;
if ($server_discount_idRow == '') $server_discount_idRow = 0;
if ($server_discount_Percentage == '') $server_discount_Percentage = 0;
if ($server_discount_Percentagextra == '') $server_discount_Percentagextra = 0;
if ($server_discount_Deleteable == '') $server_discount_Deleteable = 'No';
if ($server_discount_businessunit_mstrID == '') $server_discount_businessunit_mstrID = 0;
if ($server_discount__dihapus == '') $server_discount__dihapus = 'No';
$discount_mstrID = 0;
$koneksi_discount_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT discount_mstrID, discount_LastUpdateStamp FROM discount_mstr where discount_mstrID = " . $server_discount_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$discount_mstrID = $row_koneksi['discount_mstrID'];
$koneksi_discount_LastUpdateStamp = $row_koneksi['discount_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($discount_mstrID == 0)
{
$sql_insert = "INSERT INTO discount_mstr SET
discount_mstrID = '" . addslashes($server_discount_mstrID) . "',
discount_create_user = '" . addslashes($server_discount_create_user) . "',
discount_create_time = '" . addslashes($server_discount_create_time) . "',
discount_edit_user = '" . addslashes($server_discount_edit_user) . "',
discount_edit_time = '" . addslashes($server_discount_edit_time) . "',
discount_ip = '" . addslashes($server_discount_ip) . "',
discount_SysTrxId = '" . addslashes($server_discount_SysTrxId) . "',
discount_Active = '" . addslashes($server_discount_Active) . "',
discount_Approve = '" . addslashes($server_discount_Approve) . "',
discount_SyncronizeDate = '" . addslashes($server_discount_SyncronizeDate) . "',
discount_LastExportDate = '" . addslashes($server_discount_LastExportDate) . "',
discount_TotalImported = '" . addslashes($server_discount_TotalImported) . "',
discount_TotalExported = '" . addslashes($server_discount_TotalExported) . "',
discount_LastUpdateStamp = '" . addslashes($server_discount_LastUpdateStamp) . "',
discount_idRow = '" . addslashes($server_discount_idRow) . "',
discount_DiscountCd = '" . addslashes($server_discount_DiscountCd) . "',
discount_BusinessUnitCd = '" . addslashes($server_discount_BusinessUnitCd) . "',
discount_DiscountName = '" . addslashes($server_discount_DiscountName) . "',
discount_Description = '" . addslashes($server_discount_Description) . "',
discount_Percentage = '" . addslashes($server_discount_Percentage) . "',
discount_Percentagextra = '" . addslashes($server_discount_Percentagextra) . "',
discount_SF_Discount = '" . addslashes($server_discount_SF_Discount) . "',
discount_Deleteable = '" . addslashes($server_discount_Deleteable) . "',
discount_Forensic = '" . addslashes($server_discount_Forensic) . "',
discount_PortfolioCd = '" . addslashes($server_discount_PortfolioCd) . "',
discount_Sub_PortfolioCd = '" . addslashes($server_discount_Sub_PortfolioCd) . "',
discount_businessunit_mstrID = '" . addslashes($server_discount_businessunit_mstrID) . "',
discount__dihapus = '" . addslashes($server_discount__dihapus) . "',
discount__dihapus_time = '" . addslashes($server_discount__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert discount_mstr=>' . $err_msg;
echo "\n";
echo 'server_discount_mstrID=>' . $server_discount_mstrID;
echo "\n";
echo 'Insert discount_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE discount_mstr SET
discount_mstrID = '" . addslashes($server_discount_mstrID) . "',
discount_create_user = '" . addslashes($server_discount_create_user) . "',
discount_create_time = '" . addslashes($server_discount_create_time) . "',
discount_edit_user = '" . addslashes($server_discount_edit_user) . "',
discount_edit_time = '" . addslashes($server_discount_edit_time) . "',
discount_ip = '" . addslashes($server_discount_ip) . "',
discount_SysTrxId = '" . addslashes($server_discount_SysTrxId) . "',
discount_Active = '" . addslashes($server_discount_Active) . "',
discount_Approve = '" . addslashes($server_discount_Approve) . "',
discount_SyncronizeDate = '" . addslashes($server_discount_SyncronizeDate) . "',
discount_LastExportDate = '" . addslashes($server_discount_LastExportDate) . "',
discount_TotalImported = '" . addslashes($server_discount_TotalImported) . "',
discount_TotalExported = '" . addslashes($server_discount_TotalExported) . "',
discount_LastUpdateStamp = '" . addslashes($server_discount_LastUpdateStamp) . "',
discount_idRow = '" . addslashes($server_discount_idRow) . "',
discount_DiscountCd = '" . addslashes($server_discount_DiscountCd) . "',
discount_BusinessUnitCd = '" . addslashes($server_discount_BusinessUnitCd) . "',
discount_DiscountName = '" . addslashes($server_discount_DiscountName) . "',
discount_Description = '" . addslashes($server_discount_Description) . "',
discount_Percentage = '" . addslashes($server_discount_Percentage) . "',
discount_Percentagextra = '" . addslashes($server_discount_Percentagextra) . "',
discount_SF_Discount = '" . addslashes($server_discount_SF_Discount) . "',
discount_Deleteable = '" . addslashes($server_discount_Deleteable) . "',
discount_Forensic = '" . addslashes($server_discount_Forensic) . "',
discount_PortfolioCd = '" . addslashes($server_discount_PortfolioCd) . "',
discount_Sub_PortfolioCd = '" . addslashes($server_discount_Sub_PortfolioCd) . "',
discount_businessunit_mstrID = '" . addslashes($server_discount_businessunit_mstrID) . "',
discount__dihapus = '" . addslashes($server_discount__dihapus) . "',
discount__dihapus_time = '" . addslashes($server_discount__dihapus_time) . "'
WHERE discount_mstrID = " . $server_discount_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE discount_mstr=>' . $err_msg;
echo "\n";
echo 'server_discount_mstrID=>' . $server_discount_mstrID;
echo "\n";
echo 'UPDATE discount_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'edcassign_mstr')
{
echo "\n";
echo 'Sebelum edcassign_mstr=>' . $err_msg;
echo "\n";
list($server_edcassign_mstrID, $server_edcassign_create_user, $server_edcassign_create_time, $server_edcassign_edit_user, $server_edcassign_edit_time, $server_edcassign_ip, $server_edcassign_SysTrxId, $server_edcassign_Active, $server_edcassign_Approve, $server_edcassign_SyncronizeDate, $server_edcassign_LastExportDate, $server_edcassign_TotalImported, $server_edcassign_TotalExported, $server_edcassign_LastUpdateStamp, $server_edcassign_idRow, $server_edcassign_ContactCd, $server_edcassign_AddressCd, $server_edcassign_LocationCd, $server_edcassign_EDCCd, $server_edcassign_EDCName, $server_edcassign_Description, $server_edcassign_SF_MachineEDC, $server_edcassign_Deleteable, $server_edcassign_Forensic, $server_edcassign_PortfolioCd, $server_edcassign_Sub_PortfolioCd, $server_edcassign_contact_mstrID, $server_edcassign_add_mstrID, $server_edcassign_loc_mstrID, $server_edcassign_edc_mstrID, $server_edcassign__dihapus, $server_edcassign__dihapus_time) = explode('`', $line);
if ($server_edcassign_Active == '') $server_edcassign_Active = 'No';
if ($server_edcassign_Approve == '') $server_edcassign_Approve = 0;
if ($server_edcassign_TotalImported == '') $server_edcassign_TotalImported = 0;
if ($server_edcassign_TotalExported == '') $server_edcassign_TotalExported = 0;
if ($server_edcassign_idRow == '') $server_edcassign_idRow = 0;
if ($server_edcassign_Deleteable == '') $server_edcassign_Deleteable = 'No';
if ($server_edcassign_contact_mstrID == '') $server_edcassign_contact_mstrID = 0;
if ($server_edcassign_add_mstrID == '') $server_edcassign_add_mstrID = 0;
if ($server_edcassign_loc_mstrID == '') $server_edcassign_loc_mstrID = 0;
if ($server_edcassign_edc_mstrID == '') $server_edcassign_edc_mstrID = 0;
if ($server_edcassign__dihapus == '') $server_edcassign__dihapus = 'No';
$edcassign_mstrID = 0;
$koneksi_edcassign_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT edcassign_mstrID, edcassign_LastUpdateStamp FROM edcassign_mstr where edcassign_mstrID = " . $server_edcassign_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$edcassign_mstrID = $row_koneksi['edcassign_mstrID'];
$koneksi_edcassign_LastUpdateStamp = $row_koneksi['edcassign_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($edcassign_mstrID == 0)
{
$sql_insert = "INSERT INTO edcassign_mstr SET
edcassign_mstrID = '" . addslashes($server_edcassign_mstrID) . "',
edcassign_create_user = '" . addslashes($server_edcassign_create_user) . "',
edcassign_create_time = '" . addslashes($server_edcassign_create_time) . "',
edcassign_edit_user = '" . addslashes($server_edcassign_edit_user) . "',
edcassign_edit_time = '" . addslashes($server_edcassign_edit_time) . "',
edcassign_ip = '" . addslashes($server_edcassign_ip) . "',
edcassign_SysTrxId = '" . addslashes($server_edcassign_SysTrxId) . "',
edcassign_Active = '" . addslashes($server_edcassign_Active) . "',
edcassign_Approve = '" . addslashes($server_edcassign_Approve) . "',
edcassign_SyncronizeDate = '" . addslashes($server_edcassign_SyncronizeDate) . "',
edcassign_LastExportDate = '" . addslashes($server_edcassign_LastExportDate) . "',
edcassign_TotalImported = '" . addslashes($server_edcassign_TotalImported) . "',
edcassign_TotalExported = '" . addslashes($server_edcassign_TotalExported) . "',
edcassign_LastUpdateStamp = '" . addslashes($server_edcassign_LastUpdateStamp) . "',
edcassign_idRow = '" . addslashes($server_edcassign_idRow) . "',
edcassign_ContactCd = '" . addslashes($server_edcassign_ContactCd) . "',
edcassign_AddressCd = '" . addslashes($server_edcassign_AddressCd) . "',
edcassign_LocationCd = '" . addslashes($server_edcassign_LocationCd) . "',
edcassign_EDCCd = '" . addslashes($server_edcassign_EDCCd) . "',
edcassign_EDCName = '" . addslashes($server_edcassign_EDCName) . "',
edcassign_Description = '" . addslashes($server_edcassign_Description) . "',
edcassign_SF_MachineEDC = '" . addslashes($server_edcassign_SF_MachineEDC) . "',
edcassign_Deleteable = '" . addslashes($server_edcassign_Deleteable) . "',
edcassign_Forensic = '" . addslashes($server_edcassign_Forensic) . "',
edcassign_PortfolioCd = '" . addslashes($server_edcassign_PortfolioCd) . "',
edcassign_Sub_PortfolioCd = '" . addslashes($server_edcassign_Sub_PortfolioCd) . "',
edcassign_contact_mstrID = '" . addslashes($server_edcassign_contact_mstrID) . "',
edcassign_add_mstrID = '" . addslashes($server_edcassign_add_mstrID) . "',
edcassign_loc_mstrID = '" . addslashes($server_edcassign_loc_mstrID) . "',
edcassign_edc_mstrID = '" . addslashes($server_edcassign_edc_mstrID) . "',
edcassign__dihapus = '" . addslashes($server_edcassign__dihapus) . "',
edcassign__dihapus_time = '" . addslashes($server_edcassign__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert edcassign_mstr=>' . $err_msg;
echo "\n";
echo 'server_edcassign_mstrID=>' . $server_edcassign_mstrID;
echo "\n";
echo 'Insert edcassign_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE edcassign_mstr SET
edcassign_create_user = '" . addslashes($server_edcassign_create_user) . "',
edcassign_create_time = '" . addslashes($server_edcassign_create_time) . "',
edcassign_edit_user = '" . addslashes($server_edcassign_edit_user) . "',
edcassign_edit_time = '" . addslashes($server_edcassign_edit_time) . "',
edcassign_ip = '" . addslashes($server_edcassign_ip) . "',
edcassign_SysTrxId = '" . addslashes($server_edcassign_SysTrxId) . "',
edcassign_Active = '" . addslashes($server_edcassign_Active) . "',
edcassign_Approve = '" . addslashes($server_edcassign_Approve) . "',
edcassign_SyncronizeDate = '" . addslashes($server_edcassign_SyncronizeDate) . "',
edcassign_LastExportDate = '" . addslashes($server_edcassign_LastExportDate) . "',
edcassign_TotalImported = '" . addslashes($server_edcassign_TotalImported) . "',
edcassign_TotalExported = '" . addslashes($server_edcassign_TotalExported) . "',
edcassign_LastUpdateStamp = '" . addslashes($server_edcassign_LastUpdateStamp) . "',
edcassign_idRow = '" . addslashes($server_edcassign_idRow) . "',
edcassign_ContactCd = '" . addslashes($server_edcassign_ContactCd) . "',
edcassign_AddressCd = '" . addslashes($server_edcassign_AddressCd) . "',
edcassign_LocationCd = '" . addslashes($server_edcassign_LocationCd) . "',
edcassign_EDCCd = '" . addslashes($server_edcassign_EDCCd) . "',
edcassign_EDCName = '" . addslashes($server_edcassign_EDCName) . "',
edcassign_Description = '" . addslashes($server_edcassign_Description) . "',
edcassign_SF_MachineEDC = '" . addslashes($server_edcassign_SF_MachineEDC) . "',
edcassign_Deleteable = '" . addslashes($server_edcassign_Deleteable) . "',
edcassign_Forensic = '" . addslashes($server_edcassign_Forensic) . "',
edcassign_PortfolioCd = '" . addslashes($server_edcassign_PortfolioCd) . "',
edcassign_Sub_PortfolioCd = '" . addslashes($server_edcassign_Sub_PortfolioCd) . "',
edcassign_contact_mstrID = '" . addslashes($server_edcassign_contact_mstrID) . "',
edcassign_add_mstrID = '" . addslashes($server_edcassign_add_mstrID) . "',
edcassign_loc_mstrID = '" . addslashes($server_edcassign_loc_mstrID) . "',
edcassign_edc_mstrID = '" . addslashes($server_edcassign_edc_mstrID) . "',
edcassign__dihapus = '" . addslashes($server_edcassign__dihapus) . "',
edcassign__dihapus_time = '" . addslashes($server_edcassign__dihapus_time) . "'
WHERE edcassign_mstrID = " . $server_edcassign_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE edcassign_mstr=>' . $err_msg;
echo "\n";
echo 'server_edcassign_mstrID=>' . $server_edcassign_mstrID;
echo "\n";
echo 'UPDATE edcassign_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'userassign_det')
{
echo "\n";
echo 'Sebelum userassign_det=>' . $err_msg;
echo "\n";
list($server_userassign_detID, $server_userassign_create_user, $server_userassign_create_time, $server_userassign_edit_user, $server_userassign_edit_time, $server_userassign_ip, $server_userassign_SysTrxId, $server_userassign_Active, $server_userassign_Approve, $server_userassign_SyncronizeDate, $server_userassign_LastExportDate, $server_userassign_TotalImported, $server_userassign_TotalExported, $server_userassign_LastUpdateStamp, $server_userassign_idRow, $server_userassign_email, $server_userassign_LocationCd, $server_userassign_Password, $server_userassign_SF_UserLocation, $server_userassign_Forensic, $server_userassign_PortfolioCd, $server_userassign_Sub_PortfolioCd, $server_userassign_loc_mstrID, $server_userassign__dihapus, $server_userassign__dihapus_time, $server_userassign_level, $server_userassign_acc_mstrID) = explode('`', $line);
if ($server_userassign_Active == '') $server_userassign_Active = 'No';
if ($server_userassign_Approve == '') $server_userassign_Approve = 0;
if ($server_userassign_TotalImported == '') $server_userassign_TotalImported = 0;
if ($server_userassign_TotalExported == '') $server_userassign_TotalExported = 0;
if ($server_userassign_idRow == '') $server_userassign_idRow = 0;
if ($server_userassign_loc_mstrID == '') $server_userassign_loc_mstrID = 0;
if ($server_userassign__dihapus == '') $server_userassign__dihapus = 'No';
if ($server_userassign_level == '') $server_userassign_level = 0;
if ($server_userassign_acc_mstrID == '') $server_userassign_acc_mstrID = 0;
$userassign_detID = 0;
$koneksi_userassign_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT userassign_detID, userassign_LastUpdateStamp FROM userassign_det where userassign_detID = " . $server_userassign_detID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$userassign_detID = $row_koneksi['userassign_detID'];
$koneksi_userassign_LastUpdateStamp = $row_koneksi['userassign_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($userassign_detID == 0)
{
$sql_insert = "INSERT INTO userassign_det SET
userassign_detID = '" . addslashes($server_userassign_detID) . "',
userassign_create_user = '" . addslashes($server_userassign_create_user) . "',
userassign_create_time = '" . addslashes($server_userassign_create_time) . "',
userassign_edit_user = '" . addslashes($server_userassign_edit_user) . "',
userassign_edit_time = '" . addslashes($server_userassign_edit_time) . "',
userassign_ip = '" . addslashes($server_userassign_ip) . "',
userassign_SysTrxId = '" . addslashes($server_userassign_SysTrxId) . "',
userassign_Active = '" . addslashes($server_userassign_Active) . "',
userassign_Approve = '" . addslashes($server_userassign_Approve) . "',
userassign_SyncronizeDate = '" . addslashes($server_userassign_SyncronizeDate) . "',
userassign_LastExportDate = '" . addslashes($server_userassign_LastExportDate) . "',
userassign_TotalImported = '" . addslashes($server_userassign_TotalImported) . "',
userassign_TotalExported = '" . addslashes($server_userassign_TotalExported) . "',
userassign_LastUpdateStamp = '" . addslashes($server_userassign_LastUpdateStamp) . "',
userassign_idRow = '" . addslashes($server_userassign_idRow) . "',
userassign_email = '" . addslashes($server_userassign_email) . "',
userassign_LocationCd = '" . addslashes($server_userassign_LocationCd) . "',
userassign_Password = '" . addslashes($server_userassign_Password) . "',
userassign_SF_UserLocation = '" . addslashes($server_userassign_SF_UserLocation) . "',
userassign_Forensic = '" . addslashes($server_userassign_Forensic) . "',
userassign_PortfolioCd = '" . addslashes($server_userassign_PortfolioCd) . "',
userassign_Sub_PortfolioCd = '" . addslashes($server_userassign_Sub_PortfolioCd) . "',
userassign_loc_mstrID = '" . addslashes($server_userassign_loc_mstrID) . "',
userassign__dihapus = '" . addslashes($server_userassign__dihapus) . "',
userassign__dihapus_time = '" . addslashes($server_userassign__dihapus_time) . "',
userassign_level = '" . addslashes($server_userassign_level) . "',
userassign_acc_mstrID = '" . addslashes($server_userassign_acc_mstrID) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert userassign_det=>' . $err_msg;
echo "\n";
echo 'server_userassign_detID=>' . $server_userassign_detID;
echo "\n";
echo 'Insert userassign_det=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE userassign_det SET
userassign_create_user = '" . addslashes($server_userassign_create_user) . "',
userassign_create_time = '" . addslashes($server_userassign_create_time) . "',
userassign_edit_user = '" . addslashes($server_userassign_edit_user) . "',
userassign_edit_time = '" . addslashes($server_userassign_edit_time) . "',
userassign_ip = '" . addslashes($server_userassign_ip) . "',
userassign_SysTrxId = '" . addslashes($server_userassign_SysTrxId) . "',
userassign_Active = '" . addslashes($server_userassign_Active) . "',
userassign_Approve = '" . addslashes($server_userassign_Approve) . "',
userassign_SyncronizeDate = '" . addslashes($server_userassign_SyncronizeDate) . "',
userassign_LastExportDate = '" . addslashes($server_userassign_LastExportDate) . "',
userassign_TotalImported = '" . addslashes($server_userassign_TotalImported) . "',
userassign_TotalExported = '" . addslashes($server_userassign_TotalExported) . "',
userassign_LastUpdateStamp = '" . addslashes($server_userassign_LastUpdateStamp) . "',
userassign_idRow = '" . addslashes($server_userassign_idRow) . "',
userassign_email = '" . addslashes($server_userassign_email) . "',
userassign_LocationCd = '" . addslashes($server_userassign_LocationCd) . "',
userassign_Password = '" . addslashes($server_userassign_Password) . "',
userassign_SF_UserLocation = '" . addslashes($server_userassign_SF_UserLocation) . "',
userassign_Forensic = '" . addslashes($server_userassign_Forensic) . "',
userassign_PortfolioCd = '" . addslashes($server_userassign_PortfolioCd) . "',
userassign_Sub_PortfolioCd = '" . addslashes($server_userassign_Sub_PortfolioCd) . "',
userassign_loc_mstrID = '" . addslashes($server_userassign_loc_mstrID) . "',
userassign__dihapus = '" . addslashes($server_userassign__dihapus) . "',
userassign__dihapus_time = '" . addslashes($server_userassign__dihapus_time) . "',
userassign_level = '" . addslashes($server_userassign_level) . "',
userassign_acc_mstrID = '" . addslashes($server_userassign_acc_mstrID) . "'
WHERE userassign_detID = " . $server_userassign_detID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE userassign_det=>' . $err_msg;
echo "\n";
echo 'server_userassign_detID=>' . $server_userassign_detID;
echo "\n";
echo 'UPDATE userassign_det=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'edc_mstr')
{
echo "\n";
echo 'Sebelum edc_mstr=>' . $err_msg;
echo "\n";
list($server_edc_mstrID, $server_edc_create_user, $server_edc_create_time, $server_edc_edit_user, $server_edc_edit_time, $server_edc_ip, $server_edc_SysTrxId, $server_edc_Active, $server_edc_Approve, $server_edc_SyncronizeDate, $server_edc_LastExportDate, $server_edc_TotalImported, $server_edc_TotalExported, $server_edc_LastUpdateStamp, $server_edc_idRow, $server_edc_EDCCd, $server_edc_EDCName, $server_edc_Description, $server_edc_SF_EDC, $server_edc_Deleteable, $server_edc_Forensic, $server_edc_PortfolioCd, $server_edc_Sub_PortfolioCd, $server_edc__dihapus, $server_edc__dihapus_time) = explode('`', $line);
if ($server_edc_Active == '') $server_edc_Active = 'No';
if ($server_edc_Approve == '') $server_edc_Approve = 0;
if ($server_edc_TotalImported == '') $server_edc_TotalImported = 0;
if ($server_edc_TotalExported == '') $server_edc_TotalExported = 0;
if ($server_edc_idRow == '') $server_edc_idRow = 0;
if ($server_edc_Deleteable == '') $server_edc_Deleteable = 'No';
if ($server_edc__dihapus == '') $server_edc__dihapus = 'No';
$edc_mstrID = 0;
$koneksi_edc_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT edc_mstrID, edc_LastUpdateStamp FROM edc_mstr where edc_mstrID = " . $server_edc_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$edc_mstrID = $row_koneksi['edc_mstrID'];
$koneksi_edc_LastUpdateStamp = $row_koneksi['edc_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($edc_mstrID == 0)
{
$sql_insert = "INSERT INTO edc_mstr SET
edc_mstrID = '" . addslashes($server_edc_mstrID) . "',
edc_create_user = '" . addslashes($server_edc_create_user) . "',
edc_create_time = '" . addslashes($server_edc_create_time) . "',
edc_edit_user = '" . addslashes($server_edc_edit_user) . "',
edc_edit_time = '" . addslashes($server_edc_edit_time) . "',
edc_ip = '" . addslashes($server_edc_ip) . "',
edc_SysTrxId = '" . addslashes($server_edc_SysTrxId) . "',
edc_Active = '" . addslashes($server_edc_Active) . "',
edc_Approve = '" . addslashes($server_edc_Approve) . "',
edc_SyncronizeDate = '" . addslashes($server_edc_SyncronizeDate) . "',
edc_LastExportDate = '" . addslashes($server_edc_LastExportDate) . "',
edc_TotalImported = '" . addslashes($server_edc_TotalImported) . "',
edc_TotalExported = '" . addslashes($server_edc_TotalExported) . "',
edc_LastUpdateStamp = '" . addslashes($server_edc_LastUpdateStamp) . "',
edc_idRow = '" . addslashes($server_edc_idRow) . "',
edc_EDCCd = '" . addslashes($server_edc_EDCCd) . "',
edc_EDCName = '" . addslashes($server_edc_EDCName) . "',
edc_Description = '" . addslashes($server_edc_Description) . "',
edc_SF_EDC = '" . addslashes($server_edc_SF_EDC) . "',
edc_Deleteable = '" . addslashes($server_edc_Deleteable) . "',
edc_Forensic = '" . addslashes($server_edc_Forensic) . "',
edc_PortfolioCd = '" . addslashes($server_edc_PortfolioCd) . "',
edc_Sub_PortfolioCd = '" . addslashes($server_edc_Sub_PortfolioCd) . "',
edc__dihapus = '" . addslashes($server_edc__dihapus) . "',
edc__dihapus_time = '" . addslashes($server_edc__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert edc_mstr=>' . $err_msg;
echo "\n";
echo 'server_edc_mstrID=>' . $server_edc_mstrID;
echo "\n";
echo 'Insert edc_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE edc_mstr SET
edc_create_user = '" . addslashes($server_edc_create_user) . "',
edc_create_time = '" . addslashes($server_edc_create_time) . "',
edc_edit_user = '" . addslashes($server_edc_edit_user) . "',
edc_edit_time = '" . addslashes($server_edc_edit_time) . "',
edc_ip = '" . addslashes($server_edc_ip) . "',
edc_SysTrxId = '" . addslashes($server_edc_SysTrxId) . "',
edc_Active = '" . addslashes($server_edc_Active) . "',
edc_Approve = '" . addslashes($server_edc_Approve) . "',
edc_SyncronizeDate = '" . addslashes($server_edc_SyncronizeDate) . "',
edc_LastExportDate = '" . addslashes($server_edc_LastExportDate) . "',
edc_TotalImported = '" . addslashes($server_edc_TotalImported) . "',
edc_TotalExported = '" . addslashes($server_edc_TotalExported) . "',
edc_LastUpdateStamp = '" . addslashes($server_edc_LastUpdateStamp) . "',
edc_idRow = '" . addslashes($server_edc_idRow) . "',
edc_EDCCd = '" . addslashes($server_edc_EDCCd) . "',
edc_EDCName = '" . addslashes($server_edc_EDCName) . "',
edc_Description = '" . addslashes($server_edc_Description) . "',
edc_SF_EDC = '" . addslashes($server_edc_SF_EDC) . "',
edc_Deleteable = '" . addslashes($server_edc_Deleteable) . "',
edc_Forensic = '" . addslashes($server_edc_Forensic) . "',
edc_PortfolioCd = '" . addslashes($server_edc_PortfolioCd) . "',
edc_Sub_PortfolioCd = '" . addslashes($server_edc_Sub_PortfolioCd) . "',
edc__dihapus = '" . addslashes($server_edc__dihapus) . "',
edc__dihapus_time = '" . addslashes($server_edc__dihapus_time) . "'
WHERE edc_mstrID = " . $server_edc_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE edc_mstr=>' . $err_msg;
echo "\n";
echo 'server_edc_mstrID=>' . $server_edc_mstrID;
echo "\n";
echo 'UPDATE edc_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'stockadjd_detail')
{
echo "\n";
echo 'Sebelum stockadjd_detail=>' . $err_msg;
echo "\n";
list($server_stockadjd_detailID, $server_stockadjd_create_user, $server_stockadjd_create_time, $server_stockadjd_edit_user, $server_stockadjd_edit_time, $server_stockadjd_ip, $server_stockadjd_SysTrxId, $server_stockadjd_Active, $server_stockadjd_Approve, $server_stockadjd_SyncronizeDate, $server_stockadjd_LastExportDate, $server_stockadjd_TotalImported, $server_stockadjd_TotalExported, $server_stockadjd_LastUpdateStamp, $server_stockadjd_idRow, $server_stockadjd_AdjustmentNo, $server_stockadjd_SequenceNo, $server_stockadjd_ItemCd, $server_stockadjd_ItemSKUCd, $server_stockadjd_UOMCd, $server_stockadjd_Quantity, $server_stockadjd_LocationCd, $server_stockadjd_ReasonCd, $server_stockadjd_Remark, $server_stockadjd_SF_AdjustmentDetail, $server_stockadjd_Cost, $server_stockadjd_Deleteable, $server_stockadjd_Forensic, $server_stockadjd_PortfolioCd, $server_stockadjd_Sub_PortfolioCd, $server_stockadjd_stockadjh_headerID, $server_stockadjd_loc_mstrID, $server_stockadjd_reason_mstrID, $server_stockadjd_productitem_mstrID, $server_stockadjd_itemsku_mstrID, $server_stockadjd_measurement_uomID, $server_stockadjd__dihapus, $server_stockadjd__dihapus_time, $server_stockadjd_PStatus, $server_stockadjd_stockopnameh_headerID, $server_stockadjd_stockopnamed_detailID, $server_stockadjd_picklisth_headerID, $server_stockadjd_picklistd_detailID, $server_stockadjd_oldcd, $server_stockadjd_AdjustmentDate) = explode('`', $line);
if ($server_stockadjd_Active == '') $server_stockadjd_Active = 'No';
if ($server_stockadjd_Approve == '') $server_stockadjd_Approve = 0;
if ($server_stockadjd_TotalImported == '') $server_stockadjd_TotalImported = 0;
if ($server_stockadjd_TotalExported == '') $server_stockadjd_TotalExported = 0;
if ($server_stockadjd_idRow == '') $server_stockadjd_idRow = 0;
if ($server_stockadjd_SequenceNo == '') $server_stockadjd_SequenceNo = 0;
if ($server_stockadjd_Quantity == '') $server_stockadjd_Quantity = 0;
if ($server_stockadjd_Cost == '') $server_stockadjd_Cost = 0;
if ($server_stockadjd_Deleteable == '') $server_stockadjd_Deleteable = 'No';
if ($server_stockadjd_stockadjh_headerID == '') $server_stockadjd_stockadjh_headerID = 0;
if ($server_stockadjd_loc_mstrID == '') $server_stockadjd_loc_mstrID = 0;
if ($server_stockadjd_reason_mstrID == '') $server_stockadjd_reason_mstrID = 0;
if ($server_stockadjd_productitem_mstrID == '') $server_stockadjd_productitem_mstrID = 0;
if ($server_stockadjd_itemsku_mstrID == '') $server_stockadjd_itemsku_mstrID = 0;
if ($server_stockadjd_measurement_uomID == '') $server_stockadjd_measurement_uomID = 0;
if ($server_stockadjd__dihapus == '') $server_stockadjd__dihapus = 'No';
if ($server_stockadjd_stockopnameh_headerID == '') $server_stockadjd_stockopnameh_headerID = 0;
if ($server_stockadjd_stockopnamed_detailID == '') $server_stockadjd_stockopnamed_detailID = 0;
if ($server_stockadjd_picklisth_headerID == '') $server_stockadjd_picklisth_headerID = 0;
if ($server_stockadjd_picklistd_detailID == '') $server_stockadjd_picklistd_detailID = 0;
if ($server_stockadjd_AdjustmentDate == '') $server_stockadjd_AdjustmentDate = '1900-01-01';
$stockadjd_detailID = 0;
$koneksi_stockadjd_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT stockadjd_detailID, stockadjd_LastUpdateStamp FROM stockadjd_detail where stockadjd_detailID = " . $server_stockadjd_detailID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$stockadjd_detailID = $row_koneksi['stockadjd_detailID'];
$koneksi_stockadjd_LastUpdateStamp = $row_koneksi['stockadjd_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($stockadjd_detailID == 0)
{
$sql_insert = "INSERT INTO stockadjd_detail SET
stockadjd_detailID = '" . addslashes($server_stockadjd_detailID) . "',
stockadjd_create_user = '" . addslashes($server_stockadjd_create_user) . "',
stockadjd_create_time = '" . addslashes($server_stockadjd_create_time) . "',
stockadjd_edit_user = '" . addslashes($server_stockadjd_edit_user) . "',
stockadjd_edit_time = '" . addslashes($server_stockadjd_edit_time) . "',
stockadjd_ip = '" . addslashes($server_stockadjd_ip) . "',
stockadjd_SysTrxId = '" . addslashes($server_stockadjd_SysTrxId) . "',
stockadjd_Active = '" . addslashes($server_stockadjd_Active) . "',
stockadjd_Approve = '" . addslashes($server_stockadjd_Approve) . "',
stockadjd_SyncronizeDate = '" . addslashes($server_stockadjd_SyncronizeDate) . "',
stockadjd_LastExportDate = '" . addslashes($server_stockadjd_LastExportDate) . "',
stockadjd_TotalImported = '" . addslashes($server_stockadjd_TotalImported) . "',
stockadjd_TotalExported = '" . addslashes($server_stockadjd_TotalExported) . "',
stockadjd_LastUpdateStamp = '" . addslashes($server_stockadjd_LastUpdateStamp) . "',
stockadjd_idRow = '" . addslashes($server_stockadjd_idRow) . "',
stockadjd_AdjustmentNo = '" . addslashes($server_stockadjd_AdjustmentNo) . "',
stockadjd_SequenceNo = '" . addslashes($server_stockadjd_SequenceNo) . "',
stockadjd_ItemCd = '" . addslashes($server_stockadjd_ItemCd) . "',
stockadjd_ItemSKUCd = '" . addslashes($server_stockadjd_ItemSKUCd) . "',
stockadjd_UOMCd = '" . addslashes($server_stockadjd_UOMCd) . "',
stockadjd_Quantity = '" . addslashes($server_stockadjd_Quantity) . "',
stockadjd_LocationCd = '" . addslashes($server_stockadjd_LocationCd) . "',
stockadjd_ReasonCd = '" . addslashes($server_stockadjd_ReasonCd) . "',
stockadjd_Remark = '" . addslashes($server_stockadjd_Remark) . "',
stockadjd_SF_AdjustmentDetail = '" . addslashes($server_stockadjd_SF_AdjustmentDetail) . "',
stockadjd_Cost = '" . addslashes($server_stockadjd_Cost) . "',
stockadjd_Deleteable = '" . addslashes($server_stockadjd_Deleteable) . "',
stockadjd_Forensic = '" . addslashes($server_stockadjd_Forensic) . "',
stockadjd_PortfolioCd = '" . addslashes($server_stockadjd_PortfolioCd) . "',
stockadjd_Sub_PortfolioCd = '" . addslashes($server_stockadjd_Sub_PortfolioCd) . "',
stockadjd_stockadjh_headerID = '" . addslashes($server_stockadjd_stockadjh_headerID) . "',
stockadjd_loc_mstrID = '" . addslashes($server_stockadjd_loc_mstrID) . "',
stockadjd_reason_mstrID = '" . addslashes($server_stockadjd_reason_mstrID) . "',
stockadjd_productitem_mstrID = '" . addslashes($server_stockadjd_productitem_mstrID) . "',
stockadjd_itemsku_mstrID = '" . addslashes($server_stockadjd_itemsku_mstrID) . "',
stockadjd_measurement_uomID = '" . addslashes($server_stockadjd_measurement_uomID) . "',
stockadjd__dihapus = '" . addslashes($server_stockadjd__dihapus) . "',
stockadjd__dihapus_time = '" . addslashes($server_stockadjd__dihapus_time) . "',
stockadjd_PStatus = '" . addslashes($server_stockadjd_PStatus) . "',
stockadjd_stockopnameh_headerID = '" . addslashes($server_stockadjd_stockopnameh_headerID) . "',
stockadjd_stockopnamed_detailID = '" . addslashes($server_stockadjd_stockopnamed_detailID) . "',
stockadjd_picklisth_headerID = '" . addslashes($server_stockadjd_picklisth_headerID) . "',
stockadjd_picklistd_detailID = '" . addslashes($server_stockadjd_picklistd_detailID) . "',
stockadjd_oldcd = '" . addslashes($server_stockadjd_oldcd) . "',
stockadjd_AdjustmentDate = '" . addslashes($server_stockadjd_AdjustmentDate) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert stockadjd_detail=>' . $err_msg;
echo "\n";
echo 'server_stockadjd_detailID=>' . $server_stockadjd_detailID;
echo "\n";
echo 'Insert stockadjd_detail=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE stockadjd_detail SET
stockadjd_create_user = '" . addslashes($server_stockadjd_create_user) . "',
stockadjd_create_time = '" . addslashes($server_stockadjd_create_time) . "',
stockadjd_edit_user = '" . addslashes($server_stockadjd_edit_user) . "',
stockadjd_edit_time = '" . addslashes($server_stockadjd_edit_time) . "',
stockadjd_ip = '" . addslashes($server_stockadjd_ip) . "',
stockadjd_SysTrxId = '" . addslashes($server_stockadjd_SysTrxId) . "',
stockadjd_Active = '" . addslashes($server_stockadjd_Active) . "',
stockadjd_Approve = '" . addslashes($server_stockadjd_Approve) . "',
stockadjd_SyncronizeDate = '" . addslashes($server_stockadjd_SyncronizeDate) . "',
stockadjd_LastExportDate = '" . addslashes($server_stockadjd_LastExportDate) . "',
stockadjd_TotalImported = '" . addslashes($server_stockadjd_TotalImported) . "',
stockadjd_TotalExported = '" . addslashes($server_stockadjd_TotalExported) . "',
stockadjd_LastUpdateStamp = '" . addslashes($server_stockadjd_LastUpdateStamp) . "',
stockadjd_idRow = '" . addslashes($server_stockadjd_idRow) . "',
stockadjd_AdjustmentNo = '" . addslashes($server_stockadjd_AdjustmentNo) . "',
stockadjd_SequenceNo = '" . addslashes($server_stockadjd_SequenceNo) . "',
stockadjd_ItemCd = '" . addslashes($server_stockadjd_ItemCd) . "',
stockadjd_ItemSKUCd = '" . addslashes($server_stockadjd_ItemSKUCd) . "',
stockadjd_UOMCd = '" . addslashes($server_stockadjd_UOMCd) . "',
stockadjd_Quantity = '" . addslashes($server_stockadjd_Quantity) . "',
stockadjd_LocationCd = '" . addslashes($server_stockadjd_LocationCd) . "',
stockadjd_ReasonCd = '" . addslashes($server_stockadjd_ReasonCd) . "',
stockadjd_Remark = '" . addslashes($server_stockadjd_Remark) . "',
stockadjd_SF_AdjustmentDetail = '" . addslashes($server_stockadjd_SF_AdjustmentDetail) . "',
stockadjd_Cost = '" . addslashes($server_stockadjd_Cost) . "',
stockadjd_Deleteable = '" . addslashes($server_stockadjd_Deleteable) . "',
stockadjd_Forensic = '" . addslashes($server_stockadjd_Forensic) . "',
stockadjd_PortfolioCd = '" . addslashes($server_stockadjd_PortfolioCd) . "',
stockadjd_Sub_PortfolioCd = '" . addslashes($server_stockadjd_Sub_PortfolioCd) . "',
stockadjd_stockadjh_headerID = '" . addslashes($server_stockadjd_stockadjh_headerID) . "',
stockadjd_loc_mstrID = '" . addslashes($server_stockadjd_loc_mstrID) . "',
stockadjd_reason_mstrID = '" . addslashes($server_stockadjd_reason_mstrID) . "',
stockadjd_productitem_mstrID = '" . addslashes($server_stockadjd_productitem_mstrID) . "',
stockadjd_itemsku_mstrID = '" . addslashes($server_stockadjd_itemsku_mstrID) . "',
stockadjd_measurement_uomID = '" . addslashes($server_stockadjd_measurement_uomID) . "',
stockadjd__dihapus = '" . addslashes($server_stockadjd__dihapus) . "',
stockadjd__dihapus_time = '" . addslashes($server_stockadjd__dihapus_time) . "',
stockadjd_PStatus = '" . addslashes($server_stockadjd_PStatus) . "',
stockadjd_stockopnameh_headerID = '" . addslashes($server_stockadjd_stockopnameh_headerID) . "',
stockadjd_stockopnamed_detailID = '" . addslashes($server_stockadjd_stockopnamed_detailID) . "',
stockadjd_picklisth_headerID = '" . addslashes($server_stockadjd_picklisth_headerID) . "',
stockadjd_picklistd_detailID = '" . addslashes($server_stockadjd_picklistd_detailID) . "',
stockadjd_oldcd = '" . addslashes($server_stockadjd_oldcd) . "',
stockadjd_AdjustmentDate = '" . addslashes($server_stockadjd_AdjustmentDate) . "'
WHERE stockadjd_detailID = " . $server_stockadjd_detailID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE stockadjd_detail=>' . $err_msg;
echo "\n";
echo 'server_stockadjd_detailID=>' . $server_stockadjd_detailID;
echo "\n";
echo 'UPDATE stockadjd_detail=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'monthendclosing_det')
{
echo "\n";
echo 'Sebelum monthendclosing_det=>' . $err_msg;
echo "\n";
list($server_monthendclosing_Period, $server_monthendclosing_UOMCd, $server_monthendclosing_LocationCd, $server_monthendclosing_LocationName, $server_monthendclosing_BrandCd, $server_monthendclosing_barcode_mstrID, $server_monthendclosing_Barcode, $server_monthendclosing_BrandName, $server_monthendclosing_ItemCd, $server_monthendclosing_ItemName, $server_monthendclosing_ItemSKUCd, $server_monthendclosing_ItemSKUName, $server_monthendclosing_BeginQty, $server_monthendclosing_EndQty, $server_monthendclosing_ReserveQty, $server_monthendclosing_OpenQty, $server_monthendclosing__dihapus, $server_monthendclosing__dihapus_time, $server_monthendclosing_Cost, $server_monthendclosing_loc_mstrID, $server_monthendclosing_measurement_uomID, $server_monthendclosing_brand_mstrID, $server_monthendclosing_productitem_mstrID, $server_monthendclosing_itemsku_mstrID, $server_monthendclosing_detID, $server_monthendclosing_create_user, $server_monthendclosing_create_time, $server_monthendclosing_edit_user, $server_monthendclosing_edit_time, $server_monthendclosing_ip, $server_monthendclosing_SysTrxId, $server_monthendclosing_Active, $server_monthendclosing_Approve, $server_monthendclosing_SyncronizeDate, $server_monthendclosing_LastExportDate, $server_monthendclosing_TotalImported, $server_monthendclosing_TotalExported, $server_monthendclosing_LastUpdateStamp, $server_monthendclosing_idRow, $server_monthendclosing_PortfolioCd, $server_monthendclosing_Sub_PortfolioCd, $server_monthendclosing_RptIn, $server_monthendclosing_RptOut, $server_monthendclosing_RptTot, $server_monthendclosing_RptEnd, $server_monthendclosing_QtyJual, $server_monthendclosing_QtyReturn) = explode('`', $line);
if ($server_monthendclosing_barcode_mstrID == '') $server_monthendclosing_barcode_mstrID = 0;
if ($server_monthendclosing_BeginQty == '') $server_monthendclosing_BeginQty = 0;
if ($server_monthendclosing_EndQty == '') $server_monthendclosing_EndQty = 0;
if ($server_monthendclosing_ReserveQty == '') $server_monthendclosing_ReserveQty = 0;
if ($server_monthendclosing_OpenQty == '') $server_monthendclosing_OpenQty = 0;
if ($server_monthendclosing__dihapus == '') $server_monthendclosing__dihapus = 'No';
if ($server_monthendclosing_Cost == '') $server_monthendclosing_Cost = 0;
if ($server_monthendclosing_loc_mstrID == '') $server_monthendclosing_loc_mstrID = 0;
if ($server_monthendclosing_measurement_uomID == '') $server_monthendclosing_measurement_uomID = 0;
if ($server_monthendclosing_brand_mstrID == '') $server_monthendclosing_brand_mstrID = 0;
if ($server_monthendclosing_productitem_mstrID == '') $server_monthendclosing_productitem_mstrID = 0;
if ($server_monthendclosing_itemsku_mstrID == '') $server_monthendclosing_itemsku_mstrID = 0;
if ($server_monthendclosing_detID == '') $server_monthendclosing_detID = 0;
if ($server_monthendclosing_Active == '') $server_monthendclosing_Active = 'No';
if ($server_monthendclosing_Approve == '') $server_monthendclosing_Approve = 0;
if ($server_monthendclosing_TotalImported == '') $server_monthendclosing_TotalImported = 0;
if ($server_monthendclosing_TotalExported == '') $server_monthendclosing_TotalExported = 0;
if ($server_monthendclosing_idRow == '') $server_monthendclosing_idRow = 0;
if ($server_monthendclosing_RptIn == '') $server_monthendclosing_RptIn = 0;
if ($server_monthendclosing_RptOut == '') $server_monthendclosing_RptOut = 0;
if ($server_monthendclosing_RptTot == '') $server_monthendclosing_RptTot = 0;
if ($server_monthendclosing_RptEnd == '') $server_monthendclosing_RptEnd = 0;
if ($server_monthendclosing_QtyJual == '') $server_monthendclosing_QtyJual = 0;
if ($server_monthendclosing_QtyReturn == '') $server_monthendclosing_QtyReturn = 0;
$monthendclosing_detID = 0;
$koneksi_monthendclosing_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT monthendclosing_detID, monthendclosing_LastUpdateStamp FROM monthendclosing_det where monthendclosing_detID = " . $server_monthendclosing_detID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$monthendclosing_detID = $row_koneksi['monthendclosing_detID'];
$koneksi_monthendclosing_LastUpdateStamp = $row_koneksi['monthendclosing_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($monthendclosing_detID == 0)
{
$sql_delete = "DELETE FROM monthendclosing_det where
monthendclosing_Sub_PortfolioCd = '" . addslashes($server_monthendclosing_Sub_PortfolioCd) . "' and
monthendclosing_Period = '" . addslashes($server_monthendclosing_Period) . "' and
monthendclosing_LocationCd = '" . addslashes($server_monthendclosing_LocationCd) . "' and
monthendclosing_ItemCd = '" . addslashes($server_monthendclosing_ItemCd) . "' and
monthendclosing_ItemSKUCd = '" . addslashes($server_monthendclosing_ItemSKUCd) . "' and
monthendclosing__dihapus_time = '" . addslashes($server_monthendclosing__dihapus_time) . "' and
monthendclosing_itemsku_mstrID = " . $server_monthendclosing_itemsku_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_insert = "INSERT INTO monthendclosing_det SET
monthendclosing_Period = '" . addslashes($server_monthendclosing_Period) . "',
monthendclosing_UOMCd = '" . addslashes($server_monthendclosing_UOMCd) . "',
monthendclosing_LocationCd = '" . addslashes($server_monthendclosing_LocationCd) . "',
monthendclosing_LocationName = '" . addslashes($server_monthendclosing_LocationName) . "',
monthendclosing_BrandCd = '" . addslashes($server_monthendclosing_BrandCd) . "',
monthendclosing_barcode_mstrID = '" . addslashes($server_monthendclosing_barcode_mstrID) . "',
monthendclosing_Barcode = '" . addslashes($server_monthendclosing_Barcode) . "',
monthendclosing_BrandName = '" . addslashes($server_monthendclosing_BrandName) . "',
monthendclosing_ItemCd = '" . addslashes($server_monthendclosing_ItemCd) . "',
monthendclosing_ItemName = '" . addslashes($server_monthendclosing_ItemName) . "',
monthendclosing_ItemSKUCd = '" . addslashes($server_monthendclosing_ItemSKUCd) . "',
monthendclosing_ItemSKUName = '" . addslashes($server_monthendclosing_ItemSKUName) . "',
monthendclosing_BeginQty = '" . addslashes($server_monthendclosing_BeginQty) . "',
monthendclosing_EndQty = '" . addslashes($server_monthendclosing_EndQty) . "',
monthendclosing_ReserveQty = '" . addslashes($server_monthendclosing_ReserveQty) . "',
monthendclosing_OpenQty = '" . addslashes($server_monthendclosing_OpenQty) . "',
monthendclosing__dihapus = '" . addslashes($server_monthendclosing__dihapus) . "',
monthendclosing__dihapus_time = '" . addslashes($server_monthendclosing__dihapus_time) . "',
monthendclosing_Cost = '" . addslashes($server_monthendclosing_Cost) . "',
monthendclosing_loc_mstrID = '" . addslashes($server_monthendclosing_loc_mstrID) . "',
monthendclosing_measurement_uomID = '" . addslashes($server_monthendclosing_measurement_uomID) . "',
monthendclosing_brand_mstrID = '" . addslashes($server_monthendclosing_brand_mstrID) . "',
monthendclosing_productitem_mstrID = '" . addslashes($server_monthendclosing_productitem_mstrID) . "',
monthendclosing_itemsku_mstrID = '" . addslashes($server_monthendclosing_itemsku_mstrID) . "',
monthendclosing_detID = '" . addslashes($server_monthendclosing_detID) . "',
monthendclosing_create_user = '" . addslashes($server_monthendclosing_create_user) . "',
monthendclosing_create_time = '" . addslashes($server_monthendclosing_create_time) . "',
monthendclosing_edit_user = '" . addslashes($server_monthendclosing_edit_user) . "',
monthendclosing_edit_time = '" . addslashes($server_monthendclosing_edit_time) . "',
monthendclosing_ip = '" . addslashes($server_monthendclosing_ip) . "',
monthendclosing_SysTrxId = '" . addslashes($server_monthendclosing_SysTrxId) . "',
monthendclosing_Active = '" . addslashes($server_monthendclosing_Active) . "',
monthendclosing_Approve = '" . addslashes($server_monthendclosing_Approve) . "',
monthendclosing_SyncronizeDate = '" . addslashes($server_monthendclosing_SyncronizeDate) . "',
monthendclosing_LastExportDate = '" . addslashes($server_monthendclosing_LastExportDate) . "',
monthendclosing_TotalImported = '" . addslashes($server_monthendclosing_TotalImported) . "',
monthendclosing_TotalExported = '" . addslashes($server_monthendclosing_TotalExported) . "',
monthendclosing_LastUpdateStamp = '" . addslashes($server_monthendclosing_LastUpdateStamp) . "',
monthendclosing_idRow = '" . addslashes($server_monthendclosing_idRow) . "',
monthendclosing_PortfolioCd = '" . addslashes($server_monthendclosing_PortfolioCd) . "',
monthendclosing_Sub_PortfolioCd = '" . addslashes($server_monthendclosing_Sub_PortfolioCd) . "',
monthendclosing_RptIn = '" . addslashes($server_monthendclosing_RptIn) . "',
monthendclosing_RptOut = '" . addslashes($server_monthendclosing_RptOut) . "',
monthendclosing_RptTot = '" . addslashes($server_monthendclosing_RptTot) . "',
monthendclosing_RptEnd = '" . addslashes($server_monthendclosing_RptEnd) . "',
monthendclosing_QtyJual = '" . addslashes($server_monthendclosing_QtyJual) . "',
monthendclosing_QtyReturn = '" . addslashes($server_monthendclosing_QtyReturn) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert monthendclosing_det=>' . $err_msg;
echo "\n";
echo 'server_monthendclosing_detID=>' . $server_monthendclosing_detID;
echo "\n";
echo 'Insert monthendclosing_det=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE monthendclosing_det SET
monthendclosing_Period = '" . addslashes($server_monthendclosing_Period) . "',
monthendclosing_UOMCd = '" . addslashes($server_monthendclosing_UOMCd) . "',
monthendclosing_LocationCd = '" . addslashes($server_monthendclosing_LocationCd) . "',
monthendclosing_LocationName = '" . addslashes($server_monthendclosing_LocationName) . "',
monthendclosing_BrandCd = '" . addslashes($server_monthendclosing_BrandCd) . "',
monthendclosing_barcode_mstrID = '" . addslashes($server_monthendclosing_barcode_mstrID) . "',
monthendclosing_Barcode = '" . addslashes($server_monthendclosing_Barcode) . "',
monthendclosing_BrandName = '" . addslashes($server_monthendclosing_BrandName) . "',
monthendclosing_ItemCd = '" . addslashes($server_monthendclosing_ItemCd) . "',
monthendclosing_ItemName = '" . addslashes($server_monthendclosing_ItemName) . "',
monthendclosing_ItemSKUCd = '" . addslashes($server_monthendclosing_ItemSKUCd) . "',
monthendclosing_ItemSKUName = '" . addslashes($server_monthendclosing_ItemSKUName) . "',
monthendclosing_BeginQty = '" . addslashes($server_monthendclosing_BeginQty) . "',
monthendclosing_EndQty = '" . addslashes($server_monthendclosing_EndQty) . "',
monthendclosing_ReserveQty = '" . addslashes($server_monthendclosing_ReserveQty) . "',
monthendclosing_OpenQty = '" . addslashes($server_monthendclosing_OpenQty) . "',
monthendclosing__dihapus = '" . addslashes($server_monthendclosing__dihapus) . "',
monthendclosing__dihapus_time = '" . addslashes($server_monthendclosing__dihapus_time) . "',
monthendclosing_Cost = '" . addslashes($server_monthendclosing_Cost) . "',
monthendclosing_loc_mstrID = '" . addslashes($server_monthendclosing_loc_mstrID) . "',
monthendclosing_measurement_uomID = '" . addslashes($server_monthendclosing_measurement_uomID) . "',
monthendclosing_brand_mstrID = '" . addslashes($server_monthendclosing_brand_mstrID) . "',
monthendclosing_productitem_mstrID = '" . addslashes($server_monthendclosing_productitem_mstrID) . "',
monthendclosing_itemsku_mstrID = '" . addslashes($server_monthendclosing_itemsku_mstrID) . "',
monthendclosing_detID = '" . addslashes($server_monthendclosing_detID) . "',
monthendclosing_create_user = '" . addslashes($server_monthendclosing_create_user) . "',
monthendclosing_create_time = '" . addslashes($server_monthendclosing_create_time) . "',
monthendclosing_edit_user = '" . addslashes($server_monthendclosing_edit_user) . "',
monthendclosing_edit_time = '" . addslashes($server_monthendclosing_edit_time) . "',
monthendclosing_ip = '" . addslashes($server_monthendclosing_ip) . "',
monthendclosing_SysTrxId = '" . addslashes($server_monthendclosing_SysTrxId) . "',
monthendclosing_Active = '" . addslashes($server_monthendclosing_Active) . "',
monthendclosing_Approve = '" . addslashes($server_monthendclosing_Approve) . "',
monthendclosing_SyncronizeDate = '" . addslashes($server_monthendclosing_SyncronizeDate) . "',
monthendclosing_LastExportDate = '" . addslashes($server_monthendclosing_LastExportDate) . "',
monthendclosing_TotalImported = '" . addslashes($server_monthendclosing_TotalImported) . "',
monthendclosing_TotalExported = '" . addslashes($server_monthendclosing_TotalExported) . "',
monthendclosing_LastUpdateStamp = '" . addslashes($server_monthendclosing_LastUpdateStamp) . "',
monthendclosing_idRow = '" . addslashes($server_monthendclosing_idRow) . "',
monthendclosing_PortfolioCd = '" . addslashes($server_monthendclosing_PortfolioCd) . "',
monthendclosing_Sub_PortfolioCd = '" . addslashes($server_monthendclosing_Sub_PortfolioCd) . "',
monthendclosing_RptIn = '" . addslashes($server_monthendclosing_RptIn) . "',
monthendclosing_RptOut = '" . addslashes($server_monthendclosing_RptOut) . "',
monthendclosing_RptTot = '" . addslashes($server_monthendclosing_RptTot) . "',
monthendclosing_RptEnd = '" . addslashes($server_monthendclosing_RptEnd) . "',
monthendclosing_QtyJual = '" . addslashes($server_monthendclosing_QtyJual) . "',
monthendclosing_QtyReturn = '" . addslashes($server_monthendclosing_QtyReturn) . "'
WHERE monthendclosing_detID = " . $server_monthendclosing_detID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE monthendclosing_det=>' . $err_msg;
echo "\n";
echo 'server_monthendclosing_detID=>' . $server_monthendclosing_detID;
echo "\n";
echo 'UPDATE monthendclosing_det=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'stockrunning_det')
{
echo "\n";
echo 'Sebelum stockrunning_det=>' . $err_msg;
echo "\n";
list($server_stockrunning_detID, $server_stockrunning_create_user, $server_stockrunning_create_time, $server_stockrunning_edit_user, $server_stockrunning_edit_time, $server_stockrunning_ip, $server_stockrunning_SysTrxId, $server_stockrunning_Active, $server_stockrunning_Approve, $server_stockrunning_SyncronizeDate, $server_stockrunning_LastExportDate, $server_stockrunning_TotalImported, $server_stockrunning_TotalExported, $server_stockrunning_LastUpdateStamp, $server_stockrunning_idRow, $server_stockrunning_LocationCd, $server_stockrunning_RunningPOSDate, $server_stockrunning_ItemCd, $server_stockrunning_ItemSKUCd, $server_stockrunning_AvailableQty, $server_stockrunning_ReserveQty, $server_stockrunning_OpenQty, $server_stockrunning_Cost, $server_stockrunning_LastTransferOut, $server_stockrunning_LastTransferIn, $server_stockrunning_LastGRNoteIn, $server_stockrunning_LastGINoteOut, $server_stockrunning_LastStruckNoOut, $server_stockrunning_LastAdjustNo, $server_stockrunning_LastDONoOut, $server_stockrunning_LastDisposalOut, $server_stockrunning_LastReturnOut, $server_stockrunning_LastPOPrice, $server_stockrunning_SF_StockRunning, $server_stockrunning_Deleteable, $server_stockrunning_Forensic, $server_stockrunning_PortfolioCd, $server_stockrunning_Sub_PortfolioCd, $server_stockrunning_loc_mstrID, $server_stockrunning_productitem_mstrID, $server_stockrunning_itemsku_mstrID, $server_stockrunning_posr_runningID, $server_stockrunning_measurement_uomID, $server_stockrunning__dihapus, $server_stockrunning_UOMCd, $server_stockrunning__dihapus_time, $server_stockrunning_LastPrice, $server_stockrunning_LastSalesReturnIn, $server_stockrunning_TotCost, $server_stockrunning_TotAvailableQty, $server_stockrunning_TotCostContribution, $server_stockrunning_LastReProduct, $server_stockrunning_LastStockRequest, $server_stockrunning_OpnameNo, $server_stockrunning_RptIn, $server_stockrunning_RptOut, $server_stockrunning_RptTot, $server_stockrunning_monthendclosing, $server_stockrunning_oldcd, $server_stockrunning_LastRefundIn, $server_stockrunning_LastRentalOut) = explode('`', $line);
if ($server_stockrunning_Active == '') $server_stockrunning_Active = 'No';
if ($server_stockrunning_Approve == '') $server_stockrunning_Approve = 0;
if ($server_stockrunning_TotalImported == '') $server_stockrunning_TotalImported = 0;
if ($server_stockrunning_TotalExported == '') $server_stockrunning_TotalExported = 0;
if ($server_stockrunning_idRow == '') $server_stockrunning_idRow = 0;
if ($server_stockrunning_RunningPOSDate == '') $server_stockrunning_RunningPOSDate = '1900-01-01';
if ($server_stockrunning_AvailableQty == '') $server_stockrunning_AvailableQty = 0;
if ($server_stockrunning_ReserveQty == '') $server_stockrunning_ReserveQty = 0;
if ($server_stockrunning_OpenQty == '') $server_stockrunning_OpenQty = 0;
if ($server_stockrunning_Cost == '') $server_stockrunning_Cost = 0;
if ($server_stockrunning_LastPOPrice == '') $server_stockrunning_LastPOPrice = 0;
if ($server_stockrunning_Deleteable == '') $server_stockrunning_Deleteable = 'No';
if ($server_stockrunning_loc_mstrID == '') $server_stockrunning_loc_mstrID = 0;
if ($server_stockrunning_productitem_mstrID == '') $server_stockrunning_productitem_mstrID = 0;
if ($server_stockrunning_itemsku_mstrID == '') $server_stockrunning_itemsku_mstrID = 0;
if ($server_stockrunning_posr_runningID == '') $server_stockrunning_posr_runningID = 0;
if ($server_stockrunning_measurement_uomID == '') $server_stockrunning_measurement_uomID = 0;
if ($server_stockrunning__dihapus == '') $server_stockrunning__dihapus = 'No';
if ($server_stockrunning_LastPrice == '') $server_stockrunning_LastPrice = 0;
if ($server_stockrunning_TotCost == '') $server_stockrunning_TotCost = 0;
if ($server_stockrunning_TotAvailableQty == '') $server_stockrunning_TotAvailableQty = 0;
if ($server_stockrunning_TotCostContribution == '') $server_stockrunning_TotCostContribution = 0;
if ($server_stockrunning_RptIn == '') $server_stockrunning_RptIn = 0;
if ($server_stockrunning_RptOut == '') $server_stockrunning_RptOut = 0;
if ($server_stockrunning_RptTot == '') $server_stockrunning_RptTot = 0;
if ($server_stockrunning_monthendclosing == '') $server_stockrunning_monthendclosing = 'No';
$stockrunning_detID = 0;
$koneksi_stockrunning_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT stockrunning_detID, stockrunning_LastUpdateStamp FROM stockrunning_det where stockrunning_detID = " . $server_stockrunning_detID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$stockrunning_detID = $row_koneksi['stockrunning_detID'];
$koneksi_stockrunning_LastUpdateStamp = $row_koneksi['stockrunning_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($stockrunning_detID == 0)
{
$sql_delete = "DELETE FROM stockrunning_det where
stockrunning_LocationCd = '" . addslashes($server_stockrunning_LocationCd) . "' and
stockrunning_ItemCd = '" . addslashes($server_stockrunning_ItemCd) . "' and
stockrunning_ItemSKUCd = '" . addslashes($server_stockrunning_ItemSKUCd) . "' and
stockrunning_oldcd = '" . addslashes($server_stockrunning_oldcd) . "' and
stockrunning_measurement_uomID = " . addslashes($server_stockrunning_measurement_uomID) . " and
stockrunning__dihapus_time = '" . addslashes($server_stockrunning__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_delete = "DELETE FROM stockrunning_det where
stockrunning_loc_mstrID = '" . addslashes($server_stockrunning_loc_mstrID) . "' and
stockrunning_itemsku_mstrID = '" . addslashes($server_stockrunning_itemsku_mstrID) . "' and
stockrunning__dihapus_time = '" . addslashes($server_stockrunning__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_insert = "INSERT INTO stockrunning_det SET
stockrunning_detID = '" . addslashes($server_stockrunning_detID) . "',
stockrunning_create_user = '" . addslashes($server_stockrunning_create_user) . "',
stockrunning_create_time = '" . addslashes($server_stockrunning_create_time) . "',
stockrunning_edit_user = '" . addslashes($server_stockrunning_edit_user) . "',
stockrunning_edit_time = '" . addslashes($server_stockrunning_edit_time) . "',
stockrunning_ip = '" . addslashes($server_stockrunning_ip) . "',
stockrunning_SysTrxId = '" . addslashes($server_stockrunning_SysTrxId) . "',
stockrunning_Active = '" . addslashes($server_stockrunning_Active) . "',
stockrunning_Approve = '" . addslashes($server_stockrunning_Approve) . "',
stockrunning_SyncronizeDate = '" . addslashes($server_stockrunning_SyncronizeDate) . "',
stockrunning_LastExportDate = '" . addslashes($server_stockrunning_LastExportDate) . "',
stockrunning_TotalImported = '" . addslashes($server_stockrunning_TotalImported) . "',
stockrunning_TotalExported = '" . addslashes($server_stockrunning_TotalExported) . "',
stockrunning_LastUpdateStamp = '" . addslashes($server_stockrunning_LastUpdateStamp) . "',
stockrunning_idRow = '" . addslashes($server_stockrunning_idRow) . "',
stockrunning_LocationCd = '" . addslashes($server_stockrunning_LocationCd) . "',
stockrunning_RunningPOSDate = '" . addslashes($server_stockrunning_RunningPOSDate) . "',
stockrunning_ItemCd = '" . addslashes($server_stockrunning_ItemCd) . "',
stockrunning_ItemSKUCd = '" . addslashes($server_stockrunning_ItemSKUCd) . "',
stockrunning_AvailableQty = '" . addslashes($server_stockrunning_AvailableQty) . "',
stockrunning_ReserveQty = '" . addslashes($server_stockrunning_ReserveQty) . "',
stockrunning_OpenQty = '" . addslashes($server_stockrunning_OpenQty) . "',
stockrunning_Cost = '" . addslashes($server_stockrunning_Cost) . "',
stockrunning_LastTransferOut = '" . addslashes($server_stockrunning_LastTransferOut) . "',
stockrunning_LastTransferIn = '" . addslashes($server_stockrunning_LastTransferIn) . "',
stockrunning_LastGRNoteIn = '" . addslashes($server_stockrunning_LastGRNoteIn) . "',
stockrunning_LastGINoteOut = '" . addslashes($server_stockrunning_LastGINoteOut) . "',
stockrunning_LastStruckNoOut = '" . addslashes($server_stockrunning_LastStruckNoOut) . "',
stockrunning_LastAdjustNo = '" . addslashes($server_stockrunning_LastAdjustNo) . "',
stockrunning_LastDONoOut = '" . addslashes($server_stockrunning_LastDONoOut) . "',
stockrunning_LastDisposalOut = '" . addslashes($server_stockrunning_LastDisposalOut) . "',
stockrunning_LastReturnOut = '" . addslashes($server_stockrunning_LastReturnOut) . "',
stockrunning_LastPOPrice = '" . addslashes($server_stockrunning_LastPOPrice) . "',
stockrunning_SF_StockRunning = '" . addslashes($server_stockrunning_SF_StockRunning) . "',
stockrunning_Deleteable = '" . addslashes($server_stockrunning_Deleteable) . "',
stockrunning_Forensic = '" . addslashes($server_stockrunning_Forensic) . "',
stockrunning_PortfolioCd = '" . addslashes($server_stockrunning_PortfolioCd) . "',
stockrunning_Sub_PortfolioCd = '" . addslashes($server_stockrunning_Sub_PortfolioCd) . "',
stockrunning_loc_mstrID = '" . addslashes($server_stockrunning_loc_mstrID) . "',
stockrunning_productitem_mstrID = '" . addslashes($server_stockrunning_productitem_mstrID) . "',
stockrunning_itemsku_mstrID = '" . addslashes($server_stockrunning_itemsku_mstrID) . "',
stockrunning_posr_runningID = '" . addslashes($server_stockrunning_posr_runningID) . "',
stockrunning_measurement_uomID = '" . addslashes($server_stockrunning_measurement_uomID) . "',
stockrunning__dihapus = '" . addslashes($server_stockrunning__dihapus) . "',
stockrunning_UOMCd = '" . addslashes($server_stockrunning_UOMCd) . "',
stockrunning__dihapus_time = '" . addslashes($server_stockrunning__dihapus_time) . "',
stockrunning_LastPrice = '" . addslashes($server_stockrunning_LastPrice) . "',
stockrunning_LastSalesReturnIn = '" . addslashes($server_stockrunning_LastSalesReturnIn) . "',
stockrunning_TotCost = '" . addslashes($server_stockrunning_TotCost) . "',
stockrunning_TotAvailableQty = '" . addslashes($server_stockrunning_TotAvailableQty) . "',
stockrunning_TotCostContribution = '" . addslashes($server_stockrunning_TotCostContribution) . "',
stockrunning_LastReProduct = '" . addslashes($server_stockrunning_LastReProduct) . "',
stockrunning_LastStockRequest = '" . addslashes($server_stockrunning_LastStockRequest) . "',
stockrunning_OpnameNo = '" . addslashes($server_stockrunning_OpnameNo) . "',
stockrunning_RptIn = '" . addslashes($server_stockrunning_RptIn) . "',
stockrunning_RptOut = '" . addslashes($server_stockrunning_RptOut) . "',
stockrunning_RptTot = '" . addslashes($server_stockrunning_RptTot) . "',
stockrunning_monthendclosing = '" . addslashes($server_stockrunning_monthendclosing) . "',
stockrunning_oldcd = '" . addslashes($server_stockrunning_oldcd) . "',
stockrunning_LastRefundIn = '" . addslashes($server_stockrunning_LastRefundIn) . "',
stockrunning_LastRentalOut = '" . addslashes($server_stockrunning_LastRentalOut) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert stockrunning_det=>' . $err_msg;
echo "\n";
echo 'server_stockrunning_detID=>' . $server_stockrunning_detID;
echo "\n";
echo 'Insert stockrunning_det=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_delete = "DELETE FROM stockrunning_det where
stockrunning_detID <> " . $server_stockrunning_detID . " and
stockrunning_LocationCd = '" . addslashes($server_stockrunning_LocationCd) . "' and
stockrunning_ItemCd = '" . addslashes($server_stockrunning_ItemCd) . "' and
stockrunning_ItemSKUCd = '" . addslashes($server_stockrunning_ItemSKUCd) . "' and
stockrunning_oldcd = '" . addslashes($server_stockrunning_oldcd) . "' and
stockrunning_measurement_uomID = " . addslashes($server_stockrunning_measurement_uomID) . " and
stockrunning__dihapus_time = '" . addslashes($server_stockrunning__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_delete = "DELETE FROM stockrunning_det where
stockrunning_detID <> " . $server_stockrunning_detID . " and
stockrunning_loc_mstrID = '" . addslashes($server_stockrunning_loc_mstrID) . "' and
stockrunning_itemsku_mstrID = '" . addslashes($server_stockrunning_itemsku_mstrID) . "' and
stockrunning__dihapus_time = '" . addslashes($server_stockrunning__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_update = "UPDATE stockrunning_det SET
stockrunning_create_user = '" . addslashes($server_stockrunning_create_user) . "',
stockrunning_create_time = '" . addslashes($server_stockrunning_create_time) . "',
stockrunning_edit_user = '" . addslashes($server_stockrunning_edit_user) . "',
stockrunning_edit_time = '" . addslashes($server_stockrunning_edit_time) . "',
stockrunning_ip = '" . addslashes($server_stockrunning_ip) . "',
stockrunning_SysTrxId = '" . addslashes($server_stockrunning_SysTrxId) . "',
stockrunning_Active = '" . addslashes($server_stockrunning_Active) . "',
stockrunning_Approve = '" . addslashes($server_stockrunning_Approve) . "',
stockrunning_SyncronizeDate = '" . addslashes($server_stockrunning_SyncronizeDate) . "',
stockrunning_LastExportDate = '" . addslashes($server_stockrunning_LastExportDate) . "',
stockrunning_TotalImported = '" . addslashes($server_stockrunning_TotalImported) . "',
stockrunning_TotalExported = '" . addslashes($server_stockrunning_TotalExported) . "',
stockrunning_LastUpdateStamp = '" . addslashes($server_stockrunning_LastUpdateStamp) . "',
stockrunning_idRow = '" . addslashes($server_stockrunning_idRow) . "',
stockrunning_LocationCd = '" . addslashes($server_stockrunning_LocationCd) . "',
stockrunning_RunningPOSDate = '" . addslashes($server_stockrunning_RunningPOSDate) . "',
stockrunning_ItemCd = '" . addslashes($server_stockrunning_ItemCd) . "',
stockrunning_ItemSKUCd = '" . addslashes($server_stockrunning_ItemSKUCd) . "',
stockrunning_AvailableQty = '" . addslashes($server_stockrunning_AvailableQty) . "',
stockrunning_ReserveQty = '" . addslashes($server_stockrunning_ReserveQty) . "',
stockrunning_OpenQty = '" . addslashes($server_stockrunning_OpenQty) . "',
stockrunning_Cost = '" . addslashes($server_stockrunning_Cost) . "',
stockrunning_LastTransferOut = '" . addslashes($server_stockrunning_LastTransferOut) . "',
stockrunning_LastTransferIn = '" . addslashes($server_stockrunning_LastTransferIn) . "',
stockrunning_LastGRNoteIn = '" . addslashes($server_stockrunning_LastGRNoteIn) . "',
stockrunning_LastGINoteOut = '" . addslashes($server_stockrunning_LastGINoteOut) . "',
stockrunning_LastStruckNoOut = '" . addslashes($server_stockrunning_LastStruckNoOut) . "',
stockrunning_LastAdjustNo = '" . addslashes($server_stockrunning_LastAdjustNo) . "',
stockrunning_LastDONoOut = '" . addslashes($server_stockrunning_LastDONoOut) . "',
stockrunning_LastDisposalOut = '" . addslashes($server_stockrunning_LastDisposalOut) . "',
stockrunning_LastReturnOut = '" . addslashes($server_stockrunning_LastReturnOut) . "',
stockrunning_LastPOPrice = '" . addslashes($server_stockrunning_LastPOPrice) . "',
stockrunning_SF_StockRunning = '" . addslashes($server_stockrunning_SF_StockRunning) . "',
stockrunning_Deleteable = '" . addslashes($server_stockrunning_Deleteable) . "',
stockrunning_Forensic = '" . addslashes($server_stockrunning_Forensic) . "',
stockrunning_PortfolioCd = '" . addslashes($server_stockrunning_PortfolioCd) . "',
stockrunning_Sub_PortfolioCd = '" . addslashes($server_stockrunning_Sub_PortfolioCd) . "',
stockrunning_loc_mstrID = '" . addslashes($server_stockrunning_loc_mstrID) . "',
stockrunning_productitem_mstrID = '" . addslashes($server_stockrunning_productitem_mstrID) . "',
stockrunning_itemsku_mstrID = '" . addslashes($server_stockrunning_itemsku_mstrID) . "',
stockrunning_posr_runningID = '" . addslashes($server_stockrunning_posr_runningID) . "',
stockrunning_measurement_uomID = '" . addslashes($server_stockrunning_measurement_uomID) . "',
stockrunning__dihapus = '" . addslashes($server_stockrunning__dihapus) . "',
stockrunning_UOMCd = '" . addslashes($server_stockrunning_UOMCd) . "',
stockrunning__dihapus_time = '" . addslashes($server_stockrunning__dihapus_time) . "',
stockrunning_LastPrice = '" . addslashes($server_stockrunning_LastPrice) . "',
stockrunning_LastSalesReturnIn = '" . addslashes($server_stockrunning_LastSalesReturnIn) . "',
stockrunning_TotCost = '" . addslashes($server_stockrunning_TotCost) . "',
stockrunning_TotAvailableQty = '" . addslashes($server_stockrunning_TotAvailableQty) . "',
stockrunning_TotCostContribution = '" . addslashes($server_stockrunning_TotCostContribution) . "',
stockrunning_LastReProduct = '" . addslashes($server_stockrunning_LastReProduct) . "',
stockrunning_LastStockRequest = '" . addslashes($server_stockrunning_LastStockRequest) . "',
stockrunning_OpnameNo = '" . addslashes($server_stockrunning_OpnameNo) . "',
stockrunning_RptIn = '" . addslashes($server_stockrunning_RptIn) . "',
stockrunning_RptOut = '" . addslashes($server_stockrunning_RptOut) . "',
stockrunning_RptTot = '" . addslashes($server_stockrunning_RptTot) . "',
stockrunning_monthendclosing = '" . addslashes($server_stockrunning_monthendclosing) . "',
stockrunning_oldcd = '" . addslashes($server_stockrunning_oldcd) . "',
stockrunning_LastRefundIn = '" . addslashes($server_stockrunning_LastRefundIn) . "',
stockrunning_LastRentalOut = '" . addslashes($server_stockrunning_LastRentalOut) . "'
WHERE stockrunning_detID = " . $server_stockrunning_detID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE stockrunning_det=>' . $err_msg;
echo "\n";
echo 'server_stockrunning_detID=>' . $server_stockrunning_detID;
echo "\n";
echo 'UPDATE stockrunning_det=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'plistassign_mstr')
{
echo "\n";
echo 'Sebelum plistassign_mstr=>' . $err_msg;
echo "\n";
list($server_plistassign_mstrID, $server_plistassign_create_user, $server_plistassign_create_time, $server_plistassign_edit_user, $server_plistassign_edit_time, $server_plistassign_ip, $server_plistassign_SysTrxId, $server_plistassign_Active, $server_plistassign_Approve, $server_plistassign_SyncronizeDate, $server_plistassign_LastExportDate, $server_plistassign_TotalImported, $server_plistassign_TotalExported, $server_plistassign_LastUpdateStamp, $server_plistassign_idRow, $server_plistassign_PriceListCd, $server_plistassign_LocationCd, $server_plistassign_Deleteable, $server_plistassign_PortfolioCd, $server_plistassign_Description, $server_plistassign_Forensic, $server_plistassign_Sub_PortfolioCd, $server_plistassign_loc_mstrID, $server_plistassign__dihapus, $server_plistassign__dihapus_time) = explode('`', $line);
if ($server_plistassign_Active == '') $server_plistassign_Active = 'No';
if ($server_plistassign_Approve == '') $server_plistassign_Approve = 0;
if ($server_plistassign_TotalImported == '') $server_plistassign_TotalImported = 0;
if ($server_plistassign_TotalExported == '') $server_plistassign_TotalExported = 0;
if ($server_plistassign_idRow == '') $server_plistassign_idRow = 0;
if ($server_plistassign_PriceListCd == '') $server_plistassign_PriceListCd = 0;
if ($server_plistassign_Deleteable == '') $server_plistassign_Deleteable = 'No';
if ($server_plistassign_loc_mstrID == '') $server_plistassign_loc_mstrID = 0;
if ($server_plistassign__dihapus == '') $server_plistassign__dihapus = 'No';
$plistassign_mstrID = 0;
$koneksi_plistassign_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT plistassign_mstrID, plistassign_LastUpdateStamp FROM plistassign_mstr where plistassign_mstrID = " . $server_plistassign_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$plistassign_mstrID = $row_koneksi['plistassign_mstrID'];
$koneksi_plistassign_LastUpdateStamp = $row_koneksi['plistassign_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($plistassign_mstrID == 0)
{
$sql_insert = "INSERT INTO plistassign_mstr SET
plistassign_mstrID = '" . addslashes($server_plistassign_mstrID) . "',
plistassign_create_user = '" . addslashes($server_plistassign_create_user) . "',
plistassign_create_time = '" . addslashes($server_plistassign_create_time) . "',
plistassign_edit_user = '" . addslashes($server_plistassign_edit_user) . "',
plistassign_edit_time = '" . addslashes($server_plistassign_edit_time) . "',
plistassign_ip = '" . addslashes($server_plistassign_ip) . "',
plistassign_SysTrxId = '" . addslashes($server_plistassign_SysTrxId) . "',
plistassign_Active = '" . addslashes($server_plistassign_Active) . "',
plistassign_Approve = '" . addslashes($server_plistassign_Approve) . "',
plistassign_SyncronizeDate = '" . addslashes($server_plistassign_SyncronizeDate) . "',
plistassign_LastExportDate = '" . addslashes($server_plistassign_LastExportDate) . "',
plistassign_TotalImported = '" . addslashes($server_plistassign_TotalImported) . "',
plistassign_TotalExported = '" . addslashes($server_plistassign_TotalExported) . "',
plistassign_LastUpdateStamp = '" . addslashes($server_plistassign_LastUpdateStamp) . "',
plistassign_idRow = '" . addslashes($server_plistassign_idRow) . "',
plistassign_PriceListCd = '" . addslashes($server_plistassign_PriceListCd) . "',
plistassign_LocationCd = '" . addslashes($server_plistassign_LocationCd) . "',
plistassign_Deleteable = '" . addslashes($server_plistassign_Deleteable) . "',
plistassign_PortfolioCd = '" . addslashes($server_plistassign_PortfolioCd) . "',
plistassign_Description = '" . addslashes($server_plistassign_Description) . "',
plistassign_Forensic = '" . addslashes($server_plistassign_Forensic) . "',
plistassign_Sub_PortfolioCd = '" . addslashes($server_plistassign_Sub_PortfolioCd) . "',
plistassign_loc_mstrID = '" . addslashes($server_plistassign_loc_mstrID) . "',
plistassign__dihapus = '" . addslashes($server_plistassign__dihapus) . "',
plistassign__dihapus_time = '" . addslashes($server_plistassign__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert plistassign_mstr=>' . $err_msg;
echo "\n";
echo 'server_plistassign_mstrID=>' . $server_plistassign_mstrID;
echo "\n";
echo 'Insert plistassign_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE plistassign_mstr SET
plistassign_create_user = '" . addslashes($server_plistassign_create_user) . "',
plistassign_create_time = '" . addslashes($server_plistassign_create_time) . "',
plistassign_edit_user = '" . addslashes($server_plistassign_edit_user) . "',
plistassign_edit_time = '" . addslashes($server_plistassign_edit_time) . "',
plistassign_ip = '" . addslashes($server_plistassign_ip) . "',
plistassign_SysTrxId = '" . addslashes($server_plistassign_SysTrxId) . "',
plistassign_Active = '" . addslashes($server_plistassign_Active) . "',
plistassign_Approve = '" . addslashes($server_plistassign_Approve) . "',
plistassign_SyncronizeDate = '" . addslashes($server_plistassign_SyncronizeDate) . "',
plistassign_LastExportDate = '" . addslashes($server_plistassign_LastExportDate) . "',
plistassign_TotalImported = '" . addslashes($server_plistassign_TotalImported) . "',
plistassign_TotalExported = '" . addslashes($server_plistassign_TotalExported) . "',
plistassign_LastUpdateStamp = '" . addslashes($server_plistassign_LastUpdateStamp) . "',
plistassign_idRow = '" . addslashes($server_plistassign_idRow) . "',
plistassign_PriceListCd = '" . addslashes($server_plistassign_PriceListCd) . "',
plistassign_LocationCd = '" . addslashes($server_plistassign_LocationCd) . "',
plistassign_Deleteable = '" . addslashes($server_plistassign_Deleteable) . "',
plistassign_PortfolioCd = '" . addslashes($server_plistassign_PortfolioCd) . "',
plistassign_Description = '" . addslashes($server_plistassign_Description) . "',
plistassign_Forensic = '" . addslashes($server_plistassign_Forensic) . "',
plistassign_Sub_PortfolioCd = '" . addslashes($server_plistassign_Sub_PortfolioCd) . "',
plistassign_loc_mstrID = '" . addslashes($server_plistassign_loc_mstrID) . "',
plistassign__dihapus = '" . addslashes($server_plistassign__dihapus) . "',
plistassign__dihapus_time = '" . addslashes($server_plistassign__dihapus_time) . "'
WHERE plistassign_mstrID = " . $server_plistassign_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE plistassign_mstr=>' . $err_msg;
echo "\n";
echo 'server_plistassign_mstrID=>' . $server_plistassign_mstrID;
echo "\n";
echo 'UPDATE plistassign_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'subprogram_det')
{
echo "\n";
echo 'Sebelum subprogram_det=>' . $err_msg;
echo "\n";
list($server_subprogram_detID, $server_subprogram_create_user, $server_subprogram_create_time, $server_subprogram_edit_user, $server_subprogram_edit_time, $server_subprogram_ip, $server_subprogram_SysTrxId, $server_subprogram_Active, $server_subprogram_Approve, $server_subprogram_SyncronizeDate, $server_subprogram_LastExportDate, $server_subprogram_TotalImported, $server_subprogram_TotalExported, $server_subprogram_SF_ysubprogram, $server_subprogram_Deleteable, $server_subprogram_Forensic, $server_subprogram_PortfolioCd, $server_subprogram_Sub_PortfolioCd, $server_subprogram__dihapus_time, $server_subprogram__dihapus, $server_subprogram_LastUpdateStamp, $server_subprogram_main, $server_subprogram_sub) = explode('`', $line);
if ($server_subprogram_Active == '') $server_subprogram_Active = 'No';
if ($server_subprogram_Approve == '') $server_subprogram_Approve = 0;
if ($server_subprogram_TotalImported == '') $server_subprogram_TotalImported = 0;
if ($server_subprogram_TotalExported == '') $server_subprogram_TotalExported = 0;
if ($server_subprogram_Deleteable == '') $server_subprogram_Deleteable = 'No';
if ($server_subprogram__dihapus == '') $server_subprogram__dihapus = 'No';
$subprogram_detID = 0;
$koneksi_subprogram_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT subprogram_detID, subprogram_LastUpdateStamp FROM subprogram_det where subprogram_detID = " . $server_subprogram_detID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$subprogram_detID = $row_koneksi['subprogram_detID'];
$koneksi_subprogram_LastUpdateStamp = $row_koneksi['subprogram_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($subprogram_detID == 0)
{
$sql_insert = "INSERT INTO subprogram_det SET
subprogram_detID = '" . addslashes($server_subprogram_detID) . "',
subprogram_create_user = '" . addslashes($server_subprogram_create_user) . "',
subprogram_create_time = '" . addslashes($server_subprogram_create_time) . "',
subprogram_edit_user = '" . addslashes($server_subprogram_edit_user) . "',
subprogram_edit_time = '" . addslashes($server_subprogram_edit_time) . "',
subprogram_ip = '" . addslashes($server_subprogram_ip) . "',
subprogram_SysTrxId = '" . addslashes($server_subprogram_SysTrxId) . "',
subprogram_Active = '" . addslashes($server_subprogram_Active) . "',
subprogram_Approve = '" . addslashes($server_subprogram_Approve) . "',
subprogram_SyncronizeDate = '" . addslashes($server_subprogram_SyncronizeDate) . "',
subprogram_LastExportDate = '" . addslashes($server_subprogram_LastExportDate) . "',
subprogram_TotalImported = '" . addslashes($server_subprogram_TotalImported) . "',
subprogram_TotalExported = '" . addslashes($server_subprogram_TotalExported) . "',
subprogram_SF_ysubprogram = '" . addslashes($server_subprogram_SF_ysubprogram) . "',
subprogram_Deleteable = '" . addslashes($server_subprogram_Deleteable) . "',
subprogram_Forensic = '" . addslashes($server_subprogram_Forensic) . "',
subprogram_PortfolioCd = '" . addslashes($server_subprogram_PortfolioCd) . "',
subprogram_Sub_PortfolioCd = '" . addslashes($server_subprogram_Sub_PortfolioCd) . "',
subprogram__dihapus_time = '" . addslashes($server_subprogram__dihapus_time) . "',
subprogram__dihapus = '" . addslashes($server_subprogram__dihapus) . "',
subprogram_LastUpdateStamp = '" . addslashes($server_subprogram_LastUpdateStamp) . "',
subprogram_main = '" . addslashes($server_subprogram_main) . "',
subprogram_sub = '" . addslashes($server_subprogram_sub) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert subprogram_det=>' . $err_msg;
echo "\n";
echo 'server_subprogram_detID=>' . $server_subprogram_detID;
echo "\n";
echo 'Insert subprogram_det=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE subprogram_det SET
subprogram_create_user = '" . addslashes($server_subprogram_create_user) . "',
subprogram_create_time = '" . addslashes($server_subprogram_create_time) . "',
subprogram_edit_user = '" . addslashes($server_subprogram_edit_user) . "',
subprogram_edit_time = '" . addslashes($server_subprogram_edit_time) . "',
subprogram_ip = '" . addslashes($server_subprogram_ip) . "',
subprogram_SysTrxId = '" . addslashes($server_subprogram_SysTrxId) . "',
subprogram_Active = '" . addslashes($server_subprogram_Active) . "',
subprogram_Approve = '" . addslashes($server_subprogram_Approve) . "',
subprogram_SyncronizeDate = '" . addslashes($server_subprogram_SyncronizeDate) . "',
subprogram_LastExportDate = '" . addslashes($server_subprogram_LastExportDate) . "',
subprogram_TotalImported = '" . addslashes($server_subprogram_TotalImported) . "',
subprogram_TotalExported = '" . addslashes($server_subprogram_TotalExported) . "',
subprogram_SF_ysubprogram = '" . addslashes($server_subprogram_SF_ysubprogram) . "',
subprogram_Deleteable = '" . addslashes($server_subprogram_Deleteable) . "',
subprogram_Forensic = '" . addslashes($server_subprogram_Forensic) . "',
subprogram_PortfolioCd = '" . addslashes($server_subprogram_PortfolioCd) . "',
subprogram_Sub_PortfolioCd = '" . addslashes($server_subprogram_Sub_PortfolioCd) . "',
subprogram__dihapus_time = '" . addslashes($server_subprogram__dihapus_time) . "',
subprogram__dihapus = '" . addslashes($server_subprogram__dihapus) . "',
subprogram_LastUpdateStamp = '" . addslashes($server_subprogram_LastUpdateStamp) . "',
subprogram_main = '" . addslashes($server_subprogram_main) . "',
subprogram_sub = '" . addslashes($server_subprogram_sub) . "'
WHERE subprogram_detID = " . $server_subprogram_detID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE subprogram_det=>' . $err_msg;
echo "\n";
echo 'server_subprogram_detID=>' . $server_subprogram_detID;
echo "\n";
echo 'UPDATE subprogram_det=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'pos_mstr')
{
echo "\n";
echo 'Sebelum pos_mstr=>' . $err_msg;
echo "\n";
list($server_pos_mstrID, $server_pos_create_user, $server_pos_create_time, $server_pos_edit_user, $server_pos_edit_time, $server_pos_ip, $server_pos_SysTrxId, $server_pos_Active, $server_pos_Approve, $server_pos_SyncronizeDate, $server_pos_LastExportDate, $server_pos_TotalImported, $server_pos_TotalExported, $server_pos_LastUpdateStamp, $server_pos_idRow, $server_pos_LocationCd, $server_pos_Rounding, $server_pos_TaxCd, $server_pos_AllowBackDate, $server_pos_IncStruck, $server_pos_CommOpenDrawer, $server_pos_AllowMinStock, $server_pos_AllowChangePrc, $server_pos_AllowTransfStore, $server_pos_AllowRefund, $server_pos_AllowReturn, $server_pos_ExpiredPOS, $server_pos_ExpiredPOSUOMCd, $server_pos_ExpiredSO, $server_pos_ExpiredSOUOMCd, $server_pos_StruckRunning, $server_pos_ApprovedLevel, $server_pos_strKey1, $server_pos_strKey2, $server_pos_strKey3, $server_pos_strValue1, $server_pos_strValue2, $server_pos_strValue3, $server_pos_intValue1, $server_pos_intValue2, $server_pos_dteValue1, $server_pos_dteValue2, $server_pos_Description, $server_pos_SecurityLayer, $server_pos_SF_SpecCashier, $server_pos_Deleteable, $server_pos_Forensic, $server_pos_PortfolioCd, $server_pos_Sub_PortfolioCd, $server_pos_loc_mstrID, $server_pos__dihapus, $server_pos__dihapus_time, $server_pos_RoundUP, $server_pos_ExpiredPOSmeasurement_uomID, $server_pos_ExpiredSOmeasurement_uomID, $server_pos_tax_mstrID, $server_pos_taxinclude) = explode('`', $line);
if ($server_pos_Active == '') $server_pos_Active = 'No';
if ($server_pos_Approve == '') $server_pos_Approve = 0;
if ($server_pos_TotalImported == '') $server_pos_TotalImported = 0;
if ($server_pos_TotalExported == '') $server_pos_TotalExported = 0;
if ($server_pos_idRow == '') $server_pos_idRow = 0;
if ($server_pos_Rounding == '') $server_pos_Rounding = 0;
if ($server_pos_AllowBackDate == '') $server_pos_AllowBackDate = 'No';
if ($server_pos_IncStruck == '') $server_pos_IncStruck = 0;
if ($server_pos_AllowMinStock == '') $server_pos_AllowMinStock = 'No';
if ($server_pos_AllowChangePrc == '') $server_pos_AllowChangePrc = 'No';
if ($server_pos_AllowTransfStore == '') $server_pos_AllowTransfStore = 'No';
if ($server_pos_AllowRefund == '') $server_pos_AllowRefund = 'No';
if ($server_pos_AllowReturn == '') $server_pos_AllowReturn = 'No';
if ($server_pos_ExpiredPOS == '') $server_pos_ExpiredPOS = 0;
if ($server_pos_ExpiredSO == '') $server_pos_ExpiredSO = 0;
if ($server_pos_intValue1 == '') $server_pos_intValue1 = 0;
if ($server_pos_intValue2 == '') $server_pos_intValue2 = 0;
if ($server_pos_dteValue1 == '') $server_pos_dteValue1 = '1900-01-01';
if ($server_pos_dteValue2 == '') $server_pos_dteValue2 = '1900-01-01';
if ($server_pos_SecurityLayer == '') $server_pos_SecurityLayer = 0;
if ($server_pos_Deleteable == '') $server_pos_Deleteable = 'No';
if ($server_pos_loc_mstrID == '') $server_pos_loc_mstrID = 0;
if ($server_pos__dihapus == '') $server_pos__dihapus = 'No';
if ($server_pos_RoundUP == '') $server_pos_RoundUP = 'No';
if ($server_pos_ExpiredPOSmeasurement_uomID == '') $server_pos_ExpiredPOSmeasurement_uomID = 0;
if ($server_pos_ExpiredSOmeasurement_uomID == '') $server_pos_ExpiredSOmeasurement_uomID = 0;
if ($server_pos_tax_mstrID == '') $server_pos_tax_mstrID = 0;
if ($server_pos_taxinclude == '') $server_pos_taxinclude = 'No';
$pos_mstrID = 0;
$koneksi_pos_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT pos_mstrID, pos_LastUpdateStamp FROM pos_mstr where pos_mstrID = " . $server_pos_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$pos_mstrID = $row_koneksi['pos_mstrID'];
$koneksi_pos_LastUpdateStamp = $row_koneksi['pos_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($pos_mstrID == 0)
{
$sql_insert = "INSERT INTO pos_mstr SET
pos_mstrID = '" . addslashes($server_pos_mstrID) . "',
pos_create_user = '" . addslashes($server_pos_create_user) . "',
pos_create_time = '" . addslashes($server_pos_create_time) . "',
pos_edit_user = '" . addslashes($server_pos_edit_user) . "',
pos_edit_time = '" . addslashes($server_pos_edit_time) . "',
pos_ip = '" . addslashes($server_pos_ip) . "',
pos_SysTrxId = '" . addslashes($server_pos_SysTrxId) . "',
pos_Active = '" . addslashes($server_pos_Active) . "',
pos_Approve = '" . addslashes($server_pos_Approve) . "',
pos_SyncronizeDate = '" . addslashes($server_pos_SyncronizeDate) . "',
pos_LastExportDate = '" . addslashes($server_pos_LastExportDate) . "',
pos_TotalImported = '" . addslashes($server_pos_TotalImported) . "',
pos_TotalExported = '" . addslashes($server_pos_TotalExported) . "',
pos_LastUpdateStamp = '" . addslashes($server_pos_LastUpdateStamp) . "',
pos_idRow = '" . addslashes($server_pos_idRow) . "',
pos_LocationCd = '" . addslashes($server_pos_LocationCd) . "',
pos_Rounding = '" . addslashes($server_pos_Rounding) . "',
pos_TaxCd = '" . addslashes($server_pos_TaxCd) . "',
pos_AllowBackDate = '" . addslashes($server_pos_AllowBackDate) . "',
pos_IncStruck = '" . addslashes($server_pos_IncStruck) . "',
pos_CommOpenDrawer = '" . addslashes($server_pos_CommOpenDrawer) . "',
pos_AllowMinStock = '" . addslashes($server_pos_AllowMinStock) . "',
pos_AllowChangePrc = '" . addslashes($server_pos_AllowChangePrc) . "',
pos_AllowTransfStore = '" . addslashes($server_pos_AllowTransfStore) . "',
pos_AllowRefund = '" . addslashes($server_pos_AllowRefund) . "',
pos_AllowReturn = '" . addslashes($server_pos_AllowReturn) . "',
pos_ExpiredPOS = '" . addslashes($server_pos_ExpiredPOS) . "',
pos_ExpiredPOSUOMCd = '" . addslashes($server_pos_ExpiredPOSUOMCd) . "',
pos_ExpiredSO = '" . addslashes($server_pos_ExpiredSO) . "',
pos_ExpiredSOUOMCd = '" . addslashes($server_pos_ExpiredSOUOMCd) . "',
pos_StruckRunning = '" . addslashes($server_pos_StruckRunning) . "',
pos_ApprovedLevel = '" . addslashes($server_pos_ApprovedLevel) . "',
pos_strKey1 = '" . addslashes($server_pos_strKey1) . "',
pos_strKey2 = '" . addslashes($server_pos_strKey2) . "',
pos_strKey3 = '" . addslashes($server_pos_strKey3) . "',
pos_strValue1 = '" . addslashes($server_pos_strValue1) . "',
pos_strValue2 = '" . addslashes($server_pos_strValue2) . "',
pos_strValue3 = '" . addslashes($server_pos_strValue3) . "',
pos_intValue1 = '" . addslashes($server_pos_intValue1) . "',
pos_intValue2 = '" . addslashes($server_pos_intValue2) . "',
pos_dteValue1 = '" . addslashes($server_pos_dteValue1) . "',
pos_dteValue2 = '" . addslashes($server_pos_dteValue2) . "',
pos_Description = '" . addslashes($server_pos_Description) . "',
pos_SecurityLayer = '" . addslashes($server_pos_SecurityLayer) . "',
pos_SF_SpecCashier = '" . addslashes($server_pos_SF_SpecCashier) . "',
pos_Deleteable = '" . addslashes($server_pos_Deleteable) . "',
pos_Forensic = '" . addslashes($server_pos_Forensic) . "',
pos_PortfolioCd = '" . addslashes($server_pos_PortfolioCd) . "',
pos_Sub_PortfolioCd = '" . addslashes($server_pos_Sub_PortfolioCd) . "',
pos_loc_mstrID = '" . addslashes($server_pos_loc_mstrID) . "',
pos__dihapus = '" . addslashes($server_pos__dihapus) . "',
pos__dihapus_time = '" . addslashes($server_pos__dihapus_time) . "',
pos_RoundUP = '" . addslashes($server_pos_RoundUP) . "',
pos_ExpiredPOSmeasurement_uomID = '" . addslashes($server_pos_ExpiredPOSmeasurement_uomID) . "',
pos_ExpiredSOmeasurement_uomID = '" . addslashes($server_pos_ExpiredSOmeasurement_uomID) . "',
pos_tax_mstrID = '" . addslashes($server_pos_tax_mstrID) . "',
pos_taxinclude = '" . addslashes($server_pos_taxinclude) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert pos_mstr=>' . $err_msg;
echo "\n";
echo 'server_pos_mstrID=>' . $server_pos_mstrID;
echo "\n";
echo 'Insert pos_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE pos_mstr SET
pos_create_user = '" . addslashes($server_pos_create_user) . "',
pos_create_time = '" . addslashes($server_pos_create_time) . "',
pos_edit_user = '" . addslashes($server_pos_edit_user) . "',
pos_edit_time = '" . addslashes($server_pos_edit_time) . "',
pos_ip = '" . addslashes($server_pos_ip) . "',
pos_SysTrxId = '" . addslashes($server_pos_SysTrxId) . "',
pos_Active = '" . addslashes($server_pos_Active) . "',
pos_Approve = '" . addslashes($server_pos_Approve) . "',
pos_SyncronizeDate = '" . addslashes($server_pos_SyncronizeDate) . "',
pos_LastExportDate = '" . addslashes($server_pos_LastExportDate) . "',
pos_TotalImported = '" . addslashes($server_pos_TotalImported) . "',
pos_TotalExported = '" . addslashes($server_pos_TotalExported) . "',
pos_LastUpdateStamp = '" . addslashes($server_pos_LastUpdateStamp) . "',
pos_idRow = '" . addslashes($server_pos_idRow) . "',
pos_LocationCd = '" . addslashes($server_pos_LocationCd) . "',
pos_Rounding = '" . addslashes($server_pos_Rounding) . "',
pos_TaxCd = '" . addslashes($server_pos_TaxCd) . "',
pos_AllowBackDate = '" . addslashes($server_pos_AllowBackDate) . "',
pos_IncStruck = '" . addslashes($server_pos_IncStruck) . "',
pos_CommOpenDrawer = '" . addslashes($server_pos_CommOpenDrawer) . "',
pos_AllowMinStock = '" . addslashes($server_pos_AllowMinStock) . "',
pos_AllowChangePrc = '" . addslashes($server_pos_AllowChangePrc) . "',
pos_AllowTransfStore = '" . addslashes($server_pos_AllowTransfStore) . "',
pos_AllowRefund = '" . addslashes($server_pos_AllowRefund) . "',
pos_AllowReturn = '" . addslashes($server_pos_AllowReturn) . "',
pos_ExpiredPOS = '" . addslashes($server_pos_ExpiredPOS) . "',
pos_ExpiredPOSUOMCd = '" . addslashes($server_pos_ExpiredPOSUOMCd) . "',
pos_ExpiredSO = '" . addslashes($server_pos_ExpiredSO) . "',
pos_ExpiredSOUOMCd = '" . addslashes($server_pos_ExpiredSOUOMCd) . "',
pos_StruckRunning = '" . addslashes($server_pos_StruckRunning) . "',
pos_ApprovedLevel = '" . addslashes($server_pos_ApprovedLevel) . "',
pos_strKey1 = '" . addslashes($server_pos_strKey1) . "',
pos_strKey2 = '" . addslashes($server_pos_strKey2) . "',
pos_strKey3 = '" . addslashes($server_pos_strKey3) . "',
pos_strValue1 = '" . addslashes($server_pos_strValue1) . "',
pos_strValue2 = '" . addslashes($server_pos_strValue2) . "',
pos_strValue3 = '" . addslashes($server_pos_strValue3) . "',
pos_intValue1 = '" . addslashes($server_pos_intValue1) . "',
pos_intValue2 = '" . addslashes($server_pos_intValue2) . "',
pos_dteValue1 = '" . addslashes($server_pos_dteValue1) . "',
pos_dteValue2 = '" . addslashes($server_pos_dteValue2) . "',
pos_Description = '" . addslashes($server_pos_Description) . "',
pos_SecurityLayer = '" . addslashes($server_pos_SecurityLayer) . "',
pos_SF_SpecCashier = '" . addslashes($server_pos_SF_SpecCashier) . "',
pos_Deleteable = '" . addslashes($server_pos_Deleteable) . "',
pos_Forensic = '" . addslashes($server_pos_Forensic) . "',
pos_PortfolioCd = '" . addslashes($server_pos_PortfolioCd) . "',
pos_Sub_PortfolioCd = '" . addslashes($server_pos_Sub_PortfolioCd) . "',
pos_loc_mstrID = '" . addslashes($server_pos_loc_mstrID) . "',
pos__dihapus = '" . addslashes($server_pos__dihapus) . "',
pos__dihapus_time = '" . addslashes($server_pos__dihapus_time) . "',
pos_RoundUP = '" . addslashes($server_pos_RoundUP) . "',
pos_ExpiredPOSmeasurement_uomID = '" . addslashes($server_pos_ExpiredPOSmeasurement_uomID) . "',
pos_ExpiredSOmeasurement_uomID = '" . addslashes($server_pos_ExpiredSOmeasurement_uomID) . "',
pos_tax_mstrID = '" . addslashes($server_pos_tax_mstrID) . "',
pos_taxinclude = '" . addslashes($server_pos_taxinclude) . "'
WHERE pos_mstrID = " . $server_pos_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE pos_mstr=>' . $err_msg;
echo "\n";
echo 'server_pos_mstrID=>' . $server_pos_mstrID;
echo "\n";
echo 'UPDATE pos_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'struck_mstr')
{
echo "\n";
echo 'Sebelum struck_mstr=>' . $err_msg;
echo "\n";
list($server_struck_mstrID, $server_struck_create_user, $server_struck_create_time, $server_struck_edit_user, $server_struck_edit_time, $server_struck_ip, $server_struck_SysTrxId, $server_struck_Active, $server_struck_Approve, $server_struck_SyncronizeDate, $server_struck_LastExportDate, $server_struck_TotalImported, $server_struck_TotalExported, $server_struck_LastUpdateStamp, $server_struck_idRow, $server_struck_Sequence, $server_struck_Description1, $server_struck_Description2, $server_struck_Description3, $server_struck_Description4, $server_struck_Description5, $server_struck_Desc1Alignment, $server_struck_Desc2Alignment, $server_struck_Desc3Alignment, $server_struck_Desc4Alignment, $server_struck_Desc5Alignment, $server_struck_FromDate, $server_struck_ToDate, $server_struck_BusinessCd, $server_struck_SF_Struck, $server_struck_Deleteable, $server_struck_Forensic, $server_struck_PortfolioCd, $server_struck_Sub_PortfolioCd, $server_struck_ContactCd, $server_struck_AddressCd, $server_struck_LocationCd, $server_struck_PositionCd, $server_struck_contact_mstrID, $server_struck_add_mstrID, $server_struck_loc_mstrID, $server_struck_businessunit_mstrID, $server_struck__dihapus, $server_struck__dihapus_time, $server_struck_struckposition_mstrID) = explode('`', $line);
if ($server_struck_Active == '') $server_struck_Active = 'No';
if ($server_struck_Approve == '') $server_struck_Approve = 0;
if ($server_struck_TotalImported == '') $server_struck_TotalImported = 0;
if ($server_struck_TotalExported == '') $server_struck_TotalExported = 0;
if ($server_struck_idRow == '') $server_struck_idRow = 0;
if ($server_struck_Sequence == '') $server_struck_Sequence = 0;
if ($server_struck_FromDate == '') $server_struck_FromDate = '1900-01-01';
if ($server_struck_ToDate == '') $server_struck_ToDate = '2999-01-01';
if ($server_struck_Deleteable == '') $server_struck_Deleteable = 'No';
if ($server_struck_contact_mstrID == '') $server_struck_contact_mstrID = 0;
if ($server_struck_add_mstrID == '') $server_struck_add_mstrID = 0;
if ($server_struck_loc_mstrID == '') $server_struck_loc_mstrID = 0;
if ($server_struck_businessunit_mstrID == '') $server_struck_businessunit_mstrID = 0;
if ($server_struck__dihapus == '') $server_struck__dihapus = 'No';
if ($server_struck_struckposition_mstrID == '') $server_struck_struckposition_mstrID = 0;
$struck_mstrID = 0;
$koneksi_struck_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT struck_mstrID, struck_LastUpdateStamp FROM struck_mstr where struck_mstrID = " . $server_struck_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$struck_mstrID = $row_koneksi['struck_mstrID'];
$koneksi_struck_LastUpdateStamp = $row_koneksi['struck_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($struck_mstrID == 0)
{
$sql_insert = "INSERT INTO struck_mstr SET
struck_mstrID = '" . addslashes($server_struck_mstrID) . "',
struck_create_user = '" . addslashes($server_struck_create_user) . "',
struck_create_time = '" . addslashes($server_struck_create_time) . "',
struck_edit_user = '" . addslashes($server_struck_edit_user) . "',
struck_edit_time = '" . addslashes($server_struck_edit_time) . "',
struck_ip = '" . addslashes($server_struck_ip) . "',
struck_SysTrxId = '" . addslashes($server_struck_SysTrxId) . "',
struck_Active = '" . addslashes($server_struck_Active) . "',
struck_Approve = '" . addslashes($server_struck_Approve) . "',
struck_SyncronizeDate = '" . addslashes($server_struck_SyncronizeDate) . "',
struck_LastExportDate = '" . addslashes($server_struck_LastExportDate) . "',
struck_TotalImported = '" . addslashes($server_struck_TotalImported) . "',
struck_TotalExported = '" . addslashes($server_struck_TotalExported) . "',
struck_LastUpdateStamp = '" . addslashes($server_struck_LastUpdateStamp) . "',
struck_idRow = '" . addslashes($server_struck_idRow) . "',
struck_Sequence = '" . addslashes($server_struck_Sequence) . "',
struck_Description1 = '" . addslashes($server_struck_Description1) . "',
struck_Description2 = '" . addslashes($server_struck_Description2) . "',
struck_Description3 = '" . addslashes($server_struck_Description3) . "',
struck_Description4 = '" . addslashes($server_struck_Description4) . "',
struck_Description5 = '" . addslashes($server_struck_Description5) . "',
struck_Desc1Alignment = '" . addslashes($server_struck_Desc1Alignment) . "',
struck_Desc2Alignment = '" . addslashes($server_struck_Desc2Alignment) . "',
struck_Desc3Alignment = '" . addslashes($server_struck_Desc3Alignment) . "',
struck_Desc4Alignment = '" . addslashes($server_struck_Desc4Alignment) . "',
struck_Desc5Alignment = '" . addslashes($server_struck_Desc5Alignment) . "',
struck_FromDate = '" . addslashes($server_struck_FromDate) . "',
struck_ToDate = '" . addslashes($server_struck_ToDate) . "',
struck_BusinessCd = '" . addslashes($server_struck_BusinessCd) . "',
struck_SF_Struck = '" . addslashes($server_struck_SF_Struck) . "',
struck_Deleteable = '" . addslashes($server_struck_Deleteable) . "',
struck_Forensic = '" . addslashes($server_struck_Forensic) . "',
struck_PortfolioCd = '" . addslashes($server_struck_PortfolioCd) . "',
struck_Sub_PortfolioCd = '" . addslashes($server_struck_Sub_PortfolioCd) . "',
struck_ContactCd = '" . addslashes($server_struck_ContactCd) . "',
struck_AddressCd = '" . addslashes($server_struck_AddressCd) . "',
struck_LocationCd = '" . addslashes($server_struck_LocationCd) . "',
struck_PositionCd = '" . addslashes($server_struck_PositionCd) . "',
struck_contact_mstrID = '" . addslashes($server_struck_contact_mstrID) . "',
struck_add_mstrID = '" . addslashes($server_struck_add_mstrID) . "',
struck_loc_mstrID = '" . addslashes($server_struck_loc_mstrID) . "',
struck_businessunit_mstrID = '" . addslashes($server_struck_businessunit_mstrID) . "',
struck__dihapus = '" . addslashes($server_struck__dihapus) . "',
struck__dihapus_time = '" . addslashes($server_struck__dihapus_time) . "',
struck_struckposition_mstrID = '" . addslashes($server_struck_struckposition_mstrID) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert struck_mstr=>' . $err_msg;
echo "\n";
echo 'server_struck_mstrID=>' . $server_struck_mstrID;
echo "\n";
echo 'Insert struck_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE struck_mstr SET
struck_mstrID = '" . addslashes($server_struck_mstrID) . "',
struck_create_user = '" . addslashes($server_struck_create_user) . "',
struck_create_time = '" . addslashes($server_struck_create_time) . "',
struck_edit_user = '" . addslashes($server_struck_edit_user) . "',
struck_edit_time = '" . addslashes($server_struck_edit_time) . "',
struck_ip = '" . addslashes($server_struck_ip) . "',
struck_SysTrxId = '" . addslashes($server_struck_SysTrxId) . "',
struck_Active = '" . addslashes($server_struck_Active) . "',
struck_Approve = '" . addslashes($server_struck_Approve) . "',
struck_SyncronizeDate = '" . addslashes($server_struck_SyncronizeDate) . "',
struck_LastExportDate = '" . addslashes($server_struck_LastExportDate) . "',
struck_TotalImported = '" . addslashes($server_struck_TotalImported) . "',
struck_TotalExported = '" . addslashes($server_struck_TotalExported) . "',
struck_LastUpdateStamp = '" . addslashes($server_struck_LastUpdateStamp) . "',
struck_idRow = '" . addslashes($server_struck_idRow) . "',
struck_Sequence = '" . addslashes($server_struck_Sequence) . "',
struck_Description1 = '" . addslashes($server_struck_Description1) . "',
struck_Description2 = '" . addslashes($server_struck_Description2) . "',
struck_Description3 = '" . addslashes($server_struck_Description3) . "',
struck_Description4 = '" . addslashes($server_struck_Description4) . "',
struck_Description5 = '" . addslashes($server_struck_Description5) . "',
struck_Desc1Alignment = '" . addslashes($server_struck_Desc1Alignment) . "',
struck_Desc2Alignment = '" . addslashes($server_struck_Desc2Alignment) . "',
struck_Desc3Alignment = '" . addslashes($server_struck_Desc3Alignment) . "',
struck_Desc4Alignment = '" . addslashes($server_struck_Desc4Alignment) . "',
struck_Desc5Alignment = '" . addslashes($server_struck_Desc5Alignment) . "',
struck_FromDate = '" . addslashes($server_struck_FromDate) . "',
struck_ToDate = '" . addslashes($server_struck_ToDate) . "',
struck_BusinessCd = '" . addslashes($server_struck_BusinessCd) . "',
struck_SF_Struck = '" . addslashes($server_struck_SF_Struck) . "',
struck_Deleteable = '" . addslashes($server_struck_Deleteable) . "',
struck_Forensic = '" . addslashes($server_struck_Forensic) . "',
struck_PortfolioCd = '" . addslashes($server_struck_PortfolioCd) . "',
struck_Sub_PortfolioCd = '" . addslashes($server_struck_Sub_PortfolioCd) . "',
struck_ContactCd = '" . addslashes($server_struck_ContactCd) . "',
struck_AddressCd = '" . addslashes($server_struck_AddressCd) . "',
struck_LocationCd = '" . addslashes($server_struck_LocationCd) . "',
struck_PositionCd = '" . addslashes($server_struck_PositionCd) . "',
struck_contact_mstrID = '" . addslashes($server_struck_contact_mstrID) . "',
struck_add_mstrID = '" . addslashes($server_struck_add_mstrID) . "',
struck_loc_mstrID = '" . addslashes($server_struck_loc_mstrID) . "',
struck_businessunit_mstrID = '" . addslashes($server_struck_businessunit_mstrID) . "',
struck__dihapus = '" . addslashes($server_struck__dihapus) . "',
struck__dihapus_time = '" . addslashes($server_struck__dihapus_time) . "',
struck_struckposition_mstrID = '" . addslashes($server_struck_struckposition_mstrID) . "'
WHERE struck_mstrID = " . $server_struck_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE struck_mstr=>' . $err_msg;
echo "\n";
echo 'server_struck_mstrID=>' . $server_struck_mstrID;
echo "\n";
echo 'UPDATE struck_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'brand_mstr')
{
echo "\n";
echo 'Sebelum brand_mstr=>' . $err_msg;
echo "\n";
list($server_brand_mstrID, $server_brand_create_user, $server_brand_create_time, $server_brand_edit_user, $server_brand_edit_time, $server_brand_ip, $server_brand_SysTrxId, $server_brand_Active, $server_brand_Approve, $server_brand_SyncronizeDate, $server_brand_LastExportDate, $server_brand_TotalImported, $server_brand_TotalExported, $server_brand_LastUpdateStamp, $server_brand_idRow, $server_brand_BrandCd, $server_brand_BrandName, $server_brand_Description, $server_brand_SF_Brand, $server_brand_Deleteable, $server_brand_Forensic, $server_brand_PortfolioCd, $server_brand_Sub_PortfolioCd, $server_brand__dihapus, $server_brand__dihapus_time) = explode('`', $line);
if ($server_brand_Active == '') $server_brand_Active = 'No';
if ($server_brand_Approve == '') $server_brand_Approve = 0;
if ($server_brand_TotalImported == '') $server_brand_TotalImported = 0;
if ($server_brand_TotalExported == '') $server_brand_TotalExported = 0;
if ($server_brand_idRow == '') $server_brand_idRow = 0;
if ($server_brand_Deleteable == '') $server_brand_Deleteable = 'No';
if ($server_brand__dihapus == '') $server_brand__dihapus = 'No';
$brand_mstrID = 0;
$koneksi_brand_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT brand_mstrID, brand_LastUpdateStamp FROM brand_mstr where brand_mstrID = " . $server_brand_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$brand_mstrID = $row_koneksi['brand_mstrID'];
$koneksi_brand_LastUpdateStamp = $row_koneksi['brand_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($brand_mstrID == 0)
{
$sql_insert = "INSERT INTO brand_mstr SET brand_mstrID = '" . addslashes($server_brand_mstrID) . "', brand_create_user = '" . addslashes($server_brand_create_user) . "', brand_create_time = '" . addslashes($server_brand_create_time) . "', brand_edit_user = '" . addslashes($server_brand_edit_user) . "', brand_edit_time = '" . addslashes($server_brand_edit_time) . "', brand_ip = '" . addslashes($server_brand_ip) . "', brand_SysTrxId = '" . addslashes($server_brand_SysTrxId) . "', brand_Active = '" . addslashes($server_brand_Active) . "', brand_Approve = '" . addslashes($server_brand_Approve) . "', brand_SyncronizeDate = '" . addslashes($server_brand_SyncronizeDate) . "', brand_LastExportDate = '" . addslashes($server_brand_LastExportDate) . "', brand_TotalImported = '" . addslashes($server_brand_TotalImported) . "', brand_TotalExported = '" . addslashes($server_brand_TotalExported) . "', brand_LastUpdateStamp = '" . addslashes($server_brand_LastUpdateStamp) . "', brand_idRow = '" . addslashes($server_brand_idRow) . "', brand_BrandCd = '" . addslashes($server_brand_BrandCd) . "', brand_BrandName = '" . addslashes($server_brand_BrandName) . "', brand_Description = '" . addslashes($server_brand_Description) . "', brand_SF_Brand = '" . addslashes($server_brand_SF_Brand) . "', brand_Deleteable = '" . addslashes($server_brand_Deleteable) . "', brand_Forensic = '" . addslashes($server_brand_Forensic) . "', brand_PortfolioCd = '" . addslashes($server_brand_PortfolioCd) . "', brand_Sub_PortfolioCd = '" . addslashes($server_brand_Sub_PortfolioCd) . "', brand__dihapus = '" . addslashes($server_brand__dihapus) . "', brand__dihapus_time = '" . addslashes($server_brand__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert brand_mstr=>' . $err_msg;
echo "\n";
echo 'server_brand_mstrID=>' . $server_brand_mstrID;
echo "\n";
echo 'Insert brand_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE brand_mstr SET brand_create_user = '" . addslashes($server_brand_create_user) . "', brand_create_time = '" . addslashes($server_brand_create_time) . "', brand_edit_user = '" . addslashes($server_brand_edit_user) . "', brand_edit_time = '" . addslashes($server_brand_edit_time) . "', brand_ip = '" . addslashes($server_brand_ip) . "', brand_SysTrxId = '" . addslashes($server_brand_SysTrxId) . "', brand_Active = '" . addslashes($server_brand_Active) . "', brand_Approve = '" . addslashes($server_brand_Approve) . "', brand_SyncronizeDate = '" . addslashes($server_brand_SyncronizeDate) . "', brand_LastExportDate = '" . addslashes($server_brand_LastExportDate) . "', brand_TotalImported = '" . addslashes($server_brand_TotalImported) . "', brand_TotalExported = '" . addslashes($server_brand_TotalExported) . "', brand_LastUpdateStamp = '" . addslashes($server_brand_LastUpdateStamp) . "', brand_idRow = '" . addslashes($server_brand_idRow) . "', brand_BrandCd = '" . addslashes($server_brand_BrandCd) . "', brand_BrandName = '" . addslashes($server_brand_BrandName) . "', brand_Description = '" . addslashes($server_brand_Description) . "', brand_SF_Brand = '" . addslashes($server_brand_SF_Brand) . "', brand_Deleteable = '" . addslashes($server_brand_Deleteable) . "', brand_Forensic = '" . addslashes($server_brand_Forensic) . "', brand_PortfolioCd = '" . addslashes($server_brand_PortfolioCd) . "', brand_Sub_PortfolioCd = '" . addslashes($server_brand_Sub_PortfolioCd) . "', brand__dihapus = '" . addslashes($server_brand__dihapus) . "', brand__dihapus_time = '" . addslashes($server_brand__dihapus_time) . "' WHERE brand_mstrID = " . $server_brand_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE brand_mstr=>' . $err_msg;
echo "\n";
echo 'server_brand_mstrID=>' . $server_brand_mstrID;
echo "\n";
echo 'UPDATE brand_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'computerassignd_detail')
{
echo "\n";
echo 'Sebelum computerassignd_detail=>' . $err_msg;
echo "\n";
list($server_computerassignd_detailID, $server_computerassignd_create_user, $server_computerassignd_create_time, $server_computerassignd_edit_user, $server_computerassignd_edit_time, $server_computerassignd_ip, $server_computerassignd_SysTrxId, $server_computerassignd_Active, $server_computerassignd_Approve, $server_computerassignd_SyncronizeDate, $server_computerassignd_LastExportDate, $server_computerassignd_TotalImported, $server_computerassignd_TotalExported, $server_computerassignd_LastUpdateStamp, $server_computerassignd_idRow, $server_computerassignd_ComputerCd, $server_computerassignd_LocationCd, $server_computerassignd_MachineName, $server_computerassignd_CurrencyCd, $server_computerassignd_Description, $server_computerassignd_POSNo, $server_computerassignd_DBTypeCd, $server_computerassignd_IPAddress, $server_computerassignd_IsPOS, $server_computerassignd_SF_MachineDetail, $server_computerassignd_Deleteable, $server_computerassignd_Forensic, $server_computerassignd_PortfolioCd, $server_computerassignd_Sub_PortfolioCd, $server_computerassignd_computerassignh_headerID, $server_computerassignd_loc_mstrID, $server_computerassignd__dihapus, $server_computerassignd__dihapus_time, $server_computerassignd_currency_mstrID) = explode('`', $line);
if ($server_computerassignd_Active == '') $server_computerassignd_Active = 'No';
if ($server_computerassignd_Approve == '') $server_computerassignd_Approve = 0;
if ($server_computerassignd_TotalImported == '') $server_computerassignd_TotalImported = 0;
if ($server_computerassignd_TotalExported == '') $server_computerassignd_TotalExported = 0;
if ($server_computerassignd_idRow == '') $server_computerassignd_idRow = 0;
if ($server_computerassignd_IsPOS == '') $server_computerassignd_IsPOS = 'No';
if ($server_computerassignd_Deleteable == '') $server_computerassignd_Deleteable = 'No';
if ($server_computerassignd_computerassignh_headerID == '') $server_computerassignd_computerassignh_headerID = 0;
if ($server_computerassignd_loc_mstrID == '') $server_computerassignd_loc_mstrID = 0;
if ($server_computerassignd__dihapus == '') $server_computerassignd__dihapus = 'No';
if ($server_computerassignd_currency_mstrID == '') $server_computerassignd_currency_mstrID = 0;
$computerassignd_detailID = 0;
$koneksi_computerassignd_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT computerassignd_detailID, computerassignd_LastUpdateStamp FROM computerassignd_detail where computerassignd_detailID = " . $server_computerassignd_detailID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$computerassignd_detailID = $row_koneksi['computerassignd_detailID'];
$koneksi_computerassignd_LastUpdateStamp = $row_koneksi['computerassignd_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($computerassignd_detailID == 0)
{
$sql_insert = "INSERT INTO computerassignd_detail SET computerassignd_detailID = '" . addslashes($server_computerassignd_detailID) . "', computerassignd_create_user = '" . addslashes($server_computerassignd_create_user) . "', computerassignd_create_time = '" . addslashes($server_computerassignd_create_time) . "', computerassignd_edit_user = '" . addslashes($server_computerassignd_edit_user) . "', computerassignd_edit_time = '" . addslashes($server_computerassignd_edit_time) . "', computerassignd_ip = '" . addslashes($server_computerassignd_ip) . "', computerassignd_SysTrxId = '" . addslashes($server_computerassignd_SysTrxId) . "', computerassignd_Active = '" . addslashes($server_computerassignd_Active) . "', computerassignd_Approve = '" . addslashes($server_computerassignd_Approve) . "', computerassignd_SyncronizeDate = '" . addslashes($server_computerassignd_SyncronizeDate) . "', computerassignd_LastExportDate = '" . addslashes($server_computerassignd_LastExportDate) . "', computerassignd_TotalImported = '" . addslashes($server_computerassignd_TotalImported) . "', computerassignd_TotalExported = '" . addslashes($server_computerassignd_TotalExported) . "', computerassignd_LastUpdateStamp = '" . addslashes($server_computerassignd_LastUpdateStamp) . "', computerassignd_idRow = '" . addslashes($server_computerassignd_idRow) . "', computerassignd_ComputerCd = '" . addslashes($server_computerassignd_ComputerCd) . "', computerassignd_LocationCd = '" . addslashes($server_computerassignd_LocationCd) . "', computerassignd_MachineName = '" . addslashes($server_computerassignd_MachineName) . "', computerassignd_CurrencyCd = '" . addslashes($server_computerassignd_CurrencyCd) . "', computerassignd_Description = '" . addslashes($server_computerassignd_Description) . "', computerassignd_POSNo = '" . addslashes($server_computerassignd_POSNo) . "', computerassignd_DBTypeCd = '" . addslashes($server_computerassignd_DBTypeCd) . "', computerassignd_IPAddress = '" . addslashes($server_computerassignd_IPAddress) . "', computerassignd_IsPOS = '" . addslashes($server_computerassignd_IsPOS) . "', computerassignd_SF_MachineDetail = '" . addslashes($server_computerassignd_SF_MachineDetail) . "', computerassignd_Deleteable = '" . addslashes($server_computerassignd_Deleteable) . "', computerassignd_Forensic = '" . addslashes($server_computerassignd_Forensic) . "', computerassignd_PortfolioCd = '" . addslashes($server_computerassignd_PortfolioCd) . "', computerassignd_Sub_PortfolioCd = '" . addslashes($server_computerassignd_Sub_PortfolioCd) . "', computerassignd_computerassignh_headerID = '" . addslashes($server_computerassignd_computerassignh_headerID) . "', computerassignd_loc_mstrID = '" . addslashes($server_computerassignd_loc_mstrID) . "', computerassignd__dihapus = '" . addslashes($server_computerassignd__dihapus) . "', computerassignd__dihapus_time = '" . addslashes($server_computerassignd__dihapus_time) . "', computerassignd_currency_mstrID = '" . addslashes($server_computerassignd_currency_mstrID) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert computerassignd_detail=>' . $err_msg;
echo "\n";
echo 'server_computerassignd_detailID=>' . $server_computerassignd_detailID;
echo "\n";
echo 'Insert computerassignd_detail=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE computerassignd_detail SET computerassignd_create_user = '" . addslashes($server_computerassignd_create_user) . "', computerassignd_create_time = '" . addslashes($server_computerassignd_create_time) . "', computerassignd_edit_user = '" . addslashes($server_computerassignd_edit_user) . "', computerassignd_edit_time = '" . addslashes($server_computerassignd_edit_time) . "', computerassignd_ip = '" . addslashes($server_computerassignd_ip) . "', computerassignd_SysTrxId = '" . addslashes($server_computerassignd_SysTrxId) . "', computerassignd_Active = '" . addslashes($server_computerassignd_Active) . "', computerassignd_Approve = '" . addslashes($server_computerassignd_Approve) . "', computerassignd_SyncronizeDate = '" . addslashes($server_computerassignd_SyncronizeDate) . "', computerassignd_LastExportDate = '" . addslashes($server_computerassignd_LastExportDate) . "', computerassignd_TotalImported = '" . addslashes($server_computerassignd_TotalImported) . "', computerassignd_TotalExported = '" . addslashes($server_computerassignd_TotalExported) . "', computerassignd_LastUpdateStamp = '" . addslashes($server_computerassignd_LastUpdateStamp) . "', computerassignd_idRow = '" . addslashes($server_computerassignd_idRow) . "', computerassignd_ComputerCd = '" . addslashes($server_computerassignd_ComputerCd) . "', computerassignd_LocationCd = '" . addslashes($server_computerassignd_LocationCd) . "', computerassignd_MachineName = '" . addslashes($server_computerassignd_MachineName) . "', computerassignd_CurrencyCd = '" . addslashes($server_computerassignd_CurrencyCd) . "', computerassignd_Description = '" . addslashes($server_computerassignd_Description) . "', computerassignd_POSNo = '" . addslashes($server_computerassignd_POSNo) . "', computerassignd_DBTypeCd = '" . addslashes($server_computerassignd_DBTypeCd) . "', computerassignd_IPAddress = '" . addslashes($server_computerassignd_IPAddress) . "', computerassignd_IsPOS = '" . addslashes($server_computerassignd_IsPOS) . "', computerassignd_SF_MachineDetail = '" . addslashes($server_computerassignd_SF_MachineDetail) . "', computerassignd_Deleteable = '" . addslashes($server_computerassignd_Deleteable) . "', computerassignd_Forensic = '" . addslashes($server_computerassignd_Forensic) . "', computerassignd_PortfolioCd = '" . addslashes($server_computerassignd_PortfolioCd) . "', computerassignd_Sub_PortfolioCd = '" . addslashes($server_computerassignd_Sub_PortfolioCd) . "', computerassignd_computerassignh_headerID = '" . addslashes($server_computerassignd_computerassignh_headerID) . "', computerassignd_loc_mstrID = '" . addslashes($server_computerassignd_loc_mstrID) . "', computerassignd__dihapus = '" . addslashes($server_computerassignd__dihapus) . "', computerassignd__dihapus_time = '" . addslashes($server_computerassignd__dihapus_time) . "', computerassignd_currency_mstrID = '" . addslashes($server_computerassignd_currency_mstrID) . "' WHERE computerassignd_detailID = " . $server_computerassignd_detailID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE computerassignd_detail=>' . $err_msg;
echo "\n";
echo 'server_computerassignd_detailID=>' . $server_computerassignd_detailID;
echo "\n";
echo 'UPDATE computerassignd_detail=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'salesmand_detail')
{
echo "\n";
echo 'Sebelum salesmand_detail=>' . $err_msg;
echo "\n";
list($server_salesmand_detailID, $server_salesmand_create_user, $server_salesmand_create_time, $server_salesmand_edit_user, $server_salesmand_edit_time, $server_salesmand_ip, $server_salesmand_SysTrxId, $server_salesmand_Active, $server_salesmand_Approve, $server_salesmand_SyncronizeDate, $server_salesmand_LastExportDate, $server_salesmand_TotalImported, $server_salesmand_TotalExported, $server_salesmand_LastUpdateStamp, $server_salesmand_idRow, $server_salesmand_SalesmanContactCd, $server_salesmand_LocationCd, $server_salesmand_LocationName, $server_salesmand_PStatus, $server_salesmand_PortfolioCd, $server_salesmand_Sub_PortfolioCd, $server_salesmand_Deleteable, $server_salesmand_Forensic, $server_salesmand_salesmanh_headerID, $server_salesmand_salesmanh_SalesmanContactName, $server_salesmand_loc_mstrID, $server_salesmand__dihapus, $server_salesmand__dihapus_time) = explode('`', $line);
if ($server_salesmand_Active == '') $server_salesmand_Active = 'No';
if ($server_salesmand_Approve == '') $server_salesmand_Approve = 0;
if ($server_salesmand_TotalImported == '') $server_salesmand_TotalImported = 0;
if ($server_salesmand_TotalExported == '') $server_salesmand_TotalExported = 0;
if ($server_salesmand_idRow == '') $server_salesmand_idRow = 0;
if ($server_salesmand_Deleteable == '') $server_salesmand_Deleteable = 'No';
if ($server_salesmand_salesmanh_headerID == '') $server_salesmand_salesmanh_headerID = 0;
if ($server_salesmand_loc_mstrID == '') $server_salesmand_loc_mstrID = 0;
if ($server_salesmand__dihapus == '') $server_salesmand__dihapus = 'No';
$salesmand_detailID = 0;
$koneksi_add_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT salesmand_detailID, salesmand_LastUpdateStamp FROM salesmand_detail where salesmand_detailID = " . $server_salesmand_detailID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$salesmand_detailID = $row_koneksi['salesmand_detailID'];
$koneksi_add_LastUpdateStamp = $row_koneksi['add_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($salesmand_detailID == 0)
{
$sql_insert = "INSERT INTO salesmand_detail SET salesmand_detailID = '" . addslashes($server_salesmand_detailID) . "', salesmand_create_user = '" . addslashes($server_salesmand_create_user) . "', salesmand_create_time = '" . addslashes($server_salesmand_create_time) . "', salesmand_edit_user = '" . addslashes($server_salesmand_edit_user) . "', salesmand_edit_time = '" . addslashes($server_salesmand_edit_time) . "', salesmand_ip = '" . addslashes($server_salesmand_ip) . "', salesmand_SysTrxId = '" . addslashes($server_salesmand_SysTrxId) . "', salesmand_Active = '" . addslashes($server_salesmand_Active) . "', salesmand_Approve = '" . addslashes($server_salesmand_Approve) . "', salesmand_SyncronizeDate = '" . addslashes($server_salesmand_SyncronizeDate) . "', salesmand_LastExportDate = '" . addslashes($server_salesmand_LastExportDate) . "', salesmand_TotalImported = '" . addslashes($server_salesmand_TotalImported) . "', salesmand_TotalExported = '" . addslashes($server_salesmand_TotalExported) . "', salesmand_LastUpdateStamp = '" . addslashes($server_salesmand_LastUpdateStamp) . "', salesmand_idRow = '" . addslashes($server_salesmand_idRow) . "', salesmand_SalesmanContactCd = '" . addslashes($server_salesmand_SalesmanContactCd) . "', salesmand_LocationCd = '" . addslashes($server_salesmand_LocationCd) . "', salesmand_LocationName = '" . addslashes($server_salesmand_LocationName) . "', salesmand_PStatus = '" . addslashes($server_salesmand_PStatus) . "', salesmand_PortfolioCd = '" . addslashes($server_salesmand_PortfolioCd) . "', salesmand_Sub_PortfolioCd = '" . addslashes($server_salesmand_Sub_PortfolioCd) . "', salesmand_Deleteable = '" . addslashes($server_salesmand_Deleteable) . "', salesmand_Forensic = '" . addslashes($server_salesmand_Forensic) . "', salesmand_salesmanh_headerID = '" . addslashes($server_salesmand_salesmanh_headerID) . "', salesmand_salesmanh_SalesmanContactName = '" . addslashes($server_salesmand_salesmanh_SalesmanContactName) . "', salesmand_loc_mstrID = '" . addslashes($server_salesmand_loc_mstrID) . "', salesmand__dihapus = '" . addslashes($server_salesmand__dihapus) . "', salesmand__dihapus_time = '" . addslashes($server_salesmand__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert salesmand_detail=>' . $err_msg;
echo "\n";
echo 'server_salesmand_detailID=>' . $server_salesmand_detailID;
echo "\n";
echo 'Insert salesmand_detail=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE salesmand_detail SET salesmand_create_user = '" . addslashes($server_salesmand_create_user) . "', salesmand_create_time = '" . addslashes($server_salesmand_create_time) . "', salesmand_edit_user = '" . addslashes($server_salesmand_edit_user) . "', salesmand_edit_time = '" . addslashes($server_salesmand_edit_time) . "', salesmand_ip = '" . addslashes($server_salesmand_ip) . "', salesmand_SysTrxId = '" . addslashes($server_salesmand_SysTrxId) . "', salesmand_Active = '" . addslashes($server_salesmand_Active) . "', salesmand_Approve = '" . addslashes($server_salesmand_Approve) . "', salesmand_SyncronizeDate = '" . addslashes($server_salesmand_SyncronizeDate) . "', salesmand_LastExportDate = '" . addslashes($server_salesmand_LastExportDate) . "', salesmand_TotalImported = '" . addslashes($server_salesmand_TotalImported) . "', salesmand_TotalExported = '" . addslashes($server_salesmand_TotalExported) . "', salesmand_LastUpdateStamp = '" . addslashes($server_salesmand_LastUpdateStamp) . "', salesmand_idRow = '" . addslashes($server_salesmand_idRow) . "', salesmand_SalesmanContactCd = '" . addslashes($server_salesmand_SalesmanContactCd) . "', salesmand_LocationCd = '" . addslashes($server_salesmand_LocationCd) . "', salesmand_LocationName = '" . addslashes($server_salesmand_LocationName) . "', salesmand_PStatus = '" . addslashes($server_salesmand_PStatus) . "', salesmand_PortfolioCd = '" . addslashes($server_salesmand_PortfolioCd) . "', salesmand_Sub_PortfolioCd = '" . addslashes($server_salesmand_Sub_PortfolioCd) . "', salesmand_Deleteable = '" . addslashes($server_salesmand_Deleteable) . "', salesmand_Forensic = '" . addslashes($server_salesmand_Forensic) . "', salesmand_salesmanh_headerID = '" . addslashes($server_salesmand_salesmanh_headerID) . "', salesmand_salesmanh_SalesmanContactName = '" . addslashes($server_salesmand_salesmanh_SalesmanContactName) . "', salesmand_loc_mstrID = '" . addslashes($server_salesmand_loc_mstrID) . "', salesmand__dihapus = '" . addslashes($server_salesmand__dihapus) . "', salesmand__dihapus_time = '" . addslashes($server_salesmand__dihapus_time) . "' WHERE salesmand_detailID = " . $server_salesmand_detailID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE salesmand_detail=>' . $err_msg;
echo "\n";
echo 'server_salesmand_detailID=>' . $server_salesmand_detailID;
echo "\n";
echo 'UPDATE salesmand_detail=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'salesmanh_header')
{
echo "\n";
echo 'Sebelum salesmanh_header=>' . $err_msg;
echo "\n";
list($server_salesmanh_headerID, $server_salesmanh_create_user, $server_salesmanh_create_time, $server_salesmanh_edit_user, $server_salesmanh_edit_time, $server_salesmanh_ip, $server_salesmanh_SysTrxId, $server_salesmanh_Active, $server_salesmanh_Approve, $server_salesmanh_SyncronizeDate, $server_salesmanh_LastExportDate, $server_salesmanh_TotalImported, $server_salesmanh_TotalExported, $server_salesmanh_LastUpdateStamp, $server_salesmanh_idRow, $server_salesmanh_TopContactCd, $server_salesmanh_MiddleContactCd, $server_salesmanh_BottomContactCd, $server_salesmanh_SalesmanContactCd, $server_salesmanh_SalesmanContactName, $server_salesmanh_Description, $server_salesmanh_PStatus, $server_salesmanh_PortfolioCd, $server_salesmanh_Sub_PortfolioCd, $server_salesmanh_Deleteable, $server_salesmanh_Forensic, $server_salesmanh_top_mstrID, $server_salesmanh__dihapus, $server_salesmanh__dihapus_time, $server_salesmanh_Topcontact_mstrID, $server_salesmanh_Middlecontact_mstrID, $server_salesmanh_Bottomcontact_mstrID, $server_salesmanh_Salesmancontact_mstrID, $server_salesmanh_formula1) = explode('`', $line);
if ($server_salesmanh_Active == '') $server_salesmanh_Active = 'No';
if ($server_salesmanh_Approve == '') $server_salesmanh_Approve = 0;
if ($server_salesmanh_TotalImported == '') $server_salesmanh_TotalImported = 0;
if ($server_salesmanh_TotalExported == '') $server_salesmanh_TotalExported = 0;
if ($server_salesmanh_idRow == '') $server_salesmanh_idRow = 0;
if ($server_salesmanh_Deleteable == '') $server_salesmanh_Deleteable = 'No';
if ($server_salesmanh_top_mstrID == '') $server_salesmanh_top_mstrID = 0;
if ($server_salesmanh__dihapus == '') $server_salesmanh__dihapus = 'No';
if ($server_salesmanh_Topcontact_mstrID == '') $server_salesmanh_Topcontact_mstrID = 0;
if ($server_salesmanh_Middlecontact_mstrID == '') $server_salesmanh_Middlecontact_mstrID = 0;
if ($server_salesmanh_Bottomcontact_mstrID == '') $server_salesmanh_Bottomcontact_mstrID = 0;
if ($server_salesmanh_Salesmancontact_mstrID == '') $server_salesmanh_Salesmancontact_mstrID = 0;
if ($server_salesmanh_formula1 == '') $server_salesmanh_formula1 = 0;
$salesmanh_headerID = 0;
$koneksi_salesmanh_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT salesmanh_headerID, salesmanh_LastUpdateStamp FROM salesmanh_header where salesmanh_headerID = " . $server_salesmanh_headerID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$salesmanh_headerID = $row_koneksi['salesmanh_headerID'];
$koneksi_salesmanh_LastUpdateStamp = $row_koneksi['salesmanh_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($salesmanh_headerID == 0)
{
$sql_insert = "INSERT INTO salesmanh_header SET salesmanh_headerID = '" . addslashes($server_salesmanh_headerID) . "', salesmanh_create_user = '" . addslashes($server_salesmanh_create_user) . "', salesmanh_create_time = '" . addslashes($server_salesmanh_create_time) . "', salesmanh_edit_user = '" . addslashes($server_salesmanh_edit_user) . "', salesmanh_edit_time = '" . addslashes($server_salesmanh_edit_time) . "', salesmanh_ip = '" . addslashes($server_salesmanh_ip) . "', salesmanh_SysTrxId = '" . addslashes($server_salesmanh_SysTrxId) . "', salesmanh_Active = '" . addslashes($server_salesmanh_Active) . "', salesmanh_Approve = '" . addslashes($server_salesmanh_Approve) . "', salesmanh_SyncronizeDate = '" . addslashes($server_salesmanh_SyncronizeDate) . "', salesmanh_LastExportDate = '" . addslashes($server_salesmanh_LastExportDate) . "', salesmanh_TotalImported = '" . addslashes($server_salesmanh_TotalImported) . "', salesmanh_TotalExported = '" . addslashes($server_salesmanh_TotalExported) . "', salesmanh_LastUpdateStamp = '" . addslashes($server_salesmanh_LastUpdateStamp) . "', salesmanh_idRow = '" . addslashes($server_salesmanh_idRow) . "', salesmanh_TopContactCd = '" . addslashes($server_salesmanh_TopContactCd) . "', salesmanh_MiddleContactCd = '" . addslashes($server_salesmanh_MiddleContactCd) . "', salesmanh_BottomContactCd = '" . addslashes($server_salesmanh_BottomContactCd) . "', salesmanh_SalesmanContactCd = '" . addslashes($server_salesmanh_SalesmanContactCd) . "', salesmanh_SalesmanContactName = '" . addslashes($server_salesmanh_SalesmanContactName) . "', salesmanh_Description = '" . addslashes($server_salesmanh_Description) . "', salesmanh_PStatus = '" . addslashes($server_salesmanh_PStatus) . "', salesmanh_PortfolioCd = '" . addslashes($server_salesmanh_PortfolioCd) . "', salesmanh_Sub_PortfolioCd = '" . addslashes($server_salesmanh_Sub_PortfolioCd) . "', salesmanh_Deleteable = '" . addslashes($server_salesmanh_Deleteable) . "', salesmanh_Forensic = '" . addslashes($server_salesmanh_Forensic) . "', salesmanh_top_mstrID = '" . addslashes($server_salesmanh_top_mstrID) . "', salesmanh__dihapus = '" . addslashes($server_salesmanh__dihapus) . "', salesmanh__dihapus_time = '" . addslashes($server_salesmanh__dihapus_time) . "', salesmanh_Topcontact_mstrID = '" . addslashes($server_salesmanh_Topcontact_mstrID) . "', salesmanh_Middlecontact_mstrID = '" . addslashes($server_salesmanh_Middlecontact_mstrID) . "', salesmanh_Bottomcontact_mstrID = '" . addslashes($server_salesmanh_Bottomcontact_mstrID) . "', salesmanh_Salesmancontact_mstrID = '" . addslashes($server_salesmanh_Salesmancontact_mstrID) . "', salesmanh_formula1 = '" . addslashes($server_salesmanh_formula1) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert salesmanh_header=>' . $err_msg;
echo "\n";
echo 'server_salesmanh_headerID=>' . $server_salesmanh_headerID;
echo "\n";
echo 'Insert salesmanh_header=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE salesmanh_header SET salesmanh_create_user = '" . addslashes($server_salesmanh_create_user) . "', salesmanh_create_time = '" . addslashes($server_salesmanh_create_time) . "', salesmanh_edit_user = '" . addslashes($server_salesmanh_edit_user) . "', salesmanh_edit_time = '" . addslashes($server_salesmanh_edit_time) . "', salesmanh_ip = '" . addslashes($server_salesmanh_ip) . "', salesmanh_SysTrxId = '" . addslashes($server_salesmanh_SysTrxId) . "', salesmanh_Active = '" . addslashes($server_salesmanh_Active) . "', salesmanh_Approve = '" . addslashes($server_salesmanh_Approve) . "', salesmanh_SyncronizeDate = '" . addslashes($server_salesmanh_SyncronizeDate) . "', salesmanh_LastExportDate = '" . addslashes($server_salesmanh_LastExportDate) . "', salesmanh_TotalImported = '" . addslashes($server_salesmanh_TotalImported) . "', salesmanh_TotalExported = '" . addslashes($server_salesmanh_TotalExported) . "', salesmanh_LastUpdateStamp = '" . addslashes($server_salesmanh_LastUpdateStamp) . "', salesmanh_idRow = '" . addslashes($server_salesmanh_idRow) . "', salesmanh_TopContactCd = '" . addslashes($server_salesmanh_TopContactCd) . "', salesmanh_MiddleContactCd = '" . addslashes($server_salesmanh_MiddleContactCd) . "', salesmanh_BottomContactCd = '" . addslashes($server_salesmanh_BottomContactCd) . "', salesmanh_SalesmanContactCd = '" . addslashes($server_salesmanh_SalesmanContactCd) . "', salesmanh_SalesmanContactName = '" . addslashes($server_salesmanh_SalesmanContactName) . "', salesmanh_Description = '" . addslashes($server_salesmanh_Description) . "', salesmanh_PStatus = '" . addslashes($server_salesmanh_PStatus) . "', salesmanh_PortfolioCd = '" . addslashes($server_salesmanh_PortfolioCd) . "', salesmanh_Sub_PortfolioCd = '" . addslashes($server_salesmanh_Sub_PortfolioCd) . "', salesmanh_Deleteable = '" . addslashes($server_salesmanh_Deleteable) . "', salesmanh_Forensic = '" . addslashes($server_salesmanh_Forensic) . "', salesmanh_top_mstrID = '" . addslashes($server_salesmanh_top_mstrID) . "', salesmanh__dihapus = '" . addslashes($server_salesmanh__dihapus) . "', salesmanh__dihapus_time = '" . addslashes($server_salesmanh__dihapus_time) . "', salesmanh_Topcontact_mstrID = '" . addslashes($server_salesmanh_Topcontact_mstrID) . "', salesmanh_Middlecontact_mstrID = '" . addslashes($server_salesmanh_Middlecontact_mstrID) . "', salesmanh_Bottomcontact_mstrID = '" . addslashes($server_salesmanh_Bottomcontact_mstrID) . "', salesmanh_Salesmancontact_mstrID = '" . addslashes($server_salesmanh_Salesmancontact_mstrID) . "', salesmanh_formula1 = '" . addslashes($server_salesmanh_formula1) . "' WHERE salesmanh_headerID = " . $server_salesmanh_headerID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE salesmanh_header=>' . $err_msg;
echo "\n";
echo 'server_salesmanh_headerID=>' . $server_salesmanh_headerID;
echo "\n";
echo 'UPDATE salesmanh_header=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'paymentmaptoedc_mstr')
{
echo "\n";
echo 'Sebelum paymentmaptoedc_mstr=>' . $err_msg;
echo "\n";
list($server_paymentmaptoedc_mstrID, $server_paymentmaptoedc_create_user, $server_paymentmaptoedc_create_time, $server_paymentmaptoedc_edit_user, $server_paymentmaptoedc_edit_time, $server_paymentmaptoedc_ip, $server_paymentmaptoedc_SysTrxId, $server_paymentmaptoedc_Active, $server_paymentmaptoedc_Approve, $server_paymentmaptoedc_SyncronizeDate, $server_paymentmaptoedc_LastExportDate, $server_paymentmaptoedc_TotalImported, $server_paymentmaptoedc_TotalExported, $server_paymentmaptoedc_LastUpdateStamp, $server_paymentmaptoedc_idRow, $server_paymentmaptoedc_PaymentCd, $server_paymentmaptoedc_PaymentName, $server_paymentmaptoedc_Description, $server_paymentmaptoedc_ContactCd, $server_paymentmaptoedc_AccountCd, $server_paymentmaptoedc_IsCash, $server_paymentmaptoedc_PaymentTypeCd, $server_paymentmaptoedc_SF_Payment, $server_paymentmaptoedc_Deleteable, $server_paymentmaptoedc_Forensic, $server_paymentmaptoedc_PortfolioCd, $server_paymentmaptoedc_Sub_PortfolioCd, $server_paymentmaptoedc_paymenttype_typeID, $server_paymentmaptoedc__dihapus, $server_paymentmaptoedc__dihapus_time, $server_paymentmaptoedc_contact_mstrID) = explode('`', $line);
if ($server_paymentmaptoedc_Active == '') $server_paymentmaptoedc_Active = 'No';
if ($server_paymentmaptoedc_Approve == '') $server_paymentmaptoedc_Approve = 0;
if ($server_paymentmaptoedc_TotalImported == '') $server_paymentmaptoedc_TotalImported = 0;
if ($server_paymentmaptoedc_TotalExported == '') $server_paymentmaptoedc_TotalExported = 0;
if ($server_paymentmaptoedc_idRow == '') $server_paymentmaptoedc_idRow = 0;
if ($server_paymentmaptoedc_IsCash == '') $server_paymentmaptoedc_IsCash = 'No';
if ($server_paymentmaptoedc_Deleteable == '') $server_paymentmaptoedc_Deleteable = 'No';
if ($server_paymentmaptoedc_paymenttype_typeID == '') $server_paymentmaptoedc_paymenttype_typeID = 0;
if ($server_paymentmaptoedc__dihapus == '') $server_paymentmaptoedc__dihapus = 'No';
if ($server_paymentmaptoedc_contact_mstrID == '') $server_paymentmaptoedc_contact_mstrID = 0;
$paymentmaptoedc_mstrID = 0;
$koneksi_paymentmaptoedc_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT paymentmaptoedc_mstrID, paymentmaptoedc_LastUpdateStamp FROM paymentmaptoedc_mstr where paymentmaptoedc_mstrID = " . $server_paymentmaptoedc_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$paymentmaptoedc_mstrID = $row_koneksi['paymentmaptoedc_mstrID'];
$koneksi_paymentmaptoedc_LastUpdateStamp = $row_koneksi['paymentmaptoedc_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($paymentmaptoedc_mstrID == 0)
{
$sql_insert = "INSERT INTO paymentmaptoedc_mstr SET paymentmaptoedc_mstrID = '" . addslashes($server_paymentmaptoedc_mstrID) . "', paymentmaptoedc_create_user = '" . addslashes($server_paymentmaptoedc_create_user) . "', paymentmaptoedc_create_time = '" . addslashes($server_paymentmaptoedc_create_time) . "', paymentmaptoedc_edit_user = '" . addslashes($server_paymentmaptoedc_edit_user) . "', paymentmaptoedc_edit_time = '" . addslashes($server_paymentmaptoedc_edit_time) . "', paymentmaptoedc_ip = '" . addslashes($server_paymentmaptoedc_ip) . "', paymentmaptoedc_SysTrxId = '" . addslashes($server_paymentmaptoedc_SysTrxId) . "', paymentmaptoedc_Active = '" . addslashes($server_paymentmaptoedc_Active) . "', paymentmaptoedc_Approve = '" . addslashes($server_paymentmaptoedc_Approve) . "', paymentmaptoedc_SyncronizeDate = '" . addslashes($server_paymentmaptoedc_SyncronizeDate) . "', paymentmaptoedc_LastExportDate = '" . addslashes($server_paymentmaptoedc_LastExportDate) . "', paymentmaptoedc_TotalImported = '" . addslashes($server_paymentmaptoedc_TotalImported) . "', paymentmaptoedc_TotalExported = '" . addslashes($server_paymentmaptoedc_TotalExported) . "', paymentmaptoedc_LastUpdateStamp = '" . addslashes($server_paymentmaptoedc_LastUpdateStamp) . "', paymentmaptoedc_idRow = '" . addslashes($server_paymentmaptoedc_idRow) . "', paymentmaptoedc_PaymentCd = '" . addslashes($server_paymentmaptoedc_PaymentCd) . "', paymentmaptoedc_PaymentName = '" . addslashes($server_paymentmaptoedc_PaymentName) . "', paymentmaptoedc_Description = '" . addslashes($server_paymentmaptoedc_Description) . "', paymentmaptoedc_ContactCd = '" . addslashes($server_paymentmaptoedc_ContactCd) . "', paymentmaptoedc_AccountCd = '" . addslashes($server_paymentmaptoedc_AccountCd) . "', paymentmaptoedc_IsCash = '" . addslashes($server_paymentmaptoedc_IsCash) . "', paymentmaptoedc_PaymentTypeCd = '" . addslashes($server_paymentmaptoedc_PaymentTypeCd) . "', paymentmaptoedc_SF_Payment = '" . addslashes($server_paymentmaptoedc_SF_Payment) . "', paymentmaptoedc_Deleteable = '" . addslashes($server_paymentmaptoedc_Deleteable) . "', paymentmaptoedc_Forensic = '" . addslashes($server_paymentmaptoedc_Forensic) . "', paymentmaptoedc_PortfolioCd = '" . addslashes($server_paymentmaptoedc_PortfolioCd) . "', paymentmaptoedc_Sub_PortfolioCd = '" . addslashes($server_paymentmaptoedc_Sub_PortfolioCd) . "', paymentmaptoedc_paymenttype_typeID = '" . addslashes($server_paymentmaptoedc_paymenttype_typeID) . "', paymentmaptoedc__dihapus = '" . addslashes($server_paymentmaptoedc__dihapus) . "', paymentmaptoedc__dihapus_time = '" . addslashes($server_paymentmaptoedc__dihapus_time) . "', paymentmaptoedc_contact_mstrID = '" . addslashes($server_paymentmaptoedc_contact_mstrID) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert paymentmaptoedc_mstr=>' . $err_msg;
echo "\n";
echo 'server_paymentmaptoedc_mstrID=>' . $server_paymentmaptoedc_mstrID;
echo "\n";
echo 'Insert paymentmaptoedc_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE paymentmaptoedc_mstr SET paymentmaptoedc_create_user = '" . addslashes($server_paymentmaptoedc_create_user) . "', paymentmaptoedc_create_time = '" . addslashes($server_paymentmaptoedc_create_time) . "', paymentmaptoedc_edit_user = '" . addslashes($server_paymentmaptoedc_edit_user) . "', paymentmaptoedc_edit_time = '" . addslashes($server_paymentmaptoedc_edit_time) . "', paymentmaptoedc_ip = '" . addslashes($server_paymentmaptoedc_ip) . "', paymentmaptoedc_SysTrxId = '" . addslashes($server_paymentmaptoedc_SysTrxId) . "', paymentmaptoedc_Active = '" . addslashes($server_paymentmaptoedc_Active) . "', paymentmaptoedc_Approve = '" . addslashes($server_paymentmaptoedc_Approve) . "', paymentmaptoedc_SyncronizeDate = '" . addslashes($server_paymentmaptoedc_SyncronizeDate) . "', paymentmaptoedc_LastExportDate = '" . addslashes($server_paymentmaptoedc_LastExportDate) . "', paymentmaptoedc_TotalImported = '" . addslashes($server_paymentmaptoedc_TotalImported) . "', paymentmaptoedc_TotalExported = '" . addslashes($server_paymentmaptoedc_TotalExported) . "', paymentmaptoedc_LastUpdateStamp = '" . addslashes($server_paymentmaptoedc_LastUpdateStamp) . "', paymentmaptoedc_idRow = '" . addslashes($server_paymentmaptoedc_idRow) . "', paymentmaptoedc_PaymentCd = '" . addslashes($server_paymentmaptoedc_PaymentCd) . "', paymentmaptoedc_PaymentName = '" . addslashes($server_paymentmaptoedc_PaymentName) . "', paymentmaptoedc_Description = '" . addslashes($server_paymentmaptoedc_Description) . "', paymentmaptoedc_ContactCd = '" . addslashes($server_paymentmaptoedc_ContactCd) . "', paymentmaptoedc_AccountCd = '" . addslashes($server_paymentmaptoedc_AccountCd) . "', paymentmaptoedc_IsCash = '" . addslashes($server_paymentmaptoedc_IsCash) . "', paymentmaptoedc_PaymentTypeCd = '" . addslashes($server_paymentmaptoedc_PaymentTypeCd) . "', paymentmaptoedc_SF_Payment = '" . addslashes($server_paymentmaptoedc_SF_Payment) . "', paymentmaptoedc_Deleteable = '" . addslashes($server_paymentmaptoedc_Deleteable) . "', paymentmaptoedc_Forensic = '" . addslashes($server_paymentmaptoedc_Forensic) . "', paymentmaptoedc_PortfolioCd = '" . addslashes($server_paymentmaptoedc_PortfolioCd) . "', paymentmaptoedc_Sub_PortfolioCd = '" . addslashes($server_paymentmaptoedc_Sub_PortfolioCd) . "', paymentmaptoedc_paymenttype_typeID = '" . addslashes($server_paymentmaptoedc_paymenttype_typeID) . "', paymentmaptoedc__dihapus = '" . addslashes($server_paymentmaptoedc__dihapus) . "', paymentmaptoedc__dihapus_time = '" . addslashes($server_paymentmaptoedc__dihapus_time) . "', paymentmaptoedc_contact_mstrID = '" . addslashes($server_paymentmaptoedc_contact_mstrID) . "' WHERE paymentmaptoedc_mstrID = " . $server_paymentmaptoedc_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE paymentmaptoedc_mstr=>' . $err_msg;
echo "\n";
echo 'server_paymentmaptoedc_mstrID=>' . $server_paymentmaptoedc_mstrID;
echo "\n";
echo 'UPDATE paymentmaptoedc_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'pricesp_tbl')
{
echo "\n";
echo 'Sebelum pricesp_tbl=>' . $err_msg;
echo "\n";
list($server_pricesp_tblID, $server_pricesp_create_user, $server_pricesp_create_time, $server_pricesp_edit_user, $server_pricesp_edit_time, $server_pricesp_ip, $server_pricesp_SysTrxId, $server_pricesp_Active, $server_pricesp_Approve, $server_pricesp_SyncronizeDate, $server_pricesp_LastExportDate, $server_pricesp_TotalImported, $server_pricesp_TotalExported, $server_pricesp_SF_pricesp, $server_pricesp_Deleteable, $server_pricesp_Forensic, $server_pricesp_PortfolioCd, $server_pricesp_Sub_PortfolioCd, $server_pricesp__dihapus_time, $server_pricesp__dihapus, $server_pricesp_LastUpdateStamp, $server_pricesp_price) = explode('`', $line);
if ($server_pricesp_Active == '') $server_pricesp_Active = 'No';
if ($server_pricesp_Approve == '') $server_pricesp_Approve = 0;
if ($server_pricesp_TotalImported == '') $server_pricesp_TotalImported = 0;
if ($server_pricesp_TotalExported == '') $server_pricesp_TotalExported = 0;
if ($server_pricesp_Deleteable == '') $server_pricesp_Deleteable = 'No';
if ($server_pricesp__dihapus == '') $server_pricesp__dihapus = 'No';
if ($server_pricesp_price == '') $server_pricesp_price = 0;
$pricesp_tblID = 0;
$koneksi_pricesp_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT pricesp_tblID, pricesp_LastUpdateStamp FROM pricesp_tbl where pricesp_tblID = " . $server_pricesp_tblID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$pricesp_tblID = $row_koneksi['pricesp_tblID'];
$koneksi_pricesp_LastUpdateStamp = $row_koneksi['pricesp_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($pricesp_tblID == 0)
{
$sql_insert = "INSERT INTO pricesp_tbl SET pricesp_tblID = '" . addslashes($server_pricesp_tblID) . "', pricesp_create_user = '" . addslashes($server_pricesp_create_user) . "', pricesp_create_time = '" . addslashes($server_pricesp_create_time) . "', pricesp_edit_user = '" . addslashes($server_pricesp_edit_user) . "', pricesp_edit_time = '" . addslashes($server_pricesp_edit_time) . "', pricesp_ip = '" . addslashes($server_pricesp_ip) . "', pricesp_SysTrxId = '" . addslashes($server_pricesp_SysTrxId) . "', pricesp_Active = '" . addslashes($server_pricesp_Active) . "', pricesp_Approve = '" . addslashes($server_pricesp_Approve) . "', pricesp_SyncronizeDate = '" . addslashes($server_pricesp_SyncronizeDate) . "', pricesp_LastExportDate = '" . addslashes($server_pricesp_LastExportDate) . "', pricesp_TotalImported = '" . addslashes($server_pricesp_TotalImported) . "', pricesp_TotalExported = '" . addslashes($server_pricesp_TotalExported) . "', pricesp_SF_pricesp = '" . addslashes($server_pricesp_SF_pricesp) . "', pricesp_Deleteable = '" . addslashes($server_pricesp_Deleteable) . "', pricesp_Forensic = '" . addslashes($server_pricesp_Forensic) . "', pricesp_PortfolioCd = '" . addslashes($server_pricesp_PortfolioCd) . "', pricesp_Sub_PortfolioCd = '" . addslashes($server_pricesp_Sub_PortfolioCd) . "', pricesp__dihapus_time = '" . addslashes($server_pricesp__dihapus_time) . "', pricesp__dihapus = '" . addslashes($server_pricesp__dihapus) . "', pricesp_LastUpdateStamp = '" . addslashes($server_pricesp_LastUpdateStamp) . "', pricesp_price = '" . addslashes($server_pricesp_price) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert pricesp_tbl=>' . $err_msg;
echo "\n";
echo 'server_pricesp_tblID=>' . $server_pricesp_tblID;
echo "\n";
echo 'Insert pricesp_tbl=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE pricesp_tbl SET pricesp_create_user = '" . addslashes($server_pricesp_create_user) . "', pricesp_create_time = '" . addslashes($server_pricesp_create_time) . "', pricesp_edit_user = '" . addslashes($server_pricesp_edit_user) . "', pricesp_edit_time = '" . addslashes($server_pricesp_edit_time) . "', pricesp_ip = '" . addslashes($server_pricesp_ip) . "', pricesp_SysTrxId = '" . addslashes($server_pricesp_SysTrxId) . "', pricesp_Active = '" . addslashes($server_pricesp_Active) . "', pricesp_Approve = '" . addslashes($server_pricesp_Approve) . "', pricesp_SyncronizeDate = '" . addslashes($server_pricesp_SyncronizeDate) . "', pricesp_LastExportDate = '" . addslashes($server_pricesp_LastExportDate) . "', pricesp_TotalImported = '" . addslashes($server_pricesp_TotalImported) . "', pricesp_TotalExported = '" . addslashes($server_pricesp_TotalExported) . "', pricesp_SF_pricesp = '" . addslashes($server_pricesp_SF_pricesp) . "', pricesp_Deleteable = '" . addslashes($server_pricesp_Deleteable) . "', pricesp_Forensic = '" . addslashes($server_pricesp_Forensic) . "', pricesp_PortfolioCd = '" . addslashes($server_pricesp_PortfolioCd) . "', pricesp_Sub_PortfolioCd = '" . addslashes($server_pricesp_Sub_PortfolioCd) . "', pricesp__dihapus_time = '" . addslashes($server_pricesp__dihapus_time) . "', pricesp__dihapus = '" . addslashes($server_pricesp__dihapus) . "', pricesp_LastUpdateStamp = '" . addslashes($server_pricesp_LastUpdateStamp) . "', pricesp_price = '" . addslashes($server_pricesp_price) . "' WHERE pricesp_tblID = " . $server_pricesp_tblID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE pricesp_tbl=>' . $err_msg;
echo "\n";
echo 'server_pricesp_tblID=>' . $server_pricesp_tblID;
echo "\n";
echo 'UPDATE pricesp_tbl=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'group1_mstr')
{
echo "\n";
echo 'Sebelum group1_mstr=>' . $err_msg;
echo "\n";
list($server_group1_mstrID, $server_group1_create_user, $server_group1_create_time, $server_group1_edit_user, $server_group1_edit_time, $server_group1_ip, $server_group1_SysTrxId, $server_group1_Active, $server_group1_Approve, $server_group1_SyncronizeDate, $server_group1_LastExportDate, $server_group1_TotalImported, $server_group1_TotalExported, $server_group1_LastUpdateStamp, $server_group1_idRow, $server_group1_Group1Cd, $server_group1_Group1Name, $server_group1_Description, $server_group1_SF_Group1, $server_group1_Deleteable, $server_group1_Forensic, $server_group1_PortfolioCd, $server_group1_Sub_PortfolioCd, $server_group1_measurement_oumID, $server_group1__dihapus, $server_group1__dihapus_time) = explode('`', $line);
if ($server_group1_Active == '') $server_group1_Active = 'No';
if ($server_group1_Approve == '') $server_group1_Approve = 0;
if ($server_group1_TotalImported == '') $server_group1_TotalImported = 0;
if ($server_group1_TotalExported == '') $server_group1_TotalExported = 0;
if ($server_group1_idRow == '') $server_group1_idRow = 0;
if ($server_group1_Deleteable == '') $server_group1_Deleteable = 'No';
if ($server_group1_measurement_oumID == '') $server_group1_measurement_oumID = 0;
if ($server_group1__dihapus == '') $server_group1__dihapus = 'No';
$group1_mstrID = 0;
$koneksi_group1_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT group1_mstrID, group1_LastUpdateStamp FROM group1_mstr where group1_mstrID = " . $server_group1_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$group1_mstrID = $row_koneksi['group1_mstrID'];
$koneksi_group1_LastUpdateStamp = $row_koneksi['group1_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($group1_mstrID == 0)
{
$sql_insert = "INSERT INTO group1_mstr SET group1_mstrID = '" . addslashes($server_group1_mstrID) . "', group1_create_user = '" . addslashes($server_group1_create_user) . "', group1_create_time = '" . addslashes($server_group1_create_time) . "', group1_edit_user = '" . addslashes($server_group1_edit_user) . "', group1_edit_time = '" . addslashes($server_group1_edit_time) . "', group1_ip = '" . addslashes($server_group1_ip) . "', group1_SysTrxId = '" . addslashes($server_group1_SysTrxId) . "', group1_Active = '" . addslashes($server_group1_Active) . "', group1_Approve = '" . addslashes($server_group1_Approve) . "', group1_SyncronizeDate = '" . addslashes($server_group1_SyncronizeDate) . "', group1_LastExportDate = '" . addslashes($server_group1_LastExportDate) . "', group1_TotalImported = '" . addslashes($server_group1_TotalImported) . "', group1_TotalExported = '" . addslashes($server_group1_TotalExported) . "', group1_LastUpdateStamp = '" . addslashes($server_group1_LastUpdateStamp) . "', group1_idRow = '" . addslashes($server_group1_idRow) . "', group1_Group1Cd = '" . addslashes($server_group1_Group1Cd) . "', group1_Group1Name = '" . addslashes($server_group1_Group1Name) . "', group1_Description = '" . addslashes($server_group1_Description) . "', group1_SF_Group1 = '" . addslashes($server_group1_SF_Group1) . "', group1_Deleteable = '" . addslashes($server_group1_Deleteable) . "', group1_Forensic = '" . addslashes($server_group1_Forensic) . "', group1_PortfolioCd = '" . addslashes($server_group1_PortfolioCd) . "', group1_Sub_PortfolioCd = '" . addslashes($server_group1_Sub_PortfolioCd) . "', group1_measurement_oumID = '" . addslashes($server_group1_measurement_oumID) . "', group1__dihapus = '" . addslashes($server_group1__dihapus) . "', group1__dihapus_time = '" . addslashes($server_group1__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert group1_mstr=>' . $err_msg;
echo "\n";
echo 'server_group1_mstrID=>' . $server_group1_mstrID;
echo "\n";
echo 'Insert group1_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE group1_mstr SET group1_create_user = '" . addslashes($server_group1_create_user) . "', group1_create_time = '" . addslashes($server_group1_create_time) . "', group1_edit_user = '" . addslashes($server_group1_edit_user) . "', group1_edit_time = '" . addslashes($server_group1_edit_time) . "', group1_ip = '" . addslashes($server_group1_ip) . "', group1_SysTrxId = '" . addslashes($server_group1_SysTrxId) . "', group1_Active = '" . addslashes($server_group1_Active) . "', group1_Approve = '" . addslashes($server_group1_Approve) . "', group1_SyncronizeDate = '" . addslashes($server_group1_SyncronizeDate) . "', group1_LastExportDate = '" . addslashes($server_group1_LastExportDate) . "', group1_TotalImported = '" . addslashes($server_group1_TotalImported) . "', group1_TotalExported = '" . addslashes($server_group1_TotalExported) . "', group1_LastUpdateStamp = '" . addslashes($server_group1_LastUpdateStamp) . "', group1_idRow = '" . addslashes($server_group1_idRow) . "', group1_Group1Cd = '" . addslashes($server_group1_Group1Cd) . "', group1_Group1Name = '" . addslashes($server_group1_Group1Name) . "', group1_Description = '" . addslashes($server_group1_Description) . "', group1_SF_Group1 = '" . addslashes($server_group1_SF_Group1) . "', group1_Deleteable = '" . addslashes($server_group1_Deleteable) . "', group1_Forensic = '" . addslashes($server_group1_Forensic) . "', group1_PortfolioCd = '" . addslashes($server_group1_PortfolioCd) . "', group1_Sub_PortfolioCd = '" . addslashes($server_group1_Sub_PortfolioCd) . "', group1_measurement_oumID = '" . addslashes($server_group1_measurement_oumID) . "', group1__dihapus = '" . addslashes($server_group1__dihapus) . "', group1__dihapus_time = '" . addslashes($server_group1__dihapus_time) . "' WHERE group1_mstrID = " . $server_group1_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE group1_mstr=>' . $err_msg;
echo "\n";
echo 'server_group1_mstrID=>' . $server_group1_mstrID;
echo "\n";
echo 'UPDATE group1_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'bankmap_det')
{
echo "\n";
echo 'Sebelum bankmap_det=>' . $err_msg;
echo "\n";
list($server_bankmap_detID, $server_bankmap_create_user, $server_bankmap_create_time, $server_bankmap_edit_user, $server_bankmap_edit_time, $server_bankmap_ip, $server_bankmap_SysTrxId, $server_bankmap_Active, $server_bankmap_Approve, $server_bankmap_SyncronizeDate, $server_bankmap_LastExportDate, $server_bankmap_TotalImported, $server_bankmap_TotalExported, $server_bankmap_SF_bankmap, $server_bankmap_Deleteable, $server_bankmap_Forensic, $server_bankmap_PortfolioCd, $server_bankmap_Sub_PortfolioCd, $server_bankmap__dihapus_time, $server_bankmap__dihapus, $server_bankmap_LastUpdateStamp, $server_bankmap_kode, $server_bankmap_loc_mstrID, $server_bankmap_LocationCd, $server_bankmap_LocationName, $server_bankmap_LocationInitial, $server_bankmap_edc_mstrID, $server_bankmap_EDCCd, $server_bankmap_EDCName, $server_bankmap_jenis, $server_bankmap_FromDate, $server_bankmap_ToDate) = explode('`', $line);
if ($server_bankmap_Active == '') $server_bankmap_Active = 'No';
if ($server_bankmap_Approve == '') $server_bankmap_Approve = 0;
if ($server_bankmap_TotalImported == '') $server_bankmap_TotalImported = 0;
if ($server_bankmap_TotalExported == '') $server_bankmap_TotalExported = 0;
if ($server_bankmap_Deleteable == '') $server_bankmap_Deleteable = 'No';
if ($server_bankmap__dihapus == '') $server_bankmap__dihapus = 'No';
if ($server_bankmap_loc_mstrID == '') $server_bankmap_loc_mstrID = 0;
if ($server_bankmap_edc_mstrID == '') $server_bankmap_edc_mstrID = 0;
if ($server_bankmap_FromDate == '') $server_bankmap_FromDate = '1900-01-01';
if ($server_bankmap_ToDate == '') $server_bankmap_ToDate = '1900-01-01';
$bankmap_detID = 0;
$koneksi_bankmap_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT bankmap_detID, bankmap_LastUpdateStamp FROM bankmap_det where bankmap_detID = " . $server_bankmap_detID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$bankmap_detID = $row_koneksi['bankmap_detID'];
$koneksi_bankmap_LastUpdateStamp = $row_koneksi['bankmap_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($bankmap_detID == 0)
{
$sql_insert = "INSERT INTO bankmap_det SET bankmap_detID = '" . addslashes($server_bankmap_detID) . "', bankmap_create_user = '" . addslashes($server_bankmap_create_user) . "', bankmap_create_time = '" . addslashes($server_bankmap_create_time) . "', bankmap_edit_user = '" . addslashes($server_bankmap_edit_user) . "', bankmap_edit_time = '" . addslashes($server_bankmap_edit_time) . "', bankmap_ip = '" . addslashes($server_bankmap_ip) . "', bankmap_SysTrxId = '" . addslashes($server_bankmap_SysTrxId) . "', bankmap_Active = '" . addslashes($server_bankmap_Active) . "', bankmap_Approve = '" . addslashes($server_bankmap_Approve) . "', bankmap_SyncronizeDate = '" . addslashes($server_bankmap_SyncronizeDate) . "', bankmap_LastExportDate = '" . addslashes($server_bankmap_LastExportDate) . "', bankmap_TotalImported = '" . addslashes($server_bankmap_TotalImported) . "', bankmap_TotalExported = '" . addslashes($server_bankmap_TotalExported) . "', bankmap_SF_bankmap = '" . addslashes($server_bankmap_SF_bankmap) . "', bankmap_Deleteable = '" . addslashes($server_bankmap_Deleteable) . "', bankmap_Forensic = '" . addslashes($server_bankmap_Forensic) . "', bankmap_PortfolioCd = '" . addslashes($server_bankmap_PortfolioCd) . "', bankmap_Sub_PortfolioCd = '" . addslashes($server_bankmap_Sub_PortfolioCd) . "', bankmap__dihapus_time = '" . addslashes($server_bankmap__dihapus_time) . "', bankmap__dihapus = '" . addslashes($server_bankmap__dihapus) . "', bankmap_LastUpdateStamp = '" . addslashes($server_bankmap_LastUpdateStamp) . "', bankmap_kode = '" . addslashes($server_bankmap_kode) . "', bankmap_loc_mstrID = '" . addslashes($server_bankmap_loc_mstrID) . "', bankmap_LocationCd = '" . addslashes($server_bankmap_LocationCd) . "', bankmap_LocationName = '" . addslashes($server_bankmap_LocationName) . "', bankmap_LocationInitial = '" . addslashes($server_bankmap_LocationInitial) . "', bankmap_edc_mstrID = '" . addslashes($server_bankmap_edc_mstrID) . "', bankmap_EDCCd = '" . addslashes($server_bankmap_EDCCd) . "', bankmap_EDCName = '" . addslashes($server_bankmap_EDCName) . "', bankmap_jenis = '" . addslashes($server_bankmap_jenis) . "', bankmap_FromDate = '" . addslashes($server_bankmap_FromDate) . "', bankmap_ToDate = '" . addslashes($server_bankmap_ToDate) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert bankmap_det=>' . $err_msg;
echo "\n";
echo 'server_bankmap_detID=>' . $server_bankmap_detID;
echo "\n";
echo 'Insert bankmap_det=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE bankmap_det SET bankmap_create_user = '" . addslashes($server_bankmap_create_user) . "', bankmap_create_time = '" . addslashes($server_bankmap_create_time) . "', bankmap_edit_user = '" . addslashes($server_bankmap_edit_user) . "', bankmap_edit_time = '" . addslashes($server_bankmap_edit_time) . "', bankmap_ip = '" . addslashes($server_bankmap_ip) . "', bankmap_SysTrxId = '" . addslashes($server_bankmap_SysTrxId) . "', bankmap_Active = '" . addslashes($server_bankmap_Active) . "', bankmap_Approve = '" . addslashes($server_bankmap_Approve) . "', bankmap_SyncronizeDate = '" . addslashes($server_bankmap_SyncronizeDate) . "', bankmap_LastExportDate = '" . addslashes($server_bankmap_LastExportDate) . "', bankmap_TotalImported = '" . addslashes($server_bankmap_TotalImported) . "', bankmap_TotalExported = '" . addslashes($server_bankmap_TotalExported) . "', bankmap_SF_bankmap = '" . addslashes($server_bankmap_SF_bankmap) . "', bankmap_Deleteable = '" . addslashes($server_bankmap_Deleteable) . "', bankmap_Forensic = '" . addslashes($server_bankmap_Forensic) . "', bankmap_PortfolioCd = '" . addslashes($server_bankmap_PortfolioCd) . "', bankmap_Sub_PortfolioCd = '" . addslashes($server_bankmap_Sub_PortfolioCd) . "', bankmap__dihapus_time = '" . addslashes($server_bankmap__dihapus_time) . "', bankmap__dihapus = '" . addslashes($server_bankmap__dihapus) . "', bankmap_LastUpdateStamp = '" . addslashes($server_bankmap_LastUpdateStamp) . "', bankmap_kode = '" . addslashes($server_bankmap_kode) . "', bankmap_loc_mstrID = '" . addslashes($server_bankmap_loc_mstrID) . "', bankmap_LocationCd = '" . addslashes($server_bankmap_LocationCd) . "', bankmap_LocationName = '" . addslashes($server_bankmap_LocationName) . "', bankmap_LocationInitial = '" . addslashes($server_bankmap_LocationInitial) . "', bankmap_edc_mstrID = '" . addslashes($server_bankmap_edc_mstrID) . "', bankmap_EDCCd = '" . addslashes($server_bankmap_EDCCd) . "', bankmap_EDCName = '" . addslashes($server_bankmap_EDCName) . "', bankmap_jenis = '" . addslashes($server_bankmap_jenis) . "', bankmap_FromDate = '" . addslashes($server_bankmap_FromDate) . "', bankmap_ToDate = '" . addslashes($server_bankmap_ToDate) . "' WHERE bankmap_detID = " . $server_bankmap_detID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE bankmap_det=>' . $err_msg;
echo "\n";
echo 'server_bankmap_detID=>' . $server_bankmap_detID;
echo "\n";
echo 'UPDATE bankmap_det=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'transferinh_header')
{
echo "\n";
echo 'Sebelum transferinh_header=>' . $err_msg;
echo "\n";
list($server_transferinh_headerID, $server_transferinh_create_user, $server_transferinh_create_time, $server_transferinh_edit_user, $server_transferinh_edit_time, $server_transferinh_ip, $server_transferinh_SysTrxId, $server_transferinh_Active, $server_transferinh_Approve, $server_transferinh_SyncronizeDate, $server_transferinh_LastExportDate, $server_transferinh_TotalImported, $server_transferinh_TotalExported, $server_transferinh_LastUpdateStamp, $server_transferinh_idRow, $server_transferinh_TransferInNo, $server_transferinh_TransferInDate, $server_transferinh_ReferenceNo, $server_transferinh_LocationCd, $server_transferinh_BrandCd, $server_transferinh_Description, $server_transferinh_PStatus, $server_transferinh_PostingDate, $server_transferinh_PostingBy, $server_transferinh_SF_TransferIn, $server_transferinh_Deleteable, $server_transferinh_Forensic, $server_transferinh_PortfolioCd, $server_transferinh_Sub_PortfolioCd, $server_transferinh_loc_mstrID, $server_transferinh_brand_mstrID, $server_transferinh_TransferTypeCd, $server_transferinh_transfertype_tabID, $server_transferinh__dihapus, $server_transferinh__dihapus_time, $server_transferinh_periode) = explode('`', $line);
if ($server_transferinh_Active == '') $server_transferinh_Active = 'No';
if ($server_transferinh_Approve == '') $server_transferinh_Approve = 0;
if ($server_transferinh_TotalImported == '') $server_transferinh_TotalImported = 0;
if ($server_transferinh_TotalExported == '') $server_transferinh_TotalExported = 0;
if ($server_transferinh_idRow == '') $server_transferinh_idRow = 0;
if ($server_transferinh_TransferInDate == '') $server_transferinh_TransferInDate = '1900-01-01';
if ($server_transferinh_PostingDate == '') $server_transferinh_PostingDate = '1900-01-01';
if ($server_transferinh_Deleteable == '') $server_transferinh_Deleteable = 'No';
if ($server_transferinh_loc_mstrID == '') $server_transferinh_loc_mstrID = 0;
if ($server_transferinh_brand_mstrID == '') $server_transferinh_brand_mstrID = 0;
if ($server_transferinh_transfertype_tabID == '') $server_transferinh_transfertype_tabID = 0;
if ($server_transferinh__dihapus == '') $server_transferinh__dihapus = 'No';
$transferinh_headerID = 0;
$koneksi_transferinh_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT transferinh_headerID, transferinh_LastUpdateStamp FROM transferinh_header where transferinh_headerID = " . $server_transferinh_headerID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$transferinh_headerID = $row_koneksi['transferinh_headerID'];
$koneksi_transferinh_LastUpdateStamp = $row_koneksi['transferinh_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($transferinh_headerID == 0)
{
$sql_insert = "INSERT INTO transferinh_header SET transferinh_headerID = '" . addslashes($server_transferinh_headerID) . "', transferinh_create_user = '" . addslashes($server_transferinh_create_user) . "', transferinh_create_time = '" . addslashes($server_transferinh_create_time) . "', transferinh_edit_user = '" . addslashes($server_transferinh_edit_user) . "', transferinh_edit_time = '" . addslashes($server_transferinh_edit_time) . "', transferinh_ip = '" . addslashes($server_transferinh_ip) . "', transferinh_SysTrxId = '" . addslashes($server_transferinh_SysTrxId) . "', transferinh_Active = '" . addslashes($server_transferinh_Active) . "', transferinh_Approve = '" . addslashes($server_transferinh_Approve) . "', transferinh_SyncronizeDate = '" . addslashes($server_transferinh_SyncronizeDate) . "', transferinh_LastExportDate = '" . addslashes($server_transferinh_LastExportDate) . "', transferinh_TotalImported = '" . addslashes($server_transferinh_TotalImported) . "', transferinh_TotalExported = '" . addslashes($server_transferinh_TotalExported) . "', transferinh_LastUpdateStamp = '" . addslashes($server_transferinh_LastUpdateStamp) . "', transferinh_idRow = '" . addslashes($server_transferinh_idRow) . "', transferinh_TransferInNo = '" . addslashes($server_transferinh_TransferInNo) . "', transferinh_TransferInDate = '" . addslashes($server_transferinh_TransferInDate) . "', transferinh_ReferenceNo = '" . addslashes($server_transferinh_ReferenceNo) . "', transferinh_LocationCd = '" . addslashes($server_transferinh_LocationCd) . "', transferinh_BrandCd = '" . addslashes($server_transferinh_BrandCd) . "', transferinh_Description = '" . addslashes($server_transferinh_Description) . "', transferinh_PStatus = '" . addslashes($server_transferinh_PStatus) . "', transferinh_PostingDate = '" . addslashes($server_transferinh_PostingDate) . "', transferinh_PostingBy = '" . addslashes($server_transferinh_PostingBy) . "', transferinh_SF_TransferIn = '" . addslashes($server_transferinh_SF_TransferIn) . "', transferinh_Deleteable = '" . addslashes($server_transferinh_Deleteable) . "', transferinh_Forensic = '" . addslashes($server_transferinh_Forensic) . "', transferinh_PortfolioCd = '" . addslashes($server_transferinh_PortfolioCd) . "', transferinh_Sub_PortfolioCd = '" . addslashes($server_transferinh_Sub_PortfolioCd) . "', transferinh_loc_mstrID = '" . addslashes($server_transferinh_loc_mstrID) . "', transferinh_brand_mstrID = '" . addslashes($server_transferinh_brand_mstrID) . "', transferinh_TransferTypeCd = '" . addslashes($server_transferinh_TransferTypeCd) . "', transferinh_transfertype_tabID = '" . addslashes($server_transferinh_transfertype_tabID) . "', transferinh__dihapus = '" . addslashes($server_transferinh__dihapus) . "', transferinh__dihapus_time = '" . addslashes($server_transferinh__dihapus_time) . "', transferinh_periode = '" . addslashes($server_transferinh_periode) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert transferinh_header=>' . $err_msg;
echo "\n";
echo 'server_transferinh_headerID=>' . $server_transferinh_headerID;
echo "\n";
echo 'Insert transferinh_header=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE transferinh_header SET transferinh_create_user = '" . addslashes($server_transferinh_create_user) . "', transferinh_create_time = '" . addslashes($server_transferinh_create_time) . "', transferinh_edit_user = '" . addslashes($server_transferinh_edit_user) . "', transferinh_edit_time = '" . addslashes($server_transferinh_edit_time) . "', transferinh_ip = '" . addslashes($server_transferinh_ip) . "', transferinh_SysTrxId = '" . addslashes($server_transferinh_SysTrxId) . "', transferinh_Active = '" . addslashes($server_transferinh_Active) . "', transferinh_Approve = '" . addslashes($server_transferinh_Approve) . "', transferinh_SyncronizeDate = '" . addslashes($server_transferinh_SyncronizeDate) . "', transferinh_LastExportDate = '" . addslashes($server_transferinh_LastExportDate) . "', transferinh_TotalImported = '" . addslashes($server_transferinh_TotalImported) . "', transferinh_TotalExported = '" . addslashes($server_transferinh_TotalExported) . "', transferinh_LastUpdateStamp = '" . addslashes($server_transferinh_LastUpdateStamp) . "', transferinh_idRow = '" . addslashes($server_transferinh_idRow) . "', transferinh_TransferInNo = '" . addslashes($server_transferinh_TransferInNo) . "', transferinh_TransferInDate = '" . addslashes($server_transferinh_TransferInDate) . "', transferinh_ReferenceNo = '" . addslashes($server_transferinh_ReferenceNo) . "', transferinh_LocationCd = '" . addslashes($server_transferinh_LocationCd) . "', transferinh_BrandCd = '" . addslashes($server_transferinh_BrandCd) . "', transferinh_Description = '" . addslashes($server_transferinh_Description) . "', transferinh_PStatus = '" . addslashes($server_transferinh_PStatus) . "', transferinh_PostingDate = '" . addslashes($server_transferinh_PostingDate) . "', transferinh_PostingBy = '" . addslashes($server_transferinh_PostingBy) . "', transferinh_SF_TransferIn = '" . addslashes($server_transferinh_SF_TransferIn) . "', transferinh_Deleteable = '" . addslashes($server_transferinh_Deleteable) . "', transferinh_Forensic = '" . addslashes($server_transferinh_Forensic) . "', transferinh_PortfolioCd = '" . addslashes($server_transferinh_PortfolioCd) . "', transferinh_Sub_PortfolioCd = '" . addslashes($server_transferinh_Sub_PortfolioCd) . "', transferinh_loc_mstrID = '" . addslashes($server_transferinh_loc_mstrID) . "', transferinh_brand_mstrID = '" . addslashes($server_transferinh_brand_mstrID) . "', transferinh_TransferTypeCd = '" . addslashes($server_transferinh_TransferTypeCd) . "', transferinh_transfertype_tabID = '" . addslashes($server_transferinh_transfertype_tabID) . "', transferinh__dihapus = '" . addslashes($server_transferinh__dihapus) . "', transferinh__dihapus_time = '" . addslashes($server_transferinh__dihapus_time) . "', transferinh_periode = '" . addslashes($server_transferinh_periode) . "' WHERE transferinh_headerID = " . $server_transferinh_headerID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE transferinh_header=>' . $err_msg;
echo "\n";
echo 'server_transferinh_headerID=>' . $server_transferinh_headerID;
echo "\n";
echo 'UPDATE transferinh_header=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'transferind_detail')
{
echo "\n";
echo 'Sebelum transferind_detail=>' . $err_msg;
echo "\n";
list($server_transferind_detailID, $server_transferind_create_user, $server_transferind_create_time, $server_transferind_edit_user, $server_transferind_edit_time, $server_transferind_ip, $server_transferind_SysTrxId, $server_transferind_Active, $server_transferind_Approve, $server_transferind_SyncronizeDate, $server_transferind_LastExportDate, $server_transferind_TotalImported, $server_transferind_TotalExported, $server_transferind_LastUpdateStamp, $server_transferind_idRow, $server_transferind_ReceiptNo, $server_transferind_SequenceNo, $server_transferind_TransferInNo, $server_transferind_TransferInSequenceNo, $server_transferind_PickingListNo, $server_transferind_PLSequenceNo, $server_transferind_ItemCd, $server_transferind_ItemSKUCd, $server_transferind_Quantity, $server_transferind_UOMCd, $server_transferind_Description, $server_transferind_PStatus, $server_transferind_SF_ReceiptItem, $server_transferind_Deleteable, $server_transferind_Forensic, $server_transferind_PortfolioCd, $server_transferind_Sub_PortfolioCd, $server_transferind_transferinh_headerID, $server_transferind_measurement_uomID, $server_transferind_productitem_mstrID, $server_transferind_itemsku_mstrID, $server_transferind_picklisth_headerID, $server_transferind_picklistd_detailID, $server_transferind_transferouth_headerID, $server_transferind_transferoutd_detailID, $server_transferind__dihapus, $server_transferind__dihapus_time, $server_transferind_TransferOutNo, $server_transferind_RptDiff, $server_transferind_Barcode, $server_transferind_RptPrice, $server_transferind_RptTotal, $server_transferind_TransferInDate, $server_transferind_loc_mstrID, $server_transferind_alterasig_groupID) = explode('`', $line);
if ($server_transferind_Active == '') $server_transferind_Active = 'No';
if ($server_transferind_Approve == '') $server_transferind_Approve = 0;
if ($server_transferind_TotalImported == '') $server_transferind_TotalImported = 0;
if ($server_transferind_TotalExported == '') $server_transferind_TotalExported = 0;
if ($server_transferind_idRow == '') $server_transferind_idRow = 0;
if ($server_transferind_SequenceNo == '') $server_transferind_SequenceNo = 0;
if ($server_transferind_TransferInSequenceNo == '') $server_transferind_TransferInSequenceNo = 0;
if ($server_transferind_PLSequenceNo == '') $server_transferind_PLSequenceNo = 0;
if ($server_transferind_Quantity == '') $server_transferind_Quantity = 0;
if ($server_transferind_Deleteable == '') $server_transferind_Deleteable = 'No';
if ($server_transferind_transferinh_headerID == '') $server_transferind_transferinh_headerID = 0;
if ($server_transferind_measurement_uomID == '') $server_transferind_measurement_uomID = 0;
if ($server_transferind_productitem_mstrID == '') $server_transferind_productitem_mstrID = 0;
if ($server_transferind_itemsku_mstrID == '') $server_transferind_itemsku_mstrID = 0;
if ($server_transferind_picklisth_headerID == '') $server_transferind_picklisth_headerID = 0;
if ($server_transferind_picklistd_detailID == '') $server_transferind_picklistd_detailID = 0;
if ($server_transferind_transferouth_headerID == '') $server_transferind_transferouth_headerID = 0;
if ($server_transferind_transferoutd_detailID == '') $server_transferind_transferoutd_detailID = 0;
if ($server_transferind__dihapus == '') $server_transferind__dihapus = 'No';
if ($server_transferind_RptDiff == '') $server_transferind_RptDiff = 0;
if ($server_transferind_RptPrice == '') $server_transferind_RptPrice = 0;
if ($server_transferind_RptTotal == '') $server_transferind_RptTotal = 0;
if ($server_transferind_TransferInDate == '') $server_transferind_TransferInDate = '1900-01-01';
if ($server_transferind_loc_mstrID == '') $server_transferind_loc_mstrID = 0;
if ($server_transferind_alterasig_groupID == '') $server_transferind_alterasig_groupID = 0;
$transferind_detailID = 0;
$koneksi_transferind_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT transferind_detailID, transferind_LastUpdateStamp FROM transferind_detail where transferind_detailID = " . $server_transferind_detailID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$transferind_detailID = $row_koneksi['transferind_detailID'];
$koneksi_transferind_LastUpdateStamp = $row_koneksi['transferind_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($transferind_detailID == 0)
{
$sql_insert = "INSERT INTO transferind_detail SET transferind_detailID = '" . addslashes($server_transferind_detailID) . "', transferind_create_user = '" . addslashes($server_transferind_create_user) . "', transferind_create_time = '" . addslashes($server_transferind_create_time) . "', transferind_edit_user = '" . addslashes($server_transferind_edit_user) . "', transferind_edit_time = '" . addslashes($server_transferind_edit_time) . "', transferind_ip = '" . addslashes($server_transferind_ip) . "', transferind_SysTrxId = '" . addslashes($server_transferind_SysTrxId) . "', transferind_Active = '" . addslashes($server_transferind_Active) . "', transferind_Approve = '" . addslashes($server_transferind_Approve) . "', transferind_SyncronizeDate = '" . addslashes($server_transferind_SyncronizeDate) . "', transferind_LastExportDate = '" . addslashes($server_transferind_LastExportDate) . "', transferind_TotalImported = '" . addslashes($server_transferind_TotalImported) . "', transferind_TotalExported = '" . addslashes($server_transferind_TotalExported) . "', transferind_LastUpdateStamp = '" . addslashes($server_transferind_LastUpdateStamp) . "', transferind_idRow = '" . addslashes($server_transferind_idRow) . "', transferind_ReceiptNo = '" . addslashes($server_transferind_ReceiptNo) . "', transferind_SequenceNo = '" . addslashes($server_transferind_SequenceNo) . "', transferind_TransferInNo = '" . addslashes($server_transferind_TransferInNo) . "', transferind_TransferInSequenceNo = '" . addslashes($server_transferind_TransferInSequenceNo) . "', transferind_PickingListNo = '" . addslashes($server_transferind_PickingListNo) . "', transferind_PLSequenceNo = '" . addslashes($server_transferind_PLSequenceNo) . "', transferind_ItemCd = '" . addslashes($server_transferind_ItemCd) . "', transferind_ItemSKUCd = '" . addslashes($server_transferind_ItemSKUCd) . "', transferind_Quantity = '" . addslashes($server_transferind_Quantity) . "', transferind_UOMCd = '" . addslashes($server_transferind_UOMCd) . "', transferind_Description = '" . addslashes($server_transferind_Description) . "', transferind_PStatus = '" . addslashes($server_transferind_PStatus) . "', transferind_SF_ReceiptItem = '" . addslashes($server_transferind_SF_ReceiptItem) . "', transferind_Deleteable = '" . addslashes($server_transferind_Deleteable) . "', transferind_Forensic = '" . addslashes($server_transferind_Forensic) . "', transferind_PortfolioCd = '" . addslashes($server_transferind_PortfolioCd) . "', transferind_Sub_PortfolioCd = '" . addslashes($server_transferind_Sub_PortfolioCd) . "', transferind_transferinh_headerID = '" . addslashes($server_transferind_transferinh_headerID) . "', transferind_measurement_uomID = '" . addslashes($server_transferind_measurement_uomID) . "', transferind_productitem_mstrID = '" . addslashes($server_transferind_productitem_mstrID) . "', transferind_itemsku_mstrID = '" . addslashes($server_transferind_itemsku_mstrID) . "', transferind_picklisth_headerID = '" . addslashes($server_transferind_picklisth_headerID) . "', transferind_picklistd_detailID = '" . addslashes($server_transferind_picklistd_detailID) . "', transferind_transferouth_headerID = '" . addslashes($server_transferind_transferouth_headerID) . "', transferind_transferoutd_detailID = '" . addslashes($server_transferind_transferoutd_detailID) . "', transferind__dihapus = '" . addslashes($server_transferind__dihapus) . "', transferind__dihapus_time = '" . addslashes($server_transferind__dihapus_time) . "', transferind_TransferOutNo = '" . addslashes($server_transferind_TransferOutNo) . "', transferind_RptDiff = '" . addslashes($server_transferind_RptDiff) . "', transferind_Barcode = '" . addslashes($server_transferind_Barcode) . "', transferind_RptPrice = '" . addslashes($server_transferind_RptPrice) . "', transferind_RptTotal = '" . addslashes($server_transferind_RptTotal) . "', transferind_TransferInDate = '" . addslashes($server_transferind_TransferInDate) . "', transferind_loc_mstrID = '" . addslashes($server_transferind_loc_mstrID) . "', transferind_alterasig_groupID = '" . addslashes($server_transferind_alterasig_groupID) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert transferind_detail=>' . $err_msg;
echo "\n";
echo 'server_transferind_detailID=>' . $server_transferind_detailID;
echo "\n";
echo 'Insert transferind_detail=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE transferind_detail SET transferind_create_user = '" . addslashes($server_transferind_create_user) . "', transferind_create_time = '" . addslashes($server_transferind_create_time) . "', transferind_edit_user = '" . addslashes($server_transferind_edit_user) . "', transferind_edit_time = '" . addslashes($server_transferind_edit_time) . "', transferind_ip = '" . addslashes($server_transferind_ip) . "', transferind_SysTrxId = '" . addslashes($server_transferind_SysTrxId) . "', transferind_Active = '" . addslashes($server_transferind_Active) . "', transferind_Approve = '" . addslashes($server_transferind_Approve) . "', transferind_SyncronizeDate = '" . addslashes($server_transferind_SyncronizeDate) . "', transferind_LastExportDate = '" . addslashes($server_transferind_LastExportDate) . "', transferind_TotalImported = '" . addslashes($server_transferind_TotalImported) . "', transferind_TotalExported = '" . addslashes($server_transferind_TotalExported) . "', transferind_LastUpdateStamp = '" . addslashes($server_transferind_LastUpdateStamp) . "', transferind_idRow = '" . addslashes($server_transferind_idRow) . "', transferind_ReceiptNo = '" . addslashes($server_transferind_ReceiptNo) . "', transferind_SequenceNo = '" . addslashes($server_transferind_SequenceNo) . "', transferind_TransferInNo = '" . addslashes($server_transferind_TransferInNo) . "', transferind_TransferInSequenceNo = '" . addslashes($server_transferind_TransferInSequenceNo) . "', transferind_PickingListNo = '" . addslashes($server_transferind_PickingListNo) . "', transferind_PLSequenceNo = '" . addslashes($server_transferind_PLSequenceNo) . "', transferind_ItemCd = '" . addslashes($server_transferind_ItemCd) . "', transferind_ItemSKUCd = '" . addslashes($server_transferind_ItemSKUCd) . "', transferind_Quantity = '" . addslashes($server_transferind_Quantity) . "', transferind_UOMCd = '" . addslashes($server_transferind_UOMCd) . "', transferind_Description = '" . addslashes($server_transferind_Description) . "', transferind_PStatus = '" . addslashes($server_transferind_PStatus) . "', transferind_SF_ReceiptItem = '" . addslashes($server_transferind_SF_ReceiptItem) . "', transferind_Deleteable = '" . addslashes($server_transferind_Deleteable) . "', transferind_Forensic = '" . addslashes($server_transferind_Forensic) . "', transferind_PortfolioCd = '" . addslashes($server_transferind_PortfolioCd) . "', transferind_Sub_PortfolioCd = '" . addslashes($server_transferind_Sub_PortfolioCd) . "', transferind_transferinh_headerID = '" . addslashes($server_transferind_transferinh_headerID) . "', transferind_measurement_uomID = '" . addslashes($server_transferind_measurement_uomID) . "', transferind_productitem_mstrID = '" . addslashes($server_transferind_productitem_mstrID) . "', transferind_itemsku_mstrID = '" . addslashes($server_transferind_itemsku_mstrID) . "', transferind_picklisth_headerID = '" . addslashes($server_transferind_picklisth_headerID) . "', transferind_picklistd_detailID = '" . addslashes($server_transferind_picklistd_detailID) . "', transferind_transferouth_headerID = '" . addslashes($server_transferind_transferouth_headerID) . "', transferind_transferoutd_detailID = '" . addslashes($server_transferind_transferoutd_detailID) . "', transferind__dihapus = '" . addslashes($server_transferind__dihapus) . "', transferind__dihapus_time = '" . addslashes($server_transferind__dihapus_time) . "', transferind_TransferOutNo = '" . addslashes($server_transferind_TransferOutNo) . "', transferind_RptDiff = '" . addslashes($server_transferind_RptDiff) . "', transferind_Barcode = '" . addslashes($server_transferind_Barcode) . "', transferind_RptPrice = '" . addslashes($server_transferind_RptPrice) . "', transferind_RptTotal = '" . addslashes($server_transferind_RptTotal) . "', transferind_TransferInDate = '" . addslashes($server_transferind_TransferInDate) . "', transferind_loc_mstrID = '" . addslashes($server_transferind_loc_mstrID) . "', transferind_alterasig_groupID = '" . addslashes($server_transferind_alterasig_groupID) . "' WHERE transferind_detailID = " . $server_transferind_detailID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE transferind_detail=>' . $err_msg;
echo "\n";
echo 'server_transferind_detailID=>' . $server_transferind_detailID;
echo "\n";
echo 'UPDATE transferind_detail=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'transferouth_header')
{
echo "\n";
echo 'Sebelum transferouth_header=>' . $err_msg;
echo "\n";
list($server_transferouth_headerID, $server_transferouth_create_user, $server_transferouth_create_time, $server_transferouth_edit_user, $server_transferouth_edit_time, $server_transferouth_ip, $server_transferouth_SysTrxId, $server_transferouth_Active, $server_transferouth_Approve, $server_transferouth_SyncronizeDate, $server_transferouth_LastExportDate, $server_transferouth_TotalImported, $server_transferouth_TotalExported, $server_transferouth_LastUpdateStamp, $server_transferouth_idRow, $server_transferouth_TransferOutNo, $server_transferouth_TransferOutDate, $server_transferouth_ReferenceNo, $server_transferouth_Description, $server_transferouth_BrandCd, $server_transferouth_FromLocationCd, $server_transferouth_ToLocationCd, $server_transferouth_PStatus, $server_transferouth_PostingDate, $server_transferouth_PostingBy, $server_transferouth_SF_Transfer, $server_transferouth_Deleteable, $server_transferouth_Forensic, $server_transferouth_PortfolioCd, $server_transferouth_Sub_PortfolioCd, $server_transferouth_brand_mstrID, $server_transferouth_Fromloc_mstrID, $server_transferouth_Toloc_mstrID, $server_transferouth_TransferType, $server_transferouth_transfertype_mstrID, $server_transferouth__dihapus, $server_transferouth__dihapus_time, $server_transferouth_TransferTypeCd, $server_transferouth_transfertype_tabID, $server_transferouth_periode, $server_transferouth_transferinh_headerID, $server_transferouth_TransferInNo, $server_transferouth_DiffheaderID, $server_transferouth_FullGet) = explode('`', $line);
if ($server_transferouth_Active == '') $server_transferouth_Active = 'No';
if ($server_transferouth_Approve == '') $server_transferouth_Approve = 0;
if ($server_transferouth_TotalImported == '') $server_transferouth_TotalImported = 0;
if ($server_transferouth_TotalExported == '') $server_transferouth_TotalExported = 0;
if ($server_transferouth_idRow == '') $server_transferouth_idRow = 0;
if ($server_transferouth_TransferOutDate == '') $server_transferouth_TransferOutDate = '1900-01-01';
if ($server_transferouth_PostingDate == '') $server_transferouth_PostingDate = '1900-01-01';
if ($server_transferouth_Deleteable == '') $server_transferouth_Deleteable = 'No';
if ($server_transferouth_brand_mstrID == '') $server_transferouth_brand_mstrID = 0;
if ($server_transferouth_Fromloc_mstrID == '') $server_transferouth_Fromloc_mstrID = 0;
if ($server_transferouth_Toloc_mstrID == '') $server_transferouth_Toloc_mstrID = 0;
if ($server_transferouth_transfertype_mstrID == '') $server_transferouth_transfertype_mstrID = 0;
if ($server_transferouth__dihapus == '') $server_transferouth__dihapus = 'No';
if ($server_transferouth_transfertype_tabID == '') $server_transferouth_transfertype_tabID = 0;
if ($server_transferouth_transferinh_headerID == '') $server_transferouth_transferinh_headerID = 0;
if ($server_transferouth_DiffheaderID == '') $server_transferouth_DiffheaderID = 0;
if ($server_transferouth_FullGet == '') $server_transferouth_FullGet = 'No';
$transferouth_headerID = 0;
$koneksi_transferouth_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT transferouth_headerID, transferouth_LastUpdateStamp FROM transferouth_header where transferouth_headerID = " . $server_transferouth_headerID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$transferouth_headerID = $row_koneksi['transferouth_headerID'];
$koneksi_transferouth_LastUpdateStamp = $row_koneksi['transferouth_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($transferouth_headerID == 0)
{
$sql_insert = "INSERT INTO transferouth_header SET transferouth_headerID = '" . addslashes($server_transferouth_headerID) . "', transferouth_create_user = '" . addslashes($server_transferouth_create_user) . "', transferouth_create_time = '" . addslashes($server_transferouth_create_time) . "', transferouth_edit_user = '" . addslashes($server_transferouth_edit_user) . "', transferouth_edit_time = '" . addslashes($server_transferouth_edit_time) . "', transferouth_ip = '" . addslashes($server_transferouth_ip) . "', transferouth_SysTrxId = '" . addslashes($server_transferouth_SysTrxId) . "', transferouth_Active = '" . addslashes($server_transferouth_Active) . "', transferouth_Approve = '" . addslashes($server_transferouth_Approve) . "', transferouth_SyncronizeDate = '" . addslashes($server_transferouth_SyncronizeDate) . "', transferouth_LastExportDate = '" . addslashes($server_transferouth_LastExportDate) . "', transferouth_TotalImported = '" . addslashes($server_transferouth_TotalImported) . "', transferouth_TotalExported = '" . addslashes($server_transferouth_TotalExported) . "', transferouth_LastUpdateStamp = '" . addslashes($server_transferouth_LastUpdateStamp) . "', transferouth_idRow = '" . addslashes($server_transferouth_idRow) . "', transferouth_TransferOutNo = '" . addslashes($server_transferouth_TransferOutNo) . "', transferouth_TransferOutDate = '" . addslashes($server_transferouth_TransferOutDate) . "', transferouth_ReferenceNo = '" . addslashes($server_transferouth_ReferenceNo) . "', transferouth_Description = '" . addslashes($server_transferouth_Description) . "', transferouth_BrandCd = '" . addslashes($server_transferouth_BrandCd) . "', transferouth_FromLocationCd = '" . addslashes($server_transferouth_FromLocationCd) . "', transferouth_ToLocationCd = '" . addslashes($server_transferouth_ToLocationCd) . "', transferouth_PStatus = '" . addslashes($server_transferouth_PStatus) . "', transferouth_PostingDate = '" . addslashes($server_transferouth_PostingDate) . "', transferouth_PostingBy = '" . addslashes($server_transferouth_PostingBy) . "', transferouth_SF_Transfer = '" . addslashes($server_transferouth_SF_Transfer) . "', transferouth_Deleteable = '" . addslashes($server_transferouth_Deleteable) . "', transferouth_Forensic = '" . addslashes($server_transferouth_Forensic) . "', transferouth_PortfolioCd = '" . addslashes($server_transferouth_PortfolioCd) . "', transferouth_Sub_PortfolioCd = '" . addslashes($server_transferouth_Sub_PortfolioCd) . "', transferouth_brand_mstrID = '" . addslashes($server_transferouth_brand_mstrID) . "', transferouth_Fromloc_mstrID = '" . addslashes($server_transferouth_Fromloc_mstrID) . "', transferouth_Toloc_mstrID = '" . addslashes($server_transferouth_Toloc_mstrID) . "', transferouth_TransferType = '" . addslashes($server_transferouth_TransferType) . "', transferouth_transfertype_mstrID = '" . addslashes($server_transferouth_transfertype_mstrID) . "', transferouth__dihapus = '" . addslashes($server_transferouth__dihapus) . "', transferouth__dihapus_time = '" . addslashes($server_transferouth__dihapus_time) . "', transferouth_TransferTypeCd = '" . addslashes($server_transferouth_TransferTypeCd) . "', transferouth_transfertype_tabID = '" . addslashes($server_transferouth_transfertype_tabID) . "', transferouth_periode = '" . addslashes($server_transferouth_periode) . "', transferouth_transferinh_headerID = '" . addslashes($server_transferouth_transferinh_headerID) . "', transferouth_TransferInNo = '" . addslashes($server_transferouth_TransferInNo) . "', transferouth_DiffheaderID = '" . addslashes($server_transferouth_DiffheaderID) . "', transferouth_FullGet = '" . addslashes($server_transferouth_FullGet) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
$fp_stockopname = fopen('/xampp/htdocs/xampp/transferouth_header.html', "w+");
fwrite($fp_stockopname, $err_msg . "\n" . $sql_insert . "\n");
fclose($fp_stockopname);
echo "\n";
echo 'Insert transferouth_header=>' . $err_msg;
echo "\n";
echo 'server_transferouth_headerID=>' . $server_transferouth_headerID;
echo "\n";
echo 'Insert transferouth_header=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE transferouth_header SET transferouth_create_user = '" . addslashes($server_transferouth_create_user) . "', transferouth_create_time = '" . addslashes($server_transferouth_create_time) . "', transferouth_edit_user = '" . addslashes($server_transferouth_edit_user) . "', transferouth_edit_time = '" . addslashes($server_transferouth_edit_time) . "', transferouth_ip = '" . addslashes($server_transferouth_ip) . "', transferouth_SysTrxId = '" . addslashes($server_transferouth_SysTrxId) . "', transferouth_Active = '" . addslashes($server_transferouth_Active) . "', transferouth_Approve = '" . addslashes($server_transferouth_Approve) . "', transferouth_SyncronizeDate = '" . addslashes($server_transferouth_SyncronizeDate) . "', transferouth_LastExportDate = '" . addslashes($server_transferouth_LastExportDate) . "', transferouth_TotalImported = '" . addslashes($server_transferouth_TotalImported) . "', transferouth_TotalExported = '" . addslashes($server_transferouth_TotalExported) . "', transferouth_LastUpdateStamp = '" . addslashes($server_transferouth_LastUpdateStamp) . "', transferouth_idRow = '" . addslashes($server_transferouth_idRow) . "', transferouth_TransferOutNo = '" . addslashes($server_transferouth_TransferOutNo) . "', transferouth_TransferOutDate = '" . addslashes($server_transferouth_TransferOutDate) . "', transferouth_ReferenceNo = '" . addslashes($server_transferouth_ReferenceNo) . "', transferouth_Description = '" . addslashes($server_transferouth_Description) . "', transferouth_BrandCd = '" . addslashes($server_transferouth_BrandCd) . "', transferouth_FromLocationCd = '" . addslashes($server_transferouth_FromLocationCd) . "', transferouth_ToLocationCd = '" . addslashes($server_transferouth_ToLocationCd) . "', transferouth_PStatus = '" . addslashes($server_transferouth_PStatus) . "', transferouth_PostingDate = '" . addslashes($server_transferouth_PostingDate) . "', transferouth_PostingBy = '" . addslashes($server_transferouth_PostingBy) . "', transferouth_SF_Transfer = '" . addslashes($server_transferouth_SF_Transfer) . "', transferouth_Deleteable = '" . addslashes($server_transferouth_Deleteable) . "', transferouth_Forensic = '" . addslashes($server_transferouth_Forensic) . "', transferouth_PortfolioCd = '" . addslashes($server_transferouth_PortfolioCd) . "', transferouth_Sub_PortfolioCd = '" . addslashes($server_transferouth_Sub_PortfolioCd) . "', transferouth_brand_mstrID = '" . addslashes($server_transferouth_brand_mstrID) . "', transferouth_Fromloc_mstrID = '" . addslashes($server_transferouth_Fromloc_mstrID) . "', transferouth_Toloc_mstrID = '" . addslashes($server_transferouth_Toloc_mstrID) . "', transferouth_TransferType = '" . addslashes($server_transferouth_TransferType) . "', transferouth_transfertype_mstrID = '" . addslashes($server_transferouth_transfertype_mstrID) . "', transferouth__dihapus = '" . addslashes($server_transferouth__dihapus) . "', transferouth__dihapus_time = '" . addslashes($server_transferouth__dihapus_time) . "', transferouth_TransferTypeCd = '" . addslashes($server_transferouth_TransferTypeCd) . "', transferouth_transfertype_tabID = '" . addslashes($server_transferouth_transfertype_tabID) . "', transferouth_periode = '" . addslashes($server_transferouth_periode) . "', transferouth_transferinh_headerID = '" . addslashes($server_transferouth_transferinh_headerID) . "', transferouth_TransferInNo = '" . addslashes($server_transferouth_TransferInNo) . "', transferouth_DiffheaderID = '" . addslashes($server_transferouth_DiffheaderID) . "', transferouth_FullGet = '" . addslashes($server_transferouth_FullGet) . "' WHERE transferouth_headerID = " . $server_transferouth_headerID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
$fp_stockopname = fopen('/xampp/htdocs/xampp/transferouth_header.html', "w+");
fwrite($fp_stockopname, $err_msg . "\n" . $sql_update . "\n");
fclose($fp_stockopname);
echo "\n";
echo 'UPDATE transferouth_header=>' . $err_msg;
echo "\n";
echo 'server_transferouth_headerID=>' . $server_transferouth_headerID;
echo "\n";
echo 'UPDATE transferouth_header=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'transferoutd_detail')
{
echo "\n";
echo 'Sebelum transferoutd_detail=>' . $err_msg;
echo "\n";
list($server_transferoutd_detailID, $server_transferoutd_create_user, $server_transferoutd_create_time, $server_transferoutd_edit_user, $server_transferoutd_edit_time, $server_transferoutd_ip, $server_transferoutd_SysTrxId, $server_transferoutd_Active, $server_transferoutd_Approve, $server_transferoutd_SyncronizeDate, $server_transferoutd_LastExportDate, $server_transferoutd_TotalImported, $server_transferoutd_TotalExported, $server_transferoutd_LastUpdateStamp, $server_transferoutd_idRow, $server_transferoutd_TransferOutNo, $server_transferoutd_TransferOutSequenceNo, $server_transferoutd_SRNo, $server_transferoutd_SRSequenceNo, $server_transferoutd_ItemCd, $server_transferoutd_ItemSKUCd, $server_transferoutd_FromLocationCd, $server_transferoutd_ToLocationCd, $server_transferoutd_Quantity, $server_transferoutd_PriceCost, $server_transferoutd_UOMCd, $server_transferoutd_Remark, $server_transferoutd_PStatus, $server_transferoutd_SF_TransferDetail, $server_transferoutd_Deleteable, $server_transferoutd_Forensic, $server_transferoutd_PortfolioCd, $server_transferoutd_Sub_PortfolioCd, $server_transferoutd_measurement_uomID, $server_transferoutd_productitem_mstrID, $server_transferoutd_itemsku_mstrID, $server_transferoutd_Fromloc_mstrID, $server_transferoutd_Toloc_mstrID, $server_transferoutd__dihapus, $server_transferoutd__dihapus_time, $server_transferoutd_transferouth_headerID, $server_transferoutd_transferh_headerID, $server_transferoutd_transferd_detailID, $server_transferoutd_barcode_mstrID, $server_transferoutd_Barcode, $server_transferoutd_picklistd_detailID, $server_transferoutd_picklisth_headerID, $server_transferoutd_PickingListNo, $server_transferoutd_PickingListSequenceNo, $server_transferoutd_qty_get, $server_transferoutd_other_get, $server_transferoutd_transferinh_headerID, $server_transferoutd_transferind_detailID, $server_transferoutd_DiffheaderID, $server_transferoutd_DiffdetailID, $server_transferoutd_DiffTransferOutNo, $server_transferoutd_RptPrice, $server_transferoutd_RptTotal, $server_transferoutd_TransferOutDate, $server_transferoutd_grnoteh_headerID, $server_transferoutd_grnoted_detailID, $server_transferoutd_FullGet, $server_transferoutd_alterasig_groupID) = explode('`', $line);
if ($server_transferoutd_Active == '') $server_transferoutd_Active = 'No';
if ($server_transferoutd_Approve == '') $server_transferoutd_Approve = 0;
if ($server_transferoutd_TotalImported == '') $server_transferoutd_TotalImported = 0;
if ($server_transferoutd_TotalExported == '') $server_transferoutd_TotalExported = 0;
if ($server_transferoutd_idRow == '') $server_transferoutd_idRow = 0;
if ($server_transferoutd_TransferOutSequenceNo == '') $server_transferoutd_TransferOutSequenceNo = 0;
if ($server_transferoutd_SRSequenceNo == '') $server_transferoutd_SRSequenceNo = 0;
if ($server_transferoutd_Quantity == '') $server_transferoutd_Quantity = 0;
if ($server_transferoutd_PriceCost == '') $server_transferoutd_PriceCost = 0;
if ($server_transferoutd_Deleteable == '') $server_transferoutd_Deleteable = 'No';
if ($server_transferoutd_measurement_uomID == '') $server_transferoutd_measurement_uomID = 0;
if ($server_transferoutd_productitem_mstrID == '') $server_transferoutd_productitem_mstrID = 0;
if ($server_transferoutd_itemsku_mstrID == '') $server_transferoutd_itemsku_mstrID = 0;
if ($server_transferoutd_Fromloc_mstrID == '') $server_transferoutd_Fromloc_mstrID = 0;
if ($server_transferoutd_Toloc_mstrID == '') $server_transferoutd_Toloc_mstrID = 0;
if ($server_transferoutd__dihapus == '') $server_transferoutd__dihapus = 'No';
if ($server_transferoutd_transferouth_headerID == '') $server_transferoutd_transferouth_headerID = 0;
if ($server_transferoutd_transferh_headerID == '') $server_transferoutd_transferh_headerID = 0;
if ($server_transferoutd_transferd_detailID == '') $server_transferoutd_transferd_detailID = 0;
if ($server_transferoutd_barcode_mstrID == '') $server_transferoutd_barcode_mstrID = 0;
if ($server_transferoutd_picklistd_detailID == '') $server_transferoutd_picklistd_detailID = 0;
if ($server_transferoutd_picklisth_headerID == '') $server_transferoutd_picklisth_headerID = 0;
if ($server_transferoutd_PickingListSequenceNo == '') $server_transferoutd_PickingListSequenceNo = 0;
if ($server_transferoutd_qty_get == '') $server_transferoutd_qty_get = 0;
if ($server_transferoutd_other_get == '') $server_transferoutd_other_get = 0;
if ($server_transferoutd_transferinh_headerID == '') $server_transferoutd_transferinh_headerID = 0;
if ($server_transferoutd_transferind_detailID == '') $server_transferoutd_transferind_detailID = 0;
if ($server_transferoutd_DiffheaderID == '') $server_transferoutd_DiffheaderID = 0;
if ($server_transferoutd_DiffdetailID == '') $server_transferoutd_DiffdetailID = 0;
if ($server_transferoutd_RptPrice == '') $server_transferoutd_RptPrice = 0;
if ($server_transferoutd_RptTotal == '') $server_transferoutd_RptTotal = 0;
if ($server_transferoutd_TransferOutDate == '') $server_transferoutd_TransferOutDate = '1900-01-01';
if ($server_transferoutd_grnoteh_headerID == '') $server_transferoutd_grnoteh_headerID = 0;
if ($server_transferoutd_grnoted_detailID == '') $server_transferoutd_grnoted_detailID = 0;
if ($server_transferoutd_FullGet == '') $server_transferoutd_FullGet = 'No';
if ($server_transferoutd_alterasig_groupID == '') $server_transferoutd_alterasig_groupID = 0;
$transferoutd_detailID = 0;
$koneksi_transferoutd_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT transferoutd_detailID, transferoutd_LastUpdateStamp FROM transferoutd_detail where transferoutd_detailID = " . $server_transferoutd_detailID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$transferoutd_detailID = $row_koneksi['transferoutd_detailID'];
$koneksi_transferoutd_LastUpdateStamp = $row_koneksi['transferoutd_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($transferoutd_detailID == 0)
{
$sql_insert = "INSERT INTO transferoutd_detail SET transferoutd_detailID = '" . addslashes($server_transferoutd_detailID) . "', transferoutd_create_user = '" . addslashes($server_transferoutd_create_user) . "', transferoutd_create_time = '" . addslashes($server_transferoutd_create_time) . "', transferoutd_edit_user = '" . addslashes($server_transferoutd_edit_user) . "', transferoutd_edit_time = '" . addslashes($server_transferoutd_edit_time) . "', transferoutd_ip = '" . addslashes($server_transferoutd_ip) . "', transferoutd_SysTrxId = '" . addslashes($server_transferoutd_SysTrxId) . "', transferoutd_Active = '" . addslashes($server_transferoutd_Active) . "', transferoutd_Approve = '" . addslashes($server_transferoutd_Approve) . "', transferoutd_SyncronizeDate = '" . addslashes($server_transferoutd_SyncronizeDate) . "', transferoutd_LastExportDate = '" . addslashes($server_transferoutd_LastExportDate) . "', transferoutd_TotalImported = '" . addslashes($server_transferoutd_TotalImported) . "', transferoutd_TotalExported = '" . addslashes($server_transferoutd_TotalExported) . "', transferoutd_LastUpdateStamp = '" . addslashes($server_transferoutd_LastUpdateStamp) . "', transferoutd_idRow = '" . addslashes($server_transferoutd_idRow) . "', transferoutd_TransferOutNo = '" . addslashes($server_transferoutd_TransferOutNo) . "', transferoutd_TransferOutSequenceNo = '" . addslashes($server_transferoutd_TransferOutSequenceNo) . "', transferoutd_SRNo = '" . addslashes($server_transferoutd_SRNo) . "', transferoutd_SRSequenceNo = '" . addslashes($server_transferoutd_SRSequenceNo) . "', transferoutd_ItemCd = '" . addslashes($server_transferoutd_ItemCd) . "', transferoutd_ItemSKUCd = '" . addslashes($server_transferoutd_ItemSKUCd) . "', transferoutd_FromLocationCd = '" . addslashes($server_transferoutd_FromLocationCd) . "', transferoutd_ToLocationCd = '" . addslashes($server_transferoutd_ToLocationCd) . "', transferoutd_Quantity = '" . addslashes($server_transferoutd_Quantity) . "', transferoutd_PriceCost = '" . addslashes($server_transferoutd_PriceCost) . "', transferoutd_UOMCd = '" . addslashes($server_transferoutd_UOMCd) . "', transferoutd_Remark = '" . addslashes($server_transferoutd_Remark) . "', transferoutd_PStatus = '" . addslashes($server_transferoutd_PStatus) . "', transferoutd_SF_TransferDetail = '" . addslashes($server_transferoutd_SF_TransferDetail) . "', transferoutd_Deleteable = '" . addslashes($server_transferoutd_Deleteable) . "', transferoutd_Forensic = '" . addslashes($server_transferoutd_Forensic) . "', transferoutd_PortfolioCd = '" . addslashes($server_transferoutd_PortfolioCd) . "', transferoutd_Sub_PortfolioCd = '" . addslashes($server_transferoutd_Sub_PortfolioCd) . "', transferoutd_measurement_uomID = '" . addslashes($server_transferoutd_measurement_uomID) . "', transferoutd_productitem_mstrID = '" . addslashes($server_transferoutd_productitem_mstrID) . "', transferoutd_itemsku_mstrID = '" . addslashes($server_transferoutd_itemsku_mstrID) . "', transferoutd_Fromloc_mstrID = '" . addslashes($server_transferoutd_Fromloc_mstrID) . "', transferoutd_Toloc_mstrID = '" . addslashes($server_transferoutd_Toloc_mstrID) . "', transferoutd__dihapus = '" . addslashes($server_transferoutd__dihapus) . "', transferoutd__dihapus_time = '" . addslashes($server_transferoutd__dihapus_time) . "', transferoutd_transferouth_headerID = '" . addslashes($server_transferoutd_transferouth_headerID) . "', transferoutd_transferh_headerID = '" . addslashes($server_transferoutd_transferh_headerID) . "', transferoutd_transferd_detailID = '" . addslashes($server_transferoutd_transferd_detailID) . "', transferoutd_barcode_mstrID = '" . addslashes($server_transferoutd_barcode_mstrID) . "', transferoutd_Barcode = '" . addslashes($server_transferoutd_Barcode) . "', transferoutd_picklistd_detailID = '" . addslashes($server_transferoutd_picklistd_detailID) . "', transferoutd_picklisth_headerID = '" . addslashes($server_transferoutd_picklisth_headerID) . "', transferoutd_PickingListNo = '" . addslashes($server_transferoutd_PickingListNo) . "', transferoutd_PickingListSequenceNo = '" . addslashes($server_transferoutd_PickingListSequenceNo) . "', transferoutd_qty_get = '" . addslashes($server_transferoutd_qty_get) . "', transferoutd_other_get = '" . addslashes($server_transferoutd_other_get) . "', transferoutd_transferinh_headerID = '" . addslashes($server_transferoutd_transferinh_headerID) . "', transferoutd_transferind_detailID = '" . addslashes($server_transferoutd_transferind_detailID) . "', transferoutd_DiffheaderID = '" . addslashes($server_transferoutd_DiffheaderID) . "', transferoutd_DiffdetailID = '" . addslashes($server_transferoutd_DiffdetailID) . "', transferoutd_DiffTransferOutNo = '" . addslashes($server_transferoutd_DiffTransferOutNo) . "', transferoutd_RptPrice = '" . addslashes($server_transferoutd_RptPrice) . "', transferoutd_RptTotal = '" . addslashes($server_transferoutd_RptTotal) . "', transferoutd_TransferOutDate = '" . addslashes($server_transferoutd_TransferOutDate) . "', transferoutd_grnoteh_headerID = '" . addslashes($server_transferoutd_grnoteh_headerID) . "', transferoutd_grnoted_detailID = '" . addslashes($server_transferoutd_grnoted_detailID) . "', transferoutd_FullGet = '" . addslashes($server_transferoutd_FullGet) . "', transferoutd_alterasig_groupID = '" . addslashes($server_transferoutd_alterasig_groupID) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert transferoutd_detail=>' . $err_msg;
echo "\n";
echo 'server_transferoutd_detailID=>' . $server_transferoutd_detailID;
echo "\n";
echo 'Insert transferoutd_detail=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE transferoutd_detail SET transferoutd_create_user = '" . addslashes($server_transferoutd_create_user) . "', transferoutd_create_time = '" . addslashes($server_transferoutd_create_time) . "', transferoutd_edit_user = '" . addslashes($server_transferoutd_edit_user) . "', transferoutd_edit_time = '" . addslashes($server_transferoutd_edit_time) . "', transferoutd_ip = '" . addslashes($server_transferoutd_ip) . "', transferoutd_SysTrxId = '" . addslashes($server_transferoutd_SysTrxId) . "', transferoutd_Active = '" . addslashes($server_transferoutd_Active) . "', transferoutd_Approve = '" . addslashes($server_transferoutd_Approve) . "', transferoutd_SyncronizeDate = '" . addslashes($server_transferoutd_SyncronizeDate) . "', transferoutd_LastExportDate = '" . addslashes($server_transferoutd_LastExportDate) . "', transferoutd_TotalImported = '" . addslashes($server_transferoutd_TotalImported) . "', transferoutd_TotalExported = '" . addslashes($server_transferoutd_TotalExported) . "', transferoutd_LastUpdateStamp = '" . addslashes($server_transferoutd_LastUpdateStamp) . "', transferoutd_idRow = '" . addslashes($server_transferoutd_idRow) . "', transferoutd_TransferOutNo = '" . addslashes($server_transferoutd_TransferOutNo) . "', transferoutd_TransferOutSequenceNo = '" . addslashes($server_transferoutd_TransferOutSequenceNo) . "', transferoutd_SRNo = '" . addslashes($server_transferoutd_SRNo) . "', transferoutd_SRSequenceNo = '" . addslashes($server_transferoutd_SRSequenceNo) . "', transferoutd_ItemCd = '" . addslashes($server_transferoutd_ItemCd) . "', transferoutd_ItemSKUCd = '" . addslashes($server_transferoutd_ItemSKUCd) . "', transferoutd_FromLocationCd = '" . addslashes($server_transferoutd_FromLocationCd) . "', transferoutd_ToLocationCd = '" . addslashes($server_transferoutd_ToLocationCd) . "', transferoutd_Quantity = '" . addslashes($server_transferoutd_Quantity) . "', transferoutd_PriceCost = '" . addslashes($server_transferoutd_PriceCost) . "', transferoutd_UOMCd = '" . addslashes($server_transferoutd_UOMCd) . "', transferoutd_Remark = '" . addslashes($server_transferoutd_Remark) . "', transferoutd_PStatus = '" . addslashes($server_transferoutd_PStatus) . "', transferoutd_SF_TransferDetail = '" . addslashes($server_transferoutd_SF_TransferDetail) . "', transferoutd_Deleteable = '" . addslashes($server_transferoutd_Deleteable) . "', transferoutd_Forensic = '" . addslashes($server_transferoutd_Forensic) . "', transferoutd_PortfolioCd = '" . addslashes($server_transferoutd_PortfolioCd) . "', transferoutd_Sub_PortfolioCd = '" . addslashes($server_transferoutd_Sub_PortfolioCd) . "', transferoutd_measurement_uomID = '" . addslashes($server_transferoutd_measurement_uomID) . "', transferoutd_productitem_mstrID = '" . addslashes($server_transferoutd_productitem_mstrID) . "', transferoutd_itemsku_mstrID = '" . addslashes($server_transferoutd_itemsku_mstrID) . "', transferoutd_Fromloc_mstrID = '" . addslashes($server_transferoutd_Fromloc_mstrID) . "', transferoutd_Toloc_mstrID = '" . addslashes($server_transferoutd_Toloc_mstrID) . "', transferoutd__dihapus = '" . addslashes($server_transferoutd__dihapus) . "', transferoutd__dihapus_time = '" . addslashes($server_transferoutd__dihapus_time) . "', transferoutd_transferouth_headerID = '" . addslashes($server_transferoutd_transferouth_headerID) . "', transferoutd_transferh_headerID = '" . addslashes($server_transferoutd_transferh_headerID) . "', transferoutd_transferd_detailID = '" . addslashes($server_transferoutd_transferd_detailID) . "', transferoutd_barcode_mstrID = '" . addslashes($server_transferoutd_barcode_mstrID) . "', transferoutd_Barcode = '" . addslashes($server_transferoutd_Barcode) . "', transferoutd_picklistd_detailID = '" . addslashes($server_transferoutd_picklistd_detailID) . "', transferoutd_picklisth_headerID = '" . addslashes($server_transferoutd_picklisth_headerID) . "', transferoutd_PickingListNo = '" . addslashes($server_transferoutd_PickingListNo) . "', transferoutd_PickingListSequenceNo = '" . addslashes($server_transferoutd_PickingListSequenceNo) . "', transferoutd_qty_get = '" . addslashes($server_transferoutd_qty_get) . "', transferoutd_other_get = '" . addslashes($server_transferoutd_other_get) . "', transferoutd_transferinh_headerID = '" . addslashes($server_transferoutd_transferinh_headerID) . "', transferoutd_transferind_detailID = '" . addslashes($server_transferoutd_transferind_detailID) . "', transferoutd_DiffheaderID = '" . addslashes($server_transferoutd_DiffheaderID) . "', transferoutd_DiffdetailID = '" . addslashes($server_transferoutd_DiffdetailID) . "', transferoutd_DiffTransferOutNo = '" . addslashes($server_transferoutd_DiffTransferOutNo) . "', transferoutd_RptPrice = '" . addslashes($server_transferoutd_RptPrice) . "', transferoutd_RptTotal = '" . addslashes($server_transferoutd_RptTotal) . "', transferoutd_TransferOutDate = '" . addslashes($server_transferoutd_TransferOutDate) . "', transferoutd_grnoteh_headerID = '" . addslashes($server_transferoutd_grnoteh_headerID) . "', transferoutd_grnoted_detailID = '" . addslashes($server_transferoutd_grnoted_detailID) . "', transferoutd_FullGet = '" . addslashes($server_transferoutd_FullGet) . "', transferoutd_alterasig_groupID = '" . addslashes($server_transferoutd_alterasig_groupID) . "' WHERE transferoutd_detailID = " . $server_transferoutd_detailID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE transferoutd_detail=>' . $err_msg;
echo "\n";
echo 'server_transferoutd_detailID=>' . $server_transferoutd_detailID;
echo "\n";
echo 'UPDATE transferoutd_detail=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'transferd_detail')
{
echo "\n";
echo 'Sebelum transferd_detail=>' . $err_msg;
echo "\n";
list($server_transferd_detailID, $server_transferd_create_user, $server_transferd_create_time, $server_transferd_edit_user, $server_transferd_edit_time, $server_transferd_ip, $server_transferd_SysTrxId, $server_transferd_Active, $server_transferd_Approve, $server_transferd_SyncronizeDate, $server_transferd_LastExportDate, $server_transferd_TotalImported, $server_transferd_TotalExported, $server_transferd_LastUpdateStamp, $server_transferd_idRow, $server_transferd_StockRequestNo, $server_transferd_SequenceNo, $server_transferd_ItemCd, $server_transferd_ItemSKUCd, $server_transferd_Quantity, $server_transferd_UOMCd, $server_transferd_Description, $server_transferd_PStatus, $server_transferd_SF_StockRequestDetail, $server_transferd_Deleteable, $server_transferd_Forensic, $server_transferd_PortfolioCd, $server_transferd_Sub_PortfolioCd, $server_transferd_transferh_headerID, $server_transferd_measurement_uomID, $server_transferd_productitem_mstrID, $server_transferd_itemsku_mstrID, $server_transferd__dihapus, $server_transferd__dihapus_time, $server_transferd_qty_get, $server_transferd_other_get, $server_transferd_FromLocationCd, $server_transferd_Fromloc_mstrID, $server_transferd_OldItemSKUCd, $server_transferd_StockRequestDate, $server_transferd_Toloc_mstrID) = explode('`', $line);
if ($server_transferd_Active == '') $server_transferd_Active = 'No';
if ($server_transferd_Approve == '') $server_transferd_Approve = 0;
if ($server_transferd_TotalImported == '') $server_transferd_TotalImported = 0;
if ($server_transferd_TotalExported == '') $server_transferd_TotalExported = 0;
if ($server_transferd_idRow == '') $server_transferd_idRow = 0;
if ($server_transferd_SequenceNo == '') $server_transferd_SequenceNo = 0;
if ($server_transferd_Quantity == '') $server_transferd_Quantity = 0;
if ($server_transferd_Deleteable == '') $server_transferd_Deleteable = 'No';
if ($server_transferd_transferh_headerID == '') $server_transferd_transferh_headerID = 0;
if ($server_transferd_measurement_uomID == '') $server_transferd_measurement_uomID = 0;
if ($server_transferd_productitem_mstrID == '') $server_transferd_productitem_mstrID = 0;
if ($server_transferd_itemsku_mstrID == '') $server_transferd_itemsku_mstrID = 0;
if ($server_transferd__dihapus == '') $server_transferd__dihapus = 'No';
if ($server_transferd_qty_get == '') $server_transferd_qty_get = 0;
if ($server_transferd_other_get == '') $server_transferd_other_get = 0;
if ($server_transferd_Fromloc_mstrID == '') $server_transferd_Fromloc_mstrID = 0;
if ($server_transferd_StockRequestDate == '') $server_transferd_StockRequestDate = '1900-01-01';
if ($server_transferd_Toloc_mstrID == '') $server_transferd_Toloc_mstrID = 0;
$transferd_detailID = 0;
$koneksi_transferd_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT transferd_detailID, transferd_LastUpdateStamp FROM transferd_detail where transferd_detailID = " . $server_transferd_detailID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$transferd_detailID = $row_koneksi['transferd_detailID'];
$koneksi_transferd_LastUpdateStamp = $row_koneksi['transferd_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($transferd_detailID == 0)
{
$sql_insert = "INSERT INTO transferd_detail SET transferd_detailID = '" . addslashes($server_transferd_detailID) . "', transferd_create_user = '" . addslashes($server_transferd_create_user) . "', transferd_create_time = '" . addslashes($server_transferd_create_time) . "', transferd_edit_user = '" . addslashes($server_transferd_edit_user) . "', transferd_edit_time = '" . addslashes($server_transferd_edit_time) . "', transferd_ip = '" . addslashes($server_transferd_ip) . "', transferd_SysTrxId = '" . addslashes($server_transferd_SysTrxId) . "', transferd_Active = '" . addslashes($server_transferd_Active) . "', transferd_Approve = '" . addslashes($server_transferd_Approve) . "', transferd_SyncronizeDate = '" . addslashes($server_transferd_SyncronizeDate) . "', transferd_LastExportDate = '" . addslashes($server_transferd_LastExportDate) . "', transferd_TotalImported = '" . addslashes($server_transferd_TotalImported) . "', transferd_TotalExported = '" . addslashes($server_transferd_TotalExported) . "', transferd_LastUpdateStamp = '" . addslashes($server_transferd_LastUpdateStamp) . "', transferd_idRow = '" . addslashes($server_transferd_idRow) . "', transferd_StockRequestNo = '" . addslashes($server_transferd_StockRequestNo) . "', transferd_SequenceNo = '" . addslashes($server_transferd_SequenceNo) . "', transferd_ItemCd = '" . addslashes($server_transferd_ItemCd) . "', transferd_ItemSKUCd = '" . addslashes($server_transferd_ItemSKUCd) . "', transferd_Quantity = '" . addslashes($server_transferd_Quantity) . "', transferd_UOMCd = '" . addslashes($server_transferd_UOMCd) . "', transferd_Description = '" . addslashes($server_transferd_Description) . "', transferd_PStatus = '" . addslashes($server_transferd_PStatus) . "', transferd_SF_StockRequestDetail = '" . addslashes($server_transferd_SF_StockRequestDetail) . "', transferd_Deleteable = '" . addslashes($server_transferd_Deleteable) . "', transferd_Forensic = '" . addslashes($server_transferd_Forensic) . "', transferd_PortfolioCd = '" . addslashes($server_transferd_PortfolioCd) . "', transferd_Sub_PortfolioCd = '" . addslashes($server_transferd_Sub_PortfolioCd) . "', transferd_transferh_headerID = '" . addslashes($server_transferd_transferh_headerID) . "', transferd_measurement_uomID = '" . addslashes($server_transferd_measurement_uomID) . "', transferd_productitem_mstrID = '" . addslashes($server_transferd_productitem_mstrID) . "', transferd_itemsku_mstrID = '" . addslashes($server_transferd_itemsku_mstrID) . "', transferd__dihapus = '" . addslashes($server_transferd__dihapus) . "', transferd__dihapus_time = '" . addslashes($server_transferd__dihapus_time) . "', transferd_qty_get = '" . addslashes($server_transferd_qty_get) . "', transferd_other_get = '" . addslashes($server_transferd_other_get) . "', transferd_FromLocationCd = '" . addslashes($server_transferd_FromLocationCd) . "', transferd_Fromloc_mstrID = '" . addslashes($server_transferd_Fromloc_mstrID) . "', transferd_OldItemSKUCd = '" . addslashes($server_transferd_OldItemSKUCd) . "', transferd_StockRequestDate = '" . addslashes($server_transferd_StockRequestDate) . "', transferd_Toloc_mstrID = '" . addslashes($server_transferd_Toloc_mstrID) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert transferd_detail=>' . $err_msg;
echo "\n";
echo 'server_transferd_detailID=>' . $server_transferd_detailID;
echo "\n";
echo 'Insert transferd_detail=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE transferd_detail SET transferd_create_user = '" . addslashes($server_transferd_create_user) . "', transferd_create_time = '" . addslashes($server_transferd_create_time) . "', transferd_edit_user = '" . addslashes($server_transferd_edit_user) . "', transferd_edit_time = '" . addslashes($server_transferd_edit_time) . "', transferd_ip = '" . addslashes($server_transferd_ip) . "', transferd_SysTrxId = '" . addslashes($server_transferd_SysTrxId) . "', transferd_Active = '" . addslashes($server_transferd_Active) . "', transferd_Approve = '" . addslashes($server_transferd_Approve) . "', transferd_SyncronizeDate = '" . addslashes($server_transferd_SyncronizeDate) . "', transferd_LastExportDate = '" . addslashes($server_transferd_LastExportDate) . "', transferd_TotalImported = '" . addslashes($server_transferd_TotalImported) . "', transferd_TotalExported = '" . addslashes($server_transferd_TotalExported) . "', transferd_LastUpdateStamp = '" . addslashes($server_transferd_LastUpdateStamp) . "', transferd_idRow = '" . addslashes($server_transferd_idRow) . "', transferd_StockRequestNo = '" . addslashes($server_transferd_StockRequestNo) . "', transferd_SequenceNo = '" . addslashes($server_transferd_SequenceNo) . "', transferd_ItemCd = '" . addslashes($server_transferd_ItemCd) . "', transferd_ItemSKUCd = '" . addslashes($server_transferd_ItemSKUCd) . "', transferd_Quantity = '" . addslashes($server_transferd_Quantity) . "', transferd_UOMCd = '" . addslashes($server_transferd_UOMCd) . "', transferd_Description = '" . addslashes($server_transferd_Description) . "', transferd_PStatus = '" . addslashes($server_transferd_PStatus) . "', transferd_SF_StockRequestDetail = '" . addslashes($server_transferd_SF_StockRequestDetail) . "', transferd_Deleteable = '" . addslashes($server_transferd_Deleteable) . "', transferd_Forensic = '" . addslashes($server_transferd_Forensic) . "', transferd_PortfolioCd = '" . addslashes($server_transferd_PortfolioCd) . "', transferd_Sub_PortfolioCd = '" . addslashes($server_transferd_Sub_PortfolioCd) . "', transferd_transferh_headerID = '" . addslashes($server_transferd_transferh_headerID) . "', transferd_measurement_uomID = '" . addslashes($server_transferd_measurement_uomID) . "', transferd_productitem_mstrID = '" . addslashes($server_transferd_productitem_mstrID) . "', transferd_itemsku_mstrID = '" . addslashes($server_transferd_itemsku_mstrID) . "', transferd__dihapus = '" . addslashes($server_transferd__dihapus) . "', transferd__dihapus_time = '" . addslashes($server_transferd__dihapus_time) . "', transferd_qty_get = '" . addslashes($server_transferd_qty_get) . "', transferd_other_get = '" . addslashes($server_transferd_other_get) . "', transferd_FromLocationCd = '" . addslashes($server_transferd_FromLocationCd) . "', transferd_Fromloc_mstrID = '" . addslashes($server_transferd_Fromloc_mstrID) . "', transferd_OldItemSKUCd = '" . addslashes($server_transferd_OldItemSKUCd) . "', transferd_StockRequestDate = '" . addslashes($server_transferd_StockRequestDate) . "', transferd_Toloc_mstrID = '" . addslashes($server_transferd_Toloc_mstrID) . "' WHERE transferd_detailID = " . $server_transferd_detailID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE transferd_detail=>' . $err_msg;
echo "\n";
echo 'server_transferd_detailID=>' . $server_transferd_detailID;
echo "\n";
echo 'UPDATE transferd_detail=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'transferh_header')
{
echo "\n";
echo 'Sebelum transferh_header=>' . $err_msg;
echo "\n";
list($server_transferh_headerID, $server_transferh_create_user, $server_transferh_create_time, $server_transferh_edit_user, $server_transferh_edit_time, $server_transferh_ip, $server_transferh_SysTrxId, $server_transferh_Active, $server_transferh_Approve, $server_transferh_SyncronizeDate, $server_transferh_LastExportDate, $server_transferh_TotalImported, $server_transferh_TotalExported, $server_transferh_LastUpdateStamp, $server_transferh_idRow, $server_transferh_StockRequestNo, $server_transferh_StockRequestDate, $server_transferh_ReferenceNo, $server_transferh_Description, $server_transferh_BrandCd, $server_transferh_FromLocationCd, $server_transferh_ToLocationCd, $server_transferh_TimeLimit, $server_transferh_PStatus, $server_transferh_SF_StockRequest, $server_transferh_Deleteable, $server_transferh_Forensic, $server_transferh_PortfolioCd, $server_transferh_Sub_PortfolioCd, $server_transferh_brand_mstrID, $server_transferh__dihapus, $server_transferh__dihapus_time, $server_transferh_Fromloc_mstrID, $server_transferh_Toloc_mstrID, $server_transferh_periode, $server_transferh_FullGet, $server_transferh_fileexcel, $server_transferh_UExcelStatus, $server_transferh_FullGetPL, $server_transferh_AppAsom, $server_transferh_AppAsom_ip, $server_transferh_AppAsom_time, $server_transferh_AppAsom_user, $server_transferh_ReqAppAsom, $server_transferh_ReqAppAsom_ip, $server_transferh_ReqAppAsom_time, $server_transferh_ReqAppAsom_user, $server_transferh_Posting_time, $server_transferh_PostingDate, $server_transferh_PostingBy, $server_transferh_AppCode, $server_transferh_ReqAppAsom_comment, $server_transferh_AppAsom_comment) = explode('`', $line);
if ($server_transferh_Active == '') $server_transferh_Active = 'No';
if ($server_transferh_Approve == '') $server_transferh_Approve = 0;
if ($server_transferh_TotalImported == '') $server_transferh_TotalImported = 0;
if ($server_transferh_TotalExported == '') $server_transferh_TotalExported = 0;
if ($server_transferh_idRow == '') $server_transferh_idRow = 0;
if ($server_transferh_StockRequestDate == '') $server_transferh_StockRequestDate = '1900-01-01';
if ($server_transferh_TimeLimit == '') $server_transferh_TimeLimit = 0;
if ($server_transferh_Deleteable == '') $server_transferh_Deleteable = 'No';
if ($server_transferh_brand_mstrID == '') $server_transferh_brand_mstrID = 0;
if ($server_transferh__dihapus == '') $server_transferh__dihapus = 'No';
if ($server_transferh_Fromloc_mstrID == '') $server_transferh_Fromloc_mstrID = 0;
if ($server_transferh_Toloc_mstrID == '') $server_transferh_Toloc_mstrID = 0;
if ($server_transferh_FullGet == '') $server_transferh_FullGet = 'No';
if ($server_transferh_UExcelStatus == '') $server_transferh_UExcelStatus = 'none';
if ($server_transferh_FullGetPL == '') $server_transferh_FullGetPL = 'No';
if ($server_transferh_AppAsom == '') $server_transferh_AppAsom = 'No';
if ($server_transferh_ReqAppAsom == '') $server_transferh_ReqAppAsom = 'No';
if ($server_transferh_PostingDate == '') $server_transferh_PostingDate = '1900-01-01';
$transferh_headerID = 0;
$koneksi_transferh_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT transferh_headerID, transferh_LastUpdateStamp FROM transferh_header where transferh_headerID = " . $server_transferh_headerID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$transferh_headerID = $row_koneksi['transferh_headerID'];
$koneksi_transferh_LastUpdateStamp = $row_koneksi['transferh_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($transferh_headerID == 0)
{
$sql_insert = "INSERT INTO transferh_header SET transferh_headerID = '" . addslashes($server_transferh_headerID) . "', transferh_create_user = '" . addslashes($server_transferh_create_user) . "', transferh_create_time = '" . addslashes($server_transferh_create_time) . "', transferh_edit_user = '" . addslashes($server_transferh_edit_user) . "', transferh_edit_time = '" . addslashes($server_transferh_edit_time) . "', transferh_ip = '" . addslashes($server_transferh_ip) . "', transferh_SysTrxId = '" . addslashes($server_transferh_SysTrxId) . "', transferh_Active = '" . addslashes($server_transferh_Active) . "', transferh_Approve = '" . addslashes($server_transferh_Approve) . "', transferh_SyncronizeDate = '" . addslashes($server_transferh_SyncronizeDate) . "', transferh_LastExportDate = '" . addslashes($server_transferh_LastExportDate) . "', transferh_TotalImported = '" . addslashes($server_transferh_TotalImported) . "', transferh_TotalExported = '" . addslashes($server_transferh_TotalExported) . "', transferh_LastUpdateStamp = '" . addslashes($server_transferh_LastUpdateStamp) . "', transferh_idRow = '" . addslashes($server_transferh_idRow) . "', transferh_StockRequestNo = '" . addslashes($server_transferh_StockRequestNo) . "', transferh_StockRequestDate = '" . addslashes($server_transferh_StockRequestDate) . "', transferh_ReferenceNo = '" . addslashes($server_transferh_ReferenceNo) . "', transferh_Description = '" . addslashes($server_transferh_Description) . "', transferh_BrandCd = '" . addslashes($server_transferh_BrandCd) . "', transferh_FromLocationCd = '" . addslashes($server_transferh_FromLocationCd) . "', transferh_ToLocationCd = '" . addslashes($server_transferh_ToLocationCd) . "', transferh_TimeLimit = '" . addslashes($server_transferh_TimeLimit) . "', transferh_PStatus = '" . addslashes($server_transferh_PStatus) . "', transferh_SF_StockRequest = '" . addslashes($server_transferh_SF_StockRequest) . "', transferh_Deleteable = '" . addslashes($server_transferh_Deleteable) . "', transferh_Forensic = '" . addslashes($server_transferh_Forensic) . "', transferh_PortfolioCd = '" . addslashes($server_transferh_PortfolioCd) . "', transferh_Sub_PortfolioCd = '" . addslashes($server_transferh_Sub_PortfolioCd) . "', transferh_brand_mstrID = '" . addslashes($server_transferh_brand_mstrID) . "', transferh__dihapus = '" . addslashes($server_transferh__dihapus) . "', transferh__dihapus_time = '" . addslashes($server_transferh__dihapus_time) . "', transferh_Fromloc_mstrID = '" . addslashes($server_transferh_Fromloc_mstrID) . "', transferh_Toloc_mstrID = '" . addslashes($server_transferh_Toloc_mstrID) . "', transferh_periode = '" . addslashes($server_transferh_periode) . "', transferh_FullGet = '" . addslashes($server_transferh_FullGet) . "', transferh_fileexcel = '" . addslashes($server_transferh_fileexcel) . "', transferh_UExcelStatus = '" . addslashes($server_transferh_UExcelStatus) . "', transferh_FullGetPL = '" . addslashes($server_transferh_FullGetPL) . "', transferh_AppAsom = '" . addslashes($server_transferh_AppAsom) . "', transferh_AppAsom_ip = '" . addslashes($server_transferh_AppAsom_ip) . "', transferh_AppAsom_time = '" . addslashes($server_transferh_AppAsom_time) . "', transferh_AppAsom_user = '" . addslashes($server_transferh_AppAsom_user) . "', transferh_ReqAppAsom = '" . addslashes($server_transferh_ReqAppAsom) . "', transferh_ReqAppAsom_ip = '" . addslashes($server_transferh_ReqAppAsom_ip) . "', transferh_ReqAppAsom_time = '" . addslashes($server_transferh_ReqAppAsom_time) . "', transferh_ReqAppAsom_user = '" . addslashes($server_transferh_ReqAppAsom_user) . "', transferh_Posting_time = '" . addslashes($server_transferh_Posting_time) . "', transferh_PostingDate = '" . addslashes($server_transferh_PostingDate) . "', transferh_PostingBy = '" . addslashes($server_transferh_PostingBy) . "', transferh_AppCode = '" . addslashes($server_transferh_AppCode) . "', transferh_ReqAppAsom_comment = '" . addslashes($server_transferh_ReqAppAsom_comment) . "', transferh_AppAsom_comment = '" . addslashes($server_transferh_AppAsom_comment) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert transferh_header=>' . $err_msg;
echo "\n";
echo 'server_transferh_headerID=>' . $server_transferh_headerID;
echo "\n";
echo 'Insert transferh_header=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE transferh_header SET transferh_create_user = '" . addslashes($server_transferh_create_user) . "', transferh_create_time = '" . addslashes($server_transferh_create_time) . "', transferh_edit_user = '" . addslashes($server_transferh_edit_user) . "', transferh_edit_time = '" . addslashes($server_transferh_edit_time) . "', transferh_ip = '" . addslashes($server_transferh_ip) . "', transferh_SysTrxId = '" . addslashes($server_transferh_SysTrxId) . "', transferh_Active = '" . addslashes($server_transferh_Active) . "', transferh_Approve = '" . addslashes($server_transferh_Approve) . "', transferh_SyncronizeDate = '" . addslashes($server_transferh_SyncronizeDate) . "', transferh_LastExportDate = '" . addslashes($server_transferh_LastExportDate) . "', transferh_TotalImported = '" . addslashes($server_transferh_TotalImported) . "', transferh_TotalExported = '" . addslashes($server_transferh_TotalExported) . "', transferh_LastUpdateStamp = '" . addslashes($server_transferh_LastUpdateStamp) . "', transferh_idRow = '" . addslashes($server_transferh_idRow) . "', transferh_StockRequestNo = '" . addslashes($server_transferh_StockRequestNo) . "', transferh_StockRequestDate = '" . addslashes($server_transferh_StockRequestDate) . "', transferh_ReferenceNo = '" . addslashes($server_transferh_ReferenceNo) . "', transferh_Description = '" . addslashes($server_transferh_Description) . "', transferh_BrandCd = '" . addslashes($server_transferh_BrandCd) . "', transferh_FromLocationCd = '" . addslashes($server_transferh_FromLocationCd) . "', transferh_ToLocationCd = '" . addslashes($server_transferh_ToLocationCd) . "', transferh_TimeLimit = '" . addslashes($server_transferh_TimeLimit) . "', transferh_PStatus = '" . addslashes($server_transferh_PStatus) . "', transferh_SF_StockRequest = '" . addslashes($server_transferh_SF_StockRequest) . "', transferh_Deleteable = '" . addslashes($server_transferh_Deleteable) . "', transferh_Forensic = '" . addslashes($server_transferh_Forensic) . "', transferh_PortfolioCd = '" . addslashes($server_transferh_PortfolioCd) . "', transferh_Sub_PortfolioCd = '" . addslashes($server_transferh_Sub_PortfolioCd) . "', transferh_brand_mstrID = '" . addslashes($server_transferh_brand_mstrID) . "', transferh__dihapus = '" . addslashes($server_transferh__dihapus) . "', transferh__dihapus_time = '" . addslashes($server_transferh__dihapus_time) . "', transferh_Fromloc_mstrID = '" . addslashes($server_transferh_Fromloc_mstrID) . "', transferh_Toloc_mstrID = '" . addslashes($server_transferh_Toloc_mstrID) . "', transferh_periode = '" . addslashes($server_transferh_periode) . "', transferh_FullGet = '" . addslashes($server_transferh_FullGet) . "', transferh_fileexcel = '" . addslashes($server_transferh_fileexcel) . "', transferh_UExcelStatus = '" . addslashes($server_transferh_UExcelStatus) . "', transferh_FullGetPL = '" . addslashes($server_transferh_FullGetPL) . "', transferh_AppAsom = '" . addslashes($server_transferh_AppAsom) . "', transferh_AppAsom_ip = '" . addslashes($server_transferh_AppAsom_ip) . "', transferh_AppAsom_time = '" . addslashes($server_transferh_AppAsom_time) . "', transferh_AppAsom_user = '" . addslashes($server_transferh_AppAsom_user) . "', transferh_ReqAppAsom = '" . addslashes($server_transferh_ReqAppAsom) . "', transferh_ReqAppAsom_ip = '" . addslashes($server_transferh_ReqAppAsom_ip) . "', transferh_ReqAppAsom_time = '" . addslashes($server_transferh_ReqAppAsom_time) . "', transferh_ReqAppAsom_user = '" . addslashes($server_transferh_ReqAppAsom_user) . "', transferh_Posting_time = '" . addslashes($server_transferh_Posting_time) . "', transferh_PostingDate = '" . addslashes($server_transferh_PostingDate) . "', transferh_PostingBy = '" . addslashes($server_transferh_PostingBy) . "', transferh_AppCode = '" . addslashes($server_transferh_AppCode) . "', transferh_ReqAppAsom_comment = '" . addslashes($server_transferh_ReqAppAsom_comment) . "', transferh_AppAsom_comment = '" . addslashes($server_transferh_AppAsom_comment) . "' WHERE transferh_headerID = " . $server_transferh_headerID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE transferh_header=>' . $err_msg;
echo "\n";
echo 'server_transferh_headerID=>' . $server_transferh_headerID;
echo "\n";
echo 'UPDATE transferh_header=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'stockadjh_header')
{
echo "\n";
echo 'Sebelum stockadjh_header=>' . $err_msg;
echo "\n";
list($server_stockadjh_headerID, $server_stockadjh_create_user, $server_stockadjh_create_time, $server_stockadjh_edit_user, $server_stockadjh_edit_time, $server_stockadjh_ip, $server_stockadjh_SysTrxId, $server_stockadjh_Active, $server_stockadjh_Approve, $server_stockadjh_SyncronizeDate, $server_stockadjh_LastExportDate, $server_stockadjh_TotalImported, $server_stockadjh_TotalExported, $server_stockadjh_LastUpdateStamp, $server_stockadjh_idRow, $server_stockadjh_AdjustmentNo, $server_stockadjh_AdjustmentDate, $server_stockadjh_ReferenceNo, $server_stockadjh_Description, $server_stockadjh_PostingDate, $server_stockadjh_PostingBy, $server_stockadjh_SF_Adjustment, $server_stockadjh_Deleteable, $server_stockadjh_Forensic, $server_stockadjh_PortfolioCd, $server_stockadjh_Sub_PortfolioCd, $server_stockadjh__dihapus, $server_stockadjh__dihapus_time, $server_stockadjh_PStatus, $server_stockadjh_periode, $server_stockadjh_picklisth_headerID, $server_stockadjh_stockopnameh_headerID) = explode('`', $line);
if ($server_stockadjh_Active == '') $server_stockadjh_Active = 'No';
if ($server_stockadjh_Approve == '') $server_stockadjh_Approve = 0;
if ($server_stockadjh_TotalImported == '') $server_stockadjh_TotalImported = 0;
if ($server_stockadjh_TotalExported == '') $server_stockadjh_TotalExported = 0;
if ($server_stockadjh_idRow == '') $server_stockadjh_idRow = 0;
if ($server_stockadjh_AdjustmentDate == '') $server_stockadjh_AdjustmentDate = '1900-01-01';
if ($server_stockadjh_PostingDate == '') $server_stockadjh_PostingDate = '1900-01-01';
if ($server_stockadjh_Deleteable == '') $server_stockadjh_Deleteable = 'No';
if ($server_stockadjh__dihapus == '') $server_stockadjh__dihapus = 'No';
if ($server_stockadjh_picklisth_headerID == '') $server_stockadjh_picklisth_headerID = 0;
if ($server_stockadjh_stockopnameh_headerID == '') $server_stockadjh_stockopnameh_headerID = 0;
$stockadjh_headerID = 0;
$koneksi_stockadjh_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT stockadjh_headerID, stockadjh_LastUpdateStamp FROM stockadjh_header where stockadjh_headerID = " . $server_stockadjh_headerID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$stockadjh_headerID = $row_koneksi['stockadjh_headerID'];
$koneksi_stockadjh_LastUpdateStamp = $row_koneksi['stockadjh_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($stockadjh_headerID == 0)
{
$sql_insert = "INSERT INTO stockadjh_header SET stockadjh_headerID = '" . addslashes($server_stockadjh_headerID) . "', stockadjh_create_user = '" . addslashes($server_stockadjh_create_user) . "', stockadjh_create_time = '" . addslashes($server_stockadjh_create_time) . "', stockadjh_edit_user = '" . addslashes($server_stockadjh_edit_user) . "', stockadjh_edit_time = '" . addslashes($server_stockadjh_edit_time) . "', stockadjh_ip = '" . addslashes($server_stockadjh_ip) . "', stockadjh_SysTrxId = '" . addslashes($server_stockadjh_SysTrxId) . "', stockadjh_Active = '" . addslashes($server_stockadjh_Active) . "', stockadjh_Approve = '" . addslashes($server_stockadjh_Approve) . "', stockadjh_SyncronizeDate = '" . addslashes($server_stockadjh_SyncronizeDate) . "', stockadjh_LastExportDate = '" . addslashes($server_stockadjh_LastExportDate) . "', stockadjh_TotalImported = '" . addslashes($server_stockadjh_TotalImported) . "', stockadjh_TotalExported = '" . addslashes($server_stockadjh_TotalExported) . "', stockadjh_LastUpdateStamp = '" . addslashes($server_stockadjh_LastUpdateStamp) . "', stockadjh_idRow = '" . addslashes($server_stockadjh_idRow) . "', stockadjh_AdjustmentNo = '" . addslashes($server_stockadjh_AdjustmentNo) . "', stockadjh_AdjustmentDate = '" . addslashes($server_stockadjh_AdjustmentDate) . "', stockadjh_ReferenceNo = '" . addslashes($server_stockadjh_ReferenceNo) . "', stockadjh_Description = '" . addslashes($server_stockadjh_Description) . "', stockadjh_PostingDate = '" . addslashes($server_stockadjh_PostingDate) . "', stockadjh_PostingBy = '" . addslashes($server_stockadjh_PostingBy) . "', stockadjh_SF_Adjustment = '" . addslashes($server_stockadjh_SF_Adjustment) . "', stockadjh_Deleteable = '" . addslashes($server_stockadjh_Deleteable) . "', stockadjh_Forensic = '" . addslashes($server_stockadjh_Forensic) . "', stockadjh_PortfolioCd = '" . addslashes($server_stockadjh_PortfolioCd) . "', stockadjh_Sub_PortfolioCd = '" . addslashes($server_stockadjh_Sub_PortfolioCd) . "', stockadjh__dihapus = '" . addslashes($server_stockadjh__dihapus) . "', stockadjh__dihapus_time = '" . addslashes($server_stockadjh__dihapus_time) . "', stockadjh_PStatus = '" . addslashes($server_stockadjh_PStatus) . "', stockadjh_periode = '" . addslashes($server_stockadjh_periode) . "', stockadjh_picklisth_headerID = '" . addslashes($server_stockadjh_picklisth_headerID) . "', stockadjh_stockopnameh_headerID = '" . addslashes($server_stockadjh_stockopnameh_headerID) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert stockadjh_header=>' . $err_msg;
echo "\n";
echo 'server_stockadjh_headerID=>' . $server_stockadjh_headerID;
echo "\n";
echo 'Insert stockadjh_header=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE stockadjh_header SET stockadjh_create_user = '" . addslashes($server_stockadjh_create_user) . "', stockadjh_create_time = '" . addslashes($server_stockadjh_create_time) . "', stockadjh_edit_user = '" . addslashes($server_stockadjh_edit_user) . "', stockadjh_edit_time = '" . addslashes($server_stockadjh_edit_time) . "', stockadjh_ip = '" . addslashes($server_stockadjh_ip) . "', stockadjh_SysTrxId = '" . addslashes($server_stockadjh_SysTrxId) . "', stockadjh_Active = '" . addslashes($server_stockadjh_Active) . "', stockadjh_Approve = '" . addslashes($server_stockadjh_Approve) . "', stockadjh_SyncronizeDate = '" . addslashes($server_stockadjh_SyncronizeDate) . "', stockadjh_LastExportDate = '" . addslashes($server_stockadjh_LastExportDate) . "', stockadjh_TotalImported = '" . addslashes($server_stockadjh_TotalImported) . "', stockadjh_TotalExported = '" . addslashes($server_stockadjh_TotalExported) . "', stockadjh_LastUpdateStamp = '" . addslashes($server_stockadjh_LastUpdateStamp) . "', stockadjh_idRow = '" . addslashes($server_stockadjh_idRow) . "', stockadjh_AdjustmentNo = '" . addslashes($server_stockadjh_AdjustmentNo) . "', stockadjh_AdjustmentDate = '" . addslashes($server_stockadjh_AdjustmentDate) . "', stockadjh_ReferenceNo = '" . addslashes($server_stockadjh_ReferenceNo) . "', stockadjh_Description = '" . addslashes($server_stockadjh_Description) . "', stockadjh_PostingDate = '" . addslashes($server_stockadjh_PostingDate) . "', stockadjh_PostingBy = '" . addslashes($server_stockadjh_PostingBy) . "', stockadjh_SF_Adjustment = '" . addslashes($server_stockadjh_SF_Adjustment) . "', stockadjh_Deleteable = '" . addslashes($server_stockadjh_Deleteable) . "', stockadjh_Forensic = '" . addslashes($server_stockadjh_Forensic) . "', stockadjh_PortfolioCd = '" . addslashes($server_stockadjh_PortfolioCd) . "', stockadjh_Sub_PortfolioCd = '" . addslashes($server_stockadjh_Sub_PortfolioCd) . "', stockadjh__dihapus = '" . addslashes($server_stockadjh__dihapus) . "', stockadjh__dihapus_time = '" . addslashes($server_stockadjh__dihapus_time) . "', stockadjh_PStatus = '" . addslashes($server_stockadjh_PStatus) . "', stockadjh_periode = '" . addslashes($server_stockadjh_periode) . "', stockadjh_picklisth_headerID = '" . addslashes($server_stockadjh_picklisth_headerID) . "', stockadjh_stockopnameh_headerID = '" . addslashes($server_stockadjh_stockopnameh_headerID) . "' WHERE stockadjh_headerID = " . $server_stockadjh_headerID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE stockadjh_header=>' . $err_msg;
echo "\n";
echo 'server_stockadjh_headerID=>' . $server_stockadjh_headerID;
echo "\n";
echo 'UPDATE stockadjh_header=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'add_mstr')
{
echo "\n";
echo 'Sebelum add_mstr=>' . $err_msg;
echo "\n";
list($server_add_mstrID, $server_add_create_user, $server_add_create_time, $server_add_edit_user, $server_add_edit_time, $server_add_ip, $server_add_SysTrxId, $server_add_Active, $server_add_Approve, $server_add_SyncronizeDate, $server_add_LastExportDate, $server_add_TotalImported, $server_add_TotalExported, $server_add_LastUpdateStamp, $server_add_idRow, $server_add_ContactCd, $server_add_AddressCd, $server_add_Description, $server_add_AddressInitial, $server_add_AddressTypeCd, $server_add_Address1, $server_add_Address2, $server_add_Address3, $server_add_RegionCd, $server_add_AreaCd, $server_add_ZipCode, $server_add_PhoneNo, $server_add_FaxNo, $server_add_CellPhone1, $server_add_CellPhone2, $server_add_Email, $server_add_PinBB, $server_add_SF_ContactAddress, $server_add_BillingStatus, $server_add_MailingStatus, $server_add_TaxStatus, $server_add_CreditLimit, $server_add_SalutationCd, $server_add_Attention, $server_add_Deleteable, $server_add_Forensic, $server_add_PortfolioCd, $server_add_Sub_PortfolioCd, $server_add_contact_mstrID, $server_add_region_mstrID, $server_add_area_mstrID, $server_add_addt_typeID, $server_add__dihapus, $server_add__dihapus_time, $server_add_CityCd, $server_add_hierarchicallandci_cityID, $server_add_CountryCd, $server_add_hierarchicallandc_coutryID, $server_add_productjasa_mstrID, $server_add_jenisPJ, $server_add_Jabatan) = explode('`', $line);
if ($server_add_Active == '') $server_add_Active = 'No';
if ($server_add_Approve == '') $server_add_Approve = 0;
if ($server_add_TotalImported == '') $server_add_TotalImported = 0;
if ($server_add_TotalExported == '') $server_add_TotalExported = 0;
if ($server_add_idRow == '') $server_add_idRow = 0;
if ($server_add_BillingStatus == '') $server_add_BillingStatus = 'No';
if ($server_add_MailingStatus == '') $server_add_MailingStatus = 'No';
if ($server_add_TaxStatus == '') $server_add_TaxStatus = 'No';
if ($server_add_CreditLimit == '') $server_add_CreditLimit = 0;
if ($server_add_Deleteable == '') $server_add_Deleteable = 'No';
if ($server_add_contact_mstrID == '') $server_add_contact_mstrID = 0;
if ($server_add_region_mstrID == '') $server_add_region_mstrID = 0;
if ($server_add_area_mstrID == '') $server_add_area_mstrID = 0;
if ($server_add_addt_typeID == '') $server_add_addt_typeID = 0;
if ($server_add__dihapus == '') $server_add__dihapus = 'No';
if ($server_add_hierarchicallandci_cityID == '') $server_add_hierarchicallandci_cityID = 0;
if ($server_add_hierarchicallandc_coutryID == '') $server_add_hierarchicallandc_coutryID = 0;
if ($server_add_productjasa_mstrID == '') $server_add_productjasa_mstrID = 0;
$add_mstrID = 0;
$koneksi_add_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT add_mstrID, add_LastUpdateStamp FROM add_mstr where add_mstrID = " . $server_add_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$add_mstrID = $row_koneksi['add_mstrID'];
$koneksi_add_LastUpdateStamp = $row_koneksi['add_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($add_mstrID == 0)
{
$sql_delete = "DELETE FROM add_mstr where add_ContactCd = '" . addslashes($server_add_ContactCd) . "' and add_AddressCd = '" . addslashes($server_add_AddressCd) . "' and add__dihapus_time = '" . addslashes($server_add__dihapus_time) . "' and add_Sub_PortfolioCd = '" . addslashes($server_add_Sub_PortfolioCd) . "' and add_contact_mstrID = " . addslashes($server_add_contact_mstrID) . " and add_region_mstrID = " . addslashes($server_add_region_mstrID) . " and add_area_mstrID = " . addslashes($server_add_area_mstrID) . " and add_addt_typeID = " . $server_add_addt_typeID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_insert = "INSERT INTO add_mstr SET add_mstrID = '" . addslashes($server_add_mstrID) . "', add_create_user = '" . addslashes($server_add_create_user) . "', add_create_time = '" . addslashes($server_add_create_time) . "', add_edit_user = '" . addslashes($server_add_edit_user) . "', add_edit_time = '" . addslashes($server_add_edit_time) . "', add_ip = '" . addslashes($server_add_ip) . "', add_SysTrxId = '" . addslashes($server_add_SysTrxId) . "', add_Active = '" . addslashes($server_add_Active) . "', add_Approve = '" . addslashes($server_add_Approve) . "', add_SyncronizeDate = '" . addslashes($server_add_SyncronizeDate) . "', add_LastExportDate = '" . addslashes($server_add_LastExportDate) . "', add_TotalImported = '" . addslashes($server_add_TotalImported) . "', add_TotalExported = '" . addslashes($server_add_TotalExported) . "', add_LastUpdateStamp = '" . addslashes($server_add_LastUpdateStamp) . "', add_idRow = '" . addslashes($server_add_idRow) . "', add_ContactCd = '" . addslashes($server_add_ContactCd) . "', add_AddressCd = '" . addslashes($server_add_AddressCd) . "', add_Description = '" . addslashes($server_add_Description) . "', add_AddressInitial = '" . addslashes($server_add_AddressInitial) . "', add_AddressTypeCd = '" . addslashes($server_add_AddressTypeCd) . "', add_Address1 = '" . addslashes($server_add_Address1) . "', add_Address2 = '" . addslashes($server_add_Address2) . "', add_Address3 = '" . addslashes($server_add_Address3) . "', add_RegionCd = '" . addslashes($server_add_RegionCd) . "', add_AreaCd = '" . addslashes($server_add_AreaCd) . "', add_ZipCode = '" . addslashes($server_add_ZipCode) . "', add_PhoneNo = '" . addslashes($server_add_PhoneNo) . "', add_FaxNo = '" . addslashes($server_add_FaxNo) . "', add_CellPhone1 = '" . addslashes($server_add_CellPhone1) . "', add_CellPhone2 = '" . addslashes($server_add_CellPhone2) . "', add_Email = '" . addslashes($server_add_Email) . "', add_PinBB = '" . addslashes($server_add_PinBB) . "', add_SF_ContactAddress = '" . addslashes($server_add_SF_ContactAddress) . "', add_BillingStatus = '" . addslashes($server_add_BillingStatus) . "', add_MailingStatus = '" . addslashes($server_add_MailingStatus) . "', add_TaxStatus = '" . addslashes($server_add_TaxStatus) . "', add_CreditLimit = '" . addslashes($server_add_CreditLimit) . "', add_SalutationCd = '" . addslashes($server_add_SalutationCd) . "', add_Attention = '" . addslashes($server_add_Attention) . "', add_Deleteable = '" . addslashes($server_add_Deleteable) . "', add_Forensic = '" . addslashes($server_add_Forensic) . "', add_PortfolioCd = '" . addslashes($server_add_PortfolioCd) . "', add_Sub_PortfolioCd = '" . addslashes($server_add_Sub_PortfolioCd) . "', add_contact_mstrID = '" . addslashes($server_add_contact_mstrID) . "', add_region_mstrID = '" . addslashes($server_add_region_mstrID) . "', add_area_mstrID = '" . addslashes($server_add_area_mstrID) . "', add_addt_typeID = '" . addslashes($server_add_addt_typeID) . "', add__dihapus = '" . addslashes($server_add__dihapus) . "', add__dihapus_time = '" . addslashes($server_add__dihapus_time) . "', add_CityCd = '" . addslashes($server_add_CityCd) . "', add_hierarchicallandci_cityID = '" . addslashes($server_add_hierarchicallandci_cityID) . "', add_CountryCd = '" . addslashes($server_add_CountryCd) . "', add_hierarchicallandc_coutryID = '" . addslashes($server_add_hierarchicallandc_coutryID) . "', add_productjasa_mstrID = '" . addslashes($server_add_productjasa_mstrID) . "', add_jenisPJ = '" . addslashes($server_add_jenisPJ) . "', add_Jabatan = '" . addslashes($server_add_Jabatan) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert add_mstr=>' . $err_msg;
echo "\n";
echo 'server_add_mstrID=>' . $server_add_mstrID;
echo "\n";
echo 'Insert add_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE add_mstr SET add_create_user = '" . addslashes($server_add_create_user) . "', add_create_time = '" . addslashes($server_add_create_time) . "', add_edit_user = '" . addslashes($server_add_edit_user) . "', add_edit_time = '" . addslashes($server_add_edit_time) . "', add_ip = '" . addslashes($server_add_ip) . "', add_SysTrxId = '" . addslashes($server_add_SysTrxId) . "', add_Active = '" . addslashes($server_add_Active) . "', add_Approve = '" . addslashes($server_add_Approve) . "', add_SyncronizeDate = '" . addslashes($server_add_SyncronizeDate) . "', add_LastExportDate = '" . addslashes($server_add_LastExportDate) . "', add_TotalImported = '" . addslashes($server_add_TotalImported) . "', add_TotalExported = '" . addslashes($server_add_TotalExported) . "', add_LastUpdateStamp = '" . addslashes($server_add_LastUpdateStamp) . "', add_idRow = '" . addslashes($server_add_idRow) . "', add_ContactCd = '" . addslashes($server_add_ContactCd) . "', add_AddressCd = '" . addslashes($server_add_AddressCd) . "', add_Description = '" . addslashes($server_add_Description) . "', add_AddressInitial = '" . addslashes($server_add_AddressInitial) . "', add_AddressTypeCd = '" . addslashes($server_add_AddressTypeCd) . "', add_Address1 = '" . addslashes($server_add_Address1) . "', add_Address2 = '" . addslashes($server_add_Address2) . "', add_Address3 = '" . addslashes($server_add_Address3) . "', add_RegionCd = '" . addslashes($server_add_RegionCd) . "', add_AreaCd = '" . addslashes($server_add_AreaCd) . "', add_ZipCode = '" . addslashes($server_add_ZipCode) . "', add_PhoneNo = '" . addslashes($server_add_PhoneNo) . "', add_FaxNo = '" . addslashes($server_add_FaxNo) . "', add_CellPhone1 = '" . addslashes($server_add_CellPhone1) . "', add_CellPhone2 = '" . addslashes($server_add_CellPhone2) . "', add_Email = '" . addslashes($server_add_Email) . "', add_PinBB = '" . addslashes($server_add_PinBB) . "', add_SF_ContactAddress = '" . addslashes($server_add_SF_ContactAddress) . "', add_BillingStatus = '" . addslashes($server_add_BillingStatus) . "', add_MailingStatus = '" . addslashes($server_add_MailingStatus) . "', add_TaxStatus = '" . addslashes($server_add_TaxStatus) . "', add_CreditLimit = '" . addslashes($server_add_CreditLimit) . "', add_SalutationCd = '" . addslashes($server_add_SalutationCd) . "', add_Attention = '" . addslashes($server_add_Attention) . "', add_Deleteable = '" . addslashes($server_add_Deleteable) . "', add_Forensic = '" . addslashes($server_add_Forensic) . "', add_PortfolioCd = '" . addslashes($server_add_PortfolioCd) . "', add_Sub_PortfolioCd = '" . addslashes($server_add_Sub_PortfolioCd) . "', add_contact_mstrID = '" . addslashes($server_add_contact_mstrID) . "', add_region_mstrID = '" . addslashes($server_add_region_mstrID) . "', add_area_mstrID = '" . addslashes($server_add_area_mstrID) . "', add_addt_typeID = '" . addslashes($server_add_addt_typeID) . "', add__dihapus = '" . addslashes($server_add__dihapus) . "', add__dihapus_time = '" . addslashes($server_add__dihapus_time) . "', add_CityCd = '" . addslashes($server_add_CityCd) . "', add_hierarchicallandci_cityID = '" . addslashes($server_add_hierarchicallandci_cityID) . "', add_CountryCd = '" . addslashes($server_add_CountryCd) . "', add_hierarchicallandc_coutryID = '" . addslashes($server_add_hierarchicallandc_coutryID) . "', add_productjasa_mstrID = '" . addslashes($server_add_productjasa_mstrID) . "', add_jenisPJ = '" . addslashes($server_add_jenisPJ) . "', add_Jabatan = '" . addslashes($server_add_Jabatan) . "' WHERE add_mstrID = " . $server_add_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE add_mstr=>' . $err_msg;
echo "\n";
echo 'server_add_mstrID=>' . $server_add_mstrID;
echo "\n";
echo 'UPDATE add_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'member_mstr')
{
echo "\n";
echo 'Sebelum member_mstr=>' . $err_msg;
echo "\n";
list($server_member_mstrID, $server_member_create_user, $server_member_create_time, $server_member_edit_user, $server_member_edit_time, $server_member_ip, $server_member_SysTrxId, $server_member_Active, $server_member_Approve, $server_member_SyncronizeDate, $server_member_LastExportDate, $server_member_TotalImported, $server_member_TotalExported, $server_member_LastUpdateStamp, $server_member_idRow, $server_member_MemberCd, $server_member_TempMemberCd, $server_member_Barcode, $server_member_FromDate, $server_member_ToDate, $server_member_MemberTypeCd, $server_member_ContactCd, $server_member_PointReward, $server_member_RedeemPoint, $server_member_LastTransDate, $server_member_LastTansAmount, $server_member_SF_Member, $server_member_Deleteable, $server_member_Forensic, $server_member_PortfolioCd, $server_member_Sub_PortfolioCd, $server_member_contact_mstrID, $server_member_membert_typeID, $server_member__dihapus, $server_member__dihapus_time, $server_member_loc_mstrID, $server_member_LocationCd, $server_member_LocPickCardloc_mstrID, $server_member_LocPickCardLocationCd, $server_member_tgl_lahir, $server_member_Whatsapp, $server_member_email, $server_member_nama, $server_member_password, $server_member_email_cek, $server_member_email_lama, $server_member_email_api) = explode('`', $line);
if ($server_member_Active == '') $server_member_Active = 'No';
if ($server_member_Approve == '') $server_member_Approve = 0;
if ($server_member_TotalImported == '') $server_member_TotalImported = 0;
if ($server_member_TotalExported == '') $server_member_TotalExported = 0;
if ($server_member_idRow == '') $server_member_idRow = 0;
if ($server_member_FromDate == '') $server_member_FromDate = '1900-01-01';
if ($server_member_ToDate == '') $server_member_ToDate = '2999-01-01';
if ($server_member_PointReward == '') $server_member_PointReward = 0;
if ($server_member_RedeemPoint == '') $server_member_RedeemPoint = 0;
if ($server_member_LastTransDate == '') $server_member_LastTransDate = '1900-01-01';
if ($server_member_LastTansAmount == '') $server_member_LastTansAmount = 0;
if ($server_member_Deleteable == '') $server_member_Deleteable = 'No';
if ($server_member_contact_mstrID == '') $server_member_contact_mstrID = 0;
if ($server_member_membert_typeID == '') $server_member_membert_typeID = 0;
if ($server_member__dihapus == '') $server_member__dihapus = 'No';
if ($server_member_loc_mstrID == '') $server_member_loc_mstrID = 0;
if ($server_member_LocPickCardloc_mstrID == '') $server_member_LocPickCardloc_mstrID = 0;
if ($server_member_tgl_lahir == '') $server_member_tgl_lahir = '1900-01-01';
if ($server_member_email_cek == '') $server_member_email_cek = 'No';
$member_mstrID = 0;
$koneksi_member_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT member_mstrID, member_LastUpdateStamp FROM member_mstr where member_mstrID = " . $server_member_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$member_mstrID = $row_koneksi['member_mstrID'];
$koneksi_member_LastUpdateStamp = $row_koneksi['member_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($member_mstrID == 0)
{
$sql_insert = "INSERT INTO member_mstr SET member_mstrID = '" . addslashes($server_member_mstrID) . "', member_create_user = '" . addslashes($server_member_create_user) . "', member_create_time = '" . addslashes($server_member_create_time) . "', member_edit_user = '" . addslashes($server_member_edit_user) . "', member_edit_time = '" . addslashes($server_member_edit_time) . "', member_ip = '" . addslashes($server_member_ip) . "', member_SysTrxId = '" . addslashes($server_member_SysTrxId) . "', member_Active = '" . addslashes($server_member_Active) . "', member_Approve = '" . addslashes($server_member_Approve) . "', member_SyncronizeDate = '" . addslashes($server_member_SyncronizeDate) . "', member_LastExportDate = '" . addslashes($server_member_LastExportDate) . "', member_TotalImported = '" . addslashes($server_member_TotalImported) . "', member_TotalExported = '" . addslashes($server_member_TotalExported) . "', member_LastUpdateStamp = '" . addslashes($server_member_LastUpdateStamp) . "', member_idRow = '" . addslashes($server_member_idRow) . "', member_MemberCd = '" . addslashes($server_member_MemberCd) . "', member_TempMemberCd = '" . addslashes($server_member_TempMemberCd) . "', member_Barcode = '" . addslashes($server_member_Barcode) . "', member_FromDate = '" . addslashes($server_member_FromDate) . "', member_ToDate = '" . addslashes($server_member_ToDate) . "', member_MemberTypeCd = '" . addslashes($server_member_MemberTypeCd) . "', member_ContactCd = '" . addslashes($server_member_ContactCd) . "', member_PointReward = '" . addslashes($server_member_PointReward) . "', member_RedeemPoint = '" . addslashes($server_member_RedeemPoint) . "', member_LastTransDate = '" . addslashes($server_member_LastTransDate) . "', member_LastTansAmount = '" . addslashes($server_member_LastTansAmount) . "', member_SF_Member = '" . addslashes($server_member_SF_Member) . "', member_Deleteable = '" . addslashes($server_member_Deleteable) . "', member_Forensic = '" . addslashes($server_member_Forensic) . "', member_PortfolioCd = '" . addslashes($server_member_PortfolioCd) . "', member_Sub_PortfolioCd = '" . addslashes($server_member_Sub_PortfolioCd) . "', member_contact_mstrID = '" . addslashes($server_member_contact_mstrID) . "', member_membert_typeID = '" . addslashes($server_member_membert_typeID) . "', member__dihapus = '" . addslashes($server_member__dihapus) . "', member__dihapus_time = '" . addslashes($server_member__dihapus_time) . "', member_loc_mstrID = '" . addslashes($server_member_loc_mstrID) . "', member_LocationCd = '" . addslashes($server_member_LocationCd) . "', member_LocPickCardloc_mstrID = '" . addslashes($server_member_LocPickCardloc_mstrID) . "', member_LocPickCardLocationCd = '" . addslashes($server_member_LocPickCardLocationCd) . "', member_tgl_lahir = '" . addslashes($server_member_tgl_lahir) . "', member_Whatsapp = '" . addslashes($server_member_Whatsapp) . "', member_email = '" . addslashes($server_member_email) . "', member_nama = '" . addslashes($server_member_nama) . "', member_password = '" . addslashes($server_member_password) . "', member_email_cek = '" . addslashes($server_member_email_cek) . "', member_email_lama = '" . addslashes($server_member_email_lama) . "', member_email_api = '" . addslashes($server_member_email_api) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert member_mstr=>' . $err_msg;
echo "\n";
echo 'server_member_mstrID=>' . $server_member_mstrID;
echo "\n";
echo 'Insert member_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE member_mstr SET member_create_user = '" . addslashes($server_member_create_user) . "', member_create_time = '" . addslashes($server_member_create_time) . "', member_edit_user = '" . addslashes($server_member_edit_user) . "', member_edit_time = '" . addslashes($server_member_edit_time) . "', member_ip = '" . addslashes($server_member_ip) . "', member_SysTrxId = '" . addslashes($server_member_SysTrxId) . "', member_Active = '" . addslashes($server_member_Active) . "', member_Approve = '" . addslashes($server_member_Approve) . "', member_SyncronizeDate = '" . addslashes($server_member_SyncronizeDate) . "', member_LastExportDate = '" . addslashes($server_member_LastExportDate) . "', member_TotalImported = '" . addslashes($server_member_TotalImported) . "', member_TotalExported = '" . addslashes($server_member_TotalExported) . "', member_LastUpdateStamp = '" . addslashes($server_member_LastUpdateStamp) . "', member_idRow = '" . addslashes($server_member_idRow) . "', member_MemberCd = '" . addslashes($server_member_MemberCd) . "', member_TempMemberCd = '" . addslashes($server_member_TempMemberCd) . "', member_Barcode = '" . addslashes($server_member_Barcode) . "', member_FromDate = '" . addslashes($server_member_FromDate) . "', member_ToDate = '" . addslashes($server_member_ToDate) . "', member_MemberTypeCd = '" . addslashes($server_member_MemberTypeCd) . "', member_ContactCd = '" . addslashes($server_member_ContactCd) . "', member_PointReward = '" . addslashes($server_member_PointReward) . "', member_RedeemPoint = '" . addslashes($server_member_RedeemPoint) . "', member_LastTransDate = '" . addslashes($server_member_LastTransDate) . "', member_LastTansAmount = '" . addslashes($server_member_LastTansAmount) . "', member_SF_Member = '" . addslashes($server_member_SF_Member) . "', member_Deleteable = '" . addslashes($server_member_Deleteable) . "', member_Forensic = '" . addslashes($server_member_Forensic) . "', member_PortfolioCd = '" . addslashes($server_member_PortfolioCd) . "', member_Sub_PortfolioCd = '" . addslashes($server_member_Sub_PortfolioCd) . "', member_contact_mstrID = '" . addslashes($server_member_contact_mstrID) . "', member_membert_typeID = '" . addslashes($server_member_membert_typeID) . "', member__dihapus = '" . addslashes($server_member__dihapus) . "', member__dihapus_time = '" . addslashes($server_member__dihapus_time) . "', member_loc_mstrID = '" . addslashes($server_member_loc_mstrID) . "', member_LocationCd = '" . addslashes($server_member_LocationCd) . "', member_LocPickCardloc_mstrID = '" . addslashes($server_member_LocPickCardloc_mstrID) . "', member_LocPickCardLocationCd = '" . addslashes($server_member_LocPickCardLocationCd) . "', member_tgl_lahir = '" . addslashes($server_member_tgl_lahir) . "', member_Whatsapp = '" . addslashes($server_member_Whatsapp) . "', member_email = '" . addslashes($server_member_email) . "', member_nama = '" . addslashes($server_member_nama) . "', member_password = '" . addslashes($server_member_password) . "', member_email_cek = '" . addslashes($server_member_email_cek) . "', member_email_lama = '" . addslashes($server_member_email_lama) . "', member_email_api = '" . addslashes($server_member_email_api) . "' WHERE member_mstrID = " . $server_member_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE member_mstr=>' . $err_msg;
echo "\n";
echo 'server_member_mstrID=>' . $server_member_mstrID;
echo "\n";
echo 'UPDATE member_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'voucherd_detail')
{
echo "\n";
echo 'Sebelum voucherd_detail=>' . $err_msg;
echo "\n";
list($server_voucherd_detailID, $server_voucherd_create_user, $server_voucherd_create_time, $server_voucherd_edit_user, $server_voucherd_edit_time, $server_voucherd_ip, $server_voucherd_SysTrxId, $server_voucherd_Active, $server_voucherd_Approve, $server_voucherd_SyncronizeDate, $server_voucherd_LastExportDate, $server_voucherd_TotalImported, $server_voucherd_TotalExported, $server_voucherd_LastUpdateStamp, $server_voucherd_idRow, $server_voucherd_CouponCD, $server_voucherd_SerialNo, $server_voucherd_SF_DetailCoupon, $server_voucherd_Deleteable, $server_voucherd_Forensic, $server_voucherd_PortfolioCd, $server_voucherd_Sub_PortfolioCd, $server_voucherd_loc_mstrID, $server_voucherd_salesh_headerID, $server_voucherd_voucherh_headerID, $server_voucherd__dihapus, $server_voucherd__dihapus_time, $server_voucherd_FromDate, $server_voucherd_ToDate, $server_voucherd_MemberCd, $server_voucherd_member_mstrID, $server_voucherd_SalesNo) = explode('`', $line);
if ($server_voucherd_Active == '') $server_voucherd_Active = 'No';
if ($server_voucherd_Approve == '') $server_voucherd_Approve = 0;
if ($server_voucherd_TotalImported == '') $server_voucherd_TotalImported = 0;
if ($server_voucherd_TotalExported == '') $server_voucherd_TotalExported = 0;
if ($server_voucherd_idRow == '') $server_voucherd_idRow = 0;
if ($server_voucherd_Deleteable == '') $server_voucherd_Deleteable = 'No';
if ($server_voucherd_loc_mstrID == '') $server_voucherd_loc_mstrID = 0;
if ($server_voucherd_salesh_headerID == '') $server_voucherd_salesh_headerID = 0;
if ($server_voucherd_voucherh_headerID == '') $server_voucherd_voucherh_headerID = 0;
if ($server_voucherd__dihapus == '') $server_voucherd__dihapus = 'No';
if ($server_voucherd_FromDate == '') $server_voucherd_FromDate = '1900-01-01';
if ($server_voucherd_ToDate == '') $server_voucherd_ToDate = '1900-01-01';
if ($server_voucherd_member_mstrID == '') $server_voucherd_member_mstrID = 0;
$voucherd_detailID = 0;
$koneksi_voucherd_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT voucherd_detailID, voucherd_LastUpdateStamp FROM voucherd_detail where voucherd_detailID = " . $server_voucherd_detailID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$voucherd_detailID = $row_koneksi['voucherd_detailID'];
$koneksi_voucherd_LastUpdateStamp = $row_koneksi['voucherd_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($voucherd_detailID == 0)
{
$sql_insert = "INSERT INTO voucherd_detail SET voucherd_detailID = '" . addslashes($server_voucherd_detailID) . "', voucherd_create_user = '" . addslashes($server_voucherd_create_user) . "', voucherd_create_time = '" . addslashes($server_voucherd_create_time) . "', voucherd_edit_user = '" . addslashes($server_voucherd_edit_user) . "', voucherd_edit_time = '" . addslashes($server_voucherd_edit_time) . "', voucherd_ip = '" . addslashes($server_voucherd_ip) . "', voucherd_SysTrxId = '" . addslashes($server_voucherd_SysTrxId) . "', voucherd_Active = '" . addslashes($server_voucherd_Active) . "', voucherd_Approve = '" . addslashes($server_voucherd_Approve) . "', voucherd_SyncronizeDate = '" . addslashes($server_voucherd_SyncronizeDate) . "', voucherd_LastExportDate = '" . addslashes($server_voucherd_LastExportDate) . "', voucherd_TotalImported = '" . addslashes($server_voucherd_TotalImported) . "', voucherd_TotalExported = '" . addslashes($server_voucherd_TotalExported) . "', voucherd_LastUpdateStamp = '" . addslashes($server_voucherd_LastUpdateStamp) . "', voucherd_idRow = '" . addslashes($server_voucherd_idRow) . "', voucherd_CouponCD = '" . addslashes($server_voucherd_CouponCD) . "', voucherd_SerialNo = '" . addslashes($server_voucherd_SerialNo) . "', voucherd_SF_DetailCoupon = '" . addslashes($server_voucherd_SF_DetailCoupon) . "', voucherd_Deleteable = '" . addslashes($server_voucherd_Deleteable) . "', voucherd_Forensic = '" . addslashes($server_voucherd_Forensic) . "', voucherd_PortfolioCd = '" . addslashes($server_voucherd_PortfolioCd) . "', voucherd_Sub_PortfolioCd = '" . addslashes($server_voucherd_Sub_PortfolioCd) . "', voucherd_loc_mstrID = '" . addslashes($server_voucherd_loc_mstrID) . "', voucherd_salesh_headerID = '" . addslashes($server_voucherd_salesh_headerID) . "', voucherd_voucherh_headerID = '" . addslashes($server_voucherd_voucherh_headerID) . "', voucherd__dihapus = '" . addslashes($server_voucherd__dihapus) . "', voucherd__dihapus_time = '" . addslashes($server_voucherd__dihapus_time) . "', voucherd_FromDate = '" . addslashes($server_voucherd_FromDate) . "', voucherd_ToDate = '" . addslashes($server_voucherd_ToDate) . "', voucherd_MemberCd = '" . addslashes($server_voucherd_MemberCd) . "', voucherd_member_mstrID = '" . addslashes($server_voucherd_member_mstrID) . "', voucherd_SalesNo = '" . addslashes($server_voucherd_SalesNo) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert voucherd_detail=>' . $err_msg;
echo "\n";
echo 'server_voucherd_detailID=>' . $server_voucherd_detailID;
echo "\n";
echo 'Insert voucherd_detail=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE voucherd_detail SET voucherd_create_user = '" . addslashes($server_voucherd_create_user) . "', voucherd_create_time = '" . addslashes($server_voucherd_create_time) . "', voucherd_edit_user = '" . addslashes($server_voucherd_edit_user) . "', voucherd_edit_time = '" . addslashes($server_voucherd_edit_time) . "', voucherd_ip = '" . addslashes($server_voucherd_ip) . "', voucherd_SysTrxId = '" . addslashes($server_voucherd_SysTrxId) . "', voucherd_Active = '" . addslashes($server_voucherd_Active) . "', voucherd_Approve = '" . addslashes($server_voucherd_Approve) . "', voucherd_SyncronizeDate = '" . addslashes($server_voucherd_SyncronizeDate) . "', voucherd_LastExportDate = '" . addslashes($server_voucherd_LastExportDate) . "', voucherd_TotalImported = '" . addslashes($server_voucherd_TotalImported) . "', voucherd_TotalExported = '" . addslashes($server_voucherd_TotalExported) . "', voucherd_LastUpdateStamp = '" . addslashes($server_voucherd_LastUpdateStamp) . "', voucherd_idRow = '" . addslashes($server_voucherd_idRow) . "', voucherd_CouponCD = '" . addslashes($server_voucherd_CouponCD) . "', voucherd_SerialNo = '" . addslashes($server_voucherd_SerialNo) . "', voucherd_SF_DetailCoupon = '" . addslashes($server_voucherd_SF_DetailCoupon) . "', voucherd_Deleteable = '" . addslashes($server_voucherd_Deleteable) . "', voucherd_Forensic = '" . addslashes($server_voucherd_Forensic) . "', voucherd_PortfolioCd = '" . addslashes($server_voucherd_PortfolioCd) . "', voucherd_Sub_PortfolioCd = '" . addslashes($server_voucherd_Sub_PortfolioCd) . "', voucherd_loc_mstrID = '" . addslashes($server_voucherd_loc_mstrID) . "', voucherd_salesh_headerID = '" . addslashes($server_voucherd_salesh_headerID) . "', voucherd_voucherh_headerID = '" . addslashes($server_voucherd_voucherh_headerID) . "', voucherd__dihapus = '" . addslashes($server_voucherd__dihapus) . "', voucherd__dihapus_time = '" . addslashes($server_voucherd__dihapus_time) . "', voucherd_FromDate = '" . addslashes($server_voucherd_FromDate) . "', voucherd_ToDate = '" . addslashes($server_voucherd_ToDate) . "', voucherd_MemberCd = '" . addslashes($server_voucherd_MemberCd) . "', voucherd_member_mstrID = '" . addslashes($server_voucherd_member_mstrID) . "', voucherd_SalesNo = '" . addslashes($server_voucherd_SalesNo) . "' WHERE voucherd_detailID = " . $server_voucherd_detailID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE voucherd_detail=>' . $err_msg;
echo "\n";
echo 'server_voucherd_detailID=>' . $server_voucherd_detailID;
echo "\n";
echo 'UPDATE voucherd_detail=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'voucherh_header')
{
list($server_voucherh_headerID, $server_voucherh_create_user, $server_voucherh_create_time, $server_voucherh_edit_user, $server_voucherh_edit_time, $server_voucherh_ip, $server_voucherh_SysTrxId, $server_voucherh_Active, $server_voucherh_Approve, $server_voucherh_SyncronizeDate, $server_voucherh_LastExportDate, $server_voucherh_TotalImported, $server_voucherh_TotalExported, $server_voucherh_LastUpdateStamp, $server_voucherh_idRow, $server_voucherh_CouponCD, $server_voucherh_CouponName, $server_voucherh_Description, $server_voucherh_FromDate, $server_voucherh_ToDate, $server_voucherh_IsWithPromo, $server_voucherh_CouponValue, $server_voucherh_CouponPersentage, $server_voucherh_CouponTypeCD, $server_voucherh_SF_Coupon, $server_voucherh_Deleteable, $server_voucherh_Forensic, $server_voucherh_PortfolioCd, $server_voucherh_Sub_PortfolioCd, $server_voucherh_coupon_typeID, $server_voucherh__dihapus, $server_voucherh__dihapus_time, $server_voucherh_fileexcel, $server_voucherh_UExcelStatus, $server_voucherh_PStatus, $server_voucherh_TotalPaymentToGet, $server_voucherh_TotalPaymentToUse, $server_voucherh_TotalPaymentToGet_IsMulty) = explode('`', $line);
if ($server_voucherh_Active == '') $server_voucherh_Active = 'No';
if ($server_voucherh_Approve == '') $server_voucherh_Approve = 0;
if ($server_voucherh_TotalImported == '') $server_voucherh_TotalImported = 0;
if ($server_voucherh_TotalExported == '') $server_voucherh_TotalExported = 0;
if ($server_voucherh_idRow == '') $server_voucherh_idRow = 0;
if ($server_voucherh_FromDate == '') $server_voucherh_FromDate = '1900-01-01';
if ($server_voucherh_ToDate == '') $server_voucherh_ToDate = '2999-01-01';
if ($server_voucherh_IsWithPromo == '') $server_voucherh_IsWithPromo = 'No';
if ($server_voucherh_CouponValue == '') $server_voucherh_CouponValue = 0;
if ($server_voucherh_CouponPersentage == '') $server_voucherh_CouponPersentage = 0;
if ($server_voucherh_Deleteable == '') $server_voucherh_Deleteable = 'No';
if ($server_voucherh_coupon_typeID == '') $server_voucherh_coupon_typeID = 0;
if ($server_voucherh__dihapus == '') $server_voucherh__dihapus = 'No';
if ($server_voucherh_UExcelStatus == '') $server_voucherh_UExcelStatus = 'none';
if ($server_voucherh_TotalPaymentToGet == '') $server_voucherh_TotalPaymentToGet = 0;
if ($server_voucherh_TotalPaymentToUse == '') $server_voucherh_TotalPaymentToUse = 0;
if ($server_voucherh_TotalPaymentToGet_IsMulty == '') $server_voucherh_TotalPaymentToGet_IsMulty = 'No';
if ($server_voucherh_TotalPaymentToUse_IsMulty == '') $server_voucherh_TotalPaymentToUse_IsMulty = 'No';
$voucherh_headerID = 0;
$koneksi_voucherh_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT voucherh_headerID, voucherh_LastUpdateStamp FROM voucherh_header where voucherh_headerID = " . $server_voucherh_headerID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$voucherh_headerID = $row_koneksi['voucherh_headerID'];
$koneksi_voucherh_LastUpdateStamp = $row_koneksi['voucherh_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($voucherh_headerID == 0)
{
$sql_insert = "INSERT INTO voucherh_header SET voucherh_headerID = '" . addslashes($server_voucherh_headerID) . "', voucherh_create_user = '" . addslashes($server_voucherh_create_user) . "', voucherh_create_time = '" . addslashes($server_voucherh_create_time) . "', voucherh_edit_user = '" . addslashes($server_voucherh_edit_user) . "', voucherh_edit_time = '" . addslashes($server_voucherh_edit_time) . "', voucherh_ip = '" . addslashes($server_voucherh_ip) . "', voucherh_SysTrxId = '" . addslashes($server_voucherh_SysTrxId) . "', voucherh_Active = '" . addslashes($server_voucherh_Active) . "', voucherh_Approve = '" . addslashes($server_voucherh_Approve) . "', voucherh_SyncronizeDate = '" . addslashes($server_voucherh_SyncronizeDate) . "', voucherh_LastExportDate = '" . addslashes($server_voucherh_LastExportDate) . "', voucherh_TotalImported = '" . addslashes($server_voucherh_TotalImported) . "', voucherh_TotalExported = '" . addslashes($server_voucherh_TotalExported) . "', voucherh_LastUpdateStamp = '" . addslashes($server_voucherh_LastUpdateStamp) . "', voucherh_idRow = '" . addslashes($server_voucherh_idRow) . "', voucherh_CouponCD = '" . addslashes($server_voucherh_CouponCD) . "', voucherh_CouponName = '" . addslashes($server_voucherh_CouponName) . "', voucherh_Description = '" . addslashes($server_voucherh_Description) . "', voucherh_FromDate = '" . addslashes($server_voucherh_FromDate) . "', voucherh_ToDate = '" . addslashes($server_voucherh_ToDate) . "', voucherh_IsWithPromo = '" . addslashes($server_voucherh_IsWithPromo) . "', voucherh_CouponValue = '" . addslashes($server_voucherh_CouponValue) . "', voucherh_CouponPersentage = '" . addslashes($server_voucherh_CouponPersentage) . "', voucherh_CouponTypeCD = '" . addslashes($server_voucherh_CouponTypeCD) . "', voucherh_SF_Coupon = '" . addslashes($server_voucherh_SF_Coupon) . "', voucherh_Deleteable = '" . addslashes($server_voucherh_Deleteable) . "', voucherh_Forensic = '" . addslashes($server_voucherh_Forensic) . "', voucherh_PortfolioCd = '" . addslashes($server_voucherh_PortfolioCd) . "', voucherh_Sub_PortfolioCd = '" . addslashes($server_voucherh_Sub_PortfolioCd) . "', voucherh_coupon_typeID = '" . addslashes($server_voucherh_coupon_typeID) . "', voucherh__dihapus = '" . addslashes($server_voucherh__dihapus) . "', voucherh__dihapus_time = '" . addslashes($server_voucherh__dihapus_time) . "', voucherh_fileexcel = '" . addslashes($server_voucherh_fileexcel) . "', voucherh_UExcelStatus = '" . addslashes($server_voucherh_UExcelStatus) . "', voucherh_PStatus = '" . addslashes($server_voucherh_PStatus) . "', voucherh_TotalPaymentToGet = '" . addslashes($server_voucherh_TotalPaymentToGet) . "', voucherh_TotalPaymentToUse = '" . addslashes($server_voucherh_TotalPaymentToUse) . "', voucherh_TotalPaymentToGet_IsMulty = '" . addslashes($server_voucherh_TotalPaymentToGet_IsMulty) . "', voucherh_TotalPaymentToUse_IsMulty = '" . addslashes($server_voucherh_TotalPaymentToUse_IsMulty) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'INSERT INTO voucherh_header=>' . $err_msg;
echo "\n";
echo 'server_voucherh_headerID=>' . $server_voucherh_headerID;
echo "\n";
echo 'INSERT INTO voucherh_header=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE voucherh_header SET voucherh_create_user = '" . addslashes($server_voucherh_create_user) . "', voucherh_create_time = '" . addslashes($server_voucherh_create_time) . "', voucherh_edit_user = '" . addslashes($server_voucherh_edit_user) . "', voucherh_edit_time = '" . addslashes($server_voucherh_edit_time) . "', voucherh_ip = '" . addslashes($server_voucherh_ip) . "', voucherh_SysTrxId = '" . addslashes($server_voucherh_SysTrxId) . "', voucherh_Active = '" . addslashes($server_voucherh_Active) . "', voucherh_Approve = '" . addslashes($server_voucherh_Approve) . "', voucherh_SyncronizeDate = '" . addslashes($server_voucherh_SyncronizeDate) . "', voucherh_LastExportDate = '" . addslashes($server_voucherh_LastExportDate) . "', voucherh_TotalImported = '" . addslashes($server_voucherh_TotalImported) . "', voucherh_TotalExported = '" . addslashes($server_voucherh_TotalExported) . "', voucherh_LastUpdateStamp = '" . addslashes($server_voucherh_LastUpdateStamp) . "', voucherh_idRow = '" . addslashes($server_voucherh_idRow) . "', voucherh_CouponCD = '" . addslashes($server_voucherh_CouponCD) . "', voucherh_CouponName = '" . addslashes($server_voucherh_CouponName) . "', voucherh_Description = '" . addslashes($server_voucherh_Description) . "', voucherh_FromDate = '" . addslashes($server_voucherh_FromDate) . "', voucherh_ToDate = '" . addslashes($server_voucherh_ToDate) . "', voucherh_IsWithPromo = '" . addslashes($server_voucherh_IsWithPromo) . "', voucherh_CouponValue = '" . addslashes($server_voucherh_CouponValue) . "', voucherh_CouponPersentage = '" . addslashes($server_voucherh_CouponPersentage) . "', voucherh_CouponTypeCD = '" . addslashes($server_voucherh_CouponTypeCD) . "', voucherh_SF_Coupon = '" . addslashes($server_voucherh_SF_Coupon) . "', voucherh_Deleteable = '" . addslashes($server_voucherh_Deleteable) . "', voucherh_Forensic = '" . addslashes($server_voucherh_Forensic) . "', voucherh_PortfolioCd = '" . addslashes($server_voucherh_PortfolioCd) . "', voucherh_Sub_PortfolioCd = '" . addslashes($server_voucherh_Sub_PortfolioCd) . "', voucherh_coupon_typeID = '" . addslashes($server_voucherh_coupon_typeID) . "', voucherh__dihapus = '" . addslashes($server_voucherh__dihapus) . "', voucherh__dihapus_time = '" . addslashes($server_voucherh__dihapus_time) . "', voucherh_fileexcel = '" . addslashes($server_voucherh_fileexcel) . "', voucherh_UExcelStatus = '" . addslashes($server_voucherh_UExcelStatus) . "', voucherh_PStatus = '" . addslashes($server_voucherh_PStatus) . "', voucherh_TotalPaymentToGet = '" . addslashes($server_voucherh_TotalPaymentToGet) . "', voucherh_TotalPaymentToUse = '" . addslashes($server_voucherh_TotalPaymentToUse) . "', voucherh_TotalPaymentToGet_IsMulty = '" . addslashes($server_voucherh_TotalPaymentToGet_IsMulty) . "', voucherh_TotalPaymentToUse_IsMulty = '" . addslashes($server_voucherh_TotalPaymentToUse_IsMulty) . "' WHERE voucherh_headerID = " . $server_voucherh_headerID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE voucherh_header=>' . $err_msg;
echo "\n";
echo 'server_voucherh_headerID=>' . $server_voucherh_headerID;
echo "\n";
echo 'UPDATE voucherh_headerr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'productitem_mstr')
{
list($server_productitem_mstrID, $server_productitem_create_user, $server_productitem_create_time, $server_productitem_edit_user, $server_productitem_edit_time, $server_productitem_ip, $server_productitem_SysTrxId, $server_productitem_Active, $server_productitem_Approve, $server_productitem_SyncronizeDate, $server_productitem_LastExportDate, $server_productitem_TotalImported, $server_productitem_TotalExported, $server_productitem_LastUpdateStamp, $server_productitem_idRow, $server_productitem_ItemCd, $server_productitem_ItemName, $server_productitem_ItemShortName, $server_productitem_Description, $server_productitem_StockingUOMCd, $server_productitem_BusinessUnitCd, $server_productitem_CountryCd, $server_productitem_BrandCd, $server_productitem_DepartmentCd, $server_productitem_CategoryCd, $server_productitem_subkategory_mstrID, $server_productitem_SubkategoryCd, $server_productitem_ClassCd, $server_productitem_MaterialCd, $server_productitem_Group1Cd, $server_productitem_Group2Cd, $server_productitem_Group3Cd, $server_productitem_Group4Cd, $server_productitem_Group5Cd, $server_productitem_Group6Cd, $server_productitem_Group7Cd, $server_productitem_Group8Cd, $server_productitem_CurrencyCd, $server_productitem_DefaultPrice, $server_productitem_StandartMargin, $server_productitem_StandartGP, $server_productitem_AllowManualDiscount, $server_productitem_AllowMemberDiscount, $server_productitem_AllowDisposal, $server_productitem_AllowZeroSellingPrice, $server_productitem_IsConsignment, $server_productitem_IsStock, $server_productitem_IsRecipe, $server_productitem_IsRowMaterial, $server_productitem_IsHomeDelivery, $server_productitem_IsInstallation, $server_productitem_Status, $server_productitem_ItemAccount, $server_productitem_HPPAccount, $server_productitem_OldItemCd, $server_productitem_SF_Item, $server_productitem_Forensic, $server_productitem_PortfolioCd, $server_productitem_Sub_PortfolioCd, $server_productitem_deletable, $server_productitem_businessunit_mstrID, $server_productitem_hierarchicallandc_coutryID, $server_productitem_department_mstrID, $server_productitem_rowmaterial_mstrID, $server_productitem_group1_mstrID, $server_productitem_group2_mstrID, $server_productitem_group3_mstrID, $server_productitem_group4_mstrID, $server_productitem_group5_mstrID, $server_productitem_group6_mstrID, $server_productitem_group7_mstrID, $server_productitem_group8_mstrID, $server_productitem_brand_mstrID, $server_productitem_category_mstrID, $server_productitem_class_mstrID, $server_productitem_Stockingmeasurement_uomID, $server_productitem__dihapus, $server_productitem__dihapus_time, $server_productitem_IsBOM, $server_productitem_picture, $server_productitem_currency_mstrID, $server_productitem_itmcd, $server_productitem_ada_PL, $server_productitem_Designercontact_mstrID, $server_productitem_DesignerContactName) = explode('`', $line);
if ($server_productitem_Active == '') $server_productitem_Active = 'No';
if ($server_productitem_Approve == '') $server_productitem_Approve = 0;
if ($server_productitem_TotalImported == '') $server_productitem_TotalImported = 0;
if ($server_productitem_TotalExported == '') $server_productitem_TotalExported = 0;
if ($server_productitem_idRow == '') $server_productitem_idRow = 0;
if ($server_productitem_subkategory_mstrID == '') $server_productitem_subkategory_mstrID = 0;
if ($server_productitem_DefaultPrice == '') $server_productitem_DefaultPrice = 0;
if ($server_productitem_StandartMargin == '') $server_productitem_StandartMargin = 0;
if ($server_productitem_StandartGP == '') $server_productitem_StandartGP = 0;
if ($server_productitem_AllowManualDiscount == '') $server_productitem_AllowManualDiscount = 'No';
if ($server_productitem_AllowMemberDiscount == '') $server_productitem_AllowMemberDiscount = 'No';
if ($server_productitem_AllowDisposal == '') $server_productitem_AllowDisposal = 'No';
if ($server_productitem_AllowZeroSellingPrice == '') $server_productitem_AllowZeroSellingPrice = 'No';
if ($server_productitem_IsConsignment == '') $server_productitem_IsConsignment = 'No';
if ($server_productitem_IsStock == '') $server_productitem_IsStock = 'No';
if ($server_productitem_IsRecipe == '') $server_productitem_IsRecipe = 'No';
if ($server_productitem_IsRowMaterial == '') $server_productitem_IsRowMaterial = 'No';
if ($server_productitem_IsHomeDelivery == '') $server_productitem_IsHomeDelivery = 'No';
if ($server_productitem_IsInstallation == '') $server_productitem_IsInstallation = 'No';
if ($server_productitem_deletable == '') $server_productitem_deletable = 'No';
if ($server_productitem_businessunit_mstrID == '') $server_productitem_businessunit_mstrID = 0;
if ($server_productitem_hierarchicallandc_coutryID == '') $server_productitem_hierarchicallandc_coutryID = 0;
if ($server_productitem_department_mstrID == '') $server_productitem_department_mstrID = 0;
if ($server_productitem_rowmaterial_mstrID == '') $server_productitem_rowmaterial_mstrID = 0;
if ($server_productitem_group1_mstrID == '') $server_productitem_group1_mstrID = 0;
if ($server_productitem_group2_mstrID == '') $server_productitem_group2_mstrID = 0;
if ($server_productitem_group3_mstrID == '') $server_productitem_group3_mstrID = 0;
if ($server_productitem_group4_mstrID == '') $server_productitem_group4_mstrID = 0;
if ($server_productitem_group5_mstrID == '') $server_productitem_group5_mstrID = 0;
if ($server_productitem_group6_mstrID == '') $server_productitem_group6_mstrID = 0;
if ($server_productitem_group7_mstrID == '') $server_productitem_group7_mstrID = 0;
if ($server_productitem_group8_mstrID == '') $server_productitem_group8_mstrID = 0;
if ($server_productitem_brand_mstrID == '') $server_productitem_brand_mstrID = 0;
if ($server_productitem_category_mstrID == '') $server_productitem_category_mstrID = 0;
if ($server_productitem_class_mstrID == '') $server_productitem_class_mstrID = 0;
if ($server_productitem_Stockingmeasurement_uomID == '') $server_productitem_Stockingmeasurement_uomID = 0;
if ($server_productitem__dihapus == '') $server_productitem__dihapus = 'No';
if ($server_productitem_IsBOM == '') $server_productitem_IsBOM = 'No';
if ($server_productitem_currency_mstrID == '') $server_productitem_currency_mstrID = 0;
if ($server_productitem_ada_PL == '') $server_productitem_ada_PL = 'No';
if ($server_productitem_Designercontact_mstrID == '') $server_productitem_Designercontact_mstrID = 0;
$productitem_mstrID = 0;
$koneksi_server_productitem_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT productitem_mstrID, productitem_LastUpdateStamp FROM productitem_mstr where productitem_mstrID = " . $server_productitem_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$productitem_mstrID = $row_koneksi['productitem_mstrID'];
$koneksi_server_productitem_LastUpdateStamp = $row_koneksi['productitem_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($productitem_mstrID == 0)
{
$sql_delete = "DELETE FROM productitem_mstr where productitem__dihapus_time = '" . $server_productitem__dihapus_time . "' and productitem_ItemCd = '" . $server_productitem_ItemCd . "' and productitem_Sub_PortfolioCd = '" . addslashes($server_productitem_Sub_PortfolioCd) . "' and productitem_rowmaterial_mstrID = " . addslashes($server_productitem_rowmaterial_mstrID) . " and productitem_brand_mstrID = " . $server_productitem_brand_mstrID . " and productitem_class_mstrID = " . $server_productitem_class_mstrID . " and productitem_Stockingmeasurement_uomID = " . $server_productitem_Stockingmeasurement_uomID . " and productitem_ItemName = '" . addslashes($server_productitem_ItemName) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg_delete = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_koneksi = "SELECT productitem_mstrID FROM productitem_mstr where productitem__dihapus_time = '" . $server_productitem__dihapus_time . "' and productitem_ItemCd = '" . $server_productitem_ItemCd . "' and productitem_Sub_PortfolioCd = '" . addslashes($server_productitem_Sub_PortfolioCd) . "' and productitem_rowmaterial_mstrID = " . $server_productitem_rowmaterial_mstrID . " and productitem_brand_mstrID = " . $server_productitem_brand_mstrID . " and productitem_class_mstrID = " . $server_productitem_class_mstrID . " and productitem_Stockingmeasurement_uomID = " . $server_productitem_Stockingmeasurement_uomID . " and productitem_ItemName = '" . addslashes($server_productitem_ItemName) . "'";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$sql_delete = "DELETE FROM productitem_mstr where productitem_mstrID = " . $row_koneksi['productitem_mstrID'];
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg_delete = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
mysqli_free_result($result_koneksi);
$sql_insert = "INSERT INTO productitem_mstr SET productitem_mstrID = '" . addslashes($server_productitem_mstrID) . "', productitem_create_user = '" . addslashes($server_productitem_create_user) . "', productitem_create_time = '" . addslashes($server_productitem_create_time) . "', productitem_edit_user = '" . addslashes($server_productitem_edit_user) . "', productitem_edit_time = '" . addslashes($server_productitem_edit_time) . "', productitem_ip = '" . addslashes($server_productitem_ip) . "', productitem_SysTrxId = '" . addslashes($server_productitem_SysTrxId) . "', productitem_Active = '" . addslashes($server_productitem_Active) . "', productitem_Approve = '" . addslashes($server_productitem_Approve) . "', productitem_SyncronizeDate = '" . addslashes($server_productitem_SyncronizeDate) . "', productitem_LastExportDate = '" . addslashes($server_productitem_LastExportDate) . "', productitem_TotalImported = '" . addslashes($server_productitem_TotalImported) . "', productitem_TotalExported = '" . addslashes($server_productitem_TotalExported) . "', productitem_LastUpdateStamp = '" . addslashes($server_productitem_LastUpdateStamp) . "', productitem_idRow = '" . addslashes($server_productitem_idRow) . "', productitem_ItemCd = '" . addslashes($server_productitem_ItemCd) . "', productitem_ItemName = '" . addslashes($server_productitem_ItemName) . "', productitem_ItemShortName = '" . addslashes($server_productitem_ItemShortName) . "', productitem_Description = '" . addslashes($server_productitem_Description) . "', productitem_StockingUOMCd = '" . addslashes($server_productitem_StockingUOMCd) . "', productitem_BusinessUnitCd = '" . addslashes($server_productitem_BusinessUnitCd) . "', productitem_CountryCd = '" . addslashes($server_productitem_CountryCd) . "', productitem_BrandCd = '" . addslashes($server_productitem_BrandCd) . "', productitem_DepartmentCd = '" . addslashes($server_productitem_DepartmentCd) . "', productitem_CategoryCd = '" . addslashes($server_productitem_CategoryCd) . "', productitem_subkategory_mstrID = '" . addslashes($server_productitem_subkategory_mstrID) . "', productitem_SubkategoryCd = '" . addslashes($server_productitem_SubkategoryCd) . "', productitem_ClassCd = '" . addslashes($server_productitem_ClassCd) . "', productitem_MaterialCd = '" . addslashes($server_productitem_MaterialCd) . "', productitem_Group1Cd = '" . addslashes($server_productitem_Group1Cd) . "', productitem_Group2Cd = '" . addslashes($server_productitem_Group2Cd) . "', productitem_Group3Cd = '" . addslashes($server_productitem_Group3Cd) . "', productitem_Group4Cd = '" . addslashes($server_productitem_Group4Cd) . "', productitem_Group5Cd = '" . addslashes($server_productitem_Group5Cd) . "', productitem_Group6Cd = '" . addslashes($server_productitem_Group6Cd) . "', productitem_Group7Cd = '" . addslashes($server_productitem_Group7Cd) . "', productitem_Group8Cd = '" . addslashes($server_productitem_Group8Cd) . "', productitem_CurrencyCd = '" . addslashes($server_productitem_CurrencyCd) . "', productitem_DefaultPrice = '" . addslashes($server_productitem_DefaultPrice) . "', productitem_StandartMargin = '" . addslashes($server_productitem_StandartMargin) . "', productitem_StandartGP = '" . addslashes($server_productitem_StandartGP) . "', productitem_AllowManualDiscount = '" . addslashes($server_productitem_AllowManualDiscount) . "', productitem_AllowMemberDiscount = '" . addslashes($server_productitem_AllowMemberDiscount) . "', productitem_AllowDisposal = '" . addslashes($server_productitem_AllowDisposal) . "', productitem_AllowZeroSellingPrice = '" . addslashes($server_productitem_AllowZeroSellingPrice) . "', productitem_IsConsignment = '" . addslashes($server_productitem_IsConsignment) . "', productitem_IsStock = '" . addslashes($server_productitem_IsStock) . "', productitem_IsRecipe = '" . addslashes($server_productitem_IsRecipe) . "', productitem_IsRowMaterial = '" . addslashes($server_productitem_IsRowMaterial) . "', productitem_IsHomeDelivery = '" . addslashes($server_productitem_IsHomeDelivery) . "', productitem_IsInstallation = '" . addslashes($server_productitem_IsInstallation) . "', productitem_Status = '" . addslashes($server_productitem_Status) . "', productitem_ItemAccount = '" . addslashes($server_productitem_ItemAccount) . "', productitem_HPPAccount = '" . addslashes($server_productitem_HPPAccount) . "', productitem_OldItemCd = '" . addslashes($server_productitem_OldItemCd) . "', productitem_SF_Item = '" . addslashes($server_productitem_SF_Item) . "', productitem_Forensic = '" . addslashes($server_productitem_Forensic) . "', productitem_PortfolioCd = '" . addslashes($server_productitem_PortfolioCd) . "', productitem_Sub_PortfolioCd = '" . addslashes($server_productitem_Sub_PortfolioCd) . "', productitem_deletable = '" . addslashes($server_productitem_deletable) . "', productitem_businessunit_mstrID = '" . addslashes($server_productitem_businessunit_mstrID) . "', productitem_hierarchicallandc_coutryID = '" . addslashes($server_productitem_hierarchicallandc_coutryID) . "', productitem_department_mstrID = '" . addslashes($server_productitem_department_mstrID) . "', productitem_rowmaterial_mstrID = '" . addslashes($server_productitem_rowmaterial_mstrID) . "', productitem_group1_mstrID = '" . addslashes($server_productitem_group1_mstrID) . "', productitem_group2_mstrID = '" . addslashes($server_productitem_group2_mstrID) . "', productitem_group3_mstrID = '" . addslashes($server_productitem_group3_mstrID) . "', productitem_group4_mstrID = '" . addslashes($server_productitem_group4_mstrID) . "', productitem_group5_mstrID = '" . addslashes($server_productitem_group5_mstrID) . "', productitem_group6_mstrID = '" . addslashes($server_productitem_group6_mstrID) . "', productitem_group7_mstrID = '" . addslashes($server_productitem_group7_mstrID) . "', productitem_group8_mstrID = '" . addslashes($server_productitem_group8_mstrID) . "', productitem_brand_mstrID = '" . addslashes($server_productitem_brand_mstrID) . "', productitem_category_mstrID = '" . addslashes($server_productitem_category_mstrID) . "', productitem_class_mstrID = '" . addslashes($server_productitem_class_mstrID) . "', productitem_Stockingmeasurement_uomID = '" . addslashes($server_productitem_Stockingmeasurement_uomID) . "', productitem__dihapus = '" . addslashes($server_productitem__dihapus) . "', productitem__dihapus_time = '" . addslashes($server_productitem__dihapus_time) . "', productitem_IsBOM = '" . addslashes($server_productitem_IsBOM) . "', productitem_picture = '" . addslashes($server_productitem_picture) . "', productitem_currency_mstrID = '" . addslashes($server_productitem_currency_mstrID) . "', productitem_itmcd = '" . addslashes($server_productitem_itmcd) . "', productitem_ada_PL = '" . addslashes($server_productitem_ada_PL) . "', productitem_Designercontact_mstrID = '" . addslashes($server_productitem_Designercontact_mstrID) . "', productitem_DesignerContactName = '" . addslashes($server_productitem_DesignerContactName) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
$fp_stockopname = fopen('/xampp/htdocs/xampp/sql_delete.html', "w+");
fwrite($fp_stockopname, $err_msg_delete . "\n");
fwrite($fp_stockopname, $sql_delete . "\n");
fwrite($fp_stockopname, $err_msg . "\n");
fwrite($fp_stockopname, $sql_insert . "\n");
fclose($fp_stockopname);
echo "\n";
echo 'sql_delete=>' . $sql_delete;
echo "\n";
echo 'INSERT INTO productitem_mstr=>' . $err_msg;
echo "\n";
echo 'server_productitem_mstrID=>' . $server_productitem_mstrID;
echo "\n";
echo 'INSERT INTO productitem_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_delete = "DELETE FROM productitem_mstr where productitem_mstrID <> " . $server_productitem_mstrID . " and productitem__dihapus_time = '" . $server_productitem__dihapus_time . "' and productitem_ItemCd = '" . $server_productitem_ItemCd . "' and productitem_Sub_PortfolioCd = '" . addslashes($server_productitem_Sub_PortfolioCd) . "' and productitem_rowmaterial_mstrID = " . addslashes($server_productitem_rowmaterial_mstrID) . " and productitem_brand_mstrID = " . addslashes($server_productitem_brand_mstrID) . " and productitem_class_mstrID = " . addslashes($server_productitem_class_mstrID) . " and productitem_Stockingmeasurement_uomID = " . addslashes($server_productitem_Stockingmeasurement_uomID) . " and productitem_ItemName = '" . addslashes($server_productitem_ItemName) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_update = "UPDATE productitem_mstr SET productitem_create_user = '" . addslashes($server_productitem_create_user) . "', productitem_create_time = '" . addslashes($server_productitem_create_time) . "', productitem_edit_user = '" . addslashes($server_productitem_edit_user) . "', productitem_edit_time = '" . addslashes($server_productitem_edit_time) . "', productitem_ip = '" . addslashes($server_productitem_ip) . "', productitem_SysTrxId = '" . addslashes($server_productitem_SysTrxId) . "', productitem_Active = '" . addslashes($server_productitem_Active) . "', productitem_Approve = '" . addslashes($server_productitem_Approve) . "', productitem_SyncronizeDate = '" . addslashes($server_productitem_SyncronizeDate) . "', productitem_LastExportDate = '" . addslashes($server_productitem_LastExportDate) . "', productitem_TotalImported = '" . addslashes($server_productitem_TotalImported) . "', productitem_TotalExported = '" . addslashes($server_productitem_TotalExported) . "', productitem_LastUpdateStamp = '" . addslashes($server_productitem_LastUpdateStamp) . "', productitem_idRow = '" . addslashes($server_productitem_idRow) . "', productitem_ItemCd = '" . addslashes($server_productitem_ItemCd) . "', productitem_ItemName = '" . addslashes($server_productitem_ItemName) . "', productitem_ItemShortName = '" . addslashes($server_productitem_ItemShortName) . "', productitem_Description = '" . addslashes($server_productitem_Description) . "', productitem_StockingUOMCd = '" . addslashes($server_productitem_StockingUOMCd) . "', productitem_BusinessUnitCd = '" . addslashes($server_productitem_BusinessUnitCd) . "', productitem_CountryCd = '" . addslashes($server_productitem_CountryCd) . "', productitem_BrandCd = '" . addslashes($server_productitem_BrandCd) . "', productitem_DepartmentCd = '" . addslashes($server_productitem_DepartmentCd) . "', productitem_CategoryCd = '" . addslashes($server_productitem_CategoryCd) . "', productitem_subkategory_mstrID = '" . addslashes($server_productitem_subkategory_mstrID) . "', productitem_SubkategoryCd = '" . addslashes($server_productitem_SubkategoryCd) . "', productitem_ClassCd = '" . addslashes($server_productitem_ClassCd) . "', productitem_MaterialCd = '" . addslashes($server_productitem_MaterialCd) . "', productitem_Group1Cd = '" . addslashes($server_productitem_Group1Cd) . "', productitem_Group2Cd = '" . addslashes($server_productitem_Group2Cd) . "', productitem_Group3Cd = '" . addslashes($server_productitem_Group3Cd) . "', productitem_Group4Cd = '" . addslashes($server_productitem_Group4Cd) . "', productitem_Group5Cd = '" . addslashes($server_productitem_Group5Cd) . "', productitem_Group6Cd = '" . addslashes($server_productitem_Group6Cd) . "', productitem_Group7Cd = '" . addslashes($server_productitem_Group7Cd) . "', productitem_Group8Cd = '" . addslashes($server_productitem_Group8Cd) . "', productitem_CurrencyCd = '" . addslashes($server_productitem_CurrencyCd) . "', productitem_DefaultPrice = '" . addslashes($server_productitem_DefaultPrice) . "', productitem_StandartMargin = '" . addslashes($server_productitem_StandartMargin) . "', productitem_StandartGP = '" . addslashes($server_productitem_StandartGP) . "', productitem_AllowManualDiscount = '" . addslashes($server_productitem_AllowManualDiscount) . "', productitem_AllowMemberDiscount = '" . addslashes($server_productitem_AllowMemberDiscount) . "', productitem_AllowDisposal = '" . addslashes($server_productitem_AllowDisposal) . "', productitem_AllowZeroSellingPrice = '" . addslashes($server_productitem_AllowZeroSellingPrice) . "', productitem_IsConsignment = '" . addslashes($server_productitem_IsConsignment) . "', productitem_IsStock = '" . addslashes($server_productitem_IsStock) . "', productitem_IsRecipe = '" . addslashes($server_productitem_IsRecipe) . "', productitem_IsRowMaterial = '" . addslashes($server_productitem_IsRowMaterial) . "', productitem_IsHomeDelivery = '" . addslashes($server_productitem_IsHomeDelivery) . "', productitem_IsInstallation = '" . addslashes($server_productitem_IsInstallation) . "', productitem_Status = '" . addslashes($server_productitem_Status) . "', productitem_ItemAccount = '" . addslashes($server_productitem_ItemAccount) . "', productitem_HPPAccount = '" . addslashes($server_productitem_HPPAccount) . "', productitem_OldItemCd = '" . addslashes($server_productitem_OldItemCd) . "', productitem_SF_Item = '" . addslashes($server_productitem_SF_Item) . "', productitem_Forensic = '" . addslashes($server_productitem_Forensic) . "', productitem_PortfolioCd = '" . addslashes($server_productitem_PortfolioCd) . "', productitem_Sub_PortfolioCd = '" . addslashes($server_productitem_Sub_PortfolioCd) . "', productitem_deletable = '" . addslashes($server_productitem_deletable) . "', productitem_businessunit_mstrID = '" . addslashes($server_productitem_businessunit_mstrID) . "', productitem_hierarchicallandc_coutryID = '" . addslashes($server_productitem_hierarchicallandc_coutryID) . "', productitem_department_mstrID = '" . addslashes($server_productitem_department_mstrID) . "', productitem_rowmaterial_mstrID = '" . addslashes($server_productitem_rowmaterial_mstrID) . "', productitem_group1_mstrID = '" . addslashes($server_productitem_group1_mstrID) . "', productitem_group2_mstrID = '" . addslashes($server_productitem_group2_mstrID) . "', productitem_group3_mstrID = '" . addslashes($server_productitem_group3_mstrID) . "', productitem_group4_mstrID = '" . addslashes($server_productitem_group4_mstrID) . "', productitem_group5_mstrID = '" . addslashes($server_productitem_group5_mstrID) . "', productitem_group6_mstrID = '" . addslashes($server_productitem_group6_mstrID) . "', productitem_group7_mstrID = '" . addslashes($server_productitem_group7_mstrID) . "', productitem_group8_mstrID = '" . addslashes($server_productitem_group8_mstrID) . "', productitem_brand_mstrID = '" . addslashes($server_productitem_brand_mstrID) . "', productitem_category_mstrID = '" . addslashes($server_productitem_category_mstrID) . "', productitem_class_mstrID = '" . addslashes($server_productitem_class_mstrID) . "', productitem_Stockingmeasurement_uomID = '" . addslashes($server_productitem_Stockingmeasurement_uomID) . "', productitem__dihapus = '" . addslashes($server_productitem__dihapus) . "', productitem__dihapus_time = '" . addslashes($server_productitem__dihapus_time) . "', productitem_IsBOM = '" . addslashes($server_productitem_IsBOM) . "', productitem_picture = '" . addslashes($server_productitem_picture) . "', productitem_currency_mstrID = '" . addslashes($server_productitem_currency_mstrID) . "', productitem_itmcd = '" . addslashes($server_productitem_itmcd) . "', productitem_ada_PL = '" . addslashes($server_productitem_ada_PL) . "', productitem_Designercontact_mstrID = '" . addslashes($server_productitem_Designercontact_mstrID) . "', productitem_DesignerContactName = '" . addslashes($server_productitem_DesignerContactName) . "' WHERE productitem_mstrID = " . $server_productitem_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'sql_delete=>' . $sql_delete;
echo "\n";
echo 'UPDATE productitem_mstr=>' . $err_msg;
echo "\n";
echo 'server_productitem_mstrID=>' . $server_productitem_mstrID;
echo "\n";
echo 'UPDATE productitem_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'itemsku_mstr')
{
echo "\n";
echo 'Sebelum itemsku_mstr=>' . $err_msg;
echo "\n";
list($server_itemsku_mstrID, $server_itemsku_create_user, $server_itemsku_create_time, $server_itemsku_edit_user, $server_itemsku_edit_time, $server_itemsku_ip, $server_itemsku_SysTrxId, $server_itemsku_Active, $server_itemsku_Approve, $server_itemsku_SyncronizeDate, $server_itemsku_LastExportDate, $server_itemsku_TotalImported, $server_itemsku_TotalExported, $server_itemsku_LastUpdateStamp, $server_itemsku_idRow, $server_itemsku_ItemCd, $server_itemsku_ItemSKUCd, $server_itemsku_ItemSKUName, $server_itemsku_Description, $server_itemsku_SF_ItemSKU, $server_itemsku_OldItemSKUCd, $server_itemsku_LastPurchaseDate, $server_itemsku_Deleteable, $server_itemsku_Forensic, $server_itemsku_PortfolioCd, $server_itemsku_Sub_PortfolioCd, $server_itemsku_productitem_mstrID, $server_itemsku__dihapus, $server_itemsku__dihapus_time, $server_itemsku_PONo, $server_itemsku_Vendorcontact_mstrID, $server_itemsku_VendorContactCd, $server_itemsku_VendorContactName, $server_itemsku_Colorskud_detailID, $server_itemsku_ColorSKUDetailCd, $server_itemsku_ColorSKUDetailName, $server_itemsku_Sizeskud_detailID, $server_itemsku_SizeSKUDetailCd, $server_itemsku_SizeSKUDetailName, $server_itemsku_LastPurchasePrice, $server_itemsku_adabarcode, $server_itemsku_CreateStock, $server_itemsku_CreateStockTime, $server_itemsku_RptDay) = explode('`', $line);
if ($server_itemsku_Active == '') $server_itemsku_Active = 'No';
if ($server_itemsku_Approve == '') $server_itemsku_Approve = 0;
if ($server_itemsku_TotalImported == '') $server_itemsku_TotalImported = 0;
if ($server_itemsku_TotalExported == '') $server_itemsku_TotalExported = 0;
if ($server_itemsku_idRow == '') $server_itemsku_idRow = 0;
if ($server_itemsku_LastPurchaseDate == '') $server_itemsku_LastPurchaseDate = '1900-01-01';
if ($server_itemsku_Deleteable == '') $server_itemsku_Deleteable = 'No';
if ($server_itemsku_productitem_mstrID == '') $server_itemsku_productitem_mstrID = 0;
if ($server_itemsku__dihapus == '') $server_itemsku__dihapus = 'No';
if ($server_itemsku_Vendorcontact_mstrID == '') $server_itemsku_Vendorcontact_mstrID = 0;
if ($server_itemsku_Colorskud_detailID == '') $server_itemsku_Colorskud_detailID = 0;
if ($server_itemsku_Sizeskud_detailID == '') $server_itemsku_Sizeskud_detailID = 0;
if ($server_itemsku_LastPurchasePrice == '') $server_itemsku_LastPurchasePrice = 0;
if ($server_itemsku_adabarcode == '') $server_itemsku_adabarcode = 'No';
if ($server_itemsku_CreateStock == '') $server_itemsku_CreateStock = '0';
if ($server_itemsku_CreateStockTime == '') $server_itemsku_CreateStockTime = 0;
if ($server_itemsku_RptDay == '') $server_itemsku_RptDay = 0;
$itemsku_mstrID = 0;
$koneksi_itemsku_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT itemsku_mstrID, itemsku_LastUpdateStamp FROM itemsku_mstr where itemsku_mstrID = " . $server_itemsku_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$itemsku_mstrID = $row_koneksi['itemsku_mstrID'];
$koneksi_itemsku_LastUpdateStamp = $row_koneksi['itemsku_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($itemsku_mstrID == 0)
{
$sql_delete = "DELETE FROM itemsku_mstr where itemsku_ItemCd = '" . addslashes($server_itemsku_ItemCd) . "' and itemsku_ItemSKUCd = '" . addslashes($server_itemsku_ItemSKUCd) . "' and itemsku__dihapus_time = '" . addslashes($server_itemsku__dihapus_time) . "' and itemsku_OldItemSKUCd = '" . addslashes($server_itemsku_OldItemSKUCd) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_insert = "INSERT INTO itemsku_mstr SET itemsku_mstrID = '" . addslashes($server_itemsku_mstrID) . "', itemsku_create_user = '" . addslashes($server_itemsku_create_user) . "', itemsku_create_time = '" . addslashes($server_itemsku_create_time) . "', itemsku_edit_user = '" . addslashes($server_itemsku_edit_user) . "', itemsku_edit_time = '" . addslashes($server_itemsku_edit_time) . "', itemsku_ip = '" . addslashes($server_itemsku_ip) . "', itemsku_SysTrxId = '" . addslashes($server_itemsku_SysTrxId) . "', itemsku_Active = '" . addslashes($server_itemsku_Active) . "', itemsku_Approve = '" . addslashes($server_itemsku_Approve) . "', itemsku_SyncronizeDate = '" . addslashes($server_itemsku_SyncronizeDate) . "', itemsku_LastExportDate = '" . addslashes($server_itemsku_LastExportDate) . "', itemsku_TotalImported = '" . addslashes($server_itemsku_TotalImported) . "', itemsku_TotalExported = '" . addslashes($server_itemsku_TotalExported) . "', itemsku_LastUpdateStamp = '" . addslashes($server_itemsku_LastUpdateStamp) . "', itemsku_idRow = '" . addslashes($server_itemsku_idRow) . "', itemsku_ItemCd = '" . addslashes($server_itemsku_ItemCd) . "', itemsku_ItemSKUCd = '" . addslashes($server_itemsku_ItemSKUCd) . "', itemsku_ItemSKUName = '" . addslashes($server_itemsku_ItemSKUName) . "', itemsku_Description = '" . addslashes($server_itemsku_Description) . "', itemsku_SF_ItemSKU = '" . addslashes($server_itemsku_SF_ItemSKU) . "', itemsku_OldItemSKUCd = '" . addslashes($server_itemsku_OldItemSKUCd) . "', itemsku_LastPurchaseDate = '" . addslashes($server_itemsku_LastPurchaseDate) . "', itemsku_Deleteable = '" . addslashes($server_itemsku_Deleteable) . "', itemsku_Forensic = '" . addslashes($server_itemsku_Forensic) . "', itemsku_PortfolioCd = '" . addslashes($server_itemsku_PortfolioCd) . "', itemsku_Sub_PortfolioCd = '" . addslashes($server_itemsku_Sub_PortfolioCd) . "', itemsku_productitem_mstrID = '" . addslashes($server_itemsku_productitem_mstrID) . "', itemsku__dihapus = '" . addslashes($server_itemsku__dihapus) . "', itemsku__dihapus_time = '" . addslashes($server_itemsku__dihapus_time) . "', itemsku_PONo = '" . addslashes($server_itemsku_PONo) . "', itemsku_Vendorcontact_mstrID = '" . addslashes($server_itemsku_Vendorcontact_mstrID) . "', itemsku_VendorContactCd = '" . addslashes($server_itemsku_VendorContactCd) . "', itemsku_VendorContactName = '" . addslashes($server_itemsku_VendorContactName) . "', itemsku_Colorskud_detailID = '" . addslashes($server_itemsku_Colorskud_detailID) . "', itemsku_ColorSKUDetailCd = '" . addslashes($server_itemsku_ColorSKUDetailCd) . "', itemsku_ColorSKUDetailName = '" . addslashes($server_itemsku_ColorSKUDetailName) . "', itemsku_Sizeskud_detailID = '" . addslashes($server_itemsku_Sizeskud_detailID) . "', itemsku_SizeSKUDetailCd = '" . addslashes($server_itemsku_SizeSKUDetailCd) . "', itemsku_SizeSKUDetailName = '" . addslashes($server_itemsku_SizeSKUDetailName) . "', itemsku_LastPurchasePrice = '" . addslashes($server_itemsku_LastPurchasePrice) . "', itemsku_adabarcode = '" . addslashes($server_itemsku_adabarcode) . "', itemsku_CreateStock = '" . addslashes($server_itemsku_CreateStock) . "', itemsku_CreateStockTime = '" . addslashes($server_itemsku_CreateStockTime) . "', itemsku_RptDay = '" . addslashes($server_itemsku_RptDay) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert itemsku_mstr=>' . $err_msg;
echo "\n";
echo 'server_itemsku_productitem_mstrID=>' . $server_itemsku_productitem_mstrID;
echo "\n";
echo 'Insert itemsku_mstr=>' . $sql_insert;
echo "\n";
sleep(2000);
}
}
ELSE
{
$sql_update = "UPDATE itemsku_mstr SET itemsku_create_user = '" . addslashes($server_itemsku_create_user) . "', itemsku_create_time = '" . addslashes($server_itemsku_create_time) . "', itemsku_edit_user = '" . addslashes($server_itemsku_edit_user) . "', itemsku_edit_time = '" . addslashes($server_itemsku_edit_time) . "', itemsku_ip = '" . addslashes($server_itemsku_ip) . "', itemsku_SysTrxId = '" . addslashes($server_itemsku_SysTrxId) . "', itemsku_Active = '" . addslashes($server_itemsku_Active) . "', itemsku_Approve = '" . addslashes($server_itemsku_Approve) . "', itemsku_SyncronizeDate = '" . addslashes($server_itemsku_SyncronizeDate) . "', itemsku_LastExportDate = '" . addslashes($server_itemsku_LastExportDate) . "', itemsku_TotalImported = '" . addslashes($server_itemsku_TotalImported) . "', itemsku_TotalExported = '" . addslashes($server_itemsku_TotalExported) . "', itemsku_LastUpdateStamp = '" . addslashes($server_itemsku_LastUpdateStamp) . "', itemsku_idRow = '" . addslashes($server_itemsku_idRow) . "', itemsku_ItemCd = '" . addslashes($server_itemsku_ItemCd) . "', itemsku_ItemSKUCd = '" . addslashes($server_itemsku_ItemSKUCd) . "', itemsku_ItemSKUName = '" . addslashes($server_itemsku_ItemSKUName) . "', itemsku_Description = '" . addslashes($server_itemsku_Description) . "', itemsku_SF_ItemSKU = '" . addslashes($server_itemsku_SF_ItemSKU) . "', itemsku_OldItemSKUCd = '" . addslashes($server_itemsku_OldItemSKUCd) . "', itemsku_LastPurchaseDate = '" . addslashes($server_itemsku_LastPurchaseDate) . "', itemsku_Deleteable = '" . addslashes($server_itemsku_Deleteable) . "', itemsku_Forensic = '" . addslashes($server_itemsku_Forensic) . "', itemsku_PortfolioCd = '" . addslashes($server_itemsku_PortfolioCd) . "', itemsku_Sub_PortfolioCd = '" . addslashes($server_itemsku_Sub_PortfolioCd) . "', itemsku_productitem_mstrID = '" . addslashes($server_itemsku_productitem_mstrID) . "', itemsku__dihapus = '" . addslashes($server_itemsku__dihapus) . "', itemsku__dihapus_time = '" . addslashes($server_itemsku__dihapus_time) . "', itemsku_PONo = '" . addslashes($server_itemsku_PONo) . "', itemsku_Vendorcontact_mstrID = '" . addslashes($server_itemsku_Vendorcontact_mstrID) . "', itemsku_VendorContactCd = '" . addslashes($server_itemsku_VendorContactCd) . "', itemsku_VendorContactName = '" . addslashes($server_itemsku_VendorContactName) . "', itemsku_Colorskud_detailID = '" . addslashes($server_itemsku_Colorskud_detailID) . "', itemsku_ColorSKUDetailCd = '" . addslashes($server_itemsku_ColorSKUDetailCd) . "', itemsku_ColorSKUDetailName = '" . addslashes($server_itemsku_ColorSKUDetailName) . "', itemsku_Sizeskud_detailID = '" . addslashes($server_itemsku_Sizeskud_detailID) . "', itemsku_SizeSKUDetailCd = '" . addslashes($server_itemsku_SizeSKUDetailCd) . "', itemsku_SizeSKUDetailName = '" . addslashes($server_itemsku_SizeSKUDetailName) . "', itemsku_LastPurchasePrice = '" . addslashes($server_itemsku_LastPurchasePrice) . "', itemsku_adabarcode = '" . addslashes($server_itemsku_adabarcode) . "', itemsku_CreateStock = '" . addslashes($server_itemsku_CreateStock) . "', itemsku_CreateStockTime = '" . addslashes($server_itemsku_CreateStockTime) . "', itemsku_RptDay = '" . addslashes($server_itemsku_RptDay) . "' WHERE itemsku_mstrID = " . $server_itemsku_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE itemsku_mstr=>' . $err_msg;
echo "\n";
echo 'UPDATE itemsku_mstr=>' . $sql_update;
echo "\n";
sleep(2000);
}
}
}
else if ($t4973 == 'barcode_mstr')
{
list($server_barcode_mstrID, $server_barcode_create_user, $server_barcode_create_time, $server_barcode_edit_user, $server_barcode_edit_time, $server_barcode_ip, $server_barcode_SysTrxId, $server_barcode_Active, $server_barcode_Approve, $server_barcode_SyncronizeDate, $server_barcode_LastExportDate, $server_barcode_TotalImported, $server_barcode_TotalExported, $server_barcode_LastUpdateStamp, $server_barcode_idRow, $server_barcode_Deleteable, $server_barcode_ItemCd, $server_barcode_ItemSKUCd, $server_barcode_Barcode, $server_barcode_IsPLCreated, $server_barcode_Description, $server_barcode_MaxQty, $server_barcode_MinQty, $server_barcode_ReorderQty, $server_barcode_SF_ItemSKUBarcode, $server_barcode_Forensic, $server_barcode_PortfolioCd, $server_barcode_Sub_PortfolioCd, $server_barcode_productitem_mstrID, $server_barcode_itemsku_mstrID, $server_barcode__dihapus, $server_barcode__dihapus_time, $barcode_barcode_mstrID) = explode('`', $line);
if ($server_barcode_Active == '') $server_barcode_Active = 'No';
if ($server_barcode_Approve == '') $server_barcode_Approve = 0;
if ($server_barcode_TotalImported == '') $server_barcode_TotalImported = 0;
if ($server_barcode_TotalExported == '') $server_barcode_TotalExported = 0;
if ($server_barcode_idRow == '') $server_barcode_idRow = 0;
if ($server_barcode_Deleteable == '') $server_barcode_Deleteable = 'No';
if ($server_barcode_IsPLCreated == '') $server_barcode_IsPLCreated = 'No';
if ($server_barcode_MaxQty == '') $server_barcode_MaxQty = 0;
if ($server_barcode_MinQty == '') $server_barcode_MinQty = 0;
if ($server_barcode_ReorderQty == '') $server_barcode_ReorderQty = 0;
if ($server_barcode_productitem_mstrID == '') $server_barcode_productitem_mstrID = 0;
if ($server_barcode_itemsku_mstrID == '') $server_barcode_itemsku_mstrID = 0;
if ($server_barcode__dihapus == '') $server_barcode__dihapus = 'No';
if ($server_barcode_barcode_mstrID == '') $server_barcode_barcode_mstrID = 0;
$barcode_mstrID = 0;
$koneksi_barcode_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT barcode_mstrID, barcode_LastUpdateStamp FROM barcode_mstr where barcode_mstrID = " . $server_barcode_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$barcode_mstrID = $row_koneksi['barcode_mstrID'];
$koneksi_barcode_LastUpdateStamp = $row_koneksi['barcode_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($barcode_mstrID == 0)
{
$sql_delete = "DELETE FROM barcode_mstr where barcode_itemsku_mstrID = " . $server_barcode_itemsku_mstrID . " and barcode__dihapus = 'No'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_insert = "INSERT INTO barcode_mstr SET barcode_mstrID = '" . addslashes($server_barcode_mstrID) . "', barcode_create_user = '" . addslashes($server_barcode_create_user) . "', barcode_create_time = '" . addslashes($server_barcode_create_time) . "', barcode_edit_user = '" . addslashes($server_barcode_edit_user) . "', barcode_edit_time = '" . addslashes($server_barcode_edit_time) . "', barcode_ip = '" . addslashes($server_barcode_ip) . "', barcode_SysTrxId = '" . addslashes($server_barcode_SysTrxId) . "', barcode_Active = '" . addslashes($server_barcode_Active) . "', barcode_Approve = '" . addslashes($server_barcode_Approve) . "', barcode_SyncronizeDate = '" . addslashes($server_barcode_SyncronizeDate) . "', barcode_LastExportDate = '" . addslashes($server_barcode_LastExportDate) . "', barcode_TotalImported = '" . addslashes($server_barcode_TotalImported) . "', barcode_TotalExported = '" . addslashes($server_barcode_TotalExported) . "', barcode_LastUpdateStamp = '" . addslashes($server_barcode_LastUpdateStamp) . "', barcode_idRow = '" . addslashes($server_barcode_idRow) . "', barcode_Deleteable = '" . addslashes($server_barcode_Deleteable) . "', barcode_ItemCd = '" . addslashes($server_barcode_ItemCd) . "', barcode_ItemSKUCd = '" . addslashes($server_barcode_ItemSKUCd) . "', barcode_Barcode = '" . addslashes($server_barcode_Barcode) . "', barcode_IsPLCreated = '" . addslashes($server_barcode_IsPLCreated) . "', barcode_Description = '" . addslashes($server_barcode_Description) . "', barcode_MaxQty = '" . addslashes($server_barcode_MaxQty) . "', barcode_MinQty = '" . addslashes($server_barcode_MinQty) . "', barcode_ReorderQty = '" . addslashes($server_barcode_ReorderQty) . "', barcode_SF_ItemSKUBarcode = '" . addslashes($server_barcode_SF_ItemSKUBarcode) . "', barcode_Forensic = '" . addslashes($server_barcode_Forensic) . "', barcode_PortfolioCd = '" . addslashes($server_barcode_PortfolioCd) . "', barcode_Sub_PortfolioCd = '" . addslashes($server_barcode_Sub_PortfolioCd) . "', barcode_productitem_mstrID = '" . addslashes($server_barcode_productitem_mstrID) . "', barcode_itemsku_mstrID = '" . addslashes($server_barcode_itemsku_mstrID) . "', barcode__dihapus = '" . addslashes($server_barcode__dihapus) . "', barcode__dihapus_time = '" . addslashes($server_barcode__dihapus_time) . "', barcode_barcode_mstrID = '" . addslashes($server_barcode_barcode_mstrID) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
ELSE
{
$sql_delete = "DELETE FROM barcode_mstr where barcode_itemsku_mstrID = " . $server_barcode_itemsku_mstrID . " and barcode__dihapus = 'No' and barcode_mstrID <> " . $server_barcode_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_update = "UPDATE barcode_mstr SET barcode_create_user = '" . addslashes($server_barcode_create_user) . "', barcode_create_time = '" . addslashes($server_barcode_create_time) . "', barcode_edit_user = '" . addslashes($server_barcode_edit_user) . "', barcode_edit_time = '" . addslashes($server_barcode_edit_time) . "', barcode_ip = '" . addslashes($server_barcode_ip) . "', barcode_SysTrxId = '" . addslashes($server_barcode_SysTrxId) . "', barcode_Active = '" . addslashes($server_barcode_Active) . "', barcode_Approve = '" . addslashes($server_barcode_Approve) . "', barcode_SyncronizeDate = '" . addslashes($server_barcode_SyncronizeDate) . "', barcode_LastExportDate = '" . addslashes($server_barcode_LastExportDate) . "', barcode_TotalImported = '" . addslashes($server_barcode_TotalImported) . "', barcode_TotalExported = '" . addslashes($server_barcode_TotalExported) . "', barcode_LastUpdateStamp = '" . addslashes($server_barcode_LastUpdateStamp) . "', barcode_idRow = '" . addslashes($server_barcode_idRow) . "', barcode_Deleteable = '" . addslashes($server_barcode_Deleteable) . "', barcode_ItemCd = '" . addslashes($server_barcode_ItemCd) . "', barcode_ItemSKUCd = '" . addslashes($server_barcode_ItemSKUCd) . "', barcode_Barcode = '" . addslashes($server_barcode_Barcode) . "', barcode_IsPLCreated = '" . addslashes($server_barcode_IsPLCreated) . "', barcode_Description = '" . addslashes($server_barcode_Description) . "', barcode_MaxQty = '" . addslashes($server_barcode_MaxQty) . "', barcode_MinQty = '" . addslashes($server_barcode_MinQty) . "', barcode_ReorderQty = '" . addslashes($server_barcode_ReorderQty) . "', barcode_SF_ItemSKUBarcode = '" . addslashes($server_barcode_SF_ItemSKUBarcode) . "', barcode_Forensic = '" . addslashes($server_barcode_Forensic) . "', barcode_PortfolioCd = '" . addslashes($server_barcode_PortfolioCd) . "', barcode_Sub_PortfolioCd = '" . addslashes($server_barcode_Sub_PortfolioCd) . "', barcode_productitem_mstrID = '" . addslashes($server_barcode_productitem_mstrID) . "', barcode_itemsku_mstrID = '" . addslashes($server_barcode_itemsku_mstrID) . "', barcode__dihapus = '" . addslashes($server_barcode__dihapus) . "', barcode__dihapus_time = '" . addslashes($server_barcode__dihapus_time) . "', barcode_barcode_mstrID = '" . addslashes($server_barcode_barcode_mstrID) . "' WHERE barcode_mstrID = " . $server_barcode_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
}
else if ($t4973 == 'prosesbg_mstr')
{
echo "\n";
echo 'Sebelum prosesbg=>' . $err_msg;
echo "\n";
list($server_prosesbg_mstrID, $server_prosesbg_create_user, $server_prosesbg_create_time, $server_prosesbg_edit_user, $server_prosesbg_edit_time, $server_prosesbg_ip, $server_prosesbg_SysTrxId, $server_prosesbg_Active, $server_prosesbg_Approve, $server_prosesbg_SyncronizeDate, $server_prosesbg_LastExportDate, $server_prosesbg_TotalImported, $server_prosesbg_TotalExported, $server_prosesbg_SF_yProsesBG, $server_prosesbg_Deleteable, $server_prosesbg_Forensic, $server_prosesbg_PortfolioCd, $server_prosesbg_Sub_PortfolioCd, $server_prosesbg__dihapus_time, $server_prosesbg__dihapus, $server_prosesbg_LastUpdateStamp, $server_prosesbg_type, $server_prosesbg_var, $server_prosesbg_complete, $server_prosesbg_total, $server_prosesbg_ke, $server_prosesbg_start_time, $server_prosesbg_complete_time, $server_prosesbg_remarks, $server_prosesbg_start01, $server_prosesbg_finish01, $server_prosesbg_status01, $server_prosesbg_start02, $server_prosesbg_finish02, $server_prosesbg_status02, $server_prosesbg_start03, $server_prosesbg_finish03, $server_prosesbg_status03, $server_prosesbg_start04, $server_prosesbg_finish04, $server_prosesbg_status04, $server_prosesbg_start05, $server_prosesbg_finish05, $server_prosesbg_status05, $server_prosesbg_start06, $server_prosesbg_finish06, $server_prosesbg_status06, $server_prosesbg_start07, $server_prosesbg_finish07, $server_prosesbg_status07, $server_prosesbg_start08, $server_prosesbg_finish08, $server_prosesbg_status08, $server_prosesbg_start09, $server_prosesbg_finish09, $server_prosesbg_status09, $server_prosesbg_Period, $server_prosesbg_start10, $server_prosesbg_finish10, $server_prosesbg_status10, $server_prosesbg_start11, $server_prosesbg_finish11, $server_prosesbg_status11, $server_prosesbg_start12, $server_prosesbg_finish12, $server_prosesbg_status12, $server_prosesbg_start13, $server_prosesbg_finish13, $server_prosesbg_status13, $server_prosesbg_start14, $server_prosesbg_finish14, $server_prosesbg_status14, $server_prosesbg_start15, $server_prosesbg_finish15, $server_prosesbg_status15, $server_prosesbg_start16, $server_prosesbg_finish16, $server_prosesbg_status16) = explode('`', $line);
if ($server_prosesbg_Active == '') $server_prosesbg_Active = 'No';
if ($server_prosesbg_Approve == '') $server_prosesbg_Approve = 0;
if ($server_prosesbg_TotalImported == '') $server_prosesbg_TotalImported = 0;
if ($server_prosesbg_TotalExported == '') $server_prosesbg_TotalExported = 0;
if ($server_prosesbg_Deleteable == '') $server_prosesbg_Deleteable = 'No';
if ($server_prosesbg__dihapus == '') $server_prosesbg__dihapus = 'No';
if ($server_prosesbg_complete == '') $server_prosesbg_complete = 'Process';
if ($server_prosesbg_total == '') $server_prosesbg_total = 0;
if ($server_prosesbg_ke == '') $server_prosesbg_ke = 0;
if ($server_prosesbg_start_time == '') $server_prosesbg_start_time = 0;
if ($server_prosesbg_complete_time == '') $server_prosesbg_complete_time = 0;
if ($server_prosesbg_start01 == '') $server_prosesbg_start01 = 'No';
if ($server_prosesbg_finish01 == '') $server_prosesbg_finish01 = 'No';
if ($server_prosesbg_start02 == '') $server_prosesbg_start02 = 'No';
if ($server_prosesbg_finish02 == '') $server_prosesbg_finish02 = 'No';
if ($server_prosesbg_start03 == '') $server_prosesbg_start03 = 'No';
if ($server_prosesbg_finish03 == '') $server_prosesbg_finish03 = 'No';
if ($server_prosesbg_start04 == '') $server_prosesbg_start04 = 'No';
if ($server_prosesbg_finish04 == '') $server_prosesbg_finish04 = 'No';
if ($server_prosesbg_start05 == '') $server_prosesbg_start05 = 'No';
if ($server_prosesbg_finish05 == '') $server_prosesbg_finish05 = 'No';
if ($server_prosesbg_start06 == '') $server_prosesbg_start06 = 'No';
if ($server_prosesbg_finish06 == '') $server_prosesbg_finish06 = 'No';
if ($server_prosesbg_start07 == '') $server_prosesbg_start07 = 'No';
if ($server_prosesbg_finish07 == '') $server_prosesbg_finish07 = 'No';
if ($server_prosesbg_start08 == '') $server_prosesbg_start08 = 'No';
if ($server_prosesbg_finish08 == '') $server_prosesbg_finish08 = 'No';
if ($server_prosesbg_start09 == '') $server_prosesbg_start09 = 'No';
if ($server_prosesbg_finish09 == '') $server_prosesbg_finish09 = 'No';
if ($server_prosesbg_start10 == '') $server_prosesbg_start10 = 'No';
if ($server_prosesbg_finish10 == '') $server_prosesbg_finish10 = 'No';
if ($server_prosesbg_start11 == '') $server_prosesbg_start11 = 'No';
if ($server_prosesbg_finish11 == '') $server_prosesbg_finish11 = 'No';
if ($server_prosesbg_start12 == '') $server_prosesbg_start12 = 'No';
if ($server_prosesbg_finish12 == '') $server_prosesbg_finish12 = 'No';
if ($server_prosesbg_start13 == '') $server_prosesbg_start13 = 'No';
if ($server_prosesbg_finish13 == '') $server_prosesbg_finish13 = 'No';
if ($server_prosesbg_start14 == '') $server_prosesbg_start14 = 'No';
if ($server_prosesbg_finish14 == '') $server_prosesbg_finish14 = 'No';
if ($server_prosesbg_start15 == '') $server_prosesbg_start15 = 'No';
if ($server_prosesbg_finish15 == '') $server_prosesbg_finish15 = 'No';
if ($server_prosesbg_start16 == '') $server_prosesbg_start16 = 'No';
if ($server_prosesbg_finish16 == '') $server_prosesbg_finish16 = 'No';
$prosesbg_mstrID = 0;
$koneksi_prosesbg_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT prosesbg_mstrID, prosesbg_LastUpdateStamp FROM prosesbg_mstr where prosesbg_mstrID = " . $server_prosesbg_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$prosesbg_mstrID = $row_koneksi['prosesbg_mstrID'];
$koneksi_prosesbg_LastUpdateStamp = $row_koneksi['prosesbg_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($prosesbg_mstrID == 0)
{
$sql_insert = "INSERT INTO prosesbg_mstr SET prosesbg_mstrID = '" . addslashes($server_prosesbg_mstrID) . "', prosesbg_create_user = '" . addslashes($server_prosesbg_create_user) . "', prosesbg_create_time = '" . addslashes($server_prosesbg_create_time) . "', prosesbg_edit_user = '" . addslashes($server_prosesbg_edit_user) . "', prosesbg_edit_time = '" . addslashes($server_prosesbg_edit_time) . "', prosesbg_ip = '" . addslashes($server_prosesbg_ip) . "', prosesbg_SysTrxId = '" . addslashes($server_prosesbg_SysTrxId) . "', prosesbg_Active = '" . addslashes($server_prosesbg_Active) . "', prosesbg_Approve = '" . addslashes($server_prosesbg_Approve) . "', prosesbg_SyncronizeDate = '" . addslashes($server_prosesbg_SyncronizeDate) . "', prosesbg_LastExportDate = '" . addslashes($server_prosesbg_LastExportDate) . "', prosesbg_TotalImported = '" . addslashes($server_prosesbg_TotalImported) . "', prosesbg_TotalExported = '" . addslashes($server_prosesbg_TotalExported) . "', prosesbg_SF_yProsesBG = '" . addslashes($server_prosesbg_SF_yProsesBG) . "', prosesbg_Deleteable = '" . addslashes($server_prosesbg_Deleteable) . "', prosesbg_Forensic = '" . addslashes($server_prosesbg_Forensic) . "', prosesbg_PortfolioCd = '" . addslashes($server_prosesbg_PortfolioCd) . "', prosesbg_Sub_PortfolioCd = '" . addslashes($server_prosesbg_Sub_PortfolioCd) . "', prosesbg__dihapus_time = '" . addslashes($server_prosesbg__dihapus_time) . "', prosesbg__dihapus = '" . addslashes($server_prosesbg__dihapus) . "', prosesbg_LastUpdateStamp = '" . addslashes($server_prosesbg_LastUpdateStamp) . "', prosesbg_type = '" . addslashes($server_prosesbg_type) . "', prosesbg_var = '" . addslashes($server_prosesbg_var) . "', prosesbg_complete = '" . addslashes($server_prosesbg_complete) . "', prosesbg_total = '" . addslashes($server_prosesbg_total) . "', prosesbg_ke = '" . addslashes($server_prosesbg_ke) . "', prosesbg_start_time = '" . addslashes($server_prosesbg_start_time) . "', prosesbg_complete_time = '" . addslashes($server_prosesbg_complete_time) . "', prosesbg_remarks = '" . addslashes($server_prosesbg_remarks) . "', prosesbg_start01 = '" . addslashes($server_prosesbg_start01) . "', prosesbg_finish01 = '" . addslashes($server_prosesbg_finish01) . "', prosesbg_status01 = '" . addslashes($server_prosesbg_status01) . "', prosesbg_start02 = '" . addslashes($server_prosesbg_start02) . "', prosesbg_finish02 = '" . addslashes($server_prosesbg_finish02) . "', prosesbg_status02 = '" . addslashes($server_prosesbg_status02) . "', prosesbg_start03 = '" . addslashes($server_prosesbg_start03) . "', prosesbg_finish03 = '" . addslashes($server_prosesbg_finish03) . "', prosesbg_status03 = '" . addslashes($server_prosesbg_status03) . "', prosesbg_start04 = '" . addslashes($server_prosesbg_start04) . "', prosesbg_finish04 = '" . addslashes($server_prosesbg_finish04) . "', prosesbg_status04 = '" . addslashes($server_prosesbg_status04) . "', prosesbg_start05 = '" . addslashes($server_prosesbg_start05) . "', prosesbg_finish05 = '" . addslashes($server_prosesbg_finish05) . "', prosesbg_status05 = '" . addslashes($server_prosesbg_status05) . "', prosesbg_start06 = '" . addslashes($server_prosesbg_start06) . "', prosesbg_finish06 = '" . addslashes($server_prosesbg_finish06) . "', prosesbg_status06 = '" . addslashes($server_prosesbg_status06) . "', prosesbg_start07 = '" . addslashes($server_prosesbg_start07) . "', prosesbg_finish07 = '" . addslashes($server_prosesbg_finish07) . "', prosesbg_status07 = '" . addslashes($server_prosesbg_status07) . "', prosesbg_start08 = '" . addslashes($server_prosesbg_start08) . "', prosesbg_finish08 = '" . addslashes($server_prosesbg_finish08) . "', prosesbg_status08 = '" . addslashes($server_prosesbg_status08) . "', prosesbg_start09 = '" . addslashes($server_prosesbg_start09) . "', prosesbg_finish09 = '" . addslashes($server_prosesbg_finish09) . "', prosesbg_status09 = '" . addslashes($server_prosesbg_status09) . "', prosesbg_Period = '" . addslashes($server_prosesbg_Period) . "', prosesbg_start10 = '" . addslashes($server_prosesbg_start10) . "', prosesbg_finish10 = '" . addslashes($server_prosesbg_finish10) . "', prosesbg_status10 = '" . addslashes($server_prosesbg_status10) . "', prosesbg_start11 = '" . addslashes($server_prosesbg_start11) . "', prosesbg_finish11 = '" . addslashes($server_prosesbg_finish11) . "', prosesbg_status11 = '" . addslashes($server_prosesbg_status11) . "', prosesbg_start12 = '" . addslashes($server_prosesbg_start12) . "', prosesbg_finish12 = '" . addslashes($server_prosesbg_finish12) . "', prosesbg_status12 = '" . addslashes($server_prosesbg_status12) . "', prosesbg_start13 = '" . addslashes($server_prosesbg_start13) . "', prosesbg_finish13 = '" . addslashes($server_prosesbg_finish13) . "', prosesbg_status13 = '" . addslashes($server_prosesbg_status13) . "', prosesbg_start14 = '" . addslashes($server_prosesbg_start14) . "', prosesbg_finish14 = '" . addslashes($server_prosesbg_finish14) . "', prosesbg_status14 = '" . addslashes($server_prosesbg_status14) . "', prosesbg_start15 = '" . addslashes($server_prosesbg_start15) . "', prosesbg_finish15 = '" . addslashes($server_prosesbg_finish15) . "', prosesbg_status15 = '" . addslashes($server_prosesbg_status15) . "', prosesbg_start16 = '" . addslashes($server_prosesbg_start16) . "', prosesbg_finish16 = '" . addslashes($server_prosesbg_finish16) . "', prosesbg_status16 = '" . addslashes($server_prosesbg_status16) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert prosesbg=>' . $err_msg;
echo "\n";
echo 'Insert prosesbg=>' . $sql_insert;
echo "\n";
}
}
ELSE
{
$sql_update = "UPDATE prosesbg_mstr SET prosesbg_create_user = '" . addslashes($server_prosesbg_create_user) . "', prosesbg_create_time = '" . addslashes($server_prosesbg_create_time) . "', prosesbg_edit_user = '" . addslashes($server_prosesbg_edit_user) . "', prosesbg_edit_time = '" . addslashes($server_prosesbg_edit_time) . "', prosesbg_ip = '" . addslashes($server_prosesbg_ip) . "', prosesbg_SysTrxId = '" . addslashes($server_prosesbg_SysTrxId) . "', prosesbg_Active = '" . addslashes($server_prosesbg_Active) . "', prosesbg_Approve = '" . addslashes($server_prosesbg_Approve) . "', prosesbg_SyncronizeDate = '" . addslashes($server_prosesbg_SyncronizeDate) . "', prosesbg_LastExportDate = '" . addslashes($server_prosesbg_LastExportDate) . "', prosesbg_TotalImported = '" . addslashes($server_prosesbg_TotalImported) . "', prosesbg_TotalExported = '" . addslashes($server_prosesbg_TotalExported) . "', prosesbg_SF_yProsesBG = '" . addslashes($server_prosesbg_SF_yProsesBG) . "', prosesbg_Deleteable = '" . addslashes($server_prosesbg_Deleteable) . "', prosesbg_Forensic = '" . addslashes($server_prosesbg_Forensic) . "', prosesbg_PortfolioCd = '" . addslashes($server_prosesbg_PortfolioCd) . "', prosesbg_Sub_PortfolioCd = '" . addslashes($server_prosesbg_Sub_PortfolioCd) . "', prosesbg__dihapus_time = '" . addslashes($server_prosesbg__dihapus_time) . "', prosesbg__dihapus = '" . addslashes($server_prosesbg__dihapus) . "', prosesbg_LastUpdateStamp = '" . addslashes($server_prosesbg_LastUpdateStamp) . "', prosesbg_type = '" . addslashes($server_prosesbg_type) . "', prosesbg_var = '" . addslashes($server_prosesbg_var) . "', prosesbg_complete = '" . addslashes($server_prosesbg_complete) . "', prosesbg_total = '" . addslashes($server_prosesbg_total) . "', prosesbg_ke = '" . addslashes($server_prosesbg_ke) . "', prosesbg_start_time = '" . addslashes($server_prosesbg_start_time) . "', prosesbg_complete_time = '" . addslashes($server_prosesbg_complete_time) . "', prosesbg_remarks = '" . addslashes($server_prosesbg_remarks) . "', prosesbg_start01 = '" . addslashes($server_prosesbg_start01) . "', prosesbg_finish01 = '" . addslashes($server_prosesbg_finish01) . "', prosesbg_status01 = '" . addslashes($server_prosesbg_status01) . "', prosesbg_start02 = '" . addslashes($server_prosesbg_start02) . "', prosesbg_finish02 = '" . addslashes($server_prosesbg_finish02) . "', prosesbg_status02 = '" . addslashes($server_prosesbg_status02) . "', prosesbg_start03 = '" . addslashes($server_prosesbg_start03) . "', prosesbg_finish03 = '" . addslashes($server_prosesbg_finish03) . "', prosesbg_status03 = '" . addslashes($server_prosesbg_status03) . "', prosesbg_start04 = '" . addslashes($server_prosesbg_start04) . "', prosesbg_finish04 = '" . addslashes($server_prosesbg_finish04) . "', prosesbg_status04 = '" . addslashes($server_prosesbg_status04) . "', prosesbg_start05 = '" . addslashes($server_prosesbg_start05) . "', prosesbg_finish05 = '" . addslashes($server_prosesbg_finish05) . "', prosesbg_status05 = '" . addslashes($server_prosesbg_status05) . "', prosesbg_start06 = '" . addslashes($server_prosesbg_start06) . "', prosesbg_finish06 = '" . addslashes($server_prosesbg_finish06) . "', prosesbg_status06 = '" . addslashes($server_prosesbg_status06) . "', prosesbg_start07 = '" . addslashes($server_prosesbg_start07) . "', prosesbg_finish07 = '" . addslashes($server_prosesbg_finish07) . "', prosesbg_status07 = '" . addslashes($server_prosesbg_status07) . "', prosesbg_start08 = '" . addslashes($server_prosesbg_start08) . "', prosesbg_finish08 = '" . addslashes($server_prosesbg_finish08) . "', prosesbg_status08 = '" . addslashes($server_prosesbg_status08) . "', prosesbg_start09 = '" . addslashes($server_prosesbg_start09) . "', prosesbg_finish09 = '" . addslashes($server_prosesbg_finish09) . "', prosesbg_status09 = '" . addslashes($server_prosesbg_status09) . "', prosesbg_Period = '" . addslashes($server_prosesbg_Period) . "', prosesbg_start10 = '" . addslashes($server_prosesbg_start10) . "', prosesbg_finish10 = '" . addslashes($server_prosesbg_finish10) . "', prosesbg_status10 = '" . addslashes($server_prosesbg_status10) . "', prosesbg_start11 = '" . addslashes($server_prosesbg_start11) . "', prosesbg_finish11 = '" . addslashes($server_prosesbg_finish11) . "', prosesbg_status11 = '" . addslashes($server_prosesbg_status11) . "', prosesbg_start12 = '" . addslashes($server_prosesbg_start12) . "', prosesbg_finish12 = '" . addslashes($server_prosesbg_finish12) . "', prosesbg_status12 = '" . addslashes($server_prosesbg_status12) . "', prosesbg_start13 = '" . addslashes($server_prosesbg_start13) . "', prosesbg_finish13 = '" . addslashes($server_prosesbg_finish13) . "', prosesbg_status13 = '" . addslashes($server_prosesbg_status13) . "', prosesbg_start14 = '" . addslashes($server_prosesbg_start14) . "', prosesbg_finish14 = '" . addslashes($server_prosesbg_finish14) . "', prosesbg_status14 = '" . addslashes($server_prosesbg_status14) . "', prosesbg_start15 = '" . addslashes($server_prosesbg_start15) . "', prosesbg_finish15 = '" . addslashes($server_prosesbg_finish15) . "', prosesbg_status15 = '" . addslashes($server_prosesbg_status15) . "', prosesbg_start16 = '" . addslashes($server_prosesbg_start16) . "', prosesbg_finish16 = '" . addslashes($server_prosesbg_finish16) . "', prosesbg_status16 = '" . addslashes($server_prosesbg_status16) . "' WHERE prosesbg_mstrID = " . $server_prosesbg_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'Insert prosesbg=>' . $err_msg;
echo "\n";
echo 'Insert prosesbg=>' . $sql_update;
echo "\n";
}
}
}
else if ($t4973 == 'sellprice_mstr')
{
echo "\n";
echo 'Sebelum sellprice_mstr=>' . $err_msg;
echo "\n";
list($server_sellprice_mstrID, $server_sellprice_create_user, $server_sellprice_create_time, $server_sellprice_edit_user, $server_sellprice_edit_time, $server_sellprice_ip, $server_sellprice_SysTrxId, $server_sellprice_Active, $server_sellprice_Approve, $server_sellprice_SyncronizeDate, $server_sellprice_LastExportDate, $server_sellprice_TotalImported, $server_sellprice_TotalExported, $server_sellprice_LastUpdateStamp, $server_sellprice_idRow, $server_sellprice_PLNo, $server_sellprice_PLname, $server_sellprice_ItemCd, $server_sellprice_ItemSKUCd, $server_sellprice_Barcode, $server_sellprice_BottomPrice, $server_sellprice_UpperPrice, $server_sellprice_LastPurchase, $server_sellprice_CurrencyCd, $server_sellprice_Price, $server_sellprice_NewPrice, $server_sellprice_NewBottomPrice, $server_sellprice_NewUpperprice, $server_sellprice_isNew, $server_sellprice_SF_ItemSKUBarcodePrice, $server_sellprice_Deleteable, $server_sellprice_Forensic, $server_sellprice_PortfolioCd, $server_sellprice_Sub_PortfolioCd, $server_sellprice_IsVATInclude, $server_sellprice_currency_mstrID, $server_sellprice_productitem_mstrID, $server_sellprice_itemsku_mstrID, $server_sellprice__dihapus, $server_sellprice__dihapus_time, $server_sellprice_barcode_mstrID, $server_sellprice_PriceAwal) = explode('`', $line);
if ($server_sellprice_Active == '') $server_sellprice_Active = 'No';
if ($server_sellprice_Approve == '') $server_sellprice_Approve = 0;
if ($server_sellprice_TotalImported == '') $server_sellprice_TotalImported = 0;
if ($server_sellprice_TotalExported == '') $server_sellprice_TotalExported = 0;
if ($server_sellprice_idRow == '') $server_sellprice_idRow = 0;
if ($server_sellprice_PLNo == '') $server_sellprice_PLNo = 0;
if ($server_sellprice_BottomPrice == '') $server_sellprice_BottomPrice = 0;
if ($server_sellprice_UpperPrice == '') $server_sellprice_UpperPrice = 0;
if ($server_sellprice_LastPurchase == '') $server_sellprice_LastPurchase = 0;
if ($server_sellprice_Price == '') $server_sellprice_Price = 0;
if ($server_sellprice_NewPrice == '') $server_sellprice_NewPrice = 0;
if ($server_sellprice_NewBottomPrice == '') $server_sellprice_NewBottomPrice = 0;
if ($server_sellprice_NewUpperprice == '') $server_sellprice_NewUpperprice = 0;
if ($server_sellprice_isNew == '') $server_sellprice_isNew = 'No';
if ($server_sellprice_Deleteable == '') $server_sellprice_Deleteable = 'No';
if ($server_sellprice_IsVATInclude == '') $server_sellprice_IsVATInclude = 'No';
if ($server_sellprice_currency_mstrID == '') $server_sellprice_currency_mstrID = 0;
if ($server_sellprice_productitem_mstrID == '') $server_sellprice_productitem_mstrID = 0;
if ($server_sellprice_itemsku_mstrID == '') $server_sellprice_itemsku_mstrID = 0;
if ($server_sellprice__dihapus == '') $server_sellprice__dihapus = 'No';
if ($server_sellprice_barcode_mstrID == '') $server_sellprice_barcode_mstrID = 0;
if ($server_sellprice_PriceAwal == '') $server_sellprice_PriceAwal = 0;
$sellprice_mstrID = 0;
$koneksi_sellprice_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT sellprice_mstrID, sellprice_LastUpdateStamp FROM sellprice_mstr where sellprice_mstrID = " . $server_sellprice_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$sellprice_mstrID = $row_koneksi['sellprice_mstrID'];
$koneksi_sellprice_LastUpdateStamp = $row_koneksi['sellprice_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($sellprice_mstrID == 0)
{
$sql_delete = "DELETE FROM sellprice_mstr where sellprice_PLNo = '" . addslashes($server_sellprice_PLNo) . "' and sellprice_ItemCd = '" . addslashes($server_sellprice_ItemCd) . "' and sellprice_ItemSKUCd = '" . addslashes($server_sellprice_ItemSKUCd) . "' and sellprice_Barcode = '" . addslashes($server_sellprice_Barcode) . "' and sellprice__dihapus_time = '" . addslashes($server_sellprice__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_insert = "INSERT INTO sellprice_mstr SET sellprice_mstrID = '" . addslashes($server_sellprice_mstrID) . "', sellprice_create_user = '" . addslashes($server_sellprice_create_user) . "', sellprice_create_time = '" . addslashes($server_sellprice_create_time) . "', sellprice_edit_user = '" . addslashes($server_sellprice_edit_user) . "', sellprice_edit_time = '" . addslashes($server_sellprice_edit_time) . "', sellprice_ip = '" . addslashes($server_sellprice_ip) . "', sellprice_SysTrxId = '" . addslashes($server_sellprice_SysTrxId) . "', sellprice_Active = '" . addslashes($server_sellprice_Active) . "', sellprice_Approve = '" . addslashes($server_sellprice_Approve) . "', sellprice_SyncronizeDate = '" . addslashes($server_sellprice_SyncronizeDate) . "', sellprice_LastExportDate = '" . addslashes($server_sellprice_LastExportDate) . "', sellprice_TotalImported = '" . addslashes($server_sellprice_TotalImported) . "', sellprice_TotalExported = '" . addslashes($server_sellprice_TotalExported) . "', sellprice_LastUpdateStamp = '" . addslashes($server_sellprice_LastUpdateStamp) . "', sellprice_idRow = '" . addslashes($server_sellprice_idRow) . "', sellprice_PLNo = '" . addslashes($server_sellprice_PLNo) . "', sellprice_PLname = '" . addslashes($server_sellprice_PLname) . "', sellprice_ItemCd = '" . addslashes($server_sellprice_ItemCd) . "', sellprice_ItemSKUCd = '" . addslashes($server_sellprice_ItemSKUCd) . "', sellprice_Barcode = '" . addslashes($server_sellprice_Barcode) . "', sellprice_BottomPrice = '" . addslashes($server_sellprice_BottomPrice) . "', sellprice_UpperPrice = '" . addslashes($server_sellprice_UpperPrice) . "', sellprice_LastPurchase = '" . addslashes($server_sellprice_LastPurchase) . "', sellprice_CurrencyCd = '" . addslashes($server_sellprice_CurrencyCd) . "', sellprice_Price = '" . addslashes($server_sellprice_Price) . "', sellprice_NewPrice = '" . addslashes($server_sellprice_NewPrice) . "', sellprice_NewBottomPrice = '" . addslashes($server_sellprice_NewBottomPrice) . "', sellprice_NewUpperprice = '" . addslashes($server_sellprice_NewUpperprice) . "', sellprice_isNew = '" . addslashes($server_sellprice_isNew) . "', sellprice_SF_ItemSKUBarcodePrice = '" . addslashes($server_sellprice_SF_ItemSKUBarcodePrice) . "', sellprice_Deleteable = '" . addslashes($server_sellprice_Deleteable) . "', sellprice_Forensic = '" . addslashes($server_sellprice_Forensic) . "', sellprice_PortfolioCd = '" . addslashes($server_sellprice_PortfolioCd) . "', sellprice_Sub_PortfolioCd = '" . addslashes($server_sellprice_Sub_PortfolioCd) . "', sellprice_IsVATInclude = '" . addslashes($server_sellprice_IsVATInclude) . "', sellprice_currency_mstrID = '" . addslashes($server_sellprice_currency_mstrID) . "', sellprice_productitem_mstrID = '" . addslashes($server_sellprice_productitem_mstrID) . "', sellprice_itemsku_mstrID = '" . addslashes($server_sellprice_itemsku_mstrID) . "', sellprice__dihapus = '" . addslashes($server_sellprice__dihapus) . "', sellprice__dihapus_time = '" . addslashes($server_sellprice__dihapus_time) . "', sellprice_barcode_mstrID = '" . addslashes($server_sellprice_barcode_mstrID) . "', sellprice_PriceAwal = '" . addslashes($server_sellprice_PriceAwal) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
$sql_koneksi = "SELECT sellprice_mstrID FROM sellprice_mstr where sellprice_PLNo = '" . addslashes($server_sellprice_PLNo) . "' sellprice_ItemCd = '" . addslashes($server_sellprice_ItemCd) . "' sellprice_ItemSKUCd = '" . addslashes($server_sellprice_ItemSKUCd) . "' sellprice_Barcode = '" . addslashes($server_sellprice_Barcode) . "' sellprice__dihapus_time = '" . addslashes($server_sellprice__dihapus_time) . "'";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
echo "\n";
echo 'Sudah ada sellprice_mstrID=>' . $row_koneksi['sellprice_mstrID'];
echo "\n";
echo 'sellprice_PLNo=' . addslashes($server_sellprice_PLNo);
echo "\n";
echo ' ==>sellprice_ItemCd=' . addslashes($server_sellprice_ItemCd);
echo "\n";
echo '==>sellprice_ItemSKUCd' . addslashes($server_sellprice_ItemSKUCd);
echo "\n";
echo ' ==>sellprice_Barcode=' . addslashes($server_sellprice_Barcode);
echo "\n";
echo ' ==>sellprice__dihapus_time=' . addslashes($server_sellprice__dihapus_time);
}
mysqli_free_result($result_koneksi);
echo "\n";
echo 'Insert sellprice_mstr=>' . $err_msg;
echo "\n";
echo 'Insert server_sellprice_mstrID=>' . $server_sellprice_mstrID;
echo "\n";
echo 'Insert sellprice_mstr=>' . $sql_insert;
echo "\n";
sleep(3000);
}
}
ELSE
{
$sql_delete = "DELETE FROM sellprice_mstr where sellprice_mstrID <> " . $server_sellprice_mstrID . " and sellprice_PLNo = '" . addslashes($server_sellprice_PLNo) . "' and sellprice_ItemCd = '" . addslashes($server_sellprice_ItemCd) . "' and sellprice_ItemSKUCd = '" . addslashes($server_sellprice_ItemSKUCd) . "' and sellprice_Barcode = '" . addslashes($server_sellprice_Barcode) . "' and sellprice__dihapus_time = '" . addslashes($server_sellprice__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_delete) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
$sql_update = "UPDATE sellprice_mstr SET sellprice_create_user = '" . addslashes($server_sellprice_create_user) . "', sellprice_create_time = '" . addslashes($server_sellprice_create_time) . "', sellprice_edit_user = '" . addslashes($server_sellprice_edit_user) . "', sellprice_edit_time = '" . addslashes($server_sellprice_edit_time) . "', sellprice_ip = '" . addslashes($server_sellprice_ip) . "', sellprice_SysTrxId = '" . addslashes($server_sellprice_SysTrxId) . "', sellprice_Active = '" . addslashes($server_sellprice_Active) . "', sellprice_Approve = '" . addslashes($server_sellprice_Approve) . "', sellprice_SyncronizeDate = '" . addslashes($server_sellprice_SyncronizeDate) . "', sellprice_LastExportDate = '" . addslashes($server_sellprice_LastExportDate) . "', sellprice_TotalImported = '" . addslashes($server_sellprice_TotalImported) . "', sellprice_TotalExported = '" . addslashes($server_sellprice_TotalExported) . "', sellprice_LastUpdateStamp = '" . addslashes($server_sellprice_LastUpdateStamp) . "', sellprice_idRow = '" . addslashes($server_sellprice_idRow) . "', sellprice_PLNo = '" . addslashes($server_sellprice_PLNo) . "', sellprice_PLname = '" . addslashes($server_sellprice_PLname) . "', sellprice_ItemCd = '" . addslashes($server_sellprice_ItemCd) . "', sellprice_ItemSKUCd = '" . addslashes($server_sellprice_ItemSKUCd) . "', sellprice_Barcode = '" . addslashes($server_sellprice_Barcode) . "', sellprice_BottomPrice = '" . addslashes($server_sellprice_BottomPrice) . "', sellprice_UpperPrice = '" . addslashes($server_sellprice_UpperPrice) . "', sellprice_LastPurchase = '" . addslashes($server_sellprice_LastPurchase) . "', sellprice_CurrencyCd = '" . addslashes($server_sellprice_CurrencyCd) . "', sellprice_Price = '" . addslashes($server_sellprice_Price) . "', sellprice_NewPrice = '" . addslashes($server_sellprice_NewPrice) . "', sellprice_NewBottomPrice = '" . addslashes($server_sellprice_NewBottomPrice) . "', sellprice_NewUpperprice = '" . addslashes($server_sellprice_NewUpperprice) . "', sellprice_isNew = '" . addslashes($server_sellprice_isNew) . "', sellprice_SF_ItemSKUBarcodePrice = '" . addslashes($server_sellprice_SF_ItemSKUBarcodePrice) . "', sellprice_Deleteable = '" . addslashes($server_sellprice_Deleteable) . "', sellprice_Forensic = '" . addslashes($server_sellprice_Forensic) . "', sellprice_PortfolioCd = '" . addslashes($server_sellprice_PortfolioCd) . "', sellprice_Sub_PortfolioCd = '" . addslashes($server_sellprice_Sub_PortfolioCd) . "', sellprice_IsVATInclude = '" . addslashes($server_sellprice_IsVATInclude) . "', sellprice_currency_mstrID = '" . addslashes($server_sellprice_currency_mstrID) . "', sellprice_productitem_mstrID = '" . addslashes($server_sellprice_productitem_mstrID) . "', sellprice_itemsku_mstrID = '" . addslashes($server_sellprice_itemsku_mstrID) . "', sellprice__dihapus = '" . addslashes($server_sellprice__dihapus) . "', sellprice__dihapus_time = '" . addslashes($server_sellprice__dihapus_time) . "', sellprice_barcode_mstrID = '" . addslashes($server_sellprice_barcode_mstrID) . "', sellprice_PriceAwal = '" . addslashes($server_sellprice_PriceAwal) . "' WHERE sellprice_mstrID = " . $server_sellprice_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg != '')
{
echo "\n";
echo 'UPDATE server_sellprice_mstrID=>' . $server_sellprice_mstrID;
echo "\n";
echo "\n";
echo 'UPDATE sellprice_mstr=>' . $err_msg;
echo "\n";
echo 'UPDATE sellprice_mstr=>' . $sql_update;
echo "\n";
sleep(3000);
}
}
}
else if ($t4973 == 'promotionh_header')
{
list($server_promotionh_headerID, $server_promotionh_create_user, $server_promotionh_create_time, $server_promotionh_edit_user, $server_promotionh_edit_time, $server_promotionh_ip, $server_promotionh_SysTrxId, $server_promotionh_Active, $server_promotionh_Approve, $server_promotionh_SyncronizeDate, $server_promotionh_LastExportDate, $server_promotionh_TotalImported, $server_promotionh_TotalExported, $server_promotionh_LastUpdateStamp, $server_promotionh_idRow, $server_promotionh_PromotionCd, $server_promotionh_PromotionDate, $server_promotionh_PromotionName, $server_promotionh_PromotionTypeCd, $server_promotionh_TotalPayment, $server_promotionh_CardCd, $server_promotionh_PromoStatusCd, $server_promotionh_ReferenceNo, $server_promotionh_Description, $server_promotionh_FromDate, $server_promotionh_ToDate, $server_promotionh_FromTime, $server_promotionh_ToTime, $server_promotionh_PostingDate, $server_promotionh_PostingBy, $server_promotionh_SF_Promotion, $server_promotionh_Deleteable, $server_promotionh_Forensic, $server_promotionh_PortfolioCd, $server_promotionh_Sub_PortfolioCd, $server_promotionh__dihapus, $server_promotionh__dihapus_time, $server_promotionh_promotiontype_mstrID, $server_promotionh_promostatus_mstrID, $server_promotionh_EDCCd, $server_promotionh_edc_mstrID, $server_promotionh_pay1PaymentCd, $server_promotionh_pay2PaymentCd, $server_promotionh_pay3PaymentCd, $server_promotionh_pay4PaymentCd, $server_promotionh_pay5PaymentCd, $server_promotionh_pay1paymentmaptoedc_mstrID, $server_promotionh_pay2paymentmaptoedc_mstrID, $server_promotionh_pay3paymentmaptoedc_mstrID, $server_promotionh_pay4paymentmaptoedc_mstrID, $server_promotionh_pay5paymentmaptoedc_mstrID, $server_promotionh_MemberTypeCd, $server_promotionh_membert_typeID, $server_promotionh_GetAllItem, $server_promotionh_GetAllItemUser, $server_promotionh_GetAllItemIP) = explode('`', $line);
if ($server_promotionh_Active == '') $server_promotionh_Active = 'No';
if ($server_promotionh_Approve == '') $server_promotionh_Approve = 0;
if ($server_promotionh_TotalImported == '') $server_promotionh_TotalImported = 0;
if ($server_promotionh_TotalExported == '') $server_promotionh_TotalExported = 0;
if ($server_promotionh_idRow == '') $server_promotionh_idRow = 0;
if ($server_promotionh_PromotionDate == '') $server_promotionh_PromotionDate = '1900-01-01';
if ($server_promotionh_TotalPayment == '') $server_promotionh_TotalPayment = 0;
if ($server_promotionh_FromDate == '') $server_promotionh_FromDate = '1900-01-01';
if ($server_promotionh_ToDate == '') $server_promotionh_ToDate = '1900-01-01';
if ($server_promotionh_PostingDate == '') $server_promotionh_PostingDate = '1900-01-01';
if ($server_promotionh_Deleteable == '') $server_promotionh_Deleteable = 'No';
if ($server_promotionh__dihapus == '') $server_promotionh__dihapus = 'No';
if ($server_promotionh_promotiontype_mstrID == '') $server_promotionh_promotiontype_mstrID = 0;
if ($server_promotionh_promostatus_mstrID == '') $server_promotionh_promostatus_mstrID = 0;
if ($server_promotionh_edc_mstrID == '') $server_promotionh_edc_mstrID = 0;
if ($server_promotionh_pay1paymentmaptoedc_mstrID == '') $server_promotionh_pay1paymentmaptoedc_mstrID = 0;
if ($server_promotionh_pay2paymentmaptoedc_mstrID == '') $server_promotionh_pay2paymentmaptoedc_mstrID = 0;
if ($server_promotionh_pay3paymentmaptoedc_mstrID == '') $server_promotionh_pay3paymentmaptoedc_mstrID = 0;
if ($server_promotionh_pay4paymentmaptoedc_mstrID == '') $server_promotionh_pay4paymentmaptoedc_mstrID = 0;
if ($server_promotionh_pay5paymentmaptoedc_mstrID == '') $server_promotionh_pay5paymentmaptoedc_mstrID = 0;
if ($server_promotionh_membert_typeID == '') $server_promotionh_membert_typeID = 0;
$promotionh_headerID = 0;
$koneksi_promotionh_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT promotionh_headerID, promotionh_LastUpdateStamp FROM promotionh_header where promotionh_headerID = " . $server_promotionh_headerID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$promotionh_headerID = $row_koneksi['promotionh_headerID'];
$koneksi_promotionh_LastUpdateStamp = $row_koneksi['promotionh_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($promotionh_headerID == 0)
{
$sql_insert = "INSERT INTO promotionh_header SET promotionh_headerID = '" . addslashes($server_promotionh_headerID) . "', promotionh_create_user = '" . addslashes($server_promotionh_create_user) . "', promotionh_create_time = '" . addslashes($server_promotionh_create_time) . "', promotionh_edit_user = '" . addslashes($server_promotionh_edit_user) . "', promotionh_edit_time = '" . addslashes($server_promotionh_edit_time) . "', promotionh_ip = '" . addslashes($server_promotionh_ip) . "', promotionh_SysTrxId = '" . addslashes($server_promotionh_SysTrxId) . "', promotionh_Active = '" . addslashes($server_promotionh_Active) . "', promotionh_Approve = '" . addslashes($server_promotionh_Approve) . "', promotionh_SyncronizeDate = '" . addslashes($server_promotionh_SyncronizeDate) . "', promotionh_LastExportDate = '" . addslashes($server_promotionh_LastExportDate) . "', promotionh_TotalImported = '" . addslashes($server_promotionh_TotalImported) . "', promotionh_TotalExported = '" . addslashes($server_promotionh_TotalExported) . "', promotionh_LastUpdateStamp = '" . addslashes($server_promotionh_LastUpdateStamp) . "', promotionh_idRow = '" . addslashes($server_promotionh_idRow) . "', promotionh_PromotionCd = '" . addslashes($server_promotionh_PromotionCd) . "', promotionh_PromotionDate = '" . addslashes($server_promotionh_PromotionDate) . "', promotionh_PromotionName = '" . addslashes($server_promotionh_PromotionName) . "', promotionh_PromotionTypeCd = '" . addslashes($server_promotionh_PromotionTypeCd) . "', promotionh_TotalPayment = '" . addslashes($server_promotionh_TotalPayment) . "', promotionh_CardCd = '" . addslashes($server_promotionh_CardCd) . "', promotionh_PromoStatusCd = '" . addslashes($server_promotionh_PromoStatusCd) . "', promotionh_ReferenceNo = '" . addslashes($server_promotionh_ReferenceNo) . "', promotionh_Description = '" . addslashes($server_promotionh_Description) . "', promotionh_FromDate = '" . addslashes($server_promotionh_FromDate) . "', promotionh_ToDate = '" . addslashes($server_promotionh_ToDate) . "', promotionh_FromTime = '" . addslashes($server_promotionh_FromTime) . "', promotionh_ToTime = '" . addslashes($server_promotionh_ToTime) . "', promotionh_PostingDate = '" . addslashes($server_promotionh_PostingDate) . "', promotionh_PostingBy = '" . addslashes($server_promotionh_PostingBy) . "', promotionh_SF_Promotion = '" . addslashes($server_promotionh_SF_Promotion) . "', promotionh_Deleteable = '" . addslashes($server_promotionh_Deleteable) . "', promotionh_Forensic = '" . addslashes($server_promotionh_Forensic) . "', promotionh_PortfolioCd = '" . addslashes($server_promotionh_PortfolioCd) . "', promotionh_Sub_PortfolioCd = '" . addslashes($server_promotionh_Sub_PortfolioCd) . "', promotionh__dihapus = '" . addslashes($server_promotionh__dihapus) . "', promotionh__dihapus_time = '" . addslashes($server_promotionh__dihapus_time) . "', promotionh_promotiontype_mstrID = '" . addslashes($server_promotionh_promotiontype_mstrID) . "', promotionh_promostatus_mstrID = '" . addslashes($server_promotionh_promostatus_mstrID) . "', promotionh_EDCCd = '" . addslashes($server_promotionh_EDCCd) . "', promotionh_edc_mstrID = '" . addslashes($server_promotionh_edc_mstrID) . "', promotionh_pay1PaymentCd = '" . addslashes($server_promotionh_pay1PaymentCd) . "', promotionh_pay2PaymentCd = '" . addslashes($server_promotionh_pay2PaymentCd) . "', promotionh_pay3PaymentCd = '" . addslashes($server_promotionh_pay3PaymentCd) . "', promotionh_pay4PaymentCd = '" . addslashes($server_promotionh_pay4PaymentCd) . "', promotionh_pay5PaymentCd = '" . addslashes($server_promotionh_pay5PaymentCd) . "', promotionh_pay1paymentmaptoedc_mstrID = '" . addslashes($server_promotionh_pay1paymentmaptoedc_mstrID) . "', promotionh_pay2paymentmaptoedc_mstrID = '" . addslashes($server_promotionh_pay2paymentmaptoedc_mstrID) . "', promotionh_pay3paymentmaptoedc_mstrID = '" . addslashes($server_promotionh_pay3paymentmaptoedc_mstrID) . "', promotionh_pay4paymentmaptoedc_mstrID = '" . addslashes($server_promotionh_pay4paymentmaptoedc_mstrID) . "', promotionh_pay5paymentmaptoedc_mstrID = '" . addslashes($server_promotionh_pay5paymentmaptoedc_mstrID) . "', promotionh_MemberTypeCd = '" . addslashes($server_promotionh_MemberTypeCd) . "', promotionh_membert_typeID = '" . addslashes($server_promotionh_membert_typeID) . "', promotionh_GetAllItem = '" . addslashes($server_promotionh_GetAllItem) . "', promotionh_GetAllItemUser = '" . addslashes($server_promotionh_GetAllItemUser) . "', promotionh_GetAllItemIP = '" . addslashes($server_promotionh_GetAllItemIP) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
ELSE
{
$sql_update = "UPDATE promotionh_header SET promotionh_create_user = '" . addslashes($server_promotionh_create_user) . "', promotionh_create_time = '" . addslashes($server_promotionh_create_time) . "', promotionh_edit_user = '" . addslashes($server_promotionh_edit_user) . "', promotionh_edit_time = '" . addslashes($server_promotionh_edit_time) . "', promotionh_ip = '" . addslashes($server_promotionh_ip) . "', promotionh_SysTrxId = '" . addslashes($server_promotionh_SysTrxId) . "', promotionh_Active = '" . addslashes($server_promotionh_Active) . "', promotionh_Approve = '" . addslashes($server_promotionh_Approve) . "', promotionh_SyncronizeDate = '" . addslashes($server_promotionh_SyncronizeDate) . "', promotionh_LastExportDate = '" . addslashes($server_promotionh_LastExportDate) . "', promotionh_TotalImported = '" . addslashes($server_promotionh_TotalImported) . "', promotionh_TotalExported = '" . addslashes($server_promotionh_TotalExported) . "', promotionh_LastUpdateStamp = '" . addslashes($server_promotionh_LastUpdateStamp) . "', promotionh_idRow = '" . addslashes($server_promotionh_idRow) . "', promotionh_PromotionCd = '" . addslashes($server_promotionh_PromotionCd) . "', promotionh_PromotionDate = '" . addslashes($server_promotionh_PromotionDate) . "', promotionh_PromotionName = '" . addslashes($server_promotionh_PromotionName) . "', promotionh_PromotionTypeCd = '" . addslashes($server_promotionh_PromotionTypeCd) . "', promotionh_TotalPayment = '" . addslashes($server_promotionh_TotalPayment) . "', promotionh_CardCd = '" . addslashes($server_promotionh_CardCd) . "', promotionh_PromoStatusCd = '" . addslashes($server_promotionh_PromoStatusCd) . "', promotionh_ReferenceNo = '" . addslashes($server_promotionh_ReferenceNo) . "', promotionh_Description = '" . addslashes($server_promotionh_Description) . "', promotionh_FromDate = '" . addslashes($server_promotionh_FromDate) . "', promotionh_ToDate = '" . addslashes($server_promotionh_ToDate) . "', promotionh_FromTime = '" . addslashes($server_promotionh_FromTime) . "', promotionh_ToTime = '" . addslashes($server_promotionh_ToTime) . "', promotionh_PostingDate = '" . addslashes($server_promotionh_PostingDate) . "', promotionh_PostingBy = '" . addslashes($server_promotionh_PostingBy) . "', promotionh_SF_Promotion = '" . addslashes($server_promotionh_SF_Promotion) . "', promotionh_Deleteable = '" . addslashes($server_promotionh_Deleteable) . "', promotionh_Forensic = '" . addslashes($server_promotionh_Forensic) . "', promotionh_PortfolioCd = '" . addslashes($server_promotionh_PortfolioCd) . "', promotionh_Sub_PortfolioCd = '" . addslashes($server_promotionh_Sub_PortfolioCd) . "', promotionh__dihapus = '" . addslashes($server_promotionh__dihapus) . "', promotionh__dihapus_time = '" . addslashes($server_promotionh__dihapus_time) . "', promotionh_promotiontype_mstrID = '" . addslashes($server_promotionh_promotiontype_mstrID) . "', promotionh_promostatus_mstrID = '" . addslashes($server_promotionh_promostatus_mstrID) . "', promotionh_EDCCd = '" . addslashes($server_promotionh_EDCCd) . "', promotionh_edc_mstrID = '" . addslashes($server_promotionh_edc_mstrID) . "', promotionh_pay1PaymentCd = '" . addslashes($server_promotionh_pay1PaymentCd) . "', promotionh_pay2PaymentCd = '" . addslashes($server_promotionh_pay2PaymentCd) . "', promotionh_pay3PaymentCd = '" . addslashes($server_promotionh_pay3PaymentCd) . "', promotionh_pay4PaymentCd = '" . addslashes($server_promotionh_pay4PaymentCd) . "', promotionh_pay5PaymentCd = '" . addslashes($server_promotionh_pay5PaymentCd) . "', promotionh_pay1paymentmaptoedc_mstrID = '" . addslashes($server_promotionh_pay1paymentmaptoedc_mstrID) . "', promotionh_pay2paymentmaptoedc_mstrID = '" . addslashes($server_promotionh_pay2paymentmaptoedc_mstrID) . "', promotionh_pay3paymentmaptoedc_mstrID = '" . addslashes($server_promotionh_pay3paymentmaptoedc_mstrID) . "', promotionh_pay4paymentmaptoedc_mstrID = '" . addslashes($server_promotionh_pay4paymentmaptoedc_mstrID) . "', promotionh_pay5paymentmaptoedc_mstrID = '" . addslashes($server_promotionh_pay5paymentmaptoedc_mstrID) . "', promotionh_MemberTypeCd = '" . addslashes($server_promotionh_MemberTypeCd) . "', promotionh_membert_typeID = '" . addslashes($server_promotionh_membert_typeID) . "', promotionh_GetAllItem = '" . addslashes($server_promotionh_GetAllItem) . "', promotionh_GetAllItemUser = '" . addslashes($server_promotionh_GetAllItemUser) . "', promotionh_GetAllItemIP = '" . addslashes($server_promotionh_GetAllItemIP) . "' WHERE promotionh_headerID = " . $server_promotionh_headerID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
}
else if ($t4973 == 'promotionl_location')
{
list($server_promotionl_locationID, $server_promotionl_create_user, $server_promotionl_create_time, $server_promotionl_edit_user, $server_promotionl_edit_time, $server_promotionl_ip, $server_promotionl_SysTrxId, $server_promotionl_Active, $server_promotionl_Approve, $server_promotionl_SyncronizeDate, $server_promotionl_LastExportDate, $server_promotionl_TotalImported, $server_promotionl_TotalExported, $server_promotionl_LastUpdateStamp, $server_promotionl_idRow, $server_promotionl_PromotionCd, $server_promotionl_ContactCd, $server_promotionl_AddressCd, $server_promotionl_LocationCd, $server_promotionl_Description, $server_promotionl_SF_PromotionLocation, $server_promotionl_Deleteable, $server_promotionl_Forensic, $server_promotionl_PortfolioCd, $server_promotionl_Sub_PortfolioCd, $server_promotionl_promotionh_headerID, $server_promotionl_contact_mstrID, $server_promotionl_add_mstrID, $server_promotionl_loc_mstrID, $server_promotionl_membert_typeID, $server_promotionl__dihapus, $server_promotionl__dihapus_time) = explode('`', $line);
if ($server_promotionl_Active == '') $server_promotionl_Active = 'No';
if ($server_promotionl_Approve == '') $server_promotionl_Approve = 0;
if ($server_promotionl_TotalImported == '') $server_promotionl_TotalImported = 0;
if ($server_promotionl_TotalExported == '') $server_promotionl_TotalExported = 0;
if ($server_promotionl_idRow == '') $server_promotionl_idRow = 0;
if ($server_promotionl_Deleteable == '') $server_promotionl_Deleteable = 'No';
if ($server_promotionl_promotionh_headerID == '') $server_promotionl_promotionh_headerID = 0;
if ($server_promotionl_contact_mstrID == '') $server_promotionl_contact_mstrID = 0;
if ($server_promotionl_add_mstrID == '') $server_promotionl_add_mstrID = 0;
if ($server_promotionl_loc_mstrID == '') $server_promotionl_loc_mstrID = 0;
if ($server_promotionl_membert_typeID == '') $server_promotionl_membert_typeID = 0;
if ($server_promotionl__dihapus == '') $server_promotionl__dihapus = 'No';
$promotionl_locationID = 0;
$koneksi_promotionl_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT promotionl_locationID, promotionl_LastUpdateStamp FROM promotionl_location where promotionl_locationID = " . $server_promotionl_locationID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$promotionl_locationID = $row_koneksi['promotionl_locationID'];
$koneksi_promotionl_LastUpdateStamp = $row_koneksi['promotionl_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($promotionl_locationID == 0)
{
$sql_insert = "INSERT INTO promotionl_location SET promotionl_locationID = '" . addslashes($server_promotionl_locationID) . "', promotionl_create_user = '" . addslashes($server_promotionl_create_user) . "', promotionl_create_time = '" . addslashes($server_promotionl_create_time) . "', promotionl_edit_user = '" . addslashes($server_promotionl_edit_user) . "', promotionl_edit_time = '" . addslashes($server_promotionl_edit_time) . "', promotionl_ip = '" . addslashes($server_promotionl_ip) . "', promotionl_SysTrxId = '" . addslashes($server_promotionl_SysTrxId) . "', promotionl_Active = '" . addslashes($server_promotionl_Active) . "', promotionl_Approve = '" . addslashes($server_promotionl_Approve) . "', promotionl_SyncronizeDate = '" . addslashes($server_promotionl_SyncronizeDate) . "', promotionl_LastExportDate = '" . addslashes($server_promotionl_LastExportDate) . "', promotionl_TotalImported = '" . addslashes($server_promotionl_TotalImported) . "', promotionl_TotalExported = '" . addslashes($server_promotionl_TotalExported) . "', promotionl_LastUpdateStamp = '" . addslashes($server_promotionl_LastUpdateStamp) . "', promotionl_idRow = '" . addslashes($server_promotionl_idRow) . "', promotionl_PromotionCd = '" . addslashes($server_promotionl_PromotionCd) . "', promotionl_ContactCd = '" . addslashes($server_promotionl_ContactCd) . "', promotionl_AddressCd = '" . addslashes($server_promotionl_AddressCd) . "', promotionl_LocationCd = '" . addslashes($server_promotionl_LocationCd) . "', promotionl_Description = '" . addslashes($server_promotionl_Description) . "', promotionl_SF_PromotionLocation = '" . addslashes($server_promotionl_SF_PromotionLocation) . "', promotionl_Deleteable = '" . addslashes($server_promotionl_Deleteable) . "', promotionl_Forensic = '" . addslashes($server_promotionl_Forensic) . "', promotionl_PortfolioCd = '" . addslashes($server_promotionl_PortfolioCd) . "', promotionl_Sub_PortfolioCd = '" . addslashes($server_promotionl_Sub_PortfolioCd) . "', promotionl_promotionh_headerID = '" . addslashes($server_promotionl_promotionh_headerID) . "', promotionl_contact_mstrID = '" . addslashes($server_promotionl_contact_mstrID) . "', promotionl_add_mstrID = '" . addslashes($server_promotionl_add_mstrID) . "', promotionl_loc_mstrID = '" . addslashes($server_promotionl_loc_mstrID) . "', promotionl_membert_typeID = '" . addslashes($server_promotionl_membert_typeID) . "', promotionl__dihapus = '" . addslashes($server_promotionl__dihapus) . "', promotionl__dihapus_time = '" . addslashes($server_promotionl__dihapus_time) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
ELSE
{
$sql_update = "UPDATE promotionl_location SET promotionl_create_user = '" . addslashes($server_promotionl_create_user) . "', promotionl_create_time = '" . addslashes($server_promotionl_create_time) . "', promotionl_edit_user = '" . addslashes($server_promotionl_edit_user) . "', promotionl_edit_time = '" . addslashes($server_promotionl_edit_time) . "', promotionl_ip = '" . addslashes($server_promotionl_ip) . "', promotionl_SysTrxId = '" . addslashes($server_promotionl_SysTrxId) . "', promotionl_Active = '" . addslashes($server_promotionl_Active) . "', promotionl_Approve = '" . addslashes($server_promotionl_Approve) . "', promotionl_SyncronizeDate = '" . addslashes($server_promotionl_SyncronizeDate) . "', promotionl_LastExportDate = '" . addslashes($server_promotionl_LastExportDate) . "', promotionl_TotalImported = '" . addslashes($server_promotionl_TotalImported) . "', promotionl_TotalExported = '" . addslashes($server_promotionl_TotalExported) . "', promotionl_LastUpdateStamp = '" . addslashes($server_promotionl_LastUpdateStamp) . "', promotionl_idRow = '" . addslashes($server_promotionl_idRow) . "', promotionl_PromotionCd = '" . addslashes($server_promotionl_PromotionCd) . "', promotionl_ContactCd = '" . addslashes($server_promotionl_ContactCd) . "', promotionl_AddressCd = '" . addslashes($server_promotionl_AddressCd) . "', promotionl_LocationCd = '" . addslashes($server_promotionl_LocationCd) . "', promotionl_Description = '" . addslashes($server_promotionl_Description) . "', promotionl_SF_PromotionLocation = '" . addslashes($server_promotionl_SF_PromotionLocation) . "', promotionl_Deleteable = '" . addslashes($server_promotionl_Deleteable) . "', promotionl_Forensic = '" . addslashes($server_promotionl_Forensic) . "', promotionl_PortfolioCd = '" . addslashes($server_promotionl_PortfolioCd) . "', promotionl_Sub_PortfolioCd = '" . addslashes($server_promotionl_Sub_PortfolioCd) . "', promotionl_promotionh_headerID = '" . addslashes($server_promotionl_promotionh_headerID) . "', promotionl_contact_mstrID = '" . addslashes($server_promotionl_contact_mstrID) . "', promotionl_add_mstrID = '" . addslashes($server_promotionl_add_mstrID) . "', promotionl_loc_mstrID = '" . addslashes($server_promotionl_loc_mstrID) . "', promotionl_membert_typeID = '" . addslashes($server_promotionl_membert_typeID) . "', promotionl__dihapus = '" . addslashes($server_promotionl__dihapus) . "', promotionl__dihapus_time = '" . addslashes($server_promotionl__dihapus_time) . "' WHERE promotionl_locationID = " . $server_promotionl_locationID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
}
else if ($t4973 == 'promotiond_detail')
{
list($server_promotiond_detailID, $server_promotiond_create_user, $server_promotiond_create_time, $server_promotiond_edit_user, $server_promotiond_edit_time, $server_promotiond_ip, $server_promotiond_SysTrxId, $server_promotiond_Active, $server_promotiond_Approve, $server_promotiond_SyncronizeDate, $server_promotiond_LastExportDate, $server_promotiond_TotalImported, $server_promotiond_TotalExported, $server_promotiond_LastUpdateStamp, $server_promotiond_idRow, $server_promotiond_PromotionCd, $server_promotiond_SequenceNo, $server_promotiond_ItemCd, $server_promotiond_ItemSKUCd, $server_promotiond_ItemName, $server_promotiond_Barcode, $server_promotiond_UOMCd, $server_promotiond_CurrencyCd, $server_promotiond_Quantity, $server_promotiond_FixPrice, $server_promotiond_DiscountCd, $server_promotiond_DiscountPrice, $server_promotiond_IsMultiply, $server_promotiond_SF_PromotionDetail, $server_promotiond_Deleteable, $server_promotiond_Forensic, $server_promotiond_PortfolioCd, $server_promotiond_Sub_PortfolioCd, $server_promotiond_promotionh_headerID, $server_promotiond_currency_mstrID, $server_promotiond_productitem_mstrID, $server_promotiond_itemsku_mstrID, $server_promotiond_measurement_uomID, $server_promotiond__dihapus, $server_promotiond__dihapus_time, $server_promotiond_discount_mstrID) = explode('`', $line);
if ($server_promotiond_Active == '') $server_promotiond_Active = 'No';
if ($server_promotiond_Approve == '') $server_promotiond_Approve = 0;
if ($server_promotiond_TotalImported == '') $server_promotiond_TotalImported = 0;
if ($server_promotiond_TotalExported == '') $server_promotiond_TotalExported = 0;
if ($server_promotiond_idRow == '') $server_promotiond_idRow = 0;
if ($server_promotiond_SequenceNo == '') $server_promotiond_SequenceNo = 0;
if ($server_promotiond_Quantity == '') $server_promotiond_Quantity = 0;
if ($server_promotiond_FixPrice == '') $server_promotiond_FixPrice = 0;
if ($server_promotiond_DiscountPrice == '') $server_promotiond_DiscountPrice = 0;
if ($server_promotiond_IsMultiply == '') $server_promotiond_IsMultiply = 'No';
if ($server_promotiond_Deleteable == '') $server_promotiond_Deleteable = 'No';
if ($server_promotiond_promotionh_headerID == '') $server_promotiond_promotionh_headerID = 0;
if ($server_promotiond_currency_mstrID == '') $server_promotiond_currency_mstrID = 0;
if ($server_promotiond_productitem_mstrID == '') $server_promotiond_productitem_mstrID = 0;
if ($server_promotiond_itemsku_mstrID == '') $server_promotiond_itemsku_mstrID = 0;
if ($server_promotiond_measurement_uomID == '') $server_promotiond_measurement_uomID = 0;
if ($server_promotiond__dihapus == '') $server_promotiond__dihapus = 'No';
if ($server_promotiond_discount_mstrID == '') $server_promotiond_discount_mstrID = 0;
$promotiond_detailID = 0;
$koneksi_promotiond_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT promotiond_detailID, promotiond_LastUpdateStamp FROM promotiond_detail where promotiond_detailID = " . $server_promotiond_detailID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$promotiond_detailID = $row_koneksi['promotiond_detailID'];
$koneksi_promotiond_LastUpdateStamp = $row_koneksi['promotiond_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($promotiond_detailID == 0)
{
$sql_insert = "INSERT INTO promotiond_detail SET promotiond_detailID = '" . addslashes($server_promotiond_detailID) . "', promotiond_create_user = '" . addslashes($server_promotiond_create_user) . "', promotiond_create_time = '" . addslashes($server_promotiond_create_time) . "', promotiond_edit_user = '" . addslashes($server_promotiond_edit_user) . "', promotiond_edit_time = '" . addslashes($server_promotiond_edit_time) . "', promotiond_ip = '" . addslashes($server_promotiond_ip) . "', promotiond_SysTrxId = '" . addslashes($server_promotiond_SysTrxId) . "', promotiond_Active = '" . addslashes($server_promotiond_Active) . "', promotiond_Approve = '" . addslashes($server_promotiond_Approve) . "', promotiond_SyncronizeDate = '" . addslashes($server_promotiond_SyncronizeDate) . "', promotiond_LastExportDate = '" . addslashes($server_promotiond_LastExportDate) . "', promotiond_TotalImported = '" . addslashes($server_promotiond_TotalImported) . "', promotiond_TotalExported = '" . addslashes($server_promotiond_TotalExported) . "', promotiond_LastUpdateStamp = '" . addslashes($server_promotiond_LastUpdateStamp) . "', promotiond_idRow = '" . addslashes($server_promotiond_idRow) . "', promotiond_PromotionCd = '" . addslashes($server_promotiond_PromotionCd) . "', promotiond_SequenceNo = '" . addslashes($server_promotiond_SequenceNo) . "', promotiond_ItemCd = '" . addslashes($server_promotiond_ItemCd) . "', promotiond_ItemSKUCd = '" . addslashes($server_promotiond_ItemSKUCd) . "', promotiond_ItemName = '" . addslashes($server_promotiond_ItemName) . "', promotiond_Barcode = '" . addslashes($server_promotiond_Barcode) . "', promotiond_UOMCd = '" . addslashes($server_promotiond_UOMCd) . "', promotiond_CurrencyCd = '" . addslashes($server_promotiond_CurrencyCd) . "', promotiond_Quantity = '" . addslashes($server_promotiond_Quantity) . "', promotiond_FixPrice = '" . addslashes($server_promotiond_FixPrice) . "', promotiond_DiscountCd = '" . addslashes($server_promotiond_DiscountCd) . "', promotiond_DiscountPrice = '" . addslashes($server_promotiond_DiscountPrice) . "', promotiond_IsMultiply = '" . addslashes($server_promotiond_IsMultiply) . "', promotiond_SF_PromotionDetail = '" . addslashes($server_promotiond_SF_PromotionDetail) . "', promotiond_Deleteable = '" . addslashes($server_promotiond_Deleteable) . "', promotiond_Forensic = '" . addslashes($server_promotiond_Forensic) . "', promotiond_PortfolioCd = '" . addslashes($server_promotiond_PortfolioCd) . "', promotiond_Sub_PortfolioCd = '" . addslashes($server_promotiond_Sub_PortfolioCd) . "', promotiond_promotionh_headerID = '" . addslashes($server_promotiond_promotionh_headerID) . "', promotiond_currency_mstrID = '" . addslashes($server_promotiond_currency_mstrID) . "', promotiond_productitem_mstrID = '" . addslashes($server_promotiond_productitem_mstrID) . "', promotiond_itemsku_mstrID = '" . addslashes($server_promotiond_itemsku_mstrID) . "', promotiond_measurement_uomID = '" . addslashes($server_promotiond_measurement_uomID) . "', promotiond__dihapus = '" . addslashes($server_promotiond__dihapus) . "', promotiond__dihapus_time = '" . addslashes($server_promotiond__dihapus_time) . "', promotiond_discount_mstrID = '" . addslashes($server_promotiond_discount_mstrID) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
ELSE
{
$sql_update = "UPDATE promotiond_detail SET promotiond_create_user = '" . addslashes($server_promotiond_create_user) . "', promotiond_create_time = '" . addslashes($server_promotiond_create_time) . "', promotiond_edit_user = '" . addslashes($server_promotiond_edit_user) . "', promotiond_edit_time = '" . addslashes($server_promotiond_edit_time) . "', promotiond_ip = '" . addslashes($server_promotiond_ip) . "', promotiond_SysTrxId = '" . addslashes($server_promotiond_SysTrxId) . "', promotiond_Active = '" . addslashes($server_promotiond_Active) . "', promotiond_Approve = '" . addslashes($server_promotiond_Approve) . "', promotiond_SyncronizeDate = '" . addslashes($server_promotiond_SyncronizeDate) . "', promotiond_LastExportDate = '" . addslashes($server_promotiond_LastExportDate) . "', promotiond_TotalImported = '" . addslashes($server_promotiond_TotalImported) . "', promotiond_TotalExported = '" . addslashes($server_promotiond_TotalExported) . "', promotiond_LastUpdateStamp = '" . addslashes($server_promotiond_LastUpdateStamp) . "', promotiond_idRow = '" . addslashes($server_promotiond_idRow) . "', promotiond_PromotionCd = '" . addslashes($server_promotiond_PromotionCd) . "', promotiond_SequenceNo = '" . addslashes($server_promotiond_SequenceNo) . "', promotiond_ItemCd = '" . addslashes($server_promotiond_ItemCd) . "', promotiond_ItemSKUCd = '" . addslashes($server_promotiond_ItemSKUCd) . "', promotiond_ItemName = '" . addslashes($server_promotiond_ItemName) . "', promotiond_Barcode = '" . addslashes($server_promotiond_Barcode) . "', promotiond_UOMCd = '" . addslashes($server_promotiond_UOMCd) . "', promotiond_CurrencyCd = '" . addslashes($server_promotiond_CurrencyCd) . "', promotiond_Quantity = '" . addslashes($server_promotiond_Quantity) . "', promotiond_FixPrice = '" . addslashes($server_promotiond_FixPrice) . "', promotiond_DiscountCd = '" . addslashes($server_promotiond_DiscountCd) . "', promotiond_DiscountPrice = '" . addslashes($server_promotiond_DiscountPrice) . "', promotiond_IsMultiply = '" . addslashes($server_promotiond_IsMultiply) . "', promotiond_SF_PromotionDetail = '" . addslashes($server_promotiond_SF_PromotionDetail) . "', promotiond_Deleteable = '" . addslashes($server_promotiond_Deleteable) . "', promotiond_Forensic = '" . addslashes($server_promotiond_Forensic) . "', promotiond_PortfolioCd = '" . addslashes($server_promotiond_PortfolioCd) . "', promotiond_Sub_PortfolioCd = '" . addslashes($server_promotiond_Sub_PortfolioCd) . "', promotiond_promotionh_headerID = '" . addslashes($server_promotiond_promotionh_headerID) . "', promotiond_currency_mstrID = '" . addslashes($server_promotiond_currency_mstrID) . "', promotiond_productitem_mstrID = '" . addslashes($server_promotiond_productitem_mstrID) . "', promotiond_itemsku_mstrID = '" . addslashes($server_promotiond_itemsku_mstrID) . "', promotiond_measurement_uomID = '" . addslashes($server_promotiond_measurement_uomID) . "', promotiond__dihapus = '" . addslashes($server_promotiond__dihapus) . "', promotiond__dihapus_time = '" . addslashes($server_promotiond__dihapus_time) . "', promotiond_discount_mstrID = '" . addslashes($server_promotiond_discount_mstrID) . "' WHERE promotiond_detailID = " . $server_promotiond_detailID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
}
else if ($t4973 == 'promogroup1_det')
{
list($server_promogroup1_detID, $server_promogroup1_create_user, $server_promogroup1_create_time, $server_promogroup1_edit_user, $server_promogroup1_edit_time, $server_promogroup1_ip, $server_promogroup1_SysTrxId, $server_promogroup1_Active, $server_promogroup1_Approve, $server_promogroup1_SyncronizeDate, $server_promogroup1_LastExportDate, $server_promogroup1_TotalImported, $server_promogroup1_TotalExported, $server_promogroup1_LastUpdateStamp, $server_promogroup1_idRow, $server_promogroup1_PromotionCd, $server_promogroup1_SequenceNo, $server_promogroup1_ItemCd, $server_promogroup1_ItemSKUCd, $server_promogroup1_ItemName, $server_promogroup1_Barcode, $server_promogroup1_UOMCd, $server_promogroup1_CurrencyCd, $server_promogroup1_Quantity, $server_promogroup1_FixPrice, $server_promogroup1_DiscountCd, $server_promogroup1_DiscountPrice, $server_promogroup1_SF_PromotionGroup1, $server_promogroup1_Deleteable, $server_promogroup1_Forensic, $server_promogroup1_PortfolioCd, $server_promogroup1_Sub_PortfolioCd, $server_promogroup1_currency_mstrID, $server_promogroup1_productitem_mstrID, $server_promogroup1_itemsku_mstrID, $server_promogroup1_membert_typeID, $server_promogroup1_promotionh_headerID, $server_promogroup1_measurement_uomID, $server_promogroup1__dihapus, $server_promogroup1__dihapus_time, $server_promogroup1_discount_mstrID) = explode('`', $line);
if ($server_promogroup1_detID == '') $server_promogroup1_detID = 0;
if ($server_promogroup1_Active == '') $server_promogroup1_Active = 'No';
if ($server_promogroup1_Approve == '') $server_promogroup1_Approve = 0;
if ($server_promogroup1_TotalImported == '') $server_promogroup1_TotalImported = 0;
if ($server_promogroup1_TotalExported == '') $server_promogroup1_TotalExported = 0;
if ($server_promogroup1_idRow == '') $server_promogroup1_idRow = 0;
if ($server_promogroup1_SequenceNo == '') $server_promogroup1_SequenceNo = 0;
if ($server_promogroup1_Quantity == '') $server_promogroup1_Quantity = 0;
if ($server_promogroup1_FixPrice == '') $server_promogroup1_FixPrice = 0;
if ($server_promogroup1_DiscountPrice == '') $server_promogroup1_DiscountPrice = 0;
if ($server_promogroup1_Deleteable == '') $server_promogroup1_Deleteable = 'No';
if ($server_promogroup1_currency_mstrID == '') $server_promogroup1_currency_mstrID = 0;
if ($server_promogroup1_productitem_mstrID == '') $server_promogroup1_productitem_mstrID = 0;
if ($server_promogroup1_itemsku_mstrID == '') $server_promogroup1_itemsku_mstrID = 0;
if ($server_promogroup1_membert_typeID == '') $server_promogroup1_membert_typeID = 0;
if ($server_promogroup1_promotionh_headerID == '') $server_promogroup1_promotionh_headerID = 0;
if ($server_promogroup1_measurement_uomID == '') $server_promogroup1_measurement_uomID = 0;
if ($server_promogroup1__dihapus == '') $server_promogroup1__dihapus = 'No';
if ($server_promogroup1_discount_mstrID == '') $server_promogroup1_discount_mstrID = 0;
$promogroup1_detID = 0;
$koneksi_promogroup1_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT promogroup1_detID, promogroup1_LastUpdateStamp FROM promogroup1_det where promogroup1_detID = " . $server_promogroup1_detID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$promogroup1_detID = $row_koneksi['promogroup1_detID'];
$koneksi_promogroup1_LastUpdateStamp = $row_koneksi['promogroup1_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($promogroup1_detID == 0)
{
$sql_insert = "INSERT INTO promogroup1_det SET promogroup1_detID = '" . addslashes($server_promogroup1_detID) . "', promogroup1_create_user = '" . addslashes($server_promogroup1_create_user) . "', promogroup1_create_time = '" . addslashes($server_promogroup1_create_time) . "', promogroup1_edit_user = '" . addslashes($server_promogroup1_edit_user) . "', promogroup1_edit_time = '" . addslashes($server_promogroup1_edit_time) . "', promogroup1_ip = '" . addslashes($server_promogroup1_ip) . "', promogroup1_SysTrxId = '" . addslashes($server_promogroup1_SysTrxId) . "', promogroup1_Active = '" . addslashes($server_promogroup1_Active) . "', promogroup1_Approve = '" . addslashes($server_promogroup1_Approve) . "', promogroup1_SyncronizeDate = '" . addslashes($server_promogroup1_SyncronizeDate) . "', promogroup1_LastExportDate = '" . addslashes($server_promogroup1_LastExportDate) . "', promogroup1_TotalImported = '" . addslashes($server_promogroup1_TotalImported) . "', promogroup1_TotalExported = '" . addslashes($server_promogroup1_TotalExported) . "', promogroup1_LastUpdateStamp = '" . addslashes($server_promogroup1_LastUpdateStamp) . "', promogroup1_idRow = '" . addslashes($server_promogroup1_idRow) . "', promogroup1_PromotionCd = '" . addslashes($server_promogroup1_PromotionCd) . "', promogroup1_SequenceNo = '" . addslashes($server_promogroup1_SequenceNo) . "', promogroup1_ItemCd = '" . addslashes($server_promogroup1_ItemCd) . "', promogroup1_ItemSKUCd = '" . addslashes($server_promogroup1_ItemSKUCd) . "', promogroup1_ItemName = '" . addslashes($server_promogroup1_ItemName) . "', promogroup1_Barcode = '" . addslashes($server_promogroup1_Barcode) . "', promogroup1_UOMCd = '" . addslashes($server_promogroup1_UOMCd) . "', promogroup1_CurrencyCd = '" . addslashes($server_promogroup1_CurrencyCd) . "', promogroup1_Quantity = '" . addslashes($server_promogroup1_Quantity) . "', promogroup1_FixPrice = '" . addslashes($server_promogroup1_FixPrice) . "', promogroup1_DiscountCd = '" . addslashes($server_promogroup1_DiscountCd) . "', promogroup1_DiscountPrice = '" . addslashes($server_promogroup1_DiscountPrice) . "', promogroup1_SF_PromotionGroup1 = '" . addslashes($server_promogroup1_SF_PromotionGroup1) . "', promogroup1_Deleteable = '" . addslashes($server_promogroup1_Deleteable) . "', promogroup1_Forensic = '" . addslashes($server_promogroup1_Forensic) . "', promogroup1_PortfolioCd = '" . addslashes($server_promogroup1_PortfolioCd) . "', promogroup1_Sub_PortfolioCd = '" . addslashes($server_promogroup1_Sub_PortfolioCd) . "', promogroup1_currency_mstrID = '" . addslashes($server_promogroup1_currency_mstrID) . "', promogroup1_productitem_mstrID = '" . addslashes($server_promogroup1_productitem_mstrID) . "', promogroup1_itemsku_mstrID = '" . addslashes($server_promogroup1_itemsku_mstrID) . "', promogroup1_membert_typeID = '" . addslashes($server_promogroup1_membert_typeID) . "', promogroup1_promotionh_headerID = '" . addslashes($server_promogroup1_promotionh_headerID) . "', promogroup1_measurement_uomID = '" . addslashes($server_promogroup1_measurement_uomID) . "', promogroup1__dihapus = '" . addslashes($server_promogroup1__dihapus) . "', promogroup1__dihapus_time = '" . addslashes($server_promogroup1__dihapus_time) . "', promogroup1_discount_mstrID = '" . addslashes($server_promogroup1_discount_mstrID) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
ELSE
{
$sql_update = "UPDATE promogroup1_det SET promogroup1_create_user = '" . addslashes($server_promogroup1_create_user) . "', promogroup1_create_time = '" . addslashes($server_promogroup1_create_time) . "', promogroup1_edit_user = '" . addslashes($server_promogroup1_edit_user) . "', promogroup1_edit_time = '" . addslashes($server_promogroup1_edit_time) . "', promogroup1_ip = '" . addslashes($server_promogroup1_ip) . "', promogroup1_SysTrxId = '" . addslashes($server_promogroup1_SysTrxId) . "', promogroup1_Active = '" . addslashes($server_promogroup1_Active) . "', promogroup1_Approve = '" . addslashes($server_promogroup1_Approve) . "', promogroup1_SyncronizeDate = '" . addslashes($server_promogroup1_SyncronizeDate) . "', promogroup1_LastExportDate = '" . addslashes($server_promogroup1_LastExportDate) . "', promogroup1_TotalImported = '" . addslashes($server_promogroup1_TotalImported) . "', promogroup1_TotalExported = '" . addslashes($server_promogroup1_TotalExported) . "', promogroup1_LastUpdateStamp = '" . addslashes($server_promogroup1_LastUpdateStamp) . "', promogroup1_idRow = '" . addslashes($server_promogroup1_idRow) . "', promogroup1_PromotionCd = '" . addslashes($server_promogroup1_PromotionCd) . "', promogroup1_SequenceNo = '" . addslashes($server_promogroup1_SequenceNo) . "', promogroup1_ItemCd = '" . addslashes($server_promogroup1_ItemCd) . "', promogroup1_ItemSKUCd = '" . addslashes($server_promogroup1_ItemSKUCd) . "', promogroup1_ItemName = '" . addslashes($server_promogroup1_ItemName) . "', promogroup1_Barcode = '" . addslashes($server_promogroup1_Barcode) . "', promogroup1_UOMCd = '" . addslashes($server_promogroup1_UOMCd) . "', promogroup1_CurrencyCd = '" . addslashes($server_promogroup1_CurrencyCd) . "', promogroup1_Quantity = '" . addslashes($server_promogroup1_Quantity) . "', promogroup1_FixPrice = '" . addslashes($server_promogroup1_FixPrice) . "', promogroup1_DiscountCd = '" . addslashes($server_promogroup1_DiscountCd) . "', promogroup1_DiscountPrice = '" . addslashes($server_promogroup1_DiscountPrice) . "', promogroup1_SF_PromotionGroup1 = '" . addslashes($server_promogroup1_SF_PromotionGroup1) . "', promogroup1_Deleteable = '" . addslashes($server_promogroup1_Deleteable) . "', promogroup1_Forensic = '" . addslashes($server_promogroup1_Forensic) . "', promogroup1_PortfolioCd = '" . addslashes($server_promogroup1_PortfolioCd) . "', promogroup1_Sub_PortfolioCd = '" . addslashes($server_promogroup1_Sub_PortfolioCd) . "', promogroup1_currency_mstrID = '" . addslashes($server_promogroup1_currency_mstrID) . "', promogroup1_productitem_mstrID = '" . addslashes($server_promogroup1_productitem_mstrID) . "', promogroup1_itemsku_mstrID = '" . addslashes($server_promogroup1_itemsku_mstrID) . "', promogroup1_membert_typeID = '" . addslashes($server_promogroup1_membert_typeID) . "', promogroup1_promotionh_headerID = '" . addslashes($server_promogroup1_promotionh_headerID) . "', promogroup1_measurement_uomID = '" . addslashes($server_promogroup1_measurement_uomID) . "', promogroup1__dihapus = '" . addslashes($server_promogroup1__dihapus) . "', promogroup1__dihapus_time = '" . addslashes($server_promogroup1__dihapus_time) . "', promogroup1_discount_mstrID = '" . addslashes($server_promogroup1_discount_mstrID) . "' WHERE promogroup1_detID = " . $server_promogroup1_detID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
}
else if ($t4973 == 'acc_mstr')
{
list($server_acc_mstrID, $server_acc_create_user, $server_acc_create_time, $server_acc_edit_user, $server_acc_edit_time, $server_acc_ip, $server_acc_SysTrxId, $server_acc_Active, $server_acc_Approve, $server_acc_SyncronizeDate, $server_acc_LastExportDate, $server_acc_TotalImported, $server_acc_TotalExported, $server_acc_SF_acc, $server_acc_Deleteable, $server_acc_Forensic, $server_acc_portfolio_mstrID, $server_acc_PortfolioCd, $server_acc_portfolio, $server_acc_subportfolio_mstrID, $server_acc_Sub_PortfolioCd, $server_acc__dihapus_time, $server_acc__dihapus, $server_acc_LastUpdateStamp, $server_acc_email, $server_acc_pwd, $server_acc_group_mstrID, $server_acc_member_id, $server_acc_lng_mstrID, $server_acc_userdb_dbname, $server_acc_lng, $server_acc_userdb_detID, $server_acc_menu_mstrID, $server_acc_program, $server_acc_group, $server_acc_upload_file, $server_acc_process, $server_acc_AllowPublic) = explode('`', $line);
if ($server_acc_Active == '') $server_acc_Active = 'Yes';
if ($server_acc_Approve == '') $server_acc_Approve = 0;
if ($server_acc_TotalImported == '') $server_acc_TotalImported = 0;
if ($server_acc_TotalExported == '') $server_acc_TotalExported = 0;
if ($server_acc_Deleteable == '') $server_kuncitoko_loc_mstrID = 'Yes';
if ($server_acc_portfolio_mstrID == '') $server_acc_portfolio_mstrID = 0;
if ($server_acc_subportfolio_mstrID == '') $server_acc_subportfolio_mstrID = 0;
if ($server_acc_group_mstrID == '') $server_acc_group_mstrID = 0;
if ($server_acc_member_id == '') $server_acc_member_id = 0;
if ($server_acc_lng_mstrID == '') $server_acc_lng_mstrID = 0;
if ($server_acc_userdb_detID == '') $server_acc_userdb_detID = 0;
if ($server_acc_menu_mstrID == '') $server_acc_menu_mstrID = 0;
if ($server_acc_AllowPublic == '') $server_acc_AllowPublic = 'No';
$acc_mstrID = 0;
$koneksi_acc_LastUpdateStamp = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT acc_mstrID, acc_LastUpdateStamp FROM acc_mstr where acc_mstrID = " . $server_acc_mstrID;
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$acc_mstrID = $row_koneksi['acc_mstrID'];
$koneksi_acc_LastUpdateStamp = $row_koneksi['acc_LastUpdateStamp'];
}
mysqli_free_result($result_koneksi);
if ($acc_mstrID == 0)
{
$sql_insert = "INSERT INTO acc_mstr SET acc_mstrID = '" . addslashes($server_acc_mstrID) . "', acc_create_user = '" . addslashes($server_acc_create_user) . "', acc_create_time = '" . addslashes($server_acc_create_time) . "', acc_edit_user = '" . addslashes($server_acc_edit_user) . "', acc_edit_time = '" . addslashes($server_acc_edit_time) . "', acc_ip = '" . addslashes($server_acc_ip) . "', acc_SysTrxId = '" . addslashes($server_acc_SysTrxId) . "', acc_Active = '" . addslashes($server_acc_Active) . "', acc_Approve = '" . addslashes($server_acc_Approve) . "', acc_SyncronizeDate = '" . addslashes($server_acc_SyncronizeDate) . "', acc_LastExportDate = '" . addslashes($server_acc_LastExportDate) . "', acc_TotalImported = '" . addslashes($server_acc_TotalImported) . "', acc_TotalExported = '" . addslashes($server_acc_TotalExported) . "', acc_SF_acc = '" . addslashes($server_acc_SF_acc) . "', acc_Deleteable = '" . addslashes($server_acc_Deleteable) . "', acc_Forensic = '" . addslashes($server_acc_Forensic) . "', acc_portfolio_mstrID = '" . addslashes($server_acc_portfolio_mstrID) . "', acc_PortfolioCd = '" . addslashes($server_acc_PortfolioCd) . "', acc_portfolio = '" . addslashes($server_acc_portfolio) . "', acc_subportfolio_mstrID = '" . addslashes($server_acc_subportfolio_mstrID) . "', acc_Sub_PortfolioCd = '" . addslashes($server_acc_Sub_PortfolioCd) . "', acc__dihapus_time = '" . addslashes($server_acc__dihapus_time) . "', acc__dihapus = '" . addslashes($server_acc__dihapus) . "', acc_LastUpdateStamp = '" . addslashes($server_acc_LastUpdateStamp) . "', acc_email = '" . addslashes($server_acc_email) . "', acc_pwd = '" . addslashes($server_acc_pwd) . "', acc_group_mstrID = '" . addslashes($server_acc_group_mstrID) . "', acc_member_id = '" . addslashes($server_acc_member_id) . "', acc_lng_mstrID = '" . addslashes($server_acc_lng_mstrID) . "', acc_userdb_dbname = '" . addslashes($server_acc_userdb_dbname) . "', acc_lng = '" . addslashes($server_acc_lng) . "', acc_userdb_detID = '" . addslashes($server_acc_userdb_detID) . "', acc_menu_mstrID = '" . addslashes($server_acc_menu_mstrID) . "', acc_program = '" . addslashes($server_acc_program) . "', acc_group = '" . addslashes($server_acc_group) . "', acc_upload_file = '" . addslashes($server_acc_upload_file) . "', acc_process = '" . addslashes($server_acc_process) . "', acc_AllowPublic = '" . addslashes($server_acc_AllowPublic) . "'";
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_insert) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
ELSE
{
$sql_update = "UPDATE acc_mstr SET acc_create_user = '" . addslashes($server_acc_create_user) . "', acc_create_time = '" . addslashes($server_acc_create_time) . "', acc_edit_user = '" . addslashes($server_acc_edit_user) . "', acc_edit_time = '" . addslashes($server_acc_edit_time) . "', acc_ip = '" . addslashes($server_acc_ip) . "', acc_SysTrxId = '" . addslashes($server_acc_SysTrxId) . "', acc_Active = '" . addslashes($server_acc_Active) . "', acc_Approve = '" . addslashes($server_acc_Approve) . "', acc_SyncronizeDate = '" . addslashes($server_acc_SyncronizeDate) . "', acc_LastExportDate = '" . addslashes($server_acc_LastExportDate) . "', acc_TotalImported = '" . addslashes($server_acc_TotalImported) . "', acc_TotalExported = '" . addslashes($server_acc_TotalExported) . "', acc_SF_acc = '" . addslashes($server_acc_SF_acc) . "', acc_Deleteable = '" . addslashes($server_acc_Deleteable) . "', acc_Forensic = '" . addslashes($server_acc_Forensic) . "', acc_portfolio_mstrID = '" . addslashes($server_acc_portfolio_mstrID) . "', acc_PortfolioCd = '" . addslashes($server_acc_PortfolioCd) . "', acc_portfolio = '" . addslashes($server_acc_portfolio) . "', acc_subportfolio_mstrID = '" . addslashes($server_acc_subportfolio_mstrID) . "', acc_Sub_PortfolioCd = '" . addslashes($server_acc_Sub_PortfolioCd) . "', acc__dihapus_time = '" . addslashes($server_acc__dihapus_time) . "', acc__dihapus = '" . addslashes($server_acc__dihapus) . "', acc_LastUpdateStamp = '" . addslashes($server_acc_LastUpdateStamp) . "', acc_email = '" . addslashes($server_acc_email) . "', acc_pwd = '" . addslashes($server_acc_pwd) . "', acc_group_mstrID = '" . addslashes($server_acc_group_mstrID) . "', acc_member_id = '" . addslashes($server_acc_member_id) . "', acc_lng_mstrID = '" . addslashes($server_acc_lng_mstrID) . "', acc_userdb_dbname = '" . addslashes($server_acc_userdb_dbname) . "', acc_lng = '" . addslashes($server_acc_lng) . "', acc_userdb_detID = '" . addslashes($server_acc_userdb_detID) . "', acc_menu_mstrID = '" . addslashes($server_acc_menu_mstrID) . "', acc_program = '" . addslashes($server_acc_program) . "', acc_group = '" . addslashes($server_acc_group) . "', acc_upload_file = '" . addslashes($server_acc_upload_file) . "', acc_process = '" . addslashes($server_acc_process) . "', acc_AllowPublic = '" . addslashes($server_acc_AllowPublic) . "' WHERE acc_mstrID = " . $server_acc_mstrID;
mysqli_query($_POST['koneksi' . $koneksi_db], $sql_update) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
}
}
if (strpos($line, "`") === false) break;
}
}
fclose($handle);
}
}
if ($err_msg == '')
{
mysqli_commit($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $database_offline]);
}
else
{
mysqli_rollback($_POST['koneksi' . $koneksi_db]);
mysqli_rollback($_POST['koneksi' . $database_offline]);
}
}
echo "\n";
echo '=>Selesai cek dulu 333...' . $err_msg;
echo "\n";
//sleep(30000);
//exit;
if (isset($_POST['koneksi' . $database_slave])) mysqli_close($_POST['koneksi' . $database_slave]);
if (isset($_POST['koneksi' . $database_offline])) mysqli_close($_POST['koneksi' . $database_offline]);
echo "\n";
echo 'Proses Selesai==>' . $ulang_ke . ' ==>' . $err_msg;
$wait_ke = 0;
while (true)
{
sleep(1);
$wait_ke++;
echo "\n";
echo 'Waiting Next Process...' . str_pad($wait_ke, 2, "0", STR_PAD_LEFT) . '/99';
if ($wait_ke >= 99) break;
}
$ulang_ke++;
}
if (isset($koneksi_slave)) mysqli_close($koneksi_slave);
if (isset($koneksi_offline)) mysqli_close($koneksi_offline);
echo "\n";
echo date("Y-m-d H:i:s") . ' ==>' . $computerassignd_LocationCd;
sleep(10); ?>
Did this file decode correctly?
Original Code
<?php
set_time_limit(0);
ini_set('mysql.connect_timeout', -1);
ini_set('default_socket_timeout', -1);
ini_set('mysqli.reconnect', 'On');
ini_set("max_execution_time", "-1");
ini_set("max_allowed_packet", "2180M");
ini_set("memory_limit", "-1");
include_once ("utkPosisi.php");
$username_slave = "hva_slave";
$password_slave = "admin@**";
$database_slave = "hva";
$username_offline = "hva_slave";
$password_offline = "admin@**";
$database_offline = "hva_offline";
if ($database_slave == "gaudi") $port_server = '2278';
else $port_server = '2276';
$menit_mulai = date("i");
$jam_duabelas = '12' . ':' . $menit_mulai;
$jam_limabelas = '15' . ':' . $menit_mulai;
if (!file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd")))
{
$isi_q = 'md ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd");
$hasil_system = system($isi_q, $retval);
}
echo "\n";
echo 'Mulai...' . $IpT35;
echo "\n";
if ($database_slave == "bnb" || $database_slave == "hwr") $ip_tes = 'vrimas.ddns.net';
else
{
$ip_tes = '123.100.226.179';
$username_nc9r0up = 'root';
$password_nc9r0up = '3hqF%KGT47^g';
}
echo "\n";
echo $IpT35;
echo "\n";
$xi = 0;
$xi_total = 3;
while (true)
{
$xi++;
echo 'Waiting ...' . str_pad($xi, strlen($xi_total) , "0", STR_PAD_LEFT) . '/' . $xi_total;
echo "\n";
if ($xi >= $xi_total)
{
if (isset($koneksi_slave)) mysqli_close($koneksi_slave);
if (isset($koneksi_offline)) mysqli_close($koneksi_offline);
$koneksi_slave = mysqli_connect($ip_slave, $username_slave, $password_slave, $database_slave) or $err_msg = mysqli_connect_error();
$koneksi_offline = mysqli_connect($ip_offline, $username_offline, $password_offline, $database_offline) or $err_msg = mysqli_connect_error();
if (mysqli_ping($koneksi_offline) && mysqli_ping($koneksi_slave)) break;
}
sleep(1);
}
if (isset($_POST['koneksi' . $database_slave])) mysqli_close($_POST['koneksi' . $database_slave]);
if (isset($_POST['koneksi' . $database_offline])) mysqli_close($_POST['koneksi' . $database_offline]);
$_POST['koneksi' . $database_slave] = mysqli_connect($ip_slave, $username_slave, $password_slave, $database_slave) or $err_msg = mysqli_connect_error();
$_POST['koneksi' . $database_offline] = mysqli_connect($ip_offline, $username_offline, $password_offline, $database_offline) or $err_msg = mysqli_connect_error();
mysqli_autocommit($_POST['koneksi' . $database_slave], false);
mysqli_autocommit($_POST['koneksi' . $database_offline], false);
$id_file = strtolower($database) . (date("dYm") + 9032202);
echo "\n";
echo $id_file;
echo "\n";
$ORDINAL_POSITION_transferouth_edit_time = 0;
$sql_kcu = "SELECT ORDINAL_POSITION FROM information_schema.KEY_COLUMN_USAGE WHERE CONSTRAINT_SCHEMA = '" . $database_offline . "' AND TABLE_NAME = 'transferouth_header' AND COLUMN_NAME = 'transferouth_edit_time';";
$result_kcu = mysqli_query($_POST['koneksi' . $database_offline], $sql_kcu) or $err_msg = mysqli_error($_POST['koneksi' . $database_offline]);
while ($row_kcu = mysqli_fetch_array($result_kcu, MYSQLI_ASSOC))
{
$ORDINAL_POSITION_transferouth_edit_time = $row_kcu['ORDINAL_POSITION'];
}
mysqli_free_result($result_kcu);
if ($ORDINAL_POSITION_transferouth_edit_time == 0)
{
$query_altertable = "ALTER TABLE " . $database_offline . ".transferouth_header DROP INDEX transferouth_ReferenceNo, ADD UNIQUE INDEX transferouth_ReferenceNo (transferouth_ReferenceNo, transferouth_create_user, transferouth_edit_time, transferouth_ip, transferouth__dihapus_time, transferouth_create_time); ";
mysqli_query($_POST['koneksi' . $database_offline], $query_altertable) or $err_msg = mysqli_error($_POST['koneksi' . $database_offline]);
mysqli_commit($_POST['koneksi' . $database_offline]);
}
$ORDINAL_POSITION_salesmand_edit_time = 0;
$sql_kcu = "SELECT ORDINAL_POSITION FROM information_schema.KEY_COLUMN_USAGE WHERE CONSTRAINT_SCHEMA = '" . $database_slave . "' AND TABLE_NAME = 'salesmand_detail' AND COLUMN_NAME = 'salesmand_edit_time';";
$result_kcu = mysqli_query($_POST['koneksi' . $database_slave], $sql_kcu) or $err_msg = mysqli_error($_POST['koneksi' . $database_slave]);
while ($row_kcu = mysqli_fetch_array($result_kcu, MYSQLI_ASSOC))
{
$ORDINAL_POSITION_salesmand_edit_time = $row_kcu['ORDINAL_POSITION'];
}
mysqli_free_result($result_kcu);
if ($ORDINAL_POSITION_salesmand_edit_time == 0)
{
$query_altertable = "ALTER TABLE salesmand_detail DROP INDEX salesmand_idx, ADD UNIQUE INDEX salesmand_idx (salesmand_SalesmanContactCd, salesmand_LocationCd, salesmand_edit_time, salesmand__dihapus_time);";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $err_msg = mysqli_error($_POST['koneksi' . $database_slave]);
mysqli_commit($_POST['koneksi' . $database_slave]);
}
$ORDINAL_POSITION_contact_code_vd = 0;
$sql_kcu = "SELECT ORDINAL_POSITION FROM information_schema.KEY_COLUMN_USAGE WHERE CONSTRAINT_SCHEMA = '" . $database_slave . "' AND TABLE_NAME = 'contact_mstr' AND COLUMN_NAME = 'contact_code_vd';";
$result_kcu = mysqli_query($_POST['koneksi' . $database_slave], $sql_kcu) or $err_msg = mysqli_error($_POST['koneksi' . $database_slave]);
while ($row_kcu = mysqli_fetch_array($result_kcu, MYSQLI_ASSOC))
{
$ORDINAL_POSITION_contact_code_vd = $row_kcu['ORDINAL_POSITION'];
}
mysqli_free_result($result_kcu);
if ($ORDINAL_POSITION_contact_code_vd == 0)
{
$query_altertable = "TRUNCATE TABLE contact_mstr;";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $err_msg = mysqli_error($_POST['koneksi' . $database_slave]);
$query_altertable = "ALTER TABLE contact_mstr DROP INDEX contact_ContactName, ADD UNIQUE INDEX contact_ContactName (contact_ContactName, contact_code_vd, contact_create_user, contact_create_time, contact__dihapus_time, contact_BirthPlaceCityCd, contact_BirthDate, contact_Owner, contact_Supplier, contact_Customer, contact_Employee);";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $err_msg = mysqli_error($_POST['koneksi' . $database_slave]);
mysqli_commit($_POST['koneksi' . $database_slave]);
}
$tidak_ada_contact_BirthDateMom = '';
$sql_koneksi = "SELECT contact_ContactNameMom FROM contact_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_slave], $sql_koneksi) or $tidak_ada_contact_BirthDateMom = mysqli_error($_POST['koneksi' . $database_slave]);
if ($tidak_ada_contact_BirthDateMom != '')
{
$query_altertable = "ALTER TABLE `contact_mstr` ADD COLUMN `contact_ContactNameMom` VARCHAR(200) NULL;";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $tidak_ada_contact_BirthDateMom = mysqli_error($_POST['koneksi' . $database_slave]);
mysqli_commit($_POST['koneksi' . $database_slave]);
}
$tidak_ada_online_Date = '';
$sql_koneksi = "SELECT contact_BirthDateMom FROM contact_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_slave], $sql_koneksi) or $tidak_ada_online_Date = mysqli_error($_POST['koneksi' . $database_slave]);
if ($tidak_ada_online_Date != '')
{
$query_altertable = "ALTER TABLE `contact_mstr` ADD COLUMN `contact_BirthDateMom` DATE DEFAULT '1900-01-01' NULL; ";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $tidak_ada_online_Date = mysqli_error($_POST['koneksi' . $database_slave]);
mysqli_commit($_POST['koneksi' . $database_slave]);
}
$tidak_ada_online_status = '';
$sql_koneksi = "SELECT online_status FROM online_tab limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_offline], $sql_koneksi) or $tidak_ada_online_status = mysqli_error($_POST['koneksi' . $database_offline]);
if ($tidak_ada_online_status != '')
{
$query_altertable = "ALTER TABLE `online_tab` ADD COLUMN `online_status` VARCHAR(50) NULL;";
mysqli_query($_POST['koneksi' . $database_offline], $query_altertable) or $tidak_ada_online_status = mysqli_error($_POST['koneksi' . $database_offline]);
mysqli_commit($_POST['koneksi' . $database_offline]);
}
$tidak_ada_online_user = '';
$sql_koneksi = "SELECT online_user FROM online_tab limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_offline], $sql_koneksi) or $tidak_ada_online_user = mysqli_error($_POST['koneksi' . $database_offline]);
if ($tidak_ada_online_user != '')
{
$query_altertable = "ALTER TABLE `online_tab` ADD COLUMN `online_user` VARCHAR(200) NULL; ";
mysqli_query($_POST['koneksi' . $database_offline], $query_altertable) or $tidak_ada_online_user = mysqli_error($_POST['koneksi' . $database_offline]);
mysqli_commit($_POST['koneksi' . $database_offline]);
}
$tidak_ada_online_ID = '';
$sql_koneksi = "SELECT online_ID FROM online_tab limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_offline], $sql_koneksi) or $tidak_ada_online_ID = mysqli_error($_POST['koneksi' . $database_offline]);
if ($tidak_ada_online_ID != '')
{
$query_altertable = "ALTER TABLE `online_tab` ADD COLUMN `online_ID` VARCHAR(48) NULL; ";
mysqli_query($_POST['koneksi' . $database_offline], $query_altertable) or $tidak_ada_online_ID = mysqli_error($_POST['koneksi' . $database_offline]);
mysqli_commit($_POST['koneksi' . $database_offline]);
}
$tidak_ada_online_Date = '';
$sql_koneksi = "SELECT online_Date FROM online_tab limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_offline], $sql_koneksi) or $tidak_ada_online_Date = mysqli_error($_POST['koneksi' . $database_offline]);
if ($tidak_ada_online_Date != '')
{
$query_altertable = "ALTER TABLE `online_tab` ADD COLUMN `online_Date` DATE DEFAULT '1900-01-01' NULL; ";
mysqli_query($_POST['koneksi' . $database_offline], $query_altertable) or $tidak_ada_online_Date = mysqli_error($_POST['koneksi' . $database_offline]);
mysqli_commit($_POST['koneksi' . $database_offline]);
}
if ($database_slave == "bnb" || $database_slave == "hwr") $ip_publik = 'vrimas.ddns.net';
else $ip_publik = 'grimas.ddns.net';
echo "\n";
echo $ip_publik;
$P455300RD = date("dY") + 201610370708;
//mulai
while (true)
{
$toko = '';
$LocationCd = '';
$LocationName = '';
$user_pos_loc = 0;
if (isset($koneksi_slave)) mysqli_close($koneksi_slave);
if (isset($koneksi_offline)) mysqli_close($koneksi_offline);
$koneksi_slave = mysqli_connect($ip_slave, $username_slave, $password_slave, $database_slave) or $err_msg = mysqli_connect_error();
$koneksi_offline = mysqli_connect($ip_offline, $username_offline, $password_offline, $database_offline) or $err_msg = mysqli_connect_error();
if (mysqli_ping($koneksi_offline) && mysqli_ping($koneksi_slave))
{
$sql = "SELECT _user_pos_loc, _user_MachineName, _user_ip
FROM _user_mstr where _user_pos_loc > 0 ORDER BY _user_mstrID DESC";
$result = mysqli_query($koneksi_offline, $sql) or $err_msg = mysqli_error($koneksi_offline);
echo "\n";
echo $err_msg . ' ==>' . $sql;
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
$user_pos_loc = $row['_user_pos_loc'];
$user_IPAddress = $row['_user_ip'];
$user_MachineName = $row['_user_MachineName'];
$computerassignd_DBTypeCd = '';
$computerassignd_LocationCd = 'computerassignd_LocationCd';
$sql_loc = "SELECT loc_LocationCd, loc_LocationName, loc_LocationInitial FROM loc_mstr where loc_mstrID = " . $user_pos_loc;
$result_loc = mysqli_query($koneksi_slave, $sql_loc) or $err_msg = mysqli_error($koneksi_slave);
while ($row_loc = mysqli_fetch_array($result_loc, MYSQLI_ASSOC))
{
if (!file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd")))
{
$isi_q = 'md ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd");
$hasil_system = system($isi_q, $retval);
}
$iplokalstore = '';
$isi_q = 'ipconfig > ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd") . '\\iplokal.txt';
$hasil_system = system($isi_q, $retval);
if (file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd") . '\\iplokal.txt'))
{
$file = fopen(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd") . '\\iplokal.txt', "r");
$sudah_LAN_adapter_Local_Area_Connection = 'No';
while (!feof($file))
{
$baris_ke++;
$line = trim(fgets($file));
if (strpos($line, 'Local Area Connection') !== false) $sudah_LAN_adapter_Local_Area_Connection = 'Yes';
//if ($sudah_LAN_adapter_Local_Area_Connection == 'Yes' && substr($line,0,45)== 'IPv4 Address. . . . . . . . . . . : 192.168.1') $iplokalstore = substr($line,36);
if (substr($line, 0, 44) == 'IPv4 Address. . . . . . . . . . . : 192.168.') $iplokalstore = substr($line, 36);
}
fclose($file);
}
//if (date("Y-m-d") == '2018-10-28' && $iplokalstore == '192.168.100.2'){
//$user_IPAddress='127.0.0.1';
//testing
//$user_MachineName='HVMB-ONEPRICE';
//testing
//$user_pos_loc=64;
//testing
//}
echo "\n";
echo 'iplokalstore==>' . $iplokalstore . ' user_MachineName==>' . $user_MachineName;
echo "\n";
$toko = $row_loc['loc_LocationInitial'];
$LocationCd = $row_loc['loc_LocationCd'];
$LocationName = $row_loc['loc_LocationName'];
$url = 'http://' . $ip_publik . ':176/Compu7erass1gnD_C3k.php';
array_splice($data_Compu7erass1gnDxyz, 0, count($data_Compu7erass1gnDxyz));
$data_Compu7erass1gnDxyz[] = array(
"D4tab453" => $database,
"P455300RD" => $P455300RD,
"user_pos_loc" => $user_pos_loc,
"user_IPAddress" => $user_IPAddress,
"user_MachineName" => $user_MachineName,
"iplokalstore" => $iplokalstore
);
$ch = curl_init($url);
$data_string = urlencode(json_encode($data_Compu7erass1gnDxyz));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"OrderOnline" => $data_string
));
curl_setopt($ch, CURLOPT_TIMEOUT, 50000);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 50000);
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 50000);
$data_Compu7erass1gnD = curl_exec($ch);
$asObjects = json_decode($data_Compu7erass1gnD, true);
$computerassignd_LocationCd = $asObjects['data_Compu7erass1gnD'][0]['computerassignd_LocationCd'];
$computerassignd_DBTypeCd = $asObjects['data_Compu7erass1gnD'][0]['computerassignd_DBTypeCd'];
curl_close($ch);
echo "\n";
echo $err_msg . ' ==>' . $data_Compu7erass1gnD;
sleep(1);
}
mysqli_free_result($result_loc);
echo "\n";
echo $user_MachineName;
echo "\n";
$laptop_yanto = 'No';
if ($user_MachineName == 'LAPTOP-CS8OEIPP' && date('Y-m-d') >= '2018-10-28')
{
$laptop_yanto = 'Yes';
//$computerassignd_LocationCd='G50';
}
//yanto
//echo "\n";
//echo $err_msg . ' ==>laptop_yanto=' . $laptop_yanto . ' ==>' . $computerassignd_LocationCd;
//sleep(30);
if ($computerassignd_LocationCd != 'computerassignd_LocationCd') break;
}
mysqli_free_result($result);
}
if ($user_pos_loc == '') $user_pos_loc = 0;
if ($user_pos_loc > 0) break;
else sleep(1);
}
echo "\n";
echo $database . ' ==>' . $P455300RD . ' ==>' . $user_pos_loc . ' ==>' . $user_IPAddress . ' ==>' . $user_MachineName . ' ==>' . $computerassignd_LocationCd;
//echo "\n";
//sleep(3000);
if ($database == 'BNB' || $database == 'HWR')
{
$PORT_H0 = '3376';
$IP_H0 = $ip_publik;
$username_H0 = 'rim45hwbnb';
$password_H0 = '201809r730DBhwbnb';
}
else if ($database == 'gaudi')
{
$PORT_H0 = '3308';
$IP_H0 = $ip_publik;
$username_H0 = 'newgaudi';
$password_H0 = 'f4shiongaudi';
}
else
{
$PORT_H0 = '3306';
$IP_H0 = $ip_publik;
$username_H0 = 'nanat73n';
$password_H0 = '201409201444n4n4tren5group';
}
$ulang_ke = 0;
while (true)
{
echo "\n";
echo 'xyzXXX' . $err_msg;
echo "\n";
$hari_ini = date('Y-m-d');
$tujuh_hari_lalu = date('Y-m-d', strtotime("$hari_ini -7 day"));
$lewatBiznet = 'No';
//if ($computerassignd_LocationCd == 'G40') $lewatBiznet = 'Yes';
//else $lewatBiznet = 'No';
if (isset($koneksi_public)) mysqli_close($koneksi_public);
if (isset($koneksi_offline)) mysqli_close($koneksi_offline);
if (isset($koneksi_slave)) mysqli_close($koneksi_slave);
$koneksi_slave = mysqli_connect($ip_slave, $username_slave, $password_slave, $database_slave) or $err_msg = mysqli_connect_error();
$koneksi_offline = mysqli_connect($ip_offline, $username_offline, $password_offline, $database_offline) or $err_msg = mysqli_connect_error();
if ($database == "BNB" || $database == "HWR") $koneksi_public = mysqli_connect($ip_tes, $username, $password, $database, 3376) or $err_msg = mysqli_connect_error();
else $koneksi_public = mysqli_connect($ip_tes, $username_nc9r0up, $password_nc9r0up, $databas_nc9r0upe) or $err_msg = mysqli_connect_error();
if (mysqli_ping($koneksi_offline) && mysqli_ping($koneksi_public) && $laptop_yanto == 'No')
{
$dir_tmp = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
if (!file_exists($dir_tmp)) mkdir($dir_tmp, 0777);
$dir_edit_structure = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure';
if (!file_exists($dir_edit_structure)) mkdir($dir_edit_structure, 0777);
$online_tabID = 0;
$online_time = '1900-01-01 00:00:00';
$sql_koneksi = "SELECT online_tabID, online_time FROM online_tab force index (online_table) where online_table = 'strdboffline_tab'";
$result_koneksi = mysqli_query($koneksi_offline, $sql_koneksi);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$online_tabID = $row_koneksi['online_tabID'];
$online_time = $row_koneksi['online_time'];
}
mysqli_free_result($result_koneksi);
$sql_online = "SELECT * FROM strdboffline_tab
where strdboffline_Brand = '" . $database_slave . "' and
strdboffline_LastUpdateStamp >= '" . $tujuh_hari_lalu . "' and
strdboffline_LastUpdateStamp > '" . $online_time . "'
order by strdboffline_Brand, strdboffline_LastUpdateStamp";
$result_online = mysqli_query($koneksi_public, $sql_online) or $err_msg = mysqli_error($koneksi_public);
while ($row_online = mysqli_fetch_array($result_online, MYSQLI_ASSOC))
{
if ($row_online['strdboffline_file'] != 'phpqrcode-master.php.zip' || ($row_online['strdboffline_file'] == 'phpqrcode-master.php.zip' && !file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\phpqrcode-master')))
{
$strdboffline_tabID = $row_online['strdboffline_tabID'];
if (strpos($row_online['strdboffline_file'], '.sqlG') !== false)
{
//contohnya strdboffline_file isinya 201209111157
if (substr($row_online['strdboffline_file'], 0, 1) < 5 && strpos($row_online['strdboffline_file'], '.sql' . $computerassignd_LocationCd) !== false)
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\';
$hasil_system = system($isi_q, $retval);
$isi_q = 'copy ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".zip", "", $row_online['strdboffline_file']) . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\';
$hasil_system = system($isi_q, $retval);
if (substr($row_online['strdboffline_file'], 0, 1) == 1 || substr($row_online['strdboffline_file'], 0, 1) == 3)
{
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\mysql\\bin\\mysql -u root -p' . $password_root . ' ' . $database_offline . ' < ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
}
if (substr($row_online['strdboffline_file'], 0, 1) == 2 || substr($row_online['strdboffline_file'], 0, 1) == 3)
{
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\mysql\\bin\\mysql -u root -p' . $password_root . ' ' . $database_slave . ' < ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
}
echo 'Get Structure... --- ' . str_replace(".zip", "", $row_online['strdboffline_file']);
echo "\n";
//}
}
}
else if (substr($row_online['strdboffline_file'], 0, 1) < 5 && is_numeric(str_replace(".sql.zip", "", $row_online['strdboffline_file'])))
{
//contohnya strdboffline_file isinya 201209111157
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\';
$hasil_system = system($isi_q, $retval);
$isi_q = 'copy ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".zip", "", $row_online['strdboffline_file']) . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\';
$hasil_system = system($isi_q, $retval);
if (substr($row_online['strdboffline_file'], 0, 1) == 1 || substr($row_online['strdboffline_file'], 0, 1) == 3)
{
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\mysql\\bin\\mysql -u root -p' . $password_root . ' ' . $database_offline . ' < ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
}
if (substr($row_online['strdboffline_file'], 0, 1) == 2 || substr($row_online['strdboffline_file'], 0, 1) == 3)
{
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\mysql\\bin\\mysql -u root -p' . $password_root . ' ' . $database_slave . ' < ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\edit_structure\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
}
echo 'Get Structure... --- ' . str_replace(".zip", "", $row_online['strdboffline_file']);
echo "\n";
//}
}
//////////////////////////////
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 11) == 'hva.script.')
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\script\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 11));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\script\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 11));
echo "\n";
//}
}
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 13) == 'hva.termasuk.')
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\termasuk\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 13));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\termasuk\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 13));
echo "\n";
//}
}
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 4) == 'hva.' && strpos($row_online['strdboffline_file'], '.php.zip') !== false)
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 4));
echo 'Cek... --- ' . $isi_q;
echo "\n";
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\';
echo 'Cek... --- ' . $isi_q;
echo "\n";
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 4));
echo "\n";
//}
}
///////////////////////////////////////
else if (substr($row_online['strdboffline_file'], 0, 14) == 'opname.script.')
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\script\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 14));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\script\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 14));
echo "\n";
//}
}
else if (substr($row_online['strdboffline_file'], 0, 16) == 'opname.termasuk.')
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\termasuk\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 16));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\termasuk\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 16));
echo "\n";
//}
}
else if (substr($row_online['strdboffline_file'], 0, 7) == 'opname.' && strpos($row_online['strdboffline_file'], '.php.zip') !== false)
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 7));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\';
echo 'Cek... --- ' . $isi_q;
echo "\n";
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 7));
echo "\n";
//}
}
///////////////////////////////////////
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 14) == 'hva.opname.script.')
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\opname\\script\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 18));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\opname\\script\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 18));
echo "\n";
//}
}
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 16) == 'hva.opname.termasuk.')
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\opname\\termasuk\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 20));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\opname\\termasuk\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 20));
echo "\n";
//}
}
else if ($computerassignd_DBTypeCd == 'Kedua' && substr($row_online['strdboffline_file'], 0, 7) == 'hva.opname.' && strpos($row_online['strdboffline_file'], '.php.zip') !== false)
{
if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/gaudi/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\hva\\opname\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 11));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\opname\\';
echo 'Cek... --- ' . $isi_q;
echo "\n";
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 11));
echo "\n";
//}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
else if (substr($row_online['strdboffline_file'], 0, 7) == 'script.')
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\script\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 7));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\script\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 7));
echo "\n";
//}
}
else if (substr($row_online['strdboffline_file'], 0, 9) == 'termasuk.')
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\termasuk\\' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 9));
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\termasuk\\';
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", substr($row_online['strdboffline_file'], 9));
echo "\n";
//}
}
else if (strpos($row_online['strdboffline_file'], '.php.zip') !== false)
{
if ($database == "BNB" || $database == "HWR") $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else if ($lewatBiznet == 'Yes') $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2289 -pw 135789DFBIZNET [email protected]:/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
else $isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 8288 -pw 13svFNXsMq599YzQp2 root@' . $ip_tes . ':/home/rimas/' . $database_slave . '/' . $row_online['strdboffline_file'] . ' ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
//if (filesize(substr(__FILE__, 0,3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file']) == $row_online['strdboffline_FileSize']){
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\' . str_replace(".php.zip", "", $row_online['strdboffline_file']);
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\7z.exe x ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $row_online['strdboffline_file'] . ' -o' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\';
echo 'Cek... --- ' . $isi_q;
echo "\n";
$hasil_system = system($isi_q, $retval);
echo 'Get New File... --- ' . str_replace(".zip", "", $row_online['strdboffline_file']);
echo "\n";
//}
}
if ($err_msg == '')
{
if ($online_tabID == 0)
{
$sql_insert = "INSERT INTO online_tab SET online_time = '" . $row_online['strdboffline_LastUpdateStamp'] . "', online_table = 'strdboffline_tab'";
mysqli_query($koneksi_offline, $sql_insert) or $err_msg = mysqli_error($koneksi_offline);
$sql_koneksi = "SELECT online_tabID, online_time FROM online_tab force index (online_table) where online_table = 'strdboffline_tab'";
$result_koneksi = mysqli_query($koneksi_offline, $sql_koneksi);
while ($row_koneksi = mysqli_fetch_array($result_koneksi, MYSQLI_ASSOC))
{
$online_tabID = $row_koneksi['online_tabID'];
}
mysqli_free_result($result_koneksi);
}
else
{
$sql_update = "UPDATE online_tab SET online_time = '" . $row_online['strdboffline_LastUpdateStamp'] . "' where online_tabID = " . $online_tabID;
mysqli_query($koneksi_offline, $sql_update) or $err_msg = mysqli_error($koneksi_offline);
}
}
if ($err_msg == '') mysqli_commit($koneksi_offline);
else
{
mysqli_rollback($koneksi_offline);
echo 'Proses Syncronize to HO gagal, Silahkan Hubungi Administrator...' . $err_msg . ' --- ' . $sql_insert . $sql_update;
break;
}
}
}
mysqli_free_result($result_online);
}
echo "\n";
echo 'xyzAAA' . $err_msg;
echo "\n";
if (isset($_POST['koneksi' . $database_slave])) mysqli_close($_POST['koneksi' . $database_slave]);
if (isset($_POST['koneksi' . $database_offline])) mysqli_close($_POST['koneksi' . $database_offline]);
$_POST['koneksi' . $database_slave] = mysqli_connect($ip_slave, $username_slave, $password_slave, $database_slave) or $err_msg = mysqli_connect_error();
$_POST['koneksi' . $database_offline] = mysqli_connect($ip_offline, $username_offline, $password_offline, $database_offline) or $err_msg = mysqli_connect_error();
mysqli_autocommit($_POST['koneksi' . $database_slave], false);
mysqli_autocommit($_POST['koneksi' . $database_offline], false);
//echo "\n";
// echo 'xyzBBB' . $err_msg;
//echo "\n";
$tidak_ada_add_Jabatan = '';
$sql_koneksi = "SELECT add_Jabatan FROM add_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $database_slave], $sql_koneksi) or $tidak_ada_add_Jabatan = mysqli_error($_POST['koneksi' . $database_slave]);
if ($tidak_ada_add_Jabatan != '')
{
$query_altertable = "ALTER TABLE add_mstr ADD COLUMN add_Jabatan VARCHAR(100) NULL;";
mysqli_query($_POST['koneksi' . $database_slave], $query_altertable) or $tidak_ada_add_Jabatan = mysqli_error($_POST['koneksi' . $database_slave]);
mysqli_commit($_POST['koneksi' . $database_slave]);
}
//echo "\n";
// echo 'xyzCCC' . $err_msg;
//echo "\n";
echo '=>Selesai cek dulu 111...' . $err_msg;
echo "\n";
//sleep(30000);
//exit;
for ($table_ke = 1;$table_ke <= 51;$table_ke++)
{
if ($table_ke == 1)
{
$t4973 = 'kuncitoko_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 2)
{
$t4973 = 'itemsku_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 3)
{
$t4973 = 'prosesbg_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 4)
{
$t4973 = 'acc_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
if ($database == 'gaudi') $server_db = $database;
else $server_db = 'nana-tren';
}
else if ($table_ke == 5)
{
$t4973 = 'promotiond_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 6)
{
$t4973 = 'promotionh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 7)
{
$t4973 = 'promogroup1_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 8)
{
$t4973 = 'promotionl_location';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 9)
{
$t4973 = 'sellprice_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " sellprice_PLNo = 1 ";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 10)
{
$t4973 = 'barcode_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 11)
{
$t4973 = 'productitem_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 12)
{
$t4973 = 'voucherd_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 13)
{
$t4973 = 'voucherh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 14)
{
$t4973 = 'add_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 15)
{
$t4973 = 'stockadjh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 16)
{
$t4973 = 'transferh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " transferh_Fromloc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 17)
{
$t4973 = 'transferd_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " transferd_Fromloc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 18)
{
$t4973 = 'transferoutd_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " ( transferoutd_Fromloc_mstrID = " . $user_pos_loc . " or transferoutd_Toloc_mstrID = " . $user_pos_loc . ") ";
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 19)
{
$t4973 = 'transferouth_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " ( transferouth_Fromloc_mstrID = " . $user_pos_loc . " or transferouth_Toloc_mstrID = " . $user_pos_loc . ") ";
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 20)
{
$t4973 = 'transferind_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " transferind_loc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 21)
{
$t4973 = 'transferinh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " transferinh_loc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 22)
{
$t4973 = 'bankmap_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 23)
{
$t4973 = 'group1_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 24)
{
$t4973 = 'pricesp_tbl';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 25)
{
$t4973 = 'paymentmaptoedc_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
if ($database == 'bnb') $filter_sql = "";
else $filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 26)
{
$t4973 = 'salesmand_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 27)
{
$t4973 = 'salesmanh_header';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 28)
{
$t4973 = 'computerassignd_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 29)
{
$t4973 = 'brand_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 30)
{
$t4973 = 'struck_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 31)
{
$t4973 = 'pos_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 32)
{
$t4973 = 'subprogram_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 33)
{
$t4973 = 'plistassign_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 34)
{
$t4973 = 'stockrunning_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " stockrunning_loc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
if ($database == 'gaudi') $server_db = $database . $computerassignd_LocationCd;
else $server_db = $computerassignd_LocationCd;
}
else if ($table_ke == 35)
{
$t4973 = 'stockadjd_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " stockadjd_loc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
$server_db = $database;
}
else if ($table_ke == 36)
{
$t4973 = 'monthendclosing_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = " monthendclosing_loc_mstrID = " . $user_pos_loc;
$koneksi_db = $database_offline;
if ($database == 'gaudi') $server_db = $database . $computerassignd_LocationCd;
else $server_db = $computerassignd_LocationCd;
}
else if ($table_ke == 37)
{
$t4973 = 'discount_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 38)
{
$t4973 = 'edc_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 39)
{
$t4973 = 'edcassign_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 40)
{
$t4973 = 'userassign_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 41)
{
$t4973 = 'membert_type';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 42)
{
$t4973 = 'contact_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 43)
{
$t4973 = 'hjbarud_detail';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 44)
{
$t4973 = 'returartikel_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 45)
{
$t4973 = 'sodexo_authorization';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 46)
{
$t4973 = 'rebranding_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 47)
{
$t4973 = 'appf_det';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 48)
{
$t4973 = 'app_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 49)
{
$t4973 = 'loc_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 50)
{
$t4973 = 'member_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_slave;
$server_db = $database;
}
else if ($table_ke == 51 && ($computerassignd_LocationCd == 'BNB0001' || $computerassignd_LocationCd == 'BNB0012'))
{
$t4973 = 'var2_mstr';
$sub_t4973 = substr($t4973, 0, strpos($t4973, '_'));
$filter_sql = "";
$koneksi_db = $database_offline;
$server_db = $database;
}
$TABLE_NAME = '';
$sql_cektable = "SELECT TABLE_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . $koneksi_db . "' AND TABLE_NAME = '" . $t4973 . "' limit 1;";
$result_cektable = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_cektable) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
while ($row_cektable = mysqli_fetch_array($result_cektable, MYSQLI_ASSOC))
{
$TABLE_NAME = $row_cektable['TABLE_NAME'];
}
mysqli_free_result($result_cektable);
if ($TABLE_NAME == '')
{
if (!file_exists(substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd")))
{
$isi_q = 'md ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp' . date("Ymd");
$hasil_system = system($isi_q, $retval);
}
$isi_q = 'del ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $t4973 . '_str.sql';
$hasil_system = system($isi_q, $retval);
$isi_q = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\pscp.exe -P 2276 -pw Mytrip12369874 yanto_713m@' . $ip_publik . ':/home/rimas/' . $database_slave . '/' . $t4973 . '_str.sql ' . substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp';
$hasil_system = system($isi_q, $retval);
$output_filename = substr(__FILE__, 0, 3) . 'xampp\\htdocs\xampp\\tmp\\' . $t4973 . '_str.sql';
$mulai_baca = 'No';
$isi_filename = '';
$handle = fopen($output_filename, "r");
if ($handle)
{
while (($line = fgets($handle)) !== false)
{
if (strpos($line, "CREATE TABLE") !== false || $mulai_baca == 'Yes')
{
$mulai_baca = 'Yes';
$isi_filename .= $line;
if (strpos($line, "ENGINE") !== false) break;
}
}
fclose($handle);
}
if ($TABLE_NAME == '')
{
mysqli_query($_POST['koneksi' . $koneksi_db], $isi_filename) or $err_msg = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($err_msg == '') mysqli_commit($_POST['koneksi' . $koneksi_db]);
else mysqli_rollback($_POST['koneksi' . $koneksi_db]);
}
echo "\n";
echo $err_msg;
echo "\n";
echo $isi_filename;
echo "\n";
}
$tidak_ada_member_tgl_lahir = '';
$sql_koneksi = "SELECT member_tgl_lahir FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_tgl_lahir = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_tgl_lahir != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_tgl_lahir DATE DEFAULT '1900-01-01' NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_tgl_lahir = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_Whatsapp = '';
$sql_koneksi = "SELECT member_Whatsapp FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_Whatsapp = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_Whatsapp != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_Whatsapp VARCHAR(40) NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_Whatsapp = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_email = '';
$sql_koneksi = "SELECT member_email FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_email = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_email != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_email VARCHAR(200) NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_email = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_nama = '';
$sql_koneksi = "SELECT member_nama FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_nama = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_nama != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_nama VARCHAR(200) NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_nama = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_password = '';
$sql_koneksi = "SELECT member_password FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_password = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_password != '')
{
$query_altertable = "ALTER TABLE member_mstr ADD COLUMN member_password VARCHAR(50) NULL;";
mysqli_query($_POST['koneksi' . $koneksi_db], $query_altertable) or $tidak_ada_member_password = mysqli_error($_POST['koneksi' . $koneksi_db]);
mysqli_commit($_POST['koneksi' . $koneksi_db]);
}
$tidak_ada_member_email_cek = '';
$sql_koneksi = "SELECT member_email_cek FROM member_mstr limit 1";
$result_koneksi = mysqli_query($_POST['koneksi' . $koneksi_db], $sql_koneksi) or $tidak_ada_member_email_cek = mysqli_error($_POST['koneksi' . $koneksi_db]);
if ($tidak_ada_member_email_cek != '')
{
$query_altertable = &q