some new change : Venkateshwaran
This commit is contained in:
parent
d52e44c845
commit
4c304c22de
@ -113,7 +113,7 @@ public function rise_expence_request()
|
||||
$create_leave = $this->MY_Model->insert($data,$table);
|
||||
|
||||
$this->session->set_flashdata('Create', 'Claim Request Rised Successfully');
|
||||
redirect('Expence/expence_form');
|
||||
redirect('Expence/Emp_Expence_List');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -110,9 +110,7 @@
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
<?php if(user()->id == $value->emp_id) { ?>
|
||||
<tr class="even pointer">
|
||||
<td class=" "><?php echo dateFormat('d-m-Y',$value->created_at);?>
|
||||
<?php echo timeFormat('h:i:s a',$value->created_at);?>
|
||||
</td>
|
||||
<td class=" "><?php echo $value->created_date; ?><br><?php echo $value->created_time;?></td>
|
||||
<td class=" "><?php echo $value->comments; ?></td>
|
||||
<td class=" "> <?php echo dateFormat('d-m-Y',$value->date_of_expence);?></td>
|
||||
<td class=" ">₹ <?php echo $value->amount; ?></td>
|
||||
|
||||
@ -30,14 +30,6 @@
|
||||
<div class="x_panel">
|
||||
<div class="x_title">
|
||||
|
||||
<?php if ($this->session->userdata('Create')): ?>
|
||||
<div class="alert-success flash-message" id="customPrompt" style="text-align: right;">
|
||||
<h2><?php echo $this->session->userdata('Create'); ?></h2>
|
||||
<span onclick="$('#customPrompt').hide()" style="text-align: right;" ><i class="fa fa-times" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $this->session->unset_userdata('Create');?>
|
||||
|
||||
<ul class="nav navbar-right panel_toolbox">
|
||||
<a href="<?php echo base_url();?>Expence/emp_expence_list" class="btn btn-primary" style="margin-top: 20px;">Back</a>
|
||||
</ul>
|
||||
@ -95,7 +87,7 @@
|
||||
|
||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> Expense Cost <a style="color:red;">*</a></label>
|
||||
<div class="col-md-5 col-sm-5 ">
|
||||
<input id="cost" name="amount" required value="<?php if(isset($assetData)) { echo $assetData->cost; } ?>" class="form-control" type="text" name="middle-name">
|
||||
<input id="cost" name="amount" required value="<?php if(isset($assetData)) { echo $assetData->cost; } ?>" class="form-control" type="number" name="middle-name">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@
|
||||
|
||||
<?php if(!empty($value->bill)) { ?>
|
||||
|
||||
<a onclick="openModal('<?php echo base_url(); ?>assets/uploads/Expence_Bill/<?php echo $value->bill; ?>')" title="ViewBill"><i class="fa fa-eye" aria-hidden="true"></i></a><br>
|
||||
<a onclick="openModal('<?php echo base_url(); ?>assets/uploads/Expence_Bill/<?php echo $value->bill; ?>')" title="ViewBill"><i class="fa fa-eye" aria-hidden="true" target="_blank"></i></a><br>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th class="column-title">Claim Date</th>
|
||||
<th class="column-title">Claim Date</th>
|
||||
<th class="column-title">Employee Name</th>
|
||||
<th class="column-title">Description </th>
|
||||
<th class="column-title">Expense Date</th>
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
|
||||
<li><a href="<?php echo base_url();?>Leave/applyLeave">Apply Leave</a></li>
|
||||
|
||||
<li><a href="<?php echo base_url();?>Leave/manager_approvel">My Approvals</a></li>
|
||||
<li><a href="<?php echo base_url();?>Leave/leaveList">My Approvals</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@ -63,11 +63,13 @@ public function leaveList()
|
||||
}
|
||||
|
||||
public function applyLeave()
|
||||
{
|
||||
$emp_leave_count = $this->Leave_model->get("emp_leave_days");
|
||||
$emp = $this->Emp_model->get_employee(user()->business_id);
|
||||
{
|
||||
$business_id = user()->business_id;
|
||||
$user_id = user()->id;
|
||||
$emp_leave_count = $this->Leave_model->get_count($user_id, $business_id, "emp_leave_days");
|
||||
$emp = $this->Emp_model->get_employee(user()->business_id);
|
||||
$leavetype = $this->Leave_model->getLeaveType($business_id);
|
||||
//print_r($emp_leave_count); die();
|
||||
$this->layout->set('emp', $emp);
|
||||
$this->layout->set('count', $emp_leave_count);
|
||||
$this->layout->set('leavetype', $leavetype);
|
||||
@ -124,7 +126,7 @@ public function createLeave()
|
||||
$emp_id = user()->id;
|
||||
}
|
||||
$data['emp_id'] = $emp_id;
|
||||
if($data['manager']){
|
||||
if(!is_null($data['manager'])){
|
||||
$manager = $this->input->post('manager');
|
||||
}else{
|
||||
$manager = employee()->manager;
|
||||
@ -137,7 +139,7 @@ public function createLeave()
|
||||
$emp_leave_count = $this->Leave_model->get_leave( $emp_id , user()->business_id , "emp_leave_days");
|
||||
|
||||
// count number of days between two dates
|
||||
$days_between = ceil(abs(dateFormat('d-m-Y',$this->input->post('to_date')) - dateFormat('d-m-Y',$this->input->post('from_date'))) / 86400);
|
||||
$days_between = ceil(abs($this->input->post('to_date') - $this->input->post('from_date')) / 86400);
|
||||
$data['no_of_days'] = $days_between + 1;
|
||||
$noofdays = $days_between + 1;
|
||||
if (count($emp_leave_count) != 0)
|
||||
@ -379,6 +381,14 @@ public function manager_approvel()
|
||||
$this->layout->render('Employee_Layout');
|
||||
}
|
||||
|
||||
public function hide_leave_type()
|
||||
{
|
||||
$type_id = $this->input->get('type_id');
|
||||
$emp_id = $this->input->get('emp_id');
|
||||
$emp_leave_count = $this->Leave_model->get_emp_leave_count($type_id, $emp_id);
|
||||
echo json_encode($emp_leave_count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -27,11 +27,12 @@ public function get_with_emp_name($business_id, )
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function get($table)
|
||||
public function get_count($user_id, $business_id, $table)
|
||||
{
|
||||
$this->db->select('*');
|
||||
$this->db->from($table);
|
||||
$this->db->order_by('id','DESC');
|
||||
$this->db->where('business_id', $business_id);
|
||||
$this->db->where('emp_id', $user_id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result();
|
||||
@ -260,5 +261,15 @@ public function Get_delegation_id($business_id)
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
public function get_emp_leave_count($type_id, $emp_id)
|
||||
{
|
||||
$this->db->select('remaining_days');
|
||||
$this->db->from('emp_leave_days');
|
||||
$this->db->where('emp_id', $emp_id);
|
||||
$this->db->where('type', $type_id);
|
||||
$this->db->where('is_active', 1);
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
}
|
||||
@ -147,7 +147,7 @@
|
||||
<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>
|
||||
<select id="user_dropdown" name="emp_id" style="margin-top: 10px;padding-bottom: 10px;" class="form-control manager"> </select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -308,7 +308,6 @@
|
||||
response = JSON.parse(response);
|
||||
if(response.length == 0)
|
||||
{
|
||||
|
||||
get_all_count(type_id);
|
||||
}
|
||||
else
|
||||
@ -395,9 +394,9 @@ function permission() {
|
||||
|
||||
if( type === 'Permission' ){
|
||||
|
||||
$('#hidedate').hide()
|
||||
$('#balance').hide()
|
||||
$('#leave_bal').hide()
|
||||
$('#hidedate').hide();
|
||||
$('#balance').hide();
|
||||
$('#leave_bal').hide();
|
||||
$('#fromdate').removeAttr('required');
|
||||
$('#todate').removeAttr('required');
|
||||
$('#showtime').show();
|
||||
@ -411,8 +410,8 @@ function permission() {
|
||||
$('#hidedate').show();
|
||||
$('#showtime').hide();
|
||||
$('#showdate').hide();
|
||||
$('#balance').show()
|
||||
$('#leave_bal').show()
|
||||
$('#balance').show();
|
||||
$('#leave_bal').show();
|
||||
|
||||
}
|
||||
}
|
||||
@ -538,7 +537,7 @@ function calculateDateDifference() {
|
||||
|
||||
if (fromDate && toDate) {
|
||||
var difference = Math.ceil((toDate - fromDate) / (1000 * 60 * 60 * 24) + 1);
|
||||
if(difference === 1)s
|
||||
if(difference === 1)
|
||||
{
|
||||
$("#dateDifference").val(difference + ' day');
|
||||
}
|
||||
@ -555,7 +554,42 @@ function calculateDateDifference() {
|
||||
</script>
|
||||
|
||||
|
||||
<!-- <script>
|
||||
|
||||
$('#type, #user_dropdown').on('change', function(){
|
||||
|
||||
|
||||
let get_emp_id = document.getElementById("user_dropdown");
|
||||
let emp_id = get_emp_id.value;
|
||||
console.log(emp_id);
|
||||
|
||||
var selectElement = document.getElementById("type");
|
||||
var selectedOption = selectElement.selectedOptions[0];
|
||||
var type_id = selectedOption.id;
|
||||
console.log(type_id);
|
||||
|
||||
|
||||
$.ajax({
|
||||
data: {type_id : type_id, emp_id : emp_id},
|
||||
url : "<?php echo base_url()?>Leave/hide_leave_type/",
|
||||
type: "get",
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
|
||||
if(response[0].remaining_days == 0 || response[0].remaining_days <= -1)
|
||||
{
|
||||
alert('your leave is completed');
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script> -->
|
||||
|
||||
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
div.dataTables_wrapper div.dataTables_filter{
|
||||
margin-top: -44px !important; //search move to up
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
@ -68,6 +68,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tableData as $key => $value) { ?>
|
||||
|
||||
<tr class="even pointer">
|
||||
|
||||
<td class=" "><?php echo $value->created_date; ?><br><?php echo $value->created_time; ?></td>
|
||||
@ -76,7 +77,7 @@
|
||||
<td class="">
|
||||
<?php echo dateFormat('d-m-Y',$value->perm_date);?><br>
|
||||
<?php echo timeFormat('h:i a', $value->from_time); ?> to
|
||||
<?php echo timeFormat('h:i a', $value->to_time);; ?>
|
||||
<?php echo timeFormat('h:i a', $value->to_time);?>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
|
||||
@ -93,10 +94,10 @@
|
||||
<td style="color:#e68a00"><?php echo $value->status; ?></td>
|
||||
<?php }
|
||||
else if($value->status == 'Approved'){ ?>
|
||||
<td style="color:green"><?php echo $value->status; ?></td>
|
||||
<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; ?>by <?php echo $value->declined_by; ?> <br>" <?php echo $value->DReason; ?> "</td>
|
||||
<td style="color:red"><?php echo $value->status; ?> By <?php echo $value->declined_by; ?> <br>" <?php echo $value->DReason; ?> "</td>
|
||||
<?php }
|
||||
else if($value->status == 'canceled'){ ?>
|
||||
<td style="color:darkcyan;"><?php echo $value->status; ?></td>
|
||||
|
||||
BIN
assets/uploads/Expence_Bill/1687609751.jpg
Normal file
BIN
assets/uploads/Expence_Bill/1687609751.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 460 KiB |
BIN
assets/uploads/Expence_Bill/16876097511.jpg
Normal file
BIN
assets/uploads/Expence_Bill/16876097511.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 460 KiB |
Loading…
Reference in New Issue
Block a user