tracker issue leave expence asset
This commit is contained in:
parent
58029bb5c7
commit
517611d8e4
@ -23,7 +23,7 @@
|
|||||||
| a PHP script and you can easily do that on your own.
|
| a PHP script and you can easily do that on your own.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
$base = "https://".$_SERVER['HTTP_HOST'];
|
$base = "http://".$_SERVER['HTTP_HOST'];
|
||||||
$base .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
|
$base .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
|
||||||
$config['base_url'] = $base;
|
$config['base_url'] = $base;
|
||||||
|
|
||||||
|
|||||||
@ -170,9 +170,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Main Image </label>
|
<label class="control-label col-md-1 col-sm-1" for="first-name"> Main Image </label>
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5">
|
||||||
<input id="formFile" name="asset_img" class="typeFile" type="file" >
|
<input id="formFile" name="asset_img" class="typeFile" type="file" accept=".png, .jpg, .jpeg" onchange="checkFileFormat()">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -210,3 +210,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /Body page content -->
|
<!-- /Body page content -->
|
||||||
|
<script>
|
||||||
|
function checkFileFormat() {
|
||||||
|
var input = document.getElementById('formFile');
|
||||||
|
var fileName = input.value;
|
||||||
|
var allowedFormats = ['.png', '.jpg', '.jpeg'];
|
||||||
|
|
||||||
|
if (fileName) {
|
||||||
|
var fileExtension = fileName.slice((fileName.lastIndexOf(".") - 1 >>> 0) + 2);
|
||||||
|
|
||||||
|
if (allowedFormats.indexOf(fileExtension.toLowerCase()) === -1) {
|
||||||
|
alert('Please choose a valid image file (PNG, JPG, JPEG).');
|
||||||
|
input.value = ''; // Clear the file input to allow choosing a new file
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
<input type="hidden" name="category" value="<?php echo $tableData[0]->category; ?>" >
|
<input type="hidden" name="category" value="<?php echo $tableData[0]->category; ?>" >
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div class="col-md-5 col-sm-5 " for="first-name"> </div>
|
<div class="col-md-5 col-sm-5 " for="first-name"> </div>
|
||||||
<div class="col-md-3 col-sm-3 " for="first-name"><h2> Filter with purchase date : </h2> </div>
|
<div class="col-md-3 col-sm-3 " for="first-name"><h2> Filter with purchase date </h2> </div>
|
||||||
<div class="col-md-3 col-sm-3 ">
|
<div class="col-md-3 col-sm-3 ">
|
||||||
<div class="control-group ">
|
<div class="control-group ">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
<a href="<?php echo base_url()?>Asset/addAsset/<?php echo md5($value->id);?>" ><i class="fa fa-copy" title="Copy"></i></a>
|
<a href="<?php echo base_url()?>Asset/addAsset/<?php echo md5($value->id);?>" ><i class="fa fa-copy" title="Copy"></i></a>
|
||||||
|
|
||||||
<a><i class="fa fa-trash deleteAsset" data-toggle="modal" data-target=".bs-example-modal-sm" id="<?php echo md5($value->id);?>" ></i></a>
|
<a onclick="myFunction()"><i class="fa fa-trash " data-toggle="modal" data-target=".bs-example-modal-sm" id="<?php echo md5($value->id);?>" ></i></a>
|
||||||
<!-- <a href="<?php echo base_url()?>Asset/deleteAsset/<?php echo md5($value->id);?>" ><i class="fa fa-trash" title="Delete"></i></a> -->
|
<!-- <a href="<?php echo base_url()?>Asset/deleteAsset/<?php echo md5($value->id);?>" ><i class="fa fa-trash" title="Delete"></i></a> -->
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -121,7 +121,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
<!-- <input type="text" id="myInput"> -->
|
||||||
|
<!-- <button onclick="myFunction()">Click me</button> -->
|
||||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
||||||
|
|
||||||
<div style="display:none" id="sub-value">
|
<div style="display:none" id="sub-value">
|
||||||
@ -129,6 +130,29 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
||||||
<script>
|
<script>
|
||||||
|
function myFunction() {
|
||||||
|
console.log('entered');
|
||||||
|
// Get the input value
|
||||||
|
// var inputValue = document.getElementById("myInput").value;
|
||||||
|
var id = $(this).attr('id');
|
||||||
|
var url = "<?php echo base_url()?>Asset/deleteAsset";
|
||||||
|
console.log('before api call');
|
||||||
|
$.ajax({
|
||||||
|
url: "<?php echo base_url()?>Asset/getDeleteConfirmationPopup",
|
||||||
|
type:"GET",
|
||||||
|
success:function(data){
|
||||||
|
console.log('api success');
|
||||||
|
$('#popup').html(JSON.parse(data));
|
||||||
|
$('.delete_id').attr('value',id);
|
||||||
|
$('.delete_url').attr('action',url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Do something with the input value (for example, alert it)
|
||||||
|
console.log("end of the function ");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$("input[type='checkbox']").change(function(){
|
$("input[type='checkbox']").change(function(){
|
||||||
if($('input[type="checkbox"]:not(:checked)').length == $('input[type="checkbox"]').length){
|
if($('input[type="checkbox"]:not(:checked)').length == $('input[type="checkbox"]').length){
|
||||||
@ -145,6 +169,7 @@
|
|||||||
|
|
||||||
|
|
||||||
$('.deleteAsset').click(function() {
|
$('.deleteAsset').click(function() {
|
||||||
|
alert("hello");
|
||||||
var id = $(this).attr('id');
|
var id = $(this).attr('id');
|
||||||
var url = "<?php echo base_url()?>Asset/deleteAsset";
|
var url = "<?php echo base_url()?>Asset/deleteAsset";
|
||||||
|
|
||||||
@ -235,6 +260,39 @@ function viewQr() {
|
|||||||
$('input:checkbox').not(this).prop('checked', this.checked);
|
$('input:checkbox').not(this).prop('checked', this.checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#datatable-buttons').DataTable({
|
||||||
|
|
||||||
|
"order": [
|
||||||
|
[0, 'desc']
|
||||||
|
],
|
||||||
|
"dom": 'Bfrtip',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'pdfHtml5',
|
||||||
|
title: 'Asset Details',
|
||||||
|
text: 'PDF',
|
||||||
|
customize: function(doc) {
|
||||||
|
doc.content[1].table.body.forEach(function(row) {
|
||||||
|
// Remove the first and last columns
|
||||||
|
row.splice(0, 1);
|
||||||
|
row.pop();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'excelHtml5',
|
||||||
|
text: 'Excel',
|
||||||
|
title: 'Asset Details',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':not(:last-child)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -1,6 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="modal-dialog modal-sm">
|
<div class="modal-dialog modal-sm">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
||||||
<!-- jQuery -->
|
<!-- jQuery -->
|
||||||
<script src="<?php echo base_url(); ?>/assets/default/jquery/dist/jquery.min.js"></script>
|
<script src="<?php echo base_url(); ?>/assets/default/jquery/dist/jquery.min.js"></script>
|
||||||
<!-- Bootstrap -->
|
<!-- Bootstrap -->
|
||||||
|
|||||||
@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
<!-- Custom Theme Style -->
|
<!-- Custom Theme Style -->
|
||||||
<link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet">
|
<link href="<?php echo base_url(); ?>/assets/default/build/css/custom.min.css" rel="stylesheet">
|
||||||
|
<!-- jquery -->
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="nav-md">
|
<body class="nav-md">
|
||||||
|
|||||||
@ -54,7 +54,7 @@ public function expence_form()
|
|||||||
public function get_emp_name()
|
public function get_emp_name()
|
||||||
{
|
{
|
||||||
$emp = $this->Expence_model->get_employee_name(user()->business_id);
|
$emp = $this->Expence_model->get_employee_name(user()->business_id);
|
||||||
$html = '<option>--select Employee--</option>';
|
$html = '<option value="">--select Employee--</option>';
|
||||||
foreach($emp as $val)
|
foreach($emp as $val)
|
||||||
{
|
{
|
||||||
if($val->user_id != user()->id)
|
if($val->user_id != user()->id)
|
||||||
|
|||||||
@ -59,7 +59,7 @@
|
|||||||
<div class="x_title">
|
<div class="x_title">
|
||||||
|
|
||||||
<button hidden id="button" class="btn btn-secondary source" onclick="new PNotify({
|
<button hidden id="button" class="btn btn-secondary source" onclick="new PNotify({
|
||||||
text: '<html><h2>Submmited for Approvel.<h2></html>',
|
text: '<html><h2>Submmited for Approval.<h2></html>',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
styling: 'bootstrap3'
|
styling: 'bootstrap3'
|
||||||
});">Success</button>
|
});">Success</button>
|
||||||
|
|||||||
@ -328,14 +328,17 @@ function matchnum(event)
|
|||||||
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>');
|
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>');
|
||||||
$userDropdown.prop('disabled', true);
|
$userDropdown.prop('disabled', true);
|
||||||
} else if (selectedValue === '<?php echo user()->name; ?> (<?php echo user()->id;?>)') {
|
} else if (selectedValue === '<?php echo user()->name; ?> (<?php echo user()->id;?>)') {
|
||||||
|
console.log("REQUIRED CALL");
|
||||||
|
// $('#user_dropdown').prop('required', true);
|
||||||
|
$('#user_dropdown').attr('required', true);
|
||||||
|
console.log($('#user_dropdown').prop('required'));
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo base_url('Expence/get_emp_name/')?>"',
|
url: '<?php echo base_url('Expence/get_emp_name/')?>"',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
$('#user_dropdown').append(response);
|
$('#user_dropdown').append(response);
|
||||||
$('#user_dropdown').prop('required', true);
|
|
||||||
|
|
||||||
$('#user_dropdown').prop('disabled', false);
|
$('#user_dropdown').prop('disabled', false);
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- jQuery -->
|
<!-- jQuery -->
|
||||||
<script src="<?php echo base_url(); ?>/assets/default/jquery/dist/jquery.min.js"></script>
|
<!-- <script src="<?php echo base_url(); ?>/assets/default/jquery/dist/jquery.min.js"></script> -->
|
||||||
<!-- Bootstrap -->
|
<!-- Bootstrap -->
|
||||||
<script src="<?php echo base_url(); ?>/assets/default/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="<?php echo base_url(); ?>/assets/default/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
<!-- FastClick ------->
|
<!-- FastClick ------->
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<!---ajax call--->
|
<!---ajax call--->
|
||||||
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script> -->
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script>
|
||||||
|
|
||||||
<title>BigBamboo Enterprise</title>
|
<title>BigBamboo Enterprise</title>
|
||||||
|
|
||||||
|
|||||||
@ -146,7 +146,10 @@ public function createLeave()
|
|||||||
$perm_data['status'] = 'pending';
|
$perm_data['status'] = 'pending';
|
||||||
$perm_data['created_date'] = date('d-m-Y');
|
$perm_data['created_date'] = date('d-m-Y');
|
||||||
$perm_data['created_time'] = date('H:i A');
|
$perm_data['created_time'] = date('H:i A');
|
||||||
|
unset($perm_data['from_date']);
|
||||||
|
unset($perm_data['to_date']);
|
||||||
$table="leave_list";
|
$table="leave_list";
|
||||||
|
// print_r($perm_data);die;
|
||||||
$create_permission = $this->MY_Model->insert($perm_data,$table);
|
$create_permission = $this->MY_Model->insert($perm_data,$table);
|
||||||
|
|
||||||
//for notification
|
//for notification
|
||||||
@ -296,7 +299,13 @@ public function edit_leave_function()
|
|||||||
$emp = $this->Emp_model->get_employee(user()->business_id);
|
$emp = $this->Emp_model->get_employee(user()->business_id);
|
||||||
$business_id = user()->business_id;
|
$business_id = user()->business_id;
|
||||||
$leavetype = $this->Leave_model->getLeaveType($business_id);
|
$leavetype = $this->Leave_model->getLeaveType($business_id);
|
||||||
|
|
||||||
$editleave = $this->Leave_model->editleave($id);
|
$editleave = $this->Leave_model->editleave($id);
|
||||||
|
// print_r($leavetype);
|
||||||
|
// print_r($id);
|
||||||
|
// print_r($editleave);
|
||||||
|
// // // print_r($emp);
|
||||||
|
// die;
|
||||||
$this->layout->set('emp', $emp);
|
$this->layout->set('emp', $emp);
|
||||||
$this->layout->set('editleave', $editleave);
|
$this->layout->set('editleave', $editleave);
|
||||||
$this->layout->set('count', $emp_leave_count);
|
$this->layout->set('count', $emp_leave_count);
|
||||||
|
|||||||
@ -403,6 +403,7 @@ function get_all_count(id) {
|
|||||||
$('#leave_bal').hide();
|
$('#leave_bal').hide();
|
||||||
$('#fromdate').removeAttr('required');
|
$('#fromdate').removeAttr('required');
|
||||||
$('#todate').removeAttr('required');
|
$('#todate').removeAttr('required');
|
||||||
|
$('#perm_id').prop('required', true);
|
||||||
$('#showtime').show();
|
$('#showtime').show();
|
||||||
$('#showdate').show();
|
$('#showdate').show();
|
||||||
$('#from_time').prop('required', true);
|
$('#from_time').prop('required', true);
|
||||||
|
|||||||
@ -16,11 +16,20 @@
|
|||||||
|
|
||||||
<input type="hidden" class="delete_id" name="id" value="">
|
<input type="hidden" class="delete_id" name="id" value="">
|
||||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" >
|
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" >
|
||||||
<button type="submit" class="btn btn-sm btn-primary" id="">Yes</button>
|
<button type="submit" class="btn btn-sm btn-primary" id="submit-btn">Yes</button>
|
||||||
</form>
|
</form>
|
||||||
</center>
|
</center>
|
||||||
</br>
|
</br>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('#submit-btn').click(function(){
|
||||||
|
$(this).prop('disabled', true); // Disable the submit button
|
||||||
|
$('.delete_url').submit(); // Submit the form
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,27 +1,30 @@
|
|||||||
<div class="modal-dialog modal-sm">
|
<div class="modal-dialog modal-sm">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
<div class="modal-header">
|
<h6 class="modal-title" id="myModalLabel2">Decline Reason</h6>
|
||||||
<h6 class="modal-title" id="myModalLabel2">Decline Reason</h6>
|
</div>
|
||||||
<!-- <button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span> -->
|
</br>
|
||||||
</button>
|
<center>
|
||||||
</div>
|
<form class="delete_url" method="post" action="" id="declineForm">
|
||||||
</br>
|
<input list="browsers" onfocus id="decline_reason" required name="declinedata" autocomplete="off" style="width:90%; height: 45px;" />
|
||||||
<center>
|
<datalist id="browsers">
|
||||||
<form class="delete_url" method="post" action="" id="">
|
<?php foreach ($dropdown as $key => $value) { ?>
|
||||||
<input list="browsers" onfocus id="decline_reason" required name="declinedata" autocomplete="off" style="width:90%; height: 45px;" />
|
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
|
||||||
<datalist id="browsers">
|
<?php } ?>
|
||||||
<?php foreach ($dropdown as $key => $value) { ?>
|
</datalist><br><br>
|
||||||
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
|
<input type="hidden" class="delete_id" name="id" value="">
|
||||||
<?php } ?>
|
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" >
|
||||||
</datalist><br><br>
|
<button type="submit" class="btn btn-sm btn-primary" id="submitBtn">Yes</button>
|
||||||
<input type="hidden" class="delete_id" name="id" value="">
|
<button type="button" class="btn btn-sm btn-secondary" id="close-form" data-dismiss="modal" aria-label="Close">No</button>
|
||||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" >
|
</form>
|
||||||
<button type="submit" class="btn btn-sm btn-primary" id="">Yes</button><button type="button" class="btn btn-sm btn-secondary" id="close-form" data-dismiss="modal" aria-label="Close">No</button>
|
</center>
|
||||||
</form>
|
</br>
|
||||||
</center>
|
</div>
|
||||||
</br>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('declineForm').addEventListener('submit', function() {
|
||||||
|
document.getElementById('submitBtn').disabled = true;
|
||||||
|
// Optionally, you can display a loading spinner or other indication here
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|||||||
@ -126,16 +126,19 @@
|
|||||||
|
|
||||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Leave Type<a style="color:red;">*</a> </label>
|
<label class="control-label col-md-2 col-sm-2 " for="last-name">Leave Type<a style="color:red;">*</a> </label>
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<select id="type" name="type" class="form-control" >
|
<select id="type" name="type" required class="form-control" onchange="permission(this.id)" >
|
||||||
<?php foreach ($leavetype as $key => $val) { ?>
|
<?php foreach ($leavetype as $key => $val) { ?>
|
||||||
<?php if($leave->type == $val->id) { ?>
|
<?php if ($leave->type == $val->id) { ?>
|
||||||
<option value="<?php echo $leave->type; ?>"><?php echo $val->type; ?></option>
|
<option value="<?php echo $leave->type; ?>" selected><?php echo $val->type; ?></option>
|
||||||
<?php } }?>
|
<?php } ?>
|
||||||
<?php foreach ($leavetype as $key => $value) { ?>
|
|
||||||
|
|
||||||
<option id="<?php echo $value->id; ?>" value="<?php echo $value->id; ?>"><?php echo $value->type; ?></option>
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
<?php foreach ($leavetype as $key => $value) { ?>
|
||||||
|
<?php if ($leave->type != $value->id) { ?>
|
||||||
|
<option id="<?php echo $value->id; ?>" value="<?php echo $value->id; ?>"><?php echo $value->type; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Balance</label>
|
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Balance</label>
|
||||||
@ -354,22 +357,27 @@ function get_all_count(id) {
|
|||||||
|
|
||||||
fromDateInput.datepicker({
|
fromDateInput.datepicker({
|
||||||
dateFormat: dateFormat,
|
dateFormat: dateFormat,
|
||||||
|
changeYear: true,
|
||||||
|
changeMonth: true,
|
||||||
|
minDate: 0,
|
||||||
onSelect: function (dateText, inst) {
|
onSelect: function (dateText, inst) {
|
||||||
toDateInput.datepicker("option", "minDate", dateText);
|
toDateInput.datepicker("option", "minDate", dateText);
|
||||||
validateDateRange();
|
|
||||||
calculateDateDifference();
|
calculateDateDifference();
|
||||||
|
DateValidate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
toDateInput.datepicker({
|
toDateInput.datepicker({
|
||||||
dateFormat: dateFormat,
|
dateFormat: dateFormat,
|
||||||
|
changeYear: true,
|
||||||
|
changeMonth: true,
|
||||||
|
minDate: 0,
|
||||||
onSelect: function (dateText, inst) {
|
onSelect: function (dateText, inst) {
|
||||||
validateDateRange();
|
|
||||||
calculateDateDifference();
|
calculateDateDifference();
|
||||||
|
DateValidate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Function to validate the date range
|
// Function to validate the date range
|
||||||
function validateDateRange() {
|
function validateDateRange() {
|
||||||
var fromDate = fromDateInput.datepicker("getDate");
|
var fromDate = fromDateInput.datepicker("getDate");
|
||||||
@ -424,7 +432,7 @@ function calculateDateDifference() {
|
|||||||
|
|
||||||
console.log($('#showtime').val())
|
console.log($('#showtime').val())
|
||||||
|
|
||||||
if( type === '9' ){
|
if( type === '1' ){
|
||||||
|
|
||||||
$('#hidedate').hide()
|
$('#hidedate').hide()
|
||||||
$('#balance').hide()
|
$('#balance').hide()
|
||||||
@ -447,6 +455,41 @@ function calculateDateDifference() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
$('#showtime').hide()
|
||||||
|
$('#showdate').hide()
|
||||||
|
|
||||||
|
$('#type').change(function() {
|
||||||
|
$('#fromdate').val('');
|
||||||
|
$('#todate').val('');
|
||||||
|
|
||||||
|
var selectedOptionId = $(this).find(":selected").attr("id");
|
||||||
|
if( selectedOptionId === 'permission'){
|
||||||
|
|
||||||
|
$('#hidedate').hide();
|
||||||
|
$('#balance').hide();
|
||||||
|
$('#leave_bal').hide();
|
||||||
|
$('#fromdate').removeAttr('required');
|
||||||
|
$('#todate').removeAttr('required');
|
||||||
|
$('#myDatepicker').prop('required', true);
|
||||||
|
$('#showtime').show();
|
||||||
|
$('#showdate').show();
|
||||||
|
$('#from_time').prop('required', true);
|
||||||
|
$('#to_time').prop('required', true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
$('#from_time').removeAttr('required');
|
||||||
|
$('#to_time').removeAttr('required');
|
||||||
|
$('#perm_id').removeAttr('required');
|
||||||
|
$('#hidedate').show();
|
||||||
|
$('#showtime').hide();
|
||||||
|
$('#showdate').hide();
|
||||||
|
$('#balance').show();
|
||||||
|
$('#leave_bal').show();
|
||||||
|
$('#fromdate').prop('required', true);
|
||||||
|
$('#todate').prop('required', true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -118,7 +118,7 @@
|
|||||||
<?php if($value->status == 'pending') { ?>
|
<?php if($value->status == 'pending') { ?>
|
||||||
|
|
||||||
<a><i class="fa fa-check approveleave" data-toggle="modal" data-target=".bs-example-modal-sm" title="Approve" id="<?php echo $value->id;?>"></i></a>
|
<a><i class="fa fa-check approveleave" data-toggle="modal" data-target=".bs-example-modal-sm" title="Approve" id="<?php echo $value->id;?>"></i></a>
|
||||||
<a><i class="fa fa-times test" data-toggle="modal" data-target=".bs-example-modal-sm" title="Decline" id="<?php echo $value->id;?>"></i></a>
|
<a><i class="fa fa-times test" data-toggle="modal" data-target=".bs-example-modal-sm" title="Decline" id="<?php echo $value->id;?>"></i></a>
|
||||||
<!-- <a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" onclick="showCustomPrompt()" id="<?php echo $value->id; ?>"></i></a> -->
|
<!-- <a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" onclick="showCustomPrompt()" id="<?php echo $value->id; ?>"></i></a> -->
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@ -295,7 +295,7 @@ function submitCustomPrompt() {
|
|||||||
text: 'Excel',
|
text: 'Excel',
|
||||||
title: 'Leave',
|
title: 'Leave',
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: ':not(:last-child)'
|
// columns: ':not(:last-child)'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -64,7 +64,7 @@
|
|||||||
src="<?php echo base_url();?>/assets/uploads/profile_picture/<?php echo $userData->profile_image ?>"
|
src="<?php echo base_url();?>/assets/uploads/profile_picture/<?php echo $userData->profile_image ?>"
|
||||||
alt="Avatar" title="Change the avatar">
|
alt="Avatar" title="Change the avatar">
|
||||||
<input id="file_profile" name="profile_image" class="typeFile1" type="file"
|
<input id="file_profile" name="profile_image" class="typeFile1" type="file"
|
||||||
accept=".png, .jpg, .jpeg" hidden />
|
accept=".png, .jpg, .jpeg" onchange="checkFileFormat()" hidden />
|
||||||
<div class="profilepic__content">
|
<div class="profilepic__content">
|
||||||
<span class="profilepic__icon"><i class="fa fa-camera"
|
<span class="profilepic__icon"><i class="fa fa-camera"
|
||||||
style="font-size:25px;color:black"></i></span>
|
style="font-size:25px;color:black"></i></span>
|
||||||
@ -124,3 +124,19 @@ class="fa fa-edit m-right-xs"></i>Edit Profile</a>
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script> -->
|
</script> -->
|
||||||
|
<script>
|
||||||
|
function checkFileFormat() {
|
||||||
|
var input = document.getElementById('file_profile');
|
||||||
|
var fileName = input.value;
|
||||||
|
var allowedFormats = ['.png', '.jpg', '.jpeg'];
|
||||||
|
|
||||||
|
if (fileName) {
|
||||||
|
var fileExtension = fileName.slice((fileName.lastIndexOf(".") - 1 >>> 0) + 2);
|
||||||
|
|
||||||
|
if (allowedFormats.indexOf(fileExtension.toLowerCase()) === -1) {
|
||||||
|
alert('Please choose a valid image file (PNG, JPG, JPEG).');
|
||||||
|
input.value = ''; // Clear the file input to allow choosing a new file
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user