admin module added

This commit is contained in:
Dharmaraj Shrestha 2024-04-14 18:29:29 +05:45
parent c7c79e69a5
commit efe174e3b3
63 changed files with 1454 additions and 182 deletions

View File

@ -0,0 +1,85 @@
<?php
namespace Modules\Admin\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Admin\Repositories\AppreciationRepository;
class AppreciationController extends Controller
{
private $appreciationRepository;
public function __construct(AppreciationRepository $appreciationRepository)
{
$this->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)
{
//
}
}

View File

@ -22,7 +22,7 @@ class DepartmentsController extends Controller
$data = Departments::where('status', '<>', -1)->orderBy('display_order')->get(); $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) public function create(Request $request)
@ -30,7 +30,7 @@ class DepartmentsController extends Controller
$TableData = Departments::where('status', '<>', -1)->orderBy('display_order')->get(); $TableData = Departments::where('status', '<>', -1)->orderBy('display_order')->get();
$editable = false; $editable = false;
return view("admin.departments.edit", compact('TableData', 'editable')); return view("admin::departments.edit", compact('TableData', 'editable'));
} }
public function store(Request $request) public function store(Request $request)
@ -107,7 +107,7 @@ class DepartmentsController extends Controller
$data = Departments::findOrFail($id); $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(); $TableData = Departments::where('status', '<>', -1)->orderBy('display_order')->get();
$data = Departments::findOrFail($id); $data = Departments::findOrFail($id);
$editable = true; $editable = true;
return view("admin.departments.edit", compact('data', 'TableData', 'editable')); return view("admin::departments.edit", compact('data', 'TableData', 'editable'));
} }

View File

@ -0,0 +1,87 @@
<?php
namespace Modules\Admin\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Admin\Repositories\PromotionDemotionRepository;
class PromotionDemotionController extends Controller
{
private $promotionDemotionRepository;
public function __construct(PromotionDemotionRepository $promotionDemotionRepository)
{
$this->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');
}
}

View File

@ -0,0 +1,83 @@
<?php
namespace Modules\Admin\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Admin\Repositories\ResignationRepository;
class ResignationController extends Controller
{
private $resignationRepository;
public function __construct(ResignationRepository $resignationRepository)
{
$this->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)
{
//
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\AppreciationFactory;
class Appreciation extends Model
{
use HasFactory;
protected $table = 'tbl_appreciations';
protected $primaryKey = 'appreciation_id';
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'title',
'alias',
'type',
'employee_id',
'appreciated_by',
'appreciated_date',
'status',
'description',
'remarks',
];
}

View File

@ -0,0 +1,31 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\PromotionDemotionFactory;
class PromotionDemotion extends Model
{
use HasFactory;
protected $table = "tbl_promotion_demotions";
protected $primaryKey = "promotion_demotion_id";
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'employee_id',
'title',
'employee_id',
'old_designation_id',
'new_designation_id',
'type',
'status',
'description',
'remarks',
];
}

View File

@ -0,0 +1,31 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\ResignationFactory;
class Resignation extends Model
{
use HasFactory;
protected $table = 'tbl_resignations';
protected $primaryKey = 'resignation_id';
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'employee_id',
'resignation_date',
'approved_date',
'approved_by',
'description',
'remarks',
'status',
'createdBy',
'updatedBy',
];
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Admin\Repositories;
interface AppreciationInterface
{
public function findAll();
public function getAppreciationById($appreciationId);
public function delete($appreciationId);
public function create(array $AppreciationDetails);
public function update($appreciationId, array $newDetails);
}

View File

@ -0,0 +1,35 @@
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Appreciation;
class AppreciationRepository implements AppreciationInterface
{
public function findAll()
{
return Appreciation::get();
}
public function getAppreciationById($appreciationId)
{
return Appreciation::findOrFail($appreciationId);
}
public function delete($appreciationId)
{
Appreciation::destroy($appreciationId);
}
public function create(array $appreciationDetails)
{
return Appreciation::create($appreciationDetails);
}
public function update($appreciationId, array $newDetails)
{
return Appreciation::where('appreciation_id', $appreciationId)->update($newDetails);
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Admin\Repositories;
interface PromotionDemotionInterface
{
public function findAll();
public function getPromotionDemotionById($promotionDemotionId);
public function delete($promotionDemotionId);
public function create(array $PromotionDemotionDetails);
public function update($promotionDemotionId, array $newDetails);
}

View File

@ -0,0 +1,35 @@
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\PromotionDemotion;
class PromotionDemotionRepository implements PromotionDemotionInterface
{
public function findAll()
{
return PromotionDemotion::get();
}
public function getPromotionDemotionById($promotionDemotionId)
{
return PromotionDemotion::findOrFail($promotionDemotionId);
}
public function delete($promotionDemotionId)
{
PromotionDemotion::destroy($promotionDemotionId);
}
public function create(array $promotionDemotionDetails)
{
return PromotionDemotion::create($promotionDemotionDetails);
}
public function update($promotionDemotionId, array $newDetails)
{
return PromotionDemotion::where('promotion_demotion_id', $promotionDemotionId)->update($newDetails);
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Admin\Repositories;
interface ResignationInterface
{
public function findAll();
public function getResignationById($resignationId);
public function delete($resignationId);
public function create(array $ResignationDetails);
public function update($resignationId, array $newDetails);
}

View File

@ -0,0 +1,35 @@
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Resignation;
class ResignationRepository implements ResignationInterface
{
public function findAll()
{
return Resignation::get();
}
public function getResignationById($resignationId)
{
return Resignation::findOrFail($resignationId);
}
public function delete($resignationId)
{
Resignation::destroy($resignationId);
}
public function create(array $resignationDetails)
{
return Resignation::create($resignationDetails);
}
public function update($resignationId, array $newDetails)
{
return Resignation::where('resignation_id', $resignationId)->update($newDetails);
}
}

View File

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('tbl_promotion_demotions', function (Blueprint $table) {
$table->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');
}
};

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('tbl_appreciations', function (Blueprint $table) {
$table->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');
}
};

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('tbl_resignations', function (Blueprint $table) {
$table->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');
}
};

View File

@ -0,0 +1,23 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class='card'>
<div class='card-body'>
{{ html()->form('POST')->route('appreciation.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.appreciations.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,23 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class='card'>
<div class='card-body'>
{{ html()->modelForm($appreciation, 'PUT')->route('appreciation.update', $appreciation->appreciation_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.appreciations.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,75 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class="card">
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
<div class="flex-shrink-0">
<a href="{{ route('appreciation.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Create Appreciation</a>
</div>
</div>
<div class="card-body">
<table id="buttons-datatables" class="display table-sm table-bordered table">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">S.N</span></th>
<th class="tb-col"><span class="overline-title">Employee</span></th>
<th class="tb-col"><span class="overline-title">Appreciated Type</span></th>
<th class="tb-col"><span class="overline-title">Appreciated By</span></th>
<th class="tb-col"><span class="overline-title">Appreciated Date</span></th>
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
</th>
</tr>
</thead>
<tbody>
@foreach ($appreciationLists as $index => $item)
<tr>
<td class="tb-col">{{ $index + 1 }}</td>
<td class="tb-col">{{ $item->employee_id }}</td>
<td class="tb-col">{{ $item->type }}</td>
<td class="tb-col">{{ $item->appreciated_by }}</td>
<td class="tb-col">{{ $item->appreciated_date }}</td>
<td class="tb-col">
<div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
aria-expanded="false">
<i class="ri-more-fill align-middle"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{ route('appreciation.show', [$item->appreciation_id]) }}" class="dropdown-item"><i
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
</li>
<li><a href="{{ route('appreciation.edit', [$item->appreciation_id]) }}"
class="dropdown-item edit-item-btn"><i
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
Edit</a>
</li>
<li>
<a href="{{ route('appreciation.destroy', [$item->appreciation_id]) }}"
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
</a>
</li>
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,48 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class='card'>
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<div class="flex-shrink-0">
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<p><b>Job Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->job_description }}</span></p>
<p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->departments_id }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
@endSection

View File

@ -1,15 +1,14 @@
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class="card-header align-items-center d-flex">
<h2><?php echo label('View Details'); ?></h2> <h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('cities.index')); ?> <div class="flex-shrink-0">
<a href="{{ route('cities.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div> </div>
<div class='card-body'> <div class='card-body'>
<p><b>Districts Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->districts_id }}</span></p> <p><b>Districts Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->districts_id }}</span></p>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p> <p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p> <p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>

View File

@ -9,10 +9,12 @@
<!-- end page title --> <!-- end page title -->
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class="card-header align-items-center d-flex">
<h2><?php echo label('View Detail'); ?></h2> <h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('department.index')); ?> <div class="flex-shrink-0">
<a href="{{ route('department.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div> </div>
<div class='card-body'> <div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p> <p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>

View File

@ -0,0 +1,48 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => 'Designation'])
<!-- end page title -->
<div class='card'>
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<div class="flex-shrink-0">
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<p><b>Job Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->job_description }}</span></p>
<p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->departments_id }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
@endSection

View File

@ -0,0 +1,43 @@
<div class="row gy-3">
<div class="col-lg-4 col-md-6">
{{ html()->label('Title')->class('form-label') }}
{{ html()->text('title')->class('form-control')->placeholder('Enter Title') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Appreciation Type')->class('form-label') }}
{{ html()->select('type', [1 => 'Employee of the Month', 2 => 'Best Manger'])->class('form-select')->placeholder('Select Type') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Employee')->class('form-label') }}
{{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Appreciated By')->class('form-label') }}
{{ html()->select('appreciated_by')->class('form-select')->placeholder('Select Who Appreciated') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Appreciated Date')->class('form-label') }}
{{ html()->date('appreciated_date')->class('form-control')->placeholder('Select Date') }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('description')->class('form-control')->attributes(['rows' => 5]) }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Remarks')->class('form-label') }}
{{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 5]) }}
</div>
<div class="text-end">
{{ html()->button($editable ? 'Update' : 'Add Appreciation', 'submit')->class('btn btn-success') }}
</div>
</div>

View File

@ -0,0 +1,46 @@
<div class="row gy-3">
<div class="col-lg-4 col-md-6">
{{ html()->label('Title')->class('form-label') }}
{{ html()->text('title')->class('form-control')->placeholder('Enter Title') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Type')->class('form-label') }}
{{ html()->select('type', [1 => 'Promotion', 2 => 'Demotion'])->class('form-select')->placeholder('Select Type') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Employee')->class('form-label') }}
{{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Previous Designation')->class('form-label') }}
{{ html()->select('old_designation_id')->class('form-select')->placeholder('Select Previous Desgination') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('New Designation')->class('form-label') }}
{{ html()->select('new_designation_id')->class('form-select')->placeholder('Select New Desgination') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Date')->class('form-label') }}
{{ html()->date('date')->class('form-control')->placeholder('Select Date') }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('description')->class('form-control')->attributes(['rows' => 5]) }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Remarks')->class('form-label') }}
{{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 5]) }}
</div>
<div class="text-end">
{{ html()->button($editable ? 'Update' : 'Add Promotion/ Demotion', 'submit')->class('btn btn-success') }}
</div>
</div>

View File

@ -0,0 +1,26 @@
<div class="row gy-3">
<div class="col-lg-4 col-md-6">
{{ html()->label('Employee')->class('form-label') }}
{{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Resignation Date')->class('form-label') }}
{{ html()->date('resignation_date')->class('form-control')->placeholder('Select Resignation Date') }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Reason')->class('form-label') }}
{{ html()->textarea('description')->class('form-control')->placeholder('Write reason for resgination')->attributes(['rows' => 3]) }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Remarks')->class('form-label') }}
{{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 3]) }}
</div>
<div class="text-end">
{{ html()->button($editable ? 'Update' : 'Add Resignation', 'submit')->class('btn btn-success') }}
</div>
</div>

View File

@ -0,0 +1,23 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class='card'>
<div class='card-body'>
{{ html()->form('POST')->route('promotionDemotion.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.promotiondemotions.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,23 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class='card'>
<div class='card-body'>
{{ 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() }}
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,75 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => 'Promotion/ Demotion'])
<!-- end page title -->
<div class="card">
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">Promotion/ Demotion Lists</h5>
<div class="flex-shrink-0">
<a href="{{ route('promotionDemotion.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Create Promotion/ Demotion</a>
</div>
</div>
<div class="card-body">
<table id="buttons-datatables" class="display table-sm table-bordered table">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">S.N</span></th>
<th class="tb-col"><span class="overline-title">Title</span></th>
<th class="tb-col"><span class="overline-title">Employee</span></th>
<th class="tb-col" width="20%"><span class="overline-title">Previous Designation</span></th>
<th class="tb-col" width="20%"><span class="overline-title">New Designation</span></th>
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
</th>
</tr>
</thead>
<tbody>
@foreach ($promotionDemotionLists as $index => $item)
<tr>
<td class="tb-col">{{ $index + 1 }}</td>
<td class="tb-col">{{ $item->title }}</td>
<td class="tb-col">{{ $item->employee_id }}</td>
<td class="tb-col">{{ $item->old_promotion_demotion_id }}</td>
<td class="tb-col">{{ $item->new_promotion_demotion_id }}</td>
<td class="tb-col">
<div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
aria-expanded="false">
<i class="ri-more-fill align-middle"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{ route('promotionDemotion.show', [$item->promotion_demotion_id]) }}"
class="dropdown-item"><i class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
</li>
<li><a href="{{ route('promotionDemotion.edit', [$item->promotion_demotion_id]) }}"
class="dropdown-item edit-item-btn"><i
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
Edit</a>
</li>
<li>
<a href="{{ route('promotionDemotion.destroy', [$item->promotion_demotion_id]) }}"
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
</a>
</li>
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,48 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class='card'>
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<div class="flex-shrink-0">
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<p><b>Job Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->job_description }}</span></p>
<p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->departments_id }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
@endSection

View File

@ -0,0 +1,23 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class='card'>
<div class='card-body'>
{{ html()->form('POST')->route('resignation.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.resignations.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,23 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class='card'>
<div class='card-body'>
{{ html()->modelForm($resignation, 'PUT')->route('resignation.update', $resignation->resignation_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.resignations.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,77 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class="card">
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
<div class="flex-shrink-0">
<a href="{{ route('resignation.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Create Resignation</a>
</div>
</div>
<div class="card-body">
<table id="buttons-datatables" class="display table-sm table-bordered table">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">S.N</span></th>
<th class="tb-col"><span class="overline-title">Employee</span></th>
<th class="tb-col"><span class="overline-title">Resignation Date</span></th>
<th class="tb-col"><span class="overline-title">Approved Date</span></th>
<th class="tb-col"><span class="overline-title">Approved By</span></th>
<th class="tb-col"><span class="overline-title">Status</span></th>
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
</th>
</tr>
</thead>
<tbody>
@foreach ($resignationLists as $index => $item)
<tr>
<td class="tb-col">{{ $index + 1 }}</td>
<td class="tb-col">{{ $item->employee_id }}</td>
<td class="tb-col">{{ $item->resignation_date }}</td>
<td class="tb-col">{{ $item->approved_date }}</td>
<td class="tb-col">{{ $item->approved_by }}</td>
<td class="tb-col">{{ $item->status }}</td>
<td class="tb-col">
<div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
aria-expanded="false">
<i class="ri-more-fill align-middle"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{ route('resignation.show', [$item->resignation_id]) }}" class="dropdown-item"><i
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
</li>
<li><a href="{{ route('resignation.edit', [$item->resignation_id]) }}"
class="dropdown-item edit-item-btn"><i
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
Edit</a>
</li>
<li>
<a href="{{ route('resignation.destroy', [$item->resignation_id]) }}"
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
</a>
</li>
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,48 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class='card'>
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
<div class="flex-shrink-0">
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
</div>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<p><b>Job Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->job_description }}</span></p>
<p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->departments_id }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
@endSection

View File

@ -2,6 +2,9 @@
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Modules\Admin\Http\Controllers\AdminController; 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::group([], function () {
Route::resource('admin', AdminController::class)->names('admin'); 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'; require __DIR__ . '/route.countries.php';

View File

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class extends Migration {
{
/** /**
* Run the migrations. * Run the migrations.
*/ */
@ -43,6 +42,6 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::dropIfExists('employees'); Schema::dropIfExists('tbl_employees');
} }
}; };

View File

@ -5,19 +5,22 @@ namespace Modules\Leave\Http\Controllers;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Modules\Employee\Repositories\EmployeeInterface; use Modules\Employee\Repositories\EmployeeRepository;
use Modules\Leave\Repositories\LeaveInterface; use Modules\Leave\Repositories\LeaveRepository;
use Modules\Leave\Repositories\LeaveTypeRepository;
use Yoeunes\Toastr\Facades\Toastr; use Yoeunes\Toastr\Facades\Toastr;
class LeaveController extends Controller class LeaveController extends Controller
{ {
private $leaveRepository; private $leaveRepository;
private $employeeRepository; private $employeeRepository;
private $leaveTypeRepository;
public function __construct(LeaveInterface $leaveRepository, EmployeeInterface $employeeRepository) public function __construct(LeaveRepository $leaveRepository, EmployeeRepository $employeeRepository, LeaveTypeRepository $leaveTypeRepository)
{ {
$this->leaveRepository = $leaveRepository; $this->leaveRepository = $leaveRepository;
$this->employeeRepository = $employeeRepository; $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:access leaves|create leaves|edit leaves|delete leaves', ['only' => ['index', 'show']]);
$this->middleware('role_or_permission:create leaves', ['only' => ['create', 'store']]); $this->middleware('role_or_permission:create leaves', ['only' => ['create', 'store']]);
@ -42,7 +45,9 @@ class LeaveController extends Controller
public function create() public function create()
{ {
$data['title'] = 'Create Leave'; $data['title'] = 'Create Leave';
$data['editable'] = false;
$data['employeeList'] = $this->employeeRepository->pluck(); $data['employeeList'] = $this->employeeRepository->pluck();
$data['leaveTypeList'] = $this->leaveTypeRepository->pluck();
return view('leave::leave.create', $data); return view('leave::leave.create', $data);
} }
@ -76,6 +81,8 @@ class LeaveController extends Controller
{ {
$data['title'] = 'Edit Leave'; $data['title'] = 'Edit Leave';
$data['editable'] = true;
$data['leave'] = $this->leaveRepository->getLeaveById($id); $data['leave'] = $this->leaveRepository->getLeaveById($id);
return view('leave::leave.edit', $data); return view('leave::leave.edit', $data);

View File

@ -5,18 +5,14 @@ namespace Modules\Leave\Http\Controllers;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Modules\Leave\Repositories\LeaveInterface;
use Modules\Leave\Repositories\LeaveTypeInterface; use Modules\Leave\Repositories\LeaveTypeInterface;
class LeaveTypeController extends Controller class LeaveTypeController extends Controller
{ {
private $leaveRepository;
private $leaveTypeRepository; private $leaveTypeRepository;
public function __construct(LeaveInterface $leaveRepository, LeaveTypeInterface $leaveTypeRepository) public function __construct(LeaveTypeInterface $leaveTypeRepository)
{ {
$this->leaveRepository = $leaveRepository;
$this->leaveTypeRepository = $leaveTypeRepository; $this->leaveTypeRepository = $leaveTypeRepository;
} }
/** /**
@ -24,7 +20,8 @@ class LeaveTypeController extends Controller
*/ */
public function index() public function index()
{ {
$data['leaveTypes'] = $this->leaveTypeRepository->findAll(); $data['title'] = 'LeaveType List';
$data['leaveTypeLists'] = $this->leaveTypeRepository->findAll();
return view('leave::leave-type.index', $data); return view('leave::leave-type.index', $data);
} }
@ -35,6 +32,8 @@ class LeaveTypeController extends Controller
{ {
$data['title'] = 'Create LeaveType'; $data['title'] = 'Create LeaveType';
$data['editable'] = false;
return view('leave::leave-type.create', $data); return view('leave::leave-type.create', $data);
} }
@ -43,7 +42,12 @@ class LeaveTypeController extends Controller
*/ */
public function store(Request $request): RedirectResponse 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) public function edit($id)
{ {
return view('leave::leave-type.edit'); $data['editable'] = false;
$data['title'] = 'Edit LeaveType';
return view('leave::leave-type.edit', $data);
} }
/** /**

View File

@ -4,19 +4,12 @@ namespace Modules\Leave\Models;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Leave\Database\factories\LeaveTypeFactory;
class LeaveType extends Model class LeaveType extends Model
{ {
use HasFactory; use HasFactory;
/** protected $table = 'tbl_leave_types';
* The attributes that are mass assignable. protected $primaryKey = 'leave_type_id';
*/ protected $guarded = [];
protected $fillable = [];
protected static function newFactory(): LeaveTypeFactory
{
//return LeaveTypeFactory::new();
}
} }

View File

@ -4,9 +4,10 @@ namespace Modules\Leave\Repositories;
interface LeaveTypeInterface interface LeaveTypeInterface
{ {
public function pluck();
public function findAll(); public function findAll();
public function getLeaveById($leaveId); public function getLeaveTypeById($leaveTypeId);
public function delete($leaveId); public function delete($leaveTypeId);
public function create(array $LeaveDetails); public function create(array $LeaveTypeDetails);
public function update($leaveId, array $newDetails); public function update($leaveTypeId, array $newDetails);
} }

View File

@ -6,29 +6,33 @@ use Modules\Leave\Models\LeaveType;
class LeaveTypeRepository implements LeaveTypeInterface class LeaveTypeRepository implements LeaveTypeInterface
{ {
public function pluck()
{
return LeaveType::pluck('title', 'leave_type_id');
}
public function findAll() public function findAll()
{ {
return LeaveType::get(); 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);
} }
} }

View File

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class extends Migration {
{
/** /**
* Run the migrations. * Run the migrations.
*/ */
@ -17,6 +16,12 @@ return new class extends Migration
$table->unsignedBigInteger('leave_type_id'); $table->unsignedBigInteger('leave_type_id');
$table->date('start_date')->nullable(); $table->date('start_date')->nullable();
$table->date('end_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(); $table->timestamps();
}); });
} }

View File

@ -7,12 +7,12 @@
@include('layouts.partials.breadcrumb', ['title' => $title]) @include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title --> <!-- end page title -->
<div class="row"> <div class="row">
<div class="col-lg-8"> <div class="col-lg-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<form action="{{ route('leaveType.store') }}" class="needs-validation" novalidate method="post"> <form action="{{ route('leaveType.store') }}" class="needs-validation" novalidate method="post">
@csrf @csrf
@include('leave::leave.partials.action') @include('leave::leave-type.partials.action')
</form> </form>
</div> </div>
</div> </div>

View File

@ -27,7 +27,7 @@
{{ html()->modelForm($leave, 'PUT')->route('leave.update', $leave->id)->class(['needs-validation'])->attributes(['novalidate'])->open() }} {{ 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() }} {{ html()->closeModelForm() }}

View File

@ -3,13 +3,15 @@
@section('content') @section('content')
<div class="page-content"> <div class="page-content">
<div class="container-fluid"> <div class="container-fluid">
<!-- start page title -->
@include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title -->
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="card"> <div class="card">
<div class="card-header align-items-center d-flex"> <div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">Leave Lists</h5> <h5 class="card-title flex-grow-1 mb-0">LeaveType Lists</h5>
<div class="flex-shrink-0"> <div class="flex-shrink-0">
<a href="{{ route('leaveType.create') }}" class="btn btn-success waves-effect waves-light"><i <a href="{{ route('leaveType.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Add</a> class="ri-add-fill me-1 align-bottom"></i> Add</a>
@ -22,19 +24,16 @@
<thead> <thead>
<tr> <tr>
<th>S.N</th> <th>S.N</th>
<th>Leave Type</th> <th>Title</th>
<th>Created By</th>
<th>Status</th> <th>Status</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@forelse ($leaveTypes as $key => $leaveType) @forelse ($leaveTypeLists as $key => $leaveType)
<tr> <tr>
<td>{{ $key + 1 }}</td> <td>{{ $key + 1 }}</td>
<td>{{ $leaveType->employee_id }}</td> <td>{{ $leaveType->title }}</td>
<td>{{ $leaveType->start_date }}</td>
<td>{{ $leaveType->end_date }}</td>
<td>{{ $leaveType->created_at }}</td> <td>{{ $leaveType->created_at }}</td>
<td> <td>
<div class="hstack flex-wrap gap-3"> <div class="hstack flex-wrap gap-3">
@ -42,12 +41,12 @@
data-bs-target="#viewModal"> data-bs-target="#viewModal">
<i class="ri-eye-line"></i> <i class="ri-eye-line"></i>
</a> </a>
<a href="{{ route('leaveType.edit', $leaveType->leaveType_id) }}" <a href="{{ route('leaveType.edit', $leaveType->leave_type_id) }}"
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a> class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
<a href="javascript:void(0);" <a href="javascript:void(0);"
data-link="{{ route('leaveType.destroy', $leaveType->leaveType_id) }}" data-link="{{ route('leaveType.destroy', $leaveType->leave_type_id) }}"
data-id="{{ $leaveType->leave_id }}" class="link-danger fs-15 remove-item-btn"><i data-id="{{ $leaveType->leave_type_id }}" class="link-danger fs-15 remove-item-btn"><i
class="ri-delete-bin-line"></i></a> class="ri-delete-bin-line"></i></a>
</div> </div>

View File

@ -1,23 +1,12 @@
<div class="mb-3"> <div class="row">
<div class="col-md-4">
<label for="employee_id" class="form-label">Employee Name</label> {{ html()->label('Title')->class('form-label') }}
{{ html()->select('employee_id', $employeeList)->class('form-select')->placeholder('Select Employee') }} {{ html()->text('title')->class('form-control')->placeholder('Enter Leave Type') }}
</div> </div>
<div class="mb-3">
<label for="start_date" class="form-label">Start Leave Date</label>
<input type="date" class="form-control" id="start_date" name="start_date"
value="{{ old('start_date', $leave->start_date ?? '') }}">
</div>
<div class="mb-3">
<label for="end_date" class="form-label">End Leave Date</label>
<input type="date" class="form-control" id="end_date" name="end_date"
value="{{ old('end_date', $leave->end_date ?? '') }}">
</div> </div>
<div class="text-end"> <div class="text-end">
<button type="submit" class="btn btn-primary">{{ isset($leave) ? 'Update' : 'Add Leave' }}</button> <button type="submit" class="btn btn-primary">{{ $editable ? 'Update' : 'Add Leave Type' }}</button>
</div> </div>
@push('js') @push('js')

View File

@ -6,7 +6,7 @@
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="{{ route('leave.store') }}" class="needs-validation" novalidate method="post"> <form action="{{ route('leave-t.store') }}" class="needs-validation" novalidate method="post">
@csrf @csrf
@include('leave::leave.partials.action') @include('leave::leave.partials.action')
</form> </form>

View File

@ -7,7 +7,7 @@
@include('layouts.partials.breadcrumb', ['title' => $title]) @include('layouts.partials.breadcrumb', ['title' => $title])
<!-- end page title --> <!-- end page title -->
<div class="row"> <div class="row">
<div class="col-lg-8"> <div class="col-lg-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<form action="{{ route('leave.store') }}" class="needs-validation" novalidate method="post"> <form action="{{ route('leave.store') }}" class="needs-validation" novalidate method="post">

View File

@ -15,7 +15,6 @@
<li class="breadcrumb-item active">{{ $title }}</li> <li class="breadcrumb-item active">{{ $title }}</li>
</ol> </ol>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -50,7 +50,7 @@
<h5 class="card-title flex-grow-1 mb-0">Leave Lists</h5> <h5 class="card-title flex-grow-1 mb-0">Leave Lists</h5>
<div class="flex-shrink-0"> <div class="flex-shrink-0">
<a href="{{ route('leave.create') }}" class="btn btn-success waves-effect waves-light"><i <a href="{{ route('leave.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Add</a> class="ri-add-fill me-1 align-bottom"></i> Apply Leave</a>
</div> </div>
</div> </div>
@ -104,5 +104,5 @@
</div> </div>
</div> </div>
<!-- container-fluid --> <!-- container-fluid -->
@include('leave::leave.partials.view') {{-- @include('leave::leave.partials.view') --}}
@endsection @endsection

View File

@ -1,22 +1,32 @@
<div class="mb-3"> <div class="row g-2">
<div class="col-md-6">
<label for="employee_id" class="form-label">Title</label> {{ html()->label('Leave Type')->class('form-label') }}
{{ html()->select('leave_type_id', $leaveTypeList)->class('form-select')->placeholder('Select Leave Type') }}
</div> </div>
<div class="mb-3"> <div class="col-md-6">
<label for="start_date" class="form-label">Start Leave Date</label> {{ html()->label('Employee')->class('form-label') }}
<input type="date" class="form-control" id="start_date" name="start_date" {{ html()->select('employee_id', [1 => 'Deepak'])->class('form-select')->placeholder('Select Employee') }}
value="{{ old('start_date', $leave->start_date ?? '') }}">
</div> </div>
<div class="mb-3"> <div class="col-md-6">
<label for="end_date" class="form-label">End Leave Date</label> {{ html()->label('Start Date')->class('form-label') }}
<input type="date" class="form-control" id="end_date" name="end_date" {{ html()->date('start_date')->class('form-control')->placeholder('Select Start Date') }}
value="{{ old('end_date', $leave->end_date ?? '') }}"> </div>
<div class="col-md-6">
{{ html()->label('Start Date')->class('form-label') }}
{{ html()->date('end_date')->class('form-control')->placeholder('Select Start Date') }}
</div>
<div class="col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('description')->class('form-control')->placeholder('Write Reason for Leave') }}
</div> </div>
<div class="text-end"> <div class="text-end">
<button type="submit" class="btn btn-primary">{{ isset($leave) ? 'Update' : 'Add Leave' }}</button> {{ html()->button($editable ? 'Update' : 'Add Leave', 'submit')->class('btn btn-success') }}
</div>
</div> </div>
@push('js') @push('js')

View File

@ -18,5 +18,4 @@ use Modules\Leave\Http\Controllers\LeaveTypeController;
Route::group([], function () { Route::group([], function () {
Route::resource('leave', LeaveController::class)->names('leave'); Route::resource('leave', LeaveController::class)->names('leave');
Route::resource('leave-type', LeaveTypeController::class)->names('leaveType'); Route::resource('leave-type', LeaveTypeController::class)->names('leaveType');
}); });

View File

@ -47,7 +47,8 @@ class OMIS
$activeClass = $isActive ? 'active' : ''; $activeClass = $isActive ? 'active' : '';
?> ?>
<li> <li>
<a class="nav-link menu-link <?php echo $activeClass; ?>" href="<?php echo $URL; ?>"><i class="ri-file-text-line "></i> <span data-key="t-landing"> <a class="nav-link menu-link <?php echo $activeClass; ?>" href="<?php echo $URL; ?>"><i
class="ri-file-text-line "></i> <span data-key="t-landing">
<?php echo $text; ?> <?php echo $text; ?>
</span></a> </span></a>
</li> </li>
@ -659,6 +660,7 @@ class OMIS
CREATE TABLE IF NOT EXISTS `tbl_designations` ( CREATE TABLE IF NOT EXISTS `tbl_designations` (
`designation_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `designation_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`title` varchar(255) DEFAULT NULL, `title` varchar(255) DEFAULT NULL,
`salary` DECIMAL(10, 2) DEFAULT NULL,
`alias` varchar(255) DEFAULT NULL, `alias` varchar(255) DEFAULT NULL,
`status` int(11) DEFAULT NULL, `status` int(11) DEFAULT NULL,
`remarks` text DEFAULT NULL, `remarks` text DEFAULT NULL,

View File

@ -1,38 +0,0 @@
@extends('layouts.app')
@section('content')
<div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2>
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('designations.index')); ?>
</div>
<div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<p><b>Job Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->job_description }}</span></p>
<p><b>Departments Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->departments_id }}</span></p>
<div class="d-flex justify-content-between">
<div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div>
<div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div>
</div>
</div>
</div>
@endSection

View File

@ -94,14 +94,15 @@
<ul class="nav nav-sm flex-column"> <ul class="nav nav-sm flex-column">
<li class="nav-item"> <li class="nav-item">
<a href="{{ route('leave.index') }}" <a href="{{ route('leaveType.index') }}"
class="nav-link @if (\Request::is('leave') || \Request::is('leave/*')) active @endif">Apply</a> class="nav-link @if (\Request::is('leavetype') || \Request::is('leavetype/*')) active @endif">Leave Type</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="{{ route('leaveType.index') }}" <a href="{{ route('leave.index') }}"
class="nav-link @if (\Request::is('leave-type') || \Request::is('leave-type/*')) active @endif">Leave Type</a> class="nav-link @if (\Request::is('leave') || \Request::is('leave/*')) active @endif">Apply Leave</a>
</li> </li>
</ul> </ul>
</div> </div>
</li> </li>
@ -124,6 +125,21 @@
class="nav-link @if (\Request::is('role') || \Request::is('role/*')) active @endif">Roles</a> class="nav-link @if (\Request::is('role') || \Request::is('role/*')) active @endif">Roles</a>
</li> </li>
<li class="nav-item">
<a href="{{ route('promotionDemotion.index') }}"
class="nav-link @if (\Request::is('promotion-demotion') || \Request::is('promotion-demotion/*')) active @endif">Promotion/ Demotions</a>
</li>
<li class="nav-item">
<a href="{{ route('appreciation.index') }}"
class="nav-link @if (\Request::is('appreciation') || \Request::is('appreciation/*')) active @endif">Appreciations</a>
</li>
<li class="nav-item">
<a href="{{ route('resignation.index') }}"
class="nav-link @if (\Request::is('resignation') || \Request::is('resignation/*')) active @endif">Resignations</a>
</li>
<li class="nav-item"> <li class="nav-item">
<a href="{{ route('countries.index') }}" <a href="{{ route('countries.index') }}"
class="nav-link @if (\Request::is('country') || \Request::is('country/*')) active @endif">Countries</a> class="nav-link @if (\Request::is('country') || \Request::is('country/*')) active @endif">Countries</a>

View File

@ -1,6 +1,7 @@
<?php <?php
use App\Http\Controllers\DepartmentsController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Modules\Admin\Http\Controllers\DepartmentsController;
Route::prefix("department")->group(function () { Route::prefix("department")->group(function () {
Route::get('/', [DepartmentsController::class, 'index'])->name('department.index'); Route::get('/', [DepartmentsController::class, 'index'])->name('department.index');
Route::get('/create', [DepartmentsController::class, 'create'])->name('department.create'); Route::get('/create', [DepartmentsController::class, 'create'])->name('department.create');

View File

@ -1,16 +1,17 @@
<?php <?php
use App\Http\Controllers\DesignationsController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
Route::prefix("designation")->group(function () { use Modules\Admin\Http\Controllers\DesignationsController;
Route::get('/', [DesignationsController::class, 'index'])->name('designation.index');
Route::get('/create', [DesignationsController::class, 'create'])->name('designation.create'); Route::prefix("designation")->as('designation.')->group(function () {
Route::post('/store', [DesignationsController::class, 'store'])->name('designation.store'); Route::get('/', [DesignationsController::class, 'index'])->name('index');
Route::post('/sort', [DesignationsController::class, 'sort'])->name('designation.sort'); Route::get('/create', [DesignationsController::class, 'create'])->name('create');
Route::post('/updatealias', [DesignationsController::class, 'updatealias'])->name('designation.updatealias'); Route::post('/store', [DesignationsController::class, 'store'])->name('store');
Route::get('/show/{id}', [DesignationsController::class, 'show'])->name('designation.show'); Route::post('/sort', [DesignationsController::class, 'sort'])->name('sort');
Route::get('/edit/{id}', [DesignationsController::class, 'edit'])->name('designation.edit') ; Route::post('/updatealias', [DesignationsController::class, 'updatealias'])->name('updatealias');
Route::post('/update/{id}', [DesignationsController::class, 'update'])->name('designation.update'); Route::get('/show/{id}', [DesignationsController::class, 'show'])->name('show');
Route::get('/destroy/{id}', [DesignationsController::class, 'destroy'])->name('designation.destroy'); Route::get('/edit/{id}', [DesignationsController::class, 'edit'])->name('edit');
Route::get('/toggle/{id}', [DesignationsController::class, 'toggle'])->name('designation.toggle'); Route::post('/update/{id}', [DesignationsController::class, 'update'])->name('update');
Route::get('/clone/{id}', [DesignationsController::class, 'clone'])->name('designation.clone'); Route::get('/destroy/{id}', [DesignationsController::class, 'destroy'])->name('destroy');
Route::get('/toggle/{id}', [DesignationsController::class, 'toggle'])->name('toggle');
Route::get('/clone/{id}', [DesignationsController::class, 'clone'])->name('clone');
}); });