diff --git a/app/Extensions/PaymentGateways/PayPal/index.php b/app/Extensions/PaymentGateways/PayPal/index.php index 88abc8091..648913ae6 100644 --- a/app/Extensions/PaymentGateways/PayPal/index.php +++ b/app/Extensions/PaymentGateways/PayPal/index.php @@ -9,6 +9,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Redirect; +use Illuminate\Support\Facades\Log; use PayPalCheckoutSdk\Core\PayPalHttpClient; use PayPalCheckoutSdk\Core\ProductionEnvironment; use PayPalCheckoutSdk\Core\SandboxEnvironment; @@ -74,7 +75,7 @@ function PaypalPay(Request $request) "application_context" => [ "cancel_url" => route('payment.Cancel'), "return_url" => route('payment.PayPalSuccess', ['payment' => $payment->id]), - 'brand_name' => config('app.name', 'Laravel'), + 'brand_name' => config('app.name', 'Controlpanel.GG'), 'shipping_preference' => 'NO_SHIPPING' ] @@ -85,14 +86,23 @@ function PaypalPay(Request $request) // Call API with your client and get a response for your call $response = getPayPalClient()->execute($request); + // check for any errors in the response + if ($response->statusCode != 201) { + throw new \Exception($response->statusCode); + } + + // make sure the link is not empty + if (empty($response->result->links[1]->href)) { + throw new \Exception('No redirect link found'); + } + Redirect::away($response->result->links[1]->href)->send(); return; } catch (HttpException $ex) { - error_log($ex->statusCode); - error_log($ex->getMessage()); - + Log::error('PayPal Payment: ' . $ex->getMessage()); $payment->delete(); - Redirect::route('payment.Cancel'); + + Redirect::route('store.index')->with('error', __('Payment failed'))->send(); return; } } diff --git a/app/Http/Controllers/Admin/ServerController.php b/app/Http/Controllers/Admin/ServerController.php index 06d2cc22b..c10634711 100644 --- a/app/Http/Controllers/Admin/ServerController.php +++ b/app/Http/Controllers/Admin/ServerController.php @@ -14,6 +14,7 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Http\Response; +use Illuminate\Support\Facades\Log; class ServerController extends Controller { @@ -27,38 +28,6 @@ public function index() return view('admin.servers.index'); } - /** - * Show the form for creating a new resource. - * - * @return Response - */ - public function create() - { - // - } - - /** - * Store a newly created resource in storage. - * - * @param Request $request - * @return Response - */ - public function store(Request $request) - { - // - } - - /** - * Display the specified resource. - * - * @param Server $server - * @return Response - */ - public function show(Server $server) - { - // - } - /** * Show the form for editing the specified resource. * @@ -196,6 +165,8 @@ public function syncServers() public function dataTable(Request $request) { $query = Server::with(['user', 'product']); + + if ($request->has('product')) { $query->where('product_id', '=', $request->input('product')); } @@ -204,6 +175,9 @@ public function dataTable(Request $request) } $query->select('servers.*'); + Log::info($request->input('order')); + + return datatables($query) ->addColumn('user', function (Server $server) { return '' . $server->user->name . ''; @@ -232,7 +206,7 @@ public function dataTable(Request $request) '; }) ->addColumn('status', function (Server $server) { - $labelColor = $server->isSuspended() ? 'text-danger' : 'text-success'; + $labelColor = $server->suspended ? 'text-danger' : 'text-success'; return ''; }) diff --git a/app/Http/Controllers/Admin/ShopProductController.php b/app/Http/Controllers/Admin/ShopProductController.php index 0ff534fd8..655636f90 100644 --- a/app/Http/Controllers/Admin/ShopProductController.php +++ b/app/Http/Controllers/Admin/ShopProductController.php @@ -14,6 +14,7 @@ class ShopProductController extends Controller { + /** * Display a listing of the resource. * @@ -66,23 +67,12 @@ public function store(Request $request) 'display' => 'required|string|max:60', ]); - $disabled = ! is_null($request->input('disabled')); + $disabled = !is_null($request->input('disabled')); ShopProduct::create(array_merge($request->all(), ['disabled' => $disabled])); return redirect()->route('admin.store.index')->with('success', __('Store item has been created!')); } - /** - * Display the specified resource. - * - * @param ShopProduct $shopProduct - * @return Response - */ - public function show(ShopProduct $shopProduct) - { - // - } - /** * Show the form for editing the specified resource. * @@ -116,7 +106,7 @@ public function update(Request $request, ShopProduct $shopProduct) 'display' => 'required|string|max:60', ]); - $disabled = ! is_null($request->input('disabled')); + $disabled = !is_null($request->input('disabled')); $shopProduct->update(array_merge($request->all(), ['disabled' => $disabled])); return redirect()->route('admin.store.index')->with('success', __('Store item has been updated!')); @@ -129,7 +119,7 @@ public function update(Request $request, ShopProduct $shopProduct) */ public function disable(Request $request, ShopProduct $shopProduct) { - $shopProduct->update(['disabled' => ! $shopProduct->disabled]); + $shopProduct->update(['disabled' => !$shopProduct->disabled]); return redirect()->route('admin.store.index')->with('success', __('Product has been updated!')); } @@ -147,19 +137,20 @@ public function destroy(ShopProduct $shopProduct) return redirect()->back()->with('success', __('Store item has been removed!')); } - public function dataTable() + public function dataTable(Request $request) { $query = ShopProduct::query(); + return datatables($query) ->addColumn('actions', function (ShopProduct $shopProduct) { return ' - + -
- '.csrf_field().' - '.method_field('DELETE').' - + + ' . csrf_field() . ' + ' . method_field('DELETE') . ' +
'; }) @@ -167,12 +158,12 @@ public function dataTable() $checked = $shopProduct->disabled == false ? 'checked' : ''; return ' -
- '.csrf_field().' - '.method_field('PATCH').' + + ' . csrf_field() . ' + ' . method_field('PATCH') . '
- - + +
'; diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 329fe04c7..763490db1 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -26,6 +26,7 @@ class UserController extends Controller { + private Pterodactyl $pterodactyl; public function __construct(Pterodactyl $pterodactyl) @@ -132,7 +133,7 @@ public function update(Request $request, User $user) ]); } - if (! is_null($request->input('new_password'))) { + if (!is_null($request->input('new_password'))) { $request->validate([ 'new_password' => 'required|string|min:8', 'new_password_confirmation' => 'required|same:new_password', @@ -259,7 +260,7 @@ public function notify(Request $request) public function toggleSuspended(User $user) { try { - ! $user->isSuspended() ? $user->suspend() : $user->unSuspend(); + !$user->isSuspended() ? $user->suspend() : $user->unSuspend(); } catch (Exception $exception) { return redirect()->back()->with('error', $exception->getMessage()); } @@ -270,52 +271,45 @@ public function toggleSuspended(User $user) /** * @throws Exception */ - public function dataTable() + public function dataTable(Request $request) { - $query = User::with(['discordUser', 'servers'])->select('users.*'); + $query = User::with('discordUser')->withCount('servers'); + // manually count referrals in user_referrals table + $query->selectRaw('users.*, (SELECT COUNT(*) FROM user_referrals WHERE user_referrals.referral_id = users.id) as referrals_count'); + return datatables($query) ->addColumn('avatar', function (User $user) { - return ''; + return ''; }) ->addColumn('credits', function (User $user) { - return ' '.$user->credits(); + return ' ' . $user->credits(); }) ->addColumn('verified', function (User $user) { return $user->getVerifiedStatus(); }) - ->addColumn('servers', function (User $user) { - return $user->servers->count(); - }) - ->addColumn('referrals', function (User $user) { - return DB::table('user_referrals')->where('referral_id', '=', $user->id)->count(); - }) ->addColumn('discordId', function (User $user) { return $user->discordUser ? $user->discordUser->id : ''; }) - ->addColumn('last_seen', function (User $user) { - return ['display' => $user->last_seen ? $user->last_seen->diffForHumans() : '', - 'raw' => $user->last_seen ? strtotime($user->last_seen) : '', ]; - }) ->addColumn('actions', function (User $user) { $suspendColor = $user->isSuspended() ? 'btn-success' : 'btn-warning'; $suspendIcon = $user->isSuspended() ? 'fa-play-circle' : 'fa-pause-circle'; $suspendText = $user->isSuspended() ? __('Unsuspend') : __('Suspend'); return ' - - - - -
- '.csrf_field().' - -
-
- '.csrf_field().' - '.method_field('DELETE').' - -
+ + + + +
+ ' . csrf_field() . ' + +
+
+ ' . csrf_field() . ' + ' . method_field('DELETE') . ' + +
'; }) ->editColumn('role', function (User $user) { @@ -334,15 +328,15 @@ public function dataTable() break; } - return ''.$user->role.''; + return '' . $user->role . ''; + }) + ->editColumn('last_seen', function (User $user) { + return $user->last_seen ? $user->last_seen->diffForHumans() : __('Never'); }) ->editColumn('name', function (User $user) { - return ''.strip_tags($user->name).''; + return '' . strip_tags($user->name) . ''; }) - /*->orderColumn('last_seen', function ($query) { - $query->orderBy('last_seen', "desc"); - })*/ - ->rawColumns(['avatar', 'name', 'credits', 'role', 'usage', 'referrals', 'actions', 'last_seen']) - ->make(true); + ->rawColumns(['avatar', 'name', 'credits', 'role', 'usage', 'actions']) + ->make(); } } diff --git a/app/Http/Controllers/Moderation/TicketsController.php b/app/Http/Controllers/Moderation/TicketsController.php index be974ad2b..c927e6858 100644 --- a/app/Http/Controllers/Moderation/TicketsController.php +++ b/app/Http/Controllers/Moderation/TicketsController.php @@ -25,7 +25,12 @@ public function index() public function show($ticket_id) { + try { $ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail(); + } catch (Exception $e) + { + return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier')); + } $ticketcomments = $ticket->ticketcomments; $ticketcategory = $ticket->ticketcategory; $server = Server::where('id', $ticket->server)->first(); @@ -33,9 +38,20 @@ public function show($ticket_id) return view('moderator.ticket.show', compact('ticket', 'ticketcategory', 'ticketcomments', 'server')); } - public function close($ticket_id) + public function changeStatus($ticket_id) { + try { $ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail(); + } catch(Exception $e) + { + return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier')); + } + + if($ticket->status == "Closed"){ + $ticket->status = "Reopened"; + $ticket->save(); + return redirect()->back()->with('success', __('A ticket has been reopened, ID: #') . $ticket->ticket_id); + } $ticket->status = 'Closed'; $ticket->save(); $ticketOwner = $ticket->user; @@ -45,7 +61,13 @@ public function close($ticket_id) public function delete($ticket_id) { + try { $ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail(); + } catch (Exception $e) + { + return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier')); + } + TicketComment::where('ticket_id', $ticket->id)->delete(); $ticket->delete(); @@ -55,7 +77,11 @@ public function delete($ticket_id) public function reply(Request $request) { $this->validate($request, ['ticketcomment' => 'required']); - $ticket = Ticket::where('id', $request->input('ticket_id'))->firstOrFail(); + try { + $ticket = Ticket::where('id', $request->input('ticket_id'))->firstOrFail(); + } catch (Exception $e){ + return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier')); + } $ticket->status = 'Answered'; $ticket->update(); TicketComment::create([ @@ -63,7 +89,12 @@ public function reply(Request $request) 'user_id' => Auth::user()->id, 'ticketcomment' => $request->input('ticketcomment'), ]); + try { $user = User::where('id', $ticket->user_id)->firstOrFail(); + } catch(Exception $e) + { + return redirect()->back()->with('warning', __('User not found on the server. Check on the admin database or try again later.')); + } $newmessage = $request->input('ticketcomment'); $user->notify(new ReplyNotification($ticket, $user, $newmessage)); @@ -85,12 +116,16 @@ public function dataTable() return ''.$tickets->user->name.''; }) ->addColumn('actions', function (Ticket $tickets) { + $statusButtonColor = ($tickets->status == "Closed") ? 'btn-success' : 'btn-warning'; + $statusButtonIcon = ($tickets->status == "Closed") ? 'fa-redo' : 'fa-times'; + $statusButtonText = ($tickets->status == "Closed") ? __('Reopen') : __('Close'); + return ' -
+ '.csrf_field().' '.method_field('POST').' - +
'.csrf_field().' @@ -101,6 +136,7 @@ public function dataTable() }) ->editColumn('status', function (Ticket $tickets) { switch ($tickets->status) { + case 'Reopened': case 'Open': $badgeColor = 'badge-success'; break; @@ -135,8 +171,13 @@ public function blacklist() public function blacklistAdd(Request $request) { - $user = User::where('id', $request->user_id)->first(); + try { + $user = User::where('id', $request->user_id)->firstOrFail(); $check = TicketBlacklist::where('user_id', $user->id)->first(); + } + catch (Exception $e){ + return redirect()->back()->with('warning', __('User not found on the server. Check the admin database or try again later.')); + } if ($check) { $check->reason = $request->reason; $check->status = 'True'; @@ -163,7 +204,12 @@ public function blacklistDelete($id) public function blacklistChange($id) { - $blacklist = TicketBlacklist::where('id', $id)->first(); + try { + $blacklist = TicketBlacklist::where('id', $id)->first(); + } + catch (Exception $e){ + return redirect()->back()->with('warning', __('User not found on the server. Check the admin database or try again later.')); + } if ($blacklist->status == 'True') { $blacklist->status = 'False'; } else { diff --git a/app/Http/Controllers/TicketsController.php b/app/Http/Controllers/TicketsController.php index 2477d729f..3b2571c02 100644 --- a/app/Http/Controllers/TicketsController.php +++ b/app/Http/Controllers/TicketsController.php @@ -26,53 +26,50 @@ public function index() return view('ticket.index', compact('tickets', 'ticketcategories')); } - public function create() - { - //check in blacklist - $check = TicketBlacklist::where('user_id', Auth::user()->id)->first(); - if ($check && $check->status == 'True') { - return redirect()->route('ticket.index')->with('error', __("You can't make a ticket because you're on the blacklist for a reason: '".$check->reason."', please contact the administrator")); - } - $ticketcategories = TicketCategory::all(); - $servers = Auth::user()->servers; - - return view('ticket.create', compact('ticketcategories', 'servers')); - } - public function store(Request $request) { $this->validate($request, [ - 'title' => 'required', - 'ticketcategory' => 'required', - 'priority' => 'required', - 'message' => 'required', ] + 'title' => 'required', + 'ticketcategory' => 'required', + 'priority' => 'required', + 'message' => 'required',] ); $ticket = new Ticket([ - 'title' => $request->input('title'), - 'user_id' => Auth::user()->id, - 'ticket_id' => strtoupper(Str::random(8)), - 'ticketcategory_id' => $request->input('ticketcategory'), - 'priority' => $request->input('priority'), - 'message' => $request->input('message'), - 'status' => 'Open', - 'server' => $request->input('server'), ] + 'title' => $request->input('title'), + 'user_id' => Auth::user()->id, + 'ticket_id' => strtoupper(Str::random(8)), + 'ticketcategory_id' => $request->input('ticketcategory'), + 'priority' => $request->input('priority'), + 'message' => $request->input('message'), + 'status' => 'Open', + 'server' => $request->input('server'),] ); $ticket->save(); $user = Auth::user(); - if(config('SETTINGS::TICKET:NOTIFY') == "all"){ $admin = User::where('role', 'admin')->orWhere('role', 'mod')->get();} - if(config('SETTINGS::TICKET:NOTIFY') == "admin"){ $admin = User::where('role', 'admin')->get();} - if(config('SETTINGS::TICKET:NOTIFY') == "moderator"){ $admin = User::where('role', 'mod')->get();} + if (config('SETTINGS::TICKET:NOTIFY') == "all") { + $admin = User::where('role', 'admin')->orWhere('role', 'mod')->get(); + } + if (config('SETTINGS::TICKET:NOTIFY') == "admin") { + $admin = User::where('role', 'admin')->get(); + } + if (config('SETTINGS::TICKET:NOTIFY') == "moderator") { + $admin = User::where('role', 'mod')->get(); + } $user->notify(new CreateNotification($ticket)); - if(config('SETTINGS::TICKET:NOTIFY') != "none"){ + if (config('SETTINGS::TICKET:NOTIFY') != "none") { Notification::send($admin, new AdminCreateNotification($ticket, $user)); } - return redirect()->route('ticket.index')->with('success', __('A ticket has been opened, ID: #').$ticket->ticket_id); + return redirect()->route('ticket.index')->with('success', __('A ticket has been opened, ID: #') . $ticket->ticket_id); } public function show($ticket_id) { - $ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail(); + try { + $ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail(); + } catch (Exception $e) { + return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier')); + } $ticketcomments = $ticket->ticketcomments; $ticketcategory = $ticket->ticketcategory; $server = Server::where('id', $ticket->server)->first(); @@ -85,10 +82,14 @@ public function reply(Request $request) //check in blacklist $check = TicketBlacklist::where('user_id', Auth::user()->id)->first(); if ($check && $check->status == 'True') { - return redirect()->route('ticket.index')->with('error', __("You can't reply a ticket because you're on the blacklist for a reason: '".$check->reason."', please contact the administrator")); + return redirect()->route('ticket.index')->with('error', __("You can't reply a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator")); } $this->validate($request, ['ticketcomment' => 'required']); - $ticket = Ticket::where('id', $request->input('ticket_id'))->firstOrFail(); + try { + $ticket = Ticket::where('id', $request->input('ticket_id'))->firstOrFail(); + } catch (Exception $e) { + return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier')); + } $ticket->status = 'Client Reply'; $ticket->update(); $ticketcomment = TicketComment::create([ @@ -104,9 +105,32 @@ public function reply(Request $request) return redirect()->back()->with('success', __('Your comment has been submitted')); } - public function close($ticket_id) + + public function create() { - $ticket = Ticket::where('user_id', Auth::user()->id)->where("ticket_id", $ticket_id)->firstOrFail(); + //check in blacklist + $check = TicketBlacklist::where('user_id', Auth::user()->id)->first(); + if ($check && $check->status == 'True') { + return redirect()->route('ticket.index')->with('error', __("You can't make a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator")); + } + $ticketcategories = TicketCategory::all(); + $servers = Auth::user()->servers; + + return view('ticket.create', compact('ticketcategories', 'servers')); + } + + public function changeStatus($ticket_id) + { + try { + $ticket = Ticket::where('user_id', Auth::user()->id)->where("ticket_id", $ticket_id)->firstOrFail(); + } catch (Exception $e) { + return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier')); + } + if ($ticket->status == "Closed") { + $ticket->status = "Reopened"; + $ticket->save(); + return redirect()->back()->with('success', __('A ticket has been reopened, ID: #') . $ticket->ticket_id); + } $ticket->status = "Closed"; $ticket->save(); return redirect()->back()->with('success', __('A ticket has been closed, ID: #') . $ticket->ticket_id); @@ -121,10 +145,11 @@ public function dataTable() return $tickets->ticketcategory->name; }) ->editColumn('title', function (Ticket $tickets) { - return ''.'#'.$tickets->ticket_id.' - '.htmlspecialchars($tickets->title).''; + return '' . '#' . $tickets->ticket_id . ' - ' . htmlspecialchars($tickets->title) . ''; }) ->editColumn('status', function (Ticket $tickets) { switch ($tickets->status) { + case 'Reopened': case 'Open': $badgeColor = 'badge-success'; break; @@ -139,7 +164,7 @@ public function dataTable() break; } - return ''.$tickets->status.''; + return '' . $tickets->status . ''; }) ->editColumn('priority', function (Ticket $tickets) { return __($tickets->priority); @@ -149,12 +174,16 @@ public function dataTable() 'raw' => $tickets->updated_at ? strtotime($tickets->updated_at) : '']; }) ->addColumn('actions', function (Ticket $tickets) { + $statusButtonColor = ($tickets->status == "Closed") ? 'btn-success' : 'btn-warning'; + $statusButtonIcon = ($tickets->status == "Closed") ? 'fa-redo' : 'fa-times'; + $statusButtonText = ($tickets->status == "Closed") ? __('Reopen') : __('Close'); + return ' - - - '.csrf_field().' - '.method_field('POST').' - + + + ' . csrf_field() . ' + ' . method_field('POST') . ' +
diff --git a/public/themes/BlueInfinity/app.css b/public/themes/BlueInfinity/app.css index 898ee94ca..7ad8941fe 100644 --- a/public/themes/BlueInfinity/app.css +++ b/public/themes/BlueInfinity/app.css @@ -1 +1 @@ -@import "default.css";.layout-fixed .wrapper .sidebar{ height:calc(100vh - 3.5rem - 1px);background:radial-gradient(#061b29,black);}body:not(.sidebar-mini-md) .content-wrapper,body:not(.sidebar-mini-md) .main-footer,body:not(.sidebar-mini-md) .main-header{ transition:margin-left .3s ease-in-out;margin-left:250px;background:radial-gradient(#061b29,black);}[class*=sidebar-dark] .brand-link,[class*=sidebar-dark] .brand-link .pushmenu{ color:hsla(0,0%,100%,.8);background:radial-gradient(#061b29,black);}.main-sidebar .brand-text,.main-sidebar .logo-xl,.main-sidebar .logo-xs,.sidebar .nav-link p,.sidebar .user-panel .info{ transition:margin-left .3s linear,opacity .3s ease,visibility .3s ease;color:#d3d3d3;}.sidebar-dark-primary .nav-sidebar>.nav-item>.nav-link.active,.sidebar-light-primary .nav-sidebar>.nav-item>.nav-link.active{ color:#fff;background:radial-gradient(#1b4b61,#fd030300);border-radius:50px;}.dark-mode .card{ background-color:#00000000;color:#ffffff99;border-width:3px;border-color:#f7f7f7;border-style:double;border-radius:15px;}.btn-info{ color:#ffffff;background-color:#b8171700;border-color:#ffffff;box-shadow:none;}.btn-warning{ color:#ffffff;background-color:#ffc10700;border-color:#ffffff;box-shadow:none;}.card-title{ float:left;font-size:1.1rem;font-weight:400;margin:0;color:white;}.dark-mode .text-muted{ color:#ffffff99!important;}.dark-mode .list-group-item{ background-color:#343a4000;border-color:#ffffff99;}.dark-mode .info-box{ background-color:#343a4000;color:#fff;border:3px;border-style:double;border-radius:15px;border-color:white;}label:not(.form-check-label):not(.custom-file-label){ font-weight:700;color:#ffffffc2;}.dark-mode .custom-control-label:before,.dark-mode .custom-file-label,.dark-mode .custom-file-label:after,.dark-mode .custom-select,.dark-mode .form-control,.dark-mode .input-group-text{ background-color:#007af400;color:#828282;}.alert-success{ color:#fff;background-color:#28a745;border-color:#ffffff;border-radius:15px;border-style:double;}.dark-mode{ color:#fff;background:radial-gradient(#061b29,black);}.dark-mode .invoice{ background-color:#343a4000;border:3px;border-radius:15px;border-color:white;border:double;}.dark-mode .nav-tabs .nav-item.show .nav-link,.dark-mode .nav-tabs .nav-link.active{ background-color:#ffffff1c;color:#fff;}.slim-crop-area img,.slim-image-editor img,.slim-popover img,.slim img{ background:black;}.dark-mode .callout{ background-color:#00ff0333;}.callout.callout-info{ border-left-color:#00e11d;}.p-3{ padding:1rem!important;background:#061b29;}.small-box>.small-box-footer{ color:hsla(0,0%,100%,.8);display:block;padding:3px 0;position:relative;text-align:center;text-decoration:none;z-index:10;background:#061b29;}.dark-mode .dropdown-menu{ background-color:#061b29;border-color:white;}.card-header:first-child{ border-radius:14px 14px 0px 0px;background:#061b29;}.card-body{ flex:1 1 auto;min-height:1px;padding:1.25rem;background:#061b29;}.justify-content-between{ justify-content:space-between!important;background:#061b29;}.dark-mode .card .card-footer{ background-color:#061b29;border-radius:0px 0px 14px 14px;}.dark-mode .select2-selection--single{ background-color:#061b29;border-color:#6c757d;}.select2-search--dropdown{ display:block;padding:4px;background:#061b29;}.select2-container--default .select2-results__option{ padding:6px 12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:blue;background:#061b29;}.dark-mode .select2-dropdown,.dark-mode .select2-dropdown .select2-search__field,.dark-mode .select2-search--inline .select2-search__field{ background-color:#061b29;border-color:#ffffff;color:#fff;}.modal-header{ background:#061b29;}.modal-body{ position:relative;flex:1 1 auto;padding:1rem;background:#061b29;}.dark-mode .modal-footer,.dark-mode .modal-header{ border-color:#ffffff;background:#061b29;} +@import "default.css";.layout-fixed .wrapper .sidebar{ height:calc(100vh - 3.5rem - 1px);background:radial-gradient(#061b29,black);}body:not(.sidebar-mini-md) .content-wrapper,body:not(.sidebar-mini-md) .main-footer,body:not(.sidebar-mini-md) .main-header{ transition:margin-left .3s ease-in-out;background:radial-gradient(#061b29,black);}[class*=sidebar-dark] .brand-link,[class*=sidebar-dark] .brand-link .pushmenu{ color:hsla(0,0%,100%,.8);background:radial-gradient(#061b29,black);}.main-sidebar .brand-text,.main-sidebar .logo-xl,.main-sidebar .logo-xs,.sidebar .nav-link p,.sidebar .user-panel .info{ transition:margin-left .3s linear,opacity .3s ease,visibility .3s ease;color:#d3d3d3;}.sidebar-dark-primary .nav-sidebar>.nav-item>.nav-link.active,.sidebar-light-primary .nav-sidebar>.nav-item>.nav-link.active{ color:#fff;background:radial-gradient(#1b4b61,#fd030300);border-radius:50px;}.dark-mode .card{ background-color:#00000000;color:#ffffff99;border-width:3px;border-color:#f7f7f7;border-style:double;border-radius:15px;}.btn-info{ color:#ffffff;background-color:#b8171700;border-color:#ffffff;box-shadow:none;}.btn-warning{ color:#ffffff;background-color:#ffc10700;border-color:#ffffff;box-shadow:none;}.card-title{ float:left;font-size:1.1rem;font-weight:400;margin:0;color:white;}.dark-mode .text-muted{ color:#ffffff99!important;}.dark-mode .list-group-item{ background-color:#343a4000;border-color:#ffffff99;}.dark-mode .info-box{ background-color:#343a4000;color:#fff;border:3px;border-style:double;border-radius:15px;border-color:white;}label:not(.form-check-label):not(.custom-file-label){ font-weight:700;color:#ffffffc2;}.dark-mode .custom-control-label:before,.dark-mode .custom-file-label,.dark-mode .custom-file-label:after,.dark-mode .custom-select,.dark-mode .form-control,.dark-mode .input-group-text{ background-color:#007af400;color:#828282;}.alert-success{ color:#fff;background-color:#28a745;border-color:#ffffff;border-radius:15px;border-style:double;}.dark-mode{ color:#fff;background:radial-gradient(#061b29,black);}.dark-mode .invoice{ background-color:#343a4000;border:3px;border-radius:15px;border-color:white;border:double;}.dark-mode .nav-tabs .nav-item.show .nav-link,.dark-mode .nav-tabs .nav-link.active{ background-color:#ffffff1c;color:#fff;}.slim-crop-area img,.slim-image-editor img,.slim-popover img,.slim img{ background:black;}.dark-mode .callout{ background-color:#00ff0333;}.callout.callout-info{ border-left-color:#00e11d;}.p-3{ padding:1rem!important;background:#061b29;}.small-box>.small-box-footer{ color:hsla(0,0%,100%,.8);display:block;padding:3px 0;position:relative;text-align:center;text-decoration:none;z-index:10;background:#061b29;}.dark-mode .dropdown-menu{ background-color:#061b29;border-color:white;}.card-header:first-child{ border-radius:14px 14px 0px 0px;background:#061b29;}.card-body{ flex:1 1 auto;min-height:1px;padding:1.25rem;background:#061b29;}.justify-content-between{ justify-content:space-between!important;background:#061b29;}.dark-mode .card .card-footer{ background-color:#061b29;border-radius:0px 0px 14px 14px;}.dark-mode .select2-selection--single{ background-color:#061b29;border-color:#6c757d;}.select2-search--dropdown{ display:block;padding:4px;background:#061b29;}.select2-container--default .select2-results__option{ padding:6px 12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:blue;background:#061b29;}.dark-mode .select2-dropdown,.dark-mode .select2-dropdown .select2-search__field,.dark-mode .select2-search--inline .select2-search__field{ background-color:#061b29;border-color:#ffffff;color:#fff;}.modal-header{ background:#061b29;}.modal-body{ position:relative;flex:1 1 auto;padding:1rem;background:#061b29;}.dark-mode .modal-footer,.dark-mode .modal-header{ border-color:#ffffff;background:#061b29;} diff --git a/routes/web.php b/routes/web.php index c86a0c66c..fbbdb0283 100644 --- a/routes/web.php +++ b/routes/web.php @@ -113,7 +113,7 @@ Route::post('ticket/new', [TicketsController::class, 'store'])->middleware(['throttle:ticket-new'])->name('ticket.new.store'); Route::get('ticket/show/{ticket_id}', [TicketsController::class, 'show'])->name('ticket.show'); Route::post('ticket/reply', [TicketsController::class, 'reply'])->middleware(['throttle:ticket-reply'])->name('ticket.reply'); - Route::post('ticket/close/{ticket_id}', [TicketsController::class, 'close'])->name('ticket.close'); + Route::post('ticket/status/{ticket_id}', [TicketsController::class, 'changeStatus'])->name('ticket.changeStatus'); } //admin @@ -211,7 +211,7 @@ Route::get('ticket/datatable', [ModTicketsController::class, 'datatable'])->name('ticket.datatable'); Route::get('ticket/show/{ticket_id}', [ModTicketsController::class, 'show'])->name('ticket.show'); Route::post('ticket/reply', [ModTicketsController::class, 'reply'])->name('ticket.reply'); - Route::post('ticket/close/{ticket_id}', [ModTicketsController::class, 'close'])->name('ticket.close'); + Route::post('ticket/status/{ticket_id}', [ModTicketsController::class, 'changeStatus'])->name('ticket.changeStatus'); Route::post('ticket/delete/{ticket_id}', [ModTicketsController::class, 'delete'])->name('ticket.delete'); //ticket moderation blacklist Route::get('ticket/blacklist', [ModTicketsController::class, 'blacklist'])->name('ticket.blacklist'); diff --git a/themes/BlueInfinity/views/layouts/main.blade.php b/themes/BlueInfinity/views/layouts/main.blade.php index c4ba7cd87..f5d888d5a 100644 --- a/themes/BlueInfinity/views/layouts/main.blade.php +++ b/themes/BlueInfinity/views/layouts/main.blade.php @@ -441,7 +441,7 @@ class="nav-link @if (Request::routeIs('admin.activitylogs.*')) active @endif"> Copyright © 2021-{{ date('Y') }} {{ env('APP_NAME', 'Laravel') }}. All rights - reserved. Powered by ControlPanel. + reserved. Powered by ControlPanel. | Theme by 2IceCube @if (!str_contains(config('BRANCHNAME'), 'main') && !str_contains(config('BRANCHNAME'), 'unknown')) Version {{ config('app')['version'] }} - {{ config('BRANCHNAME') }} @endif diff --git a/themes/default/views/admin/servers/table.blade.php b/themes/default/views/admin/servers/table.blade.php index b71671de8..29d080fd7 100644 --- a/themes/default/views/admin/servers/table.blade.php +++ b/themes/default/views/admin/servers/table.blade.php @@ -1,15 +1,15 @@ - - - - - - - - - - + + + + + + + + + + @@ -17,30 +17,53 @@ - - - @endsection diff --git a/themes/default/views/admin/users/index.blade.php b/themes/default/views/admin/users/index.blade.php index b6be7a746..c19121850 100644 --- a/themes/default/views/admin/users/index.blade.php +++ b/themes/default/views/admin/users/index.blade.php @@ -6,12 +6,13 @@
-

{{__('Users')}}

+

{{ __('Users') }}

@@ -27,9 +28,9 @@
-
{{__('Users')}}
- {{__('Notify')}} +
{{ __('Users') }}
+ {{ __('Notify') }}
@@ -37,21 +38,21 @@ class="fas fa-paper-plane mr-1">{{__('Notify')}}
{{__('Name')}}{{__('User')}}{{__('Server id')}}{{__('Config')}}{{__('Suspended at')}}{{__('Created at')}}
{{ __('Name') }}{{ __('User') }}{{ __('Server id') }}{{ __('Config') }}{{ __('Suspended at') }}{{ __('Created at') }}
- - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -68,41 +69,75 @@ class="fas fa-paper-plane mr-1">{{__('Notify')}} - - - @endsection diff --git a/themes/default/views/moderator/ticket/show.blade.php b/themes/default/views/moderator/ticket/show.blade.php index 13711dd0c..dda8c1f92 100644 --- a/themes/default/views/moderator/ticket/show.blade.php +++ b/themes/default/views/moderator/ticket/show.blade.php @@ -44,6 +44,9 @@ @case("Open") {{__("Open")}} @break + @case("Reopened") + {{__("Reopened")}} + @break @case("Closed") {{__("Closed")}} @break @@ -61,21 +64,35 @@ {{__("Low")}} @break @case("Medium") - {{__("Closed")}} + {{__("Medium")}} @break @case("High") - {{__("Answered")}} + {{__("High")}} @break @endswitch

{{__("Created on")}}: {{ $ticket->created_at->diffForHumans() }}

- @if($ticket->status!='Closed') - - {{csrf_field()}} - {{method_field("POST") }} - - - @endif + @if($ticket->status=='Closed') + + {{csrf_field()}} + {{method_field("POST") }} + + + @else + + {{csrf_field()}} + {{method_field("POST") }} + + + @endif diff --git a/themes/default/views/ticket/show.blade.php b/themes/default/views/ticket/show.blade.php index 96a3b46bd..7401038fd 100644 --- a/themes/default/views/ticket/show.blade.php +++ b/themes/default/views/ticket/show.blade.php @@ -35,43 +35,58 @@
@if(!empty($server)) -

{{__("Server")}}: {{ $server->name }}

+

{{__("Server")}}: {{ $server->name }}

@endif -

{{__("Title")}}: {{ $ticket->title }}

-

{{__("Category")}}: {{ $ticketcategory->name }}

-

{{__("Status")}}: - @switch($ticket->status) - @case("Open") - {{__("Open")}} - @break - @case("Closed") - {{__("Closed")}} - @break - @case("Answered") - {{__("Answered")}} - @break - @case("Client Reply") - {{__("Client Reply")}} - @break - @endswitch -

-

Priority: - @switch($ticket->priority) - @case("Low") - {{__("Low")}} - @break - @case("Medium") - {{__("Closed")}} - @break - @case("High") - {{__("Answered")}} - @break - @endswitch -

+

{{__("Title")}}: {{ $ticket->title }}

+

{{__("Category")}}: {{ $ticketcategory->name }}

+

{{__("Status")}}: + @switch($ticket->status) + @case("Open") + {{__("Open")}} + @break + @case("Reopened") + {{__("Reopened")}} + @break + @case("Closed") + {{__("Closed")}} + @break + @case("Answered") + {{__("Answered")}} + @break + @case("Client Reply") + {{__("Client Reply")}} + @break + @endswitch +

+

Priority: + @switch($ticket->priority) + @case("Low") + {{__("Low")}} + @break + @case("Medium") + {{__("Medium")}} + @break + @case("High") + {{__("High")}} + @break + @endswitch +

{{__("Created on")}}: {{ $ticket->created_at->diffForHumans() }}

- @if($ticket->status!='Closed') + @if($ticket->status=='Closed')
+ action="{{route('ticket.changeStatus', ['ticket_id' => $ticket->ticket_id ])}}"> + {{csrf_field()}} + {{method_field("POST") }} + + + @else +
{{csrf_field()}} {{method_field("POST") }}
User Image - {{ $ticket->user->name }} - @if($ticket->user->role === "member") - Member - @elseif ($ticket->user->role === "client") - Client - @elseif ($ticket->user->role === "moderator") - Moderator - @elseif ($ticket->user->role === "admin") - Admin - @endif + src="https://www.gravatar.com/avatar/{{ md5(strtolower($ticket->user->email)) }}?s=25" + class="user-image" alt="User Image"> + {{ $ticket->user->name }} + @if($ticket->user->role === "member") + Member + @elseif ($ticket->user->role === "client") + Client + @elseif ($ticket->user->role === "moderator") + Moderator + @elseif ($ticket->user->role === "admin") + Admin + @endif
- {{ $ticket->created_at->diffForHumans() }} + {{ $ticket->created_at->diffForHumans() }}
{{ $ticket->message }}
@foreach ($ticketcomments as $ticketcomment) -
-
-
-
User Image - {{ $ticketcomment->user->name }} - @if($ticketcomment->user->role === "member") - Member - @elseif ($ticketcomment->user->role === "client") - Client - @elseif ($ticketcomment->user->role === "moderator") - Moderator - @elseif ($ticketcomment->user->role === "admin") - Admin - @endif -
- {{ $ticketcomment->created_at->diffForHumans() }} +
+
+
+
User Image + {{ $ticketcomment->user->name }} + @if($ticketcomment->user->role === "member") + Member + @elseif ($ticketcomment->user->role === "client") + Client + @elseif ($ticketcomment->user->role === "moderator") + Moderator + @elseif ($ticketcomment->user->role === "admin") + Admin + @endif +
+ {{ $ticketcomment->created_at->diffForHumans() }} +
+
{{ $ticketcomment->ticketcomment }}
-
{{ $ticketcomment->ticketcomment }}
-
@endforeach
{!! csrf_field() !!}
- + @if ($errors->has('ticketcomment')) - + {{ $errors->first('ticketcomment') }} @endif
discordIdippterodactyl_id{{__('Avatar')}}{{__('Name')}}{{__('Role')}}{{__('Email')}}{{CREDITS_DISPLAY_NAME}}{{__('Servers')}}{{__("Referrals")}}{{__('Verified')}}{{__('Last seen')}}
discordIdippterodactyl_id{{ __('Avatar') }}{{ __('Name') }}{{ __('Role') }}{{ __('Email') }}{{ CREDITS_DISPLAY_NAME }}{{ __('Servers') }}{{ __('Referrals') }}{{ __('Verified') }}{{ __('Last seen') }}