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 + + + + + +