예제 #1
0
 $udlf->getDaysWorkedByTimePeriodAndUserIdAndCompanyIdAndStartDateAndEndDate('month', $filter_data['user_ids'], $current_company->getId(), $filter_data['start_date'], $filter_data['end_date']);
 if ($udlf->getRecordCount() > 0) {
     foreach ($udlf as $ud_obj) {
         //$user_days_worked[$ud_obj->getUser()]['month']
         $user_attendance_rows[$ud_obj->getUser()]['days_worked']['month'] = array('avg' => round($ud_obj->getColumn('avg'), 2), 'min' => $ud_obj->getColumn('min'), 'max' => $ud_obj->getColumn('max'));
     }
 }
 $udlf->getDaysWorkedByTimePeriodAndUserIdAndCompanyIdAndStartDateAndEndDate('week', $filter_data['user_ids'], $current_company->getId(), $filter_data['start_date'], $filter_data['end_date']);
 if ($udlf->getRecordCount() > 0) {
     foreach ($udlf as $ud_obj) {
         $user_attendance_rows[$ud_obj->getUser()]['days_worked']['week'] = array('avg' => round($ud_obj->getColumn('avg'), 2), 'min' => $ud_obj->getColumn('min'), 'max' => $ud_obj->getColumn('max'));
     }
 }
 //var_dump($user_days_worked);
 $udtlf = new UserDateTotalListFactory();
 $udtlf->getReportHoursByTimePeriodAndUserIdAndCompanyIdAndStartDateAndEndDate('day', $filter_data['user_ids'], $current_company->getId(), $filter_data['start_date'], $filter_data['end_date']);
 if ($udtlf->getRecordCount() > 0) {
     foreach ($udtlf as $udt_obj) {
         if ($udt_obj->getStatus() == 10 and $udt_obj->getType() == 20) {
             $type = 'regular';
             $policy_id = 0;
             $policy_name = 'regular';
         } elseif ($udt_obj->getStatus() == 10 and $udt_obj->getType() == 30 and $udt_obj->getOverTimePolicyId() != 0) {
             $type = 'over_time';
             $policy_id = $udt_obj->getOverTimePolicyId();
             $policy_name = $over_time_policy_arr[$udt_obj->getOverTimePolicyId()];
         } elseif ($udt_obj->getStatus() == 10 and $udt_obj->getType() == 40 and $udt_obj->getPremiumPolicyId() != 0) {
             $type = 'premium';
             $policy_id = $udt_obj->getPremiumPolicyId();
             $policy_name = $premium_policy_arr[$udt_obj->getPremiumPolicyId()];
         } elseif ($udt_obj->getStatus() == 30 and $udt_obj->getType() == 10 and $udt_obj->getAbsencePolicyId() != 0) {