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 namespace App\Http\Controllers\Seal; use App\Http\Controllers\Controller; use Illu..

Decoded Output download

<?php 
 namespace App\Http\Controllers\Seal; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use App\Http\Controllers\Logger; use App\Http\Controllers\Alerts\Alerts; class Seals extends Controller { public function SaveSeal(Request $request) { date_default_timezone_set("Africa/Nairobi"); $response = array(); $logger = new Logger(); $seal_no = $request->input("seal"); $userid = $request->input("userid"); if ($seal_no != '' && strlen($userid) > 3) { $check_item = DB::table("seals")->select("ID")->where("Seal_No", $seal_no)->get(); if (count($check_item) == 1) { $response = array("Status" => 0, "message" => "Seal {$seal_no} Already Exits"); } else { $insert = DB::table("seals")->insert(array("Seal_No" => $seal_no, "scanby" => $userid, "created_at" => date("Y-m-d H:i:s"))); if ($insert) { $response = array("Status" => 1, "message" => "Seal Saved"); } else { $response = array("Status" => 0, "message" => "Save Error"); } } } else { $response = array("Status" => 0, "message" => "MIssing information"); } $logger->Log("Seal Save", $userid, json_encode($response), $request); return json_encode($response); } public function DeleteReceipt(Request $request) { date_default_timezone_set("Africa/Nairobi"); $response = array(); $logger = new Logger(); $userid = $request->input("userid"); $receiptid = $request->input("receiptid"); if (strlen($userid) > 3 && strlen($receiptid) > 0) { $check_receipt = DB::table("receipts")->select("ID")->where("userid", $userid)->where("ID", $receiptid)->where("status", 0)->count(); if ($check_receipt == 1) { $check_receipt = DB::table("receipts")->where("ID", $receiptid)->update(array("status" => -1)); $check_receipt = DB::table("receipt_details")->where("ReceiptID", $receiptid)->update(array("status" => -1, "updated_at" => date("Y-m-d H:i:s"))); $response = array("Status" => 1, "message" => "Deleted"); } else { $response = array("Status" => 0, "message" => "Cannot be Deleted"); } } else { $response = array("Status" => 0, "message" => "MIssing information"); } $logger->Log("Delete Receipt", $userid, json_encode($response), $request); return json_encode($response); } public function MakeReceipt(Request $request) { date_default_timezone_set("Africa/Nairobi"); $response = array(); $logger = new Logger(); $customer_name = $request->input("customer"); $collection = $request->input("collection"); $collection_email = $request->input("collection_email"); $collection_phone = $request->input("collection_phone"); $delivery = $request->input("delivery"); $delivery_email = $request->input("delivery_email"); $delivery_phone = $request->input("delivery_phone"); $branch = $request->input("branch"); $userid = $request->input("userid"); $bullion = $request->input("bullion_no"); if (strlen($customer_name) > 3 && strlen($collection) > 3 && strlen($collection_email) > 3 && strlen($collection_phone) > 3 && strlen($delivery) > 3 && strlen($delivery_email) > 3 && strlen($delivery_phone) > 3 && strlen($branch) > 3 && strlen($userid) > 3 && strlen($bullion) > 3) { $check_user = DB::table("users")->where("Type", 2)->where("Status", 1)->where("UserID", $userid)->count(); if ($check_user == 1) { $check_in_que = DB::table("receipts")->select("ID")->where("userid", $userid)->where("status", 0)->count(); if ($check_in_que == 0) { $transit_save = DB::table("receipts")->insert(array("customer" => $customer_name, "collection" => $collection, "collection_email" => $collection_email, "collection_phone" => $collection_phone, "collection_at" => date("Y-m-d H:i:s"), "delivery" => $delivery, "delivery_email" => $delivery_email, "delivery_phone" => $delivery_phone, "branch" => $branch, "updated_at" => date("Y-m-d H:i:s"), "userid" => $userid, "bullion" => $bullion)); $response = array("Status" => 1, "message" => "Generated"); } else { $response = array("Status" => 0, "message" => "You have a Pending Receipt"); } } else { $response = array("Status" => 0, "message" => "Unauthorized User"); } } else { $response = array("Status" => 0, "message" => "Missing Information"); } $logger->Log("Create Receipt", $userid, json_encode($response), $request); return json_encode($response); } function UseSeal(Request $request) { date_default_timezone_set("Africa/Nairobi"); $response = array(); $logger = new Logger(); $seal = $request->input("seal"); $boxno = $request->input("boxno"); $userid = $request->input("userid"); if (strlen($seal) > 3 && strlen($userid) > 3 && strlen($boxno) > 2) { $check_user = DB::table("users")->where("Type", 2)->where("Status", 1)->where("UserID", $userid)->count(); if ($check_user == 1) { $check_in_que = DB::table("receipts")->select("ID")->where("userid", $userid)->where("status", 0)->get(); if (count($check_in_que) == 1) { $receipt = $check_in_que[0]->ID; $check_seal = DB::table("seals")->where("Seal_No", $seal)->where("status", 0)->where("commander", $userid)->count(); if ($check_seal == 1) { $confirm_seal = DB::table("receipt_details")->where("SealNo", $seal)->where("status", 0)->count(); if ($confirm_seal == 0) { $add = DB::table("receipt_details")->insert(array("ReceiptID" => $receipt, "SealNo" => $seal, "BoxNo" => $boxno, "created_at" => date("Y-m-d H:i:s"))); $response = array("Status" => 1, "message" => "Success"); } else { $response = array("Status" => 0, "message" => "Seal Already Exists"); } } else { $response = array("Status" => 0, "message" => "Invaild Or Expired Seal"); } } else { $response = array("Status" => 0, "message" => "Generate Receipt First"); } } else { $response = array("Status" => 0, "message" => "Unauthorized User"); } } else { $response = array("Status" => 0, "message" => "Missing Information"); } $logger->Log("Use Seal", $userid, json_encode($response), $request); return json_encode($response); } function ConfirmOrder(Request $request) { date_default_timezone_set("Africa/Nairobi"); $response = array(); $logger = new Logger(); $userid = $request->input("userid"); if (strlen($userid) > 3) { $check_in_que = DB::table("receipts")->where("userid", $userid)->where("status", 0)->get(); if (count($check_in_que) == 1) { $receipt_id = $check_in_que[0]->ID; $collection_email = $check_in_que[0]->collection_email; $collection_phone = $check_in_que[0]->collection_phone; $delivery_email = $check_in_que[0]->delivery_email; $delivery_phone = $check_in_que[0]->delivery_phone; $customer = $check_in_que[0]->customer; $branch = $check_in_que[0]->branch; $collection = $check_in_que[0]->collection; $delivery = $check_in_que[0]->delivery; $get_seals = DB::table("receipt_details")->where("ReceiptID", $receipt_id)->where("status", 0)->get(); if (count($get_seals) > 0) { $otp = rand(100000, 999999); $save_otp = DB::table("otps")->insert(array("code" => $otp, "Receipt_No" => $receipt_id, "Type" => "Collect", "created_at" => date("Y-m-d H:i:s"))); $alertClass = new Alerts(); $smsmessage = "Dear Customer,{$otp} is the Collection code for Receipt No {$receipt_id}.
                        Kindly check the details sent to {$collection_email} then Share this code to  {$userid}"; $footer = $_ENV["EMAIL_FOOTER"]; $emailmessage = "Dear {$collection}, {$otp} is the Collection code.
                                        Find the Attached PDF file for more details. <p>{$footer}</p>"; $table_details = "<table style="border-collapse: collapse; width: 100%;">
                    <thead >\xa                        <tr  style="background-color: #FFAE42;color: white;text-align: center; padding: 8px;" >
                             \xa                            <th >Box No.</th>
                            <th>Seal No.</th>\xa                        </tr>
                    </thead>
                    <tbody>"; foreach ($get_seals as $seal) { $box = $seal->BoxNo; $seal_no = $seal->SealNo; $table_details = $table_details . "<tr style='background-color: #f2f2f2; padding: 8px;'><td style='text-align: center;'>{$box}</td><td style='text-align: center;'>{$seal_no}</td></tr>"; } $table_details = $table_details . "</tbody></table>"; $alertClass->SendSms($collection_phone, $smsmessage); $alertClass->SendCollectionOTPEmail($collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $table_details); $response = array("Status" => 1, "message" => "Get Code From Customer"); } else { $response = array("Status" => 0, "message" => "Kindly Scan Some Seals"); } } else { $response = array("Status" => 0, "message" => "Invalid Receipt"); } } else { $response = array("Status" => 0, "message" => "Missing Information"); } $logger->Log("Confirm Order", $userid, json_encode($response), $request); return json_encode($response); } function CloseSeal(Request $request) { date_default_timezone_set("Africa/Nairobi"); $response = array(); $logger = new Logger(); $seal = $request->input("seal"); $userid = $request->input("userid"); if (strlen($seal) > 3 && strlen($userid) > 3) { $check_in_que = DB::table("receipts")->select("ID")->where("userid", $userid)->where("status", 1)->get(); if (count($check_in_que) == 1) { $receipt = $check_in_que[0]->ID; $check_seal = DB::table("seals")->where("Seal_No", $seal)->where("status", 1)->count(); if ($check_seal == 1) { $confirm_seal = DB::table("receipt_details")->where("SealNo", $seal)->where("status", 1)->count(); if ($confirm_seal == 1) { $update = DB::table("receipt_details")->where("SealNo", $seal)->update(array("status" => 2, "updated_at" => date("Y-m-d H:i:s"))); $response = array("Status" => 1, "message" => "Success"); } else { $response = array("Status" => 0, "message" => "Seal invalid"); } } else { $response = array("Status" => 0, "message" => "Invaild Or Expired Seal"); } } else { $response = array("Status" => 0, "message" => "Invalid Receipt"); } } else { $response = array("Status" => 0, "message" => "Missing Information"); } $logger->Log("Use Seal", $userid, json_encode($response), $request); return json_encode($response); } function EndOrder(Request $request) { date_default_timezone_set("Africa/Nairobi"); $response = array(); $logger = new Logger(); $userid = $request->input("userid"); $receipt_id = $request->input("receiptid"); if (strlen($userid) > 3 && strlen($receipt_id) > 0) { $check_in_que = DB::table("receipts")->where("userid", $userid)->where("ID", $receipt_id)->where("status", 1)->get(); if (count($check_in_que) == 1) { $receipt_id = $check_in_que[0]->ID; $collection_email = $check_in_que[0]->collection_email; $collection_phone = $check_in_que[0]->collection_phone; $delivery_email = $check_in_que[0]->delivery_email; $delivery_phone = $check_in_que[0]->delivery_phone; $customer = $check_in_que[0]->customer; $branch = $check_in_que[0]->branch; $collection = $check_in_que[0]->collection; $delivery = $check_in_que[0]->delivery; $get_seals = DB::table("receipt_details")->where("ReceiptID", $receipt_id)->get(); $otp = rand(100000, 999999); $save_otp = DB::table("otps")->insert(array("code" => $otp, "Receipt_No" => $receipt_id, "Type" => "Deliver", "created_at" => date("Y-m-d H:i:s"))); $alertClass = new Alerts(); $smsmessage = "Dear {$delivery},{$otp} is the Delivery code for Receipt No {$receipt_id} Delivered
                        Kindly check details sent to {$delivery_email} then Share this code to  {$userid}"; $footer = $_ENV["EMAIL_FOOTER"]; $emailmessage = "Dear Customer,{$otp} is the Delivery code.
                        Find the Attached PDF file for more details. <p>{$footer}</p> "; $table_details = "<table style="border-collapse: collapse; width: 100%;" >
                    <thead>
                        <tr style="background-color: #FFAE42;color: white;text-align: center; padding: 8px;">
                             
                            <th>Box No.</th>\xa                            <th>Seal No.</th>\xa                        </tr>
                    </thead>
                    <tbody>"; foreach ($get_seals as $seal) { $box = $seal->BoxNo; $seal_no = $seal->SealNo; $table_details = $table_details . "<tr style='background-color: #f2f2f2; padding: 8px;'><td style='text-align: center;'>{$box}</td><td style='text-align: center;'>{$seal_no}</td></tr>"; } $table_details = $table_details . "</tbody></table>"; $alertClass->SendSms($delivery_phone, $smsmessage); $alertClass->SendDeliveryOTPEmail($collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $table_details); $response = array("Status" => 1, "message" => "Get Code From Customer"); } else { $response = array("Status" => 0, "message" => "Invalid Receipt"); } } else { $response = array("Status" => 0, "message" => "Missing Information"); } $logger->Log("End Order", $userid, json_encode($response), $request); return json_encode($response); } function VerifySealOTP(Request $request) { date_default_timezone_set("Africa/Nairobi"); $response = array(); $logger = new Logger(); $otpcode = $request->input("otp"); $userid = $request->input("userid"); if (strlen($otpcode) > 3 && strlen($userid) > 3) { $checkcode = DB::table("otps")->select("Type", "created_at", "Receipt_No")->where("code", $otpcode)->where("status", 0)->get(); if (count($checkcode) == 1) { $type = $checkcode[0]->Type; $receiptNo = $checkcode[0]->Receipt_No; if ($type == "Collect") { $update_opt = DB::table("otps")->where("code", $otpcode)->update(array("updated_at" => date("Y-m-d H:i:s"), "status" => 1)); $get_all_seals = DB::table("receipt_details")->select("SealNo")->where("ReceiptID", $receiptNo)->get(); $total = 0; foreach ($get_all_seals as $seal) { $seal_no = $seal->SealNo; $update_seal = DB::table("seals")->where("Seal_No", $seal_no)->where("status", 0)->update(array("status" => 1)); $total = $total + 1; } $update_ = DB::table("receipts")->where("ID", $receiptNo)->where("status", 0)->update(array("collection_at" => date("Y-m-d H:i:s"), "status" => 1, "collection_code" => $otpcode, "status" => 1, "count" => $total)); $check_receipt = DB::table("receipt_details")->where("ReceiptID", $receiptNo)->update(array("status" => 1, "updated_at" => date("Y-m-d H:i:s"))); $check_in_que = DB::table("receipts")->where("userid", $userid)->where("ID", $receiptNo)->get(); if (count($check_in_que) == 1) { $receipt_id = $check_in_que[0]->ID; $collection_email = $check_in_que[0]->collection_email; $collection_phone = $check_in_que[0]->collection_phone; $delivery_email = $check_in_que[0]->delivery_email; $delivery_phone = $check_in_que[0]->delivery_phone; $customer = $check_in_que[0]->customer; $branch = $check_in_que[0]->branch; $collection = $check_in_que[0]->collection; $delivery = $check_in_que[0]->delivery; $collection_code = $check_in_que[0]->collection_code; $collection_time = $check_in_que[0]->collection_at; $get_seals = DB::table("receipt_details")->where("ReceiptID", $receipt_id)->get(); if (count($get_seals) > 0) { $alertClass = new Alerts(); $smsmessage = "Dear Customer, Consignment No {$receipt_id}. is Now in Transit"; $emailmessage = "Dear Customer, Consignment No {$receipt_id}. is Now in Transit"; $table_details = "<table style="border-collapse: collapse; width: 100%;"  >\xa                    <thead>\xa                        <tr style="background-color: #FFAE42;color: white;text-align: center; padding: 8px;">
                             \xa                            <th>Box No.</th>\xa                            <th>Seal No.</th>
                        </tr>
                    </thead>
                    <tbody>"; foreach ($get_seals as $seal) { $box = $seal->BoxNo; $seal_no = $seal->SealNo; $table_details = $table_details . "<tr style='background-color: #f2f2f2; padding: 8px;'><td style='text-align: center;'>{$box}</td><td style='text-align: center;'>{$seal_no}</td></tr>"; } $table_details = $table_details . "</tbody></table>"; $get_settings = DB::table("settings")->select("Email", "phone")->where("ID", 1)->get(); $ops_email = $get_settings[0]->Email; $ops_phone = $get_settings[0]->phone; $alertClass->SendSms($collection_phone, $smsmessage); $alertClass->SendSms($ops_phone, $smsmessage); $alertClass->SendTransitEmail($ops_email, $collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $collection_code, $collection_time, $receipt_id, $table_details); $alertClass->SendTransitEmail($collection_email, $collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $collection_code, $collection_time, $receipt_id, $table_details); } else { $response = array("Status" => 0, "message" => "Kindly Scan Some Seals"); } } $response = array("Status" => 1, "message" => "Transit Mode Activated"); } else { if ($type == "Deliver") { $update_opt = DB::table("otps")->where("code", $otpcode)->update(array("updated_at" => date("Y-m-d H:i:s"), "status" => 1)); $get_all_seals = DB::table("receipt_details")->select("SealNo")->where("ReceiptID", $receiptNo)->get(); foreach ($get_all_seals as $seal) { $seal_no = $seal->SealNo; $update_seal = DB::table("seals")->where("Seal_No", $seal_no)->where("status", 1)->update(array("status" => 2)); } $update_ = DB::table("receipts")->where("ID", $receiptNo)->where("status", 1)->update(array("delivery_at" => date("Y-m-d H:i:s"), "status" => 1, "delivery_code" => $otpcode, "status" => 2)); $check_receipt = DB::table("receipt_details")->where("ReceiptID", $receiptNo)->update(array("status" => 2, "updated_at" => date("Y-m-d H:i:s"))); $check_in_que = DB::table("receipts")->where("userid", $userid)->where("ID", $receiptNo)->get(); if (count($check_in_que) == 1) { $receipt_id = $check_in_que[0]->ID; $collection_email = $check_in_que[0]->collection_email; $collection_phone = $check_in_que[0]->collection_phone; $delivery_email = $check_in_que[0]->delivery_email; $delivery_phone = $check_in_que[0]->delivery_phone; $delivery_code = $check_in_que[0]->delivery_code; $delivery_time = $check_in_que[0]->delivery_at; $bullion = $check_in_que[0]->bullion; $customer = $check_in_que[0]->customer; $branch = $check_in_que[0]->branch; $collection = $check_in_que[0]->collection; $delivery = $check_in_que[0]->delivery; $collection_code = $check_in_que[0]->collection_code; $collection_time = $check_in_que[0]->collection_at; $get_seals = DB::table("receipt_details")->where("ReceiptID", $receipt_id)->get(); $alertClass = new Alerts(); $smsmessage = "Dear Customer, Consignment No {$receipt_id}. has been  Delivered"; $footer = $_ENV["EMAIL_FOOTER"]; $emailmessage = "Dear Customer, Consignment No {$receipt_id}. has been  Delivered.Find the Attached delivery note <p>{$footer}</p>"; $table_details = "<table style="border-collapse: collapse; width: 100%;">\xa                    <thead>\xa                        <tr style="background-color: #FFAE42;color: white;text-align: center; padding: 8px;">\xa                             \xa                            <th>Box No.</th>\xa                            <th>Seal No.</th>\xa                        </tr>
                    </thead>
                    <tbody>"; foreach ($get_seals as $seal) { $box = $seal->BoxNo; $seal_no = $seal->SealNo; $table_details = $table_details . "<tr style='background-color: #f2f2f2; padding: 8px;'><td style='text-align: center;'>{$box}</td><td style='text-align: center;'>{$seal_no}</td></tr>"; } $table_details = $table_details . "</tbody></table>"; $get_settings = DB::table("settings")->select("Email", "phone")->where("ID", 1)->get(); $ops_email = $get_settings[0]->Email; $ops_phone = $get_settings[0]->phone; $alertClass->SendSms($collection_phone, $smsmessage); $alertClass->SendSms($delivery_phone, $smsmessage); $alertClass->SendSms($ops_phone, $smsmessage); $alertClass->SendDeliveryEmail($ops_email, $collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $collection_code, $collection_time, $delivery_code, $delivery_time, $userid, $bullion, $receipt_id, $table_details); $alertClass->SendDeliveryEmail($collection_email, $collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $collection_code, $collection_time, $delivery_code, $delivery_time, $userid, $bullion, $receipt_id, $table_details); $alertClass->SendDeliveryEmail($delivery_email, $collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $collection_code, $collection_time, $delivery_code, $delivery_time, $userid, $bullion, $receipt_id, $table_details); } $response = array("Status" => 1, "message" => "Delivery Success"); } } } else { $response = array("Status" => 0, "message" => "Invalid Or Exipred Code"); } } else { $response = array("Status" => 0, "message" => "Missing Information"); } $logger->Log("Verify OTP", $userid, json_encode($response), $request); return json_encode($response); } public function TransferSeal(Request $request) { date_default_timezone_set("Africa/Nairobi"); $response = array(); $logger = new Logger(); $seal_no = $request->input("seal"); $userid = $request->input("userid"); $citid = $request->input("citid"); if ($seal_no != '' && strlen($userid) > 3 && strlen($citid) > 3) { $check_users = DB::select("select count(*) As count from users admin,users cit\xa                        where admin.Type=1 AND cit.Type=2 AND admin.UserID='{$userid}'
                         AND cit.UserID='{$citid}'"); if ($check_users[0]->count == 1) { $check_item = DB::table("seals")->select("ID")->where("Seal_No", $seal_no)->where("status", 0)->where("commander", null)->get(); if (count($check_item) == 1) { $transfer_seal = DB::table("seals")->where("Seal_No", $seal_no)->update(array("commander" => $citid)); $save_history = DB::table("seal_history")->insert(array("seal" => $seal_no, "admin" => $userid, "commander" => $citid, "activity" => 1, "created_at" => date("Y-m-d H:i:s"))); $response = array("Status" => 1, "message" => "Transfered"); } else { $response = array("Status" => 0, "message" => "Invalid Seal"); } } else { $response = array("Status" => 0, "message" => "Invalid Users"); } } else { $response = array("Status" => 0, "message" => "MIssing information"); } $logger->Log("Seal Transfer", $userid, json_encode($response), $request); return json_encode($response); } public function ReturnSeal(Request $request) { date_default_timezone_set("Africa/Nairobi"); $response = array(); $logger = new Logger(); $seal_no = $request->input("seal"); $userid = $request->input("userid"); $citid = $request->input("citid"); if ($seal_no != '' && strlen($userid) > 3 && strlen($citid) > 3) { $check_users = DB::select("select count(*) As count from users admin,users cit\xa                        where admin.Type=1 AND cit.Type=2 AND admin.UserID='{$userid}'
                         AND cit.UserID='{$citid}'"); if ($check_users[0]->count == 1) { $check_item = DB::table("seals")->select("ID")->where("Seal_No", $seal_no)->where("status", 0)->where("commander", $citid)->get(); if (count($check_item) == 1) { $return_seal = DB::table("seals")->where("Seal_No", $seal_no)->update(array("commander" => null)); $save_history = DB::table("seal_history")->insert(array("seal" => $seal_no, "admin" => $userid, "commander" => $citid, "activity" => 2, "created_at" => date("Y-m-d H:i:s"))); $response = array("Status" => 1, "message" => "Returned"); } else { $response = array("Status" => 0, "message" => "Invalid Seal"); } } else { $response = array("Status" => 0, "message" => "Invalid Users"); } } else { $response = array("Status" => 0, "message" => "MIssing information"); } $logger->Log("Seal Returned", $userid, json_encode($response), $request); return json_encode($response); } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace App\Http\Controllers\Seal; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use App\Http\Controllers\Logger; use App\Http\Controllers\Alerts\Alerts; class Seals extends Controller { public function SaveSeal(Request $request) { date_default_timezone_set("\101\146\162\x69\x63\x61\57\x4e\141\x69\162\157\x62\x69"); $response = array(); $logger = new Logger(); $seal_no = $request->input("\163\145\141\154"); $userid = $request->input("\165\163\x65\x72\x69\x64"); if ($seal_no != '' && strlen($userid) > 3) { $check_item = DB::table("\163\x65\141\154\163")->select("\x49\x44")->where("\123\145\141\154\137\x4e\x6f", $seal_no)->get(); if (count($check_item) == 1) { $response = array("\x53\164\x61\x74\x75\163" => 0, "\x6d\145\163\x73\x61\147\x65" => "\x53\145\x61\x6c\x20{$seal_no}\40\101\x6c\x72\145\x61\144\171\x20\x45\170\x69\164\x73"); } else { $insert = DB::table("\x73\x65\141\154\x73")->insert(array("\x53\x65\141\154\137\116\x6f" => $seal_no, "\x73\x63\x61\x6e\x62\x79" => $userid, "\143\x72\145\141\164\145\x64\x5f\x61\164" => date("\x59\55\x6d\55\x64\x20\x48\x3a\x69\72\x73"))); if ($insert) { $response = array("\x53\x74\x61\164\x75\163" => 1, "\155\x65\x73\x73\141\x67\145" => "\x53\145\141\x6c\x20\x53\141\x76\145\144"); } else { $response = array("\123\x74\141\x74\x75\163" => 0, "\155\145\x73\x73\x61\147\145" => "\123\141\166\x65\x20\105\x72\162\x6f\x72"); } } } else { $response = array("\123\164\141\x74\x75\163" => 0, "\155\x65\163\163\141\147\145" => "\115\111\163\163\151\x6e\147\40\x69\x6e\146\157\x72\155\x61\164\151\157\x6e"); } $logger->Log("\x53\145\x61\154\40\123\141\x76\x65", $userid, json_encode($response), $request); return json_encode($response); } public function DeleteReceipt(Request $request) { date_default_timezone_set("\x41\146\162\x69\x63\x61\57\x4e\x61\151\162\157\142\x69"); $response = array(); $logger = new Logger(); $userid = $request->input("\x75\163\145\162\x69\x64"); $receiptid = $request->input("\x72\145\x63\x65\151\x70\164\x69\144"); if (strlen($userid) > 3 && strlen($receiptid) > 0) { $check_receipt = DB::table("\162\x65\143\145\x69\160\x74\163")->select("\x49\104")->where("\x75\x73\145\x72\x69\144", $userid)->where("\111\104", $receiptid)->where("\x73\x74\x61\164\165\163", 0)->count(); if ($check_receipt == 1) { $check_receipt = DB::table("\x72\145\x63\x65\x69\160\164\163")->where("\111\104", $receiptid)->update(array("\x73\x74\x61\x74\x75\x73" => -1)); $check_receipt = DB::table("\x72\x65\143\145\151\160\164\x5f\144\x65\164\141\151\154\x73")->where("\x52\x65\x63\x65\151\x70\x74\x49\104", $receiptid)->update(array("\x73\164\x61\x74\x75\163" => -1, "\165\160\x64\141\x74\145\144\137\141\164" => date("\x59\x2d\155\x2d\144\x20\110\x3a\151\72\163"))); $response = array("\x53\164\141\x74\x75\x73" => 1, "\x6d\145\x73\163\x61\x67\x65" => "\104\145\x6c\x65\x74\x65\x64"); } else { $response = array("\123\x74\x61\164\x75\x73" => 0, "\155\145\163\163\x61\x67\x65" => "\x43\x61\156\x6e\x6f\164\x20\x62\145\40\104\145\154\145\x74\145\x64"); } } else { $response = array("\123\x74\141\x74\x75\x73" => 0, "\x6d\145\163\163\x61\x67\x65" => "\115\x49\163\163\x69\156\x67\40\x69\156\146\157\x72\x6d\141\164\151\x6f\x6e"); } $logger->Log("\x44\145\x6c\x65\x74\145\40\122\145\x63\x65\151\x70\x74", $userid, json_encode($response), $request); return json_encode($response); } public function MakeReceipt(Request $request) { date_default_timezone_set("\101\146\x72\x69\x63\141\x2f\116\x61\151\162\x6f\x62\x69"); $response = array(); $logger = new Logger(); $customer_name = $request->input("\143\x75\163\x74\157\155\x65\x72"); $collection = $request->input("\143\157\154\x6c\x65\x63\x74\151\157\156"); $collection_email = $request->input("\143\157\x6c\154\145\x63\164\151\157\x6e\x5f\145\155\141\x69\154"); $collection_phone = $request->input("\x63\x6f\154\154\145\143\x74\x69\157\x6e\137\160\150\157\156\x65"); $delivery = $request->input("\144\x65\x6c\x69\x76\145\162\171"); $delivery_email = $request->input("\x64\x65\154\x69\x76\x65\162\171\x5f\x65\x6d\141\x69\154"); $delivery_phone = $request->input("\x64\x65\154\151\x76\x65\162\171\137\x70\x68\157\156\x65"); $branch = $request->input("\142\162\141\x6e\143\x68"); $userid = $request->input("\x75\x73\x65\162\151\x64"); $bullion = $request->input("\142\x75\154\154\151\x6f\x6e\x5f\x6e\157"); if (strlen($customer_name) > 3 && strlen($collection) > 3 && strlen($collection_email) > 3 && strlen($collection_phone) > 3 && strlen($delivery) > 3 && strlen($delivery_email) > 3 && strlen($delivery_phone) > 3 && strlen($branch) > 3 && strlen($userid) > 3 && strlen($bullion) > 3) { $check_user = DB::table("\x75\x73\x65\x72\x73")->where("\x54\171\x70\x65", 2)->where("\123\x74\141\164\x75\163", 1)->where("\x55\x73\x65\x72\x49\x44", $userid)->count(); if ($check_user == 1) { $check_in_que = DB::table("\x72\145\143\145\x69\x70\164\163")->select("\111\x44")->where("\165\163\x65\x72\x69\x64", $userid)->where("\x73\x74\141\x74\165\x73", 0)->count(); if ($check_in_que == 0) { $transit_save = DB::table("\162\x65\143\x65\x69\160\x74\x73")->insert(array("\x63\165\163\x74\x6f\x6d\145\162" => $customer_name, "\x63\157\154\x6c\145\143\x74\x69\x6f\x6e" => $collection, "\x63\157\x6c\x6c\x65\143\164\x69\x6f\x6e\x5f\145\155\141\x69\x6c" => $collection_email, "\143\x6f\x6c\x6c\145\143\x74\151\x6f\x6e\x5f\x70\150\x6f\156\x65" => $collection_phone, "\x63\157\154\x6c\145\143\x74\x69\157\156\137\x61\164" => date("\x59\55\155\55\144\40\110\72\151\72\x73"), "\144\145\154\151\x76\145\162\x79" => $delivery, "\144\145\x6c\x69\x76\x65\x72\x79\137\x65\155\x61\151\x6c" => $delivery_email, "\144\145\x6c\x69\x76\145\162\x79\x5f\x70\150\x6f\156\145" => $delivery_phone, "\x62\162\141\156\x63\x68" => $branch, "\x75\x70\144\141\164\145\144\x5f\x61\164" => date("\131\x2d\x6d\x2d\144\x20\x48\x3a\151\x3a\163"), "\x75\x73\145\x72\151\144" => $userid, "\142\x75\x6c\154\x69\157\x6e" => $bullion)); $response = array("\x53\164\x61\x74\x75\x73" => 1, "\155\x65\163\163\x61\147\145" => "\x47\145\156\145\x72\141\164\x65\x64"); } else { $response = array("\x53\164\141\x74\x75\x73" => 0, "\155\x65\163\163\x61\147\145" => "\131\157\165\40\x68\x61\x76\x65\40\x61\x20\x50\145\x6e\144\151\156\147\40\122\145\x63\x65\151\160\164"); } } else { $response = array("\x53\164\141\164\165\x73" => 0, "\x6d\145\163\163\x61\x67\145" => "\x55\156\x61\x75\x74\150\x6f\x72\x69\x7a\145\144\x20\125\163\x65\x72"); } } else { $response = array("\123\164\141\164\165\x73" => 0, "\x6d\x65\x73\163\141\147\145" => "\x4d\151\x73\163\x69\156\x67\40\111\156\146\x6f\162\x6d\141\164\x69\x6f\156"); } $logger->Log("\x43\x72\145\x61\x74\x65\40\x52\x65\x63\145\x69\160\x74", $userid, json_encode($response), $request); return json_encode($response); } function UseSeal(Request $request) { date_default_timezone_set("\x41\x66\162\151\x63\x61\57\x4e\x61\x69\162\157\142\x69"); $response = array(); $logger = new Logger(); $seal = $request->input("\x73\145\141\x6c"); $boxno = $request->input("\142\x6f\170\x6e\157"); $userid = $request->input("\x75\163\145\x72\x69\x64"); if (strlen($seal) > 3 && strlen($userid) > 3 && strlen($boxno) > 2) { $check_user = DB::table("\x75\163\x65\162\x73")->where("\124\171\160\x65", 2)->where("\123\x74\141\164\x75\x73", 1)->where("\125\x73\145\x72\111\x44", $userid)->count(); if ($check_user == 1) { $check_in_que = DB::table("\x72\x65\143\x65\151\x70\x74\x73")->select("\x49\x44")->where("\x75\x73\x65\162\x69\x64", $userid)->where("\163\x74\x61\164\165\163", 0)->get(); if (count($check_in_que) == 1) { $receipt = $check_in_que[0]->ID; $check_seal = DB::table("\x73\145\141\154\163")->where("\123\145\x61\154\x5f\116\x6f", $seal)->where("\x73\x74\141\164\165\163", 0)->where("\x63\x6f\x6d\155\x61\x6e\144\145\162", $userid)->count(); if ($check_seal == 1) { $confirm_seal = DB::table("\162\x65\x63\x65\151\x70\164\x5f\x64\145\164\x61\x69\154\x73")->where("\123\x65\x61\154\x4e\x6f", $seal)->where("\163\164\x61\x74\x75\163", 0)->count(); if ($confirm_seal == 0) { $add = DB::table("\162\145\143\x65\x69\160\x74\x5f\x64\145\164\x61\151\154\163")->insert(array("\x52\x65\143\x65\151\x70\164\111\x44" => $receipt, "\123\x65\x61\154\x4e\157" => $seal, "\x42\x6f\x78\x4e\x6f" => $boxno, "\143\162\x65\141\x74\145\144\137\x61\x74" => date("\131\x2d\155\55\144\40\110\x3a\151\72\163"))); $response = array("\x53\164\x61\x74\x75\x73" => 1, "\x6d\x65\x73\163\x61\147\x65" => "\123\x75\x63\x63\x65\163\163"); } else { $response = array("\x53\x74\x61\164\165\x73" => 0, "\155\145\x73\163\141\147\145" => "\x53\145\x61\x6c\x20\x41\154\x72\x65\141\x64\x79\40\x45\170\151\163\x74\163"); } } else { $response = array("\x53\x74\141\164\165\x73" => 0, "\x6d\x65\163\x73\141\x67\145" => "\111\x6e\x76\141\151\x6c\144\40\117\162\40\x45\170\x70\151\162\145\144\40\123\x65\141\x6c"); } } else { $response = array("\x53\164\x61\x74\165\163" => 0, "\x6d\x65\x73\x73\x61\147\145" => "\x47\145\156\x65\x72\x61\x74\x65\x20\122\145\x63\145\x69\160\164\40\x46\x69\x72\163\164"); } } else { $response = array("\x53\164\x61\164\x75\163" => 0, "\x6d\145\163\163\x61\x67\145" => "\x55\156\x61\x75\x74\x68\157\162\x69\172\145\x64\40\x55\x73\145\162"); } } else { $response = array("\x53\x74\141\164\165\163" => 0, "\155\145\x73\163\x61\147\145" => "\x4d\x69\x73\163\x69\x6e\147\40\111\156\146\157\x72\155\141\164\151\157\156"); } $logger->Log("\125\x73\x65\40\x53\145\x61\154", $userid, json_encode($response), $request); return json_encode($response); } function ConfirmOrder(Request $request) { date_default_timezone_set("\101\146\162\x69\x63\141\57\x4e\x61\x69\x72\x6f\142\151"); $response = array(); $logger = new Logger(); $userid = $request->input("\165\163\x65\x72\x69\144"); if (strlen($userid) > 3) { $check_in_que = DB::table("\x72\145\x63\x65\151\160\164\163")->where("\x75\163\145\x72\x69\x64", $userid)->where("\163\x74\x61\164\165\x73", 0)->get(); if (count($check_in_que) == 1) { $receipt_id = $check_in_que[0]->ID; $collection_email = $check_in_que[0]->collection_email; $collection_phone = $check_in_que[0]->collection_phone; $delivery_email = $check_in_que[0]->delivery_email; $delivery_phone = $check_in_que[0]->delivery_phone; $customer = $check_in_que[0]->customer; $branch = $check_in_que[0]->branch; $collection = $check_in_que[0]->collection; $delivery = $check_in_que[0]->delivery; $get_seals = DB::table("\x72\145\143\145\151\x70\164\137\144\145\x74\141\151\x6c\163")->where("\122\x65\x63\145\x69\160\x74\x49\104", $receipt_id)->where("\x73\x74\x61\164\165\x73", 0)->get(); if (count($get_seals) > 0) { $otp = rand(100000, 999999); $save_otp = DB::table("\157\164\160\163")->insert(array("\143\x6f\x64\x65" => $otp, "\x52\145\x63\145\151\x70\164\137\116\157" => $receipt_id, "\124\171\x70\145" => "\x43\157\154\154\x65\143\164", "\x63\x72\145\x61\x74\x65\x64\137\141\164" => date("\x59\x2d\155\55\x64\40\x48\x3a\151\x3a\x73"))); $alertClass = new Alerts(); $smsmessage = "\x44\145\x61\x72\40\x43\x75\x73\164\x6f\155\x65\162\x2c{$otp}\x20\x69\x73\40\164\150\145\40\x43\157\154\x6c\145\143\164\151\x6f\156\40\x63\x6f\144\145\40\x66\157\162\40\122\x65\x63\145\x69\160\164\x20\x4e\157\40{$receipt_id}\56\12\40\40\40\40\40\40\40\40\x20\40\40\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\40\40\x4b\151\156\x64\154\x79\40\x63\x68\145\x63\x6b\x20\164\x68\145\x20\144\145\x74\x61\x69\154\x73\40\163\x65\156\x74\x20\164\x6f\x20{$collection_email}\x20\x74\x68\145\156\x20\x53\150\x61\x72\145\40\164\x68\151\x73\x20\143\157\144\145\x20\x74\157\40\40{$userid}"; $footer = $_ENV["\105\x4d\101\x49\114\137\x46\x4f\117\x54\105\122"]; $emailmessage = "\x44\145\141\162\x20{$collection}\x2c\x20{$otp}\x20\151\x73\40\x74\150\x65\40\103\x6f\x6c\154\x65\x63\164\151\x6f\156\40\143\157\144\x65\56\12\40\x20\40\x20\40\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\40\40\40\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\x46\x69\156\x64\40\164\x68\145\40\x41\164\164\x61\143\150\x65\144\40\x50\104\x46\40\x66\x69\x6c\145\40\x66\x6f\162\40\x6d\x6f\x72\145\x20\x64\x65\x74\x61\151\x6c\x73\56\x20\74\160\76{$footer}\74\57\x70\x3e"; $table_details = "\x3c\164\141\142\x6c\145\40\163\164\171\x6c\x65\75\42\x62\x6f\x72\x64\x65\x72\55\143\x6f\154\154\141\x70\x73\x65\72\40\x63\x6f\x6c\x6c\141\160\x73\145\x3b\x20\x77\151\x64\164\150\72\40\x31\x30\x30\x25\73\42\76\12\x20\40\40\40\x20\40\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\40\40\x3c\164\150\145\141\144\x20\76\xa\40\x20\40\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\40\40\40\40\40\40\40\40\x20\74\164\162\40\40\x73\164\171\154\145\75\x22\142\141\x63\153\x67\x72\x6f\x75\x6e\144\x2d\143\x6f\x6c\157\162\x3a\x20\x23\x46\x46\101\x45\x34\62\73\143\x6f\x6c\157\x72\x3a\x20\x77\x68\x69\164\x65\73\164\x65\170\x74\x2d\141\154\151\147\156\x3a\40\143\x65\x6e\164\145\x72\x3b\x20\160\141\144\144\x69\156\147\x3a\40\70\x70\x78\73\42\x20\76\12\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\40\x20\40\x20\x20\x20\40\40\x20\40\x20\x20\40\xa\40\40\40\40\x20\40\x20\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\74\x74\x68\x20\76\x42\x6f\x78\x20\116\x6f\x2e\x3c\57\x74\150\x3e\12\40\40\x20\x20\x20\40\40\x20\40\40\40\x20\x20\40\x20\40\40\40\x20\x20\x20\40\x20\40\40\x20\40\x20\74\164\150\x3e\x53\x65\x61\x6c\40\116\157\56\x3c\57\x74\150\76\xa\x20\x20\40\x20\x20\40\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\74\57\164\162\x3e\12\40\40\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\40\40\40\40\40\40\x20\74\57\x74\150\145\141\144\76\12\40\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\74\164\142\x6f\144\x79\x3e"; foreach ($get_seals as $seal) { $box = $seal->BoxNo; $seal_no = $seal->SealNo; $table_details = $table_details . "\74\x74\x72\x20\x73\164\171\154\x65\x3d\47\142\141\x63\x6b\x67\162\157\165\x6e\x64\x2d\x63\x6f\x6c\x6f\x72\x3a\x20\x23\x66\62\146\x32\146\x32\x3b\x20\160\141\144\x64\151\x6e\x67\x3a\40\x38\x70\170\x3b\x27\x3e\74\164\x64\40\x73\164\171\154\x65\75\47\164\145\x78\x74\x2d\141\154\x69\x67\156\72\x20\x63\x65\156\164\x65\162\73\x27\76{$box}\x3c\57\164\144\x3e\74\164\x64\40\x73\x74\x79\154\145\x3d\x27\164\145\x78\164\x2d\x61\154\x69\147\x6e\72\x20\x63\145\x6e\164\145\162\73\47\76{$seal_no}\x3c\x2f\x74\144\x3e\x3c\57\164\x72\76"; } $table_details = $table_details . "\x3c\57\x74\x62\157\x64\x79\76\x3c\x2f\164\x61\x62\154\x65\76"; $alertClass->SendSms($collection_phone, $smsmessage); $alertClass->SendCollectionOTPEmail($collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $table_details); $response = array("\123\x74\141\164\x75\x73" => 1, "\x6d\x65\x73\163\141\x67\x65" => "\x47\x65\164\x20\103\x6f\x64\145\40\x46\x72\x6f\155\40\x43\x75\163\164\157\x6d\x65\162"); } else { $response = array("\123\164\141\164\x75\x73" => 0, "\155\145\x73\163\141\147\x65" => "\x4b\151\156\144\154\171\x20\123\143\x61\x6e\x20\x53\157\x6d\x65\x20\x53\145\141\x6c\163"); } } else { $response = array("\x53\164\141\164\x75\163" => 0, "\x6d\145\x73\x73\x61\x67\145" => "\x49\156\166\141\x6c\x69\x64\40\x52\145\x63\145\151\x70\x74"); } } else { $response = array("\123\x74\x61\164\x75\163" => 0, "\x6d\145\163\163\x61\x67\x65" => "\x4d\151\163\163\x69\156\147\x20\111\x6e\146\157\162\x6d\x61\164\151\157\156"); } $logger->Log("\103\157\x6e\x66\x69\162\155\40\x4f\x72\x64\145\x72", $userid, json_encode($response), $request); return json_encode($response); } function CloseSeal(Request $request) { date_default_timezone_set("\101\146\162\151\143\x61\57\116\141\151\162\x6f\142\151"); $response = array(); $logger = new Logger(); $seal = $request->input("\x73\145\141\x6c"); $userid = $request->input("\x75\x73\145\162\151\144"); if (strlen($seal) > 3 && strlen($userid) > 3) { $check_in_que = DB::table("\x72\145\143\145\x69\x70\164\x73")->select("\x49\104")->where("\165\163\x65\x72\151\x64", $userid)->where("\163\x74\x61\x74\x75\x73", 1)->get(); if (count($check_in_que) == 1) { $receipt = $check_in_que[0]->ID; $check_seal = DB::table("\x73\x65\141\154\x73")->where("\123\x65\x61\154\137\x4e\x6f", $seal)->where("\x73\x74\x61\x74\165\163", 1)->count(); if ($check_seal == 1) { $confirm_seal = DB::table("\162\145\x63\x65\x69\160\164\137\x64\x65\x74\x61\151\x6c\163")->where("\x53\145\x61\154\116\x6f", $seal)->where("\163\x74\141\164\165\163", 1)->count(); if ($confirm_seal == 1) { $update = DB::table("\162\145\x63\x65\151\x70\164\137\x64\145\x74\x61\151\154\163")->where("\123\x65\141\154\116\157", $seal)->update(array("\x73\164\x61\x74\x75\163" => 2, "\165\160\x64\141\x74\145\144\137\x61\164" => date("\x59\x2d\x6d\55\144\x20\x48\72\x69\72\x73"))); $response = array("\x53\x74\141\x74\165\163" => 1, "\x6d\145\163\x73\x61\147\x65" => "\123\x75\143\143\x65\163\x73"); } else { $response = array("\x53\164\x61\x74\165\x73" => 0, "\x6d\145\x73\163\x61\x67\145" => "\x53\145\x61\154\x20\151\x6e\166\x61\154\x69\144"); } } else { $response = array("\123\164\141\x74\x75\x73" => 0, "\x6d\145\163\x73\141\147\145" => "\x49\156\166\x61\151\x6c\x64\x20\117\x72\40\x45\x78\x70\x69\x72\145\x64\x20\x53\x65\141\154"); } } else { $response = array("\123\x74\141\164\x75\163" => 0, "\x6d\x65\x73\x73\x61\x67\x65" => "\x49\156\x76\141\154\x69\x64\40\x52\145\143\145\151\160\x74"); } } else { $response = array("\x53\164\x61\164\x75\x73" => 0, "\x6d\145\x73\163\x61\147\145" => "\115\x69\x73\x73\151\x6e\x67\x20\111\156\x66\x6f\162\155\x61\x74\x69\x6f\156"); } $logger->Log("\125\163\x65\x20\x53\145\141\x6c", $userid, json_encode($response), $request); return json_encode($response); } function EndOrder(Request $request) { date_default_timezone_set("\101\x66\x72\x69\x63\141\57\116\x61\151\162\157\x62\x69"); $response = array(); $logger = new Logger(); $userid = $request->input("\165\x73\145\162\151\144"); $receipt_id = $request->input("\x72\x65\x63\x65\151\160\x74\151\x64"); if (strlen($userid) > 3 && strlen($receipt_id) > 0) { $check_in_que = DB::table("\162\x65\143\145\x69\x70\x74\163")->where("\165\163\145\162\x69\x64", $userid)->where("\111\x44", $receipt_id)->where("\x73\164\141\x74\x75\x73", 1)->get(); if (count($check_in_que) == 1) { $receipt_id = $check_in_que[0]->ID; $collection_email = $check_in_que[0]->collection_email; $collection_phone = $check_in_que[0]->collection_phone; $delivery_email = $check_in_que[0]->delivery_email; $delivery_phone = $check_in_que[0]->delivery_phone; $customer = $check_in_que[0]->customer; $branch = $check_in_que[0]->branch; $collection = $check_in_que[0]->collection; $delivery = $check_in_que[0]->delivery; $get_seals = DB::table("\x72\145\143\x65\x69\x70\164\137\144\x65\x74\141\151\x6c\163")->where("\122\145\143\145\x69\160\x74\x49\104", $receipt_id)->get(); $otp = rand(100000, 999999); $save_otp = DB::table("\x6f\x74\160\x73")->insert(array("\x63\x6f\144\x65" => $otp, "\122\x65\143\145\151\160\x74\x5f\x4e\157" => $receipt_id, "\x54\x79\160\x65" => "\104\145\154\x69\166\145\x72", "\x63\162\145\x61\164\145\x64\137\141\164" => date("\131\55\155\x2d\144\40\x48\x3a\x69\x3a\x73"))); $alertClass = new Alerts(); $smsmessage = "\104\x65\x61\162\40{$delivery}\54{$otp}\40\x69\163\x20\x74\x68\145\x20\104\x65\x6c\x69\x76\x65\162\x79\x20\143\x6f\144\145\40\146\157\x72\40\122\145\x63\x65\151\160\164\x20\x4e\x6f\40{$receipt_id}\40\x44\145\x6c\151\x76\145\x72\x65\144\12\x20\x20\40\40\40\x20\40\40\40\x20\40\40\x20\40\40\40\40\40\x20\40\x20\40\x20\40\x4b\151\156\144\154\x79\x20\x63\150\145\143\x6b\x20\x64\145\x74\x61\151\154\x73\40\163\x65\x6e\x74\x20\164\x6f\x20{$delivery_email}\40\x74\x68\145\156\x20\123\150\x61\162\x65\x20\x74\x68\151\x73\x20\x63\157\144\x65\40\164\157\40\40{$userid}"; $footer = $_ENV["\105\x4d\101\x49\x4c\137\x46\x4f\x4f\124\x45\122"]; $emailmessage = "\104\145\141\x72\40\x43\165\x73\164\157\155\x65\x72\54{$otp}\40\151\163\x20\164\150\x65\40\x44\145\x6c\151\166\x65\x72\x79\x20\143\157\144\145\56\12\40\x20\x20\40\40\x20\40\x20\40\x20\40\x20\40\x20\x20\40\40\40\40\x20\x20\x20\x20\40\x46\151\156\x64\40\x74\150\x65\x20\101\x74\x74\x61\143\150\145\x64\40\x50\x44\x46\40\146\x69\x6c\x65\x20\146\x6f\x72\x20\155\x6f\x72\x65\x20\x64\145\164\x61\151\154\x73\x2e\x20\x3c\x70\x3e{$footer}\x3c\x2f\x70\76\40"; $table_details = "\x3c\x74\x61\142\154\x65\x20\163\x74\171\154\145\x3d\42\x62\157\x72\x64\145\x72\x2d\143\157\154\x6c\x61\x70\x73\145\x3a\40\143\157\x6c\154\141\x70\x73\x65\73\40\167\x69\x64\164\x68\x3a\40\x31\x30\x30\x25\x3b\x22\x20\76\12\x20\x20\40\x20\x20\40\x20\40\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\74\x74\x68\x65\141\x64\x3e\12\40\40\40\40\x20\40\40\40\x20\40\40\40\40\40\x20\x20\x20\40\40\x20\x20\40\40\x20\x3c\x74\162\x20\x73\164\171\x6c\x65\75\42\x62\x61\143\x6b\x67\x72\157\165\156\144\55\x63\157\x6c\x6f\162\72\40\43\x46\x46\x41\105\x34\62\x3b\x63\x6f\x6c\157\x72\x3a\40\x77\x68\151\x74\145\73\164\x65\170\164\x2d\141\154\151\x67\x6e\72\x20\143\145\156\x74\x65\x72\x3b\40\160\141\x64\144\151\156\x67\72\x20\70\x70\x78\73\x22\x3e\12\x20\x20\40\x20\x20\40\x20\x20\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\12\40\40\40\40\40\40\x20\40\40\40\40\x20\40\x20\x20\40\40\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\74\x74\x68\76\x42\x6f\170\40\116\157\x2e\x3c\x2f\164\150\x3e\xa\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\40\40\40\x20\74\164\150\x3e\x53\x65\141\154\x20\x4e\x6f\x2e\x3c\57\x74\150\76\xa\40\x20\x20\x20\x20\x20\x20\40\40\40\40\40\40\x20\x20\40\40\x20\x20\x20\40\40\40\40\74\57\x74\162\x3e\12\40\40\40\x20\40\x20\x20\40\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\74\57\164\x68\145\141\x64\76\12\40\x20\40\40\40\40\40\40\40\40\40\40\40\40\40\40\40\40\x20\40\74\164\142\x6f\x64\171\76"; foreach ($get_seals as $seal) { $box = $seal->BoxNo; $seal_no = $seal->SealNo; $table_details = $table_details . "\74\x74\162\x20\163\x74\x79\x6c\x65\x3d\47\142\141\x63\x6b\x67\162\157\165\x6e\144\55\143\x6f\x6c\x6f\x72\72\40\x23\x66\x32\146\x32\146\x32\73\x20\x70\x61\x64\144\x69\x6e\147\x3a\40\70\x70\x78\73\x27\76\x3c\164\x64\x20\163\x74\x79\x6c\145\75\47\x74\x65\170\x74\x2d\x61\154\x69\x67\156\x3a\x20\x63\x65\156\x74\145\x72\x3b\47\x3e{$box}\74\57\x74\x64\76\x3c\x74\x64\40\x73\164\x79\x6c\145\75\47\x74\x65\170\164\55\x61\x6c\151\147\156\x3a\x20\143\145\x6e\x74\145\162\x3b\47\76{$seal_no}\74\57\164\144\76\74\57\x74\x72\x3e"; } $table_details = $table_details . "\x3c\57\164\x62\157\144\171\x3e\x3c\x2f\x74\141\142\154\145\76"; $alertClass->SendSms($delivery_phone, $smsmessage); $alertClass->SendDeliveryOTPEmail($collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $table_details); $response = array("\123\164\x61\164\x75\x73" => 1, "\155\145\x73\163\141\x67\145" => "\107\x65\x74\x20\x43\x6f\144\145\x20\x46\162\x6f\x6d\40\103\x75\x73\x74\x6f\155\x65\x72"); } else { $response = array("\123\164\x61\164\165\x73" => 0, "\x6d\x65\x73\x73\x61\147\x65" => "\111\156\x76\141\154\x69\x64\40\122\x65\x63\145\x69\x70\164"); } } else { $response = array("\123\164\141\x74\165\163" => 0, "\155\x65\x73\x73\141\x67\x65" => "\115\151\x73\163\151\x6e\147\40\x49\x6e\x66\x6f\x72\x6d\141\164\151\x6f\156"); } $logger->Log("\x45\156\x64\x20\117\x72\x64\145\x72", $userid, json_encode($response), $request); return json_encode($response); } function VerifySealOTP(Request $request) { date_default_timezone_set("\101\x66\x72\151\143\141\57\116\141\151\x72\x6f\142\151"); $response = array(); $logger = new Logger(); $otpcode = $request->input("\157\x74\160"); $userid = $request->input("\165\x73\145\162\x69\144"); if (strlen($otpcode) > 3 && strlen($userid) > 3) { $checkcode = DB::table("\x6f\x74\x70\163")->select("\x54\x79\160\145", "\143\x72\x65\x61\x74\145\144\137\x61\x74", "\122\x65\x63\145\x69\160\x74\x5f\x4e\157")->where("\143\x6f\144\x65", $otpcode)->where("\x73\x74\141\164\x75\163", 0)->get(); if (count($checkcode) == 1) { $type = $checkcode[0]->Type; $receiptNo = $checkcode[0]->Receipt_No; if ($type == "\103\157\x6c\x6c\145\143\164") { $update_opt = DB::table("\x6f\164\160\163")->where("\143\157\x64\x65", $otpcode)->update(array("\x75\x70\x64\141\x74\145\144\137\141\x74" => date("\131\x2d\155\55\144\40\110\x3a\x69\72\x73"), "\163\164\x61\164\x75\x73" => 1)); $get_all_seals = DB::table("\x72\145\143\x65\151\x70\164\x5f\x64\x65\x74\141\151\x6c\163")->select("\x53\x65\141\x6c\x4e\x6f")->where("\x52\145\x63\145\x69\160\164\111\104", $receiptNo)->get(); $total = 0; foreach ($get_all_seals as $seal) { $seal_no = $seal->SealNo; $update_seal = DB::table("\163\145\141\154\163")->where("\123\145\141\154\137\x4e\x6f", $seal_no)->where("\x73\164\x61\164\165\x73", 0)->update(array("\163\164\x61\x74\x75\163" => 1)); $total = $total + 1; } $update_ = DB::table("\x72\145\143\x65\x69\x70\x74\163")->where("\x49\x44", $receiptNo)->where("\x73\x74\x61\164\x75\163", 0)->update(array("\x63\x6f\x6c\x6c\x65\x63\164\x69\157\156\137\141\x74" => date("\131\55\x6d\x2d\144\40\x48\72\151\x3a\x73"), "\x73\164\141\x74\x75\163" => 1, "\143\x6f\154\x6c\x65\143\x74\x69\157\156\137\x63\157\144\x65" => $otpcode, "\x73\x74\141\x74\x75\x73" => 1, "\x63\157\165\x6e\x74" => $total)); $check_receipt = DB::table("\162\x65\x63\x65\x69\160\x74\137\x64\x65\x74\x61\x69\154\x73")->where("\122\x65\x63\x65\151\160\x74\111\x44", $receiptNo)->update(array("\163\164\x61\164\165\x73" => 1, "\165\160\144\141\x74\x65\x64\x5f\141\x74" => date("\131\55\155\x2d\144\x20\x48\72\x69\x3a\x73"))); $check_in_que = DB::table("\x72\145\x63\x65\151\x70\164\x73")->where("\x75\x73\145\162\151\144", $userid)->where("\111\104", $receiptNo)->get(); if (count($check_in_que) == 1) { $receipt_id = $check_in_que[0]->ID; $collection_email = $check_in_que[0]->collection_email; $collection_phone = $check_in_que[0]->collection_phone; $delivery_email = $check_in_que[0]->delivery_email; $delivery_phone = $check_in_que[0]->delivery_phone; $customer = $check_in_que[0]->customer; $branch = $check_in_que[0]->branch; $collection = $check_in_que[0]->collection; $delivery = $check_in_que[0]->delivery; $collection_code = $check_in_que[0]->collection_code; $collection_time = $check_in_que[0]->collection_at; $get_seals = DB::table("\162\145\x63\x65\151\160\x74\x5f\x64\x65\x74\x61\x69\154\163")->where("\122\145\143\x65\x69\x70\164\x49\x44", $receipt_id)->get(); if (count($get_seals) > 0) { $alertClass = new Alerts(); $smsmessage = "\104\x65\x61\162\40\x43\x75\163\x74\x6f\155\145\x72\54\40\x43\157\x6e\x73\x69\147\x6e\155\x65\156\164\40\x4e\157\x20{$receipt_id}\x2e\x20\x69\x73\40\116\157\167\40\x69\x6e\x20\124\x72\141\156\163\151\x74"; $emailmessage = "\x44\145\141\162\x20\103\165\163\x74\157\155\x65\x72\54\x20\103\157\156\x73\x69\x67\156\x6d\x65\156\164\x20\116\157\40{$receipt_id}\x2e\40\151\x73\40\x4e\157\167\x20\x69\156\x20\x54\x72\141\156\x73\x69\x74"; $table_details = "\x3c\x74\141\142\154\x65\x20\x73\x74\171\x6c\x65\x3d\x22\142\157\162\144\x65\162\x2d\x63\157\154\154\141\x70\163\x65\x3a\x20\143\157\x6c\154\x61\x70\163\x65\73\x20\x77\151\x64\x74\150\72\x20\61\x30\60\45\73\x22\x20\x20\76\xa\40\x20\40\x20\x20\40\x20\x20\40\40\40\40\40\x20\x20\x20\x20\x20\40\x20\x3c\164\150\145\x61\144\x3e\xa\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\40\40\40\40\40\40\x20\40\x20\x20\40\40\40\74\164\x72\40\163\164\x79\x6c\x65\75\x22\142\141\x63\153\x67\x72\157\165\x6e\x64\x2d\x63\x6f\154\157\x72\x3a\40\x23\106\x46\x41\105\64\x32\x3b\x63\x6f\x6c\x6f\162\x3a\x20\167\150\x69\164\145\x3b\164\x65\170\x74\x2d\x61\x6c\151\x67\156\x3a\40\x63\145\156\x74\x65\x72\x3b\x20\160\141\x64\x64\x69\x6e\x67\72\x20\70\160\170\x3b\x22\76\12\40\x20\40\x20\x20\40\x20\40\40\40\40\40\x20\40\x20\x20\40\40\40\40\x20\40\40\40\40\40\x20\40\40\xa\x20\40\40\x20\x20\40\40\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\40\40\40\x3c\164\x68\x3e\x42\157\x78\x20\x4e\157\56\74\57\164\x68\76\xa\40\x20\40\40\x20\x20\x20\40\40\x20\x20\40\40\40\x20\40\40\40\x20\40\x20\40\40\x20\x20\x20\x20\40\x3c\x74\150\76\123\x65\141\154\x20\116\x6f\x2e\74\x2f\164\x68\x3e\12\x20\40\x20\40\40\40\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\74\57\x74\x72\76\12\x20\40\x20\x20\40\40\40\x20\40\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\74\57\164\x68\x65\141\x64\76\12\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\x3c\x74\x62\x6f\144\x79\x3e"; foreach ($get_seals as $seal) { $box = $seal->BoxNo; $seal_no = $seal->SealNo; $table_details = $table_details . "\x3c\x74\x72\40\163\x74\x79\154\x65\75\x27\x62\141\143\x6b\x67\162\x6f\165\x6e\x64\55\143\157\154\157\x72\72\x20\x23\x66\x32\x66\x32\146\x32\x3b\40\x70\141\x64\144\x69\x6e\x67\72\40\70\x70\x78\73\47\x3e\74\x74\x64\40\163\164\171\x6c\145\75\x27\164\x65\x78\164\x2d\141\154\x69\x67\x6e\72\40\143\x65\156\x74\145\162\73\x27\x3e{$box}\x3c\57\164\144\x3e\74\x74\x64\x20\x73\x74\x79\x6c\145\x3d\47\164\x65\x78\164\x2d\141\154\151\x67\156\x3a\x20\143\145\x6e\x74\145\162\x3b\47\x3e{$seal_no}\x3c\x2f\x74\x64\76\x3c\57\164\162\76"; } $table_details = $table_details . "\74\x2f\x74\x62\x6f\144\x79\76\x3c\57\164\141\142\x6c\x65\76"; $get_settings = DB::table("\x73\145\164\164\151\156\x67\x73")->select("\105\155\141\x69\154", "\160\150\157\156\145")->where("\x49\104", 1)->get(); $ops_email = $get_settings[0]->Email; $ops_phone = $get_settings[0]->phone; $alertClass->SendSms($collection_phone, $smsmessage); $alertClass->SendSms($ops_phone, $smsmessage); $alertClass->SendTransitEmail($ops_email, $collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $collection_code, $collection_time, $receipt_id, $table_details); $alertClass->SendTransitEmail($collection_email, $collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $collection_code, $collection_time, $receipt_id, $table_details); } else { $response = array("\123\x74\x61\164\165\163" => 0, "\x6d\x65\163\163\x61\147\145" => "\113\151\156\144\154\x79\40\x53\x63\x61\156\40\x53\x6f\155\x65\x20\123\x65\141\154\x73"); } } $response = array("\x53\164\x61\164\x75\x73" => 1, "\x6d\x65\x73\x73\141\147\145" => "\124\x72\141\156\163\x69\x74\40\115\157\x64\145\40\101\x63\x74\151\x76\141\164\145\144"); } else { if ($type == "\104\145\x6c\x69\x76\x65\162") { $update_opt = DB::table("\157\x74\160\163")->where("\143\x6f\144\145", $otpcode)->update(array("\165\x70\x64\x61\164\x65\144\x5f\141\164" => date("\131\55\155\x2d\x64\x20\x48\72\x69\x3a\163"), "\163\x74\141\x74\165\x73" => 1)); $get_all_seals = DB::table("\x72\x65\143\x65\151\160\x74\x5f\144\x65\x74\x61\x69\x6c\163")->select("\x53\x65\x61\x6c\116\x6f")->where("\122\x65\143\x65\x69\x70\164\111\x44", $receiptNo)->get(); foreach ($get_all_seals as $seal) { $seal_no = $seal->SealNo; $update_seal = DB::table("\163\145\x61\154\x73")->where("\123\145\x61\x6c\x5f\116\x6f", $seal_no)->where("\163\164\141\x74\x75\x73", 1)->update(array("\x73\164\141\x74\165\x73" => 2)); } $update_ = DB::table("\x72\145\x63\145\x69\160\164\163")->where("\x49\x44", $receiptNo)->where("\163\x74\x61\x74\x75\163", 1)->update(array("\144\145\x6c\x69\166\145\x72\171\137\x61\x74" => date("\x59\x2d\x6d\x2d\144\40\x48\72\x69\x3a\x73"), "\163\164\x61\164\x75\163" => 1, "\144\145\x6c\x69\166\x65\x72\x79\x5f\143\x6f\x64\145" => $otpcode, "\x73\x74\141\164\165\x73" => 2)); $check_receipt = DB::table("\162\x65\143\145\151\x70\x74\x5f\144\145\x74\x61\151\154\163")->where("\122\145\x63\x65\151\160\164\x49\104", $receiptNo)->update(array("\x73\x74\141\x74\x75\163" => 2, "\x75\160\x64\x61\164\x65\x64\137\x61\164" => date("\x59\55\x6d\x2d\144\40\110\x3a\x69\x3a\163"))); $check_in_que = DB::table("\162\x65\143\x65\151\160\x74\163")->where("\165\x73\145\162\x69\x64", $userid)->where("\111\104", $receiptNo)->get(); if (count($check_in_que) == 1) { $receipt_id = $check_in_que[0]->ID; $collection_email = $check_in_que[0]->collection_email; $collection_phone = $check_in_que[0]->collection_phone; $delivery_email = $check_in_que[0]->delivery_email; $delivery_phone = $check_in_que[0]->delivery_phone; $delivery_code = $check_in_que[0]->delivery_code; $delivery_time = $check_in_que[0]->delivery_at; $bullion = $check_in_que[0]->bullion; $customer = $check_in_que[0]->customer; $branch = $check_in_que[0]->branch; $collection = $check_in_que[0]->collection; $delivery = $check_in_que[0]->delivery; $collection_code = $check_in_que[0]->collection_code; $collection_time = $check_in_que[0]->collection_at; $get_seals = DB::table("\x72\145\x63\145\151\x70\x74\137\x64\145\164\x61\x69\154\163")->where("\x52\145\143\145\151\160\x74\111\x44", $receipt_id)->get(); $alertClass = new Alerts(); $smsmessage = "\104\145\x61\x72\40\103\x75\163\x74\x6f\155\x65\x72\54\x20\x43\157\156\x73\x69\x67\x6e\155\x65\156\164\40\116\x6f\40{$receipt_id}\x2e\40\150\141\x73\x20\142\x65\x65\x6e\x20\40\x44\x65\154\x69\166\145\162\x65\144"; $footer = $_ENV["\x45\x4d\x41\x49\114\x5f\x46\117\117\124\105\122"]; $emailmessage = "\104\145\141\x72\x20\103\x75\x73\164\157\155\145\x72\54\x20\103\x6f\x6e\x73\151\147\x6e\155\145\x6e\x74\x20\x4e\x6f\40{$receipt_id}\56\x20\x68\141\163\x20\142\145\145\x6e\40\x20\x44\x65\x6c\151\x76\145\162\x65\144\x2e\x46\151\156\144\x20\x74\x68\x65\x20\101\x74\164\x61\x63\150\145\144\x20\x64\145\x6c\151\166\x65\162\171\x20\x6e\157\164\145\x20\x3c\160\x3e{$footer}\74\57\x70\76"; $table_details = "\x3c\x74\141\142\x6c\x65\40\x73\x74\x79\x6c\x65\75\42\x62\x6f\162\144\x65\x72\x2d\x63\157\154\x6c\141\160\163\145\72\40\143\157\154\154\x61\x70\163\145\73\40\x77\x69\x64\x74\150\x3a\40\x31\x30\60\x25\73\x22\x3e\xa\40\x20\40\40\x20\40\40\40\40\40\40\40\x20\40\x20\40\x20\40\40\x20\74\x74\150\x65\141\144\x3e\xa\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\40\40\40\x20\x20\40\40\x20\x20\40\40\40\x3c\x74\x72\40\163\x74\171\x6c\x65\x3d\x22\x62\x61\143\x6b\147\162\157\165\x6e\x64\x2d\x63\x6f\154\157\x72\x3a\x20\43\106\106\101\x45\x34\62\73\x63\157\154\157\x72\72\40\x77\150\x69\x74\x65\73\164\145\170\x74\55\141\x6c\x69\147\156\72\x20\x63\x65\156\164\145\x72\x3b\x20\160\141\144\x64\151\156\x67\x3a\x20\70\x70\170\x3b\42\x3e\xa\40\40\40\40\x20\x20\40\40\40\x20\40\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\x20\xa\x20\x20\x20\40\40\x20\40\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\40\x20\40\x3c\164\150\x3e\102\x6f\170\x20\x4e\157\x2e\x3c\57\164\x68\x3e\xa\x20\40\x20\40\40\x20\x20\40\x20\40\40\40\x20\40\x20\x20\40\40\40\x20\40\x20\40\x20\x20\40\40\x20\x3c\x74\x68\76\123\x65\141\x6c\40\116\x6f\x2e\74\57\x74\150\76\xa\40\40\40\40\40\x20\x20\40\40\40\40\40\x20\40\x20\40\x20\x20\40\x20\40\40\x20\40\74\57\x74\162\76\12\x20\x20\40\40\40\x20\40\x20\40\40\x20\40\40\40\x20\x20\40\40\x20\40\74\57\x74\150\145\141\x64\x3e\12\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\x20\x20\40\40\x20\40\40\74\164\x62\x6f\x64\171\76"; foreach ($get_seals as $seal) { $box = $seal->BoxNo; $seal_no = $seal->SealNo; $table_details = $table_details . "\x3c\164\x72\x20\x73\x74\171\154\145\75\x27\x62\x61\143\x6b\147\162\x6f\x75\156\x64\55\x63\x6f\154\157\162\72\40\x23\146\62\146\x32\146\62\x3b\40\x70\141\144\144\x69\156\x67\x3a\x20\x38\160\x78\73\x27\76\74\164\x64\x20\163\164\x79\x6c\x65\x3d\47\x74\145\170\x74\x2d\141\x6c\x69\x67\x6e\x3a\x20\143\x65\x6e\164\x65\162\73\x27\76{$box}\74\x2f\x74\x64\x3e\74\164\144\40\163\164\x79\154\x65\75\x27\164\x65\x78\164\x2d\141\154\x69\147\156\72\40\x63\145\156\164\x65\162\x3b\47\76{$seal_no}\74\x2f\164\x64\76\x3c\x2f\164\162\x3e"; } $table_details = $table_details . "\74\x2f\x74\x62\x6f\x64\171\76\x3c\57\x74\x61\x62\x6c\x65\x3e"; $get_settings = DB::table("\x73\145\x74\x74\151\156\x67\163")->select("\x45\x6d\141\x69\154", "\x70\x68\x6f\x6e\x65")->where("\111\104", 1)->get(); $ops_email = $get_settings[0]->Email; $ops_phone = $get_settings[0]->phone; $alertClass->SendSms($collection_phone, $smsmessage); $alertClass->SendSms($delivery_phone, $smsmessage); $alertClass->SendSms($ops_phone, $smsmessage); $alertClass->SendDeliveryEmail($ops_email, $collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $collection_code, $collection_time, $delivery_code, $delivery_time, $userid, $bullion, $receipt_id, $table_details); $alertClass->SendDeliveryEmail($collection_email, $collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $collection_code, $collection_time, $delivery_code, $delivery_time, $userid, $bullion, $receipt_id, $table_details); $alertClass->SendDeliveryEmail($delivery_email, $collection_email, $collection, $collection_phone, $delivery, $delivery_email, $delivery_phone, $customer, $branch, $emailmessage, $collection_code, $collection_time, $delivery_code, $delivery_time, $userid, $bullion, $receipt_id, $table_details); } $response = array("\123\x74\141\164\165\x73" => 1, "\x6d\x65\163\163\141\x67\x65" => "\x44\145\154\x69\166\x65\x72\x79\x20\x53\x75\x63\143\x65\x73\x73"); } } } else { $response = array("\x53\164\x61\x74\x75\x73" => 0, "\x6d\x65\x73\163\141\x67\x65" => "\111\156\x76\x61\x6c\151\144\x20\x4f\162\x20\105\170\x69\160\162\x65\x64\40\x43\157\144\145"); } } else { $response = array("\123\164\141\x74\x75\x73" => 0, "\155\x65\163\x73\x61\x67\x65" => "\x4d\151\x73\x73\x69\156\147\x20\111\156\146\157\x72\155\141\164\151\157\156"); } $logger->Log("\x56\x65\x72\151\146\x79\40\117\x54\x50", $userid, json_encode($response), $request); return json_encode($response); } public function TransferSeal(Request $request) { date_default_timezone_set("\x41\146\162\151\x63\141\57\x4e\141\x69\x72\157\142\x69"); $response = array(); $logger = new Logger(); $seal_no = $request->input("\163\145\141\x6c"); $userid = $request->input("\x75\163\x65\162\x69\x64"); $citid = $request->input("\x63\x69\164\151\x64"); if ($seal_no != '' && strlen($userid) > 3 && strlen($citid) > 3) { $check_users = DB::select("\163\x65\154\145\x63\164\40\x63\157\165\156\164\x28\x2a\51\x20\101\x73\x20\143\157\165\x6e\164\40\x66\x72\157\155\40\x75\x73\145\162\x73\x20\141\x64\x6d\x69\x6e\x2c\x75\163\145\x72\163\x20\143\151\x74\xa\40\40\x20\x20\40\40\40\40\x20\40\x20\x20\x20\40\x20\40\40\x20\40\x20\40\40\40\x20\x77\x68\145\x72\145\40\x61\x64\x6d\x69\156\56\x54\171\x70\145\x3d\x31\x20\101\116\104\x20\143\x69\x74\56\x54\171\160\145\75\62\x20\101\x4e\x44\x20\x61\144\x6d\151\156\x2e\125\163\145\x72\x49\x44\x3d\47{$userid}\x27\12\40\x20\x20\40\x20\40\x20\40\x20\x20\40\40\x20\x20\x20\40\40\40\40\x20\40\40\x20\40\x20\101\x4e\x44\x20\x63\x69\164\56\x55\163\145\162\111\104\x3d\47{$citid}\47"); if ($check_users[0]->count == 1) { $check_item = DB::table("\163\x65\141\x6c\x73")->select("\x49\x44")->where("\123\145\x61\154\x5f\x4e\157", $seal_no)->where("\x73\x74\141\164\165\x73", 0)->where("\143\x6f\155\155\141\x6e\x64\145\x72", null)->get(); if (count($check_item) == 1) { $transfer_seal = DB::table("\x73\x65\x61\154\x73")->where("\123\145\141\154\x5f\116\x6f", $seal_no)->update(array("\143\157\x6d\x6d\x61\156\144\x65\x72" => $citid)); $save_history = DB::table("\x73\145\x61\x6c\137\150\x69\163\x74\157\x72\x79")->insert(array("\163\x65\x61\154" => $seal_no, "\x61\144\155\x69\156" => $userid, "\143\x6f\x6d\155\141\x6e\x64\x65\x72" => $citid, "\141\x63\x74\x69\166\151\164\171" => 1, "\143\x72\x65\141\164\x65\x64\x5f\x61\x74" => date("\x59\x2d\x6d\x2d\x64\x20\x48\72\x69\72\163"))); $response = array("\123\x74\x61\164\x75\163" => 1, "\x6d\145\x73\163\x61\147\145" => "\x54\162\141\x6e\163\x66\x65\x72\145\144"); } else { $response = array("\123\x74\141\x74\165\163" => 0, "\x6d\x65\163\x73\x61\147\145" => "\111\x6e\x76\141\x6c\151\144\x20\x53\x65\141\154"); } } else { $response = array("\x53\x74\141\x74\165\x73" => 0, "\155\145\x73\x73\141\147\145" => "\x49\x6e\166\x61\154\151\x64\40\125\163\145\162\163"); } } else { $response = array("\123\164\x61\164\x75\163" => 0, "\155\x65\163\x73\x61\x67\145" => "\115\111\163\163\x69\156\x67\40\x69\x6e\x66\x6f\x72\x6d\141\x74\151\x6f\x6e"); } $logger->Log("\x53\145\141\x6c\x20\x54\162\141\156\x73\146\x65\162", $userid, json_encode($response), $request); return json_encode($response); } public function ReturnSeal(Request $request) { date_default_timezone_set("\101\146\x72\x69\x63\x61\x2f\x4e\141\151\162\x6f\x62\x69"); $response = array(); $logger = new Logger(); $seal_no = $request->input("\x73\145\x61\154"); $userid = $request->input("\x75\163\x65\x72\x69\144"); $citid = $request->input("\x63\151\164\151\144"); if ($seal_no != '' && strlen($userid) > 3 && strlen($citid) > 3) { $check_users = DB::select("\163\x65\x6c\x65\143\x74\x20\143\157\165\x6e\x74\50\x2a\51\x20\101\163\x20\x63\157\165\x6e\164\x20\146\x72\157\155\40\165\x73\x65\x72\163\x20\141\144\155\151\x6e\54\x75\x73\x65\x72\x73\40\143\151\164\xa\40\40\x20\x20\x20\40\x20\40\40\40\40\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\40\x20\167\150\145\x72\x65\40\x61\x64\x6d\151\156\56\124\x79\160\145\x3d\61\x20\x41\x4e\104\x20\x63\x69\164\x2e\124\171\x70\145\75\62\40\x41\x4e\x44\40\x61\144\155\151\156\56\x55\x73\145\x72\111\104\75\x27{$userid}\47\12\x20\x20\x20\x20\40\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\40\40\40\40\40\x20\x41\116\x44\40\x63\x69\x74\56\x55\163\145\162\111\104\x3d\x27{$citid}\x27"); if ($check_users[0]->count == 1) { $check_item = DB::table("\x73\x65\141\154\163")->select("\x49\104")->where("\123\x65\x61\154\x5f\116\x6f", $seal_no)->where("\x73\164\141\164\x75\x73", 0)->where("\x63\x6f\x6d\155\x61\x6e\x64\145\x72", $citid)->get(); if (count($check_item) == 1) { $return_seal = DB::table("\163\x65\x61\154\x73")->where("\123\145\x61\x6c\137\x4e\157", $seal_no)->update(array("\143\157\155\x6d\141\x6e\x64\x65\162" => null)); $save_history = DB::table("\163\x65\x61\154\x5f\150\151\x73\164\x6f\x72\x79")->insert(array("\x73\x65\141\154" => $seal_no, "\141\x64\155\151\156" => $userid, "\143\157\155\155\141\x6e\144\145\x72" => $citid, "\x61\143\164\x69\166\151\x74\171" => 2, "\143\x72\x65\141\x74\145\x64\137\x61\x74" => date("\131\x2d\155\55\x64\x20\110\x3a\151\x3a\163"))); $response = array("\123\164\x61\x74\x75\163" => 1, "\155\145\163\x73\x61\147\x65" => "\x52\x65\x74\x75\162\156\145\144"); } else { $response = array("\x53\164\x61\x74\165\x73" => 0, "\155\x65\163\x73\x61\x67\x65" => "\x49\x6e\166\141\x6c\151\x64\x20\x53\145\141\x6c"); } } else { $response = array("\x53\x74\141\164\x75\163" => 0, "\155\x65\x73\163\141\x67\145" => "\x49\156\x76\141\154\x69\144\40\x55\163\x65\x72\x73"); } } else { $response = array("\123\x74\141\x74\x75\163" => 0, "\155\x65\x73\163\141\147\145" => "\x4d\111\163\163\x69\156\147\40\151\x6e\x66\x6f\x72\155\141\164\x69\x6f\x6e"); } $logger->Log("\123\145\141\x6c\x20\x52\145\x74\x75\x72\156\x65\144", $userid, json_encode($response), $request); return json_encode($response); } }

Function Calls

None

Variables

None

Stats

MD5 a4bf8c968979219b54f59a946805e098
Eval Count 0
Decode Time 117 ms