query("SELECT * FROM branch WHERE deleted_at IS NULL".$user_branch_permission_sql) ; if ( $get_branch->num_rows > 0 ){ while ( $row_branch = $get_branch->fetch_assoc() ){ $branch[$row_branch['branch_id']] = $row_branch['branch_name'] ; } } include 'HR/hr-attendance-format-2-update.php' ; include 'HR/hr-attendance-format-2-data.php' ; $boolean_role = false ; $boolean_edit = false ; if ( permissionCheck($row_user,"attendance-list-edit") ){ $boolean_role = true ; if ( $edit == 'yes' ){ $boolean_edit = true ; } } // active page $active_main_menu = 'hr' ; $active_sub_menu = 'hr-attendance' ; $active_menu = 'hr-attendance-list' ; // start header here include 'requires/page_header.php' ; include 'requires/page_top.php' ; // reset sort by type $sort_by_type = ( $sort_by_type == 'DESC' ? 'ASC' : 'DESC' ) ; // get all attendance list $array_list = [] ; $get_attendaces = $mysqli->query("SELECT list_id, list_work_day, list_ot_day, list_late, list_early_out, list_time_off, list_type_remark, staff_id, list_date, list_attendance_remark FROM staff_attendance_list WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%'") ; if ( $get_attendaces->num_rows > 0 ){ while ( $row_list = $get_attendaces->fetch_assoc() ){ $array_list[$row_list['staff_id']][$row_list['list_date']] = $row_list ; } } // get all requires $tier_list = [] ; $mysqli_tier = $mysqli->query("SELECT a.tier_id, b.title FROM profile_tier a LEFT JOIN profile_tier_translation b ON ( a.tier_id = b.tier_id ) WHERE a.deleted_at IS NULL AND b.lang = 'en' ORDER BY a.sortable ASC") ; if ( $mysqli_tier->num_rows > 0 ){ while ( $row_tier = $mysqli_tier->fetch_assoc() ){ $tier_list[] = $row_tier ; } } ?>
'.$lang['Normal Mode'].'' ; }else{ echo ''.$lang['Edit Mode'].'' ; } } ?>
placeholder="Resign List">
= date('Y-m', strtotime(TODAYDAY)) ){}else{ ?>
'.$a.'
' ; } ?> 0 ){ foreach ( $attendances as $k_staff => $v_staff ){ $date_group = $v_staff['group'] ; $staff_id = $v_staff['staff_id'] ; $staff_idno = ucwords($v_staff['staff_idno']) ; $staff_tier = $v_staff['staff_tier'] ; $departments = explode( ',', $v_staff['staff_department'] ) ; $check_permission = false ; if ( $get_user_tier['check'] ){ if ( in_array( $staff_tier, $get_user_tier['tiers'] ) ){ $check_permission = true ; } }else{ $check_permission = true ; } echo ' ' ; for ( $a = $start_day ; $a <= $day_of_month ; $a++ ){ $new_day = $date_time.'-'.str_pad($a, 2, '0', STR_PAD_LEFT) ; $list_date = $new_day ; $row_report = $array_list[$v_staff['staff_id']][$list_date] ; $report_day = 0 ; $report_min = '00:00:00' ; $report_ot = 0 ; $report_wt = '' ; $report_remark = '' ; $report_health = ( $array_health[$staff_id][$list_date] != '' ? $array_health[$staff_id][$list_date] : '' ) ; if ( $row_report != undefined && arrayCheck($row_report) ){ $report_day = ( $row_report['list_work_day'] != '00:00:00' ? $row_report['list_work_day'] : 0 ) ; $report_ot = ( $row_report['list_ot_day'] != '00:00:00' ? $row_report['list_ot_day'] : 0 ) ; $list_late = ( $row_report['list_late'] != '00:00:00' ? $row_report['list_late'] : 0 ) ; $list_early_out = ( $row_report['list_early_out'] != '00:00:00' ? $row_report['list_early_out'] : 0 ) ; if ( $row_report['list_late'] != '00:00:00' ){ $report_min = commonAddTime($row_report['list_late'], '00:00:01') ; } if ( $row_report['list_early_out'] != '00:00:00' ){ $report_min = commonAddTime($row_report['list_early_out'], $report_min) ; } if ( $row_report['list_time_off'] != '00:00:00' && $row_report['list_time_off'] != '' ){ $report_min = commonAddTime($row_report['list_time_off'], $report_min) ; } // $report_min = ( $row_report['list_late'] != '00:00:00' ? $row_report['list_late'] : '00:00' ) ; $report_wt = ( $row_report['list_type_remark'] != '' ? $row_report['list_type_remark'] : '' ) ; $report_remark = ( $row_report['list_attendance_remark'] != '' ? $row_report['list_attendance_remark'] : '' ) ; } $report_min = substr($report_min, 0, -3) ; $array_group = [] ; if ( !empty($date_group[$new_day]) ){ $get_group = $date_group[$new_day] ; foreach ( $get_group as $k_group => $v_group ){ $coordinates = '' ; if ( $v_group['latitude'] != '' && $v_group['longitude'] != '' ){ $coordinates = '' ; } $array_group[] = ( $v_group['created_at'] != $v_group['updated_at'] ? '*' : '' ) . ''.date('H:i:s', strtotime($v_group['created_at'])).'' . $coordinates ; } } echo ' ' ; } echo ' ' ; } } ?>
'.$staff_idno.'
'.implode( '
', $departments ).'
'.ucwords($v_staff['staff_positionname']).'
'; if (EXCELDETAIL == "YES"){ echo ' '; } echo '
' ; if ( $boolean_edit && $new_day <= TODAYDAY ){ if ( $check_permission ){ echo '
' ; } } echo implode('
', $array_group) ; if(arrayCheck($array_group)){ }else{ echo '--:--:--:--'; } echo '
'; if ( $boolean_edit && $new_day <= TODAYDAY ){ $list_id = $row_report['list_id'] ; echo '
Work Day :

OT Day :

Min :

Working Type :

Remark :

'.( $list_id != '' ? '' : '' ).'
'.( arrayCheck($array_group) ? '
Health :
' : '' ) ; }else{ echo '
W : '.$report_day.'
O : '.( $report_ot != 0 ? $report_ot : '-' ).'
Min : '.( $report_min != '00:00' ? numberFormat(convertMinutes($report_min)) : '-' ).'
'.' WT : '; switch ($report_wt) { case 'WD': echo 'WORK DAY'; break; case 'AL': echo 'ANNUAL LEAVE'; break; case 'UL': echo 'UNPAID LEAVE'; break; case 'MC': echo 'SICK LEAVE'; break; case 'AS': echo 'ABSENT'; break; case 'HL': echo 'HOLIDAY LIST'; break; case 'OD': echo 'OFF DAY'; break; case 'CL': echo 'COMPANY LEAVE'; break; case 'SP': echo 'SUSPEND LEAVE'; break; } echo '
RK : '.( $report_remark != '' ? $report_remark : '-' ).'
HL : '.$report_health.'
' ; } echo '