</div> <div class="da-form-col-2-8 accumulated-leave-top"> <div><?php echo lang('off_accumulated'); ?> </div> <p><strong>0</strong> days</p> <p><strong>0</strong> hours</p> </div> <div class="da-form-col-2-8 off-claimed-leave-top"> <div><?php echo lang('off_claimed'); ?> </div> <p><strong><?php echo leave_days($total_leave_off_claimed, $awh); ?> </strong> days</p> <p><strong><?php echo leave_hours($total_leave_off_claimed, $awh); ?> </strong> hours</p> </div> </div> </form> <div class="grid_4"> <div class="da-panel collapsible"> <div class="da-panel-header"> <span class="da-panel-title"> <img src="<?php
public function getLeaveProfile() { if ($this->_session_info->role_id == 1 || $this->_session_info->role_id == 2) { $this->_response['code'] = -8; $this->_response['error_message'] = "Master Admin and Centre Admin Cannot Apply for Leave"; echo json_encode($this->_response); exit; } $year = date('Y'); if ($this->_session_info->role_id == 1 || $this->_session_info->role_id == 2) { $this->_response['code'] = -8; $this->_response['error_message'] = "Master Admin and Centre Admin Cannot Apply for Leave"; } else { $entitled_leaves = $this->staffapi_model->getEntitledLeaveforApi($this->_user->id, $year); $this->data['total_leave_claimed'] = $this->leave_model->getTotalLeaveTaken($this->_user->id, $year, 1, 'not'); $this->data['total_leave_off_claimed'] = $this->leave_model->getTotalLeaveTaken($this->_user->id, $year, 1); $this->data['total_leave_accumulated'] = $this->leave_model->getTotalLeaveAccumulated($this->_user->id, $year, 1, 'not'); $this->data['total_leave_off_accumulated'] = $this->leave_model->getTotalLeaveAccumulated($this->_user->id, $year, 1); $this->data['staff_leave_types'] = $this->leave_model->getLeaveTypeOfStaff($this->_user->id, $year); $total_leave_claimed = $this->data['total_leave_claimed'] + $this->data['total_leave_off_claimed']; $total_leave_accumulated = $this->data['total_leave_accumulated'] + $this->data['total_leave_off_accumulated']; $leave_left = $total_leave_accumulated - $total_leave_claimed; $hours = 0; foreach ($entitled_leaves as $leaves) { $hours += $leaves->hours; } $this->_response['entitled_leaves'] = $hours; $this->_response['leave_left'] = leave_days($leave_left) * 24; // in hours } echo json_encode($this->_response); }