diff --git a/app/Http/Controllers/BranchesController.php b/app/Http/Controllers/BranchesController.php new file mode 100644 index 0000000..d4d37b6 --- /dev/null +++ b/app/Http/Controllers/BranchesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(BranchesController::class, 'index', ' Branches index'); + $data = Branches::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.branches.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(BranchesController::class, 'create', ' Branches create'); + $TableData = Branches::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.branches.create",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(BranchesController::class, 'store', ' Branches store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_branches')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(BranchesController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Branches Created Successfully.'], 200); + } + return redirect()->route('branches.index')->with('success','The Branches created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Branches::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Branches::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(BranchesController::class, 'show', ' Branches show'); + $data = Branches::findOrFail($id); + + return view("crud.generated.branches.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(BranchesController::class, 'edit', ' Branches edit'); + $TableData = Branches::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Branches::findOrFail($id); + $editable=true; + return view("crud.generated.branches.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(BranchesController::class, 'update', ' Branches update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('branch_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(BranchesController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Branches updated Successfully.'], 200); + } + // return redirect()->route('branches.index')->with('success','The Branches updated Successfully.'); + return redirect()->back()->with('success', 'The Branches updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(BranchesController::class, 'destroy', ' Branches destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(BranchesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Branches Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(BranchesController::class, 'destroy', ' Branches destroy'); + $data = Branches::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(BranchesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Branches Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(BranchesController::class, 'clone', ' Branches clone'); + $data = Branches::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(BranchesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Branches Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/CastesController.php b/app/Http/Controllers/CastesController.php new file mode 100644 index 0000000..01652e6 --- /dev/null +++ b/app/Http/Controllers/CastesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(CastesController::class, 'index', ' Castes index'); + $data = Castes::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.castes.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(CastesController::class, 'create', ' Castes create'); + $TableData = Castes::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.castes.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(CastesController::class, 'store', ' Castes store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_castes')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CastesController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Castes Created Successfully.'], 200); + } + return redirect()->route('castes.index')->with('success','The Castes created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Castes::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Castes::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(CastesController::class, 'show', ' Castes show'); + $data = Castes::findOrFail($id); + + return view("crud.generated.castes.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(CastesController::class, 'edit', ' Castes edit'); + $TableData = Castes::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Castes::findOrFail($id); + $editable=true; + return view("crud.generated.castes.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(CastesController::class, 'update', ' Castes update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('caste_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CastesController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Castes updated Successfully.'], 200); + } + // return redirect()->route('castes.index')->with('success','The Castes updated Successfully.'); + return redirect()->back()->with('success', 'The Castes updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(CastesController::class, 'destroy', ' Castes destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CastesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Castes Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(CastesController::class, 'destroy', ' Castes destroy'); + $data = Castes::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CastesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Castes Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(CastesController::class, 'clone', ' Castes clone'); + $data = Castes::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CastesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Castes Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/CitiesController.php b/app/Http/Controllers/CitiesController.php new file mode 100644 index 0000000..87a743f --- /dev/null +++ b/app/Http/Controllers/CitiesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(CitiesController::class, 'index', ' Cities index'); + $data = Cities::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.cities.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(CitiesController::class, 'create', ' Cities create'); + $TableData = Cities::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.cities.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(CitiesController::class, 'store', ' Cities store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_cities')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CitiesController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Cities Created Successfully.'], 200); + } + return redirect()->route('cities.index')->with('success','The Cities created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Cities::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Cities::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(CitiesController::class, 'show', ' Cities show'); + $data = Cities::findOrFail($id); + + return view("crud.generated.cities.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(CitiesController::class, 'edit', ' Cities edit'); + $TableData = Cities::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Cities::findOrFail($id); + $editable=true; + return view("crud.generated.cities.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(CitiesController::class, 'update', ' Cities update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('city_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CitiesController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Cities updated Successfully.'], 200); + } + // return redirect()->route('cities.index')->with('success','The Cities updated Successfully.'); + return redirect()->back()->with('success', 'The Cities updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(CitiesController::class, 'destroy', ' Cities destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CitiesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Cities Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(CitiesController::class, 'destroy', ' Cities destroy'); + $data = Cities::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CitiesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Cities Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(CitiesController::class, 'clone', ' Cities clone'); + $data = Cities::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CitiesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Cities Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/CompaniesController.php b/app/Http/Controllers/CompaniesController.php new file mode 100644 index 0000000..4ed27cf --- /dev/null +++ b/app/Http/Controllers/CompaniesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(CompaniesController::class, 'index', ' Companies index'); + $data = Companies::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.companies.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(CompaniesController::class, 'create', ' Companies create'); + $TableData = Companies::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.companies.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(CompaniesController::class, 'store', ' Companies store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_companies')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CompaniesController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Companies Created Successfully.'], 200); + } + return redirect()->route('companies.index')->with('success','The Companies created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Companies::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Companies::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(CompaniesController::class, 'show', ' Companies show'); + $data = Companies::findOrFail($id); + + return view("crud.generated.companies.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(CompaniesController::class, 'edit', ' Companies edit'); + $TableData = Companies::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Companies::findOrFail($id); + $editable=true; + return view("crud.generated.companies.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(CompaniesController::class, 'update', ' Companies update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('company_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CompaniesController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Companies updated Successfully.'], 200); + } + // return redirect()->route('companies.index')->with('success','The Companies updated Successfully.'); + return redirect()->back()->with('success', 'The Companies updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(CompaniesController::class, 'destroy', ' Companies destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CompaniesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Companies Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(CompaniesController::class, 'destroy', ' Companies destroy'); + $data = Companies::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CompaniesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Companies Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(CompaniesController::class, 'clone', ' Companies clone'); + $data = Companies::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CompaniesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Companies Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/CompanytypesController.php b/app/Http/Controllers/CompanytypesController.php new file mode 100644 index 0000000..352c96f --- /dev/null +++ b/app/Http/Controllers/CompanytypesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(CompanytypesController::class, 'index', ' Companytypes index'); + $data = Companytypes::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.companytypes.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(CompanytypesController::class, 'create', ' Companytypes create'); + $TableData = Companytypes::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.companytypes.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(CompanytypesController::class, 'store', ' Companytypes store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_companytypes')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CompanytypesController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Companytypes Created Successfully.'], 200); + } + return redirect()->route('companytypes.index')->with('success','The Companytypes created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Companytypes::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Companytypes::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(CompanytypesController::class, 'show', ' Companytypes show'); + $data = Companytypes::findOrFail($id); + + return view("crud.generated.companytypes.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(CompanytypesController::class, 'edit', ' Companytypes edit'); + $TableData = Companytypes::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Companytypes::findOrFail($id); + $editable=true; + return view("crud.generated.companytypes.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(CompanytypesController::class, 'update', ' Companytypes update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('companytype_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CompanytypesController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Companytypes updated Successfully.'], 200); + } + // return redirect()->route('companytypes.index')->with('success','The Companytypes updated Successfully.'); + return redirect()->back()->with('success', 'The Companytypes updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(CompanytypesController::class, 'destroy', ' Companytypes destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CompanytypesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Companytypes Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(CompanytypesController::class, 'destroy', ' Companytypes destroy'); + $data = Companytypes::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CompanytypesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Companytypes Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(CompanytypesController::class, 'clone', ' Companytypes clone'); + $data = Companytypes::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CompanytypesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Companytypes Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/CountriesController.php b/app/Http/Controllers/CountriesController.php new file mode 100644 index 0000000..5a66f25 --- /dev/null +++ b/app/Http/Controllers/CountriesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(CountriesController::class, 'index', ' Countries index'); + $data = Countries::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.countries.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(CountriesController::class, 'create', ' Countries create'); + $TableData = Countries::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.countries.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(CountriesController::class, 'store', ' Countries store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_countries')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CountriesController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Countries Created Successfully.'], 200); + } + return redirect()->route('countries.index')->with('success','The Countries created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Countries::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Countries::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(CountriesController::class, 'show', ' Countries show'); + $data = Countries::findOrFail($id); + + return view("crud.generated.countries.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(CountriesController::class, 'edit', ' Countries edit'); + $TableData = Countries::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Countries::findOrFail($id); + $editable=true; + return view("crud.generated.countries.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(CountriesController::class, 'update', ' Countries update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('country_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CountriesController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Countries updated Successfully.'], 200); + } + // return redirect()->route('countries.index')->with('success','The Countries updated Successfully.'); + return redirect()->back()->with('success', 'The Countries updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(CountriesController::class, 'destroy', ' Countries destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CountriesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Countries Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(CountriesController::class, 'destroy', ' Countries destroy'); + $data = Countries::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CountriesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Countries Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(CountriesController::class, 'clone', ' Countries clone'); + $data = Countries::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(CountriesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Countries Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/DagsController.php b/app/Http/Controllers/DagsController.php new file mode 100644 index 0000000..f4e544f --- /dev/null +++ b/app/Http/Controllers/DagsController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(DagsController::class, 'index', ' Dags index'); + $data = Dags::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.dags.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(DagsController::class, 'create', ' Dags create'); + $TableData = Dags::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.dags.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(DagsController::class, 'store', ' Dags store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_dags')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DagsController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Dags Created Successfully.'], 200); + } + return redirect()->route('dags.index')->with('success','The Dags created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Dags::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Dags::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(DagsController::class, 'show', ' Dags show'); + $data = Dags::findOrFail($id); + + return view("crud.generated.dags.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(DagsController::class, 'edit', ' Dags edit'); + $TableData = Dags::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Dags::findOrFail($id); + $editable=true; + return view("crud.generated.dags.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(DagsController::class, 'update', ' Dags update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('dag_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DagsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Dags updated Successfully.'], 200); + } + // return redirect()->route('dags.index')->with('success','The Dags updated Successfully.'); + return redirect()->back()->with('success', 'The Dags updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(DagsController::class, 'destroy', ' Dags destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DagsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Dags Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(DagsController::class, 'destroy', ' Dags destroy'); + $data = Dags::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DagsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Dags Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(DagsController::class, 'clone', ' Dags clone'); + $data = Dags::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DagsController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Dags Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/DepartmentsController.php b/app/Http/Controllers/DepartmentsController.php new file mode 100644 index 0000000..4c42e42 --- /dev/null +++ b/app/Http/Controllers/DepartmentsController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(DepartmentsController::class, 'index', ' Departments index'); + $data = Departments::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.departments.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(DepartmentsController::class, 'create', ' Departments create'); + $TableData = Departments::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.departments.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(DepartmentsController::class, 'store', ' Departments store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_departments')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DepartmentsController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Departments Created Successfully.'], 200); + } + return redirect()->route('departments.index')->with('success','The Departments created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Departments::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Departments::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(DepartmentsController::class, 'show', ' Departments show'); + $data = Departments::findOrFail($id); + + return view("crud.generated.departments.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(DepartmentsController::class, 'edit', ' Departments edit'); + $TableData = Departments::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Departments::findOrFail($id); + $editable=true; + return view("crud.generated.departments.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(DepartmentsController::class, 'update', ' Departments update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('department_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DepartmentsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Departments updated Successfully.'], 200); + } + // return redirect()->route('departments.index')->with('success','The Departments updated Successfully.'); + return redirect()->back()->with('success', 'The Departments updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(DepartmentsController::class, 'destroy', ' Departments destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DepartmentsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Departments Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(DepartmentsController::class, 'destroy', ' Departments destroy'); + $data = Departments::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DepartmentsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Departments Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(DepartmentsController::class, 'clone', ' Departments clone'); + $data = Departments::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DepartmentsController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Departments Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/DesignationsController.php b/app/Http/Controllers/DesignationsController.php new file mode 100644 index 0000000..7add074 --- /dev/null +++ b/app/Http/Controllers/DesignationsController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(DesignationsController::class, 'index', ' Designations index'); + $data = Designations::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.designations.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(DesignationsController::class, 'create', ' Designations create'); + $TableData = Designations::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.designations.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(DesignationsController::class, 'store', ' Designations store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_designations')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DesignationsController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Designations Created Successfully.'], 200); + } + return redirect()->route('designations.index')->with('success','The Designations created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Designations::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Designations::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(DesignationsController::class, 'show', ' Designations show'); + $data = Designations::findOrFail($id); + + return view("crud.generated.designations.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(DesignationsController::class, 'edit', ' Designations edit'); + $TableData = Designations::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Designations::findOrFail($id); + $editable=true; + return view("crud.generated.designations.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(DesignationsController::class, 'update', ' Designations update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('designation_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DesignationsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Designations updated Successfully.'], 200); + } + // return redirect()->route('designations.index')->with('success','The Designations updated Successfully.'); + return redirect()->back()->with('success', 'The Designations updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(DesignationsController::class, 'destroy', ' Designations destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DesignationsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Designations Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(DesignationsController::class, 'destroy', ' Designations destroy'); + $data = Designations::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DesignationsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Designations Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(DesignationsController::class, 'clone', ' Designations clone'); + $data = Designations::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DesignationsController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Designations Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/DistrictsController.php b/app/Http/Controllers/DistrictsController.php new file mode 100644 index 0000000..14ecb3b --- /dev/null +++ b/app/Http/Controllers/DistrictsController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(DistrictsController::class, 'index', ' Districts index'); + $data = Districts::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.districts.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(DistrictsController::class, 'create', ' Districts create'); + $TableData = Districts::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.districts.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(DistrictsController::class, 'store', ' Districts store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_districts')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DistrictsController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Districts Created Successfully.'], 200); + } + return redirect()->route('districts.index')->with('success','The Districts created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Districts::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Districts::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(DistrictsController::class, 'show', ' Districts show'); + $data = Districts::findOrFail($id); + + return view("crud.generated.districts.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(DistrictsController::class, 'edit', ' Districts edit'); + $TableData = Districts::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Districts::findOrFail($id); + $editable=true; + return view("crud.generated.districts.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(DistrictsController::class, 'update', ' Districts update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('district_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DistrictsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Districts updated Successfully.'], 200); + } + // return redirect()->route('districts.index')->with('success','The Districts updated Successfully.'); + return redirect()->back()->with('success', 'The Districts updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(DistrictsController::class, 'destroy', ' Districts destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DistrictsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Districts Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(DistrictsController::class, 'destroy', ' Districts destroy'); + $data = Districts::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DistrictsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Districts Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(DistrictsController::class, 'clone', ' Districts clone'); + $data = Districts::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(DistrictsController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Districts Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/EthnicitiesController.php b/app/Http/Controllers/EthnicitiesController.php new file mode 100644 index 0000000..c11a38d --- /dev/null +++ b/app/Http/Controllers/EthnicitiesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(EthnicitiesController::class, 'index', ' Ethnicities index'); + $data = Ethnicities::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.ethnicities.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(EthnicitiesController::class, 'create', ' Ethnicities create'); + $TableData = Ethnicities::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.ethnicities.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(EthnicitiesController::class, 'store', ' Ethnicities store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_ethnicities')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(EthnicitiesController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Ethnicities Created Successfully.'], 200); + } + return redirect()->route('ethnicities.index')->with('success','The Ethnicities created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Ethnicities::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Ethnicities::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(EthnicitiesController::class, 'show', ' Ethnicities show'); + $data = Ethnicities::findOrFail($id); + + return view("crud.generated.ethnicities.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(EthnicitiesController::class, 'edit', ' Ethnicities edit'); + $TableData = Ethnicities::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Ethnicities::findOrFail($id); + $editable=true; + return view("crud.generated.ethnicities.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(EthnicitiesController::class, 'update', ' Ethnicities update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('ethnicity_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(EthnicitiesController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Ethnicities updated Successfully.'], 200); + } + // return redirect()->route('ethnicities.index')->with('success','The Ethnicities updated Successfully.'); + return redirect()->back()->with('success', 'The Ethnicities updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(EthnicitiesController::class, 'destroy', ' Ethnicities destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(EthnicitiesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Ethnicities Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(EthnicitiesController::class, 'destroy', ' Ethnicities destroy'); + $data = Ethnicities::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(EthnicitiesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Ethnicities Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(EthnicitiesController::class, 'clone', ' Ethnicities clone'); + $data = Ethnicities::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(EthnicitiesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Ethnicities Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/GendersController.php b/app/Http/Controllers/GendersController.php new file mode 100644 index 0000000..569784b --- /dev/null +++ b/app/Http/Controllers/GendersController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(GendersController::class, 'index', ' Genders index'); + $data = Genders::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.genders.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(GendersController::class, 'create', ' Genders create'); + $TableData = Genders::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.genders.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(GendersController::class, 'store', ' Genders store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_genders')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(GendersController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Genders Created Successfully.'], 200); + } + return redirect()->route('genders.index')->with('success','The Genders created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Genders::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Genders::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(GendersController::class, 'show', ' Genders show'); + $data = Genders::findOrFail($id); + + return view("crud.generated.genders.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(GendersController::class, 'edit', ' Genders edit'); + $TableData = Genders::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Genders::findOrFail($id); + $editable=true; + return view("crud.generated.genders.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(GendersController::class, 'update', ' Genders update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('gender_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(GendersController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Genders updated Successfully.'], 200); + } + // return redirect()->route('genders.index')->with('success','The Genders updated Successfully.'); + return redirect()->back()->with('success', 'The Genders updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(GendersController::class, 'destroy', ' Genders destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(GendersController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Genders Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(GendersController::class, 'destroy', ' Genders destroy'); + $data = Genders::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(GendersController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Genders Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(GendersController::class, 'clone', ' Genders clone'); + $data = Genders::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(GendersController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Genders Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/GeneralFormController.php b/app/Http/Controllers/GeneralFormController.php new file mode 100644 index 0000000..d70ba25 --- /dev/null +++ b/app/Http/Controllers/GeneralFormController.php @@ -0,0 +1,1358 @@ +initializeFields(); + } + + protected function initializeFields() + { + self::$imageFields = array( + 'image', + 'logo', + 'signature', + 'cover_photo', + 'featured_image', + 'image_thumb', + 'primary_logo', + 'secondary_logo', + 'thumb_image', + 'thumb', + 'cover', + 'photo', + 'passport_copy', + 'icon', + 'favicon', + 'og_image', + 'no_image' + ); + self::$textEditorFields = array('details', 'description', 'text', 'qualification', 'experience', 'required_documents', 'biodata', 'privacy_policy', 'content1', 'content2', 'content3'); + self::$textAreaFields = array('copyright', 'remarks', 'seo_keywords', 'seo_description', 'seo_descriptions', 'intro', 'meta_tags', 'google_map', 'og_tags'); + self::$dateFields = array('dob', 'postedon', 'valid_till', 'startdate', 'enddate', 'from', 'to', 'starts', 'ends'); + self::$passwordFields = array('password'); + self::$HiddenCols = array("createdby", "updatedby", "updated_at", "created_at", "status", "alias", "display_order", "is_main", 'email_verified_at'); + } + + protected function getImageFields() + { + return $this->imageFields; + } + + protected function gettextEditorFields() + { + return $this->textEditorFields; + } + + public function create() + { + $tables = DB::select('SHOW TABLES'); + try { + $databasdeName = DB::connection()->getDatabaseName(); + $allTables = []; + foreach ($tables as $table) { + + $table_field = "Tables_in_$databasdeName"; + // dd($table->$table_field); + if(strpos($table->$table_field,"_logs")){continue;} + $allTables[$table->$table_field] = $table->$table_field; + } + return view('crud.form.create', compact('allTables')); + } catch (Exception $e) { + dd($e->getMessage()); + } + } + + + public function store(Request $request) + { + // dd($request->all()); + $request->validate([ + 'type' => 'required', + 'tableName' => 'required', + ]); + + $name = trim($request->type); + $command = $name; + + $tableName = trim($request->tableName); + $directoryName = trim($request->directoryName); + + switch ($command) { + case 'dictonary': + $data['tableName'] = "tbl_dictonary"; + if ($tableName != "") { + switch ($tableName) { + case 'add': + $data['TableCols'] = DB::select("describe " . $data['tableName']); + return view("crud.settings.dictonary/add", $data); + default: + $data['TableRows'] = DB::select("select * from " . $data['tableName']); + return view("crud.settings.dictonary.list", $data); + } + } + $data['TableName'] = "tbl_dictonary"; + $data['TableRows'] = DB::select("select * from " . $data['TableName']); + return view("crud.settings.dictonary", $data); + + + + case 'curd': + $data['tableName'] = $tableName; + $data['directoryName'] = $directoryName; + return view("crud.settings.curd", $data); + break; + case 'ajax-curd': + $data['tableName'] = $tableName; + $data['directoryName'] = $directoryName; + $columns = DB::select("describe $tableName"); // users table + return view("crud.settings.ajax-curd", $data); + break; + + default: + + return view("crud.settings.home"); + } + } + + public function getTableNullablecreate() + { + return view("crud.settings.ajax-curd"); + } + + public function tables() + { + $AllTables = DB::select('SHOW TABLES'); + try { + $databasdeName = DB::connection()->getDatabaseName(); + $allTables = []; + foreach ($AllTables as $table) { + $myTable = new stdClass; + //$allTables[]=$table['Tables_in_'.$databasdeName]; + $key = "Tables_in_" . $databasdeName; + $table->columns = DB::select("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '" . $table->$key . "'"); + $myTable->tablename = $table->$key; + $myTable->tablecolumns = $table->columns; + $allTables[] = $myTable; + } + return view('crud.form.tables', compact('allTables')); + } catch (Exception $e) { + dd($e->getMessage()); + } + } + + public static function getForeignTable($all_columns) + { + $string = '_id'; + $foreign = []; + foreach ($all_columns as $key => $column) { + if (str_contains($column, $string) !== FALSE) { // Yoshi version + $foreign[] = $column; + } + } + unset($foreign[0]); + $strArray = []; + foreach ($foreign as $key => $foreignKey) { + $strArray[$key] = explode('_id', $foreignKey); + unset($strArray[$key][1]); + } + if ($strArray) { + $all_Foreign_Key_Table = call_user_func_array('array_merge', $strArray); + foreach ($all_Foreign_Key_Table as $column) { + $tableName[] = "tbl_" . $column; + } + return $tableName; + } else { + return []; + } + } + + public static function getTableColumns($TableName) + { + return array_column(DB::select("SHOW COLUMNS FROM $TableName"), 'Field'); + } + + + + public static function ajaxShowContent($TableName, $directoryName) + { + $TableName = strtolower($TableName); + $TableCols = DB::select("describe " . $TableName); + $TableRows = DB::select("select * from " . $TableName); + $folder = ''; + $routeName = ''; + if (!empty($directoryName)) { + $folder .= strtolower($directoryName) . '/'; + $routeName .= strtolower($directoryName) . '.'; + } + $routeName .= strtolower(str_replace("tbl_", "", $TableName)); + $folder .= str_replace("tbl_", "", $TableName); + $Table_pk = str_replace("tbl_", "", $TableName) . "_id"; + $title = ucwords(str_replace("tbl_", "", $TableName)); + $showContent = " + + + "; + + foreach ($TableCols as $key => $TableCol): + $TableCol = $TableCol->Field; + if ($key == 0 || $TableCol == 'createdOn' || $TableCol == 'createdBy' || $TableCol == 'updatedBy' || $TableCol == 'created_at' || $TableCol == 'updated_at') + continue; + $TableColLabel = ucwords(str_replace("_", " ", $TableCol)); + if ($TableCol == 'status') + $showContent .= "

Status :     $TableCol == 1 ? 'text-success' : 'text-danger'}}\">{{\$data->$TableCol == 1 ? 'Active' : 'Inactive'}}

"; + else + $showContent .= '

' . $TableColLabel . " :     {{\$data->$TableCol}}

"; + + endforeach; + $showContent .= "
+
+

Created On :   {{\$data->created_at}}

+

Created By :   {{\$data->createdBy}}

+
+
+

Updated On :   {{\$data->updated_at}}

+

Updated By :   {{\$data->updatedBy}}

+ +
+
+ "; + + return $showContent; + } + public static function ajaxEditContent($TableName, $directoryName) + { + $TableName = strtolower($TableName); + $TableCols = DB::select("describe " . $TableName); + $TableRows = DB::select("select * from " . $TableName); + $folder = ''; + $routeName = ''; + if (!empty($directoryName)) { + $folder .= strtolower($directoryName) . '/'; + $routeName .= strtolower($directoryName) . '.'; + } + $routeName .= strtolower(str_replace("tbl_", "", $TableName)); + $folder .= str_replace("tbl_", "", $TableName); + + $title = ucwords(str_replace("tbl_", "", $TableName)); + + $all_columns = self::getTableColumns($TableName); + $Table_pk = $all_columns[0]; + $all_foreign_table = self::getForeignTable($all_columns); + $all_foreignKey = []; + if ($all_foreign_table) + foreach ($all_foreign_table as $key => $tablename) { + $all_foreignKey[$tablename] = self::getTableColumns($tablename); + $all_foreignKey[$tablename] = $all_foreignKey[$tablename][0] ?? null; + } + + + $editContent = " +
$Table_pk]):route('$routeName.store')}}\" id=\"updateCustomForm\" method=\"POST\" >\n @csrf "; + $editContent .= "" . PHP_EOL; + $editContent .= '
'; + foreach ($TableCols as $key => $TableCol): + + $TableCol = $TableCol->Field; + if (!in_array($TableCol, self::$HiddenCols)) { + $TableColLabel = ucwords(str_replace("_", " ", $TableCol)); + + switch ($TableCol) { + case $TableCols[0]->Field: + break; + + case (strpos($TableCol, "parent_") !== false): + $editContent .= '
'; + $editContent .= "{{createCustomSelect('$TableName', 'title', '" . $TableCols[0]->Field . "', \$editable?\$data->$TableCol:'', '" . $TableColLabel . "','$TableCol', 'form-control select2','status<>-1')}}"; + $editContent .= "
"; + break; + case (strpos($TableCol, "s_id") !== false): //CASE TO HANDLE FOREIGN TABLE + $FTNameRaw = str_replace("s_id", "s", $TableCol); + $FTName = "tbl_" . str_replace("s_id", "s", $TableCol); + $FTCols = DB::select("describe " . $FTName); + $editContent .= '
'; + //createCustomSelect($tableName, $fieldNameToDisplay, $fieldNameForValue, $defaultValueSelected, $displayTextForLabel, $HTMLElementName, $additionalClass = "form-control", $defaultCondition = null) + $editContent .= "{{createCustomSelect('$FTName', 'title', '" . $FTCols[0]->Field . "', \$editable?\$data->$TableCol:'', '" . $TableColLabel . "','$TableCol', 'form-control select2','status<>-1')}}"; + $editContent .= "
"; + break; + case (in_array($TableCol, self::$textEditorFields)): + $editContent .= '
'; + //function createTextArea($name, $class = "", $display = "", $default = "",$row = "") + $editContent .= "{{createTextarea(\"$TableCol\",\"$TableCol ckeditor-classic\",\"$TableColLabel\",\$editable?\$data->$TableCol:'')}}\n"; + $editContent .= "
"; + break; + case (in_array($TableCol, self::$imageFields)): + $editContent .= '
'; + $editContent .= "{{createImageInput(\"$TableCol\",\"$TableColLabel\",'',\$editable?\$data->$TableCol:'')}}\n"; + $editContent .= "
"; + break; + case (in_array($TableCol, self::$dateFields)): + $editContent .= '
'; + $editContent .= "{{createDate(\"$TableCol\",\"$TableColLabel\",'',\$editable?\$data->$TableCol:'')}}\n"; //createDate($name, $display = "",$class = "datepicker", $default = "") + $editContent .= "
"; + break; + case (in_array($TableCol, self::$passwordFields)): + $editContent .= '
'; + $editContent .= "{{createPassword(\"$TableCol\",\"$TableColLabel\",'',\$editable?\$data->$TableCol:'')}}\n"; //createDate($name, $display = "",$class = "datepicker", $default = "") + $editContent .= "
"; + break; + case (in_array($TableCol, self::$textAreaFields)): + $editContent .= '
'; + $editContent .= "{{createPlainTextArea(\"$TableCol\",'',\"$TableColLabel\",\$editable?\$data->$TableCol:'')}}\n"; //createDate($name, $display = "",$class = "datepicker", $default = "") + $editContent .= "
"; + break; + default: + $editContent .= '
'; + $editContent .= "{{createText(\"$TableCol\",\"$TableCol\",\"$TableColLabel\",'',\$editable?\$data->$TableCol:'')}}\n"; + $editContent .= "
"; + } + } + + + endforeach; + $editContent .= '
'; + $editContent .= "\n"; + $editContent .= "\n"; + $editContent .= "
"; + $editContent .= " "; + + + + return $editContent; + } //end of ajaxEditContent method + public static function editContent($TableName, $directoryName) + { + $TableName = strtolower($TableName); + $TableCols = DB::select("describe " . $TableName); + $TableRows = DB::select("select * from " . $TableName); + $folder = ''; + $routeName = ''; + if (!empty($directoryName)) { + $folder .= strtolower($directoryName) . '/'; + $routeName .= strtolower($directoryName) . '.'; + } + $routeName .= strtolower(str_replace("tbl_", "", $TableName)); + $folder .= str_replace("tbl_", "", $TableName); + $Table_pk = str_replace("tbl_", "", $TableName) . "_id"; + $title = ucwords(str_replace("tbl_", "", $TableName)); + $editContent = "@extends('backend.template') + @section('content') +
+
+

{{ label('Edit $title') }}

+ \n +
+
"; + $editContent .= self::ajaxEditContent($TableName, $directoryName); + $editContent .= "
\n@endsection"; + $path = base_path() . "/resources/views/crud/generated/$folder/"; + $file = $path . "edit.blade.php"; + if (!file_exists("$path")) { + mkdir("$path", 0777, true); + } + if (!file_exists($file)) { + $file = fopen($file, 'w'); + fwrite($file, $editContent); + fclose($file); + } + + return $editContent; + } //end of editContent method + + public static function addContent($TableName, $directoryName) + { + $TableName = strtolower($TableName); + $TableCols = DB::select("describe " . $TableName); + $TableRows = DB::select("select * from " . $TableName); + $folder = ''; + $routeName = ''; + if (!empty($directoryName)) { + $folder .= strtolower($directoryName) . '/'; + $routeName .= strtolower($directoryName) . '.'; + } + $routeName .= strtolower(str_replace("tbl_", "", $TableName)); + $folder .= str_replace("tbl_", "", $TableName); + $Table_pk = str_replace("tbl_", "", $TableName) . "_id"; + $title = ucwords(str_replace("tbl_", "", $TableName)); + + $addContent = "@extends('backend.template') + @section('content') +
+
+

{{ label('Add $title') }}

+ \n +
+
"; + $addContent .= self::ajaxEditContent($TableName, $directoryName); + $addContent .= "
\n@endsection"; + $path = base_path() . "/resources/views/crud/generated/$folder/"; + $file = $path . "edit.blade.php"; + if (!file_exists("$path")) { + mkdir("$path", 0777, true); + } + if (!file_exists($file)) { + $file = fopen($file, 'w'); + fwrite($file, $addContent); + fclose($file); + } + + return $addContent; + } //End of addContent + /* + public static function ajaxAddContent($TableName, $directoryName) + { + $TableName = strtolower($TableName); + $TableCols = DB::select("describe " . $TableName); + $TableRows = DB::select("select * from " . $TableName); + $folder = ''; + $routeName = ''; + if (!empty($directoryName)) { + $folder .= strtolower($directoryName) . '/'; + $routeName .= strtolower($directoryName) . '.'; + } + $routeName .= strtolower(str_replace("tbl_", "", $TableName)); + $folder .= str_replace("tbl_", "", $TableName); + $Table_pk = str_replace("tbl_", "", $TableName) . "_id"; + $title = ucwords(str_replace("tbl_", "", $TableName)); + + $all_columns = self::getTableColumns($TableName); + $all_foreign_table = self::getForeignTable($all_columns); + $all_foreignKey = []; + if ($all_foreign_table) + foreach ($all_foreign_table as $key => $tablename) { + $all_foreignKey[$tablename] = self::getTableColumns($tablename); + $all_foreignKey[$tablename] = $all_foreignKey[$tablename][0] ?? null; + } + + $addContent = " +
$Table_pk]):route('$routeName.store')}}\" id=\"storeCustomForm\" method=\"POST\">\n @csrf \n"; + $addContent .= '
'; + foreach ($TableCols as $key => $TableCol): + $TableCol = $TableCol->Field; + if (!in_array($TableCol, self::$HiddenCols)) { + $TableColLabel = ucwords(str_replace("_", " ", $TableCol)); + + switch ($TableCol) { + case $TableCols[0]->Field: + break; + case (strpos($TableCol, "parent_") !== false): + $addContent .= '
'; + $addContent .= "{{createCustomSelect('$TableName', 'title', '" . $TableCols[0]->Field . "', '', '" . $TableColLabel . "','$TableCol', 'form-control select2','status<>-1')}}"; + $addContent .= "
"; + break; + case (strpos($TableCol, "s_id") !== false): //CASE TO HANDLE FOREIGN TABLE + $FTNameRaw = str_replace("s_id", "s", $TableCol); + $FTName = "tbl_" . str_replace("s_id", "s", $TableCol); + $FTCols = DB::select("describe " . $FTName); + $addContent .= '
'; + //createCustomSelect($tableName, $fieldNameToDisplay, $fieldNameForValue, $defaultValueSelected, $displayTextForLabel, $HTMLElementName, $additionalClass = "form-control", $defaultCondition = null) + $addContent .= "{{createCustomSelect('$FTName', 'title', '" . $FTCols[0]->Field . "', '', '" . $TableColLabel . "','$TableCol', 'form-control select2','status<>-1')}}"; + $addContent .= "
"; + break; + case (in_array($TableCol, self::$textEditorFields)): + $addContent .= '
'; + $addContent .= "{{createTextarea(\"$TableCol\",\"$TableCol ckeditor-classic\",\"$TableColLabel\")}}\n"; + $addContent .= "
"; + break; + case (in_array($TableCol, self::$textAreaFields)): + $addContent .= '
'; + $addContent .= "{{createPlainTextArea(\"$TableCol\",\"$TableCol \",\"$TableColLabel\")}}\n"; + $addContent .= "
"; + break; + case (in_array($TableCol, self::$imageFields)): + $addContent .= '
'; + $addContent .= "{{createImageInput(\"$TableCol\",\"$TableColLabel\")}}\n"; + $addContent .= "
"; + break; + case (in_array($TableCol, self::$dateFields)): + $addContent .= '
'; + $addContent .= "{{createDate(\"$TableCol\",\"$TableColLabel\",'',date('Y-m-d'))}}\n"; //createDate($name, $display = "",$class = "datepicker", $default = "") + $addContent .= "
"; + break; + case (in_array($TableCol, self::$passwordFields)): + $addContent .= '
'; + $addContent .= "{{createPassword(\"$TableCol\",\"$TableColLabel\",'')}}\n"; //createDate($name, $display = "",$class = "datepicker", $default = "") + $addContent .= "
"; + break; + default: + $addContent .= '
'; + $addContent .= "{{createText(\"$TableCol\",\"$TableCol\",\"$TableColLabel\")}}\n"; + $addContent .= "
"; + } + } + endforeach; + $addContent .= '
'; + $addContent .= "\n"; + $addContent .= "\n"; + $addContent .= "
"; + $addContent .= " "; + + + return $addContent; + } //End of ajax addContent + */ + public static function showContent($TableName, $directoryName) + { + $TableName = strtolower($TableName); + $TableCols = DB::select("describe " . $TableName); + $TableRows = DB::select("select * from " . $TableName); + $folder = ''; + $routeName = ''; + if (!empty($directoryName)) { + $folder .= strtolower($directoryName) . '/'; + $routeName .= strtolower($directoryName) . '.'; + } + $routeName .= strtolower(str_replace("tbl_", "", $TableName)); + $folder .= str_replace("tbl_", "", $TableName); + $Table_pk = str_replace("tbl_", "", $TableName) . "_id"; + $title = ucwords(str_replace("tbl_", "", $TableName)); + + $showContent = "@extends('backend.template') + @section('content') +
+
+

+ \n +
+
+ "; + $showContent .= self::ajaxShowContent($TableName, $directoryName); + $showContent .= " +
+
+ +@endSection"; + + $path = base_path() . "/resources/views/crud/generated/$folder/"; + $file = $path . "show.blade.php"; + if (!file_exists("$path")) { + mkdir("$path", 0777, true); + } + if (!file_exists($file)) { + $file = fopen($file, 'w'); + fwrite($file, $showContent); + fclose($file); + } + return $showContent; + } + + + public static function migrationContent($tableName) + { + $tableName = strtolower($tableName); + $columns = self::getTableColumns($tableName); + $tableFields = DB::select("describe $tableName"); + // foreach($tableFields as $tableField){ + // dd($tableField->Field); + // } + $pkField = str_replace("tbl_", "", $tableName) . "_id"; + //BibClass::pre($tableFields); + + $contentString = "Type; + //WRITE CODE HERE TO IDENTIFY THE TYPES OF FIELDS + switch ($Type) { + case 'int(11)': + if ($tableField->Field == $pkField): + $contentString .= "\$table->integer(\"$tableField->Field\")->autoIncrement();\n"; + else: + $contentString .= "\$table->integer(\"$tableField->Field\")->default(0);\n"; + endif; + break; + + case 'varchar(255)': + $contentString .= "\$table->string(\"$tableField->Field\")->nullable();\n"; + break; + + case 'datetime': + $contentString .= "\$table->datetime(\"$tableField->Field\")->nullable();\n"; + break; + + case 'text': + $contentString .= "\$table->text(\"$tableField->Field\")->nullable();\n"; + break; + case 'timestamp': + $contentString .= "\$table->text(\"$tableField->Field\")->nullable();\n"; + break; + default: + } + } + $contentString .= "\$table->timestamps();\n });\n }\n public function down()\n {\n Schema::dropIfExists(\"$tableName\");\n }\n};"; + /* + $file = fopen(base_path() . "/database/migrations/" . date('Y_m_d_his') . "_create_" . $tableName . "_table.php", 'w'); + fwrite($file, $contentString); + fclose($file); + */ + return $contentString; + } + + public static function routeContent($TableName, $directoryName) + { + $TableName = strtolower($TableName); + $TableName = str_replace("tbl_", "", $TableName); + $routePrefixName = ''; + $ControllerName = ''; + if (!empty($directoryName)) { + // $ControllerName .= ucwords($directoryName) . '/'; + $routePrefixName .= strtolower($directoryName) . '.'; + } + $ControllerName .= ucwords($TableName) . "Controller"; + $routePrefixName .= strtolower($TableName); + + $RouteContent = "Route::prefix(\"$TableName\")->group(function () { + Route::get('/', [$ControllerName::class, 'index'])->name('$routePrefixName.index'); + Route::get('/create', [$ControllerName::class, 'create'])->name('$routePrefixName.create'); + Route::post('/store', [$ControllerName::class, 'store'])->name('$routePrefixName.store'); + Route::post('/sort', [$ControllerName::class, 'sort'])->name('$routePrefixName.sort'); + Route::post('/updatealias', [$ControllerName::class, 'updatealias'])->name('$routePrefixName.updatealias'); + Route::get('/show/{id}', [$ControllerName::class, 'show'])->name('$routePrefixName.show'); + Route::get('/edit/{id}', [$ControllerName::class, 'edit'])->name('$routePrefixName.edit') ; + Route::post('/update/{id}', [$ControllerName::class, 'update'])->name('$routePrefixName.update'); + Route::get('/destroy/{id}', [$ControllerName::class, 'destroy'])->name('$routePrefixName.destroy'); + Route::get('/toggle/{id}', [$ControllerName::class, 'toggle'])->name('$routePrefixName.toggle'); + Route::get('/clone/{id}', [$ControllerName::class, 'clone'])->name('$routePrefixName.clone'); + });"; + + $path = base_path() . "/routes/CRUDgenerated/"; + $file = $path . "route." . $routePrefixName . ".php"; + if (!file_exists($path)) { + mkdir($path, 0777, true); + } + if (!file_exists($file)) { + $file = fopen($file, 'w'); + fwrite($file, " +
+

{{ label("' . $title . ' List") }}

+ {{label("Create New")}} +
+
+ + + + ' . PHP_EOL; + + foreach ($columns as $key => $column) { + + if (!in_array($column, $HiddenColumns)) + switch ($column) { + case (strpos($column, "parent_") !== false): + $listContent .= '' . PHP_EOL; + break; + case (strpos($column, "s_id") !== false): + $ParentName = str_replace("s_id", "s", $column); + $listContent .= '' . PHP_EOL; + break; + default: + $listContent .= '' . PHP_EOL; + } + + } + $listContent .= ' + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + '; + foreach ($columns as $key => $column) { + if (!in_array($column, $HiddenColumns)) { + + switch ($column) { + case (strpos($column, "parent_") !== false): + $listContent .= '' . PHP_EOL; + break; + case (strpos($column, "s_id") !== false): //CASE TO HANDLE FOREIGN TABLE + $FTNameRaw = str_replace("s_id", "s", $column); + $FTName = "tbl_" . str_replace("s_id", "s", $column); + $FTCols = DB::select("describe " . $FTName); + $listContent .= '"; + break; + case 'alias': + $listContent .= '' . PHP_EOL; + break; + case (in_array($column, self::$imageFields)): + $listContent .= '' . PHP_EOL; + break; + case (in_array($column, self::$dateFields)): + $listContent .= '' . PHP_EOL; + break; + case 'status': + $listContent .= '' . PHP_EOL; + break; + default: + $listContent .= '' . PHP_EOL; + } + } + } + $listContent .= ' + + + @endforeach + + +
{{label("Sn.")}}{{ label("Parent") }}{{ label("' . $ParentName . '") }}{{ label("' . $column . '") }}{{ label("Action") }} +
{{ $i++ }}' . PHP_EOL; + $listContent .= '{!! getFieldData("' . $TableName . '", "title", "' . $columns[0] . '", $item->' . $column . ') !!}' . PHP_EOL; + $listContent .= '' . PHP_EOL; + //function getFieldData($tableName, $returnField, $referenceFieldName, $referenceValue) + $listContent .= '{!! getFieldData("' . $FTName . '", "title", "' . $FTCols[0]->Field . '", $item->' . $column . ') !!}' . PHP_EOL; + $listContent .= " +
+ {{ $item->alias }} + +
+ change alias +
{{ showImageThumb($item->' . $column . ') }}{{ myDate($item->' . $column . ') }}{!! $item->status_name !!}{{ $item->' . $column . ' }} + + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + '; + + $path = base_path() . "/resources/views/crud/generated/$folder/"; + $file = $path . "index.blade.php"; + if (!file_exists("$path")) { + mkdir("$path", 0777, true); + } + if (!file_exists($file)) { + $file = fopen($file, 'w'); + fwrite($file, $listContent); + fclose($file); + } + return $listContent; + } + + //End of list code content + + //ajax complete List + + + public static function modelContent($tableName, $directoryName) + { + $tableName = strtolower($tableName); + $modelPath = ''; + if (!empty($directoryName)) { + $modelPath .= "\\" . ucfirst($directoryName); + } + + $modelClass = ucfirst(str_replace("tbl_", "", $tableName)); + + + $tableFields = DB::select("describe $tableName"); + $pkField = $tableFields[0]->Field; + + $skipPRimaryKey = 1; + $tableColumns = ''; + foreach ($tableFields as $tableField): + if ($skipPRimaryKey == 1) { + $skipPRimaryKey = 2; + continue; + } + $tableColumns .= "'" . $tableField->Field . "',\n"; + + endforeach; + + $contentString = "status == 1 ? ' Active ' : 'Inactive'; + } + + protected function createdBy(): Attribute + { + return Attribute::make( + get: fn (\$value) => User::find(\$value) ? User::find(\$value)->name : '', + ); + } + + protected function updatedBy(): Attribute + { + return Attribute::make( + get: fn (\$value) => User::find(\$value) ? User::find(\$value)->name : '', + ); + } + }"; + + $modelPath = ''; + if (!empty($directoryName)) { + $modelPath .= ucfirst($directoryName) . '/'; + } + + if (!file_exists(base_path() . '/app/Models/' . $modelPath)) { + mkdir(base_path() . '/app/Models/' . $modelPath, 0777, true); + } + $filename = $modelClass . ".php"; + if (!file_exists(base_path() . "/app/Models/" . $modelPath . $filename)) { + $file = fopen(base_path() . "/app/Models/" . $modelPath . $filename, 'w'); + fwrite($file, $contentString); + fclose($file); + } + return $contentString; + } + + + public static function controllerContent($tableName, $directoryName) + { + $tableName = strtolower($tableName); + $tableFields = DB::select("describe $tableName"); + $pkField = $tableFields[0]->Field; + $controllerName = ucfirst(str_replace("tbl_", "", $tableName)) . "Controller"; + $viewName = ''; + $controllerPath = ''; + $modelName = ''; + if (!empty($directoryName)) { + $viewName .= strtolower($directoryName) . '.'; + $controllerPath .= "\\" . ucfirst($directoryName); + $modelName .= ucfirst($directoryName) . '\\'; + } + $modelName .= ucfirst(str_replace("tbl_", "", $tableName)); + $viewName .= strtolower(str_replace("tbl_", "", $tableName)); + $modelClass = ucfirst(str_replace("tbl_", "", $tableName)); + $tableAliasColumnName = "title"; + + $contentString = "modelService = new CommonModelService(\$model); + } + public function index(Request \$request) + { + createActivityLog($controllerName::class, 'index', '$directoryName $modelClass index'); + \$data = $modelClass::where('status','<>',-1)->orderBy('display_order')->get(); + + return view(\"crud.generated.$viewName.index\", compact('data')); + } + + public function create(Request \$request) + { + createActivityLog($controllerName::class, 'create', '$directoryName $modelClass create'); + \$TableData = $modelClass::where('status','<>',-1)->orderBy('display_order')->get(); + \$editable=false; + return view(\"crud.generated.$viewName.edit\",compact('TableData','editable')); + } + + public function store(Request \$request) + { + createActivityLog($controllerName::class, 'store', '$directoryName $modelClass store'); + \$validator = Validator::make(\$request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if (\$validator->fails()) { + return response()->json([ + 'error' => \$validator->errors(), + ],500); + } + \$request->request->add(['alias' => slugify(\$request->$tableAliasColumnName)]); + \$request->request->add(['display_order' => getDisplayOrder('" . $tableName . "')]); + \$request->request->add(['created_at' => date(\"Y-m-d h:i:s\")]); + \$request->request->add(['updated_at' => date(\"Y-m-d h:i:s\")]); + \$requestData=\$request->all(); + array_walk_recursive(\$requestData, function (&\$value) { + \$value = str_replace(env('APP_URL').'/', '', \$value); + }); + array_walk_recursive(\$requestData, function (&\$value) { + \$value = str_replace(env('APP_URL'), '', \$value); + }); + DB::beginTransaction(); + try { + \$operationNumber = getOperationNumber(); + \$this->modelService->create(\$operationNumber, \$operationNumber, null, \$requestData); + } catch (\Exception \$e) { + DB::rollBack(); + Log::info(\$e->getMessage()); + createErrorLog($controllerName::class, 'store', \$e->getMessage()); + return response()->json(['status' => false, 'message' => \$e->getMessage()], 500); + } + DB::commit(); + if (\$request->ajax()) { + return response()->json(['status' => true, 'message' => 'The $modelClass Created Successfully.'], 200); + } + return redirect()->route('$viewName.index')->with('success','The $modelClass created Successfully.'); + } + + public function sort(Request \$request) + { + \$idOrder = \$request->input('id_order'); + + foreach (\$idOrder as \$index => \$id) { + \$companyArticle = $modelClass::find(\$id); + \$companyArticle->display_order = \$index + 1; + \$companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request \$request) + { + + \$articleId = \$request->input('articleId'); + \$newAlias = \$request->input('newAlias'); + \$companyArticle = $modelClass::find(\$articleId); + if (!\$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + \$companyArticle->alias = \$newAlias; + \$companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request \$request, \$id) + { + createActivityLog($controllerName::class, 'show', '$directoryName $modelClass show'); + \$data = $modelClass::findOrFail(\$id); + + return view(\"crud.generated.$viewName.show\", compact('data')); + } + + + public function edit(Request \$request, \$id) + { + createActivityLog($controllerName::class, 'edit', '$directoryName $modelClass edit'); + \$TableData = $modelClass::where('status','<>',-1)->orderBy('display_order')->get(); + \$data = $modelClass::findOrFail(\$id); + \$editable=true; + return view(\"crud.generated.$viewName.edit\", compact('data','TableData','editable')); + } + + + public function update(Request \$request, \$id) + { + createActivityLog($controllerName::class, 'update', '$directoryName $modelClass update'); + \$validator = Validator::make(\$request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if (\$validator->fails()) { + return response()->json([ + 'error' => \$validator->errors(), + ],500); + } + \$requestData=\$request->all(); + array_walk_recursive(\$requestData, function (&\$value) { + \$value = str_replace(env('APP_URL').'/', '', \$value); + }); + array_walk_recursive(\$requestData, function (&\$value) { + \$value = str_replace(env('APP_URL'), '', \$value); + }); + DB::beginTransaction(); + try { + \$OperationNumber = getOperationNumber(); + \$this->modelService->update(\$OperationNumber, \$OperationNumber, null, \$requestData, \$request->input('" . $pkField . "')); + } catch (Exception \$e) { + DB::rollBack(); + Log::info(\$e->getMessage()); + createErrorLog($controllerName::class, 'update', \$e->getMessage()); + return response()->json(['status' => false, 'message' => \$e->getMessage()], 500); + } + DB::commit(); + if (\$request->ajax()) { + return response()->json(['status' => true, 'message' => 'The $modelClass updated Successfully.'], 200); + } + // return redirect()->route('$viewName.index')->with('success','The $modelClass updated Successfully.'); + return redirect()->back()->with('success', 'The $modelClass updated successfully.'); + } + + public function destroy(Request \$request,\$id) + { + createActivityLog($controllerName::class, 'destroy', '$directoryName $modelClass destroy'); + DB::beginTransaction(); + try { + \$OperationNumber = getOperationNumber(); + \$this->modelService->destroy(\$OperationNumber, \$OperationNumber, \$id); + } catch (Exception \$e) { + DB::rollBack(); + Log::info(\$e->getMessage()); + createErrorLog($controllerName::class, 'destroy', \$e->getMessage()); + return response()->json(['status' => false, 'message' => \$e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The $modelClass Deleted Successfully.'],200); + } + public function toggle(Request \$request,\$id) + { + createActivityLog($controllerName::class, 'destroy', '$directoryName $modelClass destroy'); + \$data = $modelClass::findOrFail(\$id); + \$requestData=['status'=>(\$data->status==1)?0:1]; + DB::beginTransaction(); + try { + \$OperationNumber = getOperationNumber(); + \$this->modelService->update(\$OperationNumber, \$OperationNumber, null, \$requestData, \$id); + } catch (Exception \$e) { + DB::rollBack(); + Log::info(\$e->getMessage()); + createErrorLog($controllerName::class, 'destroy', \$e->getMessage()); + return response()->json(['status' => false, 'message' => \$e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The $modelClass Deleted Successfully.'],200); + } + public function clone(Request \$request,\$id) + { + createActivityLog($controllerName::class, 'clone', '$directoryName $modelClass clone'); + \$data = $modelClass::findOrFail(\$id); + unset(\$data['updatedby']); + unset(\$data['createdby']); + \$requestData=\$data->toArray(); + DB::beginTransaction(); + try { + \$OperationNumber = getOperationNumber(); + \$this->modelService->create(\$OperationNumber, \$OperationNumber, null, \$requestData); + } catch (Exception \$e) { + DB::rollBack(); + Log::info(\$e->getMessage()); + createErrorLog($controllerName::class, 'clone', \$e->getMessage()); + return response()->json(['status' => false, 'message' => \$e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The $modelClass Clonned Successfully.'],200); + } + + + + } + "; + // $filename = ($controllerPath != "") ? $controllerPath . "/" : ""; + $controllerDirectory = ''; + if (!empty($controllerPath)) { + $controllerDirectory = ucfirst($directoryName) . '/'; + } + $filename = $controllerName . ".php"; + $filePath = base_path() . "/app/Http/Controllers/" . $controllerDirectory . $filename; + + if (!file_exists($filePath)) { + if (!file_exists(base_path() . '/app/Http/Controllers/' . $controllerDirectory)) { + mkdir(base_path() . '/app/Http/Controllers/' . $controllerDirectory, 0777, true); + } + $file = fopen($filePath, 'w'); + fwrite($file, $contentString); + fclose($file); + } + + return $contentString; + } +} diff --git a/app/Http/Controllers/NationalitiesController.php b/app/Http/Controllers/NationalitiesController.php new file mode 100644 index 0000000..ba8e578 --- /dev/null +++ b/app/Http/Controllers/NationalitiesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(NationalitiesController::class, 'index', ' Nationalities index'); + $data = Nationalities::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.nationalities.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(NationalitiesController::class, 'create', ' Nationalities create'); + $TableData = Nationalities::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.nationalities.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(NationalitiesController::class, 'store', ' Nationalities store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_nationalities')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(NationalitiesController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Nationalities Created Successfully.'], 200); + } + return redirect()->route('nationalities.index')->with('success','The Nationalities created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Nationalities::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Nationalities::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(NationalitiesController::class, 'show', ' Nationalities show'); + $data = Nationalities::findOrFail($id); + + return view("crud.generated.nationalities.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(NationalitiesController::class, 'edit', ' Nationalities edit'); + $TableData = Nationalities::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Nationalities::findOrFail($id); + $editable=true; + return view("crud.generated.nationalities.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(NationalitiesController::class, 'update', ' Nationalities update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('nationality_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(NationalitiesController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Nationalities updated Successfully.'], 200); + } + // return redirect()->route('nationalities.index')->with('success','The Nationalities updated Successfully.'); + return redirect()->back()->with('success', 'The Nationalities updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(NationalitiesController::class, 'destroy', ' Nationalities destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(NationalitiesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Nationalities Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(NationalitiesController::class, 'destroy', ' Nationalities destroy'); + $data = Nationalities::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(NationalitiesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Nationalities Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(NationalitiesController::class, 'clone', ' Nationalities clone'); + $data = Nationalities::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(NationalitiesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Nationalities Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/OnboardingsController.php b/app/Http/Controllers/OnboardingsController.php new file mode 100644 index 0000000..b40ea07 --- /dev/null +++ b/app/Http/Controllers/OnboardingsController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(OnboardingsController::class, 'index', ' Onboardings index'); + $data = Onboardings::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.onboardings.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(OnboardingsController::class, 'create', ' Onboardings create'); + $TableData = Onboardings::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.onboardings.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(OnboardingsController::class, 'store', ' Onboardings store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_onboardings')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(OnboardingsController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Onboardings Created Successfully.'], 200); + } + return redirect()->route('onboardings.index')->with('success','The Onboardings created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Onboardings::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Onboardings::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(OnboardingsController::class, 'show', ' Onboardings show'); + $data = Onboardings::findOrFail($id); + + return view("crud.generated.onboardings.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(OnboardingsController::class, 'edit', ' Onboardings edit'); + $TableData = Onboardings::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Onboardings::findOrFail($id); + $editable=true; + return view("crud.generated.onboardings.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(OnboardingsController::class, 'update', ' Onboardings update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('onboarding_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(OnboardingsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Onboardings updated Successfully.'], 200); + } + // return redirect()->route('onboardings.index')->with('success','The Onboardings updated Successfully.'); + return redirect()->back()->with('success', 'The Onboardings updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(OnboardingsController::class, 'destroy', ' Onboardings destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(OnboardingsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Onboardings Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(OnboardingsController::class, 'destroy', ' Onboardings destroy'); + $data = Onboardings::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(OnboardingsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Onboardings Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(OnboardingsController::class, 'clone', ' Onboardings clone'); + $data = Onboardings::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(OnboardingsController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Onboardings Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/PermissionsController.php b/app/Http/Controllers/PermissionsController.php new file mode 100644 index 0000000..249d7da --- /dev/null +++ b/app/Http/Controllers/PermissionsController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(PermissionsController::class, 'index', ' Permissions index'); + $data = Permissions::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.permissions.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(PermissionsController::class, 'create', ' Permissions create'); + $TableData = Permissions::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.permissions.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(PermissionsController::class, 'store', ' Permissions store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_permissions')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(PermissionsController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Permissions Created Successfully.'], 200); + } + return redirect()->route('permissions.index')->with('success','The Permissions created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Permissions::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Permissions::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(PermissionsController::class, 'show', ' Permissions show'); + $data = Permissions::findOrFail($id); + + return view("crud.generated.permissions.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(PermissionsController::class, 'edit', ' Permissions edit'); + $TableData = Permissions::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Permissions::findOrFail($id); + $editable=true; + return view("crud.generated.permissions.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(PermissionsController::class, 'update', ' Permissions update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('permission_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(PermissionsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Permissions updated Successfully.'], 200); + } + // return redirect()->route('permissions.index')->with('success','The Permissions updated Successfully.'); + return redirect()->back()->with('success', 'The Permissions updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(PermissionsController::class, 'destroy', ' Permissions destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(PermissionsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Permissions Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(PermissionsController::class, 'destroy', ' Permissions destroy'); + $data = Permissions::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(PermissionsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Permissions Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(PermissionsController::class, 'clone', ' Permissions clone'); + $data = Permissions::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(PermissionsController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Permissions Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/ProviencesController.php b/app/Http/Controllers/ProviencesController.php new file mode 100644 index 0000000..ed12e03 --- /dev/null +++ b/app/Http/Controllers/ProviencesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(ProviencesController::class, 'index', ' Proviences index'); + $data = Proviences::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.proviences.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(ProviencesController::class, 'create', ' Proviences create'); + $TableData = Proviences::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.proviences.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(ProviencesController::class, 'store', ' Proviences store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_proviences')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ProviencesController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Proviences Created Successfully.'], 200); + } + return redirect()->route('proviences.index')->with('success','The Proviences created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Proviences::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Proviences::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(ProviencesController::class, 'show', ' Proviences show'); + $data = Proviences::findOrFail($id); + + return view("crud.generated.proviences.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(ProviencesController::class, 'edit', ' Proviences edit'); + $TableData = Proviences::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Proviences::findOrFail($id); + $editable=true; + return view("crud.generated.proviences.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(ProviencesController::class, 'update', ' Proviences update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('provience_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ProviencesController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Proviences updated Successfully.'], 200); + } + // return redirect()->route('proviences.index')->with('success','The Proviences updated Successfully.'); + return redirect()->back()->with('success', 'The Proviences updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(ProviencesController::class, 'destroy', ' Proviences destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ProviencesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Proviences Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(ProviencesController::class, 'destroy', ' Proviences destroy'); + $data = Proviences::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ProviencesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Proviences Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(ProviencesController::class, 'clone', ' Proviences clone'); + $data = Proviences::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ProviencesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Proviences Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/RegistrationsController.php b/app/Http/Controllers/RegistrationsController.php new file mode 100644 index 0000000..a5e181f --- /dev/null +++ b/app/Http/Controllers/RegistrationsController.php @@ -0,0 +1,530 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + $data = $this->filterRegistrations($request); + return view("crud.generated.registrations.index", compact('data', 'request')); + } + public function bycampaign(Request $request, $CampaignAlias) + { + $Campaign = Campaigns::where("status", 1)->where("alias", $CampaignAlias)->first(); + $title = "Registrations By Campaign : " . $Campaign->title; + $data = $this->filterRegistrations($request, $Campaign); + return view("crud.generated.registrations.index", compact('data', 'title', 'request')); + } + public function bycategory(Request $request, $CategoryAlias) + { + $LeadCategory = Leadcategories::where("alias", $CategoryAlias)->first(); + $title = "Registrations By Lead Category : " . $LeadCategory->title; + $data = $this->filterRegistrations($request, null, $LeadCategory); + $reques = $request->all(); + return view("crud.generated.registrations.index", compact('data', 'title', 'request')); + } + public function bybranch(Request $request, $BranchAlias) + { + $Branch = Branches::where("alias", $BranchAlias)->first(); + $title = "Registrations By Branch : " . $Branch->title; + $data = $this->filterRegistrations($request, null,null,null,null,null, $Branch); + $reques = $request->all(); + return view("crud.generated.registrations.index", compact('data', 'title', 'request')); + } + public function bysource(Request $request, $SourceAlias) + { + $Source = Sources::where("alias", $SourceAlias)->first(); + $title = "Registrations By Source : " . $Source->title; + $data = $this->filterRegistrations($request, null, null, $Source); + $reques = $request->all(); + return view("crud.generated.registrations.index", compact('data', 'title', 'request')); + } + public function bycountry(Request $request, $CountryAlias) + { + $Country = Countries::where("alias", $CountryAlias)->first(); + $title = "Registrations By Country : " . $Country->title; + $data = $this->filterRegistrations($request, null, null, null, $Country); + $reques = $request->all(); + return view("crud.generated.registrations.index", compact('data', 'title', 'request')); + } + public function byagent(Request $request, $AgentAlias) + { + $Agent = Agents::where("alias", $AgentAlias)->first(); + $title = "Registrations By Agency : " . $Agent->title; + $data = $this->filterRegistrations($request, null, null, null, null, $Agent); + $reques = $request->all(); + return view("crud.generated.registrations.index", compact('data', 'title', 'request')); + } + private function filterRegistrations($request, $Campaign = null, $LeadCategory = null, $Source = null, $Country = null, $Agent = null, $Branch=null) + { + DB::enableQueryLog(); + $requestData = $request->all(); + // dd($requestData); + $data = Registrations::where('status', '<>', -1); + if (isset($requestData['from']) && $requestData['from']) { + $data = $data->whereDate("created_at", ">=", $requestData['from']); + } + if (isset($requestData['to'])) { + $data = $data->whereDate("created_at", "<", $requestData['to']); + } + if (isset($requestData['source_id']) && $requestData['source_id'] != 0) { + $data = $data->where("sources_id", "=", $requestData['source_id']); + } + if (isset($requestData['country_id']) && $requestData['country_id'] != 0) { + $data = $data->where("countries_id", "=", $requestData['country_id']); + } + if (isset($requestData['leadcategory_id']) && $requestData['leadcategory_id']) { + $data = $data->where("leadcategories_id", "=", $requestData['leadcategory_id']); + } + if (isset($requestData['branch_id']) && $requestData['branch_id']) { + $data = $data->where("branches_id", "=", $requestData['branch_id']); + } + if ($Campaign !== null) { + $data = $data->where("campaigns_id", $Campaign->campaign_id); + } + if ($LeadCategory !== null) { + $data = $data->where("leadcategories_id", $LeadCategory->leadcategory_id); + } + if ($Source !== null) { + $data = $data->where("sources_id", $Source->source_id); + } + if ($Country !== null) { + $data = $data->where("countries_id", $Country->country_id); + } + if ($Agent !== null) { + $data = $data->where("agents_id", $Agent->agent_id); + } + if ($Branch !== null) { + $data = $data->where("branches_id", $Branch->branch_id); + } + $data = $data->orderBy('display_order'); + $sqlQuery = $data->toSql(); + $data = $data->get(); + $data->RawQuery = DB::getQueryLog(); + return $data; + } + public function create(Request $request) + { + createActivityLog(RegistrationsController::class, 'create', ' Registrations create'); + $TableData = Registrations::where('status', '<>', -1)->orderBy('display_order')->get(); + return view("crud.generated.registrations.create", compact('TableData')); + } + public function store(Request $request) + { + $validator = Validator::make($request->all(), [ + // 'mobile' => 'required|numeric|unique:registrations,mobile', // Assuming 'users' is your table name and 'mobile' is the column + 'mobile' => 'required|numeric:registrations,mobile', // Assuming 'users' is your table name and 'mobile' is the column + ]); + $Campaign = Campaigns::findOrFail($request->campaigns_id); + if ($validator->fails()) { + $existingRegistration = Registrations::where('mobile', $request->mobile)->first(); + if ($existingRegistration) { + //$qr_code = LMS::getLeadQR($existingRegistration->registration_id); + return response()->json([ + 'status' => false, + 'message' => 'Mobile number already exists. Returning existing data.', + // 'qr_code' => site_url(str_replace(public_path(), '', $qr_code)), + 'registration' => $existingRegistration, + 'registration_id' => $existingRegistration->registration_id, + ], 200); + } + return response()->json([ + 'status' => false, + 'errors' => $validator->errors(), + 'message' => 'Form validation failed.', + ], 200); // 422 Unprocessable Entity + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_registrations')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $request->request->add(['highest_qualification' => $request->qualification]); + $request->request->add(['highest_year' => ($request->highest_year) ? $request->highest_year : 0]); + $request->request->add(['highest_college' => $request->board]); + $request->request->add(['intrested_for_country' => ($request->preferred_destination) ? $request->preferred_destination : SITEVARS->Countries[0]->country_id]); + $request->request->add(['sources_id' => ($request->sources_id) ? $request->sources_id : 2]); + $request->request->add(['campaigns_id' => ($request->campaigns_id) ? $request->campaigns_id : SITEVARS->Campaigns[0]->campaign_id]); + $request->request->add(['countries_id' => SITEVARS->Countries[0]->country_id]); + $request->request->add(['remarks' => $request->message]); + $requestData = $request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL') . '/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $registration = $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + dd($e->getMessage()); + DB::rollBack(); + } + DB::commit(); + $mailer = new CustomMailer($requestData); + if (env('SEND_EMAIL') == true) { + // Mail::bcc("prajwalbro@hotmail.com")->send($mailer->build()); + Mail::to($request['email'])->send($mailer->build()); + $notify_emails = isset($Campaign->notify_emails) ? explode(",", $Campaign->notify_emails) : "prajwalbro@hotmail.com"; + Mail::cc($notify_emails)->send($mailer->registration_completed()); + } + $msg = $Campaign->sms_message; + $success_messsage = $Campaign->success_messsage; + $success_messsage = str_replace('%name%', $request['name'], $success_messsage); + // dd($Campaign); + if (env('SEND_SMS') == true) { + + $msg = str_replace('%name%', $request['name'], $msg); + LMS::sendSMSWithCurl($requestData['mobile'], $msg); + } + LMS::SaveInGoogleSheet($requestData); + + return response()->json([ + 'status' => true, + 'qr_code' => false, + 'message' => ($success_messsage) ? $success_messsage : 'The Registration Created Successfully.', + 'registration_id' => $registration->registration_id, + ], 200); + } + public function saveform(Request $request) + { + $validator = Validator::make($request->all(), [ + 'mobile' => 'required|numeric|unique:registrations,mobile', // Assuming 'users' is your table name and 'mobile' is the column + ]); + $Campaign = Campaigns::findOrFail($request->campaigns_id); + if ($validator->fails()) { + $existingRegistration = Registrations::where('mobile', $request->mobile)->first(); + if ($existingRegistration) { + return response()->json([ + 'status' => false, + 'message' => 'Mobile number already exists', + 'registration' => $existingRegistration, + 'registration_id' => $existingRegistration->registration_id, + ], 200); + } + return response()->json([ + 'status' => false, + 'errors' => $validator->errors(), + 'message' => 'Form validation failed.', + ], 200); // 422 Unprocessable Entity + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_registrations')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $request->request->add(['highest_qualification' => $request->qualification]); + $request->request->add(['highest_year' => ($request->highest_year) ? $request->highest_year : 0]); + $request->request->add(['highest_college' => $request->board]); + $request->request->add(['intrested_for_country' => $request->preferred_destination]); + $request->request->add(['sources_id' => ($request->sources_id) ? $request->sources_id : 2]); + $request->request->add(['campaigns_id' => ($request->campaigns_id) ? $request->campaigns_id : SITEVARS->Campaigns[0]->campaign_id]); + $request->request->add(['countries_id' => SITEVARS->Countries[0]->country_id]); + $request->request->add(['remarks' => $request->message]); + $requestData = $request->all(); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $registration = $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + if (env('SEND_EMAIL') == true) { + $notify_emails = (isset($Campaign->notify_emails) && ($Campaign->notify_emails != "")) ? explode(",", $Campaign->notify_emails) : "prajwalbro@hotmail.com"; + $mailer = new CustomMailer($requestData); + Mail::to($request['email'])->send($mailer->build()); + Mail::cc($notify_emails)->send($mailer->build()); + Mail::bcc("prajwalbro@hotmail.com")->send($mailer->build()); + } + $success_messsage = $Campaign->success_messsage; + if (isset($Campaign->sms_message) && ($Campaign->sms_message != "")) { + $msg = $Campaign->sms_message; + $success_messsage = str_replace('%name%', $request['name'], $success_messsage); + $msg = str_replace('%name%', $request['name'], $msg); + if (env('SEND_SMS') == true) LMS::sendSMSWithCurl($requestData['mobile'], $msg); + } + } catch (\Exception $e) { + dd($e->getMessage()); + DB::rollBack(); + } + DB::commit(); + return response()->json([ + 'status' => true, + 'message' => ($success_messsage) ? $success_messsage : 'The Registration Created Successfully.', + 'registration_id' => $registration->registration_id, + ], 200); + } + function sendbulksms(Request $request) + { + $validator = Validator::make($request->all(), [ + 'message' => 'required', // Assuming 'users' is your table name and 'mobile' is the column + ]); + if ($validator->fails()) { + return response()->json([ + 'status' => false, + 'errors' => $validator->errors(), + 'message' => 'Form validation failed.', + ], 200); // 422 Unprocessable Entity + } + $mobile_nos = explode(",", $request->mobile); + //dd($mobile_nos); + $msg = $request->message; + foreach ($mobile_nos as $mobile) { + LMS::sendSMSWithCurl($mobile, $msg); + } + } + public function home(Request $request, $campaign_alias = null) + { + $alias = str_replace("_", "-", $campaign_alias); + $Campaign = Campaigns::where("status", "1")->where("alias", $alias)->first(); + if ($Campaign) { + $viewPath = env("CLIENT_PATH") . ".landing.$campaign_alias"; + // echo $viewPath;die; + if (view()->exists($viewPath)) + return view($viewPath, compact("Campaign")); + else + return view(env("CLIENT_PATH") . '.home', compact("Campaign")); + } + switch ($campaign_alias) { + case 'office': // Student/Visitor office visit gareko bela, MOBILE bata QR Scan garera fill garne + return view("access.office-visits"); + case 'spin_the_wheel': // Student/Visitor office visit gareko bela, MOBILE bata QR Scan garera fill garne + return view("games.spin_the_wheel.game"); + case 'direct': //Office ko Reception Bata directly fill-in garne form + return view("backend.reception"); + case 'online': //Adv etc run garda online default landing bata fill-in garne form + return view(env("CLIENT_PATH") . ".home"); + default: + $Campaign = LMS::getActiveCampaign(); + if ($Campaign) { + $viewPath = env("CLIENT_PATH") . ".landing.$Campaign->alias"; + // echo $viewPath;die; + if (view()->exists($viewPath)) + return view($viewPath, compact("Campaign")); + else + return view(env("CLIENT_PATH") . '.home', compact("Campaign")); + } + + // $viewPath = env("CLIENT_PATH") . ".landing"; + // if (view()->exists($viewPath)) + // return view($viewPath, compact("Campaign")); + // else + // return view(env("CLIENT_PATH") . '.home', compact("Campaign")); + } + } + public function zapierrequest(Request $request) + { + //Office ko Reception Bata directly fill-in garne form + //return view("backend.reception"); + $requiredFields = ['name', 'email', 'phone', 'qualification', 'passed', 'interest', 'source']; + if ($this->checkFieldsPresence($request, $requiredFields)) { + $campaign = Campaigns::orderBy("display_order", "ASC")->first(); + $source = Sources::orderBy("display_order", "ASC")->first(); + $data = [ + 'name' => $request->query('name'), + 'email' => $request->query('email'), + 'phone' => $request->query('phone'), + 'mobile' => $request->query('phone'), + 'highest_qualification' => $request->query('qualification'), + 'highest_year' => $request->query('passed'), + 'intrested_course' => $request->query('interest'), + // 'intrested_country' => $request->query('interest'), + 'leadcategories_id' => 0, + 'campaigns_id' => $campaign ? $campaign->campaign_id : null, + 'sourcess_id' => $source ? $source->source_id : null, + 'remarks' => $request->query('source') + ]; + Registrations::create($data); + return response()->json(['message' => 'Registration successful'], Response::HTTP_OK); + } else { + return response()->json(['message' => 'Registration Failed. Missing required fields.'], Response::HTTP_BAD_REQUEST); + } + } + private function checkFieldsPresence(Request $request, array $fields) + { + foreach ($fields as $field) { + if (!$request->query($field)) { + return false; + } + } + return true; + } + public function reception(Request $request) + { + //Office ko Reception Bata directly fill-in garne form + return view("backend.reception"); + } + public function reception_registrations(Request $request) + { + $data = $this->filterRegistrations($request); + //Office ko Reception Bata directly fill-in garne form + return view("backend.reception.registrations", compact('data')); + } + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + foreach ($idOrder as $index => $id) { + $companyArticle = Registrations::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Registrations::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + public function view(Request $request, $id) + { + // $data = ''; + if (Auth::check()) { + $data = Registrations::where(DB::raw('md5(registration_id)'), $id)->firstOrFail(); + if ($data) { + $qrdata = [ + 'registrations_id' => $data->registration_id, + 'qrscan_type' => ($request->qrscan_type) ? $request->qrscan_type : 'mannual scan', + 'qrscan_location' => ($request->qrscan_type) ? $request->qrscan_type : 'office visit', + // Add other columns as needed + ]; + Qrscans::create($qrdata); + return view("access.steps.scanqr", compact('data')); + } + return "Sorry!!! It seems QR is INVALID"; + } else { + // Redirect the user to the login page or handle the case where the user is not logged in + return redirect()->route('login'); // Adjust 'login' to the actual login route in your application + } + } + public function confirmation($id) + { + $data = ''; + $data = Registrations::where(DB::raw('md5(registration_id)'), $id)->firstOrFail(); + return view("lms.confirmation", compact('data')); + } + public function show(Request $request, $id) + { + createActivityLog(RegistrationsController::class, 'show', ' Registrations show'); + $data = Registrations::findOrFail($id); + return view("crud.generated.registrations.show", compact('data')); + } + public function edit(Request $request, $id) + { + createActivityLog(RegistrationsController::class, 'edit', ' Registrations edit'); + $TableData = Registrations::where('status', '<>', -1)->orderBy('display_order')->get(); + $data = Registrations::findOrFail($id); + if ($request->ajax()) { + $html = view("crud.generated.registrations.ajax.edit", compact('data'))->render(); + return response()->json(['status' => true, 'content' => $html], 200); + } + return view("crud.generated.registrations.edit", compact('data', 'TableData')); + } + public function ajaxedit(Request $request, $id) + { + createActivityLog(RegistrationsController::class, 'edit', ' Registrations edit'); + $TableData = Registrations::where('status', '<>', -1)->orderBy('display_order')->get(); + $data = Registrations::findOrFail($id); + return view("crud.generated.registrations.ajaxedit", compact('data', 'TableData')); + } + public function update(Request $request, $id) + { + createActivityLog(RegistrationsController::class, 'update', ' Registrations update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ], 500); + } + $requestData = $request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL') . '/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('registration_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RegistrationsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Registrations updated Successfully.'], 200); + } + // return redirect()->route('registrations.index')->with('success','The Registrations updated Successfully.'); + return redirect()->back()->with('success', 'The Registrations updated successfully.'); + } + public function destroy(Request $request, $id) + { + createActivityLog(RegistrationsController::class, 'destroy', ' Registrations destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RegistrationsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Registrations Deleted Successfully.'], 200); + } + public function toggle(Request $request, $id) + { + createActivityLog(RegistrationsController::class, 'destroy', ' Registrations destroy'); + $data = Registrations::findOrFail($id); + $requestData = ['status' => ($data->status == 1) ? 0 : 1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RegistrationsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Registrations Deleted Successfully.'], 200); + } +} diff --git a/app/Http/Controllers/RolepermissionsController.php b/app/Http/Controllers/RolepermissionsController.php new file mode 100644 index 0000000..92f5eec --- /dev/null +++ b/app/Http/Controllers/RolepermissionsController.php @@ -0,0 +1,226 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(RolepermissionsController::class, 'index', ' Rolepermissions index'); + $data = Rolepermissions::where('status', '<>', -1)->orderBy('display_order')->get(); + $PermissionGroups = Permissions::select('modal') + ->where('status', '<>', -1) + ->groupBy('modal') + ->get(); + foreach ($PermissionGroups as $Group) { + $Group->Commands = Permissions::where('status', '<>', -1)->where("modal", $Group->modal)->orderBy('command')->get(); + } + // $Permissions = Permissions::where('status', '<>', -1)->orderBy('modal')->orderBy('command')->get(); + return view("crud.generated.rolepermissions.index", compact('data', 'PermissionGroups')); + } + + public function create(Request $request) + { + createActivityLog(RolepermissionsController::class, 'create', ' Rolepermissions create'); + $TableData = Rolepermissions::where('status', '<>', -1)->orderBy('display_order')->get(); + $editable = false; + return view("crud.generated.rolepermissions.edit", compact('TableData', 'editable')); + } + + public function store(Request $request) + { + createActivityLog(RolepermissionsController::class, 'store', ' Rolepermissions store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ], 500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_rolepermissions')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData = $request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL') . '/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RolepermissionsController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Rolepermissions Created Successfully.'], 200); + } + return redirect()->route('rolepermissions.index')->with('success', 'The Rolepermissions created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Rolepermissions::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Rolepermissions::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(RolepermissionsController::class, 'show', ' Rolepermissions show'); + $data = Rolepermissions::findOrFail($id); + + return view("crud.generated.rolepermissions.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(RolepermissionsController::class, 'edit', ' Rolepermissions edit'); + $TableData = Rolepermissions::where('status', '<>', -1)->orderBy('display_order')->get(); + $data = Rolepermissions::findOrFail($id); + $editable = true; + return view("crud.generated.rolepermissions.edit", compact('data', 'TableData', 'editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(RolepermissionsController::class, 'update', ' Rolepermissions update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ], 500); + } + $requestData = $request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL') . '/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('rolepermission_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RolepermissionsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Rolepermissions updated Successfully.'], 200); + } + // return redirect()->route('rolepermissions.index')->with('success','The Rolepermissions updated Successfully.'); + return redirect()->back()->with('success', 'The Rolepermissions updated successfully.'); + } + + public function destroy(Request $request, $id) + { + createActivityLog(RolepermissionsController::class, 'destroy', ' Rolepermissions destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RolepermissionsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Rolepermissions Deleted Successfully.'], 200); + } + public function toggle(Request $request, $id) + { + createActivityLog(RolepermissionsController::class, 'destroy', ' Rolepermissions destroy'); + $data = Rolepermissions::findOrFail($id); + $requestData = ['status' => ($data->status == 1) ? 0 : 1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RolepermissionsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Rolepermissions Deleted Successfully.'], 200); + } + public function clone (Request $request, $id) + { + createActivityLog(RolepermissionsController::class, 'clone', ' Rolepermissions clone'); + $data = Rolepermissions::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData = $data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RolepermissionsController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status' => true, 'message' => 'The Rolepermissions Clonned Successfully.'], 200); + } + + + +} diff --git a/app/Http/Controllers/RolesController.php b/app/Http/Controllers/RolesController.php new file mode 100644 index 0000000..555fca2 --- /dev/null +++ b/app/Http/Controllers/RolesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(RolesController::class, 'index', ' Roles index'); + $data = Roles::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.roles.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(RolesController::class, 'create', ' Roles create'); + $TableData = Roles::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.roles.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(RolesController::class, 'store', ' Roles store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_roles')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RolesController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Roles Created Successfully.'], 200); + } + return redirect()->route('roles.index')->with('success','The Roles created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Roles::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Roles::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(RolesController::class, 'show', ' Roles show'); + $data = Roles::findOrFail($id); + + return view("crud.generated.roles.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(RolesController::class, 'edit', ' Roles edit'); + $TableData = Roles::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Roles::findOrFail($id); + $editable=true; + return view("crud.generated.roles.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(RolesController::class, 'update', ' Roles update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('role_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RolesController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Roles updated Successfully.'], 200); + } + // return redirect()->route('roles.index')->with('success','The Roles updated Successfully.'); + return redirect()->back()->with('success', 'The Roles updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(RolesController::class, 'destroy', ' Roles destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RolesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Roles Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(RolesController::class, 'destroy', ' Roles destroy'); + $data = Roles::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RolesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Roles Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(RolesController::class, 'clone', ' Roles clone'); + $data = Roles::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(RolesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Roles Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php new file mode 100644 index 0000000..5d69eb8 --- /dev/null +++ b/app/Http/Controllers/SettingsController.php @@ -0,0 +1,198 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(SettingsController::class, 'index', ' Settings index'); + $data = Settings::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.settings.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(SettingsController::class, 'create', ' Settings create'); + $TableData = Settings::where('status','<>',-1)->orderBy('display_order')->get(); + return view("crud.generated.settings.create",compact('TableData')); + } + + public function store(Request $request) + { + createActivityLog(SettingsController::class, 'store', ' Settings store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_settings')]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(SettingsController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Settings Created Successfully.'], 200); + } + return redirect()->route('settings.index')->with('success','The Settings created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Settings::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Settings::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(SettingsController::class, 'show', ' Settings show'); + $data = Settings::findOrFail($id); + + return view("crud.generated.settings.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(SettingsController::class, 'edit', ' Settings edit'); + $TableData = Settings::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Settings::findOrFail($id); + if ($request->ajax()) { + $html = view("crud.generated.settings.ajax.edit", compact('data'))->render(); + return response()->json(['status' => true, 'content' => $html], 200); + } + return view("crud.generated.settings.edit", compact('data','TableData')); + } + + + public function update(Request $request, $id) + { + createActivityLog(SettingsController::class, 'update', ' Settings update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('setting_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(SettingsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Settings updated Successfully.'], 200); + } + // return redirect()->route('settings.index')->with('success','The Settings updated Successfully.'); + return redirect()->back()->with('success', 'The Settings updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(SettingsController::class, 'destroy', ' Settings destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(SettingsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Settings Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(SettingsController::class, 'destroy', ' Settings destroy'); + $data = Settings::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(SettingsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Settings Deleted Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/ShiftsController.php b/app/Http/Controllers/ShiftsController.php new file mode 100644 index 0000000..eb4542d --- /dev/null +++ b/app/Http/Controllers/ShiftsController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(ShiftsController::class, 'index', ' Shifts index'); + $data = Shifts::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.shifts.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(ShiftsController::class, 'create', ' Shifts create'); + $TableData = Shifts::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.shifts.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(ShiftsController::class, 'store', ' Shifts store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_shifts')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ShiftsController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Shifts Created Successfully.'], 200); + } + return redirect()->route('shifts.index')->with('success','The Shifts created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Shifts::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Shifts::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(ShiftsController::class, 'show', ' Shifts show'); + $data = Shifts::findOrFail($id); + + return view("crud.generated.shifts.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(ShiftsController::class, 'edit', ' Shifts edit'); + $TableData = Shifts::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Shifts::findOrFail($id); + $editable=true; + return view("crud.generated.shifts.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(ShiftsController::class, 'update', ' Shifts update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('shift_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ShiftsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Shifts updated Successfully.'], 200); + } + // return redirect()->route('shifts.index')->with('success','The Shifts updated Successfully.'); + return redirect()->back()->with('success', 'The Shifts updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(ShiftsController::class, 'destroy', ' Shifts destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ShiftsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Shifts Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(ShiftsController::class, 'destroy', ' Shifts destroy'); + $data = Shifts::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ShiftsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Shifts Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(ShiftsController::class, 'clone', ' Shifts clone'); + $data = Shifts::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(ShiftsController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Shifts Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/VendorsController.php b/app/Http/Controllers/VendorsController.php new file mode 100644 index 0000000..86b0750 --- /dev/null +++ b/app/Http/Controllers/VendorsController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(VendorsController::class, 'index', ' Vendors index'); + $data = Vendors::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.vendors.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(VendorsController::class, 'create', ' Vendors create'); + $TableData = Vendors::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.vendors.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(VendorsController::class, 'store', ' Vendors store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_vendors')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(VendorsController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Vendors Created Successfully.'], 200); + } + return redirect()->route('vendors.index')->with('success','The Vendors created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Vendors::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Vendors::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(VendorsController::class, 'show', ' Vendors show'); + $data = Vendors::findOrFail($id); + + return view("crud.generated.vendors.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(VendorsController::class, 'edit', ' Vendors edit'); + $TableData = Vendors::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Vendors::findOrFail($id); + $editable=true; + return view("crud.generated.vendors.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(VendorsController::class, 'update', ' Vendors update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('vendor_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(VendorsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Vendors updated Successfully.'], 200); + } + // return redirect()->route('vendors.index')->with('success','The Vendors updated Successfully.'); + return redirect()->back()->with('success', 'The Vendors updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(VendorsController::class, 'destroy', ' Vendors destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(VendorsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Vendors Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(VendorsController::class, 'destroy', ' Vendors destroy'); + $data = Vendors::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(VendorsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Vendors Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(VendorsController::class, 'clone', ' Vendors clone'); + $data = Vendors::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(VendorsController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Vendors Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/VendortypesController.php b/app/Http/Controllers/VendortypesController.php new file mode 100644 index 0000000..0e6c787 --- /dev/null +++ b/app/Http/Controllers/VendortypesController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(VendortypesController::class, 'index', ' Vendortypes index'); + $data = Vendortypes::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.vendortypes.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(VendortypesController::class, 'create', ' Vendortypes create'); + $TableData = Vendortypes::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.vendortypes.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(VendortypesController::class, 'store', ' Vendortypes store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_vendortypes')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(VendortypesController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Vendortypes Created Successfully.'], 200); + } + return redirect()->route('vendortypes.index')->with('success','The Vendortypes created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Vendortypes::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Vendortypes::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(VendortypesController::class, 'show', ' Vendortypes show'); + $data = Vendortypes::findOrFail($id); + + return view("crud.generated.vendortypes.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(VendortypesController::class, 'edit', ' Vendortypes edit'); + $TableData = Vendortypes::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Vendortypes::findOrFail($id); + $editable=true; + return view("crud.generated.vendortypes.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(VendortypesController::class, 'update', ' Vendortypes update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('vendortypes_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(VendortypesController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Vendortypes updated Successfully.'], 200); + } + // return redirect()->route('vendortypes.index')->with('success','The Vendortypes updated Successfully.'); + return redirect()->back()->with('success', 'The Vendortypes updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(VendortypesController::class, 'destroy', ' Vendortypes destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(VendortypesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Vendortypes Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(VendortypesController::class, 'destroy', ' Vendortypes destroy'); + $data = Vendortypes::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(VendortypesController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Vendortypes Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(VendortypesController::class, 'clone', ' Vendortypes clone'); + $data = Vendortypes::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(VendortypesController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Vendortypes Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Http/Controllers/WorkoptionsController.php b/app/Http/Controllers/WorkoptionsController.php new file mode 100644 index 0000000..f8fb613 --- /dev/null +++ b/app/Http/Controllers/WorkoptionsController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + createActivityLog(WorkoptionsController::class, 'index', ' Workoptions index'); + $data = Workoptions::where('status','<>',-1)->orderBy('display_order')->get(); + + return view("crud.generated.workoptions.index", compact('data')); + } + + public function create(Request $request) + { + createActivityLog(WorkoptionsController::class, 'create', ' Workoptions create'); + $TableData = Workoptions::where('status','<>',-1)->orderBy('display_order')->get(); + $editable=false; + return view("crud.generated.workoptions.edit",compact('TableData','editable')); + } + + public function store(Request $request) + { + createActivityLog(WorkoptionsController::class, 'store', ' Workoptions store'); + $validator = Validator::make($request->all(), [ + //ADD REQUIRED FIELDS FOR VALIDATION + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $request->request->add(['alias' => slugify($request->title)]); + $request->request->add(['display_order' => getDisplayOrder('tbl_workoptions')]); + $request->request->add(['created_at' => date("Y-m-d h:i:s")]); + $request->request->add(['updated_at' => date("Y-m-d h:i:s")]); + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $operationNumber = getOperationNumber(); + $this->modelService->create($operationNumber, $operationNumber, null, $requestData); + } catch (\Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(WorkoptionsController::class, 'store', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Workoptions Created Successfully.'], 200); + } + return redirect()->route('workoptions.index')->with('success','The Workoptions created Successfully.'); + } + + public function sort(Request $request) + { + $idOrder = $request->input('id_order'); + + foreach ($idOrder as $index => $id) { + $companyArticle = Workoptions::find($id); + $companyArticle->display_order = $index + 1; + $companyArticle->save(); + } + + return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200); + } + public function updatealias(Request $request) + { + + $articleId = $request->input('articleId'); + $newAlias = $request->input('newAlias'); + $companyArticle = Workoptions::find($articleId); + if (!$companyArticle) { + return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); + } + $companyArticle->alias = $newAlias; + $companyArticle->save(); + return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); + } + + + + + public function show(Request $request, $id) + { + createActivityLog(WorkoptionsController::class, 'show', ' Workoptions show'); + $data = Workoptions::findOrFail($id); + + return view("crud.generated.workoptions.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + createActivityLog(WorkoptionsController::class, 'edit', ' Workoptions edit'); + $TableData = Workoptions::where('status','<>',-1)->orderBy('display_order')->get(); + $data = Workoptions::findOrFail($id); + $editable=true; + return view("crud.generated.workoptions.edit", compact('data','TableData','editable')); + } + + + public function update(Request $request, $id) + { + createActivityLog(WorkoptionsController::class, 'update', ' Workoptions update'); + $validator = Validator::make($request->all(), [ + //ADD VALIDATION FOR REQIRED FIELDS + ]); + + if ($validator->fails()) { + return response()->json([ + 'error' => $validator->errors(), + ],500); + } + $requestData=$request->all(); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL').'/', '', $value); + }); + array_walk_recursive($requestData, function (&$value) { + $value = str_replace(env('APP_URL'), '', $value); + }); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('workoption_id')); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(WorkoptionsController::class, 'update', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + if ($request->ajax()) { + return response()->json(['status' => true, 'message' => 'The Workoptions updated Successfully.'], 200); + } + // return redirect()->route('workoptions.index')->with('success','The Workoptions updated Successfully.'); + return redirect()->back()->with('success', 'The Workoptions updated successfully.'); + } + + public function destroy(Request $request,$id) + { + createActivityLog(WorkoptionsController::class, 'destroy', ' Workoptions destroy'); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->destroy($OperationNumber, $OperationNumber, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(WorkoptionsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Workoptions Deleted Successfully.'],200); + } + public function toggle(Request $request,$id) + { + createActivityLog(WorkoptionsController::class, 'destroy', ' Workoptions destroy'); + $data = Workoptions::findOrFail($id); + $requestData=['status'=>($data->status==1)?0:1]; + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(WorkoptionsController::class, 'destroy', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Workoptions Deleted Successfully.'],200); + } + public function clone(Request $request,$id) + { + createActivityLog(WorkoptionsController::class, 'clone', ' Workoptions clone'); + $data = Workoptions::findOrFail($id); + unset($data['updatedby']); + unset($data['createdby']); + $requestData=$data->toArray(); + DB::beginTransaction(); + try { + $OperationNumber = getOperationNumber(); + $this->modelService->create($OperationNumber, $OperationNumber, null, $requestData); + } catch (Exception $e) { + DB::rollBack(); + Log::info($e->getMessage()); + createErrorLog(WorkoptionsController::class, 'clone', $e->getMessage()); + return response()->json(['status' => false, 'message' => $e->getMessage()], 500); + } + DB::commit(); + return response()->json(['status'=>true,'message'=>'The Workoptions Clonned Successfully.'],200); + } + + + + } + \ No newline at end of file diff --git a/app/Models/Country/Country.php b/app/Models/Country/Country.php new file mode 100644 index 0000000..fbc6637 --- /dev/null +++ b/app/Models/Country/Country.php @@ -0,0 +1,28 @@ +hasMany(Province::class); + } + + public static function getCountries() + { + return self::select('id','country_name')->where('status','Active')->get(); + } +} diff --git a/app/Models/District/District.php b/app/Models/District/District.php new file mode 100644 index 0000000..c41ddbd --- /dev/null +++ b/app/Models/District/District.php @@ -0,0 +1,37 @@ +where('status', 'Active')->get(); + } + + public static function getDistrictsByProvinceId($province_id) + { + return self::select('id', 'district_name')->where('status', 'Active')->where('state_id',$province_id)->get(); + } + + public static function getPermDistrictsByProvinceId($province_id) + { + return self::select('id', 'district_name')->where('status', 'Active')->where('state_id',$province_id)->get(); + } + + public static function getTempDistrictsByProvinceId($province_id) + { + return self::select('id', 'district_name')->where('status', 'Active')->where('state_id',$province_id)->get(); + } +} diff --git a/app/Models/Eligibility/Eligibility.php b/app/Models/Eligibility/Eligibility.php new file mode 100644 index 0000000..d1d83ad --- /dev/null +++ b/app/Models/Eligibility/Eligibility.php @@ -0,0 +1,25 @@ +hasMany(Registration::class,'preffered_location','slug'); + } + + +} diff --git a/app/Models/Municipality/Municipality.php b/app/Models/Municipality/Municipality.php new file mode 100644 index 0000000..7abb7cb --- /dev/null +++ b/app/Models/Municipality/Municipality.php @@ -0,0 +1,11 @@ +visibility)); + } + + function getStatusTextAttribute(){ + return ucwords(str_replace('_', ' ', $this->status)); + } + + function getAvailabilityTextAttribute(){ + return ucwords(str_replace('_', ' ', $this->availability)); + } + + function creator(){ + return $this->belongsTo(User::class,'created_by'); + } + + function getImagePathAttribute(){ + return $this->path.'/'. $this->image; + } + + function getThumbnailPathAttribute(){ + return $this->path.'/thumb/'. $this->image; + } + + public function roles(){ + return $this->belongsToMany(Role::class,'role_has_permissions'); + } +} diff --git a/app/Models/Program/Program.php b/app/Models/Program/Program.php new file mode 100644 index 0000000..7405ef1 --- /dev/null +++ b/app/Models/Program/Program.php @@ -0,0 +1,55 @@ +hasMany(Intake::class,'program_id','id'); + } + + public function fees() + { + return $this->hasMany(Fee::class,'program_id','id'); + } + + public function eligibilities() + { + return $this->hasMany(Eligibility::class,'program_id','id'); + } + + public function criterias() + { + return $this->hasMany(Criteria::class,'program_id','id'); + } + + +} diff --git a/app/Models/Province/Province.php b/app/Models/Province/Province.php new file mode 100644 index 0000000..29f2ff3 --- /dev/null +++ b/app/Models/Province/Province.php @@ -0,0 +1,30 @@ +belongsTo(Country::class); + } + + public static function getProvinces() + { + return self::select('id','province_name')->where('status','Active')->get(); + } + + public static function getProvincesByCountryId($country_id) + { + return self::select('id','province_name')->where('status','Active')->where('country_id',$country_id)->get(); + } +} diff --git a/app/Models/Qualification/Qualification.php b/app/Models/Qualification/Qualification.php new file mode 100644 index 0000000..a929681 --- /dev/null +++ b/app/Models/Qualification/Qualification.php @@ -0,0 +1,18 @@ +where('follow_up_type','registration')->where('refrence_id',$id)->latest()->first(); + } + + public static function getFollowUpCount($id) + { + return FollowUp::select('id','next_schedule','follow_up_name','follow_up_by','remarks')->where('follow_up_type','registration')->where('refrence_id',$id)->latest()->get(); + } + + public function leadcategory() + { + return $this->belongsTo(LeadCategory::class); + } + + public function campaign() + { + return $this->belongsTo(Campaign::class); + } + + public function enroll($id) { + return Student::select('id')->where('source_ref','registration')->where('ref_id',$id)->latest()->first(); + } +} diff --git a/app/Models/Role/Role.php b/app/Models/Role/Role.php new file mode 100644 index 0000000..5096dc3 --- /dev/null +++ b/app/Models/Role/Role.php @@ -0,0 +1,49 @@ +belongsToMany(Permission::class,'role_has_permissions'); + } + + function getVisibilityTextAttribute(){ + return ucwords(str_replace('_', ' ', $this->visibility)); + } + + function getStatusTextAttribute(){ + return ucwords(str_replace('_', ' ', $this->status)); + } + + function getAvailabilityTextAttribute(){ + return ucwords(str_replace('_', ' ', $this->availability)); + } + + function creator(){ + return $this->belongsTo(User::class,'created_by'); + } + + function getImagePathAttribute(){ + return $this->path.'/'. $this->image; + } + + function getThumbnailPathAttribute(){ + return $this->path.'/thumb/'. $this->image; + } +} diff --git a/app/Models/Setting/Setting.php b/app/Models/Setting/Setting.php new file mode 100644 index 0000000..d2d2e00 --- /dev/null +++ b/app/Models/Setting/Setting.php @@ -0,0 +1,33 @@ + 'boolean' + ]; + + public function scopeFetch($query, $slug) + { + return $query->whereSlug($slug); + } + + public function scopeActive($query, $type = true) + { + return $query->whereIsActive($type); + } + + +} diff --git a/app/Models/State/State.php b/app/Models/State/State.php new file mode 100644 index 0000000..9fa787d --- /dev/null +++ b/app/Models/State/State.php @@ -0,0 +1,32 @@ +belongsTo(Country::class); + } + + public static function getStates() + { + return self::select('id','state_name')->where('status','Active')->get(); + } + + public static function getStatesByCountryId($country_id) + { + return self::select('id','state_name')->where('status','Active')->where('country_id',$country_id)->get(); + } +} diff --git a/app/Models/Student/Student.php b/app/Models/Student/Student.php new file mode 100644 index 0000000..cc92d3c --- /dev/null +++ b/app/Models/Student/Student.php @@ -0,0 +1,93 @@ +belongsTo(Admission::class,'id','student_id'); + } + + public function educations() + { + return $this->hasMany(StudentEducation::class,'student_id','id'); + } + + public function languages() + { + return $this->hasMany(StudentLanguage::class,'student_id','id'); + } + + public function fields() + { + return $this->hasMany(StudentField::class,'student_id','id'); + } + + public function agent(){ + return $this->belongsTo(Agent::class,'ref_id','id'); + } + + public function location(){ + return $this->belongsTo(Location::class,'ref_id','id'); + } + + public function student_country(){ + return $this->belongsTo(Country::class,'country_id','id'); + } + + public function student_state(){ + return $this->belongsTo(State::class,'state_id','id'); + } + + public function student_district(){ + return $this->belongsTo(District::class,'district_id','id'); + } + +} diff --git a/app/Models/Student/StudentEducation.php b/app/Models/Student/StudentEducation.php new file mode 100644 index 0000000..0b06b37 --- /dev/null +++ b/app/Models/Student/StudentEducation.php @@ -0,0 +1,37 @@ +select('id','first_name','middle_name','last_name','gender','material_status','spouse_name','father_name','mother_name','mobile_no','alternate_mobile_no','email','dob','full_address','status','is_active')->get()->toArray(); + $records = DB::table('candidates') + ->join('candidate_passports','candidate_passports.candidate_id','candidates.id') + ->join('countries','countries.id','candidates.country_id') + ->join('provinces','provinces.id','candidates.province_id') + ->join('districts','districts.id','candidates.district_id') + ->join('districts AS cid','cid.id','candidate_passports.citizenship_issue_district') + ->select('candidates.id','candidates.first_name','candidates.middle_name','candidates.last_name','candidates.gender','candidates.spouse_name','candidates.father_name','candidates.mother_name','candidates.mobile_no','candidates.alternate_mobile_no','candidates.email','candidates.dob','countries.country_name','provinces.province_name','districts.district_name','candidates.municipality_name','candidates.ward_no','candidates.full_address','candidate_passports.passport_number','candidate_passports.passport_issue_date','candidate_passports.passport_expiry_date','candidate_passports.citizenship_number','candidate_passports.citizenship_issue_date','cid.district_name AS cid_name') + ->get() + ->toArray(); + return $records; + } + + +} diff --git a/app/Models/Student/StudentField.php b/app/Models/Student/StudentField.php new file mode 100644 index 0000000..765548e --- /dev/null +++ b/app/Models/Student/StudentField.php @@ -0,0 +1,16 @@ +isDirty('createdBy')) { + $model->createdBy = auth()->user() ? auth()->user()->id : null; + } + if (!$model->isDirty('updatedBy')) { + $model->updatedBy = auth()->user() ? auth()->user()->id : null; + } + if ($model->isDirty('createdOn') && !$model->isDirty('createdOn')) { + $model->createdOn = now(); + } + if (!$model->isDirty('status')) { + $model->status = 1; + } + }); + + // updating updated_by when model is updated + static::updating(function ($model) { + if (!$model->isDirty('updatedBy')) { + $model->updatedBy = auth()->user() ? auth()->user()->id : 1; + } + }); + } +} diff --git a/resources/views/crud/form/create.blade.php b/resources/views/crud/form/create.blade.php new file mode 100644 index 0000000..c370648 --- /dev/null +++ b/resources/views/crud/form/create.blade.php @@ -0,0 +1,39 @@ +@extends('backend.template') +@section('content') +
+
+ @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif +
+
+ {{Label('Operation')}} + + {{ customCreateSelect('type', 'type', '', '', ['ajax-curd' => 'Ajax CURD']) }} + + {{Label('Table Name')}} + + {{ customCreateSelect('tableName', 'tableName', 'form-control custom-select2', '', $allTables) }} + + {{Label('Write To')}} + + {{ createText('directoryName', 'directoryName', 'Directory Name') }} + +
+
+
+
+@endsection +@push('js') + +@endpush diff --git a/resources/views/crud/form/tables.blade.php b/resources/views/crud/form/tables.blade.php new file mode 100644 index 0000000..91690cd --- /dev/null +++ b/resources/views/crud/form/tables.blade.php @@ -0,0 +1,65 @@ +@extends('backend.template') +@section('content') +
+
+
+
+
+
+
+

Tables in Database

+
+
+
+
+
+
+ + + @foreach ($allTables as $Table) + +
+

+
+
+ + + + + + + + + + + @foreach($Table->tablecolumns as $column) + + + + + + + @endforeach + +
S.N.{{__('lang.Column')}}{{label("Datatype")}}
{{$sn}} {{$column->COLUMN_NAME}} {{$column->COLUMN_TYPE}}
+
+
+
+ @endforeach + +
+
+
+
+
+
+
+ +@endsection +@push('js') + +@endpush diff --git a/resources/views/crud/generated/.DS_Store b/resources/views/crud/generated/.DS_Store new file mode 100644 index 0000000..aed498a Binary files /dev/null and b/resources/views/crud/generated/.DS_Store differ diff --git a/resources/views/crud/generated/branches/create.blade.php b/resources/views/crud/generated/branches/create.blade.php new file mode 100644 index 0000000..a22872e --- /dev/null +++ b/resources/views/crud/generated/branches/create.blade.php @@ -0,0 +1,26 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Branche') }}

+ + +
+
+
+ @csrf +
{{createCustomSelect('tbl_companies', 'title', 'company_id', $editable?$data->companies_id:'', 'Companies Id','companies_id', 'form-control select2','status<>-1')}}
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} +
{{createText("email","email","Email",'',$editable?$data->email:'')}} +
{{createText("telephone","telephone","Telephone",'',$editable?$data->telephone:'')}} +
{{createText("phone1","phone1","Phone1",'',$editable?$data->phone1:'')}} +
{{createText("phone2","phone2","Phone2",'',$editable?$data->phone2:'')}} +
{{createText("address","address","Address",'',$editable?$data->address:'')}} +
{{createText("company_reg","company_reg","Company Reg",'',$editable?$data->company_reg:'')}} +
{{createText("company_pan","company_pan","Company Pan",'',$editable?$data->company_pan:'')}} +
{{createImageInput("logo","Logo",'',$editable?$data->logo:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/branches/edit.blade.php b/resources/views/crud/generated/branches/edit.blade.php new file mode 100644 index 0000000..a821456 --- /dev/null +++ b/resources/views/crud/generated/branches/edit.blade.php @@ -0,0 +1,26 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Edit Branches') }}

+ + +
+
+
+ @csrf +
{{createCustomSelect('tbl_companies', 'title', 'company_id', $editable?$data->companies_id:'', 'Companies Id','companies_id', 'form-control select2','status<>-1')}}
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} +
{{createText("email","email","Email",'',$editable?$data->email:'')}} +
{{createText("telephone","telephone","Telephone",'',$editable?$data->telephone:'')}} +
{{createText("phone1","phone1","Phone1",'',$editable?$data->phone1:'')}} +
{{createText("phone2","phone2","Phone2",'',$editable?$data->phone2:'')}} +
{{createText("address","address","Address",'',$editable?$data->address:'')}} +
{{createText("company_reg","company_reg","Company Reg",'',$editable?$data->company_reg:'')}} +
{{createText("company_pan","company_pan","Company Pan",'',$editable?$data->company_pan:'')}} +
{{createImageInput("logo","Logo",'',$editable?$data->logo:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/branches/index.blade.php b/resources/views/crud/generated/branches/index.blade.php new file mode 100644 index 0000000..a382100 --- /dev/null +++ b/resources/views/crud/generated/branches/index.blade.php @@ -0,0 +1,289 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Branches List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + + + + + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("companies") }}{{ label("title") }}{{ label("alias") }}{{ label("email") }}{{ label("telephone") }}{{ label("phone1") }}{{ label("phone2") }}{{ label("address") }}{{ label("company_reg") }}{{ label("company_pan") }}{{ label("logo") }}{{ label("is_main") }}{{ label("Action") }} +
{{ $i++ }} +{!! getFieldData("tbl_companies", "title", "company_id", $item->companies_id) !!} +{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
{{ $item->email }}{{ $item->telephone }}{{ $item->phone1 }}{{ $item->phone2 }}{{ $item->address }}{{ $item->company_reg }}{{ $item->company_pan }}{{ showImageThumb($item->logo) }}{{ $item->is_main }} + + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/branches/show.blade.php b/resources/views/crud/generated/branches/show.blade.php new file mode 100644 index 0000000..ebd4628 --- /dev/null +++ b/resources/views/crud/generated/branches/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Companies Id :     {{$data->companies_id}}

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Description :     {{$data->description}}

Email :     {{$data->email}}

Telephone :     {{$data->telephone}}

Phone1 :     {{$data->phone1}}

Phone2 :     {{$data->phone2}}

Address :     {{$data->address}}

Company Reg :     {{$data->company_reg}}

Company Pan :     {{$data->company_pan}}

Logo :     {{$data->logo}}

Is Main :     {{$data->is_main}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/castes/edit.blade.php b/resources/views/crud/generated/castes/edit.blade.php new file mode 100644 index 0000000..95e8f4a --- /dev/null +++ b/resources/views/crud/generated/castes/edit.blade.php @@ -0,0 +1,17 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Caste') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/castes/index.blade.php b/resources/views/crud/generated/castes/index.blade.php new file mode 100644 index 0000000..53a510d --- /dev/null +++ b/resources/views/crud/generated/castes/index.blade.php @@ -0,0 +1,268 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Caste List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/castes/show.blade.php b/resources/views/crud/generated/castes/show.blade.php new file mode 100644 index 0000000..072b116 --- /dev/null +++ b/resources/views/crud/generated/castes/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/cities/edit.blade.php b/resources/views/crud/generated/cities/edit.blade.php new file mode 100644 index 0000000..3f4aa1e --- /dev/null +++ b/resources/views/crud/generated/cities/edit.blade.php @@ -0,0 +1,18 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Cities') }}

+ + +
+
+
+ @csrf +
{{createCustomSelect('tbl_districts', 'title', 'district_id', $editable?$data->districts_id:'', 'Districts Id','districts_id', 'form-control select2','status<>-1')}}
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/cities/index.blade.php b/resources/views/crud/generated/cities/index.blade.php new file mode 100644 index 0000000..75200e1 --- /dev/null +++ b/resources/views/crud/generated/cities/index.blade.php @@ -0,0 +1,271 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Cities List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("districts") }}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }} +{!! getFieldData("tbl_districts", "title", "district_id", $item->districts_id) !!} +{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/cities/show.blade.php b/resources/views/crud/generated/cities/show.blade.php new file mode 100644 index 0000000..c361ff3 --- /dev/null +++ b/resources/views/crud/generated/cities/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Districts Id :     {{$data->districts_id}}

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Description :     {{$data->description}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/companies/edit.blade.php b/resources/views/crud/generated/companies/edit.blade.php new file mode 100644 index 0000000..67e37a8 --- /dev/null +++ b/resources/views/crud/generated/companies/edit.blade.php @@ -0,0 +1,19 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Company') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} +
{{createText("address","address","Address",'',$editable?$data->address:'')}} +
{{createCustomSelect('tbl_cities', 'title', 'city_id', $editable?$data->cities_id:'', 'Cities Id','cities_id', 'form-control select2','status<>-1')}}
{{createCustomSelect('tbl_companytypes', 'title', 'companytype_id', $editable?$data->companytypes_id:'', 'Companytypes Id','companytypes_id', 'form-control select2','status<>-1')}}
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/companies/index.blade.php b/resources/views/crud/generated/companies/index.blade.php new file mode 100644 index 0000000..d5605cb --- /dev/null +++ b/resources/views/crud/generated/companies/index.blade.php @@ -0,0 +1,276 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Companies List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("address") }}{{ label("cities") }}{{ label("companytypes") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
{{ $item->address }} +{!! getFieldData("tbl_cities", "title", "city_id", $item->cities_id) !!} + +{!! getFieldData("tbl_companytypes", "title", "companytype_id", $item->companytypes_id) !!} + + + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/companies/show.blade.php b/resources/views/crud/generated/companies/show.blade.php new file mode 100644 index 0000000..304173f --- /dev/null +++ b/resources/views/crud/generated/companies/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Description :     {{$data->description}}

Address :     {{$data->address}}

Cities Id :     {{$data->cities_id}}

Companytypes Id :     {{$data->companytypes_id}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/companytypes/edit.blade.php b/resources/views/crud/generated/companytypes/edit.blade.php new file mode 100644 index 0000000..79534de --- /dev/null +++ b/resources/views/crud/generated/companytypes/edit.blade.php @@ -0,0 +1,18 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Company Type') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/companytypes/index.blade.php b/resources/views/crud/generated/companytypes/index.blade.php new file mode 100644 index 0000000..e73c2dc --- /dev/null +++ b/resources/views/crud/generated/companytypes/index.blade.php @@ -0,0 +1,268 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Company Type List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/companytypes/show.blade.php b/resources/views/crud/generated/companytypes/show.blade.php new file mode 100644 index 0000000..d616002 --- /dev/null +++ b/resources/views/crud/generated/companytypes/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Description :     {{$data->description}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/countries/create.blade.php b/resources/views/crud/generated/countries/create.blade.php new file mode 100644 index 0000000..3491e73 --- /dev/null +++ b/resources/views/crud/generated/countries/create.blade.php @@ -0,0 +1,34 @@ +@extends('backend.template') +@section('content') + +
+
+
+

Add Country

+
+ +
+
+
+
+ +
+@csrf +
+
+
+
{{createText("title","title","Title")}}
+
{{createTextarea("description","description ckeditor-classic","Description")}}
+
{{createPlainTextArea("remarks","remarks ","Remarks")}}
+
+
+
+
+ + +
+
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/countries/edit.blade.php b/resources/views/crud/generated/countries/edit.blade.php new file mode 100644 index 0000000..87ed01c --- /dev/null +++ b/resources/views/crud/generated/countries/edit.blade.php @@ -0,0 +1,39 @@ +@extends('backend.template') + @section('content') + +
+
+
+

Edit Country

+
+ +
+
+
+
+ +
+ @csrf +
+ +
+ +
+
{{createText("title","title","Title",'',$data->title)}}
+
{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}
+
+
{{createPlainTextArea("remarks",'',"Remarks",$data->remarks)}}
+ +
+
+ +
+
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/countries/index.blade.php b/resources/views/crud/generated/countries/index.blade.php new file mode 100644 index 0000000..fa64264 --- /dev/null +++ b/resources/views/crud/generated/countries/index.blade.php @@ -0,0 +1,241 @@ +@extends('backend.template') +@section('content') +
+
+
+ @csrf +
+
+

Add Country

+
+
+
+
{{createText("title","title","Title")}}
+
+
{{createTextarea("description","description ","Description")}}
+
+
{{createPlainTextArea("remarks","remarks ","Remarks")}}
+
+
+ + +
+
+
+
+
+
+

{{ label("Countries List") }}

+
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + "> + + + + + @endforeach + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ +
+
+
+
+
+@endsection +@push("css") + + +@endpush +@push("js") + + + + + + + + +@endpush diff --git a/resources/views/crud/generated/countries/show.blade.php b/resources/views/crud/generated/countries/show.blade.php new file mode 100644 index 0000000..a982950 --- /dev/null +++ b/resources/views/crud/generated/countries/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Description :     {{$data->description}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/dags/edit.blade.php b/resources/views/crud/generated/dags/edit.blade.php new file mode 100644 index 0000000..bc712f0 --- /dev/null +++ b/resources/views/crud/generated/dags/edit.blade.php @@ -0,0 +1,17 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Dags') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/dags/index.blade.php b/resources/views/crud/generated/dags/index.blade.php new file mode 100644 index 0000000..09db252 --- /dev/null +++ b/resources/views/crud/generated/dags/index.blade.php @@ -0,0 +1,268 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Dags List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/dags/show.blade.php b/resources/views/crud/generated/dags/show.blade.php new file mode 100644 index 0000000..586e501 --- /dev/null +++ b/resources/views/crud/generated/dags/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/departments/edit.blade.php b/resources/views/crud/generated/departments/edit.blade.php new file mode 100644 index 0000000..5b60155 --- /dev/null +++ b/resources/views/crud/generated/departments/edit.blade.php @@ -0,0 +1,18 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Department') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
{{createCustomSelect('tbl_branches', 'title', 'branch_id', $editable?$data->branches_id:'', 'Branches Id','branches_id', 'form-control select2','status<>-1')}}
{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/departments/index.blade.php b/resources/views/crud/generated/departments/index.blade.php new file mode 100644 index 0000000..6fd372d --- /dev/null +++ b/resources/views/crud/generated/departments/index.blade.php @@ -0,0 +1,271 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Departments List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("branches") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+{!! getFieldData("tbl_branches", "title", "branch_id", $item->branches_id) !!} + + + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/departments/show.blade.php b/resources/views/crud/generated/departments/show.blade.php new file mode 100644 index 0000000..58f0905 --- /dev/null +++ b/resources/views/crud/generated/departments/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

Branches Id :     {{$data->branches_id}}

Description :     {{$data->description}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/designations/edit.blade.php b/resources/views/crud/generated/designations/edit.blade.php new file mode 100644 index 0000000..8c59b09 --- /dev/null +++ b/resources/views/crud/generated/designations/edit.blade.php @@ -0,0 +1,18 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Designations') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
{{createText("job_description","job_description","Job Description",'',$editable?$data->job_description:'')}} +
{{createCustomSelect('tbl_departments', 'title', 'department_id', $editable?$data->departments_id:'', 'Departments Id','departments_id', 'form-control select2','status<>-1')}}
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/designations/index.blade.php b/resources/views/crud/generated/designations/index.blade.php new file mode 100644 index 0000000..d7525e3 --- /dev/null +++ b/resources/views/crud/generated/designations/index.blade.php @@ -0,0 +1,273 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Designations List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("job_description") }}{{ label("departments") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
{{ $item->job_description }} +{!! getFieldData("tbl_departments", "title", "department_id", $item->departments_id) !!} + + + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/designations/show.blade.php b/resources/views/crud/generated/designations/show.blade.php new file mode 100644 index 0000000..3bd2ce5 --- /dev/null +++ b/resources/views/crud/generated/designations/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

Job Description :     {{$data->job_description}}

Departments Id :     {{$data->departments_id}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/districts/edit.blade.php b/resources/views/crud/generated/districts/edit.blade.php new file mode 100644 index 0000000..521c9ff --- /dev/null +++ b/resources/views/crud/generated/districts/edit.blade.php @@ -0,0 +1,18 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Districts') }}

+ + +
+
+
+ @csrf +
{{createCustomSelect('tbl_proviences', 'title', 'provience_id', $editable?$data->proviences_id:'', 'Proviences Id','proviences_id', 'form-control select2','status<>-1')}}
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/districts/index.blade.php b/resources/views/crud/generated/districts/index.blade.php new file mode 100644 index 0000000..cfba3c0 --- /dev/null +++ b/resources/views/crud/generated/districts/index.blade.php @@ -0,0 +1,271 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Districts List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("proviences") }}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }} +{!! getFieldData("tbl_proviences", "title", "provience_id", $item->proviences_id) !!} +{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/districts/show.blade.php b/resources/views/crud/generated/districts/show.blade.php new file mode 100644 index 0000000..cb05cab --- /dev/null +++ b/resources/views/crud/generated/districts/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Proviences Id :     {{$data->proviences_id}}

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Description :     {{$data->description}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/employees/edit.blade.php b/resources/views/crud/generated/employees/edit.blade.php new file mode 100644 index 0000000..b8f8e51 --- /dev/null +++ b/resources/views/crud/generated/employees/edit.blade.php @@ -0,0 +1,129 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label('Add Employees') }}

+ + +
+
+
+ @csrf +
+
{{createText("first_name","first_name","First + Name",'',$editable?$data->first_name:'')}} +
+
{{createText("middle_name","middle_name","Middle + Name",'',$editable?$data->middle_name:'')}} +
+
{{createText("last_name","last_name","Last + Name",'',$editable?$data->last_name:'')}} +
+
+ {{createText("email","email","Email",'',$editable?$data->email:'')}} +
+
{{createCustomSelect('tbl_genders', 'title', 'gender_id', + $editable?$data->genders_id:'', 'Genders Id','genders_id', 'form-control + select2','status<>-1')}}
+
{{createText("nepali_dob","nepali_dob","Nepali + Dob",'',$editable?$data->nepali_dob:'')}} +
+
{{createDate("dob","Dob",'',$editable?$data->dob:'')}} +
+
{{createCustomSelect('tbl_nationalities', 'title', + 'nationality_id', $editable?$data->nationalities_id:'', 'Nationalities + Id','nationalities_id', 'form-control select2','status<>-1')}}
+
{{createText("about_me","about_me","About + Me",'',$editable?$data->about_me:'')}} +
+
+ {{createImageInput("signature","Signature",'',$editable?$data->signature:'')}} +
+
{{createText("father_name","father_name","Father + Name",'',$editable?$data->father_name:'')}} +
+
{{createText("mother_name","mother_name","Mother + Name",'',$editable?$data->mother_name:'')}} +
+
{{createText("grand_father_name","grand_father_name","Grand Father + Name",'',$editable?$data->grand_father_name:'')}} +
+
{{createText("grand_mother_name","grand_mother_name","Grand Mother + Name",'',$editable?$data->grand_mother_name:'')}} +
+
+ {{createText("spouse","spouse","Spouse",'',$editable?$data->spouse:'')}} +
+
+ {{createText("contact","contact","Contact",'',$editable?$data->contact:'')}} +
+
{{createText("alt_contact","alt_contact","Alt + Contact",'',$editable?$data->alt_contact:'')}} + +
+
{{createImageInput("profile_picture","Profile + Picture",'',$editable?$data->profile_picture:'')}} +
+
{{createCustomSelect('tbl_users', 'name', 'id', + $editable?$data->users_id:'', 'Users Id','users_id', 'form-control + select2','status<>-1')}}
+
{{createText("is_login_required","is_login_required","Is Login + Required",'',$editable?$data->is_login_required:'')}} +
+
+ {{createText("skills","skills","Skills",'',$editable?$data->skills:'')}} +
+
{{createTextarea("experience","experience + ckeditor-classic","Experience",$editable?$data->experience:'')}} +
+
{{createText("permanent_address","permanent_address","Permanent + Address",'',$editable?$data->permanent_address:'')}} +
+ +
{{createCustomSelect('tbl_cities', 'title', 'city_id', + $editable?$data->permanent_city:'', 'Permanent + City','permanent_city', 'form-control + select2','status<>-1')}} +
+ +
{{createText("temporary_address","temporary_address","Temporary + Address",'',$editable?$data->temporary_address:'')}} +
+ + +
{{createCustomSelect('tbl_cities', 'title', 'city_id', + $editable?$data->temporary_city:'', 'Temporary + City','temporary_city', 'form-control + select2','status<>-1')}} +
+ +
{{createText("old_system_address","old_system_address","Old System + Address",'',$editable?$data->old_system_address:'')}} +
+
+ {{createText("education","education","Education",'',$editable?$data->education:'')}} +
+
{{createCustomSelect('tbl_castes', 'title', 'caste_id', + $editable?$data->castes_id:'', 'Castes Id','castes_id', 'form-control + select2','status<>-1')}}
+
{{createCustomSelect('tbl_ethnicities', 'title', 'ethnicity_id', + $editable?$data->ethnicities_id:'', 'Ethnicities Id','ethnicities_id', + 'form-control select2','status<>-1')}}
+
{{createCustomSelect('tbl_dags', 'title', 'dag_id', + $editable?$data->dags_id:'', 'Dags Id','dags_id', 'form-control select2','status + <>-1')}}
+
+ {{createText("title","title","Title",'',$editable?$data->title:'')}} +
+
+ {{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+
+ + +
+ +
+
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/employees/index.blade.php b/resources/views/crud/generated/employees/index.blade.php new file mode 100644 index 0000000..7c921f3 --- /dev/null +++ b/resources/views/crud/generated/employees/index.blade.php @@ -0,0 +1,336 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Employees List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("first_name") }}{{ label("middle_name") }}{{ label("last_name") }}{{ label("email") }}{{ label("genders") }}{{ label("nepali_dob") }}{{ label("dob") }}{{ label("nationalities") }}{{ label("about_me") }}{{ label("signature") }}{{ label("father_name") }}{{ label("mother_name") }}{{ label("grand_father_name") }}{{ label("grand_mother_name") }}{{ label("spouse") }}{{ label("contact") }}{{ label("alt_contact") }}{{ label("profile_picture") }}{{ label("users") }}{{ label("is_login_required") }}{{ label("skills") }}{{ label("experience") }}{{ label("permanent_address") }}{{ label("permanent_city") }}{{ label("temporary_address") }}{{ label("temporary_city") }}{{ label("old_system_address") }}{{ label("education") }}{{ label("castes") }}{{ label("ethnicities") }}{{ label("dags") }}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->first_name }}{{ $item->middle_name }}{{ $item->last_name }}{{ $item->email }} +{!! getFieldData("tbl_genders", "title", "gender_id", $item->genders_id) !!} +{{ $item->nepali_dob }}{{ myDate($item->dob) }} +{!! getFieldData("tbl_nationalities", "title", "nationality_id", $item->nationalities_id) !!} +{{ $item->about_me }}{{ showImageThumb($item->signature) }}{{ $item->father_name }}{{ $item->mother_name }}{{ $item->grand_father_name }}{{ $item->grand_mother_name }}{{ $item->spouse }}{{ $item->contact }}{{ $item->alt_contact }}{{ showImageThumb($item->profile_picture) }} +{!! getFieldData("tbl_users", "name", "id", $item->users_id) !!} +{{ $item->is_login_required }}{{ $item->skills }}{{ $item->experience }}{{ $item->permanent_address }}{{ $item->permanent_city }}{{ $item->temporary_address }}{{ $item->temporary_city }}{{ $item->old_system_address }}{{ $item->education }} +{!! getFieldData("tbl_castes", "title", "caste_id", $item->castes_id) !!} + +{!! getFieldData("tbl_ethnicities", "title", "ethnicity_id", $item->ethnicities_id) !!} + +{!! getFieldData("tbl_dags", "title", "dag_id", $item->dags_id) !!} +{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/employees/show.blade.php b/resources/views/crud/generated/employees/show.blade.php new file mode 100644 index 0000000..699b7ad --- /dev/null +++ b/resources/views/crud/generated/employees/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

First Name :     {{$data->first_name}}

Middle Name :     {{$data->middle_name}}

Last Name :     {{$data->last_name}}

Email :     {{$data->email}}

Genders Id :     {{$data->genders_id}}

Nepali Dob :     {{$data->nepali_dob}}

Dob :     {{$data->dob}}

Nationalities Id :     {{$data->nationalities_id}}

About Me :     {{$data->about_me}}

Signature :     {{$data->signature}}

Father Name :     {{$data->father_name}}

Mother Name :     {{$data->mother_name}}

Grand Father Name :     {{$data->grand_father_name}}

Grand Mother Name :     {{$data->grand_mother_name}}

Spouse :     {{$data->spouse}}

Contact :     {{$data->contact}}

Alt Contact :     {{$data->alt_contact}}

Profile Picture :     {{$data->profile_picture}}

Users Id :     {{$data->users_id}}

Is Login Required :     {{$data->is_login_required}}

Skills :     {{$data->skills}}

Experience :     {{$data->experience}}

Permanent Address :     {{$data->permanent_address}}

Permanent City :     {{$data->permanent_city}}

Temporary Address :     {{$data->temporary_address}}

Temporary City :     {{$data->temporary_city}}

Old System Address :     {{$data->old_system_address}}

Education :     {{$data->education}}

Castes Id :     {{$data->castes_id}}

Ethnicities Id :     {{$data->ethnicities_id}}

Dags Id :     {{$data->dags_id}}

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

Remarks :     {{$data->remarks}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/ethnicities/edit.blade.php b/resources/views/crud/generated/ethnicities/edit.blade.php new file mode 100644 index 0000000..50cd46d --- /dev/null +++ b/resources/views/crud/generated/ethnicities/edit.blade.php @@ -0,0 +1,17 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Ethnicities') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/ethnicities/index.blade.php b/resources/views/crud/generated/ethnicities/index.blade.php new file mode 100644 index 0000000..fa67377 --- /dev/null +++ b/resources/views/crud/generated/ethnicities/index.blade.php @@ -0,0 +1,268 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Ethnicities List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/ethnicities/show.blade.php b/resources/views/crud/generated/ethnicities/show.blade.php new file mode 100644 index 0000000..95f2da5 --- /dev/null +++ b/resources/views/crud/generated/ethnicities/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/genders/edit.blade.php b/resources/views/crud/generated/genders/edit.blade.php new file mode 100644 index 0000000..499e130 --- /dev/null +++ b/resources/views/crud/generated/genders/edit.blade.php @@ -0,0 +1,17 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Genders') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/genders/index.blade.php b/resources/views/crud/generated/genders/index.blade.php new file mode 100644 index 0000000..de172b1 --- /dev/null +++ b/resources/views/crud/generated/genders/index.blade.php @@ -0,0 +1,268 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Genders List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/genders/show.blade.php b/resources/views/crud/generated/genders/show.blade.php new file mode 100644 index 0000000..c7b514f --- /dev/null +++ b/resources/views/crud/generated/genders/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/leaves/edit.blade.php b/resources/views/crud/generated/leaves/edit.blade.php new file mode 100644 index 0000000..7470dcb --- /dev/null +++ b/resources/views/crud/generated/leaves/edit.blade.php @@ -0,0 +1,17 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Leaves') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
{{createCustomSelect('tbl_leavetypes', 'title', 'leavetype_id', $editable?$data->leavetypes_id:'', 'Leavetypes Id','leavetypes_id', 'form-control select2','status<>-1')}}
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/leaves/index.blade.php b/resources/views/crud/generated/leaves/index.blade.php new file mode 100644 index 0000000..65bff6e --- /dev/null +++ b/resources/views/crud/generated/leaves/index.blade.php @@ -0,0 +1,271 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Leaves List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("leavetypes") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+{!! getFieldData("tbl_leavetypes", "title", "leavetype_id", $item->leavetypes_id) !!} + + + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/leaves/show.blade.php b/resources/views/crud/generated/leaves/show.blade.php new file mode 100644 index 0000000..b2558c9 --- /dev/null +++ b/resources/views/crud/generated/leaves/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

Leavetypes Id :     {{$data->leavetypes_id}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/leavetypes/edit.blade.php b/resources/views/crud/generated/leavetypes/edit.blade.php new file mode 100644 index 0000000..94dbc8f --- /dev/null +++ b/resources/views/crud/generated/leavetypes/edit.blade.php @@ -0,0 +1,17 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Leavetypes') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/leavetypes/index.blade.php b/resources/views/crud/generated/leavetypes/index.blade.php new file mode 100644 index 0000000..8f1436d --- /dev/null +++ b/resources/views/crud/generated/leavetypes/index.blade.php @@ -0,0 +1,268 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Leavetypes List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/leavetypes/show.blade.php b/resources/views/crud/generated/leavetypes/show.blade.php new file mode 100644 index 0000000..95d3666 --- /dev/null +++ b/resources/views/crud/generated/leavetypes/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/nationalities/edit.blade.php b/resources/views/crud/generated/nationalities/edit.blade.php new file mode 100644 index 0000000..28a0f16 --- /dev/null +++ b/resources/views/crud/generated/nationalities/edit.blade.php @@ -0,0 +1,17 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Nationalities') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/nationalities/index.blade.php b/resources/views/crud/generated/nationalities/index.blade.php new file mode 100644 index 0000000..73e5494 --- /dev/null +++ b/resources/views/crud/generated/nationalities/index.blade.php @@ -0,0 +1,268 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Nationalities List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/nationalities/show.blade.php b/resources/views/crud/generated/nationalities/show.blade.php new file mode 100644 index 0000000..871e7dc --- /dev/null +++ b/resources/views/crud/generated/nationalities/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/onboardings/edit.blade.php b/resources/views/crud/generated/onboardings/edit.blade.php new file mode 100644 index 0000000..ab84d52 --- /dev/null +++ b/resources/views/crud/generated/onboardings/edit.blade.php @@ -0,0 +1,58 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label('Add Onboardings') }}

+ + +
+
+
+ @csrf +
+
{{createDate("doj","Doj",'',$editable?$data->doj:'')}} + +
+ +
{{createCustomSelect('tbl_designations', 'title', + 'designation_id', $editable?$data->designations_id:'', 'Designations + Id','designations_id', 'form-control select2','status<>-1')}}
+
{{createText("position_status","position_status","Position + Status",'',$editable?$data->position_status:'')}} +
+
{{createCustomSelect('tbl_departments', 'title', 'department_id', + $editable?$data->departments_id:'', 'Departments Id','departments_id', + 'form-control select2','status<>-1')}}
+
{{createCustomSelect('tbl_shifts', 'title', 'shift_id', + $editable?$data->shifts_id:'', 'Shifts Id','shifts_id', 'form-control + select2','status<>-1')}} + + +
+
+ {{createImageInput("agreement","Agreement",'',$editable?$data->agreement:'')}} +
+
{{createImageInput("nda","Nda",'',$editable?$data->nda:'')}} + +
+
+ {{createText("terms","terms","Terms",'',$editable?$data->terms:'')}} +
+
+ {{createText("workoptions","workoptions","Workoptions",'',$editable?$data->workoptions:'')}} +
+
+ {{createText("title","title","Title",'',$editable?$data->title:'')}} +
+
+ {{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+
+ + +
+ +
+
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/onboardings/index.blade.php b/resources/views/crud/generated/onboardings/index.blade.php new file mode 100644 index 0000000..8633417 --- /dev/null +++ b/resources/views/crud/generated/onboardings/index.blade.php @@ -0,0 +1,291 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Onboardings List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + + + + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("doj") }}{{ label("designations") }}{{ label("position_status") }}{{ label("departments") }}{{ label("shifts") }}{{ label("agreement") }}{{ label("nda") }}{{ label("terms") }}{{ label("workoptions") }}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->doj }} +{!! getFieldData("tbl_designations", "title", "designation_id", $item->designations_id) !!} +{{ $item->position_status }} +{!! getFieldData("tbl_departments", "title", "department_id", $item->departments_id) !!} + +{!! getFieldData("tbl_shifts", "title", "shift_id", $item->shifts_id) !!} +{{ showImageThumb($item->agreement) }}{{ showImageThumb($item->nda) }}{{ $item->terms }}{{ $item->workoptions }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/onboardings/show.blade.php b/resources/views/crud/generated/onboardings/show.blade.php new file mode 100644 index 0000000..01bffb0 --- /dev/null +++ b/resources/views/crud/generated/onboardings/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Doj :     {{$data->doj}}

Designations Id :     {{$data->designations_id}}

Position Status :     {{$data->position_status}}

Departments Id :     {{$data->departments_id}}

Shifts Id :     {{$data->shifts_id}}

Agreement :     {{$data->agreement}}

Nda :     {{$data->nda}}

Terms :     {{$data->terms}}

Workoptions :     {{$data->workoptions}}

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/permissions/edit.blade.php b/resources/views/crud/generated/permissions/edit.blade.php new file mode 100644 index 0000000..ee23359 --- /dev/null +++ b/resources/views/crud/generated/permissions/edit.blade.php @@ -0,0 +1,18 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Permissions') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createText("modal","modal","Modal",'',$editable?$data->modal:'')}} +
{{createText("command","command","Command",'',$editable?$data->command:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/permissions/index.blade.php b/resources/views/crud/generated/permissions/index.blade.php new file mode 100644 index 0000000..cc7033a --- /dev/null +++ b/resources/views/crud/generated/permissions/index.blade.php @@ -0,0 +1,272 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Permissions List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("modal") }}{{ label("command") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
{{ $item->modal }}{{ $item->command }} + + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/permissions/show.blade.php b/resources/views/crud/generated/permissions/show.blade.php new file mode 100644 index 0000000..ba62bda --- /dev/null +++ b/resources/views/crud/generated/permissions/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Modal :     {{$data->modal}}

Command :     {{$data->command}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/proviences/edit.blade.php b/resources/views/crud/generated/proviences/edit.blade.php new file mode 100644 index 0000000..c4882da --- /dev/null +++ b/resources/views/crud/generated/proviences/edit.blade.php @@ -0,0 +1,18 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Proviences') }}

+ + +
+
+
+ @csrf +
{{createCustomSelect('tbl_countries', 'title', 'country_id', $editable?$data->countries_id:'', 'Countries Id','countries_id', 'form-control select2','status<>-1')}}
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/proviences/index.blade.php b/resources/views/crud/generated/proviences/index.blade.php new file mode 100644 index 0000000..b9a91d8 --- /dev/null +++ b/resources/views/crud/generated/proviences/index.blade.php @@ -0,0 +1,324 @@ +@extends('backend.template') +@section('content') + +
+
+
+ @csrf +
+
+

{{ label('Add Proviences') }}

+ + +
+
+ +
+
{{createCustomSelect('tbl_countries', 'title', 'country_id', 'Countries Id','countries_id', 'form-control select2','status<>-1')}}
+
{{createText("title","title","Title")}} +
+
{{createTextarea("description","description ","Description")}} +
+ + +
+
+ +
+
+ +
+
+
+
+

{{ label("Proviences List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("countries") }}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }} + {!! getFieldData("tbl_countries", "title", "country_id", $item->countries_id) !!} + {{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+
+
+ + + + + + + + + + + + + + + + +@endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush \ No newline at end of file diff --git a/resources/views/crud/generated/proviences/show.blade.php b/resources/views/crud/generated/proviences/show.blade.php new file mode 100644 index 0000000..3dcd9d0 --- /dev/null +++ b/resources/views/crud/generated/proviences/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Countries Id :     {{$data->countries_id}}

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Description :     {{$data->description}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/rolepermissions/edit.blade.php b/resources/views/crud/generated/rolepermissions/edit.blade.php new file mode 100644 index 0000000..2048e75 --- /dev/null +++ b/resources/views/crud/generated/rolepermissions/edit.blade.php @@ -0,0 +1,16 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Rolepermissions') }}

+ + +
+
+
+ @csrf +
{{createCustomSelect('tbl_roles', 'title', 'role_id', $editable?$data->roles_id:'', 'Roles Id','roles_id', 'form-control select2','status<>-1')}}
{{createCustomSelect('tbl_permissions', 'title', 'permission_id', $editable?$data->permissions_id:'', 'Permissions Id','permissions_id', 'form-control select2','status<>-1')}}
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/rolepermissions/index.blade.php b/resources/views/crud/generated/rolepermissions/index.blade.php new file mode 100644 index 0000000..1ee0605 --- /dev/null +++ b/resources/views/crud/generated/rolepermissions/index.blade.php @@ -0,0 +1,189 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Rolepermissions List") }}

+ {{label("Create New")}} +
+
+ @foreach($PermissionGroups as $PermissionGroup) +
+ @foreach($PermissionGroup->Commands as $Permission) +
+
+ + +
+
+ @endforeach +
+ @endforeach + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + @endforeach + + +
{{label("Sn.")}}{{ label("roles") }}{{ label("permissions") }}{{ label("Action") }} +
{{ $i++ }} +{!! getFieldData("tbl_roles", "title", "role_id", $item->roles_id) !!} + +{!! getFieldData("tbl_permissions", "title", "permission_id", $item->permissions_id) !!} + + + + +
+ +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/rolepermissions/show.blade.php b/resources/views/crud/generated/rolepermissions/show.blade.php new file mode 100644 index 0000000..e2e0664 --- /dev/null +++ b/resources/views/crud/generated/rolepermissions/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Roles Id :     {{$data->roles_id}}

Permissions Id :     {{$data->permissions_id}}

Display Order :     {{$data->display_order}}

Remarks :     {{$data->remarks}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/roles/edit.blade.php b/resources/views/crud/generated/roles/edit.blade.php new file mode 100644 index 0000000..742f620 --- /dev/null +++ b/resources/views/crud/generated/roles/edit.blade.php @@ -0,0 +1,25 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label('Add Role') }}

+ + +
+
+
+ @csrf +
+
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
+
{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} +
+
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+
+ +
+ +
+
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/roles/index.blade.php b/resources/views/crud/generated/roles/index.blade.php new file mode 100644 index 0000000..972ccb1 --- /dev/null +++ b/resources/views/crud/generated/roles/index.blade.php @@ -0,0 +1,301 @@ +@extends('backend.template') +@section('content') + +
+
+
+ @csrf +
+
+

{{ label('Add Role') }}

+
+
+
+
{{createText("title","title","Title",)}} +
+
{{createTextarea("description","description ","Description")}} +
+
+
+ +
+
+
+
+
+
+

{{ label("Roles List") }}

+
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ +
+
+ + + + + + +@endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + +@endpush \ No newline at end of file diff --git a/resources/views/crud/generated/roles/show.blade.php b/resources/views/crud/generated/roles/show.blade.php new file mode 100644 index 0000000..198a461 --- /dev/null +++ b/resources/views/crud/generated/roles/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Description :     {{$data->description}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/settings/create.blade.php b/resources/views/crud/generated/settings/create.blade.php new file mode 100644 index 0000000..ce71e4b --- /dev/null +++ b/resources/views/crud/generated/settings/create.blade.php @@ -0,0 +1,40 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label('Add Settings') }}

+ +
+
+
+@csrf +
{{createText("title","title","Title")}} +
{{createTextarea("description","description ckeditor-classic","Description")}} +
{{ createText("url1","url1","Url1")}} +
{{createText("url2","url2","Url2")}} +
{{createText("email","email","Email")}} +
{{ createText("phone","phone","Phone")}} +
{{createText("secondary_phone","secondary_phone","Secondary Phone")}} +
{{createPlainTextArea("google_map","google_map ","Google Map")}} +
{{createText("fb","fb","Fb")}} +
{{createText("insta","insta","Insta")}} +
{{createText("twitter","twitter","Twitter")}} +
{{createText("tiktok","tiktok","Tiktok")}} +
{{createImageInput("primary_logo","Primary Logo")}} +
{{createImageInput("secondary_logo","Secondary Logo")}} +
{{createImageInput ("thumb","Thumb")}} +
{{createImageInput("icon","Icon")}} +
{{createImageInput("og_image","Og Image")}} +
{{createImageInput ("no_image","No Image")}} +
{{createText("copyright_text","copyright_text","Copyright Text")}} +
{{createTextarea("content1","content1 ckeditor-classic","Content1")}} +
{{createTextarea("content2","content2 ckeditor-classic","Content2")}} +
{{createTextarea("content3","content3 ckeditor-classic","Content3")}} +
{{createText("seo_title","seo_title","Seo Title")}} +
{{createPlainTextArea("seo_description","seo_description ","Seo Description")}} +
{{createPlainTextArea("seo_keywords","seo_keywords ","Seo Keywords")}} +
{{createPlainTextArea("og_tags","og_tags ","Og Tags")}} +

< ?php createButton("btn-primary btn-store","","Submit"); ?> + +
+@end section \ No newline at end of file diff --git a/resources/views/crud/generated/settings/edit.blade.php b/resources/views/crud/generated/settings/edit.blade.php new file mode 100644 index 0000000..50deff2 --- /dev/null +++ b/resources/views/crud/generated/settings/edit.blade.php @@ -0,0 +1,154 @@ +@extends('backend.template') +@section('content') + +
+
+
+

Edit Setting

+
+ +
+
+
+
+ +
+ @csrf + +
+
+
+
+
+
{{createText("title","title","Title",'',$data->title)}}
+
+
{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}
+ +
+
+
+
+
+

Contact Details

+
+
+
+
{{createText("address","address","Address",'',$data->address)}}
+
{{createText("url1","url1","Url1",'',$data->url1)}}
+ +
{{createText("email","email","Email",'',$data->email)}}
+
{{createText("phone","phone","Phone",'',$data->phone)}}
+
{{createText("secondary_phone","secondary_phone","Secondary Phone",'',$data->secondary_phone)}}
+
{{createPlainTextArea("google_map",'',"Google Map",$data->google_map)}}
+
+
+
+
+
+
Footer
+
+
+
+
{{createText("copyright_text","copyright_text","Copyright Text",'',$data->copyright_text)}}
+
{{createTextarea("content1","content1","Content1",$data->content1)}}
+
{{createTextarea("content2","content2","Content2",$data->content2)}}
+
{{createTextarea("content3","content3","Content3",$data->content3)}}
+
+
+
+
+
+
SEO Related
+
+
+
{{createText("seo_title","seo_title","Seo Title",'',$data->seo_title)}}
+
{{createPlainTextArea("seo_description",'',"Seo Description",$data->seo_description)}}
+
{{createPlainTextArea("seo_keywords",'',"Seo Keywords",$data->seo_keywords)}}
+
{{createPlainTextArea("og_tags",'',"Og Tags",$data->og_tags)}}
+
+
+ +
+
+
Site Settings
+
+
+
{{createPlainTextArea("meta_pixel_code",'',"Meta Pixel Code",$data->meta_pixel_code,10)}}
+
{{createText("smtp_server","smtp_server","SMTP Server",'',$data->smtp_server)}}
+
{{createText("smtp_security","smtp_security","SMTP Security (TSL/SSL/Empty for none)",'',$data->smtp_security)}}
+
{{createText("smtp_port","smtp_port","SMTP PORT (25/587/465)",'',$data->smtp_port)}}
+
{{createText("smtp_user","smtp_user","SMTP Username",'',$data->smtp_user)}}
+
{{createText("smtp_password","smtp_password","SMTP Password",'',$data->smtp_password)}}
+
{{createText("sms_api","sms_api","SMS API",'',$data->sms_api)}}
+
{{createText("sms_username","sms_username","SMS Username",'',$data->sms_username)}}
+
{{createText("sms_password","sms_password","SMS Password",'',$data->sms_password)}}
+
{{createText("sms_sender","sms_sender","SMS Sender (Default is SMS)",'',$data->sms_sender)}}
+
+
+ + +
+ +
+ +
+
+

Social Media

+
+
+
+
{{createText("fb","fb","Facebook",'',$data->fb)}}
+
{{createText("insta","insta","Instagram",'',$data->insta)}}
+
{{createText("twitter","twitter","Twitter",'',$data->twitter)}}
+
{{createText("tiktok","tiktok","Tiktok",'',$data->tiktok)}}
+
+
+
+
+
+

Images

+
+
+
{{createImageInput("primary_logo","Primary Logo",'',$data->primary_logo)}}
+
+
{{createImageInput("secondary_logo","Secondary Logo",'',$data->secondary_logo)}}
+
+
{{createImageInput("thumb","Thumb",'',$data->thumb)}}
+
+
{{createImageInput("icon","Icon",'',$data->icon)}}
+
+
{{createImageInput("og_image","Og Image",'',$data->og_image)}}
+
+
{{createImageInput("no_image","No Image",'',$data->no_image)}}
+
+
+ +
+
+

Published

+
+
+
+ + +
+
+ +
+ +
+
+ + + +
+ + +@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/settings/index.blade.php b/resources/views/crud/generated/settings/index.blade.php new file mode 100644 index 0000000..52773ab --- /dev/null +++ b/resources/views/crud/generated/settings/index.blade.php @@ -0,0 +1,266 @@ +@extends('backend.template') +@section('content') + + + +
+
+

{{ label("Settings List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + + + + + + + + + + + + + + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("url1") }}{{ label("url2") }}{{ label("email") }}{{ label("phone") }}{{ label("secondary_phone") }}{{ label("fb") }}{{ label("insta") }}{{ label("twitter") }}{{ label("tiktok") }}{{ label("primary_logo") }}{{ label("secondary_logo") }}{{ label("thumb") }}{{ label("icon") }}{{ label("og_image") }}{{ label("no_image") }}{{ label("copyright_text") }}{{ label("content1") }}{{ label("content2") }}{{ label("content3") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }}{{ $item->url1 }}{{ $item->url2 }}{{ $item->email }}{{ $item->phone }}{{ $item->secondary_phone }}{{ $item->fb }}{{ $item->insta }}{{ $item->twitter }}{{ $item->tiktok }}{{ showImageThumb($item->primary_logo) }}{{ showImageThumb($item->secondary_logo) }}{{ showImageThumb($item->thumb) }}{{ showImageThumb($item->icon) }}{{ showImageThumb($item->og_image) }}{{ showImageThumb($item->no_image) }}{{ $item->copyright_text }}{{ $item->content1 }}{{ $item->content2 }}{{ $item->content3 }} + + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/settings/show.blade.php b/resources/views/crud/generated/settings/show.blade.php new file mode 100644 index 0000000..7f526cd --- /dev/null +++ b/resources/views/crud/generated/settings/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Description :     {{$data->description}}

Url1 :     {{$data->url1}}

Url2 :     {{$data->url2}}

Email :     {{$data->email}}

Phone :     {{$data->phone}}

Secondary Phone :     {{$data->secondary_phone}}

Google Map :     {{$data->google_map}}

Fb :     {{$data->fb}}

Insta :     {{$data->insta}}

Twitter :     {{$data->twitter}}

Tiktok :     {{$data->tiktok}}

Primary Logo :     {{$data->primary_logo}}

Secondary Logo :     {{$data->secondary_logo}}

Thumb :     {{$data->thumb}}

Icon :     {{$data->icon}}

Og Image :     {{$data->og_image}}

No Image :     {{$data->no_image}}

Copyright Text :     {{$data->copyright_text}}

Content1 :     {{$data->content1}}

Content2 :     {{$data->content2}}

Content3 :     {{$data->content3}}

Seo Title :     {{$data->seo_title}}

Seo Description :     {{$data->seo_description}}

Seo Keywords :     {{$data->seo_keywords}}

Og Tags :     {{$data->og_tags}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/shifts/edit.blade.php b/resources/views/crud/generated/shifts/edit.blade.php new file mode 100644 index 0000000..33331d8 --- /dev/null +++ b/resources/views/crud/generated/shifts/edit.blade.php @@ -0,0 +1,17 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Shifts') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/shifts/index.blade.php b/resources/views/crud/generated/shifts/index.blade.php new file mode 100644 index 0000000..9bd07a2 --- /dev/null +++ b/resources/views/crud/generated/shifts/index.blade.php @@ -0,0 +1,268 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Shifts List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/shifts/show.blade.php b/resources/views/crud/generated/shifts/show.blade.php new file mode 100644 index 0000000..bd03117 --- /dev/null +++ b/resources/views/crud/generated/shifts/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/users/__edit.blade.php b/resources/views/crud/generated/users/__edit.blade.php new file mode 100644 index 0000000..13e6d69 --- /dev/null +++ b/resources/views/crud/generated/users/__edit.blade.php @@ -0,0 +1,45 @@ +@extends('backend.template') +@section('content') + +
+
+
+

Edit User

+
+ +
+
+
+
+ +
+ @csrf +
+
+
+
{{createText("name","name","Name",'',$data->name)}}
+
+ {{createText("username","username","Username",'',$data->username)}}
+
{{createPassword("password","Password",'',$data->password)}} +
+
{{createText("email","email","Email",'',$data->email)}}
+
{{createCustomSelect('tbl_roles', 'title', 'role_id', $data->roles_id, + 'Role','roles_id', 'form-control select2','status<>-1')}}
+ +
+
+
+
+ + +
+
+ + + + + +@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/users/create.blade.php b/resources/views/crud/generated/users/create.blade.php new file mode 100644 index 0000000..ae1a3fa --- /dev/null +++ b/resources/views/crud/generated/users/create.blade.php @@ -0,0 +1,37 @@ +@extends('backend.template') +@section('content') + +
+
+
+

Add User

+
+ +
+
+
+
+ +
+ @csrf +
+
+
+
{{createText("name","name","Name")}}
+
{{createText("username","username","Username")}}
+
{{createPassword("password","Password",'')}}
+
{{createText("email","email","Email")}}
+
{{createText("remember_token","remember_token","Remember Token")}} +
+
+
+
+
+ + +
+
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/users/edit.blade.php b/resources/views/crud/generated/users/edit.blade.php new file mode 100644 index 0000000..fc1a3ef --- /dev/null +++ b/resources/views/crud/generated/users/edit.blade.php @@ -0,0 +1,44 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label('Add Users') }}

+ + +
+
+
+ @csrf +
+
{{createText("name","name","Name",'',$editable?$data->name:'')}} +
+
+ {{createText("email","email","Email",'',$editable?$data->email:'')}} +
+
+ {{createText("username","username","Username",'',$editable?$data->username:'')}} +
+
+ {{createPassword("password","Password",'',$editable?$data->password:'')}} +
+
{{createText("remember_token","remember_token","Remember + Token",'',$editable?$data->remember_token:'')}} +
+
{{createCustomSelect('tbl_roles', 'title', 'role_id', + $editable?$data->roles_id:'', 'Roles Id','roles_id', 'form-control + select2','status<>-1')}}
+
{{createCustomSelect('tbl_branches', 'title', 'branch_id', + $editable?$data->branches_id:'', 'Branches Id','branches_id', 'form-control + select2','status<>-1')}}
+ +
{{createCustomSelect('tbl_employees', 'title', 'employee_id', + $editable?$data->employees_id:'', 'employees Id','employees_id', 'form-control + select2','status<>-1')}}
+
+ + +
+ +
+
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/users/index.blade.php b/resources/views/crud/generated/users/index.blade.php new file mode 100644 index 0000000..a81d19f --- /dev/null +++ b/resources/views/crud/generated/users/index.blade.php @@ -0,0 +1,273 @@ +@extends('backend.template') +@section('content') + + + +
+
+
+
+

{{ label("Create User") }}

+
+
+
+ @csrf +
+
{{createText("name","name","Name",'',$editable?$data->name:'')}} +
+
+ {{createText("email","email","Email",'',$editable?$data->email:'')}} +
+
+ {{createText("username","username","Username",'',$editable?$data->username:'')}} +
+
+ {{createPassword("password","Password",'',$editable?$data->password:'')}} +
+ +
{{createCustomSelect('tbl_roles', 'title', 'role_id', + $editable?$data->roles_id:'', 'Roles Id','roles_id', 'form-control + select2','status<>-1')}}
+
{{createCustomSelect('tbl_branches', 'title', 'branch_id', + $editable?$data->branches_id:'', 'Branches Id','branches_id', 'form-control + select2','status<>-1')}}
+ +
{{createCustomSelect('tbl_employees', 'title', 'employee_id', + $editable?$data->employees_id:'', 'employees Id','employees_id', 'form-control + select2','status<>-1')}}
+
+ + +
+
+
+
+
+ +
+
+
+
+

{{ label("Users List") }}

+ +
+
+ + + + + + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + "> + + + + + + + + @endforeach + +
{{label("Sn.")}}{{ label("Name") }}{{ label("Email") }}{{ label("User Name") }}{{ label("Role") }}{{ label("Branch") }}{{ label("Employee") }}{{ label("Action") + }} +
{{ $i++ }}{{ $item->name }}{{ $item->email }}{{ $item->username }}{!! getFieldData("tbl_roles", "title", "role_id", $item->roles_id) !!} + {!! getFieldData("tbl_branches", "title", "branch_id", $item->branches_id) !!} + + {!! getFieldData("tbl_employees", "title", "employee_id", $item->employees_id) !!} + + +
+
+
+
+
+ +@endsection +@push("css") + + +@endpush +@push("js") + + + + + + + + +@endpush \ No newline at end of file diff --git a/resources/views/crud/generated/users/show.blade.php b/resources/views/crud/generated/users/show.blade.php new file mode 100644 index 0000000..d2e3681 --- /dev/null +++ b/resources/views/crud/generated/users/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Name :     {{$data->name}}

Email :     {{$data->email}}

Username :     {{$data->username}}

Email Verified At :     {{$data->email_verified_at}}

Password :     {{$data->password}}

Remember Token :     {{$data->remember_token}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/vendors/edit.blade.php b/resources/views/crud/generated/vendors/edit.blade.php new file mode 100644 index 0000000..238523f --- /dev/null +++ b/resources/views/crud/generated/vendors/edit.blade.php @@ -0,0 +1,18 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Vendors') }}

+ + +
+
+
+ @csrf +
{{createCustomSelect('tbl_vendortypes', 'title', 'vendortypes_id', $editable?$data->vendortypes_id:'', 'Vendortypes Id','vendortypes_id', 'form-control select2','status<>-1')}}
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/vendors/index.blade.php b/resources/views/crud/generated/vendors/index.blade.php new file mode 100644 index 0000000..eaf011f --- /dev/null +++ b/resources/views/crud/generated/vendors/index.blade.php @@ -0,0 +1,271 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Vendors List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("vendortypes") }}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }} +{!! getFieldData("tbl_vendortypes", "title", "vendortypes_id", $item->vendortypes_id) !!} +{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/vendors/show.blade.php b/resources/views/crud/generated/vendors/show.blade.php new file mode 100644 index 0000000..ef24c50 --- /dev/null +++ b/resources/views/crud/generated/vendors/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Vendortypes Id :     {{$data->vendortypes_id}}

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Description :     {{$data->description}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/vendortypes/edit.blade.php b/resources/views/crud/generated/vendortypes/edit.blade.php new file mode 100644 index 0000000..b44a2f1 --- /dev/null +++ b/resources/views/crud/generated/vendortypes/edit.blade.php @@ -0,0 +1,18 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Vendortypes') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/vendortypes/index.blade.php b/resources/views/crud/generated/vendortypes/index.blade.php new file mode 100644 index 0000000..69be60e --- /dev/null +++ b/resources/views/crud/generated/vendortypes/index.blade.php @@ -0,0 +1,268 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Vendortypes List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/vendortypes/show.blade.php b/resources/views/crud/generated/vendortypes/show.blade.php new file mode 100644 index 0000000..3000eaa --- /dev/null +++ b/resources/views/crud/generated/vendortypes/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Description :     {{$data->description}}

Display Order :     {{$data->display_order}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/generated/workoptions/edit.blade.php b/resources/views/crud/generated/workoptions/edit.blade.php new file mode 100644 index 0000000..86489e0 --- /dev/null +++ b/resources/views/crud/generated/workoptions/edit.blade.php @@ -0,0 +1,17 @@ +@extends('backend.template') + @section('content') +
+
+

{{ label('Add Workoptions') }}

+ + +
+
+
+ @csrf +
{{createText("title","title","Title",'',$editable?$data->title:'')}} +
{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} +
+ +
+@endsection \ No newline at end of file diff --git a/resources/views/crud/generated/workoptions/index.blade.php b/resources/views/crud/generated/workoptions/index.blade.php new file mode 100644 index 0000000..43ca96b --- /dev/null +++ b/resources/views/crud/generated/workoptions/index.blade.php @@ -0,0 +1,268 @@ +@extends('backend.template') +@section('content') +
+
+

{{ label("Workoptions List") }}

+ {{label("Create New")}} +
+
+ + + + + + + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + + "> + + + + + + @endforeach + + +
{{label("Sn.")}}{{ label("title") }}{{ label("alias") }}{{ label("Action") }} +
{{ $i++ }}{{ $item->title }} +
+ {{ $item->alias }} + +
+ change alias +
+ + + +
+ + +
+
+ + @endsection + +@push("css") + + +@endpush +@push("js") + + + + + + + + + + + + +@endpush + \ No newline at end of file diff --git a/resources/views/crud/generated/workoptions/show.blade.php b/resources/views/crud/generated/workoptions/show.blade.php new file mode 100644 index 0000000..959b64f --- /dev/null +++ b/resources/views/crud/generated/workoptions/show.blade.php @@ -0,0 +1,29 @@ +@extends('backend.template') + @section('content') +
+
+

+ + +
+
+ + + +

Title :     {{$data->title}}

Alias :     {{$data->alias}}

Status :     {{$data->status == 1 ? 'Active' : 'Inactive'}}

Remarks :     {{$data->remarks}}

Display Order :     {{$data->display_order}}

Createdby :     {{$data->createdby}}

Updatedby :     {{$data->updatedby}}

+
+

Created On :   {{$data->created_at}}

+

Created By :   {{$data->createdBy}}

+
+
+

Updated On :   {{$data->updated_at}}

+

Updated By :   {{$data->updatedBy}}

+ +
+
+ +
+
+ +@endSection \ No newline at end of file diff --git a/resources/views/crud/settings/ajax-curd.blade.php b/resources/views/crud/settings/ajax-curd.blade.php new file mode 100644 index 0000000..6f4b8f9 --- /dev/null +++ b/resources/views/crud/settings/ajax-curd.blade.php @@ -0,0 +1,63 @@ + +@extends("backend.template") +@section("content") + +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ + + + +
+
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/crud/template.blade.php b/resources/views/crud/template.blade.php new file mode 100644 index 0000000..cb1df3b --- /dev/null +++ b/resources/views/crud/template.blade.php @@ -0,0 +1,41 @@ +@extends('backend.template') + +@section('content') +
+
+ {{ label($title . ' List') }} + + +
+
+ + + + + {{ $tableHeader }} + + + + + @php + $i = 1; + @endphp + @foreach ($data as $item) + {{ $tableRows }} + @endforeach + +
S.N.{{ label('Action') }}
+
+
+@endsection \ No newline at end of file diff --git a/routes/CRUDgenerated/route.admittedpplications.php b/routes/CRUDgenerated/route.admittedpplications.php new file mode 100644 index 0000000..8ae24cb --- /dev/null +++ b/routes/CRUDgenerated/route.admittedpplications.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [AdmittedpplicationsController::class, 'index'])->name('admittedpplications.index'); + Route::get('/create', [AdmittedpplicationsController::class, 'create'])->name('admittedpplications.create'); + Route::post('/store', [AdmittedpplicationsController::class, 'store'])->name('admittedpplications.store'); + Route::post('/sort', [AdmittedpplicationsController::class, 'sort'])->name('admittedpplications.sort'); + Route::post('/updatealias', [AdmittedpplicationsController::class, 'updatealias'])->name('admittedpplications.updatealias'); + Route::get('/show/{id}', [AdmittedpplicationsController::class, 'show'])->name('admittedpplications.show'); + Route::get('/edit/{id}', [AdmittedpplicationsController::class, 'edit'])->name('admittedpplications.edit') ; + Route::post('/update/{id}', [AdmittedpplicationsController::class, 'update'])->name('admittedpplications.update'); + Route::get('/destroy/{id}', [AdmittedpplicationsController::class, 'destroy'])->name('admittedpplications.destroy'); + Route::get('/toggle/{id}', [AdmittedpplicationsController::class, 'toggle'])->name('admittedpplications.toggle'); + Route::get('/clone/{id}', [AdmittedpplicationsController::class, 'clone'])->name('admittedpplications.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.agents.php b/routes/CRUDgenerated/route.agents.php new file mode 100644 index 0000000..3aa6e74 --- /dev/null +++ b/routes/CRUDgenerated/route.agents.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [AgentsController::class, 'index'])->name('agents.index'); + Route::get('/create', [AgentsController::class, 'create'])->name('agents.create'); + Route::post('/store', [AgentsController::class, 'store'])->name('agents.store'); + Route::post('/sort', [AgentsController::class, 'sort'])->name('agents.sort'); + Route::post('/updatealias', [AgentsController::class, 'updatealias'])->name('agents.updatealias'); + Route::get('/show/{id}', [AgentsController::class, 'show'])->name('agents.show'); + Route::get('/edit/{id}', [AgentsController::class, 'edit'])->name('agents.edit') ; + Route::post('/update/{id}', [AgentsController::class, 'update'])->name('agents.update'); + Route::delete('/destroy/{id}', [AgentsController::class, 'destroy'])->name('agents.destroy'); + Route::get('/toggle/{id}', [AgentsController::class, 'toggle'])->name('agents.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.branches.php b/routes/CRUDgenerated/route.branches.php new file mode 100644 index 0000000..cd9850e --- /dev/null +++ b/routes/CRUDgenerated/route.branches.php @@ -0,0 +1,17 @@ +group(function () { + Route::get('/', [BranchesController::class, 'index'])->name('branches.index'); + Route::get('/create', [BranchesController::class, 'create'])->name('branches.create'); + Route::post('/store', [BranchesController::class, 'store'])->name('branches.store'); + Route::post('/sort', [BranchesController::class, 'sort'])->name('branches.sort'); + Route::post('/updatealias', [BranchesController::class, 'updatealias'])->name('branches.updatealias'); + Route::get('/show/{id}', [BranchesController::class, 'show'])->name('branches.show'); + Route::get('/edit/{id}', [BranchesController::class, 'edit'])->name('branches.edit') ; + Route::post('/update/{id}', [BranchesController::class, 'update'])->name('branches.update'); + Route::get('/destroy/{id}', [BranchesController::class, 'destroy'])->name('branches.destroy'); + Route::get('/toggle/{id}', [BranchesController::class, 'toggle'])->name('branches.toggle'); + Route::get('/clone/{id}', [BranchesController::class, 'clone'])->name('branches.clone'); +}); + \ No newline at end of file diff --git a/routes/CRUDgenerated/route.campaignarticles.php b/routes/CRUDgenerated/route.campaignarticles.php new file mode 100644 index 0000000..fcc935a --- /dev/null +++ b/routes/CRUDgenerated/route.campaignarticles.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [CampaignarticlesController::class, 'index'])->name('campaignarticles.index'); + Route::get('/create', [CampaignarticlesController::class, 'create'])->name('campaignarticles.create'); + Route::post('/store', [CampaignarticlesController::class, 'store'])->name('campaignarticles.store'); + Route::post('/sort', [CampaignarticlesController::class, 'sort'])->name('campaignarticles.sort'); + Route::post('/updatealias', [CampaignarticlesController::class, 'updatealias'])->name('campaignarticles.updatealias'); + Route::get('/show/{id}', [CampaignarticlesController::class, 'show'])->name('campaignarticles.show'); + Route::get('/edit/{id}', [CampaignarticlesController::class, 'edit'])->name('campaignarticles.edit') ; + Route::post('/update/{id}', [CampaignarticlesController::class, 'update'])->name('campaignarticles.update'); + Route::delete('/destroy/{id}', [CampaignarticlesController::class, 'destroy'])->name('campaignarticles.destroy'); + Route::get('/toggle/{id}', [CampaignarticlesController::class, 'toggle'])->name('campaignarticles.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.campaignlocations.php b/routes/CRUDgenerated/route.campaignlocations.php new file mode 100644 index 0000000..7cde43c --- /dev/null +++ b/routes/CRUDgenerated/route.campaignlocations.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [CampaignlocationsController::class, 'index'])->name('campaignlocations.index'); + Route::get('/create', [CampaignlocationsController::class, 'create'])->name('campaignlocations.create'); + Route::post('/store', [CampaignlocationsController::class, 'store'])->name('campaignlocations.store'); + Route::post('/sort', [CampaignlocationsController::class, 'sort'])->name('campaignlocations.sort'); + Route::post('/updatealias', [CampaignlocationsController::class, 'updatealias'])->name('campaignlocations.updatealias'); + Route::get('/show/{id}', [CampaignlocationsController::class, 'show'])->name('campaignlocations.show'); + Route::get('/edit/{id}', [CampaignlocationsController::class, 'edit'])->name('campaignlocations.edit') ; + Route::post('/update/{id}', [CampaignlocationsController::class, 'update'])->name('campaignlocations.update'); + Route::get('/destroy/{id}', [CampaignlocationsController::class, 'destroy'])->name('campaignlocations.destroy'); + Route::get('/toggle/{id}', [CampaignlocationsController::class, 'toggle'])->name('campaignlocations.toggle'); + Route::get('/clone/{id}', [CampaignlocationsController::class, 'clone'])->name('campaignlocations.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.campaigns.php b/routes/CRUDgenerated/route.campaigns.php new file mode 100644 index 0000000..1a004a7 --- /dev/null +++ b/routes/CRUDgenerated/route.campaigns.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [CampaignsController::class, 'index'])->name('campaigns.index'); + Route::get('/create', [CampaignsController::class, 'create'])->name('campaigns.create'); + Route::post('/store', [CampaignsController::class, 'store'])->name('campaigns.store'); + Route::post('/sort', [CampaignsController::class, 'sort'])->name('campaigns.sort'); + Route::post('/updatealias', [CampaignsController::class, 'updatealias'])->name('campaigns.updatealias'); + Route::get('/show/{id}', [CampaignsController::class, 'show'])->name('campaigns.show'); + Route::get('/edit/{id}', [CampaignsController::class, 'edit'])->name('campaigns.edit') ; + Route::post('/update/{id}', [CampaignsController::class, 'update'])->name('campaigns.update'); + Route::delete('/destroy/{id}', [CampaignsController::class, 'destroy'])->name('campaigns.destroy'); + Route::get('/toggle/{id}', [CampaignsController::class, 'toggle'])->name('campaigns.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.castes.php b/routes/CRUDgenerated/route.castes.php new file mode 100644 index 0000000..5dc103c --- /dev/null +++ b/routes/CRUDgenerated/route.castes.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [CastesController::class, 'index'])->name('castes.index'); + Route::get('/create', [CastesController::class, 'create'])->name('castes.create'); + Route::post('/store', [CastesController::class, 'store'])->name('castes.store'); + Route::post('/sort', [CastesController::class, 'sort'])->name('castes.sort'); + Route::post('/updatealias', [CastesController::class, 'updatealias'])->name('castes.updatealias'); + Route::get('/show/{id}', [CastesController::class, 'show'])->name('castes.show'); + Route::get('/edit/{id}', [CastesController::class, 'edit'])->name('castes.edit') ; + Route::post('/update/{id}', [CastesController::class, 'update'])->name('castes.update'); + Route::get('/destroy/{id}', [CastesController::class, 'destroy'])->name('castes.destroy'); + Route::get('/toggle/{id}', [CastesController::class, 'toggle'])->name('castes.toggle'); + Route::get('/clone/{id}', [CastesController::class, 'clone'])->name('castes.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.cities.php b/routes/CRUDgenerated/route.cities.php new file mode 100644 index 0000000..b504fd9 --- /dev/null +++ b/routes/CRUDgenerated/route.cities.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [CitiesController::class, 'index'])->name('cities.index'); + Route::get('/create', [CitiesController::class, 'create'])->name('cities.create'); + Route::post('/store', [CitiesController::class, 'store'])->name('cities.store'); + Route::post('/sort', [CitiesController::class, 'sort'])->name('cities.sort'); + Route::post('/updatealias', [CitiesController::class, 'updatealias'])->name('cities.updatealias'); + Route::get('/show/{id}', [CitiesController::class, 'show'])->name('cities.show'); + Route::get('/edit/{id}', [CitiesController::class, 'edit'])->name('cities.edit') ; + Route::post('/update/{id}', [CitiesController::class, 'update'])->name('cities.update'); + Route::delete('/destroy/{id}', [CitiesController::class, 'destroy'])->name('cities.destroy'); + Route::get('/clone/{id}', [CitiesController::class, 'clone'])->name('cities.clone'); + Route::get('/toggle/{id}', [CitiesController::class, 'toggle'])->name('cities.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.companies.php b/routes/CRUDgenerated/route.companies.php new file mode 100644 index 0000000..62d9e70 --- /dev/null +++ b/routes/CRUDgenerated/route.companies.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [CompaniesController::class, 'index'])->name('companies.index'); + Route::get('/create', [CompaniesController::class, 'create'])->name('companies.create'); + Route::post('/store', [CompaniesController::class, 'store'])->name('companies.store'); + Route::post('/sort', [CompaniesController::class, 'sort'])->name('companies.sort'); + Route::post('/updatealias', [CompaniesController::class, 'updatealias'])->name('companies.updatealias'); + Route::get('/show/{id}', [CompaniesController::class, 'show'])->name('companies.show'); + Route::get('/edit/{id}', [CompaniesController::class, 'edit'])->name('companies.edit') ; + Route::post('/update/{id}', [CompaniesController::class, 'update'])->name('companies.update'); + Route::get('/destroy/{id}', [CompaniesController::class, 'destroy'])->name('companies.destroy'); + Route::get('/toggle/{id}', [CompaniesController::class, 'toggle'])->name('companies.toggle'); + Route::get('/clone/{id}', [CompaniesController::class, 'clone'])->name('companies.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.companytypes.php b/routes/CRUDgenerated/route.companytypes.php new file mode 100644 index 0000000..b834021 --- /dev/null +++ b/routes/CRUDgenerated/route.companytypes.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [CompanytypesController::class, 'index'])->name('companytypes.index'); + Route::get('/create', [CompanytypesController::class, 'create'])->name('companytypes.create'); + Route::post('/store', [CompanytypesController::class, 'store'])->name('companytypes.store'); + Route::post('/sort', [CompanytypesController::class, 'sort'])->name('companytypes.sort'); + Route::post('/updatealias', [CompanytypesController::class, 'updatealias'])->name('companytypes.updatealias'); + Route::get('/show/{id}', [CompanytypesController::class, 'show'])->name('companytypes.show'); + Route::get('/edit/{id}', [CompanytypesController::class, 'edit'])->name('companytypes.edit') ; + Route::post('/update/{id}', [CompanytypesController::class, 'update'])->name('companytypes.update'); + Route::get('/destroy/{id}', [CompanytypesController::class, 'destroy'])->name('companytypes.destroy'); + Route::get('/toggle/{id}', [CompanytypesController::class, 'toggle'])->name('companytypes.toggle'); + Route::get('/clone/{id}', [CompanytypesController::class, 'clone'])->name('companytypes.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.coops.php b/routes/CRUDgenerated/route.coops.php new file mode 100644 index 0000000..a601e36 --- /dev/null +++ b/routes/CRUDgenerated/route.coops.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [CoopsController::class, 'index'])->name('coops.index'); + Route::get('/create', [CoopsController::class, 'create'])->name('coops.create'); + Route::post('/store', [CoopsController::class, 'store'])->name('coops.store'); + Route::post('/sort', [CoopsController::class, 'sort'])->name('coops.sort'); + Route::post('/updatealias', [CoopsController::class, 'updatealias'])->name('coops.updatealias'); + Route::get('/show/{id}', [CoopsController::class, 'show'])->name('coops.show'); + Route::get('/edit/{id}', [CoopsController::class, 'edit'])->name('coops.edit') ; + Route::post('/update/{id}', [CoopsController::class, 'update'])->name('coops.update'); + Route::get('/destroy/{id}', [CoopsController::class, 'destroy'])->name('coops.destroy'); + Route::get('/toggle/{id}', [CoopsController::class, 'toggle'])->name('coops.toggle'); + Route::get('/clone/{id}', [CoopsController::class, 'clone'])->name('coops.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.countries.php b/routes/CRUDgenerated/route.countries.php new file mode 100644 index 0000000..0ccc0d9 --- /dev/null +++ b/routes/CRUDgenerated/route.countries.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [CountriesController::class, 'index'])->name('countries.index'); + Route::get('/create', [CountriesController::class, 'create'])->name('countries.create'); + Route::post('/store', [CountriesController::class, 'store'])->name('countries.store'); + Route::post('/sort', [CountriesController::class, 'sort'])->name('countries.sort'); + Route::post('/updatealias', [CountriesController::class, 'updatealias'])->name('countries.updatealias'); + Route::get('/show/{id}', [CountriesController::class, 'show'])->name('countries.show'); + Route::get('/edit/{id}', [CountriesController::class, 'edit'])->name('countries.edit') ; + Route::post('/update/{id}', [CountriesController::class, 'update'])->name('countries.update'); + Route::delete('/destroy/{id}', [CountriesController::class, 'destroy'])->name('countries.destroy'); + Route::get('/toggle/{id}', [CountriesController::class, 'toggle'])->name('countries.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.dags.php b/routes/CRUDgenerated/route.dags.php new file mode 100644 index 0000000..6a21143 --- /dev/null +++ b/routes/CRUDgenerated/route.dags.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [DagsController::class, 'index'])->name('dags.index'); + Route::get('/create', [DagsController::class, 'create'])->name('dags.create'); + Route::post('/store', [DagsController::class, 'store'])->name('dags.store'); + Route::post('/sort', [DagsController::class, 'sort'])->name('dags.sort'); + Route::post('/updatealias', [DagsController::class, 'updatealias'])->name('dags.updatealias'); + Route::get('/show/{id}', [DagsController::class, 'show'])->name('dags.show'); + Route::get('/edit/{id}', [DagsController::class, 'edit'])->name('dags.edit') ; + Route::post('/update/{id}', [DagsController::class, 'update'])->name('dags.update'); + Route::get('/destroy/{id}', [DagsController::class, 'destroy'])->name('dags.destroy'); + Route::get('/toggle/{id}', [DagsController::class, 'toggle'])->name('dags.toggle'); + Route::get('/clone/{id}', [DagsController::class, 'clone'])->name('dags.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.departments.php b/routes/CRUDgenerated/route.departments.php new file mode 100644 index 0000000..3a957fd --- /dev/null +++ b/routes/CRUDgenerated/route.departments.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [DepartmentsController::class, 'index'])->name('departments.index'); + Route::get('/create', [DepartmentsController::class, 'create'])->name('departments.create'); + Route::post('/store', [DepartmentsController::class, 'store'])->name('departments.store'); + Route::post('/sort', [DepartmentsController::class, 'sort'])->name('departments.sort'); + Route::post('/updatealias', [DepartmentsController::class, 'updatealias'])->name('departments.updatealias'); + Route::get('/show/{id}', [DepartmentsController::class, 'show'])->name('departments.show'); + Route::get('/edit/{id}', [DepartmentsController::class, 'edit'])->name('departments.edit') ; + Route::post('/update/{id}', [DepartmentsController::class, 'update'])->name('departments.update'); + Route::get('/destroy/{id}', [DepartmentsController::class, 'destroy'])->name('departments.destroy'); + Route::get('/toggle/{id}', [DepartmentsController::class, 'toggle'])->name('departments.toggle'); + Route::get('/clone/{id}', [DepartmentsController::class, 'clone'])->name('departments.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.designations.php b/routes/CRUDgenerated/route.designations.php new file mode 100644 index 0000000..b4770fa --- /dev/null +++ b/routes/CRUDgenerated/route.designations.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [DesignationsController::class, 'index'])->name('designations.index'); + Route::get('/create', [DesignationsController::class, 'create'])->name('designations.create'); + Route::post('/store', [DesignationsController::class, 'store'])->name('designations.store'); + Route::post('/sort', [DesignationsController::class, 'sort'])->name('designations.sort'); + Route::post('/updatealias', [DesignationsController::class, 'updatealias'])->name('designations.updatealias'); + Route::get('/show/{id}', [DesignationsController::class, 'show'])->name('designations.show'); + Route::get('/edit/{id}', [DesignationsController::class, 'edit'])->name('designations.edit') ; + Route::post('/update/{id}', [DesignationsController::class, 'update'])->name('designations.update'); + Route::get('/destroy/{id}', [DesignationsController::class, 'destroy'])->name('designations.destroy'); + Route::get('/toggle/{id}', [DesignationsController::class, 'toggle'])->name('designations.toggle'); + Route::get('/clone/{id}', [DesignationsController::class, 'clone'])->name('designations.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.districts.php b/routes/CRUDgenerated/route.districts.php new file mode 100644 index 0000000..65dbe20 --- /dev/null +++ b/routes/CRUDgenerated/route.districts.php @@ -0,0 +1,17 @@ +group(function () { + Route::get('/', [DistrictsController::class, 'index'])->name('districts.index'); + Route::get('/create', [DistrictsController::class, 'create'])->name('districts.create'); + Route::post('/store', [DistrictsController::class, 'store'])->name('districts.store'); + Route::post('/sort', [DistrictsController::class, 'sort'])->name('districts.sort'); + Route::post('/updatealias', [DistrictsController::class, 'updatealias'])->name('districts.updatealias'); + Route::get('/show/{id}', [DistrictsController::class, 'show'])->name('districts.show'); + Route::get('/edit/{id}', [DistrictsController::class, 'edit'])->name('districts.edit') ; + Route::post('/update/{id}', [DistrictsController::class, 'update'])->name('districts.update'); + Route::delete('/destroy/{id}', [DistrictsController::class, 'destroy'])->name('districts.destroy'); + Route::get('/toggle/{id}', [DistrictsController::class, 'toggle'])->name('districts.toggle'); + Route::get('/clone/{id}', [DistrictsController::class, 'clone'])->name('districts.clone'); + + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.documentsets.php b/routes/CRUDgenerated/route.documentsets.php new file mode 100644 index 0000000..63f13aa --- /dev/null +++ b/routes/CRUDgenerated/route.documentsets.php @@ -0,0 +1,17 @@ +group(function () { + Route::get('/', [DocumentsetsController::class, 'index'])->name('documentsets.index'); + Route::get('/fetchdocuments', [DocumentsetsController::class, 'fetchdocuments'])->name('documentsets.fetchdocuments'); + Route::get('/create', [DocumentsetsController::class, 'create'])->name('documentsets.create'); + Route::post('/store', [DocumentsetsController::class, 'store'])->name('documentsets.store'); + Route::post('/sort', [DocumentsetsController::class, 'sort'])->name('documentsets.sort'); + Route::post('/updatealias', [DocumentsetsController::class, 'updatealias'])->name('documentsets.updatealias'); + Route::get('/show/{id}', [DocumentsetsController::class, 'show'])->name('documentsets.show'); + Route::get('/edit/{id}', [DocumentsetsController::class, 'edit'])->name('documentsets.edit') ; + Route::post('/update/{id}', [DocumentsetsController::class, 'update'])->name('documentsets.update'); + Route::delete('/destroy/{id}', [DocumentsetsController::class, 'destroy'])->name('documentsets.destroy'); + Route::get('/toggle/{id}', [DocumentsetsController::class, 'toggle'])->name('documentsets.toggle'); + Route::get('/clone/{id}', [DocumentsetsController::class, 'clone'])->name('documentsets.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.employees.php b/routes/CRUDgenerated/route.employees.php new file mode 100644 index 0000000..d5cb4a5 --- /dev/null +++ b/routes/CRUDgenerated/route.employees.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [EmployeesController::class, 'index'])->name('employees.index'); + Route::get('/create', [EmployeesController::class, 'create'])->name('employees.create'); + Route::post('/store', [EmployeesController::class, 'store'])->name('employees.store'); + Route::post('/sort', [EmployeesController::class, 'sort'])->name('employees.sort'); + Route::post('/updatealias', [EmployeesController::class, 'updatealias'])->name('employees.updatealias'); + Route::get('/show/{id}', [EmployeesController::class, 'show'])->name('employees.show'); + Route::get('/edit/{id}', [EmployeesController::class, 'edit'])->name('employees.edit') ; + Route::post('/update/{id}', [EmployeesController::class, 'update'])->name('employees.update'); + Route::get('/destroy/{id}', [EmployeesController::class, 'destroy'])->name('employees.destroy'); + Route::get('/toggle/{id}', [EmployeesController::class, 'toggle'])->name('employees.toggle'); + Route::get('/clone/{id}', [EmployeesController::class, 'clone'])->name('employees.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.ethnicities.php b/routes/CRUDgenerated/route.ethnicities.php new file mode 100644 index 0000000..331da0c --- /dev/null +++ b/routes/CRUDgenerated/route.ethnicities.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [EthnicitiesController::class, 'index'])->name('ethnicities.index'); + Route::get('/create', [EthnicitiesController::class, 'create'])->name('ethnicities.create'); + Route::post('/store', [EthnicitiesController::class, 'store'])->name('ethnicities.store'); + Route::post('/sort', [EthnicitiesController::class, 'sort'])->name('ethnicities.sort'); + Route::post('/updatealias', [EthnicitiesController::class, 'updatealias'])->name('ethnicities.updatealias'); + Route::get('/show/{id}', [EthnicitiesController::class, 'show'])->name('ethnicities.show'); + Route::get('/edit/{id}', [EthnicitiesController::class, 'edit'])->name('ethnicities.edit') ; + Route::post('/update/{id}', [EthnicitiesController::class, 'update'])->name('ethnicities.update'); + Route::get('/destroy/{id}', [EthnicitiesController::class, 'destroy'])->name('ethnicities.destroy'); + Route::get('/toggle/{id}', [EthnicitiesController::class, 'toggle'])->name('ethnicities.toggle'); + Route::get('/clone/{id}', [EthnicitiesController::class, 'clone'])->name('ethnicities.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.eventlocations.php b/routes/CRUDgenerated/route.eventlocations.php new file mode 100644 index 0000000..f0d9ede --- /dev/null +++ b/routes/CRUDgenerated/route.eventlocations.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [EventlocationsController::class, 'index'])->name('eventlocations.index'); + Route::get('/create', [EventlocationsController::class, 'create'])->name('eventlocations.create'); + Route::post('/store', [EventlocationsController::class, 'store'])->name('eventlocations.store'); + Route::post('/sort', [EventlocationsController::class, 'sort'])->name('eventlocations.sort'); + Route::post('/updatealias', [EventlocationsController::class, 'updatealias'])->name('eventlocations.updatealias'); + Route::get('/show/{id}', [EventlocationsController::class, 'show'])->name('eventlocations.show'); + Route::get('/edit/{id}', [EventlocationsController::class, 'edit'])->name('eventlocations.edit') ; + Route::post('/update/{id}', [EventlocationsController::class, 'update'])->name('eventlocations.update'); + Route::get('/destroy/{id}', [EventlocationsController::class, 'destroy'])->name('eventlocations.destroy'); + Route::get('/toggle/{id}', [EventlocationsController::class, 'toggle'])->name('eventlocations.toggle'); + Route::get('/clone/{id}', [EventlocationsController::class, 'clone'])->name('eventlocations.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.faqs.php b/routes/CRUDgenerated/route.faqs.php new file mode 100644 index 0000000..3880484 --- /dev/null +++ b/routes/CRUDgenerated/route.faqs.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [FaqsController::class, 'index'])->name('faqs.index'); + Route::get('/create', [FaqsController::class, 'create'])->name('faqs.create'); + Route::post('/store', [FaqsController::class, 'store'])->name('faqs.store'); + Route::post('/sort', [FaqsController::class, 'sort'])->name('faqs.sort'); + Route::post('/updatealias', [FaqsController::class, 'updatealias'])->name('faqs.updatealias'); + Route::get('/show/{id}', [FaqsController::class, 'show'])->name('faqs.show'); + Route::get('/edit/{id}', [FaqsController::class, 'edit'])->name('faqs.edit') ; + Route::post('/update/{id}', [FaqsController::class, 'update'])->name('faqs.update'); + Route::delete('/destroy/{id}', [FaqsController::class, 'destroy'])->name('faqs.destroy'); + Route::get('/toggle/{id}', [FaqsController::class, 'toggle'])->name('faqs.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.followups.php b/routes/CRUDgenerated/route.followups.php new file mode 100644 index 0000000..69d663f --- /dev/null +++ b/routes/CRUDgenerated/route.followups.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [FollowupsController::class, 'index'])->name('followups.index'); + Route::get('/create', [FollowupsController::class, 'create'])->name('followups.create'); + Route::post('/store', [FollowupsController::class, 'store'])->name('followups.store'); + Route::post('/sort', [FollowupsController::class, 'sort'])->name('followups.sort'); + Route::post('/updatealias', [FollowupsController::class, 'updatealias'])->name('followups.updatealias'); + Route::get('/show/{id}', [FollowupsController::class, 'show'])->name('followups.show'); + Route::get('/edit/{id}', [FollowupsController::class, 'edit'])->name('followups.edit') ; + Route::post('/update/{id}', [FollowupsController::class, 'update'])->name('followups.update'); + Route::delete('/destroy/{id}', [FollowupsController::class, 'destroy'])->name('followups.destroy'); + Route::get('/toggle/{id}', [FollowupsController::class, 'toggle'])->name('followups.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.genders.php b/routes/CRUDgenerated/route.genders.php new file mode 100644 index 0000000..954031a --- /dev/null +++ b/routes/CRUDgenerated/route.genders.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [GendersController::class, 'index'])->name('genders.index'); + Route::get('/create', [GendersController::class, 'create'])->name('genders.create'); + Route::post('/store', [GendersController::class, 'store'])->name('genders.store'); + Route::post('/sort', [GendersController::class, 'sort'])->name('genders.sort'); + Route::post('/updatealias', [GendersController::class, 'updatealias'])->name('genders.updatealias'); + Route::get('/show/{id}', [GendersController::class, 'show'])->name('genders.show'); + Route::get('/edit/{id}', [GendersController::class, 'edit'])->name('genders.edit') ; + Route::post('/update/{id}', [GendersController::class, 'update'])->name('genders.update'); + Route::get('/destroy/{id}', [GendersController::class, 'destroy'])->name('genders.destroy'); + Route::get('/toggle/{id}', [GendersController::class, 'toggle'])->name('genders.toggle'); + Route::get('/clone/{id}', [GendersController::class, 'clone'])->name('genders.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.institutions.php b/routes/CRUDgenerated/route.institutions.php new file mode 100644 index 0000000..c77e8b2 --- /dev/null +++ b/routes/CRUDgenerated/route.institutions.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [InstitutionsController::class, 'index'])->name('institutions.index'); + Route::get('/create', [InstitutionsController::class, 'create'])->name('institutions.create'); + Route::post('/store', [InstitutionsController::class, 'store'])->name('institutions.store'); + Route::post('/sort', [InstitutionsController::class, 'sort'])->name('institutions.sort'); + Route::post('/updatealias', [InstitutionsController::class, 'updatealias'])->name('institutions.updatealias'); + Route::get('/fetch/bycountry', [InstitutionsController::class, 'fetchbycountry'])->name('institutions.fetchbycountry'); + Route::get('/show/{id}', [InstitutionsController::class, 'show'])->name('institutions.show'); + Route::get('/edit/{id}', [InstitutionsController::class, 'edit'])->name('institutions.edit') ; + Route::post('/update/{id}', [InstitutionsController::class, 'update'])->name('institutions.update'); + Route::delete('/destroy/{id}', [InstitutionsController::class, 'destroy'])->name('institutions.destroy'); + Route::get('/toggle/{id}', [InstitutionsController::class, 'toggle'])->name('institutions.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.institutiontypes.php b/routes/CRUDgenerated/route.institutiontypes.php new file mode 100644 index 0000000..c578eb0 --- /dev/null +++ b/routes/CRUDgenerated/route.institutiontypes.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [InstitutiontypesController::class, 'index'])->name('institutiontypes.index'); + Route::get('/create', [InstitutiontypesController::class, 'create'])->name('institutiontypes.create'); + Route::post('/store', [InstitutiontypesController::class, 'store'])->name('institutiontypes.store'); + Route::post('/sort', [InstitutiontypesController::class, 'sort'])->name('institutiontypes.sort'); + Route::post('/updatealias', [InstitutiontypesController::class, 'updatealias'])->name('institutiontypes.updatealias'); + Route::get('/show/{id}', [InstitutiontypesController::class, 'show'])->name('institutiontypes.show'); + Route::get('/edit/{id}', [InstitutiontypesController::class, 'edit'])->name('institutiontypes.edit') ; + Route::post('/update/{id}', [InstitutiontypesController::class, 'update'])->name('institutiontypes.update'); + Route::delete('/destroy/{id}', [InstitutiontypesController::class, 'destroy'])->name('institutiontypes.destroy'); + Route::get('/toggle/{id}', [InstitutiontypesController::class, 'toggle'])->name('institutiontypes.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.intakes.php b/routes/CRUDgenerated/route.intakes.php new file mode 100644 index 0000000..9b1fb62 --- /dev/null +++ b/routes/CRUDgenerated/route.intakes.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [IntakesController::class, 'index'])->name('intakes.index'); + Route::get('/create', [IntakesController::class, 'create'])->name('intakes.create'); + Route::post('/store', [IntakesController::class, 'store'])->name('intakes.store'); + Route::post('/sort', [IntakesController::class, 'sort'])->name('intakes.sort'); + Route::post('/updatealias', [IntakesController::class, 'updatealias'])->name('intakes.updatealias'); + Route::get('/show/{id}', [IntakesController::class, 'show'])->name('intakes.show'); + Route::get('/edit/{id}', [IntakesController::class, 'edit'])->name('intakes.edit') ; + Route::post('/update/{id}', [IntakesController::class, 'update'])->name('intakes.update'); + Route::get('/destroy/{id}', [IntakesController::class, 'destroy'])->name('intakes.destroy'); + Route::get('/toggle/{id}', [IntakesController::class, 'toggle'])->name('intakes.toggle'); + Route::get('/clone/{id}', [IntakesController::class, 'clone'])->name('intakes.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.leadcategories.php b/routes/CRUDgenerated/route.leadcategories.php new file mode 100644 index 0000000..75b4893 --- /dev/null +++ b/routes/CRUDgenerated/route.leadcategories.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [LeadcategoriesController::class, 'index'])->name('leadcategories.index'); + Route::get('/create', [LeadcategoriesController::class, 'create'])->name('leadcategories.create'); + Route::post('/store', [LeadcategoriesController::class, 'store'])->name('leadcategories.store'); + Route::post('/sort', [LeadcategoriesController::class, 'sort'])->name('leadcategories.sort'); + Route::post('/updatealias', [LeadcategoriesController::class, 'updatealias'])->name('leadcategories.updatealias'); + Route::get('/show/{id}', [LeadcategoriesController::class, 'show'])->name('leadcategories.show'); + Route::get('/edit/{id}', [LeadcategoriesController::class, 'edit'])->name('leadcategories.edit') ; + Route::post('/update/{id}', [LeadcategoriesController::class, 'update'])->name('leadcategories.update'); + Route::delete('/destroy/{id}', [LeadcategoriesController::class, 'destroy'])->name('leadcategories.destroy'); + Route::get('/toggle/{id}', [LeadcategoriesController::class, 'toggle'])->name('leadcategories.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.leaves.php b/routes/CRUDgenerated/route.leaves.php new file mode 100644 index 0000000..a72a862 --- /dev/null +++ b/routes/CRUDgenerated/route.leaves.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [LeavesController::class, 'index'])->name('leaves.index'); + Route::get('/create', [LeavesController::class, 'create'])->name('leaves.create'); + Route::post('/store', [LeavesController::class, 'store'])->name('leaves.store'); + Route::post('/sort', [LeavesController::class, 'sort'])->name('leaves.sort'); + Route::post('/updatealias', [LeavesController::class, 'updatealias'])->name('leaves.updatealias'); + Route::get('/show/{id}', [LeavesController::class, 'show'])->name('leaves.show'); + Route::get('/edit/{id}', [LeavesController::class, 'edit'])->name('leaves.edit') ; + Route::post('/update/{id}', [LeavesController::class, 'update'])->name('leaves.update'); + Route::get('/destroy/{id}', [LeavesController::class, 'destroy'])->name('leaves.destroy'); + Route::get('/toggle/{id}', [LeavesController::class, 'toggle'])->name('leaves.toggle'); + Route::get('/clone/{id}', [LeavesController::class, 'clone'])->name('leaves.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.leavetypes.php b/routes/CRUDgenerated/route.leavetypes.php new file mode 100644 index 0000000..e2d3449 --- /dev/null +++ b/routes/CRUDgenerated/route.leavetypes.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [LeavetypesController::class, 'index'])->name('leavetypes.index'); + Route::get('/create', [LeavetypesController::class, 'create'])->name('leavetypes.create'); + Route::post('/store', [LeavetypesController::class, 'store'])->name('leavetypes.store'); + Route::post('/sort', [LeavetypesController::class, 'sort'])->name('leavetypes.sort'); + Route::post('/updatealias', [LeavetypesController::class, 'updatealias'])->name('leavetypes.updatealias'); + Route::get('/show/{id}', [LeavetypesController::class, 'show'])->name('leavetypes.show'); + Route::get('/edit/{id}', [LeavetypesController::class, 'edit'])->name('leavetypes.edit') ; + Route::post('/update/{id}', [LeavetypesController::class, 'update'])->name('leavetypes.update'); + Route::get('/destroy/{id}', [LeavetypesController::class, 'destroy'])->name('leavetypes.destroy'); + Route::get('/toggle/{id}', [LeavetypesController::class, 'toggle'])->name('leavetypes.toggle'); + Route::get('/clone/{id}', [LeavetypesController::class, 'clone'])->name('leavetypes.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.nationalities.php b/routes/CRUDgenerated/route.nationalities.php new file mode 100644 index 0000000..2040b3c --- /dev/null +++ b/routes/CRUDgenerated/route.nationalities.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [NationalitiesController::class, 'index'])->name('nationalities.index'); + Route::get('/create', [NationalitiesController::class, 'create'])->name('nationalities.create'); + Route::post('/store', [NationalitiesController::class, 'store'])->name('nationalities.store'); + Route::post('/sort', [NationalitiesController::class, 'sort'])->name('nationalities.sort'); + Route::post('/updatealias', [NationalitiesController::class, 'updatealias'])->name('nationalities.updatealias'); + Route::get('/show/{id}', [NationalitiesController::class, 'show'])->name('nationalities.show'); + Route::get('/edit/{id}', [NationalitiesController::class, 'edit'])->name('nationalities.edit') ; + Route::post('/update/{id}', [NationalitiesController::class, 'update'])->name('nationalities.update'); + Route::get('/destroy/{id}', [NationalitiesController::class, 'destroy'])->name('nationalities.destroy'); + Route::get('/toggle/{id}', [NationalitiesController::class, 'toggle'])->name('nationalities.toggle'); + Route::get('/clone/{id}', [NationalitiesController::class, 'clone'])->name('nationalities.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.offerapplications.php b/routes/CRUDgenerated/route.offerapplications.php new file mode 100644 index 0000000..2fbcbf2 --- /dev/null +++ b/routes/CRUDgenerated/route.offerapplications.php @@ -0,0 +1,22 @@ +group(function () { + Route::get('/', [OfferapplicationsController::class, 'index'])->name('offerapplications.index'); + Route::get('/issued', [OfferapplicationsController::class, 'index'])->name('offerapplications.issued'); + Route::get('/create', [OfferapplicationsController::class, 'create'])->name('offerapplications.create'); + Route::post('/store', [OfferapplicationsController::class, 'store'])->name('offerapplications.store'); + Route::post('/sort', [OfferapplicationsController::class, 'sort'])->name('offerapplications.sort'); + Route::post('/updatealias', [OfferapplicationsController::class, 'updatealias'])->name('offerapplications.updatealias'); + Route::get('/show/{id}', [OfferapplicationsController::class, 'show'])->name('offerapplications.show'); + Route::get('/edit/{id}', [OfferapplicationsController::class, 'edit'])->name('offerapplications.edit'); + Route::post('/update/{id}', [OfferapplicationsController::class, 'update'])->name('offerapplications.update'); + Route::get('/destroy/{id}', [OfferapplicationsController::class, 'destroy'])->name('offerapplications.destroy'); + Route::get('/toggle/{id}', [OfferapplicationsController::class, 'toggle'])->name('offerapplications.toggle'); + Route::get('/clone/{id}', [OfferapplicationsController::class, 'clone'])->name('offerapplications.clone'); + Route::get('/payment/{id}', [OfferapplicationsController::class, 'updatepayment'])->name('offerapplications.updatepayment'); + Route::post('/paymentreceived/{id}', [OfferapplicationsController::class, 'updatepaymentreceived'])->name('offerapplications.updatepaymentreceived'); + Route::get('/offer/{id}', [OfferapplicationsController::class, 'updateoffer'])->name('offerapplications.updateoffer'); + Route::match(['post','put'],'/offer/update/{id}', [OfferapplicationsController::class, 'storeoffer'])->name('offerapplications.storeoffer'); +}); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.onboardings.php b/routes/CRUDgenerated/route.onboardings.php new file mode 100644 index 0000000..1a3d55b --- /dev/null +++ b/routes/CRUDgenerated/route.onboardings.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [OnboardingsController::class, 'index'])->name('onboardings.index'); + Route::get('/create', [OnboardingsController::class, 'create'])->name('onboardings.create'); + Route::post('/store', [OnboardingsController::class, 'store'])->name('onboardings.store'); + Route::post('/sort', [OnboardingsController::class, 'sort'])->name('onboardings.sort'); + Route::post('/updatealias', [OnboardingsController::class, 'updatealias'])->name('onboardings.updatealias'); + Route::get('/show/{id}', [OnboardingsController::class, 'show'])->name('onboardings.show'); + Route::get('/edit/{id}', [OnboardingsController::class, 'edit'])->name('onboardings.edit') ; + Route::post('/update/{id}', [OnboardingsController::class, 'update'])->name('onboardings.update'); + Route::get('/destroy/{id}', [OnboardingsController::class, 'destroy'])->name('onboardings.destroy'); + Route::get('/toggle/{id}', [OnboardingsController::class, 'toggle'])->name('onboardings.toggle'); + Route::get('/clone/{id}', [OnboardingsController::class, 'clone'])->name('onboardings.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.options.php b/routes/CRUDgenerated/route.options.php new file mode 100644 index 0000000..4b70504 --- /dev/null +++ b/routes/CRUDgenerated/route.options.php @@ -0,0 +1,19 @@ +group(function () { + Route::get('/', [OptionsController::class, 'index'])->name('options.index'); + Route::get('/create', [OptionsController::class, 'create'])->name('options.create'); + Route::post('/store', [OptionsController::class, 'store'])->name('options.store'); + Route::post('/sort', [OptionsController::class, 'sort'])->name('options.sort'); + Route::post('/updatealias', [OptionsController::class, 'updatealias'])->name('options.updatealias'); + Route::get('/show/{id}', [OptionsController::class, 'show'])->name('options.show'); + Route::get('/edit/{id}', [OptionsController::class, 'edit'])->name('options.edit') ; + Route::post('/update/{id}', [OptionsController::class, 'update'])->name('options.update'); + Route::delete('/destroy/{id}', [OptionsController::class, 'destroy'])->name('options.destroy'); + Route::get('/toggle/{id}', [OptionsController::class, 'toggle'])->name('options.toggle'); + + //issued page routing + Route::get('/create_issue', [OptionsController::class, 'issued_create'])->name('issued.create'); + + }); diff --git a/routes/CRUDgenerated/route.permissions.php b/routes/CRUDgenerated/route.permissions.php new file mode 100644 index 0000000..74d6205 --- /dev/null +++ b/routes/CRUDgenerated/route.permissions.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [PermissionsController::class, 'index'])->name('permissions.index'); + Route::get('/create', [PermissionsController::class, 'create'])->name('permissions.create'); + Route::post('/store', [PermissionsController::class, 'store'])->name('permissions.store'); + Route::post('/sort', [PermissionsController::class, 'sort'])->name('permissions.sort'); + Route::post('/updatealias', [PermissionsController::class, 'updatealias'])->name('permissions.updatealias'); + Route::get('/show/{id}', [PermissionsController::class, 'show'])->name('permissions.show'); + Route::get('/edit/{id}', [PermissionsController::class, 'edit'])->name('permissions.edit') ; + Route::post('/update/{id}', [PermissionsController::class, 'update'])->name('permissions.update'); + Route::get('/destroy/{id}', [PermissionsController::class, 'destroy'])->name('permissions.destroy'); + Route::get('/toggle/{id}', [PermissionsController::class, 'toggle'])->name('permissions.toggle'); + Route::get('/clone/{id}', [PermissionsController::class, 'clone'])->name('permissions.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.preparationclasses.php b/routes/CRUDgenerated/route.preparationclasses.php new file mode 100644 index 0000000..9188295 --- /dev/null +++ b/routes/CRUDgenerated/route.preparationclasses.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [PreparationclassesController::class, 'index'])->name('preparationclasses.index'); + Route::get('/create', [PreparationclassesController::class, 'create'])->name('preparationclasses.create'); + Route::post('/store', [PreparationclassesController::class, 'store'])->name('preparationclasses.store'); + Route::post('/sort', [PreparationclassesController::class, 'sort'])->name('preparationclasses.sort'); + Route::post('/updatealias', [PreparationclassesController::class, 'updatealias'])->name('preparationclasses.updatealias'); + Route::get('/show/{id}', [PreparationclassesController::class, 'show'])->name('preparationclasses.show'); + Route::get('/edit/{id}', [PreparationclassesController::class, 'edit'])->name('preparationclasses.edit') ; + Route::post('/update/{id}', [PreparationclassesController::class, 'update'])->name('preparationclasses.update'); + Route::delete('/destroy/{id}', [PreparationclassesController::class, 'destroy'])->name('preparationclasses.destroy'); + Route::get('/toggle/{id}', [PreparationclassesController::class, 'toggle'])->name('preparationclasses.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.programs.php b/routes/CRUDgenerated/route.programs.php new file mode 100644 index 0000000..17af2c5 --- /dev/null +++ b/routes/CRUDgenerated/route.programs.php @@ -0,0 +1,20 @@ +group(function () { + Route::get('/', [ProgramsController::class, 'index'])->name('programs.index'); + Route::get('/list', [ProgramsController::class, 'list'])->name('programs.list'); + Route::get('/create', [ProgramsController::class, 'create'])->name('programs.create'); + Route::post('/store', [ProgramsController::class, 'store'])->name('programs.store'); + Route::post('/sort', [ProgramsController::class, 'sort'])->name('programs.sort'); + Route::post('/updatealias', [ProgramsController::class, 'updatealias'])->name('programs.updatealias'); + Route::get('/show/{id}', [ProgramsController::class, 'show'])->name('programs.show'); + Route::get('/fetch/byinstitution', [ProgramsController::class, 'fetchbyinstitution'])->name('programs.fetchbyinstitution'); + Route::get('/edit/{id}', [ProgramsController::class, 'edit'])->name('programs.edit'); + Route::post('/update/{id}', [ProgramsController::class, 'update'])->name('programs.update'); + Route::delete('/destroy/{id}', [ProgramsController::class, 'destroy'])->name('programs.destroy'); + Route::get('/toggle/{id}', [ProgramsController::class, 'toggle'])->name('programs.toggle'); + Route::get('/clone/{id}', [ProgramsController::class, 'cloneEntry'])->name('programs.clone'); +}); diff --git a/routes/CRUDgenerated/route.progressstatus.php b/routes/CRUDgenerated/route.progressstatus.php new file mode 100644 index 0000000..ed4b3bc --- /dev/null +++ b/routes/CRUDgenerated/route.progressstatus.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [ProgressstatusController::class, 'index'])->name('progressstatus.index'); + Route::get('/create', [ProgressstatusController::class, 'create'])->name('progressstatus.create'); + Route::post('/store', [ProgressstatusController::class, 'store'])->name('progressstatus.store'); + Route::post('/sort', [ProgressstatusController::class, 'sort'])->name('progressstatus.sort'); + Route::post('/updatealias', [ProgressstatusController::class, 'updatealias'])->name('progressstatus.updatealias'); + Route::get('/show/{id}', [ProgressstatusController::class, 'show'])->name('progressstatus.show'); + Route::get('/edit/{id}', [ProgressstatusController::class, 'edit'])->name('progressstatus.edit') ; + Route::post('/update/{id}', [ProgressstatusController::class, 'update'])->name('progressstatus.update'); + Route::get('/destroy/{id}', [ProgressstatusController::class, 'destroy'])->name('progressstatus.destroy'); + Route::get('/toggle/{id}', [ProgressstatusController::class, 'toggle'])->name('progressstatus.toggle'); + Route::get('/clone/{id}', [ProgressstatusController::class, 'clone'])->name('progressstatus.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.progressstatuses.php b/routes/CRUDgenerated/route.progressstatuses.php new file mode 100644 index 0000000..5731766 --- /dev/null +++ b/routes/CRUDgenerated/route.progressstatuses.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [ProgressstatusesController::class, 'index'])->name('progressstatuses.index'); + Route::get('/create', [ProgressstatusesController::class, 'create'])->name('progressstatuses.create'); + Route::post('/store', [ProgressstatusesController::class, 'store'])->name('progressstatuses.store'); + Route::post('/sort', [ProgressstatusesController::class, 'sort'])->name('progressstatuses.sort'); + Route::post('/updatealias', [ProgressstatusesController::class, 'updatealias'])->name('progressstatuses.updatealias'); + Route::get('/show/{id}', [ProgressstatusesController::class, 'show'])->name('progressstatuses.show'); + Route::get('/edit/{id}', [ProgressstatusesController::class, 'edit'])->name('progressstatuses.edit') ; + Route::post('/update/{id}', [ProgressstatusesController::class, 'update'])->name('progressstatuses.update'); + Route::get('/destroy/{id}', [ProgressstatusesController::class, 'destroy'])->name('progressstatuses.destroy'); + Route::get('/toggle/{id}', [ProgressstatusesController::class, 'toggle'])->name('progressstatuses.toggle'); + Route::get('/clone/{id}', [ProgressstatusesController::class, 'clone'])->name('progressstatuses.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.proviences.php b/routes/CRUDgenerated/route.proviences.php new file mode 100644 index 0000000..e2488c1 --- /dev/null +++ b/routes/CRUDgenerated/route.proviences.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [ProviencesController::class, 'index'])->name('proviences.index'); + Route::get('/create', [ProviencesController::class, 'create'])->name('proviences.create'); + Route::post('/store', [ProviencesController::class, 'store'])->name('proviences.store'); + Route::post('/sort', [ProviencesController::class, 'sort'])->name('proviences.sort'); + Route::post('/updatealias', [ProviencesController::class, 'updatealias'])->name('proviences.updatealias'); + Route::get('/show/{id}', [ProviencesController::class, 'show'])->name('proviences.show'); + Route::get('/edit/{id}', [ProviencesController::class, 'edit'])->name('proviences.edit') ; + Route::post('/update/{id}', [ProviencesController::class, 'update'])->name('proviences.update'); + Route::get('/destroy/{id}', [ProviencesController::class, 'destroy'])->name('proviences.destroy'); + Route::get('/toggle/{id}', [ProviencesController::class, 'toggle'])->name('proviences.toggle'); + Route::get('/clone/{id}', [ProviencesController::class, 'clone'])->name('proviences.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.provinces.php b/routes/CRUDgenerated/route.provinces.php new file mode 100644 index 0000000..e2f5de3 --- /dev/null +++ b/routes/CRUDgenerated/route.provinces.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [ProvincesController::class, 'index'])->name('provinces.index'); + Route::get('/create', [ProvincesController::class, 'create'])->name('provinces.create'); + Route::post('/store', [ProvincesController::class, 'store'])->name('provinces.store'); + Route::post('/sort', [ProvincesController::class, 'sort'])->name('provinces.sort'); + Route::post('/updatealias', [ProvincesController::class, 'updatealias'])->name('provinces.updatealias'); + Route::get('/show/{id}', [ProvincesController::class, 'show'])->name('provinces.show'); + Route::get('/edit/{id}', [ProvincesController::class, 'edit'])->name('provinces.edit') ; + Route::post('/update/{id}', [ProvincesController::class, 'update'])->name('provinces.update'); + Route::delete('/destroy/{id}', [ProvincesController::class, 'destroy'])->name('provinces.destroy'); + Route::get('/toggle/{id}', [ProvincesController::class, 'toggle'])->name('provinces.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.qrscans.php b/routes/CRUDgenerated/route.qrscans.php new file mode 100644 index 0000000..9967198 --- /dev/null +++ b/routes/CRUDgenerated/route.qrscans.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [QrscansController::class, 'index'])->name('qrscans.index'); + Route::get('/create', [QrscansController::class, 'create'])->name('qrscans.create'); + Route::post('/store', [QrscansController::class, 'store'])->name('qrscans.store'); + Route::post('/sort', [QrscansController::class, 'sort'])->name('qrscans.sort'); + Route::post('/updatealias', [QrscansController::class, 'updatealias'])->name('qrscans.updatealias'); + Route::get('/show/{id}', [QrscansController::class, 'show'])->name('qrscans.show'); + Route::get('/edit/{id}', [QrscansController::class, 'edit'])->name('qrscans.edit') ; + Route::post('/update/{id}', [QrscansController::class, 'update'])->name('qrscans.update'); + Route::delete('/destroy/{id}', [QrscansController::class, 'destroy'])->name('qrscans.destroy'); + Route::get('/toggle/{id}', [QrscansController::class, 'toggle'])->name('qrscans.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.qualifications.php b/routes/CRUDgenerated/route.qualifications.php new file mode 100644 index 0000000..4cb53ac --- /dev/null +++ b/routes/CRUDgenerated/route.qualifications.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [QualificationsController::class, 'index'])->name('qualifications.index'); + Route::get('/create', [QualificationsController::class, 'create'])->name('qualifications.create'); + Route::post('/store', [QualificationsController::class, 'store'])->name('qualifications.store'); + Route::post('/sort', [QualificationsController::class, 'sort'])->name('qualifications.sort'); + Route::post('/updatealias', [QualificationsController::class, 'updatealias'])->name('qualifications.updatealias'); + Route::get('/show/{id}', [QualificationsController::class, 'show'])->name('qualifications.show'); + Route::get('/edit/{id}', [QualificationsController::class, 'edit'])->name('qualifications.edit') ; + Route::post('/update/{id}', [QualificationsController::class, 'update'])->name('qualifications.update'); + Route::delete('/destroy/{id}', [QualificationsController::class, 'destroy'])->name('qualifications.destroy'); + Route::get('/toggle/{id}', [QualificationsController::class, 'toggle'])->name('qualifications.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.registrations.php b/routes/CRUDgenerated/route.registrations.php new file mode 100644 index 0000000..b23fdf9 --- /dev/null +++ b/routes/CRUDgenerated/route.registrations.php @@ -0,0 +1,25 @@ +group(function () { + Route::match(['get', 'post'], '/', [RegistrationsController::class, 'index'])->name('registrations.index'); + Route::match(['get', 'post'], '/campaigns/{alias}', [RegistrationsController::class, 'bycampaign'])->name('registrations.bycampaign'); + Route::match(['get', 'post'], '/categories/{alias}', [RegistrationsController::class, 'bycategory'])->name('registrations.bycategory'); + Route::match(['get', 'post'], '/branch/{alias}', [RegistrationsController::class, 'bybranch'])->name('registrations.bybranch'); + Route::match(['get', 'post'], '/sources/{alias}', [RegistrationsController::class, 'bysource'])->name('registrations.bysource'); + Route::match(['get', 'post'], '/countries/{alias}', [RegistrationsController::class, 'bycountry'])->name('registrations.bycountry'); + Route::match(['get', 'post'], '/agents/{alias}', [RegistrationsController::class, 'byagent'])->name('registrations.byagent'); + Route::get('/create', [RegistrationsController::class, 'create'])->name('registrations.create'); + Route::post('/sendbulksms', [RegistrationsController::class, 'sendbulksms'])->name('registrations.sms.send'); + Route::post('/store', [RegistrationsController::class, 'store'])->name('registrations.store'); + Route::post('/sort', [RegistrationsController::class, 'sort'])->name('registrations.sort'); + Route::post('/updatealias', [RegistrationsController::class, 'updatealias'])->name('registrations.updatealias'); + Route::get('/show/{id}', [RegistrationsController::class, 'show'])->name('registrations.show'); + Route::get('/edit/{id}', [RegistrationsController::class, 'edit'])->name('registrations.edit'); + Route::get('/ajaxedit/{id}', [RegistrationsController::class, 'ajaxedit'])->name('registrations.edit.ajax'); + Route::post('/update/{id}', [RegistrationsController::class, 'update'])->name('registrations.update'); + Route::delete('/destroy/{id}', [RegistrationsController::class, 'destroy'])->name('registrations.destroy'); + Route::get('/toggle/{id}', [RegistrationsController::class, 'toggle'])->name('registrations.toggle'); +}); diff --git a/routes/CRUDgenerated/route.requireddocuments.php b/routes/CRUDgenerated/route.requireddocuments.php new file mode 100644 index 0000000..d9b8363 --- /dev/null +++ b/routes/CRUDgenerated/route.requireddocuments.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [RequireddocumentsController::class, 'index'])->name('requireddocuments.index'); + Route::get('/create', [RequireddocumentsController::class, 'create'])->name('requireddocuments.create'); + Route::post('/store', [RequireddocumentsController::class, 'store'])->name('requireddocuments.store'); + Route::post('/sort', [RequireddocumentsController::class, 'sort'])->name('requireddocuments.sort'); + Route::post('/updatealias', [RequireddocumentsController::class, 'updatealias'])->name('requireddocuments.updatealias'); + Route::get('/show/{id}', [RequireddocumentsController::class, 'show'])->name('requireddocuments.show'); + Route::get('/edit/{id}', [RequireddocumentsController::class, 'edit'])->name('requireddocuments.edit') ; + Route::post('/update/{id}', [RequireddocumentsController::class, 'update'])->name('requireddocuments.update'); + Route::get('/destroy/{id}', [RequireddocumentsController::class, 'destroy'])->name('requireddocuments.destroy'); + Route::get('/toggle/{id}', [RequireddocumentsController::class, 'toggle'])->name('requireddocuments.toggle'); + Route::get('/clone/{id}', [RequireddocumentsController::class, 'clone'])->name('requireddocuments.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.rolepermissions.php b/routes/CRUDgenerated/route.rolepermissions.php new file mode 100644 index 0000000..8e2c30b --- /dev/null +++ b/routes/CRUDgenerated/route.rolepermissions.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [RolepermissionsController::class, 'index'])->name('rolepermissions.index'); + Route::get('/create', [RolepermissionsController::class, 'create'])->name('rolepermissions.create'); + Route::post('/store', [RolepermissionsController::class, 'store'])->name('rolepermissions.store'); + Route::post('/sort', [RolepermissionsController::class, 'sort'])->name('rolepermissions.sort'); + Route::post('/updatealias', [RolepermissionsController::class, 'updatealias'])->name('rolepermissions.updatealias'); + Route::get('/show/{id}', [RolepermissionsController::class, 'show'])->name('rolepermissions.show'); + Route::get('/edit/{id}', [RolepermissionsController::class, 'edit'])->name('rolepermissions.edit') ; + Route::post('/update/{id}', [RolepermissionsController::class, 'update'])->name('rolepermissions.update'); + Route::get('/destroy/{id}', [RolepermissionsController::class, 'destroy'])->name('rolepermissions.destroy'); + Route::get('/toggle/{id}', [RolepermissionsController::class, 'toggle'])->name('rolepermissions.toggle'); + Route::get('/clone/{id}', [RolepermissionsController::class, 'clone'])->name('rolepermissions.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.roles.php b/routes/CRUDgenerated/route.roles.php new file mode 100644 index 0000000..a9e2f28 --- /dev/null +++ b/routes/CRUDgenerated/route.roles.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [RolesController::class, 'index'])->name('roles.index'); + Route::get('/create', [RolesController::class, 'create'])->name('roles.create'); + Route::post('/store', [RolesController::class, 'store'])->name('roles.store'); + Route::post('/sort', [RolesController::class, 'sort'])->name('roles.sort'); + Route::post('/updatealias', [RolesController::class, 'updatealias'])->name('roles.updatealias'); + Route::get('/show/{id}', [RolesController::class, 'show'])->name('roles.show'); + Route::get('/edit/{id}', [RolesController::class, 'edit'])->name('roles.edit') ; + Route::post('/update/{id}', [RolesController::class, 'update'])->name('roles.update'); + Route::get('/destroy/{id}', [RolesController::class, 'destroy'])->name('roles.destroy'); + Route::get('/toggle/{id}', [RolesController::class, 'toggle'])->name('roles.toggle'); + Route::get('/clone/{id}', [RolesController::class, 'clone'])->name('roles.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.settings.php b/routes/CRUDgenerated/route.settings.php new file mode 100644 index 0000000..a8daf76 --- /dev/null +++ b/routes/CRUDgenerated/route.settings.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [SettingsController::class, 'index'])->name('settings.index'); + Route::get('/create', [SettingsController::class, 'create'])->name('settings.create'); + Route::post('/store', [SettingsController::class, 'store'])->name('settings.store'); + Route::post('/sort', [SettingsController::class, 'sort'])->name('settings.sort'); + Route::post('/updatealias', [SettingsController::class, 'updatealias'])->name('settings.updatealias'); + Route::get('/show/{id}', [SettingsController::class, 'show'])->name('settings.show'); + Route::get('/edit/{id}', [SettingsController::class, 'edit'])->name('settings.edit') ; + Route::post('/update/{id}', [SettingsController::class, 'update'])->name('settings.update'); + Route::delete('/destroy/{id}', [SettingsController::class, 'destroy'])->name('settings.destroy'); + Route::get('/toggle/{id}', [SettingsController::class, 'toggle'])->name('settings.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.shifts.php b/routes/CRUDgenerated/route.shifts.php new file mode 100644 index 0000000..2f84d60 --- /dev/null +++ b/routes/CRUDgenerated/route.shifts.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [ShiftsController::class, 'index'])->name('shifts.index'); + Route::get('/create', [ShiftsController::class, 'create'])->name('shifts.create'); + Route::post('/store', [ShiftsController::class, 'store'])->name('shifts.store'); + Route::post('/sort', [ShiftsController::class, 'sort'])->name('shifts.sort'); + Route::post('/updatealias', [ShiftsController::class, 'updatealias'])->name('shifts.updatealias'); + Route::get('/show/{id}', [ShiftsController::class, 'show'])->name('shifts.show'); + Route::get('/edit/{id}', [ShiftsController::class, 'edit'])->name('shifts.edit') ; + Route::post('/update/{id}', [ShiftsController::class, 'update'])->name('shifts.update'); + Route::get('/destroy/{id}', [ShiftsController::class, 'destroy'])->name('shifts.destroy'); + Route::get('/toggle/{id}', [ShiftsController::class, 'toggle'])->name('shifts.toggle'); + Route::get('/clone/{id}', [ShiftsController::class, 'clone'])->name('shifts.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.sources.php b/routes/CRUDgenerated/route.sources.php new file mode 100644 index 0000000..56f0f53 --- /dev/null +++ b/routes/CRUDgenerated/route.sources.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [SourcesController::class, 'index'])->name('sources.index'); + Route::get('/create', [SourcesController::class, 'create'])->name('sources.create'); + Route::post('/store', [SourcesController::class, 'store'])->name('sources.store'); + Route::post('/sort', [SourcesController::class, 'sort'])->name('sources.sort'); + Route::post('/updatealias', [SourcesController::class, 'updatealias'])->name('sources.updatealias'); + Route::get('/show/{id}', [SourcesController::class, 'show'])->name('sources.show'); + Route::get('/edit/{id}', [SourcesController::class, 'edit'])->name('sources.edit') ; + Route::post('/update/{id}', [SourcesController::class, 'update'])->name('sources.update'); + Route::delete('/destroy/{id}', [SourcesController::class, 'destroy'])->name('sources.destroy'); + Route::get('/toggle/{id}', [SourcesController::class, 'toggle'])->name('sources.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.spinthewheelwinners.php b/routes/CRUDgenerated/route.spinthewheelwinners.php new file mode 100644 index 0000000..1785ad3 --- /dev/null +++ b/routes/CRUDgenerated/route.spinthewheelwinners.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [SpinthewheelwinnersController::class, 'index'])->name('spinthewheelwinners.index'); + Route::get('/create', [SpinthewheelwinnersController::class, 'create'])->name('spinthewheelwinners.create'); + Route::post('/store', [SpinthewheelwinnersController::class, 'store'])->name('spinthewheelwinners.store'); + Route::post('/sort', [SpinthewheelwinnersController::class, 'sort'])->name('spinthewheelwinners.sort'); + Route::post('/updatealias', [SpinthewheelwinnersController::class, 'updatealias'])->name('spinthewheelwinners.updatealias'); + Route::get('/show/{id}', [SpinthewheelwinnersController::class, 'show'])->name('spinthewheelwinners.show'); + Route::get('/edit/{id}', [SpinthewheelwinnersController::class, 'edit'])->name('spinthewheelwinners.edit') ; + Route::post('/update/{id}', [SpinthewheelwinnersController::class, 'update'])->name('spinthewheelwinners.update'); + Route::delete('/destroy/{id}', [SpinthewheelwinnersController::class, 'destroy'])->name('spinthewheelwinners.destroy'); + Route::get('/toggle/{id}', [SpinthewheelwinnersController::class, 'toggle'])->name('spinthewheelwinners.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.staffs.php b/routes/CRUDgenerated/route.staffs.php new file mode 100644 index 0000000..b4de5c4 --- /dev/null +++ b/routes/CRUDgenerated/route.staffs.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [StaffsController::class, 'index'])->name('staffs.index'); + Route::get('/create', [StaffsController::class, 'create'])->name('staffs.create'); + Route::post('/store', [StaffsController::class, 'store'])->name('staffs.store'); + Route::post('/sort', [StaffsController::class, 'sort'])->name('staffs.sort'); + Route::post('/updatealias', [StaffsController::class, 'updatealias'])->name('staffs.updatealias'); + Route::get('/show/{id}', [StaffsController::class, 'show'])->name('staffs.show'); + Route::get('/edit/{id}', [StaffsController::class, 'edit'])->name('staffs.edit') ; + Route::post('/update/{id}', [StaffsController::class, 'update'])->name('staffs.update'); + Route::get('/destroy/{id}', [StaffsController::class, 'destroy'])->name('staffs.destroy'); + Route::get('/toggle/{id}', [StaffsController::class, 'toggle'])->name('staffs.toggle'); + Route::get('/clone/{id}', [StaffsController::class, 'clone'])->name('staffs.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.students.php b/routes/CRUDgenerated/route.students.php new file mode 100644 index 0000000..acacbcf --- /dev/null +++ b/routes/CRUDgenerated/route.students.php @@ -0,0 +1,21 @@ +group(function () { + Route::get('/', [StudentsController::class, 'index'])->name('students.index'); + Route::match(['get', 'post'], '/campaigns/{alias}', [StudentsController::class, 'bycampaign'])->name('students.bycampaign'); + Route::match(['get', 'post'], '/categories/{alias}', [StudentsController::class, 'bycategory'])->name('students.bycategory'); + Route::match(['get', 'post'], '/sources/{alias}', [StudentsController::class, 'bysource'])->name('students.bysource'); + Route::match(['get', 'post'], '/branches/{alias}', [StudentsController::class, 'bybranch'])->name('students.bybranch'); + Route::match(['get', 'post'], '/countries/{alias}', [StudentsController::class, 'bycountry'])->name('students.bycountry'); + Route::match(['get', 'post'], '/agents/{alias}', [StudentsController::class, 'byagent'])->name('students.byagent'); + Route::get('/create', [StudentsController::class, 'create'])->name('students.create'); + Route::post('/store', [StudentsController::class, 'store'])->name('students.store'); + Route::post('/sort', [StudentsController::class, 'sort'])->name('students.sort'); + Route::post('/updatealias', [StudentsController::class, 'updatealias'])->name('students.updatealias'); + Route::get('/show/{id}', [StudentsController::class, 'show'])->name('students.show'); + Route::get('/edit/{id}', [StudentsController::class, 'edit'])->name('students.edit') ; + Route::post('/update/{id}', [StudentsController::class, 'update'])->name('students.update'); + Route::delete('/destroy/{id}', [StudentsController::class, 'destroy'])->name('students.destroy'); + Route::get('/toggle/{id}', [StudentsController::class, 'toggle'])->name('students.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.users.php b/routes/CRUDgenerated/route.users.php new file mode 100644 index 0000000..8167adf --- /dev/null +++ b/routes/CRUDgenerated/route.users.php @@ -0,0 +1,15 @@ +group(function () { + Route::get('/', [UsersController::class, 'index'])->name('users.index'); + Route::get('/create', [UsersController::class, 'create'])->name('users.create'); + Route::post('/store', [UsersController::class, 'store'])->name('users.store'); + Route::post('/sort', [UsersController::class, 'sort'])->name('users.sort'); + Route::post('/updatealias', [UsersController::class, 'updatealias'])->name('users.updatealias'); + Route::get('/show/{id}', [UsersController::class, 'show'])->name('users.show'); + Route::get('/edit/{id}', [UsersController::class, 'edit'])->name('users.edit') ; + Route::post('/update/{id}', [UsersController::class, 'update'])->name('users.update'); + Route::delete('/destroy/{id}', [UsersController::class, 'destroy'])->name('users.destroy'); + Route::get('/toggle/{id}', [UsersController::class, 'toggle'])->name('users.toggle'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.vendors.php b/routes/CRUDgenerated/route.vendors.php new file mode 100644 index 0000000..83c38d6 --- /dev/null +++ b/routes/CRUDgenerated/route.vendors.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [VendorsController::class, 'index'])->name('vendors.index'); + Route::get('/create', [VendorsController::class, 'create'])->name('vendors.create'); + Route::post('/store', [VendorsController::class, 'store'])->name('vendors.store'); + Route::post('/sort', [VendorsController::class, 'sort'])->name('vendors.sort'); + Route::post('/updatealias', [VendorsController::class, 'updatealias'])->name('vendors.updatealias'); + Route::get('/show/{id}', [VendorsController::class, 'show'])->name('vendors.show'); + Route::get('/edit/{id}', [VendorsController::class, 'edit'])->name('vendors.edit') ; + Route::post('/update/{id}', [VendorsController::class, 'update'])->name('vendors.update'); + Route::get('/destroy/{id}', [VendorsController::class, 'destroy'])->name('vendors.destroy'); + Route::get('/toggle/{id}', [VendorsController::class, 'toggle'])->name('vendors.toggle'); + Route::get('/clone/{id}', [VendorsController::class, 'clone'])->name('vendors.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.vendortypes.php b/routes/CRUDgenerated/route.vendortypes.php new file mode 100644 index 0000000..c1357ed --- /dev/null +++ b/routes/CRUDgenerated/route.vendortypes.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [VendortypesController::class, 'index'])->name('vendortypes.index'); + Route::get('/create', [VendortypesController::class, 'create'])->name('vendortypes.create'); + Route::post('/store', [VendortypesController::class, 'store'])->name('vendortypes.store'); + Route::post('/sort', [VendortypesController::class, 'sort'])->name('vendortypes.sort'); + Route::post('/updatealias', [VendortypesController::class, 'updatealias'])->name('vendortypes.updatealias'); + Route::get('/show/{id}', [VendortypesController::class, 'show'])->name('vendortypes.show'); + Route::get('/edit/{id}', [VendortypesController::class, 'edit'])->name('vendortypes.edit') ; + Route::post('/update/{id}', [VendortypesController::class, 'update'])->name('vendortypes.update'); + Route::get('/destroy/{id}', [VendortypesController::class, 'destroy'])->name('vendortypes.destroy'); + Route::get('/toggle/{id}', [VendortypesController::class, 'toggle'])->name('vendortypes.toggle'); + Route::get('/clone/{id}', [VendortypesController::class, 'clone'])->name('vendortypes.clone'); + }); \ No newline at end of file diff --git a/routes/CRUDgenerated/route.workoptions.php b/routes/CRUDgenerated/route.workoptions.php new file mode 100644 index 0000000..10128b9 --- /dev/null +++ b/routes/CRUDgenerated/route.workoptions.php @@ -0,0 +1,16 @@ +group(function () { + Route::get('/', [WorkoptionsController::class, 'index'])->name('workoptions.index'); + Route::get('/create', [WorkoptionsController::class, 'create'])->name('workoptions.create'); + Route::post('/store', [WorkoptionsController::class, 'store'])->name('workoptions.store'); + Route::post('/sort', [WorkoptionsController::class, 'sort'])->name('workoptions.sort'); + Route::post('/updatealias', [WorkoptionsController::class, 'updatealias'])->name('workoptions.updatealias'); + Route::get('/show/{id}', [WorkoptionsController::class, 'show'])->name('workoptions.show'); + Route::get('/edit/{id}', [WorkoptionsController::class, 'edit'])->name('workoptions.edit') ; + Route::post('/update/{id}', [WorkoptionsController::class, 'update'])->name('workoptions.update'); + Route::get('/destroy/{id}', [WorkoptionsController::class, 'destroy'])->name('workoptions.destroy'); + Route::get('/toggle/{id}', [WorkoptionsController::class, 'toggle'])->name('workoptions.toggle'); + Route::get('/clone/{id}', [WorkoptionsController::class, 'clone'])->name('workoptions.clone'); + }); \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 6ea49ba..6b07195 100644 --- a/routes/web.php +++ b/routes/web.php @@ -31,3 +31,41 @@ Route::resource('users', UserController::class)->names('users'); Route::get('/initialize-db', function () { OMIS::initDB(); }); + +require __DIR__ . '/route.client.php'; +Route::middleware('auth')->group(function () { + require __DIR__ . '/route.users.php'; + require __DIR__ . '/route.roles.php'; + require __DIR__ . '/route.rolepermissions.php'; + require __DIR__ . '/route.settings.php'; + require __DIR__ . '/route.form.php'; + require __DIR__ . '/CRUDgenerated/route.countries.php'; + + require __DIR__ . '/CRUDgenerated/route.companytypes.php'; + require __DIR__ . '/CRUDgenerated/route.companies.php'; + require __DIR__ . '/CRUDgenerated/route.branches.php'; + + require __DIR__ . '/CRUDgenerated/route.proviences.php'; + require __DIR__ . '/CRUDgenerated/route.districts.php'; + require __DIR__ . '/CRUDgenerated/route.cities.php'; + + require __DIR__ . '/CRUDgenerated/route.vendortypes.php'; + require __DIR__ . '/CRUDgenerated/route.vendors.php'; + + require __DIR__ . '/CRUDgenerated/route.genders.php'; + require __DIR__ . '/CRUDgenerated/route.castes.php'; + require __DIR__ . '/CRUDgenerated/route.nationalities.php'; + require __DIR__ . '/CRUDgenerated/route.ethnicities.php'; + require __DIR__ . '/CRUDgenerated/route.dags.php'; + + require __DIR__ . '/CRUDgenerated/route.employees.php'; + + require __DIR__ . '/CRUDgenerated/route.onboardings.php'; + require __DIR__ . '/CRUDgenerated/route.departments.php'; + require __DIR__ . '/CRUDgenerated/route.designations.php'; + require __DIR__ . '/CRUDgenerated/route.shifts.php'; + require __DIR__ . '/CRUDgenerated/route.workoptions.php'; + require __DIR__ . '/CRUDgenerated/route.leavetypes.php'; + require __DIR__ . '/CRUDgenerated/route.leaves.php'; + +});