Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

namespace App\Http\Controllers\Seal; use App\Http\Controllers\Controller; use Illuminat..

Decoded Output download

<?   
 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}.\xa                        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>\xa                            <th>Seal No.</th>
                        </tr>\xa                    </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.\xa                        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;">\xa                             \xa                            <th>Box No.</th>
                            <th>Seal No.</th>\xa                        </tr>\xa                    </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>
                        <tr style="background-color: #FFAE42;color: white;text-align: center; padding: 8px;">\xa                             \xa                            <th>Box No.</th>\xa                            <th>Seal No.</th>
                        </tr>\xa                    </thead>\xa                    <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%;">
                    <thead>\xa                        <tr style="background-color: #FFAE42;color: white;text-align: center; padding: 8px;">
                             
                            <th>Box No.</th>\xa                            <th>Seal No.</th>
                        </tr>
                    </thead>\xa                    <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}'\xa                         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}'\xa                         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


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

Function Calls

None

Variables

None

Stats

MD5 cbeae46dea180df03e2839df4f2c31cb
Eval Count 0
Decode Time 129 ms