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.\xa                                        Find the Attached PDF file for more details. <p>{$footer}</p>"; $table_details = "<table style="border-collapse: collapse; width: 100%;">\xa                    <thead >
                        <tr  style="background-color: #FFAE42;color: white;text-align: center; padding: 8px;" >\xa                             
                            <th >Box No.</th>
                            <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%;" >\xa                    <thead>
                        <tr style="background-color: #FFAE42;color: white;text-align: center; padding: 8px;">
                             \xa                            <th>Box No.</th>
                            <th>Seal No.</th>\xa                        </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>"; $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%;"  >
                    <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>\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>"; $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>
                            <th>Seal No.</th>\xa                        </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($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}'\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

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

Function Calls

None

Variables

None

Stats

MD5 ff3912c2ce7463f837aa6426c58ece8f
Eval Count 0
Decode Time 95 ms