<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-05-27 11:01:55
 namespace App\Http\Controllers\Admin; use App\Employee; use App\Level; use App\Http\Controllers\Controller; use App\Http\Resources\Admin\LevelResource; use App\LevelDetail; use Illuminate\Http\Request; use Illuminate\Support\Arr; use Validator; class LevelController extends Controller { const ITEM_PER_PAGE = 100; public function index(Request $request) { goto kR2qt; g3EsM: $GarwP->where(function ($fhmo2) use($QmLxx) { $fhmo2->where("\143\x6f\144\x65", "\x4c\x49\113\x45", "\45" . $QmLxx . "\x25")->orWhere("\x6e\x61\155\x65", "\114\x49\x4b\x45", "\45" . $QmLxx . "\45")->orWhere("\x70\157\x69\x6e\x74\163", "\114\x49\x4b\x45", "\45" . $QmLxx . "\45"); }); Gwh5u: if (empty($BmM0_)) { goto vm6mn; } goto twiBP; NIp6E: $BmM0_ = Arr::get($vNQy0, "\x69\147\x6e\157\162\145\111\144", null); $GarwP = Level::where("\x70\x61\162\x65\x6e\x74\137\x69\144", 0); if (empty($QmLxx)) { goto Gwh5u; } goto g3EsM; UMgj5: return LevelResource::collection($GarwP->paginate($jC13Q)); goto ghtfI; twiBP: $GarwP->where("\x69\144", "\x21\x3d", $BmM0_); vm6mn: $GarwP->orderBy("\151\x64"); goto UMgj5; kR2qt: $vNQy0 = $request->all(); $jC13Q = Arr::get($vNQy0, "\154\151\x6d\151\x74", static::ITEM_PER_PAGE); $QmLxx = Arr::get($vNQy0, "\x6b\145\171\x77\x6f\x72\144", null); goto NIp6E; ghtfI: } public function all() { return LevelResource::collection(Level::orderBy("\164\171\x70\x65")->orderBy("\171\145\x61\x72\x73")->get()); } public function allDetail(Request $request) { goto mWKQQ; gBaOW: goto T8Vro; wOJKl: $GarwP->where("\x70\x61\162\x65\156\x74\x5f\x69\144", "\41\75", 0); goto w76FN; QtoO_: $kSBmC = Arr::get($vNQy0, "\143\x68\x69\x6c\144\162\145\x6e", 1); $BmM0_ = Arr::get($vNQy0, "\x69\147\x6e\157\162\x65\x49\144", null); $GarwP = Level::with("\x64\x65\x74\141\x69\x6c\163"); goto m2hYV; QSHy6: $iCVD1 = []; $otxWV = $GarwP->paginate($jC13Q); $zJHMZ = $otxWV->items(); goto NZhGU; FtsAi: $GarwP->where("\151\x64", "\x21\75", $BmM0_); z4dng: $GarwP->orderBy("\160\x61\162\145\156\164\137\x69\144")->orderBy("\156\x61\x6d\145")->orderBy("\x63\157\x64\145"); goto QSHy6; mWKQQ: $vNQy0 = $request->all(); $jC13Q = Arr::get($vNQy0, "\154\151\x6d\151\x74", static::ITEM_PER_PAGE); $QmLxx = Arr::get($vNQy0, "\153\x65\171\x77\x6f\162\144", null); goto QtoO_; m2hYV: if (!in_array($kSBmC, [0, 1])) { goto eham9; } if ($kSBmC == 1) { goto wOJKl; } $GarwP->where("\x70\141\x72\145\156\164\137\x69\144", 0); goto gBaOW; EM8L8: $GarwP->where(function ($fhmo2) use($QmLxx) { $fhmo2->where("\143\157\144\145", "\114\111\113\105", "\45" . $QmLxx . "\x25")->orWhere("\156\141\155\x65", "\114\111\x4b\x45", "\x25" . $QmLxx . "\45")->orWhere("\x70\157\x69\x6e\x74\163", "\x4c\111\113\105", "\x25" . $QmLxx . "\45"); }); tbjSa: if (empty($BmM0_)) { goto z4dng; } goto FtsAi; NZhGU: foreach ($zJHMZ as $a4qj9) { goto sJkF4; sJkF4: if ($a4qj9->details->count() > 0) { goto PczVy; } $iCVD1[] = ["\x69\144" => $a4qj9->id, "\x63\157\x64\x65" => $a4qj9->code, "\x6e\141\155\145" => $a4qj9->name, "\x70\x61\162\x65\156\x74\137\x69\x64" => $a4qj9->parent_id, "\160\141\x72\145\156\x74" => $a4qj9->parent ? $a4qj9->parent->toArray() : null, "\x66\162\157\155" => null, "\x74\157" => null, "\160\x6f\151\156\x74\137\x76\x61\x6c\x75\x65" => 0]; goto uxLO0; goto B3_2K; mBgWx: uxLO0: FM5Qg: goto BiYwE; B3_2K: PczVy: foreach ($a4qj9->details as $SfJY7) { $iCVD1[] = ["\x69\x64" => $a4qj9->id, "\143\157\x64\145" => $a4qj9->code, "\156\141\155\x65" => $a4qj9->name, "\x70\x61\x72\x65\x6e\x74\137\x69\144" => $a4qj9->parent_id, "\x70\x61\162\145\x6e\x74" => $a4qj9->parent ? $a4qj9->parent->toArray() : null, "\x66\162\157\155" => $SfJY7->salary_grade_from, "\164\157" => $SfJY7->salary_grade_to, "\160\157\151\156\164\137\x76\141\x6c\x75\x65" => $SfJY7->point_value]; UiLbJ: } SkCZq: goto mBgWx; BiYwE: } B_oaI: return response()->json(["\144\141\x74\x61" => $iCVD1, "\x6c\x69\x6e\153\x73" => ["\146\151\x72\163\164" => $otxWV->url(1), "\x6c\x61\x73\x74" => $otxWV->url($otxWV->lastPage()), "\160\162\x65\166" => $otxWV->previousPageUrl(), "\x6e\x65\x78\164" => $otxWV->nextPageUrl()], "\x6d\x65\164\141" => ["\x63\x75\162\162\145\x6e\164\x5f\x70\141\x67\145" => $otxWV->currentPage(), "\x70\145\x72\x5f\x70\141\x67\x65" => $otxWV->perPage(), "\x74\x6f\x74\141\x6c" => $otxWV->total(), "\154\141\x73\x74\137\x70\x61\x67\145" => $otxWV->lastPage(), "\x66\x72\x6f\155" => $otxWV->firstItem(), "\164\157" => $otxWV->lastItem()]]); goto j0IBv; w76FN: T8Vro: eham9: if (empty($QmLxx)) { goto tbjSa; } goto EM8L8; j0IBv: } public function active(Request $request) { $cdIrt = $request->get("\x64\x61\164\145", now()); return LevelResource::collection(Level::active($cdIrt)->get()); } public function allNested(Request $request) { goto rV4Fu; wCs5G: $P0qvM = $this->getChildItems($GarwP, null); return response()->json(["\x64\x61\x74\x61" => $P0qvM], 200); goto IUgwK; rV4Fu: $BmM0_ = Arr::get($request->all(), "\x69\147\156\x6f\x72\x65\111\144", ''); $GarwP = Level::query(); if (!($BmM0_ != null && $BmM0_ != '')) { goto kHy1F; } goto QvziY; QvziY: $GarwP = $GarwP->where("\x69\x64", "\x21\x3d", $BmM0_); kHy1F: $GarwP = $GarwP->orderBy("\151\x64")->get(); goto wCs5G; IUgwK: } public function getChildItems($GarwP, $jkTIh = 0) { $P0qvM = []; foreach ($GarwP as $a4qj9) { goto NWgAC; ig3rE: $P0qvM[] = $AF9cL; BbF6d: wBiqb: goto oTpmt; lUeBD: if (!($kSBmC !== null && count($kSBmC) > 0)) { goto ZUTlo; } $AF9cL["\x63\150\151\x6c\144\x72\x65\x6e"] = $kSBmC; ZUTlo: goto ig3rE; NWgAC: if (!($a4qj9->parent_id == $jkTIh)) { goto BbF6d; } $AF9cL = ["\166\141\x6c\x75\145" => $a4qj9->id, "\154\x61\x62\x65\x6c" => $a4qj9->name, "\x70\x61\162\x65\156\164\x5f\156\x61\155\x65" => $a4qj9->parent ? $a4qj9->parent->name : '']; $kSBmC = $this->getChildItems($GarwP, $a4qj9->id); goto lUeBD; oTpmt: } KM1EM: return $P0qvM; } public function show($O2IZl = 0) { $R5TmD = Level::findOrFail($O2IZl); return new LevelResource($R5TmD); } public function store(Request $request) { goto cyrEe; Cqzq1: dRt0I: yfDrP: return new LevelResource($R5TmD); goto bmU2U; ED3dI: LevelDetail::where("\x6c\x65\x76\145\x6c\137\151\x64", $R5TmD->id)->delete(); if (!isset($params["\x64\x65\164\141\151\154\x73"])) { goto yfDrP; } foreach ($params["\x64\x65\164\141\151\x6c\163"] as $SfJY7) { LevelDetail::create(["\x6c\145\166\145\x6c\137\151\x64" => $R5TmD->id, "\x73\141\154\x61\162\171\137\x67\162\141\x64\145\137\x66\162\157\x6d" => $SfJY7["\146\x72\157\155"] ?? null, "\x73\141\154\x61\x72\171\x5f\x67\x72\141\144\x65\137\164\x6f" => $SfJY7["\x74\x6f"] ?? null, "\x70\157\x69\156\x74\x5f\166\141\154\165\x65" => $SfJY7["\160\157\151\x6e\164\137\166\141\x6c\x75\x65"]]); q3v4c: } goto Cqzq1; DJVvg: return response()->json(["\x6d\157\x64\165\x6c\x65" => "\x6c\x65\166\x65\x6c", "\x65\x72\162\x6f\x72\163" => ["\156\141\x6d\145\62" => [__("\166\141\x6c\x69\144\141\164\x69\x6f\156\56\165\x6e\x69\x71\165\x65", ["\141\164\x74\x72\151\142\x75\x74\145" => "\156\x61\155\145\62"])]]], 422); Dpcnk: $R5TmD = Level::create(["\143\157\x64\145" => $params["\x63\157\144\145"], "\156\141\x6d\145" => $params["\x6e\x61\x6d\145"], "\x70\x6f\x69\x6e\x74\x73" => 0, "\x70\x61\x72\x65\x6e\x74\137\151\x64" => $ZYunf, "\143\162\145\141\164\x65\x64\x5f\x62\x79" => auth()->id()]); goto ED3dI; OxTyj: $e9IPV = Level::where("\160\141\x72\145\156\x74\137\x69\x64", $ZYunf)->where("\x63\x6f\x64\145", $params["\x63\x6f\144\x65"])->count(); if (!($e9IPV > 0)) { goto CwWG5; } return response()->json(["\155\157\x64\x75\x6c\x65" => "\154\x65\x76\x65\154", "\145\x72\162\157\x72\x73" => ["\x63\157\144\145\62" => [__("\166\141\154\x69\x64\x61\x74\x69\157\x6e\56\x75\x6e\x69\161\165\x65", ["\141\x74\x74\162\151\x62\165\x74\145" => "\x63\x6f\144\145\x32"])]]], 422); goto PyS5M; cyrEe: $bY0tT = Validator::make($request->all(), ["\143\x6f\x64\x65" => ["\162\145\161\x75\151\x72\145\144"], "\x6e\x61\155\145" => ["\x72\145\161\x75\x69\162\x65\x64"]]); if (!$bY0tT->fails()) { goto Z2DJj; } return response()->json(["\145\x72\162\157\x72\x73" => $bY0tT->errors()], 403); goto zGSmF; zGSmF: Z2DJj: $params = $request->all(); $ZYunf = $params["\x70\x61\162\145\156\x74\137\151\144"] ?? 0; goto OxTyj; PyS5M: CwWG5: $zi1tt = Level::where("\160\141\x72\145\156\x74\x5f\151\144", $ZYunf)->where("\x6e\x61\155\145", $params["\156\x61\155\x65"])->count(); if (!($zi1tt > 0)) { goto Dpcnk; } goto DJVvg; bmU2U: } public function storeEmployment(Request $request) { goto pnRsG; mNIcS: $R5TmD = Level::create(["\143\157\144\145" => $params["\143\x6f\x64\x65"], "\156\141\155\145" => $params["\156\141\x6d\145"], "\x70\141\162\145\x6e\x74\x5f\x69\x64" => 0, "\143\x72\145\141\164\x65\x64\137\142\x79" => auth()->id()]); return new LevelResource($R5TmD); goto RLTne; T2U45: a8DwN: $params = $request->all(); $BNUZ2 = Level::where("\160\x61\162\x65\156\164\137\151\x64", 0)->where(function ($fhmo2) use($params) { $fhmo2->where("\143\x6f\x64\x65", $params["\x63\157\x64\x65"])->orWhere("\x6e\141\x6d\x65", $params["\x6e\141\155\145"]); })->count(); goto e8PjW; pnRsG: $bY0tT = Validator::make($request->all(), ["\x63\157\144\145" => ["\x72\145\161\x75\x69\x72\x65\x64"], "\x6e\141\155\x65" => ["\162\145\x71\x75\151\162\x65\x64"]]); if (!$bY0tT->fails()) { goto a8DwN; } return response()->json(["\145\162\162\x6f\162\x73" => $bY0tT->errors()], 403); goto T2U45; e8PjW: if (!($BNUZ2 > 0)) { goto y01HD; } return response()->json(["\145\x72\162\157\162\x73" => "\111\x74\145\155\40\x68\x61\x76\x65\40\145\170\151\x73\164\x65\144"], 403); y01HD: goto mNIcS; RLTne: } public function update(Request $request, $O2IZl = 0) { goto O_xzm; bygTw: PCmpf: Bujgs: return response()->json(null, 204); goto xTDDP; OXY4w: LevelDetail::where("\154\145\166\145\x6c\x5f\151\x64", $R5TmD->id)->delete(); if (!isset($params["\x64\x65\x74\141\151\x6c\x73"])) { goto Bujgs; } foreach ($params["\x64\x65\164\141\151\154\x73"] as $SfJY7) { LevelDetail::create(["\x6c\x65\166\145\154\137\x69\x64" => $R5TmD->id, "\x73\141\154\x61\162\x79\137\147\x72\141\x64\x65\137\146\162\x6f\155" => $SfJY7["\x66\x72\157\155"] ?? null, "\x73\141\154\141\162\171\137\147\162\141\x64\145\x5f\x74\x6f" => $SfJY7["\164\x6f"] ?? null, "\x70\157\x69\x6e\164\x5f\x76\141\x6c\165\145" => $SfJY7["\x70\x6f\x69\x6e\164\x5f\166\x61\154\165\x65"]]); igF3O: } goto bygTw; O_xzm: $bY0tT = Validator::make($request->all(), ["\143\157\x64\x65" => ["\x72\x65\x71\x75\x69\162\145\144"], "\x6e\141\155\145" => ["\162\145\161\x75\x69\162\145\144"]]); if (!$bY0tT->fails()) { goto zRq8y; } return response()->json(["\x65\x72\162\x6f\x72\x73" => $bY0tT->errors()], 403); goto IdE3B; hIp9u: return response()->json(["\x65\162\x72\x6f\x72\x73" => "\x49\164\145\155\x20\x68\x61\166\145\x20\145\x78\x69\163\164\x65\x64"], 403); stBC7: $R5TmD->update(["\x63\157\x64\x65" => $params["\143\x6f\144\145"], "\x6e\x61\x6d\x65" => $params["\x6e\x61\155\145"], "\x70\157\151\x6e\164\x73" => $ZYunf != 0 ? $params["\160\x6f\151\x6e\x74\163"] : 0, "\160\141\162\145\156\164\x5f\151\144" => $ZYunf]); goto OXY4w; MmDJg: $ZYunf = isset($params["\x70\x61\162\x65\156\x74\137\x69\144"]) ? $params["\160\x61\x72\145\156\x74\137\x69\x64"] : 0; $BNUZ2 = Level::where("\x70\141\162\x65\x6e\164\x5f\x69\144", $ZYunf)->where("\x69\144", "\41\x3d", $R5TmD->id)->where(function ($fhmo2) use($params) { $fhmo2->where("\x63\157\x64\145", $params["\143\157\144\145"])->orWhere("\156\141\155\145", $params["\156\141\x6d\x65"]); })->count(); if (!($BNUZ2 > 0)) { goto stBC7; } goto hIp9u; IdE3B: zRq8y: $R5TmD = Level::findOrFail($O2IZl); $params = $request->all(); goto MmDJg; xTDDP: } public function updateEmployment(Request $request, $O2IZl = 0) { goto MbnQh; KPZtZ: $BNUZ2 = Level::where("\160\x61\x72\145\156\164\x5f\x69\144", 0)->where("\151\x64", "\x21\75", $R5TmD->id)->where(function ($fhmo2) use($params) { $fhmo2->where("\143\x6f\x64\145", $params["\143\157\144\145"])->orWhere("\156\141\x6d\x65", $params["\x6e\x61\155\x65"]); })->count(); if (!($BNUZ2 > 0)) { goto W6kt2; } return response()->json(["\x65\x72\x72\x6f\162\163" => "\111\x74\145\155\40\150\141\x76\145\x20\x65\170\x69\x73\x74\145\x64"], 403); goto ROviX; ROviX: W6kt2: $R5TmD->update(["\x63\x6f\144\x65" => $params["\x63\x6f\x64\x65"], "\x6e\x61\x6d\x65" => $params["\x6e\141\x6d\x65"]]); return response()->json(null, 204); goto l6vlP; wUWDj: rwvBE: $R5TmD = Level::findOrFail($O2IZl); $params = $request->all(); goto KPZtZ; MbnQh: $bY0tT = Validator::make($request->all(), ["\x63\157\144\145" => ["\162\x65\161\165\151\162\145\144"], "\x6e\141\155\x65" => ["\162\145\x71\165\x69\x72\x65\144"]]); if (!$bY0tT->fails()) { goto rwvBE; } return response()->json(["\145\x72\x72\x6f\162\163" => $bY0tT->errors()], 403); goto wUWDj; l6vlP: } public function destroy($O2IZl = 0) { goto h_x9e; h_x9e: $R5TmD = Level::findOrFail($O2IZl); $GvQOT = Level::where("\160\141\162\x65\156\164\137\151\x64", $R5TmD->id)->count(); if (!($GvQOT > 0)) { goto qhvno; } goto pyf3A; pyf3A: return response()->json(["\145\x72\x72\x6f\x72\163" => "\x43\141\156\40\x6e\x6f\164\40\144\145\154\x65\x74\x65\x20\x74\150\x69\163\x20\x6c\x65\x76\x65\x6c"], 403); qhvno: $wAEy2 = Employee::where("\x6c\145\x76\x65\154\x5f\x69\144", $R5TmD->id)->count(); goto ob_9z; IqEEb: $R5TmD->delete(); return response()->json(null, 204); goto zwh2j; ob_9z: if (!($wAEy2 > 0)) { goto BWt1Y; } return response()->json(["\x65\162\162\x6f\x72\x73" => "\x43\x61\156\40\156\x6f\164\40\x64\145\154\x65\164\145\x20\x74\150\x69\x73\40\x6c\x65\166\x65\154"], 403); BWt1Y: goto IqEEb; zwh2j: } }