tracker issue and leave mster
This commit is contained in:
parent
702ba6dd05
commit
3dac74521d
@ -110,10 +110,11 @@ public function rise_expence_request()
|
|||||||
'manager_id' => $manager,
|
'manager_id' => $manager,
|
||||||
'status' => 'Draft',
|
'status' => 'Draft',
|
||||||
// 'date_of_expense'=> $this->input->post('date_of_expence')[$i],
|
// 'date_of_expense'=> $this->input->post('date_of_expence')[$i],
|
||||||
'date_of_expense_new'=> $this->input->post('date_of_expence_new')[$i],
|
'date_of_expense_new' => date('Y-m-d', strtotime($this->input->post('date_of_expence_new')[$i])),
|
||||||
'amount' => $this->input->post('amount')[$i],
|
'amount' => $this->input->post('amount')[$i],
|
||||||
'description' => $this->input->post('description')[$i],
|
'description' => $this->input->post('description')[$i],
|
||||||
);
|
);
|
||||||
|
// print_r($data2);die;
|
||||||
$this->load->library('upload');
|
$this->load->library('upload');
|
||||||
|
|
||||||
$config['upload_path'] = APPPATH. '../assets/uploads/Expence_Bill/';
|
$config['upload_path'] = APPPATH. '../assets/uploads/Expence_Bill/';
|
||||||
|
|||||||
@ -114,7 +114,7 @@
|
|||||||
<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" for="last-name">Expense Requisted For</label>
|
<label class="control-label col-md-2 col-sm-2" for="last-name">Expense Requested 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;?>)"style="margin:10px;"checked /><b>Self</b>
|
<input type="radio" name="created_by" value="self (<?php echo user()->id;?>)"style="margin:10px;"checked /><b>Self</b>
|
||||||
@ -202,7 +202,12 @@
|
|||||||
<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_new ?>" autocomplete='off'/><i class="fa fa-calendar" style=" position: absolute; right: 25px; top: 12px;z-index: 0;"></i>
|
<?php
|
||||||
|
// Assuming $leave->perm_date_new is in the 'Y-m-d' format
|
||||||
|
$formatted_date = date('d-m-y', strtotime($value->date_of_expense_new));
|
||||||
|
?>
|
||||||
|
|
||||||
|
<input type='text' id="ExpenseDate<?php echo $i;?>" class="form-control date" placeholder="DD-MM-YYYY" required name="date_of_expence_new[]" value="<?php echo $formatted_date ?>" autocomplete='off'/><i class="fa fa-calendar" style=" position: absolute; right: 25px; top: 12px;z-index: 0;"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -144,7 +144,12 @@
|
|||||||
<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>
|
||||||
<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" required name="date_of_expence_new[]" value="<?php echo $value->date_of_expense ?>" autocomplete='off' /><i class="fa fa-calendar"></i>
|
<?php
|
||||||
|
// Assuming $leave->perm_date_new is in the 'Y-m-d' format
|
||||||
|
$formatted_date = date('d-m-y', strtotime($value->date_of_expense_new));
|
||||||
|
?>
|
||||||
|
|
||||||
|
<input type='date' id='ExpenseDate' class="form-control" placeholder="DD-MM-YYYY" required name="date_of_expence_new[]" value="<?php echo $formatted_date ?>" autocomplete='off' /><i class="fa fa-calendar"></i>
|
||||||
</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; ?>">
|
||||||
|
|||||||
@ -198,7 +198,7 @@
|
|||||||
<tr class="even pointer">
|
<tr class="even pointer">
|
||||||
<td hidden><?php echo $value->id; ?></td>
|
<td hidden><?php echo $value->id; ?></td>
|
||||||
<td><?php echo date('d-m-Y', strtotime($value->created_on));?></td>
|
<td><?php echo date('d-m-Y', strtotime($value->created_on));?></td>
|
||||||
<td class=" "><?php echo date('d-m-Y', strtotime($value->date_of_expense)) ?></td>
|
<td class=" "><?php echo date('d-m-Y', strtotime($value->date_of_expense_new)) ?></td>
|
||||||
<td class=" "><?php echo $value->amount; ?></td>
|
<td class=" "><?php echo $value->amount; ?></td>
|
||||||
<td class=" "><?php echo $value->description; ?></td>
|
<td class=" "><?php echo $value->description; ?></td>
|
||||||
<?php if($value->status == 'pending'){ ?>
|
<?php if($value->status == 'pending'){ ?>
|
||||||
|
|||||||
@ -177,7 +177,8 @@ public function createLeave()
|
|||||||
$perm_data['business_id'] = user()->business_id;
|
$perm_data['business_id'] = user()->business_id;
|
||||||
$perm_data['status'] = 'pending';
|
$perm_data['status'] = 'pending';
|
||||||
// $perm_data['created_date'] = date('d-m-Y');
|
// $perm_data['created_date'] = date('d-m-Y');
|
||||||
$perm_data['created_date_new'] = date('d-m-Y');
|
$perm_data['created_date_new'] = date('Y-m-d');
|
||||||
|
|
||||||
$perm_data['created_time'] = date('H:i A');
|
$perm_data['created_time'] = date('H:i A');
|
||||||
unset($perm_data['from_date']);
|
unset($perm_data['from_date']);
|
||||||
unset($perm_data['to_date']);
|
unset($perm_data['to_date']);
|
||||||
@ -185,6 +186,7 @@ public function createLeave()
|
|||||||
unset($perm_data['to_date_new']);
|
unset($perm_data['to_date_new']);
|
||||||
$table="leave_list";
|
$table="leave_list";
|
||||||
$perm_data['perm_date_new'] = date("Y-m-d", strtotime( $this->input->post('perm_date_new') ));
|
$perm_data['perm_date_new'] = date("Y-m-d", strtotime( $this->input->post('perm_date_new') ));
|
||||||
|
|
||||||
$create_permission = $this->MY_Model->insert($perm_data,$table);
|
$create_permission = $this->MY_Model->insert($perm_data,$table);
|
||||||
|
|
||||||
//for notification
|
//for notification
|
||||||
@ -351,7 +353,7 @@ public function edit_leave_function()
|
|||||||
// print_r($leavetype);
|
// print_r($leavetype);
|
||||||
// print_r($id);
|
// print_r($id);
|
||||||
// print_r($editleave);
|
// print_r($editleave);
|
||||||
// // // print_r($emp);
|
// print_r($emp);
|
||||||
// die;
|
// die;
|
||||||
$this->layout->set('emp', $emp);
|
$this->layout->set('emp', $emp);
|
||||||
$this->layout->set('editleave', $editleave);
|
$this->layout->set('editleave', $editleave);
|
||||||
@ -367,8 +369,8 @@ public function editleave()
|
|||||||
if($this->input->post('type') === '1')
|
if($this->input->post('type') === '1')
|
||||||
{
|
{
|
||||||
$action = $this->input->post();
|
$action = $this->input->post();
|
||||||
unset($action['from_date']);
|
unset($action['from_date_new']);
|
||||||
unset($action['to_date']);
|
unset($action['to_date_new']);
|
||||||
$id = $this->input->post('id');
|
$id = $this->input->post('id');
|
||||||
|
|
||||||
if(isset($action['emp_id'])){
|
if(isset($action['emp_id'])){
|
||||||
@ -385,10 +387,13 @@ public function editleave()
|
|||||||
$action['manager'] = $manager;
|
$action['manager'] = $manager;
|
||||||
$action['business_id'] = user()->business_id;
|
$action['business_id'] = user()->business_id;
|
||||||
$action['status'] = 'pending';
|
$action['status'] = 'pending';
|
||||||
|
$action['perm_date_new'] = date('Y-m-d', strtotime($this->input->post('perm_date_new')));
|
||||||
|
|
||||||
$action['created_date'] = date('d-m-Y');
|
$action['created_date'] = date('d-m-Y');
|
||||||
$action['created_time'] = date('H:i A');
|
$action['created_time'] = date('H:i A');
|
||||||
$table="leave_list";
|
$table="leave_list";
|
||||||
$create_permission = $this->MY_Model->edit_option($action, $id, $table);
|
$create_permission = $this->MY_Model->edit_option($action, $id, $table);
|
||||||
|
|
||||||
$this->session->set_flashdata('update', '0');
|
$this->session->set_flashdata('update', '0');
|
||||||
redirect('Leave/LeaveHistory');
|
redirect('Leave/LeaveHistory');
|
||||||
}
|
}
|
||||||
@ -405,27 +410,37 @@ public function editleave()
|
|||||||
$action['emp_id'] = $emp_id;
|
$action['emp_id'] = $emp_id;
|
||||||
$action['business_id'] = user()->business_id;
|
$action['business_id'] = user()->business_id;
|
||||||
$action['status'] = 'pending';
|
$action['status'] = 'pending';
|
||||||
$leave_year = date('Y', strtotime($this->input->post('from_date')));
|
$action['from_date_new'] = date('Y-m-d', strtotime($this->input->post('from_date_new')));
|
||||||
|
$action['to_date_new'] = date('Y-m-d', strtotime($this->input->post('to_date_new')));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$leave_year = date('Y', strtotime($this->input->post('from_date_new')));
|
||||||
$emp_leave_count = $this->Leave_model->get_leave( $emp_id , user()->business_id , "emp_leave_days", $leave_year, $this->input->post('type'));
|
$emp_leave_count = $this->Leave_model->get_leave( $emp_id , user()->business_id , "emp_leave_days", $leave_year, $this->input->post('type'));
|
||||||
$leave_master_count = $this->Leave_model->get_by_type( $this->input->post('type') , user()->business_id , "leave_master");
|
$leave_master_count = $this->Leave_model->get_by_type( $this->input->post('type') , user()->business_id , "leave_master");
|
||||||
|
|
||||||
|
|
||||||
// count number of days between two dates
|
// count number of days between two dates
|
||||||
$days_between = ceil(abs(strtotime($this->input->post('to_date')) - strtotime($this->input->post('from_date'))) / 86400);
|
$days_between = ceil(abs(strtotime(date('Y-m-d', strtotime($this->input->post('to_date_new')))) - strtotime(date('Y-m-d', strtotime($this->input->post('from_date_new'))))) / 86400);
|
||||||
|
|
||||||
$action['no_of_days'] = $days_between + 1;
|
$action['no_of_days'] = $days_between + 1;
|
||||||
$noofdays = $days_between + 1;
|
$noofdays = $days_between + 1;
|
||||||
$leave_id = $this->input->post('id');
|
$leave_id = $this->input->post('id');
|
||||||
if (count($emp_leave_count) != 0)
|
if (count($emp_leave_count) != 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
if($noofdays > $emp_leave_count[0]->remaining_days)
|
if($noofdays > $emp_leave_count[0]->remaining_days)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->session->set_flashdata('error', '1');
|
$this->session->set_flashdata('error', '1');
|
||||||
redirect('Leave/edit_leave_function?id='.md5($leave_id));
|
redirect('Leave/edit_leave_function?id='.md5($leave_id));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
//this part is update if date inculeded in emp_leave_days table
|
//this part is update if date inculeded in emp_leave_days table
|
||||||
$action['leave_bal'] = $emp_leave_count[0]->remaining_days;
|
$action['leave_bal'] = $emp_leave_count[0]->remaining_days;
|
||||||
|
|
||||||
$days['remaining_days'] = $emp_leave_count[0]->remaining_days;
|
$days['remaining_days'] = $emp_leave_count[0]->remaining_days;
|
||||||
$this->Leave_model->update_leave($days, $emp_id , 'emp_leave_days', $leave_year, $this->input->post('type'));
|
$this->Leave_model->update_leave($days, $emp_id , 'emp_leave_days', $leave_year, $this->input->post('type'));
|
||||||
}
|
}
|
||||||
@ -433,11 +448,15 @@ public function editleave()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if($noofdays > $leave_master_count[0]->days)
|
if($noofdays > $leave_master_count[0]->days)
|
||||||
{ $this->session->set_flashdata('error', '1');
|
{
|
||||||
|
|
||||||
|
$this->session->set_flashdata('error', '1');
|
||||||
redirect('Leave/edit_leave_function?id='.md5($leave_id));
|
redirect('Leave/edit_leave_function?id='.md5($leave_id));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
echo "else stss";
|
||||||
$all_leave_count = $this->Leave_model->get_by_type( $this->input->post('type') , user()->business_id , "leave_master");
|
$all_leave_count = $this->Leave_model->get_by_type( $this->input->post('type') , user()->business_id , "leave_master");
|
||||||
$data['leave_bal'] = $all_leave_count[0]->days;
|
$data['leave_bal'] = $all_leave_count[0]->days;
|
||||||
$days['remaining_days'] = $all_leave_count[0]->days;
|
$days['remaining_days'] = $all_leave_count[0]->days;
|
||||||
@ -452,14 +471,16 @@ public function editleave()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$get_from_date = $this->Leave_model->get_from_date($emp_id, $this->input->post('from_date'), $this->input->post('to_date'));
|
$get_from_date = $this->Leave_model->get_from_date($emp_id, $this->input->post('from_date_new'), $this->input->post('to_date_new'));
|
||||||
// echo "<pre>";
|
// echo "<pre>";
|
||||||
// print_r($get_from_date); die();
|
|
||||||
|
|
||||||
if($get_from_date == 0)
|
if($get_from_date == 0)
|
||||||
{
|
{
|
||||||
|
echo"update fun:";
|
||||||
$table="leave_list";
|
$table="leave_list";
|
||||||
$update_leave = $this->MY_Model->edit_option($action,$id,$table);
|
$update_leave = $this->MY_Model->edit_option($action,$id,$table);
|
||||||
|
|
||||||
$this->session->set_flashdata('update', '0');
|
$this->session->set_flashdata('update', '0');
|
||||||
redirect('Leave/LeaveHistory');
|
redirect('Leave/LeaveHistory');
|
||||||
}
|
}
|
||||||
@ -488,6 +509,7 @@ public function get_all_leave_count()
|
|||||||
{
|
{
|
||||||
$id = $this->input->get('type_id');
|
$id = $this->input->get('type_id');
|
||||||
$all_leave_count = $this->Leave_model->get_id( $id , user()->business_id , "leave_master");
|
$all_leave_count = $this->Leave_model->get_id( $id , user()->business_id , "leave_master");
|
||||||
|
|
||||||
echo json_encode($all_leave_count);
|
echo json_encode($all_leave_count);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -512,14 +534,16 @@ public function ApproveLeave()
|
|||||||
$business_id = user()->business_id;
|
$business_id = user()->business_id;
|
||||||
$emp_id = $this->Leave_model->get_emp_id($id);
|
$emp_id = $this->Leave_model->get_emp_id($id);
|
||||||
$no_of_days = $this->Leave_model->get_Leave_nodays($id,);
|
$no_of_days = $this->Leave_model->get_Leave_nodays($id,);
|
||||||
$leave_year = date('Y', strtotime($no_of_days->from_date));
|
$leave_year = date('Y', strtotime($no_of_days->from_date_new));
|
||||||
$leave_type = $this->Leave_model->get_leave_data_using_leave_id($id);
|
$leave_type = $this->Leave_model->get_leave_data_using_leave_id($id);
|
||||||
|
|
||||||
|
// print_r($leave_year);
|
||||||
|
|
||||||
if($leave_type->leave_code !== 'permission')
|
if($leave_type->leave_code !== 'permission')
|
||||||
{
|
{
|
||||||
$remaining_days = $this->Leave_model->remaining_days($emp_id, user()->business_id, $leave_year, $no_of_days->type);
|
$remaining_days = $this->Leave_model->remaining_days($emp_id,$business_id, $leave_year, $no_of_days->type);
|
||||||
$balance_days = $remaining_days[0]->remaining_days - $no_of_days->no_of_days;
|
$balance_days = $remaining_days[0]->remaining_days - $no_of_days->no_of_days;
|
||||||
|
// print_r($balance_days);die;
|
||||||
$data['leave_bal'] = $balance_days;
|
$data['leave_bal'] = $balance_days;
|
||||||
$days['remaining_days'] = $balance_days;
|
$days['remaining_days'] = $balance_days;
|
||||||
$this->Leave_model->emp_leave_days_update($emp_id, $days, $leave_year, $business_id, $no_of_days->type);
|
$this->Leave_model->emp_leave_days_update($emp_id, $days, $leave_year, $business_id, $no_of_days->type);
|
||||||
@ -556,7 +580,7 @@ public function ManagerLeaveApprove()
|
|||||||
$business_id = user()->business_id;
|
$business_id = user()->business_id;
|
||||||
$emp_id = $this->Leave_model->get_emp_id($id);
|
$emp_id = $this->Leave_model->get_emp_id($id);
|
||||||
$no_of_days = $this->Leave_model->get_Leave_nodays($id,);
|
$no_of_days = $this->Leave_model->get_Leave_nodays($id,);
|
||||||
$leave_year = date('Y', strtotime($no_of_days->from_date));
|
$leave_year = date('Y', strtotime($no_of_days->from_date_new));
|
||||||
$leave_type = $this->Leave_model->get_leave_data_using_leave_id($id);
|
$leave_type = $this->Leave_model->get_leave_data_using_leave_id($id);
|
||||||
|
|
||||||
$remaining_days = $this->Leave_model->remaining_days($emp_id, user()->business_id, $leave_year, $no_of_days->type);
|
$remaining_days = $this->Leave_model->remaining_days($emp_id, user()->business_id, $leave_year, $no_of_days->type);
|
||||||
@ -691,7 +715,7 @@ public function DeclinewithdrawLeave()
|
|||||||
$business_id = user()->business_id;
|
$business_id = user()->business_id;
|
||||||
$emp_id = $this->Leave_model->get_emp_id($id);
|
$emp_id = $this->Leave_model->get_emp_id($id);
|
||||||
$no_of_days = $this->Leave_model->get_Leave_nodays($id,);
|
$no_of_days = $this->Leave_model->get_Leave_nodays($id,);
|
||||||
$leave_year = date('Y', strtotime($no_of_days->from_date));
|
$leave_year = date('Y', strtotime($no_of_days->from_date_new));
|
||||||
$leave_type = $this->Leave_model->get_leave_data_using_leave_id($id);
|
$leave_type = $this->Leave_model->get_leave_data_using_leave_id($id);
|
||||||
|
|
||||||
if($leave_type->leave_code !== 'permission')
|
if($leave_type->leave_code !== 'permission')
|
||||||
@ -730,7 +754,7 @@ public function ApprovewithdrawLeave()
|
|||||||
|
|
||||||
// Update leave balance
|
// Update leave balance
|
||||||
$emp_id = $this->Leave_model->get_emp_id($id);
|
$emp_id = $this->Leave_model->get_emp_id($id);
|
||||||
$leave_year = date('Y', strtotime($leave_data->from_date));
|
$leave_year = date('Y', strtotime($leave_data->from_date_new));
|
||||||
$remaining_days = $this->Leave_model->remaining_days($emp_id, user()->business_id, $leave_year, $leave_data->type);
|
$remaining_days = $this->Leave_model->remaining_days($emp_id, user()->business_id, $leave_year, $leave_data->type);
|
||||||
$balance_days = $remaining_days[0]->remaining_days + $leave_data->no_of_days;
|
$balance_days = $remaining_days[0]->remaining_days + $leave_data->no_of_days;
|
||||||
|
|
||||||
|
|||||||
@ -180,6 +180,7 @@ public function remaining_days($emp_id, $business_id, $leave_year, $type)
|
|||||||
$this->db->where('is_active', 1);
|
$this->db->where('is_active', 1);
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
$query = $query->result();
|
$query = $query->result();
|
||||||
|
// print_r($this->db->last_query());
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -511,8 +512,8 @@ public function get_from_date($emp_id, $from_date, $to_date)
|
|||||||
$this->db->select('*');
|
$this->db->select('*');
|
||||||
$this->db->from('leave_list');
|
$this->db->from('leave_list');
|
||||||
$this->db->where('emp_id', $emp_id);
|
$this->db->where('emp_id', $emp_id);
|
||||||
$this->db->where('from_date >=', $from_date);
|
$this->db->where('from_date_new >=', $from_date);
|
||||||
$this->db->where('to_date <=', $to_date);
|
$this->db->where('to_date_new <=', $to_date);
|
||||||
$query = $this->db->count_all_results();
|
$query = $this->db->count_all_results();
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
@ -544,8 +545,8 @@ public function get_approved_leaves_cur_week()
|
|||||||
$this->db->from('leave_list');
|
$this->db->from('leave_list');
|
||||||
$this->db->join('users', 'users.id = leave_list.emp_id', 'left');
|
$this->db->join('users', 'users.id = leave_list.emp_id', 'left');
|
||||||
$this->db->group_start();
|
$this->db->group_start();
|
||||||
$this->db->where("STR_TO_DATE(from_date, '%d-%m-%Y') <= '$currentWeekEnd'");
|
$this->db->where("STR_TO_DATE(from_date_new, '%d-%m-%Y') <= '$currentWeekEnd'");
|
||||||
$this->db->where("STR_TO_DATE(to_date, '%d-%m-%Y') >= '$currentWeekStart'");
|
$this->db->where("STR_TO_DATE(to_date_new, '%d-%m-%Y') >= '$currentWeekStart'");
|
||||||
$this->db->or_where("STR_TO_DATE(perm_date, '%d-%m-%Y') <= '$currentWeekEnd'");
|
$this->db->or_where("STR_TO_DATE(perm_date, '%d-%m-%Y') <= '$currentWeekEnd'");
|
||||||
$this->db->or_where("STR_TO_DATE(perm_date, '%d-%m-%Y') >= '$currentWeekStart'");
|
$this->db->or_where("STR_TO_DATE(perm_date, '%d-%m-%Y') >= '$currentWeekStart'");
|
||||||
$this->db->group_end();
|
$this->db->group_end();
|
||||||
@ -556,8 +557,8 @@ public function get_approved_leaves_cur_week()
|
|||||||
// Organize approved leave records into columns based on days of the week
|
// Organize approved leave records into columns based on days of the week
|
||||||
$weekData = [];
|
$weekData = [];
|
||||||
foreach ($approvedLeaveRecords as $leave) {
|
foreach ($approvedLeaveRecords as $leave) {
|
||||||
$leaveStartDate = ($leave->from_date) ? date('Y-m-d', strtotime($leave->from_date)) : date('Y-m-d', strtotime($leave->perm_date));
|
$leaveStartDate = ($leave->from_date_new) ? date('Y-m-d', strtotime($leave->from_date_new)) : date('Y-m-d', strtotime($leave->perm_date));
|
||||||
$leaveEndDate = ($leave->to_date) ? date('Y-m-d', strtotime($leave->to_date)) : date('Y-m-d', strtotime($leave->perm_date));
|
$leaveEndDate = ($leave->to_date_new) ? date('Y-m-d', strtotime($leave->to_date_new)) : date('Y-m-d', strtotime($leave->perm_date));
|
||||||
|
|
||||||
// Use from_time and to_time if available
|
// Use from_time and to_time if available
|
||||||
$fromTime = ($leave->from_time) ? ' ' . $leave->from_time : '';
|
$fromTime = ($leave->from_time) ? ' ' . $leave->from_time : '';
|
||||||
|
|||||||
@ -143,7 +143,7 @@
|
|||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Balance</label>
|
<label class="control-label col-md-1 col-sm-1 " for="first-name"> Balance</label>
|
||||||
<div class="col-md-1 col-sm-1 ">
|
<div class="col-md-1 col-sm-1 ">
|
||||||
<input type="text" id="leave_bal" name="" value="" style="width:90px;" class="form-control " readonly>
|
<input type="text" id="leave_bal" name="" value="<?php echo $leave->leave_bal; ?>" style="width:90px;" class="form-control " readonly>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -154,7 +154,7 @@
|
|||||||
<label class="control-label col-md-2 col-sm-2 " for="first-name"> From Date<a style="color:red;">*</a> </label>
|
<label class="control-label col-md-2 col-sm-2 " for="first-name"> From Date<a style="color:red;">*</a> </label>
|
||||||
<div class="col-md-2 col-sm-2 ">
|
<div class="col-md-2 col-sm-2 ">
|
||||||
<div class='input-group date'>
|
<div class='input-group date'>
|
||||||
<input type='text' class="form-control" placeholder="DD-MM-YYYY" id="fromdate" name="from_date" value="<?php echo dateFormat('d-m-Y', $leave->from_date); ?>" required />
|
<input type='text' class="form-control" placeholder="DD-MM-YYYY" id="fromdate" name="from_date_new" value="<?php echo dateFormat('d-m-Y', $leave->from_date_new); ?>" required />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -162,14 +162,14 @@
|
|||||||
<label class="control-label col-md-1 col-sm-1" for="last-name">To Date<a style="color:red;">*</a> </label>
|
<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 ">
|
<div class="col-md-2 col-sm-2 ">
|
||||||
<div class='input-group date' >
|
<div class='input-group date' >
|
||||||
<input type='text' class="form-control" placeholder="DD-MM-YYYY" id="todate" name= "to_date" value="<?php echo dateFormat('d-m-Y', $leave->to_date); ?>" required />
|
<input type='text' class="form-control" placeholder="DD-MM-YYYY" id="todate" name= "to_date_new" value="<?php echo dateFormat('d-m-Y', $leave->to_date_new); ?>" required />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<label class="control-label col-md-1 col-sm-1 " for="last-name"></label>
|
<label class="control-label col-md-1 col-sm-1 " for="last-name"></label>
|
||||||
<div class="col-md-2 col-sm-2 ">
|
<div class="col-md-2 col-sm-2 ">
|
||||||
<input id="dateDifference" value="" readonly class="form-control" style="width:90px;" type="text" >
|
<input id="dateDifference" value="<?php echo $leave->no_of_days; ?>days" readonly class="form-control" style="width:90px;" type="text" >
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -179,7 +179,12 @@
|
|||||||
<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="<?php echo $leave->perm_date; ?>" id='myDatepicker'/></div>
|
<?php
|
||||||
|
// Assuming $leave->perm_date_new is in the 'Y-m-d' format
|
||||||
|
$formatted_date = date('d-m-y', strtotime($leave->perm_date_new));
|
||||||
|
?>
|
||||||
|
<input type='text' class="form-control" required name="perm_date_new" placeholder="DD-MM-YYYY" value="<?php echo $formatted_date; ?>" id='myDatepicker' />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -117,7 +117,7 @@
|
|||||||
<?php }
|
<?php }
|
||||||
else if($value->status == 'Withdraw-declined'){ ?>
|
else if($value->status == 'Withdraw-declined'){ ?>
|
||||||
<td style="color:red;"><?php echo $value->status; ?> By
|
<td style="color:red;"><?php echo $value->status; ?> By
|
||||||
<?php echo $value->declined_by; ?> <br>" <?php echo $value->DReason; ?> "</td></td>
|
<?php echo $value->DeclineBy; ?> <br>" <?php echo $value->DReason; ?> "</td></td>
|
||||||
<?php }
|
<?php }
|
||||||
else if($value->status == 'Withdraw-Approved'){ ?>
|
else if($value->status == 'Withdraw-Approved'){ ?>
|
||||||
<td style="color:green"><?php echo $value->status; ?> By
|
<td style="color:green"><?php echo $value->status; ?> By
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user