6 Commits

Author SHA1 Message Date
5c8cfeb854 status priority 2024-04-16 17:14:39 +05:45
de082f8bca pms module status dynamic 2024-04-16 16:59:18 +05:45
3f0d9a420b pms module setup 2024-04-16 11:38:27 +05:45
4a396e6f98 Merge branch 'omis_dharma' of ssh://bibgit.com:22022/dharmaraj/New-OMIS 2024-04-16 10:57:27 +05:45
442822e472 taxation module 2024-04-16 10:54:23 +05:45
d1851922ec complaint calendar transfer warning 2024-04-15 18:01:31 +05:45
115 changed files with 23078 additions and 165 deletions

View File

@ -0,0 +1,67 @@
<?php
namespace Modules\Admin\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class CalendarController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('admin::index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('admin::create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
//
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('admin::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('admin::edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}

View File

@ -34,7 +34,7 @@ class CompanyController extends Controller
*/
public function create()
{
$data['title'] = 'Create Companys';
$data['title'] = 'Create Company';
$data['editable'] = false;
$data['companyTypeLists'] = $this->adminService->pluckCompanyTypes();
return view('admin::companies.create', $data);

View File

@ -31,7 +31,7 @@ class ComplaintController extends Controller
*/
public function create()
{
$data['title'] = 'Create Complaints';
$data['title'] = 'Create Complaint';
$data['editable'] = false;
return view('admin::complaints.create', $data);
}
@ -65,7 +65,7 @@ class ComplaintController extends Controller
public function edit($id)
{
try {
$data['title'] = 'Edit Complaints';
$data['title'] = 'Edit Complaint';
$data['editable'] = true;
$data['complaint'] = $this->complaintRepository->getComplaintById($id);

View File

@ -0,0 +1,109 @@
<?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\EventRepository;
class EventController extends Controller
{
private $eventRepository;
public function __construct(EventRepository $eventRepository)
{
$this->eventRepository = $eventRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'Event Lists';
$data['eventLists'] = $this->eventRepository->findAll();
return view('admin::events.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create Event';
$data['editable'] = false;
return view('admin::events.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
try {
$this->eventRepository->create($request->all());
toastr()->success('Event Created Successfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('event.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('admin::events.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
try {
$data['title'] = 'Edit Event';
$data['editable'] = true;
$data['event'] = $this->eventRepository->getEventById($id);
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return view('admin::events.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
try {
$this->eventRepository->update($id, $request->all());
toastr()->success('Event Updated Successfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('event.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->eventRepository->delete($id);
toastr()->success('Event Deleted Successfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('event.index');
}
}

View File

@ -0,0 +1,109 @@
<?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\HolidayRepository;
class HolidayController extends Controller
{
private $holidayRepository;
public function __construct(HolidayRepository $holidayRepository)
{
$this->holidayRepository = $holidayRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'Holiday Lists';
$data['holidayLists'] = $this->holidayRepository->findAll();
return view('admin::holidays.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create Holiday';
$data['editable'] = false;
return view('admin::holidays.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
try {
$this->holidayRepository->create($request->all());
toastr()->success('Holiday Created Successfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('holiday.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('admin::holidays.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
try {
$data['title'] = 'Edit Holiday';
$data['editable'] = true;
$data['holiday'] = $this->holidayRepository->getHolidayById($id);
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return view('admin::holidays.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
try {
$this->holidayRepository->update($id, $request->all());
toastr()->success('Holiday Updated Successfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('holiday.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->holidayRepository->delete($id);
toastr()->success('Holiday Deleted Successfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('holiday.index');
}
}

View File

@ -31,7 +31,7 @@ class TransferController extends Controller
*/
public function create()
{
$data['title'] = 'Create Transfers';
$data['title'] = 'Create Transfer';
$data['editable'] = false;
return view('admin::transfers.create', $data);
}
@ -65,7 +65,7 @@ class TransferController extends Controller
public function edit($id)
{
try {
$data['title'] = 'Edit Transfers';
$data['title'] = 'Edit Transfer';
$data['editable'] = true;
$data['transfer'] = $this->transferRepository->getTransferById($id);

View File

@ -31,7 +31,7 @@ class WarningController extends Controller
*/
public function create()
{
$data['title'] = 'Create Warnings';
$data['title'] = 'Create Warning';
$data['editable'] = false;
return view('admin::warnings.create', $data);
}
@ -65,7 +65,7 @@ class WarningController extends Controller
public function edit($id)
{
try {
$data['title'] = 'Edit Warnings';
$data['title'] = 'Edit Warning';
$data['editable'] = true;
$data['warning'] = $this->warningRepository->getWarningById($id);

View File

@ -19,6 +19,10 @@ class Company extends Model
'title',
'alias',
'company_type_id',
'address',
'bank_name',
'bank_acc_no',
'bank_acc_branch',
'status',
'description',
'remarks',

View File

@ -0,0 +1,33 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\EventFactory;
class Event extends Model
{
use HasFactory;
protected $table = 'tbl_events';
protected $primaryKey = "event_id";
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'title',
'alias',
'type',
'date',
'start_time',
'end_time',
'location',
'status',
'description',
'remarks',
'createdBy',
'updatedBy',
];
}

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\HolidayFactory;
class Holiday extends Model
{
use HasFactory;
protected $table = 'tbl_holidays';
protected $primaryKey = "holiday_id";
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'title',
'alias',
'date',
'status',
'description',
'remarks',
'createdBy',
'updatedBy'
];
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Admin\Repositories;
interface EventInterface
{
public function findAll();
public function getEventById($eventId);
public function delete($eventId);
public function create(array $eventDetails);
public function update($eventId, array $newDetails);
}

View File

@ -0,0 +1,35 @@
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Event;
class EventRepository implements EventInterface
{
public function findAll()
{
return Event::get();
}
public function getEventById($eventId)
{
return Event::findOrFail($eventId);
}
public function delete($eventId)
{
Event::destroy($eventId);
}
public function create(array $eventDetails)
{
return Event::create($eventDetails);
}
public function update($eventId, array $newDetails)
{
return Event::where('event_id', $eventId)->update($newDetails);
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace Modules\Admin\Repositories;
interface HolidayInterface
{
public function findAll();
public function getHolidayById($holidayId);
public function delete($holidayId);
public function create(array $holidayDetails);
public function update($holidayId, array $newDetails);
}

View File

@ -0,0 +1,35 @@
<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Holiday;
class HolidayRepository implements HolidayInterface
{
public function findAll()
{
return Holiday::get();
}
public function getHolidayById($holidayId)
{
return Holiday::findOrFail($holidayId);
}
public function delete($holidayId)
{
Holiday::destroy($holidayId);
}
public function create(array $holidayDetails)
{
return Holiday::create($holidayDetails);
}
public function update($holidayId, array $newDetails)
{
return Holiday::where('holiday_id', $holidayId)->update($newDetails);
}
}

View File

@ -18,6 +18,9 @@ return new class extends Migration {
$table->integer('status')->nullable();
$table->mediumText('description')->nullable();
$table->mediumText('remarks')->nullable();
$table->string('bank_name')->nullable();
$table->string('bank_acc_no')->nullable();
$table->string('bank_acc_branch')->nullable();
$table->unsignedBigInteger('createdBy')->nullable();
$table->unsignedBigInteger('updatedBy')->nullable();
$table->timestamps();

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_events', function (Blueprint $table) {
$table->unsignedTinyInteger('event_id')->autoIncrement();
$table->string('title')->nullable();
$table->string('alias')->nullable();
$table->string('type')->nullable();
$table->string('date')->nullable();
$table->time('start_time')->nullable();
$table->time('end_time')->nullable();
$table->integer('status')->nullable();
$table->mediumText('description')->nullable();
$table->string('location')->nullable();
$table->mediumText('remarks')->nullable();
$table->unsignedBigInteger('createdBy')->nullable();
$table->unsignedBigInteger('updatedBy')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tbl_events');
}
};

View File

@ -0,0 +1,34 @@
<?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_holidays', function (Blueprint $table) {
$table->unsignedTinyInteger('holiday_id')->autoIncrement();
$table->string('title')->nullable();
$table->string('alias')->nullable();
$table->string('date')->nullable();
$table->integer('status')->nullable();
$table->mediumText('description')->nullable();
$table->mediumText('remarks')->nullable();
$table->unsignedBigInteger('createdBy')->nullable();
$table->unsignedBigInteger('updatedBy')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tbl_holidays');
}
};

File diff suppressed because it is too large Load Diff

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('event.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.events.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($event, 'PUT')->route('event.update', $event->event_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.events.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,76 @@
@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('event.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Create Event</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">Type</span></th>
<th class="tb-col"><span class="overline-title">Title</span></th>
<th class="tb-col"><span class="overline-title">Date</span></th>
<th class="tb-col"><span class="overline-title">Start Time</span></th>
<th class="tb-col"><span class="overline-title">Location</span></th>
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
</th>
</tr>
</thead>
<tbody>
@foreach ($eventLists as $index => $item)
<tr>
<td class="tb-col">{{ $index + 1 }}</td>
<td class="tb-col">{{ $item->type }}</td>
<td class="tb-col">{{ $item->title }}</td>
<td class="tb-col">{{ $item->date }}</td>
<td class="tb-col">{{ $item->start_time }}</td>
<td class="tb-col">{{ $item->location }}</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('event.show', [$item->event_id]) }}" class="dropdown-item"><i
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
</li>
<li><a href="{{ route('event.edit', [$item->event_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('event.destroy', [$item->event_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('holiday.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.holidays.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($holiday, 'PUT')->route('holiday.update', $holiday->holiday_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('admin::partials.holidays.action')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,71 @@
@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('holiday.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Create Holiday</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">Type</span></th>
<th class="tb-col"><span class="overline-title">Title</span></th>
<th class="tb-col"><span class="overline-title">Date</span></th>
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
</th>
</tr>
</thead>
<tbody>
@foreach ($holidayLists as $index => $item)
<tr>
<td class="tb-col">{{ $index + 1 }}</td>
<td class="tb-col">{{ $item->title }}</td>
<td class="tb-col">{{ $item->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('holiday.show', [$item->holiday_id]) }}" class="dropdown-item"><i
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
</li>
<li><a href="{{ route('holiday.edit', [$item->holiday_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('holiday.destroy', [$item->holiday_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,8 +1,8 @@
<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') }}
{{ html()->label('Name')->class('form-label') }}
{{ html()->text('title')->class('form-control')->placeholder('Company Name') }}
</div>
<div class="col-lg-4 col-md-6">
@ -10,17 +10,38 @@
{{ html()->select('company_type_id', $companyTypeLists)->class('form-select')->placeholder('Select Company Type') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Address')->class('form-label') }}
{{ html()->text('address')->class('form-control')->placeholder('Company Full Address') }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('description')->class('form-control')->attributes(['rows' => 5]) }}
{{ html()->textarea('description')->class('form-control')->placeholder('Company Description')->attributes(['rows' => 3]) }}
</div>
</div>
<div class="row">
<div class="col-md-12 py-4">
<h5 class="text-center">Bank Details</h5>
<div class="border-dash border"></div>
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Name')->class('form-label') }}
{{ html()->text('bank_name')->class('form-control')->placeholder('Bank Name') }}
</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 class="col-lg-4 col-md-6">
{{ html()->label('Account Number')->class('form-label') }}
{{ html()->text('bank_acc_no')->class('form-control')->placeholder('Bank Account Number') }}
</div>
<div class="text-end">
<div class="col-lg-4 col-md-6">
{{ html()->label('Branch')->class('form-label') }}
{{ html()->text('bank_acc_branch')->class('form-control')->placeholder('Branch Name') }}
</div>
<div class="text-end mt-4">
{{ html()->button($editable ? 'Update' : 'Add Company', 'submit')->class('btn btn-success') }}
</div>
</div>

View File

@ -0,0 +1,50 @@
<div class="row gy-3">
<div class="col-lg-4 col-md-6">
{{ html()->label('Event Type')->class('form-label') }}
{{ html()->select('type')->class('form-select')->placeholder('Select Event Type') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Title')->class('form-label') }}
{{ html()->text('title')->class('form-control')->placeholder('Event Title') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Date')->class('form-label') }}
<div class="input-group">
{{ html()->text('date')->class('form-control flatpickr flatpickr-input')->id('event-start-date')->placeholder('Select Event Date') }}
<span class="input-group-text"><i class="ri-calendar-event-line"></i></span>
</div>
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Start Time')->class('form-label') }}
{{ html()->time('start_time')->class('form-control')->placeholder('Event Start Time') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('End Time')->class('form-label') }}
{{ html()->time('end_time')->class('form-control')->placeholder('Event End Time') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Location')->class('form-label') }}
{{ html()->text('location')->class('form-control')->placeholder('Event Location') }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('description')->class('form-control')->placeholder('Event Description')->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 Event', 'submit')->class('btn btn-success') }}
</div>
</div>

View File

@ -0,0 +1,29 @@
<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('Holiday Title') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Date')->class('form-label') }}
<div class="input-group">
{{ html()->text('date')->class('form-control flatpickr flatpickr-input')->id('event-start-date')->placeholder('Select Holiday Date') }}
<span class="input-group-text"><i class="ri-calendar-event-line"></i></span>
</div>
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('description')->class('form-control')->placeholder('Holiday Description')->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 Holiday', 'submit')->class('btn btn-success') }}
</div>
</div>

View File

@ -3,9 +3,12 @@
use Illuminate\Support\Facades\Route;
use Modules\Admin\Http\Controllers\AdminController;
use Modules\Admin\Http\Controllers\AppreciationController;
use Modules\Admin\Http\Controllers\CalendarController;
use Modules\Admin\Http\Controllers\CompanyController;
use Modules\Admin\Http\Controllers\CompanyTypeController;
use Modules\Admin\Http\Controllers\ComplaintController;
use Modules\Admin\Http\Controllers\EventController;
use Modules\Admin\Http\Controllers\HolidayController;
use Modules\Admin\Http\Controllers\PromotionDemotionController;
use Modules\Admin\Http\Controllers\ResignationController;
use Modules\Admin\Http\Controllers\TransferController;
@ -32,6 +35,9 @@ Route::group([], function () {
Route::resource('warning', WarningController::class)->names('warning');
Route::resource('company', CompanyController::class)->names('company');
Route::resource('company-type', CompanyTypeController::class)->names('companyType');
Route::resource('event', EventController::class)->names('event');
Route::resource('holiday', HolidayController::class)->names('holiday');
Route::resource('calendar', CalendarController::class)->names('calendar');
});
require __DIR__ . '/route.countries.php';

View File

@ -10,7 +10,7 @@ class Employee extends Model
protected $table = 'tbl_employees';
protected $primaryKey = 'id';
protected $guarded = [];
protected $appends = (['full_name']);
protected $appends = ['full_name'];
protected function getFullNameAttribute()
{

View File

@ -2,6 +2,7 @@
namespace Modules\Employee\Repositories;
use Illuminate\Support\Facades\DB;
use Modules\Employee\Models\Employee;
class EmployeeRepository implements EmployeeInterface
@ -38,7 +39,7 @@ class EmployeeRepository implements EmployeeInterface
public function pluck()
{
return Employee::pluck('first_name', 'id');
return Employee::pluck(DB::raw('CONCAT(first_name," ", middle_name , " ",last_name) AS full_name'), 'id');
}
// public function uploadImage($file)

View File

@ -110,8 +110,14 @@ class LeaveController extends Controller
*/
public function destroy($id)
{
$this->leaveRepository->delete($id);
try {
$this->leaveRepository->delete($id);
toastr()->success('Leave Deleted Succesfully');
} catch (\Throwable $th) {
//throw $th;
toastr()->error($th->getMessage());
}
toastr()->success('Leave Deleted Succesfully');
}
}

View File

@ -0,0 +1,110 @@
<?php
namespace Modules\PMS\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\PMS\Models\Client;
use Modules\PMS\Repositories\ClientInterface;
class ClientController extends Controller
{
private $clientRepository;
public function __construct(ClientInterface $clientRepository)
{
$this->clientRepository = $clientRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'Client List';
$data['clients'] = $this->clientRepository->findAll();
return view('pms::client.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create Client';
$data['status'] = Client::STATUS;
$data['countryList'] = [1 => 'Nepal'];
return view('pms::client.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
$inputData = $request->all();
try {
$this->clientRepository->create($inputData);
toastr()->success('Client Created Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('client.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
$data['title'] = 'View Client';
$data['client'] = $this->clientRepository->getClientById($id);
$data['status'] = Client::STATUS;
$data['countryList'] = [1 => 'Nepal'];
return view('pms::client.show', $data);
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = 'Edit Client';
$data['client'] = $this->clientRepository->getClientById($id);
$data['status'] = Client::STATUS;
$data['countryList'] = [1 => 'Nepal'];
return view('pms::client.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
$inputData = $request->except(['_method', '_token']);
try {
$this->clientRepository->update($id, $inputData);
toastr()->success('Client Update Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('client.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->clientRepository->delete($id);
toastr()->success('Client Deleted Succesfully');
} catch (\Throwable $th) {
//throw $th;
toastr()->error($th->getMessage());
}
}
}

View File

@ -0,0 +1,67 @@
<?php
namespace Modules\PMS\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class PMSController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('pms::index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('pms::create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
//
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('pms::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('pms::edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}

View File

@ -0,0 +1,123 @@
<?php
namespace Modules\PMS\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\Employee\Repositories\EmployeeInterface;
use Modules\PMS\Models\Project;
use Modules\PMS\Repositories\ClientInterface;
use Modules\PMS\Repositories\ProjectInterface;
class ProjectController extends Controller
{
private $projectRepository;
private $clientRepository;
private $employeeRepository;
public function __construct(
ProjectInterface $projectRepository,
ClientInterface $clientRepository,
EmployeeInterface $employeeRepository) {
$this->projectRepository = $projectRepository;
$this->clientRepository = $clientRepository;
$this->employeeRepository = $employeeRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'Project List';
$data['projects'] = $this->projectRepository->findAll();
return view('pms::project.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create Project';
$data['status'] = Project::STATUS;
$data['categoryList'] = Project::CATEGORY;
$data['clientList'] = $this->clientRepository->pluck();
$data['memberList'] = $this->employeeRepository->pluck();
return view('pms::project.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
$inputData = $request->all();
try {
$this->projectRepository->create($inputData);
toastr()->success('Project Created Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('project.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
$data['title'] = 'View Project';
$data['project'] = $this->projectRepository->getProjectById($id);
$data['status'] = Project::STATUS;
$data['countryList'] = [1 => 'Nepal'];
return view('pms::project.show', $data);
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = 'Edit Project';
$data['project'] = $this->projectRepository->getProjectById($id);
$data['status'] = Project::STATUS;
$data['categoryList'] = Project::CATEGORY;
$data['clientList'] = $this->clientRepository->pluck();
$data['memberList'] = $this->employeeRepository->pluck();
return view('pms::project.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
$inputData = $request->except(['_method', '_token']);
try {
$this->projectRepository->update($id, $inputData);
toastr()->success('Project Update Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('project.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->projectRepository->delete($id);
toastr()->success('Project Deleted Succesfully');
} catch (\Throwable $th) {
//throw $th;
toastr()->error($th->getMessage());
}
}
}

View File

@ -0,0 +1,124 @@
<?php
namespace Modules\PMS\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\Employee\Repositories\EmployeeInterface;
use Modules\PMS\Models\Task;
use Modules\PMS\Repositories\ProjectInterface;
use Modules\PMS\Repositories\TaskInterface;
class TaskController extends Controller
{
private $taskRepository;
private $projectRepository;
private $employeeRepository;
public function __construct(
TaskInterface $taskRepository,
ProjectInterface $projectRepository,
EmployeeInterface $employeeRepository) {
$this->taskRepository = $taskRepository;
$this->projectRepository = $projectRepository;
$this->employeeRepository = $employeeRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'Task List';
$data['tasks'] = $this->taskRepository->findAll();
return view('pms::task.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create Task';
$data['status'] = Task::STATUS;
$data['priority'] = Task::PRIORITY;
$data['categoryList'] = Task::CATEGORY;
$data['projectList'] = $this->projectRepository->pluck();
$data['memberList'] = $this->employeeRepository->pluck();
return view('pms::task.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
$inputData = $request->all();
try {
$this->taskRepository->create($inputData);
toastr()->success('Task Created Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('task.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
$data['title'] = 'View Task';
$data['task'] = $this->taskRepository->getTaskById($id);
$data['status'] = Task::STATUS;
return view('pms::task.show', $data);
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = 'Edit Task';
$data['task'] = $this->taskRepository->getTaskById($id);
$data['status'] = Task::STATUS;
$data['priority'] = Task::PRIORITY;
$data['categoryList'] = Task::CATEGORY;
$data['projectList'] = $this->projectRepository->pluck();
$data['memberList'] = $this->employeeRepository->pluck();
return view('pms::task.edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
$inputData = $request->except(['_method', '_token']);
try {
$this->taskRepository->update($id, $inputData);
toastr()->success('Task Update Succesfully');
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return redirect()->route('task.index');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$this->taskRepository->delete($id);
toastr()->success('Task Deleted Succesfully');
} catch (\Throwable $th) {
//throw $th;
toastr()->error($th->getMessage());
}
}
}

View File

View File

@ -0,0 +1,26 @@
<?php
namespace Modules\PMS\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ClientRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
//
];
}
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
}

View File

View File

@ -0,0 +1,21 @@
<?php
namespace Modules\PMS\Models;
use App\Traits\CreatedUpdatedBy;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
class Client extends Model
{
use StatusTrait, CreatedUpdatedBy;
/**
* The attributes that are mass assignable.
*/
protected $table = 'tbl_clients';
protected $guarded = [];
protected $appends = ['status_name'];
}

View File

@ -0,0 +1,33 @@
<?php
namespace Modules\PMS\Models;
use App\Traits\CreatedUpdatedBy;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Model;
use Modules\Employee\Models\Employee;
class Project extends Model
{
use StatusTrait, CreatedUpdatedBy;
protected $table = 'tbl_projects';
protected $guarded = [];
protected $appends = ['status_name'];
const CATEGORY = [
10 => 'Vue',
11 => 'Laravel',
];
public function client()
{
return $this->belongsTo(Client::class, 'client_id');
}
public function members()
{
return $this->belongsTo(Employee::class, 'members_id');
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace Modules\PMS\Models;
use App\Traits\CreatedUpdatedBy;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Modules\Employee\Models\Employee;
class Task extends Model
{
use StatusTrait, CreatedUpdatedBy;
protected $table = 'tbl_tasks';
protected $guarded = [];
protected $appends = ['status_name', 'priority_status'];
const CATEGORY = [
10 => 'Vue',
11 => 'Laravel',
];
const PRIORITY = [
10 => 'High',
11 => 'Meduim',
12 => 'Low',
];
protected function priorityStatus(): Attribute
{
return Attribute::make(
get: function (mixed $value, array $attributes) {
switch ($attributes['priority']) {
case '10':
return '<span class="badge bg-danger">' . self::PRIORITY[$attributes['priority']] . '</span>';
break;
case '11':
return '<span class="badge bg-info">' . self::PRIORITY[$attributes['priority']] . '</span>';
break;
case '12':
return '<span class="badge bg-primary">' . self::PRIORITY[$attributes['priority']] . '</span>';
break;
default:
# code...
break;
}
},
set: fn($value) => $value,
);
}
public function project()
{
return $this->belongsTo(Project::class, 'project_id');
}
public function assigned()
{
return $this->belongsTo(Employee::class, 'assigned_id');
}
}

View File

View File

View File

@ -0,0 +1,123 @@
<?php
namespace Modules\PMS\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Modules\PMS\Repositories\ClientInterface;
use Modules\PMS\Repositories\ClientRepository;
use Modules\PMS\Repositories\ProjectInterface;
use Modules\PMS\Repositories\ProjectRepository;
use Modules\PMS\Repositories\TaskInterface;
use Modules\PMS\Repositories\TaskRepository;
class PMSServiceProvider extends ServiceProvider
{
protected string $moduleName = 'PMS';
protected string $moduleNameLower = 'pms';
/**
* Boot the application events.
*/
public function boot(): void
{
$this->registerCommands();
$this->registerCommandSchedules();
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations'));
}
/**
* Register the service provider.
*/
public function register(): void
{
$this->app->bind(ClientInterface::class, ClientRepository::class);
$this->app->bind(ProjectInterface::class, ProjectRepository::class);
$this->app->bind(TaskInterface::class, TaskRepository::class);
$this->app->register(RouteServiceProvider::class);
}
/**
* Register commands in the format of Command::class
*/
protected function registerCommands(): void
{
// $this->commands([]);
}
/**
* Register command Schedules.
*/
protected function registerCommandSchedules(): void
{
// $this->app->booted(function () {
// $schedule = $this->app->make(Schedule::class);
// $schedule->command('inspire')->hourly();
// });
}
/**
* Register translations.
*/
public function registerTranslations(): void
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
$this->loadJsonTranslationsFrom($langPath);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
}
}
/**
* Register config.
*/
protected function registerConfig(): void
{
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower . '.php')], 'config');
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
}
/**
* Register views.
*/
public function registerViews(): void
{
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'resources/views');
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower . '-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
$componentNamespace = str_replace('/', '\\', config('modules.namespace') . '\\' . $this->moduleName . '\\' . ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder', '')));
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
}
/**
* Get the services provided by the provider.
*/
public function provides(): array
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (config('view.paths') as $path) {
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
$paths[] = $path . '/modules/' . $this->moduleNameLower;
}
}
return $paths;
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace Modules\PMS\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*/
public function boot(): void
{
parent::boot();
}
/**
* Define the routes for the application.
*/
public function map(): void
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('PMS', '/routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('PMS', '/routes/api.php'));
}
}

View File

View File

@ -0,0 +1,14 @@
<?php
namespace Modules\PMS\Repositories;
interface ClientInterface
{
public function findAll();
public function getClientById($clientId);
public function delete($clientId);
public function create($clientDetails);
public function update($clientId, array $newDetails);
public function pluck();
}

View File

@ -0,0 +1,39 @@
<?php
namespace Modules\PMS\Repositories;
use Modules\PMS\Models\Client;
class ClientRepository implements ClientInterface
{
public function findAll()
{
return Client::paginate(20);
}
public function getClientById($ClientId)
{
return Client::findOrFail($ClientId);
}
public function delete($ClientId)
{
Client::destroy($ClientId);
}
public function create($ClientDetails)
{
return Client::create($ClientDetails);
}
public function update($ClientId, array $newDetails)
{
return Client::whereId($ClientId)->update($newDetails);
}
public function pluck()
{
return Client::pluck('client_name', 'id');
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Modules\PMS\Repositories;
interface ProjectInterface
{
public function findAll();
public function getProjectById($clientId);
public function delete($clientId);
public function create($clientDetails);
public function update($clientId, array $newDetails);
public function pluck();
}

View File

@ -0,0 +1,39 @@
<?php
namespace Modules\PMS\Repositories;
use Modules\PMS\Models\Project;
class ProjectRepository implements ProjectInterface
{
public function findAll()
{
return Project::paginate(20);
}
public function getProjectById($ProjectId)
{
return Project::findOrFail($ProjectId);
}
public function delete($ProjectId)
{
Project::destroy($ProjectId);
}
public function create($ProjectDetails)
{
return Project::create($ProjectDetails);
}
public function update($ProjectId, array $newDetails)
{
return Project::whereId($ProjectId)->update($newDetails);
}
public function pluck()
{
return Project::pluck('project_name', 'id');
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Modules\PMS\Repositories;
interface TaskInterface
{
public function findAll();
public function getTaskById($clientId);
public function delete($clientId);
public function create($clientDetails);
public function update($clientId, array $newDetails);
public function pluck();
}

View File

@ -0,0 +1,40 @@
<?php
namespace Modules\PMS\Repositories;
use Illuminate\Support\Facades\DB;
use Modules\PMS\Models\Task;
class TaskRepository implements TaskInterface
{
public function findAll()
{
return Task::paginate(20);
}
public function getTaskById($TaskId)
{
return Task::findOrFail($TaskId);
}
public function delete($TaskId)
{
Task::destroy($TaskId);
}
public function create($TaskDetails)
{
return Task::create($TaskDetails);
}
public function update($TaskId, array $newDetails)
{
return Task::whereId($TaskId)->update($newDetails);
}
public function pluck()
{
return Task::pluck(DB::raw('CONCAT(first_name," ", middle_name , " ",last_name) AS full_name'), 'id');
}
}

30
Modules/PMS/composer.json Normal file
View File

@ -0,0 +1,30 @@
{
"name": "nwidart/pms",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\PMS\\": "app/",
"Modules\\PMS\\Database\\Factories\\": "database/factories/",
"Modules\\PMS\\Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Modules\\PMS\\Tests\\": "tests/"
}
}
}

View File

View File

@ -0,0 +1,5 @@
<?php
return [
'name' => 'PMS',
];

View File

View File

View File

@ -0,0 +1,36 @@
<?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_clients', function (Blueprint $table) {
$table->id();
$table->string('client_name')->nullable();
$table->unsignedBigInteger('country_id')->nullable();
$table->string('email_address')->nullable();
$table->string('company')->nullable();
$table->string('address')->nullable();
$table->longText('desc')->nullable();
$table->integer('status')->nullable();
$table->unsignedBigInteger('createdBy')->nullable();
$table->unsignedBigInteger('updatedBy')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tbl_clients');
}
};

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_projects', function (Blueprint $table) {
$table->id();
$table->string('project_code')->nullable();
$table->string('project_name')->nullable();
$table->unsignedBigInteger('client_id')->nullable();
$table->unsignedBigInteger('project_category_id')->nullable();
$table->json('members_id')->nullable();
$table->date('start_date')->nullable();
$table->date('end_date')->nullable();
$table->longText('summary')->nullable();
$table->integer('status')->nullable();
$table->unsignedBigInteger('createdBy')->nullable();
$table->unsignedBigInteger('updatedBy')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tbl_projects');
}
};

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_tasks', function (Blueprint $table) {
$table->id();
$table->string('title')->nullable();
$table->unsignedBigInteger('task_category_id')->nullable();
$table->unsignedBigInteger('project_id')->nullable();
$table->date('start_date')->nullable();
$table->date('due_date')->nullable();
$table->json('assigned_id')->nullable();
$table->longText('desc')->nullable();
$table->integer('status')->nullable();
$table->integer('priority')->nullable();
$table->unsignedBigInteger('createdBy')->nullable();
$table->unsignedBigInteger('updatedBy')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tbl_tasks');
}
};

View File

View File

@ -0,0 +1,16 @@
<?php
namespace Modules\PMS\database\seeders;
use Illuminate\Database\Seeder;
class PMSDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// $this->call([]);
}
}

11
Modules/PMS/module.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "PMS",
"alias": "pms",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\PMS\\Providers\\PMSServiceProvider"
],
"files": []
}

15
Modules/PMS/package.json Normal file
View File

@ -0,0 +1,15 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.5",
"sass": "^1.69.5",
"postcss": "^8.3.7",
"vite": "^4.0.0"
}
}

View File

View File

View File

View File

@ -0,0 +1,18 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
@include('layouts.partials.breadcrumb', ['title' => $title])
{{ html()->form('POST')->route('client.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
@include('pms::client.partials.action')
{{ html()->form()->close() }}
</div>
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,22 @@
@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 -->
{{ html()->modelForm($client, 'PUT')->route('client.update', $client->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
@include('pms::client.partials.action')
{{ html()->closeModelForm() }}
<!--end row-->
</div>
<!-- container-fluid -->
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,65 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
@include('layouts.partials.breadcrumb', ['title' => $title])
<div class="mb-2 text-end">
<a href="{{ route('client.create') }}" class="btn btn-success btn-md waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Add</a>
</div>
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
<thead>
<tr>
<th>S.N</th>
<th>Client Name</th>
<th>Email</th>
<th>Company</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse ($clients as $key => $client)
<tr>
<td>{{ $key + 1 }}</td>
<td>{{ $client->client_name }}</td>
<td>{{ $client->email_address }}</td>
<td>{{ $client->company }}</td>
<td>{!! $client->status_name !!}</td>
<td>
<div class="hstack flex-wrap gap-3">
<a href="{{ route('client.show', $client->id) }}" class="link-info fs-15">
<i class="ri-eye-line"></i>
</a>
<a href="{{ route('client.edit', $client->id) }}" class="link-success fs-15 edit-item-btn"><i
class="ri-edit-2-line"></i></a>
<a href="javascript:void(0);" data-link="{{ route('client.destroy', $client->id) }}"
data-id="{{ $client->id }}" class="link-danger fs-15 remove-item-btn"><i
class="ri-delete-bin-line"></i></a>
</div>
</td>
</tr>
@empty
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!--end row-->
</div>
</div>
@endsection

View File

@ -0,0 +1,65 @@
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-body">
<div class="row gy-1">
<div class="col-md-6">
{{ html()->label('Client Name')->class('form-label') }}
{{ html()->text('client_name')->class('form-control')->placeholder('Enter Client Name')->required() }}
</div>
<div class="col-md-6">
{{ html()->label('Email')->class('form-label') }}
{{ html()->email('email_address')->class('form-control')->placeholder('Enter Email')->required() }}
</div>
{{-- <div class="col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('desc')->class('form-control')->placeholder('Enter Description...') }}
</div> --}}
<div class="col-md-6">
{{ html()->label('Country')->class('form-label') }}
{{ html()->select('country_id', $countryList)->class('form-control')->placeholder('Select Country')->required() }}
</div>
<div class="col-md-6">
{{ html()->label('Adress')->class('form-label') }}
{{ html()->text('address')->class('form-control')->placeholder('Enter Address') }}
</div>
<div class="col-md-6">
{{ html()->label('Company')->class('form-label') }}
{{ html()->text('company')->class('form-control')->placeholder('Enter Company')->attributes(['id' => 'cleave-prefixq']) }}
</div>
</div>
</div>
</div>
<!-- end card -->
<div class="mb-3 text-end">
<a href="{{ route('client.index') }}" class="btn btn-danger w-sm">Cancel</a>
<button type="submit" class="btn btn-success w-sm">Save</button>
</div>
</div>
<!-- end col -->
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Publish</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
{{ html()->label('Status')->class('form-label') }}
{{ html()->select('status', $status)->class('form-control')->placeholder('Select Status') }}
</div>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>

View File

@ -0,0 +1,49 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
@include('layouts.partials.breadcrumb', ['title' => $title])
<div class="row">
<div class="col-md-8">
<div class="card card-body p-4">
<div>
<div class="table-responsive">
<table class="table-borderless mb-0 table">
<tbody>
<tr>
<th><span class="fw-medium">Client Name</span></th>
<td>{{ $client->client_name }}</td>
</tr>
<tr>
<th><span class="fw-medium">Company</span></th>
<td>{{ $client->company }}</td>
</tr>
<tr>
<th><span class="fw-medium">Email</span></th>
<td>{{ $client->email_address }}</td>
</tr>
<tr>
<th><span class="fw-medium">Address</span></th>
<td>{{ $client->address }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="mb-3 text-end">
<a href="{{ route('client.index') }}" class="btn btn-secondary w-sm">Back</a>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,7 @@
@extends('pms::layouts.master')
@section('content')
<h1>Hello World</h1>
<p>Module: {!! config('pms.name') !!}</p>
@endsection

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>PMS Module - {{ config('app.name', 'Laravel') }}</title>
<meta name="description" content="{{ $description ?? '' }}">
<meta name="keywords" content="{{ $keywords ?? '' }}">
<meta name="author" content="{{ $author ?? '' }}">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
{{-- Vite CSS --}}
{{-- {{ module_vite('build-pms', 'resources/assets/sass/app.scss') }} --}}
</head>
<body>
@yield('content')
{{-- Vite JS --}}
{{-- {{ module_vite('build-pms', 'resources/assets/js/app.js') }} --}}
</body>

View File

@ -0,0 +1,18 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
@include('layouts.partials.breadcrumb', ['title' => $title])
{{ html()->form('POST')->route('project.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
@include('pms::project.partials.action')
{{ html()->form()->close() }}
</div>
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,22 @@
@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 -->
{{ html()->modelForm($project, 'PUT')->route('project.update', $project->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
@include('pms::project.partials.action')
{{ html()->closeModelForm() }}
<!--end row-->
</div>
<!-- container-fluid -->
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,71 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
@include('layouts.partials.breadcrumb', ['title' => $title])
<div class="mb-2 text-end">
<a href="{{ route('project.create') }}" class="btn btn-success btn-md waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Add</a>
</div>
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
<thead>
<tr>
<th>S.N</th>
<th>Code</th>
<th>Project Name</th>
<th>Members</th>
<th>Start Date</th>
<th>Deadline</th>
<th>Client</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse ($projects as $key => $project)
<tr>
<td>{{ $key + 1 }}</td>
<td>{{ $project->project_code }}</td>
<td>{{ $project->project_name }}</td>
<td>{{ $project->members_id }}</td>
<td>{{ $project->start_date }}</td>
<td class="text-danger">{{ $project->end_date }}</td>
<td>{{ optional($project->client)->client_name }}</td>
<td>{!! $project->status_name !!}</td>
<td>
<div class="hstack flex-wrap gap-3">
<a href="{{ route('project.show', $project->id) }}" class="link-info fs-15">
<i class="ri-eye-line"></i>
</a>
<a href="{{ route('project.edit', $project->id) }}"
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
<a href="javascript:void(0);" data-link="{{ route('project.destroy', $project->id) }}"
data-id="{{ $project->id }}" class="link-danger fs-15 remove-item-btn"><i
class="ri-delete-bin-line"></i></a>
</div>
</td>
</tr>
@empty
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!--end row-->
</div>
</div>
@endsection

View File

@ -0,0 +1,95 @@
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-body">
<div class="row gy-1">
<div class="col-md-6">
{{ html()->label('Project Code')->class('form-label') }}
{{ html()->text('project_code')->class('form-control')->placeholder('Enter Project Code')->required() }}
</div>
<div class="col-md-6">
{{ html()->label('Project Name')->class('form-label') }}
{{ html()->text('project_name')->class('form-control')->placeholder('Enter Project Name')->required() }}
</div>
<div class="col-md-6">
{{ html()->label('Project Category')->class('form-label') }}
{{ html()->select('project_category_id', $categoryList)->class('form-control')->placeholder('Select Project Category')->required() }}
</div>
<div class="col-md-6">
{{ html()->label('Client')->class('form-label') }}
{{ html()->select('client_id', $clientList)->class('form-control')->placeholder('Select Client')->required() }}
</div>
<div class="col-md-12">
{{ html()->label('Team Members')->class('form-label') }}
{{ html()->select('members_id', $memberList)->class('form-control')->placeholder('Select Member')->required() }}
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-12">
{{ html()->label('Summary')->class('form-label') }}
{{ html()->textarea('summary')->class('form-control')->placeholder('Enter Summary...') }}
</div>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
<div class="mb-3 text-end">
<a href="{{ route('project.index') }}" class="btn btn-danger w-sm">Cancel</a>
<button type="submit" class="btn btn-success w-sm">Save</button>
</div>
</div>
<!-- end col -->
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Publish</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
{{ html()->label('Status')->class('form-label') }}
{{ html()->select('status', $status)->class('form-control')->required() }}
</div>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Date</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
{{ html()->label('Start Date')->class('form-label') }}
{{ html()->date('start_date')->class('form-control')->placeholder('Choose Start Date') }}
</div>
<div class="col-md-12">
{{ html()->label('End Date')->class('form-label') }}
{{ html()->date('end_date')->class('form-control')->placeholder('Choose End Date') }}
</div>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>

View File

@ -0,0 +1,49 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
@include('layouts.partials.breadcrumb', ['title' => $title])
<div class="row">
<div class="col-md-8">
<div class="card card-body p-4">
<div>
<div class="table-responsive">
<table class="table-borderless mb-0 table">
<tbody>
<tr>
<th><span class="fw-medium">Project Name</span></th>
<td>{{ $project->project_name }}</td>
</tr>
<tr>
<th><span class="fw-medium">Code</span></th>
<td>{{ $project->project_code }}</td>
</tr>
<tr>
<th><span class="fw-medium">Members</span></th>
<td>{{ $project->members_id }}</td>
</tr>
<tr>
<th><span class="fw-medium">Summary</span></th>
<td>{{ $project->summary }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="mb-3 text-end">
<a href="{{ route('project.index') }}" class="btn btn-secondary w-sm">Back</a>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,18 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
@include('layouts.partials.breadcrumb', ['title' => $title])
{{ html()->form('POST')->route('task.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
@include('pms::task.partials.action')
{{ html()->form()->close() }}
</div>
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,22 @@
@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 -->
{{ html()->modelForm($task, 'PUT')->route('task.update', $task->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
@include('pms::task.partials.action')
{{ html()->closeModelForm() }}
<!--end row-->
</div>
<!-- container-fluid -->
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,73 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
@include('layouts.partials.breadcrumb', ['title' => $title])
<div class="mb-2 text-end">
<a href="{{ route('task.create') }}" class="btn btn-success btn-md waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Add</a>
</div>
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
<thead>
<tr>
<th>S.N</th>
<th>Title</th>
<th>Category</th>
<th>Project</th>
<th>Start Date</th>
<th>Deadline</th>
<th>Assigned</th>
<th>Priority</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse ($tasks as $key => $task)
<tr>
<td>{{ $key + 1 }}</td>
<td>{{ $task->title }}</td>
<td>{{ $task->task_category_id }}</td>
<td>{{ optional($task->project)->project_name }}</td>
<td>{{ $task->start_date }}</td>
<td class="text-danger">{{ $task->due_date }}</td>
<td>{{ optional($task->assigned)->full_name }}</td>
<td>{!! $task->priority_status !!}</td>
<td>{!! $task->status_name !!}</td>
<td>
<div class="hstack flex-wrap gap-3">
<a href="{{ route('task.show', $task->id) }}" class="link-info fs-15">
<i class="ri-eye-line"></i>
</a>
<a href="{{ route('task.edit', $task->id) }}" class="link-success fs-15 edit-item-btn"><i
class="ri-edit-2-line"></i></a>
<a href="javascript:void(0);" data-link="{{ route('task.destroy', $task->id) }}"
data-id="{{ $task->id }}" class="link-danger fs-15 remove-item-btn"><i
class="ri-delete-bin-line"></i></a>
</div>
</td>
</tr>
@empty
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!--end row-->
</div>
</div>
@endsection

View File

@ -0,0 +1,96 @@
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-body">
<div class="row gy-1">
<div class="col-md-12">
{{ html()->label('Title')->class('form-label') }}
{{ html()->text('title')->class('form-control')->placeholder('Enter Title')->required() }}
</div>
<div class="col-md-6">
{{ html()->label('Task Category')->class('form-label') }}
{{ html()->select('task_category_id', $categoryList)->class('form-control')->placeholder('Select Task Category')->required() }}
</div>
<div class="col-md-6">
{{ html()->label('Project')->class('form-label') }}
{{ html()->select('project_id', $projectList)->class('form-control')->placeholder('Select Project')->required() }}
</div>
<div class="col-md-12">
{{ html()->label('Assigned User')->class('form-label') }}
{{ html()->select('assigned_id', $memberList)->class('form-control')->placeholder('Select Assigned User')->required() }}
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('desc')->class('form-control')->placeholder('Enter Description...') }}
</div>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
<div class="mb-3 text-end">
<a href="{{ route('task.index') }}" class="btn btn-danger w-sm">Cancel</a>
<button type="submit" class="btn btn-success w-sm">Save</button>
</div>
</div>
<!-- end col -->
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Publish</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
{{ html()->label('Status')->class('form-label') }}
{{ html()->select('status', $status)->class('form-control')->required() }}
</div>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Date</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
{{ html()->label('Priority')->class('form-label') }}
{{ html()->select('priority', $priority)->class('form-control')->required() }}
</div>
<div class="col-md-12">
{{ html()->label('Start Date')->class('form-label') }}
{{ html()->date('start_date')->class('form-control')->placeholder('Choose Start Date') }}
</div>
<div class="col-md-12">
{{ html()->label('Due Date')->class('form-label') }}
{{ html()->date('due_date')->class('form-control')->placeholder('Choose Due Date') }}
</div>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>

View File

@ -0,0 +1,49 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
@include('layouts.partials.breadcrumb', ['title' => $title])
<div class="row">
<div class="col-md-8">
<div class="card card-body p-4">
<div>
<div class="table-responsive">
<table class="table-borderless mb-0 table">
<tbody>
<tr>
<th><span class="fw-medium">Title</span></th>
<td>{{ $task->title }}</td>
</tr>
<tr>
<th><span class="fw-medium">Task Category</span></th>
<td>{{ $task->task_category_id }}</td>
</tr>
<tr>
<th><span class="fw-medium">Project</span></th>
<td>{{ $task->project_id }}</td>
</tr>
<tr>
<th><span class="fw-medium">Description</span></th>
<td>{{ $task->desc }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="mb-3 text-end">
<a href="{{ route('task.index') }}" class="btn btn-secondary w-sm">Back</a>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\PMS\Http\Controllers\PMSController;
/*
*--------------------------------------------------------------------------
* API Routes
*--------------------------------------------------------------------------
*
* Here is where you can register API routes for your application. These
* routes are loaded by the RouteServiceProvider within a group which
* is assigned the "api" middleware group. Enjoy building your API!
*
*/
Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
Route::apiResource('pms', PMSController::class)->names('pms');
});

View File

@ -0,0 +1,26 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\PMS\Http\Controllers\ClientController;
use Modules\PMS\Http\Controllers\PMSController;
use Modules\PMS\Http\Controllers\ProjectController;
use Modules\PMS\Http\Controllers\TaskController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::group([], function () {
Route::resource('pms', PMSController::class)->names('pms');
Route::resource('client', ClientController::class)->names('client');
Route::resource('project', ProjectController::class)->names('project');
Route::resource('task', TaskController::class)->names('task');
});

View File

@ -0,0 +1,26 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
build: {
outDir: '../../public/build-pms',
emptyOutDir: true,
manifest: true,
},
plugins: [
laravel({
publicDirectory: '../../public',
buildDirectory: 'build-pms',
input: [
__dirname + '/resources/assets/sass/app.scss',
__dirname + '/resources/assets/js/app.js'
],
refresh: true,
}),
],
});
//export const paths = [
// 'Modules/PMS/resources/assets/sass/app.scss',
// 'Modules/PMS/resources/assets/js/app.js',
//];

View File

@ -0,0 +1,91 @@
<?php
namespace Modules\Taxation\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\Companies;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Modules\Employee\Repositories\EmployeeInterface;
class InvoiceController extends Controller
{
private $employeeRepository;
public function __construct(EmployeeInterface $employeeRepository)
{
$this->employeeRepository = $employeeRepository;
}
/**
* Display a listing of the resource.
*/
public function index()
{
$data['title'] = 'Invoice List';
$data['invoices'] = [];
return view('taxation::invoice.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = 'Create Invoice';
$data['companyList'] = Companies::pluck('title', 'company_id');
$data['employeeList'] = $this->employeeRepository->pluck();
return view('taxation::invoice.create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
//
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('taxation::invoice.show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('taxation::invoice.edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
public function cloneProduct(Request $request)
{
$data = [];
$numInc = $request->numberInc;
$script = true;
return response()->json([
'view' => view('taxation::invoice.clone-product', compact('data', 'numInc', 'script'))->render(),
]);
}
}

View File

@ -0,0 +1,39 @@
<div class="card card-body product-card card-border-secondary mb-2 border">
<div class="row gy-2 mb-2">
<div class="col-md-4">
{{ html()->label('Product')->class('form-label') }}
{{ html()->text('product_id')->class('form-control')->placeholder('Enter Product Name')->required() }}
</div>
<div class="col-md-2">
{{ html()->label('Unit')->class('form-label') }}
{{ html()->text('unit')->class('form-control')->placeholder('Enter Unit')->required() }}
</div>
<div class="col-md-2">
{{ html()->label('Rate')->class('form-label') }}
{{ html()->text('rate')->class('form-control product-price cleave-numeral')->placeholder('Enter Rate')->attributes(['id' => 'cleave-numeral']) }}
</div>
<div class="col-md-2">
{{ html()->label('Quantity')->class('form-label') }}
{{ html()->text('qty')->class('form-control product-quantity cleave-numeral')->placeholder('Enter QTY')->attributes(['id' => 'cleave-numeral']) }}
</div>
<div class="col-md-2">
{{ html()->label('Amount')->class('form-label') }}
{{ html()->text('amt')->class('form-control product-line-price bg-light')->placeholder('Enter Amount')->isReadOnly() }}
</div>
<div class="col-md-6">
{{ html()->label('Description')->class('form-label') }}
{{ html()->text('desc')->class('form-control')->placeholder('Enter Description') }}
</div>
<div class="col-md-6 d-flex justify-content-end align-items-end">
<button type="button" class="btn btn-danger btn-icon waves-effect btn-remove waves-light"><i
class="ri-delete-bin-5-line"></i></button>
</div>
</div>
</div>

View File

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

View File

@ -9,9 +9,9 @@
<div class="col-lg-12">
<div class="card">
<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">{{ $title }}</h5>
<div class="flex-shrink-0">
<a href="{{ route('leaveType.create') }}" class="btn btn-success waves-effect waves-light"><i
<a href="{{ route('invoice.create') }}" class="btn btn-success waves-effect waves-light"><i
class="ri-add-fill me-1 align-bottom"></i> Add</a>
</div>
</div>
@ -22,14 +22,14 @@
<thead>
<tr>
<th>S.N</th>
<th>Leave Type</th>
<th>Id</th>
<th>Created By</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse ($leaveTypes as $key => $leaveType)
@forelse ($invoices as $key => $leaveType)
<tr>
<td>{{ $key + 1 }}</td>
<td>{{ $leaveType->employee_id }}</td>

View File

@ -0,0 +1,207 @@
<div class="row gy-1">
<h5 class="text-primary text-center">Invoice Details</h5>
<div class="border border-dashed"></div>
<div class="col-md-4">
{{ html()->label('Company')->class('form-label') }}
{{ html()->select('company_id', $companyList)->class('form-control')->placeholder('Select Company')->required() }}
{{ html()->div('Please select company')->class('invalid-feedback') }}
</div>
<div class="col-md-4">
{{ html()->label('Invoice No.')->class('form-label') }}
{{ html()->text('invoice_no')->class('form-control')->placeholder('Enter Invoice No')->attributes(['id' => 'cleave-prefix']) }}
</div>
<div class="col-md-4">
{{ html()->label('VAT No.')->class('form-label') }}
{{ html()->text('vat_no')->class('form-control')->placeholder('Enter VAT No') }}
</div>
<div class="col-md-4">
{{ html()->label('Sales Date')->class('form-label') }}
{{ html()->date('sale_date')->class('form-control')->placeholder('Choose Sales Date')->required() }}
{{ html()->div('Please choose invoice date')->class('invalid-feedback') }}
</div>
<div class="col-md-4">
{{ html()->label('Bill Issue Date')->class('form-label') }}
{{ html()->date('isse_date')->class('form-control')->placeholder('Choose Bill Issue Date')->required() }}
{{ html()->div('Please choose invoice date')->class('invalid-feedback') }}
</div>
</div>
<div class="row gy-1 my-2">
<h5 class="text-primary text-center">Buyer Details</h5>
<div class="border border-dashed"></div>
<div class="col-md-4">
{{ html()->label('Buyer')->class('form-label') }}
{{ html()->select('buyer_id', $employeeList)->class('form-control')->placeholder('Select Buyer') }}
</div>
<div class="col-md-4">
{{ html()->label('Address No.')->class('form-label') }}
{{ html()->text('buyer_address')->class('form-control')->placeholder('Enter Address') }}
</div>
<div class="col-md-4">
{{ html()->label('VAT No.')->class('form-label') }}
{{ html()->text('vat_no')->class('form-control')->placeholder('Enter Buyer VAT No') }}
</div>
<div class="col-md-4">
{{ html()->label('Contact No')->class('form-label') }}
{{ html()->date('sale_date')->class('form-control')->placeholder('Enter Contact No') }}
</div>
<div class="col-md-4">
{{ html()->label('Mode of Payment')->class('form-label') }}
{{ html()->select('buyer_id', [1 => 'Cash', 2 => 'Bank', 3 => 'Credit'])->class('form-control')->placeholder('Select Payment Mode') }}
</div>
</div>
{{-- <div class="row mt-2">
<p class="text-primary">Shipping Details</p>
<div class="border border-dashed"></div>
<div class="col-md-4">
{{ html()->label('Address')->class('form-label') }}
{{ html()->text('address')->class('form-control')->placeholder('Enter Address') }}
</div>
<div class="col-md-4">
{{ html()->label('Shipping Date')->class('form-label') }}
{{ html()->date('shiiping_date')->class('form-control')->placeholder('Enter Temporary Address') }}
</div>
</div> --}}
<div class="row gy-1 gx-2 mt-1">
<div class="d-flex justify-content-end">
<button type="button" class="btn btn-info btn-icon add-btn text-end"><i class="ri-add-line"></i></button>
</div>
@include('taxation::invoice.clone-product')
<div class="appendProductCard"></div>
</div>
<div class="d-flex justify-content-end w-30 mb-2">
<table class="table-borderless align-middle">
<tbody>
<tr>
<th scope="row">Sub Total</th>
<td style="width:150px;">
<input type="text" class="form-control bg-light border-0" id="subtotal" placeholder="$0.00"
readonly="">
</td>
</tr>
<tr>
<th scope="row">Estimated Tax (11%)</th>
<td>
<input type="text" class="form-control bg-light border-0" id="tax" placeholder="$0.00"
readonly="">
</td>
</tr>
<tr>
<th scope="row">Discount</th>
<td>
<input type="text" class="form-control bg-light border-0" id="discount" placeholder="$0.00"
readonly="">
</td>
</tr>
<tr class="border-top border-top-dashed">
<th scope="row">Total Amount</th>
<td>
<input type="text" class="form-control bg-light border-0" id="total" placeholder="$0.00"
readonly="">
</td>
</tr>
</tbody>
</table>
</div>
<div class="mb-4 text-end">
<button type="submit" class="btn btn-success w-sm">Save</button>
</div>
@push('js')
<script src="{{ asset('assets/libs/cleave.js/cleave.min.js') }}"></script>
<script src="{{ asset('assets/js/pages/form-masks.init.js') }}"></script>
<script>
$("body").on('click', '.add-btn', function(e) {
e.preventDefault();
numberInc = $('.product-card').length
$.ajax({
type: 'get',
url: '{{ route('cloneProduct') }}',
data: {
numberInc: numberInc
},
success: function(response) {
$('.appendProductCard').append(response.view)
// $('#invoice-container').html(response.view).fadeIn()
},
error: function(xhr) {
},
});
});
$("body").on('click', '.btn-remove', function() {
if ($('.product-card').length > 1) {
$(this).parents(".product-card").remove();
}
recalculate();
});
function amountKeyup() {
$("body").on('keyup', '.product-price', function() {
var priceInput = $(this);
var qtyInput = priceInput.closest(".row").find(".product-quantity");
var linePrice = priceInput.closest(".row").find(".product-line-price");
updateQuantity(priceInput.val(), qtyInput.val(), linePrice);
});
$("body").on('keyup', '.product-quantity', function() {
var priceInput = $(this);
var qtyInput = priceInput.closest(".row").find(".product-price");
var linePrice = priceInput.closest(".row").find(".product-line-price");
updateQuantity(priceInput.val(), qtyInput.val(), linePrice);
});
}
amountKeyup()
function updateQuantity(rate, qty, linePriceInput) {
var amount = (rate * qty).toFixed(2);
linePriceInput.val(amount);
recalculate();
}
function recalculate() {
var subtotal = 0;
$(".product-line-price").each(function() {
if ($(this).val()) {
subtotal += parseFloat($(this).val());
}
});
var tax = subtotal * 0.125;
var discount = subtotal * 0.15;
var shipping = subtotal > 0 ? 65 : 0;
var total = subtotal + tax + shipping - discount;
$("#subtotal").val(subtotal.toFixed(2));
$("#tax").val(tax.toFixed(2));
$("#discount").val(discount.toFixed(2));
$("#shipping").val(shipping.toFixed(2));
$("#total").val(total.toFixed(2));
// $("#totalamountInput").val(total.toFixed(2));
// $("#amountTotalPay").val(total.toFixed(2));
}
</script>
@endpush

Some files were not shown because too many files have changed in this diff Show More