<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-05-27 11:01:55
 namespace App\Http\Controllers\Admin; use App\LeaveHistory; use App\LeaveType; use App\Http\Controllers\Controller; use App\Http\Resources\Admin\LeaveTypeResource; use Illuminate\Http\Request; use Illuminate\Support\Arr; use Validator; class LeaveTypeController extends Controller { const ITEM_PER_PAGE = 100; public function index(Request $request) { goto rpS5T; UsL3Q: $PCx5f = Arr::get($K5PiJ, "\153\145\x79\x77\x6f\x72\144", ''); $SrAuo = Arr::get($K5PiJ, "\x73\x74\x61\164\x75\163", ''); if (empty($PCx5f)) { goto I8nlg; } goto uu9ad; TmmD9: return LeaveTypeResource::collection($LGaa0->paginate($bSysd)); goto qXQ3f; nS1Uk: $LGaa0->where("\x69\163\137\x61\x63\x74\x69\x76\141\164\145\x64", $SrAuo); FWaGv: $LGaa0->orderBy("\164\145\156\x75\162\145\x5f\143\x61\154\x63\x75\154\x61\164\151\157\x6e\137\x72\x61\164\145", "\x64\145\163\143")->orderBy("\x69\144"); goto TmmD9; rpS5T: $K5PiJ = $request->all(); $LGaa0 = LeaveType::query(); $bSysd = Arr::get($K5PiJ, "\x6c\x69\155\151\x74", static::ITEM_PER_PAGE); goto UsL3Q; uu9ad: $LGaa0->where(function ($vqsPs) use($PCx5f) { $vqsPs->where("\156\141\x6d\145", "\114\x49\x4b\105", "\x25" . $PCx5f . "\45")->orWhere("\x63\157\144\x65", "\x4c\x49\x4b\105", "\45" . $PCx5f . "\x25"); }); I8nlg: if (!($SrAuo != null && $SrAuo != '' && ($SrAuo == "\60" || $SrAuo == "\x31"))) { goto FWaGv; } goto nS1Uk; qXQ3f: } public function all(Request $request) { $K5PiJ = $request->all(); $bSysd = Arr::get($K5PiJ, "\154\x69\x6d\151\164", static::ITEM_PER_PAGE); $LGaa0 = LeaveType::select("\x69\144", "\x6e\141\155\x65", "\x63\x6f\144\x65", "\x74\x65\156\165\162\145\137\x63\x61\154\143\x75\154\141\x74\x69\157\x6e\137\x72\141\x74\x65", "\x61\146\146\x65\143\164\x5f\164\145\156\165\x72\x65")->orderBy("\x74\145\156\x75\x72\x65\137\143\141\154\x63\x75\154\x61\x74\x69\157\x6e\137\x72\x61\x74\x65", "\x64\x65\163\x63")->orderBy("\x69\144"); return LeaveTypeResource::collection($LGaa0->paginate($bSysd)); } public function available(Request $request) { goto XNv1b; XNv1b: $WtYtB = Arr::get($request->all(), "\151\x67\x6e\x6f\162\x65\111\144", ''); $LGaa0 = LeaveType::select("\x69\x64", "\156\141\x6d\x65", "\143\x6f\x64\x65", "\164\x65\156\x75\162\145\x5f\x63\141\x6c\x63\x75\x6c\x61\164\151\x6f\156\137\x72\x61\164\145", "\141\x66\146\x65\143\164\x5f\x74\145\156\165\162\145")->where("\x69\x73\137\141\143\x74\151\x76\141\164\145\x64", true); if (!($WtYtB != null && $WtYtB != '')) { goto p6lEh; } goto ba40T; coX9J: return LeaveTypeResource::collection($LGaa0->get()); goto L3BW9; ba40T: $LGaa0->where("\151\x64", "\41\x3d", $WtYtB); p6lEh: $LGaa0->orderBy("\x74\x65\156\x75\x72\145\137\x63\141\x6c\143\x75\x6c\141\x74\x69\x6f\x6e\x5f\162\x61\x74\145", "\144\x65\x73\143")->orderBy("\151\144"); goto coX9J; L3BW9: } public function show($dKpqo = 0) { $zAQ0G = LeaveType::findOrFail($dKpqo); return new LeaveTypeResource($zAQ0G); } public function store(Request $request) { goto Lzj4v; Lzj4v: $B32GG = Validator::make($request->all(), ["\x6e\141\x6d\x65" => ["\x72\145\x71\165\151\162\145\144"], "\x63\157\x64\x65" => ["\162\x65\x71\x75\151\x72\x65\144", "\x75\156\151\x71\165\145\x3a\154\x65\x61\166\145\x5f\x74\x79\160\x65\163\x2c\143\157\144\145"], "\141\146\146\x65\143\164\137\x74\x65\156\165\x72\145" => ["\162\x65\161\165\151\x72\145\x64", "\x62\157\157\154\x65\x61\x6e"], "\164\x65\x6e\x75\162\145\x5f\143\141\154\x63\x75\x6c\x61\164\x69\157\156\137\162\141\164\x65" => ["\x72\x65\161\x75\151\162\145\144", "\x6e\x75\x6d\x65\x72\x69\x63", "\155\x69\x6e\72\60"], "\151\163\137\x61\143\164\x69\x76\141\x74\x65\144" => ["\x72\x65\161\165\151\162\x65\144", "\x62\157\x6f\154\x65\141\156"]]); if (!$B32GG->fails()) { goto dOWTm; } return response()->json(["\145\x72\x72\x6f\x72\x73" => $B32GG->errors()], 403); goto dsN2E; dsN2E: dOWTm: $params = $request->all(); $zAQ0G = LeaveType::create(["\156\141\x6d\x65" => $params["\156\141\155\145"], "\x63\157\144\145" => $params["\x63\157\144\145"], "\141\x66\146\x65\x63\x74\x5f\x74\x65\156\x75\162\145" => $params["\141\146\x66\x65\143\164\x5f\x74\145\156\165\162\x65"] === true ? 1 : 0, "\164\145\156\165\162\x65\x5f\x63\x61\154\x63\165\x6c\141\164\x69\x6f\x6e\x5f\162\141\164\145" => $params["\x74\x65\156\x75\162\x65\x5f\143\x61\154\x63\165\154\141\164\x69\157\156\137\x72\x61\164\145"], "\144\x65\x73\143\x72\x69\x70\164\151\x6f\156" => $params["\144\145\163\x63\162\x69\160\x74\151\x6f\x6e"] ?? null, "\151\x73\x5f\141\x63\x74\151\166\141\x74\x65\x64" => $params["\x69\163\137\x61\x63\x74\151\166\141\x74\145\x64"] === true ? 1 : 0]); goto qdOLB; qdOLB: return new LeaveTypeResource($zAQ0G); goto i2IfO; i2IfO: } public function update(Request $request, $dKpqo = 0) { goto AEsIy; RWUKA: $zAQ0G->update(["\156\x61\155\x65" => $params["\x6e\141\155\x65"], "\143\157\144\145" => $params["\x63\157\144\x65"], "\x61\x66\146\145\x63\164\137\164\145\156\165\162\x65" => $params["\x61\x66\x66\x65\x63\x74\x5f\164\145\x6e\x75\162\x65"] === true ? 1 : 0, "\x74\x65\156\165\x72\x65\x5f\x63\x61\154\143\x75\154\141\164\151\x6f\x6e\x5f\x72\141\x74\145" => $params["\x74\x65\x6e\165\x72\145\x5f\x63\x61\154\143\x75\154\141\164\151\157\x6e\137\162\x61\164\x65"], "\x64\x65\x73\143\x72\x69\160\x74\151\157\156" => $params["\144\145\x73\x63\x72\x69\x70\164\x69\x6f\x6e"] ?? null, "\x69\163\137\141\143\x74\151\166\x61\x74\x65\x64" => $params["\151\163\x5f\141\x63\164\x69\x76\141\x74\145\x64"] === true ? 1 : 0]); return response()->json(null, 204); goto ZSKgD; FWGSd: Tu0RT: $zAQ0G = LeaveType::findOrFail($dKpqo); $params = $request->all(); goto RWUKA; AEsIy: $B32GG = Validator::make($request->all(), ["\156\x61\x6d\145" => ["\162\x65\161\165\151\162\145\x64"], "\x63\x6f\x64\x65" => ["\162\145\161\165\x69\x72\145\x64", "\165\156\151\x71\165\x65\72\x6c\145\141\166\145\137\164\171\x70\145\163\54\143\157\144\x65\x2c" . $dKpqo], "\x61\x66\146\145\x63\164\x5f\164\x65\156\x75\162\145" => ["\162\x65\161\165\151\162\x65\144", "\142\x6f\x6f\154\x65\x61\156"], "\164\x65\156\165\x72\145\137\143\141\154\143\165\154\x61\164\151\x6f\x6e\x5f\162\x61\x74\x65" => ["\x72\145\161\x75\x69\162\x65\x64", "\156\x75\155\145\162\x69\143", "\x6d\151\x6e\72\60"], "\x69\x73\137\141\x63\x74\x69\x76\x61\164\145\x64" => ["\162\145\161\165\151\x72\145\x64", "\142\x6f\x6f\154\x65\141\156"]]); if (!$B32GG->fails()) { goto Tu0RT; } return response()->json(["\x65\x72\162\157\162\163" => $B32GG->errors()], 403); goto FWGSd; ZSKgD: } public function destroy($dKpqo = 0) { goto ZDJev; pIOgo: return response()->json(null, 204); goto drBOX; dTxZS: return response()->json(["\145\162\162\157\x72\163" => "\x43\x61\x6e\x20\156\157\x74\x20\144\x65\154\x65\164\x65\x20\164\x68\x69\163\40\154\145\141\x76\145\x20\164\171\160\145"], 403); wkQD0: $zAQ0G->delete(); goto pIOgo; ZDJev: $zAQ0G = LeaveType::findOrFail($dKpqo); $sBBvS = LeaveHistory::where("\154\x65\x61\x76\x65\137\x74\171\160\x65\x5f\151\144", $zAQ0G->id)->count(); if (!($sBBvS > 0)) { goto wkQD0; } goto dTxZS; drBOX: } public function destroyMultiple(Request $request) { goto w4Zg4; cjZRQ: NfpN1: $Aohrm = $request->get("\151\144\163", []); LeaveType::whereIn("\x69\x64", $Aohrm)->delete(); goto nXhsc; nXhsc: return response()->json(null, 204); goto rgLoM; w4Zg4: $B32GG = Validator::make($request->all(), ["\151\x64\x73" => "\x72\x65\x71\165\151\x72\x65\x64"]); if (!$B32GG->fails()) { goto NfpN1; } return response()->json(["\x65\162\x72\x6f\162\163" => $B32GG->errors()], 403); goto cjZRQ; rgLoM: } public function activateMultiple(Request $request) { goto isj1c; wEIJN: return response()->json(null, 204); goto lRadr; zu3fj: X6KOl: $Aohrm = $request->get("\x69\x64\163", []); LeaveType::whereIn("\x69\144", $Aohrm)->update(["\151\163\x5f\x61\143\x74\151\x76\x61\164\145\x64" => true]); goto wEIJN; isj1c: $B32GG = Validator::make($request->all(), ["\x69\x64\163" => "\x72\x65\161\x75\x69\162\x65\x64"]); if (!$B32GG->fails()) { goto X6KOl; } return response()->json(["\x65\162\162\157\x72\163" => $B32GG->errors()], 403); goto zu3fj; lRadr: } public function deactivateMultiple(Request $request) { goto dGOlz; glFCp: Fbi6n: $Aohrm = $request->get("\x69\144\163", []); LeaveType::whereIn("\x69\x64", $Aohrm)->update(["\x69\163\x5f\x61\x63\164\x69\166\x61\164\x65\x64" => false]); goto ySTs0; dGOlz: $B32GG = Validator::make($request->all(), ["\151\x64\163" => "\x72\x65\161\165\x69\162\x65\x64"]); if (!$B32GG->fails()) { goto Fbi6n; } return response()->json(["\145\x72\162\157\162\163" => $B32GG->errors()], 403); goto glFCp; ySTs0: return response()->json(null, 204); goto VSzZS; VSzZS: } }