first change

This commit is contained in:
2025-07-27 17:40:56 +05:45
commit f8b9a6725b
3152 changed files with 229528 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb />
{{ html()->form('POST')->route('employee.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
@include('employee::employee.partials.form')
{{ html()->form()->close() }}
</div>
@endsection

View File

@@ -0,0 +1,15 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb />
{{ html()->modelForm($employee, 'PUT')->route('employee.update', $employee->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
@include('employee::employee.partials.form')
{{ html()->closeModelForm() }}
</div>
@endsection

View File

@@ -0,0 +1,119 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb />
<div class="card">
<div class="card-body">
<div class="row g-2">
<div class="col-sm-4">
<div class="search-box">
<input type="text" name="searchMemberList" class="form-control" id="searchMemberList"
placeholder="Search for name...">
<i class="ri-search-line search-icon"></i>
</div>
</div>
<div class="col-sm-auto ms-auto">
<div class="list-grid-nav hstack gap-1">
<button type="button" id="grid-view-button"
class="btn btn-soft-info nav-link btn-icon fs-14 active filter-button"><i
class="ri-grid-fill"></i></button>
<button type="button" id="list-view-button"
class="btn btn-soft-info nav-link btn-icon fs-14 filter-button"><i
class="ri-list-unordered"></i></button>
@can('employee.create')
<a class="btn btn-primary" href="{{ route('employee.create') }}"><i
class="ri-add-fill me-1 align-bottom"></i> Create</a>
@endcan
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div>
<div id="teamlist">
<div class="text-center mb-3 auto-load" style="display: none">
<a href="javascript:void(0);" class="text-success"><i
class="mdi mdi-loading mdi-spin fs-20 align-middle me-2"></i> Load More </a>
</div>
<div class="team-list grid-view-filter row" id="team-member-list">
</div>
<div class="py-4 mt-4 text-center" id="noresult" style="display: none">
<lord-icon src="https://cdn.lordicon.com/msoeawqm.json" trigger="loop"
colors="primary:#405189,secondary:#0ab39c" style="width:72px;height:72px"></lord-icon>
<h5 class="mt-4">Sorry! No Result Found</h5>
</div>
</div>
</div>
</div>
</div>
</div>
@include('user::user.modal.assign-role')
@endsection
@push('js')
<script>
window.addEventListener('DOMContentLoaded', function() {
const debounce = (func, delay) => {
let timer;
return function(...args) {
const context = this;
clearTimeout(timer);
timer = setTimeout(() => {
func.apply(context, args);
}, delay);
};
};
function performSearch(page) {
const input = $("#searchMemberList").val();
$.ajax({
url: '{{ route('employee.index') }}',
method: 'GET',
data: {
search: input,
page: page
},
beforeSend: function() {
$(".auto-load").toggle();
$('.team-list').html("");
$("#noresult").hide();
},
success: function(response) {
if (response.html) {
$('.team-list').html(response.html);
}
$('[data-bs-toggle="tooltip"]').tooltip('dispose').tooltip();
},
error: function(error) {
console.log(error);
$("#noresult").show();
},
complete: function() {
$(".auto-load").toggle();
}
});
}
const debouncedSearch = debounce(performSearch, 500);
performSearch(1);
$('#searchMemberList').on('keyup', function() {
debouncedSearch(1);
});
$(document).on('click', '.pagination a', function(e) {
e.preventDefault();
const page = $(this).attr('href').split('page=')[1];
performSearch(page);
});
});
</script>
@endpush

View File

@@ -0,0 +1,67 @@
<div class="card">
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">Attendance Detail</h5>
<div class="flex-shrink-0">
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="display table-sm table-bordered buttons-datatables table">
<thead class="table-light">
<tr>
<th class="tb-col"><span class="overline-title">Name</span></th>
<th class="tb-col"><span class="overline-title">Date</span></th>
<th class="tb-col"><span class="overline-title">Clock In</span></th>
<th class="tb-col"><span class="overline-title">Clock Out</span></th>
<th class="tb-col"><span class="overline-title">Working Hours(hrs)</span></th>
<th class="tb-col"><span class="overline-title">Status</span></th>
</tr>
</thead>
<tbody>
@foreach ($attends as $attend)
<tr style=" vertical-align: middle;">
<td class="p-1">
<div class="d-flex align-items-center">
<div class="me-2 flex-shrink-0">
<img src="
{{ $employee->profile_pic }}
"
alt="" class="avatar-sm p-2">
</div>
<div>
<h5 class="fs-14 fw-medium my-1">
<a href="#" class="text-reset text-hover-success small">
{{ $employee->full_name }}
</a>
</h5>
<span class="text-muted">
{{ $employee->email }}
</span>
</div>
</div>
</td>
<td>{{ $attend->date }}</td>
<td class="text-success">{{ $attend->clock_in_time ?? 'N/A'}}</td>
<td class="text-danger">{{ $attend->clock_out_time ?? 'N/A'}}</td>
<td class="text-center text-muted">{{ $attend->total_hours ?? 'N/A'}}</td>
<td>
@if ($attend->status == 10)
<span class="badge bg-danger">Absent</span>
@elseif ($attend->status == 11)
<span class="badge bg-success">Present</span>
@else
<span class="badge bg-secondary">N/A</span>
@endif
</td>
{{-- <td> <span class="badge bg-{{ $attend->status_name['color'] }}">{!! $attend->status_name['status'] !!}</td> --}}
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,96 @@
<div class="py-2 text-center">
{{ $employees->links() }}
</div>
@forelse ($employees as $employee)
<div class="col">
<div class="card team-box ribbon-box mb-lg-0 material-shadow border shadow-none">
<div class="team-cover">
<img src="{{ asset('assets/images/small/img-9.jpg') }}" class="img-fluid">
</div>
<div class="card-body p-4">
<div class="ribbon-two ribbon-two-success">
{!! $employee?->user?->getRoles() !!}
</div>
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col"></div>
<div class="col dropdown text-end">
<a href="javascript:void(0);" data-bs-toggle="dropdown" aria-expanded="false"
class="">
<i class="ri-more-fill fs-17"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end">
@can('employee.destroy')
<li>
<a class="dropdown-item remove-item-btn" href="javascript:void(0);"
data-link="{{ route('employee.destroy', $employee->id) }}"
data-id="{{ $employee->id }}">
<i class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>
Delete
</a>
</li>
@endcan
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="img-thumbnail rounded-circle flex-shrink-0">
<img style="height: 90px; width:90px; object-fit:contain"
src="{{ $employee->getRawOriginal('photo') ? $employee->photo : asset('assets/images/avatar.png') }}"
alt="{{ $employee->full_name }}" class="img-fluid rounded-circle">
</div>
<div class="team-content">
<a class="member-name" href="{{ route('employee.show', $employee->id) }}">
<h5 class="fs-16 text-primary mb-1">{{ $employee->full_name }}</h5>
</a>
<p class="text-muted member-designation mb-0">
{{ $employee?->designation?->title }}
<span @class(['d-none' => !$employee->department || !$employee->branch])>
({{ $employee->branch?->title ?? $employee->department?->title }})
</span>
</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<ul class="list-inline mb-0 text-center">
@can('employee.edit')
<li class="list-inline-item avatar-xs">
<a href="{{ route('employee.edit', $employee->id) }}" data-bs-toggle="tooltip"
data-bs-placement="top" data-bs-title="Edit"
class="avatar-title bg-info-subtle text-info fs-15 rounded">
<i class="ri-edit-line"></i>
</a>
</li>
@endcan
@if (auth()->user()->hasRole('admin'))
@can('user.assignRole' && $employee->user)
<li class="list-inline-item avatar-xs">
<a href="javascript:void(0);" data-link="{{ route('user.assignRole', $employee->user?->id) }}" data-bs-toggle="tooltip"
data-bs-placement="top" data-bs-title="Assign Role" class="avatar-title bg-dark-subtle text-dark fs-15 rounded assign-role-btn">
<i class="ri-admin-line"></i>
</a>
</li>
@endcan
@endif
</ul>
</div>
</div>
</div>
</div>
</div>
@empty
<div class="py-4 mt-4 text-center" id="noresult">
<lord-icon src="https://cdn.lordicon.com/msoeawqm.json" trigger="loop"
colors="primary:#405189,secondary:#0ab39c" style="width:72px;height:72px"></lord-icon>
<h5 class="mt-4">Sorry! No Result Found</h5>
</div>
@endforelse

View File

@@ -0,0 +1,22 @@
{{ html()->form('GET')->route('employee.index')->class(['filter-form'])->attributes(['id' => 'filter-form'])->open() }}
<div class="row g-3">
<div class="col-sm-3">
{{ html()->label('Search')->class('form-label') }}
<div class="search-box">
{{ html()->text('search', request('search'))->class('form-control form-control-sm')->placeholder('Search...') }}
<i class="ri-search-line search-icon"></i>
</div>
</div>
<div class="col-sm-3">
{{ html()->label('Branch')->class('form-label') }}
{{ html()->select('branch_id', $branch, request('branch_id'))->placeholder('-Select-')->class('form-select form-select-sm') }}
</div>
</div>
<!--end row-->
<div class="d-flex justify-content-center list-grid-nav hstack mt-2 gap-1">
<button type="submit" class="btn btn-warning btn-sm">Filter</button>
<a href="{{ route('employee.index') }}" class="btn btn-danger btn-sm reset-filter">Reset</a>
</div>
{{ html()->form()->close() }}

View File

@@ -0,0 +1,136 @@
<div class="row">
<div class="col-lg-8 col-xl-9">
<div class="card shadow-sm">
<div class="card-body">
<h6 class="card-title text-primary mb-4">Personal Details</h6>
<div class="row g-3">
<div class="col-lg-4 col-md-6">
{{ html()->label('First Name')->class('form-label')->for('first_name') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->text('first_name')->class('form-control')->placeholder('Enter First Name')->required() }}
{{ html()->div('Please enter first name')->class('invalid-feedback') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Middle Name')->class('form-label')->for('middle_name') }}
{{ html()->text('middle_name')->class('form-control')->placeholder('Enter Middle Name') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Last Name')->class('form-label')->for('last_name') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->text('last_name')->class('form-control')->placeholder('Enter Last Name')->required() }}
{{ html()->div('Please enter last name')->class('invalid-feedback') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Gender')->class('form-label')->for('gender_id') }}
{{ html()->select('gender_id', @$genderOptions)->class('form-select choices-select')->placeholder('Select') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Date of Birth')->class('form-label')->for('dob') }}
<x-flatpickr-input name="dob" id="dob" placeholder="Enter Date of Birth"
data-default-date="{{ @$employee->dob }}" />
{{ html()->div('Please choose dob')->class('invalid-feedback') }}
</div>
</div>
<div class="border border-1 border-dashed my-3"></div>
<h6 class="card-title text-primary mb-4">Contact Information</h6>
<div class="row g-3">
<div class="col-lg-4 col-md-6">
{{ html()->label('Email')->class('form-label')->for('email') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->email('email')->class('form-control')->placeholder('Enter Email')->required() }}
{{ html()->div('Please enter email')->class('invalid-feedback') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Mobile')->class('form-label')->for('mobile') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->text('mobile')->class('form-control')->placeholder('Enter Mobile Number')->required() }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Phone Number')->class('form-label')->for('contact') }}
{{ html()->text('contact')->class('form-control')->placeholder('Enter Phone Number') }}
</div>
<div class="col-lg-6 col-md-6">
{{ html()->label('Permanent Address')->class('form-label')->for('permanent_address') }}
{{ html()->text('permanent_address')->class('form-control')->placeholder('Enter Permanent Address') }}
</div>
<div class="col-lg-6 col-md-6">
{{ html()->label('Temporary Address')->class('form-label')->for('temporary_address') }}
{{ html()->text('temporary_address')->class('form-control')->placeholder('Enter Temporary Address') }}
</div>
</div>
<div class="border border-1 border-dashed my-3"></div>
<h6 class="card-title text-primary mb-4">Job Details</h6>
<div class="row g-3">
<div class="col-lg-4 col-md-6">
{{ html()->label('Branch')->class('form-label')->for('branch_id') }}
{{ html()->select('branch_id', @$branchOptions)->class('form-select choices-select')->placeholder('Select') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Department')->class('form-label')->for('department_id') }}
{{ html()->select('department_id', @$departmentOptions)->class('form-select choices-select')->placeholder('Select') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Designation')->class('form-label')->for('designation_id') }}
{{ html()->select('designation_id', @$designationOptions)->class('form-select choices-select')->placeholder('Select') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Join Date')->class('form-label')->for('join_date') }}
<x-flatpickr-input name="join_date" id="join_date" placeholder="Enter Join Date"
data-default-date="{{ @$employee->join_date }}" />
</div>
</div>
<div class="border border-1 border-dashed my-3"></div>
<h6 class="card-title text-primary mb-4">Additional Information</h6>
<div class="row g-3">
<div class="col-lg-6 col-md-6">
{{ html()->label('Guardian Name')->class('form-label')->for('guardian_name') }}
{{ html()->text('guardian_name')->class('form-control')->placeholder('Enter Guardian Name') }}
</div>
<div class="col-lg-6 col-md-6">
{{ html()->label('Guardian Contact')->class('form-label')->for('guardian_contact') }}
{{ html()->text('guardian_contact')->class('form-control')->placeholder('Enter Guardian Contact') }}
</div>
<div class="col-12">
{{ html()->label('About')->class('form-label')->for('about') }}
{{ html()->textarea('remarks')->class('form-control ckeditor-classic')->placeholder('Enter Description...') }}
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-xl-3">
<div class="card">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Status
</h6>
</div>
<div class="card-body">
{{ html()->label('Status')->class('form-label visually-hidden')->for('status') }}
{{ html()->select('status', @$statusOptions, @$employee->status)->class('form-select choices-select')->placeholder('Select')->required() }}
</div>
<x-form-buttons :href="route('employee.index')" :label="isset($employee) ? 'Update' : 'Create'" />
</div>
<div class="card featured-image-section">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Profile Picture
</h6>
</div>
<div class="card-body">
<div class="mb-3">
{{ html()->label('Featured')->class('form-label visually-hidden')->for('photo') }}
<x-image-input :data="$editable ? $employee->getRawOriginal('photo') : null" id="photo" name="photo" :editable="$editable" :multiple=false />
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,76 @@
<div class="modal fade" id="leaveModal" tabindex="-1" aria-labelledby="leaveLabel"
aria-modal="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header model-primary">
<h5 class="modal-title" id="leaveModalgridLabel">Apply Leave</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="{{ route('leave.store') }}" class="needs-validation" novalidate method="post">
@csrf
<div class="row gy-2">
<input type="hidden" id="employee_id" name="employee_id" value="{{ $employee->id }}">
<div class="col-md-6">
{{ html()->label('Employee')->class('form-label') }}
{{html()->span('*')->class('text-danger')}}
{{ html()->select('employee_id', $employeeList)->class('form-select select2')->placeholder('Select Employee')->required() }}
{{ html()->div('Please Select Employee')->class('invalid-feedback') }}
</div>
<div class="col-md-6">
{{ html()->label('Leave Type')->class('form-label') }}
{{html()->span('*')->class('text-danger')}}
{{ html()->select('leave_type_id', $leaveTypeList)->class('form-select select2')->attributes(['id' => 'leave_type_id'])->placeholder('Select Leave Type')->required() }}
{{ html()->div('Please Select Leave Type')->class('invalid-feedback') }}
</div>
<div class="col-md-12">
{{ html()->label('Selet Duration')->class('form-label') }}
{{html()->span('*')->class('text-danger')}}
<div>
@php
$leaveDuration = isset($leave) && is_object($leave) ? $leave->duration : null;
@endphp
@foreach ($duration as $durationKey => $durationItem)
<div class="form-check form-check-inline">
{{ html()->radio('duration')->class('form-check-input duration')
->checked(old('duration', $leaveDuration === $durationKey))
->attributes(['id' => $durationKey])
->value($durationKey)
->required() }}
{{ html()->label($durationItem)->class('form-check-label')->for($durationKey) }}
</div>
@endforeach
</div>
</div>
<div class="col-md-12">
{{ html()->label('Choose Date')->class('form-label') }}
{{ html()->text('start_date')->class('form-control start-date')->placeholder('Select Start Date')->attributes([])->required() }}
{{ html()->div('Please Select Start Date')->class('invalid-feedback') }}
</div>
<div class="col-md-8 leave-note">
<ul class="list-group">
</ul>
</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="mt-4 text-end">
<button type="submit" class="btn btn-success w-sm">Save</button>
</div>
</form>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,59 @@
<div class="card">
<div class="card-body">
<div class="d-flex justify-content-between mb-3">
<h5 class="card-title">Leave</h5>
<div class="">
{{-- <a href="javascript:void(0);" class="btn btn-sm btn-success float-end1" data-bs-toggle="modal" data-bs-target="#leaveModal"><i
class="ri-edit-box-line align-bottom"></i> Apply Leave</a> --}}
</div>
</div>
<!-- Small Tables -->
<table class="display table-sm table-bordered align-center buttons-datatables1 table" style="width:100%">
<thead>
<tr>
<th>Leave Type</th>
<th>Dates</th>
<th>Status</th>
</tr>
</thead>
<tbody>
@forelse ($leaves as $key => $leave)
<tr>
<td>
<div class="d-flex align-items-center">
<div class="">
<h5 class="fs-12 fw-medium my-1">
{{ optional($leave->leaveType)->name }} <span class="text-danger">({{ $leave->total_days }}
days)</span>
</h5>
<span class="fs-10 text-danger text-bold">{{ $leave->getDuration() }}</span>
</div>
</div>
</td>
<td>
@foreach ($leave->start_date as $dates)
@foreach ($dates as $date)
<li class="fs-12">{{ $date }}</li>
@endforeach
@endforeach
</td>
<td>
<span class="badge bg-{{ $leave->status_name['color'] }}">
{!! $leave->status_name['status'] !!} </span>
<p class="text-info fs-10 mb-0">{{ optional($leave->approveBy)->name }}</p>
<p class="text-muted fs-10">{!! $leave->description !!}</p>
</td>
</tr>
@empty
<tr>
<td colspan="7" class="text-center"> No Leave Found</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<!--end card-body-->
</div>
@include('employee::partials.leave-modal')
{{-- @include('lead::lead.section.followup.form') --}}

View File

@@ -0,0 +1,384 @@
@extends('layouts.app')
@inject('dropdown', 'Modules\Admin\Repositories\DropdownRepository')
@section('content')
<div class="page-content">
<div class="container-fluid">
<div class="profile-foreground position-relative mx-n4 mt-n5">
<div class="employee-wid-bg profile-wid-bg">
<img src="{{ asset('assets/images/profile-bg.jpg') }}" alt="" class="profile-wid-img">
</div>
</div>
<div class="mb-lg-3 pb-lg-4 profile-wrapper mb-4 pt-4">
<div class="row g-4">
<div class="col-auto">
<div class="avatar-lg">
<img src="{!! asset('storage/' . $employee->profile_picture) !!}" alt="user-img" class="img-thumbnail rounded-circle">
</div>
</div>
<!--end col-->
<div class="col">
@if($employee->first_name && $employee->last_name)
<div class="d-flex justify-content-between align-items-center p-2">
<h3 class="mb-1 text-white">
{{ $employee->first_name }} {{ $employee->middle_name }} {{ $employee->last_name }}
</h3>
</div>
<div>
<p class="ri-phone-line text-white text-opacity-75">
{{ $employee->contact }}
<span class="ri-mail-line p-3 text-opacity-75">
{{ $employee->email }}
</span>
</p>
</div>
@if ($department || $desgination)
<p class="text-white text-opacity-75">
{{ $department }}{{ $department && $desgination ? ', ' : '' }}{{ $desgination }}
</p>
@endif
@if($employee->temporary_address || $employee->permanent_address)
<div class="hstack text-white-50 gap-1">
@if($employee->temporary_address)
<div class="me-2">
<i class="ri-map-pin-user-line fs-16 me-1 align-middle text-white text-opacity-75"></i>
{{ $employee->temporary_address }}
</div>
@endif
@if($employee->permanent_address)
<div>
<i class="ri-building-line fs-16 me-1 align-middle text-white text-opacity-75"></i>
{{ $employee->permanent_address }}
</div>
@endif
</div>
@endif
@endif
</div>
<!--end col-->
<div class="col-12 col-lg-auto order-lg-0 order-last">
<div class="row text text-white-50 text-center">
<div class="col-lg-6 col-4">
<div class="p-2">
<h4 class="mb-1 text-white"></h4>
<p class="fs-14 mb-0"></p>
</div>
</div>
<div class="col-lg-6 col-4">
<div class="p-2">
<h4 class="mb-1 text-white"></h4>
<p class="fs-14 mb-0"></p>
</div>
</div>
</div>
</div>
<!--end col-->
</div>
<!--end row-->
</div>
<div class="row">
<div class="col-3">
<div class="card">
<div class="card-body">
<h5 class="card-title mb-3">Basic Info</h5>
<div class="d-flex align-items-center mb-2">
<div class="flex-shrink-0">
<p class="mb-0">Full Name:</p>
</div>
<div class="flex-grow-1 ms-2">
<h6 class="mb-0">{{ $employee->full_name }}</h6>
</div>
</div>
<div class="d-flex align-items-center mb-2">
<div class="flex-shrink-0">
<p class="mb-0">DOB:</p>
</div>
<div class="flex-grow-1 ms-2">
<h6 class="mb-0">{{ $employee->dob }}</h6>
</div>
</div>
<div class="d-flex align-items-center mb-2">
<div class="flex-shrink-0">
<p class="mb-0">Role:</p>
</div>
<div class="flex-grow-1 ms-2">
@if ($employee->user)
<span class="badge bg-success fs-12">{{ optional($employee->user)->getRoleNames()->first() }}</span>
@endif
</div>
</div>
</div><!-- end card body -->
</div><!-- end card -->
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Leave Remaining</h5>
</div>
<div class="card-body p-2">
<div class="table-responsive">
<table class="table-nowrap table-sm mb-0 table align-middle">
<thead class="table-dark text-white">
<tr>
<th scope="col" style="width: 62;">Leave Type</th>
<th scope="col">Total</th>
<th scope="col">Remain</th>
</tr>
</thead>
<tbody id="leaveRemainTable">
@forelse ($leaveBalance as $key => $leave)
<tr>
<td>
{{ $leave['leave_type'] ?: 'N/A' }}
</td>
<td>
{{ $leave['total'] }}
</td>
<td>
{{ $leave['remain'] }}
</td>
</tr>
@empty
<tr>
<td colspan="7" class="text-center"> No Leave Found</td>
</tr>
@endforelse
</tbody><!-- end tbody -->
</table><!-- end table -->
</div>
</div>
<!-- end card body -->
</div>
</div>
<div class="col-9">
<div class="d-flex profile-wrapper">
<!-- Nav tabs -->
<ul class="nav nav-pills animation-nav profile-nav gap-lg-3 flex-grow-1 gap-2" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link fs-14 active" data-bs-toggle="tab" href="#overview-tab" role="tab"
aria-selected="true">
<i class="ri-airplay-fill d-inline-block d-md-none"></i> <span
class="d-none d-md-inline-block">Overview</span>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fs-14" data-bs-toggle="tab" href="#activities" role="tab" aria-selected="false"
tabindex="-1">
<i class="ri-list-unordered d-inline-block d-md-none"></i> <span
class="d-none d-md-inline-block">Leave</span>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fs-14" data-bs-toggle="tab" href="#projects" role="tab" aria-selected="false"
tabindex="-1">
<i class="ri-price-tag-line d-inline-block d-md-none"></i> <span
class="d-none d-md-inline-block">Attendance</span>
</a>
</li>
</ul>
<div class="flex-shrink-0">
<a href="{{ route('employee.edit', $employee->id) }}" class="btn btn-success"><i
class="ri-edit-box-line align-bottom"></i> Edit Profile</a>
</div>
</div>
<!-- Tab panes -->
<div class="tab-content text-muted pt-4">
<div class="tab-pane active" id="overview-tab" role="tabpanel">
<div class="row">
<div class="col-md-9">
<div class="card">
<div class="card-body">
<h5 class="card-title mb-3">About</h5>
<p>{{ $employee->remarks }}</p>
<div class="border-top border-top-dashed mt-4 pt-3">
<div class="row gy-3">
<div class="col-lg-3 col-sm-6">
<div>
<p class="text-uppercase fw-medium mb-2">Join Date :</p>
<h5 class="fs-15 mb-0">{{ $employee->join_date ?? 'N/A' }}</h5>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div>
<p class="text-uppercase fw-medium mb-2">Designation :</p>
<h5 class="fs-15 mb-0">{{ $desgination ?? 'N/A' }}</h5>
</div>
</div>
<div class="col-lg-3 col-sm-6">
<div>
<p class="text-uppercase fw-medium mb-2">Department :</p>
<div class="badge bg-danger fs-12">{{ $department ?? 'N/A' }}</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- end card -->
<div class="card">
<div class="card-body">
<h5 class="card-title">Activity</h5>
<div class="simplebar-scrollable-y py-3" data-simplebar style="max-height: 400px;">
<div class="acitivity-timeline">
@if ($employee->activityLogs != null)
@foreach ($employee->activityLogs as $log)
<div class="acitivity-item d-flex py-2">
<div class="avatar-xs acitivity-avatar flex-shrink-0">
<div class="avatar-title bg-primary-subtle text-primary rounded-circle">
{{ substr($log->title, 0, 1) }}
</div>
</div>
<div class="flex-grow-1 ms-3">
<h6 class="mb-1">{{ $log->title }} </h6>
<p class="text-muted mb-0">{{ $log->data }}</p>
</div>
<div class="d-flex flex-column ms-3 flex-shrink-0">
<span class="badge bg-secondary fs-12 text-white">{{ $log->createdBy?->name }}</span>
<small class="text-danger mb-2">{{ $log->created_at?->format('d M, Y') }}</small>
</div>
</div>
@endforeach
@endif
</div>
</div>
</div>
<!--end card-body-->
</div>
</div>
<div class="col-md-3">
<div class="list-group">
<li class="list-group-item active">Action</li>
@can('employee.assignRole')
<a href="javascript:void(0);" data-bs-toggle="modal" data-bs-target="#assignRoleModal"
data-email="{{ $employee->email }}"
data-role="{{ $employee->user ? $employee->user->roles->first()->id ?? '' : '' }}"
class="list-group-item list-group-item-action">
<i class="ri-speed-fill text-primary me-2 align-middle"></i>
Assign Roles
</a>
@endcan
<a href="javascript:void(0);" data-bs-toggle="modal" data-bs-target="#changePasswordModal"
class="list-group-item list-group-item-action" class="ri-speed-fill text-info me-2 align-middle"
data-id="{{ $employee->id }}">
<i class="ri-lock-unlock-line text-danger"></i> Change Password
</a>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="activities" role="tabpanel">
@include('employee::partials.leave')
</div>
<div class="tab-pane fade" id="projects" role="tabpanel">
@include('employee::partials.attendance')
</div>
</div>
<!--end tab-content-->
</div>
</div>
<!--end col-->
</div>
<!--end row-->
</div>
</div>
<div class="modal fade" id="changePasswordModal" tabindex="-1" aria-labelledby="changePasswordLabel"
aria-modal="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header model-primary">
<h5 class="modal-title" id="exampleModalgridLabel">Change Password</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="{{ route('employee.changePassword') }}" class="needs-validation" novalidate method="post">
@csrf
<div class="row gy-2">
<input type="hidden" id="employee_id" name="employee_id" value="{{ $employee->id }}">
<div class="col-lg-12">
{{ html()->label('New Password')->class('form-label') }}
{{ html()->password('password')->class('form-control')->placeholder('Enter New Password')->required() }}
</div>
<div class="col-lg-12">
{{ html()->label('Confirm New Password')->class('form-label') }}
{{ html()->password('confirm_password')->class('form-control')->placeholder('Confirm New Password')->required() }}
</div>
</div>
<div class="mt-4 text-end">
<button type="submit" class="btn btn-success w-sm">Save</button>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="assignRoleModal" tabindex="-1" aria-labelledby="assignRoleLabel" aria-modal="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header model-primary">
<h5 class="modal-title" id="exampleModalgridLabel">Assign Role</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{ html()->form('POST')->route('employee.assignRole')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
<div class="row gy-2">
<div class="col-lg-12">
{{ html()->label('Email')->class('form-label') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->email('email')->class('form-control email-field')->placeholder('Enter Email')->isReadonly(false)->required() }}
</div>
<div class="col-lg-12">
{{ html()->label('Role')->class('form-label') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->select('role_id', $roleList)->class('form-select')->placeholder('Select Role')->required() }}
</div>
</div>
<div class="mt-4 text-end">
<button type="submit" class="btn btn-success w-sm">Save</button>
</div>
{{ html()->form()->close() }}
</div>
</div>
</div>
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/profile.init.js') }}"></script>
<script src="{{ asset('assets/libs/swiper/swiper-bundle.min.js') }}"></script>
<script>
$(document).ready(function() {
$('#assignRoleModal').on('show.bs.modal', function(event) {
var button = $(event.relatedTarget);
var email = button.data('email');
var roleId = button.data('role');
$(this).find('.email-field').val(email);
$(this).find('select[name="role_id"]').val(roleId);
});
});
</script>
@endpush