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 defined("\x42\101\x53\x45\120\x41\124\x48") or die("\x4e\x6f\40\x64\151\162\145\x6..

Decoded Output download

<?php 
 defined("BASEPATH") or die("No direct script access allowed"); class Dashboard extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model("Admin_model"); $this->is_login(); $this->checkLicense(); } private function checkLicense() { $secretKey = "ABC786!@#ased"; $systemInfo = php_uname("n") . php_uname("s") . php_uname("m"); $systemInfo = md5($systemInfo); $generatedKey = md5($systemInfo . $secretKey); $keyFilePath = "key.txt"; if (!file_exists($keyFilePath)) { $this->handleViolation($systemInfo); die; } $storedKey = trim(file_get_contents($keyFilePath)); if ($generatedKey !== $storedKey) { $this->handleViolation($systemInfo); die; } } private function handleViolation($systemInfo) { echo "<h2>Your software is not registered.</h2>"; echo "<p>"; echo "Public key: " . $systemInfo . "<br>"; echo "Please contact us on WhatsApp at +923056179979 and share this public key to obtain your license key.<br>"; echo "</p>"; file_put_contents("violation_log.txt", date("Y-m-d H:i:s") . " - Unauthorized use detected on system: {$systemInfo}\xa", FILE_APPEND); } public function getmac() { $this->load->view("public/getmac"); } public function transfer() { $this->load->view("public/transfer"); } public function stockmaintainchk() { $qty = $this->Admin_model->sumdata("stock", "stk_qty", array()); $remainqty = $this->Admin_model->sumdata("stock", "stk_remainqty", array()); $this->db->select_max("pro_id"); $result = $this->db->get("product"); $a = $result->result()[0]->pro_id; if ($qty != $remainqty) { while ($a > 0) { $pqty = $this->Admin_model->sumdata("stock", "stk_qty", array("stk_proid" => $a)); $premainqty = $this->Admin_model->sumdata("stock", "stk_remainqty", array("stk_proid" => $a)); if ($pqty != $premainqty) { $stockindetail = $this->Admin_model->getdata("stock", array("stk_qty>" => 0, "stk_proid" => $a)); $stockoutdetail = $this->Admin_model->getdata("stock", array("stk_qty<" => 0, "stk_proid" => $a)); if ($stockindetail) { foreach ($stockindetail as $stkind) { $data = array("stk_id" => $stkind->stk_id, "stk_remainqty" => $stkind->stk_qty, "stk_saleamount" => 0, "stk_sale" => 0); $this->Admin_model->updata($data, "stock", array("stk_id" => $data["stk_id"])); } } $this->Admin_model->deldata("stockoutdetail", "stkoutd_proid", $a); if ($stockoutdetail) { foreach ($stockoutdetail as $stkout) { $tra = $this->Admin_model->getdata("transaction", array("tra_tkn" => $stkout->stk_tkn, "tra_type" => $stkout->stk_type, "tra_cliid" => 0)); $data = array("stk_id" => $stkout->stk_id, "stk_saleamount" => $tra[0]->tra_amount * -1, "stk_remainqty" => $stkout->stk_qty); $this->Admin_model->updata($data, "stock", array("stk_id" => $data["stk_id"])); } } } $a--; } } } public function stores() { $this->is_admin(); $user = $this->Admin_model->getdata("user", array("usr_id" => $this->session->userdata("usr_id"))); $stores = $this->Admin_model->getdata("stores", array()); $data = array("stores" => $stores); $this->load->view("public/stores", array("data" => $data)); } public function addstore() { $this->is_admin(); $storename = $this->input->post("storename"); $storedesc = $this->input->post("storedesc"); $data = array("str_name" => $storename, "str_desc" => $storedesc); $this->Admin_model->adddata($data, "stores"); return redirect("dashboard/stores"); } public function delstore($strid) { $this->is_admin(); $chk = $this->Admin_model->getdata("invoicedetail", array("invcd_strid" => $strid)); if (!$chk) { $this->Admin_model->deletedata("stores", array("str_id" => $strid)); } return redirect("dashboard/stores"); } public function profile() { $this->is_admin(); $user = $this->Admin_model->getdata("user", array("usr_id" => $this->session->userdata("usr_id"))); $users = $this->Admin_model->getdata("user", array("usr_id!=" => 1)); $data = array("user" => $user, "users" => $users); $this->load->view("public/profile", array("data" => $data)); } public function adduser() { $data["usr_name"] = $this->input->post("name"); $data["usr_contact"] = $this->input->post("contact"); $data["usr_address"] = $this->input->post("address"); $data["usr_type"] = $this->input->post("type"); $data["usr_user"] = $this->input->post("username"); $data["usr_pwd"] = $this->input->post("password"); $username = $this->Admin_model->getdata("user", array("usr_user" => $this->input->post("username"))); if (!$username) { $this->Admin_model->adddata($data, "user"); $this->session->set_flashdata("msg", "New User has been successfully added."); } else { $this->session->set_flashdata("err", "Username already exist."); } return redirect("dashboard/profile"); } public function upusr() { $data["usr_id"] = $this->input->post("usrid"); $data["usr_name"] = $this->input->post("name"); $data["usr_contact"] = $this->input->post("contact"); $data["usr_address"] = $this->input->post("address"); $data["usr_type"] = $this->input->post("type"); $data["usr_user"] = $this->input->post("username"); $data["usr_pwd"] = $this->input->post("password"); $this->Admin_model->updata($data, "user", array("usr_id" => $data["usr_id"])); $this->session->set_flashdata("msg", "User has been successfully Update."); return redirect("dashboard/profile"); } public function upuser() { $data["usr_name"] = $this->input->post("name"); $data["usr_contact"] = $this->input->post("contact"); $data["usr_address"] = $this->input->post("address"); $data["usr_shopname"] = $this->input->post("shpname"); $data["usr_shopcon"] = $this->input->post("shpcon"); $data["usr_shopaddr"] = $this->input->post("shpaddr"); $curpwd = $this->input->post("curpwd"); $newpwd = $this->input->post("newpwd"); $retyppwd = $this->input->post("retyppwd"); $user = $this->Admin_model->getdata("user", array("usr_id" => $this->session->userdata("usr_id"))); if ($curpwd != '') { if ($user[0]->usr_pwd == $curpwd) { if ($newpwd == $retyppwd) { if (strlen($newpwd) > 7) { $this->session->set_flashdata("msg", "Your profile and password has been successfully updated."); $data["usr_pwd"] = $newpwd; } else { $this->session->set_flashdata("err", "Your New password nust be above 8 characters."); } } else { $this->session->set_flashdata("err", "Your New password & Retype password are not same."); } } else { $this->session->set_flashdata("err", "Your current password in not valid."); } } if ($curpwd == '') { $this->session->set_flashdata("msg", "Your profile has been successfully updated."); } $this->Admin_model->updata($data, "user", array("usr_id" => $this->session->userdata("usr_id"))); return redirect("dashboard/profile"); } public function stockmaintain() { $stockoutdetail = $this->Admin_model->getdata("stock", array("stk_remainqty<" => 0), array(), "stk_invcid ASC"); if ($stockoutdetail) { foreach ($stockoutdetail as $stkoutd) { $rmqty = $stkoutd->stk_remainqty; $rmsaleam = $stkoutd->stk_saleamount; $stockindetail = $this->Admin_model->getdata("stock", array("stk_remainqty>" => 0, "stk_proid" => $stkoutd->stk_proid)); if ($stockindetail) { foreach ($stockindetail as $stkind) { if ($stkind->stk_remainqty + $rmqty > 0) { $data = array("stk_id" => $stkind->stk_id, "stk_remainqty" => $stkind->stk_remainqty + $rmqty, "stk_saleamount" => $stkind->stk_saleamount + $rmsaleam * -1, "stk_sale" => $stkind->stk_sale + $rmqty * -1); $this->Admin_model->updata($data, "stock", array("stk_id" => $data["stk_id"])); if ($rmqty != 0) { $data = array("stkoutd_invoiceid" => $stkoutd->stk_invcid, "stkoutd_qty" => $rmqty * -1, "stkoutd_rate" => $rmsaleam / $rmqty, "stkoutd_proid" => $stockoutdetail[0]->stk_proid, "stkoutd_stkid" => $stkind->stk_id); } $this->Admin_model->adddata($data, "stockoutdetail"); $data = array("stk_id" => $stkoutd->stk_id, "stk_remainqty" => 0, "stk_saleamount" => 0); $this->Admin_model->updata($data, "stock", array("stk_id" => $data["stk_id"])); break; } else { if ($stkoutd->stk_qty != 0) { $rate = $stkoutd->stk_saleamount / $stkoutd->stk_qty; } else { $rate = 0; } $rmqty = $stkind->stk_remainqty + $rmqty; $rmsaleam = $rmsaleam + $rate * $stkind->stk_remainqty; $data = array("stk_id" => $stkind->stk_id, "stk_remainqty" => 0, "stk_sale" => $stkind->stk_sale + $stkind->stk_remainqty, "stk_saleamount" => $stkind->stk_saleamount + $rate * $stkind->stk_remainqty); $this->Admin_model->updata($data, "stock", array("stk_id" => $data["stk_id"])); $data = array("stkoutd_invoiceid" => $stkoutd->stk_invcid, "stkoutd_qty" => $stkind->stk_remainqty, "stkoutd_rate" => $rate, "stkoutd_proid" => $stockoutdetail[0]->stk_proid, "stkoutd_stkid" => $stkind->stk_id); $this->Admin_model->adddata($data, "stockoutdetail"); $data = array("stk_id" => $stkoutd->stk_id, "stk_remainqty" => $rmqty, "stk_saleamount" => $rmqty * $rate); $this->Admin_model->updata($data, "stock", array("stk_id" => $data["stk_id"])); } } } } } } public function is_admin() { if ($this->session->userdata("log_tkn") != md5(base_url())) { $this->logout(); } if ($this->session->userdata("usr_type") != "admin") { redirect(''); } } public function is_login() { if ($this->session->userdata("log_tkn") != md5(base_url())) { $this->logout(); } if (!$this->session->userdata("usr_id")) { redirect(''); } } public function index() { $this->load->view("public/dashboard"); } public function products() { $company = $this->Admin_model->getdata("company", array()); $products = $this->Admin_model->getdata("product", array()); if (isset($_GET["proid"])) { $product = $this->Admin_model->getdata("product", array("pro_id" => $_GET["proid"])); } else { $product = false; } $data = array("company" => $company, "products" => $products, "product" => $product); $this->load->view("public/products", array("data" => $data)); } public function upcopany() { $cmpnyid = $this->input->post("cmpnyid"); $cname = $this->input->post("cname"); $cdesc = $this->input->post("cdesc"); $cliid = $this->input->post("cliid"); $data = array("cmpny_id" => $cmpnyid, "cmpny_name" => $cname, "cmpny_desc" => $cdesc, "cmpny_cliid" => $cliid); $this->Admin_model->updata($data, "company", array("cmpny_id" => $data["cmpny_id"])); $this->session->set_flashdata("msg", "Company detail has been successfully Updated."); return redirect("dashboard/company"); } public function addcopany() { $cname = $this->input->post("cname"); $cdesc = $this->input->post("cdesc"); $cliid = $this->input->post("cliid"); $data = array("cmpny_name" => $cname, "cmpny_desc" => $cdesc, "cmpny_cliid" => $cliid); $this->Admin_model->adddata($data, "company"); $this->session->set_flashdata("msg", "New company has been successfully added."); return redirect("dashboard/company"); } public function addpro() { $proname = $this->input->post("proname"); $prodesc = $this->input->post("prodesc"); $barcode = $this->input->post("barcode"); $purchaserate = $this->input->post("purchaserate"); $salerate = $this->input->post("salerate"); $dicsperunit = $this->input->post("dicsperunit"); $discpercentage = $this->input->post("discpercentage"); $unitname = $this->input->post("unitname"); $packingname = $this->input->post("packingname"); $packingqty = $this->input->post("packingqty"); $Packinpurgrate = $this->input->post("Packinpurgrate"); $Packinsalegrate = $this->input->post("Packinsalegrate"); $Packingqty = $this->input->post("Packingqty"); $openingunitqty = $this->input->post("openingunitqty"); $openingpackingqty = $this->input->post("openingpackingqty"); $minqty = $this->input->post("minqty"); $maxqty = $this->input->post("maxqty"); $docpaper = $this->input->post("docpaper"); $isdrug = $this->input->post("isdrug"); $openingqty = $openingunitqty + $openingpackingqty * $packingqty; $salerate = $salerate + $Packinsalegrate / $packingqty; $purchaserate = $purchaserate + $Packinpurgrate / $packingqty; $this->db->trans_start(); $data = array("pro_name" => $proname, "pro_desc" => $prodesc, "pro_barcode" => $barcode, "pro_purchase" => $purchaserate, "pro_salerate" => $salerate, "pro_salediscperunit" => $dicsperunit, "pro_saledicpercentage" => $discpercentage, "pro_unitname" => $unitname, "pro_packqty" => $packingqty, "pro_packname" => $packingname, "pro_openingqty" => $openingqty, "pro_max" => $maxqty, "pro_min" => $minqty, "pro_docpaper" => $docpaper, "pro_druged" => $isdrug); $proid = $this->Admin_model->adddata($data, "product"); $data = array("stk_time" => time(), "stk_date" => 0, "stk_tkn" => 0, "stk_invcid" => 0, "stk_cliid" => 0, "stk_proid" => $proid, "stk_type" => "opn", "stk_qty" => $openingqty); $this->Admin_model->adddata($data, "stock"); $this->db->trans_complete(); $this->session->set_flashdata("msg", "New product has been successfully added.(" . $proname . ")"); return redirect("dashboard/products"); } public function uppro() { $proid = $this->input->post("proid"); $proname = $this->input->post("proname"); $prodesc = $this->input->post("prodesc"); $companyid = $this->input->post("companyid"); $barcode = $this->input->post("barcode"); $purchaserate = $this->input->post("purchaserate"); $salerate = $this->input->post("salerate"); $dicsperunit = $this->input->post("dicsperunit"); $discpercentage = $this->input->post("discpercentage"); $unitname = $this->input->post("unitname"); $packingname = $this->input->post("packingname"); $packingqty = $this->input->post("packingqty"); $Packinpurgrate = $this->input->post("Packinpurgrate"); $Packinsalegrate = $this->input->post("Packinsalegrate"); $Packingqty = $this->input->post("Packingqty"); $openingunitqty = $this->input->post("openingunitqty"); $openingpackingqty = $this->input->post("openingpackingqty"); $minqty = $this->input->post("minqty"); $maxqty = $this->input->post("maxqty"); $openingqty = $openingunitqty + $openingpackingqty * $packingqty; $salerate = $salerate + $Packinsalegrate / $packingqty; $purchaserate = $purchaserate + $Packinpurgrate / $packingqty; $this->db->trans_start(); $this->Admin_model->deletedata("stock", array("stk_proid" => $proid, "stk_type" => "opn", "stk_date" => 0, "stk_tkn" => 0)); $data = array("pro_id" => $proid, "pro_name" => $proname, "pro_desc" => $prodesc, "pro_company" => $companyid, "pro_barcode" => $barcode, "pro_purchase" => $purchaserate, "pro_salerate" => $salerate, "pro_salediscperunit" => $dicsperunit, "pro_saledicpercentage" => $discpercentage, "pro_unitname" => $unitname, "pro_packqty" => $packingqty, "pro_packname" => $packingname, "pro_openingqty" => $openingqty, "pro_max" => $maxqty, "pro_min" => $minqty); $this->Admin_model->updata($data, "product", array("pro_id" => $data["pro_id"])); $data = array("stk_time" => time(), "stk_date" => 0, "stk_tkn" => 0, "stk_invcid" => 0, "stk_cliid" => 0, "stk_proid" => $proid, "stk_type" => "opn", "stk_qty" => $openingqty); $this->Admin_model->adddata($data, "stock"); $this->db->trans_complete(); $this->session->set_flashdata("msg", "Existing product has been successfully Updated."); return redirect("dashboard/products"); } public function addbenefi() { $serderid = $this->input->post("serderid"); $reciverid = $this->input->post("reciverid"); $benefidetail = $this->Admin_model->getdata("beneficiaries", array("bnifi_senderid" => $serderid, "bnifi_reciverid" => $reciverid)); if (!$benefidetail) { $data = array("bnifi_senderid" => $serderid, "bnifi_reciverid" => $reciverid); $this->Admin_model->adddata($data, "beneficiaries"); } return redirect("dashboard/transfer"); } public function accounts() { $this->is_admin(); $category = $this->Admin_model->getdata("category", array()); $joins[0] = array("jointable" => "category", "jointablecol" => "cat_id", "tablecol" => "cli_catid"); $clients = $this->Admin_model->getjoinsdata("clients", array(), $joins); $data = array("category" => $category, "clients" => $clients); $this->load->view("public/accounts", array("data" => $data)); } public function addcat() { $cname = $this->input->post("cname"); $cdesc = $this->input->post("cdesc"); $data = array("cat_name" => $cname, "cat_desc" => $cdesc); $this->Admin_model->adddata($data, "category"); $this->session->set_flashdata("msg", "New category has been successfully added."); return redirect("dashboard/accounts"); } public function addcli() { $partyname = $this->input->post("partyname"); $ownername = $this->input->post("ownername"); $contact = $this->input->post("contact"); $cnic = $this->input->post("cnic"); $ntn = $this->input->post("ntn"); $address = $this->input->post("address"); $catid = $this->input->post("catid"); $data = array("cli_party" => $partyname, "cli_owner" => $ownername, "cli_contact" => $contact, "cli_cnic" => $cnic, "cli_ntn" => $ntn, "cli_address" => $address, "cli_catid" => $catid); $this->Admin_model->adddata($data, "clients"); $this->session->set_flashdata("msg", "New Client has been successfully added."); return redirect("dashboard/accounts"); } public function upcli() { $cliid = $this->input->post("cliid"); $partyname = $this->input->post("partyname"); $ownername = $this->input->post("ownername"); $contact = $this->input->post("contact"); $cnic = $this->input->post("cnic"); $ntn = $this->input->post("ntn"); $address = $this->input->post("address"); $catid = $this->input->post("catid"); $data = array("cli_id" => $cliid, "cli_party" => $partyname, "cli_owner" => $ownername, "cli_contact" => $contact, "cli_cnic" => $cnic, "cli_ntn" => $ntn, "cli_address" => $address, "cli_catid" => $catid); $this->Admin_model->updata($data, "clients", array("cli_id" => $data["cli_id"])); $this->session->set_flashdata("msg", "Existing client detail has been successfully Updated."); return redirect("dashboard/accounts"); } public function getdatestring($invcdate) { $invcdate = explode("/", $invcdate); $invcdate = $invcdate[1] . "/" . $invcdate[0] . "/" . $invcdate[2]; return strtotime($invcdate); } public function payment($traid = 0) { $this->is_admin(); $joins[0] = array("jointable" => "category", "jointablecol" => "cat_id", "tablecol" => "cli_catid"); $clients = $this->Admin_model->getjoinsdata("clients", array(), $joins); if (!isset($_GET["date"])) { $date = strtotime(date("m/d/Y")); } else { $date = $this->getdatestring($_GET["date"]); } $joins[0] = array("jointable" => "clients", "jointablecol" => "cli_id", "tablecol" => "tra_cliid"); $transaction = $this->Admin_model->getjoinsdata("transaction", array("tra_date" => $date), $joins); $trans = $this->Admin_model->getjoinsdata("transaction", array("tra_id" => $traid), $joins); if ($trans) { if ($trans[0]->tra_type != "cpv") { if ($trans[0]->tra_type != "crv") { return redirect("dashboard/payment"); } } } $data = array("clients" => $clients, "transaction" => $transaction, "date" => $date, "trans" => $trans); $this->load->view("public/payment", array("data" => $data)); } public function delpayment($traid) { if (isset($_GET["date"])) { $date = $_GET["date"]; } else { $date = date("d/m/Y"); } $this->Admin_model->deletedata("transaction", array("tra_id" => $traid)); $this->session->set_flashdata("msg", "Your payment have been successfully deleted."); return redirect("dashboard/payment/?date=" . $date); } public function uptra() { $date = $this->getdatestring($this->input->post("date")); $traid = $this->input->post("traid"); $cliid = $this->input->post("cliid"); $prnumber = $this->input->post("prnumber"); $type = $this->input->post("type"); $amount = $this->input->post("amount"); $desc = $this->input->post("desc"); $time = time(); if ($type == "cpv") { $amount = $amount * -1; } $data = array("tra_id" => $traid, "tra_date" => $date, "tra_cliid" => $cliid, "tra_prno" => $prnumber, "tra_type" => $type, "tra_amount" => $amount, "tra_desc" => $desc, "tra_time" => $time, "tra_status" => "confirm"); $this->Admin_model->updata($data, "transaction", array("tra_id" => $data["tra_id"])); $this->session->set_flashdata("msg", "Your payment have been successfully Updated."); return redirect("dashboard/payment/?date=" . date("d/m/Y", $date) . "&traid=" . $traid); } public function addtra() { $date = $this->getdatestring($this->input->post("date")); $cliid = $this->input->post("cliid"); $prnumber = $this->input->post("prnumber"); $type = $this->input->post("type"); $amount = $this->input->post("amount"); $desc = $this->input->post("desc"); $time = time(); if ($type == "cpv") { $amount = $amount * -1; } $tkn = rand(1000, 1000000000) . time(); $data = array("tra_date" => $date, "tra_cliid" => $cliid, "tra_prno" => $prnumber, "tra_type" => $type, "tra_amount" => $amount, "tra_desc" => $desc, "tra_time" => $time, "tra_tkn" => $tkn, "tra_status" => "confirm"); $this->Admin_model->adddata($data, "transaction"); $this->session->set_flashdata("msg", "Your payment have been successfully added."); return redirect("dashboard/payment/?date=" . $this->input->post("date")); } public function company() { $joins[0] = array("jointable" => "clients", "jointablecol" => "cli_id", "tablecol" => "cmpny_cliid"); $company = $this->Admin_model->getjoinsdata("company", array(), $joins); $joins[0] = array("jointable" => "category", "jointablecol" => "cat_id", "tablecol" => "cli_catid"); $clients = $this->Admin_model->getjoinsdata("clients", array(), $joins); $data = array("company" => $company, "clients" => $clients); $this->load->view("public/company", array("data" => $data)); } public function companydetail($cmpnyid) { $company = $this->Admin_model->getdata("company", array("cmpny_id" => $cmpnyid)); $products = $this->Admin_model->getdata("product", array()); $joins[0] = array("jointable" => "product", "jointablecol" => "pro_id", "tablecol" => "cmpnyd_proid"); $companydetail = $this->Admin_model->getjoinsdata("companydetail", array("cmpnyd_cmpnyid" => $cmpnyid), $joins); if (!$company) { return redirect("dashboard/company"); } if (isset($_GET["proid"])) { $data = array("cmpnyd_cmpnyid" => $cmpnyid, "cmpnyd_proid" => $_GET["proid"]); $cmpnydetail = $this->Admin_model->getdata("companydetail", $data); if (!$cmpnydetail) { $this->Admin_model->adddata($data, "companydetail"); } return redirect("dashboard/companydetail/" . $cmpnyid); } $data = array("company" => $company, "products" => $products, "companydetail" => $companydetail); $this->load->view("public/companydetail", array("data" => $data)); } public function orders() { $joins[0] = array("jointable" => "clients", "jointablecol" => "cli_id", "tablecol" => "cmpny_cliid"); $company = $this->Admin_model->getjoinsdata("company", array(), $joins); $joins[0] = array("jointable" => "company", "jointablecol" => "cmpny_id", "tablecol" => "cli_id"); $clients = $this->Admin_model->getjoinsdata("clients", array(), $joins); $company = $this->Admin_model->getdata("company", array()); if ($company) { foreach ($company as $c) { $cliides[] = $c->cmpny_cliid; } } $cliides = array_unique($cliides); $joins[0] = array("jointable" => "clients", "jointablecol" => "cli_id", "tablecol" => "pord_cliid"); $orders = $this->Admin_model->getjoinsdata("purorder", array(), $joins); $data = array("company" => $company, "cliides" => $cliides, "orders" => $orders); $this->load->view("public/orders", array("data" => $data)); } public function order($ordid) { $joins[0] = array("jointable" => "clients", "jointablecol" => "cli_id", "tablecol" => "pord_cliid"); $order = $this->Admin_model->getjoinsdata("purorder", array("pord_id" => $ordid), $joins); $company = $this->Admin_model->getdata("company", array("cmpny_cliid" => $order[0]->cli_id)); if ($company) { foreach ($company as $cmpny) { $joins[0] = array("jointable" => "product", "jointablecol" => "pro_id", "tablecol" => "cmpnyd_proid"); $product = $this->Admin_model->getjoinsdata("companydetail", array("cmpnyd_cmpnyid" => $cmpny->cmpny_id), $joins); $this->db->trans_start(); if ($product) { foreach ($product as $pro) { $data = array("pord_ordid" => $ordid, "pord_proid" => $pro->pro_id); $odrdetail = $this->Admin_model->getdata("porderdetail", $data); if (!$odrdetail) { $this->Admin_model->adddata($data, "porderdetail"); } } } $this->db->trans_complete(); } } $joins[0] = array("jointable" => "product", "jointablecol" => "pro_id", "tablecol" => "pord_proid"); $odrdetail = $this->Admin_model->getjoinsdata("porderdetail", array("pord_ordid" => $ordid), $joins); $data = array("order" => $order, "odrdetail" => $odrdetail); $this->load->view("public/order", array("data" => $data)); } public function addorder() { $cliid = $this->input->post("cliid"); $type = $this->input->post("type"); $order = $this->Admin_model->getdata("purorder", array("pord_cliid" => $cliid, "pord_status" => "pending", "pord_type" => $type)); if (!$order) { $data = array("pord_cliid" => $cliid, "pord_status" => "pending", "pord_type" => $type); $ordid = $this->Admin_model->adddata($data, "purorder"); } else { $ordid = $order[0]->pord_id; } $this->session->set_flashdata("msg", "New order has been successfully Created."); return redirect("dashboard/order/" . $ordid); } public function logout() { $this->session->unset_userdata("usr_id"); $this->session->unset_userdata("usr_name"); $this->session->unset_userdata("usr_contact"); $this->session->unset_userdata("usr_type"); return redirect(''); } } ?>

Did this file decode correctly?

Original Code

<?php
 defined("\x42\101\x53\x45\120\x41\124\x48") or die("\x4e\x6f\40\x64\151\162\145\x63\164\40\x73\x63\x72\x69\160\x74\x20\x61\143\x63\145\163\x73\x20\141\154\154\157\167\145\144"); class Dashboard extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model("\101\144\155\151\156\137\x6d\157\x64\145\x6c"); $this->is_login(); $this->checkLicense(); } private function checkLicense() { $secretKey = "\101\102\103\x37\70\x36\x21\100\43\x61\163\x65\x64"; $systemInfo = php_uname("\156") . php_uname("\163") . php_uname("\x6d"); $systemInfo = md5($systemInfo); $generatedKey = md5($systemInfo . $secretKey); $keyFilePath = "\x6b\x65\x79\56\164\170\x74"; if (!file_exists($keyFilePath)) { $this->handleViolation($systemInfo); die; } $storedKey = trim(file_get_contents($keyFilePath)); if ($generatedKey !== $storedKey) { $this->handleViolation($systemInfo); die; } } private function handleViolation($systemInfo) { echo "\x3c\x68\62\76\x59\157\165\x72\40\163\157\x66\164\167\x61\162\x65\x20\151\163\40\156\x6f\164\40\x72\145\147\x69\x73\x74\x65\x72\145\x64\x2e\74\57\x68\x32\x3e"; echo "\74\160\x3e"; echo "\x50\x75\x62\154\151\143\x20\153\145\x79\x3a\x20" . $systemInfo . "\74\x62\x72\76"; echo "\120\154\145\x61\163\x65\40\143\x6f\x6e\x74\x61\143\164\40\165\163\x20\x6f\x6e\40\127\x68\141\x74\163\x41\x70\x70\x20\x61\164\x20\53\71\62\63\x30\65\66\61\x37\71\71\x37\71\x20\x61\x6e\144\x20\163\x68\x61\x72\145\40\x74\x68\x69\163\x20\160\x75\x62\154\151\143\40\153\145\x79\40\x74\x6f\x20\x6f\x62\164\141\151\x6e\40\171\157\165\162\40\x6c\151\143\145\x6e\163\145\40\x6b\145\171\x2e\x3c\x62\x72\x3e"; echo "\74\x2f\x70\76"; file_put_contents("\x76\151\157\154\141\164\151\x6f\156\x5f\154\x6f\x67\56\164\x78\x74", date("\x59\55\155\55\144\x20\x48\x3a\x69\72\163") . "\x20\55\40\x55\156\x61\x75\164\x68\x6f\162\151\x7a\145\x64\40\165\163\145\x20\x64\145\164\x65\143\x74\x65\x64\x20\x6f\156\40\163\171\163\164\145\x6d\72\40{$systemInfo}\xa", FILE_APPEND); } public function getmac() { $this->load->view("\160\165\142\x6c\x69\x63\57\x67\x65\164\x6d\x61\x63"); } public function transfer() { $this->load->view("\x70\x75\x62\x6c\x69\x63\x2f\164\162\x61\x6e\163\146\145\x72"); } public function stockmaintainchk() { $qty = $this->Admin_model->sumdata("\x73\x74\157\143\153", "\163\x74\x6b\137\161\164\171", array()); $remainqty = $this->Admin_model->sumdata("\x73\x74\x6f\143\153", "\x73\x74\153\x5f\x72\x65\155\141\151\156\x71\164\x79", array()); $this->db->select_max("\x70\162\x6f\x5f\x69\x64"); $result = $this->db->get("\x70\x72\x6f\x64\165\x63\164"); $a = $result->result()[0]->pro_id; if ($qty != $remainqty) { while ($a > 0) { $pqty = $this->Admin_model->sumdata("\163\x74\x6f\x63\153", "\163\x74\x6b\x5f\x71\164\171", array("\x73\164\x6b\x5f\x70\x72\x6f\x69\x64" => $a)); $premainqty = $this->Admin_model->sumdata("\x73\x74\157\143\153", "\163\164\x6b\137\x72\145\155\x61\151\156\x71\x74\171", array("\163\x74\153\137\160\x72\x6f\x69\144" => $a)); if ($pqty != $premainqty) { $stockindetail = $this->Admin_model->getdata("\163\164\x6f\143\x6b", array("\163\164\x6b\137\x71\x74\x79\76" => 0, "\x73\164\x6b\x5f\x70\162\157\x69\144" => $a)); $stockoutdetail = $this->Admin_model->getdata("\x73\164\x6f\x63\x6b", array("\163\x74\153\137\161\164\171\x3c" => 0, "\x73\164\153\137\160\162\157\151\x64" => $a)); if ($stockindetail) { foreach ($stockindetail as $stkind) { $data = array("\x73\x74\153\x5f\151\144" => $stkind->stk_id, "\x73\x74\x6b\137\162\x65\x6d\141\151\156\x71\x74\x79" => $stkind->stk_qty, "\x73\164\x6b\x5f\x73\141\154\x65\141\155\x6f\165\x6e\164" => 0, "\x73\164\153\137\x73\141\x6c\x65" => 0); $this->Admin_model->updata($data, "\163\164\x6f\x63\x6b", array("\163\x74\x6b\x5f\x69\x64" => $data["\x73\x74\x6b\137\x69\x64"])); } } $this->Admin_model->deldata("\163\164\x6f\143\x6b\157\x75\x74\144\145\164\141\x69\x6c", "\x73\x74\x6b\x6f\x75\x74\x64\137\x70\162\157\151\x64", $a); if ($stockoutdetail) { foreach ($stockoutdetail as $stkout) { $tra = $this->Admin_model->getdata("\164\x72\141\156\163\141\143\164\151\x6f\x6e", array("\x74\162\141\137\x74\x6b\156" => $stkout->stk_tkn, "\164\162\141\137\164\x79\160\145" => $stkout->stk_type, "\164\x72\x61\x5f\x63\x6c\x69\151\144" => 0)); $data = array("\x73\x74\153\x5f\151\144" => $stkout->stk_id, "\163\164\x6b\137\163\141\154\145\x61\155\157\165\x6e\164" => $tra[0]->tra_amount * -1, "\x73\x74\x6b\137\x72\x65\x6d\x61\x69\x6e\x71\x74\171" => $stkout->stk_qty); $this->Admin_model->updata($data, "\x73\164\157\143\x6b", array("\163\164\153\x5f\x69\144" => $data["\x73\164\153\137\x69\144"])); } } } $a--; } } } public function stores() { $this->is_admin(); $user = $this->Admin_model->getdata("\165\x73\x65\x72", array("\165\x73\x72\137\x69\144" => $this->session->userdata("\165\163\162\x5f\151\144"))); $stores = $this->Admin_model->getdata("\x73\x74\157\162\x65\x73", array()); $data = array("\163\164\157\x72\145\163" => $stores); $this->load->view("\x70\165\x62\x6c\151\x63\57\163\164\x6f\162\x65\x73", array("\144\x61\x74\x61" => $data)); } public function addstore() { $this->is_admin(); $storename = $this->input->post("\163\x74\x6f\162\145\x6e\x61\x6d\145"); $storedesc = $this->input->post("\163\164\x6f\162\x65\144\x65\x73\143"); $data = array("\163\x74\162\137\x6e\141\x6d\145" => $storename, "\x73\x74\162\x5f\144\x65\163\143" => $storedesc); $this->Admin_model->adddata($data, "\x73\x74\x6f\x72\145\163"); return redirect("\x64\141\x73\x68\x62\x6f\x61\x72\x64\57\163\164\157\162\x65\x73"); } public function delstore($strid) { $this->is_admin(); $chk = $this->Admin_model->getdata("\x69\x6e\x76\x6f\151\143\x65\x64\x65\164\x61\151\x6c", array("\x69\156\166\143\x64\137\163\x74\x72\151\x64" => $strid)); if (!$chk) { $this->Admin_model->deletedata("\x73\x74\157\x72\x65\x73", array("\163\164\162\137\151\144" => $strid)); } return redirect("\x64\x61\x73\x68\x62\x6f\141\x72\144\57\x73\x74\157\x72\145\x73"); } public function profile() { $this->is_admin(); $user = $this->Admin_model->getdata("\x75\163\145\x72", array("\x75\x73\x72\137\x69\x64" => $this->session->userdata("\x75\x73\x72\137\151\144"))); $users = $this->Admin_model->getdata("\165\x73\145\162", array("\165\163\162\x5f\x69\144\x21\75" => 1)); $data = array("\x75\x73\145\162" => $user, "\165\163\x65\x72\163" => $users); $this->load->view("\160\165\x62\154\151\x63\57\x70\162\157\146\x69\154\145", array("\144\141\164\141" => $data)); } public function adduser() { $data["\165\163\162\x5f\x6e\x61\155\145"] = $this->input->post("\x6e\x61\x6d\x65"); $data["\x75\163\162\x5f\x63\157\x6e\x74\141\x63\x74"] = $this->input->post("\x63\157\156\x74\141\143\x74"); $data["\165\x73\x72\137\x61\x64\144\162\145\163\163"] = $this->input->post("\x61\x64\x64\162\145\x73\x73"); $data["\165\x73\x72\137\x74\x79\x70\145"] = $this->input->post("\x74\x79\160\x65"); $data["\165\163\x72\x5f\165\x73\x65\x72"] = $this->input->post("\x75\163\x65\162\156\x61\155\145"); $data["\x75\163\162\137\160\167\x64"] = $this->input->post("\x70\x61\x73\x73\167\x6f\162\144"); $username = $this->Admin_model->getdata("\165\163\x65\x72", array("\x75\x73\x72\137\165\x73\145\162" => $this->input->post("\x75\163\x65\x72\156\141\155\145"))); if (!$username) { $this->Admin_model->adddata($data, "\165\163\145\x72"); $this->session->set_flashdata("\x6d\163\x67", "\x4e\x65\x77\40\125\x73\145\162\40\x68\x61\x73\x20\142\x65\x65\156\x20\163\x75\x63\x63\x65\163\x73\146\x75\154\154\x79\40\141\x64\144\x65\x64\56"); } else { $this->session->set_flashdata("\x65\x72\162", "\x55\163\145\162\x6e\141\x6d\x65\x20\141\x6c\x72\145\x61\x64\x79\40\145\170\151\x73\164\x2e"); } return redirect("\144\x61\x73\150\142\x6f\141\162\144\57\x70\162\157\x66\151\154\145"); } public function upusr() { $data["\x75\x73\x72\137\151\144"] = $this->input->post("\165\163\162\x69\144"); $data["\165\163\x72\x5f\156\141\155\x65"] = $this->input->post("\156\x61\155\145"); $data["\165\x73\x72\137\x63\x6f\156\x74\x61\x63\x74"] = $this->input->post("\x63\157\156\x74\141\x63\x74"); $data["\165\163\162\137\x61\x64\144\x72\x65\163\163"] = $this->input->post("\141\x64\x64\162\x65\163\x73"); $data["\165\x73\162\x5f\x74\171\x70\145"] = $this->input->post("\x74\x79\x70\x65"); $data["\x75\x73\162\137\165\163\145\162"] = $this->input->post("\x75\x73\145\x72\156\141\155\x65"); $data["\x75\x73\x72\137\160\167\x64"] = $this->input->post("\160\x61\x73\x73\x77\x6f\162\144"); $this->Admin_model->updata($data, "\x75\x73\x65\x72", array("\165\163\x72\137\x69\x64" => $data["\x75\163\162\x5f\151\x64"])); $this->session->set_flashdata("\155\163\x67", "\125\163\145\x72\40\150\x61\x73\40\142\145\145\x6e\x20\163\165\143\143\145\x73\x73\x66\165\154\154\x79\x20\125\160\x64\x61\164\x65\x2e"); return redirect("\x64\x61\163\x68\142\x6f\x61\x72\144\x2f\x70\x72\157\x66\151\x6c\145"); } public function upuser() { $data["\x75\x73\x72\x5f\156\141\x6d\x65"] = $this->input->post("\x6e\x61\155\145"); $data["\x75\163\162\x5f\143\x6f\156\x74\x61\143\164"] = $this->input->post("\143\x6f\156\x74\x61\x63\164"); $data["\165\163\x72\x5f\141\x64\144\162\x65\x73\x73"] = $this->input->post("\x61\144\x64\x72\145\163\163"); $data["\165\x73\162\x5f\x73\x68\157\x70\156\141\155\145"] = $this->input->post("\163\150\x70\156\x61\x6d\x65"); $data["\x75\x73\162\137\163\x68\157\x70\143\157\156"] = $this->input->post("\x73\150\x70\x63\157\x6e"); $data["\x75\x73\162\x5f\163\x68\x6f\160\141\x64\x64\x72"] = $this->input->post("\163\x68\160\x61\144\144\x72"); $curpwd = $this->input->post("\143\x75\x72\160\167\x64"); $newpwd = $this->input->post("\x6e\145\x77\160\x77\x64"); $retyppwd = $this->input->post("\162\x65\x74\171\160\x70\167\x64"); $user = $this->Admin_model->getdata("\165\x73\145\162", array("\165\163\x72\x5f\151\144" => $this->session->userdata("\165\x73\x72\137\x69\144"))); if ($curpwd != '') { if ($user[0]->usr_pwd == $curpwd) { if ($newpwd == $retyppwd) { if (strlen($newpwd) > 7) { $this->session->set_flashdata("\155\x73\147", "\131\x6f\x75\x72\x20\160\x72\157\x66\151\x6c\x65\40\141\156\144\40\x70\141\x73\163\x77\157\x72\144\40\x68\x61\x73\40\142\x65\x65\x6e\40\163\165\x63\143\145\x73\163\146\165\154\x6c\171\x20\165\x70\x64\x61\x74\x65\144\56"); $data["\x75\163\x72\x5f\x70\167\144"] = $newpwd; } else { $this->session->set_flashdata("\145\162\162", "\131\x6f\165\x72\x20\116\x65\x77\x20\x70\141\163\x73\x77\x6f\x72\x64\40\156\x75\x73\164\40\142\x65\40\x61\x62\x6f\166\145\40\70\40\143\150\x61\162\141\143\x74\145\162\x73\x2e"); } } else { $this->session->set_flashdata("\145\162\x72", "\131\x6f\x75\x72\40\116\145\167\40\160\141\163\x73\x77\157\x72\x64\x20\46\40\x52\x65\x74\x79\160\145\40\160\141\163\163\x77\x6f\162\144\x20\x61\162\x65\40\156\157\x74\x20\x73\x61\155\x65\x2e"); } } else { $this->session->set_flashdata("\x65\x72\x72", "\131\157\x75\162\x20\143\165\162\x72\145\156\164\x20\x70\x61\x73\163\x77\x6f\162\x64\40\x69\156\40\156\x6f\164\x20\x76\x61\x6c\x69\144\56"); } } if ($curpwd == '') { $this->session->set_flashdata("\x6d\163\x67", "\x59\x6f\x75\x72\40\160\x72\x6f\146\151\154\145\x20\150\x61\163\40\142\x65\x65\156\x20\163\165\143\x63\145\163\163\x66\x75\154\x6c\x79\40\x75\160\144\141\164\x65\x64\x2e"); } $this->Admin_model->updata($data, "\165\x73\145\162", array("\x75\163\x72\137\151\144" => $this->session->userdata("\165\x73\162\137\x69\144"))); return redirect("\144\x61\x73\150\142\x6f\141\x72\x64\57\160\162\x6f\146\151\x6c\x65"); } public function stockmaintain() { $stockoutdetail = $this->Admin_model->getdata("\x73\164\x6f\143\x6b", array("\163\164\153\x5f\x72\x65\x6d\141\x69\x6e\x71\164\171\74" => 0), array(), "\163\x74\153\137\x69\156\166\143\151\144\40\x41\x53\x43"); if ($stockoutdetail) { foreach ($stockoutdetail as $stkoutd) { $rmqty = $stkoutd->stk_remainqty; $rmsaleam = $stkoutd->stk_saleamount; $stockindetail = $this->Admin_model->getdata("\163\164\157\x63\153", array("\x73\x74\153\x5f\x72\x65\155\141\151\x6e\161\164\x79\76" => 0, "\x73\164\x6b\x5f\x70\162\x6f\151\x64" => $stkoutd->stk_proid)); if ($stockindetail) { foreach ($stockindetail as $stkind) { if ($stkind->stk_remainqty + $rmqty > 0) { $data = array("\163\164\153\137\x69\x64" => $stkind->stk_id, "\163\x74\x6b\x5f\x72\145\x6d\x61\x69\x6e\x71\164\x79" => $stkind->stk_remainqty + $rmqty, "\163\x74\153\137\163\141\x6c\x65\141\x6d\157\x75\156\164" => $stkind->stk_saleamount + $rmsaleam * -1, "\x73\x74\x6b\x5f\x73\141\154\145" => $stkind->stk_sale + $rmqty * -1); $this->Admin_model->updata($data, "\x73\164\157\x63\x6b", array("\x73\164\x6b\x5f\x69\x64" => $data["\x73\x74\153\x5f\x69\x64"])); if ($rmqty != 0) { $data = array("\x73\164\153\157\x75\164\x64\x5f\x69\156\x76\x6f\x69\143\145\x69\144" => $stkoutd->stk_invcid, "\163\164\x6b\x6f\165\x74\x64\137\x71\164\171" => $rmqty * -1, "\163\164\153\x6f\x75\x74\x64\137\162\x61\x74\145" => $rmsaleam / $rmqty, "\x73\164\x6b\157\x75\x74\144\137\160\x72\x6f\x69\144" => $stockoutdetail[0]->stk_proid, "\x73\x74\153\x6f\x75\164\x64\x5f\x73\x74\x6b\x69\144" => $stkind->stk_id); } $this->Admin_model->adddata($data, "\163\164\157\x63\x6b\157\x75\164\144\x65\164\x61\151\154"); $data = array("\163\164\x6b\x5f\x69\x64" => $stkoutd->stk_id, "\x73\x74\153\137\x72\145\155\141\x69\x6e\161\x74\171" => 0, "\x73\164\153\x5f\x73\141\154\145\141\x6d\157\x75\x6e\164" => 0); $this->Admin_model->updata($data, "\x73\164\x6f\x63\x6b", array("\163\x74\153\137\x69\x64" => $data["\x73\164\x6b\x5f\151\x64"])); break; } else { if ($stkoutd->stk_qty != 0) { $rate = $stkoutd->stk_saleamount / $stkoutd->stk_qty; } else { $rate = 0; } $rmqty = $stkind->stk_remainqty + $rmqty; $rmsaleam = $rmsaleam + $rate * $stkind->stk_remainqty; $data = array("\163\x74\x6b\x5f\151\144" => $stkind->stk_id, "\x73\x74\x6b\x5f\x72\145\155\141\x69\x6e\x71\x74\171" => 0, "\163\164\x6b\x5f\163\141\x6c\x65" => $stkind->stk_sale + $stkind->stk_remainqty, "\x73\x74\x6b\x5f\x73\141\x6c\x65\x61\155\157\165\156\x74" => $stkind->stk_saleamount + $rate * $stkind->stk_remainqty); $this->Admin_model->updata($data, "\163\x74\x6f\143\x6b", array("\163\164\153\x5f\151\144" => $data["\163\x74\x6b\137\151\144"])); $data = array("\163\x74\x6b\157\x75\164\x64\137\x69\156\x76\x6f\151\143\x65\x69\144" => $stkoutd->stk_invcid, "\163\x74\153\x6f\165\164\x64\137\161\x74\x79" => $stkind->stk_remainqty, "\163\164\x6b\157\x75\164\x64\x5f\162\x61\x74\x65" => $rate, "\x73\x74\153\157\x75\x74\144\137\x70\162\x6f\x69\x64" => $stockoutdetail[0]->stk_proid, "\x73\x74\x6b\157\165\164\144\137\163\164\x6b\151\144" => $stkind->stk_id); $this->Admin_model->adddata($data, "\163\164\x6f\143\x6b\x6f\x75\164\x64\x65\164\x61\151\154"); $data = array("\x73\x74\153\x5f\151\144" => $stkoutd->stk_id, "\x73\x74\153\137\x72\x65\155\x61\151\x6e\x71\164\171" => $rmqty, "\x73\x74\x6b\137\x73\x61\x6c\x65\x61\155\157\x75\x6e\164" => $rmqty * $rate); $this->Admin_model->updata($data, "\163\x74\x6f\143\x6b", array("\x73\164\x6b\x5f\151\x64" => $data["\163\164\153\x5f\x69\144"])); } } } } } } public function is_admin() { if ($this->session->userdata("\154\157\147\x5f\164\x6b\x6e") != md5(base_url())) { $this->logout(); } if ($this->session->userdata("\165\163\x72\x5f\164\x79\x70\145") != "\141\144\155\x69\x6e") { redirect(''); } } public function is_login() { if ($this->session->userdata("\x6c\x6f\147\137\x74\153\156") != md5(base_url())) { $this->logout(); } if (!$this->session->userdata("\165\x73\x72\137\x69\x64")) { redirect(''); } } public function index() { $this->load->view("\160\165\x62\154\x69\x63\x2f\144\x61\x73\x68\142\157\141\162\x64"); } public function products() { $company = $this->Admin_model->getdata("\x63\157\x6d\x70\141\156\171", array()); $products = $this->Admin_model->getdata("\x70\162\157\144\165\x63\x74", array()); if (isset($_GET["\x70\162\x6f\151\x64"])) { $product = $this->Admin_model->getdata("\x70\x72\157\144\165\x63\164", array("\160\x72\157\137\151\144" => $_GET["\x70\162\x6f\151\x64"])); } else { $product = false; } $data = array("\143\x6f\155\160\141\x6e\171" => $company, "\160\162\x6f\144\x75\143\x74\163" => $products, "\x70\x72\157\x64\165\143\x74" => $product); $this->load->view("\x70\x75\142\154\x69\143\x2f\x70\162\157\x64\x75\143\x74\x73", array("\144\x61\164\141" => $data)); } public function upcopany() { $cmpnyid = $this->input->post("\143\155\160\156\171\x69\x64"); $cname = $this->input->post("\x63\x6e\141\155\145"); $cdesc = $this->input->post("\143\144\x65\163\x63"); $cliid = $this->input->post("\x63\154\151\x69\x64"); $data = array("\143\x6d\x70\x6e\171\x5f\151\x64" => $cmpnyid, "\x63\x6d\160\x6e\171\137\156\141\155\145" => $cname, "\x63\155\160\156\x79\137\144\145\x73\143" => $cdesc, "\143\155\160\156\171\137\143\154\151\x69\x64" => $cliid); $this->Admin_model->updata($data, "\x63\157\x6d\160\x61\156\171", array("\x63\155\160\x6e\x79\x5f\x69\144" => $data["\x63\155\160\156\171\x5f\151\x64"])); $this->session->set_flashdata("\155\x73\147", "\103\157\155\x70\141\156\x79\x20\x64\x65\x74\141\x69\154\x20\150\x61\x73\x20\142\145\x65\156\x20\x73\165\x63\x63\x65\x73\x73\146\x75\154\x6c\x79\x20\125\x70\x64\141\x74\145\144\x2e"); return redirect("\144\141\x73\150\142\x6f\141\162\x64\57\x63\157\155\160\141\x6e\171"); } public function addcopany() { $cname = $this->input->post("\143\x6e\x61\155\x65"); $cdesc = $this->input->post("\x63\144\x65\x73\143"); $cliid = $this->input->post("\x63\154\x69\x69\144"); $data = array("\x63\x6d\160\x6e\171\137\x6e\x61\x6d\145" => $cname, "\x63\x6d\160\x6e\171\137\144\145\163\143" => $cdesc, "\143\155\x70\x6e\171\x5f\143\154\x69\151\144" => $cliid); $this->Admin_model->adddata($data, "\x63\x6f\x6d\160\x61\x6e\171"); $this->session->set_flashdata("\155\163\x67", "\x4e\145\x77\x20\143\x6f\155\x70\x61\156\171\x20\x68\141\163\40\x62\145\145\156\40\163\165\143\143\145\x73\x73\x66\165\154\x6c\171\40\141\x64\144\145\144\56"); return redirect("\x64\141\163\150\142\x6f\141\x72\x64\57\x63\157\x6d\x70\x61\156\x79"); } public function addpro() { $proname = $this->input->post("\x70\162\x6f\x6e\141\155\145"); $prodesc = $this->input->post("\160\162\x6f\x64\x65\x73\x63"); $barcode = $this->input->post("\142\x61\162\x63\x6f\x64\x65"); $purchaserate = $this->input->post("\160\165\x72\143\150\x61\163\145\x72\x61\x74\145"); $salerate = $this->input->post("\163\x61\154\145\x72\x61\164\145"); $dicsperunit = $this->input->post("\144\x69\143\x73\160\x65\x72\x75\156\x69\x74"); $discpercentage = $this->input->post("\x64\151\163\x63\x70\x65\x72\143\145\x6e\x74\x61\x67\x65"); $unitname = $this->input->post("\165\x6e\151\164\x6e\x61\x6d\x65"); $packingname = $this->input->post("\160\x61\x63\x6b\151\x6e\147\156\x61\x6d\145"); $packingqty = $this->input->post("\160\x61\143\153\151\x6e\x67\x71\164\x79"); $Packinpurgrate = $this->input->post("\120\x61\143\x6b\151\156\x70\165\162\147\x72\141\x74\145"); $Packinsalegrate = $this->input->post("\120\x61\x63\153\x69\x6e\x73\141\x6c\x65\x67\x72\x61\164\x65"); $Packingqty = $this->input->post("\x50\141\x63\153\151\x6e\x67\161\x74\x79"); $openingunitqty = $this->input->post("\x6f\160\145\x6e\151\x6e\147\x75\x6e\151\164\161\x74\171"); $openingpackingqty = $this->input->post("\x6f\160\x65\x6e\x69\156\x67\x70\x61\x63\153\x69\156\x67\161\x74\171"); $minqty = $this->input->post("\155\x69\x6e\161\164\171"); $maxqty = $this->input->post("\155\x61\170\x71\x74\171"); $docpaper = $this->input->post("\144\157\x63\160\141\x70\x65\x72"); $isdrug = $this->input->post("\151\x73\x64\162\x75\147"); $openingqty = $openingunitqty + $openingpackingqty * $packingqty; $salerate = $salerate + $Packinsalegrate / $packingqty; $purchaserate = $purchaserate + $Packinpurgrate / $packingqty; $this->db->trans_start(); $data = array("\x70\162\x6f\137\x6e\x61\x6d\x65" => $proname, "\x70\x72\157\x5f\144\145\163\x63" => $prodesc, "\160\x72\x6f\x5f\142\x61\x72\143\157\x64\x65" => $barcode, "\x70\162\157\x5f\160\165\x72\143\150\x61\x73\x65" => $purchaserate, "\x70\x72\157\137\163\141\x6c\x65\162\x61\164\145" => $salerate, "\160\x72\157\x5f\x73\x61\154\145\144\151\163\x63\160\145\x72\165\156\151\x74" => $dicsperunit, "\x70\x72\x6f\137\x73\141\x6c\x65\x64\x69\143\x70\145\x72\143\x65\156\164\x61\x67\x65" => $discpercentage, "\x70\162\x6f\x5f\x75\156\151\x74\156\141\155\x65" => $unitname, "\x70\162\157\x5f\160\x61\x63\x6b\x71\x74\x79" => $packingqty, "\160\162\157\x5f\160\141\143\153\x6e\141\x6d\x65" => $packingname, "\x70\162\x6f\x5f\157\x70\x65\x6e\x69\x6e\147\x71\x74\x79" => $openingqty, "\160\162\157\137\155\x61\170" => $maxqty, "\x70\x72\157\137\x6d\151\156" => $minqty, "\x70\162\157\x5f\144\157\143\x70\141\160\145\162" => $docpaper, "\x70\162\x6f\x5f\144\162\x75\147\x65\144" => $isdrug); $proid = $this->Admin_model->adddata($data, "\x70\162\157\144\165\x63\x74"); $data = array("\x73\x74\x6b\137\164\151\x6d\145" => time(), "\163\x74\x6b\137\x64\x61\164\145" => 0, "\x73\x74\153\x5f\x74\x6b\x6e" => 0, "\163\x74\153\x5f\x69\x6e\x76\x63\x69\x64" => 0, "\x73\164\x6b\137\x63\x6c\x69\x69\x64" => 0, "\x73\164\153\137\160\x72\x6f\x69\x64" => $proid, "\163\164\x6b\x5f\164\171\160\145" => "\157\x70\156", "\x73\164\153\137\x71\x74\171" => $openingqty); $this->Admin_model->adddata($data, "\163\164\x6f\143\153"); $this->db->trans_complete(); $this->session->set_flashdata("\x6d\x73\x67", "\x4e\145\x77\x20\x70\162\157\x64\165\x63\x74\40\x68\141\x73\x20\142\x65\x65\156\40\163\x75\143\143\x65\163\163\x66\x75\154\x6c\x79\x20\141\144\x64\145\x64\56\x28" . $proname . "\51"); return redirect("\144\x61\x73\x68\142\x6f\x61\x72\x64\57\160\x72\x6f\144\x75\x63\x74\163"); } public function uppro() { $proid = $this->input->post("\160\x72\x6f\x69\144"); $proname = $this->input->post("\x70\x72\x6f\x6e\x61\155\145"); $prodesc = $this->input->post("\160\x72\x6f\144\145\163\x63"); $companyid = $this->input->post("\x63\x6f\155\x70\141\x6e\x79\151\x64"); $barcode = $this->input->post("\x62\141\162\x63\x6f\144\145"); $purchaserate = $this->input->post("\160\165\162\143\x68\141\x73\145\162\141\x74\145"); $salerate = $this->input->post("\163\141\154\145\x72\141\x74\145"); $dicsperunit = $this->input->post("\144\151\143\163\x70\x65\x72\165\x6e\x69\164"); $discpercentage = $this->input->post("\x64\151\x73\x63\160\145\x72\143\x65\156\x74\141\147\145"); $unitname = $this->input->post("\x75\156\151\164\156\x61\x6d\x65"); $packingname = $this->input->post("\160\x61\143\153\x69\x6e\x67\x6e\141\x6d\145"); $packingqty = $this->input->post("\x70\x61\x63\153\x69\156\147\x71\x74\171"); $Packinpurgrate = $this->input->post("\x50\x61\143\x6b\x69\156\160\x75\162\147\x72\141\x74\145"); $Packinsalegrate = $this->input->post("\x50\141\x63\153\151\x6e\163\141\154\x65\x67\162\x61\164\145"); $Packingqty = $this->input->post("\120\x61\x63\153\x69\x6e\x67\x71\x74\x79"); $openingunitqty = $this->input->post("\157\x70\x65\x6e\151\x6e\147\165\x6e\x69\x74\x71\x74\171"); $openingpackingqty = $this->input->post("\x6f\160\x65\x6e\x69\156\147\x70\141\x63\153\151\x6e\147\161\x74\171"); $minqty = $this->input->post("\x6d\151\156\x71\164\x79"); $maxqty = $this->input->post("\x6d\141\170\161\x74\x79"); $openingqty = $openingunitqty + $openingpackingqty * $packingqty; $salerate = $salerate + $Packinsalegrate / $packingqty; $purchaserate = $purchaserate + $Packinpurgrate / $packingqty; $this->db->trans_start(); $this->Admin_model->deletedata("\x73\x74\157\x63\153", array("\x73\x74\x6b\x5f\x70\x72\x6f\x69\x64" => $proid, "\x73\164\153\x5f\164\171\160\x65" => "\157\x70\x6e", "\163\164\153\137\144\141\x74\x65" => 0, "\163\x74\153\137\164\153\156" => 0)); $data = array("\x70\162\x6f\137\151\x64" => $proid, "\160\162\157\x5f\x6e\x61\155\x65" => $proname, "\160\162\157\x5f\x64\x65\163\x63" => $prodesc, "\160\x72\157\137\143\x6f\155\x70\x61\156\171" => $companyid, "\x70\x72\x6f\x5f\x62\141\x72\143\x6f\x64\145" => $barcode, "\160\162\x6f\137\x70\165\x72\x63\150\x61\x73\145" => $purchaserate, "\x70\162\157\x5f\163\x61\154\145\x72\x61\164\145" => $salerate, "\160\x72\x6f\x5f\163\141\x6c\145\x64\x69\163\143\160\145\162\x75\156\151\x74" => $dicsperunit, "\x70\162\x6f\137\163\141\x6c\145\144\151\x63\160\145\x72\143\x65\x6e\x74\x61\x67\x65" => $discpercentage, "\160\162\x6f\137\x75\156\x69\164\x6e\x61\155\x65" => $unitname, "\160\x72\x6f\x5f\x70\x61\143\x6b\161\164\x79" => $packingqty, "\x70\162\x6f\137\160\141\143\x6b\156\x61\x6d\145" => $packingname, "\160\162\x6f\x5f\157\x70\145\156\151\156\x67\161\164\171" => $openingqty, "\160\162\x6f\x5f\155\141\170" => $maxqty, "\160\x72\157\x5f\155\x69\156" => $minqty); $this->Admin_model->updata($data, "\x70\x72\x6f\x64\x75\x63\164", array("\160\x72\157\x5f\x69\x64" => $data["\x70\162\157\137\x69\144"])); $data = array("\x73\x74\153\137\x74\x69\155\x65" => time(), "\x73\164\153\x5f\x64\x61\164\145" => 0, "\x73\x74\153\137\x74\153\x6e" => 0, "\x73\164\x6b\x5f\x69\x6e\x76\143\151\x64" => 0, "\x73\164\153\x5f\x63\x6c\x69\151\x64" => 0, "\163\x74\153\x5f\160\162\157\x69\144" => $proid, "\163\x74\x6b\x5f\164\171\x70\145" => "\x6f\160\156", "\163\x74\153\x5f\x71\x74\171" => $openingqty); $this->Admin_model->adddata($data, "\163\x74\x6f\x63\153"); $this->db->trans_complete(); $this->session->set_flashdata("\x6d\x73\147", "\105\x78\x69\x73\x74\x69\156\147\x20\160\162\157\x64\165\143\x74\x20\x68\x61\163\x20\142\145\x65\x6e\40\x73\x75\x63\143\145\x73\x73\146\165\x6c\x6c\x79\40\x55\x70\x64\x61\164\x65\x64\x2e"); return redirect("\x64\x61\x73\x68\142\x6f\141\162\144\x2f\x70\162\157\x64\x75\x63\x74\163"); } public function addbenefi() { $serderid = $this->input->post("\x73\145\162\x64\x65\162\x69\144"); $reciverid = $this->input->post("\x72\145\143\x69\166\145\162\x69\x64"); $benefidetail = $this->Admin_model->getdata("\142\x65\156\145\x66\x69\x63\151\x61\162\x69\x65\x73", array("\142\x6e\151\x66\151\137\163\145\156\x64\x65\162\x69\x64" => $serderid, "\142\156\151\x66\151\137\162\145\x63\151\x76\145\162\x69\x64" => $reciverid)); if (!$benefidetail) { $data = array("\x62\156\151\146\151\x5f\163\145\x6e\144\145\x72\x69\144" => $serderid, "\x62\x6e\151\146\151\x5f\x72\145\x63\151\x76\145\162\151\x64" => $reciverid); $this->Admin_model->adddata($data, "\142\x65\x6e\145\x66\x69\x63\151\141\162\151\x65\x73"); } return redirect("\144\x61\163\150\142\157\x61\x72\x64\57\x74\162\x61\156\x73\146\145\162"); } public function accounts() { $this->is_admin(); $category = $this->Admin_model->getdata("\143\x61\x74\x65\147\157\x72\171", array()); $joins[0] = array("\152\157\151\x6e\164\141\142\154\x65" => "\x63\141\x74\x65\x67\157\x72\x79", "\152\157\x69\x6e\x74\x61\142\154\x65\x63\157\154" => "\x63\141\164\x5f\151\144", "\x74\x61\142\154\145\143\x6f\x6c" => "\143\154\x69\x5f\143\141\x74\x69\144"); $clients = $this->Admin_model->getjoinsdata("\x63\154\x69\x65\156\x74\163", array(), $joins); $data = array("\x63\141\x74\145\147\157\162\x79" => $category, "\143\x6c\151\145\156\x74\x73" => $clients); $this->load->view("\x70\165\142\154\x69\x63\57\x61\x63\143\157\165\x6e\x74\x73", array("\144\141\x74\x61" => $data)); } public function addcat() { $cname = $this->input->post("\x63\x6e\141\155\145"); $cdesc = $this->input->post("\x63\144\145\163\x63"); $data = array("\x63\x61\164\x5f\x6e\x61\x6d\x65" => $cname, "\143\x61\x74\x5f\x64\x65\x73\x63" => $cdesc); $this->Admin_model->adddata($data, "\x63\141\164\145\147\157\x72\171"); $this->session->set_flashdata("\x6d\163\x67", "\116\145\167\40\143\x61\x74\145\147\x6f\x72\x79\x20\150\x61\163\40\x62\x65\145\x6e\40\x73\165\x63\x63\145\x73\163\146\165\x6c\154\171\x20\x61\x64\x64\145\x64\56"); return redirect("\144\141\163\x68\x62\157\x61\x72\144\x2f\x61\143\x63\x6f\165\x6e\164\163"); } public function addcli() { $partyname = $this->input->post("\x70\141\x72\164\x79\156\141\155\145"); $ownername = $this->input->post("\x6f\167\x6e\145\x72\x6e\141\x6d\x65"); $contact = $this->input->post("\x63\157\x6e\164\x61\x63\x74"); $cnic = $this->input->post("\x63\x6e\x69\x63"); $ntn = $this->input->post("\156\164\x6e"); $address = $this->input->post("\x61\x64\x64\162\145\x73\x73"); $catid = $this->input->post("\x63\x61\164\151\x64"); $data = array("\x63\154\151\137\160\141\162\x74\x79" => $partyname, "\x63\154\x69\x5f\157\x77\x6e\145\x72" => $ownername, "\x63\154\x69\x5f\x63\157\156\x74\141\x63\x74" => $contact, "\x63\x6c\151\x5f\x63\x6e\x69\x63" => $cnic, "\x63\154\151\x5f\156\x74\x6e" => $ntn, "\143\x6c\151\137\x61\144\x64\162\x65\x73\x73" => $address, "\143\x6c\151\137\143\141\164\x69\x64" => $catid); $this->Admin_model->adddata($data, "\x63\154\151\x65\156\x74\163"); $this->session->set_flashdata("\x6d\x73\147", "\116\x65\x77\40\x43\154\151\x65\156\x74\40\x68\141\x73\40\x62\145\145\x6e\40\x73\x75\143\x63\x65\x73\x73\146\165\154\154\171\40\141\x64\x64\145\x64\x2e"); return redirect("\144\x61\x73\x68\x62\157\x61\162\144\x2f\141\x63\143\157\x75\156\164\163"); } public function upcli() { $cliid = $this->input->post("\143\x6c\151\151\x64"); $partyname = $this->input->post("\160\x61\x72\164\x79\156\x61\x6d\145"); $ownername = $this->input->post("\157\x77\156\x65\x72\156\x61\x6d\x65"); $contact = $this->input->post("\143\157\156\x74\141\x63\x74"); $cnic = $this->input->post("\x63\156\151\x63"); $ntn = $this->input->post("\x6e\164\x6e"); $address = $this->input->post("\x61\144\144\162\x65\163\163"); $catid = $this->input->post("\143\x61\164\x69\144"); $data = array("\x63\x6c\x69\137\x69\x64" => $cliid, "\x63\154\151\x5f\160\x61\162\x74\x79" => $partyname, "\143\x6c\x69\137\x6f\167\x6e\x65\162" => $ownername, "\x63\x6c\151\137\143\157\156\x74\141\143\x74" => $contact, "\x63\154\151\137\143\156\x69\x63" => $cnic, "\x63\x6c\x69\x5f\x6e\x74\x6e" => $ntn, "\143\x6c\151\x5f\141\144\x64\x72\x65\x73\x73" => $address, "\143\x6c\x69\x5f\x63\x61\x74\151\144" => $catid); $this->Admin_model->updata($data, "\143\154\x69\145\x6e\164\163", array("\x63\x6c\x69\137\151\144" => $data["\143\x6c\151\137\151\144"])); $this->session->set_flashdata("\155\x73\x67", "\x45\x78\x69\x73\164\151\x6e\x67\x20\143\154\151\145\x6e\164\40\144\x65\164\141\151\154\40\150\141\x73\40\x62\x65\x65\x6e\x20\163\165\x63\x63\145\163\163\x66\x75\154\x6c\171\40\x55\x70\144\141\x74\x65\144\56"); return redirect("\x64\141\x73\150\x62\157\x61\x72\x64\x2f\x61\x63\143\157\x75\156\164\x73"); } public function getdatestring($invcdate) { $invcdate = explode("\x2f", $invcdate); $invcdate = $invcdate[1] . "\57" . $invcdate[0] . "\57" . $invcdate[2]; return strtotime($invcdate); } public function payment($traid = 0) { $this->is_admin(); $joins[0] = array("\152\x6f\x69\x6e\x74\141\142\154\145" => "\143\x61\x74\145\147\157\162\x79", "\x6a\157\x69\156\x74\x61\x62\154\x65\x63\157\x6c" => "\x63\141\x74\x5f\x69\144", "\x74\141\142\154\145\143\x6f\154" => "\x63\x6c\x69\137\143\141\164\151\x64"); $clients = $this->Admin_model->getjoinsdata("\143\x6c\151\145\156\x74\163", array(), $joins); if (!isset($_GET["\x64\x61\x74\145"])) { $date = strtotime(date("\x6d\x2f\x64\x2f\131")); } else { $date = $this->getdatestring($_GET["\144\x61\164\145"]); } $joins[0] = array("\x6a\x6f\151\x6e\164\x61\x62\x6c\145" => "\x63\x6c\x69\145\156\164\x73", "\152\157\x69\x6e\164\x61\x62\154\145\x63\x6f\x6c" => "\x63\x6c\151\137\151\144", "\x74\141\142\154\x65\x63\x6f\x6c" => "\164\162\x61\137\x63\x6c\151\151\x64"); $transaction = $this->Admin_model->getjoinsdata("\164\x72\x61\x6e\x73\141\x63\x74\x69\x6f\156", array("\164\x72\x61\x5f\x64\x61\x74\x65" => $date), $joins); $trans = $this->Admin_model->getjoinsdata("\164\162\141\x6e\163\x61\143\x74\151\x6f\156", array("\x74\x72\141\x5f\151\x64" => $traid), $joins); if ($trans) { if ($trans[0]->tra_type != "\143\x70\x76") { if ($trans[0]->tra_type != "\x63\x72\x76") { return redirect("\x64\141\163\150\142\157\x61\162\144\57\160\141\x79\155\145\156\x74"); } } } $data = array("\143\x6c\x69\145\x6e\164\163" => $clients, "\x74\162\141\x6e\163\x61\x63\164\151\157\156" => $transaction, "\144\141\x74\x65" => $date, "\164\x72\x61\x6e\x73" => $trans); $this->load->view("\160\165\142\154\151\143\x2f\x70\x61\171\x6d\145\x6e\x74", array("\x64\141\164\141" => $data)); } public function delpayment($traid) { if (isset($_GET["\x64\x61\x74\x65"])) { $date = $_GET["\x64\141\x74\x65"]; } else { $date = date("\x64\57\155\x2f\x59"); } $this->Admin_model->deletedata("\164\x72\x61\156\163\141\143\x74\x69\157\156", array("\x74\162\x61\137\151\144" => $traid)); $this->session->set_flashdata("\155\163\147", "\131\x6f\x75\x72\40\x70\141\171\x6d\x65\156\164\x20\150\141\166\x65\x20\142\145\x65\x6e\40\x73\x75\143\x63\145\x73\x73\x66\x75\154\x6c\x79\40\144\145\x6c\x65\164\145\x64\x2e"); return redirect("\x64\x61\163\150\x62\x6f\141\x72\x64\x2f\160\141\x79\155\145\x6e\164\57\x3f\144\141\x74\145\x3d" . $date); } public function uptra() { $date = $this->getdatestring($this->input->post("\144\x61\x74\x65")); $traid = $this->input->post("\x74\162\141\x69\x64"); $cliid = $this->input->post("\143\154\151\x69\x64"); $prnumber = $this->input->post("\160\x72\156\165\155\x62\145\x72"); $type = $this->input->post("\x74\x79\x70\x65"); $amount = $this->input->post("\141\x6d\157\x75\156\164"); $desc = $this->input->post("\144\x65\163\x63"); $time = time(); if ($type == "\x63\x70\x76") { $amount = $amount * -1; } $data = array("\x74\x72\x61\137\151\144" => $traid, "\x74\162\x61\x5f\144\141\164\x65" => $date, "\x74\162\141\x5f\x63\154\x69\x69\144" => $cliid, "\x74\x72\x61\x5f\x70\162\x6e\157" => $prnumber, "\164\162\141\137\x74\171\x70\x65" => $type, "\x74\162\x61\137\141\155\157\165\x6e\x74" => $amount, "\164\162\141\137\x64\145\x73\143" => $desc, "\164\x72\141\137\x74\x69\155\x65" => $time, "\164\x72\141\x5f\x73\x74\141\164\x75\163" => "\x63\157\x6e\x66\x69\162\155"); $this->Admin_model->updata($data, "\x74\162\141\156\163\x61\x63\164\151\x6f\x6e", array("\164\x72\141\137\x69\x64" => $data["\164\x72\x61\137\151\x64"])); $this->session->set_flashdata("\x6d\163\x67", "\131\157\165\162\40\160\x61\171\155\145\x6e\164\x20\150\141\x76\x65\x20\x62\145\x65\156\x20\x73\x75\143\x63\145\x73\163\x66\165\154\x6c\x79\40\125\160\144\141\x74\x65\x64\56"); return redirect("\x64\141\x73\150\142\x6f\x61\162\144\x2f\x70\141\171\155\145\x6e\x74\x2f\77\144\141\x74\x65\75" . date("\x64\57\155\x2f\131", $date) . "\x26\x74\x72\x61\151\144\75" . $traid); } public function addtra() { $date = $this->getdatestring($this->input->post("\x64\141\164\145")); $cliid = $this->input->post("\x63\154\x69\151\x64"); $prnumber = $this->input->post("\x70\x72\x6e\x75\155\x62\145\162"); $type = $this->input->post("\164\171\x70\x65"); $amount = $this->input->post("\x61\155\x6f\x75\x6e\164"); $desc = $this->input->post("\x64\x65\163\143"); $time = time(); if ($type == "\x63\x70\x76") { $amount = $amount * -1; } $tkn = rand(1000, 1000000000) . time(); $data = array("\x74\162\x61\137\x64\141\164\145" => $date, "\x74\162\x61\137\143\154\x69\151\144" => $cliid, "\x74\x72\x61\x5f\160\x72\x6e\157" => $prnumber, "\x74\x72\x61\x5f\164\x79\160\145" => $type, "\x74\x72\x61\137\x61\155\x6f\x75\156\164" => $amount, "\164\162\141\x5f\144\x65\x73\143" => $desc, "\x74\162\x61\x5f\x74\x69\155\x65" => $time, "\x74\162\x61\137\x74\153\x6e" => $tkn, "\x74\x72\141\x5f\x73\x74\x61\x74\165\163" => "\x63\x6f\x6e\146\151\162\155"); $this->Admin_model->adddata($data, "\x74\x72\141\x6e\x73\x61\143\x74\151\x6f\156"); $this->session->set_flashdata("\155\x73\x67", "\x59\157\x75\162\40\x70\141\x79\155\x65\156\164\x20\x68\141\x76\145\40\142\145\x65\156\x20\163\165\x63\x63\x65\x73\163\x66\165\x6c\154\x79\40\x61\144\144\x65\x64\x2e"); return redirect("\144\x61\x73\150\142\x6f\141\x72\x64\x2f\x70\141\171\x6d\x65\x6e\164\57\x3f\144\141\x74\145\x3d" . $this->input->post("\144\141\164\x65")); } public function company() { $joins[0] = array("\152\157\151\156\x74\x61\142\154\x65" => "\x63\154\x69\145\156\164\x73", "\x6a\157\151\x6e\x74\141\142\x6c\145\x63\157\154" => "\x63\x6c\x69\137\x69\x64", "\164\x61\x62\x6c\145\143\x6f\x6c" => "\x63\155\x70\156\171\x5f\143\x6c\151\151\144"); $company = $this->Admin_model->getjoinsdata("\143\157\155\160\141\156\x79", array(), $joins); $joins[0] = array("\x6a\x6f\x69\156\x74\x61\142\154\x65" => "\143\141\164\x65\147\157\162\x79", "\x6a\157\x69\x6e\x74\141\x62\x6c\145\x63\157\154" => "\143\x61\164\137\x69\144", "\x74\x61\142\x6c\x65\143\157\154" => "\143\154\151\137\x63\x61\164\x69\144"); $clients = $this->Admin_model->getjoinsdata("\143\x6c\x69\145\156\x74\163", array(), $joins); $data = array("\x63\x6f\x6d\160\141\x6e\x79" => $company, "\x63\154\151\145\156\x74\163" => $clients); $this->load->view("\x70\165\x62\154\151\x63\x2f\x63\x6f\x6d\x70\x61\156\171", array("\x64\x61\x74\141" => $data)); } public function companydetail($cmpnyid) { $company = $this->Admin_model->getdata("\143\x6f\155\160\x61\x6e\x79", array("\143\x6d\x70\156\x79\x5f\151\x64" => $cmpnyid)); $products = $this->Admin_model->getdata("\x70\162\157\x64\165\x63\164", array()); $joins[0] = array("\x6a\157\x69\156\x74\141\x62\154\145" => "\160\x72\x6f\144\x75\143\164", "\x6a\x6f\151\x6e\x74\141\x62\154\145\143\x6f\154" => "\x70\162\x6f\x5f\151\144", "\164\141\x62\154\145\x63\x6f\154" => "\x63\155\x70\156\171\144\137\x70\162\x6f\151\x64"); $companydetail = $this->Admin_model->getjoinsdata("\x63\x6f\x6d\160\141\156\x79\x64\145\164\x61\151\154", array("\x63\155\160\156\x79\144\137\143\155\x70\x6e\171\x69\144" => $cmpnyid), $joins); if (!$company) { return redirect("\144\x61\x73\x68\142\157\141\x72\144\x2f\143\x6f\155\160\141\156\x79"); } if (isset($_GET["\x70\162\x6f\151\144"])) { $data = array("\143\x6d\160\156\x79\144\x5f\x63\155\160\156\171\151\144" => $cmpnyid, "\143\x6d\x70\x6e\x79\x64\x5f\x70\x72\157\151\144" => $_GET["\x70\x72\x6f\151\x64"]); $cmpnydetail = $this->Admin_model->getdata("\x63\x6f\x6d\x70\141\x6e\171\x64\x65\164\141\151\x6c", $data); if (!$cmpnydetail) { $this->Admin_model->adddata($data, "\143\157\x6d\160\x61\x6e\171\x64\145\164\x61\151\x6c"); } return redirect("\x64\x61\x73\x68\x62\157\141\162\144\57\x63\157\x6d\x70\x61\x6e\171\x64\x65\x74\141\x69\x6c\57" . $cmpnyid); } $data = array("\x63\157\155\x70\141\x6e\171" => $company, "\160\162\x6f\x64\x75\x63\x74\x73" => $products, "\x63\x6f\x6d\160\x61\x6e\x79\144\145\x74\x61\x69\154" => $companydetail); $this->load->view("\160\165\x62\x6c\x69\143\x2f\x63\x6f\155\160\141\156\x79\x64\x65\164\x61\151\x6c", array("\144\x61\x74\x61" => $data)); } public function orders() { $joins[0] = array("\152\157\x69\x6e\x74\x61\142\154\x65" => "\143\x6c\151\145\x6e\164\x73", "\x6a\157\151\x6e\164\x61\142\154\145\x63\x6f\x6c" => "\x63\154\x69\x5f\151\x64", "\164\x61\x62\x6c\x65\143\157\x6c" => "\x63\x6d\x70\156\171\x5f\x63\154\151\151\144"); $company = $this->Admin_model->getjoinsdata("\143\x6f\x6d\x70\141\x6e\171", array(), $joins); $joins[0] = array("\152\x6f\x69\156\164\141\142\x6c\x65" => "\x63\x6f\155\x70\141\156\171", "\x6a\157\151\x6e\x74\x61\x62\x6c\145\143\157\x6c" => "\x63\x6d\160\x6e\171\137\151\144", "\x74\x61\142\154\145\143\157\154" => "\143\154\x69\x5f\x69\x64"); $clients = $this->Admin_model->getjoinsdata("\143\154\151\x65\x6e\164\163", array(), $joins); $company = $this->Admin_model->getdata("\x63\157\x6d\160\141\x6e\171", array()); if ($company) { foreach ($company as $c) { $cliides[] = $c->cmpny_cliid; } } $cliides = array_unique($cliides); $joins[0] = array("\152\157\151\x6e\x74\x61\x62\154\145" => "\143\154\151\x65\156\x74\x73", "\x6a\157\x69\156\x74\x61\x62\x6c\x65\x63\157\x6c" => "\143\154\x69\137\151\144", "\x74\x61\142\154\x65\143\157\154" => "\160\157\162\x64\137\143\x6c\x69\x69\144"); $orders = $this->Admin_model->getjoinsdata("\x70\x75\x72\157\x72\x64\x65\x72", array(), $joins); $data = array("\x63\157\x6d\160\x61\x6e\171" => $company, "\x63\x6c\151\x69\144\x65\x73" => $cliides, "\x6f\162\x64\145\x72\x73" => $orders); $this->load->view("\160\165\142\154\151\x63\x2f\x6f\162\144\145\162\x73", array("\x64\x61\164\141" => $data)); } public function order($ordid) { $joins[0] = array("\x6a\x6f\151\156\164\141\x62\154\x65" => "\x63\x6c\x69\x65\156\164\163", "\152\157\151\156\x74\141\x62\154\145\x63\x6f\154" => "\143\154\x69\137\151\144", "\x74\141\x62\x6c\x65\x63\157\x6c" => "\x70\157\162\x64\137\x63\x6c\151\151\144"); $order = $this->Admin_model->getjoinsdata("\160\x75\162\x6f\x72\144\x65\x72", array("\x70\157\x72\x64\x5f\151\x64" => $ordid), $joins); $company = $this->Admin_model->getdata("\x63\157\155\x70\141\156\171", array("\143\155\x70\x6e\171\137\143\154\x69\151\x64" => $order[0]->cli_id)); if ($company) { foreach ($company as $cmpny) { $joins[0] = array("\152\157\151\156\164\141\x62\154\145" => "\160\162\157\x64\165\143\x74", "\152\x6f\151\x6e\164\x61\x62\154\x65\143\x6f\x6c" => "\160\x72\157\x5f\151\x64", "\164\141\142\154\x65\143\x6f\x6c" => "\x63\155\160\156\x79\144\x5f\x70\x72\x6f\151\144"); $product = $this->Admin_model->getjoinsdata("\143\157\155\x70\141\156\x79\x64\145\164\x61\151\x6c", array("\143\x6d\160\x6e\171\x64\x5f\x63\155\x70\x6e\x79\x69\144" => $cmpny->cmpny_id), $joins); $this->db->trans_start(); if ($product) { foreach ($product as $pro) { $data = array("\x70\x6f\162\x64\x5f\157\x72\x64\x69\x64" => $ordid, "\x70\157\162\x64\137\x70\162\157\x69\x64" => $pro->pro_id); $odrdetail = $this->Admin_model->getdata("\x70\157\x72\x64\145\x72\x64\x65\164\141\x69\154", $data); if (!$odrdetail) { $this->Admin_model->adddata($data, "\x70\x6f\x72\x64\145\x72\144\x65\x74\x61\151\154"); } } } $this->db->trans_complete(); } } $joins[0] = array("\x6a\x6f\151\156\x74\141\x62\154\x65" => "\160\x72\157\x64\165\x63\x74", "\x6a\x6f\x69\156\164\141\142\x6c\145\143\157\154" => "\160\162\x6f\137\x69\x64", "\164\141\142\x6c\145\x63\157\154" => "\x70\x6f\162\x64\137\x70\162\x6f\x69\144"); $odrdetail = $this->Admin_model->getjoinsdata("\x70\157\x72\144\145\162\x64\145\164\x61\x69\154", array("\160\x6f\162\x64\x5f\x6f\x72\x64\x69\x64" => $ordid), $joins); $data = array("\157\162\144\x65\162" => $order, "\157\x64\x72\x64\145\x74\x61\x69\154" => $odrdetail); $this->load->view("\160\165\142\154\x69\x63\57\157\x72\x64\145\162", array("\x64\x61\x74\141" => $data)); } public function addorder() { $cliid = $this->input->post("\x63\x6c\x69\x69\144"); $type = $this->input->post("\164\171\160\145"); $order = $this->Admin_model->getdata("\x70\165\x72\157\162\144\145\162", array("\x70\x6f\x72\144\137\x63\x6c\x69\151\144" => $cliid, "\160\157\x72\144\137\163\164\x61\x74\x75\x73" => "\x70\x65\156\x64\x69\x6e\x67", "\x70\x6f\162\144\x5f\x74\171\x70\145" => $type)); if (!$order) { $data = array("\160\157\162\144\137\x63\x6c\151\x69\x64" => $cliid, "\160\x6f\162\x64\137\163\x74\x61\x74\x75\163" => "\160\x65\x6e\x64\x69\x6e\x67", "\x70\x6f\x72\x64\137\x74\171\x70\145" => $type); $ordid = $this->Admin_model->adddata($data, "\160\165\x72\x6f\162\x64\x65\162"); } else { $ordid = $order[0]->pord_id; } $this->session->set_flashdata("\x6d\163\x67", "\x4e\x65\167\x20\x6f\x72\144\x65\x72\40\x68\x61\163\40\x62\145\145\156\40\163\x75\143\143\145\x73\163\x66\x75\x6c\x6c\171\40\x43\162\145\141\x74\145\144\56"); return redirect("\x64\x61\163\x68\x62\157\x61\x72\x64\57\x6f\162\144\145\x72\x2f" . $ordid); } public function logout() { $this->session->unset_userdata("\x75\163\x72\137\151\144"); $this->session->unset_userdata("\x75\163\162\137\156\x61\x6d\145"); $this->session->unset_userdata("\165\x73\x72\137\x63\157\x6e\x74\x61\143\164"); $this->session->unset_userdata("\165\163\162\x5f\164\x79\160\145"); return redirect(''); } }

Function Calls

None

Variables

None

Stats

MD5 ec0f07d7b046f8edfff4bc8aa93ee24f
Eval Count 0
Decode Time 68 ms