initial commit

This commit is contained in:
2026-06-29 13:00:18 +06:00
commit f2aea74471
3931 changed files with 562423 additions and 0 deletions

View File

@@ -0,0 +1,139 @@
@extends('layouts.admin')
@section('content')
<div class="row">
<div class="col-xs-12 col-sm-12 column col-sm-offset-0 ">
<div class="panel panel-default panel-frm">
<div class="panel-heading">
<div class="row" style="padding-left: 25px;padding-right: 15px">
<h3 class="pull-left">Employee Registration</h3>
@if(isShowContent('employee.list'))
<a href="{{route('employee.list')}}" class="btn btn-success btn-flat pull-right">
<i class="fa fa-user" aria-hidden="true"></i>
Employee List
</a>
@endif
</div>
</div>
<div class="panel-body">
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<form method="post" action="{{route('insert.employee')}}" id="client_form" autocomplete="on" enctype=multipart/form-data class="input-form-section">
@csrf
<div class="x_content">
<div class="col-md-12">
<div class="row">
<div class="col-md-6 col-xs-12">
<div class="form-group">
<label for="first_name">First Name</label>
<input class="form-control" name="first_name" type="text"
id="firstname">
</div>
</div>
<div class="col-md-6 col-xs-12">
<div class="form-group">
<label for="last_name">Last Name</label>
<input class="form-control" name="last_name" type="text">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-12">
<div class="form-group">
<label for="email">Email</label>
<input class="form-control" name="email" value=""
type="text" autocomplete="on">
</div>
</div>
<div class="col-md-6 col-xs-12">
<div class="form-group">
<label for="password">Password</label>
<div class="input-group" id="employee_registration_show_hide_password">
<input class="form-control" name="password"
type="password"
id="password">
<div class="input-group-addon">
<a href=""><i class="fa fa-eye-slash" aria-hidden="true"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-12" style="margin-left: 10px">
@include('partials.permission',['moduleSubmoduleAssoc'=>$moduleSubmoduleAssoc])
</div>
</div>
</div>
<div class="col-sm-12 center" style="margin-top: 10px; text-align: center; ">
@if(isShowContent('insert.employee'))
<input class="btn btn-success btn2" type="submit" value="Save Changes">
@endif
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('script')
<script src="{{asset('js/jsvalidate/validate-latest.js')}}"></script>
<script>
$('#client_form').validate({
rules: {
'first_name': 'required',
'last_name': 'required',
'email': { 'required':true,'email':true},
'password': 'required',
'userRole': 'required',
},
messages: {
'first_name': {
required: "Please enter your first name"
},
'last_name': {
required: "Please enter your last name"
},
'email': {
required: "Please enter an email address",
email: "Please enter a valid email address"
},
'password': {
required: "Please enter password again",
},
},
highlight: function (element) {
$(element).parent().addClass("has-error");
},
submitHandler: function (form) {
form.submit();
}
});
$('#employee_registration_show_hide_password a').on('click', function(event){
common_helper.globalPasswordView('#employee_registration_show_hide_password',event);
})
const birthDateCompleted=()=>{
let birth_date=$("[name='birth_date']").val();
if(birth_date.length===2){
birth_date+='/';
}
else if(birth_date.length===5){
birth_date+='/';
}
$("[name='birth_date']").val(birth_date);
}
</script>
@endpush

View File

@@ -0,0 +1,135 @@
@extends('layouts.admin')
@section('content')
<div class="row">
<div class="col-xs-12 col-sm-12 column col-sm-offset-0 ">
<div class="panel panel-default panel-frm">
<div class="panel-heading">
<div class="row" style="padding-left: 25px;padding-right: 15px">
<h3 class="pull-left">Information of {{$employee['first_name'].' '.$employee['last_name']}}</h3>
@if(isShowContent('employee.list'))
<a href="{{route('employee.list')}}" class="btn btn-success btn-flat pull-right">
<i class="fa fa-list" aria-hidden="true"></i>
Employee List
</a>
@endif
</div>
</div>
<div class="panel-body">
<div class="clearfix"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<form method="post" action="{{route('update.employee')}}" id="employee_edit_form" autocomplete="on" enctype=multipart/form-data class="input-form-section">
@csrf
<input type="hidden" name="id" value="{{$employee['id']}}">
<div class="x_content">
<div class="col-md-12">
<div class="row">
<div class="col-md-6 col-xs-12">
<div class="form-group">
<label for="first_name">First Name</label>
<input class="form-control"
name="first_name"
type="text"
value="{{$employee['first_name']}}"
id="firstname">
</div>
</div>
<div class="col-md-6 col-xs-12">
<div class="form-group">
<label for="last_name">Last Name</label>
<input class="form-control" name="last_name" value="{{$employee['last_name']}}" type="text">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-12">
<div class="form-group">
<label for="email">Email</label>
<input class="form-control" name="email" value="{{$employee['email']}}"
type="text" autocomplete="on">
</div>
</div>
<div class="col-md-6 col-xs-12">
<div class="form-group">
<label for="password">Password</label>
<div class="input-group" id="employee_edit_show_hide_password">
<input class="form-control" name="password"
type="password"
value="{{customDecrypt($employee['password'])}}"
id="password">
<div class="input-group-addon">
<a href=""><i class="fa fa-eye-slash" aria-hidden="true"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-12" style="margin-left: 10px">
@include('partials.permission',['moduleSubmoduleAssoc'=>$moduleSubmoduleAssoc,'employee_permission'=>$employee_permission])
</div>
</div>
</div>
<div class="col-sm-12 center" style="margin-top: 10px; text-align: center; ">
@if(isShowContent('update.employee'))
<input class="btn btn-success btn2" type="submit" value="Save Changes">
@endif
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('script')
<script src="{{asset('js/jsvalidate/validate-latest.js')}}"></script>
<script>
$('#employee_edit_form').validate({
rules: {
'first_name': 'required',
'last_name': 'required',
'email': { 'required':true,'email':true},
'password': 'required',
'userRole': 'required',
},
messages: {
'first_name': {
required: "Please enter your first name"
},
'last_name': {
required: "Please enter your last name"
},
'email': {
required: "Please enter an email address",
email: "Please enter a valid email address"
},
'password': {
required: "Please enter password again",
},
},
highlight: function (element) {
$(element).parent().addClass("has-error");
},
submitHandler: function (form) {
form.submit();
}
});
$('#employee_edit_show_hide_password a').on('click', function(event){
common_helper.globalPasswordView('#employee_edit_show_hide_password',event);
})
</script>
@endpush

View File

@@ -0,0 +1,204 @@
@extends('layouts.admin')
<style>
#table-clients td {
text-align: left !important;
padding: 8px !important;
}
#table-clients th {
padding: 8px !important;
}
</style>
@php
$pageLimit = $searchData['pageLimit'];
$search_value = $searchData['search_value'];
@endphp
@section('content')
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row" style="padding-left: 20px;padding-right: 15px">
<h3 class="pull-left">Employee List</h3>
@if(isShowContent('create.employee'))
<a href="{{route('create.employee')}}" class="btn btn-success btn-flat pull-right">
<i class="fa fa-user" aria-hidden="true"></i>
Add Employee
</a>
@endif
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_content">
<form action="{{route('employee.list')}}" method="get" role="search">
<div class="row">
<div class="col-md-2 col-xs-12">
<div class="form-group">
<label>Show</label>
<select name="pageLimit" id="pagination" class="form-control"
onchange="this.form.submit()">
<option value="10" @if($pageLimit == 10) selected @endif>10</option>
<option value="20" @if($pageLimit == 20) selected @endif>20</option>
<option value="50" @if($pageLimit == 50) selected @endif>50</option>
<option value="100" @if($pageLimit == 100) selected @endif>100</option>
<option value="500" @if($pageLimit == 500) selected @endif>500</option>
</select>
</div>
</div>
<div class="col-md-4 col-xs-12">
<div class="form-group">
<label>Employee Name/Email</label>
<input id="search_value"
type="text"
value="{{$searchData['search_value']}}"
placeholder="Search By Name/Email"
class="form-control" name="search_value" autocomplete="off">
</div>
</div>
<div class="col-md-2 col-xs-12">
<div class="form-group" style="margin-top: 25px;">
<button class="btn btn-outline-info" style="width:100%" type="submit">Search</button>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
@if(isShowContent('admin.ajax.process'))
<button style="margin-top: 15px;" onclick="return multipleEmployeeDelete()" type="button"
class="btn btn-danger pull-left" style="margin-left: 10px"
id="btnDeleteMultipleEmployee" disabled>Delete Employee
</button>
@endif
</div>
</div>
</form>
<div class="table-responsive py-5">
<table id="table-clients" class="table table-bordered table-hover">
<thead>
<tr>
<th><input type="checkbox" name="allChecked" value="all"
onclick="common_helper.allChecked(this,'checkedBoxEmployee')"></th>
<th>Employee Name</th>
<th>Email</th>
<th>Created At</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@if(!empty($employees))
@foreach ($employees as $key => $obj)
@php
$employee_info = json_encode([$obj->id,$obj->email]);
$action = 'DELETE_EMPLOYEE';
@endphp
<tr class="tr-height">
<td style="text-align: center !important;"><input type="checkbox" name="checkedBoxEmployee"
value="{{$employee_info}}" onclick="checkedornot(this)"></td>
<td>{{$obj->first_name.' '.$obj->last_name}}</td>
<td>{{ $obj->email}}</td>
<td> {{ getStringToDateTime($obj->created_at,'m/d/Y h:i:s a') }} </td>
<td>
@if(isShowContent('get.employee.info'))
<a href="{{route('get.employee.info',$obj->id)}}"
class="btn btn-success" style="padding: 5px;"> <span
class="glyphicon glyphicon-pencil" title="Edit"></span></a>
@endif
@if(isShowContent('get.employee.info'))
<button onclick="return employeeDelete({{$employee_info}},'{{$action}}')"
class="btn btn-danger" style="padding: 5px;"><span
class="glyphicon glyphicon-trash" title="Delete"></span>
</button>
@endif
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
<div id="pagination_panel">
{{ $employees->appends(compact('pageLimit' , 'search_value')) ->links('basic.pagination') }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('script')
<script>
const allEmployeeChecked =(e)=>{
$('input:checkbox').prop('checked',e.checked);
$('#btnDeleteMultipleEmployee').prop('disabled',(!e.checked));
}
const multipleEmployeeDelete = () => {
let action = 'DELETE_MULTIPLE_EMPLOYEE';
let checkedData = $("[name='checkedBoxEmployee']");
let clientId = [];
for (let checkbox of checkedData) {
if (checkbox.checked)
clientId.push(checkbox.value);
}
if (clientId.length > 0) {
employeeDelete(clientId,action);
}
}
const employeeDelete = (userData,action) => {
let html_content = `<h4>Are you sure you want to delete employee?</h4>`;
const swalresponse = common_helper.swalAleart(html_content, 'warning', 450, true, '', true, true, 'Yes');
swalresponse.then(async function (result) {
if (result.isConfirmed) {
let response = await common_helper.globalAjaxRequest('{{route('admin.ajax.process')}}', 'POST', {
action: action,
userData: userData,
delete_type:'employee',
_token: "{{ csrf_token() }}"
});
if (response.status) {
Swal.fire({icon: response.type, title: response.message, width: 450, closeOnConfirm: true});
window.location = `{{route('employee.list')}}`;
} else {
Swal.fire({icon: response.type, title: response.message, width: 450, closeOnConfirm: true});
}
}
})
}
const checkedornot = (e) => {
let allData = $("[name='checkedBoxEmployee']");
let checkedData = $("[name='checkedBoxEmployee']:checked");
let allChecked = false;
let alldelete = false;
if(allData.length === checkedData.length){
allChecked = true;
}
if(checkedData.length === 0){
alldelete = true;
}
$("[name='allChecked']").prop('checked', allChecked);
$('#btnDeleteMultipleEmployee').prop('disabled', alldelete);
}
</script>
@endpush