| Server IP : 172.67.216.113 / Your IP : 172.71.28.146 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home2/cp648411/public_html/ilawasia.onnud20.com/Customer/ |
Upload File : |
<?php
$ck='not';
include("../include/checkLogin.php");
include("../include/class.php");
include("../include/table_name.php");
$date_year = date("Y");
$date_month = date("m");
$NamesId = @$_POST["NamesId"];
$sql = array('table'=>$name_table69,"count" => 'COUNT(Id) AS Nid','where'=>"NamesId = '".$NamesId."'");
$view_sql = $view_db->view($sql);
$row = $view_db->q($view_sql);
$NId = $row['Nid'];
$ct_n = $_POST['ct_n'];
$ind = $customer_db->LoadTech($arrayName);
$ct_n2 = COUNT($ind['Data']);
/*
echo '<pre>';
print_r($ind);
echo '</pre>';
echo count($ct_n);
echo '<pre>';
print_r($ct_n);
echo '</pre>';
*/
$Remark = $actiondata_db->getdata($_POST['Remark']);
$PostalAddress = $actiondata_db->getdata($_POST['PostalAddress']);
$NamesName = $actiondata_db->getdata($_POST['NamesName']);
$Telephone = @$_POST["Telephone"];
$list = array(
'table'=>$name_table51,
'NamesId'=>@$_POST["NamesId"],
'NamesName'=>@$NamesName,
'Telephone'=>@$Telephone,
'PostalAddress'=>@$PostalAddress,
'Fax'=>@$_POST["Fax"],
'ElectronicMail'=>@$_POST["ElectronicMail"],
'TaxID'=>@$_POST["TaxID"],
'Initial'=>@$_POST["Initial"],
'Remark'=>@$Remark,
'LastUpdateBy'=>@$_SESSION['UserInfo'][0]["UserId"],
'LastUpdateDateTime'=>@$date,
);
$add = $actiondata_db->edit_db($list);
if($add['suc']==1){
if($NId==0){
foreach ($ind['Data'] as $key => $value) {
$StatusActive = 0;
$Remark = "";
for ($i=0; $i < count($ct_n) ; $i++) {
if($value['Id'] == $ct_n[$i]){
$StatusActive = 1;
if($ct_n[$i]=="17"){
$Remark = @$_POST['ct_mark'];
}
}
}
$list2 = array(
'table'=>$name_table69,
'IndustryId'=>"'".@$value['Id']."'",
'NamesId'=>"'".@$NamesId."'",
'Remark'=>"'".@$Remark."'",
'StatusActive'=>"'".@$StatusActive."'",
'CreateBy'=>"'".@$_SESSION['UserInfo'][0]["UserId"]."'",
'CreateDateTime'=>"'".@$date."'",
);
$add = $actiondata_db->add_db($list2);
}
}else{
$ind2 = $customer_db->LoadTechmap($NamesId);
foreach ($ind2['Data'] as $key => $value) {
$StatusActive = 0;
$Remark = "";
for ($i=0; $i < count($ct_n) ; $i++) {
if($value['IndustryId'] == $ct_n[$i]){
$StatusActive = 1;
if($ct_n[$i]==17){
$Remark = @$_POST['ct_mark'];
}
}
}
$list2 = array(
'table'=>$name_table69,
'Id'=>@$value['Id'],
'StatusActive'=>@$StatusActive,
'Remark'=>@$Remark,
'LastUpdateBy'=>@$_SESSION['UserInfo'][0]["UserId"],
'LastUpdateDateTime'=>@$date,
);
$add = $actiondata_db->edit_db($list2);
}
}
$_SESSION['Success'] = "Edit Customer Successful.";
echo "<script>window.location.href='index.php';</script>";
}else{
$_SESSION['Success'] = "false";
echo "<script>window.location.href='index.php';</script>";
}
?>