From c378522598d7f5cda307fd5d44d8a64fb8058fe0 Mon Sep 17 00:00:00 2001 From: Dharma Date: Thu, 11 Apr 2024 17:50:16 +0545 Subject: [PATCH 1/4] master admin module --- .../Controllers/DepartmentsController.php | 218 ++++++++++++++++++ .../Controllers/DesignationsController.php | 209 +++++++++++++++++ .../Admin/app}/Models/Departments.php | 2 +- .../Admin/app}/Models/Designations.php | 2 +- Modules/Admin/app/Services/AdminService.php | 11 + .../Http/Controllers/EmployeeController.php | 4 +- .../resources/views/partials/action.blade.php | 9 +- .../Controllers/DepartmentsController.php | 217 ----------------- .../Controllers/DesignationsController.php | 208 ----------------- 9 files changed, 446 insertions(+), 434 deletions(-) create mode 100644 Modules/Admin/app/Http/Controllers/DepartmentsController.php create mode 100644 Modules/Admin/app/Http/Controllers/DesignationsController.php rename {app => Modules/Admin/app}/Models/Departments.php (89%) rename {app => Modules/Admin/app}/Models/Designations.php (89%) delete mode 100644 app/Http/Controllers/DepartmentsController.php delete mode 100644 app/Http/Controllers/DesignationsController.php diff --git a/Modules/Admin/app/Http/Controllers/DepartmentsController.php b/Modules/Admin/app/Http/Controllers/DepartmentsController.php new file mode 100644 index 0000000..f1caca3 --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/DepartmentsController.php @@ -0,0 +1,218 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + + $data = Departments::where('status', '<>', -1)->orderBy('display_order')->get(); + + return view("admin.departments.index", compact('data')); + } + + public function create(Request $request) + { + + $TableData = Departments::where('status', '<>', -1)->orderBy('display_order')->get(); + $editable = false; + return view("admin.departments.edit", compact('TableData', 'editable')); + } + + public function store(Request $request) + { + + $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('department.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) + { + + $data = Departments::findOrFail($id); + + return view("admin.departments.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + + $TableData = Departments::where('status', '<>', -1)->orderBy('display_order')->get(); + $data = Departments::findOrFail($id); + $editable = true; + return view("admin.departments.edit", compact('data', 'TableData', 'editable')); + } + + + public function update(Request $request, $id) + { + + $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) + { + + 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) + { + + $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) + { + + $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); + } + + + +} diff --git a/Modules/Admin/app/Http/Controllers/DesignationsController.php b/Modules/Admin/app/Http/Controllers/DesignationsController.php new file mode 100644 index 0000000..35cd12e --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/DesignationsController.php @@ -0,0 +1,209 @@ +modelService = new CommonModelService($model); + } + public function index(Request $request) + { + $data = Designations::where('status', '<>', -1)->orderBy('display_order')->get(); + + return view("admin::designations.index", compact('data')); + } + + public function create(Request $request) + { + $TableData = Designations::where('status', '<>', -1)->orderBy('display_order')->get(); + $editable = false; + return view("admin::designations.edit", compact('TableData', 'editable')); + } + + public function store(Request $request) + { + $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('designation.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) + { + $data = Designations::findOrFail($id); + + return view("admin::designations.show", compact('data')); + } + + + public function edit(Request $request, $id) + { + $TableData = Designations::where('status', '<>', -1)->orderBy('display_order')->get(); + $data = Designations::findOrFail($id); + $editable = true; + return view("admin::designations.edit", compact('data', 'TableData', 'editable')); + } + + + public function update(Request $request, $id) + { + $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) + { + 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) + { + $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) + { + $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); + } + + + +} diff --git a/app/Models/Departments.php b/Modules/Admin/app/Models/Departments.php similarity index 89% rename from app/Models/Departments.php rename to Modules/Admin/app/Models/Departments.php index 7b7be84..60c47be 100644 --- a/app/Models/Departments.php +++ b/Modules/Admin/app/Models/Departments.php @@ -1,6 +1,6 @@ adminService->pluckDepartments(); + $data['designationList'] = $this->adminService->pluckDesignations(); $data['nationalityList'] = $this->adminService->pluckNationalities(); $data['genderList'] = $this->adminService->pluckGenders(); $data['casteList'] = $this->adminService->pluckCastes(); diff --git a/Modules/Employee/resources/views/partials/action.blade.php b/Modules/Employee/resources/views/partials/action.blade.php index b32fda3..d7b8791 100644 --- a/Modules/Employee/resources/views/partials/action.blade.php +++ b/Modules/Employee/resources/views/partials/action.blade.php @@ -27,7 +27,7 @@
{{ html()->label('Gender')->class('form-label') }} - {{ html()->select('genders_id', [1 => 'male', 2 => 'female'])->class('form-select')->placeholder('Select Gender') }} + {{ html()->select('genders_id', $genderList)->class('form-select')->placeholder('Select Gender') }}
@@ -39,7 +39,7 @@
{{ html()->label('Nationality')->class('form-label') }} - {{ html()->select('nationalities_id', [1 => 'Nepal', 2 => 'Other'])->class('form-control')->placeholder('Select Nationality') }} + {{ html()->select('nationality_id', $nationalityList)->class('form-select')->placeholder('Select Nationality') }}
@@ -91,12 +91,12 @@
{{ html()->label('Department')->class('form-label') }} - {{ html()->select('department_id', ['Nepal'])->class('form-select')->placeholder('Select Department') }} + {{ html()->select('department_id', $departmentList)->class('form-select')->placeholder('Select Department') }}
{{ html()->label('Designation')->class('form-label') }} - {{ html()->select('designation_id', ['Nepal'])->class('form-select')->placeholder('Select Designation') }} + {{ html()->select('designation_id', $designationList)->class('form-select')->placeholder('Select Designation') }}
{{--
@@ -115,7 +115,6 @@
-
diff --git a/app/Http/Controllers/DepartmentsController.php b/app/Http/Controllers/DepartmentsController.php deleted file mode 100644 index bf62f70..0000000 --- a/app/Http/Controllers/DepartmentsController.php +++ /dev/null @@ -1,217 +0,0 @@ -modelService = new CommonModelService($model); - } - public function index(Request $request) - { - - $data = Departments::where('status','<>',-1)->orderBy('display_order')->get(); - - return view("crud.generated.departments.index", compact('data')); - } - - public function create(Request $request) - { - - $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) - { - - $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('department.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) - { - - $data = Departments::findOrFail($id); - - return view("crud.generated.departments.show", compact('data')); - } - - - public function edit(Request $request, $id) - { - - $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) - { - - $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) - { - - 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) - { - - $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) - { - - $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); - } - - - - } diff --git a/app/Http/Controllers/DesignationsController.php b/app/Http/Controllers/DesignationsController.php deleted file mode 100644 index 9ba6dff..0000000 --- a/app/Http/Controllers/DesignationsController.php +++ /dev/null @@ -1,208 +0,0 @@ -modelService = new CommonModelService($model); - } - public function index(Request $request) - { - $data = Designations::where('status','<>',-1)->orderBy('display_order')->get(); - - return view("crud.generated.designations.index", compact('data')); - } - - public function create(Request $request) - { - $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) - { - $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('designation.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) - { - $data = Designations::findOrFail($id); - - return view("crud.generated.designations.show", compact('data')); - } - - - public function edit(Request $request, $id) - { - $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) - { - $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) - { - 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) - { - $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) - { - $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); - } - - - - } From efe174e3b349368e7064f9aafef5d1292bebca32 Mon Sep 17 00:00:00 2001 From: Dharma Date: Sun, 14 Apr 2024 18:29:29 +0545 Subject: [PATCH 2/4] admin module added --- .../Controllers/AppreciationController.php | 85 ++++++++++++++++++ .../Controllers/DepartmentsController.php | 8 +- .../PromotionDemotionController.php | 87 +++++++++++++++++++ .../Controllers/ResignationController.php | 83 ++++++++++++++++++ Modules/Admin/app/Models/Appreciation.php | 30 +++++++ .../Admin/app/Models/PromotionDemotion.php | 31 +++++++ Modules/Admin/app/Models/Resignation.php | 31 +++++++ .../Repositories/AppreciationInterface.php | 12 +++ .../Repositories/AppreciationRepository.php | 35 ++++++++ .../PromotionDemotionInterface.php | 12 +++ .../PromotionDemotionRepository.php | 35 ++++++++ .../app/Repositories/ResignationInterface.php | 12 +++ .../Repositories/ResignationRepository.php | 35 ++++++++ ...80050_create_promotion_demotions_table.php | 38 ++++++++ ...4_14_105508_create_appreciations_table.php | 37 ++++++++ ...04_14_115955_create_resignations_table.php | 35 ++++++++ .../views/appreciations/create.blade.php | 23 +++++ .../views/appreciations/edit.blade.php | 23 +++++ .../views/appreciations/index.blade.php | 75 ++++++++++++++++ .../views/appreciations/show.blade.php | 48 ++++++++++ .../resources/views/cities/show.blade.php | 13 ++- .../views}/departments/edit.blade.php | 2 +- .../views}/departments/index.blade.php | 0 .../views}/departments/show.blade.php | 10 ++- .../views}/designations/edit.blade.php | 0 .../views}/designations/index.blade.php | 0 .../views/designations/show.blade.php | 48 ++++++++++ Modules/Admin/resources/views/index.blade.php | 4 +- .../partials/appreciations/action.blade.php | 43 +++++++++ .../promotiondemotions/action.blade.php | 46 ++++++++++ .../partials/resignations/action.blade.php | 26 ++++++ .../views/promotiondemotions/create.blade.php | 23 +++++ .../views/promotiondemotions/edit.blade.php | 23 +++++ .../views/promotiondemotions/index.blade.php | 75 ++++++++++++++++ .../views/promotiondemotions/show.blade.php | 48 ++++++++++ .../views/resignations/create.blade.php | 23 +++++ .../views/resignations/edit.blade.php | 23 +++++ .../views/resignations/index.blade.php | 77 ++++++++++++++++ .../views/resignations/show.blade.php | 48 ++++++++++ Modules/Admin/routes/web.php | 6 ++ ...24_04_07_093523_create_employees_table.php | 5 +- .../app/Http/Controllers/LeaveController.php | 13 ++- .../Http/Controllers/LeaveTypeController.php | 26 ++++-- Modules/Leave/app/Models/LeaveType.php | 13 +-- .../app/Repositories/LeaveTypeInterface.php | 9 +- .../app/Repositories/LeaveTypeRepository.php | 20 +++-- .../2024_04_04_102430_create_leaves_table.php | 9 +- .../views/leave-type/create.blade.php | 4 +- .../resources/views/leave-type/edit.blade.php | 2 +- .../views/leave-type/index.blade.php | 21 +++-- .../leave-type/partials/action.blade.php | 23 ++--- .../views/leave-type/partials/view.blade.php | 2 +- .../resources/views/leave/create.blade.php | 2 +- .../resources/views/leave/edit.blade.php | 1 - .../resources/views/leave/index.blade.php | 4 +- .../views/leave/partials/action.blade.php | 40 +++++---- Modules/Leave/routes/web.php | 1 - app/Helpers/OMIS.php | 8 +- .../generated/designations/show.blade.php | 38 -------- .../views/layouts/partials/sidebar.blade.php | 24 ++++- routes/CRUDgenerated/route.departments.php | 27 +++--- routes/CRUDgenerated/route.designations.php | 29 ++++--- ...eavetypes.php => route.leavetypes.php.bak} | 2 +- 63 files changed, 1454 insertions(+), 182 deletions(-) create mode 100644 Modules/Admin/app/Http/Controllers/AppreciationController.php create mode 100644 Modules/Admin/app/Http/Controllers/PromotionDemotionController.php create mode 100644 Modules/Admin/app/Http/Controllers/ResignationController.php create mode 100644 Modules/Admin/app/Models/Appreciation.php create mode 100644 Modules/Admin/app/Models/PromotionDemotion.php create mode 100644 Modules/Admin/app/Models/Resignation.php create mode 100644 Modules/Admin/app/Repositories/AppreciationInterface.php create mode 100644 Modules/Admin/app/Repositories/AppreciationRepository.php create mode 100644 Modules/Admin/app/Repositories/PromotionDemotionInterface.php create mode 100644 Modules/Admin/app/Repositories/PromotionDemotionRepository.php create mode 100644 Modules/Admin/app/Repositories/ResignationInterface.php create mode 100644 Modules/Admin/app/Repositories/ResignationRepository.php create mode 100644 Modules/Admin/database/migrations/2024_04_14_080050_create_promotion_demotions_table.php create mode 100644 Modules/Admin/database/migrations/2024_04_14_105508_create_appreciations_table.php create mode 100644 Modules/Admin/database/migrations/2024_04_14_115955_create_resignations_table.php create mode 100644 Modules/Admin/resources/views/appreciations/create.blade.php create mode 100644 Modules/Admin/resources/views/appreciations/edit.blade.php create mode 100644 Modules/Admin/resources/views/appreciations/index.blade.php create mode 100644 Modules/Admin/resources/views/appreciations/show.blade.php rename {resources/views/crud/generated => Modules/Admin/resources/views}/departments/edit.blade.php (99%) rename {resources/views/crud/generated => Modules/Admin/resources/views}/departments/index.blade.php (100%) rename {resources/views/crud/generated => Modules/Admin/resources/views}/departments/show.blade.php (83%) rename {resources/views/crud/generated => Modules/Admin/resources/views}/designations/edit.blade.php (100%) rename {resources/views/crud/generated => Modules/Admin/resources/views}/designations/index.blade.php (100%) create mode 100644 Modules/Admin/resources/views/designations/show.blade.php create mode 100644 Modules/Admin/resources/views/partials/appreciations/action.blade.php create mode 100644 Modules/Admin/resources/views/partials/promotiondemotions/action.blade.php create mode 100644 Modules/Admin/resources/views/partials/resignations/action.blade.php create mode 100644 Modules/Admin/resources/views/promotiondemotions/create.blade.php create mode 100644 Modules/Admin/resources/views/promotiondemotions/edit.blade.php create mode 100644 Modules/Admin/resources/views/promotiondemotions/index.blade.php create mode 100644 Modules/Admin/resources/views/promotiondemotions/show.blade.php create mode 100644 Modules/Admin/resources/views/resignations/create.blade.php create mode 100644 Modules/Admin/resources/views/resignations/edit.blade.php create mode 100644 Modules/Admin/resources/views/resignations/index.blade.php create mode 100644 Modules/Admin/resources/views/resignations/show.blade.php delete mode 100644 resources/views/crud/generated/designations/show.blade.php rename routes/CRUDgenerated/{route.leavetypes.php => route.leavetypes.php.bak} (99%) diff --git a/Modules/Admin/app/Http/Controllers/AppreciationController.php b/Modules/Admin/app/Http/Controllers/AppreciationController.php new file mode 100644 index 0000000..e300b18 --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/AppreciationController.php @@ -0,0 +1,85 @@ +appreciationRepository = $appreciationRepository; + } + /** + * Display a listing of the resource. + */ + public function index() + { + $data['title'] = "Appreciation Lists"; + $data['appreciationLists'] = $this->appreciationRepository->findAll(); + return view('admin::appreciations.index', $data); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + $data['title'] = "Create Appreciation"; + $data['editable'] = false; + return view('admin::appreciations.create', $data); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): RedirectResponse + { + $this->appreciationRepository->create($request->all()); + toastr()->success('Appreciation Created Successfully.'); + return redirect()->route('appreciation.index'); + } + + /** + * Show the specified resource. + */ + public function show($id) + { + return view('admin::appreciations.show'); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id) + { + $data['title'] = "Edit Appreciation"; + $data['editable'] = true; + $data['appreciation'] = $this->appreciationRepository->getAppreciationById($id); + return view('admin::appreciations.edit', $data); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, $id): RedirectResponse + { + $this->appreciationRepository->update($id, $request->all()); + toastr()->success('Appreciation Updated Successfully.'); + return redirect()->route('appreciation.index'); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy($id) + { + // + } +} diff --git a/Modules/Admin/app/Http/Controllers/DepartmentsController.php b/Modules/Admin/app/Http/Controllers/DepartmentsController.php index f1caca3..b30308b 100644 --- a/Modules/Admin/app/Http/Controllers/DepartmentsController.php +++ b/Modules/Admin/app/Http/Controllers/DepartmentsController.php @@ -22,7 +22,7 @@ class DepartmentsController extends Controller $data = Departments::where('status', '<>', -1)->orderBy('display_order')->get(); - return view("admin.departments.index", compact('data')); + return view("admin::departments.index", compact('data')); } public function create(Request $request) @@ -30,7 +30,7 @@ class DepartmentsController extends Controller $TableData = Departments::where('status', '<>', -1)->orderBy('display_order')->get(); $editable = false; - return view("admin.departments.edit", compact('TableData', 'editable')); + return view("admin::departments.edit", compact('TableData', 'editable')); } public function store(Request $request) @@ -107,7 +107,7 @@ class DepartmentsController extends Controller $data = Departments::findOrFail($id); - return view("admin.departments.show", compact('data')); + return view("admin::departments.show", compact('data')); } @@ -117,7 +117,7 @@ class DepartmentsController extends Controller $TableData = Departments::where('status', '<>', -1)->orderBy('display_order')->get(); $data = Departments::findOrFail($id); $editable = true; - return view("admin.departments.edit", compact('data', 'TableData', 'editable')); + return view("admin::departments.edit", compact('data', 'TableData', 'editable')); } diff --git a/Modules/Admin/app/Http/Controllers/PromotionDemotionController.php b/Modules/Admin/app/Http/Controllers/PromotionDemotionController.php new file mode 100644 index 0000000..cd9686c --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/PromotionDemotionController.php @@ -0,0 +1,87 @@ +promotionDemotionRepository = $promotionDemotionRepository; + } + /** + * Display a listing of the resource. + */ + + public function index() + { + $data['title'] = "Promotion/ Demotion Lists"; + $data['promotionDemotionLists'] = $this->promotionDemotionRepository->findAll(); + return view('admin::promotiondemotions.index', $data); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + $data['editable'] = false; + $data['title'] = "Create Promotion/ Demotion"; + return view('admin::promotiondemotions.create', $data); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): RedirectResponse + { + $this->promotionDemotionRepository->create($request->all()); + toastr()->success('Promotion/ Demotion Created Successfully'); + return redirect()->route('promotionDemotion.index'); + } + + /** + * Show the specified resource. + */ + public function show($id) + { + return view('admin::promotiondemotions.show'); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id) + { + $data['editable'] = false; + $data['title'] = "Edit Promotion/ Demotion"; + $data['promotionDemotion'] = $this->promotionDemotionRepository->getPromotionDemotionById($id); + return view('admin::promotiondemotions.edit', $data); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, $id): RedirectResponse + { + $this->promotionDemotionRepository->update($id, $request->all()); + toastr()->success('Promotion/ Demotion Updated Successfully'); + return redirect()->route('promotionDemotion.index'); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy($id) + { + $this->promotionDemotionRepository->delete($id); + toastr()->success('Promotion/ Demotion Deleted Successfully'); + return redirect()->route('promotionDemotion.index'); + } +} diff --git a/Modules/Admin/app/Http/Controllers/ResignationController.php b/Modules/Admin/app/Http/Controllers/ResignationController.php new file mode 100644 index 0000000..ced589b --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/ResignationController.php @@ -0,0 +1,83 @@ +resignationRepository = $resignationRepository; + } + /** + * Display a listing of the resource. + */ + public function index() + { + $data['title'] = 'Resignation List'; + $data['resignationLists'] = $this->resignationRepository->findAll(); + return view('admin::resignations.index', $data); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + $data['title'] = 'Create Resignation'; + $data['editable'] = false; + return view('admin::resignations.create', $data); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): RedirectResponse + { + $this->resignationRepository->create($request->all()); + return redirect()->route('resignation.index'); + } + + /** + * Show the specified resource. + */ + public function show($id) + { + return view('admin::resignations.show'); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id) + { + $data['title'] = 'Edit Resignation'; + $data['editable'] = true; + $data['resignation'] = $this->resignationRepository->getResignationById($id); + return view('admin::resignations.edit', $data); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, $id): RedirectResponse + { + $this->resignationRepository->update($id, $request->all()); + return redirect()->route('resignation.index'); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy($id) + { + // + } +} diff --git a/Modules/Admin/app/Models/Appreciation.php b/Modules/Admin/app/Models/Appreciation.php new file mode 100644 index 0000000..23d2fae --- /dev/null +++ b/Modules/Admin/app/Models/Appreciation.php @@ -0,0 +1,30 @@ +update($newDetails); + } + +} diff --git a/Modules/Admin/app/Repositories/PromotionDemotionInterface.php b/Modules/Admin/app/Repositories/PromotionDemotionInterface.php new file mode 100644 index 0000000..e6781f6 --- /dev/null +++ b/Modules/Admin/app/Repositories/PromotionDemotionInterface.php @@ -0,0 +1,12 @@ +update($newDetails); + } + +} diff --git a/Modules/Admin/app/Repositories/ResignationInterface.php b/Modules/Admin/app/Repositories/ResignationInterface.php new file mode 100644 index 0000000..1e806e8 --- /dev/null +++ b/Modules/Admin/app/Repositories/ResignationInterface.php @@ -0,0 +1,12 @@ +update($newDetails); + } + +} diff --git a/Modules/Admin/database/migrations/2024_04_14_080050_create_promotion_demotions_table.php b/Modules/Admin/database/migrations/2024_04_14_080050_create_promotion_demotions_table.php new file mode 100644 index 0000000..4b535ae --- /dev/null +++ b/Modules/Admin/database/migrations/2024_04_14_080050_create_promotion_demotions_table.php @@ -0,0 +1,38 @@ +tinyInteger('promotion_demotion_id')->unsigned()->autoIncrement(); + $table->string('title')->nullable(); + $table->string('alias')->nullable(); + $table->unsignedBigInteger('employee_id')->nullable(); + $table->unsignedBigInteger('old_designation_id')->nullable(); + $table->unsignedBigInteger('new_designation_id')->nullable(); + $table->unsignedBigInteger('type')->nullable(); + $table->unsignedBigInteger('status')->nullable(); + $table->date('date')->nullable(); + $table->mediumText('description')->nullable(); + $table->mediumText('remarks')->nullable(); + $table->unsignedBigInteger('createdBy')->nullable(); + $table->unsignedBigInteger('updatedBy')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tbl_promotion_demotions'); + } +}; diff --git a/Modules/Admin/database/migrations/2024_04_14_105508_create_appreciations_table.php b/Modules/Admin/database/migrations/2024_04_14_105508_create_appreciations_table.php new file mode 100644 index 0000000..b1420df --- /dev/null +++ b/Modules/Admin/database/migrations/2024_04_14_105508_create_appreciations_table.php @@ -0,0 +1,37 @@ +tinyInteger('appreciation_id')->unsigned()->autoIncrement(); + $table->string('title')->nullable(); + $table->string('alias')->nullable(); + $table->string('type')->nullable(); + $table->unsignedBigInteger('employee_id')->nullable(); + $table->unsignedBigInteger('appreciated_by')->nullable(); + $table->date('appreciated_date')->nullable(); + $table->unsignedBigInteger('status')->nullable(); + $table->mediumText('description')->nullable(); + $table->mediumText('remarks')->nullable(); + $table->unsignedBigInteger('createdBy')->nullable(); + $table->unsignedBigInteger('updatedBy')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tbl_appreciations'); + } +}; diff --git a/Modules/Admin/database/migrations/2024_04_14_115955_create_resignations_table.php b/Modules/Admin/database/migrations/2024_04_14_115955_create_resignations_table.php new file mode 100644 index 0000000..468722c --- /dev/null +++ b/Modules/Admin/database/migrations/2024_04_14_115955_create_resignations_table.php @@ -0,0 +1,35 @@ +tinyInteger('resignation_id')->unsigned()->autoIncrement(); + $table->unsignedBigInteger('employee_id')->nullable(); + $table->date('resignation_date')->nullable(); + $table->date('approved_date')->nullable(); + $table->unsignedBigInteger('approved_by')->nullable(); + $table->mediumText('description')->nullable(); + $table->mediumText('remarks')->nullable(); + $table->unsignedBigInteger('status')->nullable(); + $table->unsignedBigInteger('createdBy')->nullable(); + $table->unsignedBigInteger('updatedBy')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tbl_resignations'); + } +}; diff --git a/Modules/Admin/resources/views/appreciations/create.blade.php b/Modules/Admin/resources/views/appreciations/create.blade.php new file mode 100644 index 0000000..d4fea08 --- /dev/null +++ b/Modules/Admin/resources/views/appreciations/create.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+
+ + {{ html()->form('POST')->route('appreciation.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }} + + @include('admin::partials.appreciations.action') + + {{ html()->form()->close() }} + +
+
+
+ @endsection diff --git a/Modules/Admin/resources/views/appreciations/edit.blade.php b/Modules/Admin/resources/views/appreciations/edit.blade.php new file mode 100644 index 0000000..e46e4eb --- /dev/null +++ b/Modules/Admin/resources/views/appreciations/edit.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+
+ + {{ html()->modelForm($appreciation, 'PUT')->route('appreciation.update', $appreciation->appreciation_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }} + + @include('admin::partials.appreciations.action') + + {{ html()->form()->close() }} + +
+
+
+ @endsection diff --git a/Modules/Admin/resources/views/appreciations/index.blade.php b/Modules/Admin/resources/views/appreciations/index.blade.php new file mode 100644 index 0000000..dcb04d1 --- /dev/null +++ b/Modules/Admin/resources/views/appreciations/index.blade.php @@ -0,0 +1,75 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+
+
{{ $title }}
+ +
+
+ + + + + + + + + + + + + + @foreach ($appreciationLists as $index => $item) + + + + + + + + + @endforeach + +
S.NEmployeeAppreciated TypeAppreciated ByAppreciated DateAction +
{{ $index + 1 }}{{ $item->employee_id }}{{ $item->type }}{{ $item->appreciated_by }}{{ $item->appreciated_date }} + +
+
+
+
+
+@endsection diff --git a/Modules/Admin/resources/views/appreciations/show.blade.php b/Modules/Admin/resources/views/appreciations/show.blade.php new file mode 100644 index 0000000..9ed0171 --- /dev/null +++ b/Modules/Admin/resources/views/appreciations/show.blade.php @@ -0,0 +1,48 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+
+
View Detail
+ +
+ +
+

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 diff --git a/Modules/Admin/resources/views/cities/show.blade.php b/Modules/Admin/resources/views/cities/show.blade.php index daa489e..180f50c 100644 --- a/Modules/Admin/resources/views/cities/show.blade.php +++ b/Modules/Admin/resources/views/cities/show.blade.php @@ -1,15 +1,14 @@ @extends('layouts.app') @section('content')
-
-

- - +
+
View Detail
+
- - -

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

Title :     {{ $data->title }}

Alias :     {{ $data->alias }}

diff --git a/resources/views/crud/generated/departments/edit.blade.php b/Modules/Admin/resources/views/departments/edit.blade.php similarity index 99% rename from resources/views/crud/generated/departments/edit.blade.php rename to Modules/Admin/resources/views/departments/edit.blade.php index 20ba723..1e986ef 100644 --- a/resources/views/crud/generated/departments/edit.blade.php +++ b/Modules/Admin/resources/views/departments/edit.blade.php @@ -14,7 +14,7 @@
- + @csrf diff --git a/resources/views/crud/generated/departments/index.blade.php b/Modules/Admin/resources/views/departments/index.blade.php similarity index 100% rename from resources/views/crud/generated/departments/index.blade.php rename to Modules/Admin/resources/views/departments/index.blade.php diff --git a/resources/views/crud/generated/departments/show.blade.php b/Modules/Admin/resources/views/departments/show.blade.php similarity index 83% rename from resources/views/crud/generated/departments/show.blade.php rename to Modules/Admin/resources/views/departments/show.blade.php index e8839d0..af57c99 100644 --- a/resources/views/crud/generated/departments/show.blade.php +++ b/Modules/Admin/resources/views/departments/show.blade.php @@ -9,10 +9,12 @@
-
-

- - +
+
View Detail
+

Title :     {{ $data->title }}

diff --git a/resources/views/crud/generated/designations/edit.blade.php b/Modules/Admin/resources/views/designations/edit.blade.php similarity index 100% rename from resources/views/crud/generated/designations/edit.blade.php rename to Modules/Admin/resources/views/designations/edit.blade.php diff --git a/resources/views/crud/generated/designations/index.blade.php b/Modules/Admin/resources/views/designations/index.blade.php similarity index 100% rename from resources/views/crud/generated/designations/index.blade.php rename to Modules/Admin/resources/views/designations/index.blade.php diff --git a/Modules/Admin/resources/views/designations/show.blade.php b/Modules/Admin/resources/views/designations/show.blade.php new file mode 100644 index 0000000..eedfcf4 --- /dev/null +++ b/Modules/Admin/resources/views/designations/show.blade.php @@ -0,0 +1,48 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => 'Designation']) + + + +
+
+
View Detail
+ +
+ +
+

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 diff --git a/Modules/Admin/resources/views/index.blade.php b/Modules/Admin/resources/views/index.blade.php index d785078..b8a01c5 100644 --- a/Modules/Admin/resources/views/index.blade.php +++ b/Modules/Admin/resources/views/index.blade.php @@ -1,7 +1,7 @@ @extends('admin::layouts.master') @section('content') -

Hello World

+

Hello World

-

Module: {!! config('admin.name') !!}

+

Module: {!! config('admin.name') !!}

@endsection diff --git a/Modules/Admin/resources/views/partials/appreciations/action.blade.php b/Modules/Admin/resources/views/partials/appreciations/action.blade.php new file mode 100644 index 0000000..5856de5 --- /dev/null +++ b/Modules/Admin/resources/views/partials/appreciations/action.blade.php @@ -0,0 +1,43 @@ +
+ +
+ {{ html()->label('Title')->class('form-label') }} + {{ html()->text('title')->class('form-control')->placeholder('Enter Title') }} +
+ +
+ {{ html()->label('Appreciation Type')->class('form-label') }} + {{ html()->select('type', [1 => 'Employee of the Month', 2 => 'Best Manger'])->class('form-select')->placeholder('Select Type') }} +
+ +
+ {{ html()->label('Employee')->class('form-label') }} + {{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }} +
+ + +
+ {{ html()->label('Appreciated By')->class('form-label') }} + {{ html()->select('appreciated_by')->class('form-select')->placeholder('Select Who Appreciated') }} +
+ + +
+ {{ html()->label('Appreciated Date')->class('form-label') }} + {{ html()->date('appreciated_date')->class('form-control')->placeholder('Select Date') }} +
+ +
+ {{ html()->label('Description')->class('form-label') }} + {{ html()->textarea('description')->class('form-control')->attributes(['rows' => 5]) }} +
+ +
+ {{ html()->label('Remarks')->class('form-label') }} + {{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 5]) }} +
+ +
+ {{ html()->button($editable ? 'Update' : 'Add Appreciation', 'submit')->class('btn btn-success') }} +
+
diff --git a/Modules/Admin/resources/views/partials/promotiondemotions/action.blade.php b/Modules/Admin/resources/views/partials/promotiondemotions/action.blade.php new file mode 100644 index 0000000..04f6eaa --- /dev/null +++ b/Modules/Admin/resources/views/partials/promotiondemotions/action.blade.php @@ -0,0 +1,46 @@ +
+ +
+ {{ html()->label('Title')->class('form-label') }} + {{ html()->text('title')->class('form-control')->placeholder('Enter Title') }} +
+ +
+ {{ html()->label('Type')->class('form-label') }} + {{ html()->select('type', [1 => 'Promotion', 2 => 'Demotion'])->class('form-select')->placeholder('Select Type') }} +
+ +
+ {{ html()->label('Employee')->class('form-label') }} + {{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }} +
+ +
+ {{ html()->label('Previous Designation')->class('form-label') }} + {{ html()->select('old_designation_id')->class('form-select')->placeholder('Select Previous Desgination') }} +
+ +
+ {{ html()->label('New Designation')->class('form-label') }} + {{ html()->select('new_designation_id')->class('form-select')->placeholder('Select New Desgination') }} +
+ +
+ {{ html()->label('Date')->class('form-label') }} + {{ html()->date('date')->class('form-control')->placeholder('Select Date') }} +
+ +
+ {{ html()->label('Description')->class('form-label') }} + {{ html()->textarea('description')->class('form-control')->attributes(['rows' => 5]) }} +
+ +
+ {{ html()->label('Remarks')->class('form-label') }} + {{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 5]) }} +
+ +
+ {{ html()->button($editable ? 'Update' : 'Add Promotion/ Demotion', 'submit')->class('btn btn-success') }} +
+
diff --git a/Modules/Admin/resources/views/partials/resignations/action.blade.php b/Modules/Admin/resources/views/partials/resignations/action.blade.php new file mode 100644 index 0000000..ea13f8c --- /dev/null +++ b/Modules/Admin/resources/views/partials/resignations/action.blade.php @@ -0,0 +1,26 @@ +
+ +
+ {{ html()->label('Employee')->class('form-label') }} + {{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }} +
+ +
+ {{ html()->label('Resignation Date')->class('form-label') }} + {{ html()->date('resignation_date')->class('form-control')->placeholder('Select Resignation Date') }} +
+ +
+ {{ html()->label('Reason')->class('form-label') }} + {{ html()->textarea('description')->class('form-control')->placeholder('Write reason for resgination')->attributes(['rows' => 3]) }} +
+ +
+ {{ html()->label('Remarks')->class('form-label') }} + {{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 3]) }} +
+ +
+ {{ html()->button($editable ? 'Update' : 'Add Resignation', 'submit')->class('btn btn-success') }} +
+
diff --git a/Modules/Admin/resources/views/promotiondemotions/create.blade.php b/Modules/Admin/resources/views/promotiondemotions/create.blade.php new file mode 100644 index 0000000..f2830ce --- /dev/null +++ b/Modules/Admin/resources/views/promotiondemotions/create.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+
+ + {{ html()->form('POST')->route('promotionDemotion.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }} + + @include('admin::partials.promotiondemotions.action') + + {{ html()->form()->close() }} + +
+
+
+ @endsection diff --git a/Modules/Admin/resources/views/promotiondemotions/edit.blade.php b/Modules/Admin/resources/views/promotiondemotions/edit.blade.php new file mode 100644 index 0000000..0f6e93c --- /dev/null +++ b/Modules/Admin/resources/views/promotiondemotions/edit.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+
+ + {{ html()->modelForm($promotionDemotion, 'PUT')->route('promotionDemotion.update', $promotionDemotion->promotion_demotion_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }} + + @include('admin::partials.promotiondemotions.action') + + {{ html()->form()->close() }} + +
+
+
+ @endsection diff --git a/Modules/Admin/resources/views/promotiondemotions/index.blade.php b/Modules/Admin/resources/views/promotiondemotions/index.blade.php new file mode 100644 index 0000000..0868558 --- /dev/null +++ b/Modules/Admin/resources/views/promotiondemotions/index.blade.php @@ -0,0 +1,75 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => 'Promotion/ Demotion']) + + + +
+
+
Promotion/ Demotion Lists
+ +
+
+ + + + + + + + + + + + + + @foreach ($promotionDemotionLists as $index => $item) + + + + + + + + + @endforeach + +
S.NTitleEmployeePrevious DesignationNew DesignationAction +
{{ $index + 1 }}{{ $item->title }}{{ $item->employee_id }}{{ $item->old_promotion_demotion_id }}{{ $item->new_promotion_demotion_id }} + +
+
+
+
+
+@endsection diff --git a/Modules/Admin/resources/views/promotiondemotions/show.blade.php b/Modules/Admin/resources/views/promotiondemotions/show.blade.php new file mode 100644 index 0000000..9ed0171 --- /dev/null +++ b/Modules/Admin/resources/views/promotiondemotions/show.blade.php @@ -0,0 +1,48 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+
+
View Detail
+ +
+ +
+

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 diff --git a/Modules/Admin/resources/views/resignations/create.blade.php b/Modules/Admin/resources/views/resignations/create.blade.php new file mode 100644 index 0000000..ee2e67e --- /dev/null +++ b/Modules/Admin/resources/views/resignations/create.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+
+ + {{ html()->form('POST')->route('resignation.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }} + + @include('admin::partials.resignations.action') + + {{ html()->form()->close() }} + +
+
+
+ @endsection diff --git a/Modules/Admin/resources/views/resignations/edit.blade.php b/Modules/Admin/resources/views/resignations/edit.blade.php new file mode 100644 index 0000000..b09d27d --- /dev/null +++ b/Modules/Admin/resources/views/resignations/edit.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+
+ + {{ html()->modelForm($resignation, 'PUT')->route('resignation.update', $resignation->resignation_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }} + + @include('admin::partials.resignations.action') + + {{ html()->form()->close() }} + +
+
+
+ @endsection diff --git a/Modules/Admin/resources/views/resignations/index.blade.php b/Modules/Admin/resources/views/resignations/index.blade.php new file mode 100644 index 0000000..47d2b40 --- /dev/null +++ b/Modules/Admin/resources/views/resignations/index.blade.php @@ -0,0 +1,77 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+
+
{{ $title }}
+ +
+
+ + + + + + + + + + + + + + + @foreach ($resignationLists as $index => $item) + + + + + + + + + + @endforeach + +
S.NEmployeeResignation DateApproved DateApproved ByStatusAction +
{{ $index + 1 }}{{ $item->employee_id }}{{ $item->resignation_date }}{{ $item->approved_date }}{{ $item->approved_by }}{{ $item->status }} + +
+
+
+
+
+@endsection diff --git a/Modules/Admin/resources/views/resignations/show.blade.php b/Modules/Admin/resources/views/resignations/show.blade.php new file mode 100644 index 0000000..9ed0171 --- /dev/null +++ b/Modules/Admin/resources/views/resignations/show.blade.php @@ -0,0 +1,48 @@ +@extends('layouts.app') +@section('content') +
+
+ + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
+
+
View Detail
+ +
+ +
+

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 diff --git a/Modules/Admin/routes/web.php b/Modules/Admin/routes/web.php index 07ae53b..a84cbee 100644 --- a/Modules/Admin/routes/web.php +++ b/Modules/Admin/routes/web.php @@ -2,6 +2,9 @@ use Illuminate\Support\Facades\Route; use Modules\Admin\Http\Controllers\AdminController; +use Modules\Admin\Http\Controllers\AppreciationController; +use Modules\Admin\Http\Controllers\PromotionDemotionController; +use Modules\Admin\Http\Controllers\ResignationController; /* |-------------------------------------------------------------------------- @@ -16,6 +19,9 @@ use Modules\Admin\Http\Controllers\AdminController; Route::group([], function () { Route::resource('admin', AdminController::class)->names('admin'); + Route::resource('promotion-demotion', PromotionDemotionController::class)->names('promotionDemotion'); + Route::resource('appreciation', AppreciationController::class)->names('appreciation'); + Route::resource('resignation', ResignationController::class)->names('resignation'); }); require __DIR__ . '/route.countries.php'; diff --git a/Modules/Employee/database/migrations/2024_04_07_093523_create_employees_table.php b/Modules/Employee/database/migrations/2024_04_07_093523_create_employees_table.php index 527270e..e015bc6 100644 --- a/Modules/Employee/database/migrations/2024_04_07_093523_create_employees_table.php +++ b/Modules/Employee/database/migrations/2024_04_07_093523_create_employees_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class extends Migration { /** * Run the migrations. */ @@ -43,6 +42,6 @@ return new class extends Migration */ public function down(): void { - Schema::dropIfExists('employees'); + Schema::dropIfExists('tbl_employees'); } }; diff --git a/Modules/Leave/app/Http/Controllers/LeaveController.php b/Modules/Leave/app/Http/Controllers/LeaveController.php index 5d3b68b..a03c75f 100644 --- a/Modules/Leave/app/Http/Controllers/LeaveController.php +++ b/Modules/Leave/app/Http/Controllers/LeaveController.php @@ -5,19 +5,22 @@ namespace Modules\Leave\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; -use Modules\Employee\Repositories\EmployeeInterface; -use Modules\Leave\Repositories\LeaveInterface; +use Modules\Employee\Repositories\EmployeeRepository; +use Modules\Leave\Repositories\LeaveRepository; +use Modules\Leave\Repositories\LeaveTypeRepository; use Yoeunes\Toastr\Facades\Toastr; class LeaveController extends Controller { private $leaveRepository; private $employeeRepository; + private $leaveTypeRepository; - public function __construct(LeaveInterface $leaveRepository, EmployeeInterface $employeeRepository) + public function __construct(LeaveRepository $leaveRepository, EmployeeRepository $employeeRepository, LeaveTypeRepository $leaveTypeRepository) { $this->leaveRepository = $leaveRepository; $this->employeeRepository = $employeeRepository; + $this->leaveTypeRepository = $leaveTypeRepository; $this->middleware('role_or_permission:access leaves|create leaves|edit leaves|delete leaves', ['only' => ['index', 'show']]); $this->middleware('role_or_permission:create leaves', ['only' => ['create', 'store']]); @@ -42,7 +45,9 @@ class LeaveController extends Controller public function create() { $data['title'] = 'Create Leave'; + $data['editable'] = false; $data['employeeList'] = $this->employeeRepository->pluck(); + $data['leaveTypeList'] = $this->leaveTypeRepository->pluck(); return view('leave::leave.create', $data); } @@ -76,6 +81,8 @@ class LeaveController extends Controller { $data['title'] = 'Edit Leave'; + $data['editable'] = true; + $data['leave'] = $this->leaveRepository->getLeaveById($id); return view('leave::leave.edit', $data); diff --git a/Modules/Leave/app/Http/Controllers/LeaveTypeController.php b/Modules/Leave/app/Http/Controllers/LeaveTypeController.php index f07bace..f70508a 100644 --- a/Modules/Leave/app/Http/Controllers/LeaveTypeController.php +++ b/Modules/Leave/app/Http/Controllers/LeaveTypeController.php @@ -5,18 +5,14 @@ namespace Modules\Leave\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; -use Modules\Leave\Repositories\LeaveInterface; use Modules\Leave\Repositories\LeaveTypeInterface; class LeaveTypeController extends Controller { - - private $leaveRepository; private $leaveTypeRepository; - public function __construct(LeaveInterface $leaveRepository, LeaveTypeInterface $leaveTypeRepository) + public function __construct(LeaveTypeInterface $leaveTypeRepository) { - $this->leaveRepository = $leaveRepository; $this->leaveTypeRepository = $leaveTypeRepository; } /** @@ -24,7 +20,8 @@ class LeaveTypeController extends Controller */ public function index() { - $data['leaveTypes'] = $this->leaveTypeRepository->findAll(); + $data['title'] = 'LeaveType List'; + $data['leaveTypeLists'] = $this->leaveTypeRepository->findAll(); return view('leave::leave-type.index', $data); } @@ -33,7 +30,9 @@ class LeaveTypeController extends Controller */ public function create() { - $data['title'] = 'Create Leave Type'; + $data['title'] = 'Create LeaveType'; + + $data['editable'] = false; return view('leave::leave-type.create', $data); } @@ -43,7 +42,12 @@ class LeaveTypeController extends Controller */ public function store(Request $request): RedirectResponse { - // + try { + $this->leaveTypeRepository->create($request->all()); + return redirect()->route('leaveType.index')->with('success', 'Leave Type Created Successfully'); + } catch (\Throwable $th) { + throw $th; + } } /** @@ -59,7 +63,11 @@ class LeaveTypeController extends Controller */ public function edit($id) { - return view('leave::leave-type.edit'); + $data['editable'] = false; + + $data['title'] = 'Edit LeaveType'; + + return view('leave::leave-type.edit', $data); } /** diff --git a/Modules/Leave/app/Models/LeaveType.php b/Modules/Leave/app/Models/LeaveType.php index b69a90e..1e94fa8 100644 --- a/Modules/Leave/app/Models/LeaveType.php +++ b/Modules/Leave/app/Models/LeaveType.php @@ -4,19 +4,12 @@ namespace Modules\Leave\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; -use Modules\Leave\Database\factories\LeaveTypeFactory; class LeaveType extends Model { use HasFactory; - /** - * The attributes that are mass assignable. - */ - protected $fillable = []; - - protected static function newFactory(): LeaveTypeFactory - { - //return LeaveTypeFactory::new(); - } + protected $table = 'tbl_leave_types'; + protected $primaryKey = 'leave_type_id'; + protected $guarded = []; } diff --git a/Modules/Leave/app/Repositories/LeaveTypeInterface.php b/Modules/Leave/app/Repositories/LeaveTypeInterface.php index 870e937..c42d412 100644 --- a/Modules/Leave/app/Repositories/LeaveTypeInterface.php +++ b/Modules/Leave/app/Repositories/LeaveTypeInterface.php @@ -4,9 +4,10 @@ namespace Modules\Leave\Repositories; interface LeaveTypeInterface { + public function pluck(); public function findAll(); - public function getLeaveById($leaveId); - public function delete($leaveId); - public function create(array $LeaveDetails); - public function update($leaveId, array $newDetails); + public function getLeaveTypeById($leaveTypeId); + public function delete($leaveTypeId); + public function create(array $LeaveTypeDetails); + public function update($leaveTypeId, array $newDetails); } diff --git a/Modules/Leave/app/Repositories/LeaveTypeRepository.php b/Modules/Leave/app/Repositories/LeaveTypeRepository.php index 1fadc1f..fabcdc6 100644 --- a/Modules/Leave/app/Repositories/LeaveTypeRepository.php +++ b/Modules/Leave/app/Repositories/LeaveTypeRepository.php @@ -6,29 +6,33 @@ use Modules\Leave\Models\LeaveType; class LeaveTypeRepository implements LeaveTypeInterface { + public function pluck() + { + return LeaveType::pluck('title', 'leave_type_id'); + } public function findAll() { return LeaveType::get(); } - public function getLeaveById($leaveId) + public function getLeaveTypeById($leaveTypeId) { - return LeaveType::findOrFail($leaveId); + return LeaveType::findOrFail($leaveTypeId); } - public function delete($leaveId) + public function delete($leaveTypeId) { - LeaveType::destroy($leaveId); + LeaveType::destroy($leaveTypeId); } - public function create(array $leaveDetails) + public function create(array $leaveTypeDetails) { - return LeaveType::create($leaveDetails); + return LeaveType::create($leaveTypeDetails); } - public function update($leaveId, array $newDetails) + public function update($leaveTypeId, array $newDetails) { - return LeaveType::where('leave_id', $leaveId)->update($newDetails); + return LeaveType::where('leave_type_id', $leaveTypeId)->update($newDetails); } } diff --git a/Modules/Leave/database/migrations/2024_04_04_102430_create_leaves_table.php b/Modules/Leave/database/migrations/2024_04_04_102430_create_leaves_table.php index 9c2834b..c91d567 100644 --- a/Modules/Leave/database/migrations/2024_04_04_102430_create_leaves_table.php +++ b/Modules/Leave/database/migrations/2024_04_04_102430_create_leaves_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class extends Migration { /** * Run the migrations. */ @@ -17,6 +16,12 @@ return new class extends Migration $table->unsignedBigInteger('leave_type_id'); $table->date('start_date')->nullable(); $table->date('end_date')->nullable(); + $table->date('leave_approved_date')->nullable(); + $table->Integer('total_days')->nullable(); + $table->unsignedBigInteger('leave_approved_by')->nullable(); + $table->Integer('status')->nullable(); + $table->longtext('description')->nullable(); + $table->text('remarks')->nullable(); $table->timestamps(); }); } diff --git a/Modules/Leave/resources/views/leave-type/create.blade.php b/Modules/Leave/resources/views/leave-type/create.blade.php index 8fab614..43872b5 100644 --- a/Modules/Leave/resources/views/leave-type/create.blade.php +++ b/Modules/Leave/resources/views/leave-type/create.blade.php @@ -7,12 +7,12 @@ @include('layouts.partials.breadcrumb', ['title' => $title])
-
+
@csrf - @include('leave::leave.partials.action') + @include('leave::leave-type.partials.action')
diff --git a/Modules/Leave/resources/views/leave-type/edit.blade.php b/Modules/Leave/resources/views/leave-type/edit.blade.php index a780d69..154b133 100644 --- a/Modules/Leave/resources/views/leave-type/edit.blade.php +++ b/Modules/Leave/resources/views/leave-type/edit.blade.php @@ -27,7 +27,7 @@ {{ html()->modelForm($leave, 'PUT')->route('leave.update', $leave->id)->class(['needs-validation'])->attributes(['novalidate'])->open() }} - @include('leave::leave.partials.action') + @include('leave::leave-type.partials.action') {{ html()->closeModelForm() }} diff --git a/Modules/Leave/resources/views/leave-type/index.blade.php b/Modules/Leave/resources/views/leave-type/index.blade.php index ff62f20..721fc2a 100644 --- a/Modules/Leave/resources/views/leave-type/index.blade.php +++ b/Modules/Leave/resources/views/leave-type/index.blade.php @@ -3,13 +3,15 @@ @section('content')
- + + @include('layouts.partials.breadcrumb', ['title' => $title]) +
-
Leave Lists
+
LeaveType Lists
Add @@ -22,19 +24,16 @@ S.N - Leave Type - Created By + Title Status Action - @forelse ($leaveTypes as $key => $leaveType) + @forelse ($leaveTypeLists as $key => $leaveType) {{ $key + 1 }} - {{ $leaveType->employee_id }} - {{ $leaveType->start_date }} - {{ $leaveType->end_date }} + {{ $leaveType->title }} {{ $leaveType->created_at }}
@@ -42,12 +41,12 @@ data-bs-target="#viewModal"> -
diff --git a/Modules/Leave/resources/views/leave-type/partials/action.blade.php b/Modules/Leave/resources/views/leave-type/partials/action.blade.php index 50e04e8..32c91cd 100644 --- a/Modules/Leave/resources/views/leave-type/partials/action.blade.php +++ b/Modules/Leave/resources/views/leave-type/partials/action.blade.php @@ -1,23 +1,12 @@ -
- - - {{ html()->select('employee_id', $employeeList)->class('form-select')->placeholder('Select Employee') }} -
- -
- - -
- -
- - +
+
+ {{ html()->label('Title')->class('form-label') }} + {{ html()->text('title')->class('form-control')->placeholder('Enter Leave Type') }} +
- +
@push('js') diff --git a/Modules/Leave/resources/views/leave-type/partials/view.blade.php b/Modules/Leave/resources/views/leave-type/partials/view.blade.php index 67a8c0e..e05efbb 100644 --- a/Modules/Leave/resources/views/leave-type/partials/view.blade.php +++ b/Modules/Leave/resources/views/leave-type/partials/view.blade.php @@ -6,7 +6,7 @@
- @include('leave::leave.partials.view') + {{-- @include('leave::leave.partials.view') --}} @endsection diff --git a/Modules/Leave/resources/views/leave/partials/action.blade.php b/Modules/Leave/resources/views/leave/partials/action.blade.php index a0c05f3..c01fa9a 100644 --- a/Modules/Leave/resources/views/leave/partials/action.blade.php +++ b/Modules/Leave/resources/views/leave/partials/action.blade.php @@ -1,22 +1,32 @@ -
+
+
+ {{ html()->label('Leave Type')->class('form-label') }} + {{ html()->select('leave_type_id', $leaveTypeList)->class('form-select')->placeholder('Select Leave Type') }} +
- -
+
+ {{ html()->label('Employee')->class('form-label') }} + {{ html()->select('employee_id', [1 => 'Deepak'])->class('form-select')->placeholder('Select Employee') }} +
-
- - -
+
+ {{ html()->label('Start Date')->class('form-label') }} + {{ html()->date('start_date')->class('form-control')->placeholder('Select Start Date') }} +
-
- - -
+
+ {{ html()->label('Start Date')->class('form-label') }} + {{ html()->date('end_date')->class('form-control')->placeholder('Select Start Date') }} +
-
- +
+ {{ html()->label('Description')->class('form-label') }} + {{ html()->textarea('description')->class('form-control')->placeholder('Write Reason for Leave') }} +
+ +
+ {{ html()->button($editable ? 'Update' : 'Add Leave', 'submit')->class('btn btn-success') }} +
@push('js') diff --git a/Modules/Leave/routes/web.php b/Modules/Leave/routes/web.php index c3d6b11..3a1e5b2 100644 --- a/Modules/Leave/routes/web.php +++ b/Modules/Leave/routes/web.php @@ -18,5 +18,4 @@ use Modules\Leave\Http\Controllers\LeaveTypeController; Route::group([], function () { Route::resource('leave', LeaveController::class)->names('leave'); Route::resource('leave-type', LeaveTypeController::class)->names('leaveType'); - }); diff --git a/app/Helpers/OMIS.php b/app/Helpers/OMIS.php index 751ade3..7e2bcf0 100644 --- a/app/Helpers/OMIS.php +++ b/app/Helpers/OMIS.php @@ -47,12 +47,13 @@ class OMIS $activeClass = $isActive ? 'active' : ''; ?>
  • - +
  • - -
    -

    - - -
    -
    - - - -

    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 diff --git a/resources/views/layouts/partials/sidebar.blade.php b/resources/views/layouts/partials/sidebar.blade.php index 23c4d6a..615e1e5 100644 --- a/resources/views/layouts/partials/sidebar.blade.php +++ b/resources/views/layouts/partials/sidebar.blade.php @@ -94,14 +94,15 @@
    @@ -124,6 +125,21 @@ class="nav-link @if (\Request::is('role') || \Request::is('role/*')) active @endif">Roles + + + + + + + + From d1851922eced3523ff738a70bb48942a3abbbef5 Mon Sep 17 00:00:00 2001 From: Dharma Date: Mon, 15 Apr 2024 18:01:31 +0545 Subject: [PATCH 4/4] complaint calendar transfer warning --- .../Http/Controllers/CalendarController.php | 67 + .../Http/Controllers/CompanyController.php | 2 +- .../Http/Controllers/ComplaintController.php | 4 +- .../app/Http/Controllers/EventController.php | 109 ++ .../Http/Controllers/HolidayController.php | 109 ++ .../Http/Controllers/TransferController.php | 4 +- .../Http/Controllers/WarningController.php | 4 +- Modules/Admin/app/Models/Company.php | 4 + Modules/Admin/app/Models/Event.php | 33 + Modules/Admin/app/Models/Holiday.php | 30 + .../Admin/app/Repositories/EventInterface.php | 12 + .../app/Repositories/EventRepository.php | 35 + .../app/Repositories/HolidayInterface.php | 12 + .../app/Repositories/HolidayRepository.php | 35 + ...24_04_15_073007_create_companies_table.php | 3 + .../2024_04_15_080927_create_events_table.php | 38 + ...024_04_15_080945_create_holidays_table.php | 34 + .../resources/views/calendars/index.blade.php | 1305 +++++++++++++++++ .../resources/views/events/create.blade.php | 23 + .../resources/views/events/edit.blade.php | 23 + .../resources/views/events/index.blade.php | 76 + .../resources/views/events/show.blade.php | 48 + .../resources/views/holidays/create.blade.php | 23 + .../resources/views/holidays/edit.blade.php | 23 + .../resources/views/holidays/index.blade.php | 71 + .../resources/views/holidays/show.blade.php | 48 + .../views/partials/companies/action.blade.php | 35 +- .../views/partials/events/action.blade.php | 50 + .../views/partials/holidays/action.blade.php | 29 + Modules/Admin/routes/web.php | 6 + public/assets/js/custom.js | 30 +- public/assets/libs/flatpickr/flatpickr.min.js | 2 +- resources/views/layouts/app.blade.php | 45 +- .../layouts/partials/breadcrumb.blade.php | 1 - .../views/layouts/partials/footer.blade.php | 2 +- .../views/layouts/partials/sidebar.blade.php | 17 + 36 files changed, 2332 insertions(+), 60 deletions(-) create mode 100644 Modules/Admin/app/Http/Controllers/CalendarController.php create mode 100644 Modules/Admin/app/Http/Controllers/EventController.php create mode 100644 Modules/Admin/app/Http/Controllers/HolidayController.php create mode 100644 Modules/Admin/app/Models/Event.php create mode 100644 Modules/Admin/app/Models/Holiday.php create mode 100644 Modules/Admin/app/Repositories/EventInterface.php create mode 100644 Modules/Admin/app/Repositories/EventRepository.php create mode 100644 Modules/Admin/app/Repositories/HolidayInterface.php create mode 100644 Modules/Admin/app/Repositories/HolidayRepository.php create mode 100644 Modules/Admin/database/migrations/2024_04_15_080927_create_events_table.php create mode 100644 Modules/Admin/database/migrations/2024_04_15_080945_create_holidays_table.php create mode 100644 Modules/Admin/resources/views/calendars/index.blade.php create mode 100644 Modules/Admin/resources/views/events/create.blade.php create mode 100644 Modules/Admin/resources/views/events/edit.blade.php create mode 100644 Modules/Admin/resources/views/events/index.blade.php create mode 100644 Modules/Admin/resources/views/events/show.blade.php create mode 100644 Modules/Admin/resources/views/holidays/create.blade.php create mode 100644 Modules/Admin/resources/views/holidays/edit.blade.php create mode 100644 Modules/Admin/resources/views/holidays/index.blade.php create mode 100644 Modules/Admin/resources/views/holidays/show.blade.php create mode 100644 Modules/Admin/resources/views/partials/events/action.blade.php create mode 100644 Modules/Admin/resources/views/partials/holidays/action.blade.php diff --git a/Modules/Admin/app/Http/Controllers/CalendarController.php b/Modules/Admin/app/Http/Controllers/CalendarController.php new file mode 100644 index 0000000..0adfae3 --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/CalendarController.php @@ -0,0 +1,67 @@ +adminService->pluckCompanyTypes(); return view('admin::companies.create', $data); diff --git a/Modules/Admin/app/Http/Controllers/ComplaintController.php b/Modules/Admin/app/Http/Controllers/ComplaintController.php index 979f3c7..304e180 100644 --- a/Modules/Admin/app/Http/Controllers/ComplaintController.php +++ b/Modules/Admin/app/Http/Controllers/ComplaintController.php @@ -31,7 +31,7 @@ class ComplaintController extends Controller */ public function create() { - $data['title'] = 'Create Complaints'; + $data['title'] = 'Create Complaint'; $data['editable'] = false; return view('admin::complaints.create', $data); } @@ -65,7 +65,7 @@ class ComplaintController extends Controller public function edit($id) { try { - $data['title'] = 'Edit Complaints'; + $data['title'] = 'Edit Complaint'; $data['editable'] = true; $data['complaint'] = $this->complaintRepository->getComplaintById($id); diff --git a/Modules/Admin/app/Http/Controllers/EventController.php b/Modules/Admin/app/Http/Controllers/EventController.php new file mode 100644 index 0000000..32f3d86 --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/EventController.php @@ -0,0 +1,109 @@ +eventRepository = $eventRepository; + } + /** + * Display a listing of the resource. + */ + public function index() + { + $data['title'] = 'Event Lists'; + $data['eventLists'] = $this->eventRepository->findAll(); + return view('admin::events.index', $data); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + $data['title'] = 'Create Event'; + $data['editable'] = false; + return view('admin::events.create', $data); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): RedirectResponse + { + try { + $this->eventRepository->create($request->all()); + toastr()->success('Event Created Successfully'); + + } catch (\Throwable $th) { + toastr()->error($th->getMessage()); + } + return redirect()->route('event.index'); + } + + /** + * Show the specified resource. + */ + public function show($id) + { + return view('admin::events.show'); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id) + { + try { + $data['title'] = 'Edit Event'; + $data['editable'] = true; + $data['event'] = $this->eventRepository->getEventById($id); + + } catch (\Throwable $th) { + toastr()->error($th->getMessage()); + } + + return view('admin::events.edit', $data); + + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, $id): RedirectResponse + { + try { + + $this->eventRepository->update($id, $request->all()); + toastr()->success('Event Updated Successfully'); + + } catch (\Throwable $th) { + toastr()->error($th->getMessage()); + } + return redirect()->route('event.index'); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy($id) + { + try { + $this->eventRepository->delete($id); + toastr()->success('Event Deleted Successfully'); + } catch (\Throwable $th) { + toastr()->error($th->getMessage()); + } + return redirect()->route('event.index'); + } +} diff --git a/Modules/Admin/app/Http/Controllers/HolidayController.php b/Modules/Admin/app/Http/Controllers/HolidayController.php new file mode 100644 index 0000000..1b5b694 --- /dev/null +++ b/Modules/Admin/app/Http/Controllers/HolidayController.php @@ -0,0 +1,109 @@ +holidayRepository = $holidayRepository; + } + /** + * Display a listing of the resource. + */ + public function index() + { + $data['title'] = 'Holiday Lists'; + $data['holidayLists'] = $this->holidayRepository->findAll(); + return view('admin::holidays.index', $data); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + $data['title'] = 'Create Holiday'; + $data['editable'] = false; + return view('admin::holidays.create', $data); + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request): RedirectResponse + { + try { + $this->holidayRepository->create($request->all()); + toastr()->success('Holiday Created Successfully'); + + } catch (\Throwable $th) { + toastr()->error($th->getMessage()); + } + return redirect()->route('holiday.index'); + } + + /** + * Show the specified resource. + */ + public function show($id) + { + return view('admin::holidays.show'); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id) + { + try { + $data['title'] = 'Edit Holiday'; + $data['editable'] = true; + $data['holiday'] = $this->holidayRepository->getHolidayById($id); + + } catch (\Throwable $th) { + toastr()->error($th->getMessage()); + } + + return view('admin::holidays.edit', $data); + + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, $id): RedirectResponse + { + try { + + $this->holidayRepository->update($id, $request->all()); + toastr()->success('Holiday Updated Successfully'); + + } catch (\Throwable $th) { + toastr()->error($th->getMessage()); + } + return redirect()->route('holiday.index'); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy($id) + { + try { + $this->holidayRepository->delete($id); + toastr()->success('Holiday Deleted Successfully'); + } catch (\Throwable $th) { + toastr()->error($th->getMessage()); + } + return redirect()->route('holiday.index'); + } +} diff --git a/Modules/Admin/app/Http/Controllers/TransferController.php b/Modules/Admin/app/Http/Controllers/TransferController.php index a86157a..59c746f 100644 --- a/Modules/Admin/app/Http/Controllers/TransferController.php +++ b/Modules/Admin/app/Http/Controllers/TransferController.php @@ -31,7 +31,7 @@ class TransferController extends Controller */ public function create() { - $data['title'] = 'Create Transfers'; + $data['title'] = 'Create Transfer'; $data['editable'] = false; return view('admin::transfers.create', $data); } @@ -65,7 +65,7 @@ class TransferController extends Controller public function edit($id) { try { - $data['title'] = 'Edit Transfers'; + $data['title'] = 'Edit Transfer'; $data['editable'] = true; $data['transfer'] = $this->transferRepository->getTransferById($id); diff --git a/Modules/Admin/app/Http/Controllers/WarningController.php b/Modules/Admin/app/Http/Controllers/WarningController.php index b4e55ef..12b68ac 100644 --- a/Modules/Admin/app/Http/Controllers/WarningController.php +++ b/Modules/Admin/app/Http/Controllers/WarningController.php @@ -31,7 +31,7 @@ class WarningController extends Controller */ public function create() { - $data['title'] = 'Create Warnings'; + $data['title'] = 'Create Warning'; $data['editable'] = false; return view('admin::warnings.create', $data); } @@ -65,7 +65,7 @@ class WarningController extends Controller public function edit($id) { try { - $data['title'] = 'Edit Warnings'; + $data['title'] = 'Edit Warning'; $data['editable'] = true; $data['warning'] = $this->warningRepository->getWarningById($id); diff --git a/Modules/Admin/app/Models/Company.php b/Modules/Admin/app/Models/Company.php index 64b2b69..91d1d2c 100644 --- a/Modules/Admin/app/Models/Company.php +++ b/Modules/Admin/app/Models/Company.php @@ -19,6 +19,10 @@ class Company extends Model 'title', 'alias', 'company_type_id', + 'address', + 'bank_name', + 'bank_acc_no', + 'bank_acc_branch', 'status', 'description', 'remarks', diff --git a/Modules/Admin/app/Models/Event.php b/Modules/Admin/app/Models/Event.php new file mode 100644 index 0000000..ebc6afa --- /dev/null +++ b/Modules/Admin/app/Models/Event.php @@ -0,0 +1,33 @@ +update($newDetails); + } + +} diff --git a/Modules/Admin/app/Repositories/HolidayInterface.php b/Modules/Admin/app/Repositories/HolidayInterface.php new file mode 100644 index 0000000..c41dd21 --- /dev/null +++ b/Modules/Admin/app/Repositories/HolidayInterface.php @@ -0,0 +1,12 @@ +update($newDetails); + } + +} diff --git a/Modules/Admin/database/migrations/2024_04_15_073007_create_companies_table.php b/Modules/Admin/database/migrations/2024_04_15_073007_create_companies_table.php index 52b9f78..12dcf05 100644 --- a/Modules/Admin/database/migrations/2024_04_15_073007_create_companies_table.php +++ b/Modules/Admin/database/migrations/2024_04_15_073007_create_companies_table.php @@ -18,6 +18,9 @@ return new class extends Migration { $table->integer('status')->nullable(); $table->mediumText('description')->nullable(); $table->mediumText('remarks')->nullable(); + $table->string('bank_name')->nullable(); + $table->string('bank_acc_no')->nullable(); + $table->string('bank_acc_branch')->nullable(); $table->unsignedBigInteger('createdBy')->nullable(); $table->unsignedBigInteger('updatedBy')->nullable(); $table->timestamps(); diff --git a/Modules/Admin/database/migrations/2024_04_15_080927_create_events_table.php b/Modules/Admin/database/migrations/2024_04_15_080927_create_events_table.php new file mode 100644 index 0000000..7d8041c --- /dev/null +++ b/Modules/Admin/database/migrations/2024_04_15_080927_create_events_table.php @@ -0,0 +1,38 @@ +unsignedTinyInteger('event_id')->autoIncrement(); + $table->string('title')->nullable(); + $table->string('alias')->nullable(); + $table->string('type')->nullable(); + $table->string('date')->nullable(); + $table->time('start_time')->nullable(); + $table->time('end_time')->nullable(); + $table->integer('status')->nullable(); + $table->mediumText('description')->nullable(); + $table->string('location')->nullable(); + $table->mediumText('remarks')->nullable(); + $table->unsignedBigInteger('createdBy')->nullable(); + $table->unsignedBigInteger('updatedBy')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tbl_events'); + } +}; diff --git a/Modules/Admin/database/migrations/2024_04_15_080945_create_holidays_table.php b/Modules/Admin/database/migrations/2024_04_15_080945_create_holidays_table.php new file mode 100644 index 0000000..bb45ff9 --- /dev/null +++ b/Modules/Admin/database/migrations/2024_04_15_080945_create_holidays_table.php @@ -0,0 +1,34 @@ +unsignedTinyInteger('holiday_id')->autoIncrement(); + $table->string('title')->nullable(); + $table->string('alias')->nullable(); + $table->string('date')->nullable(); + $table->integer('status')->nullable(); + $table->mediumText('description')->nullable(); + $table->mediumText('remarks')->nullable(); + $table->unsignedBigInteger('createdBy')->nullable(); + $table->unsignedBigInteger('updatedBy')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('tbl_holidays'); + } +}; diff --git a/Modules/Admin/resources/views/calendars/index.blade.php b/Modules/Admin/resources/views/calendars/index.blade.php new file mode 100644 index 0000000..7a12fc4 --- /dev/null +++ b/Modules/Admin/resources/views/calendars/index.blade.php @@ -0,0 +1,1305 @@ +@extends('layouts.app') +@section('content') +
    +
    + + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
    +
    +
    +
    +
    +
    + + +
    +
    +

    Drag and drop your event or click in the calendar

    +
    + New Event Planning +
    +
    + Meeting +
    +
    + Generating Reports +
    +
    + Create New theme +
    +
    + +
    +
    +
    +
    Upcoming Events
    +

    Don't miss scheduled events

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    4 + Jan 2022
    +
    5:45 AM to 12:00 AM +
    +
    +
    World Braille Day
    +

    +
    +
    +
    +
    +
    +
    30 Jan 2022
    +
    5:45 AM to 12:00 AM +
    +
    +
    World Leprosy Day
    +

    +
    +
    +
    +
    +
    +
    21 Feb 2022
    +
    5:45 AM to 12:00 AM +
    +
    +
    International Mother Language Day
    +

    +
    +
    +
    +
    +
    +
    22 Feb 2022
    +
    5:45 AM to 12:00 AM +
    +
    +
    World Thinking Day
    +

    +
    +
    +
    +
    +
    +
    8 + Mar 2022
    +
    5:45 AM to 12:00 AM +
    +
    +
    International Women's Day
    +

    +
    +
    +
    +
    +
    +
    21 Mar 2022
    +
    5:45 AM to 12:00 AM +
    +
    +
    International Mother Language Day
    +

    +
    +
    +
    +
    +
    +
    22 Mar 2022
    +
    5:45 AM to 12:00 AM +
    +
    +
    World Water Day
    +

    +
    +
    +
    +
    +
    +
    7 Apr 2022
    +
    5:45 AM to 12:00 AM +
    +
    +
    World Health Day
    +

    +
    +
    +
    +
    +
    +
    16 Apr 2022
    +
    5:45 AM to 12:00 AM +
    +
    +
    International Special Librarians Day
    +

    +
    +
    +
    +
    +
    +
    22 Apr 2022
    +
    5:45 AM to 12:00 AM +
    +
    +
    Earth Day
    +

    +
    +
    +
    +
    +
    +
    1 Apr 2024
    +
    Full day event
    +
    +
    All Day Event
    +

    An all-day event is an event that + lasts an entire day or longer

    +
    +
    +
    +
    +
    +
    10 Apr 2024 to 12 Apr 2024
    +
    Full day event
    +
    +
    Visit Online Course
    +

    Long Term Event means an incident + that last longer than 12 hours.

    +
    +
    +
    +
    +
    +
    15 Apr 2024
    +
    12:30 PM to 12:00 AM +
    +
    +
    Meeting With Designer
    +

    Tell how to boost website traffic +

    +
    +
    +
    +
    +
    +
    16 Apr 2024
    +
    7:00 PM to 12:00 AM +
    +
    +
    Birthday Party
    +

    Family slumber party – Bring out + the blankets and pillows and have a family slumber party! Play silly party games, + share special snacks and wind down the fun with a special movie.

    +
    +
    +
    +
    +
    +
    19 Apr 2024 to 23 Apr 2024
    +
    Full day event
    +
    +
    Repeating Event
    +

    A recurring or repeating event is + simply any event that you will occur more than once on your calendar.

    +
    +
    +
    +
    +
    +
    24 Apr 2024 to 25 Apr 2024
    +
    Full day event
    +
    +
    Weekly Strategy Planning
    +

    Strategies for Creating Your Weekly + Schedule

    +
    +
    +
    +
    +
    +
    28 Apr 2024
    +
    Full day event
    +
    +
    Click for Google
    +

    +
    +
    +
    +
    +
    +
    7 May 2024 to 8 May 2024
    +
    8:00 PM to 4:00 PM +
    +
    +
    Client Meeting with Alexis
    +

    A meeting is a gathering of two or + more people that has been convened for the purpose of achieving a common goal through + verbal interaction, such as sharing information or reaching agreement.

    +
    +
    +
    +
    +
    +
    8 May 2024
    +
    8:00 PM to 4:00 PM +
    +
    +
    Velzon Project Discussion with Team
    +

    Tell how to boost website traffic +

    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + +
    +
    +
    Welcome to your Calendar!
    +

    Event that applications book will appear here. Click on an event to see + the details and manage applicants event.

    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    April 2024

    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +@endsection diff --git a/Modules/Admin/resources/views/events/create.blade.php b/Modules/Admin/resources/views/events/create.blade.php new file mode 100644 index 0000000..4a579fd --- /dev/null +++ b/Modules/Admin/resources/views/events/create.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('content') +
    +
    + + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
    +
    + + {{ html()->form('POST')->route('event.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }} + + @include('admin::partials.events.action') + + {{ html()->form()->close() }} + +
    +
    +
    + @endsection diff --git a/Modules/Admin/resources/views/events/edit.blade.php b/Modules/Admin/resources/views/events/edit.blade.php new file mode 100644 index 0000000..f21b27e --- /dev/null +++ b/Modules/Admin/resources/views/events/edit.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('content') +
    +
    + + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
    +
    + + {{ html()->modelForm($event, 'PUT')->route('event.update', $event->event_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }} + + @include('admin::partials.events.action') + + {{ html()->form()->close() }} + +
    +
    +
    + @endsection diff --git a/Modules/Admin/resources/views/events/index.blade.php b/Modules/Admin/resources/views/events/index.blade.php new file mode 100644 index 0000000..1eaae68 --- /dev/null +++ b/Modules/Admin/resources/views/events/index.blade.php @@ -0,0 +1,76 @@ +@extends('layouts.app') +@section('content') +
    +
    + + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
    +
    +
    {{ $title }}
    + +
    +
    + + + + + + + + + + + + + + + @foreach ($eventLists as $index => $item) + + + + + + + + + + @endforeach + +
    S.NTypeTitleDateStart TimeLocationAction +
    {{ $index + 1 }}{{ $item->type }}{{ $item->title }}{{ $item->date }}{{ $item->start_time }}{{ $item->location }} + +
    +
    +
    +
    +
    +@endsection diff --git a/Modules/Admin/resources/views/events/show.blade.php b/Modules/Admin/resources/views/events/show.blade.php new file mode 100644 index 0000000..9ed0171 --- /dev/null +++ b/Modules/Admin/resources/views/events/show.blade.php @@ -0,0 +1,48 @@ +@extends('layouts.app') +@section('content') +
    +
    + + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
    +
    +
    View Detail
    + +
    + +
    +

    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 diff --git a/Modules/Admin/resources/views/holidays/create.blade.php b/Modules/Admin/resources/views/holidays/create.blade.php new file mode 100644 index 0000000..51e0c61 --- /dev/null +++ b/Modules/Admin/resources/views/holidays/create.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('content') +
    +
    + + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
    +
    + + {{ html()->form('POST')->route('holiday.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }} + + @include('admin::partials.holidays.action') + + {{ html()->form()->close() }} + +
    +
    +
    + @endsection diff --git a/Modules/Admin/resources/views/holidays/edit.blade.php b/Modules/Admin/resources/views/holidays/edit.blade.php new file mode 100644 index 0000000..5b33eff --- /dev/null +++ b/Modules/Admin/resources/views/holidays/edit.blade.php @@ -0,0 +1,23 @@ +@extends('layouts.app') +@section('content') +
    +
    + + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
    +
    + + {{ html()->modelForm($holiday, 'PUT')->route('holiday.update', $holiday->holiday_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }} + + @include('admin::partials.holidays.action') + + {{ html()->form()->close() }} + +
    +
    +
    + @endsection diff --git a/Modules/Admin/resources/views/holidays/index.blade.php b/Modules/Admin/resources/views/holidays/index.blade.php new file mode 100644 index 0000000..64db220 --- /dev/null +++ b/Modules/Admin/resources/views/holidays/index.blade.php @@ -0,0 +1,71 @@ +@extends('layouts.app') +@section('content') +
    +
    + + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
    +
    +
    {{ $title }}
    + +
    +
    + + + + + + + + + + + + + @foreach ($holidayLists as $index => $item) + + + + + + + @endforeach + +
    S.NTypeTitleDateAction +
    {{ $index + 1 }}{{ $item->title }}{{ $item->date }} + +
    +
    +
    +
    +
    +@endsection diff --git a/Modules/Admin/resources/views/holidays/show.blade.php b/Modules/Admin/resources/views/holidays/show.blade.php new file mode 100644 index 0000000..9ed0171 --- /dev/null +++ b/Modules/Admin/resources/views/holidays/show.blade.php @@ -0,0 +1,48 @@ +@extends('layouts.app') +@section('content') +
    +
    + + + @include('layouts.partials.breadcrumb', ['title' => $title]) + + + +
    +
    +
    View Detail
    + +
    + +
    +

    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 diff --git a/Modules/Admin/resources/views/partials/companies/action.blade.php b/Modules/Admin/resources/views/partials/companies/action.blade.php index eb04df0..85b3c0f 100644 --- a/Modules/Admin/resources/views/partials/companies/action.blade.php +++ b/Modules/Admin/resources/views/partials/companies/action.blade.php @@ -1,8 +1,8 @@
    - {{ html()->label('Title')->class('form-label') }} - {{ html()->text('title')->class('form-control')->placeholder('Enter Title') }} + {{ html()->label('Name')->class('form-label') }} + {{ html()->text('title')->class('form-control')->placeholder('Company Name') }}
    @@ -10,17 +10,38 @@ {{ html()->select('company_type_id', $companyTypeLists)->class('form-select')->placeholder('Select Company Type') }}
    +
    + {{ html()->label('Address')->class('form-label') }} + {{ html()->text('address')->class('form-control')->placeholder('Company Full Address') }} +
    +
    {{ html()->label('Description')->class('form-label') }} - {{ html()->textarea('description')->class('form-control')->attributes(['rows' => 5]) }} + {{ html()->textarea('description')->class('form-control')->placeholder('Company Description')->attributes(['rows' => 3]) }} +
    +
    + +
    +
    +
    Bank Details
    +
    +
    +
    + {{ html()->label('Name')->class('form-label') }} + {{ html()->text('bank_name')->class('form-control')->placeholder('Bank Name') }}
    -
    - {{ html()->label('Remarks')->class('form-label') }} - {{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 5]) }} +
    + {{ html()->label('Account Number')->class('form-label') }} + {{ html()->text('bank_acc_no')->class('form-control')->placeholder('Bank Account Number') }}
    -
    +
    + {{ html()->label('Branch')->class('form-label') }} + {{ html()->text('bank_acc_branch')->class('form-control')->placeholder('Branch Name') }} +
    + +
    {{ html()->button($editable ? 'Update' : 'Add Company', 'submit')->class('btn btn-success') }}
    diff --git a/Modules/Admin/resources/views/partials/events/action.blade.php b/Modules/Admin/resources/views/partials/events/action.blade.php new file mode 100644 index 0000000..384729d --- /dev/null +++ b/Modules/Admin/resources/views/partials/events/action.blade.php @@ -0,0 +1,50 @@ +
    + +
    + {{ html()->label('Event Type')->class('form-label') }} + {{ html()->select('type')->class('form-select')->placeholder('Select Event Type') }} +
    + + +
    + {{ html()->label('Title')->class('form-label') }} + {{ html()->text('title')->class('form-control')->placeholder('Event Title') }} +
    + +
    + {{ html()->label('Date')->class('form-label') }} +
    + {{ html()->text('date')->class('form-control flatpickr flatpickr-input')->id('event-start-date')->placeholder('Select Event Date') }} + +
    +
    + +
    + {{ html()->label('Start Time')->class('form-label') }} + {{ html()->time('start_time')->class('form-control')->placeholder('Event Start Time') }} +
    + +
    + {{ html()->label('End Time')->class('form-label') }} + {{ html()->time('end_time')->class('form-control')->placeholder('Event End Time') }} +
    + +
    + {{ html()->label('Location')->class('form-label') }} + {{ html()->text('location')->class('form-control')->placeholder('Event Location') }} +
    + +
    + {{ html()->label('Description')->class('form-label') }} + {{ html()->textarea('description')->class('form-control')->placeholder('Event Description')->attributes(['rows' => 3]) }} +
    + +
    + {{ html()->label('Remarks')->class('form-label') }} + {{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 3]) }} +
    + +
    + {{ html()->button($editable ? 'Update' : 'Add Event', 'submit')->class('btn btn-success') }} +
    +
    diff --git a/Modules/Admin/resources/views/partials/holidays/action.blade.php b/Modules/Admin/resources/views/partials/holidays/action.blade.php new file mode 100644 index 0000000..7b7c2b0 --- /dev/null +++ b/Modules/Admin/resources/views/partials/holidays/action.blade.php @@ -0,0 +1,29 @@ +
    + +
    + {{ html()->label('Title')->class('form-label') }} + {{ html()->text('title')->class('form-control')->placeholder('Holiday Title') }} +
    + +
    + {{ html()->label('Date')->class('form-label') }} +
    + {{ html()->text('date')->class('form-control flatpickr flatpickr-input')->id('event-start-date')->placeholder('Select Holiday Date') }} + +
    +
    + +
    + {{ html()->label('Description')->class('form-label') }} + {{ html()->textarea('description')->class('form-control')->placeholder('Holiday Description')->attributes(['rows' => 3]) }} +
    + +
    + {{ html()->label('Remarks')->class('form-label') }} + {{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 3]) }} +
    + +
    + {{ html()->button($editable ? 'Update' : 'Add Holiday', 'submit')->class('btn btn-success') }} +
    +
    diff --git a/Modules/Admin/routes/web.php b/Modules/Admin/routes/web.php index 1281ea4..e41c07e 100644 --- a/Modules/Admin/routes/web.php +++ b/Modules/Admin/routes/web.php @@ -3,9 +3,12 @@ use Illuminate\Support\Facades\Route; use Modules\Admin\Http\Controllers\AdminController; use Modules\Admin\Http\Controllers\AppreciationController; +use Modules\Admin\Http\Controllers\CalendarController; use Modules\Admin\Http\Controllers\CompanyController; use Modules\Admin\Http\Controllers\CompanyTypeController; use Modules\Admin\Http\Controllers\ComplaintController; +use Modules\Admin\Http\Controllers\EventController; +use Modules\Admin\Http\Controllers\HolidayController; use Modules\Admin\Http\Controllers\PromotionDemotionController; use Modules\Admin\Http\Controllers\ResignationController; use Modules\Admin\Http\Controllers\TransferController; @@ -32,6 +35,9 @@ Route::group([], function () { Route::resource('warning', WarningController::class)->names('warning'); Route::resource('company', CompanyController::class)->names('company'); Route::resource('company-type', CompanyTypeController::class)->names('companyType'); + Route::resource('event', EventController::class)->names('event'); + Route::resource('holiday', HolidayController::class)->names('holiday'); + Route::resource('calendar', CalendarController::class)->names('calendar'); }); require __DIR__ . '/route.countries.php'; diff --git a/public/assets/js/custom.js b/public/assets/js/custom.js index 4410e7f..446f6a6 100644 --- a/public/assets/js/custom.js +++ b/public/assets/js/custom.js @@ -1,8 +1,8 @@ $('body').on('click', '.remove-item-btn', function (e) { - e.preventDefault(); - let url = $(this).data('link'); - let id = $(this).data('id'); + e.preventDefault(); + let url = $(this).data('link'); + let id = $(this).data('id'); Swal.fire({ title: 'Are you sure?', @@ -24,7 +24,7 @@ $('body').on('click', '.remove-item-btn', function (e) { id: id }, success: function (response) { - if(response.status == true){ + if (response.status == true) { location.reload(); } }, @@ -47,28 +47,6 @@ document.querySelectorAll('.ckeditor-classic').forEach(editor => { }); -$('.date-picker').nepaliDatePicker({ - // dateFormat: '%D, %M %d, %y', - dateFormat: '%y-%m-%d', - closeOnDateSelect: true, -}); - -// initialize filepond -const inputElement = document.querySelector('.filepond'); -console.log(inputElement); -FilePond.registerPlugin(FilePondPluginImagePreview); -const pond = FilePond.create(inputElement); -FilePond.setOptions({ - server: { - process: "/filepond/upload", - revert: '/delete', - headers: { - 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content'), - }, - } -}); - - //ajax form submit document.addEventListener('DOMContentLoaded', function () { let form = document.getElementById('storeUpdateForm'); diff --git a/public/assets/libs/flatpickr/flatpickr.min.js b/public/assets/libs/flatpickr/flatpickr.min.js index b0f59ec..f389b1d 100644 --- a/public/assets/libs/flatpickr/flatpickr.min.js +++ b/public/assets/libs/flatpickr/flatpickr.min.js @@ -1,2 +1,2 @@ /* flatpickr v4.6.13,, @license MIT */ -!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).flatpickr=n()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var n,t=1,a=arguments.length;t",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},i={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var n=e%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},o=function(e,n){return void 0===n&&(n=2),("000"+e).slice(-1*n)},r=function(e){return!0===e?1:0};function l(e,n){var t;return function(){var a=this,i=arguments;clearTimeout(t),t=setTimeout((function(){return e.apply(a,i)}),n)}}var c=function(e){return e instanceof Array?e:[e]};function s(e,n,t){if(!0===t)return e.classList.add(n);e.classList.remove(n)}function d(e,n,t){var a=window.document.createElement(e);return n=n||"",t=t||"",a.className=n,void 0!==t&&(a.textContent=t),a}function u(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function f(e,n){return n(e)?e:e.parentNode?f(e.parentNode,n):void 0}function m(e,n){var t=d("div","numInputWrapper"),a=d("input","numInput "+e),i=d("span","arrowUp"),o=d("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==n)for(var r in n)a.setAttribute(r,n[r]);return t.appendChild(a),t.appendChild(i),t.appendChild(o),t}function g(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(n){return e.target}}var p=function(){},h=function(e,n,t){return t.months[n?"shorthand":"longhand"][e]},v={D:p,F:function(e,n,t){e.setMonth(t.months.longhand.indexOf(n))},G:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},H:function(e,n){e.setHours(parseFloat(n))},J:function(e,n){e.setDate(parseFloat(n))},K:function(e,n,t){e.setHours(e.getHours()%12+12*r(new RegExp(t.amPM[1],"i").test(n)))},M:function(e,n,t){e.setMonth(t.months.shorthand.indexOf(n))},S:function(e,n){e.setSeconds(parseFloat(n))},U:function(e,n){return new Date(1e3*parseFloat(n))},W:function(e,n,t){var a=parseInt(n),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(e,n){e.setFullYear(parseFloat(n))},Z:function(e,n){return new Date(n)},d:function(e,n){e.setDate(parseFloat(n))},h:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},i:function(e,n){e.setMinutes(parseFloat(n))},j:function(e,n){e.setDate(parseFloat(n))},l:p,m:function(e,n){e.setMonth(parseFloat(n)-1)},n:function(e,n){e.setMonth(parseFloat(n)-1)},s:function(e,n){e.setSeconds(parseFloat(n))},u:function(e,n){return new Date(parseFloat(n))},w:p,y:function(e,n){e.setFullYear(2e3+parseFloat(n))}},D={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},w={Z:function(e){return e.toISOString()},D:function(e,n,t){return n.weekdays.shorthand[w.w(e,n,t)]},F:function(e,n,t){return h(w.n(e,n,t)-1,!1,n)},G:function(e,n,t){return o(w.h(e,n,t))},H:function(e){return o(e.getHours())},J:function(e,n){return void 0!==n.ordinal?e.getDate()+n.ordinal(e.getDate()):e.getDate()},K:function(e,n){return n.amPM[r(e.getHours()>11)]},M:function(e,n){return h(e.getMonth(),!0,n)},S:function(e){return o(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,n,t){return t.getWeek(e)},Y:function(e){return o(e.getFullYear(),4)},d:function(e){return o(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return o(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,n){return n.weekdays.longhand[e.getDay()]},m:function(e){return o(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},b=function(e){var n=e.config,t=void 0===n?a:n,o=e.l10n,r=void 0===o?i:o,l=e.isMobile,c=void 0!==l&&l;return function(e,n,a){var i=a||r;return void 0===t.formatDate||c?n.split("").map((function(n,a,o){return w[n]&&"\\"!==o[a-1]?w[n](e,i,t):"\\"!==n?n:""})).join(""):t.formatDate(e,n,i)}},C=function(e){var n=e.config,t=void 0===n?a:n,o=e.l10n,r=void 0===o?i:o;return function(e,n,i,o){if(0===e||e){var l,c=o||r,s=e;if(e instanceof Date)l=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)l=new Date(e);else if("string"==typeof e){var d=n||(t||a).dateFormat,u=String(e).trim();if("today"===u)l=new Date,i=!0;else if(t&&t.parseDate)l=t.parseDate(e,d);else if(/Z$/.test(u)||/GMT$/.test(u))l=new Date(e);else{for(var f=void 0,m=[],g=0,p=0,h="";g=0?new Date:new Date(w.config.minDate.getTime()),t=E(w.config);n.setHours(t.hours,t.minutes,t.seconds,n.getMilliseconds()),w.selectedDates=[n],w.latestSelectedDateObj=n}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var n="keydown"===e.type,t=g(e),a=t;void 0!==w.amPM&&t===w.amPM&&(w.amPM.textContent=w.l10n.amPM[r(w.amPM.textContent===w.l10n.amPM[0])]);var i=parseFloat(a.getAttribute("min")),l=parseFloat(a.getAttribute("max")),c=parseFloat(a.getAttribute("step")),s=parseInt(a.value,10),d=e.delta||(n?38===e.which?1:-1:0),u=s+c*d;if(void 0!==a.value&&2===a.value.length){var f=a===w.hourElement,m=a===w.minuteElement;ul&&(u=a===w.hourElement?u-l-r(!w.amPM):i,m&&L(void 0,1,w.hourElement)),w.amPM&&f&&(1===c?u+s===23:Math.abs(u-s)>c)&&(w.amPM.textContent=w.l10n.amPM[r(w.amPM.textContent===w.l10n.amPM[0])]),a.value=o(u)}}(e);var a=w._input.value;O(),ye(),w._input.value!==a&&w._debouncedChange()}function O(){if(void 0!==w.hourElement&&void 0!==w.minuteElement){var e,n,t=(parseInt(w.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(w.minuteElement.value,10)||0)%60,i=void 0!==w.secondElement?(parseInt(w.secondElement.value,10)||0)%60:0;void 0!==w.amPM&&(e=t,n=w.amPM.textContent,t=e%12+12*r(n===w.l10n.amPM[1]));var o=void 0!==w.config.minTime||w.config.minDate&&w.minDateHasTime&&w.latestSelectedDateObj&&0===M(w.latestSelectedDateObj,w.config.minDate,!0),l=void 0!==w.config.maxTime||w.config.maxDate&&w.maxDateHasTime&&w.latestSelectedDateObj&&0===M(w.latestSelectedDateObj,w.config.maxDate,!0);if(void 0!==w.config.maxTime&&void 0!==w.config.minTime&&w.config.minTime>w.config.maxTime){var c=y(w.config.minTime.getHours(),w.config.minTime.getMinutes(),w.config.minTime.getSeconds()),s=y(w.config.maxTime.getHours(),w.config.maxTime.getMinutes(),w.config.maxTime.getSeconds()),d=y(t,a,i);if(d>s&&d=12)]),void 0!==w.secondElement&&(w.secondElement.value=o(t)))}function N(e){var n=g(e),t=parseInt(n.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&ee(t)}function P(e,n,t,a){return n instanceof Array?n.forEach((function(n){return P(e,n,t,a)})):e instanceof Array?e.forEach((function(e){return P(e,n,t,a)})):(e.addEventListener(n,t,a),void w._handlers.push({remove:function(){return e.removeEventListener(n,t,a)}}))}function Y(){De("onChange")}function j(e,n){var t=void 0!==e?w.parseDate(e):w.latestSelectedDateObj||(w.config.minDate&&w.config.minDate>w.now?w.config.minDate:w.config.maxDate&&w.config.maxDate=0&&M(e,w.selectedDates[1])<=0)}(n)&&!be(n)&&o.classList.add("inRange"),w.weekNumbers&&1===w.config.showMonths&&"prevMonthDay"!==e&&a%7==6&&w.weekNumbers.insertAdjacentHTML("beforeend",""+w.config.getWeek(n)+""),De("onDayCreate",o),o}function W(e){e.focus(),"range"===w.config.mode&&oe(e)}function B(e){for(var n=e>0?0:w.config.showMonths-1,t=e>0?w.config.showMonths:-1,a=n;a!=t;a+=e)for(var i=w.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&ne(c.dateObj))return c}}function J(e,n){var t=k(),a=te(t||document.body),i=void 0!==e?e:a?t:void 0!==w.selectedDateElem&&te(w.selectedDateElem)?w.selectedDateElem:void 0!==w.todayDateElem&&te(w.todayDateElem)?w.todayDateElem:B(n>0?1:-1);void 0===i?w._input.focus():a?function(e,n){for(var t=-1===e.className.indexOf("Month")?e.dateObj.getMonth():w.currentMonth,a=n>0?w.config.showMonths:-1,i=n>0?1:-1,o=t-w.currentMonth;o!=a;o+=i)for(var r=w.daysContainer.children[o],l=t-w.currentMonth===o?e.$i+n:n<0?r.children.length-1:0,c=r.children.length,s=l;s>=0&&s0?c:-1);s+=i){var d=r.children[s];if(-1===d.className.indexOf("hidden")&&ne(d.dateObj)&&Math.abs(e.$i-s)>=Math.abs(n))return W(d)}w.changeMonth(i),J(B(i),0)}(i,n):W(i)}function K(e,n){for(var t=(new Date(e,n,1).getDay()-w.l10n.firstDayOfWeek+7)%7,a=w.utils.getDaysInMonth((n-1+12)%12,e),i=w.utils.getDaysInMonth(n,e),o=window.document.createDocumentFragment(),r=w.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",c=r?"nextMonthDay hidden":"nextMonthDay",s=a+1-t,u=0;s<=a;s++,u++)o.appendChild(R("flatpickr-day "+l,new Date(e,n-1,s),0,u));for(s=1;s<=i;s++,u++)o.appendChild(R("flatpickr-day",new Date(e,n,s),0,u));for(var f=i+1;f<=42-t&&(1===w.config.showMonths||u%7!=0);f++,u++)o.appendChild(R("flatpickr-day "+c,new Date(e,n+1,f%i),0,u));var m=d("div","dayContainer");return m.appendChild(o),m}function U(){if(void 0!==w.daysContainer){u(w.daysContainer),w.weekNumbers&&u(w.weekNumbers);for(var e=document.createDocumentFragment(),n=0;n1||"dropdown"!==w.config.monthSelectorType)){var e=function(e){return!(void 0!==w.config.minDate&&w.currentYear===w.config.minDate.getFullYear()&&ew.config.maxDate.getMonth())};w.monthsDropdownContainer.tabIndex=-1,w.monthsDropdownContainer.innerHTML="";for(var n=0;n<12;n++)if(e(n)){var t=d("option","flatpickr-monthDropdown-month");t.value=new Date(w.currentYear,n).getMonth().toString(),t.textContent=h(n,w.config.shorthandCurrentMonth,w.l10n),t.tabIndex=-1,w.currentMonth===n&&(t.selected=!0),w.monthsDropdownContainer.appendChild(t)}}}function $(){var e,n=d("div","flatpickr-month"),t=window.document.createDocumentFragment();w.config.showMonths>1||"static"===w.config.monthSelectorType?e=d("span","cur-month"):(w.monthsDropdownContainer=d("select","flatpickr-monthDropdown-months"),w.monthsDropdownContainer.setAttribute("aria-label",w.l10n.monthAriaLabel),P(w.monthsDropdownContainer,"change",(function(e){var n=g(e),t=parseInt(n.value,10);w.changeMonth(t-w.currentMonth),De("onMonthChange")})),q(),e=w.monthsDropdownContainer);var a=m("cur-year",{tabindex:"-1"}),i=a.getElementsByTagName("input")[0];i.setAttribute("aria-label",w.l10n.yearAriaLabel),w.config.minDate&&i.setAttribute("min",w.config.minDate.getFullYear().toString()),w.config.maxDate&&(i.setAttribute("max",w.config.maxDate.getFullYear().toString()),i.disabled=!!w.config.minDate&&w.config.minDate.getFullYear()===w.config.maxDate.getFullYear());var o=d("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(a),t.appendChild(o),n.appendChild(t),{container:n,yearElement:i,monthElement:e}}function V(){u(w.monthNav),w.monthNav.appendChild(w.prevMonthNav),w.config.showMonths&&(w.yearElements=[],w.monthElements=[]);for(var e=w.config.showMonths;e--;){var n=$();w.yearElements.push(n.yearElement),w.monthElements.push(n.monthElement),w.monthNav.appendChild(n.container)}w.monthNav.appendChild(w.nextMonthNav)}function z(){w.weekdayContainer?u(w.weekdayContainer):w.weekdayContainer=d("div","flatpickr-weekdays");for(var e=w.config.showMonths;e--;){var n=d("div","flatpickr-weekdaycontainer");w.weekdayContainer.appendChild(n)}return G(),w.weekdayContainer}function G(){if(w.weekdayContainer){var e=w.l10n.firstDayOfWeek,t=n(w.l10n.weekdays.shorthand);e>0&&e\n "+t.join("")+"\n \n "}}function Z(e,n){void 0===n&&(n=!0);var t=n?e:e-w.currentMonth;t<0&&!0===w._hidePrevMonthArrow||t>0&&!0===w._hideNextMonthArrow||(w.currentMonth+=t,(w.currentMonth<0||w.currentMonth>11)&&(w.currentYear+=w.currentMonth>11?1:-1,w.currentMonth=(w.currentMonth+12)%12,De("onYearChange"),q()),U(),De("onMonthChange"),Ce())}function Q(e){return w.calendarContainer.contains(e)}function X(e){if(w.isOpen&&!w.config.inline){var n=g(e),t=Q(n),a=!(n===w.input||n===w.altInput||w.element.contains(n)||e.path&&e.path.indexOf&&(~e.path.indexOf(w.input)||~e.path.indexOf(w.altInput)))&&!t&&!Q(e.relatedTarget),i=!w.config.ignoredFocusElements.some((function(e){return e.contains(n)}));a&&i&&(w.config.allowInput&&w.setDate(w._input.value,!1,w.config.altInput?w.config.altFormat:w.config.dateFormat),void 0!==w.timeContainer&&void 0!==w.minuteElement&&void 0!==w.hourElement&&""!==w.input.value&&void 0!==w.input.value&&_(),w.close(),w.config&&"range"===w.config.mode&&1===w.selectedDates.length&&w.clear(!1))}}function ee(e){if(!(!e||w.config.minDate&&ew.config.maxDate.getFullYear())){var n=e,t=w.currentYear!==n;w.currentYear=n||w.currentYear,w.config.maxDate&&w.currentYear===w.config.maxDate.getFullYear()?w.currentMonth=Math.min(w.config.maxDate.getMonth(),w.currentMonth):w.config.minDate&&w.currentYear===w.config.minDate.getFullYear()&&(w.currentMonth=Math.max(w.config.minDate.getMonth(),w.currentMonth)),t&&(w.redraw(),De("onYearChange"),q())}}function ne(e,n){var t;void 0===n&&(n=!0);var a=w.parseDate(e,void 0,n);if(w.config.minDate&&a&&M(a,w.config.minDate,void 0!==n?n:!w.minDateHasTime)<0||w.config.maxDate&&a&&M(a,w.config.maxDate,void 0!==n?n:!w.maxDateHasTime)>0)return!1;if(!w.config.enable&&0===w.config.disable.length)return!0;if(void 0===a)return!1;for(var i=!!w.config.enable,o=null!==(t=w.config.enable)&&void 0!==t?t:w.config.disable,r=0,l=void 0;r=l.from.getTime()&&a.getTime()<=l.to.getTime())return i}return!i}function te(e){return void 0!==w.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&w.daysContainer.contains(e))}function ae(e){var n=e.target===w._input,t=w._input.value.trimEnd()!==Me();!n||!t||e.relatedTarget&&Q(e.relatedTarget)||w.setDate(w._input.value,!0,e.target===w.altInput?w.config.altFormat:w.config.dateFormat)}function ie(e){var n=g(e),t=w.config.wrap?p.contains(n):n===w._input,a=w.config.allowInput,i=w.isOpen&&(!a||!t),o=w.config.inline&&t&&!a;if(13===e.keyCode&&t){if(a)return w.setDate(w._input.value,!0,n===w.altInput?w.config.altFormat:w.config.dateFormat),w.close(),n.blur();w.open()}else if(Q(n)||i||o){var r=!!w.timeContainer&&w.timeContainer.contains(n);switch(e.keyCode){case 13:r?(e.preventDefault(),_(),fe()):me(e);break;case 27:e.preventDefault(),fe();break;case 8:case 46:t&&!w.config.allowInput&&(e.preventDefault(),w.clear());break;case 37:case 39:if(r||t)w.hourElement&&w.hourElement.focus();else{e.preventDefault();var l=k();if(void 0!==w.daysContainer&&(!1===a||l&&te(l))){var c=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),Z(c),J(B(1),0)):J(void 0,c)}}break;case 38:case 40:e.preventDefault();var s=40===e.keyCode?1:-1;w.daysContainer&&void 0!==n.$i||n===w.input||n===w.altInput?e.ctrlKey?(e.stopPropagation(),ee(w.currentYear-s),J(B(1),0)):r||J(void 0,7*s):n===w.currentYearElement?ee(w.currentYear-s):w.config.enableTime&&(!r&&w.hourElement&&w.hourElement.focus(),_(e),w._debouncedChange());break;case 9:if(r){var d=[w.hourElement,w.minuteElement,w.secondElement,w.amPM].concat(w.pluginElements).filter((function(e){return e})),u=d.indexOf(n);if(-1!==u){var f=d[u+(e.shiftKey?-1:1)];e.preventDefault(),(f||w._input).focus()}}else!w.config.noCalendar&&w.daysContainer&&w.daysContainer.contains(n)&&e.shiftKey&&(e.preventDefault(),w._input.focus())}}if(void 0!==w.amPM&&n===w.amPM)switch(e.key){case w.l10n.amPM[0].charAt(0):case w.l10n.amPM[0].charAt(0).toLowerCase():w.amPM.textContent=w.l10n.amPM[0],O(),ye();break;case w.l10n.amPM[1].charAt(0):case w.l10n.amPM[1].charAt(0).toLowerCase():w.amPM.textContent=w.l10n.amPM[1],O(),ye()}(t||Q(n))&&De("onKeyDown",e)}function oe(e,n){if(void 0===n&&(n="flatpickr-day"),1===w.selectedDates.length&&(!e||e.classList.contains(n)&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():w.days.firstElementChild.dateObj.getTime(),a=w.parseDate(w.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,w.selectedDates[0].getTime()),o=Math.max(t,w.selectedDates[0].getTime()),r=!1,l=0,c=0,s=i;si&&sl)?l=s:s>a&&(!c||s ."+n)).forEach((function(n){var i,o,s,d=n.dateObj.getTime(),u=l>0&&d0&&d>c;if(u)return n.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){n.classList.remove(e)}));r&&!u||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){n.classList.remove(e)})),void 0!==e&&(e.classList.add(t<=w.selectedDates[0].getTime()?"startRange":"endRange"),at&&d===a&&n.classList.add("endRange"),d>=l&&(0===c||d<=c)&&(o=a,s=t,(i=d)>Math.min(o,s)&&i0||t.getMinutes()>0||t.getSeconds()>0),w.selectedDates&&(w.selectedDates=w.selectedDates.filter((function(e){return ne(e)})),w.selectedDates.length||"min"!==e||F(t),ye()),w.daysContainer&&(ue(),void 0!==t?w.currentYearElement[e]=t.getFullYear().toString():w.currentYearElement.removeAttribute(e),w.currentYearElement.disabled=!!a&&void 0!==t&&a.getFullYear()===t.getFullYear())}}function ce(){return w.config.wrap?p.querySelector("[data-input]"):p}function se(){"object"!=typeof w.config.locale&&void 0===I.l10ns[w.config.locale]&&w.config.errorHandler(new Error("flatpickr: invalid locale "+w.config.locale)),w.l10n=e(e({},I.l10ns.default),"object"==typeof w.config.locale?w.config.locale:"default"!==w.config.locale?I.l10ns[w.config.locale]:void 0),D.D="("+w.l10n.weekdays.shorthand.join("|")+")",D.l="("+w.l10n.weekdays.longhand.join("|")+")",D.M="("+w.l10n.months.shorthand.join("|")+")",D.F="("+w.l10n.months.longhand.join("|")+")",D.K="("+w.l10n.amPM[0]+"|"+w.l10n.amPM[1]+"|"+w.l10n.amPM[0].toLowerCase()+"|"+w.l10n.amPM[1].toLowerCase()+")",void 0===e(e({},v),JSON.parse(JSON.stringify(p.dataset||{}))).time_24hr&&void 0===I.defaultConfig.time_24hr&&(w.config.time_24hr=w.l10n.time_24hr),w.formatDate=b(w),w.parseDate=C({config:w.config,l10n:w.l10n})}function de(e){if("function"!=typeof w.config.position){if(void 0!==w.calendarContainer){De("onPreCalendarPosition");var n=e||w._positionElement,t=Array.prototype.reduce.call(w.calendarContainer.children,(function(e,n){return e+n.offsetHeight}),0),a=w.calendarContainer.offsetWidth,i=w.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,l=n.getBoundingClientRect(),c=window.innerHeight-l.bottom,d="above"===o||"below"!==o&&ct,u=window.pageYOffset+l.top+(d?-t-2:n.offsetHeight+2);if(s(w.calendarContainer,"arrowTop",!d),s(w.calendarContainer,"arrowBottom",d),!w.config.inline){var f=window.pageXOffset+l.left,m=!1,g=!1;"center"===r?(f-=(a-l.width)/2,m=!0):"right"===r&&(f-=a-l.width,g=!0),s(w.calendarContainer,"arrowLeft",!m&&!g),s(w.calendarContainer,"arrowCenter",m),s(w.calendarContainer,"arrowRight",g);var p=window.document.body.offsetWidth-(window.pageXOffset+l.right),h=f+a>window.document.body.offsetWidth,v=p+a>window.document.body.offsetWidth;if(s(w.calendarContainer,"rightMost",h),!w.config.static)if(w.calendarContainer.style.top=u+"px",h)if(v){var D=function(){for(var e=null,n=0;nw.currentMonth+w.config.showMonths-1)&&"range"!==w.config.mode;if(w.selectedDateElem=t,"single"===w.config.mode)w.selectedDates=[a];else if("multiple"===w.config.mode){var o=be(a);o?w.selectedDates.splice(parseInt(o),1):w.selectedDates.push(a)}else"range"===w.config.mode&&(2===w.selectedDates.length&&w.clear(!1,!1),w.latestSelectedDateObj=a,w.selectedDates.push(a),0!==M(a,w.selectedDates[0],!0)&&w.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()})));if(O(),i){var r=w.currentYear!==a.getFullYear();w.currentYear=a.getFullYear(),w.currentMonth=a.getMonth(),r&&(De("onYearChange"),q()),De("onMonthChange")}if(Ce(),U(),ye(),i||"range"===w.config.mode||1!==w.config.showMonths?void 0!==w.selectedDateElem&&void 0===w.hourElement&&w.selectedDateElem&&w.selectedDateElem.focus():W(t),void 0!==w.hourElement&&void 0!==w.hourElement&&w.hourElement.focus(),w.config.closeOnSelect){var l="single"===w.config.mode&&!w.config.enableTime,c="range"===w.config.mode&&2===w.selectedDates.length&&!w.config.enableTime;(l||c)&&fe()}Y()}}w.parseDate=C({config:w.config,l10n:w.l10n}),w._handlers=[],w.pluginElements=[],w.loadedPlugins=[],w._bind=P,w._setHoursFromDate=F,w._positionCalendar=de,w.changeMonth=Z,w.changeYear=ee,w.clear=function(e,n){void 0===e&&(e=!0);void 0===n&&(n=!0);w.input.value="",void 0!==w.altInput&&(w.altInput.value="");void 0!==w.mobileInput&&(w.mobileInput.value="");w.selectedDates=[],w.latestSelectedDateObj=void 0,!0===n&&(w.currentYear=w._initialDate.getFullYear(),w.currentMonth=w._initialDate.getMonth());if(!0===w.config.enableTime){var t=E(w.config),a=t.hours,i=t.minutes,o=t.seconds;A(a,i,o)}w.redraw(),e&&De("onChange")},w.close=function(){w.isOpen=!1,w.isMobile||(void 0!==w.calendarContainer&&w.calendarContainer.classList.remove("open"),void 0!==w._input&&w._input.classList.remove("active"));De("onClose")},w.onMouseOver=oe,w._createElement=d,w.createDay=R,w.destroy=function(){void 0!==w.config&&De("onDestroy");for(var e=w._handlers.length;e--;)w._handlers[e].remove();if(w._handlers=[],w.mobileInput)w.mobileInput.parentNode&&w.mobileInput.parentNode.removeChild(w.mobileInput),w.mobileInput=void 0;else if(w.calendarContainer&&w.calendarContainer.parentNode)if(w.config.static&&w.calendarContainer.parentNode){var n=w.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else w.calendarContainer.parentNode.removeChild(w.calendarContainer);w.altInput&&(w.input.type="text",w.altInput.parentNode&&w.altInput.parentNode.removeChild(w.altInput),delete w.altInput);w.input&&(w.input.type=w.input._type,w.input.classList.remove("flatpickr-input"),w.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete w[e]}catch(e){}}))},w.isEnabled=ne,w.jumpToDate=j,w.updateValue=ye,w.open=function(e,n){void 0===n&&(n=w._positionElement);if(!0===w.isMobile){if(e){e.preventDefault();var t=g(e);t&&t.blur()}return void 0!==w.mobileInput&&(w.mobileInput.focus(),w.mobileInput.click()),void De("onOpen")}if(w._input.disabled||w.config.inline)return;var a=w.isOpen;w.isOpen=!0,a||(w.calendarContainer.classList.add("open"),w._input.classList.add("active"),De("onOpen"),de(n));!0===w.config.enableTime&&!0===w.config.noCalendar&&(!1!==w.config.allowInput||void 0!==e&&w.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return w.hourElement.select()}),50))},w.redraw=ue,w.set=function(e,n){if(null!==e&&"object"==typeof e)for(var a in Object.assign(w.config,e),e)void 0!==ge[a]&&ge[a].forEach((function(e){return e()}));else w.config[e]=n,void 0!==ge[e]?ge[e].forEach((function(e){return e()})):t.indexOf(e)>-1&&(w.config[e]=c(n));w.redraw(),ye(!0)},w.setDate=function(e,n,t){void 0===n&&(n=!1);void 0===t&&(t=w.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return w.clear(n);pe(e,t),w.latestSelectedDateObj=w.selectedDates[w.selectedDates.length-1],w.redraw(),j(void 0,n),F(),0===w.selectedDates.length&&w.clear(!1);ye(n),n&&De("onChange")},w.toggle=function(e){if(!0===w.isOpen)return w.close();w.open(e)};var ge={locale:[se,G],showMonths:[V,S,z],minDate:[j],maxDate:[j],positionElement:[ve],clickOpens:[function(){!0===w.config.clickOpens?(P(w._input,"focus",w.open),P(w._input,"click",w.open)):(w._input.removeEventListener("focus",w.open),w._input.removeEventListener("click",w.open))}]};function pe(e,n){var t=[];if(e instanceof Array)t=e.map((function(e){return w.parseDate(e,n)}));else if(e instanceof Date||"number"==typeof e)t=[w.parseDate(e,n)];else if("string"==typeof e)switch(w.config.mode){case"single":case"time":t=[w.parseDate(e,n)];break;case"multiple":t=e.split(w.config.conjunction).map((function(e){return w.parseDate(e,n)}));break;case"range":t=e.split(w.l10n.rangeSeparator).map((function(e){return w.parseDate(e,n)}))}else w.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));w.selectedDates=w.config.allowInvalidPreload?t:t.filter((function(e){return e instanceof Date&&ne(e,!1)})),"range"===w.config.mode&&w.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()}))}function he(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?w.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:w.parseDate(e.from,void 0),to:w.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function ve(){w._positionElement=w.config.positionElement||w._input}function De(e,n){if(void 0!==w.config){var t=w.config[e];if(void 0!==t&&t.length>0)for(var a=0;t[a]&&a1||"static"===w.config.monthSelectorType?w.monthElements[n].textContent=h(t.getMonth(),w.config.shorthandCurrentMonth,w.l10n)+" ":w.monthsDropdownContainer.value=t.getMonth().toString(),e.value=t.getFullYear().toString()})),w._hidePrevMonthArrow=void 0!==w.config.minDate&&(w.currentYear===w.config.minDate.getFullYear()?w.currentMonth<=w.config.minDate.getMonth():w.currentYearw.config.maxDate.getMonth():w.currentYear>w.config.maxDate.getFullYear()))}function Me(e){var n=e||(w.config.altInput?w.config.altFormat:w.config.dateFormat);return w.selectedDates.map((function(e){return w.formatDate(e,n)})).filter((function(e,n,t){return"range"!==w.config.mode||w.config.enableTime||t.indexOf(e)===n})).join("range"!==w.config.mode?w.config.conjunction:w.l10n.rangeSeparator)}function ye(e){void 0===e&&(e=!0),void 0!==w.mobileInput&&w.mobileFormatStr&&(w.mobileInput.value=void 0!==w.latestSelectedDateObj?w.formatDate(w.latestSelectedDateObj,w.mobileFormatStr):""),w.input.value=Me(w.config.dateFormat),void 0!==w.altInput&&(w.altInput.value=Me(w.config.altFormat)),!1!==e&&De("onValueUpdate")}function xe(e){var n=g(e),t=w.prevMonthNav.contains(n),a=w.nextMonthNav.contains(n);t||a?Z(t?-1:1):w.yearElements.indexOf(n)>=0?n.select():n.classList.contains("arrowUp")?w.changeYear(w.currentYear+1):n.classList.contains("arrowDown")&&w.changeYear(w.currentYear-1)}return function(){w.element=w.input=p,w.isOpen=!1,function(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=e(e({},JSON.parse(JSON.stringify(p.dataset||{}))),v),o={};w.config.parseDate=i.parseDate,w.config.formatDate=i.formatDate,Object.defineProperty(w.config,"enable",{get:function(){return w.config._enable},set:function(e){w.config._enable=he(e)}}),Object.defineProperty(w.config,"disable",{get:function(){return w.config._disable},set:function(e){w.config._disable=he(e)}});var r="time"===i.mode;if(!i.dateFormat&&(i.enableTime||r)){var l=I.defaultConfig.dateFormat||a.dateFormat;o.dateFormat=i.noCalendar||r?"H:i"+(i.enableSeconds?":S":""):l+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||r)&&!i.altFormat){var s=I.defaultConfig.altFormat||a.altFormat;o.altFormat=i.noCalendar||r?"h:i"+(i.enableSeconds?":S K":" K"):s+" h:i"+(i.enableSeconds?":S":"")+" K"}Object.defineProperty(w.config,"minDate",{get:function(){return w.config._minDate},set:le("min")}),Object.defineProperty(w.config,"maxDate",{get:function(){return w.config._maxDate},set:le("max")});var d=function(e){return function(n){w.config["min"===e?"_minTime":"_maxTime"]=w.parseDate(n,"H:i:S")}};Object.defineProperty(w.config,"minTime",{get:function(){return w.config._minTime},set:d("min")}),Object.defineProperty(w.config,"maxTime",{get:function(){return w.config._maxTime},set:d("max")}),"time"===i.mode&&(w.config.noCalendar=!0,w.config.enableTime=!0);Object.assign(w.config,o,i);for(var u=0;u-1?w.config[m]=c(f[m]).map(T).concat(w.config[m]):void 0===i[m]&&(w.config[m]=f[m])}i.altInputClass||(w.config.altInputClass=ce().className+" "+w.config.altInputClass);De("onParseConfig")}(),se(),function(){if(w.input=ce(),!w.input)return void w.config.errorHandler(new Error("Invalid input element specified"));w.input._type=w.input.type,w.input.type="text",w.input.classList.add("flatpickr-input"),w._input=w.input,w.config.altInput&&(w.altInput=d(w.input.nodeName,w.config.altInputClass),w._input=w.altInput,w.altInput.placeholder=w.input.placeholder,w.altInput.disabled=w.input.disabled,w.altInput.required=w.input.required,w.altInput.tabIndex=w.input.tabIndex,w.altInput.type="text",w.input.setAttribute("type","hidden"),!w.config.static&&w.input.parentNode&&w.input.parentNode.insertBefore(w.altInput,w.input.nextSibling));w.config.allowInput||w._input.setAttribute("readonly","readonly");ve()}(),function(){w.selectedDates=[],w.now=w.parseDate(w.config.now)||new Date;var e=w.config.defaultDate||("INPUT"!==w.input.nodeName&&"TEXTAREA"!==w.input.nodeName||!w.input.placeholder||w.input.value!==w.input.placeholder?w.input.value:null);e&&pe(e,w.config.dateFormat);w._initialDate=w.selectedDates.length>0?w.selectedDates[0]:w.config.minDate&&w.config.minDate.getTime()>w.now.getTime()?w.config.minDate:w.config.maxDate&&w.config.maxDate.getTime()0&&(w.latestSelectedDateObj=w.selectedDates[0]);void 0!==w.config.minTime&&(w.config.minTime=w.parseDate(w.config.minTime,"H:i"));void 0!==w.config.maxTime&&(w.config.maxTime=w.parseDate(w.config.maxTime,"H:i"));w.minDateHasTime=!!w.config.minDate&&(w.config.minDate.getHours()>0||w.config.minDate.getMinutes()>0||w.config.minDate.getSeconds()>0),w.maxDateHasTime=!!w.config.maxDate&&(w.config.maxDate.getHours()>0||w.config.maxDate.getMinutes()>0||w.config.maxDate.getSeconds()>0)}(),w.utils={getDaysInMonth:function(e,n){return void 0===e&&(e=w.currentMonth),void 0===n&&(n=w.currentYear),1===e&&(n%4==0&&n%100!=0||n%400==0)?29:w.l10n.daysInMonth[e]}},w.isMobile||function(){var e=window.document.createDocumentFragment();if(w.calendarContainer=d("div","flatpickr-calendar"),w.calendarContainer.tabIndex=-1,!w.config.noCalendar){if(e.appendChild((w.monthNav=d("div","flatpickr-months"),w.yearElements=[],w.monthElements=[],w.prevMonthNav=d("span","flatpickr-prev-month"),w.prevMonthNav.innerHTML=w.config.prevArrow,w.nextMonthNav=d("span","flatpickr-next-month"),w.nextMonthNav.innerHTML=w.config.nextArrow,V(),Object.defineProperty(w,"_hidePrevMonthArrow",{get:function(){return w.__hidePrevMonthArrow},set:function(e){w.__hidePrevMonthArrow!==e&&(s(w.prevMonthNav,"flatpickr-disabled",e),w.__hidePrevMonthArrow=e)}}),Object.defineProperty(w,"_hideNextMonthArrow",{get:function(){return w.__hideNextMonthArrow},set:function(e){w.__hideNextMonthArrow!==e&&(s(w.nextMonthNav,"flatpickr-disabled",e),w.__hideNextMonthArrow=e)}}),w.currentYearElement=w.yearElements[0],Ce(),w.monthNav)),w.innerContainer=d("div","flatpickr-innerContainer"),w.config.weekNumbers){var n=function(){w.calendarContainer.classList.add("hasWeeks");var e=d("div","flatpickr-weekwrapper");e.appendChild(d("span","flatpickr-weekday",w.l10n.weekAbbreviation));var n=d("div","flatpickr-weeks");return e.appendChild(n),{weekWrapper:e,weekNumbers:n}}(),t=n.weekWrapper,a=n.weekNumbers;w.innerContainer.appendChild(t),w.weekNumbers=a,w.weekWrapper=t}w.rContainer=d("div","flatpickr-rContainer"),w.rContainer.appendChild(z()),w.daysContainer||(w.daysContainer=d("div","flatpickr-days"),w.daysContainer.tabIndex=-1),U(),w.rContainer.appendChild(w.daysContainer),w.innerContainer.appendChild(w.rContainer),e.appendChild(w.innerContainer)}w.config.enableTime&&e.appendChild(function(){w.calendarContainer.classList.add("hasTime"),w.config.noCalendar&&w.calendarContainer.classList.add("noCalendar");var e=E(w.config);w.timeContainer=d("div","flatpickr-time"),w.timeContainer.tabIndex=-1;var n=d("span","flatpickr-time-separator",":"),t=m("flatpickr-hour",{"aria-label":w.l10n.hourAriaLabel});w.hourElement=t.getElementsByTagName("input")[0];var a=m("flatpickr-minute",{"aria-label":w.l10n.minuteAriaLabel});w.minuteElement=a.getElementsByTagName("input")[0],w.hourElement.tabIndex=w.minuteElement.tabIndex=-1,w.hourElement.value=o(w.latestSelectedDateObj?w.latestSelectedDateObj.getHours():w.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),w.minuteElement.value=o(w.latestSelectedDateObj?w.latestSelectedDateObj.getMinutes():e.minutes),w.hourElement.setAttribute("step",w.config.hourIncrement.toString()),w.minuteElement.setAttribute("step",w.config.minuteIncrement.toString()),w.hourElement.setAttribute("min",w.config.time_24hr?"0":"1"),w.hourElement.setAttribute("max",w.config.time_24hr?"23":"12"),w.hourElement.setAttribute("maxlength","2"),w.minuteElement.setAttribute("min","0"),w.minuteElement.setAttribute("max","59"),w.minuteElement.setAttribute("maxlength","2"),w.timeContainer.appendChild(t),w.timeContainer.appendChild(n),w.timeContainer.appendChild(a),w.config.time_24hr&&w.timeContainer.classList.add("time24hr");if(w.config.enableSeconds){w.timeContainer.classList.add("hasSeconds");var i=m("flatpickr-second");w.secondElement=i.getElementsByTagName("input")[0],w.secondElement.value=o(w.latestSelectedDateObj?w.latestSelectedDateObj.getSeconds():e.seconds),w.secondElement.setAttribute("step",w.minuteElement.getAttribute("step")),w.secondElement.setAttribute("min","0"),w.secondElement.setAttribute("max","59"),w.secondElement.setAttribute("maxlength","2"),w.timeContainer.appendChild(d("span","flatpickr-time-separator",":")),w.timeContainer.appendChild(i)}w.config.time_24hr||(w.amPM=d("span","flatpickr-am-pm",w.l10n.amPM[r((w.latestSelectedDateObj?w.hourElement.value:w.config.defaultHour)>11)]),w.amPM.title=w.l10n.toggleTitle,w.amPM.tabIndex=-1,w.timeContainer.appendChild(w.amPM));return w.timeContainer}());s(w.calendarContainer,"rangeMode","range"===w.config.mode),s(w.calendarContainer,"animate",!0===w.config.animate),s(w.calendarContainer,"multiMonth",w.config.showMonths>1),w.calendarContainer.appendChild(e);var i=void 0!==w.config.appendTo&&void 0!==w.config.appendTo.nodeType;if((w.config.inline||w.config.static)&&(w.calendarContainer.classList.add(w.config.inline?"inline":"static"),w.config.inline&&(!i&&w.element.parentNode?w.element.parentNode.insertBefore(w.calendarContainer,w._input.nextSibling):void 0!==w.config.appendTo&&w.config.appendTo.appendChild(w.calendarContainer)),w.config.static)){var l=d("div","flatpickr-wrapper");w.element.parentNode&&w.element.parentNode.insertBefore(l,w.element),l.appendChild(w.element),w.altInput&&l.appendChild(w.altInput),l.appendChild(w.calendarContainer)}w.config.static||w.config.inline||(void 0!==w.config.appendTo?w.config.appendTo:window.document.body).appendChild(w.calendarContainer)}(),function(){w.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(w.element.querySelectorAll("[data-"+e+"]"),(function(n){return P(n,"click",w[e])}))}));if(w.isMobile)return void function(){var e=w.config.enableTime?w.config.noCalendar?"time":"datetime-local":"date";w.mobileInput=d("input",w.input.className+" flatpickr-mobile"),w.mobileInput.tabIndex=1,w.mobileInput.type=e,w.mobileInput.disabled=w.input.disabled,w.mobileInput.required=w.input.required,w.mobileInput.placeholder=w.input.placeholder,w.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",w.selectedDates.length>0&&(w.mobileInput.defaultValue=w.mobileInput.value=w.formatDate(w.selectedDates[0],w.mobileFormatStr));w.config.minDate&&(w.mobileInput.min=w.formatDate(w.config.minDate,"Y-m-d"));w.config.maxDate&&(w.mobileInput.max=w.formatDate(w.config.maxDate,"Y-m-d"));w.input.getAttribute("step")&&(w.mobileInput.step=String(w.input.getAttribute("step")));w.input.type="hidden",void 0!==w.altInput&&(w.altInput.type="hidden");try{w.input.parentNode&&w.input.parentNode.insertBefore(w.mobileInput,w.input.nextSibling)}catch(e){}P(w.mobileInput,"change",(function(e){w.setDate(g(e).value,!1,w.mobileFormatStr),De("onChange"),De("onClose")}))}();var e=l(re,50);w._debouncedChange=l(Y,300),w.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&P(w.daysContainer,"mouseover",(function(e){"range"===w.config.mode&&oe(g(e))}));P(w._input,"keydown",ie),void 0!==w.calendarContainer&&P(w.calendarContainer,"keydown",ie);w.config.inline||w.config.static||P(window,"resize",e);void 0!==window.ontouchstart?P(window.document,"touchstart",X):P(window.document,"mousedown",X);P(window.document,"focus",X,{capture:!0}),!0===w.config.clickOpens&&(P(w._input,"focus",w.open),P(w._input,"click",w.open));void 0!==w.daysContainer&&(P(w.monthNav,"click",xe),P(w.monthNav,["keyup","increment"],N),P(w.daysContainer,"click",me));if(void 0!==w.timeContainer&&void 0!==w.minuteElement&&void 0!==w.hourElement){var n=function(e){return g(e).select()};P(w.timeContainer,["increment"],_),P(w.timeContainer,"blur",_,{capture:!0}),P(w.timeContainer,"click",H),P([w.hourElement,w.minuteElement],["focus","click"],n),void 0!==w.secondElement&&P(w.secondElement,"focus",(function(){return w.secondElement&&w.secondElement.select()})),void 0!==w.amPM&&P(w.amPM,"click",(function(e){_(e)}))}w.config.allowInput&&P(w._input,"blur",ae)}(),(w.selectedDates.length||w.config.noCalendar)&&(w.config.enableTime&&F(w.config.noCalendar?w.latestSelectedDateObj:void 0),ye(!1)),S();var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!w.isMobile&&n&&de(),De("onReady")}(),w}function T(e,n){for(var t=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),a=[],i=0;i", noCalendar: !1, now: new Date, onChange: [], onClose: [], onDayCreate: [], onDestroy: [], onKeyDown: [], onMonthChange: [], onOpen: [], onParseConfig: [], onReady: [], onValueUpdate: [], onYearChange: [], onPreCalendarPosition: [], plugins: [], position: "auto", positionElement: void 0, prevArrow: "", shorthandCurrentMonth: !1, showMonths: 1, static: !1, time_24hr: !1, weekNumbers: !1, wrap: !1 }, i = { weekdays: { shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], longhand: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] }, months: { shorthand: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], longhand: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] }, daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], firstDayOfWeek: 0, ordinal: function (e) { var n = e % 100; if (n > 3 && n < 21) return "th"; switch (n % 10) { case 1: return "st"; case 2: return "nd"; case 3: return "rd"; default: return "th" } }, rangeSeparator: " to ", weekAbbreviation: "Wk", scrollTitle: "Scroll to increment", toggleTitle: "Click to toggle", amPM: ["AM", "PM"], yearAriaLabel: "Year", monthAriaLabel: "Month", hourAriaLabel: "Hour", minuteAriaLabel: "Minute", time_24hr: !1 }, o = function (e, n) { return void 0 === n && (n = 2), ("000" + e).slice(-1 * n) }, r = function (e) { return !0 === e ? 1 : 0 }; function l(e, n) { var t; return function () { var a = this, i = arguments; clearTimeout(t), t = setTimeout((function () { return e.apply(a, i) }), n) } } var c = function (e) { return e instanceof Array ? e : [e] }; function s(e, n, t) { if (!0 === t) return e.classList.add(n); e.classList.remove(n) } function d(e, n, t) { var a = window.document.createElement(e); return n = n || "", t = t || "", a.className = n, void 0 !== t && (a.textContent = t), a } function u(e) { for (; e.firstChild;)e.removeChild(e.firstChild) } function f(e, n) { return n(e) ? e : e.parentNode ? f(e.parentNode, n) : void 0 } function m(e, n) { var t = d("div", "numInputWrapper"), a = d("input", "numInput " + e), i = d("span", "arrowUp"), o = d("span", "arrowDown"); if (-1 === navigator.userAgent.indexOf("MSIE 9.0") ? a.type = "number" : (a.type = "text", a.pattern = "\\d*"), void 0 !== n) for (var r in n) a.setAttribute(r, n[r]); return t.appendChild(a), t.appendChild(i), t.appendChild(o), t } function g(e) { try { return "function" == typeof e.composedPath ? e.composedPath()[0] : e.target } catch (n) { return e.target } } var p = function () { }, h = function (e, n, t) { return t.months[n ? "shorthand" : "longhand"][e] }, v = { D: p, F: function (e, n, t) { e.setMonth(t.months.longhand.indexOf(n)) }, G: function (e, n) { e.setHours((e.getHours() >= 12 ? 12 : 0) + parseFloat(n)) }, H: function (e, n) { e.setHours(parseFloat(n)) }, J: function (e, n) { e.setDate(parseFloat(n)) }, K: function (e, n, t) { e.setHours(e.getHours() % 12 + 12 * r(new RegExp(t.amPM[1], "i").test(n))) }, M: function (e, n, t) { e.setMonth(t.months.shorthand.indexOf(n)) }, S: function (e, n) { e.setSeconds(parseFloat(n)) }, U: function (e, n) { return new Date(1e3 * parseFloat(n)) }, W: function (e, n, t) { var a = parseInt(n), i = new Date(e.getFullYear(), 0, 2 + 7 * (a - 1), 0, 0, 0, 0); return i.setDate(i.getDate() - i.getDay() + t.firstDayOfWeek), i }, Y: function (e, n) { e.setFullYear(parseFloat(n)) }, Z: function (e, n) { return new Date(n) }, d: function (e, n) { e.setDate(parseFloat(n)) }, h: function (e, n) { e.setHours((e.getHours() >= 12 ? 12 : 0) + parseFloat(n)) }, i: function (e, n) { e.setMinutes(parseFloat(n)) }, j: function (e, n) { e.setDate(parseFloat(n)) }, l: p, m: function (e, n) { e.setMonth(parseFloat(n) - 1) }, n: function (e, n) { e.setMonth(parseFloat(n) - 1) }, s: function (e, n) { e.setSeconds(parseFloat(n)) }, u: function (e, n) { return new Date(parseFloat(n)) }, w: p, y: function (e, n) { e.setFullYear(2e3 + parseFloat(n)) } }, D = { D: "", F: "", G: "(\\d\\d|\\d)", H: "(\\d\\d|\\d)", J: "(\\d\\d|\\d)\\w+", K: "", M: "", S: "(\\d\\d|\\d)", U: "(.+)", W: "(\\d\\d|\\d)", Y: "(\\d{4})", Z: "(.+)", d: "(\\d\\d|\\d)", h: "(\\d\\d|\\d)", i: "(\\d\\d|\\d)", j: "(\\d\\d|\\d)", l: "", m: "(\\d\\d|\\d)", n: "(\\d\\d|\\d)", s: "(\\d\\d|\\d)", u: "(.+)", w: "(\\d\\d|\\d)", y: "(\\d{2})" }, w = { Z: function (e) { return e.toISOString() }, D: function (e, n, t) { return n.weekdays.shorthand[w.w(e, n, t)] }, F: function (e, n, t) { return h(w.n(e, n, t) - 1, !1, n) }, G: function (e, n, t) { return o(w.h(e, n, t)) }, H: function (e) { return o(e.getHours()) }, J: function (e, n) { return void 0 !== n.ordinal ? e.getDate() + n.ordinal(e.getDate()) : e.getDate() }, K: function (e, n) { return n.amPM[r(e.getHours() > 11)] }, M: function (e, n) { return h(e.getMonth(), !0, n) }, S: function (e) { return o(e.getSeconds()) }, U: function (e) { return e.getTime() / 1e3 }, W: function (e, n, t) { return t.getWeek(e) }, Y: function (e) { return o(e.getFullYear(), 4) }, d: function (e) { return o(e.getDate()) }, h: function (e) { return e.getHours() % 12 ? e.getHours() % 12 : 12 }, i: function (e) { return o(e.getMinutes()) }, j: function (e) { return e.getDate() }, l: function (e, n) { return n.weekdays.longhand[e.getDay()] }, m: function (e) { return o(e.getMonth() + 1) }, n: function (e) { return e.getMonth() + 1 }, s: function (e) { return e.getSeconds() }, u: function (e) { return e.getTime() }, w: function (e) { return e.getDay() }, y: function (e) { return String(e.getFullYear()).substring(2) } }, b = function (e) { var n = e.config, t = void 0 === n ? a : n, o = e.l10n, r = void 0 === o ? i : o, l = e.isMobile, c = void 0 !== l && l; return function (e, n, a) { var i = a || r; return void 0 === t.formatDate || c ? n.split("").map((function (n, a, o) { return w[n] && "\\" !== o[a - 1] ? w[n](e, i, t) : "\\" !== n ? n : "" })).join("") : t.formatDate(e, n, i) } }, C = function (e) { var n = e.config, t = void 0 === n ? a : n, o = e.l10n, r = void 0 === o ? i : o; return function (e, n, i, o) { if (0 === e || e) { var l, c = o || r, s = e; if (e instanceof Date) l = new Date(e.getTime()); else if ("string" != typeof e && void 0 !== e.toFixed) l = new Date(e); else if ("string" == typeof e) { var d = n || (t || a).dateFormat, u = String(e).trim(); if ("today" === u) l = new Date, i = !0; else if (t && t.parseDate) l = t.parseDate(e, d); else if (/Z$/.test(u) || /GMT$/.test(u)) l = new Date(e); else { for (var f = void 0, m = [], g = 0, p = 0, h = ""; g < d.length; g++) { var w = d[g], b = "\\" === w, C = "\\" === d[g - 1] || b; if (D[w] && !C) { h += D[w]; var M = new RegExp(h).exec(e); M && (f = !0) && m["Y" !== w ? "push" : "unshift"]({ fn: v[w], val: M[++p] }) } else b || (h += ".") } l = t && t.noCalendar ? new Date((new Date).setHours(0, 0, 0, 0)) : new Date((new Date).getFullYear(), 0, 1, 0, 0, 0, 0), m.forEach((function (e) { var n = e.fn, t = e.val; return l = n(l, t, c) || l })), l = f ? l : void 0 } } if (l instanceof Date && !isNaN(l.getTime())) return !0 === i && l.setHours(0, 0, 0, 0), l; t.errorHandler(new Error("Invalid date provided: " + s)) } } }; function M(e, n, t) { return void 0 === t && (t = !0), !1 !== t ? new Date(e.getTime()).setHours(0, 0, 0, 0) - new Date(n.getTime()).setHours(0, 0, 0, 0) : e.getTime() - n.getTime() } var y = function (e, n, t) { return 3600 * e + 60 * n + t }, x = 864e5; function E(e) { var n = e.defaultHour, t = e.defaultMinute, a = e.defaultSeconds; if (void 0 !== e.minDate) { var i = e.minDate.getHours(), o = e.minDate.getMinutes(), r = e.minDate.getSeconds(); n < i && (n = i), n === i && t < o && (t = o), n === i && t === o && a < r && (a = e.minDate.getSeconds()) } if (void 0 !== e.maxDate) { var l = e.maxDate.getHours(), c = e.maxDate.getMinutes(); (n = Math.min(n, l)) === l && (t = Math.min(c, t)), n === l && t === c && (a = e.maxDate.getSeconds()) } return { hours: n, minutes: t, seconds: a } } "function" != typeof Object.assign && (Object.assign = function (e) { for (var n = [], t = 1; t < arguments.length; t++)n[t - 1] = arguments[t]; if (!e) throw TypeError("Cannot convert undefined or null to object"); for (var a = function (n) { n && Object.keys(n).forEach((function (t) { return e[t] = n[t] })) }, i = 0, o = n; i < o.length; i++) { var r = o[i]; a(r) } return e }); function k(p, v) { var w = { config: e(e({}, a), I.defaultConfig), l10n: i }; function k() { var e; return (null === (e = w.calendarContainer) || void 0 === e ? void 0 : e.getRootNode()).activeElement || document.activeElement } function T(e) { return e.bind(w) } function S() { var e = w.config; !1 === e.weekNumbers && 1 === e.showMonths || !0 !== e.noCalendar && window.requestAnimationFrame((function () { if (void 0 !== w.calendarContainer && (w.calendarContainer.style.visibility = "hidden", w.calendarContainer.style.display = "block"), void 0 !== w.daysContainer) { var n = (w.days.offsetWidth + 1) * e.showMonths; w.daysContainer.style.width = n + "px", w.calendarContainer.style.width = n + (void 0 !== w.weekWrapper ? w.weekWrapper.offsetWidth : 0) + "px", w.calendarContainer.style.removeProperty("visibility"), w.calendarContainer.style.removeProperty("display") } })) } function _(e) { if (0 === w.selectedDates.length) { var n = void 0 === w.config.minDate || M(new Date, w.config.minDate) >= 0 ? new Date : new Date(w.config.minDate.getTime()), t = E(w.config); n.setHours(t.hours, t.minutes, t.seconds, n.getMilliseconds()), w.selectedDates = [n], w.latestSelectedDateObj = n } void 0 !== e && "blur" !== e.type && function (e) { e.preventDefault(); var n = "keydown" === e.type, t = g(e), a = t; void 0 !== w.amPM && t === w.amPM && (w.amPM.textContent = w.l10n.amPM[r(w.amPM.textContent === w.l10n.amPM[0])]); var i = parseFloat(a.getAttribute("min")), l = parseFloat(a.getAttribute("max")), c = parseFloat(a.getAttribute("step")), s = parseInt(a.value, 10), d = e.delta || (n ? 38 === e.which ? 1 : -1 : 0), u = s + c * d; if (void 0 !== a.value && 2 === a.value.length) { var f = a === w.hourElement, m = a === w.minuteElement; u < i ? (u = l + u + r(!f) + (r(f) && r(!w.amPM)), m && L(void 0, -1, w.hourElement)) : u > l && (u = a === w.hourElement ? u - l - r(!w.amPM) : i, m && L(void 0, 1, w.hourElement)), w.amPM && f && (1 === c ? u + s === 23 : Math.abs(u - s) > c) && (w.amPM.textContent = w.l10n.amPM[r(w.amPM.textContent === w.l10n.amPM[0])]), a.value = o(u) } }(e); var a = w._input.value; O(), ye(), w._input.value !== a && w._debouncedChange() } function O() { if (void 0 !== w.hourElement && void 0 !== w.minuteElement) { var e, n, t = (parseInt(w.hourElement.value.slice(-2), 10) || 0) % 24, a = (parseInt(w.minuteElement.value, 10) || 0) % 60, i = void 0 !== w.secondElement ? (parseInt(w.secondElement.value, 10) || 0) % 60 : 0; void 0 !== w.amPM && (e = t, n = w.amPM.textContent, t = e % 12 + 12 * r(n === w.l10n.amPM[1])); var o = void 0 !== w.config.minTime || w.config.minDate && w.minDateHasTime && w.latestSelectedDateObj && 0 === M(w.latestSelectedDateObj, w.config.minDate, !0), l = void 0 !== w.config.maxTime || w.config.maxDate && w.maxDateHasTime && w.latestSelectedDateObj && 0 === M(w.latestSelectedDateObj, w.config.maxDate, !0); if (void 0 !== w.config.maxTime && void 0 !== w.config.minTime && w.config.minTime > w.config.maxTime) { var c = y(w.config.minTime.getHours(), w.config.minTime.getMinutes(), w.config.minTime.getSeconds()), s = y(w.config.maxTime.getHours(), w.config.maxTime.getMinutes(), w.config.maxTime.getSeconds()), d = y(t, a, i); if (d > s && d < c) { var u = function (e) { var n = Math.floor(e / 3600), t = (e - 3600 * n) / 60; return [n, t, e - 3600 * n - 60 * t] }(c); t = u[0], a = u[1], i = u[2] } } else { if (l) { var f = void 0 !== w.config.maxTime ? w.config.maxTime : w.config.maxDate; (t = Math.min(t, f.getHours())) === f.getHours() && (a = Math.min(a, f.getMinutes())), a === f.getMinutes() && (i = Math.min(i, f.getSeconds())) } if (o) { var m = void 0 !== w.config.minTime ? w.config.minTime : w.config.minDate; (t = Math.max(t, m.getHours())) === m.getHours() && a < m.getMinutes() && (a = m.getMinutes()), a === m.getMinutes() && (i = Math.max(i, m.getSeconds())) } } A(t, a, i) } } function F(e) { var n = e || w.latestSelectedDateObj; n && n instanceof Date && A(n.getHours(), n.getMinutes(), n.getSeconds()) } function A(e, n, t) { void 0 !== w.latestSelectedDateObj && w.latestSelectedDateObj.setHours(e % 24, n, t || 0, 0), w.hourElement && w.minuteElement && !w.isMobile && (w.hourElement.value = o(w.config.time_24hr ? e : (12 + e) % 12 + 12 * r(e % 12 == 0)), w.minuteElement.value = o(n), void 0 !== w.amPM && (w.amPM.textContent = w.l10n.amPM[r(e >= 12)]), void 0 !== w.secondElement && (w.secondElement.value = o(t))) } function N(e) { var n = g(e), t = parseInt(n.value) + (e.delta || 0); (t / 1e3 > 1 || "Enter" === e.key && !/[^\d]/.test(t.toString())) && ee(t) } function P(e, n, t, a) { return n instanceof Array ? n.forEach((function (n) { return P(e, n, t, a) })) : e instanceof Array ? e.forEach((function (e) { return P(e, n, t, a) })) : (e.addEventListener(n, t, a), void w._handlers.push({ remove: function () { return e.removeEventListener(n, t, a) } })) } function Y() { De("onChange") } function j(e, n) { var t = void 0 !== e ? w.parseDate(e) : w.latestSelectedDateObj || (w.config.minDate && w.config.minDate > w.now ? w.config.minDate : w.config.maxDate && w.config.maxDate < w.now ? w.config.maxDate : w.now), a = w.currentYear, i = w.currentMonth; try { void 0 !== t && (w.currentYear = t.getFullYear(), w.currentMonth = t.getMonth()) } catch (e) { e.message = "Invalid date supplied: " + t, w.config.errorHandler(e) } n && w.currentYear !== a && (De("onYearChange"), q()), !n || w.currentYear === a && w.currentMonth === i || De("onMonthChange"), w.redraw() } function H(e) { var n = g(e); ~n.className.indexOf("arrow") && L(e, n.classList.contains("arrowUp") ? 1 : -1) } function L(e, n, t) { var a = e && g(e), i = t || a && a.parentNode && a.parentNode.firstChild, o = we("increment"); o.delta = n, i && i.dispatchEvent(o) } function R(e, n, t, a) { var i = ne(n, !0), o = d("span", e, n.getDate().toString()); return o.dateObj = n, o.$i = a, o.setAttribute("aria-label", w.formatDate(n, w.config.ariaDateFormat)), -1 === e.indexOf("hidden") && 0 === M(n, w.now) && (w.todayDateElem = o, o.classList.add("today"), o.setAttribute("aria-current", "date")), i ? (o.tabIndex = -1, be(n) && (o.classList.add("selected"), w.selectedDateElem = o, "range" === w.config.mode && (s(o, "startRange", w.selectedDates[0] && 0 === M(n, w.selectedDates[0], !0)), s(o, "endRange", w.selectedDates[1] && 0 === M(n, w.selectedDates[1], !0)), "nextMonthDay" === e && o.classList.add("inRange")))) : o.classList.add("flatpickr-disabled"), "range" === w.config.mode && function (e) { return !("range" !== w.config.mode || w.selectedDates.length < 2) && (M(e, w.selectedDates[0]) >= 0 && M(e, w.selectedDates[1]) <= 0) }(n) && !be(n) && o.classList.add("inRange"), w.weekNumbers && 1 === w.config.showMonths && "prevMonthDay" !== e && a % 7 == 6 && w.weekNumbers.insertAdjacentHTML("beforeend", "" + w.config.getWeek(n) + ""), De("onDayCreate", o), o } function W(e) { e.focus(), "range" === w.config.mode && oe(e) } function B(e) { for (var n = e > 0 ? 0 : w.config.showMonths - 1, t = e > 0 ? w.config.showMonths : -1, a = n; a != t; a += e)for (var i = w.daysContainer.children[a], o = e > 0 ? 0 : i.children.length - 1, r = e > 0 ? i.children.length : -1, l = o; l != r; l += e) { var c = i.children[l]; if (-1 === c.className.indexOf("hidden") && ne(c.dateObj)) return c } } function J(e, n) { var t = k(), a = te(t || document.body), i = void 0 !== e ? e : a ? t : void 0 !== w.selectedDateElem && te(w.selectedDateElem) ? w.selectedDateElem : void 0 !== w.todayDateElem && te(w.todayDateElem) ? w.todayDateElem : B(n > 0 ? 1 : -1); void 0 === i ? w._input.focus() : a ? function (e, n) { for (var t = -1 === e.className.indexOf("Month") ? e.dateObj.getMonth() : w.currentMonth, a = n > 0 ? w.config.showMonths : -1, i = n > 0 ? 1 : -1, o = t - w.currentMonth; o != a; o += i)for (var r = w.daysContainer.children[o], l = t - w.currentMonth === o ? e.$i + n : n < 0 ? r.children.length - 1 : 0, c = r.children.length, s = l; s >= 0 && s < c && s != (n > 0 ? c : -1); s += i) { var d = r.children[s]; if (-1 === d.className.indexOf("hidden") && ne(d.dateObj) && Math.abs(e.$i - s) >= Math.abs(n)) return W(d) } w.changeMonth(i), J(B(i), 0) }(i, n) : W(i) } function K(e, n) { for (var t = (new Date(e, n, 1).getDay() - w.l10n.firstDayOfWeek + 7) % 7, a = w.utils.getDaysInMonth((n - 1 + 12) % 12, e), i = w.utils.getDaysInMonth(n, e), o = window.document.createDocumentFragment(), r = w.config.showMonths > 1, l = r ? "prevMonthDay hidden" : "prevMonthDay", c = r ? "nextMonthDay hidden" : "nextMonthDay", s = a + 1 - t, u = 0; s <= a; s++, u++)o.appendChild(R("flatpickr-day " + l, new Date(e, n - 1, s), 0, u)); for (s = 1; s <= i; s++, u++)o.appendChild(R("flatpickr-day", new Date(e, n, s), 0, u)); for (var f = i + 1; f <= 42 - t && (1 === w.config.showMonths || u % 7 != 0); f++, u++)o.appendChild(R("flatpickr-day " + c, new Date(e, n + 1, f % i), 0, u)); var m = d("div", "dayContainer"); return m.appendChild(o), m } function U() { if (void 0 !== w.daysContainer) { u(w.daysContainer), w.weekNumbers && u(w.weekNumbers); for (var e = document.createDocumentFragment(), n = 0; n < w.config.showMonths; n++) { var t = new Date(w.currentYear, w.currentMonth, 1); t.setMonth(w.currentMonth + n), e.appendChild(K(t.getFullYear(), t.getMonth())) } w.daysContainer.appendChild(e), w.days = w.daysContainer.firstChild, "range" === w.config.mode && 1 === w.selectedDates.length && oe() } } function q() { if (!(w.config.showMonths > 1 || "dropdown" !== w.config.monthSelectorType)) { var e = function (e) { return !(void 0 !== w.config.minDate && w.currentYear === w.config.minDate.getFullYear() && e < w.config.minDate.getMonth()) && !(void 0 !== w.config.maxDate && w.currentYear === w.config.maxDate.getFullYear() && e > w.config.maxDate.getMonth()) }; w.monthsDropdownContainer.tabIndex = -1, w.monthsDropdownContainer.innerHTML = ""; for (var n = 0; n < 12; n++)if (e(n)) { var t = d("option", "flatpickr-monthDropdown-month"); t.value = new Date(w.currentYear, n).getMonth().toString(), t.textContent = h(n, w.config.shorthandCurrentMonth, w.l10n), t.tabIndex = -1, w.currentMonth === n && (t.selected = !0), w.monthsDropdownContainer.appendChild(t) } } } function $() { var e, n = d("div", "flatpickr-month"), t = window.document.createDocumentFragment(); w.config.showMonths > 1 || "static" === w.config.monthSelectorType ? e = d("span", "cur-month") : (w.monthsDropdownContainer = d("select", "flatpickr-monthDropdown-months"), w.monthsDropdownContainer.setAttribute("aria-label", w.l10n.monthAriaLabel), P(w.monthsDropdownContainer, "change", (function (e) { var n = g(e), t = parseInt(n.value, 10); w.changeMonth(t - w.currentMonth), De("onMonthChange") })), q(), e = w.monthsDropdownContainer); var a = m("cur-year", { tabindex: "-1" }), i = a.getElementsByTagName("input")[0]; i.setAttribute("aria-label", w.l10n.yearAriaLabel), w.config.minDate && i.setAttribute("min", w.config.minDate.getFullYear().toString()), w.config.maxDate && (i.setAttribute("max", w.config.maxDate.getFullYear().toString()), i.disabled = !!w.config.minDate && w.config.minDate.getFullYear() === w.config.maxDate.getFullYear()); var o = d("div", "flatpickr-current-month"); return o.appendChild(e), o.appendChild(a), t.appendChild(o), n.appendChild(t), { container: n, yearElement: i, monthElement: e } } function V() { u(w.monthNav), w.monthNav.appendChild(w.prevMonthNav), w.config.showMonths && (w.yearElements = [], w.monthElements = []); for (var e = w.config.showMonths; e--;) { var n = $(); w.yearElements.push(n.yearElement), w.monthElements.push(n.monthElement), w.monthNav.appendChild(n.container) } w.monthNav.appendChild(w.nextMonthNav) } function z() { w.weekdayContainer ? u(w.weekdayContainer) : w.weekdayContainer = d("div", "flatpickr-weekdays"); for (var e = w.config.showMonths; e--;) { var n = d("div", "flatpickr-weekdaycontainer"); w.weekdayContainer.appendChild(n) } return G(), w.weekdayContainer } function G() { if (w.weekdayContainer) { var e = w.l10n.firstDayOfWeek, t = n(w.l10n.weekdays.shorthand); e > 0 && e < t.length && (t = n(t.splice(e, t.length), t.splice(0, e))); for (var a = w.config.showMonths; a--;)w.weekdayContainer.children[a].innerHTML = "\n \n " + t.join("") + "\n \n " } } function Z(e, n) { void 0 === n && (n = !0); var t = n ? e : e - w.currentMonth; t < 0 && !0 === w._hidePrevMonthArrow || t > 0 && !0 === w._hideNextMonthArrow || (w.currentMonth += t, (w.currentMonth < 0 || w.currentMonth > 11) && (w.currentYear += w.currentMonth > 11 ? 1 : -1, w.currentMonth = (w.currentMonth + 12) % 12, De("onYearChange"), q()), U(), De("onMonthChange"), Ce()) } function Q(e) { return w.calendarContainer.contains(e) } function X(e) { if (w.isOpen && !w.config.inline) { var n = g(e), t = Q(n), a = !(n === w.input || n === w.altInput || w.element.contains(n) || e.path && e.path.indexOf && (~e.path.indexOf(w.input) || ~e.path.indexOf(w.altInput))) && !t && !Q(e.relatedTarget), i = !w.config.ignoredFocusElements.some((function (e) { return e.contains(n) })); a && i && (w.config.allowInput && w.setDate(w._input.value, !1, w.config.altInput ? w.config.altFormat : w.config.dateFormat), void 0 !== w.timeContainer && void 0 !== w.minuteElement && void 0 !== w.hourElement && "" !== w.input.value && void 0 !== w.input.value && _(), w.close(), w.config && "range" === w.config.mode && 1 === w.selectedDates.length && w.clear(!1)) } } function ee(e) { if (!(!e || w.config.minDate && e < w.config.minDate.getFullYear() || w.config.maxDate && e > w.config.maxDate.getFullYear())) { var n = e, t = w.currentYear !== n; w.currentYear = n || w.currentYear, w.config.maxDate && w.currentYear === w.config.maxDate.getFullYear() ? w.currentMonth = Math.min(w.config.maxDate.getMonth(), w.currentMonth) : w.config.minDate && w.currentYear === w.config.minDate.getFullYear() && (w.currentMonth = Math.max(w.config.minDate.getMonth(), w.currentMonth)), t && (w.redraw(), De("onYearChange"), q()) } } function ne(e, n) { var t; void 0 === n && (n = !0); var a = w.parseDate(e, void 0, n); if (w.config.minDate && a && M(a, w.config.minDate, void 0 !== n ? n : !w.minDateHasTime) < 0 || w.config.maxDate && a && M(a, w.config.maxDate, void 0 !== n ? n : !w.maxDateHasTime) > 0) return !1; if (!w.config.enable && 0 === w.config.disable.length) return !0; if (void 0 === a) return !1; for (var i = !!w.config.enable, o = null !== (t = w.config.enable) && void 0 !== t ? t : w.config.disable, r = 0, l = void 0; r < o.length; r++) { if ("function" == typeof (l = o[r]) && l(a)) return i; if (l instanceof Date && void 0 !== a && l.getTime() === a.getTime()) return i; if ("string" == typeof l) { var c = w.parseDate(l, void 0, !0); return c && c.getTime() === a.getTime() ? i : !i } if ("object" == typeof l && void 0 !== a && l.from && l.to && a.getTime() >= l.from.getTime() && a.getTime() <= l.to.getTime()) return i } return !i } function te(e) { return void 0 !== w.daysContainer && (-1 === e.className.indexOf("hidden") && -1 === e.className.indexOf("flatpickr-disabled") && w.daysContainer.contains(e)) } function ae(e) { var n = e.target === w._input, t = w._input.value.trimEnd() !== Me(); !n || !t || e.relatedTarget && Q(e.relatedTarget) || w.setDate(w._input.value, !0, e.target === w.altInput ? w.config.altFormat : w.config.dateFormat) } function ie(e) { var n = g(e), t = w.config.wrap ? p.contains(n) : n === w._input, a = w.config.allowInput, i = w.isOpen && (!a || !t), o = w.config.inline && t && !a; if (13 === e.keyCode && t) { if (a) return w.setDate(w._input.value, !0, n === w.altInput ? w.config.altFormat : w.config.dateFormat), w.close(), n.blur(); w.open() } else if (Q(n) || i || o) { var r = !!w.timeContainer && w.timeContainer.contains(n); switch (e.keyCode) { case 13: r ? (e.preventDefault(), _(), fe()) : me(e); break; case 27: e.preventDefault(), fe(); break; case 8: case 46: t && !w.config.allowInput && (e.preventDefault(), w.clear()); break; case 37: case 39: if (r || t) w.hourElement && w.hourElement.focus(); else { e.preventDefault(); var l = k(); if (void 0 !== w.daysContainer && (!1 === a || l && te(l))) { var c = 39 === e.keyCode ? 1 : -1; e.ctrlKey ? (e.stopPropagation(), Z(c), J(B(1), 0)) : J(void 0, c) } } break; case 38: case 40: e.preventDefault(); var s = 40 === e.keyCode ? 1 : -1; w.daysContainer && void 0 !== n.$i || n === w.input || n === w.altInput ? e.ctrlKey ? (e.stopPropagation(), ee(w.currentYear - s), J(B(1), 0)) : r || J(void 0, 7 * s) : n === w.currentYearElement ? ee(w.currentYear - s) : w.config.enableTime && (!r && w.hourElement && w.hourElement.focus(), _(e), w._debouncedChange()); break; case 9: if (r) { var d = [w.hourElement, w.minuteElement, w.secondElement, w.amPM].concat(w.pluginElements).filter((function (e) { return e })), u = d.indexOf(n); if (-1 !== u) { var f = d[u + (e.shiftKey ? -1 : 1)]; e.preventDefault(), (f || w._input).focus() } } else !w.config.noCalendar && w.daysContainer && w.daysContainer.contains(n) && e.shiftKey && (e.preventDefault(), w._input.focus()) } } if (void 0 !== w.amPM && n === w.amPM) switch (e.key) { case w.l10n.amPM[0].charAt(0): case w.l10n.amPM[0].charAt(0).toLowerCase(): w.amPM.textContent = w.l10n.amPM[0], O(), ye(); break; case w.l10n.amPM[1].charAt(0): case w.l10n.amPM[1].charAt(0).toLowerCase(): w.amPM.textContent = w.l10n.amPM[1], O(), ye() }(t || Q(n)) && De("onKeyDown", e) } function oe(e, n) { if (void 0 === n && (n = "flatpickr-day"), 1 === w.selectedDates.length && (!e || e.classList.contains(n) && !e.classList.contains("flatpickr-disabled"))) { for (var t = e ? e.dateObj.getTime() : w.days.firstElementChild.dateObj.getTime(), a = w.parseDate(w.selectedDates[0], void 0, !0).getTime(), i = Math.min(t, w.selectedDates[0].getTime()), o = Math.max(t, w.selectedDates[0].getTime()), r = !1, l = 0, c = 0, s = i; s < o; s += x)ne(new Date(s), !0) || (r = r || s > i && s < o, s < a && (!l || s > l) ? l = s : s > a && (!c || s < c) && (c = s)); Array.from(w.rContainer.querySelectorAll("*:nth-child(-n+" + w.config.showMonths + ") > ." + n)).forEach((function (n) { var i, o, s, d = n.dateObj.getTime(), u = l > 0 && d < l || c > 0 && d > c; if (u) return n.classList.add("notAllowed"), void ["inRange", "startRange", "endRange"].forEach((function (e) { n.classList.remove(e) })); r && !u || (["startRange", "inRange", "endRange", "notAllowed"].forEach((function (e) { n.classList.remove(e) })), void 0 !== e && (e.classList.add(t <= w.selectedDates[0].getTime() ? "startRange" : "endRange"), a < t && d === a ? n.classList.add("startRange") : a > t && d === a && n.classList.add("endRange"), d >= l && (0 === c || d <= c) && (o = a, s = t, (i = d) > Math.min(o, s) && i < Math.max(o, s)) && n.classList.add("inRange"))) })) } } function re() { !w.isOpen || w.config.static || w.config.inline || de() } function le(e) { return function (n) { var t = w.config["_" + e + "Date"] = w.parseDate(n, w.config.dateFormat), a = w.config["_" + ("min" === e ? "max" : "min") + "Date"]; void 0 !== t && (w["min" === e ? "minDateHasTime" : "maxDateHasTime"] = t.getHours() > 0 || t.getMinutes() > 0 || t.getSeconds() > 0), w.selectedDates && (w.selectedDates = w.selectedDates.filter((function (e) { return ne(e) })), w.selectedDates.length || "min" !== e || F(t), ye()), w.daysContainer && (ue(), void 0 !== t ? w.currentYearElement[e] = t.getFullYear().toString() : w.currentYearElement.removeAttribute(e), w.currentYearElement.disabled = !!a && void 0 !== t && a.getFullYear() === t.getFullYear()) } } function ce() { return w.config.wrap ? p.querySelector("[data-input]") : p } function se() { "object" != typeof w.config.locale && void 0 === I.l10ns[w.config.locale] && w.config.errorHandler(new Error("flatpickr: invalid locale " + w.config.locale)), w.l10n = e(e({}, I.l10ns.default), "object" == typeof w.config.locale ? w.config.locale : "default" !== w.config.locale ? I.l10ns[w.config.locale] : void 0), D.D = "(" + w.l10n.weekdays.shorthand.join("|") + ")", D.l = "(" + w.l10n.weekdays.longhand.join("|") + ")", D.M = "(" + w.l10n.months.shorthand.join("|") + ")", D.F = "(" + w.l10n.months.longhand.join("|") + ")", D.K = "(" + w.l10n.amPM[0] + "|" + w.l10n.amPM[1] + "|" + w.l10n.amPM[0].toLowerCase() + "|" + w.l10n.amPM[1].toLowerCase() + ")", void 0 === e(e({}, v), JSON.parse(JSON.stringify(p.dataset || {}))).time_24hr && void 0 === I.defaultConfig.time_24hr && (w.config.time_24hr = w.l10n.time_24hr), w.formatDate = b(w), w.parseDate = C({ config: w.config, l10n: w.l10n }) } function de(e) { if ("function" != typeof w.config.position) { if (void 0 !== w.calendarContainer) { De("onPreCalendarPosition"); var n = e || w._positionElement, t = Array.prototype.reduce.call(w.calendarContainer.children, (function (e, n) { return e + n.offsetHeight }), 0), a = w.calendarContainer.offsetWidth, i = w.config.position.split(" "), o = i[0], r = i.length > 1 ? i[1] : null, l = n.getBoundingClientRect(), c = window.innerHeight - l.bottom, d = "above" === o || "below" !== o && c < t && l.top > t, u = window.pageYOffset + l.top + (d ? -t - 2 : n.offsetHeight + 2); if (s(w.calendarContainer, "arrowTop", !d), s(w.calendarContainer, "arrowBottom", d), !w.config.inline) { var f = window.pageXOffset + l.left, m = !1, g = !1; "center" === r ? (f -= (a - l.width) / 2, m = !0) : "right" === r && (f -= a - l.width, g = !0), s(w.calendarContainer, "arrowLeft", !m && !g), s(w.calendarContainer, "arrowCenter", m), s(w.calendarContainer, "arrowRight", g); var p = window.document.body.offsetWidth - (window.pageXOffset + l.right), h = f + a > window.document.body.offsetWidth, v = p + a > window.document.body.offsetWidth; if (s(w.calendarContainer, "rightMost", h), !w.config.static) if (w.calendarContainer.style.top = u + "px", h) if (v) { var D = function () { for (var e = null, n = 0; n < document.styleSheets.length; n++) { var t = document.styleSheets[n]; if (t.cssRules) { try { t.cssRules } catch (e) { continue } e = t; break } } return null != e ? e : (a = document.createElement("style"), document.head.appendChild(a), a.sheet); var a }(); if (void 0 === D) return; var b = window.document.body.offsetWidth, C = Math.max(0, b / 2 - a / 2), M = D.cssRules.length, y = "{left:" + l.left + "px;right:auto;}"; s(w.calendarContainer, "rightMost", !1), s(w.calendarContainer, "centerMost", !0), D.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after" + y, M), w.calendarContainer.style.left = C + "px", w.calendarContainer.style.right = "auto" } else w.calendarContainer.style.left = "auto", w.calendarContainer.style.right = p + "px"; else w.calendarContainer.style.left = f + "px", w.calendarContainer.style.right = "auto" } } } else w.config.position(w, e) } function ue() { w.config.noCalendar || w.isMobile || (q(), Ce(), U()) } function fe() { w._input.focus(), -1 !== window.navigator.userAgent.indexOf("MSIE") || void 0 !== navigator.msMaxTouchPoints ? setTimeout(w.close, 0) : w.close() } function me(e) { e.preventDefault(), e.stopPropagation(); var n = f(g(e), (function (e) { return e.classList && e.classList.contains("flatpickr-day") && !e.classList.contains("flatpickr-disabled") && !e.classList.contains("notAllowed") })); if (void 0 !== n) { var t = n, a = w.latestSelectedDateObj = new Date(t.dateObj.getTime()), i = (a.getMonth() < w.currentMonth || a.getMonth() > w.currentMonth + w.config.showMonths - 1) && "range" !== w.config.mode; if (w.selectedDateElem = t, "single" === w.config.mode) w.selectedDates = [a]; else if ("multiple" === w.config.mode) { var o = be(a); o ? w.selectedDates.splice(parseInt(o), 1) : w.selectedDates.push(a) } else "range" === w.config.mode && (2 === w.selectedDates.length && w.clear(!1, !1), w.latestSelectedDateObj = a, w.selectedDates.push(a), 0 !== M(a, w.selectedDates[0], !0) && w.selectedDates.sort((function (e, n) { return e.getTime() - n.getTime() }))); if (O(), i) { var r = w.currentYear !== a.getFullYear(); w.currentYear = a.getFullYear(), w.currentMonth = a.getMonth(), r && (De("onYearChange"), q()), De("onMonthChange") } if (Ce(), U(), ye(), i || "range" === w.config.mode || 1 !== w.config.showMonths ? void 0 !== w.selectedDateElem && void 0 === w.hourElement && w.selectedDateElem && w.selectedDateElem.focus() : W(t), void 0 !== w.hourElement && void 0 !== w.hourElement && w.hourElement.focus(), w.config.closeOnSelect) { var l = "single" === w.config.mode && !w.config.enableTime, c = "range" === w.config.mode && 2 === w.selectedDates.length && !w.config.enableTime; (l || c) && fe() } Y() } } w.parseDate = C({ config: w.config, l10n: w.l10n }), w._handlers = [], w.pluginElements = [], w.loadedPlugins = [], w._bind = P, w._setHoursFromDate = F, w._positionCalendar = de, w.changeMonth = Z, w.changeYear = ee, w.clear = function (e, n) { void 0 === e && (e = !0); void 0 === n && (n = !0); w.input.value = "", void 0 !== w.altInput && (w.altInput.value = ""); void 0 !== w.mobileInput && (w.mobileInput.value = ""); w.selectedDates = [], w.latestSelectedDateObj = void 0, !0 === n && (w.currentYear = w._initialDate.getFullYear(), w.currentMonth = w._initialDate.getMonth()); if (!0 === w.config.enableTime) { var t = E(w.config), a = t.hours, i = t.minutes, o = t.seconds; A(a, i, o) } w.redraw(), e && De("onChange") }, w.close = function () { w.isOpen = !1, w.isMobile || (void 0 !== w.calendarContainer && w.calendarContainer.classList.remove("open"), void 0 !== w._input && w._input.classList.remove("active")); De("onClose") }, w.onMouseOver = oe, w._createElement = d, w.createDay = R, w.destroy = function () { void 0 !== w.config && De("onDestroy"); for (var e = w._handlers.length; e--;)w._handlers[e].remove(); if (w._handlers = [], w.mobileInput) w.mobileInput.parentNode && w.mobileInput.parentNode.removeChild(w.mobileInput), w.mobileInput = void 0; else if (w.calendarContainer && w.calendarContainer.parentNode) if (w.config.static && w.calendarContainer.parentNode) { var n = w.calendarContainer.parentNode; if (n.lastChild && n.removeChild(n.lastChild), n.parentNode) { for (; n.firstChild;)n.parentNode.insertBefore(n.firstChild, n); n.parentNode.removeChild(n) } } else w.calendarContainer.parentNode.removeChild(w.calendarContainer); w.altInput && (w.input.type = "text", w.altInput.parentNode && w.altInput.parentNode.removeChild(w.altInput), delete w.altInput); w.input && (w.input.type = w.input._type, w.input.classList.remove("flatpickr-input"), w.input.removeAttribute("readonly"));["_showTimeInput", "latestSelectedDateObj", "_hideNextMonthArrow", "_hidePrevMonthArrow", "__hideNextMonthArrow", "__hidePrevMonthArrow", "isMobile", "isOpen", "selectedDateElem", "minDateHasTime", "maxDateHasTime", "days", "daysContainer", "_input", "_positionElement", "innerContainer", "rContainer", "monthNav", "todayDateElem", "calendarContainer", "weekdayContainer", "prevMonthNav", "nextMonthNav", "monthsDropdownContainer", "currentMonthElement", "currentYearElement", "navigationCurrentMonth", "selectedDateElem", "config"].forEach((function (e) { try { delete w[e] } catch (e) { } })) }, w.isEnabled = ne, w.jumpToDate = j, w.updateValue = ye, w.open = function (e, n) { void 0 === n && (n = w._positionElement); if (!0 === w.isMobile) { if (e) { e.preventDefault(); var t = g(e); t && t.blur() } return void 0 !== w.mobileInput && (w.mobileInput.focus(), w.mobileInput.click()), void De("onOpen") } if (w._input.disabled || w.config.inline) return; var a = w.isOpen; w.isOpen = !0, a || (w.calendarContainer.classList.add("open"), w._input.classList.add("active"), De("onOpen"), de(n)); !0 === w.config.enableTime && !0 === w.config.noCalendar && (!1 !== w.config.allowInput || void 0 !== e && w.timeContainer.contains(e.relatedTarget) || setTimeout((function () { return w.hourElement.select() }), 50)) }, w.redraw = ue, w.set = function (e, n) { if (null !== e && "object" == typeof e) for (var a in Object.assign(w.config, e), e) void 0 !== ge[a] && ge[a].forEach((function (e) { return e() })); else w.config[e] = n, void 0 !== ge[e] ? ge[e].forEach((function (e) { return e() })) : t.indexOf(e) > -1 && (w.config[e] = c(n)); w.redraw(), ye(!0) }, w.setDate = function (e, n, t) { void 0 === n && (n = !1); void 0 === t && (t = w.config.dateFormat); if (0 !== e && !e || e instanceof Array && 0 === e.length) return w.clear(n); pe(e, t), w.latestSelectedDateObj = w.selectedDates[w.selectedDates.length - 1], w.redraw(), j(void 0, n), F(), 0 === w.selectedDates.length && w.clear(!1); ye(n), n && De("onChange") }, w.toggle = function (e) { if (!0 === w.isOpen) return w.close(); w.open(e) }; var ge = { locale: [se, G], showMonths: [V, S, z], minDate: [j], maxDate: [j], positionElement: [ve], clickOpens: [function () { !0 === w.config.clickOpens ? (P(w._input, "focus", w.open), P(w._input, "click", w.open)) : (w._input.removeEventListener("focus", w.open), w._input.removeEventListener("click", w.open)) }] }; function pe(e, n) { var t = []; if (e instanceof Array) t = e.map((function (e) { return w.parseDate(e, n) })); else if (e instanceof Date || "number" == typeof e) t = [w.parseDate(e, n)]; else if ("string" == typeof e) switch (w.config.mode) { case "single": case "time": t = [w.parseDate(e, n)]; break; case "multiple": t = e.split(w.config.conjunction).map((function (e) { return w.parseDate(e, n) })); break; case "range": t = e.split(w.l10n.rangeSeparator).map((function (e) { return w.parseDate(e, n) })) } else w.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(e))); w.selectedDates = w.config.allowInvalidPreload ? t : t.filter((function (e) { return e instanceof Date && ne(e, !1) })), "range" === w.config.mode && w.selectedDates.sort((function (e, n) { return e.getTime() - n.getTime() })) } function he(e) { return e.slice().map((function (e) { return "string" == typeof e || "number" == typeof e || e instanceof Date ? w.parseDate(e, void 0, !0) : e && "object" == typeof e && e.from && e.to ? { from: w.parseDate(e.from, void 0), to: w.parseDate(e.to, void 0) } : e })).filter((function (e) { return e })) } function ve() { w._positionElement = w.config.positionElement || w._input } function De(e, n) { if (void 0 !== w.config) { var t = w.config[e]; if (void 0 !== t && t.length > 0) for (var a = 0; t[a] && a < t.length; a++)t[a](w.selectedDates, w.input.value, w, n); "onChange" === e && (w.input.dispatchEvent(we("change")), w.input.dispatchEvent(we("input"))) } } function we(e) { var n = document.createEvent("Event"); return n.initEvent(e, !0, !0), n } function be(e) { for (var n = 0; n < w.selectedDates.length; n++) { var t = w.selectedDates[n]; if (t instanceof Date && 0 === M(t, e)) return "" + n } return !1 } function Ce() { w.config.noCalendar || w.isMobile || !w.monthNav || (w.yearElements.forEach((function (e, n) { var t = new Date(w.currentYear, w.currentMonth, 1); t.setMonth(w.currentMonth + n), w.config.showMonths > 1 || "static" === w.config.monthSelectorType ? w.monthElements[n].textContent = h(t.getMonth(), w.config.shorthandCurrentMonth, w.l10n) + " " : w.monthsDropdownContainer.value = t.getMonth().toString(), e.value = t.getFullYear().toString() })), w._hidePrevMonthArrow = void 0 !== w.config.minDate && (w.currentYear === w.config.minDate.getFullYear() ? w.currentMonth <= w.config.minDate.getMonth() : w.currentYear < w.config.minDate.getFullYear()), w._hideNextMonthArrow = void 0 !== w.config.maxDate && (w.currentYear === w.config.maxDate.getFullYear() ? w.currentMonth + 1 > w.config.maxDate.getMonth() : w.currentYear > w.config.maxDate.getFullYear())) } function Me(e) { var n = e || (w.config.altInput ? w.config.altFormat : w.config.dateFormat); return w.selectedDates.map((function (e) { return w.formatDate(e, n) })).filter((function (e, n, t) { return "range" !== w.config.mode || w.config.enableTime || t.indexOf(e) === n })).join("range" !== w.config.mode ? w.config.conjunction : w.l10n.rangeSeparator) } function ye(e) { void 0 === e && (e = !0), void 0 !== w.mobileInput && w.mobileFormatStr && (w.mobileInput.value = void 0 !== w.latestSelectedDateObj ? w.formatDate(w.latestSelectedDateObj, w.mobileFormatStr) : ""), w.input.value = Me(w.config.dateFormat), void 0 !== w.altInput && (w.altInput.value = Me(w.config.altFormat)), !1 !== e && De("onValueUpdate") } function xe(e) { var n = g(e), t = w.prevMonthNav.contains(n), a = w.nextMonthNav.contains(n); t || a ? Z(t ? -1 : 1) : w.yearElements.indexOf(n) >= 0 ? n.select() : n.classList.contains("arrowUp") ? w.changeYear(w.currentYear + 1) : n.classList.contains("arrowDown") && w.changeYear(w.currentYear - 1) } return function () { w.element = w.input = p, w.isOpen = !1, function () { var n = ["wrap", "weekNumbers", "allowInput", "allowInvalidPreload", "clickOpens", "time_24hr", "enableTime", "noCalendar", "altInput", "shorthandCurrentMonth", "inline", "static", "enableSeconds", "disableMobile"], i = e(e({}, JSON.parse(JSON.stringify(p.dataset || {}))), v), o = {}; w.config.parseDate = i.parseDate, w.config.formatDate = i.formatDate, Object.defineProperty(w.config, "enable", { get: function () { return w.config._enable }, set: function (e) { w.config._enable = he(e) } }), Object.defineProperty(w.config, "disable", { get: function () { return w.config._disable }, set: function (e) { w.config._disable = he(e) } }); var r = "time" === i.mode; if (!i.dateFormat && (i.enableTime || r)) { var l = I.defaultConfig.dateFormat || a.dateFormat; o.dateFormat = i.noCalendar || r ? "H:i" + (i.enableSeconds ? ":S" : "") : l + " H:i" + (i.enableSeconds ? ":S" : "") } if (i.altInput && (i.enableTime || r) && !i.altFormat) { var s = I.defaultConfig.altFormat || a.altFormat; o.altFormat = i.noCalendar || r ? "h:i" + (i.enableSeconds ? ":S K" : " K") : s + " h:i" + (i.enableSeconds ? ":S" : "") + " K" } Object.defineProperty(w.config, "minDate", { get: function () { return w.config._minDate }, set: le("min") }), Object.defineProperty(w.config, "maxDate", { get: function () { return w.config._maxDate }, set: le("max") }); var d = function (e) { return function (n) { w.config["min" === e ? "_minTime" : "_maxTime"] = w.parseDate(n, "H:i:S") } }; Object.defineProperty(w.config, "minTime", { get: function () { return w.config._minTime }, set: d("min") }), Object.defineProperty(w.config, "maxTime", { get: function () { return w.config._maxTime }, set: d("max") }), "time" === i.mode && (w.config.noCalendar = !0, w.config.enableTime = !0); Object.assign(w.config, o, i); for (var u = 0; u < n.length; u++)w.config[n[u]] = !0 === w.config[n[u]] || "true" === w.config[n[u]]; t.filter((function (e) { return void 0 !== w.config[e] })).forEach((function (e) { w.config[e] = c(w.config[e] || []).map(T) })), w.isMobile = !w.config.disableMobile && !w.config.inline && "single" === w.config.mode && !w.config.disable.length && !w.config.enable && !w.config.weekNumbers && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); for (u = 0; u < w.config.plugins.length; u++) { var f = w.config.plugins[u](w) || {}; for (var m in f) t.indexOf(m) > -1 ? w.config[m] = c(f[m]).map(T).concat(w.config[m]) : void 0 === i[m] && (w.config[m] = f[m]) } i.altInputClass || (w.config.altInputClass = ce().className + " " + w.config.altInputClass); De("onParseConfig") }(), se(), function () { if (w.input = ce(), !w.input) return void w.config.errorHandler(new Error("Invalid input element specified")); w.input._type = w.input.type, w.input.type = "text", w.input.classList.add("flatpickr-input"), w._input = w.input, w.config.altInput && (w.altInput = d(w.input.nodeName, w.config.altInputClass), w._input = w.altInput, w.altInput.placeholder = w.input.placeholder, w.altInput.disabled = w.input.disabled, w.altInput.required = w.input.required, w.altInput.tabIndex = w.input.tabIndex, w.altInput.type = "text", w.input.setAttribute("type", "hidden"), !w.config.static && w.input.parentNode && w.input.parentNode.insertBefore(w.altInput, w.input.nextSibling)); w.config.allowInput || w._input.setAttribute("readonly", "readonly"); ve() }(), function () { w.selectedDates = [], w.now = w.parseDate(w.config.now) || new Date; var e = w.config.defaultDate || ("INPUT" !== w.input.nodeName && "TEXTAREA" !== w.input.nodeName || !w.input.placeholder || w.input.value !== w.input.placeholder ? w.input.value : null); e && pe(e, w.config.dateFormat); w._initialDate = w.selectedDates.length > 0 ? w.selectedDates[0] : w.config.minDate && w.config.minDate.getTime() > w.now.getTime() ? w.config.minDate : w.config.maxDate && w.config.maxDate.getTime() < w.now.getTime() ? w.config.maxDate : w.now, w.currentYear = w._initialDate.getFullYear(), w.currentMonth = w._initialDate.getMonth(), w.selectedDates.length > 0 && (w.latestSelectedDateObj = w.selectedDates[0]); void 0 !== w.config.minTime && (w.config.minTime = w.parseDate(w.config.minTime, "H:i")); void 0 !== w.config.maxTime && (w.config.maxTime = w.parseDate(w.config.maxTime, "H:i")); w.minDateHasTime = !!w.config.minDate && (w.config.minDate.getHours() > 0 || w.config.minDate.getMinutes() > 0 || w.config.minDate.getSeconds() > 0), w.maxDateHasTime = !!w.config.maxDate && (w.config.maxDate.getHours() > 0 || w.config.maxDate.getMinutes() > 0 || w.config.maxDate.getSeconds() > 0) }(), w.utils = { getDaysInMonth: function (e, n) { return void 0 === e && (e = w.currentMonth), void 0 === n && (n = w.currentYear), 1 === e && (n % 4 == 0 && n % 100 != 0 || n % 400 == 0) ? 29 : w.l10n.daysInMonth[e] } }, w.isMobile || function () { var e = window.document.createDocumentFragment(); if (w.calendarContainer = d("div", "flatpickr-calendar"), w.calendarContainer.tabIndex = -1, !w.config.noCalendar) { if (e.appendChild((w.monthNav = d("div", "flatpickr-months"), w.yearElements = [], w.monthElements = [], w.prevMonthNav = d("span", "flatpickr-prev-month"), w.prevMonthNav.innerHTML = w.config.prevArrow, w.nextMonthNav = d("span", "flatpickr-next-month"), w.nextMonthNav.innerHTML = w.config.nextArrow, V(), Object.defineProperty(w, "_hidePrevMonthArrow", { get: function () { return w.__hidePrevMonthArrow }, set: function (e) { w.__hidePrevMonthArrow !== e && (s(w.prevMonthNav, "flatpickr-disabled", e), w.__hidePrevMonthArrow = e) } }), Object.defineProperty(w, "_hideNextMonthArrow", { get: function () { return w.__hideNextMonthArrow }, set: function (e) { w.__hideNextMonthArrow !== e && (s(w.nextMonthNav, "flatpickr-disabled", e), w.__hideNextMonthArrow = e) } }), w.currentYearElement = w.yearElements[0], Ce(), w.monthNav)), w.innerContainer = d("div", "flatpickr-innerContainer"), w.config.weekNumbers) { var n = function () { w.calendarContainer.classList.add("hasWeeks"); var e = d("div", "flatpickr-weekwrapper"); e.appendChild(d("span", "flatpickr-weekday", w.l10n.weekAbbreviation)); var n = d("div", "flatpickr-weeks"); return e.appendChild(n), { weekWrapper: e, weekNumbers: n } }(), t = n.weekWrapper, a = n.weekNumbers; w.innerContainer.appendChild(t), w.weekNumbers = a, w.weekWrapper = t } w.rContainer = d("div", "flatpickr-rContainer"), w.rContainer.appendChild(z()), w.daysContainer || (w.daysContainer = d("div", "flatpickr-days"), w.daysContainer.tabIndex = -1), U(), w.rContainer.appendChild(w.daysContainer), w.innerContainer.appendChild(w.rContainer), e.appendChild(w.innerContainer) } w.config.enableTime && e.appendChild(function () { w.calendarContainer.classList.add("hasTime"), w.config.noCalendar && w.calendarContainer.classList.add("noCalendar"); var e = E(w.config); w.timeContainer = d("div", "flatpickr-time"), w.timeContainer.tabIndex = -1; var n = d("span", "flatpickr-time-separator", ":"), t = m("flatpickr-hour", { "aria-label": w.l10n.hourAriaLabel }); w.hourElement = t.getElementsByTagName("input")[0]; var a = m("flatpickr-minute", { "aria-label": w.l10n.minuteAriaLabel }); w.minuteElement = a.getElementsByTagName("input")[0], w.hourElement.tabIndex = w.minuteElement.tabIndex = -1, w.hourElement.value = o(w.latestSelectedDateObj ? w.latestSelectedDateObj.getHours() : w.config.time_24hr ? e.hours : function (e) { switch (e % 24) { case 0: case 12: return 12; default: return e % 12 } }(e.hours)), w.minuteElement.value = o(w.latestSelectedDateObj ? w.latestSelectedDateObj.getMinutes() : e.minutes), w.hourElement.setAttribute("step", w.config.hourIncrement.toString()), w.minuteElement.setAttribute("step", w.config.minuteIncrement.toString()), w.hourElement.setAttribute("min", w.config.time_24hr ? "0" : "1"), w.hourElement.setAttribute("max", w.config.time_24hr ? "23" : "12"), w.hourElement.setAttribute("maxlength", "2"), w.minuteElement.setAttribute("min", "0"), w.minuteElement.setAttribute("max", "59"), w.minuteElement.setAttribute("maxlength", "2"), w.timeContainer.appendChild(t), w.timeContainer.appendChild(n), w.timeContainer.appendChild(a), w.config.time_24hr && w.timeContainer.classList.add("time24hr"); if (w.config.enableSeconds) { w.timeContainer.classList.add("hasSeconds"); var i = m("flatpickr-second"); w.secondElement = i.getElementsByTagName("input")[0], w.secondElement.value = o(w.latestSelectedDateObj ? w.latestSelectedDateObj.getSeconds() : e.seconds), w.secondElement.setAttribute("step", w.minuteElement.getAttribute("step")), w.secondElement.setAttribute("min", "0"), w.secondElement.setAttribute("max", "59"), w.secondElement.setAttribute("maxlength", "2"), w.timeContainer.appendChild(d("span", "flatpickr-time-separator", ":")), w.timeContainer.appendChild(i) } w.config.time_24hr || (w.amPM = d("span", "flatpickr-am-pm", w.l10n.amPM[r((w.latestSelectedDateObj ? w.hourElement.value : w.config.defaultHour) > 11)]), w.amPM.title = w.l10n.toggleTitle, w.amPM.tabIndex = -1, w.timeContainer.appendChild(w.amPM)); return w.timeContainer }()); s(w.calendarContainer, "rangeMode", "range" === w.config.mode), s(w.calendarContainer, "animate", !0 === w.config.animate), s(w.calendarContainer, "multiMonth", w.config.showMonths > 1), w.calendarContainer.appendChild(e); var i = void 0 !== w.config.appendTo && void 0 !== w.config.appendTo.nodeType; if ((w.config.inline || w.config.static) && (w.calendarContainer.classList.add(w.config.inline ? "inline" : "static"), w.config.inline && (!i && w.element.parentNode ? w.element.parentNode.insertBefore(w.calendarContainer, w._input.nextSibling) : void 0 !== w.config.appendTo && w.config.appendTo.appendChild(w.calendarContainer)), w.config.static)) { var l = d("div", "flatpickr-wrapper"); w.element.parentNode && w.element.parentNode.insertBefore(l, w.element), l.appendChild(w.element), w.altInput && l.appendChild(w.altInput), l.appendChild(w.calendarContainer) } w.config.static || w.config.inline || (void 0 !== w.config.appendTo ? w.config.appendTo : window.document.body).appendChild(w.calendarContainer) }(), function () { w.config.wrap && ["open", "close", "toggle", "clear"].forEach((function (e) { Array.prototype.forEach.call(w.element.querySelectorAll("[data-" + e + "]"), (function (n) { return P(n, "click", w[e]) })) })); if (w.isMobile) return void function () { var e = w.config.enableTime ? w.config.noCalendar ? "time" : "datetime-local" : "date"; w.mobileInput = d("input", w.input.className + " flatpickr-mobile"), w.mobileInput.tabIndex = 1, w.mobileInput.type = e, w.mobileInput.disabled = w.input.disabled, w.mobileInput.required = w.input.required, w.mobileInput.placeholder = w.input.placeholder, w.mobileFormatStr = "datetime-local" === e ? "Y-m-d\\TH:i:S" : "date" === e ? "Y-m-d" : "H:i:S", w.selectedDates.length > 0 && (w.mobileInput.defaultValue = w.mobileInput.value = w.formatDate(w.selectedDates[0], w.mobileFormatStr)); w.config.minDate && (w.mobileInput.min = w.formatDate(w.config.minDate, "Y-m-d")); w.config.maxDate && (w.mobileInput.max = w.formatDate(w.config.maxDate, "Y-m-d")); w.input.getAttribute("step") && (w.mobileInput.step = String(w.input.getAttribute("step"))); w.input.type = "hidden", void 0 !== w.altInput && (w.altInput.type = "hidden"); try { w.input.parentNode && w.input.parentNode.insertBefore(w.mobileInput, w.input.nextSibling) } catch (e) { } P(w.mobileInput, "change", (function (e) { w.setDate(g(e).value, !1, w.mobileFormatStr), De("onChange"), De("onClose") })) }(); var e = l(re, 50); w._debouncedChange = l(Y, 300), w.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent) && P(w.daysContainer, "mouseover", (function (e) { "range" === w.config.mode && oe(g(e)) })); P(w._input, "keydown", ie), void 0 !== w.calendarContainer && P(w.calendarContainer, "keydown", ie); w.config.inline || w.config.static || P(window, "resize", e); void 0 !== window.ontouchstart ? P(window.document, "touchstart", X) : P(window.document, "mousedown", X); P(window.document, "focus", X, { capture: !0 }), !0 === w.config.clickOpens && (P(w._input, "focus", w.open), P(w._input, "click", w.open)); void 0 !== w.daysContainer && (P(w.monthNav, "click", xe), P(w.monthNav, ["keyup", "increment"], N), P(w.daysContainer, "click", me)); if (void 0 !== w.timeContainer && void 0 !== w.minuteElement && void 0 !== w.hourElement) { var n = function (e) { return g(e).select() }; P(w.timeContainer, ["increment"], _), P(w.timeContainer, "blur", _, { capture: !0 }), P(w.timeContainer, "click", H), P([w.hourElement, w.minuteElement], ["focus", "click"], n), void 0 !== w.secondElement && P(w.secondElement, "focus", (function () { return w.secondElement && w.secondElement.select() })), void 0 !== w.amPM && P(w.amPM, "click", (function (e) { _(e) })) } w.config.allowInput && P(w._input, "blur", ae) }(), (w.selectedDates.length || w.config.noCalendar) && (w.config.enableTime && F(w.config.noCalendar ? w.latestSelectedDateObj : void 0), ye(!1)), S(); var n = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); !w.isMobile && n && de(), De("onReady") }(), w } function T(e, n) { for (var t = Array.prototype.slice.call(e).filter((function (e) { return e instanceof HTMLElement })), a = [], i = 0; i < t.length; i++) { var o = t[i]; try { if (null !== o.getAttribute("data-fp-omit")) continue; void 0 !== o._flatpickr && (o._flatpickr.destroy(), o._flatpickr = void 0), o._flatpickr = k(o, n || {}), a.push(o._flatpickr) } catch (e) { console.error(e) } } return 1 === a.length ? a[0] : a } "undefined" != typeof HTMLElement && "undefined" != typeof HTMLCollection && "undefined" != typeof NodeList && (HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (e) { return T(this, e) }, HTMLElement.prototype.flatpickr = function (e) { return T([this], e) }); var I = function (e, n) { return "string" == typeof e ? T(window.document.querySelectorAll(e), n) : e instanceof Node ? T([e], n) : T(e, n) }; return I.defaultConfig = {}, I.l10ns = { en: e({}, i), default: e({}, i) }, I.localize = function (n) { I.l10ns.default = e(e({}, I.l10ns.default), n) }, I.setDefaults = function (n) { I.defaultConfig = e(e({}, I.defaultConfig), n) }, I.parseDate = C({}), I.formatDate = b({}), I.compareDates = M, "undefined" != typeof jQuery && void 0 !== jQuery.fn && (jQuery.fn.flatpickr = function (e) { return T(this, e) }), Date.prototype.fp_incr = function (e) { return new Date(this.getFullYear(), this.getMonth(), this.getDate() + ("string" == typeof e ? parseInt(e, 10) : e)) }, "undefined" != typeof window && (window.flatpickr = I), I })); diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 2f4c238..207efc3 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -9,32 +9,28 @@ {{ config('app.name', 'Laravel') }} - - + + + + + + - - - - - - - @@ -58,10 +54,13 @@ @include('layouts.partials.notification-modal') - + + @include('layouts.partials.sidebar') + +
    @@ -109,20 +108,34 @@ + {{-- --}} - {{-- --}} + + + + - + + + + + + + + + {{-- + --}} + @@ -136,16 +149,14 @@ {{-- --}} - - {{-- - --}} - + @stack('js') + diff --git a/resources/views/layouts/partials/breadcrumb.blade.php b/resources/views/layouts/partials/breadcrumb.blade.php index 35585ae..a6de77a 100644 --- a/resources/views/layouts/partials/breadcrumb.blade.php +++ b/resources/views/layouts/partials/breadcrumb.blade.php @@ -9,7 +9,6 @@
    -
    diff --git a/resources/views/layouts/partials/footer.blade.php b/resources/views/layouts/partials/footer.blade.php index 6cbe225..cb46050 100644 --- a/resources/views/layouts/partials/footer.blade.php +++ b/resources/views/layouts/partials/footer.blade.php @@ -1,7 +1,7 @@