<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-05-27 11:01:57
 namespace App\Http\Controllers\Admin; use App\PointTable; use App\Http\Controllers\Controller; use App\Http\Resources\Admin\PointTableResource; use Illuminate\Http\Request; use Illuminate\Support\Arr; use Validator; class PointTableController extends Controller { const ITEM_PER_PAGE = 100; public function index(Request $request) { goto Aeamf; Aeamf: $JEVia = $request->all(); $dkecP = Arr::get($JEVia, "\x6c\151\x6d\151\164", static::ITEM_PER_PAGE); $HEVfx = Arr::get($JEVia, "\x6b\x65\x79\167\157\x72\144", null); goto C0U4J; aEwGo: GyBNX: $mABZd->orderBy("\171\145\141\162\x73"); return PointTableResource::collection($mABZd->paginate($dkecP)); goto LJOtW; C0U4J: $mABZd = PointTable::query(); if (empty($HEVfx)) { goto GyBNX; } $mABZd->where(function ($Ia0Ho) use($HEVfx) { $Ia0Ho->where("\x79\145\x61\162\163", "\x4c\111\113\x45", "\45" . $HEVfx . "\45")->orWhere("\160\157\151\x6e\164\x73", "\x4c\111\x4b\x45", "\x25" . $HEVfx . "\x25")->orWhere("\x74\x6f\164\141\x6c\137\x70\x6f\151\x6e\x74\x73", "\114\x49\113\x45", "\x25" . $HEVfx . "\45"); }); goto aEwGo; LJOtW: } public function all() { return PointTableResource::collection(PointTable::orderBy("\164\x79\x70\145")->orderBy("\171\x65\141\x72\x73")->get()); } public function active(Request $request) { $kJhDj = $request->get("\144\x61\x74\145", now()); return PointTableResource::collection(PointTable::active($kJhDj)->get()); } public function show($p9HV0 = 0) { $b0CMb = PointTable::findOrFail($p9HV0); return new PointTableResource($b0CMb); } public function store(Request $request) { goto TQZbm; HUT5x: $b0CMb = PointTable::create(["\x79\145\141\x72\163" => $params["\171\x65\x61\162\x73"], "\x70\157\151\x6e\x74\x73" => $params["\x70\157\x69\156\x74\x73"], "\156\157\x74\x65" => $params["\x6e\157\164\x65"] ?? null, "\x63\162\x65\141\164\145\x64\137\x62\171" => auth()->id()]); $this->reloadTotalPoint(); return new PointTableResource($b0CMb); goto Y5kj3; K6A7i: nMTP7: $params = $request->all(); $SN57T = PointTable::where("\171\145\x61\x72\163", $params["\x79\x65\141\x72\x73"])->count(); goto DdC4f; TQZbm: $bAyGy = Validator::make($request->all(), ["\171\x65\141\162\163" => ["\162\x65\x71\x75\151\x72\x65\144", "\151\x6e\x74\x65\147\x65\x72", "\x6d\x69\156\72\x31"], "\160\x6f\151\156\x74\163" => ["\x72\145\x71\165\151\x72\x65\x64", "\x6e\165\x6d\145\162\x69\143", "\x6d\x69\156\72\60"]]); if (!$bAyGy->fails()) { goto nMTP7; } return response()->json(["\x65\x72\x72\157\x72\163" => $bAyGy->errors()], 403); goto K6A7i; DdC4f: if (!($SN57T > 0)) { goto n0DsK; } return response()->json(["\x65\162\162\157\x72\163" => "\116\x75\x6d\x62\145\x72\40\157\x66\x20\x79\145\x61\162\x73\x20\x77\157\162\153\x69\x6e\x67\x20\x68\141\166\x65\x20\x65\170\x69\163\x74\145\x64"], 403); n0DsK: goto HUT5x; Y5kj3: } public function update(Request $request, $p9HV0 = 0) { goto UC5HP; gXYbJ: qS2Lc: $b0CMb = PointTable::findOrFail($p9HV0); $params = $request->all(); goto xy7DM; smoNP: return response()->json(null, 204); goto fF6lK; xy7DM: $SN57T = PointTable::where("\171\145\141\x72\x73", $params["\x79\x65\141\162\x73"])->where("\151\x64", "\41\x3d", $p9HV0)->count(); if (!($SN57T > 0)) { goto ImEYg; } return response()->json(["\x65\162\162\157\x72\x73" => "\x4e\x75\x6d\142\x65\x72\x20\157\146\x20\171\x65\x61\x72\163\x20\x77\x6f\162\153\x69\x6e\147\40\150\141\x76\145\x20\x65\170\151\163\164\x65\x64"], 403); goto m4Hkg; m4Hkg: ImEYg: $b0CMb->update(["\171\145\141\x72\x73" => $params["\171\145\x61\162\x73"], "\x70\157\x69\156\x74\x73" => $params["\x70\x6f\151\x6e\x74\163"], "\156\157\x74\145" => $params["\x6e\157\x74\145"] ?? null]); $this->reloadTotalPoint(); goto smoNP; UC5HP: $bAyGy = Validator::make($request->all(), ["\171\145\141\162\x73" => ["\x72\x65\x71\165\x69\x72\145\x64", "\151\x6e\164\145\147\145\x72", "\x6d\x69\156\72\x30"], "\x70\157\151\x6e\x74\x73" => ["\162\x65\161\165\151\162\x65\144", "\x6e\x75\x6d\145\162\x69\x63", "\155\151\x6e\x3a\60"]]); if (!$bAyGy->fails()) { goto qS2Lc; } return response()->json(["\145\x72\x72\x6f\x72\163" => $bAyGy->errors()], 403); goto gXYbJ; fF6lK: } public function destroy($p9HV0 = 0) { $b0CMb = PointTable::findOrFail($p9HV0); $b0CMb->delete(); $this->reloadTotalPoint(); return response()->json(null, 204); } private function reloadTotalPoint() { $btRth = PointTable::select("\171\145\x61\x72\x73", "\160\x6f\x69\156\164\x73")->orderBy("\171\145\141\x72\x73")->pluck("\x70\x6f\151\x6e\164\163", "\x79\x65\141\x72\163")->toArray(); $wYS0i = PointTable::select("\52")->orderBy("\171\x65\141\162\163")->get(); foreach ($wYS0i as $sZql1) { $Hc72y = 0; foreach ($btRth as $Lq7tB => $rVPC4) { if (!($Lq7tB <= $sZql1->years)) { goto DSmvp; } $Hc72y += $rVPC4; DSmvp: i_FkN: } tYJHK: $sZql1->update(["\x74\x6f\164\141\x6c\137\160\157\x69\156\x74\x73" => $Hc72y]); hAotO: } idmex: } }