tracker issues fix : RV
This commit is contained in:
parent
ebffc559ce
commit
e2b789a599
@ -106,6 +106,25 @@ public function create_business()
|
|||||||
unset($data['module_id']);
|
unset($data['module_id']);
|
||||||
$create_business = $this->MY_Model->insert($data,$table);
|
$create_business = $this->MY_Model->insert($data,$table);
|
||||||
|
|
||||||
|
if($create_business){
|
||||||
|
$data1=[
|
||||||
|
'business_id' => $this->input->post('uid'),
|
||||||
|
'type'=> 'Permission',
|
||||||
|
'days'=> '0',
|
||||||
|
'is_active' => '1',
|
||||||
|
'code ' => 'permission'
|
||||||
|
];
|
||||||
|
$data2=[
|
||||||
|
'business_id' => $this->input->post('uid'),
|
||||||
|
'type'=> 'Casual Leave',
|
||||||
|
'days'=> '0',
|
||||||
|
'is_active' => '1',
|
||||||
|
];
|
||||||
|
$table = "leave_master";
|
||||||
|
$leavemaster1 = $this->MY_Model->insert($data1,$table);
|
||||||
|
$leavemaster2 = $this->MY_Model->insert($data2,$table);
|
||||||
|
}
|
||||||
|
|
||||||
// audit history
|
// audit history
|
||||||
if($create_business)
|
if($create_business)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -253,7 +253,7 @@ class="form-control" onkeyup="check_if_exists(this.id, this.value, this.name)">
|
|||||||
|
|
||||||
|
|
||||||
<div class="col-md-5 col-sm-5 offset-md-1">
|
<div class="col-md-5 col-sm-5 offset-md-1">
|
||||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
<a href="<?php echo base_url();?>Business/business_list" class="btn btn-secondary">Cancel</a>
|
||||||
<button class="btn btn-primary" type="reset">Reset</button>
|
<button class="btn btn-primary" type="reset">Reset</button>
|
||||||
<button type="submit" class="btn btn-success">Submit</button>
|
<button type="submit" class="btn btn-success">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="col-md-5 col-sm-5 offset-md-1">
|
<div class="col-md-5 col-sm-5 offset-md-1">
|
||||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
<a href="<?php echo base_url();?>Business/module_list" class="btn btn-secondary">Cancel</a>
|
||||||
<button type="submit" class="btn btn-success">Submit</button>
|
<button type="submit" class="btn btn-success">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -260,7 +260,7 @@ class="form-control" type="text">
|
|||||||
<div class="ln_solid"></div>
|
<div class="ln_solid"></div>
|
||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
<div class="offset-md-8">
|
<div class="offset-md-8">
|
||||||
<button class="btn btn-primary" onclick="history.back()">Cancel</button>
|
<a href="<?php echo base_url();?>Business/business_list" class="btn btn-secondary">Cancel</a>
|
||||||
<button type="submit" class="btn btn-success">Update</button>
|
<button type="submit" class="btn btn-success">Update</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="col-md-5 col-sm-5 offset-md-1">
|
<div class="col-md-5 col-sm-5 offset-md-1">
|
||||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
<a href="<?php echo base_url();?>Business/module_list" class="btn btn-secondary">Cancel</a>
|
||||||
<button type="submit" class="btn btn-success">Update</button>
|
<button type="submit" class="btn btn-success">Update</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -90,7 +90,7 @@
|
|||||||
<div class="ln_solid"></div>
|
<div class="ln_solid"></div>
|
||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
<div class=" offset-md-8">
|
<div class=" offset-md-8">
|
||||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
<a href="<?php echo base_url();?>Delegation/Delegation_list" class="btn btn-secondary">Cancel</a>
|
||||||
<button class="btn btn-primary" type="reset">Reset</button>
|
<button class="btn btn-primary" type="reset">Reset</button>
|
||||||
<button type="submit" class="btn btn-success">Submit</button>
|
<button type="submit" class="btn btn-success">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -22,7 +22,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.dataTables_wrapper div.dataTables_filter{
|
div.dataTables_wrapper div.dataTables_filter{
|
||||||
margin-top: -30px !important; //search to up
|
margin-top: -30px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -127,6 +127,10 @@
|
|||||||
/* Allow labels to line wrap when menu is artificially narrowed */
|
/* Allow labels to line wrap when menu is artificially narrowed */
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#errMessage {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
@ -274,7 +278,8 @@ class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
|||||||
<div class="col-md-3 col-sm-3 ">
|
<div class="col-md-3 col-sm-3 ">
|
||||||
<input type="password" id="confirm_password" name="confirm_password" value=""
|
<input type="password" id="confirm_password" name="confirm_password" value=""
|
||||||
required="required" class="form-control ">
|
required="required" class="form-control ">
|
||||||
<span id='message'></span>
|
<span id='message'></span><span id='errMessage'></span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -445,7 +450,7 @@ class="form-control typeFile" onchange="validateFile(this)"
|
|||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
<div class="offset-md-8">
|
<div class="offset-md-8">
|
||||||
<a href="<?php echo base_url();?>Employee/empList" class="btn btn-secondary">Cancel</a>
|
<a href="<?php echo base_url();?>Employee/empList" class="btn btn-secondary">Cancel</a>
|
||||||
<button type="submit" class="btn btn-success">Submit</button>
|
<button id="submit" type="submit" class="btn btn-success">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -594,4 +599,25 @@ function check_if_exists(id, value, name) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#password').keyup(function() {
|
||||||
|
if ($('#confirm_password').val() == "") {
|
||||||
|
$('#errMessage').html('Please Enter confirm password');
|
||||||
|
} else {
|
||||||
|
$('#errMessage').html('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#confirm_password').keyup(function() {
|
||||||
|
if ($('#confirm_password').val() == "") {
|
||||||
|
$('#errMessage').html('Please Enter confirm password');
|
||||||
|
} else {
|
||||||
|
$('#errMessage').html('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -1,7 +1,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<style>
|
<style>
|
||||||
div.dataTables_wrapper div.dataTables_filter{
|
div.dataTables_wrapper div.dataTables_filter{
|
||||||
margin-top: -30px !important; //search move to up
|
margin-top: -30px !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||||
@ -109,12 +109,32 @@
|
|||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#datatables').DataTable({
|
$('#datatables').DataTable({
|
||||||
"order": [[0, 'desc']], // Set initial sorting to descending on the first column
|
"order": [
|
||||||
"dom": 'Bfrtip', // Show export buttons
|
[0, 'desc']
|
||||||
"buttons": [ 'excel', 'pdf'], // Enable export options
|
],
|
||||||
"language": {
|
"dom": 'Bfrtip',
|
||||||
"search": "Search: " // Customize search label
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'pdfHtml5',
|
||||||
|
title: 'Employees',
|
||||||
|
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: 'Employees',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':not(:last-child)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,185 +0,0 @@
|
|||||||
|
|
||||||
<!-- Body page content -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="">
|
|
||||||
<div class="page-title">
|
|
||||||
|
|
||||||
<div class="title_left">
|
|
||||||
<h3>Expence Request</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12 col-sm-12 ">
|
|
||||||
<div class="x_panel">
|
|
||||||
<div class="x_title">
|
|
||||||
|
|
||||||
<ul class="nav navbar-right panel_toolbox">
|
|
||||||
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
<div class="x_content">
|
|
||||||
<br />
|
|
||||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/rise_expence_request" enctype="multipart/form-data">
|
|
||||||
|
|
||||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="item form-group">
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item form-group">
|
|
||||||
|
|
||||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Expence Requisted For</label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
|
||||||
|
|
||||||
<input type="radio" name="created_by" value="self"style="margin:10px;"checked /><b>Self</b>
|
|
||||||
|
|
||||||
<input type="radio" name="created_by" value="<?php echo user()->name;?>" style="margin: 10px;" /><b>Others</b>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="item form-group">
|
|
||||||
<label class="control-label col-md-2 col-sm-2 " for="last-name"> Employee Name </label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
|
||||||
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;" class="form-control manager" > </select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="item form-group">
|
|
||||||
|
|
||||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> Date of expence</label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
|
||||||
<div class="form-group">
|
|
||||||
<div class='input-group date' id='myDatepicker'>
|
|
||||||
<input type='text' class="form-control" name="date_of_expence" value="<?php if(isset($expenceData)) { echo $expenceData->purchase_date; } ?>" />
|
|
||||||
<span class="input-group-addon">
|
|
||||||
<li class="fa fa-calendar"></li>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item form-group">
|
|
||||||
|
|
||||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> Expence Cost </label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
|
||||||
<input id="cost" name="amount" value="<?php if(isset($assetData)) { echo $assetData->cost; } ?>" class="form-control" type="text" name="middle-name">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="item form-group">
|
|
||||||
<label class="control-label col-md-2 col-sm-2 " for="last-name">Description</label>
|
|
||||||
<div class="col-md-5 col-sm-5">
|
|
||||||
<textarea id="comments" name="comments" value="" class="form-control" style="height:200px !important;" type="text" ></textarea>
|
|
||||||
|
|
||||||
<input type="hidden" id="manager_id" name="manager" value="">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="item form-group">
|
|
||||||
|
|
||||||
<label class="control-label col-md-2 col-sm-2 " for="first-name">Expence Bill</label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
|
||||||
<input id="formFile" name="bill" class="typeFile" type="file" >
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="ln_solid"></div>
|
|
||||||
<div class="item form-group">
|
|
||||||
<div class=" offset-md-8">
|
|
||||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
|
||||||
<button class="btn btn-primary" type="reset">Reset</button>
|
|
||||||
<button type="submit" class="btn btn-success">Submit</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /Body page content -->
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
$(document).ready(function(){
|
|
||||||
|
|
||||||
var currentUserName = '<?php echo user()->name; ?>';
|
|
||||||
var currentUserId = '<?php echo user()->id; ?>';
|
|
||||||
$('#user_dropdown').append('<option value="' + currentUserId + '">' +
|
|
||||||
currentUserName + '</option>');
|
|
||||||
$('#user_dropdown').prop('disabled', true);
|
|
||||||
|
|
||||||
$('#user_dropdown').on('change',function() {
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$('input[type="radio"][name="created_by"]').change(function() {
|
|
||||||
var selectedValue = $(this).val();
|
|
||||||
var $userDropdown = $('#user_dropdown');
|
|
||||||
|
|
||||||
$userDropdown.empty();
|
|
||||||
|
|
||||||
if (selectedValue === 'self') {
|
|
||||||
|
|
||||||
var currentUserName = '<?php echo user()->name; ?>';
|
|
||||||
var currentUserId = '<?php echo user()->id; ?>';
|
|
||||||
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>');
|
|
||||||
$userDropdown.prop('disabled', true);
|
|
||||||
} else if (selectedValue === '<?php echo user()->name; ?>') {
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo base_url('Employee/get_emp_name/')?>"',
|
|
||||||
method: 'GET',
|
|
||||||
dataType: 'json',
|
|
||||||
success: function(response) {
|
|
||||||
|
|
||||||
$('#user_dropdown').append(response);
|
|
||||||
$('#user_dropdown').prop('disabled', false);
|
|
||||||
},
|
|
||||||
error: function(xhr, status, error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
//get manager id from the dropdown employee assign the value to $("#manager_id") input field
|
|
||||||
|
|
||||||
$("#user_dropdown").on("change", function(){
|
|
||||||
let manager_id = $(this).children(":selected").attr("id");
|
|
||||||
|
|
||||||
$("#manager_id").val(manager_id);
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
|
||||||
@ -1,296 +0,0 @@
|
|||||||
|
|
||||||
<head>
|
|
||||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.design {
|
|
||||||
display: none;
|
|
||||||
position: fixed;
|
|
||||||
z-index: 1;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
overflow: auto;
|
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.design-form {
|
|
||||||
background-color: #fefefe;
|
|
||||||
margin: 15% auto;
|
|
||||||
padding: 20px;
|
|
||||||
border: 1px solid #888;
|
|
||||||
width: 380px;
|
|
||||||
height: 280px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
#myImg {
|
|
||||||
border-radius: 5px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
#myImg:hover {opacity: 0.7;}
|
|
||||||
|
|
||||||
/* The Modal (background) */
|
|
||||||
.modal {
|
|
||||||
display: none; /* Hidden by default */
|
|
||||||
position: fixed; /* Stay in place */
|
|
||||||
z-index: 1; /* Sit on top */
|
|
||||||
padding-top: 100px; /* Location of the box */
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 100%; /* Full width */
|
|
||||||
height: 100%; /* Full height */
|
|
||||||
overflow: auto; /* Enable scroll if needed */
|
|
||||||
background-color: rgb(0,0,0); /* Fallback color */
|
|
||||||
background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Modal Content (image) */
|
|
||||||
.modal-content {
|
|
||||||
margin: auto;
|
|
||||||
display: block;
|
|
||||||
width: 80%;
|
|
||||||
max-width: 700px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Caption of Modal Image */
|
|
||||||
#caption {
|
|
||||||
margin: auto;
|
|
||||||
display: block;
|
|
||||||
width: 80%;
|
|
||||||
max-width: 700px;
|
|
||||||
text-align: center;
|
|
||||||
color: #ccc;
|
|
||||||
padding: 10px 0;
|
|
||||||
height: 150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add Animation */
|
|
||||||
.modal-content, #caption {
|
|
||||||
-webkit-animation-name: zoom;
|
|
||||||
-webkit-animation-duration: 0.6s;
|
|
||||||
animation-name: zoom;
|
|
||||||
animation-duration: 0.6s;
|
|
||||||
}
|
|
||||||
|
|
||||||
@-webkit-keyframes zoom {
|
|
||||||
from {-webkit-transform:scale(0)}
|
|
||||||
to {-webkit-transform:scale(1)}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes zoom {
|
|
||||||
from {transform:scale(0)}
|
|
||||||
to {transform:scale(1)}
|
|
||||||
}
|
|
||||||
|
|
||||||
.close {
|
|
||||||
position: absolute;
|
|
||||||
top: 15px;
|
|
||||||
right: 35px;
|
|
||||||
color: #f1f1f1;
|
|
||||||
font-size: 40px;
|
|
||||||
font-weight: bold;
|
|
||||||
transition: 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.close:hover,
|
|
||||||
.close:focus {
|
|
||||||
color: #bbb;
|
|
||||||
text-decoration: none;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 100% Image Width on Smaller Screens */
|
|
||||||
@media only screen and (max-width: 700px){
|
|
||||||
.modal-content {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<div class="col-md-12 col-sm-12 ">
|
|
||||||
<div class="x_panel">
|
|
||||||
<div class="x_title">
|
|
||||||
<h1>Expence List</h1>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
<div class="x_content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-12" style="overflow: auto;">
|
|
||||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
|
||||||
<thead>
|
|
||||||
<tr class="headings">
|
|
||||||
<th class="column-title">Creadted Date</th>
|
|
||||||
<th class="column-title">Employee Id</th>
|
|
||||||
<th class="column-title">Employee Name</th>
|
|
||||||
<th class="column-title">Expence Date</th>
|
|
||||||
<th class="column-title">Expence Raised By</th>
|
|
||||||
<th class="column-title">Expence Cost(₹)</th>
|
|
||||||
<th class="column-title">Expence Bill</th>
|
|
||||||
<th class="column-title">Comments </th>
|
|
||||||
<th class="column-title">Status </th>
|
|
||||||
<th class="column-title" >Action </th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php foreach ($tableData as $key => $value) { ?>
|
|
||||||
<tr class="even pointer">
|
|
||||||
|
|
||||||
<td class=" "><?php echo $value->created_at; ?> </td>
|
|
||||||
<td class=" "><?php echo $value->emp_id; ?> </td>
|
|
||||||
<td class=" "><?php echo $value->name; ?> </td>
|
|
||||||
<td class=" "><?php echo $value->date_of_expence; ?></td>
|
|
||||||
<td class=" "><?php echo $value->created_by; ?></td>
|
|
||||||
<td class=" ">₹ <?php echo $value->amount; ?></td>
|
|
||||||
<td class=" ">
|
|
||||||
<img id="myImg" style="width: 50%; display: block;" src="<?php echo base_url(); ?>assets/uploads/Expence_Bill/<?php echo $value->bill; ?>" alt="invoice"/>
|
|
||||||
</td>
|
|
||||||
<td class=" "><?php echo $value->comments; ?></td>
|
|
||||||
<?php if($value->status == 'pending'){ ?>
|
|
||||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
|
||||||
<?php }
|
|
||||||
else if($value->status == 'Approved'){ ?>
|
|
||||||
<td style="color:green"><?php echo $value->status; ?>By <?php echo $value->approved_by; ?><br><?php echo $value->approved_at;?></td>
|
|
||||||
<?php }
|
|
||||||
else if($value->status == 'Declined'){ ?>
|
|
||||||
<td style="color:red"><?php echo $value->status; ?><br><?php echo $value->DReason; ?></td>
|
|
||||||
<?php }
|
|
||||||
else if($value->status == 'canceled'){ ?>
|
|
||||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
|
||||||
<?php }
|
|
||||||
else{
|
|
||||||
|
|
||||||
}?>
|
|
||||||
<td style=" text-align: center; font-size: 16px;">
|
|
||||||
|
|
||||||
<?php if($value->status == 'pending') { ?>
|
|
||||||
|
|
||||||
<a href="<?php echo base_url('Employee/Approve_Expence')?>?id=<?php echo $value->id;?> "><i class="fa fa-check" aria-hidden="true"title="Approve" onclick = "return confirm('Are you sure to Approve This Leave ')" ></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 } ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php } ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="customPrompt" class="design">
|
|
||||||
<div class="design-form ">
|
|
||||||
<span onclick="$('#customPrompt').hide()">X</span>
|
|
||||||
<h3>Decline Reason</h3>
|
|
||||||
<input list="browsers" id="decline_reason" required name="myBrowser" />
|
|
||||||
<datalist id="browsers" >
|
|
||||||
<?php foreach ($dropdown as $key => $value) { ?>
|
|
||||||
<option value="<?php echo $value->enum_value; ?>"><?php echo $value->enum_value; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</datalist>
|
|
||||||
|
|
||||||
<button onclick="submitCustomPrompt()" type="button" class="btn btn-primary">Submit</button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
|
||||||
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
function showCustomPrompt() {
|
|
||||||
var customPrompt = document.getElementById("customPrompt");
|
|
||||||
customPrompt.style.display = "block";
|
|
||||||
}
|
|
||||||
|
|
||||||
function submitCustomPrompt() {
|
|
||||||
|
|
||||||
var id = $('.test').attr("id");
|
|
||||||
var reason = document.getElementById("decline_reason").value;
|
|
||||||
|
|
||||||
if( reason != "")
|
|
||||||
|
|
||||||
$.ajax(
|
|
||||||
{
|
|
||||||
data:{id : id , reason : reason },
|
|
||||||
url:"<?php echo base_url('Employee/Decline_expence');?>",
|
|
||||||
type:"get",
|
|
||||||
success: function(response) {
|
|
||||||
|
|
||||||
window.location ='<?php echo base_url('Employee/expence_list');?>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
else
|
|
||||||
|
|
||||||
alert('Decline Reason is required');
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- The Modal -->
|
|
||||||
<div id="myModal" class="modal">
|
|
||||||
<span class="close">×</span>
|
|
||||||
<img class="modal-content" id="img01">
|
|
||||||
<div id="caption"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#myImg').on('click', function(){
|
|
||||||
|
|
||||||
var modal = document.getElementById("myModal");
|
|
||||||
var modalImg = document.getElementById("img01");
|
|
||||||
var captionText = document.getElementById("caption");
|
|
||||||
img.onclick = function(){
|
|
||||||
modal.style.display = "block";
|
|
||||||
modalImg.src = this.src;
|
|
||||||
captionText.innerHTML = this.alt;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the <span> element that closes the modal
|
|
||||||
var span = document.getElementsByClassName("close")[0];
|
|
||||||
|
|
||||||
// When the user clicks on <span> (x), close the modal
|
|
||||||
span.onclick = function() {
|
|
||||||
modal.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -283,6 +283,7 @@ public function expence_list()
|
|||||||
$business_id = user()->business_id;
|
$business_id = user()->business_id;
|
||||||
$expence_list = $this->Expence_model->get_expence_list($business_id);
|
$expence_list = $this->Expence_model->get_expence_list($business_id);
|
||||||
$get_count_amount = $this->Expence_model->get_count_amount();
|
$get_count_amount = $this->Expence_model->get_count_amount();
|
||||||
|
// $get_business_admin = $this->Expence_model->get_business_admin();
|
||||||
$this->layout->set('count_amount', $get_count_amount);
|
$this->layout->set('count_amount', $get_count_amount);
|
||||||
$this->layout->set('tableData', $expence_list);
|
$this->layout->set('tableData', $expence_list);
|
||||||
$this->layout->buffer('main_content', 'Expence/expence_list');
|
$this->layout->buffer('main_content', 'Expence/expence_list');
|
||||||
@ -343,20 +344,85 @@ public function Approve_Expence()
|
|||||||
$table = "expense";
|
$table = "expense";
|
||||||
$this->MY_Model->edit_option($action, $id, $table);
|
$this->MY_Model->edit_option($action, $id, $table);
|
||||||
$this->Expence_model->approve_child_expense($action, $id);
|
$this->Expence_model->approve_child_expense($action, $id);
|
||||||
$this->session->set_flashdata('approve', 'Claim Request Approved');
|
$this->session->set_flashdata('Create', '1');
|
||||||
redirect('Expence/expence_list');
|
redirect('Expence/expence_list');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Approve_Child_Expence()
|
public function Approve_Child_Expence()
|
||||||
|
{
|
||||||
|
if($this->input->get('reason'))
|
||||||
|
{
|
||||||
|
$id=$this->input->get('id');
|
||||||
|
$expense_id=$this->input->get('expence_id');
|
||||||
|
$decline_action['status'] = 'Declined';
|
||||||
|
$decline_action['decline_by'] = user()->name;
|
||||||
|
$decline_action['decline_reason'] = $this->input->get('reason');
|
||||||
|
$is_decline = $this->Expence_model->approve_child_expense_2($decline_action, $id);
|
||||||
|
|
||||||
|
if($is_decline == true)
|
||||||
|
{
|
||||||
|
$count = $this->Expence_model->get_status_update($expense_id);
|
||||||
|
$table = "expense";
|
||||||
|
if($count->pending_count >= 1)
|
||||||
|
{
|
||||||
|
$status_update['status'] = 'pending';
|
||||||
|
$this->MY_Model->edit_option($status_update, $expense_id, $table);
|
||||||
|
}
|
||||||
|
else if($count->approve_count >= 1 && $count->declined_count >= 1)
|
||||||
|
{
|
||||||
|
$status_update['status'] = 'Partially approved';
|
||||||
|
return $this->MY_Model->edit_option($status_update, $expense_id, $table);
|
||||||
|
}
|
||||||
|
else if($count->declined_count >= 1 && $count->approve_count == 0 && $count->pending_count == 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
$status_update['status'] = 'Declined';
|
||||||
|
$status_update['decline_by'] = user()->name;
|
||||||
|
return $this->MY_Model->edit_option($status_update, $expense_id, $table);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$id=$this->input->post('id');
|
$id=$this->input->post('id');
|
||||||
|
$expense_id=$this->input->post('expence_id');
|
||||||
$action['status'] = 'Approved';
|
$action['status'] = 'Approved';
|
||||||
$action['approved_by']= user()->name;
|
|
||||||
$action['approved_at'] = date('Y-m-d h:i:s');
|
$action['approved_at'] = date('Y-m-d h:i:s');
|
||||||
$this->Expence_model->approve_child_expense_2($action, $id);
|
$action['approved_by']= user()->name;
|
||||||
|
$is_approve = $this->Expence_model->approve_child_expense_2($action, $id);
|
||||||
|
if($is_approve == true)
|
||||||
|
{
|
||||||
|
$count = $this->Expence_model->get_status_update($expense_id);
|
||||||
|
$table = "expense";
|
||||||
|
if($count->pending_count >= 1)
|
||||||
|
{
|
||||||
|
$status_update['status'] = 'pending';
|
||||||
|
$this->MY_Model->edit_option($status_update, $expense_id, $table);
|
||||||
|
}
|
||||||
|
else if($count->approve_count >= 1 && $count->declined_count >= 1)
|
||||||
|
{
|
||||||
|
$status_update['status'] = 'Partially approved';
|
||||||
|
$this->MY_Model->edit_option($status_update, $expense_id, $table);
|
||||||
|
}
|
||||||
|
else if($count->approve_count >= 1 && $count->declined_count == 0 && $count->pending_count == 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
$status_update['status'] = 'Approved';
|
||||||
|
$action['approved_at'] = date('Y-m-d h:i:s');
|
||||||
|
$status_update['approved_by'] = user()->name;
|
||||||
|
$this->MY_Model->edit_option($status_update, $expense_id, $table);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
redirect('Expence/expence_list_view/'.$this->input->post('expence_id'));
|
redirect('Expence/expence_list_view/'.$this->input->post('expence_id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function Decline_expence()
|
public function Decline_expence()
|
||||||
{
|
{
|
||||||
$id=$this->input->get('id');
|
$id=$this->input->get('id');
|
||||||
@ -368,14 +434,6 @@ public function Decline_expence()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Decline_Child_Expence()
|
|
||||||
{
|
|
||||||
$id=$this->input->get('id');
|
|
||||||
$action['status'] = 'Declined';
|
|
||||||
$action['decline_by'] = user()->name;
|
|
||||||
$action['decline_reason'] = $this->input->get('reason');
|
|
||||||
return $this->Expence_model->approve_child_expense_2($action, $id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getCancelConfirmationPopup()
|
public function getCancelConfirmationPopup()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,6 +29,7 @@ public function get_expence_list($business_id)
|
|||||||
$this->db->where('A.status', 'pending');
|
$this->db->where('A.status', 'pending');
|
||||||
$this->db->or_where('A.status', 'Approved');
|
$this->db->or_where('A.status', 'Approved');
|
||||||
$this->db->or_where('A.status', 'Declined');
|
$this->db->or_where('A.status', 'Declined');
|
||||||
|
$this->db->or_where('A.status', 'Partially approved');
|
||||||
$this->db->order_by('A.id', 'DESC');
|
$this->db->order_by('A.id', 'DESC');
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
$query = $query->result();
|
$query = $query->result();
|
||||||
@ -125,26 +126,11 @@ public function approve_child_expense_2($action, $id)
|
|||||||
{
|
{
|
||||||
$this->db->where('id', $id);
|
$this->db->where('id', $id);
|
||||||
$this->db->where('status','pending');
|
$this->db->where('status','pending');
|
||||||
$this->db->update('expense_child',$action);
|
return $this->db->update('expense_child',$action);
|
||||||
}
|
|
||||||
|
|
||||||
public function decline_dropdown($business_id)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
$this->db->select('*');
|
|
||||||
$this->db->from('enum');
|
|
||||||
$this->db->where('enum_type', 'decline');
|
|
||||||
$this->db->where('business_id', $business_id);
|
|
||||||
$query = $this->db->get();
|
|
||||||
if ($query->num_rows() > 0) {
|
|
||||||
return $query->result();
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function get_expence_list_by_id($id)
|
public function get_expence_list_by_id($id)
|
||||||
{
|
{
|
||||||
$this->db->select('*');
|
$this->db->select('*');
|
||||||
@ -230,6 +216,8 @@ public function update_to_submit_all($id, $data)
|
|||||||
$this->db->update('expense_child', $data);
|
$this->db->update('expense_child', $data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// get the value from expense and expense_child sum of the value and count data
|
// get the value from expense and expense_child sum of the value and count data
|
||||||
public function get_count_amount()
|
public function get_count_amount()
|
||||||
{
|
{
|
||||||
@ -238,4 +226,19 @@ public function get_count_amount()
|
|||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_status_update($id)
|
||||||
|
{
|
||||||
|
$query = $this->db->query('SELECT expense_id,
|
||||||
|
COUNT(CASE WHEN status = "Approved" THEN 1 ELSE NULL END) AS approve_count,
|
||||||
|
COUNT(CASE WHEN status = "Declined" THEN 1 ELSE NULL END) AS declined_count,
|
||||||
|
COUNT(CASE WHEN status = "pending" THEN 1 ELSE NULL END) AS pending_count
|
||||||
|
FROM expense_child
|
||||||
|
WHERE expense_id = ?
|
||||||
|
GROUP BY expense_id', $id);
|
||||||
|
|
||||||
|
$result = $query->row();
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,6 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="modal-dialog modal-sm">
|
<div class="modal-dialog modal-sm">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
||||||
|
|||||||
@ -60,6 +60,10 @@
|
|||||||
height: 280px;
|
height: 280px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
background-color: skyblue;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
@ -89,7 +93,15 @@
|
|||||||
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-primary" style="margin-top: 20px; font-size: small;">Back</a>
|
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-primary" style="margin-top: 20px; font-size: small;">Back</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>Edit Expense - <?php if(isset($expense_data[0]->id)){echo $expense_data[0]->expense_name; } ?></h3>
|
<h3>
|
||||||
|
|
||||||
|
<?php if($expense_data[0]->status == 'Draft') { ?>
|
||||||
|
|
||||||
|
Edit Expense - <?php if(isset($expense_data[0]->id)){echo $expense_data[0]->expense_name; } ?>
|
||||||
|
|
||||||
|
<?php } else { echo $expense_data[0]->expense_name; } ?>
|
||||||
|
|
||||||
|
</h3>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -121,10 +133,10 @@
|
|||||||
|
|
||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="first-name">Expense Name</label>
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">Expense Name<a style="color:red;">*</a></label>
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type='text' class="form-control" name="expense_name" value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->expense_name; } ?>" autocomplete='off' />
|
<input type='text' class="form-control" name="expense_name" value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->expense_name; } ?>" autocomplete='off' required />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -155,6 +167,34 @@
|
|||||||
|
|
||||||
<?php $i=1; foreach ($expense_child_data as $key => $value) { ?>
|
<?php $i=1; foreach ($expense_child_data as $key => $value) { ?>
|
||||||
|
|
||||||
|
<div class="item form-group">
|
||||||
|
<label class="control-label col-md-1 col-sm-1 " for="first-name">Status</label>
|
||||||
|
<div class="col-md-5 col-sm-5">
|
||||||
|
<input id="cost" class="form-control" readonly name="middle-name" autocomplete='off' value="
|
||||||
|
<?php if($value->status == "Approved")
|
||||||
|
{
|
||||||
|
echo $value->status . ' By ' . $value->approved_by . ' - ' . date('d-m-Y h:i:s', strtotime($value->approved_at));
|
||||||
|
}
|
||||||
|
else if($value->status == "Declined")
|
||||||
|
{
|
||||||
|
echo $value->status.' By '.$value->decline_by .' ( ' . $value->decline_reason . ' )';
|
||||||
|
}
|
||||||
|
else if($value->status == "Cancelled")
|
||||||
|
{
|
||||||
|
echo $value->status.' at '.date('d-m-Y h:i:s', strtotime($value->cancelled_at));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo $value->status;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
@ -162,7 +202,7 @@
|
|||||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Date of Expense<a style="color:red;">*</a></label>
|
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Date of Expense<a style="color:red;">*</a></label>
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type='text' id="ExpenseDate<?php echo $i;?>" class="form-control date" placeholder="DD-MM-YYYY" required name="date_of_expence[]" value="<?php echo $value->date_of_expense ?>" autocomplete='off'/>
|
<input type='text' id="ExpenseDate<?php echo $i;?>" class="form-control date" placeholder="DD-MM-YYYY" required name="date_of_expence[]" value="<?php echo $value->date_of_expense ?>" autocomplete='off'/><i class="fa fa-calendar" style=" position: absolute; right: 25px; top: 12px;z-index: 0;"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -185,7 +225,7 @@
|
|||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile" type="file" value="<?php echo $value->bill ?>" multiple><br>
|
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile" type="file" value="<?php echo $value->bill ?>" multiple><br>
|
||||||
|
|
||||||
<a href="<?php echo base_url(); ?>assets/uploads/Expence_Bill/<?php echo $value->bill; ?>" target="_blank" class="btn btn-info float-right" style="font-size: x-small; margin-top: 7px;"><b>View Recipt</b></a></div>
|
<a href="<?php echo base_url(); ?>assets/uploads/Expence_Bill/<?php echo $value->bill; ?>" target="_blank" class="float-right" style="font-size: x-small; color: darkblue; margin-top: 7px;"><b>View Recipt(<?php echo $value->bill; ?>)</b></a></div>
|
||||||
|
|
||||||
<?php if($expense_data[0]->status == 'Draft') { ?>
|
<?php if($expense_data[0]->status == 'Draft') { ?>
|
||||||
|
|
||||||
@ -207,9 +247,11 @@
|
|||||||
yearRange: '2000:' + new Date().getFullYear(),
|
yearRange: '2000:' + new Date().getFullYear(),
|
||||||
maxDate: new Date(),
|
maxDate: new Date(),
|
||||||
autoclose:true,
|
autoclose:true,
|
||||||
|
allowInput: false,
|
||||||
|
|
||||||
onChange: function(selectedDates, dateStr) {
|
onChange: function(selectedDates, dateStr) {
|
||||||
console.log('Selected date: ', dateStr);
|
console.log('Selected date: ', dateStr);
|
||||||
|
instance._input.removeAttribute("readonly");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -226,8 +268,8 @@
|
|||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
<div class=" offset-md-8">
|
<div class=" offset-md-8">
|
||||||
<?php if($expense_data[0]->status == 'Draft') { ?>
|
<?php if($expense_data[0]->status == 'Draft') { ?>
|
||||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-secondary">Cancel</a>
|
||||||
<button type="submit" class="btn btn-success" name="update">Update</button>
|
<button type="submit" class="btn btn-success" name="update" value="update">Update</button>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -398,10 +440,10 @@ function createAndAppendFormGroup() {
|
|||||||
var html1 = '';
|
var html1 = '';
|
||||||
i++
|
i++
|
||||||
html1 += '<div id="removeChild'+i+'">'
|
html1 += '<div id="removeChild'+i+'">'
|
||||||
html1 += '<br><div class="x_title">'+i+'</div><br>'
|
html1 += '<br><div class="x_title"></div><br>'
|
||||||
html1 += '<div class="item form-group">';
|
html1 += '<div class="item form-group">';
|
||||||
html1 += '<label class="control-label col-md-1 col-sm-1 " for="first-name"> Date of Expense<a style="color:red;">*</a></label>';
|
html1 += '<label class="control-label col-md-1 col-sm-1 " for="first-name"> Date of Expense<a style="color:red;">*</a></label>';
|
||||||
html1 += '<div class="col-md-5 col-sm-5 "><div class="form-group"><input type="date" id="datepicker'+i+'" class="form-control dates" placeholder="DD-MM-YYYY" required name="date_of_expence2[]" value="" autocomplete="off"/></div></div>';
|
html1 += '<div class="col-md-5 col-sm-5 "><div class="form-group"><input type="date" id="datepicker'+i+'" class="form-control dates" placeholder="DD-MM-YYYY" required name="date_of_expence2[]" value="" autocomplete="off"/><i class="fa fa-calendar" style=" position: absolute; right: 25px; top: 12px;z-index: 0;"></i></div></div>';
|
||||||
html1 += '<label class="control-label col-md-1 col-sm-1 " for="first-name"> Expense Cost <a style="color:red;">*</a></label>';
|
html1 += '<label class="control-label col-md-1 col-sm-1 " for="first-name"> Expense Cost <a style="color:red;">*</a></label>';
|
||||||
html1 += '<div class="col-md-5 col-sm-5 "><input id="cost" name="amount2[]" required class="form-control" onkeypress="return matchnum(event)" type="number" name="middle-name" autocomplete="off"></div>';
|
html1 += '<div class="col-md-5 col-sm-5 "><input id="cost" name="amount2[]" required class="form-control" onkeypress="return matchnum(event)" type="number" name="middle-name" autocomplete="off"></div>';
|
||||||
html1 += '</div>';
|
html1 += '</div>';
|
||||||
@ -427,6 +469,7 @@ function createAndAppendFormGroup() {
|
|||||||
dateFormat: 'd-m-Y',
|
dateFormat: 'd-m-Y',
|
||||||
maxDate: new Date(),
|
maxDate: new Date(),
|
||||||
autoclose:true,
|
autoclose:true,
|
||||||
|
allowInput: false,
|
||||||
|
|
||||||
onChange: function(selectedDates, dateStr) {
|
onChange: function(selectedDates, dateStr) {
|
||||||
console.log('Selected date: ', dateStr);
|
console.log('Selected date: ', dateStr);
|
||||||
|
|||||||
@ -144,6 +144,10 @@
|
|||||||
|
|
||||||
<td style="color:#0000e6;"><?php echo $value->status; ?></td>
|
<td style="color:#0000e6;"><?php echo $value->status; ?></td>
|
||||||
|
|
||||||
|
<?php } else if($value->status == 'Partially approved'){?>
|
||||||
|
|
||||||
|
<td style="color:#0000e6;"><?php echo $value->status; ?></td>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<td style=" text-align: center; font-size: 16px;">
|
<td style=" text-align: center; font-size: 16px;">
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
div.dataTables_wrapper div.dataTables_filter{
|
div.dataTables_wrapper div.dataTables_filter{
|
||||||
margin-top: -30px !important;
|
margin-top: -30px !important; //search to up
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-success {
|
.alert-success {
|
||||||
|
|||||||
@ -59,6 +59,15 @@
|
|||||||
width: 290px;
|
width: 290px;
|
||||||
height: 280px;
|
height: 280px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fa .fa-calendar {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
right: 10px;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
@ -67,41 +76,32 @@
|
|||||||
<div class="x_title">
|
<div class="x_title">
|
||||||
|
|
||||||
<ul class="nav navbar-right panel_toolbox">
|
<ul class="nav navbar-right panel_toolbox">
|
||||||
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-primary"
|
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-primary" style="margin-top: 20px; font-size: small;">Back</a>
|
||||||
style="margin-top: 20px; font-size: small;">Back</a>
|
|
||||||
</ul>
|
</ul>
|
||||||
<h3>Expense Claim</h3>
|
<h3>New Claim</h3>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<br />
|
<br />
|
||||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post"
|
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Expence/rise_expence_request" enctype="multipart/form-data">
|
||||||
action="<?php echo base_url();?>Expence/rise_expence_request" enctype="multipart/form-data">
|
|
||||||
|
|
||||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>"
|
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
||||||
value="<?php echo $this->security->get_csrf_hash();?>">
|
|
||||||
|
|
||||||
<div class="x_panel">
|
<div class="x_panel">
|
||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
<label class="control-label col-md-2 col-sm-2 label-align" for="last-name">Expense Requisted
|
<label class="control-label col-md-2 col-sm-2 label-align" for="last-name">Expense Requisted For</label>
|
||||||
For</label>
|
|
||||||
<div class="col-md-4 col-sm-4">
|
<div class="col-md-4 col-sm-4">
|
||||||
|
|
||||||
<input type="radio" name="created_by" value="self (<?php echo user()->id;?>)"
|
<input type="radio" name="created_by" value="self (<?php echo user()->id;?>)"style="margin:10px;"checked /><b>Self</b>
|
||||||
style="margin:10px;" checked /><b>Self</b>
|
|
||||||
|
|
||||||
<input type="radio" name="created_by"
|
<input type="radio" name="created_by" value="<?php echo user()->name;?> (<?php echo user()->id;?>)" style="margin: 10px;" /><b>Others</b>
|
||||||
value="<?php echo user()->name;?> (<?php echo user()->id;?>)"
|
|
||||||
style="margin: 10px;" /><b>Others</b>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 label-align" for="last-name"> Employee Name <a
|
<label class="control-label col-md-1 col-sm-1 label-align" for="last-name"> Employee Name <a style="color:red;">*</a></label>
|
||||||
style="color:red;">*</a></label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;"
|
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;" class="form-control manager" ></select>
|
||||||
class="form-control manager"> </select>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -109,24 +109,19 @@ class="form-control manager"> </select>
|
|||||||
|
|
||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Expense Name</label>
|
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Expense Name<a style="color:red;">*</a></label>
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type='text' class="form-control" name="expense_name"
|
<input type='text' id="expense_name" class="form-control" name="expense_name" value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->expense_name; } ?>" autocomplete='off' required />
|
||||||
value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->expense_name; } ?>"
|
|
||||||
autocomplete='off' />
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Business
|
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Business Reason</label>
|
||||||
Reason</label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type='text' class="form-control" name="business_reason"
|
<input type='text' class="form-control" name="business_reason" value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->business_reason; } ?>" autocomplete='off'/>
|
||||||
value="<?php if(isset($expense_data[0]->id)){echo $expense_data[0]->business_reason; } ?>"
|
|
||||||
autocomplete='off' />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -146,24 +141,18 @@ class="form-control manager"> </select>
|
|||||||
|
|
||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a
|
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a style="color:red;">*</a></label>
|
||||||
style="color:red;">*</a></label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type='date' id='ExpenseDate' class="form-control" placeholder="DD-MM-YYYY"
|
<input type='date' id='ExpenseDate' class="form-control" placeholder="DD-MM-YYYY" required name="date_of_expence[]" value="<?php echo $value->date_of_expense ?>" autocomplete='off' /><i class="fa fa-calendar"></i>
|
||||||
required name="date_of_expence[]" value="<?php echo $value->date_of_expense ?>"
|
|
||||||
autocomplete='off' />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="expense_pid" value="<?php echo $expense_data[0]->id; ?>">
|
<input type="hidden" name="expense_pid" value="<?php echo $expense_data[0]->id; ?>">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Expense Cost <a
|
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Expense Cost <a style="color:red;">*</a></label>
|
||||||
style="color:red;">*</a></label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<input id="cost" name="amount[]" required value="<?php echo $value->amount ?>"
|
<input id="cost" name="amount[]" required value="<?php echo $value->amount ?>" class="form-control" onkeypress = "return matchnum(event)" type="number" name="middle-name" autocomplete='off'>
|
||||||
class="form-control" onkeypress="return matchnum(event)" type="number"
|
|
||||||
name="middle-name" autocomplete='off'>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -171,23 +160,17 @@ class="form-control" onkeypress="return matchnum(event)" type="number"
|
|||||||
<div class="item form-group flex-wrap">
|
<div class="item form-group flex-wrap">
|
||||||
<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>
|
<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>
|
||||||
<div class="col-md-5 col-sm-3">
|
<div class="col-md-5 col-sm-3">
|
||||||
<textarea id="comments" name="description[]" value="" class="form-control"
|
<textarea id="comments" name="description[]" value="" class="form-control" style="height:50px !important;" type="text" ><?php echo $value->description ?></textarea>
|
||||||
style="height:50px !important;" type="text"><?php echo $value->description ?></textarea>
|
|
||||||
|
|
||||||
<!-- <input type="hidden" id="manager_id" name="manager" value=""> -->
|
<!-- <input type="hidden" id="manager_id" name="manager" value=""> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 label-align"
|
<label class="control-label col-md-1 col-sm-1 label-align" required for="first-name">Recipt</label>
|
||||||
for="first-name">Recipt</label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile"
|
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile" type="file" value="<?php echo $value->bill ?>" multiple>
|
||||||
type="file" value="<?php echo $value->bill ?>" multiple>
|
|
||||||
</div>
|
|
||||||
<div class="col-12"><button type="button" class="float-right btn btn-danger"
|
|
||||||
onclick="remove_row(<?php echo $value->id ?>)" id="remove-button2"><i
|
|
||||||
class="fa fa-trash"></i></button></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-12"><button type="button" class="float-right btn btn-danger" onclick="remove_row(<?php echo $value->id ?>)" id="remove-button2"><i class="fa fa-trash"></i></button></div></div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -198,20 +181,17 @@ class="fa fa-trash"></i></button></div>
|
|||||||
|
|
||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a
|
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a style="color:red;">*</a></label>
|
||||||
style="color:red;">*</a></label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type='text' id='ExpenseDate' class="form-control" placeholder="DD-MM-YYYY"
|
<input type='text' id='ExpenseDate' class="form-control" placeholder="DD-MM-YYYY" required name="date_of_expence[]" value="" autocomplete='off'/>
|
||||||
required name="date_of_expence[]" value="" autocomplete='off' />
|
<i class="fa fa-calendar" style=" position: absolute; right: 25px; top: 12px;z-index: 0;"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Amount <a
|
<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Amount <a style="color:red;">*</a></label>
|
||||||
style="color:red;">*</a></label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<input id="cost" name="amount[]" required value="" class="form-control"
|
<input id="cost" name="amount[]" required value="" class="form-control" onkeypress = "return matchnum(event)" type="number" name="middle-name" autocomplete='off'>
|
||||||
onkeypress="return matchnum(event)" type="number" name="middle-name" autocomplete='off'>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -219,22 +199,14 @@ class="fa fa-trash"></i></button></div>
|
|||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>
|
<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>
|
||||||
<div class="col-md-5 col-sm-3">
|
<div class="col-md-5 col-sm-3">
|
||||||
<textarea id="comments" name="description[]" value="" class="form-control"
|
<textarea id="comments" name="description[]" value="" class="form-control" style="height:50px !important;" type="text" ></textarea>
|
||||||
style="height:50px !important;" type="text"></textarea>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 label-align" required for="first-name">Recipt</label>
|
<label class="control-label col-md-1 col-sm-1 label-align" required for="first-name">Recipt</label>
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile"
|
<input id="formFile" name="bill[]" onchange="validateFile(this)" class="typeFile" type="file" value="" multiple></div>
|
||||||
type="file" value="" multiple>
|
</div><div class="col-12"><button type="button" id="add-button" onclick="createAndAppendFormGroup()" class="btn btn-primary float-right">Add</button></div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12"><button type="button" id="add-button" onclick="createAndAppendFormGroup()"
|
|
||||||
class="btn btn-primary float-right">Add</button></div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<div id="formContainer"></div>
|
<div id="formContainer"></div>
|
||||||
@ -244,12 +216,8 @@ class="btn btn-primary float-right">Add</button></div>
|
|||||||
<div class="ln_solid"></div>
|
<div class="ln_solid"></div>
|
||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
<div class=" offset-md-8">
|
<div class=" offset-md-8">
|
||||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-secondary">Cancel</a>
|
||||||
<button type="submit" class="btn btn-primary" name="save">Save</button>
|
<button type="submit" class="btn btn-primary" name="save">Save</button>
|
||||||
<?php if(isset($expense_data[0]->id)) { ?>
|
|
||||||
<button type="submit" class="btn btn-success" name="submit">Submit</button>
|
|
||||||
<button type="submit" class="btn btn-warning" name="update">Update</button>
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -264,6 +232,7 @@ class="btn btn-primary float-right">Add</button></div>
|
|||||||
<!-- /Body page content -->
|
<!-- /Body page content -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
// hide the dropdown arrow
|
// hide the dropdown arrow
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
@ -279,14 +248,19 @@ class="btn btn-primary float-right">Add</button></div>
|
|||||||
});
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
const datepickerInput = document.getElementById('ExpenseDate');
|
const datepickerInput = document.getElementById('ExpenseDate');
|
||||||
|
|
||||||
flatpickr(datepickerInput, {
|
flatpickr(datepickerInput, {
|
||||||
dateFormat: 'd-m-Y',
|
dateFormat: 'd-m-Y',
|
||||||
maxDate: new Date(),
|
maxDate: new Date(),
|
||||||
|
allowInput: false,
|
||||||
|
autoclose:true,
|
||||||
|
|
||||||
onChange: function(selectedDates, dateStr) {
|
onChange: function(selectedDates, dateStr) {
|
||||||
console.log('Selected date: ', dateStr);
|
console.log('Selected date: ', dateStr);
|
||||||
@ -309,12 +283,15 @@ function validateFile(input) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function matchnum(event) {
|
|
||||||
|
function matchnum(event)
|
||||||
|
{
|
||||||
var charcode;
|
var charcode;
|
||||||
|
|
||||||
charcode = event.which || event.keyCode;
|
charcode = event.which || event.keyCode;
|
||||||
@ -336,8 +313,8 @@ function matchnum(event) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('input[type="radio"][name="created_by"]').change(function() {
|
|
||||||
|
|
||||||
|
$('input[type="radio"][name="created_by"]').change(function() {
|
||||||
|
|
||||||
var selectedValue = $(this).val();
|
var selectedValue = $(this).val();
|
||||||
var $userDropdown = $('#user_dropdown');
|
var $userDropdown = $('#user_dropdown');
|
||||||
@ -348,8 +325,7 @@ function matchnum(event) {
|
|||||||
|
|
||||||
var currentUserName = '<?php echo user()->name; ?>';
|
var currentUserName = '<?php echo user()->name; ?>';
|
||||||
var currentUserId = '<?php echo user()->id; ?>';
|
var currentUserId = '<?php echo user()->id; ?>';
|
||||||
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName +
|
$userDropdown.append('<option value="' + currentUserId + '">' + currentUserName + '</option>');
|
||||||
'</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;?>)') {
|
||||||
|
|
||||||
@ -361,6 +337,7 @@ function matchnum(event) {
|
|||||||
|
|
||||||
$('#user_dropdown').append(response);
|
$('#user_dropdown').append(response);
|
||||||
$('#user_dropdown').prop('disabled', false);
|
$('#user_dropdown').prop('disabled', false);
|
||||||
|
$('#user_dropdown').prop('required', true);
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) {
|
error: function(xhr, status, error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -370,9 +347,26 @@ function matchnum(event) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('input[type="radio"][name="created_by"]').change(function() {
|
||||||
|
|
||||||
|
var selectedValue = $(this).val();
|
||||||
|
var $userDropdown = $('#user_dropdown');
|
||||||
|
|
||||||
|
if (selectedValue === '<?php echo user()->name; ?> (<?php echo user()->id;?>)') {
|
||||||
|
|
||||||
|
$('#user_dropdown').prop('required', true);
|
||||||
|
$('#user_dropdown').prop('disabled', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
//get manager id from the dropdown employee assign the value to $("#manager_id") input field
|
//get manager id from the dropdown employee assign the value to $("#manager_id") input field
|
||||||
|
|
||||||
$("#user_dropdown").on("change", function(){
|
$("#user_dropdown").on("change", function(){
|
||||||
@ -387,38 +381,32 @@ function matchnum(event) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
var addButton = document.getElementById("add-button");
|
||||||
|
addButton.style.display = "block"; // Show the "Add" button initially
|
||||||
|
});
|
||||||
var i=1;
|
var i=1;
|
||||||
|
|
||||||
function createAndAppendFormGroup() {
|
function createAndAppendFormGroup() {
|
||||||
var html1 = '';
|
var html1 = '';
|
||||||
i++
|
i++
|
||||||
html1 += '<div id="removeChild' + i + '">'
|
html1 += '<div id="removeChild'+i+'"><br>'
|
||||||
html1 += '<br><div class="x_title">' + i + '</div><br>'
|
html1 += '<br><div class="x_title"></div><br>'
|
||||||
html1 += '<div class="item form-group">';
|
html1 += '<div class="item form-group">';
|
||||||
html1 +=
|
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a style="color:red;">*</a></label>';
|
||||||
'<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Date of Expense<a style="color:red;">*</a></label>';
|
html1 += '<div class="col-md-5 col-sm-5 "><div class="form-group"><input type="text" id="datepicker'+i+'" class="form-control date-picker" placeholder="DD-MM-YYYY" name="date_of_expence[]" value="" autocomplete="off" required/><i class="fa fa-calendar" style=" position: absolute; right: 25px; top: 12px;z-index: 0;"></i></div></div>';
|
||||||
html1 += '<div class="col-md-5 col-sm-5 "><div class="form-group"><input type="text" id="datepicker' + i +
|
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Amount <a style="color:red;">*</a></label>';
|
||||||
'" class="form-control date-picker" placeholder="DD-MM-YYYY" required name="date_of_expence[]" value="" autocomplete="off"/></div></div>';
|
html1 += '<div class="col-md-5 col-sm-5 "><input id="cost" name="amount[]" required class="form-control" onkeypress="return matchnum(event)" type="number" name="middle-name" autocomplete="off"></div>';
|
||||||
html1 +=
|
|
||||||
'<label class="control-label col-md-1 col-sm-1 label-align" for="first-name"> Expense Cost <a style="color:red;">*</a></label>';
|
|
||||||
html1 +=
|
|
||||||
'<div class="col-md-5 col-sm-5 "><input id="cost" name="amount[]" required class="form-control" onkeypress="return matchnum(event)" type="number" name="middle-name" autocomplete="off"></div>';
|
|
||||||
html1 += '</div>';
|
html1 += '</div>';
|
||||||
|
|
||||||
|
|
||||||
html1 += '<div class="item form-group flex-wrap">'
|
html1 += '<div class="item form-group flex-wrap">'
|
||||||
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>'
|
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="last-name">Description</label>'
|
||||||
html1 +=
|
html1 += '<div class="col-md-5 col-sm-3"><textarea id="comments" name="description[]" value="" class="form-control" style="height:50px !important;" type="text" ></textarea></div>'
|
||||||
'<div class="col-md-5 col-sm-3"><textarea id="comments" name="description[]" value="" class="form-control" style="height:50px !important;" type="text" ></textarea></div>'
|
|
||||||
|
|
||||||
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" for="first-name">Recipt </label>'
|
html1 += '<label class="control-label col-md-1 col-sm-1 label-align" required for="first-name">Recipt </label>'
|
||||||
html1 +=
|
html1 += '<div class="col-md-5 col-sm-5 "><input id="formFile" name="bill[]" multiple onchange="validateFile(this)" class="typeFile" type="file" value="" ></div>'
|
||||||
'<div class="col-md-5 col-sm-5 "><input id="formFile" name="bill[]" multiple onchange="validateFile(this)" class="typeFile" type="file" value="" ></div>'
|
|
||||||
html1 += '</div>'
|
html1 += '</div>'
|
||||||
html1 +=
|
html1 += '<div class="col-12"><button type="button" class="float-right btn btn-danger"" id="remove-button" onclick="removebutton('+i+')"><i class="fa fa-trash"></i></button></div><button type="button" id="add-button" onclick="createAndAppendFormGroup()" class="btn btn-primary float-right">Add</button></div>'
|
||||||
'<div class="col-12"><button type="button" class="float-right btn btn-danger"" id="remove-button" onclick="removebutton(' +
|
|
||||||
i +
|
|
||||||
')"><i class="fa fa-trash"></i></button></div><button type="button" id="add-button" onclick="createAndAppendFormGroup()" class="btn btn-primary float-right">Add</button></div>'
|
|
||||||
|
|
||||||
|
|
||||||
var formContainer = document.getElementById('formContainer');
|
var formContainer = document.getElementById('formContainer');
|
||||||
@ -430,6 +418,7 @@ function createAndAppendFormGroup() {
|
|||||||
dateFormat: 'd-m-Y',
|
dateFormat: 'd-m-Y',
|
||||||
maxDate: new Date(),
|
maxDate: new Date(),
|
||||||
autoclose:true,
|
autoclose:true,
|
||||||
|
allowInput: false,
|
||||||
|
|
||||||
onChange: function(selectedDates, dateStr) {
|
onChange: function(selectedDates, dateStr) {
|
||||||
console.log('Selected date: ', dateStr);
|
console.log('Selected date: ', dateStr);
|
||||||
@ -449,44 +438,21 @@ function removebutton(index) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// function date(date){
|
|
||||||
// console.log('called');
|
|
||||||
// var element = document.getElementById('ExpenseDates'+ date);
|
|
||||||
// element.datepicker({
|
|
||||||
// dateFormat: "dd-mm-yy",
|
|
||||||
// changeYear: true,
|
|
||||||
// changeMonth: true,
|
|
||||||
// yearRange: "1990:c",
|
|
||||||
// maxDate: new Date(),
|
|
||||||
// autoclose: true,
|
|
||||||
// todayHighlight: true,
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- <script>
|
|
||||||
function PreviewImage() {
|
|
||||||
var oFReader = new FileReader();
|
|
||||||
oFReader.readAsDataURL(document.getElementById("formFile").files[0]);
|
|
||||||
|
|
||||||
oFReader.onload = function (oFREvent) {
|
|
||||||
document.getElementById("uploadPreview").src = oFREvent.target.result;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
</script> -->
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function remove_row(id) {
|
|
||||||
|
function remove_row(id)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
||||||
data: {
|
data:{id : id},
|
||||||
id: id
|
|
||||||
},
|
|
||||||
url:"<?php echo base_url('Expence/remove_row');?>",
|
url:"<?php echo base_url('Expence/remove_row');?>",
|
||||||
type:"get",
|
type:"get",
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
|
||||||
if (response == true); {
|
if(response==true);
|
||||||
|
{
|
||||||
location.reload(true)
|
location.reload(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -496,4 +462,5 @@ function remove_row(id) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
.modal-content_default {
|
.modal-content_default {
|
||||||
background-color: #fefefe;
|
background-color: #fefefe;
|
||||||
margin: 15% auto;
|
margin: 15% auto;s
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
border: 1px solid #888;
|
border: 1px solid #888;
|
||||||
width: 380px;
|
width: 380px;
|
||||||
@ -34,8 +34,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.dataTables_wrapper div.dataTables_filter{
|
div.dataTables_wrapper div.dataTables_filter{
|
||||||
margin-top: -30px !important;
|
margin-top: -30px !important; //search to up
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@ -87,6 +87,39 @@
|
|||||||
<div class="col-md-12 col-sm-12 ">
|
<div class="col-md-12 col-sm-12 ">
|
||||||
<div class="x_panel">
|
<div class="x_panel">
|
||||||
<div class="x_title">
|
<div class="x_title">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<button hidden id="button" class="btn btn-secondary source" onclick="new PNotify({
|
||||||
|
text: '<html><h2>Expense Approved<h2></html>',
|
||||||
|
type: 'success',
|
||||||
|
styling: 'bootstrap3'
|
||||||
|
});">Success</button>
|
||||||
|
<button hidden id="button2" class="btn btn-secondary source" onclick="new PNotify({
|
||||||
|
text: '<html><h2>Expense Declined<h2></html>',
|
||||||
|
type: 'success',
|
||||||
|
styling: 'bootstrap3'
|
||||||
|
});">Success</button>
|
||||||
|
<input type="hidden" id="error" value="<?php echo $this->session->userdata('Create');?>" >
|
||||||
|
<?php $this->session->unset_userdata('Create');?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
if($('#error').val() == 1 )
|
||||||
|
{
|
||||||
|
$('#button').click();
|
||||||
|
}
|
||||||
|
else if($('#error').val() == 2)
|
||||||
|
{
|
||||||
|
$('#button2').click();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="nav navbar-right panel_toolbox">
|
<ul class="nav navbar-right panel_toolbox">
|
||||||
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-sm btn-primary" style="margin-top: 20px;">Back</a>
|
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-sm btn-primary" style="margin-top: 20px;">Back</a>
|
||||||
</ul>
|
</ul>
|
||||||
@ -144,8 +177,11 @@
|
|||||||
<?php }
|
<?php }
|
||||||
else if($value->status == 'Cancelled'){ ?>
|
else if($value->status == 'Cancelled'){ ?>
|
||||||
<td style="color:darkcyan;"><?php echo $value->status; ?> at <br><?php echo date('d-m-Y h:i:s', strtotime($value->cancelled_at));?></td>
|
<td style="color:darkcyan;"><?php echo $value->status; ?> at <br><?php echo date('d-m-Y h:i:s', strtotime($value->cancelled_at));?></td>
|
||||||
<?php }
|
<?php } else if($value->status == 'Draft'){?>
|
||||||
else if($value->status == 'Draft'){?>
|
|
||||||
|
<td style="color:#0000e6;"><?php echo $value->status; ?></td>
|
||||||
|
|
||||||
|
<?php } else if($value->status == 'Partially approved'){?>
|
||||||
|
|
||||||
<td style="color:#0000e6;"><?php echo $value->status; ?></td>
|
<td style="color:#0000e6;"><?php echo $value->status; ?></td>
|
||||||
|
|
||||||
@ -265,6 +301,11 @@ function submitCustomPrompt() {
|
|||||||
|
|
||||||
console.log(response);
|
console.log(response);
|
||||||
window.location ='<?php echo base_url('Expence/expence_list');?>';
|
window.location ='<?php echo base_url('Expence/expence_list');?>';
|
||||||
|
new PNotify({
|
||||||
|
text: '<html><h2>Expense Declined<h2></html>',
|
||||||
|
type: 'success',
|
||||||
|
styling: 'bootstrap3'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,6 @@
|
|||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.modal_default {
|
.modal_default {
|
||||||
display: none;
|
display: none;
|
||||||
@ -175,6 +174,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<a><i class="fa fa-check approveexpense float-right btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm" title="Approve" id ></i></a>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
@ -294,13 +295,14 @@ function submitCustomPrompt() {
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
||||||
data:{id : id , reason : reason },
|
data:{id : id , reason : reason, expence_id : expence_id },
|
||||||
url:"<?php echo base_url('Expence/Decline_Child_Expence');?>",
|
url:"<?php echo base_url('Expence/Approve_Child_Expence');?>",
|
||||||
type:"get",
|
type:"get",
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
|
||||||
console.log(response);
|
console.log(response);
|
||||||
window.location ="<?php echo base_url()?>Expence/expence_list_view/"+expence_id;
|
window.location ="<?php echo base_url()?>Expence/expence_list_view/"+expence_id;
|
||||||
|
console.log(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
.modal-content_default {
|
.modal-content_default {
|
||||||
background-color: #fefefe;
|
background-color: #fefefe;
|
||||||
margin: 15% auto;
|
margin: 15% auto;s
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
border: 1px solid #888;
|
border: 1px solid #888;
|
||||||
width: 380px;
|
width: 380px;
|
||||||
@ -35,8 +35,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.dataTables_wrapper div.dataTables_filter{
|
div.dataTables_wrapper div.dataTables_filter{
|
||||||
margin-top: -30px !important;
|
margin-top: -30px !important; //search to up
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@ -70,7 +70,7 @@ public function applyLeave($update = null)
|
|||||||
$user_id = user()->id;
|
$user_id = user()->id;
|
||||||
$emp = $this->Emp_model->get_employee(user()->business_id);
|
$emp = $this->Emp_model->get_employee(user()->business_id);
|
||||||
$leave_master = $this->Leave_model->get_leave_master($business_id);
|
$leave_master = $this->Leave_model->get_leave_master($business_id);
|
||||||
$leavetype = $this->Leave_model->getLeaveType($business_id);
|
$leavetype = $this->Leave_model->get_leave_master($business_id);
|
||||||
$this->layout->set('emp', $emp);
|
$this->layout->set('emp', $emp);
|
||||||
$this->layout->set('leave_master', $leave_master);
|
$this->layout->set('leave_master', $leave_master);
|
||||||
$this->layout->set('leavetype', $leavetype);
|
$this->layout->set('leavetype', $leavetype);
|
||||||
@ -103,7 +103,7 @@ public function get_leave_master_count()
|
|||||||
public function get_emp_name()
|
public function get_emp_name()
|
||||||
{
|
{
|
||||||
$emp = $this->Leave_model->get_employee(user()->business_id);
|
$emp = $this->Leave_model->get_employee(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)
|
||||||
@ -118,7 +118,7 @@ public function createLeave()
|
|||||||
{
|
{
|
||||||
//permission type create part
|
//permission type create part
|
||||||
|
|
||||||
if($this->input->post('type') === '9')
|
if(!empty($this->input->post('from_time')))
|
||||||
{
|
{
|
||||||
$perm_data = $this->input->post();
|
$perm_data = $this->input->post();
|
||||||
if(isset($perm_data['emp_id'])){
|
if(isset($perm_data['emp_id'])){
|
||||||
|
|||||||
@ -383,11 +383,12 @@ public function get_leave_master($business_id)
|
|||||||
{
|
{
|
||||||
$this->db->select('*');
|
$this->db->select('*');
|
||||||
$this->db->from('leave_master');
|
$this->db->from('leave_master');
|
||||||
$this->db->where('business_id', $business_id);
|
$this->db->where('(business_id = 0 OR business_id = ' . $business_id . ')');
|
||||||
$this->db->where('is_active', 1);
|
$this->db->where('is_active', 1);
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
$query = $query->result();
|
$result = $query->result();
|
||||||
return $query;
|
return $result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_leave_master_count($type_id, $business_id)
|
public function get_leave_master_count($type_id, $business_id)
|
||||||
|
|||||||
@ -162,11 +162,11 @@
|
|||||||
|
|
||||||
<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" required class="form-control" onclick="permission()" >
|
<select id="type" name="type" required class="form-control" onchange="permission(this.id)" >
|
||||||
<option value="">--Select--</option>
|
<option value="">--Select--</option>
|
||||||
<?php foreach ($leavetype as $key => $value) { ?>
|
<?php foreach ($leavetype as $key => $value) { ?>
|
||||||
|
|
||||||
<option id="<?php echo $value->id; ?>" value="<?php echo $value->id; ?>"><?php echo $value->type; ?></option>
|
<option id="<?php echo $value->code; ?>" value="<?php echo $value->id; ?>"><?php echo $value->type; ?></option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -209,7 +209,7 @@
|
|||||||
<label class="control-label col-md-2 col-sm-2 " for="first-name">Date<a style="color:red;">*</a> </label>
|
<label class="control-label col-md-2 col-sm-2 " for="first-name">Date<a style="color:red;">*</a> </label>
|
||||||
<div class="col-md-5 col-sm-5 ">
|
<div class="col-md-5 col-sm-5 ">
|
||||||
<div class='input-group date'>
|
<div class='input-group date'>
|
||||||
<input type='text' class="form-control" required name="perm_date" placeholder="DD-MM-YYYY" value="" id='myDatepicker'/></div>
|
<input type='text' class="form-control" required name="perm_date" placeholder="DD-MM-YYYY" value="" id='perm_id'/></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -217,15 +217,15 @@
|
|||||||
|
|
||||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> From<a style="color:red;">*</a> </label>
|
<label class="control-label col-md-2 col-sm-2 " for="first-name"> From<a style="color:red;">*</a> </label>
|
||||||
<div class="col-md-2 col-sm-2 ">
|
<div class="col-md-2 col-sm-2 ">
|
||||||
<select class="custom-select" id="from_time" name=from_time required style="-webkit-appearance: none;">
|
<select class="custom-select" id="from_time" name=from_time required >
|
||||||
<option>select time</option>
|
<option value="">select time</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">To<a style="color:red;">*</a> </label>
|
<label class="control-label col-md-1 col-sm-1 " for="last-name">To<a style="color:red;">*</a> </label>
|
||||||
<div class="col-md-2 col-sm-2 ">
|
<div class="col-md-2 col-sm-2 ">
|
||||||
<select id="to_time" class="custom-select" name="to_time" required>
|
<select id="to_time" class="custom-select" name="to_time" required>
|
||||||
<option>select time</option>
|
<option value="">select time</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -248,7 +248,7 @@
|
|||||||
<div class="ln_solid"></div>
|
<div class="ln_solid"></div>
|
||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
<div class=" offset-md-8">
|
<div class=" offset-md-8">
|
||||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
<a href="<?php echo base_url();?>Leave/LeaveHistory" class="btn btn-secondary">Cancel</a>
|
||||||
<button type="submit" id="submit" class="btn btn-success">Submit</button>
|
<button type="submit" id="submit" class="btn btn-success">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -387,22 +387,16 @@ function get_all_count(id) {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
|
||||||
$('#myDatepicker').datetimepicker({
|
|
||||||
format: 'DD.MM.YYYY'
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$('#showtime').hide()
|
$('#showtime').hide()
|
||||||
$('#showdate').hide()
|
$('#showdate').hide()
|
||||||
function permission() {
|
|
||||||
|
|
||||||
|
$('#type').change(function() {
|
||||||
|
|
||||||
var type = $('#type').val();
|
var selectedOptionId = $(this).find(":selected").attr("id");
|
||||||
|
if( selectedOptionId === 'permission'){
|
||||||
if( type === '9' ){
|
|
||||||
|
|
||||||
$('#hidedate').hide();
|
$('#hidedate').hide();
|
||||||
$('#balance').hide();
|
$('#balance').hide();
|
||||||
@ -411,20 +405,23 @@ function permission() {
|
|||||||
$('#todate').removeAttr('required');
|
$('#todate').removeAttr('required');
|
||||||
$('#showtime').show();
|
$('#showtime').show();
|
||||||
$('#showdate').show();
|
$('#showdate').show();
|
||||||
|
$('#from_time').prop('required', true);
|
||||||
|
$('#to_time').prop('required', true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
||||||
$('#from_time').removeAttr('required');
|
$('#from_time').removeAttr('required');
|
||||||
$('#to_time').removeAttr('required');
|
$('#to_time').removeAttr('required');
|
||||||
$('#myDatepicker').removeAttr('required');
|
$('#perm_id').removeAttr('required');
|
||||||
$('#hidedate').show();
|
$('#hidedate').show();
|
||||||
$('#showtime').hide();
|
$('#showtime').hide();
|
||||||
$('#showdate').hide();
|
$('#showdate').hide();
|
||||||
$('#balance').show();
|
$('#balance').show();
|
||||||
$('#leave_bal').show();
|
$('#leave_bal').show();
|
||||||
|
$('#fromdate').prop('required', true);
|
||||||
}
|
$('#todate').prop('required', true);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -511,6 +508,7 @@ function filterTimeSlots(startingTime, numberOfHours) {
|
|||||||
var dateFormat = "dd-mm-yy";
|
var dateFormat = "dd-mm-yy";
|
||||||
var fromDateInput = $("#fromdate");
|
var fromDateInput = $("#fromdate");
|
||||||
var toDateInput = $("#todate");
|
var toDateInput = $("#todate");
|
||||||
|
var permissionDate = $("#perm_id");
|
||||||
|
|
||||||
fromDateInput.datepicker({
|
fromDateInput.datepicker({
|
||||||
dateFormat: dateFormat,
|
dateFormat: dateFormat,
|
||||||
@ -533,6 +531,15 @@ function filterTimeSlots(startingTime, numberOfHours) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
permissionDate.datepicker({
|
||||||
|
dateFormat: dateFormat,
|
||||||
|
changeYear: true,
|
||||||
|
changeMonth: true,
|
||||||
|
onSelect: function (dateText, inst) {
|
||||||
|
DateValidate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function calculateDateDifference() {
|
function calculateDateDifference() {
|
||||||
var fromDate = fromDateInput.datepicker("getDate");
|
var fromDate = fromDateInput.datepicker("getDate");
|
||||||
var toDate = toDateInput.datepicker("getDate");
|
var toDate = toDateInput.datepicker("getDate");
|
||||||
@ -557,10 +564,15 @@ function calculateDateDifference() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#subimt').click(function() {
|
// $(document).ready(function() {
|
||||||
let val = $('#user_dropdown').val()
|
// $('#submit').click(function() {
|
||||||
console.log(val);
|
// let selectedValue = $('#user_dropdown').val();
|
||||||
});
|
// alert(selectedValue);
|
||||||
|
// if(selectedValue = ""){
|
||||||
|
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,160 +0,0 @@
|
|||||||
|
|
||||||
<!-- Body page content -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="">
|
|
||||||
<div class="page-title">
|
|
||||||
|
|
||||||
<div class="title_left">
|
|
||||||
<h3>Assign Leave</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12 col-sm-12 ">
|
|
||||||
<div class="x_panel">
|
|
||||||
<div class="x_title">
|
|
||||||
|
|
||||||
<!-- <h6>General Information</h6> -->
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
<div class="x_content">
|
|
||||||
<br />
|
|
||||||
<form id="" data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Leave/createLeave" enctype="multipart/form-data">
|
|
||||||
|
|
||||||
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="item form-group">
|
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Employee Name<a style="color:red;">*</a> </label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
|
||||||
<select id="emp_id" name="emp_id" required="required" class="form-control" >
|
|
||||||
<option value="">--Select--</option>
|
|
||||||
<?php foreach ($emp as $key => $value) { ?>
|
|
||||||
<option value="<?php echo $value->id; ?>"><?php echo $value->name; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item form-group">
|
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Leave Type<a style="color:red;">*</a> </label>
|
|
||||||
<div class="col-md-5 col-sm-5 ">
|
|
||||||
<select id="type" name="type" required="required" class="form-control" >
|
|
||||||
<option value="">--Select--</option>
|
|
||||||
<?php foreach ($leavetype as $key => $value) { ?>
|
|
||||||
<option id="<?php echo $value->id; ?>" value="<?php echo $value->type; ?>"><?php echo $value->type; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Leave Balance</label>
|
|
||||||
<div class="col-md-2 col-sm-2 ">
|
|
||||||
<input type="text" id="leave_bal" name="" value="" class="form-control " readonly>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item form-group">
|
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> From Date<a style="color:red;">*</a> </label>
|
|
||||||
<div class="col-md-2 col-sm-2 ">
|
|
||||||
<input id="from_date" name="from_date" value="" required="required" class="form-control" type="date" >
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">To Date<a style="color:red;">*</a> </label>
|
|
||||||
<div class="col-md-2 col-sm-2 ">
|
|
||||||
<input id="to_date" name="to_date" value="" required="required" class="form-control" type="date" >
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item form-group">
|
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="last-name">Comments</label>
|
|
||||||
<div class="col-md-5 col-sm-5">
|
|
||||||
<textarea id="comments" name="comments" value="" class="form-control" style="height:100px !important;" type="text" ></textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ln_solid"></div>
|
|
||||||
<div class="item form-group">
|
|
||||||
<div class=" offset-md-8">
|
|
||||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
|
||||||
<button class="btn btn-primary" type="reset">Reset</button>
|
|
||||||
<button type="submit" class="btn btn-success">Submit</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /Body page content -->
|
|
||||||
<script>
|
|
||||||
var id;
|
|
||||||
|
|
||||||
$('#emp_id').on('change', function() {
|
|
||||||
id = this.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$('#type').on('change',function() {
|
|
||||||
// var type_id = this.id;
|
|
||||||
var type_id = $('option:selected', this).attr('id');
|
|
||||||
if (id)
|
|
||||||
{
|
|
||||||
$.ajax({
|
|
||||||
type: "get",
|
|
||||||
url: "<?php echo base_url()?>Leave/get_leave_count/"+id+'_'+type_id,
|
|
||||||
success: function(response) {
|
|
||||||
response = JSON.parse(response);
|
|
||||||
console.log(response);
|
|
||||||
if(response.length == 0)
|
|
||||||
{
|
|
||||||
get_all_count(type_id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$('#leave_bal').val(response[0].remaining_days);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$('#leave_bal').val("");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
function get_all_count(id) {
|
|
||||||
$.ajax({
|
|
||||||
type: "get",
|
|
||||||
url: "<?php echo base_url()?>Leave/get_all_leave_count/"+id,
|
|
||||||
success: function(response) {
|
|
||||||
response = JSON.parse(response);
|
|
||||||
$('#leave_bal').val( response[0].days);
|
|
||||||
},
|
|
||||||
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -214,7 +214,7 @@
|
|||||||
<div class="ln_solid"></div>
|
<div class="ln_solid"></div>
|
||||||
<div class="item form-group">
|
<div class="item form-group">
|
||||||
<div class=" offset-md-8">
|
<div class=" offset-md-8">
|
||||||
<button class="btn btn-secondary" onclick="history.back()">Cancel</button>
|
<a href="<?php echo base_url();?>Leave/LeaveHistory" class="btn btn-secondary">Cancel</a>
|
||||||
<button type="submit" id="submit" onclick="sweert()" class="btn btn-success">Update</button>
|
<button type="submit" id="submit" onclick="sweert()" class="btn btn-success">Update</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -92,7 +92,7 @@
|
|||||||
|
|
||||||
<td class=" "><?php echo $type->type; ?></td>
|
<td class=" "><?php echo $type->type; ?></td>
|
||||||
|
|
||||||
<td class=" "><?php echo $value->Risedby; ?></td>
|
<td class=" "><?php if($value->Risedby == ''){echo 'self'; }else{echo $value->Risedby; }; ?></td>
|
||||||
<?php if($value->no_of_days == 0){ ?>
|
<?php if($value->no_of_days == 0){ ?>
|
||||||
<td class=" ">---</td>
|
<td class=" ">---</td>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
@ -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 Leave" 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 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 } ?>
|
||||||
@ -233,14 +233,34 @@ function submitCustomPrompt() {
|
|||||||
$('#datatables').DataTable({
|
$('#datatables').DataTable({
|
||||||
"order": [
|
"order": [
|
||||||
[0, 'desc']
|
[0, 'desc']
|
||||||
], // Set initial sorting to descending on the first column
|
],
|
||||||
"dom": 'Bfrtip', // Show export buttons
|
"dom": 'Bfrtip',
|
||||||
"buttons": ['excel', 'pdf'], // Enable export options
|
buttons: [
|
||||||
"language": {
|
{
|
||||||
"search": "Search: " // Customize search label
|
extend: 'pdfHtml5',
|
||||||
|
title: 'Leave',
|
||||||
|
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: 'Leave',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':not(:last-child)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"searching": true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -24,7 +24,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>Submited for Approval.<h2></html>',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
styling: 'bootstrap3'
|
styling: 'bootstrap3'
|
||||||
});">Success</button>
|
});">Success</button>
|
||||||
@ -121,7 +121,7 @@
|
|||||||
|
|
||||||
<a href="<?php echo base_url('Leave/edit_leave_function')?>?id=<?php echo md5($value->id);?> "><i class="fa fa-edit" aria-hidden="true"title="Edit"></i></a>
|
<a href="<?php echo base_url('Leave/edit_leave_function')?>?id=<?php echo md5($value->id);?> "><i class="fa fa-edit" aria-hidden="true"title="Edit"></i></a>
|
||||||
|
|
||||||
<a href="<?php echo base_url('Leave/cancled')?>?id=<?php echo md5($value->id);?> "><i class="fa fa-ban" aria-hidden="true"title="Edit"></i></a>
|
<a href="<?php echo base_url('Leave/cancled')?>?id=<?php echo md5($value->id);?> "><i class="fa fa-ban" aria-hidden="true"title="Cancel"></i></a>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
@ -182,12 +182,32 @@
|
|||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#datatables').DataTable({
|
$('#datatables').DataTable({
|
||||||
"order": [[0, 'desc']], // Set initial sorting to descending on the first column
|
"order": [
|
||||||
"dom": 'Bfrtip', // Show export buttons
|
[0, 'desc']
|
||||||
"buttons": [ 'excel', 'pdf'], // Enable export options
|
],
|
||||||
"language": {
|
"dom": 'Bfrtip',
|
||||||
"search": "Search: " // Customize search label
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'pdfHtml5',
|
||||||
|
title: 'Leave',
|
||||||
|
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: 'Leave',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':not(:last-child)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -118,7 +118,7 @@
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
<td style=" text-align: center; font-size: 16px;">
|
<td style=" text-align: center; font-size: 16px;">
|
||||||
<?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 Leave" 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 href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" id= "<?php echo $value->id; ?>" onclick="showCustomPrompt()"></i></a>
|
<a href="#"><i class="fa fa-times test" aria-hidden="true" title="Decline" id= "<?php echo $value->id; ?>" onclick="showCustomPrompt()"></i></a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
@ -258,12 +258,32 @@ function submitCustomPrompt() {
|
|||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#datatables').DataTable({
|
$('#datatables').DataTable({
|
||||||
"order": [[0, 'desc']], // Set initial sorting to descending on the first column
|
"order": [
|
||||||
"dom": 'Bfrtip', // Show export buttons
|
[0, 'desc']
|
||||||
"buttons": [ 'excel', 'pdf'], // Enable export options
|
],
|
||||||
"language": {
|
"dom": 'Bfrtip',
|
||||||
"search": "Search: " // Customize search label
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'pdfHtml5',
|
||||||
|
title: 'Leave',
|
||||||
|
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: 'Leave',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':not(:last-child)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.status-success {
|
.status-success {
|
||||||
background-color: #c1ffc1;
|
background-color: #c1ffc1;
|
||||||
@ -18,6 +22,10 @@
|
|||||||
width: 300px;
|
width: 300px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.dataTables_wrapper div.dataTables_filter {
|
||||||
|
margin-top: -30px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<div class="col-md-12 col-sm-12 ">
|
<div class="col-md-12 col-sm-12 ">
|
||||||
@ -35,7 +43,7 @@
|
|||||||
<div class="x_content">
|
<div class="x_content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<table id="datatable" class="table table-striped table-bordered" width="100%">
|
<table id="datatables" class="table table-striped table-bordered" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="headings">
|
<tr class="headings">
|
||||||
<th class="column-title">Name </th>
|
<th class="column-title">Name </th>
|
||||||
@ -124,4 +132,36 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#datatables').DataTable({
|
||||||
|
"order": [
|
||||||
|
[0, 'desc']
|
||||||
|
],
|
||||||
|
"dom": 'Bfrtip',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'pdfHtml5',
|
||||||
|
title: 'Users',
|
||||||
|
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: 'Users',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':not(:last-child)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user