commit f8f8fcaf96205985dde79ae6fe7d09b323db8071 Author: LAPTOP-V9RRD1TL\Michelle's Computer Date: Mon Jul 21 21:38:17 2025 +0800 first commit diff --git a/HR/hr-attendance-format-2-data.php b/HR/hr-attendance-format-2-data.php new file mode 100644 index 0000000..0886107 --- /dev/null +++ b/HR/hr-attendance-format-2-data.php @@ -0,0 +1,640 @@ + $v ){ + $search_department_url .= '&search_department%5B'.$k.'%5D='.$v; + } + } +} + +if ( $search_country != '' ){ + if ( $search_country == 'local' ){ + $search_query .= " AND a.country_id = '1'" ; + }else{ + $search_query .= " AND a.country_id != '1'" ; + } +} + +if ( $search_branch != '' ){ + $search_query .= " AND a.branch_id = '".$search_branch."'" ; +} + +if ( $search_resigned != '' ){ + $search_query .= " AND ( a.staff_date_resigned != '0000-00-00' and a.staff_date_resigned IS NOT NULL )" ; +}else{ + $search_query .= " AND ( a.staff_date_resigned IS NULL OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned >= '".$date_time."' )" ; +} + +if ( $search_day_from ){ + $start_day = $search_day_from; +} + +if ( $search_day_to ){ + $day_of_month = $search_day_to; +} + +$get_user_tier = userTierQuery( $row_user ) ; +// $search_query .= ( $get_user_tier['check'] ? " AND a.staff_tier IN ( ".implode(', ', $get_user_tier['tiers'])." )" : '' ) ; + + +// page query +$mysqli_query = "SELECT a.staff_id, a.staff_name, a.staff_idno, a.staff_image, a.job_position_id, a.group_id, a.staff_tier, GROUP_CONCAT( DISTINCT CONCAT(c.department_desc) ) as department_desc FROM staff a + LEFT JOIN staff_department b ON (a.staff_id = b.staff_id) + LEFT JOIN setting_department_translation c ON (b.department_id = c.department_id) + WHERE b.deleted_at IS NULL AND c.lang = 'en' AND " ; + +$mysqli_query = $mysqli_query . " a.deleted_at IS NULL " . $search_query . $user_branch_permission_sql_a . " GROUP BY a.staff_id" ; +$mysqli_page = $mysqli->query( $mysqli_query." ORDER BY (" . $sort_by . ' * 1) ' . $sort_by_type . ', ' . $sort_by . ' ' . $sort_by_type . ( $export == 'no' ? " LIMIT $start_from, " . LIMIT : "" ) ) ; + +// set search url +$search_url = 'page='.$page.'&page_mode='.$_GET['page_mode'].'&edit='.$_GET['edit'].'&date_time='.$_GET['date_time'].'&search_name='.$_GET['search_name'].'&search_idno='.$_GET['search_idno'].'&search_country='.$_GET['search_country'].'&search_branch='.$_GET['search_branch'].'&sort_by='.$_GET['sort_by'].'&sort_by_type='.$_GET['sort_by_type'].'&search_resigned='.$_GET['search_resigned'].$search_department_url."&search_day_to=".$search_day_to."&search_day_from=".$search_day_from ; + +// load pagination +if ( $export == 'no' ){ + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; +} + +// get all staff +$attendances = [] ; +$staff_list = [] ; + +if( $mysqli_page->num_rows > 0 ){ + + // loop all position + $array_position = [] ; + $mysqli_position = $mysqli->query( "SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; + + if( $mysqli_position->num_rows > 0 ){ + + $row_position = $mysqli_position->fetch_assoc() ; + $array_position[$row_position['job_position_id']] = $row_position['job_position_desc'] ; + } + + while( $row_staff = $mysqli_page->fetch_assoc() ){ + + $staff_id = $row_staff['staff_id'] ; + $attendances[$staff_id]['staff_id'] = $staff_id ; + $attendances[$staff_id]['staff_idno'] = $row_staff['staff_idno'] ; + $attendances[$staff_id]['staff_name'] = $row_staff['staff_name'] ; + $attendances[$staff_id]['staff_positionname'] = $array_position[$row_staff['job_position_id']] ; + $attendances[$staff_id]['staff_department'] = $row_staff['department_desc'] ; + $attendances[$staff_id]['staff_image'] = PATH . ( $row_staff['staff_image'] != '' ? 'uploads/Staff/'.$row_staff['staff_image'] : 'images/NoProduct.jpg' ) ; + $attendances[$staff_id]['group_id'] = $row_staff['group_id'] ; + $attendances[$staff_id]['staff_tier'] = $row_staff['staff_tier'] ; + $staff_list[] = $staff_id ; + } +} + +$array_health = [] ; +if ( count($staff_list) > 0 ){ + $mysqli_health = $mysqli->query( "SELECT staff_id, degree, request_date FROM staff_health + WHERE deleted_at IS NULL AND request_date LIKE '".$date_time."%' AND staff_id IN (".implode(',', $staff_list).")" ) ; + + if( $mysqli_health->num_rows > 0 ){ + while ( $row_health = $mysqli_health->fetch_assoc() ){ + $array_health[$row_health['staff_id']][date('Y-m-d', strtotime($row_health['request_date']))] = $row_health['degree'] ; + } + } +} + +// get all selected month attendances +$get_attendances = $mysqli->query("SELECT staff_id, record_from, code, abnormal, latitude, longitude, created_at, updated_at FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id IN (".implode(',', $staff_list).") AND created_at LIKE '".$date_time."-%' + ORDER BY created_at ASC") ; + +if ( $get_attendances->num_rows > 0 ){ + while ( $v = $get_attendances->fetch_assoc() ){ + $created_at = $v['created_at'] ; + $date_group = date('Y-m-d', strtotime($created_at)) ; + $attendances[$v['staff_id']]['group'][$date_group][] = [ + 'abnormal' => $v['abnormal'], + 'latitude' => $v['latitude'], + 'longitude' => $v['longitude'], + 'record_from' => $v['record_from'], + 'code' => $v['code'], + 'created_at' => $created_at, + 'updated_at' => $v['updated_at'] + ] ; + } +} + +$get_department = $mysqli->query("SELECT a.staff_id, b.department_desc FROM staff_department a + LEFT JOIN setting_department_translation b on ( a.department_id = b.department_id ) + WHERE b.lang = 'en' AND a.staff_id IN (".implode(',', $staff_list).") "); + +if ( $get_department->num_rows > 0 ){ + while ( $v = $get_department->fetch_assoc() ){ + + $attendances[$v['staff_id']]['department'][] = $v['department_desc']; + } +} + +// export excel +if ( $export == 'yes' ){ + include 'PhpExcel/PHPExcel.php' ; + + // get all attendance list + $array_list = [] ; + $get_attendaces = $mysqli->query("SELECT list_id, list_work_day, list_ot_day, list_late, list_amt, list_early_out, list_time_off, list_type_remark, staff_id, list_date, list_work_day, list_ot_day, list_allow_food, list_food, 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 ; + } + } + + // set excel content + $page_filename = 'Attenndance-'.date( 'Ymd', time() ) ; + $objPHPExcel = new PHPExcel() ; + $objPHPExcel->getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + $styleArrayTitle = array( + 'font' => array( + 'bold' => true , + 'color' => array( 'rgb' => '000000' ) , + 'size' => 15 + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ); + + $styleArrayDay = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayBg1 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'AFABAB') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayBg2 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'FFDA65') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArray = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayLeft = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT, + ) + ) ; + + $styleArray2 = array( + 'alignment' => array( + 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER, + ) + ) ; + + $styleArrayRed = array( + 'font' => array( + 'color' => array('rgb' => 'FF0000'), + )); + + $count = 1 ; + $firstChar = 'A' ; + // $lastChar = 'AG' ; + $lastChar = "A"; + + for ($i= $start_day; $i <= ($day_of_month) ; $i++) { + $lastChar++; + } + + // title name + $objPHPExcel->getActiveSheet()->mergeCells( $firstChar.$count.':'.$lastChar.$count ) ; + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count.':'.$lastChar.$count )->applyFromArray( $styleArrayTitle ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, 'Attendance Clock Table' ) ; + $count++ ; + + // $array_title = array( 'DD', 'DAY', 'MIN', 'AMT', 'OT', 'FOOD', 'CK', 'RK', 'HL' ) ; + $array_title = array( 'DD', 'CK' ) ; + + // loop all attendance record + if ( count($attendances) > 0 ){ + foreach ( $attendances as $k => $v ){ + + $count++ ; + $count++ ; + + $date_group = $v['group'] ; + $staff_idno = ucwords($v['staff_idno']) ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, 'US' ) ; + $firstChar2 = $firstChar ; + $firstChar2++ ; + + $mc1 = $firstChar2.$count; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, 'ID: '.$staff_idno.' Name: '.$v['staff_name'].' Department: '.implode(",", $v['department'])) ; + $mc2 = $lastChar.$count ; + $objPHPExcel->getActiveSheet()->mergeCells($mc1.':'.$mc2) ; + $objPHPExcel->getActiveSheet()->getStyle($mc1.':'.$mc2)->applyFromArray( $styleArrayLeft ) ; + $count++ ; + + $count2 = $count ; + + + + for ($row = 6; $row <= 10; $row++) { + $objPHPExcel->getActiveSheet()->getStyle('AG' . $row)->applyFromArray($styleArray); + $objPHPExcel->getActiveSheet(0)->setCellValue('AG' . $row, '=SUM(B' . $row . ':AF' . $row . ')'); + } + + + + if( arrayCheck( $array_title ) ){ + foreach( $array_title as $key_title => $value_title ){ + $objPHPExcel->getActiveSheet()->getStyle($firstChar.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, $value_title ) ; + $firstChar2 = $firstChar ; + $firstChar2++ ; + + $total_day = 0 ; + $total_ot = 0 ; + $total_min = 0 ; + $total_amt = 0 ; + $total_fb = 0 ; + + for( $i = $start_day ; $i <= $day_of_month ; $i++ ){ + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + + // default parameter ; + $report_day = 0 ; + $report_min = '00:00:00' ; + $report_ot = 0 ; + $report_amt = 0 ; + $report_fb = 0 ; + $list_late = 0 ; + $list_early_out = 0 ; + $report_wt = '' ; + $list_type_remark = '' ; + $report_remark = '' ; + $report_health = '' ; + $report_allow_food = '' ; + $new_day = $date_time.'-'.str_pad($i, 2, '0', STR_PAD_LEFT) ; + $apply_color = [] ; + + // get attendance list report + $list_date = $new_day ; + $row_report = $array_list[$v['staff_id']][$list_date] ; + + if ( $row_report != undefined && arrayCheck($row_report) ){ + + $report_day = ( $row_report['list_work_day'] != '' ? $row_report['list_work_day'] : 0 ) ; + $report_ot = ( $row_report['list_ot_day'] != '' ? $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 ) ; + $list_type_remark = $row_report['list_type_remark'] ; + $report_remark = $row_report['list_attendance_remark']; + $report_health = ( $array_health[$v['staff_id']][$list_date] != '' ? $array_health[$v['staff_id']][$list_date] : '-'); + + // $report_min = ( $row_report['list_late'] != '00:00:00' ? substr($row_report['list_late'], 0, -3) : '00:00' ) ; + $report_amt = ( $row_report['list_amt'] != '' ? $row_report['list_amt'] : 0 ) ; + $report_fb = ( $row_report['list_allow_food'] == 'yes' ? $row_report['list_food'] : 0 ) ; + $report_allow_food = ( $row_report['list_allow_food'] == 'yes' ? '1' : '' ) ; + + 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 = substr($report_min, 0, -3) ; + + // 'DD', 'DAY', 'MIN', 'AMT', 'OT', 'CK', 'HL' + $content = '' ; + $show_decimal = true ; + + switch ( $value_title ){ + case 'DD' : + $content = $i ; + $show_decimal = false ; + break ; + + case 'DAY' : + $content = $report_day ; + $total_day += $report_day ; + break ; + + case 'MIN' : + $content = ( $report_min != '00:00' ? numberFormat(convertMinutes($report_min)) : '' ) ; + $total_min += numberFormat(convertMinutes($report_min)) ; + break ; + + case 'AMT' : + $content = ( $report_amt > 0 ? $report_amt : '' ) ; + $total_amt += $report_amt ; + break ; + + case 'OT' : + $content = ( $report_ot > 0 ? $report_ot : '' ) ; + $total_ot += $report_ot ; + break ; + + case 'FOOD' : + $content = ( $report_allow_food ) ; + // $total_fb += $report_fb ; + break ; + + case 'CK' : + $boolean_abnormal = false ; + $show_decimal = false ; + $array_group = [] ; + + if ( !empty($date_group[$new_day]) ){ + + $get_group = $date_group[$new_day] ; + + foreach( $get_group as $k_group => $v_group ){ + $array_group[] = date('H:i', strtotime($v_group['created_at'])) ; + + if ( $v_group['abnormal'] == 'yes' ){ + $boolean_abnormal = true ; + } + } + } + + $style_red = array('fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => 'FF0000'))); + $style_yellow = array('fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => 'FFFF00'))); + $style_green = array('fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => '00FF00'))); + $style_blue = array('fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => '0000FF'))); + $style_orange = array('fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => 'FF8000'))); + $style_purple = array('fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => 'C000FF'))); + + $apply_text = '' ; + $objRichText = new PHPExcel_RichText(); + + switch( $list_type_remark ){ + case 'OD' : // OFF DAY + $apply_text = 'OFF DAY' ; + $apply_color = $style_green ; + break ; + + case 'MC' : // SICK LEAVE + $apply_text = 'SICK LEAVE' ; + $apply_color = $style_yellow; ; + break ; + + case 'UL' : // UNPAID LEAVE + $apply_text = 'UNPAID LEAVE'; ; + $apply_color = $style_red ; + break ; + + case 'AL' : // ANNUAL LEAVE + $apply_text = 'ANNUAL LEAVE' ; + $apply_color = $style_blue ; + break ; + + case 'AS' : // ABSENT + $apply_text = 'ABSENT' ; + $apply_color = $style_orange ; + break ; + + case 'HL' : // HOLIDAY LIST + $apply_text = 'HOLIDAY LIST' ; + // $apply_color = $style_orange ; + break ; + + case 'CL' : // COMPANY LEAVE + $apply_text = 'COMPANY LEAVE' ; + // $apply_color = $style_orange ; + break ; + + case 'SP' : // SUSPEND LEAVE + $apply_text = 'SUSPEND LEAVE' ; + // $apply_color = $style_orange ; + break ; + + default : + if ( $boolean_abnormal ){ + $apply_color = $style_purple ; + } + } + + $content = implode("\n", $array_group) . ( $apply_text != '' ? "\n".$apply_text : '' ) ; + break ; + + case "RK": + $content = $report_remark ; + break; + + case "HL": + $content = $report_health ; + break; + } + + if ( $show_decimal ){ + + $objPHPExcel->setActiveSheetIndex(0)->getStyle( $firstChar2.$count )->getNumberFormat()->setFormatCode('#,##0.00') ; + } + + ################################################################## add color ################################################################## + + if($value_title == 'CK'){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $content ) ; + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->getAlignment()->setWrapText(true); + + if(ALLOWCOLOREXCEL == "YES" && arrayCheck($apply_color)){ + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray($apply_color); + } + }else{ + + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $content ) ; + } + + ################################################################## add color ################################################################## + + $firstChar2++ ; + + // if after day 31, add total + if ( $i == $search_day_to ){ + + $last_content = '' ; + + switch ( $value_title ){ + case 'DD' : + $last_content = 'TOTAL' ; + break ; + + case 'DAY' : + $last_content = $total_day ; + break ; + + case 'MIN' : + $last_content = $total_min ; + break; + + case 'AMT' : + $last_content = $total_amt ; + break ; + + case 'OT' : + $last_content = $total_ot ; + break ; + + case 'CK' : + break ; + } + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $last_content ) ; + $firstChar2++ ; + } + } + + $count++ ; + } + } + } + } + + // Submission from + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xlsx"' ) ; + header( 'Cache-Control: max-age=0' ) ; + + // save to pc + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; +} + +?> \ No newline at end of file diff --git a/HR/hr-attendance-format-2-update.php b/HR/hr-attendance-format-2-update.php new file mode 100644 index 0000000..985c7f8 --- /dev/null +++ b/HR/hr-attendance-format-2-update.php @@ -0,0 +1,237 @@ +Out must be greater than in.' ; + + // get previous check group + $previous_group = date('Y-m-d', strtotime($check_group.' -1 days')) ; + + // default parameter + $attendance_id_0 = escapeString($_POST['attendance_id_0']) ; + $attendance_time_0 = escapeString($_POST['attendance_time_0']) ; + $attendance_remark_0 = escapeString($_POST['attendance_remark_0']) ; + $new_in_out_0 = ( $attendance_time_0 != '' ? ( escapeString($_POST['attendance_date_0']) . ' ' . $attendance_time_0 ) : '' ) ; + + $attendance_id_1 = escapeString($_POST['attendance_id_1']) ; + $attendance_time_1 = escapeString($_POST['attendance_time_1']) ; + $attendance_remark_1 = escapeString($_POST['attendance_remark_1']) ; + $new_in_out_1 = ( $attendance_time_1 != '' ? ( escapeString($_POST['attendance_date_1']) . ' ' . $attendance_time_1 ) : '' ) ; + + $attendance_id_2 = escapeString($_POST['attendance_id_2']) ; + $attendance_time_2 = escapeString($_POST['attendance_time_2']) ; + $attendance_remark_2 = escapeString($_POST['attendance_remark_2']) ; + $new_in_out_2 = ( $attendance_time_2 != '' ? ( escapeString($_POST['attendance_date_2']) . ' ' . $attendance_time_2 ) : '' ) ; + + $attendance_id_3 = escapeString($_POST['attendance_id_3']) ; + $attendance_time_3 = escapeString($_POST['attendance_time_3']) ; + $attendance_remark_3 = escapeString($_POST['attendance_remark_3']) ; + $new_in_out_3 = ( $attendance_time_3 != '' ? ( escapeString($_POST['attendance_date_3']) . ' ' . $attendance_time_3 ) : '' ) ; + + $attendance_id_4 = escapeString($_POST['attendance_id_4']) ; + $attendance_time_4 = escapeString($_POST['attendance_time_4']) ; + $attendance_remark_4 = escapeString($_POST['attendance_remark_4']) ; + $new_in_out_4 = ( $attendance_time_4 != '' ? ( escapeString($_POST['attendance_date_4']) . ' ' . $attendance_time_4 ) : '' ) ; + + $attendance_id_5 = escapeString($_POST['attendance_id_5']) ; + $attendance_time_5 = escapeString($_POST['attendance_time_5']) ; + $attendance_remark_5 = escapeString($_POST['attendance_remark_5']) ; + $new_in_out_5 = ( $attendance_time_5 != '' ? ( escapeString($_POST['attendance_date_5']) . ' ' . $attendance_time_5 ) : '' ) ; + + $attendance_id_6 = escapeString($_POST['attendance_id_6']) ; + $attendance_time_6 = escapeString($_POST['attendance_time_6']) ; + $attendance_remark_6 = escapeString($_POST['attendance_remark_6']) ; + $new_in_out_6 = ( $attendance_time_6 != '' ? ( escapeString($_POST['attendance_date_6']) . ' ' . $attendance_time_6 ) : '' ) ; + + $attendance_id_7 = escapeString($_POST['attendance_id_7']) ; + $attendance_time_7 = escapeString($_POST['attendance_time_7']) ; + $attendance_remark_7 = escapeString($_POST['attendance_remark_7']) ; + $new_in_out_7 = ( $attendance_time_7 != '' ? ( escapeString($_POST['attendance_date_7']) . ' ' . $attendance_time_7 ) : '' ) ; + + // check out must be greater than in + $boolean_check = false ; + if ( $attendance_time_0 != '' && $attendance_time_1 != '' ){ + if ( $attendance_time_1 >= $attendance_time_0 ){ }else{ $boolean_check = true ; } + } + if ( $attendance_time_1 != '' && $attendance_time_2 != '' ){ + if ( $attendance_time_2 >= $attendance_time_1 ){ }else{ $boolean_check = true ; } + } + if ( $attendance_time_2 != '' && $attendance_time_3 != '' ){ + if ( $attendance_time_3 >= $attendance_time_2 ){ }else{ $boolean_check = true ; } + } + if ( $attendance_time_3 != '' && $attendance_time_4 != '' ){ + if ( $attendance_time_4 >= $attendance_time_3 ){ }else{ $boolean_check = true ; } + } + if ( $attendance_time_4 != '' && $attendance_time_5 != '' ){ + if ( $attendance_time_5 >= $attendance_time_4 ){ }else{ $boolean_check = true ; } + } + if ( $attendance_time_5 != '' && $attendance_time_6 != '' ){ + if ( $attendance_time_6 >= $attendance_time_5 ){ }else{ $boolean_check = true ; } + } + if ( $attendance_time_6 != '' && $attendance_time_7 != '' ){ + if ( $attendance_time_7 >= $attendance_time_6 ){ }else{ $boolean_check = true ; } + } + + // if false then allow to access + if ( !$boolean_check ){ + + $error_message = '
Record failed to updated.
' ; + + // start commit + $error = 0 ; + $mysqli->autocommit( false ) ; + + // insert or update attendance + for ( $a = 0 ; $a < 8 ; $a++ ){ + + $attendance_id = '' ; + $remark = '' ; + $new_in_out = '' ; + + switch ( $a ){ + case '0' : + $attendance_id = $attendance_id_0 ; + $remark = $attendance_remark_0 ; + $new_in_out = $new_in_out_0 ; + break ; + case '1' : + $attendance_id = $attendance_id_1 ; + $remark = $attendance_remark_1 ; + $new_in_out = $new_in_out_1 ; + break ; + case '2' : + $attendance_id = $attendance_id_2 ; + $remark = $attendance_remark_2 ; + $new_in_out = $new_in_out_2 ; + break ; + case '3' : + $attendance_id = $attendance_id_3 ; + $remark = $attendance_remark_3 ; + $new_in_out = $new_in_out_3 ; + break ; + case '4' : + $attendance_id = $attendance_id_4 ; + $remark = $attendance_remark_4 ; + $new_in_out = $new_in_out_4 ; + break ; + case '5' : + $attendance_id = $attendance_id_5 ; + $remark = $attendance_remark_5 ; + $new_in_out = $new_in_out_5 ; + break ; + case '6' : + $attendance_id = $attendance_id_6 ; + $remark = $attendance_remark_6 ; + $new_in_out = $new_in_out_6 ; + break ; + case '7' : + $attendance_id = $attendance_id_7 ; + $remark = $attendance_remark_7 ; + $new_in_out = $new_in_out_7 ; + break ; + } + + if ( $new_in_out != '' ){ + + if ( $attendance_id == '0' ){ + // add attendance + if ( $mysqli->query("INSERT INTO staff_attendance + (staff_id, check_group, type, code, record_from, mac_address, ip_address, latitude, longitude, check_area, remark, created_at, updated_at) VALUES + ('".$staff_id."', '".$check_group."', '".$attendance_type."', '', 'manual', '', '', '', '', 'in', '".$remark."', '".$new_in_out."', '".TODAYDATE."')") ){ }else{ + $error++ ; + } + }else{ + + // update attendance + $attendance_q = $mysqli->query("SELECT * FROM staff_attendance + WHERE deleted_at IS NULL AND attendance_id = '".$attendance_id."' LIMIT 1") ; + if ( $attendance_q->num_rows > 0 ){ + $attendance = $attendance_q->fetch_assoc() ; + $query_date = '' ; + if ( $attendance['created_at'] != $new_in_out ){ + $query_date .= "created_at = '".$new_in_out."'," ; + } + // update attendance + if ( $mysqli->query("UPDATE staff_attendance SET + ".$query_date." + remark = '".$remark."', + updated_at = '".TODAYDATE."' + WHERE attendance_id = '".$attendance_id."'") ){ }else{ + $error++ ; + } + } + + } + }else{ + + if ( $attendance_id != '0' ){ + + // update attendance + $attendance_q = $mysqli->query("SELECT * FROM staff_attendance + WHERE deleted_at IS NULL AND attendance_id = '".$attendance_id."' LIMIT 1") ; + if ( $attendance_q->num_rows > 0 ){ + $attendance = $attendance_q->fetch_assoc() ; + + // delete attendance list + if ( $mysqli->query("UPDATE staff_attendance SET + deleted_at = '".TODAYDATE."' + WHERE attendance_id = '".$attendance_id."'") ){ }else{ + $error++ ; + } + } + } + } + } + + // remove attendance list, direct remove 2 days, yesterday and today + /* + $array_group = [ $previous_group, $check_group ] ; + foreach ( $array_group as $k => $v ){ + $get_list_q = $mysqli->query("SELECT list_id FROM staff_attendance_list + WHERE staff_id = '".$staff_id."' AND list_date = '".$v."' AND deleted_at IS NULL LIMIT 1") ; + if ( $get_list_q->num_rows > 0 ){ + // delete attendance list + $get_list = $get_list_q->fetch_assoc() ; + $list_id = $get_list['list_id'] ; + if ( $mysqli->query("UPDATE staff_attendance_list SET + deleted_at = '".TODAYDATE."' + WHERE list_id = '".$list_id."'") ){ + + // delete the merge record + if ( $mysqli->query("UPDATE staff_attendance SET + list_id = '0' + WHERE list_id = '".$list_id."'") ){ }else{ + $error++ ; + } + + }else{ + $error++ ; + } + } + } + */ + + if( $error == 0 ) { + + // commit query + $mysqli->commit() ; + $error_message = '
Thank you, your attendance record success to updated.
' ; + + }else{ + $mysqli->rollback() ; + } + + } + + // refresh page + header("Refresh: 0") ; + $_SESSION['system_result'] = $error_message ; + exit ; + +} + +?> \ No newline at end of file diff --git a/HR/hr-local-edit-interview-det.php b/HR/hr-local-edit-interview-det.php new file mode 100644 index 0000000..28d7965 --- /dev/null +++ b/HR/hr-local-edit-interview-det.php @@ -0,0 +1,739 @@ + array( + 'q1' => $int_det_q1, + 'q2' => $int_det_q2, + 'q3' => $int_det_q3, + 'q4' => $int_det_q4, + 'q5' => $int_det_q5, + 'q6' => $int_det_q6, + 'q7' => $int_det_q7, + 'q8' => $int_det_q8, + 'q9' => $int_det_q9, + 'q10' => $int_det_q10, + 'q11' => $int_det_q11, + 'q12' => $int_det_q12, + 'q13' => $int_det_q13, + 'q14' => $int_det_q14, + 'q15' => $int_det_q15, + 'q16' => $int_det_q16), + + 'interviewer' => array( + 'name' => $int_det_interviewer, + 'int_date' => $int_det_int_date, + 'int_position' => $int_det_int_pos, + 'sign' => $int_det_sign, + 'sign_date' => $int_det_sign_date), + + 'verifier' => array( + 'verify_name' => $int_det_verifier , + 'verify_position' => $int_det_verifier_pos, + 'verify_sign' => $int_det_sign_verify, + 'verify_sign_date' => $int_det_sign_verify_date), + + 'approver' => array( + 'approve_name' => $int_det_approver, + 'approve_position' => $int_det_approver_pos, + 'approve_sign' => $int_det_sign_approve, + 'approve_sign_date' => $int_det_sign_approve_date), + + 'status' => $int_det_status + ) ; + $array_int_det = jsonEncodeDecode('encode', $array_int_det) ; + + // print_r($array_int_det);exit; + + $old_record = ''; + $mysqli_record = $mysqli->query("select employment_interview_details from staff_employment where employment_id = '".$page."' limit 1"); + if ($mysqli_record->num_rows > 0 ){ + $old_record = $mysqli_record->fetch_array(MYSQLI_ASSOC)['employment_interview_details']; + }else{ + $old_record = '-'; + } + + $record = array( + "old_record" => $old_record, + "new_record" => $array_int_det, + ); + $record = jsonEncodeDecode('encode', $record) ; + + + if($mysqli->query("UPDATE staff_employment SET employment_interview_details = '".$array_int_det."' WHERE employment_id = '".$page."'")){ + + $descrition = $_SESSION['system_name'].'(username) update the employment interview details'; + + $mysqli->query("INSERT INTO system_log_employment (log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ('employment', 'update-interview_det', '200', 'AF-".$page."', '".$_SESSION["system_id"]."', '".$descrition."', '".$record."', NOW())"); + } + + + // refresh page + header("Location:?page_mode=edit_interview_det&page=".$page."&success=1&select_worker=Local") ; + exit ; + +} + +// start header here +include 'requires/page_header.php' ; + +if ( $hide_title == false ){ + include 'requires/page_top.php' ; +} + +$user_profile = jsonEncodeDecode('decode', $row_page['employment_file']) ; +$int_det_content = jsonEncodeDecode('decode', $row_page['employment_interview_details']) ; +$int_det_question_con = $int_det_content['question']; +$int_det_interviewer_con = $int_det_content['interviewer']; +$int_det_verifier_con = $int_det_content['verifier']; +$int_det_approver_con = $int_det_content['approver']; +$int_det_status_con = $int_det_content['status']; + +if ( $hide_title == true && $_GET['success'] == '1' ){ + echo ' + ' ; +} +?> + +
+
+
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
 
Picture: +  
 
Name: 
 
Designation: + query($mysqli_query) ; + if ($mysqli_position->num_rows > 0){ + while($row_position = $mysqli_position->fetch_array(MYSQLI_ASSOC)){ + echo $row_position['job_position_desc']; + } + } + ?> + +  
 
Department: + query($mysqli_query) ; + if ($mysqli_department->num_rows > 0){ + while($row_department = $mysqli_department->fetch_array(MYSQLI_ASSOC)){ + echo $row_department['department_desc']; + } + } + ?> + +  
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Attritube:
1. Appearance (professional dress, grooming) + + + + + + + +
2. Poise, self-confidence, 1st impression + + + + + + + +
3. Verbal communication skills (articulate, clear) + + + + + + + +
4. Listening ability and non-verbal communication + + + + + + + +
5. Clarity of career interests and goals + + + + + + + +
6. Ability to link prior work experience to position + + + + + + + +
7. Knowledge of industry + + + + + + + +
8. Preparation for interview + + + + + + + +
9. Quality of questions + + + + + + + +
10. Interest in & enthusiasm toward opportunity + + + + + + + +
11. Strength of competence / skills for position / work + + + + + + + +
12. Overall impression of candidate’s performance + + + + + + + +
13. Recommended pay + +
14. Probationary Period months + + + + + +
15. Result + + + + + +
16. Recommendations / high lights of the interview + +
+
+
 
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Form Status: + +  
: 
: + query($mysqli_query) ; + if ($mysqli_user->num_rows > 0){ + echo ' + ' ; + } + ?> +   
: 
+
 
 
+ + + + + + + + + + + +
 
 
+
 
 
+ + + + + + + + + + + + + + +
: + query($mysqli_query) ; + if ($mysqli_user->num_rows > 0){ + echo ' + ' ; + } + ?> +   
: 
+
 
 
+ + + + + + + + + + + +
 
 
+
 
 
+ + + + + + + + + + + + + + +
: + query($mysqli_query) ; + if ($mysqli_user->num_rows > 0){ + echo ' + ' ; + } + ?> +   
: 
+
 
 
+ + + + + + + + + + + +
 
 
+
 
 
+
+
+
+
Click To Sign Here
+
+ +
+ + '; + }else if ($int_det_status_con == 'Verify') { + echo ' + '; + }else if ($int_det_status_con == 'Approve') { + echo ' + '; + } + ?> + +
+
+
 
+
 
+
+
 
 
+ '.$lang['submit'].' + + + + '; + } + ?> +
 
 
+
+ + +
+
+
+
+
diff --git a/HR/hr-local-edit-status.php b/HR/hr-local-edit-status.php new file mode 100644 index 0000000..827d575 --- /dev/null +++ b/HR/hr-local-edit-status.php @@ -0,0 +1,498 @@ +query("UPDATE staff_employment SET employment_status = '".$employment_status_change."', employment_incharge_staff_id = '".$employment_incharge_staff_id."' WHERE employment_id = '".$page."'")){ + $descrition = $_SESSION['system_name'].'(username) update status to Processing and waiting manager to confirm or reject.' ; + $mysqli->query("INSERT INTO system_log_employment (log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ('employment', 'update-status', '200', 'AF-".$page."', '".$_SESSION["system_id"]."', '".$descrition."', '".$record."', NOW())"); + + if ( $row_page['employment_incharge_staff_id'] != $employment_incharge_staff_id ){ + pushToUserCron( 'staff_employment', $page, $employment_incharge_staff_id, 'Recruitment', 'New hires ( '.$row_page['employment_name'].' ) need your confirmation or rejection' ) ; + } + } + } + + }elseif( $employment_status_change == 'Interview' && ($_POST['employment_interview_date'] != '' || $_POST['email_to_cand_adm'] != '' )){ + + $employment_interview_date = escapeString($_POST['employment_interview_date']) ; + $employment_email_to_cand_adm = escapeString($_POST['email_to_cand_adm']) ; + + if( $employment_interview_date !='' && $employment_email_to_cand_adm != '' ){ + $query_email = "employment_interview_email = '".$employment_email_to_cand_adm."', "; + } + + if($mysqli->query("UPDATE staff_employment SET ".$query_email." employment_status = '".$employment_status_change."', employment_interview_date = '".$employment_interview_date."' WHERE employment_id = '".$page."'")){ + $descrition = $_SESSION['system_name'].'(username) update status to Interview and update the interview details. ' ; + if ($query_email != '') { + $descrition .= 'Interview emails is sent ('.TODAYDATE.')'; + } + $mysqli->query("INSERT INTO system_log_employment (log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ('employment', 'update-status', '200', 'AF-".$page."', '".$_SESSION["system_id"]."', '".$descrition."', '".$record."', NOW())"); + } + + }elseif( $employment_status_change == 'Reschedule' && ($_POST['employment_r_interview_date'] != '' || $_POST['r_email_to_cand_adm'] != '' )){ + + $employment_r_interview_date = escapeString($_POST['employment_r_interview_date']) ; + $employment_r_email_to_cand_adm = escapeString($_POST['r_email_to_cand_adm']) ; + $employment_r_update_interview = escapeString($_POST['r_update_interview']); + + if( $employment_r_interview_date !='' && $employment_r_email_to_cand_adm !=''){ + $query_r_email = "employment_r_interview_email = '".$employment_r_email_to_cand_adm."', "; + } + + if($employment_r_update_interview == '' ){ + if($mysqli->query("UPDATE staff_employment SET ".$query_r_email." employment_status = '".$employment_status_change."', employment_r_interview_date = '".$employment_r_interview_date."' WHERE employment_id = '".$page."'")){ + $descrition = $_SESSION['system_name'].'(username) update status to Reschedule and update the reschedule details. ' ; + if ($query_r_email != '') { + $descrition .= 'Reschedule emails is sent ('.TODAYDATE.')'; + } + $mysqli->query("INSERT INTO system_log_employment (log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ('employment', 'update-status', '200', 'AF-".$page."', '".$_SESSION["system_id"]."', '".$descrition."', '".$record."', NOW())"); + } + }elseif($employment_r_update_interview !=''){ + + if($mysqli->query("UPDATE staff_employment SET ".$query_r_email." employment_status = 'Interview', employment_interview_date = '".$employment_r_interview_date."', employment_r_interview_date = '0000-00-00 00:00:00', employment_r_candidate = '' WHERE employment_id = '".$page."'")){ + $descrition = $_SESSION['system_name'].'(username) update status to Interview and update the interview details. ' ; + if ($query_r_email != '') { + $descrition .= 'Reschedule emails is sent ('.TODAYDATE.')'; + } + $mysqli->query("INSERT INTO system_log_employment (log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ('employment', 'update-status', '200', 'AF-".$page."', '".$_SESSION["system_id"]."', '".$descrition."', '".$record."', NOW())"); + } + } + + }else{ + + $temp_employment_tier = [] ; + foreach ( $_POST['employment_tier'] as $kemploymenttier => $vemploymenttier ){ + $temp_employment_tier[] = escapeString($vemploymenttier) ; + } + $employment_tier = implode(',', $temp_employment_tier) ; + + if($mysqli->query( "UPDATE staff_employment SET + employment_status = '".$employment_status_change."', + employment_tier = '".$employment_tier."' + WHERE employment_id = '".$page."'" )){ + $descrition = $_SESSION['system_name'].'(username) update the employment status to '.$employment_status_change ; + $mysqli->query("INSERT INTO system_log_employment (log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ('employment', 'update-status', '200', 'AF-".$page."', '".$_SESSION["system_id"]."', '".$descrition."', '".$record."', NOW())"); + } + } + + if($_POST['employment_interview_date'] != '' && $_POST['email_to_cand_adm'] != ''){ + + $extra_itv_link = ''; + if ($_POST['email_itv_hod'] == 1 && $_POST['email_itv_to_hod'] != '') { + $email_itv_to_hod = base64_encode($_POST['email_itv_to_hod']); + $extra_itv_link .= '&hod='.$email_itv_to_hod; + } + + if ($_POST['email_itv_attach'] == 1) { + $email_itv_attach = base64_encode($row_page['employment_resume']); + $extra_itv_link .= '&attach='.$email_itv_attach; + } + + header("Location:?page_mode=sent_email&mail_type=interview".$extra_itv_link."&page=".$page); + exit; + }else if($_POST['employment_r_interview_date'] != '' && $_POST['r_email_to_cand_adm'] != ''){ + $extra_rsd_link = ''; + if ($_POST['email_rsd_hod'] == 1 && $_POST['email_rsd_to_hod'] != '') { + $email_rsd_to_hod = base64_encode($_POST['email_rsd_to_hod']); + $extra_rsd_link .= '&hod='.$email_rsd_to_hod; + } + + if ($_POST['email_rsd_attach'] == 1) { + $email_rsd_attach = base64_encode($row_page['employment_resume']); + $extra_rsd_link .= '&attach='.$email_rsd_attach; + } + + header("Location:?page_mode=sent_email&mail_type=reschedule".$extra_rsd_link."&page=".$page); + exit; + }else if( $_POST['employment_status_change'] == 'Reject' && $_POST['employment_status_change'] != $row_page['employment_status'] ){ + $extra_rsd_link = ''; + header("Location:?page_mode=sent_email&mail_type=reject".$extra_rsd_link."&page=".$page) ; + exit; + } + + // refresh page + header("Location:?page_mode=edit_status&page=".$page."&success=1&select_worker=Local") ; + exit ; + +} + +// start header here +include 'requires/page_header.php' ; + +if ( $hide_title == false ){ + include 'requires/page_top.php' ; +} + +$user_profile = jsonEncodeDecode('decode', $row_page['employment_file']) ; + +if ( $hide_title == true && $_GET['success'] == '1' ){ + echo ' + ' ; +} +?> + +
+
+
+
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
 
Picture: +  
 
Name: 
 
Designation: + query($mysqli_query) ; + if ($mysqli_position->num_rows > 0){ + while($row_position = $mysqli_position->fetch_array(MYSQLI_ASSOC)){ + echo $row_position['job_position_desc']; + } + } + ?> + +  
 
Department: + query($mysqli_query) ; + if ($mysqli_department->num_rows > 0){ + while($row_department = $mysqli_department->fetch_array(MYSQLI_ASSOC)){ + echo $row_department['department_desc']; + } + } + ?> + +  
 
Branch: + query($mysqli_query) ; + if ($mysqli_branch->num_rows > 0){ + while($row_branch = $mysqli_branch->fetch_array(MYSQLI_ASSOC)){ + echo $row_branch['branch_name']; + } + } + ?> +  
 
Sex: 
 
Race: 
 
Nationality: 
 
Mobile Phone: 
 
Status: + +  
 
: + +  
 
Manager: + +  
 
Interview Date: 
 
+ +
 
+ +
 
+ +
 
Original Interview Date: 
 
Rescheduled Interview Date: 
 
Send Rescheduled Emails to Candidate and Admin (Reschedule emails had sent before)' : '') ?>
 
Send Email To Others:
 
Attached Candidate\'s Resume
 
Confirm and update status back to Interview
 
 
 
+ '.$lang['submit'].' + + + + '; + } + ?> +
 
 
+
+ + + + + + + + + + query($mysqli_query) ; + if ($mysqli_log->num_rows > 0){ + $count_row_log = $mysqli_log->num_rows ; + while( $row_log = $mysqli_log->fetch_array(MYSQLI_ASSOC) ){ + + echo ' + + + + + ' ; + + $count_row_log-- ; + } + } + + + ?> +
Log
 
No.ActionDate
'.$count_row_log.''.$row_log['log_description'].''.$row_log['log_date'].'
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/HR/hr-local-edit.php b/HR/hr-local-edit.php new file mode 100644 index 0000000..da0f088 --- /dev/null +++ b/HR/hr-local-edit.php @@ -0,0 +1,2357 @@ + !empty($_POST['family_member_name'][$i]) ? $_POST['family_member_name'][$i] : '', + 'age' => !empty($_POST['family_member_age'][$i]) ? $_POST['family_member_age'][$i] : '', + 'occupation' => !empty($_POST['family_member_occupation'][$i]) ? $_POST['family_member_occupation'][$i] : '', + 'relationship' => !empty($_POST['family_member_relationship'][$i]) ? $_POST['family_member_relationship'][$i] : '', + 'company' => !empty($_POST['family_member_company'][$i]) ? $_POST['family_member_company'][$i] : '' + ); + } + + // education background + $array_education_level = array(); + for ($i = 0; $i < 5; $i++) { + $array_education_level[] = array( + 'schoolName' => !empty($_POST['education_name_school'][$i]) ? $_POST['education_name_school'][$i] : '', + 'startYear' => !empty($_POST['education_start_year'][$i]) ? $_POST['education_start_year'][$i] : '', + 'finishYear' => !empty($_POST['education_finish_year'][$i]) ? $_POST['education_finish_year'][$i] : '', + 'grade' => !empty($_POST['education_grade'][$i]) ? $_POST['education_grade'][$i] : '', + 'qualification' => !empty($_POST['education_qualification'][$i]) ? $_POST['education_qualification'][$i] : '' + ); + } + + // professional qualification + $array_professional_qualification = array(); + for ($i = 0; $i < 5; $i++) { + $array_professional_qualification[] = array( + 'qualification' => !empty($_POST['professional_qualification'][$i]) ? $_POST['professional_qualification'][$i] : '', + 'accredited' => !empty($_POST['professional_accredited_by'][$i]) ? $_POST['professional_accredited_by'][$i] : '', + 'startYear' => !empty($_POST['professional_qualification_start_year'][$i]) ? $_POST['professional_qualification_start_year'][$i] : '', + 'finishYear' => !empty($_POST['professional_qualification_finish_year'][$i]) ? $_POST['professional_qualification_finish_year'][$i] : '', + ); + } + + // language proficiency + $spoken_english = $_POST['spoken_english']; + $written_english = $_POST['written_english']; + $spoken_mandarin = $_POST['spoken_mandarin']; + $written_mandarin = $_POST['written_mandarin']; + $spoken_bm = $_POST['spoken_bm']; + $written_bm = $_POST['written_bm']; + $language_other_1=$_POST['language_other_1']; + $spoken_other1 = $_POST['spoken_other1']; + $written_other1 = $_POST['written_other1']; + $language_other_2 = $_POST['language_other_2']; + $spoken_other2 = $_POST['spoken_other2']; + $written_other2 = $_POST['written_other2']; + + + //REFERENCE DETAIL + $array_reference = array(); + for ($i = 0; $i < 2; $i++) { + $array_reference[] = array( + 'name' => !empty($_POST['references_name'][$i]) ? $_POST['references_name'][$i] : '', + 'position' => !empty($_POST['references_position'][$i]) ? $_POST['references_position'][$i] : '', + 'contact' => !empty($_POST['references_contacts'][$i]) ? $_POST['references_contacts'][$i] : '', + 'year' => !empty($_POST['references_years'][$i]) ? $_POST['references_years'][$i] : '', + ); + } + + //employment history + $currentCompanyName = $_POST['current_company_name']; + $currentCompanyPosition = $_POST['current_position_name']; + $currentCompanyAddress = $_POST['current_company_full_address']; + $currentCompanyJoinDate = $_POST['current_company_join_date']; + $currentCompanyLeftDate = $_POST['current_company_left_date']; + $currentCompanySalary = $_POST['current_company_basic_salary']; + $currentCompanyAllowance = $_POST['current_company_fix_allowance']; + $currentCompanyReason = $_POST['current_company_leave_reason']; + + + //subsequent employment history + $array_subsequent_employment = array() ; + for ($i = 0; $i < 3; $i++) { + $array_subsequent_employment[] = array( + 'name' => !empty($_POST['subsequent_company_name'][$i]) ? $_POST['subsequent_company_name'][$i] : '', + 'position' => !empty($_POST['subsequent_position_name'][$i]) ? $_POST['subsequent_position_name'][$i] : '', + 'joinDate' => !empty($_POST['subsequent_company_join_date'][$i]) ? $_POST['subsequent_company_join_date'][$i] : '', + 'leftDate' => !empty($_POST['subsequent_company_left_date'][$i]) ? $_POST['subsequent_company_left_date'][$i] : '', + 'salary' => !empty($_POST['subsequent_company_basic_salary'][$i]) ? $_POST['subsequent_company_basic_salary'][$i] : '', + 'allowance' => !empty($_POST['subsequent_company_fix_allowance'][$i]) ? $_POST['subsequent_company_fix_allowance'][$i] : '', + 'reason' => !empty($_POST['subsequent_company_leave_reason'][$i]) ? $_POST['subsequent_company_leave_reason'][$i] : '', + ); + } + + //other info + $gambling = $_POST['gambling']; + $smoking = $_POST['smoking']; + $drug = $_POST['drug']; + $drinking = $_POST['drinking']; + + $disability =$_POST['disability']; + $disability_detail = ($_POST['disability'] == 'yes')?$_POST['disability_detail']:''; + $medication = $_POST['medication']; + $medication_detail = ($_POST['medication'] == 'yes')?$_POST['medication_detail']:''; + $pregnancy = $_POST['pregnancy']; + $pregnancy_detail = ($_POST['pregnancy'] == 'yes')?$_POST['pregnancy_detail']:''; + $dismissed = $_POST['dismissed']; + $dismissed_detail = ($_POST['dismissed'] == 'yes')?$_POST['dismissed_detail']:''; + $court = $_POST['court']; + $court_detail = ($_POST['court'] == 'yes')?$_POST['court_detail']:''; + $finance = $_POST['finance']; + $finance_detail = ($_POST['finance'] == 'yes')?$_POST['finance_detail']:''; + $applied = $_POST['applied']; + $applied_detail = ($_POST['applied'] == 'yes')?$_POST['applied_detail']:''; + $dispute = $_POST['dispute']; + $dispute_detail = ($_POST['dispute'] == 'yes')?$_POST['dispute_detail']:''; + $other_job = $_POST['other_job']; + $other_job_detail = ($_POST['other_job'] == 'yes')?$_POST['other_job_detail']:''; + + $willingToTransferWithrelocation = $_POST['relocation']; //yes no + $willingToTransferWithoutrelocation = $_POST['without_relocation']; //yes no + $bankruptcy = $_POST['bankruptcy']; + $vehicle = $_POST['vehicle']; + $overtime = $_POST['overtime']; + $attract = $_POST['attract']; + $career_plan = $_POST['career_plan']; + + + // policy + $privacy_name = $_POST['privacy_name']; + $privacy_nric_number = $_POST['privacy_nric_number']; + $privacy_date = $_POST['privacy_date']; + + + //acknowledgement + $acknowledgement_name = $_POST['acknowledgement_name']; + $acknowledgement_nric_number = $_POST['acknowledgement_nric_number']; + $acknowledgement_privacy_date = $_POST['acknowledgement_privacy_date']; + + // signature + $acknowledgement_certify = escapeString($_POST['acknowledgement_certify']) ; + $acknowledgement_authorize = escapeString($_POST['acknowledgement_authorize']) ; + $acknowledgement_event = escapeString($_POST['acknowledgement_event']) ; + + // print_r($_POST['application_signature']); + // echo "
"; + // print_r($_POST['application_signature_hidden']);exit; + + if ($_POST['application_signature'] != '' && $_POST['application_signature'] != $_POST['application_signature_hidden']) { + // signature + $application_signature = escapeString($_POST['application_signature']) ; + $application_signature_date = TODAYDATE ; + + $image_name = time().'-'.uniqid(count($application_signature)); + $sign_img_name = $image_name.'.jpg'; + + $boolean_upload_signature = uploadImageBased64('Employment_Application', $sign_img_name, $application_signature); + // $boolean_upload_signature = true; + if($boolean_upload_signature == true){ + $signature_image_uploaded = '/uploads/Employment_Application/'.$sign_img_name; + }else{ + $signature_image_uploaded = ''; + } + }else{ + $user_details = jsonEncodeDecode('decode', $row_page['employment_details']) ; + $application = $user_details['application'] ; + if($application != ''){ + $application_signature = $application['signature'] ; + $application_signature_date = $application['date'] ; + $signature_image_uploaded = $application_signature; + }else{ + $application_signature = escapeString($_POST['application_signature']) ; + $application_signature_date = TODAYDATE ; + $signature_image_uploaded = ''; + } + + + } + + // if (strstr($application_signature, 'uploads')) { + // $signature_image_uploaded = $application_signature; + // // echo "aaa"; + // }else{ + // if ($application_signature != 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA+EAAC2z3BhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABYWVogAAAAAAAA9tYAAQAAAADTLW1sdWMAAAAAAAAAAQAAAAxlblVTAAAAIAAAABwARwBvAG8AZwBsAGUAIABJAG4AYwAuACAAMgAwADEANv/bAEMAAwICAgICAwICAgMDAwMEBgQEBAQECAYGBQYJCAoKCQgJCQoMDwwKCw4LCQkNEQ0ODxAQERAKDBITEhATDxAQEP/bAEMBAwMDBAMECAQECBALCQsQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEP/AABEIAJYBXgMBIgACEQEDEQH/xAAVAAEBAAAAAAAAAAAAAAAAAAAACf/EABQQAQAAAAAAAAAAAAAAAAAAAAD/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AqmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//2Q==' && $application_signature != '') { + + // $image_name = time().'-'.uniqid(count($application_signature)); + // $sign_img_name = $image_name.'.jpg'; + + // $boolean_upload_signature = uploadImageBased64('Employment_Application', $sign_img_name, $application_signature); + // // $boolean_upload_signature = true; + // if($boolean_upload_signature == true){ + // $signature_image_uploaded = '/uploads/Employment_Application/'.$sign_img_name; + // // echo "bbb"; + // }else{ + // $signature_image_uploaded = ''; + // // echo "ccc"; + // } + // } + // } + + // keep other value in array + $array_other_details = [ + // Personal Information + 'positionApplyText' => $positionApplyText, + 'expectedSalary' => $expectedSalary, + 'noticePeriod' => $noticePeroid, + 'referralName' => $referralName, + 'nric' => $nric, + 'personal_name' => $personal_name, + 'personal_name_chinese' => $personal_name_chinese, + 'personal_name_nickname' => $personal_name_nickname, + 'personal_dob' => $personal_dob, + 'personal_age' => $personal_age, + 'personal_email' => $personal_email, + 'personal_nationality' => $personal_nationality, + 'personal_religion' => $personal_religion, + 'personal_mobile' => $personal_mobile, + 'personal_home_tel' => $personal_home_tel, + 'personal_gender' => $personal_gender, + 'personal_marital_status' => $personal_marital_status, + 'personal_lisence' => $personal_lisence, + 'personal_lisence_class' => $personal_lisence_class, + 'personal_permanent_address' => $personal_permanent_address, + 'personal_residential_address' => $personal_residential_address, + + // Family Members + 'family_members' => $array_family_member, + + // Education Background + 'education_levels' => $array_education_level, + + // Professional Qualification + 'professional_qualifications' => $array_professional_qualification, + + // Language Proficiency + 'language_proficiency' => [ + 'spoken_english' => $spoken_english, + 'written_english' => $written_english, + 'spoken_mandarin' => $spoken_mandarin, + 'written_mandarin' => $written_mandarin, + 'spoken_bm' => $spoken_bm, + 'written_bm' => $written_bm, + 'language_other_1'=>$language_other_1, + 'spoken_other1' => $spoken_other1, + 'written_other1' => $written_other1, + 'language_other_2' => $language_other_2, + 'spoken_other2' => $spoken_other2, + 'written_other2' => $written_other2, + ], + + // Reference Detail + 'references' => $array_reference, + + // Current Employment + 'current_employment' => [ + 'company_name' => $currentCompanyName, + 'position' => $currentCompanyPosition, + 'address' => $currentCompanyAddress, + 'join_date' => $currentCompanyJoinDate, + 'left_date' => $currentCompanyLeftDate, + 'salary' => $currentCompanySalary, + 'allowance' => $currentCompanyAllowance, + 'leave_reason' => $currentCompanyReason, + ], + + // Subsequent Employment + 'subsequent_employments' => $array_subsequent_employment, + + // Other Info + 'habits' => [ + 'gambling' => $gambling, + 'smoking' => $smoking, + 'drug' => $drug, + 'drinking' => $drinking, + ], + 'conditions' => [ + 'disability' => $disability, + 'disability_detail' => $disability_detail, + 'medication' => $medication, + 'medication_detail' => $medication_detail, + 'pregnancy' => $pregnancy, + 'pregnancy_detail' => $pregnancy_detail, + 'dismissed' => $dismissed, + 'dismissed_detail' => $dismissed_detail, + 'court' => $court, + 'court_detail' => $court_detail, + 'finance' => $finance, + 'finance_detail' => $finance_detail, + 'applied' => $applied, + 'applied_detail' => $applied_detail, + 'dispute' => $dispute, + 'dispute_detail' => $dispute_detail, + 'other_job' => $other_job, + 'other_job_detail' => $other_job_detail, + ], + + 'relocation' => [ + 'with' => $willingToTransferWithrelocation, + 'without' => $willingToTransferWithoutrelocation, + ], + + 'vehicle' => $vehicle, + 'overtime' => $overtime, + 'attract' => $attract, + 'career_plan' => $career_plan, + + // Policy Consent + 'privacy' => [ + 'name' => $privacy_name, + 'nric' => $privacy_nric_number, + 'date' => $privacy_date, + ], + + // Acknowledgement + 'acknowledgement' => [ + 'name' => $acknowledgement_name, + 'nric' => $acknowledgement_nric_number, + 'date' => $acknowledgement_privacy_date, + ], + + 'application' => [ + 'signature' => $signature_image_uploaded, + 'date' => $application_signature_date + ], + ]; + + $array_other_details = json_encode($array_other_details, JSON_UNESCAPED_UNICODE) ; + + //get old record for record + $old_record = ''; + $mysqli_record = $mysqli->query("select employment_details from staff_employment where employment_id = '".$page."' limit 1"); + if ($mysqli_record->num_rows > 0 ){ + $old_record = $mysqli_record->fetch_array(MYSQLI_ASSOC)['employment_details']; + }else{ + $old_record = '-'; + } + + + // reset dob + $personal_dob = date('Y-m-d', strtotime(str_replace('/', '-', $personal_dob))) ; + + + if ($mysqli->query("UPDATE staff_employment SET + ".$query_trash." + employment_user_id = '".$incharge_person."', + employment_position = '".$positionApplySelect."', + employment_call = '".$personal_name."', + employment_name = '".$personal_name."', + employment_nric = '".$nric."', + employment_age = '".$personal_age."', + employment_dob = '".$personal_dob."', + employment_sex = '".$personal_gender."', + employment_religion = '".$personal_religion."', + employment_nationality = '".$personal_nationality."', + employment_marital = '".$personal_marital."', + employment_mobile = '".$personal_mobile."', + employment_tel = '".$personal_home_tel."', + employment_address = '".$personal_permanent_address."', + employment_email = '".$personal_email."', + employment_details = '".$array_other_details."', + employment_status = '".$_POST['employment_status']."', + employment_branch = '".$_SESSION['url_get_branch_admin']."', + employment_modified = '".TODAYDATE."' + WHERE employment_id = '".$page."'")){ + + // check if user exists + $mysqli_user = $mysqli->query("SELECT user_id FROM system_user + WHERE user_permission = 'employment' AND user_employment = '".$page."' LIMIT 1") ; + $type_log = ''; + $descrition = $_SESSION['system_name'].'(username) ' ; + + if ( $mysqli_user->num_rows == 0 ){ + $mysqli->query("INSERT INTO system_user + (user_permission, user_employment, user_date, user_trash) VALUES + ('employment', '".$page."', '".TODAYDATE."', '0')") ; + $user_id = $mysqli->insert_id ; + $type_log = "insert"; + $descrition .= 'insert new application('.$user_id.')'; + }else{ + $row_user = $mysqli_user->fetch_assoc() ; + $user_id = $row_user['user_id'] ; + $type_log = "update"; + $descrition .= 'update a application('.$user_id.')'; + } + //save log + $record = array( + "old_record" => $old_record, + "new_record" => $array_other_details, + ); + $record = jsonEncodeDecode('encode', $record) ; + $mysqli->query("INSERT INTO system_log_employment + (log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ('employment', '".$type_log."', '200', 'AF-".$page."', '".$_SESSION["system_id"]."', '".$descrition."', '".$record."', NOW())"); + + // update user + $mysqli->query("UPDATE system_user SET + user_email = '".$personal_email."', + user_call = '".$personal_name."', + user_fullname = '".$personal_name."', + user_modified = '".TODAYDATE."' + WHERE user_id = '".$user_id."'") ; + + + + ////////////////////////////////////////////////////////////// + ////////////////////upload image and resume/////////////////// + ////////////////////////////////////////////////////////////// + /* + $create_image = reCreateImage('Employment', $page, $page, '', $personal_image, $personal_image_type, $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + + $file_upload = array('path' => PATH.'uploads/Employment/', + 'file' => $create_image['image']) ; + $file_upload = jsonEncodeDecode('encode', $file_upload) ; + + // update database + if ($mysqli->query("UPDATE staff_employment SET + employment_file = '".$file_upload."' + WHERE employment_id = '".$page."'")){ + + } + } + + + //upload resume + if ($resume_attached != '' && $resume_attached_tmp != '' && $resume_attached_type == 'application/pdf') { + $newResumeFile = time().'-'.$resume_attached; + $resume_attached_path = $_SERVER["DOCUMENT_ROOT"].'/uploads/Employment_Resume/'; + $boolean_upload_resume = move_uploaded_file($resume_attached_tmp, $resume_attached_path.$newResumeFile); + + if ($boolean_upload_resume) { + $mysqli->query("UPDATE staff_employment SET employment_resume = '".$newResumeFile."' WHERE employment_id = '".$page."'"); + } + }*/ + } + + // refresh page + header("Location:?page_mode=edit&page=".$page."&success=1&select_worker=Local") ; + exit ; +} + +// start header here +include 'requires/page_header.php' ; + +if ( $hide_title == false ){ + include 'requires/page_top.php' ; +} + +// decode other variable +$array_other_details = jsonEncodeDecode('decode', $row_page['employment_details']) ; +//$user_profile = jsonEncodeDecode('decode', $row_page['employment_file']) ; + +// Flat values +$positionApplyText = $array_other_details['positionApplyText']; +$expectedSalary = $array_other_details['expectedSalary']; +$noticePeroid = $array_other_details['noticePeriod']; +$referralName = $array_other_details['referralName']; +$personal_name = $array_other_details['personal_name']; +$personal_name_chinese = $array_other_details['personal_name_chinese']; +$personal_name_nickname = $array_other_details['personal_name_nickname']; +$personal_dob = $array_other_details['personal_dob']; +$personal_age = $array_other_details['personal_age']; +$personal_email = $array_other_details['personal_email']; +$personal_nationality = $array_other_details['personal_nationality']; +$personal_religion = $array_other_details['personal_religion']; +$personal_mobile = $array_other_details['personal_mobile']; +$personal_home_tel = $array_other_details['personal_home_tel']; +$personal_gender = $array_other_details['personal_gender']; +$personal_marital_status = $array_other_details['personal_marital_status']; +$personal_lisence = $array_other_details['personal_lisence']; +$personal_lisence_class = $array_other_details['personal_lisence_class']; +$personal_permanent_address = $array_other_details['personal_permanent_address']; +$personal_residential_address = $array_other_details['personal_residential_address']; + +// Arrays +$array_family_member = $array_other_details['family_members']; +$array_education_level = $array_other_details['education_levels']; +$array_professional_qualification = $array_other_details['professional_qualifications']; +$array_reference = $array_other_details['references']; +$array_subsequent_employment = $array_other_details['subsequent_employments']; + +// Language proficiency +$spoken_english = $array_other_details['language_proficiency']['spoken_english']; +$written_english = $array_other_details['language_proficiency']['written_english']; +$spoken_mandarin = $array_other_details['language_proficiency']['spoken_mandarin']; +$written_mandarin = $array_other_details['language_proficiency']['written_mandarin']; +$spoken_bm = $array_other_details['language_proficiency']['spoken_bm']; +$written_bm = $array_other_details['language_proficiency']['written_bm']; +$language_other_1 = $array_other_details['language_proficiency']['language_other_1']; +$spoken_other1 = $array_other_details['language_proficiency']['spoken_other1']; +$written_other1 = $array_other_details['language_proficiency']['written_other1']; +$language_other_2 = $array_other_details['language_proficiency']['language_other_2']; +$spoken_other2 = $array_other_details['language_proficiency']['spoken_other2']; +$written_other2 = $array_other_details['language_proficiency']['written_other2']; + +// Current employment +$currentCompanyName = $array_other_details['current_employment']['company_name']; +$currentCompanyPosition = $array_other_details['current_employment']['position']; +$currentCompanyAddress = $array_other_details['current_employment']['address']; +$currentCompanyJoinDate = $array_other_details['current_employment']['join_date']; +$currentCompanyLeftDate = $array_other_details['current_employment']['left_date']; +$currentCompanySalary = $array_other_details['current_employment']['salary']; +$currentCompanyAllowance = $array_other_details['current_employment']['allowance']; +$currentCompanyReason = $array_other_details['current_employment']['leave_reason']; + +// Habits +$gambling = $array_other_details['habits']['gambling']; +$smoking = $array_other_details['habits']['smoking']; +$drug = $array_other_details['habits']['drug']; +$drinking = $array_other_details['habits']['drinking']; + +// Conditions +$disability = $array_other_details['conditions']['disability']; +$disability_detail = $array_other_details['conditions']['disability_detail']; +$medication = $array_other_details['conditions']['medication']; +$medication_detail = $array_other_details['conditions']['medication_detail']; +$pregnancy = $array_other_details['conditions']['pregnancy']; +$pregnancy_detail = $array_other_details['conditions']['pregnancy_detail']; +$dismissed = $array_other_details['conditions']['dismissed']; +$dismissed_detail = $array_other_details['conditions']['dismissed_detail']; +$court = $array_other_details['conditions']['court']; +$court_detail = $array_other_details['conditions']['court_detail']; +$finance = $array_other_details['conditions']['finance']; +$finance_detail = $array_other_details['conditions']['finance_detail']; +$applied = $array_other_details['conditions']['applied']; +$applied_detail = $array_other_details['conditions']['applied_detail']; +$dispute = $array_other_details['conditions']['dispute']; +$dispute_detail = $array_other_details['conditions']['dispute_detail']; +$other_job = $array_other_details['conditions']['other_job']; +$other_job_detail = $array_other_details['conditions']['other_job_detail']; + +// Relocation +$willingToTransferWithrelocation = $array_other_details['relocation']['with']; +$willingToTransferWithoutrelocation = $array_other_details['relocation']['without']; + +// Other +$vehicle = $array_other_details['vehicle']; +$overtime = $array_other_details['overtime']; +$attract = $array_other_details['attract']; +$career_plan = $array_other_details['career_plan']; + +if ($row_page['employment_branch'] != $_SESSION['url_get_branch_admin']) { + + echo ' + ' ; +} + +if ( $hide_title == true && $_GET['success'] == '1' ){ + echo ' + ' ; +} +?> + +
+
+
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
 
+ + + + +
+ +
+
 
+ + + + + +
+ : + + + query($mysqli_query); + if ($mysqli_position->num_rows > 0) { + echo ' + '; + } + ?> + +
+
+ + + + + +
:
+
+ + + + + +
:
+
+ + + + + +
: +
+
+ + + + + +
NRIC (ONLY NUMBER) : + + + without dash or space +
+
 
 
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ : +
+
+ + + + + + + + + +
+ + : + + : +
+
+ + + + + + + + + + + +
+ : + + : + + : +
+
+ + + + + + + + + +
+ : + + : +
+
+ + + + + + + + + +
+ : + + : +
+
+ + + + + + + + + + + +
+ : + + : + + : +
+
+ +
+
+
+
+
+ +
+
+ + id="radio_yes" value="yes" /> + + : + +
+
+ + id="radio_no" value="no" /> + +
+
+ + +
+ + + + + + + +
+ : +
+
+ + + + + + + +
+ : +
+
+
+
+
 
 
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + +
+
+
+
 
 
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + +
+ + + + + + + + + +
+
+
+
 
 
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + + + + + +
+
+
+
 
 
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + name="spoken_english" value="good"> + name="spoken_english" value="average"> + name="spoken_english" value="poor"> + name="written_english" value="good"> + name="written_english" value="average"> + name="written_english" value="poor">
+ + name="spoken_mandarin" value="good"> + name="spoken_mandarin" value="average"> + name="spoken_mandarin" value="poor"> + name="written_mandarin" value="good"> + name="written_mandarin" value="average"> + name="written_mandarin" value="poor">
+ + value="good"> + value="average"> + value="poor"> + name="written_bm" value="good"> + name="written_bm" value="average"> + name="written_bm" value="poor">
+ + + name="spoken_other1" value="good"> + name="spoken_other1" value="average"> + name="spoken_other1" value="poor"> + name="written_other1" value="good"> + name="written_other1" value="average"> + name="written_other1" value="poor">
+ + + name="spoken_other2" value="good"> + name="spoken_other2" value="average"> + name="spoken_other2" value="poor"> + name="written_other2" value="good"> + name="written_other2" value="average"> + name="written_other2" value="poor">
+
+
+ +
 
 
+
+
+ +
+
+ +

+ +

+ + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + +
+ + + + + + + +
+

+
+
 
 
+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
 
 
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ #
+
+
+
 
 
+
+
+ +
+
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + value="never"> + value="occasionally"> + value="average"> + value="regularly"> + value="habitual">
+ + value="never"> + value="occasionally"> + value="average"> + value="regularly"> + value="habitual">
+ + value="never"> + value="occasionally"> + value="average"> + value="regularly"> + value="habitual">
+ + value="never"> + value="occasionally"> + value="average"> + value="regularly"> + value="habitual">
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ > + + + +
+ value="no"> + +
+ +
+ value="yes" class="toggleDetail"> + + +
+ value="no"> + + +
+ +
+ value="yes" class="toggleDetail"> +
+ value="no">
+ +
+
+ A. WITH RELOCATION:
+
+ +
+
+
+ B. WITHOUT RELOCATION:
+
+ +
+
+ +
+ type="radio" name="dismissed" class="toggleDetail"> +
+ name="dismissed">
+ +
+ value="yes" class="toggleDetail"> +
+ name="court">
+
+ name="bankruptcy">
+ name="bankruptcy">
+ +
+ name="finance" class="toggleDetail"> +
+ value="no">NO
+ +
+ name="applied" class="toggleDetail"> +
+ value="no">
+ +
+ name="dispute" class="toggleDetail"> +
+ value="no">
+ +
+ value="yes">
+ value="no">
+
+ value="yes">
+ value="no">
+ +
+ value="yes" class="toggleDetail"> +
+ value="no">
+ +
+ +
+ +
+ +
+
+
+ +
 
 
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
 
 
 
+ + + + + + + +
 
 
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/HR/hr-local-list.php b/HR/hr-local-list.php new file mode 100644 index 0000000..78f49a6 --- /dev/null +++ b/HR/hr-local-list.php @@ -0,0 +1,290 @@ + + +
+
+ ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+ +
+
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ query($mysqli_query) ; + if ($mysqli_position->num_rows > 0){ + echo ' + ' ; + } + ?> +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+
+
+
+ +
+
+
+ + + + + + + + + + + '.$lang['Update Profile'].'') ?> + '.$lang['Update'].'
'.$lang['Interview'].''; + } + ?> + + '.$lang['Update'].'
'.$lang['status'].'').' + ' ; + } + ?> + + + + query("SELECT employment_nric FROM staff_employment GROUP BY employment_nric"); + $all_ic = $mysqli_ic->fetch_all(MYSQLI_ASSOC); + $mysqli_position = $mysqli->query("SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $mysqli_position->num_rows > 0 ){ + while ( $row_position = $mysqli_position->fetch_assoc() ){ + $position[$row_position['job_position_id']] = dataFilter($row_position['job_position_desc']) ; + } + } + + if ($mysqli_page->num_rows > 0){ + while ($row_page = $mysqli_page->fetch_assoc()){ + + $employment_id = $row_page['employment_id'] ; + + // check page type + $array_update_status = array() ; + switch($type){ + case 'pending' : + $array_update_status = array('Pending', 'Offer', 'Reject') ; + $link_update = 'hr-employment.php?page_mode=edit&page='.$employment_id ; + break ; + case 'offer' : + $array_update_status = array('Offer', 'Confirmation', 'Terminate') ; + $link_update = 'hr-employment.php?page_mode=offer&page='.$employment_id ; + break ; + case 'confirmation' : + $array_update_status = array('Confirmation', 'Terminate') ; + break ; + case 'terminate' : + $array_update_status = array('Terminate') ; + break ; + } + + $link_print_jpeg = 'hr-employment-pdf.php?page='.$employment_id.'&type=changeType&page_type=jpeg' ; + $link_print_pdf = 'hr-employment-pdf.php?page='.$employment_id.'&type=changeType&page_type=pdf' ; + + echo ' + + + + + + + + '.($boolean_terminate ? '' : '').' ' ; + echo + ($boolean_terminate ? '' : ''); + if ( $type == 'processing' || $type == 'interview' || $type == 'offer' ){ + echo' + + '; + } + echo' + ' ; + if ( $type == 'pending' || $type == 'processing' || $type == 'interview' || $type == 'reschedule' ){}else{ + echo ' + '.($boolean_terminate ? '' : '').' + ' ; + } + echo ' + ' ; + } + }else{ + echo ' + + + + + + + + + + + '.($boolean_terminate ? '' : '').' + '.($boolean_terminate ? '' : '').' + '.($type == 'pending' ? '' : ($boolean_terminate ? '' : '').'').' + ' ; + } + ?> + +
NRICPOSITION '.$lang['Print'].'
'.$lang['Letter'].'
'.dataFilter($row_page['employment_name']).'' . dataFilter($row_page['employment_nric']) .'
'. + (in_array($row_page['employment_nric'], $ic_list) ? ' ic duplicated' : ' ic unique') . + '
'.$position[$row_page['employment_position']].''.dataFilter($row_page['employment_sex']).''.dataFilter($row_page['employment_nationality']).''.dataFilter($row_page['employment_mobile']).''.$row_page['employment_status'].''.$row_page['employment_status'].' | '.(!permissionCheck($row_user, 'application-list-edit') ? '' : ''.($row_page['employment_status'] == 'Reschedule' ? '' : '').'').''.(!permissionCheck($row_user, 'application-list-edit') ? '' : '').' + + + + | + + '.(!permissionCheck($row_user, 'application-list-update') ? '' : '').' + '.($boolean_offer ? 'Offer Letter : ' : '').' + + | + ' ; + if ($boolean_offer){ + echo ' +
+ I.E.A Letter : + + | + ' ; + } + echo ' +
'.$lang['no_data'].'
+ +
+
+
+ + diff --git a/HR/hr-local-mail.php b/HR/hr-local-mail.php new file mode 100644 index 0000000..c8604cc --- /dev/null +++ b/HR/hr-local-mail.php @@ -0,0 +1,169 @@ +query($mysqli_query) ; +$job_position_desc = '' ; +if ( $mysqli_position->num_rows > 0 ){ + $row_position = $mysqli_position->fetch_assoc() ; + $job_position_desc = $row_position['job_position_desc'] ; +} + +$mysqli_query = "SELECT * FROM branch + WHERE deleted_at IS NULL AND branch_id = '".$row_page['employment_branch']."' + LIMIT 1" ; +$mysqli_branch = $mysqli->query($mysqli_query) ; +$branch_name = '' ; +$branch_hr_email = '' ; +$branch_hr_cc = [] ; +$branch_email_footer = '' ; +if ( $mysqli_branch->num_rows > 0 ){ + $row_branch = $mysqli_branch->fetch_assoc() ; + $branch_name = dataFilter( $row_branch['branch_name'] ) ; + $branch_hr_email = dataFilter( $row_branch['branch_hr_email'] ) ; + $branch_hr_cc = explodeToArray( $row_branch['branch_hr_cc'] ) ; + $branch_email_footer = entityDecode( dataFilter( $row_branch['branch_email_footer'] ) ) ; +} + +$mail_type = escapeString( $_GET['mail_type'] ) ; +$hod = base64_decode(escapeString( $_GET['hod'])) ; +$attach = base64_decode(escapeString( $_GET['attach'])); + +if ( $hod != '' ) { + $temp_emailcc = explode(",", str_replace(" ","",$hod)); + foreach ($temp_emailcc as $key => $value) { + if ( filter_var($value, FILTER_VALIDATE_EMAIL) ) { + array_push($branch_hr_cc, $value); + } + } +} + +if ( $attach != '' ) { + $link_attach_resume = 'Candidate\'s Resume' ; +} +$link = PATH.'hr-employment-schedule-interview-date.php?page='.$page.'&branch='.$row_page['branch'].'&sign='.md5( $page.$row_page['branch'].APIKEY) ; +$link_reschedule = ''.$link.'' ; + +switch ( $mail_type ){ + case 'interview' : + $title = "Invitation For Interview" ; + $content = " + + + + + + + + + + + + + + + + + + + +
Dear ".strtoupper($row_page['employment_name']).",
Thank you for your application regarding the position of ".$job_position_desc." at ".$branch_name.".
We are impressed with your qualifications and would like to meet with you to have a round of discussion. You are advised to attend for the interview on ".date('Y-m-d H:i', strtotime($row_page['employment_interview_date']))." at our office.
If you have any queries, please feel free to contact the office. We look forward to meet you soon at our office.
Please Note That:
1) This is an interview call for the job applied and does not guarantee employment with us.
2) No TA / DA will be provided to candidates appearing for the interview.
3) Bring this letter with you on the above-mentioned date and time of the interview.
4) Bring photocopies and originals of your academic & other credentials along with a recent snap.
Reschedule Interview Date (If you are inconvenience with the date provided):
".$link_reschedule."
*Please revert back to this email to confirm for your interview attendance.
" . $branch_email_footer ; + break ; + case 'reschedule' : + $title = "Reschedule for Interview Date" ; + $content = " + + + + + + + + + + + + + + + + "; + if ( $attach != '' ) { + $content.=" + + + "; + } + $content.=" + +
Dear ".strtoupper($row_page['employment_name']).",
After discussion and consideration, we would like to inform you that your interview was rescheduled and will be held on ".($row_page['employment_r_interview_date'] == '0000-00-00 00:00:00' ? date('Y-m-d H:i', strtotime($row_page['employment_interview_date'])) : date('Y-m-d H:i', strtotime($row_page['employment_r_interview_date'])) )." at our office.
If you have any queries, please feel free to contact the office. We look forward to meet you soon at our office.
Please Note That:
1) This is an interview call for the job applied and does not guarantee employment with us.
2) No TA / DA will be provided to candidates appearing for the interview.
3) Bring this letter with you on the above-mentioned date and time of the interview.
4) Bring photocopies and originals of your academic & other credentials along with a recent snap.
Reschedule Interview Date (If you are inconvenience with the date provided):
".$link_reschedule."
Attachment:
".$link_attach_resume."
*This is a system generated email. Please do not reply to it.
" . $branch_email_footer ; + break ; + case 'offer_letter' : + $title = "Offer Letter" ; + $link_offer_letter = ''.PATH.'employment_document.php?id='.$page.'&doctype=offer_letter&branch='.$_SESSION['url_get_branch_admin'].'' ; + + $link_agreement = ''.PATH.'employment_document.php?id='.$page.'&doctype=ieagreement&branch='.$_SESSION['url_get_branch_admin'].'' ; + + $link_sign_form = ''.PATH.'employment_document.php?id='.$page.'&doctype=sign_form&branch='.$_SESSION['url_get_branch_admin'].'' ; + + $content = " + + + + + + + + + + "; + + if ( $offer_status['sent_ol_date'] != '' && $offer_status['sent_ol'] == 'OLA' ){ + $content.=" + + + " ; + } + + $content.= " + + + + + +
Dear ".strtoupper($row_page['employment_name']).",
Congratulations! We would like to inform you that your application of ".$job_position_desc." at ".$branch_name." had been approved. Please read the offer letter provided and sign the form provided below to confirm the offer.
If you have any queries, please feel free to contact the office. We look forward to meet you soon at our office.
Attachment:
Official Offer Letter:
".$link_offer_letter."
Individual Employment Agreement
".$link_agreement."
Offer Letter Form (Signed for Confirmation):
".$link_sign_form."
*This is a system generated email. Please do not reply to it.
" . $branch_email_footer ; + break ; + case 'reject' : + $title = "Reject Applicant Interview" ; + $content = " + + + + + + + + + +
Dear ".ucwords($row_page['employment_name']).",
Thank you for applying to the job opening at ".$branch_name.". After carefully reviewing your qualifications, we have decided to pursue other candidates whom we feel more closely meeting our needs at this time.
We appreciate your interest in our company and the time it took to apply with us. Please feel free to apply for open positions with us in the future.
Again, thank you for considering us as a potential employer. We wish you success in your career pursuit.
" . $branch_email_footer ; + break ; +} + + +$mailer = new Mailer() ; +$mailer->from = $branch_hr_email ; +$mailer->fromname = COMPANY ; +$mailer->to = [ $row_page['employment_email'] ] ; +if ( count($branch_hr_cc) > 0 ){ + $mailer->cc = $branch_hr_cc ; +} +$mailer->subject = $title ; +$mailer->body = $content ; +$mailer->send() ; + +echo '' ; +echo '' ; + +?> \ No newline at end of file diff --git a/HR/hr-local-new.php b/HR/hr-local-new.php new file mode 100644 index 0000000..8529777 --- /dev/null +++ b/HR/hr-local-new.php @@ -0,0 +1,2225 @@ +
+
+
+ +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
 
+ + + + +
+ +
+
 
+ + + + + +
+ : + + + query($mysqli_query); + if ($mysqli_position->num_rows > 0) { + echo ' + '; + } + ?> + +
+
+ + + + + +
:
+
+ + + + + +
:
+
+ + + + + +
: +
+
+ + + + + +
NRIC (ONLY NUMBER) : + + + without dash or space +
+
 
 
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ : +
+
+ + + + + + + + + +
+ + : + + : +
+
+ + + + + + + + + + + +
+ : + + : + + : +
+
+ + + + + + + + + +
+ : + + : +
+
+ + + + + + + + + +
+ : + + : +
+
+ + + + + + + + + + + +
+ : + + : + + : +
+
+ +
+
+
+
+
+ +
+
+ + + : + +
+
+ + +
+
+ + +
+ + + + + + + +
+ : +
+
+ + + + + + + +
+ : +
+
+
+
+
 
 
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + +
+
+
+
 
 
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + +
+ + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + +
+
+
+
 
 
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+
+
+
 
 
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
+
+ +
+ +
+
+
+ +
 
 
+
+
+ +
+
+ +

+ +

+ + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + +
+ + + + + + + + +
+

+
+
 
 
+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
 
 
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ #1
+ #2
+ #3
+
+
+
 
 
+
+
+ +
+
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ A. WITH RELOCATION:
+
+ +
+
+
+ B. WITHOUT RELOCATION:
+
+ +
+
+ +
+
+ +
+
+
+ +
+
NO
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+
+
+ +
 
 
+
+
+ +
+
+ +

BY PROVIDING PERSONAL DATA AS STATED IN THIS + EMPLOYMENT APPLICATION FORM, I HAVE CONSENTED YOUR COMPANY TO + PROCESS THE PERSONAL DATA IN ACCORDANCE WITH PERSONAL DATA + PROTECTION ACT, AND I FURTHER CONFIRM THAT ALL PERSONAL DATA + PROVIDED HEREIN ARE ACCURATE AND COMPLETE.

+ +

TO THE EXTENT THAT I HAVE PROVIDED ABOUT MY + FAMILY MEMBERS, SPOUSE, OTHER DEPENDENTS, AND PERSONAL REFERRALS + CONFIRM THAT I HAVE EXPLAINED TO THEM THAT THEIR PERSONAL DATA WILL + BE PROVIDED TO, AND PROCESSED BY YOUR COMPANY AND I REPRESENT AND + WARRANT THAT I HAVE OBTAINED THEIR CONSENT TO THE PROCESSING OF + THEIR PERSONAL DATA IN ACCORDANCE WITH PERSONAL DATA PROTECTION ACT. +

+ +

I FURTHER AUTHORIZE AND CONSENT YOUR COMPANY TO + CONDUCT BACKGROUND SEARCH ON ME WHETHER BASED ON THE DATA PROVIDED + BY ME IN THIS EMPLOYMENT APPLICATION FORM OR RELATED INFORMATION + THAT YOUR COMPANY MAY OBTAIN FROM OTHER SOURCES FOR EVALUATING MY + JOB APPLICATION.

+ +
+
+
+
+
+
+
+
 
 
+ +
+
+ +
+
+ +

I HEREBY DECLARE THAT ALL PARTICULARS AND + DOCUMENTS GIVEN BY ME ON THIS EMPLOYMENT APPLICATION FORM ARE TO THE + BEST OF MY KNOWLEDGE AND BELIEF, TRUE AND CORRECT. I UNDERSTAND THAT + IF OR AT ANY TIME AFTER MY EMPLOYMENT, THE INFORMATION GIVEN ON THIS + FORM ARE FOUND TO BE FALSE, INCORRECT OR INCOMPLETE, THE COMPANY + RESERVES THE RIGHT TO DISMISS MY SERVICES WITHOUT NOTICE OR + COMPENSATION.

+
+
+
+
+
+
+
+
 
 
+
Please acknowledge by signing below :
+
+
+
+ Click To Sign Here
+
+ +
+ + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
 
 
 
+ + + + + + + +
 
 
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/HR/hr-offer-letter-update.php b/HR/hr-offer-letter-update.php new file mode 100644 index 0000000..c05287a --- /dev/null +++ b/HR/hr-offer-letter-update.php @@ -0,0 +1,90 @@ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ query($mysqli_query) ; + if ($mysqli_user->num_rows > 0){ + echo ' + ' ; + } + ?> +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/HR/letter-confirmation-temp.php b/HR/letter-confirmation-temp.php new file mode 100644 index 0000000..956992d --- /dev/null +++ b/HR/letter-confirmation-temp.php @@ -0,0 +1,53 @@ + + + +
 
+ + '.$new_worker.' + +
 
+ + '.$employment_confirmation_date.' + +
 
+ +
 
+ + Subject: CONFIRMATION OF EMPLOYMENT + +
 
+ + Dear '.$new_worker.' + +
 
+ + After careful evaluation of your performance this is to inform you that with effect from '.$employment_confirmation_date.' you have been moved to Confirmation with our organization. + +
 
+ + You will now be '.$position.' and will report into '.$incharge_by.'. + +
 
+ + The terms and conditions of you employment will remain the same except for the notice period of Termination of employment. There will be a 1 month notice period from either side with effect from the date that this confirmation. + +
 
+ + We thank you for your initiatives and hope that you will perform with equal enthusiasm as time goes by. We wish you all the best in all your endeavors. + +
 
 
 
+ + Best regards, +







+ + + + + + +
'.$assign_by_position.'
'.$assign_by.'
+ +' ; +?> \ No newline at end of file diff --git a/HR/letter-iea-temp.php b/HR/letter-iea-temp.php new file mode 100644 index 0000000..821d6f8 --- /dev/null +++ b/HR/letter-iea-temp.php @@ -0,0 +1,644 @@ +query( "SELECT letterhead_content FROM setting_letterhead + WHERE letterhead_type = 'iea' AND deleted_at IS NULL + LIMIT 1") ; +$html_content = '' ; +if ( $mysqli_letterhead->num_rows > 0 ){ + $row_letterhead = $mysqli_letterhead->fetch_assoc() ; + $html_content = dataFilter( $row_letterhead['letterhead_content'] ) ; + + $html_content = str_replace( '[COMPANY]', COMPANY, $html_content ) ; + $html_content = str_replace( '[IEAASSIGNEDBY]', $assign_by, $html_content ) ; + $html_content = str_replace( '[IEAWORKERNAME]', $new_worker, $html_content ) ; + $html_content = str_replace( '[IEAWORKERIC]', dataFilter($row_page['employment_nric']), $html_content ) ; + $html_content = str_replace( '[IEAPOSITION]', $position, $html_content ) ; + $html_content = str_replace( '[IEAINCHARGEBY]', $incharge_by, $html_content ) ; + $html_content = str_replace( '[IEASALARY]', numberFormat($offer_status['salary']), $html_content ) ; + $html_content = str_replace( '[IEAALLOWANCE]', numberFormat($offer_status['allowance']), $html_content ) ; + $html_content = str_replace( '[IEACOMISSION]', numberFormat($offer_status['comission']), $html_content ) ; +} + +$html2 .= $html_content ; + +/* +$html .= ' + + + + + + + + + + + + + + + + + + + + + +
1 The Parties
  +
+ The parties to this employment agreement are:
+ 1. '.$assign_by.', the "Employer"; and
+ 2. '.$new_worker.' (NIRC: '.dataFilter($row_page['employment_nric']).') the "Employee". +
 
+
2 The Position and the Duties
  +
+ 2.1 Position +
 
+ The Employee is being employed a '.$position.' (POSITION). +
 
+ 2.2 Duties as set out in the job description which may be modified from time to time by the Employer +
 
+ The Employee shall perform the duties set out in the Job Description attached to this agreement. These duties may be modified and updated by the Employer from time to time following agreement with the Employee. The Employee also agrees to perform all other reasonable duties and comply with reasonable instructions issued by the Employer. +
 
+ 2.3 Reporting +
 
+ The Employee shall report to '.$incharge_by.' (head of department) or to any other representative of the Employer designated from time to time by the Employer. +
 
+ 2.4 Performance Objectives +
 
+ The Employer shall, in consultation with the Employee, set the Employee objectives at least on an annual basis. These objectives shall be taken into account by the Employer when assessing the Employee\'s performance. +
 
+ 2.5 Performance reviews +
 
+ The Employer shall conduct a performance review of the Employee on at least an annual basis. This review shall be taken into account in any salary reviews. +
 
+ 2.6 Secondment +
 
+ In the event the Employer considers that a secondment (such as to a client or customer or project) would be in the best interests of the Employer, the Employee shall comply with all reasonable requests to carry out that secondment. +
 
+
3 Natures and Term of the Agreement
  +
+ 3.1 Individual Agreement of Ongoing and Indefinite Duration +
 
+ This Employment Agreement is an individual employment agreement entered into under the Employment Relations Act. The employment shall commence on 1st April 2010 and shall continue until either party terminates the agreement in accordance with the terms of this agreement. The clauses in this agreement may be varied or updated by agreement between the parties at any time. +
 
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
  + 3.2 Probation +
 
+ A probation period will apply for the first 3 months of employment to assess and confirm suitability for the position. The employer will provide guidance, feedback and any necessary support to the employee. Both parties will promptly discuss any difficulties that arise, and the employer will appropriately warn the employee if he or she is contemplating termination. Any termination must comply with the termination clause in this agreement. This probation period does not limit the legal rights and obligations of the employer or the employee, and both parties must deal with each other in good faith. +
 
+
4 The Place of Work
  +
+ 4.1 Flexible Location +
 
+ The parties agree that the Employee shall perform their duties at '.COMPANY.' '.ADDRESS.' and at any other reasonable location to which they may be directed from time to time by the Employer. +
 
+
5 Hours of Work
  +
+ 5.1 Full Time Hours of Work +
 
+ The Employee\'s hours of work shall be 44 hours per week
+ + + + + + + + + + + +
Monday till Friday=9.00 am to 6.00 pm
Saturday=9.00 am to 01.00 pm

+ 5.2 Lunch Breaks +
 
+ The Employee shall be entitled to a lunch break on each working day of employment, of 1 hour, to be taken at 12.00 pm such other time as the parties agree from time to time. +
 
+ 5.3 Weekly Rest Day: +
 
+ Sunday +
 
+ 5.4 Pray Time: +
 
+ The Employee shall be entitled to pray on every Friday, of 2 hours, to be pray at 12.30pm till 2.30pm. +
 
+
+ + + + + + + + + + + +
6 Wages / Salary / Allowances
  +
+ 6.1 Salary +
 
+ The Employee\'s salary shall be as follow details +
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
6.1.1)Basic Salary : RM '.numberFormat($offer_status['salary']).' / month
6.1.2)Commission : '.($offer_status['comission'] != '' ? numberFormat($offer_status['comission']).'% Commission For Every Completed And Succeed Payment Project' : 'NIL').'
6.1.3) Duration Of Wage Period : Monthly
6.1.4)Salary / Pay Day : Before 6th Of Each Month
6.1.5)Payment By : Cheque / Cash / Bank Transfer
6.1.6)Phone Service : NIL
6.1.7)Petrol, Toll & Parking : NIL
6.1.8)Outstation Allowance : NIL
6.1.9)Overtime Wage Rate Per Hour : NIL
6.1.10)Paid Public Holidays & Total Days In A Calendar Year : 14 Days
6.1.11)E.P.F & Socso : Yes
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 a.Chinese New Year--8 Days
 b.Sultan\'s Johor Birthday--1 Day
 c.Labour Day--1 Day
 d.Agongs\'s Birthday--1 Day
 e.National Day--1 Day
 f.Malaysia Day--1 Day
 g.Merry Christmas--1 Day
+ +
+ + 6.2 Review +
 
+ The Employer agrees to review the Employee\'s salary/wages on the 12 month anniversary of this employment agreement and every 12 month anniversary thereafter. The parties agree that the Employee shall not have any necessary entitlement to an increase, but, the Employer agrees to conduct this review in good faith and to consult with the Employee during the review. +
 
+ 6.3 Allowance Clause (1) +
 
+ NIL +
 
+ 6.4 Overtime +
 
+ NIL +
 
+ 6.2 Review +
 
+ Entitled +
 
+ NIL +
 
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
  + 6.5 Reimbursement of Expenses +
 
+ The Employee shall be entitled to reimbursement by the Employer of all expenses reasonably and properly incurred by the Employee in the performance of their duties, provided the Employee produces appropriate receipts to the Employer when requesting reimbursement. +
 
+ 6.6 Reimbursement of Travel and Accommodation Expenses +
 
+ NIL +
 
+
  + 6.6 Reimbursement of Travel and Accommodation Expenses +
 
+ NIL +
 
+
7 Holidays and Leave Entitlements
  +
+ + 7.1 Annual Leave entitlements in the Holidays Act + +
 
+ + The Employee shall be entitled to paid annual leave after 1 year of Emplyment on the following basis: + +
 
+ + a) Paid Annual Leave:
+ + + + + + + + + + + + + + + + + + + + + + + +
 a.Within 2 Years:  8 Days
 b.2 ~ 5 Years:12 Days
 c.5 Years Above:16 Days

+ + b) Annual leave may, with the agreement of the Employer, be taken in advance. + +
 
+ + c) The time for taking annual leave may be agreed between the Employer and Employee, but failing agreement the Employer may, after consultation with the Employee, and having taken into account work requirements and the opportunities for rest and recreation available to the Employee, provide at least 3 days notice to the Employee directing them to take annual leave commencing on a particular date. + +
 
+ + 7.2 Sick Leave + +
 
+ + a) Sick Leave (Medical Certificate Required):
+ + + + + + + + + + + + + + + + + + + + + + + +
 a.Within 2 Years:14 Days
 b.2 ~ 5 Years:18 Days
 c.More Than 5 Years:22 Days
+ +
+ + Where the Employee has taken sick leave and has been absent from work for at least three consecutive calendar days, the Employer shall be entitled to require the employee to provide proof of entitlement to sick leave, at the employee\'s cost. + +
 
+ + Where the Employee takes sick leave, and the Employer has reasonable cause to suspect that the leave is not genuine, the Employer shall be entitled to require the employee to provide proof of entitlement to sick leave within the three consecutive calendar days, at the employee\'s cost. The employer will inform the employee as early as possible that such proof will be required. + +
 
+ + 7.3 Unpaid Leave + +
 
+ + Applications for unpaid leave will be given reasonable consideration by the Employer, but shall be granted only at the Employer\'s sole discretion having regard to the requirements of the Employer\'s business and operations. Applications for unpaid leave will be considered in situations such as for compassionate reasons; to undertake a course of work-related study; or to gain additional work-related experience. + +
 
+ + 7.4 Annual Closedown + +
 
+ + The Employer may closedown all or part of its operations regularly once a year and require the Employee to take leave during the period of the close down, even where this requires the Employee to take leave for which they are not fully reimbursed. The Employer shall provide the Employee with at least 14 days advance notice of the closedown. + +
 
+
+ + + + + + + + + + + +
8 Other Employment Obligations
  +
+ 8.1 Confidential Information +
 
+ The Employee shall not, whether during the currency of this agreement or after its termination for whatever reason, use, disclose or distribute to any person or entity, otherwise than as necessary for the proper performance of their duties and responsibilities under this agreement, or as required by law, any confidential information, messages, data or trade secrets acquired by the Employee in the course of performing their services under this agreement. This includes, but is not limited to, information about the Employer\'s business. +
 
+ 8.2 Copyright and other Intellectual Property +
 
+ All work produced for the Employer by the Employee under this agreement or otherwise and the right to the copyright and all other intellectual property in all such work is to be the sole property of the Employer. +
 
+ 8.3 Conflicts of Interest +
 
+ The Employee agrees that there are no contracts, restrictions or other matters which would interfere with their ability to discharge their obligations under this agreement. If, while performing their duties and responsibilities under this agreement, the Employee becomes aware of any potential or actual conflict between their interests and those of the Employer, then the Employee shall immediately inform the Employer. Where the Employer forms the view that such a conflict does or could exist, it may direct the Employee to take action(s) to resolve that conflict, and the Employee shall comply with that instruction. When acting in their capacity as Employee, the Employee shall not, either directly or indirectly, receive or accept for their own benefit or the benefit of any person or entity other than the Employer any gratuity, emolument, or payment of any kind from any person having or intending to have any business with the Employer. +
 
+ 8.4 Use of Internet and Email +
 
+ The Employee will not have the right to access to email and the Internet in the course of their employment. +
 
+ 8.5 Privacy Obligations +
 
+ The Employer and the Employee shall comply with the obligations set out in the Privacy Act 1993. The Employee must not breach the privacy of any customer or client in the course of their employment. +
 
+
+ + + + + + + + + + + + + + + + + +
9 Termination of Employment
  +
+ Within Probation Period +
 
+ The Employer may terminate this agreement for cause without notice within 24hours. +
 
+ After Confirmation of Employment +
 
+ The Employer may terminate this agreement for cause, by providing 1 Months notice in writing to the Employee. Likewise the Employee is required to give 1 Months notice of resignation. The Employer may, at its discretion, pay remuneration in lieu of some or all of this notice period. +
 
+ 9.2 Termination for Serious Misconduct +
 
+ Notwithstanding any other provision in this agreement, the Employer may terminate this agreement summarily and without notice for serious misconduct on the part of the Employee. Serious misconduct includes, but is not limited to: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
(i)theft;
(ii)dishonesty;
(iii)harassment of a work colleague or customer;
(iv)serious or repeated failure to follow a reasonable instruction;
(v)deliberate destruction of any property belonging to the Employer;
(vi)actions which seriously damage the Employer\'s reputation;
(vii)has a self project related in our company technique.
+
 
+ 9.3 Abandonment of Employment +
 
+ In the event the Employee has been absent from work for three consecutive working days without any notification to the Employer, and the Employer has made reasonable efforts to contact the Employee, this agreement shall automatically terminate on the expiry of the third day without the need for notice of termination of employment. +
 
+ 9.4 Obligations of Employee on Termination +
 
+ Upon the termination of this agreement for whatever reason, or at any other time if so requested by the Employer, the Employee shall immediately return to the Employer all information, material or property (including but not limited to computer disks, printouts, manuals, reports, letters, memos, plans, diagrams, security cards, keys, and laptop computers) either belonging to or the responsibility of the Employer and all copies of that material, which are in the Employee\'s possession or under their control. +
 

 
+
10 Acknowledgement of the Agreement
  +
+ 10.1 Variation of Agreement +
 
+ The parties may vary this agreement, provided that no variation shall be effective or binding on either party unless it is in writing and signed by both parties. +
 
+ 10.2 Non Assignment by Employee +
 
+ The Employee must personally perform the duties and responsibilities under this agreement and no subcontracting or assignment by the Employee is permissible. +
 
+ 10.3 Entire Agreement +
 
+ Each party acknowledges that this agreement contains the whole and entire agreement between the parties as to the subject matter of this agreement. +
+ + + + + + + + + + + + + + + + + + +
  + 10.4 Deductions from Salary/Wages +
 
+ Where requested by the Employee, the Employer shall deduct from their salary/wages any agreed amount for matters such as Unpaid Leave. The Employer shall also be entitled to deduct from any salary payment payable upon termination of employment any overpayment made to the Employee for leave taken in advance. +
 
+ 10.5 Employee Acknowledgment +
 
+ The Employee acknowledges that: + + + + + + + + + + + + + + + + + + + + + +
(i)they have been advised of their right to take independent advice on the terms of this agreement,
(ii)dishonesty;
(ii)that they have been provided with a reasonable opportunity to take that advice;
(iii)that they have read these terms of employment and understand these terms and their implications; and
(iv)that they agree to be bound by these terms of employment and the Employer\'s policies and procedures as implemented by the Employer from time to time.
+  
+ +
11 Declaration
  +
+ 11.1 Declaration +
 
+ I, '.$assign_by.', offer this employment agreement to '.$new_worker.' +
 
+
 
+
 
+
 
+
 
+
 
+ + + + + + + + + +
Signed by: Date:
+
 
+
 
+ I, '.$new_worker.' (NIRC: '.dataFilter($row_page['employment_nric']).') declare that I have read and understand the conditions of employment detailed above and accept them fully. I have been advised of the right to seek independent advice in relation to this agreement, and have been allowed reasonable time to do so. +
 
+
 
+
 
+
 
+
 
+
 
+ + + + + + + + + +
Signed by: Date:
+
 
+
+ +' ; +*/ +?> \ No newline at end of file diff --git a/HR/letter-offer.php b/HR/letter-offer.php new file mode 100644 index 0000000..c8a0b22 --- /dev/null +++ b/HR/letter-offer.php @@ -0,0 +1,58 @@ +query( "SELECT * FROM setting_letterhead + WHERE letterhead_type = '".$type."' AND deleted_at IS NULL + LIMIT 1") ; + + if( $mysqli_data->num_rows > 0 ){ + $row = $mysqli_data->fetch_assoc() ; + + $html_offer .= dataFilter( $row['letterhead_content'] ) ; + } + + $mysqli_position = $mysqli->query( "SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.job_position_id = '".$row_page['employment_position']."'" ) ; + if( $mysqli_position->num_rows > 0 ){ + $row_position = $mysqli_position->fetch_assoc() ; + + $position_id = $row_position['job_position_id'] ; + $position_title = $row_position['job_position_desc'] ; + } + + $html .= ' + + + +
+ '.str_replace('/', '.', $offer_status['date_to_offer']).'

+ Dear '.$new_worker.'

+ Re: Offer of Employment


+ I am pleased to confirm you the position of '.$position_title.' '.$letter_head['name'].' starting on '.str_replace('/', '.', $offer_status['starting_date']).' salary RM '.numberFormat($offer_status['salary'], 2, ',').' per month. I propose that the terms of employment will be those in the attached Individual Employment Agreement.


+ If you accept this position, please sign the duplicate copy of this letter and return it to me by '.str_replace('/', '.', $offer_status['return_date']).'. A copy of that agreement will be provided to you


+ In the event I have not heard from you by that date, this offer will be automatically withdrawn on that date. If there is anything you are unclear about, disagree with or wish to discuss, please contact me.


+ I look forward to working with you.


+ Yours faithfully, +







+ + + + + + +
'.$assign_by_position.'
'.$assign_by.'
+ + ' ; + +?> \ No newline at end of file diff --git a/HR/letter-pending.php b/HR/letter-pending.php new file mode 100644 index 0000000..f1cc1eb --- /dev/null +++ b/HR/letter-pending.php @@ -0,0 +1,1216 @@ + 'Below PMR', + 'qua_pmr_pt3' => 'PMR / PT3', + 'qua_spm' => 'SPM', + 'qua_certificate_skm_svm' => 'Certificate/ SKM / SVM', + 'qua_alevel_uec' => 'A-Level / UEC', + 'qua_diploma' => 'Diploma', + 'qua_degree' => 'Degree', + 'qua_master_degree' => 'Master Degree', + 'qua_phd' => 'PHD' + ); + +$mysqli_query = "SELECT * FROM system_user WHERE user_is_interview_by = 'yes' AND user_trash = '0' AND user_id = '".$int_det_interviewer_con['name']."' LIMIT 1" ; + $mysqli_check_interviewer = $mysqli->query($mysqli_query) ; +if ($mysqli_check_interviewer->num_rows > 0){ + $row_ck_interviewer = $mysqli_check_interviewer->fetch_array(MYSQLI_ASSOC) ; + $int_det_interviewer_name = dataFilter($row_ck_interviewer['user_name']) ; +} + +$mysqli_query = "SELECT * FROM system_user WHERE user_is_interview_by = 'yes' AND user_trash = '0' AND user_id = '".$int_det_verifier_con['verify_name']."' LIMIT 1" ; +$mysqli_check_verifier = $mysqli->query($mysqli_query) ; +if ($mysqli_check_verifier->num_rows > 0){ + $row_ck_verifier = $mysqli_check_verifier->fetch_array(MYSQLI_ASSOC) ; + $int_det_verifier_name = dataFilter($row_ck_verifier['user_name']) ; +} + +$mysqli_query = "SELECT * FROM system_user WHERE user_is_interview_by = 'yes' AND user_trash = '0' AND user_id = '".$int_det_approver_con['approve_name']."' LIMIT 1" ; +$mysqli_check_approver = $mysqli->query($mysqli_query) ; +if ($mysqli_check_approver->num_rows > 0){ + $row_ck_approver = $mysqli_check_approver->fetch_array(MYSQLI_ASSOC) ; + $int_det_approver_name = dataFilter($row_ck_approver['user_name']) ; +} + +$html .= ' + + + APPLICANT MUST FILL IN ALL BLANKS BEFORE SUBMISSION + + + + + + + + +
+ + + + + + + + +
Position Applied : '.$positionApplyText.' Expected Salary : RM '.$expectedSalary.'
+ + + + + + + + + + + + + +
Notice Peroid : '.$noticePeroid.' days Referral Name: '.$referralName.'
+ + + +  + +  + + + + + + + +
+ PERSONAL INFORMATION +
+ + + + + + +
Name as per NRIC :'.dataFilter($personal_name).'
+ + + + + + +
NAME IN CHINESE CHARACTER (IF APPLICABLE):

'.$personal_name_chinese.'

+ + + + + +
Nick Name :'.dataFilter($personal_name_nickname).'
+ + + + + + + + + + + + +
Nationality: '.dataFilter($row_page['employment_nationality']).' Birth Date: '.date('d/m/Y', strtotime($row_page['employment_dob'])).' Religion: '.dataFilter($personal_religion).'
+ + + + + + + + + + + +
Religion: '.dataFilter($row_page['employment_religion']).' Marital Status: '.dataFilter($personal_marital_status).'  + + +
+ + + + + + +
Permanent Address: '.dataFilter($row_page['employment_address']).'
+ + + + + + + + + + + + +
Mobile Number: '.dataFilter($row_page['employment_mobile']).' House Tel Number: '.dataFilter($row_page['employment_tel']).' Email: '.dataFilter($row_page['employment_email']).'
+ + + + + + + + + + +
Driving License: '.dataFilter($personal_lisence).' Driving License class: '.dataFilter($personal_lisence_class).' 
+ + + +  +  + + + + + + + + +
+ FAMILY PARTICULARS +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameRelationshipAgeOccupationCompany Name
1'.$member[0]['name'].''.$member[0]['relationship'].''.$member[0]['age'].''.$member[0]['occupation'].''.$member[0]['company'].'
2'.$member[1]['name'].''.$member[1]['relationship'].''.$member[1]['age'].''.$member[1]['occupation'].''.$member[1]['company'].'
3'.$member[2]['name'].''.$member[2]['relationship'].''.$member[2]['age'].''.$member[2]['occupation'].''.$member[2]['company'].'
4'.$member[3]['name'].''.$member[3]['relationship'].''.$member[3]['age'].''.$member[3]['occupation'].''.$member[3]['company'].'
5'.$member[4]['name'].''.$member[4]['relationship'].''.$member[4]['age'].''.$member[4]['occupation'].''.$member[4]['company'].'
5'.$member[5]['name'].''.$member[5]['relationship'].''.$member[5]['age'].''.$member[5]['occupation'].''.$member[5]['company'].'
5'.$member[6]['name'].''.$member[6]['relationship'].''.$member[6]['age'].''.$member[6]['occupation'].''.$member[6]['company'].'
5'.$member[7]['name'].''.$member[7]['relationship'].''.$member[7]['age'].''.$member[7]['occupation'].''.$member[7]['company'].'
+ + + + +  +  + + + + + + + + +
+ PROFESSIONAL QUALIFICATION +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PROFESSIONAL QUALIFICATIONACCREDITED BYStartEND
1'.$array_professional_qualification[0]['qualification'].''.$array_professional_qualification[0]['accredited'].''.$array_professional_qualification[0]['startYear'].''.$array_professional_qualification[0]['finishYear'].'
2'.$array_professional_qualification[1]['qualification'].''.$array_professional_qualification[1]['accredited'].''.$array_professional_qualification[1]['startYear'].''.$array_professional_qualification[1]['finishYear'].'
3'.$array_professional_qualification[2]['qualification'].''.$array_professional_qualification[2]['accredited'].''.$array_professional_qualification[2]['startYear'].''.$array_professional_qualification[2]['finishYear'].'
4'.$array_professional_qualification[3]['qualification'].''.$array_professional_qualification[3]['accredited'].''.$array_professional_qualification[3]['startYear'].''.$array_professional_qualification[3]['finishYear'].'
5'.$array_professional_qualification[4]['qualification'].''.$array_professional_qualification[4]['accredited'].''.$array_professional_qualification[4]['startYear'].''.$array_professional_qualification[4]['finishYear'].'
+ + + + +  +  + + + + + + + + +
+ EDUCATIONAL LEVEL +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QualificationName of School/College/UniversitySTARTFINISHGrade Obtained
(CGPA/Class)
Month/YearMonth/Year
'.$array_education_level[0]['qualification'].''.$array_education_level[0]['schoolName'].''.$array_education_level[0]['startYear'].''.$array_education_level[0]['finishYear'].''.$array_education_level[0]['grade'].'
'.$array_education_level[1]['qualification'].''.$array_education_level[1]['schoolName'].''.$array_education_level[1]['startYear'].''.$array_education_level[1]['finishYear'].''.$array_education_level[1]['grade'].'
'.$array_education_level[2]['qualification'].''.$array_education_level[2]['schoolName'].''.$array_education_level[2]['startYear'].''.$array_education_level[2]['finishYear'].''.$array_education_level[2]['grade'].'
'.$array_education_level[3]['qualification'].''.$array_education_level[3]['schoolName'].''.$array_education_level[3]['startYear'].''.$array_education_level[3]['finishYear'].''.$array_education_level[3]['grade'].'
+ + + + +  +  + + + + + + + + +
+ EMPLOYMENT HISTORY +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current company name: '.$currentCompanyName.'Current company position: '.$currentCompanyPosition.'
Current company address: '.$currentCompanyAddress.'
Current company join date: '.$currentCompanyJoinDate.'Current company left date: '.$currentCompanyLeftDate.'
Current company salary: '.$currentCompanySalary.'Current company allowance: '.$currentCompanyAllowance.'
reason left: '.$currentCompanyReason.'
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Company NamePosition HeldPeriod of EmploymentLast Drawn/
allowance
Last Drawn/
Current Salary
Reason(s) for leaving
FromTo
'.$array_subsequent_employment[0]['name'].''.$array_subsequent_employment[0]['position'].''.($array_subsequent_employment[0]['joinDate'] != '' ? $array_subsequent_employment[0]['joinDate'] : '' ).''.($array_subsequent_employment[0]['leftDate'] != '' ? $array_subsequent_employment[0]['leftDate'] : '' ).''.$array_subsequent_employment[0]['allowance'].''.$array_subsequent_employment[0]['salary'].''.$array_subsequent_employment[0]['reason'].'
'.$array_subsequent_employment[1]['name'].''.$array_subsequent_employment[1]['position'].''.($array_subsequent_employment[1]['joinDate'] != '' ? $array_subsequent_employment[1]['joinDate'] : '' ).''.($array_subsequent_employment[1]['leftDate'] != '' ? $array_subsequent_employment[1]['leftDate'] : '' ).''.$array_subsequent_employment[1]['allowance'].''.$array_subsequent_employment[1]['salary'].''.$array_subsequent_employment[1]['reason'].'
'.$array_subsequent_employment[2]['name'].''.$array_subsequent_employment[2]['position'].''.($array_subsequent_employment[2]['joinDate'] != '' ? $array_subsequent_employment[2]['joinDate'] : '' ).''.($array_subsequent_employment[2]['leftDate'] != '' ? $array_subsequent_employment[2]['leftDate'] : '' ).''.$array_subsequent_employment[2]['allowance'].''.$array_subsequent_employment[2]['salary'].''.$array_subsequent_employment[2]['reason'].'
+ + + + +  +  + + + + + + + + +
+ LANGUAGE AND SKILL +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LanguageWrittenSpoken
English'.$spoken_english.''.$written_english.'
Bahasa Melayu'.$spoken_bm.''.$written_bm.'
Chinese'.$spoken_mandarin.''.$written_mandarin.'
'.$language_other_1.''.$written_other1.''.$spoken_other1.'
'.$language_other_2.''.$written_other2.''.$spoken_other2.'
+ + + +  +  + + + + + + + + +
+ WHAT IS YOUR INVOLVEMENT IN THE FOLLOWING ACTIVITY +
+ + + + + + + + + + + + + + +
gamblingsmokingdrugdrinking
'.$gambling.''.$smoking.''.$drug.''.$drinking.'
+ + + +  +  + + + + + + + + +
+ OTHERS INFORMATION +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DescriptionsYesNoRemarks
1) DID YOU SUFFER FROM ANY PHYSICAL DISABILITY, CHRONIC AILMENT HANDICAP, ALLERGIES OR SERIOUS ILLNESS?'.(!empty($disability_detail) ? '/' : ' ' ).''.(empty($disability_detail) ? '/' : ' ' ).''.$disability_detail.'
2) ARE YOU TAKING ANY LONG-TERM MEDICATION FOR DIABETIC, ASTHMA, ETC.?'.(!empty($medication_detail) ? '/' : ' ' ).''.(!empty($medication_detail) ? '/' : ' ' ).''.$medication_detail.'
3) PREGNANCY BEFORE JOINING (CURRENTLY / PLANNING IN COMING FEW THREE (3) MONTHS)?'.(!empty($pregnancy_detail) ? '/' : ' ' ).''.(empty($pregnancy_detail) ? '/' : ' ' ).''.$pregnancy_detail.'
4) ARE YOU WILLING TO TRANSFER TO A NEW DEPARTMENT OR COMPANY IF THE OPPORTUNITY ARISES? (with relocation)'.(($willingToTransferWithrelocation=="yes") ? '/' : ' ').''.(($willingToTransferWithrelocation=="no") ? '/' : ' ').' 
4) ARE YOU WILLING TO TRANSFER TO A NEW DEPARTMENT OR COMPANY IF THE OPPORTUNITY ARISES? (without relocation)'.(($willingToTransferWithoutrelocation=="yes") ? '/' : ' ').''.(($willingToTransferWithoutrelocation=="no") ? '/' : ' ').' 
5) HAVE YOU EVER BEEN DISMISSED, DISCHARGED, OR LAID OFF FROM ANY EMPLOYMENT?'.(!empty($dismissed_detail) ? '/' : ' ' ).''.(empty($dismissed_detail) ? '/' : ' ' ).''.$dismissed_detail.'
6) HAVE YOU EVER BEEN CHARGED IN A COURT LAW?'.(!empty($court_detail) ? '/' : ' ' ).''.(empty($court_detail) ? '/' : ' ' ).''.$court_detail.'
7) HAVE YOU BEEN DECLARED BANKRUPTCY?'.(($bankruptcy=="yes") ? '/' : ' ').''.(($bankruptcy=="no") ? '/' : ' ').' 
8) CURRENTLY EXPERIENCING ANY FINANCIAL DIFFICULTIES?'.(!empty($finance_detail) ? '/' : ' ' ).''.(empty($finance_detail) ? '/' : ' ' ).''.$finance_detail.'
9) HAVE YOU APPLIED TO OUR COMPANY BEFORE?'.(($applied_detail=="yes") ? '/' : ' ').''.(($applied_detail=="no") ? '/' : ' ').' 
10) TRADE DISPUTE WITH PREVIOUS EMPLOYERS?'.(!empty($dispute_detail) ? '/' : ' ' ).''.(empty($dispute_detail) ? '/' : ' ' ).''.$dispute_detail.'
11) OWN A CAR OR MOTORCYCLE?'.(($vehicle=="yes") ? '/' : ' ').''.(($vehicle=="no") ? '/' : ' ').' 
12) WILLING TO WORK OVERTIME?'.(($overtime=="yes") ? '/' : ' ').''.(($overtime=="no") ? '/' : ' ').' 
13) HAVE ANY PART-TIME JOB OR SIDE BUSINESS?'.(!empty($other_job_detail) ? '/' : ' ' ).''.(empty($other_job_detail) ? '/' : ' ' ).''.$other_job_detail.'
14) WHAT ATTRACTED YOU TO THIS CAREER OPPORTUNITY?  '.$attract.'
15) WHAT ARE YOUR CAREER GOALS IN 5 YEARS?  '.$career_plan.'
+ + + +  +  + + + + + + + + +
+ REFERENCES +
+ + + + + + + + + + + + + + + + + + + + + + +
NamePosition/CompanyContact NumberYears Known
'.$array_reference[0]['name'].''.$array_reference[0]['position'].''.$array_reference[0]['contacts'].''.$array_reference[0]['year'].'
'.$array_reference[1]['name'].''.$array_reference[1]['position'].''.$array_reference[1]['contacts'].''.$array_reference[1]['year'].'
+ + + +  +  + + + + + + + + + + + + + + + + + + + +
Resignation notice period: '.$personality['notice'].' + Expected Salary:'.$salary['expected_salary'].'

I certify that the statement is correct. I understand that any false information (for omissions) in this application or its supporting documents, will be sufficient grounds for refusal to hire me or termination without notice. I further understand that the M&R Group of Companies has the right to review and investigate my previous employment, criminal records and other background data.
 
Applicant’s signature:Date:'.date('d/m/Y', strtotime($application_signature_date)).'
+ + + + +  +  + + + + + + + + +
+ FOR OFFICE USE ONLY +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ REMUNERATION DETAILS (HUMAN RESOURCE DEPT) +
Employee No +

+ +
Employee Code +

+ +
Basic Salary +

+ +
Department +

+ +
Designation +

+ +
Date Joined +

+ +
Shift +

+ +
Location +

+ +
Interview by, +




+ HOD (s) +
Name +




+ '.$int_det_interviewer_name.' +
Position +




+ '.$int_det_interviewer_con['int_position'].' +
Signature +
+ '.($int_det_interviewer_con['sign']!='' ? '' : '').' +
Verify by, +




+ HUMAN RESOURCES +
Name +




+ '.$int_det_verifier_name.' +
Position +




+ '.$int_det_verifier_con['verify_position'].' +
Signature +
+ '.($int_det_verifier_con['verify_sign']!='' ? '' : '' ).' +
Approve by, +




+ DIRECTOR +
Name +




+ '.$int_det_approver_name.' +
Position +




+ '.$int_det_approver_con['approve_position'].' +
Signature +
+ '.($int_det_verifier_con['verify_sign']!='' ? '' : '').' +
+ + + + +  +  + + + + + + + + +
+ FOR OFFICE USE ONLY +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ INTERVIEW ASSESSMENT +
Attribute + Tick which is applicable +
Excellent + Very Good + Good + Poor +
Appearance (professional dress, grooming) + '.($int_det_question_con['q1'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q1'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q1'] == 'Good' ? '/': '').' + '.($int_det_question_con['q1'] == 'Poor' ? '/': '').' +
Poise, self-confidence, 1st impression + '.($int_det_question_con['q2'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q2'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q2'] == 'Good' ? '/': '').' + '.($int_det_question_con['q2'] == 'Poor' ? '/': '').' +
Verbal communication skills (articulate, clear) + '.($int_det_question_con['q3'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q3'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q3'] == 'Good' ? '/': '').' + '.($int_det_question_con['q3'] == 'Poor' ? '/': '').' +
Listening ability and non-verbal communication + '.($int_det_question_con['q4'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q4'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q4'] == 'Good' ? '/': '').' + '.($int_det_question_con['q4'] == 'Poor' ? '/': '').' +
Clarity of career interests and goals + '.($int_det_question_con['q5'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q5'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q5'] == 'Good' ? '/': '').' + '.($int_det_question_con['q5'] == 'Poor' ? '/': '').' +
Ability to link prior work experience to position + '.($int_det_question_con['q6'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q6'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q6'] == 'Good' ? '/': '').' + '.($int_det_question_con['q6'] == 'Poor' ? '/': '').' +
Knowledge of industry + '.($int_det_question_con['q7'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q7'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q7'] == 'Good' ? '/': '').' + '.($int_det_question_con['q7'] == 'Poor' ? '/': '').' +
Preparation for interview + '.($int_det_question_con['q8'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q8'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q8'] == 'Good' ? '/': '').' + '.($int_det_question_con['q8'] == 'Poor' ? '/': '').' +
Quality of questions + '.($int_det_question_con['q9'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q9'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q9'] == 'Good' ? '/': '').' + '.($int_det_question_con['q9'] == 'Poor' ? '/': '').' +
Interest in & enthusiasm toward opportunity + '.($int_det_question_con['q10'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q10'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q10'] == 'Good' ? '/': '').' + '.($int_det_question_con['q10'] == 'Poor' ? '/': '').' +
Strength of competence / skills for position / work + '.($int_det_question_con['q11'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q11'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q11'] == 'Good' ? '/': '').' + '.($int_det_question_con['q11'] == 'Poor' ? '/': '').' +
Overall impression of candidate’s performance + '.($int_det_question_con['q12'] == 'Excellent' ? '/': '').' + '.($int_det_question_con['q12'] == 'Very Good' ? '/': '').' + '.($int_det_question_con['q12'] == 'Good' ? '/': '').' + '.($int_det_question_con['q12'] == 'Poor' ? '/': '').' +
Recommended pay + '.($int_det_question_con['q13'] != '' ? $int_det_question_con['q13'] : '').' +
Probationary Period months + + 03 / 06 / 12 month +
Result + + Suitable / Not Suitable / To be considered for future assignments +
Recommendations / high lights of the interview + + '.($int_det_question_con['q16'] != '' ? $int_det_question_con['q16'] : '').' +
+ + + + ' ; +?> diff --git a/HR/letter-terminate.php b/HR/letter-terminate.php new file mode 100644 index 0000000..a18b474 --- /dev/null +++ b/HR/letter-terminate.php @@ -0,0 +1,49 @@ + + + +
 
+ + '.$employment_terminate_date.' + +
 
+ + Dear '.$new_worker.' + +
 
+ +
 
+ + Re: Termination Letter + +
 
+ + This letter confirms our discussion today that your employment with '.$letter_head['name'].' is terminated on '.$employment_terminate_date.'. + +
 
+ + We regret to say that you have not come up to our expectations and that your performance has been unsatisfactory. The management has therefore decided to relieve you of your services with immediate effect. + +
 
+ + A meeting was conducted on (specify the date) and we discussed (give reasons of termination). Based on the reviews of the comments and the unsatisfactory performance you are requested to please hand over charge on (date). + +
 
+ + Thank you for your time at '.$letter_head['name'].' and wish you luck in finding new employment. + +
 
 
 
+ + Yours faithfully, +







+ + + + + + +
'.$assign_by_position.'
'.$assign_by.'
+ +' ; +?> \ No newline at end of file diff --git a/HR/salary-data.php b/HR/salary-data.php new file mode 100644 index 0000000..56ea85c --- /dev/null +++ b/HR/salary-data.php @@ -0,0 +1,357 @@ +query($mysqli_query." ORDER BY " . $sort_by . ' ' . $sort_by_type . " LIMIT $start_from, " . $limit ) ; + + // print_r($mysqli_query." ORDER BY " . $sort_by . ' ' . $sort_by_type . " LIMIT $start_from, " . LIMIT);exit; + // set search url + $search_url = 'page='.$page.'&page_mode='.$_GET['page_mode'].'&edit='.$_GET['edit'].'&date_time='.$_GET['date_time'].'&search_name='.$_GET['search_name'].'&search_idno='.$_GET['search_idno'].'&search_branch='.$_GET['search_branch'].'&sort_by='.$_GET['sort_by'].'&sort_by_type='.$_GET['sort_by_type'] ; + + // load pagination + + $page_pagination = nextPrevious($product_page, $limit, $search_url, $mysqli_query) ; + +}else{ + + $mysqli_query = "SELECT a.*, b.staff_idno, b.staff_name FROM salary_slip a + JOIN staff b ON (a.staff_id = b.staff_id) + WHERE a.month = '$date_time_month' AND a.deleted_at IS NULL ". $search_query. $user_branch_permission_sql_b ; + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY a.staff_id") ; +} + + + +$salary_slip = []; +if(mysqli_num_rows($mysqli_page) > 0){ + while($row = mysqli_fetch_assoc($mysqli_page)){ + $salary_slip[$row['slip_id']] = $row; + } +} + + +//export excel +if($export == 'yes'){ + + include 'PhpExcel/PHPExcel.php' ; + + // set excel content + $page_filename = 'Staff Salary - '.date( 'Ymd', time() ) ; + $objPHPExcel = new PHPExcel() ; + $objPHPExcel->getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + $styleArrayTitle = array( + 'font' => array( + 'bold' => true , + 'color' => array( 'rgb' => '000000' ) , + 'size' => 15 + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ); + + $styleArrayTitle2 = array( + 'font' => array( + 'bold' => true , + 'color' => array( 'rgb' => '000000' ) , + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ); + + $styleArrayBg1 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'AFABAB') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayBg2 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'FFDA65') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArray = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayLeft = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT, + ) + ) ; + + $styleArrayRed = array( + 'font' => array( + 'bold' => true , + 'color' => array( 'rgb' => '000000' ) , + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'FFC0CB') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ); + + $styleArrayYellow = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'FFFFB1') + ), + ); + + $styleArrayPink = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'FFD8F1') + ), + ); + + $styleArraySmoke = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'F9F1F0') + ), + ); + + $styleArrayGreen = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'ddf7e3') + ), + ); + + $styleArrayYellowGreen = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'FAFBF4') + ), + ); + + $count = 1 ; + $firstChar = 'A' ; + $lastChar = "Q"; + + // title name + $objPHPExcel->getActiveSheet()->mergeCells( $firstChar.$count.':'.$lastChar.$count ) ; + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count.':'.$lastChar.$count )->applyFromArray( $styleArrayTitle ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, 'Staff Salary '.$date_time ) ; + $count++ ; + $count++ ; + + $array_title = array( 'No.', 'ID', 'Staff Name', "Basic Salary\r(RM)", "Commission\r(RM)", "Allowance\r(RM)", "Deduction\r- (RM)", "Subtotal\r(RM)", "EPF\r- (RM)", "SOCSO\r- (RM)", "EIS\r- (RM)", "MZF\r- (RM)", "PCB\r- (RM)", "Total\r(RM)", "Employer EPF\r(RM)", "Employer SOCSO\r(RM)", "Employer EIS\r(RM)") ; + + + foreach($array_title as $k => $v){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, $v ) ; + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArrayTitle2 ) ; + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->getAlignment()->setWrapText(true); + if($firstChar >= 'D' && $firstChar <= 'G'){ + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArrayYellow ) ; + }else if($firstChar == 'H'){ + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArrayPink ) ; + }else if($firstChar >= 'I' && $firstChar <= 'M'){ + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArraySmoke ) ; + }else if($firstChar == 'N'){ + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArrayGreen ) ; + }else if($firstChar >= 'O'){ + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArrayYellowGreen ) ; + } + $firstChar++; + } + + if(count($salary_slip) > 0){ + $counter = 0; + $total_salary = $total_em_epf = $total_em_socso = $total_em_eis = 0; + foreach($salary_slip as $key => $value){ + $firstChar = 'A'; + $counter ++ ; + $count ++ ; + $array_content = array($counter, $value['staff_idno'], $value['staff_name'], $value['basic_salary'], $value['commission'], $value['allowance'], $value['deduction'], $value['sub_total'], $value['staff_epf'], $value['staff_socso'], $value['staff_eis'], $value['staff_zakat'], $value['staff_pcb'], $value['total'], $value['employer_epf'], $value['employer_socso'], $value['employer_eis']); + $total_salary += $value['total']; + $total_em_epf += $value['employer_epf']; + $total_em_socso += $value['employer_socso']; + $total_em_eis += $value['employer_eis']; + foreach($array_content as $key2 => $value2){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, $value2 ) ; + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArray ) ; + if($firstChar >= 'D' && $firstChar <= 'G'){ + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArrayYellow ) ; + }else if($firstChar == 'H'){ + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArrayPink ) ; + }else if($firstChar >= 'I' && $firstChar <= 'M'){ + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArraySmoke ) ; + }else if($firstChar == 'N'){ + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArrayGreen ) ; + }else if($firstChar >= 'O'){ + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArrayYellowGreen ) ; + } + $firstChar++; + } + } + + $count++; + $count++; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( 'N'.$count, 'Total Salary' ) ; + $objPHPExcel->getActiveSheet()->getStyle( 'N'.$count )->applyFromArray( $styleArrayRed ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( 'O'.$count, "Total\rEmployer EPF" ) ; + $objPHPExcel->getActiveSheet()->getStyle( 'O'.$count )->applyFromArray( $styleArrayRed ) ; + $objPHPExcel->getActiveSheet()->getStyle( 'O'.$count )->getAlignment()->setWrapText(true); + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( 'P'.$count, "Total\rEmployer SOCSO" ) ; + $objPHPExcel->getActiveSheet()->getStyle( 'P'.$count )->applyFromArray( $styleArrayRed ) ; + $objPHPExcel->getActiveSheet()->getStyle( 'P'.$count )->getAlignment()->setWrapText(true); + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( 'Q'.$count, "Total\rEmployer EIS" ) ; + $objPHPExcel->getActiveSheet()->getStyle( 'Q'.$count )->applyFromArray( $styleArrayRed ) ; + $objPHPExcel->getActiveSheet()->getStyle( 'Q'.$count )->getAlignment()->setWrapText(true); + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( 'R'.$count, 'GRAND TOTAL' ) ; + $objPHPExcel->getActiveSheet()->getStyle( 'R'.$count )->applyFromArray( $styleArrayRed ) ; + + $grand_total = $total_salary + $total_em_epf + $total_em_socso + $total_em_eis; + + $count++; + $firstChar = 'A'; + $array_footer = array('', '', '', '', '', '', '', '', '', '', '', '', '', $total_salary, $total_em_epf, $total_em_socso, $total_em_eis, $grand_total); + foreach($array_footer as $kk => $vv){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, $vv ) ; + if($firstChar >= 'N'){ + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count )->applyFromArray( $styleArrayRed ) ; + } + $firstChar++; + } + } + + $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(4); + $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(7); + $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(20); + $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(12); + $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(12); + $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(10); + $objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(10); + $objPHPExcel->getActiveSheet()->getColumnDimension('H')->setWidth(12); + $objPHPExcel->getActiveSheet()->getColumnDimension('I')->setWidth(10); + $objPHPExcel->getActiveSheet()->getColumnDimension('J')->setWidth(8); + $objPHPExcel->getActiveSheet()->getColumnDimension('K')->setWidth(8); + $objPHPExcel->getActiveSheet()->getColumnDimension('L')->setWidth(9); + $objPHPExcel->getActiveSheet()->getColumnDimension('M')->setWidth(11); + $objPHPExcel->getActiveSheet()->getColumnDimension('N')->setWidth(12); + $objPHPExcel->getActiveSheet()->getColumnDimension('O')->setWidth(15); + $objPHPExcel->getActiveSheet()->getColumnDimension('P')->setWidth(15); + $objPHPExcel->getActiveSheet()->getColumnDimension('Q')->setWidth(15); + $objPHPExcel->getActiveSheet()->getColumnDimension('R')->setWidth(15); + + + + + // Submission from + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; + +} + + + +?> \ No newline at end of file diff --git a/__MACOSX/._MPDF b/__MACOSX/._MPDF new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/._MPDF differ diff --git a/__MACOSX/MPDF/._CHANGELOG.txt b/__MACOSX/MPDF/._CHANGELOG.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._CHANGELOG.txt differ diff --git a/__MACOSX/MPDF/._CHANGES 5.7.3.txt b/__MACOSX/MPDF/._CHANGES 5.7.3.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._CHANGES 5.7.3.txt differ diff --git a/__MACOSX/MPDF/._CHANGES 5.7.4.txt b/__MACOSX/MPDF/._CHANGES 5.7.4.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._CHANGES 5.7.4.txt differ diff --git a/__MACOSX/MPDF/._CREDITS.txt b/__MACOSX/MPDF/._CREDITS.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._CREDITS.txt differ diff --git a/__MACOSX/MPDF/._FONT INFO.txt b/__MACOSX/MPDF/._FONT INFO.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._FONT INFO.txt differ diff --git a/__MACOSX/MPDF/._LICENSE.txt b/__MACOSX/MPDF/._LICENSE.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._LICENSE.txt differ diff --git a/__MACOSX/MPDF/._README.txt b/__MACOSX/MPDF/._README.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._README.txt differ diff --git a/__MACOSX/MPDF/._classes b/__MACOSX/MPDF/._classes new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._classes differ diff --git a/__MACOSX/MPDF/._collations b/__MACOSX/MPDF/._collations new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._collations differ diff --git a/__MACOSX/MPDF/._compress.php b/__MACOSX/MPDF/._compress.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._compress.php differ diff --git a/__MACOSX/MPDF/._config.php b/__MACOSX/MPDF/._config.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._config.php differ diff --git a/__MACOSX/MPDF/._config_cp.php b/__MACOSX/MPDF/._config_cp.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._config_cp.php differ diff --git a/__MACOSX/MPDF/._config_fonts-distr-without-OTL.php b/__MACOSX/MPDF/._config_fonts-distr-without-OTL.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._config_fonts-distr-without-OTL.php differ diff --git a/__MACOSX/MPDF/._config_fonts.php b/__MACOSX/MPDF/._config_fonts.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._config_fonts.php differ diff --git a/__MACOSX/MPDF/._config_lang2fonts.php b/__MACOSX/MPDF/._config_lang2fonts.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._config_lang2fonts.php differ diff --git a/__MACOSX/MPDF/._config_script2lang.php b/__MACOSX/MPDF/._config_script2lang.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._config_script2lang.php differ diff --git a/__MACOSX/MPDF/._examples b/__MACOSX/MPDF/._examples new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._examples differ diff --git a/__MACOSX/MPDF/._font b/__MACOSX/MPDF/._font new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._font differ diff --git a/__MACOSX/MPDF/._graph.php b/__MACOSX/MPDF/._graph.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._graph.php differ diff --git a/__MACOSX/MPDF/._graph_cache b/__MACOSX/MPDF/._graph_cache new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._graph_cache differ diff --git a/__MACOSX/MPDF/._iccprofiles b/__MACOSX/MPDF/._iccprofiles new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._iccprofiles differ diff --git a/__MACOSX/MPDF/._includes b/__MACOSX/MPDF/._includes new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._includes differ diff --git a/__MACOSX/MPDF/._lang2fonts.css b/__MACOSX/MPDF/._lang2fonts.css new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._lang2fonts.css differ diff --git a/__MACOSX/MPDF/._mpdf.css b/__MACOSX/MPDF/._mpdf.css new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._mpdf.css differ diff --git a/__MACOSX/MPDF/._mpdf.php b/__MACOSX/MPDF/._mpdf.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._mpdf.php differ diff --git a/__MACOSX/MPDF/._mpdfi b/__MACOSX/MPDF/._mpdfi new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._mpdfi differ diff --git a/__MACOSX/MPDF/._patterns b/__MACOSX/MPDF/._patterns new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._patterns differ diff --git a/__MACOSX/MPDF/._progbar.css b/__MACOSX/MPDF/._progbar.css new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._progbar.css differ diff --git a/__MACOSX/MPDF/._qrcode b/__MACOSX/MPDF/._qrcode new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._qrcode differ diff --git a/__MACOSX/MPDF/._tmp b/__MACOSX/MPDF/._tmp new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._tmp differ diff --git a/__MACOSX/MPDF/._ttfontdata b/__MACOSX/MPDF/._ttfontdata new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._ttfontdata differ diff --git a/__MACOSX/MPDF/._ttfonts b/__MACOSX/MPDF/._ttfonts new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._ttfonts differ diff --git a/__MACOSX/MPDF/._utils b/__MACOSX/MPDF/._utils new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/._utils differ diff --git a/__MACOSX/MPDF/classes/._barcode.php b/__MACOSX/MPDF/classes/._barcode.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._barcode.php differ diff --git a/__MACOSX/MPDF/classes/._bmp.php b/__MACOSX/MPDF/classes/._bmp.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._bmp.php differ diff --git a/__MACOSX/MPDF/classes/._cssmgr.php b/__MACOSX/MPDF/classes/._cssmgr.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._cssmgr.php differ diff --git a/__MACOSX/MPDF/classes/._desktop.ini b/__MACOSX/MPDF/classes/._desktop.ini new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._desktop.ini differ diff --git a/__MACOSX/MPDF/classes/._directw.php b/__MACOSX/MPDF/classes/._directw.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._directw.php differ diff --git a/__MACOSX/MPDF/classes/._form.php b/__MACOSX/MPDF/classes/._form.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._form.php differ diff --git a/__MACOSX/MPDF/classes/._gif.php b/__MACOSX/MPDF/classes/._gif.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._gif.php differ diff --git a/__MACOSX/MPDF/classes/._grad.php b/__MACOSX/MPDF/classes/._grad.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._grad.php differ diff --git a/__MACOSX/MPDF/classes/._indic.php b/__MACOSX/MPDF/classes/._indic.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._indic.php differ diff --git a/__MACOSX/MPDF/classes/._meter.php b/__MACOSX/MPDF/classes/._meter.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._meter.php differ diff --git a/__MACOSX/MPDF/classes/._mpdfform.php b/__MACOSX/MPDF/classes/._mpdfform.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._mpdfform.php differ diff --git a/__MACOSX/MPDF/classes/._myanmar.php b/__MACOSX/MPDF/classes/._myanmar.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._myanmar.php differ diff --git a/__MACOSX/MPDF/classes/._otl.php b/__MACOSX/MPDF/classes/._otl.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._otl.php differ diff --git a/__MACOSX/MPDF/classes/._otl_dump.php b/__MACOSX/MPDF/classes/._otl_dump.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._otl_dump.php differ diff --git a/__MACOSX/MPDF/classes/._sea.php b/__MACOSX/MPDF/classes/._sea.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._sea.php differ diff --git a/__MACOSX/MPDF/classes/._svg.php b/__MACOSX/MPDF/classes/._svg.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._svg.php differ diff --git a/__MACOSX/MPDF/classes/._tocontents.php b/__MACOSX/MPDF/classes/._tocontents.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._tocontents.php differ diff --git a/__MACOSX/MPDF/classes/._ttfontsuni.php b/__MACOSX/MPDF/classes/._ttfontsuni.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._ttfontsuni.php differ diff --git a/__MACOSX/MPDF/classes/._ttfontsuni_analysis.php b/__MACOSX/MPDF/classes/._ttfontsuni_analysis.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._ttfontsuni_analysis.php differ diff --git a/__MACOSX/MPDF/classes/._ucdn.php b/__MACOSX/MPDF/classes/._ucdn.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._ucdn.php differ diff --git a/__MACOSX/MPDF/classes/._wmf.php b/__MACOSX/MPDF/classes/._wmf.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/classes/._wmf.php differ diff --git a/__MACOSX/MPDF/collations/._Afrikaans_South_Africa.php b/__MACOSX/MPDF/collations/._Afrikaans_South_Africa.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Afrikaans_South_Africa.php differ diff --git a/__MACOSX/MPDF/collations/._Albanian_Albania.php b/__MACOSX/MPDF/collations/._Albanian_Albania.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Albanian_Albania.php differ diff --git a/__MACOSX/MPDF/collations/._Alsatian_France.php b/__MACOSX/MPDF/collations/._Alsatian_France.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Alsatian_France.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Algeria.php b/__MACOSX/MPDF/collations/._Arabic_Algeria.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Algeria.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Bahrain.php b/__MACOSX/MPDF/collations/._Arabic_Bahrain.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Bahrain.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Egypt.php b/__MACOSX/MPDF/collations/._Arabic_Egypt.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Egypt.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Iraq.php b/__MACOSX/MPDF/collations/._Arabic_Iraq.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Iraq.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Jordan.php b/__MACOSX/MPDF/collations/._Arabic_Jordan.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Jordan.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Kuwait.php b/__MACOSX/MPDF/collations/._Arabic_Kuwait.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Kuwait.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Lebanon.php b/__MACOSX/MPDF/collations/._Arabic_Lebanon.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Lebanon.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Libya.php b/__MACOSX/MPDF/collations/._Arabic_Libya.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Libya.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Morocco.php b/__MACOSX/MPDF/collations/._Arabic_Morocco.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Morocco.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Oman.php b/__MACOSX/MPDF/collations/._Arabic_Oman.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Oman.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Pseudo_RTL.php b/__MACOSX/MPDF/collations/._Arabic_Pseudo_RTL.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Pseudo_RTL.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Qatar.php b/__MACOSX/MPDF/collations/._Arabic_Qatar.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Qatar.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Saudi_Arabia.php b/__MACOSX/MPDF/collations/._Arabic_Saudi_Arabia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Saudi_Arabia.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Syria.php b/__MACOSX/MPDF/collations/._Arabic_Syria.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Syria.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Tunisia.php b/__MACOSX/MPDF/collations/._Arabic_Tunisia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Tunisia.php differ diff --git a/__MACOSX/MPDF/collations/._Arabic_Yemen.php b/__MACOSX/MPDF/collations/._Arabic_Yemen.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Arabic_Yemen.php differ diff --git a/__MACOSX/MPDF/collations/._Azeri_(Cyrillic)_Azerbaijan.php b/__MACOSX/MPDF/collations/._Azeri_(Cyrillic)_Azerbaijan.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Azeri_(Cyrillic)_Azerbaijan.php differ diff --git a/__MACOSX/MPDF/collations/._Azeri_(Latin)_Azerbaijan.php b/__MACOSX/MPDF/collations/._Azeri_(Latin)_Azerbaijan.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Azeri_(Latin)_Azerbaijan.php differ diff --git a/__MACOSX/MPDF/collations/._Bashkir_Russia.php b/__MACOSX/MPDF/collations/._Bashkir_Russia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Bashkir_Russia.php differ diff --git a/__MACOSX/MPDF/collations/._Basque_Spain.php b/__MACOSX/MPDF/collations/._Basque_Spain.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Basque_Spain.php differ diff --git a/__MACOSX/MPDF/collations/._Belarusian_Belarus.php b/__MACOSX/MPDF/collations/._Belarusian_Belarus.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Belarusian_Belarus.php differ diff --git a/__MACOSX/MPDF/collations/._Bosnian_(Cyrillic)_Bosnia_and_Herzegovina.php b/__MACOSX/MPDF/collations/._Bosnian_(Cyrillic)_Bosnia_and_Herzegovina.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Bosnian_(Cyrillic)_Bosnia_and_Herzegovina.php differ diff --git a/__MACOSX/MPDF/collations/._Bosnian_(Latin)_Bosnia_and_Herzegovina.php b/__MACOSX/MPDF/collations/._Bosnian_(Latin)_Bosnia_and_Herzegovina.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Bosnian_(Latin)_Bosnia_and_Herzegovina.php differ diff --git a/__MACOSX/MPDF/collations/._Breton_France.php b/__MACOSX/MPDF/collations/._Breton_France.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Breton_France.php differ diff --git a/__MACOSX/MPDF/collations/._Bulgarian_Bulgaria.php b/__MACOSX/MPDF/collations/._Bulgarian_Bulgaria.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Bulgarian_Bulgaria.php differ diff --git a/__MACOSX/MPDF/collations/._Catalan_Spain.php b/__MACOSX/MPDF/collations/._Catalan_Spain.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Catalan_Spain.php differ diff --git a/__MACOSX/MPDF/collations/._Corsican_France.php b/__MACOSX/MPDF/collations/._Corsican_France.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Corsican_France.php differ diff --git a/__MACOSX/MPDF/collations/._Croatian_(Latin)_Bosnia_and_Herzegovina.php b/__MACOSX/MPDF/collations/._Croatian_(Latin)_Bosnia_and_Herzegovina.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Croatian_(Latin)_Bosnia_and_Herzegovina.php differ diff --git a/__MACOSX/MPDF/collations/._Croatian_Croatia.php b/__MACOSX/MPDF/collations/._Croatian_Croatia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Croatian_Croatia.php differ diff --git a/__MACOSX/MPDF/collations/._Czech_Czech_Republic.php b/__MACOSX/MPDF/collations/._Czech_Czech_Republic.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Czech_Czech_Republic.php differ diff --git a/__MACOSX/MPDF/collations/._Danish_Denmark.php b/__MACOSX/MPDF/collations/._Danish_Denmark.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Danish_Denmark.php differ diff --git a/__MACOSX/MPDF/collations/._Dari_Afghanistan.php b/__MACOSX/MPDF/collations/._Dari_Afghanistan.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Dari_Afghanistan.php differ diff --git a/__MACOSX/MPDF/collations/._Dutch_Belgium.php b/__MACOSX/MPDF/collations/._Dutch_Belgium.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Dutch_Belgium.php differ diff --git a/__MACOSX/MPDF/collations/._Dutch_Netherlands.php b/__MACOSX/MPDF/collations/._Dutch_Netherlands.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Dutch_Netherlands.php differ diff --git a/__MACOSX/MPDF/collations/._English_Australia.php b/__MACOSX/MPDF/collations/._English_Australia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_Australia.php differ diff --git a/__MACOSX/MPDF/collations/._English_Belize.php b/__MACOSX/MPDF/collations/._English_Belize.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_Belize.php differ diff --git a/__MACOSX/MPDF/collations/._English_Canada.php b/__MACOSX/MPDF/collations/._English_Canada.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_Canada.php differ diff --git a/__MACOSX/MPDF/collations/._English_Caribbean.php b/__MACOSX/MPDF/collations/._English_Caribbean.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_Caribbean.php differ diff --git a/__MACOSX/MPDF/collations/._English_India.php b/__MACOSX/MPDF/collations/._English_India.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_India.php differ diff --git a/__MACOSX/MPDF/collations/._English_Ireland.php b/__MACOSX/MPDF/collations/._English_Ireland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_Ireland.php differ diff --git a/__MACOSX/MPDF/collations/._English_Jamaica.php b/__MACOSX/MPDF/collations/._English_Jamaica.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_Jamaica.php differ diff --git a/__MACOSX/MPDF/collations/._English_Malaysia.php b/__MACOSX/MPDF/collations/._English_Malaysia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_Malaysia.php differ diff --git a/__MACOSX/MPDF/collations/._English_New_Zealand.php b/__MACOSX/MPDF/collations/._English_New_Zealand.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_New_Zealand.php differ diff --git a/__MACOSX/MPDF/collations/._English_Republic_of_the_Philippines.php b/__MACOSX/MPDF/collations/._English_Republic_of_the_Philippines.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_Republic_of_the_Philippines.php differ diff --git a/__MACOSX/MPDF/collations/._English_Singapore.php b/__MACOSX/MPDF/collations/._English_Singapore.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_Singapore.php differ diff --git a/__MACOSX/MPDF/collations/._English_South_Africa.php b/__MACOSX/MPDF/collations/._English_South_Africa.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_South_Africa.php differ diff --git a/__MACOSX/MPDF/collations/._English_Trinidad_and_Tobago.php b/__MACOSX/MPDF/collations/._English_Trinidad_and_Tobago.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_Trinidad_and_Tobago.php differ diff --git a/__MACOSX/MPDF/collations/._English_United_Kingdom.php b/__MACOSX/MPDF/collations/._English_United_Kingdom.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_United_Kingdom.php differ diff --git a/__MACOSX/MPDF/collations/._English_United_States.php b/__MACOSX/MPDF/collations/._English_United_States.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_United_States.php differ diff --git a/__MACOSX/MPDF/collations/._English_Zimbabwe.php b/__MACOSX/MPDF/collations/._English_Zimbabwe.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._English_Zimbabwe.php differ diff --git a/__MACOSX/MPDF/collations/._Estonian_Estonia.php b/__MACOSX/MPDF/collations/._Estonian_Estonia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Estonian_Estonia.php differ diff --git a/__MACOSX/MPDF/collations/._Faroese_Faroe_Islands.php b/__MACOSX/MPDF/collations/._Faroese_Faroe_Islands.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Faroese_Faroe_Islands.php differ diff --git a/__MACOSX/MPDF/collations/._Filipino_Philippines.php b/__MACOSX/MPDF/collations/._Filipino_Philippines.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Filipino_Philippines.php differ diff --git a/__MACOSX/MPDF/collations/._Finnish_Finland.php b/__MACOSX/MPDF/collations/._Finnish_Finland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Finnish_Finland.php differ diff --git a/__MACOSX/MPDF/collations/._French_Belgium.php b/__MACOSX/MPDF/collations/._French_Belgium.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._French_Belgium.php differ diff --git a/__MACOSX/MPDF/collations/._French_Canada.php b/__MACOSX/MPDF/collations/._French_Canada.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._French_Canada.php differ diff --git a/__MACOSX/MPDF/collations/._French_France.php b/__MACOSX/MPDF/collations/._French_France.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._French_France.php differ diff --git a/__MACOSX/MPDF/collations/._French_Luxembourg.php b/__MACOSX/MPDF/collations/._French_Luxembourg.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._French_Luxembourg.php differ diff --git a/__MACOSX/MPDF/collations/._French_Principality_of_Monaco.php b/__MACOSX/MPDF/collations/._French_Principality_of_Monaco.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._French_Principality_of_Monaco.php differ diff --git a/__MACOSX/MPDF/collations/._French_Switzerland.php b/__MACOSX/MPDF/collations/._French_Switzerland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._French_Switzerland.php differ diff --git a/__MACOSX/MPDF/collations/._Frisian_Netherlands.php b/__MACOSX/MPDF/collations/._Frisian_Netherlands.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Frisian_Netherlands.php differ diff --git a/__MACOSX/MPDF/collations/._Galician_Spain.php b/__MACOSX/MPDF/collations/._Galician_Spain.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Galician_Spain.php differ diff --git a/__MACOSX/MPDF/collations/._German_Austria.php b/__MACOSX/MPDF/collations/._German_Austria.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._German_Austria.php differ diff --git a/__MACOSX/MPDF/collations/._German_Germany.php b/__MACOSX/MPDF/collations/._German_Germany.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._German_Germany.php differ diff --git a/__MACOSX/MPDF/collations/._German_Liechtenstein.php b/__MACOSX/MPDF/collations/._German_Liechtenstein.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._German_Liechtenstein.php differ diff --git a/__MACOSX/MPDF/collations/._German_Luxembourg.php b/__MACOSX/MPDF/collations/._German_Luxembourg.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._German_Luxembourg.php differ diff --git a/__MACOSX/MPDF/collations/._German_Switzerland.php b/__MACOSX/MPDF/collations/._German_Switzerland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._German_Switzerland.php differ diff --git a/__MACOSX/MPDF/collations/._Greek_Greece.php b/__MACOSX/MPDF/collations/._Greek_Greece.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Greek_Greece.php differ diff --git a/__MACOSX/MPDF/collations/._Greenlandic_Greenland.php b/__MACOSX/MPDF/collations/._Greenlandic_Greenland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Greenlandic_Greenland.php differ diff --git a/__MACOSX/MPDF/collations/._Hausa_(Latin)_Nigeria.php b/__MACOSX/MPDF/collations/._Hausa_(Latin)_Nigeria.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Hausa_(Latin)_Nigeria.php differ diff --git a/__MACOSX/MPDF/collations/._Hebrew_Israel.php b/__MACOSX/MPDF/collations/._Hebrew_Israel.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Hebrew_Israel.php differ diff --git a/__MACOSX/MPDF/collations/._Hungarian_Hungary.php b/__MACOSX/MPDF/collations/._Hungarian_Hungary.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Hungarian_Hungary.php differ diff --git a/__MACOSX/MPDF/collations/._Icelandic_Iceland.php b/__MACOSX/MPDF/collations/._Icelandic_Iceland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Icelandic_Iceland.php differ diff --git a/__MACOSX/MPDF/collations/._Igbo_Nigeria.php b/__MACOSX/MPDF/collations/._Igbo_Nigeria.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Igbo_Nigeria.php differ diff --git a/__MACOSX/MPDF/collations/._Indonesian_Indonesia.php b/__MACOSX/MPDF/collations/._Indonesian_Indonesia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Indonesian_Indonesia.php differ diff --git a/__MACOSX/MPDF/collations/._Inuktitut_(Latin)_Canada.php b/__MACOSX/MPDF/collations/._Inuktitut_(Latin)_Canada.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Inuktitut_(Latin)_Canada.php differ diff --git a/__MACOSX/MPDF/collations/._Invariant_Language_Invariant_Country.php b/__MACOSX/MPDF/collations/._Invariant_Language_Invariant_Country.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Invariant_Language_Invariant_Country.php differ diff --git a/__MACOSX/MPDF/collations/._Irish_Ireland.php b/__MACOSX/MPDF/collations/._Irish_Ireland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Irish_Ireland.php differ diff --git a/__MACOSX/MPDF/collations/._Italian_Italy.php b/__MACOSX/MPDF/collations/._Italian_Italy.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Italian_Italy.php differ diff --git a/__MACOSX/MPDF/collations/._Italian_Switzerland.php b/__MACOSX/MPDF/collations/._Italian_Switzerland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Italian_Switzerland.php differ diff --git a/__MACOSX/MPDF/collations/._Kinyarwanda_Rwanda.php b/__MACOSX/MPDF/collations/._Kinyarwanda_Rwanda.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Kinyarwanda_Rwanda.php differ diff --git a/__MACOSX/MPDF/collations/._Kiswahili_Kenya.php b/__MACOSX/MPDF/collations/._Kiswahili_Kenya.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Kiswahili_Kenya.php differ diff --git a/__MACOSX/MPDF/collations/._Kyrgyz_Kyrgyzstan.php b/__MACOSX/MPDF/collations/._Kyrgyz_Kyrgyzstan.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Kyrgyz_Kyrgyzstan.php differ diff --git a/__MACOSX/MPDF/collations/._Latvian_Latvia.php b/__MACOSX/MPDF/collations/._Latvian_Latvia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Latvian_Latvia.php differ diff --git a/__MACOSX/MPDF/collations/._Lithuanian_Lithuania.php b/__MACOSX/MPDF/collations/._Lithuanian_Lithuania.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Lithuanian_Lithuania.php differ diff --git a/__MACOSX/MPDF/collations/._Lower_Sorbian_Germany.php b/__MACOSX/MPDF/collations/._Lower_Sorbian_Germany.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Lower_Sorbian_Germany.php differ diff --git a/__MACOSX/MPDF/collations/._Luxembourgish_Luxembourg.php b/__MACOSX/MPDF/collations/._Luxembourgish_Luxembourg.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Luxembourgish_Luxembourg.php differ diff --git a/__MACOSX/MPDF/collations/._Macedonian_(FYROM)_Macedonia_(FYROM).php b/__MACOSX/MPDF/collations/._Macedonian_(FYROM)_Macedonia_(FYROM).php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Macedonian_(FYROM)_Macedonia_(FYROM).php differ diff --git a/__MACOSX/MPDF/collations/._Malay_Brunei_Darussalam.php b/__MACOSX/MPDF/collations/._Malay_Brunei_Darussalam.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Malay_Brunei_Darussalam.php differ diff --git a/__MACOSX/MPDF/collations/._Malay_Malaysia.php b/__MACOSX/MPDF/collations/._Malay_Malaysia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Malay_Malaysia.php differ diff --git a/__MACOSX/MPDF/collations/._Mapudungun_Chile.php b/__MACOSX/MPDF/collations/._Mapudungun_Chile.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Mapudungun_Chile.php differ diff --git a/__MACOSX/MPDF/collations/._Mohawk_Canada.php b/__MACOSX/MPDF/collations/._Mohawk_Canada.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Mohawk_Canada.php differ diff --git a/__MACOSX/MPDF/collations/._Mongolian_(Cyrillic)_Mongolia.php b/__MACOSX/MPDF/collations/._Mongolian_(Cyrillic)_Mongolia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Mongolian_(Cyrillic)_Mongolia.php differ diff --git a/__MACOSX/MPDF/collations/._Norwegian_(Nynorsk)_Norway.php b/__MACOSX/MPDF/collations/._Norwegian_(Nynorsk)_Norway.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Norwegian_(Nynorsk)_Norway.php differ diff --git a/__MACOSX/MPDF/collations/._Occitan_France.php b/__MACOSX/MPDF/collations/._Occitan_France.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Occitan_France.php differ diff --git a/__MACOSX/MPDF/collations/._Persian_Iran.php b/__MACOSX/MPDF/collations/._Persian_Iran.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Persian_Iran.php differ diff --git a/__MACOSX/MPDF/collations/._Polish_Poland.php b/__MACOSX/MPDF/collations/._Polish_Poland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Polish_Poland.php differ diff --git a/__MACOSX/MPDF/collations/._Portuguese_Brazil.php b/__MACOSX/MPDF/collations/._Portuguese_Brazil.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Portuguese_Brazil.php differ diff --git a/__MACOSX/MPDF/collations/._Portuguese_Portugal.php b/__MACOSX/MPDF/collations/._Portuguese_Portugal.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Portuguese_Portugal.php differ diff --git a/__MACOSX/MPDF/collations/._Quechua_Bolivia.php b/__MACOSX/MPDF/collations/._Quechua_Bolivia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Quechua_Bolivia.php differ diff --git a/__MACOSX/MPDF/collations/._Quechua_Ecuador.php b/__MACOSX/MPDF/collations/._Quechua_Ecuador.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Quechua_Ecuador.php differ diff --git a/__MACOSX/MPDF/collations/._Quechua_Peru.php b/__MACOSX/MPDF/collations/._Quechua_Peru.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Quechua_Peru.php differ diff --git a/__MACOSX/MPDF/collations/._Romanian_Romania.php b/__MACOSX/MPDF/collations/._Romanian_Romania.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Romanian_Romania.php differ diff --git a/__MACOSX/MPDF/collations/._Romansh_Switzerland.php b/__MACOSX/MPDF/collations/._Romansh_Switzerland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Romansh_Switzerland.php differ diff --git a/__MACOSX/MPDF/collations/._Russian_Russia.php b/__MACOSX/MPDF/collations/._Russian_Russia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Russian_Russia.php differ diff --git a/__MACOSX/MPDF/collations/._Sami_(Inari)_Finland.php b/__MACOSX/MPDF/collations/._Sami_(Inari)_Finland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Sami_(Inari)_Finland.php differ diff --git a/__MACOSX/MPDF/collations/._Sami_(Lule)_Norway.php b/__MACOSX/MPDF/collations/._Sami_(Lule)_Norway.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Sami_(Lule)_Norway.php differ diff --git a/__MACOSX/MPDF/collations/._Sami_(Lule)_Sweden.php b/__MACOSX/MPDF/collations/._Sami_(Lule)_Sweden.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Sami_(Lule)_Sweden.php differ diff --git a/__MACOSX/MPDF/collations/._Sami_(Northern)_Finland.php b/__MACOSX/MPDF/collations/._Sami_(Northern)_Finland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Sami_(Northern)_Finland.php differ diff --git a/__MACOSX/MPDF/collations/._Sami_(Northern)_Norway.php b/__MACOSX/MPDF/collations/._Sami_(Northern)_Norway.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Sami_(Northern)_Norway.php differ diff --git a/__MACOSX/MPDF/collations/._Sami_(Northern)_Sweden.php b/__MACOSX/MPDF/collations/._Sami_(Northern)_Sweden.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Sami_(Northern)_Sweden.php differ diff --git a/__MACOSX/MPDF/collations/._Sami_(Skolt)_Finland.php b/__MACOSX/MPDF/collations/._Sami_(Skolt)_Finland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Sami_(Skolt)_Finland.php differ diff --git a/__MACOSX/MPDF/collations/._Sami_(Southern)_Norway.php b/__MACOSX/MPDF/collations/._Sami_(Southern)_Norway.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Sami_(Southern)_Norway.php differ diff --git a/__MACOSX/MPDF/collations/._Sami_(Southern)_Sweden.php b/__MACOSX/MPDF/collations/._Sami_(Southern)_Sweden.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Sami_(Southern)_Sweden.php differ diff --git a/__MACOSX/MPDF/collations/._Serbian_(Cyrillic)_Bosnia_and_Herzegovina.php b/__MACOSX/MPDF/collations/._Serbian_(Cyrillic)_Bosnia_and_Herzegovina.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Serbian_(Cyrillic)_Bosnia_and_Herzegovina.php differ diff --git a/__MACOSX/MPDF/collations/._Serbian_(Cyrillic)_Serbia.php b/__MACOSX/MPDF/collations/._Serbian_(Cyrillic)_Serbia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Serbian_(Cyrillic)_Serbia.php differ diff --git a/__MACOSX/MPDF/collations/._Serbian_(Latin)_Bosnia_and_Herzegovina.php b/__MACOSX/MPDF/collations/._Serbian_(Latin)_Bosnia_and_Herzegovina.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Serbian_(Latin)_Bosnia_and_Herzegovina.php differ diff --git a/__MACOSX/MPDF/collations/._Serbian_(Latin)_Serbia.php b/__MACOSX/MPDF/collations/._Serbian_(Latin)_Serbia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Serbian_(Latin)_Serbia.php differ diff --git a/__MACOSX/MPDF/collations/._Sesotho_sa_Leboa_South_Africa.php b/__MACOSX/MPDF/collations/._Sesotho_sa_Leboa_South_Africa.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Sesotho_sa_Leboa_South_Africa.php differ diff --git a/__MACOSX/MPDF/collations/._Setswana_South_Africa.php b/__MACOSX/MPDF/collations/._Setswana_South_Africa.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Setswana_South_Africa.php differ diff --git a/__MACOSX/MPDF/collations/._Slovak_Slovakia.php b/__MACOSX/MPDF/collations/._Slovak_Slovakia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Slovak_Slovakia.php differ diff --git a/__MACOSX/MPDF/collations/._Slovenian_Slovenia.php b/__MACOSX/MPDF/collations/._Slovenian_Slovenia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Slovenian_Slovenia.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Argentina.php b/__MACOSX/MPDF/collations/._Spanish_Argentina.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Argentina.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Bolivia.php b/__MACOSX/MPDF/collations/._Spanish_Bolivia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Bolivia.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Chile.php b/__MACOSX/MPDF/collations/._Spanish_Chile.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Chile.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Colombia.php b/__MACOSX/MPDF/collations/._Spanish_Colombia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Colombia.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Costa_Rica.php b/__MACOSX/MPDF/collations/._Spanish_Costa_Rica.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Costa_Rica.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Dominican_Republic.php b/__MACOSX/MPDF/collations/._Spanish_Dominican_Republic.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Dominican_Republic.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Ecuador.php b/__MACOSX/MPDF/collations/._Spanish_Ecuador.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Ecuador.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_El_Salvador.php b/__MACOSX/MPDF/collations/._Spanish_El_Salvador.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_El_Salvador.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Guatemala.php b/__MACOSX/MPDF/collations/._Spanish_Guatemala.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Guatemala.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Honduras.php b/__MACOSX/MPDF/collations/._Spanish_Honduras.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Honduras.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Mexico.php b/__MACOSX/MPDF/collations/._Spanish_Mexico.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Mexico.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Nicaragua.php b/__MACOSX/MPDF/collations/._Spanish_Nicaragua.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Nicaragua.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Panama.php b/__MACOSX/MPDF/collations/._Spanish_Panama.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Panama.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Paraguay.php b/__MACOSX/MPDF/collations/._Spanish_Paraguay.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Paraguay.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Peru.php b/__MACOSX/MPDF/collations/._Spanish_Peru.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Peru.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Puerto_Rico.php b/__MACOSX/MPDF/collations/._Spanish_Puerto_Rico.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Puerto_Rico.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Spain.php b/__MACOSX/MPDF/collations/._Spanish_Spain.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Spain.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_United_States.php b/__MACOSX/MPDF/collations/._Spanish_United_States.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_United_States.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Uruguay.php b/__MACOSX/MPDF/collations/._Spanish_Uruguay.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Uruguay.php differ diff --git a/__MACOSX/MPDF/collations/._Spanish_Venezuela.php b/__MACOSX/MPDF/collations/._Spanish_Venezuela.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Spanish_Venezuela.php differ diff --git a/__MACOSX/MPDF/collations/._Swedish_Finland.php b/__MACOSX/MPDF/collations/._Swedish_Finland.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Swedish_Finland.php differ diff --git a/__MACOSX/MPDF/collations/._Swedish_Sweden.php b/__MACOSX/MPDF/collations/._Swedish_Sweden.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Swedish_Sweden.php differ diff --git a/__MACOSX/MPDF/collations/._Tajik_(Cyrillic)_Tajikistan.php b/__MACOSX/MPDF/collations/._Tajik_(Cyrillic)_Tajikistan.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Tajik_(Cyrillic)_Tajikistan.php differ diff --git a/__MACOSX/MPDF/collations/._Tamazight_(Latin)_Algeria.php b/__MACOSX/MPDF/collations/._Tamazight_(Latin)_Algeria.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Tamazight_(Latin)_Algeria.php differ diff --git a/__MACOSX/MPDF/collations/._Tatar_Russia.php b/__MACOSX/MPDF/collations/._Tatar_Russia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Tatar_Russia.php differ diff --git a/__MACOSX/MPDF/collations/._Turkish_Turkey.php b/__MACOSX/MPDF/collations/._Turkish_Turkey.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Turkish_Turkey.php differ diff --git a/__MACOSX/MPDF/collations/._Turkmen_Turkmenistan.php b/__MACOSX/MPDF/collations/._Turkmen_Turkmenistan.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Turkmen_Turkmenistan.php differ diff --git a/__MACOSX/MPDF/collations/._Ukrainian_Ukraine.php b/__MACOSX/MPDF/collations/._Ukrainian_Ukraine.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Ukrainian_Ukraine.php differ diff --git a/__MACOSX/MPDF/collations/._Upper_Sorbian_Germany.php b/__MACOSX/MPDF/collations/._Upper_Sorbian_Germany.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Upper_Sorbian_Germany.php differ diff --git a/__MACOSX/MPDF/collations/._Urdu_Islamic_Republic_of_Pakistan.php b/__MACOSX/MPDF/collations/._Urdu_Islamic_Republic_of_Pakistan.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Urdu_Islamic_Republic_of_Pakistan.php differ diff --git a/__MACOSX/MPDF/collations/._Uzbek_(Cyrillic)_Uzbekistan.php b/__MACOSX/MPDF/collations/._Uzbek_(Cyrillic)_Uzbekistan.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Uzbek_(Cyrillic)_Uzbekistan.php differ diff --git a/__MACOSX/MPDF/collations/._Uzbek_(Latin)_Uzbekistan.php b/__MACOSX/MPDF/collations/._Uzbek_(Latin)_Uzbekistan.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Uzbek_(Latin)_Uzbekistan.php differ diff --git a/__MACOSX/MPDF/collations/._Vietnamese_Vietnam.php b/__MACOSX/MPDF/collations/._Vietnamese_Vietnam.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Vietnamese_Vietnam.php differ diff --git a/__MACOSX/MPDF/collations/._Welsh_United_Kingdom.php b/__MACOSX/MPDF/collations/._Welsh_United_Kingdom.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Welsh_United_Kingdom.php differ diff --git a/__MACOSX/MPDF/collations/._Wolof_Senegal.php b/__MACOSX/MPDF/collations/._Wolof_Senegal.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Wolof_Senegal.php differ diff --git a/__MACOSX/MPDF/collations/._Yakut_Russia.php b/__MACOSX/MPDF/collations/._Yakut_Russia.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Yakut_Russia.php differ diff --git a/__MACOSX/MPDF/collations/._Yoruba_Nigeria.php b/__MACOSX/MPDF/collations/._Yoruba_Nigeria.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._Yoruba_Nigeria.php differ diff --git a/__MACOSX/MPDF/collations/._isiXhosa_South_Africa.php b/__MACOSX/MPDF/collations/._isiXhosa_South_Africa.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._isiXhosa_South_Africa.php differ diff --git a/__MACOSX/MPDF/collations/._isiZulu_South_Africa.php b/__MACOSX/MPDF/collations/._isiZulu_South_Africa.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/collations/._isiZulu_South_Africa.php differ diff --git a/__MACOSX/MPDF/examples/._Thumbs.db b/__MACOSX/MPDF/examples/._Thumbs.db new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._Thumbs.db differ diff --git a/__MACOSX/MPDF/examples/._alpha.gif b/__MACOSX/MPDF/examples/._alpha.gif new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._alpha.gif differ diff --git a/__MACOSX/MPDF/examples/._alpha.png b/__MACOSX/MPDF/examples/._alpha.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._alpha.png differ diff --git a/__MACOSX/MPDF/examples/._alpha3.png b/__MACOSX/MPDF/examples/._alpha3.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._alpha3.png differ diff --git a/__MACOSX/MPDF/examples/._bayeux1.jpg b/__MACOSX/MPDF/examples/._bayeux1.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._bayeux1.jpg differ diff --git a/__MACOSX/MPDF/examples/._bg.jpg b/__MACOSX/MPDF/examples/._bg.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._bg.jpg differ diff --git a/__MACOSX/MPDF/examples/._bgbarcode.png b/__MACOSX/MPDF/examples/._bgbarcode.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._bgbarcode.png differ diff --git a/__MACOSX/MPDF/examples/._bgrock.jpg b/__MACOSX/MPDF/examples/._bgrock.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._bgrock.jpg differ diff --git a/__MACOSX/MPDF/examples/._borders2FF.jpg b/__MACOSX/MPDF/examples/._borders2FF.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._borders2FF.jpg differ diff --git a/__MACOSX/MPDF/examples/._borders2IE.jpg b/__MACOSX/MPDF/examples/._borders2IE.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._borders2IE.jpg differ diff --git a/__MACOSX/MPDF/examples/._borders3FF.jpg b/__MACOSX/MPDF/examples/._borders3FF.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._borders3FF.jpg differ diff --git a/__MACOSX/MPDF/examples/._borders3IE.jpg b/__MACOSX/MPDF/examples/._borders3IE.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._borders3IE.jpg differ diff --git a/__MACOSX/MPDF/examples/._borders4FF.jpg b/__MACOSX/MPDF/examples/._borders4FF.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._borders4FF.jpg differ diff --git a/__MACOSX/MPDF/examples/._borders4IE.jpg b/__MACOSX/MPDF/examples/._borders4IE.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._borders4IE.jpg differ diff --git a/__MACOSX/MPDF/examples/._bordersFF.jpg b/__MACOSX/MPDF/examples/._bordersFF.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._bordersFF.jpg differ diff --git a/__MACOSX/MPDF/examples/._bordersIE.jpg b/__MACOSX/MPDF/examples/._bordersIE.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._bordersIE.jpg differ diff --git a/__MACOSX/MPDF/examples/._bordersMPDF2.jpg b/__MACOSX/MPDF/examples/._bordersMPDF2.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._bordersMPDF2.jpg differ diff --git a/__MACOSX/MPDF/examples/._clematis.jpg b/__MACOSX/MPDF/examples/._clematis.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._clematis.jpg differ diff --git a/__MACOSX/MPDF/examples/._example01_basic.php b/__MACOSX/MPDF/examples/._example01_basic.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example01_basic.php differ diff --git a/__MACOSX/MPDF/examples/._example02_CSS_styles.php b/__MACOSX/MPDF/examples/._example02_CSS_styles.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example02_CSS_styles.php differ diff --git a/__MACOSX/MPDF/examples/._example03_backgrounds_and_borders.php b/__MACOSX/MPDF/examples/._example03_backgrounds_and_borders.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example03_backgrounds_and_borders.php differ diff --git a/__MACOSX/MPDF/examples/._example04_images.php b/__MACOSX/MPDF/examples/._example04_images.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example04_images.php differ diff --git a/__MACOSX/MPDF/examples/._example05_tables.php b/__MACOSX/MPDF/examples/._example05_tables.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example05_tables.php differ diff --git a/__MACOSX/MPDF/examples/._example06_tables_nested.php b/__MACOSX/MPDF/examples/._example06_tables_nested.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example06_tables_nested.php differ diff --git a/__MACOSX/MPDF/examples/._example07_tables_borders.php b/__MACOSX/MPDF/examples/._example07_tables_borders.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example07_tables_borders.php differ diff --git a/__MACOSX/MPDF/examples/._example08_lists.php b/__MACOSX/MPDF/examples/._example08_lists.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example08_lists.php differ diff --git a/__MACOSX/MPDF/examples/._example09_forms.php b/__MACOSX/MPDF/examples/._example09_forms.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example09_forms.php differ diff --git a/__MACOSX/MPDF/examples/._example10_floating_and_fixed_position_elements.php b/__MACOSX/MPDF/examples/._example10_floating_and_fixed_position_elements.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example10_floating_and_fixed_position_elements.php differ diff --git a/__MACOSX/MPDF/examples/._example11_overflow_auto.php b/__MACOSX/MPDF/examples/._example11_overflow_auto.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example11_overflow_auto.php differ diff --git a/__MACOSX/MPDF/examples/._example12_paging_html.php b/__MACOSX/MPDF/examples/._example12_paging_html.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example12_paging_html.php differ diff --git a/__MACOSX/MPDF/examples/._example13_paging_css.php b/__MACOSX/MPDF/examples/._example13_paging_css.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example13_paging_css.php differ diff --git a/__MACOSX/MPDF/examples/._example14_page_numbers_ToC_Index_Bookmarks.php b/__MACOSX/MPDF/examples/._example14_page_numbers_ToC_Index_Bookmarks.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example14_page_numbers_ToC_Index_Bookmarks.php differ diff --git a/__MACOSX/MPDF/examples/._example15_headers_method_1.php b/__MACOSX/MPDF/examples/._example15_headers_method_1.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example15_headers_method_1.php differ diff --git a/__MACOSX/MPDF/examples/._example16_headers_method_2.php b/__MACOSX/MPDF/examples/._example16_headers_method_2.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example16_headers_method_2.php differ diff --git a/__MACOSX/MPDF/examples/._example17_headers_method_3.php b/__MACOSX/MPDF/examples/._example17_headers_method_3.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example17_headers_method_3.php differ diff --git a/__MACOSX/MPDF/examples/._example18_headers_method_4.php b/__MACOSX/MPDF/examples/._example18_headers_method_4.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example18_headers_method_4.php differ diff --git a/__MACOSX/MPDF/examples/._example19_page_sizes.php b/__MACOSX/MPDF/examples/._example19_page_sizes.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example19_page_sizes.php differ diff --git a/__MACOSX/MPDF/examples/._example20_justify.php b/__MACOSX/MPDF/examples/._example20_justify.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example20_justify.php differ diff --git a/__MACOSX/MPDF/examples/._example21_hyphenation.php b/__MACOSX/MPDF/examples/._example21_hyphenation.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example21_hyphenation.php differ diff --git a/__MACOSX/MPDF/examples/._example22_columns.php b/__MACOSX/MPDF/examples/._example22_columns.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example22_columns.php differ diff --git a/__MACOSX/MPDF/examples/._example23_orientation.php b/__MACOSX/MPDF/examples/._example23_orientation.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example23_orientation.php differ diff --git a/__MACOSX/MPDF/examples/._example24_orientation_2.php b/__MACOSX/MPDF/examples/._example24_orientation_2.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example24_orientation_2.php differ diff --git a/__MACOSX/MPDF/examples/._example26_RTL.php b/__MACOSX/MPDF/examples/._example26_RTL.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example26_RTL.php differ diff --git a/__MACOSX/MPDF/examples/._example27_CJK_using_Adobe_fonts.php b/__MACOSX/MPDF/examples/._example27_CJK_using_Adobe_fonts.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example27_CJK_using_Adobe_fonts.php differ diff --git a/__MACOSX/MPDF/examples/._example28_CJK_using_embedded_fonts.php b/__MACOSX/MPDF/examples/._example28_CJK_using_embedded_fonts.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example28_CJK_using_embedded_fonts.php differ diff --git a/__MACOSX/MPDF/examples/._example29_multilingual_autofont.php b/__MACOSX/MPDF/examples/._example29_multilingual_autofont.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example29_multilingual_autofont.php differ diff --git a/__MACOSX/MPDF/examples/._example30_arabic.php b/__MACOSX/MPDF/examples/._example30_arabic.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example30_arabic.php differ diff --git a/__MACOSX/MPDF/examples/._example32_indic.php b/__MACOSX/MPDF/examples/._example32_indic.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example32_indic.php differ diff --git a/__MACOSX/MPDF/examples/._example35_watermarks.php b/__MACOSX/MPDF/examples/._example35_watermarks.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example35_watermarks.php differ diff --git a/__MACOSX/MPDF/examples/._example36_annotations_and_Attached_files.php b/__MACOSX/MPDF/examples/._example36_annotations_and_Attached_files.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example36_annotations_and_Attached_files.php differ diff --git a/__MACOSX/MPDF/examples/._example37_barcodes.php b/__MACOSX/MPDF/examples/._example37_barcodes.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example37_barcodes.php differ diff --git a/__MACOSX/MPDF/examples/._example38_dot_tab.php b/__MACOSX/MPDF/examples/._example38_dot_tab.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example38_dot_tab.php differ diff --git a/__MACOSX/MPDF/examples/._example39_PDFA_compliance.php b/__MACOSX/MPDF/examples/._example39_PDFA_compliance.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example39_PDFA_compliance.php differ diff --git a/__MACOSX/MPDF/examples/._example40_MPDFI_thumbnails.php b/__MACOSX/MPDF/examples/._example40_MPDFI_thumbnails.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example40_MPDFI_thumbnails.php differ diff --git a/__MACOSX/MPDF/examples/._example41_MPDFI_template.php b/__MACOSX/MPDF/examples/._example41_MPDFI_template.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example41_MPDFI_template.php differ diff --git a/__MACOSX/MPDF/examples/._example42_MPDFI_templatedoc.php b/__MACOSX/MPDF/examples/._example42_MPDFI_templatedoc.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example42_MPDFI_templatedoc.php differ diff --git a/__MACOSX/MPDF/examples/._example43_MPDFI_booklet.php b/__MACOSX/MPDF/examples/._example43_MPDFI_booklet.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example43_MPDFI_booklet.php differ diff --git a/__MACOSX/MPDF/examples/._example44_MPDFI_yearbook.php b/__MACOSX/MPDF/examples/._example44_MPDFI_yearbook.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example44_MPDFI_yearbook.php differ diff --git a/__MACOSX/MPDF/examples/._example46_progress_bars_simple.php b/__MACOSX/MPDF/examples/._example46_progress_bars_simple.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example46_progress_bars_simple.php differ diff --git a/__MACOSX/MPDF/examples/._example47_progress_bars_simple_custom.php b/__MACOSX/MPDF/examples/._example47_progress_bars_simple_custom.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example47_progress_bars_simple_custom.php differ diff --git a/__MACOSX/MPDF/examples/._example48_progress_bars_advanced.php b/__MACOSX/MPDF/examples/._example48_progress_bars_advanced.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example48_progress_bars_advanced.php differ diff --git a/__MACOSX/MPDF/examples/._example49_changelog.php b/__MACOSX/MPDF/examples/._example49_changelog.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example49_changelog.php differ diff --git a/__MACOSX/MPDF/examples/._example50_new_mPDF_3_features.php b/__MACOSX/MPDF/examples/._example50_new_mPDF_3_features.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example50_new_mPDF_3_features.php differ diff --git a/__MACOSX/MPDF/examples/._example51_new_mPDF_4_features.php b/__MACOSX/MPDF/examples/._example51_new_mPDF_4_features.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example51_new_mPDF_4_features.php differ diff --git a/__MACOSX/MPDF/examples/._example52_lineheight.htm b/__MACOSX/MPDF/examples/._example52_lineheight.htm new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example52_lineheight.htm differ diff --git a/__MACOSX/MPDF/examples/._example52_new_mPDF_4-2_features.php b/__MACOSX/MPDF/examples/._example52_new_mPDF_4-2_features.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example52_new_mPDF_4-2_features.php differ diff --git a/__MACOSX/MPDF/examples/._example53_new_mPDF_v5-0_fonts.php b/__MACOSX/MPDF/examples/._example53_new_mPDF_v5-0_fonts.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example53_new_mPDF_v5-0_fonts.php differ diff --git a/__MACOSX/MPDF/examples/._example54_new_mPDF_v5-1_features_gradients_and_images.php b/__MACOSX/MPDF/examples/._example54_new_mPDF_v5-1_features_gradients_and_images.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example54_new_mPDF_v5-1_features_gradients_and_images.php differ diff --git a/__MACOSX/MPDF/examples/._example55_new_mPDF_v5-1_color_and_other_features.php b/__MACOSX/MPDF/examples/._example55_new_mPDF_v5-1_color_and_other_features.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example55_new_mPDF_v5-1_color_and_other_features.php differ diff --git a/__MACOSX/MPDF/examples/._example56_new_mPDF_v5-1_features_grayscale.php b/__MACOSX/MPDF/examples/._example56_new_mPDF_v5-1_features_grayscale.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example56_new_mPDF_v5-1_features_grayscale.php differ diff --git a/__MACOSX/MPDF/examples/._example57_new_mPDF_v5-3_active_forms.php b/__MACOSX/MPDF/examples/._example57_new_mPDF_v5-3_active_forms.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example57_new_mPDF_v5-3_active_forms.php differ diff --git a/__MACOSX/MPDF/examples/._example57_new_mPDF_v5-3_active_forms_b.php b/__MACOSX/MPDF/examples/._example57_new_mPDF_v5-3_active_forms_b.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example57_new_mPDF_v5-3_active_forms_b.php differ diff --git a/__MACOSX/MPDF/examples/._example58_new_mPDF_v5-4_features.php b/__MACOSX/MPDF/examples/._example58_new_mPDF_v5-4_features.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example58_new_mPDF_v5-4_features.php differ diff --git a/__MACOSX/MPDF/examples/._example59_new_mPDF_v5-6_features.php b/__MACOSX/MPDF/examples/._example59_new_mPDF_v5-6_features.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example59_new_mPDF_v5-6_features.php differ diff --git a/__MACOSX/MPDF/examples/._example60_new_mPDF_v5-7_features.php b/__MACOSX/MPDF/examples/._example60_new_mPDF_v5-7_features.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._example60_new_mPDF_v5-7_features.php differ diff --git a/__MACOSX/MPDF/examples/._firefox-48.png b/__MACOSX/MPDF/examples/._firefox-48.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._firefox-48.png differ diff --git a/__MACOSX/MPDF/examples/._flowers-pattern.jpg b/__MACOSX/MPDF/examples/._flowers-pattern.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._flowers-pattern.jpg differ diff --git a/__MACOSX/MPDF/examples/._formsubmit.php b/__MACOSX/MPDF/examples/._formsubmit.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._formsubmit.php differ diff --git a/__MACOSX/MPDF/examples/._goto.gif b/__MACOSX/MPDF/examples/._goto.gif new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._goto.gif differ diff --git a/__MACOSX/MPDF/examples/._img1.png b/__MACOSX/MPDF/examples/._img1.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._img1.png differ diff --git a/__MACOSX/MPDF/examples/._img2.png b/__MACOSX/MPDF/examples/._img2.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._img2.png differ diff --git a/__MACOSX/MPDF/examples/._img3.png b/__MACOSX/MPDF/examples/._img3.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._img3.png differ diff --git a/__MACOSX/MPDF/examples/._img4.png b/__MACOSX/MPDF/examples/._img4.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._img4.png differ diff --git a/__MACOSX/MPDF/examples/._img5.png b/__MACOSX/MPDF/examples/._img5.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._img5.png differ diff --git a/__MACOSX/MPDF/examples/._index.php b/__MACOSX/MPDF/examples/._index.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._index.php differ diff --git a/__MACOSX/MPDF/examples/._klematis.jpg b/__MACOSX/MPDF/examples/._klematis.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._klematis.jpg differ diff --git a/__MACOSX/MPDF/examples/._loading.gif b/__MACOSX/MPDF/examples/._loading.gif new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._loading.gif differ diff --git a/__MACOSX/MPDF/examples/._mpdfstyleA4.css b/__MACOSX/MPDF/examples/._mpdfstyleA4.css new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._mpdfstyleA4.css differ diff --git a/__MACOSX/MPDF/examples/._mpdfstylePaged.css b/__MACOSX/MPDF/examples/._mpdfstylePaged.css new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._mpdfstylePaged.css differ diff --git a/__MACOSX/MPDF/examples/._mpdfstyletables.css b/__MACOSX/MPDF/examples/._mpdfstyletables.css new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._mpdfstyletables.css differ diff --git a/__MACOSX/MPDF/examples/._quran282.jpg b/__MACOSX/MPDF/examples/._quran282.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._quran282.jpg differ diff --git a/__MACOSX/MPDF/examples/._sample_basic.pdf b/__MACOSX/MPDF/examples/._sample_basic.pdf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._sample_basic.pdf differ diff --git a/__MACOSX/MPDF/examples/._sample_logoheader2.pdf b/__MACOSX/MPDF/examples/._sample_logoheader2.pdf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._sample_logoheader2.pdf differ diff --git a/__MACOSX/MPDF/examples/._sample_orientation2.pdf b/__MACOSX/MPDF/examples/._sample_orientation2.pdf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._sample_orientation2.pdf differ diff --git a/__MACOSX/MPDF/examples/._sample_orientation3.pdf b/__MACOSX/MPDF/examples/._sample_orientation3.pdf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._sample_orientation3.pdf differ diff --git a/__MACOSX/MPDF/examples/._show_code.php b/__MACOSX/MPDF/examples/._show_code.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._show_code.php differ diff --git a/__MACOSX/MPDF/examples/._sunset.jpg b/__MACOSX/MPDF/examples/._sunset.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._sunset.jpg differ diff --git a/__MACOSX/MPDF/examples/._sunsetv.jpg b/__MACOSX/MPDF/examples/._sunsetv.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._sunsetv.jpg differ diff --git a/__MACOSX/MPDF/examples/._test.pdf b/__MACOSX/MPDF/examples/._test.pdf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._test.pdf differ diff --git a/__MACOSX/MPDF/examples/._tiger b/__MACOSX/MPDF/examples/._tiger new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger differ diff --git a/__MACOSX/MPDF/examples/._tiger.bmp b/__MACOSX/MPDF/examples/._tiger.bmp new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger.bmp differ diff --git a/__MACOSX/MPDF/examples/._tiger.gif b/__MACOSX/MPDF/examples/._tiger.gif new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger.gif differ diff --git a/__MACOSX/MPDF/examples/._tiger.jpg b/__MACOSX/MPDF/examples/._tiger.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger.jpg differ diff --git a/__MACOSX/MPDF/examples/._tiger.php b/__MACOSX/MPDF/examples/._tiger.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger.php differ diff --git a/__MACOSX/MPDF/examples/._tiger.png b/__MACOSX/MPDF/examples/._tiger.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger.png differ diff --git a/__MACOSX/MPDF/examples/._tiger.svg b/__MACOSX/MPDF/examples/._tiger.svg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger.svg differ diff --git a/__MACOSX/MPDF/examples/._tiger.wmf b/__MACOSX/MPDF/examples/._tiger.wmf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger.wmf differ diff --git a/__MACOSX/MPDF/examples/._tiger2.png b/__MACOSX/MPDF/examples/._tiger2.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger2.png differ diff --git a/__MACOSX/MPDF/examples/._tiger2.wmf b/__MACOSX/MPDF/examples/._tiger2.wmf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger2.wmf differ diff --git a/__MACOSX/MPDF/examples/._tiger24trns.png b/__MACOSX/MPDF/examples/._tiger24trns.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger24trns.png differ diff --git a/__MACOSX/MPDF/examples/._tiger300px300dpi.jpg b/__MACOSX/MPDF/examples/._tiger300px300dpi.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger300px300dpi.jpg differ diff --git a/__MACOSX/MPDF/examples/._tiger300px300dpi.png b/__MACOSX/MPDF/examples/._tiger300px300dpi.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger300px300dpi.png differ diff --git a/__MACOSX/MPDF/examples/._tiger300px72dpi.jpg b/__MACOSX/MPDF/examples/._tiger300px72dpi.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger300px72dpi.jpg differ diff --git a/__MACOSX/MPDF/examples/._tiger300px96dpi.jpg b/__MACOSX/MPDF/examples/._tiger300px96dpi.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger300px96dpi.jpg differ diff --git a/__MACOSX/MPDF/examples/._tiger300px96dpi.png b/__MACOSX/MPDF/examples/._tiger300px96dpi.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger300px96dpi.png differ diff --git a/__MACOSX/MPDF/examples/._tiger8trns.gif b/__MACOSX/MPDF/examples/._tiger8trns.gif new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger8trns.gif differ diff --git a/__MACOSX/MPDF/examples/._tiger8trns.png b/__MACOSX/MPDF/examples/._tiger8trns.png new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tiger8trns.png differ diff --git a/__MACOSX/MPDF/examples/._tigercmyk.jpg b/__MACOSX/MPDF/examples/._tigercmyk.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tigercmyk.jpg differ diff --git a/__MACOSX/MPDF/examples/._tux.svg b/__MACOSX/MPDF/examples/._tux.svg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._tux.svg differ diff --git a/__MACOSX/MPDF/examples/._windmill.jpg b/__MACOSX/MPDF/examples/._windmill.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/examples/._windmill.jpg differ diff --git a/__MACOSX/MPDF/font/._ccourier.php b/__MACOSX/MPDF/font/._ccourier.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._ccourier.php differ diff --git a/__MACOSX/MPDF/font/._ccourierb.php b/__MACOSX/MPDF/font/._ccourierb.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._ccourierb.php differ diff --git a/__MACOSX/MPDF/font/._ccourierbi.php b/__MACOSX/MPDF/font/._ccourierbi.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._ccourierbi.php differ diff --git a/__MACOSX/MPDF/font/._ccourieri.php b/__MACOSX/MPDF/font/._ccourieri.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._ccourieri.php differ diff --git a/__MACOSX/MPDF/font/._chelvetica.php b/__MACOSX/MPDF/font/._chelvetica.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._chelvetica.php differ diff --git a/__MACOSX/MPDF/font/._chelveticab.php b/__MACOSX/MPDF/font/._chelveticab.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._chelveticab.php differ diff --git a/__MACOSX/MPDF/font/._chelveticabi.php b/__MACOSX/MPDF/font/._chelveticabi.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._chelveticabi.php differ diff --git a/__MACOSX/MPDF/font/._chelveticai.php b/__MACOSX/MPDF/font/._chelveticai.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._chelveticai.php differ diff --git a/__MACOSX/MPDF/font/._csymbol.php b/__MACOSX/MPDF/font/._csymbol.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._csymbol.php differ diff --git a/__MACOSX/MPDF/font/._ctimes.php b/__MACOSX/MPDF/font/._ctimes.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._ctimes.php differ diff --git a/__MACOSX/MPDF/font/._ctimesb.php b/__MACOSX/MPDF/font/._ctimesb.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._ctimesb.php differ diff --git a/__MACOSX/MPDF/font/._ctimesbi.php b/__MACOSX/MPDF/font/._ctimesbi.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._ctimesbi.php differ diff --git a/__MACOSX/MPDF/font/._ctimesi.php b/__MACOSX/MPDF/font/._ctimesi.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._ctimesi.php differ diff --git a/__MACOSX/MPDF/font/._czapfdingbats.php b/__MACOSX/MPDF/font/._czapfdingbats.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/font/._czapfdingbats.php differ diff --git a/__MACOSX/MPDF/graph_cache/._dummy.txt b/__MACOSX/MPDF/graph_cache/._dummy.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/graph_cache/._dummy.txt differ diff --git a/__MACOSX/MPDF/iccprofiles/._SWOP2006_Coated5v2.icc b/__MACOSX/MPDF/iccprofiles/._SWOP2006_Coated5v2.icc new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/iccprofiles/._SWOP2006_Coated5v2.icc differ diff --git a/__MACOSX/MPDF/iccprofiles/._sRGB_IEC61966-2-1.icc b/__MACOSX/MPDF/iccprofiles/._sRGB_IEC61966-2-1.icc new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/iccprofiles/._sRGB_IEC61966-2-1.icc differ diff --git a/__MACOSX/MPDF/includes/._CJKdata.php b/__MACOSX/MPDF/includes/._CJKdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._CJKdata.php differ diff --git a/__MACOSX/MPDF/includes/._functions.php b/__MACOSX/MPDF/includes/._functions.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._functions.php differ diff --git a/__MACOSX/MPDF/includes/._ind_bn_1_001.volt.php b/__MACOSX/MPDF/includes/._ind_bn_1_001.volt.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._ind_bn_1_001.volt.php differ diff --git a/__MACOSX/MPDF/includes/._ind_gu_1_001.volt.php b/__MACOSX/MPDF/includes/._ind_gu_1_001.volt.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._ind_gu_1_001.volt.php differ diff --git a/__MACOSX/MPDF/includes/._ind_hi_1_001.volt.php b/__MACOSX/MPDF/includes/._ind_hi_1_001.volt.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._ind_hi_1_001.volt.php differ diff --git a/__MACOSX/MPDF/includes/._ind_kn_1_001.volt.php b/__MACOSX/MPDF/includes/._ind_kn_1_001.volt.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._ind_kn_1_001.volt.php differ diff --git a/__MACOSX/MPDF/includes/._ind_ml_1_001.volt.php b/__MACOSX/MPDF/includes/._ind_ml_1_001.volt.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._ind_ml_1_001.volt.php differ diff --git a/__MACOSX/MPDF/includes/._ind_or_1_001.volt.php b/__MACOSX/MPDF/includes/._ind_or_1_001.volt.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._ind_or_1_001.volt.php differ diff --git a/__MACOSX/MPDF/includes/._ind_pa_1_001.volt.php b/__MACOSX/MPDF/includes/._ind_pa_1_001.volt.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._ind_pa_1_001.volt.php differ diff --git a/__MACOSX/MPDF/includes/._ind_ta_1_001.volt.php b/__MACOSX/MPDF/includes/._ind_ta_1_001.volt.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._ind_ta_1_001.volt.php differ diff --git a/__MACOSX/MPDF/includes/._ind_te_1_001.volt.php b/__MACOSX/MPDF/includes/._ind_te_1_001.volt.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._ind_te_1_001.volt.php differ diff --git a/__MACOSX/MPDF/includes/._linebrdictK.dat b/__MACOSX/MPDF/includes/._linebrdictK.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._linebrdictK.dat differ diff --git a/__MACOSX/MPDF/includes/._linebrdictL.dat b/__MACOSX/MPDF/includes/._linebrdictL.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._linebrdictL.dat differ diff --git a/__MACOSX/MPDF/includes/._linebrdictT.dat b/__MACOSX/MPDF/includes/._linebrdictT.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._linebrdictT.dat differ diff --git a/__MACOSX/MPDF/includes/._no_image.jpg b/__MACOSX/MPDF/includes/._no_image.jpg new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._no_image.jpg differ diff --git a/__MACOSX/MPDF/includes/._out.php b/__MACOSX/MPDF/includes/._out.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._out.php differ diff --git a/__MACOSX/MPDF/includes/._subs_core.php b/__MACOSX/MPDF/includes/._subs_core.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._subs_core.php differ diff --git a/__MACOSX/MPDF/includes/._subs_win-1252.php b/__MACOSX/MPDF/includes/._subs_win-1252.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._subs_win-1252.php differ diff --git a/__MACOSX/MPDF/includes/._upperCase.php b/__MACOSX/MPDF/includes/._upperCase.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/includes/._upperCase.php differ diff --git a/__MACOSX/MPDF/mpdfi/._filters b/__MACOSX/MPDF/mpdfi/._filters new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/mpdfi/._filters differ diff --git a/__MACOSX/MPDF/mpdfi/._fpdi_pdf_parser.php b/__MACOSX/MPDF/mpdfi/._fpdi_pdf_parser.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/mpdfi/._fpdi_pdf_parser.php differ diff --git a/__MACOSX/MPDF/mpdfi/._pdf_context.php b/__MACOSX/MPDF/mpdfi/._pdf_context.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/mpdfi/._pdf_context.php differ diff --git a/__MACOSX/MPDF/mpdfi/._pdf_parser.php b/__MACOSX/MPDF/mpdfi/._pdf_parser.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/mpdfi/._pdf_parser.php differ diff --git a/__MACOSX/MPDF/mpdfi/filters/._FilterASCII85.php b/__MACOSX/MPDF/mpdfi/filters/._FilterASCII85.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/mpdfi/filters/._FilterASCII85.php differ diff --git a/__MACOSX/MPDF/mpdfi/filters/._FilterLZW.php b/__MACOSX/MPDF/mpdfi/filters/._FilterLZW.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/mpdfi/filters/._FilterLZW.php differ diff --git a/__MACOSX/MPDF/patterns/._NOTES.txt b/__MACOSX/MPDF/patterns/._NOTES.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._NOTES.txt differ diff --git a/__MACOSX/MPDF/patterns/._de.php b/__MACOSX/MPDF/patterns/._de.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._de.php differ diff --git a/__MACOSX/MPDF/patterns/._dictionary.txt b/__MACOSX/MPDF/patterns/._dictionary.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._dictionary.txt differ diff --git a/__MACOSX/MPDF/patterns/._en.php b/__MACOSX/MPDF/patterns/._en.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._en.php differ diff --git a/__MACOSX/MPDF/patterns/._es.php b/__MACOSX/MPDF/patterns/._es.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._es.php differ diff --git a/__MACOSX/MPDF/patterns/._fi.php b/__MACOSX/MPDF/patterns/._fi.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._fi.php differ diff --git a/__MACOSX/MPDF/patterns/._fr.php b/__MACOSX/MPDF/patterns/._fr.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._fr.php differ diff --git a/__MACOSX/MPDF/patterns/._it.php b/__MACOSX/MPDF/patterns/._it.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._it.php differ diff --git a/__MACOSX/MPDF/patterns/._nl.php b/__MACOSX/MPDF/patterns/._nl.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._nl.php differ diff --git a/__MACOSX/MPDF/patterns/._pl.php b/__MACOSX/MPDF/patterns/._pl.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._pl.php differ diff --git a/__MACOSX/MPDF/patterns/._ru.php b/__MACOSX/MPDF/patterns/._ru.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._ru.php differ diff --git a/__MACOSX/MPDF/patterns/._sv.php b/__MACOSX/MPDF/patterns/._sv.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/patterns/._sv.php differ diff --git a/__MACOSX/MPDF/qrcode/.__LGPL.txt b/__MACOSX/MPDF/qrcode/.__LGPL.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/.__LGPL.txt differ diff --git a/__MACOSX/MPDF/qrcode/.__lisez_moi.txt b/__MACOSX/MPDF/qrcode/.__lisez_moi.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/.__lisez_moi.txt differ diff --git a/__MACOSX/MPDF/qrcode/._data b/__MACOSX/MPDF/qrcode/._data new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/._data differ diff --git a/__MACOSX/MPDF/qrcode/._image.php b/__MACOSX/MPDF/qrcode/._image.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/._image.php differ diff --git a/__MACOSX/MPDF/qrcode/._index.php b/__MACOSX/MPDF/qrcode/._index.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/._index.php differ diff --git a/__MACOSX/MPDF/qrcode/._qrcode.class.php b/__MACOSX/MPDF/qrcode/._qrcode.class.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/._qrcode.class.php differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele1.dat b/__MACOSX/MPDF/qrcode/data/._modele1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele10.dat b/__MACOSX/MPDF/qrcode/data/._modele10.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele10.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele11.dat b/__MACOSX/MPDF/qrcode/data/._modele11.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele11.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele12.dat b/__MACOSX/MPDF/qrcode/data/._modele12.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele12.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele13.dat b/__MACOSX/MPDF/qrcode/data/._modele13.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele13.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele14.dat b/__MACOSX/MPDF/qrcode/data/._modele14.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele14.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele15.dat b/__MACOSX/MPDF/qrcode/data/._modele15.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele15.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele16.dat b/__MACOSX/MPDF/qrcode/data/._modele16.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele16.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele17.dat b/__MACOSX/MPDF/qrcode/data/._modele17.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele17.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele18.dat b/__MACOSX/MPDF/qrcode/data/._modele18.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele18.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele19.dat b/__MACOSX/MPDF/qrcode/data/._modele19.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele19.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele2.dat b/__MACOSX/MPDF/qrcode/data/._modele2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele20.dat b/__MACOSX/MPDF/qrcode/data/._modele20.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele20.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele21.dat b/__MACOSX/MPDF/qrcode/data/._modele21.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele21.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele22.dat b/__MACOSX/MPDF/qrcode/data/._modele22.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele22.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele23.dat b/__MACOSX/MPDF/qrcode/data/._modele23.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele23.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele24.dat b/__MACOSX/MPDF/qrcode/data/._modele24.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele24.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele25.dat b/__MACOSX/MPDF/qrcode/data/._modele25.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele25.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele26.dat b/__MACOSX/MPDF/qrcode/data/._modele26.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele26.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele27.dat b/__MACOSX/MPDF/qrcode/data/._modele27.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele27.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele28.dat b/__MACOSX/MPDF/qrcode/data/._modele28.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele28.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele29.dat b/__MACOSX/MPDF/qrcode/data/._modele29.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele29.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele3.dat b/__MACOSX/MPDF/qrcode/data/._modele3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele30.dat b/__MACOSX/MPDF/qrcode/data/._modele30.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele30.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele31.dat b/__MACOSX/MPDF/qrcode/data/._modele31.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele31.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele32.dat b/__MACOSX/MPDF/qrcode/data/._modele32.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele32.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele33.dat b/__MACOSX/MPDF/qrcode/data/._modele33.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele33.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele34.dat b/__MACOSX/MPDF/qrcode/data/._modele34.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele34.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele35.dat b/__MACOSX/MPDF/qrcode/data/._modele35.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele35.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele36.dat b/__MACOSX/MPDF/qrcode/data/._modele36.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele36.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele37.dat b/__MACOSX/MPDF/qrcode/data/._modele37.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele37.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele38.dat b/__MACOSX/MPDF/qrcode/data/._modele38.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele38.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele39.dat b/__MACOSX/MPDF/qrcode/data/._modele39.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele39.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele4.dat b/__MACOSX/MPDF/qrcode/data/._modele4.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele4.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele40.dat b/__MACOSX/MPDF/qrcode/data/._modele40.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele40.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele5.dat b/__MACOSX/MPDF/qrcode/data/._modele5.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele5.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele6.dat b/__MACOSX/MPDF/qrcode/data/._modele6.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele6.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele7.dat b/__MACOSX/MPDF/qrcode/data/._modele7.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele7.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele8.dat b/__MACOSX/MPDF/qrcode/data/._modele8.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele8.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._modele9.dat b/__MACOSX/MPDF/qrcode/data/._modele9.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._modele9.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv10_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv10_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv10_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv10_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv10_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv10_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv10_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv10_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv10_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv10_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv10_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv10_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv11_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv11_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv11_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv11_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv11_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv11_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv11_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv11_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv11_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv11_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv11_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv11_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv12_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv12_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv12_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv12_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv12_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv12_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv12_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv12_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv12_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv12_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv12_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv12_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv13_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv13_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv13_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv13_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv13_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv13_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv13_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv13_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv13_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv13_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv13_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv13_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv14_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv14_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv14_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv14_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv14_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv14_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv14_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv14_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv14_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv14_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv14_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv14_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv15_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv15_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv15_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv15_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv15_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv15_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv15_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv15_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv15_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv15_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv15_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv15_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv16_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv16_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv16_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv16_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv16_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv16_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv16_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv16_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv16_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv16_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv16_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv16_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv17_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv17_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv17_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv17_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv17_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv17_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv17_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv17_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv17_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv17_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv17_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv17_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv18_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv18_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv18_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv18_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv18_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv18_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv18_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv18_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv18_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv18_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv18_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv18_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv19_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv19_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv19_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv19_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv19_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv19_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv19_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv19_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv19_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv19_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv19_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv19_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv1_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv1_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv1_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv1_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv1_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv1_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv1_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv1_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv1_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv1_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv1_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv1_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv20_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv20_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv20_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv20_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv20_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv20_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv20_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv20_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv20_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv20_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv20_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv20_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv21_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv21_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv21_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv21_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv21_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv21_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv21_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv21_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv21_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv21_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv21_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv21_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv22_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv22_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv22_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv22_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv22_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv22_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv22_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv22_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv22_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv22_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv22_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv22_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv23_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv23_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv23_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv23_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv23_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv23_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv23_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv23_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv23_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv23_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv23_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv23_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv24_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv24_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv24_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv24_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv24_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv24_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv24_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv24_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv24_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv24_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv24_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv24_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv25_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv25_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv25_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv25_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv25_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv25_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv25_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv25_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv25_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv25_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv25_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv25_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv26_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv26_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv26_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv26_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv26_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv26_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv26_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv26_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv26_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv26_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv26_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv26_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv27_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv27_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv27_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv27_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv27_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv27_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv27_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv27_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv27_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv27_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv27_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv27_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv28_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv28_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv28_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv28_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv28_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv28_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv28_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv28_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv28_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv28_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv28_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv28_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv29_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv29_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv29_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv29_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv29_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv29_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv29_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv29_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv29_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv29_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv29_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv29_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv2_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv2_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv2_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv2_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv2_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv2_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv2_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv2_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv2_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv2_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv2_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv2_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv30_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv30_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv30_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv30_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv30_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv30_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv30_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv30_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv30_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv30_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv30_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv30_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv31_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv31_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv31_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv31_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv31_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv31_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv31_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv31_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv31_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv31_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv31_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv31_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv32_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv32_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv32_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv32_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv32_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv32_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv32_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv32_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv32_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv32_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv32_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv32_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv33_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv33_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv33_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv33_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv33_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv33_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv33_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv33_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv33_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv33_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv33_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv33_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv34_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv34_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv34_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv34_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv34_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv34_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv34_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv34_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv34_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv34_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv34_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv34_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv35_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv35_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv35_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv35_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv35_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv35_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv35_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv35_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv35_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv35_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv35_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv35_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv36_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv36_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv36_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv36_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv36_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv36_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv36_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv36_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv36_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv36_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv36_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv36_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv37_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv37_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv37_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv37_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv37_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv37_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv37_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv37_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv37_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv37_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv37_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv37_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv38_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv38_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv38_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv38_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv38_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv38_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv38_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv38_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv38_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv38_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv38_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv38_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv39_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv39_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv39_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv39_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv39_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv39_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv39_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv39_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv39_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv39_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv39_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv39_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv3_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv3_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv3_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv3_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv3_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv3_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv3_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv3_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv3_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv3_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv3_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv3_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv40_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv40_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv40_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv40_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv40_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv40_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv40_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv40_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv40_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv40_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv40_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv40_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv4_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv4_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv4_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv4_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv4_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv4_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv4_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv4_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv4_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv4_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv4_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv4_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv5_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv5_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv5_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv5_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv5_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv5_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv5_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv5_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv5_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv5_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv5_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv5_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv6_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv6_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv6_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv6_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv6_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv6_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv6_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv6_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv6_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv6_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv6_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv6_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv7_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv7_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv7_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv7_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv7_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv7_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv7_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv7_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv7_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv7_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv7_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv7_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv8_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv8_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv8_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv8_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv8_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv8_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv8_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv8_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv8_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv8_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv8_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv8_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv9_0.dat b/__MACOSX/MPDF/qrcode/data/._qrv9_0.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv9_0.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv9_1.dat b/__MACOSX/MPDF/qrcode/data/._qrv9_1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv9_1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv9_2.dat b/__MACOSX/MPDF/qrcode/data/._qrv9_2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv9_2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrv9_3.dat b/__MACOSX/MPDF/qrcode/data/._qrv9_3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrv9_3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr1.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr1.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr1.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr10.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr10.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr10.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr11.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr11.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr11.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr12.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr12.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr12.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr13.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr13.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr13.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr14.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr14.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr14.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr15.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr15.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr15.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr16.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr16.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr16.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr17.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr17.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr17.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr18.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr18.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr18.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr19.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr19.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr19.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr2.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr2.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr2.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr20.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr20.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr20.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr21.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr21.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr21.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr22.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr22.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr22.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr23.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr23.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr23.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr24.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr24.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr24.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr25.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr25.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr25.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr26.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr26.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr26.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr27.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr27.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr27.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr28.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr28.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr28.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr29.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr29.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr29.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr3.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr3.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr3.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr30.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr30.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr30.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr31.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr31.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr31.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr32.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr32.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr32.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr33.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr33.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr33.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr34.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr34.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr34.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr35.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr35.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr35.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr36.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr36.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr36.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr37.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr37.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr37.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr38.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr38.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr38.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr39.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr39.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr39.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr4.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr4.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr4.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr40.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr40.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr40.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr5.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr5.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr5.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr6.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr6.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr6.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr7.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr7.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr7.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr8.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr8.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr8.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._qrvfr9.dat b/__MACOSX/MPDF/qrcode/data/._qrvfr9.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._qrvfr9.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc10.dat b/__MACOSX/MPDF/qrcode/data/._rsc10.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc10.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc13.dat b/__MACOSX/MPDF/qrcode/data/._rsc13.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc13.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc15.dat b/__MACOSX/MPDF/qrcode/data/._rsc15.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc15.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc16.dat b/__MACOSX/MPDF/qrcode/data/._rsc16.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc16.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc17.dat b/__MACOSX/MPDF/qrcode/data/._rsc17.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc17.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc18.dat b/__MACOSX/MPDF/qrcode/data/._rsc18.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc18.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc20.dat b/__MACOSX/MPDF/qrcode/data/._rsc20.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc20.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc22.dat b/__MACOSX/MPDF/qrcode/data/._rsc22.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc22.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc24.dat b/__MACOSX/MPDF/qrcode/data/._rsc24.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc24.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc26.dat b/__MACOSX/MPDF/qrcode/data/._rsc26.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc26.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc28.dat b/__MACOSX/MPDF/qrcode/data/._rsc28.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc28.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc30.dat b/__MACOSX/MPDF/qrcode/data/._rsc30.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc30.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc32.dat b/__MACOSX/MPDF/qrcode/data/._rsc32.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc32.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc34.dat b/__MACOSX/MPDF/qrcode/data/._rsc34.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc34.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc36.dat b/__MACOSX/MPDF/qrcode/data/._rsc36.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc36.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc40.dat b/__MACOSX/MPDF/qrcode/data/._rsc40.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc40.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc42.dat b/__MACOSX/MPDF/qrcode/data/._rsc42.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc42.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc44.dat b/__MACOSX/MPDF/qrcode/data/._rsc44.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc44.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc46.dat b/__MACOSX/MPDF/qrcode/data/._rsc46.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc46.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc48.dat b/__MACOSX/MPDF/qrcode/data/._rsc48.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc48.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc50.dat b/__MACOSX/MPDF/qrcode/data/._rsc50.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc50.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc52.dat b/__MACOSX/MPDF/qrcode/data/._rsc52.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc52.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc54.dat b/__MACOSX/MPDF/qrcode/data/._rsc54.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc54.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc56.dat b/__MACOSX/MPDF/qrcode/data/._rsc56.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc56.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc58.dat b/__MACOSX/MPDF/qrcode/data/._rsc58.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc58.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc60.dat b/__MACOSX/MPDF/qrcode/data/._rsc60.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc60.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc62.dat b/__MACOSX/MPDF/qrcode/data/._rsc62.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc62.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc64.dat b/__MACOSX/MPDF/qrcode/data/._rsc64.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc64.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc66.dat b/__MACOSX/MPDF/qrcode/data/._rsc66.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc66.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc68.dat b/__MACOSX/MPDF/qrcode/data/._rsc68.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc68.dat differ diff --git a/__MACOSX/MPDF/qrcode/data/._rsc7.dat b/__MACOSX/MPDF/qrcode/data/._rsc7.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/qrcode/data/._rsc7.dat differ diff --git a/__MACOSX/MPDF/tmp/._dummy.txt b/__MACOSX/MPDF/tmp/._dummy.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/tmp/._dummy.txt differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GDEFdata.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GDEFdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GDEFdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GPOSdata.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GPOSdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GPOSdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.DFLT.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.KUR .php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.KUR .php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.KUR .php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.SND .php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.SND .php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.SND .php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.URD .php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.URD .php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.arab.URD .php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.nko .DFLT.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.nko .DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUB.nko .DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUBGPOStables.dat b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUBGPOStables.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUBGPOStables.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUBdata.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUBdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.GSUBdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.cw.dat b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.cw.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.cw.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.cw127.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.cw127.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.cw127.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.gid.dat b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.gid.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.gid.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.mtx.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.mtx.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensed.mtx.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GDEFdata.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GDEFdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GDEFdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GPOSdata.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GPOSdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GPOSdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.DFLT.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.KUR .php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.KUR .php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.KUR .php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.SND .php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.SND .php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.SND .php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.URD .php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.URD .php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.arab.URD .php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.nko .DFLT.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.nko .DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUB.nko .DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUBGPOStables.dat b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUBGPOStables.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUBGPOStables.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUBdata.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUBdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.GSUBdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.cw.dat b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.cw.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.cw.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.cw127.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.cw127.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.cw127.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.gid.dat b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.gid.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.gid.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.mtx.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.mtx.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedB.mtx.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedI.cw.dat b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedI.cw.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedI.cw.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedI.mtx.php b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedI.mtx.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusanscondensedI.mtx.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GDEFdata.php b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GDEFdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GDEFdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GPOSdata.php b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GPOSdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GPOSdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GSUB.arab.DFLT.php b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GSUB.arab.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GSUB.arab.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GSUBGPOStables.dat b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GSUBGPOStables.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GSUBGPOStables.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GSUBdata.php b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GSUBdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.GSUBdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusansmono.cw.dat b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.cw.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.cw.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusansmono.cw127.php b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.cw127.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.cw127.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusansmono.gid.dat b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.gid.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.gid.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavusansmono.mtx.php b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.mtx.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavusansmono.mtx.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavuserifcondensed.cw.dat b/__MACOSX/MPDF/ttfontdata/._dejavuserifcondensed.cw.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavuserifcondensed.cw.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._dejavuserifcondensed.mtx.php b/__MACOSX/MPDF/ttfontdata/._dejavuserifcondensed.mtx.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dejavuserifcondensed.mtx.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._dummy.txt b/__MACOSX/MPDF/ttfontdata/._dummy.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._dummy.txt differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GDEFdata.php b/__MACOSX/MPDF/ttfontdata/._freesans.GDEFdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GDEFdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GPOSdata.php b/__MACOSX/MPDF/ttfontdata/._freesans.GPOSdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GPOSdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.beng.DFLT.php b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.beng.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.beng.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.bng2.DFLT.php b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.bng2.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.bng2.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.dev2.DFLT.php b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.dev2.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.dev2.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.dev2.SAN .php b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.dev2.SAN .php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.dev2.SAN .php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.deva.DFLT.php b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.deva.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.deva.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.deva.SAN .php b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.deva.SAN .php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.deva.SAN .php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.gur2.DFLT.php b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.gur2.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.gur2.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.guru.DFLT.php b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.guru.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.guru.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.mlym.DFLT.php b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.mlym.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GSUB.mlym.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GSUBGPOStables.dat b/__MACOSX/MPDF/ttfontdata/._freesans.GSUBGPOStables.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GSUBGPOStables.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.GSUBdata.php b/__MACOSX/MPDF/ttfontdata/._freesans.GSUBdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.GSUBdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.cw.dat b/__MACOSX/MPDF/ttfontdata/._freesans.cw.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.cw.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.gid.dat b/__MACOSX/MPDF/ttfontdata/._freesans.gid.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.gid.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesans.mtx.php b/__MACOSX/MPDF/ttfontdata/._freesans.mtx.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesans.mtx.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.GDEFdata.php b/__MACOSX/MPDF/ttfontdata/._freesansB.GDEFdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.GDEFdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.GPOSdata.php b/__MACOSX/MPDF/ttfontdata/._freesansB.GPOSdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.GPOSdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.dev2.DFLT.php b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.dev2.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.dev2.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.dev2.SAN .php b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.dev2.SAN .php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.dev2.SAN .php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.deva.DFLT.php b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.deva.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.deva.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.deva.SAN .php b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.deva.SAN .php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.deva.SAN .php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.gur2.DFLT.php b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.gur2.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.gur2.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.guru.DFLT.php b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.guru.DFLT.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUB.guru.DFLT.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.GSUBGPOStables.dat b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUBGPOStables.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUBGPOStables.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.GSUBdata.php b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUBdata.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.GSUBdata.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.cw.dat b/__MACOSX/MPDF/ttfontdata/._freesansB.cw.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.cw.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.cw127.php b/__MACOSX/MPDF/ttfontdata/._freesansB.cw127.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.cw127.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.gid.dat b/__MACOSX/MPDF/ttfontdata/._freesansB.gid.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.gid.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._freesansB.mtx.php b/__MACOSX/MPDF/ttfontdata/._freesansB.mtx.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._freesansB.mtx.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._opensans.cw.dat b/__MACOSX/MPDF/ttfontdata/._opensans.cw.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._opensans.cw.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._opensans.cw127.php b/__MACOSX/MPDF/ttfontdata/._opensans.cw127.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._opensans.cw127.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._opensans.mtx.php b/__MACOSX/MPDF/ttfontdata/._opensans.mtx.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._opensans.mtx.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._opensansB.cw.dat b/__MACOSX/MPDF/ttfontdata/._opensansB.cw.dat new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._opensansB.cw.dat differ diff --git a/__MACOSX/MPDF/ttfontdata/._opensansB.cw127.php b/__MACOSX/MPDF/ttfontdata/._opensansB.cw127.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._opensansB.cw127.php differ diff --git a/__MACOSX/MPDF/ttfontdata/._opensansB.mtx.php b/__MACOSX/MPDF/ttfontdata/._opensansB.mtx.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfontdata/._opensansB.mtx.php differ diff --git a/__MACOSX/MPDF/ttfonts/._AboriginalSansREGULAR.ttf b/__MACOSX/MPDF/ttfonts/._AboriginalSansREGULAR.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._AboriginalSansREGULAR.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Abyssinica_SIL.ttf b/__MACOSX/MPDF/ttfonts/._Abyssinica_SIL.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Abyssinica_SIL.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Aegean.otf b/__MACOSX/MPDF/ttfonts/._Aegean.otf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Aegean.otf differ diff --git a/__MACOSX/MPDF/ttfonts/._Aegyptus.otf b/__MACOSX/MPDF/ttfonts/._Aegyptus.otf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Aegyptus.otf differ diff --git a/__MACOSX/MPDF/ttfonts/._Akkadian.otf b/__MACOSX/MPDF/ttfonts/._Akkadian.otf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Akkadian.otf differ diff --git a/__MACOSX/MPDF/ttfonts/._DBSILBR.ttf b/__MACOSX/MPDF/ttfonts/._DBSILBR.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DBSILBR.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSans-Bold.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSans-Bold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSans-Bold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSans-BoldOblique.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSans-BoldOblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSans-BoldOblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSans-Oblique.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSans-Oblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSans-Oblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSans.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSans.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSans.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed-Bold.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed-Bold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed-Bold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed-BoldOblique.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed-BoldOblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed-BoldOblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed-Oblique.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed-Oblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed-Oblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSansCondensed.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSansMono-Bold.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSansMono-Bold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSansMono-Bold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSansMono-BoldOblique.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSansMono-BoldOblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSansMono-BoldOblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSansMono-Oblique.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSansMono-Oblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSansMono-Oblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSansMono.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSansMono.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSansMono.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSerif-Bold.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSerif-Bold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSerif-Bold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSerif-BoldItalic.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSerif-BoldItalic.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSerif-BoldItalic.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSerif-Italic.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSerif-Italic.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSerif-Italic.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSerif.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSerif.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSerif.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed-Bold.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed-Bold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed-Bold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed-BoldItalic.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed-BoldItalic.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed-BoldItalic.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed-Italic.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed-Italic.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed-Italic.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed.ttf b/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuSerifCondensed.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DejaVuinfo.txt b/__MACOSX/MPDF/ttfonts/._DejaVuinfo.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DejaVuinfo.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._Dhyana-Bold.ttf b/__MACOSX/MPDF/ttfonts/._Dhyana-Bold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Dhyana-Bold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Dhyana-Regular.ttf b/__MACOSX/MPDF/ttfonts/._Dhyana-Regular.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Dhyana-Regular.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._DhyanaOFL.txt b/__MACOSX/MPDF/ttfonts/._DhyanaOFL.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._DhyanaOFL.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeMono.ttf b/__MACOSX/MPDF/ttfonts/._FreeMono.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeMono.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeMonoBold.ttf b/__MACOSX/MPDF/ttfonts/._FreeMonoBold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeMonoBold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeMonoBoldOblique.ttf b/__MACOSX/MPDF/ttfonts/._FreeMonoBoldOblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeMonoBoldOblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeMonoOblique.ttf b/__MACOSX/MPDF/ttfonts/._FreeMonoOblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeMonoOblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeSans.ttf b/__MACOSX/MPDF/ttfonts/._FreeSans.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeSans.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeSansBold.ttf b/__MACOSX/MPDF/ttfonts/._FreeSansBold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeSansBold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeSansBoldOblique.ttf b/__MACOSX/MPDF/ttfonts/._FreeSansBoldOblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeSansBoldOblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeSansOblique.ttf b/__MACOSX/MPDF/ttfonts/._FreeSansOblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeSansOblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeSerif.ttf b/__MACOSX/MPDF/ttfonts/._FreeSerif.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeSerif.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeSerifBold.ttf b/__MACOSX/MPDF/ttfonts/._FreeSerifBold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeSerifBold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeSerifBoldItalic.ttf b/__MACOSX/MPDF/ttfonts/._FreeSerifBoldItalic.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeSerifBoldItalic.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._FreeSerifItalic.ttf b/__MACOSX/MPDF/ttfonts/._FreeSerifItalic.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._FreeSerifItalic.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._GNUFreeFontinfo.txt b/__MACOSX/MPDF/ttfonts/._GNUFreeFontinfo.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._GNUFreeFontinfo.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._Garuda-Bold.ttf b/__MACOSX/MPDF/ttfonts/._Garuda-Bold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Garuda-Bold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Garuda-BoldOblique.ttf b/__MACOSX/MPDF/ttfonts/._Garuda-BoldOblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Garuda-BoldOblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Garuda-Oblique.ttf b/__MACOSX/MPDF/ttfonts/._Garuda-Oblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Garuda-Oblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Garuda.ttf b/__MACOSX/MPDF/ttfonts/._Garuda.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Garuda.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Jomolhari-OFL.txt b/__MACOSX/MPDF/ttfonts/._Jomolhari-OFL.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Jomolhari-OFL.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._Jomolhari.ttf b/__MACOSX/MPDF/ttfonts/._Jomolhari.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Jomolhari.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._KhmerOFL.txt b/__MACOSX/MPDF/ttfonts/._KhmerOFL.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._KhmerOFL.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._KhmerOS.ttf b/__MACOSX/MPDF/ttfonts/._KhmerOS.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._KhmerOS.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Lateef font OFL.txt b/__MACOSX/MPDF/ttfonts/._Lateef font OFL.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Lateef font OFL.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._LateefRegOT.ttf b/__MACOSX/MPDF/ttfonts/._LateefRegOT.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._LateefRegOT.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Lohit-Kannada.ttf b/__MACOSX/MPDF/ttfonts/._Lohit-Kannada.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Lohit-Kannada.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._LohitKannadaOFL.txt b/__MACOSX/MPDF/ttfonts/._LohitKannadaOFL.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._LohitKannadaOFL.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._Norasi-Bold.ttf b/__MACOSX/MPDF/ttfonts/._Norasi-Bold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Norasi-Bold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Norasi-BoldOblique.ttf b/__MACOSX/MPDF/ttfonts/._Norasi-BoldOblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Norasi-BoldOblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Norasi-Oblique.ttf b/__MACOSX/MPDF/ttfonts/._Norasi-Oblique.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Norasi-Oblique.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Norasi.ttf b/__MACOSX/MPDF/ttfonts/._Norasi.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Norasi.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._OpenSans.ttf b/__MACOSX/MPDF/ttfonts/._OpenSans.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._OpenSans.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._OpenSansBold.ttf b/__MACOSX/MPDF/ttfonts/._OpenSansBold.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._OpenSansBold.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Padauk-book.ttf b/__MACOSX/MPDF/ttfonts/._Padauk-book.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Padauk-book.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Pothana2000.ttf b/__MACOSX/MPDF/ttfonts/._Pothana2000.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Pothana2000.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Quivira.otf b/__MACOSX/MPDF/ttfonts/._Quivira.otf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Quivira.otf differ diff --git a/__MACOSX/MPDF/ttfonts/._Sun-ExtA.ttf b/__MACOSX/MPDF/ttfonts/._Sun-ExtA.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Sun-ExtA.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Sun-ExtB.ttf b/__MACOSX/MPDF/ttfonts/._Sun-ExtB.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Sun-ExtB.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._SundaneseUnicode-1.0.5.ttf b/__MACOSX/MPDF/ttfonts/._SundaneseUnicode-1.0.5.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._SundaneseUnicode-1.0.5.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._SyrCOMEdessa.otf b/__MACOSX/MPDF/ttfonts/._SyrCOMEdessa.otf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._SyrCOMEdessa.otf differ diff --git a/__MACOSX/MPDF/ttfonts/._SyrCOMEdessa_license.txt b/__MACOSX/MPDF/ttfonts/._SyrCOMEdessa_license.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._SyrCOMEdessa_license.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._TaameyDavidCLM-LICENSE.txt b/__MACOSX/MPDF/ttfonts/._TaameyDavidCLM-LICENSE.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._TaameyDavidCLM-LICENSE.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._TaameyDavidCLM-Medium.ttf b/__MACOSX/MPDF/ttfonts/._TaameyDavidCLM-Medium.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._TaameyDavidCLM-Medium.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._TaiHeritagePro.ttf b/__MACOSX/MPDF/ttfonts/._TaiHeritagePro.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._TaiHeritagePro.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Thai Fonts License.txt b/__MACOSX/MPDF/ttfonts/._Thai Fonts License.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Thai Fonts License.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._Tharlon-Regular.ttf b/__MACOSX/MPDF/ttfonts/._Tharlon-Regular.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Tharlon-Regular.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._TharlonOFL.txt b/__MACOSX/MPDF/ttfonts/._TharlonOFL.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._TharlonOFL.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._UnBatang_0613.ttf b/__MACOSX/MPDF/ttfonts/._UnBatang_0613.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._UnBatang_0613.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._Uthman.otf b/__MACOSX/MPDF/ttfonts/._Uthman.otf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._Uthman.otf differ diff --git a/__MACOSX/MPDF/ttfonts/._XB Riyaz.ttf b/__MACOSX/MPDF/ttfonts/._XB Riyaz.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._XB Riyaz.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._XB RiyazBd.ttf b/__MACOSX/MPDF/ttfonts/._XB RiyazBd.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._XB RiyazBd.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._XB RiyazBdIt.ttf b/__MACOSX/MPDF/ttfonts/._XB RiyazBdIt.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._XB RiyazBdIt.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._XB RiyazIt.ttf b/__MACOSX/MPDF/ttfonts/._XB RiyazIt.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._XB RiyazIt.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._XB Zar Bd.ttf b/__MACOSX/MPDF/ttfonts/._XB Zar Bd.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._XB Zar Bd.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._XB Zar BdIt.ttf b/__MACOSX/MPDF/ttfonts/._XB Zar BdIt.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._XB Zar BdIt.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._XB Zar It.ttf b/__MACOSX/MPDF/ttfonts/._XB Zar It.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._XB Zar It.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._XB Zar.ttf b/__MACOSX/MPDF/ttfonts/._XB Zar.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._XB Zar.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._XW Zar Font Info.txt b/__MACOSX/MPDF/ttfonts/._XW Zar Font Info.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._XW Zar Font Info.txt differ diff --git a/__MACOSX/MPDF/ttfonts/._ZawgyiOne.ttf b/__MACOSX/MPDF/ttfonts/._ZawgyiOne.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ZawgyiOne.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ayar.ttf b/__MACOSX/MPDF/ttfonts/._ayar.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ayar.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._damase_v.2.ttf b/__MACOSX/MPDF/ttfonts/._damase_v.2.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._damase_v.2.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ind_bn_1_001.ttf b/__MACOSX/MPDF/ttfonts/._ind_bn_1_001.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ind_bn_1_001.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ind_gu_1_001.ttf b/__MACOSX/MPDF/ttfonts/._ind_gu_1_001.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ind_gu_1_001.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ind_hi_1_001.ttf b/__MACOSX/MPDF/ttfonts/._ind_hi_1_001.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ind_hi_1_001.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ind_kn_1_001.ttf b/__MACOSX/MPDF/ttfonts/._ind_kn_1_001.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ind_kn_1_001.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ind_ml_1_001.ttf b/__MACOSX/MPDF/ttfonts/._ind_ml_1_001.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ind_ml_1_001.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ind_or_1_001.ttf b/__MACOSX/MPDF/ttfonts/._ind_or_1_001.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ind_or_1_001.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ind_pa_1_001.ttf b/__MACOSX/MPDF/ttfonts/._ind_pa_1_001.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ind_pa_1_001.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ind_ta_1_001.ttf b/__MACOSX/MPDF/ttfonts/._ind_ta_1_001.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ind_ta_1_001.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ind_te_1_001.ttf b/__MACOSX/MPDF/ttfonts/._ind_te_1_001.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ind_te_1_001.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._kaputaunicode.ttf b/__MACOSX/MPDF/ttfonts/._kaputaunicode.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._kaputaunicode.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._lannaalif-v1-03.ttf b/__MACOSX/MPDF/ttfonts/._lannaalif-v1-03.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._lannaalif-v1-03.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ocrb10.ttf b/__MACOSX/MPDF/ttfonts/._ocrb10.ttf new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ocrb10.ttf differ diff --git a/__MACOSX/MPDF/ttfonts/._ocrbinfo.txt b/__MACOSX/MPDF/ttfonts/._ocrbinfo.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/ttfonts/._ocrbinfo.txt differ diff --git a/__MACOSX/MPDF/utils/._UnicodeData.txt b/__MACOSX/MPDF/utils/._UnicodeData.txt new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/utils/._UnicodeData.txt differ diff --git a/__MACOSX/MPDF/utils/._UnicodeRanges.php b/__MACOSX/MPDF/utils/._UnicodeRanges.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/utils/._UnicodeRanges.php differ diff --git a/__MACOSX/MPDF/utils/._font_collections.php b/__MACOSX/MPDF/utils/._font_collections.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/utils/._font_collections.php differ diff --git a/__MACOSX/MPDF/utils/._font_coverage.php b/__MACOSX/MPDF/utils/._font_coverage.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/utils/._font_coverage.php differ diff --git a/__MACOSX/MPDF/utils/._font_dump.php b/__MACOSX/MPDF/utils/._font_dump.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/utils/._font_dump.php differ diff --git a/__MACOSX/MPDF/utils/._font_dump_OTL.php b/__MACOSX/MPDF/utils/._font_dump_OTL.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/utils/._font_dump_OTL.php differ diff --git a/__MACOSX/MPDF/utils/._font_names.php b/__MACOSX/MPDF/utils/._font_names.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/utils/._font_names.php differ diff --git a/__MACOSX/MPDF/utils/._image_details.php b/__MACOSX/MPDF/utils/._image_details.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/utils/._image_details.php differ diff --git a/__MACOSX/MPDF/utils/._index.php b/__MACOSX/MPDF/utils/._index.php new file mode 100644 index 0000000..fbf2bbe Binary files /dev/null and b/__MACOSX/MPDF/utils/._index.php differ diff --git a/apiv3/activities/documentations/lists.php b/apiv3/activities/documentations/lists.php new file mode 100644 index 0000000..00350f2 --- /dev/null +++ b/apiv3/activities/documentations/lists.php @@ -0,0 +1,48 @@ +query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current) ) ; + if ( $mysqli_query->num_rows > 0 ){ + + $status = '1' ; + $message = 'Success.' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['documentation_message'] = html_entity_decode( stripslashes( $row['documentation_message'] ) ) ; + $list[] = $row ; + } + $data = [ + 'list' => [ + "current_page" => $current, + "data" => $list, + "from" => '', + "last_page" => $pagination['last_page'], + "next_page_url" => '', + "path" => '', + "per_page" => $limit, + "prev_page_url" => '', + "to" => '', + "total" => $pagination['total'] + ], + 'file_path' => PATH.'uploads/Documentation/' + ] ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/attendances/attendance.php b/apiv3/attendances/attendance.php new file mode 100644 index 0000000..635a765 --- /dev/null +++ b/apiv3/attendances/attendance.php @@ -0,0 +1,71 @@ +query("SELECT * FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id = '".$staff_info['staff_id']."' AND created_at LIKE '".$today_month."%' ORDER BY created_at ASC") ; + $list = [] ; + if ( $attendances_q->num_rows > 0 ){ + while ( $attendance = $attendances_q->fetch_assoc() ){ + $created_at = $attendance['created_at'] ; + $created_date = date('Y-m-d', strtotime($created_at)) ; + $list[$created_date][] = date('H:i', strtotime($attendance['created_at'])) ; + } + } + + + $all = [] ; + for ( $a = $last_day ; $a >= 1 ; $a-- ){ + + $lead = $today_month.'-'.str_pad( $a, '2', '0', STR_PAD_LEFT ) ; + $temp = [] ; + for ( $b = 1 ; $b <= 6 ; $b++ ){ + $temp[] = '' ; + } + + if ( !empty($list[$lead]) ){ + $count = 0 ; + foreach ( $list[$lead] as $k => $v ){ + if ( $count < 6 ){ + $temp[$count] = $v ; + } + $count++ ; + } + } + + // get attendance list + $attendance_list_q = $mysqli->query("SELECT list_work_day, list_type_remark FROM staff_attendance_list + WHERE deleted_at IS NULL AND staff_id = '".$staff_info['staff_id']."' AND list_date = '".$lead."' LIMIT 1") ; + $work_day = '0' ; + $work_type = '' ; + if ( $attendance_list_q->num_rows > 0 ){ + $attendance_list = $attendance_list_q->fetch_assoc() ; + $work_day = $attendance_list['list_work_day'] ; + $work_type = $attendance_list['list_type_remark'] ; + } + + $all[] = [ + 'date' => $lead, + 'date_name' => date('d M Y', strtotime($lead)), + 'work_day' => $work_day, + 'type' => $work_type, + 'time' => $temp + ] ; + } + + $data = [ + 'attendance' => $all + ] ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/attendances/check.php b/apiv3/attendances/check.php new file mode 100644 index 0000000..dbe95b3 --- /dev/null +++ b/apiv3/attendances/check.php @@ -0,0 +1,454 @@ +query( "SELECT a.module FROM app_service a + WHERE a.deleted_at IS NULL AND a.type = 'service' AND a.module IN ( 'Hr', 'HrBranch', 'HrManual' ) AND on_off = 'on' + LIMIT 2" ) ; + + if ( $services->num_rows > 0 ){ + while ( $row_service = $services->fetch_assoc() ){ + if ( $row_service['module'] == 'Hr' ){ + $is_show = 'yes' ; + } + if ( $row_service['module'] == 'HrBranch' ){ + $is_show = 'yes' ; + $is_filterbranch = 'yes' ; + } + if ( $row_service['module'] == 'HrManual' ){ + $is_show = 'manual' ; + $is_filterbranch = 'yes' ; + } + } + } + + if ( $array['module'] == 'branch' ){ + $is_show = 'yes' ; + $is_filterbranch = 'yes' ; + + if ( $array['branch_id'] != '' ){ + $get_branch = $mysqli->query("SELECT branch_name FROM branch + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' LIMIT 1") ; + if ( $get_branch->num_rows > 0 ){ + $branch = $get_branch->fetch_assoc() ; + + $branch_name = $branch['branch_name'] ; + } + } + } + + + $list = [] ; + + $total_staffs = 0 ; + $present = 0 ; + $late = 0 ; + $rest_late = 0 ; + $absent = 0 ; + $merit = 0 ; + $passionate = 0 ; + $in_off = 0 ; + $in_mc = 0 ; + $in_leave = 0 ; + $in_off_working = 0 ; + $error = 0 ; + $present_list = [] ; + $late_list = [] ; + $rest_late_list = [] ; + $absent_list = [] ; + $off_list = [] ; + $mc_list = [] ; + $leave_list = [] ; + $off_working_list = [] ; + $merit_list = [] ; + $passionate_list = [] ; + + $yesterday_day = date('N', strtotime('-1 days')) ; + $today_day = date('N', time()) ; + $date_yesterday = date('Y-m-d', strtotime('-1 days')) ; + $date_today = date('Y-m-d', time()) ; + $date_next = date('Y-m-d', strtotime('+1 days')) ; + + if ( $is_show == 'yes' ){ + + // filter department + $check_department = false; + if( $department_id > 0 ){ + $check_department = true ; + $search_query1 .= " AND a.department_id = '".$department_id."'" ; + } + + // loop all group + $working_q = $mysqli->query("SELECT group_id, working_day, working_next_day, working_on, working_morning_start as working_period_from, working_morning_end as working_period_to, working_break_start as working_from, working_break_end as working_to, working_break_end_include_ot as working_to_include_ot, working_max_ot, working_period_before, working_total_rest_hours FROM setting_working + WHERE deleted_at IS NULL AND group_id > '0' AND ( working_day = '".$yesterday_day."' OR working_day = '".$today_day."' )") ; + $row_working = [] ; + if ( $working_q->num_rows > 0 ){ + while ( $working = $working_q->fetch_assoc() ){ + $row_working[$working['group_id']][$working['working_day']] = $working ; + } + } + + // get all last checkin attendace + $attendance_q = $mysqli->query( "SELECT staff_id, MAX(created_at) AS created_at FROM staff_attendance + WHERE deleted_at IS NULL + GROUP BY staff_id" ) ; + $row_attendance = [] ; + if ( $attendance_q->num_rows > 0 ){ + while ( $attendance = $attendance_q->fetch_assoc() ){ + $row_attendance[$attendance['staff_id']] = $attendance['created_at'] ; + } + } + + // get all last 4 checkin attendace + $attendance_2days_q = $mysqli->query( "SELECT staff_id, created_at FROM staff_attendance + WHERE deleted_at IS NULL AND list_id = '0' AND '".date( 'Y-m-d', time() )." 23:59:59'" ) ; + $row_attendance_2days = [] ; + if ( $attendance_2days_q->num_rows > 0 ){ + while ( $attendance_2days = $attendance_2days_q->fetch_assoc() ){ + $row_attendance_2days[$attendance_2days['staff_id']][] = $attendance_2days['created_at'] ; + } + } + + // get all mc / unpaid / annual today + $leave_q = $mysqli->query("SELECT staff_id, leave_type FROM staff_leave_date + WHERE deleted_at IS NULL AND leave_type_mode = 'working' AND leave_date = '".$date_today."'") ; + $row_leave = [] ; + if ( $leave_q->num_rows > 0 ){ + while ( $leave = $leave_q->fetch_assoc() ){ + $row_leave[$leave['staff_id']] = $leave['leave_type'] ; + } + } + + // get all staff + $staffs_q = $mysqli->query( "SELECT staff_id, staff_idno, staff_name, staff_image, group_id FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".$date_today."' ) AND deleted_at IS NULL ".( $is_filterbranch == 'yes' ? " AND branch_id = '".$array['branch_id']."'" : '' )." + ORDER BY (staff_idno+0)" ) ; + + + if ( $staffs_q->num_rows > 0 ){ + + $status = '200' ; + + $row_staff = [] ; + while ( $staff = $staffs_q->fetch_assoc() ){ + + if( $check_department ){ + $mysqli_department = $mysqli->query( "SELECT a.department_id, b.department_desc FROM staff_department a + LEFT JOIN setting_department_translation b ON ( b.department_id = a.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND a.staff_id = '".$staff['staff_id']."'".$search_query1 ) ; + $count = 0 ; + $department_name = '' ; + if( $mysqli_department->num_rows > 0 ){ + while( $row_department = $mysqli_department->fetch_assoc() ){ + $count++ ; + + $break = '' ; + if( $count == 3 ){ + $break = "\n" ; + $count = 0 ; + } + + $department_name .= $row_department['department_desc'].', '.$break ; + } + $department_name = substr( $department_name, 0, -2 ) ; + + if( $department_name != '' ){ + $row_staff[] = $staff ; + } + } + }else{ + $row_staff[] = $staff ; + } + } + + + foreach ( $row_staff as $staff ){ + + $total_staffs++ ; + + $this_working = $row_working[$staff['group_id']] ; + $this_type = '' ; + $attendance = '' ; + $last_late = '' ; + + if ( arrayCheck( $this_working ) ){ + + // get staff attendance + $attendance = $row_attendance[$staff['staff_id']] ; + $attendance_all = $row_attendance_2days[$staff['staff_id']] ; + $attendance_first = ( isset($attendance_all[0]) ? $attendance_all[0] : '' ) ; + + // check if mc / unpaid / annual leave today + $get_leave = $row_leave[$staff['staff_id']] ; + if ( $get_leave != '' ){ + + if ( $get_leave == 'sick' ){ + $in_mc++ ; + $this_type = 'mc' ; + } + if ( $get_leave == 'unpaid' ){ + $in_leave++ ; + $this_type = 'leave' ; + } + if ( $get_leave == 'annual' ){ + $in_leave++ ; + $this_type = 'leave' ; + } + + }else{ + + // check today day working + $working = $this_working[$today_day] ; + + $check_current_datetime = $date_today.' '.$working['working_period_from'] ; + $check_next_datetime = $date_next.' '.$working['working_period_to'] ; + $working_from = $date_today.' '.$working['working_from'] ; + if ( $working['working_period_before'] > 0 ){ + $working_from = $date_today.' '.addTime( $working['working_from'], convertToTimes($working['working_period_before']) ) ; + } + + $working_to = $date_today.' '.$working['working_to'] ; + $working_to_include_ot = $date_today.' '.$working['working_to_include_ot'] ; + $working_max_ot = $working['working_max_ot'] ; + + if ( $working_from > $working_to ){ + $working_to = $date_next.' '.$working['working_to'] ; + } + if ( $working['working_to_include_ot'] != '' && $working['working_to_include_ot'] != '00:00:00' ){ + $working_to = $date_next.' '.$working['working_to_include_ot'] ; + } + + + if ( $working_max_ot != '' && $working_max_ot != '00:00:00' ){ + $convertMinutes = convertMinutes($working_max_ot) ; + $working_to = date("Y-m-d H:i:s", strtotime($working_to . ' + '.$convertMinutes.' minutes')) ; + } + + // check if allow to insert attendances + if ( TODAYDATE >= $check_current_datetime ){ + + // this guys is working within this day + + }else{ + + if ( $attendance >= $working_to ){ + + // this guys is working within this day + + }else{ + + if ( date('Y-m-d', strtotime($attendance)) == $yesterday_day ){ + + // check yesterday day working + $working = $this_working[$yesterday_day] ; + $check_current_datetime = $date_yesterday.' '.$working['working_period_from'] ; + $check_next_datetime = $date_today.' '.$working['working_period_to'] ; + $working_from = $date_yesterday.' '.$working['working_from'] ; + $working_to = $date_yesterday.' '.$working['working_to'] ; + $working_max_ot = $working['working_max_ot'] ; + + if ( $working_from > $working_to ){ + $working_to = $date_today.' '.$working['working_to'] ; + } + if ( $working['working_to_include_ot'] != '' && $working['working_to_include_ot'] != '00:00:00' ){ + $working_to = $date_today.' '.$working['working_to_include_ot'] ; + } + + } + + } + } + + $working_to_10 = date("Y-m-d H:i:s", strtotime($working_to . ' + 10 hours')) ; + + if ( $working['working_if_flexi'] == 'yes' ){ + $working_from = $check_current_datetime ; + $working_to = $check_next_datetime ; + } + + if ( $working["working_on"] == "yes" ){ + + // check if within working period + if ( TODAYDATE >= $check_current_datetime && TODAYDATE <= $working_to ){ + + if ( $attendance_first >= $check_current_datetime && $attendance_first <= $working_to ){ + if ( $attendance_first >= $working_from ){ + $late++ ; + $this_type = 'late' ; + $last_late = subtractTime( $attendance_first, $working_from ) ; + }else{ + + $present++ ; + $this_type = 'working' ; + + if ( count( $attendance_all ) == 2 || count( $attendance_all ) == 3 ){ + $rest_out = $attendance_all[1] ; + $rest_in = ( count( $attendance_all ) == 3 ? $attendance_all[2] : TODAYDATE ) ; + + $total_rest = subtractTime( $rest_in, $rest_out ) ; + if ( $total_rest > $working['working_total_rest_hours'] ){ + $rest_late++ ; + $this_type = 'rest_late' ; + $last_late = subtractTime( $rest_in, $rest_out ) ; + } + $attendance_first = $attendance ; + } + + } + }else{ + + if ( TODAYDATE >= $working_from ){ + $absent++ ; + $this_type = 'absent' ; + $attendance_first = $attendance ; + } + } + + }else{ + + // check absent + if ( $attendance >= $check_current_datetime && $attendance <= $check_next_datetime ){ + + // check error + if ( $attendance >= $check_current_datetime && $attendance <= $working_to_10 ){ + // do nothing + }else{ + $error++ ; + $this_type = 'error' ; + } + + }else{ + + if ( TODAYDATE >= $check_current_datetime && TODAYDATE <= $check_next_datetime ){ + $absent++ ; + $this_type = 'absent' ; + $attendance_first = $attendance ; + } + } + + } + + }else{ + if ( $attendance >= $working_from && $attendance <= $check_next_datetime ){ + $in_off_working++ ; + $this_type = 'off_working' ; + }else{ + $in_off++ ; + $this_type = 'off' ; + } + } + } + + $temp = [ + 'staff_id' => $staff['staff_id'], + 'staff_image' => PATH . ( $staff['staff_image'] != '' ? 'uploads/Staff/'.$staff['staff_image'] : 'images/NoProduct.jpg' ), + 'staff_idno' => $staff['staff_idno'], + 'staff_name' => $staff['staff_name'], + 'last_late' => ( $last_late != '' ? date( 'H:i', strtotime($last_late) ) : '' ), + 'last_attendance' => ( $attendance_first != '' ? $attendance_first : '-' ) + ] ; + + switch ( $this_type ){ + case 'working' : $present_list[] = $temp ; break ; + case 'late' : $late_list[] = $temp ; break ; + case 'rest_late' : $rest_late_list[] = $temp ; break ; + case 'absent' : $absent_list[] = $temp ; break ; + case 'off' : $off_list[] = $temp ; break ; + case 'off_working' : $off_working_list[] = $temp ; break ; + case 'mc' : $mc_list[] = $temp ; break ; + case 'leave' : $leave_list[] = $temp ; break ; + case 'error' : $error_list[] = $temp ; break ; + } + + } + + } + } + } + + + + + if ( $is_show == 'manual' ){ + + $staffs = $mysqli->query( "SELECT a.type, a.times, b.staff_id, b.staff_image, b.staff_idno, b.staff_name FROM staff_attendance_summary a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND b.branch_id = '".$array['branch_id']."'" ) ; + if ( $staffs->num_rows > 0 ){ + + $status = '200' ; + + while ( $staff = $staffs->fetch_assoc() ){ + + $temp = [ + 'staff_id' => $staff['staff_id'], + 'staff_image' => PATH . ( $staff['staff_image'] != '' ? 'uploads/Staff/'.$staff['staff_image'] : 'images/NoProduct.jpg' ), + 'staff_idno' => $staff['staff_idno'], + 'staff_name' => $staff['staff_name'], + 'last_attendance' => $staff['times'] + ] ; + + if ( $staff['type'] == 'late' ){ + $late++ ; + $late_list[] = $temp ; + } + + if ( $staff['type'] == 'absent' ){ + $absent++ ; + $absent_list[] = $temp ; + } + + if ( $staff['type'] == 'merit' ){ + $merit++ ; + $merit_list[] = $temp ; + } + + if ( $staff['type'] == 'passionate' ){ + $passionate++ ; + $passionate_list[] = $temp ; + } + + } + } + + } + + $data = [ + 'staff' => $total_staffs, + 'branch_name' => dataFilter( $branch_name ), + 'present' => $present, + 'present_list' => $present_list, + 'late' => ( $late + $rest_late ), + 'late_list' => array_merge( $late_list, $rest_late_list ), + 'absent' => $absent, + 'absent_list' => $absent_list, + 'in_off' => $in_off, + 'off_list' => $off_list, + 'in_mc' => $in_mc, + 'mc_list' => $mc_list, + 'in_leave' => $in_leave, + 'in_off_working' => $in_off_working, + 'leave_list' => $leave_list, + 'off_working_list' => $off_working_list, + 'merit' => $merit, + 'merit_list' => $merit_list, + 'passionate' => $passionate, + 'passionate_list' => $passionate_list + ] ; +// } + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/attendances/punch.php b/apiv3/attendances/punch.php new file mode 100644 index 0000000..dcd6969 --- /dev/null +++ b/apiv3/attendances/punch.php @@ -0,0 +1,183 @@ +query( "SELECT staff_id, branch_id, staff_settings FROM staff + WHERE staff_idno = '".$qrcode."' AND ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL " ) ; + if ( $select_qrcode->num_rows > 0 ){ + $boolean_access = true ; + $data_qrcode = $select_qrcode->fetch_assoc() ; + + $staff_id = $data_qrcode['staff_id'] ; + $branch_id = $data_qrcode['branch_id'] ; + $staff_settings = $data_qrcode['staff_settings'] ; + } + +}else{ + if ( $boolean_login ){ + $boolean_access = true ; + + $staff_id = $staff_info['staff_id'] ; + $branch_id = $staff_info['branch_id'] ; + $staff_settings = $staff_info['staff_settings'] ; + } +} + +if ( $boolean_access ){ + $status = '300' ; + + if ( ( $input_type == 'qrcode' && $qrcode != '' ) || $input_type == 'button' || $input_type == 'selfpunch' ){ + $status = '272' ; + + $first_string = substr( $qrcode, 0, 1 ) ; + + $boolean_qr = false ; + if ( $input_type == 'button' || $input_type == 'selfpunch' ){ + $boolean_qr = true ; + $date_code = TODAYDATE ; + $code_status = '0' ; + }else{ + $check = $mysqli->query( "SELECT qrcode_id, status, created_at FROM qrcodes + WHERE deleted_at IS NULL AND type = 'checkin' AND code = '".$qrcode."' LIMIT 1" ) ; + if ( $check->num_rows > 0 ){ + $get = $check->fetch_assoc() ; + $boolean_qr = true ; + $date_code = $get['created_at'] ; + $code_status = $get['status'] ; + } + } + + + if ( $boolean_qr ){ + $status = '277' ; + + $date_current = TODAYDATE ; + $date_time = date('Y-m-d H:i:s', strtotime($date_current . ' -5 minutes')) ; + $date_time_res = date('Y-m-d H:i:s', strtotime($date_current . ' -15 minutes')) ; + $date_group = date('Y-m-d', strtotime($date_current)) ; + + // check if code not yet expired. + if ( $date_code > $date_time ){ + $status = '276' ; + + // check code status + if ( $code_status == '0' ){ + $status = '275' ; + + // check last check in out time + // get previous check in & out type + $last_attendance_q = $mysqli->query("SELECT type, check_group, created_at FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' ORDER BY created_at DESC LIMIT 1") ; + $boolean_last = false ; + $boolean_last_att = false ; + if ( $last_attendance_q->num_rows > 0 ){ + $last_attendance = $last_attendance_q->fetch_assoc() ; + if ( $date_time_res > $last_attendance['created_at'] ){ + $boolean_last = true ; + $boolean_last_att = true ; + } + }else{ + $boolean_last = true ; + } + + if ( $boolean_last ){ + + $status = '270' ; + + $check_area = 'out' ; + if ( $latitude != '' && $longitude != '' ){ + + // get this staff branch + $get_branch = $mysqli->query("SELECT branch_geometry FROM branch + WHERE deleted_at IS NULL AND branch_id = '".$branch_id."' LIMIT 1") ; + if ( $get_branch->num_rows > 0 ){ + + $branch = $get_branch->fetch_assoc() ; + $branch_geometry = $branch['branch_geometry'] ; + if ( $branch_geometry != '' ){ + $pointLatLng = geoPHP::load("POINT(".$longitude." ".$latitude.")","wkt") ; + $polygon = geoPHP::load($branch_geometry,'wkt') ; + $inpolygon = $polygon->pointInPolygon($pointLatLng) ; + if ( $inpolygon ){ + $check_area = 'in' ; + } + } + + } + } + + if ( $check_area == 'in' || $staff_settings['without_geometry'] == 'yes' || $input_type == 'selfpunch' ){ + + // start commit + $error = 0 ; + $mysqli->autocommit( false ) ; + + if ( $input_type == 'qrcode' ){ + // update qrcode + if ( $mysqli->query("UPDATE qrcodes SET + staff_id = '".$staff_id."', + status = '1', + updated_at = '".TODAYDATE."' + WHERE qrcode_id = '".$get['qrcode_id']."'") ){ }else{ + $error++ ; + } + } + + $check_type = 'in' ; + if ( $boolean_last_att ){ + // check if last attendance is in + if ( $last_attendance['type'] == 'in' ){ + $date_group = $last_attendance['check_group'] ; + $check_type = 'out' ; + } + } + + // insert new attendance record + if ( $mysqli->query("INSERT INTO staff_attendance + ( staff_id, check_group, type, code, record_from, mac_address, ip_address, latitude, longitude, check_area, created_at, updated_at ) VALUES + ( '".$staff_id."', '".$date_group."', '".$check_type."', '".$qrcode."', '".$input_type."', '".$mac_address."', '".$ip_address."', '".$latitude."', '".$longitude."', '".$check_area."', '".TODAYDATE."', '".TODAYDATE."' )") ){ }else{ + $error++ ; + } + + if ( $error == 0 ) { + $mysqli->commit() ; + $status = '200' ; + }else{ + $mysqli->rollback() ; + $status = '304' ; + } + } + + } + + } + + } + + } + + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/auths/change-password.php b/apiv3/auths/change-password.php new file mode 100644 index 0000000..8a46157 --- /dev/null +++ b/apiv3/auths/change-password.php @@ -0,0 +1,40 @@ +query( "UPDATE staff SET + staff_password = '".$enc_password."' + WHERE staff_id = '".$staff_info['staff_id']."'" ) ){ + + $status = '208' ; + + $mailer = new Mailer() ; + $mailer->from = EMAILNOREPLY ; + $mailer->to = [ $staff_info['staff_email'] ] ; + $mailer->subject = 'Change password' ; + $mailer->body = 'Your new password was success change to ' . $array['password'] ; + if ( $mailer->send() ){ + $status = '200' ; + } + + } + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/auths/forgot-password.php b/apiv3/auths/forgot-password.php new file mode 100644 index 0000000..e0991a5 --- /dev/null +++ b/apiv3/auths/forgot-password.php @@ -0,0 +1,47 @@ +query("SELECT staff_id, staff_idno, staff_username, staff_email, staff_mobileno FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned IS NULL OR staff_date_resigned = '0000-00-00' ) AND staff_idno = '".$array['staff_idno']."' AND staff_username = '".$array['username']."' LIMIT 1") ; + + if ( $mysqli_staff->num_rows > 0 ){ + $status = '204' ; + + $row_staff = $mysqli_staff->fetch_assoc() ; + + $password = $row_staff['staff_id'].strPad( 6, rand(000000, 999999) ) ; + $enc_password = passwordEncrypt( $password ) ; + + if ( $mysqli->query( "UPDATE staff SET + staff_password = '".$enc_password."' + WHERE staff_id = '".$row_staff['staff_id']."'" ) ){ + + $status = '208' ; + + $mailer = new Mailer() ; + $mailer->from = EMAILNOREPLY ; + $mailer->to = [ $row_staff['staff_email'] ] ; + $mailer->subject = 'Reset password' ; + $mailer->body = 'Your temporary password is ' . $password ; + if ( $mailer->send() ){ + $status = '200' ; + } + + } + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/auths/login.php b/apiv3/auths/login.php new file mode 100644 index 0000000..02a980d --- /dev/null +++ b/apiv3/auths/login.php @@ -0,0 +1,74 @@ +query("SELECT staff_id, staff_idno, staff_name, staff_shortname, staff_username, staff_email, staff_mobileno, staff_image, job_position_id, job_section_id, branch_id, staff_point_achievement, staff_point, staff_wallet, staff_tier, staff_achievement, staff_star, staff_settings, country_id FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned IS NULL OR staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND staff_username = '".$username."' AND staff_password = '".$password."' LIMIT 1") ; + if ( $mysqli_staff->num_rows > 0 ){ + $status = '200' ; + + $row_staff = $mysqli_staff->fetch_array(MYSQLI_ASSOC) ; + + $code = time().strPad( 6, rand(000000, 999999) ) ; + $tokencode = $row_staff['staff_id'] . '_' . $code . md5($code) ; + + $mysqli->query( "INSERT INTO staff_token + ( staff_id, platform, token ) VALUES + ( '".$row_staff['staff_id']."', '".$array['platform']."', '".$tokencode."' )" ) ; + + if ( $array['notification'] != '' ){ + + $select_notification = $mysqli->query( "SELECT * FROM staff_notification + WHERE notification = '".$array['notification']."' LIMIT 1" ) ; + if ( $select_notification->num_rows == 0 ){ + $mysqli->query( "INSERT INTO staff_notification + ( notification, staff_id ) VALUES + ( '".$array['notification']."', '".$row_staff['staff_id']."' )" ) ; + }else{ + $mysqli->query( "UPDATE staff_notification SET + staff_id = '".$row_staff['staff_id']."' + WHERE notification = '".$array['notification']."'" ) ; + } + } + + $row_staff['staff_image'] = ( $row_staff['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_staff['staff_image']) : '' ) ; + $row_staff['token'] = $tokencode ; + $row_staff['staff_settings'] = ( $row_staff['staff_settings'] != '' ? json_decode($row_staff['staff_settings'], true) : [] ) ; + + + $get_tier = getTier( $row_staff['staff_tier'], $array['lang'] ) ; + $row_staff['staff_tier_level'] = $get_tier['level'] ; + $row_staff['staff_tier_title'] = $get_tier['title'] ; + $row_staff['staff_tier_is_task'] = $get_tier['is_task'] ; + $row_staff['staff_tier_is_task_assigned'] = $get_tier['is_task_assigned'] ; + $row_staff['staff_tier_is_task_incentive'] = $get_tier['is_task_incentive'] ; + $row_staff['staff_tier_is_task_incentive2'] = $get_tier['is_task_incentive2'] ; + $row_staff['staff_tier_is_task_extra'] = $get_tier['is_task_extra'] ; + $row_staff['staff_tier_is_adjustment'] = $get_tier['is_adjustment'] ; + + $row_staff['staff_star'] = ( $row_staff['staff_star'] + 0 ) ; + + + + + + $data = $row_staff ; + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/auths/register.php b/apiv3/auths/register.php new file mode 100644 index 0000000..82bdc5c --- /dev/null +++ b/apiv3/auths/register.php @@ -0,0 +1,34 @@ +query( "SELECT staff_id, staff_idno, staff_name, staff_shortname, staff_username, staff_email, staff_mobileno, staff_image, job_position_id, job_section_id, staff_point_achievement, staff_point, staff_wallet, staff_tier, staff_achievement, staff_star FROM staff + WHERE deleted_at IS NULL AND staff_username = '".$username."' LIMIT 1" ) ; + if ( $mysqli_staff->num_rows == 0 ){ + $status = '200' ; + + $password = passwordEncrypt( $password ) ; + $mysqli->query( "INSERT INTO staff + ( staff_name, staff_username, staff_email, staff_mobileno, staff_password, staff_date_resigned, staff_run_away ) VALUES + ( '".$name."', '".$username."', '".$email."', '".$mobile."', '".$password."', '".TODAYDAY."', 'yes' )" ) ; + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/auths/reset-password.php b/apiv3/auths/reset-password.php new file mode 100644 index 0000000..8a46157 --- /dev/null +++ b/apiv3/auths/reset-password.php @@ -0,0 +1,40 @@ +query( "UPDATE staff SET + staff_password = '".$enc_password."' + WHERE staff_id = '".$staff_info['staff_id']."'" ) ){ + + $status = '208' ; + + $mailer = new Mailer() ; + $mailer->from = EMAILNOREPLY ; + $mailer->to = [ $staff_info['staff_email'] ] ; + $mailer->subject = 'Change password' ; + $mailer->body = 'Your new password was success change to ' . $array['password'] ; + if ( $mailer->send() ){ + $status = '200' ; + } + + } + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/auths/visitor.php b/apiv3/auths/visitor.php new file mode 100644 index 0000000..efe244d --- /dev/null +++ b/apiv3/auths/visitor.php @@ -0,0 +1,50 @@ + $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'Visitor', md5( $array['name'] ), $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $test_filename = $upload['data']['file_name'] ; + $test_filetype = $upload['data']['file_type'] ; + } + } + } + + if ( $test_file != '' ){ + + if ( $mysqli->query( "INSERT INTO visitor + ( name, mobile, temperature, test_file, test_filetype ) VALUES + ( '".$array['name']."', '".$array['mobile']."', '".$array['temperature']."', '".$test_filename."', '".$test_filetype."' )" ) ){ + $status = '200' ; + } + + } + */ + + if ( $mysqli->query( "INSERT INTO visitor + ( name, mobile ) VALUES + ( '".$array['name']."', '".$array['mobile']."' )" ) ){ + $status = '200' ; + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/footer.php b/apiv3/footer.php new file mode 100644 index 0000000..c9bc33e --- /dev/null +++ b/apiv3/footer.php @@ -0,0 +1,16 @@ + $status, + 'message' => $message[$status], + 'data' => $data +] ; + +saveLog( 'api', 'API', $array, $result ) ; + +header('Content-Type: application/json') ; +echo json_encode($result) ; + +?> \ No newline at end of file diff --git a/apiv3/header.php b/apiv3/header.php new file mode 100644 index 0000000..3519b96 --- /dev/null +++ b/apiv3/header.php @@ -0,0 +1,61 @@ + strtotime('-1 minutes') ){ + if ( hash('sha256', $path.$array['platform'].$array['lang'].$array['branch_id'].$array['staff_id'].$array['token'].$array['time'].APIKEY) == $array['sign'] ){ + $access = true ; + } + } + + if ( !$access ){ header("HTTP/1.0 404 Not Found") ; exit ; } +} + +$boolean_login = false ; +$staff_info = [] ; +if ( $must_login == true ){ + $status = '400' ; + + $select = $mysqli->query( "SELECT a.staff_id, b.staff_idno, b.staff_name, b.staff_shortname, b.staff_username, b.staff_email, b.staff_mobileno, b.staff_image, b.job_position_id, b.job_section_id, b.branch_id, b.staff_point_achievement, b.staff_point, b.staff_wallet, b.staff_tier, b.staff_achievement, b.staff_star, b.staff_settings, b.country_id FROM staff_token a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.staff_id = '".$array['staff_id']."' AND a.token = '".$array['token']."' AND ( b.staff_date_resigned IS NULL OR b.staff_date_resigned = '0000-00-00' ) AND b.deleted_at IS NULL" ) ; + if ( $select->num_rows > 0 ){ + $boolean_login = true ; + $staff_info = $select->fetch_assoc() ; + $staff_info['staff_image'] = ( $staff_info['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($staff_info['staff_image']) : '' ) ; + $staff_info['token'] = $array['token'] ; + $staff_info['staff_settings'] = ( $staff_info['staff_settings'] != '' ? json_decode($staff_info['staff_settings'], true) : [] ) ; + + $get_tier = getTier( $staff_info['staff_tier'], $array['lang'] ) ; + $staff_info['staff_tier_level'] = $get_tier['level'] ; + $staff_info['staff_tier_title'] = $get_tier['title'] ; + $staff_info['staff_tier_is_task'] = $get_tier['is_task'] ; + $staff_info['staff_tier_is_task_assigned'] = $get_tier['is_task_assigned'] ; + $staff_info['staff_tier_is_task_incentive'] = $get_tier['is_task_incentive'] ; + $staff_info['staff_tier_is_task_incentive2'] = $get_tier['is_task_incentive2'] ; + $staff_info['staff_tier_is_task_extra'] = $get_tier['is_task_extra'] ; + $staff_info['staff_tier_is_adjustment'] = $get_tier['is_adjustment'] ; + + $staff_info['staff_star'] = ( $staff_info['staff_star'] + 0 ) ; + + } +} + +?> \ No newline at end of file diff --git a/apiv3/hr/advances/details.php b/apiv3/hr/advances/details.php new file mode 100644 index 0000000..d067550 --- /dev/null +++ b/apiv3/hr/advances/details.php @@ -0,0 +1,27 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/advances/lists.php b/apiv3/hr/advances/lists.php new file mode 100644 index 0000000..fa82fdc --- /dev/null +++ b/apiv3/hr/advances/lists.php @@ -0,0 +1,34 @@ +query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/advances/update.php b/apiv3/hr/advances/update.php new file mode 100644 index 0000000..843150c --- /dev/null +++ b/apiv3/hr/advances/update.php @@ -0,0 +1,83 @@ +query("SELECT post_id, post_title as advance_from, post_link as advance_to, post_content as advance_remark FROM system_post + WHERE post_type = 'page-advance' AND post_categories = 'page-advance' AND post_trash = '0' LIMIT 1") ; + if ( $setting_query->num_rows > 0 ){ + $setting = $setting_query->fetch_assoc() ; + } + + $boolean_advance = false ; + if ( $setting['advance_from'] != '' ){ + if ( $setting['advance_from'] <= $day && $setting['advance_to'] >= $day ){ + $boolean_advance = true ; + }else{ + $status = '399' ; + $custom_message = $setting['advance_remark'] ; + } + }else{ + $boolean_advance = true ; + } + + if ( $boolean_advance ){ + + $error = 0 ; + $mysqli->autocommit( false ) ; + + try { + + $advance_amount = is_numeric($advance_amount) ? number_format($advance_amount, 2, '.', '') : 0 ; + $advance_reason = ( $advance_reason != '' ? $advance_reason : 'ADVANCE' ) ; + + // insert into advance + $mysqli->query("INSERT INTO staff_advance + ( staff_id, advance_paidby, advance_amount, advance_reason, advance_status ) VALUES + ( '".$staff_info['staff_id']."', '".$advance_paidby."', '".$advance_amount."', '".$advance_reason."', 'pending' )" ) ; + + $staff_advance_id = $mysqli->insert_id ; + + pushToUserCron( 'staff_advance', $staff_advance_id, $staff_info['staff_id'], 'Apply Advance', 'Advance has been created.' ) ; + + }catch( Exception $e ){ + $error++; + } + + if( $error == 0 ) { + + $status = '200' ; + + // commit query + $mysqli->commit() ; + + }else{ + $mysqli->rollback() ; + } + + } + } +} + +$data['custom_message'] = $custom_message ; + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/healths/details.php b/apiv3/hr/healths/details.php new file mode 100644 index 0000000..8f1a1a5 --- /dev/null +++ b/apiv3/hr/healths/details.php @@ -0,0 +1,27 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/healths/lists.php b/apiv3/hr/healths/lists.php new file mode 100644 index 0000000..7fbd964 --- /dev/null +++ b/apiv3/hr/healths/lists.php @@ -0,0 +1,34 @@ +query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/healths/update.php b/apiv3/hr/healths/update.php new file mode 100644 index 0000000..663cecf --- /dev/null +++ b/apiv3/hr/healths/update.php @@ -0,0 +1,52 @@ +autocommit( false ) ; + + try { + + $health_reason = ( $health_reason != '' ? $health_reason : '' ) ; + + // insert into health + $mysqli->query("INSERT INTO staff_health + ( staff_id, temperature, health_reason ) VALUES + ( '".$staff_info['staff_id']."', '".$temperature."', '".$health_reason."' )" ) ; + + $staff_health_id = $mysqli->insert_id ; + + pushToUserCron( 'staff_health', $staff_health_id, $staff_info['staff_id'], 'Apply Health', 'Health has been created.' ) ; + + }catch( Exception $e ){ + $error++; + } + + if( $error == 0 ) { + + $status = '200' ; + + // commit query + $mysqli->commit() ; + + }else{ + $mysqli->rollback() ; + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/holidays/lists.php b/apiv3/hr/holidays/lists.php new file mode 100644 index 0000000..86fc71a --- /dev/null +++ b/apiv3/hr/holidays/lists.php @@ -0,0 +1,45 @@ +query( $query . " ORDER BY holiday_date ASC" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + while ( $row = $mysqli_query->fetch_assoc() ){ + + $set_status = 'current' ; + if ( $row['holiday_date'] > date( "Y-m-d", time() ) ){ + $set_status = 'future' ; + }elseif ( $row['holiday_date'] < date( "Y-m-d", time() ) ){ + $set_status = 'passed' ; + } + $row['status'] = $set_status ; + + $list[] = $row ; + } + + } +} + +$data['list'] = $list ; + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/identities/details.php b/apiv3/hr/identities/details.php new file mode 100644 index 0000000..e982875 --- /dev/null +++ b/apiv3/hr/identities/details.php @@ -0,0 +1,187 @@ +query( "SELECT a.staff_id, a.branch_id, a.staff_idno, a.staff_name, a.staff_shortname, a.staff_username, a.staff_email, a.staff_mobileno, a.staff_birthdate, a.job_position_id, a.job_section_id, a.staff_image, a.staff_point_achievement, a.staff_point, a.staff_tier, a.staff_achievement, a.staff_star, a.gender_id, a.country_id, a.staff_date_joined, a.job_section_id, a.job_position_id, a.staff_icno, a.staff_passportno, a.staff_passportexpired, a.staff_permitno, a.staff_permit_start, a.staff_permit_end, a.staff_permit_effective_date, a.staff_settings FROM staff a + WHERE a.deleted_at IS NULL AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL ) ".$search_query." + LIMIT 1" ) ; + + if ( $select_staff->num_rows > 0 ){ + $status = '200' ; + + $row_staff = $select_staff->fetch_assoc() ; + $row_staff['staff_name'] = ucwords( strtolower( $row_staff['staff_name'] ) ) ; + $row_staff['staff_image'] = ( $row_staff['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_staff['staff_image']) : '' ) ; + $row_staff['staff_mobileno'] = ( $row_staff['staff_mobileno'] != '' ? '+'.$row_staff['staff_mobileno'] : '' ) ; + $row_staff['staff_birthdate'] = resetDateFormat( $row_staff['staff_birthdate'] ) ; + + $staff_settings = json_decode($row_staff['staff_settings'], true) ; + $row_staff['mailing_address'] = checkExists( $staff_settings['mailing_address'] ) ; + $row_staff['staff_date_joined'] = ( $row_staff['staff_date_joined'] != '0000-00-00' && $row_staff['staff_date_joined'] != '' ? resetDateFormat( $row_staff['staff_date_joined'] ) : '' ) ; + + // get branch + $branch = '' ; + $get_branch = $mysqli->query( "SELECT * FROM branch WHERE deleted_at IS NULL AND branch_id = '".$row_staff['branch_id']."' LIMIT 1" ) ; + if ( $get_gender->num_rows > 0 ){ + $row_gender = $get_gender->fetch_assoc() ; + $gender = $row_gender['gender_desc'] ; + } + $row_staff['staff_gender'] = ucwords( strtolower( $gender ) ) ; + + // get gender + $gender = '' ; + $get_gender = $mysqli->query( "SELECT * FROM master_gender WHERE deleted_at IS NULL AND gender_id = '".$row_staff['gender_id']."' LIMIT 1" ) ; + if ( $get_gender->num_rows > 0 ){ + $row_gender = $get_gender->fetch_assoc() ; + $gender = $row_gender['gender_desc'] ; + } + $row_staff['staff_gender'] = ucwords( strtolower( $gender ) ) ; + + // get country + $country = '' ; + $get_country = $mysqli->query( "SELECT * FROM master_country WHERE deleted_at IS NULL AND country_id = '".$row_staff['country_id']."' LIMIT 1" ) ; + if ( $get_country->num_rows > 0 ){ + $row_country = $get_country->fetch_assoc() ; + $country = $row_country['country_desc'] ; + } + $row_staff['staff_country'] = ucwords( strtolower( $country ) ) ; + + // get department + $department = '' ; + $department_list = [] ; + $get_department = $mysqli->query( "SELECT a.department_id, b.department_desc FROM staff_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND a.staff_id = '".$row_staff['staff_id']."'" ) ; + if ( $get_department->num_rows > 0 ){ + while ( $row_department = $get_department->fetch_assoc() ){ + $department_list[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } + $department = implode( ', ', $department_list ) ; + } + $row_staff['staff_department'] = ucwords( strtolower( $department ) ) ; + + // get section + $section = '' ; + $get_section = $mysqli->query( "SELECT b.job_section_desc FROM setting_job_section a + LEFT JOIN setting_job_section_translation b ON ( a.job_section_id = b.job_section_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND a.job_section_id = '".$row_staff['job_section_id']."' LIMIT 1" ) ; + if ( $get_section->num_rows > 0 ){ + $row_section = $get_section->fetch_assoc() ; + $section = $row_section['job_section_desc'] ; + } + $row_staff['staff_section'] = ucwords( strtolower( $section ) ) ; + + $position = '' ; + $get_position = $mysqli->query( "SELECT b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND a.job_position_id = '".$row_staff['job_position_id']."' LIMIT 1" ) ; + if ( $get_position->num_rows > 0 ){ + $row_position = $get_position->fetch_assoc() ; + $position = $row_position['job_position_desc'] ; + } + $row_staff['staff_position'] = ucwords( strtolower( $position ) ) ; + + // get passport / permit + $passportimages = [] ; + $permitimages = [] ; + $get_staff_image = $mysqli->query("SELECT * FROM staff_image WHERE deleted_at IS NULL AND staff_id = '".$row_staff['staff_id']."'") ; + if ( $get_staff_image->num_rows > 0 ){ + while ( $row_staff_image = $get_staff_image->fetch_assoc() ){ + if ( $row_staff_image['type'] == 'passport' ){ + $passportimages[] = PATH.'uploads/StaffImage/b/'.$row_staff_image['file_name'] ; + } + if ( $row_staff_image['type'] == 'permit' ){ + $permitimages[] = PATH.'uploads/StaffImage/b/'.$row_staff_image['file_name'] ; + } + } + } + $row_staff['passportimages'] = $passportimages ; + $row_staff['permitimages'] = $permitimages ; + + // get tier + $get_tier = getTier( $row_staff['staff_tier'], $array['lang'] ) ; + $row_staff['staff_tier_level'] = $get_tier['level'] ; + $row_staff['staff_tier_title'] = $get_tier['title'] ; + $row_staff['staff_tier_is_task'] = $get_tier['is_task'] ; + $row_staff['staff_tier_is_task_assigned'] = $get_tier['is_task_assigned'] ; + $row_staff['staff_tier_is_task_incentive'] = $get_tier['is_task_incentive'] ; + $row_staff['staff_tier_is_task_incentive2'] = $get_tier['is_task_incentive2'] ; + $row_staff['staff_tier_is_task_extra'] = $get_tier['is_task_extra'] ; + $row_staff['staff_tier_is_adjustment'] = $get_tier['is_adjustment'] ; + + $row_staff['staff_star'] = ( $row_staff['staff_star'] + 0 ) ; + + // get join training + $trainings = [] ; + $get_training = $mysqli->query( "SELECT a.created_at, b.title FROM staff_training a + LEFT JOIN training_translation b ON ( a.training_id = b.training_id ) + WHERE b.lang = '".$array['lang']."' AND a.staff_id = '".$row_staff['staff_id']."' AND a.status IN ( 'confirmed', 'rated' ) + GROUP BY a.training_id + ORDER BY a.updated_at DESC + LIMIT 15" ) ; + if ( $get_training->num_rows > 0 ){ + while ( $row_training = $get_training->fetch_assoc() ){ + $trainings[] = [ + 'title' => dataFilter( $row_training['title'] ), + 'created_at' => resetDateFormat( $row_training['created_at'] ) + ] ; + } + } + $row_staff['trainings'] = $trainings ; + + + // get join association + $associations = [] ; + $get_association = $mysqli->query( "SELECT a.created_at, b.title FROM staff_association a + LEFT JOIN association_translation b ON ( a.association_id = b.association_id ) + WHERE b.lang = '".$array['lang']."' AND a.staff_id = '".$row_staff['staff_id']."' AND a.status IN ( 'confirmed', 'rated' ) + GROUP BY a.association_id + ORDER BY a.updated_at DESC + LIMIT 15" ) ; + if ( $get_association->num_rows > 0 ){ + while ( $row_association = $get_association->fetch_assoc() ){ + $associations[] = [ + 'title' => dataFilter( $row_association['title'] ), + 'created_at' => resetDateFormat( $row_association['created_at'] ) + ] ; + } + } + $row_staff['associations'] = $associations ; + + + // get outstanding + $outstanding = '' ; + $get_outstanding = $mysqli->query( "SELECT type FROM staff_attendance_summary + WHERE deleted_at IS NULL AND staff_id = '".$row_staff['staff_id']."' AND type IN ( 'merit', 'passionate' ) " ) ; + if ( $get_outstanding->num_rows > 0 ){ + $row_outstanding = $get_outstanding->fetch_assoc() ; + $outstanding = $row_outstanding['type'] ; + } + $row_staff['outstanding'] = $outstanding ; + + + unset( $row_staff['staff_settings'] ) ; + $data = $row_staff ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/leaves/details.php b/apiv3/hr/leaves/details.php new file mode 100644 index 0000000..4654bbc --- /dev/null +++ b/apiv3/hr/leaves/details.php @@ -0,0 +1,29 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $row['leave_reason'] = dataFilter( $row['leave_reason'] ) ; + $row['leave_file'] = ( $row['leave_file'] != '' ? PATH.'uploads/Leave/b/'.$row['leave_file'] : '' ) ; + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/leaves/lists.php b/apiv3/hr/leaves/lists.php new file mode 100644 index 0000000..db4abe8 --- /dev/null +++ b/apiv3/hr/leaves/lists.php @@ -0,0 +1,60 @@ +query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['leave_reason'] = dataFilter( $row['leave_reason'] ) ; + $list[] = $row ; + } + + } + + $data['list'] = $list ; + + + + // get left leave + $annual_leave = 0 ; + $sick_leave = 0 ; + + $select_leave_year = $mysqli->query( "SELECT leave_type, leave_days FROM staff_leave_year + WHERE deleted_at IS NULL AND staff_id = '".$staff_info['staff_id']."' AND leave_year = '".date('Y', time())."'" ) ; + if ( $select_leave_year->num_rows > 0 ){ + while ( $row_leave_year = $select_leave_year->fetch_assoc() ){ + if ( $row_leave_year['leave_type'] == 'annual' ){ + $annual_leave = $row_leave_year['leave_days'] ; + } + if ( $row_leave_year['leave_type'] == 'sick' ){ + $sick_leave = $row_leave_year['leave_days'] ; + } + } + } + + + + $data['annual_leave'] = $annual_leave ; + $data['sick_leave'] = $sick_leave ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/leaves/staff-lists.php b/apiv3/hr/leaves/staff-lists.php new file mode 100644 index 0000000..9b8e5ad --- /dev/null +++ b/apiv3/hr/leaves/staff-lists.php @@ -0,0 +1,108 @@ +query( "SELECT a.module FROM app_service a + WHERE a.deleted_at IS NULL AND a.type = 'service' AND a.module IN ( 'HrBranch' ) AND on_off = 'on' + LIMIT 1" ) ; + $is_filterbranch = 'no' ; + if ( $services->num_rows > 0 ){ + $is_filterbranch = 'yes' ; + } + + $search_query = ( $is_filterbranch == 'yes' ? " AND branch_id = '".$array['branch_id']."'" : '' ) ; + $search_query2 = '' ; + + $search_query .= " AND ( a.leave_from LIKE '%".$searchyearmonth."%' OR a.leave_to LIKE '%".$searchyearmonth."%' )" ; + $search_query2 .= " AND holiday_date LIKE '%".$searchyearmonth."%'" ; + + if ( $searchday != '' ){ + $searchyearmonthday = $searchyearmonth . '-' . $searchday ; + + $search_query .= " AND a.leave_from <= '".$searchyearmonthday."' AND a.leave_to >= '".$searchyearmonthday."'" ; + $search_query2 .= " AND holiday_date = '".$searchyearmonthday."'" ; + } + + $query = "SELECT a.leave_type, a.leave_from, a.leave_to, a.leave_day, a.leave_reason, a.leave_status, b.staff_idno, b.staff_name, b.staff_shortname FROM staff_leave a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE b.deleted_at IS NULL AND ( b.staff_date_resigned >= '".date("Y-m-d",time())."' OR b.staff_date_resigned = '0000-00-00' OR b.staff_date_resigned IS NULL ) AND a.deleted_at IS NULL AND a.leave_status IN ( 'pending', 'confirmed' ) " . $search_query ; + + $mysqli_query = $mysqli->query( $query . " ORDER BY leave_from" ) ; + + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + while ( $row = $mysqli_query->fetch_assoc() ){ + + $boolean_loop = true ; + $leave_from = $row['leave_from'] ; + $leave_to = $row['leave_to'] ; + $row['leave_reason'] = dataFilter( $row['leave_reason'] ) ; + while ( $boolean_loop ){ + if ( $leave_from <= $leave_to ){ + $selected[$leave_from] = $leave_from ; + }else{ + $boolean_loop = false ; + } + + $leave_from = date('Y-m-d', strtotime("+1 day", strtotime($leave_from))) ; + } + + $row['type'] = 'leave' ; + $list[] = $row ; + } + } + + + + $query_holiday = "SELECT * FROM setting_holiday + WHERE deleted_at IS NULL " . $search_query2 ; + $mysqli_holiday = $mysqli->query( $query_holiday . " ORDER BY holiday_date ASC" ) ; + if ( $mysqli_holiday->num_rows > 0 ){ + while ( $row_holiday = $mysqli_holiday->fetch_assoc() ){ + $row_holiday['type'] = 'holiday' ; + $list[] = $row_holiday ; + } + } + + + + $first_day_of_month = $searchyearmonth . '-01' ; + $last_day_of_month = $searchyearmonth . '-' . date( 't', strtotime( $first_day_of_month ) ) ; + for ( $a = $first_day_of_month ; $a <= $last_day_of_month ; $a++ ){ + if ( $selected[$a] != null ){ + $marked[$a] = [ 'marked' => true, 'dotColor' => '#ff9500' ] ; + } + } + + + // get holiday list + $select_holiday = $mysqli->query( "SELECT holiday_date FROM setting_holiday WHERE deleted_at IS NULL AND holiday_date LIKE '%".$searchyearmonth."%'" ) ; + if ( $select_holiday->num_rows > 0 ){ + while ( $row_holiday = $select_holiday->fetch_assoc() ){ + $marked[$row_holiday['holiday_date']] = [ 'marked' => true, 'dotColor' => '#5188ff' ] ; + } + } + + $data['list'] = $list ; + $data['marked'] = $marked ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/leaves/update.php b/apiv3/hr/leaves/update.php new file mode 100644 index 0000000..5523e8c --- /dev/null +++ b/apiv3/hr/leaves/update.php @@ -0,0 +1,304 @@ +diff($datetime2) ; + $days = $interval->format('%a')+1 ; + + $photos = $array['photos'] ; + + if ( $leave_fullhalf == 'half' ){ + $leave_to = $leave_from ; + } + + if ( $leave_type != '' && $leave_from != '' && $leave_to != '' && $leave_reason != '' ){ + $status = '274' ; + + $from = $leave_from ; + $to = $leave_to ; + + if ( date('Y', strtotime($from)) == date('Y', strtotime($to)) ){ + $status = '273' ; + + // get again staff + $department = '' ; + $get_department = $mysqli->query("SELECT department_id FROM staff_department + WHERE deleted_at IS NULL AND staff_id = '".$staff_info['staff_id']."'") ; + if ( $get_department->num_rows > 0 ){ + while ( $row_department = $get_department->fetch_assoc() ){ + $department .= ',('.$row_department['department_id'].')' ; + } + $department = substr($department, 1) ; + } + + // get days + $datetime1 = new DateTime($from) ; + $datetime2 = new DateTime($to) ; + $interval = $datetime1->diff($datetime2) ; + $days = $interval->format('%a')+1 ; + + if ( $leave_fullhalf == 'half' ){ + $days = '0.5' ; + } + + $boolean_apply = false ; + + // check left leave + if ( $type == 'unpaid' ){ + $boolean_apply = true ; + }else{ + + $leave_days = 0 ; + $boolean_ded = false ; + + // return leave to the staff + $get_leave_year = $mysqli->query("SELECT leave_days FROM staff_leave_year + WHERE deleted_at IS NULL AND staff_id = '".$staff_info['staff_id']."' AND leave_type = '".$leave_type."' AND leave_year_from >= '".TODAYDAY."' AND leave_year_to <= '".TODAYDAY."' LIMIT 1") ; + if ( $get_leave_year->num_rows > 0 ){ + $row_leave_year = $get_leave_year->fetch_assoc() ; + $leave_days = $row_leave_year['leave_days'] ; + $boolean_ded = true ; + } + + if ( $leave_days > 0 ){ + + // get currently apply pending leave + $get_leave_pending = $mysqli->query("SELECT leave_from, leave_to, leave_day FROM staff_leave + WHERE deleted_at IS NULL AND staff_id = '".$staff_info['staff_id']."' AND leave_type = '".$leave_type."' AND leave_status = 'pending' AND leave_from LIKE '".date('Y', time())."-%'") ; + if ( $get_leave_pending->num_rows > 0 ){ + + $array_leave_pending[] = [ + 'from' => $leave_from, + 'to' => $leave_to, + 'days' => $days + ] ; + + while ( $row_leave_pending = $get_leave_pending->fetch_assoc() ){ + $array_leave_pending[] = [ + 'from' => $row_leave_pending['leave_from'], + 'to' => $row_leave_pending['leave_to'], + 'days' => $row_leave_pending['leave_day'] + ] ; + } + + foreach ( $array_leave_pending as $kk => $vv ){ + + $new_date = date('Y-m-d', strtotime($vv['leave_from'])) ; + + // check if full day or half day + $day_fullhalf = 'full' ; + $leave_day = $vv['days'] ; // should change to $days + $cut_day = '1' ; + if ( $leave_day == '0.5' ){ + $day_fullhalf = 'half' ; + $leave_day = '1' ; + $cut_day = '0.5' ; + } + + // save to leave more + for ( $a = 1 ; $a <= $leave_day ; $a++ ){ + + $leave_type_mode = 'working' ; + $leave_work_direct = 'no' ; + $leave_work_day = '0' ; + $boolean_holiday = false ; + $boolean_off = false ; + + // check if today is holiday + $get_holiday = $mysqli->query("SELECT * FROM $prefixSettingHoliday + WHERE deleted_at IS NULL AND holiday_date = '".$new_date."' LIMIT 1") ; + if ( $get_holiday->num_rows > 0 ){ + $leave_type_mode = 'holiday' ; + $boolean_holiday = true ; + $leave_work_day = '1' ; + } + + // check working days if today off + if ( !$boolean_holiday ){ + $new_week_day = date('N', strtotime($new_date)) ; + $get_working = $mysqli->query("SELECT * FROM setting_working + WHERE deleted_at IS NULL AND group_id = '".$row_staff['group_id']."' AND working_day = '".$new_week_day."' LIMIT 1") ; + if ( $get_working->num_rows > 0 ){ + $row_working = $get_working->fetch_assoc() ; + if ( $row_working['working_on'] == 'no' ){ + $leave_type_mode = 'off' ; + $boolean_off = true ; + $leave_work_day = '1' ; + } + $leave_work_direct = $row_working['working_direct_day'] ; + if ( $leave_work_direct == 'yes' ){ + $leave_work_day = '0.5' ; + } + } + + if ( !$boolean_off ){ + $leave_work_day = $cut_day ; + } + + } + + $new_date = date('Y-m-d', strtotime($new_date . '+1 days')) ; + + if ( !$boolean_holiday && !$boolean_off ){ + $leave_days = ( $leave_days - $leave_work_day ) ; + } + + } + + } + + } + + } + + if ( $leave_days >= 0 ){ + $boolean_apply = true ; + } + + } + + + + if ( $boolean_apply ){ + + $status = '203' ; + + $error = 0 ; + $mysqli->autocommit( false ) ; + + try { + + $incharge_status = 'confirmed' ; + + // insert into leave + $mysqli->query( "INSERT INTO staff_leave + ( staff_id, leave_department, leave_type, leave_from, leave_to, leave_day, leave_reason, leave_file, leave_incharge_status, leave_status ) VALUES + ( '".$staff_info['staff_id']."', '".$department."', '".$leave_type."', '".$leave_from."', '".$leave_to."', '".$days."', '".$leave_reason."', '".$leave_file."', '".$incharge_status."', 'pending' )" ) ; + $last_id = $mysqli->insert_id ; + + if ( checkExists($photos) ){ + foreach ( $photos as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'Leave', $last_id.'-'.$last_id, $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $mysqli->query( "UPDATE staff_leave SET + leave_file = '".$upload['data']['file_name']."' + WHERE leave_id = '".$last_id."'" ) ; + } + } + } + } + + // get team leave + $l_content = '' ; + $leave_q = $mysqli->query("SELECT a.leave_day, a.leave_from, a.leave_to, a.leave_status, b.staff_name FROM staff_leave a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.leave_id != '".$last_id."' AND a.leave_incharge_status = 'confirmed' AND a.leave_status != 'rejected' AND a.leave_from >= '".TODAYDAY."' + ORDER BY a.leave_from ASC") ; + if ( $leave_q->num_rows > 0 ){ + while ( $leave = $leave_q->fetch_assoc() ){ + $l_content .= ' + + '.$leave['staff_name'].' + '.$leave['leave_day'].' + '.$leave['leave_from'].' ~ '.$leave['leave_to'].' + '.ucwords($leave['leave_status']).' + ' ; + } + }else{ + $l_content .= 'No leave found.' ; + } + + // set date + $array_date = [ + 1 => 'Monday', + 2 => 'Tuesday', + 3 => 'Wednesday', + 4 => 'Thursday', + 5 => 'Friday', + 6 => 'Saturday', + 7 => 'Sunday', + ] ; + $leave_from_date = $array_date[ date('N', strtotime($leave_from)) ] ; + $leave_to_date = $array_date[ date('N', strtotime($leave_to)) ] ; + + // get current annual leave or sick leave + $leave_year_days = 0 ; + if ( $leave_type != 'unpaid' ){ + $leave_year_q = $mysqli->query("SELECT leave_days FROM staff_leave_year + WHERE deleted_at IS NULL AND staff_id = '".$staff_info['staff_id']."' AND leave_type = '".$leave_type."' ORDER BY leave_year_id DESC LIMIT 1") ; + if ( $leave_year_q->num_rows > 0 ){ + $leave_year = $leave_year_q->fetch_assoc() ; + $leave_year_days = $leave_year['leave_days'] ; + } + } + + pushToUserCron( 'staff_leave', $last_id, $staff_info['staff_id'], 'Apply Leave', 'Leave has been created.' ) ; + + // send email when apply leave + $content = ' + Hello Team,

+ Please approve '.$staff_info['staff_name'].' leave.

+ '.$staff_info + ['staff_name'].' has applied for '.ucwords($leave_type).' leave from '.date('d/m/Y', strtotime($leave_from)).' ('.$leave_from_date.') to '.date('d/m/Y', strtotime($leave_to)).' ('.$leave_to_date.') with the reason ('.$leave_reason.'). Please review the application and appove or reject it.

+ '.( $leave_type != 'unpaid' ? 'If this application is approved, it will utilize '.$days.' day(s) and there is '.($leave_year_days-$days).' day(s) remaining '.ucwords($leave_type).' leave days.

' : '' ).' + Currently, your team\'s leave schedule (nearby the date range) is illustrated as below: + + + + + + + + '.$l_content.' +
NameDay(s)Date RangeStatus


+ The approval for this application belongs to you, so do keep this e-mail safe.' ; + + $mailer = new Mailer() ; + $mailer->from = EMAILNOREPLY ; + $mailer->to = $EMAILCC ; + $mailer->cc = [ $staff_info['staff_email'] ] ; + $mailer->subject = ucwords($leave_type).' leave request from '.$staff_info['staff_name'] ; + $mailer->body = $content ; + $mailer->send() ; + + }catch( Exception $e ){ + $message = $e ; + $error++; + } + + if( $error == 0 ) { + $status = '200' ; + + // commit query + $mysqli->commit() ; + + }else{ + $mysqli->rollback() ; + } + + } + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/paymentslips/details.php b/apiv3/hr/paymentslips/details.php new file mode 100644 index 0000000..e2f58db --- /dev/null +++ b/apiv3/hr/paymentslips/details.php @@ -0,0 +1,29 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $row['payment_file'] = ( $row['payment_file'] != '' ? PATH.'uploads/PaymentSlip/b/'.$row['payment_file'] : '' ) ; + $data['list'] = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/hr/paymentslips/lists.php b/apiv3/hr/paymentslips/lists.php new file mode 100644 index 0000000..e282647 --- /dev/null +++ b/apiv3/hr/paymentslips/lists.php @@ -0,0 +1,35 @@ +query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['payment_file'] = ( $row['payment_file'] != '' ? PATH.'uploads/PaymentSlip/b/'.$row['payment_file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/integrators/commissions/create.php b/apiv3/integrators/commissions/create.php new file mode 100644 index 0000000..6b06e98 --- /dev/null +++ b/apiv3/integrators/commissions/create.php @@ -0,0 +1,33 @@ + 0 ){ + + $status = '203'; + foreach($commission_array as $key => $value){ + $staff_id = $value['staff_id']; + $commission_num = $value['commision_student_count']; + $commission = $value['commission']; + $month = $value['month']; + + $query_commission_temp = $mysqli->query("SELECT temp_id FROM staff_commission_temp WHERE staff_id='$staff_id' AND month='$month'"); + if(mysqli_num_rows($query_commission_temp)==0){ + $insert = $mysqli->query("INSERT INTO staff_commission_temp (staff_id, commission_num, commission, month) VALUES ('$staff_id', '$commission_num', '$commission', '$month') "); + } + } + + if($insert){ + $status = '200'; + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/integrators/staffs/update.php b/apiv3/integrators/staffs/update.php new file mode 100644 index 0000000..b67426c --- /dev/null +++ b/apiv3/integrators/staffs/update.php @@ -0,0 +1,76 @@ +query( "SELECT * FROM branch WHERE branch_id = '".$branch_id."' LIMIT 1" ) ; + if ( $select_branch->num_rows == 0 ){ + if ( $branch_name != '' ){ + $mysqli->query( "INSERT INTO branch + ( branch_id, branch_name, created_at, updated_at ) VALUES + ( '".$branch_id."', '".$branch_name."', '".TODAYDATE."', '".TODAYDATE."' )" ) ; + } + } + + // check staffidno exists + $staff_id = '' ; + $select_staff = $mysqli->query( "SELECT staff_id FROM staff + WHERE deleted_at IS NULL AND staff_idno = '".$staff_idno."' LIMIT 1" ) ; + if ( $select_staff->num_rows == 0 ){ + $status = '203' ; + + if ( $mysqli->query( "INSERT INTO staff + ( branch_id, staff_idno, staff_name, staff_email, staff_mobileno, staff_tier ) VALUES + ( '".$branch_id."', '".$staff_idno."', '".$staff_name."', '".$staff_email."', '".$staff_mobileno."', '9' )" ) ){ + $staff_id = $mysqli->insert_id ; + + $status = '200' ; + } + }else{ + $status = '202' ; + + $row_staff = $select_staff->fetch_assoc() ; + + if ( $mysqli->query( "UPDATE staff SET + branch_id = '".$branch_id."', + staff_name = '".$staff_name."', + staff_email = '".$staff_email."', + staff_mobileno = '".$staff_mobileno."' + WHERE staff_id = '".$row_staff['staff_id']."'" ) ){ + + $staff_id = $row_staff['staff_id'] ; + + $status = '200' ; + } + } + + if ( $staff_id != '' ){ + $select_department = $mysqli->query( "SELECT staff_department_id FROM staff_department + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' LIMIT 1" ) ; + if ( $select_department->num_rows == 0 ){ + $mysqli->query("INSERT INTO staff_department + ( staff_id, department_id, created_at, updated_at ) VALUES + ( '".$staff_id."', '".$department_id."', '".TODAYDATE."', '".TODAYDATE."')" ) ; + } + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/pages/home.php b/apiv3/pages/home.php new file mode 100644 index 0000000..e88850c --- /dev/null +++ b/apiv3/pages/home.php @@ -0,0 +1,348 @@ + [], 'service' => [] ] ; + $count_inbox = 0 ; + + $staff_settings = $staff_info['staff_settings'] ; + + + + // get branch name + $branch = '' ; + $select_branch = $mysqli->query( "SELECT branch_name FROM branch + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' LIMIT 1" ) ; + if ( $select_branch->num_rows > 0 ){ + $row_branch = $select_branch->fetch_assoc() ; + $branch = dataFilter( $row_branch['branch_name'] ) ; + } + + + + // get popup + $select = $mysqli->query( "SELECT * FROM setting_popup + WHERE branch LIKE '%/".$array['branch_id']."/%' AND setting_popup_id = '1' AND file != '' AND status = 'active' LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $row = $select->fetch_assoc() ; + $popup = PATH.'uploads/Pop-up/b/'.dataFilter($row['file']) ; + } + + + + + + // select all department + $select = $mysqli->query( "SELECT a.department_id, a.department_code, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = dataFilter( $row['department_desc'] ) ; + } + } + + + + + // select staff department + $select = $mysqli->query( "SELECT a.department_id FROM staff_department a + WHERE a.deleted_at IS NULL AND a.staff_id = '".$staff_info['staff_id']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $departments[] = $department_list[ $row['department_id'] ] ; + } + } + $departments = implode( ', ', $departments ) ; + + + + + // select staff position + $select = $mysqli->query( "SELECT a.job_position_code, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND a.job_position_id = '".$staff_info['job_position_id']."'" ) ; + if ( $select->num_rows > 0 ){ + $row = $select->fetch_assoc() ; + $position = dataFilter( $row['job_position_desc'] ) ; + } + + + + // select staff section + $select = $mysqli->query( "SELECT a.job_section_code, b.job_section_desc FROM setting_job_section a + LEFT JOIN setting_job_section_translation b ON ( a.job_section_id = b.job_section_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND a.job_section_id = '".$staff_info['job_section_id']."'" ) ; + if ( $select->num_rows > 0 ){ + $row = $select->fetch_assoc() ; + $section = dataFilter( $row['job_section_desc'] ) ; + $section = ( $section != 'NONE' ? $section : '' ) ; + } + + + + + // select announcement + $select = $mysqli->query( "SELECT a.announcement_id, a.is_hide, a.file, b.title FROM announcement a + LEFT JOIN announcement_translation b ON ( a.announcement_id = b.announcement_id ) + WHERE a.deleted_at IS NULL AND a.status = 'active' AND b.lang = '".$array['lang']."' AND a.branch LIKE '%".$array['branch_id']."%' AND a.file != '' + ORDER BY a.announcement_id DESC + LIMIT 8" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $row['id'] = dataFilter( $row['announcement_id'] ) ; + $row['title'] = ( $row['is_hide'] == 'no' ? dataFilter( $row['title'] ) : '' ) ; + $row['uri'] = ( $row['file'] != '' ? PATH.'uploads/Announcement/b/'.$row['file'] : '' ) ; + $row['url'] = ( $row['file'] != '' ? PATH.'uploads/Announcement/b/'.$row['file'] : '' ) ; + $announcements[] = $row ; + } + } + + + + + + + + + + + + + // count + + // count adjustment + $count_adjustment = 0 ; + $query = "SELECT COUNT( adjustment_id ) as total FROM staff_adjustment + WHERE deleted_at IS NULL AND ( created_branch_id = '".$array['branch_id']."' AND created_by = '".$staff_info['staff_id']."' ) " ; + $mysqli_query = $mysqli->query( $query ) ; + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_adjustment = $row['total'] ; + } + + // count task + $count_task = 0 ; + $query = "SELECT COUNT( a.task_id ) as total FROM task a + WHERE a.deleted_at IS NULL AND ( a.created_branch_id = '".$array['branch_id']."' AND a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 ) ) AND status IN ( 'pending', 'assigned', 'resubmit', 'progress' ) " ; + $mysqli_query = $mysqli->query( $query ) ; + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_task = $row['total'] ; + } + + // count redeem + $count_redeem = 0 ; + $query = "SELECT COUNT( redeem_id ) as total FROM staff_redeem + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' AND status = 'pending'" ; + $mysqli_query = $mysqli->query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_redeem = $row['total'] ; + } + + // count catalog + $count_catalog = 0 ; + $query = "SELECT COUNT( catalog_id ) as total FROM catalog + WHERE deleted_at IS NULL" ; + $mysqli_query = $mysqli->query( $query ) ; + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_catalog = $row['total'] ; + } + + // count handbook + $count_handbook = 0 ; + $query = "SELECT COUNT( handbook_id ) as total FROM handbook + WHERE deleted_at IS NULL AND ( ( receiver_type IN ( '0' ) ) OR ( receiver_type IN ( '1', '2' ) AND staff_id LIKE '%/".$staff_info['staff_id']."/%' ) )" ; + $mysqli_query = $mysqli->query( $query ) ; + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_handbook = $row['total'] ; + } + + // count suggestion, grievance, request + // count suggestion + $count_suggestion = 0 ; + $query = "SELECT COUNT( suggestion_id ) as total FROM suggestion + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' AND status = 'pending'" ; + $mysqli_query = $mysqli->query( $query ) ; + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_suggestion = $row['total'] ; + } + + // count request + $count_request = 0 ; + $query = "SELECT COUNT( request_id ) as total FROM request + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' AND status = 'pending'" ; + $mysqli_query = $mysqli->query( $query ) ; + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_request += $row['total'] ; + } + + // count grievance + $count_grievance = 0 ; + $query = "SELECT COUNT( grievance_id ) as total FROM grievance + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' AND status = 'pending'" ; + $mysqli_query = $mysqli->query( $query ) ; + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_grievance += $row['total'] ; + } + + // count training + $count_training = 0 ; + $query = "SELECT COUNT( training_id ) as total FROM staff_training + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' AND status = 'pending'" ; + $mysqli_query = $mysqli->query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_training = $row['total'] ; + } + + // count association + $count_association = 0 ; + $query = "SELECT COUNT( association_id ) as total FROM staff_association + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' AND status = 'pending'" ; + $mysqli_query = $mysqli->query( $query ) ; + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_association = $row['total'] ; + } + + // count form + $count_form = 0 ; + $query = "SELECT COUNT( form_id ) as total FROM form + WHERE deleted_at IS NULL AND branch LIKE '%/".$array['branch_id']."/%' AND ( ( receiver_type IN ( '0' ) ) OR ( receiver_type IN ( '1', '2' ) AND staff_id LIKE '%/".$staff_info['staff_id']."/%' ) )" ; + $mysqli_query = $mysqli->query( $query ) ; + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_form = $row['total'] ; + } + + // count recruitment + $count_recruitment = 0 ; + $query = "SELECT COUNT( employment_id ) as total FROM staff_employment + WHERE employment_trash = '0' AND employment_status = 'Processing' AND employment_branch = '".$array['branch_id']."' AND employment_incharge_staff_id = '".$staff_info['staff_id']."'" ; + $mysqli_query = $mysqli->query( $query ) ; + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_recruitment = $row['total'] ; + } + + + // select service + $select = $mysqli->query( "SELECT a.type, a.module, a.colour, a.file, b.title FROM app_service a + LEFT JOIN app_service_translation b ON ( a.service_id = b.service_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND a.on_off = 'on' + ORDER BY a.sortable" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $boolean_show = true ; + + $count = 0 ; + switch ( $row['module'] ){ + case 'Punch' : + if ( $staff_settings['punch'] != 'yes' ){ + $boolean_show = false ; + } + break ; + case 'Adjustment' : + switch ( $staff_info['staff_tier_is_adjustment'] ){ + case 'yes' : + case 'fixed' : + $count = $count_adjustment ; + break ; + default : + $boolean_show = false ; + } + break ; + case 'Task' : $count = $count_task ; break ; + case 'Redeem' : $count = $count_redeem ; break ; + case 'Catalog' : $count = $count_catalog ; break ; + case 'Handbook' : + case 'HandbookMainCategory' : + $count = $count_handbook ; + break ; + case 'LocalInbox' : $count = ( $count_suggestion + $count_grievance + $count_request ) ; break ; + case 'Training' : $count = $count_training ; break ; + case 'Association' : $count = $count_association ; break ; + case 'Hr' : $is_show = 'yes' ; break ; + case 'HrBranch' : $is_show = 'yes' ; break ; + case 'HrManual' : $is_show = 'manual' ; break ; + case 'Recruitment' : + if ( $staff_info['staff_settings']['checkrecruitment'] != 'yes' ){ + $boolean_show = false ; + }else{ + $count = $count_recruitment ; + } + break ; + case 'Visitor' : + if ( $staff_info['staff_settings']['approvevisitation'] != 'yes' ){ + $boolean_show = false ; + } + break ; + case 'Form' : $count = $count_form ; break ; + } + $row['title'] = dataFilter( $row['title'] ) ; + $row['count'] = ( $count > 999 ? '999+' : $count ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/AppService/'.$row['file'] : '' ) ; + $service_type = $row['type'] ; + unset( $row['type'] ) ; + + if ( $boolean_show ){ + $services[$service_type][] = $row ; + } + } + } + + + + // select attendance + $attendances = [ 'presents' => 0, 'late' => 0, 'absent' => 0 ] ; + + + + + + $mysqli_query = $mysqli->query( "SELECT COUNT( a.view_id ) as total FROM staff_inbox_view a + WHERE a.deleted_at IS NULL AND a.staff_id = '".$staff_info['staff_id']."' AND a.is_read = '0'" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_inbox = $row['total'] ; + } + + + $data = [ + 'is_show' => $is_show, + 'branch' => $branch, + 'position' => $position, + 'section' => $section, + 'popup' => $popup, + 'departments' => $departments, + 'announcements' => $announcements, + 'services' => $services, + 'attendances' => $attendances, + 'count_inbox' => $count_inbox + ] ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/pages/menu-page.php b/apiv3/pages/menu-page.php new file mode 100644 index 0000000..2cdc160 --- /dev/null +++ b/apiv3/pages/menu-page.php @@ -0,0 +1,33 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/AppMenu/b/'.$row['file'] : '' ) ; + $row['created_at'] = resetDateTimeFormat( $row['created_at'] ) ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/pages/menu.php b/apiv3/pages/menu.php new file mode 100644 index 0000000..8d3b3c7 --- /dev/null +++ b/apiv3/pages/menu.php @@ -0,0 +1,30 @@ +query( "SELECT a.menu_id, b.title FROM app_menu a + LEFT JOIN app_menu_translation b ON ( a.menu_id = b.menu_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' ORDER BY a.sortable" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $row['id'] = dataFilter( $row['menu_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $menus[] = $row ; + } + } + + + $data = [ + 'menus' => $menus + ] ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/pages/page.php b/apiv3/pages/page.php new file mode 100644 index 0000000..ae06dd6 --- /dev/null +++ b/apiv3/pages/page.php @@ -0,0 +1,33 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/AppPage/b/'.$row['file'] : '' ) ; + $row['created_at'] = resetDateTimeFormat( $row['created_at'] ) ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/pages/setting.php b/apiv3/pages/setting.php new file mode 100644 index 0000000..caa4ba4 --- /dev/null +++ b/apiv3/pages/setting.php @@ -0,0 +1,39 @@ +query( "SELECT a.page_id, b.title FROM app_page a + LEFT JOIN app_page_translation b ON ( a.page_id = b.page_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' ORDER BY a.sortable" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $row['id'] = dataFilter( $row['page_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $pages[] = $row ; + } + } + + $generatecode = generateQrcode( $require_path, $staff_info['staff_idno'], PATH.'hr-staff-vcard.php?staff_idno='.$staff_info['staff_idno'] ) ; + + + $data = [ + 'is_delete' => $is_delete, + 'pages' => $pages, + 'namecard' => $generatecode['url'] + ] ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/pages/support.php b/apiv3/pages/support.php new file mode 100644 index 0000000..840517c --- /dev/null +++ b/apiv3/pages/support.php @@ -0,0 +1,35 @@ +query( "SELECT a.mobile, b.name FROM app_support a + LEFT JOIN app_support_translation b ON ( a.support_id = b.support_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' " . $search_query ) ; + if ( $select->num_rows > 0 ){ + $status = '200' ; + + while ( $row = $select->fetch_assoc() ){ + $supports[] = $row ; + } + } + + + $data = [ + 'list' => $supports + ] ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/branches/lists.php b/apiv3/profiles/branches/lists.php new file mode 100644 index 0000000..cf1b2b9 --- /dev/null +++ b/apiv3/profiles/branches/lists.php @@ -0,0 +1,31 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['branch_name'] = dataFilter( $row['branch_name'] ) ; + $row['branch_hq'] = ( $row['branch_hq'] != '' ? $row['branch_hq'] : '0' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/inboxes/details.php b/apiv3/profiles/inboxes/details.php new file mode 100644 index 0000000..9a1035d --- /dev/null +++ b/apiv3/profiles/inboxes/details.php @@ -0,0 +1,207 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + $row = $mysqli_query->fetch_assoc() ; + + $file = '' ; + if ( $row['file'] != '' ){ + if ( $row['file_type'] == 'pdf' ){ + $file = PATH.'uploads/Inbox/'.$row['file'] ; + }else{ + $file = PATH.'uploads/Inbox/b/'.$row['file'] ; + } + } + + $row['title'] = dataFilter( $row['title'] ) ; + $row['description'] = dataFilter( $row['description'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['file'] = $file ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + + $go_page = '' ; + $go_param = '' ; + + $is_updateread = true ; + + switch ( $row['from_table'] ){ + case 'task' : + $go_page = 'TaskView' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'redeem' : + $go_page = 'RedeemDetails' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'], 'view_id' => '' ] ; + break ; + case 'staff_redeem' : + $select_view = $mysqli->query( "SELECT redeem_id FROM staff_redeem WHERE view_id = '".$row['from_id']."' LIMIT 1" ) ; + $main_id = '' ; + if ( $select_view->num_rows > 0 ){ + $row_view = $select_view->fetch_assoc() ; + $main_id = $row_view['redeem_id'] ; + + $go_page = 'RedeemView' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $main_id, 'view_id' => $row['from_id'] ] ; + } + break ; + case 'association' : + $go_page = 'AssociationDetails' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'], 'view_id' => '' ] ; + break ; + case 'staff_association' : + $select_view = $mysqli->query( "SELECT association_id FROM staff_association WHERE view_id = '".$row['from_id']."' LIMIT 1" ) ; + $main_id = '' ; + if ( $select_view->num_rows > 0 ){ + $row_view = $select_view->fetch_assoc() ; + $main_id = $row_view['association_id'] ; + + $go_page = 'AssociationView' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $main_id, 'view_id' => $row['from_id'] ] ; + } + break ; + case 'training' : + $go_page = 'TrainingDetails' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'], 'view_id' => '' ] ; + break ; + case 'staff_training' : + $select_view = $mysqli->query( "SELECT training_id FROM staff_training WHERE view_id = '".$row['from_id']."' LIMIT 1" ) ; + $main_id = '' ; + if ( $select_view->num_rows > 0 ){ + $row_view = $select_view->fetch_assoc() ; + $main_id = $row_view['training_id'] ; + + $go_page = 'TrainingView' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $main_id, 'view_id' => $row['from_id'] ] ; + } + break ; + case 'suggestion' : + $go_page = 'SuggestionUpdate' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'grievance' : + $go_page = 'GrievanceUpdate' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'request' : + $go_page = 'RequestUpdate' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'staff_adjustment' : + $go_page = 'AdjustmentDetails' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'handbook' : + $go_page = 'HandbookDetails' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'staff_leave' : + $go_page = 'LeaveDetails' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'staff_payment_slip': + $go_page = 'PaymentSlipUpdate' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'staff_advance' : + $go_page = 'AdvanceUpdate' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'staff_health' : + $go_page = 'HealthUpdate' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'holiday' : + $go_page = 'Holiday' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => '' ] ; + break ; + case 'announcement' : + $select_announcement = $mysqli->query( "SELECT is_showagree FROM announcement + WHERE deleted_at IS NULL AND status = 'active' AND announcement_id = '".$row['from_id']."' LIMIT 1" ) ; + if ( $select_announcement->num_rows > 0 ){ + $row_announcement = $select_announcement->fetch_assoc() ; + if ( $row_announcement['is_showagree'] == 'yes' ){ + $select_agree = $mysqli->query( "SELECT * FROM staff_announcement + WHERE deleted_at IS NULL AND announcement_id = '".$row['from_id']."' AND staff_id = '".$staff_info['staff_id']."' LIMIT 1" ) ; + if ( $select_agree->num_rows == 0 ){ + $is_updateread = false ; + } + } + } + + $go_page = 'AnnouncementDetails' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'outstanding-employee' : + case 'lateness-board' : + $go_page = 'Home' ; + $go_param = [ 'refresh' => '', 'type' => '', 'id' => '' ] ; + break ; + case 'association_gallery' : + case 'training_gallery' : + case 'request_gallery' : + $select_view = $mysqli->query( "SELECT file FROM ".$row['from_table']." WHERE gallery_id = '".$row['from_id']."' LIMIT 1" ) ; + $main_id = '' ; + if ( $select_view->num_rows > 0 ){ + $row_view = $select_view->fetch_assoc() ; + + $path = '' ; + switch ( $row['from_table'] ){ + case 'association_gallery' : + $path = 'AssociationGallery' ; + break ; + case 'training_gallery' : + $path = 'TrainingGallery' ; + break ; + case 'request_gallery' : + $path = 'RequestGallery' ; + break ; + } + + $files = ( $row_view['file'] != '' ? [ PATH.'uploads/'.$path.'/b/'.$row_view['file'] ] : [] ) ; + + $go_page = 'ImageZoom' ; + $go_param = [ 'refresh' => '', 'files' => $files ] ; + } + break ; + case 'form' : + $go_page = 'FormDetails' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + case 'formresignation' : + $go_page = 'FormResignationUpdate' ; + $go_param = [ 'refresh' => '', 'type' => 'update', 'id' => $row['from_id'] ] ; + break ; + } + + $row['go_page'] = $go_page ; + $row['go_param'] = $go_param ; + + $data['list'] = $row ; + + // update is read + if ( $row['is_read'] == '0' && $is_updateread ) { + $mysqli->query( "UPDATE staff_inbox_view SET + is_read = '1' + WHERE view_id = '".$row['view_id']."'" ) ; + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/inboxes/lists.php b/apiv3/profiles/inboxes/lists.php new file mode 100644 index 0000000..208cf7d --- /dev/null +++ b/apiv3/profiles/inboxes/lists.php @@ -0,0 +1,65 @@ +query( $query . " ORDER BY b.created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['title'] = dataFilter( $row['title'] ) ; + $row['description'] = dataFilter( $row['description'] ) ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } + + + // total inbox + $mysqli_query = $mysqli->query( "SELECT COUNT( a.view_id ) as total FROM staff_inbox_view a + WHERE a.deleted_at IS NULL AND a.staff_id = '".$staff_info['staff_id']."' AND a.is_read = '0'" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $row = $mysqli_query->fetch_assoc() ; + $count_inbox = $row['total'] ; + } + $data['count_inbox'] = $count_inbox ; + + + // mark notification as 0 + $mysqli->query( "UPDATE staff_notification SET badge = '0' WHERE staff_id = '".$staff_info['staff_id']."'" ) ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/inboxes/markall.php b/apiv3/profiles/inboxes/markall.php new file mode 100644 index 0000000..12001e4 --- /dev/null +++ b/apiv3/profiles/inboxes/markall.php @@ -0,0 +1,18 @@ +query( "UPDATE staff_inbox_view SET + is_read = '1' + WHERE deleted_at IS NULL AND staff_id = '".$staff_info['staff_id']."'" ) ){ + $status = '200' ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/pages/achievement.php b/apiv3/profiles/pages/achievement.php new file mode 100644 index 0000000..ed963dc --- /dev/null +++ b/apiv3/profiles/pages/achievement.php @@ -0,0 +1,37 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + while ( $row = $mysqli_query->fetch_assoc() ){ + $temp = [] ; + $temp['code'] = dataFilter( $row['code'] ) ; + $temp['title'] = dataFilter( $row['title'] ) ; + $temp['content'] = dataFilter( $row['content'] ) ; + $temp['file'] = ( $row['file'] != '' ? PATH.'uploads/ProfileAchievement/b/'.$row['file'] : '' ) ; + $temp['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $temp ; + } + + + } + + $data['list'] = $list ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/pages/level.php b/apiv3/profiles/pages/level.php new file mode 100644 index 0000000..01bd5f1 --- /dev/null +++ b/apiv3/profiles/pages/level.php @@ -0,0 +1,36 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + while ( $row = $mysqli_query->fetch_assoc() ){ + $temp = [] ; + $temp['title'] = dataFilter( $row['title'] ) ; + $temp['sub'] = dataFilter( $row['sub'] ) ; + $temp['content'] = dataFilter( $row['content'] ) ; + $temp['file'] = ( $row['file'] != '' ? PATH.'uploads/ProfileTier/b/'.$row['file'] : '' ) ; + $temp['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $temp ; + } + + + } + + $data['list'] = $list ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/pages/point-movement.php b/apiv3/profiles/pages/point-movement.php new file mode 100644 index 0000000..fec3bfb --- /dev/null +++ b/apiv3/profiles/pages/point-movement.php @@ -0,0 +1,35 @@ +query( $query . " ORDER BY a.movement_id DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/pages/point.php b/apiv3/profiles/pages/point.php new file mode 100644 index 0000000..88f2457 --- /dev/null +++ b/apiv3/profiles/pages/point.php @@ -0,0 +1,188 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $temp = [] ; + $temp['title'] = dataFilter( $row['title'] ) ; + $temp['content'] = dataFilter( $row['content'] ) ; + $temp['file'] = ( $row['file'] != '' ? PATH.'uploads/ProfilePoint/b/'.$row['file'] : '' ) ; + $temp['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list = $temp ; + } + + + // get total accumulated point + // 'system','staff_point_movement_cutoff','task','redeem','adjustment','training' + $select_movement = $mysqli->query( "SELECT SUM( amount ) as total FROM staff_point_movement + WHERE staff_id = '".$staff_info['staff_id']."' AND from_table IN ( 'system','task','adjustment','training' ) AND created_at LIKE '%".date('Y', time())."-%'" ) ; + if ( $select_movement->num_rows > 0 ){ + $data_movement = $select_movement->fetch_assoc() ; + $total_accumulated = $data_movement['total'] ; + } + + // get total redeem + $select_movement = $mysqli->query( "SELECT SUM( amount ) as total FROM staff_point_movement + WHERE staff_id = '".$staff_info['staff_id']."' AND from_table IN ( 'redeem' ) AND created_at LIKE '%".date('Y', time())."-%'" ) ; + if ( $select_movement->num_rows > 0 ){ + $data_movement = $select_movement->fetch_assoc() ; + $total_redeem = $data_movement['total'] ; + $total_redeem = numberFormat( $total_redeem < 0 ? -( $total_redeem ) : 0 ) ; + } + + $data['list'] = $list ; + $data['total_accumulated'] = $total_accumulated ; + $data['total_redeem'] = $total_redeem ; + + } + + + + // direct echo + if ( $array['iswebview'] == 'yes' ){ + require( $require_path.'languages/'.$array['lang'].'.php' ) ; + + $search_year = ( $array['search_year'] != '' ? $array['search_year'] : date('Y') ) ; + $search_type = ( $array['search_type'] != '' ? $array['search_type'] : 'personal' ) ; + + $staff_settings = $staff_info['staff_settings'] ; + + $months = [] ; + $months_name = [ $lang['Jan'], $lang['Feb'], $lang['Mar'], $lang['Apr'], $lang['May'], $lang['Jun'], $lang['Jul'], $lang['Aug'], $lang['Sep'], $lang['Oct'], $lang['Nov'], $lang['Dec'] ] ; + for ( $a = 1 ; $a <= 12 ; $a++ ){ $months[$a] = 0 ; } + + // monthly report = by personal or whole branch + $array_report = [ + 'personal' => [ + 'yes' => $months + ], + ] ; + + $filtertype = [] ; + foreach ( $array_report as $k => $v ){ + if ( $k == $search_type ){ + $filtertype[] = $k ; + } + } + + foreach ( $filtertype as $k => $v ){ + + $search_query = " AND ( a.staff_id = '".$staff_info['staff_id']."' )" ; + + $select_task = $mysqli->query( "SELECT SUM(a.staff_point_achievement) as total, MONTH(a.reported_at) as month FROM staff_monthly_achievement a + WHERE a.deleted_at IS NULL AND a.reported_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY MONTH(a.reported_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_report = $select_task->fetch_assoc() ){ + $array_report[$v]['yes'][$row_report['month']] = $row_report['total'] ; + } + } + } + + + $html .= ' + + + + + + + + + + +
+ +
+ + + + '. $search_year .' + + + +
' ; + + foreach ( $array_report as $kreport => $vreport ){ + + if ( $kreport == $search_type ){ + + $title = $lang['By '.ucwords($kreport).' Report'] ; + $titlename = $title.' ( '.$lang['Year'].' '.$search_year.' )' ; + + $html .= ' +
+ +
+ ' ; + + } + } + + $html .= ' +
+ + ' ; + } + +} + +if ( $array['iswebview'] == 'yes' ){ + echo $html ; + exit ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/pages/star.php b/apiv3/profiles/pages/star.php new file mode 100644 index 0000000..a00dec0 --- /dev/null +++ b/apiv3/profiles/pages/star.php @@ -0,0 +1,88 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $temp = [] ; + $temp['title'] = dataFilter( $row['title'] ) ; + $temp['content'] = dataFilter( $row['content'] ) ; + $temp['file'] = ( $row['file'] != '' ? PATH.'uploads/ProfileStar/b/'.$row['file'] : '' ) ; + $temp['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list = $temp ; + } + $data['list'] = $list ; + + } + + + + // direct echo + if ( $array['iswebview'] == 'yes' ){ + $get_monthly = getMonthlyAchievement( date('Y', time()), $staff_info['staff_id'] ) ; + $get_star[] = [ 'Month', 'Star' ] ; + foreach ( $get_monthly as $k => $v ){ + $get_star[] = [ date('m', strtotime($v['reported_at'])), $v['staff_star'] ] ; + } + + $html .= ' + + + + + + + + + + + + +
+
+
+ + ' ; + } + +} + +if ( $array['iswebview'] == 'yes' ){ + echo $html ; + exit ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/pages/tier.php b/apiv3/profiles/pages/tier.php new file mode 100644 index 0000000..51635aa --- /dev/null +++ b/apiv3/profiles/pages/tier.php @@ -0,0 +1,38 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + while ( $row = $mysqli_query->fetch_assoc() ){ + $temp = [] ; + $temp['tier_id'] = dataFilter( $row['tier_id'] ) ; + $temp['title'] = dataFilter( $row['title'] ) ; + $temp['sub'] = dataFilter( $row['sub'] ) ; + $temp['content'] = dataFilter( $row['content'] ) ; + $temp['file'] = ( $row['file'] != '' ? PATH.'uploads/ProfileTier/b/'.$row['file'] : '' ) ; + $temp['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $temp ; + } + + + } + + $data['list'] = $list ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/updates/delete.php b/apiv3/profiles/updates/delete.php new file mode 100644 index 0000000..2b2795b --- /dev/null +++ b/apiv3/profiles/updates/delete.php @@ -0,0 +1,18 @@ +query( "UPDATE staff SET + deleted_at = '".TODAYDATE."' + WHERE staff_id = '".$staff_info['staff_id']."'" ) ){ + $status = '200' ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/profiles/updates/password.php b/apiv3/profiles/updates/password.php new file mode 100644 index 0000000..d5cbf67 --- /dev/null +++ b/apiv3/profiles/updates/password.php @@ -0,0 +1,56 @@ +query("SELECT staff_id, staff_idno, staff_name, staff_shortname, staff_username, staff_email, staff_mobileno, staff_image, job_position_id, job_section_id, staff_point_achievement, staff_point, staff_wallet, staff_tier, staff_achievement, staff_star FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned IS NULL OR staff_date_resigned = '0000-00-00' ) AND staff_id = '".$staff_info['staff_id']."' AND staff_password = '".$password."' LIMIT 1") ; + if ( $mysqli_staff->num_rows > 0 ){ + $status = '286' ; + + if ( $array['password'] == $array['confirm'] ){ + $status = '285' ; + + if ( strlen( $array['password'] ) >= 6 ){ + + $status = '205' ; + + $password = $staff_info['staff_id'].strPad( 6, rand(000000, 999999) ) ; + $enc_password = passwordEncrypt( $array['password'] ) ; + + if ( $mysqli->query( "UPDATE staff SET + staff_password = '".$enc_password."' + WHERE staff_id = '".$staff_info['staff_id']."'" ) ){ + + $status = '208' ; + + $mailer = new Mailer() ; + $mailer->from = EMAILNOREPLY ; + $mailer->to = [ $staff_info['staff_email'] ] ; + $mailer->subject = 'Change password' ; + $mailer->body = 'Your new password was success change to ' . $array['password'] ; + if ( $mailer->send() ){ + $status = '200' ; + } + + } + } + } + } + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/punchs/checkinout.php b/apiv3/punchs/checkinout.php new file mode 100644 index 0000000..c27b83c --- /dev/null +++ b/apiv3/punchs/checkinout.php @@ -0,0 +1,78 @@ +query("SELECT staff_id FROM staff + WHERE deleted_at IS NULL AND staff_idno = '".$employment_id."' LIMIT 1") ; + + if ( $staffs_q->num_rows == 0 ){ + + $mysqli->query("INSERT INTO staff + (staff_idno, staff_name, staff_email, gender_id, staff_icno, staff_passportno, religion_id, ethnic_id, created_at, updated_at) VALUES + ('".$employment_id."', '', '', '0', '', '', '0', '0', '".TODAYDATE."', '".TODAYDATE."')") ; + $staff_id = $mysqli->insert_id ; + + }else{ + $staff = $staffs_q->fetch_assoc() ; + $staff_id = $staff['staff_id'] ; + } + + $last_attendance_q = $mysqli->query("SELECT type FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND check_group = '".$date_group_yest."' ORDER BY attendance_id DESC LIMIT 1") ; + $check_type = 'in' ; + if ( $last_attendance_q->num_rows > 0 ){ + // check if last attendance is in + $last_attendance = $last_attendance_q->fetch_assoc() ; + if ( $last_attendance['type'] == 'in' ){ + $date_group = $date_group_yest ; + $check_type = 'out' ; + } + } + + if ( $check_type != 'out' ){ + $current_attendance_q = $mysqli->query("SELECT type FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND check_group = '".$date_group."' ORDER BY attendance_id DESC LIMIT 1") ; + if ( $current_attendance_q->num_rows > 0 ){ + // check if last attendance is in + $current_attendance = $current_attendance_q->fetch_assoc() ; + if ( $current_attendance['type'] == 'in' ){ + $check_type = 'out' ; + } + } + } + + // check if staff and time exists + $check = $mysqli->query("SELECT * FROM staff_attendance + WHERE record_from = 'machine' AND staff_id = '".$staff_id."' AND created_at = '".$date_time."' LIMIT 1") ; + if ( $check->num_rows == 0 ){ + + // set information into staff_attendance + if ( $mysqli->query("INSERT INTO staff_attendance + (staff_id, check_group, type, code, record_from, mac_address, ip_address, latitude, longitude, check_area, temperature, created_at, updated_at) VALUES + ('".$staff_id."', '".$date_group."', '".$check_type."', '".$sn."', 'machine', '', '', '', '', 'in', '".$temperature."', '".$date_time."', '".$date_time."')") ){ + $status = '200' ; + } + + }else{ + $status = '200' ; + } + +} + +require( $require_sub.'footer.php' ) ; + +?> \ No newline at end of file diff --git a/apiv3/punchs/user.php b/apiv3/punchs/user.php new file mode 100644 index 0000000..729e4c8 --- /dev/null +++ b/apiv3/punchs/user.php @@ -0,0 +1,50 @@ +query( "SELECT staff_id, staff_idno, staff_name, staff_shortname, staff_image, branch_id FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned >= '".date( "Y-m-d", time() )."' OR staff_date_resigned = '0000-00-00' OR staff_date_resigned IS NULL ) AND updated_at >= '".date( "Y-m-d H:i:s", strtotime("-1 minutes") )."'" ) ; + +if ( $select_staff->num_rows > 0 ){ + $status = '200' ; + + $array_branch = [] ; + $select_branch = $mysqli->query( "SELECT * FROM branch + WHERE deleted_at IS NULL" ) ; + if ( $select_branch->num_rows > 0 ){ + while ( $row_branch = $select_branch->fetch_assoc() ){ + $array_branch[$row_branch['branch_id']] = $row_branch ; + } + } + + while ( $row_staff = $select_staff->fetch_assoc() ){ + $staff_image = ( $row_staff['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_staff['staff_image']) : '' ) ; + + $punch_companyid = PUNCHCOMPANYID ; + if ( $row_staff['branch_id'] > 0 ){ + if ( arrayCheck( $array_branch[$row_staff['branch_id']] ) ){ + if ( $array_branch[$row_staff['branch_id']]['branch_binding_id'] > 0 ){ + $punch_companyid = $array_branch[$row_staff['branch_id']]['branch_binding_id'] ; + } + } + } + + call( 'curl', PUNCHURL.'/api/user.php', 'POST', [], [ + 'company_id' => $punch_companyid, + 'staff_idno' => $row_staff['staff_idno'], + 'staff_name' => $row_staff['staff_name'], + 'staff_shortname' => $row_staff['staff_shortname'], + 'staff_image' => $staff_image + ] ) ; + + } + +} + +require( $require_sub.'footer.php' ) ; + +?> \ No newline at end of file diff --git a/apiv3/rms/bills/category.php b/apiv3/rms/bills/category.php new file mode 100644 index 0000000..501876e --- /dev/null +++ b/apiv3/rms/bills/category.php @@ -0,0 +1,46 @@ +query( "SELECT a.category_id, b.title FROM rms_bill_category a + LEFT JOIN rms_bill_category_translation b ON ( a.category_id = b.category_id ) + WHERE a.deleted_at IS NULL AND a.status = 'active' AND b.lang = '".$array['lang']."' ORDER BY a.sortable ASC" ) ; + + if ( $mysqli_category->num_rows > 0 ){ + + $status = '200' ; + + $items = [] ; + $mysqli_item = $mysqli->query( "SELECT a.item_id, a.category_id, a.min_amount, a.max_amount, a.is_reference1, a.is_reference2, a.is_reference3, a.is_reference4, a.file, b.title, b.content, b.reference1, b.reference2, b.reference3, b.reference4 FROM rms_bill_item a + LEFT JOIN rms_bill_item_translation b ON ( a.item_id = b.item_id ) + WHERE a.deleted_at IS NULL AND a.status = 'active' AND b.lang = '".$array['lang']."' ORDER BY a.sortable ASC" ) ; + if ( $mysqli_item->num_rows > 0 ){ + while ( $row_item = $mysqli_item->fetch_assoc() ){ + $row_item['title'] = dataFilter( $row_item['title'] ) ; + $row_item['content'] = dataFilter( $row_item['content'] ) ; + $row_item['file'] = ( $row_item['file'] != '' ? PATH.'uploads/RmsBillItem/b/'.$row_item['file'] : '' ) ; + $items[$row_item['category_id']][] = $row_item ; + } + } + + while ( $row_category = $mysqli_category->fetch_assoc() ){ + $row_category['id'] = dataFilter( $row_category['category_id'] ) ; + $row_category['title'] = dataFilter( $row_category['title'] ) ; + $row_category['items'] = ( $items[$row_category['category_id']] != null ? $items[$row_category['category_id']] : [] ) ; + $list[] = $row_category ; + } + + } + + $data['list'] = $list ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/bills/confirm.php b/apiv3/rms/bills/confirm.php new file mode 100644 index 0000000..b637e8c --- /dev/null +++ b/apiv3/rms/bills/confirm.php @@ -0,0 +1,86 @@ + 0 ){ + $status = '250' ; + + $amount = numberFormat( $amount, 2 ) ; + + if ( $staff_info['staff_wallet'] >= $amount ){ + $status = '201' ; + + $select_bill = $mysqli->query( "SELECT a.bill_id, a.reference1, a.reference2, a.reference3, a.reference4, b.biller_code, b.min_amount, b.max_amount FROM staff_rms_bill a + LEFT JOIN rms_bill_item b ON ( a.item_id = b.item_id ) + WHERE a.deleted_at IS NULL AND b.deleted_at IS NULL AND a.staff_id = '".$staff_info['staff_id']."' AND a.bill_id = '".$bill_id."' LIMIT 1" ) ; + if ( $select_bill->num_rows > 0 ){ + $status = 'rms-39' ; + + $row_bill = $select_bill->fetch_assoc() ; + + if ( $amount >= $row_bill['min_amount'] && $amount <= $row_bill['max_amount'] ){ + + $status = '203' ; + + if ( $mysqli->query( "INSERT INTO staff_rms_bill_order + ( `branch_id`, `staff_id`, `bill_id`, `biller_code`, `cashier_id`, `reference1`, `reference2`, `reference3`, `reference4`, `amount` ) VALUES + ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$bill_id."', '".$row_bill['biller_code']."', '".RMSLOCATION."', '".$row_bill['reference1']."', '".$row_bill['reference2']."', '".$row_bill['reference3']."', '".$row_bill['reference4']."', '".$amount."' )" ) ){ + // update sonumber + $order_id = $mysqli->insert_id ; + $sonumber = 'BO'.strPad( 6, $order_id ) ; + + $mysqli->query( "UPDATE staff_rms_bill_order SET sonumber = '".$sonumber."' WHERE order_id = '".$order_id."'" ) ; + + $rms_content = [ + 'referenceId' => $sonumber, + 'billerCode' => $row_bill['biller_code'], + 'billReferenceNo1' => $row_bill['reference1'], + 'billReferenceNo2' => $row_bill['reference2'], + 'billReferenceNo3' => $row_bill['reference3'], + 'billReferenceNo4' => $row_bill['reference4'], + 'amount' => $amount + ] ; + $rms_call = rmsCall( 'bill/initiate', $rms_content ) ; + saveLog( 'rms-api', 'Intiate Bill Order', $rms_content, $rms_call ) ; + + if ( $rms_call['respCode'] == '00' ){ + $status = '298' ; + + // deduct the wallet first + $remark = 'You have been deducted the wallet from bill order '.$row_bill['reference1'].' (' . $sonumber . ')' ; + $walletdeduct = walletMovement( 'staff_rms_bill_order', $order_id, 'minus', 'normal', $staff_info['staff_id'], -($amount), $remark ) ; + + if ( $walletdeduct ){ + $status = '200' ; + + // update status + $mysqli->query( "UPDATE staff_rms_bill_order SET + rms_accountname = '".$rms_call['billAccountName']."', + rms_instruction = '".$rms_call['instruction']."', + rms_authorizationtoken = '".$rms_call['authorizationToken']."', + status = 'pending' + WHERE order_id = '".$order_id."'" ) ; + } + + }else{ + $status = 'rms-'.$rms_call['respCode'] ; + } + + } + } + } + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/bills/delete.php b/apiv3/rms/bills/delete.php new file mode 100644 index 0000000..34f0d8d --- /dev/null +++ b/apiv3/rms/bills/delete.php @@ -0,0 +1,25 @@ +query( "SELECT a.bill_id FROM staff_rms_bill a + WHERE a.deleted_at IS NULL AND a.staff_id = '".$staff_info['staff_id']."' AND a.bill_id = '".$array['bill_id']."'" ) ; + + if ( $mysqli_bill->num_rows > 0 ){ + + $status = '200' ; + + $mysqli->query( "UPDATE staff_rms_bill SET + deleted_at = '".TODAYDATE."' + WHERE bill_id = '".$array['bill_id']."'" ) ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/bills/details.php b/apiv3/rms/bills/details.php new file mode 100644 index 0000000..16b270e --- /dev/null +++ b/apiv3/rms/bills/details.php @@ -0,0 +1,28 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/RmsBillItem/b/'.$row['file'] : '' ) ; + $data['list'] = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/bills/history.php b/apiv3/rms/bills/history.php new file mode 100644 index 0000000..150ce69 --- /dev/null +++ b/apiv3/rms/bills/history.php @@ -0,0 +1,52 @@ +query( $query . " ORDER BY a.order_id DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $row['order_status'] = ( checkExists( $row['status'] ) != '' ? $row['status'] : '' ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/RmsBillItem/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/bills/lists.php b/apiv3/rms/bills/lists.php new file mode 100644 index 0000000..9e6d3ed --- /dev/null +++ b/apiv3/rms/bills/lists.php @@ -0,0 +1,29 @@ +query( "SELECT a.bill_id, a.item_id, a.title, a.reference1, a.reference2, a.reference3, a.reference4, a.created_at, b.is_reference1, b.is_reference2, b.is_reference3, b.is_reference4, c.reference1 as reference1_title, c.reference2 as reference2_title, c.reference3 as reference3_title, c.reference4 as reference4_title FROM staff_rms_bill a + LEFT JOIN rms_bill_item b ON ( a.item_id = b.item_id ) + LEFT JOIN rms_bill_item_translation c ON ( b.item_id = c.item_id ) + WHERE a.deleted_at IS NULL AND a.staff_id = '".$staff_info['staff_id']."' AND a.item_id = '".$array['item_id']."' AND b.deleted_at IS NULL AND b.status = 'active' AND c.lang = '".$array['lang']."'" ) ; + + if ( $mysqli_bill->num_rows > 0 ){ + + $status = '200' ; + + while ( $row_bill = $mysqli_bill->fetch_assoc() ){ + $list[] = $row_bill ; + } + } + + $data['list'] = $list ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/bills/new.php b/apiv3/rms/bills/new.php new file mode 100644 index 0000000..da5b520 --- /dev/null +++ b/apiv3/rms/bills/new.php @@ -0,0 +1,58 @@ +query( "SELECT is_reference1, is_reference2, is_reference3, is_reference4 FROM rms_bill_item + WHERE deleted_at IS NULL AND status = 'active' AND item_id = '".$item_id."' LIMIT 1" ) ; + + if ( $select_item->num_rows > 0 ){ + $status = '300' ; + + $row_item = $select_item->fetch_assoc() ; + + $is_error = 0 ; + if ( $row_item['is_reference1'] == 'yes' && $reference1 == '' ){ + $is_error++ ; + } + if ( $row_item['is_reference2'] == 'yes' && $reference2 == '' ){ + $is_error++ ; + } + if ( $row_item['is_reference3'] == 'yes' && $reference3 == '' ){ + $is_error++ ; + } + if ( $row_item['is_reference4'] == 'yes' && $reference4 == '' ){ + $is_error++ ; + } + + if ( $is_error == 0 ){ + $status = '203' ; + + if ( $mysqli->query( "INSERT INTO staff_rms_bill + ( `branch_id`, `staff_id`, `item_id`, `title`, `reference1`, `reference2`, `reference3`, `reference4` ) VALUES + ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$array['item_id']."', '".$array['title']."', '".$array['reference1']."', '".$array['reference2']."', '".$array['reference3']."', '".$array['reference4']."' )" ) ){ + $status = '200' ; + } + } + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/bills/update.php b/apiv3/rms/bills/update.php new file mode 100644 index 0000000..6c89618 --- /dev/null +++ b/apiv3/rms/bills/update.php @@ -0,0 +1,65 @@ + 0 ){ + $status = '201' ; + + $select_item = $mysqli->query( "SELECT is_reference1, is_reference2, is_reference3, is_reference4 FROM rms_bill_item + WHERE deleted_at IS NULL AND status = 'active' AND item_id = '".$item_id."' LIMIT 1" ) ; + + if ( $select_item->num_rows > 0 ){ + $status = '300' ; + + $row_item = $select_item->fetch_assoc() ; + + $is_error = 0 ; + foreach ( $lists as $k => $v ){ + if ( $row_item['is_reference1'] == 'yes' && $v['reference1'] == '' ){ + $is_error++ ; + } + if ( $row_item['is_reference2'] == 'yes' && $v['reference2'] == '' ){ + $is_error++ ; + } + if ( $row_item['is_reference3'] == 'yes' && $v['reference3'] == '' ){ + $is_error++ ; + } + if ( $row_item['is_reference4'] == 'yes' && $v['reference4'] == '' ){ + $is_error++ ; + } + } + + if ( $is_error == 0 ){ + $status = '203' ; + + $is_update = false ; + foreach ( $lists as $k => $v ){ + if ( $mysqli->query( "UPDATE staff_rms_bill SET + title = '".$v['title']."', + reference1 = '".$v['reference1']."', + reference2 = '".$v['reference2']."', + reference3 = '".$v['reference3']."', + reference4 = '".$v['reference4']."' + WHERE bill_id = '".$v['bill_id']."'" ) ){ + $is_update = true ; + } + } + + if ( $is_update ){ + $status = '200' ; + } + } + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/prepaids/check.php b/apiv3/rms/prepaids/check.php new file mode 100644 index 0000000..05820ea --- /dev/null +++ b/apiv3/rms/prepaids/check.php @@ -0,0 +1,68 @@ +query( "INSERT INTO staff_rms_prepaid_pretemp + ( `referenceid`, `item_id`, `dialcode`, `mobile` ) VALUES + ( '".$referenceid."', '".$item_id."', '".$dialcode."', '".$mobile."' )" ) ){ + + $temp_id = $mysqli->insert_id ; + + // $rms_content = [ + // 'referenceId' => $referenceid, + // 'countryCode' => $dialcode, + // 'mobileNumber' => $mobile + // ] ; + // $rms_call = rmsCall( 'pinless/getproductidlistbymobilenumber', $rms_content ) ; + // saveLog( 'rms-api', 'Check Prepaid Mobile Number', $rms_content, $rms_call ) ; + + // if ( $rms_call['respCode'] == '00' ){ + // $status = '202' ; + + // if ( $mysqli->query( "UPDATE staff_rms_prepaid_pretemp SET + // rms_authorizationtoken = '".$rms_call['authorizationToken']."', + // status = 'progress' + // WHERE temp_id = '".$temp_id."'" ) ){ + // $status = '200' ; + // $data = [ + // 'temp_id' => $temp_id + // ] ; + // } + + // }else{ + // $status = 'rms-'.$rms_call['respCode'] ; + // } + + $status = '202' ; + + if ( $mysqli->query( "UPDATE staff_rms_prepaid_pretemp SET + status = 'progress' + WHERE temp_id = '".$temp_id."'" ) ){ + $status = '200' ; + $data = [ + 'temp_id' => $temp_id + ] ; + } + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/prepaids/confirm.php b/apiv3/rms/prepaids/confirm.php new file mode 100644 index 0000000..9933247 --- /dev/null +++ b/apiv3/rms/prepaids/confirm.php @@ -0,0 +1,88 @@ +query( "SELECT deno_code, amount FROM rms_prepaid_deno + WHERE deleted_at IS NULL AND item_id = '".$item_id."' AND deno_id = '".$deno_id."' AND status = 'active' LIMIT 1" ) ; + if ( $select_deno->num_rows > 0 ){ + + $row_deno = $select_deno->fetch_assoc() ; + $amount = numberFormat( $row_deno['amount'], 2 ) ; + + $select_temp = $mysqli->query( "SELECT rms_authorizationtoken FROM staff_rms_prepaid_pretemp + WHERE deleted_at IS NULL AND temp_id = '".$temp_id."' AND item_id = '".$item_id."' AND dialcode = '".$dialcode."' AND mobile = '".$mobile."' LIMIT 1" ) ; + + if ( $select_temp->num_rows > 0 ){ + $status = '250' ; + + $row_temp = $select_temp->fetch_assoc() ; + + if ( $amount > 0 && $staff_info['staff_wallet'] >= $amount ){ + $status = '203' ; + + if ( $mysqli->query( "INSERT INTO staff_rms_prepaid_order + ( `branch_id`, `staff_id`, `temp_id`, `item_id`, `deno_id`, `deno_code`, `cashier_id`, `dialcode`, `mobile`, `amount` ) VALUES + ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$temp_id."', '".$item_id."', '".$deno_id."', '".$row_deno['deno_code']."', '".RMSLOCATION."', '".$dialcode."', '".$mobile."', '".$amount."' )" ) ){ + // update sonumber + $order_id = $mysqli->insert_id ; + $sonumber = 'TO'.strPad( 6, $order_id ) ; + + $mysqli->query( "UPDATE staff_rms_prepaid_order SET sonumber = '".$sonumber."' WHERE order_id = '".$order_id."'" ) ; + + $status = '298' ; + + // deduct the wallet first + $remark = 'You have been deducted the wallet from prepaid order '.$dialcode.'-'.$mobile.' (' . $sonumber . ')' ; + $walletdeduct = walletMovement( 'staff_rms_prepaid_order', $order_id, 'minus', 'normal', $staff_info['staff_id'], -($amount), $remark ) ; + + if ( $walletdeduct ){ + $status = '200' ; + + $rms_content = [ + 'referenceId' => $sonumber, + 'cashierId' => RMSLOCATION, + 'productCode' => $row_deno['deno_code'], + 'transactionDateTime' => date( "Y-m-d\TH:i:s", time() ), + 'businessDate' => date( "Y-m-d", time() ), + 'countryCode' => $dialcode, + 'mobileNumber' => $mobile, + 'partnerReferenceId' => $sonumber + ] ; + $rms_call = rmsCall( 'pinless/requesttopup', $rms_content ) ; + saveLog( 'rms-api', 'Request Prepaid Order', $rms_content, $rms_call ) ; + + // update status + $mysqli->query( "UPDATE staff_rms_prepaid_order SET + rms_instruction = '".$rms_call['instructions']."', + rms_order_id = '".$rms_call['orderId']."', + status = 'pending' + WHERE order_id = '".$order_id."'" ) ; + + } + + } + } + + } + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/prepaids/details.php b/apiv3/rms/prepaids/details.php new file mode 100644 index 0000000..44d6957 --- /dev/null +++ b/apiv3/rms/prepaids/details.php @@ -0,0 +1,28 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/RmsPrepaidItem/b/'.$row['file'] : '' ) ; + $data['list'] = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/prepaids/history.php b/apiv3/rms/prepaids/history.php new file mode 100644 index 0000000..819657a --- /dev/null +++ b/apiv3/rms/prepaids/history.php @@ -0,0 +1,52 @@ +query( $query . " ORDER BY a.order_id DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $row['order_status'] = ( checkExists( $row['status'] ) != '' ? $row['status'] : '' ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/RmsPrepaidItem/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/rms/prepaids/item.php b/apiv3/rms/prepaids/item.php new file mode 100644 index 0000000..aabbb6f --- /dev/null +++ b/apiv3/rms/prepaids/item.php @@ -0,0 +1,45 @@ +query( "SELECT a.item_id, a.file, b.title FROM rms_prepaid_item a + LEFT JOIN rms_prepaid_item_translation b ON ( a.item_id = b.item_id ) + WHERE a.deleted_at IS NULL AND a.status = 'active' AND b.lang = '".$array['lang']."' ORDER BY a.sortable ASC" ) ; + + if ( $mysqli_item->num_rows > 0 ){ + + $status = '200' ; + + $denos = [] ; + $mysqli_deno = $mysqli->query( "SELECT a.deno_id, a.item_id, b.title FROM rms_prepaid_deno a + LEFT JOIN rms_prepaid_deno_translation b ON ( a.deno_id = b.deno_id ) + WHERE a.deleted_at IS NULL AND a.status = 'active' AND b.lang = '".$array['lang']."' ORDER BY a.sortable ASC" ) ; + if ( $mysqli_deno->num_rows > 0 ){ + while ( $row_deno = $mysqli_deno->fetch_assoc() ){ + $row_deno['title'] = dataFilter( $row_deno['title'] ) ; + $denos[$row_deno['item_id']][] = $row_deno ; + } + } + + while ( $row_item = $mysqli_item->fetch_assoc() ){ + $row_item['id'] = dataFilter( $row_item['item_id'] ) ; + $row_item['title'] = dataFilter( $row_item['title'] ) ; + $row_item['file'] = ( $row_item['file'] != '' ? PATH.'uploads/RmsPrepaidItem/b/'.$row_item['file'] : '' ) ; + $row_item['denos'] = ( $denos[$row_item['item_id']] != null ? $denos[$row_item['item_id']] : [] ) ; + $list[] = $row_item ; + } + + } + + $data['list'] = $list ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/scans/checkin-service.php b/apiv3/scans/checkin-service.php new file mode 100644 index 0000000..74ce115 --- /dev/null +++ b/apiv3/scans/checkin-service.php @@ -0,0 +1,71 @@ +query( "SELECT view_id, status FROM staff_association + WHERE deleted_at IS NULL AND association_so = '".$qrocde."' LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '299' ; + + $row = $select->fetch_assoc() ; + + if ( $row['status'] == 'approved' ){ + $status = '200' ; + + $mysqli->query( "UPDATE staff_association SET + status = 'confirmed' + WHERE view_id = '".$row['view_id']."'" ) ; + } + + } + + } + + } + + + + if ( strpos($qrocde, 'TN') !== false ) { + $status = '303' ; + + if ( $staff_info['staff_settings']['checktraining'] == 'yes' ){ + $status = '201' ; + + $select = $mysqli->query( "SELECT view_id, status FROM staff_training + WHERE deleted_at IS NULL AND training_so = '".$qrocde."' LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '299' ; + + $row = $select->fetch_assoc() ; + + if ( $row['status'] == 'approved' ){ + $status = '200' ; + + $mysqli->query( "UPDATE staff_training SET + status = 'confirmed' + WHERE view_id = '".$row['view_id']."'" ) ; + } + + } + } + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/scans/visitation-checkin.php b/apiv3/scans/visitation-checkin.php new file mode 100644 index 0000000..9266310 --- /dev/null +++ b/apiv3/scans/visitation-checkin.php @@ -0,0 +1,109 @@ +query( "SELECT * FROM visitor + WHERE deleted_at IS NULL AND visitor_id = '".$visitor_id."' LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '306' ; + + $row_visitor = $select->fetch_assoc() ; + + $branch_hr_contact = '' ; + $branch_hr_email = '' ; + $branch_hr_cc = [] ; + $branch_email_footer = '' ; + $mysqli_query = "SELECT branch_hr_email, branch_hr_cc, branch_hr_contact, branch_email_footer FROM branch WHERE + deleted_at IS NULL AND branch_id = '".$row_visitor['branch']."' LIMIT 1" ; + $mysqli_branch = $mysqli->query($mysqli_query) ; + if ( $mysqli_branch->num_rows > 0 ){ + $row_branch = $mysqli_branch->fetch_assoc() ; + $branch_hr_contact = dataFilter( $row_branch['branch_hr_contact'] ) ; + $branch_hr_email = dataFilter( $row_branch['branch_hr_email'] ) ; + $branch_hr_cc = explodeToArray( $row_branch['branch_hr_cc'] ) ; + $branch_email_footer = entityDecode( dataFilter( $row_branch['branch_email_footer'] ) ) ; + } + + + $file_name = '' ; + + // upload file + $count_upload = 0 ; + foreach ( $photos as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'Visitor', 'visiter-'.$visitor_id, $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $file_name = $upload['data']['file_name'] ; + } + } + } + + if ( $count_upload == 0 ){ + $status = '308' ; + + if ( $row_visitor['status'] == 'tested-approved' || $row_visitor['status'] == 'visited' ){ + $status = '257' ; + + $visited_at = date( 'Y-m-d', strtotime( $row_visitor['visited_at'] ) ) ; + $visited_at_to = date( 'Y-m-d', strtotime( $row_visitor['visited_at_to'] ) ) ; + if ( $visited_at <= TODAYDAY && $visited_at_to >= TODAYDAY ){ + $status = '200' ; + + $mysqli->query( "INSERT INTO visitor_checkin ( visitor_id, checkin_file ) VALUES ( '".$visitor_id."', '".$file_name."' )" ) ; + + $mysqli->query( "UPDATE visitor SET status = 'visited' WHERE visitor_id = '".$visitor_id."'" ) ; + + $body = 'Dear valued visitor,

Thank you for your submission. Welcome to '.COMPANYSHORT.'!

by ' . COMPANY . '!' . $branch_email_footer ; + $body_sms = 'Dear valued visitor, thank you for your submission. Welcome to '.COMPANYSHORT.'!' ; + + $mailer = new Mailer() ; + $mailer->from = $branch_hr_email ; + $mailer->fromname = COMPANY ; + $mailer->to = [ $row_visitor['email'] ] ; + if ( count($branch_hr_cc) > 0 ){ + $mailer->cc = $branch_hr_cc ; + } + $mailer->subject = 'Visitor Checked In' ; + $mailer->body = $body ; + $mailer->send() ; + + if ( substr( $row_visitor['mobile'], 0, 2 ) == '60' || substr( $row_visitor['mobile'], 0, 3 ) == '+60' || + substr( $row_visitor['mobile'], 0, 2 ) == '65' || substr( $row_visitor['mobile'], 0, 3 ) == '+65' ){ + $sms = new Sms() ; + $sms->to = $row_visitor['mobile'] ; + $sms->message = $body_sms ; + $sms->send() ; + } + } + } + } + + } + + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/scans/visitation.php b/apiv3/scans/visitation.php new file mode 100644 index 0000000..4b79039 --- /dev/null +++ b/apiv3/scans/visitation.php @@ -0,0 +1,67 @@ +query( "SELECT * FROM visitor + WHERE deleted_at IS NULL AND visitor_id = '".$qrocde."' LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + + $status = '200' ; + + $row_visitor = $select->fetch_assoc() ; + + // get branch name + $branch_name = '' ; + $mysqli_query = "SELECT branch_id, branch_name FROM branch + WHERE branch_id = '".$row_visitor['branch']."' LIMIT 1" ; + $mysqli_branch = $mysqli->query($mysqli_query) ; + if ( $mysqli_branch->num_rows > 0 ){ + $row_branch = $mysqli_branch->fetch_assoc() ; + $branch_name = $row_branch['branch_name'] ; + } + + $is_showbutton = 'no' ; + $visited_at = date( 'Y-m-d', strtotime( $row_visitor['visited_at'] ) ) ; + $visited_at_to = date( 'Y-m-d', strtotime( $row_visitor['visited_at_to'] ) ) ; + if ( $visited_at <= TODAYDAY && $visited_at_to >= TODAYDAY ){ + $is_showbutton = 'yes' ; + } + + $data = [ + 'visitor_id' => dataFilter( $row_visitor['visitor_id'] ), + 'appointment_date' => date( 'Y-m-d H:iA', strtotime( $row_visitor['visited_at'] ) ) . ' ~ ' . date( 'Y-m-d H:iA', strtotime( $row_visitor['visited_at_to'] ) ), + 'branch_name' => dataFilter( $branch_name ), + 'visitor_category' => ucwords( dataFilter( $row_visitor['category'] ) ), + 'visitor_name' => dataFilter( $row_visitor['name'] ), + 'contact_number' => dataFilter( $row_visitor['mobile'] ), + 'email' => dataFilter( $row_visitor['email'] ), + 'nric_passport' => dataFilter( $row_visitor['identity'] ), + 'nationality' => dataFilter( $row_visitor['nationality'] ), + 'visitor_company' => ucwords( dataFilter( $row_visitor['visitor_company'] ) ), + 'car_plate' => dataFilter( $row_visitor['car_plate'] ), + 'reason_to_visit' => dataFilter( $row_visitor['reason'] ), + 'contact_person' => dataFilter( $row_visitor['contact_person'] ), + 'status' => dataFilter( $row_visitor['status'] ), + 'is_showbutton' => $is_showbutton + ] ; + + } + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/adjustments/componentsv2.php b/apiv3/services/adjustments/componentsv2.php new file mode 100644 index 0000000..b6a3861 --- /dev/null +++ b/apiv3/services/adjustments/componentsv2.php @@ -0,0 +1,150 @@ + [], 'minus' => [] ] ; + $staffs = [] ; + $departments = [] ; + $staff_departments = [] ; + $all_tier = getAllTier( $array['lang'] ) ; + + + + // select all adjustment + $query_setting = " AND set_tier LIKE '%|".$staff_info['staff_tier']."|%'" ; + switch ( $staff_info['staff_tier_is_adjustment'] ){ + case 'yes' : + // do nothing + break ; + default : + $query_setting = " AND a.adjustment_mode = 'fixed'" ; + } + + $select = $mysqli->query( "SELECT a.adjustment_id, a.adjustment_type, a.adjustment_mode, a.point, b.title FROM setting_adjustment a + LEFT JOIN setting_adjustment_translation b ON ( a.adjustment_id = b.adjustment_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND a.adjustment_site = 'frontend' ".$query_setting." ORDER BY a.sortable" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $adjustments[$row['adjustment_type']][] = [ + 'id' => $row['adjustment_id'], + 'mode' => $row['adjustment_mode'], + 'title' => dataFilter( $row['title'] ), + 'point' => $row['point'] + ] ; + } + } + + // select all staff + $staff_tier = [] ; + $staff_tier = getRelatedTierID( 'no', $staff_info['staff_tier_level'] ) ; + + $where_staff = '' ; + $where_branch = '' ; + if ( $staff_info['staff_settings']['adjustmentbranch'] != 'yes' ){ + $where_staff .= " AND a.branch_id = '".$array['branch_id']."'" ; + $where_branch .= " AND a.branch_id = '".$array['branch_id']."'" ; + } + + // select all staff + $select = $mysqli->query( "SELECT a.staff_id, a.branch_id, a.staff_idno, a.staff_name, a.staff_shortname, a.staff_tier FROM staff a + WHERE a.deleted_at IS NULL AND a.staff_id != '".$staff_info['staff_id']."' AND a.staff_tier IN ( '".implode("', '", $staff_tier)."' ) AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL ) " . $where_staff ) ; + + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $get_staff_tier = $all_tier[$row['staff_tier']] ; + + $staffs[$row['staff_id']] = [ + 'id' => $row['staff_id'], + 'branch_id' => $row['branch_id'], + 'title' => $row['staff_shortname'] . ' ('.$row['staff_idno'].' / '.strtoupper( $get_staff_tier['title'] ).')', + 'name' => $row['staff_name'], + 'tier' => $get_staff_tier['level'] + ] ; + } + } + + + + // select all department + $select = $mysqli->query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $departments[] = $row ; + } + } + + + + + // select all branch + $branches = [] ; + $select_branch = $mysqli->query( "SELECT branch_id, branch_name FROM branch a + WHERE a.deleted_at IS NULL" . $where_branch ) ; + if ( $select_branch->num_rows > 0 ){ + while ( $row_branch = $select_branch->fetch_assoc() ){ + $branches[] = [ + 'id' => $row_branch['branch_id'], + 'title' => dataFilter( $row_branch['branch_name'] ) + ] ; + } + } + + + + // select all staff department + $select = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department a + WHERE a.deleted_at IS NULL" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + if ( $staffs[ $row['staff_id'] ] != null && $staffs[ $row['staff_id'] ] != undefined ){ + $staff = $staffs[ $row['staff_id'] ] ; + $staff_departments[$staff['branch_id']][$row['department_id']][] = $staff ; + } + } + } + + + $reset_branches = [] ; + foreach ( $branches as $kbranch => $vbranch ){ + // reset + $reset_departments = [] ; + $reset_departments[] = [ + 'id' => '0', + 'title' => 'Cross Department', + 'staffs' => [] + ] ; + foreach ( $departments as $k => $v ){ + if ( $staff_departments[$vbranch['id']][$v['department_id']] != null && $staff_departments[$vbranch['id']][$v['department_id']] != undefined ){ + $reset_departments[] = [ + 'id' => $v['department_id'], + 'title' => $v['department_desc'], + 'staffs' => $staff_departments[$vbranch['id']][$v['department_id']] + ] ; + } + } + + $reset_branches[] = [ + 'id' => $vbranch['id'], + 'title' => $vbranch['title'], + 'departments' => $reset_departments + ] ; + } + + + + $data = [ + 'adjustments' => $adjustments, + 'default_branch' => $array['branch_id'], + 'branches' => $reset_branches + ] ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/adjustments/lists.php b/apiv3/services/adjustments/lists.php new file mode 100644 index 0000000..712e2e2 --- /dev/null +++ b/apiv3/services/adjustments/lists.php @@ -0,0 +1,61 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = $row['department_desc'] ; + } + } + + // select all staff + $staff_list = [] ; + $select = $mysqli->query( "SELECT a.staff_id, a.staff_name, a.staff_shortname, a.staff_idno FROM staff a + WHERE a.deleted_at IS NULL AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL )" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $staff_list[$row['staff_id']] = $row['staff_shortname'] . ' ( '.$row['staff_idno'].' )' ; + } + } + + + $search_query = '' ; + if ( $array['search'] != '' ){ + $search_query .= " AND ( a.remark LIKE '%".$array['search']."%' OR b.title LIKE '%".$array['search']."%' )" ; + } + + $query = "SELECT a.adjustment_id, a.adjustment_so, a.adjustment_type, a.created_by, a.department_id, a.point, a.remark, a.created_at, b.title FROM staff_adjustment a + LEFT JOIN setting_adjustment_translation b ON ( a.setting_adjustment_id = b.adjustment_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND ( a.created_branch_id = '".$array['branch_id']."' AND a.created_by = '".$staff_info['staff_id']."' ) " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ORDER BY a.adjustment_id DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + + $row['department'] = $department_list[ $row['department_id'] ] ; + $row['created_by_name'] = $staff_list[ $row['created_by'] ] ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/adjustments/report.php b/apiv3/services/adjustments/report.php new file mode 100644 index 0000000..4870420 --- /dev/null +++ b/apiv3/services/adjustments/report.php @@ -0,0 +1,172 @@ + [ + 'plus' => $months, + 'minus' => $months + ], + ] ; + if ( $staff_settings['reportadjustmentbranch'] == 'yes' ){ + $array_report['branch'] = [ + 'plus' => $months, + 'minus' => $months + ] ; + } + + $filtertype = [] ; + foreach ( $array_report as $k => $v ){ + if ( $k == $search_type ){ + $filtertype[] = $k ; + } + } + + foreach ( $filtertype as $k => $v ){ + + $search_query = " AND ( b.created_branch_id = '".$array['branch_id']."' XXXXXX )" ; + switch ( $v ){ + case 'personal' : + $search_query = str_replace( 'XXXXXX', " AND b.created_by = '".$staff_info['staff_id']."'", $search_query ) ; + break ; + case 'branch' : + $search_query = str_replace( 'XXXXXX', '', $search_query ) ; + break ; + } + + $select_report = $mysqli->query( "SELECT SUM(a.point) as total, b.adjustment_type, MONTH(b.created_at) as month FROM staff_adjustment_point a + LEFT JOIN staff_adjustment b ON ( a.adjustment_id = b.adjustment_id ) + WHERE a.deleted_at IS NULL AND b.deleted_at IS NULL AND b.created_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY b.adjustment_type, MONTH(b.created_at)" ) ; + + if ( $select_report->num_rows > 0 ){ + while ( $row_report = $select_report->fetch_assoc() ){ + $array_report[$v][$row_report['adjustment_type']][$row_report['month']] = $row_report['total'] ; + } + } + + } + + + // direct echo + if ( $array['iswebview'] == 'yes' ){ + + $html .= ' + + + + + + + + + + +
+ +
+ + + + '. $search_year .' + + + +
' ; + + if ( count($array_report) > 1 ){ + $html .= ' + ' ; + } + + foreach ( $array_report as $kreport => $vreport ){ + + if ( $kreport == $search_type ){ + + $title = $lang['By '.ucwords($kreport).' Report'] ; + $titlename = $title.' ( '.$lang['Year'].' '.$search_year.' )' ; + + $html .= ' +
+ +
+ ' ; + + } + } + + $html .= ' +
+ + ' ; + } + +} + + + + +if ( $array['iswebview'] == 'yes' ){ + echo $html ; + exit ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/adjustments/select.php b/apiv3/services/adjustments/select.php new file mode 100644 index 0000000..4aa77c9 --- /dev/null +++ b/apiv3/services/adjustments/select.php @@ -0,0 +1,72 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = $row['department_desc'] ; + } + } + + // select all staff + $staff_list = [] ; + $select = $mysqli->query( "SELECT a.staff_id, a.staff_name, a.staff_shortname, a.staff_idno FROM staff a + WHERE a.deleted_at IS NULL AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL )" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $staff_list[$row['staff_id']] = $row['staff_shortname'] . ' ( '.$row['staff_idno'].' )' ; + } + } + + + $search_query = '' ; + $search_query .= " AND a.adjustment_id = '".$array['adjustment_id']."'" ; + + $query = "SELECT a.adjustment_id, a.adjustment_so, a.adjustment_type, a.created_by, a.department_id, a.point, a.remark, a.created_at, b.title FROM staff_adjustment a + LEFT JOIN setting_adjustment_translation b ON ( a.setting_adjustment_id = b.adjustment_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + + $search_query2 = '' ; + if ( $row['created_by'] != $staff_info['staff_id'] ){ + $search_query2 .= " AND staff_id = '".$staff_info['staff_id']."'" ; + } + + $related_staff = [] ; + $select_related = $mysqli->query( "SELECT staff_id FROM staff_adjustment_point + WHERE deleted_at IS NULL AND adjustment_id = '".$array['adjustment_id']."'" . $search_query2 ) ; + + if ( $select_related->num_rows > 0 ){ + while ( $row_related = $select_related->fetch_assoc() ){ + $related_staff[] = $staff_list[$row_related['staff_id']] ; + } + } + + $row['title'] = dataFilter( $row['title'] ) ; + $row['department'] = $department_list[ $row['department_id'] ] ; + $row['created_by_name'] = $staff_list[ $row['created_by'] ] ; + $row['related_staff'] = $related_staff ; + $data = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/adjustments/update.php b/apiv3/services/adjustments/update.php new file mode 100644 index 0000000..f394e53 --- /dev/null +++ b/apiv3/services/adjustments/update.php @@ -0,0 +1,199 @@ + 0 ? $point : -($point) ) ; + break ; + case 'minus' : + $point = ( $point > 0 ? -($point) : $point ) ; + break ; + } + + if ( $point > 0 || $point < 0 ){ + $status = '203' ; + + $select_adjustment = $mysqli->query( "SELECT a.adjustment_id, a.adjustment_group, a.adjustment_scenario, a.adjustment_times, b.title FROM setting_adjustment a + LEFT JOIN setting_adjustment_translation b ON ( a.adjustment_id = b.adjustment_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.adjustment_id = '".$array['setting_adjustment_id']."' + LIMIT 1" ) ; + if ( $select_adjustment->num_rows > 0 ){ + $status = '271' ; + + $row_adjustment = $select_adjustment->fetch_assoc() ; + $adjustment_times = $row_adjustment['adjustment_times'] ; + + $list_adjustment = [] ; + $list_adjustment[]= $row_adjustment['adjustment_id'] ; + if ( $row_adjustment['adjustment_group'] > 0 ){ + $select_group = $mysqli->query( "SELECT adjustment_id FROM setting_adjustment + WHERE deleted_at IS NULL AND adjustment_site = 'frontend' AND adjustment_group = '".$row_adjustment['adjustment_group']."'" ) ; + if ( $select_group->num_rows > 0 ){ + while ( $row_group = $select_group->fetch_assoc() ){ + $list_adjustment[] = $row_group['adjustment_id'] ; + } + } + } + + $is_allow = false ; + switch ( $row_adjustment['adjustment_scenario'] ){ + case 'none' : + $is_allow = true ; + break ; + case 'daily' : + + $boolean_all = true ; + foreach ( $array['related_staffs'] as $k => $v ){ + $select_total = $mysqli->query( "SELECT point_id FROM staff_adjustment_point + WHERE setting_adjustment_id IN ( ".implode( ', ', $list_adjustment )." ) AND staff_id = '".$v['id']."' AND created_at LIKE '%".date( 'Y-m-d', time() )."%'" ) ; + if ( $select_total->num_rows >= $adjustment_times ){ + $boolean_all = false ; + } + + } + + if ( $boolean_all ){ + $is_allow = true ; + } + + break ; + case '2daily' : + + $boolean_all = true ; + foreach ( $array['related_staffs'] as $k => $v ){ + $select_total = $mysqli->query( "SELECT point_id FROM staff_adjustment_point + WHERE setting_adjustment_id IN ( ".implode( ', ', $list_adjustment )." ) AND staff_id = '".$v['id']."' AND ( created_at LIKE '%".date( 'Y-m-d', strtotime( "-1 days" ) )."%' OR created_at LIKE '%".date( 'Y-m-d', time() )."%' )" ) ; + if ( $select_total->num_rows >= $adjustment_times ){ + $boolean_all = false ; + } + } + + if ( $boolean_all ){ + $is_allow = true ; + } + + break ; + case 'weekly' : + + $boolean_all = true ; + foreach ( $array['related_staffs'] as $k => $v ){ + $select_total = $mysqli->query( "SELECT point_id FROM staff_adjustment_point + WHERE setting_adjustment_id IN ( ".implode( ', ', $list_adjustment )." ) AND staff_id = '".$v['id']."' AND created_at BETWEEN '".date( 'Y-m-d', strtotime('monday this week') )." 00:00:00' AND '".date( 'Y-m-d', strtotime('sunday this week') )." 23:59:59'" ) ; + if ( $select_total->num_rows >= $adjustment_times ){ + $boolean_all = false ; + } + } + + if ( $boolean_all ){ + $is_allow = true ; + } + + break ; + case 'monthly' : + + $boolean_all = true ; + foreach ( $array['related_staffs'] as $k => $v ){ + $select_total = $mysqli->query( "SELECT point_id FROM staff_adjustment_point + WHERE setting_adjustment_id IN ( ".implode( ', ', $list_adjustment )." ) AND staff_id = '".$v['id']."' AND ( created_at LIKE '%".date( 'Y-m', time() )."%' )" ) ; + if ( $select_total->num_rows >= $adjustment_times ){ + $boolean_all = false ; + } + + } + + if ( $boolean_all ){ + $is_allow = true ; + } + + break ; + case 'quaterly' : + + $array_quarter = [ + '1' => [ '01', '02', '03' ], + '2' => [ '04', '05', '06' ], + '3' => [ '07', '08', '09' ], + '4' => [ '10', '11', '12' ], + ] ; + $current_month = date( "m", time() ) ; + $current_quarter = ceil( $current_month / 3 ) ; + $get_quarter = $array_quarter[$current_quarter] ; + + $boolean_all = true ; + foreach ( $array['related_staffs'] as $k => $v ){ + $select_total = $mysqli->query( "SELECT point_id FROM staff_adjustment_point + WHERE setting_adjustment_id IN ( ".implode( ', ', $list_adjustment )." ) AND staff_id = '".$v['id']."' AND ( created_at LIKE '%".date( 'Y-', time() ).$array_quarter[0]."%' OR created_at LIKE '%".date( 'Y-', time() ).$array_quarter[1]."%' OR created_at LIKE '%".date( 'Y-', time() ).$array_quarter[2]."%' )" ) ; + if ( $select_total->num_rows >= $adjustment_times ){ + $boolean_all = false ; + } + } + + if ( $boolean_all ){ + $is_allow = true ; + } + break ; + case 'annually' : + + $boolean_all = true ; + foreach ( $array['related_staffs'] as $k => $v ){ + $select_total = $mysqli->query( "SELECT point_id FROM staff_adjustment_point + WHERE setting_adjustment_id IN ( ".implode( ', ', $list_adjustment )." ) AND staff_id = '".$v['id']."' AND ( created_at LIKE '%".date( 'Y-', time() )."%' )" ) ; + if ( $select_total->num_rows >= $adjustment_times ){ + $boolean_all = false ; + } + + } + + if ( $boolean_all ){ + $is_allow = true ; + } + + break ; + } + + if ( $is_allow ){ + + if ( $mysqli->query( "INSERT INTO staff_adjustment + ( `adjustment_type`, `created_branch_id`, `created_by`, `department_id`, `setting_adjustment_id`, `point`, `remark` ) VALUES + ( '".$array['adjustment_type']."', '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$array['department_id']."', '".$array['setting_adjustment_id']."', '".$point."', '".$array['remark']."' )" ) ){ + $status = '200' ; + + + $adjustment_id = $mysqli->insert_id ; + $adjustment_so = 'AD'.strPad( 6, $adjustment_id ) ; + $mysqli->query( "UPDATE staff_adjustment SET adjustment_so = '".$adjustment_so."' WHERE adjustment_id = '".$adjustment_id."'" ) ; + + // set point movement + // $remark = $staff_info['staff_shortname'].' ('.$staff_info['staff_idno'].') '.( $point > 0 ? 'give' : 'deduct' ).' the point ('.$row_adjustment['title'].') from adjustment ( ' . $adjustment_so . ' )' ; + $remark = 'You have been '.( $point > 0 ? 'given' : 'deducted' ).' the point ('.$row_adjustment['title'].') from adjustment (' . $adjustment_so . ')' ; + + foreach ( $array['related_staffs'] as $k => $v ){ + $mysqli->query( "INSERT INTO staff_adjustment_point ( `adjustment_id`, `setting_adjustment_id`, `staff_id`, `point` ) VALUES ( '".$adjustment_id."', '".$array['setting_adjustment_id']."', '".$v['id']."', '".$point."' )" ) ; + + pointMovement( 'adjustment', $adjustment_id, $array['adjustment_type'], 'normal', $v['id'], $point, $remark ) ; + pushToUserCron( 'staff_adjustment', $adjustment_id, $v['id'], 'Point Adjustment', $remark ) ; + } + + } + } + + } + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/announcements/checked.php b/apiv3/services/announcements/checked.php new file mode 100644 index 0000000..805a36e --- /dev/null +++ b/apiv3/services/announcements/checked.php @@ -0,0 +1,44 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + $mysqli->query( "INSERT INTO staff_announcement + ( announcement_id, staff_id ) VALUES + ( '".$array['id']."', '".$staff_info['staff_id']."' ) " ) ; + + // update inbox as read + $select_inbox = $mysqli->query( "SELECT a.view_id FROM staff_inbox_view a + LEFT JOIN inbox b ON ( a.inbox_id = b.inbox_id ) + WHERE a.deleted_at IS NULL AND a.staff_id = '".$staff_info['staff_id']."' AND a.is_read = '0' AND b.deleted_at IS NULL AND b.from_table = 'announcement' AND b.from_id = '".$array['id']."'" ) ; + if ( $select_inbox->num_rows > 0 ){ + while ( $row_inbox = $select_inbox->fetch_assoc() ){ + $mysqli->query( "UPDATE staff_inbox_view SET + is_read = '1' + WHERE view_id = '".$row_inbox['view_id']."'" ) ; + } + } + + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/announcements/details.php b/apiv3/services/announcements/details.php new file mode 100644 index 0000000..8767322 --- /dev/null +++ b/apiv3/services/announcements/details.php @@ -0,0 +1,70 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $content = dataFilter( $row['content'] ) ; + $file = ( $row['file'] != '' ? PATH.'uploads/Announcement/b/'.$row['file'] : '' ) ; + + // check if agree or not + $is_agreed = 'no' ; + $select_agree = $mysqli->query( "SELECT * FROM staff_announcement + WHERE deleted_at IS NULL AND announcement_id = '".$array['id']."' AND staff_id = '".$staff_info['staff_id']."' LIMIT 1" ) ; + if ( $select_agree->num_rows > 0 ){ + $is_agreed = 'yes' ; + } + + + $filename = 'pdfs/announcement-'.strPad( 3, $id ).'.pdf' ; + $filename_save = $require_path . $filename ; + $filename_source = PATH . $filename ; + $header = '' ; + $footer = '' ; + $html = mergeImageWithContent( $file, $content ) ; + + $mpdf = new mPDF( 'utf-8', 'A4', '', 'freesans', 15, 15, 15, 15, 5, 5 ) ; + $mpdf->mirrorMargins = 1 ; + $mpdf->useAdobeCJK = true ; + $mpdf->SetHTMLHeader( $header ) ; + $mpdf->SetHTMLHeader( $header,'E' ) ; + $mpdf->SetHTMLFooter( $footer ) ; + $mpdf->SetHTMLFooter( $footer,'E' ) ; + $mpdf->WriteHTML( $html ) ; + $mpdf->Output( $filename_save, 'F' ) ; + + + $row['id'] = dataFilter( $row['announcement_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = $content ; + $row['file'] = $file ; + $row['created_at'] = dataFilter( $row['created_at'] ) ; + $row['is_agreed'] = $is_agreed ; + $row['source'] = $filename_source ; + + $data['list'] = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/announcements/lists.php b/apiv3/services/announcements/lists.php new file mode 100644 index 0000000..e025a2a --- /dev/null +++ b/apiv3/services/announcements/lists.php @@ -0,0 +1,38 @@ +query( $query . " ORDER BY a.created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['announcement_id'] ) ; + $row['title'] = ( $row['is_hide'] == 'no' ? dataFilter( $row['title'] ) : '' ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Announcement/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/associations/categories.php b/apiv3/services/associations/categories.php new file mode 100644 index 0000000..1f3ee6c --- /dev/null +++ b/apiv3/services/associations/categories.php @@ -0,0 +1,42 @@ +query( $query . " ".$query_sortable." LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['category_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/AssociationCategory/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/associations/confirm.php b/apiv3/services/associations/confirm.php new file mode 100644 index 0000000..7fc38e4 --- /dev/null +++ b/apiv3/services/associations/confirm.php @@ -0,0 +1,46 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '248' ; + + $row = $mysqli_query->fetch_assoc() ; + + $is_association = 'no' ; + if ( $row['status'] == 'active' ){ + if ( $row['association_type'] == 'all' || ( $row['association_type'] == 'date' && $row['date_start'] <= TODAYDAY && $row['date_end'] >= TODAYDAY ) ){ + $is_association = 'yes' ; + } + } + + if ( $is_association == 'yes' ){ + $status = '200' ; + + $mysqli->query( "INSERT INTO staff_association + ( association_id, branch_id, staff_id, status ) VALUES + ( '".$array['id']."', '".$array['branch_id']."', '".$staff_info['staff_id']."', 'pending' ) " ) ; + + $view_id = $mysqli->insert_id ; + $association_so = 'AS'.strPad( 6, $view_id ) ; + + $mysqli->query( "UPDATE staff_association SET association_so = '".$association_so."' WHERE view_id = '".$view_id."'" ) ; + + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/associations/details.php b/apiv3/services/associations/details.php new file mode 100644 index 0000000..65aeea5 --- /dev/null +++ b/apiv3/services/associations/details.php @@ -0,0 +1,60 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + $generatecode = generateQrcode( '', $row['association_so'], $row['association_so'] ) ; + + $row = $mysqli_query->fetch_assoc() ; + $row['id'] = dataFilter( $row['association_id'] ) ; + $row['sonumber'] = dataFilter( $row['association_so'] ) ; + $row['qrcode'] = $generatecode['url'] ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Association/b/'.$row['file'] : '' ) ; + + $is_association = 'no' ; + if ( $row['status'] == 'active' ){ + if ( $row['association_type'] == 'all' || ( $row['association_type'] == 'date' && $row['date_start'] <= TODAYDAY && $row['date_end'] >= TODAYDAY ) ){ + $is_association = 'yes' ; + } + } + $row['is_association'] = $is_association ; + $row['date_start'] = resetDateFormat( $row['date_start'] ) ; + $row['date_end'] = resetDateFormat( $row['date_end'] ) ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $row['association_status'] = ( checkExists( $row['association_status'] ) != '' ? $row['association_status'] : '') ; + $row['association_remark'] = dataFilter( checkExists( $row['association_remark'] ) != '' ? $row['association_remark'] : '') ; + $row['association_rated'] = dataFilter( checkExists( $row['association_rated'] ) != '' ? $row['association_rated'] : 0) ; + $row['association_comment'] = dataFilter( checkExists( $row['association_comment'] ) != '' ? $row['association_comment'] : '') ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/associations/gallery-category.php b/apiv3/services/associations/gallery-category.php new file mode 100644 index 0000000..94c42b7 --- /dev/null +++ b/apiv3/services/associations/gallery-category.php @@ -0,0 +1,35 @@ +query( $query . " ORDER BY a.sortable" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['category_id'] = dataFilter( $row['category_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/associations/gallery-list.php b/apiv3/services/associations/gallery-list.php new file mode 100644 index 0000000..3700010 --- /dev/null +++ b/apiv3/services/associations/gallery-list.php @@ -0,0 +1,46 @@ +query( $query . " ".$query_sortable." LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['date'] = resetDateFormat( $row['created_at'] ) ; + $row['time'] = resetTimeFormat( $row['created_at'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/AssociationGallery/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/associations/gallery-upload.php b/apiv3/services/associations/gallery-upload.php new file mode 100644 index 0000000..a5d5332 --- /dev/null +++ b/apiv3/services/associations/gallery-upload.php @@ -0,0 +1,35 @@ + 0 ){ + if ( checkExists($photos) ){ + foreach ( $photos as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'AssociationGallery', time(), $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $mysqli->query( "INSERT INTO association_gallery + ( branch_id, staff_id, title, file, filetype ) VALUES + ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$title."', '".$upload['data']['file_name']."', '".$upload['data']['file_type']."' )" ) ; + $status = '200' ; + } + } + } + } + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/associations/is-going.php b/apiv3/services/associations/is-going.php new file mode 100644 index 0000000..707b8bc --- /dev/null +++ b/apiv3/services/associations/is-going.php @@ -0,0 +1,40 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + + $mysqli->query( "UPDATE staff_association SET + is_going = '".$array['is_going']."', + status = '".$update_status."' + WHERE view_id = '".$array['view_id']."'" ) ; + + } + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/associations/lists.php b/apiv3/services/associations/lists.php new file mode 100644 index 0000000..cd260e7 --- /dev/null +++ b/apiv3/services/associations/lists.php @@ -0,0 +1,70 @@ += '".TODAYDAY."' ) )" ; + break ; + case 'previous' : + $join_filter = ", c.view_id, c.status as association_status" ; + $join_query = "LEFT JOIN staff_association c ON ( a.association_id = c.association_id )" ; + $search_query .= " AND c.branch_id = '".$array['branch_id']."' AND c.staff_id = '".$staff_info['staff_id']."'" ; + $query_sortable = "ORDER BY view_id DESC" ; + break ; + case 'expired' : + $search_query .= " AND a.branch LIKE '%/".$array['branch_id']."/%' AND ( a.status = 'inactive' OR ( a.association_type = 'date' AND a.date_start <= '".TODAYDAY."' AND NOT ( a.date_end >= '".TODAYDAY."' ) ) )" ; + break ; + } + } + + $query = "SELECT a.association_id, a.association_type, a.date_start, a.date_end, a.file, a.created_at, b.title ".$join_filter." FROM association a + LEFT JOIN association_translation b ON ( a.association_id = b.association_id ) + ".$join_query." + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ".$query_sortable." LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['association_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['date_start'] = resetDateFormat( $row['date_start'] ) ; + $row['date_end'] = resetDateFormat( $row['date_end'] ) ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $row['association_status'] = ( checkExists( $row['association_status'] ) != '' ? $row['association_status'] : '' ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Association/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/associations/rating.php b/apiv3/services/associations/rating.php new file mode 100644 index 0000000..536f80d --- /dev/null +++ b/apiv3/services/associations/rating.php @@ -0,0 +1,38 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + + $mysqli->query( "UPDATE staff_association SET + rated = '".$array['association_rated']."', + comment = '".$array['association_comment']."', + status = 'rated' + WHERE view_id = '".$array['view_id']."'" ) ; + + } + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/catalogs/details.php b/apiv3/services/catalogs/details.php new file mode 100644 index 0000000..982089d --- /dev/null +++ b/apiv3/services/catalogs/details.php @@ -0,0 +1,42 @@ +query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + $row = $mysqli_query->fetch_assoc() ; + + $file = '' ; + if ( $row['file'] != '' ){ + if ( $row['file_type'] == 'pdf' ){ + $file = PATH.'uploads/Catalog/'.$row['file'] ; + }else{ + $file = PATH.'uploads/Catalog/b/'.$row['file'] ; + } + } + + $row['id'] = dataFilter( $row['catalog_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['file'] = $file ; + $row['created_at'] = dataFilter( $row['created_at'] ) ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/catalogs/lists.php b/apiv3/services/catalogs/lists.php new file mode 100644 index 0000000..db7debf --- /dev/null +++ b/apiv3/services/catalogs/lists.php @@ -0,0 +1,41 @@ +query( $query . " ORDER BY sortable ASC, created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['catalog_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Catalog/b/'.$row['file'] : '' ) ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/catalogs/main-category.php b/apiv3/services/catalogs/main-category.php new file mode 100644 index 0000000..ea7dc1d --- /dev/null +++ b/apiv3/services/catalogs/main-category.php @@ -0,0 +1,37 @@ +query( $query . " ORDER BY sortable ASC, created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['category_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/CatalogCategory/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/catalogs/sub-category.php b/apiv3/services/catalogs/sub-category.php new file mode 100644 index 0000000..bff1685 --- /dev/null +++ b/apiv3/services/catalogs/sub-category.php @@ -0,0 +1,37 @@ +query( $query . " ORDER BY sortable ASC, created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['category_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/CatalogCategory/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formheadcounts/lists.php b/apiv3/services/formheadcounts/lists.php new file mode 100644 index 0000000..77b2185 --- /dev/null +++ b/apiv3/services/formheadcounts/lists.php @@ -0,0 +1,83 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = $row['department_desc'] ; + } + } + + $search_query = '' ; + if ( $array['search'] != '' ){ + $search_query .= " AND title LIKE '%".$array['search']."%'" ; + } + + $query = "SELECT formheadcount_id, staff_id, title, content, status, created_at FROM formheadcount + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $staff_list = [] ; + $formheadcount_id = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['formheadcount_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['departments'] = '' ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $row ; + + $staff_list[$row['staff_id']] = $row['staff_id'] ; + $formheadcount_id[$row['formheadcount_id']] = $row['formheadcount_id'] ; + } + + // select related formheadcount media + $media_list = [] ; + $select_media = $mysqli->query( "SELECT formheadcount_id, file FROM formheadcount_media a + WHERE a.deleted_at IS NULL AND formheadcount_id IN ( ".implode( ',', $formheadcount_id )." ) AND filetype IN ( 'jpg', 'png', 'gif' )" ) ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + $media_list[$row_media['formheadcount_id']][] = ( $row_media['file'] != '' ? PATH.'uploads/FormHeadCount/b/'.$row_media['file'] : '' ) ; + } + } + + // select all staff related deparment + $related_list = [] ; + $select_related = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department a + WHERE a.deleted_at IS NULL AND a.staff_id IN ( ".implode( ',', $staff_list )." )" ) ; + if ( $select_related->num_rows > 0 ){ + while ( $row_related = $select_related->fetch_assoc() ){ + if ( checkExists( $department_list[$row_related['department_id']] ) ){ + $related_list[$row_related['staff_id']][] = $department_list[$row_related['department_id']] ; + } + } + } + + foreach ( $list as $k => $v ){ + $list[$k]['departments'] = ( checkExists( $related_list[$v['staff_id']] ) ? implode( ', ', $related_list[$v['staff_id']] ) : '' ) ; + $list[$k]['files'] = ( checkExists( $media_list[$v['formheadcount_id']] ) ? $media_list[$v['formheadcount_id']] : [] ) ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formheadcounts/select.php b/apiv3/services/formheadcounts/select.php new file mode 100644 index 0000000..e555dda --- /dev/null +++ b/apiv3/services/formheadcounts/select.php @@ -0,0 +1,68 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $row = $mysqli_query->fetch_assoc() ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['remark'] = dataFilter( $row['remark'] ) ; + $row['comment'] = dataFilter( $row['comment'] ) ; + + // get all media + $select_media = $mysqli->query( "SELECT media_id, file, filetype FROM formheadcount_media + WHERE deleted_at IS NULL AND formheadcount_id = '".$array['formheadcount_id']."'" ) ; + $photos = [] ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + + switch ( $row_media['filetype'] ){ + case 'jpg' : + case 'jpeg' : + case 'png' : + $photos[] = [ + 'media_id' => $row_media['media_id'], + 'type' => 'online', + 'filetype' => $row_media['filetype'], + 'file' => ( $row_media['file'] != '' ? PATH.'uploads/FormHeadCount/b/'.$row_media['file'] : '' ) + ] ; + break ; + default : + $photos[] = [ + 'media_id' => $row_media['media_id'], + 'type' => 'online', + 'filetype' => $row_media['filetype'], + 'file' => ( $row_media['file'] != '' ? PATH.'uploads/FormHeadCount/'.$row_media['file'] : '' ) + ] ; + } + + + + } + } + + $row['photos'] = $photos ; + + $data = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formheadcounts/update.php b/apiv3/services/formheadcounts/update.php new file mode 100644 index 0000000..9804ca5 --- /dev/null +++ b/apiv3/services/formheadcounts/update.php @@ -0,0 +1,50 @@ + 0 ){ + $status = '203' ; + + if ( $mysqli->query( "INSERT INTO formheadcount + ( `branch_id`, `staff_id`, `title`, `content`, `remark`, `status` ) VALUES + ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$array['title']."', '".$array['content']."', '".$array['remark']."', 'pending' )" ) ){ + $status = '200' ; + + $boolean_submit = true ; + $formheadcount_id = $mysqli->insert_id ; + + $formheadcount_so = 'FH'.strPad( 6, $formheadcount_id ) ; + $mysqli->query( "UPDATE formheadcount SET + formheadcount_so = '".$formheadcount_so."' + WHERE formheadcount_id = '".$formheadcount_id."'" ) ; + + if ( checkExists($photos) ){ + foreach ( $photos as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'FormHeadCount', $formheadcount_id.'-'.$formheadcount_id, $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $mysqli->query( "INSERT INTO formheadcount_media + ( formheadcount_id, file, filetype ) VALUES + ( '".$formheadcount_id."', '".$upload['data']['file_name']."', '".$upload['data']['file_type']."' )" ) ; + $status = '200' ; + } + } + } + } + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formnominations/componentsv2.php b/apiv3/services/formnominations/componentsv2.php new file mode 100644 index 0000000..e372a6a --- /dev/null +++ b/apiv3/services/formnominations/componentsv2.php @@ -0,0 +1,78 @@ +query( "SELECT a.staff_id, a.staff_idno, a.staff_name, a.staff_shortname, a.staff_tier FROM staff a + WHERE a.deleted_at IS NULL AND a.branch_id = '".$array['branch_id']."' AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL ) " ) ; + + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $get_staff_tier = $all_tier[$row['staff_tier']] ; + + $staffs[] = [ + 'id' => $row['staff_id'], + 'title' => $row['staff_shortname'] . ' ('.$row['staff_idno'].' / '.strtoupper( $get_staff_tier['title'] ).')', + 'name' => $row['staff_name'], + 'tier' => $get_staff_tier['level'] + ] ; + } + } + + + $where_question = '' ; + if ( $array['submission_type'] != '' ){ + $where_question .= " AND a.nomination_type = '".$array['submission_type']."'" ; + } + + // question & form + $select_question = $mysqli->query( "SELECT a.question_id, a.question_type, b.title, b.content, b.questions FROM formnomination_question a + LEFT JOIN formnomination_question_translation b ON ( a.question_id = b.question_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' ".$where_question." ORDER BY a.sortable" ) ; + if ( $select_question->num_rows > 0 ){ + while ( $row_question = $select_question->fetch_assoc() ){ + + if ( $row_question['question_type'] == 'question' ){ + $temp = $row_question ; + $temp['title'] = dataFilter( $temp['title'] ) ; + $temp['content'] = dataFilter( $temp['content'] ) ; + $temp['questions'] = ( $temp['questions'] != '' ? explode( '|', $temp['questions'] ) : [] ) ; + + $question_list[] = $temp ; + } + if ( $row_question['question_type'] == 'form' ){ + $temp = $row_question ; + $temp['title'] = dataFilter( $temp['title'] ) ; + $temp['content'] = dataFilter( $temp['content'] ) ; + $temp['questions'] = ( $temp['questions'] != '' ? explode( '|', $temp['questions'] ) : [] ) ; + + $form_list[] = $temp ; + } + + } + } + + + $data = [ + 'staffs' => $staffs, + 'questions' => $question_list, + 'forms' => $form_list + ] ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formnominations/lists.php b/apiv3/services/formnominations/lists.php new file mode 100644 index 0000000..7c3872f --- /dev/null +++ b/apiv3/services/formnominations/lists.php @@ -0,0 +1,89 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = $row['department_desc'] ; + } + } + + $search_query = '' ; + if ( $array['search'] != '' ){ + $search_query .= " AND b.staff_name LIKE '%".$array['search']."%'" ; + } + if ( $array['submission_type'] != '' ){ + $search_query .= " AND a.formnomination_type = '".$array['submission_type']."'" ; + } + + + $query = "SELECT a.formnomination_id, a.staff_id, a.nominee_staff_id, a.status, a.created_at FROM formnomination a + WHERE a.deleted_at IS NULL AND a.branch_id = '".$array['branch_id']."' AND a.staff_id = '".$staff_info['staff_id']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ORDER BY a.created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $nominee_staff_list = [] ; + $formnomination_id = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['formnomination_id'] ) ; + $row['nominee_name'] = '' ; + $row['nominee_departments'] = '' ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $row ; + + $nominee_staff_list[$row['nominee_staff_id']] = $row['nominee_staff_id'] ; + } + + // select all staff + $related_staff_list = [] ; + $select_related_staff = $mysqli->query( "SELECT a.staff_id, a.staff_name FROM staff a + WHERE a.deleted_at IS NULL AND a.staff_id IN ( ".implode( ',', $nominee_staff_list )." )" ) ; + if ( $select_related_staff->num_rows > 0 ){ + while ( $row_related_staff = $select_related_staff->fetch_assoc() ){ + $related_staff_list[$row_related_staff['staff_id']] = [ + 'staff_name' => $row_related_staff['staff_name'] + ] ; + } + } + + // select all staff related deparment + $related_list = [] ; + $select_related = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department a + WHERE a.deleted_at IS NULL AND a.staff_id IN ( ".implode( ',', $nominee_staff_list )." )" ) ; + if ( $select_related->num_rows > 0 ){ + while ( $row_related = $select_related->fetch_assoc() ){ + if ( checkExists( $department_list[$row_related['department_id']] ) ){ + $related_list[$row_related['staff_id']][] = $department_list[$row_related['department_id']] ; + } + } + } + + foreach ( $list as $k => $v ){ + $selected_staff = ( checkExists( $related_staff_list[$v['nominee_staff_id']] ) ? $related_staff_list[$v['nominee_staff_id']] : [] ) ; + + $list[$k]['nominee_name'] = ( checkExists( $selected_staff['staff_name'] ) ? checkExists( $selected_staff['staff_name'] ) : 'Unknown' ) ; + $list[$k]['nominee_departments'] = ( checkExists( $related_list[$v['nominee_staff_id']] ) ? implode( ', ', $related_list[$v['nominee_staff_id']] ) : '' ) ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formnominations/select.php b/apiv3/services/formnominations/select.php new file mode 100644 index 0000000..7b809e8 --- /dev/null +++ b/apiv3/services/formnominations/select.php @@ -0,0 +1,65 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $row = $mysqli_query->fetch_assoc() ; + $row['comment'] = dataFilter( $row['comment'] ) ; + + + // select all staff + $nominee_to_name = '' ; + $select_related_staff = $mysqli->query( "SELECT a.staff_id, a.staff_name FROM staff a + WHERE a.deleted_at IS NULL AND a.staff_id = '".$row['nominee_staff_id']."' LIMIT 1" ) ; + if ( $select_related_staff->num_rows > 0 ){ + $row_related_staff = $select_related_staff->fetch_assoc() ; + $nominee_to_name = $row_related_staff['staff_name'] ; + } + $row['nominee_to_name'] = $nominee_to_name ; + + + // select all answer + $question_list = [] ; + $form_list = [] ; + $select_answer = $mysqli->query( "SELECT a.question_type, a.checkbox, a.chosen, a.remark, c.title, c.content FROM formnomination_answer a + LEFT JOIN formnomination_question b ON ( a.question_id = b.question_id ) + LEFT JOIN formnomination_question_translation c ON ( b.question_id = c.question_id ) + WHERE a.formnomination_id = '".$row['formnomination_id']."' AND c.lang = '".$array['lang']."' ORDER BY b.sortable" ) ; + + if ( $select_answer->num_rows > 0 ){ + while ( $row_answer = $select_answer->fetch_assoc() ){ + if ( $row_answer['question_type'] == 'question' ){ + $question_list[] = $row_answer ; + } + if ( $row_answer['question_type'] == 'form' ){ + $form_list[] = $row_answer ; + } + } + } + $row['questions'] = $question_list ; + $row['forms'] = $form_list ; + + $data = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formnominations/update-form.php b/apiv3/services/formnominations/update-form.php new file mode 100644 index 0000000..f687959 --- /dev/null +++ b/apiv3/services/formnominations/update-form.php @@ -0,0 +1,85 @@ + 0 ){ + $status = '201' ; + + $where_question = '' ; + if ( $array['submission_type'] != '' ){ + $where_question .= " AND a.nomination_type = '".$array['submission_type']."'" ; + } + + $select_formnomination = $mysqli->query( "SELECT * FROM formnomination + WHERE deleted_at IS NULL AND formnomination_id = '".$formnomination_id."' AND status = 'pending' LIMIT 1" ) ; + if ( $select_formnomination->num_rows > 0 ){ + $status = '314' ; + + $row_formnomination = $select_formnomination->fetch_assoc() ; + + $form_list = [] ; + $select_form = $mysqli->query( "SELECT a.question_id FROM formnomination_question a + WHERE a.deleted_at IS NULL AND a.question_type = 'form'" . $where_question ) ; + + $total_form = $select_form->num_rows ; + + $total_remark = 0 ; + foreach ( $forms as $kform => $vform ){ + if ( $vform['remark'] != '' ){ + $total_remark++ ; + } + } + + if ( count($forms) == $total_form && $total_form == $total_remark ){ + $status = '200' ; + + $mysqli->query( "UPDATE formnomination SET + nominee_staff_id = '".$nominee_to."', + status = 'approved' + WHERE formnomination_id = '".$formnomination_id."'" ) ; + + foreach ( $forms as $kform => $vform ){ + $mysqli->query( "INSERT INTO formnomination_answer + ( formnomination_id, question_id, question_type, checkbox, chosen, remark ) VALUES + ( '".$formnomination_id."', '".$vform['id']."', 'form', '".$vform['checkbox']."', '".$vform['radio']."', '".$vform['remark']."' )" ) ; + } + + $mailer = new Mailer() ; + $mailer->from = EMAILNOREPLY ; + $select_staff = $mysqli->query( "SELECT a.staff_id, a.staff_name, a.staff_email FROM staff a + WHERE a.deleted_at IS NULL AND a.branch_id = '".$array['branch_id']."' AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL ) AND a.staff_settings LIKE '%\"ishrmanager\":\"yes\"%'" ) ; + + if ( $select_staff->num_rows > 0 ){ + while ( $row_staff = $select_staff->fetch_assoc() ){ + pushToUserCron( 'formnomination', $array['formnomination_id'], $row_staff['staff_id'], 'Nomination', 'Nomination '.$row_formnomination['formnomination_so'].' need you to review' ) ; + + if ( $row_staff['staff_email'] != '' ){ + $mailer->to = [ $row_staff['staff_email'] ] ; + // $mailer->cc = $EMAILCC ; + $mailer->subject = 'Reminder for Nomination' ; + $mailer->body = 'Dear HR Manager, '.dataFilter($staff_info['staff_name']).' has submitted an nomination request. Please log in to review. +

+ * This is an auto-generated message, please do not reply.' ; + $mailer->send() ; + } + } + } + + } + + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formnominations/update-question.php b/apiv3/services/formnominations/update-question.php new file mode 100644 index 0000000..9f255ed --- /dev/null +++ b/apiv3/services/formnominations/update-question.php @@ -0,0 +1,81 @@ + 0 ){ + $status = '314' ; + + $where_question = '' ; + if ( $array['submission_type'] != '' ){ + $where_question .= " AND a.nomination_type = '".$array['submission_type']."'" ; + } + + $question_list = [] ; + $select_question = $mysqli->query( "SELECT a.question_id FROM formnomination_question a + WHERE a.deleted_at IS NULL AND a.question_type = 'question'" . $where_question ) ; + $total_question = $select_question->num_rows ; + + $point_peryes = ( 100 / $total_question ) ; + $point_questionyes = 0 ; + $total_yesno = 0 ; + foreach ( $questions as $kquestion => $vquestion ){ + if ( $vquestion['checkbox'] == 'yes' ){ + $point_questionyes += $point_peryes ; + } + + if ( $vquestion['checkbox'] != '' ){ + $total_yesno++ ; + } + } + + if ( count($questions) == $total_question && $total_yesno == $total_question ){ + $status = '99' ; + + $update_status = 'cancelled' ; + if ( $point_questionyes >= NOMINATIONPOINT ){ + $status = '98' ; + + $update_status = 'pending' ; + } + + if ( $mysqli->query( "INSERT INTO formnomination + ( `formnomination_type`, `branch_id`, `staff_id`, `status` ) VALUES + ( '".$array['submission_type']."', '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$update_status."' )" ) ){ + + $boolean_submit = true ; + $formnomination_id = $mysqli->insert_id ; + + $formnomination_so = 'FN'.strPad( 6, $formnomination_id ) ; + $mysqli->query( "UPDATE formnomination SET + formnomination_so = '".$formnomination_so."' + WHERE formnomination_id = '".$formnomination_id."'" ) ; + + foreach ( $questions as $kquestion => $vquestion ){ + $mysqli->query( "INSERT INTO formnomination_answer + ( formnomination_id, question_id, question_type, checkbox, chosen, remark ) VALUES + ( '".$formnomination_id."', '".$vquestion['id']."', 'question', '".$vquestion['checkbox']."', '".$vquestion['radio']."', '".$vquestion['remark']."' )" ) ; + } + + $data = [ + 'formnomination_id' => $formnomination_id, + 'update_status' => $update_status + ] ; + + }else{ + $status = '203' ; + } + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formresignations/components.php b/apiv3/services/formresignations/components.php new file mode 100644 index 0000000..a66112e --- /dev/null +++ b/apiv3/services/formresignations/components.php @@ -0,0 +1,36 @@ +query( "SELECT a.staff_id, a.staff_idno, a.staff_name, a.staff_shortname, a.staff_tier FROM staff a + WHERE a.deleted_at IS NULL AND a.branch_id = '".$array['branch_id']."' AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL ) AND a.staff_settings LIKE '%\"ismanager\":\"yes\"%'" ) ; + + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $get_staff_tier = $all_tier[$row['staff_tier']] ; + + $staffs[] = [ + 'id' => $row['staff_id'], + 'title' => dataFilter( $row['staff_shortname'] ) . ' ('.$row['staff_idno'].' / '.strtoupper( $get_staff_tier['title'] ).')', + 'name' => dataFilter( $row['staff_name'] ), + 'tier' => $get_staff_tier['level'] + ] ; + } + } + + $data = [ + 'staffs' => $staffs + ] ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formresignations/lists.php b/apiv3/services/formresignations/lists.php new file mode 100644 index 0000000..4eb5d85 --- /dev/null +++ b/apiv3/services/formresignations/lists.php @@ -0,0 +1,84 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = $row['department_desc'] ; + } + } + + + $search_query = '' ; + if ( $array['search'] != '' ){ + $search_query .= " AND title LIKE '%".$array['search']."%'" ; + } + + $query = "SELECT formresignation_id, staff_id, title, content, status_manager, status_hr, created_at FROM formresignation + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $staff_list = [] ; + $formresignation_id = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['formresignation_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['departments'] = '' ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $row ; + + $staff_list[$row['staff_id']] = $row['staff_id'] ; + $formresignation_id[$row['formresignation_id']] = $row['formresignation_id'] ; + } + + // select related formresignation media + $media_list = [] ; + $select_media = $mysqli->query( "SELECT formresignation_id, file FROM formresignation_media a + WHERE a.deleted_at IS NULL AND formresignation_id IN ( ".implode( ',', $formresignation_id )." ) AND filetype IN ( 'jpg', 'png', 'gif' )" ) ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + $media_list[$row_media['formresignation_id']][] = ( $row_media['file'] != '' ? PATH.'uploads/FormResignation/b/'.$row_media['file'] : '' ) ; + } + } + + // select all staff related deparment + $related_list = [] ; + $select_related = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department a + WHERE a.deleted_at IS NULL AND a.staff_id IN ( ".implode( ',', $staff_list )." )" ) ; + if ( $select_related->num_rows > 0 ){ + while ( $row_related = $select_related->fetch_assoc() ){ + if ( checkExists( $department_list[$row_related['department_id']] ) ){ + $related_list[$row_related['staff_id']][] = $department_list[$row_related['department_id']] ; + } + } + } + + foreach ( $list as $k => $v ){ + $list[$k]['departments'] = ( checkExists( $related_list[$v['staff_id']] ) ? implode( ', ', $related_list[$v['staff_id']] ) : '' ) ; + $list[$k]['files'] = ( checkExists( $media_list[$v['formresignation_id']] ) ? $media_list[$v['formresignation_id']] : [] ) ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formresignations/select.php b/apiv3/services/formresignations/select.php new file mode 100644 index 0000000..e160731 --- /dev/null +++ b/apiv3/services/formresignations/select.php @@ -0,0 +1,113 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $row = $mysqli_query->fetch_assoc() ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + + $manager_name = '' ; + $hr_name = '' ; + + // select manager / hr manager + $staff_ids = [ $row['staff_id_manager'] ] ; + if ( $row['staff_id_hr'] > 0 ){ + $staff_ids[] = $row['staff_id_hr'] ; + } + $select_staff = $mysqli->query( "SELECT staff_id, staff_idno, staff_name, staff_shortname, staff_tier FROM staff + WHERE staff_id IN ( ".implode(',', $staff_ids)." ) LIMIT 2" ) ; + if ( $select_staff->num_rows > 0 ){ + while ( $row_staff = $select_staff->fetch_assoc() ){ + $get_staff_tier = $all_tier[$row_staff['staff_tier']] ; + + if ( $row_staff['staff_id'] == $row['staff_id_manager'] ){ + $manager_name = dataFilter( $row_staff['staff_shortname'] ) . ' ('.$row_staff['staff_idno'].' / '.strtoupper( $get_staff_tier['title'] ).')' ; + } + if ( $row_staff['staff_id'] == $row['staff_id_hr'] ){ + $hr_name = dataFilter( $row_staff['staff_shortname'] ) . ' ('.$row_staff['staff_idno'].' / '.strtoupper( $get_staff_tier['title'] ).')' ; + } + } + } + + $is_manager_update = 'no' ; + if ( $staff_settings['ismanager'] == 'yes' ){ + if ( $row['status_manager'] == 'pending' && $row['status_hr'] == 'pending' ){ + if ( $staff_info['staff_id'] == $row['staff_id_manager'] ){ + $is_manager_update = 'yes' ; + } + } + } + $row['is_manager_update'] = $is_manager_update ; + $row['manager_name'] = $manager_name ; + $row['comment_manager'] = ( $row['comment_manager'] != '' ? '
'.dataFilter( $row['comment_manager'] ).'
': '' ) ; + + $is_hr_update = 'no' ; + if ( $staff_settings['ishrmanager'] == 'yes' ){ + if ( $row['status_manager'] == 'confirmed' && $row['status_hr'] == 'pending' ){ + $is_hr_update = 'yes' ; + } + } + $row['is_hr_update'] = $is_hr_update ; + $row['hr_name'] = $hr_name ; + $row['comment_hr'] = ( $row['comment_hr'] != '' ? '
'.dataFilter( $row['comment_hr'] ).'
': '' ) ; + + // get all media + $select_media = $mysqli->query( "SELECT media_id, file, filetype FROM formresignation_media + WHERE deleted_at IS NULL AND formresignation_id = '".$array['formresignation_id']."'" ) ; + $photos = [] ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + + switch ( $row_media['filetype'] ){ + case 'jpg' : + case 'jpeg' : + case 'png' : + $photos[] = [ + 'media_id' => $row_media['media_id'], + 'type' => 'online', + 'filetype' => $row_media['filetype'], + 'file' => ( $row_media['file'] != '' ? PATH.'uploads/FormResignation/b/'.$row_media['file'] : '' ) + ] ; + break ; + default : + $photos[] = [ + 'media_id' => $row_media['media_id'], + 'type' => 'online', + 'filetype' => $row_media['filetype'], + 'file' => ( $row_media['file'] != '' ? PATH.'uploads/FormResignation/'.$row_media['file'] : '' ) + ] ; + } + + + + } + } + + $row['photos'] = $photos ; + + $data = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formresignations/status-hr.php b/apiv3/services/formresignations/status-hr.php new file mode 100644 index 0000000..d695b90 --- /dev/null +++ b/apiv3/services/formresignations/status-hr.php @@ -0,0 +1,53 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $row = $mysqli_query->fetch_assoc() ; + + $status = '308' ; + + $update_status = ( $array['update_status'] == 'confirmed' ? 'confirmed' : 'rejected' ) ; + + if ( $update_status != '' ){ + $status = '200' ; + + $mysqli->query( "UPDATE formresignation SET + staff_id_hr = '".$staff_info['staff_id']."', + status_hr = '".$update_status."', + comment_hr = '".$array['comment_hr']."', + date_hr = '".TODAYDATE."' + WHERE formresignation_id = '".$array['formresignation_id']."'" ) ; + + if ( $update_status == 'confirmed' ){ + pushToUserCron( 'formresignation', $array['formresignation_id'], $row['staff_id'], 'Resignation', 'Resignation is confirmed by your HR Manager' ) ; + }else{ + pushToUserCron( 'formresignation', $array['formresignation_id'], $row['staff_id'], 'Resignation', 'Resignation is rejected by your HR Manager' ) ; + } + + } + + } + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formresignations/status-manager.php b/apiv3/services/formresignations/status-manager.php new file mode 100644 index 0000000..fce7b1e --- /dev/null +++ b/apiv3/services/formresignations/status-manager.php @@ -0,0 +1,76 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $row = $mysqli_query->fetch_assoc() ; + + $status = '308' ; + + $update_status = ( $array['update_status'] == 'confirmed' ? 'confirmed' : 'rejected' ) ; + + if ( $update_status != '' ){ + $status = '200' ; + + $mysqli->query( "UPDATE formresignation SET + status_manager = '".$update_status."', + comment_manager = '".$array['comment_manager']."', + date_manager = '".TODAYDATE."' + WHERE formresignation_id = '".$array['formresignation_id']."'" ) ; + + + // push notification to hr manager + $mailer = new Mailer() ; + $mailer->from = EMAILNOREPLY ; + if ( $update_status == 'confirmed' ){ + + $select_staff = $mysqli->query( "SELECT a.staff_id, a.staff_name, a.staff_email FROM staff a + WHERE a.deleted_at IS NULL AND a.branch_id = '".$array['branch_id']."' AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL ) AND a.staff_settings LIKE '%\"ishrmanager\":\"yes\"%'" ) ; + + if ( $select_staff->num_rows > 0 ){ + while ( $row_staff = $select_staff->fetch_assoc() ){ + pushToUserCron( 'formresignation', $array['formresignation_id'], $row_staff['staff_id'], 'Resignation', 'Resignation '.$row['formresignation_so'].' need your approval or rejection' ) ; + + if ( $row_staff['staff_email'] != '' ){ + $mailer->to = [ $row_staff['staff_email'] ] ; + $mailer->cc = $EMAILCC ; + $mailer->subject = 'Reminder for Resignation' ; + $mailer->body = 'Dear HR Manager, '.dataFilter($staff_info['staff_name']).' has submitted an resignation request. Please log in to review. +

+ * This is an auto-generated message, please do not reply.' ; + $mailer->send() ; + } + } + } + + pushToUserCron( 'formresignation', $array['formresignation_id'], $row['staff_id'], 'Resignation', 'Resignation is confirmed by your Manager, we will send to HR Manager to do approval and rejection' ) ; + }else{ + pushToUserCron( 'formresignation', $array['formresignation_id'], $row['staff_id'], 'Resignation', 'Resignation is rejected by your Manager' ) ; + } + } + + } + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formresignations/update.php b/apiv3/services/formresignations/update.php new file mode 100644 index 0000000..7e0d8d8 --- /dev/null +++ b/apiv3/services/formresignations/update.php @@ -0,0 +1,53 @@ + 0 && $array['title'] != '' && $array['content'] != '' && $array['photos'] != '' && count( $photos ) > 0 ){ + $status = '203' ; + + if ( $mysqli->query( "INSERT INTO formresignation + ( `branch_id`, `staff_id`, `staff_id_manager`, `title`, `content`, `status_manager`, `status_hr` ) VALUES + ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$array['staff_id_manager']."', '".$array['title']."', '".$array['content']."', 'pending', 'pending' )" ) ){ + $status = '200' ; + + $boolean_submit = true ; + $formresignation_id = $mysqli->insert_id ; + + $formresignation_so = 'FR'.strPad( 6, $formresignation_id ) ; + $mysqli->query( "UPDATE formresignation SET + formresignation_so = '".$formresignation_so."' + WHERE formresignation_id = '".$formresignation_id."'" ) ; + + if ( checkExists($photos) ){ + foreach ( $photos as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'FormResignation', $formresignation_id.'-'.$formresignation_id, $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $mysqli->query( "INSERT INTO formresignation_media + ( formresignation_id, file, filetype ) VALUES + ( '".$formresignation_id."', '".$upload['data']['file_name']."', '".$upload['data']['file_type']."' )" ) ; + $status = '200' ; + } + } + } + } + + pushToUserCron( 'formresignation', $formresignation_id, $array['staff_id_manager'], 'Resignation', 'Resignation '.$formresignation_so.' need your approval or rejection' ) ; + + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/forms/details.php b/apiv3/services/forms/details.php new file mode 100644 index 0000000..5ba2b62 --- /dev/null +++ b/apiv3/services/forms/details.php @@ -0,0 +1,42 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + $row = $mysqli_query->fetch_assoc() ; + + $file = '' ; + if ( $row['file'] != '' ){ + if ( $row['file_type'] == 'pdf' || $row['file_type'] == 'xls' || $row['file_type'] == 'xlsx' || $row['file_type'] == 'doc' || $row['file_type'] == 'docx' ){ + $file = PATH.'uploads/Form/'.$row['file'] ; + }else{ + $file = PATH.'uploads/Form/b/'.$row['file'] ; + } + } + + $row['id'] = dataFilter( $row['form_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['file'] = $file ; + $row['created_at'] = dataFilter( $row['created_at'] ) ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/forms/lists.php b/apiv3/services/forms/lists.php new file mode 100644 index 0000000..ee78d46 --- /dev/null +++ b/apiv3/services/forms/lists.php @@ -0,0 +1,41 @@ +query( $query . " ORDER BY a.sortable ASC, a.created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['form_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/forms/main-category.php b/apiv3/services/forms/main-category.php new file mode 100644 index 0000000..e931da5 --- /dev/null +++ b/apiv3/services/forms/main-category.php @@ -0,0 +1,38 @@ +query( $query . " ORDER BY a.sortable ASC, a.created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['category_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/FormCategory/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/forms/sub-category.php b/apiv3/services/forms/sub-category.php new file mode 100644 index 0000000..f07f134 --- /dev/null +++ b/apiv3/services/forms/sub-category.php @@ -0,0 +1,38 @@ +query( $query . " ORDER BY a.sortable ASC, a.created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['category_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/FormCategory/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/formsubmissions/lists.php b/apiv3/services/formsubmissions/lists.php new file mode 100644 index 0000000..ddefdc1 --- /dev/null +++ b/apiv3/services/formsubmissions/lists.php @@ -0,0 +1,40 @@ +query( $query . " ORDER BY a.created_at ASC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['formsubmissionid'] = dataFilter( $row['formsubmissionid'] ) ; + $row['submission_type'] = dataFilter( $row['submission_type'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/FormSubmissionCategory/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/grievances/details.php b/apiv3/services/grievances/details.php new file mode 100644 index 0000000..1f2f576 --- /dev/null +++ b/apiv3/services/grievances/details.php @@ -0,0 +1,34 @@ +query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $row['id'] = dataFilter( $row['grievance_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['comment'] = dataFilter( $row['comment'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/grievance/b/'.$row['file'] : '' ) ; + $row['created_at'] = dataFilter( $row['created_at'] ) ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/grievances/lists.php b/apiv3/services/grievances/lists.php new file mode 100644 index 0000000..2871332 --- /dev/null +++ b/apiv3/services/grievances/lists.php @@ -0,0 +1,83 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = $row['department_desc'] ; + } + } + + + $search_query = '' ; + if ( $array['search'] != '' ){ + $search_query .= " AND title LIKE '%".$array['search']."%'" ; + } + + $query = "SELECT grievance_id, staff_id, title, status, created_at FROM grievance + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $staff_list = [] ; + $grievance_id = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['grievance_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['departments'] = '' ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $row ; + + $staff_list[$row['staff_id']] = $row['staff_id'] ; + $grievance_id[$row['grievance_id']] = $row['grievance_id'] ; + } + + // select related grievance media + $media_list = [] ; + $select_media = $mysqli->query( "SELECT grievance_id, file FROM grievance_media a + WHERE a.deleted_at IS NULL AND grievance_id IN ( ".implode( ',', $grievance_id )." )" ) ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + $media_list[$row_media['grievance_id']][] = ( $row_media['file'] != '' ? PATH.'uploads/Grievance/b/'.$row_media['file'] : '' ) ; + } + } + + // select all staff related deparment + $related_list = [] ; + $select_related = $mysqli->query( "SELECT staff_id, department_id FROM staff_department a + WHERE a.deleted_at IS NULL AND staff_id IN ( ".implode( ',', $staff_list )." )" ) ; + if ( $select_related->num_rows > 0 ){ + while ( $row_related = $select_related->fetch_assoc() ){ + if ( checkExists( $department_list[$row_related['department_id']] ) ){ + $related_list[$row_related['staff_id']][] = $department_list[$row_related['department_id']] ; + } + } + } + + foreach ( $list as $k => $v ){ + $list[$k]['departments'] = ( checkExists( $related_list[$v['staff_id']] ) ? implode( ', ', $related_list[$v['staff_id']] ) : '' ) ; + $list[$k]['files'] = ( checkExists( $media_list[$v['grievance_id']] ) ? $media_list[$v['grievance_id']] : [] ) ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/grievances/select.php b/apiv3/services/grievances/select.php new file mode 100644 index 0000000..b345b7c --- /dev/null +++ b/apiv3/services/grievances/select.php @@ -0,0 +1,49 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $row = $mysqli_query->fetch_assoc() ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['comment'] = dataFilter( $row['comment'] ) ; + + // get all media + $select_media = $mysqli->query( "SELECT media_id, file FROM grievance_media + WHERE deleted_at IS NULL AND grievance_id = '".$array['grievance_id']."'" ) ; + $photos = [] ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + $photos[] = [ + 'media_id' => $row_media['media_id'], + 'type' => 'online', + 'file' => ( $row_media['file'] != '' ? PATH.'uploads/Grievance/b/'.$row_media['file'] : '' ) + ] ; + } + } + + $row['photos'] = $photos ; + + $data = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/grievances/update.php b/apiv3/services/grievances/update.php new file mode 100644 index 0000000..a4541a2 --- /dev/null +++ b/apiv3/services/grievances/update.php @@ -0,0 +1,50 @@ + 0 ){ + $status = '203' ; + + if ( $mysqli->query( "INSERT INTO grievance + ( `branch_id`, `staff_id`, `title`, `content`, `status` ) VALUES + ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$array['title']."', '".$array['content']."', 'pending' )" ) ){ + $status = '200' ; + + $boolean_submit = true ; + $grievance_id = $mysqli->insert_id ; + + $grievance_so = 'GV'.strPad( 6, $grievance_id ) ; + $mysqli->query( "UPDATE grievance SET + grievance_so = '".$grievance_so."' + WHERE grievance_id = '".$grievance_id."'" ) ; + + if ( checkExists($photos) ){ + foreach ( $photos as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'Grievance', $grievance_id.'-'.$grievance_id, $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $mysqli->query( "INSERT INTO grievance_media + ( grievance_id, file, filetype ) VALUES + ( '".$grievance_id."', '".$upload['data']['file_name']."', '".$upload['data']['file_type']."' )" ) ; + $status = '200' ; + } + } + } + } + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/handbooks/checked.php b/apiv3/services/handbooks/checked.php new file mode 100644 index 0000000..d18c985 --- /dev/null +++ b/apiv3/services/handbooks/checked.php @@ -0,0 +1,31 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + $mysqli->query( "INSERT INTO staff_handbook + ( handbook_id, staff_id ) VALUES + ( '".$array['id']."', '".$staff_info['staff_id']."' ) " ) ; + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/handbooks/details.php b/apiv3/services/handbooks/details.php new file mode 100644 index 0000000..8bf9a43 --- /dev/null +++ b/apiv3/services/handbooks/details.php @@ -0,0 +1,54 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + $row = $mysqli_query->fetch_assoc() ; + + $file = '' ; + if ( $row['file'] != '' ){ + if ( $row['file_type'] == 'pdf' ){ + $file = PATH.'uploads/Handbook/'.$row['file'] ; + }else{ + $file = PATH.'uploads/Handbook/b/'.$row['file'] ; + } + } + + // check if agree or not + $is_agreed = 'no' ; + $select_agree = $mysqli->query( "SELECT * FROM staff_handbook + WHERE deleted_at IS NULL AND handbook_id = '".$array['id']."' AND staff_id = '".$staff_info['staff_id']."' LIMIT 1" ) ; + if ( $select_agree->num_rows > 0 ){ + $is_agreed = 'yes' ; + } + + + $row['id'] = dataFilter( $row['handbook_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['file'] = $file ; + $row['created_at'] = dataFilter( $row['created_at'] ) ; + $row['is_agreed'] = $is_agreed ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/handbooks/lists.php b/apiv3/services/handbooks/lists.php new file mode 100644 index 0000000..cf9ea54 --- /dev/null +++ b/apiv3/services/handbooks/lists.php @@ -0,0 +1,42 @@ +query( $query . " ORDER BY a.sortable ASC, a.created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['handbook_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Handbook/b/'.$row['file'] : '' ) ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/handbooks/main-category.php b/apiv3/services/handbooks/main-category.php new file mode 100644 index 0000000..41a8c4d --- /dev/null +++ b/apiv3/services/handbooks/main-category.php @@ -0,0 +1,38 @@ +query( $query . " ORDER BY a.sortable ASC, a.created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['category_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/HandbookCategory/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/handbooks/sub-category.php b/apiv3/services/handbooks/sub-category.php new file mode 100644 index 0000000..69e09a9 --- /dev/null +++ b/apiv3/services/handbooks/sub-category.php @@ -0,0 +1,38 @@ +query( $query . " ORDER BY a.sortable ASC, a.created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['category_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/HandbookCategory/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/recruitments/lists.php b/apiv3/services/recruitments/lists.php new file mode 100644 index 0000000..af82cba --- /dev/null +++ b/apiv3/services/recruitments/lists.php @@ -0,0 +1,86 @@ +query( "SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $mysqli_position->num_rows > 0 ){ + while( $row_position = $mysqli_position->fetch_assoc() ){ + $positions[$row_position['job_position_id']] = $row_position['job_position_desc'] ; + } + } + + + + $search_query = '' ; + if ( $array['search'] != '' ){ + $search_query .= " AND ( employment_name LIKE '%".$array['search']."%' OR employment_nric LIKE '%".$array['search']."%' OR employment_mobile LIKE '%".$array['search']."%' OR employment_email LIKE '%".$array['search']."%' )" ; + } + + $searchstatus = 'Processing' ; + if ( $array['searchstatus'] != '' ){ + switch ( $array['searchstatus'] ){ + case 'pending' : + $searchstatus = 'Processing' ; + break ; + case 'shortlisted' : + $searchstatus = 'Processing Confirmed' ; + break ; + case 'rejected' : + $searchstatus = 'Processing Rejected' ; + break ; + } + } + if ( $searchstatus != '' ){ + $search_query .= " AND employment_status = '".$searchstatus."'" ; + } + + $query = "SELECT employment_id, employment_name, employment_nric, employment_mobile, employment_email, employment_sex, employment_position, employment_resume, employment_status, employment_date FROM staff_employment + WHERE employment_trash = '0' AND employment_branch = '".$array['branch_id']."' AND employment_incharge_staff_id = '".$staff_info['staff_id']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ORDER BY employment_modified DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + + + + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['employment_id'] = dataFilter( $row['employment_id'] ) ; + $row['employment_name'] = dataFilter( $row['employment_name'] ) ; + $row['employment_nric'] = dataFilter( $row['employment_nric'] ) ; + $row['employment_mobile'] = dataFilter( $row['employment_mobile'] ) ; + $row['employment_email'] = dataFilter( $row['employment_email'] ) ; + $row['employment_sex'] = dataFilter( $row['employment_sex'] ) ; + $row['employment_date'] = resetDateFormat( $row['employment_date'] ) ; + $row['employment_position'] = $positions[$row['employment_position']] ; + $row['employment_resume'] = ( $row['employment_resume'] != '' ? PATH.'/uploads/Employment_Resume/'.$row['employment_resume'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/recruitments/update.php b/apiv3/services/recruitments/update.php new file mode 100644 index 0000000..5437cb4 --- /dev/null +++ b/apiv3/services/recruitments/update.php @@ -0,0 +1,148 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $row_employment = $mysqli_query->fetch_assoc() ; + + $status = '308' ; + + $update_status = '' ; + switch ( $array['status'] ){ + case 'confirm' : + $update_status = 'Processing Confirmed' ; + break ; + case 'reject' : + $update_status = 'Processing Rejected' ; + break ; + } + + $branch_hr_contact = '' ; + $branch_hr_email = '' ; + $branch_hr_cc = [] ; + $branch_email_footer = '' ; + $mysqli_query = "SELECT branch_hr_email, branch_hr_cc, branch_hr_contact, branch_email_footer FROM branch WHERE + deleted_at IS NULL AND branch_id = '".$row_employment['employment_branch']."' LIMIT 1" ; + $mysqli_branch = $mysqli->query($mysqli_query) ; + if ( $mysqli_branch->num_rows > 0 ){ + $row_branch = $mysqli_branch->fetch_assoc() ; + $branch_hr_contact = dataFilter( $row_branch['branch_hr_contact'] ) ; + $branch_hr_email = dataFilter( $row_branch['branch_hr_email'] ) ; + $branch_hr_cc = explodeToArray( $row_branch['branch_hr_cc'] ) ; + $branch_email_footer = entityDecode( dataFilter( $row_branch['branch_email_footer'] ) ) ; + } + + $position = '' ; + $mysqli_query = "SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.job_position_id = '".$row_employment['employment_position']."' LIMIT 1" ; + $mysqli_position = $mysqli->query($mysqli_query) ; + if ( $mysqli_position->num_rows > 0 ){ + $row_position = $mysqli_position->fetch_assoc() ; + $position = dataFilter( $row_position['job_position_desc'] ) ; + } + + + if ( $update_status != '' ){ + $status = '200' ; + + $mysqli->query( "UPDATE staff_employment SET + employment_status = '".$update_status."' + WHERE employment_id = '".$array['id']."'" ) ; + + $title = ucwords($array['status']).' Applicant Interview' ; + $content = '' ; + + $link = PATH.'hr-employment-schedule-interview-date.php?page='.$row_employment['employment_id'].'&branch='.$row_employment['employment_branch'].'&sign='.md5($row_employment['employment_id'].$row_employment['employment_branch'].APIKEY) ; + $schedule = ''.$link.'' ; + + $email_status = '' ; + if ( $update_status == 'Processing Confirmed' ){ + $email_status = 'confirmed' ; + + $content = " + + + + + + + + + + + + + +
Dear ".ucwords($row_employment['employment_name']).",
Greetings from ".COMPANYSHORT.". We've reviewed your resume and would like to have more discussion with you on the ".$position.".
Kindly select the slot for face-to-face interview session on your availability : ".$schedule."
You will receive our second email for interview invitation once your selected slot is being confirmed. If you have any enquiry, please do not hesitate to contact us via email (".$branch_hr_email.") or call to HR department (".$branch_hr_contact.").
Please Note That:
1) This is an interview call for the job applied and does not guarantee employment with us.
2) No TA / DA will be provided to candidates appearing for the interview.
3) If we didn't receive your response on the interview slots in 2 days, we will consider as abandoned application.
" . $branch_email_footer ; + }else{ + $email_status = 'rejected' ; + + // $content = " + // + // + // + // + //
Dear ".ucwords($row_employment['employment_name']).",
Greetings from ".COMPANYSHORT.". We've reviewed your resume and reject your application.
" . $branch_email_footer ; + } + + + $mysqli->query( "INSERT INTO system_log_employment ( log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ( 'employment', 'manager-update-status', '200', 'AF-".$array['id']."', '".$staff_info["staff_id"]."', '".$content."', '', NOW() )" ) ; + + $mailer = new Mailer() ; + + + // send to employee + if ( $content != '' ){ + $mailer->from = $branch_hr_email ; + $mailer->fromname = COMPANY ; + $mailer->to = [ $row_employment['employment_email'] ] ; + if ( count($branch_hr_cc) > 0 ){ + $mailer->cc = $branch_hr_cc ; + } + $mailer->subject = $title ; + $mailer->body = $content ; + $mailer->send() ; + } + + + // send to hr + $mailer->from = $branch_hr_email ; + $mailer->fromname = COMPANY ; + $mailer->to = [ $branch_hr_email ] ; + if ( count($branch_hr_cc) > 0 ){ + $mailer->cc = $branch_hr_cc ; + } + $mailer->subject = 'Reminder for Recruitment' ; + $mailer->body = 'Dear HR, '.ucwords($staff_info['staff_name']).' has '.$email_status.' '.ucwords($row_employment['employment_name']).' for '.$position.'. Please log in to review. +

+ * This is an auto-generated message, please do not reply.' ; + $mailer->send() ; + + + } + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/redeems/category.php b/apiv3/services/redeems/category.php new file mode 100644 index 0000000..27bd7e9 --- /dev/null +++ b/apiv3/services/redeems/category.php @@ -0,0 +1,32 @@ += '".TODAYDAY."' ) )" ; + $mysqli_query = $mysqli->query( $query . " ORDER BY a.sortable ASC" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['category_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/redeems/confirm.php b/apiv3/services/redeems/confirm.php new file mode 100644 index 0000000..58bdfdc --- /dev/null +++ b/apiv3/services/redeems/confirm.php @@ -0,0 +1,96 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '269' ; + + $row = $mysqli_query->fetch_assoc() ; + $point = $row['point'] ; + $custom_point = $array['custom_point'] ; + + $select_category = $mysqli->query( "SELECT category_mode, number_of_times FROM redeem_category + WHERE deleted_at IS NULL AND status = 'active' AND category_id = '".$row['category_id']."' AND ( category_type = 'all' OR ( category_type = 'date' AND date_start <= '".TODAYDAY."' AND date_end >= '".TODAYDAY."' ) ) LIMIT 1" ) ; + + if ( $select_category->num_rows > 0 ){ + $status = '268' ; + + $row_category = $select_category->fetch_assoc() ; + $category_mode = $row_category['category_mode'] ; + $number_of_times = $row_category['number_of_times'] ; + + $get_staffcategory = $mysqli->query( "SELECT * FROM staff_redeem + WHERE deleted_at IS NULL AND category_id = '".$row['category_id']."' AND staff_id = '".$staff_info['staff_id']."' AND created_at LIKE '%".date('Y-m', time())."%' AND status != 'rejected'" ) ; + + if ( $number_of_times > $get_staffcategory->num_rows ){ + + $status = '248' ; + + $is_redeem = 'no' ; + $is_custom = 'no' ; + if ( $row['status'] == 'active' ){ + if ( $row['redeem_type'] == 'all' || ( $row['redeem_type'] == 'date' && $row['date_start'] <= TODAYDATE && $row['date_end'] >= TODAYDATE ) ){ + $is_redeem = 'yes' ; + $is_custom = ( $category_mode == 'custom' ? 'yes' : 'no' ) ; + } + } + + if ( $is_redeem == 'yes' ){ + $status = '243' ; + + if ( $is_custom == 'no' || ( $is_custom == 'yes' && $custom_point > 0 ) ){ + $status = '246' ; + + if ( $is_custom == 'yes' ){ + $point = $custom_point ; + } + + $get_staffredeem = $mysqli->query( "SELECT * FROM staff_redeem + WHERE deleted_at IS NULL AND redeem_id = '".$array['id']."' AND status != 'rejected'" ) ; + $total_redeem = $get_staffredeem->num_rows ; + + if ( $row['redeem_quantity'] > $total_redeem ){ + $status = '249' ; + + $balance = getStaffPoint( $staff_info['staff_id'] ) ; + + if ( $balance >= $point ){ + $status = '200' ; + + $mysqli->query( "INSERT INTO staff_redeem + ( redeem_id, branch_id, category_id, staff_id, point, status ) VALUES + ( '".$array['id']."', '".$array['branch_id']."', '".$row['category_id']."', '".$staff_info['staff_id']."', '".$point."', 'pending' ) " ) ; + + $view_id = $mysqli->insert_id ; + $redeem_so = 'RD'.strPad( 6, $view_id ) ; + + $remark = 'Deduct point '.$point.' ('.$row['title'].') from redeem ' . $redeem_so ; + pointMovement( 'redeem', $view_id, 'exchange', 'normal', $staff_info['staff_id'], -( $point ), $remark ) ; + + $mysqli->query( "UPDATE staff_redeem SET redeem_so = '".$redeem_so."' WHERE view_id = '".$view_id."'" ) ; + + } + + } + } + } + } + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/redeems/details.php b/apiv3/services/redeems/details.php new file mode 100644 index 0000000..bc6165d --- /dev/null +++ b/apiv3/services/redeems/details.php @@ -0,0 +1,67 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $row['id'] = dataFilter( $row['redeem_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Redeem/b/'.$row['file'] : '' ) ; + + $is_redeem = 'no' ; + $is_custom = 'no' ; + if ( $row['status'] == 'active' ){ + if ( $row['redeem_type'] == 'all' || ( $row['redeem_type'] == 'date' && $row['date_start'] <= TODAYDATE && $row['date_end'] >= TODAYDATE ) ){ + $is_redeem = 'yes' ; + + $select_category = $mysqli->query( "SELECT category_mode FROM redeem_category + WHERE deleted_at IS NULL AND category_id = '".$row['category_id']."' LIMIT 1" ) ; + if ( $select_category->num_rows > 0 ){ + $row_category = $select_category->fetch_assoc() ; + $is_custom = ( $row_category['category_mode'] == 'custom' ? 'yes' : 'no' ) ; + } + } + } + $row['is_redeem'] = $is_redeem ; + $row['is_custom'] = $is_custom ; + if ( $is_custom == 'yes' ){ + $row['point'] = $staff_info['staff_point'] ; + } + + $row['date_start'] = resetDateFormat( $row['date_start'] ) ; + $row['date_end'] = resetDateFormat( $row['date_end'] ) ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $row['redeem_status'] = ( checkExists( $row['redeem_status'] ) != '' ? $row['redeem_status'] : '') ; + $row['redeem_remark'] = dataFilter( checkExists( $row['redeem_remark'] ) != '' ? $row['redeem_remark'] : '') ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/redeems/lists.php b/apiv3/services/redeems/lists.php new file mode 100644 index 0000000..da75306 --- /dev/null +++ b/apiv3/services/redeems/lists.php @@ -0,0 +1,91 @@ += '".TODAYDATE."' ) )" ; + break ; + case 'previous' : // my redeem + $join_filter = ", c.view_id, c.status as redeem_status" ; + $join_query = "LEFT JOIN staff_redeem c ON ( a.redeem_id = c.redeem_id )" ; + $search_query .= " AND c.branch_id = '".$array['branch_id']."' AND c.staff_id = '".$staff_info['staff_id']."'" ; + $query_sortable = "ORDER BY c.view_id DESC" ; + break ; + case 'expired' : // temporary close + $search_query .= " AND a.branch LIKE '%/".$array['branch_id']."/%' AND ( a.status = 'inactive' OR ( a.redeem_type = 'date' AND a.date_start <= '".TODAYDATE."' AND NOT ( a.date_end >= '".TODAYDATE."' ) ) )" ; + break ; + case 'history' : + $join_filter = ", c.view_id, c.point as redeem_point, c.status as redeem_status, c.created_at as redeem_created, d.staff_idno, d.staff_shortname" ; + $join_query .= " LEFT JOIN staff_redeem c ON ( a.redeem_id = c.redeem_id )" ; + $join_query .= " LEFT JOIN staff d ON ( c.staff_id = d.staff_id )" ; + $search_query .= " AND c.branch_id = '".$array['branch_id']."' AND c.status = 'confirmed'" ; + $query_sortable = "ORDER BY c.view_id DESC" ; + break ; + } + } + + $query = "SELECT a.redeem_id, a.redeem_type, a.date_start, a.date_end, a.point, a.redeem_quantity, a.file, a.created_at, b.title ".$join_filter." FROM redeem a + LEFT JOIN redeem_translation b ON ( a.redeem_id = b.redeem_id ) + ".$join_query." + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ".$query_sortable." LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['redeem_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['date_start'] = resetDateFormat( $row['date_start'] ) ; + $row['date_end'] = resetDateFormat( $row['date_end'] ) ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $row['redeem_status'] = ( checkExists( $row['redeem_status'] ) != '' ? $row['redeem_status'] : '' ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Redeem/b/'.$row['file'] : '' ) ; + + $row['redeem_left'] = 0 ; + switch ( $searchfilter ){ + case 'current' : + $get_staffredeem = $mysqli->query( "SELECT view_id FROM staff_redeem + WHERE deleted_at IS NULL AND redeem_id = '".$row['redeem_id']."' AND status != 'rejected'" ) ; + $total_redeem = $get_staffredeem->num_rows ; + $row['redeem_left'] = ( $row['redeem_quantity'] - $total_redeem ) ; + break ; + case 'history' : + $row['redeem_created'] = resetDateFormat( $row['redeem_created'] ) ; + break ; + } + + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/redeems/receive.php b/apiv3/services/redeems/receive.php new file mode 100644 index 0000000..48998d5 --- /dev/null +++ b/apiv3/services/redeems/receive.php @@ -0,0 +1,39 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '299' ; + + $row = $mysqli_query->fetch_assoc() ; + + if ( $row['redeem_status'] == 'awaiting-collection' ){ + + $status = '200' ; + + $mysqli->query( "UPDATE staff_redeem SET + status = 'confirmed' + WHERE view_id = '".$array['view_id']."'" ) ; + + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/requests/cancel.php b/apiv3/services/requests/cancel.php new file mode 100644 index 0000000..f8c8904 --- /dev/null +++ b/apiv3/services/requests/cancel.php @@ -0,0 +1,25 @@ += '".TODAYDATE."'" ; + $mysqli_query = $mysqli->query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + $mysqli->query( "UPDATE request SET + status = 'cancelled' + WHERE request_id = '".$array['request_id']."'" ) ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/requests/details.php b/apiv3/services/requests/details.php new file mode 100644 index 0000000..b0a007a --- /dev/null +++ b/apiv3/services/requests/details.php @@ -0,0 +1,32 @@ +query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $row['id'] = dataFilter( $row['request_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['created_at'] = dataFilter( $row['created_at'] ) ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/requests/gallery-list.php b/apiv3/services/requests/gallery-list.php new file mode 100644 index 0000000..7618c87 --- /dev/null +++ b/apiv3/services/requests/gallery-list.php @@ -0,0 +1,46 @@ +query( $query . " ".$query_sortable." LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['date'] = resetDateFormat( $row['created_at'] ) ; + $row['time'] = resetTimeFormat( $row['created_at'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/RequestGallery/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/requests/gallery-upload.php b/apiv3/services/requests/gallery-upload.php new file mode 100644 index 0000000..845df77 --- /dev/null +++ b/apiv3/services/requests/gallery-upload.php @@ -0,0 +1,35 @@ + 0 ){ + if ( checkExists($photos) ){ + foreach ( $photos as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'RequestGallery', time(), $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $mysqli->query( "INSERT INTO request_gallery + ( branch_id, staff_id, title, file, filetype ) VALUES + ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$title."', '".$upload['data']['file_name']."', '".$upload['data']['file_type']."' )" ) ; + $status = '200' ; + } + } + } + } + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/requests/lists.php b/apiv3/services/requests/lists.php new file mode 100644 index 0000000..752181f --- /dev/null +++ b/apiv3/services/requests/lists.php @@ -0,0 +1,87 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = $row['department_desc'] ; + } + } + + + $search_query = "" ; + if ( $array['search'] != '' ){ + $search_query .= " AND title LIKE '%".$array['search']."%'" ; + } + + $query = "SELECT request_id, staff_id, is_main, main_id, sub_id, type, title, description, reason, date_from, date_to, status, created_at FROM request + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $staff_list = [] ; + $request_id = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['request_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['description'] = dataFilter( $row['description'] ) ; + $row['request_date'] = ( $row['date_from'] != '' ? date( "Y-m-d", strtotime( $row['date_from'] ) ) : '' ) ; + $row['time_from'] = date( 'H:ia', strtotime( $row['date_from'] ) ) ; + $row['time_to'] = date( 'H:ia', strtotime( $row['date_to'] ) ) ; + $row['departments'] = '' ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $row ; + + $staff_list[$row['staff_id']] = $row['staff_id'] ; + $request_id[$row['request_id']] = $row['request_id'] ; + } + + // select related request media + $media_list = [] ; + $select_media = $mysqli->query( "SELECT request_id, file FROM request_media a + WHERE a.deleted_at IS NULL AND request_id IN ( ".implode( ',', $request_id )." )" ) ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + $media_list[$row_media['request_id']][] = ( $row_media['file'] != '' ? PATH.'uploads/Request/b/'.$row_media['file'] : '' ) ; + } + } + + // select all staff related deparment + $related_list = [] ; + $select_related = $mysqli->query( "SELECT staff_id, department_id FROM staff_department a + WHERE a.deleted_at IS NULL AND staff_id IN ( ".implode( ',', $staff_list )." )" ) ; + if ( $select_related->num_rows > 0 ){ + while ( $row_related = $select_related->fetch_assoc() ){ + if ( checkExists( $department_list[$row_related['department_id']] ) ){ + $related_list[$row_related['staff_id']][] = $department_list[$row_related['department_id']] ; + } + } + } + + foreach ( $list as $k => $v ){ + $list[$k]['departments'] = ( checkExists( $related_list[$v['staff_id']] ) ? implode( ', ', $related_list[$v['staff_id']] ) : '' ) ; + $list[$k]['files'] = ( checkExists( $media_list[$v['request_id']] ) ? $media_list[$v['request_id']] : [] ) ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/requests/main.php b/apiv3/services/requests/main.php new file mode 100644 index 0000000..3517898 --- /dev/null +++ b/apiv3/services/requests/main.php @@ -0,0 +1,39 @@ +query( $query . " ORDER BY a.sortable ASC, a.created_at ASC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['main_id'] = dataFilter( $row['main_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['description'] = dataFilter( $row['description'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Request/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/requests/receive.php b/apiv3/services/requests/receive.php new file mode 100644 index 0000000..bc55bf1 --- /dev/null +++ b/apiv3/services/requests/receive.php @@ -0,0 +1,67 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '299' ; + + $row = $mysqli_query->fetch_assoc() ; + + if ( $row['status'] == 'awaiting-collection' ){ + + $status = '200' ; + + $mysqli->query( "UPDATE request SET + status = 'confirmed' + WHERE request_id = '".$array['request_id']."'" ) ; + + // get last movment + $updateremark = 'Stock deduct from so number ' . $row['request_so'] ; + $updatequantity = -($row['quantity']) ; + + if ( ( $updatequantity < 0 || $updatequantity > 0) && $updatequantity != '' ){ + $before = 0 ; + + $main_id = $row['main_id'] ; + $sub_id = $row['sub_id'] ; + if ( $sub_id > 0 ){ + $main_id = 0 ; + } + + // get last movment + $mysqli_select = $mysqli->query( "SELECT balance FROM setting_request_movement + WHERE deleted_at IS NULL AND main_id = '".$main_id."' AND sub_id = '".$sub_id."' + ORDER BY movement_id DESC + LIMIT 1" ) ; + if ( $mysqli_select->num_rows > 0 ){ + $row_select = $mysqli_select->fetch_assoc() ; + $before = $row_select['balance'] ; + } + + $quantity = $updatequantity ; + $balance = ( $before + $quantity ) ; + + $mysqli->query( "INSERT INTO setting_request_movement + ( main_id, sub_id, before_quantity, quantity, balance, remark ) VALUES + ( '".$main_id."', '".$sub_id."', '".$before."', '".$quantity."', '".$balance."', '".$updateremark."' )" ) ; + } + + + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/requests/reservation-lists.php b/apiv3/services/requests/reservation-lists.php new file mode 100644 index 0000000..cc308d7 --- /dev/null +++ b/apiv3/services/requests/reservation-lists.php @@ -0,0 +1,80 @@ +query( $query . " ORDER BY a.date_from" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + while ( $row = $mysqli_query->fetch_assoc() ){ + + $boolean_loop = true ; + $date_from = date( 'Y-m-d', strtotime( $row['date_from'] ) ) ; + $date_to = date( 'Y-m-d', strtotime( $row['date_to'] ) ) ; + + $loop_date_from = $date_from ; + $loop_date_to = $date_to ; + while ( $boolean_loop ){ + if ( $loop_date_from <= $loop_date_to ){ + $selected[$loop_date_from] = $loop_date_from ; + }else{ + $boolean_loop = false ; + } + + $loop_date_from = date('Y-m-d', strtotime("+1 day", strtotime($loop_date_from))) ; + } + + if ( $date_from <= $searchyearmonthday && $date_to >= $searchyearmonthday ){ + $row['title'] = dataFilter( $row['title'] ) ; + $row['description'] = dataFilter( $row['description'] ) ; + $row['reason'] = dataFilter( $row['reason'] ) ; + $row['request_date'] = ( $row['date_from'] != '' ? date( "Y-m-d", strtotime( $row['date_from'] ) ) : '' ) ; + $row['time_from'] = date( 'h:ia', strtotime( $row['date_from'] ) ) ; + $row['time_to'] = date( 'h:ia', strtotime( $row['date_to'] ) ) ; + $list[] = $row ; + } + } + } + + + $first_day_of_month = $searchyearmonth . '-01' ; + $last_day_of_month = $searchyearmonth . '-' . date( 't', strtotime( $first_day_of_month ) ) ; + for ( $a = $first_day_of_month ; $a <= $last_day_of_month ; $a++ ){ + if ( $selected[$a] != null ){ + $marked[$a] = [ 'marked' => true, 'dotColor' => '#ff9500' ] ; + } + } + + $data['yearmonthday'] = $searchyearmonthday ; + $data['list'] = $list ; + $data['marked'] = $marked ; + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/requests/select.php b/apiv3/services/requests/select.php new file mode 100644 index 0000000..7cd6ef2 --- /dev/null +++ b/apiv3/services/requests/select.php @@ -0,0 +1,55 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $row = $mysqli_query->fetch_assoc() ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['description'] = dataFilter( $row['description'] ) ; + $row['date_from'] = dataFilter( $row['date_from'] ) ; + $row['date_to'] = dataFilter( $row['date_to'] ) ; + $row['time_from'] = date( 'H:ia', strtotime( $row['date_from'] ) ) ; + $row['time_to'] = date( 'H:ia', strtotime( $row['date_to'] ) ) ; + $row['reason'] = dataFilter( $row['reason'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['comment'] = dataFilter( $row['comment'] ) ; + + // get all media + $select_media = $mysqli->query( "SELECT media_id, file FROM request_media + WHERE deleted_at IS NULL AND request_id = '".$array['request_id']."'" ) ; + $photos = [] ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + $photos[] = [ + 'media_id' => $row_media['media_id'], + 'type' => 'online', + 'file' => ( $row_media['file'] != '' ? PATH.'uploads/Request/b/'.$row_media['file'] : '' ) + ] ; + } + } + + $row['photos'] = $photos ; + + $data = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/requests/sub.php b/apiv3/services/requests/sub.php new file mode 100644 index 0000000..d06237a --- /dev/null +++ b/apiv3/services/requests/sub.php @@ -0,0 +1,40 @@ +query( $query . " ORDER BY a.sortable ASC, a.created_at ASC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['main_id'] = dataFilter( $row['main_id'] ) ; + $row['sub_id'] = dataFilter( $row['sub_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['description'] = dataFilter( $row['description'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Request/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/requests/update.php b/apiv3/services/requests/update.php new file mode 100644 index 0000000..879b8a0 --- /dev/null +++ b/apiv3/services/requests/update.php @@ -0,0 +1,167 @@ + 0 ){ + + $select_sub = $mysqli->query( "SELECT b.title, b.description FROM setting_request_sub a + LEFT JOIN setting_request_sub_translation b ON ( a.sub_id = b.sub_id ) + WHERE a.deleted_at IS NULL AND a.sub_id = '".$array['sub_id']."' AND b.lang = '".$array['lang']."' " ) ; + if ( $select_sub->num_rows > 0 ){ + $boolean_exists = true ; + + $row_sub = $select_sub->fetch_assoc() ; + $descrition = $row_sub['description'] ; + } + + }else{ + + $select_main = $mysqli->query( "SELECT b.title, b.description FROM setting_request a + LEFT JOIN setting_request_translation b ON ( a.main_id = b.main_id ) + WHERE a.deleted_at IS NULL AND a.main_id = '".$array['main_id']."' AND b.lang = '".$array['lang']."' " ) ; + if ( $select_main->num_rows > 0 ){ + $boolean_exists = true ; + + $row_main = $select_main->fetch_assoc() ; + $descrition = $row_main['description'] ; + } + + } + + + if ( $boolean_exists ){ + $status = '300' ; + + $is_upload_photo = false ; + $is_submit = false ; + $is_default_status = '' ; + if ( $array['request_type'] == 'reservation' ){ + if ( $title != '' && $array['reason'] != '' && $request_date != '' && $time_from != '' && $time_to != '' ){ + $status = '295' ; + if ( $date_to >= $date_from ){ + $status = '259' ; + + $select_record = $mysqli->query( "SELECT request_id FROM request + WHERE deleted_at IS NULL AND type = 'reservation' AND main_id = '".$array['main_id']."' AND sub_id = '".$array['sub_id']."' AND status = 'confirmed' AND ( + ( date_from >= '".$date_from."' AND date_from < '".$date_to."' ) OR + ( date_to > '".$date_from."' AND date_to < '".$date_to."' ) OR + ( '".$date_from."' >= date_from AND '".$date_from."' < date_to ) OR + ( '".$date_to."' > date_from AND '".$date_to."' < date_to ) + ) LIMIT 1" ) ; + if ( $select_record->num_rows == 0 ){ + $is_upload_photo = false ; + $is_submit = true ; + $is_default_status = 'confirmed' ; + } + } + } + }else{ + if ( $title != '' && $array['reason'] != '' && $array['photos'] != '' && count( $photos ) > 0 ){ + $is_upload_photo = true ; + $is_submit = true ; + $is_default_status = 'pending' ; + } + } + + if ( $is_submit ){ + $status = '203' ; + + if ( $mysqli->query( "INSERT INTO request + ( `main_id`, `sub_id`, `branch_id`, `staff_id`, `is_main`, `type`, `title`, `description`, `quantity`, `size`, `reason`, `date_from`, `date_to`, `content`, `status` ) VALUES + ( '".$array['main_id']."', '".$array['sub_id']."', '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$array['is_main']."', '".$array['request_type']."', '".$title."', '".$descrition."', '".$array['quantity']."', '".$array['size']."', '".$array['reason']."', '".$date_from."', '".$date_to."', '".$array['content']."', '".$is_default_status."' )" ) ){ + $status = '200' ; + + $boolean_submit = true ; + $request_id = $mysqli->insert_id ; + + $request_so = 'RQ'.strPad( 6, $request_id ) ; + $mysqli->query( "UPDATE request SET + request_so = '".$request_so."' + WHERE request_id = '".$request_id."'" ) ; + + if ( $is_upload_photo ){ + if ( checkExists($photos) ){ + foreach ( $photos as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'Request', $request_id.'-'.$request_id, $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $mysqli->query( "INSERT INTO request_media + ( request_id, file, filetype ) VALUES + ( '".$request_id."', '".$upload['data']['file_name']."', '".$upload['data']['file_type']."' )" ) ; + $status = '200' ; + } + } + } + } + } + + // send email to hr + $branch_hr_contact = '' ; + $branch_hr_email = '' ; + $branch_hr_cc = [] ; + $branch_email_footer = '' ; + $mysqli_query = "SELECT branch_hr_email, branch_hr_cc, branch_hr_contact, branch_email_footer FROM branch WHERE + deleted_at IS NULL AND branch_id = '".$array['branch_id']."' LIMIT 1" ; + $mysqli_branch = $mysqli->query($mysqli_query) ; + if ( $mysqli_branch->num_rows > 0 ){ + $row_branch = $mysqli_branch->fetch_assoc() ; + $branch_hr_contact = dataFilter( $row_branch['branch_hr_contact'] ) ; + $branch_hr_email = dataFilter( $row_branch['branch_hr_email'] ) ; + $branch_hr_cc = explodeToArray( $row_branch['branch_hr_cc'] ) ; + $branch_email_footer = entityDecode( dataFilter( $row_branch['branch_email_footer'] ) ) ; + } + + $mailer = new Mailer() ; + $mailer->from = $branch_hr_email ; + $mailer->fromname = COMPANY ; + $mailer->to = [ $branch_hr_email ] ; + if ( count($branch_hr_cc) > 0 ){ + $mailer->cc = $branch_hr_cc ; + } + $mailer->subject = 'Item Request' ; + $mailer->body = 'Dear HR, staff request new item, kindly review and update it.

by ' . COMPANY . '!' . $branch_email_footer ; ; + $mailer->send() ; + + + } + } + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/suggestions/details.php b/apiv3/services/suggestions/details.php new file mode 100644 index 0000000..1561af9 --- /dev/null +++ b/apiv3/services/suggestions/details.php @@ -0,0 +1,34 @@ +query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $row['id'] = dataFilter( $row['suggestion_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['comment'] = dataFilter( $row['comment'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Suggestion/b/'.$row['file'] : '' ) ; + $row['created_at'] = dataFilter( $row['created_at'] ) ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/suggestions/lists.php b/apiv3/services/suggestions/lists.php new file mode 100644 index 0000000..d5e3c7d --- /dev/null +++ b/apiv3/services/suggestions/lists.php @@ -0,0 +1,83 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = $row['department_desc'] ; + } + } + + + $search_query = '' ; + if ( $array['search'] != '' ){ + $search_query .= " AND title LIKE '%".$array['search']."%'" ; + } + + $query = "SELECT suggestion_id, staff_id, title, status, created_at FROM suggestion + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $staff_list = [] ; + $suggestion_id = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['suggestion_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['departments'] = '' ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $row ; + + $staff_list[$row['staff_id']] = $row['staff_id'] ; + $suggestion_id[$row['suggestion_id']] = $row['suggestion_id'] ; + } + + // select related suggestion media + $media_list = [] ; + $select_media = $mysqli->query( "SELECT suggestion_id, file FROM suggestion_media a + WHERE a.deleted_at IS NULL AND suggestion_id IN ( ".implode( ',', $suggestion_id )." ) AND filetype IN ( 'jpg', 'png', 'gif' )" ) ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + $media_list[$row_media['suggestion_id']][] = ( $row_media['file'] != '' ? PATH.'uploads/Suggestion/b/'.$row_media['file'] : '' ) ; + } + } + + // select all staff related deparment + $related_list = [] ; + $select_related = $mysqli->query( "SELECT staff_id, department_id FROM staff_department a + WHERE a.deleted_at IS NULL AND staff_id IN ( ".implode( ',', $staff_list )." )" ) ; + if ( $select_related->num_rows > 0 ){ + while ( $row_related = $select_related->fetch_assoc() ){ + if ( checkExists( $department_list[$row_related['department_id']] ) ){ + $related_list[$row_related['staff_id']][] = $department_list[$row_related['department_id']] ; + } + } + } + + foreach ( $list as $k => $v ){ + $list[$k]['departments'] = ( checkExists( $related_list[$v['staff_id']] ) ? implode( ', ', $related_list[$v['staff_id']] ) : '' ) ; + $list[$k]['files'] = ( checkExists( $media_list[$v['suggestion_id']] ) ? $media_list[$v['suggestion_id']] : [] ) ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/suggestions/select.php b/apiv3/services/suggestions/select.php new file mode 100644 index 0000000..bea842e --- /dev/null +++ b/apiv3/services/suggestions/select.php @@ -0,0 +1,67 @@ +query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $row = $mysqli_query->fetch_assoc() ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['comment'] = dataFilter( $row['comment'] ) ; + + // get all media + $select_media = $mysqli->query( "SELECT media_id, file, filetype FROM suggestion_media + WHERE deleted_at IS NULL AND suggestion_id = '".$array['suggestion_id']."'" ) ; + $photos = [] ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + + switch ( $row_media['filetype'] ){ + case 'jpg' : + case 'jpeg' : + case 'png' : + $photos[] = [ + 'media_id' => $row_media['media_id'], + 'type' => 'online', + 'filetype' => $row_media['filetype'], + 'file' => ( $row_media['file'] != '' ? PATH.'uploads/Suggestion/b/'.$row_media['file'] : '' ) + ] ; + break ; + default : + $photos[] = [ + 'media_id' => $row_media['media_id'], + 'type' => 'online', + 'filetype' => $row_media['filetype'], + 'file' => ( $row_media['file'] != '' ? PATH.'uploads/Suggestion/'.$row_media['file'] : '' ) + ] ; + } + + + + } + } + + $row['photos'] = $photos ; + + $data = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/suggestions/update.php b/apiv3/services/suggestions/update.php new file mode 100644 index 0000000..7c2f833 --- /dev/null +++ b/apiv3/services/suggestions/update.php @@ -0,0 +1,50 @@ + 0 ){ + $status = '203' ; + + if ( $mysqli->query( "INSERT INTO suggestion + ( `branch_id`, `staff_id`, `type`, `title`, `content`, `status` ) VALUES + ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$array['suggest_type']."', '".$array['title']."', '".$array['content']."', 'pending' )" ) ){ + $status = '200' ; + + $boolean_submit = true ; + $suggestion_id = $mysqli->insert_id ; + + $suggestion_so = 'SG'.strPad( 6, $suggestion_id ) ; + $mysqli->query( "UPDATE suggestion SET + suggestion_so = '".$suggestion_so."' + WHERE suggestion_id = '".$suggestion_id."'" ) ; + + if ( checkExists($photos) ){ + foreach ( $photos as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'Suggestion', $suggestion_id.'-'.$suggestion_id, $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $mysqli->query( "INSERT INTO suggestion_media + ( suggestion_id, file, filetype ) VALUES + ( '".$suggestion_id."', '".$upload['data']['file_name']."', '".$upload['data']['file_type']."' )" ) ; + $status = '200' ; + } + } + } + } + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/approved.php b/apiv3/services/tasks/approved.php new file mode 100644 index 0000000..422a7ef --- /dev/null +++ b/apiv3/services/tasks/approved.php @@ -0,0 +1,79 @@ +query( "SELECT task_so, task_type, difficulty, date_end, assigned_by, incentive, incentive2, confirmed_at, updated_at FROM task + WHERE deleted_at IS NULL AND task_id = '".$task_id."' AND ( created_by = '".$staff_info['staff_id']."' ) AND status = 'confirmed' LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '212' ; + + $row = $select->fetch_assoc() ; + $is_late = 'yes' ; + if ( $row['date_end'] >= $row['confirmed_at'] ){ + $is_late = 'no' ; + } + + if ( $mysqli->query( "UPDATE task SET + extra = '".$extra."', + rating = '".$rating."', + is_late = '".$is_late."', + status = 'approved' + WHERE task_id = '".$task_id."'" ) ) { + + + // $earned_assigned = ( $extra ) ; + // $earned_executed = ( $extra ) ; + // if ( $row['date_end'] >= $row['updated_at'] ){ + $earned_assigned = ( $row['incentive'] + $extra ) ; + $earned_executed = ( $row['incentive2'] + $extra ) ; + // } + + $remark1 = 'Earn point from task ' . $row['task_so'] ; + $remark2 = 'Earn incentive from task ' . $row['task_so'] ; + + if ( $row['assigned_by'] > 0 ){ + pointMovement( 'task', $task_id, $rating, 'normal', $row['assigned_by'], '0', $remark1 ) ; + pointMovement( 'task', $task_id, $row['task_type'], $row['difficulty'], $row['assigned_by'], $earned_assigned, $remark2 ) ; + } + + // joinstaff earn point + $select_joinstaff = $mysqli->query( "SELECT staff_id FROM task_joinstaff + WHERE task_id = '".$task_id."'" ) ; + if ( $select_joinstaff->num_rows > 0 ){ + while ( $row_joinstaff = $select_joinstaff->fetch_assoc() ){ + pointMovement( 'task', $task_id, $rating, 'normal', $row_joinstaff['staff_id'], '0', $remark1 ) ; + pointMovement( 'task', $task_id, $row['task_type'], $row['difficulty'], $row_joinstaff['staff_id'], $earned_executed, $remark2 ) ; + } + } + + $status = '200' ; + + // push to notification + $related_staffid = getTaskRelatedStaff( $task_id, $row['created_by'], $row['assigned_by'] ) ; + foreach ( $related_staffid as $k => $v ){ + pushToUserCron( 'task', $task_id, $v, 'Task Approved', 'Task ( '.$row['task_so'].' ) has been approved' ) ; + } + } + + } + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/assign.php b/apiv3/services/tasks/assign.php new file mode 100644 index 0000000..bc4ad6f --- /dev/null +++ b/apiv3/services/tasks/assign.php @@ -0,0 +1,85 @@ + 0 ){ + $status = '303' ; + + $staff_tier = [] ; + $staff_tier = getRelatedTierID( 'no', $staff_info['staff_tier_level'] ) ; + + $related_staffs = [] ; + if ( count( $joinstaffs ) > 0 ){ + foreach ( $joinstaffs as $k => $v ){ + $related_staffs[] = $v['id'] ; + } + } + + $select_staff = $mysqli->query( "SELECT a.staff_id, a.staff_idno, a.staff_name, a.staff_shortname, a.staff_tier FROM staff a + WHERE a.deleted_at IS NULL AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL ) AND staff_id IN ( '".implode("', '", $related_staffs)."' ) AND staff_tier IN ( '".implode("', '", $staff_tier)."' )" ) ; + + if ( $select_staff->num_rows == count( $related_staffs ) ){ + $status = '201' ; + + $select = $mysqli->query( "SELECT * FROM task a + WHERE a.deleted_at IS NULL AND a.task_id = '".$task_id."' AND ( a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 ) ) AND a.status IN ( 'pending', 'assigned', 'resubmit', 'progress' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '212' ; + + $row = $select->fetch_assoc() ; + + // get all task + $update_status = 'assigned' ; + $count_todo_done = 0 ; + $select_task_todo = $mysqli->query( "SELECT is_done FROM task_todo + WHERE deleted_at IS NULL AND task_id = '".$task_id."'" ) ; + if ( $select_task_todo->num_rows > 0 ){ + while ( $row_todo = $select_task_todo->fetch_assoc() ){ + if ( $row_todo['is_done'] == 'yes' ){ + $count_todo_done++ ; + } + } + } + + if ( $count_todo_done > 0 ){ + $update_status = 'progress' ; + } + + if ( $mysqli->query( "UPDATE task SET + incentive2 = '".$incentive2."', + status = '".$update_status."' + WHERE task_id = '".$task_id."'" ) ) { + $status = '200' ; + + // deleted all related staff + $mysqli->query( "DELETE FROM `task_joinstaff` WHERE task_id = '".$task_id."'" ) ; + if ( checkExists($joinstaffs) ){ + foreach ( $joinstaffs as $k => $v ){ + $mysqli->query( "INSERT INTO `task_joinstaff` ( `task_id`, `staff_id` ) VALUES ( '".$task_id."', '".$v['id']."' )" ) ; + } + } + + // push to notification + $related_staffid = getTaskRelatedStaff( $task_id, $row['created_by'], $row['assigned_by'] ) ; + foreach ( $related_staffid as $k => $v ){ + pushToUserCron( 'task', $task_id, $v, 'Task Assign', 'Task ( '.$row['task_so'].' ) has been assigned' ) ; + } + } + + } + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/cancelled.php b/apiv3/services/tasks/cancelled.php new file mode 100644 index 0000000..e795696 --- /dev/null +++ b/apiv3/services/tasks/cancelled.php @@ -0,0 +1,45 @@ +query( "SELECT * FROM task a + WHERE a.deleted_at IS NULL AND a.task_id = '".$task_id."' AND a.created_by = '".$staff_info['staff_id']."' AND a.status IN ( 'pending', 'assigned', 'resubmit', 'progress', 'completed', 'confirmed' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '303' ; + + $row = $select->fetch_assoc() ; + + if ( $mysqli->query( "UPDATE task SET + status = 'cancelled' + WHERE task_id = '".$task_id."'" ) ) { + + $mysqli->query( "INSERT INTO task_rejected + ( `task_id`, `staff_id`, `remark` ) VALUES + ( '".$task_id."', '".$staff_info['staff_id']."', '".$reason."' )" ) ; + + $status = '200' ; + + // push to notification + $related_staffid = getTaskRelatedStaff( $task_id, $row['created_by'], $row['assigned_by'] ) ; + foreach ( $related_staffid as $k => $v ){ + pushToUserCron( 'task', $task_id, $v, 'Task Cancelled', 'Task ( '.$row['task_so'].' ) has been cancelled' ) ; + } + } + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/components.php b/apiv3/services/tasks/components.php new file mode 100644 index 0000000..949d100 --- /dev/null +++ b/apiv3/services/tasks/components.php @@ -0,0 +1,140 @@ +query( "SELECT a.staff_id, a.staff_idno, a.staff_name, a.staff_shortname, a.staff_tier FROM staff a + WHERE a.deleted_at IS NULL AND a.branch_id = '".$array['branch_id']."' AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL ) " ) ; + + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $get_staff_tier = $all_tier[$row['staff_tier']] ; + + $staffs[$row['staff_id']] = [ + 'id' => $row['staff_id'], + 'title' => $row['staff_shortname'] . ' ('.$row['staff_idno'].' / '.strtoupper( $get_staff_tier['title'] ).')', + 'name' => $row['staff_name'], + 'tier' => $get_staff_tier['level'] + ] ; + } + } + + + + + // select all department + $select = $mysqli->query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $departments[] = $row ; + } + } + + + + + + // select all staff department + $select = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department a + WHERE a.deleted_at IS NULL" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + if ( $staffs[ $row['staff_id'] ] != null && $staffs[ $row['staff_id'] ] != undefined ){ + $staff = $staffs[ $row['staff_id'] ] ; + $staff_departments[$row['department_id']][] = $staff ; + } + } + } + + + + + + // reset + $reset_departments[] = [ + 'id' => '0', + 'title' => 'Cross Department', + 'staffs' => [] + ] ; + foreach ( $departments as $k => $v ){ + if ( $staff_departments[$v['department_id']] != null && $staff_departments[$v['department_id']] != undefined ){ + $reset_departments[] = [ + 'id' => $v['department_id'], + 'title' => $v['department_desc'], + 'staffs' => $staff_departments[$v['department_id']] + ] ; + } + } + + + + + + + + $task_types = [ + [ + 'id' => '1time', + 'title' => 'One Time Only' + ], + [ + 'id' => 'daily', + 'title' => 'Daily Update' + ], + [ + 'id' => 'weekly', + 'title' => 'Weekly Update' + ], + [ + 'id' => 'monthly', + 'title' => 'Monthly Update' + ], + [ + 'id' => 'yearly', + 'title' => 'Yearly Update' + ] + ] ; + + + + + // select all department + $select = $mysqli->query( "SELECT a.code, b.title FROM setting_difficulty a + LEFT JOIN setting_difficulty_translation b ON ( a.difficulty_id = b.difficulty_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' AND set_tier LIKE '%|".$staff_info['staff_tier']."|%' + ORDER BY a.sortable" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $difficultys[] = [ + 'id' => $row['code'], + 'title' => $row['title'], + ] ; + } + } + + + + $data = [ + 'task_types' => $task_types, + 'departments' => $reset_departments, + 'difficultys' => $difficultys + ] ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/confirmed.php b/apiv3/services/tasks/confirmed.php new file mode 100644 index 0000000..d1c6472 --- /dev/null +++ b/apiv3/services/tasks/confirmed.php @@ -0,0 +1,40 @@ +query( "SELECT * FROM task a + WHERE a.deleted_at IS NULL AND a.task_id = '".$task_id."' AND ( a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 ) ) AND a.status IN ( 'completed' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '212' ; + + $row = $select->fetch_assoc() ; + + if ( $mysqli->query( "UPDATE task SET + status = 'confirmed', + confirmed_at = '".TODAYDATE."' + WHERE task_id = '".$task_id."'" ) ) { + $status = '200' ; + + // push to notification + $related_staffid = getTaskRelatedStaff( $task_id, $row['created_by'], $row['assigned_by'] ) ; + foreach ( $related_staffid as $k => $v ){ + pushToUserCron( 'task', $task_id, $v, 'Task Confirmed', 'Task ( '.$row['task_so'].' ) has been confirmed' ) ; + } + } + + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/lists.php b/apiv3/services/tasks/lists.php new file mode 100644 index 0000000..3e28b7b --- /dev/null +++ b/apiv3/services/tasks/lists.php @@ -0,0 +1,128 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = $row['department_desc'] ; + } + } + + // select all staff + $staff_list = [] ; + $select = $mysqli->query( "SELECT a.staff_id, a.staff_name, a.staff_shortname, a.staff_idno FROM staff a + WHERE a.deleted_at IS NULL" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $staff_list[$row['staff_id']] = $row['staff_name'] . ' ( '.$row['staff_idno'].' )' ; + } + } + + + + + $search_query = '' ; + if ( $array['search'] != '' ){ + $search_query .= " AND a.title LIKE '%".$array['search']."%'" ; + } + if ( $array['searchstatus'] != '' ){ + // $search_query .= " AND a.status = '".$array['searchstatus']."'" ; + + $search_status = [] ; + switch ( $array['searchstatus'] ){ + case 'approved' : + $search_status = [ 'approved' ] ; + break ; + case 'rejected' : + $search_status = [ 'rejected' ] ; + break ; + default : + $search_status = [ 'pending', 'assigned', 'resubmit', 'progress', 'completed', 'confirmed' ] ; + } + $search_query .= " AND a.status IN ( '".implode("', '", $search_status)."' )" ; + }else{ + $search_query .= " AND a.status != 'rejected'" ; + } + switch ( $array['searchincharge'] ){ + case 'create' : + $search_query .= " AND a.created_by = '".$staff_info['staff_id']."'" ; + break ; + case 'assign' : + $search_query .= " AND a.assigned_by = '".$staff_info['staff_id']."'" ; + break ; + case 'execute' : + $search_query .= " AND EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 )" ; + break ; + } + + $query = "SELECT a.task_id, a.task_type, a.title, a.department_id, a.created_by, a.assigned_by, a.difficulty, a.date_start, a.date_end, a.remark, a.todo_list, a.todo_done, a.status, a.created_at, a.updated_at FROM task a + WHERE a.deleted_at IS NULL AND ( a.created_branch_id = '".$array['branch_id']."' AND a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 ) ) " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ORDER BY a.created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $task_ids = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + + $task_type_name = '' ; + switch ( $row['task_type'] ){ + case '1time' : $task_type_name = 'One Time Only' ; break ; + case 'daily' : $task_type_name = 'Daily Update' ; break ; + case 'weekly' : $task_type_name = 'Weekly Update' ; break ; + case 'monthly' : $task_type_name = 'Monthly Update' ; break ; + case 'yearly' : $task_type_name = 'Yearly Update' ; break ; + } + + $row['title'] = dataFilter( $row['title'] ) ; + $row['task_type_name'] = $task_type_name ; + $row['expired'] = strtotime( $row['date_end'] ) ; + $row['is_warning'] = ( $row['date_end'] == TODAYDAY ? 'yes' : 'no' ) ; + + $row['department'] = ( checkExists( $department_list[ $row['department_id'] ] ) ? $department_list[ $row['department_id'] ] : 'Cross Department' ) ; + $row['created_by_name'] = $staff_list[ $row['created_by'] ] ; + $row['assigned_by_name'] = checkExists( $staff_list[ $row['assigned_by'] ] ) ; + $row['progress'] = ( $row['todo_done'] > 0 ? ( numberFormat( ( $row['todo_done'] / $row['todo_list'] * 100 ), 2 ) + 0 ) : 0 ) ; + $list[$row['task_id']] = $row ; + + $task_ids[] = $row['task_id'] ; + } + + // join staff + $query_joinstaff = $mysqli->query( "SELECT * FROM task_joinstaff + WHERE task_id IN ( ".implode(', ', $task_ids)." )" ) ; + $joinstaffs = [] ; + if ( $query_joinstaff->num_rows > 0 ){ + while ( $row_joinstaff = $query_joinstaff->fetch_assoc() ){ + $joinstaffs[$row_joinstaff['task_id']][] = $staff_list[ $row_joinstaff['staff_id'] ] ; + } + } + + // reset list + $new_list = [] ; + foreach ( $list as $k => $v ){ + $assigned_by_name = ( checkExists( $joinstaffs[$v['task_id']] ) ? implode( ', ', $joinstaffs[$v['task_id']] ) : $v['assigned_by_name'] ) ; + $v['assigned_by_name'] = $assigned_by_name ; + $new_list[] = $v ; + } + + $data['list'] = $new_list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/more-todo.php b/apiv3/services/tasks/more-todo.php new file mode 100644 index 0000000..7375358 --- /dev/null +++ b/apiv3/services/tasks/more-todo.php @@ -0,0 +1,92 @@ + 0 ){ + $status = '201' ; + + $select = $mysqli->query( "SELECT * FROM task a + WHERE a.deleted_at IS NULL AND a.task_id = '".$task_id."' AND ( a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 ) ) AND a.status IN ( 'pending', 'assigned', 'resubmit', 'progress', 'completed' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '202' ; + + $row = $select->fetch_assoc() ; + + $count_todo_list = 0 ; + $count_todo_done = 0 ; + if ( checkExists($array['todo_list']) ){ + foreach ( $array['todo_list'] as $k => $v ){ + if ( $v['is_delete'] == 'no' ){ + $count_todo_list++ ; + + if ( $v['is_done'] == 'yes' ){ + $count_todo_done++ ; + } + } + } + } + + if ( checkExists($array['todo_list']) ){ + foreach ( $array['todo_list'] as $k => $v ){ + if ( $v['is_delete'] == 'no' ){ + if ( $v['id'] > 0 ){ + $mysqli->query( "UPDATE task_todo SET + title = '".$v['title']."', + sortable = '".$v['sortable']."' + WHERE todo_id = '".$v['id']."'" ) ; + }else{ + $mysqli->query( "INSERT INTO task_todo + ( `task_id`, `title`, `sortable` ) VALUES + ( '".$task_id."', '".$v['title']."', '".$v['sortable']."' )" ) ; + } + }else{ + if ( $v['id'] > 0 ){ + $mysqli->query( "UPDATE task_todo SET + deleted_at = '".TODAYDATE."' + WHERE todo_id = '".$v['id']."'" ) ; + } + } + } + } + + $update_status = 'pending' ; + if ( $row['assigned_by'] > 0 ){ + $update_status = 'assigned' ; + } + if ( $count_todo_done > 0 ){ + $update_status = 'progress' ; + } + if ( $count_todo_list == $count_todo_done ){ + $update_status = 'completed' ; + } + + if ( $mysqli->query( "UPDATE task SET + status = '".$update_status."', + todo_list = '".$count_todo_list."', + todo_done = '".$count_todo_done."' + WHERE task_id = '".$task_id."'" ) ) { + $status = '200' ; + + // push to notification + $related_staffid = getTaskRelatedStaff( $task_id, $row['created_by'], $row['assigned_by'] ) ; + foreach ( $related_staffid as $k => $v ){ + pushToUserCron( 'task', $task_id, $v, 'Task Todo', 'Task ( '.$row['task_so'].' ) todo has been updated' ) ; + } + } + + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/reject.php b/apiv3/services/tasks/reject.php new file mode 100644 index 0000000..7a514a2 --- /dev/null +++ b/apiv3/services/tasks/reject.php @@ -0,0 +1,36 @@ +query( "SELECT * FROM task a + WHERE a.deleted_at IS NULL AND a.task_id = '".$task_id."' AND ( a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 ) ) AND a.status IN ( 'pending', 'assigned' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '212' ; + + if ( $mysqli->query( "UPDATE task SET + status = 'rejected', + rejected_at = '".TODAYDATE."', + rejected_by = '".$staff_info['staff_id']."', + rejected_reason = '".$reason."' + WHERE task_id = '".$task_id."'" ) ) { + $status = '200' ; + } + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/rejected.php b/apiv3/services/tasks/rejected.php new file mode 100644 index 0000000..953a222 --- /dev/null +++ b/apiv3/services/tasks/rejected.php @@ -0,0 +1,66 @@ +query( "SELECT * FROM task a + WHERE a.deleted_at IS NULL AND a.task_id = '".$task_id."' AND ( a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 ) ) AND a.status IN ( 'pending', 'assigned', 'completed', 'confirmed' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '303' ; + + $row = $select->fetch_assoc() ; + + $update_status = '' ; + if ( $row['status'] == 'confirmed' ){ + if ( $row['created_by'] == $staff_info['staff_id'] ){ + $update_status = 'resubmit' ; + } + }else{ + $update_status = 'rejected' ; + } + + if ( $update_status != '' ){ + $status = '202' ; + + if ( $mysqli->query( "UPDATE task SET + todo_done = '0', + status = '".$update_status."' + WHERE task_id = '".$task_id."'" ) ) { + + $mysqli->query( "INSERT INTO task_rejected + ( `task_id`, `staff_id`, `remark` ) VALUES + ( '".$task_id."', '".$staff_info['staff_id']."', '".$reason."' )" ) ; + + if ( $update_status == 'resubmit' ){ + $mysqli->query( "UPDATE task_todo SET + is_done = 'no' + WHERE task_id = '".$task_id."'" ) ; + } + + $status = '200' ; + + // push to notification + $related_staffid = getTaskRelatedStaff( $task_id, $row['created_by'], $row['assigned_by'] ) ; + foreach ( $related_staffid as $k => $v ){ + pushToUserCron( 'task', $task_id, $v, 'Task Rejected', 'Task ( '.$row['task_so'].' ) has been rejected' ) ; + } + } + } + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/remark-todo.php b/apiv3/services/tasks/remark-todo.php new file mode 100644 index 0000000..d54b568 --- /dev/null +++ b/apiv3/services/tasks/remark-todo.php @@ -0,0 +1,67 @@ + 0 ){ + $status = '201' ; + + $select = $mysqli->query( "SELECT * FROM task a + WHERE a.deleted_at IS NULL AND a.task_id = '".$task_id."' AND ( a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 ) ) AND a.status IN ( 'pending', 'assigned', 'resubmit', 'progress', 'completed' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + + $row = $select->fetch_assoc() ; + + // check if selected todo exists + $select_todo = $mysqli->query( "SELECT * FROM task_todo + WHERE deleted_at IS NULL AND task_id = '".$task_id."' AND todo_id = '".$todo_id."' LIMIT 1" ) ; + if ( $select_todo->num_rows > 0 ){ + $status = '202' ; + + if ( checkExists($array['remark_list']) ){ + foreach ( $array['remark_list'] as $k => $v ){ + if ( $v['is_delete'] == 'no' ){ + if ( $v['id'] > 0 ){ + $mysqli->query( "UPDATE task_todo_remark SET + title = '".$v['title']."' + WHERE remark_id = '".$v['id']."'" ) ; + }else{ + $mysqli->query( "INSERT INTO task_todo_remark + ( `task_id`, `todo_id`, `staff_id`, `title` ) VALUES + ( '".$task_id."', '".$todo_id."', '".$staff_info['staff_id']."', '".$v['title']."' )" ) ; + } + }else{ + if ( $v['id'] > 0 ){ + $mysqli->query( "UPDATE task_todo_remark SET + deleted_at = '".TODAYDATE."' + WHERE remark_id = '".$v['id']."'" ) ; + } + } + } + + $status = '200' ; + + // push to notification + $related_staffid = getTaskRelatedStaff( $task_id, $row['created_by'], $row['assigned_by'] ) ; + foreach ( $related_staffid as $k => $v ){ + pushToUserCron( 'task', $task_id, $v, 'Task Remark', 'Task ( '.$row['task_so'].' ) remark updated' ) ; + } + } + + } + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/report copy 2.php b/apiv3/services/tasks/report copy 2.php new file mode 100644 index 0000000..39a7948 --- /dev/null +++ b/apiv3/services/tasks/report copy 2.php @@ -0,0 +1,351 @@ + $months ] ; + $departments_name = [ '0' => $lang['Cross Department'] ] ; + $select_departments = $mysqli->query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select_departments->num_rows > 0 ){ + while ( $row_departments = $select_departments->fetch_assoc() ){ + $departments[$row_departments['department_id']] = $months ; + $departments_name[$row_departments['department_id']] = $row_departments['department_desc'] ; + } + } + + // monthly report = by personal or whole branch + $array_report = [ + 'personal' => [ + // 'late' => [ + // 'name' => $lang['On Time Or Delayed Report'], + // 'subname' => $months_name, + // 'sub' => [ + // 'no' => [ 'name' => $lang['On Time'], 'lists' => $months ], + // 'yes' => [ 'name' => $lang['Delayed'], 'lists' => $months ] + // ] + // ], + 'complete' => [ + 'name' => $lang['Completed Or Incompleted Report'], + 'subname' => $months_name, + 'sub' => [ + 'yes' => [ 'name' => $lang['Completed'], 'lists' => $months ], + 'no' => [ 'name' => $lang['Incompleted'], 'lists' => $months ], + 'cancel' => [ 'name' => $lang['Cancelled'], 'lists' => $months ] + ] + ], + 'department' => [ + 'name' => $lang['Department Task Given Report'], + 'subname' => $months_name, + 'sub' => $departments + ] + ] + ] ; + if ( $staff_settings['reporttaskbranch'] == 'yes' ){ + $array_report['branch'] = [ + // 'late' => [ + // 'name' => $lang['On Time Or Delayed Report'], + // 'subname' => $months_name, + // 'sub' => [ + // 'no' => [ 'name' => $lang['On Time'], 'lists' => $months ], + // 'yes' => [ 'name' => $lang['Delayed'], 'lists' => $months ] + // ] + // ], + 'complete' => [ + 'name' => $lang['Completed Or Incompleted Report'], + 'subname' => $months_name, + 'sub' => [ + 'yes' => [ 'name' => $lang['Completed'], 'lists' => $months ], + 'no' => [ 'name' => $lang['Incompleted'], 'lists' => $months ], + 'cancel' => [ 'name' => $lang['Cancelled'], 'lists' => $months ] + ] + ], + 'department' => [ + 'name' => $lang['Department Task Given Report'], + 'subname' => $months_name, + 'sub' => $departments + ] + ] ; + } + + $filtertype = [] ; + foreach ( $array_report as $k => $v ){ + if ( $k == $search_type ){ + $filtertype[] = $k ; + } + } + + foreach ( $filtertype as $k => $v ){ + + $search_query = " AND ( a.created_branch_id = '".$array['branch_id']."' XXXXXX )" ; + switch ( $v ){ + case 'personal' : + $search_query = str_replace( 'XXXXXX', " AND a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 )", $search_query ) ; + break ; + case 'branch' : + $search_query = str_replace( 'XXXXXX', '', $search_query ) ; + break ; + } + + + + + // late report + // $select_task = $mysqli->query( "SELECT COUNT(a.is_late) as total, a.is_late, MONTH(a.confirmed_at) as month FROM task a + // WHERE a.deleted_at IS NULL AND a.status = 'approved' AND a.confirmed_at LIKE '%".$search_year."%' ".$search_query." + // GROUP BY a.is_late, MONTH(a.confirmed_at)" ) ; + // if ( $select_task->num_rows > 0 ){ + // while ( $row_task = $select_task->fetch_assoc() ){ + // $array_report[$v]['late']['sub'][$row_task['is_late']]['lists'][$row_task['month']] = $row_task['total'] ; + // } + // } + + + + + // complete report + $select_task = $mysqli->query( "SELECT COUNT(a.status) as total, MONTH(a.created_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'approved' ) AND a.created_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY MONTH(a.created_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['complete']['sub']['yes']['lists'][$row_task['month']] = $row_task['total'] ; + } + } + + + // incomplete report + $select_task = $mysqli->query( "SELECT COUNT(a.status) as total, MONTH(a.created_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'pending','assigned','resubmit','progress','completed','confirmed' ) AND a.created_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY MONTH(a.created_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['complete']['sub']['no']['lists'][$row_task['month']] = $row_task['total'] ; + } + } + + + // cancel report + $select_task = $mysqli->query( "SELECT COUNT(a.status) as total, MONTH(a.created_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'rejected', 'cancelled' ) AND a.created_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY MONTH(a.created_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['complete']['sub']['cancel']['lists'][$row_task['month']] = $row_task['total'] ; + } + } + + + + + + + // department complete report + $select_task = $mysqli->query( "SELECT COUNT(a.department_id) as total, a.department_id, MONTH(a.confirmed_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'approved' ) AND a.confirmed_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY a.department_id, MONTH(a.confirmed_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['department']['sub'][$row_task['department_id']][$row_task['month']] = $row_task['total'] ; + } + } + } + + + // direct echo + if ( $array['iswebview'] == 'yes' ){ + + $html .= ' + + + + + + + + + + +
+ +
+ + + + '. $search_year .' + + + +
' ; + + if ( count($array_report) > 1 ){ + $html .= ' + ' ; + } + + foreach ( $array_report as $kreport => $vreport ){ + + if ( $kreport == $search_type ){ + + foreach ( $vreport as $ktype => $vtype ){ + + $title = $vtype['name'] ; + $titlename = $title.' ( '.$lang['Year'].' '.$search_year.' )' ; + + $idname = 'myChart_'.$kreport.'_'.$ktype ; + $ctxname = 'ctx_'.$idname ; + $configname = 'config_'.$idname ; + + $datasets = [] ; + + switch ( $ktype ){ + + case 'late' : + case 'complete' : + + foreach ( $vtype['sub'] as $ksub => $vsub ){ + $temp = [] ; + foreach ( $vsub['lists'] as $klist => $vlist ){ + $temp[] = "$vlist" ; + } + + $datasets[] = [ + 'label' => $vsub['name'], + 'data' => $temp + ] ; + } + + $html .= ' +
+ +
+ ' ; + + break ; + + case 'department' : + + foreach ( $departments_name as $kdepartment => $vdepartment ){ + $temp = [] ; + foreach ( $vtype['sub'][$kdepartment] as $klist => $vlist ){ + $temp[] = "$vlist" ; + } + + $datasets[] = [ + 'label' => $vdepartment, + 'data' => $temp + ] ; + } + + $html .= ' +
+ +
+ ' ; + + break ; + + } + + } + + } + } + + $html .= ' +
+ + ' ; + } + +} + + + + +if ( $array['iswebview'] == 'yes' ){ + echo $html ; + exit ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/report copy.php b/apiv3/services/tasks/report copy.php new file mode 100644 index 0000000..8667b51 --- /dev/null +++ b/apiv3/services/tasks/report copy.php @@ -0,0 +1,248 @@ + [ + 'late' => [ + 'name' => $lang['On Time Or Delayed Report'], + 'subname' => $months_name, + 'sub' => [ + 'no' => [ 'name' => $lang['On Time'], 'months' => $months ], + 'yes' => [ 'name' => $lang['Delayed'], 'months' => $months ] + ] + ], + 'complete' => [ + 'name' => $lang['Completed Or Incompleted Report'], + 'subname' => $months_name, + 'sub' => [ + 'yes' => [ 'name' => $lang['Completed'], 'months' => $months ], + 'no' => [ 'name' => $lang['Incompleted'], 'months' => $months ], + 'cancel' => [ 'name' => $lang['Cancelled'], 'months' => $months ] + ] + ] + ] + ] ; + if ( $staff_settings['reporttaskbranch'] == 'yes' ){ + $array_report['branch'] = [ + 'late' => [ + 'name' => $lang['On Time Or Delayed Report'], + 'subname' => $months_name, + 'sub' => [ + 'no' => [ 'name' => $lang['On Time'], 'months' => $months ], + 'yes' => [ 'name' => $lang['Delayed'], 'months' => $months ] + ] + ], + 'complete' => [ + 'name' => $lang['Completed Or Incompleted Report'], + 'subname' => $months_name, + 'sub' => [ + 'yes' => [ 'name' => $lang['Completed'], 'months' => $months ], + 'no' => [ 'name' => $lang['Incompleted'], 'months' => $months ], + 'cancel' => [ 'name' => $lang['Cancelled'], 'months' => $months ] + ] + ], + ] ; + } + + $filtertype = [] ; + foreach ( $array_report as $k => $v ){ + if ( $k == $search_type ){ + $filtertype[] = $k ; + } + } + + foreach ( $filtertype as $k => $v ){ + + $search_query = " AND ( a.created_branch_id = '".$array['branch_id']."' XXXXXX )" ; + switch ( $v ){ + case 'personal' : + $search_query = str_replace( 'XXXXXX', " AND a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 )", $search_query ) ; + break ; + case 'branch' : + $search_query = str_replace( 'XXXXXX', '', $search_query ) ; + break ; + } + + + // late report + $select_task = $mysqli->query( "SELECT COUNT(a.is_late) as total, a.is_late, MONTH(a.confirmed_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status = 'approved' AND a.confirmed_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY a.is_late, MONTH(a.confirmed_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['late']['sub'][$row_task['is_late']]['months'][$row_task['month']] = $row_task['total'] ; + } + } + + + // complete report + $select_task = $mysqli->query( "SELECT COUNT(a.status) as total, MONTH(a.created_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'approved' ) AND a.created_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY MONTH(a.created_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['complete']['sub']['yes']['months'][$row_task['month']] = $row_task['total'] ; + } + } + + + // incomplete report + $select_task = $mysqli->query( "SELECT COUNT(a.status) as total, MONTH(a.created_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'pending','assigned','resubmit','progress','completed','confirmed' ) AND a.created_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY MONTH(a.created_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['complete']['sub']['no']['months'][$row_task['month']] = $row_task['total'] ; + } + } + + + // cancel report + $select_task = $mysqli->query( "SELECT COUNT(a.status) as total, MONTH(a.created_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'rejected', 'cancelled' ) AND a.created_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY MONTH(a.created_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['complete']['sub']['cancel']['months'][$row_task['month']] = $row_task['total'] ; + } + } + } + + + + // direct echo + if ( $array['iswebview'] == 'yes' ){ + + $html .= ' + + + + + + + + + + +
+ +
+ + + + '. $search_year .' + + + +
' ; + + if ( count($array_report) > 1 ){ + $html .= ' + ' ; + } + + foreach ( $array_report as $kreport => $vreport ){ + + if ( $kreport == $search_type ){ + + foreach ( $vreport as $ktype => $vtype ){ + + $title = $vtype['name'] ; + $titlename = $title.' ( '.$lang['Year'].' '.$search_year.' )' ; + + $idname = 'myChart_'.$kreport.'_'.$ktype ; + $ctxname = 'ctx_'.$idname ; + $configname = 'config_'.$idname ; + + $datasets = [] ; + foreach ( $vtype['sub'] as $ksub => $vsub ){ + + $temp = [] ; + foreach ( $vsub['months'] as $kmonth => $vmonth ){ + $temp[] = $vmonth ; + } + + $datasets[] = [ + 'label' => $vsub['name'], + 'data' => $temp + ] ; + } + + $html .= ' +
+ +
+ ' ; + + } + + } + } + + $html .= ' +
+ + ' ; + } + +} + + + + +if ( $array['iswebview'] == 'yes' ){ + echo $html ; + exit ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/report.php b/apiv3/services/tasks/report.php new file mode 100644 index 0000000..c4c73c0 --- /dev/null +++ b/apiv3/services/tasks/report.php @@ -0,0 +1,361 @@ + $months ] ; + $departments_name = [ '0' => [ 'desc' => $lang['Cross Department'], 'colour' => '#EB5406' ] ] ; + $select_departments = $mysqli->query( "SELECT a.department_id, a.department_colour, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select_departments->num_rows > 0 ){ + while ( $row_departments = $select_departments->fetch_assoc() ){ + $departments[$row_departments['department_id']] = $months ; + $departments_name[$row_departments['department_id']] = [ + 'desc' => dataFilter( $row_departments['department_desc'] ), + 'colour' => $row_departments['department_colour'] + ] ; + } + } + + // monthly report = by personal or whole branch + $array_report = [ + 'personal' => [ + // 'late' => [ + // 'name' => $lang['On Time Or Delayed Report'], + // 'subname' => $months_name, + // 'sub' => [ + // 'no' => [ 'name' => $lang['On Time'], 'lists' => $months ], + // 'yes' => [ 'name' => $lang['Delayed'], 'lists' => $months ] + // ] + // ], + 'complete' => [ + 'name' => $lang['Completed Or Incompleted Report'], + 'subname' => $months_name, + 'sub' => [ + 'yes' => [ 'name' => $lang['Completed'], 'lists' => $months ], + 'no' => [ 'name' => $lang['Incompleted'], 'lists' => $months ], + 'cancel' => [ 'name' => $lang['Cancelled'], 'lists' => $months ] + ] + ], + 'department' => [ + 'name' => $lang['Department Task Given Report'], + 'subname' => $months_name, + 'sub' => $departments + ] + ] + ] ; + if ( $staff_settings['reporttaskbranch'] == 'yes' ){ + $array_report['branch'] = [ + // 'late' => [ + // 'name' => $lang['On Time Or Delayed Report'], + // 'subname' => $months_name, + // 'sub' => [ + // 'no' => [ 'name' => $lang['On Time'], 'lists' => $months ], + // 'yes' => [ 'name' => $lang['Delayed'], 'lists' => $months ] + // ] + // ], + 'complete' => [ + 'name' => $lang['Completed Or Incompleted Report'], + 'subname' => $months_name, + 'sub' => [ + 'yes' => [ 'name' => $lang['Completed'], 'lists' => $months ], + 'no' => [ 'name' => $lang['Incompleted'], 'lists' => $months ], + 'cancel' => [ 'name' => $lang['Cancelled'], 'lists' => $months ] + ] + ], + 'department' => [ + 'name' => $lang['Department Task Given Report'], + 'subname' => $months_name, + 'sub' => $departments + ] + ] ; + } + + $filtertype = [] ; + foreach ( $array_report as $k => $v ){ + if ( $k == $search_type ){ + $filtertype[] = $k ; + } + } + + foreach ( $filtertype as $k => $v ){ + + $search_query = " AND ( a.created_branch_id = '".$array['branch_id']."' XXXXXX )" ; + switch ( $v ){ + case 'personal' : + $search_query = str_replace( 'XXXXXX', " AND a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 )", $search_query ) ; + break ; + case 'branch' : + $search_query = str_replace( 'XXXXXX', '', $search_query ) ; + break ; + } + + + + + // late report + // $select_task = $mysqli->query( "SELECT COUNT(a.is_late) as total, a.is_late, MONTH(a.confirmed_at) as month FROM task a + // WHERE a.deleted_at IS NULL AND a.status = 'approved' AND a.confirmed_at LIKE '%".$search_year."%' ".$search_query." + // GROUP BY a.is_late, MONTH(a.confirmed_at)" ) ; + // if ( $select_task->num_rows > 0 ){ + // while ( $row_task = $select_task->fetch_assoc() ){ + // $array_report[$v]['late']['sub'][$row_task['is_late']]['lists'][$row_task['month']] = $row_task['total'] ; + // } + // } + + + + + // complete report + $select_task = $mysqli->query( "SELECT COUNT(a.status) as total, MONTH(a.created_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'approved' ) AND a.created_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY MONTH(a.created_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['complete']['sub']['yes']['lists'][$row_task['month']] = $row_task['total'] ; + } + } + + + // incomplete report + $select_task = $mysqli->query( "SELECT COUNT(a.status) as total, MONTH(a.created_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'pending','assigned','resubmit','progress','completed','confirmed' ) AND a.created_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY MONTH(a.created_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['complete']['sub']['no']['lists'][$row_task['month']] = $row_task['total'] ; + } + } + + + // cancel report + $select_task = $mysqli->query( "SELECT COUNT(a.status) as total, MONTH(a.created_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'rejected', 'cancelled' ) AND a.created_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY MONTH(a.created_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['complete']['sub']['cancel']['lists'][$row_task['month']] = $row_task['total'] ; + } + } + + + + + + + // department complete report + $select_task = $mysqli->query( "SELECT COUNT(a.department_id) as total, a.department_id, MONTH(a.confirmed_at) as month FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'approved' ) AND a.confirmed_at LIKE '%".$search_year."%' ".$search_query." + GROUP BY a.department_id, MONTH(a.confirmed_at)" ) ; + if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $array_report[$v]['department']['sub'][$row_task['department_id']][$row_task['month']] = $row_task['total'] ; + } + } + } + + + // direct echo + if ( $array['iswebview'] == 'yes' ){ + + $html .= ' + + + + + + + + + + +
+ +
+ + + + '. $search_year .' + + + +
' ; + + if ( count($array_report) > 1 ){ + $html .= ' + ' ; + } + + foreach ( $array_report as $kreport => $vreport ){ + + if ( $kreport == $search_type ){ + + foreach ( $vreport as $ktype => $vtype ){ + + $title = $vtype['name'] ; + $titlename = $title.' ( '.$lang['Year'].' '.$search_year.' )' ; + + $idname = 'myChart_'.$kreport.'_'.$ktype ; + $ctxname = 'ctx_'.$idname ; + $configname = 'config_'.$idname ; + + $datasets = [] ; + + switch ( $ktype ){ + + case 'late' : + case 'complete' : + + $count_color = 0 ; + foreach ( $vtype['sub'] as $ksub => $vsub ){ + $temp = [] ; + foreach ( $vsub['lists'] as $klist => $vlist ){ + $temp[] = "$vlist" ; + } + + $datasets[] = [ + 'label' => $vsub['name'], + 'data' => $temp, + 'backgroundColor' => $colors[$count_color] + ] ; + + $count_color++ ; + } + + $html .= ' +
+ +
+ ' ; + + break ; + + case 'department' : + + $count_color = 0 ; + foreach ( $departments_name as $kdepartment => $vdepartment ){ + $temp = [] ; + foreach ( $vtype['sub'][$kdepartment] as $klist => $vlist ){ + $temp[] = "$vlist" ; + } + + $datasets[] = [ + 'label' => $vdepartment['desc'], + 'data' => $temp, + 'backgroundColor' => $vdepartment['colour'] + ] ; + + $count_color++ ; + } + + $html .= ' +
+ +
+ ' ; + + break ; + + } + + } + + } + } + + $html .= ' +
+ + ' ; + } + +} + + + + +if ( $array['iswebview'] == 'yes' ){ + echo $html ; + exit ; +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/select.php b/apiv3/services/tasks/select.php new file mode 100644 index 0000000..2b0aa39 --- /dev/null +++ b/apiv3/services/tasks/select.php @@ -0,0 +1,240 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = $row['department_desc'] ; + } + } + + // select all staff + $staff_list = [] ; + $select = $mysqli->query( "SELECT a.staff_id, a.staff_name, a.staff_shortname, a.staff_idno, a.staff_tier FROM staff a + WHERE a.deleted_at IS NULL" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $get_staff_tier = $all_tier[$row['staff_tier']] ; + + $staff_list[$row['staff_id']] = $row['staff_shortname'] . ' ( '.$row['staff_idno'].' / '.strtoupper( $get_staff_tier['title'] ).')' ; + } + } + + + // default parameter + $isupdate = 'no' ; + $iscancel = 'no' ; + $isreject = 'no' ; + $isassigned = 'no' ; + + $search_query = '' ; + $search_query .= " AND task_id = '".$array['task_id']."'" ; + + $query = "SELECT task_id, task_type, task_so, title, department_id, created_by, assigned_by, difficulty, date_start, date_end, remark, incentive, incentive2, extra, rating, todo_list, todo_done, status, created_at, updated_at FROM task + WHERE deleted_at IS NULL " . $search_query ; + $mysqli_query = $mysqli->query( $query . " LIMIT 1" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $row = $mysqli_query->fetch_assoc() ; + $task_type_name = '' ; + switch ( $row['task_type'] ){ + case '1time' : $task_type_name = 'One Time Only' ; break ; + case 'daily' : $task_type_name = 'Daily Update' ; break ; + case 'weekly' : $task_type_name = 'Weekly Update' ; break ; + case 'monthly' : $task_type_name = 'Monthly Update' ; break ; + case 'yearly' : $task_type_name = 'Yearly Update' ; break ; + } + + $row['title'] = dataFilter( $row['title'] ) ; + $row['task_type_name'] = $task_type_name ; + $row['expired'] = strtotime( $row['date_end'] . ' 23:59:59' ) ; + $row['is_warning'] = ( $row['date_end'] == TODAYDAY ? 'yes' : 'no' ) ; + + $row['department_name'] = checkExists( $department_list[ $row['department_id'] ] ) ; + $row['created_by_name'] = checkExists( $staff_list[ $row['created_by'] ] ) ; + $row['assigned_by_name'] = checkExists( $staff_list[ $row['assigned_by'] ] ) ; + $row['progress'] = ( $row['todo_done'] > $row['todo_list'] ? ( numberFormat( ( $row['todo_done'] / $row['todo_list'] * 100 ), 2 ) + 0 ) : 0 ) ; + + + + + // get all joinstaff + $joinstaff_list = [] ; + $select_joinstaff = $mysqli->query( "SELECT staff_id FROM task_joinstaff + WHERE task_id = '".$array['task_id']."'" ) ; + if ( $select_joinstaff->num_rows > 0 ){ + while ( $row_joinstaff = $select_joinstaff->fetch_assoc() ){ + $joinstaff_list[] = [ + 'id' => $row_joinstaff['staff_id'], + 'title' => $staff_list[ $row_joinstaff['staff_id'] ] + ] ; + + if ( $row_joinstaff['staff_id'] == $staff_info['staff_id'] ){ + $isreject = 'yes' ; + } + } + } + $row['joinstaffs'] = $joinstaff_list ; + + + + + // get all todo remark + $todo_remark_list = [] ; + $select_task_todo_remark = $mysqli->query( "SELECT * FROM task_todo_remark + WHERE deleted_at IS NULL AND task_id = '".$array['task_id']."'" ) ; + if ( $select_task_todo_remark->num_rows > 0 ){ + while ( $row_todo_remark = $select_task_todo_remark->fetch_assoc() ){ + $todo_remark_list[$row_todo_remark['todo_id']][] = [ + 'id' => $row_todo_remark['remark_id'], + 'title' => dataFilter( $row_todo_remark['title'] ), + 'is_delete' => 'no' + ] ; + } + } + + // get all todo task + $todo_list = [] ; + $select_task_todo = $mysqli->query( "SELECT * FROM task_todo + WHERE deleted_at IS NULL AND task_id = '".$array['task_id']."' + ORDER BY sortable ASC, todo_id ASC" ) ; + if ( $select_task_todo->num_rows > 0 ){ + while ( $row_todo = $select_task_todo->fetch_assoc() ){ + $todo_list[] = [ + 'id' => $row_todo['todo_id'], + 'title' => dataFilter( $row_todo['title'] ), + 'is_done' => $row_todo['is_done'], + 'done_by' => $row_todo['done_by'], + 'done_name' => $staff_list[ $row_todo['done_by'] ], + 'done_at' => $row_todo['done_at'], + 'is_delete' => 'no', + 'remark' => ( checkExists( $todo_remark_list[$row_todo['todo_id']] ) ? $todo_remark_list[$row_todo['todo_id']] : [] ) + ] ; + } + } + $row['todo_list'] = $todo_list ; + + + + + + // get all reject + $rejected_list = [] ; + $select_rejected = $mysqli->query( "SELECT * FROM task_rejected + WHERE deleted_at IS NULL AND task_id = '".$array['task_id']."'" ) ; + if ( $select_rejected->num_rows > 0 ){ + while ( $row_rejected = $select_rejected->fetch_assoc() ){ + $rejected_list[] = [ + 'id' => $row_rejected['reject_id'], + 'title' => dataFilter( $row_rejected['remark'] ), + 'staff_name' => $staff_list[ $row_rejected['staff_id'] ], + 'created_at' => $row_rejected['created_at'] + ] ; + } + } + $row['rejected_list'] = $rejected_list ; + + + + + + // get all media + $select_media = $mysqli->query( "SELECT media_id, file, filetype FROM task_media + WHERE deleted_at IS NULL AND task_id = '".$array['task_id']."' AND todo_id = '".$array['todo_id']."'" ) ; + $photos = [] ; + $attachments = [] ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + switch ( $row_media['filetype'] ){ + case 'jpg' : + case 'jpeg' : + case 'png' : + $photos[] = [ + 'media_id' => $row_media['media_id'], + 'type' => 'online', + 'filetype' => $row_media['filetype'], + 'file' => ( $row_media['file'] != '' ? PATH.'uploads/Task/b/'.$row_media['file'] : '' ) + ] ; + break ; + default : + $attachments[] = [ + 'media_id' => $row_media['media_id'], + 'type' => 'online', + 'filetype' => $row_media['filetype'], + 'file' => ( $row_media['file'] != '' ? PATH.'uploads/Task/'.$row_media['file'] : '' ) + ] ; + } + } + } + + $row['photos'] = $photos ; + $row['attachments'] = $attachments ; + + + + // check update permission + // check cancel permission + switch ( $row['status'] ){ + case 'pending' : + case 'assigned' : + case 'resubmit' : + case 'progress' : + case 'completed' : + case 'confirmed' : + if ( $row['created_by'] == $staff_info['staff_id'] ){ + $isupdate = 'yes' ; + $iscancel = 'yes' ; + } + break ; + } + $row['isupdate'] = $isupdate ; + $row['iscancel'] = $iscancel ; + + // check reject permission + switch ( $row['status'] ){ + case 'pending' : + case 'assigned' : + case 'resubmit' : + case 'progress' : + case 'completed' : + if ( $row['assigned_by'] == $staff_info['staff_id'] ){ + $isreject = 'yes' ; + } + break ; + case 'confirmed' : + if ( $row['created_by'] == $staff_info['staff_id'] ){ + $isreject = 'yes' ; + } + break ; + } + $row['isreject'] = $isreject ; + + // check assign permission + if ( $staff_info['staff_tier_is_task_assigned'] == 'yes' ){ + $isassigned = 'yes' ; + } + $row['isassigned'] = $isassigned ; + + $data = $row ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/update-todo.php b/apiv3/services/tasks/update-todo.php new file mode 100644 index 0000000..8f08717 --- /dev/null +++ b/apiv3/services/tasks/update-todo.php @@ -0,0 +1,81 @@ + 0 ){ + $status = '201' ; + + $select = $mysqli->query( "SELECT * FROM task a + WHERE a.deleted_at IS NULL AND a.task_id = '".$task_id."' AND ( a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 ) ) AND a.status IN ( 'pending', 'assigned', 'resubmit', 'progress', 'completed' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '202' ; + + $row = $select->fetch_assoc() ; + + $count_todo_list = 0 ; + $count_todo_done = 0 ; + if ( checkExists($array['todo_list']) ){ + foreach ( $array['todo_list'] as $k => $v ){ + if ( $v['is_delete'] == 'no' ){ + $count_todo_list++ ; + + if ( $v['is_done'] == 'yes' ){ + $count_todo_done++ ; + } + } + } + } + + if ( checkExists($array['todo_list']) ){ + foreach ( $array['todo_list'] as $k => $v ){ + if ( $v['is_done'] == 'yes' ){ + $mysqli->query( "UPDATE task_todo SET + is_done = 'yes', + done_by = '".$staff_info['staff_id']."', + done_at = '".TODAYDATE."' + WHERE todo_id = '".$v['id']."' AND is_done = 'no'" ) ; + } + } + } + + $update_status = 'pending' ; + if ( $row['assigned_by'] > 0 ){ + $update_status = 'assigned' ; + } + if ( $count_todo_done > 0 ){ + $update_status = 'progress' ; + } + if ( $count_todo_list == $count_todo_done ){ + $update_status = 'completed' ; + } + + if ( $mysqli->query( "UPDATE task SET + status = '".$update_status."', + todo_done = '".$count_todo_done."' + WHERE task_id = '".$task_id."'" ) ) { + $status = '200' ; + + // push to notification + $related_staffid = getTaskRelatedStaff( $task_id, $row['created_by'], $row['assigned_by'] ) ; + foreach ( $related_staffid as $k => $v ){ + pushToUserCron( 'task', $task_id, $v, 'Task Todo', 'Task ( '.$row['task_so'].' ) todo has been updated' ) ; + } + + } + + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/update.php b/apiv3/services/tasks/update.php new file mode 100644 index 0000000..61cae82 --- /dev/null +++ b/apiv3/services/tasks/update.php @@ -0,0 +1,176 @@ + 0 || count( $joinstaffs ) > 0 ){ + $status = '303' ; + + $staff_tier = [] ; + $staff_tier = getRelatedTierID( 'no', $staff_info['staff_tier_level'] ) ; + + + $related_staffs = [] ; + if ( $array['assigned_by'] > 0 ){ + $related_staffs[$array['assigned_by']] = $array['assigned_by'] ; + } + if ( count( $joinstaffs ) > 0 ){ + foreach ( $joinstaffs as $k => $v ){ + $related_staffs[$v['id']] = $v['id'] ; + } + } + + $select_staff = $mysqli->query( "SELECT a.staff_id, a.staff_idno, a.staff_name, a.staff_shortname, a.staff_tier FROM staff a + WHERE a.deleted_at IS NULL AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL ) AND staff_id IN ( '".implode("', '", $related_staffs)."' ) AND staff_tier IN ( '".implode("', '", $staff_tier)."' )" ) ; + + if ( $select_staff->num_rows == count( $related_staffs ) ){ + + $status = '201' ; + + $count_todo_list = 0 ; + $count_todo_done = 0 ; + if ( checkExists($array['todo_list']) ){ + if ( count($array['todo_list']) > 0 ){ + foreach ( $array['todo_list'] as $k => $v ){ + if ( $v['is_delete'] == 'no' ){ + $count_todo_list++ ; + + if ( $v['is_done'] == 'yes' ){ + $count_todo_done++ ; + } + } + } + } + } + + // check update status + $task_status = 'pending' ; + if ( $array['assigned_by'] > 0 && count( $joinstaffs ) > 0 ){ + $task_status = 'assigned' ; + } + + // check if task id exsits + $boolean_submit = false ; + if ( $task_id > 0 ){ + + $select = $mysqli->query( "SELECT * FROM task + WHERE deleted_at IS NULL AND task_id = '".$task_id."' AND created_by = '".$staff_info['staff_id']."' AND status IN ( 'pending', 'assigned', 'resubmit', 'progress', 'completed', 'confirmed' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '202' ; + + $row = $select->fetch_assoc() ; + + if ( $mysqli->query( "UPDATE task SET + task_type = '".$array['task_type']."', + title = '".$array['title']."', + department_id = '".$array['department_id']."', + assigned_by = '".$array['assigned_by']."', + difficulty = '".$array['difficulty']."', + date_start = '".$array['date_start']."', + date_end = '".$array['date_end']."', + remark = '".$array['remark']."', + incentive = '".$array['incentive']."', + todo_list = '".$count_todo_list."', + todo_done = '".$count_todo_done."' + WHERE task_id = '".$task_id."'" ) ) { + $boolean_submit = true ; + $is_updated = true ; + + $push_staffid[$array['assigned_by']] = $array['assigned_by'] ; + } + } + + }else{ + $status = '203' ; + + if ( $mysqli->query( "INSERT INTO task + ( `task_type`, `title`, `department_id`, `created_branch_id`, `created_by`, `assigned_by`, `difficulty`, `date_start`, `date_end`, `remark`, `incentive`, `todo_list`, `todo_done`, `status` ) VALUES + ( '".$array['task_type']."', '".$array['title']."', '".$array['department_id']."', '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$array['assigned_by']."', '".$array['difficulty']."', '".$array['date_start']."', '".$array['date_end']."', '".$array['remark']."', '".$array['incentive']."', '".$count_todo_list."', '".$count_todo_done."', '".$task_status."' )" ) ){ + $boolean_submit = true ; + $task_id = $mysqli->insert_id ; + + $task_so = 'PT'.strPad( 6, $task_id ) ; + $mysqli->query( "UPDATE task SET + task_so = '".$task_so."' + WHERE task_id = '".$task_id."'" ) ; + + $push_staffid[$staff_info['staff_id']] = $staff_info['staff_id'] ; + $push_staffid[$array['assigned_by']] = $array['assigned_by'] ; + } + + } + + if ( $boolean_submit ){ + $status = '203' ; + + // deleted all related staff + $mysqli->query( "DELETE FROM `task_joinstaff` WHERE task_id = '".$task_id."'" ) ; + if ( checkExists($joinstaffs) ){ + foreach ( $joinstaffs as $k => $v ){ + $mysqli->query( "INSERT INTO `task_joinstaff` ( `task_id`, `staff_id` ) VALUES ( '".$task_id."', '".$v['id']."' )" ) ; + $push_staffid[$v['id']] = $v['id'] ; + } + } + + + if ( checkExists($array['todo_list']) ){ + if ( count($array['todo_list']) > 0 ){ + foreach ( $array['todo_list'] as $k => $v ){ + if ( $v['is_delete'] == 'no' ){ + if ( $v['id'] > 0 ){ + $mysqli->query( "UPDATE task_todo SET title = '".$v['title']."' WHERE todo_id = '".$v['id']."'" ) ; + }else{ + $mysqli->query( "INSERT INTO task_todo ( `task_id`, `title`, `sortable` ) VALUES ( '".$task_id."', '".$v['title']."', '9999' )" ) ; + } + }else{ + if ( $v['id'] > 0 ){ + $mysqli->query( "UPDATE task_todo SET deleted_at = '".TODAYDATE."' WHERE todo_id = '".$v['id']."'" ) ; + } + } + } + } + } + + $status = '200' ; + + // push to notification + foreach ( $push_staffid as $k => $v ){ + if ( $is_updated ){ + pushToUserCron( 'task', $task_id, $v, 'Task Updated', 'Task ( '.$row['task_so'].' ) has been updated' ) ; + }else{ + pushToUserCron( 'task', $task_id, $v, 'Task Created', 'New task ( '.$task_so.' ) appoint to you' ) ; + } + } + + } + } + + } + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/tasks/upload.php b/apiv3/services/tasks/upload.php new file mode 100644 index 0000000..cc39da7 --- /dev/null +++ b/apiv3/services/tasks/upload.php @@ -0,0 +1,68 @@ + 0 || count( $attachments ) > 0 ) ){ + $status = '201' ; + + $select = $mysqli->query( "SELECT * FROM task a + WHERE a.deleted_at IS NULL AND a.task_id = '".$task_id."' AND ( a.created_by = '".$staff_info['staff_id']."' OR a.assigned_by = '".$staff_info['staff_id']."' OR EXISTS ( SELECT b.staff_id FROM task_joinstaff b WHERE a.task_id = b.task_id AND b.staff_id = '".$staff_info['staff_id']."' LIMIT 1 ) ) AND a.status IN ( 'pending', 'assigned', 'resubmit', 'progress', 'completed', 'confirmed' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '201' ; + + $row = $select->fetch_assoc() ; + + $select = $mysqli->query( "SELECT * FROM task_todo + WHERE deleted_at IS NULL AND task_id = '".$task_id."' AND todo_id = '".$todo_id."' LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '205' ; + + $row_todo = $select->fetch_assoc() ; + + if ( checkExists($photos) || checkExists($attachments) ){ + + foreach ( [ $photos, $attachments ] as $upload_key => $upload_value ){ + foreach ( $upload_value as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'Task', $task_id.'-'.$todo_id, $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $mysqli->query( "INSERT INTO task_media + ( task_id, todo_id, file, filetype ) VALUES + ( '".$task_id."', '".$todo_id."', '".$upload['data']['file_name']."', '".$upload['data']['file_type']."' )" ) ; + $status = '200' ; + } + } + } + } + + if ( $status == '200' ){ + // push to notification + $related_staffid = getTaskRelatedStaff( $task_id, $row['created_by'], $row['assigned_by'] ) ; + foreach ( $related_staffid as $k => $v ){ + pushToUserCron( 'task', $task_id, $v, 'Task Uploaded', 'Task ( '.$row['task_so'].' ) file uploaded' ) ; + } + } + + } + + } + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/trainings/confirm.php b/apiv3/services/trainings/confirm.php new file mode 100644 index 0000000..034a8dd --- /dev/null +++ b/apiv3/services/trainings/confirm.php @@ -0,0 +1,53 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '248' ; + + $row = $mysqli_query->fetch_assoc() ; + + $is_training = 'no' ; + if ( $row['status'] == 'active' ){ + if ( $row['training_type'] == 'all' || ( $row['training_type'] == 'date' && $row['date_start'] <= TODAYDAY && $row['date_end'] >= TODAYDAY ) ){ + $is_training = 'yes' ; + } + } + + if ( $is_training == 'yes' ){ + $status = '254' ; + + $staff_training = $mysqli->query( "SELECT * FROM staff_training + WHERE deleted_at IS NULL AND training_id = '".$array['id']."' AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' LIMIT 1" ) ; + if ( $staff_training->num_rows == 0 ){ + $status = '200' ; + + $mysqli->query( "INSERT INTO staff_training + ( training_id, branch_id, staff_id, status ) VALUES + ( '".$array['id']."', '".$array['branch_id']."', '".$staff_info['staff_id']."', 'pending' ) " ) ; + + $view_id = $mysqli->insert_id ; + $training_so = 'TN'.strPad( 6, $view_id ) ; + + $mysqli->query( "UPDATE staff_training SET training_so = '".$training_so."' WHERE view_id = '".$view_id."'" ) ; + + } + + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/trainings/details.php b/apiv3/services/trainings/details.php new file mode 100644 index 0000000..68be693 --- /dev/null +++ b/apiv3/services/trainings/details.php @@ -0,0 +1,60 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + $generatecode = generateQrcode( '', $row['training_so'], $row['training_so'] ) ; + + $row = $mysqli_query->fetch_assoc() ; + $row['id'] = dataFilter( $row['training_id'] ) ; + $row['sonumber'] = dataFilter( $row['training_so'] ) ; + $row['qrcode'] = $generatecode['url'] ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Training/b/'.$row['file'] : '' ) ; + + $is_training = 'no' ; + if ( $row['status'] == 'active' ){ + if ( $row['training_type'] == 'all' || ( $row['training_type'] == 'date' && $row['date_start'] <= TODAYDAY && $row['date_end'] >= TODAYDAY ) ){ + $is_training = 'yes' ; + } + } + $row['is_training'] = $is_training ; + $row['date_start'] = resetDateFormat( $row['date_start'] ) ; + $row['date_end'] = resetDateFormat( $row['date_end'] ) ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $row['training_status'] = ( checkExists( $row['training_status'] ) != '' ? $row['training_status'] : '') ; + $row['training_remark'] = dataFilter( checkExists( $row['training_remark'] ) != '' ? $row['training_remark'] : '') ; + $row['training_rated'] = dataFilter( checkExists( $row['training_rated'] ) != '' ? $row['training_rated'] : 0) ; + $row['training_comment'] = dataFilter( checkExists( $row['training_comment'] ) != '' ? $row['training_comment'] : '') ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/trainings/gallery-category.php b/apiv3/services/trainings/gallery-category.php new file mode 100644 index 0000000..a20c73c --- /dev/null +++ b/apiv3/services/trainings/gallery-category.php @@ -0,0 +1,35 @@ +query( $query . " ORDER BY a.sortable" ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['category_id'] = dataFilter( $row['category_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/trainings/gallery-list.php b/apiv3/services/trainings/gallery-list.php new file mode 100644 index 0000000..42c3618 --- /dev/null +++ b/apiv3/services/trainings/gallery-list.php @@ -0,0 +1,46 @@ +query( $query . " ".$query_sortable." LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['date'] = resetDateFormat( $row['created_at'] ) ; + $row['time'] = resetTimeFormat( $row['created_at'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/TrainingGallery/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/trainings/gallery-upload.php b/apiv3/services/trainings/gallery-upload.php new file mode 100644 index 0000000..d37162f --- /dev/null +++ b/apiv3/services/trainings/gallery-upload.php @@ -0,0 +1,35 @@ + 0 ){ + if ( checkExists($photos) ){ + foreach ( $photos as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'TrainingGallery', time(), $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $mysqli->query( "INSERT INTO training_gallery + ( branch_id, staff_id, title, file, filetype ) VALUES + ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$title."', '".$upload['data']['file_name']."', '".$upload['data']['file_type']."' )" ) ; + $status = '200' ; + } + } + } + } + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/trainings/is-going.php b/apiv3/services/trainings/is-going.php new file mode 100644 index 0000000..74daf99 --- /dev/null +++ b/apiv3/services/trainings/is-going.php @@ -0,0 +1,40 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + + $mysqli->query( "UPDATE staff_training SET + is_going = '".$array['is_going']."', + status = '".$update_status."' + WHERE view_id = '".$array['view_id']."'" ) ; + + } + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/trainings/lists.php b/apiv3/services/trainings/lists.php new file mode 100644 index 0000000..8a29bc7 --- /dev/null +++ b/apiv3/services/trainings/lists.php @@ -0,0 +1,67 @@ += '".TODAYDAY."' ) )" ; + break ; + case 'previous' : + $join_filter = ", c.view_id, c.status as training_status" ; + $join_query = "LEFT JOIN staff_training c ON ( a.training_id = c.training_id )" ; + $search_query .= " AND c.branch_id = '".$array['branch_id']."' AND c.staff_id = '".$staff_info['staff_id']."'" ; + $query_sortable = "ORDER BY view_id DESC" ; + break ; + case 'expired' : + $search_query .= " AND a.branch LIKE '%/".$array['branch_id']."/%' AND ( a.status = 'inactive' OR ( a.training_type = 'date' AND a.date_start <= '".TODAYDAY."' AND NOT ( a.date_end >= '".TODAYDAY."' ) ) )" ; + break ; + } + } + + $query = "SELECT a.training_id, a.training_type, a.date_start, a.date_end, a.file, a.created_at, b.title ".$join_filter." FROM training a + LEFT JOIN training_translation b ON ( a.training_id = b.training_id ) + ".$join_query." + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ".$query_sortable." LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['training_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['date_start'] = resetDateFormat( $row['date_start'] ) ; + $row['date_end'] = resetDateFormat( $row['date_end'] ) ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $row['training_status'] = ( checkExists( $row['training_status'] ) != '' ? $row['training_status'] : '' ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/Training/b/'.$row['file'] : '' ) ; + $list[] = $row ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/trainings/rating.php b/apiv3/services/trainings/rating.php new file mode 100644 index 0000000..7d594f4 --- /dev/null +++ b/apiv3/services/trainings/rating.php @@ -0,0 +1,47 @@ +query( $query ) ; + + if ( $mysqli_query->num_rows > 0 ){ + $status = '308' ; + + $row = $mysqli_query->fetch_assoc() ; + + if ( $row['status'] == 'confirmed' ){ + $status = '200' ; + + $mysqli->query( "UPDATE staff_training SET + rated = '".$array['training_rated']."', + comment = '".$array['training_comment']."', + status = 'rated' + WHERE view_id = '".$array['view_id']."'" ) ; + + $remark = 'Review training ( '.$row['training_so'].' ) to get points' ; + pointMovement( 'training', $array['view_id'], '1time', 'normal', $row['staff_id'], 0, $remark ) ; + pushToUserCron( 'staff_training', $array['view_id'], $row['staff_id'], 'Review Point', $remark ) ; + + } + + } + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/visitors/details.php b/apiv3/services/visitors/details.php new file mode 100644 index 0000000..dc5b464 --- /dev/null +++ b/apiv3/services/visitors/details.php @@ -0,0 +1,59 @@ +query( "SELECT * FROM visitor + WHERE deleted_at IS NULL AND visitor_id = '".$id."' AND branch = '".$array['branch_id']."' AND status IN ( 'pending', 'tested-approved' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + + $status = '200' ; + + $row_visitor = $select->fetch_assoc() ; + + // get branch name + $branch_name = '' ; + $mysqli_query = "SELECT branch_id, branch_name FROM branch + WHERE branch_id = '".$row_visitor['branch']."' LIMIT 1" ; + $mysqli_branch = $mysqli->query($mysqli_query) ; + if ( $mysqli_branch->num_rows > 0 ){ + $row_branch = $mysqli_branch->fetch_assoc() ; + $branch_name = $row_branch['branch_name'] ; + } + + $data = [ + 'visitor_id' => dataFilter( $row_visitor['visitor_id'] ), + 'appointment_date' => date( 'Y-m-d H:iA', strtotime( $row_visitor['visited_at'] ) ) . ' ~ ' . date( 'Y-m-d H:iA', strtotime( $row_visitor['visited_at_to'] ) ), + 'branch_name' => dataFilter( $branch_name ), + 'visitor_category' => ucwords( dataFilter( $row_visitor['category'] ) ), + 'visitor_name' => dataFilter( $row_visitor['name'] ), + 'contact_number' => dataFilter( $row_visitor['mobile'] ), + 'email' => dataFilter( $row_visitor['email'] ), + 'nric_passport' => dataFilter( $row_visitor['identity'] ), + 'nationality' => dataFilter( $row_visitor['nationality'] ), + 'visitor_company' => ucwords( dataFilter( $row_visitor['visitor_company'] ) ), + 'car_plate' => dataFilter( $row_visitor['car_plate'] ), + 'reason_to_visit' => dataFilter( $row_visitor['reason'] ), + 'contact_person' => dataFilter( $row_visitor['contact_person'] ), + 'status' => dataFilter( $row_visitor['status'] ) + ] ; + + } + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/visitors/lists.php b/apiv3/services/visitors/lists.php new file mode 100644 index 0000000..f3c7361 --- /dev/null +++ b/apiv3/services/visitors/lists.php @@ -0,0 +1,66 @@ += '".TODAYDATE."' ) )" ; + break ; + case 'history' : + $search_query .= " AND ( status = 'tested-rejected' OR ( status = 'visited' AND visited_at_to < '".TODAYDATE."' ) )" ; + break ; + } + + if ( $array['search'] != '' ){ + $search_query .= " AND ( category LIKE '%".$array['search']."%' OR name LIKE '%".$array['search']."%' OR mobile LIKE '%".$array['search']."%' OR email LIKE '%".$array['search']."%' OR visitor_company LIKE '%".$array['search']."%' )" ; + } + + $query = "SELECT visitor_id, branch, category, name, mobile, email, identity, nationality, visitor_company, status, visited_at, visited_at_to, created_at FROM visitor a + WHERE deleted_at IS NULL AND branch = '".$array['branch_id']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ORDER BY visitor_id DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + while ( $row_visitor = $mysqli_query->fetch_assoc() ){ + $list[] = [ + 'visitor_id' => dataFilter( $row_visitor['visitor_id'] ), + 'appointment_date' => date( 'Y-m-d H:iA', strtotime( $row_visitor['visited_at'] ) ) . ' ~ ' . date( 'Y-m-d H:iA', strtotime( $row_visitor['visited_at_to'] ) ), + 'visitor_category' => ucwords( dataFilter( $row_visitor['category'] ) ), + 'visitor_name' => dataFilter( $row_visitor['name'] ), + 'contact_number' => dataFilter( $row_visitor['mobile'] ), + 'email' => dataFilter( $row_visitor['email'] ), + 'nric_passport' => dataFilter( $row_visitor['identity'] ), + 'nationality' => dataFilter( $row_visitor['nationality'] ), + 'visitor_company' => ucwords( dataFilter( $row_visitor['visitor_company'] ) ), + 'status' => dataFilter( $row_visitor['status'] ), + 'created_at' => resetDateFormat( $row_visitor['created_at'] ) + ] ; + } + + $data['list'] = $list ; + + } + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/services/visitors/status.php b/apiv3/services/visitors/status.php new file mode 100644 index 0000000..cc5df1e --- /dev/null +++ b/apiv3/services/visitors/status.php @@ -0,0 +1,100 @@ +query( "SELECT * FROM visitor + WHERE deleted_at IS NULL AND visitor_id = '".$id."' AND branch = '".$array['branch_id']."' AND status IN ( 'pending', 'tested-approved' ) LIMIT 1" ) ; + if ( $select->num_rows > 0 ){ + $status = '299' ; + + $row = $select->fetch_assoc() ; + + $branch_hr_contact = '' ; + $branch_hr_email = '' ; + $branch_hr_cc = [] ; + $branch_email_footer = '' ; + $mysqli_query = "SELECT branch_hr_email, branch_hr_cc, branch_hr_contact, branch_email_footer FROM branch WHERE + deleted_at IS NULL AND branch_id = '".$row['branch']."' LIMIT 1" ; + $mysqli_branch = $mysqli->query($mysqli_query) ; + if ( $mysqli_branch->num_rows > 0 ){ + $row_branch = $mysqli_branch->fetch_assoc() ; + $branch_hr_contact = dataFilter( $row_branch['branch_hr_contact'] ) ; + $branch_hr_email = dataFilter( $row_branch['branch_hr_email'] ) ; + $branch_hr_cc = explodeToArray( $row_branch['branch_hr_cc'] ) ; + $branch_email_footer = entityDecode( dataFilter( $row_branch['branch_email_footer'] ) ) ; + } + + $boolean_update = false ; + $title = '' ; + $body = '' ; + $body_sms = '' ; + if ( $updatestatus == 'tested-approved' ){ + $boolean_update = true ; + $title = 'Visitor Confirmation' ; + + // send email / sms + $body = 'Dear valued visitor, good day. Your application form has been approved.

Kindly present your QR code to us during the visitation date via below link: '.PATH.'visitation/qrcode.php?visitor_id='.$id.'&token='.setSecret( $id ).'.

Thank you and have a nice day.

by ' . COMPANY ; + $body_sms = 'Dear valued visitor, good day. Your application form has been approved. Kindly present your QR code to us during the visitation date via below link: '.PATH.'visitation/qrcode.php?visitor_id='.$id.'&token='.setSecret( $id ).' Thank you and have a nice day.' ; + } + + if ( $updatestatus == 'tested-rejected' ){ + $boolean_update = true ; + $title = 'Visitor Rejected' ; + $body = 'Dear valued visitor, good day. Sorry to inform that your visitation request has been rejected.

by ' . COMPANY ; + $body_sms = 'Dear valued visitor, good day. Sorry to inform that your visitation request has been rejected.' ; + } + + if ( $boolean_update ){ + $status = '202' ; + + if ( $mysqli->query( "UPDATE visitor SET + status = '".$updatestatus."' + WHERE visitor_id = '".$id."'" ) ){ + + $status = '200' ; + + $mailer = new Mailer() ; + $mailer->from = $branch_hr_email ; + $mailer->to = [ $row['email'] ] ; + if ( count($branch_hr_cc) > 0 ){ + $mailer->cc = $branch_hr_cc ; + } + $mailer->subject = $title ; + $mailer->body = $body ; + $mailer->send() ; + + if ( substr( $row['mobile'], 0, 2 ) == '60' || substr( $row['mobile'], 0, 3 ) == '+60' || + substr( $row['mobile'], 0, 2 ) == '65' || substr( $row['mobile'], 0, 3 ) == '+65' ){ + $sms = new Sms() ; + $sms->to = $row['mobile'] ; + $sms->message = $body_sms ; + $sms->send() ; + } + + } + + } + + } + + } + +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/apiv3/versions/index.php b/apiv3/versions/index.php new file mode 100644 index 0000000..189f8a5 --- /dev/null +++ b/apiv3/versions/index.php @@ -0,0 +1,39 @@ +query( "SELECT version, url, is_update FROM versions a + WHERE a.platform = '".$array['platform']."' LIMIT 1" ) ; + +$status = '200' ; +$screens = [] ; + +$data = [ + 'version' => '', + 'url' => '', + 'is_update' => 'no' +] ; +if ( $select->num_rows > 0 ){ + $data = $select->fetch_assoc() ; +} + +if ( $array['islogin'] == 'no' ){ + $select = $mysqli->query( "SELECT a.file, b.title, b.content FROM app_screen a + LEFT JOIN app_screen_translation b ON ( a.screen_id = b.screen_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' ORDER BY a.sortable" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/AppScreen/b/'.$row['file'].'?v='.filemtime( $_SERVER["DOCUMENT_ROOT"].'/uploads/AppScreen/b/'.$row['file'] ) : '' ) ; + $screens[] = $row ; + } + } +} + +$data['screens'] = $screens ; + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/app-adjustment-group.php b/app-adjustment-group.php new file mode 100644 index 0000000..cbb5be2 --- /dev/null +++ b/app-adjustment-group.php @@ -0,0 +1,269 @@ +query("SELECT * FROM setting_adjustment_group + WHERE group_id = '".$group_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $group_id == '' ){ + $mysqli->query( "INSERT INTO setting_adjustment_group + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $group_id = $mysqli->insert_id ; + } + + // update database + $mysqli->query( "UPDATE setting_adjustment_group SET + title = '".escapeString($_POST['title'])."' + WHERE group_id = '".$group_id."'" ) ; + + // refresh page + header("Location:app-adjustment-group.php?page_mode=edit&group_id=".$group_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'adjustment-group-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'adjustment-group-update') ) ){ + header('Location: app-adjustment-group.php') ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'app-adjustment-group-new') ) ){ + header('Location: index.php') ; + exit ; + } + + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
Title
+
+ +
+
+ +
+
+
+ + + +
+
+ +
+
+
+
+ + + query( $mysqli_query." ORDER BY a.group_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
ActionTitleCreated Date
' ; + if ( permissionCheck($row_user, 'adjustment-update') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['title']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-adjustment.php b/app-adjustment.php new file mode 100644 index 0000000..a504ab2 --- /dev/null +++ b/app-adjustment.php @@ -0,0 +1,440 @@ +query("SELECT * FROM setting_adjustment + WHERE adjustment_id = '".$adjustment_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $adjustment_id == '' ){ + $mysqli->query( "INSERT INTO setting_adjustment + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $adjustment_id = $mysqli->insert_id ; + } + + $set_tier = [] ; + foreach ( $_POST['set_tier'] as $k => $v ){ + $set_tier[] = $v ; + } + + // update database + $mysqli->query( "UPDATE setting_adjustment SET + adjustment_group = '".escapeString($_POST['adjustment_group'])."', + adjustment_site = '".escapeString($_POST['adjustment_site'])."', + adjustment_type = '".escapeString($_POST['adjustment_type'])."', + adjustment_scenario = '".escapeString($_POST['adjustment_scenario'])."', + adjustment_times = '".escapeString($_POST['adjustment_times'])."', + set_tier = '|".implode( '|', $set_tier )."|', + adjustment_mode = '".escapeString($_POST['adjustment_mode'])."', + point = '".escapeString($_POST['point'])."' + WHERE adjustment_id = '".$adjustment_id."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'setting_adjustment_translation', 'adjustment_id', $adjustment_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-adjustment.php?page_mode=edit&adjustment_id=".$adjustment_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'adjustment-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'adjustment-update') ) ){ + header('Location: app-adjustment.php') ; + exit ; + } + + // get all requires + // get all adjustment group + $group_list = [] ; + $mysqli_group = $mysqli->query("SELECT * FROM setting_adjustment_group + WHERE deleted_at IS NULL") ; + if ( $mysqli_group->num_rows > 0 ){ + while ( $row_group = $mysqli_group->fetch_assoc() ){ + $group_list[] = $row_group ; + } + } + + // get all tier + $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 ; + } + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'app-adjustment-new') ) ){ + header('Location: index.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
Group
+
+ +
+
+
+
Site
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Type
+
+ +
+
+
+
Mode
+
+ +
+
+
+
Scenario
+
+ +
+
+
+
Times
+
+ +
+
+
+
Point
+
+ +
+
+ + +
+
Tier
+
+ +
+
+ + +
+
+
+ + + +
+
+ +
+
+
+
+ + + query( $mysqli_query." ORDER BY a.adjustment_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + echo ' + + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + + ' ; + } + ?> + +
ActionSiteTitleTypeModePointCreated Date
' ; + if ( permissionCheck($row_user, 'adjustment-update') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.ucwords($row_page['adjustment_site']).''.dataFilter($row_page['title']).''.ucwords($row_page['adjustment_type']).''.ucwords($row_page['adjustment_mode']).''.dataFilter($row_page['point']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-association-category.php b/app-association-category.php new file mode 100644 index 0000000..719d58d --- /dev/null +++ b/app-association-category.php @@ -0,0 +1,405 @@ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check permission +if ( !permissionCheck($row_user, 'association-category-view') ){ + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch( $page_mode ){ + + // edit association category + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM association_category + WHERE category_id = '".$category_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $category_id == '' ){ + $mysqli->query( "INSERT INTO association_category + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $category_id = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ( $remove_photo == 1 ){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('AssociationCategory', $category_id, $category_id, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // update database + $mysqli->query( "UPDATE association_category SET + ".$image_query." + branch = '/".implode('/', $array_branch)."/', + status = '".escapeString($_POST['status'])."' + WHERE category_id = '".$category_id."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'association_category_translation', 'category_id', $category_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-association-category.php?page_mode=edit&category_id=".$category_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'association-category-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'association-category-edit') ) ){ + header('Location: app-association-category.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
Status
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+
+ + + query( $mysqli_query." ORDER BY a.category_id DESC LIMIT $start_from, " . LIMIT ) ; + + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['category_id'] ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Created Date
' ; + if ( permissionCheck($row_user, 'association-category-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['title']).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-association-gallery-category.php b/app-association-gallery-category.php new file mode 100644 index 0000000..68edf2e --- /dev/null +++ b/app-association-gallery-category.php @@ -0,0 +1,335 @@ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check permission +if ( !permissionCheck($row_user, 'association-list-gallery-category') ){ + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch( $page_mode ){ + + // edit association category + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM association_gallery_category + WHERE category_id = '".$category_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $category_id == '' ){ + $mysqli->query( "INSERT INTO association_gallery_category + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $category_id = $mysqli->insert_id ; + } + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // update database + $mysqli->query( "UPDATE association_gallery_category SET + branch = '/".implode('/', $array_branch)."/', + status = '".escapeString($_POST['status'])."' + WHERE category_id = '".$category_id."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'association_gallery_category_translation', 'category_id', $category_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-association-gallery-category.php?page_mode=edit&category_id=".$category_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Status
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+
+ + + query( $mysqli_query." ORDER BY a.category_id DESC LIMIT $start_from, " . LIMIT ) ; + + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ +
+
+ + + + +
+
+ +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['category_id'] ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + + ' ; + } + ?> + +
Created Date
+ + '.dataFilter($row_page['title']).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-association-gallery-view.php b/app-association-gallery-view.php new file mode 100644 index 0000000..a7efecd --- /dev/null +++ b/app-association-gallery-view.php @@ -0,0 +1,124 @@ +query("SELECT a.gallery_id, a.category_id, a.title, a.file, a.status, a.created_at, a.updated_at, b.staff_id, b.staff_idno, b.staff_name FROM association_gallery a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.gallery_id = '".$gallery_id."' LIMIT 1"); +if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; +}else{ + exit ; +} + +// update database +if ( $_POST['hide'] == 1 ){ + + // update database + $mysqli->query( "UPDATE association_gallery SET + category_id = '".escapeString($_POST['category_id'])."' + WHERE gallery_id = '".$gallery_id."'" ) ; + + // refresh page + header("Location:app-association-gallery-view.php?page_mode=edit&gallery_id=".$gallery_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; +} + +// start header here +include 'requires/page_header.php'; +include 'requires/page_top.php'; +?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
Staff ID
+
+ +
+
+
+
Title
+
+ +
+
+
+
Status
+
+ +
+
+ +
+
Category
+
+ +
+
+ +
+
+
+ + + +
+
+
+
+
+ + + $vv ){ + $mysqli->query( "UPDATE association_gallery SET + status = '".$update_status."' + WHERE gallery_id = '".$kk."'" ) ; + + if ( $update_status == 'rejected' ){ + pushToUserCron( 'association_gallery', $kk, $vv, 'Association Gallery', 'Association gallery has been reject.' ) ; + }else{ + pushToUserCron( 'association_gallery', $kk, $vv, 'Association Gallery', 'Association gallery has been update.' ) ; + } + } + + header( "Refresh: 0;" ) ; + exit ; +} + + + +//query +$search_query = '' ; +$search_name = escapeString($_GET['search_name']) ; +$search_idno = escapeString($_GET['search_idno']) ; +$search_status = escapeString($_GET['search_status']) ; +$search_date = ( $_GET['search_date'] != '' ? date('Y-m-d', strtotime($_GET['search_date'])) : '' ) ; + +$search_query = '' ; + +if ( $search_name != ''){ + $search_query .= " AND b.staff_name LIKE '%".$search_name."%'" ; +} +if ( $search_idno != ''){ + $search_query .= " AND b.staff_idno LIKE '%".$search_idno."%'" ; +} +if ( $search_status != ''){ + $search_query .= " AND a.status = '".$search_status."'" ; +} +if ( $search_date != '' ){ + $search_query .= " AND a.created_at LIKE '%".$search_date."%'" ; +} + +// related staff +// pagination +if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) +$start_from = ($product_page - 1) * LIMIT ; //end next and prev page + +// set search url +$search_url = 'search_name='.$search_name.'&search_idno='.$search_idno.'&search_status='.$search_status.'&search_date='.$search_date ; + +// page query +$mysqli_query = "SELECT a.gallery_id, a.title, a.file, a.status, a.created_at, a.updated_at, b.staff_id, b.staff_idno, b.staff_name FROM association_gallery a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL " . $search_query . $user_branch_permission_sql_b ; +$mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.gallery_id DESC LIMIT $start_from, " . LIMIT ) ; + +// load pagination +$page_pagination = nextPrevious( $product_page, LIMIT, $search_url, $mysqli_query ) ; + +// start header here +include 'requires/page_header.php'; +include 'requires/page_top.php'; +?> + +
+
+ + +
+ +
+
+ + + + +
+
+ +
+
Join Staff
+
+ + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_list = $mysqli_list->fetch_assoc() ){ + $image = ( $row_list['file'] != '' ? PATH.'uploads/AssociationGallery/'.dataFilter($row_list['file']) : '' ) ; + + echo ' + + + + + + + + + + '; + } + }else{ + echo + ' + + + + + + + + + '; + } + ?> + +
ActionImageStaff IDTitleStatusCreated AtUpdated At
' ; + if ( $row_list['status'] == 'pending' ){ + echo ' +
+ + +
' ; + } + echo ' +
+ + '.( $image != '' ? '' : '' ).''.dataFilter($row_list['staff_name']).' ( '.dataFilter($row_list['staff_idno']).' )'.dataFilter($row_list['title']).''.resetStatus($row_list['status']).''.resetDateFormat($row_list['created_at']).''.resetDateFormat($row_list['updated_at']).'
No data.
+ +
+
+
+
+
+ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check permission +if ( !permissionCheck($row_user, 'association-list-view') ){ + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch($page_mode){ + + // edit association + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM association + WHERE association_id = '".$association_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $association_id == '' ){ + $mysqli->query( "INSERT INTO association + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $association_id = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('Association', $association_id, $association_id, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // update database + $mysqli->query( "UPDATE association SET + ".$image_query." + branch = '/".implode('/', $array_branch)."/', + category_id = '".escapeString($_POST['category_id'])."', + association_type = '".escapeString($_POST['association_type'])."', + date_start = '".escapeString($_POST['date_start'])."', + date_end = '".escapeString($_POST['date_end'])."', + status = '".escapeString($_POST['status'])."' + WHERE association_id = '".$association_id."'" ) ; + + $title_en = '' ; + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + if ( $klang == 'en' ){ $title_en = $title ; } + + checkLangUpdate( 'association_translation', 'association_id', $association_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'content' => [ 'type' => 'input', 'value' => $content ] + ] ) ; + } + + if ( $submit_type == 'new' ){ + pushToBranchUser( $array_branch, [], 'association', $association_id, 'New Association', ( $title_en != '' ? $title_en : 'New association has been submitted.' ) ) ; + } + + // refresh page + header("Location:app-association.php?page_mode=edit&association_id=".$association_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'association-list-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'association-list-edit') ) ){ + header('Location: app-association.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+
+
Category
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'content' => [ + 'type' => 'textarea', + 'title' => $lang['Content'] + ] + ]) ; + ?> + +
+
Association Type
+
+ +
+
+
+
Date Start
+
+ +
+
+
+
Date End
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
Status
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+
+ + + query("SELECT a.association_id, b.title, b.content FROM association a + LEFT JOIN association_translation b ON ( a.association_id = b.association_id ) + WHERE a.association_id = '".$association_id."' LIMIT 1"); + if ( $mysqli_page->num_rows == 0 ){ + exit ; + } + + $row_page = $mysqli_page->fetch_assoc() ; + + // update database + if ( $_POST['hide'] == 1 ){ + $update_status = escapeString( $_POST['update_status'] ) ; + + foreach ( $_POST['multiple_status'] as $kk => $vv ){ + $mysqli->query( "UPDATE staff_association SET status = '".$update_status."' WHERE view_id = '".$kk."'" ) ; + + if ( $update_status == 'rejected' ){ + pushToUserCron( 'staff_association', $kk, $vv, 'Association', 'Association has been reject.' ) ; + }else{ + pushToUserCron( 'staff_association', $kk, $vv, 'Association', 'Association has been update.' ) ; + } + } + + header( "Refresh: 0;" ) ; + exit ; + } + + + //query + $search_query = '' ; + $search_name = escapeString($_GET['search_name']) ; + $search_idno = escapeString($_GET['search_idno']) ; + $search_rated = escapeString($_GET['search_rated']) ; + $search_date = ( $_GET['search_date']!= '' ? date('Y-m-d', strtotime($_GET['search_date'])) : '' ) ; + $search_type = $_GET['search_type'] ; + $export_excel = $_GET['export-excel']; + + $search_query = ''; + + if( $search_name != ''){ + $search_query .= " AND b.staff_name LIKE '%".$search_name."%'" ; + } + if( $search_idno != ''){ + $search_query .= " AND b.staff_idno LIKE '%".$search_idno."%'" ; + } + if( $search_rated != ''){ + $search_query .= " AND a.rated = '".$search_rated."'" ; + } + if ( $search_date != '' ){ + $search_query .= " AND a.created_at >= '".$search_date."' " ; + } + // search query + if ($search != ''){ + $search_query .= " AND ( title LIKE '%".$search."%' )" ; + } + if( $search_type != ''){ + $search_query .= " AND a.status = '".$search_type."' " ; + } + + + // related staff + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = '&page_mode='.$page_mode.'&association_id='.$association_id.'search='.$search.'&search_name='.$search_name.'&search_rated='.$search_rated.'&search_date='.$search_date.'&search_idno='.$search_idno; + // page query + $mysqli_query = "SELECT a.view_id, a.association_so, a.association_id, a.rated, a.comment, a.status, a.created_at, a.updated_at, b.staff_id, b.staff_idno, b.staff_name, b.staff_image, c.title FROM staff_association a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + LEFT JOIN association_translation c ON ( a.association_id = c.association_id ) + WHERE a.deleted_at IS NULL AND c.lang = 'en' AND a.association_id = '".$association_id."' " . $search_query ; + + $mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.view_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + + + if ( $export_excel == 'export_eae' ){ + + $page_export_file_name = 'Association Report-'; + + $array_header_excel = array( + 'No.', + 'SO Number', + 'ID', + 'Name', + 'Rated', + 'Comment', + 'Association', + 'Status', + 'Created At', + 'Updated At' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + $count_mysqli_export_page = 0; + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + $count_mysqli_export_page ++; + $array_body_excel[] = array( + $count_mysqli_export_page, + $mysqli_export_page['association_so'], + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + $mysqli_export_page['comment'], + $mysqli_export_page['rated'], + dataFilter($mysqli_export_page['title']), + $mysqli_export_page['status'], + date('Y-m-d', strtotime($mysqli_export_page['created_at'])), + date('Y-m-d', strtotime($mysqli_export_page['updated_at'])) + ) ; + } + $count_mysqli_export_page = 0; + } + + include 'export_excel_default.php'; + + } + + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ +
+ + query( $mysqli_query." ORDER BY a.view_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + if ( $export_excel == 'export_eae' ){ + + $page_export_file_name = 'Association List-'; + + $array_header_excel = array( + 'No.', + 'SO Number', + 'ID', + 'Name', + 'Association', + 'Status', + 'Created At', + 'Updated At' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + $count_mysqli_export_page = 0; + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + $count_mysqli_export_page ++; + $array_body_excel[] = array( + $count_mysqli_export_page, + $mysqli_export_page['association_so'], + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + dataFilter($mysqli_export_page['title']), + $mysqli_export_page['status'], + date('Y-m-d', strtotime($mysqli_export_page['created_at'])), + date('Y-m-d', strtotime($mysqli_export_page['updated_at'])) + ) ; + } + $count_mysqli_export_page = 0; + } + + include 'export_excel_default.php'; + + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + +
+
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ + +
+
Join Staff
+
+ + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_list = $mysqli_list->fetch_array(MYSQLI_ASSOC) ){ + $staff_image = ( $row_list['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_list['staff_image']) : '' ) ; + + echo ' + + + + + + + + + + '; + } + }else{ + echo + ' + + + + + + + + + '; + } + ?> + +
So NumberProfileStaff IDNameAssociationStatusCreated AtUpdated At
'.dataFilter($row_list['association_so']).''.( $staff_image != '' ? '' : '' ).''.dataFilter($row_list['staff_idno']).''.dataFilter($row_list['staff_name']).''.dataFilter($row_list['title']).''.resetStatus($row_list['status']).''.resetDateFormat($row_list['created_at']).''.resetDateFormat($row_list['updated_at']).'
No data.
+ +
+
+
+
+ + query( "SELECT association_id, status FROM staff_association + WHERE deleted_at IS NULL AND association_so = '".$qrcode."' LIMIT 1" ) ; + + if ( $select->num_rows > 0 ){ + $error = 'Invalid status' ; + + $row = $select->fetch_assoc() ; + + if ( $row['status'] == 'approved' ){ + $error = 'Success' ; + + $mysqli->query( "UPDATE staff_association SET + status = 'confirmed' + WHERE association_id = '".$row['association_id']."'" ) ; + } + } + } + + $_SESSION['system_result'] = $error ; + header( "Refresh: 0;" ) ; + exit ; + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search ; + + // page query + $mysqli_query = "SELECT a.association_so, a.created_at, a.updated_at, c.staff_idno, c.staff_name FROM staff_association a + LEFT JOIN association b ON ( a.association_id = b.association_id ) + LEFT JOIN staff c ON ( a.staff_id = c.staff_id ) + WHERE a.deleted_at IS NULL AND a.status = 'confirmed' " . $search_query ; + $mysqli_page = $mysqli->query( $mysqli_query." ORDER BY a.view_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+ + +
+ + +
+
+
+
+
Scan Qrde
+
+ +
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ + + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_assoc() ){ + echo ' + + + + + + + '; + } + } + ?> + +
So NumberStaff IDStaff NameCreated DateUpdated Date
'.dataFilter($row_page['association_so']).''.dataFilter($row_page['staff_idno']).''.dataFilter($row_page['staff_name']).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).'
+ +
+
+
+
+
+ + query( $mysqli_query." ORDER BY a.association_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
search
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_assoc() ){ + + $staff_association = $mysqli->query( "SELECT view_id FROM staff_association + WHERE deleted_at IS NULL AND association_id = '".$row_page['association_id']."' AND status IN ( 'pending' )" ) ; + $total_association = $staff_association->num_rows ; + + echo ' + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + ' ; + } + ?> + +
PeriodCreated Date
'; + if ( permissionCheck($row_user, 'association-list-edit') ){ + echo ' + |'; + } + echo ' + ( '.$total_association.' ) + '.dataFilter($row_page['title']).''.resetDateFormat($row_page['date_start']).' ~ '.resetDateFormat($row_page['date_end']).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-catalog-maincategory.php b/app-catalog-maincategory.php new file mode 100644 index 0000000..d4e28eb --- /dev/null +++ b/app-catalog-maincategory.php @@ -0,0 +1,308 @@ +query("SELECT * FROM catalog_category + WHERE category_id = '".$page."' AND category_type = 'main' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO catalog_category ( category_type, created_at ) VALUES ( 'main', '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('CatalogCategory', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + // update database + $mysqli->query("UPDATE catalog_category SET + ".$image_query." + title = '".escapeString($_POST['title'])."', + sortable = '".escapeString($_POST['sortable'])."', + updated_at = '".TODAYDATE."' + WHERE category_id = '".$page."'") ; + + // refresh page + header("Location:app-catalog-maincategory.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+
+
+
+ +
+
+ +
+
Sortable
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+
+
+
+
+
+ query($mysqli_query." ORDER BY category_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+ +
+
+ + + + +
+
+ +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['category_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
+ + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-catalog-subcategory.php b/app-catalog-subcategory.php new file mode 100644 index 0000000..985c92a --- /dev/null +++ b/app-catalog-subcategory.php @@ -0,0 +1,327 @@ +query("SELECT * FROM catalog_category + WHERE category_id = '".$page."' AND category_type = 'sub' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO catalog_category ( category_type, created_at ) VALUES ( 'sub', '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('CatalogCategory', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + // update database + $mysqli->query("UPDATE catalog_category SET + ".$image_query." + category_parent = '".escapeString($_POST['category_parent'])."', + title = '".escapeString($_POST['title'])."', + sortable = '".escapeString($_POST['sortable'])."', + updated_at = '".TODAYDATE."' + WHERE category_id = '".$page."'") ; + + // refresh page + header("Location:app-catalog-subcategory.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+
+
+
+ +
+
+ +
+
Sortable
+
+ +
+
+ +
+
Main Category
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+
+
+
+
+
+ query($mysqli_query." ORDER BY category_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+ +
+
+ + + + +
+
+ +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['category_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
+ + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-catalog.php b/app-catalog.php new file mode 100644 index 0000000..21d4b2f --- /dev/null +++ b/app-catalog.php @@ -0,0 +1,398 @@ +query("SELECT * FROM catalog + WHERE catalog_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO catalog ( created_at ) VALUES ( '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ( $remove_photo == 1 ){ + $image = '' ; + $image_query = "file = '', + file_type = ''," ; + }else{ + if ( $image != '' ){ + $get_image = pathinfo($image) ; + if ( $get_image['extension'] == 'pdf' ){ + + $file_name = $page.'-'.time().'.pdf' ; + copy($_FILES["image"]["tmp_name"], 'uploads/Catalog/'.$file_name) ; + + $image_query= "file = '".$file_name."', + file_type = 'pdf'," ; + }else{ + $create_image = reCreateImage('Catalog', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + + $image_query = "file = '".$create_image['image']."', + file_type = '".$create_image['extension']."'," ; + } + } + } + } + + // update database + $mysqli->query("UPDATE catalog SET + ".$image_query." + category_id = '".escapeString($_POST['category_id'])."', + title = '".escapeString($_POST['title'])."', + sortable = '".escapeString($_POST['sortable'])."', + view_format = '".escapeString($_POST['view_format'])."', + content = '".escapeString($_POST['content'])."', + video_url = '".escapeString($_POST['video_url'])."', + updated_at = '".TODAYDATE."' + WHERE catalog_id = '".$page."'") ; + + // refresh page + header("Location:app-catalog.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+ +
+
Sub Category
+
+ +
+
+ +
+
Sortable
+
+ +
+
+ +
+
Format
+
+ + + +
+
+ +
> +
Photo
+
+
+
+ + + +
+
+
+
+
> +
Preview
+
+  Remove pdf + Download' ; + }else{ + echo ' + ' ; + } + ?> +
+
+
> +
Message
+
+ + +
+
+
> +
Video
+
+ +
+
+ + +
+
+
+ + + +
+
+
+
+
+
+ + query($mysqli_query." ORDER BY catalog_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+ +
+
+ + + + +
+
+ +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['catalog_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
+ + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-difficulty.php b/app-difficulty.php new file mode 100644 index 0000000..94080b4 --- /dev/null +++ b/app-difficulty.php @@ -0,0 +1,338 @@ +query("SELECT * FROM setting_difficulty + WHERE difficulty_id = '".$difficulty_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $difficulty_id == '' ){ + $mysqli->query( "INSERT INTO setting_difficulty + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $difficulty_id = $mysqli->insert_id ; + } + + $set_tier = [] ; + foreach ( $_POST['set_tier'] as $k => $v ){ + $set_tier[] = $v ; + } + + // update database + $mysqli->query( "UPDATE setting_difficulty SET + code = '".escapeString($_POST['code'])."', + set_tier = '|".implode( '|', $set_tier )."|' + WHERE difficulty_id = '".$difficulty_id."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'setting_difficulty_translation', 'difficulty_id', $difficulty_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-difficulty.php?page_mode=edit&difficulty_id=".$difficulty_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'app-difficulty-new') ) && $page_mode == 'edit' ){ + header('Location: app-difficulty.php') ; + exit ; + } + + // get all requires + + // get all tier + $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 ; + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Code
+
+ +
+
+ +
+
Tier
+
+ +
+
+ + +
+
+
+ + + +
+
+ + +
+
+
+ + + query( $mysqli_query." ORDER BY a.difficulty_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+ + + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
ActionCodeTitleCreated Date
' ; + if ( permissionCheck($row_user, 'difficulty-update') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.$row_page['code'].''.dataFilter($row_page['title']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-form-headcount.php b/app-form-headcount.php new file mode 100644 index 0000000..439c695 --- /dev/null +++ b/app-form-headcount.php @@ -0,0 +1,494 @@ +query("SELECT * FROM formheadcount + WHERE formheadcount_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // update database + $mysqli->query( "UPDATE formheadcount SET + comment = '".escapeString($_POST['comment'])."', + status = '".escapeString($_POST['status'])."' + WHERE formheadcount_id = '".$page."'" ) ; + + if ( $row_page['status'] != $_POST['status'] ){ + pushToUserCron( 'formheadcount', $page, $row_page['staff_id'], 'Headcount Requisition', 'Headcount Requisition has been update.' ) ; + } + + // refresh page + header("Location:app-form-headcount.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'form-headcount-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'form-headcount-edit') ) ){ + header('Location: app-form-headcount.php') ; + exit ; + } + + // get all media + $media_list = [] ; + $mysqli_media = $mysqli->query( "SELECT file, filetype FROM formheadcount_media + WHERE deleted_at IS NULL AND formheadcount_id = '".$page."'" ) ; + if ( $mysqli_media->num_rows > 0 ){ + while ( $row_media = $mysqli_media->fetch_assoc() ){ + $media_list[] = $row_media ; + } + } + + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query( "SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
Staff
+
+ +
+
+ +
+
Title
+
+ +
+
+
+
Content
+
+ +
+
+ + + + +
+
+
+ $row_image ){ ?> + + ' ; + break ; + default : + echo ' + + ' ; + } + ?> + +
+
+ + +
+ +
+
Status
+
+ +
+
+ +
+
Comment
+
+ + +
+
+ + +
+
+
+ + + +
+
+ + +
+
+
+ + + query( $mysqli_query." ORDER BY a.formheadcount_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + if ( $export_excel == 'export_eae' ){ + + $page_export_file_name = 'Headcount Requisition Report-'; + + $array_header_excel = array( + 'No.', + 'ID', + 'Name', + 'Subject', + 'Status', + 'Created Date', + 'Updated Date' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + $count_mysqli_export_page = 0; + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + $count_mysqli_export_page ++; + $array_body_excel[] = array( + $count_mysqli_export_page, + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + $mysqli_export_page['title'], + $mysqli_export_page['status'], + date('Y-m-d', strtotime($mysqli_export_page['created_at'])), + date('Y-m-d', strtotime($mysqli_export_page['updated_at'])) + ) ; + } + $count_mysqli_export_page = 0; + } + + include 'export_excel_default.php'; + + } + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+ + + +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ + +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['formheadcount_id'] ; + + echo ' + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + ' ; + } + ?> + +
' ; + if ( permissionCheck($row_user, 'form-formheadcount-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['staff_name']).' ( '.dataFilter($row_page['staff_idno']).' )'.dataFilter($row_page['title']).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).''.resetStatus($row_page['status']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-form-maincategory.php b/app-form-maincategory.php new file mode 100644 index 0000000..8db6e9d --- /dev/null +++ b/app-form-maincategory.php @@ -0,0 +1,340 @@ +query("SELECT * FROM form_category + WHERE category_id = '".$page."' AND category_type = 'main' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO form_category ( category_type, created_at ) VALUES ( 'main', '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('FormCategory', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + // update database + $mysqli->query("UPDATE form_category SET + ".$image_query." + sortable = '".escapeString($_POST['sortable'])."', + updated_at = '".TODAYDATE."' + WHERE category_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'form_category_translation', 'category_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-form-maincategory.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Sortable
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+
+
+
+ + query($mysqli_query." ORDER BY a.category_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+ + + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ +
+
+ + + + +
+
+ +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['category_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
+ + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-form-nomination-question.php b/app-form-nomination-question.php new file mode 100644 index 0000000..20c6722 --- /dev/null +++ b/app-form-nomination-question.php @@ -0,0 +1,417 @@ +query("SELECT a.password_id, a.content FROM app_password a LEFT JOIN app_password_translation b ON ( a.password_id = b.password_id ) WHERE a.deleted_at IS NULL AND a.password_type = 'nomination' AND b.lang = 'en'"); +if ($mysqli_ck_password->num_rows > 0) { + $row_ck_password = $mysqli_ck_password->fetch_array(); +} +if ($_SESSION['nomination_password'] == '' ){ + echo ''; +} +if($_SESSION['nomination_password'] != $row_ck_password['content']) { + unset($_SESSION['nomination_password']); + echo ''; +} + +// keep parameter in value +$page = escapeString($_GET['page']) ; +$page_mode = escapeString($_GET['page_mode']) ; +$type = escapeString($_GET['type']) ; +$search = escapeString($_GET['search']) ; +$question_id = escapeString($_GET['question_id']) ; + +// active menu bar +$active_main_menu = 'service' ; +$active_sub_menu = 'form-submission-question' ; +$active_menu = 'form-nomination-question-list' ; + +// get all branch +$branch_all = [] ; +$get_branch = $mysqli->query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check permission +if ( !permissionCheck($row_user, 'form-nomination-question-view') ){ + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch( $page_mode ){ + + // edit nomination question + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM formnomination_question + WHERE question_id = '".$question_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $question_id == '' ){ + $mysqli->query( "INSERT INTO formnomination_question + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $question_id = $mysqli->insert_id ; + } + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // update database + $mysqli->query( "UPDATE formnomination_question SET + ".$image_query." + branch = '/".implode('/', $array_branch)."/', + nomination_type = '".escapeString($_POST['nomination_type'])."', + question_type = '".escapeString($_POST['question_type'])."', + sortable = '".escapeString($_POST['sortable'])."' + WHERE question_id = '".$question_id."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'formnomination_question_translation', 'question_id', $question_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'content' => [ 'type' => 'textarea', 'value' => escapeString( $_POST['content_'.$klang] ) ], + 'questions' => [ 'type' => 'input', 'value' => escapeString( $_POST['questions_'.$klang] ) ] + ] ) ; + } + + // refresh page + header("Location:app-form-nomination-question.php?page_mode=edit&question_id=".$question_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'form-nomination-question-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'form-nomination-question-edit') ) ){ + header('Location: app-form-nomination-question.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'content' => [ + 'type' => 'input', + 'title' => $lang['Content'] + ], + 'questions' => [ + 'type' => 'input', + 'title' => $lang['Questions'] + ] + ]) ; + ?> + +
+
Nomination Type
+
+ +
+
+
+
Type
+
+ +
+
+
+
Sortable
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+ + + query( $mysqli_query." ORDER BY a.question_id ASC LIMIT $start_from, " . LIMIT ) ; + + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+ + + +
+
+
+
+
+ +
+ +
+
+
+
Type
+
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['question_id'] ; + + echo ' + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + ' ; + } + ?> + +
Nomination TypeCreated Date
' ; + if ( permissionCheck($row_user, 'form-nomination-question-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.ucwords($row_page['nomination_type']).''.ucwords($row_page['question_type']).''.dataFilter($row_page['title']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-form-nomination.php b/app-form-nomination.php new file mode 100644 index 0000000..08a5ba9 --- /dev/null +++ b/app-form-nomination.php @@ -0,0 +1,645 @@ +query("SELECT a.password_id, a.content FROM app_password a LEFT JOIN app_password_translation b ON ( a.password_id = b.password_id ) WHERE a.deleted_at IS NULL AND a.password_type = 'nomination' AND b.lang = 'en'"); +if ($mysqli_ck_password->num_rows > 0) { + $row_ck_password = $mysqli_ck_password->fetch_array(); +} +if ($_SESSION['nomination_password'] == '' ){ + echo ''; +} +if($_SESSION['nomination_password'] != $row_ck_password['content']) { + unset($_SESSION['nomination_password']); + echo ''; +} + +// keep parameter in value +$page = escapeString($_GET['page']) ; +$page_mode = escapeString($_GET['page_mode']) ; +$type = escapeString($_GET['type']) ; +$search = escapeString($_GET['search']) ; + +// active menu bar +$active_main_menu = 'service' ; +$active_sub_menu = 'form-submission' ; +$active_menu = 'form-nomination-list' ; + +// check permission +if ( !permissionCheck($row_user, 'form-nomination-view') ){ + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch($page_mode){ + + // edit formnomination + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM formnomination + WHERE formnomination_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // update database + $mysqli->query( "UPDATE formnomination SET + comment = '".escapeString($_POST['comment'])."', + status = '".escapeString($_POST['status'])."' + WHERE formnomination_id = '".$page."'" ) ; + + if ( $row_page['status'] != $_POST['status'] ){ + pushToUserCron( 'formnomination', $page, $row_page['staff_id'], 'Nomination', 'Nomination has been update.' ) ; + } + + // refresh page + header("Location:app-form-nomination.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'form-nomination-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'form-nomination-edit') ) ){ + header('Location: app-form-nomination.php') ; + exit ; + } + + // get all media + $media_list = [] ; + $mysqli_media = $mysqli->query( "SELECT file, filetype FROM formnomination_media + WHERE deleted_at IS NULL AND formnomination_id = '".$page."'" ) ; + if ( $mysqli_media->num_rows > 0 ){ + while ( $row_media = $mysqli_media->fetch_assoc() ){ + $media_list[] = $row_media ; + } + } + + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query( "SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + query("SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) LEFT JOIN staff c ON ( a.job_position_id = c.job_position_id ) WHERE a.deleted_at IS NULL AND b.lang = 'en' AND c.staff_id = '".$row_page['staff_id']."' LIMIT 1"); + + if ($mysql_ck_position_1->num_rows > 0 ) { + $row_ck_position_1 = $mysql_ck_position_1->fetch_assoc(); + } + + $mysqli_ck_department_1 = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) LEFT JOIN staff_department c ON ( a.department_id = c.department_id ) WHERE c.staff_id = '".$row_page['staff_id']."' AND a.deleted_at IS NULL AND b.lang = 'en' LIMIT 1"); + if ($mysqli_ck_department_1->num_rows > 0 ) { + $row_ck_department_1 = $mysqli_ck_department_1->fetch_assoc(); + } + ?> + +
+
Nominator
+
+
+
Staff
+
+ +
+
+ +
+
Department
+
+ +
+
+ +
+
Position
+
+ +
+
+ +
+ + + query("SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) LEFT JOIN staff c ON ( a.job_position_id = c.job_position_id ) WHERE a.deleted_at IS NULL AND b.lang = 'en' AND c.staff_id = '".$row_page['nominee_staff_id']."' LIMIT 1"); + + if ($mysql_ck_position_2->num_rows > 0 ) { + $row_ck_position_2 = $mysql_ck_position_2->fetch_assoc(); + } + + $mysqli_ck_department_2 = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) LEFT JOIN staff_department c ON ( a.department_id = c.department_id ) WHERE c.staff_id = '".$row_page['nominee_staff_id']."' AND a.deleted_at IS NULL AND b.lang = 'en' LIMIT 1"); + if ($mysqli_ck_department_2->num_rows > 0 ) { + $row_ck_department_2 = $mysqli_ck_department_2->fetch_assoc(); + } + ?> + +
+
Nominee
+
+
+
Staff
+
+ +
+
+ +
+
Department
+
+ +
+
+ +
+
Position
+
+ +
+
+ +
+ + query( "SELECT a.question_id, a.question_type, a.sortable, b.title, b.content FROM formnomination_question a + LEFT JOIN formnomination_question_translation b ON ( a.question_id = b.question_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.branch like '%/".$_SESSION['url_get_branch_admin']."/%' ORDER BY a.sortable ASC" ) ; + if ( $mysqli_question->num_rows > 0 ){ + while ( $row_question = $mysqli_question->fetch_assoc() ){ + if ( $row_question['question_type'] == 'question' ){ + $question_list[] = $row_question ; + } + if ( $row_question['question_type'] == 'form' ){ + $form_list[] = $row_question ; + } + } + } + + // get all answer + $mysqli_answer = $mysqli->query( "SELECT question_id, checkbox, remark FROM formnomination_answer + WHERE formnomination_id = '".$page."'" ) ; + if ( $mysqli_answer->num_rows > 0 ){ + while ( $row_answer = $mysqli_answer->fetch_assoc() ){ + $answer_list[$row_answer['question_id']] = $row_answer ; + } + } + + // render question & form + if ( count($question_list) > 0 ){ + echo ' +
+
Question
+
' ; + + foreach ( $question_list as $k => $v ){ + $get_answer = $answer_list[$v['question_id']] ; + + echo ' +
+
'.$v['title'].'
+
+ '.$v['content'].' +
+
+
+
Answer
+
+ + + + + + + +
+
+
' ; + } + } + + if ( count($form_list) > 0 ){ + echo ' +
+
Form
+
' ; + + foreach ( $form_list as $k => $v ){ + $get_answer = $answer_list[$v['question_id']] ; + + echo ' +
+
'.$v['title'].'
+
+ '.$v['content'].' +
+
+
+
Answer
+
+ +
+
+
' ; + } + } + ?> + +
+
Status
+
+ +
+
+ +
+
Comment
+
+ + +
+
+ + +
+
+
+ + + +
+
+ + +
+
+
+ + + query( $mysqli_query." ORDER BY a.formnomination_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + + if ( $export_excel == 'export_eae' ){ + + $page_export_file_name = 'Nomination Report-'; + + $array_header_excel = array( + 'No.', + 'ID', + 'Name', + 'Status', + 'Created Date', + 'Updated Date' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + $count_mysqli_export_page = 0; + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + $count_mysqli_export_page ++; + $array_body_excel[] = array( + $count_mysqli_export_page, + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + $mysqli_export_page['status'], + date('Y-m-d', strtotime($mysqli_export_page['created_at'])), + date('Y-m-d', strtotime($mysqli_export_page['updated_at'])) + ) ; + } + $count_mysqli_export_page = 0; + } + + include 'export_excel_default.php'; + + } + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+ + + +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ + +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['formnomination_id'] ; + + echo ' + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + ' ; + } + ?> + +
' ; + if ( permissionCheck($row_user, 'form-nomination-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['staff_name']).' ( '.dataFilter($row_page['staff_idno']).' )'.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-form-resignation.php b/app-form-resignation.php new file mode 100644 index 0000000..1b844f1 --- /dev/null +++ b/app-form-resignation.php @@ -0,0 +1,545 @@ +query("SELECT * FROM formresignation + WHERE formresignation_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + // if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // // update database + // $mysqli->query( "UPDATE formresignation SET + // comment = '".escapeString($_POST['comment'])."', + // status = '".escapeString($_POST['status'])."' + // WHERE formresignation_id = '".$page."'" ) ; + + // if ( $row_page['status'] != $_POST['status'] ){ + // pushToUserCron( 'formresignation', $page, $row_page['staff_id'], 'Resignation', 'Resignation has been update.' ) ; + // } + + // // refresh page + // header("Location:app-form-resignation.php?page_mode=edit&page=".$page."&success=1") ; + // $_SESSION['system_result'] = 'success-updated' ; + // exit ; + // } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'form-resignation-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'form-resignation-edit') ) ){ + header('Location: app-form-resignation.php') ; + exit ; + } + + // get all media + $media_list = [] ; + $mysqli_media = $mysqli->query( "SELECT file, filetype FROM formresignation_media + WHERE deleted_at IS NULL AND formresignation_id = '".$page."'" ) ; + if ( $mysqli_media->num_rows > 0 ){ + while ( $row_media = $mysqli_media->fetch_assoc() ){ + $media_list[] = $row_media ; + } + } + + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query( "SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + +
+
+
+
+ +
+
Staff
+
+ +
+
+ +
+
Title
+
+ +
+
+
+
Content
+
+ +
+
+ +
+
+
+ $row_image ){ ?> + + ' ; + break ; + default : + echo ' + + ' ; + } + ?> + +
+
+ + +
+ + +
+
Manager Date Approve
+
+
+
+
+ + +
+
Manager
+
+ +
+
+
+
Manager Status
+
+ +
+
+
+
Manager Comment
+
+
+
+
+ +
+ + +
+
HR Date Approve
+
+
+
+
+ + +
+
HR Manager
+
+ +
+
+
+
HR Manager Status
+
+ +
+
+
+
HR Manager Comment
+
+
+
+
+ +
+
+
+
+ + query( $mysqli_query." ORDER BY a.formresignation_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + + if ( $export_excel == 'export_eae' ){ + + $page_export_file_name = 'Resignation Report-'; + + $array_header_excel = array( + 'No.', + 'ID', + 'Name', + 'Subject', + 'Manager Status', + 'HR Manager Status', + 'Created Date', + 'Updated Date' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + $count_mysqli_export_page = 0; + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + $count_mysqli_export_page ++; + $array_body_excel[] = array( + $count_mysqli_export_page, + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + $mysqli_export_page['title'], + $mysqli_export_page['status_manager'], + $mysqli_export_page['status_hr'], + date('Y-m-d', strtotime($mysqli_export_page['created_at'])), + date('Y-m-d', strtotime($mysqli_export_page['updated_at'])) + ) ; + } + $count_mysqli_export_page = 0; + } + + include 'export_excel_default.php'; + + } + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+ + + +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ + +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['formresignation_id'] ; + + echo ' + + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + + ' ; + } + ?> + +
Manager StatusHR Manager Status
' ; + if ( permissionCheck($row_user, 'form-resignation-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['staff_name']).' ( '.dataFilter($row_page['staff_idno']).' )'.dataFilter($row_page['title']).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).''.resetStatus($row_page['status_manager']).''.resetStatus($row_page['status_hr']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-form-subcategory.php b/app-form-subcategory.php new file mode 100644 index 0000000..af8eb97 --- /dev/null +++ b/app-form-subcategory.php @@ -0,0 +1,360 @@ +query("SELECT * FROM form_category + WHERE category_id = '".$page."' AND category_type = 'sub' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO form_category ( category_type, created_at ) VALUES ( 'sub', '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('FormCategory', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + // update database + $mysqli->query("UPDATE form_category SET + ".$image_query." + category_parent = '".escapeString($_POST['category_parent'])."', + sortable = '".escapeString($_POST['sortable'])."', + updated_at = '".TODAYDATE."' + WHERE category_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'form_category_translation', 'category_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-form-subcategory.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Sortable
+
+ +
+
+ +
+
Main Category
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+
+
+
+ + query($mysqli_query." ORDER BY a.category_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+ + + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ +
+
+ + + + +
+
+ +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['category_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
+ + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-form-submission-category.php b/app-form-submission-category.php new file mode 100644 index 0000000..12255bd --- /dev/null +++ b/app-form-submission-category.php @@ -0,0 +1,337 @@ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check permission +if ( !permissionCheck($row_user, 'form-submission-category-view') ){ + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch($page_mode){ + + // edit + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM formsubmission + WHERE formsubmissionid = '".$formsubmissionid."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $formsubmissionid == '' ){ + $mysqli->query( "INSERT INTO formsubmission + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $formsubmissionid = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('FormSubmissionCategory', $formsubmissionid, $formsubmissionid, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + // update database + $mysqli->query( "UPDATE formsubmission SET + ".$image_query." + submission_type = '".escapeString($_POST['submission_type'])."', + updated_at = NOW() + WHERE formsubmissionid = '".$formsubmissionid."'" ) ; + + $title_en = '' ; + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + if ( $klang == 'en' ){ $title_en = $title ; } + + checkLangUpdate( 'formsubmission_translation', 'formsubmissionid', $formsubmissionid, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + //, + // 'content' => [ 'type' => 'input', 'value' => $content ] + ] ) ; + } + + // refresh page + header("Location:app-form-submission-category.php?page_mode=edit&formsubmissionid=".$formsubmissionid."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'form-submission-category-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'form-submission-category-edit') ) ){ + header('Location: app-form-submission-category.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + //, + // 'content' => [ + // 'type' => 'textarea', + // 'title' => $lang['Content'] + // ] + ]) ; + ?> + +
+
Type
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+
+
+
+ + + query( $mysqli_query." ORDER BY a.formsubmissionid DESC LIMIT $start_from, " . LIMIT ) ; + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+ + + +
+ +
+
+
+ + + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_assoc() ){ + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
TypeCreated Date
' ; + if ( permissionCheck($row_user, 'form-submission-category-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['title']).''.dataFilter($row_page['submission_type']).''.resetDateFormat($row_page['created_at']).'
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-form.php b/app-form.php new file mode 100644 index 0000000..bb16197 --- /dev/null +++ b/app-form.php @@ -0,0 +1,747 @@ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// mode type | all list | new | edit +switch($page_mode){ + + // edit + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM form + WHERE form_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO form ( created_at ) VALUES ( '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ( $remove_photo == 1 ){ + $image = '' ; + $image_query = "file = '', + file_type = ''," ; + }else{ + if ( $image != '' ){ + $get_image = pathinfo($image) ; + if ( $get_image['extension'] == 'pdf' || + $get_image['extension'] == 'xls' || + $get_image['extension'] == 'xlsx' || + $get_image['extension'] == 'doc' || + $get_image['extension'] == 'docx' + ){ + $file_name = $page.'-'.time().'.'.$get_image['extension'] ; + copy($_FILES["image"]["tmp_name"], 'uploads/Form/'.$file_name) ; + + $image_query= "file = '".$file_name."', + file_type = '".$get_image['extension']."'," ; + }else{ + $create_image = reCreateImage('Form', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + + $image_query = "file = '".$create_image['image']."', + file_type = '".$create_image['extension']."'," ; + } + } + } + } + + // delete all department & receiver + $staffids = [] ; + $receiver_type = dataFilter($_POST['receiver_type']) ; + $receiver_to = $_POST['receiver_to'] ; + $receiver_to_dept = $_POST['receiver_to_dept'] ; + + $selected_staff = [] ; + $selected_depart = [] ; + if ( $receiver_type == '0' ){ + + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL ") ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staffids[] = $row_staff['staff_id'] ; + // pushToUserCron( 'form', $page, $row_staff['staff_id'], 'Form', 'Form has been update' ) ; + } + } + + }elseif ( $receiver_type == '1' ){ + + if( !empty( $receiver_to ) ){ + for ( $i = 0 ; $i < count($receiver_to) ; $i++ ){ + if ( $receiver_to[$i] != '' ){ + $reset_staff = $receiver_to[$i] ; + $selected_staff[$reset_staff] = $reset_staff ; + $staffids[] = $reset_staff ; + // pushToUserCron( 'form', $page, $reset_staff, 'Form', 'Form has been update' ) ; + } + } + } + + }else{ + if( !empty( $receiver_to_dept ) ){ + $array_depart = [] ; + for ( $i = 0 ; $i < count($receiver_to_dept) ; $i++ ){ + + $department_id = $receiver_to_dept[$i] ; + if ( $department_id != '' ){ + + // save into department + $selected_depart[]= $department_id ; + + // check department staff + $reset_depart = str_replace( ['(', ')'], '', $department_id ) ; + $get_depart_staff = $mysqli->query( "SELECT staff_id FROM staff_department + WHERE deleted_at IS NULL AND department_id = '".$reset_depart."'") ; + if ( $get_depart_staff->num_rows > 0 ){ + while ( $row_depart_staff = $get_depart_staff->fetch_assoc() ){ + if ( !in_array($row_depart_staff['staff_id'], $array_depart) ){ + $array_depart[] = $row_depart_staff['staff_id'] ; + $selected_staff[$row_depart_staff['staff_id']] = $row_depart_staff['staff_id'] ; + $staffids[] = $row_depart_staff['staff_id'] ; + // pushToUserCron( 'form', $page, $row_depart_staff['staff_id'], 'Form', 'Form has been update' ) ; + } + } + } + + } + } + } + } + + $selected_staff = ( arrayCheck($selected_staff) ? '/'.implode( '/', $selected_staff ).'/' : '' ) ; + $selected_depart = ( arrayCheck($selected_depart) ? '/'.implode( '/', $selected_depart ).'/' : '' ) ; + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // update database + $mysqli->query("UPDATE form SET + ".$image_query." + branch = '/".implode('/', $array_branch)."/', + category_id = '".escapeString($_POST['category_id'])."', + staff_id = '".$selected_staff."', + department_id = '".$selected_depart."', + title = '".escapeString($_POST['title'])."', + sortable = '".escapeString($_POST['sortable'])."', + receiver_type = '".escapeString($_POST['receiver_type'])."', + updated_at = '".TODAYDATE."' + WHERE form_id = '".$page."'") ; + + if ( $_POST['is_retick'] == 'yes' ){ + $mysqli->query( "UPDATE staff_form SET + deleted_at = '".TODAYDATE."' + WHERE form_id = '".$page."'" ) ; + } + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'form_translation', 'form_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + if ( count($staffids) > 0 ){ + // pushToBranchUser( $array_branch, $staffids, 'form', $page, 'Form', 'Form has been update' ) ; + } + + // refresh page + header("Location:app-form.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // get all requires + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL ") ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // get all requires + $department_list = [] ; + $mysqli_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $mysqli_department->num_rows > 0 ){ + while ( $row_department = $mysqli_department->fetch_assoc() ){ + $department_list[$row_department['department_id']] = dataFilter($row_department['department_desc']) ; + } + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'form-list-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'form-list-edit') ) ){ + header('Location: app-form.php') ; + exit ; + } + + // get all selected staff & department + $receiver_staff = ( $row_page['staff_id'] != '' ? explode('/', $row_page['staff_id']) : [] ) ; + $receiver_depart = ( $row_page['department_id'] != '' ? explode('/', $row_page['department_id']) : [] ) ; + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+ +
+
To
+
+ +
+     +     + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Sub Category
+
+ +
+
+ +
+
Sortable
+
+ +
+
+ +
+
Photo
+
+
+
+ + + +
+
+ * Upload pdf / word / excel only +
+
+
+
Preview
+
+  Remove pdf / word / excel + Download' ; + }else{ + echo ' + ' ; + } + ?> +
+
+ +
+
+
+ + + +
+
+
+
+
+ + query("SELECT b.title FROM form a + LEFT JOIN form_translation b ON ( a.form_id = b.form_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.form_id = '".$form_id."' LIMIT 1"); + if ( $mysqli_page->num_rows == 0 ){ + exit ; + } + + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + + // related staff + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'page_mode='.$page_mode.'&form_id='.$form_id.'search='.$search ; + + // page query + $mysqli_query = "SELECT a.created_at, b.staff_idno, b.staff_name, b.staff_image FROM staff_form a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.form_id = '".$form_id."' " . $search_query ; + $mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.view_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + +
+
Join Staff
+
+ + + + + + + + + + + num_rows > 0 ){ + while ( $row_list = $mysqli_list->fetch_array(MYSQLI_ASSOC) ){ + $staff_image = ( $row_list['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_list['staff_image']) : '' ) ; + + echo ' + + + + + + '; + } + } + ?> + +
ProfileStaff IDNameAgreed Date
'.( $staff_image != '' ? '' : '' ).''.dataFilter($row_list['staff_idno']).''.dataFilter($row_list['staff_name']).''.resetDateFormat($row_list['created_at']).'
+ +
+
+ + +
+
Preview
+
+
+ +
+
Title
+
+ +
+
+ +
+
+
+
+ + query( $mysqli_query." ORDER BY a.form_id LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+ + + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['form_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
' ; + if ( permissionCheck($row_user, 'form-list-edit') ){ + echo ' + + |' ; + }else{ + echo '-' ; + } + echo ' + + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-grievance.php b/app-grievance.php new file mode 100644 index 0000000..633eb92 --- /dev/null +++ b/app-grievance.php @@ -0,0 +1,484 @@ +query("SELECT * FROM grievance + WHERE grievance_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // update database + $mysqli->query( "UPDATE grievance SET + comment = '".escapeString($_POST['comment'])."', + status = '".escapeString($_POST['status'])."' + WHERE grievance_id = '".$page."'" ) ; + + if ( $row_page['status'] != $_POST['status'] ){ + pushToUserCron( 'grievance', $page, $row_page['staff_id'], 'Grievance', 'Grievance has been update.' ) ; + } + + // refresh page + header("Location:app-grievance.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'our-grievance-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'our-grievance-edit') ) ){ + header('Location: app-grievance.php') ; + exit ; + } + + // get all media + $media_list = [] ; + $mysqli_media = $mysqli->query( "SELECT file, filetype FROM grievance_media + WHERE deleted_at IS NULL AND grievance_id = '".$page."'" ) ; + if ( $mysqli_media->num_rows > 0 ){ + while ( $row_media = $mysqli_media->fetch_assoc() ){ + $media_list[] = $row_media ; + } + } + + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query( "SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
Staff
+
+ +
+
+ +
+
Title
+
+ +
+
+
+
Content
+
+ +
+
+ + +
+
+
+ $v ){ ?> + + + + +
+
+ + +
+ +
+
Status
+
+ +
+
+ +
+
Comment
+
+ + +
+
+ + +
+
+
+ + + +
+
+ + +
+
+
+
+ + + query( $mysqli_query." ORDER BY a.grievance_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + + if ( $export_excel == 'export_eae' ){ + + $page_export_file_name = 'Grievance Report-'; + + $array_header_excel = array( + 'No.', + 'ID', + 'Name', + 'Subject', + 'Content', + 'Comment', + 'Status', + 'Created At', + 'Updated At' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + $count_mysqli_export_page = 0; + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + $count_mysqli_export_page ++; + $array_body_excel[] = array( + $count_mysqli_export_page, + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + $mysqli_export_page['title'], + dataFilter($mysqli_export_page['content']), + strip_tags(dataFilter($mysqli_export_page['comment'])), + $mysqli_export_page['status'], + date('Y-m-d', strtotime($mysqli_export_page['created_at'])), + date('Y-m-d', strtotime($mysqli_export_page['updated_at'])) + ) ; + } + $count_mysqli_export_page = 0; + } + + include 'export_excel_default.php'; + + } + + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
listing +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
listing
+
+ + + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['grievance_id'] ; + + echo ' + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + ' ; + } + ?> + +
' ; + if ( permissionCheck($row_user, 'our-grievance-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['staff_name']).' ( '.dataFilter($row_page['staff_idno']).' )'.dataFilter($row_page['title']).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).''.resetStatus($row_page['status']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-handbook-maincategory.php b/app-handbook-maincategory.php new file mode 100644 index 0000000..5ea037b --- /dev/null +++ b/app-handbook-maincategory.php @@ -0,0 +1,349 @@ +query("SELECT * FROM handbook_category + WHERE category_id = '".$page."' AND category_type = 'main' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO handbook_category ( category_type, created_at ) VALUES ( 'main', '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('HandbookCategory', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + // update database + $mysqli->query("UPDATE handbook_category SET + ".$image_query." + sortable = '".escapeString($_POST['sortable'])."', + updated_at = '".TODAYDATE."' + WHERE category_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'handbook_category_translation', 'category_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-handbook-maincategory.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Sortable
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+
+
+
+
+ + query($mysqli_query." ORDER BY a.category_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
search
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ +
+
+ + + + +
+
+ +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['category_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
+ + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-handbook-subcategory.php b/app-handbook-subcategory.php new file mode 100644 index 0000000..0a7bfb9 --- /dev/null +++ b/app-handbook-subcategory.php @@ -0,0 +1,369 @@ +query("SELECT * FROM handbook_category + WHERE category_id = '".$page."' AND category_type = 'sub' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO handbook_category ( category_type, created_at ) VALUES ( 'sub', '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('HandbookCategory', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + // update database + $mysqli->query("UPDATE handbook_category SET + ".$image_query." + category_parent = '".escapeString($_POST['category_parent'])."', + sortable = '".escapeString($_POST['sortable'])."', + updated_at = '".TODAYDATE."' + WHERE category_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'handbook_category_translation', 'category_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-handbook-subcategory.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Sortable
+
+ +
+
+ +
+
Main Category
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+
+
+
+
+ + query($mysqli_query." ORDER BY a.category_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ +
+
+ + + + +
+
+ +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['category_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
+ + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-handbook.php b/app-handbook.php new file mode 100644 index 0000000..07c7b0e --- /dev/null +++ b/app-handbook.php @@ -0,0 +1,845 @@ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// mode type | all list | new | edit +switch($page_mode){ + + // edit + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM handbook + WHERE handbook_id = '".$page."' LIMIT 1"); + + $notification_title = 'Handbook has been added' ; + $prev_staff_id = [] ; + $is_update_send = false ; + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + $notification_title = 'Handbook has been update' ; + $prev_staff_id = ( $row_page['staff_id'] != '' ? explode( '/', substr( $row_page['staff_id'], 1, -1 ) ) : [] ) ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO handbook ( created_at ) VALUES ( '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ( $remove_photo == 1 ){ + $image = '' ; + $image_query = "file = '', + file_type = ''," ; + }else{ + if ( $image != '' ){ + $get_image = pathinfo($image) ; + if ( $get_image['extension'] == 'pdf' ){ + + $file_name = $page.'-'.time().'.pdf' ; + copy($_FILES["image"]["tmp_name"], 'uploads/Handbook/'.$file_name) ; + + $image_query= "file = '".$file_name."', + file_type = 'pdf'," ; + + $is_update_send = true ; + }else{ + $create_image = reCreateImage('Handbook', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + + $image_query = "file = '".$create_image['image']."', + file_type = '".$create_image['extension']."'," ; + + $is_update_send = true ; + } + } + } + } + + // delete all department & receiver + $receiver_type = dataFilter($_POST['receiver_type']) ; + $receiver_to = $_POST['receiver_to'] ; + $receiver_to_dept = $_POST['receiver_to_dept'] ; + $branch = $_POST['branch'] ; + $array_branch = [] ; + foreach ( $branch as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + $selected_staff = [] ; + $selected_depart = [] ; + if ( $receiver_type == '0' ){ + + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL AND branch_id IN (".implode(',', $array_branch).")") ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + if ( !in_array( $row_staff['staff_id'], $prev_staff_id ) || $is_update_send ) { + pushToUserCron( 'handbook', $page, $row_staff['staff_id'], 'Handbook', $notification_title ) ; + } + } + } + + }elseif ( $receiver_type == '1' ){ + + if( !empty( $receiver_to ) ){ + for ( $i = 0 ; $i < count($receiver_to) ; $i++ ){ + if ( $receiver_to[$i] != '' ){ + $reset_staff = $receiver_to[$i] ; + $selected_staff[$reset_staff] = $reset_staff ; + + if ( !in_array( $reset_staff, $prev_staff_id ) || $is_update_send ) { + pushToUserCron( 'handbook', $page, $reset_staff, 'Handbook', $notification_title ) ; + } + } + } + } + + }else{ + if( !empty( $receiver_to_dept ) ){ + $array_depart = [] ; + for ( $i = 0 ; $i < count($receiver_to_dept) ; $i++ ){ + + $department_id = $receiver_to_dept[$i] ; + if ( $department_id != '' ){ + + // save into department + $selected_depart[]= $department_id ; + + // check department staff + $reset_depart = str_replace( ['(', ')'], '', $department_id ) ; + $get_depart_staff = $mysqli->query( "SELECT a.staff_id FROM staff_department a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.department_id = '".$reset_depart."' AND b.branch_id IN (".implode(',', $array_branch).")" ) ; + if ( $get_depart_staff->num_rows > 0 ){ + while ( $row_depart_staff = $get_depart_staff->fetch_assoc() ){ + if ( !in_array($row_depart_staff['staff_id'], $array_depart) ){ + $array_depart[] = $row_depart_staff['staff_id'] ; + $selected_staff[$row_depart_staff['staff_id']] = $row_depart_staff['staff_id'] ; + + if ( !in_array( $row_depart_staff['staff_id'], $prev_staff_id ) || $is_update_send ) { + pushToUserCron( 'handbook', $page, $row_depart_staff['staff_id'], 'Handbook', $notification_title ) ; + } + } + } + } + + } + } + } + } + + $selected_staff = ( arrayCheck($selected_staff) ? '/'.implode( '/', $selected_staff ).'/' : '' ) ; + $selected_depart = ( arrayCheck($selected_depart) ? '/'.implode( '/', $selected_depart ).'/' : '' ) ; + + // update database + $mysqli->query("UPDATE handbook SET + ".$image_query." + branch = '/".implode('/', $array_branch)."/', + category_id = '".escapeString($_POST['category_id'])."', + staff_id = '".$selected_staff."', + department_id = '".$selected_depart."', + title = '".escapeString($_POST['title'])."', + sortable = '".escapeString($_POST['sortable'])."', + receiver_type = '".escapeString($_POST['receiver_type'])."', + view_format = '".escapeString($_POST['view_format'])."', + content = '".escapeString($_POST['content'])."', + video_url = '".escapeString($_POST['video_url'])."', + is_showagree = '".escapeString($_POST['is_showagree'])."', + updated_at = '".TODAYDATE."' + WHERE handbook_id = '".$page."'") ; + + if ( $_POST['is_retick'] == 'yes' ){ + $mysqli->query( "UPDATE staff_handbook SET + deleted_at = '".TODAYDATE."' + WHERE handbook_id = '".$page."'" ) ; + } + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'handbook_translation', 'handbook_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-handbook.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // get all requires + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL ") ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // get all requires + $department_list = [] ; + $mysqli_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $mysqli_department->num_rows > 0 ){ + while ( $row_department = $mysqli_department->fetch_assoc() ){ + $department_list[$row_department['department_id']] = dataFilter($row_department['department_desc']) ; + } + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'handbook-list-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'handbook-list-edit') ) ){ + header('Location: app-handbook.php') ; + exit ; + } + + // get all selected staff & department + $receiver_staff = ( $row_page['staff_id'] != '' ? explode('/', $row_page['staff_id']) : [] ) ; + $receiver_depart = ( $row_page['department_id'] != '' ? explode('/', $row_page['department_id']) : [] ) ; + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+ +
+
To
+
+ +
+     +     + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Sub Category
+
+ +
+
+ +
+
Sortable
+
+ +
+
+ +
+ +
+
Format
+
+ + + +
+
+ +
> +
Photo
+
+
+
+ + + +
+
+
+
+
> +
Preview
+
+  Remove pdf + Download' ; + }else{ + echo ' + ' ; + } + ?> +
+
+
> +
Message
+
+ + +
+
+
> +
Video
+
+ +
+
+ +
+
Is Signature
+
+ + +
+
+ +
+
Is Signature Retick
+
+ + +
+
+ + +
+
+
+ + + +
+
+
+
+
+
+ + query("SELECT b.title FROM handbook a + LEFT JOIN handbook_translation b ON ( a.handbook_id = b.handbook_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.handbook_id = '".$handbook_id."' LIMIT 1"); + if ( $mysqli_page->num_rows == 0 ){ + exit ; + } + + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + + // related staff + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'page_mode='.$page_mode.'&handbook_id='.$handbook_id.'search='.$search ; + + // page query + $mysqli_query = "SELECT a.created_at, b.staff_idno, b.staff_name, b.staff_image FROM staff_handbook a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.handbook_id = '".$handbook_id."' " . $search_query ; + $mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.view_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + +
+
Join Staff
+
+ + + + + + + + + + + num_rows > 0 ){ + while ( $row_list = $mysqli_list->fetch_array(MYSQLI_ASSOC) ){ + $staff_image = ( $row_list['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_list['staff_image']) : '' ) ; + + echo ' + + + + + + '; + } + } + ?> + +
ProfileStaff IDNameAgreed Date
'.( $staff_image != '' ? '' : '' ).''.dataFilter($row_list['staff_idno']).''.dataFilter($row_list['staff_name']).''.resetDateFormat($row_list['created_at']).'
+ +
+
+ + +
+
Preview
+
+
+ +
+
Title
+
+ +
+
+ +
+
+
+
+
+ + query($mysqli_query." ORDER BY a.handbook_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['handbook_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
' ; + if ( permissionCheck($row_user, 'handbook-list-edit') ){ + echo ' + + |' ; + }else{ + echo '-' ; + } + echo ' + + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-menu.php b/app-menu.php new file mode 100644 index 0000000..9c1ee34 --- /dev/null +++ b/app-menu.php @@ -0,0 +1,363 @@ +query("SELECT * FROM app_menu + WHERE menu_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO app_menu ( created_at ) VALUES ( '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('AppMenu', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + // update database + $mysqli->query("UPDATE app_menu SET + ".$image_query." + sortable = '".escapeString($_POST['sortable'])."', + updated_at = '".TODAYDATE."' + WHERE menu_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + checkLangUpdate( 'app_menu_translation', 'menu_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'content' => [ 'type' => 'input', 'value' => $content ] + ] ) ; + } + + // refresh page + header("Location:app-menu.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'app-menu-new') ) ){ + header('Location: index.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'content' => [ + 'type' => 'textarea', + 'title' => $lang['Content'] + ] + ]) ; + ?> + +
+
Sortable
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+ * 1000px x 375px +
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+ +
+
+
+
+ + query($mysqli_query." ORDER BY a.menu_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['menu_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
+ + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-nomination.php b/app-nomination.php new file mode 100644 index 0000000..55a9b5e --- /dev/null +++ b/app-nomination.php @@ -0,0 +1,775 @@ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check permission +if ( !permissionCheck($row_user, 'our-nomination-view') ){ + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch($page_mode){ + + // edit nomination + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM nomination + WHERE nomination_id = '".$nomination_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $nomination_id == '' ){ + $mysqli->query( "INSERT INTO nomination + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $nomination_id = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('Nomination', $nomination_id, $nomination_id, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // update database + $mysqli->query( "UPDATE nomination SET + ".$image_query." + branch = '/".implode('/', $array_branch)."/', + status = '".escapeString($_POST['status'])."' + WHERE nomination_id = '".$nomination_id."'" ) ; + + $title_en = '' ; + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + if ( $klang == 'en' ){ $title_en = $title ; } + + checkLangUpdate( 'nomination_translation', 'nomination_id', $nomination_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'content' => [ 'type' => 'input', 'value' => $content ] + ] ) ; + } + + if ( $submit_type == 'new' ){ + pushToBranchUser( $array_branch, [], 'nomination', $nomination_id, 'New Nomination', ( $title_en != '' ? $title_en : 'New nomination has been submitted.' ) ) ; + } + + // refresh page + header("Location:app-nomination.php?page_mode=edit&nomination_id=".$nomination_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'our-nomination-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'our-nomination-edit') ) ){ + header('Location: app-nomination.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+ + + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'content' => [ + 'type' => 'textarea', + 'title' => $lang['Content'] + ] + ]) ; + ?> + +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
Status
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+ + + query("SELECT a.nomination_id, b.title, b.content FROM nomination a + LEFT JOIN nomination_translation b ON ( a.nomination_id = b.nomination_id ) + WHERE a.nomination_id = '".$nomination_id."' LIMIT 1"); + if ($mysqli_page->num_rows == 0){ + exit ; + } + + $row_page = $mysqli_page->fetch_assoc() ; + + // update database + if ( $_POST['hide'] == 1 ){ + $update_status = escapeString( $_POST['update_status'] ) ; + + foreach ( $_POST['multiple_status'] as $kk => $vv ){ + $mysqli->query( "UPDATE staff_nomination SET + status = '".$update_status."' + WHERE view_id = '".$kk."'" ) ; + + if ( $update_status == 'rejected' ){ + pushToUserCron( 'staff_nomination', $kk, $vv, 'Nomination', 'Nomination has been reject.' ) ; + }else{ + pushToUserCron( 'staff_nomination', $kk, $vv, 'Nomination', 'Nomination has been update.' ) ; + } + } + + header( "Refresh: 0;" ) ; + exit ; + } + + // related staff + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'page_mode='.$page_mode.'&nomination_id='.$nomination_id.'search='.$search ; + + // page query + $mysqli_query = "SELECT a.view_id, a.nomination_so, a.created_at, a.updated_at, a.status, b.staff_id, b.staff_idno, b.staff_name, b.staff_image FROM staff_nomination a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.nomination_id = '".$nomination_id."' " . $search_query ; + $mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.view_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + +
+ +
+
+ + + + +
+
+ +
+
Join Staff
+
+ + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_list = $mysqli_list->fetch_assoc() ){ + $staff_image = ( $row_list['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_list['staff_image']) : '' ) ; + + echo ' + + + + + + + + + + '; + } + } + ?> + +
So NumberProfileStaff IDNameStatusCreated AtUpdated At
' ; + if ( $row_list['status'] == 'pending' || $row_list['status'] == 'approved' ){ + echo ' +
+ + +
' ; + } + echo ' +
'.dataFilter($row_list['nomination_so']).''.( $staff_image != '' ? '' : '' ).''.dataFilter($row_list['staff_idno']).''.dataFilter($row_list['staff_name']).''.resetStatus($row_list['status']).''.resetDateFormat($row_list['created_at']).''.resetDateFormat($row_list['updated_at']).'
+ +
+
+ +
+ +
+
+
+
+ +
+
Title
+
+ +
+
+
+
Content
+
+ + +
+
+ + +
+
+
+ + + + +
+
+ + + + +
+
Status
+
+ +
+
+
+
+
+ +
+ + = '".$search_date."' " ; + } + // search query + if ($search != ''){ + $search_query .= " AND ( title LIKE '%".$search."%' )" ; + } + if( $search_type != ''){ + $search_query .= " AND a.status IN ('".implode("', '",$search_type)."') " ; + } + + // related staff + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_name='.$search_name.'&search_date='.$search_date.'&page_mode='.$page_mode.'&search_idno='.$search_idno.'&search_mobile='.$search_mobile.'&search_mail='.$search_mail; + + // page query + $mysqli_query = "SELECT a.view_id, a.nomination_so, a.created_at, a.updated_at, a.status, b.staff_idno, b.staff_name, b.staff_image FROM staff_nomination a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL " . $search_query ; + $mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.view_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+
Join Staff
+
+ + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_list = $mysqli_list->fetch_assoc() ){ + $staff_image = ( $row_list['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_list['staff_image']) : '' ) ; + + echo ' + + + + + + + + + + '; + } + } + ?> + +
So NumberProfileStaff IDNameStatusCreated AtUpdated At
' ; + if ( $row_list['status'] == 'pending' || $row_list['status'] == 'approved' ){ + echo ' +
+ + +
' ; + } + echo ' +
'.dataFilter($row_list['nomination_so']).''.( $staff_image != '' ? '' : '' ).''.dataFilter($row_list['staff_idno']).''.dataFilter($row_list['staff_name']).''.resetStatus($row_list['status']).''.resetDateFormat($row_list['created_at']).''.resetDateFormat($row_list['updated_at']).'
+ +
+
+ +
+ + query( $mysqli_query." ORDER BY a.nomination_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+ + + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_assoc() ){ + + $staff_nomination = $mysqli->query( "SELECT view_id FROM staff_nomination + WHERE deleted_at IS NULL AND nomination_id = '".$row_page['nomination_id']."' AND status IN ( 'pending' )" ) ; + $total_nomination = $staff_nomination->num_rows ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + + ' ; + } + ?> + +
Created Date
' ; + if ( permissionCheck($row_user, 'our-nomination-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + | + ( '.$total_nomination.' ) + '.dataFilter($row_page['title']).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-page.php b/app-page.php new file mode 100644 index 0000000..c2768ea --- /dev/null +++ b/app-page.php @@ -0,0 +1,366 @@ +query("SELECT * FROM app_page + WHERE page_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO app_page ( created_at ) VALUES ( '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ( $remove_photo == 1 ){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('AppPage', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + // update database + $mysqli->query("UPDATE app_page SET + ".$image_query." + sortable = '".escapeString($_POST['sortable'])."', + updated_at = '".TODAYDATE."' + WHERE page_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + checkLangUpdate( 'app_page_translation', 'page_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'content' => [ 'type' => 'input', 'value' => $content ] + ] ) ; + } + + // refresh page + header("Location:app-page.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'app-page-new') ) ){ + header('Location: index.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'content' => [ + 'type' => 'textarea', + 'title' => $lang['Content'] + ] + ]) ; + ?> + +
+
Sortable
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+ * 1000px x 375px +
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+ +
+
+
+
+ + query($mysqli_query." ORDER BY a.page_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['page_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
+ + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-password.php b/app-password.php new file mode 100644 index 0000000..2a1dbd3 --- /dev/null +++ b/app-password.php @@ -0,0 +1,296 @@ +query("SELECT * FROM app_password + WHERE password_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // check permission + if ( ( $submit_type == 'new' || $submit_type == 'edit' ) && !permissionCheck($row_user, 'app-password-edit') ){ + header('Location: index.php') ; + exit ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO app_password ( created_at ) VALUES ( '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE app_password SET + content = '".escapeString($_POST['password'])."', + password_type = '".escapeString($_POST['password_type'])."', + updated_at = '".TODAYDATE."' + WHERE password_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + checkLangUpdate( 'app_password_translation', 'password_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-password.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Password
+
+ + +
+
+
+
Password Type
+
+ +
+
+ +
+
+
+ + + +
+
+ +
+
+
+ + + query($mysqli_query." ORDER BY a.password_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+ + + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+
+
+
+ + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['password_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
Type
+ + '.$title.''.ucfirst(dataFilter($row_page['password_type'])).''.resetDateFormat($row_page['created_at']).'
'.$lang['no_data'].'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-point.php b/app-point.php new file mode 100644 index 0000000..5b92f91 --- /dev/null +++ b/app-point.php @@ -0,0 +1,406 @@ +query("SELECT * FROM setting_point + WHERE point_id = '".$point_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $point_id == '' ){ + $mysqli->query( "INSERT INTO setting_point + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $point_id = $mysqli->insert_id ; + } + + // update database + $mysqli->query( "UPDATE setting_point SET + point_title = '".escapeString($_POST['point_title'])."', + point_description = '".escapeString($_POST['point_description'])."', + point_from = '".escapeString($_POST['point_from'])."', + point_type = '".escapeString($_POST['point_type'])."', + difficulty = '".escapeString($_POST['difficulty'])."', + point_value = '".escapeString($_POST['point_value'])."' + WHERE point_id = '".$point_id."'" ) ; + + // refresh page + header("Location:app-point.php?page_mode=edit&point_id=".$point_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'app-point-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'app-point-edit') ) ){ + header('Location: app-point.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
Title
+
+ +
+
+
+
Description
+
+ +
+
+
+
From
+
+ +
+
+
+
Type
+
+ +
+
+
+
Difficulty
+
+ +
+
+
+
Point
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+
+ + + query( $mysqli_query." ORDER BY a.point_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
search
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ +
+
listing
+
+ + + + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + echo ' + + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + + ' ; + } + ?> + +
ActionTitleDescriptionFromTypeDifficultyPointCreated Date
' ; + if ( permissionCheck($row_user, 'app-point-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['point_title']).''.dataFilter($row_page['point_description']).''.ucwords($row_page['point_from']).''.ucwords($row_page['point_type']).''.ucwords($row_page['difficulty']).''.dataFilter($row_page['point_value']).''.resetDateFormat($row_page['created_at']).'
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-pop-up.php b/app-pop-up.php new file mode 100644 index 0000000..9b682aa --- /dev/null +++ b/app-pop-up.php @@ -0,0 +1,203 @@ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check query exsits +$submit_type = 'new' ; +$mysqli_page = $mysqli->query("SELECT * FROM setting_popup + WHERE setting_popup_id = '1' LIMIT 1"); +if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; +} + + +// update database +if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + + if ( $page == '' ){ + $mysqli->query( "INSERT INTO setting_popup + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('Pop-up', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + + $branch = $_POST['branch'] ; + $array_branch = [] ; + foreach ( $branch as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // update database + $mysqli->query( "UPDATE setting_popup SET + ".$image_query." + branch = '/".implode('/', $array_branch)."/', + title_name = '".escapeString($_POST['title_name'])."', + status = '".escapeString($_POST['status'])."' + WHERE setting_popup_id = '1'" ) ; + + // refresh page + header("Location:app-pop-up.php?page_mode=edit&page=1&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; +} + + +// start header here +include 'requires/page_header.php'; +include 'requires/page_top.php'; + +?> + + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+ +
+
Title
+
+ +
+
+
+
+
+
+
+ + + /> +
+
+ * 800px x 1000px +
+
+ +
+
+
+ + + no image + +
+
+ + + + + +
+
Status
+
+ +
+
+ +
+
+
+ + + +
+
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-redeem-category.php b/app-redeem-category.php new file mode 100644 index 0000000..7017142 --- /dev/null +++ b/app-redeem-category.php @@ -0,0 +1,601 @@ +query("SELECT * FROM redeem_category + WHERE category_id = '".$category_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $category_id == '' ){ + $mysqli->query( "INSERT INTO redeem_category + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $category_id = $mysqli->insert_id ; + } + + + + + + // delete all department & receiver + $receiver_type = dataFilter($_POST['receiver_type']) ; + $receiver_to = $_POST['receiver_to'] ; + $receiver_to_dept = $_POST['receiver_to_dept'] ; + + $selected_staff = [] ; + $selected_depart = [] ; + if ( $receiver_type == '0' ){ + + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL ") ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + if ( !in_array( $row_staff['staff_id'], $prev_staff_id ) || $is_update_send ) { + // pushToUserCron( 'redeem_category', $category_id, $row_staff['staff_id'], 'Redeem', $notification_title ) ; + } + } + } + + }elseif ( $receiver_type == '1' ){ + + if( !empty( $receiver_to ) ){ + for ( $i = 0 ; $i < count($receiver_to) ; $i++ ){ + if ( $receiver_to[$i] != '' ){ + $reset_staff = $receiver_to[$i] ; + $selected_staff[$reset_staff] = $reset_staff ; + + if ( !in_array( $reset_staff, $prev_staff_id ) || $is_update_send ) { + // pushToUserCron( 'redeem_category', $category_id, $reset_staff, 'Redeem', $notification_title ) ; + } + } + } + } + + }else{ + if( !empty( $receiver_to_dept ) ){ + $array_depart = [] ; + for ( $i = 0 ; $i < count($receiver_to_dept) ; $i++ ){ + + $department_id = $receiver_to_dept[$i] ; + if ( $department_id != '' ){ + + // save into department + $selected_depart[]= $department_id ; + + // check department staff + $reset_depart = str_replace( ['(', ')'], '', $department_id ) ; + $get_depart_staff = $mysqli->query( "SELECT staff_id FROM staff_department + WHERE deleted_at IS NULL AND department_id = '".$reset_depart."'") ; + if ( $get_depart_staff->num_rows > 0 ){ + while ( $row_depart_staff = $get_depart_staff->fetch_assoc() ){ + if ( !in_array($row_depart_staff['staff_id'], $array_depart) ){ + $array_depart[] = $row_depart_staff['staff_id'] ; + $selected_staff[$row_depart_staff['staff_id']] = $row_depart_staff['staff_id'] ; + + if ( !in_array( $row_depart_staff['staff_id'], $prev_staff_id ) || $is_update_send ) { + // pushToUserCron( 'redeem_category', $category_id, $row_depart_staff['staff_id'], 'Redeem', $notification_title ) ; + } + } + } + } + + } + } + } + } + + $selected_staff = ( arrayCheck($selected_staff) ? '/'.implode( '/', $selected_staff ).'/' : '' ) ; + $selected_depart = ( arrayCheck($selected_depart) ? '/'.implode( '/', $selected_depart ).'/' : '' ) ; + + + + + // update database + $mysqli->query( "UPDATE redeem_category SET + staff_id = '".$selected_staff."', + department_id = '".$selected_depart."', + receiver_type = '".escapeString($_POST['receiver_type'])."', + category_mode = '".escapeString($_POST['category_mode'])."', + category_type = '".escapeString($_POST['category_type'])."', + number_of_times = '".escapeString($_POST['number_of_times'])."', + date_start = '".escapeString($_POST['date_start'])."', + date_end = '".escapeString($_POST['date_end'])."', + status = '".escapeString($_POST['status'])."' + WHERE category_id = '".$category_id."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + checkLangUpdate( 'redeem_category_translation', 'category_id', $category_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'content' => [ 'type' => 'input', 'value' => $content ] + ] ) ; + } + + // refresh page + header("Location:app-redeem-category.php?page_mode=edit&category_id=".$category_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'redeem-category-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'redeem-category-edit') ) ){ + header('Location: app-redeem-category.php') ; + exit ; + } + + + + + + // get all requires + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL ") ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // get all requires + $department_list = [] ; + $mysqli_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $mysqli_department->num_rows > 0 ){ + while ( $row_department = $mysqli_department->fetch_assoc() ){ + $department_list[$row_department['department_id']] = dataFilter($row_department['department_desc']) ; + } + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'handbook-list-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'handbook-list-edit') ) ){ + header('Location: app-handbook.php') ; + exit ; + } + + // get all selected staff & department + $receiver_staff = ( $row_page['staff_id'] != '' ? explode('/', $row_page['staff_id']) : [] ) ; + $receiver_depart = ( $row_page['department_id'] != '' ? explode('/', $row_page['department_id']) : [] ) ; + + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
To
+
+ +
+     +     + +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'content' => [ + 'type' => 'textarea', + 'title' => $lang['Content'] + ] + ]) ; + ?> + +
+
Number of Times
+
+ +
+
+
+
Category Mode
+
+ +
+
+
+
Category Type
+
+ +
+
+
+
Date Start
+
+ +
+
+
+
Date End
+
+ +
+
+
+
Status
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+
+ + + query( $mysqli_query." ORDER BY a.category_id DESC LIMIT $start_from, " . LIMIT ) ; + + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['category_id'] ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + + ' ; + } + ?> + +
Created Date
' ; + if ( permissionCheck($row_user, 'redeem-category-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['title']).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-redeem.php b/app-redeem.php new file mode 100644 index 0000000..4d9cbb2 --- /dev/null +++ b/app-redeem.php @@ -0,0 +1,1034 @@ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check permission +if ( !permissionCheck($row_user, 'redeem-list-view') ){ + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch($page_mode){ + + // edit redeem + case 'new' : + case 'edit' : + + $active_menu = 'redeem-list-category' ; + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM redeem + WHERE redeem_id = '".$redeem_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $redeem_id == '' ){ + $mysqli->query( "INSERT INTO redeem ( user_id, created_at ) VALUES ( '".$_SESSION['system_id']."', '".TODAYDATE."' )" ) ; + $redeem_id = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('Redeem', $redeem_id, $redeem_id, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // get total redeem + $redeem_quantity = escapeString($_POST['redeem_quantity']) ; + + // update database + $mysqli->query( "UPDATE redeem SET + ".$image_query." + branch = '/".implode('/', $array_branch)."/', + category_id = '".escapeString($_POST['category_id'])."', + redeem_type = '".escapeString($_POST['redeem_type'])."', + date_start = '".escapeString($_POST['date_start'])."', + date_end = '".escapeString($_POST['date_end'])."', + point = '".escapeString($_POST['point'])."', + redeem_quantity = '".$redeem_quantity."', + status = '".escapeString($_POST['status'])."' + WHERE redeem_id = '".$redeem_id."'" ) ; + + $title_en = '' ; + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + if ( $klang == 'en' ){ $title_en = $title ; } + + checkLangUpdate( 'redeem_translation', 'redeem_id', $redeem_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'content' => [ 'type' => 'input', 'value' => $content ] + ] ) ; + } + + if ( $submit_type == 'new' ){ + // pushToBranchUser( $array_branch, [], 'redeem', $redeem_id, 'New Redeem', ( $title != '' ? $title : 'New redeem has been submitted.' ) ) ; + } + + // refresh page + header("Location:app-redeem.php?page_mode=edit&redeem_id=".$redeem_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'redeem-list-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'redeem-list-edit') ) ){ + header('Location: app-redeem.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + +
+
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'content' => [ + 'type' => 'textarea', + 'title' => $lang['Content'] + ] + ]) ; + ?> + +
+
Category
+
+ +
+
+
+
Redeem Type
+
+ +
+
+
+
Date Start
+
+ +
+
+
+
Date End
+
+ +
+
+
+
Point
+
+ +
+
+
+
Quantity
+
+ +
+
+ + +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
Status
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+ + + query("SELECT a.redeem_so, a.point, a.remark, a.status as redeem_status, a.created_at, b.staff_id, b.staff_image, b.staff_idno, b.staff_name, c.file as item_file, d.title FROM staff_redeem a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + LEFT JOIN redeem c ON ( a.redeem_id = c.redeem_id ) + LEFT JOIN redeem_translation d ON ( a.redeem_id = d.redeem_id ) + WHERE a.deleted_at IS NULL AND d.lang = 'en' AND a.redeem_id = '".$redeem_id."' AND a.view_id = '".$view_id."' ". $user_branch_permission_sql_b." LIMIT 1") ; + if ( $mysqli_page->num_rows == 0 ){ + exit ; + } + + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + + $boolean_submit = false ; + if ( $row_page['redeem_status'] != 'confirmed' && $row_page['redeem_status'] != 'rejected' ){ + $boolean_submit = true ; + } + + + // update database + if ( $_POST['hide'] == 1 && $boolean_submit ){ + + $redeem_status = escapeString($_POST['redeem_status']) ; + + if ( $row_page['redeem_status'] != $redeem_status ){ + + $boolean_update = false ; + if ( $redeem_status == 'rejected' ){ + $remark = 'Refund point from redeem ' . $row_page['redeem_so'] ; + pointMovement( 'redeem', $view_id, 'exchange-refund', 'normal', $row_page['staff_id'], $row_page['point'], $remark ) ; + + $boolean_update = true ; + }else{ + $boolean_update = true ; + } + + if ( $boolean_update ){ + $mysqli->query( "UPDATE staff_redeem SET + remark = '".escapeString($_POST['remark'])."', + status = '".escapeString($redeem_status)."' + WHERE redeem_id = '".$redeem_id."' AND view_id = '".$view_id."'" ) ; + + if ( $redeem_status == 'rejected' ){ + pushToUserCron( 'staff_redeem', $view_id, $row_page['staff_id'], 'Redeem', 'Redeem has been reject.' ) ; + }else{ + pushToUserCron( 'staff_redeem', $view_id, $row_page['staff_id'], 'Redeem', 'Redeem has been update.' ) ; + } + + } + + } + + // refresh page + header("Location:app-redeem.php?page_mode=view&redeem_id=".$redeem_id."&view_id=".$view_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'redeem-list-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'redeem-list-edit') ) ){ + header('Location: app-redeem.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
Staff ID
+
+ +
+
+
+
Staff Name
+
+ +
+
+ +
+
+
+ + + +
+
+ + +
+ +
+
Title
+
+ +
+
+ +
+
+
+ + + +
+
+ + +
+ +
+
Point
+
+ +
+
+
+
Created At
+
+ +
+
+
+
Status
+
+ +
+
+
+
+
+ + +
+
+ + +
+
+
+ + + +
+
+ + +
+
+
+
+ + + query( $mysqli_query_staff." ORDER BY a.redeem_id DESC") ; + + if ($mysqli_staff->num_rows > 0){ + while ( $row_staff = $mysqli_staff->fetch_array(MYSQLI_ASSOC) ){ + $staff_redeem_array[$row_staff['redeem_id']][] = $row_staff; + } + } + + // query type + $search_query = '' ; + + // search query + if( $search_title != ''){ + $search_query .= " AND b.title LIKE '%".$search_title."%'" ; + } + if ( $search_date != '' ){ + $search_query .= " AND a.created_at like '%".$search_date."%' " ; + } + + // form submit + if ( $_POST['hide'] == '1' && $_POST['hide_status'] == 'action' ){ + switch($_POST['page_action']){ + case 'trash': + $mysqli_query = "UPDATE redeem SET deleted_at = '".TODAYDATE."' WHERE redeem_id = " ; + $trash_page = trashPage('redeem', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_title='.$search_title.'&search_date='.$search_date.'&page_mode='.$page_mode ; + + // page query + $mysqli_query = "SELECT a.redeem_id, a.point, a.status, a.created_at, b.title FROM redeem a + LEFT JOIN redeem_translation b ON ( a.redeem_id = b.redeem_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' " . $search_query . $user_branch_permission_sql_symbol ; + $mysqli_page = $mysqli->query( $mysqli_query." ORDER BY a.redeem_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['redeem_id'] ; + $redeem_staff = 0; + + $blink_css = ''; + + foreach ($staff_redeem_array[$id] as $key => $value) { + // $redeem_staff .= $value['staff_name'].'
'; + $redeem_staff ++; + + if(date( 'Y-m-d', strtotime( $value['created_at'] ) ) == date( 'Y-m-d' )){ + $blink_css = 'blink_css_cms'; + } + } + + echo ' + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + ' ; + } + ?> + +
PointCreated Date
' ; + if ( permissionCheck($row_user, 'redeem-list-edit') ){ + echo ' + + |' ; + }else{ + echo '-' ; + } + echo ' + ('.$redeem_staff.') + '.dataFilter($row_page['title']).''.dataFilter($row_page['point']).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+ query( $mysqli_query." ORDER BY a.view_id DESC LIMIT $start_from, " . LIMIT ) ; + + + if ($_POST['hide'] == '1' && $_POST['hide_status'] == 'action'){ + switch($_POST['page_action']){ + case 'export-excel' : + include 'PhpExcel/PHPExcel.php' ; + // // Create new PHPExcel object + $objPHPExcel = new PHPExcel(); + + // set letter + $letters = array(); + $letter = 'A'; + while ($letter !== 'AAA') { + $letters[] = $letter++; + } + + // // get array header + $HeaderArray = array( + 'SO', + 'Item', + 'Name', + 'Point', + 'Remark', + 'Status', + 'Created At', + 'Updated At' + ); + // Set document properties + $objPHPExcel->getProperties()->setCreator("IPS") + ->setLastModifiedBy("CMS") + ->setTitle("System Export Excel") + ->setSubject("System Export Excel") + ->setDescription("System Export Excel") + ->setKeywords("System Excel") + ->setCategory("System Excel"); + + // Add some data + if (arrayCheck($HeaderArray)){ + $cound_header = 1; + $count = 0; + foreach($HeaderArray as $key => $header_name){ + // if sub exist + if (arrayCheck($header_name)){ + + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($letters[$count].$cound_header, $key); + $count_sub_header = $cound_header; + $sub_count = $count; + $count_sub_header++; + foreach($header_name as $header_name_sub){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($letters[$sub_count].$count_sub_header, $header_name_sub); + // continue first layer + $count = $sub_count; + // add second layer + $sub_count++; + } + }else{ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($letters[$count].$cound_header, $header_name); + } + // merge value + $begin = $count; + //$end = $count+15; + $end = $count; + + $count++; + } + } + + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY a.view_id ") ; + if ($mysqli_page->num_rows > 0){ + + $array_customer = array() ; + $count = 2 ; + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + $objPHPExcel->setActiveSheetIndex(0) + ->setCellValue('A'.$count, dataFilterDash($row_page['redeem_so'])) + ->setCellValue('B'.$count, dataFilterDash($row_page['title'])) + ->setCellValue('C'.$count, dataFilterDash(dataFilter($row_page['staff_name']).' ( '.$row_page['staff_idno']).' )') + ->setCellValue('D'.$count, dataFilterDash($row_page['point'])) + ->setCellValue('E'.$count, dataFilterDash($row_page['remark'])) + ->setCellValue('F'.$count, dataFilterDash($row_page['redeem_status'])) + ->setCellValue('G'.$count, dataFilterDash($row_page['created_at'])) + ->setCellValue('H'.$count, dataFilterDash($row_page['updated_at'])); + $count++; + } + + } + // file name + $fileName = "Redeem_" .time(); + + // Rename worksheet + $objPHPExcel->getActiveSheet()->setTitle($fileName); + + // Set active sheet index to the first sheet, so Excel opens this as the first sheet + $objPHPExcel->setActiveSheetIndex(0); + + // Save Excel 2007 file + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); + + //Setting the header type + header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); + header('Content-Disposition: attachment;filename="'.$fileName.'.xlsx"'); + header('Cache-Control: max-age=0'); + + // save to pc + $objWriter->save('php://output'); + header("Refresh: 0") ; + exit ; + break ; + } + } + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+
+
+ + + + +
+
+
+ +
+
Staff Redeem
+
+ + + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + $item_image = ( $row_page['item_file'] != '' ? PATH.'uploads/Redeem/'.dataFilter($row_page['item_file']) : '' ) ; + $staff_image = ( $row_page['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_page['staff_image']) : '' ) ; + + echo ' + + + + + + + + + + + '; + } + } + ?> + +
SOItemNamePointRemarkStatusCreated AtUpdated At
+ + '.dataFilter($row_page['redeem_so']).' + '.dataFilter($row_page['title']).'
+ '.( $item_image != '' ? '' : '' ).' +
+ '.dataFilter($row_page['staff_name']).' ( '.dataFilter($row_page['staff_idno']).' )
+ '.( $staff_image != '' ? '' : '' ).' +
'.dataFilter($row_page['point']).''.dataFilter($row_page['remark']).''.resetStatus($row_page['redeem_status']).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).'
+ +
+
+
+
+ \ No newline at end of file diff --git a/app-request-gallery.php b/app-request-gallery.php new file mode 100644 index 0000000..c9a9f0a --- /dev/null +++ b/app-request-gallery.php @@ -0,0 +1,223 @@ + $vv ){ + $mysqli->query( "UPDATE request_gallery SET + status = '".$update_status."' + WHERE gallery_id = '".$kk."'" ) ; + + if ( $update_status == 'rejected' ){ + pushToUserCron( 'request_gallery', $kk, $vv, 'Request Gallery', 'Request gallery has been reject.' ) ; + }else{ + pushToUserCron( 'request_gallery', $kk, $vv, 'Request Gallery', 'Request gallery has been update.' ) ; + } + } + + header( "Refresh: 0;" ) ; + exit ; +} + + + +//query +$search_query = '' ; +$search_name = escapeString($_GET['search_name']) ; +$search_idno = escapeString($_GET['search_idno']) ; +$search_status = escapeString($_GET['search_status']) ; +$search_date = ( $_GET['search_date'] != '' ? date('Y-m-d', strtotime($_GET['search_date'])) : '' ) ; + +$search_query = '' ; + +if ( $search_name != ''){ + $search_query .= " AND b.staff_name LIKE '%".$search_name."%'" ; +} +if ( $search_idno != ''){ + $search_query .= " AND b.staff_idno LIKE '%".$search_idno."%'" ; +} +if ( $search_status != ''){ + $search_query .= " AND a.status = '".$search_status."'" ; +} +if ( $search_date != '' ){ + $search_query .= " AND a.created_at LIKE '%".$search_date."%'" ; +} + +// related staff +// pagination +if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) +$start_from = ($product_page - 1) * LIMIT ; //end next and prev page + +// set search url +$search_url = 'search_name='.$search_name.'&search_idno='.$search_idno.'&search_status='.$search_status.'&search_date='.$search_date ; + +// page query +$mysqli_query = "SELECT a.gallery_id, a.title, a.file, a.status, a.created_at, a.updated_at, b.staff_id, b.staff_idno, b.staff_name FROM request_gallery a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL " . $search_query ; +$mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.gallery_id DESC LIMIT $start_from, " . LIMIT ) ; + +// load pagination +$page_pagination = nextPrevious( $product_page, LIMIT, $search_url, $mysqli_query ) ; + +// start header here +include 'requires/page_header.php'; +include 'requires/page_top.php'; +?> + +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+ + + +
+
Join Staff
+
+ + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_list = $mysqli_list->fetch_assoc() ){ + $image = ( $row_list['file'] != '' ? PATH.'uploads/RequestGallery/'.dataFilter($row_list['file']) : '' ) ; + + echo ' + + + + + + + + + '; + } + }else{ + echo + ' + + + + + + '; + } + ?> + +
ImageStaff IDTitleCreated AtUpdated At
'.( $image != '' ? '' : '' ).''.dataFilter($row_list['staff_name']).' ( '.dataFilter($row_list['staff_idno']).' )'.dataFilter($row_list['title']).''.resetDateFormat($row_list['created_at']).''.resetDateFormat($row_list['updated_at']).'
No data.
+ +
+
+ +
+
+ +
+ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check permission +if ( !permissionCheck($row_user, 'our-category-main-view') ){ + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch($page_mode){ + + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM setting_request + WHERE main_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query( "INSERT INTO setting_request + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('Request', 'main-'.$page, 'main-'.$page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // update database + $mysqli->query( "UPDATE setting_request SET + ".$image_query." + branch = '/".implode('/', $array_branch)."/', + is_main = '".( $_POST['is_main'] == 'yes' ? 'yes' : 'no' )."', + type = '".escapeString($_POST['type'])."' + WHERE main_id = '".$page."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $description = escapeString( $_POST['description_'.$klang] ) ; + + checkLangUpdate( 'setting_request_translation', 'main_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'description' => [ 'type' => 'input', 'value' => $description ] + ] ) ; + } + + + // refresh page + header("Location:app-request-main.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+
+
Is Direct Request
+
+
+
+
+
+
Type
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'description' => [ + 'type' => 'textarea', + 'title' => 'Description' + ] + ]) ; + ?> + +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+
+
+
+
+
+ + query( $mysqli_query." ORDER BY a.main_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
search
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
listing
+
+ + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + $id = $row_page['main_id'] ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Balance
' ; + if ( permissionCheck($row_user, 'our-category-main-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + if ( permissionCheck($row_user, 'our-category-main-stock') ){ + if ( $row_page['is_main'] == 'yes' ){ + echo ' + | + ' ; + } + } + echo ' + '.ucwords($row_page['type']).''.dataFilter($row_page['title']).''.( $row_page['balance'] != '' ? $row_page['balance'] : '0' ).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-request-stock.php b/app-request-stock.php new file mode 100644 index 0000000..6ae9810 --- /dev/null +++ b/app-request-stock.php @@ -0,0 +1,187 @@ + 0 ){ + $main_id = '0' ; +} + +if ( $_POST['hidden'] == 1 ){ + + $error = 'failed' ; + + $updatequantity= escapeString($_POST['updatequantity']) ; + $updateremark = escapeString($_POST['updateremark']) ; + + if ( ( $updatequantity < 0 || $updatequantity > 0) && $updatequantity != '' ){ + $before = 0 ; + + // get last movment + $mysqli_select = $mysqli->query( "SELECT balance FROM setting_request_movement + WHERE deleted_at IS NULL AND main_id = '".$main_id."' AND sub_id = '".$sub_id."' + ORDER BY movement_id DESC + LIMIT 1" ) ; + if ( $mysqli_select->num_rows > 0 ){ + $row_select = $mysqli_select->fetch_assoc() ; + $before = $row_select['balance'] ; + } + + $quantity = $updatequantity ; + $balance = ( $before + $quantity ) ; + + $mysqli->query( "INSERT INTO setting_request_movement + ( main_id, sub_id, before_quantity, quantity, balance, remark ) VALUES + ( '".$main_id."', '".$sub_id."', '".$before."', '".$quantity."', '".$balance."', '".$updateremark."' )" ) ; + $error = 'success' ; + } + + // refresh page + $_SESSION['system_result'] = $error ; + header("Refresh:0") ; + exit ; +} + + +// search query + +// pagination +if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) +$start_from = ($product_page - 1) * LIMIT ; //end next and prev page + +// set search url +$search_url = 'search_name='.$search_name ; + +// page query +$mysqli_query = "SELECT * FROM setting_request_movement + WHERE deleted_at IS NULL AND main_id = '".$main_id."' AND sub_id = '".$sub_id."' " . $search_query ; +$mysqli_page = $mysqli->query( $mysqli_query." ORDER BY movement_id DESC LIMIT $start_from, " . LIMIT ) ; + +// load pagination +$page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + +// start header here +include 'requires/page_header.php' ; +include 'requires/page_top.php' ; + +?> + +
+ + ' ; + break ; + case 'success' : + echo '
Thank you details has been updated
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
DateBeforeQuantityBalanceRemark
'.resetDateTimeFormat($row_page['created_at']).''.dataFilter($row_page['before_quantity']).''.dataFilter($row_page['quantity']).''.dataFilter($row_page['balance']).''.dataFilter($row_page['remark']).'
'.$lang['no_data'].'
+ +
+
+
+ + +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check permission +if ( !permissionCheck($row_user, 'our-category-sub-view') ){ + header('Location: index.php') ; + exit ; +} + +$mysqli_query_main = "SELECT a.main_id, b.title FROM setting_request a + LEFT JOIN setting_request_translation b ON ( a.main_id = b.main_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' " . $user_branch_permission_sql_symbol ; +$mysqli_main = $mysqli->query( $mysqli_query_main ) ; + +// mode type | all list | new | edit +switch($page_mode){ + + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM setting_request_sub + WHERE sub_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query( "INSERT INTO setting_request_sub + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('Request', 'sub-'.$page, 'sub-'.$page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // update database + $mysqli->query( "UPDATE setting_request_sub SET + ".$image_query." + branch = '/".implode('/', $array_branch)."/', + main_id = '".escapeString($_POST['main_id'])."', + type = '".escapeString($_POST['type'])."', + title = '".escapeString($_POST['title'])."' + WHERE sub_id = '".$page."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $description = escapeString( $_POST['description_'.$klang] ) ; + + checkLangUpdate( 'setting_request_sub_translation', 'sub_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'description' => [ 'type' => 'input', 'value' => $description ] + ] ) ; + } + + + // refresh page + header("Location:app-request-sub.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+
+
Type
+
+ +
+
+ +
+
Main Category
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'description' => [ + 'type' => 'textarea', + 'title' => 'Description' + ] + ]) ; + ?> + +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+
+
+
+
+ + + query( $mysqli_query." ORDER BY a.sub_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ +
+ \ No newline at end of file diff --git a/app-request.php b/app-request.php new file mode 100644 index 0000000..37d99ac --- /dev/null +++ b/app-request.php @@ -0,0 +1,681 @@ +query("SELECT * FROM request + WHERE request_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // update database + $mysqli->query( "UPDATE request SET + comment = '".escapeString($_POST['comment'])."', + status = '".escapeString($_POST['status'])."' + WHERE request_id = '".$page."'" ) ; + + if ( $_POST['status'] == 'confirmed' ){ + + // get last movment + $updateremark = 'Stock deduct from so number ' . $row_page['request_so'] ; + $updatequantity= -($row_page['quantity']) ; + + if ( ( $updatequantity < 0 || $updatequantity > 0) && $updatequantity != '' ){ + $before = 0 ; + + $main_id = $row_page['main_id'] ; + $sub_id = $row_page['sub_id'] ; + if ( $sub_id > 0 ){ + $main_id = 0 ; + } + + // get last movment + $mysqli_select = $mysqli->query( "SELECT balance FROM setting_request_movement + WHERE deleted_at IS NULL AND main_id = '".$main_id."' AND sub_id = '".$sub_id."' + ORDER BY movement_id DESC + LIMIT 1" ) ; + if ( $mysqli_select->num_rows > 0 ){ + $row_select = $mysqli_select->fetch_assoc() ; + $before = $row_select['balance'] ; + } + + $quantity = $updatequantity ; + $balance = ( $before + $quantity ) ; + + $mysqli->query( "INSERT INTO setting_request_movement + ( main_id, sub_id, before_quantity, quantity, balance, remark ) VALUES + ( '".$main_id."', '".$sub_id."', '".$before."', '".$quantity."', '".$balance."', '".$updateremark."' )" ) ; + } + } + + if ( $row_page['status'] != $_POST['status'] ){ + pushToUserCron( 'request', $page, $row_page['staff_id'], 'Request', 'Request has been update.' ) ; + } + + // refresh page + header("Location:app-request.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'our-request-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'our-request-edit') ) ){ + header('Location: app-request.php') ; + exit ; + } + + // get all media + $media_list = [] ; + $mysqli_media = $mysqli->query( "SELECT file, filetype FROM request_media + WHERE deleted_at IS NULL AND request_id = '".$page."'" ) ; + if ( $mysqli_media->num_rows > 0 ){ + while ( $row_media = $mysqli_media->fetch_assoc() ){ + $media_list[] = $row_media ; + } + } + + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query( "SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
Staff
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
Quantity
+
+ +
+
+ + +
+
Size
+
+ +
+
+ + + +
+
Selected Date
+
+ +
+
+
+
Time From
+
+ +
+
+
+
Time To
+
+ +
+
+ + +
+
Request Reason
+
+ +
+
+
+
Remark
+
+ +
+
+ + +
+
+
+ $v ){ ?> + + + + +
+
+ + +
+ +
+
Status
+
+ +
+
+ +
+
Comment
+
+ + +
+
+ + +
+
+
+ + + +
+
+ + +
+
+
+
+ + $search_status)); + + // page query + $mysqli_query = "SELECT a.*, b.staff_idno, b.staff_name, c.title as main_title, d.title as sub_title FROM request a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + LEFT JOIN setting_request c ON ( a.main_id = c.main_id ) + LEFT JOIN setting_request_sub d ON ( a.sub_id = d.sub_id ) + WHERE a.deleted_at IS NULL " . $search_query . $user_branch_permission_sql_a ; + + $mysqli_page = $mysqli->query( $mysqli_query." ORDER BY a.request_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + if ( $export_excel == 'export_eae' ){ + + $page_export_file_name = 'Request Report-'; + + $array_header_excel = array( + 'No.', + 'ID', + 'Name', + 'Type', + 'Main Category', + 'Sub Category', + 'Title', + 'Status', + 'Created At', + 'Updated At' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + $count_mysqli_export_page = 0; + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + $count_mysqli_export_page ++; + $array_body_excel[] = array( + $count_mysqli_export_page, + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + $mysqli_export_page['type'], + dataFilter($mysqli_export_page['main_title']), + dataFilter($mysqli_export_page['sub_title']), + strip_tags(dataFilter($mysqli_export_page['title'])), + $mysqli_export_page['status'], + date('Y-m-d', strtotime($mysqli_export_page['created_at'])), + date('Y-m-d', strtotime($mysqli_export_page['updated_at'])) + ) ; + } + $count_mysqli_export_page = 0; + } + + include 'export_excel_default.php'; + + } + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ + + + +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + + + + + + + num_rows > 0){ + + while( $row_page = $mysqli_page->fetch_assoc() ){ + $staff_lists[] = $row_page ; + $staff_ids[] = $row_page['staff_id'] ; + } + + $staff_departments = [] ; + $select_departments = $mysqli->query( "SELECT a.staff_id, b.department_desc FROM staff_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.staff_id IN ( ".implode(', ', $staff_ids)." )" ) ; + if ( $select_departments->num_rows > 0 ){ + while ( $row_departments = $select_departments->fetch_assoc() ){ + $staff_departments[$row_departments['staff_id']][] = $row_departments['department_desc'] ; + } + } + + foreach ( $staff_lists as $k => $row_page ){ + echo ' + + + + + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + + + + + ' ; + } + ?> + +
' ; + if ( permissionCheck($row_user, 'our-request-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['staff_name']).' ( '.dataFilter($row_page['staff_idno']).' )'.( count($staff_departments[$row_page['staff_id']]) > 0 ? ( implode( '
', $staff_departments[$row_page['staff_id']] ) ) : '' ).'
'.ucwords( str_replace( '-', ' ', $row_page['type'] ) ).''.dataFilter($row_page['main_title']).''.dataFilter($row_page['sub_title']).''.dataFilter($row_page['title']).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).''.resetStatus($row_page['status']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-screen.php b/app-screen.php new file mode 100644 index 0000000..c547c48 --- /dev/null +++ b/app-screen.php @@ -0,0 +1,368 @@ +query("SELECT * FROM app_screen + WHERE screen_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO app_screen ( created_at ) VALUES ( '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('AppScreen', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + // update database + $mysqli->query("UPDATE app_screen SET + ".$image_query." + sortable = '".escapeString($_POST['sortable'])."', + updated_at = '".TODAYDATE."' + WHERE screen_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + checkLangUpdate( 'app_screen_translation', 'screen_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'content' => [ 'type' => 'input', 'value' => $content ] + ] ) ; + } + + // refresh page + header("Location:app-screen.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'app-welcome-screen-new') ) ){ + header('Location: index.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'content' => [ + 'type' => 'input', + 'title' => $lang['Content'] + ] + ]) ; + ?> + +
+
Sortable
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+ * 500px x 1082px +
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+
+ + + +
+
+ +
+
+
+
+ + query( $mysqli_query." ORDER BY a.screen_id LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
search
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ + +
+ + +
+
+ + + + +
+
+ + +
+
listing
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['screen_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
+ + '.$title.''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ diff --git a/app-service.php b/app-service.php new file mode 100644 index 0000000..4df68d4 --- /dev/null +++ b/app-service.php @@ -0,0 +1,355 @@ +query("SELECT * FROM app_service + WHERE service_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO app_service ( created_at ) VALUES ( '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $file_name = $page.'.png' ; + + move_uploaded_file( $_FILES["image"]["tmp_name"], $_SERVER['DOCUMENT_ROOT'].'/uploads/AppService/'.$file_name ) ; + $image_query = "file = '".$file_name."'," ; + } + + // update database + $mysqli->query("UPDATE app_service SET + ".$image_query." + module = '".escapeString($_POST['module'])."', + on_off = '".escapeString($_POST['on_off'])."', + colour = '".escapeString($_POST['colour'])."' + WHERE service_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'app_service_translation', 'service_id', $page, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-service.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'app-service-new') ) ){ + header('Location: index.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Module
+
+ +
+
+
+
On / Off
+
+ +
+
+
+
Colour
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + + +
+
+
+ + + +
+
+ +
+
+
+
+ + query($mysqli_query." ORDER BY a.service_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['service_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
On / Off
+ + '.$title.''.ucwords($row_page['on_off']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-suggestion.php b/app-suggestion.php new file mode 100644 index 0000000..a1cc1db --- /dev/null +++ b/app-suggestion.php @@ -0,0 +1,513 @@ +query("SELECT * FROM suggestion + WHERE suggestion_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // update database + $mysqli->query( "UPDATE suggestion SET + comment = '".escapeString($_POST['comment'])."', + status = '".escapeString($_POST['status'])."' + WHERE suggestion_id = '".$page."'" ) ; + + if ( $row_page['status'] != $_POST['status'] ){ + pushToUserCron( 'suggestion', $page, $row_page['staff_id'], 'Suggestion', 'Suggestion has been update.' ) ; + } + + // refresh page + header("Location:app-suggestion.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'our-suggestion-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'our-suggestion-edit') ) ){ + header('Location: app-suggestion.php') ; + exit ; + } + + // get all media + $media_list = [] ; + $mysqli_media = $mysqli->query( "SELECT file, filetype FROM suggestion_media + WHERE deleted_at IS NULL AND suggestion_id = '".$page."'" ) ; + if ( $mysqli_media->num_rows > 0 ){ + while ( $row_media = $mysqli_media->fetch_assoc() ){ + $media_list[] = $row_media ; + } + } + + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query( "SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
Staff
+
+ +
+
+ +
+
Title
+
+ +
+
+
+
Content
+
+ +
+
+ +
+
Type
+
+ +
+
+ + +
+
+
+ $row_image ){ ?> + + ' ; + break ; + default : + echo ' + + ' ; + } + ?> + +
+
+ + +
+ +
+
Status
+
+ +
+
+ +
+
Comment
+
+ + +
+
+ + +
+
+
+ + + +
+
+ + +
+
+
+
+ + + query( $mysqli_query." ORDER BY a.suggestion_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + + if ( $export_excel == 'export_eae' ){ + + $page_export_file_name = 'Suggestion Report-'; + + $array_header_excel = array( + 'No.', + 'ID', + 'Name', + 'Subject', + 'Content', + 'Comment', + 'Status', + 'Created Date', + 'Updated Date' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + $count_mysqli_export_page = 0; + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + $count_mysqli_export_page ++; + $array_body_excel[] = array( + $count_mysqli_export_page, + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + $mysqli_export_page['title'], + dataFilter($mysqli_export_page['content']), + strip_tags(dataFilter($mysqli_export_page['comment'])), + $mysqli_export_page['status'], + date('Y-m-d', strtotime($mysqli_export_page['created_at'])), + date('Y-m-d', strtotime($mysqli_export_page['updated_at'])) + ) ; + } + $count_mysqli_export_page = 0; + } + + include 'export_excel_default.php'; + + } + + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
search
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ + +
+ + +
+
+ + + + +
+
+ + +
+
listing
+
+ + + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['suggestion_id'] ; + + echo ' + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + ' ; + } + ?> + +
' ; + if ( permissionCheck($row_user, 'our-suggestion-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['staff_name']).' ( '.dataFilter($row_page['staff_idno']).' )'.dataFilter($row_page['title']).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).''.resetStatus($row_page['status']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-support.php b/app-support.php new file mode 100644 index 0000000..a196ca9 --- /dev/null +++ b/app-support.php @@ -0,0 +1,316 @@ +query("SELECT * FROM app_support + WHERE support_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO app_support ( created_at ) VALUES ( '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE app_support SET + mobile = '".escapeString($_POST['mobile'])."', + sortable = '".escapeString($_POST['sortable'])."', + updated_at = '".TODAYDATE."' + WHERE support_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $name = escapeString( $_POST['name_'.$klang] ) ; + + checkLangUpdate( 'app_support_translation', 'support_id', $page, $klang, [ + 'name' => [ 'type' => 'input', 'value' => $name ] + ] ) ; + } + + // refresh page + header("Location:app-support.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'app-support-new') ) ){ + header('Location: index.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ + [ + 'type' => 'input', + 'title' => $lang['Name'] + ] + ]) ; + ?> + +
+
+
+ +
+
+ +
+
Sortable
+
+ +
+
+ +
+
+
+ + + +
+
+ +
+
+
+
+ + query( $mysqli_query." ORDER BY a.support_id LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['support_id'] ; + $name = dataFilter($row_page['name']) ; + + echo ' + + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
Sortable
+ + '.$name.''.$row_page['mobile'].''.resetDateFormat($row_page['created_at']).''.dataFilter($row_page['sortable']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-training-gallery-category.php b/app-training-gallery-category.php new file mode 100644 index 0000000..09a8958 --- /dev/null +++ b/app-training-gallery-category.php @@ -0,0 +1,336 @@ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check permission +if ( !permissionCheck($row_user, 'training-gallery-category') ){ + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch( $page_mode ){ + + // edit training category + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM training_gallery_category + WHERE category_id = '".$category_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $category_id == '' ){ + $mysqli->query( "INSERT INTO training_gallery_category + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $category_id = $mysqli->insert_id ; + } + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // update database + $mysqli->query( "UPDATE training_gallery_category SET + branch = '/".implode('/', $array_branch)."/', + status = '".escapeString($_POST['status'])."' + WHERE category_id = '".$category_id."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'training_gallery_category_translation', 'category_id', $category_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:app-training-gallery-category.php?page_mode=edit&category_id=".$category_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+ + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
+
Status
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+
+ + + query( $mysqli_query." ORDER BY a.category_id DESC LIMIT $start_from, " . LIMIT ) ; + + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ +
+
+ + + + +
+
+ +
+
+
+ + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['category_id'] ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + + ' ; + } + ?> + +
Created Date
+ + '.dataFilter($row_page['title']).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/app-training-gallery-view.php b/app-training-gallery-view.php new file mode 100644 index 0000000..6af553b --- /dev/null +++ b/app-training-gallery-view.php @@ -0,0 +1,124 @@ +query("SELECT a.gallery_id, a.category_id, a.title, a.file, a.status, a.created_at, a.updated_at, b.staff_id, b.staff_idno, b.staff_name FROM training_gallery a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.gallery_id = '".$gallery_id."' LIMIT 1"); +if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; +}else{ + exit ; +} + +// update database +if ( $_POST['hide'] == 1 ){ + + // update database + $mysqli->query( "UPDATE training_gallery SET + category_id = '".escapeString($_POST['category_id'])."' + WHERE gallery_id = '".$gallery_id."'" ) ; + + // refresh page + header("Location:app-training-gallery-view.php?page_mode=edit&gallery_id=".$gallery_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; +} + +// start header here +include 'requires/page_header.php'; +include 'requires/page_top.php'; +?> + +
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
Staff ID
+
+ +
+
+
+
Title
+
+ +
+
+
+
Status
+
+ +
+
+ +
+
Category
+
+ +
+
+ +
+
+
+ + + +
+
+
+
+
+ + + $vv ){ + $mysqli->query( "UPDATE training_gallery SET + status = '".$update_status."' + WHERE gallery_id = '".$kk."'" ) ; + + if ( $update_status == 'rejected' ){ + pushToUserCron( 'training_gallery', $kk, $vv, 'Training Gallery', 'Training gallery has been reject.' ) ; + }else{ + pushToUserCron( 'training_gallery', $kk, $vv, 'Training Gallery', 'Training gallery has been update.' ) ; + } + } + + header( "Refresh: 0;" ) ; + exit ; +} + + + +//query +$search_query = '' ; +$search_name = escapeString($_GET['search_name']) ; +$search_idno = escapeString($_GET['search_idno']) ; +$search_status = escapeString($_GET['search_status']) ; +$search_date = ( $_GET['search_date'] != '' ? date('Y-m-d', strtotime($_GET['search_date'])) : '' ) ; + +$search_query = '' ; + +if ( $search_name != ''){ + $search_query .= " AND b.staff_name LIKE '%".$search_name."%'" ; +} +if ( $search_idno != ''){ + $search_query .= " AND b.staff_idno LIKE '%".$search_idno."%'" ; +} +if ( $search_status != ''){ + $search_query .= " AND a.status = '".$search_status."'" ; +} +if ( $search_date != '' ){ + $search_query .= " AND a.created_at LIKE '%".$search_date."%'" ; +} + +// related staff +// pagination +if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) +$start_from = ($product_page - 1) * LIMIT ; //end next and prev page + +// set search url +$search_url = 'search_name='.$search_name.'&search_idno='.$search_idno.'&search_status='.$search_status.'&search_date='.$search_date ; + +// page query +$mysqli_query = "SELECT a.gallery_id, a.title, a.file, a.status, a.created_at, a.updated_at, b.staff_id, b.staff_idno, b.staff_name FROM training_gallery a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL " . $search_query ; +$mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.gallery_id DESC LIMIT $start_from, " . LIMIT ) ; + +// load pagination +$page_pagination = nextPrevious( $product_page, LIMIT, $search_url, $mysqli_query ) ; + +// start header here +include 'requires/page_header.php'; +include 'requires/page_top.php'; +?> + +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+ +
+ +
+
+ + + + +
+
+ +
+
Join Staff
+
+ + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_list = $mysqli_list->fetch_assoc() ){ + $image = ( $row_list['file'] != '' ? PATH.'uploads/TrainingGallery/'.dataFilter($row_list['file']) : '' ) ; + + echo ' + + + + + + + + + + '; + } + }else{ + echo + ' + + + + + + + + + '; + } + ?> + +
ActionImageStaff IDTitleStatusCreated AtUpdated At
' ; + if ( $row_list['status'] == 'pending' ){ + echo ' +
+ + +
' ; + } + echo ' +
+ + '.( $image != '' ? '' : '' ).''.dataFilter($row_list['staff_name']).' ( '.dataFilter($row_list['staff_idno']).' )'.dataFilter($row_list['title']).''.resetStatus($row_list['status']).''.resetDateFormat($row_list['created_at']).''.resetDateFormat($row_list['updated_at']).'
No data.
+ +
+
+ +
+
+
+ +query( "SELECT * FROM branch + WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// check permission +if ( !permissionCheck($row_user, 'training-view') ){ + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch($page_mode){ + + // edit training + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM training + WHERE training_id = '".$training_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $training_id == '' ){ + $mysqli->query( "INSERT INTO training + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $training_id = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('Training', $training_id, $training_id, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + $array_branch = [] ; + foreach ( $_POST['branch'] as $k_branch => $v_branch ){ + $array_branch[] = escapeString( $v_branch ) ; + } + + // update database + $mysqli->query( "UPDATE training SET + ".$image_query." + branch = '/".implode('/', $array_branch)."/', + training_type = '".escapeString($_POST['training_type'])."', + date_start = '".escapeString($_POST['date_start'])."', + date_end = '".escapeString($_POST['date_end'])."', + status = '".escapeString($_POST['status'])."' + WHERE training_id = '".$training_id."'" ) ; + + $title_en = '' ; + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + if ( $klang == 'en' ){ $title_en = $title ; } + + checkLangUpdate( 'training_translation', 'training_id', $training_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'content' => [ 'type' => 'input', 'value' => $content ] + ] ) ; + } + + if ( $submit_type == 'new' ){ + pushToBranchUser( $array_branch, [], 'training', $training_id, 'New Training', ( $title_en != '' ? $title_en : 'New training has been submitted.' ) ) ; + } + + // refresh page + header("Location:app-training.php?page_mode=edit&training_id=".$training_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'training-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'training-edit') ) ){ + header('Location: app-training.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + '.$lang['Thank you details has been updated'].'
' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
+
+
+
+ +
+
+
+ +
+
+ + + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'content' => [ + 'type' => 'textarea', + 'title' => $lang['Content'] + ] + ]) ; + ?> + +
+
Training Type
+
+ +
+
+
+
Date Start
+
+ +
+
+
+
Date End
+
+ +
+
+ +
+
+
+
+
+ + + /> +
+
+
+
+ +
+
+
+ + + + +
+
+ + + + +
+
Status
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+
+ + + query("SELECT a.training_id, b.title, b.content FROM training a + LEFT JOIN training_translation b ON ( a.training_id = b.training_id ) + WHERE a.training_id = '".$training_id."' LIMIT 1"); + if ($mysqli_page->num_rows == 0){ + exit ; + } + + $row_page = $mysqli_page->fetch_assoc() ; + + // update database + if ( $_POST['hide'] == 1 ){ + $update_status = escapeString( $_POST['update_status'] ) ; + + foreach ( $_POST['multiple_status'] as $kk => $vv ){ + $mysqli->query( "UPDATE staff_training SET + status = '".$update_status."' + WHERE view_id = '".$kk."'" ) ; + + if ( $update_status == 'rejected' ){ + pushToUserCron( 'staff_training', $kk, $vv, 'Training', 'Training has been reject.' ) ; + }else{ + pushToUserCron( 'staff_training', $kk, $vv, 'Training', 'Training has been update.' ) ; + } + } + + header( "Refresh: 0;" ) ; + exit ; + } + + + + //query + $search_query = '' ; + $search_name = escapeString($_GET['search_name']) ; + $search_idno = escapeString($_GET['search_idno']) ; + $search_rated = escapeString($_GET['search_rated']) ; + $search_date = ( $_GET['search_date']!= '' ? date('Y-m-d', strtotime($_GET['search_date'])) : '' ) ; + $search_training = escapeString($_GET['search_training']) ; + $search_type = $_GET['search_type'] ; + $export_excel = $_GET['export-excel']; + + $search_query = ''; + + if( $search_name != ''){ + $search_query .= " AND b.staff_name LIKE '%".$search_name."%'" ; + } + if( $search_idno != ''){ + $search_query .= " AND b.staff_idno LIKE '%".$search_idno."%'" ; + } + if( $search_rated != ''){ + $search_query .= " AND a.rated = '".$search_rated."'" ; + } + if ( $search_date != '' ){ + $search_query .= " AND a.created_at >= '".$search_date."' " ; + } + // search query + if ($search != ''){ + $search_query .= " AND ( title LIKE '%".$search."%' )" ; + } + if( $search_type != ''){ + $search_query .= " AND a.status = '".$search_type."' " ; + } + + // related staff + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_name='.$search_name.'&search_rated='.$search_rated.'&search_date='.$search_date.'&page_mode='.$page_mode.'&training_id='.$training_id.'&search_idno='.$search_idno; + + // page query + $mysqli_query = "SELECT a.view_id, a.training_so, a.training_id, a.rated, a.comment, a.status, a.created_at, a.updated_at, b.staff_id, b.staff_idno, b.staff_name, b.staff_image, c.title FROM staff_training a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + LEFT JOIN training_translation c ON ( a.training_id = c.training_id ) + WHERE a.deleted_at IS NULL AND c.lang = 'en' AND a.training_id = '".$training_id."' " . $search_query ; + $mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.view_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + + if ( $export_excel == 'export_eae' ){ + + $page_export_file_name = 'Training Report-'; + + $array_header_excel = array( + 'No.', + 'SO Number', + 'ID', + 'Name', + 'Rated', + 'Comment', + 'Training', + 'Status', + 'Created At', + 'Updated At' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + $count_mysqli_export_page = 0; + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + $count_mysqli_export_page ++; + $array_body_excel[] = array( + $count_mysqli_export_page, + $mysqli_export_page['training_so'], + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + $mysqli_export_page['rated'], + $mysqli_export_page['comment'], + dataFilter($mysqli_export_page['title']), + $mysqli_export_page['status'], + date('Y-m-d', strtotime($mysqli_export_page['created_at'])), + date('Y-m-d', strtotime($mysqli_export_page['updated_at'])) + ) ; + } + $count_mysqli_export_page = 0; + } + + include 'export_excel_default.php'; + + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + +
+
search
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ +
+
+ + + + +
+
+ +
+
Join Staff
+
+ + + + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_list = $mysqli_list->fetch_assoc() ){ + $staff_image = ( $row_list['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_list['staff_image']) : '' ) ; + + echo ' + + + + + + + + + + + + '; + } + }else{ + echo + ' + + + + + + + + + + + '; + } + ?> + +
So NumberProfileStaff IDNameRatedCommentStatusCreated AtUpdated At
' ; + if ( $row_list['status'] == 'pending' || $row_list['status'] == 'approved' ){ + echo ' +
+ + +
' ; + } + echo ' +
'.dataFilter($row_list['training_so']).''.( $staff_image != '' ? '' : '' ).''.dataFilter($row_list['staff_idno']).''.dataFilter($row_list['staff_name']).''.dataFilter($row_list['rated']).''.dataFilter($row_list['comment']).''.resetStatus($row_list['status']).''.resetDateFormat($row_list['created_at']).''.resetDateFormat($row_list['updated_at']).'
No data.
+ +
+
+ +
+ +
+
+
+
+ +
+
Title
+
+ +
+
+
+
Content
+
+ + +
+
+ +
+
Training Type
+
+ +
+
+
+
Date Start
+
+ +
+
+
+
Date End
+
+ +
+
+ + +
+
+
+ + + + +
+
+ + + + +
+
Status
+
+ +
+
+
+
+
+
+
+ + query( $mysqli_query." ORDER BY a.view_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + + if ( $export_excel == 'export_eae' ){ + + $page_export_file_name = 'Training List-'; + + $array_header_excel = array( + 'No.', + 'SO Number', + 'ID', + 'Name', + 'Training', + 'Status', + 'Created At', + 'Updated At' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + $count_mysqli_export_page = 0; + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + $count_mysqli_export_page ++; + $array_body_excel[] = array( + $count_mysqli_export_page, + $mysqli_export_page['training_so'], + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + dataFilter($mysqli_export_page['title']), + $mysqli_export_page['status'], + date('Y-m-d', strtotime($mysqli_export_page['created_at'])), + date('Y-m-d', strtotime($mysqli_export_page['updated_at'])) + ) ; + } + $count_mysqli_export_page = 0; + } + + include 'export_excel_default.php'; + + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
+
+ + +
+
search
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+
Join Staff
+
+ + + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_list = $mysqli_list->fetch_assoc() ){ + $staff_image = ( $row_list['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_list['staff_image']) : '' ) ; + + echo ' + + + + + + + + + + + '; + } + }else{ + echo + ' + + + + + + + + + + '; + } + ?> + +
So NumberProfileStaff IDNameTrainingStatusCreated AtUpdated At
' ; + if ( $row_list['status'] == 'pending' || $row_list['status'] == 'approved' ){ + echo ' +
+ + +
' ; + } + echo ' +
'.dataFilter($row_list['training_so']).''.( $staff_image != '' ? '' : '' ).''.dataFilter($row_list['staff_idno']).''.dataFilter($row_list['staff_name']).''.$row_list['title'].''.resetStatus($row_list['status']).''.resetDateFormat($row_list['created_at']).''.resetDateFormat($row_list['updated_at']).'
No data.
+ +
+
+
+
+ + query( "SELECT training_id, status FROM staff_training + WHERE deleted_at IS NULL AND training_so = '".$qrcode."' LIMIT 1" ) ; + + if ( $select->num_rows > 0 ){ + $error = 'Invalid status' ; + + $row = $select->fetch_assoc() ; + + if ( $row['status'] == 'approved' ){ + $error = 'Success' ; + + $mysqli->query( "UPDATE staff_training SET + status = 'confirmed' + WHERE training_id = '".$row['training_id']."'" ) ; + } + } + } + + $_SESSION['system_result'] = $error ; + header( "Refresh: 0;" ) ; + exit ; + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search ; + + // page query + $mysqli_query = "SELECT a.training_so, a.created_at, a.updated_at, c.staff_idno, c.staff_name FROM staff_training a + LEFT JOIN training b ON ( a.training_id = b.training_id ) + LEFT JOIN staff c ON ( a.staff_id = c.staff_id ) + WHERE a.deleted_at IS NULL AND a.status = 'confirmed' " . $search_query ; + $mysqli_page = $mysqli->query( $mysqli_query." ORDER BY a.view_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+ + +
+ + +
+
+
+
+
Scan Qrde
+
+ +
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ + + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_assoc() ){ + echo ' + + + + + + + '; + } + }else{ + echo + ' + + + + + + '; + } + + ?> + +
So NumberStaff IDStaff NameCreated DateUpdated Date
'.dataFilter($row_page['training_so']).''.dataFilter($row_page['staff_idno']).''.dataFilter($row_page['staff_name']).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).'
No data.
+ +
+
+
+
+
+ + query( $mysqli_query." ORDER BY a.training_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
+
+ + +
+
search
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+ + +
+
+ + + + +
+
+ + +
+
+
+ + + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_assoc() ){ + + $staff_training = $mysqli->query( "SELECT view_id FROM staff_training + WHERE deleted_at IS NULL AND training_id = '".$row_page['training_id']."' AND status IN ( 'pending' )" ) ; + $total_training = $staff_training->num_rows ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + + ' ; + } + ?> + +
Created Date
' ; + if ( permissionCheck($row_user, 'training-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + | + ( '.$total_training.' ) + '.dataFilter($row_page['title']).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
+ + +
+
'.$lang['no_data'].'
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/chart_iframe.php b/chart_iframe.php new file mode 100644 index 0000000..d511ddc --- /dev/null +++ b/chart_iframe.php @@ -0,0 +1,1590 @@ + + + + + + + +
+ + +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+
+ + + + + + + + + + + +
TASK
+
+
+ + + + + + + + + + + +
SUGGESTION
+
+
+ + + + + + + + + + + +
REQUEST
+
+
+ + + + + + + + + + + +
GRIEVANCE
+
+
+ + + + + + + + + + + +
REDEEM
+
+
+ + + + + + + + + + + +
ASSOCIATION
+
+
+ + + + + + + + + + + +
TRAINING
+
+
+ + + + + + + + + + + +
HEADCOUNT
+
+
+ + + + + + + + + + + +
NOMINATION
+
+
+ + + + + + + + + + + +
RESIGNATION
+
+
+
+ + + diff --git a/check_password.php b/check_password.php new file mode 100644 index 0000000..5d61397 --- /dev/null +++ b/check_password.php @@ -0,0 +1,65 @@ +query("SELECT a.password_id, a.content FROM app_password a LEFT JOIN app_password_translation b ON ( a.password_id = b.password_id ) WHERE a.deleted_at IS NULL AND a.password_type = '".$type."' AND b.lang = 'en'"); +if ($mysqli_ck_password->num_rows > 0) { + $row_ck_password = $mysqli_ck_password->fetch_array(); +} + +include 'requires/page_header.php'; +include 'requires/page_top.php'; +?> + +
+ +
+
+
+
+
+
Password
+
+ + +
+
+
+
+
+ + + +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..369bdbe --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "require": { + "phpoffice/phpspreadsheet": "^1.12", + "google/apiclient": "^2.14", + "mpdf/mpdf": "^8.2", + "verot/class.upload.php": "^2.1", + "guzzlehttp/guzzle": "^6.5" + }, + "config": { + "platform": { + "php": "7.1.0" + } + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..8874cec --- /dev/null +++ b/composer.lock @@ -0,0 +1,1974 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "0df5da322d1c4ec025548040996fca8d", + "packages": [ + { + "name": "firebase/php-jwt", + "version": "v6.4.0", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "4dd1e007f22a927ac77da5a3fbb067b42d3bc224" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/4dd1e007f22a927ac77da5a3fbb067b42d3bc224", + "reference": "4dd1e007f22a927ac77da5a3fbb067b42d3bc224", + "shasum": "" + }, + "require": { + "php": "^7.1||^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.5||^7.4", + "phpspec/prophecy-phpunit": "^1.1", + "phpunit/phpunit": "^7.5||^9.5", + "psr/cache": "^1.0||^2.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-sodium": "Support EdDSA (Ed25519) signatures", + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" + }, + "type": "library", + "autoload": { + "psr-4": { + "Firebase\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" + }, + { + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" + } + ], + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", + "keywords": [ + "jwt", + "php" + ], + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v6.4.0" + }, + "time": "2023-02-09T21:01:23+00:00" + }, + { + "name": "google/apiclient", + "version": "v2.14.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-api-php-client.git", + "reference": "789c8b07cad97f420ac0467c782036f955a2ad89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/789c8b07cad97f420ac0467c782036f955a2ad89", + "reference": "789c8b07cad97f420ac0467c782036f955a2ad89", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "~2.0||~3.0||~4.0||~5.0||~6.0", + "google/apiclient-services": "~0.200", + "google/auth": "^1.10", + "guzzlehttp/guzzle": "~5.3.3||~6.0||~7.0", + "guzzlehttp/psr7": "^1.8.4||^2.2.1", + "monolog/monolog": "^1.17||^2.0||^3.0", + "php": "^5.6|^7.0|^8.0", + "phpseclib/phpseclib": "~2.0||^3.0.2" + }, + "require-dev": { + "cache/filesystem-adapter": "^0.3.2|^1.1", + "composer/composer": "^1.10.22", + "phpcompatibility/php-compatibility": "^9.2", + "phpspec/prophecy-phpunit": "^1.1||^2.0", + "phpunit/phpunit": "^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.0", + "symfony/css-selector": "~2.1", + "symfony/dom-crawler": "~2.1", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "cache/filesystem-adapter": "For caching certs and tokens (using Google\\Client::setCache)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "files": [ + "src/aliases.php" + ], + "psr-4": { + "Google\\": "src/" + }, + "classmap": [ + "src/aliases.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Client library for Google APIs", + "homepage": "http://developers.google.com/api-client-library/php", + "keywords": [ + "google" + ], + "support": { + "issues": "https://github.com/googleapis/google-api-php-client/issues", + "source": "https://github.com/googleapis/google-api-php-client/tree/v2.14.0" + }, + "time": "2023-05-11T21:54:55+00:00" + }, + { + "name": "google/apiclient-services", + "version": "v0.302.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-api-php-client-services.git", + "reference": "ac872f59a7b4631b12628fe990c167d18a71c783" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/ac872f59a7b4631b12628fe990c167d18a71c783", + "reference": "ac872f59a7b4631b12628fe990c167d18a71c783", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^5.7||^8.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "autoload.php" + ], + "psr-4": { + "Google\\Service\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Client library for Google APIs", + "homepage": "http://developers.google.com/api-client-library/php", + "keywords": [ + "google" + ], + "support": { + "issues": "https://github.com/googleapis/google-api-php-client-services/issues", + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.302.0" + }, + "time": "2023-05-16T01:08:12+00:00" + }, + { + "name": "google/auth", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-auth-library-php.git", + "reference": "f1f0d0319e2e7750ebfaa523c78819792a9ed9f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/f1f0d0319e2e7750ebfaa523c78819792a9ed9f7", + "reference": "f1f0d0319e2e7750ebfaa523c78819792a9ed9f7", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "^5.5||^6.0", + "guzzlehttp/guzzle": "^6.2.1|^7.0", + "guzzlehttp/psr7": "^1.7|^2.0", + "php": "^7.1||^8.0", + "psr/cache": "^1.0|^2.0|^3.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "guzzlehttp/promises": "0.1.1|^1.3", + "kelvinmo/simplejwt": "0.7.0", + "phpseclib/phpseclib": "^2.0.31||^3.0", + "phpspec/prophecy-phpunit": "^1.1||^2.0", + "phpunit/phpunit": "^7.5||^9.0.0", + "sebastian/comparator": ">=1.2.3", + "squizlabs/php_codesniffer": "^3.5" + }, + "suggest": { + "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Auth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Auth Library for PHP", + "homepage": "http://github.com/google/google-auth-library-php", + "keywords": [ + "Authentication", + "google", + "oauth2" + ], + "support": { + "docs": "https://googleapis.github.io/google-auth-library-php/main/", + "issues": "https://github.com/googleapis/google-auth-library-php/issues", + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.26.0" + }, + "time": "2023-04-05T15:11:57+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.5.8", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.9", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.17" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/6.5.8" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2022-06-20T22:16:07+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2023-05-21T12:31:43+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.9.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2023-04-17T16:00:37+00:00" + }, + { + "name": "markbaker/complex", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "c3131244e29c08d44fefb49e0dd35021e9e39dd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/c3131244e29c08d44fefb49e0dd35021e9e39dd2", + "reference": "c3131244e29c08d44fefb49e0dd35021e9e39dd2", + "shasum": "" + }, + "require": { + "php": "^5.6.0|^7.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "phpcompatibility/php-compatibility": "^9.0", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "^4.0|^5.0|^6.0|^7.0", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^4.8.35|^5.0|^6.0|^7.0", + "sebastian/phpcpd": "2.*", + "squizlabs/php_codesniffer": "^3.4.0" + }, + "type": "library", + "autoload": { + "files": [ + "classes/src/functions/abs.php", + "classes/src/functions/acos.php", + "classes/src/functions/acosh.php", + "classes/src/functions/acot.php", + "classes/src/functions/acoth.php", + "classes/src/functions/acsc.php", + "classes/src/functions/acsch.php", + "classes/src/functions/argument.php", + "classes/src/functions/asec.php", + "classes/src/functions/asech.php", + "classes/src/functions/asin.php", + "classes/src/functions/asinh.php", + "classes/src/functions/atan.php", + "classes/src/functions/atanh.php", + "classes/src/functions/conjugate.php", + "classes/src/functions/cos.php", + "classes/src/functions/cosh.php", + "classes/src/functions/cot.php", + "classes/src/functions/coth.php", + "classes/src/functions/csc.php", + "classes/src/functions/csch.php", + "classes/src/functions/exp.php", + "classes/src/functions/inverse.php", + "classes/src/functions/ln.php", + "classes/src/functions/log2.php", + "classes/src/functions/log10.php", + "classes/src/functions/negative.php", + "classes/src/functions/pow.php", + "classes/src/functions/rho.php", + "classes/src/functions/sec.php", + "classes/src/functions/sech.php", + "classes/src/functions/sin.php", + "classes/src/functions/sinh.php", + "classes/src/functions/sqrt.php", + "classes/src/functions/tan.php", + "classes/src/functions/tanh.php", + "classes/src/functions/theta.php", + "classes/src/operations/add.php", + "classes/src/operations/subtract.php", + "classes/src/operations/multiply.php", + "classes/src/operations/divideby.php", + "classes/src/operations/divideinto.php" + ], + "psr-4": { + "Complex\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPComplex/issues", + "source": "https://github.com/MarkBaker/PHPComplex/tree/1.5.0" + }, + "time": "2020-08-26T19:47:57+00:00" + }, + { + "name": "markbaker/matrix", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPMatrix.git", + "reference": "44bb1ab01811116f01fe216ab37d921dccc6c10d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/44bb1ab01811116f01fe216ab37d921dccc6c10d", + "reference": "44bb1ab01811116f01fe216ab37d921dccc6c10d", + "shasum": "" + }, + "require": { + "php": "^5.6.0|^7.0.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "dev-master", + "phploc/phploc": "^4", + "phpmd/phpmd": "dev-master", + "phpunit/phpunit": "^5.7|^6.0|7.0", + "sebastian/phpcpd": "^3.0", + "squizlabs/php_codesniffer": "^3.0@dev" + }, + "type": "library", + "autoload": { + "files": [ + "classes/src/Functions/adjoint.php", + "classes/src/Functions/antidiagonal.php", + "classes/src/Functions/cofactors.php", + "classes/src/Functions/determinant.php", + "classes/src/Functions/diagonal.php", + "classes/src/Functions/identity.php", + "classes/src/Functions/inverse.php", + "classes/src/Functions/minors.php", + "classes/src/Functions/trace.php", + "classes/src/Functions/transpose.php", + "classes/src/Operations/add.php", + "classes/src/Operations/directsum.php", + "classes/src/Operations/subtract.php", + "classes/src/Operations/multiply.php", + "classes/src/Operations/divideby.php", + "classes/src/Operations/divideinto.php" + ], + "psr-4": { + "Matrix\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with matrices", + "homepage": "https://github.com/MarkBaker/PHPMatrix", + "keywords": [ + "mathematics", + "matrix", + "vector" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPMatrix/issues", + "source": "https://github.com/MarkBaker/PHPMatrix/tree/1.2.3" + }, + "time": "2021-01-26T14:36:01+00:00" + }, + { + "name": "monolog/monolog", + "version": "1.27.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "904713c5929655dc9b97288b69cfeedad610c9a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/904713c5929655dc9b97288b69cfeedad610c9a1", + "reference": "904713c5929655dc9b97288b69cfeedad610c9a1", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpstan/phpstan": "^0.12.59", + "phpunit/phpunit": "~4.5", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/1.27.1" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2022-06-09T08:53:42+00:00" + }, + { + "name": "mpdf/mpdf", + "version": "v8.2.5", + "source": { + "type": "git", + "url": "https://github.com/mpdf/mpdf.git", + "reference": "e175b05e3e00977b85feb96a8cccb174ac63621f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/mpdf/zipball/e175b05e3e00977b85feb96a8cccb174ac63621f", + "reference": "e175b05e3e00977b85feb96a8cccb174ac63621f", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "ext-mbstring": "*", + "mpdf/psr-http-message-shim": "^1.0 || ^2.0", + "mpdf/psr-log-aware-trait": "^2.0 || ^3.0", + "myclabs/deep-copy": "^1.7", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": "^5.6 || ^7.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", + "psr/http-message": "^1.0 || ^2.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "setasign/fpdi": "^2.1" + }, + "require-dev": { + "mockery/mockery": "^1.3.0", + "mpdf/qrcode": "^1.1.0", + "squizlabs/php_codesniffer": "^3.5.0", + "tracy/tracy": "~2.5", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "ext-bcmath": "Needed for generation of some types of barcodes", + "ext-xml": "Needed mainly for SVG manipulation", + "ext-zlib": "Needed for compression of embedded resources, such as fonts" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Mpdf\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-only" + ], + "authors": [ + { + "name": "Matěj Humpál", + "role": "Developer, maintainer" + }, + { + "name": "Ian Back", + "role": "Developer (retired)" + } + ], + "description": "PHP library generating PDF files from UTF-8 encoded HTML", + "homepage": "https://mpdf.github.io", + "keywords": [ + "pdf", + "php", + "utf-8" + ], + "support": { + "docs": "https://mpdf.github.io", + "issues": "https://github.com/mpdf/mpdf/issues", + "source": "https://github.com/mpdf/mpdf" + }, + "funding": [ + { + "url": "https://www.paypal.me/mpdf", + "type": "custom" + } + ], + "time": "2024-11-18T15:30:42+00:00" + }, + { + "name": "mpdf/psr-http-message-shim", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/mpdf/psr-http-message-shim.git", + "reference": "3206e6b80b6d2479e148ee497e9f2bebadc919db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/psr-http-message-shim/zipball/3206e6b80b6d2479e148ee497e9f2bebadc919db", + "reference": "3206e6b80b6d2479e148ee497e9f2bebadc919db", + "shasum": "" + }, + "require": { + "psr/http-message": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mpdf\\PsrHttpMessageShim\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Dorison", + "email": "mark@chromatichq.com" + }, + { + "name": "Kristofer Widholm", + "email": "kristofer@chromatichq.com" + }, + { + "name": "Nigel Cunningham", + "email": "nigel.cunningham@technocrat.com.au" + } + ], + "description": "Shim to allow support of different psr/message versions.", + "support": { + "issues": "https://github.com/mpdf/psr-http-message-shim/issues", + "source": "https://github.com/mpdf/psr-http-message-shim/tree/1.0.0" + }, + "time": "2023-09-01T05:59:47+00:00" + }, + { + "name": "mpdf/psr-log-aware-trait", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/mpdf/psr-log-aware-trait.git", + "reference": "7a077416e8f39eb626dee4246e0af99dd9ace275" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/psr-log-aware-trait/zipball/7a077416e8f39eb626dee4246e0af99dd9ace275", + "reference": "7a077416e8f39eb626dee4246e0af99dd9ace275", + "shasum": "" + }, + "require": { + "psr/log": "^1.0 || ^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mpdf\\PsrLogAwareTrait\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Dorison", + "email": "mark@chromatichq.com" + }, + { + "name": "Kristofer Widholm", + "email": "kristofer@chromatichq.com" + } + ], + "description": "Trait to allow support of different psr/log versions.", + "support": { + "issues": "https://github.com/mpdf/psr-log-aware-trait/issues", + "source": "https://github.com/mpdf/psr-log-aware-trait/tree/v2.0.0" + }, + "time": "2023-05-03T06:18:28+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.12.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2024-11-08T17:47:46+00:00" + }, + { + "name": "paragonie/constant_time_encoding", + "version": "v2.7.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "52a0d99e69f56b9ec27ace92ba56897fe6993105" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/52a0d99e69f56b9ec27ace92ba56897fe6993105", + "reference": "52a0d99e69f56b9ec27ace92ba56897fe6993105", + "shasum": "" + }, + "require": { + "php": "^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^6|^7|^8|^9", + "vimeo/psalm": "^1|^2|^3|^4" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "time": "2024-05-08T12:18:48+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" + }, + { + "name": "phpoffice/phpspreadsheet", + "version": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", + "reference": "f79611d6dc1f6b7e8e30b738fc371b392001dbfd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/f79611d6dc1f6b7e8e30b738fc371b392001dbfd", + "reference": "f79611d6dc1f6b7e8e30b738fc371b392001dbfd", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-fileinfo": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "ext-xmlreader": "*", + "ext-xmlwriter": "*", + "ext-zip": "*", + "ext-zlib": "*", + "markbaker/complex": "^1.4", + "markbaker/matrix": "^1.2", + "php": "^7.1", + "psr/simple-cache": "^1.0" + }, + "require-dev": { + "dompdf/dompdf": "^0.8.3", + "friendsofphp/php-cs-fixer": "^2.16", + "jpgraph/jpgraph": "^4.0", + "mpdf/mpdf": "^8.0", + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^7.5", + "squizlabs/php_codesniffer": "^3.5", + "tecnickcom/tcpdf": "^6.3" + }, + "suggest": { + "dompdf/dompdf": "Option for rendering PDF with PDF Writer", + "jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", + "mpdf/mpdf": "Option for rendering PDF with PDF Writer", + "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "https://blog.maartenballiauw.be" + }, + { + "name": "Mark Baker", + "homepage": "https://markbakeruk.net" + }, + { + "name": "Franck Lefevre", + "homepage": "https://rootslabs.net" + }, + { + "name": "Erik Tilt" + }, + { + "name": "Adrien Crivelli" + } + ], + "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", + "keywords": [ + "OpenXML", + "excel", + "gnumeric", + "ods", + "php", + "spreadsheet", + "xls", + "xlsx" + ], + "support": { + "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.12.0" + }, + "time": "2020-04-27T08:12:48+00:00" + }, + { + "name": "phpseclib/phpseclib", + "version": "3.0.43", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "709ec107af3cb2f385b9617be72af8cf62441d02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/709ec107af3cb2f385b9617be72af8cf62441d02", + "reference": "709ec107af3cb2f385b9617be72af8cf62441d02", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "^1|^2|^3", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": ">=5.6.1" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-dom": "Install the DOM extension to load XML formatted public keys.", + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + }, + "type": "library", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib3\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.43" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2024-12-14T21:12:59+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "setasign/fpdi", + "version": "v2.6.2", + "source": { + "type": "git", + "url": "https://github.com/Setasign/FPDI.git", + "reference": "9e013b376939c0d4029f54150d2a16f3c67a5797" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/9e013b376939c0d4029f54150d2a16f3c67a5797", + "reference": "9e013b376939c0d4029f54150d2a16f3c67a5797", + "shasum": "" + }, + "require": { + "ext-zlib": "*", + "php": "^5.6 || ^7.0 || ^8.0" + }, + "conflict": { + "setasign/tfpdf": "<1.31" + }, + "require-dev": { + "phpunit/phpunit": "~5.7", + "setasign/fpdf": "~1.8.6", + "setasign/tfpdf": "~1.33", + "squizlabs/php_codesniffer": "^3.5", + "tecnickcom/tcpdf": "~6.2" + }, + "suggest": { + "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured." + }, + "type": "library", + "autoload": { + "psr-4": { + "setasign\\Fpdi\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Slabon", + "email": "jan.slabon@setasign.com", + "homepage": "https://www.setasign.com" + }, + { + "name": "Maximilian Kresse", + "email": "maximilian.kresse@setasign.com", + "homepage": "https://www.setasign.com" + } + ], + "description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.", + "homepage": "https://www.setasign.com/fpdi", + "keywords": [ + "fpdf", + "fpdi", + "pdf" + ], + "support": { + "issues": "https://github.com/Setasign/FPDI/issues", + "source": "https://github.com/Setasign/FPDI/tree/v2.6.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/setasign/fpdi", + "type": "tidelift" + } + ], + "time": "2024-12-10T13:12:19+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", + "reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "10112722600777e02d2745716b70c5db4ca70442" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/10112722600777e02d2745716b70c5db4ca70442", + "reference": "10112722600777e02d2745716b70c5db4ca70442", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-19T12:30:46+00:00" + }, + { + "name": "verot/class.upload.php", + "version": "2.1.6", + "source": { + "type": "git", + "url": "https://github.com/verot/class.upload.php.git", + "reference": "724a3ee4ea6579f97fa556caf91a27c3c4100289" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/verot/class.upload.php/zipball/724a3ee4ea6579f97fa556caf91a27c3c4100289", + "reference": "724a3ee4ea6579f97fa556caf91a27c3c4100289", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/class.upload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-only" + ], + "authors": [ + { + "name": "Colin Verot", + "email": "colin@verot.net" + } + ], + "description": "This PHP class uploads files and manipulates images very easily.", + "homepage": "http://www.verot.net/php_class_upload.htm", + "keywords": [ + "gd", + "upload" + ], + "support": { + "email": "colin@verot.net", + "issues": "https://github.com/verot/class.upload.php/issues", + "source": "https://github.com/verot/class.upload.php/tree/2.1.6" + }, + "time": "2023-12-06T23:03:55+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "platform-overrides": { + "php": "7.1.0" + }, + "plugin-api-version": "2.6.0" +} diff --git a/connect/cms-config.php b/connect/cms-config.php new file mode 100644 index 0000000..a8b57c5 --- /dev/null +++ b/connect/cms-config.php @@ -0,0 +1,188 @@ + 'English', + "_zh" => "Chinese", + "_my" => "Malay", + '_np' => "Nepali", + '_md' => "Burmese", + ]; + +if ( $_GET['app_view'] != "yes" ){ + // check login status + $system_login_cookies = $_COOKIE['system_login_cookies'] ; + if ($_SESSION['system_id'] != '' && $_SESSION['system_name'] != '' && $_SESSION['system_branch'] != '' && $_SESSION["system_permission"] != ""){ + $mysqli_user = $mysqli->query("SELECT * FROM system_user + WHERE user_id = '".$_SESSION['system_id']."' AND user_name = '".$_SESSION['system_name']."' AND user_permission = '".$_SESSION['system_permission']."' AND user_branch = '".$_SESSION['system_branch']."' AND user_login_cookies = '".$system_login_cookies."' AND user_trash = '0' LIMIT 1") ; + if ($mysqli_user->num_rows == 0 || trim($system_login_cookies) == ''){ + // unset user session + $all_session = array_keys($_SESSION); + foreach ($all_session as $key){ + unset($_SESSION[$key]); + } + // unset user cookie + $expired_time = (time() - 3600) ; + setcookie("system_id", $_SESSION['system_id'], $expired_time, "/") ; + setcookie("system_name", $_SESSION['system_name'], $expired_time, "/") ; + setcookie("system_branch", $_SESSION['system_branch'], $expired_time, "/") ; + setcookie("system_permission", $_SESSION['system_permission'], $expired_time, "/") ; + setcookie("system_login_cookies", '', $expired_time, "/") ; + }else{ + $check_user = true ; + $row_user = $mysqli_user->fetch_array(MYSQLI_ASSOC) ; + } + } +} + +// check user permission +$system_permission = $_SESSION['system_permission'] ; +$boolean_admin = ($system_permission == 'admin' ? true : false) ; +$boolean_purchasing = ($system_permission == 'purchasing' ? true : false) ; +$boolean_account = ($system_permission == 'account' ? true : false) ; +$boolean_hr = ($system_permission == 'hr' ? true : false) ; +$boolean_office_marketing = ($system_permission == 'office-marketing' ? true : false) ; +$boolean_marketing = ($system_permission == 'marketing' ? true : false) ; +$boolean_store = ($system_permission == 'store' ? true : false) ; +$boolean_programmer = ($system_permission == 'programmer' ? true : false) ; +$boolean_customer = ($system_permission == 'customer' ? true : false) ; + +// include file +$get_lang = ( $_COOKIE['Lang'] != '' ? $_COOKIE['Lang'] : 'en' ) ; +include __DIR__.'/../languages/'.$get_lang.'.php' ; + +if($row_user['user_permission'] == 'user'){ + + $array_staff_branch_123 = json_decode($row_user['user_permission_branch'],true); + + $user_branch_permission_sql_123 = ' and branch_id IN ('.implode(',', $array_staff_branch_123).') '; + + $user_branch_permission_sql = ' and branch_id IN ('.implode(',', $array_staff_branch_123).') '; + $user_branch_permission_sql_a = ' and a.branch_id IN ('.implode(',', $array_staff_branch_123).') '; + $user_branch_permission_sql_b = ' and b.branch_id IN ('.implode(',', $array_staff_branch_123).') '; + + // $staff_list = [] ; + + // $mysqli_staff = $mysqli->query( "SELECT staff_id, staff_name, staff_idno FROM staff + // WHERE deleted_at IS NULL ".$user_branch_permission_sql_123) ; + // if ( $mysqli_staff->num_rows > 0 ){ + // while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + // $staff_list[] = $row_staff['staff_id']; + // } + // } + + // $user_branch_permission_sql_task = ' and a.created_by IN ('.implode(", ",$staff_list).') '; + + if(empty($_SESSION['url_get_branch_admin'])){ + if (strpos($url_branch_ori, '&') == true || strpos($url_branch_ori, '?') == true || (strpos($url_branch_ori, '?') == true && strpos($url_branch_ori, '&') == true )) { + $echo_script_url = ' + + '; + }else{ + $echo_script_url = ' + + '; + } + } + +} + +$url_get_branch_admin_get = $_GET['url_get_branch_admin_get']; + +$Current_Url = sprintf( + '%s://%s/%s', + isset($_SERVER['HTTPS']) ? 'https' : 'http', + $_SERVER['HTTP_HOST'], + trim($_SERVER['REQUEST_URI'],'/\\') +); + +$url_branch_ori = strip_param_from_url( $Current_Url, 'url_get_branch_admin_get' ); + +$mysqli_branch = $mysqli->query( "SELECT branch_id, branch_hq FROM branch + WHERE deleted_at IS NULL ORDER BY branch_id DESC") ; +if ( $mysqli_branch->num_rows > 0 ){ + while ( $row_branch = $mysqli_branch->fetch_assoc() ){ + if($row_branch['branch_hq'] >= 1 ){ + $count_branch_selected++; + $HQ_branch = $row_branch['branch_id']; + } + if($count_branch_selected <= 0){ + $HQ_branch = $row_branch['branch_id']; + } + } +} +if($row_user['user_permission'] == 'admin'){ + if(empty($_SESSION['url_get_branch_admin'])){ + if (strpos($url_branch_ori, '&') == true || strpos($url_branch_ori, '?') == true || (strpos($url_branch_ori, '?') == true && strpos($url_branch_ori, '&') == true )) { + $echo_script_url = ' + + '; + }else{ + $echo_script_url = ' + + '; + } + } +} +if($url_get_branch_admin_get != ''){ + $_SESSION['url_get_branch_admin'] = $url_get_branch_admin_get; + $echo_script_url = ' + + '; +} + +function strip_param_from_url( $url, $param ) { + $base_url = strtok($url, '?'); // Get the base url + $parsed_url = parse_url($url); // Parse it + $query = $parsed_url['query']; // Get the query string + parse_str( $query, $parameters ); // Convert Parameters into array + unset( $parameters[$param] ); // Delete the one you want + $new_query = http_build_query($parameters); // Rebuilt query string + return $base_url.'?'.$new_query; // Finally url is ready +} + +// if($row_user['user_permission'] == 'admin'){ + $user_branch_permission_sql = ' and branch_id = "'.$_SESSION['url_get_branch_admin'].'" '; + $user_branch_permission_sql_a = ' and a.branch_id = "'.$_SESSION['url_get_branch_admin'].'" '; + $user_branch_permission_sql_b = ' and b.branch_id = "'.$_SESSION['url_get_branch_admin'].'" '; + $user_branch_permission_sql_d = ' and d.branch_id = "'.$_SESSION['url_get_branch_admin'].'" '; + $user_branch_permission_sql_symbol = ' and branch like "%/'.$_SESSION['url_get_branch_admin'].'/%" '; + + if($_SESSION['url_get_branch_admin'] == 1){ + $url_get_branch_admin_name = 'muar'; + }elseif($_SESSION['url_get_branch_admin'] == 2){ + $url_get_branch_admin_name = 'iskandar'; + }elseif($_SESSION['url_get_branch_admin'] == 3){ + $url_get_branch_admin_name = 'penan1'; + }elseif($_SESSION['url_get_branch_admin'] == 4){ + $url_get_branch_admin_name = 'asa'; + } + + $user_branch_permission_sql_branch_name = ' and branch = "'.$url_get_branch_admin_name.'" '; + + $staff_list = [] ; + + $mysqli_staff = $mysqli->query( "SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[] = $row_staff['staff_id']; + } + } + + $user_branch_permission_sql_task = ' and a.created_by IN ('.implode(", ",$staff_list).') '; +// } + + // print_r($_SESSION['url_get_branch_admin']);exit(); +?> diff --git a/connect/main-config.php b/connect/main-config.php new file mode 100644 index 0000000..74175e7 --- /dev/null +++ b/connect/main-config.php @@ -0,0 +1,133 @@ +set_charset("utf8") ; +date_default_timezone_set('Asia/Singapore') ; + +// Check connection // +if (mysqli_connect_errno()) { + printf("Connect failed: %s\n", mysqli_connect_error()) ; + exit ; +} + +// default variable +if ( !isset($_SERVER['HTTPS']) && !$boolean_ssl_lock ) { + header('Location: https://' . $_SERVER["SERVER_NAME"] . '/' . $current_page) ; + exit ; +} +$prefix_url = 'https://' ; +define('PATH', $prefix_url.$_SERVER['SERVER_NAME'].'/') ; +define('COMPANY', 'IPS Software Sdn. Bhd.') ; +define('COMPANYSHORT', 'IPS') ; +define('ADDRESS', '') ; +define('COMPANYLOCATION', '{"lat":"2.058902","lon":"102.560469"}') ; +define('COUNTRY', 'Malaysia') ; +define('WEBSITE', 'https://ips.com.my') ; +define('SYSTEM', 'System') ; +define('MAPKEY', '') ; +define('PUSHTOKEN', 'AAAAeH4NE-M:APA91bF3mRs11LWVgUgZeOHW2PVArCLrGzXkyC2UZajIs9mdZQK0khPVw59rsCAxZ47o2za3l5pFa3NLE3-yBEu2VlKz7hWjvGreeurudhY64FsqYZF4oUW-wVxJcDvjwU5UDW4Swmnq') ; +define('SECRETKEY', 'A91bLWVZaj0khPVwFa3N') ; +define('APIKEY', '1egZU2jm#ya+E9E3K&DbivDh') ; +define('IMAGELOCATION', 'ips') ; +define('CONTACTHR', '016 977 5111') ; + +define('SUPPORTNAME', 'Mr. Jimmy') ; +define('SUPPORTMOBILE', '+60 16-977 7280') ; + +// setdefault setting +define('ALLOWSIGN', '0') ; +define('LIMIT', '20') ; +define('TODAYDAY', date('Y-m-d', time())) ; +define('TODAYDATE', date('Y-m-d H:i:s', time())) ; + +// set config +define('DEFAULTPUNCH', 'NO') ; +define('ATTENDANCEFORMULA', '2') ; +define('LIMITDIGITNO', '4') ; +define('ATTENDANCEABSENT', 'yes') ; // yes or no + +// set module config +define('MENUMARKETING', 'no') ; +define('MENUJOB', 'no') ; +define('MENUACCOUNT', 'no') ; +define('MENUCUSTOMER', 'no') ; +define('MENUPRODUCT', 'no') ; +define('MENUPRODUCTIONS', 'no') ; +define('MENUHR', 'yes') ; + +// 1 = table view only, 2 = qrcode only, 3 = table and qrcode only +define('QRCODEVIEW', '2') ; + +// to punch card system +define('PUNCHURL', 'http://machine.ips.com.my') ; +define('PUNCHCOMPANYID', '2') ; +define('PUNCHSHOWBRANCHID', 'no') ; + +// mail setting +$EMAILCC = [ 'info@ips.com.my' ] ; +$EMAILCRON = [ 'info@ips.com.my' ] ; +define('EMAIL', 'info@ips.com.my') ; +define('EMAILSYSTEM', 'info@ips.com.my') ; +define('EMAILNOREPLY', 'noreply@ips.com.my') ; +DEFINE('MAILSMTP', 'yes') ; +DEFINE('MAILHOST', 'mail.ips.com.my') ; +DEFINE('MAILUSERNAME', 'noreply@ips.com.my') ; +DEFINE('MAILPASSWORD', '0a=RoEvz6G#c') ; +DEFINE('MAILPORT', '587') ; + +// sms +define('SMSENDPOINT', 'https://sms.ips.com.my/api/sms.php') ; +define('SMSID', '1') ; +define('SMSTOKEN', 'e282bc52197813943c744e61eb6b65c6') ; +define('SMSSECRET', '2316efc8559cec0a7c7b5f43b913feeb') ; +define('SMSCOMPANY', 'IPS') ; + +// rms pay +define('RMSLOCATION', 'IPS') ; +define('RMSAPIURL', 'https://api.molreloads.com/terminal/v1/') ; +define('RMSAPITERMINAL', 'IPSSOF0001') ; +define('RMSAPIKEY', '8668989810297014') ; + +// point for nomination +define('NOMINATIONPOINT', 60) ; + +$LANGS = [ 'en' => 'EN', 'my' => 'MY', 'cn' => 'CN' ] ; +$STAFFDETAILS = 'show' ; +$CRONJOBS = [ + 'generate_attendance' => 'yes', + 'push_notification' => 'yes', + 'rms_pay_bill' => 'yes', + 'rms_prepaid_check_status' => 'yes', + 'punchs/user' => 'yes', + 'generate_leave_day' => 'yes', + 'push_task_notification' => 'yes', + 'push_holiday' => 'yes', + 'push_passport_permit_leave_advance' => 'yes', + 'push_application_form_reminder' => 'yes', + 'push_staff_resignation' => 'yes', + 'generate_payment_slip' => 'yes', + 'generate_attendance_to_text' => 'no', + 'generate_staff_achievement' => 'yes', + 'generate_monthly_attendance_point' => 'yes', + 'generate_monthly_performance_point' => 'yes', + 'generate_seasonly_improvement_point' => 'yes', + 'generate_seasonly_summary_point' => 'yes' +] ; + +// set array binding config +$CHECKLEAVEPOSITION = [ '2' ] ; +define('LEAVESETTING', 'month') ; + +?> \ No newline at end of file diff --git a/connect/status.php b/connect/status.php new file mode 100644 index 0000000..642ad5d --- /dev/null +++ b/connect/status.php @@ -0,0 +1,193 @@ + 'Pending', + 'rms-02' => 'Failed', + 'rms-03' => 'Authorization Code Not Found or Expired', + 'rms-04' => 'Out of Stock', + 'rms-05' => 'Transaction Not Found', + 'rms-06' => 'Invalid Product', + 'rms-07' => 'Invalid Biller', + 'rms-08' => 'Invalid Business Date / Invalid Transaction Date Time', + 'rms-10' => 'Conflict', + 'rms-11' => 'Invalid Dealer', + 'rms-12' => 'Invalid Package', + 'rms-13' => 'Invalid Status', + 'rms-14' => 'Insufficient Wallet Balance', + 'rms-15' => 'Invalid Amount', + 'rms-16' => 'Invalid Parameter (TNG)', + 'rms-17' => 'Unmatched Cryptogram (TNG)', + 'rms-18' => 'Blacklist Due To CBL (TNG)', + 'rms-19' => 'Blacklist Due To SBLK (TNG)', + 'rms-20' => 'Insufficient Fund (TNG)', + 'rms-21' => 'Exceeded Threshold (TNG)', + 'rms-22' => 'Exceeded Max Quantity Per Transaction (Top up PIN only)', + 'rms-23' => 'No Supplier Product Assign', + 'rms-24' => 'BillPaymentConflictWithinPeriod', + 'rms-31' => 'Invalid Terminal', + 'rms-32' => 'Invalid Reference No', + 'rms-33' => 'Service Type Not Support', + 'rms-34' => 'No Wallet Assign', + 'rms-35' => 'Wallet Account Inactive', + 'rms-36' => 'Mobile Apps not support', + 'rms-37' => 'Invalid AppCode / Invalid SecureCode', + 'rms-38' => 'Exceeded Max Transaction Per Account Allowed', + 'rms-39' => 'Not Within Min Max Amount', + 'rms-40' => 'Invalid Account No', + 'rms-41' => 'Invalid Parameter', + 'rms-42' => 'Invalid API Version', + 'rms-43' => 'Invalid Merchant Account', + 'rms-44' => 'Unauthorized Server IP Address', + 'rms-45' => 'Invalid Signature', + 'rms-46' => 'Invalid Validated Token or Expired', + 'rms-47' => 'Invalid Mobile Number', + 'rms-48' => 'Parking - Invalid Street', + 'rms-49' => 'Parking - Payment not required. Free Parking – Off period', + 'rms-50' => 'Parking - Invalid Start End Time', + 'rms-51' => 'Parking - Invalid Coupon Types', + 'rms-52' => 'Currency Not Match', + 'rms-53' => 'Possible Fraud - Blocked', + 'rms-54' => 'Invalid Store', + 'rms-55' => 'Invalid Service', + 'rms-56' => 'Invalid Transaction Type (TNG)', + 'rms-57' => 'Invalid Fund Request (TNG)', + 'rms-58' => 'Invalid TNG Account(TNG)', + 'rms-59' => 'Invalid Message Code (TNG)', + 'rms-60' => 'Invalid Random (TNG)', + 'rms-61' => 'Invalid Account (TNG)', + 'rms-62' => 'Invalid SpId (TNG)', + 'rms-63' => 'Duplicate Transaction No (TNG)', + 'rms-64' => 'Invalid Secret Key (TNG)', + 'rms-65' => 'Invalid Transaction Date (TNG)', + 'rms-66' => 'Invalid Card Manufactured No (TNG)', + 'rms-67' => 'Invalid Card Transaction No (TNG)', + 'rms-68' => 'Invalid Response Code (TNG)', + 'rms-69' => 'Invalid Card No (TNG)', + 'rms-70' => 'Unauthorized (TNG)', + 'rms-71' => 'Invalid Card (TNG)', + 'rms-72' => 'Invalid Card Issuer SPID (TNG)', + 'rms-73' => 'Invalid Card Issuer Machine Code (TNG)', + 'rms-74' => 'Invalid Last Refill Machine No (TNG)', + 'rms-75' => 'Invalid Machine No (TNG)', + 'rms-76' => 'Invalid Blacklist Code (TNG)', + 'rms-99' => 'Others', + 'rms-211' => 'Pending Authorize (OfflinePayment)', + 'rms-212' => 'Reversed / Refunded (Note: Reversed is only for OfflinePayment)', + 'rms-213' => 'Request Inquiry (OfflinePayment)', + 'rms-214' => 'Request Reversal (OfflinePayment)', + 'rms-215' => 'Request Retry Refund (OfflinePayment)', + 'rms-999' => 'Payment Failed (OfflinePayment)', + 'rms-1000' => 'Client version not matched', + 'rms-1001' => 'Invalid authorization code', + 'rms-1002' => 'Insufficient balance', + 'rms-1003' => 'Exceed transaction limit', + 'rms-1004' => 'Forbidden word', + 'rms-1005' => 'Payer account not exists', + 'rms-1006' => 'Forbidden payer account', + 'rms-1007' => 'Payer disabled payment option', + 'rms-1008' => 'Refund amount exceeded', + 'rms-1009' => 'Unable to reverse or refund', + 'rms-1010' => 'Trade closed', + 'rms-9999' => 'Other error', + 'rms-40000' => 'Bad Request / Duplicate Reference Id', + 'rms-40001' => 'Invalid Authorization Code / Missing parameters', + 'rms-40002' => 'Invalid API version', + 'rms-40003' => 'Invalid Currency Code', + 'rms-40005' => 'Invalid ChannelId', + 'rms-40007' => 'Invalid Authorization Code Type', + 'rms-40008' => 'Exceed authorized amount', + 'rms-40101' => 'Invalid Application Code', + 'rms-40103' => 'Invalid Signature', + 'rms-40400' => 'Payment Not Found', + 'rms-40431' => 'Transaction date more than 90 days', + 'rms-50031' => 'Refund record not saved', + 'rms-50032' => 'Refund record update failed', + 'rms-50033' => 'Transaction update failed', + 'rms-50034' => 'Payback record not saved', + 'rms-50200' => 'Bad Gateway', + + '500' => 'Failed to connect', + '401' => 'Under development', + '400' => 'Invalid login token or token expired', + '399' => 'Custom message', + '314' => 'Kinldy answer all question', + '313' => 'User account not found', + '312' => 'Please read & understood & agree the policy', + '311' => 'User account has been blocked', + '310' => 'User account not active yet', + '309' => 'Token failed to insert', + '308' => 'Invalid status', + '307' => 'Invalid qrcode', + '306' => 'Failed to upload', + '305' => 'Setting not found', + '304' => 'Something error, please try again later', + '303' => 'Permission not allow', + '302' => 'Error more than 3 times, the verification code was invalid', + '301' => 'Otp code not allow to send within 1 minute', + '300' => 'Invalid parameter', + '299' => 'Invalid status', + '298' => 'Invalid wallet movement', + '297' => 'Invalid point movement', + '296' => 'Invalid file', + '295' => 'Invalid date', + '294' => 'Sorry, testkit result only can submit on visiting date', + '293' => 'Visitor has been visited before', + '292' => 'Otp code was expired', + '291' => 'Otp code not found', + '290' => 'Account not found', + '289' => 'Username / Mobile / email already exists', + '288' => 'Mobile already exists', + '287' => 'Email already exists', + '286' => 'Password not match', + '285' => 'Password must be 6 digit and above', + '284' => 'Incorrect password', + '283' => 'Incorrect otp code', + '282' => 'Mobile same as previous', + '281' => 'Email same as previous', + '280' => 'Invalid mobile format', + '279' => 'Invalid email format', + '278' => 'Invalid rating', + '277' => 'Code expired', + '276' => 'Code used', + '275' => 'Accept rescan only after 15 minutes', + '274' => 'Sorry, you cannot apply different year of leave', + '273' => 'No enough leave to apply', + '272' => 'Invalid code', + '271' => 'Some of the staff doesn\'t meet the scenario', + '270' => 'Out of area', + '269' => 'Category not found', + '268' => 'Category can only redeem by batch', + '260' => 'User not found', + '259' => 'Selected date has been reserved', + '258' => 'Cannot cancel for the selected reservation', + '257' => 'The visitation qrcode was expired', + '254' => 'Sorry, cannot apply again', + '253' => 'Amount must have value', + '252' => 'Please complete your profile', + '251' => 'Invalid minimum amount', + '250' => 'E-wallet balance is insufficient', + '249' => 'Points balance is insufficient', + '248' => 'Item not allow to redeem', + '247' => 'Data failed to rejected', + '246' => 'Out of stock', + '245' => 'Please upload your profile', + '244' => 'Account exists', + '243' => 'Invalid point', + '211' => 'Movement failed to update', + '210' => 'Notification failed to send', + '209' => 'Sms failed to send', + '208' => 'Email failed to send', + '207' => 'Data failed to cancel', + '206' => 'Data failed to delete', + '205' => 'Data failed to save', + '204' => 'Data failed to reset', + '203' => 'Data failed to insert', + '202' => 'Data failed to update', + '201' => 'No data found', + '200' => 'Success', + '199' => 'Sms sent', + '198' => 'Email sent', + '99' => 'Not eligible for nomination', + '98' => 'Not eligible for nomination' +] ; + +?> \ No newline at end of file diff --git a/cron/call_infotech.php b/cron/call_infotech.php new file mode 100644 index 0000000..f2238bb --- /dev/null +++ b/cron/call_infotech.php @@ -0,0 +1,234 @@ + 2, + "CompanyCode" => null, + "CompanyName" => "M&R MANUFACTURING SDN BHD" + ], + [ + "CompanyID" => 4, + "CompanyCode" => null, + "CompanyName" => "M&R MANUFACTURING SDN BHD (ISKANDAR)" + ], + [ + "CompanyID" => 5, + "CompanyCode" => null, + "CompanyName" => "M&R INTEGRATED SOLUTION SDN BHD" + ], + [ + "CompanyID" => 6, + "CompanyCode" => null, + "CompanyName" => "ASA MULTIPLATE (M) SDN BHD" + ], + [ + "CompanyID" => 7, + "CompanyCode" => null, + "CompanyName" => "M & R INTEGRATED SYNERGY SDN BHD" + ] +] ; + + +$infotech_authorization = 'ASp8qEBeQpu/Y3FfoagKElhJgvi4A1hH0aTwcvIko1jPsHYm2x1rdEW+rqwZ/QY4YpBmmZhgvLiOZrx73yuQoQ==' ; +$infotech_api = 'https://malhrmsgateway.azurewebsites.net' ; +$infotech_clientid = 'dceb24cd-9965-404c-9988-8b8da4f6bd19' ; +$infotech_secretkey = 'WoXOHQfBAsUR3gTBu91uh5tcWxqR6e' ; +$infotech_key = '1234567890030188'; +$infotech_iv = 'Info-TechGateWay' ; + + +foreach ( $companys as $kcompany => $vcompany ){ + + $infotech_companyid = $vcompany['CompanyID'] ; + + $call_token = call( 'curl', $infotech_api.'/Authenticate', 'POST', [ "Authorization:".$infotech_clientid.':'.$infotech_secretkey, "customkey:".$infotech_authorization ], [ "Grant_type" => "password" ] + ) ; + + if ( $call_token['access_token'] != null ){ + + // get all current staff + $staffs = [] ; + $select_staff = $mysqli->query("SELECT staff_id, staff_idno, group_id FROM staff + WHERE deleted_at IS NULL AND staff_idno != '' ORDER BY group_id") ; + if ( $select_staff->num_rows > 0 ){ + while ( $row_staff = $select_staff->fetch_assoc() ){ + $staffs[$row_staff['staff_idno']] = $row_staff ; + } + } + + // get all working code + $workingids = [] ; + $workingnames = [] ; + $select_working = $mysqli->query("SELECT group_id, group_name FROM setting_working_group + WHERE deleted_at IS NULL ORDER BY group_id") ; + if ( $select_working->num_rows > 0 ){ + while ( $row_working = $select_working->fetch_assoc() ){ + $workingids[$row_working['group_id']] = $row_working['group_name'] ; + $workingnames[$row_working['group_name']] = $row_working['group_id'] ; + } + } + + + // get staff details + $call_parameter = [ + "CompanyID" => $infotech_companyid, + "IsActive" => "1" + ] ; + $plaintext = json_encode( $call_parameter ) ; + $ciphertext = openssl_encrypt( $plaintext, 'aes-128-cbc', $infotech_key, OPENSSL_RAW_DATA, $infotech_iv ) ; + $get_str = base64_encode( $ciphertext ) ; + $call_staff = call( 'curl-json', $infotech_api.'/Api/GetEmployeeDetails', 'GET', [ "Authorization:Bearer ".$call_token['access_token'] ], [ "str" => $get_str ] + ) ; + + // check staff shiftcode same with system or not + $update_staffs = [] ; + if ( count($call_staff) > 0 ){ + foreach ( $call_staff as $k => $v ){ + $get_staff = $staffs[$v['EmployeeCode']] ; + $get_group_id = $get_staff['group_id'] ; + + if ( $v['ShiftCode'] != '' && $v['ShiftCode'] != $workingids[$get_group_id] ){ + $update_staffs[$get_staff['staff_id']] = $workingnames[$v['ShiftCode']] ; + } + } + } + + // update all staff latest shift + if ( count($update_staffs) > 0 ){ + + $staff_ids = [] ; + $case_ids = [] ; + foreach ( $update_staffs as $k => $v ){ + $case_ids[] = " WHEN staff_id = '".$k."' THEN '".$v."'" ; + $staff_ids[] = $k ; + } + + $update_query = " + UPDATE staff + SET group_id = CASE + ".implode( '', $case_ids )." + ELSE group_id + END + WHERE staff_id IN ( ".implode( ', ', $staff_ids )." ) + " ; + $mysqli->query( $update_query ) ; + } + + + + + + + + // get leave details + $call_parameter = [ + "CompanyID" => $infotech_companyid, + "EmpCode" => "", + // "FromDate" => '22/07/2023', + // "ToDate" => '22/07/2023', + "FromDate" => date( "d/m/Y", time() ), + "ToDate" => date( "d/m/Y", time() ) + ] ; + $plaintext = json_encode( $call_parameter ) ; + $ciphertext = openssl_encrypt( $plaintext, 'aes-128-cbc', $infotech_key, OPENSSL_RAW_DATA, $infotech_iv ) ; + $get_str = base64_encode( $ciphertext ) ; + $call_leave = call( 'curl-json', $infotech_api.'/Api/GetLeaveDetails', 'GET', [ "Authorization:Bearer ".$call_token['access_token'] ], [ "str" => $get_str ] + ) ; + + $leaves = [] ; + if ( count($call_leave) > 0 ){ + foreach ( $call_leave as $k => $v ){ + if ( $v['LeaveStatus'] == 'APPROVED' ){ + $get_staff = $staffs[$v['EmpCodeC']] ; + + $v['staff_id'] = $get_staff['staff_id'] ; + $leaves[] = $v ; + $kkk[$v['LeaveType']] = $v['LeaveType'] ; + } + } + } + + foreach ( $leaves as $kleave => $vleave ){ + + $leave_type_mode = 'working' ; + $leave_date = date( 'Y-m-d', strtotime( $vleave['LvDateD'] ) ) ; + $leave_work_day = '0' ; + $leave_type = 'unpaid' ; + $leave_work_direct = 'yes' ; + switch ( $vleave['LeaveType'] ){ + case 'HOURLY LEAVE UNPAID' : + $leave_type = 'unpaid' ; + $leave_work_day = 'hourly' ; + break ; + case 'UNPAID LEAVE' : + $leave_type = 'unpaid' ; + $leave_work_day = 'full' ; + break ; + case 'UNPAID LEAVE FIRST HALF' : + $leave_type = 'unpaid' ; + $leave_work_day = 'firsthalf' ; + break ; + case 'UNPAID LEAVE SECOND HALF' : + $leave_type = 'unpaid' ; + $leave_work_day = 'secondhalf' ; + break ; + case 'ANNUAL LEAVE' : + case 'REPLACEMENT LEAVE' : + case 'MATRIMONIAL LEAVE' : + case 'COMPASSIONATE LEAVE' : + case 'EMERGENCY LEAVE' : + $leave_type = 'annual' ; + $leave_work_day = 'full' ; + break ; + case 'ANNUAL LEAVE FIRST HALF' : + case 'EMERGENCY LEAVE FIRST HALF' : + $leave_type = 'annual' ; + $leave_work_day = 'firsthalf' ; + break ; + case 'ANNUAL LEAVE SECOND HALF' : + case 'EMERGENCY LEAVE SECOND HALF' : + $leave_type = 'annual' ; + $leave_work_day = 'secondhalf' ; + break ; + case 'MEDICAL LEAVE' : + case 'HOSPITALIZATION LEAVE' : + case 'MATERNITY LEAVE' : + case 'PATERNITY LEAVE' : + $leave_type = 'sick' ; + $leave_work_day = 'full' ; + break ; + } + + $select_leave = $mysqli->query( "SELECT * FROM staff_leave_date + WHERE deleted_at IS NULL AND staff_id = '".$vleave['staff_id']."' AND leave_type = '".$leave_type."' AND leave_type_mode = '".$leave_type_mode."' AND leave_date = '".$leave_date."'" ) ; + if ( $select_leave->num_rows == 0 ){ + $mysqli->query( "INSERT INTO staff_leave_date + ( staff_id, leave_type, leave_type_mode, leave_date, leave_work_direct, leave_work_day ) VALUES + ( '".$vleave['staff_id']."', '".$leave_type."', '".$leave_type_mode."', '".$leave_date."', '".$leave_work_direct."', '".$leave_work_day."' )" ) ; + } + } + + // print_r($leaves) ; + // print_r("
") ; + // print_r("
") ; + // print_r("
") ; + + } + +} + +?> \ No newline at end of file diff --git a/cron/cronjob.php b/cron/cronjob.php new file mode 100644 index 0000000..8e34dcd --- /dev/null +++ b/cron/cronjob.php @@ -0,0 +1,70 @@ + \ No newline at end of file diff --git a/cron/generate_attendance.php b/cron/generate_attendance.php new file mode 100644 index 0000000..c02e463 --- /dev/null +++ b/cron/generate_attendance.php @@ -0,0 +1,994 @@ +query("SELECT holiday_name FROM setting_holiday + WHERE deleted_at IS NULL AND holiday_date = '".$date_yesterday."' LIMIT 1") ; +if ( $holiday_q->num_rows ){ + $boolean_holiday = true ; + $holiday = $holiday_q->fetch_assoc() ; + $holiday_name = $holiday['holiday_name'] ; +} + +// loop all staff +if ( $get_type == 'custom' ){ + $staffs_q = $mysqli->query("SELECT staff_id, staff_idno, staff_name, group_id, country_id, staff_settings, work_type_id FROM staff + WHERE deleted_at IS NULL AND staff_id = '".$get_staff_id."' LIMIT 1") ; +}else{ + $staffs_q = $mysqli->query("SELECT staff_id, staff_idno, staff_name, group_id, country_id, staff_settings, work_type_id FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned >= '".date("Y-m-d",time())."' OR staff_date_resigned = '0000-00-00' OR staff_date_resigned IS NULL )") ; +} + + +if ( $staffs_q->num_rows > 0 ){ + + $status = '210' ; + $message = 'No staff found.' ; + + $staffs = [] ; + while ( $row = $staffs_q->fetch_assoc() ){ + $staffs[] = $row ; + } + + // get all staff deparment + $staff_department = [] ; + $get_department = $mysqli->query("SELECT staff_id, department_id FROM staff_department + WHERE deleted_at IS NULL ORDER BY department_id") ; + if ( $get_department->num_rows > 0 ){ + while ( $row_department = $get_department->fetch_assoc() ){ + $staff_department[$row_department['staff_id']][] = $row_department['department_id'] ; + } + } + + // cut off attendance report + foreach ( $staffs as $key => $staff ){ + + $status = '201' ; + $message = 'Attendance list report was generated already.' ; + + $staff_id = $staff['staff_id'] ; + $list_type = 'normal' ; + $list_type_remark = 'WD' ; + $list_remark = '' ; + $list_work_day = '0' ; + $list_ot_day = '0' ; + + $list_work = '00:00:00' ; + + $list_rest = '00:00:00' ; + $list_rest_more = '00:00:00' ; + $list_time_off = '00:00:00' ; + + $list_rest2 = '00:00:00' ; + $list_rest_more2 = '00:00:00' ; + $list_time_off2 = '00:00:00' ; + + $list_early = '00:00:00' ; + $list_early_out = '00:00:00' ; + $list_late = '00:00:00' ; + $list_ot_normal = '00:00:00' ; + $list_leave_day = 0 ; + + $wrong_punch = [] ; + $array_abnormal = [] ; + + // staff setting + $staff_settings = $staff['staff_settings'] ; + if ( $staff_settings != '' ){ + $staff_settings = JsonEncodeDecode('decode', $staff_settings) ; + }else{ + $staff_settings = [] ; + } + + // check if not exists + $attendance_list_q = $mysqli->query("SELECT list_id FROM staff_attendance_list + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND list_date = '".$date_yesterday."' LIMIT 1") ; + if ( $attendance_list_q->num_rows == 0 ){ + + $status = '209' ; + $message = 'Selected staff no setting working hours.' ; + + // check staff working time, if not exists create + $boolean_setting_working = false ; + $working_q = $mysqli->query("SELECT working_id, working_on, working_next_day, working_if_flexi, working_if_include_rest, working_if_ot, working_direct_day, working_if_fixed_work, working_day_calculation, working_period_from, working_period_to, working_period_before, working_from, working_to, working_to_include_ot, working_total_hours, working_total_rest_hours, working_rest_range_from, working_rest_range_to, working_rest_include_ot, working_rounding_ot, working_if_ot_morning, working_if_offduty, working_count_offduty, working_if_deduct_offduty, working_max_ot,working_total_rest_hours2,working_rest_range_from2,working_rest_range_to2 FROM staff_attendance_working + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND working_date = '".$date_yesterday."' LIMIT 1") ; + if ( $working_q->num_rows == 0 ){ + + // get staff working hours + $working_q2 = $mysqli->query("SELECT group_id, working_on, working_next_day, working_if_flexi, working_if_include_rest, working_if_ot, working_direct_day, working_if_fixed_work, working_day_calculation, working_morning_start as working_period_from, working_morning_end as working_period_to, working_period_before, working_break_start as working_from, working_break_end as working_to, working_break_end_include_ot as working_to_include_ot, working_total_hours, working_total_rest_hours, working_rest_range_from, working_rest_range_to, working_rest_include_ot, working_rounding_ot, working_if_ot_morning, working_if_offduty, working_count_offduty, working_if_deduct_offduty, working_max_ot,working_total_rest_hours2,working_rest_range_from2,working_rest_range_to2 FROM setting_working + WHERE deleted_at IS NULL AND group_id = '".$staff['group_id']."' AND working_day = '".$yesterday_day."' LIMIT 1") ; + + // check if working setting got set + if ( $working_q2->num_rows > 0 ){ + $boolean_setting_working = true ; + $working = $working_q2->fetch_assoc() ; + $mysqli->query("INSERT INTO staff_attendance_working + (staff_id, working_group_id, working_date, working_on, working_next_day, working_if_flexi, working_if_include_rest, working_if_ot, working_direct_day, working_if_fixed_work, working_day_calculation, working_period_from, working_period_to, working_period_before, working_from, working_to, working_to_include_ot, working_total_hours, working_total_rest_hours, working_rest_range_from, working_rest_range_to, working_rest_include_ot, working_rounding_ot, working_if_ot_morning, working_if_offduty, working_count_offduty, working_if_deduct_offduty, working_max_ot, created_at, updated_at,working_total_rest_hours2,working_rest_range_from2,working_rest_range_to2) VALUES + ('".$staff_id."', '".$working['group_id']."', '".$date_yesterday."', '".$working['working_on']."', '".$working['working_next_day']."', '".$working['working_if_flexi']."', '".$working['working_if_include_rest']."', '".$working['working_if_ot']."', '".$working['working_direct_day']."', '".$working['working_if_fixed_work']."', '".$working['working_day_calculation']."', '".$working['working_period_from']."', '".$working['working_period_to']."', '".$working['working_period_before']."', '".$working['working_from']."', '".$working['working_to']."', '".$working['working_to_include_ot']."', '".$working['working_total_hours']."', '".$working['working_total_rest_hours']."', ".( $working['working_rest_range_from'] != '' ? "'".$working['working_rest_range_from']."'" : "NULL" ).", ".( $working['working_rest_range_to'] != '' ? "'".$working['working_rest_range_to']."'" : "NULL" ).", ".( $working['working_rest_include_ot'] != '' ? "'".$working['working_rest_include_ot']."'" : "NULL" ).", '".$working['working_rounding_ot']."', '".$working['working_if_ot_morning']."', '".$working['working_if_offduty']."', '".$working['working_count_offduty']."', '".$working['working_if_deduct_offduty']."', '".$working['working_max_ot']."', '".TODAYDATE."', '".TODAYDATE."','".$working['working_total_rest_hours2']."',".($working['working_rest_range_from2'] !='' ? "'".$working['working_rest_range_from2']."'" : "NULL" ).",".($working['working_rest_range_to2'] != '' ? "'".$working['working_rest_range_to2']."'": "NULL" ).")") ; + } + }else{ + $boolean_setting_working = true ; + $working = $working_q->fetch_assoc() ; + } + + if ( $boolean_setting_working ){ + + $status = '208' ; + $message = 'Selected staff cannot generate attendance report currently.' ; + + // default parameter + $total_hours = $working['working_total_hours'] ; + $total_rest_hours = $working['working_total_rest_hours'] ; + $total_rest_hours2 = $working['working_total_rest_hours2'] ; + $boolean_rest_hours2 = ( $total_rest_hours2 != '' && $total_rest_hours2 != '00:00:00' ? 'yes' : 'no' ) ; + $array_atten_ls = [] ; + $array_atten = [] ; + $punchiscorrect = true ; + + // check if allow to insert attendances + $check_current_datetime = $date_yesterday.' '.$working['working_period_from'] ; + $check_next_datetime = $date_next.' '.$working['working_period_to'] ; + if ( $working['working_to_include_ot'] > 0 ){ + $check_next_datetime = date( 'Y-m-d H:i:s', strtotime('-'.$working['working_to_include_ot'].' hour', strtotime($check_next_datetime)) ) ; + } + + // set running schedule time + 1 hours + $check_running_datetime = date( 'Y-m-d H:i:s', strtotime('+1 hour', strtotime($check_next_datetime)) ) ; + + + $after_rest1 = date( 'Y-m-d', strtotime( $check_current_datetime ) ) . ' ' . $working['working_rest_range_from'] ; + $after_rest2 = date( 'Y-m-d', strtotime( $check_current_datetime ) ) . ' ' . $working['working_rest_range_to'] ; + + if ( TODAYDATE > $check_running_datetime ){ + + // check if today got apply leave + $check_leave_q = $mysqli->query("SELECT a.leave_type, a.leave_work_day, b.leave_reason FROM staff_leave_date a + LEFT JOIN staff_leave b ON ( a.leave_id = b.leave_id ) + WHERE a.deleted_at IS NULL AND a.staff_id = '".$staff_id."' AND a.leave_date = '".$date_yesterday."' AND b.deleted_at IS NULL AND b.leave_status = 'confirmed' LIMIT 1") ; + if ( $check_leave_q->num_rows > 0 ){ + + $check_leave = $check_leave_q->fetch_assoc() ; + $list_type = 'leave' ; + $list_remark = $check_leave['leave_reason'] ; + $list_leave_day = $check_leave['leave_work_day'] ; + + switch ( $check_leave['leave_type'] ){ + case 'unpaid' : + $list_type_remark = 'UL' ; + break ; + case 'annual' : + $list_type_remark = 'AL' ; + break ; + case 'sick' : + $list_type_remark = 'MC' ; + break ; + } + } + + // check today is holiday or weekend + if ( $working['working_on'] == 'no' ){ + $list_type = 'weekend' ; + $list_type_remark = 'OD' ; + $list_remark = 'Off Day' ; + $list_work_day = '0' ; + }else{ + // if is holiday + if ( $boolean_holiday ){ + $list_type = 'holiday' ; + $list_type_remark = 'HL' ; + $list_remark = $holiday_name ; + $list_work_day = '0' ; + } + } + + // filter between time period attendance + $attendance_q = $mysqli->query("SELECT attendance_id, created_at FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND list_id = '0' AND created_at >= '".$check_current_datetime."' AND created_at <= '".$check_next_datetime."' ORDER BY created_at ASC") ; + + if ( $attendance_q->num_rows > 0 ){ + + $total_atten = $attendance_q->num_rows ; + $last_atten = '' ; + $working_from = '00:00:00' ; + $first_in_time = '00:00:00' ; + $count_atten = 0 ; + + // keep all attendance in array + while ( $attendance = $attendance_q->fetch_assoc() ){ + + $last_atten = $attendance['created_at'] ; + + // check working to + $working_to = date('Y-m-d H:i:s', strtotime( date('Y-m-d', strtotime($last_atten)).' '.$working['working_to'] )) ; + if ( $working['working_if_flexi'] != 'yes' && $working['working_if_fixed_work'] == 'yes' ){ + if ( $last_atten >= $working_to ){ + $last_atten = $working_to ; + } + } + + if ( $count_atten == 0 ){ + + if ( $working['working_if_flexi'] == 'yes' ){ + $working_from = $last_atten ; + }else{ + $working_from = date('Y-m-d H:i:s', strtotime( date('Y-m-d', strtotime($last_atten)).' '.$working['working_from'] )) ; + } + + $first_in_time = $last_atten ; + if ( $working_from >= $last_atten ){ + $last_atten = $working_from ; + } + } + + $array_atten_ls[] = $attendance['attendance_id'] ; + $array_atten[] = $last_atten ; + $count_atten++ ; + + } + + // generate new attendance if attendance is odd + if ( $total_atten%2 == 1 ){ + $array_atten[] = $last_atten ; + $punchiscorrect = false ; + } + + if ( $array_atten['1'] >= $array_atten['0'] ){ + + // calculate work and rest and keep in array + $array_hours = [] ; + $array_abnormal = [] ; + $next_hours = '' ; + $rest_1_out = '' ; + $rest_1_in = '' ; + $rest_2_out = '' ; + $rest_2_in = '' ; + $count_rest = 0 ; + foreach ( $array_atten as $k => $v ){ + if ( $next_hours != '' ){ + $array_hours[] = subtractTime($v, $next_hours) ; + if ( $count_rest == 1 ){ + $rest_1_out = $v ; + } + if ( $count_rest == 2 ){ + $rest_1_in = $v ; + } + if ( $count_rest == 3 ){ + $rest_2_out = $v ; + } + if ( $count_rest == 4 ){ + $rest_2_in = $v ; + } + } + $next_hours = $v ; + $count_rest++ ; + } + + + // get total work & rest + foreach ( $array_hours as $k => $v ){ + if ( $k%2 == 1 ){ + if ( $k == 1 ){ + $list_rest = addTime($list_rest, $v) ; + }else{ + if ( $boolean_rest_hours2 == 'yes' ){ + $list_rest2 = addTime($list_rest2, $v) ; + }else{ + $list_rest = addTime($list_rest, $v) ; + } + } + }else{ + $list_work = addTime($list_work, $v) ; + } + $prev_hours = $v ; + } + + + // check rest in & out if got time, and attendance time more than 2 + // if range from and range to setting is empty do nothing + // check if under the range time, if yes do nothing, else checking total time off + $rest_array[] = [ + 'current_rest' => '1', + 'boolean_rest_hours' => 'yes', + 'array_atten_ls_1' => 1, + 'array_atten_ls_2' => 2, + 'total_rest_hours' => $total_rest_hours, + 'list_rest' => $list_rest, + 'list_rest_more' => $list_rest_more, + 'list_time_off' => $list_time_off, + 'rest_out' => $rest_1_out, + 'rest_in' => $rest_1_in, + 'count_rest' => 2, + 'working_rest_range_from' => $working['working_rest_range_from'], + 'working_rest_range_to' => $working['working_rest_range_to'] + ] ; + if ( $boolean_rest_hours2 ){ + $rest_array[] = [ + 'current_rest' => '2', + 'boolean_rest_hours' => $boolean_rest_hours2, + 'array_atten_ls_1' => 3, + 'array_atten_ls_2' => 4, + 'total_rest_hours' => $total_rest_hours2, + 'list_rest' => $list_rest2, + 'list_rest_more' => $list_rest_more2, + 'list_time_off' => $list_time_off2, + 'rest_out' => $rest_2_out, + 'rest_in' => $rest_2_in, + 'count_rest' => 4, + 'working_rest_range_from' => $working['working_rest_range_from2'], + 'working_rest_range_to' => $working['working_rest_range_to2'] + ] ; + } + + foreach ( $rest_array as $krest => $vrest ){ + + $temp_list_time_off = $vrest['list_time_off'] ; + $more_rest = '00:00:00' ; + + if ( $vrest['boolean_rest_hours'] == 'yes' ){ + + if ( $working['working_if_flexi'] == 'no' && $vrest['rest_out'] != '' && $vrest['rest_in'] != '' && $count_rest > $vrest['count_rest'] ){ + + $rest_range_from = $vrest['working_rest_range_from'] ; + $rest_range_to = $vrest['working_rest_range_to'] ; + + if ( ( $rest_range_from != '' && $rest_range_from != '00:00:00' ) && + ( $rest_range_to != '' && $rest_range_to != '00:00:00' ) ){ + + $rest_range_from = $date_yesterday . ' ' . $rest_range_from ; + $rest_range_to = $date_yesterday . ' ' . $rest_range_to ; + + if ( $rest_range_from > $vrest['rest_out'] || $rest_range_to < $vrest['rest_out'] || $rest_range_from > $vrest['rest_in'] || $rest_range_to < $vrest['rest_in'] ){ + + // if situation 1 - early out + // else - late out + if ( $rest_range_from > $vrest['rest_out'] || $rest_range_to >= $vrest['rest_out'] ){ + + if ( $rest_range_from > $vrest['rest_in'] ){ + $temp_list_time_off = subtractTime($rest_range_from, $vrest['rest_out']) ; + + $array_abnormal[] = $array_atten_ls[$vrest['array_atten_ls_1']] ; + $array_abnormal[] = $array_atten_ls[$vrest['array_atten_ls_2']] ; + }else{ + + if ( $rest_range_from > $vrest['rest_out'] && $rest_range_to < $vrest['rest_in'] ){ + $deduct_out = subtractTime($rest_range_from, $vrest['rest_out']) ; + $deduct_in = subtractTime($vrest['rest_in'], $rest_range_to) ; + $temp_list_time_off = addTime($deduct_out, $deduct_in) ; + + $array_abnormal[] = $array_atten_ls[$vrest['array_atten_ls_1']] ; + $array_abnormal[] = $array_atten_ls[$vrest['array_atten_ls_2']] ; + }elseif ( $rest_range_from <= $vrest['rest_out'] && $rest_range_to < $vrest['rest_in'] ){ + $temp_list_time_off = subtractTime($vrest['rest_in'], $rest_range_to) ; + + $array_abnormal[] = $array_atten_ls[$vrest['array_atten_ls_2']] ; + }else{ + $temp_list_time_off = subtractTime($rest_range_from, $vrest['rest_out']) ; + + $array_abnormal[] = $array_atten_ls[$vrest['array_atten_ls_1']] ; + } + + } + + }else{ + $temp_list_time_off = subtractTime($vrest['rest_in'], $vrest['rest_out']) ; + + $array_abnormal[] = $array_atten_ls[$vrest['array_atten_ls_2']] ; + } + + } + + } + } + + $boolean_rest = false ; + if ( $vrest['current_rest'] == '1' ){ + $boolean_rest = true ; + } + if ( $vrest['current_rest'] == '2' ){ + if ( $vrest['working_rest_range_from'] != '00:00:00' && $vrest['working_rest_range_to'] != '00:00:00' ){ + $setting_rest2_time = date( 'Y-m-d', strtotime( $check_current_datetime ) ) . ' ' . $vrest['working_rest_range_to'] ; + }else{ + $setting_rest2_time = date( 'Y-m-d', strtotime( $check_current_datetime ) ) . ' ' . $working['working_to'] ; + $setting_rest2_time = date( 'Y-m-d H:i:s', strtotime( $setting_rest2_time . ' +'.convertMinutes($vrest['total_rest_hours']).' minutes' ) ) ; + } + + if ( $last_atten >= $working_to && $last_atten >= $setting_rest2_time ){ + $check_atten_hours = subtractTime($last_atten, $working_to) ; + $boolean_rest = true ; + }else{ + $list_rest2 = '00:00:00' ; + $list_rest_more2 = '00:00:00' ; + $list_time_off2 = '00:00:00' ; + } + } + + + // calculate rest + if ( $vrest['total_rest_hours'] != '00:00:00' && $vrest['total_rest_hours'] != '' ){ + + if ( $boolean_rest ){ + if ( $vrest['total_rest_hours'] > $vrest['list_rest'] ){ + $diff_rest = subtractTime($vrest['total_rest_hours'], $vrest['list_rest']) ; + if ( $list_work > '00:00:00' ){ + $list_work = subtractTime($list_work, $diff_rest) ; + } + } + } + + if ( $vrest['list_rest'] > $vrest['total_rest_hours'] ){ + $more_rest = subtractTime($vrest['list_rest'], $vrest['total_rest_hours']) ; + + if ( $boolean_rest ){ + $list_work = addTime($list_work, $more_rest) ; + $array_abnormal[] = $array_atten_ls[$vrest['array_atten_ls_2']] ; + } + } + } + + // if rest hour more than real rest hours within working hours + if ( $boolean_rest ){ + if ( $vrest['total_rest_hours'] == '00:00:00' || $vrest['total_rest_hours'] == '' ){ + if ( $temp_list_time_off != '00:00:00' && $temp_list_time_off != '' ){ + if ( $temp_list_time_off > $vrest['total_rest_hours'] ){ + $list_work = addTime($list_work, $vrest['total_rest_hours']) ; + $temp_list_time_off = subtractTime($temp_list_time_off, $vrest['total_rest_hours']) ; + }else{ + $list_work = addTime($list_work, $temp_list_time_off) ; + $temp_list_time_off = '00:00:00' ; + } + } + } + } + + // if ( $working['working_direct_day'] == 'no' ){ + if ( $list_type_remark != 'OD' && $list_type_remark != 'HL' ){ + switch ( $vrest['current_rest'] ){ + case '1' : + $list_rest = $vrest['total_rest_hours'] ; + $list_rest_more = $more_rest ; + $list_time_off = $temp_list_time_off ; + break ; + case '2' : + $list_rest2 = $vrest['total_rest_hours'] ; + $list_rest_more2 = $more_rest ; + $list_time_off2 = $temp_list_time_off ; + break ; + } + } + + } + } + + + // get early / late / ot + if ( $working_from > $first_in_time ){ + $list_early = subtractTime($working_from, $first_in_time) ; + } + + $new_first_in_time = $first_in_time ; + if ( $working['working_rest_range_from'] != '00:00:00' ){ + $new_first_in_time = date( 'Y-m-d', strtotime( $first_in_time ) ) . ' ' . $working['working_rest_range_from'] ; + } + if ( $first_in_time >= $working_from && $working_from < $new_first_in_time ){ + if ( $new_first_in_time >= $first_in_time ){ + $list_late = subtractTime($first_in_time, $working_from) ; + }else{ + $list_late = subtractTime($new_first_in_time, $working_from) ; + } + } + + // echo $list_late ; + // exit ; + + // check if OT is count as total work? + // add the late hours to the total work + $list_work_total = $list_work ; + // if ( $working['working_direct_day'] == 'yes' ){ + if ( $list_type_remark == 'OD' || $list_type_remark == 'HL' ){ + $total_hours = '00:00:00' ; + }else{ + if ( $working['working_if_flexi'] != 'yes' ){ + $list_work = addTime($list_work, $list_late) ; + } + } + + // check if work enough hours + if ( $list_work >= $total_hours ){ + + // check if ot + if ( $working['working_if_ot'] == 'yes' ){ + + if ( $list_work > $total_hours ){ + $list_ot_normal = subtractTime($list_work, $total_hours) ; + $list_work = subtractTime($list_work, $list_ot_normal) ; + } + + // if off duty is yes + if ( $working['working_if_offduty'] == 'yes' ){ + if ( $list_ot_normal >= $working['working_count_offduty'] ){ + if ( $working['working_if_deduct_offduty'] == 'no' ){ + $list_work = addTime($list_work, $working['working_count_offduty']) ; + $list_ot_normal = subtractTime($list_ot_normal, $working['working_count_offduty']) ; + } + }else{ + $list_work = addTime($list_work, $list_ot_normal) ; + $list_ot_normal = '00:00:00' ; + } + } + + // if ot rounding is greater than 1 + if ( $working['working_rounding_ot'] > 1 ){ + + $working_rounding_ot = strPad(2, $working['working_rounding_ot']) ; + if ( $working_rounding_ot == '60' ){ + $rounding_ot = '01:00:00' ; + }else{ + $rounding_ot = '00:'.$working_rounding_ot.':00' ; + } + $reset_list_ot_normal = $list_ot_normal ; + $list_ot_normal = '00:00:00' ; + $boolean_ot = true ; + if ( $rounding_ot <= $reset_list_ot_normal ){ + while ( $boolean_ot ){ + + $reset_list_ot_normal = subtractTime($reset_list_ot_normal, $rounding_ot) ; + $list_ot_normal = addTime($list_ot_normal, $rounding_ot) ; + if ( $rounding_ot > $reset_list_ot_normal ){ + $boolean_ot = false ; + } + } + + + // check if morning is count as ot + if ( $working['working_if_ot_morning'] == 'yes' ){ + if ( $list_early != '' && $list_early != '00:00:00' ){ + + $reset_list_ot_normal = $list_early ; + $boolean_ot = true ; + if ( $rounding_ot <= $reset_list_ot_normal ){ + while ( $boolean_ot ){ + + $reset_list_ot_normal = subtractTime($reset_list_ot_normal, $rounding_ot) ; + $list_ot_normal = addTime($list_ot_normal, $rounding_ot) ; + if ( $rounding_ot > $reset_list_ot_normal ){ + $boolean_ot = false ; + } + } + } + + } + } + + } + } + + // check if OT is count as total work? + // delete back the total work hours + if ( $working['working_if_flexi'] != 'yes' ){ + $list_work = subtractTime($list_work, $list_late) ; + } + + // check max ot hours + $working_max_ot = $working['working_max_ot'] ; + if ( $working_max_ot != '' && $working_max_ot != '00:00:00' ){ + if ( $list_ot_normal > $working_max_ot ){ + $list_work = addTime( $list_work, subtractTime($working_max_ot, $list_ot_normal) ) ; + $list_ot_normal = $working_max_ot ; + } + } + + } + + }else{ + $list_early_out = subtractTime($total_hours, $list_work_total) ; + if ( $list_late != '00:00:00' ){ + $list_early_out = subtractTime($list_early_out, $list_late) ; + } + if ( $after_rest2 > $last_atten ){ + // $rest_exclude_early_out = subtractTime($after_rest2, $last_atten) ; + // $list_early_out = subtractTime( $list_early_out, $rest_exclude_early_out ) ; + } + } + } + }else{ + if ( $working['working_on'] == 'yes' && $list_type == 'normal' ){ + $list_type_remark = 'AS' ; + $list_remark = 'Absent' ; + } + } + + + // inside into db + // start commit + $error = 0 ; + $mysqli->autocommit( false ) ; + + try{ + + // check if normal working hours + if ( $list_work != '00:00:00' ){ + + // reset late + $count_total_less = 0 ; + $boolean_less = true ; + $rounding_less = $working['working_day_calculation'] ; + $get_list_early_out = $list_early_out ; + $reset_list_less = addTime($list_late, $get_list_early_out) ; + $reset_list_less = addTime($reset_list_less, $list_time_off) ; + + if ( $list_leave_day == '0.5' ){ + if ( $list_late > $list_early_out ){ + $reset_list_less = subtractTime($reset_list_less, $total_rest_hours) ; + } + } + + $reset_work = $working['working_total_hours'] ; + $reset_ot_normal = $list_ot_normal ; + + if ( $reset_list_less != '00:00:00' && $reset_list_less > '00:01:00'){ + $reset_list_less = subtractTime($reset_list_less, '00:01:00') ; + + $rounding_less = ( $rounding_less != '00:00:00' ? $rounding_less : '00:01' ) ; + if ( $rounding_less <= $reset_list_less ){ + while ( $boolean_less ){ + $reset_list_less = subtractTime($reset_list_less, $rounding_less) ; + if ( $rounding_less > $reset_list_less ){ + $boolean_less = false ; + } + $count_total_less++ ; + } + } + + if ( $reset_list_less != '00:00:00' ){ + $count_total_less++ ; + } + } + + // check if local / oversea worker, 1 = local, else oversea + if ( $count_total_less > 0 ){ + for ( $a = $count_total_less ; $a > 0 ; $a-- ){ + // $deduct_from_day = true ; + // if ( $staff['country_id'] == '1' ){ + + // }else{ + // if ( $working['working_if_ot'] == 'yes' && $reset_ot_normal != '00:00:00' ){ + // $deduct_from_day = false ; + // } + // } + + // // check if deduct from day or ot + // if ( $deduct_from_day ){ + + // }else{ + // if ( $rounding_less > $reset_ot_normal ){ + // $reset_ot_normal = '00:00:00' ; + // }else{ + // $reset_ot_normal = subtractTime($reset_ot_normal, $rounding_less) ; + // } + // } + + if ( $rounding_less > $reset_work ){ + $reset_work = '00:00:00' ; + }else{ + $reset_work = subtractTime($reset_work, $rounding_less) ; + } + } + } + + // get working & ot day + if ( $reset_work != '00:00:00' ){ + $reset_total_work = numberFormat( convertMinutes($working['working_total_hours']), 2 ) ; + $reset_work = numberFormat( convertMinutes($reset_work), 2 ) ; + $list_work_day += numberFormat( ( $reset_work / $reset_total_work ), 2 ) ; + $list_work_day = ( $list_leave_day == 0.5 ? 0.5 : ( $list_work_day > 0.5 ? 1 : ( $list_work_day > 0 ? 0.5 : 0 ) ) ) ; + } + if ( $reset_ot_normal != '00:00:00' ){ + $explode_ot_normal = explode(':', $reset_ot_normal) ; + $list_ot_day = numberFormat ( ( $explode_ot_normal[0] . '.' . ( $explode_ot_normal[1] > 0 ? ( $explode_ot_normal[1] / 60 * 100 ) : '' ) ), 2 ) ; + } + + } + + // over x minutes just count as late + if ( $working['working_period_before'] > 0 ){ + $count_late_minutes = convertToTimes($working['working_period_before']) ; + + if ( $list_late != '00:00:00' ){ + if ( $count_late_minutes > $list_late ){ + $list_work = addTime($list_work, $list_late) ; + $list_late = '00:00:00' ; + }else{ + $list_work = addTime($list_work, $count_late_minutes) ; + $list_late = subtractTime($list_late, $count_late_minutes) ; + } + } + } + + // work_type_id == 3 mean part time job + if ( $list_type_remark == 'WD' && $staff['work_type_id'] == '3' ){ + $list_type_remark = 'PT' ; + } + + // check if abnormal attendance + if ( $list_late != '00:00:00' ){ + $array_abnormal[] = $array_atten_ls[0] ; + } + if ( $list_early_out != '00:00:00' ){ + $array_abnormal[] = end($array_atten_ls) ; + } + + // if only work half day + $boolean_move_towork = false ; + if ( ( $list_work_day + $list_leave_day ) == '0.5' ){ + if ( convertMinutes( $list_late ) > 0 ){ + $list_work_day += 0.5 ; + + if ( $working['working_rest_range_to'] != '00:00:00' ){ + if ( $first_in_time >= $after_rest1 && $after_rest2 > $first_in_time && $list_late != '00:00:00' ){ + $late_includerest = subtractTime( $after_rest2, $first_in_time ) ; + $list_late = subtractTime( $list_late, $late_includerest ) ; + }else{ + $boolean_move_towork = true ; + } + + }else{ + $boolean_move_towork = true ; + } + }else{ + $boolean_move_towork = true ; + } + } + if ( $boolean_move_towork ){ + if ( $list_rest != '00:00:00' ){ + $list_work = addTime($list_work, $list_rest) ; + } + $list_rest = '00:00:00' ; + $list_time_off = '00:00:00' ; + } + + if ( $list_work_day == 0.5 && $list_leave_day == 0 ){ + $list_work_day = 1 ; + } + + // combine all working hours as ot + // if ( $working['working_direct_day'] == 'yes' ){ + if ( $list_type_remark == 'OD' || $list_type_remark == 'HL' ){ + $list_work_day = '0' ; + $list_ot_day = '0' ; + $list_work = '00:00:00' ; + $list_late = '00:00:00' ; + $list_early = '00:00:00' ; + $list_early_out = '00:00:00' ; + } + + // if leave half day, then filter out late / early out + if ( $working['working_if_flexi'] == 'no' ){ + if ( $list_type_remark == 'AL' || $list_type_remark == 'UL' || $list_type_remark == 'MC' ){ + if ( $list_leave_day == '0.5' ){ + $half_day_minutes = ( convertMinutes( $total_hours ) / 2 ) ; + $half_day_hours = convertToTimes( $half_day_minutes ) ; + + if ( $list_late >= $half_day_hours ){ + $list_late = subtractTime( $list_late, $half_day_hours ) ; + if ( $list_late >= $total_rest_hours ){ + $list_late = subtractTime( $list_late, $total_rest_hours ) ; + }else{ + $list_late = '00:00:00' ; + } + }else{ + $list_late = '00:00:00' ; + } + + if ( $list_early_out >= $half_day_hours ){ + $list_early_out = subtractTime( $list_early_out, $half_day_hours ) ; + if ( $list_early_out >= $total_rest_hours ){ + $list_early_out = subtractTime( $list_early_out, $total_rest_hours ) ; + }else{ + $list_early_out = '00:00:00' ; + } + }else{ + $list_early_out = '00:00:00' ; + } + } + } + } + + if ( $working['working_rest_include_ot'] != '00:00:00' ){ + if ( $list_rest != '00:00:00' ){ + $temp_ot_rest = addTime( $list_ot_normal, $list_rest ) ; + if ( $working['working_rest_include_ot'] >= $temp_ot_rest ){ + $list_ot_normal = $temp_ot_rest ; + $list_rest = '00:00:00' ; + } + } + } + + if ( !$punchiscorrect ){ + $list_work_day = 0 ; + $list_ot_day = 0 ; + + $list_work = '00:00:00' ; + + $list_rest = '00:00:00' ; + $list_rest_more = '00:00:00' ; + $list_time_off = '00:00:00' ; + + $list_rest2 = '00:00:00' ; + $list_rest_more2 = '00:00:00' ; + $list_time_off2 = '00:00:00' ; + + $list_early = '00:00:00' ; + $list_early_out = '00:00:00' ; + $list_late = '00:00:00' ; + $list_ot_normal = '00:00:00' ; + + $array_abnormal = [] ; + } + + // show log + echo 'staff :
' ; + foreach ( $staff as $kk => $vv ){ + echo $kk . ' -> ' . $vv ; + echo '
' ; + } + echo '
' ; + echo '
' ; + + echo 'array_atten :
' ; + foreach ( $array_atten as $kk => $vv ){ + echo $kk . ' -> ' . $vv ; + echo '
' ; + } + echo '
' ; + echo '
' ; + + echo 'array_abnormal :
' ; + foreach ( $array_abnormal as $kk => $vv ){ + echo $kk . ' -> ' . $vv ; + echo '
' ; + } + echo '
' ; + echo '
' ; + + echo 'working :
' ; + foreach ( $working as $kk => $vv ){ + echo $kk . ' -> ' . $vv ; + echo '
' ; + } + echo '
' ; + echo '
' ; + + echo 'staff_id -> ' . $staff_id ; + echo '
' ; + echo 'list_type -> ' . $list_type ; + echo '
' ; + echo 'list_date -> ' . $date_yesterday ; + echo '
' ; + echo 'list_work_day -> ' . $list_work_day ; + echo '
' ; + echo 'list_ot_day -> ' . $list_ot_day ; + echo '
' ; + echo 'list_leave_day -> ' . $list_leave_day ; + echo '
' ; + echo 'list_early -> ' . $list_early ; + echo '
' ; + echo 'list_early_out -> ' . $list_early_out ; + echo '
' ; + echo 'list_late -> ' . $list_late ; + echo '
' ; + echo 'list_rest -> ' . $list_rest ; + echo '
' ; + echo 'list_rest_more -> ' . $list_rest_more ; + echo '
' ; + echo 'list_time_off -> ' . $list_time_off ; + echo '
' ; + echo 'list_rest2 -> ' . $list_rest2 ; + echo '
' ; + echo 'list_rest_more2 -> ' . $list_rest_more2 ; + echo '
' ; + echo 'list_time_off2 -> ' . $list_time_off2 ; + echo '
' ; + echo 'list_type -> ' . $list_type ; + echo '
' ; + echo 'list_type_remark -> ' . $list_type_remark ; + echo '
' ; + echo 'list_remark -> ' . $list_remark ; + echo '
' ; + echo 'list_work -> ' . $list_work ; + echo '
' ; + echo 'list_ot_normal -> ' . $list_ot_normal ; + echo '
' ; + echo '
' ; + echo '
' ; + // exit ; + + $list_insert = $mysqli->query("INSERT INTO staff_attendance_list + (staff_id, list_date, list_checkinout, created_at, updated_at, list_work_day, list_ot_day, list_leave_day, list_early, list_early_out, list_late, list_rest, list_rest_more, list_time_off, list_rest2, list_rest_more2, list_time_off2, list_type, list_type_remark, list_remark, list_work, list_ot_normal) VALUES + ('".$staff_id."', '".$date_yesterday."', '".json_encode($array_atten)."', '".TODAYDATE."', '".TODAYDATE."', '".$list_work_day."', '".$list_ot_day."', '".$list_leave_day."', '".$list_early."', '".$list_early_out."', '".$list_late."', '".$list_rest."', '".$list_rest_more."', '".$list_time_off."', '".$list_rest2."', '".$list_rest_more2."', '".$list_time_off2."', '".$list_type."', '".$list_type_remark."', '".$list_remark."', '".$list_work."', '".$list_ot_normal."')") ; + + if ( $mysqli->affected_rows > 0 ){ + + $last_insert = $mysqli->insert_id ; + if ( count($array_atten_ls) > 0 ){ + + foreach ( $array_atten_ls as $k_atten => $v_atten ){ + $merge_insert = $mysqli->query("UPDATE staff_attendance SET + " . ( in_array($v_atten, $array_abnormal) ? "abnormal = 'yes'," : '' ) . " + list_id = '".$last_insert."', + check_group = '".$date_yesterday."' + WHERE attendance_id = '".$v_atten."' ") ; + if ( $mysqli->affected_rows > 0 ){ }else{ + $error++ ; + } + } + } + + }else{ + $error++ ; + } + + }catch( Exception $e ){ + $error++; + } + + if( $error == 0 ) { + + // commit query + $mysqli->commit() ; + $status = '200' ; + $message = 'Success' ; + + }else{ + $mysqli->rollback() ; + $status = '300' ; + $message = 'Something error, please try again later.' ; + } + + } + + + } + + + } + + + } + +} + +echo json_encode([ + 'status' => $status, + 'message' => $message +]) ; + +?> \ No newline at end of file diff --git a/cron/generate_attendance_to_text.php b/cron/generate_attendance_to_text.php new file mode 100644 index 0000000..2d5054e --- /dev/null +++ b/cron/generate_attendance_to_text.php @@ -0,0 +1,69 @@ + '09:40:00' && $current_times <= '14:40:00' ){ + $search_query .= " AND a.created_at BETWEEN '" . $day_before_3 . " 09:30:00' AND '" . $today_day . " 14:29:59'" ; + + $today_datetime .= '-1' ; +}else{ + $search_query .= " AND a.created_at BETWEEN '" . $day_before_4 . " 14:30:00' AND '" . $today_day . " 09:29:59'" ; + + $today_datetime .= '-2' ; +} + +$mysqli_attendances = $mysqli->query( "SELECT a.created_at, b.staff_idno FROM staff_attendance a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND CHAR_LENGTH(b.staff_idno) > 6 " . $search_query . " + ORDER BY a.created_at" ) ; + +$filename = '../txt/' . $today_datetime . '.txt' ; +$file = fopen( $filename, "wb" ) ; +fwrite($fp,$content); + +if ( $mysqli_attendances->num_rows > 0 ){ + $count = 0 ; + $total = $mysqli_attendances->num_rows ; + + while ( $row_attendances = $mysqli_attendances->fetch_assoc() ){ + $count++ ; + + $content = $row_attendances['staff_idno'] . '|' . date( 'Y-m-d', strtotime($row_attendances['created_at']) ) . '|' . date( 'H:i:s', strtotime($row_attendances['created_at']) ) ; + + if ( $count != $total ){ + $content .= "\n" ; + } + + fwrite( $file, $content ) ; + + } +} + +fclose( $file ) ; + + + + +// header("Content-Description: File Transfer"); +// header("Content-Type: application/octet-stream"); +// header("Content-Disposition: attachment; filename=\"". basename($filename) ."\"") ; +// readfile ( $filename ) ; + +exit ; + +?> \ No newline at end of file diff --git a/cron/generate_attendance_to_text_custom.php b/cron/generate_attendance_to_text_custom.php new file mode 100644 index 0000000..06689a4 --- /dev/null +++ b/cron/generate_attendance_to_text_custom.php @@ -0,0 +1,65 @@ +query( "SELECT a.created_at, b.staff_idno FROM staff_attendance a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND CHAR_LENGTH(b.staff_idno) > 6 " . $search_query . " + ORDER BY a.created_at" ) ; + + +$filename = '../txt/' . $today_datetime . '.txt' ; +$file = fopen( $filename, "wb" ) ; +fwrite($fp,$content); + +if ( $mysqli_attendances->num_rows > 0 ){ + $count = 0 ; + $total = $mysqli_attendances->num_rows ; + + while ( $row_attendances = $mysqli_attendances->fetch_assoc() ){ + $count++ ; + + $content = $row_attendances['staff_idno'] . '|' . date( 'Y-m-d', strtotime($row_attendances['created_at']) ) . '|' . date( 'H:i:s', strtotime($row_attendances['created_at']) ) ; + + if ( $count != $total ){ + $content .= "\n" ; + } + + fwrite( $file, $content ) ; + + } +} + +fclose( $file ) ; + + + + +// header("Content-Description: File Transfer"); +// header("Content-Type: application/octet-stream"); +// header("Content-Disposition: attachment; filename=\"". basename($filename) ."\"") ; +// readfile ( $filename ) ; + +echo 'Download' ; + +exit ; + +?> \ No newline at end of file diff --git a/cron/generate_leave_day.php b/cron/generate_leave_day.php new file mode 100644 index 0000000..7b6f91a --- /dev/null +++ b/cron/generate_leave_day.php @@ -0,0 +1,19 @@ +query( "SELECT a.staff_id FROM staff a + WHERE a.deleted_at IS NULL AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL )" ) ; +if ( $staffs->num_rows > 0 ){ + while ( $staff = $staffs->fetch_assoc() ){ + setStaffLeaveYear( $staff['staff_id'] ) ; + } +} + + + +?> \ No newline at end of file diff --git a/cron/generate_monthly_attendance_point.php b/cron/generate_monthly_attendance_point.php new file mode 100644 index 0000000..ddf3bb9 --- /dev/null +++ b/cron/generate_monthly_attendance_point.php @@ -0,0 +1,157 @@ +query( "SELECT a.module FROM app_service a + WHERE a.deleted_at IS NULL AND a.type = 'service' AND a.module IN ( 'Hr', 'HrBranch', 'HrManual' ) AND on_off = 'on' + LIMIT 1" ) ; + +if ( $services->num_rows > 0 ){ + $row_service = $services->fetch_assoc() ; + $service_module = $row_service['module'] ; +} + + + + + +// get setting point +$array_setting_point = [ 'daily' => 0, 'monthly' => 0 ] ; +$select_setting_point = $mysqli->query( "SELECT point_type, point_value FROM setting_point + WHERE deleted_at IS NULL AND point_from = 'staff_point_monthly_report' AND point_type IN ( 'daily', 'monthly' ) AND difficulty = 'normal' " ) ; +if ( $select_setting_point->num_rows > 0 ){ + while ( $row_setting_point = $select_setting_point->fetch_assoc() ){ + $array_setting_point[$row_setting_point['point_type']] = $row_setting_point['point_value'] ; + } +} + + +// check record +$array_record = [] ; +$select_record = $mysqli->query( "SELECT staff_id, type FROM staff_point_monthly_report + WHERE deleted_at IS NULL AND type IN ( 'daily-attendance', 'monthly-attendance' ) AND given_date LIKE '%".$last_month."%'" ) ; + +if ( $select_record->num_rows > 0 ){ + while ( $row_record = $select_record->fetch_assoc() ){ + $array_record[$row_record['staff_id']][$row_record['type']] = $row_record['staff_id'] ; + } +} + + + +switch ( $service_module ){ + + case 'Hr' : + case 'HrBranch' : + + + // get working day + $list_workday = [] ; + $select_attendancelist = $mysqli->query("SELECT staff_id, list_type_remark, COUNT( list_type_remark ) as count_list_type_remark, SUM( list_work_day ) as sum_list_work_day, SUM( list_leave_day ) as sum_list_leave_day FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$last_month."%' + GROUP BY staff_id, list_type_remark") ; + + if ( $select_attendancelist->num_rows > 0 ){ + while ( $row_attendancelist = $select_attendancelist->fetch_assoc() ){ + $list_workday[$row_attendancelist['staff_id']][$row_attendancelist['list_type_remark']] = $row_attendancelist ; + } + } + + foreach ( $list_workday as $kwork => $vwork ){ + $staff_id = $kwork ; + + $total_realwork = floor( ( $vwork['WD'] != null ? $vwork['WD']['sum_list_work_day'] : 0 ) + 0 ) ; + $total_workday = 0 ; + foreach ( [ 'WD', 'PT', 'AL', 'MC', 'UL', 'AS' ] as $ktype => $vtype ){ + if ( $vwork[$vtype] != null ){ + $total_workday += $vwork[$vtype]['count_list_type_remark'] ; + } + } + + + if ( $array_record[$staff_id]['daily-attendance'] == null ){ + if ( $total_realwork > 0 ){ + $point_value = $array_setting_point['daily'] ; + $point_total = ( $total_realwork * $point_value ) ; + $point_total_minus1day = ( $point_total - $point_value ) ; + + $remark = 'System auto given daily attendance point ( '.$total_realwork.' days * '.$point_value.' points = '.$point_total.' points )' ; + + $mysqli->query( "INSERT INTO staff_point_monthly_report + ( staff_id, type, remark, given_date, times, given_point ) VALUES + ( '".$staff_id."', 'daily-attendance', '".$remark."', '".$last_monthday."', '".$total_realwork."', '".$point_value."' )" ) ; + + $report_id = $mysqli->insert_id ; + + pointMovement( 'staff_point_monthly_report', $report_id, 'daily', 'normal', $staff_id, $point_total_minus1day, $remark ) ; + } + } + + + if ( $array_record[$staff_id]['monthly-attendance'] == null ){ + if ( $total_realwork > 0 && $total_realwork == $total_workday ){ + $point_value = $array_setting_point['monthly'] ; + + $remark = 'System auto given monthly attendance point ( '.$total_workday.' days, '.$point_value.' points )' ; + + $mysqli->query( "INSERT INTO staff_point_monthly_report + ( staff_id, type, remark, given_date, times, given_point ) VALUES + ( '".$staff_id."', 'monthly-attendance', '".$remark."', '".$last_monthday."', '".$total_workday."', '".$point_value."' )" ) ; + + $report_id = $mysqli->insert_id ; + + pointMovement( 'staff_point_monthly_report', $report_id, 'monthly', 'normal', $staff_id, 0, $remark ) ; + } + } + + } + + break ; + + case 'HrManual' : + + $staff_ids = [] ; + $select_manual = $mysqli->query( "SELECT staff_id FROM staff_attendance_manual + WHERE deleted_at IS NULL AND attendance_date LIKE '%".$last_month."%'" ) ; + if ( $select_manual->num_rows > 0 ){ + while ( $row_manual = $select_manual->fetch_assoc() ){ + $staff_ids[] = $row_manual['staff_id'] ; + } + } + + if ( count($staff_ids) ){ + foreach ( $staff_ids as $kstaff => $vstaff ){ + $staff_id = $vstaff ; + + if ( $array_record[$staff_id]['monthly-attendance'] == null ){ + $point_value = $array_setting_point['monthly'] ; + + $remark = 'System auto given monthly attendance point ( '.$point_value.' points )' ; + + $mysqli->query( "INSERT INTO staff_point_monthly_report + ( staff_id, type, remark, given_date, times, given_point ) VALUES + ( '".$staff_id."', 'monthly-attendance', '".$remark."', '".$last_monthday."', '1', '".$point_value."' )" ) ; + + $report_id = $mysqli->insert_id ; + + pointMovement( 'staff_point_monthly_report', $report_id, 'monthly', 'normal', $staff_id, 0, $remark ) ; + } + + } + } + + break ; + +} + +?> \ No newline at end of file diff --git a/cron/generate_monthly_performance_point.php b/cron/generate_monthly_performance_point.php new file mode 100644 index 0000000..8df1dc6 --- /dev/null +++ b/cron/generate_monthly_performance_point.php @@ -0,0 +1,167 @@ + 0, 'monthly-task' => 0 ] ; +$select_setting_point = $mysqli->query( "SELECT point_type, point_value FROM setting_point + WHERE deleted_at IS NULL AND point_from = 'staff_point_monthly_report' AND point_type IN ( 'monthly-compliment', 'monthly-task' ) AND difficulty = 'normal' " ) ; +if ( $select_setting_point->num_rows > 0 ){ + while ( $row_setting_point = $select_setting_point->fetch_assoc() ){ + $array_setting_point[$row_setting_point['point_type']] = $row_setting_point['point_value'] ; + } +} + + +// check record +$array_record = [] ; +$select_record = $mysqli->query( "SELECT staff_id, type FROM staff_point_monthly_report + WHERE deleted_at IS NULL AND type IN ( 'monthly-compliment', 'monthly-task' ) AND given_date LIKE '%".$last_month."%'" ) ; + +if ( $select_record->num_rows > 0 ){ + while ( $row_record = $select_record->fetch_assoc() ){ + $array_record[$row_record['staff_id']][$row_record['type']] = $row_record['staff_id'] ; + } +} + + + + +// get all staff +$staffs = [] ; +$staffs_q = $mysqli->query("SELECT staff_id, staff_idno, staff_name FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned >= '".date("Y-m-d",time())."' OR staff_date_resigned = '0000-00-00' OR staff_date_resigned IS NULL )") ; +if ( $staffs_q->num_rows > 0 ){ + while ( $row_staff = $staffs_q->fetch_assoc() ){ + $staffs[] = $row_staff ; + } +} + + +// - compliment +// Â·ä¸€ä¸ªæœˆå†…è¢«åŠ äº†æœ€å°‘äº”æ¬¡åˆ†ï¼Œå¹¶ä¸”åŒæ—¶æ²¡æœ‰è¢«æ‰£è¿‡ä»»ä½•的分数,就能拿到é¢å¤–çš„30分(æ¯ä¸ªæœˆ30分) +// ·æ¯ä¸ªæœˆä¸€å·è®¡ç®—上个月的数æ®ï¼ˆauto) +$adjustments = [] ; +$select_adjustment = $mysqli->query( "SELECT a.staff_id, b.adjustment_type, count(b.adjustment_type) as total_adjustment_type FROM staff_adjustment_point a + LEFT JOIN staff_adjustment b ON ( a.adjustment_id = b.adjustment_id ) + WHERE a.deleted_at IS NULL AND b.deleted_at IS NULL AND b.created_at LIKE '%".$last_month."%' + GROUP BY a.staff_id, b.adjustment_type" ) ; +if ( $select_adjustment->num_rows > 0 ){ + while ( $row_adjustment = $select_adjustment->fetch_assoc() ){ + $adjustments[$row_adjustment['staff_id']][$row_adjustment['adjustment_type']] = $row_adjustment['total_adjustment_type'] ; + } +} + + + + +// - task +// ·一个月内最少完æˆä¸‰ä¸ªtask(在deadline之å‰ï¼‰ï¼Œå°±èƒ½èŽ·å¾—50分(æ¯ä¸ªæœˆ50分) +// ·æ¯ä¸ªæœˆä¸€å·è®¡ç®—上个月的数æ®ï¼ˆauto) +$tasks = [] ; +$select_task = $mysqli->query( "SELECT a.task_id, a.assigned_by, ( SELECT GROUP_CONCAT( DISTINCT(staff_id) ) FROM task_joinstaff WHERE task_id = a.task_id ) as executed_by FROM task a + WHERE a.deleted_at IS NULL AND a.status = 'approved' AND a.is_late = 'no' AND a.updated_at LIKE '%".$last_month."%'" ) ; +if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $executed_by = $row_task['executed_by'] ; + $executeds = ( $executed_by != null ? explode( ',', $executed_by ) : [] ) ; + + if ( $row_task['assigned_by'] > 0 ){ + if ( !in_array( $row_task['assigned_by'], $executeds ) ){ + $tasks[$row_task['assigned_by']][] = $row_task['task_id'] ; + } + } + + foreach ( $executeds as $kexecuted => $vexecuted ){ + $tasks[$vexecuted][] = $row_task['task_id'] ; + } + + } +} + + + +// - improvement +// ·给出有用的suggestion就能获得é¢å¤–çš„60分(æ¯ä¸‰ä¸ªæœˆ60分) +// ·æ¯ä¸ªæœˆä¸€å·è®¡ç®—上个月的数æ®ï¼ˆauto) +// $suggestions = [] ; +// $select_suggestion = $mysqli->query( "SELECT staff_id, count(suggestion_id) as total_suggestion FROM suggestion +// WHERE deleted_at IS NULL AND type = 'improvement-plan' AND status = 'confirmed' AND updated_at LIKE '%".$last_month."%' +// GROUP BY staff_id" ) ; +// if ( $select_suggestion->num_rows > 0 ){ +// while ( $row_suggestion = $select_suggestion->fetch_assoc() ){ +// $suggestions[$row_suggestion['staff_id']] = $row_suggestion['total_suggestion'] ; +// } +// } + + + + + +// start running report +foreach ( $staffs as $kstaff => $vstaff ){ + + $staff_id = $vstaff['staff_id'] ; + + + // adjustment given (compliment) + if ( $array_record[$staff_id]['monthly-compliment'] == null ){ + $get_adjustment = $adjustments[$staff_id] ; + if ( $get_adjustment != null ){ + if ( $get_adjustment['minus'] == null && $get_adjustment['plus'] != null ){ + if ( $get_adjustment['plus'] >= 5 ){ + + $point_value = $array_setting_point['monthly-compliment'] ; + + $remark = 'System auto given monthly compliment point ( '.$point_value.' points )' ; + + $mysqli->query( "INSERT INTO staff_point_monthly_report + ( staff_id, type, remark, given_date, times, given_point ) VALUES + ( '".$staff_id."', 'monthly-compliment', '".$remark."', '".$last_monthday."', '1', '".$point_value."' )" ) ; + + $report_id = $mysqli->insert_id ; + + pointMovement( 'staff_point_monthly_report', $report_id, 'monthly-compliment', 'normal', $staff_id, 0, $remark ) ; + + } + } + } + } + + + // task given + if ( $array_record[$staff_id]['monthly-task'] == null ){ + $get_task = $tasks[$staff_id] ; + if ( $get_task != null ){ + + if ( count($get_task) >= 3 ){ + + $point_value = $array_setting_point['monthly-task'] ; + + $remark = 'System auto given monthly task point ( '.$point_value.' points )' ; + + $mysqli->query( "INSERT INTO staff_point_monthly_report + ( staff_id, type, remark, given_date, times, given_point ) VALUES + ( '".$staff_id."', 'monthly-task', '".$remark."', '".$last_monthday."', '1', '".$point_value."' )" ) ; + + $report_id = $mysqli->insert_id ; + + pointMovement( 'staff_point_monthly_report', $report_id, 'monthly-task', 'normal', $staff_id, 0, $remark ) ; + + } + } + } + +} + + + +?> \ No newline at end of file diff --git a/cron/generate_payment_slip.php b/cron/generate_payment_slip.php new file mode 100644 index 0000000..24e4521 --- /dev/null +++ b/cron/generate_payment_slip.php @@ -0,0 +1,241 @@ +query("SELECT * FROM setting_salary_tax WHERE tax_type = 'slip_month_setting' LIMIT 1"); +if(mysqli_num_rows($query_setting) > 0){ + $result_setting = mysqli_fetch_assoc($query_setting); + $setting_month = $result_setting['tax_title']; +} +if($setting_month == 'current'){ + $month = date('Y-m-01', strtotime($today_date)); +}else if($setting_month == 'previous'){ + $temp_month = date('Y-m-01', strtotime($today_date)); + $month = date('Y-m-01', strtotime($temp_month. ' - 1 months')); +} + + +$query_staff = $mysqli->query("SELECT * FROM staff WHERE deleted_at is NULL"); +if(mysqli_num_rows($query_staff) > 0){ + + //get all tax rate and store + $tax_rate = []; + $query_tax_rate = $mysqli->query("SELECT * FROM setting_salary_tax WHERE deleted_at is NULL"); + while($row_tax = mysqli_fetch_assoc($query_tax_rate)){ + $tax_rate[$row_tax['tax_id']] = $row_tax; + } + + while($row = mysqli_fetch_assoc($query_staff)){ + $staff_id = $row['staff_id']; + $staff_idno = $row['staff_idno']; + $basic_salary = $row['staff_salary']; + $epf_rate_id = $row['staff_epf_rate_id']; + $socso_rate_id = $row['staff_socso_rate_id']; + $eis_rate_id = $row['staff_eis_rate_id']; + $zakat_rate_id = $row['staff_zakat_rate_id']; + $tax_status_id = $row['tax_status_id']; //pcb category, resident, non-resident, no tax + + $staff_epf_rate = $tax_rate[$epf_rate_id]['employee_rate']; + $employer_epf_rate = $tax_rate[$epf_rate_id]['employer_rate']; + $staff_socso_rate = $tax_rate[$socso_rate_id]['employee_rate']; + $employer_socso_rate = $tax_rate[$socso_rate_id]['employer_rate']; + $staff_eis_rate = $tax_rate[$eis_rate_id]['employee_rate']; + $employer_eis_rate = $tax_rate[$eis_rate_id]['employer_rate']; + $staff_zakat_rate = $tax_rate[$zakat_rate_id]['employee_rate']; + $employer_zakat_rate = $tax_rate[$zakat_rate_id]['employer_rate']; + + $socso_category_id = $row['socso_category_id']; + $eis_status = $row['staff_eis_status']; + + $birthday = $row['staff_birthdate']; + if($birthday == NULL || $birthday == '0000-00-00'){ + $age = 0; + }else{ + $birthDate = date("Y",strtotime($birthday)); + $age = date("Y") - $birthDate; + } + $country_id = $row['country_id']; + $query_country = $mysqli->query("SELECT country_desc FROM master_country WHERE country_id = '$country_id' LIMIT 1"); + $country = mysqli_fetch_assoc($query_country)['country_desc']; + + if($country == 'MALAYSIA'){ + $citizen = 'yes'; + }else{ + $citizen = 'yes'; + } + + $staff_settings = $row['staff_settings'] ; + if ( $staff_settings != '' ){ + $staff_settings = JsonEncodeDecode('decode', $staff_settings) ; + }else{ + $staff_settings = [] ; + } + $marital_status = $staff_settings['marital_status']; + $num_children = $staff_settings['no_children']; + $spouse_working = $staff_settings['spouse_working']; + + + //for kindlemind + $query_commission_temp = $mysqli->query("SELECT * FROM staff_commission_temp WHERE staff_id='$staff_idno' AND month='$month' LIMIT 1"); + if(mysqli_num_rows($query_commission_temp) > 0){ + $commission = mysqli_fetch_assoc($query_commission_temp)['commission']; + }else{ + $commission = 0; + } + + + $allowance = $row['staff_allowance_topup'] + $row['staff_allowance_work'] + $row['staff_allowance_food']; + + //calculate epf, socso, eis, pcb + $staff_epf = 0; + $staff_socso = 0; + $staff_eis = 0; + $staff_zakat = 0; + $staff_pcb = 0; + $employer_epf = 0; + $employer_socso = 0; + $employer_eis = 0; + $employer_zakat = 0; + $employer_pcb = 0; + $deduction = 0; + + $gross_total = $basic_salary + $commission + $allowance; + + //calculate pcb tax + + $boolean_pcb = true; + if($row['tax_status_id'] == 1){ + + if($marital_status == 'Single' || $marital_status == 'Divorced' || $marital_status == 'Widow'){ + $category = 1; + $category2 = 'B'; + }else if($marital_status == 'Married'){ + + if($num_children == '' || $num_children == 0){ + $category2 = 'K'; + }else{ + $category2 = 'KA'.$num_children; + } + + if($spouse_working == 'Yes'){ + $category = 3; + }else{ + $category = 2; + } + + }else{ + $boolean_pcb = false; + } + }else{ + $boolean_pcb = false; + } + + if($boolean_pcb){ + $pcb = calculateTax('pcb', $gross_total, $category, $category2); + }else{ + $pcb = 0; + } + + $staff_pcb = $pcb; + + //calculate pcb tax end + + + + //calculate epf tax + + if($staff_epf_rate == '11'){ + $epf_array = calculateTaxEPF('epf', $gross_total, $age, $citizen); + }else if($staff_epf_rate == '9'){ + $epf_array = calculateTaxEPF('epf', $gross_total, $age, $citizen); + }else if($staff_epf_rate == '0' || $staff_epf_rate == ''){ + $epf_array = []; + } + + if($epf_array['staff_epf']!= ''){ + $staff_epf = $epf_array['staff_epf']; + } + if($epf_array['employer_epf']!= ''){ + $employer_epf = $epf_array['employer_epf']; + } + + //calculate epf tax end + + + //calculate socso tax + + if($socso_category_id == 1){ + $socso_array = calculateTaxSOCSO('socso', $gross_total, $socso_category_id); + }else if($socso_category_id == 2){ + $socso_array = calculateTaxSOCSO('socso', $gross_total, $socso_category_id); + }else{ + $socso_array = []; + } + + if($socso_array['staff_socso']!= ''){ + $staff_socso = $socso_array['staff_socso']; + } + if($socso_array['employer_socso']!= ''){ + $employer_socso = $socso_array['employer_socso']; + } + + //calculate socso tax end + + + //calculate eis tax + + if($eis_status == 1){ + $eis_array = calculateTaxEIS('eis', $gross_total); + }else{ + $eis_array = []; + } + + if($eis_array['staff_eis']!= ''){ + $staff_eis = $eis_array['staff_eis']; + } + if($eis_array['employer_eis']!= ''){ + $employer_eis = $eis_array['employer_eis']; + } + + //calculate eis tax end + + + //calculate zakat fund + + if($staff_zakat_rate > 0){ + $staff_zakat = calculateTaxZAKAT($gross_total, $staff_zakat_rate); + } + + //calculate zakat fund end + + $subtotal = $basic_salary + $commission + $allowance ; + $total = $basic_salary + $commission + $allowance - $staff_epf - $staff_socso - $staff_eis - $staff_zakat - $staff_pcb ; + + + $query_salary_slip = $mysqli->query("SELECT slip_id FROM salary_slip WHERE staff_id = '$staff_id' AND month = '$month' LIMIT 1"); + if(mysqli_num_rows($query_salary_slip) <= 0){ + $insert = $mysqli->query("INSERT INTO salary_slip ( staff_id, basic_salary, commission, allowance, staff_epf, staff_socso, staff_eis, staff_zakat, staff_pcb, employer_epf, employer_socso, employer_eis, employer_zakat, employer_pcb, deduction, deduction_reason, status, sub_total, total, month ) VALUES ( '$staff_id', '$basic_salary', '$commission', '$allowance', '$staff_epf', '$staff_socso', '$staff_eis', '$staff_zakat', '$staff_pcb', '$employer_epf', '$employer_socso', '$employer_eis', '$employer_zakat', '$employer_pcb', '$deduction', '', 'active', '$subtotal', '$total', '$month' )"); + + if($insert){ + $slip_id = $mysqli->insert_id; + + $mysqli->query("INSERT INTO setting_slip_tax( slip_id, staff_epf_rate, employer_epf_rate, age, country_id, staff_socso_rate, employer_socso_rate, socso_category_id, staff_eis_rate, employer_eis_rate, staff_eis_status, staff_zakat_rate, employer_zakat_rate, tax_status_id, marital_status, spouse_working, num_children ) VALUES ( '$slip_id', '$staff_epf_rate', '$employer_epf_rate', '$age', '$country_id', '$staff_socso_rate', '$employer_socso_rate', '$socso_category_id', '$staff_eis_rate', '$employer_eis_rate', '$eis_status', '$staff_zakat_rate', '$employer_zakat_rate', '$tax_status_id', '$marital_status', '$spouse_working', '$num_children')"); + + } + } + + + } +} + + +?> \ No newline at end of file diff --git a/cron/generate_seasonly_improvement_point.php b/cron/generate_seasonly_improvement_point.php new file mode 100644 index 0000000..e71675d --- /dev/null +++ b/cron/generate_seasonly_improvement_point.php @@ -0,0 +1,106 @@ + 0 ] ; + $select_setting_point = $mysqli->query( "SELECT point_type, point_value FROM setting_point + WHERE deleted_at IS NULL AND point_from = 'staff_point_monthly_report' AND point_type IN ( 'seasonly-improvement' ) AND difficulty = 'normal' " ) ; + if ( $select_setting_point->num_rows > 0 ){ + while ( $row_setting_point = $select_setting_point->fetch_assoc() ){ + $array_setting_point[$row_setting_point['point_type']] = $row_setting_point['point_value'] ; + } + } + + + // check record + $array_record = [] ; + $select_record = $mysqli->query( "SELECT staff_id, type FROM staff_point_monthly_report + WHERE deleted_at IS NULL AND type IN ( 'seasonly-improvement' ) AND given_date LIKE '%".$last_month."%'" ) ; + + if ( $select_record->num_rows > 0 ){ + while ( $row_record = $select_record->fetch_assoc() ){ + $array_record[$row_record['staff_id']][$row_record['type']] = $row_record['staff_id'] ; + } + } + + + + // get all staff + $staffs = [] ; + $staffs_q = $mysqli->query("SELECT staff_id, staff_idno, staff_name FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned >= '".date("Y-m-d",time())."' OR staff_date_resigned = '0000-00-00' OR staff_date_resigned IS NULL )") ; + if ( $staffs_q->num_rows > 0 ){ + while ( $row_staff = $staffs_q->fetch_assoc() ){ + $staffs[] = $row_staff ; + } + } + + // - improvement + // ·给出有用的suggestion就能获得é¢å¤–çš„60分(æ¯ä¸‰ä¸ªæœˆ60分) + // ·æ¯ä¸ªæœˆä¸€å·è®¡ç®—上个月的数æ®ï¼ˆauto) + $suggestions = [] ; + $select_suggestion = $mysqli->query( "SELECT staff_id, count(suggestion_id) as total_suggestion FROM suggestion + WHERE deleted_at IS NULL AND type = 'improvement-plan' AND status = 'confirmed' AND updated_at BETWEEN '".$date_from." 00:00:00' AND '".$date_to." 23:59:59' + GROUP BY staff_id" ) ; + if ( $select_suggestion->num_rows > 0 ){ + while ( $row_suggestion = $select_suggestion->fetch_assoc() ){ + $suggestions[$row_suggestion['staff_id']] = $row_suggestion['total_suggestion'] ; + } + } + + + + + + + // start running report + foreach ( $staffs as $kstaff => $vstaff ){ + + $staff_id = $vstaff['staff_id'] ; + + + // adjustment given (compliment) + if ( $array_record[$staff_id]['seasonly-improvement'] == null ){ + $get_suggestion = $suggestions[$staff_id] ; + if ( $get_suggestion != null ){ + if ( $get_suggestion >= 1 ){ + + $point_value = $array_setting_point['seasonly-improvement'] ; + + $remark = 'System auto given seasonly improvement point ( '.$point_value.' points )' ; + + $mysqli->query( "INSERT INTO staff_point_monthly_report + ( staff_id, type, remark, given_date, times, given_point ) VALUES + ( '".$staff_id."', 'seasonly-improvement', '".$remark."', '".$last_monthday."', '1', '".$point_value."' )" ) ; + + $report_id = $mysqli->insert_id ; + + pointMovement( 'staff_point_monthly_report', $report_id, 'seasonly-improvement', 'normal', $staff_id, 0, $remark ) ; + + } + } + } + + } + +} + +?> \ No newline at end of file diff --git a/cron/generate_seasonly_performance_point.php b/cron/generate_seasonly_performance_point.php new file mode 100644 index 0000000..ce2fad6 --- /dev/null +++ b/cron/generate_seasonly_performance_point.php @@ -0,0 +1,130 @@ + 0, 'seasonly-summary' => 0 ] ; + $select_setting_point = $mysqli->query( "SELECT point_type, point_value FROM setting_point + WHERE deleted_at IS NULL AND point_from = 'staff_point_monthly_report' AND point_type IN ( 'seasonly-improvement', 'seasonly-summary' ) AND difficulty = 'normal' " ) ; + if ( $select_setting_point->num_rows > 0 ){ + while ( $row_setting_point = $select_setting_point->fetch_assoc() ){ + $array_setting_point[$row_setting_point['point_type']] = $row_setting_point['point_value'] ; + } + } + + + // check record + $array_record = [] ; + $select_record = $mysqli->query( "SELECT staff_id, type FROM staff_point_monthly_report + WHERE deleted_at IS NULL AND type IN ( 'seasonly-improvement', 'seasonly-summary' ) AND given_date LIKE '%".$last_month."%'" ) ; + + if ( $select_record->num_rows > 0 ){ + while ( $row_record = $select_record->fetch_assoc() ){ + $array_record[$row_record['staff_id']][$row_record['type']] = $row_record['staff_id'] ; + } + } + + + + // get all staff + $staffs = [] ; + $staffs_q = $mysqli->query("SELECT staff_id, staff_idno, staff_name FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned >= '".date("Y-m-d",time())."' OR staff_date_resigned = '0000-00-00' OR staff_date_resigned IS NULL )") ; + if ( $staffs_q->num_rows > 0 ){ + while ( $row_staff = $staffs_q->fetch_assoc() ){ + $staffs[] = $row_staff ; + } + } + + // - improvement + // ·给出有用的suggestion就能获得é¢å¤–çš„60分(æ¯ä¸‰ä¸ªæœˆ60分) + // ·æ¯ä¸ªæœˆä¸€å·è®¡ç®—上个月的数æ®ï¼ˆauto) + $suggestions = [] ; + $select_suggestion = $mysqli->query( "SELECT staff_id, count(suggestion_id) as total_suggestion FROM suggestion + WHERE deleted_at IS NULL AND type = 'improvement-plan' AND status = 'confirmed' AND updated_at BETWEEN '".$date_from." 00:00:00' AND '".$date_to." 23:59:59' + GROUP BY staff_id" ) ; + if ( $select_suggestion->num_rows > 0 ){ + while ( $row_suggestion = $select_suggestion->fetch_assoc() ){ + $suggestions[$row_suggestion['staff_id']] = $row_suggestion['total_suggestion'] ; + } + } + + + + + + + // start running report + foreach ( $staffs as $kstaff => $vstaff ){ + + $staff_id = $vstaff['staff_id'] ; + + + // adjustment given (compliment) + if ( $array_record[$staff_id]['seasonly-improvement'] == null ){ + $get_suggestion = $suggestions[$staff_id] ; + if ( $get_suggestion != null ){ + if ( $get_suggestion >= 1 ){ + + $point_value = $array_setting_point['seasonly-improvement'] ; + + $remark = 'System auto given seasonly improvement point ( '.$point_value.' points )' ; + + $mysqli->query( "INSERT INTO staff_point_monthly_report + ( staff_id, type, remark, given_date, times, given_point ) VALUES + ( '".$staff_id."', 'seasonly-improvement', '".$remark."', '".$last_monthday."', '1', '".$point_value."' )" ) ; + + $report_id = $mysqli->insert_id ; + + pointMovement( 'staff_point_monthly_report', $report_id, 'seasonly-improvement', 'normal', $staff_id, 0, $remark ) ; + + } + } + } + + + // task given + // if ( $array_record[$staff_id]['seasonly-summary'] == null ){ + // $get_task = $tasks[$staff_id] ; + // if ( $get_task != null ){ + + // if ( count($get_task) >= 3 ){ + + // $point_value = $array_setting_point['monthly-task'] ; + + // $remark = 'System auto given monthly task point ( '.$point_value.' points )' ; + + // $mysqli->query( "INSERT INTO staff_point_monthly_report + // ( staff_id, type, remark, given_date, times, given_point ) VALUES + // ( '".$staff_id."', 'monthly-task', '".$remark."', '".$last_monthday."', '1', '".$point_value."' )" ) ; + + // $report_id = $mysqli->insert_id ; + + // pointMovement( 'staff_point_monthly_report', $report_id, 'monthly-task', 'normal', $staff_id, 0, $remark ) ; + + // } + // } + // } + + } + +} + +?> \ No newline at end of file diff --git a/cron/generate_seasonly_summary_point.php b/cron/generate_seasonly_summary_point.php new file mode 100644 index 0000000..27f68a6 --- /dev/null +++ b/cron/generate_seasonly_summary_point.php @@ -0,0 +1,109 @@ + 0 ] ; + $select_setting_point = $mysqli->query( "SELECT point_type, point_value FROM setting_point + WHERE deleted_at IS NULL AND point_from = 'staff_point_monthly_report' AND point_type IN ( 'seasonly-summary' ) AND difficulty = 'normal' " ) ; + if ( $select_setting_point->num_rows > 0 ){ + while ( $row_setting_point = $select_setting_point->fetch_assoc() ){ + $array_setting_point[$row_setting_point['point_type']] = $row_setting_point['point_value'] ; + } + } + + + // check record + $array_record = [] ; + $select_record = $mysqli->query( "SELECT staff_id, type FROM staff_point_monthly_report + WHERE deleted_at IS NULL AND type IN ( 'seasonly-summary' ) AND given_date LIKE '%".$last_month."%'" ) ; + + if ( $select_record->num_rows > 0 ){ + while ( $row_record = $select_record->fetch_assoc() ){ + $array_record[$row_record['staff_id']][$row_record['type']] = $row_record['staff_id'] ; + } + } + + + + // get all staff + $staffs = [] ; + $staffs_q = $mysqli->query("SELECT staff_id, staff_idno, staff_name FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned >= '".date("Y-m-d",time())."' OR staff_date_resigned = '0000-00-00' OR staff_date_resigned IS NULL )") ; + if ( $staffs_q->num_rows > 0 ){ + while ( $row_staff = $staffs_q->fetch_assoc() ){ + $staffs[] = $row_staff ; + } + } + + + + + + + // 'monthly-attendance', 'monthly-compliment', 'monthly-task', 'seasonly-improvement' + // the total should be 10 by each staff + $summaries = [] ; + $select_summary = $mysqli->query( "SELECT staff_id, count(report_id) as total_summary FROM staff_point_monthly_report + WHERE deleted_at IS NULL AND type IN ( 'monthly-attendance', 'monthly-compliment', 'monthly-task', 'seasonly-improvement' ) AND given_date BETWEEN '".$date_from." 00:00:00' AND '".$date_to." 23:59:59' + GROUP BY staff_id" ) ; + if ( $select_summary->num_rows > 0 ){ + while ( $row_summary = $select_summary->fetch_assoc() ){ + $summaries[$row_summary['staff_id']] = $row_summary['total_summary'] ; + } + } + + + + + + // start running report + foreach ( $staffs as $kstaff => $vstaff ){ + + $staff_id = $vstaff['staff_id'] ; + + + // adjustment given (compliment) + if ( $array_record[$staff_id]['seasonly-summary'] == null ){ + $get_summary = $summaries[$staff_id] ; + if ( $get_summary != null ){ + if ( $get_summary >= 10 ){ + + $point_value = $array_setting_point['seasonly-summary'] ; + + $remark = 'System auto given seasonly summary point ( '.$point_value.' points )' ; + + $mysqli->query( "INSERT INTO staff_point_monthly_report + ( staff_id, type, remark, given_date, times, given_point ) VALUES + ( '".$staff_id."', 'seasonly-summary', '".$remark."', '".$last_monthday."', '1', '".$point_value."' )" ) ; + + $report_id = $mysqli->insert_id ; + + pointMovement( 'staff_point_monthly_report', $report_id, 'seasonly-summary', 'normal', $staff_id, 0, $remark ) ; + + } + } + } + + } + +} + +?> \ No newline at end of file diff --git a/cron/generate_staff_achievement.php b/cron/generate_staff_achievement.php new file mode 100644 index 0000000..f761810 --- /dev/null +++ b/cron/generate_staff_achievement.php @@ -0,0 +1,46 @@ +query("SELECT staff_id, staff_star, staff_point_achievement, staff_achievement FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned >= '".date("Y-m-d",time())."' OR staff_date_resigned = '0000-00-00' OR staff_date_resigned IS NULL )") ; + +if ( $staffs_q->num_rows > 0 ){ + + $yesterday_day = date( 'Y-m-d', strtotime( '-1 days' ) ) ; + + while ( $staff = $staffs_q->fetch_assoc() ){ + + + + + $staff_id = $staff['staff_id'] ; + $staff_star = $staff['staff_star'] ; + $staff_point_achievement = $staff['staff_point_achievement'] ; + $staff_achievement = $staff['staff_achievement'] ; + + + + + + $mysqli->query( "INSERT INTO staff_monthly_achievement + ( reported_at, staff_id, staff_point_achievement, staff_star, staff_achievement ) VALUES + ( '".$yesterday_day."', '".$staff_id."', '".$staff_point_achievement."', '".$staff_star."', '".$staff_achievement."' )" ) ; + + + + + $staff_point_achievement = ( $staff_point_achievement <= 0 ? $staff_point_achievement : 0 ) ; + + $mysqli->query( "UPDATE staff SET + staff_star = '0', + staff_point_achievement = '".$staff_point_achievement."' + WHERE staff_id = '".$staff_id."'" ) ; + + + } + +} + +?> \ No newline at end of file diff --git a/cron/hr-system-b0af6-firebase-adminsdk-u5wel-5bcb3596d4.json b/cron/hr-system-b0af6-firebase-adminsdk-u5wel-5bcb3596d4.json new file mode 100644 index 0000000..a05f875 --- /dev/null +++ b/cron/hr-system-b0af6-firebase-adminsdk-u5wel-5bcb3596d4.json @@ -0,0 +1,13 @@ +{ + "type": "service_account", + "project_id": "hr-system-b0af6", + "private_key_id": "5bcb3596d437019f95b9d43e6a47c5456f9a8638", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCouTmCxNvs14t6\nG0wZCb6lg2jOQG/cVzh1PPK38jDp88ehfljtvaCQx9ZXWrANnAZVqN9ufaL5zBS7\noT3Q6u7hO+9sakyrf70gzqgEgXEFs8Wa7/JHqChMPUmJoaDWhf/CEKGdeMGyBj4P\n9/Qt7TyQqDSpzKndx0raAVdQtybNKUrwNFO9RB7AOjuKU3FhDUKiFCZp4SllmPsJ\ntvUt3Wn/ItPhzRZLdcCR0P5+S71prwwu/5u8Xk/f1+OsC2Zgw5G62ztqbOOj4xUc\neWr6J66D0jNwBKPhf2vTINAdxzGQGiRD9iSOefP3499v+cbsUNx3Bce6lNgSJCt9\nPpz74309AgMBAAECggEABChkWWuee8yn/D9V9bv+vbdqSsLdvtFLa+AvnwbR28IN\nJlalvF4S6d5y0r5CXmN86Hl74A4qiPtVe3YyvsY7UsOWV9aawxMnxvowu8Ow1FIk\nyXemQcvMCmzsNf8Mppywu8iLIwVJyKhMuToEA2m4N1xdx91qRjPWDV9BFpUc2Ktk\nilC8YMobwiZYKyrtHH5m9eJCtdaUs4zRa1Ur0g+LFMpOh2O3g+eC+YDdN7mP6Bky\nErs403DVItMkFC82A8xLvhq5MLDPKcx6YFAlsXe/gNClhJ/lvG7OeX1aqDOqtm+U\ntA71sZXRh0qZ79hbKB5FQjropmNrg8yAIJ0nnNieRQKBgQDkhYvyg575yDGtgvGk\nGl7HTfzQg5YbarAAFgk3fw7pxrldUz70KsaGc2ixj4SXc24q8DMY2HQlGNYXBDZX\n29+pW2EE/HYlO0EY3ANj9ma1zwh/qB7SnC1eCpQ07q1qhadOfc/VhMICjuXAgN51\n63WNFTkKoXuJusEmKnihi05SQwKBgQC9AvIjKbdx9zl8MbCylEWhzVG7pl2seSnR\nPSKzLyUve+CdcN/IeAV6UIX8oZ3VpjAM2SUIQQQ7AAc0RaqLHBA0tpYQeqUh2+3i\nw6CqqX1KaP6X1uQEQooutRRFVv6vZ+zeZBU6gNb+ZA7jGn46k+PPYcXxCyN3XJ2G\nLVHBbGy6fwKBgQCBV+1cOI90xZEIqoLm5V4b5NJhmvkNT5eKlO5mkO3599bXMdUC\nEmwHka8CQT9FEbqbZxUkzO8ASEx0/pdbp0Gy89u4HMUqUZ2I2o64t7Bu213uE1RO\n1MMA5W/5fdZ94mROEvvd2KSPGh6ElOxVRg5k6kw87iWkUSYd2hApL1YHTQKBgDiQ\nkiBd0q2DnCuDv2qiHvieNpCe6De+hvo8fo77U/iS7RSQ/BfFe3YwdPi28UJIGuct\ncPy4YGi7yGwnUTOScXMlFWHXImYwqE+N1h5c3McRBugwAksYEryJqohZ0Zxy0Jt5\nfjTk6/JzxVTHz/D941Zj31YUzEdjay0FkQr+xMdHAoGBAISQ6K+tRnjAXi1Hnu/p\nWdmrem1wJrVZiVbXUJoduu/uBaexSetO+PaMniZrjZeDTYfq6DpjLbhrQB86jcj7\n0jrpy4nmgLjNU+QxKO2STrepnkDDzLhvohWkK8qBBQt95/FFfTXpH458Q97fUcS3\nJiBKfyvwllztWwch/m04964z\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-u5wel@hr-system-b0af6.iam.gserviceaccount.com", + "client_id": "116658927130976853667", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-u5wel%40hr-system-b0af6.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" +} diff --git a/cron/push_application_form_reminder.php b/cron/push_application_form_reminder.php new file mode 100644 index 0000000..cc3413d --- /dev/null +++ b/cron/push_application_form_reminder.php @@ -0,0 +1,84 @@ +query("SELECT employment_id, employment_branch, employment_position, employment_name, employment_email, employment_interview_date FROM staff_employment WHERE + employment_trash = '0' AND ( + ( employment_status = 'Interview' AND employment_interview_date LIKE '%".TODAYDAY."%' ) OR + ( employment_status = 'Reschedule' AND employment_r_interview_date LIKE '%".TODAYDAY."%' ) + )" ) ; +if ( $mysqli_employment->num_rows > 0 ){ + + $mailer = new Mailer() ; + + // get all branch + $array_branch = [] ; + $mysqli_branch = $mysqli->query( "SELECT branch_id, branch_name, branch_hr_email, branch_hr_cc, branch_hr_contact, branch_email_footer FROM branch + WHERE deleted_at IS NULL" ) ; + if ( $mysqli_branch->num_rows > 0 ){ + while ( $row_branch = $mysqli_branch->fetch_assoc() ){ + $row_branch['branch_hr_cc'] = explodeToArray( $row_branch['branch_hr_cc'] ) ; + $row_branch['branch_email_footer'] = entityDecode( dataFilter( $row_branch['branch_email_footer'] ) ) ; + + $array_branch[$row_branch['branch_id']] = $row_branch ; + } + } + + // get all position + $array_position = [] ; + $mysqli_position = $mysqli->query( "SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; + if ( $mysqli_position->num_rows > 0 ){ + while ( $row_position = $mysqli_position->fetch_assoc() ){ + $array_position[$row_position['job_position_id']] = $row_position['job_position_desc'] ; + } + } + + while ( $row_employment = $mysqli_employment->fetch_assoc() ){ + + $title = "Friendly Reminder For Today Interview" ; + $link = PATH.'hr-employment-schedule-interview-date.php?page='.$row_employment['employment_id'].'&branch='.$row_employment['employment_branch'].'&sign='.md5($row_employment['employment_id'].$row_employment['employment_branch'].APIKEY) ; + $link_reschedule = ''.$link.'' ; + $link_attach_resume = 'Candidate\'s Resume' ; + + $get_branch = $array_branch[$row_employment['employment_branch']] ; + + $content = " + + + + + + + + + + + + + + + + + + + +
Dear ".strtoupper($row_employment['employment_name']).",
Thank you for your application regarding the position of ".$array_position[$row_employment['No AAR for react-native-reanimated found. Attempting to build from source.']]." at ".$get_branch['branch_name'].".
We are impressed with your qualifications and would like to meet with you to have a round of discussion. You are advised to attend for the interview on ".date('Y-m-d H:i', strtotime($row_employment['employment_interview_date']))." at our office.
If you have any queries, please feel free to contact the office. We look forward to meet you soon at our office.
Please Note That:
1) This is an interview call for the job applied and does not guarantee employment with us.
2) No TA / DA will be provided to candidates appearing for the interview.
3) Bring this letter with you on the above-mentioned date and time of the interview.
4) Bring photocopies and originals of your academic & other credentials along with a recent snap.
Reschedule Interview Date (If you are inconvenience with the date provided):
".$link_reschedule."
*Please revert back to this email to confirm for your interview attendance.
" . $get_branch['branch_email_footer'] ; + + $mailer->from = $get_branch['branch_hr_email'] ; + $mailer->fromname = COMPANY ; + $mailer->to = [ $row_employment['employment_email'] ] ; + if ( count($get_branch['branch_hr_cc']) > 0 ){ + $mailer->cc = $get_branch['branch_hr_cc'] ; + } + $mailer->subject = $title ; + $mailer->body = $content ; + $mailer->send() ; + + + } +} + +?> \ No newline at end of file diff --git a/cron/push_holiday.php b/cron/push_holiday.php new file mode 100644 index 0000000..d403dcb --- /dev/null +++ b/cron/push_holiday.php @@ -0,0 +1,21 @@ +query( "SELECT * FROM setting_holiday + WHERE deleted_at IS NULL AND holiday_date = '".date('Y-m-d', time())."' LIMIT 1" ) ; +if ( $select->num_rows > 0 ){ + $row_select = $select->fetch_assoc() ; + + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL ") ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + pushToUserCron( 'holiday', $row_select['holiday_id'], $row_staff['staff_id'], 'Holiday', 'It is public holiday today ( '.$row_select['holiday_name'].' ), kindly enjoy.' ) ; + } + } + +} + +?> \ No newline at end of file diff --git a/cron/push_notification.php b/cron/push_notification.php new file mode 100644 index 0000000..ec5265a --- /dev/null +++ b/cron/push_notification.php @@ -0,0 +1,140 @@ +setAuthConfig($credentials); + $client->setScopes($scopes); + + // Get the token + $accessToken = $client->fetchAccessTokenWithAssertion()['access_token']; + + return $accessToken; +} + + +// single send +function sendFCMNotification($projectId, $deviceTokens, $messageTitle, $messageBody, $dataPayload, $credentialsPath) { + $accessToken = getAccessToken($credentialsPath); + $url = 'https://fcm.googleapis.com/v1/projects/' . $projectId . '/messages:send'; + + $client = new \GuzzleHttp\Client(); + + foreach ($deviceTokens as $deviceToken) { + $message = [ + 'message' => [ + 'token' => $deviceToken, + 'notification' => [ + 'title' => $messageTitle, + 'body' => $messageBody + ], + 'android' => [ + 'notification' => [ + 'sound' => 'default' // Use this for Android specific sound settings + ] + ], + 'apns' => [ + 'payload' => [ + 'aps' => [ + 'sound' => 'default' // Use this for iOS specific sound settings + ] + ] + ], + 'data' => $dataPayload // Custom data payload + ] + ]; + + $headers = [ + 'Authorization' => 'Bearer ' . $accessToken, + 'Content-Type' => 'application/json', + ]; + + print_r($message) ; + print_r($headers) ; + + try { + $response = $client->post($url, [ + 'headers' => $headers, + 'json' => $message + ]); + + echo 'Notification sent to ' . $deviceToken . ': ' . $response->getBody()->getContents() . PHP_EOL; + } catch (RequestException $e) { + if ($e->hasResponse()) { + echo 'Error sending to ' . $deviceToken . ': ' . $e->getResponse()->getBody()->getContents() . PHP_EOL; + } else { + echo 'Error: ' . $e->getMessage() . PHP_EOL; + } + } + } +} + +function pushToNotificationUser( $type, $type_id, $staff_id, $title, $message, $cron_id = '', $inbox_id = '' ){ + global $mysqli, $projectId, $credentialsPath ; + + $push = array() ; + + $notifications_query = $mysqli->query( "SELECT notificationid, notification, badge FROM staff_notification + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' ORDER BY notificationid DESC LIMIT 1") ; + + if ( $notifications_query->num_rows > 0 ){ + + $notification = $notifications_query->fetch_assoc() ; + $token_id = $notification['notificationid'] ; + $badge = ( $notification['badge'] + 1 ) ; + + $is_create = true ; + if ( $inbox_id != '' && $inbox_id > 0 ){ + $is_create = false ; + } + + if ( $is_create ){ + $mysqli->query( "INSERT INTO inbox ( staff_id, from_table, from_id, receiver_type, view_format, title, description, created_at ) VALUES ( '/".$staff_id."/', '".$type."', '".$type_id."', '3', 'message', '".$title."', '".$message."', '".TODAYDATE."' )" ) ; + + $inbox_id = $mysqli->insert_id ; + + $mysqli->query( "INSERT INTO staff_inbox_view ( inbox_id, staff_id, is_read ) VALUES ( '".$inbox_id."', '".$staff_id."', '0' )" ) ; + + $mysqli->query( "UPDATE staff_notification_cron SET inbox_id = '".$inbox_id."' WHERE cron_id = '".$cron_id."'" ) ; + } + + sendFCMNotification( $projectId, [ $notification['notification'] ], dataFilter( $title ), dataFilter( $message ), [ + 'go_messageid' => '', + 'go_page' => '', + 'go_param' => '' + ], $credentialsPath ) ; + + // update badge + $mysqli->query("UPDATE staff_notification SET badge = '".$badge."' WHERE notificationid = '".$token_id."'") ; + } + +} + + + + +$select = $mysqli->query( "SELECT * FROM staff_notification_cron + WHERE deleted_at IS NULL AND is_sent = 'no' LIMIT 50" ) ; +if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + pushToNotificationUser( $row['type'], $row['type_id'], $row['staff_id'], $row['title'], $row['message'], $row['cron_id'], $row['inbox_id'] ) ; + + $mysqli->query( "UPDATE staff_notification_cron SET is_sent = 'yes' WHERE cron_id = '".$row['cron_id']."'" ) ; + } +} + +?> \ No newline at end of file diff --git a/cron/push_passport_permit_leave_advance.php b/cron/push_passport_permit_leave_advance.php new file mode 100644 index 0000000..d21a598 --- /dev/null +++ b/cron/push_passport_permit_leave_advance.php @@ -0,0 +1,182 @@ + [ + 'title' => 'Passport', + 'no' => 'staff_passportno', + 'date' => 'staff_passportexpired' + ], + 'permit' => [ + 'title' => 'Permit', + 'no' => 'staff_permitno', + 'date' => 'staff_permit_end' + ] +] ; + +// password expired +// permit expired +foreach ( $check as $k => $v ){ + + // previous date + $staff_q = $mysqli->query("SELECT staff_name, staff_idno, ".$v['no'].", ".$v['date']." FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL AND ".$v['no']." != '' AND ".$v['date']." != '0000-00-00' AND ".$v['date']." IS NOT NULL AND ".$v['date']." <= '".$after_14."'") ; + if ( $staff_q->num_rows > 0 ){ + + $html = '' ; + $count = 0 ; + + while ( $row = $staff_q->fetch_assoc() ){ + + $staff_idno = ucwords( dataFilter($row['staff_idno']) ) ; + + $count++ ; + $html .= ' + + '.$count.' + '.$staff_idno.' + '.dataFilter($row['staff_name']).' + '.dataFilter($row[$v['no']]).' + '.dataFilter($row[$v['date']]).' + ' ; + + } + + $html = ' + + + + + + + + + + + + '.$html.' + +
No.ID No.Staff'.$v['title'].' No.Expired Date
' ; + + $title = $v['title'] . ' Expired Warning' ; + foreach ( $EMAILCRON as $vv ){ + sendEmail( $vv, EMAILNOREPLY, $title, $html ) ; + } + + } + +} + +// leave apply waiting approve +$leave_q = $mysqli->query("SELECT a.leave_type, a.leave_from, a.leave_to, a.leave_day, a.leave_reason, b.staff_name, b.staff_idno FROM staff_leave a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE + a.leave_status = 'pending' AND a.deleted_at IS NULL AND + ( b.staff_date_resigned IS NULL || b.staff_date_resigned = '0000-00-00' || b.staff_date_resigned >= '".TODAYDATE."' ) AND b.deleted_at IS NULL + ORDER BY a.leave_from") ; +if ( $leave_q->num_rows > 0 ){ + + $html = '' ; + $count = 0 ; + + while ( $row = $leave_q->fetch_assoc() ){ + + $staff_idno = ucwords( dataFilter($row['staff_idno']) ) ; + + $count++ ; + $html .= ' + + '.$count.' + '.$staff_idno.' + '.dataFilter($row['staff_name']).' + '.ucwords($row['leave_type']).' + '.$row['leave_from'].' ~ '.$row['leave_to'].' ( '.$row['leave_day'].' days ) + '.dataFilter($row['leave_reason']).' + ' ; + + } + + $html = ' + + + + + + + + + + + + + '.$html.' + +
No.ID No.StaffTypeFrom ~ To ( Days )Reason
' ; + + $title = 'Leave Waiting Approve' ; + foreach ( $EMAILCRON as $vv ){ + sendEmail( $vv, EMAILNOREPLY, $title, $html ) ; + } + +} + +// advance apply waiting approve +$advance_q = $mysqli->query("SELECT a.advance_amount, a.advance_reason, b.staff_name, b.staff_idno FROM staff_advance a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE + a.advance_status = 'pending' AND a.deleted_at IS NULL AND + ( b.staff_date_resigned IS NULL || b.staff_date_resigned = '0000-00-00' || b.staff_date_resigned >= '".TODAYDATE."' ) AND b.deleted_at IS NULL + ORDER BY a.created_at") ; +if ( $advance_q->num_rows > 0 ){ + + $html = '' ; + $count = 0 ; + + while ( $row = $advance_q->fetch_assoc() ){ + + $staff_idno = ucwords( dataFilter($row['staff_idno']) ) ; + + $count++ ; + $html .= ' + + '.$count.' + '.$staff_idno.' + '.dataFilter($row['staff_name']).' + '.ucwords($row['advance_amount']).' + '.dataFilter($row['advance_reason']).' + ' ; + + } + + $html = ' + + + + + + + + + + + + '.$html.' + +
No.ID No.StaffAmountReason
' ; + + $title = 'Advance Waiting Approve' ; + foreach ( $EMAILCRON as $vv ){ + sendEmail( $vv, EMAILNOREPLY, $title, $html ) ; + } + +} + +?> \ No newline at end of file diff --git a/cron/push_staff_resignation.php b/cron/push_staff_resignation.php new file mode 100644 index 0000000..2b6918d --- /dev/null +++ b/cron/push_staff_resignation.php @@ -0,0 +1,105 @@ +query( "SELECT branch_id, branch_name FROM branch + WHERE deleted_at IS NULL " ) ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + + + + +$month_3_ago = date( "Y-m", strtotime( '-2 months' ) ) ; +$month_2_ago = date( "Y-m", strtotime( '-1 months' ) ) ; +$month_1_current = date( "Y-m", time() ) ; + +$mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno, staff_date_resigned, branch_id FROM staff + WHERE deleted_at IS NULL AND staff_idno IS NOT NULL AND ( staff_date_resigned LIKE '%".$month_3_ago."%' OR staff_date_resigned LIKE '%".$month_2_ago."%' OR staff_date_resigned LIKE '%".$month_1_current."%' ) + ORDER BY staff_date_resigned ASC") ; + +$staff_list = [] ; +if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + + $reset_month = date( 'Y-m', strtotime( $row_staff['staff_date_resigned'] ) ) ; + $staff_list[$row_staff['branch_id']][$reset_month][] = $row_staff ; + + } +} + +$html = '' ; +if ( count($staff_list) ){ + + foreach ( $staff_list as $kbranch => $vbranch ){ + + $html .= ' +
'.$branch_all[$kbranch].'
' ; + + foreach ( $vbranch as $kdate => $vdate ){ + + $count = 0 ; + $content = '' ; + + + $html .= ' +
'.date( 'M Y', strtotime( $kdate.'-01' ) ).'
' ; + + foreach ( $vdate as $kstaff => $vstaff ){ + + $count++ ; + $staff_idno = ucwords( dataFilter($vstaff['staff_idno']) ) ; + + $content .= ' + + '.$count.' + '.dataFilter($vstaff['staff_idno']).' + '.dataFilter($vstaff['staff_name']).' + '.dataFilter($vstaff['staff_date_resigned']).' + ' ; + + } + + $html .= ' + + + + + + + + + + + '.$content.' + +
No.ID No.Staff NameResigned Date
' ; + + } + + $html .= ' +
+
+
' ; + + } + + + $title = 'Staff Resignation Within 3 Month' ; + foreach ( $EMAILCRON as $vv ){ + sendEmail( $vv, EMAILNOREPLY, $title, $html ) ; + } +} + +?> \ No newline at end of file diff --git a/cron/push_task_notification.php b/cron/push_task_notification.php new file mode 100644 index 0000000..d107742 --- /dev/null +++ b/cron/push_task_notification.php @@ -0,0 +1,72 @@ +query( "SELECT task_id, task_so, task_type, created_by, assigned_by, date_start FROM task + WHERE deleted_at IS NULL AND status IN ( 'pending', 'assigned', 'resubmit', 'progress' )" ) ; +if ( $select->num_rows > 0 ){ + + while ( $row = $select->fetch_assoc() ){ + + // '1time','daily','weekly','monthly','yearly' + + $task_so = $row['task_so'] ; + $title = 'Task Reminder' ; + $message = 'Friendly reminder task ( '.$task_so.' ) haven\'t completed yet' ; + + $date_start = strtotime( $row['date_start'] ) ; + + $boolean = false ; + switch ( $row['task_type'] ){ + case '1time' : + case 'daily' : + $boolean = true ; + break ; + case 'weekly' : + if ( date( 'w', $date_start ) == date( 'w', time() ) ){ + $boolean = true ; + } + break ; + case 'monthly' : + + if ( date( 'd', $date_start ) >= date( 't', time() ){ + $boolean = true ; + }else{ + if ( date( 'd', $date_start ) == date( 'd', time() ) ){ + $boolean = true ; + } + } + + break ; + case 'yearly' : + if ( date( 'm-01', $date_start ) == date( 'm-d', time() ) ){ + $boolean = true ; + } + break ; + } + + if ( $boolean ){ + $staffs = [] ; + $staffs[] = $row['created_by'] ; + $staffs[] = $row['assigned_by'] ; + + $select_join = $mysqli->query( "SELECT staff_id FROM task_joinstaff WHERE task_id = '".$row['task_id']."'" ) ; + if ( $select_join->num_rows > 0 ){ + while ( $row_join = $select_join->fetch_assoc() ){ + $staffs[] = $row_join['staff_id'] ; + } + } + + foreach ( $staffs as $k => $staff ){ + pushToUserCron( 'task', $row['task_id'], $staff, $title, $message ) ; + } + } + + } + +} + + + +?> \ No newline at end of file diff --git a/cron/rms_pay_bill.php b/cron/rms_pay_bill.php new file mode 100644 index 0000000..034265a --- /dev/null +++ b/cron/rms_pay_bill.php @@ -0,0 +1,77 @@ +query( "SELECT order_id, staff_id, biller_code, rms_authorizationtoken, created_at FROM staff_rms_bill_order + WHERE deleted_at IS NULL AND status IN ( 'pending', 'progress' ) AND ( ( created_at BETWEEN '".$from_date."' AND '".$to_date."' ) OR created_at LIKE '%".$hours1."%' OR created_at LIKE '%".$hours2."%' OR created_at LIKE '%".$hours3."%' OR created_at LIKE '%".$hours4."%' )" ) ; +if ( $select_order->num_rows > 0 ){ + while ( $row_order = $select_order->fetch_assoc() ){ + + $rms_content = [ + 'authorizationToken' => $row_order['rms_authorizationtoken'], + 'cashierId' => RMSLOCATION, + 'transactionDateTime' => date( 'Y-m-d\TH:i:s', strtotime( $row_order['created_at'] ) ), + 'businessDate' => date( 'Y-m-d', strtotime( $row_order['created_at'] ) ) + ] ; + $rms_call = rmsCall( 'bill/confirm', $rms_content ) ; + saveLog( 'rms-api', 'Confirm Bill Order *Per Minutes*', $rms_content, $rms_call ) ; + + if ( $rms_call['respCode'] == '00' ){ + + if ( $mysqli->query( "UPDATE staff_rms_bill_order SET + rms_order_id = '".$rms_call['orderId']."', + rms_receiptno = '".$rms_call['billerReceiptNo']."', + status = 'confirmed' + WHERE order_id = '".$row_order['order_id']."'" ) ){ + $status = '200' ; + } + + }else{ + + if ( $mysqli->query( "UPDATE staff_rms_bill_order SET + status = 'progress' + WHERE order_id = '".$row_order['order_id']."'" ) ){ + $status = '202' ; + } + + } + + } +} + + + +// after transaction over 4 hours, auto cancel order and refund the wallet +$hours1 = date( 'Y-m-d H:i', strtotime( "-300 minutes" ) ) ; +$select_order = $mysqli->query( "SELECT order_id, staff_id, sonumber, reference1, amount FROM staff_rms_bill_order + WHERE deleted_at IS NULL AND status IN ( 'pending', 'progress' ) AND ( created_at LIKE '%".$hours1."%' )" ) ; +if ( $select_order->num_rows > 0 ){ + while ( $row_order = $select_order->fetch_assoc() ){ + + saveLog( 'rms-api', 'Auto Cancel Bill', [], $row_order ) ; + + if ( $mysqli->query( "UPDATE staff_rms_bill_order SET + status = 'cancelled' + WHERE order_id = '".$row_order['order_id']."'" ) ){ + + // refund the wallet + $remark = 'You have been refunded the wallet from bill order '.$row_order['reference1'].' (' . $row_order['sonumber'] . ')' ; + walletMovement( 'staff_rms_bill_order', $row_order['order_id'], 'plus', 'normal', $row_order['staff_id'], $row_order['amount'], $remark ) ; + + } + + } +} + +?> \ No newline at end of file diff --git a/cron/rms_prepaid_check_status.php b/cron/rms_prepaid_check_status.php new file mode 100644 index 0000000..c6089ba --- /dev/null +++ b/cron/rms_prepaid_check_status.php @@ -0,0 +1,64 @@ +query( "SELECT order_id, staff_id, sonumber, created_at FROM staff_rms_prepaid_order + WHERE deleted_at IS NULL AND status IN ( 'pending', 'progress' ) AND ( ( created_at BETWEEN '".$from_date."' AND '".$to_date."' ) OR created_at LIKE '%".$hours1."%' )" ) ; +if ( $select_order->num_rows > 0 ){ + while ( $row_order = $select_order->fetch_assoc() ){ + + $rms_content = [ + 'topUpReferenceId' => $row_order['sonumber'] + ] ; + $rms_call = rmsCall( 'pinless/checktransactionstatus', $rms_content ) ; + saveLog( 'rms-api', 'Check Prepaid Status', $rms_content, $rms_call ) ; + + if ( $rms_call['respCode'] == '00' ){ + if ( $mysqli->query( "UPDATE staff_rms_prepaid_order SET + rms_order_id = '".$rms_call['orderId']."', + status = 'confirmed' + WHERE order_id = '".$row_order['order_id']."'" ) ){ + $status = '200' ; + } + }else{ + if ( $mysqli->query( "UPDATE staff_rms_prepaid_order SET + status = 'progress' + WHERE order_id = '".$row_order['order_id']."'" ) ){ + $status = '202' ; + } + } + } +} + + +// after transaction over 24 hours, auto cancel order and refund the wallet +$hours1 = date( 'Y-m-d H:i', strtotime( "-25 hours" ) ) ; +$select_order = $mysqli->query( "SELECT order_id, staff_id, sonumber, dialcode, mobile, amount FROM staff_rms_prepaid_order + WHERE deleted_at IS NULL AND status IN ( 'pending', 'progress' ) AND ( created_at LIKE '%".$hours1."%' )" ) ; +if ( $select_order->num_rows > 0 ){ + while ( $row_order = $select_order->fetch_assoc() ){ + + saveLog( 'rms-api', 'Auto Cancel Prepaid', [], $row_order ) ; + + if ( $mysqli->query( "UPDATE staff_rms_prepaid_order SET + status = 'cancelled' + WHERE order_id = '".$row_order['order_id']."'" ) ){ + + // refund the wallet + $remark = 'You have been refunded the wallet from prepaid order '.$row_order['dialcode'].'-'.$row_order['mobile'].' (' . $row_order['sonumber'] . ')' ; + walletMovement( 'staff_rms_prepaid_order', $row_order['order_id'], 'plus', 'normal', $row_order['staff_id'], $row_order['amount'], $remark ) ; + + } + + } +} + +?> \ No newline at end of file diff --git a/css/bootstrap.css b/css/bootstrap.css new file mode 100644 index 0000000..cc894ac --- /dev/null +++ b/css/bootstrap.css @@ -0,0 +1,230 @@ +/* another chosen scripts -> select2 */ +.is-invalid .select2-container--default .select2-selection--single { border-color: red; } +.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;width:100%!important}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:26px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:2px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:#fff;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:2px 6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:0 4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2-container--default .select2-selection--single{position:relative;overflow:hidden;height:25px;text-decoration:none;white-space:nowrap;display:block;width:100%;padding:2px 6px;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.select2-container--default .select2-selection--single .select2-selection__rendered{line-height:19px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:20px;position:absolute;top:1px;right:1px;width:17px}.select2-container--default .select2-selection--single .select2-selection__arrow b{display:block;width:100%;height:100%;background:url(../images/chosen-sprite.png) 3px 0 no-repeat}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{background-position:-16px 2px}.select2-container--default .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;cursor:text; cursor: text;display: block;width: 100%;padding: 2px 3px;color: #555;background-color: #fff;background-image: none;border: 1px solid #ccc;-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);box-shadow: inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{font-size: 12px;background-color: #e4e4e4;border: 1px solid #aaa;border-radius: 0px;cursor: default;float: left;margin-right: 5px;margin-top: 1px;margin-bottom: 1px;padding: 0 5px;position: relative;max-width: 100%;background-color: rgb(238, 238, 238);background-image: linear-gradient(rgb(244, 244, 244) 20%, rgb(240, 240, 240) 50%, rgb(232, 232, 232) 52%, rgb(238, 238, 238) 100%);background-size: 100% 19px;background-clip: padding-box;box-shadow: rgb(255, 255, 255) 0px 0px 2px inset, rgba(0, 0, 0, 0.0470588) 0px 1px 0px;color: rgb(51, 51, 51);line-height: 13px;cursor: default;margin: 2px 5px 2px 0px;padding: 3px 20px 3px 5px;border-width: 1px;border-style: solid;border-color: rgb(170, 170, 170);border-image: initial;border-radius: 3px;background-repeat: repeat-x;}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:700;margin:0;position:absolute;right:2px;margin-top: 0;font-size: 18px;}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-search--inline,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__placeholder{float:right}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--above .select2-selection--single{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--below .select2-selection--single{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:0 0;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto;font-size:12px}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#3249ad;color:#fff}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top,#fff 50%,#eee 100%);background-image:-o-linear-gradient(top,#fff 50%,#eee 100%);background-image:linear-gradient(to bottom,#fff 50%,#eee 100%);background-repeat:repeat-x;filter:progid: DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top,#eee 50%,#ccc 100%);background-image:-o-linear-gradient(top,#eee 50%,#ccc 100%);background-image:linear-gradient(to bottom,#eee 50%,#ccc 100%);background-repeat:repeat-x;filter:progid: DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:4px 0 0 4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:0 0;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top,#fff 0,#eee 50%);background-image:-o-linear-gradient(top,#fff 0,#eee 50%);background-image:linear-gradient(to bottom,#fff 0,#eee 50%);background-repeat:repeat-x;filter:progid: DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top,#eee 50%,#fff 100%);background-image:-o-linear-gradient(top,#eee 50%,#fff 100%);background-image:linear-gradient(to bottom,#eee 50%,#fff 100%);background-repeat:repeat-x;filter:progid: DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} +/*! + * Datepicker for Bootstrap + * + * Copyright 2012 Stefan Petre + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + */.pad,.xdsoft_noselect{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none}.autocomplete_li:after,.clearfix:after,.item_box:after,.row_custom:after,.xdsoft_datetimepicker .xdsoft_calendar{clear:both}.forecast_box,.xdsoft_noselect{-webkit-touch-callout:none;-khtml-user-select:none}.datepicker:after,.datepicker:before{content:'';display:inline-block;position:absolute}.datepicker td span.active,.datepicker td.active,.datepicker td.active:hover{filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker{top:0;left:0;padding:4px;margin-top:1px}.datepicker:before{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);top:-7px;left:6px}.datepicker:after{border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;top:-6px;left:7px}.datepicker>div{display:none}.datepicker table{width:100%;margin:0}.datepicker td,.datepicker th{text-align:center;width:20px;height:20px}.datepicker td.day:hover{background:#eee;cursor:pointer}.datepicker td.day.disabled{color:#eee}.datepicker td.new,.datepicker td.old{color:#999}.datepicker td.active,.datepicker td.active:hover{background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);color:#fff}.datepicker td.active.active,.datepicker td.active.disabled,.datepicker td.active:active,.datepicker td.active:focus,.datepicker td.active:hover,.datepicker td.active:hover.active,.datepicker td.active:hover.disabled,.datepicker td.active:hover:active,.datepicker td.active:hover:focus,.datepicker td.active:hover:hover,.datepicker td.active:hover[disabled],.datepicker td.active[disabled]{color:#fff;background-color:#04c}.datepicker td.active.active,.datepicker td.active:active,.datepicker td.active:hover.active,.datepicker td.active:hover:active{background-color:#039\9}.datepicker td span{display:block;width:47px;height:54px;line-height:54px;float:left;margin:2px;cursor:pointer}.datepicker td span:hover{background:#eee}.datepicker td span.active{background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);color:#fff}.datepicker td span.active.active,.datepicker td span.active.disabled,.datepicker td span.active:active,.datepicker td span.active:focus,.datepicker td span.active:hover,.datepicker td span.active[disabled]{color:#fff;background-color:#04c}.datepicker td span.active.active,.datepicker td span.active:active{background-color:#039\9}.datepicker td span.old{color:#999}.datepicker th.switch{width:145px}.datepicker th.next,.datepicker th.prev{font-size:21px}.datepicker thead tr:first-child th{cursor:pointer}.datepicker thead tr:first-child th:hover{background:#eee}.input-append.date .add-on i,.input-prepend.date .add-on i{display:block;cursor:pointer;width:16px;height:16px}.xdsoft_datetimepicker{box-shadow:0 5px 15px -5px rgba(0,0,0,.506);background:#fff;border-bottom:1px solid #bbb;border-left:1px solid #ccc;border-right:1px solid #ccc;border-top:1px solid #ccc;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;padding:2px 8px 8px 0;position:absolute;z-index:9999;-moz-box-sizing:border-box;box-sizing:border-box;display:none}.xdsoft_datetimepicker.xdsoft_rtl{padding:8px 0 8px 8px}.xdsoft_datetimepicker iframe{position:absolute;left:0;top:0;width:75px;height:210px;background:0 0;border:none}.xdsoft_datetimepicker button{border:none!important}.xdsoft_noselect{user-select:none}.xdsoft_noselect::selection{background:0 0}.xdsoft_noselect::-moz-selection{background:0 0}.xdsoft_datetimepicker.xdsoft_inline{display:inline-block;position:static;box-shadow:none}.xdsoft_datetimepicker *{-moz-box-sizing:border-box;box-sizing:border-box;padding:0;margin:0}.xdsoft_datetimepicker .xdsoft_datepicker,.xdsoft_datetimepicker .xdsoft_timepicker{display:none}.xdsoft_datetimepicker .xdsoft_datepicker.active,.xdsoft_datetimepicker .xdsoft_timepicker.active{display:block}.xdsoft_datetimepicker .xdsoft_datepicker{width:224px;float:left;margin-left:8px}.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_datepicker{float:right;margin-right:8px;margin-left:0}.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_datepicker{width:256px}.xdsoft_datetimepicker .xdsoft_timepicker{width:58px;float:left;text-align:center;margin-left:8px;margin-top:0}.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker{float:right;margin-right:8px;margin-left:0}.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker{margin-top:8px;margin-bottom:3px}.xdsoft_datetimepicker .xdsoft_mounthpicker{position:relative;text-align:center}.xdsoft_datetimepicker .xdsoft_label i,.xdsoft_datetimepicker .xdsoft_next,.xdsoft_datetimepicker .xdsoft_prev,.xdsoft_datetimepicker .xdsoft_today_button{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC)}.xdsoft_datetimepicker .xdsoft_label i{opacity:.5;background-position:-92px -19px;display:inline-block;width:9px;height:20px;vertical-align:middle}.xdsoft_datetimepicker .xdsoft_prev{float:left;background-position:-20px 0}.xdsoft_datetimepicker .xdsoft_today_button{float:left;background-position:-70px 0;margin-left:5px}.xdsoft_datetimepicker .xdsoft_next{float:right;background-position:0 0}.xdsoft_datetimepicker .xdsoft_next,.xdsoft_datetimepicker .xdsoft_prev,.xdsoft_datetimepicker .xdsoft_today_button{background-color:transparent;background-repeat:no-repeat;border:0;cursor:pointer;display:block;height:30px;opacity:.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";outline:0;overflow:hidden;padding:0;position:relative;text-indent:100%;white-space:nowrap;width:20px;min-width:0}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev{float:none;background-position:-40px -15px;height:15px;width:30px;display:block;margin-left:14px;margin-top:7px}.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_next,.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_prev{float:none;margin-left:0;margin-right:14px}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev{background-position:-40px 0;margin-bottom:7px;margin-top:0}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box{height:151px;overflow:hidden;border-bottom:1px solid #ddd}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div{background:#f5f5f5;border-top:1px solid #ddd;color:#666;font-size:12px;text-align:center;border-collapse:collapse;cursor:pointer;border-bottom-width:0;height:25px;line-height:25px}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div:first-child{border-top-width:0}.xdsoft_datetimepicker .xdsoft_next:hover,.xdsoft_datetimepicker .xdsoft_prev:hover,.xdsoft_datetimepicker .xdsoft_today_button:hover{opacity:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"}.xdsoft_datetimepicker .xdsoft_label{display:inline;position:relative;z-index:9999;margin:0;padding:5px 3px;font-size:14px;line-height:20px;font-weight:700;background-color:#fff;float:left;width:182px;text-align:center;cursor:pointer}.fa.fa-pull-left,.fa.pull-left{margin-right:.3em}.xdsoft_datetimepicker .xdsoft_label:hover>span{text-decoration:underline}.xdsoft_datetimepicker .xdsoft_label:hover i{opacity:1}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select{border:1px solid #ccc;position:absolute;right:0;top:30px;z-index:101;display:none;background:#fff;max-height:160px;overflow-y:hidden}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select.xdsoft_monthselect{right:-7px}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select.xdsoft_yearselect{right:2px}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option:hover{color:#fff;background:#ff8000}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option{padding:2px 10px 2px 5px;text-decoration:none!important}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option.xdsoft_current{background:#3af;box-shadow:#178fe5 0 1px 3px 0 inset;color:#fff;font-weight:700}.xdsoft_datetimepicker .xdsoft_month{width:100px;text-align:right}.xdsoft_datetimepicker .xdsoft_year{width:48px;margin-left:5px}.xdsoft_datetimepicker .xdsoft_calendar table{border-collapse:collapse;width:100%}.xdsoft_datetimepicker .xdsoft_calendar td>div{padding-right:5px}.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th{width:14.2857142%;background:#f5f5f5;border:1px solid #ddd;color:#666;font-size:12px;text-align:right;vertical-align:middle;padding:0;border-collapse:collapse;cursor:pointer;height:25px}.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar th{width:12.5%}.xdsoft_datetimepicker .xdsoft_calendar th{background:#f1f1f1}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today{color:#3af}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_default{background:#ffe9d2;box-shadow:#ffb871 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_mint{background:#c1ffc9;box-shadow:#00dd1c 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current{background:#3af;box-shadow:#178fe5 0 1px 3px 0 inset;color:#fff;font-weight:700}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled,.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month,.xdsoft_datetimepicker .xdsoft_time_box>div>div.xdsoft_disabled{opacity:.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";cursor:default}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled{opacity:.2;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)"}.xdsoft_datetimepicker .xdsoft_calendar td:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div:hover{color:#fff!important;background:#ff8000!important;box-shadow:none!important}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current.xdsoft_disabled:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current.xdsoft_disabled:hover{background:#3af!important;box-shadow:#178fe5 0 1px 3px 0 inset!important;color:#fff!important}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_disabled:hover{color:inherit !important;background:inherit!important;box-shadow:inherit!important}.xdsoft_datetimepicker .xdsoft_calendar th{font-weight:700;text-align:center;color:#999;cursor:default}.xdsoft_datetimepicker .xdsoft_copyright{color:#ccc!important;font-size:10px;clear:both;float:none;margin-left:8px}.xdsoft_datetimepicker .xdsoft_copyright a{color:#eee!important}.xdsoft_datetimepicker .xdsoft_copyright a:hover{color:#aaa!important}.xdsoft_time_box{position:relative;border:1px solid #ccc}.xdsoft_scrollbar>.xdsoft_scroller{background:#ccc!important;height:20px;border-radius:3px}.xdsoft_scrollbar{position:absolute;width:7px;right:0;top:0;bottom:0;cursor:pointer}.fa-ul>li,.xdsoft_scroller_box{position:relative}.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_scrollbar{left:0;right:auto}.xdsoft_datetimepicker.xdsoft_dark{box-shadow:0 5px 15px -5px rgba(255,255,255,.506);background:#000;border-bottom:1px solid #444;border-left:1px solid #333;border-right:1px solid #333;border-top:1px solid #333;color:#ccc}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box{border-bottom:1px solid #222}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box>div>div{background:#0a0a0a;border-top:1px solid #222;color:#999}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label{background-color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label>.xdsoft_select{border:1px solid #333;background:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label>.xdsoft_select>div>.xdsoft_option:hover{color:#000;background:#007fff}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label>.xdsoft_select>div>.xdsoft_option.xdsoft_current{background:#c50;box-shadow:#b03e00 0 1px 3px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label i,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_next,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_prev,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_today_button{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUExQUUzOTA0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUExQUUzOTE0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQTFBRTM4RTQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQTFBRTM4RjQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp0VxGEAAAIASURBVHja7JrNSgMxEMebtgh+3MSLr1T1Xn2CHoSKB08+QmR8Bx9A8e7RixdB9CKCoNdexIugxFlJa7rNZneTbLIpM/CnNLsdMvNjM8l0mRCiQ9Ye61IKCAgZAUnH+mU3MMZaHYChBnJUDzWOFZdVfc5+ZFLbrWDeXPwbxIqrLLfaeS0hEBVGIRQCEiZoHQwtlGSByCCdYBl8g8egTTAWoKQMRBRBcZxYlhzhKegqMOageErsCHVkk3hXIFooDgHB1KkHIHVgzKB4ADJQ/A1jAFmAYhkQqA5TOBtocrKrgXwQA8gcFIuAIO8sQSA7hidvPwaQGZSaAYHOUWJABhWWw2EMIH9QagQERU4SArJXo0ZZL18uvaxejXt/Em8xjVBXmvFr1KVm/AJ10tRe2XnraNqaJvKE3KHuUbfK1E+VHB0q40/y3sdQSxY4FHWeKJCunP8UyDdqJZenT3ntVV5jIYCAh20vT7ioP8tpf6E2lfEMwERe+whV1MHjwZB7PBiCxcGQWwKZKD62lfGNnP/1poFAA60T7rF1UgcKd2id3KDeUS+oLWV8DfWAepOfq00CgQabi9zjcgJVYVD7PVzQUAUGAQkbNJTBICDhgwYTjDYD6XeW08ZKh+A4pYkzenOxXUbvZcWz7E8ykRMnIHGX1XPl+1m2vPYpL+2qdb8CDAARlKFEz/ZVkAAAAABJRU5ErkJggg==)}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{background:#0a0a0a;border:1px solid #222;color:#999}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{background:#0e0e0e}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_today{color:#c50}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_default{background:#ffe9d2;box-shadow:#ffb871 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_mint{background:#c1ffc9;box-shadow:#00dd1c 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_current,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_default,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current{background:#c50;box-shadow:#b03e00 0 1px 3px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td:hover,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box>div>div:hover{color:#000!important;background:#007fff!important}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{color:#666}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright{color:#333!important}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a{color:#111!important}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a:hover{color:#555!important}.xdsoft_dark .xdsoft_time_box{border:1px solid #333}.xdsoft_dark .xdsoft_scrollbar>.xdsoft_scroller{background:#333!important}.xdsoft_datetimepicker .xdsoft_save_selected{display:block;border:1px solid #ddd!important;margin-top:5px;width:100%;color:#454551;font-size:13px}.SumoSelect,.fa,.fa-stack{display:inline-block}.xdsoft_datetimepicker .blue-gradient-button{font-family:museo-sans,"Book Antiqua",sans-serif;font-size:12px;font-weight:300;color:#82878c;height:28px;position:relative;padding:4px 17px 4px 33px;border:1px solid #d7d8da;background:-moz-linear-gradient(top,#fff 0,#f4f8fa 73%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(73%,#f4f8fa));background:-webkit-linear-gradient(top,#fff 0,#f4f8fa 73%);background:-o-linear-gradient(top,#fff 0,#f4f8fa 73%);background:-ms-linear-gradient(top,#fff 0,#f4f8fa 73%);background:linear-gradient(to bottom,#fff 0,#f4f8fa 73%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#fff', endColorstr='#f4f8fa', GradientType=0 )}.xdsoft_datetimepicker .blue-gradient-button:focus,.xdsoft_datetimepicker .blue-gradient-button:focus span,.xdsoft_datetimepicker .blue-gradient-button:hover,.xdsoft_datetimepicker .blue-gradient-button:hover span{color:#454551;background:-moz-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#f4f8fa),color-stop(73%,#FFF));background:-webkit-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:-o-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:-ms-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:linear-gradient(to bottom,#f4f8fa 0,#FFF 73%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f8fa', endColorstr='#FFF', GradientType=0 )} + + /*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} + +.SlectBox{width:200px;padding:5px 8px}.width_60{width:60px}.width_80{width:80px}.width_100{width:100px}.cart_product_remark,.cart_select_type_box{margin-bottom:10px}.cart_select_type_box .form-control{max-width:350px;float:right}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.header_company_box,.row_half{float:left}#save_remark{margin-bottom:8px}.SelectClass{position:absolute;top:0;left:0;right:0;height:100%;width:100%;border:none;z-index:1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0}.SumoSelect>.CaptionCont,.SumoSelect>.optWrapper>.options>li label{user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none}.SumoSelect{width:100%;position:relative;outline:0}.SumoSelect:focus>.CaptionCont,.SumoSelect:hover>.CaptionCont{box-shadow:0 0 2px #7799D0;border-color:#7799D0}.SumoSelect>.CaptionCont{position:relative;border:1px solid #A4A4A4;min-height:14px;background-color:#fff;border-radius:2px;margin:0;width:100%}.SumoSelect>.CaptionCont>span{display:block;padding-right:30px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;cursor:default}.SumoSelect>.CaptionCont>span.placeholder{color:#ccc;font-style:italic}.SumoSelect>.CaptionCont>label{position:absolute;top:0;right:0;bottom:0;width:30px}.SumoSelect>.CaptionCont>label>i{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMdBhAJ/fwnjwAAAGFJREFUKM9jYBh+gBFKuzEwMKQwMDB8xaOWlYGB4T4DA0MrsuapDAwM//HgNwwMDDbYTJuGQ8MHBgYGJ1xOYGNgYJiBpuEpAwODHSF/siDZ+ISBgcGClEDqZ2Bg8B6CkQsAPRga0cpRtDEAAAAASUVORK5CYII=);background-position:center center;width:16px;height:16px;display:block;position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;background-repeat:no-repeat;opacity:.8}.SumoSelect>.optWrapper{top:30px;width:100%;position:absolute;left:0;opacity:0;visibility:hidden;transition:opacity .2s ease-out,top .2s ease-out,visibility .2s ease-out;-webkit-transition:opacity .2s ease-out,top .2s ease-out,visibility .2s ease-out;-moz-transition:opacity .2s ease-out,top .2s ease-out,visibility .2s ease-out;-ms-transition:opacity .2s ease-out,top .2s ease-out,visibility .2s ease-out;-o-transition:opacity .2s ease-out,top .2s ease-out,visibility .2s ease-out;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;z-index:-100;background:#fff;border:1px solid #ddd;box-shadow:2px 3px 3px rgba(0,0,0,.11);border-radius:3px;overflow:hidden}.SumoSelect>.optWrapper.open{top:35px;visibility:visible;opacity:1;z-index:1000}.SumoSelect>.optWrapper>.options{list-style:none;display:block;padding:0;margin:0;overflow:auto;border-radius:2px;max-height:250px}.sr-only,svg:not(:root){overflow:hidden}.SumoSelect>.optWrapper.isFloating>.options{max-height:100%;box-shadow:0 0 100px #595959}.SumoSelect>.optWrapper>.options>li{padding:6px;border-bottom:1px solid #F3F3F3;position:relative}.SumoSelect>.optWrapper>.options>li:first-child{border-radius:2px 2px 0 0}.SumoSelect>.optWrapper>.options>li:last-child{border-bottom:none;border-radius:0 0 2px 2px}.SumoSelect>.optWrapper>.options>li:hover{background-color:#E4E4E4}.SumoSelect>.optWrapper>.options>li.sel{background-color:#a1c0e4}.SumoSelect>.optWrapper>.options>li label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;cursor:pointer}.messages,textarea{overflow:auto}.SumoSelect>.optWrapper>.options>li span{display:none}.SumoSelect>.optWrapper.isFloating{position:fixed;top:0;left:0;right:0;width:90%;bottom:0;margin:auto;max-height:90%}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.pre-scrollable{max-height:340px}.SumoSelect>.optWrapper>.options>li.disabled{background-color:inherit;pointer-events:none}.SumoSelect>.optWrapper>.options>li.disabled *{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";filter:alpha(opacity=50);-moz-opacity:.5;-khtml-opacity:.5;opacity:.5}.SumoSelect>.optWrapper.multiple>.options>li{padding-left:35px;cursor:pointer}.SumoSelect .select-all>span,.SumoSelect>.optWrapper.multiple>.options>li span{position:absolute;display:block;width:30px;top:0;bottom:0;margin-left:-35px}.SumoSelect .select-all>span i,.SumoSelect>.optWrapper.multiple>.options>li span i{position:absolute;margin:auto;left:0;right:0;top:0;bottom:0;width:14px;height:14px;border:1px solid #AEAEAE;border-radius:2px;box-shadow:inset 0 1px 3px rgba(0,0,0,.15);background-color:#fff}.SumoSelect>.optWrapper>.MultiControls{display:none;border-top:1px solid #ddd;background-color:#fff;box-shadow:0 0 2px rgba(0,0,0,.13);border-radius:0 0 3px 3px}.SumoSelect>.optWrapper.multiple.isFloating>.MultiControls{display:block;margin-top:5px;position:absolute;bottom:0;width:100%}.mix_group,.pad,sub,sup{position:relative}.SumoSelect>.optWrapper.multiple.okCancelInMulti>.MultiControls{display:block}.SumoSelect>.optWrapper.multiple.okCancelInMulti>.MultiControls>p{padding:6px}.SumoSelect>.optWrapper.multiple>.MultiControls>p{display:inline-block;cursor:pointer;padding:12px;width:50%;box-sizing:border-box;text-align:center}.SumoSelect>.optWrapper.multiple>.MultiControls>p:hover{background-color:#f1f1f1}.SumoSelect>.optWrapper.multiple>.MultiControls>p.btnOk{border-right:1px solid #DBDBDB;border-radius:0 0 0 3px}.SumoSelect>.optWrapper.multiple>.MultiControls>p.btnCancel{border-radius:0 0 3px}.SumoSelect>.optWrapper.isFloating>.options>li{padding:12px 6px}.SumoSelect>.optWrapper.multiple.isFloating>.options>li{padding-left:35px}.SumoSelect>.optWrapper.multiple.isFloating{padding-bottom:43px}.SumoSelect .select-all.partial>span i,.SumoSelect .select-all.selected>span i,.SumoSelect>.optWrapper.multiple>.options>li.selected span i{background-color:#11a911;box-shadow:none;border-color:transparent;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAABMSURBVAiZfc0xDkAAFIPhd2Kr1WRjcAExuIgzGUTIZ/AkImjSofnbNBAfHvzAHjOKNzhiQ42IDFXCDivaaxAJd0xYshT3QqBxqnxeHvhunpu23xnmAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:center center}.SumoSelect.disabled{opacity:.7;cursor:not-allowed}.SumoSelect.disabled>.CaptionCont{border-color:#ccc;box-shadow:none}.SumoSelect .select-all{border-radius:3px 3px 0 0;position:relative;border-bottom:1px solid #ddd;background-color:#fff;padding:8px 0 3px 35px;height:20px}.SumoSelect .select-all>span i{cursor:pointer}.SumoSelect .select-all.partial>span i{background-color:#ccc}.SumoSelect>.optWrapper>.options>li.optGroup{padding-left:5px;text-decoration:underline}.sig{display:none}.pad{cursor:url(../images/pen.cur),crosshair;cursor:url(../images/pen.cur) 16 16,crosshair;-ms-touch-action:none;user-select:none}.btn,.chosen-container{-webkit-user-select:none;-moz-user-select:none}.delivery_by_file,.received_by_file{border:1px solid #ccc;display:block}.delivery_by_signature_box p.error,.received_by_signature_box p.error,[hidden],template{display:none}.delivery_by_signature_box .error,.received_by_signature_box .error{border:1px solid red}hr,img{border:0} +/*! +* Bootstrap v3.2.0 (http://getbootstrap.com) +* Copyright 2011-2014 Twitter, Inc. +* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) +*//*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}a{background:0 0}a:active,a:hover{outline:0}dfn{font-style:italic}h1{margin:.67em 0}mark{color:#000;background:#ff0}sub,sup{font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}*,:after,:before,input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box}code,kbd,samp{font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}.item_price,.item_title{font-size:16px}.item_price,optgroup{font-weight:700}address,cite{font-style:normal}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}textarea{resize:vertical}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}.autocomplete_li:after,.autocomplete_li:before,.clearfix:after,.clearfix:before,.item_box:after,.item_box:before,.row_custom:after{content:"";display:table}input[type=email].error,input[type=number].error,input[type=password].error,input[type=text].error,select.error,textarea.error{border:1px solid red!important;text-align:left}input[type=radio].error,input[type=checkbox].error{outline:1px auto red;}.align_center,.last_order_label,.row_half,.td_image,.text_center{text-align:center}#block_error,#block_home_error,#capcha_error,#email_error,#email_home_error,#password_error{display:none;margin-bottom:10px;color:red}.mix_group{width:100%}.mix_option{position:absolute;width:100%;clip:rect(-1px 1200px 38px 0)}.mix_textbox{position:absolute;width:92%}.item_image,.position_relative{position:relative}.mix_textbox #company,.mix_textbox #return_company,.mix_textbox #return_customer,.mix_textbox .order_ajax_item_title{width:100%;height:25px;-webkit-border-top-right-radius:0;-webkit-border-bottom-right-radius:0;-moz-border-radius-topright:0;-moz-border-radius-bottomright:0;border-top-right-radius:0;border-bottom-right-radius:0}.width_100_percent{width:100%;padding:0 2%}.main_discount_box{margin:0 0 10px}.item_box{margin:-1% 0 0 -1%;padding:0;list-style:none}.item_box li{float:left;width:24%;margin:1% 0 0 1%}.item_box li .panel{margin:0}.item_discount,.item_stock_left,.item_title{margin:8px 0}.item_price{margin-top:8px}.item_quantity{margin-right:5px}.item_overlay{-webkit-border-radius:2px;border-radius:2px;opacity:0;filter:alpha(opacity=0);-webkit-transition:all .25s ease;transition:all .25s ease;background:rgba(0,0,0,.4);cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.discount_box:hover .item_overlay,.item_box li a:hover .item_overlay{opacity:1}.item_background_none.item_overlay{display:none;opacity:1}.item_background_none img{width:30px;height:30px;position:absolute;top:50%;left:50%;margin-left:-15px;margin-top:-15px}.order_add_success{position:fixed;top:50%;left:50%;margin:-89px 0 0 -150px;box-shadow:0 0 10px #000;-webkit-box-shadow:0 0 10px #000;display:none;z-index:1}.order_add_success img,.td_image img{display:block}.td_image img{width:60px}.error_message{color:red}.result_error,.result_success{padding:8px 5px;color:#fff;text-align:center}.result_error{background-color:#960606}.result_success{background-color:#0F541B}.last_order_label{display:block;width:auto;height:auto;padding:8px;line-height:1.5;background:#2b2f3e;border:2px solid #2b2f3e;border-radius:5px;-webkit-transition:all .4s ease-in-out;-moz-transition:all .4s ease-in-out;-ms-transition:all .4s ease-in-out;-o-transition:all .4s ease-in-out;transition:all .4s ease-in-out;position:absolute;right:0;top:0;z-index:1;color:#FFD588}.img-thumbnail,.thumbnail{-o-transition:all .2s ease-in-out}.last_order_label .fa{margin-right:6px}.loading_customer{width:25px;margin-top:0;margin-left:-20px;display:none}.vertical_align_top{vertical-align:top!important}.ajax_loading{position:absolute;top:0;left:0;width:100%;height:100%;background:url(../images/fancybox_overlay.png);z-index:5;display:none}.ajax_loading img{position:absolute;width:150px;height:150px;top:10%;left:50%;margin-left:-75px}.add_item_box{margin-bottom:10px}.quotation_add_item{width:180px;height:34px;padding:10px}.add_item_input{position:relative}@media print{blockquote,img,tr{page-break-inside:avoid}*{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote{border:1px solid #999}thead{display:table-header-group}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}*,:after,:before{box-sizing:border-box}.chosen-container *,input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:transparent}body{font-size:14px;line-height:1.42857143}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#9D9EA5;text-decoration:none}a:focus,a:hover{color:#1d3395;text-decoration:underline}a:focus{outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}hr{margin-top:20px;margin-bottom:20px;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;clip:rect(0,0,0,0);border:0}select[multiple],select[size],textarea.form-control{height:auto}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.lead,.page-header *,.page-header h1{font-weight:300}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;line-height:1.4}dt,label{font-weight:700}address,dd,dt{line-height:1.42857143}.table-responsive-big .table-responsive{width:100%;margin:0 0 15px;padding:0;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}dl,ol,ul{margin-top:0}.table-responsive-big .table-responsive>.table{margin-bottom:0}.table-responsive-big .table-responsive>.table>tbody>tr>td,.table-responsive-big .table-responsive>.table>tbody>tr>th,.table-responsive-big .table-responsive>.table>tfoot>tr>td,.table-responsive-big .table-responsive>.table>tfoot>tr>th,.table-responsive-big .table-responsive>.table>thead>tr>td,.table-responsive-big .table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive-big .table-responsive>.table-bordered{border:0}.table-responsive-big .table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive-big .table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive-big .table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive-big .table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive-big .table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive-big .table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive-big .table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive-big .table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive-big .table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive-big .table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive-big .table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive-big .table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive-big .table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive-big .table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive-big .table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive-big .table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.row_custom{width:200px}.row_half{width:100px}@media (max-width:2000px){.table-responsive{width:100%;margin-bottom:10px;padding:0;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child,ol ol,ol ul,ul ol,ul ul{margin-bottom:0}address,dl{margin-bottom:20px}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-inline,.list-unstyled{padding-left:0;list-style:none}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.initialism,.navigation>ul>li>a,.page-header h1{text-transform:uppercase}.text-muted{color:#777}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}a.text-success:hover{color:#2b542c}a.text-info:hover{color:#245269}a.text-warning:hover{color:#66512c}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}a.bg-success:hover{background-color:#c1e2b3}a.bg-info:hover{background-color:#afd9ee}a.bg-warning:hover{background-color:#f7ecb5}a.bg-danger:hover{background-color:#e4b9b9}pre code,table{background-color:transparent}.page-header{padding-bottom:10px}ol,ul{margin-bottom:10px}.list-inline{margin-left:-5px}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.container{width:750px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}legend{display:block;color:#333}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}code,kbd{padding:2px 4px;font-size:90%}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}.checkbox label::before,blockquote:after,blockquote:before{content:""}code,kbd,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;-webkit-box-shadow:none;box-shadow:none}.pre-scrollable{overflow-y:scroll}.container,.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.row{margin-right:0;margin-left:0}#.dataTables_wrapper .row{margin:0}.dataTables_wrapper .col-sm-12{padding:0}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-4 img{width:100%}.col-lg-3{width:25%}.col-lg-3 img{width:100%;border:1px solid #CCC}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}th{text-align:left}.tablestandard{width:5%}.photostandard{width:8%}.codestandard{width:20%}.table{width:100%;max-width:100%;margin-bottom:10px}.gradeX:hover td{background:#ececec!important}.table .table,.table-striped>tbody>tr:nth-child(even)>td,.table-striped>tbody>tr:nth-child(even)>th{background-color:#fff}.dropdown-menu,.modal-content{-webkit-background-clip:padding-box}.btn,.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-primary.active,.btn-primary:active,.btn-warning.active,.btn-warning:active,.btn.active,.btn:active,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover,.form-control,.navbar-toggle,.open>.dropdown-toggle.btn-danger,.open>.dropdown-toggle.btn-default,.open>.dropdown-toggle.btn-info,.open>.dropdown-toggle.btn-primary,.open>.dropdown-toggle.btn-warning{background-image:none}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:6px;line-height:1.5;vertical-align:top;border-top:1px solid #ddd}.table-responsive-big .table>tbody>tr>td,.table-responsive-big .table>tbody>tr>th,.table-responsive-big .table>tfoot>tr>td,.table-responsive-big .table>tfoot>tr>th,.table-responsive-big .table>thead>tr>th,.table>thead>tr>td{padding:0}.table-responsive-big .table>tbody>tr>td.padding_2px_8px,.table-responsive-big .table>thead>tr>th.padding_2px_8px{padding:2px 8px}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>thead:first-child>tr:first-child>th{text-align:center;vertical-align:middle;line-height:1.5}.table>thead:first-child>tr:first-child>th.text_right{text-align:right}.table>tbody+tbody{border-top:2px solid #ddd}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered,.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>tbody>tr>td.border_none{border-right:0;border-left:0}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr.tr_order_odd>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-striped>tbody>tr.tr_order_even>td{background:#fff;}.table-striped>tbody>tr.tr_order_sub>td{background:#f1f1f1;}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th,.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}@media screen and (max-width:767px){.col-lg-3 img{width:100%;border:1px solid #CCC}.col-lg-4 img{width:auto;max-width:100%}}fieldset,legend{padding:0;border:0}fieldset{min-width:0;margin:0}legend{width:100%;margin-bottom:20px;font-size:21px;line-height:inherit;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px}.form-control,.product_text_mm,input[type=file],output{display:block}input[type=search]{box-sizing:border-box;-webkit-appearance:none}input[type=checkbox],input[type=radio]{margin:4px 0 0;line-height:normal}input[type=range]{display:block;width:100%}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}output{padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{width:100%;padding:3px 6px;color:#555;background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.input_three_columns,.input_three_columns_reset{float:left;width:32%}.input_three_columns_reset{width:23.3333%}span.times{float:left;width:10%;text-align:center;line-height:26px}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#d4d4d4;opacity:1}.form-control:-ms-input-placeholder{color:#d4d4d4}.form-control::-webkit-input-placeholder{color:#d4d4d4}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .form-control-feedback,.has-success .help-block,.has-success .radio,.has-success .radio-inline{color:#3c763d}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control,input[readonly]{cursor:not-allowed;background-color:#eee;opacity:1}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{line-height:26px;line-height:1.42857143\9}input[type=date].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm,input[type=time].input-sm{line-height:30px}input[type=date].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg,input[type=time].input-lg{line-height:46px}::-webkit-inner-spin-button{display:none}.form-group{margin-bottom:5px}.checkbox label,.radio label{padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}.checkbox-inline.disabled,.checkbox.disabled label,.radio-inline.disabled,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio label,fieldset[disabled] .radio-inline,fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.form-horizontal .form-group-sm .form-control,.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-horizontal .form-group-lg .form-control,.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:25px;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .form-control-feedback,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .form-control-feedback,.has-error .help-block,.has-error .radio,.has-error .radio-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-left:-20px}.checkbox input[type=checkbox]{cursor:pointer;opacity:0;z-index:1;margin:0 0 0 -17px;width:17px;height:17px}.checkbox,.radio{min-height:20px;position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox{padding-left:17px}.radio label,checkbox label{min-height:17px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox label{display:inline-block;position:relative;padding-left:0}.checkbox label::after,.checkbox label::before{display:inline-block;position:absolute;width:17px;height:17px;left:0}.checkbox label::before{margin-left:-17px;margin-top:-17px;border:1px solid #ccc;border-radius:0;background-color:#fff;-webkit-transition:border .15s ease-in-out,color .15s ease-in-out;-o-transition:border .15s ease-in-out,color .15s ease-in-out;transition:border .15s ease-in-out,color .15s ease-in-out}.checkbox label::after{top:0;margin-left:-16px;margin-top:-16px;padding-left:2px;padding-top:0;font-size:11px;color:#555}.collapsing,.dropdown{position:relative}.checkbox input[type=checkbox]:checked+label::after{font-family:FontAwesome;content:"\f00c"}.multiple_trash{width:17px;height:17px;margin:0 auto}.selectpicker{max-width:180px;float:left;margin-right:10px}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:0;margin-left:0}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}@media (min-width:768px){.form-inline .control-label,.form-inline .form-group{margin-bottom:0;vertical-align:middle}.form-inline .form-group{display:inline-block}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}.form-horizontal .control-label{padding:4px 0;margin-bottom:0;text-align:right}#user_page_permission .control-label{padding-top:0}.form-horizontal .form-group-lg .control-label{padding-top:14.3px}.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:3px 6px;margin-bottom:0;font-weight:400;font-size:13px;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;-ms-user-select:none;user-select:none;border:1px solid transparent;border-radius:4px}.btn.active:focus,.btn:active:focus,.btn:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{background-color:#fff;border-color:#ccc}.btn-default.active,.btn-default:active,.btn-default:focus,.btn-default:hover,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary.active,.btn-primary:active,.btn-primary:focus,.btn-primary:hover,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#3071a9;border-color:#285e8e}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.active,.btn-success:active,.btn-success:focus,.btn-success:hover,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.active,.btn-info:active,.btn-info:focus,.btn-info:hover,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.active,.btn-warning:active,.btn-warning:focus,.btn-warning:hover,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.active,.btn-danger:active,.btn-danger:focus,.btn-danger:hover,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#428bca;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px;color:#e4e4e4;}.dropdown-header,.dropdown-menu>li>a{line-height:1.42857143;white-space:nowrap}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}.width_auto{width:auto}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{height:0;overflow:hidden;-webkit-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:180px;padding:5px 0;margin:2px 0 0;font-size:13px;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:1px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu-right,.dropdown-menu.pull-right{right:0;left:auto}.btn-group-vertical>.btn:not(:first-child):not(:last-child),.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn,.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.dropdown-menu .divider{height:1px;margin:4px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:2px 14px;clear:both;font-weight:400}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#3249ad;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu, .custom_dropdown_open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;color:#777}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.nav-justified>.dropdown .dropdown-menu,.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group-vertical>.btn:focus,.btn-group>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn .caret,.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn-lg .caret{border-width:5px 5px 0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group,.input-group-btn>.btn+.btn{margin-left:-1px}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn>input[type=checkbox],[data-toggle=buttons]>.btn>input[type=radio]{position:absolute;z-index:-1;filter:alpha(opacity=0);opacity:0}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.nav>li,.nav>li>a{display:block;position:relative}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li>a{padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center;margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0;border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-justified>li,.nav-stacked>li{float:none}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#5e5bd0}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar{border-radius:4px}.navbar-header{float:left}.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.embed-responsive,.modal,.modal-open,.progress{overflow:hidden}@media (max-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}.navbar-static-top{z-index:1000;border-width:0 0 1px}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030;-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}.navbar-fixed-bottom,.navbar-fixed-top,.navbar-static-top{border-radius:0}.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;background-color:transparent;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}.progress-bar-striped,.progress-striped .progress-bar,.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}@media (min-width:768px){.navbar-toggle{display:none}.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{padding:10px 15px;margin:8px -15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .control-label,.navbar-form .form-group{margin-bottom:0;vertical-align:middle}.navbar-form .form-group{display:inline-block}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.breadcrumb>li,.pagination{display:inline-block}.btn .badge,.btn .label{top:-1px;position:relative}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}.breadcrumb,table.extra-info td{padding:8px 15px}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-nav>li>a,.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#777}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>li>a,.navbar-inverse .navbar-text{color:#777}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#777}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#777}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{padding-left:0;margin:20px 0;border-radius:4px}.pager li,.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-top:3px;margin-left:-1px;line-height:1.42857143;color:#428bca;text-decoration:none;background-color:#fff;border:1px solid #ddd}.badge,.label{font-weight:700;line-height:1;white-space:nowrap;vertical-align:baseline;text-align:center}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:2;color:#fff;cursor:default;background-color:#3249ad;border-color:#248C96}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;color:#fff;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#428bca}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;color:#fff;background-color:#777;border-radius:10px}.badge:empty{display:none}.list-group-item,.media-object,.thumbnail{display:block}.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.nav-pills>.active>a>.badge,a.list-group-item.active>.badge{color:#428bca;background-color:#fff}.jumbotron,.jumbotron .h1,.jumbotron h1{color:inherit}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;background-color:#eee}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.alert,.thumbnail{margin-bottom:20px}.alert .alert-link,.close{font-weight:700}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.col-lg-3 img{width:100%;border:1px solid #CCC}.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.modal,.modal-backdrop{top:0;right:0;bottom:0;left:0}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.close,.list-group-item>.badge{float:right}.progress-bar-striped,.progress-striped .progress-bar{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar[aria-valuenow="1"],.progress-bar[aria-valuenow="2"]{min-width:30px}.progress-bar[aria-valuenow="0"]{min-width:30px;color:#777;background-color:transparent;background-image:none;-webkit-box-shadow:none;box-shadow:none}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-striped .progress-bar-info,.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text,.panel-title,.panel>.list-group,.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.list-group-item-text{line-height:1.3}.panel{background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-default>.panel-heading,.panel-footer{background-color:#f5f5f5}.panel-body{padding:10px;font-size:13px}.panel-body-word{padding:15px 0 0;color:#ed1c24}.panel-heading>.dropdown .dropdown-toggle,.panel-title,.panel-title>a{color:inherit}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-title{margin-top:0;font-size:16px}.panel-footer{padding:10px 15px;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel-group .panel-heading,.panel>.list-group:last-child .list-group-item:last-child,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.list-group:last-child .list-group-item:last-child,.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.list-group+.panel-footer,.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary>.panel-heading{color:#fff}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#428bca}.panel-primary>.panel-heading .badge{color:#428bca;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#428bca}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{font-size:21px;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal{position:fixed;z-index:1050;display:none;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate3d(0,-25%,0);-o-transform:translate3d(0,-25%,0);transform:translate3d(0,-25%,0)}.modal.in .modal-dialog{-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.tooltip.top .tooltip-arrow,.tooltip.top-left .tooltip-arrow,.tooltip.top-right .tooltip-arrow{bottom:0;border-width:5px 5px 0;border-top-color:#000}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-size:12px;line-height:1.4;visibility:visible;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{white-space:pre-wrap;max-width:200px;padding:3px 8px;color:#fff;text-align:left;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{left:50%;margin-left:-5px}.tooltip.top-left .tooltip-arrow{left:5px}.tooltip.top-right .tooltip-arrow{right:5px}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow,.tooltip.bottom-left .tooltip-arrow,.tooltip.bottom-right .tooltip-arrow{border-width:0 5px 5px;border-bottom-color:#000;top:0}.tooltip.bottom .tooltip-arrow{left:50%;margin-left:-5px}.tooltip.bottom-left .tooltip-arrow{left:5px}.tooltip.bottom-right .tooltip-arrow{right:5px}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.carousel,.carousel-inner{position:relative}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.left>.arrow:after,.popover.right>.arrow:after{bottom:-10px;content:" "}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;border-right-width:0;border-left-color:#fff}.carousel-inner{width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;margin-top:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:transparent;border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn,.text-hide{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.hidden,.visible-lg,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-print,.visible-print-block,.visible-print-inline,.visible-print-inline-block,.visible-sm,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;background-color:transparent;border:0}.hidden{visibility:hidden!important}.affix{position:fixed;-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-ms-viewport{width:device-width}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}.visible-xs-block{display:block!important}.responsive_center{text-align:center}.loading_customer{margin:10px auto 0;position:relative}.visible-xs-inline{display:inline!important}.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}.visible-sm-block{display:block!important}.visible-sm-inline{display:inline!important}.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}.visible-md-block{display:block!important}.visible-md-inline{display:inline!important}.visible-md-inline-block{display:inline-block!important}.item_box li{width:32.3333%}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}.visible-lg-block{display:block!important}.visible-lg-inline{display:inline!important}.visible-lg-inline-block{display:inline-block!important}.hidden-lg{display:none!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}.item_box li{width:49%}.responsive_width{width:40px}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}.responsive_width{width:40px}}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}.visible-print-block{display:block!important}.visible-print-inline{display:inline!important}.visible-print-inline-block{display:inline-block!important}.hidden-print{display:none!important}}.has-warning .twitter-typeahead .tt-hint,.has-warning .twitter-typeahead .tt-input{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .twitter-typeahead .tt-hint:focus,.has-warning .twitter-typeahead .tt-input:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-error .twitter-typeahead .tt-hint,.has-error .twitter-typeahead .tt-input{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .twitter-typeahead .tt-hint:focus,.has-error .twitter-typeahead .tt-input:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-success .twitter-typeahead .tt-hint,.has-success .twitter-typeahead .tt-input{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .twitter-typeahead .tt-hint:focus,.has-success .twitter-typeahead .tt-input:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.input-group .twitter-typeahead:first-child .tt-hint,.input-group .twitter-typeahead:first-child .tt-input{border-bottom-left-radius:4px;border-top-left-radius:4px}.input-group .twitter-typeahead:last-child .tt-hint,.input-group .twitter-typeahead:last-child .tt-input{border-bottom-right-radius:4px;border-top-right-radius:4px}.input-group.input-group-sm .twitter-typeahead .tt-hint,.input-group.input-group-sm .twitter-typeahead .tt-input{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group.input-group-sm .twitter-typeahead .tt-hint,select.input-group.input-group-sm .twitter-typeahead .tt-input{height:30px;line-height:30px}select[multiple].input-group.input-group-sm .twitter-typeahead .tt-hint,select[multiple].input-group.input-group-sm .twitter-typeahead .tt-input,textarea.input-group.input-group-sm .twitter-typeahead .tt-hint,textarea.input-group.input-group-sm .twitter-typeahead .tt-input{height:auto}.input-group.input-group-sm .twitter-typeahead:not(:first-child):not(:last-child) .tt-hint,.input-group.input-group-sm .twitter-typeahead:not(:first-child):not(:last-child) .tt-input{border-radius:0}.input-group.input-group-sm .twitter-typeahead:first-child .tt-hint,.input-group.input-group-sm .twitter-typeahead:first-child .tt-input{border-radius:3px 0 0 3px}.input-group.input-group-sm .twitter-typeahead:last-child .tt-hint,.input-group.input-group-sm .twitter-typeahead:last-child .tt-input{border-radius:0 3px 3px 0}.input-group.input-group-lg .twitter-typeahead .tt-hint,.input-group.input-group-lg .twitter-typeahead .tt-input{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group.input-group-lg .twitter-typeahead .tt-hint,select.input-group.input-group-lg .twitter-typeahead .tt-input{height:46px;line-height:46px}select[multiple].input-group.input-group-lg .twitter-typeahead .tt-hint,select[multiple].input-group.input-group-lg .twitter-typeahead .tt-input,textarea.input-group.input-group-lg .twitter-typeahead .tt-hint,textarea.input-group.input-group-lg .twitter-typeahead .tt-input{height:auto}.input-group.input-group-lg .twitter-typeahead:not(:first-child):not(:last-child) .tt-hint,.input-group.input-group-lg .twitter-typeahead:not(:first-child):not(:last-child) .tt-input{border-radius:0}.input-group.input-group-lg .twitter-typeahead:first-child .tt-hint,.input-group.input-group-lg .twitter-typeahead:first-child .tt-input{border-radius:6px 0 0 6px}.input-group.input-group-lg .twitter-typeahead:last-child .tt-hint,.input-group.input-group-lg .twitter-typeahead:last-child .tt-input{border-radius:0 6px 6px 0}.twitter-typeahead{width:100%}.input-group .twitter-typeahead{display:table-cell!important;float:left}.twitter-typeahead .tt-hint{color:#999}.twitter-typeahead .tt-input{z-index:2}.twitter-typeahead .tt-input[disabled],.twitter-typeahead .tt-input[readonly],fieldset[disabled] .twitter-typeahead .tt-input{cursor:not-allowed;background-color:#eee!important}.tt-dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;min-width:160px;width:100%;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.tt-dropdown-menu .tt-suggestion{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.tt-dropdown-menu .tt-suggestion.tt-cursor{text-decoration:none;outline:0;background-color:#f5f5f5;color:#262626}.tt-dropdown-menu .tt-suggestion.tt-cursor a{color:#262626}.tt-dropdown-menu .tt-suggestion p{margin:0}.bootstrap-tagsinput{vertical-align:middle;cursor:text;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.075) inset;color:#555;display:block;font-size:14px;line-height:1.42857;padding:6px 12px;transition:border-color .15s ease-in-out 0s,box-shadow .15s ease-in-out 0s;width:100%}.bootstrap-tagsinput input,.bootstrap-tagsinput input:focus{border:none;box-shadow:none}.switch-button label,.switch-button label:after{-webkit-transition:all .4s;-o-transition:all .4s}.bootstrap-tagsinput input{outline:0;background-color:transparent;padding:0;margin:0;width:auto!important;max-width:inherit}.bootstrap-tagsinput .tag{margin-right:2px;color:#fff}.bootstrap-tagsinput .tag [data-role=remove]{margin-left:8px;cursor:pointer}.bootstrap-tagsinput .tag [data-role=remove]:after{content:"x";padding:0 2px}.bootstrap-tagsinput .tag [data-role=remove]:hover{box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.bootstrap-tagsinput .tag [data-role=remove]:hover:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)} + +/*! + * Datetimepicker for Bootstrap v3 +//! version : 3.1.3 + * https://github.com/Eonasdan/bootstrap-datetimepicker/ + */.bootstrap-datetimepicker-widget{top:0;left:0;width:250px;padding:4px;margin-top:1px;z-index:99999!important;border-radius:4px}.bootstrap-datetimepicker-widget.timepicker-sbs{width:600px}.bootstrap-datetimepicker-widget.bottom:before{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);top:-7px;left:7px}.bootstrap-datetimepicker-widget.bottom:after{border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;top:-6px;left:8px}.bootstrap-datetimepicker-widget.top:before{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,.2);bottom:-7px;left:6px}.bootstrap-datetimepicker-widget.top:after{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #fff;bottom:-6px;left:7px}.bootstrap-datetimepicker-widget .dow{width:14.2857%}.bootstrap-datetimepicker-widget.pull-right:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.pull-right:after{left:auto;right:7px}.bootstrap-datetimepicker-widget>ul{list-style-type:none;margin:0}.bootstrap-datetimepicker-widget a[data-action]{padding:6px 0}.bootstrap-datetimepicker-widget a[data-action]:active{box-shadow:none}.bootstrap-datetimepicker-widget .timepicker-hour,.bootstrap-datetimepicker-widget .timepicker-minute,.bootstrap-datetimepicker-widget .timepicker-second{width:54px;font-weight:700;font-size:1.2em;margin:0}.bootstrap-datetimepicker-widget button[data-action]{padding:6px}.bootstrap-datetimepicker-widget table[data-hour-format="12"] .separator{width:4px;padding:0;margin:0}.bootstrap-datetimepicker-widget .datepicker>div{display:none}.bootstrap-datetimepicker-widget .picker-switch{text-align:center}.bootstrap-datetimepicker-widget table{width:100%;margin:0}.bootstrap-datetimepicker-widget td,.bootstrap-datetimepicker-widget th{text-align:center;border-radius:4px}.bootstrap-datetimepicker-widget td{height:54px;line-height:54px;width:54px}.bootstrap-datetimepicker-widget td.cw{font-size:10px;height:20px;line-height:20px;color:#777}.bootstrap-datetimepicker-widget td.day{height:20px;line-height:20px;width:20px}.bootstrap-datetimepicker-widget td.day:hover,.bootstrap-datetimepicker-widget td.hour:hover,.bootstrap-datetimepicker-widget td.minute:hover,.bootstrap-datetimepicker-widget td.second:hover{background:#eee;cursor:pointer}.bootstrap-datetimepicker-widget td.new,.bootstrap-datetimepicker-widget td.old{color:#777}.bootstrap-datetimepicker-widget td.today{position:relative}.bootstrap-datetimepicker-widget td.today:before{content:'';display:inline-block;border-left:7px solid transparent;border-bottom:7px solid #428bca;border-top-color:rgba(0,0,0,.2);position:absolute;bottom:4px;right:4px}.bootstrap-datetimepicker-widget td.active,.bootstrap-datetimepicker-widget td.active:hover{background-color:#428bca;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.bootstrap-datetimepicker-widget td.active.today:before{border-bottom-color:#fff}.bootstrap-datetimepicker-widget td.disabled,.bootstrap-datetimepicker-widget td.disabled:hover{background:0 0;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget td span{display:inline-block;width:54px;height:54px;line-height:54px;margin:2px 1.5px;cursor:pointer;border-radius:4px}.bootstrap-datetimepicker-widget td span.disabled,.bootstrap-datetimepicker-widget td span.disabled:hover,.bootstrap-datetimepicker-widget th.disabled,.bootstrap-datetimepicker-widget th.disabled:hover{cursor:not-allowed;background:0 0;color:#777}.bootstrap-datetimepicker-widget td span:hover{background:#eee}.bootstrap-datetimepicker-widget td span.active{background-color:#428bca;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.bootstrap-datetimepicker-widget td span.old{color:#777}.bootstrap-datetimepicker-widget th{height:20px;line-height:20px;width:20px}.bootstrap-datetimepicker-widget th.picker-switch{width:145px}.bootstrap-datetimepicker-widget th.next,.bootstrap-datetimepicker-widget th.prev{font-size:21px}.bootstrap-datetimepicker-widget thead tr:first-child th{cursor:pointer}.bootstrap-datetimepicker-widget thead tr:first-child th:hover{background:#eee}.input-group.date .input-group-addon span{display:block;cursor:pointer;width:16px;height:16px}.bootstrap-datetimepicker-widget.left-oriented:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.left-oriented:after{left:auto;right:7px}.bootstrap-datetimepicker-widget ul.list-unstyled li div.timepicker div.timepicker-picker table.table-condensed tbody>tr>td{padding:0!important}@media screen and (max-width:767px){.bootstrap-datetimepicker-widget.timepicker-sbs{width:283px}}.switch-button{display:inline-block}.switch-button input{visibility:hidden;position:absolute;margin:0}.switch-button label{position:relative;background-color:#CCC;border:1px solid #ccc;vertical-align:middle;width:50px;height:25px;margin:0;cursor:pointer;-webkit-border-radius:60px;-moz-border-radius:60px;-ms-border-radius:60px;-o-border-radius:60px;border-radius:60px;-moz-transition:all .4s;transition:all .4s}.switch-button label:after{background-color:#fff;height:100%;position:absolute;top:0;left:0;width:50%;content:"";-webkit-border-radius:60px;-moz-border-radius:60px;-ms-border-radius:60px;-o-border-radius:60px;border-radius:60px;-moz-transition:all .4s;transition:all .4s}.switch-button input:checked+label{background-color:#27C24C;border-color:#27C24C}.switch-button input:checked+label:after{margin-left:50%;-webkit-transition:all .4s;-moz-transition:all .4s;-o-transition:all .4s;transition:all .4s}.switch-button.xs label{width:30px;height:15px}.switch-button.sm label{width:40px;height:20px}.switch-button.lg label{width:60px;height:30px}.switch-button.xlg label{width:80px;height:40px}.switch-button.primary input:checked+label{background-color:#8d82b5;border-color:#8d82b5}.switch-button.info input:checked+label{background-color:#5bc0de;border-color:#5bc0de}.switch-button.warning input:checked+label{background-color:#f0ad4e;border-color:#f0ad4e}.switch-button.danger input:checked+label{background-color:#d9534f;border-color:#d9534f}table.dataTable thead .sorting{background:url(../../../images/datatables/datatables/sort_both.png) center right no-repeat}table.dataTable thead .sorting_asc{background:url(../../../images/datatables/sort_asc.png) center right no-repeat}table.dataTable thead .sorting_desc{background:url(../../../images/datatables/sort_desc.png) center right no-repeat}table.dataTable thead .sorting_asc_disabled{background:url(../../../images/datatables/sort_asc_disabled.png) center right no-repeat}table.dataTable thead .sorting_desc_disabled{background:url(../../../images/datatables/sort_desc_disabled.png) center right no-repeat}.loading-container,body{background-color:#f9f9f9}@media screen and (max-width:767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:.5em}}@media screen and (max-width:640px){.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_length{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:.5em}}body{color:#000;font-family:sans-serif;position:relative}body,html{overflow-x:hidden}b,strong{font-weight:700}.transit{transition:all .5s;-moz-transition:all .5s;-webkit-transition:all .5s;-o-transition:all .5s}a:focus{outline:0}.loading-container{position:fixed;z-index:9;top:0;left:0;height:100%;width:100%;cursor:wait}.loading{width:40px;height:40px;position:absolute;top:0;left:0;bottom:0;right:0;margin:auto;transform:rotate(45deg)}.loading div{width:16px;height:16px;position:absolute}.l1 div,.l2 div,.l3 div,.l4 div{width:100%;height:100%;background-color:#fff}.l1{transform:translate(0,0);animation:l1-rise 3s ease 0s infinite}.l2{transform:translate(0,16px);animation:l2-rise 3s ease 0s infinite}.l3{transform:translate(16px,0);animation:l3-rise 3s ease 0s infinite}.l4{transform:translate(16px,16px);animation:l4-rise 3s ease 0s infinite}@keyframes rot1{0%,40%,50%{transform:rotate(0)}100%,60%{transform:rotate(90deg)}}@keyframes rot2{0%,40%,50%{transform:rotate(0)}100%,60%{transform:rotate(-90deg)}}@keyframes rot3{0%,35%{transform:rotate(45deg)}100%,65%{transform:rotate(405deg)}}@keyframes l1-rise{0%,100%{transform:translate(0,0)}30%,70%{transform:translate(-4px,-4px)}}@keyframes l2-rise{0%,100%{transform:translate(0,16px)}30%,70%{transform:translate(-4px,20px)}}@keyframes l3-rise{0%,100%{transform:translate(16px,0)}30%,70%{transform:translate(20px,-4px)}}@keyframes l4-rise{0%,100%{transform:translate(16px,16px)}30%,70%{transform:translate(20px,20px)}}.l1 div,.l4 div{animation:rot1 3s ease 0s infinite}.l2 div,.l3 div{animation:rot2 3s ease 0s infinite}aside.left-panel{background-color:#2b2f3e;width:230px;position:fixed;padding:25px 0;box-shadow:inset -5px 0 8px rgba(0,0,0,.3);height:100%;top:0;left:0;z-index:1}aside.left-panel.collapsed{overflow:visible!important;bottom:0}aside.left-panel.lg{width:250px}aside.left-panel.lg+.content{margin-left:250px}@media (min-width:768px){aside.left-panel.collapsed .navigation>ul>li.has-submenu:after,aside.left-panel.collapsed .user .user-login,aside.left-panel.collapsed span.nav-label{display:none}aside.left-panel.collapsed{width:75px;text-align:center}aside.left-panel.collapsed+.content{margin-left:75px}aside.left-panel.collapsed .navigation>ul>li>a{padding:20px}aside.left-panel.collapsed i.fa{font-size:22px}}.user{margin-bottom:35px}.user h4.user-name{color:#8e909a;font-size:16px;text-overflow:ellipsis;overflow:hidden}.user img{border:1px solid #383c4a;padding:8px;width:70px}.user .user-login{display:inline-block}.user .user-login .btn{border:1px solid #343847;background-color:transparent;color:#616574;padding:4px 8px}.user-login .dropdown-menu{border:1px solid #343847;color:#616574;background-color:#2B2F3E;width:100%;margin-top:-1px;min-width:100%;border-radius:0 0 4px 4px;border-top:0}.user-login .dropdown-menu li a{font-size:12px;color:#616574;padding:4px 8px}.user-login .dropdown-menu li a:focus,.user-login .dropdown-menu li a:hover{background-color:#616574;color:#fff}.user .user-login .status-icon{font-size:6px;line-height:0;margin-right:2px;position:relative;bottom:2px}.user .user-login .status-icon.available{color:#27c7bc}.user .user-login .status-icon.busy{color:#EC971F}.user .user-login .status-icon.invisibled{color:#4a4e5d}.user .user-login .status-icon.signout{color:#FF404B}.navigation{margin:20px 0}.navigation>ul>li{position:relative}.navigation>ul>li.has-submenu:after{content:"\f105";font-family:FontAwesome;display:inline-block;position:absolute;color:#7a7e8a;right:15px;transition:all .4s;-moz-transition:all .4s;-webkit-transition:all .4s;-o-transition:all .4s;top:10px;visibility:hidden}.navigation>ul>li.active.has-submenu:after,.navigation>ul>li.has-submenu:hover:after{color:#fff}.navigation>ul>li>a{display:block;padding:12px 25px;color:#CCC;font-size:13px;border-bottom:1px solid #2f3444;transition:all .4s;-moz-transition:all .4s;-webkit-transition:all .4s;-o-transition:all .4s}.navigation>ul:hover>li.active>a{background-color:transparent;box-shadow:none;color:#7a7e8a}.navigation>ul>li.active:hover>a,.navigation>ul>li.active>a,.navigation>ul>li:hover>a{text-decoration:none;color:#fff;background-color:#3249ad;-webkit-box-shadow:inset -6px 0 8px -2px rgba(0,0,0,.3);box-shadow:inset -6px 0 8px -2px rgba(0,0,0,.3)}.navigation ul li a i{margin-right:6px;font-size:14px}.navigation ul li ul,.navigation ul li ul li ul{display:none;background-color:#333747;-webkit-box-shadow:inset -6px 0 8px -2px rgba(0,0,0,.2);box-shadow:inset -6px 0 8px -2px rgba(0,0,0,.2)}aside:not(.collapsed) .navigation ul li.active>ul{display:block}.navigation ul li ul li a{padding:8px 25px;color:#CCC;text-decoration:none;white-space:nowrap;transition:all .2s;-moz-transition:all .2s;-webkit-transition:all .2s;-o-transition:all .2s;font-size:13px;border-left:0 solid #5e6271;text-align:left;display:block}.navigation ul li ul li a:hover,.navigation ul li ul li.active>a{border-left:5px solid #5e6271;color:#CCC}.navigation ul li ul li ul li a:hover,.navigation ul li ul li ul li.active>a{border-left:5px solid #9CA0AF;color:#CCC}@media (min-width:768px){aside.left-panel.collapsed .navigation ul li ul{position:absolute;z-index:3;left:100%;top:0;background-color:#F2F2F4;box-shadow:none;padding:10px 0;min-width:200px;border:1px solid #ddd}aside.left-panel.collapsed .navigation ul li ul:before{display:block;content:"";height:20px;width:20px;border-color:transparent #F2F2F4 transparent transparent;border-width:10px;border-style:solid;position:absolute;cursor:pointer;right:100%;top:22px}aside.left-panel.collapsed .navigation>ul>li:hover>ul{display:block!important}aside.left-panel.collapsed .navigation ul li ul li a{border:0;color:#8f8f9f;border-bottom:1px dashed #ECECEE}}header{background-color:#f2f2f4;border-bottom:1px solid #ececee;padding-top:4px;padding-bottom:4px}.navbar-toggle{margin:4px 10px 0 0;display:block;padding-left:0}.navbar-toggle .icon-bar{background-color:#b3b3be}.app-search{width:250px;position:relative;margin-top:8px;margin-bottom:0;margin-right:10px}.app-search .form-control,.app-search .form-control:focus{padding:3px 6px 3px 30px;border:1px solid #d3d3db;font-size:13px;color:#c4c4cd;background:0 0;box-shadow:none}.app-search:before{content:" ";position:absolute;left:12px;font-family:FontAwesome;cursor:pointer;top:7px;color:#c4c4cd;display:inline-block}.app-search-submit{border:0;background:inherit;position:absolute;top:2px;left:6px;color:#c4c4cd;outline:0}.app-search .form-control::-moz-placeholder{color:#c4c4cd}header .navbar-default .navbar-nav>li>a{color:#b3b3be}.nav-toolbar{margin:0;float:right}.nav-toolbar>li{padding:0;display:inline-block;margin-left:5px;position:relative;list-style:none}.nav-toolbar li span.badge{position:absolute;top:-3px;right:-3px;background-color:#8d82b5;font-weight:300;cursor:pointer;height:18px;width:18px;padding:1px}.nav-toolbar li span.badge.bg-info{background-color:#8d82b5}.nav-toolbar li span.badge.bg-warning{background-color:#E35B5A}.nav-toolbar>li>a{color:#d3d3db;font-size:18px;border:1px solid #d3d3db;border-radius:50px;height:34px;width:34px;text-align:center;display:block;padding:4px}.nav-toolbar>li>a:hover{color:#C1C1C9;border:1px solid #C1C1C9}.nav-toolbar .dropdown-menu.panel{padding-top:0;padding-bottom:0;box-shadow:0 6px 12px rgba(0,0,0,.176)}.content{margin-left:230px}.content>.container-fluid{padding-left:25px;padding-right:25px}.warper{padding-top:20px;padding-bottom:20px;min-height:550px}.page-header{margin:0;border:0}.page-header h1{color:#000;font-size:30px;margin-top:0;margin-bottom:10px}.page-header * small{font-size:14px;color:#9D9EA5}.no-margn{margin:0}.margn-t-xs{margin-top:5px}.margn-t-sm{margin-top:10px}.no-padd{padding:0}.padd-xs{padding:5px}.padd-sm{padding:10px}.padd-md{padding:15px}.padd-lg{padding:20px}.padd-t-xs{padding-top:5px}.padd-t-sm{padding-top:10px}.padd-t-md{padding-top:15px}.padd-t-lg{padding-top:20px}.cr-styled{display:inline-block;margin:0 2px}.cr-styled i{display:inline-block;height:20px;width:20px;cursor:pointer;vertical-align:middle;border:2px solid #CCC;border-radius:3px;text-align:center;padding-top:1px;font-family:FontAwesome}.cr-styled input{visibility:hidden;display:none}.cr-styled input[type=checkbox]:checked+i:before{content:"\f00c"}.cr-styled input[type=radio]+i{border-radius:20px}.cr-styled input[type=radio]:checked+i:before{content:"\f111"}.cr-styled input:checked+i{border-color:#a49bc4;color:#a49bc4}.dashboard-stats.panel{position:relative;cursor:pointer;padding:10px 10px 10px 106px}.dashboard-stats i.fa.stats-icon{width:80px;padding:20px;font-size:40px;position:absolute;margin-left:10px;left:0;top:10px;text-align:center;z-index:1;color:#fff;height:80px}.dashboard-stats.rounded i.fa.stats-icon,.dashboard-stats.rounded.panel{border-radius:50px}.dashboard-stats .sparkline{position:absolute;left:30px;top:20px;opacity:0}.activities-list>li:before,.user-status:before{top:0;content:""}.dashboard-stats h3{margin-top:14px}.dashboard-stats small{font-size:14px;margin-left:6px;opacity:.8}.dashboard-stats:hover i.fa.stats-icon{left:100%;margin-left:-90px}.dashboard-stats:hover h3,.dashboard-stats:hover p{opacity:0}.dashboard-stats:hover .sparkline,.dashboard-stats:hover i.fa.stats-icon{opacity:1}.messages{max-height:520px}.messages .media{padding-top:18px;padding-bottom:18px;margin:0;border-top:1px dashed #eaeef1}.messages .media:first-child{border:0}.messages .media .media-body .media{margin-top:18px;padding-bottom:0}.user-status{position:relative;display:inline-block}.user-status:before{display:inline-block;height:12px;width:12px;border-radius:100%;background-color:#666;position:absolute;right:0;border:2px solid #fff}.user-status.online:before{background-color:#70ba63}.user-status.busy:before{background-color:#01a0e6}.user-status.invisibled:before{background-color:#f2b635}.user-status.offline:before{background-color:#f25648}.messages .media>.pull-left{margin-right:15px}.messages .media>.pull-right{margin-left:15px}.messages .media>.pull-right+.media-body{text-align:right}.messages .media img.media-object{width:54px;border-radius:100%}.messages .media .media-body{font-size:13px}.todo-list li{border:0;margin:0;border-radius:0;border-bottom:1px dashed #e0e0e0}.activities-list{max-height:560px;overflow:auto}.activities-list>li{position:relative;padding:10px 95px 10px 40px}.activities-list>li:before{position:absolute;left:15px;height:100%;border-left:1px solid #ccc}.activities-list>li:after{content:"";position:absolute;left:10px;top:10px;height:12px;width:12px;border-radius:20px;border:1px solid #ccc;background-color:#fff}.activities-list>li span.time{font-size:12px;color:#ccc}.activities-list li .activity-actions{position:absolute;right:0;top:25px}.activities-list>li.warning-activity:after,.activities-list>li.warning-activity:before{border-color:#fcd036}.activities-list>li.danger-activity:after,.activities-list>li.danger-activity:before{border-color:#ff6264}.activities-list li.success-activity:after,.activities-list>li.success-activity:before{border-color:#68b828}.activities-list>li.primary-activity:after,.activities-list>li.primary-activity:before{border-color:#7c38bc}.activities-list>li.info-activity:after,.activities-list>li.info-activity:before{border-color:#4fcdfc}.footer{background-color:#f2f2f4;border-top:1px solid #ececee;padding-bottom:15px;padding-top:15px}.row.no-gutter{margin-left:0;margin-right:0}.row.no-gutter [class*=col-]:not(:first-child),.row.no-gutter [class*=col-]:not(:last-child){padding-left:0;padding-right:0}.bg-white{background-color:#fff}.text-white{color:#fff}.bg-pink{background-color:#eaa1bd}.text-pink{color:#eaa1bd}.bg-gray{background-color:#b2b2b2}.text-gray{color:#b2b2b2}.bg-lightgray{background-color:#fbfbfd}.text-lightgray{color:#fbfbfd}.bg-red{background-color:#F16364}.text-red{color:#F16364}.bg-blue{background-color:#00a0e6}.text-blue{color:#00a0e6}.bg-green{background-color:#67BF74}.text-green{color:#67BF74}.bg-purple{background-color:#8d82b5}.text-purple{color:#8d82b5}.bg-yellow{background-color:#F9A43E}.text-yellow{color:#F9A43E}.bg-orange{background-color:#F58559}.text-orange{color:#F58559}.bg-test{background-color:#79B9D9}.text-test{color:#79B9D9}.bg-warning{background-color:#FEB252}.text-warning{color:#FEB252}.bg-danger{background-color:#E9573F}.text-danger{color:#E9573F}.bg-success{background-color:#70BA63}.text-success{color:#70BA63}.bg-info{background-color:#4DC5F9}.text-info{color:#4DC5F9}.btn-purple{background-color:#3249ad;border-color:#3249ad;color:#fff}.btn.active,.btn:active,.btn:focus,.btn:hover,.open .dropdown-toggle.btn{background-color:#cecece;}.btn-purple.active,.btn-purple:active,.btn-purple:focus,.btn-purple:hover,.open .dropdown-toggle.btn-purple{background-color:#1d3395;color:#fff}.btn-green{background-color:#70ba63;border-color:#579e4b;color:#fff}.btn-green.active,.btn-green:active,.btn-green:focus,.btn-green:hover,.open .dropdown-toggle.btn-purple{background-color:#579e4b;color:#fff}.material_disabled_remove,.material_disabled_remove:active,.material_disabled_remove:focus,.material_disabled_remove:hover{background-color:#ccc;border-color:#ccc}.btn-circle,.btn-group .btn-circle:first-child:not(:last-child):not(.dropdown-toggle),.form-control-circle{border-radius:50px}.btn-flat,.form-control-flat{border-radius:0}.has-feedback div[class*=col-] .form-control-feedback{right:15px;line-height:34px}.panel{margin-bottom:10px}.panel-heading{font-weight:700}.panel-heading small,.panel-heading span,.panel-heading.un-bold{font-weight:400}.bold,.commission_rule_box h5,div.control-label,table th{font-weight:700}.panel-default>.panel-footer,.panel-default>.panel-heading{border-color:#e8e8eb;box-shadow:none}.btn-default,.panel-default>.panel-heading{color:#9D9EA5}.panel-primary{border-color:#8d82b5}.panel-primary>.panel-footer,.panel-primary>.panel-heading{border-color:#8d82b5;background-color:#8d82b5;box-shadow:none}.panel-success{border-color:#70ba63}.panel-success>.panel-footer,.panel-success>.panel-heading{border-color:#70ba63;background-color:#70ba63;color:#fff;box-shadow:none}.panel-info{border-color:#4cbceb}.panel-info>.panel-footer,.panel-info>.panel-heading{border-color:#4cbceb;background-color:#4cbceb;color:#fff;box-shadow:none}.panel-warning{border-color:#feb252}.panel-warning>.panel-footer,.panel-warning>.panel-heading{border-color:#feb252;background-color:#feb252;color:#fff;box-shadow:none}.panel-danger{border-color:#e35b5a}.panel-danger>.panel-footer,.panel-danger>.panel-heading{border-color:#e35b5a;background-color:#e35b5a;color:#fff;box-shadow:none}.panel-footer.clean,.panel-heading.clean{background:0 0;border:none}.dropdown-menu>li>a{color:#84868e}.dropdown-menu.md{min-width:300px}.dropdown-menu.lg{min-width:400px}.dropdown-menu.arrow:after,.dropdown-menu.arrow:before{content:"";display:block;height:11px;width:11px;border-color:transparent;border-style:solid;border-width:11px;position:absolute;bottom:100%;left:6px}.dropdown-menu.arrow.arrow-top-left,.dropdown-menu.arrow.arrow-top-right{top:calc(100% + 15px)}.dropdown-menu.arrow.arrow-top-right:after,.dropdown-menu.arrow.arrow-top-right:before{border-bottom-color:inherit;right:6px;left:auto}.dropdown-menu.arrow.arrow-top-right:before{right:5px;left:auto}.dropdown-menu.arrow.arrow-top-right:after{border-bottom-color:#fff}.dropdown-menu.arrow.arrow-top-left:after,.dropdown-menu.arrow.arrow-top-left:before{border-bottom-color:inherit;left:6px;left:auto}.dropdown-menu.arrow.arrow-top-left:before{left:5px}.dropdown-menu.arrow:after{height:10px;width:10px;border-width:10px}.dropdown-menu.arrow.panel-default:after{border-bottom-color:#F5F5F5}.progress.progress-xxs{height:4px}.progress.progress-xs{height:8px}.progress.progress-sm{height:12px}.progress.progress-lg{height:24px}hr.sm{margin-top:15px;margin-bottom:15px}.showcase-btn,.showcase-btn li,hr.xs{margin-bottom:10px}hr.xs{margin-top:10px}hr.dotted{border-style:dashed}hr.clean{border:0}.panel.tab-pane.tabs-up{border-top:0;border-top-left-radius:0;border-top-right-radius:0}@media (max-width:767px){aside.left-panel.collapsed{width:250px;left:0;overflow:hidden!important}aside.left-panel.collapsed+.content{margin-left:0;transform:translate3d(250px,0,0);-ms-transform:translate3d(250px,0,0);-webkit-transform:translate3d(250px,0,0);-moz-transition:translate3d(250px,0,0);-o-transition:translate3d(250px,0,0)}aside.left-panel{left:100%}section.content{margin-left:0}.content>.container-fluid{padding-left:15px;padding-right:15px}.page-header h1{margin-top:0}}@media (max-width:450px){.dropdown-menu{min-width:280px!important}.messages-dropdown{right:-80px!important}.messages-dropdown.arrow.arrow-top-right:after{right:85px}.messages-dropdown.arrow.arrow-top-right:before{right:84px}.notifications{right:-40px!important}.notifications.arrow.arrow-top-right:after{right:45px}.notifications.arrow.arrow-top-right:before{right:44px}}.showcase-switch-button{margin-right:15px}.showcase-pagination{margin-top:10px;margin-bottom:10px}.showcase-icons div{line-height:40px;cursor:pointer;height:40px}.showcase-icons i{transition:font-size .2s ease 0s;text-align:center;width:40px}.showcase-icons>div:hover i{font-size:26px}/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */.fancybox-image,.fancybox-inner,.fancybox-nav,.fancybox-nav span,.fancybox-outer,.fancybox-skin,.fancybox-tmp,.fancybox-wrap,.fancybox-wrap iframe,.fancybox-wrap object{padding:0;margin:0;border:0;outline:0;vertical-align:top}.fancybox-wrap{position:absolute;top:0;left:0;z-index:8020}.fancybox-inner,.fancybox-outer,.fancybox-skin{position:relative}.fancybox-skin{background:#f9f9f9;color:#444;text-shadow:none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.fancybox-opened{z-index:8030}.fancybox-opened .fancybox-skin{-webkit-box-shadow:0 10px 25px rgba(0,0,0,.5);-moz-box-shadow:0 10px 25px rgba(0,0,0,.5);box-shadow:0 10px 25px rgba(0,0,0,.5)}.fancybox-inner{overflow:hidden}.fancybox-type-iframe .fancybox-inner{-webkit-overflow-scrolling:touch}.fancybox-error{color:#444;margin:0;padding:15px;white-space:nowrap}.fancybox-iframe,.fancybox-image{display:block;width:100%;height:100%}.fancybox-image{max-width:100%;max-height:100%}#fancybox-loading,.fancybox-close,.fancybox-next span,.fancybox-prev span{background-image:url(../images/fancybox_sprite.png)}#fancybox-loading{position:fixed;top:50%;left:50%;margin-top:-22px;margin-left:-22px;background-position:0 -108px;opacity:.8;cursor:pointer;z-index:8060}.fancybox-close,.fancybox-nav,.fancybox-nav span{cursor:pointer;z-index:8040;position:absolute}#fancybox-loading div{width:44px;height:44px;background:url(../images/fancybox_loading.gif) center center no-repeat}.fancybox-close{top:-18px;right:-18px;width:36px;height:36px}.fancybox-nav{top:0;width:40%;height:100%;background:url(../images/blank.gif);-webkit-tap-highlight-color:transparent}.fancybox-prev{left:0}.fancybox-next{right:0}.fancybox-nav span{top:50%;width:36px;height:34px;margin-top:-18px;visibility:hidden}.fancybox-prev span{left:10px;background-position:0 -36px}.fancybox-next span{right:10px;background-position:0 -72px}.fancybox-nav:hover span{visibility:visible}.fancybox-tmp{position:absolute;top:-99999px;left:-99999px;visibility:hidden;max-width:99999px;max-height:99999px;overflow:visible!important}.fancybox-lock,.fancybox-lock body{overflow:hidden!important}.fancybox-lock{width:auto}.fancybox-lock-test{overflow-y:hidden!important}.fancybox-overlay{position:absolute;top:0;left:0;overflow:hidden;display:none;z-index:8010;background:url(../images/fancybox_overlay.png)}.fancybox-overlay-fixed{position:fixed;bottom:0;right:0}.fancybox-lock .fancybox-overlay{overflow:auto;overflow-y:scroll}.fancybox-title{visibility:hidden;position:relative;text-shadow:none;z-index:8050}.fancybox-opened .fancybox-title{visibility:visible}.fancybox-title-float-wrap{position:absolute;bottom:0;right:50%;margin-bottom:-35px;z-index:8050;text-align:center}.fancybox-title-float-wrap .child{display:inline-block;margin-right:-100%;padding:2px 20px;background:0 0;background:rgba(0,0,0,.8);-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;text-shadow:0 1px 2px #222;color:#FFF;font-weight:700;line-height:24px;white-space:nowrap}.fancybox-title-outside-wrap{position:relative;margin-top:10px;color:#fff}.fancybox-title-inside-wrap{padding-top:10px}.fancybox-title-over-wrap{position:absolute;bottom:0;left:0;color:#fff;padding:10px;background:#000;background:rgba(0,0,0,.8)}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){#fancybox-loading,.fancybox-close,.fancybox-next span,.fancybox-prev span{background-image:url(../images/fancybox_sprite@2x.png);background-size:44px 152px}#fancybox-loading div{background-image:url(../images/fancybox_loading@2x.gif);background-size:24px 24px}}.ac_results,.add_item_ajax{max-width:400px;top:79px;left:671.5px;display:block;background:#fff;color:#000;position:absolute;z-index:200;margin:0;padding:0;box-shadow:1px 1px 10px #888}.add_item_ajax{left:0;top:0;margin-top:34px;width:100%}.ac_results ul{margin:0;padding:0;line-height:1.4}.ac_results ul li,.add_item_ajax span{list-style:none;cursor:default;padding:4px 6px;font-size:13px}.add_item_ajax span{display:block;padding:5px 12px}.ac_loading{background:url(../images/indicator.gif) right center no-repeat #fff}.ac_odd{background-color:#fff}.ac_over,.add_item_ajax span:hover{background-color:#f4f4f4;color:#000}.float_left{float:left}.float_right{float:right}.margin_left_10{margin-left:10px}.remove_photo{display:block}.display_none{display:none}.quotation_job_box ul li{padding-top:7px}.quotation_job_box ul li label{margin-bottom:2px}.quotation_job_box ul li input[type=checkbox]{margin-right:5px}.deposit,.order_cancelled,.order_pending, .leave_pending, .leave_reject, .payment_failed, .payment_cancelled, .payment_chargeback, .payment_reject, .payment_hold, .payment_blocked, .order_deposit,.order_unpaid,.packing,.pending,.unpaid,.order_design,.order_mbm,.order_progress, .domain_pending, .domain_expired, .domain_cancelled{color:red}.payment_completed, .leave_confirmed, .order_invoice,.order_confirmed,.completed,.confirmed,.done,.order_completed,.order_done,.order_paid,.paid,.used, .domain_active{color:#063}.job_updated{display:block}.quotation_update{cursor:pointer}table td,table th{padding:3px 6px;text-align:left}@media only screen and (max-width:767px){table.responsive{margin-bottom:0}.pinned{position:absolute;left:0;top:0;background:#fff;width:35%;overflow:hidden;overflow-x:scroll;border-right:1px solid #ccc;border-left:1px solid #ccc}.pinned table{border-right:none;border-left:none;width:100%}.pinned table td,.pinned table th{white-space:nowrap}.pinned td:last-child{border-bottom:0}div.table-wrapper{position:relative;margin-bottom:20px;overflow:hidden;border-right:1px solid #ccc}div.table-wrapper div.scrollable{margin-left:35%;overflow:scroll;overflow-y:hidden}table.responsive td,table.responsive th{position:relative;white-space:nowrap}.item_box li{width:32.3333%}.responsive_width{width:40px}}@media only screen and (max-width:480px){.item_box li{width:49%}}@media only screen and (max-width:320px){.item_box{margin:0}.item_box li{width:100%;margin-left:0}.btn{margin-top:5px}}.login_logo img{display:block;width:100%;max-width:250px;margin:0 auto}.DTFC_LeftHeadWrapper .table,.dataTables_scrollBody .table,.dataTables_scrollHeadInner .table{margin:0;background:#fff}td,th{white-space:nowrap}div.dataTables_wrapper{width:100%;margin:0 auto}.padding_2px_8px{padding:2px 8px}.height_100{height:100px}.table_padding_less{margin-bottom:10px}.table_padding_less td{padding:3px 6px}.search_by_category{margin:6px 0}.page_dashboard{max-width:800px;margin:50px auto}.page_dashboard h2{margin:0 0 25px}.page_dashboard p{margin:0}.margin_bottom,.margin_last_0:last-child{margin-bottom:0}.container_volume_quantity,.container_volume_times,.container_volume_title{float:left}.container_volume_quantity{width:100px}.container_volume_times{width:40px;text-align:center;font-size:24px}.container_volume_title{font-size:24px}.reset_form_group{width:100%;margin:5px 0 0!important;padding-top:5px;border-top:1px solid #ccc}.reset_total{width:100%;margin:0!important;padding:0}.border_right{border-right:1px solid #ccc}.border_bottom_ddd{border-bottom:1px solid #ddd}.border_top_ddd{border-top:1px solid #ddd}.border_right_ddd{border-right:1px solid #ddd}.margin_0{margin:0}.doc_company_details td{padding:0}.doc_loading_details td{padding:3px}.max_width_960{width:100%;max-width:960px;margin:0 auto}.width_38px{width:38px}.margin_top_3px{margin-top:3px}.margin_top_7px{margin-top:7px}.margin_left_10px{margin-left:10px}input[readonly]{border:1px solid #ddd}.split_line{padding:0 15px}.checkbox.th_multiple_trash label::after{margin-left:-17px}.selected_marketing_tfoot #assign_marketing{max-width:250px;float:right}.quotation_serialize{text-transform:capitalize}.table_shipping_list{margin-top:0}.table_shipping_list td{vertical-align:top;padding:0}.input_width_60{width:60px}.text_right{text-align:right}.v_align_top{vertical-align:top!important}.v_align_middle{vertical-align:middle!important}.v_align_bottom{vertical-align:bottom!important}.table_shipping_list_sub td{padding:5px}.table_shipping_list_sub{margin-top:30px;border:1px solid #ddd}.table_shipping_list_sub>tbody>tr>td,.table_shipping_list_sub>thead>tr>th{border-bottom:1px solid #ddd;border-left:1px solid #ddd;border-right:1px solid #ddd}.shipping_doc_table1 .table>tbody>tr>td{padding:4px}.btn-grey{background-color:#ccc;border-color:#b4b4b4}.btn-grey:active,.btn-grey:hover,.btn-grey:visited{background-color:#b1b1b1;border-color:#828282}.forecast_ajax_box,.forecast_bg{position:fixed;top:0;left:0;width:100%;height:100%}.forecast_ajax_box{overflow-y:scroll;display:none;z-index:9999}.forecast_bg{background:url(../images/forecast_bg.png)}.forecast_box{width:100%;max-width:1000px;height:auto;min-height:100px;background:#fff;position:absolute;top:0;left:50%;margin:50px 0 50px -500px;padding:20px;overflow:initial!important;box-shadow:0 1px #FFF inset,0 1px 3px rgba(34,25,25,.4);border-radius:2px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.forecast_close{position:absolute;top:0;right:0;margin:-20px -20px 0 0;font-size:20px;width:40px;height:40px;line-height:40px;color:#999;cursor:pointer;text-align:center;display:block;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;background:-webkit-linear-gradient(#fff,#ebebeb);background:linear-gradient(#fff,#ebebeb);background-color:#f5f5f5;box-shadow:0 1px 4px rgba(0,0,0,.34),1px 0 0 rgba(255,255,255,.9) inset;-webkit-transition-delay:.3s;-moz-transition-delay:.3s;transition-delay:.3s;-webkit-transition-duration:.35s;-moz-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:-webkit-transform,-moz-transform,-o-transform,-webkit-transform;-moz-transition-property:-webkit-transform,-moz-transform,-o-transform,-moz-transform;transition-property:-webkit-transform,-moz-transform,-o-transform,transform;-webkit-transform:translateY(-60px);-moz-transform:translateY(-60px);-ms-transform:translateY(-60px);-o-transform:translateY(-60px);transform:translateY(-60px);-webkit-transform:translateZ(0)}.forecast_close:active,.forecast_close:hover{color:#fff;background:-webkit-linear-gradient(#d62229,#ab171e);background:linear-gradient(#d62229,#ab171e);background-color:#c01c23;box-shadow:0 1px 4px rgba(0,0,0,.74);-webkit-transition-delay:0;-moz-transition-delay:0;transition-delay:0;-webkit-transition-duration:0;-moz-transition-duration:0;transition-duration:0}.forecast_container h2{margin:0 0 20px;padding:0;text-decoration:underline}.forecast_table{width:100%}.forecast_tr input[type=text]{width:100%;padding:0 5px}.forecast_saved{position:absolute;right:100px;margin-top:4px;color:#398613}.inv_status{text-transform:uppercase}.forecash_filter_radio{margin-right:15px}.order_edit_iframe{width:100%;height:100%;display:block;border:0}.lazy_load_img{display:inline-block;max-width:100%;min-width:48px;min-height:48px;background-repeat:no-repeat;background-image:url(../images/lazy_load_loading.gif);background-position:center center}#cartons_packages_box,.hide_order_edit .hide_item,.modal_hide,.show_carton_size,.show_order_edit .add_item,.show_package_size{display:none}.margin_bottom_10{margin-bottom:10px}.checkbox_label{margin:5px 20px 0 0}.checkbox_label input[type=checkbox]{margin:0}.price_list .table>tbody>tr>td,.price_list .table>tbody>tr>th,.price_list .table>tfoot>tr>td,.price_list .table>tfoot>tr>th,.price_list .table>thead>tr>td,.price_list .table>thead>tr>th{padding:3px 8px;line-height:1.6}.price_list .table tr:hover td{background:#f3f3f3!important}.price_list_specification{margin:0 0 0 20px;padding:0}.charge_invoice_remove{margin-right:10px}.row_2_padding{padding-left:15px}.row_2_padding:first-child{padding-left:0}.DTFC_LeftBodyWrapper{border-right:1px solid #ddd}.no_padding_under .col-sm-6,.no_padding_under .form-group,.no_padding_under td{margin:0;padding:0}.no_padding_under td{padding-right:15px}.result_error_bottom_selling{position:absolute;width:100%;left:0;bottom:13px}.item_submit{height:34px}.charge_remove{float:right}.cartons_packages_cbm td,.cartons_packages_dimension_box td{padding:5px 0 0}.dimension_type_cartons .show_carton_size,.dimension_type_packages .show_package_size{display:block}.full_table{width:100%;table-layout:fixed}.full_table td{vertical-align:top}.header_company_content{display:none}.table-bordered.border_none_table>tbody>tr>td{border-left:none;border-right:none}.table-bordered.border_none_table>tbody>tr>td.border_none_table_left{border-left:1px solid #ddd}.main_order_remark_pi_po{margin-top:30px}#cke_126,#cke_131,#cke_135,#cke_140,#cke_180,#cke_183,#cke_189,#cke_192,#cke_30,#cke_34,#cke_35,#cke_39,#cke_84,#cke_87,#cke_88,#cke_91,.cke_button__about,.cke_button__anchor,.cke_button__blockquote,.cke_button__button,.cke_button__checkbox,.cke_button__creatediv,.cke_button__find,.cke_button__flash,.cke_button__form,.cke_button__hiddenfield,.cke_button__horizontalrule,.cke_button__iframe,.cke_button__imagebutton,.cke_button__language,.cke_button__maximize,.cke_button__newpage,.cke_button__pagebreak,.cke_button__preview,.cke_button__print,.cke_button__radio,.cke_button__replace,.cke_button__save,.cke_button__scayt,.cke_button__select,.cke_button__selectall,.cke_button__showblocks,.cke_button__smiley,.cke_button__specialchar,.cke_button__templates,.cke_button__textarea,.cke_button__textfield,.cke_toolbar_break,.cke_toolbar_separator{display:none!important}.ajax_order_item_box{position:relative}.order_item_action{font-size:15px}.order_item_action_close,.order_item_action_down,.order_item_action_up{float:left;margin-left:10px;width:15px;height:20px}.order_details_box_list:first-child .order_item_action_up_a,.order_details_box_list:last-child .order_item_action_down_a{display:none}#autocomplete_box_result{position:absolute;top:0;left:0;width:100%;margin-top:26px;z-index:99999}.autocomplete_box{margin:0;padding:0;list-style:none;box-shadow:0 0 1px #000;max-height:300px;overflow:hidden;overflow-y:scroll}.autocomplete_li{padding:3px;background-color:#fff;border-top:1px solid #ddd;cursor:pointer}.autocomplete_li:first-child{border-top:none}.autocomplete_li:nth-child(odd){background-color:#f9f9f9}.autocomplete_li:hover{background:#f3f3f3}.autocomplete_view_image,.autocomplete_view_title{float:left}.autocomplete_view_image{width:38px;margin-right:10px}.autocomplete_view_title{width:83%}.autocomplete_view_image img{width:100%}.commission_rule_box{margin:0;display:none}.commission_rule_box .col-sm-4{padding:0 0 0 20px}.commission_rule_box .commission_rule_box_1{padding-left:0}.commission_rule_box h5{margin:10px 0 7px;font-size:13px;text-decoration:underline}.commission_rule_box td{padding:0 5px 7px 0;vertical-align:middle}.commission_rule_box label{margin:3px 0}.commission_rule_box input[type=checkbox]{float:left;margin:2px 3px 0 0}.custom_div{margin:4px 0}.custom_label{margin:4px 0 0}input[type=checkbox].custom_checkbox{float:left;margin:2px 3px 0 0}.commission_rule_box td.td_no_padding{padding:0}.custom_table{width:100%;max-width:400px}.live_active{color:#0F541B}.live_inactive{color:red}#div_filter_print{margin-top:10px;display:none}.custom_dropdown_th{ position:relative; }.custom_dropdown{position:absolute;right:0;top:0;width:31px;height:31px}.custom_dropdownbox{position:relative;}.custom_dropdown_title{padding:0 10px}.custom_dropdown .caret{margin-top:10px;margin-left:14px;}.custom_dropdown .dropdown-menu{left:inherit;right:0;padding:0;max-height:150px;overflow-y:auto}.custom_dropdown_first .dropdown-menu{left:0}.custom_dropdown_filter{width:80%;margin:0 auto;padding:0 6px;font-weight:400}.responsive.table{min-height:200px}.responsive.table.table_height_flexible{min-height:auto;}.rotate_image_box{width:100px;position:relative}.rotate_image_link{position:relative;display:block;width:100%}.rotate_loading{position:absolute;width:40px;top:50%;left:50%;margin-top:-20px;margin-left:-20px;display:none}.div_current_location{margin-top:10px}.locator_marker{float:left;margin:4px 15px}.input_four_columns_reset{float:left;width:21.25%}.input_five_columns_reset{float:left;width:17.5%}span.minus{float:left;width:5%;text-align:center;line-height:26px}.number_format_box .serial_number_input{float:left;width:16%}#dvMap,#map_waypoints{width:100%;height:600px}.marquee{display:block;padding:0;margin:0;list-style:none;line-height:1;position:relative;width:100%;height:35px;overflow:hidden;background:#E0E0E0;border-bottom:1px solid #ececee}.marquee li{position:absolute;top:-999em;left:0;display:block;white-space:nowrap;padding:10px 20px;text-align:center}#shipping_to_another_address,.result_ajax_call{display:none}.cart_to_shipping_label{margin-top:6px}.cart_to_shipping_label input[type=checkbox]{float:left;margin-top:2px;margin-right:3px}.ajax_serial_number{position:relative;min-height:200px}.ajax_serial_number .ajax_loading img{width:60px;height:60px;top:40%;margin-left:-30px}.custom_serial_number_print{width:120px;margin:0 auto}.custom_serial_number_print td{padding-top:0;padding-bottom:0;text-align:center}.line_break_left{border-left:1px solid #D8D8D8}.product_material_table{margin:0}.order_print_span{margin:0 6px}.site_color_box{list-style:none;margin:0;padding:10px;border:1px solid #f4f4f4}.site_color_box li{margin-top:8px}.site_color_box li:first-child{margin-top:0}.site_color_box .color_box{float:left}.site_color_box .color_title{width:76%;float:left;text-transform:uppercase;font-weight:700;padding:5.5px 0 5.5px 7px;font-size:13px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;height:27px;-webkit-line-clamp:1;-webkit-box-orient:vertical}.color_box{width:20%;height:30px;display:block;border:1px solid #f4f4f4}.site_left_box{float:left;width:15%;text-align:left}.employment_table td,.employment_table th{padding:0;white-space:inherit}.employment_table input[type=email],.employment_table input[type=text], .employment_table input[type=number], .employment_table select,.employment_table textarea{width:100%;padding:8px;margin:0 0 5px;display:block;border:1px solid #d9d9d9;border-top:1px solid silver;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.employment_table input[type=file]{margin:10px 0}.preview_photo{width:80px;border:1px solid #ccc}.preview_photo img{width:100%;display:block}.total_sales_result{text-align:center;font-weight:500;font-size:20px;margin-top:30px}.update_employment_box,.update_estimated_box{position:relative}.update_employment_box .custom_button,.update_estimated_box .custom_button{position:absolute;top:0;right:0;border:0;margin:0;padding:2px 15px;line-height:2}.update_employment_box .custom_button:hover,.update_estimated_box .custom_button:hover{background:#ccc}.update_employment_result,.update_estimated_result{font-size:25px;display:none;position:absolute;top:0;right:35px;z-index:1;width:43px;height:33px;line-height:1.5}.update_employment_result{right:38px;top:-2px}.update_employment_result_success,.update_estimated_result_success{color:#060}.update_employment_result_error,.update_estimated_result_error{color:red}.employment_status_update_success,.update_employment_update_success{font-size:14px;color:#060}.update_employment_box{width:155px;margin:0 auto}.update_employment_status{width:110px;height:32px}.received_by_file{display:block;border:1px solid #ccc}.checkbox_language input{margin:3px!important}.tr_order_sub {display:none;}.main_order_version_click{cursor:pointer;}.main_order_level_down, .main_active .main_order_level_up{display:none;}.main_active .main_order_level_down{display:inline-block;}.order_details_title,.order_details_description,.order_details_price{padding:4px 0;}.order_details_description{margin:0;font-family:inherit;}.list_item_sub{margin-bottom:10px;}#list_item_main{background:#f9f9f9;}#list_item_pending{display:none;}.list_item_sub_div{position:relative;}.list_item_remove_a,.list_item_remark_a, .list_item_date_span{position: absolute;top: 0px;right: 8px;font-size: 19px;display:none;}.list_item_date_span{display:block;font-size:11px;left:-125px;top:-2px;}.list_item_remark_a{right: 32px;font-size: 16px;top: 3px;}.list_item_sub_div:hover .list_item_remove_a,.list_item_sub_div:hover .list_item_remark_a{display:block;}.list_item_status_box{position:absolute;top:1px;left:5px;}.list_item_sub,#list_item_main{padding-left:25px;padding-right:50px;}.list_item_remark{margin-bottom:5px;display:none;}textarea.list_item_remark{height:100px;}.list_item_remark.remark_active{display:block;}textarea.order_ajax_item_description{height:200px;}.main_order_list_title{margin-bottom:10px;}.opacity_me{-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";filter: alpha(opacity=20);-moz-opacity: 0.2;-khtml-opacity: 0.2;opacity: 0.2;}.shine_me{-webkit-animation-name: ShineAnimation;-webkit-animation-duration: 1s;-webkit-animation-iteration-count: infinite;}@-webkit-keyframes ShineAnimation{from {color:#9D9EA5;}to {color:#3249ad;}}.job_list_note{margin: 15px 0 0 16px;padding: 0;}.job_status_colour_box{margin:0;padding:0;list-style:none;}.job_status_colour_box_li{float:left;}.job_status_colour_box_li a{padding: 8px 18px;display: block;color: #fff;text-transform: capitalize;text-decoration:none !important;}.dropdown-menu-select{width:100%;padding:3px 10px;border:0;outline:0;font-weight:400;cursor:pointer}.dropdown-menu-select:hover{background-color:#f5f5f5}.custom_dropdown_toggle{display:block;width:100%;height:100%;position:relative;}textarea.domain_remark {height:100px;}.div_cms_login_yes, .div_system_login_yes, .type_other_hide{display:none;}.domain_sub_table td{padding:0px;}.check_domain_form{position:relative;}#check_domain_input{font-size: 16px;height: 48px;padding: 10px 20px;font-weight: 400;line-height: 1.42857143;border-radius: 3px;padding-right: 349px;}#check_domain_button{position: absolute;top: 0;right: 0;padding: 12px;border-radius: 0;border-top-right-radius: 3px;border-bottom-right-radius: 3px; font-size:16px;width:130px;}.check_domain_form .select2{position: absolute;top: 0;right: 130px;width: 200px !important;}.check_domain_form .select2-selection{padding: 13.5px !important;height: auto;font-size: 16px;}.check_domain_form .select2-selection__arrow{top:14px !important}.check_domain_loading{display:none; text-align: center; margin: 0 0 30px;}.check_domain_box{text-align: center; margin: 0 0 30px;font-weight: 700;font-size: 18px;}.check_domain_form_div{margin:30px 0;}.report_chart_box{margin-top:100px}.report_chart_box:first-child{margin:0}.report_chart_content{width:100%}.chart_div_box{margin:0 auto}.chart_div_total_sales{font-weight: bold;text-align: center;font-size: 20px;color: #000;z-index: 1;position: relative;margin-top:-15px;}.ajax_order_print_as_box,.ajax_order_print_bg,.forecast_ajax_box,.forecast_bg{position:fixed;top:0;left:0;width:100%;height:100%}.ajax_order_print_as_box,.forecast_ajax_box{overflow-y:scroll;display:none;z-index:99999999}.ajax_order_print_bg,.forecast_bg{background:url(../images/forecast_bg.png)}.ajax_order_print_div,.forecast_box{width:100%;max-width:1000px;height:auto;min-height:100px;background:#fff;position:absolute;top:0;left:50%;margin:50px 0 50px -500px;padding:20px;overflow:initial!important;box-shadow:0 1px #FFF inset,0 1px 3px rgba(34,25,25,.4);border-radius:2px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ajax_order_print_div{padding:0;min-height:auto;width:250px;font-size:13px;font-weight:500;top:35%;left:50%;margin:-37px 0 0 -125px}.order_print_as_a{display:block;padding:8px;text-decoration:none !important}.order_print_as_a:hover{color:#fff;background-color:#3249ad}.border_dashed_bottom{border-bottom:1px dashed #ddd}.ajax_order_print_div .border_dashed_bottom:last-child{border-bottom:0;}.ajax_box_close,.forecast_close{position:absolute;top:0;right:0;margin:-15px -15px 0 0;font-size:15px;width:30px;height:30px;line-height:30px;color:#999;cursor:pointer;text-align:center;display:block;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;background:-webkit-linear-gradient(#fff,#ebebeb);background:linear-gradient(#fff,#ebebeb);background-color:#f5f5f5;box-shadow:0 1px 4px rgba(0,0,0,.34),1px 0 0 rgba(255,255,255,.9) inset;-webkit-transition-delay:.3s;-moz-transition-delay:.3s;transition-delay:.3s;-webkit-transition-duration:.35s;-moz-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:-webkit-transform,-moz-transform,-o-transform,-webkit-transform;-moz-transition-property:-webkit-transform,-moz-transform,-o-transform,-moz-transform;transition-property:-webkit-transform,-moz-transform,-o-transform,transform;-webkit-transform:translateY(-60px);-moz-transform:translateY(-60px);-ms-transform:translateY(-60px);-o-transform:translateY(-60px);transform:translateY(-60px);-webkit-transform:translateZ(0)}.small_message{font-size:11px;} + +/* production */ +.specialDate_data a{ background-color: #6F0 !important; } +.specialDate_no_data a{ background-color: #b3b3b3 !important; } + +/* background */ +.warper.container-fluid { + background-color: #f3efec; +} + +input.form-control[type="text"], +input.form-control[type="date"], +select.form-control { + border-radius: 5px; +} + +label, +.listing-table{ + color:#9D9EA5; +} + +.fa.fa-edit{ + background-color: #3a9b94; + color: white; + text-align: center; + border-radius: 5px; + padding: 5px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 3px 10px 0 rgba(0, 0, 0, 0.19);; +} + +.fa.fa-file-image-o{ + background-color: #f9b840; + color: white; + text-align: center; + border-radius: 5px; + padding: 5px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 3px 10px 0 rgba(0, 0, 0, 0.19);; +} + +.fa.fa-print{ + background-color: #924ea5; + color: white; + text-align: center; + border-radius: 5px; + padding: 5px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 3px 10px 0 rgba(0, 0, 0, 0.19);; +} + +.fa.fa-eye{ + background-color: #924ea5; + color: white; + text-align: center; + border-radius: 5px; + padding: 5px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 3px 10px 0 rgba(0, 0, 0, 0.19);; +} + +/* custom comment box */ +.fixed-thead table {width:100%; border-collapse:collapse;} +.fixed-thead, .fixed-thead-head {position:relative; overflow:hidden;} +.fixed-thead-side, .fixed-thead-corner {position:absolute; left:0; overflow:hidden;} +.fixed-thead-corner {top:0;} +.fixed-thead-body {overflow:auto;} +.dataTable_width{ width:54px; } +.dataTable_width_image img{ width:40px; } +.pre{ display: block; white-space: pre; } + +.comment_picture_box{float:left;}.comment_picture{margin-right:8px;}.comment_picture img{display:block;border:0;}.comment_content_div_box{overflow:hidden;}.comment_content_textarea{font-size: 14px;line-height: 1.358;word-break: break-word;background: #fff;box-sizing: border-box;cursor: text;font-size: 11px;padding: 3px;border: 1px solid #d3d6db;word-wrap: break-word;width: 100%;outline: 0;padding: 12px;font-size: 13px;height:70px;display:block;}.comment_content_submit{background: #f6f7f9;text-align: right;border: 1px solid #d3d6db;border-top: 0;display: none;padding: 8px;zoom: 1;}.comment_content_submit{border: 1px solid #d3d6db;border-top: 0;background: #f6f7f9;text-align: right;padding: 8px;}.comment_submit_form_div{margin-bottom:20px;}.comment_view_title{font-size: 14px;line-height: 1.358;word-break: break-word;word-wrap: break-word;font-weight: bold;}.comment_view_content{margin-bottom: 4px;margin-top: 4px;font-size: 14px;line-height: 1.358;word-break: break-word;word-wrap: break-word;}.comment_view_reply{word-break: break-word;word-wrap: break-word;font-weight: normal;color: #90949c;font-size: 12px;line-height: 1.358;padding-top: 2px;}.comment_view_reply,.comment_view_time{direction: ltr;word-break: break-word;word-wrap: break-word;font-weight: normal;font-size: 12px;line-height: 1.358;cursor: pointer;text-decoration: none;color: #4267b2;text-decoration:none}.comment_view_reply:hover{color: #4267b2;text-decoration:underline}.comment_view_time{color: #90949c;}.comment_listing_div .comment_submit_box{margin-top: 12px;zoom: 1;}.comment_listing_div .comment_submit_box:first-child{border-top:0;}.comment_view_time{cursor:inherit;}.comment_view_more{float: right;display: block;vertical-align: middle;text-decoration: underline;line-height: 1;font-size:16px;display:none;color: #d0d3d8;}.comment_content_div:hover > .comment_content_div_box > .comment_content_reply_view > .comment_content_view > .comment_content_details > .comment_view_more, .comment_view_more.more_active{display:block;}.comment_view_more_box{position: absolute;right: 0px;font-size: 11px;color: #1d2129;direction: ltr;line-height: 1.28;margin:20px 10px 30px;border-top-right-radius: 0;background-clip: padding-box;background-color: #fff;border: 1px solid rgba(0, 0, 0, .15);border-radius: 3px;box-shadow: 0 3px 8px rgba(0, 0, 0, .3);padding: 5px 0;display:none;}.comment_view_more_edit,.comment_view_more_delete{overflow: hidden;white-space: nowrap;display: block;outline: none;text-decoration: none !important;border: solid #fff;border-width: 1px 0;color: #1d2129 !important;font-size: 12px;-webkit-font-smoothing: antialiased;font-weight: normal;line-height: 22px;padding: 0 12px;}.comment_view_more_edit:hover,.comment_view_more_delete:hover,.comment_view_more_edit:active,.comment_view_more_delete:active{text-decoration:none;background-color: #4267b2;border-color: #29487d;color: #fff !important;}.comment_content_reply_form{border-left: 1px dotted #d3d6db;padding-left: 8px;margin-top: 12px;}.comment_content_reply_form .comment_content_submit, .comment_content_reply_view .comment_content_submit{display:block;}.comment_content_reply_form .comment_content_sub_form, .comment_content_reply_form{display:none;}.comment_view_content_pre{margin:0;padding:0;display:block;font-family:inherit;color:inherit;font-size:inherit;}.comment_content_sub_view .comment_content_reply_form{display:none !important;}.comment_picture img{width:48px;height:48px;} +input.error{border: 1px solid red;} +.gst_box{display:none;} +.ajax_update_status_bg, .ajax_update_status_box{ position: fixed; top: 0; left: 0; width: 100%; height: 100%; overflow-y: scroll; display: none; z-index: 999; } +.ajax_update_status_bg { display: block; z-index: 1; background: url(../images/bg.png); } +.ajax_update_tracking_print_div{ max-width: 1000px; height: auto; background: #fff; position: absolute; overflow: initial!important; box-shadow: 0 1px #FFF inset, 0 1px 3px rgba(34,25,25,.4); border-radius: 2px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0; min-height: auto; width: 280px; font-size: 13px; font-weight: 500; top: 100px; left: 50%; margin: -37px 0 50px -140px; z-index: 2; } +.ajax_box_close{ position: absolute; top: 0; right: 0; margin: -15px -15px 0 0; font-size: 15px; width: 30px; height: 30px; line-height: 30px; color: #999; cursor: pointer; text-align: center; display: block; -webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%; background: -webkit-linear-gradient(#fff,#ebebeb); background: linear-gradient(#fff,#ebebeb); background-color: #f5f5f5; box-shadow: 0 1px 4px rgba(0,0,0,.34), 1px 0 0 rgba(255,255,255,.9) inset; -webkit-transition-delay: .3s; -moz-transition-delay: .3s; transition-delay: .3s; -webkit-transition-duration: .35s; -moz-transition-duration: .35s; transition-duration: .35s; -webkit-transition-property: -webkit-transform,-moz-transform,-o-transform,-webkit-transform; -moz-transition-property: -webkit-transform,-moz-transform,-o-transform,-moz-transform; transition-property: -webkit-transform,-moz-transform,-o-transform,transform; -webkit-transform: translateY(-60px); -moz-transform: translateY(-60px); -ms-transform: translateY(-60px); -o-transform: translateY(-60px); transform: translateY(-60px); -webkit-transform: translateZ(0); } +.ajax_update_status_bg,.ajax_popup_bg{display:block;z-index:1;background:url(../images/bg.png);} +.ajax_update_status_print_div,.ajax_popup_print_div{max-width:1000px;height:auto;background:#fff;position:absolute;overflow:initial!important;box-shadow:0 1px #FFF inset,0 1px 3px rgba(34,25,25,.4);border-radius:2px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:0;min-height:auto;width:280px;font-size:13px;font-weight:500;top:100px;left:50%;margin:-37px 0 50px -140px;z-index:2} +.ajax_popup_print_div{width:700px;margin-left:-350px;margin-bottom:50px;} +.scrollup { width: 50px; height: 50px; text-indent: -9999px; opacity: .5; position: fixed; bottom: 50px; right: 140px; display: none; background: url(../images/icon_top.png) no-repeat; transition: all .4s ease-in-out; } +.table-background-red td { color: #fff ; background-color: red !important ; } +.table-background-red td .fa { color: #fff ; } +.table-background-green td { color: #fff ; background-color: green !important ; } +.table-background-green td .fa { color: #fff ; } +.index_language { text-align: center; padding: 0; margin-top: 20px; margin-bottom: 20px; } +.language{margin-top:20px;} +.language a { margin: 0 10px; font-size: 13px; } +.language a.active { color: #1d3395; } +.left-panel .language a.active { color: #fff; } +.red{color:#f00;} +.dataTable_width_time{height:150px;} +.dataTable_form_edit{ position: relative; border: 1px solid transparent; } +.dataTable_form_edit_health{ margin-top: 10px; padding: 10px; background: #dcdcdc; } +.dataTable_form_edit_success{ border: 1px solid #49690b; } +.dataTable_form_edit_failed{ border: 1px solid #69210b; } +.dataTable_form_edit_title{ font-size: 8px; text-align: left; } +.dataTable_form_edit input{ width:100%; padding:1px; font-size:11px; margin-bottom:3px; } +.dataTable_form_edit select{ width:100%; padding:1px; font-size:11px; margin-bottom:3px; } +.dataTable_form_edit button{ border:0; background: transparent; position: absolute; right:0; bottom:2px; padding: 2px 3px; outline: none; } +.warehouse_box{ display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #ccc; margin-bottom: 5px; } +.warehouse_box:last-child{ border-bottom: 0px; margin-bottom: 0; } +.fancybox_iframe_background{ float: left; width: 60px; height: 60px; margin-right: 10px; margin-bottom: 10px; display: block; background-size: cover; } +.dashboard-tab{ width: 20%; height: 100%; margin: 10px 0px; } + +/* chart report */ +.report_chart_main{ padding-left:15px; padding-right:15px; } +.report_chart_filter_year{ display:flex; align-items: center; justify-content: space-between; margin: 20px auto; text-align:center; width: 270px; } +.report_chart_filter_year_button{ display:block; width:80px; background-color: #f96b8a; padding: 10px; border-radius: 10px; color: #fff; font-weight: bold; } +.report_chart_filter_year_button:hover { text-decoration: none; background-color:#b71d3f; color:#fff; } +.report_chart_filter_year_span{ display: block; float:left; width:80px; background-color: #59a8e2; margin-left:15px; margin-right:15px; padding: 10px; border-radius: 10px; color: #fff; font-weight: bold; } +.report_chart_filter_type{ display:flex; align-items: center; justify-content: space-between; margin: 20px auto; text-align:center; width: 270px; } +.report_chart_filter_type_button{ display: block; width:120px; background-color: #f96b8a; padding: 10px; border-radius: 10px; color: #fff; font-weight: bold; } +.report_chart_filter_type_button:hover, .report_chart_filter_type_button.active { text-decoration: none; background-color:#b71d3f; color:#fff; } + +.blink_css_cms { animation: blinker 1s linear infinite; } + +.report_chart_line{ height:500px; margin-bottom:50px; } +.report_chart_bar{ height:1500px; margin-bottom:50px; } + +.dashboard_section{ margin-bottom:30px;} +.dashboard_chart{ background-color:#fff } +.dashboard_chart .col-sm-6{ padding:0; } +.chart_div{ width:98%; height: 300px; margin:20px 0; padding:0 1%; } +.dashboard_input_box{ max-width:300px; width:100%; margin:0 auto; } + +@keyframes blinker { 50% { opacity: 0; } } + +/* for mobile only */ +/* min width */ +@media (min-width: 2000px){ + .dashboard-tab{ width: 14.28%; } +} + +/* min width */ +@media (max-width: 1200px) and (min-width: 981px){ + .forecast_box{ max-width:800px; margin-left:-400px } + .autocomplete_view_title { width: 64%; } + .dashboard-tab{ width: 20%; } +} +@media (max-width: 980px) and (min-width: 768px){ + .forecast_box{max-width:600px;margin-left:-300px;} + .btn, .form-control, table td, table th, .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ padding:10px 6px; } + .select2-container--default .select2-selection--single{ height:auto; padding:9.5px 6px; } + .select2-container--default .select2-selection--single .select2-selection__arrow b{ background-position:3px 8px ; } + .list_item_sub, #list_item_main{ padding-left: 25px; padding-right: 50px; } + .list_item_remark_a{top:9px;} + .list_item_remove_a{top:6px;} + .form-horizontal .list_item_status_box{ padding-top:14px; } + .mix_group{height:36px} + .mix_textbox #company, .mix_textbox #return_customer, .mix_textbox #return_company, .mix_textbox .order_ajax_item_title{ height:36px; } + .dropdown-menu>li>a{ padding:8px 14px; } + .panel-body{font-size:14px;} + .custom_dropdown .caret{ margin-top:18px; } + .care{margin-left:6px;} + .custom_dropdown{height:41px;} + .check_domain_form .select2{ width: 110px !important; } + .select2-container--default .select2-selection--multiple{ padding:9px 3px; } + .mix_group{height:42px;} + .mix_option{ clip: rect(-1px 1200px 42px 0); } + .mix_option .form-control{ padding-top:11px; padding-bottom:11px; } + .mix_textbox #company, .mix_textbox #return_customer, .mix_textbox #return_company, .mix_textbox .order_ajax_item_title{ height:42px; } + .list_item_sub { margin-bottom: 35px; } + .list_item_date_span{right:inherit;left:5px;top:45px;} + .dashboard-tab{ width: 25%; } +} +@media only screen and (max-width:767px){ + .no_padding_under .mobile_padding_10{ padding:5px 0; } + .row_2_padding { padding: 0; margin-bottom: 6px; } + .forecast_box{ width: 90%; max-width:100%; left:0; margin-left: 5%; } + .commission_rule_box .col-sm-4{ padding:0 0 0 0; } + .btn, .form-control, table td, table th, .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ padding:10px 6px; } + .select2-container--default .select2-selection--single{ height:auto; padding:9.5px 6px; } + .select2-container--default .select2-selection--single .select2-selection__arrow b{ background-position:3px 8px ; } + #check_domain_input{padding-right:259px;} + .list_item_sub, #list_item_main{ padding-left: 25px; padding-right: 50px; } + .list_item_remark_a{top:9px;} + .list_item_remove_a{top:6px;} + .form-horizontal .list_item_status_box{ padding-top:14px; } + .dropdown-menu>li>a{ padding:8px 14px; } + .panel-body{font-size:14px;} + .header_company_box { width: 100%; margin-top: 8px; } + .mix_group{height:36px} + .mix_textbox #company, .mix_textbox #return_customer, .mix_textbox #return_company, .mix_textbox .order_ajax_item_title{ height:36px; } + .mobile_hide{display:none;} + .comment_picture img{ width:32px; height:32px; } + .custom_dropdown .caret{ margin-top:18px; } + .care{margin-left:6px;} + .custom_dropdown{height:41px;} + .check_domain_form .select2{ width: 110px !important; } + .select2-container--default .select2-selection--multiple{ padding:9px 3px; } + .mix_group{height:42px;} + .mix_option{ clip: rect(-1px 1200px 42px 0); } + .mix_option .form-control{ padding-top:11px; padding-bottom:11px; } + .mix_textbox #company, .mix_textbox #return_customer, .mix_textbox #return_company, .mix_textbox .order_ajax_item_title{ height:42px; } + .list_item_sub { margin-bottom: 35px; } + .list_item_date_span{right:inherit;left:5px;top:45px;} + .dashboard-tab{ width: 33%; } + .dashboard_chart .col-sm-6:first-child{ margin-bottom:40px } +} +@media only screen and (max-width:479px){ + #check_domain_input{padding-right:20px;} + .check_domain_form .select2, #check_domain_button{ position:relative; right:0; width:100% !important; margin-top:10px; } +} \ No newline at end of file diff --git a/css/css_employment.css b/css/css_employment.css new file mode 100644 index 0000000..13970f1 --- /dev/null +++ b/css/css_employment.css @@ -0,0 +1,3391 @@ +@import url(https://fonts.googleapis.com/css?family=Lato:400,900italic,900,700italic,700,400italic,300italic,100italic,300&subset=latin,latin-ext); + + +/** + * html5doctor.com Reset Stylesheet v1.6.1 (http://html5doctor.com/html-5-reset-stylesheet/) + * Richard Clark (http://richclarkdesign.com) + * http://cssreset.com + */ +html, body, div, span, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +abbr, address, cite, code, +del, dfn, em, img, ins, kbd, q, samp, +small, strong, sub, sup, var, +b, i, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, figcaption, figure, +footer, header, hgroup, menu, nav, section, summary, +time, mark, audio, video { + margin:0; + padding:0; + outline:0; + vertical-align:baseline; + background:transparent; +} +table, tbody, tfooter, tr, th, td{ + vertical-align:middle; +} +body { + font-size: 16px; + line-height: 1.5; + color: #000; + font-weight: 300; +} +article,aside,details,figcaption,figure, +footer,header,hgroup,menu,nav,section { + display:block; +} +nav ul { + list-style:none; +} +blockquote, q { + quotes:none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content:''; + content:none; +} +a { + margin:0; + padding:0; + font-size:100%; + vertical-align:baseline; + background:transparent; +} +/* change colours to suit your needs */ +ins { + background-color:#ff9; + color:#000; + text-decoration:none; +} +/* change colours to suit your needs */ +mark { + background-color:#ff9; + color:#000; + font-style:italic; + font-weight:bold; +} +del { + text-decoration: line-through; +} +abbr[title], dfn[title] { + border-bottom:1px dotted; + cursor:help; +} +table { + border-collapse:collapse; + border-spacing:0; +} +/* change border colour to suit your needs */ +hr { + display:block; + height:1px; + border:0; + border-top:1px solid #cccccc; + margin:1em 0; + padding:0; +} +input, select { + vertical-align:middle; +} + +input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select{ + width: 100%; + padding: 8px; + margin: 0 0 5px; + display:block; + border: 1px solid #d9d9d9; + border-top: 1px solid #c0c0c0; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +input[type="text"]:hover, input[type="email"]:hover, input[type="password"]:hover, textarea:hover, select:hover{ + -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); + -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); + box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); +} + +.page_loader{ + position: fixed; + left: 0px; + top: 0px; + width: 100%; + height: 100%; + z-index: 999999; + background: rgb(249,249,249); +} +.page_loader img{ + position: absolute; + top: 35%; + left: 50%; + width: 280px; + margin-left: -140px; + + -webkit-animation: page_loader 1s infinite; /* Safari 4+ */ + -moz-animation: page_loader 1s infinite; /* Fx 5+ */ + -o-animation: page_loader 1s infinite; /* Opera 12+ */ + animation: page_loader 1s infinite; /* IE 10+, Fx 29+ */ +} +@-webkit-keyframes page_loader { + 0% { opacity: 1; } + 50% { opacity: 0.6; } + 100% { opacity: 1; } +} +@-moz-keyframes page_loader { + 0% { opacity: 1; } + 50% { opacity: 0.6; } + 100% { opacity: 1; } +} +@-o-keyframes page_loader { + 0% { opacity: 1; } + 50% { opacity: 0.6; } + 100% { opacity: 1; } +} +@keyframes page_loader { + 0% { opacity: 1; } + 50% { opacity: 0.6; } + 100% { opacity: 1; } +} +/* style columns css */ +.row { + width: 100%; + max-width: 980px; + min-width: 320px; + margin: 0 auto; + padding:0 22px; +} +.row.row-full, .row.row-full-padding-0 { + max-width:100%; +} +.row .row { + min-width: 0; + padding-left: 0; + padding-right: 0; +} +/* To fix the grid into a different size, set max-width to your desired width */ +.columns { + margin-left: 2.12766%; + float: left; + min-height: 1px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.columns:first-child{ + margin-left: 0; +} +/* Column Classes */ +.row .one.columns { + width: 6.38298%; +} +.row .two.columns { + width: 14.89362%; +} +.row .three.columns { + width: 23.40426%; +} +.row .reset_three.columns{ + width: 26.00426%; +} +.row .four.columns { + width: 31.91489%; +} +.row .five.columns { + width: 40.42553%; +} +.row .six.columns { + width: 48.93617%; +} +.row .seven.columns { + width: 57.44681%; +} +.row .eight.columns { + width: 65.95745%; +} +.row .nine.columns { + width: 74.46809%; +} +.row .reset_nine.columns{ + width: 71.86808%; +} +.row .ten.columns { + width: 82.97872%; +} +.row .eleven.columns { + width: 91.48936%; +} +.row .twelve.columns { + width: 100%; +} +.row, .clearfix { + *zoom: 1; +} +.row:before, .row:after, .clearfix:before, .clearfix:after, .wrapper:before, .wrapper:after{ + content: ""; + display: table; +} +.row:after, .clearfix:after, .wrapper:after{ + clear: both; +} +.float_right{ + float:right; +} +.ajax_loading, #ajax_loading{ + position:absolute; + margin-left:10px; + margin-top:15px; + display:none; +} +.margin_20{ + margin-top:20px; +} +/* header bar */ + +.header_bar{ + position: absolute; + top: 0; + right: 0; + left: 0; + z-index: 99999; + display: block; + margin: 0; + width: 100%; + height: 48px; + max-height: 44px; + background: #323232; + background: rgba(0,0,0,0.8); + font-size: 18px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.header_category_bar{ + position: absolute; + width: 100%; + top: 44px; + z-index: 100; + background: rgba(242,242,242,0.6); + height: 110px; + max-width: 100%; +} + +.header_content{ + position: relative; + height: 100%; + margin: 0 auto; +} + +.header_navigation{ + cursor: default; + margin: 0 auto; + text-align: justify; + width: auto; + height: 44px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + text-align: justify; + -ms-text-justify: distribute-all-lines; + text-justify: distribute-all-lines; + text-transform:uppercase; +} + +.navigation_li{ + display: inline-block; + position: relative; + height: 44px; + z-index: 1; + vertical-align: top; +} +.navigation_search_li{ + padding:0 15px; +} +.navigation_li a{ + font-size: 16px; + line-height: 2.75; + font-weight: 100; + letter-spacing: normal; + opacity: 1; + -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=$ieopacity)'; + filter: alpha(opacity=100); + color: #fff; + position: relative; + z-index: 1; + display: inline-block; + padding: 0 25px; + height: 44px; + background: no-repeat; + text-decoration: none; + white-space: nowrap; + -webkit-transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + -webkit-tap-highlight-color: transparent; + outline-offset: -7px; +} +.navigation_li a.navigation_search_link{ + -webkit-transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + opacity: 1; + background-repeat: no-repeat; + background-size: 15px 15px; + background-image: url("../images/search_icon.png"); + background-position: 18px 50%; + background-repeat: no-repeat; + -webkit-transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + outline: 0; +} +.navigation_li a.navigation_shopping_bag{ + -webkit-transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + opacity: 1; + background-repeat: no-repeat; + background-size: 15px 15px; + background-image: url("../images/shopper_icon.png"); + background-position: 18px 54%; + background-repeat: no-repeat; + -webkit-transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + outline: 0; +} +.navigation_li a.navigation_shopping_bag_item{ + background-image: url("../images/shopper_item_icon.png"); +} +.navigation_logo{ + width:100px; + margin-right:20px; +} + +.navigation_logo a{ + padding:0; +} +.navigation_logo img{ + width: 100%; + display: block; +} +.header_logo_mobile, .mobile_view{ + display:none; +} +.search_bar_view{ + display:none; +} +.search_bar_view_content{ + box-sizing: content-box; + margin: 0; + padding: 0; + pointer-events: auto; + letter-spacing: normal; + position: absolute; + top: 0; + left: 16.66667%; + width: 66.66667%; + height: 44px; + z-index: 3; +} +.search_bar_view_form{ + height: 44px; + line-height: 44px; +} +.search_bar_view_form_wrapper{ + padding-left: 40px; + position: relative; + z-index: 2; +} +input[type="text"].search_bar_view_form_input{ + border: none; + background-color: transparent; + font-size: 14px; + line-height: 44px; + font-weight: 200; + letter-spacing: normal; + color: #fff; + outline: none; + width: 100%; + height: 44px; + padding:0; + margin:0; + display:block; +} +.search_bar_view_form_submit{ + border: none; + background-color: transparent; + position: absolute; + z-index: 1; + top: 0; + left: 0; + width: 40px; + height: 44px; + cursor: pointer; + -webkit-transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + opacity: 1; + background-repeat: no-repeat; + background-size: 15px 15px; + background-image: url("../images/search_icon.png"); + background-position: 10px 50%; + background-repeat: no-repeat; + -webkit-transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + outline:0; +} +.search_bar_view_form_submit:hover{ + opacity:0.65; +} +#search_bar_view_close{ + opacity: 1; + -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=$ieopacity)'; + filter: alpha(opacity=100); + position: absolute; + z-index: 3; + width: 38px; + height: 44px; + right: 12px; + top: 0; + color: #fff; + cursor: pointer; + -webkit-transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + -webkit-tap-highlight-color: transparent; + + border: 0; + background: transparent; + outline: none; +} +#search_bar_view_close:hover{ + opacity:0.65; +} +.search_bar_view_close_wrapper{ + display: block; + width: 100%; + height: 100%; +} +.search_bar_view_close_left, .search_bar_view_close_right{ + height: 18px; + width: 1px; + background: #fff; + position: absolute; + display: block; + top: 11px; + z-index: 1; +} +.search_bar_view_close_left{ + right: 12px; + -webkit-transform: scale3d(1, 0.65, 1); + transform: scale3d(1, 0.65, 1); + -webkit-transform-origin: 0 100%; + transform-origin: 0 100%; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); +} +.search_bar_view_close_right{ + left: 12px; + -webkit-transform: scale3d(1, 0.65, 1); + transform: scale3d(1, 0.65, 1); + -webkit-transform-origin: 100% 100%; + transform-origin: 100% 100%; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); +} +/* end header bar + +/* content */ +.section_container{ + margin-top:44px; +} +.has_header_category{ + margin-top:154px; +} +ul li.keyb { + display:block; + margin:0; + padding:0; + position:relative; + border-bottom: 2px solid #fff; +} + +ul li.keyb > .section{ + padding:50px 0; +} +.default_image_420{ + width:420px; +} + +.section_default_setting > .section_content > .alphagrid-row-content, .product_box{ + border-bottom: 2px solid #fff; + padding-top:44px; + padding-bottom:44px; +} +.section_default_setting > .section_content > .alphagrid-row-content.row-full-padding-0{ + padding:0; + width:100%; +} +.delivery_by_file, .received_by_file { + border: 1px solid #ccc; + display: block; +} +/* end content */ + +/* content */ +.section_page_title, h1{ + font-size:50px; + margin: 120px 0 20px 0; + text-align:center; + font-weight: 300; + color: #474747; + line-height: 60px; + letter-spacing: 2px; + word-spacing: 6px; + text-transform: uppercase; +} +.section_contact .section_page_title, h1{ + margin-top:80px; +} +.social_share_ul{ + list-style: none; + display: block; + margin: 0px; + padding: 0px; + width: 32px; + left: 0px; + position: fixed; + margin-top:200px; + z-index:99999; +} +.social_share_ul li{ + text-indent: -100000px; + width: 32px; + height: 32px; + cursor: pointer; + + -webkit-transition: width 0.1s ease-in-out; + -moz-transition: width 0.1s ease-in-out; + -ms-transition: width 0.1s ease-in-out; + -o-transition: width 0.1s ease-in-out; + transition: width 0.1s ease-in-out; +} +.social_share_ul .facebook{ + background: url(../images/share_icons.jpg) no-repeat -42px 0px; +} +.social_share_ul .facebook:hover{ + background: url(../images/share_icons.jpg) no-repeat -3px 0px; + width: 38px; +} +.social_share_ul .twitter{ + background: url(../images/share_icons.jpg) no-repeat -42px -34px; +} +.social_share_ul .twitter:hover{ + background: url(../images/share_icons.jpg) no-repeat -3px -34px; + width: 38px; +} +.social_share_ul .gplus{ + background: url(../images/share_icons.jpg) no-repeat -42px -68px; +} +.social_share_ul .gplus:hover{ + background: url(../images/share_icons.jpg) no-repeat -3px -68px; + width: 38px; +} +/* end content */ + +.ajax_return_box{ + position: fixed; + width: 100%; + height: 100%; + top: 0; + left:0; + z-index:99999; + display:none; +} +.bg_background_hide{ + background: #000; + opacity: 0.6; + position: absolute; + width: 100%; + height: 100%; + top: 0; + left:0; + z-index:1; +} +.new_order_image{ + position: relative; + z-index: 2; + left: 50%; + top: 50%; + margin-left: -150px; + margin-top: -95px; +} +.cart_success, .cart_success_show, .cart_error, .voucher_success, .voucher_error{ + background-color: #e3f8e2; + border: 1px solid #b7d5a1; + color: #6fab43; + padding: 10px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + margin-bottom: 30px; + display:none; +} +.cart_success_show{ + display:block; +} +.cart_error, .voucher_error{ + background-color:#ffa9b0; + border-color:#ff2a3b; + color:#f00; +} + +.birthday_box select{ + float:left; + width:32%; + margin-left:2%; +} +.birthday_box select:first-child{ + margin-left:0; +} +.register_gender{ + height:34px; +} +.register_gender input[type="radio"]{ + margin:0 3px 0 0; +} +.register_gender label{ + margin-right:15px; +} +.employee_application_form{ + width:98%; + max-width:980px; + padding: 0 1%; + margin:0 auto; +} +/* promotion columns */ + +.promo_box{ + max-width: 2560px; + margin: 0 auto; +} +.promo_box ul{ + margin: 0; + position: relative; + z-index: 1; +} +.promo_box li{ + list-style: none; + position: relative; + z-index: 1; + min-height: 2px; + margin: 0; + padding: 0; + float: left; + width: 25%; +} +.promo_box li a{ + display: block; + min-height: 200px; + font: 0/0 a; + color: transparent; + background-position: top center; + background-repeat: no-repeat; + border-left: 1px solid #fff; + border-right: 1px solid #fff; + width: 640px; + height: 200px; + width: auto; +} +.promo_box li.promo_item_1 a{ + border-left: none; +} +.promo_box li.promo_item_4 a{ + border-right:0; +} +.promo_item_1{ + background-image: url("../images/promo_1.jpg"); + background-size: 640px 200px; + background-position: center center; + background-repeat:no-repeat; +} +.promo_item_2{ + background-image: url("../images/promo_2.jpg"); + background-size: 640px 200px; + background-position: center center; + background-repeat:no-repeat; +} +.promo_item_3{ + background-image: url("../images/promo_3.jpg"); + background-size: 640px 200px; + background-position: center center; + background-repeat:no-repeat; +} +.promo_item_4{ + background-image:url("../images/promo_4.jpg"); + background-size: 640px 200px; + background-position: center center; + background-repeat:no-repeat; +} + +/* end promotion columns */ + +/* product page */ +.product_image_column img{ + width:100%; + display:block; +} +.product_price{ + font-size:22px; + font-weight:bold; +} +/* google map */ +#map{ + margin-top:44px; + width:100%; + height:450px; +} +.disabled_map{ + position:absolute; + width:100%; + height:100%; + top:0; +} +/* end google maps */ + +/* sitemap */ +.section_site_map{ + font-size: 13px; + line-height: 1.66667; + font-weight: 400; + letter-spacing: normal; + position: relative; + z-index: 1; + padding:50px 0; + +} +.site_map_box_title{ + font-size:14px; + line-height: 1.66667; + font-weight: 600; + letter-spacing: normal; + color: #333; + margin: 0; +} +.site_map_box_ul{ + list-style: none; + margin-right: 20px; + padding: 0; +} +.site_map_box_ul li{ + display: block; + pointer-events: auto; +} +.site_map_box_ul li a{ + color: #666; + text-decoration: none; +} +/* sitemap */ + +/* header shopping bag */ +.navigation_shopping_bag_li{ + float:right; +} +.shopping_bag_box{ + margin-right: -141px; + position: absolute; + top: 48px; + right: 0; + z-index: 1; + letter-spacing: normal; + border: 1px solid #d6d6d6; + border-radius: 2px; + width: 288px; + font-size: 15px; + line-height: 1.23333; + font-weight: 400; + letter-spacing: normal; + background: #fff; + min-height: 90px; + padding: 0 20px; + display:none; +} +.shopping_bag_cart{ + box-sizing: content-box; + padding: 0; + letter-spacing: normal; + color: #999; + line-height: 90px; + margin: 0; + text-align: center; + border-bottom: 1px solid #e3e3e3; +} +.shopping_bag_box_ul{ + margin: 0; + padding: 0; + list-style: none; +} +.shopping_bag_box_ul li{ + margin: 0; + padding: 0; + border-top: 1px solid #e3e3e3; +} +.shopping_bag_box_ul li:first-child{ + border-top:0; +} +.shopping_bag_box_ul li a{ + color: #08c; + display: block; + line-height: 44px; + padding: 0 30px 0 0; + text-decoration: none; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-weight:300; +} +.shopping_bag_box_ul li span{ + padding-left:15px; +} +.shopping_bag_box_ul li a:hover span{ + text-decoration: underline; +} +.shopping_bag_box_caret{ + box-sizing: content-box; + margin: 0; + padding: 0; + pointer-events: auto; + letter-spacing: normal; + overflow: hidden; + position: absolute; + bottom: -5px; + left: 0; + width: 100%; + height: 10px; + z-index: 1; + top:0; + margin-top:-10px; +} +.shopping_bag_box_caret:after{ + border: 1px solid; + content: ""; + display: block; + position: absolute; + background: #fff; + border-color: #d6d6d6; + top: 0; + left: 50%; + width: 12px; + height: 12px; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + z-index: 1; +} +.shopping_bag_view{ + box-sizing: content-box; + margin: 0; + padding: 0; + letter-spacing: normal; + list-style: none; +} +.shopping_bag_view_li{ + border-top: 1px solid #e3e3e3; + padding-top: 8px; +} +.shopping_bag_view_li:first-child{ + border-top:0; +} +.shopping_bag_view_link{ + margin: 0; + padding: 0; + display: table; + width: 100%; + color: #333; + text-decoration: none; +} +.shopping_bag_view_image{ + display: table-cell; + vertical-align: middle; + min-height: 56px; + padding: 15px 14px 15px 4px; + width: 25%; +} +.shopping_bag_view_picture{ + border: 0; + vertical-align: middle; + max-width: 56px; + height: auto; +} +.shopping_bag_view_title{ + display: table-cell; + vertical-align: middle; + min-height: 56px; + padding: 15px 0; + width: 75%; +} +.shopping_bag_view_remove{ + display: table-cell; + vertical-align: middle; + min-height: 56px; + padding: 15px 14px 15px 4px; + width: 25%; +} +.shopping_bag_view_remove:hover{ + color:#d44457; +} +.shopping_bag_request_quotation .custom_button{ + width:100%; + padding-left:0; + padding-right:0; + text-align:center; + margin-bottom:10px; +} +.shopping_bag_view_line{ + margin: 0; + color: #999; + font-size: 12px; + line-height: 1.33333; + font-weight: 400; + letter-spacing: normal; + text-align: center; +} +.shopping_bag_view_line:before{ + display: block; + position: relative; + top: 9px; + margin-top: -1px; + z-index: -10; + border-bottom: 1px solid #e3e3e3; + content: ""; +} +.shopping_bag_view_line_text{ + padding: 0 8px; + background: #fff; +} +.product_title_link{ + color:inherit; + text-decoration:none; +} +.product_title_link:hover{ + text-decoration: none; + color: #d44457; +} +/* user login account */ +#password_error, #capcha_error, #email_error, #username_error, #block_error, #email_home_error, #block_home_error { + display: none; + margin-bottom: 10px; + color: #f00; + font-size:16px; +} +.forgot_password{ + font-size:16px; + text-decoration:none; +} +.forgot_password:hover{ + text-decoration:underline; +} +.display_none{ + display:none; +} +/* ----- CSS ----- */ + +html, body { + font-family: 'lato', Helvetica, Arial, 'Sans-serif'; + width: 100%; + height: 100%; +} + +.wrapper { + position: relative; + width: 100%; + height: 100%; + margin: 0 auto; +} + + +.formobile { + display: none; +} + +/* ----- MENU ----- */ + +.dotstyle { + position: fixed; + right: 20px; + height: 176px; + top: 50%; + margin-top: -88px; + opacity: 0; + z-index: 20000; +} + +.dotstyle ul { + width: 16px; + display: inline-block; + margin: 0; + padding: 0; + list-style: none; + cursor: default; + -webkit-touch-callout: none; + -webkit-user-select: none; + -o-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.dotstyle li { + position: relative; + display: block; + float: left; + margin: 16px 0; + width: 10px; /*mod1*/ + height: 10px; /*mod1*/ + border-radius: 5px; + background: #e0e0e0; + -webkit-touch-callout: none; + -webkit-user-select: none; + -o-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.dotstyle li a { + top: 0; + left: 0; + width: 100%; + height: 100%; + outline: none; + border-radius: 50%; + text-indent: -999em; + pointer-events: none; + position: absolute; +} + +.dotstyle li a:focus { + outline: none; +} + +.dotstyle .active { + background-color: rgba(0,0,0,.4); +} + + + + + + + + +/* ----- POPUP ----- */ + +.md-modal { + position: fixed; + top: 50%; + left: 50%; + width: 50%; + max-width: 630px; + min-width: 320px; + height: auto; + z-index: 190000; + visibility: hidden; + background: white; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-transform: translateX(-50%) translateY(-50%); + -moz-transform: translateX(-50%) translateY(-50%); + -ms-transform: translateX(-50%) translateY(-50%); + transform: translateX(-50%) translateY(-50%); +} + +.md-show { + visibility: visible; +} + +.md-overlay { + position: fixed; + width: 100%; + height: 100%; + visibility: hidden; + top: 0; + left: 0; + z-index: 180000; + opacity: 0; + background: white; + -webkit-transition: all 0.3s; + -moz-transition: all 0.3s; + transition: all 0.3s; +} + +.md-show ~ .md-overlay { + opacity: 1; + visibility: visible; +} + + +/* ----- TAILLE SECTION ----- */ + + +#typo, +#brightness, +#exposure, +#before-after{ + overflow: hidden; + height: 100%; +} + + + +/* ----- HEADER ----- */ + +.section { + position: relative; +} + + #brightness, .section_site_map { + background:#f8f8f8; + } + + + +/* ----- HEADER ----- */ + + +/* ----- ECRANS ----- */ + +.fade { + opacity: 1; +} + +section .info_left{ + margin:0; +} + +.contact_info { + font-size: 20px; + line-height: 1.5; + color: #666766; + font-weight: 100; +} + +.contact_info{ + font-size:18px; +} + +.contact_info a{ + text-decoration:none; + color:inherit; +} + +section .info h1, h1, h2, h3, h4, h5, h6 { + font-size: 25px; + font-weight: 300; + color: #474747; + letter-spacing: 2px; /*3px*/ + word-spacing: 6px; + text-transform: uppercase; + margin-bottom:25px; +} +h1{ + font-size:60px; +} +h2{ + font-size:45px; +} +h3{ + font-size:38px; +} +h4{ + font-size:25px; +} +h5{ + font-size:20px; +} +h6{ + font-size:16px; +} +p.form_success { + display: none; + color: #004402; + margin-bottom: 20px; + font-size: 16px; + font-weight: bold; +} +input[type="text"].error, input[type="password"].error, input[type="email"].error, input[type="number"].error, textarea.error, select.error { + border: 1px solid #f00 !important; + text-align:left; +} +input[type="checkbox"].error, input[type="radio"].error{ + outline: 1px auto red; +} +/*mod1*/ +span.icons { + margin-top: 20px; + display: block; + width: 250px; + height: 42px; } + + +/* TEXT */ + +/*mod1*/ +span.icon-text { + background: url(../images/icon-text.png) no-repeat center center; +} +span.icon-img { + background: url(../images/icon-img.png) no-repeat center center; +} + + +/* BEFORE/AFTER */ + +#before-after { + background: #f8f8f8; + position: relative; + z-index: 10000; +} + +#bef-af { + position: relative; + top: 50%; + -webkit-transform: translateY(-50%) translateX(-50%); + -moz-transform: translateY(-50%) translateX(-50%); + -ms-transform: translateY(-50%) translateX(-50%); + -o-transform: translateY(-50%) translateX(-50%); + transform: translateY(-50%) translateX(-50%); + left:15.2%; + width: 500px; + height: 600px; + -webkit-transition: all .4s ease-in; + -moz-transition: all .4s ease-in; + -ms-transition: all .4s ease-in; + -o-transition: all .4s ease-in; + transition: all .4s ease-in; + z-index: 6000; +} + + +#bef-af img { + position: relative; + z-index: 2000; + pointer-events:none; +} + +.full { + position: relative; + background-position: center center; + background-attachment: fixed; + background-repeat: no-repeat; + width: 84%; + height: 425px; +} + +.droite { + background:transparent; + position: absolute; + top: 0; + left: 0; + background-image: url(../images/droite1.jpg); + margin: 89px 0px 0px 24px; + overflow: hidden; + height: 425px; +} + +.gauche { + height: 425px; + position: relative; + background: transparent; + background-image: url(../images/gauche.jpg); + width: 50%; +} + + + +#handle { + position: absolute; + top: 50%; + width: 20px; + height: 20px; + border-radius: 50px; + right: -10px; +} + +.pulse { + width: 10px; + height: 10px; + border: 5px solid rgba(255,255,255,.8); + -webkit-border-radius: 30px; + -moz-border-radius: 30px; + -ms-border-radius: 30px; + -o-border-radius: 30px; + border-radius: 30px; + background-color: rgba(255,255,255,.7); + z-index: 10; + position: absolute; +} + +.dot { + border: 10px solid #fff; + background: transparent; + -webkit-border-radius: 60px; + -moz-border-radius: 60px; + -ms-border-radius: 60px; + -o-border-radius: 60px; + border-radius: 60px; + height: 50px; + width: 50px; + -webkit-animation: pulse 3s ease-out; + -moz-animation: pulse 3s ease-out; + -ms-animation: pulse 3s ease-out; + -o-animation: pulse 3s ease-out; + animation: pulse 3s ease-out; + -webkit-animation-iteration-count: infinite; + -moz-animation-iteration-count: infinite; + -ms-animation-iteration-count: infinite; + -o-animation-iteration-count: infinite; + animation-iteration-count: infinite; + position: absolute; + top: -25px; + left: -25px; + z-index: 1; + opacity: 0; +} + +@-moz-keyframes pulse { + 0% {-moz-transform: scale(0); opacity: 0.0; } + 25% {-moz-transform: scale(0); opacity: 0.1; } + 50% {-moz-transform: scale(0.1); opacity: 0.3; } + 75% {-moz-transform: scale(0.5); opacity: 0.5; } + 100% {-moz-transform: scale(1); opacity: 0.0; } +} + +@-ms-keyframes pulse { + 0% {-ms-transform: scale(0); opacity: 0.0; } + 25% {-ms-transform: scale(0); opacity: 0.1; } + 50% {-ms-transform: scale(0.1); opacity: 0.3; } + 75% {-ms-transform: scale(0.5); opacity: 0.5; } + 100% {-ms-transform: scale(1); opacity: 0.0; } +} + +@-o-keyframes pulse { + 0% {-o-transform: scale(0); opacity: 0.0; } + 25% {-o-transform: scale(0); opacity: 0.1; } + 50% {-o-transform: scale(0.1); opacity: 0.3; } + 75% {-o-transform: scale(0.5); opacity: 0.5; } + 100% {-o-transform: scale(1); opacity: 0.0; } +} + +@-webkit-keyframes pulse { + 0% {-webkit-transform: scale(0); opacity: 0.0; } + 25% {-webkit-transform: scale(0); opacity: 0.1; } + 50% {-webkit-transform: scale(0.1); opacity: 0.3; } + + 75% {-webkit-transform: scale(0.5); opacity: 0.5; } + 100% {-webkit-transform: scale(1); opacity: 0.0; } +} + +@keyframes pulse { + 0% {transform: scale(0); opacity: 0.0; } + 25% {transform: scale(0); opacity: 0.1; } + 50% {transform: scale(0.1); opacity: 0.3; } + 75% {transform: scale(0.5); opacity: 0.5; } + 100% {transform: scale(1); opacity: 0.0; } +} + + +.tools { + position: relative; + float: right; +} + +.tools nav ul { + position: absolute; + bottom: 0; +} + +.tools nav ul li a { + float: right: ; + width: 50px; + height: 50px; + border-radius: 25px; +} + +footer { + position: relative; + text-align: center; + padding: 50px; + text-decoration: none; + z-index: 25000; + text-transform: uppercase; + background: #fff; +} + +footer h1 { + margin: 0 0 50px 0; +} +footer h1 a { + display: block; + width: auto; + margin: 10px auto 0 auto; + font-size: 14px; + color: #aaa; + letter-spacing: 1px; + text-decoration: none; + font-weight: 100; +} +.footer_logo{ + width:200px; +} +.footer_logo img{ + width:100%; +} +.heart { + font-size: 15px; + color: lightpink; +} + +footer p, footer p a { + -webkit-font-smoothing:antialiased; + -moz-font-smoothing:antialiased; + -ms-font-smoothing:antialiased; + -o-font-smoothing:antialiased; + font-smoothing:antialiased; + font-family: 'lato', Helvetica, Arial, Sans-serif; + font-size: 12px; + color: #AAAAAA; + font-weight: 400; + text-decoration: none; +} + +footer p a:hover { + color:#d85667; +} +/*custom*/ +label.checkbox_language { + float: left; + width: 33%; +} +.photo_box_right { + width:120px; + padding:3px; + border:2px solid #000; + margin-left:10px; + margin-bottom:8px; + position:relative; +} +.form_box_title{ + width:200px; + padding:5px; + border-bottom:2px solid #000; + font-size:16px; + margin-bottom:8px; + font-weight: bold; +} + +.xdsoft_datetimepicker{box-shadow:0 5px 15px -5px rgba(0,0,0,.506);background:#fff;border-bottom:1px solid #bbb;border-left:1px solid #ccc;border-right:1px solid #ccc;border-top:1px solid #ccc;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;padding:2px 8px 8px 0;position:absolute;z-index:9999;-moz-box-sizing:border-box;box-sizing:border-box;display:none}.xdsoft_datetimepicker.xdsoft_rtl{padding:8px 0 8px 8px}.xdsoft_datetimepicker iframe{position:absolute;left:0;top:0;width:75px;height:210px;background:0 0;border:none}.xdsoft_datetimepicker button{border:none!important}.xdsoft_noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.xdsoft_noselect::selection{background:0 0}.xdsoft_noselect::-moz-selection{background:0 0}.xdsoft_datetimepicker.xdsoft_inline{display:inline-block;position:static;box-shadow:none}.xdsoft_datetimepicker *{-moz-box-sizing:border-box;box-sizing:border-box;padding:0;margin:0}.xdsoft_datetimepicker .xdsoft_datepicker,.xdsoft_datetimepicker .xdsoft_timepicker{display:none}.xdsoft_datetimepicker .xdsoft_datepicker.active,.xdsoft_datetimepicker .xdsoft_timepicker.active{display:block}.xdsoft_datetimepicker .xdsoft_datepicker{width:224px;float:left;margin-left:8px}.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_datepicker{float:right;margin-right:8px;margin-left:0}.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_datepicker{width:256px}.xdsoft_datetimepicker .xdsoft_timepicker{width:58px;float:left;text-align:center;margin-left:8px;margin-top:0}.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker{float:right;margin-right:8px;margin-left:0}.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker{margin-top:8px;margin-bottom:3px}.xdsoft_datetimepicker .xdsoft_mounthpicker{position:relative;text-align:center}.xdsoft_datetimepicker .xdsoft_label i,.xdsoft_datetimepicker .xdsoft_next,.xdsoft_datetimepicker .xdsoft_prev,.xdsoft_datetimepicker .xdsoft_today_button{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC)}.xdsoft_datetimepicker .xdsoft_label i{opacity:.5;background-position:-92px -19px;display:inline-block;width:9px;height:20px;vertical-align:middle}.xdsoft_datetimepicker .xdsoft_prev{float:left;background-position:-20px 0}.xdsoft_datetimepicker .xdsoft_today_button{float:left;background-position:-70px 0;margin-left:5px}.xdsoft_datetimepicker .xdsoft_next{float:right;background-position:0 0}.xdsoft_datetimepicker .xdsoft_next,.xdsoft_datetimepicker .xdsoft_prev,.xdsoft_datetimepicker .xdsoft_today_button{background-color:transparent;background-repeat:no-repeat;border:0;cursor:pointer;display:block;height:30px;opacity:.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";outline:0;overflow:hidden;padding:0;position:relative;text-indent:100%;white-space:nowrap;width:20px;min-width:0}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev{float:none;background-position:-40px -15px;height:15px;width:30px;display:block;margin-left:14px;margin-top:7px}.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_next,.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_prev{float:none;margin-left:0;margin-right:14px}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev{background-position:-40px 0;margin-bottom:7px;margin-top:0}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box{height:151px;overflow:hidden;border-bottom:1px solid #ddd}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div{background:#f5f5f5;border-top:1px solid #ddd;color:#666;font-size:12px;text-align:center;border-collapse:collapse;cursor:pointer;border-bottom-width:0;height:25px;line-height:25px}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div:first-child{border-top-width:0}.xdsoft_datetimepicker .xdsoft_next:hover,.xdsoft_datetimepicker .xdsoft_prev:hover,.xdsoft_datetimepicker .xdsoft_today_button:hover{opacity:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"}.xdsoft_datetimepicker .xdsoft_label{display:inline;position:relative;z-index:9999;margin:0;padding:5px 3px;font-size:14px;line-height:20px;font-weight:700;background-color:#fff;float:left;width:182px;text-align:center;cursor:pointer}.xdsoft_datetimepicker .xdsoft_label:hover>span{text-decoration:underline}.xdsoft_datetimepicker .xdsoft_label:hover i{opacity:1}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select{border:1px solid #ccc;position:absolute;right:0;top:30px;z-index:101;display:none;background:#fff;max-height:160px;overflow-y:hidden}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select.xdsoft_monthselect{right:-7px}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select.xdsoft_yearselect{right:2px}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option:hover{color:#fff;background:#ff8000}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option{padding:2px 10px 2px 5px;text-decoration:none!important}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option.xdsoft_current{background:#3af;box-shadow:#178fe5 0 1px 3px 0 inset;color:#fff;font-weight:700}.xdsoft_datetimepicker .xdsoft_month{width:100px;text-align:right}.xdsoft_datetimepicker .xdsoft_calendar{clear:both}.xdsoft_datetimepicker .xdsoft_year{width:48px;margin-left:5px}.xdsoft_datetimepicker .xdsoft_calendar table{border-collapse:collapse;width:100%}.xdsoft_datetimepicker .xdsoft_calendar td>div{padding-right:5px}.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th{width:14.2857142%;background:#f5f5f5;border:1px solid #ddd;color:#666;font-size:12px;text-align:right;vertical-align:middle;padding:0;border-collapse:collapse;cursor:pointer;height:25px}.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar th{width:12.5%}.xdsoft_datetimepicker .xdsoft_calendar th{background:#f1f1f1}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today{color:#3af}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_default{background:#ffe9d2;box-shadow:#ffb871 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_mint{background:#c1ffc9;box-shadow:#00dd1c 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current{background:#3af;box-shadow:#178fe5 0 1px 3px 0 inset;color:#fff;font-weight:700}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled,.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month,.xdsoft_datetimepicker .xdsoft_time_box>div>div.xdsoft_disabled{opacity:.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";cursor:default}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled{opacity:.2;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)"}.xdsoft_datetimepicker .xdsoft_calendar td:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div:hover{color:#fff!important;background:#ff8000!important;box-shadow:none!important}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current.xdsoft_disabled:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current.xdsoft_disabled:hover{background:#3af!important;box-shadow:#178fe5 0 1px 3px 0 inset!important;color:#fff!important}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_disabled:hover{color:inherit !important;background:inherit!important;box-shadow:inherit!important}.xdsoft_datetimepicker .xdsoft_calendar th{font-weight:700;text-align:center;color:#999;cursor:default}.xdsoft_datetimepicker .xdsoft_copyright{color:#ccc!important;font-size:10px;clear:both;float:none;margin-left:8px}.xdsoft_datetimepicker .xdsoft_copyright a{color:#eee!important}.xdsoft_datetimepicker .xdsoft_copyright a:hover{color:#aaa!important}.xdsoft_time_box{position:relative;border:1px solid #ccc}.xdsoft_scrollbar>.xdsoft_scroller{background:#ccc!important;height:20px;border-radius:3px}.xdsoft_scrollbar{position:absolute;width:7px;right:0;top:0;bottom:0;cursor:pointer}.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_scrollbar{left:0;right:auto}.xdsoft_scroller_box{position:relative}.xdsoft_datetimepicker.xdsoft_dark{box-shadow:0 5px 15px -5px rgba(255,255,255,.506);background:#000;border-bottom:1px solid #444;border-left:1px solid #333;border-right:1px solid #333;border-top:1px solid #333;color:#ccc}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box{border-bottom:1px solid #222}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box>div>div{background:#0a0a0a;border-top:1px solid #222;color:#999}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label{background-color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label>.xdsoft_select{border:1px solid #333;background:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label>.xdsoft_select>div>.xdsoft_option:hover{color:#000;background:#007fff}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label>.xdsoft_select>div>.xdsoft_option.xdsoft_current{background:#c50;box-shadow:#b03e00 0 1px 3px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label i,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_next,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_prev,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_today_button{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUExQUUzOTA0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUExQUUzOTE0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQTFBRTM4RTQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQTFBRTM4RjQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp0VxGEAAAIASURBVHja7JrNSgMxEMebtgh+3MSLr1T1Xn2CHoSKB08+QmR8Bx9A8e7RixdB9CKCoNdexIugxFlJa7rNZneTbLIpM/CnNLsdMvNjM8l0mRCiQ9Ye61IKCAgZAUnH+mU3MMZaHYChBnJUDzWOFZdVfc5+ZFLbrWDeXPwbxIqrLLfaeS0hEBVGIRQCEiZoHQwtlGSByCCdYBl8g8egTTAWoKQMRBRBcZxYlhzhKegqMOageErsCHVkk3hXIFooDgHB1KkHIHVgzKB4ADJQ/A1jAFmAYhkQqA5TOBtocrKrgXwQA8gcFIuAIO8sQSA7hidvPwaQGZSaAYHOUWJABhWWw2EMIH9QagQERU4SArJXo0ZZL18uvaxejXt/Em8xjVBXmvFr1KVm/AJ10tRe2XnraNqaJvKE3KHuUbfK1E+VHB0q40/y3sdQSxY4FHWeKJCunP8UyDdqJZenT3ntVV5jIYCAh20vT7ioP8tpf6E2lfEMwERe+whV1MHjwZB7PBiCxcGQWwKZKD62lfGNnP/1poFAA60T7rF1UgcKd2id3KDeUS+oLWV8DfWAepOfq00CgQabi9zjcgJVYVD7PVzQUAUGAQkbNJTBICDhgwYTjDYD6XeW08ZKh+A4pYkzenOxXUbvZcWz7E8ykRMnIHGX1XPl+1m2vPYpL+2qdb8CDAARlKFEz/ZVkAAAAABJRU5ErkJggg==)}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{background:#0a0a0a;border:1px solid #222;color:#999}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{background:#0e0e0e}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_today{color:#c50}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_default{background:#ffe9d2;box-shadow:#ffb871 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_mint{background:#c1ffc9;box-shadow:#00dd1c 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_current,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_default,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current{background:#c50;box-shadow:#b03e00 0 1px 3px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td:hover,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box>div>div:hover{color:#000!important;background:#007fff!important}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{color:#666}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright{color:#333!important}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a{color:#111!important}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a:hover{color:#555!important}.xdsoft_dark .xdsoft_time_box{border:1px solid #333}.xdsoft_dark .xdsoft_scrollbar>.xdsoft_scroller{background:#333!important}.xdsoft_datetimepicker .xdsoft_save_selected{display:block;border:1px solid #ddd!important;margin-top:5px;width:100%;color:#454551;font-size:13px}.xdsoft_datetimepicker .blue-gradient-button{font-family:museo-sans,"Book Antiqua",sans-serif;font-size:12px;font-weight:300;color:#82878c;height:28px;position:relative;padding:4px 17px 4px 33px;border:1px solid #d7d8da;background:-moz-linear-gradient(top,#fff 0,#f4f8fa 73%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(73%,#f4f8fa));background:-webkit-linear-gradient(top,#fff 0,#f4f8fa 73%);background:-o-linear-gradient(top,#fff 0,#f4f8fa 73%);background:-ms-linear-gradient(top,#fff 0,#f4f8fa 73%);background:linear-gradient(to bottom,#fff 0,#f4f8fa 73%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#fff', endColorstr='#f4f8fa', GradientType=0 )}.xdsoft_datetimepicker .blue-gradient-button:focus,.xdsoft_datetimepicker .blue-gradient-button:focus span,.xdsoft_datetimepicker .blue-gradient-button:hover,.xdsoft_datetimepicker .blue-gradient-button:hover span{color:#454551;background:-moz-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#f4f8fa),color-stop(73%,#FFF));background:-webkit-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:-o-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:-ms-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:linear-gradient(to bottom,#f4f8fa 0,#FFF 73%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f8fa', endColorstr='#FFF', GradientType=0 )} + + + +/*! + * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.5.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.5.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"} + + + +/************************************************ + responsive flexmenu +*************************************************/ +.flexmenu ul { + overflow: initial !important; +} +.header_menu { + border-top:3px solid #1283d2; + border-bottom:3px solid #1283d2; + position: relative; +} +.fm-button { + display: none; + box-sizing: border-box; + margin:0; + padding: 15px; + width: 100%; + opacity:0.9; +} +.fm-button:hover { + cursor: pointer; + opacity: .65; +} +.fm-button:hover .fm-bar { + background-color: #fff +} +.fm-button .fm-bar { + display: block; + width: 24px; + height: 2px; + border-radius: 1px; + background-color:#fff +} +.fm-button .fm-bar+.fm-bar { + margin-top: 4px +} +.flexmenu:after, .flexmenu:before { + display: table; + content: " " +} +.flexmenu:after { + clear: both +} +.flexmenu a { + text-decoration: none +} +.flexmenu.fm-toggle.fm-sm { + display: none; + background:#323232; + padding:30px 0; +} +.fm-outer { + position: relative; + overflow: hidden; + height: 100%; + width: 100% +} +.fm-inner { + position: relative; + height: 100%; + width: 100%; + left: 0 +} +.fm-inner.open { + left: 70% +} +.fm-inner.open .flexmenu.fm-sm { + left: 0 +} +.flexmenu.fm-offcanvas.fm-sm { + z-index: 100; + overflow-y: auto; + overflow-x: hidden; + position: fixed; + top: 0; + left: -70%; + width: 70%; + height: 100%; + -webkit-box-shadow: inset -10px 0 10px -10px rgba(0, 0, 0, .3); + -moz-box-shadow: inset -10px 0 10px -10px rgba(0, 0, 0, .3); + box-shadow: inset -10px 0 10px -10px rgba(0, 0, 0, .3); + background: #333 +} +.flexmenu.fm-lg { + max-width: 1170px; + margin: auto; + overflow:inherit !important; +} +.flexmenu.fm-lg .navicon:after { + border: 4px solid transparent; + border-top-color: #666; + content: ""; + position: absolute; + right: 6px; + top: 20px +} +.flexmenu > ul ul li{ + border-left:3px solid #323232; +} +.flexmenu > ul ul li:hover{ + border-left:3px solid #ee2e6a; +} +.flexmenu.fm-lg>ul>li { + float: left +} +.flexmenu.fm-lg>ul>li.navigation_search_li, .flexmenu.fm-lg>ul>li.navigation_shopping_bag_li{ + float:right; +} +.flexmenu.fm-lg ul { + margin: 0; + padding: 0; + list-style: none +} +.flexmenu.fm-lg li { + position: relative; + white-space: nowrap +} +.flexmenu.fm-lg li ul { + position: absolute; + left: 0; + top: 100%; + z-index: 99 +} +.flexmenu.fm-lg li ul .navicon:after { + border: 4px solid transparent; + border-left-color: #666; + right: 6px; + top: 18px +} +.flexmenu.fm-lg li ul ul { + top: 0; + left: 100% +} +.flexmenu.fm-lg>ul>li { + padding: 0 +} +.flexmenu.fm-lg a { + display: block; +} +.flexmenu.fm-lg a:hover, .flexmenu.fm-lg .active a { + opacity: 0.65; +} +.flexmenu.fm-lg .navigation_logo.active a , .flexmenu.fm-lg .navigation_logo a:hover { + opacity:1; +} +/*.flexmenu.fm-lg .active a, .flexmenu.fm-lg a:hover {*/ +.lavalamp-object { + background:#323232; + text-decoration: none +} +.flexmenu.fm-lg li ul { + background:#323232; +} +.flexmenu.fm-lg ul ul{ + display:none; +} +.flexmenu.fm-lg li ul li { + padding: 0; + min-width: 150px; + height:auto; +} +.flexmenu.fm-lg li ul li a{ + border-top: 1px solid #323232; +} +.flexmenu.fm-sm ul { + margin: 0; + padding: 0; + list-style: none +} +.flexmenu.fm-sm ul li { + position: relative; + width:80%; + padding:0 10%; +} +.flexmenu.fm-sm ul li:last-child { + border-bottom:0; +} +.flexmenu.fm-sm ul li a { + display: block; + padding: 0px; + font-size: 16px; + color: #fff; + text-transform: uppercase; + border-bottom:1px solid #464545; +} +.flexmenu.fm-sm ul li a.active, .flexmenu.fm-sm ul li a:hover { + text-decoration: none; + opacity:0.65; +} +.flexmenu.fm-sm ul ul li a { + background-color: #daeaf4; + padding-left: 35px; +} +.flexmenu.fm-sm > ul ul li:hover { + border-left: 3px solid #0d70b5; +} +.flexmenu.fm-sm .navicon { + position: absolute; + top: 0; + right: 0; + height:38px; + width: 38px; +} +.flexmenu.fm-sm .navicon:hover { + background-color: #0d70b5; + -webkit-box-shadow: inset 0 0 8px rgba(0, 0, 0, .3); + -moz-box-shadow: inset 0 0 8px rgba(0, 0, 0, .3); + box-shadow: inset 0 0 8px rgba(0, 0, 0, .3); +} +.flexmenu.fm-sm .navicon:hover { + cursor: pointer +} +.flexmenu.fm-sm .navicon:after { + border: 5px solid transparent; + border-top-color: #333; + content: ""; + position: absolute; + right: 13px; + top: 18px; +} +.flexmenu.fm-sm .navicon:hover:after { + border-top-color: #fff; +} + +/************************************************ + end responsive flexmenu +*************************************************/ + + + + + +/************************************************ + responsive tabs +*************************************************/ +ul.resp-tabs-list, p { + margin: 0px; + padding: 0px; +} +.resp-tabs-list li { + font-weight: 600; + font-size: 13px; + display: inline-block; + padding: 13px 15px; + margin: 0; + list-style: none; + cursor: pointer; + float: left; +} +.resp-tabs-container { + padding: 0px; + clear: left; +} +h2.resp-accordion { + cursor: pointer; + padding: 5px; + display: none; +} +.resp-tab-content { + display: none; + padding: 0 15px 15px 15px; +} +.resp-tab-active { + border-bottom: none; + margin-bottom: -1px !important; + padding: 12px 14px 14px 14px !important; +} +.resp-tab-active { + border-bottom: none; +} +.resp-content-active, .resp-accordion-active { + display: block; +} +h2.resp-accordion { + font-size: 13px; + margin: 0px; + padding: 10px 15px; + border-top:1px solid #ccc; +} +h2.resp-accordion:first-child { + border:0; +} +h2.resp-tab-active { + border-bottom: 0px solid #c1c1c1 !important; + margin-bottom: 0px !important; + padding: 10px 15px !important; +} +h2.resp-tab-title:last-child { + border-bottom: 12px solid #c1c1c1 !important; + background: blue; +} +/*-----------Vertical tabs-----------*/ + +.resp-vtabs ul.resp-tabs-list { + float: left; + width: 30%; +} +.resp-vtabs .resp-tabs-list li { + display: block; + padding: 15px 15px !important; + margin: 0; + cursor: pointer; + float: none; +} +.resp-vtabs .resp-tabs-container { + padding: 0px; + background-color: #fff; + border: 1px solid #c1c1c1; + float: left; + width: 68%; + min-height: 250px; + border-radius: 4px; + clear: none; +} +.resp-vtabs .resp-tab-content { + border: none; +} +.resp-vtabs li.resp-tab-active { + border: 1px solid #c1c1c1; + border-right: none; + background-color: #fff; + position: relative; + z-index: 1; + margin-right: -1px !important; + padding: 14px 15px 15px 14px !important; +} +.resp-arrow:after { + content: '+'; + float: right; + font-weight: normal; + margin-right: 8px; + -webkit-transition: -webkit-transform .3s ease; + transition: transform .3s ease; +} +h2.resp-tab-active span.resp-arrow:after { + -webkit-transform: rotate(45deg) scale(1.08); + -ms-transform: rotate(45deg) scale(1.08); + transform: rotate(45deg) scale(1.08); +} +/*-----------Accordion styles-----------*/ + +.resp-easy-accordion h2.resp-accordion { + display: block; +} +.resp-easy-accordion .resp-tab-content { + border: 1px solid #c1c1c1; +} +.resp-easy-accordion .resp-tab-content:last-child { + border-bottom: 1px solid #c1c1c1 !important; +} +.resp-jfit { + width: 100%; + margin: 0px; +} +.resp-tab-content-active { + display: block; +} +.resp-tab-content ul{ + list-style:none; +} +.resp-tab-content ul li a{ + color: #666; + text-decoration: none; +} + +/*Here your can change the breakpoint to set the accordion, when screen resolution changed*/ +@media only screen and (max-width: 768px) { + ul.resp-tabs-list { + display: none; + } + h2.resp-accordion { + display: block; + } + .resp-vtabs .resp-tab-content { + border: 1px solid #C1C1C1; + } + .resp-vtabs .resp-tabs-container { + border: none; + float: none; + width: 100%; + min-height: initial; + clear: none; + } + .resp-accordion-closed { + display: none !important; + } + .resp-vtabs .resp-tab-content:last-child { + border-bottom: 1px solid #c1c1c1 !important; + } +} +/************************************************ + responsive tabs +*************************************************/ + + + + + + + + + + + + + + +/************************************************ + responsive carousel +*************************************************/ + +/* + * Owl Carousel - Animate Plugin + */ +.owl-carousel .animated { + -webkit-animation-duration: 1000ms; + animation-duration: 1000ms; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} +.owl-carousel .owl-animated-in { + z-index: 0; +} +.owl-carousel .owl-animated-out { + z-index: 1; +} +.owl-carousel .fadeOut { + -webkit-animation-name: fadeOut; + animation-name: fadeOut; +} + @-webkit-keyframes fadeOut { + 0% { + opacity: 1; +} + 100% { + opacity: 0; +} +} +@keyframes fadeOut { + 0% { + opacity: 1; +} + 100% { + opacity: 0; +} +} +/* + * Owl Carousel - Auto Height Plugin + */ +.owl-height { + -webkit-transition: height 500ms ease-in-out; + -moz-transition: height 500ms ease-in-out; + -ms-transition: height 500ms ease-in-out; + -o-transition: height 500ms ease-in-out; + transition: height 500ms ease-in-out; +} +/* + * Core Owl Carousel CSS File + */ +.owl-carousel { + display: none; + width: 100%; + -webkit-tap-highlight-color: transparent; + /* position relative and z-index fix webkit rendering fonts issue */ + position: relative; + z-index: 1; +} +.owl-carousel .owl-stage { + position: relative; + -ms-touch-action: pan-Y; +} +.owl-carousel .owl-stage:after { + content: "."; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + height: 0; +} +.owl-carousel .owl-stage-outer { + position: relative; + overflow: hidden; + /* fix for flashing background */ + -webkit-transform: translate3d(0px, 0px, 0px); +} +.owl-carousel .owl-controls .owl-nav .owl-prev, .owl-carousel .owl-controls .owl-nav .owl-next, .owl-carousel .owl-controls .owl-dot { + cursor: pointer; + cursor: hand; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.owl-prev, .owl-next{ + width: 40px; + height: 110px; + top: 44px; + position: fixed; + padding: 0; + color: #fff; + display: inline-block; + zoom: 1; + font-size: 12px; + filter: Alpha(Opacity=50); + opacity: .5; +} +.owl-prev{ + left: -50px; + background: url(../images/carousel_controls.png) 9px center no-repeat #fff; + -webkit-transition: all .4s ease-in-out; + -moz-transition: all .4s ease-in-out; + -ms-transition: all .4s ease-in-out; + -o-transition: all .4s ease-in-out; + transition: all .4s ease-in-out; +} +.owl-next{ + right: -50px; + background: url(../images/carousel_controls.png) -45px center no-repeat #fff; + -webkit-transition: all .4s ease-in-out; + -moz-transition: all .4s ease-in-out; + -ms-transition: all .4s ease-in-out; + -o-transition: all .4s ease-in-out; + transition: all .4s ease-in-out; +} +.header_category_bar:hover .owl-prev { + left: 0; +} +.header_category_bar:hover .owl-next { + right: 0; +} +.owl-prev:hover, .owl-next:hover { + filter: Alpha(Opacity=100); + opacity: 1; + text-decoration: none; +} + +.owl-carousel.owl-loaded { + display: block; +} +.owl-carousel.owl-loading { + opacity: 0; + display: block; +} +.owl-carousel.owl-hidden { + opacity: 0; +} +.owl-carousel .owl-refresh .owl-item { + display: none; +} +.owl-carousel .owl-item { + position: relative; + min-height: 1px; + float: left; + -webkit-backface-visibility: hidden; + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.owl-carousel .owl-item img { + display: block; + width: 100%; + -webkit-transform-style: preserve-3d; +} +.owl-carousel.owl-text-select-on .owl-item { + -webkit-user-select: auto; + -moz-user-select: auto; + -ms-user-select: auto; + user-select: auto; +} +.owl-carousel .owl-grab { + cursor: move; + cursor: -webkit-grab; + cursor: -o-grab; + cursor: -ms-grab; + cursor: grab; +} +.owl-carousel.owl-rtl { + direction: rtl; +} +.owl-carousel.owl-rtl .owl-item { + float: right; +} +/* No Js */ +.no-js .owl-carousel { + display: block; +} +/* + * Owl Carousel - Lazy Load Plugin + */ +.owl-carousel .owl-item .owl-lazy { + opacity: 0; + -webkit-transition: opacity 400ms ease; + -moz-transition: opacity 400ms ease; + -ms-transition: opacity 400ms ease; + -o-transition: opacity 400ms ease; + transition: opacity 400ms ease; +} +.owl-carousel .owl-item img { + transform-style: preserve-3d; +} +/* + * Owl Carousel - Video Plugin + */ +.owl-carousel .owl-video-wrapper { + position: relative; + height: 100%; + background: #000; +} +.owl-carousel .owl-video-play-icon { + position: absolute; + height: 80px; + width: 80px; + left: 50%; + top: 50%; + margin-left: -40px; + margin-top: -40px; + background: url("../images/owl.video.play.png") no-repeat; + cursor: pointer; + z-index: 1; + -webkit-backface-visibility: hidden; + -webkit-transition: scale 100ms ease; + -moz-transition: scale 100ms ease; + -ms-transition: scale 100ms ease; + -o-transition: scale 100ms ease; + transition: scale 100ms ease; +} +.owl-carousel .owl-video-play-icon:hover { + -webkit-transition: scale(1.3, 1.3); + -moz-transition: scale(1.3, 1.3); + -ms-transition: scale(1.3, 1.3); + -o-transition: scale(1.3, 1.3); + transition: scale(1.3, 1.3); +} +.owl-carousel .owl-video-playing .owl-video-tn, .owl-carousel .owl-video-playing .owl-video-play-icon { + display: none; +} +.owl-carousel .owl-video-tn { + opacity: 0; + height: 100%; + background-position: center center; + background-repeat: no-repeat; + -webkit-background-size: contain; + -moz-background-size: contain; + -o-background-size: contain; + background-size: contain; + -webkit-transition: opacity 400ms ease; + -moz-transition: opacity 400ms ease; + -ms-transition: opacity 400ms ease; + -o-transition: opacity 400ms ease; + transition: opacity 400ms ease; +} +.owl-carousel .owl-video-frame { + position: relative; + z-index: 1; +} + +.owl-carousel .item { + text-align:center; + height: 110px; + padding: 0; +} +.item_link{ + position: relative; + z-index: 1; + display: inline-block; + margin:15px 0 ; + vertical-align: top; + color: inherit; + text-decoration: none; +} +.item_link:hover{ + opactiy:0.6; +} +.item_img{ + width:60px !important; + height:60px; +} +.item_title{ + text-align:center; + font-size: 12px; + line-height: 1; + font-weight: 400; + letter-spacing: normal; + margin-left: auto; + margin-right: auto; + display: block; + padding-top: 8px; + white-space: normal; + color: #333; + -webkit-transition: opacity 200ms linear; + transition: opacity 200ms linear; +} +/************************************************ + end responsive carousel +*************************************************/ + + + +/** + * + * slippry v1.3.1 - Responsive content slider for jQuery + * http://slippry.com + * + * Authors: Lukas Jakob Hafner - @saftsaak + * Thomas Hurd - @SeenNotHurd + * + * Copyright 2015, booncon oy - http://booncon.com + * + * + * Released under the MIT license - http://opensource.org/licenses/MIT + */ +/* kenBurns animations, very basic */ +@-webkit-keyframes left-right { + 0% { + -moz-transform: translateY(-20%) translateX(-10%); + -ms-transform: translateY(-20%) translateX(-10%); + -webkit-transform: translateY(-20%) translateX(-10%); + transform: translateY(-20%) translateX(-10%); +} + 100% { + -moz-transform: translateY(0%) translateX(10%); + -ms-transform: translateY(0%) translateX(10%); + -webkit-transform: translateY(0%) translateX(10%); + transform: translateY(0%) translateX(10%); +} +} +@-moz-keyframes left-right { + 0% { + -moz-transform: translateY(-20%) translateX(-10%); + -ms-transform: translateY(-20%) translateX(-10%); + -webkit-transform: translateY(-20%) translateX(-10%); + transform: translateY(-20%) translateX(-10%); +} + 100% { + -moz-transform: translateY(0%) translateX(10%); + -ms-transform: translateY(0%) translateX(10%); + -webkit-transform: translateY(0%) translateX(10%); + transform: translateY(0%) translateX(10%); +} +} +@-ms-keyframes left-right { + 0% { + -moz-transform: translateY(-20%) translateX(-10%); + -ms-transform: translateY(-20%) translateX(-10%); + -webkit-transform: translateY(-20%) translateX(-10%); + transform: translateY(-20%) translateX(-10%); +} + 100% { + -moz-transform: translateY(0%) translateX(10%); + -ms-transform: translateY(0%) translateX(10%); + -webkit-transform: translateY(0%) translateX(10%); + transform: translateY(0%) translateX(10%); +} +} +@keyframes left-right { + 0% { + -moz-transform: translateY(-20%) translateX(-10%); + -ms-transform: translateY(-20%) translateX(-10%); + -webkit-transform: translateY(-20%) translateX(-10%); + transform: translateY(-20%) translateX(-10%); +} + 100% { + -moz-transform: translateY(0%) translateX(10%); + -ms-transform: translateY(0%) translateX(10%); + -webkit-transform: translateY(0%) translateX(10%); + transform: translateY(0%) translateX(10%); +} +} +@-webkit-keyframes right-left { + 0% { + -moz-transform: translateY(0%) translateX(10%); + -ms-transform: translateY(0%) translateX(10%); + -webkit-transform: translateY(0%) translateX(10%); + transform: translateY(0%) translateX(10%); +} + 100% { + -moz-transform: translateY(-20%) translateX(-10%); + -ms-transform: translateY(-20%) translateX(-10%); + -webkit-transform: translateY(-20%) translateX(-10%); + transform: translateY(-20%) translateX(-10%); +} +} +@-moz-keyframes right-left { + 0% { + -moz-transform: translateY(0%) translateX(10%); + -ms-transform: translateY(0%) translateX(10%); + -webkit-transform: translateY(0%) translateX(10%); + transform: translateY(0%) translateX(10%); +} + 100% { + -moz-transform: translateY(-20%) translateX(-10%); + -ms-transform: translateY(-20%) translateX(-10%); + -webkit-transform: translateY(-20%) translateX(-10%); + transform: translateY(-20%) translateX(-10%); +} +} +@-ms-keyframes right-left { + 0% { + -moz-transform: translateY(0%) translateX(10%); + -ms-transform: translateY(0%) translateX(10%); + -webkit-transform: translateY(0%) translateX(10%); + transform: translateY(0%) translateX(10%); +} + 100% { + -moz-transform: translateY(-20%) translateX(-10%); + -ms-transform: translateY(-20%) translateX(-10%); + -webkit-transform: translateY(-20%) translateX(-10%); + transform: translateY(-20%) translateX(-10%); +} +} +@keyframes right-left { + 0% { + -moz-transform: translateY(0%) translateX(10%); + -ms-transform: translateY(0%) translateX(10%); + -webkit-transform: translateY(0%) translateX(10%); + transform: translateY(0%) translateX(10%); +} + 100% { + -moz-transform: translateY(-20%) translateX(-10%); + -ms-transform: translateY(-20%) translateX(-10%); + -webkit-transform: translateY(-20%) translateX(-10%); + transform: translateY(-20%) translateX(-10%); +} +} +/* added to the original element calling slippry */ +.sy-box.sy-loading { + background: url("/images/sy-loader.gif") 50% 50% no-repeat; + -moz-background-size: 32px; + -o-background-size: 32px; + -webkit-background-size: 32px; + background-size: 32px; + min-height: 40px; +} +.sy-box.sy-loading .sy-slides-wrap, .sy-box.sy-loading .sy-pager { + visibility: hidden; +} +/* element that wraps the slides */ +.sy-slides-wrap { + position: relative; + height: 100%; + width: 100%; +} +/*.sy-slides-wrap:hover .sy-controls { + display: block; +}*/ +/* element that crops the visible area to the slides */ +.sy-slides-crop { + height: 100%; + width: 100%; + position: absolute; + overflow: hidden; +} +/* list containing the slides */ +.sy-list { + width: 100%; + height: 100%; + list-style: none; + margin: 0; + padding: 0; + position: absolute; +} +.sy-list.horizontal { + -moz-transition: left ease; + -o-transition: left ease; + -webkit-transition: left ease; + transition: left ease; +} +.sy-list.vertical { + -moz-transition: top ease; + -o-transition: top ease; + -webkit-transition: top ease; + transition: top ease; +} +/* single slide */ +.sy-slide { + position: absolute; + width: 100%; + z-index: 2; +} +.sy-slide.kenburns { + width: 140%; + left: -20%; +} +.sy-slide.kenburns.useCSS { + -moz-transition-property: opacity; + -o-transition-property: opacity; + -webkit-transition-property: opacity; + transition-property: opacity; +} + .sy-slide.kenburns.useCSS.sy-ken:nth-child(1n) { + -webkit-animation-name: left-right; + -webkit-animation-fill-mode: forwards; + -moz-animation-name: left-right; + -moz-animation-fill-mode: forwards; + -o-animation-name: left-right; + -o-animation-fill-mode: forwards; + animation-name: left-right; + animation-fill-mode: forwards; +} + .sy-slide.kenburns.useCSS.sy-ken:nth-child(2n) { + -webkit-animation-name: right-left; + -webkit-animation-fill-mode: forwards; + -moz-animation-name: right-left; + -moz-animation-fill-mode: forwards; + -o-animation-name: right-left; + -o-animation-fill-mode: forwards; + animation-name: right-left; + animation-fill-mode: forwards; +} +.sy-slide.sy-active { + z-index: 3; +} +.sy-slide > a { + margin: 0; + padding: 0; + display: block; + width: 100%; +} +.sy-slide > a > img, .sy-slide > img, .slider_li img { + margin: 0; + padding: 0; + display: block; + width: 100%; + border: 0; +} +/* next/ prev buttons, with arrows and clickable area a lot larger than the visible buttons */ +.sy-controls { + display: none; + list-style: none; + height: 100%; + width: 100%; + position: absolute; + padding: 0; + margin: 0; +} +.sy-controls li { + position: absolute; + width: 10%; + min-width: 4.2em; + height: 100%; + z-index: 33; +} +.sy-controls li.sy-prev { + left: 0; + top: 0; +} +.sy-controls li.sy-prev a:after { + background-position: -5% 0; +} +.sy-controls li.sy-next { + right: 0; + top: 0; +} +.sy-controls li.sy-next a:after { + background-position: 105% 0; +} +.sy-controls li a { + position: relative; + width: 100%; + height: 100%; + display: block; + text-indent: -9999px; +} +.sy-controls li a:link, .sy-controls li a:visited { + opacity: 0.4; +} +.sy-controls li a:hover, .sy-controls li a:focus { + opacity: 0.8; + outline: none; +} +.sy-controls li a:after { + content: ""; + background-image: url("/images/arrows.svg"); + background-repeat: no-repeat; + -moz-background-size: cover; + -o-background-size: cover; + -webkit-background-size: cover; + background-size: cover; + text-align: center; + text-indent: 0; + line-height: 2.8em; + color: #111; + font-weight: 800; + position: absolute; + background-color: #fff; + width: 2.8em; + height: 2.8em; + left: 50%; + top: 50%; + margin-top: -1.4em; + margin-left: -1.4em; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; +} + @media only screen and (max-device-width: 600px) { + .sy-controls { + display: block; + } + .sy-controls li { + min-width: 2.1em; + } + .sy-controls li a:after { + width: 1.4em; + height: 1.4em; + margin-top: -0.7em; + margin-left: -0.7em; + } +} +/* captions, styled fo the overlay variant */ +.sy-caption-wrap { + position: absolute; + bottom: 2em; + z-index: 12; + left: 50%; +} +.sy-caption-wrap .sy-caption { + position: relative; + left: -50%; + background-color: rgba(0, 0, 0, 0.54); + color: #fff; + padding: 0.4em 1em; + -moz-border-radius: 1.2em; + -webkit-border-radius: 1.2em; + border-radius: 1.2em; +} +.sy-caption-wrap .sy-caption a:link, .sy-caption-wrap .sy-caption a:visited { + color: #e24b70; + font-weight: 600; + text-decoration: none; +} +.sy-caption-wrap .sy-caption a:hover, .sy-caption-wrap .sy-caption a:focus { + text-decoration: underline; +} +@media only screen and (max-device-width: 600px), screen and (max-width: 600px) { + .sy-caption-wrap { + left: 0; + bottom: 0.4em; + } + .sy-caption-wrap .sy-caption { + left: 0; + padding: 0.2em 0.4em; + font-size: 0.92em; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + } +} +/* pager bubbles */ +.sy-pager { + overflow: hidden; + *zoom: 1; + display: block; + width: 100%; + margin: 0 0 15px 0; + padding: 0; + list-style: none; + text-align: center; + position:absolute; + bottom:0; + text-align:center; + z-index: 9; +} +.sy-pager li { + list-style: none; + margin: 0 10px; + width: 8px; + height: 8px; + display:inline-block; + position: relative; +} +.sy-pager li.sy-active a { + top: -1px; + left: -1px; + width: 8px; + height: 8px; + border-style: solid; + border-width: 1px; + border-color: #08c; + background-color: transparent; + cursor: default; +} +.sy-pager li a { + top: 0; + left: 0; + width: 8px; + height: 8px; + outline: none; + position: absolute; + border-radius: 50%; + background-color: #999; + font: 0/0 a; + color: transparent; +} +.sy-pager li a:link, .sy-pager li a:visited { + opacity: 1.0; +} +.sy-pager li a:hover, .sy-pager li a:focus { + opacity: 0.6; +} +/* element to "keep/ fill" the space of the content, gets intrinsic height via js */ +.sy-filler { + width: 100%; +} +.sy-filler.ready { + -moz-transition: padding 600ms ease; + -o-transition: padding 600ms ease; + -webkit-transition: padding 600ms ease; + transition: padding 600ms ease; +} + + + + + + +/* -------------------------------- + +Slider + +-------------------------------- */ +.cd-hero { + position: relative; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.cd-hero-slider { + position: relative; + height: 360px; + overflow: hidden; +} +.cd-hero-slider li { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + -webkit-transform: translateX(100%); + -moz-transform: translateX(100%); + -ms-transform: translateX(100%); + -o-transform: translateX(100%); + transform: translateX(100%); +} +.cd-hero-slider li.selected { + /* this is the visible slide */ + position: relative; + -webkit-transform: translateX(0); + -moz-transform: translateX(0); + -ms-transform: translateX(0); + -o-transform: translateX(0); + transform: translateX(0); +} +.cd-hero-slider li.move-left { + /* slide hidden on the left */ + -webkit-transform: translateX(-100%); + -moz-transform: translateX(-100%); + -ms-transform: translateX(-100%); + -o-transform: translateX(-100%); + transform: translateX(-100%); +} +.cd-hero-slider li.is-moving, .cd-hero-slider li.selected { + /* the is-moving class is assigned to the slide which is moving outside the viewport */ + -webkit-transition: -webkit-transform 0.5s; + -moz-transition: -moz-transform 0.5s; + transition: transform 0.5s; +} +@media only screen and (min-width: 768px) { + .cd-hero-slider { + height: 500px; + } +} +@media only screen and (min-width: 1170px) { + .cd-hero-slider { + height: 680px; + } +} +/* -------------------------------- + +Single slide style + +-------------------------------- */ +.cd-hero-slider li { + background-position: center center; + background-size: cover; + background-repeat: no-repeat; +} +.cd-hero-slider li:first-of-type { + background-color: #2c343b; + background-image: url("../images/home.jpg"); +} +.cd-hero-slider li:nth-of-type(2) { + background-color: #3d4952; + background-image: url("../images/tech-1-mobile.jpg"); +} +.cd-hero-slider .cd-full-width, .cd-hero-slider .cd-half-width { + position: absolute; + width: 100%; + height: 100%; + z-index: 1; + left: 0; + top: 0; + /* this padding is used to align the text */ + padding-top: 100px; + text-align: center; + /* Force Hardware Acceleration in WebKit */ + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -ms-transform: translateZ(0); + -o-transform: translateZ(0); + transform: translateZ(0); +} +.cd-hero-slider .cd-img-container { + /* hide image on mobile device */ + /*display: none;*/ +} +.cd-hero-slider .cd-img-container img { + position: absolute; + left: 50%; + top: 50%; + bottom: auto; + right: auto; + -webkit-transform: translateX(-50%) translateY(-50%); + -moz-transform: translateX(-50%) translateY(-50%); + -ms-transform: translateX(-50%) translateY(-50%); + -o-transform: translateX(-50%) translateY(-50%); + transform: translateX(-50%) translateY(-50%); +} +.cd-hero-slider .cd-bg-video-wrapper { + display:block; + /* hide video on mobile device */ + /*display: none; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + overflow: hidden;*/ +} +.cd-hero-slider .cd-bg-video-wrapper video { + /* you won't see this element in the html, but it will be injected using js */ + display: block; + min-height: 100%; + min-width: 100%; + max-width: none; + height: auto; + width: auto; + position: absolute; + left: 50%; + top: 50%; + bottom: auto; + right: auto; + -webkit-transform: translateX(-50%) translateY(-50%); + -moz-transform: translateX(-50%) translateY(-50%); + -ms-transform: translateX(-50%) translateY(-50%); + -o-transform: translateX(-50%) translateY(-50%); + transform: translateX(-50%) translateY(-50%); +} +.cd-hero-slider h2, .cd-hero-slider p { + text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + line-height: 1.2; + margin: 0 auto 14px; + color: #ffffff; + width: 90%; + max-width: 400px; +} +.cd-hero-slider h2 { + font-size: 2.4rem; +} +.cd-hero-slider p { + font-size: 1.4rem; + line-height: 1.4; +} +.cd-btn { + display: inline-block; + padding: 2px 6px; + margin-bottom: 0; + font-weight: 400; + font-size: 12px; + text-align: center; + white-space: nowrap; + vertical-align: middle; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; + background-color: #3249ad; + border-color: #3249ad; + color: #fff; +} +.page_pagination .active a, .cd-btn:hover{ + background-color: #3ca6b0; + color: #fff; +} +.cd-hero-slider .cd-btn.secondary { + background-color: rgba(22, 26, 30, 0.8); +} +.cd-hero-slider .cd-btn:nth-of-type(2) { + margin-left: 1em; +} +.no-touch .cd-hero-slider .cd-btn:hover { + background-color: #d44457; +} +.no-touch .cd-hero-slider .cd-btn.secondary:hover { + background-color: #161a1e; +} +@media only screen and (min-width: 768px) { + .cd-hero-slider li:nth-of-type(2) { + background-image: none; + } + .cd-hero-slider li:nth-of-type(3) { + background-image: none; + } + .cd-hero-slider li:nth-of-type(4) { + background-image: none; + } + .cd-hero-slider .cd-full-width, .cd-hero-slider .cd-half-width { + padding-top: 150px; + } + .cd-hero-slider .cd-bg-video-wrapper { + display: block; + } + .cd-hero-slider .cd-half-width { + width: 45%; + } + .cd-hero-slider .cd-half-width:first-of-type { + left: 5%; + } + .cd-hero-slider .cd-half-width:nth-of-type(2) { + right: 5%; + left: auto; + } + .cd-hero-slider .cd-img-container { + display: block; + } + .cd-hero-slider h2, .cd-hero-slider p { + max-width: 520px; + } + .cd-hero-slider h2 { + font-size: 2.4em; + font-weight: 300; + } + .cd-hero-slider .cd-btn { + font-size: 1.4rem; + } +} +@media only screen and (min-width: 1170px) { + .cd-hero-slider .cd-full-width, .cd-hero-slider .cd-half-width { + padding-top: 220px; + } + .cd-hero-slider h2, .cd-hero-slider p { + margin-bottom: 20px; + } + .cd-hero-slider h2 { + font-size: 3.2em; + } + .cd-hero-slider p { + font-size: 1.6rem; + } +} + +/* -------------------------------- + +Single slide animation + +-------------------------------- */ +@media only screen and (min-width: 768px) { + .cd-hero-slider .cd-half-width { + opacity: 0; + -webkit-transform: translateX(40px); + -moz-transform: translateX(40px); + -ms-transform: translateX(40px); + -o-transform: translateX(40px); + transform: translateX(40px); + } + .cd-hero-slider .move-left .cd-half-width { + -webkit-transform: translateX(-40px); + -moz-transform: translateX(-40px); + -ms-transform: translateX(-40px); + -o-transform: translateX(-40px); + transform: translateX(-40px); + } + .cd-hero-slider .selected .cd-half-width { + /* this is the visible slide */ + opacity: 1; + -webkit-transform: translateX(0); + -moz-transform: translateX(0); + -ms-transform: translateX(0); + -o-transform: translateX(0); + transform: translateX(0); + } + .cd-hero-slider .is-moving .cd-half-width { + /* this is the slide moving outside the viewport + wait for the end of the transition on the
  • parent before set opacity to 0 and translate to 40px/-40px */ + -webkit-transition: opacity 0s 0.5s, -webkit-transform 0s 0.5s; + -moz-transition: opacity 0s 0.5s, -moz-transform 0s 0.5s; + transition: opacity 0s 0.5s, transform 0s 0.5s; + } + .cd-hero-slider li.selected.from-left .cd-half-width:nth-of-type(2), .cd-hero-slider li.selected.from-right .cd-half-width:first-of-type { + /* this is the selected slide - different animation if it's entering from left or right */ + -webkit-transition: opacity 0.4s 0.2s, -webkit-transform 0.5s 0.2s; + -moz-transition: opacity 0.4s 0.2s, -moz-transform 0.5s 0.2s; + transition: opacity 0.4s 0.2s, transform 0.5s 0.2s; + } + .cd-hero-slider li.selected.from-left .cd-half-width:first-of-type, .cd-hero-slider li.selected.from-right .cd-half-width:nth-of-type(2) { + /* this is the selected slide - different animation if it's entering from left or right */ + -webkit-transition: opacity 0.4s 0.4s, -webkit-transform 0.5s 0.4s; + -moz-transition: opacity 0.4s 0.4s, -moz-transform 0.5s 0.4s; + transition: opacity 0.4s 0.4s, transform 0.5s 0.4s; + } + .cd-hero-slider .cd-full-width h2, .cd-hero-slider .cd-full-width p, .cd-hero-slider .cd-full-width .cd-btn { + opacity: 0; + -webkit-transform: translateX(100px); + -moz-transform: translateX(100px); + -ms-transform: translateX(100px); + -o-transform: translateX(100px); + transform: translateX(100px); + } + .cd-hero-slider .move-left .cd-full-width h2, .cd-hero-slider .move-left .cd-full-width p, .cd-hero-slider .move-left .cd-full-width .cd-btn { + opacity: 0; + -webkit-transform: translateX(-100px); + -moz-transform: translateX(-100px); + -ms-transform: translateX(-100px); + -o-transform: translateX(-100px); + transform: translateX(-100px); + } + .cd-hero-slider .selected .cd-full-width h2, .cd-hero-slider .selected .cd-full-width p, .cd-hero-slider .selected .cd-full-width .cd-btn { + /* this is the visible slide */ + opacity: 1; + -webkit-transform: translateX(0); + -moz-transform: translateX(0); + -ms-transform: translateX(0); + -o-transform: translateX(0); + transform: translateX(0); + } + .cd-hero-slider li.is-moving .cd-full-width h2, .cd-hero-slider li.is-moving .cd-full-width p, .cd-hero-slider li.is-moving .cd-full-width .cd-btn { + /* this is the slide moving outside the viewport + wait for the end of the transition on the li parent before set opacity to 0 and translate to 100px/-100px */ + -webkit-transition: opacity 0s 0.5s, -webkit-transform 0s 0.5s; + -moz-transition: opacity 0s 0.5s, -moz-transform 0s 0.5s; + transition: opacity 0s 0.5s, transform 0s 0.5s; + } + .cd-hero-slider li.selected h2 { + -webkit-transition: opacity 0.4s 0.2s, -webkit-transform 0.5s 0.2s; + -moz-transition: opacity 0.4s 0.2s, -moz-transform 0.5s 0.2s; + transition: opacity 0.4s 0.2s, transform 0.5s 0.2s; + } + .cd-hero-slider li.selected p { + -webkit-transition: opacity 0.4s 0.3s, -webkit-transform 0.5s 0.3s; + -moz-transition: opacity 0.4s 0.3s, -moz-transform 0.5s 0.3s; + transition: opacity 0.4s 0.3s, transform 0.5s 0.3s; + } + .cd-hero-slider li.selected .cd-btn { + -webkit-transition: opacity 0.4s 0.4s, -webkit-transform 0.5s 0.4s, background-color 0.2s 0s; + -moz-transition: opacity 0.4s 0.4s, -moz-transform 0.5s 0.4s, background-color 0.2s 0s; + transition: opacity 0.4s 0.4s, transform 0.5s 0.4s, background-color 0.2s 0s; + } +} +/* -------------------------------- + +Slider navigation + +-------------------------------- */ +.cd-slider-nav { + position: absolute; + width: 100%; + bottom: 0; + z-index: 2; + text-align: center; + height: 55px; + background-color: rgba(0, 1, 1, 0.5); +} +.cd-slider-nav nav, .cd-slider-nav ul, .cd-slider-nav li, .cd-slider-nav a { + height: 100%; +} +.cd-slider-nav nav { + display: inline-block; + position: relative; +} +.cd-slider-nav .cd-marker { + position: absolute; + bottom: 0; + left: 0; + width: 60px; + height: 100%; + color: #d44457; + background-color: #ffffff; + box-shadow: inset 0 2px 0 currentColor; + -webkit-transition: -webkit-transform 0.2s, box-shadow 0.2s; + -moz-transition: -moz-transform 0.2s, box-shadow 0.2s; + transition: transform 0.2s, box-shadow 0.2s; +} +.cd-slider-nav .cd-marker.item-2 { + -webkit-transform: translateX(100%); + -moz-transform: translateX(100%); + -ms-transform: translateX(100%); + -o-transform: translateX(100%); + transform: translateX(100%); +} +.cd-slider-nav .cd-marker.item-3 { + -webkit-transform: translateX(200%); + -moz-transform: translateX(200%); + -ms-transform: translateX(200%); + -o-transform: translateX(200%); + transform: translateX(200%); +} +.cd-slider-nav .cd-marker.item-4 { + -webkit-transform: translateX(300%); + -moz-transform: translateX(300%); + -ms-transform: translateX(300%); + -o-transform: translateX(300%); + transform: translateX(300%); +} +.cd-slider-nav .cd-marker.item-5 { + -webkit-transform: translateX(400%); + -moz-transform: translateX(400%); + -ms-transform: translateX(400%); + -o-transform: translateX(400%); + transform: translateX(400%); +} +.cd-slider-nav ul::after { + clear: both; + content: ""; + display: table; +} +.cd-slider-nav li { + display: inline-block; + width: 60px; + float: left; +} +.cd-slider-nav li.selected a { + color: #2c343b; +} +.no-touch .cd-slider-nav li.selected a:hover { + background-color: transparent; +} +.cd-slider-nav a { + display: block; + position: relative; + padding-top: 35px; + font-size: 1rem; + font-weight: 700; + color: #a8b4be; + -webkit-transition: background-color 0.2s; + -moz-transition: background-color 0.2s; + transition: background-color 0.2s; +} +.cd-slider-nav a::before { + content: ''; + position: absolute; + width: 24px; + height: 24px; + top: 8px; + left: 50%; + right: auto; + -webkit-transform: translateX(-50%); + -moz-transform: translateX(-50%); + -ms-transform: translateX(-50%); + -o-transform: translateX(-50%); + transform: translateX(-50%); + background: url(../images/cd-icon-navigation.svg) no-repeat 0 0; +} +.no-touch .cd-slider-nav a:hover { + background-color: rgba(0, 1, 1, 0.5); +} +.cd-slider-nav li:first-of-type a::before { + background-position: 0 0; +} +.cd-slider-nav li.selected:first-of-type a::before { + background-position: 0 -24px; +} +.cd-slider-nav li:nth-of-type(2) a::before { + background-position: -24px 0; +} +.cd-slider-nav li.selected:nth-of-type(2) a::before { + background-position: -24px -24px; +} +.cd-slider-nav li:nth-of-type(3) a::before { + background-position: -48px 0; +} +.cd-slider-nav li.selected:nth-of-type(3) a::before { + background-position: -48px -24px; +} +.cd-slider-nav li:nth-of-type(4) a::before { + background-position: -72px 0; +} +.cd-slider-nav li.selected:nth-of-type(4) a::before { + background-position: -72px -24px; +} +.cd-slider-nav li:nth-of-type(5) a::before { + background-position: -96px 0; +} +.cd-slider-nav li.selected:nth-of-type(5) a::before { + background-position: -96px -24px; +} +@media only screen and (min-width: 768px) { + .cd-slider-nav { + height: 80px; + } + .cd-slider-nav .cd-marker, .cd-slider-nav li { + width: 95px; + } + .cd-slider-nav a { + padding-top: 48px; + font-size: 1.1rem; + text-transform: uppercase; + } + .cd-slider-nav a::before { + top: 18px; + } +} +/* -------------------------------- + +Main content + +-------------------------------- */ +.cd-main-content { + width: 90%; + max-width: 768px; + margin: 0 auto; + padding: 2em 0; +} +.cd-main-content p { + font-size: 1.4rem; + line-height: 1.8; + color: #999999; + margin: 2em 0; +} +@media only screen and (min-width: 1170px) { + .cd-main-content { + padding: 3em 0; + } + .cd-main-content p { + font-size: 1.6rem; + } +} +/* -------------------------------- + +Javascript disabled + +-------------------------------- */ +.no-js .cd-hero-slider li { + display: none; +} +.no-js .cd-hero-slider li.selected { + display: block; +} +.no-js .cd-slider-nav { + display: none; +} + + + + +/* reset css */ + +.custom_button{ + text-decoration: none; + margin-top:10px; + padding:10px; + font-size:16px; +} + +/* reset css */ + +.page_pagination ul{ + list-style:none; + margin:0; + padding:0; + text-align:center; +} +.page_pagination ul li{ + display:inline-block; +} +.page_pagination ul li a{ + margin:0; + padding:10px 15px +} + + +/* responsive */ + +@media (max-width: 1200px) and (min-width: 768px){ + /* promotion */ + .promo_box li{ + width: 50%; + } + .promo_box li a { + border-left: 1px solid #fff; + border-right: 1px solid #fff; + } + .promo_box li.promo_item_1 a, .promo_box li.promo_item_2 a { + border-bottom:2px solid #fff; + } + .promo_box li.promo_item_1 a, .promo_box li.promo_item_3 a { + border-left:0; + } + .promo_box li.promo_item_2 a, .promo_box li.promo_item_4 a { + border-right:0; + } + /* promotion */ +} + +@media (max-width: 1200px) and (min-width: 981px){ + .row{ + max-width: 924px; + padding:0 20px; + } + .shopping_bag_box{ + margin-right:0; + } + .shopping_bag_box_caret:after{ + left:initial; + right:9px; + } +} + +@media (max-width: 980px) and (min-width: 768px){ + .row{ + max-width: 730px; + padding:0 10px; + } + .navigation_li a{ + padding-left:15px; + padding-right:15px; + } + .navigation_logo a{ + padding:0; + } + .navigation_shopping_bag_li a, .navigation_search_li a{ + padding:0 25px; + } + .navigation_logo{ + margin-right:0; + } + .shopping_bag_box{ + margin-right:0; + } + .shopping_bag_box_caret:after{ + left:initial; + right:9px; + } +} + +@media (max-width: 767px){ + label.checkbox_language { + width: 50%; + } + body { + -webkit-text-size-adjust: none; + -ms-text-size-adjust: none; + width: 100%; + min-width: 0; + } + h1, h2, h3, h4, h5, h6 { + word-wrap: break-word; + } + h1 { + font-size: 42px; + font-size: 2.625rem; + } + h2 { + font-size: 36px; + font-size: 2.25rem; + } + p { + line-height: 1.625em; + } + ul, ol, dl, p { + text-align: left; + } + /* restyle row columns */ + .row { + width: 96%; + max-width:100%; + min-width: 0; + margin-left: 0; + margin-right: 0; + padding:0 2%; + } + .header_bar .row{ + width:100%; + padding:0; + } + .row .row .columns { + padding: 0; + } + .columns { + width: auto !important; + float: none; + margin-left: 0; + margin-right: 0; + } + .columns:last-child { + margin-right: 0; + float: none; + } + + .header_bar .wrapper{ + width:100%; + padding:0; + } + + .info, .info_content { + float: none; + width: 100%; + } + + .default_image_420{ + width:100%; + } + .desktop_view{ + display:none; + } + .mobile_view{ + display:block; + } + .header_logo_mobile{ + display: block; + position: absolute; + left: 50%; + margin-left: -50px; + margin-right:0; + z-index:1111; + } + .navigation_li.navigation_logo{ + display:none; + } + .navigation_shopping_bag_li{ + position: absolute; + top: 0; + right: 0px; + width: 50px; + padding: 0; + margin-top: -2px; + } + .navigation_li a.navigation_shopping_bag{ + background-position: 20px 54%; + } + .flexmenu.fm-sm ul li.navigation_shopping_bag_li a{ + border:0; + } + .shopping_bag_box{ + margin-right:0; + width:240px; + } + .shopping_bag_box_caret:after{ + left:initial; + right:7px; + } + .header_logo_mobile_view{ + margin-top:50px; + } + .navigation_li a.navigation_search_link{ + background-position:center center; + } + /* promotion */ + .promo_box li{ + width: 100%; + } + .promo_item_1, .promo_item_2, .promo_item_3, .promo_item_4{ + background-size:767px 200px; + } + .promo_item_1, .promo_item_2, .promo_item_3{ + border-bottom:2px solid #fff; + } + /* promotion */ + .social_share_ul{ + width: 100%; + text-align: center; + position: fixed; + bottom: 1px; + } + .social_share_ul li{ + display: inline-block; + margin-left: -2px; + margin-right: -2px; + } +} + +/* responsive */ diff --git a/css/dashboard.css b/css/dashboard.css new file mode 100644 index 0000000..a4d21e7 --- /dev/null +++ b/css/dashboard.css @@ -0,0 +1,96 @@ + +.dashboard-report-ul, +.dashboard-report-ul:after { + clear: both; +} +.dashboard-report-ul:after, +.dashboard-report-ul:before { + content: ""; + display: table; +} +.dashboard-report-ul { + padding: 0; + list-style: none; +} +.dashboard-report-ul li { + width: 25%; + float: left; + padding-left: 10px; +} +.dashboard-report-ul li:first-child { + padding-left: 0; +} +.dashboard-report-div { + padding: 20px 30px; + border-radius: 4px; + background-color: #fff; + border: 1px solid #ddd; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); +} +.dashboard-report-div, +.dashboard-report-div:after { + clear: both; +} +.dashboard-report-div:after, +.dashboard-report-div:before { + content: ""; + display: table; +} +.dashboard-report-icon { + width: 25%; + float: left; +} +.dashboard-report-icon i { + font-size: 48px; +} +.dashboard-report-details { + width: 75%; + float: left; + padding-left: 20px; +} +.dashboard-report-text { + font-size: 20px; +} +.dashboard-report-heading { + color: #99abb4; + font-size: 14px; +} + + +.dashboard-report-div { + padding: 20px 30px; + border-radius: 4px; + background-color: #fff; + border: 1px solid #ddd; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + } + .dashboard-report-div, + .dashboard-report-div:after { + clear: both; + } + .dashboard-report-div:after, + .dashboard-report-div:before { + content: ""; + display: table; + } + .dashboard-report-icon { + width: 25%; + float: left; + } + .dashboard-report-icon i { + font-size: 48px; + } + .dashboard-report-details { + width: 75%; + float: left; + padding-left: 20px; + } + .dashboard-report-text { + font-size: 20px; + } + .dashboard-report-heading { + color: #99abb4; + font-size: 14px; + } \ No newline at end of file diff --git a/css/fullcalendar.min.css b/css/fullcalendar.min.css new file mode 100644 index 0000000..8727885 --- /dev/null +++ b/css/fullcalendar.min.css @@ -0,0 +1,5 @@ +/*! + * FullCalendar v3.0.1 Stylesheet + * Docs & License: http://fullcalendar.io/ + * (c) 2016 Adam Shaw + */.fc-icon,body .fc{font-size:1em}.fc-button-group,.fc-icon{display:inline-block}.fc-bg,.fc-row .fc-bgevent-skeleton,.fc-row .fc-highlight-skeleton{bottom:0}.fc-icon,.fc-unselectable{-khtml-user-select:none;-webkit-touch-callout:none}.fc{direction:ltr;text-align:left}.fc-rtl{text-align:right}.fc th,.fc-basic-view td.fc-week-number,.fc-icon,.fc-toolbar{text-align:center}.fc-unthemed .fc-content,.fc-unthemed .fc-divider,.fc-unthemed .fc-list-heading td,.fc-unthemed .fc-list-view,.fc-unthemed .fc-popover,.fc-unthemed .fc-row,.fc-unthemed tbody,.fc-unthemed td,.fc-unthemed th,.fc-unthemed thead{border-color:#ddd}.fc-unthemed .fc-popover{background-color:#fff}.fc-unthemed .fc-divider,.fc-unthemed .fc-list-heading td,.fc-unthemed .fc-popover .fc-header{background:#eee}.fc-unthemed .fc-popover .fc-header .fc-close{color:#666}.fc-unthemed .fc-today{background:#fcf8e3}.fc-highlight{background:#bce8f1;opacity:.3}.fc-bgevent{background:#8fdf82;opacity:.3}.fc-nonbusiness{background:#d7d7d7}.fc-icon{height:1em;line-height:1em;overflow:hidden;font-family:"Courier New",Courier,monospace;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fc-icon:after{position:relative}.fc-icon-left-single-arrow:after{content:"\02039";font-weight:700;font-size:200%;top:-7%}.fc-icon-right-single-arrow:after{content:"\0203A";font-weight:700;font-size:200%;top:-7%}.fc-icon-left-double-arrow:after{content:"\000AB";font-size:160%;top:-7%}.fc-icon-right-double-arrow:after{content:"\000BB";font-size:160%;top:-7%}.fc-icon-left-triangle:after{content:"\25C4";font-size:125%;top:3%}.fc-icon-right-triangle:after{content:"\25BA";font-size:125%;top:3%}.fc-icon-down-triangle:after{content:"\25BC";font-size:125%;top:2%}.fc-icon-x:after{content:"\000D7";font-size:200%;top:6%}.fc button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;height:2.1em;padding:0 .6em;font-size:1em;white-space:nowrap;cursor:pointer}.fc button::-moz-focus-inner{margin:0;padding:0}.fc-state-default{border:1px solid;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);color:#333;text-shadow:0 1px 1px rgba(255,255,255,.75);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.fc-state-default.fc-corner-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.fc-state-default.fc-corner-right{border-top-right-radius:4px;border-bottom-right-radius:4px}.fc button .fc-icon{position:relative;top:-.05em;margin:0 .2em;vertical-align:middle}.fc-state-active,.fc-state-disabled,.fc-state-down,.fc-state-hover{color:#333;background-color:#e6e6e6}.fc-state-hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.fc-state-active,.fc-state-down{background-color:#ccc;background-image:none;box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.fc-state-disabled{cursor:default;background-image:none;opacity:.65;box-shadow:none}.fc-event.fc-draggable,.fc-event[href],.fc-popover .fc-header .fc-close,a[data-goto]{cursor:pointer}.fc .fc-button-group>*{float:left;margin:0 0 0 -1px}.fc .fc-button-group>:first-child{margin-left:0}.fc-popover{position:absolute;box-shadow:0 2px 6px rgba(0,0,0,.15)}.fc-popover .fc-header{padding:2px 4px}.fc-popover .fc-header .fc-title{margin:0 2px}.fc-ltr .fc-popover .fc-header .fc-title,.fc-rtl .fc-popover .fc-header .fc-close{float:left}.fc-ltr .fc-popover .fc-header .fc-close,.fc-rtl .fc-popover .fc-header .fc-title{float:right}.fc-unthemed .fc-popover{border-width:1px;border-style:solid}.fc-unthemed .fc-popover .fc-header .fc-close{font-size:.9em;margin-top:2px}.fc-popover>.ui-widget-header+.ui-widget-content{border-top:0}.fc-divider{border-style:solid;border-width:1px}hr.fc-divider{height:0;margin:0;padding:0 0 2px;border-width:1px 0}.fc-bg table,.fc-row .fc-bgevent-skeleton table,.fc-row .fc-highlight-skeleton table{height:100%}.fc-clear{clear:both}.fc-bg,.fc-bgevent-skeleton,.fc-helper-skeleton,.fc-highlight-skeleton{position:absolute;top:0;left:0;right:0}.fc table{width:100%;box-sizing:border-box;table-layout:fixed;border-collapse:collapse;border-spacing:0;font-size:1em}.fc td,.fc th{border-style:solid;border-width:1px;padding:0;vertical-align:top}.fc td.fc-today{border-style:double}a[data-goto]:hover{text-decoration:underline}.fc .fc-row{border-style:solid;border-width:0}.fc-row table{border-left:0 hidden transparent;border-right:0 hidden transparent;border-bottom:0 hidden transparent}.fc-row:first-child table{border-top:0 hidden transparent}.fc-row{position:relative}.fc-row .fc-bg{z-index:1}.fc-row .fc-bgevent-skeleton td,.fc-row .fc-highlight-skeleton td{border-color:transparent}.fc-row .fc-bgevent-skeleton{z-index:2}.fc-row .fc-highlight-skeleton{z-index:3}.fc-row .fc-content-skeleton{position:relative;z-index:4;padding-bottom:2px}.fc-row .fc-helper-skeleton{z-index:5}.fc-row .fc-content-skeleton td,.fc-row .fc-helper-skeleton td{background:0 0;border-color:transparent;border-bottom:0}.fc-row .fc-content-skeleton tbody td,.fc-row .fc-helper-skeleton tbody td{border-top:0}.fc-scroller{-webkit-overflow-scrolling:touch}.fc-row.fc-rigid,.fc-time-grid-event{overflow:hidden}.fc-scroller>.fc-day-grid,.fc-scroller>.fc-time-grid{position:relative;width:100%}.fc-event{position:relative;display:block;font-size:.85em;line-height:1.3;border-radius:2px;font-weight:400;}.fc-event,.fc-event-dot{background-color:#3a87ad}.fc-event,.fc-event:hover,.ui-widget .fc-event{color:#fff;text-decoration:none}.fc-not-allowed,.fc-not-allowed .fc-event{cursor:not-allowed}.fc-event .fc-bg{z-index:1;background:#fff;opacity:.25}.fc-event .fc-content{position:relative;z-index:2}.fc-event .fc-resizer{position:absolute;z-index:4;display:none}.fc-event.fc-allow-mouse-resize .fc-resizer,.fc-event.fc-selected .fc-resizer{display:block}.fc-event.fc-selected .fc-resizer:before{content:"";position:absolute;z-index:9999;top:50%;left:50%;width:40px;height:40px;margin-left:-20px;margin-top:-20px}.fc-event.fc-selected{z-index:9999!important;box-shadow:0 2px 5px rgba(0,0,0,.2)}.fc-event.fc-selected.fc-dragging{box-shadow:0 2px 7px rgba(0,0,0,.3)}.fc-h-event.fc-selected:before{content:"";position:absolute;z-index:3;top:-10px;bottom:-10px;left:0;right:0}.fc-ltr .fc-h-event.fc-not-start,.fc-rtl .fc-h-event.fc-not-end{margin-left:0;border-left-width:0;padding-left:1px;border-top-left-radius:0;border-bottom-left-radius:0}.fc-ltr .fc-h-event.fc-not-end,.fc-rtl .fc-h-event.fc-not-start{margin-right:0;border-right-width:0;padding-right:1px;border-top-right-radius:0;border-bottom-right-radius:0}.fc-ltr .fc-h-event .fc-start-resizer,.fc-rtl .fc-h-event .fc-end-resizer{cursor:w-resize;left:-1px}.fc-ltr .fc-h-event .fc-end-resizer,.fc-rtl .fc-h-event .fc-start-resizer{cursor:e-resize;right:-1px}.fc-h-event.fc-allow-mouse-resize .fc-resizer{width:7px;top:-1px;bottom:-1px}.fc-h-event.fc-selected .fc-resizer{border-radius:4px;border-width:1px;width:6px;height:6px;border-style:solid;border-color:inherit;background:#fff;top:50%;margin-top:-4px}.fc-ltr .fc-h-event.fc-selected .fc-start-resizer,.fc-rtl .fc-h-event.fc-selected .fc-end-resizer{margin-left:-4px}.fc-ltr .fc-h-event.fc-selected .fc-end-resizer,.fc-rtl .fc-h-event.fc-selected .fc-start-resizer{margin-right:-4px}.fc-day-grid-event{margin:2px 2px 0;padding:2px 4px;font-size:13px;}tr:first-child>td>.fc-day-grid-event{margin-top:2px}.fc-day-grid-event.fc-selected:after{content:"";position:absolute;z-index:1;top:-1px;right:-1px;bottom:-1px;left:-1px;background:#000;opacity:.25}.fc-day-grid-event .fc-content{white-space:nowrap;overflow:hidden}.fc-day-grid-event .fc-time{font-weight:700}.fc-ltr .fc-day-grid-event.fc-allow-mouse-resize .fc-start-resizer,.fc-rtl .fc-day-grid-event.fc-allow-mouse-resize .fc-end-resizer{margin-left:-2px}.fc-ltr .fc-day-grid-event.fc-allow-mouse-resize .fc-end-resizer,.fc-rtl .fc-day-grid-event.fc-allow-mouse-resize .fc-start-resizer{margin-right:-2px}a.fc-more{margin:1px 3px;font-size:.85em;cursor:pointer;text-decoration:none}a.fc-more:hover{text-decoration:underline}.fc-limited{display:none}.fc-day-grid .fc-row{z-index:1}.fc-more-popover{z-index:2;width:220px}.fc-more-popover .fc-event-container{padding:10px}.fc-now-indicator{position:absolute;border:0 solid red}.fc-unselectable{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.fc-toolbar{margin-bottom:1em}.fc-toolbar .fc-left{float:left}.fc-toolbar .fc-right{float:right}.fc-toolbar .fc-center{display:inline-block}.fc .fc-toolbar>*>*{float:left;margin-left:.75em}.fc .fc-toolbar>*>:first-child{margin-left:0}.fc-toolbar h2{margin:0}.fc-toolbar button{position:relative}.fc-toolbar .fc-state-hover,.fc-toolbar .ui-state-hover{z-index:2}.fc-toolbar .fc-state-down{z-index:3}.fc-toolbar .fc-state-active,.fc-toolbar .ui-state-active{z-index:4}.fc-toolbar button:focus{z-index:5}.fc-view-container *,.fc-view-container :after,.fc-view-container :before{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.fc-view,.fc-view>table{position:relative;z-index:1}.fc-basicDay-view .fc-content-skeleton,.fc-basicWeek-view .fc-content-skeleton{padding-bottom:1em}.fc-basic-view .fc-body .fc-row{min-height:4em}.fc-row.fc-rigid .fc-content-skeleton{position:absolute;top:0;left:0;right:0}.fc-day-top.fc-other-month{opacity:.3}.fc-basic-view .fc-day-number,.fc-basic-view .fc-week-number{padding:2px}.fc-basic-view th.fc-day-number,.fc-basic-view th.fc-week-number{padding:0 2px}.fc-ltr .fc-basic-view .fc-day-top .fc-day-number{float:right}.fc-rtl .fc-basic-view .fc-day-top .fc-day-number{float:left}.fc-ltr .fc-basic-view .fc-day-top .fc-week-number{float:left;border-radius:0 0 3px}.fc-rtl .fc-basic-view .fc-day-top .fc-week-number{float:right;border-radius:0 0 0 3px}.fc-basic-view .fc-day-top .fc-week-number{min-width:1.5em;text-align:center;background-color:#f2f2f2;color:grey}.fc-basic-view td.fc-week-number>*{display:inline-block;min-width:1.25em}.fc-agenda-view .fc-day-grid{position:relative;z-index:2}.fc-agenda-view .fc-day-grid .fc-row{min-height:3em}.fc-agenda-view .fc-day-grid .fc-row .fc-content-skeleton{padding-bottom:1em}.fc .fc-axis{vertical-align:middle;padding:0 4px;white-space:nowrap}.fc-ltr .fc-axis{text-align:right}.fc-rtl .fc-axis{text-align:left}.ui-widget td.fc-axis{font-weight:400}.fc-time-grid,.fc-time-grid-container{position:relative;z-index:1}.fc-time-grid{min-height:100%}.fc-time-grid table{border:0 hidden transparent}.fc-time-grid>.fc-bg{z-index:1}.fc-time-grid .fc-slats,.fc-time-grid>hr{position:relative;z-index:2}.fc-time-grid .fc-content-col{position:relative}.fc-time-grid .fc-content-skeleton{position:absolute;z-index:3;top:0;left:0;right:0}.fc-time-grid .fc-business-container{position:relative;z-index:1}.fc-time-grid .fc-bgevent-container{position:relative;z-index:2}.fc-time-grid .fc-highlight-container{z-index:3;position:relative}.fc-time-grid .fc-event-container{position:relative;z-index:4}.fc-time-grid .fc-now-indicator-line{z-index:5}.fc-time-grid .fc-helper-container{position:relative;z-index:6}.fc-time-grid .fc-slats td{height:1.5em;border-bottom:0}.fc-time-grid .fc-slats .fc-minor td{border-top-style:dotted}.fc-time-grid .fc-slats .ui-widget-content{background:0 0}.fc-time-grid .fc-highlight{position:absolute;left:0;right:0}.fc-ltr .fc-time-grid .fc-event-container{margin:0 2.5% 0 2px}.fc-rtl .fc-time-grid .fc-event-container{margin:0 2px 0 2.5%}.fc-time-grid .fc-bgevent,.fc-time-grid .fc-event{position:absolute;z-index:1}.fc-time-grid .fc-bgevent{left:0;right:0}.fc-v-event.fc-not-start{border-top-width:0;padding-top:1px;border-top-left-radius:0;border-top-right-radius:0}.fc-v-event.fc-not-end{border-bottom-width:0;padding-bottom:1px;border-bottom-left-radius:0;border-bottom-right-radius:0}.fc-time-grid-event.fc-selected{overflow:visible}.fc-time-grid-event.fc-selected .fc-bg{display:none}.fc-time-grid-event .fc-content{overflow:hidden}.fc-time-grid-event .fc-time,.fc-time-grid-event .fc-title{padding:0 1px}.fc-time-grid-event .fc-time{font-size:.85em;white-space:nowrap}.fc-time-grid-event.fc-short .fc-content{white-space:nowrap}.fc-time-grid-event.fc-short .fc-time,.fc-time-grid-event.fc-short .fc-title{display:inline-block;vertical-align:top}.fc-time-grid-event.fc-short .fc-time span{display:none}.fc-time-grid-event.fc-short .fc-time:before{content:attr(data-start)}.fc-time-grid-event.fc-short .fc-time:after{content:"\000A0-\000A0"}.fc-time-grid-event.fc-short .fc-title{font-size:.85em;padding:0}.fc-time-grid-event.fc-allow-mouse-resize .fc-resizer{left:0;right:0;bottom:0;height:8px;overflow:hidden;line-height:8px;font-size:11px;font-family:monospace;text-align:center;cursor:s-resize}.fc-time-grid-event.fc-allow-mouse-resize .fc-resizer:after{content:"="}.fc-time-grid-event.fc-selected .fc-resizer{border-radius:5px;border-width:1px;width:8px;height:8px;border-style:solid;border-color:inherit;background:#fff;left:50%;margin-left:-5px;bottom:-5px}.fc-time-grid .fc-now-indicator-line{border-top-width:1px;left:0;right:0}.fc-time-grid .fc-now-indicator-arrow{margin-top:-5px}.fc-ltr .fc-time-grid .fc-now-indicator-arrow{left:0;border-width:5px 0 5px 6px;border-top-color:transparent;border-bottom-color:transparent}.fc-rtl .fc-time-grid .fc-now-indicator-arrow{right:0;border-width:5px 6px 5px 0;border-top-color:transparent;border-bottom-color:transparent}.fc-event-dot{display:inline-block;width:10px;height:10px;border-radius:5px}.fc-rtl .fc-list-view{direction:rtl}.fc-list-view{border-width:1px;border-style:solid}.fc .fc-list-table{table-layout:auto}.fc-list-table td{border-width:1px 0 0;padding:8px 14px}.fc-list-table tr:first-child td{border-top-width:0}.fc-list-heading{border-bottom-width:1px}.fc-list-heading td{font-weight:700}.fc-ltr .fc-list-heading-main{float:left}.fc-ltr .fc-list-heading-alt,.fc-rtl .fc-list-heading-main{float:right}.fc-rtl .fc-list-heading-alt{float:left}.fc-list-item.fc-has-url{cursor:pointer}.fc-list-item:hover td{background-color:#f5f5f5}.fc-list-item-marker,.fc-list-item-time{white-space:nowrap;width:1px}.fc-ltr .fc-list-item-marker{padding-right:0}.fc-rtl .fc-list-item-marker{padding-left:0}.fc-list-item-title a{text-decoration:none;color:inherit}.fc-list-item-title a[href]:hover{text-decoration:underline}.fc-list-empty-wrap2{position:absolute;top:0;left:0;right:0;bottom:0}.fc-list-empty-wrap1{width:100%;height:100%;display:table}.fc-list-empty{display:table-cell;vertical-align:middle;text-align:center}.fc-unthemed .fc-list-empty{background-color:#eee} \ No newline at end of file diff --git a/css/fullcalendar.print.css b/css/fullcalendar.print.css new file mode 100644 index 0000000..bfa910b --- /dev/null +++ b/css/fullcalendar.print.css @@ -0,0 +1,208 @@ +/*! + * FullCalendar v3.0.1 Print Stylesheet + * Docs & License: http://fullcalendar.io/ + * (c) 2016 Adam Shaw + */ + +/* + * Include this stylesheet on your page to get a more printer-friendly calendar. + * When including this stylesheet, use the media='print' attribute of the tag. + * Make sure to include this stylesheet IN ADDITION to the regular fullcalendar.css. + */ + +.fc { + max-width: 100% !important; +} + + +/* Global Event Restyling +--------------------------------------------------------------------------------------------------*/ + +.fc-event { + background: #fff !important; + color: #000 !important; + page-break-inside: avoid; +} + +.fc-event .fc-resizer { + display: none; +} + + +/* Table & Day-Row Restyling +--------------------------------------------------------------------------------------------------*/ + +.fc th, +.fc td, +.fc hr, +.fc thead, +.fc tbody, +.fc-row { + border-color: #ccc !important; + background: #fff !important; +} + +/* kill the overlaid, absolutely-positioned components */ +/* common... */ +.fc-bg, +.fc-bgevent-skeleton, +.fc-highlight-skeleton, +.fc-helper-skeleton, +/* for timegrid. within cells within table skeletons... */ +.fc-bgevent-container, +.fc-business-container, +.fc-highlight-container, +.fc-helper-container { + display: none; +} + +/* don't force a min-height on rows (for DayGrid) */ +.fc tbody .fc-row { + height: auto !important; /* undo height that JS set in distributeHeight */ + min-height: 0 !important; /* undo the min-height from each view's specific stylesheet */ +} + +.fc tbody .fc-row .fc-content-skeleton { + position: static; /* undo .fc-rigid */ + padding-bottom: 0 !important; /* use a more border-friendly method for this... */ +} + +.fc tbody .fc-row .fc-content-skeleton tbody tr:last-child td { /* only works in newer browsers */ + padding-bottom: 1em; /* ...gives space within the skeleton. also ensures min height in a way */ +} + +.fc tbody .fc-row .fc-content-skeleton table { + /* provides a min-height for the row, but only effective for IE, which exaggerates this value, + making it look more like 3em. for other browers, it will already be this tall */ + height: 1em; +} + + +/* Undo month-view event limiting. Display all events and hide the "more" links +--------------------------------------------------------------------------------------------------*/ + +.fc-more-cell, +.fc-more { + display: none !important; +} + +.fc tr.fc-limited { + display: table-row !important; +} + +.fc td.fc-limited { + display: table-cell !important; +} + +.fc-popover { + display: none; /* never display the "more.." popover in print mode */ +} + + +/* TimeGrid Restyling +--------------------------------------------------------------------------------------------------*/ + +/* undo the min-height 100% trick used to fill the container's height */ +.fc-time-grid { + min-height: 0 !important; +} + +/* don't display the side axis at all ("all-day" and time cells) */ +.fc-agenda-view .fc-axis { + display: none; +} + +/* don't display the horizontal lines */ +.fc-slats, +.fc-time-grid hr { /* this hr is used when height is underused and needs to be filled */ + display: none !important; /* important overrides inline declaration */ +} + +/* let the container that holds the events be naturally positioned and create real height */ +.fc-time-grid .fc-content-skeleton { + position: static; +} + +/* in case there are no events, we still want some height */ +.fc-time-grid .fc-content-skeleton table { + height: 4em; +} + +/* kill the horizontal spacing made by the event container. event margins will be done below */ +.fc-time-grid .fc-event-container { + margin: 0 !important; +} + + +/* TimeGrid *Event* Restyling +--------------------------------------------------------------------------------------------------*/ + +/* naturally position events, vertically stacking them */ +.fc-time-grid .fc-event { + position: static !important; + margin: 3px 2px !important; +} + +/* for events that continue to a future day, give the bottom border back */ +.fc-time-grid .fc-event.fc-not-end { + border-bottom-width: 1px !important; +} + +/* indicate the event continues via "..." text */ +.fc-time-grid .fc-event.fc-not-end:after { + content: "..."; +} + +/* for events that are continuations from previous days, give the top border back */ +.fc-time-grid .fc-event.fc-not-start { + border-top-width: 1px !important; +} + +/* indicate the event is a continuation via "..." text */ +.fc-time-grid .fc-event.fc-not-start:before { + content: "..."; +} + +/* time */ + +/* undo a previous declaration and let the time text span to a second line */ +.fc-time-grid .fc-event .fc-time { + white-space: normal !important; +} + +/* hide the the time that is normally displayed... */ +.fc-time-grid .fc-event .fc-time span { + display: none; +} + +/* ...replace it with a more verbose version (includes AM/PM) stored in an html attribute */ +.fc-time-grid .fc-event .fc-time:after { + content: attr(data-full); +} + + +/* Vertical Scroller & Containers +--------------------------------------------------------------------------------------------------*/ + +/* kill the scrollbars and allow natural height */ +.fc-scroller, +.fc-day-grid-container, /* these divs might be assigned height, which we need to cleared */ +.fc-time-grid-container { /* */ + overflow: visible !important; + height: auto !important; +} + +/* kill the horizontal border/padding used to compensate for scrollbars */ +.fc-row { + border: 0 !important; + margin: 0 !important; +} + + +/* Button Controls +--------------------------------------------------------------------------------------------------*/ + +.fc-button-group, +.fc button { + display: none; /* don't display any button-related controls */ +} diff --git a/css/jquery-ui.css b/css/jquery-ui.css new file mode 100644 index 0000000..acc2cdd --- /dev/null +++ b/css/jquery-ui.css @@ -0,0 +1,1314 @@ +/*! jQuery UI - v1.13.2 - 2022-07-14 +* http://jqueryui.com +* Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&fwDefault=normal&cornerRadius=3px&bgColorHeader=e9e9e9&bgTextureHeader=flat&borderColorHeader=dddddd&fcHeader=333333&iconColorHeader=444444&bgColorContent=ffffff&bgTextureContent=flat&borderColorContent=dddddd&fcContent=333333&iconColorContent=444444&bgColorDefault=f6f6f6&bgTextureDefault=flat&borderColorDefault=c5c5c5&fcDefault=454545&iconColorDefault=777777&bgColorHover=ededed&bgTextureHover=flat&borderColorHover=cccccc&fcHover=2b2b2b&iconColorHover=555555&bgColorActive=007fff&bgTextureActive=flat&borderColorActive=003eff&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=fffa90&bgTextureHighlight=flat&borderColorHighlight=dad55e&fcHighlight=777620&iconColorHighlight=777620&bgColorError=fddfdf&bgTextureError=flat&borderColorError=f1a899&fcError=5f3f3f&iconColorError=cc0000&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=666666&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=5px&offsetTopShadow=0px&offsetLeftShadow=0px&cornerRadiusShadow=8px +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + -ms-filter: "alpha(opacity=0)"; /* support: IE8 */ +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; + pointer-events: none; +} + + +/* Icons +----------------------------------*/ +.ui-icon { + display: inline-block; + vertical-align: middle; + margin-top: -.25em; + position: relative; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + +.ui-widget-icon-block { + left: 50%; + margin-left: -8px; + display: block; +} + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin: 2px 0 0 0; + padding: .5em .5em .5em .7em; + font-size: 100%; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-menu { + list-style: none; + padding: 0; + margin: 0; + display: block; + outline: 0; +} +.ui-menu .ui-menu { + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + cursor: pointer; + /* support: IE10, see #8844 */ + list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); +} +.ui-menu .ui-menu-item-wrapper { + position: relative; + padding: 3px 1em 3px .4em; +} +.ui-menu .ui-menu-divider { + margin: 5px 0; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active { + margin: -1px; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item-wrapper { + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: 0; + bottom: 0; + left: .2em; + margin: auto 0; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + left: auto; + right: 0; +} +.ui-button { + padding: .4em 1em; + display: inline-block; + position: relative; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + /* Support: IE <= 11 */ + overflow: visible; +} + +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} + +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2em; + box-sizing: border-box; + text-indent: -9999px; + white-space: nowrap; +} + +/* no icon support for input elements */ +input.ui-button.ui-button-icon-only { + text-indent: 0; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon { + position: absolute; + top: 50%; + left: 50%; + margin-top: -8px; + margin-left: -8px; +} + +.ui-button.ui-icon-notext .ui-icon { + padding: 0; + width: 2.1em; + height: 2.1em; + text-indent: -9999px; + white-space: nowrap; + +} + +input.ui-button.ui-icon-notext .ui-icon { + width: auto; + height: auto; + text-indent: 0; + white-space: normal; + padding: .4em 1em; +} + +/* workarounds */ +/* Support: Firefox 5 - 40 */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-controlgroup { + vertical-align: middle; + display: inline-block; +} +.ui-controlgroup > .ui-controlgroup-item { + float: left; + margin-left: 0; + margin-right: 0; +} +.ui-controlgroup > .ui-controlgroup-item:focus, +.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus { + z-index: 9999; +} +.ui-controlgroup-vertical > .ui-controlgroup-item { + display: block; + float: none; + width: 100%; + margin-top: 0; + margin-bottom: 0; + text-align: left; +} +.ui-controlgroup-vertical .ui-controlgroup-item { + box-sizing: border-box; +} +.ui-controlgroup .ui-controlgroup-label { + padding: .4em 1em; +} +.ui-controlgroup .ui-controlgroup-label span { + font-size: 80%; +} +.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item { + border-left: none; +} +.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item { + border-top: none; +} +.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content { + border-right: none; +} +.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content { + border-bottom: none; +} + +/* Spinner specific style fixes */ +.ui-controlgroup-vertical .ui-spinner-input { + + /* Support: IE8 only, Android < 4.4 only */ + width: 75%; + width: calc( 100% - 2.4em ); +} +.ui-controlgroup-vertical .ui-spinner .ui-spinner-up { + border-top-style: solid; +} + +.ui-checkboxradio-label .ui-icon-background { + box-shadow: inset 1px 1px 1px #ccc; + border-radius: .12em; + border: none; +} +.ui-checkboxradio-radio-label .ui-icon-background { + width: 16px; + height: 16px; + border-radius: 1em; + overflow: visible; + border: none; +} +.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon, +.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon { + background-image: none; + width: 8px; + height: 8px; + border-width: 4px; + border-style: solid; +} +.ui-checkboxradio-disabled { + pointer-events: none; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 45%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} + +/* Icons */ +.ui-datepicker .ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; + left: .5em; + top: .3em; +} +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 20px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-n { + height: 2px; + top: 0; +} +.ui-dialog .ui-resizable-e { + width: 2px; + right: 0; +} +.ui-dialog .ui-resizable-s { + height: 2px; + bottom: 0; +} +.ui-dialog .ui-resizable-w { + width: 2px; + left: 0; +} +.ui-dialog .ui-resizable-se, +.ui-dialog .ui-resizable-sw, +.ui-dialog .ui-resizable-ne, +.ui-dialog .ui-resizable-nw { + width: 7px; + height: 7px; +} +.ui-dialog .ui-resizable-se { + right: 0; + bottom: 0; +} +.ui-dialog .ui-resizable-sw { + left: 0; + bottom: 0; +} +.ui-dialog .ui-resizable-ne { + right: 0; + top: 0; +} +.ui-dialog .ui-resizable-nw { + left: 0; + top: 0; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-draggable-handle { + -ms-touch-action: none; + touch-action: none; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; + -ms-touch-action: none; + touch-action: none; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); + height: 100%; + -ms-filter: "alpha(opacity=25)"; /* support: IE8 */ + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-selectable { + -ms-touch-action: none; + touch-action: none; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-selectmenu-menu { + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + display: none; +} +.ui-selectmenu-menu .ui-menu { + overflow: auto; + overflow-x: hidden; + padding-bottom: 1px; +} +.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { + font-size: 1em; + font-weight: bold; + line-height: 1.5; + padding: 2px 0.4em; + margin: 0.5em 0 0 0; + height: auto; + border: 0; +} +.ui-selectmenu-open { + display: block; +} +.ui-selectmenu-text { + display: block; + margin-right: 20px; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-selectmenu-button.ui-button { + text-align: left; + white-space: nowrap; + width: 14em; +} +.ui-selectmenu-icon.ui-icon { + float: right; + margin-top: 0; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: pointer; + -ms-touch-action: none; + touch-action: none; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* support: IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-sortable-handle { + -ms-touch-action: none; + touch-action: none; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: .222em 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 2em; +} +.ui-spinner-button { + width: 1.6em; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to override default borders */ +.ui-spinner a.ui-spinner-button { + border-top-style: none; + border-bottom-style: none; + border-right-style: none; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav .ui-tabs-anchor { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { + cursor: text; +} +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; +} +body .ui-tooltip { + border-width: 2px; +} +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Arial,Helvetica,sans-serif; + font-size: 1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Arial,Helvetica,sans-serif; + font-size: 1em; +} +.ui-widget.ui-widget-content { + border: 1px solid #c5c5c5; +} +.ui-widget-content { + border: 1px solid #dddddd; + background: #ffffff; + color: #333333; +} +.ui-widget-content a { + color: #333333; +} +.ui-widget-header { + border: 1px solid #dddddd; + background: #e9e9e9; + color: #333333; + font-weight: bold; +} +.ui-widget-header a { + color: #333333; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default, +.ui-button, + +/* We use html here because we need a greater specificity to make sure disabled +works properly when clicked or hovered */ +html .ui-button.ui-state-disabled:hover, +html .ui-button.ui-state-disabled:active { + border: 1px solid #c5c5c5; + background: #f6f6f6; + font-weight: normal; + color: #454545; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited, +a.ui-button, +a:link.ui-button, +a:visited.ui-button, +.ui-button { + color: #454545; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus, +.ui-button:hover, +.ui-button:focus { + border: 1px solid #cccccc; + background: #ededed; + font-weight: normal; + color: #2b2b2b; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited, +.ui-state-focus a, +.ui-state-focus a:hover, +.ui-state-focus a:link, +.ui-state-focus a:visited, +a.ui-button:hover, +a.ui-button:focus { + color: #2b2b2b; + text-decoration: none; +} + +.ui-visual-focus { + box-shadow: 0 0 3px 1px rgb(94, 158, 214); +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active, +a.ui-button:active, +.ui-button:active, +.ui-button.ui-state-active:hover { + border: 1px solid #003eff; + background: #007fff; + font-weight: normal; + color: #ffffff; +} +.ui-icon-background, +.ui-state-active .ui-icon-background { + border: #003eff; + background-color: #ffffff; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #ffffff; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #dad55e; + background: #fffa90; + color: #777620; +} +.ui-state-checked { + border: 1px solid #dad55e; + background: #fffa90; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #777620; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #f1a899; + background: #fddfdf; + color: #5f3f3f; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #5f3f3f; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #5f3f3f; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + -ms-filter: "alpha(opacity=70)"; /* support: IE8 */ + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + -ms-filter: "alpha(opacity=35)"; /* support: IE8 */ + background-image: none; +} +.ui-state-disabled .ui-icon { + -ms-filter: "alpha(opacity=35)"; /* support: IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url("images/ui-icons_444444_256x240.png"); +} +.ui-widget-header .ui-icon { + background-image: url("images/ui-icons_444444_256x240.png"); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon, +.ui-button:hover .ui-icon, +.ui-button:focus .ui-icon { + background-image: url("images/ui-icons_555555_256x240.png"); +} +.ui-state-active .ui-icon, +.ui-button:active .ui-icon { + background-image: url("images/ui-icons_ffffff_256x240.png"); +} +.ui-state-highlight .ui-icon, +.ui-button .ui-state-highlight.ui-icon { + background-image: url("images/ui-icons_777620_256x240.png"); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url("images/ui-icons_cc0000_256x240.png"); +} +.ui-button .ui-icon { + background-image: url("images/ui-icons_777777_256x240.png"); +} + +/* positioning */ +/* Three classes needed to override `.ui-button:hover .ui-icon` */ +.ui-icon-blank.ui-icon-blank.ui-icon-blank { + background-image: none; +} +.ui-icon-caret-1-n { background-position: 0 0; } +.ui-icon-caret-1-ne { background-position: -16px 0; } +.ui-icon-caret-1-e { background-position: -32px 0; } +.ui-icon-caret-1-se { background-position: -48px 0; } +.ui-icon-caret-1-s { background-position: -65px 0; } +.ui-icon-caret-1-sw { background-position: -80px 0; } +.ui-icon-caret-1-w { background-position: -96px 0; } +.ui-icon-caret-1-nw { background-position: -112px 0; } +.ui-icon-caret-2-n-s { background-position: -128px 0; } +.ui-icon-caret-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -65px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -65px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 1px -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 3px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 3px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 3px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 3px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa; + opacity: .3; + -ms-filter: Alpha(Opacity=30); /* support: IE8 */ +} +.ui-widget-shadow { + -webkit-box-shadow: 0px 0px 5px #666666; + box-shadow: 0px 0px 5px #666666; +} diff --git a/css/optionbox.css b/css/optionbox.css new file mode 100644 index 0000000..1db2fe2 --- /dev/null +++ b/css/optionbox.css @@ -0,0 +1,1745 @@ +/*********************************************** start jquery ui selection ****************************************/ +.ui-multiselect { padding:2px 0 2px 4px; text-align:left } +.ui-multiselect span.ui-icon { float:right } +.ui-multiselect-single .ui-multiselect-checkboxes input { position:absolute !important; top: auto !important; left:-9999px; } +.ui-multiselect-single .ui-multiselect-checkboxes label { padding:5px !important } + +.ui-multiselect-header { margin-bottom:3px; padding:3px 0 3px 4px } +.ui-multiselect-header ul { font-size:0.9em } +.ui-multiselect-header ul li { float:left; padding:0 10px 0 0; display:none;} +.ui-multiselect-header a { text-decoration:none } +.ui-multiselect-header a:hover { text-decoration:underline } +.ui-multiselect-header span.ui-icon { float:left } +.ui-multiselect-header li.ui-multiselect-close { float:right; text-align:right; padding-right:0 } + +.ui-multiselect-menu { display:none; padding:3px; position:absolute; z-index:10000; text-align: left } +.ui-multiselect-checkboxes { position:relative /* fixes bug in IE6/7 */; overflow-y:auto } +.ui-multiselect-checkboxes label { cursor:default; display:block; border:1px solid transparent; padding:3px 1px } +.ui-multiselect-checkboxes label input { position:relative; top:1px; margin-right:10px; } +.ui-multiselect-checkboxes li { clear:both; font-size:0.9em; padding-right:3px } +.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label { text-align:center; font-weight:bold; border-bottom:1px solid } +.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label a { display:block; padding:3px; margin:1px 0; text-decoration:none } +.ui-multiselect{ width:100% !important } + +/* remove label borders in IE6 because IE6 does not support transparency */ +* html .ui-multiselect-checkboxes label { border:none } +/*! jQuery UI - v1.9.2 - 2012-11-23 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css +* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } +.ui-helper-clearfix:after { clear: both; } +.ui-helper-clearfix { zoom: 1; } +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + +.ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; } +.ui-accordion .ui-accordion-icons { padding-left: 2.2em; } +.ui-accordion .ui-accordion-noicons { padding-left: .7em; } +.ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; } + +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; + z-index:99 !important; +} + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; } +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ + + +.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } + +.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; } +.ui-menu .ui-menu { margin-top: -3px; position: absolute; } +.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; } +.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; } +.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; } +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; } + +.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; } +.ui-menu .ui-state-disabled a { cursor: default; } + +/* icon support */ +.ui-menu-icons { position: relative; } +.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; } + +/* left-aligned */ +.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; } + +/* right-aligned */ +.ui-menu .ui-menu-icon { position: static; float: right; } + +.ui-progressbar { height:2em; text-align: left; overflow: hidden; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; } +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } + +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; } +.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; } +.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; } +.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; } +.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */ +.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */ +.ui-spinner-up { top: 0; } +.ui-spinner-down { bottom: 0; } + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position:-65px -16px; +} + +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } + +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +/* Fades and background-images don't work well together in IE6, drop the image */ +* html .ui-tooltip { + background-image: none; +} +body .ui-tooltip { border-width: 2px; } + +/* Component containers +----------------------------------*/ +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(../images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } +.ui-widget-content a { color: #333333; } +.ui-widget-header a { color: #ffffff; } + +/* Interaction states +----------------------------------*/ +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } +.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #c77405; text-decoration: none; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; } + +/* Interaction Cues +----------------------------------*/ +/*.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(../images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; }*/ +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } + +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(../images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } +.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */ + +/* Icons +----------------------------------*/ + +/* states and images */ +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { background: #666666 url(../images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .5;filter:Alpha(Opacity=50); } +.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(../images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .2;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } +/************************************************end jquery ui selection *****************************************/ + + + + + + + +/*! jQuery UI - v1.12.1 - 2018-09-23 +* http://jqueryui.com +* Includes: draggable.css, core.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=base&cornerRadiusShadow=8px&offsetLeftShadow=0px&offsetTopShadow=0px&thicknessShadow=5px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=666666&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cc0000&fcError=5f3f3f&borderColorError=f1a899&bgTextureError=flat&bgColorError=fddfdf&iconColorHighlight=777620&fcHighlight=777620&borderColorHighlight=dad55e&bgTextureHighlight=flat&bgColorHighlight=fffa90&iconColorActive=ffffff&fcActive=ffffff&borderColorActive=003eff&bgTextureActive=flat&bgColorActive=007fff&iconColorHover=555555&fcHover=2b2b2b&borderColorHover=cccccc&bgTextureHover=flat&bgColorHover=ededed&iconColorDefault=777777&fcDefault=454545&borderColorDefault=c5c5c5&bgTextureDefault=flat&bgColorDefault=f6f6f6&iconColorContent=444444&fcContent=333333&borderColorContent=dddddd&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=444444&fcHeader=333333&borderColorHeader=dddddd&bgTextureHeader=flat&bgColorHeader=e9e9e9&cornerRadius=3px&fwDefault=normal&fsDefault=1em&ffDefault=Arial%2CHelvetica%2Csans-serif +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +.ui-draggable-handle { + -ms-touch-action: none; + touch-action: none; +} +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); /* support: IE8 */ +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; + pointer-events: none; +} + + +/* Icons +----------------------------------*/ +.ui-icon { + display: inline-block; + vertical-align: middle; + margin-top: -.25em; + position: relative; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + +.ui-widget-icon-block { + left: 50%; + margin-left: -8px; + display: block; +} + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; + -ms-touch-action: none; + touch-action: none; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable { + -ms-touch-action: none; + touch-action: none; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-sortable-handle { + -ms-touch-action: none; + touch-action: none; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin: 2px 0 0 0; + padding: .5em .5em .5em .7em; + font-size: 100%; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-menu { + list-style: none; + padding: 0; + margin: 0; + display: block; + outline: 0; +} +.ui-menu .ui-menu { + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + cursor: pointer; + /* support: IE10, see #8844 */ + list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); +} +.ui-menu .ui-menu-item-wrapper { + position: relative; + padding: 3px 1em 3px .4em; +} +.ui-menu .ui-menu-divider { + margin: 5px 0; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active { + margin: -1px; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item-wrapper { + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: 0; + bottom: 0; + left: .2em; + margin: auto 0; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + left: auto; + right: 0; +} +.ui-button { + padding: .4em 1em; + display: inline-block; + position: relative; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + /* Support: IE <= 11 */ + overflow: visible; +} + +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} + +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2em; + box-sizing: border-box; + text-indent: -9999px; + white-space: nowrap; +} + +/* no icon support for input elements */ +input.ui-button.ui-button-icon-only { + text-indent: 0; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon { + position: absolute; + top: 50%; + left: 50%; + margin-top: -8px; + margin-left: -8px; +} + +.ui-button.ui-icon-notext .ui-icon { + padding: 0; + width: 2.1em; + height: 2.1em; + text-indent: -9999px; + white-space: nowrap; + +} + +input.ui-button.ui-icon-notext .ui-icon { + width: auto; + height: auto; + text-indent: 0; + white-space: normal; + padding: .4em 1em; +} + +/* workarounds */ +/* Support: Firefox 5 - 40 */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-controlgroup { + vertical-align: middle; + display: inline-block; +} +.ui-controlgroup > .ui-controlgroup-item { + float: left; + margin-left: 0; + margin-right: 0; +} +.ui-controlgroup > .ui-controlgroup-item:focus, +.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus { + z-index: 9999; +} +.ui-controlgroup-vertical > .ui-controlgroup-item { + display: block; + float: none; + width: 100%; + margin-top: 0; + margin-bottom: 0; + text-align: left; +} +.ui-controlgroup-vertical .ui-controlgroup-item { + box-sizing: border-box; +} +.ui-controlgroup .ui-controlgroup-label { + padding: .4em 1em; +} +.ui-controlgroup .ui-controlgroup-label span { + font-size: 80%; +} +.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item { + border-left: none; +} +.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item { + border-top: none; +} +.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content { + border-right: none; +} +.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content { + border-bottom: none; +} + +/* Spinner specific style fixes */ +.ui-controlgroup-vertical .ui-spinner-input { + + /* Support: IE8 only, Android < 4.4 only */ + width: 75%; + width: calc( 100% - 2.4em ); +} +.ui-controlgroup-vertical .ui-spinner .ui-spinner-up { + border-top-style: solid; +} + +.ui-checkboxradio-label .ui-icon-background { + box-shadow: inset 1px 1px 1px #ccc; + border-radius: .12em; + border: none; +} +.ui-checkboxradio-radio-label .ui-icon-background { + width: 16px; + height: 16px; + border-radius: 1em; + overflow: visible; + border: none; +} +.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon, +.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon { + background-image: none; + width: 8px; + height: 8px; + border-width: 4px; + border-style: solid; +} +.ui-checkboxradio-disabled { + pointer-events: none; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 45%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} + +/* Icons */ +.ui-datepicker .ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; + left: .5em; + top: .3em; +} +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 20px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-n { + height: 2px; + top: 0; +} +.ui-dialog .ui-resizable-e { + width: 2px; + right: 0; +} +.ui-dialog .ui-resizable-s { + height: 2px; + bottom: 0; +} +.ui-dialog .ui-resizable-w { + width: 2px; + left: 0; +} +.ui-dialog .ui-resizable-se, +.ui-dialog .ui-resizable-sw, +.ui-dialog .ui-resizable-ne, +.ui-dialog .ui-resizable-nw { + width: 7px; + height: 7px; +} +.ui-dialog .ui-resizable-se { + right: 0; + bottom: 0; +} +.ui-dialog .ui-resizable-sw { + left: 0; + bottom: 0; +} +.ui-dialog .ui-resizable-ne { + right: 0; + top: 0; +} +.ui-dialog .ui-resizable-nw { + left: 0; + top: 0; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); + height: 100%; + filter: alpha(opacity=25); /* support: IE8 */ + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-selectmenu-menu { + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + display: none; +} +.ui-selectmenu-menu .ui-menu { + overflow: auto; + overflow-x: hidden; + padding-bottom: 1px; +} +.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { + font-size: 1em; + font-weight: bold; + line-height: 1.5; + padding: 2px 0.4em; + margin: 0.5em 0 0 0; + height: auto; + border: 0; +} +.ui-selectmenu-open { + display: block; +} +.ui-selectmenu-text { + display: block; + margin-right: 20px; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-selectmenu-button.ui-button { + text-align: left; + white-space: nowrap; + width: 14em; +} +.ui-selectmenu-icon.ui-icon { + float: right; + margin-top: 0; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; + -ms-touch-action: none; + touch-action: none; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* support: IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: .222em 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 2em; +} +.ui-spinner-button { + width: 1.6em; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to override default borders */ +.ui-spinner a.ui-spinner-button { + border-top-style: none; + border-bottom-style: none; + border-right-style: none; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav .ui-tabs-anchor { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { + cursor: text; +} +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Arial,Helvetica,sans-serif; + font-size: 1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Arial,Helvetica,sans-serif; + font-size: 1em; +} +.ui-widget.ui-widget-content { + border: 1px solid #c5c5c5; +} +.ui-widget-content { + border: 1px solid #dddddd; + background: #ffffff; + color: #333333; +} +.ui-widget-content a { + color: #333333; +} +.ui-widget-header { + border: 1px solid #dddddd; + background: #e9e9e9; + color: #333333; + font-weight: bold; +} +.ui-widget-header a { + color: #333333; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default, +.ui-button, + +/* We use html here because we need a greater specificity to make sure disabled +works properly when clicked or hovered */ +html .ui-button.ui-state-disabled:hover, +html .ui-button.ui-state-disabled:active { + border: 1px solid #c5c5c5; + background: #f6f6f6; + font-weight: normal; + color: #454545; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited, +a.ui-button, +a:link.ui-button, +a:visited.ui-button, +.ui-button { + color: #454545; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus, +.ui-button:hover, +.ui-button:focus { + border: 1px solid #cccccc; + background: #ededed; + font-weight: normal; + color: #2b2b2b; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited, +.ui-state-focus a, +.ui-state-focus a:hover, +.ui-state-focus a:link, +.ui-state-focus a:visited, +a.ui-button:hover, +a.ui-button:focus { + color: #2b2b2b; + text-decoration: none; +} + +.ui-visual-focus { + box-shadow: 0 0 3px 1px rgb(94, 158, 214); +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active, +a.ui-button:active, +.ui-button:active, +.ui-button.ui-state-active:hover { + border: 1px solid #003eff; + background: #007fff; + font-weight: normal; + color: #ffffff; +} +.ui-icon-background, +.ui-state-active .ui-icon-background { + border: #003eff; + background-color: #ffffff; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #ffffff; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #dad55e; + background: #fffa90; + color: #777620; +} +.ui-state-checked { + border: 1px solid #dad55e; + background: #fffa90; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #777620; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #f1a899; + background: #fddfdf; + color: #5f3f3f; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #5f3f3f; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #5f3f3f; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); /* support: IE8 */ + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); /* support: IE8 */ + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url("../images/ui-icons_444444_256x240.png"); +} +.ui-widget-header .ui-icon { + background-image: url("../images/ui-icons_444444_256x240.png"); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon, +.ui-button:hover .ui-icon, +.ui-button:focus .ui-icon { + background-image: url("../images/ui-icons_555555_256x240.png"); +} +.ui-state-active .ui-icon, +.ui-button:active .ui-icon { + background-image: url("../images/ui-icons_ffffff_256x240.png"); +} +.ui-state-highlight .ui-icon, +.ui-button .ui-state-highlight.ui-icon { + background-image: url("../images/ui-icons_777620_256x240.png"); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url("../images/ui-icons_cc0000_256x240.png"); +} +.ui-button .ui-icon { + background-image: url("../images/ui-icons_777777_256x240.png"); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-caret-1-n { background-position: 0 0; } +.ui-icon-caret-1-ne { background-position: -16px 0; } +.ui-icon-caret-1-e { background-position: -32px 0; } +.ui-icon-caret-1-se { background-position: -48px 0; } +.ui-icon-caret-1-s { background-position: -65px 0; } +.ui-icon-caret-1-sw { background-position: -80px 0; } +.ui-icon-caret-1-w { background-position: -96px 0; } +.ui-icon-caret-1-nw { background-position: -112px 0; } +.ui-icon-caret-2-n-s { background-position: -128px 0; } +.ui-icon-caret-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -65px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -65px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 1px -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 3px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 3px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 3px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 3px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa; + opacity: .3; + filter: Alpha(Opacity=30); /* support: IE8 */ +} +.ui-widget-shadow { + -webkit-box-shadow: 0px 0px 5px #666666; + box-shadow: 0px 0px 5px #666666; +} diff --git a/css/salary_pdf.css b/css/salary_pdf.css new file mode 100644 index 0000000..27a7ee2 --- /dev/null +++ b/css/salary_pdf.css @@ -0,0 +1,57 @@ + +td { + padding-left:7px; + padding-top: 5px; + padding-bottom: 5px; +} +th { + padding: 3px; +} + +.calTable { + border-collapse: collapse; + border: 2px solid black; + margin-top: 40px; + margin-bottom: 0px; +} + +thead { + border: 2px solid black; + padding-left:4px; +} + +.title { + border: 2px solid black; +} + +.titleleft{ + text-align: left; +} + +.headtitle{ + text-align: center; +} + +.calTable td.leftLine { + border-left: 2px solid black; +} +.calTable th.leftLine { + border-left: 2px solid black; +} + +.calTable td.subtitle { + border: 2px solid black; +} + +.amount{ + text-align:right; + padding-right:10px; +} + +.bold{ + font-weight: bold; +} +img{ + margin-right: -80px; +} + diff --git a/css/visitation.css b/css/visitation.css new file mode 100644 index 0000000..3bca488 --- /dev/null +++ b/css/visitation.css @@ -0,0 +1,449 @@ +body{ + min-height: 100%; + height: auto; + font-size: 13px; +} +.modal-body{ + padding: 10px; + background-color:#000; +} +.modal-top{ + background-size: 100% auto; + width: 100%; + height: 25px; +} +.modal-center{ + background-size: 100% auto; + width: 100%; + min-height: 26px; + padding: 0 50px; + padding-bottom: 30px; +} +.modal-bottom{ + background-size: 100% auto; + width: 100%; + height: 26px; +} +.modal-backdrop.in{ + opacity: 0.1; +} +.input-form{ + width: 100%; + margin: 0 auto; +} +.input-form-next{ + width: 100%; +} +.logo-box{ + text-align: center; + padding: 0; +} +.logo{ + width: 100%; + max-width: 200px; +} +.input-box{ + margin-top: 20px; +} +.input{ + padding: 6px; + width: 100%; +} +.join-input-left{ + width: 100%; + padding: 6px; +} +.join-input-right{ + width: 100%; + padding: 6px; +} +.input-title{ + color: #fff; +} +.input-title-2 a{ + color:#fff; +} +.input-ul{ + margin-left: 0; + padding-left: 16px; +} +.input-submit{ + padding: 6px; + width: 100%; + margin-top: 10px; + background: #e8c77a; + color: #fff; + font-weight: bold; + border: 0; +} +.input-submit-a{ + display: block; + text-align: center; +} +.input-submit:hover, .input-submit:active{ + background: #b68f32; + color: #fff; + text-decoration: none !important; +} +.image-preview{ + width: 100%; +} +.table-box{ + border: 1px solid #fff; + margin-top: 10px; + margin-bottom: 10px; + padding: 10px; +} +.table-preview{ + width: 100%; + color: #fff; + font-size: 12px; +} +.table-preview td{ + vertical-align: top; + white-space: initial; +} + +.input-sub-box{ + background: #3e3c3c; + padding: 20px; + margin-top: 30px; +} +.qrcode-box{ + margin: 20px 0; + text-align: center; +} + +input.input:disabled, input.join-input-left:disabled, input.join-input-right:disabled{ + background: #ddd; +} +.title-box{ + margin-top: -30px; +} +.title{ + text-align: center; + color: #fff; + font-size: 20px; +} +.description{ + text-align: justify; + color: #fff; +} + +.desktop-preview{ + display: block; +} +.mobile-preview{ + display: none; +} +.input-mobile select, .input-mobile input { + float: left; +} +.input-mobile select{ + width: 30%; + height: 35px; +} +.input-mobile input{ + width: 70%; +} + + +.language{ + width: inherit; + float: right; + margin-top: 0; +} +.language a{ + color: #fff; +} +.language a.active{ + color: #e8c77b; +} + + +/* for mobile only */ +@media (max-width: 1200px) and (min-width: 981px){ + .forecast_box{ + max-width:800px; + margin-left:-400px; + } + .autocomplete_view_title { + width: 64%; + } +} +@media (max-width: 980px) and (min-width: 768px){ + .forecast_box{ + max-width:600px; + margin-left:-300px; + } + .btn, .form-control, table td, table th, .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ + padding:10px 6px; + } + .select2-container--default .select2-selection--single{ + height:auto; + padding:9.5px 6px; + } + .select2-container--default .select2-selection--single .select2-selection__arrow b{ + background-position:3px 8px ; + } + .list_item_sub, #list_item_main{ + padding-left: 25px; + padding-right: 50px; + } + .list_item_remark_a{ + top:9px; + } + .list_item_remove_a{ + top:6px; + } + .form-horizontal .list_item_status_box{ + padding-top:14px; + } + .mix_group{ + height:36px + } + .mix_textbox #company, .mix_textbox #return_customer, .mix_textbox #return_company, .mix_textbox .order_ajax_item_title{ + height:36px; + } + .dropdown-menu>li>a{ + padding:8px 14px; + } + .panel-body{ + font-size:14px; + } + .custom_dropdown .caret{ + margin-top:18px; + } + .care{ + margin-left:6px; + } + .custom_dropdown{ + height:41px; + } + .check_domain_form .select2{ + width: 110px !important; + } + .select2-container--default .select2-selection--multiple{ + padding:9px 3px; + } + .mix_group{ + height:42px; + } + .mix_option{ + clip: rect(-1px 1200px 42px 0); + } + .mix_option .form-control{ + padding-top:11px; + padding-bottom:11px; + } + .mix_textbox #company, .mix_textbox #return_customer, .mix_textbox #return_company, .mix_textbox .order_ajax_item_title{ + height:42px; + } + .list_item_sub { + margin-bottom: 35px; + } + .list_item_date_span{ + right:inherit; + left:5px; + top:45px; + } +} +@media only screen and (max-width:767px){ + .desktop-preview{ + display: none; + } + .mobile-preview{ + display: block; + } + .no_padding_under .mobile_padding_10{ + padding:5px 0; + } + .row_2_padding { + padding: 0; + margin-bottom: 6px; + } + .forecast_box{ + width: 90%; + max-width:100%; + left:0; + margin-left: 5%; + } + .commission_rule_box .col-sm-4{ + padding:0 0 0 0; + } + .btn, .form-control, table td, table th, .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ + padding:10px 6px; + } + .select2-container--default .select2-selection--single{ + height:auto; + padding:9.5px 6px; + } + .select2-container--default .select2-selection--single .select2-selection__arrow b{ + background-position:3px 8px ; + } + #check_domain_input{ + padding-right:259px; + } + .list_item_sub, #list_item_main{ + padding-left: 25px; + padding-right: 50px; + } + .list_item_remark_a{ + top:9px; + } + .list_item_remove_a{ + top:6px; + } + .form-horizontal .list_item_status_box{ + padding-top:14px; + } + .dropdown-menu>li>a{ + padding:8px 14px; + } + .panel-body{ + font-size:14px; + } + .header_company_box { + width: 100%; + margin-top: 8px; + } + .mix_group{ + height:36px + } + .mix_textbox #company, .mix_textbox #return_customer, .mix_textbox #return_company, .mix_textbox .order_ajax_item_title{ + height:36px; + } + .mobile_hide{ + display:none; + } + .comment_picture img{ + width:32px; + height:32px; + } + .custom_dropdown .caret{ + margin-top:18px; + } + .care{ + margin-left:6px; + } + .custom_dropdown{ + height:41px; + } + .check_domain_form .select2{ + width: 110px !important; + } + .select2-container--default .select2-selection--multiple{ + padding:9px 3px; + } + .mix_group{ + height:42px; + } + .mix_option{ + clip: rect(-1px 1200px 42px 0); + } + .mix_option .form-control{ + padding-top:11px; + padding-bottom:11px; + } + .mix_textbox #company, .mix_textbox #return_customer, .mix_textbox #return_company, .mix_textbox .order_ajax_item_title{ + height:42px; + } + .list_item_sub { + margin-bottom: 35px; + } + .list_item_date_span{ + right:inherit; + left:5px; + top:45px; + } + + .modal-dialog{ + width: 460px; + margin: 30px auto; + } + .modal-top{ + height: 19px; + } + .modal-center{ + min-height: 19px; + padding: 0 30px 30px; + } + .modal-bottom{ + height: 19px; + } +} +@media only screen and (max-width:667px){ + .modal-dialog{ + width: 540px; + } + .modal-top{ + height: 19px; + } + .modal-center{ + min-height: 19px; + padding: 0 30px 30px; + } + .modal-bottom{ + height: 19px; + } +} +@media only screen and (max-width:567px){ + .modal-dialog{ + width: 440px; + } + .modal-top{ + height: 18px; + } + .modal-center{ + min-height: 18px; + padding: 0 30px 30px; + } + .modal-bottom{ + height: 18px; + } +} +@media only screen and (max-width:479px){ + .modal-dialog{ + width: 420px; + } + .modal-top{ + height: 13px; + } + .modal-center{ + min-height: 13px; + padding: 0 25px 25px; + } + .modal-bottom{ + height: 13px; + } +} +@media only screen and (max-width:429px){ + .modal-dialog{ + width: 370px; + } + .modal-top{ + height: 13px; + } + .modal-center{ + min-height: 13px; + padding: 0 20px 20px; + } + .modal-bottom{ + height: 13px; + } +} +@media only screen and (max-width:380px){ + .modal-dialog{ + width: 320px; + } + .modal-top{ + height: 13px; + } + .modal-center{ + min-height: 13px; + padding: 0 20px 20px; + } + .modal-bottom{ + height: 13px; + } +} \ No newline at end of file diff --git a/dashboard/adjustment.php b/dashboard/adjustment.php new file mode 100644 index 0000000..c9f1a1f --- /dev/null +++ b/dashboard/adjustment.php @@ -0,0 +1,175 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// plus minus report +$group_lists = [] ; +$split_departmerns = [] ; +$split_lists = [] ; +$split_grouplists = [] ; +$all_lists = [] ; +$plus_lists = [] ; +$minus_lists = [] ; +$select_adjustment = $mysqli->query( "SELECT + SUM(a.point) as total, + SUM(CASE WHEN a.point > 0 THEN a.point ELSE 0 END) AS totalplus, + SUM(CASE WHEN a.point < 0 THEN a.point ELSE 0 END) AS totalminus, + a.staff_id + FROM staff_adjustment_point a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.created_at LIKE '%" . $date_time . "%' + AND b.deleted_at IS NULL + " . $search_query . " + GROUP BY a.staff_id" ) ; + + + +if ( $select_adjustment->num_rows > 0 ){ + while ( $row_adjustment = $select_adjustment->fetch_assoc() ){ + $get_department = $staffdeparments[$row_adjustment['staff_id']] ; + + $group_lists[$get_department] = ( $group_lists[$get_department] + $row_adjustment['total'] ) ; + + $split_lists['plus'][$get_department] = ( $split_lists['plus'][$get_department] + $row_adjustment['totalplus'] ) ; + $split_lists['minus'][$get_department] = ( $split_lists['minus'][$get_department] + $row_adjustment['totalminus'] ) ; + + $split_departmerns[$get_department] = $get_department ; + } +} + +foreach ( $group_lists as $k => $v ){ + $get_departmentname = ( $k == '0' ? 'Cross Department' : $department_lists[$k] ) ; + + $all_lists[] = [ + 'label' => $get_departmentname, + 'y' => floatval( $v ) + ] ; +} + +foreach ( $split_lists as $k_lists => $v_lists ){ + + $temps = [] ; + foreach ( $split_departmerns as $k_department => $v_department ){ + $temps[] = [ + 'label' => ( $v_department == '0' ? 'Cross Department' : $department_lists[$v_department] ), + 'y' => floatval( checkExists( $v_lists[$v_department], '0' ) ) + ] ; + } + + + $split_grouplists[] = [ + 'type' => 'bar', + 'showInLegend' => true, + 'name' => ucwords( $k_lists ), + 'dataPoints' => $temps + ] ; +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/association.php b/dashboard/association.php new file mode 100644 index 0000000..08f4ca7 --- /dev/null +++ b/dashboard/association.php @@ -0,0 +1,125 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// reject report +$reject_lists = [] ; +$select_association = $mysqli->query( "SELECT + COUNT(a.staff_id) as total, a.staff_id + FROM staff_association a + WHERE + a.deleted_at IS NULL AND a.status IN ( 'rejected', 'cancelled' ) AND a.updated_at LIKE '%" . $date_time . "%' + " . $search_query . " + GROUP BY a.staff_id" ) ; + + +if ( $select_association->num_rows > 0 ){ + while ( $row_association = $select_association->fetch_assoc() ){ + $get_department = $staffdeparments[$row_association['staff_id']] ; + + $reject_lists[] = [ + 'label' => ( $get_department == '0' ? 'Cross Department' : $department_lists[$get_department] ), + 'y' => floatval( $row_association['total'] ) + ] ; + } +} + + + +// complete report +$complete_lists = [] ; +$select_association = $mysqli->query( "SELECT + COUNT(a.staff_id) as total, a.staff_id + FROM staff_association a + WHERE + a.deleted_at IS NULL AND a.status IN ( 'confirmed', 'rated' ) AND a.updated_at LIKE '%" . $date_time . "%' + " . $search_query . " + GROUP BY a.staff_id" ) ; +if ( $select_association->num_rows > 0 ){ + while ( $row_association = $select_association->fetch_assoc() ){ + $get_department = $staffdeparments[$row_association['staff_id']] ; + + $complete_lists[] = [ + 'label' => ( $get_department == '0' ? 'Cross Department' : $department_lists[$get_department] ), + 'y' => floatval( $row_association['total'] ) + ] ; + } +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/attendance.php b/dashboard/attendance.php new file mode 100644 index 0000000..2aaa183 --- /dev/null +++ b/dashboard/attendance.php @@ -0,0 +1,115 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// report +$group_lists = [] ; +$split_departmerns = [] ; +$split_lists = [] ; +$split_grouplists = [] ; +$all_lists = [] ; +$select_attendance = $mysqli->query( "SELECT + COUNT(a.staff_id) as total, + a.staff_id + FROM staff_attendance_list a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.list_work_day > 0 AND a.list_date LIKE '%" . $date_time . "%' + " . str_replace( 'a.branch_id', 'b.branch_id', $search_query ) . " + GROUP BY a.staff_id" ) ; + +if ( $select_attendance ->num_rows > 0 ){ + while ( $row_attendance = $select_attendance->fetch_assoc() ){ + $get_department = $staffdeparments[$row_attendance['staff_id']] ; + $type = $row_attendance['type'] ; + + $group_lists[$get_department] = ( $group_lists[$get_department] + $row_attendance['total'] ) ; + + $split_lists[$type][$get_department] = ( $split_lists[$type][$get_department] + $row_attendance['total'] ) ; + + $split_departmerns[$get_department] = $get_department ; + } +} + +foreach ( $group_lists as $k => $v ){ + $get_departmentname = ( $k == '0' ? 'Cross Department' : $department_lists[$k] ) ; + + $all_lists[] = [ + 'label' => $get_departmentname, + 'y' => floatval( $v ) + ] ; +} + + + +foreach ( $split_lists as $k_lists => $v_lists ){ + + $temps = [] ; + foreach ( $split_departmerns as $k_department => $v_department ){ + $temps[] = [ + 'label' => ( $v_department == '0' ? 'Cross Department' : $department_lists[$v_department] ), + 'y' => floatval( checkExists( $v_lists[$v_department], '0' ) ) + ] ; + } + + $split_grouplists[] = [ + 'type' => 'bar', + 'showInLegend' => true, + 'name' => ucwords( $k_lists ), + 'dataPoints' => $temps + ] ; +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/attendancev2.php b/dashboard/attendancev2.php new file mode 100644 index 0000000..899b8ca --- /dev/null +++ b/dashboard/attendancev2.php @@ -0,0 +1,115 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// report +$group_lists = [] ; +$split_departmerns = [] ; +$split_lists = [] ; +$split_grouplists = [] ; +$all_lists = [] ; +$select_attendance = $mysqli->query( "SELECT + COUNT(a.staff_id) as total, + a.staff_id + FROM staff_attendance_list a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.list_date LIKE '%" . $date_time . "%' + " . str_replace( 'a.branch_id', 'b.branch_id', $search_query ) . " + GROUP BY a.staff_id" ) ; + +if ( $select_attendance ->num_rows > 0 ){ + while ( $row_attendance = $select_attendance->fetch_assoc() ){ + $get_department = $staffdeparments[$row_attendance['staff_id']] ; + $type = $row_attendance['type'] ; + + $group_lists[$get_department] = ( $group_lists[$get_department] + $row_attendance['total'] ) ; + + $split_lists[$type][$get_department] = ( $split_lists[$type][$get_department] + $row_attendance['total'] ) ; + + $split_departmerns[$get_department] = $get_department ; + } +} + +foreach ( $group_lists as $k => $v ){ + $get_departmentname = ( $k == '0' ? 'Cross Department' : $department_lists[$k] ) ; + + $all_lists[] = [ + 'label' => $get_departmentname, + 'y' => floatval( $v ) + ] ; +} + + + +foreach ( $split_lists as $k_lists => $v_lists ){ + + $temps = [] ; + foreach ( $split_departmerns as $k_department => $v_department ){ + $temps[] = [ + 'label' => ( $v_department == '0' ? 'Cross Department' : $department_lists[$v_department] ), + 'y' => floatval( checkExists( $v_lists[$v_department], '0' ) ) + ] ; + } + + $split_grouplists[] = [ + 'type' => 'bar', + 'showInLegend' => true, + 'name' => ucwords( $k_lists ), + 'dataPoints' => $temps + ] ; +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/grievance.php b/dashboard/grievance.php new file mode 100644 index 0000000..09b6d4c --- /dev/null +++ b/dashboard/grievance.php @@ -0,0 +1,125 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// reject report +$reject_lists = [] ; +$select_grievance = $mysqli->query( "SELECT + COUNT(a.staff_id) as total, a.staff_id + FROM grievance a + WHERE + a.deleted_at IS NULL AND a.status IN ( 'rejected' ) AND a.updated_at LIKE '%" . $date_time . "%' + " . $search_query . " + GROUP BY a.staff_id" ) ; + + +if ( $select_grievance->num_rows > 0 ){ + while ( $row_grievance = $select_grievance->fetch_assoc() ){ + $get_department = $staffdeparments[$row_grievance['staff_id']] ; + + $reject_lists[] = [ + 'label' => ( $get_department == '0' ? 'Cross Department' : $department_lists[$get_department] ), + 'y' => floatval( $row_grievance['total'] ) + ] ; + } +} + + + +// complete report +$complete_lists = [] ; +$select_grievance = $mysqli->query( "SELECT + COUNT(a.staff_id) as total, a.staff_id + FROM grievance a + WHERE + a.deleted_at IS NULL AND a.status IN ( 'confirmed' ) AND a.updated_at LIKE '%" . $date_time . "%' + " . $search_query . " + GROUP BY a.staff_id" ) ; +if ( $select_grievance->num_rows > 0 ){ + while ( $row_grievance = $select_grievance->fetch_assoc() ){ + $get_department = $staffdeparments[$row_grievance['staff_id']] ; + + $complete_lists[] = [ + 'label' => ( $get_department == '0' ? 'Cross Department' : $department_lists[$get_department] ), + 'y' => floatval( $row_grievance['total'] ) + ] ; + } +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/lateness-king.php b/dashboard/lateness-king.php new file mode 100644 index 0000000..fb6c3ba --- /dev/null +++ b/dashboard/lateness-king.php @@ -0,0 +1,167 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// report +$group_lists = [] ; +$split_departmerns = [] ; +$split_lists = [] ; +$split_grouplists = [] ; +$all_lists = [] ; +$select_latenesss = $mysqli->query( "SELECT + COUNT(a.staff_id) as total, + a.staff_id + FROM staff_attendance_list a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.list_late != '00:00:00' AND a.list_date LIKE '%" . $date_time . "%' + " . str_replace( 'a.branch_id', 'b.branch_id', $search_query ) . " + GROUP BY a.staff_id" ) ; +if ( $select_latenesss->num_rows > 0 ){ + while ( $row_latenesss = $select_latenesss->fetch_assoc() ){ + $get_department = $staffdeparments[$row_latenesss['staff_id']] ; + $type = $row_latenesss['type'] ; + + $group_lists[$get_department] = ( $group_lists[$get_department] + $row_latenesss['total'] ) ; + + $split_lists[$type][$get_department] = ( $split_lists[$type][$get_department] + $row_latenesss['total'] ) ; + + $split_departmerns[$get_department] = $get_department ; + } +} + +foreach ( $group_lists as $k => $v ){ + $get_departmentname = ( $k == '0' ? 'Cross Department' : $department_lists[$k] ) ; + + $all_lists[] = [ + 'label' => $get_departmentname, + 'y' => floatval( $v ) + ] ; +} + +foreach ( $split_lists as $k_lists => $v_lists ){ + + $temps = [] ; + foreach ( $split_departmerns as $k_department => $v_department ){ + $temps[] = [ + 'label' => ( $v_department == '0' ? 'Cross Department' : $department_lists[$v_department] ), + 'y' => floatval( checkExists( $v_lists[$v_department], '0' ) ) + ] ; + } + + $split_grouplists[] = [ + 'type' => 'bar', + 'showInLegend' => true, + 'name' => ucwords( $k_lists ), + 'dataPoints' => $temps + ] ; +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/lateness-kingv2.php b/dashboard/lateness-kingv2.php new file mode 100644 index 0000000..4ca68bc --- /dev/null +++ b/dashboard/lateness-kingv2.php @@ -0,0 +1,170 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// report +$group_lists = [] ; +$split_departmerns = [] ; +$split_lists = [] ; +$split_grouplists = [] ; +$all_lists = [] ; +$select_latenesss = $mysqli->query( "SELECT + COUNT(a.type) as total, + a.staff_id, + a.type + FROM staff_attendance_summary a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.created_at LIKE '%" . $date_time . "%' + AND a.type IN ( 'late', 'absent' ) + AND b.deleted_at IS NULL + " . $search_query . " + GROUP BY a.staff_id, a.type" ) ; +if ( $select_latenesss->num_rows > 0 ){ + while ( $row_latenesss = $select_latenesss->fetch_assoc() ){ + $get_department = $staffdeparments[$row_latenesss['staff_id']] ; + $type = $row_latenesss['type'] ; + + $group_lists[$get_department] = ( $group_lists[$get_department] + $row_latenesss['total'] ) ; + + $split_lists[$type][$get_department] = ( $split_lists[$type][$get_department] + $row_latenesss['total'] ) ; + + $split_departmerns[$get_department] = $get_department ; + } +} + +foreach ( $group_lists as $k => $v ){ + $get_departmentname = ( $k == '0' ? 'Cross Department' : $department_lists[$k] ) ; + + $all_lists[] = [ + 'label' => $get_departmentname, + 'y' => floatval( $v ) + ] ; +} + +foreach ( $split_lists as $k_lists => $v_lists ){ + + $temps = [] ; + foreach ( $split_departmerns as $k_department => $v_department ){ + $temps[] = [ + 'label' => ( $v_department == '0' ? 'Cross Department' : $department_lists[$v_department] ), + 'y' => floatval( checkExists( $v_lists[$v_department], '0' ) ) + ] ; + } + + $split_grouplists[] = [ + 'type' => 'bar', + 'showInLegend' => true, + 'name' => ucwords( $k_lists ), + 'dataPoints' => $temps + ] ; +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/outstanding-employee.php b/dashboard/outstanding-employee.php new file mode 100644 index 0000000..e0c9e49 --- /dev/null +++ b/dashboard/outstanding-employee.php @@ -0,0 +1,170 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// report +$group_lists = [] ; +$split_departmerns = [] ; +$split_lists = [] ; +$split_grouplists = [] ; +$all_lists = [] ; +$select_outstanding = $mysqli->query( "SELECT + COUNT(a.type) as total, + a.staff_id, + a.type + FROM staff_attendance_summary a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.created_at LIKE '%" . $date_time . "%' + AND a.type IN ( 'passionate', 'merit' ) + AND b.deleted_at IS NULL + " . $search_query . " + GROUP BY a.staff_id, a.type" ) ; +if ( $select_outstanding->num_rows > 0 ){ + while ( $row_outstanding = $select_outstanding->fetch_assoc() ){ + $get_department = $staffdeparments[$row_outstanding['staff_id']] ; + $type = $row_outstanding['type'] ; + + $group_lists[$get_department] = ( $group_lists[$get_department] + $row_outstanding['total'] ) ; + + $split_lists[$type][$get_department] = ( $split_lists[$type][$get_department] + $row_outstanding['total'] ) ; + + $split_departmerns[$get_department] = $get_department ; + } +} + +foreach ( $group_lists as $k => $v ){ + $get_departmentname = ( $k == '0' ? 'Cross Department' : $department_lists[$k] ) ; + + $all_lists[] = [ + 'label' => $get_departmentname, + 'y' => floatval( $v ) + ] ; +} + +foreach ( $split_lists as $k_lists => $v_lists ){ + + $temps = [] ; + foreach ( $split_departmerns as $k_department => $v_department ){ + $temps[] = [ + 'label' => ( $v_department == '0' ? 'Cross Department' : $department_lists[$v_department] ), + 'y' => floatval( checkExists( $v_lists[$v_department], '0' ) ) + ] ; + } + + $split_grouplists[] = [ + 'type' => 'bar', + 'showInLegend' => true, + 'name' => ucwords( $k_lists ), + 'dataPoints' => $temps + ] ; +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/point.php b/dashboard/point.php new file mode 100644 index 0000000..41c880c --- /dev/null +++ b/dashboard/point.php @@ -0,0 +1,115 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// report +$group_lists = [] ; +$split_departmerns = [] ; +$split_lists = [] ; +$split_grouplists = [] ; +$all_lists = [] ; +$select_achievement = $mysqli->query( "SELECT + SUM(a.staff_point_achievement) as totalpoint, + a.staff_id + FROM staff_monthly_achievement a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE + a.deleted_at IS NULL AND a.reported_at LIKE '%" . $date_time . "%' + AND b.deleted_at IS NULL + " . $search_query . " + GROUP BY a.staff_id" ) ; + +if ( $select_achievement ->num_rows > 0 ){ + while ( $row_achievement = $select_achievement->fetch_assoc() ){ + $get_department = $staffdeparments[$row_achievement['staff_id']] ; + $type = $row_achievement['type'] ; + + $group_lists[$get_department] = ( $group_lists[$get_department] + $row_achievement['totalpoint'] ) ; + + $split_lists[$type][$get_department] = ( $split_lists[$type][$get_department] + $row_achievement['totalpoint'] ) ; + + $split_departmerns[$get_department] = $get_department ; + } +} + +foreach ( $group_lists as $k => $v ){ + $get_departmentname = ( $k == '0' ? 'Cross Department' : $department_lists[$k] ) ; + + $all_lists[] = [ + 'label' => $get_departmentname, + 'y' => floatval( $v ) + ] ; +} + +foreach ( $split_lists as $k_lists => $v_lists ){ + + $temps = [] ; + foreach ( $split_departmerns as $k_department => $v_department ){ + $temps[] = [ + 'label' => ( $v_department == '0' ? 'Cross Department' : $department_lists[$v_department] ), + 'y' => floatval( checkExists( $v_lists[$v_department], '0' ) ) + ] ; + } + + $split_grouplists[] = [ + 'type' => 'bar', + 'showInLegend' => true, + 'name' => ucwords( $k_lists ), + 'dataPoints' => $temps + ] ; +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/redeem.php b/dashboard/redeem.php new file mode 100644 index 0000000..20e5813 --- /dev/null +++ b/dashboard/redeem.php @@ -0,0 +1,181 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + +// redeeem category +$categories = [] ; +$mysqli_category = $mysqli->query("SELECT a.category_id, b.title FROM redeem_category a + LEFT JOIN redeem_category_translation b ON ( a.category_id = b.category_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' ORDER BY a.sortable") ; +if ( $mysqli_category->num_rows > 0 ){ + while ( $row_category = $mysqli_category->fetch_assoc() ){ + $categories[$row_category['category_id']] = $row_category['title'] ; + } +} + + +// plus minus report +$group_lists = [] ; +$split_departmerns = [] ; +$split_lists = [] ; +$split_grouplists = [] ; +$all_lists = [] ; +$plus_lists = [] ; +$minus_lists = [] ; +$select_redeem = $mysqli->query( "SELECT + SUM(a.point) as totalpoint, + a.staff_id, + a.category_id + FROM staff_redeem a + WHERE a.deleted_at IS NULL AND a.created_at LIKE '%" . $date_time . "%' + AND a.status = 'confirmed' + " . $search_query . " + GROUP BY a.staff_id, a.category_id" ) ; +if ( $select_redeem->num_rows > 0 ){ + while ( $row_redeem = $select_redeem->fetch_assoc() ){ + $get_department = $staffdeparments[$row_redeem['staff_id']] ; + $category_id = $row_redeem['category_id'] ; + + $group_lists[$get_department] = ( $group_lists[$get_department] + $row_redeem['totalpoint'] ) ; + + $split_lists[$category_id][$get_department] = ( $split_lists[$category_id][$get_department] + $row_redeem['totalpoint'] ) ; + + $split_departmerns[$get_department] = $get_department ; + } +} + +foreach ( $group_lists as $k => $v ){ + $get_departmentname = ( $k == '0' ? 'Cross Department' : $department_lists[$k] ) ; + + $all_lists[] = [ + 'label' => $get_departmentname, + 'y' => floatval( $v ) + ] ; +} + +foreach ( $split_lists as $k_lists => $v_lists ){ + + $temps = [] ; + foreach ( $split_departmerns as $k_department => $v_department ){ + $temps[] = [ + 'label' => ( $v_department == '0' ? 'Cross Department' : $department_lists[$v_department] ), + 'y' => floatval( checkExists( $v_lists[$v_department], '0' ) ) + ] ; + } + + $split_grouplists[] = [ + 'type' => 'bar', + 'showInLegend' => true, + 'name' => ucwords( $categories[$k_lists] ), + 'dataPoints' => $temps + ] ; +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/request.php b/dashboard/request.php new file mode 100644 index 0000000..a59457c --- /dev/null +++ b/dashboard/request.php @@ -0,0 +1,181 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + +// redeeem category +$mains = [] ; +$mysqli_main = $mysqli->query("SELECT a.main_id, b.title FROM setting_request a + LEFT JOIN setting_request_translation b ON ( a.main_id = b.main_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' ORDER BY a.sortable") ; +if ( $mysqli_main->num_rows > 0 ){ + while ( $row_main = $mysqli_main->fetch_assoc() ){ + $mains[$row_main['main_id']] = $row_main['title'] ; + } +} + + +// plus minus report +$group_lists = [] ; +$split_departmerns = [] ; +$split_lists = [] ; +$split_grouplists = [] ; +$all_lists = [] ; +$plus_lists = [] ; +$minus_lists = [] ; +$select_request = $mysqli->query( "SELECT + SUM(a.quantity) as totalquantity, + a.staff_id, + a.main_id + FROM request a + WHERE a.deleted_at IS NULL AND a.created_at LIKE '%" . $date_time . "%' + AND a.status = 'confirmed' + " . $search_query . " + GROUP BY a.staff_id, a.main_id" ) ; +if ( $select_request->num_rows > 0 ){ + while ( $row_request = $select_request->fetch_assoc() ){ + $get_department = $staffdeparments[$row_request['staff_id']] ; + $main_id = $row_request['main_id'] ; + + $group_lists[$get_department] = ( $group_lists[$get_department] + $row_request['totalquantity'] ) ; + + $split_lists[$main_id][$get_department] = ( $split_lists[$main_id][$get_department] + $row_request['totalquantity'] ) ; + + $split_departmerns[$get_department] = $get_department ; + } +} + +foreach ( $group_lists as $k => $v ){ + $get_departmentname = ( $k == '0' ? 'Cross Department' : $department_lists[$k] ) ; + + $all_lists[] = [ + 'label' => $get_departmentname, + 'y' => floatval( $v ) + ] ; +} + +foreach ( $split_lists as $k_lists => $v_lists ){ + + $temps = [] ; + foreach ( $split_departmerns as $k_department => $v_department ){ + $temps[] = [ + 'label' => ( $v_department == '0' ? 'Cross Department' : $department_lists[$v_department] ), + 'y' => floatval( checkExists( $v_lists[$v_department], '0' ) ) + ] ; + } + + $split_grouplists[] = [ + 'type' => 'bar', + 'showInLegend' => true, + 'name' => ucwords( $mains[$k_lists] ), + 'dataPoints' => $temps + ] ; +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/staff-application.php b/dashboard/staff-application.php new file mode 100644 index 0000000..1c08d76 --- /dev/null +++ b/dashboard/staff-application.php @@ -0,0 +1,110 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + +// reject report +$reject_lists = [] ; +$select_employment = $mysqli->query( "SELECT + COUNT(a.employment_department) as total, + a.employment_department + FROM staff_employment a + WHERE a.deleted_at IS NULL AND a.employment_trash = '0' AND a.employment_modified LIKE '%" . $date_time . "%' + AND a.employment_status IN ( 'Processing Rejected', 'Reject' ) + " . $search_query . " + GROUP BY a.employment_department" ) ; +if ( $select_employment->num_rows > 0 ){ + while ( $row_employment = $select_employment->fetch_assoc() ){ + $get_department = $department_lists[$row_employment['employment_department']] ; + $get_department = ( $get_department == '' ? 'Cross Department' : $get_department ) ; + + $reject_lists[] = [ + 'label' => $get_department, + 'y' => floatval( $row_employment['total'] ) + ] ; + } +} + + +// complete report +$complete_lists = [] ; +$select_employment = $mysqli->query( "SELECT + COUNT(a.employment_department) as total, + a.employment_department + FROM staff_employment a + WHERE a.deleted_at IS NULL AND a.employment_trash = '0' AND a.employment_modified LIKE '%" . $date_time . "%' + AND a.employment_status IN ( 'Confirmation' ) + " . $search_query . " + GROUP BY a.employment_department" ) ; +if ( $select_employment->num_rows > 0 ){ + while ( $row_employment = $select_employment->fetch_assoc() ){ + $get_department = $department_lists[$row_employment['employment_department']] ; + $get_department = ( $get_department == '' ? 'Cross Department' : $get_department ) ; + + $complete_lists[] = [ + 'label' => $get_department, + 'y' => floatval( $row_employment['total'] ) + ] ; + } +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/star.php b/dashboard/star.php new file mode 100644 index 0000000..9fb75b7 --- /dev/null +++ b/dashboard/star.php @@ -0,0 +1,115 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// report +$group_lists = [] ; +$split_departmerns = [] ; +$split_lists = [] ; +$split_grouplists = [] ; +$all_lists = [] ; +$select_achievement = $mysqli->query( "SELECT + SUM(a.staff_star) as totalstar, + a.staff_id + FROM staff_monthly_achievement a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE + a.deleted_at IS NULL AND a.reported_at LIKE '%" . $date_time . "%' + AND b.deleted_at IS NULL + " . $search_query . " + GROUP BY a.staff_id" ) ; + +if ( $select_achievement ->num_rows > 0 ){ + while ( $row_achievement = $select_achievement->fetch_assoc() ){ + $get_department = $staffdeparments[$row_achievement['staff_id']] ; + $type = $row_achievement['type'] ; + + $group_lists[$get_department] = ( $group_lists[$get_department] + $row_achievement['totalstar'] ) ; + + $split_lists[$type][$get_department] = ( $split_lists[$type][$get_department] + $row_achievement['totalstar'] ) ; + + $split_departmerns[$get_department] = $get_department ; + } +} + +foreach ( $group_lists as $k => $v ){ + $get_departmentname = ( $k == '0' ? 'Cross Department' : $department_lists[$k] ) ; + + $all_lists[] = [ + 'label' => $get_departmentname, + 'y' => floatval( $v ) + ] ; +} + +foreach ( $split_lists as $k_lists => $v_lists ){ + + $temps = [] ; + foreach ( $split_departmerns as $k_department => $v_department ){ + $temps[] = [ + 'label' => ( $v_department == '0' ? 'Cross Department' : $department_lists[$v_department] ), + 'y' => floatval( checkExists( $v_lists[$v_department], '0' ) ) + ] ; + } + + $split_grouplists[] = [ + 'type' => 'bar', + 'showInLegend' => true, + 'name' => ucwords( $k_lists ), + 'dataPoints' => $temps + ] ; +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/suggestion.php b/dashboard/suggestion.php new file mode 100644 index 0000000..55ae5a4 --- /dev/null +++ b/dashboard/suggestion.php @@ -0,0 +1,125 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// reject report +$reject_lists = [] ; +$select_suggestion = $mysqli->query( "SELECT + COUNT(a.staff_id) as total, a.staff_id + FROM suggestion a + WHERE + a.deleted_at IS NULL AND a.status IN ( 'rejected' ) AND a.updated_at LIKE '%" . $date_time . "%' + " . $search_query . " + GROUP BY a.staff_id" ) ; + + +if ( $select_suggestion->num_rows > 0 ){ + while ( $row_suggestion = $select_suggestion->fetch_assoc() ){ + $get_department = $staffdeparments[$row_suggestion['staff_id']] ; + + $reject_lists[] = [ + 'label' => ( $get_department == '0' ? 'Cross Department' : $department_lists[$get_department] ), + 'y' => floatval( $row_suggestion['total'] ) + ] ; + } +} + + + +// complete report +$complete_lists = [] ; +$select_suggestion = $mysqli->query( "SELECT + COUNT(a.staff_id) as total, a.staff_id + FROM suggestion a + WHERE + a.deleted_at IS NULL AND a.status IN ( 'confirmed' ) AND a.updated_at LIKE '%" . $date_time . "%' + " . $search_query . " + GROUP BY a.staff_id" ) ; +if ( $select_suggestion->num_rows > 0 ){ + while ( $row_suggestion = $select_suggestion->fetch_assoc() ){ + $get_department = $staffdeparments[$row_suggestion['staff_id']] ; + + $complete_lists[] = [ + 'label' => ( $get_department == '0' ? 'Cross Department' : $department_lists[$get_department] ), + 'y' => floatval( $row_suggestion['total'] ) + ] ; + } +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/task.php b/dashboard/task.php new file mode 100644 index 0000000..be4bdfe --- /dev/null +++ b/dashboard/task.php @@ -0,0 +1,193 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// reject report +$reject_lists = [] ; +$select_task = $mysqli->query( "SELECT COUNT(a.department_id) as total, a.department_id FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'rejected', 'cancelled' ) AND a.updated_at LIKE '%" . $date_time . "%' " . $search_query . " + GROUP BY a.department_id" ) ; +if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $reject_lists[] = [ + 'label' => ( $row_task['department_id'] == '0' ? 'Cross Department' : $department_lists[$row_task['department_id']] ), + 'y' => floatval( $row_task['total'] ) + ] ; + } +} + +// complete report by difficulty +$difficulty_departments = [] ; +$difficulty_lists = [] ; +$difficulty_alllists = [] ; +$select_task = $mysqli->query( "SELECT COUNT(a.difficulty) as total, a.department_id, a.difficulty FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'approved' ) AND a.confirmed_at LIKE '%" . $date_time . "%' " . $search_query . " + GROUP BY a.department_id, a.difficulty" ) ; +if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $difficulty_lists[$row_task['difficulty']][$row_task['department_id']]= $row_task['total'] ; + $difficulty_departments[$row_task['department_id']] = $row_task['department_id'] ; + } +} + +foreach ( $difficulty_lists as $k_lists => $v_lists ){ + + $temps = [] ; + foreach ( $difficulty_departments as $k_department => $v_department ){ + $temps[] = [ + 'label' => ( $v_department == '0' ? 'Cross Department' : $department_lists[$v_department] ), + 'y' => floatval( checkExists( $v_lists[$v_department], '0' ) ) + ] ; + } + + + $difficulty_alllists[] = [ + 'type' => 'bar', + 'showInLegend' => true, + 'name' => ucwords( $k_lists ), + 'dataPoints' => $temps + ] ; +} + + + +// complete report +$complete_lists = [] ; +$select_task = $mysqli->query( "SELECT COUNT(a.department_id) as total, a.department_id FROM task a + WHERE a.deleted_at IS NULL AND a.status IN ( 'approved' ) AND a.confirmed_at LIKE '%" . $date_time . "%' " . $search_query . " + GROUP BY a.department_id" ) ; +if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + $complete_lists[] = [ + 'label' => ( $row_task['department_id'] == '0' ? 'Cross Department' : $department_lists[$row_task['department_id']] ), + 'y' => floatval( $row_task['total'] ) + ] ; + } +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/training.php b/dashboard/training.php new file mode 100644 index 0000000..b8a7a6f --- /dev/null +++ b/dashboard/training.php @@ -0,0 +1,125 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'" ) ; +if ( $select_departments->num_rows > 0 ){ + while ( $row_department = $select_departments->fetch_assoc() ){ + $department_lists[$row_department['department_id']] = dataFilter( $row_department['department_desc'] ) ; + } +} + + +// staff department +$staffdeparments = [] ; +$select_staffdeparments = $mysqli->query( "SELECT a.staff_id, a.department_id FROM staff_department + a + WHERE a.deleted_at IS NULL + GROUP BY a.staff_id" ) ; +if ( $select_staffdeparments->num_rows > 0 ){ + while ( $row_staffdeparment = $select_staffdeparments->fetch_assoc() ){ + $staffdeparments[$row_staffdeparment['staff_id']] = $row_staffdeparment['department_id'] ; + } +} + + +// reject report +$reject_lists = [] ; +$select_training = $mysqli->query( "SELECT + COUNT(a.staff_id) as total, a.staff_id + FROM staff_training a + WHERE + a.deleted_at IS NULL AND a.status IN ( 'rejected', 'cancelled' ) AND a.updated_at LIKE '%" . $date_time . "%' + " . $search_query . " + GROUP BY a.staff_id" ) ; + + +if ( $select_training->num_rows > 0 ){ + while ( $row_training = $select_training->fetch_assoc() ){ + $get_department = $staffdeparments[$row_training['staff_id']] ; + + $reject_lists[] = [ + 'label' => ( $get_department == '0' ? 'Cross Department' : $department_lists[$get_department] ), + 'y' => floatval( $row_training['total'] ) + ] ; + } +} + + + +// complete report +$complete_lists = [] ; +$select_training = $mysqli->query( "SELECT + COUNT(a.staff_id) as total, a.staff_id + FROM staff_training a + WHERE + a.deleted_at IS NULL AND a.status IN ( 'confirmed', 'rated' ) AND a.updated_at LIKE '%" . $date_time . "%' + " . $search_query . " + GROUP BY a.staff_id" ) ; +if ( $select_training->num_rows > 0 ){ + while ( $row_training = $select_training->fetch_assoc() ){ + $get_department = $staffdeparments[$row_training['staff_id']] ; + + $complete_lists[] = [ + 'label' => ( $get_department == '0' ? 'Cross Department' : $department_lists[$get_department] ), + 'y' => floatval( $row_training['total'] ) + ] ; + } +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/dashboard/visitor.php b/dashboard/visitor.php new file mode 100644 index 0000000..adcc5ae --- /dev/null +++ b/dashboard/visitor.php @@ -0,0 +1,101 @@ +query( "SELECT + COUNT(a.category) as total, + a.category + FROM visitor a + WHERE a.deleted_at IS NULL AND a.updated_at LIKE '%" . $date_time . "%' + AND a.status IN ( 'rejected', 'tested-rejected' ) + " . $search_query . " + GROUP BY a.category" ) ; + +if ( $select_visitor->num_rows > 0 ){ + while ( $row_visitor = $select_visitor->fetch_assoc() ){ + $category_id = $row_visitor['category'] ; + $category_id = dataFilter( $category_id != '' ? $category_id : 'Unknown' ) ; + + $reject_lists[] = [ + 'label' => $category_id, + 'y' => floatval( $row_visitor['total'] ) + ] ; + } +} + + +// complete report +$complete_lists = [] ; +$select_visitor = $mysqli->query( "SELECT + COUNT(a.category) as total, + a.category + FROM visitor a + WHERE a.deleted_at IS NULL AND a.updated_at LIKE '%" . $date_time . "%' + AND a.status IN ( 'approved', 'tested-approved', 'visited' ) + " . $search_query . " + GROUP BY a.category" ) ; +if ( $select_visitor->num_rows > 0 ){ + while ( $row_visitor = $select_visitor->fetch_assoc() ){ + $category_id = $row_visitor['category'] ; + $category_id = dataFilter( $category_id != '' ? $category_id : 'Unknown' ) ; + + $complete_lists[] = [ + 'label' => $category_id, + 'y' => floatval( $row_visitor['total'] ) + ] ; + } +} +?> + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/details.php b/details.php new file mode 100644 index 0000000..20781d2 --- /dev/null +++ b/details.php @@ -0,0 +1,34 @@ +query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $row = $mysqli_query->fetch_assoc() ; + $row['id'] = dataFilter( $row['formheadcount_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['content'] = dataFilter( $row['content'] ) ; + $row['comment'] = dataFilter( $row['comment'] ) ; + $row['file'] = ( $row['file'] != '' ? PATH.'uploads/FormHeadCount/b/'.$row['file'] : '' ) ; + $row['created_at'] = dataFilter( $row['created_at'] ) ; + + $data['list'] = $row ; + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/documentation.php b/documentation.php new file mode 100644 index 0000000..3f07db5 --- /dev/null +++ b/documentation.php @@ -0,0 +1,564 @@ +query("SELECT * FROM documentation + WHERE documentation_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + if ( $page == '' ){ + $mysqli->query( "INSERT INTO documentation + (author_id, created_at) VALUES + ('".$_SESSION['system_id']."', '".TODAYDATE."')" ) ; + $page = $mysqli->insert_id ; + } + + // resize image + $image = $_FILES["image"]["name"] ; + + // remove photo + $remove_photo = $_POST['remove_photo'] ; + if ( $remove_photo == 1 ){ + $image = '' ; + $image_query = "documentation_file_type = '', + documentation_file = ''," ; + } + + $type = dataFilter($_POST['documentation_receiver_type']) ; + $documentation_to = $_POST['documentation_to'] ; + $documentation_to_dept = $_POST['documentation_to_dept'] ; + + // delete all documentation department & receiver + $selected_staff = [] ; + $selected_depart = [] ; + if ( $type == '1' ){ + if( !empty( $documentation_to ) ){ + for ( $i = 0 ; $i < count($documentation_to) ; $i++ ){ + if ( $documentation_to[$i] != '' ){ + $reset_staff = $documentation_to[$i] ; + $selected_staff[] = $reset_staff ; + pushToUserCron( 'documentation', $page, $reset_staff, 'Documentation', 'Documentation has been update.' ) ; + } + } + } + + }else{ + if( !empty( $documentation_to_dept ) ){ + $array_depart = [] ; + for ( $i = 0 ; $i < count($documentation_to_dept) ; $i++ ){ + + $department_id = $documentation_to_dept[$i] ; + if ( $department_id != '' ){ + + // save into documentation department + $selected_depart[]= $department_id ; + + // check department staff + $reset_depart = str_replace( ['(', ')'], '', $department_id ) ; + $get_depart_staff = $mysqli->query( "SELECT staff_id FROM staff_department + WHERE deleted_at IS NULL AND department_id = '".$reset_depart."'") ; + if ( $get_depart_staff->num_rows > 0 ){ + while ( $row_depart_staff = $get_depart_staff->fetch_assoc() ){ + if ( !in_array($row_depart_staff['staff_id'], $array_depart) ){ + $array_depart[] = $row_depart_staff['staff_id'] ; + $selected_staff = $row_depart_staff['staff_id'] ; + pushToUserCron( 'documentation', $page, $row_depart_staff['staff_id'], 'Documentation', 'Documentation has been update.' ) ; + } + } + } + + } + } + } + } + + $selected_staff = implode( '/', $selected_staff ) ; + $selected_depart = implode( '/', $selected_depart ) ; + + // update database + $mysqli->query( "UPDATE documentation SET + ".$image_query." + staff_id = '".$selected_staff."', + department_id = '".$selected_depart."', + documentation_subject = '".$page_title."', + documentation_format = '".escapeString($_POST['documentation_format'])."', + documentation_message = '".escapeString($_POST['documentation_message'])."', + documentation_video = '".escapeString($_POST['documentation_video'])."', + documentation_receiver_type = '".escapeString($_POST['documentation_receiver_type'])."', + updated_at = '".TODAYDATE."' + WHERE documentation_id = '".$page."'") ; + + + $get_image = pathinfo($image) ; + if ( $get_image['extension'] == 'pdf' ){ + + $file_name = $page.'-'.time().'.pdf' ; + copy($_FILES["image"]["tmp_name"], 'uploads/Documentation/'.$file_name) ; + + // update database + $mysqli->query("UPDATE documentation SET + documentation_file_type = 'pdf', + documentation_file = '".$file_name."' + WHERE documentation_id = '".$page."'") ; + } + + // add system log + $array_remark = array('old' => array('title' => $row_page['documentation_subject']), + 'new' => array('title' => $page_title)) ; + // refresh page + header("Location:documentation.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'documentation-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'documentation-update') ) ){ + header('Location: documentation.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + // get all requires + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ") ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // get all requires + $department_list = [] ; + $mysqli_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $mysqli_department->num_rows > 0 ){ + while ( $row_department = $mysqli_department->fetch_assoc() ){ + $department_list[$row_department['department_id']] = dataFilter($row_department['department_desc']) ; + } + } + + // get all selected staff & department + $receiver_staff = ( $row_page['staff_id'] != '' ? explode('/', $row_page['staff_id']) : [] ) ; + $receiver_depart = ( $row_page['department_id'] != '' ? explode('/', $row_page['department_id']) : [] ) ; + + ?> + + + + + +
    + + + '.$lang['Thank you your documentation has been updated'].' +
    ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
    +
    +
    +
    +
    +
    +
    + +
    +     + +
    + +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + +
    +
    +
    > +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    > +
    +
    +  '.$lang['Remove'].' pdf + '.$lang['Download'].'' ; + }else{ + echo ' + ' ; + } + ?> +
    +
    +
    > +
    +
    + + +
    +
    +
    > +
    +
    + +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + + + query($mysqli_query." ORDER BY a.documentation_id DESC LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
    + + + +
    + + +
    +
    + + + + +
    +
    + + +
    +
    +
    + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['documentation_id'] ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
    ' ; + if ( permissionCheck($row_user, 'documentation-update') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['documentation_subject']).''.dataFilter($row_page['user_name']).''.resetDateFormat($row_page['created_at']).' +
    + + +
    +
    '.$lang['no_data'].'
    + +
    +
    +
    +
    + \ No newline at end of file diff --git a/employment_document.php b/employment_document.php new file mode 100644 index 0000000..6040363 --- /dev/null +++ b/employment_document.php @@ -0,0 +1,353 @@ +query("SELECT branch_id FROM branch"); +if ($mysqli_ck_branch->num_rows >0) { + while ($row_ck_branch = $mysqli_ck_branch->fetch_array()) { + $array_branch_id_list[] = $row_ck_branch['branch_id']; + } +} +// print_r($array_branch_id_list);exit; +$boolean_ck_branch = in_array($branch_id, $array_branch_id_list) ; + +if ($branch_id == '' || $boolean_ck_branch == false) { + echo ' + ' ; + exit; +} + +// print_r($_POST['application_signature']);exit; + +if (isset($doctype) && $doctype == 'sign_form' && $_POST['hidden'] == 1 && $_POST['offer_letter_sign_form'] == 'offer_letter_sign_form'){ + + if ($_POST['application_signature'] != $_POST['application_signature_hidden'] && $_POST['application_signature'] != '') { + // signature + $application_signature = escapeString($_POST['application_signature']) ; + $application_signature_date = TODAYDATE ; + }else{ + $offer_form_con = jsonEncodeDecode('decode', $row_page['employment_offer_sign_detail']) ; + if($application != ''){ + $application_signature = $offer_form_con['signature'] ; + $application_signature_date = $offer_form_con['date'] ; + }else{ + $application_signature = escapeString($_POST['application_signature']) ; + $application_signature_date = TODAYDATE ; + } + + } + + $array_offer_form = array('signature' => $application_signature, + 'date' => $application_signature_date); + $array_offer_form = jsonEncodeDecode('encode', $array_offer_form) ; + + + if($mysqli->query("UPDATE staff_employment SET employment_offer_sign_detail = '".$array_offer_form."' WHERE employment_id = '".$page."'")){ + $descrition = 'Candidate had sign the offer letter form. ('.TODAYDATE.')' ; + $mysqli->query("INSERT INTO system_log_employment (log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ('employment', 'update-offer-form', '200', 'AF-".$page."', '".$_SESSION["system_id"]."', '".$descrition."', '".$record."', NOW())"); + } + +} + + + +$mysqli_page = $mysqli->query("SELECT * FROM staff_employment + WHERE employment_id = '".$page."' AND employment_trash = '0' AND employment_status = 'Offer' LIMIT 1"); +if ($mysqli_page->num_rows > 0){ + // set query in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; +} + +$offer_form_con = jsonEncodeDecode('decode', $row_page['employment_offer_sign_detail']) ; + + +if(($doctype == 'offer_letter' || $doctype == 'ieagreement') && $page != ''){ + + switch($doctype){ + case 'offer_letter' : + $print_filename = 'Offer Letter' ; + $title = 'Offer Letter' ; + break ; + case 'ieagreement' : + $print_filename = 'IEA' ; + $title = 'Individual Employment Agreement between an Employer and an Employee' ; + break ; + } + + $mysqli_page = $mysqli->query("SELECT * FROM staff_employment + WHERE employment_id = '".$page."' AND employment_trash = '0' AND employment_status = 'Offer' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + + // set query in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + + // employment position + $mysqli_position = $mysqli->query("SELECT post_title FROM system_post + WHERE post_id = '".$row_page['employment_position']."' AND post_type = 'hr-position' AND post_categories = 'hr-position' LIMIT 1") ; + if ($mysqli_position->num_rows > 0){ + $row_position = $mysqli_position->fetch_array(MYSQLI_ASSOC) ; + $position = dataFilter($row_position['post_title']) ; + } + + // incharge person + $mysqli_query = "SELECT * FROM system_user + WHERE user_id = '".$row_page['employment_user_id']."' AND (user_permission = 'admin' OR user_permission = 'hr') AND user_trash = '0' LIMIT 1" ; + $mysqli_incharge_by = $mysqli->query($mysqli_query) ; + if ($mysqli_incharge_by->num_rows > 0){ + $row_incharge_by = $mysqli_incharge_by->fetch_array(MYSQLI_ASSOC) ; + $incharge_by = dataFilter($row_incharge_by['user_call']).' . '.dataFilter($row_incharge_by['user_fullname']) ; + } + + // assigned by + $mysqli_query = "SELECT * FROM system_user a + LEFT JOIN system_post b ON (a.user_position = b.post_id) + WHERE user_id = '".$row_page['employment_assign_by']."' AND (user_permission = 'admin' OR user_permission = 'hr') AND user_trash = '0' ORDER BY user_name" ; + $mysqli_assign_by = $mysqli->query($mysqli_query) ; + if ($mysqli_assign_by->num_rows > 0){ + $row_assign_by = $mysqli_assign_by->fetch_array(MYSQLI_ASSOC) ; + $assign_by = dataFilter($row_assign_by['user_call']).' . '.dataFilter($row_assign_by['user_fullname']) ; + $assign_by_position = dataFilter($row_assign_by['post_title']) ; + } + + $status_text = jsonEncodeDecode('decode', $row_page['employment_status_text']) ; + $offer_status = $status_text['offer_status'] ; + + $new_worker = dataFilter($row_page['employment_call']).' . '.strtoupper(dataFilter($row_page['employment_name'])); + + $letter_head = getOwnerCompanyLetterHead($branch_id) ; + + // set body content + $html = ' + '.$letter_head['header'].' + + + + + + ' ; + } + + if($doctype == 'offer_letter'){ + include_once 'HR/letter-offer.php' ; + }else if ($doctype == 'ieagreement'){ + include_once 'HR/letter-iea-temp.php' ; + + // page footer + $footer = ' +
     
    + '.$title.' +
     
    + + + +
    {PAGENO}
    ' ; + } + + $html .= ' + '.$html_offer ; + + // page header + $header = '' ; + + include_once 'MPDF/mpdf.php' ; + + $mpdf = new mPDF('utf-8', 'A4', '', 'freesans', 15, 15, 15, 15, 5, 5) ; + ini_set("memory_limit","999999999999999999999999999999999999999999M"); + + // Use different Odd/Even headers and footers and mirror margins + $mpdf->mirrorMargins = 1 ; + + + // set mpdf header + $mpdf->SetHTMLHeader($header) ; + $mpdf->SetHTMLHeader($header,'E') ; + + // set mpdf footer + $mpdf->SetHTMLFooter($footer) ; + $mpdf->SetHTMLFooter($footer,'E') ; + + // write in html + $mpdf->WriteHTML($html) ; + + // set filename + $filename = 'Offer Letter-'.strPad(3, $page) ; // Your Filename whit local date and time + $filename_save = $filename.'.pdf' ; + $filename_temp = $filename ; + + // turns all headers/footers off from new page onwards + $mpdf->useAdobeCJK = true; + + // check output type + $page_type = ($_GET['page_type']) ; + $page_type_output = 'I' ; + + //$mpdf->SetAutoFont(AUTOFONT_ALL); + $mpdf->Output($filename_save, $page_type_output); +}else if ($doctype == 'sign_form' && $page!='' && $row_page['employment_status'] == 'Offer') { + $letter_head = getOwnerCompanyLetterHead($branch_id) ; + + $mysqli_query = "SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.job_position_id = '".$row_page['employment_position']."' LIMIT 1" ; + $mysqli_position = $mysqli->query($mysqli_query) ; + if ( $mysqli_position->num_rows > 0 ){ + $row_position = $mysqli_position->fetch_array(MYSQLI_ASSOC); + } + + $mysqli_query = "SELECT * FROM branch WHERE deleted_at IS NULL AND branch_id = '".$row_page['employment_branch']."' LIMIT 1" ; + $mysqli_branch = $mysqli->query($mysqli_query) ; + if ($mysqli_branch->num_rows > 0){ + $row_branch = $mysqli_branch->fetch_array(MYSQLI_ASSOC); + } + + echo' + + + + + + + Offer Letter Sign Form - '.COMPANY.' + + + + + + + + + +
    +
    + + + + + + + + + '; + if($offer_form_con['date'] != ''){ + echo' + + + + '; + } + echo' + + + + + + + + + + + + + + + + + '; + if($offer_form_con['signature'] == '' && $offer_form_con['date'] == ''){ + echo' + '; + }else{ + echo' + '; + } + + echo''; + + if($offer_form_con['date'] == ''){ + echo' + + + '; + } + echo' +
    + '.$letter_head['header'].' +
     
    + + + + +
    + OFFER LETTER SIGNATURE FORM +
    +
     
    + You have submitted the form. +
     
    NAME: + '.$row_page['employment_name'] .' +
     
    Position Applied: + '.$row_position['job_position_desc'].' +
     
    Branch Applied: + '.$row_branch['branch_name'].' +
     
    Signature: +
    +
    +
    Click To Sign Here
    +
    +
    + +
    + + + +
    +
    +
     
    +
     
    +
    + +
    + + + + +
    +
    +
    + + + + + + + + + '; +}else{ + echo''; +} +?> \ No newline at end of file diff --git a/export_excel_default.php b/export_excel_default.php new file mode 100644 index 0000000..4679e6b --- /dev/null +++ b/export_excel_default.php @@ -0,0 +1,59 @@ +getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + // default parameter + $count = 1 ; + $char = 'A' ; + + + if ($t_title_header_excel != '') { + $newChar = $char ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($newChar.$count, $t_title_header_excel); + $count ++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($newChar.$count, ''); + $count ++; + } + + $newChar = $char ; + foreach( $array_header_excel as $k => $v ){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $newChar.$count, $v ) ; + $newChar++ ; + } + $count++ ; + + $redeem_q = $mysqli->query( $mysqli_query ) ; + if (!empty($array_body_excel)){ + foreach( $array_body_excel as $kk => $vv ){ + $newChar = $char ; + foreach( $vv as $kkk => $vvv ){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $newChar.$count, $vvv ) ; + $newChar++ ; + } + $count++ ; + } + } + + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + ob_clean(); + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; +?> \ No newline at end of file diff --git a/extensions/mailer.php b/extensions/mailer.php new file mode 100644 index 0000000..21bf2b2 --- /dev/null +++ b/extensions/mailer.php @@ -0,0 +1,96 @@ +attachment[0] = $path; + $this->attachment[1] = $filename; + } + + public function from( $from ){ + $this->from = $from ; + } + + public function to( $to ){ + $this->to = $to ; + } + + public function cc( $cc ){ + $this->cc = $cc ; + } + + public function bcc( $bcc ){ + $this->bcc = $bcc ; + } + + public function subject( $subject ){ + $this->subject = $subject ; + } + + public function body( $body ){ + $this->body = $body ; + } + + public function send(){ + $mail = new PHPMailer ; + + // Server settings + if ( $this->smtp == 'yes' ){ + // $mail->isSMTP() ; + // $mail->SMTPDebug = 1 ; + $mail->Host = $this->host ; + $mail->SMTPAuth = true ; + $mail->Username = $this->username ; + $mail->Password = $this->password ; + $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS ; + $mail->SMTPAuth = true ; + $mail->Port = $this->port ; + } + + // from + $mail->setFrom( $this->from, $this->fromname ) ; + + // send to / cc / bcc + foreach ( $this->to as $k => $v ){ $mail->addAddress( $v ) ; } + foreach ( $this->cc as $k => $v ){ $mail->addCC( $v ) ; } + foreach ( $this->bcc as $k => $v ){ $mail->addBCC( $v ) ; } + + $mail->Subject = $this->subject ; + + if(count($this->attachment) > 0){ + $mail->AddAttachment($this->attachment[0], $this->attachment[1]); + } + + $mail->isHTML(true) ; + $mail->msgHTML( $this->body ) ; + + if ( !$mail->send() ) { + return false ; + }else { + return true ; + } + } + +} + +?> \ No newline at end of file diff --git a/extensions/otp.php b/extensions/otp.php new file mode 100644 index 0000000..746e87e --- /dev/null +++ b/extensions/otp.php @@ -0,0 +1,77 @@ +otpid = $otpid ; + } + + public function allowOtp( $mobile ){ + $query = new Database( $this->table ) ; + $query->filter = 'otpid' ; + $query->where = "ip_address = '".$_SERVER["REMOTE_ADDR"]."' AND created_at > '".date('Y-m-d H:i:s', strtotime('-1 minute'))."' AND send_to = '".$mobile."'" ; + $query->limit = '1' ; + $select = $query->select() ; + if ( $select['status'] == '200' ){ + return json_return( '301' ) ; + }else{ + return json_return( '200' ) ; + } + } + + public function check( $otpid, $refertype, $referid, $otp ){ + if ( $otp == '' ) return json_return( '300' ) ; + + $query = new Database( $this->table ) ; + $query->filter = 'count, code, created_at' ; + $query->where = "otpid = '".$otpid."' AND refertype = '".$refertype."' AND referid = '".$referid."'" ; + $query->limit = '1' ; + $select = $query->select() ; + + if ( $select['status'] == '200' ){ + + $data = $select['data']['0'] ; + + // update count + $count = ( $data['count'] + 1 ) ; + $query->field = [ 'count' => $count ] ; + $query->save() ; + + if ( $count > 3 ) return json_return( '302' ) ; + + if ( $data['created_at'] < date('Y-m-d H:i:s', strtotime('-1 minute')) ) return json_return( '292' ) ; + + if ( $data['code'] != $otp ) { + $count++ ; + if ( $count > 3 ) return json_return( '302' ) ; + return json_return( '283' ) ; + } + + return json_return( '200' ) ; + + } + return json_return( '291' ) ; + } + + public function save(){ + $save = new Database( $this->table ) ; + $save->type = 'insert' ; + $save->field = $this->field ; + if ( $save->save() ){ + return json_return( '200', [ 'id' => $save->id ] ) ; + } + return json_return( '205' ) ; + } + +} + +?> \ No newline at end of file diff --git a/extensions/sms.php b/extensions/sms.php new file mode 100644 index 0000000..9ce6dde --- /dev/null +++ b/extensions/sms.php @@ -0,0 +1,47 @@ + $this->endpoint, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => 'user_id='.urlencode( $this->id ).'&token='.urlencode( $this->token ).'&sign='.urlencode( md5( $this->id . $this->token . $this->secret ) ).'&company=' . urlencode( $this->company ) . '&to='.urlencode( '+'.str_replace( [ '-', '+' ], '', $this->to ) ).'&msg='.urlencode( $this->message ), + CURLOPT_HTTPHEADER => array( 'Content-Type: application/x-www-form-urlencoded' ), + )); + + $response = curl_exec($curl); + + curl_close($curl); + + $result = json_decode( $response, true ) ; + + saveLog( 'sms', 'Sms', 'user_id='.urlencode( $this->id ).'&token='.urlencode( $this->token ).'&sign='.urlencode( md5( $this->id . $this->token . $this->secret ) ).'&company=' . urlencode( $this->company ) . '&to='.urlencode( '+'.str_replace( [ '-', '+' ], '', $this->to ) ).'&msg='.urlencode( $this->message ), $result ) ; + + if ( $result['status'] == '200' ) { + return true ; + } + return false ; + } + +} + +?> \ No newline at end of file diff --git a/extensions/upload.php b/extensions/upload.php new file mode 100644 index 0000000..8afe86e --- /dev/null +++ b/extensions/upload.php @@ -0,0 +1,5168 @@ + + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @copyright Colin Verot + */ +class Upload { + + + /** + * Class version + * + * @access public + * @var string + */ + var $version; + + /** + * Uploaded file name + * + * @access public + * @var string + */ + var $file_src_name; + + /** + * Uploaded file name body (i.e. without extension) + * + * @access public + * @var string + */ + var $file_src_name_body; + + /** + * Uploaded file name extension + * + * @access public + * @var string + */ + var $file_src_name_ext; + + /** + * Uploaded file MIME type + * + * @access public + * @var string + */ + var $file_src_mime; + + /** + * Uploaded file size, in bytes + * + * @access public + * @var double + */ + var $file_src_size; + + /** + * Holds eventual PHP error code from $_FILES + * + * @access public + * @var string + */ + var $file_src_error; + + /** + * Uloaded file name, including server path + * + * @access public + * @var string + */ + var $file_src_pathname; + + /** + * Uloaded file name temporary copy + * + * @access private + * @var string + */ + var $file_src_temp; + + /** + * Destination file name + * + * @access public + * @var string + */ + var $file_dst_path; + + /** + * Destination file name + * + * @access public + * @var string + */ + var $file_dst_name; + + /** + * Destination file name body (i.e. without extension) + * + * @access public + * @var string + */ + var $file_dst_name_body; + + /** + * Destination file extension + * + * @access public + * @var string + */ + var $file_dst_name_ext; + + /** + * Destination file name, including path + * + * @access public + * @var string + */ + var $file_dst_pathname; + + /** + * Source image width + * + * @access public + * @var integer + */ + var $image_src_x; + + /** + * Source image height + * + * @access public + * @var integer + */ + var $image_src_y; + + /** + * Source image color depth + * + * @access public + * @var integer + */ + var $image_src_bits; + + /** + * Number of pixels + * + * @access public + * @var long + */ + var $image_src_pixels; + + /** + * Type of image (png, gif, jpg, webp or bmp) + * + * @access public + * @var string + */ + var $image_src_type; + + /** + * Destination image width + * + * @access public + * @var integer + */ + var $image_dst_x; + + /** + * Destination image height + * + * @access public + * @var integer + */ + var $image_dst_y; + + /** + * Destination image type (png, gif, jpg, webp or bmp) + * + * @access public + * @var integer + */ + var $image_dst_type; + + /** + * Supported image formats + * + * @access private + * @var array + */ + var $image_supported; + + /** + * Flag to determine if the source file is an image + * + * @access public + * @var boolean + */ + var $file_is_image; + + /** + * Flag set after instanciating the class + * + * Indicates if the file has been uploaded properly + * + * @access public + * @var bool + */ + var $uploaded; + + /** + * Flag stopping PHP upload checks + * + * Indicates whether we instanciated the class with a filename, in which case + * we will not check on the validity of the PHP *upload* + * + * This flag is automatically set to true when working on a local file + * + * Warning: for uploads, this flag MUST be set to false for security reason + * + * @access public + * @var bool + */ + var $no_upload_check; + + /** + * Flag set after calling a process + * + * Indicates if the processing, and copy of the resulting file went OK + * + * @access public + * @var bool + */ + var $processed; + + /** + * Holds eventual error message in plain english + * + * @access public + * @var string + */ + var $error; + + /** + * Holds an HTML formatted log + * + * @access public + * @var string + */ + var $log; + + + // overiddable processing variables + + + /** + * Set this variable to replace the name body (i.e. without extension) + * + * @access public + * @var string + */ + var $file_new_name_body; + + /** + * Set this variable to append a string to the file name body + * + * @access public + * @var string + */ + var $file_name_body_add; + + /** + * Set this variable to prepend a string to the file name body + * + * @access public + * @var string + */ + var $file_name_body_pre; + + /** + * Set this variable to change the file extension + * + * @access public + * @var string + */ + var $file_new_name_ext; + + /** + * Set this variable to format the filename (spaces changed to _) + * + * @access public + * @var boolean + */ + var $file_safe_name; + + /** + * Forces an extension if the source file doesn't have one + * + * If the file is an image, then the correct extension will be added + * Otherwise, a .txt extension will be chosen + * + * @access public + * @var boolean + */ + var $file_force_extension; + + /** + * Set this variable to false if you don't want to check the MIME against the allowed list + * + * This variable is set to true by default for security reason + * + * @access public + * @var boolean + */ + var $mime_check; + + /** + * Set this variable to false in the init() function if you don't want to check the MIME + * with Fileinfo PECL extension. On some systems, Fileinfo is known to be buggy, and you + * may want to deactivate it in the class code directly. + * + * You can also set it with the path of the magic database file. + * If set to true, the class will try to read the MAGIC environment variable + * and if it is empty, will default to the system's default + * If set to an empty string, it will call finfo_open without the path argument + * + * This variable is set to true by default for security reason + * + * @access public + * @var boolean + */ + var $mime_fileinfo; + + /** + * Set this variable to false in the init() function if you don't want to check the MIME + * with UNIX file() command + * + * This variable is set to true by default for security reason + * + * @access public + * @var boolean + */ + var $mime_file; + + /** + * Set this variable to false in the init() function if you don't want to check the MIME + * with the magic.mime file + * + * The function mime_content_type() will be deprecated, + * and this variable will be set to false in a future release + * + * This variable is set to true by default for security reason + * + * @access public + * @var boolean + */ + var $mime_magic; + + /** + * Set this variable to false in the init() function if you don't want to check the MIME + * with getimagesize() + * + * The class tries to get a MIME type from getimagesize() + * If no MIME is returned, it tries to guess the MIME type from the file type + * + * This variable is set to true by default for security reason + * + * @access public + * @var boolean + */ + var $mime_getimagesize; + + /** + * Set this variable to false if you don't want to turn dangerous scripts into simple text files + * + * @access public + * @var boolean + */ + var $no_script; + + /** + * Set this variable to true to allow automatic renaming of the file + * if the file already exists + * + * Default value is true + * + * For instance, on uploading foo.ext,
    + * if foo.ext already exists, upload will be renamed foo_1.ext
    + * and if foo_1.ext already exists, upload will be renamed foo_2.ext
    + * + * Note that this option doesn't have any effect if {@link file_overwrite} is true + * + * @access public + * @var bool + */ + var $file_auto_rename; + + /** + * Set this variable to true to allow automatic creation of the destination + * directory if it is missing (works recursively) + * + * Default value is true + * + * @access public + * @var bool + */ + var $dir_auto_create; + + /** + * Set this variable to true to allow automatic chmod of the destination + * directory if it is not writeable + * + * Default value is true + * + * @access public + * @var bool + */ + var $dir_auto_chmod; + + /** + * Set this variable to the default chmod you want the class to use + * when creating directories, or attempting to write in a directory + * + * Default value is 0755 (without quotes) + * + * @access public + * @var bool + */ + var $dir_chmod; + + /** + * Set this variable tu true to allow overwriting of an existing file + * + * Default value is false, so no files will be overwritten + * + * @access public + * @var bool + */ + var $file_overwrite; + + /** + * Set this variable to change the maximum size in bytes for an uploaded file + * + * Default value is the value upload_max_filesize from php.ini + * + * Value in bytes (integer) or shorthand byte values (string) is allowed. + * The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes) + * + * @access public + * @var double + */ + var $file_max_size; + + /** + * Set this variable to true to resize the file if it is an image + * + * You will probably want to set {@link image_x} and {@link image_y}, and maybe one of the ratio variables + * + * Default value is false (no resizing) + * + * @access public + * @var bool + */ + var $image_resize; + + /** + * Set this variable to convert the file if it is an image + * + * Possibles values are : ''; 'png'; 'jpeg'; 'gif'; 'webp'; 'bmp' + * + * Default value is '' (no conversion)
    + * If {@link resize} is true, {@link convert} will be set to the source file extension + * + * @access public + * @var string + */ + var $image_convert; + + /** + * Set this variable to the wanted (or maximum/minimum) width for the processed image, in pixels + * + * Default value is 150 + * + * @access public + * @var integer + */ + var $image_x; + + /** + * Set this variable to the wanted (or maximum/minimum) height for the processed image, in pixels + * + * Default value is 150 + * + * @access public + * @var integer + */ + var $image_y; + + /** + * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y} + * + * Default value is false + * + * @access public + * @var bool + */ + var $image_ratio; + + /** + * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y} + * + * The image will be resized as to fill the whole space, and excedent will be cropped + * + * Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right) + * If set as a string, it determines which side of the image is kept while cropping. + * By default, the part of the image kept is in the center, i.e. it crops equally on both sides + * + * Default value is false + * + * @access public + * @var mixed + */ + var $image_ratio_crop; + + /** + * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y} + * + * The image will be resized to fit entirely in the space, and the rest will be colored. + * The default color is white, but can be set with {@link image_default_color} + * + * Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right) + * If set as a string, it determines in which side of the space the image is displayed. + * By default, the image is displayed in the center, i.e. it fills the remaining space equally on both sides + * + * Default value is false + * + * @access public + * @var mixed + */ + var $image_ratio_fill; + + /** + * Set this variable to a number of pixels so that {@link image_x} and {@link image_y} are the best match possible + * + * The image will be resized to have approximatively the number of pixels + * The aspect ratio wil be conserved + * + * Default value is false + * + * @access public + * @var mixed + */ + var $image_ratio_pixels; + + /** + * Set this variable to calculate {@link image_x} automatically , using {@link image_y} and conserving ratio + * + * Default value is false + * + * @access public + * @var bool + */ + var $image_ratio_x; + + /** + * Set this variable to calculate {@link image_y} automatically , using {@link image_x} and conserving ratio + * + * Default value is false + * + * @access public + * @var bool + */ + var $image_ratio_y; + + /** + * (deprecated) Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}, + * but only if original image is bigger + * + * This setting is soon to be deprecated. Instead, use {@link image_ratio} and {@link image_no_enlarging} + * + * Default value is false + * + * @access public + * @var bool + */ + var $image_ratio_no_zoom_in; + + /** + * (deprecated) Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}, + * but only if original image is smaller + * + * Default value is false + * + * This setting is soon to be deprecated. Instead, use {@link image_ratio} and {@link image_no_shrinking} + * + * @access public + * @var bool + */ + var $image_ratio_no_zoom_out; + + /** + * Cancel resizing if the resized image is bigger than the original image, to prevent enlarging + * + * Default value is false + * + * @access public + * @var bool + */ + var $image_no_enlarging; + + /** + * Cancel resizing if the resized image is smaller than the original image, to prevent shrinking + * + * Default value is false + * + * @access public + * @var bool + */ + var $image_no_shrinking; + + /** + * Set this variable to set a maximum image width, above which the upload will be invalid + * + * Default value is null + * + * @access public + * @var integer + */ + var $image_max_width; + + /** + * Set this variable to set a maximum image height, above which the upload will be invalid + * + * Default value is null + * + * @access public + * @var integer + */ + var $image_max_height; + + /** + * Set this variable to set a maximum number of pixels for an image, above which the upload will be invalid + * + * Default value is null + * + * @access public + * @var long + */ + var $image_max_pixels; + + /** + * Set this variable to set a maximum image aspect ratio, above which the upload will be invalid + * + * Note that ratio = width / height + * + * Default value is null + * + * @access public + * @var float + */ + var $image_max_ratio; + + /** + * Set this variable to set a minimum image width, below which the upload will be invalid + * + * Default value is null + * + * @access public + * @var integer + */ + var $image_min_width; + + /** + * Set this variable to set a minimum image height, below which the upload will be invalid + * + * Default value is null + * + * @access public + * @var integer + */ + var $image_min_height; + + /** + * Set this variable to set a minimum number of pixels for an image, below which the upload will be invalid + * + * Default value is null + * + * @access public + * @var long + */ + var $image_min_pixels; + + /** + * Set this variable to set a minimum image aspect ratio, below which the upload will be invalid + * + * Note that ratio = width / height + * + * Default value is null + * + * @access public + * @var float + */ + var $image_min_ratio; + + /** + * Compression level for PNG images + * + * Between 1 (fast but large files) and 9 (slow but smaller files) + * + * Default value is null (Zlib default) + * + * @access public + * @var integer + */ + var $png_compression; + + /** + * Quality of JPEG created/converted destination image + * + * Default value is 85 + * + * @access public + * @var integer + */ + var $jpeg_quality; + + /** + * Quality of WebP created/converted destination image + * + * Default value is 85 + * + * @access public + * @var integer + */ + var $webp_quality; + + /** + * Determines the quality of the JPG image to fit a desired file size + * + * The JPG quality will be set between 1 and 100% + * The calculations are approximations. + * + * Value in bytes (integer) or shorthand byte values (string) is allowed. + * The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes) + * + * Default value is null (no calculations) + * + * @access public + * @var integer + */ + var $jpeg_size; + + /** + * Turns the interlace bit on + * + * This is actually used only for JPEG images, and defaults to false + * + * @access public + * @var boolean + */ + var $image_interlace; + + /** + * Flag set to true when the image is transparent + * + * This is actually used only for transparent GIFs + * + * @access public + * @var boolean + */ + var $image_is_transparent; + + /** + * Transparent color in a palette + * + * This is actually used only for transparent GIFs + * + * @access public + * @var boolean + */ + var $image_transparent_color; + + /** + * Background color, used to paint transparent areas with + * + * If set, it will forcibly remove transparency by painting transparent areas with the color + * This setting will fill in all transparent areas in PNG, WEPB and GIF, as opposed to {@link image_default_color} + * which will do so only in BMP, JPEG, and alpha transparent areas in transparent GIFs + * This setting overrides {@link image_default_color} + * + * Default value is null + * + * @access public + * @var string + */ + var $image_background_color; + + /** + * Default color for non alpha-transparent images + * + * This setting is to be used to define a background color for semi transparent areas + * of an alpha transparent when the output format doesn't support alpha transparency + * This is useful when, from an alpha transparent PNG or WEBP image, or an image with alpha transparent features + * if you want to output it as a transparent GIFs for instance, you can set a blending color for transparent areas + * If you output in JPEG or BMP, this color will be used to fill in the previously transparent areas + * + * The default color white + * + * @access public + * @var boolean + */ + var $image_default_color; + + /** + * Flag set to true when the image is not true color + * + * @access public + * @var boolean + */ + var $image_is_palette; + + /** + * Corrects the image brightness + * + * Value can range between -127 and 127 + * + * Default value is null + * + * @access public + * @var integer + */ + var $image_brightness; + + /** + * Corrects the image contrast + * + * Value can range between -127 and 127 + * + * Default value is null + * + * @access public + * @var integer + */ + var $image_contrast; + + /** + * Changes the image opacity + * + * Value can range between 0 and 100 + * + * Default value is null + * + * @access public + * @var integer + */ + var $image_opacity; + + /** + * Applies threshold filter + * + * Value can range between -127 and 127 + * + * Default value is null + * + * @access public + * @var integer + */ + var $image_threshold; + + /** + * Applies a tint on the image + * + * Value is an hexadecimal color, such as #FFFFFF + * + * Default value is null + * + * @access public + * @var string; + */ + var $image_tint_color; + + /** + * Applies a colored overlay on the image + * + * Value is an hexadecimal color, such as #FFFFFF + * + * To use with {@link image_overlay_opacity} + * + * Default value is null + * + * @access public + * @var string; + */ + var $image_overlay_color; + + /** + * Sets the opacity for the colored overlay + * + * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque) + * + * Unless used with {@link image_overlay_color}, this setting has no effect + * + * Default value is 50 + * + * @access public + * @var integer + */ + var $image_overlay_opacity; + + /** + * Inverts the color of an image + * + * Default value is FALSE + * + * @access public + * @var boolean; + */ + var $image_negative; + + /** + * Turns the image into greyscale + * + * Default value is FALSE + * + * @access public + * @var boolean; + */ + var $image_greyscale; + + /** + * Pixelate an image + * + * Value is integer, represents the block size + * + * Default value is null + * + * @access public + * @var integer; + */ + var $image_pixelate; + + /** + * Applies an unsharp mask, with alpha transparency support + * + * Beware that this unsharp mask is quite resource-intensive + * + * Default value is FALSE + * + * @access public + * @var boolean; + */ + var $image_unsharp; + + /** + * Sets the unsharp mask amount + * + * Value is an integer between 0 and 500, typically between 50 and 200 + * + * Unless used with {@link image_unsharp}, this setting has no effect + * + * Default value is 80 + * + * @access public + * @var integer + */ + var $image_unsharp_amount; + + /** + * Sets the unsharp mask radius + * + * Value is an integer between 0 and 50, typically between 0.5 and 1 + * It is not recommended to change it, the default works best + * + * Unless used with {@link image_unsharp}, this setting has no effect + * + * From PHP 5.1, imageconvolution is used, and this setting has no effect + * + * Default value is 0.5 + * + * @access public + * @var integer + */ + var $image_unsharp_radius; + + /** + * Sets the unsharp mask threshold + * + * Value is an integer between 0 and 255, typically between 0 and 5 + * + * Unless used with {@link image_unsharp}, this setting has no effect + * + * Default value is 1 + * + * @access public + * @var integer + */ + var $image_unsharp_threshold; + + /** + * Adds a text label on the image + * + * Value is a string, any text. Text will not word-wrap, although you can use breaklines in your text "\n" + * + * If set, this setting allow the use of all other settings starting with image_text_ + * + * Replacement tokens can be used in the string: + *
    +     * gd_version    src_name       src_name_body src_name_ext
    +     * src_pathname  src_mime       src_x         src_y
    +     * src_type      src_bits       src_pixels
    +     * src_size      src_size_kb    src_size_mb   src_size_human
    +     * dst_path      dst_name_body  dst_pathname
    +     * dst_name      dst_name_ext   dst_x         dst_y
    +     * date          time           host          server        ip
    +     * 
    + * The tokens must be enclosed in square brackets: [dst_x] will be replaced by the width of the picture + * + * Default value is null + * + * @access public + * @var string; + */ + var $image_text; + + /** + * Sets the text direction for the text label + * + * Value is either 'h' or 'v', as in horizontal and vertical + * + * Note that if you use a TrueType font, you can use {@link image_text_angle} instead + * + * Default value is h (horizontal) + * + * @access public + * @var string; + */ + var $image_text_direction; + + /** + * Sets the text color for the text label + * + * Value is an hexadecimal color, such as #FFFFFF + * + * Default value is #FFFFFF (white) + * + * @access public + * @var string; + */ + var $image_text_color; + + /** + * Sets the text opacity in the text label + * + * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque) + * + * Default value is 100 + * + * @access public + * @var integer + */ + var $image_text_opacity; + + /** + * Sets the text background color for the text label + * + * Value is an hexadecimal color, such as #FFFFFF + * + * Default value is null (no background) + * + * @access public + * @var string; + */ + var $image_text_background; + + /** + * Sets the text background opacity in the text label + * + * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque) + * + * Default value is 100 + * + * @access public + * @var integer + */ + var $image_text_background_opacity; + + /** + * Sets the text font in the text label + * + * Value is a an integer between 1 and 5 for GD built-in fonts. 1 is the smallest font, 5 the biggest + * Value can also be a string, which represents the path to a GDF or TTF font (TrueType). + * + * Default value is 5 + * + * @access public + * @var mixed; + */ + var $image_text_font; + + /** + * Sets the text font size for TrueType fonts + * + * Value is a an integer, and represents the font size in pixels (GD1) or points (GD1) + * + * Note that this setting is only applicable to TrueType fonts, and has no effects with GD fonts + * + * Default value is 16 + * + * @access public + * @var integer; + */ + var $image_text_size; + + /** + * Sets the text angle for TrueType fonts + * + * Value is a an integer between 0 and 360, in degrees, with 0 degrees being left-to-right reading text. + * + * Note that this setting is only applicable to TrueType fonts, and has no effects with GD fonts + * For GD fonts, you can use {@link image_text_direction} instead + * + * Default value is null (so it is determined by the value of {@link image_text_direction}) + * + * @access public + * @var integer; + */ + var $image_text_angle; + + /** + * Sets the text label position within the image + * + * Value is one or two out of 'TBLR' (top, bottom, left, right) + * + * The positions are as following: + *
    +     *                        TL  T  TR
    +     *                        L       R
    +     *                        BL  B  BR
    +     * 
    + * + * Default value is null (centered, horizontal and vertical) + * + * Note that is {@link image_text_x} and {@link image_text_y} are used, this setting has no effect + * + * @access public + * @var string; + */ + var $image_text_position; + + /** + * Sets the text label absolute X position within the image + * + * Value is in pixels, representing the distance between the left of the image and the label + * If a negative value is used, it will represent the distance between the right of the image and the label + * + * Default value is null (so {@link image_text_position} is used) + * + * @access public + * @var integer + */ + var $image_text_x; + + /** + * Sets the text label absolute Y position within the image + * + * Value is in pixels, representing the distance between the top of the image and the label + * If a negative value is used, it will represent the distance between the bottom of the image and the label + * + * Default value is null (so {@link image_text_position} is used) + * + * @access public + * @var integer + */ + var $image_text_y; + + /** + * Sets the text label padding + * + * Value is in pixels, representing the distance between the text and the label background border + * + * Default value is 0 + * + * This setting can be overriden by {@link image_text_padding_x} and {@link image_text_padding_y} + * + * @access public + * @var integer + */ + var $image_text_padding; + + /** + * Sets the text label horizontal padding + * + * Value is in pixels, representing the distance between the text and the left and right label background borders + * + * Default value is null + * + * If set, this setting overrides the horizontal part of {@link image_text_padding} + * + * @access public + * @var integer + */ + var $image_text_padding_x; + + /** + * Sets the text label vertical padding + * + * Value is in pixels, representing the distance between the text and the top and bottom label background borders + * + * Default value is null + * + * If set, his setting overrides the vertical part of {@link image_text_padding} + * + * @access public + * @var integer + */ + var $image_text_padding_y; + + /** + * Sets the text alignment + * + * Value is a string, which can be either 'L', 'C' or 'R' + * + * Default value is 'C' + * + * This setting is relevant only if the text has several lines. + * + * Note that this setting is only applicable to GD fonts, and has no effects with TrueType fonts + * + * @access public + * @var string; + */ + var $image_text_alignment; + + /** + * Sets the text line spacing + * + * Value is an integer, in pixels + * + * Default value is 0 + * + * This setting is relevant only if the text has several lines. + * + * Note that this setting is only applicable to GD fonts, and has no effects with TrueType fonts + * + * @access public + * @var integer + */ + var $image_text_line_spacing; + + /** + * Sets the height of the reflection + * + * Value is an integer in pixels, or a string which format can be in pixels or percentage. + * For instance, values can be : 40, '40', '40px' or '40%' + * + * Default value is null, no reflection + * + * @access public + * @var mixed; + */ + var $image_reflection_height; + + /** + * Sets the space between the source image and its relection + * + * Value is an integer in pixels, which can be negative + * + * Default value is 2 + * + * This setting is relevant only if {@link image_reflection_height} is set + * + * @access public + * @var integer + */ + var $image_reflection_space; + + /** + * Sets the initial opacity of the reflection + * + * Value is an integer between 0 (no opacity) and 100 (full opacity). + * The reflection will start from {@link image_reflection_opacity} and end up at 0 + * + * Default value is 60 + * + * This setting is relevant only if {@link image_reflection_height} is set + * + * @access public + * @var integer + */ + var $image_reflection_opacity; + + /** + * Automatically rotates the image according to EXIF data (JPEG only) + * + * Default value is true + * + * @access public + * @var boolean; + */ + var $image_auto_rotate; + + /** + * Flips the image vertically or horizontally + * + * Value is either 'h' or 'v', as in horizontal and vertical + * + * Default value is null (no flip) + * + * @access public + * @var string; + */ + var $image_flip; + + /** + * Rotates the image by increments of 45 degrees + * + * Value is either 90, 180 or 270 + * + * Default value is null (no rotation) + * + * @access public + * @var string; + */ + var $image_rotate; + + /** + * Crops an image + * + * Values are four dimensions, or two, or one (CSS style) + * They represent the amount cropped top, right, bottom and left. + * These values can either be in an array, or a space separated string. + * Each value can be in pixels (with or without 'px'), or percentage (of the source image) + * + * For instance, are valid: + *
    +     * $foo->image_crop = 20                  OR array(20);
    +     * $foo->image_crop = '20px'              OR array('20px');
    +     * $foo->image_crop = '20 40'             OR array('20', 40);
    +     * $foo->image_crop = '-20 25%'           OR array(-20, '25%');
    +     * $foo->image_crop = '20px 25%'          OR array('20px', '25%');
    +     * $foo->image_crop = '20% 25%'           OR array('20%', '25%');
    +     * $foo->image_crop = '20% 25% 10% 30%'   OR array('20%', '25%', '10%', '30%');
    +     * $foo->image_crop = '20px 25px 2px 2px' OR array('20px', '25%px', '2px', '2px');
    +     * $foo->image_crop = '20 25% 40px 10%'   OR array(20, '25%', '40px', '10%');
    +     * 
    + * + * If a value is negative, the image will be expanded, and the extra parts will be filled with black + * + * Default value is null (no cropping) + * + * @access public + * @var string OR array; + */ + var $image_crop; + + /** + * Crops an image, before an eventual resizing + * + * See {@link image_crop} for valid formats + * + * Default value is null (no cropping) + * + * @access public + * @var string OR array; + */ + var $image_precrop; + + /** + * Adds a bevel border on the image + * + * Value is a positive integer, representing the thickness of the bevel + * + * If the bevel colors are the same as the background, it makes a fade out effect + * + * Default value is null (no bevel) + * + * @access public + * @var integer + */ + var $image_bevel; + + /** + * Top and left bevel color + * + * Value is a color, in hexadecimal format + * This setting is used only if {@link image_bevel} is set + * + * Default value is #FFFFFF + * + * @access public + * @var string; + */ + var $image_bevel_color1; + + /** + * Right and bottom bevel color + * + * Value is a color, in hexadecimal format + * This setting is used only if {@link image_bevel} is set + * + * Default value is #000000 + * + * @access public + * @var string; + */ + var $image_bevel_color2; + + /** + * Adds a single-color border on the outer of the image + * + * Values are four dimensions, or two, or one (CSS style) + * They represent the border thickness top, right, bottom and left. + * These values can either be in an array, or a space separated string. + * Each value can be in pixels (with or without 'px'), or percentage (of the source image) + * + * See {@link image_crop} for valid formats + * + * If a value is negative, the image will be cropped. + * Note that the dimensions of the picture will be increased by the borders' thickness + * + * Default value is null (no border) + * + * @access public + * @var integer + */ + var $image_border; + + /** + * Border color + * + * Value is a color, in hexadecimal format. + * This setting is used only if {@link image_border} is set + * + * Default value is #FFFFFF + * + * @access public + * @var string; + */ + var $image_border_color; + + /** + * Sets the opacity for the borders + * + * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque) + * + * Unless used with {@link image_border}, this setting has no effect + * + * Default value is 100 + * + * @access public + * @var integer + */ + var $image_border_opacity; + + /** + * Adds a fading-to-transparent border on the image + * + * Values are four dimensions, or two, or one (CSS style) + * They represent the border thickness top, right, bottom and left. + * These values can either be in an array, or a space separated string. + * Each value can be in pixels (with or without 'px'), or percentage (of the source image) + * + * See {@link image_crop} for valid formats + * + * Note that the dimensions of the picture will not be increased by the borders' thickness + * + * Default value is null (no border) + * + * @access public + * @var integer + */ + var $image_border_transparent; + + /** + * Adds a multi-color frame on the outer of the image + * + * Value is an integer. Two values are possible for now: + * 1 for flat border, meaning that the frame is mirrored horizontally and vertically + * 2 for crossed border, meaning that the frame will be inversed, as in a bevel effect + * + * The frame will be composed of colored lines set in {@link image_frame_colors} + * + * Note that the dimensions of the picture will be increased by the borders' thickness + * + * Default value is null (no frame) + * + * @access public + * @var integer + */ + var $image_frame; + + /** + * Sets the colors used to draw a frame + * + * Values is a list of n colors in hexadecimal format. + * These values can either be in an array, or a space separated string. + * + * The colors are listed in the following order: from the outset of the image to its center + * + * For instance, are valid: + *
    +     * $foo->image_frame_colors = '#FFFFFF #999999 #666666 #000000';
    +     * $foo->image_frame_colors = array('#FFFFFF', '#999999', '#666666', '#000000');
    +     * 
    + * + * This setting is used only if {@link image_frame} is set + * + * Default value is '#FFFFFF #999999 #666666 #000000' + * + * @access public + * @var string OR array; + */ + var $image_frame_colors; + + /** + * Sets the opacity for the frame + * + * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque) + * + * Unless used with {@link image_frame}, this setting has no effect + * + * Default value is 100 + * + * @access public + * @var integer + */ + var $image_frame_opacity; + + /** + * Adds a watermark on the image + * + * Value is a local image filename, relative or absolute. GIF, JPG, BMP, WEBP and PNG are supported, as well as PNG and WEBP alpha. + * + * If set, this setting allow the use of all other settings starting with image_watermark_ + * + * Default value is null + * + * @access public + * @var string; + */ + var $image_watermark; + + /** + * Sets the watermarkposition within the image + * + * Value is one or two out of 'TBLR' (top, bottom, left, right) + * + * The positions are as following: TL T TR + * L R + * BL B BR + * + * Default value is null (centered, horizontal and vertical) + * + * Note that is {@link image_watermark_x} and {@link image_watermark_y} are used, this setting has no effect + * + * @access public + * @var string; + */ + var $image_watermark_position; + + /** + * Sets the watermark absolute X position within the image + * + * Value is in pixels, representing the distance between the top of the image and the watermark + * If a negative value is used, it will represent the distance between the bottom of the image and the watermark + * + * Default value is null (so {@link image_watermark_position} is used) + * + * @access public + * @var integer + */ + var $image_watermark_x; + + /** + * Sets the twatermark absolute Y position within the image + * + * Value is in pixels, representing the distance between the left of the image and the watermark + * If a negative value is used, it will represent the distance between the right of the image and the watermark + * + * Default value is null (so {@link image_watermark_position} is used) + * + * @access public + * @var integer + */ + var $image_watermark_y; + + /** + * Prevents the watermark to be resized up if it is smaller than the image + * + * If the watermark if smaller than the destination image, taking in account the desired watermark position + * then it will be resized up to fill in the image (minus the {@link image_watermark_x} or {@link image_watermark_y} values) + * + * If you don't want your watermark to be resized in any way, then + * set {@link image_watermark_no_zoom_in} and {@link image_watermark_no_zoom_out} to true + * If you want your watermark to be resized up or doan to fill in the image better, then + * set {@link image_watermark_no_zoom_in} and {@link image_watermark_no_zoom_out} to false + * + * Default value is true (so the watermark will not be resized up, which is the behaviour most people expect) + * + * @access public + * @var integer + */ + var $image_watermark_no_zoom_in; + + /** + * Prevents the watermark to be resized down if it is bigger than the image + * + * If the watermark if bigger than the destination image, taking in account the desired watermark position + * then it will be resized down to fit in the image (minus the {@link image_watermark_x} or {@link image_watermark_y} values) + * + * If you don't want your watermark to be resized in any way, then + * set {@link image_watermark_no_zoom_in} and {@link image_watermark_no_zoom_out} to true + * If you want your watermark to be resized up or doan to fill in the image better, then + * set {@link image_watermark_no_zoom_in} and {@link image_watermark_no_zoom_out} to false + * + * Default value is false (so the watermark may be shrinked to fit in the image) + * + * @access public + * @var integer + */ + var $image_watermark_no_zoom_out; + + /** + * List of MIME types per extension + * + * @access private + * @var array + */ + var $mime_types; + + /** + * Allowed MIME types + * + * Default is a selection of safe mime-types, but you might want to change it + * + * Simple wildcards are allowed, such as image/* or application/* + * If there is only one MIME type allowed, then it can be a string instead of an array + * + * @access public + * @var array OR string + */ + var $allowed; + + /** + * Forbidden MIME types + * + * Default is a selection of safe mime-types, but you might want to change it + * To only check for forbidden MIME types, and allow everything else, set {@link allowed} to array('* / *') without the spaces + * + * Simple wildcards are allowed, such as image/* or application/* + * If there is only one MIME type forbidden, then it can be a string instead of an array + * + * @access public + * @var array OR string + */ + var $forbidden; + + /** + * Blacklisted file extensions + * + * List of blacklisted extensions, that are enforced if {@link no_script} is true + * + * @access public + * @var array + */ + var $blacklist; + + + /** + * Array of translated error messages + * + * By default, the language is english (en_GB) + * Translations can be in separate files, in a lang/ subdirectory + * + * @access public + * @var array + */ + var $translation; + + /** + * Language selected for the translations + * + * By default, the language is english ("en_GB") + * + * @access public + * @var array + */ + var $lang; + + /** + * Init or re-init all the processing variables to their default values + * + * This function is called in the constructor, and after each call of {@link process} + * + * @access private + */ + function init() { + + // overiddable variables + $this->file_new_name_body = null; // replace the name body + $this->file_name_body_add = null; // append to the name body + $this->file_name_body_pre = null; // prepend to the name body + $this->file_new_name_ext = null; // replace the file extension + $this->file_safe_name = true; // format safely the filename + $this->file_force_extension = true; // forces extension if there isn't one + $this->file_overwrite = false; // allows overwritting if the file already exists + $this->file_auto_rename = true; // auto-rename if the file already exists + $this->dir_auto_create = true; // auto-creates directory if missing + $this->dir_auto_chmod = true; // auto-chmod directory if not writeable + $this->dir_chmod = 0755; // default chmod to use + + $this->no_script = true; // turns scripts into test files + $this->mime_check = true; // checks the mime type against the allowed list + + // these are the different MIME detection methods. if one of these method doesn't work on your + // system, you can deactivate it here; just set it to false + $this->mime_fileinfo = true; // MIME detection with Fileinfo PECL extension + $this->mime_file = true; // MIME detection with UNIX file() command + $this->mime_magic = true; // MIME detection with mime_magic (mime_content_type()) + $this->mime_getimagesize = true; // MIME detection with getimagesize() + + // get the default max size from php.ini + $this->file_max_size_raw = trim(ini_get('upload_max_filesize')); + $this->file_max_size = $this->getsize($this->file_max_size_raw); + + $this->image_resize = false; // resize the image + $this->image_convert = ''; // convert. values :''; 'png'; 'jpeg'; 'gif'; 'bmp' + + $this->image_x = 150; + $this->image_y = 150; + $this->image_ratio = false; // keeps aspect ratio within x and y dimensions + $this->image_ratio_crop = false; // keeps aspect ratio within x and y dimensions, filling the space + $this->image_ratio_fill = false; // keeps aspect ratio within x and y dimensions, fitting the image in the space + $this->image_ratio_pixels = false; // keeps aspect ratio, calculating x and y to reach the number of pixels + $this->image_ratio_x = false; // calculate the $image_x if true + $this->image_ratio_y = false; // calculate the $image_y if true + $this->image_ratio_no_zoom_in = false; + $this->image_ratio_no_zoom_out = false; + $this->image_no_enlarging = false; + $this->image_no_shrinking = false; + + $this->png_compression = null; + $this->webp_quality = 85; + $this->jpeg_quality = 85; + $this->jpeg_size = null; + $this->image_interlace = false; + $this->image_is_transparent = false; + $this->image_transparent_color = null; + $this->image_background_color = null; + $this->image_default_color = '#ffffff'; + $this->image_is_palette = false; + + $this->image_max_width = null; + $this->image_max_height = null; + $this->image_max_pixels = null; + $this->image_max_ratio = null; + $this->image_min_width = null; + $this->image_min_height = null; + $this->image_min_pixels = null; + $this->image_min_ratio = null; + + $this->image_brightness = null; + $this->image_contrast = null; + $this->image_opacity = null; + $this->image_threshold = null; + $this->image_tint_color = null; + $this->image_overlay_color = null; + $this->image_overlay_opacity = null; + $this->image_negative = false; + $this->image_greyscale = false; + $this->image_pixelate = null; + $this->image_unsharp = false; + $this->image_unsharp_amount = 80; + $this->image_unsharp_radius = 0.5; + $this->image_unsharp_threshold = 1; + + $this->image_text = null; + $this->image_text_direction = null; + $this->image_text_color = '#FFFFFF'; + $this->image_text_opacity = 100; + $this->image_text_background = null; + $this->image_text_background_opacity = 100; + $this->image_text_font = 5; + $this->image_text_size = 16; + $this->image_text_angle = null; + $this->image_text_x = null; + $this->image_text_y = null; + $this->image_text_position = null; + $this->image_text_padding = 0; + $this->image_text_padding_x = null; + $this->image_text_padding_y = null; + $this->image_text_alignment = 'C'; + $this->image_text_line_spacing = 0; + + $this->image_reflection_height = null; + $this->image_reflection_space = 2; + $this->image_reflection_opacity = 60; + + $this->image_watermark = null; + $this->image_watermark_x = null; + $this->image_watermark_y = null; + $this->image_watermark_position = null; + $this->image_watermark_no_zoom_in = true; + $this->image_watermark_no_zoom_out = false; + + $this->image_flip = null; + $this->image_auto_rotate = true; + $this->image_rotate = null; + $this->image_crop = null; + $this->image_precrop = null; + + $this->image_bevel = null; + $this->image_bevel_color1 = '#FFFFFF'; + $this->image_bevel_color2 = '#000000'; + $this->image_border = null; + $this->image_border_color = '#FFFFFF'; + $this->image_border_opacity = 100; + $this->image_border_transparent = null; + $this->image_frame = null; + $this->image_frame_colors = '#FFFFFF #999999 #666666 #000000'; + $this->image_frame_opacity = 100; + + $this->forbidden = array(); + $this->allowed = array( + 'application/arj', + 'application/excel', + 'application/gnutar', + 'application/mspowerpoint', + 'application/msword', + 'application/octet-stream', + 'application/onenote', + 'application/pdf', + 'application/plain', + 'application/postscript', + 'application/powerpoint', + 'application/rar', + 'application/rtf', + 'application/vnd.ms-excel', + 'application/vnd.ms-excel.addin.macroEnabled.12', + 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'application/vnd.ms-excel.template.macroEnabled.12', + 'application/vnd.ms-office', + 'application/vnd.ms-officetheme', + 'application/vnd.ms-powerpoint', + 'application/vnd.ms-powerpoint.addin.macroEnabled.12', + 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'application/vnd.ms-powerpoint.slide.macroEnabled.12', + 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', + 'application/vnd.ms-powerpoint.template.macroEnabled.12', + 'application/vnd.ms-word', + 'application/vnd.ms-word.document.macroEnabled.12', + 'application/vnd.ms-word.template.macroEnabled.12', + 'application/vnd.oasis.opendocument.chart', + 'application/vnd.oasis.opendocument.database', + 'application/vnd.oasis.opendocument.formula', + 'application/vnd.oasis.opendocument.graphics', + 'application/vnd.oasis.opendocument.graphics-template', + 'application/vnd.oasis.opendocument.image', + 'application/vnd.oasis.opendocument.presentation', + 'application/vnd.oasis.opendocument.presentation-template', + 'application/vnd.oasis.opendocument.spreadsheet', + 'application/vnd.oasis.opendocument.spreadsheet-template', + 'application/vnd.oasis.opendocument.text', + 'application/vnd.oasis.opendocument.text-master', + 'application/vnd.oasis.opendocument.text-template', + 'application/vnd.oasis.opendocument.text-web', + 'application/vnd.openofficeorg.extension', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'application/vocaltec-media-file', + 'application/wordperfect', + 'application/haansoftxlsx', + 'application/x-bittorrent', + 'application/x-bzip', + 'application/x-bzip2', + 'application/x-compressed', + 'application/x-excel', + 'application/x-gzip', + 'application/x-latex', + 'application/x-midi', + 'application/xml', + 'application/x-msexcel', + 'application/x-rar', + 'application/x-rar-compressed', + 'application/x-rtf', + 'application/x-shockwave-flash', + 'application/x-sit', + 'application/x-stuffit', + 'application/x-troff-msvideo', + 'application/x-zip', + 'application/x-zip-compressed', + 'application/zip', + 'audio/*', + 'image/*', + 'multipart/x-gzip', + 'multipart/x-zip', + 'text/plain', + 'text/rtf', + 'text/richtext', + 'text/xml', + 'video/*', + 'text/csv', + 'text/x-c', + 'text/x-csv', + 'text/comma-separated-values', + 'text/x-comma-separated-values', + 'application/csv', + 'application/x-csv', + ); + + $this->mime_types = array( + 'jpg' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpe' => 'image/jpeg', + 'gif' => 'image/gif', + 'webp' => 'image/webp', + 'png' => 'image/png', + 'bmp' => 'image/bmp', + 'flif' => 'image/flif', + 'flv' => 'video/x-flv', + 'js' => 'application/x-javascript', + 'json' => 'application/json', + 'tiff' => 'image/tiff', + 'css' => 'text/css', + 'xml' => 'application/xml', + 'doc' => 'application/msword', + 'xls' => 'application/vnd.ms-excel', + 'xlt' => 'application/vnd.ms-excel', + 'xlm' => 'application/vnd.ms-excel', + 'xld' => 'application/vnd.ms-excel', + 'xla' => 'application/vnd.ms-excel', + 'xlc' => 'application/vnd.ms-excel', + 'xlw' => 'application/vnd.ms-excel', + 'xll' => 'application/vnd.ms-excel', + 'ppt' => 'application/vnd.ms-powerpoint', + 'pps' => 'application/vnd.ms-powerpoint', + 'rtf' => 'application/rtf', + 'pdf' => 'application/pdf', + 'html' => 'text/html', + 'htm' => 'text/html', + 'php' => 'text/html', + 'txt' => 'text/plain', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'mp3' => 'audio/mpeg3', + 'wav' => 'audio/wav', + 'aiff' => 'audio/aiff', + 'aif' => 'audio/aiff', + 'avi' => 'video/msvideo', + 'wmv' => 'video/x-ms-wmv', + 'mov' => 'video/quicktime', + 'zip' => 'application/zip', + 'tar' => 'application/x-tar', + 'swf' => 'application/x-shockwave-flash', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'ott' => 'application/vnd.oasis.opendocument.text-template', + 'oth' => 'application/vnd.oasis.opendocument.text-web', + 'odm' => 'application/vnd.oasis.opendocument.text-master', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'otg' => 'application/vnd.oasis.opendocument.graphics-template', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'otp' => 'application/vnd.oasis.opendocument.presentation-template', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odf' => 'application/vnd.oasis.opendocument.formula', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odi' => 'application/vnd.oasis.opendocument.image', + 'oxt' => 'application/vnd.openofficeorg.extension', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'docm' => 'application/vnd.ms-word.document.macroEnabled.12', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12', + 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12', + 'thmx' => 'application/vnd.ms-officetheme', + 'onetoc' => 'application/onenote', + 'onetoc2' => 'application/onenote', + 'onetmp' => 'application/onenote', + 'onepkg' => 'application/onenote', + 'csv' => 'text/csv', + ); + + $this->blacklist = array( + 'php', + 'php7', + 'php6', + 'php5', + 'php4', + 'php3', + 'phtml', + 'pht', + 'phpt', + 'phtm', + 'phps', + 'inc', + 'pl', + 'py', + 'cgi', + 'asp', + 'js', + 'sh', + 'phar', + ); + + } + + /** + * Constructor, for PHP5+ + */ + function __construct($file, $lang = 'en_GB') { + $this->upload($file, $lang); + } + + /** + * Constructor, for PHP4. Checks if the file has been uploaded + * + * The constructor takes $_FILES['form_field'] array as argument + * where form_field is the form field name + * + * The constructor will check if the file has been uploaded in its temporary location, and + * accordingly will set {@link uploaded} (and {@link error} is an error occurred) + * + * If the file has been uploaded, the constructor will populate all the variables holding the upload + * information (none of the processing class variables are used here). + * You can have access to information about the file (name, size, MIME type...). + * + * + * Alternatively, you can set the first argument to be a local filename (string) + * This allows processing of a local file, as if the file was uploaded + * + * The optional second argument allows you to set the language for the error messages + * + * @access private + * @param array $file $_FILES['form_field'] + * or string $file Local filename + * @param string $lang Optional language code + */ + function upload($file, $lang = 'en_GB') { + + $this->version = '03/08/2019'; + + $this->file_src_name = ''; + $this->file_src_name_body = ''; + $this->file_src_name_ext = ''; + $this->file_src_mime = ''; + $this->file_src_size = ''; + $this->file_src_error = ''; + $this->file_src_pathname = ''; + $this->file_src_temp = ''; + + $this->file_dst_path = ''; + $this->file_dst_name = ''; + $this->file_dst_name_body = ''; + $this->file_dst_name_ext = ''; + $this->file_dst_pathname = ''; + + $this->image_src_x = null; + $this->image_src_y = null; + $this->image_src_bits = null; + $this->image_src_type = null; + $this->image_src_pixels = null; + $this->image_dst_x = 0; + $this->image_dst_y = 0; + $this->image_dst_type = ''; + + $this->uploaded = true; + $this->no_upload_check = false; + $this->processed = false; + $this->error = ''; + $this->log = ''; + $this->allowed = array(); + $this->forbidden = array(); + $this->file_is_image = false; + $this->init(); + $info = null; + $mime_from_browser = null; + + // sets default language + $this->translation = array(); + $this->translation['file_error'] = 'File error. Please try again.'; + $this->translation['local_file_missing'] = 'Local file doesn\'t exist.'; + $this->translation['local_file_not_readable'] = 'Local file is not readable.'; + $this->translation['uploaded_too_big_ini'] = 'File upload error (the uploaded file exceeds the upload_max_filesize directive in php.ini).'; + $this->translation['uploaded_too_big_html'] = 'File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form).'; + $this->translation['uploaded_partial'] = 'File upload error (the uploaded file was only partially uploaded).'; + $this->translation['uploaded_missing'] = 'File upload error (no file was uploaded).'; + $this->translation['uploaded_no_tmp_dir'] = 'File upload error (missing a temporary folder).'; + $this->translation['uploaded_cant_write'] = 'File upload error (failed to write file to disk).'; + $this->translation['uploaded_err_extension'] = 'File upload error (file upload stopped by extension).'; + $this->translation['uploaded_unknown'] = 'File upload error (unknown error code).'; + $this->translation['try_again'] = 'File upload error. Please try again.'; + $this->translation['file_too_big'] = 'File too big.'; + $this->translation['no_mime'] = 'MIME type can\'t be detected.'; + $this->translation['incorrect_file'] = 'Incorrect type of file.'; + $this->translation['image_too_wide'] = 'Image too wide.'; + $this->translation['image_too_narrow'] = 'Image too narrow.'; + $this->translation['image_too_high'] = 'Image too tall.'; + $this->translation['image_too_short'] = 'Image too short.'; + $this->translation['ratio_too_high'] = 'Image ratio too high (image too wide).'; + $this->translation['ratio_too_low'] = 'Image ratio too low (image too high).'; + $this->translation['too_many_pixels'] = 'Image has too many pixels.'; + $this->translation['not_enough_pixels'] = 'Image has not enough pixels.'; + $this->translation['file_not_uploaded'] = 'File not uploaded. Can\'t carry on a process.'; + $this->translation['already_exists'] = '%s already exists. Please change the file name.'; + $this->translation['temp_file_missing'] = 'No correct temp source file. Can\'t carry on a process.'; + $this->translation['source_missing'] = 'No correct uploaded source file. Can\'t carry on a process.'; + $this->translation['destination_dir'] = 'Destination directory can\'t be created. Can\'t carry on a process.'; + $this->translation['destination_dir_missing'] = 'Destination directory doesn\'t exist. Can\'t carry on a process.'; + $this->translation['destination_path_not_dir'] = 'Destination path is not a directory. Can\'t carry on a process.'; + $this->translation['destination_dir_write'] = 'Destination directory can\'t be made writeable. Can\'t carry on a process.'; + $this->translation['destination_path_write'] = 'Destination path is not a writeable. Can\'t carry on a process.'; + $this->translation['temp_file'] = 'Can\'t create the temporary file. Can\'t carry on a process.'; + $this->translation['source_not_readable'] = 'Source file is not readable. Can\'t carry on a process.'; + $this->translation['no_create_support'] = 'No create from %s support.'; + $this->translation['create_error'] = 'Error in creating %s image from source.'; + $this->translation['source_invalid'] = 'Can\'t read image source. Not an image?.'; + $this->translation['gd_missing'] = 'GD doesn\'t seem to be present.'; + $this->translation['watermark_no_create_support'] = 'No create from %s support, can\'t read watermark.'; + $this->translation['watermark_create_error'] = 'No %s read support, can\'t create watermark.'; + $this->translation['watermark_invalid'] = 'Unknown image format, can\'t read watermark.'; + $this->translation['file_create'] = 'No %s create support.'; + $this->translation['no_conversion_type'] = 'No conversion type defined.'; + $this->translation['copy_failed'] = 'Error copying file on the server. copy() failed.'; + $this->translation['reading_failed'] = 'Error reading the file.'; + + // determines the language + $this->lang = $lang; + if ($this->lang != 'en_GB' && file_exists(dirname(__FILE__).'/lang') && file_exists(dirname(__FILE__).'/lang/class.upload.' . $lang . '.php')) { + $translation = null; + include(dirname(__FILE__).'/lang/class.upload.' . $lang . '.php'); + if (is_array($translation)) { + $this->translation = array_merge($this->translation, $translation); + } else { + $this->lang = 'en_GB'; + } + } + + + // determines the supported MIME types, and matching image format + $this->image_supported = array(); + if ($this->gdversion()) { + if (imagetypes() & IMG_GIF) { + $this->image_supported['image/gif'] = 'gif'; + } + if (imagetypes() & IMG_JPG) { + $this->image_supported['image/jpg'] = 'jpg'; + $this->image_supported['image/jpeg'] = 'jpg'; + $this->image_supported['image/pjpeg'] = 'jpg'; + } + if (imagetypes() & IMG_PNG) { + $this->image_supported['image/png'] = 'png'; + $this->image_supported['image/x-png'] = 'png'; + } + if (imagetypes() & IMG_WEBP) { + $this->image_supported['image/webp'] = 'webp'; + $this->image_supported['image/x-webp'] = 'webp'; + } + if (imagetypes() & IMG_WBMP) { + $this->image_supported['image/bmp'] = 'bmp'; + $this->image_supported['image/x-ms-bmp'] = 'bmp'; + $this->image_supported['image/x-windows-bmp'] = 'bmp'; + } + } + + // display some system information + if (empty($this->log)) { + $this->log .= 'system information
    '; + if ($this->function_enabled('ini_get_all')) { + $inis = ini_get_all(); + $open_basedir = (array_key_exists('open_basedir', $inis) && array_key_exists('local_value', $inis['open_basedir']) && !empty($inis['open_basedir']['local_value'])) ? $inis['open_basedir']['local_value'] : false; + } else { + $open_basedir = false; + } + $gd = $this->gdversion() ? $this->gdversion(true) : 'GD not present'; + $supported = trim((in_array('png', $this->image_supported) ? 'png' : '') . ' ' . + (in_array('webp', $this->image_supported) ? 'webp' : '') . ' ' . + (in_array('jpg', $this->image_supported) ? 'jpg' : '') . ' ' . + (in_array('gif', $this->image_supported) ? 'gif' : '') . ' ' . + (in_array('bmp', $this->image_supported) ? 'bmp' : '')); + $this->log .= '- class version : ' . $this->version . '
    '; + $this->log .= '- operating system : ' . PHP_OS . '
    '; + $this->log .= '- PHP version : ' . PHP_VERSION . '
    '; + $this->log .= '- GD version : ' . $gd . '
    '; + $this->log .= '- supported image types : ' . (!empty($supported) ? $supported : 'none') . '
    '; + $this->log .= '- open_basedir : ' . (!empty($open_basedir) ? $open_basedir : 'no restriction') . '
    '; + $this->log .= '- upload_max_filesize : ' . $this->file_max_size_raw . ' (' . $this->file_max_size . ' bytes)
    '; + $this->log .= '- language : ' . $this->lang . '
    '; + } + + if (!$file) { + $this->uploaded = false; + $this->error = $this->translate('file_error'); + } + + // check if we sent a local filename or a PHP stream rather than a $_FILE element + if (!is_array($file)) { + if (empty($file)) { + $this->uploaded = false; + $this->error = $this->translate('file_error'); + } else { + $file = (string) $file; + if (substr($file, 0, 4) == 'php:' || substr($file, 0, 5) == 'data:' || substr($file, 0, 7) == 'base64:') { + $data = null; + + // this is a PHP stream, i.e.not uploaded + if (substr($file, 0, 4) == 'php:') { + $file = preg_replace('/^php:(.*)/i', '$1', $file); + if (!$file) $file = $_SERVER['HTTP_X_FILE_NAME']; + if (!$file) $file = 'unknown'; + $data = file_get_contents('php://input'); + $this->log .= 'source is a PHP stream ' . $file . ' of length ' . strlen($data) . '
    '; + + // this is the raw file data, base64-encoded, i.e.not uploaded + } else if (substr($file, 0, 7) == 'base64:') { + $data = base64_decode(preg_replace('/^base64:(.*)/i', '$1', $file)); + $file = 'base64'; + $this->log .= 'source is a base64 string of length ' . strlen($data) . '
    '; + + // this is the raw file data, base64-encoded, i.e.not uploaded + } else if (substr($file, 0, 5) == 'data:' && strpos($file, 'base64,') !== false) { + $data = base64_decode(preg_replace('/^data:.*base64,(.*)/i', '$1', $file)); + $file = 'base64'; + $this->log .= 'source is a base64 data string of length ' . strlen($data) . '
    '; + + // this is the raw file data, i.e.not uploaded + } else if (substr($file, 0, 5) == 'data:') { + $data = preg_replace('/^data:(.*)/i', '$1', $file); + $file = 'data'; + $this->log .= 'source is a data string of length ' . strlen($data) . '
    '; + } + + if (!$data) { + $this->log .= '- source is empty!
    '; + $this->uploaded = false; + $this->error = $this->translate('source_invalid'); + } + + $this->no_upload_check = true; + + if ($this->uploaded) { + $this->log .= '- requires a temp file ... '; + $hash = $this->temp_dir() . md5($file . rand(1, 1000)); + if ($data && file_put_contents($hash, $data)) { + $this->file_src_pathname = $hash; + $this->log .= ' file created
    '; + $this->log .= '    temp file is: ' . $this->file_src_pathname . '
    '; + } else { + $this->log .= ' failed
    '; + $this->uploaded = false; + $this->error = $this->translate('temp_file'); + } + } + + if ($this->uploaded) { + $this->file_src_name = $file; + $this->log .= '- local file OK
    '; + preg_match('/\.([^\.]*$)/', $this->file_src_name, $extension); + if (is_array($extension) && sizeof($extension) > 0) { + $this->file_src_name_ext = strtolower($extension[1]); + $this->file_src_name_body = substr($this->file_src_name, 0, ((strlen($this->file_src_name) - strlen($this->file_src_name_ext)))-1); + } else { + $this->file_src_name_ext = ''; + $this->file_src_name_body = $this->file_src_name; + } + $this->file_src_size = (file_exists($this->file_src_pathname) ? filesize($this->file_src_pathname) : 0); + } + $this->file_src_error = 0; + + } else { + // this is a local filename, i.e.not uploaded + $this->log .= 'source is a local file ' . $file . '
    '; + $this->no_upload_check = true; + + if ($this->uploaded && !file_exists($file)) { + $this->uploaded = false; + $this->error = $this->translate('local_file_missing'); + } + + if ($this->uploaded && !is_readable($file)) { + $this->uploaded = false; + $this->error = $this->translate('local_file_not_readable'); + } + + if ($this->uploaded) { + $this->file_src_pathname = $file; + $this->file_src_name = basename($file); + $this->log .= '- local file OK
    '; + preg_match('/\.([^\.]*$)/', $this->file_src_name, $extension); + if (is_array($extension) && sizeof($extension) > 0) { + $this->file_src_name_ext = strtolower($extension[1]); + $this->file_src_name_body = substr($this->file_src_name, 0, ((strlen($this->file_src_name) - strlen($this->file_src_name_ext)))-1); + } else { + $this->file_src_name_ext = ''; + $this->file_src_name_body = $this->file_src_name; + } + $this->file_src_size = (file_exists($this->file_src_pathname) ? filesize($this->file_src_pathname) : 0); + } + $this->file_src_error = 0; + } + } + } else { + // this is an element from $_FILE, i.e. an uploaded file + $this->log .= 'source is an uploaded file
    '; + if ($this->uploaded) { + $this->file_src_error = trim((int) $file['error']); + switch($this->file_src_error) { + case UPLOAD_ERR_OK: + // all is OK + $this->log .= '- upload OK
    '; + break; + case UPLOAD_ERR_INI_SIZE: + $this->uploaded = false; + $this->error = $this->translate('uploaded_too_big_ini'); + break; + case UPLOAD_ERR_FORM_SIZE: + $this->uploaded = false; + $this->error = $this->translate('uploaded_too_big_html'); + break; + case UPLOAD_ERR_PARTIAL: + $this->uploaded = false; + $this->error = $this->translate('uploaded_partial'); + break; + case UPLOAD_ERR_NO_FILE: + $this->uploaded = false; + $this->error = $this->translate('uploaded_missing'); + break; + case @UPLOAD_ERR_NO_TMP_DIR: + $this->uploaded = false; + $this->error = $this->translate('uploaded_no_tmp_dir'); + break; + case @UPLOAD_ERR_CANT_WRITE: + $this->uploaded = false; + $this->error = $this->translate('uploaded_cant_write'); + break; + case @UPLOAD_ERR_EXTENSION: + $this->uploaded = false; + $this->error = $this->translate('uploaded_err_extension'); + break; + default: + $this->uploaded = false; + $this->error = $this->translate('uploaded_unknown') . ' ('.$this->file_src_error.')'; + } + } + + if ($this->uploaded) { + $this->file_src_pathname = (string) $file['tmp_name']; + $this->file_src_name = (string) $file['name']; + if ($this->file_src_name == '') { + $this->uploaded = false; + $this->error = $this->translate('try_again'); + } + } + + if ($this->uploaded) { + $this->log .= '- file name OK
    '; + preg_match('/\.([^\.]*$)/', $this->file_src_name, $extension); + if (is_array($extension) && sizeof($extension) > 0) { + $this->file_src_name_ext = strtolower($extension[1]); + $this->file_src_name_body = substr($this->file_src_name, 0, ((strlen($this->file_src_name) - strlen($this->file_src_name_ext)))-1); + } else { + $this->file_src_name_ext = ''; + $this->file_src_name_body = $this->file_src_name; + } + $this->file_src_size = (int) $file['size']; + $mime_from_browser = (string) $file['type']; + } + } + + if ($this->uploaded) { + $this->log .= 'determining MIME type
    '; + $this->file_src_mime = null; + + // checks MIME type with Fileinfo PECL extension + if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === false) { + if ($this->mime_fileinfo) { + $this->log .= '- Checking MIME type with Fileinfo PECL extension
    '; + if ($this->function_enabled('finfo_open')) { + $path = null; + if ($this->mime_fileinfo !== '') { + if ($this->mime_fileinfo === true) { + if (getenv('MAGIC') === false) { + if (substr(PHP_OS, 0, 3) == 'WIN') { + $path = realpath(ini_get('extension_dir') . '/../') . '/extras/magic'; + $this->log .= '    MAGIC path defaults to ' . $path . '
    '; + } + } else { + $path = getenv('MAGIC'); + $this->log .= '    MAGIC path is set to ' . $path . ' from MAGIC variable
    '; + } + } else { + $path = $this->mime_fileinfo; + $this->log .= '    MAGIC path is set to ' . $path . '
    '; + } + } + if ($path) { + $f = @finfo_open(FILEINFO_MIME, $path); + } else { + $this->log .= '    MAGIC path will not be used
    '; + $f = @finfo_open(FILEINFO_MIME); + } + if (is_resource($f)) { + $mime = finfo_file($f, realpath($this->file_src_pathname)); + finfo_close($f); + $this->file_src_mime = $mime; + $this->log .= '    MIME type detected as ' . $this->file_src_mime . ' by Fileinfo PECL extension
    '; + if (preg_match("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", $this->file_src_mime)) { + $this->file_src_mime = preg_replace("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", '$1/$2', $this->file_src_mime); + $this->log .= '- MIME validated as ' . $this->file_src_mime . '
    '; + } else { + $this->file_src_mime = null; + } + } else { + $this->log .= '    Fileinfo PECL extension failed (finfo_open)
    '; + } + } elseif (@class_exists('finfo', false)) { + $f = new finfo( FILEINFO_MIME ); + if ($f) { + $this->file_src_mime = $f->file(realpath($this->file_src_pathname)); + $this->log .= '- MIME type detected as ' . $this->file_src_mime . ' by Fileinfo PECL extension
    '; + if (preg_match("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", $this->file_src_mime)) { + $this->file_src_mime = preg_replace("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", '$1/$2', $this->file_src_mime); + $this->log .= '- MIME validated as ' . $this->file_src_mime . '
    '; + } else { + $this->file_src_mime = null; + } + } else { + $this->log .= '    Fileinfo PECL extension failed (finfo)
    '; + } + } else { + $this->log .= '    Fileinfo PECL extension not available
    '; + } + } else { + $this->log .= '- Fileinfo PECL extension deactivated
    '; + } + } + + // checks MIME type with shell if unix access is authorized + if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === false) { + if ($this->mime_file) { + $this->log .= '- Checking MIME type with UNIX file() command
    '; + if (substr(PHP_OS, 0, 3) != 'WIN') { + if ($this->function_enabled('exec') && $this->function_enabled('escapeshellarg')) { + if (strlen($mime = @exec("file -bi ".escapeshellarg($this->file_src_pathname))) != 0) { + $this->file_src_mime = trim($mime); + $this->log .= '    MIME type detected as ' . $this->file_src_mime . ' by UNIX file() command
    '; + if (preg_match("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", $this->file_src_mime)) { + $this->file_src_mime = preg_replace("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", '$1/$2', $this->file_src_mime); + $this->log .= '- MIME validated as ' . $this->file_src_mime . '
    '; + } else { + $this->file_src_mime = null; + } + } else { + $this->log .= '    UNIX file() command failed
    '; + } + } else { + $this->log .= '    PHP exec() function is disabled
    '; + } + } else { + $this->log .= '    UNIX file() command not availabled
    '; + } + } else { + $this->log .= '- UNIX file() command is deactivated
    '; + } + } + + // checks MIME type with mime_magic + if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === false) { + if ($this->mime_magic) { + $this->log .= '- Checking MIME type with mime.magic file (mime_content_type())
    '; + if ($this->function_enabled('mime_content_type')) { + $this->file_src_mime = mime_content_type($this->file_src_pathname); + $this->log .= '    MIME type detected as ' . $this->file_src_mime . ' by mime_content_type()
    '; + if (preg_match("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", $this->file_src_mime)) { + $this->file_src_mime = preg_replace("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", '$1/$2', $this->file_src_mime); + $this->log .= '- MIME validated as ' . $this->file_src_mime . '
    '; + } else { + $this->file_src_mime = null; + } + } else { + $this->log .= '    mime_content_type() is not available
    '; + } + } else { + $this->log .= '- mime.magic file (mime_content_type()) is deactivated
    '; + } + } + + // checks MIME type with getimagesize() + if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === false) { + if ($this->mime_getimagesize) { + $this->log .= '- Checking MIME type with getimagesize()
    '; + $info = getimagesize($this->file_src_pathname); + if (is_array($info) && array_key_exists('mime', $info)) { + $this->file_src_mime = trim($info['mime']); + if (empty($this->file_src_mime)) { + $this->log .= '    MIME empty, guessing from type
    '; + $mime = (is_array($info) && array_key_exists(2, $info) ? $info[2] : null); // 1 = GIF, 2 = JPG, 3 = PNG + $this->file_src_mime = ($mime==IMAGETYPE_GIF ? 'image/gif' : + ($mime==IMAGETYPE_JPEG ? 'image/jpeg' : + ($mime==IMAGETYPE_PNG ? 'image/png' : + ($mime==IMAGETYPE_WEBP ? 'image/webp' : + ($mime==IMAGETYPE_BMP ? 'image/bmp' : null))))); + } + $this->log .= '    MIME type detected as ' . $this->file_src_mime . ' by PHP getimagesize() function
    '; + if (preg_match("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", $this->file_src_mime)) { + $this->file_src_mime = preg_replace("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", '$1/$2', $this->file_src_mime); + $this->log .= '- MIME validated as ' . $this->file_src_mime . '
    '; + } else { + $this->file_src_mime = null; + } + } else { + $this->log .= '    getimagesize() failed
    '; + } + } else { + $this->log .= '- getimagesize() is deactivated
    '; + } + } + + // default to MIME from browser (or Flash) + if (!empty($mime_from_browser) && !$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime)) { + $this->file_src_mime =$mime_from_browser; + $this->log .= '- MIME type detected as ' . $this->file_src_mime . ' by browser
    '; + if (preg_match("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", $this->file_src_mime)) { + $this->file_src_mime = preg_replace("/^([\.\w-]+)\/([\.\w-]+)(.*)$/i", '$1/$2', $this->file_src_mime); + $this->log .= '- MIME validated as ' . $this->file_src_mime . '
    '; + } else { + $this->file_src_mime = null; + } + } + + // we need to work some magic if we upload via Flash + if ($this->file_src_mime == 'application/octet-stream' || !$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === false) { + if ($this->file_src_mime == 'application/octet-stream') $this->log .= '- Flash may be rewriting MIME as application/octet-stream
    '; + $this->log .= '- Try to guess MIME type from file extension (' . $this->file_src_name_ext . '): '; + if (array_key_exists($this->file_src_name_ext, $this->mime_types)) $this->file_src_mime = $this->mime_types[$this->file_src_name_ext]; + if ($this->file_src_mime == 'application/octet-stream') { + $this->log .= 'doesn\'t look like anything known
    '; + } else { + $this->log .= 'MIME type set to ' . $this->file_src_mime . '
    '; + } + } + + if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === false) { + $this->log .= '- MIME type couldn\'t be detected! (' . (string) $this->file_src_mime . ')
    '; + } + + // determine whether the file is an image + if ($this->file_src_mime && is_string($this->file_src_mime) && !empty($this->file_src_mime) && array_key_exists($this->file_src_mime, $this->image_supported)) { + $this->file_is_image = true; + $this->image_src_type = $this->image_supported[$this->file_src_mime]; + } + + // if the file is an image, we gather some useful data + if ($this->file_is_image) { + if ($h = fopen($this->file_src_pathname, 'r')) { + fclose($h); + $info = getimagesize($this->file_src_pathname); + if (is_array($info)) { + $this->image_src_x = $info[0]; + $this->image_src_y = $info[1]; + $this->image_dst_x = $this->image_src_x; + $this->image_dst_y = $this->image_src_y; + $this->image_src_pixels = $this->image_src_x * $this->image_src_y; + $this->image_src_bits = array_key_exists('bits', $info) ? $info['bits'] : null; + } else { + $this->file_is_image = false; + $this->uploaded = false; + $this->log .= '- can\'t retrieve image information, image may have been tampered with
    '; + $this->error = $this->translate('source_invalid'); + } + } else { + $this->log .= '- can\'t read source file directly. open_basedir restriction in place?
    '; + } + } + + $this->log .= 'source variables
    '; + $this->log .= '- You can use all these before calling process()
    '; + $this->log .= '    file_src_name : ' . $this->file_src_name . '
    '; + $this->log .= '    file_src_name_body : ' . $this->file_src_name_body . '
    '; + $this->log .= '    file_src_name_ext : ' . $this->file_src_name_ext . '
    '; + $this->log .= '    file_src_pathname : ' . $this->file_src_pathname . '
    '; + $this->log .= '    file_src_mime : ' . $this->file_src_mime . '
    '; + $this->log .= '    file_src_size : ' . $this->file_src_size . ' (max= ' . $this->file_max_size . ')
    '; + $this->log .= '    file_src_error : ' . $this->file_src_error . '
    '; + + if ($this->file_is_image) { + $this->log .= '- source file is an image
    '; + $this->log .= '    image_src_x : ' . $this->image_src_x . '
    '; + $this->log .= '    image_src_y : ' . $this->image_src_y . '
    '; + $this->log .= '    image_src_pixels : ' . $this->image_src_pixels . '
    '; + $this->log .= '    image_src_type : ' . $this->image_src_type . '
    '; + $this->log .= '    image_src_bits : ' . $this->image_src_bits . '
    '; + } + } + + } + + /** + * Returns the version of GD + * + * @access public + * @param boolean $full Optional flag to get precise version + * @return float GD version + */ + function gdversion($full = false) { + static $gd_version = null; + static $gd_full_version = null; + if ($gd_version === null) { + if ($this->function_enabled('gd_info')) { + $gd = gd_info(); + $gd = $gd["GD Version"]; + $regex = "/([\d\.]+)/i"; + } else { + ob_start(); + phpinfo(8); + $gd = ob_get_contents(); + ob_end_clean(); + $regex = "/\bgd\s+version\b[^\d\n\r]+?([\d\.]+)/i"; + } + if (preg_match($regex, $gd, $m)) { + $gd_full_version = (string) $m[1]; + $gd_version = (float) $m[1]; + } else { + $gd_full_version = 'none'; + $gd_version = 0; + } + } + if ($full) { + return $gd_full_version; + } else { + return $gd_version; + } + } + + /** + * Checks if a function is available + * + * @access private + * @param string $func Function name + * @return boolean Success + */ + function function_enabled($func) { + // cache the list of disabled functions + static $disabled = null; + if ($disabled === null) $disabled = array_map('trim', array_map('strtolower', explode(',', ini_get('disable_functions')))); + // cache the list of functions blacklisted by suhosin + static $blacklist = null; + if ($blacklist === null) $blacklist = extension_loaded('suhosin') ? array_map('trim', array_map('strtolower', explode(',', ini_get(' suhosin.executor.func.blacklist')))) : array(); + // checks if the function is really enabled + return (function_exists($func) && !in_array($func, $disabled) && !in_array($func, $blacklist)); + } + + /** + * Creates directories recursively + * + * @access private + * @param string $path Path to create + * @param integer $mode Optional permissions + * @return boolean Success + */ + function rmkdir($path, $mode = 0755) { + return is_dir($path) || ( $this->rmkdir(dirname($path), $mode) && $this->_mkdir($path, $mode) ); + } + + /** + * Creates directory + * + * @access private + * @param string $path Path to create + * @param integer $mode Optional permissions + * @return boolean Success + */ + function _mkdir($path, $mode = 0755) { + $old = umask(0); + $res = @mkdir($path, $mode); + umask($old); + return $res; + } + + /** + * Translate error messages + * + * @access private + * @param string $str Message to translate + * @param array $tokens Optional token values + * @return string Translated string + */ + function translate($str, $tokens = array()) { + if (array_key_exists($str, $this->translation)) $str = $this->translation[$str]; + if (is_array($tokens) && sizeof($tokens) > 0) $str = vsprintf($str, $tokens); + return $str; + } + + /** + * Returns the temp directory + * + * @access private + * @return string Temp directory string + */ + function temp_dir() { + $dir = ''; + if ($this->function_enabled('sys_get_temp_dir')) $dir = sys_get_temp_dir(); + if (!$dir && $tmp=getenv('TMP')) $dir = $tmp; + if (!$dir && $tmp=getenv('TEMP')) $dir = $tmp; + if (!$dir && $tmp=getenv('TMPDIR')) $dir = $tmp; + if (!$dir) { + $tmp = tempnam(__FILE__,''); + if (file_exists($tmp)) { + unlink($tmp); + $dir = dirname($tmp); + } + } + if (!$dir) return ''; + $slash = (strtolower(substr(PHP_OS, 0, 3)) === 'win' ? '\\' : '/'); + if (substr($dir, -1) != $slash) $dir = $dir . $slash; + return $dir; + } + + /** + * Sanitize a file name + * + * @access private + * @param string $filename File name + * @return string Sanitized file name + */ + function sanitize($filename) { + // remove HTML tags + $filename = strip_tags($filename); + // remove non-breaking spaces + $filename = preg_replace("#\x{00a0}#siu", ' ', $filename); + // remove illegal file system characters + $filename = str_replace(array_map('chr', range(0, 31)), '', $filename); + // remove dangerous characters for file names + $chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "’", "%20", + "+", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", "%", "+", "^", chr(0)); + $filename = str_replace($chars, '-', $filename); + // remove break/tabs/return carriage + $filename = preg_replace('/[\r\n\t -]+/', '-', $filename); + // convert some special letters + $convert = array('Þ' => 'TH', 'þ' => 'th', 'Ã' => 'DH', 'ð' => 'dh', 'ß' => 'ss', + 'Å’' => 'OE', 'Å“' => 'oe', 'Æ' => 'AE', 'æ' => 'ae', 'µ' => 'u'); + $filename = strtr($filename, $convert); + // remove foreign accents by converting to HTML entities, and then remove the code + $filename = html_entity_decode( $filename, ENT_QUOTES, "utf-8" ); + $filename = htmlentities($filename, ENT_QUOTES, "utf-8"); + $filename = preg_replace("/(&)([a-z])([a-z]+;)/i", '$2', $filename); + // clean up, and remove repetitions + $filename = preg_replace('/_+/', '_', $filename); + $filename = preg_replace(array('/ +/', '/-+/'), '-', $filename); + $filename = preg_replace(array('/-*\.-*/', '/\.{2,}/'), '.', $filename); + // cut to 255 characters + $length = 255 - strlen($this->file_dst_name_ext) + 1; + $filename = extension_loaded('mbstring') ? mb_strcut($filename, 0, $length, mb_detect_encoding($filename)) : substr($filename, 0, $length); + // remove bad characters at start and end + $filename = trim($filename, '.-_'); + return $filename; + } + + /** + * Decodes colors + * + * @access private + * @param string $color Color string + * @return array RGB colors + */ + function getcolors($color) { + $color = str_replace('#', '', $color); + if (strlen($color) == 3) $color = str_repeat(substr($color, 0, 1), 2) . str_repeat(substr($color, 1, 1), 2) . str_repeat(substr($color, 2, 1), 2); + $r = sscanf($color, "%2x%2x%2x"); + $red = (is_array($r) && array_key_exists(0, $r) && is_numeric($r[0]) ? $r[0] : 0); + $green = (is_array($r) && array_key_exists(1, $r) && is_numeric($r[1]) ? $r[1] : 0); + $blue = (is_array($r) && array_key_exists(2, $r) && is_numeric($r[2]) ? $r[2] : 0); + return array($red, $green, $blue); + } + + /** + * Decodes sizes + * + * @access private + * @param string $size Size in bytes, or shorthand byte options + * @return integer Size in bytes + */ + function getsize($size) { + if ($size === null) return null; + $last = is_string($size) ? strtolower(substr($size, -1)) : null; + $size = (int) $size; + switch($last) { + case 'g': + $size *= 1024; + case 'm': + $size *= 1024; + case 'k': + $size *= 1024; + } + return $size; + } + + /** + * Decodes offsets + * + * @access private + * @param misc $offsets Offsets, as an integer, a string or an array + * @param integer $x Reference picture width + * @param integer $y Reference picture height + * @param boolean $round Round offsets before returning them + * @param boolean $negative Allow negative offsets to be returned + * @return array Array of four offsets (TRBL) + */ + function getoffsets($offsets, $x, $y, $round = true, $negative = true) { + if (!is_array($offsets)) $offsets = explode(' ', $offsets); + if (sizeof($offsets) == 4) { + $ct = $offsets[0]; $cr = $offsets[1]; $cb = $offsets[2]; $cl = $offsets[3]; + } else if (sizeof($offsets) == 2) { + $ct = $offsets[0]; $cr = $offsets[1]; $cb = $offsets[0]; $cl = $offsets[1]; + } else { + $ct = $offsets[0]; $cr = $offsets[0]; $cb = $offsets[0]; $cl = $offsets[0]; + } + if (strpos($ct, '%')>0) $ct = $y * (str_replace('%','',$ct) / 100); + if (strpos($cr, '%')>0) $cr = $x * (str_replace('%','',$cr) / 100); + if (strpos($cb, '%')>0) $cb = $y * (str_replace('%','',$cb) / 100); + if (strpos($cl, '%')>0) $cl = $x * (str_replace('%','',$cl) / 100); + if (strpos($ct, 'px')>0) $ct = str_replace('px','',$ct); + if (strpos($cr, 'px')>0) $cr = str_replace('px','',$cr); + if (strpos($cb, 'px')>0) $cb = str_replace('px','',$cb); + if (strpos($cl, 'px')>0) $cl = str_replace('px','',$cl); + $ct = (int) $ct; $cr = (int) $cr; $cb = (int) $cb; $cl = (int) $cl; + if ($round) { + $ct = round($ct); + $cr = round($cr); + $cb = round($cb); + $cl = round($cl); + } + if (!$negative) { + if ($ct < 0) $ct = 0; + if ($cr < 0) $cr = 0; + if ($cb < 0) $cb = 0; + if ($cl < 0) $cl = 0; + } + return array($ct, $cr, $cb, $cl); + } + + /** + * Creates a container image + * + * @access private + * @param integer $x Width + * @param integer $y Height + * @param boolean $fill Optional flag to draw the background color or not + * @param boolean $trsp Optional flag to set the background to be transparent + * @return resource Container image + */ + function imagecreatenew($x, $y, $fill = true, $trsp = false) { + if ($x < 1) $x = 1; if ($y < 1) $y = 1; + if ($this->gdversion() >= 2 && !$this->image_is_palette) { + // create a true color image + $dst_im = imagecreatetruecolor($x, $y); + // this preserves transparency in PNG and WEBP, in true color + if (empty($this->image_background_color) || $trsp) { + imagealphablending($dst_im, false ); + imagefilledrectangle($dst_im, 0, 0, $x, $y, imagecolorallocatealpha($dst_im, 0, 0, 0, 127)); + } + } else { + // creates a palette image + $dst_im = imagecreate($x, $y); + // preserves transparency for palette images, if the original image has transparency + if (($fill && $this->image_is_transparent && empty($this->image_background_color)) || $trsp) { + imagefilledrectangle($dst_im, 0, 0, $x, $y, $this->image_transparent_color); + imagecolortransparent($dst_im, $this->image_transparent_color); + } + } + // fills with background color if any is set + if ($fill && !empty($this->image_background_color) && !$trsp) { + list($red, $green, $blue) = $this->getcolors($this->image_background_color); + $background_color = imagecolorallocate($dst_im, $red, $green, $blue); + imagefilledrectangle($dst_im, 0, 0, $x, $y, $background_color); + } + return $dst_im; + } + + + /** + * Transfers an image from the container to the destination image + * + * @access private + * @param resource $src_im Container image + * @param resource $dst_im Destination image + * @return resource Destination image + */ + function imagetransfer($src_im, $dst_im) { + if (is_resource($dst_im)) imagedestroy($dst_im); + $dst_im = & $src_im; + return $dst_im; + } + + /** + * Merges two images + * + * If the output format is PNG or WEBP, then we do it pixel per pixel to retain the alpha channel + * + * @access private + * @param resource $dst_img Destination image + * @param resource $src_img Overlay image + * @param int $dst_x x-coordinate of destination point + * @param int $dst_y y-coordinate of destination point + * @param int $src_x x-coordinate of source point + * @param int $src_y y-coordinate of source point + * @param int $src_w Source width + * @param int $src_h Source height + * @param int $pct Optional percentage of the overlay, between 0 and 100 (default: 100) + * @return resource Destination image + */ + function imagecopymergealpha(&$dst_im, &$src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct = 0) { + $dst_x = (int) $dst_x; + $dst_y = (int) $dst_y; + $src_x = (int) $src_x; + $src_y = (int) $src_y; + $src_w = (int) $src_w; + $src_h = (int) $src_h; + $pct = (int) $pct; + $dst_w = imagesx($dst_im); + $dst_h = imagesy($dst_im); + + for ($y = $src_y; $y < $src_h; $y++) { + for ($x = $src_x; $x < $src_w; $x++) { + + if ($x + $dst_x >= 0 && $x + $dst_x < $dst_w && $x + $src_x >= 0 && $x + $src_x < $src_w + && $y + $dst_y >= 0 && $y + $dst_y < $dst_h && $y + $src_y >= 0 && $y + $src_y < $src_h) { + + $dst_pixel = imagecolorsforindex($dst_im, imagecolorat($dst_im, $x + $dst_x, $y + $dst_y)); + $src_pixel = imagecolorsforindex($src_im, imagecolorat($src_im, $x + $src_x, $y + $src_y)); + + $src_alpha = 1 - ($src_pixel['alpha'] / 127); + $dst_alpha = 1 - ($dst_pixel['alpha'] / 127); + $opacity = $src_alpha * $pct / 100; + if ($dst_alpha >= $opacity) $alpha = $dst_alpha; + if ($dst_alpha < $opacity) $alpha = $opacity; + if ($alpha > 1) $alpha = 1; + + if ($opacity > 0) { + $dst_red = round(( ($dst_pixel['red'] * $dst_alpha * (1 - $opacity)) ) ); + $dst_green = round(( ($dst_pixel['green'] * $dst_alpha * (1 - $opacity)) ) ); + $dst_blue = round(( ($dst_pixel['blue'] * $dst_alpha * (1 - $opacity)) ) ); + $src_red = round((($src_pixel['red'] * $opacity)) ); + $src_green = round((($src_pixel['green'] * $opacity)) ); + $src_blue = round((($src_pixel['blue'] * $opacity)) ); + $red = round(($dst_red + $src_red ) / ($dst_alpha * (1 - $opacity) + $opacity)); + $green = round(($dst_green + $src_green) / ($dst_alpha * (1 - $opacity) + $opacity)); + $blue = round(($dst_blue + $src_blue ) / ($dst_alpha * (1 - $opacity) + $opacity)); + if ($red > 255) $red = 255; + if ($green > 255) $green = 255; + if ($blue > 255) $blue = 255; + $alpha = round((1 - $alpha) * 127); + $color = imagecolorallocatealpha($dst_im, $red, $green, $blue, $alpha); + imagesetpixel($dst_im, $x + $dst_x, $y + $dst_y, $color); + } + } + } + } + return true; + } + + + + /** + * Actually uploads the file, and act on it according to the set processing class variables + * + * This function copies the uploaded file to the given location, eventually performing actions on it. + * Typically, you can call {@link process} several times for the same file, + * for instance to create a resized image and a thumbnail of the same file. + * The original uploaded file remains intact in its temporary location, so you can use {@link process} several times. + * You will be able to delete the uploaded file with {@link clean} when you have finished all your {@link process} calls. + * + * According to the processing class variables set in the calling file, the file can be renamed, + * and if it is an image, can be resized or converted. + * + * When the processing is completed, and the file copied to its new location, the + * processing class variables will be reset to their default value. + * This allows you to set new properties, and perform another {@link process} on the same uploaded file + * + * If the function is called with a null or empty argument, then it will return the content of the picture + * + * It will set {@link processed} (and {@link error} is an error occurred) + * + * @access public + * @param string $server_path Optional path location of the uploaded file, with an ending slash + * @return string Optional content of the image + */ + function process($server_path = null) { + $this->error = ''; + $this->processed = true; + $return_mode = false; + $return_content = null; + + // clean up dst variables + $this->file_dst_path = ''; + $this->file_dst_pathname = ''; + $this->file_dst_name = ''; + $this->file_dst_name_body = ''; + $this->file_dst_name_ext = ''; + + // clean up some parameters + $this->file_max_size = $this->getsize($this->file_max_size); + $this->jpeg_size = $this->getsize($this->jpeg_size); + + // copy some variables as we need to keep them clean + $file_src_name = $this->file_src_name; + $file_src_name_body = $this->file_src_name_body; + $file_src_name_ext = $this->file_src_name_ext; + + if (!$this->uploaded) { + $this->error = $this->translate('file_not_uploaded'); + $this->processed = false; + } + + if ($this->processed) { + if (empty($server_path) || is_null($server_path)) { + $this->log .= 'process file and return the content
    '; + $return_mode = true; + } else { + if(strtolower(substr(PHP_OS, 0, 3)) === 'win') { + if (substr($server_path, -1, 1) != '\\') $server_path = $server_path . '\\'; + } else { + if (substr($server_path, -1, 1) != '/') $server_path = $server_path . '/'; + } + $this->log .= 'process file to ' . $server_path . '
    '; + } + } + + if ($this->processed) { + // checks file max size + if ($this->file_src_size > $this->file_max_size) { + $this->processed = false; + $this->error = $this->translate('file_too_big') . ' : ' . $this->file_src_size . ' > ' . $this->file_max_size; + } else { + $this->log .= '- file size OK
    '; + } + } + + if ($this->processed) { + // if we have an image without extension, set it + if ($this->file_force_extension && $this->file_is_image && !$this->file_src_name_ext) $file_src_name_ext = $this->image_src_type; + // turn dangerous scripts into text files + if ($this->no_script) { + // if the file has no extension, we try to guess it from the MIME type + if ($this->file_force_extension && empty($file_src_name_ext)) { + if ($key = array_search($this->file_src_mime, $this->mime_types)) { + $file_src_name_ext = $key; + $file_src_name = $file_src_name_body . '.' . $file_src_name_ext; + $this->log .= '- file renamed as ' . $file_src_name_body . '.' . $file_src_name_ext . '!
    '; + } + } + // if the file is text based, or has a dangerous extension, we rename it as .txt + if ((((substr($this->file_src_mime, 0, 5) == 'text/' && $this->file_src_mime != 'text/rtf') || strpos($this->file_src_mime, 'javascript') !== false) && (substr($file_src_name, -4) != '.txt')) + || preg_match('/\.(' . implode('|', $this->blacklist) . ')$/i', $this->file_src_name) + || $this->file_force_extension && empty($file_src_name_ext)) { + $this->file_src_mime = 'text/plain'; + if ($this->file_src_name_ext) $file_src_name_body = $file_src_name_body . '.' . $this->file_src_name_ext; + $file_src_name_ext = 'txt'; + $file_src_name = $file_src_name_body . '.' . $file_src_name_ext; + $this->log .= '- script renamed as ' . $file_src_name_body . '.' . $file_src_name_ext . '!
    '; + } + } + + if ($this->mime_check && empty($this->file_src_mime)) { + $this->processed = false; + $this->error = $this->translate('no_mime'); + } else if ($this->mime_check && !empty($this->file_src_mime) && strpos($this->file_src_mime, '/') !== false) { + list($m1, $m2) = explode('/', $this->file_src_mime); + $allowed = false; + // check wether the mime type is allowed + if (!is_array($this->allowed)) $this->allowed = array($this->allowed); + foreach($this->allowed as $k => $v) { + list($v1, $v2) = explode('/', $v); + if (($v1 == '*' && $v2 == '*') || ($v1 == $m1 && ($v2 == $m2 || $v2 == '*'))) { + $allowed = true; + break; + } + } + // check wether the mime type is forbidden + if (!is_array($this->forbidden)) $this->forbidden = array($this->forbidden); + foreach($this->forbidden as $k => $v) { + list($v1, $v2) = explode('/', $v); + if (($v1 == '*' && $v2 == '*') || ($v1 == $m1 && ($v2 == $m2 || $v2 == '*'))) { + $allowed = false; + break; + } + } + if (!$allowed) { + $this->processed = false; + $this->error = $this->translate('incorrect_file'); + } else { + $this->log .= '- file mime OK : ' . $this->file_src_mime . '
    '; + } + } else { + $this->log .= '- file mime (not checked) : ' . $this->file_src_mime . '
    '; + } + + // if the file is an image, we can check on its dimensions + // these checks are not available if open_basedir restrictions are in place + if ($this->file_is_image) { + if (is_numeric($this->image_src_x) && is_numeric($this->image_src_y)) { + $ratio = $this->image_src_x / $this->image_src_y; + if (!is_null($this->image_max_width) && $this->image_src_x > $this->image_max_width) { + $this->processed = false; + $this->error = $this->translate('image_too_wide'); + } + if (!is_null($this->image_min_width) && $this->image_src_x < $this->image_min_width) { + $this->processed = false; + $this->error = $this->translate('image_too_narrow'); + } + if (!is_null($this->image_max_height) && $this->image_src_y > $this->image_max_height) { + $this->processed = false; + $this->error = $this->translate('image_too_high'); + } + if (!is_null($this->image_min_height) && $this->image_src_y < $this->image_min_height) { + $this->processed = false; + $this->error = $this->translate('image_too_short'); + } + if (!is_null($this->image_max_ratio) && $ratio > $this->image_max_ratio) { + $this->processed = false; + $this->error = $this->translate('ratio_too_high'); + } + if (!is_null($this->image_min_ratio) && $ratio < $this->image_min_ratio) { + $this->processed = false; + $this->error = $this->translate('ratio_too_low'); + } + if (!is_null($this->image_max_pixels) && $this->image_src_pixels > $this->image_max_pixels) { + $this->processed = false; + $this->error = $this->translate('too_many_pixels'); + } + if (!is_null($this->image_min_pixels) && $this->image_src_pixels < $this->image_min_pixels) { + $this->processed = false; + $this->error = $this->translate('not_enough_pixels'); + } + } else { + $this->log .= '- no image properties available, can\'t enforce dimension checks : ' . $this->file_src_mime . '
    '; + } + } + } + + if ($this->processed) { + $this->file_dst_path = $server_path; + + // repopulate dst variables from src + $this->file_dst_name = $file_src_name; + $this->file_dst_name_body = $file_src_name_body; + $this->file_dst_name_ext = $file_src_name_ext; + if ($this->file_overwrite) $this->file_auto_rename = false; + + if ($this->image_convert && $this->file_is_image) { // if we convert as an image + $this->file_dst_name_ext = $this->image_convert; + $this->log .= '- new file name ext : ' . $this->file_dst_name_ext . '
    '; + } + if (!is_null($this->file_new_name_body)) { // rename file body + $this->file_dst_name_body = $this->file_new_name_body; + $this->log .= '- new file name body : ' . $this->file_new_name_body . '
    '; + } + if (!is_null($this->file_new_name_ext)) { // rename file ext + $this->file_dst_name_ext = $this->file_new_name_ext; + $this->log .= '- new file name ext : ' . $this->file_new_name_ext . '
    '; + } + if (!is_null($this->file_name_body_add)) { // append a string to the name + $this->file_dst_name_body = $this->file_dst_name_body . $this->file_name_body_add; + $this->log .= '- file name body append : ' . $this->file_name_body_add . '
    '; + } + if (!is_null($this->file_name_body_pre)) { // prepend a string to the name + $this->file_dst_name_body = $this->file_name_body_pre . $this->file_dst_name_body; + $this->log .= '- file name body prepend : ' . $this->file_name_body_pre . '
    '; + } + if ($this->file_safe_name) { // sanitize the name + $this->file_dst_name_body = $this->sanitize($this->file_dst_name_body); + $this->log .= '- file name safe format
    '; + } + + $this->log .= '- destination variables
    '; + if (empty($this->file_dst_path) || is_null($this->file_dst_path)) { + $this->log .= '    file_dst_path : n/a
    '; + } else { + $this->log .= '    file_dst_path : ' . $this->file_dst_path . '
    '; + } + $this->log .= '    file_dst_name_body : ' . $this->file_dst_name_body . '
    '; + $this->log .= '    file_dst_name_ext : ' . $this->file_dst_name_ext . '
    '; + + // set the destination file name + $this->file_dst_name = $this->file_dst_name_body . (!empty($this->file_dst_name_ext) ? '.' . $this->file_dst_name_ext : ''); + + if (!$return_mode) { + if (!$this->file_auto_rename) { + $this->log .= '- no auto_rename if same filename exists
    '; + $this->file_dst_pathname = $this->file_dst_path . $this->file_dst_name; + } else { + $this->log .= '- checking for auto_rename
    '; + $this->file_dst_pathname = $this->file_dst_path . $this->file_dst_name; + $body = $this->file_dst_name_body; + $ext = ''; + // if we have changed the extension, then we add our increment before + if ($file_src_name_ext != $this->file_src_name_ext) { + if (substr($this->file_dst_name_body, -1 - strlen($this->file_src_name_ext)) == '.' . $this->file_src_name_ext) { + $body = substr($this->file_dst_name_body, 0, strlen($this->file_dst_name_body) - 1 - strlen($this->file_src_name_ext)); + $ext = '.' . $this->file_src_name_ext; + } + } + $cpt = 1; + while (@file_exists($this->file_dst_pathname)) { + $this->file_dst_name_body = $body . '_' . $cpt . $ext; + $this->file_dst_name = $this->file_dst_name_body . (!empty($this->file_dst_name_ext) ? '.' . $this->file_dst_name_ext : ''); + $cpt++; + $this->file_dst_pathname = $this->file_dst_path . $this->file_dst_name; + } + if ($cpt>1) $this->log .= '    auto_rename to ' . $this->file_dst_name . '
    '; + } + + $this->log .= '- destination file details
    '; + $this->log .= '    file_dst_name : ' . $this->file_dst_name . '
    '; + $this->log .= '    file_dst_pathname : ' . $this->file_dst_pathname . '
    '; + + if ($this->file_overwrite) { + $this->log .= '- no overwrite checking
    '; + } else { + if (@file_exists($this->file_dst_pathname)) { + $this->processed = false; + $this->error = $this->translate('already_exists', array($this->file_dst_name)); + } else { + $this->log .= '- ' . $this->file_dst_name . ' doesn\'t exist already
    '; + } + } + } + } + + if ($this->processed) { + // if we have already moved the uploaded file, we use the temporary copy as source file, and check if it exists + if (!empty($this->file_src_temp)) { + $this->log .= '- use the temp file instead of the original file since it is a second process
    '; + $this->file_src_pathname = $this->file_src_temp; + if (!file_exists($this->file_src_pathname)) { + $this->processed = false; + $this->error = $this->translate('temp_file_missing'); + } + // if we haven't a temp file, and that we do check on uploads, we use is_uploaded_file() + } else if (!$this->no_upload_check) { + if (!is_uploaded_file($this->file_src_pathname)) { + $this->processed = false; + $this->error = $this->translate('source_missing'); + } + // otherwise, if we don't check on uploaded files (local file for instance), we use file_exists() + } else { + if (!file_exists($this->file_src_pathname)) { + $this->processed = false; + $this->error = $this->translate('source_missing'); + } + } + + // checks if the destination directory exists, and attempt to create it + if (!$return_mode) { + if ($this->processed && !file_exists($this->file_dst_path)) { + if ($this->dir_auto_create) { + $this->log .= '- ' . $this->file_dst_path . ' doesn\'t exist. Attempting creation:'; + if (!$this->rmkdir($this->file_dst_path, $this->dir_chmod)) { + $this->log .= ' failed
    '; + $this->processed = false; + $this->error = $this->translate('destination_dir'); + } else { + $this->log .= ' success
    '; + } + } else { + $this->error = $this->translate('destination_dir_missing'); + } + } + + if ($this->processed && !is_dir($this->file_dst_path)) { + $this->processed = false; + $this->error = $this->translate('destination_path_not_dir'); + } + + // checks if the destination directory is writeable, and attempt to make it writeable + $hash = md5($this->file_dst_name_body . rand(1, 1000)); + if ($this->processed && !($f = @fopen($this->file_dst_path . $hash . (!empty($this->file_dst_name_ext) ? '.' . $this->file_dst_name_ext : ''), 'a+'))) { + if ($this->dir_auto_chmod) { + $this->log .= '- ' . $this->file_dst_path . ' is not writeable. Attempting chmod:'; + if (!@chmod($this->file_dst_path, $this->dir_chmod)) { + $this->log .= ' failed
    '; + $this->processed = false; + $this->error = $this->translate('destination_dir_write'); + } else { + $this->log .= ' success
    '; + if (!($f = @fopen($this->file_dst_path . $hash . (!empty($this->file_dst_name_ext) ? '.' . $this->file_dst_name_ext : ''), 'a+'))) { // we re-check + $this->processed = false; + $this->error = $this->translate('destination_dir_write'); + } else { + @fclose($f); + } + } + } else { + $this->processed = false; + $this->error = $this->translate('destination_path_write'); + } + } else { + if ($this->processed) @fclose($f); + @unlink($this->file_dst_path . $hash . (!empty($this->file_dst_name_ext) ? '.' . $this->file_dst_name_ext : '')); + } + + + // if we have an uploaded file, and if it is the first process, and if we can't access the file directly (open_basedir restriction) + // then we create a temp file that will be used as the source file in subsequent processes + // the third condition is there to check if the file is not accessible *directly* (it already has positively gone through is_uploaded_file(), so it exists) + if (!$this->no_upload_check && empty($this->file_src_temp) && !@file_exists($this->file_src_pathname)) { + $this->log .= '- attempting to use a temp file:'; + $hash = md5($this->file_dst_name_body . rand(1, 1000)); + if (move_uploaded_file($this->file_src_pathname, $this->file_dst_path . $hash . (!empty($this->file_dst_name_ext) ? '.' . $this->file_dst_name_ext : ''))) { + $this->file_src_pathname = $this->file_dst_path . $hash . (!empty($this->file_dst_name_ext) ? '.' . $this->file_dst_name_ext : ''); + $this->file_src_temp = $this->file_src_pathname; + $this->log .= ' file created
    '; + $this->log .= '    temp file is: ' . $this->file_src_temp . '
    '; + } else { + $this->log .= ' failed
    '; + $this->processed = false; + $this->error = $this->translate('temp_file'); + } + } + } + } + + if ($this->processed) { + + // check if we need to autorotate, to automatically pre-rotates the image according to EXIF data (JPEG only) + $auto_flip = false; + $auto_rotate = 0; + if ($this->file_is_image && $this->image_auto_rotate && $this->image_src_type == 'jpg' && $this->function_enabled('exif_read_data')) { + $exif = @exif_read_data($this->file_src_pathname); + if (is_array($exif) && isset($exif['Orientation'])) { + $orientation = $exif['Orientation']; + switch($orientation) { + case 1: + $this->log .= '- EXIF orientation = 1 : default
    '; + break; + case 2: + $auto_flip = 'v'; + $this->log .= '- EXIF orientation = 2 : vertical flip
    '; + break; + case 3: + $auto_rotate = 180; + $this->log .= '- EXIF orientation = 3 : 180 rotate left
    '; + break; + case 4: + $auto_flip = 'h'; + $this->log .= '- EXIF orientation = 4 : horizontal flip
    '; + break; + case 5: + $auto_flip = 'h'; + $auto_rotate = 90; + $this->log .= '- EXIF orientation = 5 : horizontal flip + 90 rotate right
    '; + break; + case 6: + $auto_rotate = 90; + $this->log .= '- EXIF orientation = 6 : 90 rotate right
    '; + break; + case 7: + $auto_flip = 'v'; + $auto_rotate = 90; + $this->log .= '- EXIF orientation = 7 : vertical flip + 90 rotate right
    '; + break; + case 8: + $auto_rotate = 270; + $this->log .= '- EXIF orientation = 8 : 90 rotate left
    '; + break; + default: + $this->log .= '- EXIF orientation = '.$orientation.' : unknown
    '; + break; + } + } else { + $this->log .= '- EXIF data is invalid or missing
    '; + } + } else { + if (!$this->image_auto_rotate) { + $this->log .= '- auto-rotate deactivated
    '; + } else if (!$this->image_src_type == 'jpg') { + $this->log .= '- auto-rotate applies only to JPEG images
    '; + } else if (!$this->function_enabled('exif_read_data')) { + $this->log .= '- auto-rotate requires function exif_read_data to be enabled
    '; + } + } + + // do we do some image manipulation? + $image_manipulation = ($this->file_is_image && ( + $this->image_resize + || $this->image_convert != '' + || is_numeric($this->image_brightness) + || is_numeric($this->image_contrast) + || is_numeric($this->image_opacity) + || is_numeric($this->image_threshold) + || !empty($this->image_tint_color) + || !empty($this->image_overlay_color) + || $this->image_pixelate + || $this->image_unsharp + || !empty($this->image_text) + || $this->image_greyscale + || $this->image_negative + || !empty($this->image_watermark) + || $auto_rotate || $auto_flip + || is_numeric($this->image_rotate) + || is_numeric($this->jpeg_size) + || !empty($this->image_flip) + || !empty($this->image_crop) + || !empty($this->image_precrop) + || !empty($this->image_border) + || !empty($this->image_border_transparent) + || $this->image_frame > 0 + || $this->image_bevel > 0 + || $this->image_reflection_height)); + + // we do a quick check to ensure the file is really an image + // we can do this only now, as it would have failed before in case of open_basedir + if ($image_manipulation && !@getimagesize($this->file_src_pathname)) { + $this->log .= '- the file is not an image!
    '; + $image_manipulation = false; + } + + if ($image_manipulation) { + + // make sure GD doesn't complain too much + @ini_set("gd.jpeg_ignore_warning", 1); + + // checks if the source file is readable + if ($this->processed && !($f = @fopen($this->file_src_pathname, 'r'))) { + $this->processed = false; + $this->error = $this->translate('source_not_readable'); + } else { + @fclose($f); + } + + // we now do all the image manipulations + $this->log .= '- image resizing or conversion wanted
    '; + if ($this->gdversion()) { + switch($this->image_src_type) { + case 'jpg': + if (!$this->function_enabled('imagecreatefromjpeg')) { + $this->processed = false; + $this->error = $this->translate('no_create_support', array('JPEG')); + } else { + $image_src = @imagecreatefromjpeg($this->file_src_pathname); + if (!$image_src) { + $this->processed = false; + $this->error = $this->translate('create_error', array('JPEG')); + } else { + $this->log .= '- source image is JPEG
    '; + } + } + break; + case 'png': + if (!$this->function_enabled('imagecreatefrompng')) { + $this->processed = false; + $this->error = $this->translate('no_create_support', array('PNG')); + } else { + $image_src = @imagecreatefrompng($this->file_src_pathname); + if (!$image_src) { + $this->processed = false; + $this->error = $this->translate('create_error', array('PNG')); + } else { + $this->log .= '- source image is PNG
    '; + } + } + break; + case 'webp': + if (!$this->function_enabled('imagecreatefromwebp')) { + $this->processed = false; + $this->error = $this->translate('no_create_support', array('WEBP')); + } else { + $image_src = @imagecreatefromwebp($this->file_src_pathname); + if (!$image_src) { + $this->processed = false; + $this->error = $this->translate('create_error', array('WEBP')); + } else { + $this->log .= '- source image is WEBP
    '; + } + } + break; + case 'gif': + if (!$this->function_enabled('imagecreatefromgif')) { + $this->processed = false; + $this->error = $this->translate('no_create_support', array('GIF')); + } else { + $image_src = @imagecreatefromgif($this->file_src_pathname); + if (!$image_src) { + $this->processed = false; + $this->error = $this->translate('create_error', array('GIF')); + } else { + $this->log .= '- source image is GIF
    '; + } + } + break; + case 'bmp': + if (!method_exists($this, 'imagecreatefrombmp')) { + $this->processed = false; + $this->error = $this->translate('no_create_support', array('BMP')); + } else { + $image_src = @$this->imagecreatefrombmp($this->file_src_pathname); + if (!$image_src) { + $this->processed = false; + $this->error = $this->translate('create_error', array('BMP')); + } else { + $this->log .= '- source image is BMP
    '; + } + } + break; + default: + $this->processed = false; + $this->error = $this->translate('source_invalid'); + } + } else { + $this->processed = false; + $this->error = $this->translate('gd_missing'); + } + + if ($this->processed && $image_src) { + + // we have to set image_convert if it is not already + if (empty($this->image_convert)) { + $this->log .= '- setting destination file type to ' . $this->image_src_type . '
    '; + $this->image_convert = $this->image_src_type; + } + + if (!in_array($this->image_convert, $this->image_supported)) { + $this->image_convert = 'jpg'; + } + + // we set the default color to be the background color if we don't output in a transparent format + if ($this->image_convert != 'png' && $this->image_convert != 'webp' && $this->image_convert != 'gif' && !empty($this->image_default_color) && empty($this->image_background_color)) $this->image_background_color = $this->image_default_color; + if (!empty($this->image_background_color)) $this->image_default_color = $this->image_background_color; + if (empty($this->image_default_color)) $this->image_default_color = '#FFFFFF'; + + $this->image_src_x = imagesx($image_src); + $this->image_src_y = imagesy($image_src); + $gd_version = $this->gdversion(); + $ratio_crop = null; + + if (!imageistruecolor($image_src)) { // $this->image_src_type == 'gif' + $this->log .= '- image is detected as having a palette
    '; + $this->image_is_palette = true; + $this->image_transparent_color = imagecolortransparent($image_src); + if ($this->image_transparent_color >= 0 && imagecolorstotal($image_src) > $this->image_transparent_color) { + $this->image_is_transparent = true; + $this->log .= '    palette image is detected as transparent
    '; + } + // if the image has a palette (GIF), we convert it to true color, preserving transparency + $this->log .= '    convert palette image to true color
    '; + $true_color = imagecreatetruecolor($this->image_src_x, $this->image_src_y); + imagealphablending($true_color, false); + imagesavealpha($true_color, true); + for ($x = 0; $x < $this->image_src_x; $x++) { + for ($y = 0; $y < $this->image_src_y; $y++) { + if ($this->image_transparent_color >= 0 && imagecolorat($image_src, $x, $y) == $this->image_transparent_color) { + imagesetpixel($true_color, $x, $y, 127 << 24); + } else { + $rgb = imagecolorsforindex($image_src, imagecolorat($image_src, $x, $y)); + imagesetpixel($true_color, $x, $y, ($rgb['alpha'] << 24) | ($rgb['red'] << 16) | ($rgb['green'] << 8) | $rgb['blue']); + } + } + } + $image_src = $this->imagetransfer($true_color, $image_src); + imagealphablending($image_src, false); + imagesavealpha($image_src, true); + $this->image_is_palette = false; + } + + $image_dst = & $image_src; + + // auto-flip image, according to EXIF data (JPEG only) + if ($gd_version >= 2 && !empty($auto_flip)) { + $this->log .= '- auto-flip image : ' . ($auto_flip == 'v' ? 'vertical' : 'horizontal') . '
    '; + $tmp = $this->imagecreatenew($this->image_src_x, $this->image_src_y); + for ($x = 0; $x < $this->image_src_x; $x++) { + for ($y = 0; $y < $this->image_src_y; $y++){ + if (strpos($auto_flip, 'v') !== false) { + imagecopy($tmp, $image_dst, $this->image_src_x - $x - 1, $y, $x, $y, 1, 1); + } else { + imagecopy($tmp, $image_dst, $x, $this->image_src_y - $y - 1, $x, $y, 1, 1); + } + } + } + // we transfert tmp into image_dst + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + + // auto-rotate image, according to EXIF data (JPEG only) + if ($gd_version >= 2 && is_numeric($auto_rotate)) { + if (!in_array($auto_rotate, array(0, 90, 180, 270))) $auto_rotate = 0; + if ($auto_rotate != 0) { + if ($auto_rotate == 90 || $auto_rotate == 270) { + $tmp = $this->imagecreatenew($this->image_src_y, $this->image_src_x); + } else { + $tmp = $this->imagecreatenew($this->image_src_x, $this->image_src_y); + } + $this->log .= '- auto-rotate image : ' . $auto_rotate . '
    '; + for ($x = 0; $x < $this->image_src_x; $x++) { + for ($y = 0; $y < $this->image_src_y; $y++){ + if ($auto_rotate == 90) { + imagecopy($tmp, $image_dst, $y, $x, $x, $this->image_src_y - $y - 1, 1, 1); + } else if ($auto_rotate == 180) { + imagecopy($tmp, $image_dst, $x, $y, $this->image_src_x - $x - 1, $this->image_src_y - $y - 1, 1, 1); + } else if ($auto_rotate == 270) { + imagecopy($tmp, $image_dst, $y, $x, $this->image_src_x - $x - 1, $y, 1, 1); + } else { + imagecopy($tmp, $image_dst, $x, $y, $x, $y, 1, 1); + } + } + } + if ($auto_rotate == 90 || $auto_rotate == 270) { + $t = $this->image_src_y; + $this->image_src_y = $this->image_src_x; + $this->image_src_x = $t; + } + // we transfert tmp into image_dst + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + } + + // pre-crop image, before resizing + if ((!empty($this->image_precrop))) { + list($ct, $cr, $cb, $cl) = $this->getoffsets($this->image_precrop, $this->image_src_x, $this->image_src_y, true, true); + $this->log .= '- pre-crop image : ' . $ct . ' ' . $cr . ' ' . $cb . ' ' . $cl . '
    '; + $this->image_src_x = $this->image_src_x - $cl - $cr; + $this->image_src_y = $this->image_src_y - $ct - $cb; + if ($this->image_src_x < 1) $this->image_src_x = 1; + if ($this->image_src_y < 1) $this->image_src_y = 1; + $tmp = $this->imagecreatenew($this->image_src_x, $this->image_src_y); + + // we copy the image into the recieving image + imagecopy($tmp, $image_dst, 0, 0, $cl, $ct, $this->image_src_x, $this->image_src_y); + + // if we crop with negative margins, we have to make sure the extra bits are the right color, or transparent + if ($ct < 0 || $cr < 0 || $cb < 0 || $cl < 0 ) { + // use the background color if present + if (!empty($this->image_background_color)) { + list($red, $green, $blue) = $this->getcolors($this->image_background_color); + $fill = imagecolorallocate($tmp, $red, $green, $blue); + } else { + $fill = imagecolorallocatealpha($tmp, 0, 0, 0, 127); + } + // fills eventual negative margins + if ($ct < 0) imagefilledrectangle($tmp, 0, 0, $this->image_src_x, -$ct, $fill); + if ($cr < 0) imagefilledrectangle($tmp, $this->image_src_x + $cr, 0, $this->image_src_x, $this->image_src_y, $fill); + if ($cb < 0) imagefilledrectangle($tmp, 0, $this->image_src_y + $cb, $this->image_src_x, $this->image_src_y, $fill); + if ($cl < 0) imagefilledrectangle($tmp, 0, 0, -$cl, $this->image_src_y, $fill); + } + + // we transfert tmp into image_dst + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + + // resize image (and move image_src_x, image_src_y dimensions into image_dst_x, image_dst_y) + if ($this->image_resize) { + $this->log .= '- resizing...
    '; + $this->image_dst_x = $this->image_x; + $this->image_dst_y = $this->image_y; + + // backward compatibility for soon to be deprecated settings + if ($this->image_ratio_no_zoom_in) { + $this->image_ratio = true; + $this->image_no_enlarging = true; + } else if ($this->image_ratio_no_zoom_out) { + $this->image_ratio = true; + $this->image_no_shrinking = true; + } + + // keeps aspect ratio with x calculated from y + if ($this->image_ratio_x) { + $this->log .= '    calculate x size
    '; + $this->image_dst_x = round(($this->image_src_x * $this->image_y) / $this->image_src_y); + $this->image_dst_y = $this->image_y; + + // keeps aspect ratio with y calculated from x + } else if ($this->image_ratio_y) { + $this->log .= '    calculate y size
    '; + $this->image_dst_x = $this->image_x; + $this->image_dst_y = round(($this->image_src_y * $this->image_x) / $this->image_src_x); + + // keeps aspect ratio, calculating x and y so that the image is approx the set number of pixels + } else if (is_numeric($this->image_ratio_pixels)) { + $this->log .= '    calculate x/y size to match a number of pixels
    '; + $pixels = $this->image_src_y * $this->image_src_x; + $diff = sqrt($this->image_ratio_pixels / $pixels); + $this->image_dst_x = round($this->image_src_x * $diff); + $this->image_dst_y = round($this->image_src_y * $diff); + + // keeps aspect ratio with x and y dimensions, filling the space + } else if ($this->image_ratio_crop) { + if (!is_string($this->image_ratio_crop)) $this->image_ratio_crop = ''; + $this->image_ratio_crop = strtolower($this->image_ratio_crop); + if (($this->image_src_x/$this->image_x) > ($this->image_src_y/$this->image_y)) { + $this->image_dst_y = $this->image_y; + $this->image_dst_x = intval($this->image_src_x*($this->image_y / $this->image_src_y)); + $ratio_crop = array(); + $ratio_crop['x'] = $this->image_dst_x - $this->image_x; + if (strpos($this->image_ratio_crop, 'l') !== false) { + $ratio_crop['l'] = 0; + $ratio_crop['r'] = $ratio_crop['x']; + } else if (strpos($this->image_ratio_crop, 'r') !== false) { + $ratio_crop['l'] = $ratio_crop['x']; + $ratio_crop['r'] = 0; + } else { + $ratio_crop['l'] = round($ratio_crop['x']/2); + $ratio_crop['r'] = $ratio_crop['x'] - $ratio_crop['l']; + } + $this->log .= '    ratio_crop_x : ' . $ratio_crop['x'] . ' (' . $ratio_crop['l'] . ';' . $ratio_crop['r'] . ')
    '; + if (is_null($this->image_crop)) $this->image_crop = array(0, 0, 0, 0); + } else { + $this->image_dst_x = $this->image_x; + $this->image_dst_y = intval($this->image_src_y*($this->image_x / $this->image_src_x)); + $ratio_crop = array(); + $ratio_crop['y'] = $this->image_dst_y - $this->image_y; + if (strpos($this->image_ratio_crop, 't') !== false) { + $ratio_crop['t'] = 0; + $ratio_crop['b'] = $ratio_crop['y']; + } else if (strpos($this->image_ratio_crop, 'b') !== false) { + $ratio_crop['t'] = $ratio_crop['y']; + $ratio_crop['b'] = 0; + } else { + $ratio_crop['t'] = round($ratio_crop['y']/2); + $ratio_crop['b'] = $ratio_crop['y'] - $ratio_crop['t']; + } + $this->log .= '    ratio_crop_y : ' . $ratio_crop['y'] . ' (' . $ratio_crop['t'] . ';' . $ratio_crop['b'] . ')
    '; + if (is_null($this->image_crop)) $this->image_crop = array(0, 0, 0, 0); + } + + // keeps aspect ratio with x and y dimensions, fitting the image in the space, and coloring the rest + } else if ($this->image_ratio_fill) { + if (!is_string($this->image_ratio_fill)) $this->image_ratio_fill = ''; + $this->image_ratio_fill = strtolower($this->image_ratio_fill); + if (($this->image_src_x/$this->image_x) < ($this->image_src_y/$this->image_y)) { + $this->image_dst_y = $this->image_y; + $this->image_dst_x = intval($this->image_src_x*($this->image_y / $this->image_src_y)); + $ratio_crop = array(); + $ratio_crop['x'] = $this->image_dst_x - $this->image_x; + if (strpos($this->image_ratio_fill, 'l') !== false) { + $ratio_crop['l'] = 0; + $ratio_crop['r'] = $ratio_crop['x']; + } else if (strpos($this->image_ratio_fill, 'r') !== false) { + $ratio_crop['l'] = $ratio_crop['x']; + $ratio_crop['r'] = 0; + } else { + $ratio_crop['l'] = round($ratio_crop['x']/2); + $ratio_crop['r'] = $ratio_crop['x'] - $ratio_crop['l']; + } + $this->log .= '    ratio_fill_x : ' . $ratio_crop['x'] . ' (' . $ratio_crop['l'] . ';' . $ratio_crop['r'] . ')
    '; + if (is_null($this->image_crop)) $this->image_crop = array(0, 0, 0, 0); + } else { + $this->image_dst_x = $this->image_x; + $this->image_dst_y = intval($this->image_src_y*($this->image_x / $this->image_src_x)); + $ratio_crop = array(); + $ratio_crop['y'] = $this->image_dst_y - $this->image_y; + if (strpos($this->image_ratio_fill, 't') !== false) { + $ratio_crop['t'] = 0; + $ratio_crop['b'] = $ratio_crop['y']; + } else if (strpos($this->image_ratio_fill, 'b') !== false) { + $ratio_crop['t'] = $ratio_crop['y']; + $ratio_crop['b'] = 0; + } else { + $ratio_crop['t'] = round($ratio_crop['y']/2); + $ratio_crop['b'] = $ratio_crop['y'] - $ratio_crop['t']; + } + $this->log .= '    ratio_fill_y : ' . $ratio_crop['y'] . ' (' . $ratio_crop['t'] . ';' . $ratio_crop['b'] . ')
    '; + if (is_null($this->image_crop)) $this->image_crop = array(0, 0, 0, 0); + } + + // keeps aspect ratio with x and y dimensions + } else if ($this->image_ratio) { + if (($this->image_src_x/$this->image_x) > ($this->image_src_y/$this->image_y)) { + $this->image_dst_x = $this->image_x; + $this->image_dst_y = intval($this->image_src_y*($this->image_x / $this->image_src_x)); + } else { + $this->image_dst_y = $this->image_y; + $this->image_dst_x = intval($this->image_src_x*($this->image_y / $this->image_src_y)); + } + + // resize to provided exact dimensions + } else { + $this->log .= '    use plain sizes
    '; + $this->image_dst_x = $this->image_x; + $this->image_dst_y = $this->image_y; + } + + if ($this->image_dst_x < 1) $this->image_dst_x = 1; + if ($this->image_dst_y < 1) $this->image_dst_y = 1; + $this->log .= '    image_src_x y : ' . $this->image_src_x . ' x ' . $this->image_src_y . '
    '; + $this->log .= '    image_dst_x y : ' . $this->image_dst_x . ' x ' . $this->image_dst_y . '
    '; + + // make sure we don't enlarge the image if we don't want to + if ($this->image_no_enlarging && ($this->image_src_x < $this->image_dst_x || $this->image_src_y < $this->image_dst_y)) { + $this->log .= '    cancel resizing, as it would enlarge the image!
    '; + $this->image_dst_x = $this->image_src_x; + $this->image_dst_y = $this->image_src_y; + $ratio_crop = null; + } + + // make sure we don't shrink the image if we don't want to + if ($this->image_no_shrinking && ($this->image_src_x > $this->image_dst_x || $this->image_src_y > $this->image_dst_y)) { + $this->log .= '    cancel resizing, as it would shrink the image!
    '; + $this->image_dst_x = $this->image_src_x; + $this->image_dst_y = $this->image_src_y; + $ratio_crop = null; + } + + // resize the image + if ($this->image_dst_x != $this->image_src_x || $this->image_dst_y != $this->image_src_y) { + $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y); + + if ($gd_version >= 2) { + $res = imagecopyresampled($tmp, $image_src, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y, $this->image_src_x, $this->image_src_y); + } else { + $res = imagecopyresized($tmp, $image_src, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y, $this->image_src_x, $this->image_src_y); + } + + $this->log .= '    resized image object created
    '; + // we transfert tmp into image_dst + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + + } else { + $this->image_dst_x = $this->image_src_x; + $this->image_dst_y = $this->image_src_y; + } + + // crop image (and also crops if image_ratio_crop is used) + if ((!empty($this->image_crop) || !is_null($ratio_crop))) { + list($ct, $cr, $cb, $cl) = $this->getoffsets($this->image_crop, $this->image_dst_x, $this->image_dst_y, true, true); + // we adjust the cropping if we use image_ratio_crop + if (!is_null($ratio_crop)) { + if (array_key_exists('t', $ratio_crop)) $ct += $ratio_crop['t']; + if (array_key_exists('r', $ratio_crop)) $cr += $ratio_crop['r']; + if (array_key_exists('b', $ratio_crop)) $cb += $ratio_crop['b']; + if (array_key_exists('l', $ratio_crop)) $cl += $ratio_crop['l']; + } + if ($ct != 0 || $cr != 0 || $cb != 0 || $cl != 0) { + $this->log .= '- crop image : ' . $ct . ' ' . $cr . ' ' . $cb . ' ' . $cl . '
    '; + $this->image_dst_x = $this->image_dst_x - $cl - $cr; + $this->image_dst_y = $this->image_dst_y - $ct - $cb; + if ($this->image_dst_x < 1) $this->image_dst_x = 1; + if ($this->image_dst_y < 1) $this->image_dst_y = 1; + $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y); + + // we copy the image into the recieving image + imagecopy($tmp, $image_dst, 0, 0, $cl, $ct, $this->image_dst_x, $this->image_dst_y); + + // if we crop with negative margins, we have to make sure the extra bits are the right color, or transparent + if ($ct < 0 || $cr < 0 || $cb < 0 || $cl < 0 ) { + // use the background color if present + if (!empty($this->image_background_color)) { + list($red, $green, $blue) = $this->getcolors($this->image_background_color); + $fill = imagecolorallocate($tmp, $red, $green, $blue); + } else { + $fill = imagecolorallocatealpha($tmp, 0, 0, 0, 127); + } + // fills eventual negative margins + if ($ct < 0) imagefilledrectangle($tmp, 0, 0, $this->image_dst_x, -$ct-1, $fill); + if ($cr < 0) imagefilledrectangle($tmp, $this->image_dst_x + $cr, 0, $this->image_dst_x, $this->image_dst_y, $fill); + if ($cb < 0) imagefilledrectangle($tmp, 0, $this->image_dst_y + $cb, $this->image_dst_x, $this->image_dst_y, $fill); + if ($cl < 0) imagefilledrectangle($tmp, 0, 0, -$cl-1, $this->image_dst_y, $fill); + } + + // we transfert tmp into image_dst + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + } + + // flip image + if ($gd_version >= 2 && !empty($this->image_flip)) { + $this->image_flip = strtolower($this->image_flip); + $this->log .= '- flip image : ' . $this->image_flip . '
    '; + $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y); + for ($x = 0; $x < $this->image_dst_x; $x++) { + for ($y = 0; $y < $this->image_dst_y; $y++){ + if (strpos($this->image_flip, 'v') !== false) { + imagecopy($tmp, $image_dst, $this->image_dst_x - $x - 1, $y, $x, $y, 1, 1); + } else { + imagecopy($tmp, $image_dst, $x, $this->image_dst_y - $y - 1, $x, $y, 1, 1); + } + } + } + // we transfert tmp into image_dst + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + + // rotate image + if ($gd_version >= 2 && is_numeric($this->image_rotate)) { + if (!in_array($this->image_rotate, array(0, 90, 180, 270))) $this->image_rotate = 0; + if ($this->image_rotate != 0) { + if ($this->image_rotate == 90 || $this->image_rotate == 270) { + $tmp = $this->imagecreatenew($this->image_dst_y, $this->image_dst_x); + } else { + $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y); + } + $this->log .= '- rotate image : ' . $this->image_rotate . '
    '; + for ($x = 0; $x < $this->image_dst_x; $x++) { + for ($y = 0; $y < $this->image_dst_y; $y++){ + if ($this->image_rotate == 90) { + imagecopy($tmp, $image_dst, $y, $x, $x, $this->image_dst_y - $y - 1, 1, 1); + } else if ($this->image_rotate == 180) { + imagecopy($tmp, $image_dst, $x, $y, $this->image_dst_x - $x - 1, $this->image_dst_y - $y - 1, 1, 1); + } else if ($this->image_rotate == 270) { + imagecopy($tmp, $image_dst, $y, $x, $this->image_dst_x - $x - 1, $y, 1, 1); + } else { + imagecopy($tmp, $image_dst, $x, $y, $x, $y, 1, 1); + } + } + } + if ($this->image_rotate == 90 || $this->image_rotate == 270) { + $t = $this->image_dst_y; + $this->image_dst_y = $this->image_dst_x; + $this->image_dst_x = $t; + } + // we transfert tmp into image_dst + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + } + + // pixelate image + if ((is_numeric($this->image_pixelate) && $this->image_pixelate > 0)) { + $this->log .= '- pixelate image (' . $this->image_pixelate . 'px)
    '; + $filter = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y); + if ($gd_version >= 2) { + imagecopyresampled($filter, $image_dst, 0, 0, 0, 0, round($this->image_dst_x / $this->image_pixelate), round($this->image_dst_y / $this->image_pixelate), $this->image_dst_x, $this->image_dst_y); + imagecopyresampled($image_dst, $filter, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y, round($this->image_dst_x / $this->image_pixelate), round($this->image_dst_y / $this->image_pixelate)); + } else { + imagecopyresized($filter, $image_dst, 0, 0, 0, 0, round($this->image_dst_x / $this->image_pixelate), round($this->image_dst_y / $this->image_pixelate), $this->image_dst_x, $this->image_dst_y); + imagecopyresized($image_dst, $filter, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y, round($this->image_dst_x / $this->image_pixelate), round($this->image_dst_y / $this->image_pixelate)); + } + imagedestroy($filter); + } + + // unsharp mask + if ($gd_version >= 2 && $this->image_unsharp && is_numeric($this->image_unsharp_amount) && is_numeric($this->image_unsharp_radius) && is_numeric($this->image_unsharp_threshold)) { + // Unsharp Mask for PHP - version 2.1.1 + // Unsharp mask algorithm by Torstein Hønsi 2003-07. + // Used with permission + // Modified to support alpha transparency + if ($this->image_unsharp_amount > 500) $this->image_unsharp_amount = 500; + $this->image_unsharp_amount = $this->image_unsharp_amount * 0.016; + if ($this->image_unsharp_radius > 50) $this->image_unsharp_radius = 50; + $this->image_unsharp_radius = $this->image_unsharp_radius * 2; + if ($this->image_unsharp_threshold > 255) $this->image_unsharp_threshold = 255; + $this->image_unsharp_radius = abs(round($this->image_unsharp_radius)); + if ($this->image_unsharp_radius != 0) { + $this->image_dst_x = imagesx($image_dst); $this->image_dst_y = imagesy($image_dst); + $canvas = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y, false, true); + $blur = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y, false, true); + if ($this->function_enabled('imageconvolution')) { // PHP >= 5.1 + $matrix = array(array( 1, 2, 1 ), array( 2, 4, 2 ), array( 1, 2, 1 )); + imagecopy($blur, $image_dst, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y); + imageconvolution($blur, $matrix, 16, 0); + } else { + for ($i = 0; $i < $this->image_unsharp_radius; $i++) { + imagecopy($blur, $image_dst, 0, 0, 1, 0, $this->image_dst_x - 1, $this->image_dst_y); // left + $this->imagecopymergealpha($blur, $image_dst, 1, 0, 0, 0, $this->image_dst_x, $this->image_dst_y, 50); // right + $this->imagecopymergealpha($blur, $image_dst, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y, 50); // center + imagecopy($canvas, $blur, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y); + $this->imagecopymergealpha($blur, $canvas, 0, 0, 0, 1, $this->image_dst_x, $this->image_dst_y - 1, 33.33333 ); // up + $this->imagecopymergealpha($blur, $canvas, 0, 1, 0, 0, $this->image_dst_x, $this->image_dst_y, 25); // down + } + } + $p_new = array(); + if($this->image_unsharp_threshold>0) { + for ($x = 0; $x < $this->image_dst_x-1; $x++) { + for ($y = 0; $y < $this->image_dst_y; $y++) { + $p_orig = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $p_blur = imagecolorsforindex($blur, imagecolorat($blur, $x, $y)); + $p_new['red'] = (abs($p_orig['red'] - $p_blur['red']) >= $this->image_unsharp_threshold) ? max(0, min(255, ($this->image_unsharp_amount * ($p_orig['red'] - $p_blur['red'])) + $p_orig['red'])) : $p_orig['red']; + $p_new['green'] = (abs($p_orig['green'] - $p_blur['green']) >= $this->image_unsharp_threshold) ? max(0, min(255, ($this->image_unsharp_amount * ($p_orig['green'] - $p_blur['green'])) + $p_orig['green'])) : $p_orig['green']; + $p_new['blue'] = (abs($p_orig['blue'] - $p_blur['blue']) >= $this->image_unsharp_threshold) ? max(0, min(255, ($this->image_unsharp_amount * ($p_orig['blue'] - $p_blur['blue'])) + $p_orig['blue'])) : $p_orig['blue']; + if (($p_orig['red'] != $p_new['red']) || ($p_orig['green'] != $p_new['green']) || ($p_orig['blue'] != $p_new['blue'])) { + $color = imagecolorallocatealpha($image_dst, $p_new['red'], $p_new['green'], $p_new['blue'], $p_orig['alpha']); + imagesetpixel($image_dst, $x, $y, $color); + } + } + } + } else { + for ($x = 0; $x < $this->image_dst_x; $x++) { + for ($y = 0; $y < $this->image_dst_y; $y++) { + $p_orig = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $p_blur = imagecolorsforindex($blur, imagecolorat($blur, $x, $y)); + $p_new['red'] = ($this->image_unsharp_amount * ($p_orig['red'] - $p_blur['red'])) + $p_orig['red']; + if ($p_new['red']>255) { $p_new['red']=255; } elseif ($p_new['red']<0) { $p_new['red']=0; } + $p_new['green'] = ($this->image_unsharp_amount * ($p_orig['green'] - $p_blur['green'])) + $p_orig['green']; + if ($p_new['green']>255) { $p_new['green']=255; } elseif ($p_new['green']<0) { $p_new['green']=0; } + $p_new['blue'] = ($this->image_unsharp_amount * ($p_orig['blue'] - $p_blur['blue'])) + $p_orig['blue']; + if ($p_new['blue']>255) { $p_new['blue']=255; } elseif ($p_new['blue']<0) { $p_new['blue']=0; } + $color = imagecolorallocatealpha($image_dst, $p_new['red'], $p_new['green'], $p_new['blue'], $p_orig['alpha']); + imagesetpixel($image_dst, $x, $y, $color); + } + } + } + imagedestroy($canvas); + imagedestroy($blur); + } + } + + // add color overlay + if ($gd_version >= 2 && (is_numeric($this->image_overlay_opacity) && $this->image_overlay_opacity > 0 && !empty($this->image_overlay_color))) { + $this->log .= '- apply color overlay
    '; + list($red, $green, $blue) = $this->getcolors($this->image_overlay_color); + $filter = imagecreatetruecolor($this->image_dst_x, $this->image_dst_y); + $color = imagecolorallocate($filter, $red, $green, $blue); + imagefilledrectangle($filter, 0, 0, $this->image_dst_x, $this->image_dst_y, $color); + $this->imagecopymergealpha($image_dst, $filter, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y, $this->image_overlay_opacity); + imagedestroy($filter); + } + + // add brightness, contrast and tint, turns to greyscale and inverts colors + if ($gd_version >= 2 && ($this->image_negative || $this->image_greyscale || is_numeric($this->image_threshold)|| is_numeric($this->image_brightness) || is_numeric($this->image_contrast) || !empty($this->image_tint_color))) { + $this->log .= '- apply tint, light, contrast correction, negative, greyscale and threshold
    '; + if (!empty($this->image_tint_color)) list($tint_red, $tint_green, $tint_blue) = $this->getcolors($this->image_tint_color); + //imagealphablending($image_dst, true); + for($y=0; $y < $this->image_dst_y; $y++) { + for($x=0; $x < $this->image_dst_x; $x++) { + if ($this->image_greyscale) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $r = $g = $b = round((0.2125 * $pixel['red']) + (0.7154 * $pixel['green']) + (0.0721 * $pixel['blue'])); + $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']); + imagesetpixel($image_dst, $x, $y, $color); + unset($color); unset($pixel); + } + if (is_numeric($this->image_threshold)) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $c = (round($pixel['red'] + $pixel['green'] + $pixel['blue']) / 3) - 127; + $r = $g = $b = ($c > $this->image_threshold ? 255 : 0); + $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']); + imagesetpixel($image_dst, $x, $y, $color); + unset($color); unset($pixel); + } + if (is_numeric($this->image_brightness)) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $r = max(min(round($pixel['red'] + (($this->image_brightness * 2))), 255), 0); + $g = max(min(round($pixel['green'] + (($this->image_brightness * 2))), 255), 0); + $b = max(min(round($pixel['blue'] + (($this->image_brightness * 2))), 255), 0); + $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']); + imagesetpixel($image_dst, $x, $y, $color); + unset($color); unset($pixel); + } + if (is_numeric($this->image_contrast)) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $r = max(min(round(($this->image_contrast + 128) * $pixel['red'] / 128), 255), 0); + $g = max(min(round(($this->image_contrast + 128) * $pixel['green'] / 128), 255), 0); + $b = max(min(round(($this->image_contrast + 128) * $pixel['blue'] / 128), 255), 0); + $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']); + imagesetpixel($image_dst, $x, $y, $color); + unset($color); unset($pixel); + } + if (!empty($this->image_tint_color)) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $r = min(round($tint_red * $pixel['red'] / 169), 255); + $g = min(round($tint_green * $pixel['green'] / 169), 255); + $b = min(round($tint_blue * $pixel['blue'] / 169), 255); + $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']); + imagesetpixel($image_dst, $x, $y, $color); + unset($color); unset($pixel); + } + if (!empty($this->image_negative)) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $r = round(255 - $pixel['red']); + $g = round(255 - $pixel['green']); + $b = round(255 - $pixel['blue']); + $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']); + imagesetpixel($image_dst, $x, $y, $color); + unset($color); unset($pixel); + } + } + } + } + + // adds a border + if ($gd_version >= 2 && !empty($this->image_border)) { + list($ct, $cr, $cb, $cl) = $this->getoffsets($this->image_border, $this->image_dst_x, $this->image_dst_y, true, false); + $this->log .= '- add border : ' . $ct . ' ' . $cr . ' ' . $cb . ' ' . $cl . '
    '; + $this->image_dst_x = $this->image_dst_x + $cl + $cr; + $this->image_dst_y = $this->image_dst_y + $ct + $cb; + if (!empty($this->image_border_color)) list($red, $green, $blue) = $this->getcolors($this->image_border_color); + $opacity = (is_numeric($this->image_border_opacity) ? (int) (127 - $this->image_border_opacity / 100 * 127): 0); + // we now create an image, that we fill with the border color + $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y); + $background = imagecolorallocatealpha($tmp, $red, $green, $blue, $opacity); + imagefilledrectangle($tmp, 0, 0, $this->image_dst_x, $this->image_dst_y, $background); + // we then copy the source image into the new image, without merging so that only the border is actually kept + imagecopy($tmp, $image_dst, $cl, $ct, 0, 0, $this->image_dst_x - $cr - $cl, $this->image_dst_y - $cb - $ct); + // we transfert tmp into image_dst + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + + // adds a fading-to-transparent border + if ($gd_version >= 2 && !empty($this->image_border_transparent)) { + list($ct, $cr, $cb, $cl) = $this->getoffsets($this->image_border_transparent, $this->image_dst_x, $this->image_dst_y, true, false); + $this->log .= '- add transparent border : ' . $ct . ' ' . $cr . ' ' . $cb . ' ' . $cl . '
    '; + // we now create an image, that we fill with the border color + $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y); + // we then copy the source image into the new image, without the borders + imagecopy($tmp, $image_dst, $cl, $ct, $cl, $ct, $this->image_dst_x - $cr - $cl, $this->image_dst_y - $cb - $ct); + // we now add the top border + $opacity = 100; + for ($y = $ct - 1; $y >= 0; $y--) { + $il = (int) ($ct > 0 ? ($cl * ($y / $ct)) : 0); + $ir = (int) ($ct > 0 ? ($cr * ($y / $ct)) : 0); + for ($x = $il; $x < $this->image_dst_x - $ir; $x++) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $alpha = (1 - ($pixel['alpha'] / 127)) * $opacity / 100; + if ($alpha > 0) { + if ($alpha > 1) $alpha = 1; + $color = imagecolorallocatealpha($tmp, $pixel['red'] , $pixel['green'], $pixel['blue'], round((1 - $alpha) * 127)); + imagesetpixel($tmp, $x, $y, $color); + } + } + if ($opacity > 0) $opacity = $opacity - (100 / $ct); + } + // we now add the right border + $opacity = 100; + for ($x = $this->image_dst_x - $cr; $x < $this->image_dst_x; $x++) { + $it = (int) ($cr > 0 ? ($ct * (($this->image_dst_x - $x - 1) / $cr)) : 0); + $ib = (int) ($cr > 0 ? ($cb * (($this->image_dst_x - $x - 1) / $cr)) : 0); + for ($y = $it; $y < $this->image_dst_y - $ib; $y++) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $alpha = (1 - ($pixel['alpha'] / 127)) * $opacity / 100; + if ($alpha > 0) { + if ($alpha > 1) $alpha = 1; + $color = imagecolorallocatealpha($tmp, $pixel['red'] , $pixel['green'], $pixel['blue'], round((1 - $alpha) * 127)); + imagesetpixel($tmp, $x, $y, $color); + } + } + if ($opacity > 0) $opacity = $opacity - (100 / $cr); + } + // we now add the bottom border + $opacity = 100; + for ($y = $this->image_dst_y - $cb; $y < $this->image_dst_y; $y++) { + $il = (int) ($cb > 0 ? ($cl * (($this->image_dst_y - $y - 1) / $cb)) : 0); + $ir = (int) ($cb > 0 ? ($cr * (($this->image_dst_y - $y - 1) / $cb)) : 0); + for ($x = $il; $x < $this->image_dst_x - $ir; $x++) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $alpha = (1 - ($pixel['alpha'] / 127)) * $opacity / 100; + if ($alpha > 0) { + if ($alpha > 1) $alpha = 1; + $color = imagecolorallocatealpha($tmp, $pixel['red'] , $pixel['green'], $pixel['blue'], round((1 - $alpha) * 127)); + imagesetpixel($tmp, $x, $y, $color); + } + } + if ($opacity > 0) $opacity = $opacity - (100 / $cb); + } + // we now add the left border + $opacity = 100; + for ($x = $cl - 1; $x >= 0; $x--) { + $it = (int) ($cl > 0 ? ($ct * ($x / $cl)) : 0); + $ib = (int) ($cl > 0 ? ($cb * ($x / $cl)) : 0); + for ($y = $it; $y < $this->image_dst_y - $ib; $y++) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $alpha = (1 - ($pixel['alpha'] / 127)) * $opacity / 100; + if ($alpha > 0) { + if ($alpha > 1) $alpha = 1; + $color = imagecolorallocatealpha($tmp, $pixel['red'] , $pixel['green'], $pixel['blue'], round((1 - $alpha) * 127)); + imagesetpixel($tmp, $x, $y, $color); + } + } + if ($opacity > 0) $opacity = $opacity - (100 / $cl); + } + // we transfert tmp into image_dst + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + + // add frame border + if ($gd_version >= 2 && is_numeric($this->image_frame)) { + if (is_array($this->image_frame_colors)) { + $vars = $this->image_frame_colors; + $this->log .= '- add frame : ' . implode(' ', $this->image_frame_colors) . '
    '; + } else { + $this->log .= '- add frame : ' . $this->image_frame_colors . '
    '; + $vars = explode(' ', $this->image_frame_colors); + } + $nb = sizeof($vars); + $this->image_dst_x = $this->image_dst_x + ($nb * 2); + $this->image_dst_y = $this->image_dst_y + ($nb * 2); + $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y); + imagecopy($tmp, $image_dst, $nb, $nb, 0, 0, $this->image_dst_x - ($nb * 2), $this->image_dst_y - ($nb * 2)); + $opacity = (is_numeric($this->image_frame_opacity) ? (int) (127 - $this->image_frame_opacity / 100 * 127): 0); + for ($i=0; $i<$nb; $i++) { + list($red, $green, $blue) = $this->getcolors($vars[$i]); + $c = imagecolorallocatealpha($tmp, $red, $green, $blue, $opacity); + if ($this->image_frame == 1) { + imageline($tmp, $i, $i, $this->image_dst_x - $i -1, $i, $c); + imageline($tmp, $this->image_dst_x - $i -1, $this->image_dst_y - $i -1, $this->image_dst_x - $i -1, $i, $c); + imageline($tmp, $this->image_dst_x - $i -1, $this->image_dst_y - $i -1, $i, $this->image_dst_y - $i -1, $c); + imageline($tmp, $i, $i, $i, $this->image_dst_y - $i -1, $c); + } else { + imageline($tmp, $i, $i, $this->image_dst_x - $i -1, $i, $c); + imageline($tmp, $this->image_dst_x - $nb + $i, $this->image_dst_y - $nb + $i, $this->image_dst_x - $nb + $i, $nb - $i, $c); + imageline($tmp, $this->image_dst_x - $nb + $i, $this->image_dst_y - $nb + $i, $nb - $i, $this->image_dst_y - $nb + $i, $c); + imageline($tmp, $i, $i, $i, $this->image_dst_y - $i -1, $c); + } + } + // we transfert tmp into image_dst + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + + // add bevel border + if ($gd_version >= 2 && $this->image_bevel > 0) { + if (empty($this->image_bevel_color1)) $this->image_bevel_color1 = '#FFFFFF'; + if (empty($this->image_bevel_color2)) $this->image_bevel_color2 = '#000000'; + list($red1, $green1, $blue1) = $this->getcolors($this->image_bevel_color1); + list($red2, $green2, $blue2) = $this->getcolors($this->image_bevel_color2); + $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y); + imagecopy($tmp, $image_dst, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y); + imagealphablending($tmp, true); + for ($i=0; $i<$this->image_bevel; $i++) { + $alpha = round(($i / $this->image_bevel) * 127); + $c1 = imagecolorallocatealpha($tmp, $red1, $green1, $blue1, $alpha); + $c2 = imagecolorallocatealpha($tmp, $red2, $green2, $blue2, $alpha); + imageline($tmp, $i, $i, $this->image_dst_x - $i -1, $i, $c1); + imageline($tmp, $this->image_dst_x - $i -1, $this->image_dst_y - $i, $this->image_dst_x - $i -1, $i, $c2); + imageline($tmp, $this->image_dst_x - $i -1, $this->image_dst_y - $i -1, $i, $this->image_dst_y - $i -1, $c2); + imageline($tmp, $i, $i, $i, $this->image_dst_y - $i -1, $c1); + } + // we transfert tmp into image_dst + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + + // add watermark image + if ($this->image_watermark!='' && file_exists($this->image_watermark)) { + $this->log .= '- add watermark
    '; + $this->image_watermark_position = strtolower($this->image_watermark_position); + $watermark_info = getimagesize($this->image_watermark); + $watermark_type = (array_key_exists(2, $watermark_info) ? $watermark_info[2] : null); // 1 = GIF, 2 = JPG, 3 = PNG + $watermark_checked = false; + if ($watermark_type == IMAGETYPE_GIF) { + if (!$this->function_enabled('imagecreatefromgif')) { + $this->error = $this->translate('watermark_no_create_support', array('GIF')); + } else { + $filter = @imagecreatefromgif($this->image_watermark); + if (!$filter) { + $this->error = $this->translate('watermark_create_error', array('GIF')); + } else { + $this->log .= '    watermark source image is GIF
    '; + $watermark_checked = true; + } + } + } else if ($watermark_type == IMAGETYPE_JPEG) { + if (!$this->function_enabled('imagecreatefromjpeg')) { + $this->error = $this->translate('watermark_no_create_support', array('JPEG')); + } else { + $filter = @imagecreatefromjpeg($this->image_watermark); + if (!$filter) { + $this->error = $this->translate('watermark_create_error', array('JPEG')); + } else { + $this->log .= '    watermark source image is JPEG
    '; + $watermark_checked = true; + } + } + } else if ($watermark_type == IMAGETYPE_PNG) { + if (!$this->function_enabled('imagecreatefrompng')) { + $this->error = $this->translate('watermark_no_create_support', array('PNG')); + } else { + $filter = @imagecreatefrompng($this->image_watermark); + if (!$filter) { + $this->error = $this->translate('watermark_create_error', array('PNG')); + } else { + $this->log .= '    watermark source image is PNG
    '; + $watermark_checked = true; + } + } + } else if ($watermark_type == IMAGETYPE_WEBP) { + if (!$this->function_enabled('imagecreatefromwebp')) { + $this->error = $this->translate('watermark_no_create_support', array('WEBP')); + } else { + $filter = @imagecreatefromwebp($this->image_watermark); + if (!$filter) { + $this->error = $this->translate('watermark_create_error', array('WEBP')); + } else { + $this->log .= '    watermark source image is WEBP
    '; + $watermark_checked = true; + } + } + } else if ($watermark_type == IMAGETYPE_BMP) { + if (!method_exists($this, 'imagecreatefrombmp')) { + $this->error = $this->translate('watermark_no_create_support', array('BMP')); + } else { + $filter = @$this->imagecreatefrombmp($this->image_watermark); + if (!$filter) { + $this->error = $this->translate('watermark_create_error', array('BMP')); + } else { + $this->log .= '    watermark source image is BMP
    '; + $watermark_checked = true; + } + } + } else { + $this->error = $this->translate('watermark_invalid'); + } + if ($watermark_checked) { + $watermark_dst_width = $watermark_src_width = imagesx($filter); + $watermark_dst_height = $watermark_src_height = imagesy($filter); + + // if watermark is too large/tall, resize it first + if ((!$this->image_watermark_no_zoom_out && ($watermark_dst_width > $this->image_dst_x || $watermark_dst_height > $this->image_dst_y)) + || (!$this->image_watermark_no_zoom_in && $watermark_dst_width < $this->image_dst_x && $watermark_dst_height < $this->image_dst_y)) { + $canvas_width = $this->image_dst_x - abs($this->image_watermark_x); + $canvas_height = $this->image_dst_y - abs($this->image_watermark_y); + if (($watermark_src_width/$canvas_width) > ($watermark_src_height/$canvas_height)) { + $watermark_dst_width = $canvas_width; + $watermark_dst_height = intval($watermark_src_height*($canvas_width / $watermark_src_width)); + } else { + $watermark_dst_height = $canvas_height; + $watermark_dst_width = intval($watermark_src_width*($canvas_height / $watermark_src_height)); + } + $this->log .= '    watermark resized from '.$watermark_src_width.'x'.$watermark_src_height.' to '.$watermark_dst_width.'x'.$watermark_dst_height.'
    '; + + } + // determine watermark position + $watermark_x = 0; + $watermark_y = 0; + if (is_numeric($this->image_watermark_x)) { + if ($this->image_watermark_x < 0) { + $watermark_x = $this->image_dst_x - $watermark_dst_width + $this->image_watermark_x; + } else { + $watermark_x = $this->image_watermark_x; + } + } else { + if (strpos($this->image_watermark_position, 'r') !== false) { + $watermark_x = $this->image_dst_x - $watermark_dst_width; + } else if (strpos($this->image_watermark_position, 'l') !== false) { + $watermark_x = 0; + } else { + $watermark_x = ($this->image_dst_x - $watermark_dst_width) / 2; + } + } + if (is_numeric($this->image_watermark_y)) { + if ($this->image_watermark_y < 0) { + $watermark_y = $this->image_dst_y - $watermark_dst_height + $this->image_watermark_y; + } else { + $watermark_y = $this->image_watermark_y; + } + } else { + if (strpos($this->image_watermark_position, 'b') !== false) { + $watermark_y = $this->image_dst_y - $watermark_dst_height; + } else if (strpos($this->image_watermark_position, 't') !== false) { + $watermark_y = 0; + } else { + $watermark_y = ($this->image_dst_y - $watermark_dst_height) / 2; + } + } + imagealphablending($image_dst, true); + imagecopyresampled($image_dst, $filter, $watermark_x, $watermark_y, 0, 0, $watermark_dst_width, $watermark_dst_height, $watermark_src_width, $watermark_src_height); + } else { + $this->error = $this->translate('watermark_invalid'); + } + } + + // add text + if (!empty($this->image_text)) { + $this->log .= '- add text
    '; + + // calculate sizes in human readable format + $src_size = $this->file_src_size / 1024; + $src_size_mb = number_format($src_size / 1024, 1, ".", " "); + $src_size_kb = number_format($src_size, 1, ".", " "); + $src_size_human = ($src_size > 1024 ? $src_size_mb . " MB" : $src_size_kb . " kb"); + + $this->image_text = str_replace( + array('[src_name]', + '[src_name_body]', + '[src_name_ext]', + '[src_pathname]', + '[src_mime]', + '[src_size]', + '[src_size_kb]', + '[src_size_mb]', + '[src_size_human]', + '[src_x]', + '[src_y]', + '[src_pixels]', + '[src_type]', + '[src_bits]', + '[dst_path]', + '[dst_name_body]', + '[dst_name_ext]', + '[dst_name]', + '[dst_pathname]', + '[dst_x]', + '[dst_y]', + '[date]', + '[time]', + '[host]', + '[server]', + '[ip]', + '[gd_version]'), + array($this->file_src_name, + $this->file_src_name_body, + $this->file_src_name_ext, + $this->file_src_pathname, + $this->file_src_mime, + $this->file_src_size, + $src_size_kb, + $src_size_mb, + $src_size_human, + $this->image_src_x, + $this->image_src_y, + $this->image_src_pixels, + $this->image_src_type, + $this->image_src_bits, + $this->file_dst_path, + $this->file_dst_name_body, + $this->file_dst_name_ext, + $this->file_dst_name, + $this->file_dst_pathname, + $this->image_dst_x, + $this->image_dst_y, + date('Y-m-d'), + date('H:i:s'), + (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'n/a'), + (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'n/a'), + (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'n/a'), + $this->gdversion(true)), + $this->image_text); + + if (!is_numeric($this->image_text_padding)) $this->image_text_padding = 0; + if (!is_numeric($this->image_text_line_spacing)) $this->image_text_line_spacing = 0; + if (!is_numeric($this->image_text_padding_x)) $this->image_text_padding_x = $this->image_text_padding; + if (!is_numeric($this->image_text_padding_y)) $this->image_text_padding_y = $this->image_text_padding; + $this->image_text_position = strtolower($this->image_text_position); + $this->image_text_direction = strtolower($this->image_text_direction); + $this->image_text_alignment = strtolower($this->image_text_alignment); + + $font_type = 'gd'; + + // if the font is a string with a GDF font path, we assume that we might want to load a font + if (!is_numeric($this->image_text_font) && strlen($this->image_text_font) > 4 && substr(strtolower($this->image_text_font), -4) == '.gdf') { + if (strpos($this->image_text_font, '/') === false) $this->image_text_font = "./" . $this->image_text_font; + $this->log .= '    try to load font ' . $this->image_text_font . '... '; + if ($this->image_text_font = @imageloadfont($this->image_text_font)) { + $this->log .= 'success
    '; + } else { + $this->log .= 'error
    '; + $this->image_text_font = 5; + } + } + + // if the font is a string with a TTF font path, we check if we can access the font file + if (!is_numeric($this->image_text_font) && strlen($this->image_text_font) > 4 && substr(strtolower($this->image_text_font), -4) == '.ttf') { + $this->log .= '    try to load font ' . $this->image_text_font . '... '; + if (strpos($this->image_text_font, '/') === false) $this->image_text_font = "./" . $this->image_text_font; + if (file_exists($this->image_text_font) && is_readable($this->image_text_font)) { + $this->log .= 'success
    '; + $font_type = 'tt'; + } else { + $this->log .= 'error
    '; + $this->image_text_font = 5; + } + } + + // get the text bounding box (GD fonts) + if ($font_type == 'gd') { + $text = explode("\n", $this->image_text); + $char_width = imagefontwidth($this->image_text_font); + $char_height = imagefontheight($this->image_text_font); + $text_height = 0; + $text_width = 0; + $line_height = 0; + $line_width = 0; + foreach ($text as $k => $v) { + if ($this->image_text_direction == 'v') { + $h = ($char_width * strlen($v)); + if ($h > $text_height) $text_height = $h; + $line_width = $char_height; + $text_width += $line_width + ($k < (sizeof($text)-1) ? $this->image_text_line_spacing : 0); + } else { + $w = ($char_width * strlen($v)); + if ($w > $text_width) $text_width = $w; + $line_height = $char_height; + $text_height += $line_height + ($k < (sizeof($text)-1) ? $this->image_text_line_spacing : 0); + } + } + $text_width += (2 * $this->image_text_padding_x); + $text_height += (2 * $this->image_text_padding_y); + + // get the text bounding box (TrueType fonts) + } else if ($font_type == 'tt') { + $text = $this->image_text; + if (!$this->image_text_angle) $this->image_text_angle = $this->image_text_direction == 'v' ? 90 : 0; + $text_height = 0; + $text_width = 0; + $text_offset_x = 0; + $text_offset_y = 0; + $rect = imagettfbbox($this->image_text_size, $this->image_text_angle, $this->image_text_font, $text ); + if ($rect) { + $minX = min(array($rect[0],$rect[2],$rect[4],$rect[6])); + $maxX = max(array($rect[0],$rect[2],$rect[4],$rect[6])); + $minY = min(array($rect[1],$rect[3],$rect[5],$rect[7])); + $maxY = max(array($rect[1],$rect[3],$rect[5],$rect[7])); + $text_offset_x = abs($minX) - 1; + $text_offset_y = abs($minY) - 1; + $text_width = $maxX - $minX + (2 * $this->image_text_padding_x); + $text_height = $maxY - $minY + (2 * $this->image_text_padding_y); + } + } + + // position the text block + $text_x = 0; + $text_y = 0; + if (is_numeric($this->image_text_x)) { + if ($this->image_text_x < 0) { + $text_x = $this->image_dst_x - $text_width + $this->image_text_x; + } else { + $text_x = $this->image_text_x; + } + } else { + if (strpos($this->image_text_position, 'r') !== false) { + $text_x = $this->image_dst_x - $text_width; + } else if (strpos($this->image_text_position, 'l') !== false) { + $text_x = 0; + } else { + $text_x = ($this->image_dst_x - $text_width) / 2; + } + } + if (is_numeric($this->image_text_y)) { + if ($this->image_text_y < 0) { + $text_y = $this->image_dst_y - $text_height + $this->image_text_y; + } else { + $text_y = $this->image_text_y; + } + } else { + if (strpos($this->image_text_position, 'b') !== false) { + $text_y = $this->image_dst_y - $text_height; + } else if (strpos($this->image_text_position, 't') !== false) { + $text_y = 0; + } else { + $text_y = ($this->image_dst_y - $text_height) / 2; + } + } + + // add a background, maybe transparent + if (!empty($this->image_text_background)) { + list($red, $green, $blue) = $this->getcolors($this->image_text_background); + if ($gd_version >= 2 && (is_numeric($this->image_text_background_opacity)) && $this->image_text_background_opacity >= 0 && $this->image_text_background_opacity <= 100) { + $filter = imagecreatetruecolor($text_width, $text_height); + $background_color = imagecolorallocate($filter, $red, $green, $blue); + imagefilledrectangle($filter, 0, 0, $text_width, $text_height, $background_color); + $this->imagecopymergealpha($image_dst, $filter, $text_x, $text_y, 0, 0, $text_width, $text_height, $this->image_text_background_opacity); + imagedestroy($filter); + } else { + $background_color = imagecolorallocate($image_dst ,$red, $green, $blue); + imagefilledrectangle($image_dst, $text_x, $text_y, $text_x + $text_width, $text_y + $text_height, $background_color); + } + } + + $text_x += $this->image_text_padding_x; + $text_y += $this->image_text_padding_y; + $t_width = $text_width - (2 * $this->image_text_padding_x); + $t_height = $text_height - (2 * $this->image_text_padding_y); + list($red, $green, $blue) = $this->getcolors($this->image_text_color); + + // add the text, maybe transparent + if ($gd_version >= 2 && (is_numeric($this->image_text_opacity)) && $this->image_text_opacity >= 0 && $this->image_text_opacity <= 100) { + if ($t_width < 0) $t_width = 0; + if ($t_height < 0) $t_height = 0; + $filter = $this->imagecreatenew($t_width, $t_height, false, true); + $text_color = imagecolorallocate($filter ,$red, $green, $blue); + + if ($font_type == 'gd') { + foreach ($text as $k => $v) { + if ($this->image_text_direction == 'v') { + imagestringup($filter, + $this->image_text_font, + $k * ($line_width + ($k > 0 && $k < (sizeof($text)) ? $this->image_text_line_spacing : 0)), + $text_height - (2 * $this->image_text_padding_y) - ($this->image_text_alignment == 'l' ? 0 : (($t_height - strlen($v) * $char_width) / ($this->image_text_alignment == 'r' ? 1 : 2))) , + $v, + $text_color); + } else { + imagestring($filter, + $this->image_text_font, + ($this->image_text_alignment == 'l' ? 0 : (($t_width - strlen($v) * $char_width) / ($this->image_text_alignment == 'r' ? 1 : 2))), + $k * ($line_height + ($k > 0 && $k < (sizeof($text)) ? $this->image_text_line_spacing : 0)), + $v, + $text_color); + } + } + } else if ($font_type == 'tt') { + imagettftext($filter, + $this->image_text_size, + $this->image_text_angle, + $text_offset_x, + $text_offset_y, + $text_color, + $this->image_text_font, + $text); + } + $this->imagecopymergealpha($image_dst, $filter, $text_x, $text_y, 0, 0, $t_width, $t_height, $this->image_text_opacity); + imagedestroy($filter); + + } else { + $text_color = imagecolorallocate($image_dst ,$red, $green, $blue); + if ($font_type == 'gd') { + foreach ($text as $k => $v) { + if ($this->image_text_direction == 'v') { + imagestringup($image_dst, + $this->image_text_font, + $text_x + $k * ($line_width + ($k > 0 && $k < (sizeof($text)) ? $this->image_text_line_spacing : 0)), + $text_y + $text_height - (2 * $this->image_text_padding_y) - ($this->image_text_alignment == 'l' ? 0 : (($t_height - strlen($v) * $char_width) / ($this->image_text_alignment == 'r' ? 1 : 2))), + $v, + $text_color); + } else { + imagestring($image_dst, + $this->image_text_font, + $text_x + ($this->image_text_alignment == 'l' ? 0 : (($t_width - strlen($v) * $char_width) / ($this->image_text_alignment == 'r' ? 1 : 2))), + $text_y + $k * ($line_height + ($k > 0 && $k < (sizeof($text)) ? $this->image_text_line_spacing : 0)), + $v, + $text_color); + } + } + } else if ($font_type == 'tt') { + imagettftext($image_dst, + $this->image_text_size, + $this->image_text_angle, + $text_offset_x + ($this->image_dst_x / 2) - ($text_width / 2) + $this->image_text_padding_x, + $text_offset_y + ($this->image_dst_y / 2) - ($text_height / 2) + $this->image_text_padding_y, + $text_color, + $this->image_text_font, + $text); + } + } + } + + // add a reflection + if ($this->image_reflection_height) { + $this->log .= '- add reflection : ' . $this->image_reflection_height . '
    '; + // we decode image_reflection_height, which can be a integer, a string in pixels or percentage + $image_reflection_height = $this->image_reflection_height; + if (strpos($image_reflection_height, '%')>0) $image_reflection_height = $this->image_dst_y * ((int) str_replace('%','',$image_reflection_height) / 100); + if (strpos($image_reflection_height, 'px')>0) $image_reflection_height = (int) str_replace('px','',$image_reflection_height); + $image_reflection_height = (int) $image_reflection_height; + if ($image_reflection_height > $this->image_dst_y) $image_reflection_height = $this->image_dst_y; + if (empty($this->image_reflection_opacity)) $this->image_reflection_opacity = 60; + // create the new destination image + $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y + $image_reflection_height + $this->image_reflection_space, true); + $transparency = $this->image_reflection_opacity; + + // copy the original image + imagecopy($tmp, $image_dst, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y + ($this->image_reflection_space < 0 ? $this->image_reflection_space : 0)); + + // we have to make sure the extra bit is the right color, or transparent + if ($image_reflection_height + $this->image_reflection_space > 0) { + // use the background color if present + if (!empty($this->image_background_color)) { + list($red, $green, $blue) = $this->getcolors($this->image_background_color); + $fill = imagecolorallocate($tmp, $red, $green, $blue); + } else { + $fill = imagecolorallocatealpha($tmp, 0, 0, 0, 127); + } + // fill in from the edge of the extra bit + imagefill($tmp, round($this->image_dst_x / 2), $this->image_dst_y + $image_reflection_height + $this->image_reflection_space - 1, $fill); + } + + // copy the reflection + for ($y = 0; $y < $image_reflection_height; $y++) { + for ($x = 0; $x < $this->image_dst_x; $x++) { + $pixel_b = imagecolorsforindex($tmp, imagecolorat($tmp, $x, $y + $this->image_dst_y + $this->image_reflection_space)); + $pixel_o = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $this->image_dst_y - $y - 1 + ($this->image_reflection_space < 0 ? $this->image_reflection_space : 0))); + $alpha_o = 1 - ($pixel_o['alpha'] / 127); + $alpha_b = 1 - ($pixel_b['alpha'] / 127); + $opacity = $alpha_o * $transparency / 100; + if ($opacity > 0) { + $red = round((($pixel_o['red'] * $opacity) + ($pixel_b['red'] ) * $alpha_b) / ($alpha_b + $opacity)); + $green = round((($pixel_o['green'] * $opacity) + ($pixel_b['green']) * $alpha_b) / ($alpha_b + $opacity)); + $blue = round((($pixel_o['blue'] * $opacity) + ($pixel_b['blue'] ) * $alpha_b) / ($alpha_b + $opacity)); + $alpha = ($opacity + $alpha_b); + if ($alpha > 1) $alpha = 1; + $alpha = round((1 - $alpha) * 127); + $color = imagecolorallocatealpha($tmp, $red, $green, $blue, $alpha); + imagesetpixel($tmp, $x, $y + $this->image_dst_y + $this->image_reflection_space, $color); + } + } + if ($transparency > 0) $transparency = $transparency - ($this->image_reflection_opacity / $image_reflection_height); + } + + // copy the resulting image into the destination image + $this->image_dst_y = $this->image_dst_y + $image_reflection_height + $this->image_reflection_space; + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + + // change opacity + if ($gd_version >= 2 && is_numeric($this->image_opacity) && $this->image_opacity < 100) { + $this->log .= '- change opacity
    '; + // create the new destination image + $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y, true); + for($y=0; $y < $this->image_dst_y; $y++) { + for($x=0; $x < $this->image_dst_x; $x++) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $alpha = $pixel['alpha'] + round((127 - $pixel['alpha']) * (100 - $this->image_opacity) / 100); + if ($alpha > 127) $alpha = 127; + if ($alpha > 0) { + $color = imagecolorallocatealpha($tmp, $pixel['red'] , $pixel['green'], $pixel['blue'], $alpha); + imagesetpixel($tmp, $x, $y, $color); + } + } + } + // copy the resulting image into the destination image + $image_dst = $this->imagetransfer($tmp, $image_dst); + } + + // reduce the JPEG image to a set desired size + if (is_numeric($this->jpeg_size) && $this->jpeg_size > 0 && ($this->image_convert == 'jpeg' || $this->image_convert == 'jpg')) { + // inspired by: JPEGReducer class version 1, 25 November 2004, Author: Huda M ElMatsani, justhuda at netscape dot net + $this->log .= '- JPEG desired file size : ' . $this->jpeg_size . '
    '; + // calculate size of each image. 75%, 50%, and 25% quality + ob_start(); imagejpeg($image_dst,null,75); $buffer = ob_get_contents(); ob_end_clean(); + $size75 = strlen($buffer); + ob_start(); imagejpeg($image_dst,null,50); $buffer = ob_get_contents(); ob_end_clean(); + $size50 = strlen($buffer); + ob_start(); imagejpeg($image_dst,null,25); $buffer = ob_get_contents(); ob_end_clean(); + $size25 = strlen($buffer); + + // make sure we won't divide by 0 + if ($size50 == $size25) $size50++; + if ($size75 == $size50 || $size75 == $size25) $size75++; + + // calculate gradient of size reduction by quality + $mgrad1 = 25 / ($size50-$size25); + $mgrad2 = 25 / ($size75-$size50); + $mgrad3 = 50 / ($size75-$size25); + $mgrad = ($mgrad1 + $mgrad2 + $mgrad3) / 3; + // result of approx. quality factor for expected size + $q_factor = round($mgrad * ($this->jpeg_size - $size50) + 50); + + if ($q_factor<1) { + $this->jpeg_quality=1; + } elseif ($q_factor>100) { + $this->jpeg_quality=100; + } else { + $this->jpeg_quality=$q_factor; + } + $this->log .= '    JPEG quality factor set to ' . $this->jpeg_quality . '
    '; + } + + // converts image from true color, and fix transparency if needed + $this->log .= '- converting...
    '; + $this->image_dst_type = $this->image_convert; + switch($this->image_convert) { + case 'gif': + // if the image is true color, we convert it to a palette + if (imageistruecolor($image_dst)) { + $this->log .= '    true color to palette
    '; + // creates a black and white mask + $mask = array(array()); + for ($x = 0; $x < $this->image_dst_x; $x++) { + for ($y = 0; $y < $this->image_dst_y; $y++) { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $mask[$x][$y] = $pixel['alpha']; + } + } + list($red, $green, $blue) = $this->getcolors($this->image_default_color); + // first, we merge the image with the background color, so we know which colors we will have + for ($x = 0; $x < $this->image_dst_x; $x++) { + for ($y = 0; $y < $this->image_dst_y; $y++) { + if ($mask[$x][$y] > 0){ + // we have some transparency. we combine the color with the default color + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + $alpha = ($mask[$x][$y] / 127); + $pixel['red'] = round(($pixel['red'] * (1 -$alpha) + $red * ($alpha))); + $pixel['green'] = round(($pixel['green'] * (1 -$alpha) + $green * ($alpha))); + $pixel['blue'] = round(($pixel['blue'] * (1 -$alpha) + $blue * ($alpha))); + $color = imagecolorallocate($image_dst, $pixel['red'], $pixel['green'], $pixel['blue']); + imagesetpixel($image_dst, $x, $y, $color); + } + } + } + // transforms the true color image into palette, with its merged default color + if (empty($this->image_background_color)) { + imagetruecolortopalette($image_dst, true, 255); + $transparency = imagecolorallocate($image_dst, 254, 1, 253); + imagecolortransparent($image_dst, $transparency); + // make the transparent areas transparent + for ($x = 0; $x < $this->image_dst_x; $x++) { + for ($y = 0; $y < $this->image_dst_y; $y++) { + // we test wether we have enough opacity to justify keeping the color + if ($mask[$x][$y] > 120) imagesetpixel($image_dst, $x, $y, $transparency); + } + } + } + unset($mask); + } + break; + case 'jpg': + case 'bmp': + // if the image doesn't support any transparency, then we merge it with the default color + $this->log .= '    fills in transparency with default color
    '; + list($red, $green, $blue) = $this->getcolors($this->image_default_color); + $transparency = imagecolorallocate($image_dst, $red, $green, $blue); + // make the transaparent areas transparent + for ($x = 0; $x < $this->image_dst_x; $x++) { + for ($y = 0; $y < $this->image_dst_y; $y++) { + // we test wether we have some transparency, in which case we will merge the colors + if (imageistruecolor($image_dst)) { + $rgba = imagecolorat($image_dst, $x, $y); + $pixel = array('red' => ($rgba >> 16) & 0xFF, + 'green' => ($rgba >> 8) & 0xFF, + 'blue' => $rgba & 0xFF, + 'alpha' => ($rgba & 0x7F000000) >> 24); + } else { + $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y)); + } + if ($pixel['alpha'] == 127) { + // we have full transparency. we make the pixel transparent + imagesetpixel($image_dst, $x, $y, $transparency); + } else if ($pixel['alpha'] > 0) { + // we have some transparency. we combine the color with the default color + $alpha = ($pixel['alpha'] / 127); + $pixel['red'] = round(($pixel['red'] * (1 -$alpha) + $red * ($alpha))); + $pixel['green'] = round(($pixel['green'] * (1 -$alpha) + $green * ($alpha))); + $pixel['blue'] = round(($pixel['blue'] * (1 -$alpha) + $blue * ($alpha))); + $color = imagecolorclosest($image_dst, $pixel['red'], $pixel['green'], $pixel['blue']); + imagesetpixel($image_dst, $x, $y, $color); + } + } + } + + break; + default: + break; + } + + // interlace options + if($this->image_interlace) imageinterlace($image_dst, true); + + // outputs image + $this->log .= '- saving image...
    '; + switch($this->image_convert) { + case 'jpeg': + case 'jpg': + if (!$return_mode) { + $result = @imagejpeg($image_dst, $this->file_dst_pathname, $this->jpeg_quality); + } else { + ob_start(); + $result = @imagejpeg($image_dst, null, $this->jpeg_quality); + $return_content = ob_get_contents(); + ob_end_clean(); + } + if (!$result) { + $this->processed = false; + $this->error = $this->translate('file_create', array('JPEG')); + } else { + $this->log .= '    JPEG image created
    '; + } + break; + case 'png': + imagealphablending( $image_dst, false ); + imagesavealpha( $image_dst, true ); + if (!$return_mode) { + if (is_numeric($this->png_compression) && version_compare(PHP_VERSION, '5.1.2') >= 0) { + $result = @imagepng($image_dst, $this->file_dst_pathname, $this->png_compression); + } else { + $result = @imagepng($image_dst, $this->file_dst_pathname); + } + } else { + ob_start(); + if (is_numeric($this->png_compression) && version_compare(PHP_VERSION, '5.1.2') >= 0) { + $result = @imagepng($image_dst, null, $this->png_compression); + } else { + $result = @imagepng($image_dst); + } + $return_content = ob_get_contents(); + ob_end_clean(); + } + if (!$result) { + $this->processed = false; + $this->error = $this->translate('file_create', array('PNG')); + } else { + $this->log .= '    PNG image created
    '; + } + break; + case 'webp': + imagealphablending( $image_dst, false ); + imagesavealpha( $image_dst, true ); + if (!$return_mode) { + $result = @imagewebp($image_dst, $this->file_dst_pathname, $this->webp_quality); + } else { + ob_start(); + $result = @imagewebp($image_dst, null, $this->webp_quality); + $return_content = ob_get_contents(); + ob_end_clean(); + } + if (!$result) { + $this->processed = false; + $this->error = $this->translate('file_create', array('WEBP')); + } else { + $this->log .= '    WEBP image created
    '; + } + break; + case 'gif': + if (!$return_mode) { + $result = @imagegif($image_dst, $this->file_dst_pathname); + } else { + ob_start(); + $result = @imagegif($image_dst); + $return_content = ob_get_contents(); + ob_end_clean(); + } + if (!$result) { + $this->processed = false; + $this->error = $this->translate('file_create', array('GIF')); + } else { + $this->log .= '    GIF image created
    '; + } + break; + case 'bmp': + if (!$return_mode) { + $result = $this->imagebmp($image_dst, $this->file_dst_pathname); + } else { + ob_start(); + $result = $this->imagebmp($image_dst); + $return_content = ob_get_contents(); + ob_end_clean(); + } + if (!$result) { + $this->processed = false; + $this->error = $this->translate('file_create', array('BMP')); + } else { + $this->log .= '    BMP image created
    '; + } + break; + + default: + $this->processed = false; + $this->error = $this->translate('no_conversion_type'); + } + if ($this->processed) { + if (is_resource($image_src)) imagedestroy($image_src); + if (is_resource($image_dst)) imagedestroy($image_dst); + $this->log .= '    image objects destroyed
    '; + } + } + + } else { + $this->log .= '- no image processing wanted
    '; + + if (!$return_mode) { + // copy the file to its final destination. we don't use move_uploaded_file here + // if we happen to have open_basedir restrictions, it is a temp file that we copy, not the original uploaded file + if (!copy($this->file_src_pathname, $this->file_dst_pathname)) { + $this->processed = false; + $this->error = $this->translate('copy_failed'); + } + } else { + // returns the file, so that its content can be received by the caller + $return_content = @file_get_contents($this->file_src_pathname); + if ($return_content === false) { + $this->processed = false; + $this->error = $this->translate('reading_failed'); + } + } + } + } + + if ($this->processed) { + $this->log .= '- process OK
    '; + } else { + $this->log .= '- error: ' . $this->error . '
    '; + } + + // we reinit all the vars + $this->init(); + + // we may return the image content + if ($return_mode) return $return_content; + + } + + /** + * Deletes the uploaded file from its temporary location + * + * When PHP uploads a file, it stores it in a temporary location. + * When you {@link process} the file, you actually copy the resulting file to the given location, it doesn't alter the original file. + * Once you have processed the file as many times as you wanted, you can delete the uploaded file. + * If there is open_basedir restrictions, the uploaded file is in fact a temporary file + * + * You might want not to use this function if you work on local files, as it will delete the source file + * + * @access public + */ + function clean() { + $this->log .= 'cleanup
    '; + $this->log .= '- delete temp file ' . $this->file_src_pathname . '
    '; + @unlink($this->file_src_pathname); + } + + + /** + * Opens a BMP image + * + * This function has been written by DHKold, and is used with permission of the author + * + * @access public + */ + function imagecreatefrombmp($filename) { + if (! $f1 = fopen($filename,"rb")) return false; + + $file = unpack("vfile_type/Vfile_size/Vreserved/Vbitmap_offset", fread($f1,14)); + if ($file['file_type'] != 19778) return false; + + $bmp = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel'. + '/Vcompression/Vsize_bitmap/Vhoriz_resolution'. + '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1,40)); + $bmp['colors'] = pow(2,$bmp['bits_per_pixel']); + if ($bmp['size_bitmap'] == 0) $bmp['size_bitmap'] = $file['file_size'] - $file['bitmap_offset']; + $bmp['bytes_per_pixel'] = $bmp['bits_per_pixel']/8; + $bmp['bytes_per_pixel2'] = ceil($bmp['bytes_per_pixel']); + $bmp['decal'] = ($bmp['width']*$bmp['bytes_per_pixel']/4); + $bmp['decal'] -= floor($bmp['width']*$bmp['bytes_per_pixel']/4); + $bmp['decal'] = 4-(4*$bmp['decal']); + if ($bmp['decal'] == 4) $bmp['decal'] = 0; + + $palette = array(); + if ($bmp['colors'] < 16777216) { + $palette = unpack('V'.$bmp['colors'], fread($f1,$bmp['colors']*4)); + } + + $im = fread($f1,$bmp['size_bitmap']); + $vide = chr(0); + + $res = imagecreatetruecolor($bmp['width'],$bmp['height']); + $P = 0; + $Y = $bmp['height']-1; + while ($Y >= 0) { + $X=0; + while ($X < $bmp['width']) { + if ($bmp['bits_per_pixel'] == 24) + $color = unpack("V",substr($im,$P,3).$vide); + elseif ($bmp['bits_per_pixel'] == 16) { + $color = unpack("n",substr($im,$P,2)); + $color[1] = $palette[$color[1]+1]; + } elseif ($bmp['bits_per_pixel'] == 8) { + $color = unpack("n",$vide.substr($im,$P,1)); + $color[1] = $palette[$color[1]+1]; + } elseif ($bmp['bits_per_pixel'] == 4) { + $color = unpack("n",$vide.substr($im,floor($P),1)); + if (($P*2)%2 == 0) $color[1] = ($color[1] >> 4) ; else $color[1] = ($color[1] & 0x0F); + $color[1] = $palette[$color[1]+1]; + } elseif ($bmp['bits_per_pixel'] == 1) { + $color = unpack("n",$vide.substr($im,floor($P),1)); + if (($P*8)%8 == 0) $color[1] = $color[1] >>7; + elseif (($P*8)%8 == 1) $color[1] = ($color[1] & 0x40)>>6; + elseif (($P*8)%8 == 2) $color[1] = ($color[1] & 0x20)>>5; + elseif (($P*8)%8 == 3) $color[1] = ($color[1] & 0x10)>>4; + elseif (($P*8)%8 == 4) $color[1] = ($color[1] & 0x8)>>3; + elseif (($P*8)%8 == 5) $color[1] = ($color[1] & 0x4)>>2; + elseif (($P*8)%8 == 6) $color[1] = ($color[1] & 0x2)>>1; + elseif (($P*8)%8 == 7) $color[1] = ($color[1] & 0x1); + $color[1] = $palette[$color[1]+1]; + } else + return false; + imagesetpixel($res,$X,$Y,$color[1]); + $X++; + $P += $bmp['bytes_per_pixel']; + } + $Y--; + $P+=$bmp['decal']; + } + fclose($f1); + return $res; + } + + /** + * Saves a BMP image + * + * This function has been published on the PHP website, and can be used freely + * + * @access public + */ + function imagebmp(&$im, $filename = "") { + + if (!$im) return false; + $w = imagesx($im); + $h = imagesy($im); + $result = ''; + + // if the image is not true color, we convert it first + if (!imageistruecolor($im)) { + $tmp = imagecreatetruecolor($w, $h); + imagecopy($tmp, $im, 0, 0, 0, 0, $w, $h); + imagedestroy($im); + $im = & $tmp; + } + + $biBPLine = $w * 3; + $biStride = ($biBPLine + 3) & ~3; + $biSizeImage = $biStride * $h; + $bfOffBits = 54; + $bfSize = $bfOffBits + $biSizeImage; + + $result .= substr('BM', 0, 2); + $result .= pack ('VvvV', $bfSize, 0, 0, $bfOffBits); + $result .= pack ('VVVvvVVVVVV', 40, $w, $h, 1, 24, 0, $biSizeImage, 0, 0, 0, 0); + + $numpad = $biStride - $biBPLine; + for ($y = $h - 1; $y >= 0; --$y) { + for ($x = 0; $x < $w; ++$x) { + $col = imagecolorat ($im, $x, $y); + $result .= substr(pack ('V', $col), 0, 3); + } + for ($i = 0; $i < $numpad; ++$i) + $result .= pack ('C', 0); + } + + if($filename==""){ + echo $result; + } else { + $file = fopen($filename, "wb"); + fwrite($file, $result); + fclose($file); + } + return true; + } +} + +?> diff --git a/fonts/AdobeFnt13.lst b/fonts/AdobeFnt13.lst new file mode 100644 index 0000000..c34b6f4 --- /dev/null +++ b/fonts/AdobeFnt13.lst @@ -0,0 +1,50 @@ +%!Adobe-FontList 1.13 +%Locale:0x804 + +%BeginFont +Handler:DirectoryHandler +FontType:Invalid +OutlineFileName:C:\Users\Aking-D11\Desktop\V4_11MAY2015_NewMock\Font\fontawesome-webfont.eot +FileModTime:1431309802 +%EndFont + +%BeginFont +Handler:DirectoryHandler +FontType:Type1 +FontName:FontAwesome +FamilyName:FontAwesome +StyleName:Regular +FullName:FontAwesome +MenuName:FontAwesome +StyleBits:0 +WritingScript:Roman +OutlineFileName:C:\Users\Aking-D11\Desktop\V4_11MAY2015_NewMock\Font\fontawesome-webfont.otf +DataFormat:sfntData +UsesStandardEncoding:yes +isCFF:yes +FileLength:85908 +FileModTime:1431309802 +WeightClass:400 +WidthClass:5 +AngleClass:0 +%EndFont + +%BeginFont +Handler:DirectoryHandler +FontType:TrueType +FontName:FontAwesome +FamilyName:FontAwesome +StyleName:Regular +FullName:FontAwesome Regular +MenuName:FontAwesome +StyleBits:0 +WritingScript:Roman +OutlineFileName:C:\Users\Aking-D11\Desktop\V4_11MAY2015_NewMock\Font\fontawesome-webfont.ttf +DataFormat:sfntData +FileLength:112160 +FileModTime:1431309802 +WeightClass:400 +WidthClass:5 +AngleClass:0 +%EndFont + diff --git a/fonts/FontAwesome.otf b/fonts/FontAwesome.otf new file mode 100644 index 0000000..401ec0f Binary files /dev/null and b/fonts/FontAwesome.otf differ diff --git a/fonts/fontawesome-webfont.eot b/fonts/fontawesome-webfont.eot new file mode 100644 index 0000000..e9f60ca Binary files /dev/null and b/fonts/fontawesome-webfont.eot differ diff --git a/fonts/fontawesome-webfont.otf b/fonts/fontawesome-webfont.otf new file mode 100644 index 0000000..81c9ad9 Binary files /dev/null and b/fonts/fontawesome-webfont.otf differ diff --git a/fonts/fontawesome-webfont.svg b/fonts/fontawesome-webfont.svg new file mode 100644 index 0000000..855c845 --- /dev/null +++ b/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fonts/fontawesome-webfont.ttf b/fonts/fontawesome-webfont.ttf new file mode 100644 index 0000000..35acda2 Binary files /dev/null and b/fonts/fontawesome-webfont.ttf differ diff --git a/fonts/fontawesome-webfont.woff b/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..400014a Binary files /dev/null and b/fonts/fontawesome-webfont.woff differ diff --git a/fonts/fontawesome-webfont.woff2 b/fonts/fontawesome-webfont.woff2 new file mode 100644 index 0000000..4d13fc6 Binary files /dev/null and b/fonts/fontawesome-webfont.woff2 differ diff --git a/frontend/index.php b/frontend/index.php new file mode 100644 index 0000000..eb5a623 --- /dev/null +++ b/frontend/index.php @@ -0,0 +1,329 @@ +query("SELECT user_code, user_login_cookies FROM system_user + WHERE user_name = '".$user."' AND user_trash = '0' LIMIT 1") ; + // check if username exists + if ($mysqli_user->num_rows > 0){ + // set query in variable + $row_user = $mysqli_user->fetch_array(MYSQLI_ASSOC) ; + // encode password with md5 + code + $code = $row_user['user_code'] ; + $password = md5(md5($password).$code) ; + $login_cookies = $row_user['user_login_cookies'] ; + $login_cookies = (trim($login_cookies) != '' ? $login_cookies : rand(100000,999999)) ; + if ($system_login_cookies == $login_cookies && trim($system_login_cookies) != ''){ + $query = '' ; + $boolean_status = false ; + } + // check user login + $mysqli_user = $mysqli->query("SELECT user_id, user_name, user_fullname, user_code, user_permission, user_branch, user_verification_type, user_visit_count FROM system_user + WHERE user_name = '".$user."' AND user_password = '".$password."' ".$query." AND user_trash = '0' LIMIT 1") ; + // check if username exists + if ($mysqli_user->num_rows > 0){ + // set query in variable + $row_user = $mysqli_user->fetch_array(MYSQLI_ASSOC) ; + // user id + $user_id = $row_user['user_id'] ; + $user_code = $row_user['user_code'] ; + $visit_count = $row_user['user_visit_count'] ; + $user_verification_type = $row_user['user_verification_type'] ; + $visit_count++ ; + $get_client_ip = get_client_ip() ; + $get_user_agent = userAgent($_SERVER['HTTP_USER_AGENT']) ; + // get user last login coordinates + $latitude = escapeString($_POST['latitude']) ; + $longtitude = escapeString($_POST['longtitude']) ; + + // check status + if ($boolean_status){ + $_SESSION['system_temp_user_name'] = $user ; // name + $_SESSION['system_temp_password'] = $password2 ; // password + $_SESSION['system_temp_remember'] = $remember ; // remember me + $_SESSION['system_temp_access'] = 3 ; // verification access times | 3 + $_SESSION['system_temp_bool_verify'] = $user_verification_type ; // verification boolean + + if( $user_verification_type == 'yes' ){ + // generate rand number + $rand = rand(100000,999999) ; + + // update login form + $mysqli->query( "UPDATE system_user SET + user_verification = '".$rand."', + user_verification_date = '".TODAYDATE."' + WHERE user_id = '".$user_id."'") ; + + // send verifcation code to owner + emailVerifcationCode($mysqli, system_user, COMPANY, EMAILSYSTEM, $row_user, $rand) ; + }else{ + // update login form + $mysqli->query("UPDATE system_user SET + user_login_cookies = '".$login_cookies."', + user_visit_count = '".$visit_count."', + user_last_latitude = '".$latitude."', + user_last_longtitude = '".$longtitude."', + user_last_device = '".$get_user_agent."', + user_last_ip = '".$get_client_ip."', + user_last_login = '".TODAYDATE."' + WHERE user_id = '".$user_id."'") ; + // unset temporary session + unset($_SESSION['system_temp_user_name']) ; + unset($_SESSION['system_temp_password']) ; + unset($_SESSION['system_temp_remember']) ; + unset($_SESSION['system_temp_access']) ; + unset($_SESSION['system_temp_bool_verify']) ; + // get the customer information + $_SESSION['system_id'] = $user_id ; + $_SESSION['system_name'] = $row_user['user_name'] ; + $_SESSION['system_branch'] = $row_user['user_branch'] ; + $_SESSION['system_permission'] = $row_user['user_permission'] ; + // set cookies + $expired_time = (time() + 60 * 60 * 24 * 365 * 5) ; + setcookie("system_login_cookies", $login_cookies, $expired_time, "/") ; + if ($remember){ + setcookie("system_id", $_SESSION['system_id'], $expired_time, "/") ; + setcookie("system_name", $_SESSION['system_name'], $expired_time, "/") ; + setcookie("system_branch", $_SESSION['system_branch'], $expired_time, "/") ; + setcookie("system_permission", $_SESSION['system_permission'], $expired_time, "/") ; + }else{ + $expired_time = (time() - 3600) ; + setcookie("system_id", $_SESSION['system_id'], $expired_time, "/") ; + setcookie("system_name", $_SESSION['system_name'], $expired_time, "/") ; + setcookie("system_branch", $_SESSION['system_branch'], $expired_time, "/") ; + setcookie("system_permission", $_SESSION['system_permission'], $expired_time, "/") ; + } + // redirect page + header('Location: main.php') ; + exit ; + } + }else{ + // update login form + $mysqli->query("UPDATE system_user SET + user_verification = '', + user_login_cookies = '".$login_cookies."', + user_visit_count = '".$visit_count."', + user_last_latitude = '".$latitude."', + user_last_longtitude = '".$longtitude."', + user_last_device = '".$get_user_agent."', + user_last_ip = '".$get_client_ip."', + user_last_login = '".TODAYDATE."' + WHERE user_id = '".$user_id."'") ; + // unset temporary session + unset($_SESSION['system_temp_user_name']) ; + unset($_SESSION['system_temp_password']) ; + unset($_SESSION['system_temp_remember']) ; + unset($_SESSION['system_temp_access']) ; + unset($_SESSION['system_temp_bool_verify']) ; + // get the customer information + $_SESSION['system_id'] = $user_id ; + $_SESSION['system_name'] = $row_user['user_name'] ; + $_SESSION['system_branch'] = $row_user['user_branch'] ; + $_SESSION['system_permission'] = $row_user['user_permission'] ; + // set cookies + $expired_time = (time() + 60 * 60 * 24 * 365 * 5) ; + setcookie("system_login_cookies", $login_cookies, $expired_time, "/") ; + if ($remember){ + setcookie("system_id", $_SESSION['system_id'], $expired_time, "/") ; + setcookie("system_name", $_SESSION['system_name'], $expired_time, "/") ; + setcookie("system_branch", $_SESSION['system_branch'], $expired_time, "/") ; + setcookie("system_permission", $_SESSION['system_permission'], $expired_time, "/") ; + }else{ + $expired_time = (time() - 3600) ; + setcookie("system_id", $_SESSION['system_id'], $expired_time, "/") ; + setcookie("system_name", $_SESSION['system_name'], $expired_time, "/") ; + setcookie("system_branch", $_SESSION['system_branch'], $expired_time, "/") ; + setcookie("system_permission", $_SESSION['system_permission'], $expired_time, "/") ; + } + + // redirect page + header('Location: main.php') ; + exit ; + } + }else{ + $warning_verfication = 'error_verifcation' ; + $access-- ; + if ($access == 0){ + // unset temporary session + unset($_SESSION['system_temp_user_name']) ; + unset($_SESSION['system_temp_password']) ; + unset($_SESSION['system_temp_remember']) ; + unset($_SESSION['system_temp_access']) ; + unset($_SESSION['system_temp_bool_verify']) ; + }else{ + $_SESSION['system_temp_access'] = $access-- ; + } + } + } + } +} + +// check status +if ($_SESSION['system_temp_user_name'] != '' && $_SESSION['system_temp_password'] != ''){ + if( $_SESSION['system_temp_bool_verify'] == 'yes' ){ + $boolean_verifcation = true ; + }else{ + $boolean_verifcation = false ; + } +}else{ + $boolean_verifcation = false ; +} + +// token session +$_SESSION['system_token'] = md5(uniqid()) ; + +// body onload script +$show_map_library = true ; +$show_map_script = true ; +$body_onload = true ; + +// start header here +include 'requires/page_header.php' ; + +?> +
    +
    +
    + + +
    +

    +

    +
    + '.$lang['please_get_the_verification_code_from_the_owner'].'

    + '.($warning_verfication == 'error_verifcation' ? '

    '.$lang['sorry_please_provide_a_correct_verification_code'].$lang['you_still_can_try'].$_SESSION['system_temp_access'].$lang['times'].'

    ' : '').' +
    + + +
    ' ; + }else{ + echo ' +
    + + +
    +
    + + +
    +
    + + '.$lang['remember_me'].' +
    ' ; + } + ?> + + + + + + + + +
    + +
    + $v ){ + $new_download[] = ''.$v.'' ; + } + echo implode( ' / ', $new_download ) ; + } + ?> +
    + +
    + + + +
    + +

    IPS Software Sdn. Bhd.

    +
    +
    +
    + + + \ No newline at end of file diff --git a/frontend/requires/ajax_chart.php b/frontend/requires/ajax_chart.php new file mode 100644 index 0000000..f47deed --- /dev/null +++ b/frontend/requires/ajax_chart.php @@ -0,0 +1,171 @@ + 0 ){ + + $query = "SELECT * FROM system_orgChart where chart_id = '".$place."'"; + //echo $query; + $query = $mysqli->query($query); + if ( $query ->num_rows > 0 ){ + $row = $query->fetch_array(MYSQLI_ASSOC); + $old_staff_group[1]["old"] = $row['staff_id']; + // $old_staff_group[1] = [ + // "old" => $row['staff_id'], + // "new" => $staff_id, + // ]; + } + $old_staff_group[1]["new"] = $staff_id; + + $query = "UPDATE system_orgChart set staff_id = '".$staff_id."' where chart_id = '".$place."'"; + + if (!$mysqli->query($query)){ + $result = "failed"; + }else{ + $result = "success"; + } + } + + + break; + case 'staff_update': + // array for seaching query + $staff_list = []; + + if ( $staff_id > 0 && $group_id > 0 ){ + + $old_staff_group[0] = false; + $check_group = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' LIMIT 1") ; + if ( $check_group->num_rows > 0 ){ + $row = $check_group->fetch_array(MYSQLI_ASSOC); + if ( $row['group_id'] != $group_id ){ + $old_staff_group[0] = true; + $old_staff_group[1] = [ + "old" => $row['group_id'], + "new" => $group_id, + ]; + } + + } + + $query = "UPDATE staff set group_id = '".$group_id."' where staff_id = '".$staff_id."'"; + + if (!$mysqli->query($query)){ + $result = "failed"; + }else{ + $result = "success"; + } + } + + break; + case "working_hours": + $old_staff_group[0] = false; + if ( $place > 0 && $group_id > 0 ){ + $query = "SELECT * FROM system_formula where chart_id = '".$place."' AND formula_group = '".$formula_group."'"; + //echo $query; + $query = $mysqli->query($query); + if ($query->num_rows > 0){ + $row = $query->fetch_array(MYSQLI_ASSOC); + if ( $row['group_id'] != $group_id ){ + $old_staff_group[0] = true; + $old_staff_group[1] = [ + "old" => $row['group_id'], + "new" => $group_id, + "formula" => $formula_group, + ]; + } + if (!$mysqli->query("UPDATE system_formula set group_id = '".$group_id."' where chart_id = '".$place."' AND formula_group = '".$formula_group."'")){ + $result = "failed"; + }else{ + $result = "success"; + } + }else{ + if ( $row['group_id'] != $group_id ){ + $old_staff_group[0] = true; + $old_staff_group[1] = [ + "old" => $row['group_id'], + "new" => $group_id, + "formula" => $formula_group, + + ]; + } + if (!$mysqli->query("INSERT INTO system_formula (group_id, chart_id, formula_group) VALUES ('".$group_id."', '".$place."', '".$formula_group."')")){ + $result = "failed"; + }else{ + $result = "success"; + } + } + + } + break; + + case 'update_type': + // array for seaching query + $exchange = escapeString($_POST['exchange']); + if ( $group_id > 0 ){ + + $query = "UPDATE system_orgChart set type = '".$exchange."', staff_id = '' where chart_id = '".$group_id."'"; + + if (!$mysqli->query($query)){ + $result = "failed"; + }else{ + $query = "UPDATE system_formula set group_id = '' where chart_id = '".$group_id."'"; + if (!$mysqli->query($query)){ + $result = "failed"; + }else{ + $result = "success"; + } + } + } + + break; + case 'remark_update': + // array for seaching query + $remark = escapeString($_POST['remark']); + if ( $group_id > 0 ){ + + $query = "UPDATE system_orgChart set remark = '".$remark."' where chart_id = '".$group_id."'"; + + if (!$mysqli->query($query)){ + $result = "failed"; + }else{ + $result = "success"; + } + } + + break; + default: + # code... + break; + } +} + + + +// set in array +$array['data'] = $data ; +$array['result'] = $result ; + +// echo array +echo json_encode($array); +?> \ No newline at end of file diff --git a/frontend/requires/ajax_employment_update.php b/frontend/requires/ajax_employment_update.php new file mode 100644 index 0000000..8ce0c92 --- /dev/null +++ b/frontend/requires/ajax_employment_update.php @@ -0,0 +1,69 @@ +query("SELECT * FROM staff_employment + WHERE employment_id = '".$page."' AND employment_trash = '0' LIMIT 1") ; + + if ($mysqli_page->num_rows > 0){ + + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $current_employment_status = $row_page['employment_status'] ; + + $array_update_status = array() ; + switch($current_employment_status){ + case 'Pending' : + $array_update_status = array('Pending', 'Offer', 'Reject') ; + break ; + case 'Offer' : + $array_update_status = array('Offer', 'Confirmation', 'Terminate') ; + break ; + case 'Confirmation' : + $array_update_status = array('Confirmation', 'Terminate') ; + break ; + } + + if (in_array($status, $array_update_status)) { + + switch($status){ + case 'Confirmation' : + $update_query = "employment_confirmation_date = '".TODAYDATE."'," ; + break ; + case 'Terminate' : + $update_query = "employment_terminate_date = '".TODAYDATE."'," ; + break ; + } + + if ($mysqli->query("UPDATE staff_employment SET + ".$update_query." + employment_status = '".$status."', + employment_modified = '".TODAYDATE."' + WHERE employment_id = '".$page."'")){ + + $result = true ; + + } + } + + } + + break ; + +} + +$array['result'] = $result ; +echo json_encode($array) ; + +?> \ No newline at end of file diff --git a/frontend/requires/ajax_hr_list_health.php b/frontend/requires/ajax_hr_list_health.php new file mode 100644 index 0000000..b64d984 --- /dev/null +++ b/frontend/requires/ajax_hr_list_health.php @@ -0,0 +1,41 @@ +query("SELECT * FROM staff_health + WHERE staff_id = '".$list_staff_id."' AND request_date = '".$list_date."' LIMIT 1"); + if ( $mysqli_page->num_rows == 0 ){ + $mysqli->query( "INSERT INTO staff_health + ( staff_id, request_date, created_at ) VALUES + ( '".$list_staff_id."', '".$list_date."', '".TODAYDATE."' )" ) ; + $health_id = $mysqli->insert_id ; + }else{ + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $health_id = $row_page['health_id'] ; + } + + $mysqli->query("UPDATE staff_health SET + degree = '".escapeString($_POST['list_health'])."', + updated_at = '".TODAYDATE."' + WHERE health_id = '".$health_id."'") ; + + $result = 'success' ; +} + +// set in array +$array['result'] = $result ; + +// echo array +echo json_encode($array) ; + +?> \ No newline at end of file diff --git a/frontend/requires/ajax_hr_list_update.php b/frontend/requires/ajax_hr_list_update.php new file mode 100644 index 0000000..16ca4cc --- /dev/null +++ b/frontend/requires/ajax_hr_list_update.php @@ -0,0 +1,41 @@ + 0 ? 'yes' : 'no'); + +if ( $list_id != '' ){ + $mysqli->query( "UPDATE staff_attendance_list SET + list_late = '".$list_min."', + list_amt = '".$list_amt."', + list_food = '".$list_fd."', + list_allow_food = '".$list_allow_food."', + list_type_remark = '".$list_wt."', + list_work_day = '".$list_work_day."', + list_ot_day = '".$list_ot_day."', + list_attendance_remark = '".$list_remark."' + WHERE list_id = '".$list_id."'" ) ; + + $result = 'success' ; +} + +// set in array +$array['result'] = $result ; + +// echo array +echo json_encode($array) ; + +?> \ No newline at end of file diff --git a/frontend/requires/ajax_log.php b/frontend/requires/ajax_log.php new file mode 100644 index 0000000..1bf5503 --- /dev/null +++ b/frontend/requires/ajax_log.php @@ -0,0 +1,229 @@ + $value){ + $array_family_member[] = array('name' => $_POST['family_member_name'][$value], + 'dob' => $_POST['family_member_dob'][$value], + 'occupation' => $_POST['family_member_occupation'][$value], + 'education' => $_POST['family_member_education'][$value]) ; + } +} + +// family children +$family_child_key = $_POST['family_child_key'] ; +$array_family_child = array() ; +if (arrayCheck($family_child_key)){ + foreach($family_child_key as $key => $value){ + $array_family_child[] = array('name' => $_POST['family_child_name'][$value], + 'dob' => $_POST['family_child_dob'][$value], + 'occupation' => $_POST['family_child_occupation'][$value], + 'education' => $_POST['family_child_education'][$value]) ; + } +} + +// educational level +$education_key = $_POST['education_key'] ; +$array_education = array() ; +if (arrayCheck($education_key)){ + foreach($education_key as $key => $value){ + $array_education[] = array('year' => $_POST['education_year'][$value], + 'school' => $_POST['education_name_school'][$value], + 'qualification' => $_POST['education_qualification'][$value]) ; + } +} +$education_others = escapeString($_POST['education_others']) ; + +// employment history +$employment_key = $_POST['employment_key'] ; +$array_employment = array() ; +if (arrayCheck($employment_key)){ + foreach($employment_key as $key => $value){ + $array_employment[] = array('date' => $_POST['employment_date'][$value], + 'employer' => $_POST['employment_employer'][$value], + 'contacts' => $_POST['employment_contacts'][$value], + 'salary' => $_POST['employment_salary'][$value], + 'reasons' => $_POST['employment_reasons_leaving'][$value]) ; + } +} + +// personality +$personality_language_spoken = escapeString($_POST['personality_language_spoken']) ; +$personality_language_written = escapeString($_POST['personality_language_written']) ; +$personality_own_strengths = escapeString($_POST['personality_own_strengths']) ; +$personality_own_weakness = escapeString($_POST['personality_own_weakness']) ; + +$personality_aims = escapeString($_POST['personality_aims']) ; +$personality_overtime = escapeString($_POST['personality_overtime']) ; +$personality_pressure = escapeString($_POST['personality_pressure']) ; +$personality_available_work = escapeString($_POST['personality_available_work']) ; +$personality_contract = escapeString($_POST['personality_contract']) ; +$personality_notice = escapeString($_POST['personality_notice']) ; + +// salary +$salary_last_drawn = escapeString($_POST['salary_last_drawn']) ; +$salary_expected_salary = escapeString($_POST['salary_expected_salary']) ; + +// references +$references_key = $_POST['references_key'] ; +$array_references = array() ; +if (arrayCheck($references_key)){ + foreach($references_key as $key => $value){ + $array_references[] = array('name' => $_POST['references_name'][$value], + 'position' => $_POST['references_position'][$value], + 'contacts' => $_POST['references_contracts'][$value], + 'years' => $_POST['references_years'][$value]) ; + } +} + +// aknowledgement and authorization +$acknowledgement_certify = escapeString($_POST['acknowledgement_certify']) ; +$acknowledgement_authorize = escapeString($_POST['acknowledgement_authorize']) ; +$acknowledgement_event = escapeString($_POST['acknowledgement_event']) ; + +// signature +$application_signature = escapeString($_POST['application_signature']) ; +$application_signature_date = TODAYDATE ; + +// interview by +$incharge_person = escapeString($_POST['incharge_person']) ; +$information_interview_date = escapeString($_POST['information_interview_date']) ; +$information_interview_comments = escapeString($_POST['information_interview_comments']) ; + +// status +$employment_status = escapeString($_POST['employment_status']) ; +// keep other value in array +$array_other_details = array('family' => array('background' => array('father_name' => $family_father_name, + 'father_occupation' => $family_father_occupation, + 'mother_name' => $family_mother_name, + 'mother_occupation' => $family_mother_occupation, + 'spouse_name' => $family_spouse_name, + 'spouse_occupation' => $family_spouse_occupation), + 'member' => $array_family_member, + 'child' => $array_family_child), + 'education' => array('school' => $array_education, + 'others' => $education_others), + 'employment' => $array_employment, + 'personality' => array('language_spoken' => $personality_language_spoken, + 'language_written' => $personality_language_written, + 'own_strengths' => $personality_own_strengths, + 'own_weakness' => $personality_own_weakness, + 'aims' => $personality_aims, + 'overtime' => $personality_overtime, + 'pressure' => $personality_pressure, + 'available_work' => $personality_available_work, + 'contract' => $personality_contract, + 'notice' => $personality_notice), + 'salary' => array('last_drawn' => $salary_last_drawn, + 'expected_salary' => $salary_expected_salary), + 'references' => $array_references, + 'acknowledgement' => array('certify' => $acknowledgement_certify, + 'authorize' => $acknowledgement_authorize, + 'event' => $acknowledgement_event), + 'application' => array('signature' => $application_signature, + 'date' => $application_signature_date), + 'interview' => array('date' => $information_interview_date, + 'comments' => $information_interview_comments) + ) ; +$array_other_details = jsonEncodeDecode('encode', $array_other_details) ; +$status = $_POST['status']; +$status1 = $_POST['status1']; + +$id = $_POST['id']; +$descrition = $_SESSION['system_name'].'(username) ' ; +$record = ''; +$page_id = ''; +switch ($status) { + case 'new': + switch ($status1) { + case 'not-yet': + $descrition .= 'click on application form but not submit yet'; + break; + case 'insert': + $descrition .= 'submit an new application form'; + break; + default: + $descrition .= 'click on new application form'; + break; + } + $page_id = '200'; + break; + case 'edit': + switch ($status1) { + case 'not-yet': + $descrition .= 'edit application form but not submit yet'; + break; + case 'insert': + $descrition .= 'submit an edited application form'; + break; + default: + $descrition .= 'click on edit application form'; + break; + } + $page_id = '200'; + break; + case 'unknown': + switch ($status1) { + case 'not-yet': + $descrition .= 'click on unknown application form but not submit yet'; + break; + case 'insert': + $descrition .= 'submit an unknown application form'; + break; + default: + $descrition .= 'click on unknown application form'; + break; + } + $page_id = '201'; + break; +} + +if ($mysqli->query("INSERT INTO system_log + (log_table, log_action, log_page_id, log_user_id, log_description, log_record, log_date) VALUES + ('employment', '".$status."', ".$page_id.", '".$_SESSION["system_id"]."', '".$descrition."', '".$array_other_details."', NOW())")){ + return "success"; +}else{ + return "fail"; +} + + +?> + + diff --git a/frontend/requires/ajax_login.php b/frontend/requires/ajax_login.php new file mode 100644 index 0000000..6c9da32 --- /dev/null +++ b/frontend/requires/ajax_login.php @@ -0,0 +1,27 @@ +query("UPDATE system_user SET + user_login_cookies = '' + WHERE user_id = '".$id."'") ; + $result = 'success' ; + break ; + } + $array_result['result'] = $result ; + // return result + echo json_encode($array_result) ; + exit ; +} +// redirect page +header("Location: ".PATH) ; +exit ; +?> \ No newline at end of file diff --git a/frontend/requires/ajax_rotate.php b/frontend/requires/ajax_rotate.php new file mode 100644 index 0000000..7d55c61 --- /dev/null +++ b/frontend/requires/ajax_rotate.php @@ -0,0 +1,43 @@ + '', 'medium' => 'm/', 'big' => 'b/') ; + + foreach($array_folder as $key => $value){ + + $temp_file = 'uploads/'.$folder.'/'.$value.$file ; + $filename = $_SERVER['DOCUMENT_ROOT'].'/'.$temp_file ; //this is the original file + $source = imagecreatefromjpeg($filename) or notfound() ; + $rotate = imagerotate($source, $degrees, 0) ; + + imagejpeg($rotate,$filename) ; //save the new image + imagedestroy($source) ; //free up the memory + imagedestroy($rotate) ; //free up the memory + + $array[$key] = PATH.$temp_file.'?timestamp='.time() ; + $result = 'success' ; + + } + + } + +} + +$array['result'] = $result ; +echo json_encode($array) ; +?> \ No newline at end of file diff --git a/frontend/requires/barcode.php b/frontend/requires/barcode.php new file mode 100644 index 0000000..91d2799 --- /dev/null +++ b/frontend/requires/barcode.php @@ -0,0 +1,153 @@ + + */ + +// For demonstration purposes, get pararameters that are passed in through $_GET or set to the default value +$filepath = (isset($_GET["filepath"])?$_GET["filepath"]:""); +$text = (isset($_GET["text"])?$_GET["text"]:"0"); +$size = (isset($_GET["size"])?$_GET["size"]:"20"); +$orientation = (isset($_GET["orientation"])?$_GET["orientation"]:"horizontal"); +$code_type = (isset($_GET["codetype"])?$_GET["codetype"]:"code128"); +$print = (isset($_GET["print"])&&$_GET["print"]=='true'?true:false); +$sizefactor = (isset($_GET["sizefactor"])?$_GET["sizefactor"]:"1"); + +// This function call can be copied into your project and can be made from anywhere in your code +barcode( $filepath, $text, $size, $orientation, $code_type, $print, $sizefactor ); + +function barcode( $filepath="", $text="0", $size="20", $orientation="horizontal", $code_type="code128", $print=false, $SizeFactor=1 ) { + $code_string = ""; + // Translate the $text into barcode the correct $code_type + if ( in_array(strtolower($code_type), array("code128", "code128b")) ) { + $chksum = 104; + // Must not change order of array elements as the checksum depends on the array's key to validate final code + $code_array = array(" "=>"212222","!"=>"222122","\""=>"222221","#"=>"121223","$"=>"121322","%"=>"131222","&"=>"122213","'"=>"122312","("=>"132212",")"=>"221213","*"=>"221312","+"=>"231212",","=>"112232","-"=>"122132","."=>"122231","/"=>"113222","0"=>"123122","1"=>"123221","2"=>"223211","3"=>"221132","4"=>"221231","5"=>"213212","6"=>"223112","7"=>"312131","8"=>"311222","9"=>"321122",":"=>"321221",";"=>"312212","<"=>"322112","="=>"322211",">"=>"212123","?"=>"212321","@"=>"232121","A"=>"111323","B"=>"131123","C"=>"131321","D"=>"112313","E"=>"132113","F"=>"132311","G"=>"211313","H"=>"231113","I"=>"231311","J"=>"112133","K"=>"112331","L"=>"132131","M"=>"113123","N"=>"113321","O"=>"133121","P"=>"313121","Q"=>"211331","R"=>"231131","S"=>"213113","T"=>"213311","U"=>"213131","V"=>"311123","W"=>"311321","X"=>"331121","Y"=>"312113","Z"=>"312311","["=>"332111","\\"=>"314111","]"=>"221411","^"=>"431111","_"=>"111224","\`"=>"111422","a"=>"121124","b"=>"121421","c"=>"141122","d"=>"141221","e"=>"112214","f"=>"112412","g"=>"122114","h"=>"122411","i"=>"142112","j"=>"142211","k"=>"241211","l"=>"221114","m"=>"413111","n"=>"241112","o"=>"134111","p"=>"111242","q"=>"121142","r"=>"121241","s"=>"114212","t"=>"124112","u"=>"124211","v"=>"411212","w"=>"421112","x"=>"421211","y"=>"212141","z"=>"214121","{"=>"412121","|"=>"111143","}"=>"111341","~"=>"131141","DEL"=>"114113","FNC 3"=>"114311","FNC 2"=>"411113","SHIFT"=>"411311","CODE C"=>"113141","FNC 4"=>"114131","CODE A"=>"311141","FNC 1"=>"411131","Start A"=>"211412","Start B"=>"211214","Start C"=>"211232","Stop"=>"2331112"); + $code_keys = array_keys($code_array); + $code_values = array_flip($code_keys); + for ( $X = 1; $X <= strlen($text); $X++ ) { + $activeKey = substr( $text, ($X-1), 1); + $code_string .= $code_array[$activeKey]; + $chksum=($chksum + ($code_values[$activeKey] * $X)); + } + $code_string .= $code_array[$code_keys[($chksum - (intval($chksum / 103) * 103))]]; + + $code_string = "211214" . $code_string . "2331112"; + } elseif ( strtolower($code_type) == "code128a" ) { + $chksum = 103; + $text = strtoupper($text); // Code 128A doesn't support lower case + // Must not change order of array elements as the checksum depends on the array's key to validate final code + $code_array = array(" "=>"212222","!"=>"222122","\""=>"222221","#"=>"121223","$"=>"121322","%"=>"131222","&"=>"122213","'"=>"122312","("=>"132212",")"=>"221213","*"=>"221312","+"=>"231212",","=>"112232","-"=>"122132","."=>"122231","/"=>"113222","0"=>"123122","1"=>"123221","2"=>"223211","3"=>"221132","4"=>"221231","5"=>"213212","6"=>"223112","7"=>"312131","8"=>"311222","9"=>"321122",":"=>"321221",";"=>"312212","<"=>"322112","="=>"322211",">"=>"212123","?"=>"212321","@"=>"232121","A"=>"111323","B"=>"131123","C"=>"131321","D"=>"112313","E"=>"132113","F"=>"132311","G"=>"211313","H"=>"231113","I"=>"231311","J"=>"112133","K"=>"112331","L"=>"132131","M"=>"113123","N"=>"113321","O"=>"133121","P"=>"313121","Q"=>"211331","R"=>"231131","S"=>"213113","T"=>"213311","U"=>"213131","V"=>"311123","W"=>"311321","X"=>"331121","Y"=>"312113","Z"=>"312311","["=>"332111","\\"=>"314111","]"=>"221411","^"=>"431111","_"=>"111224","NUL"=>"111422","SOH"=>"121124","STX"=>"121421","ETX"=>"141122","EOT"=>"141221","ENQ"=>"112214","ACK"=>"112412","BEL"=>"122114","BS"=>"122411","HT"=>"142112","LF"=>"142211","VT"=>"241211","FF"=>"221114","CR"=>"413111","SO"=>"241112","SI"=>"134111","DLE"=>"111242","DC1"=>"121142","DC2"=>"121241","DC3"=>"114212","DC4"=>"124112","NAK"=>"124211","SYN"=>"411212","ETB"=>"421112","CAN"=>"421211","EM"=>"212141","SUB"=>"214121","ESC"=>"412121","FS"=>"111143","GS"=>"111341","RS"=>"131141","US"=>"114113","FNC 3"=>"114311","FNC 2"=>"411113","SHIFT"=>"411311","CODE C"=>"113141","CODE B"=>"114131","FNC 4"=>"311141","FNC 1"=>"411131","Start A"=>"211412","Start B"=>"211214","Start C"=>"211232","Stop"=>"2331112"); + $code_keys = array_keys($code_array); + $code_values = array_flip($code_keys); + for ( $X = 1; $X <= strlen($text); $X++ ) { + $activeKey = substr( $text, ($X-1), 1); + $code_string .= $code_array[$activeKey]; + $chksum=($chksum + ($code_values[$activeKey] * $X)); + } + $code_string .= $code_array[$code_keys[($chksum - (intval($chksum / 103) * 103))]]; + + $code_string = "211412" . $code_string . "2331112"; + } elseif ( strtolower($code_type) == "code39" ) { + $code_array = array("0"=>"111221211","1"=>"211211112","2"=>"112211112","3"=>"212211111","4"=>"111221112","5"=>"211221111","6"=>"112221111","7"=>"111211212","8"=>"211211211","9"=>"112211211","A"=>"211112112","B"=>"112112112","C"=>"212112111","D"=>"111122112","E"=>"211122111","F"=>"112122111","G"=>"111112212","H"=>"211112211","I"=>"112112211","J"=>"111122211","K"=>"211111122","L"=>"112111122","M"=>"212111121","N"=>"111121122","O"=>"211121121","P"=>"112121121","Q"=>"111111222","R"=>"211111221","S"=>"112111221","T"=>"111121221","U"=>"221111112","V"=>"122111112","W"=>"222111111","X"=>"121121112","Y"=>"221121111","Z"=>"122121111","-"=>"121111212","."=>"221111211"," "=>"122111211","$"=>"121212111","/"=>"121211121","+"=>"121112121","%"=>"111212121","*"=>"121121211"); + + // Convert to uppercase + $upper_text = strtoupper($text); + + for ( $X = 1; $X<=strlen($upper_text); $X++ ) { + $code_string .= $code_array[substr( $upper_text, ($X-1), 1)] . "1"; + } + + $code_string = "1211212111" . $code_string . "121121211"; + } elseif ( strtolower($code_type) == "code25" ) { + $code_array1 = array("1","2","3","4","5","6","7","8","9","0"); + $code_array2 = array("3-1-1-1-3","1-3-1-1-3","3-3-1-1-1","1-1-3-1-3","3-1-3-1-1","1-3-3-1-1","1-1-1-3-3","3-1-1-3-1","1-3-1-3-1","1-1-3-3-1"); + + for ( $X = 1; $X <= strlen($text); $X++ ) { + for ( $Y = 0; $Y < count($code_array1); $Y++ ) { + if ( substr($text, ($X-1), 1) == $code_array1[$Y] ) + $temp[$X] = $code_array2[$Y]; + } + } + + for ( $X=1; $X<=strlen($text); $X+=2 ) { + if ( isset($temp[$X]) && isset($temp[($X + 1)]) ) { + $temp1 = explode( "-", $temp[$X] ); + $temp2 = explode( "-", $temp[($X + 1)] ); + for ( $Y = 0; $Y < count($temp1); $Y++ ) + $code_string .= $temp1[$Y] . $temp2[$Y]; + } + } + + $code_string = "1111" . $code_string . "311"; + } elseif ( strtolower($code_type) == "codabar" ) { + $code_array1 = array("1","2","3","4","5","6","7","8","9","0","-","$",":","/",".","+","A","B","C","D"); + $code_array2 = array("1111221","1112112","2211111","1121121","2111121","1211112","1211211","1221111","2112111","1111122","1112211","1122111","2111212","2121112","2121211","1121212","1122121","1212112","1112122","1112221"); + + // Convert to uppercase + $upper_text = strtoupper($text); + + for ( $X = 1; $X<=strlen($upper_text); $X++ ) { + for ( $Y = 0; $Y diff --git a/frontend/requires/class_resize.php b/frontend/requires/class_resize.php new file mode 100644 index 0000000..ac8b4a5 --- /dev/null +++ b/frontend/requires/class_resize.php @@ -0,0 +1,253 @@ + resizeImage(150, 100, 0); + # $resizeObj -> saveImage('images/cars/large/output.jpg', 100); + # + # + # ========================================================================# + + + Class resize + { + // *** Class variables + private $image; + private $width; + private $height; + private $imageResized; + + function __construct($fileName) + { + // *** Open up the file + $this->image = $this->openImage($fileName); + + // *** Get width and height + $this->width = imagesx($this->image); + $this->height = imagesy($this->image); + } + + ## -------------------------------------------------------- + + private function openImage($file) + { + // *** Get extension + $extension = strtolower(strrchr($file, '.')); + + switch($extension) + { + case '.jpg': + case '.jpeg': + $img = @imagecreatefromjpeg($file); + break; + case '.gif': + $img = @imagecreatefromgif($file); + break; + case '.png': + $img = @imagecreatefrompng($file); + break; + default: + $img = false; + break; + } + return $img; + } + + ## -------------------------------------------------------- + + public function resizeImage($newWidth, $newHeight, $option="auto") + { + // *** Get optimal width and height - based on $option + $optionArray = $this->getDimensions($newWidth, $newHeight, $option); + + $optimalWidth = $optionArray['optimalWidth']; + $optimalHeight = $optionArray['optimalHeight']; + + + // *** Resample - create image canvas of x, y size + $this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight); + imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height); + + + // *** if option is 'crop', then crop too + if ($option == 'crop') { + $this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight); + } + } + + ## -------------------------------------------------------- + + private function getDimensions($newWidth, $newHeight, $option) + { + + switch ($option) + { + case 'exact': + $optimalWidth = $newWidth; + $optimalHeight= $newHeight; + break; + case 'portrait': + $optimalWidth = $this->getSizeByFixedHeight($newHeight); + $optimalHeight= $newHeight; + break; + case 'landscape': + $optimalWidth = $newWidth; + $optimalHeight= $this->getSizeByFixedWidth($newWidth); + break; + case 'auto': + $optionArray = $this->getSizeByAuto($newWidth, $newHeight); + $optimalWidth = $optionArray['optimalWidth']; + $optimalHeight = $optionArray['optimalHeight']; + break; + case 'crop': + $optionArray = $this->getOptimalCrop($newWidth, $newHeight); + $optimalWidth = $optionArray['optimalWidth']; + $optimalHeight = $optionArray['optimalHeight']; + break; + } + return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight); + } + + ## -------------------------------------------------------- + + private function getSizeByFixedHeight($newHeight) + { + $ratio = $this->width / $this->height; + $newWidth = $newHeight * $ratio; + return $newWidth; + } + + private function getSizeByFixedWidth($newWidth) + { + $ratio = $this->height / $this->width; + $newHeight = $newWidth * $ratio; + return $newHeight; + } + + private function getSizeByAuto($newWidth, $newHeight) + { + if ($this->height < $this->width) + // *** Image to be resized is wider (landscape) + { + $optimalWidth = $newWidth; + $optimalHeight= $this->getSizeByFixedWidth($newWidth); + } + elseif ($this->height > $this->width) + // *** Image to be resized is taller (portrait) + { + $optimalWidth = $this->getSizeByFixedHeight($newHeight); + $optimalHeight= $newHeight; + } + else + // *** Image to be resizerd is a square + { + if ($newHeight < $newWidth) { + $optimalWidth = $newWidth; + $optimalHeight= $this->getSizeByFixedWidth($newWidth); + } else if ($newHeight > $newWidth) { + $optimalWidth = $this->getSizeByFixedHeight($newHeight); + $optimalHeight= $newHeight; + } else { + // *** Sqaure being resized to a square + $optimalWidth = $newWidth; + $optimalHeight= $newHeight; + } + } + + return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight); + } + + ## -------------------------------------------------------- + + private function getOptimalCrop($newWidth, $newHeight) + { + + $heightRatio = $this->height / $newHeight; + $widthRatio = $this->width / $newWidth; + + if ($heightRatio < $widthRatio) { + $optimalRatio = $heightRatio; + } else { + $optimalRatio = $widthRatio; + } + + $optimalHeight = $this->height / $optimalRatio; + $optimalWidth = $this->width / $optimalRatio; + + return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight); + } + + ## -------------------------------------------------------- + + private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight) + { + // *** Find center - this will be used for the crop + $cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 ); + $cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 ); + + $crop = $this->imageResized; + //imagedestroy($this->imageResized); + + // *** Now crop from center to exact requested size + $this->imageResized = imagecreatetruecolor($newWidth , $newHeight); + imagecopyresampled($this->imageResized, $crop , 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight , $newWidth, $newHeight); + } + + ## -------------------------------------------------------- + + public function saveImage($savePath, $imageQuality="100") + { + // *** Get extension + $extension = strrchr($savePath, '.'); + $extension = strtolower($extension); + + switch($extension) + { + case '.jpg': + case '.jpeg': + if (imagetypes() & IMG_JPG) { + imagejpeg($this->imageResized, $savePath, $imageQuality); + } + break; + + case '.gif': + if (imagetypes() & IMG_GIF) { + imagegif($this->imageResized, $savePath); + } + break; + + case '.png': + // *** Scale quality from 0-100 to 0-9 + $scaleQuality = round(($imageQuality/100) * 9); + + // *** Invert quality setting as 0 is best, not 9 + $invertScaleQuality = 9 - $scaleQuality; + + if (imagetypes() & IMG_PNG) { + imagepng($this->imageResized, $savePath, $invertScaleQuality); + } + break; + + // ... etc + + default: + // *** No extension - No save. + break; + } + + imagedestroy($this->imageResized); + } + + + ## -------------------------------------------------------- + + } +?> diff --git a/frontend/requires/function.php b/frontend/requires/function.php new file mode 100644 index 0000000..e148d5c --- /dev/null +++ b/frontend/requires/function.php @@ -0,0 +1,3747 @@ + 0 && !empty( $string ) && $string != '' ){ + $boolean = true ; + } + return $boolean ; +} + +function dateFilter( $type, $field, $date_from, $date_to, $year, $month, $day_from, $day_to ){ + global $mysqli ; + + $search = '' ; + $array_td = array() ; + + if( stringCheck( $type ) ){ + switch( $type ){ + case 'normally' : + if( stringCheck( $date_from ) && stringCheck( $date_to ) ){ + $search .= " AND ".$field." BETWEEN '".$date_from."' AND '".date( 'Y-m-d', strtotime( $date_to ) +86400 )."'" ; + }else{ + $search .= " AND ".$field." BETWEEN '".date( 'Y-m-01' )."' AND '".date( 'Y-m-d', strtotime( TODAYDATE ) +86400 )."'" ; + } + break ; + case 'yearly' : + $start_loop = STARTYEAR ; + $end_loop = THISYEAR ; + break ; + case 'monthly' : + if( stringCheck( $year ) ){ + $start_loop = 1 ; + $end_loop = 12 ; + + $search = " AND ".$field." LIKE '".$year."%'" ; + } + break ; + case 'daily' : + if( stringCheck( $year ) && stringCheck( $month ) ){ + if( stringCheck( $day_from ) || stringCheck( $day_to ) ){ + $start_loop = $day_from ; + $end_loop = $day_to ; + + $search .= " AND ".$field." BETWEEN '".$year."-".$month."-".$day_from."' AND '".date( 'Y-m-d', strtotime( $year."-".$month."-".$day_to ) +86400 )."'" ; + }else{ + $start_loop = 1 ; + $end_loop = 31 ; + + $search .= " AND ".$field." LIKE '%".$year."-".$month."%'" ; + } + } + break ; + } + + if( stringCheck( $start_loop ) && stringCheck( $end_loop ) ){ + for( $a = $start_loop ; $a <= $end_loop ; $a++ ){ + $reset_a = strPad( 2, $a ) ; + switch( $type ){ + case 'yearly' : + $array_td[] = $reset_a ; + break ; + case 'monthly' : + $array_td[] = $reset_a ; + break ; + case 'daily' : + if( $reset_a >= date( '01', strtotime( $year.'-'.$month ) ) && $reset_a <= date( 't', strtotime( $year.'-'.$month ) ) ){ + $array_td[] = $year.'-'.$month.'-'.$reset_a ; + } + break ; + } + } + } + } + + $array['array_date'] = $array_td ; + $array['search'] = $search ; + + return $array ; +} + + +function resetRequest( $array ){ + if ( arrayCheck( $array ) ){ + foreach ( $array as $key => $value ){ + if ( arrayCheck( $value ) ){ + $array[$key] = resetRequest( $value ) ; + }else{ + $array[$key] = escapeString( $value ) ; + } + } + } + return $array ; +} + +function getLimit( $current ){ + return ( ( $current - 1 ) * LIMIT ) . ',' . LIMIT ; +} + +// upload image +function uploadImage($path, $file_name, $source){ + $result = false ; + + $split = explode(',', substr($source, 5), 2) ; + $mime = trim( $split[0] ) ; + $img_data = trim( $split[1] ) ; + $mime_split_without_base64 = explode(';', $mime, 2) ; + $mime_split = explode('/', $mime_split_without_base64[0], 2) ; + + if ( count($mime_split) == 2 ) { + $extension = $mime_split[1] ; + $extension = ( $extension == 'jpeg' ? 'jpg' : $extension ) ; + $new_extension = '' ; + + switch ( $extension ){ + case "jpeg" : + case "jpg" : + $new_extension = 'jpg' ; + break ; + case "png" : + $new_extension = 'png' ; + break ; + case "gif" : + $new_extension = 'gif' ; + break ; + case "msword" : + $new_extension = 'docx' ; + break ; + case "pdf" : + $new_extension = 'pdf' ; + break ; + case "vnd.ms-excel" : + $new_extension = 'xlsx' ; + break ; + } + + if ( $new_extension != '' ){ + $decoded = base64_decode($img_data) ; + $file_name = $file_name . '-' . time() . '-' . rand(000000, 999999) . '.' . $new_extension ; + $file_type = $new_extension ; + + $s = $_SERVER["DOCUMENT_ROOT"].'/uploads/'.$path.'/'.$file_name ; + $b = $_SERVER["DOCUMENT_ROOT"].'/uploads/'.$path.'/b/'.$file_name ; + + $is_upload = false ; + switch ( $new_extension ){ + case "jpeg" : + case "jpg" : + case "png" : + case "gif" : + if( file_put_contents( $s, $decoded ) && file_put_contents( $b, $decoded ) ) { + $is_upload = true ; + } + break ; + default : + if( file_put_contents( $s, $decoded ) ) { + $is_upload = true ; + } + } + + if( $is_upload ) { + return [ + 'status' => '200', + 'message' => 'Success', + 'data' => [ + 'file_name' => $file_name, + 'file_type' => $file_type + ] + ] ; + } + } + } + return [ + 'status' => '306', + 'message' => 'Failed', + 'data' => [] + ] ; +} + + + + +function convertMinutes($time){ + $time = explode(':', $time); + return ($time[0]*60) + ($time[1]) + ($time[2]/60) ; +} + +function convertToTimes($minutes){ + $hours = strPad( 2, floor( $minutes / 60 ) ) ; + $min = strPad( 2, floor( $minutes - ( $hours * 60 ) ) ) ; + + return $hours.":".$min.":00" ; +} + + +// prevent new line, convert \n or enter to br +function escapeNewLine($value){ + $value = trim( preg_replace( '/(\r\n)|\n|\r/', '
    ', $value ) ); + return trim( preg_replace('/\s+/', ' ', $value) ) ; +} + +// convert br to \n or enter +function brToNewLine($value){ + $breaks = array("
    ", "
    ", "
    ") ; + return str_ireplace($breaks, "\r\n", $value) ; +} + +// check spam email +function spamcheck($field){ + $field=filter_var($field, FILTER_SANITIZE_EMAIL); + if(filter_var($field, FILTER_VALIDATE_EMAIL)){ + return TRUE; + } + else{ + return FALSE; + } +} + +// remove last comma +function removeLastComma($value, $type = ','){ + $value = rtrim(trimData($value), $type) ; + return $value ; +} + +// remove last 3 string +function subStrChar($value, $start, $end){ + return substr(trimData($value), $start, $end) ; +} + +// entity decode +function entityDecode($value){ + $value = html_entity_decode($value) ; + return $value ; +} + +// trim data +function trimData($value){ + $value = trim($value) ; + return $value ; +} + +function explodeToArray( $string ){ + $array = [] ; + if ( $string != '' ){ + $new_string = explode(',', $string) ; + foreach ( $new_string as $k => $v ){ + if ( $v != '' ){ + $array[] = dataFilter( $v ) ; + } + } + } + + return $array ; +} + +// self custom array +function customFilterArray($value){ + + $result = false ; + + if (dataFilter($value) != ''){ + $value = str_replace('') ; + $value = explode('>', $value) ; + + if (arrayCheck($value)){ + $result = true ; + } + } + + $array['result'] = $result ; + $array['content'] = $value ; + return $array ; +} + +// insert database filter string +function resetString($value){ + $value = htmlspecialchars($value, ENT_QUOTES) ; + return $value ; +} + +// check array is it true +function arrayCheck( $array ){ + if ( $array != null ){ + if ( is_array($array) ){ + if ( count($array) > 0 ){ + return true ; + } + } + } + return false ; +} + +// check check value exsits +function checkValueExists($value){ + $result = false ; + + if (isset($value) && !empty($value)){ + $result = true ; + } + + return $result ; +} + +// check if value exists +function checkArrayValueExists($array, $key, $val) { + if (arrayCheck($array)){ + foreach ($array as $item){ + if (isset($item[$key]) && $item[$key] == $val){ + return true; + } + } + } + return false; +} + +// select box for loop +function selectForLoopNumber($name, $selected, $start, $end, $type, $required, $run_out){ + + $select = ' + ' ; + + return $select ; + +} + +// trash page +function trashPage($page, $mysqli, $query, $trash){ + + $multiple_trash = array() ; + $multiple_trash = $trash ; + $boolean = true ; + + if (arrayCheck($multiple_trash)){ + foreach($multiple_trash as $key => $value){ + + // trash query + if ($value == '1' && $mysqli->query($query . $key)){ + $boolean = true ; + }else{ + $boolean = false ; + } + + } + }else{ + $boolean = false ; + } + + return $boolean ; +} + +// duplicate or clone new order +function duplicateMySQLRecord ($action, $type, $table, $array_field, $id, $search_query) { + global $mysqli, $prefixQuotation, $prefixQuotationJob ; + + $new_id = '' ; + $prefix_table = '' ; + $prefix_data = '' ; + $prefix_level = 'sub' ; + + $id = dataFilter($id) ; + $id_field = $array_field['id'] ; + $related_type_field = $array_field['related_type'] ; + $related_id_field = $array_field['related_id'] ; + $related_action_field = $array_field['related_action'] ; + $version_field = $array_field['version'] ; + $status_field = $array_field['status'] ; + $date_filed = $array_field['date'] ; + $modified_filed = $array_field['modified'] ; + $date_start_filed = $array_field['date_start'] ; + + // load the original record into an array + $mysqli_query = $mysqli->query("SELECT * FROM ".$table." + WHERE ".$id_field." = '".$id."' ".$search_query." LIMIT 1") ; + if ($mysqli_query->num_rows > 0){ + + $row_record = $mysqli_query->fetch_array(MYSQLI_ASSOC) ; + $main_related_id = $row_record[$related_id_field] ; + + // total page exists + if ( $action == 'clone' ){ + $mysqli_version = $mysqli->query("SELECT * FROM ".$table." + WHERE ".$related_id_field." = '".$main_related_id."' AND quotation_type = '".$type."'") ; + $total_version = $mysqli_version->num_rows ; + }else{ + $total_version = 0 ; + } + $total_version++ ; + + // check the type + switch($type){ + case 'order' : + case 'job-list' : + case 'tax-invoice' : + + // get so number + $form_submit = $row_record['quotation_type'] ; + + // check if invoice type + switch($type){ + case 'job-list' : + $prefix_level = 'main' ; + $form_submit = 'job-list' ; + $prefix_table .= ", quotation_type, quotation_status" ; + $prefix_data .= ", 'job-list', 'pending'" ; + break ; + case 'tax-invoice' : + $prefix_level = 'main' ; + $form_submit = 'tax-invoice' ; + $prefix_table .= ", quotation_type, quotation_status" ; + $prefix_data .= ", 'tax-invoice', 'unpaid'" ; + break ; + } + + $system_company_id = $row_record['quotation_company_id'] ; + + $so_number = soNumber($form_submit) ; + + $prefix_table .= ", quotation_so" ; + $prefix_data .= ", '".$so_number."'" ; + + break ; + } + + if ( $table == $prefixQuotation && $action == 'clone' ){ + // list all related id field + $mysqli->query("UPDATE $prefixQuotation SET + quotation_related_action = 'hide' + WHERE quotation_related_id = '".$main_related_id."' AND quotation_type = '".$type."' AND quotation_trash = '0'") ; + } + + // insert the new record and get the new auto_increment id + if ($mysqli->query("INSERT INTO ".$table." + (".$related_type_field.", ".$related_id_field.", ".$related_action_field.", ".$version_field.", ".$id_field.", ".$date_filed.", ".$modified_filed.", ".$date_start_filed." ".$prefix_table.") VALUES + ('".$prefix_level."', '".$main_related_id."', 'show', '".$total_version."', 'NULL', '".TODAYDATE."', '".TODAYDATE."', '".TODAYDATE."' ".$prefix_data.")")){ + $new_id = $mysqli->insert_id ; + // generate the query to update the new record with the previous values + $new_query = "UPDATE ".$table." SET " ; + foreach ($row_record as $key => $value) { + if (in_array($key, $array_field)) { }else{ + $new_query .= ('`'.$key.'` = "'.str_replace('"','\"',$value).'", ') ; + } + } + // lop off the extra trailing comma + $new_query = substr($new_query,0,strlen($new_query)-2) ; + $new_query .= " WHERE ".$id_field." = '".$new_id."'" ; + $mysqli->query($new_query) ; + } + + } + + // return the new id + return $new_id ; +} + +function checkCookieLogin(){ + // check if user has been remembered + if ($_COOKIE['system_id'] != '' && $_COOKIE['system_name'] != '' && $_COOKIE['system_branch'] != '' && $_COOKIE['system_permission'] != ''){ + // keep in session + $_SESSION['system_id'] = $_COOKIE['system_id'] ; + $_SESSION['system_name'] = $_COOKIE['system_name'] ; + $_SESSION['system_branch'] = $_COOKIE['system_branch'] ; + $_SESSION['system_permission'] = $_COOKIE['system_permission'] ; + // refresh page to check session + header('Refresh: 0') ; + exit ; + } +} + +function getAllTier( $lang = 'en' ){ + global $mysqli ; + + $array_tier = [] ; + $mysqli_tier = $mysqli->query( "SELECT a.tier_id, a.level, 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 = '".$lang."'" ) ; + if ( $mysqli_tier->num_rows > 0 ){ + while ( $row_tier = $mysqli_tier->fetch_assoc() ){ + $array_tier[$row_tier['tier_id']] = $row_tier ; + } + } + + return $array_tier ; +} + +function getRelatedTierID( $is_include, $level ){ + global $mysqli ; + + $array_tier = [] ; + $search_query = '' ; + if ( $is_include == 'yes' ){ + $search_query .= " AND level >= '".$level."'" ; + }else{ + $search_query .= " AND level > '".$level."'" ; + } + + $mysqli_tier = $mysqli->query( "SELECT tier_id FROM profile_tier WHERE deleted_at IS NULL " . $search_query . " ORDER BY level ASC" ) ; + if ( $mysqli_tier->num_rows > 0 ){ + while ( $row_tier = $mysqli_tier->fetch_assoc() ){ + $array_tier[] = $row_tier['tier_id'] ; + } + } + + return $array_tier ; +} + +function getTier( $staff_tier, $lang = 'en' ){ + global $mysqli ; + + $level = -1 ; + $title = '' ; + $is_task = 'no' ; + $is_task_assigned = 'no' ; + $is_task_incentive = 'no' ; + $is_task_incentive2 = 'no' ; + $is_task_extra = 'no' ; + $is_adjustment = 'no' ; + + $mysqli_tier = $mysqli->query("SELECT a.level, a.is_task, a.is_task_assigned, a.is_task_incentive, a.is_task_incentive2, a.is_task_extra, a.is_adjustment, 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 = '".$lang."' AND a.tier_id = '".$staff_tier."' LIMIT 1") ; + if ( $mysqli_tier->num_rows > 0 ){ + $row_tier = $mysqli_tier->fetch_assoc() ; + $level = $row_tier['level'] ; + $title = $row_tier['title'] ; + $is_task = $row_tier['is_task'] ; + $is_task_assigned = $row_tier['is_task_assigned'] ; + $is_task_incentive = $row_tier['is_task_incentive'] ; + $is_task_incentive2 = $row_tier['is_task_incentive2'] ; + $is_task_extra = $row_tier['is_task_extra'] ; + $is_adjustment = $row_tier['is_adjustment'] ; + } + + return [ + 'level' => $level, + 'title' => $title, + 'is_task' => $is_task, + 'is_task_assigned' => $is_task_assigned, + 'is_task_incentive' => $is_task_incentive, + 'is_task_incentive2' => $is_task_incentive2, + 'is_task_extra' => $is_task_extra, + 'is_adjustment' => $is_adjustment + ] ; +} + +// sort by subarray +function cmpBySortable($a, $b) { + return $a["cart_sortable"] - $b["cart_sortable"]; +} + +// change number to wording +function numtowords($num, $currency){ + $decones = array( + '01' => "One", + '02' => "Two", + '03' => "Three", + '04' => "Four", + '05' => "Five", + '06' => "Six", + '07' => "Seven", + '08' => "Eight", + '09' => "Nine", + 10 => "Ten", + 11 => "Eleven", + 12 => "Twelve", + 13 => "Thirteen", + 14 => "Fourteen", + 15 => "Fifteen", + 16 => "Sixteen", + 17 => "Seventeen", + 18 => "Eighteen", + 19 => "Nineteen" + ) ; + $ones = array( + 0 => " ", + 1 => "One", + 2 => "Two", + 3 => "Three", + 4 => "Four", + 5 => "Five", + 6 => "Six", + 7 => "Seven", + 8 => "Eight", + 9 => "Nine", + 10 => "Ten", + 11 => "Eleven", + 12 => "Twelve", + 13 => "Thirteen", + 14 => "Fourteen", + 15 => "Fifteen", + 16 => "Sixteen", + 17 => "Seventeen", + 18 => "Eighteen", + 19 => "Nineteen" + ) ; + $tens = array( + 0 => "", + 1 => "Ten", + 2 => "Twenty", + 3 => "Thirty", + 4 => "Forty", + 5 => "Fifty", + 6 => "Sixty", + 7 => "Seventy", + 8 => "Eighty", + 9 => "Ninety" + ) ; + $hundreds = array( + "Hundred", + "Thousand", + "Million", + "Billion", + "Trillion", + "Quadrillion" + ) ; + // limit t quadrillion + $num = number_format($num,2,".",",") ; + $num_arr = explode(".", $num) ; + $wholenum = $num_arr[0] ; + $decnum = $num_arr[1] ; + $whole_arr = array_reverse(explode(",", $wholenum)) ; + krsort($whole_arr) ; + $rettxt = "" ; + foreach($whole_arr as $key => $i){ + if($i < 20){ + $length_id = strlen($i) ; + if ($length_id == 3){ + $i = substr($i, 1) ; + } + $rettxt .= $ones[$i] ; + } + elseif($i < 100){ + // remove 0 infront + $reset_value = ltrim($i, '0') ; + // continue wording + $rettxt .= $tens[substr($reset_value,0,1)] ; + $rettxt .= " ".$ones[substr($reset_value,1,1)] ; + } + else{ + $rettxt .= $ones[substr($i,0,1)]." ".$hundreds[0] ; + + if ($decnum > 0){ + $rettxt .= ' ' ; + }else{ + $rettxt .= ' and ' ; + } + + $splite_txt = (substr($i,1,1).substr($i,2,1)) ; + if ($splite_txt >= 10 && $splite_txt < 20){ + $rettxt .= $ones[$splite_txt] ; + }else{ + $rettxt .= $tens[substr($i,1,1)] ; + $rettxt .= ' '.$ones[substr($i,2,1)] ; + } + + } + if($key > 0){ + $rettxt .= " ".$hundreds[$key]." " ; + } + + } + $rettxt = $rettxt." ".$currency ; + + if($decnum > 0){ + $rettxt .= " and " ; + if($decnum < 20){ + $rettxt .= $decones[$decnum] ; + } + elseif($decnum < 100){ + $rettxt .= $tens[substr($decnum,0,1)] ; + $rettxt .= " ".$ones[substr($decnum,1,1)] ; + } + $rettxt = $rettxt . ($decnum == 1 ? " cent" : " cents") ; + } + return $rettxt . ' ONLY' ; +} + +// Product pagination +function nextPrevious($current_page, $limit_page, $search, $query) { + global $mysqli ; + // today date + $today_date = date('Y-m-d', time()) ; + // get query + $mysqli_product = $mysqli->query($query) ; + // total page + $total = $mysqli_product->num_rows ; + $total_page = ceil($total / $limit_page) ; + $end_number = ($total - (($current_page - 1) * $limit_page)) ; + // start pagination + if ($total_page <= 1){ + $search_result = ' +
    + Total result: '.$total.' +
    '; + } + else{ + // explode url + $explode_url = explode('&page=', $url, 2); + // Calculating the starting and endign values for the loop + if ($current_page >= 7) { + $start_loop = $current_page - 3; + if ($total_page > $current_page + 3) + $end_loop = $current_page + 3; + else if ($current_page <= $total_page && $current_page > $total_page - 6) { + $start_loop = $total_page - 6; + $end_loop = $total_page; + } else { + $end_loop = $total_page; + } + } + else { + $start_loop = 1; + if ($total_page > 7) + $end_loop = 7; + else + $end_loop = $total_page; + } + // End calculating the starting and endign values for the loop + $search_result = ' +
    +
    + Total result: '.$total.' +
    +
    +
    +
      '; + // previous linking + if ($current_page > 1) { + $prev = $current_page - 1; + $search_result .= ' + ' ; + } + + // pagination number + for ($i = $start_loop; $i <= $end_loop; $i++) { + + $search_result .= ' +
    • + '.$i.' +
    • ' ; + + } + + // show last page + if ($current_page <= ($total_page - 4)){ + $search_result .= ' +
    • + ... Last +
    • ' ; + } + + // next linking + if ($current_page < $total_page) { + $next = $current_page + 1; + $search_result .= ' + ' ; + } + $search_result .= ' +
    +
    +
    +
    ' ; + } + $array['page_total'] = ($total != '' ? $total : 0) ; + $array['page_pagination'] = $search_result ; + $array['page_end'] = $end_number ; + return $array; +} + +/************************************************************************************* + Resize Image +*************************************************************************************/ +function reCreateImage($path, $page, $title, $position, $image, $type, $source, $status = ''){ + // Image uploads when exists + $image = $image ; + $imagetype = $type ; + $source_file = $source ; + $explode_type = pathinfo($image, PATHINFO_EXTENSION); + $flag = false ; + switch($imagetype){ + case 'image/jpg': + case 'image/jpeg': + $ext_type = 'jpg' ; + $flag = true ; + break ; + case 'image/png': + $ext_type = 'png' ; + $flag = true ; + break ; + } + // check if image not exists + if ($image != ''){ + // check if image type not jpeg or png + if ($flag){ + // image + $image_name = $title.($status != '' ? '-'.$status : '').'-'.$page.'.'.$ext_type; + $dir_img = $_SERVER['DOCUMENT_ROOT'].'/uploads/'.$path.'/m/'.$image_name ; + $dir_img_ori = $_SERVER['DOCUMENT_ROOT'].'/uploads/'.$path.'/b/'.$image_name ; + // move file to selected directory + if (move_uploaded_file($source_file, $dir_img_ori)){ + list($img_width,$img_height) = getimagesize($dir_img_ori); + // resize image 2000 x height ? + $modwidth_2000 = 1080 ; + $diff_2000 = $img_width / $modwidth_2000 ; + $modheight_2000 = $img_height / $diff_2000 ; + // resize image 500 x height ? + $modwidth = 500; + $diff = $img_width / $modwidth; + $modheight = $img_height / $diff; + // keep resize image into array + + $dir_img_crop = + array( + array( + 'width' => $modwidth_2000, + 'height' => $modheight_2000, + 'type' => 'auto', + 'watermark' => $_SERVER['DOCUMENT_ROOT'].'/images/watermark_800.png', + 'source' => $dir_img_ori + ), + array( + 'width' => $modwidth, + 'height' => $modheight, + 'type' => 'auto', + 'watermark' => $_SERVER['DOCUMENT_ROOT'].'/images/watermark_800.png', + 'source' => $dir_img + ), + array( + 'width' => '400', + 'height' => '400', + 'type' => 'crop', + 'watermark' => $_SERVER['DOCUMENT_ROOT'].'/images/watermark_100.png', + 'source' => $_SERVER['DOCUMENT_ROOT'].'/uploads/'.$path.'/'.$image_name + ) + ) ; + // return result as array + $array['result'] = true ; + $array['image'] = $image_name ; + $array['original'] = $dir_img_ori ; + $array['extension'] = $ext_type ; + $array['position'] = $position ; + $array['merge_watermark'] = $status ; + $array['crop'] = $dir_img_crop ; + } + }else{ + $array['result'] = false ; + $array['result_message'] = 'error-type' ; + } + } + return $array ; +} + +// check title +function checkTitle($title, $page){ + global $mysqli ; + $title = escapeString($title) ; + $title = stripNonAlphaNumeric($title) ; + $title = $title != '' ? $title : 'No Title' ; + $title = strtolower(str_replace(" ", "-", $title)) ; + $title = strtolower(str_replace(" ", "-", $title)) ; + if (substr($title, -1) == '-'){ $title = substr_replace($title, '', -1) ; } + $mysqli_check = $mysqli->query("SELECT * FROM system_post + WHERE post_id != '".$page."' AND post_link = '".$title."' AND post_trash = '0' ORDER BY (post_status+0) DESC"); + if ($mysqli_check->num_rows > 0){ + $status = 1; + $check_title = 0; + while($check_title == 0){ + $new_title = $title.$status; + $new_title = stripNonAlphaNumeric($new_title); + $new_title = strtolower(str_replace(" ", "-", $new_title)); + $new_title = strtolower(str_replace(" ", "-", $new_title)); + if (substr($title, -1) == '-'){ $title = substr_replace($title, '', -1) ; } + $mysqli_check = $mysqli->query("SELECT * FROM system_post + WHERE post_id != '".$page."' AND post_link = '".$new_title."' AND post_trash = '0' ORDER BY (post_status+0) DESC"); + if ($mysqli_check->num_rows > 0){ + $check_title = 0; + } + else{ + $check_title = 1; + } + $status++; + } + $title = $new_title; + } + else{ + $status = 0; + } + $array['title'] = $title ; + $array['status'] = $status ; + return $array ; +} + +// check product title if exists +function titleExists($mysqli, $prefix_post, $id, $title){ + $boolean_result = false ; + if ($title != ''){ + // check id + if ($id != ''){ + $search_query = " AND post_id != '".$id."'" ; + } + // query for product + $mysqli_product = $mysqli->query("SELECT post_title FROM system_post + WHERE post_title = '".$title."' AND post_type = 'product' AND post_trash = '0' ".$search_query." LIMIT 1") ; + // check if product exist + if ($mysqli_product->num_rows == 0){ + $boolean_result = true ; + } + } + return $boolean_result ; +} + +// replace numeric string +function stripNonAlphaNumeric($string) { + return preg_replace("/[^a-zA-Z0-9\s]/", "", $string); +} + +// number format with 2 decimal +function numberFormat($price, $digit = 2, $type = ''){ + $price = number_format($price, $digit, '.', $type) ; + return $price ; +} + +// check if number +function numberCheck($value){ + $value = ($value > 0 ? $value : 0) ; + return $value ; +} + +// product breadcrumbs +function productBreadcrumbs($page_id){ + global $mysqli, $selected_page ; + // start loop breadcrumbs + $mysqli_breadcrumbs = $mysqli->query("SELECT post_id, post_title, post_parent FROM system_post + WHERE post_id = '".$page_id."' AND post_trash = '0' LIMIT 1") ; + $row_breadcrumbs = $mysqli_breadcrumbs->fetch_array(MYSQLI_ASSOC) ; + // page title + $title = dataFilter($row_breadcrumbs['post_title']) ; + // keep title in breadcrumbs + $breadcrumbs = $title ; + // post parent + $post_parent = $row_breadcrumbs['post_parent'] ; + while ($post_parent != 0){ + $mysqli_breadcrumbs = $mysqli->query("SELECT post_id, post_title, post_parent FROM system_post + WHERE post_id = '".$post_parent."' AND post_trash = '0' LIMIT 1") ; + $row_breadcrumbs = $mysqli_breadcrumbs->fetch_array(MYSQLI_ASSOC) ; + // keep title in breadcrumbs + // page title + $title = dataFilter($row_breadcrumbs['post_title']) ; + $breadcrumbs = ''.$title.' / '.$breadcrumbs ; + // post parent + $post_parent = $row_breadcrumbs['post_parent'] ; + } + $breadcrumbs = 'Main Category'.($breadcrumbs != '' ? ' / '.$breadcrumbs : '') ; + return $breadcrumbs; +} + +// get my current ip +function get_client_ip() { + $ipaddress = ''; + if (getenv('HTTP_CLIENT_IP')) + $ipaddress = getenv('HTTP_CLIENT_IP'); + else if(getenv('HTTP_X_FORWARDED_FOR')) + $ipaddress = getenv('HTTP_X_FORWARDED_FOR'); + else if(getenv('HTTP_X_FORWARDED')) + $ipaddress = getenv('HTTP_X_FORWARDED'); + else if(getenv('HTTP_FORWARDED_FOR')) + $ipaddress = getenv('HTTP_FORWARDED_FOR'); + else if(getenv('HTTP_FORWARDED')) + $ipaddress = getenv('HTTP_FORWARDED'); + else if(getenv('REMOTE_ADDR')) + $ipaddress = getenv('REMOTE_ADDR'); + else + $ipaddress = 'unknown'; + return $ipaddress; +} + +function userAgent($ua){ + $iphone = strstr(strtolower($ua), 'mobile'); //Search for 'mobile' in user-agent (iPhone have that) + $android = strstr(strtolower($ua), 'android'); //Search for 'android' in user-agent + $windowsPhone = strstr(strtolower($ua), 'phone'); //Search for 'phone' in user-agent (Windows Phone uses that) + + function androidTablet($ua){ //Find out if it is a tablet + if(strstr(strtolower($ua), 'android') ){//Search for android in user-agent + if(!strstr(strtolower($ua), 'mobile')){ //If there is no ''mobile' in user-agent (Android have that on their phones, but not tablets) + return true; + } + } + } + $androidTablet = androidTablet($ua); //Do androidTablet function + $ipad = strstr(strtolower($ua), 'ipad'); //Search for iPad in user-agent + $kindle = strstr(strtolower($ua), 'kindle'); //Search for iPad in user-agent + + if($androidTablet || $ipad || $kindle){ //If it's a tablet (iPad / Android / Kindly) + return 'tablet'; + } + elseif($iphone || $android || $windowsPhone){ //If it's a phone and NOT a tablet + return 'mobile'; + } + else{ //If it's not a mobile device + return 'desktop'; + } +} + +//**************************************************************** +//**************************************************************** zip all jpeg file +//**************************************************************** +/* creates a compressed zip file */ +function create_zip($files = array(),$destination = '',$overwrite = false) { + //if the zip file already exists and overwrite is false, return false + if(file_exists($destination) && !$overwrite) { return false; } + //vars + $valid_files = array(); + //if files were passed in... + if(is_array($files)) { + //cycle through each file + foreach($files as $file) { + //make sure the file exists + if(file_exists($file)) { + $valid_files[] = $file; + } + } + } + //if we have good files... + if(count($valid_files)) { + //create the archive + $zip = new ZipArchive(); + if($zip->open($destination,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) { + return false; + } + //add the files + foreach($valid_files as $file) { + $zip->addFile($file,$file); + } + //debug + //echo 'The zip archive contains ',$zip->numFiles,' files with a status of ',$zip->status; + + //close the zip -- done! + $zip->close(); + + //check to make sure the file exists + return file_exists($destination); + } + else + { + return false; + } +} + +// set 0 infront of number +function strPad($zero, $value){ + return str_pad($value, $zero, '0', STR_PAD_LEFT) ; +} + +function emailVerifcationCode($mysqli, $system_user, $company, $from, $arruser, $rand){ + $fullname = dataFilter($arruser['user_fullname']); + $user_id = $arruser['user_id']; + if ($rand != '' && strlen($rand) == 6){ + // query for user + $mysqli_user = $mysqli->query("SELECT * FROM system_user + WHERE (user_permission = 'admin' || user_id = '".$user_id."') AND user_trash = '0'") ; + if ($mysqli_user->num_rows > 0){ + // loop all user + while ($row_user = $mysqli_user->fetch_array(MYSQLI_ASSOC)){ + // email to owner | sbs admin + $to = dataFilter($row_user['user_email']) ; + $title = SYSTEM . ' verification code for ' . $fullname ; + // show content + $body = 'Verification code for ' . $fullname . ' is ' . $rand ; + //put your email address here + $header = 'From: '.$company.' <'.$from.'>'.PHP_EOL. + 'MIME-Version: 1.0'.PHP_EOL. + 'Content-type: text/html; charset=utf-8'.PHP_EOL. + 'Content-Transfer-Encoding: 8bit'.PHP_EOL. + 'X-Mailer: PHP/'.PHP_VERSION.PHP_EOL ; // send to owner + mail($to, $title, $body, $header); // send to user + } + } + } + return $boolean ; +} + +// continue array with text with comma +function continueTextWithComma($array){ + $wording = '' ; + if (count($array) > 0 && is_array($array)){ + foreach($array as $key => $value){ + $wording .= ($key == 0 ? '' : ', ') . $value ; + } + } + return $wording ; +} + +// check is numberic +function checkNumberic($value){ + $value = ($value > 0 ? $value : 0) ; + return $value ; +} + +// check if zero value +function checkZeroValue($value){ + return ($value > 0 ? $value : 0) ; +} + +// json_encode array +function jsonEncodeDecode($type, $array){ + + if ($type == 'encode'){ + return json_encode($array) ; + }else{ + return json_decode($array, true) ; + } + +} + +// add array with set max array +function arrayInsertMax($array, $insert, $max){ + + array_unshift($array, $insert) ; + array_splice($array, $max) ; + + return $array ; +} + +// list all country in array +function allCountry($type, $selected){ + $content = '' ; + + $countries = array("AFGHANISTAN", "ALBANIA", "ALGERIA", "AMERICAN SAMOA", "ANDORRA", "ANGOLA", "ANGUILLA", "ANTARCTICA", "ANTIGUA AND BARBUDA", "ARGENTINA", "ARMENIA", "ARUBA", "AUSTRALIA", "AUSTRIA", "AZERBAIJAN", "BAHAMAS", "BAHRAIN", "BANGLADESH", "BARBADOS", "BELARUS", "BELGIUM", "BELIZE", "BENIN", "BERMUDA", "BHUTAN", "BOLIVIA", "BOSNIA AND HERZEGOWINA", "BOTSWANA", "BOUVET ISLAND", "BRAZIL", "BRITISH INDIAN OCEAN TERRITORY", "BRUNEI DARUSSALAM", "BULGARIA", "BURKINA FASO", "BURUNDI", "CAMBODIA", "CAMEROON", "CANADA", "CAPE VERDE", "CAYMAN ISLANDS", "CENTRAL AFRICAN REPUBLIC", "CHAD", "CHILE", "CHINA", "CHRISTMAS ISLAND", "COCOS (KEELING) ISLANDS", "COLOMBIA", "COMOROS", "CONGO", "CONGO, THE DEMOCRATIC REPUBLIC OF THE", "COOK ISLANDS", "COSTA RICA", "COTE D'IVOIRE", "CROATIA (HRVATSKA)", "CUBA", "CYPRUS", "CZECH REPUBLIC", "DENMARK", "DJIBOUTI", "DOMINICA", "DOMINICAN REPUBLIC", "EAST TIMOR", "ECUADOR", "EGYPT", "EL SALVADOR", "EQUATORIAL GUINEA", "ERITREA", "ESTONIA", "ETHIOPIA", "FALKLAND ISLANDS (MALVINAS)", "FAROE ISLANDS", "FIJI", "FINLAND", "FRANCE", "FRANCE METROPOLITAN", "FRENCH GUIANA", "FRENCH POLYNESIA", "FRENCH SOUTHERN TERRITORIES", "GABON", "GAMBIA", "GEORGIA", "GERMANY", "GHANA", "GIBRALTAR", "GREECE", "GREENLAND", "GRENADA", "GUADELOUPE", "GUAM", "GUATEMALA", "GUINEA", "GUINEA-BISSAU", "GUYANA", "HAITI", "HEARD AND MC DONALD ISLANDS", "HOLY SEE (VATICAN CITY STATE)", "HONDURAS", "HONG KONG", "HUNGARY", "ICELAND", "INDIA", "INDONESIA", "IRAN (ISLAMIC REPUBLIC OF)", "IRAQ", "IRELAND", "ISRAEL", "ITALY", "JAMAICA", "JAPAN", "JORDAN", "KAZAKHSTAN", "KENYA", "KIRIBATI", "KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF", "KOREA, REPUBLIC OF", "KUWAIT", "KYRGYZSTAN", "LAO, PEOPLE'S DEMOCRATIC REPUBLIC", "LATVIA", "LEBANON", "LESOTHO", "LIBERIA", "LIBYAN ARAB JAMAHIRIYA", "LIECHTENSTEIN", "LITHUANIA", "LUXEMBOURG", "MACAU", "MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF", "MADAGASCAR", "MALAWI", "MALAYSIA", "MALDIVES", "MALI", "MALTA", "MARSHALL ISLANDS", "MARTINIQUE", "MAURITANIA", "MAURITIUS", "MAYOTTE", "MEXICO", "MICRONESIA, FEDERATED STATES OF", "MOLDOVA, REPUBLIC OF", "MONACO", "MONGOLIA", "MONTSERRAT", "MOROCCO", "MOZAMBIQUE", "MYANMAR", "NAMIBIA", "NAURU", "NEPAL", "NETHERLANDS", "NETHERLANDS ANTILLES", "NEW CALEDONIA", "NEW ZEALAND", "NICARAGUA", "NIGER", "NIGERIA", "NIUE", "NORFOLK ISLAND", "NORTHERN MARIANA ISLANDS", "NORWAY", "OMAN", "PAKISTAN", "PALAU", "PANAMA", "PAPUA NEW GUINEA", "PARAGUAY", "PERU", "PHILIPPINES", "PITCAIRN", "POLAND", "PORTUGAL", "PUERTO RICO", "QATAR", "REUNION", "ROMANIA", "RUSSIAN FEDERATION", "RWANDA", "SAINT KITTS AND NEVIS", "SAINT LUCIA", "SAINT VINCENT AND THE GRENADINES", "SAMOA", "SAN MARINO", "SAO TOME AND PRINCIPE", "SAUDI ARABIA", "SENEGAL", "SEYCHELLES", "SIERRA LEONE", "SINGAPORE", "SLOVAKIA (SLOVAK REPUBLIC)", "SLOVENIA", "SOLOMON ISLANDS", "SOMALIA", "SOUTH AFRICA", "SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS", "SPAIN", "SRI LANKA", "ST. HELENA", "ST. PIERRE AND MIQUELON", "SUDAN", "SURINAME", "SVALBARD AND JAN MAYEN ISLANDS", "SWAZILAND", "SWEDEN", "SWITZERLAND", "SYRIAN ARAB REPUBLIC", "TAIWAN, PROVINCE OF CHINA", "TAJIKISTAN", "TANZANIA, UNITED REPUBLIC OF", "THAILAND", "TOGO", "TOKELAU", "TONGA", "TRINIDAD AND TOBAGO", "TUNISIA", "TURKEY", "TURKMENISTAN", "TURKS AND CAICOS ISLANDS", "TUVALU", "UGANDA", "UKRAINE", "UNITED ARAB EMIRATES", "UNITED KINGDOM", "UNITED STATES", "UNITED STATES MINOR OUTLYING ISLANDS", "URUGUAY", "UZBEKISTAN", "VANUATU", "VENEZUELA", "VIETNAM", "VIRGIN ISLANDS (BRITISH)", "VIRGIN ISLANDS (U.S.)", "WALLIS AND FUTUNA ISLANDS", "WESTERN SAHARA", "YEMEN", "YUGOSLAVIA", "ZAMBIA", "ZIMBABWE"); + + switch($type){ + case 'select' : + $content = ' + ' ; + break ; + } + + $array['content'] = $content ; + return $array ; +} + +// check company or customer exists else insert +function checkCompanyCustomer($array_company){ + global $mysqli, $prefixCompany, $prefixCustomer ; + + $array = array() ; + $customer_type = 'customer' ; + + // reset value + $company = $array_company['company_name'] ; + $customer = $array_company['customer_name'] ; + + // check company if exists else insert + $returnCompanyID = getCompanyByName($company) ; + + if ($returnCompanyID['result']){ + $company_id = $returnCompanyID['company_id'] ; + }else{ + + // insert into company table + $mysqli->query("INSERT INTO $prefixCompany + (company_name, company_website, company_gst, company_number, company_code, company_type, company_date, company_trash) VALUES + ('".$company."', '".$array_company['company_website']."', '".$array_company['company_gst']."', '".$array_company['company_number']."', '".$array_company['company_code']."', '".$array_company['company_type']."', '".TODAYDATE."', '0')") ; + + // get last id for company + $company_id = $mysqli->insert_id ; + + } + + $returnCustomerID = getCustomerByName($customer_type, $company_id, $customer) ; + if ($returnCustomerID['result']){ + + $customer_id = $returnCustomerID['customer_id'] ; + $mysqli->query("UPDATE $prefixCustomer SET + customer_account_code = '".$array_company['customer_account_code']."', + customer_country = '".$array_company['customer_country']."', + customer_state = '".$array_company['customer_state']."', + customer_area = '".$array_company['customer_area']."', + customer_address1 = '".$array_company['customer_address1']."', + customer_address2 = '".$array_company['customer_address2']."', + customer_address3 = '".$array_company['customer_address3']."', + customer_call = '".$array_company['customer_call']."', + customer_name = '".$customer."', + customer_email1 = '".$array_company['customer_email1']."', + customer_email2 = '".$array_company['customer_email2']."', + customer_email3 = '".$array_company['customer_email3']."', + customer_mobile = '".$array_company['customer_mobile']."', + customer_office = '".$array_company['customer_office']."', + customer_fax = '".$array_company['customer_fax']."', + customer_modified = '".TODAYDATE."' + WHERE customer_id = '".$customer_id."'") ; + + }else{ + + // insert into company table + $mysqli->query("INSERT INTO $prefixCustomer + (customer_type, customer_company_id, customer_account_code, customer_call, customer_name, + customer_country, customer_state, customer_area, customer_address1, customer_address2, customer_address3, + customer_email1, customer_email2, customer_email3, customer_mobile, customer_office, customer_fax, + customer_live, customer_date, customer_modified, customer_trash) VALUES + ('".$customer_type."', '".$company_id."', '".$array_company['customer_account_code']."', '".$array_company['customer_call']."', '".$customer."', + '".$array_company['customer_country']."', '".$array_company['customer_state']."', '".$array_company['customer_area']."', '".$array_company['customer_address1']."', '".$array_company['customer_address2']."', '".$array_company['customer_address3']."', + '".$array_company['customer_email1']."', '".$array_company['customer_email2']."', '".$array_company['customer_email3']."', '".$array_company['customer_mobile']."', '".$array_company['customer_office']."', '".$array_company['customer_fax']."', + 'active', '".TODAYDATE."', '".TODAYDATE."', '0')") ; + + // get last id for company + $customer_id = $mysqli->insert_id ; + + } + + $array['company_id'] = $company_id ; + $array['customer_id'] = $customer_id ; + return $array ; +} + +// get all company list only +function getAllCompanyOnly($search_query){ + global $mysqli, $prefixCompany ; + + $result = false ; + $array_company = array() ; + + // query for company + $mysqli_company = $mysqli->query("SELECT company_id, company_name FROM $prefixCompany + WHERE company_name != '' AND company_trash = '0' ".$search_query." ORDER BY (company_name+0) ASC") ; + if ($mysqli_company->num_rows > 0){ + + // loop all company + while ($row_company = $mysqli_company->fetch_array(MYSQLI_ASSOC)){ + $array_company[] = $row_company ; + } + + $result = true ; + } + + $array['result'] = $result ; + $array['content'] = $array_company ; + + return $array ; +} + +// get all company list +function getAllCompany($search_query, $selected_id, $page_title){ + global $mysqli, $prefixCompany, $prefixCustomer ; + $select = '' ; + $result = false ; + + // query for company + $mysqli_company = $mysqli->query("SELECT company_id, company_name FROM $prefixCompany a + LEFT JOIN $prefixCustomer b ON (a.company_id = b.customer_company_id) + WHERE a.company_name != '' AND a.company_trash = '0' AND b.customer_live = 'active' AND b.customer_trash = '0' ".$search_query." GROUP BY a.company_name ORDER BY a.company_name ASC") ; + if ($mysqli_company->num_rows > 0){ + $select .= ' + ' ; + + $result = true ; + } + + $array['result'] = $result ; + $array['select'] = $select ; + return $array ; +} + +// get selected company by name +function getCompanyByName($company_name){ + global $mysqli, $prefixCompany ; + + $result = false ; + $array = array() ; + + $mysqli_company = $mysqli->query( "SELECT company_id FROM $prefixCompany + WHERE company_trash = '0' AND company_name = '".$company_name."' LIMIT 1" ) ; + + if ($mysqli_company->num_rows > 0){ + $row_company = $mysqli_company->fetch_array(MYSQLI_ASSOC) ; + $array = $row_company ; + $result = true ; + } + + $array['result'] = $result ; + return $array ; +} + +// get selected customer by name +function getCustomerByName($customer_type, $company_id, $customer_name){ + global $mysqli, $prefixCompany, $prefixCustomer ; + + $result = false ; + $array = array() ; + + $mysqli_customer = $mysqli->query("SELECT customer_id FROM $prefixCustomer + WHERE customer_type = '".$customer_type."' AND customer_company_id = '".$company_id."' AND customer_name = '".$customer_name."' AND customer_trash = '0' LIMIT 1") ; + + if ($mysqli_customer->num_rows > 0){ + $row_customer = $mysqli_customer->fetch_array(MYSQLI_ASSOC) ; + $array = $row_customer ; + $result = true ; + } + + $array['result'] = $result ; + return $array ; +} + +// get all company list +function getAllCustomer($search_query, $selected_company_id, $selected_customer_id){ + global $mysqli, $prefixCompany, $prefixCustomer ; + $select = '' ; + $result = false ; + + // query for company + $mysqli_company = $mysqli->query("SELECT company_id, company_name FROM $prefixCompany a + LEFT JOIN $prefixCustomer b ON (a.company_id = b.customer_company_id) + WHERE a.company_name != '' AND a.company_trash = '0' AND b.customer_live = 'active' AND b.customer_trash = '0' ".$search_query." GROUP BY a.company_name ORDER BY a.company_name ASC") ; + if ($mysqli_company->num_rows > 0){ + $select .= ' + ' ; + + $result = true ; + } + + $array['result'] = $result ; + $array['select'] = $select ; + return $array ; +} + +// return customer value +function getCustomer($type, $select_customer_id, $select_company_id, $select_customer_type){ + global $mysqli, $prefixCustomer, $prefixCompany ; + $result = false ; + + // check query if exsits + if ($type == 'trash'){ + }else{ + $query = " AND a.customer_type = '".$type."'" ; + if ($type != 'supplier'){ + $query = " AND a.customer_company_id = '".$select_company_id."'" ; + } + } + + $mysqli_query = "SELECT * FROM $prefixCustomer a + LEFT JOIN $prefixCompany b ON (a.customer_company_id = b.company_id) + WHERE a.customer_id = '".$select_customer_id."' AND a.customer_live = 'active' AND a.customer_trash = '0' AND b.company_trash = '0'".$query ; + $mysqli_customer = $mysqli->query($mysqli_query." LIMIT 1") ; + if ($mysqli_customer->num_rows > 0){ + + $row_customer = $mysqli_customer->fetch_array(MYSQLI_ASSOC) ; + + $array['content'] = $row_customer ; + $result = true ; + } + + $array['result'] = $result ; + return $array ; + +} + +// return selected customer value with company id provide +function getSelectedCustomerOption($selected_page, $select_customer_id, $select_company_id, $boolean_marketing, $user_id){ + global $mysqli, $prefixCustomer, $prefixCompany ; + + // check selected page + $search_query = $customer = '' ; + + if ($selected_page != ''){ + // check user page + switch($selected_page){ + case 'marketing' : + // check permission + $search_query .= " AND customer_type = 'customer'" ; + break ; + case 'purchasing' : + $search_query .= " AND customer_type = 'supplier'" ; + break ; + } + } + + // query for customer + $mysqli_customer = $mysqli->query("SELECT * FROM $prefixCustomer + WHERE customer_company_id = '".$select_company_id."' AND customer_live = 'active' AND customer_trash = '0' ".$search_query." ORDER BY customer_name ASC") ; + + $customer = '' ; + if ($mysqli_customer->num_rows > 0){ + // loop all customer + while($row_customer = $mysqli_customer->fetch_array(MYSQLI_ASSOC)){ + // check if customer not null + $customer_name = dataFilter($row_customer['customer_name']) ; + $customer_name = ($customer_name != '' ? $customer_name : 'NoName') ; + $customer_account_code = dataFilter($row_customer['customer_account_code']) ; + $customer_account_code = ($customer_account_code != '' ? $customer_account_code : 'No Account Code') ; + + if ($customer_name != '' || $customer_account_code != ''){ + $customer .= ' + ' ; + } + } + } + + return $customer ; +} + +// return company letter head +function getOwnerCompanyLetterHead($comp_id = ''){ + global $mysqli ; + + if ($comp_id != '') { + $search_pquery="AND branch_id ='".$comp_id."'"; + } + + $array = [ + 'name' => '', + 'header' => '' + ] ; + + $mysqli_page = $mysqli->query("SELECT branch_name, branch_content FROM branch + WHERE deleted_at IS NULL ".$search_pquery." LIMIT 1") ; + + if ($mysqli_page->num_rows > 0){ + $row_page = $mysqli_page->fetch_assoc() ; + $content = entityDecode(dataFilter($row_page['branch_content'])) ; + $array['name'] = $row_page['branch_name'] ; + $array['header'] = $content ; + } + return $array ; +} + +// export file +function exportFileExcel($records) { + $heading = false ; + if(!empty($records)) + foreach($records as $row) { + if(!$heading) { + // display field/column names as a first row + echo implode("\t", array_keys($row)) . "\n" ; + $heading = true; + } + echo implode("\t", array_values($row)) . "\n" ; + } + exit; +} + +// get user list +function getUser($type, $select_name, $selected_id, $required, $search_query){ + global $mysqli ; + + $result = false ; + $boolean_exsits = false ; + $select_box = '' ; + $array_list = array() ; + + // loop all user + if ( $type != 'all-marketing' ){ + $search_query = " AND user_trash = '0'" . $search_query ; + } + + $mysqli_page = $mysqli->query("SELECT user_id, user_name, user_colour FROM system_user + WHERE user_id != '' ".$search_query) ; + + if ($mysqli_page->num_rows > 0){ + $result = true ; + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + $id = $row_page['user_id'] ; + $username = ucwords(dataFilter($row_page['user_name'])) ; + $colour = dataFilter($row_page['user_colour']) ; + + $select_box .= ' + ' ; + $array_list[] = array('id' => $id, + 'name' => $username, + 'user_name' => $username, + 'colour' => $colour) ; + if ($selected_id == $id){ + $boolean_exsits = true ; + $array_selected_list = array('id' => $id, + 'name' => $username, + 'user_name' => $username, + 'colour' => $colour) ; + } + + } + } + + $select_box = ' + ' ; + + $array['select_box'] = $select_box ; + $array['exists'] = $boolean_exsits ; + $array['list'] = $array_list ; + $array['selected_list'] = $array_selected_list ; + $array['result'] = $result ; + return $array ; +} + +// branch +function getBranch($type, $select_name, $selected_id, $required, $search_query){ + global $mysqli ; + + $result = false ; + $select_box = '' ; + $array_list = array() ; + $array_selected_list = array() ; + $boolean_branch_exsits = false ; + + // show hq and branch + $array_branch_list = array('branch-hq', 'branch') ; + foreach($array_branch_list as $key => $value){ + + // loop hq + switch($value){ + case 'branch-hq' : + $search_query_reset = " LIMIT 1" ; + break ; + case 'branch' : + $search_query_reset = " AND post_title != ''" . $search_query ; + break ; + } + + // check branch query + $mysqli_page = $mysqli->query("SELECT * FROM system_post + WHERE post_type = '".$value."' AND post_categories = '".$value."' AND post_trash = '0'" . $search_query_reset) ; + if ($mysqli_page->num_rows > 0){ + + $result = true ; + + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + $id = $row_page['post_id'] ; + + $select_box .= ' + ' ; + $array_list[] = array('id' => $id, + 'type' => $value, + 'title' => dataFilter($row_page['post_title'])) ; + if ($selected_id == $id){ + $boolean_branch_exsits = true ; + $array_selected_list = array('id' => $id, + 'type' => $value, + 'title' => dataFilter($row_page['post_title'])) ; + } + + } + } + + } + + $select_box = ' + ' ; + + $array['select_box'] = $select_box ; + $array['list'] = $array_list ; + $array['selected_list'] = $array_selected_list ; + $array['exists'] = $boolean_branch_exsits ; + $array['result'] = $result ; + return $array ; +} + +// return selected product status +function selectedProductStatus($id){ + global $mysqli ; + $result = false ; + + if ($id != ''){ + $mysqli_product = $mysqli->query("SELECT post_id, post_type, post_title, post_content, post_product, post_quantity_available, post_quantity_minimum, post_price, post_price_selling, post_supplier_id FROM system_post + WHERE post_id = '".$id."' AND post_trash = '0' LIMIT 1") ; + if ($mysqli_product->num_rows > 0){ + $row_product = $mysqli_product->fetch_array(MYSQLI_ASSOC) ; + $array = $row_product ; + $result = true ; + } + } + + $array['result'] = $result ; + return $array ; +} + +// get user list +function getPostType($type, $select_name, $selected_id, $required, $search_query){ + global $mysqli ; + + $result = false ; + $boolean_exsits = false ; + $select_box = '' ; + $array_list = $array_select_list = array() ; + + // check type first + switch($type){ + case 'area-title' : + $post_type = 'area' ; + break ; + default : + $post_type = $type ; + } + + // loop all user + $mysqli_page = $mysqli->query("SELECT * FROM system_post + WHERE post_type = '".$post_type."' AND post_trash = '0'".$search_query) ; + + if ($mysqli_page->num_rows > 0){ + $result = true ; + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + $title = dataFilter($row_page['post_title']) ; + $id = $row_page['post_id'] ; + + switch($type){ + case 'area' : + $select_box .= '' ; + break ; + default : + $select_box .= '' ; + $array_list[] = array('id' => $id, + 'name' => $title) ; + if ($selected_id == $id){ + $boolean_exsits = true ; + $array_select_list = array('id' => $id, + 'name' => $title) ; + } + break ; + } + + } + } + + switch($type){ + case 'area' : + $select_box = '
    ' ; + break ; + default : + $select_box = '' ; + } + + $array['select_box'] = $select_box ; + $array['exists'] = $boolean_exsits ; + $array['list'] = $array_list ; + $array['select_list'] = $array_select_list ; + $array['result'] = $result ; + return $array ; +} + +// reset company insert function +function resetCompanyDetails($array_company){ + + // reset key + $array_remove = array('company_id', 'company_date', 'company_trash', 'customer_id', 'customer_type', 'customer_company_id', 'customer_user_id', 'customer_remark', 'customer_date', 'customer_modified', 'customer_trash') ; + + foreach($array_remove as $value){ + unset($array_company[$value]) ; + } + + $array_company = resetStringArray($array_company) ; + + array_values($array_company) ; + return $array_company ; +} + +// reset string array +function resetStringArray($array){ + foreach ( $array as $key => $value ){ + $array[$key] = resetString(dataFilter($value)) ; + } + return $array ; +} + +// reset date format +function resetDateFormat($date){ + if($date != NULL){ + return ( $date == '0000-00-00' || $date == '0000-00-00 00:00:00' ? '-' : date('d . m . Y', strtotime($date)) ) ; + }else{ + return "-"; + } +} + +// reset date format +function resetDateFormat2($date){ + return ( $date == '0000-00-00' || $date == '0000-00-00 00:00:00' ? '-' : date('d . m . Y', strtotime($date)) ) ; +} + +// reset date format +function resetDateTimeFormat($date){ + return ( $date != '0000-00-00 00:00:00' ? date('d . m . Y ( ha : i\m : s\s )', strtotime($date)) : '-' ) ; +} + +// reset date format +function resetTimeFormat($date){ + $value = '' ; + switch ( $date ){ + case '0000-00-00 00:00:00' : + case '00:00:00' : + $value = '' ; + break ; + default : + $value = date('H:iA', strtotime($date)) ; + } + return $value ; +} + +function resetTimeWithoutSec( $value ){ + $value = ( $value != '00:00:00' ? date('H:i', strtotime($value)) : '' ) ; + $value = ( $value != '00:00' ? $value : '' ) ; + return $value ; +} + +// encode value +function encodeValue($value){ + $value = base64_encode('system_'.$value.'123') ; + return md5($value) ; +} + +function getRounding($amount){ + $priceRounding = priceRounding($amount); + $Rounding = $priceRounding - $amount; + return $Rounding; +} +// price rounding +function priceRounding($amount = 0){ + // set amount to 2 decimal + // $amount = numberFormat($amount) ; + // check if decimal exists + if (is_float($amount) && strpos($amount, '.') !== false){ + $amount = substr_replace($amount, '', strpos($amount, '.') + 3) ; + }else{ + $amount = $amount.'.00' ; + } + // reset amount to 2 decimal + $amount = numberFormat($amount) ; + $gst_rounding = substr($amount, -2) ; + // statement for rounding + if ($gst_rounding < 1){ + $amount = substr_replace($amount, 00, -2) ; + }elseif ($gst_rounding <= 10){ + $amount = substr_replace($amount, 10, -2) ; + }elseif ($gst_rounding <= 20){ + $amount = substr_replace($amount, 20, -2) ; + }elseif ($gst_rounding <= 30){ + $amount = substr_replace($amount, 30, -2) ; + }elseif ($gst_rounding <= 40){ + $amount = substr_replace($amount, 40, -2) ; + }elseif ($gst_rounding <= 50){ + $amount = substr_replace($amount, 50, -2) ; + }elseif ($gst_rounding <= 60){ + $amount = substr_replace($amount, 60, -2) ; + }elseif ($gst_rounding <= 70){ + $amount = substr_replace($amount, 70, -2) ; + }elseif ($gst_rounding <= 80){ + $amount = substr_replace($amount, 80, -2) ; + }elseif ($gst_rounding <= 90){ + $amount = substr_replace($amount, 90, -2) ; + }elseif ($gst_rounding <= 99){ + $amount = substr_replace($amount, 00, -2) ; + $amount += 1 ; + } + // set again amount to 2 decimal + $amount = numberFormat($amount) ; + // return result + return $amount ; +} + +// multiple array insert +function multipleArrayTo($array){ + $temp = array() ; + if ( arrayCheck($array) ){ + foreach ( $array as $value ){ + $temp[] = '('.$value.')' ; + } + } + return implode(',', $temp) ; +} + +// check page permission +function permissionCheck($row_user, $page){ + $page = '('.$page.')' ; + $result = false ; + if ( $page == '(all-can-access)' ){ + $result = true ; + }else{ + if ( $row_user['user_permission'] == 'admin' || strpos($row_user['user_permission2'], $page) !== false ) { + $result = true ; + } + } + return $result ; + +} + +// check page permission +function permissionWebsite($row_page_website, $page){ + $page = '('.$page.')' ; + if ( strpos($row_page_website['post_content'], $page) !== false ) { + $result = true ; + } + return $result ; +} + +function passwordEncrypt($psw){ + return md5('1QWE#!'.$psw.'2QW#wew') ; +} + +function getConfig($attr){ + global $mysqli, $prefixConfig ; + $config_value = '' ; + $get_config = $mysqli->query("SELECT config_value FROM $prefixConfig + WHERE config_attribute = '".$attr."' LIMIT 1") ; + if ( $get_config->num_rows > 0 ){ + $row_config = $get_config->fetch_assoc() ; + $config_value = $row_config['config_value'] ; + } + return $config_value ; +} + +// function change columns name +function changeColumnsName($pass_value){ + + $array_col = array( 'col-xs-14' => 'twelve', + 'col-xs-13' => 'twelve', + 'col-xs-12' => 'twelve', + 'col-xs-11' => 'eleven', + 'col-xs-10' => 'ten', + 'col-xs-9' => 'nine', + 'col-xs-8' => 'eight', + 'col-xs-7' => 'seven', + 'col-xs-6' => 'six', + 'col-xs-5' => 'five', + 'col-xs-4' => 'four', + 'col-xs-3' => 'three', + 'col-xs-2' => 'two', + 'col-xs-1' => 'one') ; + + foreach($array_col as $key => $value){ + $pass_value = str_replace($key, $value . ' columns', $pass_value) ; + } + + ///$pass_value = str_replace('contenteditable="true" tabindex="0"', '', $pass_value) ; + $pass_value = preg_replace("/(spellcheck=\"(\w*)\"|role=\"(\w*\W*\d*\D*\s*\S*)\"|aria-label=\"(\w*\W*\d*\D*\s*\S*)\"|aria-describedby=\"(cke_(\d+))\"|contenteditable=\"(\w+\W*\d*\D\s*\S*)\"|tabindex=\"(\w+\W*\d*\D\s*\S*)\")/", "", $pass_value); + //preg_replace("/title=\"(.*editor(\d+))\"/", "", $input_lines); + //$pass_value = preg_replace("/Rich.*editor\d+/", "", $pass_value); + $pass_value = preg_replace("/Rich Text Editor, editor(\d+)/", "", $pass_value); + return $pass_value ; +} + +function pushToBranchUser( $branchs, $staffs, $type, $type_id, $title, $message ){ + global $mysqli ; + + $search_query = '' ; + if ( arrayCheck($branchs) ){ + $search_query .= " AND branch_id IN ( ".implode(', ', $branchs)." )" ; + } + + if ( arrayCheck($staffs) ){ + $search_query .= " AND staff_id IN ( ".implode(', ', $staffs)." )" ; + } + + $select_staffs = $mysqli->query( "SELECT staff_id FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) " . $search_query ) ; + if ( $select_staffs->num_rows > 0 ){ + $array_staffs = [] ; + while ( $staff = $select_staffs->fetch_assoc() ){ + $array_staffs[] = $staff['staff_id'] ; + } + + foreach ( $array_staffs as $k => $v ){ + pushToUserCron( $type, $type_id, $v, $title, $message ) ; + } + } +} + +function pushToUserCron( $type, $type_id, $staff_id, $title, $message, $inbox_id = '' ){ + global $mysqli ; + + $mysqli->query( "INSERT INTO staff_notification_cron + ( type, type_id, staff_id, title, message, inbox_id, is_sent ) VALUES + ( '".$type."', '".$type_id."', '".$staff_id."', '".$title."', '".$message."', '".$inbox_id."', 'no' )" ) ; +} + +function pushToUser( $type, $type_id, $staff_id, $title, $message, $cron_id = '', $inbox_id = '' ){ + /* + global $mysqli ; + + $push = array() ; + + $notifications_query = $mysqli->query( "SELECT notificationid, notification, badge FROM staff_notification + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' ORDER BY notificationid DESC LIMIT 1") ; + + if ( $notifications_query->num_rows > 0 ){ + + $notification = $notifications_query->fetch_assoc() ; + $token_id = $notification['notificationid'] ; + $badge = ( $notification['badge'] + 1 ) ; + + $is_create = true ; + if ( $inbox_id != '' && $inbox_id > 0 ){ + $is_create = false ; + } + + if ( $is_create ){ + $mysqli->query( "INSERT INTO inbox ( staff_id, from_table, from_id, receiver_type, view_format, title, description, created_at ) VALUES ( '/".$staff_id."/', '".$type."', '".$type_id."', '3', 'message', '".$title."', '".$message."', '".TODAYDATE."' )" ) ; + + $inbox_id = $mysqli->insert_id ; + + $mysqli->query( "INSERT INTO staff_inbox_view ( inbox_id, staff_id, is_read ) VALUES ( '".$inbox_id."', '".$staff_id."', '0' )" ) ; + + $mysqli->query( "UPDATE staff_notification_cron SET inbox_id = '".$inbox_id."' WHERE cron_id = '".$cron_id."'" ) ; + } + + $data = array( "to" => $notification['notification'], + "notification" => array( + "id" => $notification['notificationid'], + "title" => dataFilter( $title ), + "body" => dataFilter( $message ), + "icon" => PATH.'images/logo.png', + "sound" => 'default', + "vibrate" => '1', + "badge" => $badge, + "click_action" => '', + "show_in_foreground" => 'true' + ) + ) ; + pushNotification( $data ) ; + + // update badge + $mysqli->query("UPDATE staff_notification SET badge = '".$badge."' WHERE notificationid = '".$token_id."'") ; + } + */ +} + +function pushNotification( $data ){ + /* + + $credentialsPath = 'hr-system-b0af6-firebase-adminsdk-u5wel-5bcb3596d4.json' ; // Replace with your actual path + $projectId = '517510861795' ; // Your Firebase project ID or project number + + function getAccessToken($credentialsPath) { + $scopes = ['https://www.googleapis.com/auth/firebase.messaging']; + + // Get OAuth2 token using service account credentials + $credentials = json_decode(file_get_contents($credentialsPath), true); + $client = new Google_Client(); + $client->setAuthConfig($credentials); + $client->setScopes($scopes); + + // Get the token + $accessToken = $client->fetchAccessTokenWithAssertion()['access_token']; + + return $accessToken; + } + + + $headers = array( + 'Authorization: key='.PUSHTOKEN, + 'Content-Type: application/json' + ) ; + + $ch = curl_init() ; + curl_setopt( $ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' ) ; + curl_setopt( $ch,CURLOPT_POST, true ) ; + curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ) ; + curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ) ; + curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode($data)) ; + $result = curl_exec($ch) ; + $output = jsonEncodeDecode('decode', $result) ; + + print_r($result) ; + + saveLog( 'notification', 'Notification', $data, $output ) ; + + curl_close ($ch) ; + */ +} + +function setTotalHoursArray( $array, $value ){ + if ( $value != '' ){ + $value = explode( ':', $value ) ; + $array[] = $value ; + } + return $array ; +} + +function setTotalHoursSum( $array ){ + $value = '00:00' ; + if ( count($array) > 0 ){ + + $hours = 0 ; + $minutes = 0 ; + + foreach ( $array as $kk => $vv ){ + $hours += $vv['0'] ; + $minutes += $vv['1'] ; + } + + $check = true ; + while ( $check ){ + if ( $minutes >= 60 ){ + $minutes -= 60 ; + $hours++ ; + }else{ + $check = false ; + } + } + + $value = strPad(2, $hours).':'.strPad(2, $minutes) ; + + } + + return $value ; +} + +function cronjobHit($urlParameter){ + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch,CURLOPT_URL,$urlParameter); + curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); + curl_setopt($ch, CURLOPT_TIMEOUT, 1); + curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); + curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13"); + $output = curl_exec($ch); + curl_close($ch); + + return json_decode($output, true) ; +} + +function callWithoutResponse( $host, $port, $method, $path, $params = [], $connectTimeout = 1 ){ + $status = '2' ; + $message = '' ; + + $host = str_replace( [ 'https://', 'www.' ], '', $host ) ; + $host = str_replace( '/', '', $host ) ; + $server = $host ; + $params = http_build_query($params) ; + + if ( $port == '443' ){ $server = 'ssl://'.$server ; } + + $fp = fsockopen( $server, $port, $errorCode, $errorInfo, $connectTimeout ) ; + if ( !$fp ) { + $message = $errorInfo . ' ( '.$errorCode.' )' ; + } else { + + if ( $method == 'POST' ){ + $http .= "$method $path HTTP/1.1\r\n" ; + $http .= "Host: $host\r\n" ; + $http .= "Content-type: application/x-www-form-urlencoded\r\n" ; + $http .= "Content-length: ".strlen($params)."\r\n" ; + $http .= "Connection: close\r\n\r\n" ; + $http .= $params."\r\n\r\n" ; + }else{ + $http .= "$method $path?".$params." HTTP/1.1\r\n" ; + $http .= "Host: $host\r\n" ; + $http .= "Connection: close\r\n\r\n" ; + } + + if ( fputs( $fp, $http ) === false ){ + $message = 'Request failed.' ; + }else{ + $status = '1' ; + $message = 'Success' ; + } + + fclose($fp) ; + } + + return [ + 'status' => $status, + 'message' => $message + ] ; +} + + +function getOTSalary( $staffOtRate, $staff_salary, $list_ot_day, $return = '' ){ + $onehoursalary = numberFormat( ( $staff_salary * $staffOtRate / 8 ), 2 ) ; // base rate + // $oneminutesalary = numberFormat( ( $onehoursalary / 60 ), 2 ) ; // base rate for minute + // off day, public holiday, work day all ot rate is same + $get_total = numberFormat( $list_ot_day*$onehoursalary ) ; + + // hour rate + minute rate + if ( $return != '' ){ + return [ + 'perhour' => $onehoursalary, + 'total' => $get_total + ] ; + }else{ + return $get_total ; + } +} + +function calculateSalary( $row ){ + $salary = $row['salary'] ; + $salary_jtk = $row['salary_jtk'] ; + + $total_basic = numberFormat( $salary * $row['total_normal_days'] ) ; + $get_ot = getOTSalary( $row['ot_rate'], $salary, $row['total_ot_hours'], 'yes' ) ; + $total_ot = $get_ot['total'] ; + + $total_rest = numberFormat( numberFormat($salary_jtk * $row['day_rest_rate'], 2) * $row['total_rest_days'] ) ; + $get_ot_rest = getOTSalary( $row['ot_rest_rate'], $salary_jtk, $row['total_ot_rest_hours'], 'yes' ) ; + $total_ot_rest = $get_ot_rest['total'] ; + + $total_public = numberFormat( numberFormat($salary_jtk * $row['day_public_rate'], 2) * $row['total_public_days'] ) ; + $get_ot_public = getOTSalary( $row['ot_public_rate'], $salary_jtk, $row['total_ot_public_hours'], 'yes' ) ; + $total_ot_public = $get_ot_public['total'] ; + + // $total_public_nor = numberFormat( $salary_jtk * $row['total_public_working_days'] ) ; + $total_public_nor = numberFormat( $salary_jtk * $row['total_public_working_days'] ) ; + + $total_annual = numberFormat( $salary_jtk * $row['total_annual_days'] ) ; + + $total_medical = numberFormat( $salary_jtk * $row['total_mc_days'] ) ; + $total_allo_food = numberFormat( $row['allowance_food'] * $row['allowance_food_days'] ) ; + + $total_unpaid_leave = numberFormat( $salary_jtk * $row['total_unpaid_days'] ) ; + + // total allowance + // claim or allowance description + $allo = 0 ; + $allo += $row['claim_medical'] ; + $allo += $row['allowance_monthly_increment'] ; + $allo += $row['allowance_monthly'] ; + $allo += $row['allowance_topup'] ; + $allo += $row['allowance_target'] ; + $allo = numberFormat( $allo ) ; + + // sum total salary first + $total_earn = ( $total_basic + $total_ot ) ; + $total_earn += ( $total_rest + $total_ot_rest ) ; + $total_earn += ( $total_public + $total_ot_public + $total_public_nor ) ; + $total_earn += ( $total_annual ) ; + $total_earn += ( $total_medical ) ; + $total_earn += ( $total_allo_food + $allo ) ; + $total_earn = numberFormat( $total_earn ) ; + + // total charge + // charge + $charge = 0 ; + $charge += $row['charge_advance'] ; + $charge += $row['charge_skhppa'] ; + $charge += $row['charge_hostel'] ; + $charge += $row['charge_gas'] ; + $charge += $row['charge_absent'] ; + $charge += $row['charge_absent_punch'] ; + $charge += $row['charge_late'] ; + $charge += $row['charge_time_off'] ; + $charge += $row['charge_early_out'] ; + $charge += $row['charge_give_away'] ; + $charge += $row['charge_comment'] ; + $charge += $row['charge_target'] ; + $charge += $total_unpaid_leave ; + $charge = numberFormat( $charge ) ; + + $total_salary = numberFormat( $total_earn - $charge ) ; + + return [ + 'total_basic' => $total_basic, + 'total_ot' => $total_ot, + 'total_ot_hour' => $get_ot['perhour'], + 'total_rest' => $total_rest, + 'total_ot_rest' => $total_ot_rest, + 'total_ot_rest_hour' => $get_ot_rest['perhour'], + 'total_public' => $total_public, + 'total_ot_public' => $total_ot_public, + 'total_ot_public_hour' => $get_ot_public['perhour'], + 'total_public_nor' => $total_public_nor, + 'total_medical' => $total_medical, + 'total_annual' => $total_annual, + 'total_allo_food' => $total_allo_food, + 'total_allowance' => $allo, + 'total_earn' => $total_earn, + 'total_charge' => $charge, + 'total_unpaid_leave' => $total_unpaid_leave, + 'total_salary' => $total_salary + ] ; +} + +function zeroToEmpty( $value ){ + return ( $value > 0 ? $value : '' ) ; +} + + +function commonAddTime( $start, $end ){ + + // explode + $end = strtotime($end) ; + $hours = date('H', $end) ; + $minutes = date('i', $end) ; + $seconds = date('s', $end) ; + $interval = 'PT'.$hours.'H'.$minutes.'M'.$seconds.'S' ; // P开头代表日期, T=时间, Y=Year...,Sample : P2Y4DT6H8M + + $start = new DateTime($start) ; + $start = $start->add( new DateInterval($interval) ) ; + $start = $start->format('H:i:s') ; + return $start ; +} + +function resetStatus( $value ){ + switch ( $value ){ + case 'inactive' : return 'Inactive' ; break ; + case 'pending' : + case 'awaiting-arrival' : + case 'awaiting-collection' : return 'Pending' ; break ; + case 'cancelled' : return 'Cancelled' ; break ; + case 'active' : return 'Active' ; break ; + case 'approved' : return 'Approved' ; break ; + case 'confirmed' : return 'Confirmed' ; break ; + case 'rated' : return 'Rated' ; break ; + case 'rejected' : return 'Rejected' ; break ; + } +} + +function taskStatusButton( $status ){ + switch ($status) { + case 'visited': + case 'completed': + $status = ''; + break; + case 'tested': + case 'progress': + $status = ''; + break; + case 'tested-rejected' : + case 'rejected': + $status = ''; + break; + case 'tested-approved' : + case 'approved': + $status = ''; + break; + case 'pending': + $status = ''; + break; + case 'assigned': + $status = ''; + break; + default: + $status = ''; + break; + } + + return $status; +} + +function setDifficulty( $value ){ + switch ( $value ) { + case 'normal': + $color = 'darkgreen'; + break; + case 'medium': + $color = 'blueviolet'; + break; + case 'high': + $color = 'blue'; + break; + case 'extremely': + $color = 'orange'; + break; + case 'urgent': + $color = 'red'; + break; + + default: + $color = 'black'; + break; + } + + return $color; +} + +function resetTaskType( $task_type ){ + switch($task_type){ + case '1time': + $task_type = 'One Time Only'; + break; + case 'daily': + $task_type = 'Daily Update'; + break; + case 'weekly': + $task_type = 'Weekly Update'; + break; + case 'monthly': + $task_type = 'Monthly Update'; + break; + case 'yearly': + $task_type = 'Yearly Update'; + break; + default: + $task_type = '-'; + break; + } + + return $task_type; +} + +function getDepartmentName( $department_id ){ + global $mysqli; + + $mysqli_department = $mysqli->query("SELECT b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.department_id = '".$department_id."'"); + $row_department = $mysqli_department->fetch_assoc(); + $department_name = $row_department['department_desc']; + + return $department_name; +} + +function getStaffName( $staff_id ){ + global $mysqli; + + $staff_name = '' ; + + $mysqli_staff = $mysqli->query("SELECT staff_name, staff_idno FROM staff WHERE staff_id = '".$staff_id."' LIMIT 1") ; + if ( $mysqli_staff->num_rows > 0 ){ + $row_staff = $mysqli_staff->fetch_assoc() ; + $staff_name = dataFilter( $row_staff['staff_name'] ) . ' ('.$row_staff['staff_idno'].')' ; + } + + return $staff_name; +} + +function getStaffPoint( $staff_id ){ + global $mysqli ; + + $select = $mysqli->query( "SELECT balance FROM staff_point_movement + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' ORDER BY movement_id DESC LIMIT 1" ) ; + $balance = 0 ; + if ( $select->num_rows > 0 ){ + $row = $select->fetch_assoc() ; + $balance = $row['balance'] ; + } + + return $balance ; +} + +function pointMovement( $from_table, $from_id, $type, $difficulty, $staff_id, $amount, $remark ){ + global $mysqli ; + + $result = false ; + + $select = $mysqli->query( "SELECT point_id, point_value FROM setting_point + WHERE deleted_at IS NULL AND point_from = '".$from_table."' AND point_type = '".$type."' AND difficulty = '".$difficulty."' LIMIT 1" ) ; + + if ( $select->num_rows > 0 ){ + + $select_staff = $mysqli->query( "SELECT staff_point_achievement, staff_point FROM staff a + WHERE a.deleted_at IS NULL AND a.staff_id = '".$staff_id."' AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL ) LIMIT 1" ) ; + + + if ( $select_staff->num_rows > 0 ){ + + $staff = $select_staff->fetch_assoc() ; + + $row_select = $select->fetch_assoc() ; + $reference_id = $row_select['point_id'] ; + $amount = ( $row_select['point_value'] + $amount ) ; + + if ( $amount < 0 || $amount > 0 ){ + + // set staff point + $select = $mysqli->query( "SELECT balance FROM staff_point_movement + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' ORDER BY movement_id DESC LIMIT 1" ) ; + $before = 0 ; + if ( $select->num_rows > 0 ){ + $row = $select->fetch_assoc() ; + $before = $row['balance'] ; + } + + // if ( $before == $staff['staff_point'] ){ + + $balance = ( $before + $amount ) ; + + $mysqli->query( "INSERT INTO staff_point_movement + ( staff_id, reference_id, from_table, from_id, before_amount, amount, balance, remark ) VALUES + ( '".$staff_id."', '".$reference_id."', '".$from_table."', '".$from_id."', '".$before."', '".$amount."', '".$balance."', '".$remark."' )" ) ; + + + + + + // set staff star + $update_query = '' ; + $staff_star = 0 ; + $point_achievement = $staff['staff_point_achievement'] ; + $list_allow_achievement = [ 'hr', 'task', 'adjustment' ] ; + + if ( in_array( $from_table, $list_allow_achievement ) ){ + $point_achievement = ( $point_achievement + $amount ) ; + $point_achievement2 = $point_achievement ; + + // check current start get + $boolean_achievement = true ; + if ( $point_achievement2 >= 50 ){ + while ( $boolean_achievement ){ + $staff_star += 0.5 ; + $point_achievement2 -= 50 ; + + if ( $point_achievement2 < 50 ){ + $boolean_achievement = false ; + } + } + } + + + // set staff achievement + $total_star = 0 ; + $select_monthly = $mysqli->query( "SELECT SUM(staff_star) as total_star FROM staff_monthly_achievement + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND reported_at LIKE '%".date('Y-')."%'" ) ; + + if ( $select_monthly->num_rows > 0 ){ + $row_monthly = $select_monthly->fetch_assoc() ; + $total_star = ( $row_monthly['total_star'] != null ? $row_monthly['total_star'] : 0 ) ; + } + + $total_star = ( $total_star + $staff_star ) ; + $staff_achievement = 'beginner' ; + + // get profile achievement + $select_achievement = $mysqli->query( "SELECT code, star_from, star_to FROM profile_achievement WHERE deleted_at IS NULL" ) ; + if ( $select_achievement->num_rows > 0 ){ + while ( $row_achievement = $select_achievement->fetch_assoc() ){ + if ( $total_star >= $row_achievement['star_from'] && $total_star < $row_achievement['star_to'] ){ + $staff_achievement = $row_achievement['code'] ; + } + } + } + + $update_query = " + staff_point_achievement = '".$point_achievement."', + staff_star = '".$staff_star."', + staff_achievement = '".$staff_achievement."'," ; + } + + $mysqli->query( "UPDATE staff SET + ".$update_query." + staff_point = '".$balance."' + WHERE staff_id = '".$staff_id."'" ) ; + + $result = true ; + + // } + } + } + } + + return $result ; +} + +function walletMovement( $from_table, $from_id, $type, $difficulty, $staff_id, $amount, $remark ){ + global $mysqli ; + + $result = false ; + + $select = $mysqli->query( "SELECT wallet_id, wallet_value FROM setting_wallet + WHERE deleted_at IS NULL AND wallet_from = '".$from_table."' AND wallet_type = '".$type."' AND difficulty = '".$difficulty."' LIMIT 1" ) ; + + if ( $select->num_rows > 0 ){ + + $select_staff = $mysqli->query( "SELECT staff_wallet FROM staff a + WHERE a.deleted_at IS NULL AND a.staff_id = '".$staff_id."' AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL ) LIMIT 1" ) ; + + + if ( $select_staff->num_rows > 0 ){ + + $staff = $select_staff->fetch_assoc() ; + + $row_select = $select->fetch_assoc() ; + $reference_id = $row_select['wallet_id'] ; + $amount = ( $row_select['wallet_value'] + $amount ) ; + + if ( $amount < 0 || $amount > 0 ){ + + // set staff wallet + $select = $mysqli->query( "SELECT balance FROM staff_wallet_movement + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' ORDER BY movement_id DESC LIMIT 1" ) ; + $before = 0 ; + if ( $select->num_rows > 0 ){ + $row = $select->fetch_assoc() ; + $before = $row['balance'] ; + } + + // if ( $before == $staff['staff_wallet'] ){ + + $balance = ( $before + $amount ) ; + + $mysqli->query( "INSERT INTO staff_wallet_movement + ( staff_id, reference_id, from_table, from_id, before_amount, amount, balance, remark ) VALUES + ( '".$staff_id."', '".$reference_id."', '".$from_table."', '".$from_id."', '".$before."', '".$amount."', '".$balance."', '".$remark."' )" ) ; + + $mysqli->query( "UPDATE staff SET + staff_wallet = '".$balance."' + WHERE staff_id = '".$staff_id."'" ) ; + + $result = true ; + + // } + } + } + } + + return $result ; +} + +function call( $type, $host, $method, $path, $params, $more_curl = [], $port = '443', $connectTimeout = 0 ){ + + switch ( $type ){ + case 'curl' : + case 'curl-gzip' : + + $curl = curl_init() ; + curl_setopt_array( $curl, array( + CURLOPT_URL => $host, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => $connectTimeout, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => $method, + CURLOPT_POSTFIELDS => http_build_query($params), + CURLOPT_HTTPHEADER => $path, + CURLOPT_ENCODING => 'gzip' + ) + $more_curl ) ; + + $response = curl_exec($curl) ; + $result = json_decode( $response, true ) ; + curl_close($curl) ; + + return $result ; + + break ; + case 'curl-json' : + $path[] = 'Content-Type:application/json' ; + + $curl = curl_init() ; + curl_setopt_array( $curl, array( + CURLOPT_URL => $host, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => $connectTimeout, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => $method, + CURLOPT_POSTFIELDS => json_encode( $params ), + CURLOPT_HTTPHEADER => $path, + CURLOPT_ENCODING => 'gzip' + ) + $more_curl ) ; + + $response = curl_exec($curl) ; + $result = json_decode( $response, true ) ; + curl_close($curl) ; + + return $result ; + + break ; + case 'file-contents' : + + $status = '200' ; + $message = '' ; + $data = [] ; + + $params = http_build_query($params) ; + $opts = [] ; + + if ( $method == 'POST' ){ + $opts = array('http' => + array( + 'method' => $method, + 'header' => 'Content-Type: application/x-www-form-urlencoded', + 'content' => $params + ) + ) ; + }else{ + $host .= '?'.$params ; + } + + $context = stream_context_create($opts) ; + $result = file_get_contents( $host, false, $context ) ; + $data = json_decode( $result, true ) ; + + return [ + 'status' => $status, + 'message' => $message, + 'data' => $data + ] ; + + break ; + case 'no-response' : + + $status = '500' ; + $message = '' ; + $data = [] ; + + $host = str_replace( [ 'http://', 'https://', 'www.' ], '', $host ) ; + $server = str_replace( '/', '', $host ) ; + $params = http_build_query($params) ; + + if ( $port == '443' ){ $server = 'ssl://'.$server ; } + + $fp = fsockopen( $server, $port, $errorCode, $errorInfo, $connectTimeout ) ; + + if ( !$fp ) { + $message = $errorInfo . ' ( '.$errorCode.' )' ; + } else { + + $http .= "$method $path HTTP/1.1\r\n" ; + $http .= "Host: $host\r\n" ; + $http .= "Content-type: application/x-www-form-urlencoded\r\n" ; + $http .= "Content-length: ".strlen($params)."\r\n" ; + $http .= "Connection: close\r\n\r\n" ; + $http .= $params."\r\n\r\n" ; + + if ( fputs( $fp, $http ) === false ){ + $message = 'Request failed.' ; + }else{ + $status = '200' ; + $message = 'Success' ; + + while (!feof($fp)) { + $data[] = fgets( $fp, 128 ) ; + } + } + + fclose($fp) ; + } + + return [ + 'status' => $status, + 'message' => $message, + 'data' => $data + ] ; + + break ; + } +} + +function showMessage( $status, $message ){ + $script = '' ; + if ( checkExists($status) ){ + + if ( $status <= '200' ){ + $script .= 'toastr.success("'.$message[$status].'") ;' ; + }else{ + $script .= 'toastr.error("'.$message[$status].'") ;' ; + } + + $script = '$(function(){ '.$script.' }) ;' ; + + unset($_SESSION['error']) ; + } + return $script ; +} + +function setSecret( $value ){ + return md5( COMPANY . $value . SECRETKEY ) ; +} + +function json_return( $status, $data = [] ){ + return [ + 'status' => $status, + 'data' => $data + ] ; +} + + + +function saveLog( $file, $name, $request, $response ){ + + $path = __DIR__ . '/../logs/' ; + + $year_folder = $path . date('Y', time()) . '/' ; + $month_folder = $year_folder . date('m', time()) . '/' ; + $day_folder = $month_folder . date('d', time()) . '/' ; + + if ( !file_exists($year_folder) ){ mkdir($year_folder, 0751) ; } + if ( !file_exists($month_folder) ){ mkdir($month_folder, 0751) ; } + if ( !file_exists($day_folder) ){ mkdir($day_folder, 0751) ; } + + $file_name = $day_folder . date('H') . '-' . $file . '.txt' ; + if ( file_exists($file_name) ) { + $fh = fopen($file_name, 'a') ; + } else { + $fh = fopen($file_name, 'w') ; + } + + $log = '=====================================' . "\r\n" . + 'CALL ::: ' . $name . "\r\n" . + 'URL ::: ' . $_SERVER["REQUEST_URI"] . "\r\n" . + 'TIME START ::: ' . TODAYDATE."\r\n" . + 'TIME END ::: ' . date('Y-m-d H:i:s', time()) . "\r\n" . + 'REQUEST ::: ' . json_encode($request) . "\r\n" . + 'RESPONSE ::: ' . json_encode($response) . "\r\n" . + '=====================================' . "\r\n\r\n\r\n\r\n\r\n" ; + fwrite( $fh, $log ) ; + fclose( $fh ) ; + + // fwrite($fh, '====================================='."\r\n") ; + // fwrite($fh, 'CALL ::: '.$name."\r\n") ; + // fwrite($fh, 'URL ::: '.$_SERVER["REQUEST_URI"]."\r\n") ; + // fwrite($fh, 'TIME START ::: '.TODAYDATE."\r\n") ; + // fwrite($fh, 'TIME END ::: '.date('Y-m-d H:i:s', time())."\r\n") ; + // fwrite($fh, 'REQUEST ::: '.json_encode($request)."\r\n") ; + // fwrite($fh, 'RESPONSE ::: '.json_encode($response)."\r\n") ; + // fwrite($fh, '====================================='."\r\n\r\n\r\n\r\n\r\n") ; + // fclose($fh) ; + +} + + + + + + + + + + + + +function getTaskRelatedStaff( $task_id, $created_by, $assigned_by ){ + global $mysqli ; + + $push_staffid[$created_by] = $created_by ; + $push_staffid[$assigned_by] = $assigned_by ; + + $select = $mysqli->query( "SELECT * FROM task_joinstaff + WHERE task_id = '".$task_id."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $push_staffid[$row['staff_id']] = $row['staff_id'] ; + } + } + + return $push_staffid ; +} + +function getMonthlyAchievement( $year, $staff_id ){ + global $mysqli ; + + $list = [] ; + for ( $a = 1 ; $a <= 12 ; $a++ ){ + $month = strPad(2, $a) ; + $reported_at = date( 'Y-m-d', strtotime( $year.'-'.$month.'-01' ) ) ; + $list[$month] = [ + 'reported_at' => $reported_at, + 'staff_point_achievement' => 0, + 'staff_star' => 0, + 'staff_achievement' => 0 + ] ; + } + + $select = $mysqli->query( "SELECT reported_at, staff_point_achievement, staff_star, staff_achievement FROM staff_monthly_achievement + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND reported_at LIKE '%".$year."-%' + ORDER BY created_at ASC" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $month = date( 'm', strtotime( $row['reported_at'] ) ) ; + $list[$month] = $row ; + } + } + + return $list ; +} + + +function sendEmail( $to, $from, $title, $body ){ + $header = 'From: "'.$from.'" <'.$from .'>'.PHP_EOL. + 'MIME-Version: 1.0'.PHP_EOL. + 'Content-type: text/html; charset=utf-8'.PHP_EOL. + 'Content-Transfer-Encoding: 8bit'.PHP_EOL. + 'X-Mailer: PHP/'.PHP_VERSION.PHP_EOL ; // send to owner + mail( $to, $title, $body, $header ) ; +} + +function getWork( $type, $selected_day, $morning_in, $morning_out, $break_in, $afternoon_out, $shortbreak_in, $night_out, $working_ot_start ){ + + $list_work = '00:00:00' ; + $list_ot = '00:00:00' ; + + if ( $type == 'normal' ){ + + $total_break = '00:00:00' ; + $total_shortbreak = '00:00:00' ; + $total_ot = '00:00:00' ; + + // check last out + if ( $night_out == '00:00:00' ){ + $night_out = $afternoon_out ; + } + + if ( $night_out == '00:00:00' ){ + $night_out = $morning_out ; + } + + if ( $night_out == '00:00:00' ){ + $night_out = $morning_in ; + } + + // get total working hours + $start = new DateTime($morning_in) ; + $end = new DateTime($night_out) ; + $total_work = $start->diff($end)->format('%H:%I:%S') ; + + // total break + if ( $morning_out != '00:00:00' && $break_in != '00:00:00' ){ + $start = new DateTime($morning_out) ; + $end = new DateTime($break_in) ; + $total_break = $start->diff($end)->format('%H:%I:%S') ; + } + + // total short break + if ( $afternoon_out != '00:00:00' && $shortbreak_in != '00:00:00' ){ + $start = new DateTime($afternoon_out) ; + $end = new DateTime($shortbreak_in) ; + $total_shortbreak = $start->diff($end)->format('%H:%I:%S') ; + } + + // if staff no ot + if ( $night_out > $working_ot_start ){ + + // total ot + // working_ot_start -> 19:00 + // afternoon_out -> 18:00 + $start = new DateTime($working_ot_start) ; + $end = new DateTime($night_out) ; + $total_ot = $start->diff($end)->format('%H:%I:%S') ; + + $total_subot = '00:00:00' ; + if ( $morning_out > $working_ot_start && $break_in != '00:00:00' ){ + $start = new DateTime($morning_out) ; + $end = new DateTime($break_in) ; + $total_subot = $start->diff($end)->format('%H:%I:%S') ; + } + $total_ot = subtractTime( $total_ot, $total_subot ) ; + + $total_subot = '00:00:00' ; + if ( $afternoon_out > $working_ot_start && $shortbreak_in != '00:00:00' ){ + $start = new DateTime($afternoon_out) ; + $end = new DateTime($shortbreak_in) ; + $total_subot = $start->diff($end)->format('%H:%I:%S') ; + } + $total_ot = subtractTime( $total_ot, $total_subot ) ; + } + + $total_ot = roundOt( $total_ot ) ; + + // count total work & ot + $list_work = subtractTime( $total_work, $total_break ) ; + $list_work = subtractTime( $list_work, $total_shortbreak ) ; + $list_work = subtractTime( $list_work, $total_ot ) ; + $list_ot = $total_ot ; + + } + + if ( $type == 'weekend' || $type == 'holiday' ){ + + $first = '00:00:00' ; + $second = '00:00:00' ; + $third = '00:00:00' ; + + if ( $morning_in != '00:00:00' && $morning_out != '00:00:00' ){ + $start = new DateTime($morning_in) ; + $end = new DateTime($morning_out) ; + $first = $start->diff($end)->format('%H:%I:%S') ; + } + + if ( $break_in != '00:00:00' && $afternoon_out != '00:00:00' ){ + $start = new DateTime($break_in) ; + $end = new DateTime($afternoon_out) ; + $second = $start->diff($end)->format('%H:%I:%S') ; + } + + if ( $shortbreak_in != '00:00:00' && $night_out != '00:00:00' ){ + $start = new DateTime($selected_day.' '.$shortbreak_in) ; + $end = new DateTime($selected_day.' '.$night_out) ; + if ( $shortbreak_in > $night_out ){ + $end->modify('+1 day'); + } + $third = $start->diff($end)->format('%H:%I:%S') ; + } + + $list_work = addTime( $first, $second ) ; + $list_work = addTime( $list_work, $third ) ; + + } + + $total_work = addTime( $list_work, $list_ot ) ; + + return [ + 'total' => $total_work, + 'work' => $list_work, + 'ot' => $list_ot + ] ; +} + +function roundOt( $ot ){ + + $ot = explode(':', $ot) ; + $ot_h = $ot['0'] ; + $ot_m = $ot['1'] ; + + if ( $ot_m < 15 ){ + $ot_m = '00' ; + }elseif ( $ot_m < 30 ){ + $ot_m = '15' ; + }elseif ( $ot_m < 45 ){ + $ot_m = '30' ; + }elseif ( $ot_m < 60 ){ + $ot_m = '45' ; + } + + return $ot_h.':'.$ot_m.':00' ; +} + +function getTotalHour( $start, $end ){ + $start = new DateTime($start) ; + $end = new DateTime($end) ; + return $start->diff($end)->format('%H:%I:%S') ; ; +} + +function calculateAllHours( $hoursList ){ + + // Initialize a DateInterval object with 0 hours + $totalInterval = new DateInterval('PT0S'); + + // Loop through the list of hours and add each one to the total + foreach ($hoursList as $hour) { + list($h, $m, $s) = explode(':', $hour); + $totalInterval->h += (int)$h; + $totalInterval->i += (int)$m; + $totalInterval->s += (int)$s; + } + + // Normalize the DateInterval + $totalInterval->i += floor($totalInterval->s / 60); + $totalInterval->s = $totalInterval->s % 60; + $totalInterval->h += floor($totalInterval->i / 60); + $totalInterval->i = $totalInterval->i % 60; + + // Format the total hours + $totalHoursFormatted = $totalInterval->format('%H:%I:%S'); + + // Format the total hours + return $totalHoursFormatted ; +} + +function getRest( $morning_out, $break_in, $afternoon_out, $shortbreak_in ){ + + $list_rest = '00:00:00' ; + + if ( $morning_out != '00:00:00' && $break_in != '00:00:00' ){ + $start = new DateTime($morning_out) ; + $end = new DateTime($break_in) ; + $list_rest = $start->diff($end)->format('%H:%I:%S') ; + } + + if ( $afternoon_out != '00:00:00' && $shortbreak_in != '00:00:00' ){ + $start = new DateTime($afternoon_out) ; + $end = new DateTime($shortbreak_in) ; + $list_rest2 = $start->diff($end)->format('%H:%I:%S') ; + $list_rest = addTime( $list_rest, $list_rest2 ) ; + } + return $list_rest ; +} + +function getLate( $list_late, $break, $working, $check_out, $check_in ){ + + // get break hours + if ( $break != '00:00:00' && $working != '00:00:00' ){ + + // get working break hours + $start = new DateTime($break) ; + $end = new DateTime($working) ; + $get_working_break = $start->diff($end)->format('%H:%I:%S') ; + $get_check_break = '00:00:00' ; + + if ( $check_out != '00:00:00' && $check_in != '00:00:00' ){ + // get check in & out break hours + $start = new DateTime($check_out) ; + $end = new DateTime($check_in) ; + $get_check_break = $start->diff($end)->format('%H:%I:%S') ; + } + + // check if late + $get_working_break = date('H:i:s', strtotime($get_working_break.' +5 minutes')) ; + if ( $get_check_break > $get_working_break ){ + $start = new DateTime($get_check_break) ; + $end = new DateTime($get_working_break) ; + $get_working_break = $start->diff($end)->format('%H:%I:%S') ; + $list_late = addTime( $list_late, $get_working_break ) ; + } + } + + $list_late = date('H:i', strtotime($list_late)) ; + return $list_late ; +} + +function addTime( $start, $end ){ + + // explode + $end = strtotime($end) ; + $hours = date('H', $end) ; + $minutes = date('i', $end) ; + $seconds = date('s', $end) ; + $interval = 'PT'.$hours.'H'.$minutes.'M'.$seconds.'S' ; // P开头代表日期, T=时间, Y=Year...,Sample : P2Y4DT6H8M + + $start = new DateTime($start) ; + $start = $start->add( new DateInterval($interval) ) ; + $start = $start->format('H:i:s') ; + return $start ; +} + +function subtractTime( $start, $end ){ + + // explode + $end = strtotime($end) ; + $hours = date('H', $end) ; + $minutes = date('i', $end) ; + $seconds = date('s', $end) ; + $interval = 'PT'.$hours.'H'.$minutes.'M'.$seconds.'S' ; // P开头代表日期, T=时间, Y=Year...,Sample : P2Y4DT6H8M + + $start = new DateTime($start) ; + $start = $start->sub( new DateInterval($interval) ) ; + $start = $start->format('H:i:s') ; + return $start ; +} + + + + + + + + + + + + + + +function getTotalMonth( $date1, $date2 ){ + $ts1 = strtotime( $date1 ) ; + $ts2 = strtotime( $date2 ) ; + + $year1 = date( 'Y', $ts1 ) ; + $year2 = date( 'Y', $ts2 ) ; + + $month1 = date( 'm', $ts1 ) ; + $month2 = date( 'm', $ts2 ) ; + + $diff = ( ( $year2 - $year1 ) * 12 ) + ( $month2 - $month1 ) ; + return $diff ; +} + + + + +function setStaffLeaveYear($staff_id){ + global $mysqli ; + + // check if staff exists or not + $get_staff = $mysqli->query("SELECT staff_date_joined, staff_date_confirmed, leave_id, sick_id, job_status_id FROM staff + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' LIMIT 1") ; + if ( $get_staff->num_rows > 0 ){ + + $staff = $get_staff->fetch_assoc() ; + + $staff_date_joined = $staff['staff_date_joined'] ; + $staff_date_confirmed = $staff['staff_date_confirmed'] ; + $job_status_id = $staff['job_status_id'] ; + $date_joined_month = 0 ; + + // default setting + $current_year = date( 'Y', strtotime(TODAYDATE) ) ; + $current_month = date( 'm', strtotime(TODAYDATE) ) ; + $given_date = $current_year.'-'.$current_month.'-01' ; + + $divide_month = '' ; + switch ( LEAVESETTING ){ + case 'quaterly' : + switch ( $current_month ){ + case 1 : + $divide_month = 3 ; + break ; + case 4 : + $divide_month = 6 ; + break ; + case 7 : + $divide_month = 9 ; + break ; + case 10 : + $divide_month = 12 ; + break ; + } + break ; + case 'month' : + default : + $divide_month = $current_month ; + } + + if ( $staff_date_joined != null && $staff_date_joined != '0000-00-00' ){ + + + // insert into list, check if exsits + // for unpaid leave + $unpaid_days = 365 ; + $get_leave_year = $mysqli->query("SELECT leave_year_id FROM staff_leave_year + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND leave_type = 'unpaid' AND leave_year = '".$current_year."' LIMIT 1") ; + if ( $get_leave_year->num_rows == 0 ){ + $mysqli->query("INSERT INTO staff_leave_year + (staff_id, leave_type, leave_year, leave_year_from, leave_year_to, leave_record_days, leave_given_days, leave_days, created_at, updated_at) VALUES + ('".$staff_id."', 'unpaid', '".$current_year."', '".$current_year."-01-01', '".$current_year."-12-31', '".$unpaid_days."', '".$unpaid_days."', '".$unpaid_days."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + + + + + + + + + + // insert into list, check if exsits + // sick leave + $date_joined_year = date('Y', strtotime($staff_date_joined)) ; + $date_joined_first = $current_year.'-01-01' ; + + if ( $date_joined_first > $staff_date_joined ){ + $date_joined_end = $date_joined_first ; + }else{ + $date_joined_end = $staff_date_joined ; + } + + $date_joined_month = getTotalMonth( $staff_date_joined, $date_joined_end ) ; + + // sick + $sick_days = 0 ; + if ( $staff['sick_id'] != '0' ){ + $get_sick = $mysqli->query("SELECT sick_rules FROM setting_sick + WHERE sick_id = '".$staff['sick_id']."' LIMIT 1") ; + if ( $get_sick->num_rows > 0 ){ + $row_sick = $get_sick->fetch_assoc() ; + $sick_rules = jsonEncodeDecode('decode', $row_sick['sick_rules']) ; + if ( is_array($sick_rules) ){ + foreach ( $sick_rules as $value ){ + if ( $date_joined_month >= $value['more_from'] && $date_joined_month < $value['more_to'] ){ + $sick_days = $value['more_days'] ; + } + } + } + } + } + + // update into db + $get_sick_year = $mysqli->query("SELECT leave_year_id FROM staff_leave_year + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND leave_type = 'sick' AND leave_year = '".$current_year."' LIMIT 1") ; + if ( $get_sick_year->num_rows == 0 ){ + $mysqli->query("INSERT INTO staff_leave_year + (staff_id, leave_type, leave_year, leave_year_from, leave_year_to, leave_record_days, leave_given_days, leave_days, created_at, updated_at) VALUES + ('".$staff_id."', 'sick', '".$current_year."', '".$current_year."-01-01', '".$current_year."-12-31', '".$sick_days."', '".$sick_days."', '".$sick_days."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + + + // 1 = confirmed + // 2 = under probation + // 3 = training / internship + if ( $job_status_id == '1' && ( $staff_date_confirmed != null && $staff_date_confirmed != '0000-00-00' ) ){ + + // insert into list, check if exsits + // annual leave + $date_joined_from = $current_year.'-01-01' ; + $date_joined_to = $current_year.'-12-31' ; + + if ( $date_joined_from > $staff_date_joined ){ + $date_joined_end = $date_joined_from ; + }else{ + $date_joined_end = $staff_date_joined ; + } + + $date_joined_month = getTotalMonth( $staff_date_joined, $date_joined_end ) ; + $date_joined_realmonth = getTotalMonth( $staff_date_joined, TODAYDATE ) ; + + if ( LEAVEMONTHTYPE == '2' ){ + $date_joined_month = $date_joined_realmonth ; + } + + $annual_days = 0 ; + $more_give_days = 0 ; + + // annual + if ( $staff['leave_id'] != '0' ){ + $get_annual = $mysqli->query("SELECT leave_rules FROM setting_leave + WHERE leave_id = '".$staff['leave_id']."' LIMIT 1") ; + if ( $get_annual->num_rows > 0 ){ + $row_annual = $get_annual->fetch_assoc() ; + $annual_rules = jsonEncodeDecode('decode', $row_annual['leave_rules']) ; + + if ( is_array($annual_rules) ){ + foreach ( $annual_rules as $value ){ + if ( $date_joined_month >= $value['more_from'] && $date_joined_month < $value['more_to'] ){ + + $current_minus_month = ( $current_month - 1 ) ; + $default_given_day = 0 ; + if ( $current_minus_month > 0 ){ + $default_given_day = numberFormat( ( $value['more_days'] / 12 * $current_minus_month ) , 2 ) ; + + $default_given_day = ( numberFormat( ( $value['more_days'] / 12 * $current_minus_month ) , 2 ) - $total_leave_month ) ; + } + + $days = 0 ; + $boolean_day = true ; + while ( $boolean_day ){ + if ( $default_given_day >= 1 ){ + $default_given_day -= 1 ; + $days++ ; + }else{ + $boolean_day = false ; + } + } + + $annual_days = ( $value['more_days'] - $days ) ; + $more_give_days = $value['more_days'] ; + } + } + } + } + } + + // insert into list, check if exsits + $get_leave_year = $mysqli->query("SELECT leave_year_id, leave_record_days FROM staff_leave_year + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND leave_type = 'annual' AND leave_year = '".$current_year."' LIMIT 1") ; + if ( $get_leave_year->num_rows == 0 ){ + $mysqli->query("INSERT INTO staff_leave_year + (staff_id, leave_type, leave_year, leave_year_from, leave_year_to, leave_record_days, leave_given_days, leave_days, created_at, updated_at) VALUES + ('".$staff_id."', 'annual', '".$current_year."', '".$date_joined_from."', '".$date_joined_to."', '".$annual_days."', '0', '0', '".TODAYDATE."', '".TODAYDATE."')") ; + }else{ + if ( ( $date_joined_realmonth - 12 ) > 0 && ( $date_joined_realmonth - 12 ) < 12 ){ + $row_leave_year = $get_leave_year->fetch_assoc() ; + + $mysqli->query("UPDATE staff_leave_year SET + leave_record_days = '".$more_give_days."', + leave_yearup = '1' + WHERE leave_year_id = '".$row_leave_year['leave_year_id']."' AND leave_yearup = '0'") ; + } + } + + + + // monthly given annual leave days + $get_leave_year = $mysqli->query("SELECT leave_year_id, leave_record_days FROM staff_leave_year + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND leave_type = 'annual' AND leave_year = '".$current_year."' LIMIT 1") ; + if ( $get_leave_year->num_rows > 0 ){ + $row_leave_year = $get_leave_year->fetch_assoc() ; + + if ( $divide_month != '' ){ + $get_leave_month = $mysqli->query( "SELECT * FROM staff_leave_month + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND leave_year_id = '".$row_leave_year['leave_year_id']."' AND given_month = '".$current_month."' LIMIT 1" ) ; + if ( $get_leave_month->num_rows == 0 ){ + + $get_total_leave_month = $mysqli->query( "SELECT SUM(given_day) as total FROM staff_leave_month + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND leave_year_id = '".$row_leave_year['leave_year_id']."' AND given_month <= '".$current_month."'" ) ; + + $row_total_leave_month = $get_total_leave_month->fetch_assoc() ; + $total_leave_month = $row_total_leave_month['total'] ; + $balance_leave_month = ( $row_leave_year['leave_record_days'] - $total_leave_month ) ; + + // check month setting, by month or by quaterly + $given_day = ( numberFormat( ( $row_leave_year['leave_record_days'] / 12 * $divide_month ) , 2 ) - $total_leave_month ) ; + + $days = 0 ; + $boolean_day = true ; + while ( $boolean_day ){ + if ( $given_day >= 1 ){ + $given_day -= 1 ; + $days++ ; + }else{ + $boolean_day = false ; + } + } + + $mysqli->query( "INSERT INTO staff_leave_month + ( leave_year_id, staff_id, given_month, given_day, given_date ) VALUES + ( '".$row_leave_year['leave_year_id']."', '".$staff_id."', '".$current_month."', '".$days."', '".$given_date."' )" ) ; + + if ( $days > 0 ){ + $mysqli->query( "UPDATE staff_leave_year SET + leave_given_days = leave_given_days + ".$days.", + leave_days = leave_days + ".$days." + WHERE leave_year_id = '".$row_leave_year['leave_year_id']."'" ) ; + } + + + } + } + + } + } + } + } +} + + + + + + + + + + + +function getCurrentCountry(){ + $myip = '' ; + if (!empty($_SERVER['HTTP_CLIENT_IP'])) { + $myip = $_SERVER['HTTP_CLIENT_IP'] ; + } + else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { + $myip = $_SERVER['HTTP_X_FORWARDED_FOR'] ; + } + else { + $myip = $_SERVER['REMOTE_ADDR'] ; + } + + $curl = curl_init() ; + curl_setopt_array($curl, array( + CURLOPT_URL => 'http://www.geoplugin.net/json.gp?ip=' . $myip, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'GET', + )); + $response = curl_exec($curl); + curl_close($curl) ; + + return json_decode( $response, true ) ; +} + + + + + + + + + + +function showTabs( $table, $key, $id, $list ){ + global $mysqli, $LANGS, $lang ; + + $lang_content = [] ; + + if ( $id != '' ){ + $select = $mysqli->query( "SELECT * FROM " . $table . " WHERE ".$key." = '".$id."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + foreach ( $list as $klist => $vlist ){ + $lang_content[$row['lang']][$klist] = $row[$klist] ; + } + } + } + } + + + $html = ' +
    + +
      ' ; + foreach ( $LANGS as $klang => $vlang ){ $html .= '
    • '.$vlang.'
    • ' ; } + $html .= ' +
    ' ; + + foreach ( $LANGS as $klang => $vlang ){ + $html .= ' +
    ' ; + + foreach ( $list as $klist => $vlist ){ + switch ( $vlist['type'] ){ + case 'input' : + + $html .= ' +
    +
    '.$vlist['title'].'
    +
    + +
    +
    ' ; + + break ; + case 'textarea' : + + $html .= ' +
    +
    '.$vlist['title'].'
    +
    + + +
    +
    ' ; + + break ; + case 'file' : + + $html .= ' +
    +
    '.$vlist['title'].'
    +
    +
    +
    + + +
    +
    + '.( $vlist['size'] != '' ? ''.$vlist['size'].'' : '' ).' +
    +
    ' ; + + if ( $lang_content[$klang][$klist] != '' ){ + $html .= ' +
    +
    '.$lang['preview'].'
    +
    + + + + +
    +
    ' ; + }else{ + $html .= '' ; + } + + break ; + } + } + + $html .= ' +
    ' ; + } + + $html .= ' +
    ' ; + + return $html ; +} + +function checkLangUpdate( $table, $key, $id, $lang, $list ){ + global $mysqli ; + + $select = $mysqli->query( "SELECT * FROM ".$table." WHERE ".$key." = '".$id."' AND lang = '".$lang."' LIMIT 1" ) ; + + // only query only + if ( $select->num_rows > 0 ){ + + $query_update = [] ; + foreach ( $list as $k => $v ){ + if ( $v['type'] != 'file' ){ + $query_update[] = $k . " = '" . $v['value'] . "'" ; + } + } + + $mysqli->query( "UPDATE ".$table." SET + ".implode(',', $query_update)." + WHERE ".$key." = '".$id."' AND lang = '".$lang."'" ) ; + + }else{ + + $query_key = '' ; + $query_value = '' ; + foreach ( $list as $k => $v ){ + if ( $v['type'] != 'file' ){ + $query_key .= ", " . $k ; + $query_value .= ", '" . $v['value'] . "'" ; + } + } + + $mysqli->query( "INSERT INTO ".$table." + ( ".$key.", lang ".$query_key." ) VALUES + ( '".$id."', '".$lang."' ".$query_value." )" ) ; + + } + + // upload file only + foreach ( $list as $k => $v ){ + if ( $v['type'] == 'file' ){ + + $image = $v['value']["name"] ; + $remove_photo = $v['remove_photo'] ; + + if ( $remove_photo == 1 ){ + $mysqli->query( "UPDATE ".$table." SET + ".$k." = '' + WHERE ".$key." = '".$id."' AND lang = '".$lang."'" ) ; + }else{ + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + $create_image = reCreateImage( $v['folder'], $lang, $id, '', $image, $v['value']['type'], $v['value']['tmp_name'] ) ; + + if ( $create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0 ){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach( $create_image['crop'] as $value ){ + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + + $mysqli->query( "UPDATE ".$table." SET + ".$k." = '".$create_image['image']."' + WHERE ".$key." = '".$id."' AND lang = '".$lang."'" ) ; + + } + } + + } + + } + } +} + +function uploadImageBased64($path, $file_name, $source, $file_type = ''){ + + $result = false ; + // $s = $_SERVER["DOCUMENT_ROOT"].'/Uploads/'.$path.'/'.$file_name ; + + $b = $_SERVER["DOCUMENT_ROOT"].'/uploads/'.$path.'/'.$file_name ; + + $data = explode( ',', $source ); + + $file = fopen($b, "wb"); //(you can put jpg, png or any other extension) + + fwrite($file, base64_decode($data[1])); + + fclose($file); + + // check file size + if(filesize($b) > 0){ + $result = true; + } + + return $result ; +} + +function fromExcelToLinux($excel_time) { + return date( 'Y-m-d', ($excel_time-25569)*86400 ) ; +} + +function mergeImageWithContent ( $file, $content ){ + $html = ' + + + + + + + + '.( $file != '' ? '' : '' ).' + '.$content.' + + ' ; + + return $html ; +} + +function resetGetParams( $parameter, $filterout ){ + $param = '' ; + foreach ( $parameter as $k => $v ){ + if ( $v != '' ){ + if ( !in_array( $k, $filterout ) ){ + $param .= '&'.$k.'='.$v ; + } + } + } + + return $param ; +} + +function calculateTax($type, $salary, $category, $category2){ + global $mysqli; + include '../read_csv.php'; + return $tax; +} + +function calculateTaxEPF($type, $salary, $age, $citizen){ + global $mysqli; + include '../read_csv.php'; + return $tax; +} + +function calculateTaxSOCSO($type, $salary, $category){ + global $mysqli; + include '../read_csv.php'; + return $tax; +} + +function calculateTaxEIS($type, $salary){ + global $mysqli; + include '../read_csv.php'; + return $tax; +} + +function calculateTaxZAKAT($salary, $rate){ + $tax = $salary * $rate / 100; + return $tax; +} + + +function roundNearestRinggit($number){ + if(fmod($number, 1) !== 0.0){ + $explode = explode(".", $number); + $return = $explode[0] + 1; + }else{ + $return = $number; + } + return $return; +} + +function userTierQuery( $user ){ + $tiers = [] ; + + if ( $user['user_tier'] != '' ){ + $temp = explode( ',', $user['user_tier'] ) ; + foreach ( $temp as $k => $v ){ + $temp_v = str_replace( [ '|' ], '', $v ) ; + $temp_v = trim( $temp_v ) ; + if ( $temp_v != '' ){ + $tiers[] = $temp_v ; + } + } + } + + if ( count($tiers) == 0 ){ + $tiers[] = -1 ; + } + + return [ + 'check' => ( $user['user_permission'] == 'admin' ? false : true ), + 'tiers' => $tiers + ] ; +} + +function rmsCall( $api, $array ){ + $data_post = 'POST' ; + $data_path = RMSAPIURL.$api ; + $data_content = $array ; + $data_content_json = json_encode( $data_content ) ; + $data_datetime = gmdate("Y-m-d\TH:i:s\Z") ; + $data_terminal = RMSAPITERMINAL ; + $data_terminal_base64 = base64_encode($data_terminal) ; + $data_key = RMSAPIKEY ; + + $post_data = $data_post . $data_path . $data_content_json . $data_datetime . $data_terminal ; + $signature = hash_hmac( "sha1", $post_data, RMSAPIKEY ) ; + $signaturetobase64 = base64_encode( $signature ) ; + + $call = call( 'curl-json', $data_path, $data_post, [ + 'Authorization: mol-req-sign '.$data_terminal_base64.':'.$signaturetobase64, + 'x-mol-date-time: '.$data_datetime + ], $data_content ) ; + + return $call ; +} + + + +function generateQrcode( $require_path, $qrcode, $qrcodegenerate ){ + require_once( $require_path.'plugins/phpqrcode/qrlib.php' ) ; + + $outputqrcode = $require_path.'qrcodes/'.$qrcode.'.png' ; + QRcode::png($qrcodegenerate, $outputqrcode, 'L', 10, 1) ; + + return [ + 'qrcode' => $qrcode, + 'url' => PATH.'qrcodes/'.$qrcode.'.png', + ] ; + + // return [ + // 'qrcode' => $qrcode, + // 'url' => 'https://chart.googleapis.com/chart?chs=500x500&cht=qr&chl='.$qrcode, + // ] ; +} +?> diff --git a/frontend/requires/page_footer.php b/frontend/requires/page_footer.php new file mode 100644 index 0000000..cfafefb --- /dev/null +++ b/frontend/requires/page_footer.php @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/frontend/requires/page_header.php b/frontend/requires/page_header.php new file mode 100644 index 0000000..6a30ad3 --- /dev/null +++ b/frontend/requires/page_header.php @@ -0,0 +1,40 @@ + + + + + + +<?= COMPANY ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/requires/page_top.php b/frontend/requires/page_top.php new file mode 100644 index 0000000..9c7f638 --- /dev/null +++ b/frontend/requires/page_top.php @@ -0,0 +1,680 @@ +query("SELECT * FROM system_post + WHERE post_type = 'website-page-menu' LIMIT 1") ; +// check table exsits +if ($mysqli_page_website->num_rows > 0){ + $row_page_website = $mysqli_page_website->fetch_array(MYSQLI_ASSOC) ; +} +?> + + +
    + + + + + +
    +
    + + + + query("SELECT * FROM branch + WHERE deleted_at IS NULL".$user_branch_permission_sql_123) ; + if ( $get_branch->num_rows > 0 ){ + if($row_user['user_permission'] == 'user'){ + + echo '
    + +
    '; + + } + } + $get_branch = $mysqli->query("SELECT * FROM branch + WHERE deleted_at IS NULL") ; + if ( $get_branch->num_rows > 0 ){ + if($row_user['user_permission'] == 'admin'){ + echo '
    + +
    '; + } + } + ?> +
    + query($mysqli_query." ORDER BY post_order") ; + if ($mysqli_notification->num_rows > 0){ + + $top_notification = '' ; + while ($row_notification = $mysqli_notification->fetch_array(MYSQLI_ASSOC)){ + $top_notification .= '
  • '.dataFilter($row_notification['post_title']) .'
  • ' ; + } + + echo ' + + +
      + '.$top_notification.' +
    ' ; + + } + ?> \ No newline at end of file diff --git a/frontend/requires/session.php b/frontend/requires/session.php new file mode 100644 index 0000000..fef5232 --- /dev/null +++ b/frontend/requires/session.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/frontend/requires/validate_login.php b/frontend/requires/validate_login.php new file mode 100644 index 0000000..791a1a4 --- /dev/null +++ b/frontend/requires/validate_login.php @@ -0,0 +1,40 @@ +query("SELECT user_code FROM system_user WHERE + user_name = '".$user."' AND user_trash = '0' LIMIT 1") ; + // check if user exists + if ($mysqli_user->num_rows > 0){ + // set query as array + $row_user = $mysqli_user->fetch_array(MYSQLI_ASSOC) ; + // encode password with md5 + code + $code = $row_user['user_code'] ; + // check if capcha corrent + $password = md5(md5($password).$code) ; + // query for user + $mysqli_user = $mysqli->query("SELECT user_id, user_name, user_code, user_permission, user_visit_count FROM system_user WHERE + user_name = '".$user."' AND user_password = '".$password."' AND user_trash = '0' LIMIT 1") ; + // check if user exists + if ($mysqli_user->num_rows > 0){ + echo 4 ; + }else{ + echo 2 ; + } + }else{ + echo 2 ; + } + exit ; + } +} +echo 'Page Error.' ; +?> \ No newline at end of file diff --git a/frontend/sftp-config.json b/frontend/sftp-config.json new file mode 100644 index 0000000..406a936 --- /dev/null +++ b/frontend/sftp-config.json @@ -0,0 +1,45 @@ +{ + // The tab key will cycle through the settings when first created + // Visit https://codexns.io/products/sftp_for_subime/settings for help + + // sftp, ftp or ftps + "type": "sftp", + + "save_before_upload": true, + "upload_on_save": true, + "sync_down_on_open": false, + "sync_skip_deletes": false, + "sync_same_age": false, + "confirm_downloads": false, + "confirm_sync": true, + "confirm_overwrite_newer": false, + + "host": "mrmsb.my", + "user": "mrsb", + "password": "7s=YsZgnrI}e", + "remote_path": "/home/mrsb/public_html/frontend/", + "port": "8288", + + "ignore_regexes": [ + "\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json", + "sftp-settings\\.json", "/venv/", "\\.svn/", "\\.jpg/", "\\.hg/", "\\.git/", + "\\.bzr", "_darcs", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini", "/Doc/", "/flags/", "/cgi-bin/", "/\\.well-known/", "/PHPExcel/", "/libphonenumber-for-php/", "/Plugins/", "/Ckeditor/", "/ckeditor/", "php\\.ini/" + ], + //"file_permissions": "664", + //"dir_permissions": "775", + + //"extra_list_connections": 0, + + "connect_timeout": 30, + //"keepalive": 120, + //"ftp_passive_mode": true, + //"ftp_obey_passive_host": false, + //"ssh_key_file": "~/.ssh/id_rsa", + //"sftp_flags": ["-F", "/path/to/ssh_config"], + + //"preserve_modification_times": false, + //"remote_time_offset_in_hours": 0, + //"remote_encoding": "utf-8", + //"remote_locale": "C", + //"allow_config_upload": false, +} diff --git a/hr-advance-print.php b/hr-advance-print.php new file mode 100644 index 0000000..e52445e --- /dev/null +++ b/hr-advance-print.php @@ -0,0 +1,240 @@ +query("SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $get_position->num_rows > 0 ){ + while ( $row_position = $get_position->fetch_assoc() ){ + $position[$row_position['job_position_id']] = $row_position['job_position_desc'] ; + } + } + + $mysqli_query = $mysqli->query("SELECT a.advance_id, a.advance_paidby, a.advance_amount, a.advance_reason, a.advance_status, a.advance_payment_status, a.advance_payment_date, a.created_at, a.updated_at, b.staff_id, b.staff_name, b.staff_idno, b.staff_accountno, b.staff_icno, b.staff_passportno, b.country_id,b.job_position_id FROM staff_advance a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.advance_id IN (".$page.") "); + + $letter_head = $letter_head['header'] ; + $letter_head = str_replace( '', '', $letter_head ) ; + $letter_head = str_replace( '  ', '', $letter_head ) ; + + $html = ' + + + + + ' ; + + if ($mysqli_query->num_rows > 0){ + while ($row_page = $mysqli_query->fetch_array(MYSQLI_ASSOC)){ + $staff_idno = ucwords($row_page['staff_idno']) ; + + // set body content + $html .= ' +
    + + + + + + + + + + +

    '.$letter_head.'

     

    Advanced Slip

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Employee ID:'.$staff_idno.' Date:'.( $row_page['advance_payment_date'] != '' ? date('d.m.Y',strtotime(dataFilter($row_page['advance_payment_date']))) : '-' ).'
    Name:'.dataFilter($row_page['staff_name']).'Department:'; + //department + $d_name = [] ; + $get_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM staff_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND staff_id = '".$row_page['staff_id']."'") ; + if($get_department->num_rows > 0){ + while ( $row_department = $get_department->fetch_assoc() ){ + $d_name[] = $row_department['department_desc']; + } + } + $html .= implode( ', ', $d_name ) ; + $html .= ' +
    Month:'.date('F Y',strtotime(dataFilter($row_page['created_at']))).' Position:'.dataFilter( $position[$row_page['job_position_id']] ).'
     

    Particulars

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Advanced '.dataFilter($row_page['advance_amount']).'
     
    TOTAL ADVANCE '.dataFilter($row_page['advance_amount']).'
     
    Nett pay '.dataFilter($row_page['advance_amount']).'
     
     
    Received By: 
    +
    '; + } + } + + $html .= ' + + ' ; + + //print pdf + include_once 'MPDF/mpdf.php' ; + $mpdf = new mPDF('utf-8', [ 215, 135 ], '', 'freesans', 0, 0, 0, 0, 0, 0) ; + + $mpdf->useAdobeCJK = true ; + $mpdf->SetAutoFont(AUTOFONT_ALL) ; + + // Use different Odd/Even headers and footers and mirror margins + $mpdf->mirrorMargins = 1 ; + + // set mpdf header + //$mpdf->SetHTMLHeader($header) ; + //$mpdf->SetHTMLHeader($header,'E') ; + + // set mpdf footer + $mpdf->SetHTMLFooter($footer) ; + $mpdf->SetHTMLFooter($footer,'E') ; + + // write in html + $mpdf->WriteHTML($html) ; + + // set filename + $page_filename = 'hr-advanced-'.time() ; + $filename = $page_filename ; // Your Filename whit local date and time + $filename_save = $filename.'.pdf' ; + $filename_jpeg = $filename.'.jpg' ; + $filename_temp = $filename ; + + // check output type + $page_type_output = ($page_type == 'jpeg' ? 'F' : 'I') ; + $mpdf->Output($filename_save, $page_type_output) ; + + // check page type + if ($page_type == 'jpeg'){ + //******************************************************************* + //******************************************************************* save pdf file to jpeg file + //******************************************************************* + $img = new imagick() ; + //this must be called before reading the image, otherwise has no effect - "-density {$x_resolution}x{$y_resolution}" + $img->setResolution(300,300) ; //this is important to give good quality output, otherwise text might be unclear + $img->readImage("{$filename_save}") ; //read the pdf + $total_page = $img->getNumberImages() ; + $img->setImageFormat('jpg') ; //set new format + $img->writeImages($filename_jpeg, true) ; //save image file + //******************************************************************* + //******************************************************************* force download jpeg file + //******************************************************************* + $file_name = $filename_jpeg ; // grab the requested file's name + // make sure it's a file before doing anything! + if ($total_page > 1){ + for ($i = 0; $i < $total_page; $i++){ + $file_name = $filename_temp.'-'.$i.'.jpg' ; + if(is_file($file_name)) { + $files_to_zip[] = $file_name ; + } + } + create_zip($files_to_zip, $filename_temp.'.zip') ; + for ($i = 0; $i < $total_page; $i++){ unlink($filename_temp.'-'.$i.'.jpg') ; } + $file_name = $filename_jpeg = $filename_temp.'.zip' ; + } + if(is_file($file_name)) { + // required for IE + if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'Off') ; } + // get the file mime type using the file extension + switch(strtolower(substr(strrchr($file_name, '.'), 1))) { + case 'pdf': $mime = 'application/pdf'; break ; + case 'zip': $mime = 'application/zip'; break ; + case 'jpeg': + case 'jpg': $mime = 'image/jpg'; break ; + default: $mime = 'application/force-download' ; + } + header('Pragma: public') ; // required + header('Expires: 0') ; // no cache + header('Cache-Control: must-revalidate, post-check=0, pre-check=0') ; + header('Last-Modified: '.gmdate ('D, d M Y H:i:s', filemtime ($file_name)).' GMT') ; + header('Cache-Control: private',false) ; + header('Content-Type: '.$mime) ; + header('Content-Disposition: attachment; filename="'.basename($file_name).'"') ; + header('Content-Transfer-Encoding: binary') ; + header('Content-Length: '.filesize($file_name)) ; // provide file size + header('Connection: close') ; + readfile($file_name); // push it out + } + unlink($filename_jpeg) ; + unlink($filename_save) ; + echo '' ; + } + +?> \ No newline at end of file diff --git a/hr-advance.php b/hr-advance.php new file mode 100644 index 0000000..94e78b4 --- /dev/null +++ b/hr-advance.php @@ -0,0 +1,841 @@ +query("SELECT * FROM master_country + WHERE deleted_at IS NULL") ; +if ( $get_country->num_rows > 0 ){ + while ( $row_country = $get_country->fetch_assoc() ){ + $country[$row_country['country_id']] = $row_country['country_desc'] ; + } +} + +// mode type | all list | new | edit +switch($page_mode){ + + // edit advance + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM staff_advance + WHERE advance_id = '".$page."' AND deleted_at IS NULL LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( !($row_page['advance_id']>0) && isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + $error_message = '
    Please enter all required field.
    ' ; + + $staff_id = escapeString($_POST['staff_id']) ; + $advance_paidby = escapeString($_POST['advance_paidby']) ; + $advance_amount = escapeString($_POST['advance_amount']) ; + $advance_reason = escapeString($_POST['advance_reason']) ; + + if ( ( ( $submit_type == 'new' && $staff_id != '' ) || $submit_type == 'edit' ) && $advance_paidby != '' && $advance_amount != '' ){ + + $advance_reason = ( $advance_reason != '' ? $advance_reason : 'ADVANCE' ) ; + + $error_message = '
    No setting found.
    ' ; + + $day = date('j', strtotime(TODAYDATE)) ; + + // check query exsits + $setting_query = $mysqli->query("SELECT post_id, post_title as advance_from, post_link as advance_to, post_content as advance_remark FROM system_post + WHERE post_type = 'page-advance' AND post_categories = 'page-advance' AND post_trash = '0' LIMIT 1") ; + $setting = [] ; + if ( $setting_query->num_rows > 0 ){ + $setting = $setting_query->fetch_assoc() ; + } + + $boolean_advance = false ; + if ( $setting['advance_from'] != '' ){ + if ( $setting['advance_from'] <= $day && $setting['advance_to'] >= $day ){ + $boolean_advance = true ; + } + }else{ + $boolean_advance = true ; + } + + if ( $setting['advance_remark'] != '' ){ + $error_message = '
    '.$setting['advance_remark'].'
    ' ; + } + + if ( $boolean_advance ){ + + $error = 0 ; + $mysqli->autocommit( false ) ; + + try { + + $amount = is_numeric($advance_amount) ? number_format($advance_amount, 2, '.', '') : 0 ; + + // insert into advance + $mysqli->query("INSERT INTO staff_advance + (staff_id, advance_paidby, advance_amount, advance_reason, advance_status, created_at, updated_at) VALUES + ('".$staff_id."', '".$advance_paidby."', '".$advance_amount."', '".$advance_reason."', 'pending', '".TODAYDATE."', '".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + + pushToUserCron( 'staff_advance', $page, $staff_id, 'Apply Advance', 'Your advance was submitted.' ) ; + + }catch( Exception $e ){ + $error_message = '
    '.$e.'
    ' ; + $error++; + } + + if( $error == 0 ) { + + // commit query + $mysqli->commit() ; + $error_message = '
    '.$lang['Advance was submitted'].'
    ' ; + + }else{ + $mysqli->rollback() ; + } + + } + + } + + // refresh page + header("Location:hr-advance.php?page_mode=".$page_mode."&page=".$page) ; + $_SESSION['system_result'] = $error_message ; + exit ; + }elseif($row_page['advance_id']>0 && $_POST['hide'] == 1 && $type == 'edit'){ + + $advance_paidby = escapeString($_POST['advance_paidby']); + $advance_amount = escapeString($_POST['advance_amount']); + $advance_reason = escapeString($_POST['advance_reason']); + $error = 0 ; + $mysqli->autocommit( false ) ; + + try { + $q = "UPDATE `staff_advance` SET + advance_paidby = '".$advance_paidby."', + advance_amount = '".$advance_amount."', + advance_reason = '".$advance_reason."' + WHERE advance_id = '".$page."' "; + $mysqli->query($q); + if($mysqli->error == ''){ + + }else{ + $error_message = '
    Failed Update
    ' ; + $error++; + } + }catch( Exception $e ){ + $error_message = '
    '.$e.'
    ' ; + $error++; + } + + if( $error == 0 ) { + // commit query + $mysqli->commit() ; + $error_message = '
    Update success
    ' ; + }else{ + $mysqli->rollback() ; + } + header("Location:hr-advance.php?page_mode=".$page_mode."&page=".$page) ; + $_SESSION['system_result'] = $error_message ; + exit; + } + + // active menu bar + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-advance' ; + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'advance-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'advance-update') ) ){ + header('Location: hr-advance.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + // get all requires + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + ?> + +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + + + + + + +
    +
    +
    + + + +
    +
    + + +
    +
    +
    +
    +
    + + 0 ){ + + $new_print_id = [] ; + foreach ( $_POST['multiple_print'] as $key => $value ){ + $new_print_id[] = $key ; + } + $print_id = implode(',', $new_print_id) ; + $_SESSION['open_in_new'] = $print_id ; + + }else{ + + // trash item + if ( $page_action != '' ){ + switch ( $page_action ){ + case 'confirmed' : + case 'rejected' : + case 'trash' : + + $result = 'failed-check' ; + + $multiple = $_POST['multiple_trash'] ; + $staff_list = [] ; + $update_list = [] ; + if ( arrayCheck($multiple) ){ + foreach ( $multiple as $key => $value ){ + $update_list[] = $key ; + $staff_list[] = $value ; + } + + if ( $page_action == 'trash' ){ + if ( $mysqli->query("UPDATE staff_advance SET + deleted_at = '".TODAYDATE."', + advance_updated_author = '".$_SESSION['system_id']."' + WHERE advance_id IN (".implode(',', $update_list).") AND advance_payment_status = 'no'") ){ + $result = 'success-update' ; + } + }else{ + if ( $mysqli->query("UPDATE staff_advance SET + advance_status = '".$page_action."', + advance_updated_author = '".$_SESSION['system_id']."' + WHERE advance_id IN (".implode(',', $update_list).") AND advance_status = 'pending' AND advance_payment_status = 'no'") ){ + $result = 'success-update' ; + } + } + + } + + break ; + } + } + + // update payment status + $update_payment_status = $_POST['update_payment_status']; + + if( $update_payment_status != '' ){ + + $multiple = $_POST['multiple_trash'] ; + if ( arrayCheck($multiple) ){ + foreach ( $multiple as $key => $value ){ + + $result = 'success-update' ; + $mysqli->query("UPDATE staff_advance SET + advance_payment_status = '".$update_payment_status."', + advance_payment_date = '".TODAYDATE."', + advance_updated_author = '".$_SESSION['system_id']."' + WHERE advance_id IN (".$key.") ") ; + + pushToUserCron( 'staff_advance', $key, $value, 'Advance '.ucwords($page_action), 'Your advance has been '.$page_action.'.' ) ; + } + } + } + + $_SESSION['system_result'] = $result ; + } + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_paidby='.$search_paidby.'&search_status_type='.$search_status_type.'&search_payment_status='.$search_payment_status.'&search_date_from='.$search_date_from.'&search_date_to='.$search_date_to.'&sort_by='.$sort_by.'&sort_by_type='.$sort_by_type ; + + // page query + $mysqli_query = "SELECT a.advance_id, a.advance_paidby, a.advance_amount, a.advance_reason, a.advance_status, a.advance_payment_status, a.advance_payment_date, a.created_at, a.updated_at, b.staff_id, b.staff_name, b.staff_idno, b.staff_accountno, b.staff_icno, b.staff_passportno, b.country_id FROM staff_advance a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL " . $search_query.$user_branch_permission_sql_b ; + + // export excel + if ( $export == 'yes' ){ + + include 'PhpExcel/PHPExcel.php' ; + + $page_filename = 'Advance-'.date( 'Ymd', time() ) ; + $objPHPExcel = new PHPExcel() ; + $objPHPExcel->getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + $border_Style = array( + 'borders' => array( + 'allborders' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ) + ); + + // default parameter + $count = 1 ; + $from_count = $count; + $char = 'A' ; + $count_staff = 1 ; + $total_amt = 0 ; + + $array_title = array( 'Emp. No', 'Name', 'Country', 'IC', 'Passport', 'Bank Account No.', 'Paid By', 'Amount RM', 'Reason', 'Status', 'Payment Status', 'Created Date', 'Updated Date' ) ; + + $newChar = $char ; + foreach( $array_title as $k => $v ){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $newChar.$count, $v ) ; + $newChar++ ; + } + $count++ ; + + $staff_advance = $mysqli->query( $mysqli_query." ORDER BY a.created_at DESC" ) ; + if ( $staff_advance->num_rows > 0 ){ + while ( $staff_adv = $staff_advance->fetch_assoc() ){ + + $staff_idno = ucwords($staff_adv['staff_idno']) ; + + switch ( $staff_adv['advance_paidby'] ){ + case 'cash' : + $paidby = 'Cash' ; + break ; + case 'debit' : + $paidby = 'Debit Bank' ; + break ; + default : + $paidby = '' ; + } + + switch ( $staff_adv['advance_payment_status'] ){ + case 'no' : + $payment_status = 'Pending' ; + break ; + case 'yes' : + $payment_status = 'Done ('.$staff_adv['advance_payment_date'].')' ; + break ; + default : + $payment_status = '' ; + } + + $newChar = $char ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $staff_idno ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $staff_adv['staff_name'] ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $country[$staff_adv['country_id']] ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $staff_adv['staff_icno'] ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $staff_adv['staff_passportno'] ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, "'".$staff_adv['staff_accountno'] ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $paidby ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $staff_adv['advance_amount'] ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $staff_adv['advance_reason'] ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, ucwords( $staff_adv['advance_status'] ) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $payment_status ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $staff_adv['created_at'] ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $staff_adv['updated_at'] ) ; + + $count++ ; + $count_staff++ ; + + $total_amt += $staff_adv['advance_amount'] ; + } + + $newChar = $char ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, '' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, '' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, '' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, '' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, '' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, '' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, 'Total :' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $total_amt ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, '' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, '' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, '' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, '' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, '' ) ; + $count++ ; + + } + $to_count = $count-1; + + $objPHPExcel->getActiveSheet()->getStyle('A') ->getAlignment()->setWrapText(true); + $objPHPExcel->getActiveSheet()->getStyle('A'.$count.':A'.$to_count)->getAlignment()->applyFromArray( + array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER) + ); + $objPHPExcel->getActiveSheet()->getStyle('Q'.$count.':Q'.$to_count)->getAlignment()->applyFromArray( + array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER) + ); + + $objPHPExcel->getActiveSheet()->getStyle('A1:M'.$to_count)->applyFromArray($border_Style) ; + $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth("5"); + $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth("28"); + $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth("7"); + $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth("5"); + $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth("5"); + $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth("28"); + $objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth("7"); + + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + ob_clean(); + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; + } + + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY a.created_at DESC LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + if ( $_SESSION['open_in_new'] != '' ){ + echo '' ; + unset( $_SESSION['open_in_new'] ) ; + } + + ?> + + +
    +
    + ' ; + break ; + case 'failed-check' : + echo '
    '.$lang['Sorry please select at least one'].'
    ' ; + break ; + case 'success-update' : + echo '
    '.$lang['Thank you status updated sucessfully'].'
    ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
    +
    +
    search
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    + + + + + +
    +
    +
    +
    +
    + +
    + + +
    +
    + +
    + +
    + +
    + +
    + + + + +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + $staff_idno = ucwords($row_page['staff_idno']) ; + + // advance status + if ( $row_page['advance_paidby'] == 'cash' ){ + $button_paidby = ''.$lang['Cash'].'' ; + }elseif ( $row_page['advance_paidby'] == 'debit' ){ + $button_paidby = ''.$lang['Debit Bank'].'' ; + } + + // advance status + if ( $row_page['advance_status'] == 'pending' ){ + $button = '' ; + }elseif ( $row_page['advance_status'] == 'confirmed' ){ + $button = '' ; + }else{ + $button = '' ; + } + + // payment status + if ( $row_page['advance_payment_status'] == 'yes' ){ + $button_p = '' ; + }else{ + $button_p = '' ; + } + + echo ' + + + + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + + + + ' ; + } + ?> + +
    Update Status
    ' ; + if ( $row_page['advance_payment_status'] == 'no' ){ + echo ' +
    + + +
    ' ; + } + echo ' +
    + + | + + '.dataFilter($row_page['staff_name']).'
    ( '.$staff_idno.' )
    '.dataFilter($row_page['advance_reason']).''.$button_paidby.''.dataFilter($row_page['advance_amount']).''.$button.''.$button_p.''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).'
    '.$lang['no_data'].'
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/hr-announcement-view.php b/hr-announcement-view.php new file mode 100644 index 0000000..6c56e08 --- /dev/null +++ b/hr-announcement-view.php @@ -0,0 +1,110 @@ +query($mysqli_query." ORDER BY a.announcement_receiver_id DESC LIMIT $start_from, " . LIMIT) ; + +// load pagination +$page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + +// start header here +include 'requires/page_header.php' ; +include 'requires/page_top.php' ; +?> + +
    + + + +
    +
    +
    +
    + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['announcement_id'] ; + $staff_idno = ucwords($row_page['staff_idno']) ; + + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
    '.dataFilter($row_page['staff_name']).' ('.$staff_idno.')' ; + if ( $row_page['announcement_receiver_status'] == 1 ){ + echo '' ; + }else{ + echo '' ; + } + echo ' + '.( $row_page['announcement_receiver_sign'] != '' ? '' : '' ).''.resetDateFormat($row_page['created_at']).'
    '.$lang['no_data'].'
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/hr-application.php b/hr-application.php new file mode 100644 index 0000000..8f2974f --- /dev/null +++ b/hr-application.php @@ -0,0 +1,111 @@ +query("INSERT INTO staff_employment (employment_status, employment_confirmation_date, employment_date, employment_modified, employment_trash) VALUES ('".$worker_status."', '".$confirmation_date."', '".TODAYDATE."', '".TODAYDATE."', '0')"); + $page = $mysqli->insert_id; + } + + // check query exsits + $mysqli_page = $mysqli->query("SELECT * FROM staff_employment + WHERE employment_id = '".$page."' AND employment_trash = '0' LIMIT 1") ; + if ($mysqli_page->num_rows > 0){ + + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $select_worker = $row_page['employment_type'] ; + $employment_status = $row_page['employment_status'] ; + + // check select worker + include 'HR/hr-local-edit.php' ; + + }else{ + $boolean_redirect = true ; + } + + if ($boolean_redirect){ + header("Location: ?page_mode=all") ; + exit ; + } + +}else{ + // start header here + include 'requires/page_header.php' ; + include 'HR/hr-local-new.php' ; +} +?> + + + \ No newline at end of file diff --git a/hr-attendance-export-by-month.php b/hr-attendance-export-by-month.php new file mode 100644 index 0000000..4a9e3ea --- /dev/null +++ b/hr-attendance-export-by-month.php @@ -0,0 +1,520 @@ +getProperties()->setCreator(COMPANY)->setTitle(COMPANY)->setSubject(COMPANY)->setDescription(COMPANY)->setKeywords(COMPANY)->setCategory(COMPANY) ; +$objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; +$objPHPExcel->setActiveSheetIndex(0); +$objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; +$cacheMethod = PHPExcel_CachedObjectStorageFactory:: cache_to_phpTemp; +$cacheSettings = array( + 'memoryCacheSize' => '50MB', + 'cacheTime' => 1200 +) ; +PHPExcel_Settings::setCacheStorageMethod( $cacheMethod, $cacheSettings ) ; + +$styleArrayTitle = array( + 'font' => array( + 'bold' => true , + 'color' => array( 'rgb' => '000000' ) , + 'size' => 15 + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) +); + +$styleArrayDay = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) +) ; + +$styleArrayBg1 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'AFABAB') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) +) ; + +$styleArrayBg2 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'FFDA65') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) +) ; + +$styleArray = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) +) ; + +$styleArrayLeft = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT, + ) +) ; + +$styleArray2 = array( + 'alignment' => array( + //'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER, + ) +) ; + +$styleArrayRed = array( +'font' => array( + 'color' => array('rgb' => 'FF0000'), +)); + +$count = 1 ; +$firstChar = 'A' ; +$lastChar = ''; + if (EXCELDETAIL == "YES"){ + $lastChar = 'w' ; +}else{ + $lastChar = 'U' ; +} + +// title name +$objPHPExcel->getActiveSheet()->mergeCells( $firstChar.$count.':'.$lastChar.$count ) ; +$objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count.':'.$lastChar.$count )->applyFromArray( $styleArrayTitle ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, 'Attendance Report' ) ; +$count++ ; + +// loop all attendance record +$arr_att = array(); +if ( $mysqli_page->num_rows > 0 ){ + while ( $att = $mysqli_page->fetch_assoc() ){ + $arr_att[] = $att; + } +} + +// sum all working hours +$total_all_list_work_day = 0 ; +$total_all_list_ot_day = 0 ; +$total_all_list_work = [] ; +$total_all_list_rest = [] ; +$total_all_list_time_off = [] ; +$total_all_list_rest2 = [] ; +$total_all_list_time_off2 = [] ; +$total_all_list_early = [] ; +$total_all_list_late = [] ; +$total_all_list_early_out = [] ; +$total_all_list_ot_normal = [] ; +$total_all_work = [] ; + +if(arrayCheck($arr_att)){ + + $all_staffid = [] ; + $all_date = [] ; + $all_attendances = [] ; + + foreach($arr_att as $attendances){ + $all_staffid[] = $attendances['staff_id'] ; + } + + + $mysqli_date = $mysqli->query("SELECT * FROM staff_attendance_list a + WHERE a.staff_id IN ( ".implode( ', ', $all_staffid )." ) AND a.list_date LIKE '%".$date_time."%' AND a.deleted_at IS NULL AND a.list_date BETWEEN '".$date_from." 00:00:00' and '".$date_to." 23:59:59' ORDER BY a.list_date ASC") ; + if ( $mysqli_date->num_rows > 0 ){ + while ( $row_date = $mysqli_date->fetch_assoc() ){ + $all_date[$row_date['staff_id']][] = $row_date ; + } + } + + + $time_attendances = $mysqli->query("SELECT staff_id, list_id, record_from, latitude, longitude, created_at FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id IN ( ".implode( ', ', $all_staffid )." ) AND check_group LIKE '%".$date_time."%' ORDER BY created_at ASC") ; + if ( $time_attendances->num_rows > 0 ){ + while ( $row_attendances = $time_attendances->fetch_assoc() ){ + $all_attendances[$row_attendances['staff_id']][] = $row_attendances ; + } + } + + foreach($arr_att as $attendances){ + $count++ ; + $count++ ; + + $staff_idno = ucwords($attendances['staff_idno']) ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar.$count)->applyFromArray( $styleArray ) ; + $firstChar2 = $firstChar ; + + $mc1 = $firstChar2.$count; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, 'ID: '.$staff_idno.' Name: '.$attendances['staff_name'] ) ; + $mc2 = $lastChar.$count ; + $objPHPExcel->getActiveSheet()->mergeCells($mc1.':'.$mc2) ; + $objPHPExcel->getActiveSheet()->getStyle($mc1.':'.$mc2)->applyFromArray( $styleArrayLeft ) ; + $count++ ; + + $get_staffdate = $all_date[$attendances['staff_id']] ; + if ( $get_staffdate != null && $get_staffdate != undefined && count($get_staffdate) > 0 ){ + + // get all attendance time + $attendances_list = [] ; + $get_staffattendances = $all_attendances[$attendances['staff_id']] ; + if ( $get_staffattendances != null && $get_staffattendances != undefined && count($get_staffattendances) > 0 ){ + foreach ( $get_staffattendances as $row ){ + $attendances_list[$row['list_id']][] = $row ; + } + } + + + $firstChar2 = $firstChar ; + $array_title = [ 'Date', 'Day' ] ; + for ( $a = 0 ; $a < 8 ; $a++ ){ + $array_title[] = ( $a%2 == 0 ? 'In' : 'Out' ) ; + } + if ( EXCELDETAIL == "YES" ){ + $array_title[] = 'Work Day' ; + $array_title[] = 'OT Day' ; + } + $array_title[] = 'Work' ; + $array_title[] = 'Rest 1' ; + $array_title[] = 'Time Off 1' ; + $array_title[] = 'Rest 2' ; + $array_title[] = 'Time Off 2' ; + $array_title[] = 'Early' ; + $array_title[] = 'Late' ; + $array_title[] = 'Early Out' ; + $array_title[] = 'OT' ; + $array_title[] = 'Remark' ; + $array_title[] = 'Work + OT' ; + foreach ( $array_title as $kk => $vv ){ + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $vv ) ; + $firstChar2++ ; + } + $count++ ; + + // sum working hours + $total_list_work_day = 0 ; + $total_list_ot_day = 0 ; + $total_list_work = [] ; + $total_list_rest = [] ; + $total_list_time_off = [] ; + $total_list_rest2 = [] ; + $total_list_time_off2 = [] ; + $total_list_early = [] ; + $total_list_late = [] ; + $total_list_early_out = [] ; + $total_list_ot_normal = [] ; + $total_work = [] ; + + + foreach ( $get_staffdate as $value ){ + + $firstChar2 = $firstChar ; + $newlistdate = date($dateformat,strtotime($value['list_date'])); + + $date = date('w', strtotime($newlistdate)) ; + $date = $date_array[$date] ; + $attendances_date = $attendances_list[$value['list_id']] ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $newlistdate ) ; + $firstChar2++ ; + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $date ) ; + $firstChar2++ ; + + + for ( $a = 0 ; $a < 8 ; $a++ ){ + + $coordinates = ( $attendances_date[$a]['latitude'] != '' && $attendances_date[$a]['longitude'] != '' ? $attendances_date[$a]['latitude'].','.$attendances_date[$a]['longitude'] : '' ) ; + $map_link = 'https://maps.google.com/?q='.$coordinates ; + + $current_time = $attendances_date[$a]['created_at'] ; + $record_from = $attendances_date[$a]['record_from'] ; + + $record_from_w = '' ; + switch ( $record_from ){ + case 'qrcode' : $record_from_w = ' (Q)' ; break ; + case 'machine' : $record_from_w = ' (D)' ; break ; + case 'button' : $record_from_w = ' (M)' ; break ; + case 'system' : $record_from_w = ' (S)' ; break ; + case 'manual' : $record_from_w = ' (S)' ; break ; + } + + //$current_time = ( $current_time != '' ? resetTimeWithoutSec($current_time) : '' ) ; + $current_time = ( $current_time != '' ? date('H:i:s', strtotime($current_time)).$record_from_w : '' ) ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $current_time ) ; + + if ( $coordinates != '' ){ + $objPHPExcel->setActiveSheetIndex(0)->getCell( $firstChar2.$count )->setDataType(PHPExcel_Cell_DataType::TYPE_STRING2) ; + $objPHPExcel->setActiveSheetIndex(0)->getCell( $firstChar2.$count )->getHyperlink()->setUrl(strip_tags( $map_link )) ; + } + + $firstChar2++ ; + } + if (EXCELDETAIL == "YES"){ + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, resetTimeWithoutSec($value['list_work_day']) ) ; + $firstChar2++ ; + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, resetTimeWithoutSec($value['list_ot_day']) ) ; + $firstChar2++ ; + } + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->getActiveSheet()->setCellValue( $firstChar2.$count, resetTimeWithoutSec($value['list_work']) ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, resetTimeWithoutSec($value['list_rest']) ) ; + $firstChar2++ ; + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, resetTimeWithoutSec($value['list_time_off']) ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, resetTimeWithoutSec($value['list_rest2']) ) ; + $firstChar2++ ; + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, resetTimeWithoutSec($value['list_time_off2']) ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, resetTimeWithoutSec($value['list_early']) ) ; + $firstChar2++ ; + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, resetTimeWithoutSec($value['list_late']) ) ; + $firstChar2++ ; + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, resetTimeWithoutSec($value['list_early_out']) ) ; + $firstChar2++ ; + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, resetTimeWithoutSec($value['list_ot_normal']) ) ; + $firstChar2++ ; + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $value['list_remark'] ) ; + $firstChar2++ ; + + $time = $value['list_ot_normal']; + $time2 = $value['list_work']; + + $secs = strtotime($time2)-strtotime("00:00:00"); + $result = date("H:i:s",strtotime($time)+$secs); + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, resetTimeWithoutSec($result) ) ; + + + $count++ ; + + // count total working hours + $total_list_work_day += $value['list_work_day'] ; + $total_list_ot_day += $value['list_ot_day'] ; + $total_list_work = setTotalHoursArray( $total_list_work, resetTimeWithoutSec($value['list_work']) ) ; + + $total_list_rest = setTotalHoursArray( $total_list_rest, resetTimeWithoutSec($value['list_rest']) ) ; + $total_list_time_off = setTotalHoursArray( $total_list_time_off, resetTimeWithoutSec($value['list_time_off']) ) ; + $total_list_rest2 = setTotalHoursArray( $total_list_rest2, resetTimeWithoutSec($value['list_rest2']) ) ; + $total_list_time_off2 = setTotalHoursArray( $total_list_time_off2, resetTimeWithoutSec($value['list_time_off2']) ) ; + + $total_list_early = setTotalHoursArray( $total_list_early, resetTimeWithoutSec($value['list_early']) ) ; + $total_list_late = setTotalHoursArray( $total_list_late, resetTimeWithoutSec($value['list_late']) ) ; + $total_list_early_out = setTotalHoursArray( $total_list_early_out, resetTimeWithoutSec($value['list_early_out']) ) ; + $total_list_ot_normal = setTotalHoursArray( $total_list_ot_normal, resetTimeWithoutSec($value['list_ot_normal']) ) ; + + $total_work = setTotalHoursArray( $total_work, resetTimeWithoutSec($result) ) ; + + + //calculate all + $total_all_list_work = setTotalHoursArray( $total_all_list_work, resetTimeWithoutSec($value['list_work']) ) ; + + $total_all_list_rest = setTotalHoursArray( $total_all_list_rest, resetTimeWithoutSec($value['list_rest']) ) ; + $total_all_list_time_off = setTotalHoursArray( $total_all_list_time_off, resetTimeWithoutSec($value['list_time_off']) ) ; + $total_all_list_rest2 = setTotalHoursArray( $total_all_list_rest2, resetTimeWithoutSec($value['list_rest2']) ) ; + $total_all_list_time_off2 = setTotalHoursArray( $total_all_list_time_off2, resetTimeWithoutSec($value['list_time_off2']) ) ; + + $total_all_list_early = setTotalHoursArray( $total_all_list_early, resetTimeWithoutSec($value['list_early']) ) ; + $total_all_list_late = setTotalHoursArray( $total_all_list_late, resetTimeWithoutSec($value['list_late']) ) ; + $total_all_list_early_out = setTotalHoursArray( $total_all_list_early_out, resetTimeWithoutSec($value['list_early_out']) ) ; + $total_all_list_ot_normal = setTotalHoursArray( $total_all_list_ot_normal, resetTimeWithoutSec($value['list_ot_normal']) ) ; + + $total_all_work = setTotalHoursArray( $total_all_work, resetTimeWithoutSec($result) ) ; + + } + + + // column for total + $firstChar2 = $firstChar ; + $firstChar2++ ; + $firstChar2++ ; + $firstChar2++ ; + $firstChar2++ ; + $firstChar2++ ; + $firstChar2++ ; + $firstChar2++ ; + $firstChar2++ ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, 'Total' ) ; + $firstChar2++ ; + + if (EXCELDETAIL == "YES"){ + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $total_list_work_day ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $total_list_ot_day ) ; + $firstChar2++ ; + } + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_list_work) ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_list_rest) ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_list_time_off) ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_list_rest2) ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_list_time_off2) ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_list_early) ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_list_late) ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_list_early_out) ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_list_ot_normal) ) ; + $firstChar2++ ; + + $firstChar2++ ; + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_work) ) ; + + $count++ ; + + $total_all_list_work_day += $total_list_work_day ; + $total_all_list_ot_day += $total_list_ot_day ; + + + } + + } +} +$count++; +$firstChar2 = "J"; +$objPHPExcel->getActiveSheet()->getStyle($firstChar2.++$count)->applyFromArray( $styleArray ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, 'Total All' ) ; +$firstChar2++ ; + +if (EXCELDETAIL == "YES"){ + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $total_all_list_work_day ) ; + $firstChar2++ ; + + $objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $total_all_list_ot_day ) ; + $firstChar2++ ; +} + +$objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_all_list_work) ) ; +$firstChar2++ ; + +$objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_all_list_rest) ) ; +$firstChar2++ ; + +$objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_all_list_time_off) ) ; +$firstChar2++ ; + +$objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_all_list_rest2) ) ; +$firstChar2++ ; + +$objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_all_list_time_off2) ) ; +$firstChar2++ ; + +$objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_all_list_early) ) ; +$firstChar2++ ; + +$objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_all_list_late) ) ; +$firstChar2++ ; + +$objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_all_list_early_out) ) ; +$firstChar2++ ; + +$objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_all_list_ot_normal) ) ; +$firstChar2++ ; +$firstChar2++ ; + +$objPHPExcel->getActiveSheet()->getStyle($firstChar2.$count)->applyFromArray( $styleArray ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, setTotalHoursSum($total_all_work) ) ; +$firstChar2++ ; + +// Submission from +header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; +header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; +header( 'Cache-Control: max-age=0' ) ; +// save to pc +$objWriter->save('php://output') ; +// header( "Refresh: 0" ) ; +exit ; +?> \ No newline at end of file diff --git a/hr-attendance-export-by-template1.php b/hr-attendance-export-by-template1.php new file mode 100644 index 0000000..b0feda2 --- /dev/null +++ b/hr-attendance-export-by-template1.php @@ -0,0 +1,469 @@ +getProperties()->setCreator(COMPANY)->setTitle(COMPANY)->setSubject(COMPANY)->setDescription(COMPANY)->setKeywords(COMPANY)->setCategory(COMPANY) ; +$objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; +$objPHPExcel->setActiveSheetIndex(0); +$objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; +$cacheMethod = PHPExcel_CachedObjectStorageFactory:: cache_to_phpTemp; +$cacheSettings = array( + 'memoryCacheSize' => '50MB', + 'cacheTime' => 1200 +) ; +PHPExcel_Settings::setCacheStorageMethod( $cacheMethod, $cacheSettings ) ; + +$styleArrayTitle = array( + 'font' => array( + 'bold' => true , + 'color' => array( 'rgb' => '000000' ) , + 'size' => 15 + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) +); + +$styleArrayDay = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) +) ; + +$styleArrayBg1 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'AFABAB') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) +) ; + +$styleArrayBg2 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'FFDA65') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) +) ; + +$styleArray = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) +) ; + +$styleArrayLeft = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT, + ) +) ; + +$styleArray2 = array( + 'alignment' => array( + //'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER, + ) +) ; + +$styleArrayRed = array( +'font' => array( + 'color' => array('rgb' => 'FF0000'), +)); + +$count = 1 ; +$firstChar = 'A' ; +$lastChar = 'K'; + +// title name +$objPHPExcel->getActiveSheet()->mergeCells( $firstChar.$count.':'.$lastChar.$count ) ; +$objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count.':'.$lastChar.$count )->applyFromArray( $styleArrayTitle ) ; +$objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, 'Attendance Report' ) ; +$count++ ; + + +$firstChar2 = $firstChar ; +$array_title = [ 'Employee Code', 'Employee Name', 'Currency Code', 'Rate Type', '#BAS - Basic Salary', '#OT15 - OT 1.5 Hours', '#OT2 - OT 2.0 Hours', '#OT3 - OT 3.0 Hours', '#LTE - Late & Under', '#WDYS - Working Days' ] ; +foreach ( $array_title as $k => $v ){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $v ) ; + $firstChar2++ ; +} +$count++ ; + + + + + + + + + + +$get_result = 'failed' ; +$get_list = '' ; +if ( $mysqli_page->num_rows > 0 ){ + + $get_result = 'success' ; + + $new_attendance = array() ; + $staff_ids = array() ; + while ( $attendance = $mysqli_page->fetch_assoc() ){ + $temp_attendance = [ + 'staff_id' => $attendance['staff_id'], + 'idno' => $attendance['staff_idno'], + 'name' => $attendance['staff_name'], + 'staff_salary' => $attendance['staff_salary'], + 'ot_rate_type' => $attendance['ot_rate_type'], + 'work_type_id' => $attendance['work_type_id'] + ] ; + + $new_attendance[$attendance['staff_id']] = $temp_attendance ; + $staff_ids[] = $attendance['staff_id'] ; + } + + + + + // get working day + $list_workday = [] ; + $select_attendancelist = $mysqli->query("SELECT staff_id, list_type_remark, COUNT( list_type_remark ) as count_list_type_remark, SUM( list_work_day ) as sum_list_work_day, SUM( list_leave_day ) as sum_list_leave_day FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) + GROUP BY staff_id, list_type_remark") ; + + if ( $select_attendancelist->num_rows > 0 ){ + while ( $row_attendancelist = $select_attendancelist->fetch_assoc() ){ + $list_workday[$row_attendancelist['staff_id']][$row_attendancelist['list_type_remark']] = $row_attendancelist ; + } + } + + + $list_time_off = [] ; + $select_attendancelist = $mysqli->query("SELECT staff_id, list_type_remark, list_time_off, list_time_off2 FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND ( list_time_off != '00:00:00' OR list_time_off2 != '00:00:00' )") ; + + if ( $select_attendancelist->num_rows > 0 ){ + while ( $row_attendancelist = $select_attendancelist->fetch_assoc() ){ + $get_sum_timeoff = $list_time_off[$row_attendancelist['staff_id']]['sum'] ; + $check_sum_timeoff = ( $get_sum_timeoff != '' ? $get_sum_timeoff : '00:00:00' ) ; + + if ( $row_attendancelist['list_time_off'] != '00:00:00' ){ + $list_time_off[$row_attendancelist['staff_id']]['count'] = ( $list_time_off[$row_attendancelist['staff_id']]['count'] + 1 ); + $list_time_off[$row_attendancelist['staff_id']]['sum'] = addTime( $check_sum_timeoff, $row_attendancelist['list_time_off'] ) ; + } + if ( $row_attendancelist['list_time_off2'] != '00:00:00' ){ + $list_time_off[$row_attendancelist['staff_id']]['count'] = ( $list_time_off[$row_attendancelist['staff_id']]['count'] + 1 ); + $list_time_off[$row_attendancelist['staff_id']]['sum'] = addTime( $check_sum_timeoff, $row_attendancelist['list_time_off2'] ) ; + } + } + } + + + + + // get staff leave + $list_leave = [] ; + $select_leavelist = $mysqli->query("SELECT staff_id, leave_type, leave_record_days FROM staff_leave_year + WHERE deleted_at IS NULL AND leave_year LIKE '".date( 'Y', strtotime( $date_time.'-01' ) )."%' AND staff_id IN ( ".implode(',', $staff_ids)." )") ; + if ( $select_leavelist->num_rows > 0 ){ + while ( $row_leavelist = $select_leavelist->fetch_assoc() ){ + $list_leave[$row_leavelist['staff_id']][$row_leavelist['leave_type']] = $row_leavelist ; + } + } + + // get staff given leave + $list_leave_given = [] ; + $select_leavegivenlist = $mysqli->query("SELECT staff_id, SUM(given_day) as total_given_day FROM staff_leave_month + WHERE deleted_at IS NULL AND given_date BETWEEN '".$year_of_day."' AND '".$month_of_day."' AND staff_id IN ( ".implode(',', $staff_ids)." ) + GROUP BY staff_id ") ; + if ( $select_leavegivenlist->num_rows > 0 ){ + while ( $row_leavegivenlist = $select_leavegivenlist->fetch_assoc() ){ + $list_leave_given[$row_leavegivenlist['staff_id']] = $row_leavegivenlist['total_given_day'] ; + } + } + + // get staff total use leave + $list_leave_used = [] ; + $select_leave_usedlist = $mysqli->query("SELECT staff_id, list_type_remark, SUM( list_leave_day ) as sum_list_leave_day FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date BETWEEN '".$year_of_day."' AND '".$month_of_last."' AND list_type_remark IN ( 'AL', 'MC' ) AND staff_id IN ( ".implode(',', $staff_ids)." ) + GROUP BY staff_id, list_type_remark") ; + + if ( $select_leave_usedlist->num_rows > 0 ){ + while ( $row_leave_usedlist = $select_leave_usedlist->fetch_assoc() ){ + $list_leave_used[$row_leave_usedlist['staff_id']][$row_leave_usedlist['list_type_remark']] = $row_leave_usedlist['sum_list_leave_day'] ; + } + } + + + + // get late + $list_late = [] ; + $select_latelist = $mysqli->query("SELECT staff_id, count( list_late ) as count_list_late, SEC_TO_TIME(SUM(TIME_TO_SEC(TIME_FORMAT(list_late, '%H:%i')))) as sum_list_late FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_late != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_latelist->num_rows > 0 ){ + while ( $row_late = $select_latelist->fetch_assoc() ){ + $list_late[$row_late['staff_id']] = [ + 'count' => $row_late['count_list_late'], + 'sum' => $row_late['sum_list_late'] + ] ; + } + } + + + // get early out + $list_earlyout = [] ; + $select_earlyoutlist = $mysqli->query("SELECT staff_id, count( list_early_out ) as count_list_early_out, SEC_TO_TIME(SUM(TIME_TO_SEC(TIME_FORMAT(list_early_out, '%H:%i')))) as sum_list_early_out FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_early_out != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_earlyoutlist->num_rows > 0 ){ + while ( $row_earlyoutlist = $select_earlyoutlist->fetch_assoc() ){ + $list_earlyout[$row_earlyoutlist['staff_id']] = [ + 'count' => $row_earlyoutlist['count_list_early_out'], + 'sum' => $row_earlyoutlist['sum_list_early_out'] + ] ; + } + } + + + + // get rest more + $list_rest_more = [] ; + $select_rest_morelist = $mysqli->query("SELECT staff_id, count( list_rest_more ) as count_list_rest_more, SEC_TO_TIME(SUM(TIME_TO_SEC(TIME_FORMAT(list_rest_more, '%H:%i')))) as sum_list_rest_more FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_rest_more != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_rest_morelist->num_rows > 0 ){ + while ( $row_rest_more = $select_rest_morelist->fetch_assoc() ){ + $list_rest_more[$row_rest_more['staff_id']] = [ + 'count' => $row_rest_more['count_list_rest_more'], + 'sum' => $row_rest_more['sum_list_rest_more'] + ] ; + } + } + + + + // get rest more 2 + $list_rest_more2 = [] ; + $select_rest_more2list = $mysqli->query("SELECT staff_id, count( list_rest_more2 ) as count_list_rest_more2, SEC_TO_TIME(SUM(TIME_TO_SEC(TIME_FORMAT(list_rest_more2, '%H:%i')))) as sum_list_rest_more2 FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_rest_more2 != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_rest_more2list->num_rows > 0 ){ + while ( $row_rest_more2 = $select_rest_more2list->fetch_assoc() ){ + $list_rest_more2[$row_rest_more2['staff_id']] = [ + 'count' => $row_rest_more2['count_list_rest_more2'], + 'sum' => $row_rest_more2['sum_list_rest_more'] + ] ; + } + } + + + // get ot + $list_ot = [] ; + $select_otlist = $mysqli->query("SELECT staff_id, count( list_ot_normal ) as count_list_ot_normal, SEC_TO_TIME(SUM(TIME_TO_SEC(TIME_FORMAT(list_ot_normal, '%H:%i')))) as sum_list_ot_normal FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_ot_normal != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_otlist->num_rows > 0 ){ + while ( $row_otlist = $select_otlist->fetch_assoc() ){ + $list_ot[$row_otlist['staff_id']] = [ + 'count' => $row_otlist['count_list_ot_normal'], + 'sum' => $row_otlist['sum_list_ot_normal'] + ] ; + } + } + + + + // render table + foreach ( $new_attendance as $key => $value ){ + $firstChar2 = $firstChar ; + + + $array_tablelist = [] ; + $total_workday = 0 ; + $total_realwork = 0 ; + $total_realworkdays = 0 ; + + $get_late = checkExists( $list_late[$value['staff_id']]['count'] ) ; + $get_sum_late = checkExists( $list_late[$value['staff_id']]['sum'] ) ; + $get_earlyout = checkExists( $list_earlyout[$value['staff_id']]['count'] ) ; + $get_sum_earlyout = checkExists( $list_earlyout[$value['staff_id']]['sum'] ) ; + $get_ot = checkExists( $list_ot[$value['staff_id']]['count'] ) ; + $get_sum_ot = checkExists( $list_ot[$value['staff_id']]['sum'] ) ; + $get_timeoff = checkExists( $list_time_off[$value['staff_id']]['count'] ) ; + $get_sum_timeoff = checkExists( $list_time_off[$value['staff_id']]['sum'] ) ; + $get_restmore = checkExists( $list_rest_more[$value['staff_id']]['count'] ) ; + $get_sum_restmore = checkExists( $list_rest_more[$value['staff_id']]['sum'] ) ; + $get_restmore2 = checkExists( $list_rest_more2[$value['staff_id']]['count'] ) ; + $get_sum_restmore2 = checkExists( $list_rest_more2[$value['staff_id']]['sum'] ) ; + + $total_over_list = [] ; + if ( $get_sum_late != '' ){ $total_over_list[] = $get_sum_late ; } + if ( $get_sum_earlyout != '' ){ $total_over_list[] = $get_sum_earlyout ; } + if ( $get_sum_restmore != '' ){ $total_over_list[] = $get_sum_restmore ; } + if ( $get_sum_restmore2 != '' ){ $total_over_list[] = $get_sum_restmore2 ; } + + $total_over = 0 ; + foreach ( $total_over_list as $kover => $vover ){ + $total_over += convertMinutes( $vover ) ; + } + + $get_leave = $list_leave[$value['staff_id']] ; + $get_leave_annual = $get_leave['annual'] ; + $get_leave_sick = $get_leave['sick'] ; + + $get_leave_used = $list_leave_used[$value['staff_id']] ; + $get_leave_annual_used = $get_leave_used['AL'] ; + $get_leave_sick_used = $get_leave_used['MC'] ; + + $get_leave_annual_given = $list_leave_given[$value['staff_id']] ; + + foreach ( $array_typelist as $ktypelist => $vtypelist ){ + $get_workday = checkExists( $list_workday[$value['staff_id']][$ktypelist] ) ; + $days = 0 ; + $total_realwork += $get_workday['sum_list_work_day'] ; + $total_realworkdays += $get_workday['sum_list_work_day'] ; + + switch ( $ktypelist ){ + case 'WD' : + case 'PT' : + case 'AL' : + case 'MC' : + case 'UL' : + case 'AS' : + $total_workday += $get_workday['count_list_type_remark'] ; + break ; + } + + + + + switch ( $ktypelist ){ + case 'WD' : + case 'PT' : + $days = $get_workday['sum_list_work_day'] ; + break ; + case 'AL' : + case 'MC' : + case 'UL' : + $days = $get_workday['sum_list_leave_day'] ; + + if ( $ktypelist == 'AL' || $ktypelist == 'MC' ){ + $total_realworkdays += $get_workday['sum_list_leave_day'] ; + } + break ; + case 'AS' : + case 'HL' : + case 'OD' : + $days = $get_workday['count_list_type_remark'] ; + break ; + } + + + + + if ( $ktypelist != 'WD' && $ktypelist != 'PT' && $ktypelist != 'HL' && $ktypelist != 'OD' ){ + + $temp_typelist = '' ; + $days = ( $days + 0 ) ; + + switch ( $ktypelist ){ + case 'AL' : + $temp_typelist = '' ; + if ( $get_leave_annual['leave_record_days'] > 0 ){ + $temp_typelist .= ( $days > 0 ? ''.$days.'' : '-' ) .' / '.( $get_leave_annual_given - $get_leave_annual_used + 0 ) .' / '.( $get_leave_annual['leave_record_days'] + 0 ) . ' ( '.( $get_leave_annual_given + 0 ).' )' ; + } + $temp_typelist .= '' ; + break ; + case 'MC' : + $temp_typelist = ''. ( $days > 0 ? ''.$days.'' : '-' ) .' / '.( $get_leave_sick['leave_record_days'] - $get_leave_sick_used + 0 ) .' / '.( $get_leave_sick['leave_record_days'] + 0 ).'' ; + break ; + case 'UL' : + $temp_typelist = ''. ( $days > 0 ? ''.$days.'' : '' ) .'' ; + break ; + default : + $temp_typelist = ''. ( $days > 0 ? $days : 0 ) .'' ; + } + + $array_tablelist[] = $temp_typelist ; + } + } + + $work_type_id = '' ; + switch ( $value['work_type_id'] ){ + case '1' : + $work_type_id = 'NORMAL' ; + break ; + case '2' : + $work_type_id = 'DAILY' ; + break ; + case '3' : + $work_type_id = 'HOURLY' ; + break ; + } + + + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $value['idno'] ) ; $firstChar2++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, ucwords($value['name']) ) ; $firstChar2++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, "RM" ) ; $firstChar2++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $work_type_id ) ; $firstChar2++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $value['staff_salary'] ) ; $firstChar2++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, ( $value['ot_rate_type'] == '1.5' ? convertMinutes( $get_sum_ot ) : '' ) ) ; $firstChar2++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, ( $value['ot_rate_type'] == '2.0' ? convertMinutes( $get_sum_ot ) : '' ) ) ; $firstChar2++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, ( $value['ot_rate_type'] == '3.0' ? convertMinutes( $get_sum_ot ) : '' ) ) ; $firstChar2++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, ( $total_over > 0 ? $total_over : '' ) ) ; $firstChar2++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $total_realworkdays ) ; $firstChar2++ ; + $count++ ; + } + + // J column 4 decimal + $objPHPExcel->getActiveSheet()->getStyle('J2:J' . $objPHPExcel->getActiveSheet()->getHighestRow())->getNumberFormat()->setFormatCode('0.0000'); + +} + + +// Submission from +header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; +header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; +header( 'Cache-Control: max-age=0' ) ; +// save to pc +$objWriter->save('php://output') ; +// header( "Refresh: 0" ) ; +exit ; +?> \ No newline at end of file diff --git a/hr-attendance-format-2.php b/hr-attendance-format-2.php new file mode 100644 index 0000000..5768837 --- /dev/null +++ b/hr-attendance-format-2.php @@ -0,0 +1,663 @@ +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 ; + } +} + +?> + + + + +
    +
    + + + + +
    +
    search
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + placeholder="Resign List"> +
    +
    +
    + +
    + +
    +
    +
    +
    + + + + + + +
    +
    +
    +
    +
    + +
    +
    lisitng
    +
    + +
    +
    + +
    + + +
    + + + +
    + + = 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 ' +
    +
    +
    + + +
    +
    + +
    +
    + +
    + + + + + + + + + + \ No newline at end of file diff --git a/hr-attendance-reprocessing.php b/hr-attendance-reprocessing.php new file mode 100644 index 0000000..1c05629 --- /dev/null +++ b/hr-attendance-reprocessing.php @@ -0,0 +1,430 @@ +query("SELECT staff_id, staff_idno, staff_name, group_id, country_id FROM staff + WHERE deleted_at IS NULL AND staff_id IN (".implode(',', $rsi).")") ; + + if ( $staffs_q->num_rows > 0 ){ + + $result = 'Failed invalid date' ; + + if ( $reprocessing_date_from != '' && $reprocessing_date_to != '' ){ + + $get_day = date('N', strtotime($reprocessing_date_from)) ; + + // get all related staff first + $staffs = [] ; + $staffs_id = [] ; + $group_id = [] ; + while ( $row_staff = $staffs_q->fetch_assoc() ){ + $staffs[] = $row_staff ; + $staffs_id[] = $row_staff['staff_id'] ; + $group_id[] = $row_staff['group_id'] ; + } + + // get staff working hours + $workings = [] ; + $working_q = $mysqli->query("SELECT staff_id, working_period_from, working_period_to, working_period_before FROM staff_attendance_working + WHERE deleted_at IS NULL AND staff_id IN (".implode(',', $staffs_id).") AND working_date = '".$reprocessing_date_from."'") ; + if ( $working_q->num_rows > 0 ){ + while ( $row_working = $working_q->fetch_assoc() ){ + $workings[$row_working['staff_id']] = $row_working ; + } + } + + // get staff setting working + $sworkings = [] ; + $working_q = $mysqli->query("SELECT group_id, working_morning_start as working_period_from, working_morning_end as working_period_to, working_period_before FROM setting_working + WHERE deleted_at IS NULL AND group_id IN (".implode(',', $group_id).") AND working_day = '".$get_day."'") ; + if ( $working_q->num_rows > 0 ){ + while ( $row_working = $working_q->fetch_assoc() ){ + $sworkings[$row_working['group_id']] = $row_working ; + } + } + + // loop all staff + foreach ( $staffs as $staff ){ + + $boolean_working = false ; + $staff_id = $staff['staff_id'] ; + + if ( arrayCheck($workings[$staff_id]) ){ + $boolean_working = true ; + $working = $workings[$staff_id] ; + }else{ + if ( arrayCheck($sworkings[$staff['group_id']]) ){ + $boolean_working = true ; + $working = $sworkings[$staff['group_id']] ; + } + } + + if ( $boolean_working ){ + + $date_from = $reprocessing_date_from . ' ' . $working['working_period_from'] ; + $date_to = date('Y-m-d', strtotime($reprocessing_date_to.' +1 days')) . ' ' . $working['working_period_to'] ; + + // if ( $working['working_period_before'] > 0 ){ + // $date_to = date( 'Y-m-d H:i:s', strtotime('-'.$working['working_period_before'].' hour', strtotime($date_to)) ) ; + // } + + // get attendance list + $attendance_q = $mysqli->query("SELECT attendance_id, list_id, created_at FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND created_at >= '".$date_from."' AND created_at <= '".$date_to."' ORDER BY created_at ASC") ; + if ( $attendance_q->num_rows > 0 ){ + + $result = 'Success update.' ; + + $list_id = [] ; + while ( $row = $attendance_q->fetch_assoc() ){ + $list_id[$row['list_id']] = $row['list_id'] ; + } + + $im_list_id = implode(',', $list_id) ; + + $u_sal = "UPDATE staff_attendance_list SET deleted_at = '".TODAYDATE."' WHERE deleted_at IS NULL AND list_id IN (".$im_list_id.") AND staff_id = '".$staff_id."'" ; + $mysqli->query($u_sal) ; + if ( $mysqli->error != '' ){ + $error++ ; + $result = 'Failed update.' ; + $_SESSION['system_result'] = $mysqli->error ; + exit; + } + + $u_sa = "UPDATE staff_attendance SET list_id = '0' WHERE deleted_at IS NULL AND list_id IN (".$im_list_id.") AND staff_id = '".$staff_id."' AND list_id != '-1'" ; + + $mysqli->query($u_sa) ; + if ( $mysqli->error != '' ){ + $error++ ; + $result = 'Failed update.' ; + $_SESSION['system_result'] = $mysqli->error ; + exit; + } + } + + $period_date_to = $date_to ; + $date_to = date('Y-m-d H:i:s', strtotime($date_to.' -1 days')) ; + $u_sal2 = "UPDATE staff_attendance_list SET deleted_at = '".TODAYDATE."' WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND list_date >= '".date('Y-m-d', strtotime($date_from))."' AND list_date <= '".date('Y-m-d', strtotime($date_to))."'" ; + + $mysqli->query($u_sal2) ; + if ( $mysqli->error != '' ){ + $error++ ; + $result = 'Failed update.' ; + $_SESSION['system_result'] = $mysqli->error ; + exit; + } + + if ( $reprocessing_reset == 'yes' ){ + $u_saw = "UPDATE staff_attendance_working SET deleted_at = '".TODAYDATE."' WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND working_date >= '".date('Y-m-d', strtotime($date_from))."' AND working_date <= '".date('Y-m-d', strtotime($date_to))."'" ; + + $mysqli->query($u_saw) ; + if ( $mysqli->error != '' ){ + $error++ ; + $result = 'Failed update.' ; + $_SESSION['system_result'] = $mysqli->error ; + exit; + } + } + + $period = new DatePeriod( + new DateTime($date_from), + new DateInterval('P1D'), + new DateTime($period_date_to) + ) ; + + foreach ( $period as $key => $value ) { + + $params = [ + 'get_type' => 'custom', + 'get_date' => $value->format('Y-m-d'), + 'get_staff_id' => $staff_id + ] ; + + // callWithoutResponse( PATH, '443', 'GET', '/cron/generate_attendance_2.php', $params ) ; + $cronjobHit = cronjobHit( PATH."cron/generate_attendance.php?get_type=custom&get_date=".$value->format('Y-m-d')."&get_staff_id=".$staff_id."" ) ; + + // $cronjobHit = cronjobHit( PATH."cron/generate_attendance.php?get_type=custom&get_date=".$value->format('Y-m-d')."&get_staff_id=".$staff_id."" ) ; + // $de = json_decode($cronjobHit,true); + // if($de['status'] != '200'){ + // $_SESSION['system_result'] .= $de['message']; + // } + } + $_SESSION['system_result'] = 'success update' ; + + } + } + + } + + } + + header("Location: ".PATH."/hr-attendance-reprocessing.php?sort_by=staff_idno&sort_by_type=ASC") ; + exit ; +} + +$boolean_role = false ; +$boolean_edit = false ; +if ( $_SESSION['system_permission'] == 'admin' ){ + $boolean_role = true ; + if ( $edit == 'yes' ){ + $boolean_edit = true ; + } +} + +// active page +$active_main_menu = 'hr' ; +$active_sub_menu = 'hr-attendance' ; +$active_menu = 'hr-attendance-report' ; + +// 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' ) ; + +?> + + + + +
    + + + '.$_SESSION['system_result'].'
    ' ; + }else{ + echo '
    '.$_SESSION['system_result'].'
    ' ; + } + unset($_SESSION['system_result']) ; + } + + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query( "SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned >= '".date("Y-m-d",time())."' OR staff_date_resigned = '0000-00-00' OR staff_date_resigned IS NULL ) ".$user_branch_permission_sql.( $get_user_tier['check'] ? " AND staff_tier IN ( ".implode(', ', $get_user_tier['tiers'])." )" : '' )." ORDER BY staff_idno ASC" ) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + ?> + +
    +
    +
    +
    +
    + +
    + + + +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + + + + +
    +
    +
    +
    +
    + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/hr-attendance.php b/hr-attendance.php new file mode 100644 index 0000000..f319b55 --- /dev/null +++ b/hr-attendance.php @@ -0,0 +1,1861 @@ +query("SELECT * FROM system_user WHERE user_id = '".$_SESSION['system_id']."' "); +if ($mysqli_page->num_rows > 0){ + while($row_page=$mysqli_page->fetch_array(MYSQLI_ASSOC)){ + if($row_page['user_date_format'] == NULL){ + $dateformat = "Y-m-d"; + } + else{ + $dateformat = $row_page['user_date_format']; + } + $date01 = str_replace("d","01",$dateformat); + $date31 = str_replace("d","t",$dateformat); + + +// get all branch +$branch = [] ; +$get_branch = $mysqli->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'] ; + } +} + +$array_typelist = [ + 'PT' => 'Partime Day', + 'WD' => 'Working Day', + 'AL' => 'Annual Leave', + 'MC' => 'Sick Leave', + 'UL' => 'Unpaid Leave', + 'AS' => 'Absent', + 'HL' => 'Holiday', + 'OD' => 'Off Day' +] ; + +// mode type | all list | new | edit +switch( $page_mode ){ + case 'record-all': + include 'includes/Record/record-all.php'; + break; + case 'record-edit': + include 'includes/Record/record-edit.php'; + break; + + case 'admend-format-1' : + + /* + $result = 'failed' ; + $data = [] ; + + $staff_id = escapeString($_GET['staff_id']) ; + $check_group = escapeString($_GET['check_group']) ; + + if ( $staff_id != '' && $check_group != '' ){ + + $attendances_q = $mysqli->query("SELECT * FROM staff_attendance + WHERE staff_id = '".$staff_id."'AND check_group = '".$check_group."' AND deleted_at IS NULL + ORDER BY created_at ASC") ; + + if ( $attendances_q->num_rows > 0 ){ + + $result = 'success' ; + + while ( $attendance = $attendances_q->fetch_assoc() ){ + $data[] = [ + 'id' => $attendance['attendance_id'], + 'type' => ucwords($attendance['type']), + 'date' => date('Y-m-d', strtotime($attendance['created_at'])), + 'time' => date('H:i:s', strtotime($attendance['created_at'])) + ] ; + } + + $last_inout = '' ; + $last_date = '' ; + for ( $a = 0 ; $a < 8 ; $a++ ){ + + if ( !empty($data[$a]) ){ + $last_inout = $data[$a]['type'] ; + $last_date = $data[$a]['date'] ; + }else{ + + if ( $last_inout == 'In' ){ + $last_inout = 'Out' ; + }else{ + $last_inout = 'In' ; + } + + $data[$a] = [ + 'id' => 0, + 'type' => $last_inout, + 'date' => $last_date, + 'time' => '' + ] ; + + } + } + + }else{ + + $result = 'success' ; + + $last_inout = '' ; + for ( $a = 0 ; $a < 8 ; $a++ ){ + + if ( $last_inout == 'In' && $last_inout != '' ){ + $last_inout = 'Out' ; + }else{ + $last_inout = 'In' ; + } + + $data[$a] = [ + 'id' => 0, + 'type' => $last_inout, + 'date' => $check_group, + 'time' => '' + ] ; + } + } + + } + + echo json_encode([ + 'result' => $result, + 'data' => $data + ]) ; + exit ; + */ + + break ; + + case 'admend-format-2' : + + $result = 'failed' ; + $data = [] ; + + $staff_id = escapeString($_GET['staff_id']) ; + $check_group = escapeString($_GET['check_group']) ; + + if ( $staff_id != '' && $check_group != '' ){ + + $attendances_q = $mysqli->query("SELECT * FROM staff_attendance + WHERE staff_id = '".$staff_id."'AND created_at LIKE '".$check_group."%' AND deleted_at IS NULL + ORDER BY created_at ASC") ; + + if ( $attendances_q->num_rows > 0 ){ + + $result = 'success' ; + + while ( $attendance = $attendances_q->fetch_assoc() ){ + $data[] = [ + 'id' => $attendance['attendance_id'], + 'date' => date('Y-m-d', strtotime($attendance['created_at'])), + 'time' => date('H:i:s', strtotime($attendance['created_at'])), + 'remark' => dataFilter($attendance['remark']) + ] ; + } + + for ( $a = 0 ; $a < 8 ; $a++ ){ + + if ( !empty($data[$a]) ){ + $last_date = $data[$a]['date'] ; + }else{ + + $data[$a] = [ + 'id' => 0, + 'date' => $last_date, + 'time' => '', + 'remark' => '' + ] ; + + } + } + + }else{ + + $result = 'success' ; + + $last_inout = '' ; + for ( $a = 0 ; $a < 8 ; $a++ ){ + + $data[$a] = [ + 'id' => 0, + 'date' => $check_group, + 'time' => '', + 'remark' => '' + ] ; + } + } + + } + + echo json_encode([ + 'result' => $result, + 'data' => $data + ]) ; + exit ; + + break ; + + case 'list-limit' : + + $path = 'attendances/check' ; + $platform = 'web' ; + $lang = 'en' ; + $branch_id = $row_branch['branch_id'] ; + $staff_id = '' ; + $token = '' ; + $time = time() ; + $sign = hash('sha256', $path.$platform.$lang.$branch_id.$staff_id.$token.$time.APIKEY) ; + $call = call( 'curl', PATH.'api/'.$path.'.php', 'POST', [], [ + 'input_type' => 'selfpunch', + 'qrcode' => $staff_idno, + 'latitude' => '', + 'longitude' => '', + 'platform' => $platform, + 'lang' => $lang, + 'branch_id' => $branch_id, + 'staff_id' => $staff_id, + 'token' => $token, + 'time' => $time, + 'sign' => $sign + ] ) ; + echo json_encode( $call ) ; + exit ; + + break ; + + case 'selfpunch' : + + $status = '300' ; + $message = 'Staff not found.' ; + $alert = '' ; + $data = [] ; + $list = [] ; + + // staff_idno + $staff_idno = escapeString( $_GET['staff_idno'] ) ; + + if ( $staff_idno != '' ){ + + $path = 'attendances/punch' ; + $platform = 'web' ; + $lang = 'en' ; + $branch_id = $row_branch['branch_id'] ; + $staff_id = '' ; + $token = '' ; + $time = time() ; + $sign = hash('sha256', $path.$platform.$lang.$branch_id.$staff_id.$token.$time.APIKEY) ; + $call = call( 'curl', PATH.'api/'.$path.'.php', 'POST', [], [ + 'input_type' => 'selfpunch', + 'qrcode' => $staff_idno, + 'latitude' => '', + 'longitude' => '', + 'platform' => $platform, + 'lang' => $lang, + 'branch_id' => $branch_id, + 'staff_id' => $staff_id, + 'token' => $token, + 'time' => $time, + 'sign' => $sign + ] ) ; + + $status = $call['status'] ; + $message = $call['message'] ; + + if ( $call['status'] == '200' ){ + $alert = 'Scan success ( '.$staff_idno.' ).' ; + } + } + + echo json_encode([ + 'status' => $status, + 'message' => $message, + 'alert' => $alert + ]) ; + exit ; + + break ; + + case 'qrcode-check' : + + $status = '300' ; + $message = 'Code not found.' ; + $data = [] ; + $new_code = '' ; + $alert = '' ; + $boolean = false ; + + $type = $_POST['type'] ; + $qrcode = $_POST['qrcode'] ; + + // if code not found, generate one + if ( $qrcode != '' ){ + + $get_code = $mysqli->query("SELECT staff_id, code, status, created_at FROM qrcodes + WHERE type = '".$type."' AND code = '".$qrcode."' LIMIT 1") ; + + if ( $get_code->num_rows > 0 ){ + + $status = '220' ; + $message = 'Code expired.' ; + + $get = $get_code->fetch_assoc() ; + + $date_code = $get['created_at'] ; + $date_time = TODAYDATE ; + $date_time = date('Y-m-d H:i:s', strtotime($date_time . ' -5 minutes')) ; + + if ( $date_code > $date_time ){ + + $status = '210' ; + $message = 'Code used' ; + + // check code status + if ( $get['status'] == '0' ){ + + $status = '201' ; // Code used before + $message = 'Code can used back.' ; + $generate = $get['code'] ; + $boolean = true ; + + }elseif ( $get['status'] == '1' ){ // 1 mean scan success + + // get staff info + if ( $get['staff_id'] > 0 ){ + $get_staff = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id = '".$get['staff_id']."' LIMIT 1") ; + if ( $get_staff->num_rows > 0 ){ + $staff = $get_staff->fetch_assoc() ; + $alert = 'Scan success ( '.$staff['staff_idno'].' )' ; + } + } + + }elseif ( $get['status'] == '2' ){ // 2 mean scan success, but scan too fast + $alert = 'Accept rescan only after 15 minutes.' ; + } + + } + + } + + } + + if ( !$boolean ){ + $mysqli->query("INSERT INTO qrcodes + (type, status, created_at, updated_at) VALUES + ('checkin', '0', '".TODAYDATE."', '".TODAYDATE."')") ; + + // set new code + $last_id = $mysqli->insert_id ; + $new_code = 'PC|'.str_pad($last_id, 6, '0', STR_PAD_LEFT) ; + + $mysqli->query("UPDATE qrcodes SET + code = '".$new_code."' + WHERE qrcode_id = '".$last_id."'") ; + + $status = '200' ; + $message = 'New code generated' ; + } + + $generatecode = generateQrcode( '', $new_code, $new_code ) ; + $new_code = $generatecode['url'] ; + + echo json_encode([ + 'status' => $status, + 'message' => $message, + 'data' => [ + 'alert' => $alert, + 'code' => $generatecode['url'], + ] + ]) ; + exit ; + + break ; + + + + case 'qrcode' : + + // check permission + if ( !permissionCheck($row_user, 'attendance-list-qrcode') ){ + header('Location: index.php') ; + exit ; + } + + // active page + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-attendance' ; + $active_menu = 'hr-attendance-qrcode' ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + ?> + + + + + + + + + +
    + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
     
    + + + + + + $v ){ + $search_department_url .= '&search_department%5B'.$k.'%5D='.$v; + } + } + } + + if ( $search_name != '' ){ + $search_query .= " AND ( b.staff_name LIKE '%".$search_name."%' )" ; + } + if ( $search_idno != '' ){ + $search_query .= " AND ( b.staff_idno LIKE '%".$search_idno."%' )" ; + } + if ( $search_country != '' ){ + if ( $search_country == 'local' ){ + $search_query .= " AND b.country_id = '1'" ; + }else{ + $search_query .= " AND b.country_id != '1'" ; + } + } + if ( $search_branch != '' ){ + $search_query .= " AND b.branch_id = '".$search_branch."'" ; + } + + if ( $date_to != '' || $date_from != '' ){ + if ($date_from != '' && $date_to != ''){ + $search_query .= " AND a.list_date BETWEEN '".$date_from."' and '".$date_to."'" ; + }else if ( $date_from != '' ){ + $search_query .= " AND a.list_date >= '".$date_from."'" ; + }else{ + $search_query .= " AND a.list_date <= '".$date_to."'" ; + } + } + if ( $search_job_type_id != '' ){ + $search_query .= " AND b.job_type_id = '".$search_job_type_id."'" ; + } + + $mysqli_page = $mysqli->query("SELECT b.staff_id, b.staff_idno, b.staff_name, b.staff_salary, b.ot_rate_type, b.work_type_id FROM staff_attendance_list a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + ".$search_join." + WHERE b.deleted_at IS NULL AND ( b.staff_date_resigned IS NULL OR b.staff_date_resigned = '0000-00-00' OR b.staff_date_resigned >= '".$date_time."' ) AND a.deleted_at IS NULL AND a.list_date LIKE '%".$date_time."%' ".$search_query.$user_branch_permission_sql_b." + GROUP BY a.staff_id + ORDER BY b.staff_idno") ; + + + + + if ( $export == 'report-month' ){ + include 'hr-attendance-export-by-month.php' ; + } + if ( $export == 'report-template1' ){ + include 'hr-attendance-export-by-template1.php' ; + } + if ( $export == 'absence' ){ + include 'hr-attendance-absence-report1.php' ; + } + + + + // if ( $export == 'report-daily' ){ + // include 'hr-attendance-export-by-daily.php' ; + // } + + // active page + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-attendance' ; + $active_menu = 'hr-attendance-report' ; + + // required component + // get all job type + $job_type = [] ; + $get_job_type = $mysqli->query("SELECT * FROM master_job_type + WHERE deleted_at IS NULL") ; + if ( $get_job_type->num_rows > 0 ){ + while ( $row_job_type = $get_job_type->fetch_assoc() ){ + $job_type[$row_job_type['job_type_id']] = $row_job_type['job_type_desc'] ; + } + } + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + ?> + + +
    +
    + + +
    +
    search
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + " max=""/> +
    +
    +
    + +
    + " max=""/> +
    +
    +
    + +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    listing
    +
    + +
    +
    + +
    + + '.$date_time.'' ; + if ( $date_time >= date('Y-m', time()) ){}else{ + ?> + + +
    + +
    +
    + +
    +
    + + + + + + + + + $vtypelist ){ $default_typelist[$ktypelist] = 0 ; ?> + + + + + + + + + + + + num_rows > 0 ){ + + $get_result = 'success' ; + + $new_attendance = array() ; + $staff_ids = array() ; + while ( $attendance = $mysqli_page->fetch_assoc() ){ + $temp_attendance = [ + 'staff_id' => $attendance['staff_id'], + 'idno' => $attendance['staff_idno'], + 'name' => $attendance['staff_name'], + 'staff_salary' => $attendance['staff_salary'], + 'ot_rate_type' => $attendance['ot_rate_type'], + 'work_type_id' => $attendance['work_type_id'] + ] ; + + $new_attendance[$attendance['staff_id']] = $temp_attendance ; + $staff_ids[] = $attendance['staff_id'] ; + } + + + + + // get working day + $list_workday = [] ; + $select_attendancelist = $mysqli->query("SELECT staff_id, list_type_remark, COUNT( list_type_remark ) as count_list_type_remark, SUM( list_work_day ) as sum_list_work_day, SUM( list_leave_day ) as sum_list_leave_day FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) + GROUP BY staff_id, list_type_remark") ; + + if ( $select_attendancelist->num_rows > 0 ){ + while ( $row_attendancelist = $select_attendancelist->fetch_assoc() ){ + $list_workday[$row_attendancelist['staff_id']][$row_attendancelist['list_type_remark']] = $row_attendancelist ; + } + } + + + $list_time_off = [] ; + $select_attendancelist = $mysqli->query("SELECT staff_id, list_type_remark, list_time_off, list_time_off2 FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND ( list_time_off != '00:00:00' OR list_time_off2 != '00:00:00' )") ; + + if ( $select_attendancelist->num_rows > 0 ){ + while ( $row_attendancelist = $select_attendancelist->fetch_assoc() ){ + $get_sum_timeoff = $list_time_off[$row_attendancelist['staff_id']]['sum'] ; + $check_sum_timeoff = ( $get_sum_timeoff != '' ? $get_sum_timeoff : '00:00:00' ) ; + + if ( $row_attendancelist['list_time_off'] != '00:00:00' ){ + $list_time_off[$row_attendancelist['staff_id']]['count'] = ( $list_time_off[$row_attendancelist['staff_id']]['count'] + 1 ); + $list_time_off[$row_attendancelist['staff_id']]['sum'] = addTime( $check_sum_timeoff, $row_attendancelist['list_time_off'] ) ; + } + if ( $row_attendancelist['list_time_off2'] != '00:00:00' ){ + $list_time_off[$row_attendancelist['staff_id']]['count'] = ( $list_time_off[$row_attendancelist['staff_id']]['count'] + 1 ); + $list_time_off[$row_attendancelist['staff_id']]['sum'] = addTime( $check_sum_timeoff, $row_attendancelist['list_time_off2'] ) ; + } + } + } + + + + + // get staff leave + $list_leave = [] ; + $select_leavelist = $mysqli->query("SELECT staff_id, leave_type, leave_record_days FROM staff_leave_year + WHERE deleted_at IS NULL AND leave_year LIKE '".date( 'Y', strtotime( $date_time.'-01' ) )."%' AND staff_id IN ( ".implode(',', $staff_ids)." )") ; + if ( $select_leavelist->num_rows > 0 ){ + while ( $row_leavelist = $select_leavelist->fetch_assoc() ){ + $list_leave[$row_leavelist['staff_id']][$row_leavelist['leave_type']] = $row_leavelist ; + } + } + + // get staff given leave + $list_leave_given = [] ; + $select_leavegivenlist = $mysqli->query("SELECT staff_id, SUM(given_day) as total_given_day FROM staff_leave_month + WHERE deleted_at IS NULL AND given_date BETWEEN '".$year_of_day."' AND '".$month_of_day."' AND staff_id IN ( ".implode(',', $staff_ids)." ) + GROUP BY staff_id ") ; + if ( $select_leavegivenlist->num_rows > 0 ){ + while ( $row_leavegivenlist = $select_leavegivenlist->fetch_assoc() ){ + $list_leave_given[$row_leavegivenlist['staff_id']] = $row_leavegivenlist['total_given_day'] ; + } + } + + // get staff total use leave + $list_leave_used = [] ; + $select_leave_usedlist = $mysqli->query("SELECT staff_id, list_type_remark, SUM( list_leave_day ) as sum_list_leave_day FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date BETWEEN '".$year_of_day."' AND '".$month_of_last."' AND list_type_remark IN ( 'AL', 'MC' ) AND staff_id IN ( ".implode(',', $staff_ids)." ) + GROUP BY staff_id, list_type_remark") ; + + if ( $select_leave_usedlist->num_rows > 0 ){ + while ( $row_leave_usedlist = $select_leave_usedlist->fetch_assoc() ){ + $list_leave_used[$row_leave_usedlist['staff_id']][$row_leave_usedlist['list_type_remark']] = $row_leave_usedlist['sum_list_leave_day'] ; + } + } + + + + // get late + $list_late = [] ; + $select_latelist = $mysqli->query("SELECT staff_id, count( list_late ) as count_list_late, SEC_TO_TIME(SUM(TIME_TO_SEC(TIME_FORMAT(list_late, '%H:%i')))) as sum_list_late FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_late != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_latelist->num_rows > 0 ){ + while ( $row_late = $select_latelist->fetch_assoc() ){ + $list_late[$row_late['staff_id']] = [ + 'count' => $row_late['count_list_late'], + 'sum' => $row_late['sum_list_late'] + ] ; + } + } + + + // get early out + $list_earlyout = [] ; + $select_earlyoutlist = $mysqli->query("SELECT staff_id, count( list_early_out ) as count_list_early_out, SEC_TO_TIME(SUM(TIME_TO_SEC(TIME_FORMAT(list_early_out, '%H:%i')))) as sum_list_early_out FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_early_out != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_earlyoutlist->num_rows > 0 ){ + while ( $row_earlyoutlist = $select_earlyoutlist->fetch_assoc() ){ + $list_earlyout[$row_earlyoutlist['staff_id']] = [ + 'count' => $row_earlyoutlist['count_list_early_out'], + 'sum' => $row_earlyoutlist['sum_list_early_out'] + ] ; + } + } + + + + // get rest more + $list_rest_more = [] ; + $select_rest_morelist = $mysqli->query("SELECT staff_id, count( list_rest_more ) as count_list_rest_more, SEC_TO_TIME(SUM(TIME_TO_SEC(TIME_FORMAT(list_rest_more, '%H:%i')))) as sum_list_rest_more FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_rest_more != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_rest_morelist->num_rows > 0 ){ + while ( $row_rest_more = $select_rest_morelist->fetch_assoc() ){ + $list_rest_more[$row_rest_more['staff_id']] = [ + 'count' => $row_rest_more['count_list_rest_more'], + 'sum' => $row_rest_more['sum_list_rest_more'] + ] ; + } + } + + + + // get rest more 2 + $list_rest_more2 = [] ; + $select_rest_more2list = $mysqli->query("SELECT staff_id, count( list_rest_more2 ) as count_list_rest_more2, SEC_TO_TIME(SUM(TIME_TO_SEC(TIME_FORMAT(list_rest_more2, '%H:%i')))) as sum_list_rest_more2 FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_rest_more2 != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_rest_more2list->num_rows > 0 ){ + while ( $row_rest_more2 = $select_rest_more2list->fetch_assoc() ){ + $list_rest_more2[$row_rest_more2['staff_id']] = [ + 'count' => $row_rest_more2['count_list_rest_more2'], + 'sum' => $row_rest_more2['sum_list_rest_more'] + ] ; + } + } + + + // get ot + $list_ot = [] ; + $select_otlist = $mysqli->query("SELECT staff_id, count( list_ot_normal ) as count_list_ot_normal, SEC_TO_TIME(SUM(TIME_TO_SEC(TIME_FORMAT(list_ot_normal, '%H:%i')))) as sum_list_ot_normal FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_ot_normal != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_otlist->num_rows > 0 ){ + while ( $row_otlist = $select_otlist->fetch_assoc() ){ + $list_ot[$row_otlist['staff_id']] = [ + 'count' => $row_otlist['count_list_ot_normal'], + 'sum' => $row_otlist['sum_list_ot_normal'] + ] ; + } + } + + + // render table + foreach ( $new_attendance as $key => $value ){ + echo ' + + + + ' ; + + $array_tablelist = [] ; + $total_workday = 0 ; + $total_realwork = 0 ; + + $get_late = checkExists( $list_late[$value['staff_id']]['count'] ) ; + $get_sum_late = checkExists( $list_late[$value['staff_id']]['sum'] ) ; + $get_earlyout = checkExists( $list_earlyout[$value['staff_id']]['count'] ) ; + $get_sum_earlyout = checkExists( $list_earlyout[$value['staff_id']]['sum'] ) ; + $get_ot = checkExists( $list_ot[$value['staff_id']]['count'] ) ; + $get_sum_ot = checkExists( $list_ot[$value['staff_id']]['sum'] ) ; + $get_timeoff = checkExists( $list_time_off[$value['staff_id']]['count'] ) ; + $get_sum_timeoff = checkExists( $list_time_off[$value['staff_id']]['sum'] ) ; + $get_restmore = checkExists( $list_rest_more[$value['staff_id']]['count'] ) ; + $get_sum_restmore = checkExists( $list_rest_more[$value['staff_id']]['sum'] ) ; + $get_restmore2 = checkExists( $list_rest_more2[$value['staff_id']]['count'] ) ; + $get_sum_restmore2 = checkExists( $list_rest_more2[$value['staff_id']]['sum'] ) ; + + $total_restmore_list = [] ; + if ( $get_sum_restmore != '' ){ $total_restmore_list[] = $get_sum_restmore ; } + if ( $get_sum_restmore2 != '' ){ $total_restmore_list[] = $get_sum_restmore2 ; } + + $total_restmore = 0 ; + foreach ( $total_restmore_list as $krestmore => $vrestmore ){ + $total_restmore += convertMinutes( $vrestmore ) ; + } + + $get_leave = $list_leave[$value['staff_id']] ; + $get_leave_annual = $get_leave['annual'] ; + $get_leave_sick = $get_leave['sick'] ; + + $get_leave_used = $list_leave_used[$value['staff_id']] ; + $get_leave_annual_used = $get_leave_used['AL'] ; + $get_leave_sick_used = $get_leave_used['MC'] ; + + $get_leave_annual_given = $list_leave_given[$value['staff_id']] ; + + foreach ( $array_typelist as $ktypelist => $vtypelist ){ + $get_workday = checkExists( $list_workday[$value['staff_id']][$ktypelist] ) ; + $days = 0 ; + $total_realwork += $get_workday['sum_list_work_day'] ; + + switch ( $ktypelist ){ + case 'WD' : + case 'PT' : + case 'AL' : + case 'MC' : + case 'UL' : + case 'AS' : + $total_workday += $get_workday['count_list_type_remark'] ; + break ; + } + + + + + switch ( $ktypelist ){ + case 'WD' : + case 'PT' : + $days = $get_workday['sum_list_work_day'] ; + break ; + case 'AL' : + case 'MC' : + case 'UL' : + $days = $get_workday['sum_list_leave_day'] ; + break ; + case 'AS' : + case 'HL' : + case 'OD' : + $days = $get_workday['count_list_type_remark'] ; + break ; + } + + + + + if ( $ktypelist != 'WD' && $ktypelist != 'PT' && $ktypelist != 'HL' && $ktypelist != 'OD' ){ + + $temp_typelist = '' ; + $days = ( $days + 0 ) ; + + switch ( $ktypelist ){ + case 'AL' : + $temp_typelist = '' ; + break ; + case 'MC' : + $temp_typelist = '' ; + break ; + case 'UL' : + $temp_typelist = '' ; + break ; + default : + $temp_typelist = '' ; + } + + $array_tablelist[] = $temp_typelist ; + } + } + + echo '' ; + echo implode( '', $array_tablelist ) ; + + echo '' ; + echo '' ; + echo '' ; + echo '' ; + + echo ' + ' ; + } + + } + ?> + +
    IDLateEarly OutOver RestOT
    + + '.$value['idno'].''.ucwords($value['name']).'' ; + if ( $get_leave_annual['leave_record_days'] > 0 ){ + $temp_typelist .= ( $days > 0 ? ''.$days.'' : '-' ) .' / '.( $get_leave_annual_given - $get_leave_annual_used + 0 ) .' / '.( $get_leave_annual['leave_record_days'] + 0 ) . ' ( '.( $get_leave_annual_given + 0 ).' )' ; + } + $temp_typelist .= ''. ( $days > 0 ? ''.$days.'' : '-' ) .' / '.( $get_leave_sick['leave_record_days'] - $get_leave_sick_used + 0 ) .' / '.( $get_leave_sick['leave_record_days'] + 0 ).''. ( $days > 0 ? ''.$days.'' : '' ) .''. ( $days > 0 ? $days : 0 ) .'' . $total_realwork . ' / ' . $total_workday . ''.( $get_late > 0 ? $get_late . ' ( ' . $get_sum_late . ' )' : '' ).''.( $get_earlyout > 0 ? $get_earlyout . ' ( ' . $get_sum_earlyout . ' )' : '' ).''.( $total_restmore > 0 ? convertToTimes( $total_restmore ) : '' ).''.( $get_ot > 0 ? $get_ot . ' ( ' . $get_sum_ot . ' )' : '' ).'
    + +
    +
    + +
    +
    +
    +
    + + query("SELECT * FROM staff_attendance_list a + WHERE a.staff_id = '".$staff_id."' AND a.list_date LIKE '%".$date_time."%' AND a.deleted_at IS NULL ORDER BY a.list_date ASC") ; + + // get staff information + $staff = $mysqli->query("SELECT staff_idno, staff_name FROM staff + WHERE staff_id = '".$staff_id."' LIMIT 1") ; + $staff_name = '' ; + $staff_idno = '' ; + if ( $staff->num_rows > 0 ){ + $row_staff = $staff->fetch_assoc() ; + $staff_name = $row_staff['staff_name'] ; + $staff_idno = $row_staff['staff_idno'] ; + } + + // get all attendance time + $attendances = $mysqli->query("SELECT list_id, created_at FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND check_group LIKE '%".$date_time."%' ORDER BY created_at ASC") ; + $attendances_list = [] ; + if ( $attendances->num_rows > 0 ){ + while ( $row = $attendances->fetch_assoc() ){ + $attendances_list[$row['list_id']][] = $row ; + } + } + + // active page + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-attendance' ; + $active_menu = 'hr-attendance-report' ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + ?> + + +
    + + +
    +
    + ID :
    + : +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $value = $mysqli_page->fetch_assoc() ){ + + $date = date('w', strtotime($value['list_date'])) ; + $date = $date_array[$date] ; + + $attendances_date = $attendances_list[$value['list_id']] ; + + $bg_color = '' ; + + switch ( $value['list_type_remark'] ){ + case 'WD' : $bg_color = '' ; break ; + case 'AL' : $bg_color = '#ffccf0' ; break ; + case 'UL' : $bg_color = '#fff6cc' ; break ; + case 'MC' : $bg_color = '#ffd9cc' ; break ; + case 'AS' : $bg_color = '#ffcccc' ; break ; + case 'HL' : $bg_color = '#ccfffd' ; break ; + case 'OD' : $bg_color = '#daccff' ; break ; + case 'PT' : $bg_color = '#ffd5d1' ; break ; + } + + if ( $value['list_work'] != '00:00:00' ){ + $list_total_work[] = $value['list_work'] ; + } + + echo ' + + + + ' ; + + for ( $a = 0 ; $a < 8 ; $a++ ){ + $current_time = $attendances_date[$a]['created_at'] ; + $current_time = ( $current_time != '' ? date('H:i:s', strtotime($current_time)) : '' ) ; + echo ' + ' ; + } + if ( EXCELDETAIL == "YES" ){ + echo ' + + '; + } + + + echo ' + + + + + + + + + + + ' ; + } + } + ?> + + + + + + + + +
    DateDayWork dayWork DayT DayWorkRest 1Rest Timeout 1Rest 2Rest Timeout 2EarlyLateEarly OutOTRemark
    '. $value['list_date'] .''. $lang[$date] .''.( $value['list_work_day'] > 0 ? ''.$value['list_work_day'].'' : $value['list_work_day'] ).' +
    '. $current_time .'
    +
    '. ( $value['list_work_day'] != '0.00' ? $value['list_work_day'] : '' ) .''. ( $value['list_ot_day'] != '0.00' ? $value['list_ot_day'] : '' ) .''. ( $value['list_work'] != '00:00:00' ? $value['list_work'] : '' ) .' + '. ( $value['list_rest'] != '00:00:00' ? $value['list_rest'] : '' ) .' + '. ( $value['list_time_off'] != '00:00:00' ? '( '.$value['list_time_off'].' )' : '' ) .' + '. ( $value['list_rest_more'] != '00:00:00' ? $value['list_rest_more'] : '' ) .' + '. ( $value['list_rest2'] != '00:00:00' ? $value['list_rest2'] : '' ) .' + '. ( $value['list_time_off2'] != '00:00:00' ? '( '.$value['list_time_off2'].' )' : '' ) .' + '. ( $value['list_rest_more2'] != '00:00:00' ? $value['list_rest_more2'] : '' ) .''. ( $value['list_early'] != '00:00:00' ? $value['list_early'] : '' ) .''. ( $value['list_late'] != '00:00:00' ? $value['list_late'] : '' ) .''. ( $value['list_early_out'] != '00:00:00' ? $value['list_early_out'] : '' ) .''. ( $value['list_ot_normal'] != '00:00:00' ? $value['list_ot_normal'] : '' ) .''. $value['list_remark'] .'
    Total 
    + +
    +
    + +
    +
    + +
    + + $value) { + if ( $value != '' ){ + $required_reprocess[$key] = $value ; + } + } + + if(arrayCheck($required_reprocess)){ + foreach ($required_reprocess as $key => $value) { + $u_saw = "UPDATE staff_attendance_working SET deleted_at = '".TODAYDATE."' WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND working_date = '".$key."' " ; + $mysqli->query($u_saw) ; + + // get staff working hours + $working_q2 = $mysqli->query("SELECT group_id, working_on, working_next_day, working_if_flexi, working_if_include_rest, working_if_ot, working_direct_day, working_if_fixed_work, working_day_calculation, working_morning_start as working_period_from, working_morning_end as working_period_to, working_period_before, working_break_start as working_from, working_break_end as working_to, working_total_hours, working_total_rest_hours, working_rest_range_from, working_rest_range_to, working_rounding_ot, working_if_ot_morning, working_if_offduty, working_count_offduty, working_if_deduct_offduty, working_max_ot,working_total_rest_hours2,working_rest_range_from2,working_rest_range_to2 FROM setting_working + WHERE deleted_at IS NULL AND group_id = '".$value."' AND working_day = '".date('N', strtotime($key))."' LIMIT 1") ; + + // check if working setting got set + if ( $working_q2->num_rows > 0 ){ + $working = $working_q2->fetch_assoc() ; + $mysqli->query("INSERT INTO staff_attendance_working + (staff_id, working_group_id, working_date, working_on, working_next_day, working_if_flexi, working_if_include_rest, working_if_ot, working_direct_day, working_if_fixed_work, working_day_calculation, working_period_from, working_period_to, working_period_before, working_from, working_to, working_total_hours, working_total_rest_hours, working_rest_range_from, working_rest_range_to, working_rounding_ot, working_if_ot_morning, working_if_offduty, working_count_offduty, working_if_deduct_offduty, working_max_ot, created_at, updated_at, working_total_rest_hours2, working_rest_range_from2, working_rest_range_to2) VALUES + ('".$staff_id."', '".$working['group_id']."', '".$key."', '".$working['working_on']."', '".$working['working_next_day']."', '".$working['working_if_flexi']."', '".$working['working_if_include_rest']."', '".$working['working_if_ot']."', '".$working['working_direct_day']."', '".$working['working_if_fixed_work']."', '".$working['working_day_calculation']."', '".$working['working_period_from']."', '".$working['working_period_to']."', '".$working['working_period_before']."', '".$working['working_from']."', '".$working['working_to']."', '".$working['working_total_hours']."', '".$working['working_total_rest_hours']."', ".( $working['working_rest_range_from'] != '' ? "'".$working['working_rest_range_from']."'" : "NULL" ).", ".( $working['working_rest_range_to'] != '' ? "'".$working['working_rest_range_to']."'" : "NULL" ).", '".$working['working_rounding_ot']."', '".$working['working_if_ot_morning']."', '".$working['working_if_offduty']."', '".$working['working_count_offduty']."', '".$working['working_if_deduct_offduty']."', '".$working['working_max_ot']."', '".TODAYDATE."', '".TODAYDATE."','".$working['working_total_rest_hours2']."','".$working['working_rest_range_from2']."','".$working['working_rest_range_to2']."')") ; + + } + + } + } + } + header('Location: hr-attendance.php?page_mode=reprocessing-list&date_time='.$date_time.'&staff_id='.$staff_id.'&a=1') ; + exit ; + } + + $mysqli_page = $mysqli->query("SELECT * FROM staff_attendance_list a + WHERE a.staff_id = '".$staff_id."' AND a.list_date LIKE '%".$date_time."%' AND a.deleted_at IS NULL ORDER BY a.list_date ASC") ; + + // get staff information + $staff = $mysqli->query("SELECT staff_idno, staff_name FROM staff + WHERE staff_id = '".$staff_id."' LIMIT 1") ; + $staff_name = '' ; + $staff_idno = '' ; + if ( $staff->num_rows > 0 ){ + $row_staff = $staff->fetch_assoc() ; + $staff_name = $row_staff['staff_name'] ; + $staff_idno = $row_staff['staff_idno'] ; + } + + // get all attendance time + $attendances = $mysqli->query("SELECT staff_id, list_id, created_at FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND check_group LIKE '%".$date_time."%' ORDER BY created_at ASC") ; + $attendances_list = [] ; + if ( $attendances->num_rows > 0 ){ + while ( $row = $attendances->fetch_assoc() ){ + $attendances_list[$row['list_id']][] = $row ; + } + } + + // 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' ; + ?> + + +
    + + '.$_SESSION['system_result'].'
    ' ; + }else{ + echo '
    '.$_SESSION['system_result'].'
    ' ; + } + unset($_SESSION['system_result']) ; + } + ?> +
    +
    + ID :
    + : +
    +
    + +
    +
    + +
    + +
    + + + +
    + +
    + +
    +
    + +
    +
    +
    + + + + + + + + + + + + query($mysqli_work); + if ($mwk->num_rows > 0){ + while ($rmwk = $mwk->fetch_array(MYSQLI_ASSOC)){ + $arr_work[] = $rmwk; + } + } + + $attendances = [] ; + if ( $mysqli_page->num_rows > 0 ){ + while ( $value = $mysqli_page->fetch_assoc() ){ + $attendances[$value['list_date']] = $value ; + } + } + + for ( $loop = 1 ; $loop <= $last_day ; $loop++ ){ + + $select_date = $date_time.'-'.strPad(2, $loop) ; + $select_day_w = date('w', strtotime($select_date)) ; + $select_day_w = $date_array[$select_day_w] ; + + $value = $attendances[$select_date] ; + $attendances_date = $attendances_list[$value['list_id']] ; + + echo ' + + + + + + + + + ' ; + } + ?> + +
    '. $select_date .''. $lang[$select_day_w] .'' ; + + for ( $a = 0 ; $a < 8 ; $a++ ){ + $current_time = $attendances_date[$a]['created_at'] ; + $current_time = ( $current_time != '' ? date('H:i:s', strtotime($current_time)) : '' ) ; + echo '
    '. $current_time .'
    ' ; + } + + echo ' +
    + +
    + + +
    +
    +
    + +
    +
    + + + + \ No newline at end of file diff --git a/hr-employment-pdf.php b/hr-employment-pdf.php new file mode 100644 index 0000000..9987f83 --- /dev/null +++ b/hr-employment-pdf.php @@ -0,0 +1,243 @@ +query("SELECT * FROM staff_employment + WHERE employment_id = '".$page."' AND employment_trash = '0' ".$search_query." LIMIT 1"); +// check quotation +if ($mysqli_page->num_rows > 0){ + + // set query in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + + // employment position + $mysqli_position = $mysqli->query("SELECT post_title FROM system_post + WHERE post_id = '".$row_page['employment_position']."' AND post_type = 'hr-position' AND post_categories = 'hr-position' LIMIT 1") ; + if ($mysqli_position->num_rows > 0){ + $row_position = $mysqli_position->fetch_array(MYSQLI_ASSOC) ; + $position = dataFilter($row_position['post_title']) ; + } + + // incharge person + $mysqli_query = "SELECT * FROM system_user + WHERE user_id = '".$row_page['employment_user_id']."' AND (user_permission = 'admin' OR user_permission = 'hr') AND user_trash = '0' LIMIT 1" ; + $mysqli_incharge_by = $mysqli->query($mysqli_query) ; + if ($mysqli_incharge_by->num_rows > 0){ + $row_incharge_by = $mysqli_incharge_by->fetch_array(MYSQLI_ASSOC) ; + $incharge_by = dataFilter($row_incharge_by['user_call']).' . '.dataFilter($row_incharge_by['user_fullname']) ; + } + + // assigned by + $mysqli_query = "SELECT * FROM system_user a + LEFT JOIN system_post b ON (a.user_position = b.post_id) + WHERE user_id = '".$row_page['employment_assign_by']."' AND (user_permission = 'admin' OR user_permission = 'hr') AND user_trash = '0' ORDER BY user_name" ; + $mysqli_assign_by = $mysqli->query($mysqli_query) ; + if ($mysqli_assign_by->num_rows > 0){ + $row_assign_by = $mysqli_assign_by->fetch_array(MYSQLI_ASSOC) ; + $assign_by = dataFilter($row_assign_by['user_call']).' . '.dataFilter($row_assign_by['user_fullname']) ; + $assign_by_position = dataFilter($row_assign_by['post_title']) ; + } + + switch($type){ + case 'offer' : + case 'iea' : + $status_text = jsonEncodeDecode('decode', $row_page['employment_status_text']) ; + $offer_status = $status_text['offer_status'] ; + break ; + case 'confirmation' : + $employment_confirmation_date = $row_page['employment_confirmation_date'] ; + $employment_confirmation_date = ($employment_confirmation_date != '0000-00-00 00:00:00' ? date('d.m.Y', strtotime($employment_confirmation_date)) : '') ; + break ; + case 'terminate' : + $employment_terminate_date = $row_page['employment_terminate_date'] ; + $employment_terminate_date = ($employment_terminate_date != '0000-00-00 00:00:00' ? date('d.m.Y', strtotime($employment_terminate_date)) : '') ; + break ; + } + + $new_worker = dataFilter($row_page['employment_call']).' . '.dataFilter($row_page['employment_name']) ; + + $letter_head = getOwnerCompanyLetterHead($row_page['employment_branch']) ; + $html2 = ''; + + // set body content + $html = $letter_head['header'].' + + + + + + ' ; + switch($type){ + case 'pending' : + include_once 'HR/letter-pending.php' ; + break ; + case 'offer' : + include_once 'HR/letter-offer.php' ; + break ; + case 'iea' : + // include_once 'HR/letter-iea.php' ; + include_once 'HR/letter-iea-temp.php' ; + + // page footer + $footer = ' +
     
    + '.$title.' +
     
    + + + +
    {PAGENO}
    ' ; + + break ; + case 'confirmation' : + include_once 'HR/letter-confirmation.php' ; + break ; + case 'terminate' : + include_once 'HR/letter-terminate.php' ; + break ; + } + $html .= ' + '.$html2.$html_offer ; + + + // page header + $header = '' ; + + // keep footer html content in variable + include_once 'MPDF/mpdf.php' ; + + $mpdf = new mPDF('utf-8', 'A4', '', 'freesans', 15, 15, 15, 15, 5, 5) ; + ini_set("memory_limit","999999999999999999999999999999999999999999M"); + + // Use different Odd/Even headers and footers and mirror margins + $mpdf->mirrorMargins = 1 ; + + //allow special character + $mpdf->useAdobeCJK = true; + + // set mpdf header + $mpdf->SetHTMLHeader($header) ; + $mpdf->SetHTMLHeader($header,'E') ; + + // set mpdf footer + $mpdf->SetHTMLFooter($footer) ; + $mpdf->SetHTMLFooter($footer,'E') ; + + // write in html + $mpdf->WriteHTML($html) ; + + // set filename + $filename = $print_filename.'-'.strPad(3, $page) ; // Your Filename whit local date and time + $filename_save = $filename.'.pdf' ; + $filename_jpeg = $filename.'.jpg' ; + $filename_temp = $filename ; + + // turns all headers/footers off from new page onwards + $mpdf->useAdobeCJK = true; + + // check output type + $page_type = ($_GET['page_type']) ; + $page_type_output = ($page_type == 'jpeg' ? 'F' : 'I') ; + + //$mpdf->SetAutoFont(AUTOFONT_ALL); + $mpdf->Output($filename_save, $page_type_output); + + // check page type + if ($page_type == 'jpeg'){ + //******************************************************************* + //******************************************************************* save pdf file to jpeg file + //******************************************************************* + $img = new imagick() ; + //this must be called before reading the image, otherwise has no effect - "-density {$x_resolution}x{$y_resolution}" + $img->setResolution(300,300) ; //this is important to give good quality output, otherwise text might be unclear + $img->readImage("{$filename_save}") ; //read the pdf + $total_page = $img->getNumberImages() ; + $img->setImageFormat('jpg') ; //set new format + $img->writeImages($filename_jpeg, true) ; //save image file + //******************************************************************* + //******************************************************************* force download jpeg file + //******************************************************************* + $file_name = $filename_jpeg ; // grab the requested file's name + // make sure it's a file before doing anything! + if ($total_page > 1){ + for ($i = 0; $i < $total_page; $i++){ + $file_name = $filename_temp.'-'.$i.'.jpg' ; + if(is_file($file_name)) { + $files_to_zip[] = $file_name ; + } + } + create_zip($files_to_zip, $filename_temp.'.zip') ; + for ($i = 0; $i < $total_page; $i++){ unlink($filename_temp.'-'.$i.'.jpg') ; } + $file_name = $filename_jpeg = $filename_temp.'.zip' ; + } + if(is_file($file_name)) { + // required for IE + if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'Off') ; } + // get the file mime type using the file extension + switch(strtolower(substr(strrchr($file_name, '.'), 1))) { + case 'pdf': $mime = 'application/pdf'; break ; + case 'zip': $mime = 'application/zip'; break ; + case 'jpeg': + case 'jpg': $mime = 'image/jpg'; break ; + default: $mime = 'application/force-download' ; + } + header('Pragma: public') ; // required + header('Expires: 0') ; // no cache + header('Cache-Control: must-revalidate, post-check=0, pre-check=0') ; + header('Last-Modified: '.gmdate ('D, d M Y H:i:s', filemtime ($file_name)).' GMT') ; + header('Cache-Control: private',false) ; + header('Content-Type: '.$mime) ; + header('Content-Disposition: attachment; filename="'.basename($file_name).'"') ; + header('Content-Transfer-Encoding: binary') ; + header('Content-Length: '.filesize($file_name)) ; // provide file size + header('Connection: close') ; + readfile($file_name); // push it out + } + unlink($filename_jpeg) ; + unlink($filename_save) ; + echo '' ; + } + exit ; +} +// redirect page +header("Location: main.php") ; +exit ; +?> diff --git a/hr-employment-schedule-interview-date.php b/hr-employment-schedule-interview-date.php new file mode 100644 index 0000000..7aed324 --- /dev/null +++ b/hr-employment-schedule-interview-date.php @@ -0,0 +1,376 @@ +alert("Sorry, you don\'t have permission to view the page");' ; + exit ; +} + +$mysqli_page = $mysqli->query( "SELECT * FROM staff_employment + WHERE employment_id = '".$page."' AND employment_trash = '0' LIMIT 1" ) ; +if ( $mysqli_page->num_rows == 0 ){ + echo '' ; + exit ; +} +$row_page = $mysqli_page->fetch_assoc() ; + + +$branch_hr_email = '' ; +$branch_hr_cc = [] ; +$branch_email_footer = '' ; +$mysqli_branch = $mysqli->query( "SELECT * FROM branch + WHERE deleted_at IS NULL AND branch_id = '".$row_page['employment_branch']."' LIMIT 1" ) ; +if ( $mysqli_branch->num_rows == 0 ){ + echo '' ; + exit ; +} +$row_branch = $mysqli_branch->fetch_assoc() ; +$branch_name = dataFilter( $row_branch['branch_name'] ) ; +$branch_hr_email = dataFilter( $row_branch['branch_hr_email'] ) ; +$branch_hr_cc = explodeToArray( $row_branch['branch_hr_cc'] ) ; +$branch_email_footer = entityDecode( dataFilter( $row_branch['branch_email_footer'] ) ) ; + +$mysqli_schedule_date = $mysqli->query("SELECT weekdays FROM setting_employment_schedule + WHERE deleted_at IS NULL LIMIT 1") ; +if ( $mysqli_schedule_date->num_rows == 0 ){ + echo '' ; + exit ; +} +$row_schedule_date = $mysqli_schedule_date->fetch_assoc() ; +$weekdays = json_decode( $row_schedule_date['weekdays'] ) ; + +// get position +$mysqli_position = $mysqli->query("SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.job_position_id = '".$row_page['employment_position']."' LIMIT 1") ; +$job_position_desc = '' ; +if ( $mysqli_position->num_rows > 0 ){ + $row_position = $mysqli_position->fetch_assoc() ; + $job_position_desc = $row_position['job_position_desc'] ; +} + +// page header +$letter_head = getOwnerCompanyLetterHead($branch_id) ; +$header = $letter_head['header'] ; + +if ( $_POST['hidden'] != '' ){ + $employment_interview_date = escapeString($_POST['employment_interview_date']) ; + $is_reschedule = escapeString($_POST['is_reschedule']) ; + $error = 'Selected date was select by other candidate' ; + + $select_check_date = $mysqli->query( "SELECT * FROM staff_employment + WHERE employment_id != '".$page."' AND employment_trash = '0' AND ( employment_interview_date = '".$employment_interview_date."' OR employment_r_candidate = '".$employment_interview_date."' ) LIMIT 1" ) ; + + if ( $select_check_date->num_rows == 0 ){ + $error = 'Cannot set schedule date' ; + + $is_sendemail = '' ; + switch ( $is_reschedule ){ + case 'no' : + $error = 'Failed to update' ; + + if ( $mysqli->query( "UPDATE staff_employment SET + employment_status = 'Processing Interview Slot', + employment_interview_date = '".$employment_interview_date."' + WHERE employment_id = '".$page."'" ) ){ + $descrition = 'Candidate schedule interview date to ' . $employment_interview_date . '.' ; + $mysqli->query( "INSERT INTO system_log_employment (log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ( 'employment', 'update-status', '200', 'AF-".$page."', '', '".$descrition."', '', NOW())" ) ; + + $is_sendemail = 'selected' ; + + $error = 'Success' ; + } + + break ; + case 'yes' : + $error = 'Failed to update' ; + + if ( $mysqli->query( "UPDATE staff_employment SET + employment_status = 'Reschedule', + employment_r_interview_date = '".$employment_interview_date."', + employment_r_candidate = '1' + WHERE employment_id = '".$page."'" ) ){ + $descrition = 'Candidate reschedule interview date from ' . $row_page['employment_interview_date'] . ' to ' . $employment_interview_date ; + $mysqli->query( "INSERT INTO system_log_employment (log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ( 'employment', 'update-status', '200', 'AF-".$page."', '', '".$descrition."', '', NOW())" ) ; + + $is_sendemail = 'reschedule' ; + + $error = 'Success' ; + } + + break ; + } + + if ( $is_sendemail ){ + $mailer->from = $branch_hr_email ; + $mailer->fromname = COMPANY ; + $mailer->to = [ $branch_hr_email ] ; + if ( count($branch_hr_cc) > 0 ){ + $mailer->cc = $branch_hr_cc ; + } + $mailer->subject = 'Reminder for Recruitment' ; + $mailer->body = 'Dear HR, '.ucwords($row_page['employment_name']).' has '.$is_sendemail.' interview slot for '.$job_position_desc.'. Please log in to review. +

    + * This is an auto-generated message, please do not reply.' ; + $mailer->send() ; + } + + } + + $_SESSION['system_error'] = $error ; + header( "Refresh:0;" ) ; + exit ; +} +?> + + + + + + + + Schedule Interview Date- <?= COMPANY ?> + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
     
    + + + + +
    + INTERVIEW DATE +
    +
     
    + + + + + + + + +
    + Your application to schedule interview date was submitted. + + +
    +
     
     
    Name : + +
     
    Position Applied : + +
     
    Branch Applied : + +
     
    + Schedule Date : + + +
     
    + : + + +
    + + + + +
    +
    +
    + alert("Sorry, you don\'t have permission the page.");' ; +} +?> + + + + + + + + + + + diff --git a/hr-employment.php b/hr-employment.php new file mode 100644 index 0000000..1a1a393 --- /dev/null +++ b/hr-employment.php @@ -0,0 +1,623 @@ +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 DESC") ; +if ( $mysqli_tier->num_rows > 0 ){ + while ( $row_tier = $mysqli_tier->fetch_assoc() ){ + $tier_list[] = $row_tier ; + $tier_list_id[$row_tier['tier_id']] = $row_tier['title'] ; + } +} + +$get_user_tier = userTierQuery( $row_user ) ; + +// mode type | all list | new | edit +switch($page_mode){ + + // new department + case 'new' : + + // check permission + if ( !permissionCheck($row_user, 'application-form-view') ){ + echo ''; + header('Location: index.php') ; + exit ; + } + + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-employment' ; + $active_menu = 'hr-employment-new' ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + // check select worker + switch($select_worker){ + case 'Local' : + include 'HR/hr-local-new.php' ; + break ; + } + + break ; + + // edit category + case 'edit' : + + // check permission + if ( !permissionCheck($row_user, 'application-list-edit') ){ + echo ''; + header('Location: index.php') ; + exit ; + } + + // active page + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-employment' ; + $active_menu = 'hr-employment' ; + + $boolean_redirect = false ; + + $page_status = escapeString( $_POST['page_status'] ) ; + + if ( $page_status == 'new' ){ + $worker_status = 'Pending' ; + $confirmation_date = ($worker_status == 'Confirmation' ? TODAYDATE : '') ; + + $select_employment = $mysqli->query( "SELECT * FROM staff_employment + WHERE employment_trash = '0' AND employment_status = 'Pending' AND employment_email = '".escapeString($_POST['personal_email'])."' + LIMIT 1" ) ; + if ( $select_employment->num_rows == 0 ){ + $mysqli->query("INSERT INTO staff_employment (employment_status, employment_confirmation_date, employment_date, employment_modified, employment_trash) VALUES ('".$worker_status."', '".$confirmation_date."', '".TODAYDATE."', '".TODAYDATE."', '0')"); + $page = $mysqli->insert_id; + }else{ + $boolean_redirect = true ; + $_SESSION['system_result'] = 'failed-exists' ; + header("Location: hr-employment.php?page_mode=all&select_worker=Local&type=pending") ; + exit ; + } + } + + // check query exsits + $mysqli_page = $mysqli->query("SELECT * FROM staff_employment + WHERE employment_id = '".$page."' AND employment_trash = '0' LIMIT 1") ; + if ($mysqli_page->num_rows > 0){ + + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $select_worker = $row_page['employment_type'] ; + $employment_status = $row_page['employment_status'] ; + + // check select worker + include 'HR/hr-local-edit.php' ; + + }else{ + $boolean_redirect = true ; + } + + if ($boolean_redirect){ + print_r('test'.$page); + exit; + header("Location: hr-employment.php?page_mode=all") ; + exit ; + } + + break ; + + // edit status + case 'edit_status' : + + // check permission + if ( !permissionCheck($row_user, 'application-list-edit') ){ + echo ''; + header('Location: index.php') ; + exit ; + } + + // active page + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-employment' ; + $active_menu = 'hr-employment' ; + + $boolean_redirect = false ; + + $page_status = escapeString( $_POST['page_status'] ) ; + + if ( $page_status == 'new' ){ + $worker_status = 'Pending' ; + $confirmation_date = ($worker_status == 'Confirmation' ? TODAYDATE : '') ; + + $mysqli->query("INSERT INTO staff_employment (employment_status, employment_confirmation_date, employment_date, employment_modified, employment_trash) VALUES ('".$worker_status."', '".$confirmation_date."', '".TODAYDATE."', '".TODAYDATE."', '0')"); + + $page = $mysqli->insert_id; + } + + // check query exsits + $mysqli_page = $mysqli->query("SELECT * FROM staff_employment + WHERE employment_id = '".$page."' AND employment_trash = '0' LIMIT 1") ; + if ( $mysqli_page->num_rows > 0 ){ + + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $select_worker = $row_page['employment_type'] ; + $employment_status = $row_page['employment_status'] ; + + // check select worker + include 'HR/hr-local-edit-status.php' ; + }else{ + $boolean_redirect = true ; + } + + if ($boolean_redirect){ + header("Location: hr-employment.php?page_mode=all") ; + exit ; + } + + break ; + + // edit status + case 'edit_interview_det' : + + // check permission + if ( !permissionCheck($row_user, 'application-list-edit') ){ + echo ''; + header('Location: index.php') ; + exit ; + } + + // active page + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-employment' ; + $active_menu = 'hr-employment' ; + $boolean_redirect = false ; + + $page_status = $_POST['page_status'] ; + if ($page_status == 'new'){ + $worker_status = 'Pending' ; + $confirmation_date = ($worker_status == 'Confirmation' ? TODAYDATE : '') ; + $mysqli->query("INSERT INTO staff_employment (employment_status, employment_confirmation_date, employment_date, employment_modified, employment_trash) VALUES ('".$worker_status."', '".$confirmation_date."', '".TODAYDATE."', '".TODAYDATE."', '0')"); + $page = $mysqli->insert_id; + + } + + // check query exsits + $mysqli_page = $mysqli->query("SELECT * FROM staff_employment + WHERE employment_id = '".$page."' AND employment_trash = '0' LIMIT 1") ; + if ($mysqli_page->num_rows > 0){ + + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $select_worker = $row_page['employment_type'] ; + $employment_status = $row_page['employment_status'] ; + + // check select worker + include 'HR/hr-local-edit-interview-det.php' ; + + }else{ + $boolean_redirect = true ; + } + + if ($boolean_redirect){ + header("Location: hr-employment.php?page_mode=all") ; + exit ; + } + + break ; + + // offer update + case 'offer' : + + // check permission + if ( !permissionCheck($row_user, 'application-list-update') ){ + echo ''; + header('Location: index.php') ; + exit ; + } + + // active page + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-employment' ; + $active_menu = 'hr-letter-offer' ; + + // check query exsits + $mysqli_page = $mysqli->query("SELECT * FROM staff_employment + WHERE employment_id = '".$page."' AND (employment_status = 'Offer' || employment_status = 'Confirmation') AND employment_trash = '0' LIMIT 1") ; + + + if ($mysqli_page->num_rows > 0){ + + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + + switch($row_page['employment_status']){ + case 'Offer' : + $active_menu = 'hr-letter-offer' ; + break ; + case 'Confirmation' : + $active_menu = 'hr-letter-confirmation' ; + break ; + } + + $status_text = jsonEncodeDecode('decode', $row_page['employment_status_text']) ; + $offer_status = $status_text['offer_status'] ; + + // update database + if ($_POST['hide'] == 1){ + + $date_to_offer = escapeString($_POST['date_to_offer']) ; + $starting_date = escapeString($_POST['starting_date']) ; + $salary = escapeString($_POST['salary']) ; + $allowance = escapeString($_POST['allowance']) ; + $comission = escapeString($_POST['comission']) ; + $return_date = escapeString($_POST['return_date']) ; + $assign_by = escapeString($_POST['assign_by']) ; + + if ($_POST['sent_offer_letter']!='') { + $sent_offer_letter = escapeString($_POST['sent_offer_letter']); + $sent_offer_letter_date = TODAYDATE; + }else{ + $status_text_temp = jsonEncodeDecode('decode', $row_page['employment_status_text']) ; + $offer_status_temp = $status_text_temp['offer_status'] ; + if ($offer_status_temp != '') { + $sent_offer_letter_date = $offer_status_temp['sent_ol_date']; + $sent_offer_letter = $offer_status_temp['sent_ol']; + }else{ + $sent_offer_letter = escapeString($_POST['sent_offer_letter']); + $sent_offer_letter_date = TODAYDATE; + } + } + + if ($date_to_offer != '' && $starting_date != '' && $salary != '' && $return_date != ''){ + + $offer_status = array('date_to_offer' => $date_to_offer, + 'starting_date' => $starting_date, + 'salary' => $salary, + 'allowance' => $allowance, + 'comission' => $comission, + 'sent_ol' => $sent_offer_letter, + 'sent_ol_date' => $sent_offer_letter_date, + 'return_date' => $return_date) ; + + $status_text['offer_status'] = $offer_status ; + $status_text = jsonEncodeDecode('encode', $status_text) ; + + + // update database + if ($mysqli->query("UPDATE staff_employment SET + employment_status_text = '".$status_text."', + employment_salary = '".$salary."', + employment_assign_by = '".$assign_by."' + WHERE employment_id = '".$page."'")){ + + $descrition = $_SESSION['system_name'].'(username) update employment offer letter. ' ; + + if ($sent_offer_letter != '') { + $descrition .= 'Offer letter is sent ('.TODAYDATE.')'; + } + + $mysqli->query("INSERT INTO system_log_employment (log_table, log_action, log_page_id, log_page_name, log_user_id, log_description, log_record, log_date) VALUES + ('employment', 'update-status', '200', 'AF-".$page."', '".$_SESSION["system_id"]."', '".$descrition."', '".$record."', NOW())"); + + + if ($_POST['sent_offer_letter']!='') { + header("Location:?page_mode=sent_email&mail_type=offer_letter&page=".$page); + exit; + } + + // refresh page + header("Location:hr-employment.php?page_mode=offer&page=".$page."&success=1") ; + exit ; + } + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + include 'HR/hr-offer-letter-update.php'; + } + + else{ + header("Location: hr-employment.php?page_mode=all&select_worker=Local&type=offer") ; + exit ; + } + + break ; + + // sent email + case 'sent_email' : + + $mysqli_page = $mysqli->query("SELECT * FROM staff_employment + WHERE employment_id = '".$page."' AND employment_trash = '0' LIMIT 1") ; + if ($mysqli_page->num_rows > 0){ + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + } + + $status_text = jsonEncodeDecode('decode', $row_page['employment_status_text']) ; + $offer_status = $status_text['offer_status'] ; + + include 'HR/hr-local-mail.php'; + + break; + + // all category list + case 'all' : + default : + + // check permission + if ( !permissionCheck($row_user, 'application-list-view') ){ + echo ''; + header('Location: index.php') ; + exit ; + } + + $search_name = escapeString($_GET['search_name']) ; + $search_ic = escapeString($_GET['search_ic']) ; + $search_department = escapeString($_GET['search_department']) ; + $search_designation = escapeString($_GET['search_designation']) ; + $search_yexp = escapeString($_GET['search_yexp']) ; + $search_qualification = escapeString($_GET['search_qualification']) ; + $search_spoke_en = escapeString($_GET['search_spoke_en']) ; + $search_spoke_bm = escapeString($_GET['search_spoke_bm']) ; + $search_spoke_cn = escapeString($_GET['search_spoke_cn']) ; + $search_mobile = escapeString($_GET['search_mobile']) ; + $search_mail = escapeString($_GET['search_mail']) ; + $search_date = ( $_GET['search_date']!= '' ? date('Y-m-d', strtotime($_GET['search_date'])) : '' ) ; + + // query type + $search_query = '' ; + if( $search_name != ''){ + $search_query .= " AND employment_name LIKE '%".$search_name."%'" ; + } + if( $search_ic != ''){ + $search_query .= " AND employment_nric LIKE '%".$search_ic."%'" ; + } + if( $search_department != ''){ + $search_query .= " AND employment_department = '".$search_department."'" ; + } + if( $search_designation != ''){ + $search_query .= " AND employment_position = '".$search_designation."'" ; + } + if( $search_yexp != ''){ + $search_query .= " AND employment_details LIKE '%\"working_yexp\":\"".$search_yexp."\"%'" ; + } + if( $search_qualification != ''){ + $search_query .= " AND employment_details LIKE '%".$search_qualification."%'" ; + } + if( $search_spoke_en != ''){ + $search_query .= " AND employment_details LIKE '%".$search_spoke_en."%'" ; + } + if( $search_spoke_bm != ''){ + $search_query .= " AND employment_details LIKE '%".$search_spoke_bm."%'" ; + } + if( $search_spoke_cn != ''){ + $search_query .= " AND employment_details LIKE '%".$search_spoke_cn."%'" ; + } + if( $search_mobile != ''){ + $search_query .= " AND employment_mobile LIKE '%".$search_mobile."%'" ; + } + if( $search_mail != ''){ + $search_query .= " AND employment_email LIKE '%".$search_mail."%'" ; + } + if ( $search_date != '' ){ + $search_query .= " AND employment_date like '%".$search_date."%' " ; + } + + // search query + if ($search != ''){ + $search_query .= " AND (employment_name LIKE '%".$search."%')" ; + } + + // active page + $active_main_menu = 'hr' ; + $active_menu = 'hr-employment' ; + + // form submit + if ($_POST['hide'] == '1' && $_POST['hide_status'] == 'action'){ + // trash item + switch($_POST['page_action']){ + case 'trash': + $mysqli_query = "UPDATE staff_employment SET + employment_trash = '1' + WHERE employment_id = " ; + $trash_page = trashPage('employment', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } + } + + // check page selected worker + $active_sub_menu = 'hr-employment' ; + + // check employment status + $boolean_offer = false ; + $query_order_by = "employment_id DESC" ; + $boolean_tier = false ; + switch($type){ + case 'pending' : + $active_menu = 'hr-letter-pending' ; + $employment_status = 'Pending' ; + break ; + case 'processing' : + $active_menu = 'hr-letter-processing' ; + $employment_status = 'Processing' ; + break ; + case 'processing-manager-approved' : + $active_menu = 'hr-letter-processing-manager-approved' ; + $employment_status = 'Processing Confirmed' ; + break ; + case 'processing-manager-rejected' : + $active_menu = 'hr-letter-processing-manager-rejected' ; + $employment_status = 'Processing Rejected' ; + break ; + case 'processing-interview-slot' : + $active_menu = 'hr-letter-processing-interview-slot' ; + $employment_status = 'Processing Interview Slot' ; + break ; + case 'interview' : + $active_menu = 'hr-letter-interview' ; + $employment_status = 'Interview' ; + break ; + case 'reschedule' : + $active_menu = 'hr-letter-reschedule' ; + $employment_status = 'Reschedule' ; + break ; + case 'kiv' : + $active_menu = 'hr-letter-kiv' ; + $employment_status = 'Keep In View' ; + break ; + case 'offer' : + $active_menu = 'hr-letter-offer' ; + $employment_status = 'Offer' ; + $boolean_offer = true ; + break ; + case 'confirmation' : + $active_menu = 'hr-letter-confirmation' ; + $employment_status = 'Confirmation' ; + $boolean_tier = true ; + break ; + case 'terminate' : + $active_menu = 'hr-letter-terminate' ; + $employment_status = 'Terminate' ; + $boolean_tier = true ; + break ; + case 'reject' : + $active_menu = 'hr-letter-reject' ; + $employment_status = 'Reject' ; + $boolean_tier = true ; + break ; + } + + switch($sort_type){ + case 'dob' : + $sort_by_dob = ($sortby == 'dob_desc' ? 'dob_asc' : 'dob_desc') ; + $sortable = ($sort_by_dob == 'dob_asc' ? 'DESC' : 'ASC') ; + $query_order_by = 'employment_dob ' . $sortable ; + break ; + + } + + // query for employement status + if ( $employment_status == 'Processing' ){ + $search_query .= " AND employment_status IN ( 'Processing', 'Processing Confirmed', 'Processing Rejected', 'Processing Interview Slot' )" ; + }else{ + $search_query .= " AND employment_status = '".$employment_status."'" ; + } + + // query for branch + $search_query .= " AND employment_branch = '".$_SESSION['url_get_branch_admin']."'" ; + + if ( $boolean_tier ){ + $search_query .= ( $get_user_tier['check'] ? " AND ( employment_tier = '' || ( employment_tier LIKE '%|" . implode( "|%' OR employment_tier LIKE '%|", $get_user_tier['tiers'] ) . "|%' ) )" : "" ) ; + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'page_mode=all&select_worker=Local&type=pending&search='.$search.'&search_name='.$search_name.'&search_date='.$search_date.'&search_mobile='.$search_mobile.'&search_mail='.$search_mail ; + + // page query + $mysqli_query = "SELECT * FROM staff_employment + WHERE employment_trash = '0'".$search_query ; + $mysqli_page = $mysqli->query( $mysqli_query.' ORDER BY '.$query_order_by." LIMIT $start_from, " . LIMIT ) ; + + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + + // sort by variable + $url_sort_by = 'hr-employment.php?page_mode=all&select_worker='.$select_worker.'&type='.$type ; + + // check page selected worker + include 'HR/hr-local-list.php'; + + break ; +} +?> + + + + + \ No newline at end of file diff --git a/hr-health.php b/hr-health.php new file mode 100644 index 0000000..85867de --- /dev/null +++ b/hr-health.php @@ -0,0 +1,298 @@ +query("SELECT * FROM staff_health + WHERE health_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + $boolean_new = false ; + if ( $page == '' ){ + $mysqli->query("INSERT INTO staff_health ( created_at ) VALUES ( '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + $boolean_new = true ; + } + + // update database + $mysqli->query("UPDATE staff_health SET + staff_id = '".escapeString($_POST['staff_id'])."', + temperature = '".escapeString($_POST['temperature'])."', + health_reason = '".escapeString($_POST['health_reason'])."' + WHERE health_id = '".$page."'") ; + + // refresh page + if ( $boolean_new ){ + header("Location:hr-health.php?page_mode=new&page=&success=1") ; + }else{ + header("Location:hr-health.php?page_mode=edit&page=".$page."&success=1") ; + } + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'attendance-health-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'attendance-health-update') ) ){ + header('Location: hr-health.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + // get all requires + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + ?> + +
    + + + '.$lang['Thank you details has been updated'].' +
    ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + + + +
    +
    +
    +
    +
    + + query($mysqli_query." ORDER BY a.health_id DESC LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
    + + + +
    + + +
    +
    + + + + +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['health_id'] ; + + echo ' + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + ' ; + } + ?> + +
    ' ; + if ( permissionCheck($row_user, 'attendance-health-update') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['staff_name']).' ( '.dataFilter($row_page['staff_idno']).' )'.dataFilter($row_page['temperature']).''.resetDateFormat($row_page['health_reason']).''.resetDateFormat($row_page['created_at']).' +
    + + +
    +
    '.$lang['no_data'].'
    + +
    +
    +
    +
    + \ No newline at end of file diff --git a/hr-import-point.php b/hr-import-point.php new file mode 100644 index 0000000..055ae27 --- /dev/null +++ b/hr-import-point.php @@ -0,0 +1,142 @@ +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; +} + + +$active_sub_menu = 'hr-attendance' ; +$active_menu = 'hr-staff-attendance' ; + +$staff_all = [] ; +$mysqli_staff = $mysqli->query("SELECT staff_idno, staff_id FROM staff WHERE deleted_at IS NULL") ; +if ( $mysqli_staff->num_rows > 0 ){ + while($row_staff = $mysqli_staff->fetch_array(MYSQLI_ASSOC)){ + $staff_all[$row_staff['staff_idno']] = $row_staff['staff_id'] ; + } +} + +if(isset($_FILES['import-excel']['name'])){ + + include 'PhpExcel/PHPExcel.php' ; + + $file_name = $_FILES['import-excel']['name']; + $ext = pathinfo($file_name, PATHINFO_EXTENSION); + + //Checking the file extension + if($ext == "xlsx"){ + $file_name = $_FILES['import-excel']['tmp_name']; + $inputFileName = $file_name; + + /**********************PHPExcel Script to Read Excel File**********************/ + // Read your Excel workbook + try { + $inputFileType = PHPExcel_IOFactory::identify($inputFileName); //Identify the file + $objReader = PHPExcel_IOFactory::createReader($inputFileType); //Creating the reader + $objPHPExcel = $objReader->load($inputFileName); //Loading the file + } catch (Exception $e) { + die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) + . '": ' . $e->getMessage()); + header("location: hr-staff.php?page_mode=staff-attendance&result=error&msg=".urlencode($e->getMessage())); + exit; + } + // ################################################################################## + // Setting excel + // ################################################################################## + $sheet1 = $objPHPExcel->getSheet(0); //Selecting sheet 0 + $highestRow1 = $sheet1->getHighestRow(); //Getting number of rows + $highestColumn1 = $sheet1->getHighestColumn(); //Getting number of columns + // Loop through each row of the worksheet in turn -> $row is for starting point + for ( $row = 2; $row <= $highestRow1; $row++ ) { + // Read a row of data into an array + $rowData = $sheet1->rangeToArray('A' . $row . ':' . $highestColumn1 . $row, NULL, TRUE, FALSE); + $rowData2[] = $rowData[0] ; + } + + if( isset($rowData2) ){ + + $setting_point = $mysqli->query( "SELECT point_id, point_type FROM setting_point WHERE deleted_at IS NULL AND point_from = 'adjustment' AND point_type IN ( 'plus', 'minus' ) AND difficulty = 'normal'" ) ; + if ( $setting_point->num_rows > 0 ){ + $setting_point_list = [] ; + while ( $row_setting_point = $setting_point->fetch_assoc() ){ + $setting_point_list[$row_setting_point['point_type']] = $row_setting_point['point_id'] ; + } + + foreach ( $rowData2 as $rowData2data ){ + $staff_idno = $rowData2data['0'] ; + $staff_id = $staff_all[$staff_idno] ; + $point_amount = $rowData2data['1'] ; + $point_type = ( $point_amount > 0 ? 'plus' : ( $point_amount < 0 ? 'minus' : '' ) ) ; + $remark = $rowData2data['2'] ; + if ( $staff_idno != '' && $staff_id != '' && ( $point_type == 'plus' || $point_type == 'minus' ) && ( $point_amount < 0 || $point_amount > 0 ) ){ + pointMovement( 'adjustment', $setting_point_list[$point_type], $point_type, 'normal', $staff_id, $point_amount, $remark ) ; + pushToUserCron( 'staff_adjustment', $setting_point_list[$point_type], $staff_id, 'Point Adjustment', $remark ) ; + } + } + } + + }else{ + header( "Location: ?result=error&msg=Failed to Import" ) ; + exit; + } + header( "Location: ?result=success&msg=Import Successful" ) ; + exit; + } +} + +$result = $_GET['result']; +$msg = $_GET['msg']; +if ($result == 'error') { + $display_error = '
    '.$msg.'
    ' ; +}elseif ($result == 'success') { + $display_error = '
    '.$msg.'
    ' ; +} + +include 'requires/page_header.php'; +include 'requires/page_top.php'; +?> + +
    + + +
    +
    + Import Excel File + Download Sample +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/hr-leave.php b/hr-leave.php new file mode 100644 index 0000000..050db9f --- /dev/null +++ b/hr-leave.php @@ -0,0 +1,1171 @@ +query($q); + if($mysqli->error == ''){ + $error_message = '
    '.$lang['Thank you your leave has been updated'].'
    ' ; + header("Location:hr-leave.php?page_mode=list&ist_type=confirmed") ; + $_SESSION['system_result'] = $error_message ; + exit ; + + } + break; + // edit leave + case 'new' : + case 'edit' : + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM staff_leave + WHERE leave_id = '".$page."' AND deleted_at IS NULL LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + $error_message = '
    '.$lang['Please enter all required fill'].'
    ' ; + + $staff_id = escapeString($_POST['staff_id']) ; + $leave_type = escapeString($_POST['leave_type']) ; + $leave_fullhalf = escapeString($_POST['leave_fullhalf']) ; + $leave_from = escapeString($_POST['leave_from']) ; + $leave_to = escapeString($_POST['leave_to']) ; + $leave_reason = escapeString($_POST['leave_reason']) ; + $leave_status = escapeString($_POST['leave_status']) ; + + if ( $leave_fullhalf == 'half' ){ + $leave_to = $leave_from ; + } + + if ( ( ( $submit_type == 'new' && $staff_id != '' ) || $submit_type == 'edit' ) && $leave_type != '' && $leave_from != '' && $leave_to != '' && $leave_reason != '' ){ + + $error_message = '
    '.$lang['Sorry you cannot apply different year of leave'].'
    ' ; + + if ( date('Y', strtotime($leave_from)) == date('Y', strtotime($leave_to)) ){ + + // get again staff + $department = '' ; + $get_department = $mysqli->query("SELECT department_id FROM staff_department + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."'") ; + if ( $get_department->num_rows > 0 ){ + while ( $row_department = $get_department->fetch_assoc() ){ + $department .= ',('.$row_department['department_id'].')' ; + } + $department = substr($department, 1) ; + } + + // get days + $datetime1 = new DateTime($leave_from) ; + $datetime2 = new DateTime($leave_to) ; + $interval = $datetime1->diff($datetime2) ; + $days = $interval->format('%a')+1 ; + + if ( $leave_fullhalf == 'half' ){ + $days = '0.5' ; + } ; + + $leave_file = '' ; + $image = $_FILES["image"]["name"] ; + if ( $_POST['remove_photo'] != '1' ){ + if ( $image != '' ){ + $file_name = $staff_id.'-'.time().'.png' ; + copy($_FILES["image"]["tmp_name"], 'uploads/Leave/'.$file_name) ; + $leave_file = $file_name ; + }else{ + $leave_file = $row_page['leave_file'] ; + } + } + + // insert into leave + if ( $submit_type == 'new' ){ + if ( $mysqli->query("INSERT INTO staff_leave + (staff_id, leave_department, leave_type, leave_from, leave_to, leave_day, leave_reason, leave_file, leave_incharge_status, leave_status, created_at, updated_at) VALUES + ('".$staff_id."', '".$department."', '".$leave_type."', '".$leave_from."', '".$leave_to."', '".$days."', '".$leave_reason."', '".$leave_file."', 'confirmed', 'pending', '".TODAYDATE."', '".TODAYDATE."')") ){ + $error_message = '
    '.$lang['Thank you your leave has been add'].'
    ' ; + } + }else{ + if ( $mysqli->query("UPDATE staff_leave SET + leave_department = '".$department."', + leave_type = '".$leave_type."', + leave_from = '".$leave_from."', + leave_to = '".$leave_to."', + leave_day = '".$days."', + leave_reason = '".$leave_reason."', + leave_file = '".$leave_file."', + updated_at = '".TODAYDATE."' + WHERE leave_id = '".$page."'") ){ + $error_message = '
    '.$lang['Thank you your leave has been updated'].'
    ' ; + + // for admin update date + // refer to update status part + /* + if ( $_POST['hide_admin_edit'] == 'yes' && $submit_type == 'edit' && $row_page['leave_status'] == 'confirmed' ){ + $mysqli_leave = $mysqli->query("SELECT * FROM staff_leave + WHERE leave_id = '".$page."' AND deleted_at IS NULL LIMIT 1"); + if ( $mysqli_leave->num_rows > 0 ){ + $row_leave = $mysqli_leave->fetch_array(MYSQLI_ASSOC) ; + $page_action = $row_leave['leave_status'] ; + $key = $page ; + + if ( $row_leave['leave_type'] == 'unpaid' || $row_leave['leave_type'] == 'annual' || $row_leave['leave_type'] == 'sick' ){ + + // deduct leave + $new_date = date('Y-m-d', strtotime($row_leave['leave_from'])) ; + $new_year = date('Y', strtotime($row_leave['leave_from'])) ; + + $get_previous_leave = $mysqli->query("SELECT * FROM staff_leave_date + WHERE deleted_at IS NULL AND staff_id = '".$row_leave['staff_id']."' AND leave_id = '".$key."' AND leave_type = '".$row_leave['leave_type']."'") ; + if ( $get_previous_leave->num_rows > 0 ){ + + $count = 0 ; + while ( $previous_leave = $get_previous_leave->fetch_assoc() ){ + if ( $previous_leave['leave_type_mode'] == 'working' ){ + $count += $previous_leave['leave_work_day'] ; + } + $mysqli->query("UPDATE staff_leave_date SET + deleted_at = '".TODAYDATE."' + WHERE leave_date_id = '".$previous_leave['leave_date_id']."'") ; + } + + if ( $count > 0 ){ + $mysqli->query("UPDATE staff_leave_year SET + leave_days = leave_days + '".$count."' + WHERE deleted_at IS NULL AND staff_id = '".$row_leave['staff_id']."' AND leave_type = '".$row_leave['leave_type']."' AND leave_year_from <= '".$row_leave['leave_from']."' AND leave_year_to >= '".$row_leave['leave_from']."'") ; + } + } + + // confirmed leave + $boolean_leave_update = false ; + if ( $page_action == 'confirmed' ){ + + // check if staff exists or not + $get_staff = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id = '".$row_leave['staff_id']."' LIMIT 1") ; + if ( $get_staff->num_rows > 0 ){ + + $row_staff = $get_staff->fetch_assoc() ; + + // open leave year for selected staff + setStaffLeaveYear($row_leave['staff_id']) ; + + // check staff leave + // get current staff total leave + $get_leave_year = $mysqli->query("SELECT leave_year_id, SUM(leave_days) as leave_total_days FROM staff_leave_year + WHERE deleted_at IS NULL AND staff_id = '".$row_leave['staff_id']."' AND leave_type = '".$row_leave['leave_type']."' AND leave_year_from <= '".$row_leave['leave_from']."' AND leave_year_to >= '".$row_leave['leave_from']."'") ; + + if ( $get_leave_year->num_rows > 0 ){ + + $leave_days = 0 ; + $boolean_ded = false ; + if ( $get_leave_year->num_rows > 0 ){ + $row_leave_year = $get_leave_year->fetch_assoc() ; + $leave_days = $row_leave_year['leave_total_days'] ; + $boolean_ded = true ; + } + + if ( $leave_days > 0 ){ + + // check if full day or half day + $day_fullhalf = 'full' ; + $leave_day = $row_leave['leave_day'] ; // should change to $days + $cut_day = '1' ; + if ( $leave_day == '0.5' ){ + $day_fullhalf = 'half' ; + $leave_day = '1' ; + $cut_day = '0.5' ; + } + + // save to leave more + $leave_date_list = [] ; + $leave_work_day = 0 ; + for ( $a = 1 ; $a <= $leave_day ; $a++ ){ + + $leave_type_mode = 'working' ; + $leave_work_direct = 'no' ; + $leave_work_day = '0' ; + $boolean_holiday = false ; + $boolean_off = false ; + + // check if today is holiday + $get_holiday = $mysqli->query("SELECT * FROM setting_holiday + WHERE deleted_at IS NULL AND holiday_date = '".$new_date."' LIMIT 1") ; + if ( $get_holiday->num_rows > 0 ){ + $leave_type_mode = 'holiday' ; + $boolean_holiday = true ; + $leave_work_day = '1' ; + } + + // check working days if today off + if ( !$boolean_holiday ){ + $new_week_day = date('N', strtotime($new_date)) ; + $get_working = $mysqli->query("SELECT * FROM setting_working + WHERE deleted_at IS NULL AND group_id = '".$row_staff['group_id']."' AND working_day = '".$new_week_day."' LIMIT 1") ; + if ( $get_working->num_rows > 0 ){ + $row_working = $get_working->fetch_assoc() ; + if ( $row_working['working_on'] == 'no' ){ + $leave_type_mode = 'off' ; + $boolean_off = true ; + $leave_work_day = '1' ; + } + $leave_work_direct = $row_working['working_direct_day'] ; + } + + if ( !$boolean_off ){ + if ( $leave_days > 0 ){ + $leave_work_day = $cut_day ; + } + } + + } + + $leave_date_list[] = [ + 'leave_type_mode' => $leave_type_mode, + 'leave_date' => $new_date, + 'leave_work_day' => $leave_work_day, + ] ; + + $new_date = date('Y-m-d', strtotime($new_date . '+1 days')) ; + + if ( !$boolean_holiday && !$boolean_off ){ + $leave_days = ( $leave_days - $leave_work_day ) ; + } + + } + + if ( $leave_days >= 0 ){ + foreach ( $leave_date_list as $k_date => $v_date ){ + // check total leave + $mysqli->query("INSERT INTO staff_leave_date + (staff_id, leave_id, leave_type, leave_type_mode, leave_date, leave_work_day, created_at, updated_at) VALUES + ('".$row_staff['staff_id']."', '".$key."', '".$row_leave['leave_type']."', '".$v_date['leave_type_mode']."', '".$v_date['leave_date']."', '".$v_date['leave_work_day']."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + + if ( $boolean_ded ){ + $mysqli->query("UPDATE staff_leave_year SET + leave_days = '".$leave_days."' + WHERE leave_year_id = '".$row_leave_year['leave_year_id']."'") ; + } + + $boolean_leave_update = true ; + + }else{ + $error_update++; + } + }else{ + $error_update++; + } + + } + + } + + }else{ + $boolean_leave_update = true ; + } + + if ( $boolean_leave_update ){ + + $mysqli->query( "UPDATE staff_leave SET + leave_status = '".$page_action."', + leave_updated_author = '".$_SESSION['system_id']."' + WHERE leave_id = '".$key."'") ; + + $staff_list[] = $value ; + + if ( $row_leave['staff_incharge_id'] != '0' ){ + $supervisor_list[] = [ + 'super_id' => $row_leave['staff_incharge_id'], + 'staff_name' => $row_leave['staff_name'], + 'staff_idno' => $row_leave['staff_idno'] + ] ; + } + } + + + } + } + + } + */ + // end refer to update status part + + + } + } + + } + + } + + // refresh page + header("Location:hr-leave.php?page_mode=".$page_mode."&page=".$page) ; + $_SESSION['system_result'] = $error_message ; + exit ; + } + + // active menu bar + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-leave' ; + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'leave-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'leave-update') ) ){ + header('Location: hr-leave.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + // get all requires + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + $input_block = '' ; + $admin_edit = 'no' ; + // if ( $submit_type == 'edit' && $row_page['leave_status'] != 'pending' ){ + // $input_block = 'disabled' ; + // } + if ( $row_user['user_permission'] != 'admin' ){ + if ( $submit_type == 'edit' && $row_page['leave_status'] != 'pending' ){ + $input_block = 'disabled' ; + } + }else{ + if ( $row_page['leave_status'] == 'confirmed' ){ + $admin_edit = 'yes' ; + } + } + + ?> + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    + + + + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + /> +
    +
    +
    > +
    +
    + /> +
    +
    +
    +
    +
    + /> +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + + + /> +
    +
    +
    +
    + +
    +
    +
    + + +
    +
    + + + + + +
    +
    +
    + + + + +
    +
    + + +
    +
    +
    +
    +
    + + + + = '".$search_date_from."' ) ) " ; + } + + if ($search_date_from == '' && $search_date_to != ''){ + $search_query .= " AND (DATE(a.leave_to) like '%".$search_date_to."%' OR (DATE(a.leave_from) <= '".$search_date_to."' AND DATE(a.leave_to) >= '".$search_date_to."' ) ) " ; + } + + if ($search_date_from != '' && $search_date_to != ''){ + $search_query .= " AND ((DATE(a.leave_from) >= '".$search_date_from."' AND DATE(a.leave_to) <= '".$search_date_to."') OR (DATE(a.leave_from) <= '".$search_date_from."' AND DATE(a.leave_to) >= '".$search_date_to."') OR (DATE(a.leave_from) >= '".$search_date_from."' AND DATE(a.leave_from) <= '".$search_date_to."') OR (DATE(a.leave_to) >= '".$search_date_from."' AND DATE(a.leave_to) <= '".$search_date_to."') ) " ; + } + + // active menu bar + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-leave' ; + + // form submit + if ($_POST['hide'] == '1' && $_POST['hide_status'] == 'action'){ + + $result = 'failed-action' ; + $page_action = $_POST['page_action'] ; + + // trash item + switch ( $page_action ){ + case 'confirmed' : + case 'rejected' : + + $result = 'failed-check' ; + + $multiple = $_POST['multiple_trash'] ; + $supervisor_list = [] ; + $staff_list = [] ; + $update_list = [] ; + $error_update = 0 ; + + if ( arrayCheck($multiple) ){ + + foreach ( $multiple as $key => $value ){ + + // check if leave exsits + $get_leave = $mysqli->query("SELECT * FROM staff_leave a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.leave_id = '".$key."' AND a.leave_status != '".$page_action."' LIMIT 1") ; + if ( $get_leave->num_rows > 0 ){ + + $row_leave = $get_leave->fetch_assoc() ; + + if ( $row_leave['leave_type'] == 'unpaid' || $row_leave['leave_type'] == 'annual' || $row_leave['leave_type'] == 'sick' ){ + + // deduct leave + $new_date = date('Y-m-d', strtotime($row_leave['leave_from'])) ; + $new_year = date('Y', strtotime($row_leave['leave_from'])) ; + + $get_previous_leave = $mysqli->query("SELECT * FROM staff_leave_date + WHERE deleted_at IS NULL AND staff_id = '".$row_leave['staff_id']."' AND leave_id = '".$key."' AND leave_type = '".$row_leave['leave_type']."'") ; + if ( $get_previous_leave->num_rows > 0 ){ + + $count = 0 ; + while ( $previous_leave = $get_previous_leave->fetch_assoc() ){ + if ( $previous_leave['leave_type_mode'] == 'working' ){ + $count += $previous_leave['leave_work_day'] ; + } + $mysqli->query("UPDATE staff_leave_date SET + deleted_at = '".TODAYDATE."' + WHERE leave_date_id = '".$previous_leave['leave_date_id']."'") ; + } + + if ( $count > 0 ){ + $mysqli->query("UPDATE staff_leave_year SET + leave_days = leave_days + '".$count."' + WHERE deleted_at IS NULL AND staff_id = '".$row_leave['staff_id']."' AND leave_type = '".$row_leave['leave_type']."' AND leave_year_from <= '".$row_leave['leave_from']."' AND leave_year_to >= '".$row_leave['leave_from']."'") ; + } + } + + // confirmed leave + $boolean_leave_update = false ; + if ( $page_action == 'confirmed' ){ + + // check if staff exists or not + $get_staff = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id = '".$row_leave['staff_id']."' LIMIT 1") ; + if ( $get_staff->num_rows > 0 ){ + + $row_staff = $get_staff->fetch_assoc() ; + + // open leave year for selected staff + setStaffLeaveYear($row_leave['staff_id']) ; + + // check staff leave + // get current staff total leave + $get_leave_year = $mysqli->query("SELECT leave_year_id, SUM(leave_days) as leave_total_days FROM staff_leave_year + WHERE deleted_at IS NULL AND staff_id = '".$row_leave['staff_id']."' AND leave_type = '".$row_leave['leave_type']."' AND leave_year_from <= '".$row_leave['leave_from']."' AND leave_year_to >= '".$row_leave['leave_from']."'") ; + + if ( $get_leave_year->num_rows > 0 ){ + + $leave_days = 0 ; + $boolean_ded = false ; + if ( $get_leave_year->num_rows > 0 ){ + $row_leave_year = $get_leave_year->fetch_assoc() ; + $leave_days = $row_leave_year['leave_total_days'] ; + $boolean_ded = true ; + } + + if ( $leave_days > 0 ){ + + // check if full day or half day + $day_fullhalf = 'full' ; + $leave_day = $row_leave['leave_day'] ; // should change to $days + $cut_day = '1' ; + if ( $leave_day == '0.5' ){ + $day_fullhalf = 'half' ; + $leave_day = '1' ; + $cut_day = '0.5' ; + } + + // save to leave more + $leave_date_list = [] ; + $leave_work_day = 0 ; + for ( $a = 1 ; $a <= $leave_day ; $a++ ){ + + $leave_type_mode = 'working' ; + $leave_work_direct = 'no' ; + $leave_work_day = '0' ; + $boolean_holiday = false ; + $boolean_off = false ; + + // check if today is holiday + $get_holiday = $mysqli->query("SELECT * FROM setting_holiday + WHERE deleted_at IS NULL AND holiday_date = '".$new_date."' LIMIT 1") ; + if ( $get_holiday->num_rows > 0 ){ + $leave_type_mode = 'holiday' ; + $boolean_holiday = true ; + $leave_work_day = '1' ; + } + + // check working days if today off + if ( !$boolean_holiday ){ + $new_week_day = date('N', strtotime($new_date)) ; + $get_working = $mysqli->query("SELECT * FROM setting_working + WHERE deleted_at IS NULL AND group_id = '".$row_staff['group_id']."' AND working_day = '".$new_week_day."' LIMIT 1") ; + if ( $get_working->num_rows > 0 ){ + $row_working = $get_working->fetch_assoc() ; + if ( $row_working['working_on'] == 'no' ){ + $leave_type_mode = 'off' ; + $boolean_off = true ; + $leave_work_day = '1' ; + } + $leave_work_direct = $row_working['working_direct_day'] ; + } + + if ( !$boolean_off ){ + $leave_work_day = $cut_day ; + } + } + + $leave_date_list[] = [ + 'leave_type_mode' => $leave_type_mode, + 'leave_date' => $new_date, + 'leave_work_day' => $leave_work_day, + ] ; + + $new_date = date('Y-m-d', strtotime($new_date . '+1 days')) ; + + if ( !$boolean_holiday && !$boolean_off ){ + $leave_days = ( $leave_days - $leave_work_day ) ; + } + + } + + + if ( $leave_days >= 0 ){ + foreach ( $leave_date_list as $k_date => $v_date ){ + // check total leave + $mysqli->query("INSERT INTO staff_leave_date + (staff_id, leave_id, leave_type, leave_type_mode, leave_date, leave_work_day, created_at, updated_at) VALUES + ('".$row_staff['staff_id']."', '".$key."', '".$row_leave['leave_type']."', '".$v_date['leave_type_mode']."', '".$v_date['leave_date']."', '".$v_date['leave_work_day']."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + + if ( $boolean_ded ){ + $mysqli->query("UPDATE staff_leave_year SET + leave_days = '".$leave_days."' + WHERE leave_year_id = '".$row_leave_year['leave_year_id']."'") ; + } + + $boolean_leave_update = true ; + + }else{ + $error_update++; + } + }else{ + $error_update++; + } + + } + + } + + }else{ + $boolean_leave_update = true ; + } + + if ( $boolean_leave_update ){ + + $mysqli->query( "UPDATE staff_leave SET + leave_status = '".$page_action."', + leave_updated_author = '".$_SESSION['system_id']."' + WHERE leave_id = '".$key."'") ; + + pushToUserCron( 'staff_leave', $key, $value, 'Leave '.ucwords($page_action), 'Your leave has been '.$page_action.'.' ) ; + + $staff_list[] = $value ; + + if ( $row_leave['staff_incharge_id'] != '0' ){ + pushToUserCron( 'staff_leave', $key, $row_leave['staff_incharge_id'], 'Staff Leave '.ucwords($page_action), 'Staff '.$row_leave['staff_name'].' ('.$row_leave['staff_idno'].') leave has been '.$page_action.'.' ) ; + } + } + + } + + } + } + + // push notification for those staff + if ( count( $staff_list ) > 0 ){ + if ( $error_update == 0 ){ + $result = 'success-update' ; + }else{ + $result = 'success-some-update' ; + } + }else{ + $result = 'success-some-update' ; + } + + } + + break ; + } + + $_SESSION['system_result'] = $result ; + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_name='.$search_name.'&search_idno='.$search_idno.'&search_date_from='.$search_date_from.'&search_date_to='.$search_date_to.'&ty_type='.$ty_type.'&ist_type='.$ist_type.'&st_type='.$st_type.'&sort_by='.$sort_by.'&sort_by_type='.$sort_by_type ; + + // page query + $mysqli_query = "SELECT a.leave_id as leave_id, a.leave_type, a.leave_from, a.leave_to, a.leave_day, a.leave_file, a.leave_reason, a.leave_incharge_status, a.leave_status, a.leave_updated_author, a.created_at, a.updated_at, b.staff_id, b.staff_name, b.staff_idno FROM staff_leave a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL " . $search_query.$user_branch_permission_sql_b ; + // export excel + if ( $export == 'yes' ){ + + include 'PhpExcel/PHPExcel.php' ; + + $page_filename = 'Leave-'.date( 'Ymd', time() ) ; + $objPHPExcel = new PHPExcel() ; + $objPHPExcel->getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + // default parameter + $count = 1 ; + $char = 'A' ; + $count_row = 1 ; + + $array_title = array( 'No.', 'Request By', 'Type', 'From ~ To', 'Reason', 'Status', 'Created Date', 'Updated Date' ) ; + + $newChar = $char ; + foreach( $array_title as $k => $v ){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $newChar.$count, $v ) ; + $newChar++ ; + } + $count++ ; + + $row_q = $mysqli->query($mysqli_query." ORDER BY a.created_at DESC") ; + if ( $row_q->num_rows > 0 ){ + while ( $row = $row_q->fetch_assoc() ){ + $newChar = $char ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $count_row ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($row['staff_name']).' ( '.dataFilter($row['staff_idno']).' )' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, ucwords($row['leave_type']) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($row['leave_from']).' ~ '.dataFilter($row['leave_to']).' ('.dataFilter($row['leave_day']).')' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($row['leave_reason']) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($row['leave_status']) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, resetDateFormat($row['created_at']) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, resetDateFormat($row['updated_at']) ) ; + + $count++ ; + $count_row++ ; + } + } + + // Submission from + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; + } + + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY a.leave_from DESC, a.created_at DESC LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
    +
    + + + '.$lang['Sorry invalid action type'].'
    ' ; + break ; + case 'failed-check' : + echo '
    '.$lang['Sorry please select at least one'].'
    ' ; + break ; + case 'success-some-update' : + echo '
    '.$lang['Sorry some of the staff not enough day to confirm'].'
    ' ; + break ; + case 'success-update' : + echo '
    '.$lang['Thank you status updated sucessfully'].'
    ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> + +
    +
    search
    +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    +
    + + + + + +
    +
    +
    +
    +
    + +
    + + +
    +
    + + + + +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + if ( $row_page['leave_updated_author'] > 0 ){ + $get_user_id[$row_page['leave_updated_author']] = $row_page['leave_updated_author'] ; + } + $array_page[] = $row_page ; + } + } + + // get author id + $author_query = $mysqli->query( "SELECT user_id, user_name FROM system_user + WHERE user_trash = '0' AND user_id IN (".implode( ', ', $get_user_id ).")" ) ; + $array_author = [] ; + if ( $author_query->num_rows > 0 ){ + while ( $row_author = $author_query->fetch_assoc() ){ + $array_author[$row_author['user_id']] = $row_author['user_name'] ; + } + } + + if ( arrayCheck($array_page) ){ + foreach ( $array_page as $row_page ){ + + if ( $row_page['leave_incharge_status'] == 'pending' ){ + $button_incharge = '' ; + }elseif ( $row_page['leave_incharge_status'] == 'confirmed' ){ + $button_incharge = '' ; + }else{ + $button_incharge = '' ; + } + + if ( $row_page['leave_status'] == 'pending' ){ + $button = '' ; + }elseif ( $row_page['leave_status'] == 'confirmed' ){ + $button = '' ; + }else{ + $button = '' ; + } + + echo ' + + + + + + + + + + + + ' ; + } + }else{ + echo ' + + + + + + + + + + + + ' ; + } + ?> + +
      TypeStatus
    ' ; + // if ( $row_page['leave_status'] == 'pending' ){ + echo ' +
    + + +
    ' ; + // } + echo ' +
    ' ; + if ( permissionCheck($row_user, 'leave-update') ){ + echo ' + ' ; + if($row_page['leave_status'] == 'pending'){ + echo ' + | + + ' ; + } + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['staff_name']).'
    ( '.dataFilter($row_page['staff_idno']).' )
    '.ucwords($lang[$row_page['leave_type']]).''.dataFilter($row_page['leave_from']) . ( $row_page['leave_from'] != $row_page['leave_to'] ? ' ~ ' . dataFilter($row_page['leave_to']) : '' ) .' ('.dataFilter($row_page['leave_day']).')' ; + if ( $row_page['leave_file'] != '' ){ + echo ' + + + ' ; + } + echo ' + '.dataFilter($row_page['leave_reason']).''.$button.''.resetDateTimeFormat($row_page['created_at']).' + '.resetDateTimeFormat($row_page['updated_at']).' + '.( $row_page['leave_updated_author'] > 0 ? '
    ( '.$array_author[$row_page['leave_updated_author']].' )' : '' ).' +
    '.$lang['no_data'].'
    + +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/hr-merit-points.php b/hr-merit-points.php new file mode 100644 index 0000000..d594ea3 --- /dev/null +++ b/hr-merit-points.php @@ -0,0 +1,909 @@ +query("SELECT staff_name, staff_id FROM staff WHERE deleted_at IS NULL") ; +if ( $mysqli_staff->num_rows > 0 ){ + while($row_staff = $mysqli_staff->fetch_array(MYSQLI_ASSOC)){ + $staff_all[$row_staff['staff_id']] = $row_staff['staff_name']; + } +} + +// get all position +$position = [] ; +$get_position = $mysqli->query("SELECT a.job_position_id, a.job_position_code, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; +if ( $get_position->num_rows > 0 ){ + while ( $row_position = $get_position->fetch_assoc() ){ + $position[$row_position['job_position_id']] = dataFilter( $row_position['job_position_code'] ) . ' ( ' . dataFilter( $row_position['job_position_desc'] ) . ' )' ; + } +} + +// get all section +$section = [] ; +$get_section = $mysqli->query("SELECT a.job_section_id, a.job_section_code, b.job_section_desc FROM setting_job_section a + LEFT JOIN setting_job_section_translation b ON ( a.job_section_id = b.job_section_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; +if ( $get_section->num_rows > 0 ){ + while ( $row_section = $get_section->fetch_assoc() ){ + $section[$row_section['job_section_id']] = dataFilter( $row_section['job_section_code'] ) . ' ( ' . dataFilter( $row_section['job_section_desc'] ) . ' )' ; + } +} + +// get all requires +$department_list = [] ; +$mysqli_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' ORDER BY b.department_desc ASC") ; +if ( $mysqli_department->num_rows > 0 ){ + while ( $row_department = $mysqli_department->fetch_assoc() ){ + $department_list[] = $row_department ; + } +} + +// active menu bar +$active_main_menu = 'hr' ; +$active_sub_menu = 'hr-merit-points' ; + +// mode type | all list | new | edit +switch($page_mode){ + + case 'movement' : + + // check permission + if ( !permissionCheck($row_user, 'hr-merit-points-movement-view') && !permissionCheck($row_user, 'foreign-only') ){ + echo ''; + + header('Location: index.php') ; + exit ; + } + + $active_menu = 'hr-merit-points-movement' ; + $search_name = escapeString($_GET['search_name']) ; + $search_idno = escapeString($_GET['search_idno']) ; + $search_mobile = escapeString($_GET['search_mobile']) ; + $search_mail = escapeString($_GET['search_mail']) ; + $search_date = ( $_GET['search_date']!= '' ? date('Y-m-d', strtotime($_GET['search_date'])) : '' ) ; + $search_action = escapeString($_GET['search_action']) ; + $search_type = escapeString($_GET['search_type']) ; + $search_remark = escapeString($_GET['search_remark']) ; + $export = escapeString($_GET['export']) ; + + $search_query = ''; + + if( $search_name != ''){ + $search_query .= " AND b.staff_name LIKE '%".$search_name."%'" ; + } + if( $search_idno != ''){ + $search_query .= " AND b.staff_idno LIKE '%".$search_idno."%'" ; + } + if( $search_mobile != ''){ + $search_query .= " AND b.staff_mobileno LIKE '%".$search_mobile."%'" ; + } + if( $search_mail != ''){ + $search_query .= " AND b.staff_email LIKE '%".$search_mail."%'" ; + } + if ( $search_date != '' ){ + $search_query .= " AND a.created_at LIKE '%".$search_date."%' " ; + } + if ( $search_action != '' ){ + $search_query .= " AND a.from_table = '".$search_action."' " ; + } + if ( $search_type == 'positive' ){ + $search_query .= " AND a.amount >= '0' " ; + }elseif ( $search_type == 'negative' ){ + $search_query .= " AND a.amount < '0' " ; + } + if ( $search_remark != '' ){ + $search_query .= " AND a.remark LIKE '%".$search_remark."%' " ; + } + + // page query + $mysqli_query = "SELECT + a.created_at, a.balance, a.before_amount, a.amount, a.from_table, a.remark, + b.staff_id, b.staff_idno, b.staff_name, b.job_position_id, b.job_section_id + FROM staff_point_movement a + LEFT JOIN staff b ON (a.staff_id = b.staff_id) + WHERE a.deleted_at IS NULL " . $search_query .$user_branch_permission_sql_b ; + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_name='.$search_name.'&search_date='.$search_date.'&page_mode='.$page_mode.'&search_idno='.$search_idno.'&search_mobile='.$search_mobile.'&search_mail='.$search_mail.'&search_action='.$search_action.'&search_type='.$search_type.'&search_remark='.$search_remark ; + + switch ( $export ){ + case 'export-excel' : + include 'PhpExcel/PHPExcel.php' ; + $page_filename = 'MeritPoint-'.date('Ymd', time()) ; + $objPHPExcel = new PHPExcel() ; + $objPHPExcel->getProperties()->setCreator(COMPANY)->setTitle(COMPANY)->setSubject(COMPANY)->setDescription(COMPANY)->setKeywords(COMPANY)->setCategory(COMPANY) ; + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + $count = 1 ; + $firstChar = 'A' ; + $firstChar2 = $firstChar ; + + $array_title = [] ; + $array_title[] = 'Date' ; + $array_title[] = 'Time' ; + $array_title[] = 'Staff IDNo' ; + $array_title[] = 'Staff Name' ; + $array_title[] = 'Department' ; + $array_title[] = 'Designation' ; + $array_title[] = 'Section' ; + $array_title[] = 'Action' ; + $array_title[] = 'Before' ; + $array_title[] = 'Amount' ; + $array_title[] = 'Total' ; + $array_title[] = 'Remark' ; + foreach ( $array_title as $ktitle => $vtitle ){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $vtitle ) ; + $firstChar2++ ; + } + $count++ ; + + $mysqli_page = $mysqli->query( $mysqli_query." ORDER by a.created_at DESC" ) ; + if( $mysqli_page->num_rows > 0 ){ + + $staff_lists = [] ; + $staff_ids = [] ; + while( $row_page = $mysqli_page->fetch_assoc() ){ + $staff_lists[] = $row_page ; + $staff_ids[$row_page['staff_id']] = $row_page['staff_id'] ; + } + + $staff_departments = [] ; + $select_departments = $mysqli->query( "SELECT a.staff_id, b.department_desc FROM staff_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.staff_id IN ( ".implode(', ', $staff_ids)." )" ) ; + if ( $select_departments->num_rows > 0 ){ + while ( $row_departments = $select_departments->fetch_assoc() ){ + $staff_departments[$row_departments['staff_id']][] = $row_departments['department_desc'] ; + } + } + + foreach ( $staff_lists as $k => $row_page ){ + $firstChar2 = $firstChar ; + + if( $row_page['before_amount'] >= $row_page['balance'] ){ + $movement_action = 'minus'; + }else{ + $movement_action = 'add'; + } + + $temp = [ + 'Date' => date('Y-m-d', strtotime( $row_page['created_at'])), + 'Time' => date('H:i:s', strtotime( $row_page['created_at'])), + 'StaffIDNo' => dataFilter($row_page['staff_idno']), + 'StaffName' => dataFilter($row_page['staff_name']), + 'Department' => ( count($staff_departments[$row_page['staff_id']]) > 0 ? ( implode( "\n", $staff_departments[$row_page['staff_id']] ) ) : '' ), + 'Designation' => $position[$row_page['job_position_id']], + 'Section' => $section[$row_page['job_section_id']], + 'Action' => ucfirst($row_page['from_table']), + 'Before' => dataFilter($row_page['before_amount']), + 'Amount' => ($movement_action == 'add' ? '+' : '').dataFilter($row_page['amount']), + 'Total' => dataFilter($row_page['balance']), + 'Remark' => dataFilter($row_page['remark']) + ] ; + + foreach ( $temp as $ktemp => $vtemp ){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $vtemp ) ; + $firstChar2++ ; + } + + $count++ ; + } + } + + // Submission from + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + $objWriter->save('php://output') ; + exit ; + break ; + } + + $mysqli_page = $mysqli->query($mysqli_query." ORDER by a.created_at DESC LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
    +
    + + +
    +
    Search
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    +
    +
    listing
    +
    + + + + + + + + + + + + + + num_rows > 0 ){ + while( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + if($row_page['before_amount'] >= $row_page['balance']){ + $movement_action = 'minus'; + }else{ + $movement_action = 'add'; + } + + echo ' + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + ' ; + } + ?> + +
    '.resetDateTimeFormat($row_page['created_at']).''.dataFilter($row_page['staff_name']).''.ucfirst($row_page['from_table']).''.dataFilter($row_page['before_amount']).''.($movement_action == 'add' ? '+' : '').dataFilter($row_page['amount']).''.dataFilter($row_page['balance']).''.dataFilter($row_page['remark']).'
    '.$lang['no_data'].'
    + +
    +
    +
    +
    +
    +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; + } + + $active_menu = 'hr-merit-points-adjustment' ; + $search_name = escapeString($_GET['search_name']) ; + $search_idno = escapeString($_GET['search_idno']) ; + $search_mobile = escapeString($_GET['search_mobile']) ; + $search_mail = escapeString($_GET['search_mail']) ; + $search_date = ( $_GET['search_date']!= '' ? date('Y-m-d', strtotime($_GET['search_date'])) : '' ) ; + $search_action = escapeString($_GET['search_action']) ; + $search_type = escapeString($_GET['search_type']) ; + $search_remark = escapeString($_GET['search_remark']) ; + $export = escapeString($_GET['export']) ; + + $search_query = ''; + + if( $search_name != ''){ + $search_query .= " AND d.staff_name LIKE '%".$search_name."%'" ; + } + if( $search_idno != ''){ + $search_query .= " AND d.staff_idno LIKE '%".$search_idno."%'" ; + } + if( $search_mobile != ''){ + $search_query .= " AND d.staff_mobileno LIKE '%".$search_mobile."%'" ; + } + if( $search_mail != ''){ + $search_query .= " AND d.staff_email LIKE '%".$search_mail."%'" ; + } + if ( $search_date != '' ){ + $search_query .= " AND a.created_at like '%".$search_date."%' " ; + } + if ( $search_action != '' ){ + $search_query .= " AND c.title like '%".$search_action."%' " ; + } + if ( $search_type == 'positive' ){ + $search_query .= " AND a.adjustment_type = 'plus' " ; + }elseif ( $search_type == 'negative' ){ + $search_query .= " AND a.adjustment_type = 'minus' " ; + } + if ( $search_remark != '' ){ + $search_query .= " AND a.remark LIKE '%".$search_remark."%' " ; + } + + // page query + $mysqli_query = "SELECT + a.adjustment_so, a.adjustment_type, a.created_by, a.point, a.remark, a.created_at, a.point, + c.title, + d.staff_id, d.staff_idno, d.staff_name, d.job_position_id, d.job_section_id, + e.staff_id as createdby_staff_id, e.staff_idno as createdby_staff_idno, e.staff_name as createdby_staff_name, e.job_position_id as createdby_job_position_id, e.job_section_id as createdby_job_section_id + FROM staff_adjustment a + LEFT JOIN staff_adjustment_point b ON (a.adjustment_id = b.adjustment_id) + LEFT JOIN setting_adjustment c ON (a.setting_adjustment_id = c.adjustment_id) + LEFT JOIN staff d ON (b.staff_id = d.staff_id) + LEFT JOIN staff e ON (a.created_by = e.staff_id) + WHERE a.deleted_at IS NULL " . $search_query .$user_branch_permission_sql_d ; + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_name='.$search_name.'&search_date='.$search_date.'&page_mode='.$page_mode.'&search_idno='.$search_idno.'&search_mobile='.$search_mobile.'&search_mail='.$search_mail.'&search_action='.$search_action.'&search_type='.$search_type.'&search_remark='.$search_remark ; + + switch ( $export ){ + case 'export-excel' : + include 'PhpExcel/PHPExcel.php' ; + $page_filename = 'MeritPoint-'.date('Ymd', time()) ; + $objPHPExcel = new PHPExcel() ; + $objPHPExcel->getProperties()->setCreator(COMPANY)->setTitle(COMPANY)->setSubject(COMPANY)->setDescription(COMPANY)->setKeywords(COMPANY)->setCategory(COMPANY) ; + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + $count = 1 ; + $firstChar = 'A' ; + $firstChar2 = $firstChar ; + + $array_title = [] ; + $array_title[] = 'Date' ; + $array_title[] = 'Time' ; + $array_title[] = 'Created By Staff IDNo' ; + $array_title[] = 'Created By Staff Name' ; + $array_title[] = 'Created By Department' ; + $array_title[] = 'Created By Designation' ; + $array_title[] = 'Created By Section' ; + $array_title[] = 'Staff IDNo' ; + $array_title[] = 'Staff Name' ; + $array_title[] = 'Department' ; + $array_title[] = 'Designation' ; + $array_title[] = 'Section' ; + $array_title[] = 'Action' ; + $array_title[] = 'Amount' ; + $array_title[] = 'Remark' ; + foreach ( $array_title as $ktitle => $vtitle ){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $vtitle ) ; + $firstChar2++ ; + } + $count++ ; + + $mysqli_page = $mysqli->query( $mysqli_query." ORDER by a.created_at DESC" ) ; + if( $mysqli_page->num_rows > 0 ){ + + $staff_lists = [] ; + $staff_ids = [] ; + while( $row_page = $mysqli_page->fetch_assoc() ){ + $staff_lists[] = $row_page ; + $staff_ids[$row_page['staff_id']] = $row_page['staff_id'] ; + $staff_ids[$row_page['createdby_staff_id']] = $row_page['createdby_staff_id'] ; + } + + $staff_departments = [] ; + $select_departments = $mysqli->query( "SELECT a.staff_id, b.department_desc FROM staff_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.staff_id IN ( ".implode(', ', $staff_ids)." )" ) ; + if ( $select_departments->num_rows > 0 ){ + while ( $row_departments = $select_departments->fetch_assoc() ){ + $staff_departments[$row_departments['staff_id']][] = $row_departments['department_desc'] ; + } + } + + foreach ( $staff_lists as $k => $row_page ){ + $firstChar2 = $firstChar ; + + $temp = [ + 'Date' => date('Y-m-d', strtotime( $row_page['created_at'])), + 'time' => date('H:i:s', strtotime( $row_page['created_at'])), + 'CreatedByStaffIDNo' => dataFilter($row_page['createdby_staff_idno']), + 'CreatedByStaffName' => dataFilter($row_page['createdby_staff_name']), + 'CreatedByDepartment' => ( count($staff_departments[$row_page['createdby_staff_id']]) > 0 ? ( implode( "\n", $staff_departments[$row_page['createdby_staff_id']] ) ) : '' ), + 'CreatedByDesignation' => $position[$row_page['createdby_job_position_id']], + 'CreatedBySection' => $section[$row_page['createdby_job_section_id']], + 'StaffIDNo' => dataFilter($row_page['staff_idno']), + 'StaffName' => dataFilter($row_page['staff_name']), + 'Department' => ( count($staff_departments[$row_page['staff_id']]) > 0 ? ( implode( "\n", $staff_departments[$row_page['staff_id']] ) ) : '' ), + 'Designation' => $position[$row_page['job_position_id']], + 'Section' => $section[$row_page['job_section_id']], + 'Action' => ucfirst($row_page['title']), + 'Amount' => ($row_page['adjustment_type'] == 'plus' ? '+' : '').dataFilter($row_page['point']), + 'Remark' => dataFilter($row_page['remark']) + ] ; + + foreach ( $temp as $ktemp => $vtemp ){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar2.$count, $vtemp ) ; + $firstChar2++ ; + } + + $count++ ; + } + } + + // Submission from + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + $objWriter->save('php://output') ; + exit ; + break ; + } + + $mysqli_page = $mysqli->query($mysqli_query."ORDER by a.created_at DESC LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
    +
    + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + num_rows > 0 ){ + while( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + echo ' + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + ' ; + } + ?> + +
    '.resetDateTimeFormat($row_page['created_at']).''.dataFilter($row_page['createdby_staff_name']).' ('.dataFilter($row_page['createdby_staff_idno']).')'.dataFilter($row_page['staff_name']).' ('.dataFilter($row_page['staff_idno']).')'.ucfirst($row_page['title']).''.($row_page['adjustment_type'] == 'plus' ? '+' : '').dataFilter($row_page['point']).''.dataFilter($row_page['remark']).'
    '.$lang['no_data'].'
    + +
    +
    +
    +
    +
    +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; + } + + $active_menu = 'hr-merit-points-task' ; + $search_name = escapeString($_GET['search_name']) ; + $search_idno = escapeString($_GET['search_idno']) ; + $search_mobile = escapeString($_GET['search_mobile']) ; + $search_mail = escapeString($_GET['search_mail']) ; + $search_date = ( $_GET['search_date']!= '' ? date('Y-m-d', strtotime($_GET['search_date'])) : '' ) ; + $search_action = escapeString($_GET['search_action']) ; + $search_type = escapeString($_GET['search_type']) ; + $search_remark = escapeString($_GET['search_remark']) ; + $search_level = escapeString($_GET['search_level']) ; + + $search_query = ''; + + if( $search_name != ''){ + $search_query .= " AND b.staff_name LIKE '%".$search_name."%'" ; + } + if( $search_idno != ''){ + $search_query .= " AND b.staff_idno LIKE '%".$search_idno."%'" ; + } + if( $search_mobile != ''){ + $search_query .= " AND b.staff_mobileno LIKE '%".$search_mobile."%'" ; + } + if( $search_mail != ''){ + $search_query .= " AND b.staff_email LIKE '%".$search_mail."%'" ; + } + if ( $search_date != '' ){ + $search_query .= " AND a.created_at >= '".$search_date."' " ; + } + if ( $search_level != '' ){ + $search_query .= " AND c.difficulty = '".$search_level."' " ; + } + if ( $search_action != '' ){ + $search_query .= " AND c.title like '%".$search_action."%' " ; + } + if ( $search_type == 'positive' ){ + $search_query .= " AND a.amount >= '0' " ; + }elseif ( $search_type == 'negative' ){ + $search_query .= " AND a.amount < '0' " ; + } + if ( $search_remark != '' ){ + $search_query .= " AND a.remark LIKE '%".$search_remark."%' " ; + } + + // page query + $mysqli_query = "SELECT a.created_at, a.amount, a.remark, b.staff_name, c.assigned_by, c.difficulty, c.title FROM staff_point_movement a + LEFT JOIN staff b ON (a.staff_id = b.staff_id) + LEFT JOIN task c ON (a.from_id = c.task_id) + WHERE a.deleted_at IS NULL and a.from_table = 'task' " . $search_query .$user_branch_permission_sql_b ; + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_name='.$search_name.'&search_date='.$search_date.'&page_mode='.$page_mode.'&search_idno='.$search_idno.'&search_mobile='.$search_mobile.'&search_mail='.$search_mail.'&search_action='.$search_action.'&search_type='.$search_type.'&search_remark='.$search_remark.'&search_level='.$search_level ; + + $mysqli_page = $mysqli->query($mysqli_query."ORDER by a.created_at DESC LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
    +
    + + +
    +
    Search
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    +
    +
    listing
    +
    + + + + + + + + + + + + + + num_rows > 0 ){ + while( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + if($row_page['before_amount'] >= $row_page['balance']){ + $movement_action = 'minus'; + }else{ + $movement_action = 'add'; + } + + echo ' + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + ' ; + } + ?> + +
    Assigned By
    '.resetDateTimeFormat($row_page['created_at']).''.dataFilter($row_page['staff_name']).''.dataFilter($staff_all[$row_page['assigned_by']]).''.ucfirst($row_page['difficulty']).''.ucfirst($row_page['title']).''.($movement_action == 'add' ? '+' : '').dataFilter($row_page['amount']).''.dataFilter($row_page['remark']).'
    '.$lang['no_data'].'
    + +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/hr-payment-slip.php b/hr-payment-slip.php new file mode 100644 index 0000000..65cba20 --- /dev/null +++ b/hr-payment-slip.php @@ -0,0 +1,364 @@ +query("SELECT * FROM staff_payment_slip + WHERE payment_slip_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO staff_payment_slip (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "payment_file_type = '', + payment_file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + if ( $get_image['extension'] == 'pdf' ){ + $file_name = $page.'-'.time().'.pdf' ; + copy($_FILES["image"]["tmp_name"], 'uploads/PaymentSlip/'.$file_name) ; + $image_query = "payment_file_type = 'pdf', + payment_file = '".$file_name."'," ; + }else{ + $create_image = reCreateImage('PaymentSlip', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "payment_file_type = '".$get_image['extension']."', + payment_file = '".$create_image['image']."'," ; + } + } + } + + // update database + $mysqli->query("UPDATE staff_payment_slip SET + ".$image_query." + staff_id = '".escapeString($_POST['staff_id'])."', + payment_subject = '".$page_title."', + updated_at = '".TODAYDATE."' + WHERE payment_slip_id = '".$page."'") ; + + pushToUserCron( 'staff_payment_slip', $page, $_POST['staff_id'], 'Payment Slip', 'Your payment slip has been submitted.' ) ; + + // add system log + $array_remark = array('old' => array('title' => $row_page['payment_subject']), + 'new' => array('title' => $page_title)) ; + // refresh page + header("Location:hr-payment-slip.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'payment-slip-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'payment-slip-update') ) ){ + header('Location: hr-payment-slip.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + // get all requires + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + ?> + + + +
    +
    + + + '.$lang['Thank you your payment slip has been updated'].' +
    ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    + +
    +
    +
    + + +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + query($mysqli_query." ORDER BY a.payment_slip_id DESC LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
    +
    + + +
    + + +
    +
    + + + + +
    +
    + + +
    +
    listing
    +
    + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['payment_slip_id'] ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
    ' ; + if ( permissionCheck($row_user, 'payment-slip-update') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['staff_name']).' ( '.dataFilter($row_page['staff_idno']).' )'.dataFilter($row_page['payment_subject']).''.resetDateFormat($row_page['created_at']).' +
    + + +
    +
    '.$lang['no_data'].'
    + +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/hr-position.php b/hr-position.php new file mode 100644 index 0000000..0f988f8 --- /dev/null +++ b/hr-position.php @@ -0,0 +1,255 @@ +query("INSERT INTO system_post (post_type, post_categories, post_date, post_modified) VALUES ('hr-position', 'hr-position', '".TODAYDATE."', '".TODAYDATE."')"); + $last_id = $mysqli->insert_id; + } + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
    + +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + query("SELECT * FROM system_post + WHERE post_id = '".$page."' AND post_type = 'hr-position' AND post_categories = 'hr-position' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // update database + if (isset($type) && $type == 'edit' && $_POST['hide'] == 1){ + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + $apply_to_form = escapeString($_POST['apply_to_form']) ; + // check if name already exists. + $check_status = checkTitle($page_title, $page) ; + $title = $check_status['title'] ; + $status = $check_status['status'] ; + // update database + $mysqli->query("UPDATE system_post SET + post_title = '".$page_title."', + post_status = '".$status."', + post_link = '".$title."', + ".$image_query." + post_modified = '".TODAYDATE."', + post_trash = '0' + WHERE post_id = '".$page."'") ; + // refresh page + header("Location:hr-position.php?page_mode=edit&page=".$page."&success=1") ; + exit ; + } + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + ?> +
    + +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + 0){ + foreach($sortable as $key => $value){ + $mysqli->query("UPDATE system_post SET + post_order = '".$value."' + WHERE post_id = '".$key."'") ; + } + } + // trash item + switch($_POST['page_action']){ + case 'trash': + $mysqli_query = "UPDATE " . system_post . " SET + post_trash = '1' + WHERE post_id = " ; + $trash_page = trashPage('post', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } + } + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + // set search url + $search_url = 'search='.$search ; + // page query + $mysqli_query = "SELECT * FROM system_post + WHERE post_title != '' AND post_type = 'hr-position' AND post_categories = 'hr-position' AND post_trash = '0'".$search_query ; + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY post_order LIMIT $start_from, " . LIMIT) ; + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query); + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
    + +
    + +
    +
    + + + + +
    +
    + +
    +
    +
    + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + // title + $title = dataFilter($row_page['post_title']) ; + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
    '.$title.''.date('d M Y', strtotime($row_page['post_date'])).' +
    + + +
    +
    '.$lang['no_data'].'
    + +
    +
    +
    +
    + \ No newline at end of file diff --git a/hr-staff-adjustment-wallet.php b/hr-staff-adjustment-wallet.php new file mode 100644 index 0000000..059d97e --- /dev/null +++ b/hr-staff-adjustment-wallet.php @@ -0,0 +1,602 @@ + 0 ? 'plus' : ( $amount < 0 ? 'minus' : '' ) ) ; + + switch ( $adjustment_type ){ + case 'plus' : + $amount = ( $amount > 0 ? $amount : -($amount) ) ; + break ; + case 'minus' : + $amount = ( $amount > 0 ? -($amount) : $amount ) ; + break ; + } + + if ( $adjustment_type != '' ){ + + $error = 'Invalid staff' ; + + $staff_id = [] ; + + // delete all department & receiver + $receiver_type = dataFilter($_POST['receiver_type']) ; + $receiver_to = $_POST['receiver_to'] ; + $receiver_to_dept = $_POST['receiver_to_dept'] ; + + if ( $receiver_type == '1' ){ + if( !empty( $receiver_to ) ){ + for ( $i = 0 ; $i < count($receiver_to) ; $i++ ){ + if ( $receiver_to[$i] != '' ){ + $reset_staff = $receiver_to[$i] ; + $staff_id[$reset_staff] = $receiver_to[$i] ; + } + } + } + }else{ + if( !empty( $receiver_to_dept ) ){ + $array_depart = [] ; + for ( $i = 0 ; $i < count($receiver_to_dept) ; $i++ ){ + + $department_id = $receiver_to_dept[$i] ; + if ( $department_id != '' ){ + + // save into department + $selected_depart[]= $department_id ; + + // check department staff + $reset_depart = str_replace( ['(', ')'], '', $department_id ) ; + $get_depart_staff = $mysqli->query( "SELECT a.staff_id FROM staff_department a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND b.deleted_at IS NULL AND a.department_id = '".$reset_depart."'" ) ; + if ( $get_depart_staff->num_rows > 0 ){ + while ( $row_depart_staff = $get_depart_staff->fetch_assoc() ){ + if ( !in_array($row_depart_staff['staff_id'], $array_depart) ){ + $array_depart[] = $row_depart_staff['staff_id'] ; + $staff_id[$row_depart_staff['staff_id']] = $row_depart_staff['staff_id'] ; + } + } + } + + } + } + } + } + + if ( count($staff_id) > 0 ){ + $error = 'Failed To Submit' ; + + if ( $mysqli->query( "INSERT INTO staff_adjustmentwallet + ( `adjustment_type`, `created_branch_id`, `created_by_userid`, `department_id`, `amount`, `remark` ) VALUES + ( '".$adjustment_type."', '".$current_branch_id."', '".$_SESSION['system_id']."', '0', '".$amount."', '".$remark."' )" ) ){ + $status = '200' ; + + $error = 'success-updated' ; + + $adjustment_id = $mysqli->insert_id ; + $adjustment_so = 'AW'.strPad( 6, $adjustment_id ) ; + $mysqli->query( "UPDATE staff_adjustmentwallet SET adjustment_so = '".$adjustment_so."' WHERE adjustment_id = '".$adjustment_id."'" ) ; + + // set amount movement + $remark2 = 'You have been '.( $amount > 0 ? 'given' : 'deducted' ).' the amount from backend (' . $adjustment_so . ')' ; + + foreach ( $staff_id as $k => $v ){ + + $mysqli->query( "INSERT INTO staff_adjustment_wallet ( `adjustment_id`, `staff_id`, `amount` ) VALUES ( '".$adjustment_id."', '".$v."', '".$amount."' )" ) ; + walletMovement( 'adjustment', $adjustment_id, $adjustment_type, 'normal', $v, $amount, $remark ) ; + pushToUserCron( 'staff_adjustmentwallet', $adjustment_id, $v, 'Wallet Adjustment', $remark ) ; + } + + } + + } + + } + } + + // refresh page + header("Location:hr-staff-adjustment-wallet.php?page_mode=all&success=1") ; + $_SESSION['system_result'] = $error ; + exit ; + } + + if ( (!permissionCheck($row_user, 'staff-adjustment-wallet-new') ) ){ + header('Location: hr-staff-adjustment-wallet.php') ; + exit ; + } + + // staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query( "SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql . ( $get_user_tier['check'] ? " AND staff_tier IN ( ".implode(', ', $get_user_tier['tiers'])." )" : '' ) ) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // get all requires + $department_list = [] ; + $mysqli_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $mysqli_department->num_rows > 0 ){ + while ( $row_department = $mysqli_department->fetch_assoc() ){ + $department_list[$row_department['department_id']] = dataFilter($row_department['department_desc']) ; + } + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'handbook-list-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'handbook-list-edit') ) ){ + header('Location: app-training.php') ; + exit ; + } + + // get all selected staff & department + $receiver_depart = ( $row_page['department_id'] != '' ? explode('/', $row_page['department_id']) : [] ) ; + + // setting + $array_setting_adjustment = [] ; + $select_setting = $mysqli->query( "SELECT a.adjustment_id, a.adjustment_type, b.title FROM setting_adjustment a + LEFT JOIN setting_adjustment_translation b ON ( a.adjustment_id = b.adjustment_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.adjustment_site = 'backend'" ) ; + if ( $select_setting->num_rows > 0 ){ + while ( $row_setting = $select_setting->fetch_assoc() ){ + $array_setting_adjustment[$row_setting['adjustment_type']][] = $row_setting ; + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + + + + +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    To
    +
    + +
    +     + +
    + +
    +
    +
    + +
    + +
    + + +
    +
    + +
    +
    + +
    +
    + + +
    +
    +
    + +
    +
    +
    +
    Remark
    +
    + +
    +
    +
    +
    Amount
    +
    + +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + + query( $mysqli_query." LIMIT 1" ) ; + if ( $mysqli_adjustment->num_rows == 0 ){ + exit ; + } + $row_adjustment = $mysqli_adjustment->fetch_assoc() ; + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'page_mode='.$page_mode.'&adjustment_id='.$adjustment_id.'search='.$search ; + + $mysqli_query = "SELECT a.amount, a.created_at, b.staff_name FROM staff_adjustment_wallet a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.adjustment_id = '".$adjustment_id."'" ; + $mysqli_page = $mysqli->query( $mysqli_query." ORDER BY a.wallet_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> +
    +
    + + +
    +
    Staff Wallet Adjustment
    +
    + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + echo ' + + + + + '; + } + } + ?> + +
    StaffAmountCreated At
    '.dataFilter($row_page['staff_name']).''.dataFilter($row_page['amount']).''.resetDateTimeFormat($row_page['created_at']).'
    + +
    +
    + +
    +
    Wallet Adjustment Details
    +
    +
    +
    +
    Type
    +
    + +
    +
    +
    +
    Remark
    +
    + +
    +
    +
    +
    Amount
    +
    + +
    +
    +
    +
    +
    +
    +
    + + query( $mysqli_query." ORDER BY a.adjustment_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> +
    +
    + + + + '.$lang['Thank you details has been updated'].' +
    ' ; + break ; + default : + echo ' +
    + '.$_SESSION['system_result'].' +
    ' ; + } + unset($_SESSION['system_result']) ; + } + ?> + +
    +
    Staff Wallet Adjustment
    +
    + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + echo ' + + + + + + + + '; + } + } + ?> + +
    SoTypeAmountRemarkCreated At
    + + '.dataFilter($row_page['adjustment_so']).''.dataFilter($row_page['adjustment_type']).''.dataFilter($row_page['amount']).''.dataFilter($row_page['remark']).''.resetDateTimeFormat($row_page['created_at']).'
    + +
    +
    +
    + + \ No newline at end of file diff --git a/hr-staff-adjustment.php b/hr-staff-adjustment.php new file mode 100644 index 0000000..8cfb5b7 --- /dev/null +++ b/hr-staff-adjustment.php @@ -0,0 +1,739 @@ + 0 ? $point : -($point) ) ; + break ; + case 'minus' : + $point = ( $point > 0 ? -($point) : $point ) ; + break ; + } + + if ( $setting_adjustment_id != '' ){ + + $error = 'Invalid staff' ; + + $staff_id = [] ; + + // delete all department & receiver + $receiver_type = dataFilter($_POST['receiver_type']) ; + $receiver_to = $_POST['receiver_to'] ; + $receiver_to_dept = $_POST['receiver_to_dept'] ; + + if ( $receiver_type == '1' ){ + if( !empty( $receiver_to ) ){ + for ( $i = 0 ; $i < count($receiver_to) ; $i++ ){ + if ( $receiver_to[$i] != '' ){ + $reset_staff = $receiver_to[$i] ; + $staff_id[$reset_staff] = $receiver_to[$i] ; + } + } + } + }else{ + if( !empty( $receiver_to_dept ) ){ + $array_depart = [] ; + for ( $i = 0 ; $i < count($receiver_to_dept) ; $i++ ){ + + $department_id = $receiver_to_dept[$i] ; + if ( $department_id != '' ){ + + // save into department + $selected_depart[]= $department_id ; + + // check department staff + $reset_depart = str_replace( ['(', ')'], '', $department_id ) ; + $get_depart_staff = $mysqli->query( "SELECT a.staff_id FROM staff_department a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND b.deleted_at IS NULL AND a.department_id = '".$reset_depart."'" ) ; + if ( $get_depart_staff->num_rows > 0 ){ + while ( $row_depart_staff = $get_depart_staff->fetch_assoc() ){ + if ( !in_array($row_depart_staff['staff_id'], $array_depart) ){ + $array_depart[] = $row_depart_staff['staff_id'] ; + $staff_id[$row_depart_staff['staff_id']] = $row_depart_staff['staff_id'] ; + } + } + } + + } + } + } + } + + if ( count($staff_id) > 0 ){ + $error = 'Selected adjustment not exists.' ; + + // check adjustment exists + $setting_adjustment = $mysqli->query( "SELECT a.adjustment_id, a.adjustment_type, b.title FROM setting_adjustment a + LEFT JOIN setting_adjustment_translation b ON ( a.adjustment_id = b.adjustment_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.adjustment_site = 'backend' AND a.adjustment_id = '".$setting_adjustment_id."' LIMIT 1" ) ; + if ( $setting_adjustment->num_rows > 0 ){ + $error = 'Failed To Submit' ; + + $row_setting_adjustment = $setting_adjustment->fetch_assoc() ; + + if ( $mysqli->query( "INSERT INTO staff_adjustment + ( `adjustment_type`, `created_branch_id`, `created_by`, `created_type`, `created_name`, `department_id`, `setting_adjustment_id`, `point`, `remark` ) VALUES + ( '".$adjustment_type."', '".$current_branch_id."', '".$_SESSION['system_id']."', '".$created_type."', '".$created_name."', '0', '".$setting_adjustment_id."', '".$point."', '".$remark."' )" ) ){ + $status = '200' ; + + $error = 'success-updated' ; + + + $adjustment_id = $mysqli->insert_id ; + $adjustment_so = 'AD'.strPad( 6, $adjustment_id ) ; + $mysqli->query( "UPDATE staff_adjustment SET adjustment_so = '".$adjustment_so."' WHERE adjustment_id = '".$adjustment_id."'" ) ; + + // set point movement + // $remark = ( $point > 0 ? 'Earn' : 'Deduct' ).' point from adjustment ( ' . $adjustment_so . ' )' ; + $remark = 'You have been '.( $point > 0 ? 'given' : 'deducted' ).' the point ('.$row_setting_adjustment['title'].') from backend (' . $adjustment_so . ')' ; + + foreach ( $staff_id as $k => $v ){ + $mysqli->query( "INSERT INTO staff_adjustment_point ( `adjustment_id`, `setting_adjustment_id`, `staff_id`, `point` ) VALUES ( '".$adjustment_id."', '".$setting_adjustment_id."', '".$v."', '".$point."' )" ) ; + + pointMovement( 'adjustment', $adjustment_id, $adjustment_type, 'normal', $v, $point, $remark ) ; + pushToUserCron( 'staff_adjustment', $adjustment_id, $v, 'Point Adjustment', $remark ) ; + } + + } + } + + } + + } + } + + // refresh page + header("Location:hr-staff-adjustment.php?page_mode=all&success=1") ; + $_SESSION['system_result'] = $error ; + exit ; + } + + if ( (!permissionCheck($row_user, 'staff-adjustment-new') ) ){ + header('Location: hr-staff-adjustment.php') ; + exit ; + } + + // staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query( "SELECT staff_id, staff_name, staff_idno FROM staff + WHERE deleted_at IS NULL ".$user_branch_permission_sql . ( $get_user_tier['check'] ? " AND staff_tier IN ( ".implode(', ', $get_user_tier['tiers'])." )" : '' ) ) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // get all requires + $department_list = [] ; + $mysqli_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $mysqli_department->num_rows > 0 ){ + while ( $row_department = $mysqli_department->fetch_assoc() ){ + $department_list[$row_department['department_id']] = dataFilter($row_department['department_desc']) ; + } + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'handbook-list-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'handbook-list-edit') ) ){ + header('Location: app-training.php') ; + exit ; + } + + // get all selected staff & department + $receiver_depart = ( $row_page['department_id'] != '' ? explode('/', $row_page['department_id']) : [] ) ; + + // setting + $array_setting_adjustment = [] ; + $select_setting = $mysqli->query( "SELECT a.adjustment_id, a.adjustment_type, b.title FROM setting_adjustment a + LEFT JOIN setting_adjustment_translation b ON ( a.adjustment_id = b.adjustment_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.adjustment_site = 'backend'" ) ; + if ( $select_setting->num_rows > 0 ){ + while ( $row_setting = $select_setting->fetch_assoc() ){ + $array_setting_adjustment[$row_setting['adjustment_type']][] = $row_setting ; + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + + + +
    +
    + + +
    +
    +
    +
    + +
    +
    Mode
    +
    + + + +
    +
    +
    +
    Name
    +
    + +
    +
    + +
    + +
    +
    +
    To
    +
    + +
    +     + +
    + +
    +
    +
    + +
    + +
    + + +
    +
    + +
    +
    + +
    +
    + + +
    +
    +
    + +
    +
    + + + +
    +
    Mode
    +
    + + +
    +
    + +
    +
    Type
    +
    + + + + + +
    +
    + +
    +
    Remark
    +
    + +
    +
    +
    +
    Point
    +
    + +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + + query( $mysqli_query." LIMIT 1" ) ; + if ( $mysqli_adjustment->num_rows == 0 ){ + exit ; + } + $row_adjustment = $mysqli_adjustment->fetch_assoc() ; + + + + // get adjustment title + $adjustment_title = '' ; + $setting_adjustment = $mysqli->query( "SELECT b.title FROM setting_adjustment a + LEFT JOIN setting_adjustment_translation b ON ( a.adjustment_id = b.adjustment_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.adjustment_id = '".$row_adjustment['setting_adjustment_id']."' LIMIT 1" ) ; + if ( $setting_adjustment->num_rows > 0 ){ + $row_setting_adjustment = $setting_adjustment->fetch_assoc() ; + $adjustment_title = $row_setting_adjustment['title'] ; + } + + + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'page_mode='.$page_mode.'&adjustment_id='.$adjustment_id.'search='.$search ; + + $mysqli_query = "SELECT a.point, a.created_at, b.staff_name FROM staff_adjustment_point a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.adjustment_id = '".$adjustment_id."'" ; + $mysqli_page = $mysqli->query( $mysqli_query." ORDER BY a.point_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> +
    + + +
    +
    Staff Point Adjustment
    +
    + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + echo ' + + + + + '; + } + } + ?> + +
    StaffPointCreated At
    '.dataFilter($row_page['staff_name']).''.dataFilter($row_page['point']).''.resetDateTimeFormat($row_page['created_at']).'
    + +
    +
    + +
    +
    Point Adjustment Details
    +
    +
    +
    +
    Created Type
    +
    + +
    +
    +
    +
    Created Name
    +
    + +
    +
    + +
    + +
    +
    Type
    +
    + +
    +
    +
    +
    Type
    +
    + +
    +
    +
    +
    Remark
    +
    + +
    +
    +
    +
    Point
    +
    + +
    +
    +
    +
    +
    +
    + + query( $mysqli_query." ORDER BY a.adjustment_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> +
    +
    + + + + '.$lang['Thank you details has been updated'].' +
    ' ; + break ; + default : + echo ' +
    + '.$_SESSION['system_result'].' +
    ' ; + } + unset($_SESSION['system_result']) ; + } + ?> + +
    +
    Staff Point Adjustment
    +
    + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + echo ' + + + + + + + + + '; + } + } + ?> + +
    SoTypeTitlePointRemarkCreated At
    + + '.dataFilter($row_page['adjustment_so']).''.dataFilter($row_page['adjustment_type']).''.dataFilter($row_page['title']).''.dataFilter($row_page['point']).''.dataFilter($row_page['remark']).''.resetDateTimeFormat($row_page['created_at']).'
    + +
    +
    +
    + + \ No newline at end of file diff --git a/hr-staff-attendance.php b/hr-staff-attendance.php new file mode 100644 index 0000000..b51ad97 --- /dev/null +++ b/hr-staff-attendance.php @@ -0,0 +1,211 @@ +query("SELECT staff_idno, staff_id FROM staff WHERE deleted_at IS NULL") ; + if ( $mysqli_staff->num_rows > 0 ){ + while($row_staff = $mysqli_staff->fetch_array(MYSQLI_ASSOC)){ + $staff_all[$row_staff['staff_idno']] = $row_staff['staff_id']; + } + } + + if(isset($_FILES['import-excel']['name'])){ + + include 'PhpExcel/PHPExcel.php' ; + + $file_name = $_FILES['import-excel']['name']; + $ext = pathinfo($file_name, PATHINFO_EXTENSION); + + //Checking the file extension + if($ext == "xlsx"){ + $file_name = $_FILES['import-excel']['tmp_name']; + $inputFileName = $file_name; + + /**********************PHPExcel Script to Read Excel File**********************/ + // Read your Excel workbook + try { + $inputFileType = PHPExcel_IOFactory::identify($inputFileName); //Identify the file + $objReader = PHPExcel_IOFactory::createReader($inputFileType); //Creating the reader + $objPHPExcel = $objReader->load($inputFileName); //Loading the file + } catch (Exception $e) { + die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) + . '": ' . $e->getMessage()); + header("location: hr-staff.php?page_mode=staff-attendance&result=error&msg=".urlencode($e->getMessage())); + exit; + } + // ################################################################################## + // Setting excel + // ################################################################################## + $sheet1 = $objPHPExcel->getSheet(0); //Selecting sheet 0 + $highestRow1 = $sheet1->getHighestRow(); //Getting number of rows + $highestColumn1 = $sheet1->getHighestColumn(); //Getting number of columns + // Loop through each row of the worksheet in turn -> $row is for starting point + for ( $row = 2; $row <= $highestRow1; $row++ ) { + // Read a row of data into an array + $rowData = $sheet1->rangeToArray('A' . $row . ':' . $highestColumn1 . $row, NULL, TRUE, FALSE); + $rowData2[] = $rowData[0] ; + } + + if( isset($rowData2) ){ + + $mysqli->query( "UPDATE staff_attendance_summary SET deleted_at = '".TODAYDATE."' WHERE type IN ( 'late', 'absent' )" ) ; + + foreach ( $rowData2 as $kk => $vv ) { + if ( $vv[0] != '' ){ + $get_staff = $staff_all[$vv[0]] ; + if ( $get_staff != null ){ + $mysqli->query( "INSERT INTO staff_attendance_summary + ( `staff_id`, `type`, `times`, `created_at`, `updated_at` ) VALUES + ( '".$get_staff."', '".$vv[1]."', '".$vv[2]."', '".TODAYDATE."', '".TODAYDATE."' )" ) ; + } + } + } + }else{ + header("location: hr-staff.php?page_mode=staff-attendance&result=error&msg=Something got ERROR"); + exit; + } + header("location: hr-staff.php?page_mode=staff-attendance&result=success&msg=Import Successful"); + exit; + } + } + + // form submit + if ($_POST['hide'] == '1' && $_POST['hide_status'] == 'action'){ + // trash item + switch($_POST['page_action']){ + case 'trash': + $mysqli_query = "UPDATE staff_attendance_summary SET + deleted_at = '".TODAYDATE."' + WHERE attendance_summary_id = " ; + $trash_page = trashPage('staff_attendance_summary', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } + } + + $search_query = ''; + + // page query + $mysqli_query = "SELECT a.attendance_summary_id, a.type, a.times, b.staff_idno FROM staff_attendance_summary a + LEFT JOIN staff b ON (a.staff_id = b.staff_id) + WHERE a.deleted_at IS NULL " . $search_query .$user_branch_permission_sql_b ; + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_staff_idno='.$search_staff_idno.'&search_type='.$search_type.'&page_mode=staff-attendance' ; + + $mysqli_page = $mysqli->query($mysqli_query." LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + $result = $_GET['result']; + $msg = $_GET['msg']; + if ($result == 'error') { + $display_error = '
    '.$msg.'
    '; + }elseif ($result == 'success') { + $display_error = '
    '.$msg.'
    '; + } + + include 'requires/page_header.php'; + include 'requires/page_top.php'; +?> + +
    + + +
    +
    + Import Excel File + Download Sample +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    + + +
    +
    + + + + +
    +
    + + +
    +
    +
    + + + + + + + + + + + num_rows > 0 ){ + while( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['staff_id'] ; + + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
    '.dataFilter($row_page['staff_idno']).''.dataFilter($row_page['type']).''.dataFilter($row_page['times']).' +
    + + +
    +
    '.$lang['no_data'].'
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/hr-staff-leave.php b/hr-staff-leave.php new file mode 100644 index 0000000..70ef091 --- /dev/null +++ b/hr-staff-leave.php @@ -0,0 +1,311 @@ +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; +} + +// include the class +include 'requires/class_resize.php' ; + +// keep parameter in value +$page = escapeString($_GET['page']) ; +$page_mode = escapeString($_GET['page_mode']) ; +$type = escapeString($_GET['type']) ; +$search = escapeString($_GET['search']) ; + +// mode type | all list | new | edit +switch($page_mode){ + + // all type list + case 'all' : + default : + + // query type + $search_query = '' ; + $staff_id = escapeString($_GET['staff_id']) ; + $ty_type = escapeString($_GET['ty_type']) ; + $st_type = escapeString($_GET['st_type']) ; + $sort_by = escapeString($_GET['sort_by']) ; + $sort_by = ( $sort_by != '' ? $sort_by : 'created_at' ) ; + $sort_by_type = escapeString($_GET['sort_by_type']) ; + $sort_by_type = ( $sort_by_type != '' ? $sort_by_type : 'desc' ) ; + $export = escapeString($_GET['export']) ; + + // form submit + if ( $_POST['hide'] == '1' ){ + $leave_annual_id = escapeString($_POST['leave_annual_id']) ; + $leave_annual = escapeString($_POST['leave_annual']) ; + $leave_sick_id = escapeString($_POST['leave_sick_id']) ; + $leave_sick = escapeString($_POST['leave_sick']) ; + if ( $leave_annual_id > 0 && $leave_annual != '' ){ + $mysqli->query("UPDATE staff_leave_year SET leave_days = '".$leave_annual."' WHERE leave_year_id = '".$leave_annual_id."'") ; + } + if ( $leave_sick_id > 0 && $leave_sick != '' ){ + $mysqli->query("UPDATE staff_leave_year SET leave_days = '".$leave_sick."' WHERE leave_year_id = '".$leave_sick_id."'") ; + } + } + + // search query + if ($search != ''){ + $search_query .= " AND (leave_reason LIKE '%".$search."%')" ; + } + if ($ty_type != ''){ + $search_query .= " AND leave_type = '".$ty_type."'" ; + } + if ($st_type != ''){ + $search_query .= " AND leave_status = '".$st_type."'" ; + } + + // active menu bar + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-leave' ; + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&staff_id='.$staff_id.'&ty_type='.$ty_type.'&st_type='.$st_type.'&sort_by='.$sort_by.'&sort_by_type='.$sort_by_type ; + + // page query + $mysqli_query = "SELECT a.leave_id as leave_id, a.leave_type, a.leave_from, a.leave_to, a.leave_day, a.leave_file, a.leave_reason, a.leave_status, a.created_at, a.updated_at, b.staff_name, b.staff_idno FROM staff_leave a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.staff_id = '".$staff_id."' AND a.deleted_at IS NULL " . $search_query ; + + // export excel + if ( $export == 'yes' ){ + + include 'PhpExcel/PHPExcel.php' ; + + $page_filename = 'StaffLeave-'.date( 'Ymd', time() ) ; + $objPHPExcel = new PHPExcel() ; + $objPHPExcel->getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel2007' ) ; + + // default parameter + $count = 1 ; + $char = 'A' ; + $count_row = 1 ; + + $array_title = array( 'No.', 'Request By', 'Type', 'From ~ To', 'Reason', 'Status', 'Created Date', 'Updated Date' ) ; + + $newChar = $char ; + foreach( $array_title as $k => $v ){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $newChar.$count, $v ) ; + $newChar++ ; + } + $count++ ; + + $row_q = $mysqli->query($mysqli_query." ORDER BY a.created_at DESC") ; + if ( $row_q->num_rows > 0 ){ + while ( $row = $row_q->fetch_assoc() ){ + $newChar = $char ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $count_row ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($row['staff_name']).' ( '.dataFilter($row['staff_idno']).' )' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, ucwords($row['leave_type']) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($row['leave_from']).' ~ '.dataFilter($row['leave_to']).' ('.dataFilter($row['leave_day']).')' ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($row['leave_reason']) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($row['leave_status']) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, resetDateFormat($row['created_at']) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, resetDateFormat($row['updated_at']) ) ; + + $count++ ; + $count_row++ ; + } + } + + // Submission from + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; + } + + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY a.created_at DESC LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + setStaffLeaveYear( $staff_id ) ; + ?> + +
    + + + + query("SELECT leave_year_id, leave_type, leave_days FROM staff_leave_year + WHERE staff_id = '".$staff_id."' AND leave_year = '".date('Y', time())."'") ; + if ( $get_year->num_rows > 0 ){ + $annual_id = '' ; + $annual = '' ; + $sick_id = '' ; + $sick = '' ; + while ( $row_year = $get_year->fetch_assoc() ){ + if ( $row_year['leave_type'] == 'annual' ){ + $annual_id = $row_year['leave_year_id'] ; + $annual = $row_year['leave_days'] ; + } + if ( $row_year['leave_type'] == 'sick' ){ + $sick_id = $row_year['leave_year_id'] ; + $sick = $row_year['leave_days'] ; + } + } + ?> +
    +
    +
    +
    +
    +
    Annual
    +
    + +
    +
    +
    +
    Sick
    +
    + +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + if ( $row_page['leave_status'] == 'pending' ){ + $button = '' ; + }elseif ( $row_page['leave_status'] == 'confirmed' ){ + $button = '' ; + }else{ + $button = '' ; + } + + echo ' + + + + + + + + + + ' ; + } + }else{ + echo ' + + + + + + + + + + ' ; + } + ?> + +
    +
    + +
    +
    + +
    '.dataFilter($row_page['staff_name']).'
    ( '.dataFilter($row_page['staff_idno']).' )
    '.ucwords($row_page['leave_type']).''.dataFilter($row_page['leave_from']).' ~ '.dataFilter($row_page['leave_to']).' ('.dataFilter($row_page['leave_day']).')' ; + if ( $row_page['leave_file'] != '' ){ + echo ' + + + ' ; + } + echo ' + '.dataFilter($row_page['leave_reason']).''.$button.''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).'
    '.$lang['no_data'].'
    + +
    +
    + +
    + \ No newline at end of file diff --git a/hr-staff-point-history.php b/hr-staff-point-history.php new file mode 100644 index 0000000..d252eab --- /dev/null +++ b/hr-staff-point-history.php @@ -0,0 +1,133 @@ +query("SELECT staff_idno, staff_id FROM staff + WHERE staff_id != ''"); + if ($mysqli_staff->num_rows > 0){ + while($row_staff = $mysqli_staff->fetch_array(MYSQLI_ASSOC)){ + $staff_all[$row_staff['staff_idno']] = $row_staff['staff_id']; + } + } + + $search_name = $_GET['search_name']; + $search_date = $_GET['search_date']; + + if ( $search_date != '' ){ + $search_query .= " AND ( a.created_at LIKE '%".$search_date."%' )" ; + } + if ( $search_name != '' ){ + $search_query .= " AND ( b.staff_name LIKE '%".$search_name."%' )" ; + } + + + // page query + $mysqli_query = "SELECT a.created_at, a.balance, a.before_amount, a.amount, b.staff_name FROM staff_point_movement a + LEFT JOIN staff b ON (a.staff_id = b.staff_id) + WHERE a.deleted_at IS NULL " . $search_query .$user_branch_permission_sql_b ; + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_name='.$search_name.'&search_date='.$search_date.'&page_mode=staff-point-history' ; + + $mysqli_page = $mysqli->query($mysqli_query."ORDER by a.staff_id, a.movement_id DESC LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + include 'requires/page_header.php'; + include 'requires/page_top.php'; +?> +
    +
    + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + num_rows > 0 ){ + while( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + if($row_page['before_amount'] >= $row_page['balance']){ + $movement_action = 'minus'; + }else{ + $movement_action = 'add'; + } + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
    '.dataFilter($row_page['staff_name']).''.dataFilter($row_page['before_amount']).''.($movement_action == 'add' ? '+' : '').dataFilter($row_page['amount']).''.dataFilter($row_page['balance']).''.resetDateFormat($row_page['created_at']).'
    '.$lang['no_data'].'
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/hr-staff-transaction.php b/hr-staff-transaction.php new file mode 100644 index 0000000..892e2bb --- /dev/null +++ b/hr-staff-transaction.php @@ -0,0 +1,127 @@ +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; +} + +// keep parameter in value +$staff_id = escapeString($_GET['staff_id']) ; +$branch_transaction = escapeString($_GET['branch_transaction']) ; +$hide = escapeString($_GET['hide']) ; +$name = escapeString($_GET['name']) ; +$confirm = escapeString($_GET['confirm']) ; +// include the class +include 'requires/class_resize.php' ; + +// get all branch +$branch = [] ; +$get_branch = $mysqli->query("SELECT * FROM branch + WHERE deleted_at IS NULL") ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +$mysqli_page = $mysqli->query("SELECT * FROM staff + WHERE staff_id = '".$staff_id."' LIMIT 1"); +if ($mysqli_page->num_rows > 0){ + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + + + if( $confirm == 1 ){ + if ( $row_page['branch_id'] != $branch_transaction ){ + $mysqli->query("UPDATE staff SET + branch_id = '".$branch_transaction."' + WHERE staff_id = '".$staff_id."'") ; + $mysqli->query("DELETE FROM staff_token WHERE staff_id = '".$staff_id."'") ; + } + + header("Location:hr-staff-transaction.php?staff_id=".$staff_id) ; + exit ; + } +} + +$active_main_menu = 'hr' ; +$active_sub_menu = 'hr-staff' ; +$active_menu = 'hr-staff-list' ; +// start header here +include 'requires/page_header.php' ; +include 'requires/page_top.php' ; + + +if($hide == 1){ +echo ''; +} + +?> + +
    + + + +
    +
    +
    +
    +
    +
    Staff Name
    +
    + +
    +
    +
    +
    Branch
    +
    + +
    +
    +
    +
    Transaction To
    +
    + +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/hr-staff-vcard.php b/hr-staff-vcard.php new file mode 100644 index 0000000..5f7a7c6 --- /dev/null +++ b/hr-staff-vcard.php @@ -0,0 +1,107 @@ +query("SELECT * FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND staff_idno = '".$staff_idno."' LIMIT 1") ; +if ( $mysqli_staff->num_rows > 0 ){ + header('Content-Type: text/x-vcard') ; + header('Content-Disposition: inline; filename= "'.$staff_idno.'.vcf"'); + + // get staff details + $row_staff = $mysqli_staff->fetch_assoc() ; + + $staff_settings = $row_staff['staff_settings'] ; + if ( $staff_settings != '' ){ + $staff_settings = JsonEncodeDecode('decode', $staff_settings) ; + }else{ + $staff_settings = [] ; + } + + // get all gender + $gender = [] ; + $get_gender = $mysqli->query("SELECT * FROM master_gender + WHERE deleted_at IS NULL") ; + if ( $get_gender->num_rows > 0 ){ + while ( $row_gender = $get_gender->fetch_assoc() ){ + $gender[$row_gender['gender_id']] = $row_gender['gender_desc'] ; + } + } + + // get all department + $department = [] ; + $get_department = $mysqli->query("SELECT b.department_desc FROM staff_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.staff_id = '".$row_staff['staff_id']."'") ; + + if ( $get_department->num_rows > 0 ){ + while ( $row_department = $get_department->fetch_assoc() ){ + $department[] = $row_department['department_desc'] ; + } + } + + // get all position + $position = [] ; + $get_position = $mysqli->query("SELECT a.job_position_id, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $get_position->num_rows > 0 ){ + while ( $row_position = $get_position->fetch_assoc() ){ + $position[$row_position['job_position_id']] = $row_position['job_position_desc'] ; + } + } + + // get all section + // $section = [] ; + // $get_section = $mysqli->query("SELECT * FROM setting_job_section + // WHERE deleted_at IS NULL") ; + // if ( $get_section->num_rows > 0 ){ + // while ( $row_section = $get_section->fetch_assoc() ){ + // $section[$row_section['job_section_id']] = $row_section['job_section_desc'] ; + // } + // } + + $get_department = implode( ', ', $department ) ; + $get_position = $position[$row_staff['job_position_id']] ; + $get_section = $section[$row_staff['job_section_id']] ; + $get_title = $get_position . ( $get_section != '' && $get_section != 'NONE' ? ' ( '.$get_section.' )' : '' ) ; + + + switch ( $staff_settings['vcard_mode'] ){ + case '1' : + $get_title = $get_position ; + break ; + case '2' : + $get_title = $get_department ; + break ; + default : + $get_title = $get_department . ' ' . $get_position ; + } + + $data_joined = ( $row_staff['staff_date_joined'] != '' && $row_staff['staff_date_joined'] != '0000-00-00' ? date( 'Ymd', strtotime($row_staff['staff_date_joined']) ) . "T195243Z" : '' ) ; + + $vcard = "" ; + $vcard .= "BEGIN:VCARD" . "\r\n" ; + $vcard .= "VERSION:3.0" . "\r\n" ; + $vcard .= "N:".$row_staff['staff_shortname'] . "\r\n" ; + $vcard .= "ORG:".strtoupper( COMPANY ) . "\r\n" ; + $vcard .= "TITLE:".$get_title . "\r\n" ; + $vcard .= "GENDER:".substr( $gender[$row_staff['gender_id']], 0, 1 ) . "\r\n" ; + $vcard .= "TEL;TYPE=WORK,VOICE:+".str_replace( '+', '', $row_staff['staff_mobileno'] ) . "\r\n" ; + $vcard .= "TEL;TYPE=WORK,MSG:+".str_replace( '+', '', $row_staff['staff_mobileno'] ) . "\r\n" ; + $vcard .= "URL;TYPE=WORK:".WEBSITE . "\r\n" ; + $vcard .= "EMAIL;TYPE=INTERNET:".$row_staff['staff_email'] . "\r\n" ; + $vcard .= "REV:" . $data_joined . "\r\n" ; + $vcard .= "END:VCARD" ; + + echo $vcard ; + exit ; + +}else{ + header( "Location: hr-staff.php" ) ; + exit ; +} + +?> \ No newline at end of file diff --git a/hr-staff.php b/hr-staff.php new file mode 100644 index 0000000..cb137e9 --- /dev/null +++ b/hr-staff.php @@ -0,0 +1,2982 @@ +query("SELECT * FROM setting_salary_tax WHERE deleted_at IS NULL"); +while($row_tax = mysqli_fetch_assoc($get_salary_tax)){ + if($row_tax['tax_type'] == 'EPF'){ + $epf_rate[$row_tax['tax_id']] = [ + 'title' => $row_tax['tax_title'], + 'employee_rate' => $row_tax['employee_rate'], + 'employer_rate' => $row_tax['employer_rate'], + ]; + }else if($row_tax['tax_type'] == 'SOCSO'){ + $socso_rate[$row_tax['tax_id']] = [ + 'title' => $row_tax['tax_title'], + 'employee_rate' => $row_tax['employee_rate'], + 'employer_rate' => $row_tax['employer_rate'], + ]; + }else if($row_tax['tax_type'] == 'EIS'){ + $eis_rate[$row_tax['tax_id']] = [ + 'title' => $row_tax['tax_title'], + 'employee_rate' => $row_tax['employee_rate'], + 'employer_rate' => $row_tax['employer_rate'], + ]; + }else if($row_tax['tax_type'] == 'ZAKAT'){ + $zakat_rate[$row_tax['tax_id']] = [ + 'title' => $row_tax['tax_title'], + 'employee_rate' => $row_tax['employee_rate'], + 'employer_rate' => $row_tax['employer_rate'], + ]; + } +} + +// get all gender +$gender = [] ; +$get_gender = $mysqli->query("SELECT * FROM master_gender + WHERE deleted_at IS NULL") ; +if ( $get_gender->num_rows > 0 ){ + while ( $row_gender = $get_gender->fetch_assoc() ){ + $gender[$row_gender['gender_id']] = $row_gender['gender_desc'] ; + } +} + +// get all position +$position = [] ; +$get_position = $mysqli->query("SELECT a.job_position_id, a.job_position_code, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; +if ( $get_position->num_rows > 0 ){ + while ( $row_position = $get_position->fetch_assoc() ){ + $position[$row_position['job_position_id']] = $row_position['job_position_code'] . ' ( ' . $row_position['job_position_desc'] . ' )' ; + } +} + +// get all section +$section = [] ; +$get_section = $mysqli->query("SELECT a.job_section_id, a.job_section_code, b.job_section_desc FROM setting_job_section a + LEFT JOIN setting_job_section_translation b ON ( a.job_section_id = b.job_section_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; +if ( $get_section->num_rows > 0 ){ + while ( $row_section = $get_section->fetch_assoc() ){ + $section[$row_section['job_section_id']] = $row_section['job_section_code'] . ' ( ' . $row_section['job_section_desc'] . ' )' ; + } +} + +// get all job status +$job_status = [] ; +$get_job_status = $mysqli->query("SELECT * FROM master_job_status + WHERE deleted_at IS NULL") ; +if ( $get_job_status->num_rows > 0 ){ + while ( $row_job_status = $get_job_status->fetch_assoc() ){ + $job_status[$row_job_status['job_status_id']] = $row_job_status['job_status_desc'] ; + } +} + +// get all country +$country = [] ; +$get_country = $mysqli->query("SELECT * FROM master_country + WHERE deleted_at IS NULL") ; +if ( $get_country->num_rows > 0 ){ + while ( $row_country = $get_country->fetch_assoc() ){ + $country[$row_country['country_id']] = $row_country['country_desc'] ; + } +} + +// get all working group +$working_group = [] ; +$get_working_group = $mysqli->query("SELECT * FROM setting_working_group + WHERE deleted_at IS NULL") ; +if ( $get_working_group->num_rows > 0 ){ + while ( $row_working_group = $get_working_group->fetch_assoc() ){ + $working_group[$row_working_group['group_id']] = $row_working_group['group_name'] ; + } +} + +// get all branch +$branch = [] ; +$get_branch = $mysqli->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'] ; + } +} + +// get all requires +$get_user_tier = userTierQuery( $row_user ) ; + +$tier_list = [] ; +$tier_list_id = [] ; +$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 DESC") ; +if ( $mysqli_tier->num_rows > 0 ){ + while ( $row_tier = $mysqli_tier->fetch_assoc() ){ + $tier_list[] = $row_tier ; + $tier_list_id[$row_tier['tier_id']] = $row_tier['title'] ; + } +} + +// get all requires +$department_list = [] ; +$mysqli_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' ORDER BY b.department_desc ASC") ; +if ( $mysqli_department->num_rows > 0 ){ + while ( $row_department = $mysqli_department->fetch_assoc() ){ + $department_list[] = $row_department ; + } +} + +// mode type | all list | new | edit +switch($page_mode){ + + case 'staff-point-history' : + include 'hr-staff-point-history.php'; + break; + + // edit staff + case 'new' : + case 'edit' : + $active_menu = 'hr-staff-list' ; + + // add permission + $search_query = '' ; + // if ( $_SESSION['system_permission'] != 'admin' ){ + // if ( permissionCheck($row_user, 'staff-list-view') && permissionCheck($row_user, 'foreign-only') ){ + // // do nothing + // }elseif ( permissionCheck($row_user, 'staff-list-view') ){ + // $search_query .= " AND country_id = '1'" ; + // }else{ + // $search_query .= " AND country_id != '1'" ; + // } + // } + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM staff + WHERE staff_id = '".$page."' ".$search_query." LIMIT 1"); + + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + }else{ + $page = '' ; + } + + // trash passport / permit + if ( $_GET['staff_image'] == 'yes' && $_GET['staff_image_id'] != '' ){ + + $error_message = '
    '.$lang['Sorry image not found'].'
    ' ; + + $staff_image_id = escapeString($_GET['staff_image_id']) ; + $get_staff_image = $mysqli->query("SELECT * FROM staff_image + WHERE image_id = '".$staff_image_id."' LIMIT 1") ; + if ( $get_staff_image->num_rows > 0 ){ + $mysqli->query("UPDATE staff_image SET + deleted_at = '".TODAYDATE."' + WHERE image_id = '".$staff_image_id."'") ; + $error_message = '
    '.$lang['Thank you image was removed'].'
    ' ; + } + + // refresh page + header("Location:hr-staff.php?page_mode=edit&page=".$page) ; + $_SESSION['system_result'] = $error_message ; + exit ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + $error_message = '
    '.$lang['Please enter all required fill'].'
    ' ; + $message = ''; + + $staff_idno = escapeString($_POST['staff_idno']) ; + $staff_name = escapeString($_POST['staff_name']) ; + $staff_shortname = escapeString($_POST['staff_shortname']) ; + $staff_mobileno = escapeString($_POST['staff_mobileno']) ; + $staff_birthdate = escapeString($_POST['staff_birthdate']) ; + $staff_date_joined = escapeString($_POST['staff_date_joined']) ; + $staff_tier = escapeString($_POST['staff_tier']) ; + $staff_probation_end = escapeString($_POST['staff_probation_end']) ; + $staff_effective_date = escapeString($_POST['staff_effective_date']) ; + $ot_rate_type = escapeString($_POST['ot_rate_type']) ; + $staff_salary_nextreview_date = escapeString($_POST['staff_salary_nextreview_date']) ; + $staff_salary_effective_date = escapeString($_POST['staff_salary_effective_date']) ; + $staff_username = escapeString($_POST['staff_username']) ; + $staff_email = escapeString($_POST['staff_email']) ; + $password = escapeString($_POST['password']) ; + $passwordnotmatch = escapeString($_POST['passwordnotmatch']) ; + $staff_covid = escapeString($_POST['staff_covid']) ; + $staff_covid_test = escapeString($_POST['staff_covid_test']) ; + $staff_fonema = escapeString($_POST['staff_fonema']) ; + $staff_typhoid = escapeString($_POST['staff_typhoid']) ; + $staff_fenoma_period = escapeString($_POST['staff_fenoma_period']) ; + $country_id = $_POST['country_id'] ; + $staff_icno = escapeString($_POST['staff_icno']) ; + $staff_passportno = escapeString($_POST['staff_passportno']) ; + $staff_passportexpired = escapeString($_POST['staff_passportexpired']) ; + + + $old_staff_group[0] = false; + + + + // if ( $staff_idno != '' && $staff_name != '' && $staff_shortname != '' && $staff_username != '' && $staff_mobileno != '' && $staff_birthdate != '' && $staff_tier != '' && $staff_date_joined != '' ){ + + //if( ($country_id == '1' && $staff_icno != '') || ( $country_id != '' && $staff_passportno != '' && $staff_passportexpired != '') ){ + + // check if email not exists + if ( $staff_email != '' ){ + $check_email = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id != '".$page."' AND staff_email = '".$staff_email."' LIMIT 1") ; + if ( $check_email->num_rows > 0 ){ + $error_message .= '
    '.$lang['Sorry email already exists'].'
    ' ; + } + } + + // check if username not exists + if ( $staff_username != '' ){ + $check_username = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id != '".$page."' AND staff_username = '".$staff_username."' LIMIT 1") ; + if ( $check_username->num_rows > 0 ){ + $error_message .= '
    '.$lang['Sorry username already exists'].'
    ' ; + } + } + + // check if staff idno not exists + if ( $staff_idno != '' ){ + $check_idno = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id != '".$page."' AND staff_idno = '".$staff_idno."' LIMIT 1") ; + if ( $check_idno->num_rows > 0 ){ + $error_message .= '
    '.$lang['Sorry idno already exists'].'
    ' ; + } + } + + $check_group = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id = '".$page."' LIMIT 1") ; + if ( $check_group->num_rows > 0 ){ + $row = $check_group->fetch_array(MYSQLI_ASSOC); + if ( $row['group_id'] != $_POST['group_id'] ){ + $old_staff_group[0] = true; + $old_staff_group[1] = [ + "old" => $row['group_id'], + "new" => $_POST['group_id'], + ]; + } + + } + + + + // if ( $password != '' && $password != $passwordnotmatch ){ + // $error_message .= '
    '.$lang['Sorry password doesnt exists'].'
    ' ; + // } + + // save staff data + if ( $error_message != '' ){ + + $error = 0 ; + $mysqli->autocommit( false ) ; + + $update_query = '' ; + + try { + + + // new staff + if ( $page == '' ){ + $mysqli->query("INSERT INTO staff (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // password + if ( $password != '' ){ + $staff_password = passwordEncrypt($password) ; + $update_query .= "staff_password = '".$staff_password."'," ; + } + + // staff settings + $staff_settings = [ + 'ismanager' => ( $_POST['staff_setting_ismanager'] == 'yes' ? 'yes' : 'no' ), + 'ishrmanager' => ( $_POST['staff_setting_ishrmanager'] == 'yes' ? 'yes' : 'no' ), + 'warning' => ( $_POST['staff_setting_warning'] == 'yes' ? 'yes' : 'no' ), + 'switchbranch' => ( $_POST['staff_setting_switchbranch_card'] == 'yes' ? 'yes' : 'no' ), + 'adjustmentbranch' => ( $_POST['staff_setting_adjustmentbranch_card'] == 'yes' ? 'yes' : 'no' ), + 'reporttaskbranch' => ( $_POST['staff_setting_reporttaskbranch_card'] == 'yes' ? 'yes' : 'no' ), + 'reportadjustmentbranch' => ( $_POST['staff_setting_reportadjustmentbranch_card'] == 'yes' ? 'yes' : 'no' ), + 'punch' => ( $_POST['staff_setting_punch_card'] == 'yes' ? 'yes' : 'no' ), + 'without_geometry' => ( $_POST['staff_setting_without_geometry'] == 'yes' ? 'yes' : 'no' ), + 'checkrecruitment' => ( $_POST['staff_setting_checkrecruitment'] == 'yes' ? 'yes' : 'no' ), + 'checkassociation' => ( $_POST['staff_setting_checkassociation'] == 'yes' ? 'yes' : 'no' ), + 'checktraining' => ( $_POST['staff_setting_checktraining'] == 'yes' ? 'yes' : 'no' ), + 'approvevisitation' => ( $_POST['staff_setting_approvevisitation'] == 'yes' ? 'yes' : 'no' ), + 'checkvisitation' => ( $_POST['staff_setting_checkvisitation'] == 'yes' ? 'yes' : 'no' ), + 'vcard_mode' => ( $_POST['staff_setting_vcard_mode'] == '1' ? '1' : ( $_POST['staff_setting_vcard_mode'] == '2' ? '2' : '3' ) ), + 'marital_status' => escapeString($_POST['marital_status']), + 'mailing_address' => escapeString($_POST['mailing_address']), + 'income_tax_no' => escapeString($_POST['income_tax_no']), + 'spouse_name' => escapeString($_POST['spouse_name']), + 'spouse_ic' => escapeString($_POST['spouse_ic']), + 'spouse_working' => escapeString($_POST['spouse_working']), + 'spouse_income_tax' => escapeString($_POST['spouse_income_tax']), + 'no_children' => escapeString($_POST['no_children']), + ] ; + $staff_settings = json_encode($staff_settings) ; + + // resize image + // set image in variable + $image = $_FILES["staff_image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "staff_image = ''," ; + } + $create_image = reCreateImage('Staff', $page, $page, '', $image, $_FILES["staff_image"]["type"], $_FILES['staff_image']['tmp_name']) ; + + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $image_query = "staff_image = '".$create_image['image']."'," ; + } + + //Array ( [name] => Array ( [0] => addon-apk.pdf ) [type] => Array ( [0] => application/pdf ) [tmp_name] => Array ( [0] => /tmp/phpy5FLEr ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 314338 ) ) + + // passport image + $passportimages = $_FILES['passportimages'] ; + if ( arrayCheck($passportimages['name']) ){ + foreach ( $passportimages['name'] as $k => $v ){ + + $image = $v ; + if ( $_FILES['passportimages']['type'][$k] == 'application/pdf' ){ + $new_image = 'ppd-'.$k.'-'.rand(000000, 999999).'-'.time().'.pdf' ; + copy( $_FILES['passportimages']['tmp_name'][$k], 'uploads/StaffImage/'.$new_image ) ; + $mysqli->query("INSERT INTO staff_image + (staff_id, type, file_name, created_at, updated_at) VALUES + ('".$page."', 'passport', '".$new_image."', '".TODAYDATE."', '".TODAYDATE."')") ; + }else{ + $create_image = reCreateImage('StaffImage', $page, 'ppi-'.$k.'-'.rand(000000, 999999).'-'.time(), '', $image, $_FILES['passportimages']["type"][$k], $_FILES['passportimages']['tmp_name'][$k]) ; + + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $mysqli->query("INSERT INTO staff_image + (staff_id, type, file_name, created_at, updated_at) VALUES + ('".$page."', 'passport', '".$create_image['image']."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + } + } + } + + // permit image + $permitimages = $_FILES['permitimages'] ; + if ( arrayCheck($permitimages['name']) ){ + foreach ( $permitimages['name'] as $k => $v ){ + $image = $v ; + if ( $_FILES['permitimages']['type'][$k] == 'application/pdf' ){ + $permit_pdf = 'pd-'.$k.'-'.rand(000000, 999999).'-'.time().'.pdf' ; + copy( $_FILES['permitimages']['tmp_name'][$k], 'uploads/StaffImage/'.$permit_pdf ) ; + $mysqli->query("INSERT INTO staff_image + (staff_id, type, file_name, created_at, updated_at) VALUES + ('".$page."', 'permit', '".$permit_pdf."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + else{ + $create_image = reCreateImage('StaffImage', $page, 'pi-'.$k.'-'.rand(000000, 999999).'-'.time(), '', $image, $_FILES['permitimages']["type"][$k], $_FILES['permitimages']['tmp_name'][$k]) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $mysqli->query("INSERT INTO staff_image + (staff_id, type, file_name, created_at, updated_at) VALUES + ('".$page."', 'permit', '".$create_image['image']."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + } + } + } + // update database + $mysqli->query("UPDATE staff SET + ".$update_query." + ".$image_query." + staff_idno = '".$staff_idno."', + staff_name = '".$staff_name."', + staff_shortname = '".$staff_shortname."', + staff_email = '".$staff_email."', + staff_username = '".$staff_username."', + staff_mobileno = '".$staff_mobileno."', + gender_id = '".escapeString($_POST['gender_id'])."', + staff_birthdate = '".escapeString($_POST['staff_birthdate'])."', + country_id = '".escapeString($_POST['country_id'])."', + staff_icno = '".escapeString($_POST['staff_icno'])."', + staff_passportno = '".escapeString($_POST['staff_passportno'])."', + staff_passportexpired = '".escapeString($_POST['staff_passportexpired'])."', + religion_id = '".escapeString($_POST['religion_id'])."', + ethnic_id = '".escapeString($_POST['ethnic_id'])."', + staff_date_joined = '".escapeString($_POST['staff_date_joined'])."', + staff_tier = '".escapeString($_POST['staff_tier'])."', + staff_date_confirmed = '".escapeString($_POST['staff_date_confirmed'])."', + staff_date_resigned = '".escapeString($_POST['staff_date_resigned'])."', + staff_run_away = '".escapeString($_POST['staff_run_away'])."', + staff_resign_reason = '".escapeString($_POST['staff_resign_reason'])."', + staff_probation_end = '".escapeString($_POST['staff_probation_end'])."', + job_position_id = '".escapeString($_POST['job_position_id'])."', + job_section_id = '".escapeString($_POST['job_section_id'])."', + staff_effective_date = '".escapeString($_POST['staff_effective_date'])."', + ot_rate_type = '".escapeString($_POST['ot_rate_type'])."', + branch_id = '".escapeString($_POST['branch_id'])."', + leave_id = '".escapeString($_POST['leave_id'])."', + sick_id = '".escapeString($_POST['sick_id'])."', + group_id = '".escapeString($_POST['group_id'])."', + salary_id = '".escapeString($_POST['salary_id'])."', + job_type_id = '".escapeString($_POST['job_type_id'])."', + job_status_id = '".escapeString($_POST['job_status_id'])."', + work_type_id = '".escapeString($_POST['work_type_id'])."', + staff_permitno = '".escapeString($_POST['staff_permitno'])."', + staff_permit_start = '".escapeString($_POST['staff_permit_start'])."', + staff_permit_end = '".escapeString($_POST['staff_permit_end'])."', + staff_permit_effective_date = '".escapeString($_POST['staff_permit_effective_date'])."', + staff_salary = '".escapeString($_POST['staff_salary'])."', + staff_contract_salary = '".escapeString($_POST['staff_contract_salary'])."', + staff_allowance_topup = '".escapeString($_POST['staff_allowance_topup'])."', + staff_allowance_work = '".escapeString($_POST['staff_allowance_work'])."', + staff_allowance_food = '".escapeString($_POST['staff_allowance_food'])."', + staff_salary_nextreview_date = '".escapeString($_POST['staff_salary_nextreview_date'])."', + staff_salary_effective_date = '".escapeString($_POST['staff_salary_effective_date'])."', + bank_id = '".escapeString($_POST['bank_id'])."', + payment_type_id = '".escapeString($_POST['payment_type_id'])."', + payment_transfer_id = '".escapeString($_POST['payment_transfer_id'])."', + staff_accountno = '".escapeString($_POST['staff_accountno'])."', + staff_epf_rate = '".escapeString($_POST['staff_epf_rate'])."', + staff_epf_rate_id = '".escapeString($_POST['staff_epf_rate_id'])."', + staff_socso_rate_id = '".escapeString($_POST['staff_socso_rate_id'])."', + staff_eis_rate_id = '".escapeString($_POST['staff_eis_rate_id'])."', + staff_zakat_rate_id = '".escapeString($_POST['staff_zakat_rate_id'])."', + staff_epfno = '".escapeString($_POST['staff_epfno'])."', + staff_taxno = '".escapeString($_POST['staff_taxno'])."', + staff_child_relief = '".escapeString($_POST['staff_child_relief'])."', + staff_eis_status = '".escapeString($_POST['staff_eis_status'])."', + socso_category_id = '".escapeString($_POST['socso_category_id'])."', + tax_status_id = '".escapeString($_POST['tax_status_id'])."', + staff_muslim_zakat = '".escapeString($_POST['staff_muslim_zakat'])."', + staff_eis_status = '".escapeString($_POST['staff_eis_status'])."', + staff_settings = '".$staff_settings."', + staff_covid = '".$staff_covid."', + staff_covid_test = '".$staff_covid_test."', + staff_fonema = '".$staff_fonema."', + staff_fenoma_period = '".$staff_fenoma_period."', + staff_typhoid = '".$staff_typhoid."', + updated_at = '".TODAYDATE."' + WHERE staff_id = '".$page."'") ; + + // knowledge check list + $knowledgelist = $_POST['knowledge'] ; + $mysqli->query("DELETE FROM staff_knowledge + WHERE staff_id = '".$page."'") ; + + if( !empty($knowledgelist) ){ + for ( $i = 0 ; $i < count($knowledgelist) ; $i++ ){ + $mysqli->query("INSERT INTO staff_knowledge + (staff_id, knowledge_id, created_at, updated_at) VALUES + ('".$page."', '".$knowledgelist[$i]."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + } + + // department check list + $departmentlist = $_POST['department'] ; + $mysqli->query("DELETE FROM staff_department + WHERE staff_id = '".$page."'") ; + + if( !empty($departmentlist) ){ + for ( $i = 0 ; $i < count($departmentlist) ; $i++ ){ + $mysqli->query("INSERT INTO staff_department + (staff_id, department_id, created_at, updated_at) VALUES + ('".$page."', '".$departmentlist[$i]."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + } + + // hostel check list + $hostellist = $_POST['hostel'] ; + $mysqli->query("DELETE FROM staff_hostel + WHERE staff_id = '".$page."'") ; + + if( !empty($hostellist) ){ + for ( $i = 0 ; $i < count($hostellist) ; $i++ ){ + $mysqli->query("INSERT INTO staff_hostel + (staff_id, hostel_id, created_at, updated_at) VALUES + ('".$page."', '".$hostellist[$i]."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + } + + // add system log + $array_remark = array('old' => array('staff_name' => $row_page['staff_name']), + 'new' => array('staff_name' => $staff_name)) ; + + + + }catch( Exception $e ){ + $error_message .= '
    '.$lang['Sorry something error'].' ('.$e.').
    ' ; + $error++; + } + + if( $error == 0 ) { + + // commit query + $mysqli->commit() ; + $error_message = '
    '.$lang['Thank you your staff has been updated'].'
    ' ; + + }else{ + $mysqli->rollback() ; + } + + } + + //}else{ + //$error_message ; + //} + + // } + + // refresh page + header("Location:hr-staff.php?page_mode=edit&page=".$page) ; + $_SESSION['system_result'] = $error_message ; + exit ; + } + + // get all ethnic + $ethnic = [] ; + $get_ethnic = $mysqli->query("SELECT * FROM master_ethnic + WHERE deleted_at IS NULL") ; + if ( $get_ethnic->num_rows > 0 ){ + while ( $row_ethnic = $get_ethnic->fetch_assoc() ){ + $ethnic[$row_ethnic['ethnic_id']] = $row_ethnic['ethnic_desc'] ; + } + } + + // get all religion + $religion = [] ; + $get_religion = $mysqli->query("SELECT * FROM master_religion + WHERE deleted_at IS NULL") ; + if ( $get_religion->num_rows > 0 ){ + while ( $row_religion = $get_religion->fetch_assoc() ){ + $religion[$row_religion['religion_id']] = $row_religion['religion_desc'] ; + } + } + + // get all leave + $leave = [] ; + $get_leave = $mysqli->query("SELECT * FROM setting_leave + WHERE deleted_at IS NULL") ; + if ( $get_leave->num_rows > 0 ){ + while ( $row_leave = $get_leave->fetch_assoc() ){ + $leave[$row_leave['leave_id']] = $row_leave['leave_name'] ; + } + } + + // get all sick + $sick = [] ; + $get_sick = $mysqli->query("SELECT * FROM setting_sick + WHERE deleted_at IS NULL") ; + if ( $get_sick->num_rows > 0 ){ + while ( $row_sick = $get_sick->fetch_assoc() ){ + $sick[$row_sick['sick_id']] = $row_sick['sick_name'] ; + } + } + + // get all job type + $job_type = [] ; + $get_job_type = $mysqli->query("SELECT * FROM master_job_type + WHERE deleted_at IS NULL") ; + if ( $get_job_type->num_rows > 0 ){ + while ( $row_job_type = $get_job_type->fetch_assoc() ){ + $job_type[$row_job_type['job_type_id']] = $row_job_type['job_type_desc'] ; + } + } + + // get all work days + $work_type = [] ; + $get_work_type = $mysqli->query("SELECT * FROM master_work_type + WHERE deleted_at IS NULL") ; + if ( $get_work_type->num_rows > 0 ){ + while ( $row_work_type = $get_work_type->fetch_assoc() ){ + $work_type[$row_work_type['work_type_id']] = $row_work_type['work_type_desc'] ; + } + } + + // get all chief + $chief = [] ; + $get_chief = $mysqli->query("SELECT * FROM setting_chief + WHERE deleted_at IS NULL") ; + if ( $get_chief->num_rows > 0 ){ + while ( $row_chief = $get_chief->fetch_assoc() ){ + $chief[$row_chief['chief_id']] = $row_chief['chief_desc'] ; + } + } + + // get all bank + $bank = [] ; + $get_bank = $mysqli->query("SELECT * FROM master_bank + WHERE deleted_at IS NULL") ; + if ( $get_bank->num_rows > 0 ){ + while ( $row_bank = $get_bank->fetch_assoc() ){ + $bank[$row_bank['bank_id']] = $row_bank['bank_desc'] ; + } + } + + // get all payment transfer + $payment_transfer = [] ; + $get_payment_transfer = $mysqli->query("SELECT * FROM master_payment_transfer + WHERE deleted_at IS NULL") ; + if ( $get_payment_transfer->num_rows > 0 ){ + while ( $row_payment_transfer = $get_payment_transfer->fetch_assoc() ){ + $payment_transfer[$row_payment_transfer['payment_transfer_id']] = $row_payment_transfer['payment_transfer_desc'] ; + } + } + + // get all payment transfer + $payment_type = [] ; + $get_payment_type = $mysqli->query("SELECT * FROM master_payment_type + WHERE deleted_at IS NULL") ; + if ( $get_payment_type->num_rows > 0 ){ + while ( $row_payment_type = $get_payment_type->fetch_assoc() ){ + $payment_type[$row_payment_type['payment_type_id']] = $row_payment_type['payment_type_desc'] ; + } + } + + // get all payment transfer + $socso_category = [] ; + $get_socso_category = $mysqli->query("SELECT * FROM master_socso_category + WHERE deleted_at IS NULL") ; + if ( $get_socso_category->num_rows > 0 ){ + while ( $row_socso_category = $get_socso_category->fetch_assoc() ){ + $socso_category[$row_socso_category['socso_category_id']] = $row_socso_category['socso_category_desc'] ; + } + } + + // get all payment transfer + $tax_status = [] ; + $get_tax_status = $mysqli->query("SELECT * FROM master_tax_status + WHERE deleted_at IS NULL") ; + if ( $get_tax_status->num_rows > 0 ){ + while ( $row_tax_status = $get_tax_status->fetch_assoc() ){ + $tax_status[$row_tax_status['tax_status_id']] = $row_tax_status['tax_status_desc'] ; + } + } + + // get all knowledge + $knowledge = [] ; + $get_knowledge = $mysqli->query("SELECT * FROM setting_knowledge + WHERE deleted_at IS NULL") ; + if ( $get_knowledge->num_rows > 0 ){ + while ( $row_knowledge = $get_knowledge->fetch_assoc() ){ + $knowledge[$row_knowledge['knowledge_id']] = $row_knowledge['knowledge_desc'] ; + } + } + + // get all hostel + $hostel = [] ; + $get_hostel = $mysqli->query("SELECT * FROM setting_hostel + WHERE deleted_at IS NULL") ; + if ( $get_hostel->num_rows > 0 ){ + while ( $row_hostel = $get_hostel->fetch_assoc() ){ + $hostel[$row_hostel['hostel_id']] = $row_hostel['hostel_desc'] ; + } + } + + // get all department + $department = [] ; + $get_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $get_department->num_rows > 0 ){ + while ( $row_department = $get_department->fetch_assoc() ){ + $department[$row_department['department_id']] = $row_department['department_desc'] ; + } + } + + // get selected knowledge + $selected_knowledge = [] ; + $get_selected_knowledge = $mysqli->query("SELECT * FROM staff_knowledge + WHERE deleted_at IS NULL AND staff_id = '".$page."'") ; + if ( $get_selected_knowledge->num_rows > 0 ){ + while ( $row_selected_knowledge = $get_selected_knowledge->fetch_assoc() ){ + $selected_knowledge[] = $row_selected_knowledge['knowledge_id'] ; + } + } + + // get selected hostel + $selected_hostel = [] ; + $get_selected_hostel = $mysqli->query("SELECT * FROM staff_hostel + WHERE deleted_at IS NULL AND staff_id = '".$page."'") ; + if ( $get_selected_hostel->num_rows > 0 ){ + while ( $row_selected_hostel = $get_selected_hostel->fetch_assoc() ){ + $selected_hostel[] = $row_selected_hostel['hostel_id'] ; + } + } + + // get selected department + $selected_department = [] ; + $get_selected_department = $mysqli->query("SELECT * FROM staff_department + WHERE deleted_at IS NULL AND staff_id = '".$page."'") ; + if ( $get_selected_department->num_rows > 0 ){ + while ( $row_selected_department = $get_selected_department->fetch_assoc() ){ + $selected_department[] = $row_selected_department['department_id'] ; + } + } + + // default config + $default_config_punch = DEFAULTPUNCH ; + + $staff_settings = $row_page['staff_settings'] ; + if ( $staff_settings != '' ){ + $staff_settings = JsonEncodeDecode('decode', $staff_settings) ; + }else{ + $staff_settings = [] ; + } + + $passportimages = [] ; + $permitimages = [] ; + $get_staff_image = $mysqli->query("SELECT * FROM staff_image + WHERE deleted_at IS NULL AND staff_id = '".$page."'") ; + if ( $get_staff_image->num_rows > 0 ){ + while ( $row_staff_image = $get_staff_image->fetch_assoc() ){ + if ( $row_staff_image['type'] == 'passport' ){ + $passportimages[$row_staff_image['image_id']] = $row_staff_image['file_name'] ; + } + if ( $row_staff_image['type'] == 'permit' ){ + $permitimages[$row_staff_image['image_id']] = $row_staff_image['file_name'] ; + } + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + + + + +
    +
    + + + + query("SELECT * FROM staff + // WHERE deleted_at IS NULL ORDER BY (staff_idno * 1) ASC, staff_idno ASC"); + + // $boolean_next = false ; + // $temp_id = $previous_id = '' ; + // while ($row_next_previous = $mysqli_next_previous->fetch_array(MYSQLI_ASSOC)){ + // $next_previous_id = $row_next_previous['staff_id'] ; + + // if ($boolean_next){ + // $next_id = $next_previous_id ; + // $boolean_next = false ; + // } + + // if ($next_previous_id == $page){ + // $previous_id = $temp_id ; + // $boolean_next = true ; + // } + + // $temp_id = $next_previous_id ; + // } + + // if ($previous_id != '' || $next_id != ''){ + // echo ' + //
    + //
    + //
    + // '.($previous_id != '' ? ''.$lang['Previous'].'' : '').' + // '.($next_id != '' ? ''.$lang['Next'].'' : '').' + //
    + //
    ' ; + // } + ?> + +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +

    +
    + +
    +
    +
    + + + +
    +
    + + +
    +
    +
    + +
    +
    +
    +
    +
    +  '.$lang['remove_photo'].' + ' ; + }else{ + echo ' + + ' ; + } + ?> +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    + +
    +
    *
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +

    +
    + +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + + - +
    +
    +
    +
    *
    +
    + + - +
    +
    +
    +
    *
    +
    + + - +
    +
    +
    +
    +
    + +
    +
    + + 0 ){ ?> +
    +
    +
    +
    + $v ){ + if(strpos($v, ".pdf") == true){ + ?> +
    + +
    + View +
    +
    + Del +
    +
    + +
    + +
    + View +
    +
    + Del +
    +
    + +
    +
    +
    + + +
    +
    + +
    +

    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    Checkup Details

    +
    +
    +
    Fomema Checkup Date
    +
    + +
    +
    +
    +
    Fomema Checkup Period (Year)
    +
    + +
    +
    +
    +
    Typhoid Checkup Date
    +
    + +
    +
    +
    +
    Covid Test Date
    +
    + +
    +
    +
    +
    Covid Injections
    +
    + +
    +
    +
    +
    + +
    + +
    +
    +

    +
    + +
    +
    *
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +

    +
    + +
    +
    *
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + > +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    *

    +
    + +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    + +
    +
    + + $v ){ ?> + + +
    +

    +
    + +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +

    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + 0 ){ ?> +
    +
    +
    +
    + $v ){ + if(strpos($v, ".pdf") == true){ + ?> +
    + +
    + View +
    +
    + Del +
    +
    + +
    + +
    + View +
    +
    + Del +
    +
    + +
    +
    +
    + + +
    +
    + +
    +
    +
    +

    +
    + +
    +
    *
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    OT Rate Type
    +
    + +
    +
    +
    +
    + +
    +

    +
    +
    +
    EPF Rate
    +
    + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    Socso Rate
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    EIS Rate
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    + +
    +

    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +

    +
    + +
    +
    + $v ){ ?> +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    *

    +
    + +
    +
    + $v ){ ?> +
    + +
    +
    + +
    +
    + +
    +
    + +
    +

    +
    + +
    +
    + $v ){ ?> +
    + +
    +
    + +
    +
    + +
    +
    + +
    +

    +
    + +
    +
    +
    + Allow to Approve Resignation +
    +
    + +
    +
    Is Manager
    +
    + + +
    +
    +
    +
    Is HR Manager
    +
    + + +
    +
    + +
    + +
    +
    +
    + + +
    +
    + +
    +
    +
    + + +
    +
    + +
    +
    Allow To View Task Branch Report
    +
    + + +
    +
    + +
    +
    Allow To View Adjustment Branch Report
    +
    + + +
    +
    + +
    +
    Allow To Check Recruitment
    +
    + + +
    +
    + +
    +
    Allow Check In Association
    +
    + + +
    +
    + +
    +
    Allow Check In Training
    +
    + + +
    +
    + +
    +
    Allow Approve Visitation
    +
    + + +
    +
    + +
    +
    Allow Check In Visitation
    +
    + + +
    +
    + +
    +
    +
    + + +
    +
    + +
    +
    Punch Card Without Checking Branch Geometry
    +
    + + +
    +
    + +
    +
    Vcard Mode
    +
    + + + +
    +
    + +
    +
    + +
    + +
    +
    + + +
    +
    +
    + + + +
    +
    + + +
    +
    +
    +
    +
    + = '".$lf_resigned."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL )" ; + }else{ + $search_query .= " AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL )" ; + } + + // $search_query .= ( $get_user_tier['check'] ? " AND a.staff_tier IN ( ".implode(', ', $get_user_tier['tiers'])." )" : '' ) ; + + // form submit + if( $_POST['hide'] == '1' && $_POST['hide_status'] == 'action' ){ + // trash item + switch( $_POST['page_action'] ){ + case 'trash': + $mysqli_query = "UPDATE " . staff . " SET + deleted_at = '".TODAYDATE."' + WHERE staff_id = " ; + $trash_page = trashPage('staff', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_name='.$search_name.'&search_idno='.$search_idno.'&lf_type='.$lf_type.'&lf_branch='.$lf_branch.'&sort_by='.$sort_by.'&sort_by_type='.$sort_by_type.'&lf_branch='.$lf_branch.'&lf_resigned='.$lf_resigned.'&status='.$status.'&show_all_none_branch_staff='.$show_all_none_branch_staff.'&search_point='.$search_point.'&search_wallet='.$search_wallet.'&search_star='.$search_star.'&search_achievement='.$search_achievement ; + + $show_all_none_branch_staff = escapeString($_GET['show_all_none_branch_staff']); + if ( $show_all_none_branch_staff == 'all' ) { + $user_branch_permission_sql_a = '' ; + } + if ( $show_all_none_branch_staff == 'noassigned' ) { + $user_branch_permission_sql_a = " AND a.branch_id = '0'" ; + } + + // page query + $mysqli_query = "SELECT a.* FROM staff a + ".$left_join." + WHERE a.deleted_at IS NULL" . $search_query . $user_branch_permission_sql_a ; + + // export excel + if ( $export == 'yes' ){ + + include 'PhpExcel/PHPExcel.php' ; + + $page_filename = 'Staff-'.date( 'Ymd', time() ) ; + $objPHPExcel = new PHPExcel() ; + $objPHPExcel->getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + // default parameter + $count = 1 ; + $char = 'A' ; + $count_staff = 1 ; + + $array_title = array( 'No.', 'Qrcode', 'ID', 'Name', 'Mobile No','Gender', 'Birth Date','Age','Mailing Address','Marriage Status','Country', "IC", "Passport Date",'Passport No.' , "Permit", 'Position', 'Status','Ethnic','Religion', 'Date Joined ','Created Date','Covid Injections','Covid Test','Fenoma Checkup Date','Fenoma Period', 'Typhoid Checkup Date', 'Monthly Point Achievement', 'Total Point', 'Total Wallet', 'Total Star', 'Tier', 'Achievement' ) ; + + $newChar = $char ; + foreach( $array_title as $k => $v ){ + $objPHPExcel->getActiveSheet()->setCellValue( $newChar.$count, $v ) ; + $newChar++ ; + } + $count++ ; + + $array_staffidnos = [] ; + $staffs_q = $mysqli->query( $mysqli_query." ORDER BY (".$sort_by.' * 1) '.$sort_by_type . ', '.$sort_by.' '.$sort_by_type ) ; + if ( $staffs_q->num_rows > 0 ){ + while ( $staff = $staffs_q->fetch_assoc() ){ + + $staff_idno = ucwords($staff['staff_idno']) ; + if( $staff['country_id'] == '1' ){ + if( $staff['staff_icno'] != '' ){ + $IC = dataFilter($staff['staff_icno']) ; + }else{ + $IC = '-' ; + } + }else{ + $IC = '-' ; + } + + if( $staff['country_id'] == '1' ){ + $passport = '-' ; + }else{ + if( $staff['staff_passportno'] != '-' && $staff['staff_passportexpired'] != '0000-00-00' ){ + $passport = dataFilter($staff['staff_passportexpired']) . ( $staff['staff_passportno'] != '' ? ' ('.dataFilter($staff['staff_passportno']).')' : '' ) ; + }else{ + $passport = '-' ; + } + } + + if( $staff['country_id'] == '1' ){ + $permit = '-' ; + }else{ + if( $staff['staff_permitno'] != '-' && $staff['staff_permit_end'] != '0000-00-00' ){ + $permit = dataFilter($staff['staff_permit_end']) . ( $staff['staff_permitno'] != '' ? ' ('.dataFilter($staff['staff_permitno']).')' : '' ) ; + }else{ + $permit = '-' ; + } + } + + $birthDate = $staff['staff_birthdate']; + if($birthDate!='' && $birthDate !='0000-00-00'){ + $birthDate = date("Y",strtotime($staff['staff_birthdate'])); + //explode the date to get month, day and year + + //get age from date or birthdate + $age = date("Y") - $birthDate; + + if($birthDate!=''){ + $age = "( ".$age." years old )"; + }else{ + $age = "(-)"; + } + }else{ + $age = "(-)"; + } + + $staff_settings_excel = jsonEncodeDecode('decode',$staff['staff_settings']); + + $select_ethnic_name = $mysqli->query("SELECT * FROM master_ethnic WHERE ethnic_id = '".$staff['ethnic_id']."' "); + if($select_ethnic_name->num_rows>0){ + while($row_ethnic_name = $select_ethnic_name->fetch_assoc()){ + $ethic_name = $row_ethnic_name['ethnic_desc']; + } + } + + $select_religion_name = $mysqli->query("SELECT * FROM master_religion WHERE religion_id = '".$staff['religion_id']."' "); + if($select_religion_name->num_rows>0){ + while($row_religion_name = $select_religion_name->fetch_assoc()){ + $religion_name = $row_religion_name['religion_desc']; + } + } + + $newChar = $char ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $count_staff ) ; + + // for qrcode + $qrcode_column = ($newChar++).$count ; + $objPHPExcel->getActiveSheet()->setCellValue( $qrcode_column, ' ' ) ; + $array_staffidnos[] = [ 'coordinate' => $qrcode_column, 'idno' => $staff_idno, ] ; + + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff_idno ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_name'] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_mobileno'] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, dataFilter( $gender[$staff['gender_id']] ) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, date("d-m-Y",strtotime($staff['staff_birthdate'])) ); + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $age ); + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff_settings_excel['mailing_address'] ); + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff_settings_excel['marital_status'] ); + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $country[$staff['country_id']] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $IC ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $passport ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_passportno'] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $permit ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, dataFilter( $position[$staff['job_position_id']] ) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, dataFilter( $job_status[$staff['job_status_id']] ) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $ethic_name) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $religion_name) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['staff_date_joined']) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['created_at']) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['staff_covid']) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['staff_covid_test']) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['staff_fonema']) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_fenoma_period'] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['staff_typhoid']) ) ; + + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_point_achievement'] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_point'] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_wallet'] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_star'] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $tier_list_id[$staff['staff_tier']] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, ucfirst($staff['staff_achievement']) ) ; + + $count++ ; + $count_staff++ ; + } + } + + + // start drawing image + foreach ( $array_staffidnos as $kstaffidnos => $vstaffidnos ){ + // if ( $kstaffidnos == '0' ){ + + $generatecode = generateQrcode( '', $vstaffidnos['idno'], PATH.'hr-staff-vcard.php?staff_idno='.$vstaffidnos['idno'] ) ; + + $qrcode = $generatecode['url'] ; + $base64_qrcode = 'data:image/png;base64,'.base64_encode(file_get_contents($qrcode)) ; + $gdImage = imagecreatefrompng($base64_qrcode) ; + + $objDrawing = new PHPExcel_Worksheet_MemoryDrawing() ; + $objDrawing->setName( $vstaffidnos['idno'] ) ; + $objDrawing->setImageResource( $gdImage ) ; + $objDrawing->setRenderingFunction( PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG ) ; + $objDrawing->setMimeType( PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT ) ; + $objDrawing->setHeight( 55 ) ; + $objDrawing->setCoordinates( $vstaffidnos['coordinate'] ) ; + $objDrawing->setWorksheet( $objPHPExcel->getActiveSheet() ) ; + // } + } + $objPHPExcel->getActiveSheet()->getDefaultRowDimension()->setRowHeight( 40 ) ; + + + // start render excel file + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + ob_clean(); + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; + } + + $mysqli_page = $mysqli->query( $mysqli_query . " ORDER BY (".$sort_by.' * 1) '.$sort_by_type.", ".$sort_by." ".$sort_by_type." LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // 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' ) ; + + ?> + +
    +
    + + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + + + +
    +
    +
    +
    +
    + +
    + + + +
    +
    + + + + +
    +
    + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + num_rows > 0 ){ + + while( $row_page = $mysqli_page->fetch_assoc() ){ + $staff_lists[] = $row_page ; + $staff_ids[] = $row_page['staff_id'] ; + } + + $staff_departments = [] ; + $select_departments = $mysqli->query( "SELECT a.staff_id, b.department_desc FROM staff_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.staff_id IN ( ".implode(', ', $staff_ids)." )" ) ; + if ( $select_departments->num_rows > 0 ){ + while ( $row_departments = $select_departments->fetch_assoc() ){ + $staff_departments[$row_departments['staff_id']][] = $row_departments['department_desc'] ; + } + } + + foreach ( $staff_lists as $k => $row_page ){ + + // default variable + $id = $row_page['staff_id'] ; + $staff_idno = ucwords($row_page['staff_idno']) ; + + if ( $STAFFDETAILS == 'show' ){ + $last_4_class = '' ; + if ( $row_page['country_id'] != '0' && $row_page['country_id'] != '1' ){ + $last_4_month_passport = date( 'Y-m-d', strtotime( $row_page['staff_passportexpired'].' -2 month' ) ) ; + $last_4_month_permit = date( 'Y-m-d', strtotime( $row_page['staff_permit_end'].' -2 month' ) ) ; + if ( ( $row_page['staff_passportno'] != '-' && TODAYDAY >= $last_4_month_passport ) || ( $row_page['staff_permitno'] != '-' && TODAYDAY >= $last_4_month_permit ) ){ + $last_4_class = 'table-background-orange' ; + } + $last_4_month_passport = date( 'Y-m-d', strtotime( $row_page['staff_passportexpired'].' -1 month' ) ) ; + $last_4_month_permit = date( 'Y-m-d', strtotime( $row_page['staff_permit_end'].' -1 month' ) ) ; + if ( ( $row_page['staff_passportno'] != '-' && TODAYDAY >= $last_4_month_passport ) || ( $row_page['staff_permitno'] != '-' && TODAYDAY >= $last_4_month_permit ) ){ + $last_4_class = 'table-background-red' ; + } + } + + // staff_birthdate + $staff_birthdate = $today_year . date( '-m-d', strtotime( $row_page['staff_birthdate'] ) ) ; + + if ( TODAYDAY == $staff_birthdate || TODAYDAY == date('Y-m-d', strtotime('-1 days',strtotime($staff_birthdate))) ){ + $last_4_class = 'table-background-green' ; + } + } + + $check_permission = false ; + if ( $get_user_tier['check'] ){ + if ( in_array( $row_page['staff_tier'], $get_user_tier['tiers'] ) ){ + $check_permission = true ; + } + }else{ + $check_permission = true ; + } + + + echo ' + + + + + + ' ; + + if ( $STAFFDETAILS == 'show' ){ + echo ' + + + ' ; + } + + echo ' + + + + + + + + + + + + '; + } + } + ?> + +
    + + + + + + + ' : ' ' ) ?> + + + +
    + +
    + + + ' : ' ' ) ?> + + + + + + ' : ' ' ) ?> + + + + + + ' : ' ' ) ?> + + + + + + ' : ' ' ) ?> + + + + Department View + + + + Monthly Point Achievement' : ' ' ) ?> + + + + + + Point' : ' ' ) ?> + + + + + + Wallet' : ' ' ) ?> + + + + + + Total Star' : ' ' ) ?> + + + + + + Tier' : ' ' ) ?> + + + + + + Achievement' : ' ' ) ?> + + + + + + ' : ' ' ) ?> + + + + + + ' : ' ' ) ?> + + +
    ' ; + if ( $check_permission ){ + echo ' + + | + + '.(!permissionCheck($row_user, 'staff-list-update') ? '' : ' + | + ') ; + }else{ + echo '-' ; + } + echo ' + '.$staff_idno.''.dataFilter($row_page['staff_name']).''.dataFilter( $gender[$row_page['gender_id']] ).''.$country[$row_page['country_id']].'' ; + if( $row_page['country_id'] == '1' ){ + if( $row_page['staff_icno'] != '' ){ + echo dataFilter($row_page['staff_icno']) ; + }else{ + echo '-' ; + } + }else{ + echo '-' ; + } + echo ' + ' ; + if( $row_page['country_id'] == '1' ){ + echo '-' ; + }else{ + if( $row_page['staff_passportno'] != '-' && $row_page['staff_passportexpired'] != '0000-00-00' ){ + echo dataFilter($row_page['staff_passportexpired']) . ( $row_page['staff_passportno'] != '' ? ' ('.dataFilter($row_page['staff_passportno']).')' : '' ) ; + }else{ + echo '-' ; + } + } + echo ' + ' ; + if( $row_page['country_id'] == '1' ){ + echo '-' ; + }else{ + if( $row_page['staff_permitno'] != '-' && $row_page['staff_permit_end'] != '0000-00-00' ){ + echo dataFilter($row_page['staff_permit_end']) . ( $row_page['staff_permitno'] != '' ? ' ('.dataFilter($row_page['staff_permitno']).')' : '' ) ; + }else{ + echo '-' ; + } + } + echo ' + '.dataFilter( $position[$row_page['job_position_id']] ).''.( count($staff_departments[$row_page['staff_id']]) > 0 ? ( implode( '
    ', $staff_departments[$row_page['staff_id']] ) ) : '' ).'
    '.$row_page['staff_point_achievement'].''.$row_page['staff_point'].''.$row_page['staff_wallet'].''.$row_page['staff_star'].''.$tier_list_id[$row_page['staff_tier']].''.ucfirst($row_page['staff_achievement']).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).'' ; + if ( $check_permission ){ + echo ' +
    + + +
    ' ; + } + echo ' +
    + +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/hr-timetable.php b/hr-timetable.php new file mode 100644 index 0000000..5c6356c --- /dev/null +++ b/hr-timetable.php @@ -0,0 +1,559 @@ +query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'"); +if ($get_department->num_rows > 0) { + while ($row_department = $get_department->fetch_assoc()) { + $department[$row_department['department_id']] = $row_department['department_desc']; + } +} + +$working_group = []; +$get_working_group = $mysqli->query("SELECT * FROM setting_working_group + WHERE deleted_at IS NULL"); +if ($get_working_group->num_rows > 0) { + while ($row_working_group = $get_working_group->fetch_assoc()) { + $working_group[$row_working_group['group_id']] = $row_working_group['group_name']; + } +} + +switch ( $page_mode ) { + case 'user' : + if ( isset($_POST['submit']) && $_POST['submit'] == '1' && count($_POST['staffs']) > 0 && $_POST['timetable'] != '' ) { + $staff_list = []; + + $check_group = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id IN (".implode("," , $_POST['staffs']).") ") ; + + + if ( $check_group->num_rows > 0 ){ + while ( $row = $check_group->fetch_array(MYSQLI_ASSOC) ) { + if ( $row['group_id'] != $_POST['timetable'] ){ + $old_staff_group[$row['staff_id']][0] = true; + $old_staff_group[$row['staff_id']][1] = [ + "old" => $row['group_id'], + "new" => $_POST['group_id'], + ]; + } + } + } + + foreach ( $_POST['staffs'] as $staff ) { + $mysqli->query("UPDATE staff SET + group_id = '".escapeString($_POST['timetable'])."' + WHERE staff_id = '".$staff."'"); + + if ( $old_staff_group[$staff][0] && $old_staff_group[$staff][0] != '' ){ + // log here + } + } + + + header("Refresh: 0") ; + exit ; + } + break ; + case 'dep': + if ( isset($_POST['submit']) && $_POST['submit'] == '1' && $_POST['department'] != '' && $_POST['timetable'] != '' ) { + $department_list = []; + $staff_list = []; + $departments = $mysqli->query("SELECT * FROM staff_department + WHERE deleted_at IS NULL AND department_id = '".escapeString($_POST['department'])."'") ; + if ( $departments->num_rows > 0 ){ + while( $department = $departments->fetch_assoc() ) { + $department_list[] = $department; + $staff_list[$department['staff_id']] = $department['staff_id']; + } + } + + $check_group = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id IN (".implode("," , $staff_list).") ") ; + + if ( $check_group->num_rows > 0 ){ + while ( $row = $check_group->fetch_array(MYSQLI_ASSOC) ) { + if ( $row['group_id'] != $_POST['timetable'] ){ + $old_staff_group[$row['staff_id']][0] = true; + $old_staff_group[$row['staff_id']][1] = [ + "old" => $row['group_id'], + "new" => $_POST['group_id'], + ]; + } + } + } + + foreach ($department_list as $k => $v) { + $mysqli->query("UPDATE staff SET + group_id = '".escapeString($_POST['timetable'])."' + WHERE staff_id = '".escapeString($v['staff_id'])."'"); + if ( $old_staff_group[$staff][0] && $old_staff_group[$staff][0] != '' ){ + // log here + } + } + header("Refresh: 0") ; + exit ; + } + break ; + case 'schedule' : + if ( isset($_POST['submit']) && $_POST['submit'] == '1' && $_POST['staffs'] != '' && $_POST['timetable'] != '' ) { + + $staffs = $_POST['staffs'] ; + $timetable = escapeString($_POST['timetable']) ; + $date_from = escapeString($_POST['date_from']) ; + $date_to = escapeString($_POST['date_to']) ; + $date_to = ( $date_to >= $date_from ? $date_to : $date_from ) ; + $date_to = date( 'Y-m-d', strtotime($date_to . ' + 1 day') ) ; + + $period = new DatePeriod( + new DateTime($date_from), + new DateInterval('P1D'), + new DateTime($date_to) + ) ; + + // get setting working + $get_workings = $mysqli->query("SELECT working_day, group_id, working_on, working_next_day, working_if_flexi, working_if_include_rest, working_if_ot, working_direct_day, working_if_fixed_work, working_day_calculation, working_morning_start as working_period_from, working_morning_end as working_period_to, working_period_before, working_break_start as working_from, working_break_end as working_to, working_break_end_include_ot as working_to_include_ot, working_total_hours, working_total_rest_hours, working_rest_range_from, working_rest_range_to, working_rounding_ot, working_if_ot_morning, working_if_offduty, working_count_offduty, working_if_deduct_offduty, working_max_ot,working_total_rest_hours2,working_rest_range_from2,working_rest_range_to2 FROM setting_working + WHERE deleted_at IS NULL AND group_id = '".$timetable."'") ; + + if ( $get_workings->num_rows > 0 ){ + + $array_working = [] ; + while ( $get_working = $get_workings->fetch_assoc() ){ + $array_working[$get_working['working_day']] = $get_working ; + } + + foreach ( $staffs as $staff_id ){ + foreach ( $period as $key => $value ) { + + $get_date = $value->format('Y-m-d') ; + $working = $array_working[ date('N', strtotime($get_date)) ] ; + + $mysqli->query( "UPDATE staff_attendance_working SET deleted_at = '".TODAYDATE."' + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND working_date = '".$get_date."'" ) ; + + $mysqli->query("INSERT INTO staff_attendance_working + (staff_id, working_group_id, working_date, working_on, working_next_day, working_if_flexi, working_if_include_rest, working_if_ot, working_direct_day, working_if_fixed_work, working_day_calculation, working_period_from, working_period_to, working_period_before, working_from, working_to, working_to_include_ot, working_total_hours, working_total_rest_hours, working_rest_range_from, working_rest_range_to, working_rounding_ot, working_if_ot_morning, working_if_offduty, working_count_offduty, working_if_deduct_offduty, working_max_ot, created_at, updated_at,working_total_rest_hours2,working_rest_range_from2,working_rest_range_to2) VALUES + ('".$staff_id."', '".$working['group_id']."', '".$get_date."', '".$working['working_on']."', '".$working['working_next_day']."', '".$working['working_if_flexi']."', '".$working['working_if_include_rest']."', '".$working['working_if_ot']."', '".$working['working_direct_day']."', '".$working['working_if_fixed_work']."', '".$working['working_day_calculation']."', '".$working['working_period_from']."', '".$working['working_period_to']."', '".$working['working_period_before']."', '".$working['working_from']."', '".$working['working_to']."', '".$working['working_to_include_ot']."', '".$working['working_total_hours']."', '".$working['working_total_rest_hours']."', ".( $working['working_rest_range_from'] != '' ? "'".$working['working_rest_range_from']."'" : "NULL" ).", ".( $working['working_rest_range_to'] != '' ? "'".$working['working_rest_range_to']."'" : "NULL" ).", '".$working['working_rounding_ot']."', '".$working['working_if_ot_morning']."', '".$working['working_if_offduty']."', '".$working['working_count_offduty']."', '".$working['working_if_deduct_offduty']."', '".$working['working_max_ot']."', '".TODAYDATE."', '".TODAYDATE."','".$working['working_total_rest_hours2']."','".$working['working_rest_range_from2']."','".$working['working_rest_range_to2']."')") ; + + + } + } + + } + + header("Refresh: 0") ; + exit ; + } + break ; +} + +include 'requires/page_header.php'; +include 'requires/page_top.php'; + +switch ( $page_mode ) { + + case 'user' : + ?> + + +
    +
    + + +
    +
    +
    +
    +
    + +
    + + + +
    +
    +
    + +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + + +
    +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    + query($mysqli_query." ORDER BY (".$sort_by.' * 1) '.$sort_by_type.", ".$sort_by." ".$sort_by_type." LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // get all related staff + $related_staffs = [] ; + $related_staffid = [] ; + if( $mysqli_page->num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + $related_staffs[] = $row_page ; + $related_staffid[] = $row_page['staff_id'] ; + } + } + + // all selected staff working hours + $group_working = [] ; + $get_workings = $mysqli->query( "SELECT staff_id, working_date, working_group_id FROM staff_attendance_working + WHERE deleted_at IS NULL AND working_date LIKE '%".$date_time."%' AND staff_id IN (".implode(',', $related_staffid).")" ) ; + if( $get_workings->num_rows > 0 ){ + while ( $get_working = $get_workings->fetch_array(MYSQLI_ASSOC) ){ + $group_working[$get_working['staff_id']][$get_working['working_date']] = $get_working['working_group_id'] ; + } + } + ?> + + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    + + + + + +
    +
    +
    + +
    +
    + +
    + + + +
    + +
    +
    + +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + + + + +
    +
    +
    + + + + + + + + + '.$a.'' ; + } + ?> + + + + $row_page ){ + + $id = $row_page['staff_id'] ; + $staff_idno = ucwords($row_page['staff_idno']) ; + + echo ' + + + + ' ; + + for ( $a = 1 ; $a <= $day_of_month ; $a++ ){ + + $new_day = $date_time.'-'.str_pad($a, 2, '0', STR_PAD_LEFT) ; + $group_id = $group_working[$id][$new_day] ; + + echo '' ; + } + + echo ' + ' ; + } + } + ?> + +
    ID
    + + | + + '.$staff_idno.''.dataFilter($row_page['staff_name']).''.$working_group[$group_id].'
    + +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/hr-warning-letter.php b/hr-warning-letter.php new file mode 100644 index 0000000..31e0bac --- /dev/null +++ b/hr-warning-letter.php @@ -0,0 +1,273 @@ + +
    + +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + + + +
    +
    +
    +
    +
    +
    +
    +
    + query("INSERT INTO system_letter (letter_type, letter_date, letter_modified, letter_trash) VALUES ('warning', '".TODAYDATE."', '".TODAYDATE."', '0')"); + $page = $mysqli->insert_id; + } + // check query exsits + $mysqli_page = $mysqli->query("SELECT * FROM system_letter + WHERE letter_id = '".$page."' AND letter_type = 'warning' AND letter_trash = '0' LIMIT 1") ; + if ($mysqli_page->num_rows > 0){ + // update database + if (isset($type) && $type == 'edit' && $_POST['hide'] == 1){ + // keep value in variable + $letter_employment_id = escapeString($_POST['employment']) ; + $letter_title = escapeString($_POST['reason']) ; + $letter_remark = escapeString($_POST['remark']) ; + // update database + $mysqli->query("UPDATE system_letter SET + letter_employment_id = '".$letter_employment_id."', + letter_title = '".$letter_title."', + letter_remark = '".$letter_remark."', + letter_modified = '".TODAYDATE."' + WHERE letter_id = '".$page."'") ; + // refresh page + header("Location:hr-warning-letter.php?page_mode=edit&page=".$page."&success=1") ; + exit ; + } + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + ?> +
    + +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + + + +
    +
    +
    +
    +
    +
    +
    +
    + query($mysqli_query." ORDER BY a.letter_id LIMIT $start_from, " . LIMIT) ; + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query); + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + +
    + +
    + +
    +
    + + + + +
    +
    + +
    +
    +
    + Create Warning Letter + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + // title + $title = dataFilter($row_page['letter_title']) ; + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
    TitleEmploymentDateTrash
    '.$title.''.dataFilter($row_page['employment_name']).''.date('d M Y', strtotime($row_page['letter_date'])).' +
    + + +
    +
    No data.
    + +
    +
    +
    +
    + \ No newline at end of file diff --git a/images/NoProduct.jpg b/images/NoProduct.jpg new file mode 100644 index 0000000..efced5b Binary files /dev/null and b/images/NoProduct.jpg differ diff --git a/images/artwork_advertise_blank.jpg b/images/artwork_advertise_blank.jpg new file mode 100644 index 0000000..d85db58 Binary files /dev/null and b/images/artwork_advertise_blank.jpg differ diff --git a/images/bg.png b/images/bg.png new file mode 100644 index 0000000..58955b6 Binary files /dev/null and b/images/bg.png differ diff --git a/images/bg_border.jpg b/images/bg_border.jpg new file mode 100644 index 0000000..c9a2f87 Binary files /dev/null and b/images/bg_border.jpg differ diff --git a/images/blank.gif b/images/blank.gif new file mode 100644 index 0000000..35d42e8 Binary files /dev/null and b/images/blank.gif differ diff --git a/images/bui.png b/images/bui.png new file mode 100644 index 0000000..f7e927d Binary files /dev/null and b/images/bui.png differ diff --git a/images/cbui.png b/images/cbui.png new file mode 100644 index 0000000..8329085 Binary files /dev/null and b/images/cbui.png differ diff --git a/images/checked.png b/images/checked.png new file mode 100644 index 0000000..812a8f8 Binary files /dev/null and b/images/checked.png differ diff --git a/images/chosen-sprite.png b/images/chosen-sprite.png new file mode 100644 index 0000000..c57da70 Binary files /dev/null and b/images/chosen-sprite.png differ diff --git a/images/chosen-sprite@2x.png b/images/chosen-sprite@2x.png new file mode 100644 index 0000000..6b50545 Binary files /dev/null and b/images/chosen-sprite@2x.png differ diff --git a/images/company/ckm/favicon.ico b/images/company/ckm/favicon.ico new file mode 100644 index 0000000..d22cf28 Binary files /dev/null and b/images/company/ckm/favicon.ico differ diff --git a/images/company/ckm/logo.png b/images/company/ckm/logo.png new file mode 100644 index 0000000..021b135 Binary files /dev/null and b/images/company/ckm/logo.png differ diff --git a/images/company/ckm/logo_full.png b/images/company/ckm/logo_full.png new file mode 100644 index 0000000..179ce10 Binary files /dev/null and b/images/company/ckm/logo_full.png differ diff --git a/images/company/ge/favicon.ico b/images/company/ge/favicon.ico new file mode 100644 index 0000000..7c046d1 Binary files /dev/null and b/images/company/ge/favicon.ico differ diff --git a/images/company/ge/logo.png b/images/company/ge/logo.png new file mode 100644 index 0000000..3bd1962 Binary files /dev/null and b/images/company/ge/logo.png differ diff --git a/images/company/ge/logo_full.png b/images/company/ge/logo_full.png new file mode 100644 index 0000000..7bfde7d Binary files /dev/null and b/images/company/ge/logo_full.png differ diff --git a/images/company/ips/favicon.ico b/images/company/ips/favicon.ico new file mode 100644 index 0000000..69bf880 Binary files /dev/null and b/images/company/ips/favicon.ico differ diff --git a/images/company/ips/logo.png b/images/company/ips/logo.png new file mode 100644 index 0000000..7367e6e Binary files /dev/null and b/images/company/ips/logo.png differ diff --git a/images/company/ips/logo_full.png b/images/company/ips/logo_full.png new file mode 100644 index 0000000..6ba17b5 Binary files /dev/null and b/images/company/ips/logo_full.png differ diff --git a/images/company/kindlemind/changes/hr-attendance-format-2.php b/images/company/kindlemind/changes/hr-attendance-format-2.php new file mode 100644 index 0000000..6eac49b --- /dev/null +++ b/images/company/kindlemind/changes/hr-attendance-format-2.php @@ -0,0 +1,662 @@ +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 ' +
    +
    +
    + + +
    +
    + +
    +
    + +
    + + + + + + + + + + \ No newline at end of file diff --git a/images/company/kindlemind/changes/hr-attendance.php b/images/company/kindlemind/changes/hr-attendance.php new file mode 100644 index 0000000..d51ef14 --- /dev/null +++ b/images/company/kindlemind/changes/hr-attendance.php @@ -0,0 +1,1730 @@ +query("SELECT * FROM system_user WHERE user_id = '".$_SESSION['system_id']."' "); +if ($mysqli_page->num_rows > 0){ + while($row_page=$mysqli_page->fetch_array(MYSQLI_ASSOC)){ + if($row_page['user_date_format'] == NULL){ + $dateformat = "Y-m-d"; + } + else{ + $dateformat = $row_page['user_date_format']; + } + $date01 = str_replace("d","01",$dateformat); + $date31 = str_replace("d","t",$dateformat); + + +// get all branch +$branch = [] ; +$get_branch = $mysqli->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'] ; + } +} + +// mode type | all list | new | edit +switch( $page_mode ){ + case 'record-all': + include 'includes/Record/record-all.php'; + break; + case 'record-edit': + include 'includes/Record/record-edit.php'; + break; + + case 'admend-format-1' : + + /* + $result = 'failed' ; + $data = [] ; + + $staff_id = escapeString($_GET['staff_id']) ; + $check_group = escapeString($_GET['check_group']) ; + + if ( $staff_id != '' && $check_group != '' ){ + + $attendances_q = $mysqli->query("SELECT * FROM staff_attendance + WHERE staff_id = '".$staff_id."'AND check_group = '".$check_group."' AND deleted_at IS NULL + ORDER BY created_at ASC") ; + + if ( $attendances_q->num_rows > 0 ){ + + $result = 'success' ; + + while ( $attendance = $attendances_q->fetch_assoc() ){ + $data[] = [ + 'id' => $attendance['attendance_id'], + 'type' => ucwords($attendance['type']), + 'date' => date('Y-m-d', strtotime($attendance['created_at'])), + 'time' => date('H:i:s', strtotime($attendance['created_at'])) + ] ; + } + + $last_inout = '' ; + $last_date = '' ; + for ( $a = 0 ; $a < 8 ; $a++ ){ + + if ( !empty($data[$a]) ){ + $last_inout = $data[$a]['type'] ; + $last_date = $data[$a]['date'] ; + }else{ + + if ( $last_inout == 'In' ){ + $last_inout = 'Out' ; + }else{ + $last_inout = 'In' ; + } + + $data[$a] = [ + 'id' => 0, + 'type' => $last_inout, + 'date' => $last_date, + 'time' => '' + ] ; + + } + } + + }else{ + + $result = 'success' ; + + $last_inout = '' ; + for ( $a = 0 ; $a < 8 ; $a++ ){ + + if ( $last_inout == 'In' && $last_inout != '' ){ + $last_inout = 'Out' ; + }else{ + $last_inout = 'In' ; + } + + $data[$a] = [ + 'id' => 0, + 'type' => $last_inout, + 'date' => $check_group, + 'time' => '' + ] ; + } + } + + } + + echo json_encode([ + 'result' => $result, + 'data' => $data + ]) ; + exit ; + */ + + break ; + + case 'admend-format-2' : + + $result = 'failed' ; + $data = [] ; + + $staff_id = escapeString($_GET['staff_id']) ; + $check_group = escapeString($_GET['check_group']) ; + + if ( $staff_id != '' && $check_group != '' ){ + + $attendances_q = $mysqli->query("SELECT * FROM staff_attendance + WHERE staff_id = '".$staff_id."'AND created_at LIKE '".$check_group."%' AND deleted_at IS NULL + ORDER BY created_at ASC") ; + + if ( $attendances_q->num_rows > 0 ){ + + $result = 'success' ; + + while ( $attendance = $attendances_q->fetch_assoc() ){ + $data[] = [ + 'id' => $attendance['attendance_id'], + 'date' => date('Y-m-d', strtotime($attendance['created_at'])), + 'time' => date('H:i:s', strtotime($attendance['created_at'])), + 'remark' => dataFilter($attendance['remark']) + ] ; + } + + for ( $a = 0 ; $a < 8 ; $a++ ){ + + if ( !empty($data[$a]) ){ + $last_date = $data[$a]['date'] ; + }else{ + + $data[$a] = [ + 'id' => 0, + 'date' => $last_date, + 'time' => '', + 'remark' => '' + ] ; + + } + } + + }else{ + + $result = 'success' ; + + $last_inout = '' ; + for ( $a = 0 ; $a < 8 ; $a++ ){ + + $data[$a] = [ + 'id' => 0, + 'date' => $check_group, + 'time' => '', + 'remark' => '' + ] ; + } + } + + } + + echo json_encode([ + 'result' => $result, + 'data' => $data + ]) ; + exit ; + + break ; + + case 'list-limit' : + + $path = 'attendances/check' ; + $platform = 'web' ; + $lang = 'en' ; + $branch_id = $row_branch['branch_id'] ; + $staff_id = '' ; + $token = '' ; + $time = time() ; + $sign = hash('sha256', $path.$platform.$lang.$branch_id.$staff_id.$token.$time.APIKEY) ; + $call = call( 'curl', PATH.'api/'.$path.'.php', 'POST', [], [ + 'input_type' => 'selfpunch', + 'qrcode' => $staff_idno, + 'latitude' => '', + 'longitude' => '', + 'platform' => $platform, + 'lang' => $lang, + 'branch_id' => $branch_id, + 'staff_id' => $staff_id, + 'token' => $token, + 'time' => $time, + 'sign' => $sign + ] ) ; + echo json_encode( $call ) ; + exit ; + + break ; + + case 'selfpunch' : + + $status = '300' ; + $message = 'Staff not found.' ; + $alert = '' ; + $data = [] ; + $list = [] ; + + // staff_idno + $staff_idno = escapeString( $_GET['staff_idno'] ) ; + + if ( $staff_idno != '' ){ + + $path = 'attendances/punch' ; + $platform = 'web' ; + $lang = 'en' ; + $branch_id = $row_branch['branch_id'] ; + $staff_id = '' ; + $token = '' ; + $time = time() ; + $sign = hash('sha256', $path.$platform.$lang.$branch_id.$staff_id.$token.$time.APIKEY) ; + $call = call( 'curl', PATH.'api/'.$path.'.php', 'POST', [], [ + 'input_type' => 'selfpunch', + 'qrcode' => $staff_idno, + 'latitude' => '', + 'longitude' => '', + 'platform' => $platform, + 'lang' => $lang, + 'branch_id' => $branch_id, + 'staff_id' => $staff_id, + 'token' => $token, + 'time' => $time, + 'sign' => $sign + ] ) ; + + $status = $call['status'] ; + $message = $call['message'] ; + + if ( $call['status'] == '200' ){ + $alert = 'Scan success ( '.$staff_idno.' ).' ; + } + } + + echo json_encode([ + 'status' => $status, + 'message' => $message, + 'alert' => $alert + ]) ; + exit ; + + break ; + + case 'qrcode-check' : + + $status = '300' ; + $message = 'Code not found.' ; + $data = [] ; + $new_code = '' ; + $alert = '' ; + $boolean = false ; + + $type = $_POST['type'] ; + $qrcode = $_POST['qrcode'] ; + + // if code not found, generate one + if ( $qrcode != '' ){ + + $get_code = $mysqli->query("SELECT staff_id, code, status, created_at FROM qrcodes + WHERE type = '".$type."' AND code = '".$qrcode."' LIMIT 1") ; + + if ( $get_code->num_rows > 0 ){ + + $status = '220' ; + $message = 'Code expired.' ; + + $get = $get_code->fetch_assoc() ; + + $date_code = $get['created_at'] ; + $date_time = TODAYDATE ; + $date_time = date('Y-m-d H:i:s', strtotime($date_time . ' -5 minutes')) ; + + if ( $date_code > $date_time ){ + + $status = '210' ; + $message = 'Code used' ; + + // check code status + if ( $get['status'] == '0' ){ + + $status = '201' ; // Code used before + $message = 'Code can used back.' ; + $generate = $get['code'] ; + $boolean = true ; + + }elseif ( $get['status'] == '1' ){ // 1 mean scan success + + // get staff info + if ( $get['staff_id'] > 0 ){ + $get_staff = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id = '".$get['staff_id']."' LIMIT 1") ; + if ( $get_staff->num_rows > 0 ){ + $staff = $get_staff->fetch_assoc() ; + $alert = 'Scan success ( '.$staff['staff_idno'].' )' ; + } + } + + }elseif ( $get['status'] == '2' ){ // 2 mean scan success, but scan too fast + $alert = 'Accept rescan only after 15 minutes.' ; + } + + } + + } + + } + + $generatecode = generateQrcode( '', $new_code, $new_code ) ; + $new_code = $generatecode['url'] ; + + if ( !$boolean ){ + $mysqli->query("INSERT INTO qrcodes + (type, status, created_at, updated_at) VALUES + ('checkin', '0', '".TODAYDATE."', '".TODAYDATE."')") ; + + // set new code + $last_id = $mysqli->insert_id ; + $new_code = 'PC|'.str_pad($last_id, 6, '0', STR_PAD_LEFT) ; + + $mysqli->query("UPDATE qrcodes SET + code = '".$new_code."' + WHERE qrcode_id = '".$last_id."'") ; + + $status = '200' ; + $message = 'New code generated' ; + } + + $generatecode = generateQrcode( '', $new_code, $new_code ) ; + $new_code = $generatecode['url'] ; + + echo json_encode([ + 'status' => $status, + 'message' => $message, + 'data' => [ + 'alert' => $alert, + 'code' => $new_code + ] + ]) ; + exit ; + + break ; + + + + case 'qrcode' : + + // check permission + if ( !permissionCheck($row_user, 'attendance-list-qrcode') ){ + header('Location: index.php') ; + exit ; + } + + // active page + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-attendance' ; + $active_menu = 'hr-attendance-qrcode' ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + ?> + + + + + + + + + +
    + + +
    +
    +
    + + +
    +
    + +
    + +
     
    + + + + + + $v ){ + $search_department_url .= '&search_department%5B'.$k.'%5D='.$v; + } + } + } + + if ( $search_name != '' ){ + $search_query .= " AND ( b.staff_name LIKE '%".$search_name."%' )" ; + } + if ( $search_idno != '' ){ + $search_query .= " AND ( b.staff_idno LIKE '%".$search_idno."%' )" ; + } + if ( $search_country != '' ){ + if ( $search_country == 'local' ){ + $search_query .= " AND b.country_id = '1'" ; + }else{ + $search_query .= " AND b.country_id != '1'" ; + } + } + if ( $search_branch != '' ){ + $search_query .= " AND b.branch_id = '".$search_branch."'" ; + } + + if ( $date_to != '' || $date_from != '' ){ + if ($date_from != '' && $date_to != ''){ + $search_query .= " AND a.list_date BETWEEN '".$date_from."' and '".$date_to."'" ; + }else if ( $date_from != '' ){ + $search_query .= " AND a.list_date >= '".$date_from."'" ; + }else{ + $search_query .= " AND a.list_date <= '".$date_to."'" ; + } + } + + $mysqli_page = $mysqli->query("SELECT b.staff_id, b.staff_idno, b.staff_name FROM staff_attendance_list a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + ".$search_join." + WHERE b.deleted_at IS NULL AND ( b.staff_date_resigned IS NULL OR b.staff_date_resigned = '0000-00-00' OR b.staff_date_resigned >= '".$date_time."' ) AND a.deleted_at IS NULL AND a.list_date LIKE '%".$date_time."%' ".$search_query.$user_branch_permission_sql_b." + GROUP BY a.staff_id + ORDER BY b.staff_idno") ; + + if ( $export == 'report-month' ){ + include 'hr-attendance-export-by-month.php' ; + } + // if ( $export == 'report-daily' ){ + // include 'hr-attendance-export-by-daily.php' ; + // } + + // active page + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-attendance' ; + $active_menu = 'hr-attendance-report' ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + ?> + + +
    + + +
    +
    +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + + + +
    + +
    + " max=""/> +
    +
    +
    + +
    + " max=""/> +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    + + '.$date_time.'' ; + if ( $date_time >= date('Y-m', time()) ){}else{ + ?> + + +
    + +
    +
    + +
    +
    + + + + + + + + + 'Partime Day', + 'WD' => 'Working Day', + 'AL' => 'Annual Leave', + 'MC' => 'Sick Leave', + 'UL' => 'Unpaid Leave', + 'AS' => 'Absent', + 'HL' => 'Holiday', + 'OD' => 'Off Day' + ] ; + $default_typelist = [] ; + foreach ( $array_typelist as $ktypelist => $vtypelist ){ $default_typelist[$ktypelist] = 0 ; ?> + + + + + + + + + + + num_rows > 0 ){ + + $get_result = 'success' ; + + $new_attendance = array() ; + $staff_ids = array() ; + while ( $attendance = $mysqli_page->fetch_assoc() ){ + $temp_attendance = [ + 'staff_id' => $attendance['staff_id'], + 'idno' => $attendance['staff_idno'], + 'name' => $attendance['staff_name'] + ] ; + + $new_attendance[$attendance['staff_id']] = $temp_attendance ; + $staff_ids[] = $attendance['staff_id'] ; + } + + + + + // get working day + $list_workday = [] ; + $select_attendancelist = $mysqli->query("SELECT staff_id, list_type_remark, COUNT( list_type_remark ) as count_list_type_remark, SUM( list_work_day ) as sum_list_work_day, SUM( list_leave_day ) as sum_list_leave_day FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) + GROUP BY staff_id, list_type_remark") ; + + if ( $select_attendancelist->num_rows > 0 ){ + while ( $row_attendancelist = $select_attendancelist->fetch_assoc() ){ + $list_workday[$row_attendancelist['staff_id']][$row_attendancelist['list_type_remark']] = $row_attendancelist ; + } + } + + + // get staff leave + $list_leave = [] ; + $select_leavelist = $mysqli->query("SELECT staff_id, leave_type, leave_record_days FROM staff_leave_year + WHERE deleted_at IS NULL AND leave_year LIKE '".date( 'Y', strtotime( $date_time.'-01' ) )."%' AND staff_id IN ( ".implode(',', $staff_ids)." )") ; + if ( $select_leavelist->num_rows > 0 ){ + while ( $row_leavelist = $select_leavelist->fetch_assoc() ){ + $list_leave[$row_leavelist['staff_id']][$row_leavelist['leave_type']] = $row_leavelist ; + } + } + + // get staff given leave + $list_leave_given = [] ; + $select_leavegivenlist = $mysqli->query("SELECT staff_id, SUM(given_day) as total_given_day FROM staff_leave_month + WHERE deleted_at IS NULL AND given_date BETWEEN '".$year_of_day."' AND '".$month_of_day."' AND staff_id IN ( ".implode(',', $staff_ids)." ) + GROUP BY staff_id ") ; + if ( $select_leavegivenlist->num_rows > 0 ){ + while ( $row_leavegivenlist = $select_leavegivenlist->fetch_assoc() ){ + $list_leave_given[$row_leavegivenlist['staff_id']] = $row_leavegivenlist['total_given_day'] ; + } + } + + // get staff total use leave + $list_leave_used = [] ; + $select_leave_usedlist = $mysqli->query("SELECT staff_id, list_type_remark, SUM( list_leave_day ) as sum_list_leave_day FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date BETWEEN '".$year_of_day."' AND '".$month_of_last."' AND list_type_remark IN ( 'AL', 'MC' ) AND staff_id IN ( ".implode(',', $staff_ids)." ) + GROUP BY staff_id, list_type_remark") ; + + if ( $select_leave_usedlist->num_rows > 0 ){ + while ( $row_leave_usedlist = $select_leave_usedlist->fetch_assoc() ){ + $list_leave_used[$row_leave_usedlist['staff_id']][$row_leave_usedlist['list_type_remark']] = $row_leave_usedlist['sum_list_leave_day'] ; + } + } + + + + // get late + $list_late = [] ; + $select_latelist = $mysqli->query("SELECT staff_id, count( list_late ) as count_list_late, SEC_TO_TIME(sum(TIME_TO_SEC(list_late))) as sum_list_late FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_late != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_latelist->num_rows > 0 ){ + while ( $row_late = $select_latelist->fetch_assoc() ){ + $list_late[$row_late['staff_id']] = [ + 'count' => $row_late['count_list_late'], + 'sum' => $row_late['sum_list_late'] + ] ; + } + } + + + // get early out + $list_earlyout = [] ; + $select_earlyoutlist = $mysqli->query("SELECT staff_id, count( list_early_out ) as count_list_early_out, SEC_TO_TIME(sum(TIME_TO_SEC(list_early_out))) as sum_list_early_out FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_early_out != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_earlyoutlist->num_rows > 0 ){ + while ( $row_earlyoutlist = $select_earlyoutlist->fetch_assoc() ){ + $list_earlyout[$row_earlyoutlist['staff_id']] = [ + 'count' => $row_earlyoutlist['count_list_early_out'], + 'sum' => $row_earlyoutlist['sum_list_early_out'] + ] ; + } + } + + + // get ot + $list_ot = [] ; + $select_otlist = $mysqli->query("SELECT staff_id, count( list_ot_normal ) as count_list_ot_normal, SEC_TO_TIME(sum(TIME_TO_SEC(list_ot_normal))) as sum_list_ot_normal FROM staff_attendance_list + WHERE deleted_at IS NULL AND list_date LIKE '".$date_time."%' AND staff_id IN ( ".implode(',', $staff_ids)." ) AND list_ot_normal != '00:00:00' + GROUP BY staff_id") ; + + if ( $select_otlist->num_rows > 0 ){ + while ( $row_otlist = $select_otlist->fetch_assoc() ){ + $list_ot[$row_otlist['staff_id']] = [ + 'count' => $row_otlist['count_list_ot_normal'], + 'sum' => $row_otlist['sum_list_ot_normal'] + ] ; + } + } + + + // render table + foreach ( $new_attendance as $key => $value ){ + echo ' + + + + ' ; + + $array_tablelist = [] ; + $total_workday = 0 ; + $total_realwork = 0 ; + + $get_late = checkExists( $list_late[$value['staff_id']]['count'] ) ; + $get_sum_late = checkExists( $list_late[$value['staff_id']]['sum'] ) ; + $get_earlyout = checkExists( $list_earlyout[$value['staff_id']]['count'] ) ; + $get_sum_earlyout = checkExists( $list_earlyout[$value['staff_id']]['sum'] ) ; + $get_ot = checkExists( $list_ot[$value['staff_id']]['count'] ) ; + $get_sum_ot = checkExists( $list_ot[$value['staff_id']]['sum'] ) ; + + $get_leave = $list_leave[$value['staff_id']] ; + $get_leave_annual = $get_leave['annual'] ; + $get_leave_sick = $get_leave['sick'] ; + + $get_leave_used = $list_leave_used[$value['staff_id']] ; + $get_leave_annual_used = $get_leave_used['AL'] ; + $get_leave_sick_used = $get_leave_used['MC'] ; + + $get_leave_annual_given = $list_leave_given[$value['staff_id']] ; + + foreach ( $array_typelist as $ktypelist => $vtypelist ){ + $get_workday = checkExists( $list_workday[$value['staff_id']][$ktypelist] ) ; + $days = 0 ; + $total_realwork += $get_workday['sum_list_work_day'] ; + + switch ( $ktypelist ){ + case 'WD' : + case 'PT' : + case 'AL' : + case 'MC' : + case 'UL' : + case 'AS' : + $total_workday += $get_workday['count_list_type_remark'] ; + break ; + } + + + + + switch ( $ktypelist ){ + case 'WD' : + case 'PT' : + $days = $get_workday['sum_list_work_day'] ; + break ; + case 'AL' : + case 'MC' : + case 'UL' : + $days = $get_workday['sum_list_leave_day'] ; + break ; + case 'AS' : + case 'HL' : + case 'OD' : + $days = $get_workday['count_list_type_remark'] ; + break ; + } + + + + + if ( $ktypelist != 'WD' && $ktypelist != 'PT' && $ktypelist != 'HL' && $ktypelist != 'OD' ){ + + $temp_typelist = '' ; + $days = ( $days + 0 ) ; + + switch ( $ktypelist ){ + case 'AL' : + $temp_typelist = '' ; + break ; + case 'MC' : + $temp_typelist = '' ; + break ; + case 'UL' : + $temp_typelist = '' ; + break ; + default : + $temp_typelist = '' ; + } + + $array_tablelist[] = $temp_typelist ; + } + } + + echo '' ; + echo implode( '', $array_tablelist ) ; + + echo '' ; + echo '' ; + echo '' ; + + echo ' + ' ; + } + + } + ?> + +
    IDLateEarly OutOT
    + + '.$value['idno'].''.ucwords($value['name']).'' ; + if ( $get_leave_annual['leave_record_days'] > 0 ){ + $temp_typelist .= ( $days > 0 ? ''.$days.'' : '-' ) .' / '.( $get_leave_annual_given - $get_leave_annual_used + 0 ) .' / '.( $get_leave_annual['leave_record_days'] + 0 ) . ' ( '.( $get_leave_annual_given + 0 ).' )' ; + } + $temp_typelist .= ''. ( $days > 0 ? ''.$days.'' : '-' ) .' / '.( $get_leave_sick['leave_record_days'] - $get_leave_sick_used + 0 ) .' / '.( $get_leave_sick['leave_record_days'] + 0 ).''. ( $days > 0 ? ''.$days.'' : '' ) .''. ( $days > 0 ? $days : 0 ) .'' . $total_realwork . ' / ' . $total_workday . ''.( $get_late > 0 ? $get_late . ' ( ' . $get_sum_late . ' )' : '' ).''.( $get_earlyout > 0 ? $get_earlyout . ' ( ' . $get_sum_earlyout . ' )' : '' ).''.( $get_ot > 0 ? $get_ot . ' ( ' . $get_sum_ot . ' )' : '' ).'
    + +
    +
    + +
    +
    + +
    + + query("SELECT * FROM staff_attendance_list a + WHERE a.staff_id = '".$staff_id."' AND a.list_date LIKE '%".$date_time."%' AND a.deleted_at IS NULL ORDER BY a.list_date ASC") ; + + // get staff information + $staff = $mysqli->query("SELECT staff_idno, staff_name FROM staff + WHERE staff_id = '".$staff_id."' LIMIT 1") ; + $staff_name = '' ; + $staff_idno = '' ; + if ( $staff->num_rows > 0 ){ + $row_staff = $staff->fetch_assoc() ; + $staff_name = $row_staff['staff_name'] ; + $staff_idno = $row_staff['staff_idno'] ; + } + + // get all attendance time + $attendances = $mysqli->query("SELECT list_id, created_at FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND check_group LIKE '%".$date_time."%' ORDER BY created_at ASC") ; + $attendances_list = [] ; + if ( $attendances->num_rows > 0 ){ + while ( $row = $attendances->fetch_assoc() ){ + $attendances_list[$row['list_id']][] = $row ; + } + } + + // active page + $active_main_menu = 'hr' ; + $active_sub_menu = 'hr-attendance' ; + $active_menu = 'hr-attendance-report' ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + ?> + + +
    + + +
    +
    + ID :
    + : +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $value = $mysqli_page->fetch_assoc() ){ + + $date = date('w', strtotime($value['list_date'])) ; + $date = $date_array[$date] ; + + $attendances_date = $attendances_list[$value['list_id']] ; + + $bg_color = '' ; + + switch ( $value['list_type_remark'] ){ + case 'WD' : $bg_color = '' ; break ; + case 'AL' : $bg_color = '#ffccf0' ; break ; + case 'UL' : $bg_color = '#fff6cc' ; break ; + case 'MC' : $bg_color = '#ffd9cc' ; break ; + case 'AS' : $bg_color = '#ffcccc' ; break ; + case 'HL' : $bg_color = '#ccfffd' ; break ; + case 'OD' : $bg_color = '#daccff' ; break ; + case 'PT' : $bg_color = '#ffd5d1' ; break ; + } + + echo ' + + + + ' ; + + for ( $a = 0 ; $a < 8 ; $a++ ){ + $current_time = $attendances_date[$a]['created_at'] ; + $current_time = ( $current_time != '' ? date('H:i:s', strtotime($current_time)) : '' ) ; + echo ' + ' ; + } + if ( EXCELDETAIL == "YES" ){ + echo ' + + '; + } + + + echo ' + + + + + + + + + + + ' ; + } + } + ?> + +
    DateDayWork dayWork DayT DayWorkRest 1Rest Timeout 1Rest 2Rest Timeout 2EarlyLateEarly OutOTRemark
    '. $value['list_date'] .''. $lang[$date] .''.( $value['list_work_day'] > 0 ? ''.$value['list_work_day'].'' : $value['list_work_day'] ).' +
    '. $current_time .'
    +
    '. ( $value['list_work_day'] != '0.00' ? $value['list_work_day'] : '' ) .''. ( $value['list_ot_day'] != '0.00' ? $value['list_ot_day'] : '' ) .''. ( $value['list_work'] != '00:00:00' ? $value['list_work'] : '' ) .' + '. ( $value['list_rest'] != '00:00:00' ? $value['list_rest'] : '' ) .' + '. ( $value['list_time_off'] != '00:00:00' ? '( '.$value['list_time_off'].' )' : '' ) .' + '. ( $value['list_rest_more'] != '00:00:00' ? $value['list_rest_more'] : '' ) .' + '. ( $value['list_rest2'] != '00:00:00' ? $value['list_rest2'] : '' ) .' + '. ( $value['list_time_off2'] != '00:00:00' ? '( '.$value['list_time_off2'].' )' : '' ) .' + '. ( $value['list_rest_more2'] != '00:00:00' ? $value['list_rest_more2'] : '' ) .''. ( $value['list_early'] != '00:00:00' ? $value['list_early'] : '' ) .''. ( $value['list_late'] != '00:00:00' ? $value['list_late'] : '' ) .''. ( $value['list_early_out'] != '00:00:00' ? $value['list_early_out'] : '' ) .''. ( $value['list_ot_normal'] != '00:00:00' ? $value['list_ot_normal'] : '' ) .''. $value['list_remark'] .'
    + +
    +
    + +
    +
    + +
    + + $value) { + if ( $value != '' ){ + $required_reprocess[$key] = $value ; + } + } + + if(arrayCheck($required_reprocess)){ + foreach ($required_reprocess as $key => $value) { + $u_saw = "UPDATE staff_attendance_working SET deleted_at = '".TODAYDATE."' WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND working_date = '".$key."' " ; + $mysqli->query($u_saw) ; + + // get staff working hours + $working_q2 = $mysqli->query("SELECT group_id, working_on, working_next_day, working_if_flexi, working_if_include_rest, working_if_ot, working_direct_day, working_if_fixed_work, working_day_calculation, working_morning_start as working_period_from, working_morning_end as working_period_to, working_period_before, working_break_start as working_from, working_break_end as working_to, working_total_hours, working_total_rest_hours, working_rest_range_from, working_rest_range_to, working_rounding_ot, working_if_ot_morning, working_if_offduty, working_count_offduty, working_if_deduct_offduty, working_max_ot,working_total_rest_hours2,working_rest_range_from2,working_rest_range_to2 FROM setting_working + WHERE deleted_at IS NULL AND group_id = '".$value."' AND working_day = '".date('N', strtotime($key))."' LIMIT 1") ; + + // check if working setting got set + if ( $working_q2->num_rows > 0 ){ + $working = $working_q2->fetch_assoc() ; + $mysqli->query("INSERT INTO staff_attendance_working + (staff_id, working_group_id, working_date, working_on, working_next_day, working_if_flexi, working_if_include_rest, working_if_ot, working_direct_day, working_if_fixed_work, working_day_calculation, working_period_from, working_period_to, working_period_before, working_from, working_to, working_total_hours, working_total_rest_hours, working_rest_range_from, working_rest_range_to, working_rounding_ot, working_if_ot_morning, working_if_offduty, working_count_offduty, working_if_deduct_offduty, working_max_ot, created_at, updated_at, working_total_rest_hours2, working_rest_range_from2, working_rest_range_to2) VALUES + ('".$staff_id."', '".$working['group_id']."', '".$key."', '".$working['working_on']."', '".$working['working_next_day']."', '".$working['working_if_flexi']."', '".$working['working_if_include_rest']."', '".$working['working_if_ot']."', '".$working['working_direct_day']."', '".$working['working_if_fixed_work']."', '".$working['working_day_calculation']."', '".$working['working_period_from']."', '".$working['working_period_to']."', '".$working['working_period_before']."', '".$working['working_from']."', '".$working['working_to']."', '".$working['working_total_hours']."', '".$working['working_total_rest_hours']."', ".( $working['working_rest_range_from'] != '' ? "'".$working['working_rest_range_from']."'" : "NULL" ).", ".( $working['working_rest_range_to'] != '' ? "'".$working['working_rest_range_to']."'" : "NULL" ).", '".$working['working_rounding_ot']."', '".$working['working_if_ot_morning']."', '".$working['working_if_offduty']."', '".$working['working_count_offduty']."', '".$working['working_if_deduct_offduty']."', '".$working['working_max_ot']."', '".TODAYDATE."', '".TODAYDATE."','".$working['working_total_rest_hours2']."','".$working['working_rest_range_from2']."','".$working['working_rest_range_to2']."')") ; + + } + + } + } + } + header('Location: hr-attendance.php?page_mode=reprocessing-list&date_time='.$date_time.'&staff_id='.$staff_id.'&a=1') ; + exit ; + } + + $mysqli_page = $mysqli->query("SELECT * FROM staff_attendance_list a + WHERE a.staff_id = '".$staff_id."' AND a.list_date LIKE '%".$date_time."%' AND a.deleted_at IS NULL ORDER BY a.list_date ASC") ; + + // get staff information + $staff = $mysqli->query("SELECT staff_idno, staff_name FROM staff + WHERE staff_id = '".$staff_id."' LIMIT 1") ; + $staff_name = '' ; + $staff_idno = '' ; + if ( $staff->num_rows > 0 ){ + $row_staff = $staff->fetch_assoc() ; + $staff_name = $row_staff['staff_name'] ; + $staff_idno = $row_staff['staff_idno'] ; + } + + // get all attendance time + $attendances = $mysqli->query("SELECT staff_id, list_id, created_at FROM staff_attendance + WHERE deleted_at IS NULL AND staff_id = '".$staff_id."' AND check_group LIKE '%".$date_time."%' ORDER BY created_at ASC") ; + $attendances_list = [] ; + if ( $attendances->num_rows > 0 ){ + while ( $row = $attendances->fetch_assoc() ){ + $attendances_list[$row['list_id']][] = $row ; + } + } + + // 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' ; + ?> + + +
    + + '.$_SESSION['system_result'].'
    ' ; + }else{ + echo '
    '.$_SESSION['system_result'].'
    ' ; + } + unset($_SESSION['system_result']) ; + } + ?> +
    +
    + ID :
    + : +
    +
    + +
    +
    + +
    + +
    + + + +
    + +
    + +
    +
    + +
    +
    +
    + + + + + + + + + + + + query($mysqli_work); + if ($mwk->num_rows > 0){ + while ($rmwk = $mwk->fetch_array(MYSQLI_ASSOC)){ + $arr_work[] = $rmwk; + } + } + + $attendances = [] ; + if ( $mysqli_page->num_rows > 0 ){ + while ( $value = $mysqli_page->fetch_assoc() ){ + $attendances[$value['list_date']] = $value ; + } + } + + for ( $loop = 1 ; $loop <= $last_day ; $loop++ ){ + + $select_date = $date_time.'-'.strPad(2, $loop) ; + $select_day_w = date('w', strtotime($select_date)) ; + $select_day_w = $date_array[$select_day_w] ; + + $value = $attendances[$select_date] ; + $attendances_date = $attendances_list[$value['list_id']] ; + + echo ' + + + + + + + + + ' ; + } + ?> + +
    '. $select_date .''. $lang[$select_day_w] .'' ; + + for ( $a = 0 ; $a < 8 ; $a++ ){ + $current_time = $attendances_date[$a]['created_at'] ; + $current_time = ( $current_time != '' ? date('H:i:s', strtotime($current_time)) : '' ) ; + echo '
    '. $current_time .'
    ' ; + } + + echo ' +
    + +
    + + +
    +
    +
    + +
    +
    + +
    + + \ No newline at end of file diff --git a/images/company/kindlemind/changes/hr-staff.php b/images/company/kindlemind/changes/hr-staff.php new file mode 100644 index 0000000..31f9427 --- /dev/null +++ b/images/company/kindlemind/changes/hr-staff.php @@ -0,0 +1,2948 @@ +query("SELECT * FROM setting_salary_tax WHERE deleted_at IS NULL"); +while($row_tax = mysqli_fetch_assoc($get_salary_tax)){ + if($row_tax['tax_type'] == 'EPF'){ + $epf_rate[$row_tax['tax_id']] = [ + 'title' => $row_tax['tax_title'], + 'employee_rate' => $row_tax['employee_rate'], + 'employer_rate' => $row_tax['employer_rate'], + ]; + }else if($row_tax['tax_type'] == 'SOCSO'){ + $socso_rate[$row_tax['tax_id']] = [ + 'title' => $row_tax['tax_title'], + 'employee_rate' => $row_tax['employee_rate'], + 'employer_rate' => $row_tax['employer_rate'], + ]; + }else if($row_tax['tax_type'] == 'EIS'){ + $eis_rate[$row_tax['tax_id']] = [ + 'title' => $row_tax['tax_title'], + 'employee_rate' => $row_tax['employee_rate'], + 'employer_rate' => $row_tax['employer_rate'], + ]; + }else if($row_tax['tax_type'] == 'ZAKAT'){ + $zakat_rate[$row_tax['tax_id']] = [ + 'title' => $row_tax['tax_title'], + 'employee_rate' => $row_tax['employee_rate'], + 'employer_rate' => $row_tax['employer_rate'], + ]; + } +} + +// get all gender +$gender = [] ; +$get_gender = $mysqli->query("SELECT * FROM master_gender + WHERE deleted_at IS NULL") ; +if ( $get_gender->num_rows > 0 ){ + while ( $row_gender = $get_gender->fetch_assoc() ){ + $gender[$row_gender['gender_id']] = $row_gender['gender_desc'] ; + } +} + +// get all position +$position = [] ; +$get_position = $mysqli->query("SELECT a.job_position_id, a.job_position_code, b.job_position_desc FROM setting_job_position a + LEFT JOIN setting_job_position_translation b ON ( a.job_position_id = b.job_position_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; +if ( $get_position->num_rows > 0 ){ + while ( $row_position = $get_position->fetch_assoc() ){ + $position[$row_position['job_position_id']] = $row_position['job_position_code'] . ' ( ' . $row_position['job_position_desc'] . ' )' ; + } +} + +// get all section +$section = [] ; +$get_section = $mysqli->query("SELECT a.job_section_id, a.job_section_code, b.job_section_desc FROM setting_job_section a + LEFT JOIN setting_job_section_translation b ON ( a.job_section_id = b.job_section_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; +if ( $get_section->num_rows > 0 ){ + while ( $row_section = $get_section->fetch_assoc() ){ + $section[$row_section['job_section_id']] = $row_section['job_section_code'] . ' ( ' . $row_section['job_section_desc'] . ' )' ; + } +} + +// get all job status +$job_status = [] ; +$get_job_status = $mysqli->query("SELECT * FROM master_job_status + WHERE deleted_at IS NULL") ; +if ( $get_job_status->num_rows > 0 ){ + while ( $row_job_status = $get_job_status->fetch_assoc() ){ + $job_status[$row_job_status['job_status_id']] = $row_job_status['job_status_desc'] ; + } +} + +// get all country +$country = [] ; +$get_country = $mysqli->query("SELECT * FROM master_country + WHERE deleted_at IS NULL") ; +if ( $get_country->num_rows > 0 ){ + while ( $row_country = $get_country->fetch_assoc() ){ + $country[$row_country['country_id']] = $row_country['country_desc'] ; + } +} + +// get all working group +$working_group = [] ; +$get_working_group = $mysqli->query("SELECT * FROM setting_working_group + WHERE deleted_at IS NULL") ; +if ( $get_working_group->num_rows > 0 ){ + while ( $row_working_group = $get_working_group->fetch_assoc() ){ + $working_group[$row_working_group['group_id']] = $row_working_group['group_name'] ; + } +} + +// get all branch +$branch = [] ; +$get_branch = $mysqli->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'] ; + } +} + +// get all requires +$get_user_tier = userTierQuery( $row_user ) ; + +$tier_list = [] ; +$tier_list_id = [] ; +$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 DESC") ; +if ( $mysqli_tier->num_rows > 0 ){ + while ( $row_tier = $mysqli_tier->fetch_assoc() ){ + $tier_list[] = $row_tier ; + $tier_list_id[$row_tier['tier_id']] = $row_tier['title'] ; + } +} + +// get all requires +$department_list = [] ; +$mysqli_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' ORDER BY b.department_desc ASC") ; +if ( $mysqli_department->num_rows > 0 ){ + while ( $row_department = $mysqli_department->fetch_assoc() ){ + $department_list[] = $row_department ; + } +} + +// mode type | all list | new | edit +switch($page_mode){ + + case 'staff-point-history' : + include 'hr-staff-point-history.php'; + break; + + // edit staff + case 'new' : + case 'edit' : + $active_menu = 'hr-staff-list' ; + + // add permission + $search_query = '' ; + // if ( $_SESSION['system_permission'] != 'admin' ){ + // if ( permissionCheck($row_user, 'staff-list-view') && permissionCheck($row_user, 'foreign-only') ){ + // // do nothing + // }elseif ( permissionCheck($row_user, 'staff-list-view') ){ + // $search_query .= " AND country_id = '1'" ; + // }else{ + // $search_query .= " AND country_id != '1'" ; + // } + // } + + // check query exsits + $submit_type = 'new' ; + $mysqli_page = $mysqli->query("SELECT * FROM staff + WHERE staff_id = '".$page."' ".$search_query." LIMIT 1"); + + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + }else{ + $page = '' ; + } + + // trash passport / permit + if ( $_GET['staff_image'] == 'yes' && $_GET['staff_image_id'] != '' ){ + + $error_message = '
    '.$lang['Sorry image not found'].'
    ' ; + + $staff_image_id = escapeString($_GET['staff_image_id']) ; + $get_staff_image = $mysqli->query("SELECT * FROM staff_image + WHERE image_id = '".$staff_image_id."' LIMIT 1") ; + if ( $get_staff_image->num_rows > 0 ){ + $mysqli->query("UPDATE staff_image SET + deleted_at = '".TODAYDATE."' + WHERE image_id = '".$staff_image_id."'") ; + $error_message = '
    '.$lang['Thank you image was removed'].'
    ' ; + } + + // refresh page + header("Location:hr-staff.php?page_mode=edit&page=".$page) ; + $_SESSION['system_result'] = $error_message ; + exit ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + $error_message = '
    '.$lang['Please enter all required fill'].'
    ' ; + $message = ''; + + $staff_idno = escapeString($_POST['staff_idno']) ; + $staff_name = escapeString($_POST['staff_name']) ; + $staff_shortname = escapeString($_POST['staff_shortname']) ; + $staff_mobileno = escapeString($_POST['staff_mobileno']) ; + $staff_birthdate = escapeString($_POST['staff_birthdate']) ; + $staff_date_joined = escapeString($_POST['staff_date_joined']) ; + $staff_tier = escapeString($_POST['staff_tier']) ; + $staff_probation_end = escapeString($_POST['staff_probation_end']) ; + $staff_effective_date = escapeString($_POST['staff_effective_date']) ; + $staff_salary_nextreview_date = escapeString($_POST['staff_salary_nextreview_date']) ; + $staff_salary_effective_date = escapeString($_POST['staff_salary_effective_date']) ; + $staff_username = escapeString($_POST['staff_username']) ; + $staff_email = escapeString($_POST['staff_email']) ; + $password = escapeString($_POST['password']) ; + $passwordnotmatch = escapeString($_POST['passwordnotmatch']) ; + $staff_covid = escapeString($_POST['staff_covid']) ; + $staff_covid_test = escapeString($_POST['staff_covid_test']) ; + $staff_fonema = escapeString($_POST['staff_fonema']) ; + $staff_typhoid = escapeString($_POST['staff_typhoid']) ; + $staff_fenoma_period = escapeString($_POST['staff_fenoma_period']) ; + $country_id = $_POST['country_id'] ; + $staff_icno = escapeString($_POST['staff_icno']) ; + $staff_passportno = escapeString($_POST['staff_passportno']) ; + $staff_passportexpired = escapeString($_POST['staff_passportexpired']) ; + + + $old_staff_group[0] = false; + + + + // if ( $staff_idno != '' && $staff_name != '' && $staff_shortname != '' && $staff_username != '' && $staff_mobileno != '' && $staff_birthdate != '' && $staff_tier != '' && $staff_date_joined != '' ){ + + //if( ($country_id == '1' && $staff_icno != '') || ( $country_id != '' && $staff_passportno != '' && $staff_passportexpired != '') ){ + + // check if email not exists + if ( $staff_email != '' ){ + $check_email = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id != '".$page."' AND staff_email = '".$staff_email."' LIMIT 1") ; + if ( $check_email->num_rows > 0 ){ + $error_message .= '
    '.$lang['Sorry email already exists'].'
    ' ; + } + } + + // check if username not exists + if ( $staff_username != '' ){ + $check_username = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id != '".$page."' AND staff_username = '".$staff_username."' LIMIT 1") ; + if ( $check_username->num_rows > 0 ){ + $error_message .= '
    '.$lang['Sorry username already exists'].'
    ' ; + } + } + + // check if staff idno not exists + if ( $staff_idno != '' ){ + $check_idno = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id != '".$page."' AND staff_idno = '".$staff_idno."' LIMIT 1") ; + if ( $check_idno->num_rows > 0 ){ + $error_message .= '
    '.$lang['Sorry idno already exists'].'
    ' ; + } + } + + $check_group = $mysqli->query("SELECT * FROM staff + WHERE deleted_at IS NULL AND staff_id = '".$page."' LIMIT 1") ; + if ( $check_group->num_rows > 0 ){ + $row = $check_group->fetch_array(MYSQLI_ASSOC); + if ( $row['group_id'] != $_POST['group_id'] ){ + $old_staff_group[0] = true; + $old_staff_group[1] = [ + "old" => $row['group_id'], + "new" => $_POST['group_id'], + ]; + } + + } + + + + // if ( $password != '' && $password != $passwordnotmatch ){ + // $error_message .= '
    '.$lang['Sorry password doesnt exists'].'
    ' ; + // } + + // save staff data + if ( $error_message != '' ){ + + $error = 0 ; + $mysqli->autocommit( false ) ; + + $update_query = '' ; + + try { + + + // new staff + if ( $page == '' ){ + $mysqli->query("INSERT INTO staff (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // password + if ( $password != '' ){ + $staff_password = passwordEncrypt($password) ; + $update_query .= "staff_password = '".$staff_password."'," ; + } + + // staff settings + $staff_settings = [ + 'ismanager' => ( $_POST['staff_setting_ismanager'] == 'yes' ? 'yes' : 'no' ), + 'ishrmanager' => ( $_POST['staff_setting_ishrmanager'] == 'yes' ? 'yes' : 'no' ), + 'warning' => ( $_POST['staff_setting_warning'] == 'yes' ? 'yes' : 'no' ), + 'switchbranch' => ( $_POST['staff_setting_switchbranch_card'] == 'yes' ? 'yes' : 'no' ), + 'reporttaskbranch' => ( $_POST['staff_setting_reporttaskbranch_card'] == 'yes' ? 'yes' : 'no' ), + 'reportadjustmentbranch' => ( $_POST['staff_setting_reportadjustmentbranch_card'] == 'yes' ? 'yes' : 'no' ), + 'punch' => ( $_POST['staff_setting_punch_card'] == 'yes' ? 'yes' : 'no' ), + 'without_geometry' => ( $_POST['staff_setting_without_geometry'] == 'yes' ? 'yes' : 'no' ), + 'checkrecruitment' => ( $_POST['staff_setting_checkrecruitment'] == 'yes' ? 'yes' : 'no' ), + 'checkassociation' => ( $_POST['staff_setting_checkassociation'] == 'yes' ? 'yes' : 'no' ), + 'checktraining' => ( $_POST['staff_setting_checktraining'] == 'yes' ? 'yes' : 'no' ), + 'approvevisitation' => ( $_POST['staff_setting_approvevisitation'] == 'yes' ? 'yes' : 'no' ), + 'checkvisitation' => ( $_POST['staff_setting_checkvisitation'] == 'yes' ? 'yes' : 'no' ), + 'vcard_mode' => ( $_POST['staff_setting_vcard_mode'] == '1' ? '1' : ( $_POST['staff_setting_vcard_mode'] == '2' ? '2' : '3' ) ), + 'marital_status' => escapeString($_POST['marital_status']), + 'mailing_address' => escapeString($_POST['mailing_address']), + 'income_tax_no' => escapeString($_POST['income_tax_no']), + 'spouse_name' => escapeString($_POST['spouse_name']), + 'spouse_ic' => escapeString($_POST['spouse_ic']), + 'spouse_working' => escapeString($_POST['spouse_working']), + 'spouse_income_tax' => escapeString($_POST['spouse_income_tax']), + 'no_children' => escapeString($_POST['no_children']), + ] ; + $staff_settings = json_encode($staff_settings) ; + + // resize image + // set image in variable + $image = $_FILES["staff_image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "staff_image = ''," ; + } + $create_image = reCreateImage('Staff', $page, $page, '', $image, $_FILES["staff_image"]["type"], $_FILES['staff_image']['tmp_name']) ; + + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $image_query = "staff_image = '".$create_image['image']."'," ; + } + + //Array ( [name] => Array ( [0] => addon-apk.pdf ) [type] => Array ( [0] => application/pdf ) [tmp_name] => Array ( [0] => /tmp/phpy5FLEr ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 314338 ) ) + + // passport image + $passportimages = $_FILES['passportimages'] ; + if ( arrayCheck($passportimages['name']) ){ + foreach ( $passportimages['name'] as $k => $v ){ + + $image = $v ; + if ( $_FILES['passportimages']['type'][$k] == 'application/pdf' ){ + $new_image = 'ppd-'.$k.'-'.rand(000000, 999999).'-'.time().'.pdf' ; + copy( $_FILES['passportimages']['tmp_name'][$k], 'uploads/StaffImage/'.$new_image ) ; + $mysqli->query("INSERT INTO staff_image + (staff_id, type, file_name, created_at, updated_at) VALUES + ('".$page."', 'passport', '".$new_image."', '".TODAYDATE."', '".TODAYDATE."')") ; + }else{ + $create_image = reCreateImage('StaffImage', $page, 'ppi-'.$k.'-'.rand(000000, 999999).'-'.time(), '', $image, $_FILES['passportimages']["type"][$k], $_FILES['passportimages']['tmp_name'][$k]) ; + + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $mysqli->query("INSERT INTO staff_image + (staff_id, type, file_name, created_at, updated_at) VALUES + ('".$page."', 'passport', '".$create_image['image']."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + } + } + } + + // permit image + $permitimages = $_FILES['permitimages'] ; + if ( arrayCheck($permitimages['name']) ){ + foreach ( $permitimages['name'] as $k => $v ){ + $image = $v ; + if ( $_FILES['permitimages']['type'][$k] == 'application/pdf' ){ + $permit_pdf = 'pd-'.$k.'-'.rand(000000, 999999).'-'.time().'.pdf' ; + copy( $_FILES['permitimages']['tmp_name'][$k], 'uploads/StaffImage/'.$permit_pdf ) ; + $mysqli->query("INSERT INTO staff_image + (staff_id, type, file_name, created_at, updated_at) VALUES + ('".$page."', 'permit', '".$permit_pdf."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + else{ + $create_image = reCreateImage('StaffImage', $page, 'pi-'.$k.'-'.rand(000000, 999999).'-'.time(), '', $image, $_FILES['permitimages']["type"][$k], $_FILES['permitimages']['tmp_name'][$k]) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $mysqli->query("INSERT INTO staff_image + (staff_id, type, file_name, created_at, updated_at) VALUES + ('".$page."', 'permit', '".$create_image['image']."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + } + } + } + // update database + $mysqli->query("UPDATE staff SET + ".$update_query." + ".$image_query." + staff_idno = '".$staff_idno."', + staff_name = '".$staff_name."', + staff_shortname = '".$staff_shortname."', + staff_email = '".$staff_email."', + staff_username = '".$staff_username."', + staff_mobileno = '".$staff_mobileno."', + gender_id = '".escapeString($_POST['gender_id'])."', + staff_birthdate = '".escapeString($_POST['staff_birthdate'])."', + country_id = '".escapeString($_POST['country_id'])."', + staff_icno = '".escapeString($_POST['staff_icno'])."', + staff_passportno = '".escapeString($_POST['staff_passportno'])."', + staff_passportexpired = '".escapeString($_POST['staff_passportexpired'])."', + religion_id = '".escapeString($_POST['religion_id'])."', + ethnic_id = '".escapeString($_POST['ethnic_id'])."', + staff_date_joined = '".escapeString($_POST['staff_date_joined'])."', + staff_tier = '".escapeString($_POST['staff_tier'])."', + staff_date_confirmed = '".escapeString($_POST['staff_date_confirmed'])."', + staff_date_resigned = '".escapeString($_POST['staff_date_resigned'])."', + staff_run_away = '".escapeString($_POST['staff_run_away'])."', + staff_resign_reason = '".escapeString($_POST['staff_resign_reason'])."', + staff_probation_end = '".escapeString($_POST['staff_probation_end'])."', + job_position_id = '".escapeString($_POST['job_position_id'])."', + job_section_id = '".escapeString($_POST['job_section_id'])."', + staff_effective_date = '".escapeString($_POST['staff_effective_date'])."', + branch_id = '".escapeString($_POST['branch_id'])."', + leave_id = '".escapeString($_POST['leave_id'])."', + sick_id = '".escapeString($_POST['sick_id'])."', + group_id = '".escapeString($_POST['group_id'])."', + salary_id = '".escapeString($_POST['salary_id'])."', + job_type_id = '".escapeString($_POST['job_type_id'])."', + job_status_id = '".escapeString($_POST['job_status_id'])."', + work_type_id = '".escapeString($_POST['work_type_id'])."', + staff_permitno = '".escapeString($_POST['staff_permitno'])."', + staff_permit_start = '".escapeString($_POST['staff_permit_start'])."', + staff_permit_end = '".escapeString($_POST['staff_permit_end'])."', + staff_permit_effective_date = '".escapeString($_POST['staff_permit_effective_date'])."', + staff_salary = '".escapeString($_POST['staff_salary'])."', + staff_contract_salary = '".escapeString($_POST['staff_contract_salary'])."', + staff_allowance_topup = '".escapeString($_POST['staff_allowance_topup'])."', + staff_allowance_work = '".escapeString($_POST['staff_allowance_work'])."', + staff_allowance_food = '".escapeString($_POST['staff_allowance_food'])."', + staff_salary_nextreview_date = '".escapeString($_POST['staff_salary_nextreview_date'])."', + staff_salary_effective_date = '".escapeString($_POST['staff_salary_effective_date'])."', + bank_id = '".escapeString($_POST['bank_id'])."', + payment_type_id = '".escapeString($_POST['payment_type_id'])."', + payment_transfer_id = '".escapeString($_POST['payment_transfer_id'])."', + staff_accountno = '".escapeString($_POST['staff_accountno'])."', + staff_epf_rate = '".escapeString($_POST['staff_epf_rate'])."', + staff_epf_rate_id = '".escapeString($_POST['staff_epf_rate_id'])."', + staff_socso_rate_id = '".escapeString($_POST['staff_socso_rate_id'])."', + staff_eis_rate_id = '".escapeString($_POST['staff_eis_rate_id'])."', + staff_zakat_rate_id = '".escapeString($_POST['staff_zakat_rate_id'])."', + staff_epfno = '".escapeString($_POST['staff_epfno'])."', + staff_taxno = '".escapeString($_POST['staff_taxno'])."', + staff_child_relief = '".escapeString($_POST['staff_child_relief'])."', + staff_eis_status = '".escapeString($_POST['staff_eis_status'])."', + socso_category_id = '".escapeString($_POST['socso_category_id'])."', + tax_status_id = '".escapeString($_POST['tax_status_id'])."', + staff_muslim_zakat = '".escapeString($_POST['staff_muslim_zakat'])."', + staff_eis_status = '".escapeString($_POST['staff_eis_status'])."', + staff_settings = '".$staff_settings."', + staff_covid = '".$staff_covid."', + staff_covid_test = '".$staff_covid_test."', + staff_fonema = '".$staff_fonema."', + staff_fenoma_period = '".$staff_fenoma_period."', + staff_typhoid = '".$staff_typhoid."', + updated_at = '".TODAYDATE."' + WHERE staff_id = '".$page."'") ; + + // knowledge check list + $knowledgelist = $_POST['knowledge'] ; + $mysqli->query("DELETE FROM staff_knowledge + WHERE staff_id = '".$page."'") ; + + if( !empty($knowledgelist) ){ + for ( $i = 0 ; $i < count($knowledgelist) ; $i++ ){ + $mysqli->query("INSERT INTO staff_knowledge + (staff_id, knowledge_id, created_at, updated_at) VALUES + ('".$page."', '".$knowledgelist[$i]."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + } + + // department check list + $departmentlist = $_POST['department'] ; + $mysqli->query("DELETE FROM staff_department + WHERE staff_id = '".$page."'") ; + + if( !empty($departmentlist) ){ + for ( $i = 0 ; $i < count($departmentlist) ; $i++ ){ + $mysqli->query("INSERT INTO staff_department + (staff_id, department_id, created_at, updated_at) VALUES + ('".$page."', '".$departmentlist[$i]."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + } + + // hostel check list + $hostellist = $_POST['hostel'] ; + $mysqli->query("DELETE FROM staff_hostel + WHERE staff_id = '".$page."'") ; + + if( !empty($hostellist) ){ + for ( $i = 0 ; $i < count($hostellist) ; $i++ ){ + $mysqli->query("INSERT INTO staff_hostel + (staff_id, hostel_id, created_at, updated_at) VALUES + ('".$page."', '".$hostellist[$i]."', '".TODAYDATE."', '".TODAYDATE."')") ; + } + } + + // add system log + $array_remark = array('old' => array('staff_name' => $row_page['staff_name']), + 'new' => array('staff_name' => $staff_name)) ; + + + + }catch( Exception $e ){ + $error_message .= '
    '.$lang['Sorry something error'].' ('.$e.').
    ' ; + $error++; + } + + if( $error == 0 ) { + + // commit query + $mysqli->commit() ; + $error_message = '
    '.$lang['Thank you your staff has been updated'].'
    ' ; + + }else{ + $mysqli->rollback() ; + } + + } + + //}else{ + //$error_message ; + //} + + // } + + // refresh page + header("Location:hr-staff.php?page_mode=edit&page=".$page) ; + $_SESSION['system_result'] = $error_message ; + exit ; + } + + // get all ethnic + $ethnic = [] ; + $get_ethnic = $mysqli->query("SELECT * FROM master_ethnic + WHERE deleted_at IS NULL") ; + if ( $get_ethnic->num_rows > 0 ){ + while ( $row_ethnic = $get_ethnic->fetch_assoc() ){ + $ethnic[$row_ethnic['ethnic_id']] = $row_ethnic['ethnic_desc'] ; + } + } + + // get all religion + $religion = [] ; + $get_religion = $mysqli->query("SELECT * FROM master_religion + WHERE deleted_at IS NULL") ; + if ( $get_religion->num_rows > 0 ){ + while ( $row_religion = $get_religion->fetch_assoc() ){ + $religion[$row_religion['religion_id']] = $row_religion['religion_desc'] ; + } + } + + // get all leave + $leave = [] ; + $get_leave = $mysqli->query("SELECT * FROM setting_leave + WHERE deleted_at IS NULL") ; + if ( $get_leave->num_rows > 0 ){ + while ( $row_leave = $get_leave->fetch_assoc() ){ + $leave[$row_leave['leave_id']] = $row_leave['leave_name'] ; + } + } + + // get all sick + $sick = [] ; + $get_sick = $mysqli->query("SELECT * FROM setting_sick + WHERE deleted_at IS NULL") ; + if ( $get_sick->num_rows > 0 ){ + while ( $row_sick = $get_sick->fetch_assoc() ){ + $sick[$row_sick['sick_id']] = $row_sick['sick_name'] ; + } + } + + // get all job type + $job_type = [] ; + $get_job_type = $mysqli->query("SELECT * FROM master_job_type + WHERE deleted_at IS NULL") ; + if ( $get_job_type->num_rows > 0 ){ + while ( $row_job_type = $get_job_type->fetch_assoc() ){ + $job_type[$row_job_type['job_type_id']] = $row_job_type['job_type_desc'] ; + } + } + + // get all work days + $work_type = [] ; + $get_work_type = $mysqli->query("SELECT * FROM master_work_type + WHERE deleted_at IS NULL") ; + if ( $get_work_type->num_rows > 0 ){ + while ( $row_work_type = $get_work_type->fetch_assoc() ){ + $work_type[$row_work_type['work_type_id']] = $row_work_type['work_type_desc'] ; + } + } + + // get all chief + $chief = [] ; + $get_chief = $mysqli->query("SELECT * FROM setting_chief + WHERE deleted_at IS NULL") ; + if ( $get_chief->num_rows > 0 ){ + while ( $row_chief = $get_chief->fetch_assoc() ){ + $chief[$row_chief['chief_id']] = $row_chief['chief_desc'] ; + } + } + + // get all bank + $bank = [] ; + $get_bank = $mysqli->query("SELECT * FROM master_bank + WHERE deleted_at IS NULL") ; + if ( $get_bank->num_rows > 0 ){ + while ( $row_bank = $get_bank->fetch_assoc() ){ + $bank[$row_bank['bank_id']] = $row_bank['bank_desc'] ; + } + } + + // get all payment transfer + $payment_transfer = [] ; + $get_payment_transfer = $mysqli->query("SELECT * FROM master_payment_transfer + WHERE deleted_at IS NULL") ; + if ( $get_payment_transfer->num_rows > 0 ){ + while ( $row_payment_transfer = $get_payment_transfer->fetch_assoc() ){ + $payment_transfer[$row_payment_transfer['payment_transfer_id']] = $row_payment_transfer['payment_transfer_desc'] ; + } + } + + // get all payment transfer + $payment_type = [] ; + $get_payment_type = $mysqli->query("SELECT * FROM master_payment_type + WHERE deleted_at IS NULL") ; + if ( $get_payment_type->num_rows > 0 ){ + while ( $row_payment_type = $get_payment_type->fetch_assoc() ){ + $payment_type[$row_payment_type['payment_type_id']] = $row_payment_type['payment_type_desc'] ; + } + } + + // get all payment transfer + $socso_category = [] ; + $get_socso_category = $mysqli->query("SELECT * FROM master_socso_category + WHERE deleted_at IS NULL") ; + if ( $get_socso_category->num_rows > 0 ){ + while ( $row_socso_category = $get_socso_category->fetch_assoc() ){ + $socso_category[$row_socso_category['socso_category_id']] = $row_socso_category['socso_category_desc'] ; + } + } + + // get all payment transfer + $tax_status = [] ; + $get_tax_status = $mysqli->query("SELECT * FROM master_tax_status + WHERE deleted_at IS NULL") ; + if ( $get_tax_status->num_rows > 0 ){ + while ( $row_tax_status = $get_tax_status->fetch_assoc() ){ + $tax_status[$row_tax_status['tax_status_id']] = $row_tax_status['tax_status_desc'] ; + } + } + + // get all knowledge + $knowledge = [] ; + $get_knowledge = $mysqli->query("SELECT * FROM setting_knowledge + WHERE deleted_at IS NULL") ; + if ( $get_knowledge->num_rows > 0 ){ + while ( $row_knowledge = $get_knowledge->fetch_assoc() ){ + $knowledge[$row_knowledge['knowledge_id']] = $row_knowledge['knowledge_desc'] ; + } + } + + // get all hostel + $hostel = [] ; + $get_hostel = $mysqli->query("SELECT * FROM setting_hostel + WHERE deleted_at IS NULL") ; + if ( $get_hostel->num_rows > 0 ){ + while ( $row_hostel = $get_hostel->fetch_assoc() ){ + $hostel[$row_hostel['hostel_id']] = $row_hostel['hostel_desc'] ; + } + } + + // get all department + $department = [] ; + $get_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $get_department->num_rows > 0 ){ + while ( $row_department = $get_department->fetch_assoc() ){ + $department[$row_department['department_id']] = $row_department['department_desc'] ; + } + } + + // get selected knowledge + $selected_knowledge = [] ; + $get_selected_knowledge = $mysqli->query("SELECT * FROM staff_knowledge + WHERE deleted_at IS NULL AND staff_id = '".$page."'") ; + if ( $get_selected_knowledge->num_rows > 0 ){ + while ( $row_selected_knowledge = $get_selected_knowledge->fetch_assoc() ){ + $selected_knowledge[] = $row_selected_knowledge['knowledge_id'] ; + } + } + + // get selected hostel + $selected_hostel = [] ; + $get_selected_hostel = $mysqli->query("SELECT * FROM staff_hostel + WHERE deleted_at IS NULL AND staff_id = '".$page."'") ; + if ( $get_selected_hostel->num_rows > 0 ){ + while ( $row_selected_hostel = $get_selected_hostel->fetch_assoc() ){ + $selected_hostel[] = $row_selected_hostel['hostel_id'] ; + } + } + + // get selected department + $selected_department = [] ; + $get_selected_department = $mysqli->query("SELECT * FROM staff_department + WHERE deleted_at IS NULL AND staff_id = '".$page."'") ; + if ( $get_selected_department->num_rows > 0 ){ + while ( $row_selected_department = $get_selected_department->fetch_assoc() ){ + $selected_department[] = $row_selected_department['department_id'] ; + } + } + + // default config + $default_config_punch = DEFAULTPUNCH ; + + $staff_settings = $row_page['staff_settings'] ; + if ( $staff_settings != '' ){ + $staff_settings = JsonEncodeDecode('decode', $staff_settings) ; + }else{ + $staff_settings = [] ; + } + + $passportimages = [] ; + $permitimages = [] ; + $get_staff_image = $mysqli->query("SELECT * FROM staff_image + WHERE deleted_at IS NULL AND staff_id = '".$page."'") ; + if ( $get_staff_image->num_rows > 0 ){ + while ( $row_staff_image = $get_staff_image->fetch_assoc() ){ + if ( $row_staff_image['type'] == 'passport' ){ + $passportimages[$row_staff_image['image_id']] = $row_staff_image['file_name'] ; + } + if ( $row_staff_image['type'] == 'permit' ){ + $permitimages[$row_staff_image['image_id']] = $row_staff_image['file_name'] ; + } + } + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + + + +
    + + + + query("SELECT * FROM staff + // WHERE deleted_at IS NULL ORDER BY (staff_idno * 1) ASC, staff_idno ASC"); + + // $boolean_next = false ; + // $temp_id = $previous_id = '' ; + // while ($row_next_previous = $mysqli_next_previous->fetch_array(MYSQLI_ASSOC)){ + // $next_previous_id = $row_next_previous['staff_id'] ; + + // if ($boolean_next){ + // $next_id = $next_previous_id ; + // $boolean_next = false ; + // } + + // if ($next_previous_id == $page){ + // $previous_id = $temp_id ; + // $boolean_next = true ; + // } + + // $temp_id = $next_previous_id ; + // } + + // if ($previous_id != '' || $next_id != ''){ + // echo ' + //
    + //
    + //
    + // '.($previous_id != '' ? ''.$lang['Previous'].'' : '').' + // '.($next_id != '' ? ''.$lang['Next'].'' : '').' + //
    + //
    ' ; + // } + ?> + +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +

    +
    + + +
    +
    +
    + + + +
    +
    + + +
    +
    +
    + +
    +
    +
    +
    +
    +  '.$lang['remove_photo'].' + ' ; + }else{ + echo ' + + ' ; + } + ?> +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    + +
    +
    *
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +

    +
    + +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + + - +
    +
    + + + + + 0 ){ ?> +
    +
    +
    +
    + $v ){ + if(strpos($v, ".pdf") == true){ + ?> +
    + +
    + View +
    +
    + Del +
    +
    + +
    + +
    + View +
    +
    + Del +
    +
    + +
    +
    +
    + + +
    +
    + +
    +

    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + + +
    + + + +
    + +
    +

    +
    + +
    +
    *
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + > +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    *

    +
    + +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    + +
    +
    + + $v ){ ?> + + +
    +

    +
    + +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    *
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + + +
    +
    + +
    +

    +
    + +
    +
    *
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +

    +
    + +
    +
    EPF Rate
    +
    + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    Socso Rate
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    EIS Rate
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    + +
    +

    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +

    +
    + +
    +
    + $v ){ ?> +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    *

    +
    + +
    +
    + $v ){ ?> +
    + +
    +
    + +
    +
    + +
    +
    + +
    +

    +
    + +
    +
    + $v ){ ?> +
    + +
    +
    + +
    +
    + +
    +
    + +
    +

    +
    + +
    +
    +
    + Allow to Approve Resignation +
    +
    + +
    +
    Is Manager
    +
    + + +
    +
    +
    +
    Is HR Manager
    +
    + + +
    +
    + +
    + +
    +
    +
    + + +
    +
    + +
    +
    Allow To View Task Branch Report
    +
    + + +
    +
    + +
    +
    Allow To View Adjustment Branch Report
    +
    + + +
    +
    + +
    +
    Allow To Check Recruitment
    +
    + + +
    +
    + +
    +
    Allow Check In Association
    +
    + + +
    +
    + +
    +
    Allow Check In Training
    +
    + + +
    +
    + +
    +
    Allow Approve Visitation
    +
    + + +
    +
    + +
    +
    Allow Check In Visitation
    +
    + + +
    +
    + +
    +
    +
    + + +
    +
    + +
    +
    Punch Card Without Checking Branch Geometry
    +
    + + +
    +
    + +
    +
    Vcard Mode
    +
    + + + +
    +
    + +
    +
    + +
    + +
    +
    + + +
    +
    +
    + + + +
    +
    + + +
    +
    +
    +
    + alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: page-dashboard.php') ; + exit ; + } + + // default parameter + $left_join = '' ; + + $search = escapeString($_GET['search']) ; + $search_name = escapeString($_GET['search_name']) ; + $search_idno = escapeString($_GET['search_idno']) ; + $search = escapeString($_GET['search']) ; + $lf_type = escapeString($_GET['lf_type']) ; + $lf_branch = escapeString($_GET['lf_branch']) ; + $lf_resigned = escapeString($_GET['lf_resigned']) ; + $sort_by = escapeString($_GET['sort_by']) ; + $sort_by = ( $sort_by != '' ? $sort_by : 'staff_idno' ) ; + $sort_by_type = escapeString($_GET['sort_by_type']) ; + $sort_by_type = ( $sort_by_type != '' ? $sort_by_type : 'asc' ) ; + $export = escapeString($_GET['export']) ; + $status = escapeString($_GET['status']) ; + $search_mobile = escapeString($_GET['search_mobile']) ; + $search_mail = escapeString($_GET['search_mail']) ; + $search_tier = escapeString($_GET['search_tier']) ; + $search_department = escapeString($_GET['search_department']) ; + $search_point = escapeString($_GET['search_point']) ; + $search_wallet = escapeString($_GET['search_wallet']) ; + $search_star = escapeString($_GET['search_star']) ; + $search_achievement = escapeString($_GET['search_achievement']) ; + + + + // query type + $search_query = '' ; + + if($status != ''){ + if($status == 'resign'){ + $search_query .= " AND (a.staff_date_resigned != '0000-00-00' AND a.staff_date_resigned IS NOT NULL AND (a.staff_run_away = '' || a.staff_run_away IS NULL))" ; + }elseif($status == 'run-away'){ + $search_query .= " AND (a.staff_date_resigned != '0000-00-00' AND a.staff_date_resigned IS NOT NULL AND a.staff_run_away = 'yes')" ; + }elseif($status == 'warning'){ + + } + } + + switch ( $page_mode ){ + case 'resign' : + $active_menu = 'hr-staff-resgined' ; + $search_query .= " AND (a.staff_date_resigned != '0000-00-00' AND a.staff_date_resigned IS NOT NULL AND (a.staff_run_away = '' || a.staff_run_away IS NULL))" ; + break ; + case 'run_away' : + $active_menu = 'hr-staff-run-away' ; + $search_query .= " AND (a.staff_date_resigned != '0000-00-00' AND a.staff_date_resigned IS NOT NULL AND a.staff_run_away = 'yes')" ; + break ; + default : + $active_menu = 'hr-staff-list' ; + } + + // search query + if( $search != ''){ + $search_query .= " AND (a.staff_idno LIKE '%".$search."%' || a.staff_name LIKE '%".$search."%')" ; + } + if( $search_name != ''){ + $search_query .= " AND a.staff_name LIKE '%".$search_name."%'" ; + } + if( $search_mobile != ''){ + $search_query .= " AND a.staff_mobileno LIKE '%".$search_mobile."%'" ; + } + if( $search_mail != ''){ + $search_query .= " AND a.staff_email LIKE '%".$search_mail."%'" ; + } + if( $search_tier != ''){ + $search_query .= " AND a.staff_tier LIKE '%".$search_tier."%'" ; + } + if( $search_department != ''){ + $left_join = " LEFT JOIN staff_department b ON ( a.staff_id = b.staff_id )" ; + $search_query .= " AND b.department_id = '".$search_department."'" ; + } + if( $search_idno != ''){ + $search_query .= " AND a.staff_idno LIKE '%".$search_idno."%'" ; + } + if( $search_point != ''){ + $search_query .= " AND a.staff_point = '".$search_point."'" ; + } + if( $search_wallet != ''){ + $search_query .= " AND a.staff_wallet = '".$search_wallet."'" ; + } + if( $search_star != ''){ + $search_query .= " AND a.staff_star = '".$search_star."'" ; + } + if( $search_achievement != ''){ + $search_query .= " AND a.staff_achievement LIKE '%".$search_achievement."%'" ; + } + if( $lf_type != '' ){ + if( $lf_type == 'local' ){ + $search_query .= " AND a.country_id = '1'" ; + }else{ + $search_query .= " AND a.country_id != '1'" ; + } + } + if ( $lf_branch != '' ){ + $search_query .= " AND a.branch_id = '".$lf_branch."'" ; + } + + if ( $lf_resigned != '' ){ + $search_query .= " AND ( a.staff_date_resigned >= '".$lf_resigned."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL )" ; + }else{ + $search_query .= " AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL )" ; + } + + // $search_query .= ( $get_user_tier['check'] ? " AND a.staff_tier IN ( ".implode(', ', $get_user_tier['tiers'])." )" : '' ) ; + + // form submit + if( $_POST['hide'] == '1' && $_POST['hide_status'] == 'action' ){ + // trash item + switch( $_POST['page_action'] ){ + case 'trash': + $mysqli_query = "UPDATE " . staff . " SET + deleted_at = '".TODAYDATE."' + WHERE staff_id = " ; + $trash_page = trashPage('staff', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_name='.$search_name.'&search_idno='.$search_idno.'&lf_type='.$lf_type.'&lf_branch='.$lf_branch.'&sort_by='.$sort_by.'&sort_by_type='.$sort_by_type.'&lf_branch='.$lf_branch.'&lf_resigned='.$lf_resigned.'&status='.$status.'&show_all_none_branch_staff='.$show_all_none_branch_staff.'&search_point='.$search_point.'&search_wallet='.$search_wallet.'&search_star='.$search_star.'&search_achievement='.$search_achievement ; + + $show_all_none_branch_staff = escapeString($_GET['show_all_none_branch_staff']); + if ($show_all_none_branch_staff == 'all') { + $user_branch_permission_sql = 'and branch_id = "" and staff_name != "" '; + } + + // page query + $mysqli_query = "SELECT a.* FROM staff a + ".$left_join." + WHERE a.deleted_at IS NULL" . $search_query . $user_branch_permission_sql_a ; + + // export excel + if ( $export == 'yes' ){ + + include 'PhpExcel/PHPExcel.php' ; + + $page_filename = 'Staff-'.date( 'Ymd', time() ) ; + $objPHPExcel = new PHPExcel() ; + $objPHPExcel->getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + // default parameter + $count = 1 ; + $char = 'A' ; + $count_staff = 1 ; + + $array_title = array( 'No.', 'Qrcode', 'ID', 'Name', 'Mobile No','Gender', 'Birth Date','Age','Mailing Address','Marriage Status','Country', "IC", 'Position', 'Status','Ethnic','Religion', 'Date Joined ','Created Date' ) ; + + $newChar = $char ; + foreach( $array_title as $k => $v ){ + $objPHPExcel->getActiveSheet()->setCellValue( $newChar.$count, $v ) ; + $newChar++ ; + } + $count++ ; + + $array_staffidnos = [] ; + $staffs_q = $mysqli->query( $mysqli_query." ORDER BY (".$sort_by.' * 1) '.$sort_by_type . ', '.$sort_by.' '.$sort_by_type ) ; + if ( $staffs_q->num_rows > 0 ){ + while ( $staff = $staffs_q->fetch_assoc() ){ + + $staff_idno = ucwords($staff['staff_idno']) ; + if( $staff['country_id'] == '1' ){ + if( $staff['staff_icno'] != '' ){ + $IC = dataFilter($staff['staff_icno']) ; + }else{ + $IC = '-' ; + } + }else{ + $IC = '-' ; + } + + if( $staff['country_id'] == '1' ){ + $passport = '-' ; + }else{ + if( $staff['staff_passportno'] != '-' && $staff['staff_passportexpired'] != '0000-00-00' ){ + $passport = dataFilter($staff['staff_passportexpired']) . ( $staff['staff_passportno'] != '' ? ' ('.dataFilter($staff['staff_passportno']).')' : '' ) ; + }else{ + $passport = '-' ; + } + } + + if( $staff['country_id'] == '1' ){ + $permit = '-' ; + }else{ + if( $staff['staff_permitno'] != '-' && $staff['staff_permit_end'] != '0000-00-00' ){ + $permit = dataFilter($staff['staff_permit_end']) . ( $staff['staff_permitno'] != '' ? ' ('.dataFilter($staff['staff_permitno']).')' : '' ) ; + }else{ + $permit = '-' ; + } + } + + $birthDate = $staff['staff_birthdate']; + if($birthDate!='' && $birthDate !='0000-00-00'){ + $birthDate = date("Y",strtotime($staff['staff_birthdate'])); + //explode the date to get month, day and year + + //get age from date or birthdate + $age = date("Y") - $birthDate; + + if($birthDate!=''){ + $age = "( ".$age." years old )"; + }else{ + $age = "(-)"; + } + }else{ + $age = "(-)"; + } + + $staff_settings_excel = jsonEncodeDecode('decode',$staff['staff_settings']); + + $select_ethnic_name = $mysqli->query("SELECT * FROM master_ethnic WHERE ethnic_id = '".$staff['ethnic_id']."' "); + if($select_ethnic_name->num_rows>0){ + while($row_ethnic_name = $select_ethnic_name->fetch_assoc()){ + $ethic_name = $row_ethnic_name['ethnic_desc']; + } + } + + $select_religion_name = $mysqli->query("SELECT * FROM master_religion WHERE religion_id = '".$staff['religion_id']."' "); + if($select_religion_name->num_rows>0){ + while($row_religion_name = $select_religion_name->fetch_assoc()){ + $religion_name = $row_religion_name['religion_desc']; + } + } + + $newChar = $char ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $count_staff ) ; + + // for qrcode + $qrcode_column = ($newChar++).$count ; + $objPHPExcel->getActiveSheet()->setCellValue( $qrcode_column, ' ' ) ; + $array_staffidnos[] = [ 'coordinate' => $qrcode_column, 'idno' => $staff_idno, ] ; + + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff_idno ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_name'] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_mobileno'] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, dataFilter( $gender[$staff['gender_id']] ) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, date("d-m-Y",strtotime($staff['staff_birthdate'])) ); + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $age ); + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff_settings_excel['mailing_address'] ); + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff_settings_excel['marital_status'] ); + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $country[$staff['country_id']] ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $IC ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $passport ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_passportno'] ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $permit ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, dataFilter( $position[$staff['job_position_id']] ) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, dataFilter( $job_status[$staff['job_status_id']] ) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $ethic_name) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $religion_name) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['staff_date_joined']) ) ; + $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['created_at']) ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['staff_covid']) ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['staff_covid_test']) ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['staff_fonema']) ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_fenoma_period'] ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, resetDateFormat($staff['staff_typhoid']) ) ; + + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_point_achievement'] ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_point'] ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_wallet'] ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $staff['staff_star'] ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, $tier_list_id[$staff['staff_tier']] ) ; + // $objPHPExcel->getActiveSheet()->setCellValue( ($newChar++).$count, ucfirst($staff['staff_achievement']) ) ; + + $count++ ; + $count_staff++ ; + } + } + + + // start drawing image + foreach ( $array_staffidnos as $kstaffidnos => $vstaffidnos ){ + // if ( $kstaffidnos == '0' ){ + $generatecode = generateQrcode( '', $vstaffidnos['idno'], PATH.'hr-staff-vcard.php?staff_idno='.$vstaffidnos['idno'] ) ; + + $qrcode = $generatecode['url'] ; + $base64_qrcode = 'data:image/png;base64,'.base64_encode(file_get_contents($qrcode)) ; + $gdImage = imagecreatefrompng($base64_qrcode) ; + + $objDrawing = new PHPExcel_Worksheet_MemoryDrawing() ; + $objDrawing->setName( $vstaffidnos['idno'] ) ; + $objDrawing->setImageResource( $gdImage ) ; + $objDrawing->setRenderingFunction( PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG ) ; + $objDrawing->setMimeType( PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT ) ; + $objDrawing->setHeight( 55 ) ; + $objDrawing->setCoordinates( $vstaffidnos['coordinate'] ) ; + $objDrawing->setWorksheet( $objPHPExcel->getActiveSheet() ) ; + // } + } + $objPHPExcel->getActiveSheet()->getDefaultRowDimension()->setRowHeight( 40 ) ; + + + // start render excel file + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + ob_clean(); + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; + } + + $mysqli_page = $mysqli->query( $mysqli_query . " ORDER BY (".$sort_by.' * 1) '.$sort_by_type.", ".$sort_by." ".$sort_by_type." LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // 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' ) ; + + ?> + +
    + + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + + + + + + + + +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + + + +
    +
    +
    +
    +
    + +
    + + + +
    +
    + + + + +
    +
    + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + num_rows > 0 ){ + + while( $row_page = $mysqli_page->fetch_assoc() ){ + $staff_lists[] = $row_page ; + $staff_ids[] = $row_page['staff_id'] ; + } + + $staff_departments = [] ; + $select_departments = $mysqli->query( "SELECT a.staff_id, b.department_desc FROM staff_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' AND a.staff_id IN ( ".implode(', ', $staff_ids)." )" ) ; + if ( $select_departments->num_rows > 0 ){ + while ( $row_departments = $select_departments->fetch_assoc() ){ + $staff_departments[$row_departments['staff_id']][] = $row_departments['department_desc'] ; + } + } + + foreach ( $staff_lists as $k => $row_page ){ + + // default variable + $id = $row_page['staff_id'] ; + $staff_idno = ucwords($row_page['staff_idno']) ; + + if ( $STAFFDETAILS == 'show' ){ + $last_4_class = '' ; + if ( $row_page['country_id'] != '0' && $row_page['country_id'] != '1' ){ + $last_4_month_passport = date( 'Y-m-d', strtotime( $row_page['staff_passportexpired'].' -2 month' ) ) ; + $last_4_month_permit = date( 'Y-m-d', strtotime( $row_page['staff_permit_end'].' -2 month' ) ) ; + if ( ( $row_page['staff_passportno'] != '-' && TODAYDAY >= $last_4_month_passport ) || ( $row_page['staff_permitno'] != '-' && TODAYDAY >= $last_4_month_permit ) ){ + $last_4_class = 'table-background-orange' ; + } + $last_4_month_passport = date( 'Y-m-d', strtotime( $row_page['staff_passportexpired'].' -1 month' ) ) ; + $last_4_month_permit = date( 'Y-m-d', strtotime( $row_page['staff_permit_end'].' -1 month' ) ) ; + if ( ( $row_page['staff_passportno'] != '-' && TODAYDAY >= $last_4_month_passport ) || ( $row_page['staff_permitno'] != '-' && TODAYDAY >= $last_4_month_permit ) ){ + $last_4_class = 'table-background-red' ; + } + } + + // staff_birthdate + $staff_birthdate = $today_year . date( '-m-d', strtotime( $row_page['staff_birthdate'] ) ) ; + + if ( TODAYDAY == $staff_birthdate || TODAYDAY == date('Y-m-d', strtotime('-1 days',strtotime($staff_birthdate))) ){ + $last_4_class = 'table-background-green' ; + } + } + + $check_permission = false ; + if ( $get_user_tier['check'] ){ + if ( in_array( $row_page['staff_tier'], $get_user_tier['tiers'] ) ){ + $check_permission = true ; + } + }else{ + $check_permission = true ; + } + + + echo ' + + + + + + ' ; + + // if ( $STAFFDETAILS == 'show' ){ + // echo ' + // + // + // ' ; + // } + + echo ' + + + + + + '; + } + } + ?> + +
    + + + + + + + ' : '' ) ?> + + + + + + ' : '' ) ?> + + + + + + ' : '' ) ?> + + + + + + ' : '' ) ?> + + +
    ' ; + if ( $check_permission ){ + echo ' + + | + + '.(!permissionCheck($row_user, 'staff-list-update') ? '' : ' + | + ') ; + }else{ + echo '-' ; + } + echo ' + '.$staff_idno.''.dataFilter($row_page['staff_name']).''.dataFilter( $gender[$row_page['gender_id']] ).'' ; + // if( $row_page['country_id'] == '1' ){ + // if( $row_page['staff_icno'] != '' ){ + // echo dataFilter($row_page['staff_icno']) ; + // }else{ + // echo '-' ; + // } + // }else{ + // echo '-' ; + // } + // echo ' + // ' ; + // if( $row_page['country_id'] == '1' ){ + // echo '-' ; + // }else{ + // if( $row_page['staff_passportno'] != '-' && $row_page['staff_passportexpired'] != '0000-00-00' ){ + // echo dataFilter($row_page['staff_passportexpired']) . ( $row_page['staff_passportno'] != '' ? ' ('.dataFilter($row_page['staff_passportno']).')' : '' ) ; + // }else{ + // echo '-' ; + // } + // } + // echo ' + // ' ; + // if( $row_page['country_id'] == '1' ){ + // echo '-' ; + // }else{ + // if( $row_page['staff_permitno'] != '-' && $row_page['staff_permit_end'] != '0000-00-00' ){ + // echo dataFilter($row_page['staff_permit_end']) . ( $row_page['staff_permitno'] != '' ? ' ('.dataFilter($row_page['staff_permitno']).')' : '' ) ; + // }else{ + // echo '-' ; + // } + // } + // echo ' + // '.dataFilter( $position[$row_page['job_position_id']] ).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).'' ; + if ( $check_permission ){ + echo ' +
    + + +
    ' ; + } + echo ' +
    + +
    +
    +
    +
    + \ No newline at end of file diff --git a/images/company/kindlemind/favicon.ico b/images/company/kindlemind/favicon.ico new file mode 100644 index 0000000..526628c Binary files /dev/null and b/images/company/kindlemind/favicon.ico differ diff --git a/images/company/kindlemind/logo-salary.jpg b/images/company/kindlemind/logo-salary.jpg new file mode 100644 index 0000000..1af1275 Binary files /dev/null and b/images/company/kindlemind/logo-salary.jpg differ diff --git a/images/company/kindlemind/logo.png b/images/company/kindlemind/logo.png new file mode 100644 index 0000000..1ac9303 Binary files /dev/null and b/images/company/kindlemind/logo.png differ diff --git a/images/company/kindlemind/logo_full.png b/images/company/kindlemind/logo_full.png new file mode 100644 index 0000000..e3a79c1 Binary files /dev/null and b/images/company/kindlemind/logo_full.png differ diff --git a/images/company/mnr/favicon.ico b/images/company/mnr/favicon.ico new file mode 100644 index 0000000..ea54945 Binary files /dev/null and b/images/company/mnr/favicon.ico differ diff --git a/images/company/mnr/logo.png b/images/company/mnr/logo.png new file mode 100644 index 0000000..50147b7 Binary files /dev/null and b/images/company/mnr/logo.png differ diff --git a/images/company/mnr/logo_email.png b/images/company/mnr/logo_email.png new file mode 100644 index 0000000..59dde56 Binary files /dev/null and b/images/company/mnr/logo_email.png differ diff --git a/images/company/mnr/logo_full.png b/images/company/mnr/logo_full.png new file mode 100644 index 0000000..bfbd70d Binary files /dev/null and b/images/company/mnr/logo_full.png differ diff --git a/images/company/mnr/visitation/background-result.jpg b/images/company/mnr/visitation/background-result.jpg new file mode 100644 index 0000000..3b6f71c Binary files /dev/null and b/images/company/mnr/visitation/background-result.jpg differ diff --git a/images/company/mnr/visitation/background.jpg b/images/company/mnr/visitation/background.jpg new file mode 100644 index 0000000..bf6f483 Binary files /dev/null and b/images/company/mnr/visitation/background.jpg differ diff --git a/images/company/mnr/visitation/frame-bottom.png b/images/company/mnr/visitation/frame-bottom.png new file mode 100644 index 0000000..42b6e2f Binary files /dev/null and b/images/company/mnr/visitation/frame-bottom.png differ diff --git a/images/company/mnr/visitation/frame-center.png b/images/company/mnr/visitation/frame-center.png new file mode 100644 index 0000000..2fe5c4e Binary files /dev/null and b/images/company/mnr/visitation/frame-center.png differ diff --git a/images/company/mnr/visitation/frame-result.png b/images/company/mnr/visitation/frame-result.png new file mode 100644 index 0000000..765c65a Binary files /dev/null and b/images/company/mnr/visitation/frame-result.png differ diff --git a/images/company/mnr/visitation/frame-top.png b/images/company/mnr/visitation/frame-top.png new file mode 100644 index 0000000..104b5a1 Binary files /dev/null and b/images/company/mnr/visitation/frame-top.png differ diff --git a/images/company/seow/favicon.ico b/images/company/seow/favicon.ico new file mode 100644 index 0000000..75aaee9 --- /dev/null +++ b/images/company/seow/favicon.ico @@ -0,0 +1,327 @@ +Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org +Copyright: © 1999-2017 ImageMagick Studio LLC +License: http://www.imagemagick.org/script/license.php +Features: Cipher DPC Modules OpenMP +Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib +Usage: convert [options ...] file [ [options ...] file ...] [options ...] file + +Image Settings: + -adjoin join images into a single multi-image file + -affine matrix affine transform matrix + -alpha option activate, deactivate, reset, or set the alpha channel + -antialias remove pixel-aliasing + -authenticate password + decipher image with this password + -attenuate value lessen (or intensify) when adding noise to an image + -background color background color + -bias value add bias when convolving an image + -black-point-compensation + use black point compensation + -blue-primary point chromaticity blue primary point + -bordercolor color border color + -caption string assign a caption to an image + -channel type apply option to select image channels + -clip-mask filename associate a clip mask with the image + -colors value preferred number of colors in the image + -colorspace type alternate image colorspace + -comment string annotate image with comment + -compose operator set image composite operator + -compress type type of pixel compression when writing the image + -define format:option + define one or more image format options + -delay value display the next image after pausing + -density geometry horizontal and vertical density of the image + -depth value image depth + -direction type render text right-to-left or left-to-right + -display server get image or font from this X server + -dispose method layer disposal method + -dither method apply error diffusion to image + -encoding type text encoding type + -endian type endianness (MSB or LSB) of the image + -family name render text with this font family + -fill color color to use when filling a graphic primitive + -filter type use this filter when resizing an image + -font name render text with this font + -format "string" output formatted image characteristics + -fuzz distance colors within this distance are considered equal + -gravity type horizontal and vertical text placement + -green-primary point chromaticity green primary point + -intensity method method to generate intensity value from pixel + -intent type type of rendering intent when managing the image color + -interlace type type of image interlacing scheme + -interline-spacing value + set the space between two text lines + -interpolate method pixel color interpolation method + -interword-spacing value + set the space between two words + -kerning value set the space between two letters + -label string assign a label to an image + -limit type value pixel cache resource limit + -loop iterations add Netscape loop extension to your GIF animation + -mask filename associate a mask with the image + -matte store matte channel if the image has one + -mattecolor color frame color + -moments report image moments + -monitor monitor progress + -orient type image orientation + -page geometry size and location of an image canvas (setting) + -ping efficiently determine image attributes + -pointsize value font point size + -precision value maximum number of significant digits to print + -preview type image preview type + -quality value JPEG/MIFF/PNG compression level + -quiet suppress all warning messages + -red-primary point chromaticity red primary point + -regard-warnings pay attention to warning messages + -remap filename transform image colors to match this set of colors + -respect-parentheses settings remain in effect until parenthesis boundary + -sampling-factor geometry + horizontal and vertical sampling factor + -scene value image scene number + -seed value seed a new sequence of pseudo-random numbers + -size geometry width and height of image + -stretch type render text with this font stretch + -stroke color graphic primitive stroke color + -strokewidth value graphic primitive stroke width + -style type render text with this font style + -support factor resize support: > 1.0 is blurry, < 1.0 is sharp + -synchronize synchronize image to storage device + -taint declare the image as modified + -texture filename name of texture to tile onto the image background + -tile-offset geometry + tile offset + -treedepth value color tree depth + -transparent-color color + transparent color + -undercolor color annotation bounding box color + -units type the units of image resolution + -verbose print detailed information about the image + -view FlashPix viewing transforms + -virtual-pixel method + virtual pixel access method + -weight type render text with this font weight + -white-point point chromaticity white point + +Image Operators: + -adaptive-blur geometry + adaptively blur pixels; decrease effect near edges + -adaptive-resize geometry + adaptively resize image using 'mesh' interpolation + -adaptive-sharpen geometry + adaptively sharpen pixels; increase effect near edges + -alpha option on, activate, off, deactivate, set, opaque, copy + transparent, extract, background, or shape + -annotate geometry text + annotate the image with text + -auto-gamma automagically adjust gamma level of image + -auto-level automagically adjust color levels of image + -auto-orient automagically orient (rotate) image + -bench iterations measure performance + -black-threshold value + force all pixels below the threshold into black + -blue-shift factor simulate a scene at nighttime in the moonlight + -blur geometry reduce image noise and reduce detail levels + -border geometry surround image with a border of color + -bordercolor color border color + -brightness-contrast geometry + improve brightness / contrast of the image + -canny geometry detect edges in the image + -cdl filename color correct with a color decision list + -charcoal radius simulate a charcoal drawing + -chop geometry remove pixels from the image interior + -clamp keep pixel values in range (0-QuantumRange) + -clip clip along the first path from the 8BIM profile + -clip-path id clip along a named path from the 8BIM profile + -colorize value colorize the image with the fill color + -color-matrix matrix apply color correction to the image + -connected-components connectivity + connected-components uniquely labeled + -contrast enhance or reduce the image contrast + -contrast-stretch geometry + improve contrast by `stretching' the intensity range + -convolve coefficients + apply a convolution kernel to the image + -cycle amount cycle the image colormap + -decipher filename convert cipher pixels to plain pixels + -deskew threshold straighten an image + -despeckle reduce the speckles within an image + -distort method args + distort images according to given method ad args + -draw string annotate the image with a graphic primitive + -edge radius apply a filter to detect edges in the image + -encipher filename convert plain pixels to cipher pixels + -emboss radius emboss an image + -enhance apply a digital filter to enhance a noisy image + -equalize perform histogram equalization to an image + -evaluate operator value + evaluate an arithmetic, relational, or logical expression + -extent geometry set the image size + -extract geometry extract area from image + -features distance analyze image features (e.g. contrast, correlation) + -fft implements the discrete Fourier transform (DFT) + -flip flip image vertically + -floodfill geometry color + floodfill the image with color + -flop flop image horizontally + -frame geometry surround image with an ornamental border + -function name parameters + apply function over image values + -gamma value level of gamma correction + -gaussian-blur geometry + reduce image noise and reduce detail levels + -geometry geometry preferred size or location of the image + -grayscale method convert image to grayscale + -hough-lines geometry + identify lines in the image + -identify identify the format and characteristics of the image + -ift implements the inverse discrete Fourier transform (DFT) + -implode amount implode image pixels about the center + -interpolative-resize geometry + resize image using 'point sampled' interpolation + -kuwahara geometry edge preserving noise reduction filter + -lat geometry local adaptive thresholding + -level value adjust the level of image contrast + -level-colors color,color + level image with the given colors + -linear-stretch geometry + improve contrast by `stretching with saturation' + -liquid-rescale geometry + rescale image with seam-carving + -local-contrast geometry + enhance local contrast + -magnify double the size of the image with pixel art scaling + -mean-shift geometry delineate arbitrarily shaped clusters in the image + -median geometry apply a median filter to the image + -mode geometry make each pixel the 'predominant color' of the + neighborhood + -modulate value vary the brightness, saturation, and hue + -monochrome transform image to black and white + -morphology method kernel + apply a morphology method to the image + -motion-blur geometry + simulate motion blur + -negate replace every pixel with its complementary color + -noise geometry add or reduce noise in an image + -normalize transform image to span the full range of colors + -opaque color change this color to the fill color + -ordered-dither NxN + add a noise pattern to the image with specific + amplitudes + -paint radius simulate an oil painting + -perceptible epsilon + pixel value less than |epsilon| become epsilon or + -epsilon + -polaroid angle simulate a Polaroid picture + -posterize levels reduce the image to a limited number of color levels + -profile filename add, delete, or apply an image profile + -quantize colorspace reduce colors in this colorspace + -radial-blur angle radial blur the image (deprecated use -rotational-blur + -raise value lighten/darken image edges to create a 3-D effect + -random-threshold low,high + random threshold the image + -region geometry apply options to a portion of the image + -render render vector graphics + -repage geometry size and location of an image canvas + -resample geometry change the resolution of an image + -resize geometry resize the image + -roll geometry roll an image vertically or horizontally + -rotate degrees apply Paeth rotation to the image + -rotational-blur angle + rotational blur the image + -sample geometry scale image with pixel sampling + -scale geometry scale the image + -segment values segment an image + -selective-blur geometry + selectively blur pixels within a contrast threshold + -sepia-tone threshold + simulate a sepia-toned photo + -set property value set an image property + -shade degrees shade the image using a distant light source + -shadow geometry simulate an image shadow + -sharpen geometry sharpen the image + -shave geometry shave pixels from the image edges + -shear geometry slide one edge of the image along the X or Y axis + -sigmoidal-contrast geometry + increase the contrast without saturating highlights or + shadows + -sketch geometry simulate a pencil sketch + -solarize threshold negate all pixels above the threshold level + -sparse-color method args + fill in a image based on a few color points + -splice geometry splice the background color into the image + -spread radius displace image pixels by a random amount + -statistic type geometry + replace each pixel with corresponding statistic from the + neighborhood + -strip strip image of all profiles and comments + -swirl degrees swirl image pixels about the center + -threshold value threshold the image + -thumbnail geometry create a thumbnail of the image + -tile filename tile image when filling a graphic primitive + -tint value tint the image with the fill color + -transform affine transform image + -transparent color make this color transparent within the image + -transpose flip image vertically and rotate 90 degrees + -transverse flop image horizontally and rotate 270 degrees + -trim trim image edges + -type type image type + -unique-colors discard all but one of any pixel color + -unsharp geometry sharpen the image + -vignette geometry soften the edges of the image in vignette style + -wave geometry alter an image along a sine wave + -wavelet-denoise threshold + removes noise from the image using a wavelet transform + -white-threshold value + force all pixels above the threshold into white + +Image Sequence Operators: + -append append an image sequence + -clut apply a color lookup table to the image + -coalesce merge a sequence of images + -combine combine a sequence of images + -compare mathematically and visually annotate the difference between an image and its reconstruction + -complex operator perform complex mathematics on an image sequence + -composite composite image + -copy geometry offset + copy pixels from one area of an image to another + -crop geometry cut out a rectangular region of the image + -deconstruct break down an image sequence into constituent parts + -evaluate-sequence operator + evaluate an arithmetic, relational, or logical expression + -flatten flatten a sequence of images + -fx expression apply mathematical expression to an image channel(s) + -hald-clut apply a Hald color lookup table to the image + -layers method optimize, merge, or compare image layers + -morph value morph an image sequence + -mosaic create a mosaic from an image sequence + -poly terms build a polynomial from the image sequence and the corresponding + terms (coefficients and degree pairs). + -print string interpret string and print to console + -process arguments process the image with a custom image filter + -separate separate an image channel into a grayscale image + -smush geometry smush an image sequence together + -write filename write images to this file + +Image Stack Operators: + -clone indexes clone an image + -delete indexes delete the image from the image sequence + -duplicate count,indexes + duplicate an image one or more times + -insert index insert last image into the image sequence + -reverse reverse image sequence + -swap indexes swap two images in the image sequence + +Miscellaneous Options: + -debug events display copious debugging information + -distribute-cache port + distributed pixel cache spanning one or more servers + -help print program options + -list type print a list of supported option arguments + -log format format of debugging information + -version print version information + +By default, the image format of `file' is determined by its magic +number. To specify a particular image format, precede the filename +with an image format name and a colon (i.e. ps:image) or specify the +image type as the filename suffix (i.e. image.ps). Specify 'file' as +'-' for standard input or output. diff --git a/images/company/seow/logo.png b/images/company/seow/logo.png new file mode 100644 index 0000000..7aaacc4 Binary files /dev/null and b/images/company/seow/logo.png differ diff --git a/images/company/seow/logo_full.png b/images/company/seow/logo_full.png new file mode 100644 index 0000000..7aaacc4 Binary files /dev/null and b/images/company/seow/logo_full.png differ diff --git a/images/company_signature.jpg b/images/company_signature.jpg new file mode 100644 index 0000000..d057e72 Binary files /dev/null and b/images/company_signature.jpg differ diff --git a/images/ddui.png b/images/ddui.png new file mode 100644 index 0000000..89df8e1 Binary files /dev/null and b/images/ddui.png differ diff --git a/images/edit.png b/images/edit.png new file mode 100644 index 0000000..1c28bf9 Binary files /dev/null and b/images/edit.png differ diff --git a/images/fancybox_loading.gif b/images/fancybox_loading.gif new file mode 100644 index 0000000..a03a40c Binary files /dev/null and b/images/fancybox_loading.gif differ diff --git a/images/fancybox_loading@2x.gif b/images/fancybox_loading@2x.gif new file mode 100644 index 0000000..9205aeb Binary files /dev/null and b/images/fancybox_loading@2x.gif differ diff --git a/images/fancybox_overlay.png b/images/fancybox_overlay.png new file mode 100644 index 0000000..a439139 Binary files /dev/null and b/images/fancybox_overlay.png differ diff --git a/images/fancybox_sprite.png b/images/fancybox_sprite.png new file mode 100644 index 0000000..fd8d5ca Binary files /dev/null and b/images/fancybox_sprite.png differ diff --git a/images/fancybox_sprite@2x.png b/images/fancybox_sprite@2x.png new file mode 100644 index 0000000..d0e4779 Binary files /dev/null and b/images/fancybox_sprite@2x.png differ diff --git a/images/filetype/docx.png b/images/filetype/docx.png new file mode 100644 index 0000000..2a4d070 Binary files /dev/null and b/images/filetype/docx.png differ diff --git a/images/filetype/pdf.png b/images/filetype/pdf.png new file mode 100644 index 0000000..c072abd Binary files /dev/null and b/images/filetype/pdf.png differ diff --git a/images/filetype/ppt.png b/images/filetype/ppt.png new file mode 100644 index 0000000..8d30307 Binary files /dev/null and b/images/filetype/ppt.png differ diff --git a/images/filetype/xlsx.png b/images/filetype/xlsx.png new file mode 100644 index 0000000..03637af Binary files /dev/null and b/images/filetype/xlsx.png differ diff --git a/images/grid_bg.png b/images/grid_bg.png new file mode 100644 index 0000000..6b8e021 Binary files /dev/null and b/images/grid_bg.png differ diff --git a/images/helpers/fancybox_buttons.png b/images/helpers/fancybox_buttons.png new file mode 100644 index 0000000..0787207 Binary files /dev/null and b/images/helpers/fancybox_buttons.png differ diff --git a/images/helpers/jquery.fancybox-buttons.css b/images/helpers/jquery.fancybox-buttons.css new file mode 100644 index 0000000..a26273a --- /dev/null +++ b/images/helpers/jquery.fancybox-buttons.css @@ -0,0 +1,97 @@ +#fancybox-buttons { + position: fixed; + left: 0; + width: 100%; + z-index: 8050; +} + +#fancybox-buttons.top { + top: 10px; +} + +#fancybox-buttons.bottom { + bottom: 10px; +} + +#fancybox-buttons ul { + display: block; + width: 166px; + height: 30px; + margin: 0 auto; + padding: 0; + list-style: none; + border: 1px solid #111; + border-radius: 3px; + -webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); + -moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); + box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); + background: rgb(50,50,50); + background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51))); + background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); + background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); + background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); + background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 ); +} + +#fancybox-buttons ul li { + float: left; + margin: 0; + padding: 0; +} + +#fancybox-buttons a { + display: block; + width: 30px; + height: 30px; + text-indent: -9999px; + background-color: transparent; + background-image: url('fancybox_buttons.png'); + background-repeat: no-repeat; + outline: none; + opacity: 0.8; +} + +#fancybox-buttons a:hover { + opacity: 1; +} + +#fancybox-buttons a.btnPrev { + background-position: 5px 0; +} + +#fancybox-buttons a.btnNext { + background-position: -33px 0; + border-right: 1px solid #3e3e3e; +} + +#fancybox-buttons a.btnPlay { + background-position: 0 -30px; +} + +#fancybox-buttons a.btnPlayOn { + background-position: -30px -30px; +} + +#fancybox-buttons a.btnToggle { + background-position: 3px -60px; + border-left: 1px solid #111; + border-right: 1px solid #3e3e3e; + width: 35px +} + +#fancybox-buttons a.btnToggleOn { + background-position: -27px -60px; +} + +#fancybox-buttons a.btnClose { + border-left: 1px solid #111; + width: 35px; + background-position: -56px 0px; +} + +#fancybox-buttons a.btnDisabled { + opacity : 0.4; + cursor: default; +} \ No newline at end of file diff --git a/images/helpers/jquery.fancybox-buttons.js b/images/helpers/jquery.fancybox-buttons.js new file mode 100644 index 0000000..fd8b955 --- /dev/null +++ b/images/helpers/jquery.fancybox-buttons.js @@ -0,0 +1,122 @@ + /*! + * Buttons helper for fancyBox + * version: 1.0.5 (Mon, 15 Oct 2012) + * @requires fancyBox v2.0 or later + * + * Usage: + * $(".fancybox").fancybox({ + * helpers : { + * buttons: { + * position : 'top' + * } + * } + * }); + * + */ +(function ($) { + //Shortcut for fancyBox object + var F = $.fancybox; + + //Add helper object + F.helpers.buttons = { + defaults : { + skipSingle : false, // disables if gallery contains single image + position : 'top', // 'top' or 'bottom' + tpl : '
    ' + }, + + list : null, + buttons: null, + + beforeLoad: function (opts, obj) { + //Remove self if gallery do not have at least two items + + if (opts.skipSingle && obj.group.length < 2) { + obj.helpers.buttons = false; + obj.closeBtn = true; + + return; + } + + //Increase top margin to give space for buttons + obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30; + }, + + onPlayStart: function () { + if (this.buttons) { + this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn'); + } + }, + + onPlayEnd: function () { + if (this.buttons) { + this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn'); + } + }, + + afterShow: function (opts, obj) { + var buttons = this.buttons; + + if (!buttons) { + this.list = $(opts.tpl).addClass(opts.position).appendTo('body'); + + buttons = { + prev : this.list.find('.btnPrev').click( F.prev ), + next : this.list.find('.btnNext').click( F.next ), + play : this.list.find('.btnPlay').click( F.play ), + toggle : this.list.find('.btnToggle').click( F.toggle ), + close : this.list.find('.btnClose').click( F.close ) + } + } + + //Prev + if (obj.index > 0 || obj.loop) { + buttons.prev.removeClass('btnDisabled'); + } else { + buttons.prev.addClass('btnDisabled'); + } + + //Next / Play + if (obj.loop || obj.index < obj.group.length - 1) { + buttons.next.removeClass('btnDisabled'); + buttons.play.removeClass('btnDisabled'); + + } else { + buttons.next.addClass('btnDisabled'); + buttons.play.addClass('btnDisabled'); + } + + this.buttons = buttons; + + this.onUpdate(opts, obj); + }, + + onUpdate: function (opts, obj) { + var toggle; + + if (!this.buttons) { + return; + } + + toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn'); + + //Size toggle button + if (obj.canShrink) { + toggle.addClass('btnToggleOn'); + + } else if (!obj.canExpand) { + toggle.addClass('btnDisabled'); + } + }, + + beforeClose: function () { + if (this.list) { + this.list.remove(); + } + + this.list = null; + this.buttons = null; + } + }; + +}(jQuery)); diff --git a/images/helpers/jquery.fancybox-media.js b/images/helpers/jquery.fancybox-media.js new file mode 100644 index 0000000..3584c8a --- /dev/null +++ b/images/helpers/jquery.fancybox-media.js @@ -0,0 +1,199 @@ +/*! + * Media helper for fancyBox + * version: 1.0.6 (Fri, 14 Jun 2013) + * @requires fancyBox v2.0 or later + * + * Usage: + * $(".fancybox").fancybox({ + * helpers : { + * media: true + * } + * }); + * + * Set custom URL parameters: + * $(".fancybox").fancybox({ + * helpers : { + * media: { + * youtube : { + * params : { + * autoplay : 0 + * } + * } + * } + * } + * }); + * + * Or: + * $(".fancybox").fancybox({, + * helpers : { + * media: true + * }, + * youtube : { + * autoplay: 0 + * } + * }); + * + * Supports: + * + * Youtube + * http://www.youtube.com/watch?v=opj24KnzrWo + * http://www.youtube.com/embed/opj24KnzrWo + * http://youtu.be/opj24KnzrWo + * http://www.youtube-nocookie.com/embed/opj24KnzrWo + * Vimeo + * http://vimeo.com/40648169 + * http://vimeo.com/channels/staffpicks/38843628 + * http://vimeo.com/groups/surrealism/videos/36516384 + * http://player.vimeo.com/video/45074303 + * Metacafe + * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/ + * http://www.metacafe.com/watch/7635964/ + * Dailymotion + * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people + * Twitvid + * http://twitvid.com/QY7MD + * Twitpic + * http://twitpic.com/7p93st + * Instagram + * http://instagr.am/p/IejkuUGxQn/ + * http://instagram.com/p/IejkuUGxQn/ + * Google maps + * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17 + * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 + * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56 + */ +(function ($) { + "use strict"; + + //Shortcut for fancyBox object + var F = $.fancybox, + format = function( url, rez, params ) { + params = params || ''; + + if ( $.type( params ) === "object" ) { + params = $.param(params, true); + } + + $.each(rez, function(key, value) { + url = url.replace( '$' + key, value || '' ); + }); + + if (params.length) { + url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params; + } + + return url; + }; + + //Add helper object + F.helpers.media = { + defaults : { + youtube : { + matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i, + params : { + autoplay : 1, + autohide : 1, + fs : 1, + rel : 0, + hd : 1, + wmode : 'opaque', + enablejsapi : 1 + }, + type : 'iframe', + url : '//www.youtube.com/embed/$3' + }, + vimeo : { + matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/, + params : { + autoplay : 1, + hd : 1, + show_title : 1, + show_byline : 1, + show_portrait : 0, + fullscreen : 1 + }, + type : 'iframe', + url : '//player.vimeo.com/video/$1' + }, + metacafe : { + matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/, + params : { + autoPlay : 'yes' + }, + type : 'swf', + url : function( rez, params, obj ) { + obj.swf.flashVars = 'playerVars=' + $.param( params, true ); + + return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf'; + } + }, + dailymotion : { + matcher : /dailymotion.com\/video\/(.*)\/?(.*)/, + params : { + additionalInfos : 0, + autoStart : 1 + }, + type : 'swf', + url : '//www.dailymotion.com/swf/video/$1' + }, + twitvid : { + matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i, + params : { + autoplay : 0 + }, + type : 'iframe', + url : '//www.twitvid.com/embed.php?guid=$1' + }, + twitpic : { + matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i, + type : 'image', + url : '//twitpic.com/show/full/$1/' + }, + instagram : { + matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, + type : 'image', + url : '//$1/p/$2/media/?size=l' + }, + google_maps : { + matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i, + type : 'iframe', + url : function( rez ) { + return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed'); + } + } + }, + + beforeLoad : function(opts, obj) { + var url = obj.href || '', + type = false, + what, + item, + rez, + params; + + for (what in opts) { + if (opts.hasOwnProperty(what)) { + item = opts[ what ]; + rez = url.match( item.matcher ); + + if (rez) { + type = item.type; + params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null)); + + url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params ); + + break; + } + } + } + + if (type) { + obj.href = url; + obj.type = type; + + obj.autoHeight = false; + } + } + }; + +}(jQuery)); \ No newline at end of file diff --git a/images/helpers/jquery.fancybox-thumbs.css b/images/helpers/jquery.fancybox-thumbs.css new file mode 100644 index 0000000..63d2943 --- /dev/null +++ b/images/helpers/jquery.fancybox-thumbs.css @@ -0,0 +1,55 @@ +#fancybox-thumbs { + position: fixed; + left: 0; + width: 100%; + overflow: hidden; + z-index: 8050; +} + +#fancybox-thumbs.bottom { + bottom: 2px; +} + +#fancybox-thumbs.top { + top: 2px; +} + +#fancybox-thumbs ul { + position: relative; + list-style: none; + margin: 0; + padding: 0; +} + +#fancybox-thumbs ul li { + float: left; + padding: 1px; + opacity: 0.5; +} + +#fancybox-thumbs ul li.active { + opacity: 0.75; + padding: 0; + border: 1px solid #fff; +} + +#fancybox-thumbs ul li:hover { + opacity: 1; +} + +#fancybox-thumbs ul li a { + display: block; + position: relative; + overflow: hidden; + border: 1px solid #222; + background: #111; + outline: none; +} + +#fancybox-thumbs ul li img { + display: block; + position: relative; + border: 0; + padding: 0; + max-width: none; +} \ No newline at end of file diff --git a/images/helpers/jquery.fancybox-thumbs.js b/images/helpers/jquery.fancybox-thumbs.js new file mode 100644 index 0000000..5db3d4a --- /dev/null +++ b/images/helpers/jquery.fancybox-thumbs.js @@ -0,0 +1,162 @@ + /*! + * Thumbnail helper for fancyBox + * version: 1.0.7 (Mon, 01 Oct 2012) + * @requires fancyBox v2.0 or later + * + * Usage: + * $(".fancybox").fancybox({ + * helpers : { + * thumbs: { + * width : 50, + * height : 50 + * } + * } + * }); + * + */ +(function ($) { + //Shortcut for fancyBox object + var F = $.fancybox; + + //Add helper object + F.helpers.thumbs = { + defaults : { + width : 50, // thumbnail width + height : 50, // thumbnail height + position : 'bottom', // 'top' or 'bottom' + source : function ( item ) { // function to obtain the URL of the thumbnail image + var href; + + if (item.element) { + href = $(item.element).find('img').attr('src'); + } + + if (!href && item.type === 'image' && item.href) { + href = item.href; + } + + return href; + } + }, + + wrap : null, + list : null, + width : 0, + + init: function (opts, obj) { + var that = this, + list, + thumbWidth = opts.width, + thumbHeight = opts.height, + thumbSource = opts.source; + + //Build list structure + list = ''; + + for (var n = 0; n < obj.group.length; n++) { + list += '
  • '; + } + + this.wrap = $('
    ').addClass(opts.position).appendTo('body'); + this.list = $('
      ' + list + '
    ').appendTo(this.wrap); + + //Load each thumbnail + $.each(obj.group, function (i) { + var href = thumbSource( obj.group[ i ] ); + + if (!href) { + return; + } + + $("").load(function () { + var width = this.width, + height = this.height, + widthRatio, heightRatio, parent; + + if (!that.list || !width || !height) { + return; + } + + //Calculate thumbnail width/height and center it + widthRatio = width / thumbWidth; + heightRatio = height / thumbHeight; + + parent = that.list.children().eq(i).find('a'); + + if (widthRatio >= 1 && heightRatio >= 1) { + if (widthRatio > heightRatio) { + width = Math.floor(width / heightRatio); + height = thumbHeight; + + } else { + width = thumbWidth; + height = Math.floor(height / widthRatio); + } + } + + $(this).css({ + width : width, + height : height, + top : Math.floor(thumbHeight / 2 - height / 2), + left : Math.floor(thumbWidth / 2 - width / 2) + }); + + parent.width(thumbWidth).height(thumbHeight); + + $(this).hide().appendTo(parent).fadeIn(300); + + }).attr('src', href); + }); + + //Set initial width + this.width = this.list.children().eq(0).outerWidth(true); + + this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))); + }, + + beforeLoad: function (opts, obj) { + //Remove self if gallery do not have at least two items + if (obj.group.length < 2) { + obj.helpers.thumbs = false; + + return; + } + + //Increase bottom margin to give space for thumbs + obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15); + }, + + afterShow: function (opts, obj) { + //Check if exists and create or update list + if (this.list) { + this.onUpdate(opts, obj); + + } else { + this.init(opts, obj); + } + + //Set active element + this.list.children().removeClass('active').eq(obj.index).addClass('active'); + }, + + //Center list + onUpdate: function (opts, obj) { + if (this.list) { + this.list.stop(true).animate({ + 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)) + }, 150); + } + }, + + beforeClose: function () { + if (this.wrap) { + this.wrap.remove(); + } + + this.wrap = null; + this.list = null; + this.width = 0; + } + } + +}(jQuery)); \ No newline at end of file diff --git a/images/icon_top.png b/images/icon_top.png new file mode 100644 index 0000000..9f0bf04 Binary files /dev/null and b/images/icon_top.png differ diff --git a/images/indicator.gif b/images/indicator.gif new file mode 100644 index 0000000..abe430d Binary files /dev/null and b/images/indicator.gif differ diff --git a/images/lazy_load_loading.gif b/images/lazy_load_loading.gif new file mode 100644 index 0000000..6380dd7 Binary files /dev/null and b/images/lazy_load_loading.gif differ diff --git a/images/load.gif b/images/load.gif new file mode 100644 index 0000000..c60ee17 Binary files /dev/null and b/images/load.gif differ diff --git a/images/loading.gif b/images/loading.gif new file mode 100644 index 0000000..e092d81 Binary files /dev/null and b/images/loading.gif differ diff --git a/images/location.png b/images/location.png new file mode 100644 index 0000000..5336c59 Binary files /dev/null and b/images/location.png differ diff --git a/images/mbui.png b/images/mbui.png new file mode 100644 index 0000000..007d4fe Binary files /dev/null and b/images/mbui.png differ diff --git a/images/new_order.jpg b/images/new_order.jpg new file mode 100644 index 0000000..1eaac1b Binary files /dev/null and b/images/new_order.jpg differ diff --git a/images/noimage.jpg b/images/noimage.jpg new file mode 100644 index 0000000..cc4381a Binary files /dev/null and b/images/noimage.jpg differ diff --git a/images/pdf.png b/images/pdf.png new file mode 100644 index 0000000..01b1508 Binary files /dev/null and b/images/pdf.png differ diff --git a/images/pdf_background.jpg b/images/pdf_background.jpg new file mode 100644 index 0000000..f3741c6 Binary files /dev/null and b/images/pdf_background.jpg differ diff --git a/images/pdf_background_top.jpg b/images/pdf_background_top.jpg new file mode 100644 index 0000000..5466260 Binary files /dev/null and b/images/pdf_background_top.jpg differ diff --git a/images/pdf_signature.jpg b/images/pdf_signature.jpg new file mode 100644 index 0000000..264db07 Binary files /dev/null and b/images/pdf_signature.jpg differ diff --git a/images/quotation_pdf.png b/images/quotation_pdf.png new file mode 100644 index 0000000..8e294a7 Binary files /dev/null and b/images/quotation_pdf.png differ diff --git a/images/sb.png b/images/sb.png new file mode 100644 index 0000000..f7b5fbb Binary files /dev/null and b/images/sb.png differ diff --git a/images/square_tick.jpg b/images/square_tick.jpg new file mode 100644 index 0000000..dfbf68a Binary files /dev/null and b/images/square_tick.jpg differ diff --git a/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/images/ui-bg_highlight-soft_100_eeeeee_1x100.png new file mode 100644 index 0000000..f127367 Binary files /dev/null and b/images/ui-bg_highlight-soft_100_eeeeee_1x100.png differ diff --git a/images/ui-icons_444444_256x240.png b/images/ui-icons_444444_256x240.png new file mode 100644 index 0000000..19f664d Binary files /dev/null and b/images/ui-icons_444444_256x240.png differ diff --git a/images/ui-icons_555555_256x240.png b/images/ui-icons_555555_256x240.png new file mode 100644 index 0000000..e965f6d Binary files /dev/null and b/images/ui-icons_555555_256x240.png differ diff --git a/images/ui-icons_777620_256x240.png b/images/ui-icons_777620_256x240.png new file mode 100644 index 0000000..9785948 Binary files /dev/null and b/images/ui-icons_777620_256x240.png differ diff --git a/images/ui-icons_777777_256x240.png b/images/ui-icons_777777_256x240.png new file mode 100644 index 0000000..323c456 Binary files /dev/null and b/images/ui-icons_777777_256x240.png differ diff --git a/images/ui-icons_cc0000_256x240.png b/images/ui-icons_cc0000_256x240.png new file mode 100644 index 0000000..45ac778 Binary files /dev/null and b/images/ui-icons_cc0000_256x240.png differ diff --git a/images/ui-icons_ffffff_256x240.png b/images/ui-icons_ffffff_256x240.png new file mode 100644 index 0000000..fe41d2d Binary files /dev/null and b/images/ui-icons_ffffff_256x240.png differ diff --git a/images/user.jpg b/images/user.jpg new file mode 100644 index 0000000..4ce5d89 Binary files /dev/null and b/images/user.jpg differ diff --git a/images/user_profile.png b/images/user_profile.png new file mode 100644 index 0000000..3ed3368 Binary files /dev/null and b/images/user_profile.png differ diff --git a/images/white.jpg b/images/white.jpg new file mode 100644 index 0000000..c283018 Binary files /dev/null and b/images/white.jpg differ diff --git a/import-excel.php b/import-excel.php new file mode 100644 index 0000000..3e72b28 --- /dev/null +++ b/import-excel.php @@ -0,0 +1,152 @@ +load($inputFileName); //Loading the file + } catch (Exception $e) { + die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) + . '": ' . $e->getMessage()); + } + + // Get worksheet dimensions + $sheet = $objPHPExcel->getSheet(0); //Selecting sheet 0 + $highestRow = $sheet->getHighestRow(); //Getting number of rows + //$highestRow = 5; //Getting number of rows + $highestColumn = $sheet->getHighestColumn(); //Getting number of columns + + $crow = 0; + + //initial array + $certain_pic_fail = $pic_fail = $area_fail = $profile_fail = array(); + $success_count = 0; + $array_error = []; + + // Loop through each row of the worksheet in turn -> $row is for starting point + for ($row = 2; $row <= $highestRow; $row++) { + // Read a row of data into an array + $rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, + NULL, TRUE, FALSE); + + if($rowData[0][0] != ''){ + //gender + if($rowData[0][3]!= ''){ + $select_gender = $mysqli->query("SELECT gender_id FROM master_gender WHERE gender_desc = '".$rowData[0][3]."' LIMIT 1"); + $gender_id = $select_gender->fetch_assoc()['gender_id']; + }else{ + $gender_id = 0; + } + + //calculate probation end date + if($rowData[0][7] != ""){ + if($rowData[0][4] != ''){ + $start_date = date('Y-m-d', $rowData[0][4]); + $end_date = date('Y-m-d', strtotime("+".$rowData[0][7]." month", $start_date)); + } + } + + //detect working type + if($rowData[0][10] != ''){ + $select_working_group = $mysqli->query("SELECT * FROM setting_working_group WHERE group_name = '".$rowData[0][10]."'"); + $working_group_id = $select_working_group->fetch_assoc()['group_id']; + }else{ + $working_group_id = 0; + } + + $staff_idno = $rowData[0][0]; + $staff_fullname = $mysqli->real_escape_string($rowData[0][1]); + $staff_username = $rowData[0][2]; + $staff_password = passwordEncrypt($rowData[0][0]); + $staff_gender = $gender_id; + $staff_join_date = $rowData[0][4] != '' ? date('Y-m-d', ($rowData[0][4] - 25569)*86400) : ''; + $staff_confirm_date = $rowData[0][5] != '' ? date('Y-m-d', ($rowData[0][5]- 25569)*86400) : NULL; + $staff_terminate_date = $rowData[0][6] != '' ? date('Y-m-d', ($rowData[0][6]- 25569)*86400) : NULL; + $staff_probation = $end_date; + $staff_email = $rowData[0][8]; + $staff_mobile = $rowData[0][9]; + $staff_working_type = $working_group_id; + + $result = false; + if($mysqli->query("INSERT INTO staff (staff_idno, staff_name, staff_email, staff_username, staff_password, staff_mobileno, gender_id, staff_date_joined, staff_date_confirmed, staff_date_resigned, staff_probation_end, group_id, created_at) VALUES('".$staff_idno."', '".$staff_fullname."', '".$staff_email."', '".$staff_username."', '".$staff_password."', '".$staff_mobile."', '".$staff_gender."', '".$staff_join_date."', '".$staff_confirm_date."', '".$staff_terminate_date."', '".$staff_probation."', '".$staff_working_type."', '".TODAYDATE."')")){ + + $result = true; + } + + if(!$result){ + $array_error[] = $row; + } + } + } + + } +} + +if(arrayCheck($array_error)){ + echo (implode(",", $array_error)); +}else{ + echo ("SUCCESS"); +} +?> + + + +
    + +
    + + \ No newline at end of file diff --git a/import-full-attendance.php b/import-full-attendance.php new file mode 100644 index 0000000..43a9536 --- /dev/null +++ b/import-full-attendance.php @@ -0,0 +1,262 @@ +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; +} + + +$active_main_menu = 'import' ; +$active_sub_menu = 'import-full-attendance' ; +$active_menu = 'import-full-attendance' ; + +$date_time = escapeString($_GET['date_time']) ; +$date_current = TODAYDAY ; +$date_time = ( $date_time != '' ? $date_time : date('Y-m', strtotime($date_current)) ) ; +$date_time_day = $date_time.'-01' ; + +$staff_all = [] ; +$mysqli_staff = $mysqli->query("SELECT staff_idno, staff_id, branch_id FROM staff WHERE deleted_at IS NULL" . $user_branch_permission_sql) ; +if ( $mysqli_staff->num_rows > 0 ){ + while($row_staff = $mysqli_staff->fetch_array(MYSQLI_ASSOC)){ + $staff_all[$row_staff['staff_idno']] = $row_staff ; + } +} + +if(isset($_FILES['import-excel']['name'])){ + + include 'PhpExcel/PHPExcel.php' ; + + $file_name = $_FILES['import-excel']['name']; + $ext = pathinfo($file_name, PATHINFO_EXTENSION); + + //Checking the file extension + if($ext == "xlsx"){ + $file_name = $_FILES['import-excel']['tmp_name']; + $inputFileName = $file_name; + + /**********************PHPExcel Script to Read Excel File**********************/ + // Read your Excel workbook + try { + $inputFileType = PHPExcel_IOFactory::identify($inputFileName); //Identify the file + $objReader = PHPExcel_IOFactory::createReader($inputFileType); //Creating the reader + $objPHPExcel = $objReader->load($inputFileName); //Loading the file + } catch (Exception $e) { + die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) + . '": ' . $e->getMessage()); + header("location: hr-staff.php?page_mode=staff-attendance&result=error&msg=".urlencode($e->getMessage())); + exit; + } + // ################################################################################## + // Setting excel + // ################################################################################## + $sheet1 = $objPHPExcel->getSheet(0); //Selecting sheet 0 + $highestRow1 = $sheet1->getHighestRow(); //Getting number of rows + $highestColumn1 = $sheet1->getHighestColumn(); //Getting number of columns + // Loop through each row of the worksheet in turn -> $row is for starting point + for ( $row = 2; $row <= $highestRow1; $row++ ) { + // Read a row of data into an array + $rowData = $sheet1->rangeToArray('A' . $row . ':' . $highestColumn1 . $row, NULL, TRUE, FALSE); + $rowData2[] = $rowData[0] ; + } + + if( isset($rowData2) ){ + + $update_branchid = '' ; + $error_stafflist = [] ; + $error_staff = 0 ; + $update_list = [] ; + foreach ( $rowData2 as $rowData2data ){ + + if ( $rowData2data[0] != '' ){ + + $get_staff = $staff_all[$rowData2data[0]] ; + $staff_id = $get_staff['staff_id'] ; + $staff_idno = $get_staff['staff_idno'] ; + + if ( $get_staff != null && $get_staff['branch_id'] == $_SESSION['url_get_branch_admin'] ){ + + $atten_date = fromExcelToLinux($atten_date) ; + + $update_list[] = $staff_id ; + + }else{ + $error_staff++ ; + $error_stafflist[] = $rowData2data[0] ; + } + } + } + + + if ( $error_staff == 0 ){ + + $mysqli->query( "DELETE FROM `staff_attendance_manual` WHERE branch_id = '".$_SESSION['url_get_branch_admin']."' AND attendance_date = '".$date_time_day."'" ) ; + + foreach ( $update_list as $kstaff => $vstaff ){ + $mysqli->query( "INSERT INTO staff_attendance_manual + ( `branch_id`, `staff_id`, `attendance_date` ) VALUES + ( '".$_SESSION['url_get_branch_admin']."', '".$vstaff."', '".$date_time_day."' )" ) ; + } + + $redirect_url = '?&date_time='.$date_time.'&result=success&msg=Import Successful' ; + + }else{ + $redirect_url = '?&date_time='.$date_time.'&result=error&date_time&msg=Some of the Staff not exists or invalid branch ( '.implode(', ', $error_stafflist).' )' ; + } + + }else{ + $redirect_url = '&date_time='.$date_time.'&result=error&msg=Failed to Import' ; + } + + header( "Location: ".$redirect_url ) ; + exit; + } +} + + +// select query +$mysqli_page = $mysqli->query( "SELECT b.staff_idno, b.staff_name, a.updated_at FROM staff_attendance_manual a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.branch_id = '".$_SESSION['url_get_branch_admin']."' AND a.attendance_date = '".$date_time_day."'" ) ; + + + + + +$result = $_GET['result']; +$msg = $_GET['msg']; +if ($result == 'error') { + $display_error = '
    '.$msg.'
    ' ; +}elseif ($result == 'success') { + $display_error = '
    '.$msg.'
    ' ; +} + +include 'requires/page_header.php'; +include 'requires/page_top.php'; +?> + + + +
    + + +
    +
    + Import Excel File + Download Sample +
    +
    + +
    +
    + +
    + + +
    + + + +
    + + = date('Y-m', strtotime(TODAYDAY)) ){}else{ + ?> + + +
    + +
    +
    + +
     
    +
     
    + +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
    Staff IDNameDate
    '.$row_page['staff_idno'].''.$row_page['staff_name'].''.resetDateFormat($row_page['updated_at']).'
    '.$lang['no_data'].'
    + +
    +
    +
    +
    +
    + +
    + + + + \ No newline at end of file diff --git a/import-lateness-board.php b/import-lateness-board.php new file mode 100644 index 0000000..0ffc6b4 --- /dev/null +++ b/import-lateness-board.php @@ -0,0 +1,279 @@ +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; +} + +$active_main_menu = 'import' ; +$active_sub_menu = 'import-lateness-board' ; +$active_menu = 'import-lateness-board' ; + + +$staff_all = [] ; +$mysqli_staff = $mysqli->query("SELECT staff_idno, staff_id, branch_id FROM staff WHERE deleted_at IS NULL" . $user_branch_permission_sql) ; +if ( $mysqli_staff->num_rows > 0 ){ + while($row_staff = $mysqli_staff->fetch_array(MYSQLI_ASSOC)){ + $staff_all[$row_staff['staff_idno']] = $row_staff ; + } +} + +if(isset($_FILES['import-excel']['name'])){ + $redirect_url = '' ; + + include 'PhpExcel/PHPExcel.php' ; + + $file_name = $_FILES['import-excel']['name']; + $ext = pathinfo($file_name, PATHINFO_EXTENSION); + + //Checking the file extension + if($ext == "xlsx"){ + $file_name = $_FILES['import-excel']['tmp_name']; + $inputFileName = $file_name; + + /**********************PHPExcel Script to Read Excel File**********************/ + // Read your Excel workbook + try { + $inputFileType = PHPExcel_IOFactory::identify($inputFileName); //Identify the file + $objReader = PHPExcel_IOFactory::createReader($inputFileType); //Creating the reader + $objPHPExcel = $objReader->load($inputFileName); //Loading the file + } catch (Exception $e) { + die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) + . '": ' . $e->getMessage()); + header("location: ?result=error&msg=".urlencode($e->getMessage())); + exit; + } + // ################################################################################## + // Setting excel + // ################################################################################## + $sheet1 = $objPHPExcel->getSheet(0); //Selecting sheet 0 + $highestRow1 = $sheet1->getHighestRow(); //Getting number of rows + $highestColumn1 = $sheet1->getHighestColumn(); //Getting number of columns + // Loop through each row of the worksheet in turn -> $row is for starting point + for ( $row = 2; $row <= $highestRow1; $row++ ) { + // Read a row of data into an array + $rowData = $sheet1->rangeToArray('A' . $row . ':' . $highestColumn1 . $row, NULL, TRUE, FALSE); + $rowData2[] = $rowData[0] ; + } + + if( isset($rowData2) ){ + + $error_typelist = [] ; + $error_type = 0 ; + $error_stafflist = [] ; + $error_staff = 0 ; + $update_list = [] ; + foreach ( $rowData2 as $kk => $vv ) { + if ( $vv[0] != '' ){ + $get_staff = $staff_all[$vv[0]] ; + if ( $get_staff != null && $get_staff['branch_id'] == $_SESSION['url_get_branch_admin'] ){ + if ( $vv[1] == 'late' || $vv[1] == 'absent' ){ + $update_list[] = [ + 'staff_id' => $get_staff['staff_id'], + 'type' => $vv[1], + 'times' => $vv[2] + ] ; + }else{ + $error_type++ ; + $error_typelist[] = $vv[1] ; + } + }else{ + $error_staff++ ; + $error_stafflist[] = $vv[0] ; + } + } + } + + if ( $error_staff == 0 ){ + if ( $error_type == 0 ){ + + $staff_ids = '' ; + $related_staff = $mysqli->query( "SELECT GROUP_CONCAT( a.staff_id ) AS staff_ids FROM staff_attendance_summary a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL " . $user_branch_permission_sql_b ) ; + if ( $related_staff->num_rows > 0 ){ + $row_related = $related_staff->fetch_assoc() ; + $staff_ids = $row_related['staff_ids'] ; + } + + $mysqli->query( "UPDATE staff_attendance_summary + SET deleted_at = '".TODAYDATE."' + WHERE staff_id IN ( ".$staff_ids." ) AND type IN ( 'late', 'absent' )" ) ; + + foreach ( $update_list as $k => $v ){ + $mysqli->query( "INSERT INTO staff_attendance_summary + ( `staff_id`, `type`, `times`, `created_at`, `updated_at` ) VALUES + ( '".$v['staff_id']."', '".$v['type']."', '".$v['times']."', '".TODAYDATE."', '".TODAYDATE."' )" ) ; + } + + pushToBranchUser( [ $_SESSION['url_get_branch_admin'] ], [], 'lateness-board', '', 'Lateness Board Announced', 'The latest of lateness board has been announced' ) ; + + $redirect_url = '?result=success&msg=Import Successful' ; + }else{ + $redirect_url = '?result=error&msg=Some of type invalid ( '.implode(', ', $error_typelist).' )' ; + } + }else{ + $redirect_url = '?result=error&msg=Some of the Staff not exists or invalid branch ( '.implode(', ', $error_stafflist).' )' ; + } + }else{ + $redirect_url = '?result=error&msg=Something got ERROR' ; + } + } + + header( "Location: " . $redirect_url ) ; + exit ; +} + +// form submit +if ($_POST['hide'] == '1' && $_POST['hide_status'] == 'action'){ + // trash item + switch($_POST['page_action']){ + case 'trash': + $mysqli_query = "UPDATE staff_attendance_summary SET deleted_at = '".TODAYDATE."' WHERE attendance_summary_id = " ; + $trash_page = trashPage('staff_attendance_summary', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } +} + +$search_query = ''; + +// page query +$mysqli_query = "SELECT a.attendance_summary_id, a.type, a.times, b.staff_idno FROM staff_attendance_summary a + LEFT JOIN staff b ON (a.staff_id = b.staff_id) + WHERE a.deleted_at IS NULL AND type IN ( 'late', 'absent' ) " . $search_query .$user_branch_permission_sql_b ; + +// pagination +if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) +$start_from = ($product_page - 1) * LIMIT ; //end next and prev page + +// set search url +$search_url = 'search='.$search.'&search_staff_idno='.$search_staff_idno.'&search_type='.$search_type.'&page_mode=staff-attendance' ; + +$mysqli_page = $mysqli->query($mysqli_query." LIMIT $start_from, " . LIMIT) ; + + // load pagination +$page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + +$result = $_GET['result']; +$msg = $_GET['msg']; +if ($result == 'error') { + $display_error = '
    '.$msg.'
    '; +}elseif ($result == 'success') { + $display_error = '
    '.$msg.'
    '; +} + +include 'requires/page_header.php'; +include 'requires/page_top.php'; +?> + + + +
    + + + +
    +
    + Import Excel File + Download Sample +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + +
    + + +
    +
    + + + + +
    +
    + + +
    +
    +
    + + + + + + + + + + + num_rows > 0 ){ + while( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['staff_id'] ; + + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
    '.dataFilter($row_page['staff_idno']).''.dataFilter($row_page['type']).''.dataFilter($row_page['times']).' +
    + + +
    +
    '.$lang['no_data'].'
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/import-outstanding-employee.php b/import-outstanding-employee.php new file mode 100644 index 0000000..88fd1c3 --- /dev/null +++ b/import-outstanding-employee.php @@ -0,0 +1,275 @@ +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; +} + +$active_main_menu = 'import' ; +$active_sub_menu = 'import-outstanding-employee' ; +$active_menu = 'import-outstanding-employee' ; + + +$staff_all = [] ; +$mysqli_staff = $mysqli->query("SELECT staff_idno, staff_id, branch_id FROM staff WHERE deleted_at IS NULL" . $user_branch_permission_sql) ; +if ( $mysqli_staff->num_rows > 0 ){ + while($row_staff = $mysqli_staff->fetch_array(MYSQLI_ASSOC)){ + $staff_all[$row_staff['staff_idno']] = $row_staff ; + } +} + +if(isset($_FILES['import-excel']['name'])){ + $redirect_url = '' ; + + include 'PhpExcel/PHPExcel.php' ; + + $file_name = $_FILES['import-excel']['name']; + $ext = pathinfo($file_name, PATHINFO_EXTENSION); + + //Checking the file extension + if($ext == "xlsx"){ + $file_name = $_FILES['import-excel']['tmp_name']; + $inputFileName = $file_name; + + /**********************PHPExcel Script to Read Excel File**********************/ + // Read your Excel workbook + try { + $inputFileType = PHPExcel_IOFactory::identify($inputFileName); //Identify the file + $objReader = PHPExcel_IOFactory::createReader($inputFileType); //Creating the reader + $objPHPExcel = $objReader->load($inputFileName); //Loading the file + } catch (Exception $e) { + die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) + . '": ' . $e->getMessage()); + header("location: ?result=error&msg=".urlencode($e->getMessage())); + exit; + } + // ################################################################################## + // Setting excel + // ################################################################################## + $sheet1 = $objPHPExcel->getSheet(0); //Selecting sheet 0 + $highestRow1 = $sheet1->getHighestRow(); //Getting number of rows + $highestColumn1 = $sheet1->getHighestColumn(); //Getting number of columns + // Loop through each row of the worksheet in turn -> $row is for starting point + for ( $row = 2; $row <= $highestRow1; $row++ ) { + // Read a row of data into an array + $rowData = $sheet1->rangeToArray('A' . $row . ':' . $highestColumn1 . $row, NULL, TRUE, FALSE); + $rowData2[] = $rowData[0] ; + } + + if( isset($rowData2) ){ + + $error_type = 0 ; + $error_staff = 0 ; + $update_list = [] ; + foreach ( $rowData2 as $kk => $vv ) { + if ( $vv[0] != '' ){ + $get_staff = $staff_all[$vv[0]] ; + if ( $get_staff != null && $get_staff['branch_id'] == $_SESSION['url_get_branch_admin'] ){ + if ( $vv[1] == 'merit' || $vv[1] == 'passionate' ){ + $update_list[] = [ + 'staff_id' => $get_staff['staff_id'], + 'type' => $vv[1], + 'times' => $vv[2] + ] ; + }else{ + $error_type++ ; + } + }else{ + $error_staff++ ; + } + } + } + + if ( $error_staff == 0 ){ + if ( $error_type == 0 ){ + + $staff_ids = '' ; + $related_staff = $mysqli->query( "SELECT GROUP_CONCAT( a.staff_id ) AS staff_ids FROM staff_attendance_summary a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL " . $user_branch_permission_sql_b ) ; + if ( $related_staff->num_rows > 0 ){ + $row_related = $related_staff->fetch_assoc() ; + $staff_ids = $row_related['staff_ids'] ; + } + + $mysqli->query( "UPDATE staff_attendance_summary + SET deleted_at = '".TODAYDATE."' + WHERE staff_id IN ( ".$staff_ids." ) AND type IN ( 'merit', 'passionate' )" ) ; + + foreach ( $update_list as $k => $v ){ + $mysqli->query( "INSERT INTO staff_attendance_summary + ( `staff_id`, `type`, `times`, `created_at`, `updated_at` ) VALUES + ( '".$v['staff_id']."', '".$v['type']."', '".$v['times']."', '".TODAYDATE."', '".TODAYDATE."' )" ) ; + } + + pushToBranchUser( [ $_SESSION['url_get_branch_admin'] ], [], 'outstanding-employee', '', 'Outstanding Employee Announced', 'The latest of outstanding employee has been announced' ) ; + + $redirect_url = '?result=success&msg=Import Successful' ; + }else{ + $redirect_url = '?result=error&msg=Some of type invalid' ; + } + }else{ + $redirect_url = '?result=error&msg=Some of the Staff not exists or invalid branch' ; + } + }else{ + $redirect_url = '?result=error&msg=Something got ERROR' ; + } + } + + header( "Location: " . $redirect_url ) ; + exit ; +} + +// form submit +if ($_POST['hide'] == '1' && $_POST['hide_status'] == 'action'){ + // trash item + switch($_POST['page_action']){ + case 'trash': + $mysqli_query = "UPDATE staff_attendance_summary SET deleted_at = '".TODAYDATE."' WHERE attendance_summary_id = " ; + $trash_page = trashPage('staff_attendance_summary', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } +} + +$search_query = ''; + +// page query +$mysqli_query = "SELECT a.attendance_summary_id, a.type, a.times, b.staff_idno FROM staff_attendance_summary a + LEFT JOIN staff b ON (a.staff_id = b.staff_id) + WHERE a.deleted_at IS NULL AND type IN ( 'merit', 'passionate' ) " . $search_query .$user_branch_permission_sql_b ; + +// pagination +if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) +$start_from = ($product_page - 1) * LIMIT ; //end next and prev page + +// set search url +$search_url = 'search='.$search.'&search_staff_idno='.$search_staff_idno.'&search_type='.$search_type.'&page_mode=staff-attendance' ; + +$mysqli_page = $mysqli->query($mysqli_query." LIMIT $start_from, " . LIMIT) ; + + // load pagination +$page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + +$result = $_GET['result']; +$msg = $_GET['msg']; +if ($result == 'error') { + $display_error = '
    '.$msg.'
    '; +}elseif ($result == 'success') { + $display_error = '
    '.$msg.'
    '; +} + +include 'requires/page_header.php'; +include 'requires/page_top.php'; +?> + + + +
    + + + +
    +
    + Import Excel File + Download Sample +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + +
    + + +
    +
    + + + + +
    +
    + + +
    +
    +
    + + + + + + + + + + + num_rows > 0 ){ + while( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['staff_id'] ; + + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
    '.dataFilter($row_page['staff_idno']).''.dataFilter($row_page['type']).''.dataFilter($row_page['times']).' +
    + + +
    +
    '.$lang['no_data'].'
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/import-point.php b/import-point.php new file mode 100644 index 0000000..c39b4fe --- /dev/null +++ b/import-point.php @@ -0,0 +1,241 @@ +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; +} + + +$active_main_menu = 'import' ; +$active_sub_menu = 'import-point' ; +$active_menu = 'import-point' ; + +$staff_all = [] ; +$mysqli_staff = $mysqli->query("SELECT staff_idno, staff_id, branch_id FROM staff WHERE deleted_at IS NULL" . $user_branch_permission_sql) ; +if ( $mysqli_staff->num_rows > 0 ){ + while($row_staff = $mysqli_staff->fetch_array(MYSQLI_ASSOC)){ + $staff_all[$row_staff['staff_idno']] = $row_staff ; + } +} + +if(isset($_FILES['import-excel']['name'])){ + + include 'PhpExcel/PHPExcel.php' ; + + $file_name = $_FILES['import-excel']['name']; + $ext = pathinfo($file_name, PATHINFO_EXTENSION); + + //Checking the file extension + if($ext == "xlsx"){ + $file_name = $_FILES['import-excel']['tmp_name']; + $inputFileName = $file_name; + + /**********************PHPExcel Script to Read Excel File**********************/ + // Read your Excel workbook + try { + $inputFileType = PHPExcel_IOFactory::identify($inputFileName); //Identify the file + $objReader = PHPExcel_IOFactory::createReader($inputFileType); //Creating the reader + $objPHPExcel = $objReader->load($inputFileName); //Loading the file + } catch (Exception $e) { + die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) + . '": ' . $e->getMessage()); + header("location: hr-staff.php?page_mode=staff-attendance&result=error&msg=".urlencode($e->getMessage())); + exit; + } + // ################################################################################## + // Setting excel + // ################################################################################## + $sheet1 = $objPHPExcel->getSheet(0); //Selecting sheet 0 + $highestRow1 = $sheet1->getHighestRow(); //Getting number of rows + $highestColumn1 = $sheet1->getHighestColumn(); //Getting number of columns + // Loop through each row of the worksheet in turn -> $row is for starting point + for ( $row = 2; $row <= $highestRow1; $row++ ) { + // Read a row of data into an array + $rowData = $sheet1->rangeToArray('A' . $row . ':' . $highestColumn1 . $row, NULL, TRUE, FALSE); + $rowData2[] = $rowData[0] ; + } + + if( isset($rowData2) ){ + + $setting_point = $mysqli->query( "SELECT point_id, point_type FROM setting_point WHERE deleted_at IS NULL AND point_from = 'adjustment' AND point_type IN ( 'plus', 'minus' ) AND difficulty = 'normal'" ) ; + if ( $setting_point->num_rows > 0 ){ + $setting_point_list = [] ; + while ( $row_setting_point = $setting_point->fetch_assoc() ){ + $setting_point_list[$row_setting_point['point_type']] = $row_setting_point['point_id'] ; + } + + $update_branchid = '' ; + $error_stafflist = [] ; + $error_staff = 0 ; + $error_typelist = [] ; + $error_type = 0 ; + $update_list = [] ; + foreach ( $rowData2 as $rowData2data ){ + + if ( $rowData2data[0] != '' ){ + + $get_staff = $staff_all[$rowData2data[0]] ; + $staff_id = $get_staff['staff_id'] ; + $staff_idno = $get_staff['staff_idno'] ; + + $point_amount = $rowData2data['1'] ; + $point_type = ( $point_amount > 0 ? 'plus' : ( $point_amount < 0 ? 'minus' : '' ) ) ; + $remark = $rowData2data['2'] ; + + if ( $get_staff != null && $get_staff['branch_id'] == $_SESSION['url_get_branch_admin'] ){ + + if ( ( $point_type == 'plus' || $point_type == 'minus' ) && ( $point_amount < 0 || $point_amount > 0 ) ){ + + $update_list[$point_type][$point_amount][$remark][] = $staff_id ; + + $update_branchid = $get_staff['branch_id'] ; + + }else{ + $error_type++ ; + $error_typelist[] = $point_type ; + } + + }else{ + $error_staff++ ; + $error_stafflist[] = $rowData2data[0] ; + } + } + } + + + if ( $error_staff == 0 ){ + if ( $error_type == 0 ){ + + + + $array_setting_adjustment = [] ; + foreach ( [ 'plus', 'minus' ] as $k => $v ){ + + $select_setting = $mysqli->query( "SELECT adjustment_id FROM setting_adjustment + WHERE deleted_at IS NULL AND adjustment_site = 'system' AND adjustment_type = '".$v."' AND adjustment_mode = 'fixed' AND adjustment_scenario = 'import-point'" ) ; + if ( $select_setting->num_rows > 0 ){ + $row_setting = $select_setting->fetch_assoc() ; + $array_setting_adjustment[$v] = $row_setting['adjustment_id'] ; + }else{ + $mysqli->query( "INSERT INTO setting_adjustment + ( adjustment_site, adjustment_type, adjustment_mode ) VALUES + ( 'system', '".$v."', 'fixed' )" ) ; + $setting_adjustment_id = $mysqli->insert_id ; + $array_setting_adjustment[$v] = $setting_adjustment_id ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = 'System Import Point ( '.ucwords($v).' )' ; + + checkLangUpdate( 'setting_adjustment_translation', 'adjustment_id', $setting_adjustment_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + } + } + + foreach ( $update_list as $ktype => $vtype ){ + foreach ( $vtype as $kpoint => $vpoint ){ + foreach ( $vpoint as $kremark => $vremark ){ + + $setting_adjustment_id = $array_setting_adjustment[$ktype] ; + + if ( $mysqli->query( "INSERT INTO staff_adjustment + ( `adjustment_type`, `created_branch_id`, `created_by_userid`, `created_by`, `department_id`, `setting_adjustment_id`, `point`, `remark` ) VALUES + ( '".$ktype."', '".$update_branchid."', '".$_SESSION['system_id']."', '', '', '".$setting_adjustment_id."', '".$kpoint."', '".$kremark."' )" ) ){ + + $adjustment_id = $mysqli->insert_id ; + $adjustment_so = 'AD'.strPad( 6, $adjustment_id ) ; + $mysqli->query( "UPDATE staff_adjustment SET adjustment_so = '".$adjustment_so."' WHERE adjustment_id = '".$adjustment_id."'" ) ; + + foreach ( $vremark as $kstaff => $vstaff ){ + $mysqli->query( "INSERT INTO staff_adjustment_point ( `adjustment_id`, `setting_adjustment_id`, `staff_id`, `point` ) VALUES ( '".$adjustment_id."', '".$setting_adjustment_id."', '".$vstaff."', '".$kpoint."' )" ) ; + + pointMovement( 'adjustment', $adjustment_id, $ktype, 'normal', $vstaff, $kpoint, $kremark ) ; + pushToUserCron( 'staff_adjustment', $adjustment_id, $vstaff, 'Point Adjustment', $kremark ) ; + } + + } + + } + } + } + + $redirect_url = '?result=success&msg=Import Successful' ; + + }else{ + $redirect_url = '?result=error&msg=Some of type invalid ( '.implode(', ', $error_typelist).' )' ; + } + }else{ + $redirect_url = '?result=error&msg=Some of the Staff not exists or invalid branch ( '.implode(', ', $error_stafflist).' )' ; + } + + } + + }else{ + $redirect_url = '?result=error&msg=Failed to Import' ; + } + + header( "Location: ".$redirect_url ) ; + exit; + } +} + +$result = $_GET['result']; +$msg = $_GET['msg']; +if ($result == 'error') { + $display_error = '
    '.$msg.'
    ' ; +}elseif ($result == 'success') { + $display_error = '
    '.$msg.'
    ' ; +} + +include 'requires/page_header.php'; +include 'requires/page_top.php'; +?> + +
    + + + +
    +
    + Import Excel File + Download Sample +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + +
    + + + + \ No newline at end of file diff --git a/inbox.php b/inbox.php new file mode 100644 index 0000000..4de8b2e --- /dev/null +++ b/inbox.php @@ -0,0 +1,639 @@ +query("SELECT * FROM inbox + WHERE inbox_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + $title = escapeString($_POST['title']) ; + $description = escapeString($_POST['description']) ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO inbox ( user_id, created_at ) VALUES ( '".$row_user['user_id']."', '".TODAYDATE."' )") ; + $page = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ( $remove_photo == 1 ){ + $image = '' ; + $image_query = "file = '', + file_type = ''," ; + }else{ + if ( $image != '' ){ + $get_image = pathinfo($image) ; + if ( $get_image['extension'] == 'pdf' ){ + + $file_name = $page.'-'.time().'.pdf' ; + copy($_FILES["image"]["tmp_name"], 'uploads/Inbox/'.$file_name) ; + + $image_query= "file = '".$file_name."', + file_type = 'pdf'," ; + }else{ + $create_image = reCreateImage('Inbox', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + + $image_query = "file = '".$create_image['image']."', + file_type = '".$create_image['extension']."'," ; + } + } + } + } + + // delete all department & receiver + $receiver_type = dataFilter($_POST['receiver_type']) ; + $receiver_to = $_POST['receiver_to'] ; + $receiver_to_dept = $_POST['receiver_to_dept'] ; + + $selected_staff = [] ; + $selected_depart = [] ; + if ( $receiver_type == '1' ){ + + if( !empty( $receiver_to ) ){ + for ( $i = 0 ; $i < count($receiver_to) ; $i++ ){ + if ( $receiver_to[$i] != '' ){ + $reset_staff = $receiver_to[$i] ; + $selected_staff[$reset_staff] = $reset_staff ; + } + } + } + + }else{ + if( !empty( $receiver_to_dept ) ){ + $array_depart = [] ; + for ( $i = 0 ; $i < count($receiver_to_dept) ; $i++ ){ + + $department_id = $receiver_to_dept[$i] ; + if ( $department_id != '' ){ + + // save into department + $selected_depart[]= $department_id ; + + // check department staff + $reset_depart = str_replace( ['(', ')'], '', $department_id ) ; + $get_depart_staff = $mysqli->query( "SELECT staff_id FROM staff_department + WHERE deleted_at IS NULL AND department_id = '".$reset_depart."'") ; + if ( $get_depart_staff->num_rows > 0 ){ + while ( $row_depart_staff = $get_depart_staff->fetch_assoc() ){ + if ( !in_array($row_depart_staff['staff_id'], $array_depart) ){ + $array_depart[] = $row_depart_staff['staff_id'] ; + $selected_staff[$row_depart_staff['staff_id']] = $row_depart_staff['staff_id'] ; + } + } + } + + } + } + } + } + + $related_staff = $selected_staff ; + $selected_staff = ( arrayCheck($selected_staff) ? '/'.implode( '/', $selected_staff ).'/' : '' ) ; + $selected_depart = ( arrayCheck($selected_depart) ? '/'.implode( '/', $selected_depart ).'/' : '' ) ; + + // update database + $mysqli->query("UPDATE inbox SET + ".$image_query." + staff_id = '".$selected_staff."', + department_id = '".$selected_depart."', + receiver_type = '".escapeString($_POST['receiver_type'])."', + view_format = '".escapeString($_POST['view_format'])."', + title = '".$title."', + description = '".$description."', + content = '".escapeString($_POST['content'])."', + video_url = '".escapeString($_POST['video_url'])."' + WHERE inbox_id = '".$page."'") ; + + $mysqli->query( "UPDATE `staff_inbox_view` SET deleted_at = '".TODAYDATE."' WHERE inbox_id = '".$page."'" ) ; + foreach ( $related_staff as $k => $v ){ + pushToUserCron( 'inbox', $page, $v, $title, $description, $page ) ; + + $mysqli->query( "INSERT INTO staff_inbox_view ( inbox_id, staff_id, is_read ) VALUES ( '".$page."', '".$v."', '0' )" ) ; + } + + // refresh page + header("Location:inbox.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // get all requires + // get all staff + $staff_list = [] ; + $mysqli_staff = $mysqli->query("SELECT staff_id, staff_name, staff_idno FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL ".$user_branch_permission_sql . ( $get_user_tier['check'] ? " AND staff_tier IN ( ".implode(', ', $get_user_tier['tiers'])." )" : '' ) ) ; + if ( $mysqli_staff->num_rows > 0 ){ + while ( $row_staff = $mysqli_staff->fetch_assoc() ){ + $staff_list[$row_staff['staff_id']] = dataFilter($row_staff['staff_name']) . ' ( ' . dataFilter($row_staff['staff_idno']) . ' )' ; + } + } + + // get all requires + $department_list = [] ; + $mysqli_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; + if ( $mysqli_department->num_rows > 0 ){ + while ( $row_department = $mysqli_department->fetch_assoc() ){ + $department_list[$row_department['department_id']] = dataFilter($row_department['department_desc']) ; + } + } + + // get all selected staff & department + $receiver_staff = ( $row_page['staff_id'] != '' ? explode('/', $row_page['staff_id']) : [] ) ; + $receiver_depart = ( $row_page['department_id'] != '' ? explode('/', $row_page['department_id']) : [] ) ; + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + + +
    +
    + + '.$lang['Thank you details has been updated'].'
    ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
    +
    +
    +
    + +
    +
    To
    +
    + +
    +     + +
    + +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    Format
    +
    + + + +
    +
    +
    > +
    Message
    +
    + + +
    +
    +
    > +
    Video
    +
    + +
    +
    + +
    > +
    Photo
    +
    +
    +
    + + + +
    +
    +
    +
    +
    > +
    Preview
    +
    +  Remove + Download' ; + }else{ + echo ' + ' ; + } + ?> +
    +
    + + +
    +
    +
    + + + +
    +
    + + +
    +
    +
    +
    + + query( $mysqli_query." ORDER BY inbox_id LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
    +
    + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    + + +
    +
    + + + + +
    +
    + + +
    +
    +
    + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + $id = $row_page['inbox_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
    + + '.$title.''.dataFilter($row_page['description']).''.resetDateFormat($row_page['created_at']).' +
    + + +
    +
    '.$lang['no_data'].'
    + +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..d82f177 --- /dev/null +++ b/index.php @@ -0,0 +1,327 @@ +query("SELECT user_code, user_login_cookies FROM system_user + WHERE user_name = '".$user."' AND user_trash = '0' LIMIT 1") ; + // check if username exists + if ($mysqli_user->num_rows > 0){ + // set query in variable + $row_user = $mysqli_user->fetch_array(MYSQLI_ASSOC) ; + // encode password with md5 + code + $code = $row_user['user_code'] ; + $password = md5(md5($password).$code) ; + $login_cookies = $row_user['user_login_cookies'] ; + $login_cookies = (trim($login_cookies) != '' ? $login_cookies : rand(100000,999999)) ; + if ($system_login_cookies == $login_cookies && trim($system_login_cookies) != ''){ + $query = '' ; + $boolean_status = false ; + } + // check user login + $mysqli_user = $mysqli->query("SELECT user_id, user_name, user_fullname, user_code, user_permission, user_branch, user_verification_type, user_visit_count FROM system_user + WHERE user_name = '".$user."' AND user_password = '".$password."' ".$query." AND user_trash = '0' LIMIT 1") ; + // check if username exists + if ($mysqli_user->num_rows > 0){ + // set query in variable + $row_user = $mysqli_user->fetch_array(MYSQLI_ASSOC) ; + // user id + $user_id = $row_user['user_id'] ; + $user_code = $row_user['user_code'] ; + $visit_count = $row_user['user_visit_count'] ; + $user_verification_type = $row_user['user_verification_type'] ; + $visit_count++ ; + $get_client_ip = get_client_ip() ; + $get_user_agent = userAgent($_SERVER['HTTP_USER_AGENT']) ; + // get user last login coordinates + $latitude = escapeString($_POST['latitude']) ; + $longtitude = escapeString($_POST['longtitude']) ; + + // check status + if ($boolean_status){ + $_SESSION['system_temp_user_name'] = $user ; // name + $_SESSION['system_temp_password'] = $password2 ; // password + $_SESSION['system_temp_remember'] = $remember ; // remember me + $_SESSION['system_temp_access'] = 3 ; // verification access times | 3 + $_SESSION['system_temp_bool_verify'] = $user_verification_type ; // verification boolean + + if( $user_verification_type == 'yes' ){ + // generate rand number + $rand = rand(100000,999999) ; + + // update login form + $mysqli->query( "UPDATE system_user SET + user_verification = '".$rand."', + user_verification_date = '".TODAYDATE."' + WHERE user_id = '".$user_id."'") ; + + // send verifcation code to owner + emailVerifcationCode($mysqli, system_user, COMPANY, EMAILSYSTEM, $row_user, $rand) ; + }else{ + // update login form + $mysqli->query("UPDATE system_user SET + user_login_cookies = '".$login_cookies."', + user_visit_count = '".$visit_count."', + user_last_latitude = '".$latitude."', + user_last_longtitude = '".$longtitude."', + user_last_device = '".$get_user_agent."', + user_last_ip = '".$get_client_ip."', + user_last_login = '".TODAYDATE."' + WHERE user_id = '".$user_id."'") ; + // unset temporary session + unset($_SESSION['system_temp_user_name']) ; + unset($_SESSION['system_temp_password']) ; + unset($_SESSION['system_temp_remember']) ; + unset($_SESSION['system_temp_access']) ; + unset($_SESSION['system_temp_bool_verify']) ; + // get the customer information + $_SESSION['system_id'] = $user_id ; + $_SESSION['system_name'] = $row_user['user_name'] ; + $_SESSION['system_branch'] = $row_user['user_branch'] ; + $_SESSION['system_permission'] = $row_user['user_permission'] ; + // set cookies + $expired_time = (time() + 60 * 60 * 24 * 365 * 5) ; + setcookie("system_login_cookies", $login_cookies, $expired_time, "/") ; + if ($remember){ + setcookie("system_id", $_SESSION['system_id'], $expired_time, "/") ; + setcookie("system_name", $_SESSION['system_name'], $expired_time, "/") ; + setcookie("system_branch", $_SESSION['system_branch'], $expired_time, "/") ; + setcookie("system_permission", $_SESSION['system_permission'], $expired_time, "/") ; + }else{ + $expired_time = (time() - 3600) ; + setcookie("system_id", $_SESSION['system_id'], $expired_time, "/") ; + setcookie("system_name", $_SESSION['system_name'], $expired_time, "/") ; + setcookie("system_branch", $_SESSION['system_branch'], $expired_time, "/") ; + setcookie("system_permission", $_SESSION['system_permission'], $expired_time, "/") ; + } + // redirect page + header('Location: main.php') ; + exit ; + } + }else{ + // update login form + $mysqli->query("UPDATE system_user SET + user_verification = '', + user_login_cookies = '".$login_cookies."', + user_visit_count = '".$visit_count."', + user_last_latitude = '".$latitude."', + user_last_longtitude = '".$longtitude."', + user_last_device = '".$get_user_agent."', + user_last_ip = '".$get_client_ip."', + user_last_login = '".TODAYDATE."' + WHERE user_id = '".$user_id."'") ; + // unset temporary session + unset($_SESSION['system_temp_user_name']) ; + unset($_SESSION['system_temp_password']) ; + unset($_SESSION['system_temp_remember']) ; + unset($_SESSION['system_temp_access']) ; + unset($_SESSION['system_temp_bool_verify']) ; + // get the customer information + $_SESSION['system_id'] = $user_id ; + $_SESSION['system_name'] = $row_user['user_name'] ; + $_SESSION['system_branch'] = $row_user['user_branch'] ; + $_SESSION['system_permission'] = $row_user['user_permission'] ; + // set cookies + $expired_time = (time() + 60 * 60 * 24 * 365 * 5) ; + setcookie("system_login_cookies", $login_cookies, $expired_time, "/") ; + if ($remember){ + setcookie("system_id", $_SESSION['system_id'], $expired_time, "/") ; + setcookie("system_name", $_SESSION['system_name'], $expired_time, "/") ; + setcookie("system_branch", $_SESSION['system_branch'], $expired_time, "/") ; + setcookie("system_permission", $_SESSION['system_permission'], $expired_time, "/") ; + }else{ + $expired_time = (time() - 3600) ; + setcookie("system_id", $_SESSION['system_id'], $expired_time, "/") ; + setcookie("system_name", $_SESSION['system_name'], $expired_time, "/") ; + setcookie("system_branch", $_SESSION['system_branch'], $expired_time, "/") ; + setcookie("system_permission", $_SESSION['system_permission'], $expired_time, "/") ; + } + + // redirect page + header('Location: main.php') ; + exit ; + } + }else{ + $warning_verfication = 'error_verifcation' ; + $access-- ; + if ($access == 0){ + // unset temporary session + unset($_SESSION['system_temp_user_name']) ; + unset($_SESSION['system_temp_password']) ; + unset($_SESSION['system_temp_remember']) ; + unset($_SESSION['system_temp_access']) ; + unset($_SESSION['system_temp_bool_verify']) ; + }else{ + $_SESSION['system_temp_access'] = $access-- ; + } + } + } + } +} + +// check status +if ($_SESSION['system_temp_user_name'] != '' && $_SESSION['system_temp_password'] != ''){ + if( $_SESSION['system_temp_bool_verify'] == 'yes' ){ + $boolean_verifcation = true ; + }else{ + $boolean_verifcation = false ; + } +}else{ + $boolean_verifcation = false ; +} + +// token session +$_SESSION['system_token'] = md5(uniqid()) ; + +// body onload script +$show_map_library = true ; +$show_map_script = true ; +$body_onload = true ; + +// start header here +include 'requires/page_header.php' ; + +?> +
    +
    +
    + + +
    +

    +

    +
    + '.$lang['please_get_the_verification_code_from_the_owner'].'

    + '.($warning_verfication == 'error_verifcation' ? '

    '.$lang['sorry_please_provide_a_correct_verification_code'].$lang['you_still_can_try'].$_SESSION['system_temp_access'].$lang['times'].'

    ' : '').' +
    + + +
    ' ; + }else{ + echo ' +
    + + +
    +
    + + +
    +
    + + '.$lang['remember_me'].' +
    ' ; + } + ?> + + + + + + + + +
    + +
    + $v ){ + $new_download[] = ''.$v.'' ; + } + echo implode( ' / ', $new_download ) ; + } + ?> +
    + +
    + + + +
    + +

    IPS Software Sdn. Bhd.

    +
    +
    +
    + + + diff --git a/language.php b/language.php new file mode 100644 index 0000000..eec493e --- /dev/null +++ b/language.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/languages/cn.php b/languages/cn.php new file mode 100644 index 0000000..22a130b --- /dev/null +++ b/languages/cn.php @@ -0,0 +1,1389 @@ + '第1', + '1time' => '一次而已', + '2nd' => '第2', + '3rd' => '第3', + '4th' => '第4', + '3 months' => '3个月', + '6 months' => '6个月', + '12 months' => '12个月', + + + // a + 'ACCREDITED BY' => 'è®¤è¯æœºæž„', + 'Are you sure to get the redemption code?' => '是å¦ç¡®è®¤èŽ·å–å…‘æ¢ç ï¼Ÿ', + 'Allow Switch Branch' => 'Allow Switch Branch', + 'Allow Production' => 'å…许生产', + 'Allow Store' => 'å…许库存', + 'Allow Comment' => 'å…许评论', + 'Allow Warning Letter' => 'å…许警告信', + 'Absent' => '缺席', + 'Absent Days' => '缺席日', + 'APPROV' => '批准', + 'APPROVED BY' => '批准人', + 'Approve by' => '批准者', + 'Approvers Position' => '批准者èŒä½', + 'Absent Deduct Salary' => '缺席(扣除薪金)', + 'Absent Punch Deduct Salary' => '缺席打å¡ï¼ˆæ‰£é™¤è–ªæ°´ï¼‰', + 'account' => '叿ˆ·', + 'Account' => '叿ˆ·', + 'ACCOUNT MANAGER' => '客户ç»ç†', + 'Action' => '行动', + 'Active' => '活跃', + 'Active All' => '活跃全部', + 'Additional Details' => 'é¢å¤–细节', + 'Address' => 'ä½å®¶åœ°å€', + 'add_group' => '新增群组', + 'add_new' => '新创建', + 'advance' => '预支', + 'advance-new' => '新建预支', + 'advance-update' => '更新预支', + 'Advance was submitted' => '预支申请已æäº¤ã€‚', + 'After' => '之åŽ', + 'afternoon_hours' => 'ä¸‹åˆæ—¶é—´', + 'afternoon_start' => '下åˆå¼€å§‹æ—¶é—´', + 'afternoon_end' => '下åˆç»“æŸæ—¶é—´', + 'Aims ambitions' => '目标/抱负', + 'All' => '所有', + 'Allow Allowance' => 'å…许津贴', + 'Allow Punch' => 'å…许打å¡', + 'Allow Topup' => 'å…许充值', + 'allowance' => '津贴', + 'Allowance' => '津贴', + 'Allowance By 1 month working day' => '1个月工作日津贴', + 'Allowance Food' => '食物津贴', + 'Allowance Food Days' => '食物津贴日', + 'Allowance Food Total' => '食物津贴总数', + 'Allowance Mobile Topup' => '津贴手机充值', + 'Allowance Monthly' => 'æ¯æœˆæ´¥è´´', + 'Allowance Monthly Attend' => 'æ¯æœˆå‡ºå¸­æ´¥è´´', + 'Allowance Monthly Increment' => 'æ¯æœˆæ´¥è´´å¢žé‡', + 'Allowance Monthly Increment Bonus' => 'æ¯æœˆæ´¥è´´å¢žé‡ï¼ˆå¥–金)', + 'Allowance Target' => '达到目标津贴', + 'Allowance Topup' => '充值津贴', + 'all_devices_for_the_selected_user_were_disconnected' => '所选用户的所有设备已断开连接。', + 'amount' => 'æ•°é¢', + 'Amount bonus' => '金é¢ï¼ˆå¥–金)', + 'Amount deduct' => '金é¢ï¼ˆæ‰£é™¤ï¼‰', + 'Amount RM' => '金é¢ï¼ˆé©¬å¸ï¼‰', + 'AND' => 'å’Œ', + 'announcement' => '公告', + 'announcement-new' => '新建公告', + 'announcement-update' => '更新公告', + 'Announcement Type' => '公告类型', + 'Announcement View' => '查看公告', + 'Annual' => 'å¹´å‡', + 'annual' => 'å¹´å‡', + 'Annual Days' => '年凿—¥', + 'Annual Leave' => 'å¹´å‡', + 'application' => '申请书', + 'Application Form' => '申请表', + 'Application signature' => '申请签å', + 'Approvers signature' => '批准者签å', + 'Area' =>'é¢ç§¯', + 'Are you willing to work overtime' => '您愿æ„加ç­å—?', + 'Are you willing to work under pressure' => '您愿æ„在压力下工作å—?', + 'Are you able to join us' => '你能加入我们å—?', + 'are you sure to vote this' => 'ä½ ç¡®å®šè¦æŠ•ç¥¨å—?', + 'Assign By' => '分é…人', + 'Assigned By' => '分é…人', + 'attended' => '已出席', + 'attendance' => '出勤率', + 'Attendance Allowance' => '勤工津贴', + 'attendance-qrcode' => '考勤二维ç ', + 'Attendance Today' => '今日出勤率', + 'Author' => '笔者', + 'Attention' => '注æ„事项', + "Attention Title" => "注æ„事项标题", + 'Auto Execution' => '自动执行', + 'ACKNOWLEDGEMENT AND AUTHORIZATION' => '致谢和授æƒ', + 'Are you exhibiting 2 or more symptoms as listed below?' => 'Are you exhibiting 2 or more symptoms as listed below?', + 'Are you a MOH COVID-19 volunteer in the last 14 days?' => 'Are you a MOH COVID-19 volunteer in the last 14 days?', + 'Appointment Date' => '预约日期', + 'Appointment Time' => '预约时间', + 'Assigned' => '已分é…', + 'Approved' => '已批准', + 'Adjustment' => 'Adjustment', + 'Appointment Date From' => 'Appointment Date From', + 'Appointment Date To' => 'Appointment Date To', + 'Allow Adjustment Branch' => 'Allow Adjustment Branch', + 'AGE' => '年龄', + + + // b + 'Bank' => '银行', + 'Back' => '返回', + 'Basket' => '篮å­', + 'Bonus' => '奖金', + 'Bank Account No' => '银行户å£å·', + 'Bag' => '袋', + 'Basic' => '基本', + 'Basic Salary' => '基础工资', + 'be specific' => '(请明确点)', + 'Bean' => '豆类', + 'before' => '之å‰', + 'Benefit' => '利益', + 'BENEFIT' => '利益', + 'Birth Date' => '出生日期', + 'Boiler' => '锅炉', + 'BOILER' => '锅炉', + 'branch' => '分店', + 'Branch Geometry' => '分店地ç†ä½ç½®', + 'brand' => '商标', + 'break_hours' => 'ä¼‘æ¯æ—¶é—´', + 'break_start' => '休æ¯å¼€å§‹æ—¶é—´', + 'break_end' => '休æ¯ç»“æŸæ—¶é—´', + 'Broken' => '破碎', + 'BROKEN' => '破碎', + 'Broken_KG' => '破碎(公斤)', + 'BUDDHIST' => '佛教', + 'by_department' => '按部门', + 'by_user' => '按用户', + 'by_schedule' => '按时间表', + 'Batch Number' => "批å·", + 'Besides the above, are you exhibiting any of the symptoms listed below?' => 'Besides the above, are you exhibiting any of the symptoms listed below?', + 'Body ache' => 'Body ache', + 'Branch To Visit' => 'å‚观分行', + 'By Personal' => 'By Personal', + 'By Personal Report' => 'By Personal Report', + 'By Branch' => 'By Branch', + 'By Branch Report' => 'By Branch Report', + + + // c + 'COMPANY NAME' => 'å…¬å¸åç§°', + 'cause_letter' => '解释信', + 'call' => '称呼', + 'Car' => '车厢', + 'Carton' => '纸箱', + 'Cash' => '现金', + 'CASH' => '现金', + 'Category' => '分类', + 'Career Plan' => 'èŒä¸šè§„划', + 'Charge' => 'æ”¶è´¹', + 'Chart' => '图表', + 'Charge Absent' => '缺席收费', + 'Charge Absent Punch' => 'ç¼ºå¸­æ‰“å¡æ”¶è´¹', + 'Charge Comment' => '评论收费', + 'Charge Early Out' => '早退收费', + 'Charge Give Away' => 'å…è´¹æ ·å“æ”¶è´¹', + 'Charge Late' => '迟到收费', + 'Charge Late Rest' => '休æ¯ä¸åœ¨èŒƒå›´æ”¶è´¹', + 'Charge Advance' => '预制收费', + 'Charge Skhppa' => 'Skhppaæ”¶è´¹', + 'Charge Hostel' => 'å®¿èˆæ”¶è´¹', + 'Charge Gas' => '煤气收费', + 'Charge Time Off' => '休æ¯è¿Ÿåˆ°æ”¶è´¹', + 'Charge Target' => '未达到目标收费', + 'Check All' => '打勾所有', + 'Checked' => '已检查', + 'check_if_fixed_working_hours' => 'æ˜¯å¦æœ‰å›ºå®šçš„工作时间?', + 'check_if_flexible_hours' => '是å¦å±žäºŽå¼¹æ€§æ—¶é—´ï¼Ÿ', + 'check_if_have_OT' => 'æ˜¯å¦æœ‰åŠ ç­ï¼Ÿ', + 'check_if_morning_count_as_ot' => 'ä¸Šåˆæ˜¯å¦ç®—作加ç­ï¼Ÿ', + 'check_if_off_duty' => '是å¦å·²è¿‡ä¸‹ç­æ—¶é—´ï¼Ÿ', + 'check_if_ot_is_count_as_total_work' => 'åŠ ç­æ˜¯å¦ç®—为总工作é‡ï¼Ÿ', + 'Chemical' => '化学制å“', + 'Check staff leave' => 'æŸ¥çœ‹å‘˜å·¥ä¼‘å‡æ—¥', + 'CHEQUE' => '支票', + 'Chief' => '首席', + 'Child Relief' => '儿童救济', + 'CHINESE' => 'åŽäºº', + 'CHRISTIAN' => 'åŸºç£æ•™', + 'Choose Work hour' => '选择工作时间', + 'chosen' => '已选', + 'Claim' => 'ç´¢å¿', + 'Claim Annual Salary' => '领å–å¹´è–ª', + 'Claim Medical Fee' => 'ç´¢å–医疗费', + 'Claim Medical Salary' => '领å–医疗工资', + 'Claim Left Amount' => 'ç´¢å¿å‰©ä½™é‡‘é¢', + 'Clear' => '清除', + 'Cleaner' => '清æ´å·¥äºº', + 'Click yes to allow button production' => '打勾以å…许生产按钮。', + 'Click yes to allow button store' => '打勾以å…许库存按钮。', + 'Click yes to allow button comment' => '打勾以å…许评论按钮。', + 'Click yes to allow button warning letter' => '打勾以å…许警告信按钮。', + 'Click yes to allow button punch card' => '打勾以å…è®¸æ‰“å¡æŒ‰é’®ã€‚', + 'Click yes to allow food allowance' => '打勾以å…许食物津贴。', + 'Click yes to allow topup allowance' => '打勾以å…许充值津贴。', + 'Click yes to allow button switch branch' => 'Click yes to allow button switch branch', + 'Code' => '代ç ', + 'Comission' => '佣金', + 'Comment' => '评论', + 'Comment was submitted' => 'è¯„è®ºå·²ç»æäº¤ã€‚', + 'Confirm' => 'è¯å®ž', + 'Confirmation' => 'è¯å®ž', + 'Contacts no' => 'è”络å·ç ', + 'copy_paste' => 'å¤åˆ¶ç²˜è´´', + 'confirmed' => '确认', + 'CONFIRMED' => '确认', + 'Confirmed' => '确认', + 'Confirm to change this employment status to' => 'ç¡®è®¤å°†æ­¤å·¥ä½œçŠ¶æ€æ›´æ”¹ä¸º', + 'Contract' => 'åˆçº¦', + 'CONTRACT' => 'åˆçº¦', + 'Contract Salary' => 'åˆåŒå·¥èµ„', + 'Cost' => 'æˆæœ¬', + 'Country' => '国家', + 'created_date' => '创建日期', + 'Created At' => '创建日期', + 'Created By' => '创建人', + 'Current Car' => '当å‰è½¦è¾†', + 'Current Level' => '当å‰ç­‰çº§', + 'Current Group' => '当å‰ç»„', + 'customer' => '顾客', + 'Customer Details' => '顾客信æ¯', + 'Customer List' => '顾客列表', + 'Cutting' => '切割', + 'check_if_count_day_include_rest_hours' => '检查计数日是å¦åŒ…æ‹¬ä¼‘æ¯æ—¶é—´ã€‚', + 'Comment/Warning Today' => '今天的评论/警告', + 'Content' => 'Content', + 'Chills' => 'Chills', + 'Cough' => 'Cough', + 'Contact Person' => 'è”络人', + 'Contact Number' => 'è”系电è¯', + 'Car Plate' => '车牌', + 'Corporate Staff' => 'Corporate Staff', + 'Completed' => '已完æˆ', + 'Completed Task' => 'Completed Task', + 'Completed Or Incompleted Report' => 'Completed Or Incompleted Report', + 'Completed' => 'Completed', + 'Cancelled' => 'Cancelled', + 'Cross Department' => 'Cross Department', + 'Click yes to allow adjustment branch' => 'Click yes to allow adjustment branch', + 'CLASS' => '类别', + + + // d + 'Degree' => 'Degree', + 'Debit Bank' => '借记银行', + 'DAILY' => 'æ¯æ—¥', + 'Daily' => 'æ¯æ—¥', + 'Daily Frying Dept Record' => 'æ¯æ—¥æ²¹ç‚¸éƒ¨é—¨è®°å½•', + 'Daily KBA Packing Record' => 'æ¯æ—¥KBA包装记录', + 'Daily Wet Packing Record' => 'æ¯æ—¥æ¹¿åŒ…装记录', + 'Daily Hours' => 'æ¯æ—¥æ—¶é—´', + 'Dashboard' => '仪表æ¿', + 'date' => '日期', + 'Date Confirmed' => '确认日期', + 'Date Approved' => '批准日期', + 'Date Created' => '创建日期', + 'Date From' => '日期从', + 'Date Joined' => 'å‚与日期', + 'Date Resigned' => 'è¾žèŒæ—¥æœŸ', + 'Date of Birth' => '出生日期', + 'DATE OF BIRTH' => '出生日期', + 'Date to offer' => '录喿—¥æœŸ', + 'Date Month Year' => '日期 (月/年)', + 'date_request' => '申请日期', + 'Date To' => '日期至', + 'Date to return' => '返回日期', + 'Day' => '天', + 'Day From' => '天从', + 'Day To' => '天至', + 'Days' => '天', + 'debtor_type' => '债务人类型', + 'Deduction' => '扣除', + 'Deduct Hour' => 'æ‰£é™¤å°æ—¶', + 'Deduct Point' => '扣除分数', + 'deduct_the_off_duty_x_minutes_later' => '扣除 “ ä¸‹ç­ X åˆ†é’ŸåŽ â€ï¼Ÿ', + 'DELIVERY CONTROL OFFICER' => 'é€è´§æŽ§åˆ¶å‘˜', + 'Department' => '部门', + 'Description' => '说明', + 'Deselect all' => 'å–æ¶ˆé€‰æ‹©æ‰€æœ‰', + 'developed_by_eng' => 'ç”± ', + 'developed_by_cn' => ' å¼€å‘', + 'DIRECTOR' => 'ç†äº‹', + 'Disabled' => 'ç¦ç”¨', + 'disconnect' => 'æ–­å¼€', + 'Divorced' => '离婚', + 'DIVORCED' => '离婚', + 'Duration' => '为其', + 'documentation' => '文件资料', + 'documentation-new' => '新建文件资料', + 'documentation-update' => '更新文件资料', + 'DONE' => '已完æˆ', + 'Done' => '已完æˆ', + 'Done By' => '完æˆè€…', + 'Done At' => 'å®Œæˆæ—¥æœŸ', + 'Download' => '下载', + 'Dry' => 'å¹²å“', + 'Dryer' => '烘干机', + 'Detail' => '细节', + 'Date Of Visiting' => 'Date Of Visiting', + 'Diarrhea' => 'Diarrhea', + 'Difficulty breathing' => 'Difficulty breathing', + 'Dear Guest, Welcome to XXXX Group! We are honored to have you in our plant. Kindly fill up this Visitor Registration Form for us to be well-prepared for your visit. Looking forward to meeting you in person soon!' => '尊敬的客人,欢迎æ¥åˆ°XXXXé›†å›¢ï¼ æˆ‘ä»¬å¾ˆè£å¹¸æœ‰ä½ åœ¨æˆ‘们的工厂。 请填写此访客登记表,以便我们为您的到访åšå¥½å……分准备。 期待很快与您è§é¢ï¼', + 'daily' => 'æ¯å¤©', + 'Designation' => 'ç§°å·', + 'Delayed' => 'Delayed', + 'Department Task Given Report' => 'Department Task Given Report', + 'DRIVING LISENCE' => '驾驶执照', + + + // e + 'Entitle' => 'æƒåˆ©', + 'Early' => 'ææ—©', + 'Early Out' => '早退', + 'Earn Point' => '赚å–积分', + 'Earnings' => '赚å–', + 'Employee ID' => '员工ID', + 'edit' => 'æ›´æ–°', + 'Edit Current' => '更新当å‰', + 'Edit Mode' => '更改模å¼', + 'Education Level' => '教育程度', + 'EDUCATIONAL LEVEL' => '教育程度', + 'Effective Date' => '有效日期', + 'EIS Contribution' => 'EIS贡献', + 'email' => '电邮', + 'Email' => '电邮', + 'EMAIL ADDRESS' => '电邮', + 'EMP' => '员工', + 'Employer Epf Rate' => '雇主EPF率', + 'Employment' => '雇用', + 'Employment date' => '就业日期', + 'Employment Info' => '就业信æ¯', + 'Employment Offer Letter' => '员工录å–通知信', + 'EMPLOYMENT APPLICATION FORM' => '就业申请表', + 'EMPLOYMENT HISTORY' => '工作ç»åކ', + 'EMPLOYMENT INJURY & VALIDITY' => '工伤 & 就业有效性', + 'EMPLOYMENT INJURY ONLY' => '仅工伤', + 'Employment Status' => '就业状况', + 'Employment Interview Details' => '员工é¢è¯•内容', + 'Employee Number' => '员工å·ç ', + 'Employee Code' => '员工ç ', + 'Enabled' => 'å·²å¯ç”¨', + 'End Of Probation' => '试用期结æŸ', + 'End Time' => 'ç»“æŸæ—¶é—´', + 'End Date' => 'ç»“æŸæ—¥æœŸ', + 'EPF Membership No' => 'EPF会员编å·', + 'Ethnic' => 'æ°‘æ—', + 'EXPECTED SALARY' => '期望薪水', + 'expired date' => '过期日期', + 'export_as' => '导出为', + 'export' => '导出', + 'expenses' => '开销', + "Efficiency"=> '效率', + "Executed By"=> '执行人', + 'Employee' => 'Employee', + "Excellent"=> '优秀', + + + // f + 'FINISH' => '结æŸ', + 'factory' => '工厂', + 'FACTORY MANAGER' => '厂长', + 'Family' => '家庭', + 'Female' => '女', + 'FEMALE' => '女', + 'FAMILY BACKGROUND' => '家庭背景', + 'File' => '文件', + 'flexible_hours' => '弹性时间', + 'Food Additives' => 'é£Ÿå“æ·»åР剂', + 'Foreigner' => '外国人', + 'foreign-only' => '仅外国', + 'FOREIGN WORKERS' => '外国工人', + 'Format' => 'æ ¼å¼', + 'Food Choise' => '食物选择', + 'Food Allowance' => '食物津贴', + 'friday' => '星期五', + 'Fresh' => '鲜', + 'Fried' => '油炸', + 'from' => '从', + 'From (Months)' => '从 (月)', + 'From month' => '从 (月)', + 'From minute' => '从 (分钟)', + 'From To' => '从 ~ 至', + 'Fryer' => '炸锅', + 'Frying' => '油炸', + 'fullname' => 'å§“å', + 'Full' => '全天', + 'Full Attendance' => '全勤', + 'Full Half' => '全天/åŠå¤©', + 'fullstop' => '。', + 'Find Code' => 'Find Code', + 'Fever' => 'Fever', + 'Fatigue' => 'Fatigue', + 'FAMILY PARTICULARS' => '家庭详情', + + + // g + 'GRADE' => 'æˆç»©', + 'Gender' => '性别', + 'GENDER' => '性别', + 'Group' => '群组', + 'Give Away' => 'å…费样å“', + 'Give away was submitted' => 'å…费样å“å·²æäº¤ã€‚', + 'Grinding' => '打磨', + 'Grinding Report' => 'æ¯æ—¥æ‰“磨报表', + 'GPS' => 'å…¨çƒå®šä½ç³»ç»Ÿ', + 'Give Item' => 'Give Item', + 'Go to the semi-finished products department' => 'åŽ»åŠæˆå“部门', + 'Good' => '好', + 'Give Point' => 'Give Point', + + + // h + 'health' => 'Health', + 'Health' => 'Health', + 'Half' => 'åŠå¤©', + 'Halal' => '清真', + 'Hide' => 'éšè—', + 'Hours' => 'å°æ—¶', + 'has reach limit this year' => '今年已ç»è¾¾åˆ°æžé™ã€‚', + 'Have a contract with the previous employer' => '与å‰é›‡ä¸»æœ‰åˆåŒå—?', + 'Headquarter' => '总公å¸', + 'HIGH' => '高等', + 'HINDU' => '兴都教', + 'Holiday' => '凿œŸ', + 'Hostel' => '宿èˆ', + 'House Tel' => 'ä½å®¶ç”µè¯', + 'hr' => '人力资æº', + 'HR' => '人力资æº', + 'HUMAN RESOURCES OFFICER' => '人力资æºéƒ¨é—¨äººå‘˜', + 'Hrs/Day' => 'å°æ—¶/天数', + 'Health Screening Form for Visitors' => 'Health Screening Form for Visitors', + 'Have you been in contact with a confirmed novel Covid-19 patient in the past 14 days?' => 'Have you been in contact with a confirmed novel Covid-19 patient in the past 14 days?', + 'Have you been to affected countries in the past 14 days' => 'Have you been to affected countries in the past 14 days', + 'Headache' => 'Headache', + 'Have you attended any event / areas associated with known COVID-19 cluster?' => 'Have you attended any event / areas associated with known COVID-19 cluster?', + 'Have you had close contact with any confirmed or suspected COVID-19 cases within the last 14 days?' => 'Have you had close contact with any confirmed or suspected COVID-19 cases within the last 14 days?', + 'Have you travelled abroad within the last 14 days?' => 'Have you travelled abroad within the last 14 days?', + 'HOME TELEPHONE' => '家庭电è¯', + + + + // i + 'I certify that all answers given herein are true and complete to the best of my knowledge' => '我ä¿è¯ï¼Œæ­¤å¤„给出的所有答案都是真实完整的。', + 'I authorize investigation of all statements contained in this application for employment as may be necessary in arriving at an employment decision' => '本人授æƒè°ƒæŸ¥æ­¤æ±‚èŒç”³è¯·ä¸­åŒ…å«çš„æ‰€æœ‰é™ˆè¿°ï¼Œä»¥ä½œå‡ºæ±‚èŒå†³å®šã€‚', + 'IC' => '身份è¯', + 'IC Passport' => '身份è¯/护照', + 'IC Passport Image' => '身份è¯/护照图片', + 'ID' => 'ID', + 'ID No' => 'ID å·', + 'if_direct_count_as_1_day' => '是å¦ç›´æŽ¥ç®—作1天?', + 'if_early' => 'å¦‚æžœææ—©', + 'If early Checkout' => '如果早退', + 'If Late Checkin' => 'å¦‚æžœè¿Ÿæ‰“å¡æŠ¥åˆ°', + 'If Late Rest' => 'å¦‚æžœä¼‘æ¯æ—¶é—´ä¸åœ¨èŒƒå›´', + 'if not put' => '如果没有请放', + 'If yes' => '如果是', + 'If you need help getting started check out to our user manual' =>'如果您需è¦å…¥é—¨æ–¹é¢çš„帮助,请查阅我们的用户手册。', + 'If you need help call us at' => '如果您需è¦å¸®åŠ©ï¼Œè¯·è‡´ç”µæˆ‘ä»¬', + 'If any technical issue kindly contact us' => '如有任何技术问题,请è”系我们。', + 'Image' =>'图片', + 'IMPORTANT' => 'é‡è¦', + 'Import' => 'Import', + 'Import Attendance' => 'Import Attendance', + 'Import Point' => 'Import Point', + 'In the event of employment that false or misleading information given in my application or interview may result in an immediate termination of employment' => '如果在我的申请或é¢è¯•中æä¾›çš„è™šå‡æˆ–误导性信æ¯èƒ½å¯¼è‡´ç«‹å³ç»ˆæ­¢é›‡ç”¨ã€‚', + 'Inactive All' => '䏿´»è·ƒå…¨éƒ¨', + 'Inactive' => '䏿´»è·ƒ', + 'INDIAN' => 'å°åº¦äºº', + 'Individual' => '个人', + 'Incentive' => '奖励', + 'INFORMATION RESOURCES DEPARTMENT' => 'ä¿¡æ¯èµ„æºéƒ¨', + 'In' => 'è¿›', + 'InOut' => 'è¿›/出', + 'Interview' => 'é¢è¯•', + 'Interview by' => 'é¢è¯•官', + 'Interview Details' => 'é¢è¯•细节', + 'Interview date time' => 'é¢è¯•日期/æ—¶é—´', + 'Interviewers signature' => 'é¢è¯•官签å', + 'Interviewers Position' => 'é¢è¯•官èŒä½', + 'Invoice' =>'å‘票', + 'Invoice Yearly Report' => '年度å‘票报告', + 'Input your staff id number only' => '备注:åªè¾“入您的员工è¯å·ç ', + 'insurance' => 'ä¿é™©', + 'Item' => 'æ ·å“', + 'Items' => 'æ ·å“', + 'Item Code' => 'æ ·å“代ç ', + 'Item Name' => 'æ ·å“åç§°', + 'Item Point' => 'æ ·å“积分', + 'IC' => '身份è¯', + 'Income Tax No' => '所得税编å·ï¼ˆSG / OG)', + 'Incharge Status' => '负责人状æ€', + 'If you have the following symptom(s), please tick the relevant box(es)' => 'If you have the following symptom(s), please tick the relevant box(es)', + 'Invalid Date' => 'Invalid Date', + 'Interview' => 'Interview', + 'Identity' => 'Identity', + 'Inbox' => 'Inbox', + 'Incompleted' => 'Incompleted', + + + // j + 'job' => 'å²—ä½', + 'Job Calendar' => '工作日历', + 'Job Invoice' => '工作å‘票', + 'Job Position' => '工作èŒä½', + 'Job Section' => '部分èŒä½', + 'Job Status' => '工作状æ€', + 'Job Type' => '工作类型', + 'Job List' => '工作列表', + 'Job Mission' => '工作使命', + 'job-list-new' => '新建岗ä½', + 'job-list-edit' => '更改岗ä½', + + + // k + 'Keep In View' => 'æŒç»­å…³æ³¨', + 'KG' => '公斤', + 'knowledge' => '知识', + 'KM23 Fried' => 'KM23 Fried', + + + + + // l + 'LANGUAGE PROFICIENCY' => '语言能力', + 'Language spoken' => '语言(说)', + 'Language written' => '语言(写)', + 'last_login' => '上次登录', + 'last_login_device' => '上次登录设备', + 'last_login_IP' => '上次登录IP', + 'last_login_location' => '上次登录ä½ç½®', + 'Last Check In' => '最åŽç­¾åˆ°', + 'Last drawn salary' => '最åŽçš„薪水', + 'Last Updated' => 'æœ€åŽæ›´æ–°', + 'Late' => '迟到', + 'Late Report' => '迟到报告', + 'Leave Type' => '休å‡ç±»åž‹', + 'leave has been' => 'çš„ä¼‘å‡æ—¥å·²è¢«', + 'Leave Name' => '休凿—¥åç§°', + 'leave-new' => 'æ–°å»ºä¼‘å‡æ—¥', + 'leave-update' => 'æ›´æ–°ä¼‘å‡æ—¥', + 'Leftover Sisa' => '剩余', + 'Letter' => 'ä¿¡ä»¶', + 'Letterhead' => '信头纸', + 'level' => '等级', + 'Level Requirement' => '等级需求', + 'license' => '执照', + 'License Record' => '执照记录', + 'Line Supervision' => '线路监ç£', + 'list' => '列表', + 'link' => '链接', + 'Local' => '本地', + 'Local1' => '本地人', + 'local-only' => '仅本地', + 'LOCAL WORKER' => '本地工人', + 'login_code' => '登录ç ', + 'Logout' => '登出', + 'L_F' => '本地/外国', + 'Leave' => '休å‡', + 'leave' => '休å‡', + 'Loss of smell' => 'Loss of smell', + 'Loss of taste' => 'Loss of taste', + 'Late Task' => 'Late Task', + + + // m + 'Movement' => '移动', + 'Media' => '媒体', + 'Mins' => 'Mins', + 'Min Quantity' => '最低数é‡', + 'Marital Status' => '婚姻状况', + 'MARITAL STATUS' => '婚姻状况', + 'Mailing Address' => '邮寄地å€', + 'Machine' => '机械', + 'MALAY' => '马æ¥äºº', + 'Male' => 'ç”·', + 'MALE' => 'ç”·', + 'malaysia' => '马æ¥è¥¿äºš', + 'Maintenance' => 'ä¿å…¨', + 'MAINTENANCE' => 'ä¿å…¨', + 'M_A_M' => '(M/A) M?', + 'Marital Status' => '婚姻状况', + 'Married' => '已婚', + 'MARRIED' => '已婚', + 'MPower' => '人手', + 'marketing' => '市场行销', + 'marketing-new' => '新建市场行销', + 'marketing-edit' => '更改市场行销', + 'Marketing Record' => '市场行销记录', + 'maximum_OT_hours' => '最长加ç­å°æ—¶', + 'MC' => 'ç—…å‡', + 'MCResign' => 'ç—…å‡ / 辞èŒ', + 'Medical Claim' => '医疗索赔', + 'Medical Claim was submitted' => '医疗索赔已æäº¤ã€‚', + 'Medical Leave' => 'ç—…å‡', + 'Medical Days' => 'åŒ»å‡æ—¥', + 'Medical Fee' => '医疗费', + 'Medical Fee(max)' => '医疗费(最高)', + 'MEDIUM' => '中等', + 'Message' => 'ä¿¡æ¯', + 'miss' => 'å°å§', + 'mr' => '先生', + 'mrs' => '夫人', + 'ms' => '女士', + 'Mobile' => '手机', + 'More Image' => '更多图片', + 'Mobile No' => '手机å·ç ', + 'MOBILE NO.' => '手机å·ç ', + 'model' => 'åž‹å·', + 'modified_date' => '修改日期', + 'monday' => '星期一', + 'MONTH' => '月', + 'Monthly' => 'æ¯æœˆ', + 'MONTHLY' => 'æ¯æœˆ', + 'morning_end' => 'æ—©ä¸Šç»“æŸæ—¶é—´', + 'morning_hours' => '早上时间', + 'morning_start' => '早上开始时间', + 'move_to_trash' => '移除', + 'MUSLIM' => '穆斯林', + 'Muslim Zakat Fund' => '穆斯林扎å¡ç‰¹åŸºé‡‘', + 'myr' => '(马å¸ï¼‰', + 'Meeting Venue / Level / Department To Visit' => 'Meeting Venue / Level / Department To Visit', + 'Meeting Venue / Meet up Venue or Department / Department To Visit' => 'Meeting Venue / Meet up Venue or Department / Department To Visit', + 'monthly' => 'æ¯ä¸ªæœˆ', + 'Main Category' => '主分类', + 'Minus Point' => 'Minus Point', + + + // n + 'NAME OF SCHOOL / COLLEGE / UNIVERSITY' => '学校/学院/大学åç§°', + 'name' => 'åç§°', + 'Name' => 'åå­—', + 'NAME' => 'åå­—', + 'NICKNAME' => '别称', + 'NAME IN CHINESE CHARACTER (IF APPLICABLE)'=>'中文å (如果有)', + 'FULL NAME (AS PER NRIC)' => 'å…¨å (如身份è¯)', + 'Name of father' => '父亲姓å', + 'Name of mother' => 'æ¯äº²å§“å', + 'Name of spouse' => 'é…å¶å§“å', + 'Name of school collage university' => '学校/学院/大学åç§°', + 'Nationality' => '国ç±', + 'NATIONALITY' => '国ç±', + 'Need Sign Back' => '需è¦å›žç­¾', + 'Next' => '下一个', + 'Next' => '下个', + 'Next Day' => '下一天', + 'Next Month' => '下个月', + 'Next Review Date' => '下次审核日期', + 'Next Year' => '下一年', + 'Next Group' => '下一组', + 'new' => '新创建', + 'New' => '新建', + 'New Customer' => '新建顾客', + 'Nett Pay' => '净工资', + 'night_hours' => '晚上时间', + 'night_start' => '晚上开始时间', + 'night_end' => 'æ™šä¸Šç»“æŸæ—¶é—´', + 'no' => 'å¦', + 'NO' => 'å¦', + 'No' => 'ç¼–å·', + 'no_branch' => '没有分店ï¼', + 'no_data' => '没有数æ®ã€‚', + 'no_image' => '没有图åƒã€‚', + 'no_record' => '没有记录。', + 'NO CONTRIBUTION' => '没有贡献', + 'NO TAX CONTRIBUTION' => '没有税务贡献', + 'NON TAX RESIDENT' => 'éžå±…民税', + 'Non-Halal' => 'éžæ¸…真', + 'Nope thanks for inviting' => 'ä¸ï¼Œè°¢è°¢æ‚¨çš„邀请。', + 'NORMAL' => '正常', + 'Normal Day' => '正常日', + 'Normal Mode' => '正常模å¼', + 'Normal Working' => '正常工作日', + 'Normal Rate' => '正常费率', + 'Normal OT Rate' => '正常加ç­è´¹çއ', + 'Notification' => '通知', + 'NRIC' => '身份è¯å·ç ', + 'No Children' => 'å­©å­æ•°é‡', + 'NRIC / Passport No' => 'NRIC / Passport No', + 'Nationality (For Foreigner Only)' => 'Nationality (For Foreigner Only)', + 'Nausea or vomiting' => 'Nausea or vomiting', + 'Nric / Passport No' => '身份è¯/护照å·ç ', + 'Not Suitable' => 'ä¸é€‚åˆ', + 'NOTICE PERIOD' =>'离èŒé€šçŸ¥æœŸ', + + + // o + 'Occupation' => 'èŒä¸š', + 'OCCUPATION' => 'èŒä¸š', + 'Offer' => '录å–', + 'off_duty' => 'ä¸‹ç­æ—¶é—´', + 'office_marketing' => '办公室行销', + 'OFFICE HOUR' => '办公时间', + 'Oil' => 'æ²¹', + 'Old NRIC' => '旧身份è¯å·ç ', + 'ONLINE TRANSFER' =>'线上转账', + 'OR' => '或', + 'Order Setting' => '订å•设置', + 'Order Title' => 'è®¢å•æ ‡é¢˜', + 'or email us' => '或给我们å‘电å­é‚®ä»¶', + 'Original Group' => '原组别', + 'Organization Chart' => '组织图', + 'ot' => '加ç­', + 'OT Day' => '加ç­å¤©', + 'OT Holiday' => '加ç­å‡æœŸ', + 'Ot Hours' => '加ç­å°æ—¶', + 'Ot Rate' => '加ç­çއ', + 'Ot Rest Hours' => '休æ¯åŠ ç­å°æ—¶', + 'Ot Rest Total' => '休æ¯åŠ ç­å°æ—¶æ€»æ•°', + 'Ot Public Hours' => '公共加ç­å°æ—¶', + 'Ot Public Total' => '公共加ç­å°æ—¶æ€»æ•°', + 'OT Off Day' => '加ç­ä¼‘å‡', + 'OT Work Day' => '加ç­ä¸Šç­å¤©', + 'OTP' => '验è¯ç ', + 'OTHER' => 'å…¶ä»–', + 'Others' => 'å…¶ä»–', + 'OTHERS' => 'å…¶ä»–', + 'ot_count_format' => '加ç­è®¡ç®—æ ¼å¼', + 'ot_rounding' => '加ç­è¿›ä½å€¼', + 'ot_start' => '加ç­å¼€å§‹', + 'Ot Total' => 'åŠ ç­æ€»æ•°', + 'Out' => '出', + 'Output' => '产é‡', + 'Oven' => '烤箱', + 'Oven Time' => '烤箱时间', + 'Oven Packing' => '烤箱/包装', + 'Oven And Packing Daily Report' => 'æ¯æ—¥çƒ˜åˆ¶ä¸ŽåŒ…装记录', + 'Oven Daily Report' => 'æ¯æ—¥çƒ˜åˆ¶è®°å½•', + 'Own any transport' => '拥有任何交通工具', + 'Own strengths' => '自己的强项', + 'Own weakness' => '自己的弱点', + 'Others Working' => '其他工作日', + 'Overtime' => '加ç­', + 'Outstation' => '出差', + 'On Time' => 'On Time', + 'On Time Or Delayed Report' => 'On Time Or Delayed Report', + + + // p + 'Pallet' => '托盘', + 'Paid By' => '付款于', + 'Public' => '公共', + 'Packing' => '包装', + 'P.Rate' => '费率', + 'Public Working' => '公共工作', + 'Packing All' => '包装所有', + 'Packing Time' => '包装时间', + 'Packing Daily Report' => 'æ¯æ—¥åŒ…装记录', + 'page' => '页é¢', + 'Pail' => 'æ¡¶', + 'Passport' => '护照', + 'Passport Expired Date' => '护照过期日期', + 'Passport No' => '护照å·ç ', + 'password' => '密ç ', + 'Password Confirmation' => '确认密ç ', + 'Payment Details' => '付款详情', + 'Payment Status' => '付款状æ€', + 'Payment Transfer' => '付款转å¸', + 'Payment Type' => '付款类型', + 'payment-slip' => '付款å•', + 'payment-slip-new' => '新建付款å•', + 'payment-slip-update' => '更新付款å•', + 'Pending' => '待定', + 'PENDING' => '待定', + 'Period' => '期é™', + 'PERMANENT' => '永久', + 'permission' => 'æƒé™', + 'Permit' => '许å¯è¯', + 'Permit From' => '许å¯è¯æœ‰æ•ˆæ—¥ä»Ž', + 'Permit Image' => '许å¯è¯å›¾åƒ', + 'Permit No' => '许å¯è¯å·', + 'Permit To' => '许å¯è¯æœ‰æ•ˆæ—¥è‡³', + 'Personal Info' => '个人资料', + 'PERSONAL INFORMATION' => '个人资料', + 'PERSONALITY' => '个性', + 'Poor' => 'å·®', + 'photo' => '照片', + 'PKT_KG' => '包装/公斤', + 'Plastic' => 'å¡‘æ–™', + 'Please answer the below questions' => '请回答以下问题:', + 'Please enter all required fill' => '请输入所有必填项。', + 'please_get_the_verification_code_from_the_owner' => '请从所有者那里获得验è¯ç ï¼', + 'Please list down details of brother and sister if any' => '请列出兄弟å§å¦¹çš„详细信æ¯ï¼ˆå¦‚果有)', + 'Please list down details of children if any' => '请列出孩å­çš„详细信æ¯ï¼ˆå¦‚果有)', + 'Please select status' => '请选择状æ€ã€‚', + 'please bring your tng card' => '备注:请æºå¸¦æ‚¨çš„TNGå¡ä»¥ä¾¿è¿›å…¥åœè½¦åœºã€‚', + 'please choose the best product' => '请投选出最好的穿æ­ï¼š', + 'Please state other training ceritication of licenses held' => 'è¯·è¯´æ˜Žå…¶ä»–åŸ¹è®­ï¼Œè¯æ˜ŽæŒæœ‰çš„æ‰§ç…§', + 'Point' => '积分', + 'POINT' => '积分', + 'Point Record' => '积分记录', + 'Point From' => '积分 从', + 'Point To' => '积分 至', + 'Position' => 'èŒä½', + 'Position company' => 'èŒä½ / å…¬å¸', + 'POSITION APPLIED FOR' => '申请èŒä½', + 'Procedure' => '规定程åº', + 'preview' => '预览', + 'Prev Day' => '上一天', + 'Previous' => '上个', + 'Previous current employer' => 'å‰ä»»/现任雇主', + 'Prev Month' => '上个月', + 'Prev Year' => '上一年', + 'Print' => '打å°', + 'Priority' => '优先', + 'product' => '产å“', + 'Problem' => '问题', + 'Title Problem' => '问题标题', + 'Product Movement' => '产å“移动', + 'productions' => '生产', + 'Processed' => '已加工', + 'Productions2' => '生产2', + 'Productions Items' => '生产样å“', + 'Productions Remark' => '生产备注', + 'Production Department' => '生产部门', + 'Production Daily Report' => 'æ¯æ—¥ç”Ÿäº§çº¿æŠ¥è¡¨', + 'profile' => '个人资料', + 'Profile' => '个人资料', + 'Profile Image' => '个人资料图片', + 'proforma-invoice' => 'å½¢å¼å‘票', + 'proforma-invoice-edit' => '更改形å¼å‘票', + 'Public Holiday' => '公共å‡', + 'Public Holiday Rate' => '公共凿œŸçއ', + 'Public Days' => '公共凿œŸæ—¥', + 'Public Day Rest' => '公共日 (休æ¯)', + 'Public Day Normal' => '公共日 (普通)', + 'Public Day OT' => '公共日 (è¶…æ—¶)', + 'Public Day Rate' => '公共日率', + 'Public Rate' => '公共凿œŸçއ', + 'Public Total' => '公共凿œŸæ€»æ•°', + 'purchasing' => 'è´­ä¹°', + 'PURCHASING' => 'è´­ä¹°', + 'pdf'=>'导出PDF', + 'Personal Contact Number' => 'Personal Contact Number', + 'Personal Contact Number (Include Dial code, Ex: +60xxxxxxxxx)' => 'Personal Contact Number (Include Dial code, Ex: +60xxxxxxxxx)', + 'Personal Email' => 'Personal Email', + 'Progress'=>'进行中', + 'Processing' => '进行中', + 'PERMANENT ADDRESS' => '永久地å€', + 'PROFESSIONAL QUALIFICATIONS (MEMBERSHIPS / TECHNICAL / PROFESSIONAL / OCCUPATION TRAINING)' => '专业资格(会员资格/技术/专业/èŒä¸šåŸ¹è®­ï¼‰', + 'PROFESSIONAL QUALIFICATION' => '专业资格', + + // q + 'QUALIFICATIONS' => '学历', + 'Qrcode' => '二维ç ', + 'Qrcode Barcode' => '二维ç /æ¡å½¢ç ', + 'Qty' => 'æ•°é‡', + 'QTY_KG' => 'æ•°é‡ï¼ˆå…¬æ–¤ï¼‰', + 'QTY_KG' => 'æ•°é‡å…¬æ–¤', + 'QTY PKT' => 'æ•°é‡åŒ…装', + 'QTY_PKT_KG' => 'æ•°é‡ï¼ˆåŒ…装/公斤)', + 'Qualification Major Academic' => '学历(专业)', + 'Quantity' => 'æ•°é‡', + 'QUANTITY TOTAL' => 'æ•°é‡æ€»è®¡', + 'quotation-new' => '新建报价å•', + 'quotation-edit' => '更改报价å•', + 'Quotation List' => '报价å•列表', + 'Questions' => 'Questions', + + + // r + 'RELATIONSHIP' => '关系', + 'Redemption' => 'å…‘æ¢', + 'Race' => 'ç§æ—', + 'Rate' => '比率', + 'Rest Day Working' => 'ä¼‘æ¯æ—¥å·¥ä½œ', + 'RECEIVED BY' => '收到者', + 'Raw Material' => '原料', + 'Raw Materials' => '原料', + 'Raw Materials Soya' => '原料大豆', + 'Reason' => '原因', + 'Reason of Resign' => '辞èŒåŽŸå› ', + 'Resign List'=> '辞èŒåˆ—表', + 'Reasons for leaving' => '离开的原因', + 'REFERENCES' => 'å‚考资料', + 'Reference' => 'å‚考资料', + 'Reject' => '驳回', + 'REJECTED' => '已驳回', + 'Rejected' => '已驳回', + 'Rejected At' => '驳回日期·', + 'Rejected By' => '驳回者', + 'rejected' => '驳回', + 'Religion' => 'å®—æ•™', + 'RELIGION' => 'å®—æ•™', + 'remark' => '备注', + 'remark name' => '备注åå­—', + 'remember_me' => 'è®°ä½æˆ‘', + 'Remove' => '移除', + 'Remove File' => '移除文件', + 'remove_photo' => '移除照片', + 'report' => '报告', + 'Report' => '报告', + 'Reprocessing' => 'å†åŠ å·¥', + 'request' => '申请', + 'Request By' => '申请者', + 'Request Date' => '申请日期', + 'Reschedule' => '改期', + 'Rest' => '休æ¯', + 'Rest Day Normal' => 'ä¼‘æ¯æ—¥ (普通)', + 'Rest Day OT' => 'ä¼‘æ¯æ—¥ (è¶…æ—¶)', + 'Reset Working Hours' => 'é‡ç½®å·¥ä½œæ—¶é—´', + 'rest_hours_range' => 'ä¼‘æ¯æ—¶é—´èŒƒå›´', + 'Rest Day' => '休æ¯å¤©æ•°', + 'Rest Days' => '休æ¯å¤©æ•°', + 'Rest Day Rate' => 'ä¼‘æ¯æ—¥çއ', + 'Rest Rate' => '休æ¯çއ', + 'Rest Total' => 'ä¼‘æ¯æ€»æ•°', + 'Result' => '结果', + 'road-tax' => '路税', + 'rotate' => '旋转', + 'Rest / Public Working' => 'ä¼‘æ¯æˆ–公共凿œŸ', + 'Run Away' => '逃跑', + 'Run Away List' => '逃跑列表', + 'Runny nose or nasal congestion' => 'Runny nose or nasal congestion', + 'Reason To Visit' => 'å‚è§‚ç†ç”±', + 'Resubmit' => '釿–°æäº¤', + 'REFERRAL NAME (IF APPLICABLE)' => '推è人姓å(如适用)', + 'RESIDENTIAL ADDRESS' => 'å±…ä½åœ°å€', + + + // s + 'search' => 'æœç´¢', + 'listing' => '列表', + 'SPOKEN' => '说', + 'START' => '开始', + 'Sorry, no code cannot be redempted.' => '抱歉,无任何兑æ¢ç å¯å…‘æ¢ã€‚', + 'Switch To Summary' => 'Switch To Summary', + 'Switch To Efficiency' => 'Switch To Efficiency', + 'salary' => '薪资', + 'SALARY' => '薪资', + 'Salary Name' => '薪资åç§°', + 'salary-view' => '薪资查看', + 'Salary Rate' => '工资率', + 'Salary Report' => '薪资报告', + 'Salary staff' => '员工薪资', + 'Salary Type' => '薪资类型', + 'Salary Letter' => '工资信', + 'Salary Increment' => '加薪', + 'Salary report updated' => '薪资报告已更新。', + 'Salt' => '腌制', + 'saturday' => '星期六', + 'Save' => '储存', + 'scan' => '扫æ', + 'Scroll' => '滚动', + 'select' => '选择', + 'Sent' => 'å‘é€', + 'Select all' => '选择所有', + 'Select Branch' => '选择分店', + 'Select Status' => '选择状æ€', + 'select_a_call' => '选择一个称呼', + 'Self Punch' => '自行打å¡', + 'setting' => '设置', + 'Settings' => '设置', + 'set_the_X_hours_before_the_ending_working_hours' => 'è®¾ç½®å·¥ä½œç»“æŸæ—¶é—´å‰ X å°æ—¶ï¼Ÿ', + 'Sex' => '性别', + 'Shift' => 'è½®ç­', + 'SHIFT' => 'è½®ç­', + 'shortbreak_hours' => '短休时间', + 'shortbreak_end' => '短休开始时间', + 'shortbreak_start' => 'çŸ­ä¼‘ç»“æŸæ—¶é—´', + 'Short Name' => '简称', + 'Show in Application List' => '在求èŒè¡¨æ ¼ä¸­æ˜¾ç¤º', + 'Show' => '显示', + 'sick1' => '医疗', + 'sick' => 'ç—…å‡', + 'Sick' => 'ç—…å‡', + 'Sick leave' => 'ç—…å‡', + 'sick_name' => 'ç—…å', + 'Single' => 'å•身', + 'SINGLE' => 'å•身', + 'sign_in' => '登入', + 'Sign out' => '登出', + 'signature' => 'ç­¾å', + 'Size Item' => 'æ ·å“大å°', + 'Sorry data not found' => '抱歉,找ä¸åˆ°æ•°æ®ã€‚', + 'Sorry email already exists' => '抱歉,电å­é‚®ä»¶å·²ç»å­˜åœ¨ã€‚', + 'Sorry failed create Medical Claim' => '抱歉,创建医疗索赔失败。', + 'Sorry failed update' => '抱歉,更新失败。', + 'Sorry idno already exists' => '抱歉,idnoå·²ç»å­˜åœ¨ã€‚', + 'Sorry invalid action type' => '抱歉,无效的æ“作类型。', + 'Sorry failed medical claim' => '抱歉,医疗索赔失败,', + 'Sorry password doesnt exists' => '抱歉,密ç ä¸å­˜åœ¨ã€‚', + 'Sorry please select at least one' => '抱歉,请至少选择一个。', + 'Sorry something error' => '抱歉,出现错误', + 'Sorry some of the staff not enough day to confirm' => '抱歉,指定的员工ä¸å¤Ÿå¤©æ•°ç¡®è®¤', + 'Sorry username already exists' => '抱歉,用户åå·²ç»å­˜åœ¨ã€‚', + 'Sorry image not found' => '抱歉,找ä¸åˆ°å›¾ç‰‡ã€‚', + 'sorry_password_must_at_least_6_digits' => '抱歉,密ç å¿…须至少6使•°å­—ï¼', + 'sorry_please_provide_a_correct_verification_code' => '抱歉,请æä¾›æ­£ç¡®çš„验è¯ç ï¼', + 'sorry_username_exsits' => '抱歉,用户å已存在ï¼', + 'Sorry you cannot apply different year of leave' => '抱歉,您ä¸èƒ½ç”³è¯·ä¸åŒå¹´ä»½çš„凿œŸã€‚', + 'sorry_your_account_was_in_our_block_list' => 'æŠ±æ­‰ï¼Œæ‚¨çš„å¸æˆ·å·²åœ¨æˆ‘们的阻止列表中ï¼', + 'Sorry product exists in your stock' => '抱歉,您的产å“已存在库存中ï¼', + 'Sorry item exists in your stock' => '抱歉,您的样å“已存在库存中ï¼', + 'sortable' => '排åº', + 'Socso Category' => 'Socso类别', + 'SOP' => '标准作业程åº', + "Stock Request" => " 请求库存", + 'Stock Summmary' => '库春总结', + 'SOP Title' => 'æ ‡å‡†ä½œä¸šç¨‹åºæ ‡é¢˜', + 'staff' => '员工', + 'Staff' => '员工', + 'Staff Application' => '员工申请', + 'Staff ID' => '员工编å·', + 'Staff IDno' => '员工编å·', + 'Staff Leave' => 'å‘˜å·¥ä¼‘å‡æ—¥', + 'Staff Name' => '员工åå­—', + 'Staff Status' => '员工状æ€', + 'star' => '星级', + 'start date' => '开始日期', + 'Starting Date' => '开始日期', + 'Starting Time' => '开始时间', + 'Stationary' => '固定', + 'status' => '状æ€', + 'Statutory Details' => '法定详细资料', + 'Step 1' => '步骤1', + 'Step 2' => '步骤2', + 'Step 3' => '步骤3', + 'Staff Designation Name' => '员工èŒä½åç§°', + 'Sticker' => '贴图', + 'store' => '商店', + 'submit' => 'æäº¤', + 'Subject' => '主题', + 'Subtotal' => 'å°è®¡', + 'sunday' => '星期日', + 'super_admin' => '超级管ç†å‘˜', + 'Supervisor' => '主管', + 'SUPERVISOR' => '主管', + 'Summarize' => '总结', + 'Suitable' => '适åˆ', + 'Spouse Name' => 'é…å¶å§“å', + 'Spouse IC' => 'é…å¶èº«ä»½è¯', + 'Spouse Working' => 'é…å¶å·¥ä½œ', + 'Spouse Income Tax' => 'é…å¶æ‰€å¾—税编å·ï¼ˆSG / OG)', + 'Shivering (rigor)' => 'Shivering (rigor)', + 'Sore throat' => 'Sore throat', + 'Supplier/Vendor' => 'Supplier/Vendor', + 'Supplier/Contractor' => 'Supplier/Contractor', + 'Section' => '部分', + 'Short Name' => '简称', + 'Sub Category' => 'å­åˆ†ç±»', + 'Success deleted' => '删除æˆåŠŸ', + 'Fail to delete' => '删除失败', + 'SEPERATED' => '已离婚', + + + // t + 'Table' => 'Table', + 'Tier' => 'Tier', + 'Target' => '目标', + 'Target Summmary' => '目标总结', + 'Task' => '任务', + 'Task Type' => '任务ç§ç±»', + 'Taken Bal' => 'å–得平衡', + 'Total Earning' => '总收益', + 'Total Deduction' => '总扣除é¢', + 'tax-invoice-new' => '新建税务å‘票', + 'tax-invoice-edit' => '更改税务å‘票', + 'Tax Reference No' => '税务å‚考编å·', + 'Tax Category' =>'税务类别', + 'TAX RESIDENT' => '居民税', + 'Teko' => 'Teko', + 'test' => '测试 ', + 'Temperature' => '温度', + 'Test Kit Result' => '测试结果', + 'Terminate' => '终止', + 'TFryers' => '炸锅', + 'Thank you image was removed' => '谢谢,图片已删除。', + 'Thank you comment was removed' => '谢谢,评论已删除。', + 'Thank you give away was removed' => '谢谢,å…费样å“已删除。', + 'Thank you status updated sucessfully' => '谢谢,状æ€å·²æˆåŠŸæ›´æ–°ã€‚', + 'Thank you details has been updated' => '谢谢,资料已æˆåŠŸæ›´æ–°ã€‚', + 'Thank you your staff has been updated' => '谢谢,您的员工已更新。', + 'Thank you your announcement has been updated' => 'è°¢è°¢ï¼Œæ‚¨çš„å…¬å‘Šå·²ç»æ›´æ–°ã€‚', + 'thank_you_your_branch_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„åˆ†åº—è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_claim_ot_has_been_updated' => '谢谢,您的加ç­ç´¢å–å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_claim_expenses_has_been_updated' => '谢谢,您的开销索å–å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_claim_outstation_has_been_updated' => '谢谢,您的出差索å–å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_chief_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„é¦–å¸­è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_comment_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„è¯„è®ºå·²ç»æ›´æ–°ã€‚', + 'thank_you_your_dashboard_has_been_updated' => '谢谢,您的仪表æ¿å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_department_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„éƒ¨é—¨è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'Thank you your documentation has been updated' => 'è°¢è°¢ï¼Œæ‚¨çš„æ–‡ä»¶èµ„æ–™å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_holiday_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„å‡æœŸè®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_hostel_has_been_updated' => '谢谢,您的宿èˆè®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_knowledge_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„çŸ¥è¯†è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'Thank you your leave has been add' => 'è°¢è°¢ï¼Œæ‚¨çš„ä¼‘å‡æ—¥è®¾ç½®å·²ç»åŠ äº†ã€‚', + 'Thank you your leave has been updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ä¼‘å‡æ—¥å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_leave_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ä¼‘å‡æ—¥è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_level_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ç­‰çº§è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_level_requirement_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ç­‰çº§éœ€æ±‚è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_license_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„æ‰§ç…§è®°å½•å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_notification_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„é€šçŸ¥è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'Thank you your payment slip has been updated' => '谢谢,您的付款å•å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_point_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ç§¯åˆ†è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_position_has_been_updated' => '谢谢,您的èŒä½è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_section_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„éƒ¨åˆ†è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'Thank you your product has been added' => '谢谢,您的产å“已添加。', + 'Thank you your item has been added' => '谢谢,您的样å“已添加。', + 'thank_you_your_salary_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„è–ªèµ„è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_report_late_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„è¿Ÿåˆ°æŠ¥å‘Šå·²ç»æ›´æ–°ã€‚', + 'thank_you_your_star_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„æ˜Ÿçº§è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_sick_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ç—…æƒ…è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_working_has_been_updated' => '谢谢,您的工作时间设置已更新', + 'The period of notice' => '通知期é™ï¼Ÿ', + 'thursday' => '星期四', + 'Tick to reset the working hours and follow the new one' => '勾选以é‡ç½®å·¥ä½œæ—¶é—´å¹¶éµå¾ªæ–°çš„工作时间。', + 'Tie ikat' => 'æ†', + 'Time' => 'æ—¶é—´', + 'Time Off' => '休æ¯è¿Ÿåˆ°', + 'times' => '次ï¼', + 'Time Soya' => 'æ—¶é—´ + 黄豆', + 'title' => '标题', + 'to' => '至', + 'To1' => '致', + 'to get information on how to use your current screen and where to go for more assistance' => 'ä»¥èŽ·å–æœ‰å…³å¦‚何使用当å‰å±å¹•以åŠå¦‚何获得更多帮助的信æ¯ã€‚', + 'To be considered for future assignments' => '未æ¥å†è€ƒè™‘', + 'To (Months)' => '至(月)', + 'To month' => '至(月)', + 'To minute' => '至(分钟)', + 'Toggle navigation' => '切æ¢å¯¼èˆª', + 'Todo' => '事项', + 'Todo List' => '事项清å•', + 'Total' => '总共', + 'Total Car' => '车辆总数', + 'Total Absent' => '缺席共数', + 'Total Broken' => '破碎总数', + 'Total Department' => '部门共数', + 'Total KG' => '总共公斤', + 'Total Point' => '总共分数', + 'Total Output' => '总产é‡', + 'Total Time' => '总共时间', + 'Total Salary' => '总薪资', + 'Total Work' => '上ç­å…±æ•°', + 'Total Mc' => '总病å‡', + 'Total Leave' => '总休å‡', + 'Total Rest' => '总休æ¯', + 'Total Rest Working' => 'æ€»ä¼‘æ¯æ—¥å·¥ä½œ', + 'Total Error' => '总误差', + 'total_rest_hours' => 'æ€»ä¼‘æ¯æ—¶é—´', + 'total_working_hours' => '总工作时间', + 'trash' => '移除', + 'Tracking' => '追踪', + 'Transaction' => '交易', + 'TRAINING' => 'å—è®­', + 'tuesday' => '星期二', + 'type' => '类型', + 'To prevent the spread of Covid-19 in our community and reduce the risk of exposure to our staff and visitors, we are conducting a simple screening questionnaire. Your participation is important to help us take precautionary measures to protect you and everyone in this building. Thank you for your time.' => 'To prevent the spread of Covid-19 in our community and reduce the risk of exposure to our staff and visitors, we are conducting a simple screening questionnaire. Your participation is important to help us take precautionary measures to protect you and everyone in this building. Thank you for your time.', + 'Thank you for your submission. We will get back to you as soon as possible.' => 'Thank you for your submission. We will get back to you as soon as possible.', + 'Test Kit Result' => 'Test Kit Result', + 'Thank you for your visitation. Please present your qrcode to our staff' => 'Thank you for your visitation. Please present your qrcode to our staff', + 'Thank you for your submission. We will get back to you soon.' => 'Thank you for your submission. We will get back to you soon.', + 'Thank you for your submission. Your application form has been approved. Kindly present your QR code to us during the visitation date.' => 'Thank you for your submission. Your application form has been approved. Kindly present your QR code to us during the visitation date.', + 'Total of Reject by Department' => 'Total of Reject by Department', + + + // u + 'Uncheck All' => 'å–æ¶ˆæ‰“勾所有', + 'Unsalt' => '脱ç›', + 'Unpaid' => '无薪休å‡', + 'unpaid' => '无薪休å‡', + 'Unpaid Leave' => 'æ— è–ªå‡', + 'Unpaid Days' => '无薪日', + 'Update' => 'æ›´æ–°', + 'Update Profile' => '更新个人资料', + 'Update Username' => '更新用户å', + 'Updated At' => '更新日期', + 'UNDER PROBATION' => '试用期', + 'Use Soya' => '使用大豆', + 'User' => '用户', + 'username' => '用户å', + 'user_colour' => '用户颜色', + 'user_name' => '用户å', + 'UOM' => '测é‡å•ä½ ', + "Update Group Next Month" => "更改下个月组别", + + + // v + 'value' => '数值', + 'Vegetarian' => '素食', + 'Value Status' => '数值状æ€', + 'verification_code' => '验è¯ç ', + 'verification_code_6_digits_only' => '验è¯ç  (ä»…6使•°)', + 'Verifiers signature' => '验è¯è€…ç­¾å', + 'Verifiers Position' => '验è¯è€…èŒä½', + 'Verify by' => '验è¯è€…', + 'Very Good' => '很好', + 'Video' => '影片', + 'view' => '查看', + 'View Current Report' => 'æŸ¥çœ‹å½“å‰æŠ¥å‘Š', + 'View Signature' => '查看签å', + 'View Staff Report' => '查看员工报告', + 'Visitor' => '访客', + 'VIP Visitor' => '贵宾访客', + 'Visit At' => '访问时间', + 'Vcard' => 'Vcard', + 'Vote Count' => '投票数é‡', + 'Vote This' => '投票', + 'Vote' => '投票', + 'Visitor Name' => '访客姓å', + 'Visit Reason' => '访问原因', + 'Visitor Company' => 'æ¥è®¿å…¬å¸', + 'Visitor Registration Form' => '访客登记表', + 'Visitor Category' => '访客类别', + 'View All' => '查看全部', + + + // w + 'WRITTEN' => '写', + 'Wage' => 'Wage', + 'Warning' => '警告', + 'Warning Letter' => '警告信', + 'Warehouse' => 'Warehouse', + 'warning-letter-content' => '警告信内容', + 'wednesday' => '星期三', + "Weight of A Bag" => "一包的é‡é‡", + 'WEEKLY' => 'æ¯å‘¨', + 'Welcome to your new system' => '欢迎使用您的新系统ï¼', + 'Wet' => '潮湿', + 'What type of vehicle license' => '哪类车辆/驾照', + 'When will you be available for work' => '您什么时候å¯ä»¥ä¸Šç­ï¼Ÿ', + 'Where we are' => '地点', + 'Whos Absent Today' => '今日缺席者', + 'Whos Work Today' => '今日上ç­è€…', + 'Widow' => '寡妇', + 'Word MC' => 'Word M/C', + 'Work' => '工作', + 'Work Day' => '工作天', + 'Work Days' => '工作日', + 'work_day_calculation' => '工作日计算', + 'Working Hour' => '工作时间', + 'working_hours' => '工作时间', + 'working_start' => '工作开始时间', + 'working_title' => '工作标题', + 'working_day_include' => '工作日包括', + 'Worker Welfare' => '工人ç¦åˆ©', + 'Working Day' => '工作日', + 'WIP' => 'åŠæˆå“', + 'Welcome to XXXX Group!' => '欢迎æ¥åˆ°XXXX集团ï¼', + 'weekly' => 'æ¯ä¸ªç¤¼æ‹œ', + 'Wallet' => 'Wallet', + 'WINDOWED' => 'çª—å£æœŸ', + + + //x + 'x_minutes_for_ot_rounding_number_format' => 'X 分钟为加ç­è¿›ä½å€¼ï¼Œæ•°å­—æ ¼å¼', + 'x_minutes_later_clock_out_counted_as_ot' => 'è¶…æ—¶ X 分钟åŽè®°ä¸ºåŠ ç­ï¼Œæ—¶é—´æ ¼å¼', + + + // y + 'Year' => 'å¹´', + 'Years known' => '为期', + 'yes see you there' => '是的,到时è§ï¼', + 'YES' => '是', + 'yes' => '是', + 'you_still_can_try' => '您还å¯ä»¥å°è¯•', + 'Your advance has been' => '您的预支申请已', + 'Your advance was submitted' => '您的预支申请已æäº¤ã€‚', + 'your username or password is incorrect' => 'Your username or password is incorrect!', + 'you are only allowed to upload 5 files' => '您åªèƒ½ä¸Šä¼  5 个文件。', + 'yearly' => 'æ¯å¹´', + + + + + // language + 'English' => '英文', + 'Nepali' => '尼泊尔语', + 'Burmese' => '缅甸语', + 'Malay' => 'é©¬æ¥æ–‡', + 'Chinese' => '中文', + + + // month + 'Jan' => 'Jan', + 'Feb' => 'Feb', + 'Mar' => 'Mar', + 'Apr' => 'Apr', + 'May' => 'May', + 'Jun' => 'Jun', + 'Jul' => 'Jul', + 'Aug' => 'Aug', + 'Sep' => 'Sep', + 'Oct' => 'Oct', + 'Nov' => 'Nov', + 'Dec' => 'Dec', + + // Language Proficiency + 'GOOD' => '好', + 'AVERAGE' => '一般', + 'POOR' => 'å·®', + 'ENGLISH' => '英语', + 'MANDARIN' => '中文', + 'BAHASA MALAYSIA' => '马æ¥è¯­', + 'Other' => 'å…¶ä»–', + + // Reference Detail + 'REFERENCE DETAIL' => '推è人详情', + 'LIST AT LEAST TWO (2) FORMER SUPERVISOR, HR MANAGER AND/OR COLLEAGUE.' => '请列出至少两ä½å‰ä¸»ç®¡ã€äººäº‹ç»ç†æˆ–åŒäº‹ã€‚', + 'Name' => 'å§“å', + 'Position' => 'èŒä½', + 'company' => 'å…¬å¸', + 'Contacts no.' => 'è”系电è¯', + 'Years known' => '认识年é™', + + // Employment History + 'EMPLOYMENT HISTORY' => '工作ç»åކ', + 'CURRENT COMPANY :' => 'ç›®å‰å…¬å¸ï¼š', + 'CURRENT POSITION :' => 'ç›®å‰èŒä½ï¼š', + 'FULL ADDRESS :' => '完整地å€ï¼š', + 'DATE JOIN :' => 'å…¥èŒæ—¥æœŸï¼š', + 'DATE LEFT :' => 'ç¦»èŒæ—¥æœŸï¼š', + 'BASIC SALARY :' => '基本工资:', + 'FIX AllOWANCE :' => '固定津贴:', + 'REASON FOR LEAVING :' => '离èŒåŽŸå› ï¼š', + + // Subsequent Employment + 'SUBSEQUENT EMPLOYMENT HISTORY' => '之åŽçš„工作ç»åކ', + 'Employment Record' => '工作记录', + 'Company:' => 'å…¬å¸ï¼š', + 'Position:' => 'èŒä½ï¼š', + 'Date Join:' => 'å…¥èŒæ—¥æœŸï¼š', + 'Date Left:' => 'ç¦»èŒæ—¥æœŸï¼š', + 'Basic Salary:' => '基本工资:', + 'Fix Allowance:' => '固定津贴:', + 'Reason for Leaving:' => '离èŒåŽŸå› ï¼š', + + // Other Information + 'OTHER INFORMATION' => '其他资料', + 'WHAT IS YOUR INVOLVEMENT IN THE FOLLOWING ACTIVITY :' => '您å‚与以下活动的频率如何:', + 'NEVER' => '从ä¸', + 'OCCASIONALLY' => 'å¶å°”', + 'REGULARLY' => 'ç»å¸¸', + 'HABITUAL' => '习惯性', + 'GAMBLING' => '赌åš', + 'DRINKING' => 'å–é…’', + 'SMOKING' => 'å¸çƒŸ', + 'DRUG TAKING' => '叿¯’', + + // Questions 1–15 + '1) DID YOU SUFFER FROM ANY PHYSICAL DISABILITY, CHRONIC AILMENT HANDICAP, ALLERGIES OR SERIOUS ILLNESS?' => '1ï¼‰æ‚¨æ˜¯å¦æ‚£æœ‰ä»»ä½•èº«ä½“æ®‹ç–¾ã€æ…¢æ€§ç–¾ç—…ã€è¿‡æ•或严é‡ç–¾ç—…?', + 'IF YES, PLEASE GIVE DETAILS:' => '如果是,请详细说明:', + 'NO' => 'å¦', + '2) ARE YOU TAKING ANY LONG-TERM MEDICATION FOR DIABETIC, ASTHMA, ETC.?' => '2ï¼‰æ‚¨æ˜¯å¦æ­£åœ¨é•¿æœŸæœç”¨ç³–å°¿ç—…ã€å“®å–˜ç­‰è¯ç‰©ï¼Ÿ', + '3) PREGNANCY BEFORE JOINING (CURRENTLY / PLANNING IN COMING FEW THREE (3) MONTHS)?' => '3)入èŒå‰æ˜¯å¦æ€€å­•(目å‰/计划在未æ¥ä¸‰ä¸ªæœˆå†…)?', + '4) ARE YOU WILLING TO TRANSFER TO A NEW DEPARTMENT OR COMPANY IF THE OPPORTUNITY ARISES?' => '4ï¼‰å¦‚æžœæœ‰æœºä¼šï¼Œæ‚¨æ˜¯å¦æ„¿æ„è°ƒèŒè‡³æ–°éƒ¨é—¨æˆ–å…¬å¸ï¼Ÿ', + 'A. WITH RELOCATION:' => 'A. éœ€è¦æ¬è¿ï¼š', + 'B. WITHOUT RELOCATION:' => 'B. 无需æ¬è¿ï¼š', + '5) HAVE YOU EVER BEEN DISMISSED, DISCHARGED, OR LAID OFF FROM ANY EMPLOYMENT?' => '5ï¼‰æ‚¨æ˜¯å¦æ›¾è¢«è§£é›‡ã€è¾žé€€æˆ–è£å‘˜ï¼Ÿ', + '6) HAVE YOU EVER BEEN CHARGED IN A COURT LAW?' => '6ï¼‰æ‚¨æ˜¯å¦æ›¾è¢«æ³•院起诉?', + '7) HAVE YOU BEEN DECLARED BANKRUPTCY?' => '7ï¼‰æ‚¨æ˜¯å¦æ›¾è¢«å®£å‘Šç ´äº§ï¼Ÿ', + '8) ARE YOU CURRENTLY EXPERIENCING ANY FINANCIAL DIFFICULTIES?' => '8ï¼‰æ‚¨ç›®å‰æ˜¯å¦é¢ä¸´ä»»ä½•ç»æµŽå›°éš¾ï¼Ÿ', + '9) HAVE YOU APPLIED TO OUR COMPANY BEFORE?' => '9ï¼‰æ‚¨æ˜¯å¦æ›¾ç”³è¯·è¿‡æœ¬å…¬å¸èŒä½ï¼Ÿ', + 'POSITION APPLIED:' => '申请èŒä½ï¼š', + '10) HAVE YOU BEEN INVOLVED IN A TRADE DISPUTE REFERRED TO LABOUR COURT?' => '10ï¼‰æ‚¨æ˜¯å¦æ›¾å‚与被æäº¤è‡³åŠ³å·¥æ³•é™¢çš„åŠ³èµ„çº çº·ï¼Ÿ', + '11) DO YOU OWN A CAR AND/OR MOTORCYCLE WITH VALID LICENSE?' => '11ï¼‰æ‚¨æ˜¯å¦æ‹¥æœ‰æ±½è½¦å’Œ/æˆ–æ‘©æ‰˜è½¦ï¼Œå¹¶æŒæœ‰æœ‰æ•ˆé©¾é©¶æ‰§ç…§ï¼Ÿ', + '12) ARE YOU WILLING TO WORK OVERTIME?' => '12ï¼‰æ‚¨æ˜¯å¦æ„¿æ„加ç­ï¼Ÿ', + '13) DO YOU HAVE ANY OTHER SIDE JOB OR BUSINESS?' => '13ï¼‰æ‚¨æ˜¯å¦æœ‰å…¼èŒæˆ–其他业务?', + '14) WHAT ATTRACTED YOU TO THIS CAREER OPPORTUNITY?' => '14)是什么å¸å¼•您申请这个èŒä½ï¼Ÿ', + '15) WHAT ARE YOUR CAREER GOALS IN 5 YEARS, AND HOW TO ACHIEVE THEM?' => '15)您未æ¥äº”å¹´çš„èŒä¸šç›®æ ‡æ˜¯ä»€ä¹ˆï¼Ÿæ‚¨å°†å¦‚何实现这些目标?', + + // Declaration + 'PRIVACY NOTICE FOR PERSONAL DATA' => '个人资料éšç§å£°æ˜Ž', + 'BY PROVIDING PERSONAL DATA AS STATED...' => '通过æä¾›æœ¬ç”³è¯·è¡¨ä¸­çš„ä¸ªäººèµ„æ–™ï¼Œæˆ‘åŒæ„公叿 ¹æ®ã€Šä¸ªäººèµ„æ–™ä¿æŠ¤æ³•ã€‹å¤„ç†è¿™äº›èµ„料,并确认所æä¾›å†…容准确完整。', + 'FULL NAME' => 'å…¨å', + 'NRIC NUMBER' => '身份è¯å·ç ', + 'DATE' => '日期', + 'ACKNOWLEDGEMENT AND AUTHORIZATION' => '确认与授æƒ', + 'I HEREBY DECLARE THAT ALL PARTICULARS...' => '本人声明此表中所æä¾›çš„ä¿¡æ¯å’Œæ–‡ä»¶çœŸå®žæ— è¯¯ã€‚如有虚å‡ï¼Œå…¬å¸æœ‰æƒç«‹å³ç»ˆæ­¢é›‡ä½£å…³ç³»ï¼Œä¸”ä¸ä½œä»»ä½•èµ”å¿ã€‚', + 'Please acknowledge by signing below :' => '请在下方签å确认:', + 'Click To Sign Here' => '点击此处签å', + 'Clear' => '清除', +] ; +?> \ No newline at end of file diff --git a/languages/en.php b/languages/en.php new file mode 100644 index 0000000..0aef783 --- /dev/null +++ b/languages/en.php @@ -0,0 +1,1398 @@ + '1st', + '1time' => 'One Time Only', + '2nd' => '2nd', + '3rd' => '3rd', + '4th' => '4th', + '3 months' => '3 months', + '6 months' => '6 months', + '12 months' => '12 months', + + + // a + 'Are you sure to get the redemption code?' => 'Are you sure to get the redemption code?', + 'Allow Switch Branch' => 'Allow Switch Branch', + 'Allow Production' => 'Allow Production', + 'Allow Store' => 'Allow Store', + 'Allow Comment' => 'Allow Comment', + 'Allow Warning Letter' => 'Allow Warning Letter', + 'allowance item' => 'Allowance Item', + 'Absent' => 'Absent', + 'Absent Days' => 'Absent Days', + 'Approve' => 'Approve', + 'APPROVED BY' => 'APPROVED BY', + 'Approve by' => 'Approve by', + 'Approvers Position' => 'Approver\'s Position', + 'Absent Deduct Salary' => 'Absent (Deduct Salary)', + 'Absent Punch Deduct Salary' => 'Absent Punch (Deduct Salary)', + 'account' => 'account', + 'Account' => 'Account', + 'ACCOUNT MANAGER' => 'ACCOUNT MANAGER', + 'Action' => 'Action', + 'Active' => 'Active', + 'Active All' => 'Active All', + 'Additional Details' => 'Additional Details', + 'Address' => 'Address', + 'add_group' => 'Add Group', + 'add_new' => 'Add New', + 'advance' => 'Advance', + 'advance-new' => 'Advance New', + 'advance-update' => 'Advance Update', + 'Advance was submitted' => 'Advance was submitted.', + 'After' => 'After', + 'afternoon_hours' => 'Afternoon Hours', + 'afternoon_start' => 'Afternoon Start', + 'afternoon_end' => 'Afternoon End', + 'Aims ambitions' => 'Aims / ambitions', + 'All' => 'All', + 'Allow Allowance' => 'Allow Allowance', + 'Allow Punch' => 'Allow Punch', + 'Allow Topup' => 'Allow Top Up', + 'allowance' => 'allowance', + 'Allowance' => 'Allowance', + 'Allowance By 1 month working day' => 'Allowance By 1 month working day', + 'Allowance Food' => 'Allowance Food', + 'Allowance Food Days' => 'Allowance Food Days', + 'Allowance Food Total' => 'Allowance Food Total', + 'Allowance Mobile Topup' => 'Allowance Mobile Topup', + 'Allowance Monthly' => 'Allowance Monthly', + 'Allowance Monthly Attend' => 'Allowance Monthly Attend', + 'Allowance Monthly Increment' => 'Allowance Monthly Increment', + 'Allowance Monthly Increment Bonus' => 'Allowance Monthly Increment(Bonus)', + 'Allowance Target' => 'Allowance Target', + 'Allowance Topup' => 'Allowance Topup', + 'all_devices_for_the_selected_user_were_disconnected' => 'All devices for the selected user(s) were disconnected.', + 'amount' => 'Amount', + 'Amount bonus' => 'Amount (bonus)', + 'Amount deduct' => 'Amount (deduct)', + 'Amount RM' => 'Amount (RM)', + 'AND' => 'AND', + 'announcement' => 'Announcement', + 'announcement-new' => 'Announcement New', + 'announcement-update' => 'Announcement Update', + 'Announcement Type' => 'Announcement Type', + 'Announcement View' => 'Announcement View', + 'Annual' => 'Annual', + 'annual' => 'annual', + 'Annual Days' => 'Annual Days', + 'Annual Leave' => 'Annual Leave', + 'application' => 'Application', + 'Application Form' => 'Application Form', + 'Applications signature' => 'Application\'s signature', + 'Approvers signature' => 'Approver\'s Signature', + 'Area' => 'Area', + 'Are you willing to work overtime' => 'Are you willing to work overtime?', + 'Are you willing to work under pressure' => 'Are you willing to work under pressure?', + 'Are you able to join us' => 'Are you able to join us?', + 'are you sure to vote this' => 'Are you sure to vote this?', + 'Assign By' => 'Assign By', + 'Assigned By' => 'Assigned By', + 'attendance' => 'Attendance', + 'attended' => 'Attended', + 'Attendance Allowance' => 'Attendance Allowance', + 'attendance-qrcode' => 'Attendance Qr Code', + 'Attendance Today' => 'Attendance Today', + "Attention" => "Attention", + "Title Attention" => "Title Attention", + 'Author' => 'Author', + 'Auto Execution' => 'Auto Execution', + 'ACKNOWLEDGEMENT AND AUTHORIZATION' => 'ACKNOWLEDGEMENT AND AUTHORIZATION', + 'Achievement' => 'Achievement', + 'Are you exhibiting 2 or more symptoms as listed below?' => 'Are you exhibiting 2 or more symptoms as listed below?', + 'Are you a MOH COVID-19 volunteer in the last 14 days?' => 'Are you a MOH COVID-19 volunteer in the last 14 days?', + 'Appointment Date' => 'Appointment Date', + 'Appointment Time' => 'Appointment Time', + 'Assigned' => 'Assigned', + 'Approved' => 'Approved', + 'Adjustment' => 'Adjustment', + 'Appointment Date From' => 'Appointment Date From', + 'Appointment Date To' => 'Appointment Date To', + 'Allow Adjustment Branch' => 'Allow Adjustment Branch', + 'AGE' => 'AGE', + 'ACCREDITED BY' => 'ACCREDITED BY', + + + // b + 'Branch Transaction' => 'Branch Transaction', + 'Bako' => 'Bako', + 'Back' => 'Back', + 'Bag' => 'Bag', + 'Basket' => 'Basket', + 'Bank' => 'Bank', + 'Bonus' => 'Bonus', + 'Bank Account No' => 'Bank Account No', + 'Basic' => 'Basic', + 'Basic Salary' => 'Basic Salary', + 'Bean' => 'Bean', + 'be specific' => '(be specific)', + 'before' => 'Before', + 'Benefit' => 'Benefit', + 'BENEFIT' => 'BENEFIT(s)', + 'Birth Date' => 'Birth Date', + 'Boiler' => 'Boiler', + 'BOILER' => 'BOILER', + 'branch' => 'Branch', + 'Branch Geometry' => 'Branch Geometry', + 'brand' => 'Brand', + 'break_hours' => 'Break Hours', + 'break_start' => 'Break Start', + 'break_end' => 'Break End', + 'Broken' => 'Broken', + 'BROKEN' => 'BROKEN', + 'Broken_KG' => 'Broken (KG)', + 'BUDDHIST' => 'BUDDHIST', + 'by_department' => 'By Department', + 'by_user' => 'By User', + 'by_schedule' => 'By Schedule', + 'Batch Number' => "Batch Number", + 'Besides the above, are you exhibiting any of the symptoms listed below?' => 'Besides the above, are you exhibiting any of the symptoms listed below?', + 'Body ache' => 'Body ache', + 'Branch To Visit' => 'Branch To Visit', + 'By Personal' => 'By Personal', + 'By Personal Report' => 'By Personal Report', + 'By Branch' => 'By Branch', + 'By Branch Report' => 'By Branch Report', + + + // c + 'COMPANY NAME' => 'COMPANY NAME', + 'cause_letter' => 'Cause Letter', + 'call' => 'Call', + 'Car' => 'Car', + 'Carton' => 'Carton', + 'Cash' => 'Cash', + 'CASH' => 'CASH', + 'Category' => 'Category', + 'Career Plan' => 'Career Plan', + 'Charge' => 'Charge', + 'Chart' => 'Chart', + 'Charge Absent' => 'Charge Absent', + 'Charge Absent Punch' => 'Charge Absent Punch', + 'Charge Advance' => 'Charge Advance', + 'Charge Comment' => 'Charge Comment', + 'Charge Early Out' => 'Charge Early Out', + 'Charge Gas' => 'Charge Gas', + 'Charge Give Away' => 'Charge Give Away', + 'Charge Hostel' => 'Charge Hostel', + 'Charge Late' => 'Charge Late', + 'Charge Late Rest' => 'Charge Late Rest', + 'Charge Skhppa' => 'Charge Skhppa', + 'Charge Target' => 'Charge Target', + 'Charge Time Off' => 'Charge Time Off', + 'Checked' => 'Checked', + 'Check All' => 'Check All', + 'check_if_fixed_working_hours' => 'Check if fixed working hours?', + 'check_if_flexible_hours' => 'Check if flexible hours?', + 'check_if_have_OT' => 'Check if have OT?', + 'check_if_morning_count_as_ot' => 'Check if morning count as OT?', + 'check_if_off_duty' => 'Check if off duty?', + 'check_if_ot_is_count_as_total_work' => 'Check if OT is count as total work?', + 'Chemical' => 'Chemical', + 'Check staff leave' => 'Check Staff Leave', + 'CHEQUE' => 'CHEQUE', + 'Chief' => 'Chief', + 'Child Relief' => 'Child Relief', + 'CHINESE' => 'CHINESE', + 'CHRISTIAN' => 'CHRISTIAN', + 'Choose Work hour' => 'Choose Work hour', + 'chosen' => 'You Voted This', + 'Claim' => 'Claim', + 'Claim Annual Salary' => 'Claim Annual Salary', + 'Claim Medical Fee' => 'Claim Medical Fee', + 'Claim Medical Salary' => 'Claim Medical Salary', + 'Claim Left Amount' =>'Claim Left Amount', + 'Cleaner' => 'Cleaner', + 'Clear' => 'Clear', + 'Click yes to allow button production' => 'Click yes to allow button production', + 'Click yes to allow button store' => 'Click yes to allow button store', + 'Click yes to allow button comment' => 'Click yes to allow button comment', + 'Click yes to allow button warning letter' => 'Click yes to allow button warning letter', + 'Click yes to allow button punch card' => 'Tick to allow button punch card.', + 'Click yes to allow food allowance' => 'Tick to allow food allowance.', + 'Click yes to allow topup allowance' => 'Tick to allow topup allowance.', + 'Click yes to allow button switch branch' => 'Click yes to allow button switch branch', + 'Code' => 'Code', + 'Comission' => 'Comission', + 'Comment' => 'Comment', + 'Comment was submitted' => 'Comment was submitted.', + 'Confirm'=> 'Confirm', + 'Confirm to change this employment status to' => 'Confirm to change this employment status to ', + 'Confirmation' => 'Confirmation', + 'confirmed' => 'confirmed', + 'CONFIRMED' => 'CONFIRMED', + 'Confirmed' => 'Confirmed', + 'Contacts no' => 'Contacts no.', + 'CONTRACT' => 'CONTRACT', + 'Contract Salary' => 'Contract Salary', + 'copy_paste' => 'Copy & Paste', + 'Cost' => 'Cost', + 'Contract' => 'Contract', + 'Country' => 'Country', + 'Created At' => 'Created At', + 'Created By' => 'Created By', + 'Current Car' => 'Current Car', + 'created_date' => 'Created Date', + 'Current Level' => 'Current Level', + 'Current Group' => 'Current Group', + 'customer' => 'Customer', + 'Customer Details' => 'Customer Details', + 'Customer List' => 'Customer List', + 'Cutting' => 'Cutting', + 'check_if_count_day_include_rest_hours' => 'Check if count day include rest hours.', + 'Comment/Warning Today' => 'Comment/Warning Today', + 'Content' => 'Content', + 'Chills' => 'Chills', + 'Cough' => 'Cough', + 'Contact Person' => 'Contact Person', + 'Contact Number' => 'Contact Number', + 'Car Plate' => 'Car Plate', + 'Corporate Staff' => 'Corporate Staff', + 'Completed' => 'Completed', + 'Completed Task' => 'Completed Task', + 'Completed Or Incompleted Report' => 'Completed Or Incompleted Report', + 'Completed' => 'Completed', + 'Cancelled' => 'Cancelled', + 'Cross Department' => 'Cross Department', + 'Click yes to allow adjustment branch' => 'Click yes to allow adjustment branch', + 'CLASS' => 'CLASS', + + + // d + 'Degree' => 'Degree', + 'DAILY' => 'DAILY', + 'Daily' => 'Daily', + 'Daily Frying Dept Record' => 'Daily Frying Dept Record', + 'Daily KBA Packing Record' => 'Daily KBA Packing Record', + 'Daily Wet Packing Record' => 'Daily Wet Packing Record', + 'Daily Hours' => 'Daily Hours', + 'Dashboard' => 'Dashboard', + 'date' => 'Date', + 'Date Confirmed' => 'Date Confirmed', + 'Date Approved' => 'Date Approved', + 'Date Created' => 'Date Created', + 'Date From' => 'Date From', + 'Date Joined' => 'Date Joined', + 'Date Month Year' => 'Date (Month/Year)', + 'Date Resigned' => 'Date Resigned', + 'Date of Birth' => 'Date of Birth', + 'DATE OF BIRTH' => 'DATE OF BIRTH', + 'Date To' => 'Date To', + 'Date to offer' => 'Date to offer', + 'Date to return' => 'Date to return', + 'Day' => 'Day', + 'Day From' => 'Day From', + 'Day To' => 'Day To', + 'Days' => 'Days', + 'date_request' => 'Date Request', + 'debtor_type' => 'Debtor Type', + 'Deduction' => 'Deduction', + 'Deduct Hour' => 'Deduct Hour', + 'Deduct Point' => 'Deduct Point', + 'deduction item' => 'Deduction Item', + 'deduct_the_off_duty_x_minutes_later' => 'Deduct the "off duty X minutes later"?', + 'DELIVERY CONTROL OFFICER' => 'DELIVERY CONTROL OFFICER', + 'Department' => 'Department', + 'Description' => 'Description', + 'Deselect all' => 'Deselect all', + 'developed_by_eng' => 'Developed by ', + 'developed_by_cn' => '', + 'DIRECTOR' => 'DIRECTOR', + 'Disabled' => 'Disable', + 'disconnect' => 'Disconnect', + 'Divorced' => 'Divorced', + 'DIVORCED' => 'DIVORCED', + 'Duration' => 'Duration', + 'documentation' => 'Documentation', + 'documentation-new' => 'Documentation New', + 'documentation-update' => 'Documentation Update', + 'DONE' => 'DONE', + 'Done' => 'Done', + 'Done By' => 'Done By', + 'Done At' => 'Done At', + 'Download' => 'Download', + 'Dry' => 'Dry', + 'Dryer' => 'Dryer', + 'Detail' => 'Detail', + 'Difficulty' => 'Difficulty', + 'Date Of Visiting' => 'Date Of Visiting', + 'Diarrhea' => 'Diarrhea', + 'Difficulty breathing' => 'Difficulty breathing', + 'Dear Guest, Welcome to XXXX Group! We are honored to have you in our plant. Kindly fill up this Visitor Registration Form for us to be well-prepared for your visit. Looking forward to meeting you in person soon!' => 'Dear Guest, Welcome to XXXX Group! We are honored to have you in our plant. Kindly fill up this Visitor Registration Form for us to be well-prepared for your visit. Looking forward to meeting you in person soon!', + 'daily' => 'Daily', + 'Designation' => 'Designation', + 'Delayed' => 'Delayed', + 'Department Task Given Report' => 'Department Task Given Report', + 'DRIVING LISENCE' => 'DRIVING LISENCE', + + + // e + 'Debit Bank' => 'Debit Bank', + 'Entitle' => 'Entitle', + 'Early' => 'Early', + 'Early Out' => 'Early Out', + 'Earn Point' => 'Earn Point', + 'Earnings' => 'Earnings', + 'Employee ID' => 'Employee ID', + 'edit' => 'Edit', + 'Edit Current' => 'Edit Current ', + 'Edit Mode' => 'Edit Mode', + 'EDUCATIONAL LEVEL' => 'EDUCATIONAL LEVEL', + 'Education Level' => 'Education Level', + 'EIS Contribution' => 'EIS Contribution', + 'Effective Date' => 'Effective Date', + 'email' => 'Email', + 'Email' => 'Email', + 'EMAIL ADDRESS' => 'EMAIL ADDRESS', + 'EMP' => 'EMP', + 'Employer Epf Rate' => 'Employer Epf Rate', + 'Employment' => 'Employment', + 'Employment date' => 'Employment date', + 'Employment Info' => 'Employment Info', + 'Employment Offer Letter' =>'Employment Offer Letter', + 'EMPLOYMENT APPLICATION FORM' => 'EMPLOYMENT APPLICATION FORM', + 'EMPLOYMENT HISTORY' => 'EMPLOYMENT HISTORY', + 'Employment Status' => 'Employment Status', + 'Employment Interview Details' => 'Employment Interview Details', + 'EMPLOYMENT INJURY & VALIDITY' => 'EMPLOYEMENT INJURY & VALIDITY', + 'EMPLOYMENT INJURY ONLY' => 'EMPLOYEMENT INJURY ONLY', + 'Employee Number' => 'Employee Number', + 'Employee Code' => 'Employee Code', + 'Enabled' => 'Enabled', + 'End Of Probation' => 'End Of Probation', + 'End Time' => 'End Time', + 'End Date' => 'End Date', + 'EPF Membership No' => 'EPF Membership No', + 'Ethnic' => 'Ethnic', + 'EXPECTED SALARY' => 'EXPECTED SALARY', + 'expired date' => 'Expired Date', + 'export' => 'Export ', + 'export_as' => 'Export as ', + 'expenses' => 'Expenses', + 'Efficiency' => 'Efficiency', + 'Executed By' => 'Executed By', + 'Employee' => 'Employee', + 'Excellent' => 'Excellent', + + + // f + 'FINISH' => 'FINISH', + 'factory' => 'Factory', + 'FACTORY MANAGER' => 'FACTORY MANAGER', + 'Family' => 'Family', + 'Female' => 'Female', + 'FEMALE' => 'FEMALE', + 'FAMILY BACKGROUND' => 'FAMILY BACKGROUND', + 'File' => 'File', + 'flexible_hours' => 'Flexible Hours', + 'Food Additives' => 'Food Additives', + 'Food Choise' => 'Food Choise', + 'Foreigner' => 'Foreigner', + 'foreign-only' => 'Foreign Only', + 'FOREIGN WORKERS' => 'FOREIGN WORKER', + 'Format' => 'Format', + 'Food Allowance' => 'Food Allowance', + 'friday' => 'Friday', + 'Fresh' => 'Fresh', + 'from' => 'From', + 'From (Months)' => 'From (Months)', + 'From month' => 'From (month)', + 'From minute' => 'From (minute)', + 'From To' => 'From ~ To', + 'Fried' => 'Fried', + 'Fryer' => 'Fryer', + 'Frying' => 'Frying', + 'fullname' => 'Full Name', + 'Full' => 'Full', + 'Full Attendance' => 'Full Attendance', + 'Full Half' => 'Full / Half', + 'fullstop' => '.', + 'Find Code' => 'Find Code', + 'Fever' => 'Fever', + 'Fatigue' => 'Fatigue', + 'FAMILY PARTICULARS' => 'FAMILY PARTICULARS', + + + // g + 'GRADE' => 'GRADE', + 'Gender' => 'Gender', + 'GENDER' => 'GENDER', + 'Group' => 'Group', + 'Give Away' => 'Give Away', + 'Grinding' => 'Grinding', + 'Grinding Report' => 'Grinding Report', + 'Give away was submitted' => 'Give away was submitted.', + 'GPS' => 'GPS', + 'Give Item' => 'Give Item', + 'Go to the semi-finished products department' => 'Go to the semi-finished products department', + 'Good' => 'Good', + 'Give Point' => 'Give Point', + + + // h + 'health' => 'Health', + 'Health' => 'Health', + 'Half' => 'Half', + 'Halal' => 'Halal', + 'Hide' => 'Hide', + 'Hours' => 'Hours', + 'has reach limit this year' => 'has reach limit this year.', + 'Have a contract with the previous employer' => 'Have a contract with the previous employer?', + 'Headquarter' => 'Headquarter', + 'HQ' => 'HQ', + 'HIGH' => 'HIGH', + 'HINDU' => 'HINDU', + 'Holiday' => 'Holiday ', + 'Hostel' => 'Hostel', + 'House Tel' => 'House Tel', + 'hr' => 'Hr', + 'HR' => 'HR', + 'HUMAN RESOURCES OFFICER' => 'HUMAN RESOURCES OFFICER', + 'Hrs/Day' => 'Hrs/Day', + 'Health Screening Form for Visitors' => 'Health Screening Form for Visitors', + 'Have you been in contact with a confirmed novel Covid-19 patient in the past 14 days?' => 'Have you been in contact with a confirmed novel Covid-19 patient in the past 14 days?', + 'Have you been to affected countries in the past 14 days' => 'Have you been to affected countries in the past 14 days', + 'Headache' => 'Headache', + 'Have you attended any event / areas associated with known COVID-19 cluster?' => 'Have you attended any event / areas associated with known COVID-19 cluster?', + 'Have you had close contact with any confirmed or suspected COVID-19 cases within the last 14 days?' => 'Have you had close contact with any confirmed or suspected COVID-19 cases within the last 14 days?', + 'Have you travelled abroad within the last 14 days?' => 'Have you travelled abroad within the last 14 days?', + 'HOME TELEPHONE' => 'HOME TELEPHONE', + + + + // i + 'I certify that all answers given herein are true and complete to the best of my knowledge' => 'I certify that all answers given herein are true and complete to the best of my knowledge.', + 'I authorize investigation of all statements contained in this application for employment as may be necessary in arriving at an employment decision' => 'I authorize investigation of all statements contained in this application for employment as may be necessary in arriving at an employment decision.', + 'IC' => 'IC', + 'IC Passport' => 'IC / Passport', + 'IC Passport Image' => 'IC / Passport Image', + 'ID' => 'ID', + 'ID No' => 'ID No', + 'if_direct_count_as_1_day' => 'If direct count as 1 day?', + 'if_early' => 'If Early', + 'If early Checkout' => 'If early Check Out', + 'If Late Checkin' => 'If Late Check In', + 'If Late Rest' => 'If Late Rest', + 'if not put' => 'if not put', + 'If yes' => 'If yes', + 'If you need help getting started check out to our user manual' =>'If you need help getting started, check out to our user manual.', + 'If you need help call us at' => 'If you need help, call us at', + 'If any technical issue kindly contact us' => 'If any technical issue, kindly contact us.', + 'Image' => 'Image', + 'IMPORTANT' => 'IMPORTANT', + 'Import' => 'Import', + 'Import Attendance' => 'Import Attendance', + 'Import Point' => 'Import Point', + 'In' => 'In', + 'In the event of employment that false or misleading information given in my application or interview may result in an immediate termination of employment' => 'In the event of employment that false or misleading information given in my application or interview may result in an immediate termination of employment.', + 'Inactive' => 'Inactive', + 'Inactive All' => 'Inactive All', + 'Incentive' => 'Incentive', + 'INFORMATION RESOURCES DEPARTMENT' => 'INFORMATION RESOURCES DEPARTMENT', + 'INDIAN' => 'INDIAN', + 'Individual' => 'Individual', + 'InOut' => 'In/Out', + 'insurance' => 'Insurance', + 'Interview' => 'Interview', + 'Interview by' => 'Interview by', + 'Interview Details' => 'Interview Details', + 'Interview date time' => 'Interview date / time', + 'Interviewers signature' => 'Interviewer\'s Signature', + 'Interviewers Position' => 'Interviewer\'s Position', + 'Invoice' => 'Invoice', + 'Invoice Yearly Report' => 'Invoice Yearly Report', + 'Input your staff id number only' => 'Remarks: Input your staff ID number ONLY', + 'Item' => 'Item', + 'Items' => 'Items', + 'Item Code' => 'Item Code', + 'Item Name' => 'Item Name', + 'Item Point' => 'Item Point', + 'IC' => 'IC', + 'Income Tax No' => 'Income Tax No. (SG / OG)', + 'Incharge Status' => 'Incharge Status', + 'If you have the following symptom(s), please tick the relevant box(es)' => 'If you have the following symptom(s), please tick the relevant box(es)', + 'Invalid Date' => 'Invalid Date', + 'Interview' => 'Interview', + 'Identity' => 'Identity', + 'Inbox' => 'Inbox', + 'Incompleted' => 'Incompleted', + + + // j + 'job' => 'Job', + 'Job Position' => 'Job Position', + 'Job Section' => 'Job Section', + 'Job Status' => 'Job Status', + 'Job Type' => 'Job Type', + 'job-list-new' => 'Job List New', + 'job-list-edit' => 'Job List Edit', + 'Job Calendar' => 'Job Calendar', + 'Job Invoice' => 'Job Invoice', + 'Job List' => 'Job List', + 'Job Mission' => 'Job Mission', + + + // k + 'knowledge' => 'Knowledge', + 'KG' => 'KG', + 'Keep In View' => 'Keep In View', + 'KM23 Fried' => 'KM23 Fried', + + + // l + 'LANGUAGE PROFICIENCY' => 'LANGUAGE PROFICIENCY', + 'Language spoken' => 'Language (spoken)', + 'Language written' => 'Language (written)', + 'last_login' => 'Last Login', + 'last_login_device' => 'Last Login Device', + 'last_login_IP' => 'Last Login IP', + 'last_login_location' => 'Last Login Location', + 'Last Check In' => 'Last Check In', + 'Last drawn salary' => 'Last drawn salary', + 'Last Updated' => 'Last Updated', + 'Late' => 'Late', + 'Late Report' => 'Report Late', + 'Leave Type' => 'Leave Type', + 'leave has been' => 'leave has been', + 'Leave Name' => 'Leave Name', + 'leave-new' => 'Leave New', + 'leave-update' => 'Leave Update', + 'Leftover Sisa' => 'Leftover (Sisa)', + 'Letter' => 'Letter', + 'Letterhead' => 'Letterhead', + 'level' => 'Level ', + 'Level Requirement' => 'Level Requirement', + 'L_F' => 'L/F', + 'license' => 'License', + 'License Record' => 'License Record', + 'Line Supervision' => 'Line Supervision', + 'list' => ' List', + 'link' => 'Link', + 'Local' => 'Local ', + 'Local1' => 'Local', + 'local-only' => 'Local Only', + 'LOCAL WORKER' => 'LOCAL WORKER', + 'login_code' => 'Login Code', + 'Logout' => 'Logout', + 'Leave' => 'Leave', + 'leave' => 'Leave', + 'Loss of smell' => 'Loss of smell', + 'Loss of taste' => 'Loss of taste', + 'Late Task' => 'Late Task', + + + // m + 'Movement' => 'Movement', + 'Media' => 'Media', + 'Mins' => 'Mins', + 'Min Quantity' => 'Min Quantity', + 'Marital Status' => 'Marital Status', + 'MARITAL STATUS' => 'MARITAL STATUS', + 'Mailing Address' => 'Mailing Address', + 'Machine' => 'Machine', + 'MALAY' => 'MALAY', + 'Male' => 'Male', + 'MALE' => 'MALE', + 'malaysia' => 'Malaysia', + 'Maintenance' => 'Maintenance', + 'MAINTENANCE' => 'MAINTENANCE', + 'M_A_M' => '(M/A) M?', + 'Marital Status' => 'Marital Status', + 'Married' => 'Married', + 'MARRIED' => 'MARRIED', + 'MPower' => 'MPower', + 'marketing' => 'Marketing', + 'marketing-new' => 'Marketing New', + 'marketing-edit' => 'Marketing Edit', + 'Marketing Record' => 'Marketing Record', + 'maximum_OT_hours' => 'Maximum OT Hours', + 'Medical Claim' => 'Medical Claim', + 'Medical Claim was submitted' => 'Medical Claim was submitted.', + 'Medical Leave' => 'Medical Leave', + 'Medical Days' => 'Medical Days', + 'MEDIUM' => 'MEDIUM', + 'Medical Fee' => 'Medical Fee', + 'Medical Fee(max)' => 'Medical Fee(max)', + 'Message' => 'Message', + 'miss' => 'Miss', + 'MC' => 'MC', + 'MCResign' => 'MC / Resign', + 'mr' => 'Mr', + 'mrs' => 'Mrs', + 'ms' => 'Ms', + 'Mobile' => 'Mobile', + 'More Image' => 'More Image', + 'Mobile No' => 'Mobile No', + 'MOBILE NO.' => 'MOBILE NO.', + 'model' => 'Model', + 'modified_date' => 'Modified Date', + 'monday' => 'Monday', + 'MONTH' => 'MONTH', + 'Monthly' => 'Monthly', + 'MONTHLY' => 'MONTHLY', + 'morning_end' => 'Morning End', + 'morning_hours' => 'Morning Hours', + 'morning_start' => 'Morning Start', + 'move_to_trash' => 'Move to trash', + 'MUSLIM' => 'MUSLIM', + 'Muslim Zakat Fund' => 'Muslim Zakat Fund', + 'myr' => '(MYR)', + 'Meeting Venue / Level / Department To Visit' => 'Meeting Venue / Level / Department To Visit', + 'Meeting Venue / Meet up Venue or Department / Department To Visit' => 'Meeting Venue / Meet up Venue or Department / Department To Visit', + 'monthly' => 'Monthly', + 'Main Category' => 'Main Category', + 'Minus Point' => 'Minus Point', + + + // n + 'NAME OF SCHOOL / COLLEGE / UNIVERSITY' => 'NAME OF SCHOOL / COLLEGE / UNIVERSITY', + 'name' => 'Name', + 'Name' => 'Name', + 'NAME' => 'NAME', + 'NICKNAME' => 'NICKNAME', + 'NAME IN CHINESE CHARACTER (IF APPLICABLE)' => 'NAME IN CHINESE CHARACTER (IF APPLICABLE)', + 'FULL NAME (AS PER NRIC)' => 'FULL NAME (AS PER NRIC)', + 'Name of father' => 'Name of father', + 'Name of mother' => 'Name of mother', + 'Name of spouse' => 'Name of spouse', + 'Name of school collage university' => 'Name of school / collage / university', + 'Nationality' => 'Nationality', + 'NATIONALITY' => 'NATIONALITY', + 'Need Sign Back' => 'Need Sign Back', + 'Next' => 'Next', + 'Next Day' => 'Next Day', + 'Next Review Date' => 'Next Review Date', + 'Next Month' => 'Next Month', + 'Next Year' => 'Next Year', + 'Next Group' => 'Next Group', + 'new' => 'new', + 'New' => 'New ', + 'New Customer' => 'New Customer', + 'Nett Pay' => 'Nett Pay', + 'night_hours' => 'Night Hours', + 'night_start' => 'Night Start', + 'night_end' => 'Night End', + 'no' => 'No', + 'NO' => 'NO', + 'No' => 'No.', + 'no_branch' => 'No branch!', + 'no_data' => 'No data.', + 'no_image' => 'No image.', + 'no_record' => 'No record.', + 'NO CONTRIBUTION' => 'NO CONTRIBUTION', + 'NO TAX CONTRIBUTION' => 'NO TAX CONTRIBUTION', + 'NON TAX RESIDENT' => 'NON TAX RESIDENT', + 'Nope thanks for inviting' => 'Nope, thanks for inviting.', + 'Non-Halal' => 'Non-Halal', + 'NORMAL' => 'NORMAL', + 'Normal Day' => 'Normal Day', + 'Normal Mode' => 'Normal Mode', + 'Normal Working' => 'Normal Working', + 'Normal Rate' => 'Normal Rate', + 'Normal OT Rate' => 'Normal OT Rate', + 'Notification' => 'Notification', + 'NRIC' => 'NRIC', + 'No Children' => 'No Children', + 'NRIC / Passport No' => 'NRIC / Passport No', + 'Nationality (For Foreigner Only)' => 'Nationality (For Foreigner Only)', + 'Nausea or vomiting' => 'Nausea or vomiting', + 'Nric / Passport No' => 'Nric / Passport No', + 'Not Suitable' => 'Not Suitable', + 'NOTICE PERIOD' =>'NOTICE PERIOD', + + + // o + 'Occupation' => 'Occupation', + 'OCCUPATION' => 'OCCUPATION', + 'Offer' => 'Offer', + 'off_duty' => 'Off Duty', + 'OFFICE HOUR' => 'OFFICE HOUR', + 'office_marketing' => 'Office Marketing', + 'Oil' => 'Oil', + 'Old NRIC' => 'Old NRIC', + 'ONLINE TRANSFER' => 'ONLINE TRANSFER', + 'OR' => 'OR', + 'Order Setting' => 'Order Setting', + 'Order Title' => 'Order Title', + 'or email us' => 'or email us', + 'Original Group' => 'Original Group', + 'Organization Chart' => 'Organization Chart', + 'ot' => 'OT', + 'OT Day' => 'OT Day', + 'OT Holiday' => 'OT Holiday', + 'Ot Hours' => 'OT Hours', + 'Ot Rate' => 'OT Rate', + 'Ot Rest Hours' => 'Ot Rest Hours', + 'Ot Rest Total' => 'Ot Rest Total', + 'Ot Public Hours' => 'Ot Public Hours', + 'Ot Public Total' => 'Ot Public Total', + 'OT Off Day' => 'OT Off Day', + 'OT Work Day' => 'OT Work Day', + 'OTHER' => 'OTHER', + 'Others' => 'Others', + 'OTHERS' => 'OTHER', + 'ot_count_format' => 'OT Count Format', + 'ot_rounding' => 'OT Rounding', + 'ot_start' => 'OT Start', + 'Ot Total' => 'Ot Total', + 'OTP' => 'OTP', + 'Out' => 'Out', + 'Output' => 'Output', + 'Oven' => 'Oven', + 'Oven Time' => 'Oven Time', + 'Oven Packing' => 'Oven / Packing', + 'Oven And Packing Daily Report' => 'Oven and Packing Daily Report', + 'Oven Daily Report' => 'Oven Daily Report', + 'Own any transport' => 'Own any transport', + 'Own strengths' => 'Own strengths', + 'Own weakness' => 'Own weakness', + 'Own Strengths' => 'Own Strengths', + 'Own Weakness' => 'Own Weakness', + 'Others Working' => 'Others Working', + 'Overtime' => 'Overtime', + 'Outstation' => 'Outstation', + 'On Time' => 'On Time', + 'On Time Or Delayed Report' => 'On Time Or Delayed Report', + + + // p + "Pallet" => "Pallet", + 'Paid By' => 'Paid By', + 'Public' => 'Public', + 'Packing' => 'Packing', + 'P.Rate' => 'P.Rate', + 'Public Working' => 'Public Working', + 'Packing All' => 'Packing All', + 'Packing Time' => 'Packing Time', + 'Packing Daily Report' => 'Packing Daily Report', + 'page' => 'Page', + 'Pail' => 'Pail', + 'Passport' => 'Passport', + 'Passport Expired Date' => 'Passport Expired Date', + 'Passport No' => 'Passport No', + 'password' => 'Password', + 'Password Confirmation' => 'Password Confirmation', + 'Payment Details' => 'Payment Details', + 'payment-slip' => 'Payment Slip', + 'payment-slip-new' => 'Payment Slip New', + 'payment-slip-update' => 'Payment Slip Update', + 'Payment Status' => 'Payment Status', + 'Payment Transfer' => 'Payment Transfer', + 'Payment Type' => 'Payment Type', + 'Pending' => 'Pending', + 'PENDING' => 'PENDING', + 'Period' => 'Period', + 'PERMANENT' => 'PERMANENT', + 'permission' => 'Permission', + 'Permit' => 'Permit', + 'Permit From' => 'Permit From', + 'Permit Image' => 'Permit Image', + 'Permit No' => 'Permit No', + 'Permit To' => 'Permit To', + 'Personal Info'=> 'Personal Info', + 'PERSONAL INFORMATION' => 'PERSONAL INFORMATION', + 'PERSONALITY' => 'PERSONALITY', + 'photo' => 'Photo', + 'PKT_KG' => 'PKT/KG', + 'Plastic' => 'Plastic', + 'Please answer the below questions' => 'Please answer the below questions:', + 'please bring your tng card' => 'Remarks: Please bring your TNG card for parking entrance.', + 'Please enter all required fill' => 'Please enter all required field.', + 'please_get_the_verification_code_from_the_owner' =>'Please get the verification code from the owner!', + 'Please list down details of brother and sister if any' => 'Please list down details of brother and sister (if any)', + 'Please list down details of children if any' => 'Please list down details of children (if any)', + 'Please select status' => 'Please select status.', + 'Please state other training ceritication of licenses held' => 'Please state other training, ceritication of licenses held', + 'please choose the best product' => 'Please vote for the best dress:', + 'Point' => 'Point ', + 'POINT' => 'POINT', + 'Point Record' => 'Point Record', + 'Point From' => 'Point From', + 'Point To' => 'Point To', + 'Position' => 'Position', + 'Position company' => 'Position / company', + 'POSITION APPLIED FOR' => 'POSITION APPLIED FOR', + 'Procedure' => 'Procedure', + 'Poor' => 'Poor', + 'preview' => 'Preview', + 'Prev Day' => 'Prev Day', + 'Previous' => 'Previous', + 'Previous current employer' => 'Previous / current employer', + 'Prev Month' => 'Prev Month', + 'Prev Year' => 'Prev Year', + 'Print' => 'Print', + 'Priority' => 'Priority', + 'product' => 'Product', + 'Problem' => 'Problem', + 'Title Problem' => 'Title Problem', + 'Product Movement' => 'Product Movement', + 'productions' => 'Productions', + 'Productions2' => 'Productions 2', + 'Production Department' => 'Production Department', + 'Production Daily Report' => 'Production Daily Report', + 'Productions Items' => 'Productions Items', + 'Productions Remark' => 'Productions Remark', + 'profile' => 'profile', + 'Profile' => 'Profile', + 'Processed' => 'Processed', + 'Profile Image' => 'Profile Image', + 'proforma-invoice' => 'Proforma Invoice', + 'proforma-invoice-edit' => 'Proforma Invoice Edit', + 'Public Holiday' => 'Public Holiday', + 'Public Holiday Rate' => 'Public Holiday Rate', + 'Public Days' => 'Public Days', + 'Public Day Rest' => 'Public Day (Rest)', + 'Public Day Normal' => 'Public Day (Normal)', + 'Public Day OT' => 'Public Day (OT)', + 'Public Day Rate' => 'Public Day Rate', + 'Public Rate' => 'Public Rate', + 'Public Total' => 'Public Total', + 'purchasing' => 'Purchasing', + 'PURCHASING' => 'PURCHASING', + 'pdf'=>'Export to PDF', + 'Personal Contact Number' => 'Personal Contact Number', + 'Personal Contact Number (Include Dial code, Ex: +60xxxxxxxxx)' => 'Personal Contact Number (Include Dial code, Ex: +60xxxxxxxxx)', + 'Personal Email' => 'Personal Email', + 'Progress'=>'Progress', + 'Processing' => 'Processing', + 'PERMANENT ADDRESS' => 'PERMANENT ADDRESS', + 'PROFESSIONAL QUALIFICATIONS (MEMBERSHIPS / TECHNICAL / PROFESSIONAL / OCCUPATION TRAINING)' => 'PROFESSIONAL QUALIFICATIONS (MEMBERSHIPS / TECHNICAL / PROFESSIONAL / OCCUPATION TRAINING)', + 'PROFESSIONAL QUALIFICATION' => 'PROFESSIONAL QUALIFICATION', + + // q + 'QUALIFICATIONS' => 'QUALIFICATIONS', + 'Qrcode' => 'Qrcode', + 'Qrcode Barcode' => 'Qrcode / Barcode', + 'Qty' => 'Qty', + 'QTY_KG' => 'QTY(KG)', + 'QTY KG' => 'QTY KG', + 'QTY PKT' => 'QTY PKT', + 'QTY_PKT_KG' => 'QTY (PKT/KG)', + 'Qualification Major Academic' => 'Qualification (Major Academic)', + 'Quantity' => 'Quantity', + 'QUANTITY TOTAL' => 'QUANTITY TOTAL', + 'quotation-new' => 'Quotation New', + 'quotation-edit' => 'Quotation Edit', + 'Quotation List' => 'Quotation List', + 'Questions' => 'Questions', + + + // r + 'RELATIONSHIP' => 'RELATIONSHIP', + 'Redemption' => 'Redemption', + 'Roll' => 'Roll', + 'Race' => 'Race', + 'Rate' => 'Rate', + 'Rest Day Working' => 'Rest Day Working', + 'RECEIVED BY' => 'RECEIVED BY', + 'Raw Material' => 'Raw Material', + 'Raw Materials' => 'Raw Materials', + 'Raw Materials Soya' => 'Raw Materials Soya', + 'Reason' => 'Reason', + 'Reasons for leaving' => 'Reasons for leaving', + 'Reason of Resign' => 'Reason of Resign', + 'Resign List'=> 'Resign List', + 'REFERENCES' => 'REFERENCES', + 'Reference' => 'Reference', + 'Reject' => 'Reject', + 'REJECTED' => 'REJECTED', + 'Rejected' => 'Rejected', + 'Rejected At' => 'Rejected At', + 'Rejected By' => 'Rejected By', + 'rejected' => 'rejected', + 'Religion' => 'Religion', + 'RELIGION' => 'RELIGION', + 'remark' => 'Remark', + 'remark name'=> "Remark Name", + 'remember_me' => 'Remember Me', + 'Remove' => 'Remove', + 'Remove File' => 'Remove File', + 'remove_photo' => 'Remove Photo', + 'report' => 'report', + 'Report' => 'Report', + 'Reprocessing' => 'Reprocessing', + 'request' => 'Request', + 'Request By' => 'Request By', + 'Request Date' => 'Request Date', + 'Reschedule' => 'Reschedule', + 'Rest' => 'Rest', + 'Reset Working Hours' => 'Reset Working Hours', + 'rest_hours_range' => 'Rest Hours Range', + 'Rest Day' => 'Rest Day', + 'Rest Days' => 'Rest Days', + 'Rest Day Normal' => 'Rest Day (Normal)', + 'Rest Day OT' => 'Rest Day (OT)', + 'Rest Day Rate' => 'Rest Day Rate', + 'Rest Rate' => 'Rest Rate', + 'Rest Total' => 'Rest Total', + 'Result' => 'Result', + 'road-tax' => 'Road Tax', + 'rotate' => 'Rotate', + 'Rest / Public Working' => 'Rest / Public Working', + 'Run Away' => 'Run Away', + 'Run Away List' => 'Run Away List', + 'Runny nose or nasal congestion' => 'Runny nose or nasal congestion', + 'Reason To Visit' => 'Reason To Visit', + 'Resubmit' => 'Resubmit', + 'REFERRAL NAME (IF APPLICABLE)' => 'REFERRAL NAME (IF APPLICABLE)', + 'RESIDENTIAL ADDRESS' => 'RESIDENTIAL ADDRESS', + + + // s + 'search' => 'search', + 'listing' => 'listing', + 'SPOKEN' => 'SPOKEN', + 'START' => 'START', + 'Sorry, no code cannot be redempted.' => 'Sorry, no code cannot be redempted.', + 'Switch To Summary' => 'Switch To Summary', + 'Switch To Efficiency' => 'Switch To Efficiency', + 'salary' => 'Salary', + 'SALARY' => 'SALARY', + 'Salary Name' => 'Salary Name', + 'salary-view' => 'Salary View', + 'Salary staff' => 'Salary staff', + 'Salary Rate' => 'Salary Rate', + 'Salary Report' => 'Salary Report', + 'Salary Type' => 'Salary Type', + 'Salary Letter' => 'Salary Letter', + 'Salary Increment' => 'Salary Increment', + 'Salary report updated' => 'Salary report updated.', + 'Salt' => 'Salt', + 'saturday' => 'Saturday', + 'Save' => 'Save', + 'scan' => 'scan', + 'Scroll' => 'Scroll', + 'select' => 'Select', + 'Sent' => 'Sent', + 'Select all' => 'Select all', + 'Select Branch' => 'Select Branch', + 'Select Status' => 'Select Status', + 'select_a_call' => 'Select a call', + 'Self Punch' => 'Self Punch', + 'setting' => 'Setting', + 'Settings' => 'Settings', + 'set_the_X_hours_before_the_ending_working_hours' => 'Set the X hours before the ending working hours?', + 'Sex' => 'Sex', + 'Shift' => 'Shift', + 'SHIFT' => 'SHIFT', + 'shortbreak_hours' => 'Shortbreak Hours', + 'shortbreak_end' => 'Shortbreak Start', + 'shortbreak_start' => 'Shortbreak End', + 'Short Name' => 'Short Name', + 'Show in Application List' => 'Show in Application List', + 'Show' => 'Show', + 'sick1' => 'Sick', + 'sick' => 'Sick', + 'Sick' => 'Sick', + 'Sick leave' => 'Sick', + 'sick_name' => 'Sick Name', + 'sign_in' => 'Sign In', + 'Sign out' => 'Sign Out', + 'signature' => 'Signature', + 'Single' => 'Single', + 'SINGLE' => 'SINGLE', + 'Size Item' => 'Size Item', + 'Sorry data not found' => 'Sorry, data not found.', + 'Sorry email already exists' => 'Sorry, email already exists.', + 'Sorry failed create Medical Claim' => 'Sorry, failed create Medical Claim.', + 'Sorry failed medical claim' => 'Sorry, failed medical claim, ', + 'Sorry failed update' => 'Sorry, failed to update.', + 'Sorry idno already exists' => 'Sorry, idno already exists.', + 'Sorry invalid action type' => 'Sorry, invalid action type.', + 'Sorry password doesnt exists' => 'Sorry, password does not exists.', + 'Sorry please select at least one' => 'Sorry, please select at least one.', + 'Sorry something error' => 'Sorry, something error', + 'Sorry some of the staff not enough day to confirm' => 'Sorry, some of the staff not enough day to confirm.', + 'Sorry username already exists' => 'Sorry, username already exists.', + 'Sorry image not found' => 'Sorry, image not found.', + 'sorry_password_must_at_least_6_digits' => 'Sorry, password must at least 6 digits!', + 'sorry_please_provide_a_correct_verification_code' => 'Sorry, please provide a correct verifcation code! ', + 'sorry_username_exsits' => 'Sorry, username exsits!', + 'Sorry you cannot apply different year of leave' => 'Sorry, you cannot apply different year of leave.', + 'sorry_your_account_was_in_our_block_list' => 'Sorry, your account was in our block list!', + 'Sorry product exists in your stock' => 'Sorry, product exists in your stock!', + 'Sorry item exists in your stock' => 'Sorry, item exists in your stock!', + 'sortable' => 'Sortable', + 'Socso Category' => 'Socso Category', + 'SOP' => 'SOP', + 'Stock Request' => 'Stock Request', + 'Stock Summmary' => 'Stock Summmary', + 'Title SOP' => 'Title SOP', + 'staff' => 'staff', + 'Staff' => 'Staff', + 'Staff Application' => 'Staff Application', + 'Staff ID' => 'Staff ID', + 'Staff IDno' => 'Staff ID No', + 'Staff Leave' => 'Staff Leave', + 'Staff Transaction' => 'Staff Transaction', + 'Staff Name' => 'Staff Name', + 'Staff Status' => 'Staff Status', + 'star' => 'Star', + 'Starting Date' => 'Starting Date', + 'Start Time' => 'Start Time', + 'Stationary' => 'Stationary', + 'status' => 'Status', + 'Statutory Details' => 'Statutory Details', + 'Step 1' => 'Step 1', + 'Step 2' => 'Step 2', + 'Step 3' => 'Step 3', + 'Sticker' => 'Sticker', + 'store' => 'Store', + 'submit' => 'Submit', + 'Subject' => 'Subject', + 'Subtotal' => 'Subtotal', + 'sunday' => 'Sunday', + 'super_admin' => 'Super Admin', + 'Supervisor' => 'Supervisor', + 'SUPERVISOR' => 'SUPERVISOR', + 'Summarize' => 'Summarize', + 'Suitable' => 'Suitable', + 'start date' => 'Start Date', + 'Staff Designation Name' => 'Staff Designation Name', + 'Spouse Name' => 'Spouse Name', + 'Spouse IC' => 'Spouse IC', + 'Spouse Working' => 'Spouse Working', + 'Spouse Income Tax' => 'Spouse Income Tax No. (SG / OG)', + 'Shivering (rigor)' => 'Shivering (rigor)', + 'Sore throat' => 'Sore throat', + 'Supplier/Vendor' => 'Supplier/Vendor', + 'Supplier/Contractor' => 'Supplier/Contractor', + 'Section' => 'Section', + 'Short Name' => 'Short Name', + 'Sub Category' => 'Sub Category', + 'Success deleted' => 'Success deleted', + 'Fail to delete' => 'Fail to delete', + 'SEPERATED' => 'SEPERATED', + + + // t + 'Table' => 'Table', + 'Tier' => 'Tier', + 'Target' => 'Target', + 'Target Summmary' => 'Target Summmary', + 'Taken Bal' => 'Taken Bal', + 'Task' => 'Task', + 'Task Type' => 'Task Type', + 'Temperature' => 'Temperature', + 'Total Earning' => 'Total Earning', + 'Total Deduction' => 'Total Deduction', + 'tax-invoice-new' => 'Tax Invoice New', + 'tax-invoice-edit' => 'Tax Invoice Edit', + 'Tax Reference No' => 'Tax Reference No', + 'Tax Category' => 'Tax Category', + 'TAX RESIDENT' => 'TAX RESIDENT', + 'Teko' => 'Teko ', + 'test' => 'Test ', + 'Test Kit Result' => 'Test Kit Result', + 'Terminate' => 'Terminate', + 'TFryers' => 'T.Fryers', + 'Thank you image was removed' => 'Thank you, image was removed.', + 'Thank you comment was removed' => 'Thank you, comment was removed.', + 'Thank you give away was removed' => 'Thank you, give away was removed.', + 'Thank you status updated sucessfully' => 'Thank you, status updated sucessfully.', + 'Thank you your staff has been updated' => 'Thank you, your staff has been updated.', + 'Thank you details has been updated' => 'Thank you, details has been updated.', + 'thank_you_your_branch_has_been_updated' => 'Thank you, your branch setting has been updated.', + 'thank_you_your_claim_ot_has_been_updated' => 'Thank you, your Claim OT has been updated.', + 'thank_you_your_claim_expenses_has_been_updated' => 'Thank you, your Claim Expenses has been updated.', + 'thank_you_your_claim_outstation_has_been_updated' => 'Thank you, your Claim Outstation has been updated.', + 'thank_you_your_chief_has_been_updated' => 'Thank you, your chief setting has been updated.', + 'thank_you_your_comment_has_been_updated' => 'Thank you, your comment has been updated.', + 'thank_you_your_dashboard_has_been_updated' => 'Thank you, your dashboard has been updated.', + 'thank_you_your_department_has_been_updated' => 'Thank you, your department setting has been updated.', + 'Thank you your documentation has been updated' => 'Thank you, your documentation has been updated.', + 'thank_you_your_holiday_has_been_updated' => 'Thank you, your holiday setting has been updated.', + 'thank_you_your_hostel_has_been_updated' => 'Thank you, your hostel setting has been updated.', + 'thank_you_your_knowledge_has_been_updated' => 'Thank you, your knowledge setting has been updated.', + 'Thank you your leave has been add' => 'Thank you, your leave has been add.', + 'Thank you your leave has been updated' => 'Thank you, your leave has been updated.', + 'thank_you_your_leave_has_been_updated' => ' Thank you, your leave setting has been updated.', + 'thank_you_your_level_has_been_updated' => 'Thank you, your level setting has been updated.', + 'thank_you_your_level_requirement_has_been_updated' => 'Thank you, your level requirement setting has been updated.', + 'thank_you_your_license_has_been_updated' => 'Thank you, your license record has been updated.', + 'thank_you_your_notification_has_been_updated' => 'Thank you, your notification setting has been updated.', + 'Thank you your payment slip has been updated' =>'Thank you, your payment slip has been updated.', + 'thank_you_your_point_has_been_updated' => 'Thank you, your point setting has been updated.', + 'thank_you_your_position_has_been_updated' => 'Thank you, your position setting has been updated.', + 'thank_you_your_section_has_been_updated' => 'Thank you, your section setting has been updated.', + 'Thank you your product has been added' => 'Thank you, your product has been added.', + 'Thank you your item has been added' => 'Thank you, your item has been added.', + 'thank_you_your_report_late_has_been_updated' => 'Thank you, your Report Late has been updated.', + 'thank_you_your_salary_has_been_updated' => 'Thank you, your salary setting has been updated.', + 'thank_you_your_sick_has_been_updated' => 'Thank you, your sick setting has been updated.', + 'thank_you_your_star_has_been_updated' => 'Thank you, your star setting has been updated.', + 'thank_you_your_working_has_been_updated' => 'Thank you, your working hours setting has been updated.', + 'The period of notice' => 'The period of notice?', + 'Tick to reset the working hours and follow the new one' => 'Tick to reset the working hours and follow the new one.', + 'thursday' => 'Thursday', + 'Tie ikat' => 'Tie (ikat)', + 'times' => ' times!', + 'Time' => 'Time', + 'Time Off' => 'Time Off', + 'Time Soya' => 'Time + Soya', + 'title' => 'Title', + 'to' => 'To', + 'To1' => 'To', + 'to get information on how to use your current screen and where to go for more assistance' => 'to get information on how to use your current screen and where to go for more assistance.', + 'To be considered for future assignments' => 'To be considered for future assignments', + 'To (Months)' => 'To (Months)', + 'To month' => 'To (month)', + 'To minute' => 'To (minute)', + 'Todo' => 'Todo', + 'Todo List' => 'Todo List', + 'Toggle navigation' => 'Toggle navigation', + 'Total' => 'Total ', + 'Total Car' => 'Total Car', + 'Total Absent' => 'Total Absent', + 'Total Broken' => 'Total Broken', + 'Total KG' => 'Total KG', + 'Total Department' => 'Total Department', + 'Total Point' => 'Total Point', + 'Total Output' => 'Total Output', + 'Total Salary' => 'Total Salary', + 'Total Time' => 'Total Time', + 'Total Work' => 'Total Work', + 'Total Mc' => 'Total Mc', + 'Total Leave' => 'Total Leave', + 'Total Rest' => 'Total Rest', + 'Total Rest Working' => 'Total Rest Working', + 'Total Error' => 'Total Error', + 'total_rest_hours' => 'Total Rest Hours', + 'total_working_hours' => 'Total Working Hours', + 'Tracking' => 'Tracking', + 'Transaction' => 'Transaction', + 'TRAINING' => 'TRAINING', + 'trash' => 'Trash', + 'tuesday' => 'Tuesday', + 'type' => 'Type', + 'To prevent the spread of Covid-19 in our community and reduce the risk of exposure to our staff and visitors, we are conducting a simple screening questionnaire. Your participation is important to help us take precautionary measures to protect you and everyone in this building. Thank you for your time.' => 'To prevent the spread of Covid-19 in our community and reduce the risk of exposure to our staff and visitors, we are conducting a simple screening questionnaire. Your participation is important to help us take precautionary measures to protect you and everyone in this building. Thank you for your time.', + 'Thank you for your submission. We will get back to you as soon as possible.' => 'Thank you for your submission. We will get back to you as soon as possible.', + 'Test Kit Result' => 'Test Kit Result', + 'Thank you for your visitation. Please present your qrcode to our staff' => 'Thank you for your visitation. Please present your qrcode to our staff', + 'Thank you for your submission. We will get back to you soon.' => 'Thank you for your submission. We will get back to you soon.', + 'Thank you for your submission. Your application form has been approved. Kindly present your QR code to us during the visitation date.' => 'Thank you for your submission. Your application form has been approved. Kindly present your QR code to us during the visitation date.', + 'Total of Reject by Department' => 'Total of Reject by Department', + + + // u + 'Uncheck All' => 'Uncheck All', + 'Unsalt' => 'Unsalt', + 'UNDER PROBATION' => 'UNDER PROBATION', + 'Unpaid' => 'Unpaid', + 'unpaid' => 'unpaid', + 'Unpaid Leave' => 'Unpaid Leave', + 'Unpaid Days' => 'Unpaid Days', + 'Update' => 'Update', + 'Update Profile' => 'Update Profile', + 'Update Username' => 'Update Username', + 'Updated At' => 'Updated At', + 'Use Soya' => 'Use Soya', + 'User' => 'User ', + 'username' => 'Username', + 'user_colour' => 'User Colour', + 'user_name' => 'User Name', + 'UOM' => 'UOM ', + "Update Group Next Month" => "Update Group Next Month", + + + // v + 'value' => 'Value', + 'Value Status' => 'Value Status', + 'Vegetarian' => 'Vegetarian', + 'verification_code' => 'Verification Code', + 'verification_code_6_digits_only' => 'Verification Code (6 Digits Only)', + 'Verifiers signature' => 'Verifier\'s Signature', + 'Verifiers Position' => 'Verifier\'s Position', + 'Verify by' => 'Verify by', + 'Very Good' => 'Very Good', + 'Video' => 'Video', + 'view' => 'View', + 'View Current Report' => 'View Current Report', + 'View Signature' => 'View Signature', + 'View Staff Report' => 'View Staff Report', + 'Visitor' => 'Visitor', + 'VIP Visitor' => 'VIP Visitor', + 'Visit At' => 'Visited At', + 'Vcard' => 'Vcard', + 'Vote' => 'Vote Now', + 'Vote This' => 'Vote This', + 'Vote Count' => 'Vote Count', + 'Visitor Name' => 'Visitor Name', + 'Visit Reason' => 'Visit Reason', + 'Visitor Company' => 'Visitor Company', + 'Visitor Registration Form' => 'Visitor Registration Form', + 'Visitor Category' => 'Visitor Category', + 'View All' => 'View All', + + + // w + 'WRITTEN' => 'WRITTEN', + 'Wage' => 'Wage', + 'Warning' => 'Warning', + 'Warehouse' => 'Warehouse', + 'Warning Letter' => 'Warning Letter', + 'warning-letter-content' => 'Warning Letter Content', + 'wednesday' => 'Wednesday', + "Weight of A Bag" => "Weight of A Bag", + 'WEEKLY' => 'WEEKLY', + 'Wet' => 'Wet', + 'Welcome to your new system' => 'Welcome to your new system!', + 'What type of vehicle license' => 'What type of vehicle / license', + 'When will you be available for work' => 'When will you be available for work?', + 'Where we are' => 'Where we are', + 'Whos Absent Today' => 'Who\'s Absent Today', + 'Whos Work Today' => 'Who\'s Work Today', + 'Widow' => 'Widow', + 'Work' => 'Work', + 'Work Day' => 'Work Day', + 'Work Days' => 'Work Days', + 'work_day_calculation' => 'Work Day Calculation', + 'Word MC' => 'Word M/C', + 'Working Hour' => 'Working Hour', + 'working_hours' => 'Working Hours', + 'working_start' => 'Working Start', + 'working_title' => 'Working Title', + 'working_day_include' => 'Working Day Include', + 'Worker Welfare' => 'Worker Welfare', + 'Working Day' => 'Working Day', + 'WIP' => 'WIP', + 'Welcome to XXXX Group!' => 'Welcome to XXXX Group!', + 'weekly' => 'Weekly', + 'Wallet' => 'Wallet', + 'WINDOWED' => 'WINDOWED', + + + //x + 'x_minutes_for_ot_rounding_number_format' => 'X minutes for OT rounding, number format', + 'x_minutes_later_clock_out_counted_as_ot' => 'X minutes later clock-out counted as OT, time format', + + + // y + 'Year' => 'Year', + 'Years known' => 'Years known', + 'yes' => 'Yes', + 'YES' => 'YES', + 'yes see you there' => 'Yes, see you there!', + 'you_still_can_try' => 'You still can try ', + 'Your advance has been' => 'Your advance has been ', + 'Your leave has been' => 'Your leave has been ', + 'Your advance was submitted' => 'Your advance was submitted.', + 'your username or password is incorrect' => '11Your username or password is incorrect!', + 'you are only allowed to upload 5 files' => 'You are only allowed to upload 5 files.', + 'yearly' => 'Yearly', + + '(month/year)'=>'(month/year)', + + // language + 'English' => 'English', + 'Nepali' => 'Nepali', + 'Burmese' => 'Burmese', + 'Malay' => 'Malay', + 'Chinese' => 'Chinese', + + + // month + 'Jan' => 'Jan', + 'Feb' => 'Feb', + 'Mar' => 'Mar', + 'Apr' => 'Apr', + 'May' => 'May', + 'Jun' => 'Jun', + 'Jul' => 'Jul', + 'Aug' => 'Aug', + 'Sep' => 'Sep', + 'Oct' => 'Oct', + 'Nov' => 'Nov', + 'Dec' => 'Dec', + + // Language Proficiency + 'GOOD' => 'GOOD', + 'AVERAGE' => 'AVERAGE', + 'POOR' => 'POOR', + 'ENGLISH' => 'ENGLISH', + 'MANDARIN' => 'MANDARIN', + 'BAHASA MALAYSIA' => 'BAHASA MALAYSIA', + 'Other' => 'Other', + + // Reference Detail + 'REFERENCE DETAIL' => 'REFERENCE DETAIL', + 'LIST AT LEAST TWO (2) FORMER SUPERVISOR, HR MANAGER AND/OR COLLEAGUE.' => 'LIST AT LEAST TWO (2) FORMER SUPERVISOR, HR MANAGER AND/OR COLLEAGUE.', + 'Name' => 'Name', + 'Position' => 'Position', + 'company' => 'company', + 'Contacts no.' => 'Contacts no.', + 'Years known' => 'Years known', + + // Employment History + 'EMPLOYMENT HISTORY' => 'EMPLOYMENT HISTORY', + 'CURRENT COMPANY :' => 'CURRENT COMPANY :', + 'CURRENT POSITION :' => 'CURRENT POSITION :', + 'FULL ADDRESS :' => 'FULL ADDRESS :', + 'DATE JOIN :' => 'DATE JOIN :', + 'DATE LEFT :' => 'DATE LEFT :', + 'BASIC SALARY :' => 'BASIC SALARY :', + 'FIX AllOWANCE :' => 'FIX AllOWANCE :', + 'REASON FOR LEAVING :' => 'REASON FOR LEAVING :', + + // Subsequent Employment + 'SUBSEQUENT EMPLOYMENT HISTORY' => 'SUBSEQUENT EMPLOYMENT HISTORY', + 'Employment Record' => 'Employment Record', + 'Company:' => 'Company:', + 'Position:' => 'Position:', + 'Date Join:' => 'Date Join:', + 'Date Left:' => 'Date Left:', + 'Basic Salary:' => 'Basic Salary:', + 'Fix Allowance:' => 'Fix Allowance:', + 'Reason for Leaving:' => 'Reason for Leaving:', + + // Other Info + 'OTHER INFORMATION' => 'OTHER INFORMATION', + 'WHAT IS YOUR INVOLVEMENT IN THE FOLLOWING ACTIVITY :' => 'WHAT IS YOUR INVOLVEMENT IN THE FOLLOWING ACTIVITY :', + 'NEVER' => 'NEVER', + 'OCCASIONALLY' => 'OCCASIONALLY', + 'REGULARLY' => 'REGULARLY', + 'HABITUAL' => 'HABITUAL', + 'GAMBLING' => 'GAMBLING', + 'DRINKING' => 'DRINKING', + 'SMOKING' => 'SMOKING', + 'DRUG TAKING' => 'DRUG TAKING', + + // Questions 1-15 + '1) DID YOU SUFFER FROM ANY PHYSICAL DISABILITY, CHRONIC AILMENT HANDICAP, ALLERGIES OR SERIOUS ILLNESS?' => '1) DID YOU SUFFER FROM ANY PHYSICAL DISABILITY, CHRONIC AILMENT HANDICAP, ALLERGIES OR SERIOUS ILLNESS?', + 'IF YES, PLEASE GIVE DETAILS:' => 'IF YES, PLEASE GIVE DETAILS:', + 'NO' => 'NO', + '2) ARE YOU TAKING ANY LONG-TERM MEDICATION FOR DIABETIC, ASTHMA, ETC.?' => '2) ARE YOU TAKING ANY LONG-TERM MEDICATION FOR DIABETIC, ASTHMA, ETC.?', + '3) PREGNANCY BEFORE JOINING (CURRENTLY / PLANNING IN COMING FEW THREE (3) MONTHS)?' => '3) PREGNANCY BEFORE JOINING (CURRENTLY / PLANNING IN COMING FEW THREE (3) MONTHS)?', + '4) ARE YOU WILLING TO TRANSFER TO A NEW DEPARTMENT OR COMPANY IF THE OPPORTUNITY ARISES?' => '4) ARE YOU WILLING TO TRANSFER TO A NEW DEPARTMENT OR COMPANY IF THE OPPORTUNITY ARISES?', + 'A. WITH RELOCATION:' => 'A. WITH RELOCATION:', + 'YES' => 'YES', + 'NO' => 'NO', + 'B. WITHOUT RELOCATION:' => 'B. WITHOUT RELOCATION:', + '5) HAVE YOU EVER BEEN DISMISSED, DISCHARGED, OR LAID OFF FROM ANY EMPLOYMENT?' => '5) HAVE YOU EVER BEEN DISMISSED, DISCHARGED, OR LAID OFF FROM ANY EMPLOYMENT?', + '6) HAVE YOU EVER BEEN CHARGED IN A COURT LAW?' => '6) HAVE YOU EVER BEEN CHARGED IN A COURT LAW?', + '7) HAVE YOU BEEN DECLARED BANKRUPTCY?' => '7) HAVE YOU BEEN DECLARED BANKRUPTCY?', + '8) ARE YOU CURRENTLY EXPERIENCING ANY FINANCIAL DIFFICULTIES?' => '8) ARE YOU CURRENTLY EXPERIENCING ANY FINANCIAL DIFFICULTIES?', + '9) HAVE YOU APPLIED TO OUR COMPANY BEFORE?' => '9) HAVE YOU APPLIED TO OUR COMPANY BEFORE?', + 'POSITION APPLIED:' => 'POSITION APPLIED:', + '10) HAVE YOU BEEN INVOLVED IN A TRADE DISPUTE REFERRED TO LABOUR COURT?' => '10) HAVE YOU BEEN INVOLVED IN A TRADE DISPUTE REFERRED TO LABOUR COURT?', + '11) DO YOU OWN A CAR AND/OR MOTORCYCLE WITH VALID LICENSE?' => '11) DO YOU OWN A CAR AND/OR MOTORCYCLE WITH VALID LICENSE?', + '12) ARE YOU WILLING TO WORK OVERTIME?' => '12) ARE YOU WILLING TO WORK OVERTIME?', + '13) DO YOU HAVE ANY OTHER SIDE JOB OR BUSINESS?' => '13) DO YOU HAVE ANY OTHER SIDE JOB OR BUSINESS?', + '14) WHAT ATTRACTED YOU TO THIS CAREER OPPORTUNITY?' => '14) WHAT ATTRACTED YOU TO THIS CAREER OPPORTUNITY?', + '15) WHAT ARE YOUR CAREER GOALS IN 5 YEARS, AND HOW TO ACHIEVE THEM?' => '15) WHAT ARE YOUR CAREER GOALS IN 5 YEARS, AND HOW TO ACHIEVE THEM?', + + // Declarations + 'PRIVACY NOTICE FOR PERSONAL DATA' => 'PRIVACY NOTICE FOR PERSONAL DATA', + 'BY PROVIDING PERSONAL DATA AS STATED...' => 'BY PROVIDING PERSONAL DATA AS STATED...', // You can shorten or keep full text + 'FULL NAME' => 'FULL NAME', + 'NRIC NUMBER' => 'NRIC NUMBER', + 'DATE' => 'DATE', + 'ACKNOWLEDGEMENT AND AUTHORIZATION' => 'ACKNOWLEDGEMENT AND AUTHORIZATION', + 'I HEREBY DECLARE THAT ALL PARTICULARS...' => 'I HEREBY DECLARE THAT ALL PARTICULARS...', // Same here + 'Please acknowledge by signing below :' => 'Please acknowledge by signing below :', + 'Click To Sign Here' => 'Click To Sign Here', + 'Clear' => 'Clear', +] ; +?> \ No newline at end of file diff --git a/languages/my.php b/languages/my.php new file mode 100644 index 0000000..b587d47 --- /dev/null +++ b/languages/my.php @@ -0,0 +1,1391 @@ + '第1', + '1time' => '一次而已', + '2nd' => '第2', + '3rd' => '第3', + '4th' => '第4', + '3 months' => '3个月', + '6 months' => '6个月', + '12 months' => '12个月', + + + // a + 'ACCREDITED BY' => 'BERTAULIAH OLEH', + 'Are you sure to get the redemption code?' => '是å¦ç¡®è®¤èŽ·å–å…‘æ¢ç ï¼Ÿ', + 'Allow Switch Branch' => 'Allow Switch Branch', + 'Allow Production' => 'å…许生产', + 'Allow Store' => 'å…许库存', + 'Allow Comment' => 'å…许评论', + 'Allow Warning Letter' => 'å…许警告信', + 'Absent' => '缺席', + 'Absent Days' => '缺席日', + 'APPROV' => '批准', + 'APPROVED BY' => '批准人', + 'Approve by' => '批准者', + 'Approvers Position' => '批准者èŒä½', + 'Absent Deduct Salary' => '缺席(扣除薪金)', + 'Absent Punch Deduct Salary' => '缺席打å¡ï¼ˆæ‰£é™¤è–ªæ°´ï¼‰', + 'account' => '叿ˆ·', + 'Account' => '叿ˆ·', + 'ACCOUNT MANAGER' => '客户ç»ç†', + 'Action' => '行动', + 'Active' => '活跃', + 'Active All' => '活跃全部', + 'Additional Details' => 'é¢å¤–细节', + 'Address' => 'ä½å®¶åœ°å€', + 'add_group' => '新增群组', + 'add_new' => '新创建', + 'advance' => '预支', + 'advance-new' => '新建预支', + 'advance-update' => '更新预支', + 'Advance was submitted' => '预支申请已æäº¤ã€‚', + 'After' => '之åŽ', + 'afternoon_hours' => 'ä¸‹åˆæ—¶é—´', + 'afternoon_start' => '下åˆå¼€å§‹æ—¶é—´', + 'afternoon_end' => '下åˆç»“æŸæ—¶é—´', + 'Aims ambitions' => '目标/抱负', + 'All' => '所有', + 'Allow Allowance' => 'å…许津贴', + 'Allow Punch' => 'å…许打å¡', + 'Allow Topup' => 'å…许充值', + 'allowance' => '津贴', + 'Allowance' => '津贴', + 'Allowance By 1 month working day' => '1个月工作日津贴', + 'Allowance Food' => '食物津贴', + 'Allowance Food Days' => '食物津贴日', + 'Allowance Food Total' => '食物津贴总数', + 'Allowance Mobile Topup' => '津贴手机充值', + 'Allowance Monthly' => 'æ¯æœˆæ´¥è´´', + 'Allowance Monthly Attend' => 'æ¯æœˆå‡ºå¸­æ´¥è´´', + 'Allowance Monthly Increment' => 'æ¯æœˆæ´¥è´´å¢žé‡', + 'Allowance Monthly Increment Bonus' => 'æ¯æœˆæ´¥è´´å¢žé‡ï¼ˆå¥–金)', + 'Allowance Target' => '达到目标津贴', + 'Allowance Topup' => '充值津贴', + 'all_devices_for_the_selected_user_were_disconnected' => '所选用户的所有设备已断开连接。', + 'amount' => 'æ•°é¢', + 'Amount bonus' => '金é¢ï¼ˆå¥–金)', + 'Amount deduct' => '金é¢ï¼ˆæ‰£é™¤ï¼‰', + 'Amount RM' => '金é¢ï¼ˆé©¬å¸ï¼‰', + 'AND' => 'å’Œ', + 'announcement' => '公告', + 'announcement-new' => '新建公告', + 'announcement-update' => '更新公告', + 'Announcement Type' => '公告类型', + 'Announcement View' => '查看公告', + 'Annual' => 'å¹´å‡', + 'annual' => 'å¹´å‡', + 'Annual Days' => '年凿—¥', + 'Annual Leave' => 'å¹´å‡', + 'application' => '申请书', + 'Application Form' => '申请表', + 'Application signature' => '申请签å', + 'Approvers signature' => '批准者签å', + 'Area' =>'é¢ç§¯', + 'Are you willing to work overtime' => '您愿æ„加ç­å—?', + 'Are you willing to work under pressure' => '您愿æ„在压力下工作å—?', + 'Are you able to join us' => '你能加入我们å—?', + 'are you sure to vote this' => 'ä½ ç¡®å®šè¦æŠ•ç¥¨å—?', + 'Assign By' => '分é…人', + 'Assigned By' => '分é…人', + 'attended' => '已出席', + 'attendance' => '出勤率', + 'Attendance Allowance' => '勤工津贴', + 'attendance-qrcode' => '考勤二维ç ', + 'Attendance Today' => '今日出勤率', + 'Author' => '笔者', + 'Attention' => '注æ„事项', + "Attention Title" => "注æ„事项标题", + 'Auto Execution' => '自动执行', + 'ACKNOWLEDGEMENT AND AUTHORIZATION' => '致谢和授æƒ', + 'Are you exhibiting 2 or more symptoms as listed below?' => 'Are you exhibiting 2 or more symptoms as listed below?', + 'Are you a MOH COVID-19 volunteer in the last 14 days?' => 'Are you a MOH COVID-19 volunteer in the last 14 days?', + 'Appointment Date' => '预约日期', + 'Appointment Time' => '预约时间', + 'Assigned' => '已分é…', + 'Approved' => '已批准', + 'Adjustment' => 'Adjustment', + 'Appointment Date From' => 'Appointment Date From', + 'Appointment Date To' => 'Appointment Date To', + 'Allow Adjustment Branch' => 'Allow Adjustment Branch', + 'AGE' => 'UMUR', + + + // b + 'Bank' => '银行', + 'Back' => '返回', + 'Basket' => '篮å­', + 'Bonus' => '奖金', + 'Bank Account No' => '银行户å£å·', + 'Bag' => '袋', + 'Basic' => '基本', + 'Basic Salary' => '基础工资', + 'be specific' => '(请明确点)', + 'Bean' => '豆类', + 'before' => '之å‰', + 'Benefit' => '利益', + 'BENEFIT' => '利益', + 'Birth Date' => '出生日期', + 'DATE OF BIRTH'=> 'TARIKH LAHIR', + 'Boiler' => '锅炉', + 'BOILER' => '锅炉', + 'branch' => '分店', + 'Branch Geometry' => '分店地ç†ä½ç½®', + 'brand' => '商标', + 'break_hours' => 'ä¼‘æ¯æ—¶é—´', + 'break_start' => '休æ¯å¼€å§‹æ—¶é—´', + 'break_end' => '休æ¯ç»“æŸæ—¶é—´', + 'Broken' => '破碎', + 'BROKEN' => '破碎', + 'Broken_KG' => '破碎(公斤)', + 'BUDDHIST' => '佛教', + 'by_department' => '按部门', + 'by_user' => '按用户', + 'by_schedule' => '按时间表', + 'Batch Number' => "批å·", + 'Besides the above, are you exhibiting any of the symptoms listed below?' => 'Besides the above, are you exhibiting any of the symptoms listed below?', + 'Body ache' => 'Body ache', + 'Branch To Visit' => 'å‚观分行', + 'By Personal' => 'By Personal', + 'By Personal Report' => 'By Personal Report', + 'By Branch' => 'By Branch', + 'By Branch Report' => 'By Branch Report', + + + // c + 'COMPANY NAME' => 'NAMA SYARIKAT', + 'cause_letter' => '解释信', + 'call' => '称呼', + 'Car' => '车厢', + 'Carton' => '纸箱', + 'Cash' => '现金', + 'CASH' => '现金', + 'Category' => '分类', + 'Career Plan' => 'èŒä¸šè§„划', + 'Charge' => 'æ”¶è´¹', + 'Chart' => '图表', + 'Charge Absent' => '缺席收费', + 'Charge Absent Punch' => 'ç¼ºå¸­æ‰“å¡æ”¶è´¹', + 'Charge Comment' => '评论收费', + 'Charge Early Out' => '早退收费', + 'Charge Give Away' => 'å…è´¹æ ·å“æ”¶è´¹', + 'Charge Late' => '迟到收费', + 'Charge Late Rest' => '休æ¯ä¸åœ¨èŒƒå›´æ”¶è´¹', + 'Charge Advance' => '预制收费', + 'Charge Skhppa' => 'Skhppaæ”¶è´¹', + 'Charge Hostel' => 'å®¿èˆæ”¶è´¹', + 'Charge Gas' => '煤气收费', + 'Charge Time Off' => '休æ¯è¿Ÿåˆ°æ”¶è´¹', + 'Charge Target' => '未达到目标收费', + 'Check All' => '打勾所有', + 'Checked' => '已检查', + 'check_if_fixed_working_hours' => 'æ˜¯å¦æœ‰å›ºå®šçš„工作时间?', + 'check_if_flexible_hours' => '是å¦å±žäºŽå¼¹æ€§æ—¶é—´ï¼Ÿ', + 'check_if_have_OT' => 'æ˜¯å¦æœ‰åŠ ç­ï¼Ÿ', + 'check_if_morning_count_as_ot' => 'ä¸Šåˆæ˜¯å¦ç®—作加ç­ï¼Ÿ', + 'check_if_off_duty' => '是å¦å·²è¿‡ä¸‹ç­æ—¶é—´ï¼Ÿ', + 'check_if_ot_is_count_as_total_work' => 'åŠ ç­æ˜¯å¦ç®—为总工作é‡ï¼Ÿ', + 'Chemical' => '化学制å“', + 'Check staff leave' => 'æŸ¥çœ‹å‘˜å·¥ä¼‘å‡æ—¥', + 'CHEQUE' => '支票', + 'Chief' => '首席', + 'Child Relief' => '儿童救济', + 'CHINESE' => 'åŽäºº', + 'CHRISTIAN' => 'åŸºç£æ•™', + 'Choose Work hour' => '选择工作时间', + 'chosen' => '已选', + 'Claim' => 'ç´¢å¿', + 'Claim Annual Salary' => '领å–å¹´è–ª', + 'Claim Medical Fee' => 'ç´¢å–医疗费', + 'Claim Medical Salary' => '领å–医疗工资', + 'Claim Left Amount' => 'ç´¢å¿å‰©ä½™é‡‘é¢', + 'Clear' => '清除', + 'Cleaner' => '清æ´å·¥äºº', + 'Click yes to allow button production' => '打勾以å…许生产按钮。', + 'Click yes to allow button store' => '打勾以å…许库存按钮。', + 'Click yes to allow button comment' => '打勾以å…许评论按钮。', + 'Click yes to allow button warning letter' => '打勾以å…许警告信按钮。', + 'Click yes to allow button punch card' => '打勾以å…è®¸æ‰“å¡æŒ‰é’®ã€‚', + 'Click yes to allow food allowance' => '打勾以å…许食物津贴。', + 'Click yes to allow topup allowance' => '打勾以å…许充值津贴。', + 'Click yes to allow button switch branch' => 'Click yes to allow button switch branch', + 'Code' => '代ç ', + 'Comission' => '佣金', + 'Comment' => '评论', + 'Comment was submitted' => 'è¯„è®ºå·²ç»æäº¤ã€‚', + 'Confirm' => 'è¯å®ž', + 'Confirmation' => 'è¯å®ž', + 'Contacts no' => 'è”络å·ç ', + 'copy_paste' => 'å¤åˆ¶ç²˜è´´', + 'confirmed' => '确认', + 'CONFIRMED' => '确认', + 'Confirmed' => '确认', + 'Confirm to change this employment status to' => 'ç¡®è®¤å°†æ­¤å·¥ä½œçŠ¶æ€æ›´æ”¹ä¸º', + 'Contract' => 'åˆçº¦', + 'CONTRACT' => 'åˆçº¦', + 'Contract Salary' => 'åˆåŒå·¥èµ„', + 'Cost' => 'æˆæœ¬', + 'Country' => '国家', + 'created_date' => '创建日期', + 'Created At' => '创建日期', + 'Created By' => '创建人', + 'Current Car' => '当å‰è½¦è¾†', + 'Current Level' => '当å‰ç­‰çº§', + 'Current Group' => '当å‰ç»„', + 'customer' => '顾客', + 'Customer Details' => '顾客信æ¯', + 'Customer List' => '顾客列表', + 'Cutting' => '切割', + 'check_if_count_day_include_rest_hours' => '检查计数日是å¦åŒ…æ‹¬ä¼‘æ¯æ—¶é—´ã€‚', + 'Comment/Warning Today' => '今天的评论/警告', + 'Content' => 'Content', + 'Chills' => 'Chills', + 'Cough' => 'Cough', + 'Contact Person' => 'è”络人', + 'Contact Number' => 'è”系电è¯', + 'Car Plate' => '车牌', + 'Corporate Staff' => 'Corporate Staff', + 'Completed' => '已完æˆ', + 'Completed Task' => 'Completed Task', + 'Completed Or Incompleted Report' => 'Completed Or Incompleted Report', + 'Completed' => 'Completed', + 'Cancelled' => 'Cancelled', + 'Cross Department' => 'Cross Department', + 'Click yes to allow adjustment branch' => 'Click yes to allow adjustment branch', + 'CLASS' => 'KELAS', + + + + // d + 'Degree' => 'Degree', + 'Debit Bank' => '借记银行', + 'DAILY' => 'æ¯æ—¥', + 'Daily' => 'æ¯æ—¥', + 'Daily Frying Dept Record' => 'æ¯æ—¥æ²¹ç‚¸éƒ¨é—¨è®°å½•', + 'Daily KBA Packing Record' => 'æ¯æ—¥KBA包装记录', + 'Daily Wet Packing Record' => 'æ¯æ—¥æ¹¿åŒ…装记录', + 'Daily Hours' => 'æ¯æ—¥æ—¶é—´', + 'Dashboard' => '仪表æ¿', + 'date' => '日期', + 'Date Confirmed' => '确认日期', + 'Date Approved' => '批准日期', + 'Date Created' => '创建日期', + 'Date From' => '日期从', + 'Date Joined' => 'å‚与日期', + 'Date Resigned' => 'è¾žèŒæ—¥æœŸ', + 'Date of Birth' => '出生日期', + 'Date to offer' => '录喿—¥æœŸ', + 'Date Month Year' => '日期 (月/年)', + 'date_request' => '申请日期', + 'Date To' => '日期至', + 'Date to return' => '返回日期', + 'Day' => '天', + 'Day From' => '天从', + 'Day To' => '天至', + 'Days' => '天', + 'debtor_type' => '债务人类型', + 'Deduction' => '扣除', + 'Deduct Hour' => 'æ‰£é™¤å°æ—¶', + 'Deduct Point' => '扣除分数', + 'deduct_the_off_duty_x_minutes_later' => '扣除 “ ä¸‹ç­ X åˆ†é’ŸåŽ â€ï¼Ÿ', + 'DELIVERY CONTROL OFFICER' => 'é€è´§æŽ§åˆ¶å‘˜', + 'Department' => '部门', + 'Description' => '说明', + 'Deselect all' => 'å–æ¶ˆé€‰æ‹©æ‰€æœ‰', + 'developed_by_eng' => 'ç”± ', + 'developed_by_cn' => ' å¼€å‘', + 'DIRECTOR' => 'ç†äº‹', + 'Disabled' => 'ç¦ç”¨', + 'disconnect' => 'æ–­å¼€', + 'Divorced' => '离婚', + 'DIVORCED' => 'BERCERAI', + 'Duration' => '为其', + 'documentation' => '文件资料', + 'documentation-new' => '新建文件资料', + 'documentation-update' => '更新文件资料', + 'DONE' => '已完æˆ', + 'Done' => '已完æˆ', + 'Done By' => '完æˆè€…', + 'Done At' => 'å®Œæˆæ—¥æœŸ', + 'Download' => '下载', + 'Dry' => 'å¹²å“', + 'Dryer' => '烘干机', + 'Detail' => '细节', + 'Date Of Visiting' => 'Date Of Visiting', + 'Diarrhea' => 'Diarrhea', + 'Difficulty breathing' => 'Difficulty breathing', + 'Dear Guest, Welcome to XXXX Group! We are honored to have you in our plant. Kindly fill up this Visitor Registration Form for us to be well-prepared for your visit. Looking forward to meeting you in person soon!' => '尊敬的客人,欢迎æ¥åˆ°XXXXé›†å›¢ï¼ æˆ‘ä»¬å¾ˆè£å¹¸æœ‰ä½ åœ¨æˆ‘们的工厂。 请填写此访客登记表,以便我们为您的到访åšå¥½å……分准备。 期待很快与您è§é¢ï¼', + 'daily' => 'æ¯å¤©', + 'Designation' => 'ç§°å·', + 'Delayed' => 'Delayed', + 'Department Task Given Report' => 'Department Task Given Report', + 'DRIVING LISENCE' => 'LESEN MEMANDU', + + + // e + 'Entitle' => 'æƒåˆ©', + 'Early' => 'ææ—©', + 'Early Out' => '早退', + 'Earn Point' => '赚å–积分', + 'Earnings' => '赚å–', + 'Employee ID' => '员工ID', + 'edit' => 'æ›´æ–°', + 'Edit Current' => '更新当å‰', + 'Edit Mode' => '更改模å¼', + 'Education Level' => '教育程度', + 'EDUCATIONAL LEVEL' => '教育程度', + 'Effective Date' => '有效日期', + 'EIS Contribution' => 'EIS贡献', + 'email' => '电邮', + 'Email' => '电邮', + 'EMAIL ADDRESS' => 'ALAMAT EMEL', + 'EMP' => '员工', + 'Employer Epf Rate' => '雇主EPF率', + 'Employment' => '雇用', + 'Employment date' => '就业日期', + 'Employment Info' => '就业信æ¯', + 'Employment Offer Letter' => '员工录å–通知信', + 'EMPLOYMENT APPLICATION FORM' => '就业申请表', + 'EMPLOYMENT HISTORY' => '工作ç»åކ', + 'EMPLOYMENT INJURY & VALIDITY' => '工伤 & 就业有效性', + 'EMPLOYMENT INJURY ONLY' => '仅工伤', + 'Employment Status' => '就业状况', + 'Employment Interview Details' => '员工é¢è¯•内容', + 'Employee Number' => '员工å·ç ', + 'Employee Code' => '员工ç ', + 'Enabled' => 'å·²å¯ç”¨', + 'End Of Probation' => '试用期结æŸ', + 'End Time' => 'ç»“æŸæ—¶é—´', + 'End Date' => 'ç»“æŸæ—¥æœŸ', + 'EPF Membership No' => 'EPF会员编å·', + 'Ethnic' => 'æ°‘æ—', + 'EXPECTED SALARY' => 'JANGKAAN GAJI', + 'expired date' => '过期日期', + 'export_as' => '导出为', + 'export' => '导出', + 'expenses' => '开销', + "Efficiency"=> '效率', + "Executed By"=> '执行人', + 'Employee' => 'Employee', + "Excellent"=> '优秀', + + + // f + 'FINISH' => 'TAMAT', + 'FAMILY PARTICULARS' => 'BUTIR-BUTIR KELUARGA', + 'factory' => '工厂', + 'FACTORY MANAGER' => '厂长', + 'Family' => '家庭', + 'Female' => '女', + 'FEMALE' => '女', + 'FAMILY BACKGROUND' => '家庭背景', + 'File' => '文件', + 'flexible_hours' => '弹性时间', + 'Food Additives' => 'é£Ÿå“æ·»åР剂', + 'Foreigner' => '外国人', + 'foreign-only' => '仅外国', + 'FOREIGN WORKERS' => '外国工人', + 'Format' => 'æ ¼å¼', + 'Food Choise' => '食物选择', + 'Food Allowance' => '食物津贴', + 'friday' => '星期五', + 'Fresh' => '鲜', + 'Fried' => '油炸', + 'from' => '从', + 'From (Months)' => '从 (月)', + 'From month' => '从 (月)', + 'From minute' => '从 (分钟)', + 'From To' => '从 ~ 至', + 'Fryer' => '炸锅', + 'Frying' => '油炸', + 'fullname' => 'å§“å', + 'Full' => '全天', + 'Full Attendance' => '全勤', + 'Full Half' => '全天/åŠå¤©', + 'fullstop' => '。', + 'Find Code' => 'Find Code', + 'Fever' => 'Fever', + 'Fatigue' => 'Fatigue', + + + // g + 'GRADE' => 'GRED', + 'Gender' => '性别', + 'GENDER' => 'JANTINA', + 'Group' => '群组', + 'Give Away' => 'å…费样å“', + 'Give away was submitted' => 'å…费样å“å·²æäº¤ã€‚', + 'Grinding' => '打磨', + 'Grinding Report' => 'æ¯æ—¥æ‰“磨报表', + 'GPS' => 'å…¨çƒå®šä½ç³»ç»Ÿ', + 'Give Item' => 'Give Item', + 'Go to the semi-finished products department' => 'åŽ»åŠæˆå“部门', + 'Good' => '好', + 'Give Point' => 'Give Point', + + + // h + 'health' => 'Health', + 'Health' => 'Health', + 'Half' => 'åŠå¤©', + 'Halal' => '清真', + 'Hide' => 'éšè—', + 'Hours' => 'å°æ—¶', + 'has reach limit this year' => '今年已ç»è¾¾åˆ°æžé™ã€‚', + 'Have a contract with the previous employer' => '与å‰é›‡ä¸»æœ‰åˆåŒå—?', + 'Headquarter' => '总公å¸', + 'HIGH' => '高等', + 'HINDU' => '兴都教', + 'Holiday' => '凿œŸ', + 'Hostel' => '宿èˆ', + 'House Tel' => 'ä½å®¶ç”µè¯', + 'hr' => '人力资æº', + 'HR' => '人力资æº', + 'HUMAN RESOURCES OFFICER' => '人力资æºéƒ¨é—¨äººå‘˜', + 'Hrs/Day' => 'å°æ—¶/天数', + 'Health Screening Form for Visitors' => 'Health Screening Form for Visitors', + 'Have you been in contact with a confirmed novel Covid-19 patient in the past 14 days?' => 'Have you been in contact with a confirmed novel Covid-19 patient in the past 14 days?', + 'Have you been to affected countries in the past 14 days' => 'Have you been to affected countries in the past 14 days', + 'Headache' => 'Headache', + 'Have you attended any event / areas associated with known COVID-19 cluster?' => 'Have you attended any event / areas associated with known COVID-19 cluster?', + 'Have you had close contact with any confirmed or suspected COVID-19 cases within the last 14 days?' => 'Have you had close contact with any confirmed or suspected COVID-19 cases within the last 14 days?', + 'Have you travelled abroad within the last 14 days?' => 'Have you travelled abroad within the last 14 days?', + 'HOME TELEPHONE' => 'TELEfON RUMAH', + + + + // i + 'I certify that all answers given herein are true and complete to the best of my knowledge' => '我ä¿è¯ï¼Œæ­¤å¤„给出的所有答案都是真实完整的。', + 'I authorize investigation of all statements contained in this application for employment as may be necessary in arriving at an employment decision' => '本人授æƒè°ƒæŸ¥æ­¤æ±‚èŒç”³è¯·ä¸­åŒ…å«çš„æ‰€æœ‰é™ˆè¿°ï¼Œä»¥ä½œå‡ºæ±‚èŒå†³å®šã€‚', + 'IC' => '身份è¯', + 'IC Passport' => '身份è¯/护照', + 'IC Passport Image' => '身份è¯/护照图片', + 'ID' => 'ID', + 'ID No' => 'ID å·', + 'if_direct_count_as_1_day' => '是å¦ç›´æŽ¥ç®—作1天?', + 'if_early' => 'å¦‚æžœææ—©', + 'If early Checkout' => '如果早退', + 'If Late Checkin' => 'å¦‚æžœè¿Ÿæ‰“å¡æŠ¥åˆ°', + 'If Late Rest' => 'å¦‚æžœä¼‘æ¯æ—¶é—´ä¸åœ¨èŒƒå›´', + 'if not put' => '如果没有请放', + 'If yes' => '如果是', + 'If you need help getting started check out to our user manual' =>'如果您需è¦å…¥é—¨æ–¹é¢çš„帮助,请查阅我们的用户手册。', + 'If you need help call us at' => '如果您需è¦å¸®åŠ©ï¼Œè¯·è‡´ç”µæˆ‘ä»¬', + 'If any technical issue kindly contact us' => '如有任何技术问题,请è”系我们。', + 'Image' =>'图片', + 'IMPORTANT' => 'é‡è¦', + 'Import' => 'Import', + 'Import Attendance' => 'Import Attendance', + 'Import Point' => 'Import Point', + 'In the event of employment that false or misleading information given in my application or interview may result in an immediate termination of employment' => '如果在我的申请或é¢è¯•中æä¾›çš„è™šå‡æˆ–误导性信æ¯èƒ½å¯¼è‡´ç«‹å³ç»ˆæ­¢é›‡ç”¨ã€‚', + 'Inactive All' => '䏿´»è·ƒå…¨éƒ¨', + 'Inactive' => '䏿´»è·ƒ', + 'INDIAN' => 'å°åº¦äºº', + 'Individual' => '个人', + 'Incentive' => '奖励', + 'INFORMATION RESOURCES DEPARTMENT' => 'ä¿¡æ¯èµ„æºéƒ¨', + 'In' => 'è¿›', + 'InOut' => 'è¿›/出', + 'Interview' => 'é¢è¯•', + 'Interview by' => 'é¢è¯•官', + 'Interview Details' => 'é¢è¯•细节', + 'Interview date time' => 'é¢è¯•日期/æ—¶é—´', + 'Interviewers signature' => 'é¢è¯•官签å', + 'Interviewers Position' => 'é¢è¯•官èŒä½', + 'Invoice' =>'å‘票', + 'Invoice Yearly Report' => '年度å‘票报告', + 'Input your staff id number only' => '备注:åªè¾“入您的员工è¯å·ç ', + 'insurance' => 'ä¿é™©', + 'Item' => 'æ ·å“', + 'Items' => 'æ ·å“', + 'Item Code' => 'æ ·å“代ç ', + 'Item Name' => 'æ ·å“åç§°', + 'Item Point' => 'æ ·å“积分', + 'IC' => '身份è¯', + 'Income Tax No' => '所得税编å·ï¼ˆSG / OG)', + 'Incharge Status' => '负责人状æ€', + 'If you have the following symptom(s), please tick the relevant box(es)' => 'If you have the following symptom(s), please tick the relevant box(es)', + 'Invalid Date' => 'Invalid Date', + 'Interview' => 'Interview', + 'Identity' => 'Identity', + 'Inbox' => 'Inbox', + 'Incompleted' => 'Incompleted', + + + // j + 'job' => 'å²—ä½', + 'Job Calendar' => '工作日历', + 'Job Invoice' => '工作å‘票', + 'Job Position' => '工作èŒä½', + 'Job Section' => '部分èŒä½', + 'Job Status' => '工作状æ€', + 'Job Type' => '工作类型', + 'Job List' => '工作列表', + 'Job Mission' => '工作使命', + 'job-list-new' => '新建岗ä½', + 'job-list-edit' => '更改岗ä½', + + + // k + 'Keep In View' => 'æŒç»­å…³æ³¨', + 'KG' => '公斤', + 'knowledge' => '知识', + 'KM23 Fried' => 'KM23 Fried', + + + + + // l + 'LANGUAGE PROFICIENCY'=>'PENGUASAAN BAHASA', + 'Language spoken' => '语言(说)', + 'Language written' => '语言(写)', + 'last_login' => '上次登录', + 'last_login_device' => '上次登录设备', + 'last_login_IP' => '上次登录IP', + 'last_login_location' => '上次登录ä½ç½®', + 'Last Check In' => '最åŽç­¾åˆ°', + 'Last drawn salary' => '最åŽçš„薪水', + 'Last Updated' => 'æœ€åŽæ›´æ–°', + 'Late' => '迟到', + 'Late Report' => '迟到报告', + 'Leave Type' => '休å‡ç±»åž‹', + 'leave has been' => 'çš„ä¼‘å‡æ—¥å·²è¢«', + 'Leave Name' => '休凿—¥åç§°', + 'leave-new' => 'æ–°å»ºä¼‘å‡æ—¥', + 'leave-update' => 'æ›´æ–°ä¼‘å‡æ—¥', + 'Leftover Sisa' => '剩余', + 'Letter' => 'ä¿¡ä»¶', + 'Letterhead' => '信头纸', + 'level' => '等级', + 'Level Requirement' => '等级需求', + 'license' => '执照', + 'License Record' => '执照记录', + 'Line Supervision' => '线路监ç£', + 'list' => '列表', + 'link' => '链接', + 'Local' => '本地', + 'Local1' => '本地人', + 'local-only' => '仅本地', + 'LOCAL WORKER' => '本地工人', + 'login_code' => '登录ç ', + 'Logout' => '登出', + 'L_F' => '本地/外国', + 'Leave' => '休å‡', + 'leave' => '休å‡', + 'Loss of smell' => 'Loss of smell', + 'Loss of taste' => 'Loss of taste', + 'Late Task' => 'Late Task', + + + // m + 'Movement' => 'Penggerakan', + 'Media' => '媒体', + 'Mins' => 'Mins', + 'Min Quantity' => '最低数é‡', + 'Marital Status' => '婚姻状况', + 'MARITAL STATUS' => 'STATUS PERKAHWINAN', + 'Mailing Address' => '邮寄地å€', + 'Machine' => '机械', + 'MALAY' => '马æ¥äºº', + 'Male' => 'ç”·', + 'MALE' => 'ç”·', + 'malaysia' => '马æ¥è¥¿äºš', + 'Maintenance' => 'ä¿å…¨', + 'MAINTENANCE' => 'ä¿å…¨', + 'M_A_M' => '(M/A) M?', + 'Marital Status' => '婚姻状况', + 'Married' => '已婚', + 'MARRIED' => 'BERKAHWIN', + 'MPower' => '人手', + 'marketing' => '市场行销', + 'marketing-new' => '新建市场行销', + 'marketing-edit' => '更改市场行销', + 'Marketing Record' => '市场行销记录', + 'maximum_OT_hours' => '最长加ç­å°æ—¶', + 'MC' => 'ç—…å‡', + 'MCResign' => 'ç—…å‡ / 辞èŒ', + 'Medical Claim' => '医疗索赔', + 'Medical Claim was submitted' => '医疗索赔已æäº¤ã€‚', + 'Medical Leave' => 'ç—…å‡', + 'Medical Days' => 'åŒ»å‡æ—¥', + 'Medical Fee' => '医疗费', + 'Medical Fee(max)' => '医疗费(最高)', + 'MEDIUM' => '中等', + 'Message' => 'ä¿¡æ¯', + 'miss' => 'å°å§', + 'mr' => '先生', + 'mrs' => '夫人', + 'ms' => '女士', + 'Mobile' => '手机', + 'MOBILE NO.' => 'TELEFON BIMBIT NO.', + 'More Image' => '更多图片', + 'Mobile No' => '手机å·', + 'Mobile No' => '手机å·ç ', + 'model' => 'åž‹å·', + 'modified_date' => '修改日期', + 'monday' => '星期一', + 'MONTH' => '月', + 'Monthly' => 'æ¯æœˆ', + 'MONTHLY' => 'æ¯æœˆ', + 'morning_end' => 'æ—©ä¸Šç»“æŸæ—¶é—´', + 'morning_hours' => '早上时间', + 'morning_start' => '早上开始时间', + 'move_to_trash' => '移除', + 'MUSLIM' => '穆斯林', + 'Muslim Zakat Fund' => '穆斯林扎å¡ç‰¹åŸºé‡‘', + 'myr' => '(马å¸ï¼‰', + 'Meeting Venue / Level / Department To Visit' => 'Meeting Venue / Level / Department To Visit', + 'Meeting Venue / Meet up Venue or Department / Department To Visit' => 'Meeting Venue / Meet up Venue or Department / Department To Visit', + 'monthly' => 'æ¯ä¸ªæœˆ', + 'Main Category' => '主分类', + 'Minus Point' => 'Minus Point', + + + // n + 'NAME OF SCHOOL / COLLEGE / UNIVERSITY' => 'NAMA SEKOLAH / KOLEJ / UNIVERSITI', + 'name' => 'åç§°', + 'Name' => 'åå­—', + 'NAME' => 'NAMA', + 'NICKNAME' => 'NAME PANGGILAN (JIKA ADA)', + 'FULL NAME (AS PER NRIC)' => 'NAMA PENUH (SEPERTI NRIC)', + 'Name of father' => '父亲姓å', + 'Name of mother' => 'æ¯äº²å§“å', + 'Name of spouse' => 'é…å¶å§“å', + 'Name of school collage university' => '学校/学院/大学åç§°', + 'Nationality' => '国ç±', + 'NATIONALITY' => 'KEWARGANEGARAAN', + 'Need Sign Back' => '需è¦å›žç­¾', + 'Next' => '下一个', + 'Next' => '下个', + 'Next Day' => '下一天', + 'Next Month' => '下个月', + 'Next Review Date' => '下次审核日期', + 'Next Year' => '下一年', + 'Next Group' => '下一组', + 'new' => '新创建', + 'New' => '新建', + 'New Customer' => '新建顾客', + 'Nett Pay' => '净工资', + 'night_hours' => '晚上时间', + 'night_start' => '晚上开始时间', + 'night_end' => 'æ™šä¸Šç»“æŸæ—¶é—´', + 'no' => 'å¦', + 'NO' => 'TIDAK', + 'No' => 'ç¼–å·', + 'no_branch' => '没有分店ï¼', + 'no_data' => '没有数æ®ã€‚', + 'no_image' => '没有图åƒã€‚', + 'no_record' => '没有记录。', + 'NO CONTRIBUTION' => '没有贡献', + 'NO TAX CONTRIBUTION' => '没有税务贡献', + 'NON TAX RESIDENT' => 'éžå±…民税', + 'Non-Halal' => 'éžæ¸…真', + 'Nope thanks for inviting' => 'ä¸ï¼Œè°¢è°¢æ‚¨çš„邀请。', + 'NORMAL' => '正常', + 'Normal Day' => '正常日', + 'Normal Mode' => '正常模å¼', + 'Normal Working' => '正常工作日', + 'Normal Rate' => '正常费率', + 'Normal OT Rate' => '正常加ç­è´¹çއ', + 'Notification' => '通知', + 'NRIC' => '身份è¯å·ç ', + 'No Children' => 'å­©å­æ•°é‡', + 'NRIC / Passport No' => 'NRIC / Passport No', + 'Nationality (For Foreigner Only)' => 'Nationality (For Foreigner Only)', + 'Nausea or vomiting' => 'Nausea or vomiting', + 'Nric / Passport No' => '身份è¯/护照å·ç ', + 'Not Suitable' => 'ä¸é€‚åˆ', + 'NOTICE PERIOD' =>'TEMPOH NOTIS', + + + // o + 'Occupation' => 'èŒä¸š', + 'OCCUPATION' => 'PEKERJAAN', + 'Offer' => '录å–', + 'off_duty' => 'ä¸‹ç­æ—¶é—´', + 'office_marketing' => '办公室行销', + 'OFFICE HOUR' => '办公时间', + 'Oil' => 'æ²¹', + 'Old NRIC' => '旧身份è¯å·ç ', + 'ONLINE TRANSFER' =>'线上转账', + 'OR' => '或', + 'Order Setting' => '订å•设置', + 'Order Title' => 'è®¢å•æ ‡é¢˜', + 'or email us' => '或给我们å‘电å­é‚®ä»¶', + 'Original Group' => '原组别', + 'Organization Chart' => '组织图', + 'ot' => '加ç­', + 'OT Day' => '加ç­å¤©', + 'OT Holiday' => '加ç­å‡æœŸ', + 'Ot Hours' => '加ç­å°æ—¶', + 'Ot Rate' => '加ç­çއ', + 'Ot Rest Hours' => '休æ¯åŠ ç­å°æ—¶', + 'Ot Rest Total' => '休æ¯åŠ ç­å°æ—¶æ€»æ•°', + 'Ot Public Hours' => '公共加ç­å°æ—¶', + 'Ot Public Total' => '公共加ç­å°æ—¶æ€»æ•°', + 'OT Off Day' => '加ç­ä¼‘å‡', + 'OT Work Day' => '加ç­ä¸Šç­å¤©', + 'OTP' => '验è¯ç ', + 'OTHER' => 'å…¶ä»–', + 'Others' => 'å…¶ä»–', + 'OTHERS' => 'å…¶ä»–', + 'ot_count_format' => '加ç­è®¡ç®—æ ¼å¼', + 'ot_rounding' => '加ç­è¿›ä½å€¼', + 'ot_start' => '加ç­å¼€å§‹', + 'Ot Total' => 'åŠ ç­æ€»æ•°', + 'Out' => '出', + 'Output' => '产é‡', + 'Oven' => '烤箱', + 'Oven Time' => '烤箱时间', + 'Oven Packing' => '烤箱/包装', + 'Oven And Packing Daily Report' => 'æ¯æ—¥çƒ˜åˆ¶ä¸ŽåŒ…装记录', + 'Oven Daily Report' => 'æ¯æ—¥çƒ˜åˆ¶è®°å½•', + 'Own any transport' => '拥有任何交通工具', + 'Own strengths' => '自己的强项', + 'Own weakness' => '自己的弱点', + 'Others Working' => '其他工作日', + 'Overtime' => '加ç­', + 'Outstation' => '出差', + 'On Time' => 'On Time', + 'On Time Or Delayed Report' => 'On Time Or Delayed Report', + + + // p + 'Pallet' => '托盘', + 'Paid By' => '付款于', + 'Public' => '公共', + 'Packing' => '包装', + 'P.Rate' => '费率', + 'Public Working' => '公共工作', + 'Packing All' => '包装所有', + 'Packing Time' => '包装时间', + 'Packing Daily Report' => 'æ¯æ—¥åŒ…装记录', + 'page' => '页é¢', + 'Pail' => 'æ¡¶', + 'Passport' => '护照', + 'Passport Expired Date' => '护照过期日期', + 'Passport No' => '护照å·ç ', + 'password' => '密ç ', + 'Password Confirmation' => '确认密ç ', + 'Payment Details' => '付款详情', + 'Payment Status' => '付款状æ€', + 'Payment Transfer' => '付款转å¸', + 'Payment Type' => '付款类型', + 'payment-slip' => '付款å•', + 'payment-slip-new' => '新建付款å•', + 'payment-slip-update' => '更新付款å•', + 'Pending' => '待定', + 'PENDING' => '待定', + 'Period' => '期é™', + 'PERMANENT' => '永久', + 'permission' => 'æƒé™', + 'Permit' => '许å¯è¯', + 'Permit From' => '许å¯è¯æœ‰æ•ˆæ—¥ä»Ž', + 'Permit Image' => '许å¯è¯å›¾åƒ', + 'Permit No' => '许å¯è¯å·', + 'Permit To' => '许å¯è¯æœ‰æ•ˆæ—¥è‡³', + 'Personal Info' => '个人资料', + 'PERSONAL INFORMATION' => '个人资料', + 'PERSONALITY' => '个性', + 'Poor' => 'å·®', + 'photo' => '照片', + 'PKT_KG' => '包装/公斤', + 'Plastic' => 'å¡‘æ–™', + 'Please answer the below questions' => '请回答以下问题:', + 'Please enter all required fill' => '请输入所有必填项。', + 'please_get_the_verification_code_from_the_owner' => '请从所有者那里获得验è¯ç ï¼', + 'Please list down details of brother and sister if any' => '请列出兄弟å§å¦¹çš„详细信æ¯ï¼ˆå¦‚果有)', + 'Please list down details of children if any' => '请列出孩å­çš„详细信æ¯ï¼ˆå¦‚果有)', + 'Please select status' => '请选择状æ€ã€‚', + 'please bring your tng card' => '备注:请æºå¸¦æ‚¨çš„TNGå¡ä»¥ä¾¿è¿›å…¥åœè½¦åœºã€‚', + 'please choose the best product' => '请投选出最好的穿æ­ï¼š', + 'Please state other training ceritication of licenses held' => 'è¯·è¯´æ˜Žå…¶ä»–åŸ¹è®­ï¼Œè¯æ˜ŽæŒæœ‰çš„æ‰§ç…§', + 'Point' => '积分', + 'POINT' => '积分', + 'Point Record' => '积分记录', + 'Point From' => '积分 从', + 'Point To' => '积分 至', + 'Position' => 'èŒä½', + 'Position company' => 'èŒä½ / å…¬å¸', + 'POSITION APPLIED FOR' => '申请èŒä½', + 'Procedure' => '规定程åº', + 'preview' => '预览', + 'Prev Day' => '上一天', + 'Previous' => '上个', + 'Previous current employer' => 'å‰ä»»/现任雇主', + 'Prev Month' => '上个月', + 'Prev Year' => '上一年', + 'Print' => '打å°', + 'Priority' => '优先', + 'product' => '产å“', + 'Problem' => '问题', + 'Title Problem' => '问题标题', + 'Product Movement' => '产å“移动', + 'productions' => '生产', + 'Processed' => '已加工', + 'Productions2' => '生产2', + 'Productions Items' => '生产样å“', + 'Productions Remark' => '生产备注', + 'Production Department' => '生产部门', + 'Production Daily Report' => 'æ¯æ—¥ç”Ÿäº§çº¿æŠ¥è¡¨', + 'profile' => '个人资料', + 'Profile' => '个人资料', + 'Profile Image' => '个人资料图片', + 'proforma-invoice' => 'å½¢å¼å‘票', + 'proforma-invoice-edit' => '更改形å¼å‘票', + 'Public Holiday' => '公共å‡', + 'Public Holiday Rate' => '公共凿œŸçއ', + 'Public Days' => '公共凿œŸæ—¥', + 'Public Day Rest' => '公共日 (休æ¯)', + 'Public Day Normal' => '公共日 (普通)', + 'Public Day OT' => '公共日 (è¶…æ—¶)', + 'Public Day Rate' => '公共日率', + 'Public Rate' => '公共凿œŸçއ', + 'Public Total' => '公共凿œŸæ€»æ•°', + 'purchasing' => 'è´­ä¹°', + 'PURCHASING' => 'è´­ä¹°', + 'pdf'=>'导出PDF', + 'Personal Contact Number' => 'Personal Contact Number', + 'Personal Contact Number (Include Dial code, Ex: +60xxxxxxxxx)' => 'Personal Contact Number (Include Dial code, Ex: +60xxxxxxxxx)', + 'Personal Email' => 'Personal Email', + 'Progress'=>'进行中', + 'Processing' => '进行中', + 'PERMANENT ADDRESS' => 'ALAMAT TETAP', + 'PROFESSIONAL QUALIFICATIONS (MEMBERSHIPS / TECHNICAL / PROFESSIONAL / OCCUPATION TRAINING)' => 'KELAYAKAN PROFESIONAL (KEAHLIAN / TEKNIKAL / PROFESIONAL / LATIHAN PEKERJAAN)', + 'PROFESSIONAL QUALIFICATION'=>'KELAYAKAN PROFESIONAL', + + + + // q + 'QUALIFICATIONS' => 'KELAYAKAN', + 'Qrcode' => '二维ç ', + 'Qrcode Barcode' => '二维ç /æ¡å½¢ç ', + 'Qty' => 'æ•°é‡', + 'QTY_KG' => 'æ•°é‡ï¼ˆå…¬æ–¤ï¼‰', + 'QTY_KG' => 'æ•°é‡å…¬æ–¤', + 'QTY PKT' => 'æ•°é‡åŒ…装', + 'QTY_PKT_KG' => 'æ•°é‡ï¼ˆåŒ…装/公斤)', + 'Qualification Major Academic' => '学历(专业)', + 'Quantity' => 'æ•°é‡', + 'QUANTITY TOTAL' => 'æ•°é‡æ€»è®¡', + 'quotation-new' => '新建报价å•', + 'quotation-edit' => '更改报价å•', + 'Quotation List' => '报价å•列表', + 'Questions' => 'Questions', + + + // r + 'RELATIONSHIP' => 'HUBUNGAN', + 'Redemption' => 'å…‘æ¢', + 'Race' => 'ç§æ—', + 'Rate' => '比率', + 'Rest Day Working' => 'ä¼‘æ¯æ—¥å·¥ä½œ', + 'RECEIVED BY' => '收到者', + 'Raw Material' => '原料', + 'Raw Materials' => '原料', + 'Raw Materials Soya' => '原料大豆', + 'Reason' => '原因', + 'Reason of Resign' => '辞èŒåŽŸå› ', + 'Resign List'=> '辞èŒåˆ—表', + 'Reasons for leaving' => '离开的原因', + 'REFERENCES' => 'å‚考资料', + 'Reference' => 'å‚考资料', + 'Reject' => '驳回', + 'REJECTED' => '已驳回', + 'Rejected' => '已驳回', + 'Rejected At' => '驳回日期·', + 'Rejected By' => '驳回者', + 'rejected' => '驳回', + 'Religion' => 'å®—æ•™', + 'RELIGION' => 'AGAMA', + 'remark' => '备注', + 'remark name' => '备注åå­—', + 'remember_me' => 'è®°ä½æˆ‘', + 'Remove' => '移除', + 'Remove File' => '移除文件', + 'remove_photo' => '移除照片', + 'report' => '报告', + 'Report' => '报告', + 'Reprocessing' => 'å†åŠ å·¥', + 'request' => '申请', + 'Request By' => '申请者', + 'Request Date' => '申请日期', + 'Reschedule' => '改期', + 'Rest' => '休æ¯', + 'Rest Day Normal' => 'ä¼‘æ¯æ—¥ (普通)', + 'Rest Day OT' => 'ä¼‘æ¯æ—¥ (è¶…æ—¶)', + 'Reset Working Hours' => 'é‡ç½®å·¥ä½œæ—¶é—´', + 'rest_hours_range' => 'ä¼‘æ¯æ—¶é—´èŒƒå›´', + 'Rest Day' => '休æ¯å¤©æ•°', + 'Rest Days' => '休æ¯å¤©æ•°', + 'Rest Day Rate' => 'ä¼‘æ¯æ—¥çއ', + 'Rest Rate' => '休æ¯çއ', + 'Rest Total' => 'ä¼‘æ¯æ€»æ•°', + 'Result' => '结果', + 'road-tax' => '路税', + 'rotate' => '旋转', + 'Rest / Public Working' => 'ä¼‘æ¯æˆ–公共凿œŸ', + 'Run Away' => '逃跑', + 'Run Away List' => '逃跑列表', + 'Runny nose or nasal congestion' => 'Runny nose or nasal congestion', + 'Reason To Visit' => 'å‚è§‚ç†ç”±', + 'Resubmit' => '釿–°æäº¤', + 'REFERRAL NAME (IF APPLICABLE)' => 'NAMA RUJUKAN (JIKA BERKENAAN)', + 'RESIDENTIAL ADDRESS' => 'ALAMAT KEDIAMAN', + + + // s + 'search' => 'cari', + 'listing' => 'senarai', + 'SPOKEN' => 'LISAN', + 'START' => 'MULA', + 'Sorry, no code cannot be redempted.' => '抱歉,无任何兑æ¢ç å¯å…‘æ¢ã€‚', + 'Switch To Summary' => 'Switch To Summary', + 'Switch To Efficiency' => 'Switch To Efficiency', + 'salary' => '薪资', + 'SALARY' => '薪资', + 'Salary Name' => '薪资åç§°', + 'salary-view' => '薪资查看', + 'Salary Rate' => '工资率', + 'Salary Report' => '薪资报告', + 'Salary staff' => '员工薪资', + 'Salary Type' => '薪资类型', + 'Salary Letter' => '工资信', + 'Salary Increment' => '加薪', + 'Salary report updated' => '薪资报告已更新。', + 'Salt' => '腌制', + 'saturday' => '星期六', + 'Save' => '储存', + 'scan' => '扫æ', + 'Scroll' => '滚动', + 'select' => '选择', + 'Sent' => 'å‘é€', + 'Select all' => '选择所有', + 'Select Branch' => '选择分店', + 'Select Status' => '选择状æ€', + 'select_a_call' => '选择一个称呼', + 'Self Punch' => '自行打å¡', + 'setting' => '设置', + 'Settings' => '设置', + 'set_the_X_hours_before_the_ending_working_hours' => 'è®¾ç½®å·¥ä½œç»“æŸæ—¶é—´å‰ X å°æ—¶ï¼Ÿ', + 'Sex' => '性别', + 'Shift' => 'è½®ç­', + 'SHIFT' => 'è½®ç­', + 'shortbreak_hours' => '短休时间', + 'shortbreak_end' => '短休开始时间', + 'shortbreak_start' => 'çŸ­ä¼‘ç»“æŸæ—¶é—´', + 'Short Name' => '简称', + 'Show in Application List' => '在求èŒè¡¨æ ¼ä¸­æ˜¾ç¤º', + 'Show' => '显示', + 'sick1' => '医疗', + 'sick' => 'ç—…å‡', + 'Sick' => 'ç—…å‡', + 'Sick leave' => 'ç—…å‡', + 'sick_name' => 'ç—…å', + 'Single' => 'å•身', + 'SINGLE' => 'BUJANG', + 'sign_in' => '登入', + 'Sign out' => '登出', + 'signature' => 'ç­¾å', + 'Size Item' => 'æ ·å“大å°', + 'Sorry data not found' => '抱歉,找ä¸åˆ°æ•°æ®ã€‚', + 'Sorry email already exists' => '抱歉,电å­é‚®ä»¶å·²ç»å­˜åœ¨ã€‚', + 'Sorry failed create Medical Claim' => '抱歉,创建医疗索赔失败。', + 'Sorry failed update' => '抱歉,更新失败。', + 'Sorry idno already exists' => '抱歉,idnoå·²ç»å­˜åœ¨ã€‚', + 'Sorry invalid action type' => '抱歉,无效的æ“作类型。', + 'Sorry failed medical claim' => '抱歉,医疗索赔失败,', + 'Sorry password doesnt exists' => '抱歉,密ç ä¸å­˜åœ¨ã€‚', + 'Sorry please select at least one' => '抱歉,请至少选择一个。', + 'Sorry something error' => '抱歉,出现错误', + 'Sorry some of the staff not enough day to confirm' => '抱歉,指定的员工ä¸å¤Ÿå¤©æ•°ç¡®è®¤', + 'Sorry username already exists' => '抱歉,用户åå·²ç»å­˜åœ¨ã€‚', + 'Sorry image not found' => '抱歉,找ä¸åˆ°å›¾ç‰‡ã€‚', + 'sorry_password_must_at_least_6_digits' => '抱歉,密ç å¿…须至少6使•°å­—ï¼', + 'sorry_please_provide_a_correct_verification_code' => '抱歉,请æä¾›æ­£ç¡®çš„验è¯ç ï¼', + 'sorry_username_exsits' => '抱歉,用户å已存在ï¼', + 'Sorry you cannot apply different year of leave' => '抱歉,您ä¸èƒ½ç”³è¯·ä¸åŒå¹´ä»½çš„凿œŸã€‚', + 'sorry_your_account_was_in_our_block_list' => 'æŠ±æ­‰ï¼Œæ‚¨çš„å¸æˆ·å·²åœ¨æˆ‘们的阻止列表中ï¼', + 'Sorry product exists in your stock' => '抱歉,您的产å“已存在库存中ï¼', + 'Sorry item exists in your stock' => '抱歉,您的样å“已存在库存中ï¼', + 'sortable' => '排åº', + 'Socso Category' => 'Socso类别', + 'SOP' => '标准作业程åº', + "Stock Request" => " 请求库存", + 'Stock Summmary' => '库春总结', + 'SOP Title' => 'æ ‡å‡†ä½œä¸šç¨‹åºæ ‡é¢˜', + 'staff' => '员工', + 'Staff' => '员工', + 'Staff Application' => '员工申请', + 'Staff ID' => '员工编å·', + 'Staff IDno' => '员工编å·', + 'Staff Leave' => 'å‘˜å·¥ä¼‘å‡æ—¥', + 'Staff Name' => '员工åå­—', + 'Staff Status' => '员工状æ€', + 'star' => '星级', + 'start date' => '开始日期', + 'Starting Date' => '开始日期', + 'Starting Time' => '开始时间', + 'Stationary' => '固定', + 'status' => '状æ€', + 'Statutory Details' => '法定详细资料', + 'Step 1' => '步骤1', + 'Step 2' => '步骤2', + 'Step 3' => '步骤3', + 'Staff Designation Name' => '员工èŒä½åç§°', + 'Sticker' => '贴图', + 'store' => '商店', + 'submit' => 'æäº¤', + 'Subject' => '主题', + 'Subtotal' => 'å°è®¡', + 'sunday' => '星期日', + 'super_admin' => '超级管ç†å‘˜', + 'Supervisor' => '主管', + 'SUPERVISOR' => '主管', + 'Summarize' => '总结', + 'Suitable' => '适åˆ', + 'Spouse Name' => 'é…å¶å§“å', + 'Spouse IC' => 'é…å¶èº«ä»½è¯', + 'Spouse Working' => 'é…å¶å·¥ä½œ', + 'Spouse Income Tax' => 'é…å¶æ‰€å¾—税编å·ï¼ˆSG / OG)', + 'Shivering (rigor)' => 'Shivering (rigor)', + 'Sore throat' => 'Sore throat', + 'Supplier/Vendor' => 'Supplier/Vendor', + 'Supplier/Contractor' => 'Supplier/Contractor', + 'Section' => '部分', + 'Short Name' => '简称', + 'Sub Category' => 'å­åˆ†ç±»', + 'Success deleted' => '删除æˆåŠŸ', + 'Fail to delete' => '删除失败', + 'SEPERATED' => 'PERCERAIAN', + + + // t + 'Table' => 'Table', + 'Tier' => 'Tier', + 'Target' => '目标', + 'Target Summmary' => '目标总结', + 'Task' => '任务', + 'Task Type' => '任务ç§ç±»', + 'Taken Bal' => 'å–得平衡', + 'Total Earning' => '总收益', + 'Total Deduction' => '总扣除é¢', + 'tax-invoice-new' => '新建税务å‘票', + 'tax-invoice-edit' => '更改税务å‘票', + 'Tax Reference No' => '税务å‚考编å·', + 'Tax Category' =>'税务类别', + 'TAX RESIDENT' => '居民税', + 'Teko' => 'Teko', + 'test' => '测试 ', + 'Temperature' => '温度', + 'Test Kit Result' => '测试结果', + 'Terminate' => '终止', + 'TFryers' => '炸锅', + 'Thank you image was removed' => '谢谢,图片已删除。', + 'Thank you comment was removed' => '谢谢,评论已删除。', + 'Thank you give away was removed' => '谢谢,å…费样å“已删除。', + 'Thank you status updated sucessfully' => '谢谢,状æ€å·²æˆåŠŸæ›´æ–°ã€‚', + 'Thank you details has been updated' => '谢谢,资料已æˆåŠŸæ›´æ–°ã€‚', + 'Thank you your staff has been updated' => '谢谢,您的员工已更新。', + 'Thank you your announcement has been updated' => 'è°¢è°¢ï¼Œæ‚¨çš„å…¬å‘Šå·²ç»æ›´æ–°ã€‚', + 'thank_you_your_branch_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„åˆ†åº—è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_claim_ot_has_been_updated' => '谢谢,您的加ç­ç´¢å–å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_claim_expenses_has_been_updated' => '谢谢,您的开销索å–å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_claim_outstation_has_been_updated' => '谢谢,您的出差索å–å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_chief_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„é¦–å¸­è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_comment_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„è¯„è®ºå·²ç»æ›´æ–°ã€‚', + 'thank_you_your_dashboard_has_been_updated' => '谢谢,您的仪表æ¿å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_department_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„éƒ¨é—¨è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'Thank you your documentation has been updated' => 'è°¢è°¢ï¼Œæ‚¨çš„æ–‡ä»¶èµ„æ–™å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_holiday_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„å‡æœŸè®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_hostel_has_been_updated' => '谢谢,您的宿èˆè®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_knowledge_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„çŸ¥è¯†è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'Thank you your leave has been add' => 'è°¢è°¢ï¼Œæ‚¨çš„ä¼‘å‡æ—¥è®¾ç½®å·²ç»åŠ äº†ã€‚', + 'Thank you your leave has been updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ä¼‘å‡æ—¥å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_leave_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ä¼‘å‡æ—¥è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_level_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ç­‰çº§è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_level_requirement_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ç­‰çº§éœ€æ±‚è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_license_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„æ‰§ç…§è®°å½•å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_notification_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„é€šçŸ¥è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'Thank you your payment slip has been updated' => '谢谢,您的付款å•å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_point_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ç§¯åˆ†è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_position_has_been_updated' => '谢谢,您的èŒä½è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_section_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„éƒ¨åˆ†è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'Thank you your product has been added' => '谢谢,您的产å“已添加。', + 'Thank you your item has been added' => '谢谢,您的样å“已添加。', + 'thank_you_your_salary_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„è–ªèµ„è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_report_late_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„è¿Ÿåˆ°æŠ¥å‘Šå·²ç»æ›´æ–°ã€‚', + 'thank_you_your_star_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„æ˜Ÿçº§è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_sick_has_been_updated' => 'è°¢è°¢ï¼Œæ‚¨çš„ç—…æƒ…è®¾ç½®å·²ç»æ›´æ–°ã€‚', + 'thank_you_your_working_has_been_updated' => '谢谢,您的工作时间设置已更新', + 'The period of notice' => '通知期é™ï¼Ÿ', + 'thursday' => '星期四', + 'Tick to reset the working hours and follow the new one' => '勾选以é‡ç½®å·¥ä½œæ—¶é—´å¹¶éµå¾ªæ–°çš„工作时间。', + 'Tie ikat' => 'æ†', + 'Time' => 'æ—¶é—´', + 'Time Off' => '休æ¯è¿Ÿåˆ°', + 'times' => '次ï¼', + 'Time Soya' => 'æ—¶é—´ + 黄豆', + 'title' => '标题', + 'to' => '至', + 'To1' => '致', + 'to get information on how to use your current screen and where to go for more assistance' => 'ä»¥èŽ·å–æœ‰å…³å¦‚何使用当å‰å±å¹•以åŠå¦‚何获得更多帮助的信æ¯ã€‚', + 'To be considered for future assignments' => '未æ¥å†è€ƒè™‘', + 'To (Months)' => '至(月)', + 'To month' => '至(月)', + 'To minute' => '至(分钟)', + 'Toggle navigation' => '切æ¢å¯¼èˆª', + 'Todo' => '事项', + 'Todo List' => '事项清å•', + 'Total' => '总共', + 'Total Car' => '车辆总数', + 'Total Absent' => '缺席共数', + 'Total Broken' => '破碎总数', + 'Total Department' => '部门共数', + 'Total KG' => '总共公斤', + 'Total Point' => '总共分数', + 'Total Output' => '总产é‡', + 'Total Time' => '总共时间', + 'Total Salary' => '总薪资', + 'Total Work' => '上ç­å…±æ•°', + 'Total Mc' => '总病å‡', + 'Total Leave' => '总休å‡', + 'Total Rest' => '总休æ¯', + 'Total Rest Working' => 'æ€»ä¼‘æ¯æ—¥å·¥ä½œ', + 'Total Error' => '总误差', + 'total_rest_hours' => 'æ€»ä¼‘æ¯æ—¶é—´', + 'total_working_hours' => '总工作时间', + 'trash' => '移除', + 'Tracking' => '追踪', + 'Transaction' => '交易', + 'TRAINING' => 'å—è®­', + 'tuesday' => '星期二', + 'type' => '类型', + 'To prevent the spread of Covid-19 in our community and reduce the risk of exposure to our staff and visitors, we are conducting a simple screening questionnaire. Your participation is important to help us take precautionary measures to protect you and everyone in this building. Thank you for your time.' => 'To prevent the spread of Covid-19 in our community and reduce the risk of exposure to our staff and visitors, we are conducting a simple screening questionnaire. Your participation is important to help us take precautionary measures to protect you and everyone in this building. Thank you for your time.', + 'Thank you for your submission. We will get back to you as soon as possible.' => 'Thank you for your submission. We will get back to you as soon as possible.', + 'Test Kit Result' => 'Test Kit Result', + 'Thank you for your visitation. Please present your qrcode to our staff' => 'Thank you for your visitation. Please present your qrcode to our staff', + 'Thank you for your submission. We will get back to you soon.' => 'Thank you for your submission. We will get back to you soon.', + 'Thank you for your submission. Your application form has been approved. Kindly present your QR code to us during the visitation date.' => 'Thank you for your submission. Your application form has been approved. Kindly present your QR code to us during the visitation date.', + 'Total of Reject by Department' => 'Total of Reject by Department', + + + // u + 'Uncheck All' => 'å–æ¶ˆæ‰“勾所有', + 'Unsalt' => '脱ç›', + 'Unpaid' => '无薪休å‡', + 'unpaid' => '无薪休å‡', + 'Unpaid Leave' => 'æ— è–ªå‡', + 'Unpaid Days' => '无薪日', + 'Update' => 'æ›´æ–°', + 'Update Profile' => '更新个人资料', + 'Update Username' => '更新用户å', + 'Updated At' => '更新日期', + 'UNDER PROBATION' => '试用期', + 'Use Soya' => '使用大豆', + 'User' => '用户', + 'username' => '用户å', + 'user_colour' => '用户颜色', + 'user_name' => '用户å', + 'UOM' => '测é‡å•ä½ ', + "Update Group Next Month" => "更改下个月组别", + + + // v + 'value' => '数值', + 'Vegetarian' => '素食', + 'Value Status' => '数值状æ€', + 'verification_code' => '验è¯ç ', + 'verification_code_6_digits_only' => '验è¯ç  (ä»…6使•°)', + 'Verifiers signature' => '验è¯è€…ç­¾å', + 'Verifiers Position' => '验è¯è€…èŒä½', + 'Verify by' => '验è¯è€…', + 'Very Good' => '很好', + 'Video' => '影片', + 'view' => '查看', + 'View Current Report' => 'æŸ¥çœ‹å½“å‰æŠ¥å‘Š', + 'View Signature' => '查看签å', + 'View Staff Report' => '查看员工报告', + 'Visitor' => '访客', + 'VIP Visitor' => '贵宾访客', + 'Visit At' => '访问时间', + 'Vcard' => 'Vcard', + 'Vote Count' => '投票数é‡', + 'Vote This' => '投票', + 'Vote' => '投票', + 'Visitor Name' => '访客姓å', + 'Visit Reason' => '访问原因', + 'Visitor Company' => 'æ¥è®¿å…¬å¸', + 'Visitor Registration Form' => '访客登记表', + 'Visitor Category' => '访客类别', + 'View All' => '查看全部', + + + // w + 'WRITTEN' => 'BERTULIS', + 'Wage' => 'Wage', + 'Warning' => '警告', + 'Warning Letter' => '警告信', + 'Warehouse' => 'Warehouse', + 'warning-letter-content' => '警告信内容', + 'wednesday' => '星期三', + "Weight of A Bag" => "一包的é‡é‡", + 'WEEKLY' => 'æ¯å‘¨', + 'Welcome to your new system' => '欢迎使用您的新系统ï¼', + 'Wet' => '潮湿', + 'What type of vehicle license' => '哪类车辆/驾照', + 'When will you be available for work' => '您什么时候å¯ä»¥ä¸Šç­ï¼Ÿ', + 'Where we are' => '地点', + 'Whos Absent Today' => '今日缺席者', + 'Whos Work Today' => '今日上ç­è€…', + 'Widow' => '寡妇', + 'Word MC' => 'Word M/C', + 'Work' => '工作', + 'Work Day' => '工作天', + 'Work Days' => '工作日', + 'work_day_calculation' => '工作日计算', + 'Working Hour' => '工作时间', + 'working_hours' => '工作时间', + 'working_start' => '工作开始时间', + 'working_title' => '工作标题', + 'working_day_include' => '工作日包括', + 'Worker Welfare' => '工人ç¦åˆ©', + 'Working Day' => '工作日', + 'WIP' => 'åŠæˆå“', + 'Welcome to XXXX Group!' => '欢迎æ¥åˆ°XXXX集团ï¼', + 'weekly' => 'æ¯ä¸ªç¤¼æ‹œ', + 'Wallet' => 'Wallet', + 'WINDOWED' => 'berjendela', + + + //x + 'x_minutes_for_ot_rounding_number_format' => 'X 分钟为加ç­è¿›ä½å€¼ï¼Œæ•°å­—æ ¼å¼', + 'x_minutes_later_clock_out_counted_as_ot' => 'è¶…æ—¶ X 分钟åŽè®°ä¸ºåŠ ç­ï¼Œæ—¶é—´æ ¼å¼', + + + // y + 'Year' => 'å¹´', + 'Years known' => '为期', + 'yes see you there' => '是的,到时è§ï¼', + 'YES' => 'ya', + 'yes' => '是', + 'you_still_can_try' => '您还å¯ä»¥å°è¯•', + 'Your advance has been' => '您的预支申请已', + 'Your advance was submitted' => '您的预支申请已æäº¤ã€‚', + 'your username or password is incorrect' => 'Your username or password is incorrect!', + 'you are only allowed to upload 5 files' => '您åªèƒ½ä¸Šä¼  5 个文件。', + 'yearly' => 'æ¯å¹´', + + '(month/year)'=>'(月/年)', + + // language + 'English' => '英文', + 'Nepali' => '尼泊尔语', + 'Burmese' => '缅甸语', + 'Malay' => 'é©¬æ¥æ–‡', + 'Chinese' => '中文', + + + // month + 'Jan' => 'Jan', + 'Feb' => 'Feb', + 'Mar' => 'Mar', + 'Apr' => 'Apr', + 'May' => 'May', + 'Jun' => 'Jun', + 'Jul' => 'Jul', + 'Aug' => 'Aug', + 'Sep' => 'Sep', + 'Oct' => 'Oct', + 'Nov' => 'Nov', + 'Dec' => 'Dec', + + // Language Proficiency + 'GOOD' => 'BAIK', + 'AVERAGE' => 'SEDERHANA', + 'POOR' => 'LEMAH', + 'ENGLISH' => 'BAHASA INGGERIS', + 'MANDARIN' => 'MANDARIN', + 'BAHASA MALAYSIA' => 'BAHASA MELAYU', + 'Other' => 'Lain-lain', + + // Reference Detail + 'REFERENCE DETAIL' => 'BUTIRAN RUJUKAN', + 'LIST AT LEAST TWO (2) FORMER SUPERVISOR, HR MANAGER AND/OR COLLEAGUE.' => 'NYATAKAN SEKURANG-KURANGNYA DUA (2) BEKAS PENYELIA, PENGURUS SUMBER MANUSIA DAN/ATAU RAKAN SEKERJA.', + 'Name' => 'Nama', + 'Position' => 'Jawatan', + 'company' => 'Syarikat', + 'Contacts no.' => 'No. Telefon', + 'Years known' => 'Tahun Kenal', + + // Employment History + 'EMPLOYMENT HISTORY' => 'SEJARAH PEKERJAAN', + 'CURRENT COMPANY :' => 'SYARIKAT SEMASA :', + 'CURRENT POSITION :' => 'JAWATAN SEMASA :', + 'FULL ADDRESS :' => 'ALAMAT PENUH :', + 'DATE JOIN :' => 'TARIKH SERTAI :', + 'DATE LEFT :' => 'TARIKH BERHENTI :', + 'BASIC SALARY :' => 'GAJI ASAS :', + 'FIX AllOWANCE :' => 'ELAUN TETAP :', + 'REASON FOR LEAVING :' => 'SEBAB BERHENTI :', + + // Subsequent Employment + 'SUBSEQUENT EMPLOYMENT HISTORY' => 'SEJARAH PEKERJAAN BERIKUTNYA', + 'Employment Record' => 'Rekod Pekerjaan', + 'Company:' => 'Syarikat:', + 'Position:' => 'Jawatan:', + 'Date Join:' => 'Tarikh Sertai:', + 'Date Left:' => 'Tarikh Berhenti:', + 'Basic Salary:' => 'Gaji Asas:', + 'Fix Allowance:' => 'Elaun Tetap:', + 'Reason for Leaving:' => 'Sebab Berhenti:', + + // Other Info + 'OTHER INFORMATION' => 'MAKLUMAT LAIN', + 'WHAT IS YOUR INVOLVEMENT IN THE FOLLOWING ACTIVITY :' => 'PENGANLIBATAN ANDA DALAM AKTIVITI BERIKUT :', + 'NEVER' => 'TIDAK PERNAH', + 'OCCASIONALLY' => 'SESEKALI', + 'REGULARLY' => 'KADANG-KADANG', + 'HABITUAL' => 'KEBIASAAN', + 'GAMBLING' => 'JUDI', + 'DRINKING' => 'MINUMAN KERAS', + 'SMOKING' => 'MEROKOK', + 'DRUG TAKING' => 'PENGAMBILAN DADAH', + + // Questions 1-15 + '1) DID YOU SUFFER FROM ANY PHYSICAL DISABILITY, CHRONIC AILMENT HANDICAP, ALLERGIES OR SERIOUS ILLNESS?' => '1) ADAKAH ANDA MENGALAMI SEBARANG KECACATAN FIZIKAL, PENYAKIT KRONIK, ALERGI ATAU PENYAKIT SERIUS?', + 'IF YES, PLEASE GIVE DETAILS:' => 'JIKA YA, SILA BERIKAN BUTIRAN:', + 'NO' => 'TIDAK', + '2) ARE YOU TAKING ANY LONG-TERM MEDICATION FOR DIABETIC, ASTHMA, ETC.?' => '2) ADAKAH ANDA MENGAMBIL UBAT JANGKA PANJANG UNTUK DIABETES, ASMA, DLL.?', + '3) PREGNANCY BEFORE JOINING (CURRENTLY / PLANNING IN COMING FEW THREE (3) MONTHS)?' => '3) KEHAMILAN SEBELUM MENYERTAI (SEMASA INI / DALAM RANCANGAN DALAM TEMPOH TIGA (3) BULAN AKAN DATANG)?', + '4) ARE YOU WILLING TO TRANSFER TO A NEW DEPARTMENT OR COMPANY IF THE OPPORTUNITY ARISES?' => '4) ADAKAH ANDA BERSEDIA UNTUK BERTUKAR KE JABATAN ATAU SYARIKAT LAIN JIKA BERPELUANG?', + 'A. WITH RELOCATION:' => 'A. DENGAN PENEMPATAN SEMULA:', + 'B. WITHOUT RELOCATION:' => 'B. TANPA PENEMPATAN SEMULA:', + '5) HAVE YOU EVER BEEN DISMISSED, DISCHARGED, OR LAID OFF FROM ANY EMPLOYMENT?' => '5) PERNAHKAH ANDA DIPECAT, DIBERHENTIKAN, ATAU DIBUANG KERJA?', + '6) HAVE YOU EVER BEEN CHARGED IN A COURT LAW?' => '6) PERNAHKAH ANDA DIDAKWA DI MAHKAMAH?', + '7) HAVE YOU BEEN DECLARED BANKRUPTCY?' => '7) PERNAHKAH ANDA DIISYTIHAR MUFLIS?', + '8) ARE YOU CURRENTLY EXPERIENCING ANY FINANCIAL DIFFICULTIES?' => '8) ADAKAH ANDA MENGALAMI MASALAH KEWANGAN PADA MASA INI?', + '9) HAVE YOU APPLIED TO OUR COMPANY BEFORE?' => '9) PERNAHKAH ANDA MEMOHON UNTUK BEKERJA DI SYARIKAT INI SEBELUM INI?', + 'POSITION APPLIED:' => 'JAWATAN DIPOHON:', + '10) HAVE YOU BEEN INVOLVED IN A TRADE DISPUTE REFERRED TO LABOUR COURT?' => '10) PERNAHKAH ANDA TERLIBAT DALAM PERTIKAIAN INDUSTRI YANG DIRUJUK KE MAHKAMAH BURUH?', + '11) DO YOU OWN A CAR AND/OR MOTORCYCLE WITH VALID LICENSE?' => '11) ADAKAH ANDA MEMILIKI KERETA DAN/ATAU MOTOSIKAL DENGAN LESEN SAH?', + '12) ARE YOU WILLING TO WORK OVERTIME?' => '12) ADAKAH ANDA BERSEDIA UNTUK BEKERJA LEBIH MASA?', + '13) DO YOU HAVE ANY OTHER SIDE JOB OR BUSINESS?' => '13) ADAKAH ANDA MEMPUNYAI PEKERJAAN SAMPINGAN ATAU PERNIAGAAN LAIN?', + '14) WHAT ATTRACTED YOU TO THIS CAREER OPPORTUNITY?' => '14) APA YANG MENARIK MINAT ANDA KEPADA PELUANG KERJAYA INI?', + '15) WHAT ARE YOUR CAREER GOALS IN 5 YEARS, AND HOW TO ACHIEVE THEM?' => '15) APAKAH MATLAMAT KERJAYA ANDA DALAM TEMPOH 5 TAHUN, DAN BAGAIMANA UNTUK MENCAPAINYA?', + + // Declarations + 'PRIVACY NOTICE FOR PERSONAL DATA' => 'NOTIS PRIVASI UNTUK DATA PERIBADI', + 'BY PROVIDING PERSONAL DATA AS STATED...' => 'DENGAN MEMBERIKAN DATA PERIBADI SEPERTI YANG DINYATAKAN DALAM BORANG PERMOHONAN INI, SAYA TELAH MEMBERIKAN KEBENARAN KEPADA SYARIKAT UNTUK MEMPROSES DATA BERKENAAN MENGIKUT AKTA PERLINDUNGAN DATA PERIBADI.', + 'FULL NAME' => 'NAMA PENUH', + 'NRIC NUMBER' => 'NOMBOR KAD PENGENALAN', + 'DATE' => 'TARIKH', + 'ACKNOWLEDGEMENT AND AUTHORIZATION' => 'PENGAKUAN DAN KEBENARAN', + 'I HEREBY DECLARE THAT ALL PARTICULARS...' => 'SAYA DENGAN INI MENGAKU BAHAWA SEMUA MAKLUMAT YANG DIBERIKAN ADALAH BENAR DAN TEPAT. JIKA DIDAPATI TIDAK BENAR, SYARIKAT BERHAK UNTUK MENAMATKAN PERKHIDMATAN TANPA NOTIS.', + 'Please acknowledge by signing below :' => 'Sila sahkan dengan menandatangani di bawah:', + 'Click To Sign Here' => 'Klik Untuk Tandatangan Di Sini', + 'Clear' => 'Padam', +] ; +?> \ No newline at end of file diff --git a/lists.php b/lists.php new file mode 100644 index 0000000..064dd1c --- /dev/null +++ b/lists.php @@ -0,0 +1,83 @@ +query( "SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."'" ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + $department_list[$row['department_id']] = $row['department_desc'] ; + } + } + + + $search_query = '' ; + if ( $array['search'] != '' ){ + $search_query .= " AND title LIKE '%".$array['search']."%'" ; + } + + $query = "SELECT formheadcount_id, staff_id, title, status, created_at FROM formheadcount + WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' AND staff_id = '".$staff_info['staff_id']."' " . $search_query ; + $mysqli_query = $mysqli->query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ; + + if ( $mysqli_query->num_rows > 0 ){ + + $status = '200' ; + + $list = [] ; + $staff_list = [] ; + $formheadcount_id = [] ; + while ( $row = $mysqli_query->fetch_assoc() ){ + $row['id'] = dataFilter( $row['formheadcount_id'] ) ; + $row['title'] = dataFilter( $row['title'] ) ; + $row['departments'] = '' ; + $row['created_at'] = resetDateFormat( $row['created_at'] ) ; + $list[] = $row ; + + $staff_list[$row['staff_id']] = $row['staff_id'] ; + $formheadcount_id[$row['formheadcount_id']] = $row['formheadcount_id'] ; + } + + // select related formheadcount media + $media_list = [] ; + $select_media = $mysqli->query( "SELECT formheadcount_id, file FROM formheadcount_media a + WHERE a.deleted_at IS NULL AND formheadcount_id IN ( ".implode( ',', $formheadcount_id )." ) AND filetype IN ( 'jpg', 'png', 'gif' )" ) ; + if ( $select_media->num_rows > 0 ){ + while ( $row_media = $select_media->fetch_assoc() ){ + $media_list[$row_media['formheadcount_id']][] = ( $row_media['file'] != '' ? PATH.'uploads/FormHeadCount/b/'.$row_media['file'] : '' ) ; + } + } + + // select all staff related deparment + $related_list = [] ; + $select_related = $mysqli->query( "SELECT staff_id, department_id FROM staff_department aformheadcount + WHERE a.deleted_at IS NULL AND staff_id IN ( ".implode( ',', $staff_list )." )" ) ; + if ( $select_related->num_rows > 0 ){ + while ( $row_related = $select_related->fetch_assoc() ){ + if ( checkExists( $department_list[$row_related['department_id']] ) ){ + $related_list[$row_related['staff_id']][] = $department_list[$row_related['department_id']] ; + } + } + } + + foreach ( $list as $k => $v ){ + $list[$k]['departments'] = ( checkExists( $related_list[$v['staff_id']] ) ? implode( ', ', $related_list[$v['staff_id']] ) : '' ) ; + $list[$k]['files'] = ( checkExists( $media_list[$v['formheadcount_id']] ) ? $media_list[$v['formheadcount_id']] : [] ) ; + } + + $data['list'] = $list ; + + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/logs/ignored.md b/logs/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/main.php b/main.php new file mode 100644 index 0000000..c60a8f9 --- /dev/null +++ b/main.php @@ -0,0 +1,15 @@ + + diff --git a/media-setting.php b/media-setting.php new file mode 100644 index 0000000..28735b8 --- /dev/null +++ b/media-setting.php @@ -0,0 +1,405 @@ +query("SELECT * FROM branch + WHERE deleted_at IS NULL") ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +//trash media +if($_POST['trash_media']){ + $media_id = $_POST['trash_media']; + $today_date = date("Y-m-d H:i:s"); + foreach($media_id as $value){ + $update = $mysqli->query("UPDATE media SET deleted_at = '$today_date' WHERE media_id = '$value' "); + } + if($update){ + $_SESSION['media_delete'] = 'success'; + header('Refresh:0'); + exit; + }else{ + $_SESSION['media_delete'] = 'failed'; + header('Refresh:0'); + exit; + } +} + +// form submit +if ($_POST['hide'] == 1){ + + $boolean_redirect = false ; + + // set image in variable + $image = $_FILES["image"]["name"] ; + + + // check status + switch($_POST['hide_status']){ + case 'new' : + + if ( $image != '' ){ + $filetype = $_FILES["image"]["type"]; + $filetype = explode('/', $filetype)[1]; + + $mysqli->query("INSERT INTO media (filetype) VALUES ('$filetype')"); + $id = $mysqli->insert_id; + $file_name = 'media-'.$id.'.'.$filetype ; + + if(move_uploaded_file( $_FILES["image"]["tmp_name"], $_SERVER['DOCUMENT_ROOT'].'/uploads/Media/'.$file_name )){ + $update = $mysqli->query("UPDATE media SET file = '$file_name' WHERE media_id = '$id'"); + } + if($update){ + $_SESSION['media_upload'] = 'success'; + header('Location: media-setting.php?page_mode=edit&page='.$id.''); + exit; + }else{ + $_SESSION['media_upload'] = 'failed'; + header('Refresh:0'); + exit; + } + + } + + break ; + case 'edit' : + $media_id = $_POST['hidden_media_id']; + $remove_photo = $_POST['remove_photo'] ; + + if ($remove_photo == 1){ + $update = $mysqli->query("UPDATE media SET file = '', filetype = '' WHERE media_id = '$media_id'"); + } + + if($image != ''){ + + $filetype = $_FILES["image"]["type"]; + $filetype = explode('/', $filetype)[1]; + + $file_name = 'media-'.$media_id.'.'.$filetype ; + + if(move_uploaded_file( $_FILES["image"]["tmp_name"], $_SERVER['DOCUMENT_ROOT'].'/uploads/Media/'.$file_name )){ + $update = $mysqli->query("UPDATE media SET file = '$file_name' WHERE media_id = '$media_id'"); + } + if($update){ + $_SESSION['media_edit'] = 'success'; + header('Location: media-setting.php?page_mode=edit&page='.$media_id.''); + exit; + }else{ + $_SESSION['media_edit'] = 'failed'; + header('Location: media-setting.php?page_mode=edit&page='.$media_id.''); + exit; + } + } + + break ; + + } + + + +} + +// mode type | all list | new | edit +switch($page_mode){ + + // new customer + case 'new' : + + // check permission + if ( !permissionCheck($row_user, 'user-new-user-new') ){ + header('Location: index.php') ; + exit ; + } + + // active menu bar + $active_main_menu = 'setting' ; + $active_sub_menu = 'setting-media' ; + + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> +
    +
    + +
    +
    +
    + Sorry. Some error occured. Uplaod failed!' .'
    ' ; + } + unset($_SESSION['media_upload']); + unset($_SESSION['media_edit']); + + ?> +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + query("SELECT * FROM media WHERE media_id = '$page' LIMIT 1"); + $row_page = mysqli_fetch_assoc($mysqli_data); + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
    +
    + +
    +
    +
    + Media edit success' .'
    ' ; + }else if($_SESSION['media_edit'] == 'failed'){ + echo '
    Media edit failed' .'
    ' ; + }else if($_SESSION['media_upload'] == 'success'){ + echo '
    Media uplaoded sucess' .'
    ' ; + } + unset($_SESSION['media_upload']); + unset($_SESSION['media_edit']); + ?> +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + query($mysqli_query." ORDER BY created_at DESC LIMIT $start_from, " . $limit) ; + + // set search url + $search_url = 'search='.$search ; + + // load pagination + $page_pagination = nextPrevious($product_page, $limit, $search_url, $mysqli_query); + + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + $media_id = $row_page['media_id']; + $file = $row_page['file']; + echo ' + + + + + + + + '; + } + }else{ + echo ' + + + ' ; + } + ?> + + +
    '.PATH.'uploads/Media/'.dataFilter($row_page['file']).''.$row_page['created_at'].'
    '.$lang['no_data'].'
    +
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/note.md b/note.md new file mode 100644 index 0000000..acbd4f1 --- /dev/null +++ b/note.md @@ -0,0 +1,8 @@ +form +form_category +form_category_translation +form_translation + +nomination +nomination_translation +nomination_translation \ No newline at end of file diff --git a/online-form.php b/online-form.php new file mode 100644 index 0000000..bd92d97 --- /dev/null +++ b/online-form.php @@ -0,0 +1,2514 @@ + !empty($_POST['family_member_name'][$i]) ? $_POST['family_member_name'][$i] : '', + 'age' => !empty($_POST['family_member_age'][$i]) ? $_POST['family_member_age'][$i] : '', + 'occupation' => !empty($_POST['family_member_occupation'][$i]) ? $_POST['family_member_occupation'][$i] : '', + 'relationship' => !empty($_POST['family_member_relationship'][$i]) ? $_POST['family_member_relationship'][$i] : '', + 'company' => !empty($_POST['family_member_company'][$i]) ? $_POST['family_member_company'][$i] : '' + ); + } + + // education background + $array_education_level = array(); + for ($i = 0; $i < 5; $i++) { + $array_education_level[] = array( + 'schoolName' => !empty($_POST['education_name_school'][$i]) ? $_POST['education_name_school'][$i] : '', + 'startYear' => !empty($_POST['education_start_year'][$i]) ? $_POST['education_start_year'][$i] : '', + 'finishYear' => !empty($_POST['education_finish_year'][$i]) ? $_POST['education_finish_year'][$i] : '', + 'grade' => !empty($_POST['education_grade'][$i]) ? $_POST['education_grade'][$i] : '', + 'qualification' => !empty($_POST['education_qualification'][$i]) ? $_POST['education_qualification'][$i] : '' + ); + } + + // professional qualification + $array_professional_qualification = array(); + for ($i = 0; $i < 5; $i++) { + $array_professional_qualification[] = array( + 'qualification' => !empty($_POST['professional_qualification'][$i]) ? $_POST['professional_qualification'][$i] : '', + 'accredited' => !empty($_POST['professional_accredited_by'][$i]) ? $_POST['professional_accredited_by'][$i] : '', + 'startYear' => !empty($_POST['professional_qualification_start_year'][$i]) ? $_POST['professional_qualification_start_year'][$i] : '', + 'finishYear' => !empty($_POST['professional_qualification_finish_year'][$i]) ? $_POST['professional_qualification_finish_year'][$i] : '', + ); + } + + // language proficiency + $spoken_english = $_POST['spoken_english']; + $written_english = $_POST['written_english']; + $spoken_mandarin = $_POST['spoken_mandarin']; + $written_mandarin = $_POST['written_mandarin']; + $spoken_bm = $_POST['spoken_bm']; + $written_bm = $_POST['written_bm']; + $language_other_1=$_POST['language_other_1']; + $spoken_other1 = $_POST['spoken_other1']; + $written_other1 = $_POST['written_other1']; + $language_other_2 = $_POST['language_other_2']; + $spoken_other2 = $_POST['spoken_other2']; + $written_other2 = $_POST['written_other2']; + + + //REFERENCE DETAIL + $array_reference = array(); + for ($i = 0; $i < 2; $i++) { + $array_reference[] = array( + 'name' => !empty($_POST['references_name'][$i]) ? $_POST['references_name'][$i] : '', + 'position' => !empty($_POST['references_position'][$i]) ? $_POST['references_position'][$i] : '', + 'contact' => !empty($_POST['references_contacts'][$i]) ? $_POST['references_contacts'][$i] : '', + 'year' => !empty($_POST['references_years'][$i]) ? $_POST['references_years'][$i] : '', + ); + } + + //employment history + $currentCompanyName = $_POST['current_company_name']; + $currentCompanyPosition = $_POST['current_position_name']; + $currentCompanyAddress = $_POST['current_company_full_address']; + $currentCompanyJoinDate = $_POST['current_company_join_date']; + $currentCompanyLeftDate = $_POST['current_company_left_date']; + $currentCompanySalary = $_POST['current_company_basic_salary']; + $currentCompanyAllowance = $_POST['current_company_fix_allowance']; + $currentCompanyReason = $_POST['current_company_leave_reason']; + + + //subsequent employment history + $array_subsequent_employment = array() ; + for ($i = 0; $i < 3; $i++) { + $array_subsequent_employment[] = array( + 'name' => !empty($_POST['subsequent_company_name'][$i]) ? $_POST['subsequent_company_name'][$i] : '', + 'position' => !empty($_POST['subsequent_position_name'][$i]) ? $_POST['subsequent_position_name'][$i] : '', + 'joinDate' => !empty($_POST['subsequent_company_join_date'][$i]) ? $_POST['subsequent_company_join_date'][$i] : '', + 'leftDate' => !empty($_POST['subsequent_company_left_date'][$i]) ? $_POST['subsequent_company_left_date'][$i] : '', + 'salary' => !empty($_POST['subsequent_company_basic_salary'][$i]) ? $_POST['subsequent_company_basic_salary'][$i] : '', + 'allowance' => !empty($_POST['subsequent_company_fix_allowance'][$i]) ? $_POST['subsequent_company_fix_allowance'][$i] : '', + 'reason' => !empty($_POST['subsequent_company_leave_reason'][$i]) ? $_POST['subsequent_company_leave_reason'][$i] : '', + ); + } + + //other info + $gambling = $_POST['gambling']; + $smoking = $_POST['smoking']; + $drug = $_POST['drug']; + $drinking = $_POST['drinking']; + + $disability =$_POST['disability']; + $disability_detail = ($_POST['disability'] == 'yes')?$_POST['disability_detail']:''; + $medication = $_POST['medication']; + $medication_detail = ($_POST['medication'] == 'yes')?$_POST['medication_detail']:''; + $pregnancy = $_POST['pregnancy']; + $pregnancy_detail = ($_POST['pregnancy'] == 'yes')?$_POST['pregnancy_detail']:''; + $dismissed = $_POST['dismissed']; + $dismissed_detail = ($_POST['dismissed'] == 'yes')?$_POST['dismissed_detail']:''; + $court = $_POST['court']; + $court_detail = ($_POST['court'] == 'yes')?$_POST['court_detail']:''; + $finance = $_POST['finance']; + $finance_detail = ($_POST['finance'] == 'yes')?$_POST['finance_detail']:''; + $applied = $_POST['applied']; + $applied_detail = ($_POST['applied'] == 'yes')?$_POST['applied_detail']:''; + $dispute = $_POST['dispute']; + $dispute_detail = ($_POST['dispute'] == 'yes')?$_POST['dispute_detail']:''; + $other_job = $_POST['other_job']; + $other_job_detail = ($_POST['other_job'] == 'yes')?$_POST['other_job_detail']:''; + + $willingToTransferWithrelocation = $_POST['relocation']; //yes no + $willingToTransferWithoutrelocation = $_POST['without_relocation']; //yes no + $bankruptcy = $_POST['bankruptcy']; + $vehicle = $_POST['vehicle']; + $overtime = $_POST['overtime']; + $attract = $_POST['attract']; + $career_plan = $_POST['career_plan']; + + + // policy + $privacy_name = $_POST['privacy_name']; + $privacy_nric_number = $_POST['privacy_nric_number']; + $privacy_date = $_POST['privacy_date']; + + + //acknowledgement + $acknowledgement_name = $_POST['acknowledgement_name']; + $acknowledgement_nric_number = $_POST['acknowledgement_nric_number']; + $acknowledgement_privacy_date = $_POST['acknowledgement_privacy_date']; + + + // signature + $acknowledgement_certify = escapeString($_POST['acknowledgement_certify']) ; + $acknowledgement_authorize = escapeString($_POST['acknowledgement_authorize']) ; + $acknowledgement_event = escapeString($_POST['acknowledgement_event']) ; + + + //signature + + if ($_POST['application_signature'] != '' && $_POST['application_signature'] != $_POST['application_signature_hidden']) { + // signature + $application_signature = escapeString($_POST['application_signature']) ; + $application_signature_date = TODAYDATE ; + + $image_name = time().'-'.uniqid(count($application_signature)); + $sign_img_name = $image_name.'.jpg'; + + $boolean_upload_signature = uploadImageBased64('Employment_Application', $sign_img_name, $application_signature); + // $boolean_upload_signature = true; + if($boolean_upload_signature == true){ + $signature_image_uploaded = '/uploads/Employment_Application/'.$sign_img_name; + }else{ + $signature_image_uploaded = ''; + } + }else{ + $user_details = jsonEncodeDecode('decode', $row_page['employment_details']) ; + $application = $user_details['application'] ; + if($application != ''){ + $application_signature = $application['signature'] ; + $application_signature_date = $application['date'] ; + $signature_image_uploaded = $application_signature; + }else{ + $application_signature = escapeString($_POST['application_signature']) ; + $application_signature_date = TODAYDATE ; + $signature_image_uploaded = ''; + } + + + } + + // keep other value in array + $array_other_details = [ + // Personal Information + 'positionApplyText' => $positionApplyText, + 'expectedSalary' => $expectedSalary, + 'noticePeriod' => $noticePeroid, + 'referralName' => $referralName, + 'nric' => $nric, + 'personal_name' => $personal_name, + 'personal_name_chinese' => $personal_name_chinese, + 'personal_name_nickname' => $personal_name_nickname, + 'personal_dob' => $personal_dob, + 'personal_age' => $personal_age, + 'personal_email' => $personal_email, + 'personal_nationality' => $personal_nationality, + 'personal_religion' => $personal_religion, + 'personal_mobile' => $personal_mobile, + 'personal_home_tel' => $personal_home_tel, + 'personal_gender' => $personal_gender, + 'personal_marital_status' => $personal_marital_status, + 'personal_lisence' => $personal_lisence, + 'personal_lisence_class' => $personal_lisence_class, + 'personal_permanent_address' => $personal_permanent_address, + 'personal_residential_address' => $personal_residential_address, + + // Family Members + 'family_members' => $array_family_member, + + // Education Background + 'education_levels' => $array_education_level, + + // Professional Qualification + 'professional_qualifications' => $array_professional_qualification, + + // Language Proficiency + 'language_proficiency' => [ + 'spoken_english' => $spoken_english, + 'written_english' => $written_english, + 'spoken_mandarin' => $spoken_mandarin, + 'written_mandarin' => $written_mandarin, + 'spoken_bm' => $spoken_bm, + 'written_bm' => $written_bm, + 'language_other_1' => $language_other_1, + 'spoken_other1' => $spoken_other1, + 'written_other1' => $written_other1, + 'language_other_2' => $language_other_2, + 'spoken_other2' => $spoken_other2, + 'written_other2' => $written_other2, + ], + + // Reference Detail + 'references' => $array_reference, + + // Current Employment + 'current_employment' => [ + 'company_name' => $currentCompanyName, + 'position' => $currentCompanyPosition, + 'address' => $currentCompanyAddress, + 'join_date' => $currentCompanyJoinDate, + 'left_date' => $currentCompanyLeftDate, + 'salary' => $currentCompanySalary, + 'allowance' => $currentCompanyAllowance, + 'leave_reason' => $currentCompanyReason, + ], + + // Subsequent Employment + 'subsequent_employments' => $array_subsequent_employment, + + // Other Info + 'habits' => [ + 'gambling' => $gambling, + 'smoking' => $smoking, + 'drug' => $drug, + 'drinking' => $drinking, + ], + 'conditions' => [ + 'disability' => $disability, + 'disability_detail' => $disability_detail, + 'medication' => $medication, + 'medication_detail' => $medication_detail, + 'pregnancy' => $pregnancy, + 'pregnancy_detail' => $pregnancy_detail, + 'dismissed' => $dismissed, + 'dismissed_detail' => $dismissed_detail, + 'court' => $court, + 'court_detail' => $court_detail, + 'finance' => $finance, + 'finance_detail' => $finance_detail, + 'applied' => $applied, + 'applied_detail' => $applied_detail, + 'dispute' => $dispute, + 'dispute_detail' => $dispute_detail, + 'other_job' => $other_job, + 'other_job_detail' => $other_job_detail, + ], + + 'relocation' => [ + 'with' => $willingToTransferWithrelocation, + 'without' => $willingToTransferWithoutrelocation, + ], + + 'vehicle' => $vehicle, + 'overtime' => $overtime, + 'attract' => $attract, + 'career_plan' => $career_plan, + + // Policy Consent + 'privacy' => [ + 'name' => $privacy_name, + 'nric' => $privacy_nric_number, + 'date' => $privacy_date, + ], + + // Acknowledgement + 'acknowledgement' => [ + 'name' => $acknowledgement_name, + 'nric' => $acknowledgement_nric_number, + 'date' => $acknowledgement_privacy_date, + ], + ]; + $array_other_details = json_encode($array_other_details, JSON_UNESCAPED_UNICODE) ; + + + // reset dob + + $personal_dob = date('Y-m-d', strtotime(str_replace('/', '-', $personal_dob))) ; + + if ($mysqli->query("INSERT INTO staff_employment ( + employment_user_id, + employment_position, + employment_call, + employment_name, + employment_nric, + employment_age, + employment_dob, + employment_sex, + employment_religion, + employment_nationality, + employment_marital, + employment_mobile, + employment_tel, + employment_address, + employment_email, + employment_details, + employment_branch, + employment_status, + employment_modified + ) VALUES ( + '".$incharge_person."', + '".$positionApplySelect."', + '".$personal_name."', + '".$personal_name."', + '".$nric."', + '".$personal_age."', + '".$personal_dob."', + '".$personal_gender."', + '".$personal_religion."', + '".$personal_nationality."', + '".$personal_marital."', + '".$personal_mobile."', + '".$personal_home_tel."', + '".$personal_permanent_address."', + '".$personal_email."', + '".$array_other_details."', + '".$_GET['branch']."', + '".$_POST['employment_status']."', + '".TODAYDATE."' + )")){ + $last_id = $mysqli->insert_id ; + $result = 'success-employment' ; + + } + ////////////////////////////////////////////////////////////// + ////////////////////upload image and resume/////////////////// + ////////////////////////////////////////////////////////////// + /* + $create_image = reCreateImage('Employment', $page, $page, '', $personal_image, $personal_image_type, $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + + $file_upload = array('path' => PATH.'uploads/Employment/', + 'file' => $create_image['image']) ; + $file_upload = jsonEncodeDecode('encode', $file_upload) ; + + // update database + if ($mysqli->query("UPDATE staff_employment SET + employment_file = '".$file_upload."' + WHERE employment_id = '".$page."'")){ + + } + } + + + //upload resume + if ($resume_attached != '' && $resume_attached_tmp != '' && $resume_attached_type == 'application/pdf') { + $newResumeFile = time().'-'.$resume_attached; + $resume_attached_path = $_SERVER["DOCUMENT_ROOT"].'/uploads/Employment_Resume/'; + $boolean_upload_resume = move_uploaded_file($resume_attached_tmp, $resume_attached_path.$newResumeFile); + + if ($boolean_upload_resume) { + $mysqli->query("UPDATE staff_employment SET employment_resume = '".$newResumeFile."' WHERE employment_id = '".$page."'"); + } + }*/ + +$_SESSION['system_result'] = $result ; + //header("Refresh: 0;") ; + //exit ; +} + +$branch_id = escapeString($_GET['branch']); + +$mysqli_ck_branch = $mysqli->query("SELECT branch_id FROM branch"); +if ($mysqli_ck_branch->num_rows >0) { + while ($row_ck_branch = $mysqli_ck_branch->fetch_array()) { + $array_branch_id_list[] = $row_ck_branch['branch_id']; + } +} +// print_r($array_branch_id_list);exit; +$boolean_ck_branch = in_array($branch_id, $array_branch_id_list) ; + +if ($branch_id == '' || $boolean_ck_branch == false) { + echo ' + ' ; + exit; +} + +// page header + +$letter_head = getOwnerCompanyLetterHead($branch_id) ; +// page footer + +$header = $letter_head['header'] ; + + +?> + + + + + + + + Online Application Form - <?= COMPANY ?> + + + + + + + + + + + + +
    +
    + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    +
     
    + + + + + +
    + : + + + query($mysqli_query); + if ($mysqli_position->num_rows > 0) { + echo ' + '; + } + ?> + +
    +
    + + + + + +
    :
    +
    + + + + + +
    :
    +
    + + + + + +
    : +
    +
    + + + + + +
    NRIC (ONLY NUMBER) : + + + without dash or space +
    +
     
     
    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + +
    + : +
    +
    +
    + + + + + + + + + +
    + + : + + : +
    +
    + + + + + + + + + + + +
    + : + + : + + : +
    +
    + + + + + + + + + +
    + : + + : +
    +
    + + + + + + + + + +
    + : + + : +
    +
    + + + + + + + + + + + +
    + : + + : + + : +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + + + : + +
    +
    + + +
    +
    + + +
    + + + + + + + +
    + : +
    +
    + + + + + + + +
    + : +
    +
    +
    +
    +
     
     
    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    +
    +
    +
     
     
    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    +
    +
    +
     
     
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + + + + + + +
    + + + + + + + + +
    + + + + + + + + +
    + + + + + + + + +
    + + + + + + + + +
    +
    +
    +
     
     
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
     
     
    +
    +
    + +
    +
    + +

    + +

    + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + + + + +
    + + + + + + + + +
    +

    +
    +
     
     
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
     
     
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + #1
    + #2
    + #3
    +
    +
    +
     
     
    +
    +
    + +
    +
    + +

    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + A. WITH RELOCATION:
    +
    + +
    +
    +
    + B. WITHOUT RELOCATION:
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    NO
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    + +
    + +
    + +
    +
    +
    + +
     
     
    +
    +
    + +
    +
    + +

    BY PROVIDING PERSONAL DATA AS STATED IN THIS + EMPLOYMENT APPLICATION FORM, I HAVE CONSENTED YOUR COMPANY TO + PROCESS THE PERSONAL DATA IN ACCORDANCE WITH PERSONAL DATA + PROTECTION ACT, AND I FURTHER CONFIRM THAT ALL PERSONAL DATA + PROVIDED HEREIN ARE ACCURATE AND COMPLETE.

    + +

    TO THE EXTENT THAT I HAVE PROVIDED ABOUT MY + FAMILY MEMBERS, SPOUSE, OTHER DEPENDENTS, AND PERSONAL REFERRALS + CONFIRM THAT I HAVE EXPLAINED TO THEM THAT THEIR PERSONAL DATA WILL + BE PROVIDED TO, AND PROCESSED BY YOUR COMPANY AND I REPRESENT AND + WARRANT THAT I HAVE OBTAINED THEIR CONSENT TO THE PROCESSING OF + THEIR PERSONAL DATA IN ACCORDANCE WITH PERSONAL DATA PROTECTION ACT. +

    + +

    I FURTHER AUTHORIZE AND CONSENT YOUR COMPANY TO + CONDUCT BACKGROUND SEARCH ON ME WHETHER BASED ON THE DATA PROVIDED + BY ME IN THIS EMPLOYMENT APPLICATION FORM OR RELATED INFORMATION + THAT YOUR COMPANY MAY OBTAIN FROM OTHER SOURCES FOR EVALUATING MY + JOB APPLICATION.

    + +
    +
    +
    +
    +
    +
    +
    +
     
     
    + +
    +
    + +
    +
    + +

    I HEREBY DECLARE THAT ALL PARTICULARS AND + DOCUMENTS GIVEN BY ME ON THIS EMPLOYMENT APPLICATION FORM ARE TO THE + BEST OF MY KNOWLEDGE AND BELIEF, TRUE AND CORRECT. I UNDERSTAND THAT + IF OR AT ANY TIME AFTER MY EMPLOYMENT, THE INFORMATION GIVEN ON THIS + FORM ARE FOUND TO BE FALSE, INCORRECT OR INCOMPLETE, THE COMPANY + RESERVES THE RIGHT TO DISMISS MY SERVICES WITHOUT NOTICE OR + COMPENSATION.

    +
    +
    +
    +
    +
    +
    +
    +
     
     
    +
    +
    + +
    +
    + +
    +
    + Click To Sign Here
    +
    + +
    + + + +
    + + + + +
    + + +
     
    +
     
    +
    + + + + + + + + + + + + + + + + +
     
     
    + + + + +
     
     
    +
    +
    + + + + + + + + \ No newline at end of file diff --git a/org_chart.php b/org_chart.php new file mode 100644 index 0000000..3b4ab55 --- /dev/null +++ b/org_chart.php @@ -0,0 +1,1911 @@ += 0 ){ + $mysqli->query("INSERT INTO system_orgChart (chart_parent, created_at, updated_at, chartTitle_id) VALUES ('".$add."', '".$current_date."', '".$current_date."', '".$page."')"); + } + + if ( isset($_POST['remove']) && $remove > 0 ){ + $mysqli->query("UPDATE system_orgChart set chart_trash = '1' where chart_id = '".$remove."'"); + } + } + + // udpate time + if ($_POST['hide'] == "1" && $_POST['action'] == "edit"){ + + $name = ($_POST['name']); + $start = ($_POST['start']); + $end = ($_POST['end']); + $trash = ($_POST['trash']); + $new_name = ($_POST['new_name']); + $new_start = ($_POST['new_start']); + $new_end = ($_POST['new_end']); + $new_trash = ($_POST['new_trash']); + + $temp = []; + foreach ($name as $k => $v) { + $temp[0][] = "When ".$k." Then '".$name[$k]."'"; + $temp[1][] = "When ".$k." Then '".$start[$k]."'"; + $temp[2][] = "When ".$k." Then '".$end[$k]."'"; + $temp[3][] = "When ".$k." Then '".(!empty($trash[$k]) ? "1" : "0")."'"; + $temp[4][] = $k; + } + $mysqli->query("UPDATE system_chartTime SET + time_name = CASE time_id ".implode(",", $temp[0]). " END, + time_start = CASE time_id ".implode(",", $temp[1]). " END, + time_end = CASE time_id ".implode(",", $temp[2]). " END, + time_trash = CASE time_id ".implode(",", $temp[3]). " END + WHERE time_id IN (".implode(",", $temp[4]).") "); + + + + $temp = []; + foreach ($new_name as $k => $v) { + $temp[] = '( "'.$new_name[$k].'", "'.$new_start[$k].'", "'.$new_end[$k].'", "'.$page.'" )'; + } + $mysqli->query("INSERT INTO system_chartTime (time_name, time_start, time_end, time_chart) VALUES ".implode(",", $temp)); + + + } + + + // all data + $data[] = ["Name",'Parent']; + $chart = []; + + // array for seaching query + $staff_list = []; + + //parent_list + $parent = []; + + // default parameter + $title_name = ''; + $group_title = []; + + $query = $mysqli->query("SELECT a.chart_id, a.staff_id, a.chart_parent, b.group_id, c.chart_title, c.chart_group, a.type, a.remark,c.group_title + from system_orgChart a + LEFT JOIN (SELECT * FROM system_formula WHERE formula_group = '".$type."') b on (a.chart_id = b.chart_id) + LEFT JOIN system_chartTitle c on ( a.chartTitle_id = c.chartTitle_id ) + where a.chartTitle_id = '".$page."' AND a.chart_trash = '0' "); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $chart[$row['chart_parent']][] = [ + "staff_id" => $row['staff_id'], + "parent" => $row['chart_parent'], + "id" => $row['chart_id'], + "group_id" => $row['group_id'], + "type" => $row['type'], + "remark" => $row['remark'], + ]; + $group_title = json_decode( $row['group_title'] , true ); + $title_name = $row['chart_title']; + $staff_list[$row['staff_id']] = $row['staff_id']; + $parent[] = $row['chart_parent']; + } + $query = $mysqli->query("SELECT staff_id, staff_idno, staff_image, staff_name from staff where (staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00') AND deleted_at IS NULL "); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $staff_list[$row['staff_id']] = [ + "staff_idno" => $row['staff_idno'], + "image" => $row['staff_image'], + "name" => $row['staff_name'], + ]; + } + } + + //get working hours + $working_hours = []; + $query = $mysqli->query("SELECT group_id, group_name FROM setting_working_group WHERE deleted_at IS NULL ORDER BY group_id "); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $working_hours[$row['group_id']] = [ + "name" => $row['group_name'], + ]; + } + } + }else{ + $query = $mysqli->query("SELECT chart_title FROM system_chartTitle + where chartTitle_id = '".$page."' AND chart_trash = '0'"); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $title_name = $row['chart_title']; + } + } + } + + + + if ( arrayCheck($chart) ){ + foreach ($chart as $k => $v) { + foreach ($v as $k1 => $v1) { + $image = ''; + $content = ''; + foreach ($staff_list as $k2 => $v2) { + $selected = ""; + if ($v1['staff_id'] > 0 ){ + if ($v1['staff_id'] == $k2){ + $selected = "selected"; + $image = $v2['image']; + } + } + + $content .= ''; + } + + $content_working = ''; + foreach ($working_hours as $k2 => $v2) { + $selected = ""; + if ($v1['group_id'] > 0 ){ + if ($v1['group_id'] == $k2){ + $selected = "selected"; + } + } + + $content_working .= ''; + } + $data[] = [ + [ + "v" => "child_node_".$v1['id'], + "f" => '
    + + '.(in_array($v1['id'], $parent) ? '' : ' + ').' + +
    +
    + +
    +
    + Update Now +
    +
    + +
    +
    + ', + ], + ( $k == 0 ? "" : "child_node_".$v1['parent'] ), + ]; + + + } + } + }else{ + $data[] = [ + [ + "v" => "child_node_".$v1['id'], + "f" => '
    + New
    + + +
    ', + ], + ( $k == 0 ? "" : "child_node_".$v1['parent'] ), + ]; + } + + + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + + + + +
    + +
    +
    +
    +
    +
    +
    + '.( !empty( $group_title[$letter] ) ? $group_title[$letter] : 'Group '.$letter ).''; + $letter++; + } + ?> +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    + + + + + + $v) { + $temp[] = " ('".explode("-", $k)[0]."', '".explode("-", $k)[1]."', '".date("Y-m-d", strtotime($v))."', '".$current_date."', '".$_SESSION['system_id']."') "; + $old_chart[] = explode("-", $k)[0]; + } + + // start commits + $error = 0 ; + + if (!$mysqli->query("UPDATE system_record_chart SET record_trash = '1' where chart_id IN (".implode(",", $old_chart).")") ){ + $error ++; + } + + if (!$mysqli->query("UPDATE system_chartTitle SET chart_group = '".$type."' where chartTitle_id = '".$page."'")){ + $error ++; + } + if (!$mysqli->query("INSERT INTO system_record_chart (chart_id, group_id, `date`, created_at, user_id) VALUES ".implode(",", $temp))){ + $error ++; + } + + if( $error == 0 ) { + // commit query + $mysqli->commit() ; + $status = '200' ; + $message = 'Process Successful.' ; + + }else{ + $data = $error; + $status = '216' ; + $message = 'Error Occur' ; + $mysqli->rollback() ; + } + + if ( $status == '200' ){ + $_SESSION['result'] = "success"; + }else{ + $_SESSION['result'] = "failed"; + } + + } + + + // all data + $data[] = ["Name",'Parent']; + $chart = []; + + // array for seaching query + $staff_list = []; + + //parent_list + $parent = []; + + // default parameter + $title_name = ''; + $chart_group = ''; + $group_title = []; + + $query = $mysqli->query("SELECT a.chart_id, a.staff_id, a.chart_parent, b.group_id, c.chart_title, c.chart_group, d.date, a.type, a.remark, c.group_title, e.date as last_Record + from system_orgChart a + LEFT JOIN (SELECT * FROM system_formula WHERE formula_group = '".$type."') b on (a.chart_id = b.chart_id) + LEFT JOIN system_chartTitle c on ( a.chartTitle_id = c.chartTitle_id ) + LEFT JOIN (SELECT * FROM system_record_chart WHERE record_trash = '0') d on ( a.chart_id = d.chart_id) + LEFT JOIN (SELECT * FROM system_record_chart WHERE record_trash = '1') e on ( a.chart_id = e.chart_id) + where a.chartTitle_id = '".$page."' AND a.chart_trash = '0'"); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $chart[$row['chart_parent']][] = [ + "staff_id" => $row['staff_id'], + "parent" => $row['chart_parent'], + "id" => $row['chart_id'], + "group_id" => $row['group_id'], + "date" => $row['date'], + "last_modified" => $row['last_Record'], + "type" => $row['type'], + "remark" => $row['remark'], + ]; + + + $group_title = json_decode( $row['group_title'], true ); + $chart_group = $row['chart_group']; + $staff_list[$row['staff_id']] = $row['staff_id']; + $title_name = $row['chart_title']; + } + $query = $mysqli->query("SELECT staff_id, staff_idno, staff_image, staff_name from staff where (staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00') AND deleted_at IS NULL"); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $staff_list[$row['staff_id']] = [ + "staff_idno" => $row['staff_idno'], + "image" => $row['staff_image'], + "name" => $row['staff_name'], + ]; + } + } + + //get working hours + $working_hours = []; + $query = $mysqli->query("SELECT group_id, group_name FROM setting_working_group WHERE deleted_at IS NULL ORDER BY group_id "); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $working_hours[$row['group_id']] = [ + "name" => $row['group_name'], + ]; + } + } + }else{ + $query = $mysqli->query("SELECT chart_title FROM system_chartTitle + where chartTitle_id = '".$page."' AND chart_trash = '0'"); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $title_name = $row['chart_title']; + } + } + } + + + + if ( arrayCheck($chart) ){ + foreach ($chart as $k => $v) { + foreach ($v as $k1 => $v1) { + $data[] = [ + [ + "v" => "child_node_".$v1['id'], + "f" => '
    +
    +
    + '.dataFilterDash($staff_list[$v1['staff_id']]['staff_idno']).' +
    + '.dataFilterDash($working_hours[$v1['group_id']]['name']).' +
    + '.( $v1['type'] == "staff" || empty($v1['type']) ? '' : '').' + '.( !empty($v1['last_modified']) ? '
    Last Modified: '.date("Y-m-d", strtotime($v1['last_modified']))."
    " : '').' +
    +
    + '.dataFilterDash($v1['remark']).' +
    + +
    ', + ], + ( $k == 0 ? "" : "child_node_".$v1['parent'] ), + ]; + + + } + } + }else{ + $data[] = [ + [ + "v" => "child_node_".$v1['id'], + "f" => '
    + No Data
    +
    ', + ], + ( $k == 0 ? "" : "child_node_".$v1['parent'] ), + ]; + } + + + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + + + + +
    + + + '.$lang['Thank you details has been updated'].' +
    '; + break; + case 'failed': + echo '
    + '.$lang['Sorry something error'].' +
    '; + break; + default: + # code... + break; + } + unset( $_SESSION['result'] ); + } + ?> +
    +
    +
    +
    +
    +
    + '.( !empty( $group_title[$letter] ) ? $group_title[$letter] : 'Group '.$letter ).''; + $letter ++; + } + ?> +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + ' : '' ) ?> +
    +
    +
    +
    + + $v) { + // $temp[] = " ('".explode("-", $k)[0]."', '".explode("-", $k)[1]."', '".date("Y-m-d", strtotime($v))."', '".$current_date."', '".$_SESSION['system_id']."') "; + // $old_chart[] = explode("-", $k)[0]; + // } + + // start commits + $error = 0 ; + + foreach ($day as $key => $value) { + $temp[0][] = "When formula_id = ".$key." Then '".$value."'"; + $temp[1][] = $key; + } + + if (!$mysqli->query("UPDATE system_formula SET chart_day = CASE ".implode(" ", $temp[0]). " END where formula_id IN (".implode(",", $temp[1]).")")){ + $error ++; + } + + if( $error == 0 ) { + // commit query + $mysqli->commit() ; + $status = '200' ; + $message = 'Process Successful.' ; + + }else{ + $data = $error; + $status = '216' ; + $message = 'Error Occur' ; + $mysqli->rollback() ; + } + + if ( $status == '200' ){ + $_SESSION['result'] = "success"; + }else{ + $_SESSION['result'] = "failed"; + } + + } + + + // all data + $data[] = ["Name",'Parent']; + $chart = []; + + // array for seaching query + $staff_list = []; + + //parent_list + $parent = []; + + // default parameter + $title_name = ''; + $chart_group = ''; + $group_title = []; + + $query = $mysqli->query("SELECT a.chart_id, a.staff_id, a.chart_parent, b.group_id, c.chart_title, c.chart_group, d.date, a.type, a.remark, c.group_title, e.date as last_Record , b.chart_day, b.formula_id + from system_orgChart a + LEFT JOIN (SELECT * FROM system_formula WHERE formula_group = '".$type."') b on (a.chart_id = b.chart_id) + LEFT JOIN system_chartTitle c on ( a.chartTitle_id = c.chartTitle_id ) + LEFT JOIN (SELECT * FROM system_record_chart WHERE record_trash = '0') d on ( a.chart_id = d.chart_id) + LEFT JOIN (SELECT * FROM system_record_chart WHERE record_trash = '1') e on ( a.chart_id = e.chart_id) + where a.chartTitle_id = '".$page."' AND a.chart_trash = '0'"); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $chart[$row['chart_parent']][] = [ + "staff_id" => $row['staff_id'], + "parent" => $row['chart_parent'], + "id" => $row['chart_id'], + "group_id" => $row['group_id'], + "date" => $row['date'], + "last_modified" => $row['last_Record'], + "day" => $row['chart_day'], + "type" => $row['type'], + "remark" => $row['remark'], + "formula_id" => $row['formula_id'], + ]; + + + $group_title = json_decode( $row['group_title'], true ); + $chart_group = $row['chart_group']; + $staff_list[$row['staff_id']] = $row['staff_id']; + $title_name = $row['chart_title']; + } + $query = $mysqli->query("SELECT staff_id, staff_idno, staff_image, staff_name from staff where (staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00') AND deleted_at IS NULL"); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $staff_list[$row['staff_id']] = [ + "staff_idno" => $row['staff_idno'], + "image" => $row['staff_image'], + "name" => $row['staff_name'], + ]; + } + } + + //get working hours + $working_hours = []; + $query = $mysqli->query("SELECT group_id, group_name FROM setting_working_group WHERE deleted_at IS NULL ORDER BY group_id "); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $working_hours[$row['group_id']] = [ + "name" => $row['group_name'], + ]; + } + } + }else{ + $query = $mysqli->query("SELECT chart_title FROM system_chartTitle + where chartTitle_id = '".$page."' AND chart_trash = '0'"); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $title_name = $row['chart_title']; + } + } + } + + $array_day = [ + 1 => "Monday", + 2 => "Tuesday", + 3 => "Wednesday", + 4 => "Thursday", + 5 => "Friday", + 6 => "Saturday", + 7 => "Sunday", + ]; + + + if ( arrayCheck($chart) ){ + foreach ($chart as $k => $v) { + foreach ($v as $k1 => $v1) { + $day_option = ''; + foreach ($array_day as $key => $value) { + $day_option .= ""; + } + $data[] = [ + [ + "v" => "child_node_".$v1['id'], + "f" => '
    +
    +
    + '.dataFilterDash($staff_list[$v1['staff_id']]['staff_idno']).' +
    + '.dataFilterDash($working_hours[$v1['group_id']]['name']).' +
    + '.( $v1['type'] == "staff" || empty($v1['type']) ? ' + ' : '').' + '.( !empty($v1['last_modified']) ? '
    Last Modified: '.date("Y-m-d", strtotime($v1['last_modified']))."
    " : '').' +
    +
    + '.dataFilterDash($v1['remark']).' +
    + +
    ', + ], + ( $k == 0 ? "" : "child_node_".$v1['parent'] ), + ]; + + + } + } + }else{ + $data[] = [ + [ + "v" => "child_node_".$v1['id'], + "f" => '
    + No Data
    +
    ', + ], + ( $k == 0 ? "" : "child_node_".$v1['parent'] ), + ]; + } + + + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + + + + +
    + + + '.$lang['Thank you details has been updated'].' +
    '; + break; + case 'failed': + echo '
    + '.$lang['Sorry something error'].' +
    '; + break; + default: + # code... + break; + } + unset( $_SESSION['result'] ); + } + ?> +
    +
    +
    +
    +
    +
    + '.( !empty( $group_title[$letter] ) ? $group_title[$letter] : 'Group '.$letter ).''; + $letter ++; + } + ?> +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + ' : '' ) ?> +
    +
    +
    +
    + + $v) { + // $temp[] = " ('".explode("-", $k)[0]."', '".explode("-", $k)[1]."', '".date("Y-m-d", strtotime($v))."', '".$current_date."', '".$_SESSION['system_id']."') "; + // $old_chart[] = explode("-", $k)[0]; + // } + + + + // start commits + $error = 0 ; + $mysqli->autocommit( false ) ; + $boolean = false; + + foreach ($day as $key => $value) { + $temp[] = $key; + } + $query = $mysqli->query("SELECT * FROM system_chart_day WHERE chart_id IN (".implode(",", $temp).")"); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC) ){ + $exists[] = $row['chart_id']; + } + } + + $temp = []; + foreach ($day as $key => $value) { + if ( in_array($key, $exists) ){ + $temp[0][] = "When chart_id = ".$key." Then '".$value."'"; + $temp[1][] = $key; + }else{ + $temp[2][] = " ('".$key."', '".$value."', '".$_SESSION['system_id']."' ) "; + } + + } + + if ( arrayCheck($temp[0]) ){ + if (!$mysqli->query("UPDATE system_chart_day SET chart_day = CASE ".implode(" ", $temp[0]). " END where chart_id IN (".implode(",", $temp[1]).")")){ + $error ++; + } + } + if ( arrayCheck($temp[2]) ){ + if (!$mysqli->query("INSERT INTO system_chart_day ( chart_id , chart_day, updated_by ) VALUES ".implode(",", $temp[2]). "")){ + $error ++; + } + } + + if( $error == 0 ) { + // commit query + $mysqli->commit() ; + $status = '200' ; + $message = 'Process Successful.' ; + + }else{ + $data = $error; + $status = '216' ; + $message = 'Error Occur' ; + $mysqli->rollback() ; + } + + if ( $status == '200' ){ + $_SESSION['result'] = "success"; + }else{ + $_SESSION['result'] = "failed"; + } + + } + + + // all data + $data[] = ["Name",'Parent']; + $chart = []; + + // array for seaching query + $staff_list = []; + + //parent_list + $parent = []; + + // default parameter + $title_name = ''; + $chart_group = ''; + $group_title = []; + + $query = $mysqli->query("SELECT b.*,a.*,c.* + from system_orgChart a + LEFT JOIN system_chart_day b ON ( b.chart_id = a.chart_id ) + LEFT JOIN system_chartTitle c on ( a.chartTitle_id = c.chartTitle_id ) + where a.chartTitle_id = '".$page."' AND a.chart_trash = '0'"); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $chart[$row['chart_parent']][] = [ + "staff_id" => $row['staff_id'], + "parent" => $row['chart_parent'], + "id" => $row['chart_id'], + "group_id" => $row['group_id'], + "date" => $row['date'], + "last_modified" => $row['last_autoupdate'], + "day" => $row['chart_day'], + "type" => $row['type'], + "remark" => $row['remark'], + "chart_id" => $row['chart_id'], + ]; + + + $group_title = json_decode( $row['group_title'], true ); + $chart_group = $row['chart_group']; + $staff_list[$row['staff_id']] = $row['staff_id']; + $title_name = $row['chart_title']; + $type = ( !empty( $group_title[$row['chart_next_group']] ) ? $group_title[$row['chart_next_group']] : $row['chart_next_group'] ); + } + $query = $mysqli->query("SELECT staff_id, staff_idno, staff_image, staff_name from staff where (staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00') AND deleted_at IS NULL"); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $staff_list[$row['staff_id']] = [ + "staff_idno" => $row['staff_idno'], + "image" => $row['staff_image'], + "name" => $row['staff_name'], + ]; + } + } + + //get working hours + $working_hours = []; + $query = $mysqli->query("SELECT group_id, group_name FROM setting_working_group WHERE deleted_at IS NULL ORDER BY group_id "); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $working_hours[$row['group_id']] = [ + "name" => $row['group_name'], + ]; + } + } + }else{ + $query = $mysqli->query("SELECT chart_title FROM system_chartTitle + where chartTitle_id = '".$page."' AND chart_trash = '0'"); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC)){ + $title_name = $row['chart_title']; + } + } + } + + $array_day = [ + 1 => "Monday", + 2 => "Tuesday", + 3 => "Wednesday", + 4 => "Thursday", + 5 => "Friday", + 6 => "Saturday", + 7 => "Sunday", + ]; + + + if ( arrayCheck($chart) ){ + foreach ($chart as $k => $v) { + foreach ($v as $k1 => $v1) { + $day_option = ''; + foreach ($array_day as $key => $value) { + $day_option .= ""; + } + $data[] = [ + [ + "v" => "child_node_".$v1['id'], + "f" => '
    +
    +
    + '.dataFilterDash($staff_list[$v1['staff_id']]['staff_idno']).' + +
    + '.( $v1['type'] == "staff" || empty($v1['type']) ? ' + ' : '').' + '.( !empty($v1['last_modified']) ? '
    Last Modified: '.date("Y-m-d", strtotime($v1['last_modified']))."
    " : '').' +
    +
    + '.dataFilterDash($v1['remark']).' +
    + +
    ', + ], + ( $k == 0 ? "" : "child_node_".$v1['parent'] ), + ]; + + + } + } + }else{ + $data[] = [ + [ + "v" => "child_node_".$v1['id'], + "f" => '
    + No Data
    +
    ', + ], + ( $k == 0 ? "" : "child_node_".$v1['parent'] ), + ]; + } + + + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + + + + +
    + + + '.$lang['Thank you details has been updated'].' +
    '; + break; + case 'failed': + echo '
    + '.$lang['Sorry something error'].' +
    '; + break; + default: + # code... + break; + } + unset( $_SESSION['result'] ); + } + ?> +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + "> +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + ' : '' ) ?> +
    +
    +
    +
    + + query("INSERT INTO system_chartTitle (chart_organization_group,created_at, updated_at) VALUES ('hr','".TODAYDATE."', '".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + $query = "SELECT * FROM system_chartTitle where chartTitle_id = '".$page."' LIMIT 1"; + $query = $mysqli->query($query); + if ( $query->num_rows > 0 ){ + $row_page = $query->fetch_array(MYSQLI_ASSOC); + $row_page['group_title'] = json_decode($row_page['group_title'],true); + // update database + if (isset($type) && $type == 'edit' && $_POST['hide'] == 1){ + + $title = escapeString($_POST['title']); + // $post_parent_type = escapeString($_POST['post_parent_type']); + $group = $_POST['group']; + $post_parent_type = $_POST['post_parent_type'] ; + $post_parent_type = ( $post_parent_type != '' ? '('.implode( '),(', $post_parent_type).')' : '' ) ; + + $array_title = []; + foreach ($group as $k => $v) { + $array_title[$k] = $v; + } + + $success = 'failed' ; + // update database + if ($mysqli->query("UPDATE system_chartTitle SET + chart_title = '".$title."', + post_parent_type = '".$post_parent_type."', + group_title = '".json_encode($array_title)."', + updated_at = '".TODAYDATE."' + WHERE chartTitle_id = '".$page."'") ){ + $success = 'success' ; + } + // refresh page + $redirect = 'org_chart.php?page_mode=edit_title&page='.$page.'&success='.$success; + + // header("Location:") ; + header("Location:".$redirect) ; + exit ; + } + } + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
    + + + '.$lang['Thank you details has been updated'].' +
    '; + break; + case 'failed': + echo '
    + '.$lang['Sorry something error'].' +
    '; + break; + default: + # code... + break; + } + } + ?> +
    +
    +
    +
    +
    +
    + +
    +
    + +
    '.$lang['Group'].' '.$letter.'
    +
    + +
    +
    + '; + } + ?> +
    +
    +
    + + + +
    +
    + +
    + + + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    '.$lang['Group'].' '.$letter.'
    +
    + +
    +
    + '; + } + ?> +
    +
    +
    + + + +
    +
    + +
    +
    + + query("SELECT a.chartTitle_id FROM system_orgChart a + LEFT JOIN system_chartTitle b ON ( a.chartTitle_id = b.chartTitle_id ) + LEFT JOIN staff c ON ( a.staff_id = c.staff_id ) + WHERE a.chart_trash = '0' AND b.chart_trash = '0' AND c.staff_idno = '".$search."' "); + + $chart_list = []; + if ( $query_staff->num_rows > 0 ){ + while ( $row_staff = $query_staff->fetch_array(MYSQLI_ASSOC) ){ + $chart_list[] = $row_staff['chartTitle_id']; + } + $search_query .= " OR chartTitle_id IN (".implode(",", $chart_list).") )"; + }else{ + $search_query .= " )"; + } + + + } + + if ( $_POST['hide'] == "1" && $_POST['hide_status'] == "action" ){ + switch ($_POST['page_action']) { + case 'update': + $id = $_POST['update']; + foreach ($id as $k => $v) { + $mysqli->query('UPDATE '.system_chartTitle.' set chart_next_group = "'.$v.'" where chartTitle_id = "'.$k.'"'); + } + break; + case 'trash': + $id = $_POST['multiple_trash']; + foreach ($id as $k => $v) { + $mysqli->query('UPDATE '.system_chartTitle.' set chart_trash = "1" where chartTitle_id = "'.$k.'"'); + } + break; + + case 'sortable': + $id = $_POST['sortable']; + foreach ($id as $k => $v) { + $mysqli->query('UPDATE '.system_chartTitle.' set chart_order = "'.$v.'" where chartTitle_id = "'.$k.'"'); + } + break; + default: + # code... + break; + } + } + + $query = "SELECT * FROM system_chartTitle where chart_trash = '0' AND chart_organization_group='hr' AND chart_title != ''".$search_query; + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; // end next and prev page + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $query) ; + + $query = $mysqli->query($query." order by chartTitle_id asc LIMIT $start_from, " . LIMIT); + if ( $query->num_rows > 0 ){ + while ( $row = $query->fetch_array(MYSQLI_ASSOC) ){ + $array_data[] = $row; + } + } + + // print_R($array_data) ; + // exit ; + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
    + +
    + +
    +
    + + + + +
    +
    + +
    +
    + + + + + + + + + + + + + $v) { + $group_title = array(); + $group_title = json_decode( $v['group_title'], true ); + echo ' + + + + + + + + + '; + } + }else{ + echo ' + + + + + + '; + } + ?> + +
    +
    + + +
    +
    + +  |  + +  |  + + + '.$v['chart_title'].' + + '.( !empty($v['chart_group']) ? ( !empty($group_title[$v['chart_group']]) ? $group_title[$v['chart_group']] : $v['chart_group'] ) : '').' + + + + +
    No data.
    + +
    +
    +
    +
    + + + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..03524ff --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "hr.system.new", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/page-area.php b/page-area.php new file mode 100644 index 0000000..72589dc --- /dev/null +++ b/page-area.php @@ -0,0 +1,359 @@ + +
    + +
    +
    +
    +
    +
    +
    Area
    +
    + +
    +
    +
    +
    Photo
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    +
    + query("INSERT INTO system_post (post_type, post_categories, post_date, post_modified) VALUES ('area', 'area', '".TODAYDATE."', '".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // check query exsits + $mysqli_page = $mysqli->query("SELECT * FROM system_post + WHERE post_id = '".$page."' AND post_type = 'area' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // update database + if (isset($type) && $type == 'edit' && $_POST['hide'] == 1){ + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + // check if name already exists. + $check_status = checkTitle($page_title, $page) ; + $title = $check_status['title'] ; + $status = $check_status['status'] ; + // set image in variable + $image = $_FILES["image"]["name"] ; + // remove photo + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "post_file = ''," ; + } + // update database + $mysqli->query("UPDATE system_post SET + post_title = '".$page_title."', + post_status = '".$status."', + post_link = '".$title."', + ".$image_query." + post_modified = '".TODAYDATE."', + post_trash = '0' + WHERE post_id = '".$page."'") ; + // resize image + $create_image = reCreateImage('Branch', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + // update database + $mysqli->query("UPDATE system_post SET + post_file = '".$create_image['image']."' + WHERE post_id = '".$page."'"); + } + // add system log + $array_remark = array('old' => array('title' => $row_page['post_title']), + 'new' => array('title' => $page_title)) ; + // refresh page + header("Location:page-area.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + ?> +
    + + + Thank you, your area has been updated. +
    ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
    +
    +
    +
    +
    +
    Area
    +
    + +
    +
    +
    +
    Photo
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    Preview
    +
    +  Remove photo + ' ; + }else{ + echo ' + + ' ; + } + ?> +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    + + $value){ + $mysqli->query("UPDATE system_post SET + post_order = '".$value."' + WHERE post_id = '".$key."'") ; + + // add system log + $old_order = $_POST['hide_sortable'][$key] ; + if ($old_order != $value){ + } + } + } + break ; + case 'trash': + $mysqli_query = "UPDATE " . system_post . " SET + post_trash = '1' + WHERE post_id = " ; + $trash_page = trashPage('post', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search ; + + // page query + $mysqli_query = "SELECT * FROM system_post + WHERE post_title != '' AND post_type = 'area' AND post_trash = '0'".$search_query ; + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY post_order LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
    + +
    + +
    +
    + + + + +
    +
    + +
    +
    +
    + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + // default variable + $id = $row_page['post_id'] ; + $title = dataFilter($row_page['post_title']) ; + $sortable = dataFilter($row_page['post_order']) ; + + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
    TitleDateSortableTrash
    '.$title.''.resetDateFormat($row_page['post_date']).' + + + + +
    + + +
    +
    No data.
    + +
    +
    +
    +
    + \ No newline at end of file diff --git a/page-auto-execution.php b/page-auto-execution.php new file mode 100644 index 0000000..c97c9f0 --- /dev/null +++ b/page-auto-execution.php @@ -0,0 +1,113 @@ +query("SELECT post_id, post_title FROM system_post + WHERE post_type = 'page-auto-execution' AND post_categories = 'page-auto-execution' AND post_trash = '0' LIMIT 1") ; + +// check if page exists +if ($mysqli_page->num_rows == 0){ + // insert into database + $mysqli->query("INSERT INTO system_post + (post_type, post_categories, post_date, post_modified, post_trash) VALUES + ('page-auto-execution', 'page-auto-execution', '".TODAYDATE."', '".TODAYDATE."', '0')") ; + // set page id in variable + $page = $mysqli->insert_id ; + // refresh page + header("Location:page-auto-execution.php?page=".$page."") ; + exit ; +}else{ + // set query as array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + // set page id in variable + $page = $row_page['post_id'] ; +} + +// update database +// keep value in variable +$timeout_hour = resetString(escapeString($_POST['timeout_hour'])) ; +$timeout_minute = resetString(escapeString($_POST['timeout_minute'])) ; + +if (isset($type) && $type == 'edit' && $_POST['hide'] == 1){ + + $timeout = ($timeout_hour != '' && $timeout_minute != '' ? ($timeout_hour.':'.$timeout_minute) : '') ; + + // keep value in variable + $page_content = resetString(escapeString($_POST['content'])) ; + $array_timeout = array('old' => $row_page['post_title'], + 'new' => $timeout) ; + + // update database + $mysqli->query("UPDATE system_post SET + post_title = '".$timeout."', + post_modified = '".TODAYDATE."' + WHERE post_id = '".$page."'") ; + + // refresh page + header("Location:page-auto-execution.php?page=".$page."&success=1") ; + exit ; +} + +// start header here +include 'requires/page_header.php' ; +include 'requires/page_top.php' ; + +$timeout = $row_page['post_title'] ; +$timeout_hour = $timeout_minute = '' ; + +if ($timeout != ''){ + $timeout_hour = date('G', strtotime($timeout)) ; + $timeout_minute = date('i', strtotime($timeout)) ; +} + +?> +
    + +
    +
    +
    +
    +
    +
    +
    +
    Time For Auto Logout
    +
    + + + + + + + + +
    Hour  Minute
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/page-dashboard-ckm.php b/page-dashboard-ckm.php new file mode 100644 index 0000000..1c85f91 --- /dev/null +++ b/page-dashboard-ckm.php @@ -0,0 +1,474 @@ +query("SELECT post_id, post_title, post_content FROM system_post + WHERE post_type = 'page-dashboard' AND post_categories = 'page-dashboard' AND post_trash = '0' LIMIT 1") ; + +// check if page exists +if ($mysqli_page->num_rows == 0){ + // insert into database + $mysqli->query("INSERT INTO system_post + (post_type, post_categories, post_date, post_modified, post_trash) VALUES + ('page-dashboard', 'page-dashboard', '".TODAYDATE."', '".TODAYDATE."', '0')") ; + // set page id in variable s + $page = $mysqli->insert_id ; + // refresh page + header("Location:page-dashboard.php?page=".$page."") ; + exit ; +}else{ + + // set query as array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + + // set page id in variable + $page = $row_page['post_id'] ; + + // update database + if ( $boolean_admin && isset($type) && $type == 'edit' && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : '') ; + $page_content = resetString(escapeString($_POST['content'])) ; + + // check if name already exists. + $check_status = checkTitle($page_title, $page) ; + $title = $check_status['title'] ; + $status = $check_status['status'] ; + + // update database + $mysqli->query("UPDATE system_post SET + post_title = '".$page_title."', + post_content = '".$page_content."', + post_status = '".$status."', + post_link = '".$title."', + post_modified = '".TODAYDATE."', + post_trash = '0' + WHERE post_id = '".$page."'") ; + + // refresh page + $_SESSION['system_result'] = 'success-updated' ; + header("Location:page-dashboard.php?page_mode=edit&page=".$page."&success=1") ; + exit ; + + } + +} + +// start header here +include 'requires/page_header.php' ; +include 'requires/page_top.php' ; + +?> + + +
    + + + + '.$lang['thank_you_your_dashboard_has_been_updated'].'
    ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> + + + query( "SELECT COUNT(staff_id) as total FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL AND branch_id = '0'" ) ; + $row_staff_noassigned = $mysqli_staff_noassigned->fetch_assoc() ; + $total_staff_noassigned = $row_staff_noassigned['total'] ; + + + // all active staff + $mysqli_staff = $mysqli->query( "SELECT COUNT(staff_id) as total FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL AND branch_id != '0'" ) ; + $row_staff = $mysqli_staff->fetch_assoc() ; + $total_staff = $row_staff['total'] ; + + + // total branch + $mysqli_branch = $mysqli->query( "SELECT COUNT(branch_id) as total FROM branch + WHERE deleted_at IS NULL " ) ; + $row_staff_noassigned = $mysqli_staff_noassigned->fetch_assoc() ; + $row_branch = $mysqli_branch->fetch_assoc() ; + $total_branch = $row_branch['total'] ; + + + // passport / permit expiry within 2 months + $date_startmonth = TODAYDAY . ' 00:00:00' ; + $date_endmonth = date( "Y-m-d", strtotime("+2 months") ) . ' 23:59:59' ; + $mysqli_passport = $mysqli->query( "SELECT COUNT(staff_id) as total FROM staff + WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL AND branch_id != '0' AND country_id != '1' AND ( staff_permit_end BETWEEN '".$date_startmonth."' AND '".$date_endmonth."' OR staff_passportexpired BETWEEN '".$date_startmonth."' AND '".$date_endmonth."' )" ) ; + $row_passport = $mysqli_passport->fetch_assoc() ; + $total_passport = $row_passport['total'] ; + + $dashboards = [ + [ + 'title' => 'Not Yet Assign Staff', + 'value' => $total_staff_noassigned + ], + [ + 'title' => 'Active Staff', + 'value' => $total_staff + ], + [ + 'title' => 'Total Branch', + 'value' => $total_branch + ], + [ + 'title' => 'Permit & Passport Within 2 Months', + 'value' => $total_passport + ] + ] ; + + ?> +
      + $v ){ ?> +
    • +
      +
      +
      +
      +
      +

      +
      + +
      +
      +
      +
    • + +
    + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + +
    +
    Monthly Achievement
    + +
    + +
    +
    + + 'TASK', + 'query' => "SELECT task_id FROM task a + WHERE a.deleted_at IS NULL and a.status in ('pending', 'assigned', 'resubmit', 'progress') " . $user_branch_permission_sql_task, + 'url' => "task.php?search_type%5B%5D=pending&search_type%5B%5D=assigned&search_type%5B%5D=resubmit&search_type%5B%5D=progress&page_mode=list" + ], [ + 'title' => 'SUGGESTION', + 'query' => "SELECT a.suggestion_id FROM suggestion a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL and a.status IN ( 'pending' ) " . $user_branch_permission_sql_b, + 'url' => "app-suggestion.php?page_mode=list&search_type=pending" + ], [ + 'title' => 'REQUEST', + 'query' => "SELECT a.request_id FROM request a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL and a.status IN ('pending', 'awaiting-arrival', 'awaiting-collection') " . $user_branch_permission_sql_b, + 'url' => "app-request.php?page_mode=list&search_type%5B%5D=pending&search_type%5B%5D=awaiting-arrival&search_type%5B%5D=awaiting-collection" + ], [ + 'title' => 'GRIEVANCE', + 'query' => "SELECT a.grievance_id FROM grievance a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL and a.status IN ( 'pending' ) " . $user_branch_permission_sql_b, + 'url' => "app-grievance.php?page_mode=list&search_type=pending" + ], [ + 'title' => 'Redeem', + 'query' => "SELECT a.redeem_id as item_file FROM staff_redeem a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL and a.status IN ('pending', 'awaiting-arrival', 'awaiting-collection') " . $user_branch_permission_sql_b, + 'url' => "app-redeem.php?page_mode=all&search_type%5B%5D=pending&search_type%5B%5D=awaiting-arrival&search_type%5B%5D=awaiting-collection" + ], [ + 'title' => 'ASSOCIATION', + 'query' => "SELECT a.view_id FROM staff_association a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL and a.status IN ( 'pending' ) " . $user_branch_permission_sql_b, + 'url' => "app-association.php?page_mode=view_all&search_type[]=pending" + ], [ + 'title' => 'TRAINING', + 'query' => "SELECT a.view_id FROM staff_training a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.status IN ( 'pending' ) " .$user_branch_permission_sql_b, + 'url' => "app-training.php?page_mode=view_all&search_type[]=pending" + ], [ + 'title' => 'HEADCOUNT', + 'query' => "SELECT a.formheadcount_id FROM formheadcount a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.status IN ( 'pending' ) " . $user_branch_permission_sql_b, + 'url' => "app-form-headcount.php?page_mode=list&search_type=pending" + ], [ + 'title' => 'NOMINATION', + 'query' => "SELECT a.formnomination_id FROM formnomination a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.status IN ( 'pending' ) ".$user_branch_permission_sql_b, + 'url' => "app-form-nomination.php?page_mode=list&search_type=pending" + ], [ + 'title' => 'RESIGNATION', + 'query' => "SELECT a.formresignation_id FROM formresignation a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.deleted_at IS NULL AND a.status IN ( 'pending' ) ".$user_branch_permission_sql_b, + 'url' => "app-form-resignation.php?page_mode=list&search_type=pending" + ] + ] ; + ?> + +
    +
    Current Pending List
    +
    + $v_table ) { + $select_table = $mysqli->query( $v_table['query'] ) ; + $count_table = $select_table->num_rows ; + + ?> + + + + + + + + + + + +
    + +
    +

    +
    +
    +
    + +
    +
    + + + + +
    +
    Weekly Chart Report
    +
    + + + +
    +
    + + + +
    +
    +
    + +
    + +
    +
    Title
    +
    + placeholder="Title" /> +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    +
    + + + +
    +
    + +
    + +
    +
    + + + + + + \ No newline at end of file diff --git a/page-dashboard-iframe.php b/page-dashboard-iframe.php new file mode 100644 index 0000000..4f8d897 --- /dev/null +++ b/page-dashboard-iframe.php @@ -0,0 +1,231 @@ +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: page-logout.php') ; + exit ; +} + +// check query exsits +$mysqli_page = $mysqli->query("SELECT post_id, post_title, post_content FROM system_post + WHERE post_type = 'page-dashboard' AND post_categories = 'page-dashboard' AND post_trash = '0' LIMIT 1") ; + +//pagination +if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + +$limit_dash = 20; + +$start_from = ($product_page - 1) * $limit_dash ; //end next and prev page + +$search_name = escapeString($_GET['search_name']); +$search_idno = escapeString($_GET['search_idno']); +$export_excel = escapeString($_GET['export-excel']); + +$search_query = '' ; + +if( $search_name != ''){ + + $search_query .= " AND b.staff_name LIKE '%".$search_name."%'" ; + +} + +if( $search_idno != ''){ + + $search_query .= " AND b.staff_idno LIKE '%".$search_idno."%'" ; + +} + + +$mysqli_achievement = $mysqli->query("SELECT a.*, b.staff_name, b.staff_point, b.staff_idno FROM staff_monthly_achievement a + LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) + WHERE a.staff_id != '' AND Year(a.created_at) = Year(Now()) AND MONTH(a.created_at) = month(Now()) ".$search_query." ".$user_branch_permission_sql_b." GROUP BY a.staff_id ORDER BY b.staff_point DESC LIMIT $start_from, ".$limit_dash) ; + +$mysqli_achievement_query = "SELECT a.*, b.staff_name, b.staff_point, b.staff_idno FROM staff_monthly_achievement a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.staff_id != '' AND Year(a.created_at) = Year(Now()) AND MONTH(a.created_at) = month(Now()) ".$search_query." ".$user_branch_permission_sql_b." GROUP BY a.staff_id ORDER BY b.staff_point DESC"; + + +if ( $export_excel == 'export_eae' ){ + + $page_export_file_name = 'Monthly Achivement-'; + + $t_title_header_excel = 'Monthly Achivement Report '; + + $array_header_excel = array( + 'ID', + 'Name', + 'Monthly Point Achievement', + 'Current Point', + 'Redeemed Point', + 'Total Accumulated Point', + 'Star', + 'Achievement' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_achievement_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + + $mysqli_accumulated_point = $mysqli->query("SELECT SUM(amount) AS total_accumulated FROM staff_point_movement WHERE staff_id = '".$mysqli_export_page['staff_id']."' AND from_table NOT IN ('redeem','staff_point_movement_cutoff') AND Year(created_at) = Year(Now())"); + + if ( $mysqli_accumulated_point->num_rows > 0 ){ + $row_accumulated = $mysqli_accumulated_point->fetch_array(MYSQLI_ASSOC); + } + + + $mysqli_total_redeem = $mysqli->query("SELECT SUM(amount) AS total_redeem FROM staff_point_movement WHERE staff_id = '".$mysqli_export_page['staff_id']."' AND from_table = 'redeem' AND Year(created_at) = Year(Now())"); + + if ( $mysqli_total_redeem->num_rows > 0 ){ + $row_redeem = $mysqli_total_redeem->fetch_array(MYSQLI_ASSOC); + } + + $current_point = $row_accumulated['total_accumulated'] + $row_redeem['total_redeem']; + $current_point = number_format($current_point, 2, '.', ''); + + $array_body_excel[] = array( + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + $mysqli_export_page['staff_point_achievement'], + $current_point, + ($row_redeem['total_redeem'] != '' ? $row_redeem['total_redeem'] : '0.00' ), + ($row_accumulated['total_accumulated'] != '' ? $row_accumulated['total_accumulated'] : '0.00' ), + $mysqli_export_page['staff_star'], + $mysqli_export_page['staff_achievement'] + ) ; + } + } + + include 'export_excel_default.php'; + +} + +// start header here +include 'requires/page_header.php' ; +// include 'requires/page_top.php' ; + +$search_url = 'page_mode=all&search_name='.$search_name.'&search_idno='.$search_idno ; + +$page_pagination = nextPrevious($product_page, $limit_dash, $search_url, $mysqli_achievement_query) ; + +?> + + +
    + + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_achievement = $mysqli_achievement->fetch_array(MYSQLI_ASSOC) ){ + echo ' + + + + '; + + + $mysqli_accumulated_point = $mysqli->query("SELECT SUM(amount) AS total_accumulated FROM staff_point_movement WHERE staff_id = '".$row_achievement['staff_id']."' AND from_table NOT IN ('redeem','staff_point_movement_cutoff') AND Year(created_at) = Year(Now())"); + + if ( $mysqli_accumulated_point->num_rows > 0 ){ + $row_accumulated = $mysqli_accumulated_point->fetch_array(MYSQLI_ASSOC); + } + + + $mysqli_total_redeem = $mysqli->query("SELECT SUM(amount) AS total_redeem FROM staff_point_movement WHERE staff_id = '".$row_achievement['staff_id']."' AND from_table = 'redeem' AND Year(created_at) = Year(Now())"); + + if ( $mysqli_total_redeem->num_rows > 0 ){ + $row_redeem = $mysqli_total_redeem->fetch_array(MYSQLI_ASSOC); + } + + $current_point = $row_accumulated['total_accumulated'] + $row_redeem['total_redeem']; + $current_point = number_format($current_point, 2, '.', ''); + + echo ' + + + '; + + // $mysqli_current_point + + echo ' + + + + '; + } + }else{ + echo ' + + + + + + + + + + ' ; + } + ?> + +
    IDNameMonthly Point AchievementCurrent PointRedeemed PointTotal Accumulated PointStarAchievement
    '.dataFilter($row_achievement['staff_idno']).''.dataFilter($row_achievement['staff_name']).''.dataFilter($row_achievement['staff_point_achievement']).''.dataFilter($current_point).''.($row_redeem['total_redeem'] != '' ?dataFilter($row_redeem['total_redeem']) : '0.00' ).''.($row_accumulated['total_accumulated'] != '' ?dataFilter($row_accumulated['total_accumulated']) : '0.00' ).''.dataFilter($row_achievement['staff_star']).''.dataFilter($row_achievement['staff_achievement']).'
    '.$lang['no_data'].'
    + +
    + diff --git a/page-dashboard.php b/page-dashboard.php new file mode 100644 index 0000000..daa9110 --- /dev/null +++ b/page-dashboard.php @@ -0,0 +1,322 @@ + + + + + +
    +
    + +
    +
    +

    DASHBOARD

    +
    +
    + + +
    +
    + 2025-07-08 +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + Employee +
    700
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + Employee +
    700
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + Employee +
    700
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + Employee +
    700
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +

    ANNOUNCEMENT

    +
    +
    + +
    +
    + Welcome to your new system +
    +
    + +
    +
    + + If you need help getting started, check out our user manual. If you need help, call us at +6016 977 5111 or email us at info@ips.com.my to get information on how to use your current screen and where to go for more assistance. + +
    +
    +
    + +
    +
    +
    +
    +

    TOTAL EMPLOYEES

    +
    +
    +
    +
    +
    +

    EMPLOYEES COMPARISON

    +
    +
    +
    +
    +
    +
    + + + + + \ No newline at end of file diff --git a/page-department.php b/page-department.php new file mode 100644 index 0000000..ef3e05b --- /dev/null +++ b/page-department.php @@ -0,0 +1,485 @@ +query("SELECT * FROM setting_department + WHERE department_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_department (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE setting_department SET + department_code = '".escapeString($_POST['code'])."', + department_colour = '".escapeString($_POST['department_colour'])."', + updated_at = '".TODAYDATE."' + WHERE department_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $department_desc = escapeString( $_POST['department_desc_'.$klang] ) ; + + checkLangUpdate( 'setting_department_translation', 'department_id', $page, $klang, [ + 'department_desc' => [ 'type' => 'input', 'value' => $department_desc ] + ] ) ; + } + + // refresh page + header("Location:page-department.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'hr-department-list-new') ) ){ + header('Location: index.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + +
    +
    + + + '.$lang['thank_you_your_department_has_been_updated'].' +
    ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
    +
    +
    +
    + + + [ + 'type' => 'input', + 'title' => $lang['name'] + ] + ]) ; + ?> + +
    +
    +
    + +
    +
    +
    +
    Colour
    +
    + +
    +
    + + +
    +
    +
    + + + +
    +
    + +
    +
    +
    +
    +
    + getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + $styleArrayTitle = array( + 'font' => array( + 'bold' => true , + 'color' => array( 'rgb' => '000000' ) , + 'size' => 15 + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ); + + $styleArrayDay = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayBg1 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'AFABAB') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayBg2 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'FFDA65') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArray = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayLeft = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT, + ) + ) ; + + $styleArray2 = array( + 'alignment' => array( + //'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER, + ) + ) ; + + $styleArrayRed = array( + 'font' => array( + 'color' => array('rgb' => 'FF0000'), + )); + + $count = 1 ; + $firstChar = 'A' ; + $lastChar = 'E' ; + + // title name + $objPHPExcel->getActiveSheet()->mergeCells( $firstChar.$count.':'.$lastChar.$count ) ; + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count.':'.$lastChar.$count )->applyFromArray( $styleArrayTitle ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, 'Department List' ) ; + $count++ ; + + $setChar = $firstChar ; + $objPHPExcel->getActiveSheet()->getStyle($setChar.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, 'No' ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, 'Title' ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, 'Date' ) ; + + // loop all attendance record + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY department_id") ; + if ( $mysqli_page->num_rows > 0 ){ + $count_no = 0 ; + while ( $row_page = $mysqli_page->fetch_assoc() ){ + + $count++ ; + $count_no++ ; + $setChar = $firstChar ; + + $objPHPExcel->getActiveSheet()->getStyle($setChar.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, $count_no ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, dataFilter($row_page['department_desc']) ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, dataFilter($row_page['created_at']) ) ; + + } + } + + // Submission from + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; + } + + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY department_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
    +
    + + +
    +
    search
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    + + +
    +
    + + + + +
    +
    + + +
    +
    listing
    +
    + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
    '.dataFilter($row_page['department_desc']).''.dataFilter($row_page['department_code']).''.resetDateFormat($row_page['created_at']).' +
    + + +
    +
    '.$lang['no_data'].'
    + +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/page-logout.php b/page-logout.php new file mode 100644 index 0000000..63e2597 --- /dev/null +++ b/page-logout.php @@ -0,0 +1,29 @@ + \ No newline at end of file diff --git a/page-notification.php b/page-notification.php new file mode 100644 index 0000000..92e4265 --- /dev/null +++ b/page-notification.php @@ -0,0 +1,386 @@ + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + query("INSERT INTO system_post (post_type, post_categories, post_date, post_modified) VALUES ('page-notification', 'page-notification', '".TODAYDATE."', '".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // check query exsits + $mysqli_page = $mysqli->query("SELECT * FROM system_post + WHERE post_id = '".$page."' AND post_type = 'page-notification' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + + // update database + if (isset($type) && $type == 'edit' && $_POST['hide'] == 1){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + // check if name already exists. + $check_status = checkTitle($page_title, $page) ; + $title = $check_status['title'] ; + $status = $check_status['status'] ; + + // set image in variable + $image = $_FILES["image"]["name"] ; + + // remove photo + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "post_file = ''," ; + } + + // update database + $mysqli->query("UPDATE system_post SET + post_title = '".$page_title."', + post_status = '".$status."', + post_link = '".$title."', + ".$image_query." + post_modified = '".TODAYDATE."', + post_trash = '0' + WHERE post_id = '".$page."'") ; + + // resize image + $create_image = reCreateImage('Product', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + // update database + $mysqli->query("UPDATE system_post SET + post_file = '".$create_image['image']."' + WHERE post_id = '".$page."'"); + } + + // refresh page + header("Location:page-notification.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + + } + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + + ?> +
    + +
    +
    + + '. $lang['thank_you_your_notification_has_been_updated'].' +
    ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
    +
    +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    + + + + +
    +
    + +
    +
    +
    +
    +
    + + 0){ + foreach($sortable as $key => $value){ + $mysqli->query("UPDATE system_post SET + post_order = '".$value."' + WHERE post_id = '".$key."'") ; + } + } + // trash item + switch($_POST['page_action']){ + case 'trash': + $mysqli_query = "UPDATE " . system_post . " SET + post_trash = '1' + WHERE post_id = " ; + $trash_page = trashPage('post', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_title='.$search_title.'&search_date='.$search_date.'&page_mode='.$page_mode ; + + // page query + $mysqli_query = "SELECT * FROM system_post + WHERE post_title != '' AND post_type = 'page-notification' AND post_trash = '0'".$search_query ; + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY post_order LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
    +
    + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    + + +
    +
    + + + + +
    +
    + + +
    +
    +
    + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + // title + $title = dataFilter($row_page['post_title']) ; + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
    '.$title.''.resetDateFormat($row_page['post_date']).' +
    + + +
    +
    '.$lang['no_data'].'
    + +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/pdfs/ignored.md b/pdfs/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/plugins/PHPMailer/COMMITMENT b/plugins/PHPMailer/COMMITMENT new file mode 100644 index 0000000..a687e0d --- /dev/null +++ b/plugins/PHPMailer/COMMITMENT @@ -0,0 +1,46 @@ +GPL Cooperation Commitment +Version 1.0 + +Before filing or continuing to prosecute any legal proceeding or claim +(other than a Defensive Action) arising from termination of a Covered +License, we commit to extend to the person or entity ('you') accused +of violating the Covered License the following provisions regarding +cure and reinstatement, taken from GPL version 3. As used here, the +term 'this License' refers to the specific Covered License being +enforced. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly + and finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you + have received notice of violation of this License (for any work) + from that copyright holder, and you cure the violation prior to 30 + days after your receipt of the notice. + +We intend this Commitment to be irrevocable, and binding and +enforceable against us and assignees of or successors to our +copyrights. + +Definitions + +'Covered License' means the GNU General Public License, version 2 +(GPLv2), the GNU Lesser General Public License, version 2.1 +(LGPLv2.1), or the GNU Library General Public License, version 2 +(LGPLv2), all as published by the Free Software Foundation. + +'Defensive Action' means a legal proceeding or claim that We bring +against you in response to a prior proceeding or claim initiated by +you or your affiliate. + +'We' means each contributor to this repository as of the date of +inclusion of this file, including subsidiaries of a corporate +contributor. + +This work is available under a Creative Commons Attribution-ShareAlike +4.0 International license (https://creativecommons.org/licenses/by-sa/4.0/). diff --git a/plugins/PHPMailer/LICENSE b/plugins/PHPMailer/LICENSE new file mode 100644 index 0000000..f166cc5 --- /dev/null +++ b/plugins/PHPMailer/LICENSE @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! \ No newline at end of file diff --git a/plugins/PHPMailer/README.md b/plugins/PHPMailer/README.md new file mode 100644 index 0000000..7c7d290 --- /dev/null +++ b/plugins/PHPMailer/README.md @@ -0,0 +1,221 @@ +![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png) + +# PHPMailer - A full-featured email creation and transfer class for PHP + +Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer) +[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/quality-score.png?s=3758e21d279becdf847a557a56a3ed16dfec9d5d)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/) +[![Code Coverage](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/coverage.png?s=3fe6ca5fe8cd2cdf96285756e42932f7ca256962)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/) + +[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![Latest Unstable Version](https://poser.pugx.org/phpmailer/phpmailer/v/unstable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](http://phpmailer.github.io/PHPMailer/) + +## Class Features +- Probably the world's most popular code for sending email from PHP! +- Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more +- Integrated SMTP support - send without a local mail server +- Send emails with multiple To, CC, BCC and Reply-to addresses +- Multipart/alternative emails for mail clients that do not read HTML email +- Add attachments, including inline +- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings +- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SSL and SMTP+STARTTLS transports +- Validates email addresses automatically +- Protect against header injection attacks +- Error messages in over 50 languages! +- DKIM and S/MIME signing support +- Compatible with PHP 5.5 and later +- Namespaced to prevent name clashes +- Much more! + +## Why you might need it +Many PHP developers need to send email from their code. The only PHP function that supports this is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments. + +Formatting email correctly is surprisingly difficult. There are myriad overlapping RFCs, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong! +*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/), [Zend/Mail](https://zendframework.github.io/zend-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail) etc. + +The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP implementation allows email sending on Windows platforms without a local mail server. + +## License +This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read LICENSE for information on the software availability and distribution. + +## Installation & loading +PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: + +```json +"phpmailer/phpmailer": "~6.1" +``` + +or run + +```sh +composer require phpmailer/phpmailer +``` + +Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer. + +If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`. + +Alternatively, if you're not using Composer, copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually: + +```php +SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output + $mail->isSMTP(); // Send using SMTP + $mail->Host = 'smtp1.example.com'; // Set the SMTP server to send through + $mail->SMTPAuth = true; // Enable SMTP authentication + $mail->Username = 'user@example.com'; // SMTP username + $mail->Password = 'secret'; // SMTP password + $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` also accepted + $mail->Port = 587; // TCP port to connect to + + //Recipients + $mail->setFrom('from@example.com', 'Mailer'); + $mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient + $mail->addAddress('ellen@example.com'); // Name is optional + $mail->addReplyTo('info@example.com', 'Information'); + $mail->addCC('cc@example.com'); + $mail->addBCC('bcc@example.com'); + + // Attachments + $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments + $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name + + // Content + $mail->isHTML(true); // Set email format to HTML + $mail->Subject = 'Here is the subject'; + $mail->Body = 'This is the HTML message body in bold!'; + $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; + + $mail->send(); + echo 'Message has been sent'; +} catch (Exception $e) { + echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; +} +``` + +You'll find plenty more to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. + +If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance. + +That's it. You should now be ready to use PHPMailer! + +## Localization +PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: + +```php +// To load the French version +$mail->setLanguage('fr', '/optional/path/to/language/directory/'); +``` + +We welcome corrections and new languages - if you're looking for corrections to do, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations. + +## Documentation +Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, this should be the first place you look as it's the most frequently updated. + +Examples of how to use PHPMailer for common scenarios can be found in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. If you're looking for a good starting point, we recommend you start with [the Gmail example](https://github.com/PHPMailer/PHPMailer/tree/master/examples/gmail.phps). + +Note that in order to reduce PHPMailer's deployed code footprint, the examples are no longer included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly. + +Complete generated API documentation is [available online](http://phpmailer.github.io/PHPMailer/). + +You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good source of how to do various operations such as encryption. + +If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting). + +## Tests +There is a PHPUnit test script in the [test](https://github.com/PHPMailer/PHPMailer/tree/master/test/) folder. PHPMailer uses PHPUnit 4.8 - we would use 5.x but we need to run on PHP 5.5. + +Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer) + +If this isn't passing, is there something you can do to help? + +## Security +Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately. + +PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. + +PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer). + +PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a critical remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). + +See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) for more detail on security issues. + +## Contributing +Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). + +We're particularly interested in fixing edge-cases, expanding test coverage and updating translations. + +If you found a mistake in the docs, or want to add something, go ahead and amend the wiki - anyone can edit it. + +If you have git clones from prior to the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone: + +```sh +git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git +``` + +Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained. + +## Sponsorship +Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), a powerful email marketing system. + +Smartmessages email marketing + +Other contributions are gladly received, whether in beer ðŸº, T-shirts 👕, Amazon wishlist raids, or cold, hard cash 💰. If you'd like to donate to say "thank you" to maintainers or contributors, please contact them through individual profile pages via [the contributors page](https://github.com/PHPMailer/PHPMailer/graphs/contributors). + +## Changelog +See [changelog](changelog.md). + +## History +- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/). +- Marcus Bointon (coolbru on SF) and Andy Prevost (codeworxtech) took over the project in 2004. +- Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski. +- Marcus created his fork on [GitHub](https://github.com/Synchro/PHPMailer) in 2008. +- Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer in 2013. +- PHPMailer moves to the [PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013. + +### What's changed since moving from SourceForge? +- Official successor to the SourceForge and Google Code projects. +- Test suite. +- Continuous integration with Travis-CI. +- Composer support. +- Public development. +- Additional languages and language strings. +- CRAM-MD5 authentication support. +- Preserves full repo history of authors, commits and branches from the original SourceForge project. diff --git a/plugins/PHPMailer/SECURITY.md b/plugins/PHPMailer/SECURITY.md new file mode 100644 index 0000000..5e917cd --- /dev/null +++ b/plugins/PHPMailer/SECURITY.md @@ -0,0 +1,28 @@ +# Security notices relating to PHPMailer + +Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately. + +PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr. + +PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project. + +PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. + +PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer). + +PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). + +PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending. + +PHPMailer versions prior to 5.2.10 (released May 2015) are vulnerable to [CVE-2008-5619](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-5619), a remote code execution vulnerability in the bundled html2text library. This file was removed in 5.2.10, so if you are using a version prior to that and make use of the html2text function, it's vitally important that you upgrade and remove this file. + +PHPMailer versions prior to 2.0.7 and 2.2.1 are vulnerable to [CVE-2012-0796](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-0796), an email header injection attack. + +Joomla 1.6.0 uses PHPMailer in an unsafe way, allowing it to reveal local file paths, reported in [CVE-2011-3747](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-3747). + +PHPMailer didn't sanitise the `$lang_path` parameter in `SetLanguage`. This wasn't a problem in itself, but some apps (PHPClassifieds, ATutor) also failed to sanitise user-provided parameters passed to it, permitting semi-arbitrary local file inclusion, reported in [CVE-2010-4914](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-4914), [CVE-2007-2021](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-2021) and [CVE-2006-5734](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-5734). + +PHPMailer 1.7.2 and earlier contained a possible DDoS vulnerability reported in [CVE-2005-1807](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2005-1807). + +PHPMailer 1.7 and earlier (June 2003) have a possible vulnerability in the `SendmailSend` method where shell commands may not be sanitised. Reported in [CVE-2007-3215](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-3215). + diff --git a/plugins/PHPMailer/VERSION b/plugins/PHPMailer/VERSION new file mode 100644 index 0000000..1879c1b --- /dev/null +++ b/plugins/PHPMailer/VERSION @@ -0,0 +1 @@ +6.1.4 \ No newline at end of file diff --git a/plugins/PHPMailer/composer.json b/plugins/PHPMailer/composer.json new file mode 100644 index 0000000..fd0695c --- /dev/null +++ b/plugins/PHPMailer/composer.json @@ -0,0 +1,51 @@ +{ + "name": "phpmailer/phpmailer", + "type": "library", + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "require": { + "php": ">=5.5.0", + "ext-ctype": "*", + "ext-filter": "*" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.2", + "phpunit/phpunit": "^4.8 || ^5.7", + "doctrine/annotations": "^1.2" + }, + "suggest": { + "psr/log": "For optional PSR-3 debug logging", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "ext-mbstring": "Needed to send email in multibyte encoding charset", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + }, + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "PHPMailer\\Test\\": "test/" + } + }, + "license": "LGPL-2.1-only" +} diff --git a/plugins/PHPMailer/get_oauth_token.php b/plugins/PHPMailer/get_oauth_token.php new file mode 100644 index 0000000..1237b57 --- /dev/null +++ b/plugins/PHPMailer/get_oauth_token.php @@ -0,0 +1,144 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2017 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * Get an OAuth2 token from an OAuth2 provider. + * * Install this script on your server so that it's accessible + * as [https/http]:////get_oauth_token.php + * e.g.: http://localhost/phpmailer/get_oauth_token.php + * * Ensure dependencies are installed with 'composer install' + * * Set up an app in your Google/Yahoo/Microsoft account + * * Set the script address as the app's redirect URL + * If no refresh token is obtained when running this file, + * revoke access to your app and run the script again. + */ + +namespace PHPMailer\PHPMailer; + +/** + * Aliases for League Provider Classes + * Make sure you have added these to your composer.json and run `composer install` + * Plenty to choose from here: + * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ + */ +// @see https://github.com/thephpleague/oauth2-google +use League\OAuth2\Client\Provider\Google; +// @see https://packagist.org/packages/hayageek/oauth2-yahoo +use Hayageek\OAuth2\Client\Provider\Yahoo; +// @see https://github.com/stevenmaguire/oauth2-microsoft +use Stevenmaguire\OAuth2\Client\Provider\Microsoft; + +if (!isset($_GET['code']) && !isset($_GET['provider'])) { +?> + +Select Provider:
    +Google
    +Yahoo
    +Microsoft/Outlook/Hotmail/Live/Office365
    + + + $clientId, + 'clientSecret' => $clientSecret, + 'redirectUri' => $redirectUri, + 'accessType' => 'offline' +]; + +$options = []; +$provider = null; + +switch ($providerName) { + case 'Google': + $provider = new Google($params); + $options = [ + 'scope' => [ + 'https://mail.google.com/' + ] + ]; + break; + case 'Yahoo': + $provider = new Yahoo($params); + break; + case 'Microsoft': + $provider = new Microsoft($params); + $options = [ + 'scope' => [ + 'wl.imap', + 'wl.offline_access' + ] + ]; + break; +} + +if (null === $provider) { + exit('Provider missing'); +} + +if (!isset($_GET['code'])) { + // If we don't have an authorization code then get one + $authUrl = $provider->getAuthorizationUrl($options); + $_SESSION['oauth2state'] = $provider->getState(); + header('Location: ' . $authUrl); + exit; +// Check given state against previously stored one to mitigate CSRF attack +} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { + unset($_SESSION['oauth2state']); + unset($_SESSION['provider']); + exit('Invalid state'); +} else { + unset($_SESSION['provider']); + // Try to get an access token (using the authorization code grant) + $token = $provider->getAccessToken( + 'authorization_code', + [ + 'code' => $_GET['code'] + ] + ); + // Use this to interact with an API on the users behalf + // Use this to get a new access token if the old one expires + echo 'Refresh Token: ', $token->getRefreshToken(); +} diff --git a/plugins/PHPMailer/language/phpmailer.lang-af.php b/plugins/PHPMailer/language/phpmailer.lang-af.php new file mode 100644 index 0000000..3c42d78 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-af.php @@ -0,0 +1,25 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP -Õ« Õ½Õ­Õ¡Õ¬: Õ¹Õ°Õ¡Õ»Õ¸Õ²Õ¾Õ¥Ö Õ½Õ¿Õ¸Ö‚Õ£Õ¥Õ¬ Õ«Õ½Õ¯Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP -Õ« Õ½Õ­Õ¡Õ¬: Õ¹Õ°Õ¡Õ»Õ¸Õ²Õ¾Õ¥Ö Õ¯Õ¡Õº Õ°Õ¡Õ½Õ¿Õ¡Õ¿Õ¥Õ¬ SMTP Õ½Õ¥Ö€Õ¾Õ¥Ö€Õ« Õ°Õ¥Õ¿.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP -Õ« Õ½Õ­Õ¡Õ¬: Õ¿Õ¾ÕµÕ¡Õ¬Õ¶Õ¥Ö€Õ¨ Õ¨Õ¶Õ¤Õ¸Ö‚Õ¶Õ¾Õ¡Õ® Õ¹Õ¥Õ¶.'; +$PHPMAILER_LANG['empty_message'] = 'Õ€Õ¡Õ²Õ¸Ö€Õ¤Õ¡Õ£Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ Õ¤Õ¡Õ¿Õ¡Ö€Õ¯ Õ§'; +$PHPMAILER_LANG['encoding'] = 'Ô¿Õ¸Õ¤Õ¡Õ¾Õ¸Ö€Õ´Õ¡Õ¶ Õ¡Õ¶Õ°Õ¡ÕµÕ¿ Õ¿Õ¥Õ½Õ¡Õ¯: '; +$PHPMAILER_LANG['execute'] = 'Õ‰Õ°Õ¡Õ»Õ¸Õ²Õ¾Õ¥Ö Õ«Ö€Õ¡Õ¯Õ¡Õ¶Õ¡ÖÕ¶Õ¥Õ¬ Õ°Ö€Õ¡Õ´Õ¡Õ¶Õ¨: '; +$PHPMAILER_LANG['file_access'] = 'Õ–Õ¡ÕµÕ¬Õ¨ Õ°Õ¡Õ½Õ¡Õ¶Õ¥Õ¬Õ« Õ¹Õ§: '; +$PHPMAILER_LANG['file_open'] = 'Õ–Õ¡ÕµÕ¬Õ« Õ½Õ­Õ¡Õ¬: Ö†Õ¡ÕµÕ¬Õ¨ Õ¹Õ°Õ¡Õ»Õ¸Õ²Õ¾Õ¥Ö Õ¢Õ¡ÖÕ¥Õ¬: '; +$PHPMAILER_LANG['from_failed'] = 'ÕˆÖ‚Õ²Õ¡Ö€Õ¯Õ¸Õ²Õ« Õ°Õ¥Õ¿Ö‡ÕµÕ¡Õ¬ Õ°Õ¡Õ½ÖÕ¥Õ¶ Õ½Õ­Õ¡Õ¬ Õ§: '; +$PHPMAILER_LANG['instantiate'] = 'Õ€Õ¶Õ¡Ö€Õ¡Õ¾Õ¸Ö€ Õ¹Õ§ Õ¯Õ¡Õ¶Õ¹Õ¥Õ¬ mail Ö†Õ¸Ö‚Õ¶Õ¯ÖÕ«Õ¡Õ¶.'; +$PHPMAILER_LANG['invalid_address'] = 'Õ€Õ¡Õ½ÖÕ¥Õ¶ Õ½Õ­Õ¡Õ¬ Õ§: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' ÖƒÕ¸Õ½Õ¿Õ¡ÕµÕ«Õ¶ Õ½Õ¥Ö€Õ¾Õ¥Ö€Õ« Õ°Õ¥Õ¿ Õ¹Õ« Õ¡Õ·Õ­Õ¡Õ¿Õ¸Ö‚Õ´.'; +$PHPMAILER_LANG['provide_address'] = 'Ô±Õ¶Õ°Ö€Õ¡ÕªÕ¥Õ·Õ¿ Õ§ Õ¿Ö€Õ¡Õ´Õ¡Õ¤Ö€Õ¥Õ¬ Õ£Õ¸Õ¶Õ¥ Õ´Õ¥Õ¯ Õ½Õ¿Õ¡ÖÕ¸Õ²Õ« e-mail Õ°Õ¡Õ½ÖÕ¥.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP -Õ« Õ½Õ­Õ¡Õ¬: Õ¹Õ« Õ°Õ¡Õ»Õ¸Õ²Õ¾Õ¥Õ¬ Õ¸Ö‚Õ²Õ¡Ö€Õ¯Õ¥Õ¬ Õ°Õ¥Õ¿Ö‡ÕµÕ¡Õ¬ Õ½Õ¿Õ¡ÖÕ¸Õ²Õ¶Õ¥Ö€Õ« Õ°Õ¡Õ½ÖÕ¥Õ¶Õ¥Ö€Õ«Õ¶: '; +$PHPMAILER_LANG['signing'] = 'ÕÕ¿Õ¸Ö€Õ¡Õ£Ö€Õ´Õ¡Õ¶ Õ½Õ­Õ¡Õ¬: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP -Õ« connect() Ö†Õ¸Ö‚Õ¶Õ¯ÖÕ«Õ¡Õ¶ Õ¹Õ« Õ°Õ¡Õ»Õ¸Õ²Õ¾Õ¥Õ¬'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP Õ½Õ¥Ö€Õ¾Õ¥Ö€Õ« Õ½Õ­Õ¡Õ¬: '; +$PHPMAILER_LANG['variable_set'] = 'Õ‰Õ« Õ°Õ¡Õ»Õ¸Õ²Õ¾Õ¸Ö‚Õ´ Õ½Õ¿Õ¥Õ²Õ®Õ¥Õ¬ Õ¯Õ¡Õ´ Õ¾Õ¥Ö€Õ¡ÖƒÕ¸Õ­Õ¥Õ¬ ÖƒÕ¸ÖƒÕ¸Õ­Õ¡Õ¯Õ¡Õ¶Õ¨: '; +$PHPMAILER_LANG['extension_missing'] = 'Õ€Õ¡Õ¾Õ¥Õ¬Õ¾Õ¡Õ®Õ¨ Õ¢Õ¡ÖÕ¡Õ¯Õ¡ÕµÕ¸Ö‚Õ´ Õ§: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-ar.php b/plugins/PHPMailer/language/phpmailer.lang-ar.php new file mode 100644 index 0000000..865d0b7 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-ar.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'خطأ SMTP : لا يمكن تأكيد الهوية.'; +$PHPMAILER_LANG['connect_host'] = 'خطأ SMTP: لا يمكن الاتصال بالخادم SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'خطأ SMTP: لم يتم قبول المعلومات .'; +$PHPMAILER_LANG['empty_message'] = 'نص الرسالة ÙØ§Ø±Øº'; +$PHPMAILER_LANG['encoding'] = 'ترميز غير معروÙ: '; +$PHPMAILER_LANG['execute'] = 'لا يمكن تنÙيذ : '; +$PHPMAILER_LANG['file_access'] = 'لا يمكن الوصول للملÙ: '; +$PHPMAILER_LANG['file_open'] = 'خطأ ÙÙŠ الملÙ: لا يمكن ÙØªØ­Ù‡: '; +$PHPMAILER_LANG['from_failed'] = 'خطأ على مستوى عنوان المرسل : '; +$PHPMAILER_LANG['instantiate'] = 'لا يمكن توÙير خدمة البريد.'; +$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; +$PHPMAILER_LANG['provide_address'] = 'يجب توÙير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; +$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية ' . + 'ÙØ´Ù„ ÙÙŠ الارسال لكل من : '; +$PHPMAILER_LANG['signing'] = 'خطأ ÙÙŠ التوقيع: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.'; +$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'لا يمكن تعيين أو إعادة تعيين متغير: '; +$PHPMAILER_LANG['extension_missing'] = 'Ø§Ù„Ø¥Ø¶Ø§ÙØ© غير موجودة: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-az.php b/plugins/PHPMailer/language/phpmailer.lang-az.php new file mode 100644 index 0000000..3749d83 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-az.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP GreÅ¡ka: Neuspjela prijava.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP GreÅ¡ka: Nije moguće spojiti se sa SMTP serverom.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP GreÅ¡ka: Podatci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznata kriptografija: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvrÅ¡iti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP GreÅ¡ka: Slanje sa navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP GreÅ¡ka: Slanje na navedene e-mail adrese nije uspjelo: '; +$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; +$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'DefiniÅ¡ite barem jednu adresu primaoca.'; +$PHPMAILER_LANG['signing'] = 'GreÅ¡ka prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP greÅ¡ka: '; +$PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: '; \ No newline at end of file diff --git a/plugins/PHPMailer/language/phpmailer.lang-be.php b/plugins/PHPMailer/language/phpmailer.lang-be.php new file mode 100644 index 0000000..e2f98f0 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-be.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Памылка SMTP: памылка ідÑнтыфікацыі.'; +$PHPMAILER_LANG['connect_host'] = 'Памылка SMTP: нельга ÑžÑтанавіць ÑувÑзь з SMTP-Ñерверам.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Памылка SMTP: звеÑткі непрынÑтыÑ.'; +$PHPMAILER_LANG['empty_message'] = 'ПуÑтое паведамленне.'; +$PHPMAILER_LANG['encoding'] = 'ÐевÑÐ´Ð¾Ð¼Ð°Ñ ÐºÐ°Ð´Ñ‹Ñ€Ð¾ÑžÐºÐ° Ñ‚ÑкÑту: '; +$PHPMAILER_LANG['execute'] = 'Ðельга выканаць каманду: '; +$PHPMAILER_LANG['file_access'] = 'ÐÑма доÑтупу да файла: '; +$PHPMAILER_LANG['file_open'] = 'Ðельга адкрыць файл: '; +$PHPMAILER_LANG['from_failed'] = 'ÐÑправільны Ð°Ð´Ñ€Ð°Ñ Ð°Ð´Ð¿Ñ€Ð°ÑžÐ½Ñ–ÐºÐ°: '; +$PHPMAILER_LANG['instantiate'] = 'Ðельга прымÑніць функцыю mail().'; +$PHPMAILER_LANG['invalid_address'] = 'Ðельга даÑлаць паведамленне, нÑправільны email атрымальніка: '; +$PHPMAILER_LANG['provide_address'] = 'Запоўніце, калі лаÑка, правільны email атрымальніка.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы Ñервер не падтрымліваецца.'; +$PHPMAILER_LANG['recipients_failed'] = 'Памылка SMTP: нÑÐ¿Ñ€Ð°Ð²Ñ–Ð»ÑŒÐ½Ñ‹Ñ Ð°Ñ‚Ñ€Ñ‹Ð¼Ð°Ð»ÑŒÐ½Ñ–ÐºÑ–: '; +$PHPMAILER_LANG['signing'] = 'Памылка подпіÑу паведамленнÑ: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Памылка ÑувÑзі з SMTP-Ñерверам.'; +$PHPMAILER_LANG['smtp_error'] = 'Памылка SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Ðельга ÑžÑтанавіць або перамÑніць значÑнне пераменнай: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-bg.php b/plugins/PHPMailer/language/phpmailer.lang-bg.php new file mode 100644 index 0000000..b22941f --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-bg.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: Ðе може да Ñе удоÑтовери пред Ñървъра.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: Ðе може да Ñе Ñвърже Ñ SMTP хоÑта.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: данните не Ñа приети.'; +$PHPMAILER_LANG['empty_message'] = 'Съдържанието на Ñъобщението е празно'; +$PHPMAILER_LANG['encoding'] = 'ÐеизвеÑтно кодиране: '; +$PHPMAILER_LANG['execute'] = 'Ðе може да Ñе изпълни: '; +$PHPMAILER_LANG['file_access'] = 'ÐÑма доÑтъп до файл: '; +$PHPMAILER_LANG['file_open'] = 'Файлова грешка: Ðе може да Ñе отвори файл: '; +$PHPMAILER_LANG['from_failed'] = 'Следните адреÑи за подател Ñа невалидни: '; +$PHPMAILER_LANG['instantiate'] = 'Ðе може да Ñе инÑтанцира функциÑта mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Ðевалиден адреÑ: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенÑки Ñървър не Ñе поддържа.'; +$PHPMAILER_LANG['provide_address'] = 'ТрÑбва да предоÑтавите поне един email Ð°Ð´Ñ€ÐµÑ Ð·Ð° получател.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Следните адреÑи за Получател Ñа невалидни: '; +$PHPMAILER_LANG['signing'] = 'Грешка при подпиÑване: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP провален connect().'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP Ñървърна грешка: '; +$PHPMAILER_LANG['variable_set'] = 'Ðе може да Ñе уÑтанови или възÑтанови променлива: '; +$PHPMAILER_LANG['extension_missing'] = 'ЛипÑва разширение: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-ca.php b/plugins/PHPMailer/language/phpmailer.lang-ca.php new file mode 100644 index 0000000..4117596 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-ca.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s’ha pogut autenticar.'; +$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.'; +$PHPMAILER_LANG['empty_message'] = 'El cos del missatge està buit.'; +$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: '; +$PHPMAILER_LANG['execute'] = 'No es pot executar: '; +$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l’arxiu: '; +$PHPMAILER_LANG['file_open'] = 'Error d’Arxiu: No es pot obrir l’arxiu: '; +$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: '; +$PHPMAILER_LANG['instantiate'] = 'No s’ha pogut crear una instància de la funció Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Adreça d’email invalida: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat'; +$PHPMAILER_LANG['provide_address'] = 'S’ha de proveir almenys una adreça d’email com a destinatari.'; +$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: '; +$PHPMAILER_LANG['signing'] = 'Error al signar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ha fallat el SMTP Connect().'; +$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'No s’ha pogut establir o restablir la variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-ch.php b/plugins/PHPMailer/language/phpmailer.lang-ch.php new file mode 100644 index 0000000..4fda6b8 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-ch.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验è¯å¤±è´¥ã€‚'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: ä¸èƒ½è¿žæŽ¥SMTP主机。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: æ•°æ®ä¸å¯æŽ¥å—。'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = '未知编ç ï¼š'; +$PHPMAILER_LANG['execute'] = 'ä¸èƒ½æ‰§è¡Œ: '; +$PHPMAILER_LANG['file_access'] = 'ä¸èƒ½è®¿é—®æ–‡ä»¶ï¼š'; +$PHPMAILER_LANG['file_open'] = '文件错误:ä¸èƒ½æ‰“开文件:'; +$PHPMAILER_LANG['from_failed'] = '下é¢çš„å‘é€åœ°å€é‚®ä»¶å‘é€å¤±è´¥äº†ï¼š '; +$PHPMAILER_LANG['instantiate'] = 'ä¸èƒ½å®žçްmail方法。'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的å‘é€é‚®ä»¶çš„æ–¹æ³•并䏿”¯æŒã€‚'; +$PHPMAILER_LANG['provide_address'] = '您必须æä¾›è‡³å°‘一个 收信人的email地å€ã€‚'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下é¢çš„ æ”¶ä»¶äººå¤±è´¥äº†ï¼š '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-cs.php b/plugins/PHPMailer/language/phpmailer.lang-cs.php new file mode 100644 index 0000000..1160cf0 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-cs.php @@ -0,0 +1,25 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge pÃ¥.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: '; +$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: '; +$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke Ã¥bne filen: '; +$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; +$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; +$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-de.php b/plugins/PHPMailer/language/phpmailer.lang-de.php new file mode 100644 index 0000000..aa987a9 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-de.php @@ -0,0 +1,25 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; +$PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; +$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.'; +$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; +$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; +$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; +$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: '; +$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; +$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; +$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.'; +$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; +$PHPMAILER_LANG['signing'] = 'Error al firmar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; +$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-et.php b/plugins/PHPMailer/language/phpmailer.lang-et.php new file mode 100644 index 0000000..7e06da1 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-et.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.'; +$PHPMAILER_LANG['empty_message'] = 'Tühi kirja sisu'; +$PHPMAILER_LANG["encoding"] = 'Tundmatu kodeering: '; +$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: '; +$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: '; +$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: '; +$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: '; +$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.'; +$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: '; +$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: '; +$PHPMAILER_LANG["signing"] = 'Viga allkirjastamisel: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() ebaõnnestus.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP serveri viga: '; +$PHPMAILER_LANG['variable_set'] = 'Ei õnnestunud määrata või lähtestada muutujat: '; +$PHPMAILER_LANG['extension_missing'] = 'Nõutud laiendus on puudu: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-fa.php b/plugins/PHPMailer/language/phpmailer.lang-fa.php new file mode 100644 index 0000000..8aa0ad2 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-fa.php @@ -0,0 +1,27 @@ + + * @author Mohammad Hossein Mojtahedi + */ + +$PHPMAILER_LANG['authenticate'] = 'خطای SMTP: احراز هویت با شکست مواجه شد.'; +$PHPMAILER_LANG['connect_host'] = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.'; +$PHPMAILER_LANG['data_not_accepted'] = 'خطای SMTP: داده‌ها نا‌درست هستند.'; +$PHPMAILER_LANG['empty_message'] = 'بخش متن پیام خالی است.'; +$PHPMAILER_LANG['encoding'] = 'کد‌گذاری نا‌شناخته: '; +$PHPMAILER_LANG['execute'] = 'امکان اجرا وجود ندارد: '; +$PHPMAILER_LANG['file_access'] = 'امکان دسترسی به ÙØ§ÛŒÙ„ وجود ندارد: '; +$PHPMAILER_LANG['file_open'] = 'خطای File: امکان بازکردن ÙØ§ÛŒÙ„ وجود ندارد: '; +$PHPMAILER_LANG['from_failed'] = 'آدرس ÙØ±Ø³ØªÙ†Ø¯Ù‡ اشتباه است: '; +$PHPMAILER_LANG['instantiate'] = 'امکان معرÙÛŒ تابع ایمیل وجود ندارد.'; +$PHPMAILER_LANG['invalid_address'] = 'آدرس ایمیل معتبر نیست: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمی‌شود.'; +$PHPMAILER_LANG['provide_address'] = 'باید حداقل یک آدرس گیرنده وارد کنید.'; +$PHPMAILER_LANG['recipients_failed'] = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: '; +$PHPMAILER_LANG['signing'] = 'خطا در امضا: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'خطا در اتصال به SMTP.'; +$PHPMAILER_LANG['smtp_error'] = 'خطا در SMTP Server: '; +$PHPMAILER_LANG['variable_set'] = 'امکان ارسال یا ارسال مجدد متغیر‌ها وجود ندارد: '; +$PHPMAILER_LANG['extension_missing'] = 'Ø§ÙØ²ÙˆÙ†Ù‡ موجود نیست: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-fi.php b/plugins/PHPMailer/language/phpmailer.lang-fi.php new file mode 100644 index 0000000..ec4e752 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-fi.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Ókend encoding: '; +$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: '; +$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: '; +$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: '; +$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: '; +$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.'; +$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-fr.php b/plugins/PHPMailer/language/phpmailer.lang-fr.php new file mode 100644 index 0000000..af68c92 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-fr.php @@ -0,0 +1,29 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Non puido ser autentificado.'; +$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Non puido conectar co servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Datos non aceptados.'; +$PHPMAILER_LANG['empty_message'] = 'Corpo da mensaxe vacía'; +$PHPMAILER_LANG['encoding'] = 'Codificación descoñecida: '; +$PHPMAILER_LANG['execute'] = 'Non puido ser executado: '; +$PHPMAILER_LANG['file_access'] = 'Nob puido acceder ó arquivo: '; +$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: No puido abrir o arquivo: '; +$PHPMAILER_LANG['from_failed'] = 'A(s) seguinte(s) dirección(s) de remitente(s) deron erro: '; +$PHPMAILER_LANG['instantiate'] = 'Non puido crear unha instancia da función Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Non puido envia-lo correo: dirección de email inválida: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer non está soportado.'; +$PHPMAILER_LANG['provide_address'] = 'Debe engadir polo menos unha dirección de email coma destino.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Os seguintes destinos fallaron: '; +$PHPMAILER_LANG['signing'] = 'Erro ó firmar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Non puidemos axustar ou reaxustar a variábel: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-he.php b/plugins/PHPMailer/language/phpmailer.lang-he.php new file mode 100644 index 0000000..70eb717 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-he.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'שגי×ת SMTP: פעולת ×”×ימות נכשלה.'; +$PHPMAILER_LANG['connect_host'] = 'שגי×ת SMTP: ×œ× ×”×¦×œ×—×ª×™ להתחבר לשרת SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'שגי×ת SMTP: מידע ×œ× ×”×ª×§×‘×œ.'; +$PHPMAILER_LANG['empty_message'] = 'גוף ההודעה ריק'; +$PHPMAILER_LANG['invalid_address'] = 'כתובת שגויה: '; +$PHPMAILER_LANG['encoding'] = 'קידוד ×œ× ×ž×•×›×¨: '; +$PHPMAILER_LANG['execute'] = '×œ× ×”×¦×œ×—×ª×™ להפעיל ×ת: '; +$PHPMAILER_LANG['file_access'] = '×œ× × ×™×ª×Ÿ לגשת לקובץ: '; +$PHPMAILER_LANG['file_open'] = 'שגי×ת קובץ: ×œ× × ×™×ª×Ÿ לגשת לקובץ: '; +$PHPMAILER_LANG['from_failed'] = 'כתובות ×”× ×ž×¢× ×™× ×”×‘×ות נכשלו: '; +$PHPMAILER_LANG['instantiate'] = '×œ× ×”×¦×œ×—×ª×™ להפעיל ×ת פונקציית המייל.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' ××™× ×” נתמכת.'; +$PHPMAILER_LANG['provide_address'] = 'חובה לספק לפחות כתובת ×חת של מקבל המייל.'; +$PHPMAILER_LANG['recipients_failed'] = 'שגי×ת SMTP: ×”× ×ž×¢× ×™× ×”×‘××™× × ×›×©×œ×•: '; +$PHPMAILER_LANG['signing'] = 'שגי×ת חתימה: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +$PHPMAILER_LANG['smtp_error'] = 'שגי×ת שרת SMTP: '; +$PHPMAILER_LANG['variable_set'] = '×œ× × ×™×ª×Ÿ לקבוע ×ו לשנות ×ת המשתנה: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-hi.php b/plugins/PHPMailer/language/phpmailer.lang-hi.php new file mode 100644 index 0000000..607a5ee --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-hi.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP तà¥à¤°à¥à¤Ÿà¤¿: पà¥à¤°à¤¾à¤®à¤¾à¤£à¤¿à¤•ता की जांच नहीं हो सका। '; +$PHPMAILER_LANG['connect_host'] = 'SMTP तà¥à¤°à¥à¤Ÿà¤¿: SMTP सरà¥à¤µà¤° से कनेकà¥à¤Ÿ नहीं हो सका। '; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP तà¥à¤°à¥à¤Ÿà¤¿: डेटा सà¥à¤µà¥€à¤•ार नहीं किया जाता है। '; +$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; +$PHPMAILER_LANG['encoding'] = 'अजà¥à¤žà¤¾à¤¤ à¤à¤¨à¥à¤•ोडिंग पà¥à¤°à¤•ार। '; +$PHPMAILER_LANG['execute'] = 'आदेश को निषà¥à¤ªà¤¾à¤¦à¤¿à¤¤ करने में विफल। '; +$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलबà¥à¤§ नहीं है। '; +$PHPMAILER_LANG['file_open'] = 'फ़ाइल तà¥à¤°à¥à¤Ÿà¤¿: फाइल को खोला नहीं जा सका। '; +$PHPMAILER_LANG['from_failed'] = 'पà¥à¤°à¥‡à¤·à¤• का पता गलत है। '; +$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंकà¥à¤¶à¤¨ कॉल नहीं कर सकता है।'; +$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; +$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सरà¥à¤µà¤° के साथ काम नहीं करता है। '; +$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम à¤à¤• पà¥à¤°à¤¾à¤ªà¥à¤¤à¤•रà¥à¤¤à¤¾ का ई-मेल पता पà¥à¤°à¤¦à¤¾à¤¨ करना होगा।'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP तà¥à¤°à¥à¤Ÿà¤¿: निमà¥à¤¨ पà¥à¤°à¤¾à¤ªà¥à¤¤à¤•रà¥à¤¤à¤¾à¤“ं को पते भेजने में विफल। '; +$PHPMAILER_LANG['signing'] = 'साइनअप तà¥à¤°à¥à¤Ÿà¤¿:। '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंकà¥à¤¶à¤¨ विफल हà¥à¤†à¥¤ '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP सरà¥à¤µà¤° तà¥à¤°à¥à¤Ÿà¤¿à¥¤ '; +$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; +$PHPMAILER_LANG['extension_missing'] = 'à¤à¤•à¥à¤¸à¤Ÿà¥‡à¤¨à¥à¤·à¤¨ गायब है: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-hr.php b/plugins/PHPMailer/language/phpmailer.lang-hr.php new file mode 100644 index 0000000..3822920 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-hr.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP GreÅ¡ka: Neuspjela autentikacija.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP GreÅ¡ka: Ne mogu se spojiti na SMTP poslužitelj.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP GreÅ¡ka: Podatci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznati encoding: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvrÅ¡iti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP GreÅ¡ka: Slanje s navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP GreÅ¡ka: Slanje na navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; +$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definirajte barem jednu adresu primatelja.'; +$PHPMAILER_LANG['signing'] = 'GreÅ¡ka prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP poslužitelj nije uspjelo.'; +$PHPMAILER_LANG['smtp_error'] = 'GreÅ¡ka SMTP poslužitelja: '; +$PHPMAILER_LANG['variable_set'] = 'Ne mogu postaviti varijablu niti ju vratiti nazad: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proÅ¡irenje: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-hu.php b/plugins/PHPMailer/language/phpmailer.lang-hu.php new file mode 100644 index 0000000..196cddc --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-hu.php @@ -0,0 +1,26 @@ + + * @author @januridp + */ + +$PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.'; +$PHPMAILER_LANG['connect_host'] = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.'; +$PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong'; +$PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: '; +$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses : '; +$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas : '; +$PHPMAILER_LANG['file_open'] = 'Kesalahan File: Berkas tidak dapat dibuka : '; +$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan : '; +$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel'; +$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak benar : '; +$PHPMAILER_LANG['provide_address'] = 'Harus disediakan minimal satu alamat tujuan'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung'; +$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menghasilkan kesalahan : '; +$PHPMAILER_LANG['signing'] = 'Kesalahan dalam tanda tangan : '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.'; +$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP : '; +$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variable : '; +$PHPMAILER_LANG['extension_missing'] = 'Ekstensi hilang: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-it.php b/plugins/PHPMailer/language/phpmailer.lang-it.php new file mode 100644 index 0000000..e67b6f7 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-it.php @@ -0,0 +1,27 @@ + + * @author Stefano Sabatini + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dati non accettati dal server.'; +$PHPMAILER_LANG['empty_message'] = 'Il corpo del messaggio è vuoto'; +$PHPMAILER_LANG['encoding'] = 'Codifica dei caratteri sconosciuta: '; +$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; +$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; +$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; +$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; +$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: '; +$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; +$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato un errore: '; +$PHPMAILER_LANG['signing'] = 'Errore nella firma: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallita.'; +$PHPMAILER_LANG['smtp_error'] = 'Errore del server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Impossibile impostare o resettare la variabile: '; +$PHPMAILER_LANG['extension_missing'] = 'Estensione mancante: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-ja.php b/plugins/PHPMailer/language/phpmailer.lang-ja.php new file mode 100644 index 0000000..2d77872 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-ja.php @@ -0,0 +1,27 @@ + + * @author Yoshi Sakai + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: èªè¨¼ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; +$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPãƒ›ã‚¹ãƒˆã«æŽ¥ç¶šã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データãŒå—ã‘付ã‘られã¾ã›ã‚“ã§ã—ãŸã€‚'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = '䏿˜Žãªã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°: '; +$PHPMAILER_LANG['execute'] = '実行ã§ãã¾ã›ã‚“ã§ã—ãŸ: '; +$PHPMAILER_LANG['file_access'] = 'ファイルã«ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã›ã‚“: '; +$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開ã‘ã¾ã›ã‚“: '; +$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録ã™ã‚‹éš›ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ: '; +$PHPMAILER_LANG['instantiate'] = 'ãƒ¡ãƒ¼ãƒ«é–¢æ•°ãŒæ­£å¸¸ã«å‹•作ã—ã¾ã›ã‚“ã§ã—ãŸã€‚'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['provide_address'] = 'å°‘ãªãã¨ã‚‚1ã¤ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’ 指定ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚'; +$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーãŒã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次ã®å—信者アドレス㫠間é•ã„ãŒã‚りã¾ã™: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-ka.php b/plugins/PHPMailer/language/phpmailer.lang-ka.php new file mode 100644 index 0000000..dd1af8a --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-ka.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდáƒáƒ›áƒ: áƒáƒ•ტáƒáƒ áƒ˜áƒ–áƒáƒªáƒ˜áƒ შეუძლებელიáƒ.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდáƒáƒ›áƒ: SMTP სერვერთáƒáƒœ დáƒáƒ™áƒáƒ•შირებრშეუძლებელიáƒ.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდáƒáƒ›áƒ: მáƒáƒœáƒáƒªáƒ”მები áƒáƒ  იქნრმიღებული.'; +$PHPMAILER_LANG['encoding'] = 'კáƒáƒ“ირების უცნáƒáƒ‘ი ტიპი: '; +$PHPMAILER_LANG['execute'] = 'შეუძლებელირშემდეგი ბრძáƒáƒœáƒ”ბის შესრულებáƒ: '; +$PHPMAILER_LANG['file_access'] = 'შეუძლებელირწვდáƒáƒ›áƒ ფáƒáƒ˜áƒšáƒ—áƒáƒœ: '; +$PHPMAILER_LANG['file_open'] = 'ფáƒáƒ˜áƒšáƒ£áƒ áƒ˜ სისტემის შეცდáƒáƒ›áƒ: áƒáƒ  იხსნებრფáƒáƒ˜áƒšáƒ˜: '; +$PHPMAILER_LANG['from_failed'] = 'გáƒáƒ›áƒ’ზáƒáƒ•ნის áƒáƒ áƒáƒ¡áƒ¬áƒáƒ áƒ˜ მისáƒáƒ›áƒáƒ áƒ—ი: '; +$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გáƒáƒ¨áƒ•ებრვერ ხერხდებáƒ.'; +$PHPMAILER_LANG['provide_address'] = 'გთხáƒáƒ•თ მიუთითáƒáƒ— ერთი áƒáƒ“რესáƒáƒ¢áƒ˜áƒ¡ e-mail მისáƒáƒ›áƒáƒ áƒ—ი მáƒáƒ˜áƒœáƒª.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - სáƒáƒ¤áƒáƒ¡áƒ¢áƒ სერვერის მხáƒáƒ áƒ“áƒáƒ­áƒ”რრáƒáƒ  áƒáƒ áƒ˜áƒ¡.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდáƒáƒ›áƒ: შემდეგ მისáƒáƒ›áƒáƒ áƒ—ებზე გáƒáƒ’ზáƒáƒ•ნრვერ მáƒáƒ®áƒ”რხდáƒ: '; +$PHPMAILER_LANG['empty_message'] = 'შეტყáƒáƒ‘ინებრცáƒáƒ áƒ˜áƒ”ლიáƒ'; +$PHPMAILER_LANG['invalid_address'] = 'áƒáƒ  გáƒáƒ˜áƒ’ზáƒáƒ•ნáƒ, e-mail მისáƒáƒ›áƒáƒ áƒ—ის áƒáƒ áƒáƒ¡áƒ¬áƒáƒ áƒ˜ ფáƒáƒ áƒ›áƒáƒ¢áƒ˜: '; +$PHPMAILER_LANG['signing'] = 'ხელმáƒáƒ¬áƒ”რის შეცდáƒáƒ›áƒ: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდáƒáƒ›áƒ SMTP სერვერთáƒáƒœ დáƒáƒ™áƒáƒ•შირებისáƒáƒ¡'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდáƒáƒ›áƒ: '; +$PHPMAILER_LANG['variable_set'] = 'შეუძლებელირშემდეგი ცვლáƒáƒ“ის შექმნრáƒáƒœ შეცვლáƒ: '; +$PHPMAILER_LANG['extension_missing'] = 'ბიბლიáƒáƒ—ეკრáƒáƒ  áƒáƒ áƒ¡áƒ”ბáƒáƒ‘ს: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-ko.php b/plugins/PHPMailer/language/phpmailer.lang-ko.php new file mode 100644 index 0000000..9599fa6 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-ko.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 오류: ì¸ì¦í•  수 없습니다.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 오류: SMTP í˜¸ìŠ¤íŠ¸ì— ì ‘ì†í•  수 없습니다.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 오류: ë°ì´í„°ê°€ 받아들여지지 않았습니다.'; +$PHPMAILER_LANG['empty_message'] = '메세지 ë‚´ìš©ì´ ì—†ìŠµë‹ˆë‹¤'; +$PHPMAILER_LANG['encoding'] = '알 수 없는 ì¸ì½”딩: '; +$PHPMAILER_LANG['execute'] = '실행 불가: '; +$PHPMAILER_LANG['file_access'] = 'íŒŒì¼ ì ‘ê·¼ 불가: '; +$PHPMAILER_LANG['file_open'] = 'íŒŒì¼ ì˜¤ë¥˜: 파ì¼ì„ ì—´ 수 없습니다: '; +$PHPMAILER_LANG['from_failed'] = 'ë‹¤ìŒ From 주소ì—서 오류가 ë°œìƒí–ˆìŠµë‹ˆë‹¤: '; +$PHPMAILER_LANG['instantiate'] = 'mail 함수를 ì¸ìŠ¤í„´ìŠ¤í™”í•  수 없습니다'; +$PHPMAILER_LANG['invalid_address'] = 'ìž˜ëª»ëœ ì£¼ì†Œ: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' ë©”ì¼ëŸ¬ëŠ” ì§€ì›ë˜ì§€ 않습니다.'; +$PHPMAILER_LANG['provide_address'] = 'ì ì–´ë„ 한 ê°œ ì´ìƒì˜ ìˆ˜ì‹ ìž ë©”ì¼ ì£¼ì†Œë¥¼ 제공해야 합니다.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 오류: ë‹¤ìŒ ìˆ˜ì‹ ìžì—서 오류가 ë°œìƒí–ˆìŠµë‹ˆë‹¤: '; +$PHPMAILER_LANG['signing'] = '서명 오류: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP ì—°ê²°ì„ ì‹¤íŒ¨í•˜ì˜€ìŠµë‹ˆë‹¤.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP 서버 오류: '; +$PHPMAILER_LANG['variable_set'] = '변수 설정 ë° ì´ˆê¸°í™” 불가: '; +$PHPMAILER_LANG['extension_missing'] = 'í™•ìž¥ìž ì—†ìŒ: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-lt.php b/plugins/PHPMailer/language/phpmailer.lang-lt.php new file mode 100644 index 0000000..1253a4f --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-lt.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP klaida: autentifikacija nepavyko.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP klaida: nepavyksta prisijungti prie SMTP stoties.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP klaida: duomenys nepriimti.'; +$PHPMAILER_LANG['empty_message'] = 'LaiÅ¡ko turinys tuÅ¡Äias'; +$PHPMAILER_LANG['encoding'] = 'Neatpažinta koduotÄ—: '; +$PHPMAILER_LANG['execute'] = 'Nepavyko įvykdyti komandos: '; +$PHPMAILER_LANG['file_access'] = 'Byla nepasiekiama: '; +$PHPMAILER_LANG['file_open'] = 'Bylos klaida: Nepavyksta atidaryti: '; +$PHPMAILER_LANG['from_failed'] = 'Neteisingas siuntÄ—jo adresas: '; +$PHPMAILER_LANG['instantiate'] = 'Nepavyko paleisti mail funkcijos.'; +$PHPMAILER_LANG['invalid_address'] = 'Neteisingas adresas: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' paÅ¡to stotis nepalaikoma.'; +$PHPMAILER_LANG['provide_address'] = 'Nurodykite bent vienÄ… gavÄ—jo adresÄ….'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP klaida: nepavyko iÅ¡siųsti Å¡iems gavÄ—jams: '; +$PHPMAILER_LANG['signing'] = 'Prisijungimo klaida: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP susijungimo klaida'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP stoties klaida: '; +$PHPMAILER_LANG['variable_set'] = 'Nepavyko priskirti reikÅ¡mÄ—s kintamajam: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-lv.php b/plugins/PHPMailer/language/phpmailer.lang-lv.php new file mode 100644 index 0000000..39bf9a1 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-lv.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP kļūda: AutorizÄcija neizdevÄs.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Kļūda: Nepieņem informÄciju.'; +$PHPMAILER_LANG['empty_message'] = 'Ziņojuma teksts ir tukÅ¡s'; +$PHPMAILER_LANG['encoding'] = 'NeatpazÄ«ts kodÄ“jums: '; +$PHPMAILER_LANG['execute'] = 'NeizdevÄs izpildÄ«t komandu: '; +$PHPMAILER_LANG['file_access'] = 'Fails nav pieejams: '; +$PHPMAILER_LANG['file_open'] = 'Faila kļūda: Nevar atvÄ“rt failu: '; +$PHPMAILER_LANG['from_failed'] = 'Nepareiza sÅ«tÄ«tÄja adrese: '; +$PHPMAILER_LANG['instantiate'] = 'Nevar palaist sÅ«tīšanas funkciju.'; +$PHPMAILER_LANG['invalid_address'] = 'Nepareiza adrese: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' sÅ«tÄ«tÄjs netiek atbalstÄ«ts.'; +$PHPMAILER_LANG['provide_address'] = 'LÅ«dzu, norÄdiet vismaz vienu adresÄtu.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP kļūda: neizdevÄs nosÅ«tÄ«t Å¡Ädiem saņēmÄ“jiem: '; +$PHPMAILER_LANG['signing'] = 'AutorizÄcijas kļūda: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP savienojuma kļūda'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP servera kļūda: '; +$PHPMAILER_LANG['variable_set'] = 'Nevar piešķirt mainÄ«gÄ vÄ“rtÄ«bu: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-mg.php b/plugins/PHPMailer/language/phpmailer.lang-mg.php new file mode 100644 index 0000000..f4c7563 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-mg.php @@ -0,0 +1,25 @@ + + */ +$PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.'; +$PHPMAILER_LANG['empty_message'] = 'Tsy misy ny votoaty mailaka.'; +$PHPMAILER_LANG['encoding'] = 'Tsy fantatra encoding: '; +$PHPMAILER_LANG['execute'] = 'Tsy afaka manatanteraka ity baiko manaraka ity: '; +$PHPMAILER_LANG['file_access'] = 'Tsy nahomby ny fidirana amin\'ity rakitra ity: '; +$PHPMAILER_LANG['file_open'] = 'Hadisoana diso: Tsy afaka nanokatra ity file manaraka ity: '; +$PHPMAILER_LANG['from_failed'] = 'Ny adiresy iraka manaraka dia diso: '; +$PHPMAILER_LANG['instantiate'] = 'Tsy afaka nanomboka ny hetsika mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Tsy mety ny adiresy: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tsy manohana.'; +$PHPMAILER_LANG['provide_address'] = 'Alefaso azafady iray adiresy iray farafahakeliny.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Tsy mety ireo mpanaraka ireto: '; +$PHPMAILER_LANG['signing'] = 'Error nandritra ny sonia:'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Tsy nahomby ny fifandraisana tamin\'ny server SMTP.'; +$PHPMAILER_LANG['smtp_error'] = 'Fahadisoana tamin\'ny server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tsy azo atao ny mametraka na mamerina ny variable: '; +$PHPMAILER_LANG['extension_missing'] = 'Tsy hita ny ampahany: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-ms.php b/plugins/PHPMailer/language/phpmailer.lang-ms.php new file mode 100644 index 0000000..f12a6ad --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-ms.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Ralat SMTP: Tidak dapat pengesahan.'; +$PHPMAILER_LANG['connect_host'] = 'Ralat SMTP: Tidak dapat menghubungi hos pelayan SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ralat SMTP: Data tidak diterima oleh pelayan.'; +$PHPMAILER_LANG['empty_message'] = 'Tiada isi untuk mesej'; +$PHPMAILER_LANG['encoding'] = 'Pengekodan tidak diketahui: '; +$PHPMAILER_LANG['execute'] = 'Tidak dapat melaksanakan: '; +$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses fail: '; +$PHPMAILER_LANG['file_open'] = 'Ralat Fail: Tidak dapat membuka fail: '; +$PHPMAILER_LANG['from_failed'] = 'Berikut merupakan ralat dari alamat e-mel: '; +$PHPMAILER_LANG['instantiate'] = 'Tidak dapat memberi contoh fungsi e-mel.'; +$PHPMAILER_LANG['invalid_address'] = 'Alamat emel tidak sah: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' jenis penghantar emel tidak disokong.'; +$PHPMAILER_LANG['provide_address'] = 'Anda perlu menyediakan sekurang-kurangnya satu alamat e-mel penerima.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ralat SMTP: Penerima e-mel berikut telah gagal: '; +$PHPMAILER_LANG['signing'] = 'Ralat pada tanda tangan: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() telah gagal.'; +$PHPMAILER_LANG['smtp_error'] = 'Ralat pada pelayan SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tidak boleh menetapkan atau menetapkan semula pembolehubah: '; +$PHPMAILER_LANG['extension_missing'] = 'Sambungan hilang: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-nb.php b/plugins/PHPMailer/language/phpmailer.lang-nb.php new file mode 100644 index 0000000..97403e7 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-nb.php @@ -0,0 +1,25 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.'; +$PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg'; +$PHPMAILER_LANG['encoding'] = 'Onbekende codering: '; +$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: '; +$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: '; +$PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: '; +$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; +$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; +$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; +$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; +$PHPMAILER_LANG['signing'] = 'Signeerfout: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; +$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-pl.php b/plugins/PHPMailer/language/phpmailer.lang-pl.php new file mode 100644 index 0000000..3da0dee --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-pl.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.'; +$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.'; +$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.'; +$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; +$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; +$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: '; +$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: '; +$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: '; +$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: '; +$PHPMAILER_LANG['signing'] = 'Erro ao assinar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-pt_br.php b/plugins/PHPMailer/language/phpmailer.lang-pt_br.php new file mode 100644 index 0000000..62d692d --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-pt_br.php @@ -0,0 +1,29 @@ + + * @author Lucas Guimarães + * @author Phelipe Alves + * @author Fabio Beneditto + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; +$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.'; +$PHPMAILER_LANG['empty_message'] = 'Mensagem vazia'; +$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; +$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; +$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: '; +$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: '; +$PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: '; +$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: '; +$PHPMAILER_LANG['signing'] = 'Erro de Assinatura: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-ro.php b/plugins/PHPMailer/language/phpmailer.lang-ro.php new file mode 100644 index 0000000..fa100ea --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-ro.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eÈ™uat.'; +$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eÈ™uat.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.'; +$PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.'; +$PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: '; +$PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: '; +$PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fiÈ™ier: '; +$PHPMAILER_LANG['file_open'] = 'Eroare fiÈ™ier: Nu se poate deschide următorul fiÈ™ier: '; +$PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: '; +$PHPMAILER_LANG['instantiate'] = 'FuncÈ›ia mail nu a putut fi iniÈ›ializată.'; +$PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; +$PHPMAILER_LANG['provide_address'] = 'Trebuie să adăugaÈ›i cel puÈ›in o adresă de email.'; +$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eÈ™uat: '; +$PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eÈ™uat.'; +$PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. '; +$PHPMAILER_LANG['extension_missing'] = 'LipseÈ™te extensia: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-ru.php b/plugins/PHPMailer/language/phpmailer.lang-ru.php new file mode 100644 index 0000000..720e9a1 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-ru.php @@ -0,0 +1,27 @@ + + * @author Foster Snowhill + */ + +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; +$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удаетÑÑ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡Ð¸Ñ‚ÑŒÑÑ Ðº SMTP-Ñерверу.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не принÑты.'; +$PHPMAILER_LANG['encoding'] = 'ÐеизвеÑÑ‚Ð½Ð°Ñ ÐºÐ¾Ð´Ð¸Ñ€Ð¾Ð²ÐºÐ°: '; +$PHPMAILER_LANG['execute'] = 'Ðевозможно выполнить команду: '; +$PHPMAILER_LANG['file_access'] = 'Ðет доÑтупа к файлу: '; +$PHPMAILER_LANG['file_open'] = 'Ð¤Ð°Ð¹Ð»Ð¾Ð²Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°: не удаётÑÑ Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚ÑŒ файл: '; +$PHPMAILER_LANG['from_failed'] = 'Ðеверный Ð°Ð´Ñ€ÐµÑ Ð¾Ñ‚Ð¿Ñ€Ð°Ð²Ð¸Ñ‚ÐµÐ»Ñ: '; +$PHPMAILER_LANG['instantiate'] = 'Ðевозможно запуÑтить функцию mail().'; +$PHPMAILER_LANG['provide_address'] = 'ПожалуйÑта, введите Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ один email-Ð°Ð´Ñ€ÐµÑ Ð¿Ð¾Ð»ÑƒÑ‡Ð°Ñ‚ÐµÐ»Ñ.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый Ñервер не поддерживаетÑÑ.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалаÑÑŒ отправка таким адреÑатам: '; +$PHPMAILER_LANG['empty_message'] = 'ПуÑтое Ñообщение'; +$PHPMAILER_LANG['invalid_address'] = 'Ðе отправлено из-за неправильного формата email-адреÑа: '; +$PHPMAILER_LANG['signing'] = 'Ошибка подпиÑи: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ SMTP-Ñервером'; +$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-Ñервера: '; +$PHPMAILER_LANG['variable_set'] = 'Ðевозможно уÑтановить или ÑброÑить переменную: '; +$PHPMAILER_LANG['extension_missing'] = 'РаÑширение отÑутÑтвует: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-sk.php b/plugins/PHPMailer/language/phpmailer.lang-sk.php new file mode 100644 index 0000000..69cfb0f --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-sk.php @@ -0,0 +1,27 @@ + + * @author Peter Orlický + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nebolo možné nadviazaÅ¥ spojenie so SMTP serverom.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dáta neboli prijaté'; +$PHPMAILER_LANG['empty_message'] = 'Prázdne telo správy.'; +$PHPMAILER_LANG['encoding'] = 'Neznáme kódovanie: '; +$PHPMAILER_LANG['execute'] = 'Nedá sa vykonaÅ¥: '; +$PHPMAILER_LANG['file_access'] = 'Súbor nebol nájdený: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriÅ¥ pre Äítanie: '; +$PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: '; +$PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriÅ¥ inÅ¡tancia emailovej funkcie.'; +$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.'; +$PHPMAILER_LANG['provide_address'] = 'Musíte zadaÅ¥ aspoň jednu emailovú adresu príjemcu.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; +$PHPMAILER_LANG['signing'] = 'Chyba prihlasovania: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zlyhalo.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP chyba serveru: '; +$PHPMAILER_LANG['variable_set'] = 'Nemožno nastaviÅ¥ alebo resetovaÅ¥ premennú: '; +$PHPMAILER_LANG['extension_missing'] = 'Chýba rozšírenie: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-sl.php b/plugins/PHPMailer/language/phpmailer.lang-sl.php new file mode 100644 index 0000000..1e3cb7f --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-sl.php @@ -0,0 +1,27 @@ + + * @author Filip Å  + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavraÄa podatke.'; +$PHPMAILER_LANG['empty_message'] = 'E-poÅ¡tno sporoÄilo nima vsebine.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: '; +$PHPMAILER_LANG['execute'] = 'Operacija ni uspela: '; +$PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: '; +$PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: '; +$PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov poÅ¡iljatelja: '; +$PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; +$PHPMAILER_LANG['invalid_address'] = 'E-poÅ¡tno sporoÄilo ni bilo poslano. E-naslov je neveljaven: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; +$PHPMAILER_LANG['provide_address'] = 'Prosim vnesite vsaj enega naslovnika.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: SledeÄi naslovniki so neveljavni: '; +$PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; +$PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: '; +$PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: '; +$PHPMAILER_LANG['extension_missing'] = 'ManjkajoÄa razÅ¡iritev: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-sr.php b/plugins/PHPMailer/language/phpmailer.lang-sr.php new file mode 100644 index 0000000..34c1e18 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-sr.php @@ -0,0 +1,27 @@ + + * @author MiloÅ¡ Milanović + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: аутентификација није уÑпела.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: повезивање Ñа SMTP Ñервером није уÑпело.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: подаци ниÑу прихваћени.'; +$PHPMAILER_LANG['empty_message'] = 'Садржај поруке је празан.'; +$PHPMAILER_LANG['encoding'] = 'Ðепознато кодирање: '; +$PHPMAILER_LANG['execute'] = 'Ðије могуће извршити наредбу: '; +$PHPMAILER_LANG['file_access'] = 'Ðије могуће приÑтупити датотеци: '; +$PHPMAILER_LANG['file_open'] = 'Ðије могуће отворити датотеку: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP грешка: Ñлање Ñа Ñледећих адреÑа није уÑпело: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Ñлање на Ñледеће адреÑе није уÑпело: '; +$PHPMAILER_LANG['instantiate'] = 'Ðије могуће покренути mail функцију.'; +$PHPMAILER_LANG['invalid_address'] = 'Порука није поÑлата. ÐеиÑправна адреÑа: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.'; +$PHPMAILER_LANG['provide_address'] = 'Дефинишите бар једну адреÑу примаоца.'; +$PHPMAILER_LANG['signing'] = 'Грешка приликом пријаве: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Повезивање Ñа SMTP Ñервером није уÑпело.'; +$PHPMAILER_LANG['smtp_error'] = 'Грешка SMTP Ñервера: '; +$PHPMAILER_LANG['variable_set'] = 'Ðије могуће задати нити реÑетовати променљиву: '; +$PHPMAILER_LANG['extension_missing'] = 'ÐедоÑтаје проширење: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-sv.php b/plugins/PHPMailer/language/phpmailer.lang-sv.php new file mode 100644 index 0000000..4408e63 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-sv.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; +$PHPMAILER_LANG['file_access'] = 'Ingen Ã¥tkomst till fil: '; +$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; +$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; +$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; +$PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: '; +$PHPMAILER_LANG['provide_address'] = 'Du mÃ¥ste ange minst en mottagares e-postadress.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; +$PHPMAILER_LANG['signing'] = 'Signerings fel: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server fel: '; +$PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller Ã¥terställa variabel: '; +$PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-tl.php b/plugins/PHPMailer/language/phpmailer.lang-tl.php new file mode 100644 index 0000000..ed51d4c --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-tl.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi maaaring matatanggap.'; +$PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe'; +$PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: '; +$PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: '; +$PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: '; +$PHPMAILER_LANG['file_open'] = 'Hindi mabuksan ang file: '; +$PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: '; +$PHPMAILER_LANG['instantiate'] = 'Hindi maaaring magbigay ng institusyon ang mail'; +$PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: '; +$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado'; +$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: '; +$PHPMAILER_LANG['signing'] = 'Hindi ma-sign'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo'; +$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo'; +$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda ang mga variables: '; +$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension'; diff --git a/plugins/PHPMailer/language/phpmailer.lang-tr.php b/plugins/PHPMailer/language/phpmailer.lang-tr.php new file mode 100644 index 0000000..cfe8eaa --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-tr.php @@ -0,0 +1,30 @@ + + * @fixed by Boris Yurchenko + */ + +$PHPMAILER_LANG['authenticate'] = 'Помилка SMTP: помилка авторизації.'; +$PHPMAILER_LANG['connect_host'] = 'Помилка SMTP: не вдаєтьÑÑ Ð¿Ñ–Ð´\'єднатиÑÑ Ð´Ð¾ SMTP-Ñерверу.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Помилка SMTP: дані не прийнÑто.'; +$PHPMAILER_LANG['encoding'] = 'Ðевідоме кодуваннÑ: '; +$PHPMAILER_LANG['execute'] = 'Ðеможливо виконати команду: '; +$PHPMAILER_LANG['file_access'] = 'Ðемає доÑтупу до файлу: '; +$PHPMAILER_LANG['file_open'] = 'Помилка файлової ÑиÑтеми: не вдаєтьÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл: '; +$PHPMAILER_LANG['from_failed'] = 'Ðевірна адреÑа відправника: '; +$PHPMAILER_LANG['instantiate'] = 'Ðеможливо запуÑтити функцію mail().'; +$PHPMAILER_LANG['provide_address'] = 'Будь-лаÑка, введіть хоча б одну email-адреÑу отримувача.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий Ñервер не підтримуєтьÑÑ.'; +$PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалоÑÑ Ð²Ñ–Ð´Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ñ‚Ð°ÐºÐ¸Ñ… отримувачів: '; +$PHPMAILER_LANG['empty_message'] = 'ПуÑте повідомленнÑ'; +$PHPMAILER_LANG['invalid_address'] = 'Ðе відправлено через невірний формат email-адреÑи: '; +$PHPMAILER_LANG['signing'] = 'Помилка підпиÑу: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· SMTP-Ñервером'; +$PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-Ñервера: '; +$PHPMAILER_LANG['variable_set'] = 'Ðеможливо вÑтановити або Ñкинути змінну: '; +$PHPMAILER_LANG['extension_missing'] = 'Ð Ð¾Ð·ÑˆÐ¸Ñ€ÐµÐ½Ð½Ñ Ð²Ñ–Ð´Ñутнє: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-vi.php b/plugins/PHPMailer/language/phpmailer.lang-vi.php new file mode 100644 index 0000000..c60dade --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-vi.php @@ -0,0 +1,26 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'Lá»—i SMTP: Không thể xác thá»±c.'; +$PHPMAILER_LANG['connect_host'] = 'Lá»—i SMTP: Không thể kết nối máy chá»§ SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Lá»—i SMTP: Dữ liệu không được chấp nhận.'; +$PHPMAILER_LANG['empty_message'] = 'Không có ná»™i dung'; +$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: '; +$PHPMAILER_LANG['execute'] = 'Không thá»±c hiện được: '; +$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin '; +$PHPMAILER_LANG['file_open'] = 'Lá»—i Tập tin: Không thể mở tệp tin: '; +$PHPMAILER_LANG['from_failed'] = 'Lá»—i địa chỉ gá»­i Ä‘i: '; +$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gá»­i thư.'; +$PHPMAILER_LANG['invalid_address'] = 'Äại chỉ emai không đúng: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' trình gá»­i thư không được há»— trợ.'; +$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất má»™t địa chỉ ngưá»i nhận.'; +$PHPMAILER_LANG['recipients_failed'] = 'Lá»—i SMTP: lá»—i địa chỉ ngưá»i nhận: '; +$PHPMAILER_LANG['signing'] = 'Lá»—i đăng nhập: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Lá»—i kết nối vá»›i SMTP'; +$PHPMAILER_LANG['smtp_error'] = 'Lá»—i máy chá»§ smtp '; +$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-zh.php b/plugins/PHPMailer/language/phpmailer.lang-zh.php new file mode 100644 index 0000000..3e9e358 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-zh.php @@ -0,0 +1,28 @@ + + * @author Peter Dave Hello <@PeterDaveHello/> + * @author Jason Chiang + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接å—的資料。'; +$PHPMAILER_LANG['empty_message'] = '郵件內容為空'; +$PHPMAILER_LANG['encoding'] = '未知編碼: '; +$PHPMAILER_LANG['execute'] = '無法執行:'; +$PHPMAILER_LANG['file_access'] = 'ç„¡æ³•å­˜å–æª”案:'; +$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:'; +$PHPMAILER_LANG['from_failed'] = '發é€åœ°å€éŒ¯èª¤ï¼š'; +$PHPMAILER_LANG['instantiate'] = '未知函數呼å«ã€‚'; +$PHPMAILER_LANG['invalid_address'] = '因為電å­éƒµä»¶åœ°å€ç„¡æ•ˆï¼Œç„¡æ³•傳é€: '; +$PHPMAILER_LANG['mailer_not_supported'] = '䏿”¯æ´çš„發信客戶端。'; +$PHPMAILER_LANG['provide_address'] = 'å¿…é ˆæä¾›è‡³å°‘一個收件人地å€ã€‚'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:以下收件人地å€éŒ¯èª¤ï¼š'; +$PHPMAILER_LANG['signing'] = 'é›»å­ç°½ç« éŒ¯èª¤: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 連線失敗'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP 伺æœå™¨éŒ¯èª¤: '; +$PHPMAILER_LANG['variable_set'] = '無法設定或é‡è¨­è®Šæ•¸: '; +$PHPMAILER_LANG['extension_missing'] = 'éºå¤±æ¨¡çµ„ Extension: '; diff --git a/plugins/PHPMailer/language/phpmailer.lang-zh_cn.php b/plugins/PHPMailer/language/phpmailer.lang-zh_cn.php new file mode 100644 index 0000000..3753780 --- /dev/null +++ b/plugins/PHPMailer/language/phpmailer.lang-zh_cn.php @@ -0,0 +1,28 @@ + + * @author young + * @author Teddysun + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数æ®ä¸è¢«æŽ¥å—。'; +$PHPMAILER_LANG['empty_message'] = '邮件正文为空。'; +$PHPMAILER_LANG['encoding'] = '未知编ç ï¼š'; +$PHPMAILER_LANG['execute'] = '无法执行:'; +$PHPMAILER_LANG['file_access'] = '无法访问文件:'; +$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; +$PHPMAILER_LANG['from_failed'] = 'å‘é€åœ°å€é”™è¯¯ï¼š'; +$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; +$PHPMAILER_LANG['invalid_address'] = 'å‘é€å¤±è´¥ï¼Œç”µå­é‚®ç®±åœ°å€æ˜¯æ— æ•ˆçš„:'; +$PHPMAILER_LANG['mailer_not_supported'] = 'å‘信客户端ä¸è¢«æ”¯æŒã€‚'; +$PHPMAILER_LANG['provide_address'] = 'å¿…é¡»æä¾›è‡³å°‘一个收件人地å€ã€‚'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地å€é”™è¯¯ï¼š'; +$PHPMAILER_LANG['signing'] = '登录失败:'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTPæœåŠ¡å™¨è¿žæŽ¥å¤±è´¥ã€‚'; +$PHPMAILER_LANG['smtp_error'] = 'SMTPæœåŠ¡å™¨å‡ºé”™ï¼š'; +$PHPMAILER_LANG['variable_set'] = '无法设置或é‡ç½®å˜é‡ï¼š'; +$PHPMAILER_LANG['extension_missing'] = 'ä¸¢å¤±æ¨¡å— Extension:'; diff --git a/plugins/PHPMailer/src/Exception.php b/plugins/PHPMailer/src/Exception.php new file mode 100644 index 0000000..b1e552f --- /dev/null +++ b/plugins/PHPMailer/src/Exception.php @@ -0,0 +1,39 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2017 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer exception handler. + * + * @author Marcus Bointon + */ +class Exception extends \Exception +{ + /** + * Prettify error message output. + * + * @return string + */ + public function errorMessage() + { + return '' . htmlspecialchars($this->getMessage()) . "
    \n"; + } +} diff --git a/plugins/PHPMailer/src/OAuth.php b/plugins/PHPMailer/src/OAuth.php new file mode 100644 index 0000000..0271963 --- /dev/null +++ b/plugins/PHPMailer/src/OAuth.php @@ -0,0 +1,138 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2015 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +use League\OAuth2\Client\Grant\RefreshToken; +use League\OAuth2\Client\Provider\AbstractProvider; +use League\OAuth2\Client\Token\AccessToken; + +/** + * OAuth - OAuth2 authentication wrapper class. + * Uses the oauth2-client package from the League of Extraordinary Packages. + * + * @see http://oauth2-client.thephpleague.com + * + * @author Marcus Bointon (Synchro/coolbru) + */ +class OAuth +{ + /** + * An instance of the League OAuth Client Provider. + * + * @var AbstractProvider + */ + protected $provider; + + /** + * The current OAuth access token. + * + * @var AccessToken + */ + protected $oauthToken; + + /** + * The user's email address, usually used as the login ID + * and also the from address when sending email. + * + * @var string + */ + protected $oauthUserEmail = ''; + + /** + * The client secret, generated in the app definition of the service you're connecting to. + * + * @var string + */ + protected $oauthClientSecret = ''; + + /** + * The client ID, generated in the app definition of the service you're connecting to. + * + * @var string + */ + protected $oauthClientId = ''; + + /** + * The refresh token, used to obtain new AccessTokens. + * + * @var string + */ + protected $oauthRefreshToken = ''; + + /** + * OAuth constructor. + * + * @param array $options Associative array containing + * `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements + */ + public function __construct($options) + { + $this->provider = $options['provider']; + $this->oauthUserEmail = $options['userName']; + $this->oauthClientSecret = $options['clientSecret']; + $this->oauthClientId = $options['clientId']; + $this->oauthRefreshToken = $options['refreshToken']; + } + + /** + * Get a new RefreshToken. + * + * @return RefreshToken + */ + protected function getGrant() + { + return new RefreshToken(); + } + + /** + * Get a new AccessToken. + * + * @return AccessToken + */ + protected function getToken() + { + return $this->provider->getAccessToken( + $this->getGrant(), + ['refresh_token' => $this->oauthRefreshToken] + ); + } + + /** + * Generate a base64-encoded OAuth token. + * + * @return string + */ + public function getOauth64() + { + // Get a new token if it's not available or has expired + if (null === $this->oauthToken || $this->oauthToken->hasExpired()) { + $this->oauthToken = $this->getToken(); + } + + return base64_encode( + 'user=' . + $this->oauthUserEmail . + "\001auth=Bearer " . + $this->oauthToken . + "\001\001" + ); + } +} diff --git a/plugins/PHPMailer/src/PHPMailer.php b/plugins/PHPMailer/src/PHPMailer.php new file mode 100644 index 0000000..127f2b7 --- /dev/null +++ b/plugins/PHPMailer/src/PHPMailer.php @@ -0,0 +1,4778 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2019 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer - PHP email creation and transport class. + * + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + */ +class PHPMailer +{ + const CHARSET_ASCII = 'us-ascii'; + const CHARSET_ISO88591 = 'iso-8859-1'; + const CHARSET_UTF8 = 'utf-8'; + + const CONTENT_TYPE_PLAINTEXT = 'text/plain'; + const CONTENT_TYPE_TEXT_CALENDAR = 'text/calendar'; + const CONTENT_TYPE_TEXT_HTML = 'text/html'; + const CONTENT_TYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative'; + const CONTENT_TYPE_MULTIPART_MIXED = 'multipart/mixed'; + const CONTENT_TYPE_MULTIPART_RELATED = 'multipart/related'; + + const ENCODING_7BIT = '7bit'; + const ENCODING_8BIT = '8bit'; + const ENCODING_BASE64 = 'base64'; + const ENCODING_BINARY = 'binary'; + const ENCODING_QUOTED_PRINTABLE = 'quoted-printable'; + + const ENCRYPTION_STARTTLS = 'tls'; + const ENCRYPTION_SMTPS = 'ssl'; + + const ICAL_METHOD_REQUEST = 'REQUEST'; + const ICAL_METHOD_PUBLISH = 'PUBLISH'; + const ICAL_METHOD_REPLY = 'REPLY'; + const ICAL_METHOD_ADD = 'ADD'; + const ICAL_METHOD_CANCEL = 'CANCEL'; + const ICAL_METHOD_REFRESH = 'REFRESH'; + const ICAL_METHOD_COUNTER = 'COUNTER'; + const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER'; + + /** + * Email priority. + * Options: null (default), 1 = High, 3 = Normal, 5 = low. + * When null, the header is not set at all. + * + * @var int + */ + public $Priority; + + /** + * The character set of the message. + * + * @var string + */ + public $CharSet = self::CHARSET_ISO88591; + + /** + * The MIME Content-type of the message. + * + * @var string + */ + public $ContentType = self::CONTENT_TYPE_PLAINTEXT; + + /** + * The message encoding. + * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". + * + * @var string + */ + public $Encoding = self::ENCODING_8BIT; + + /** + * Holds the most recent mailer error message. + * + * @var string + */ + public $ErrorInfo = ''; + + /** + * The From email address for the message. + * + * @var string + */ + public $From = 'root@localhost'; + + /** + * The From name of the message. + * + * @var string + */ + public $FromName = 'Root User'; + + /** + * The envelope sender of the message. + * This will usually be turned into a Return-Path header by the receiver, + * and is the address that bounces will be sent to. + * If not empty, will be passed via `-f` to sendmail or as the 'MAIL FROM' value over SMTP. + * + * @var string + */ + public $Sender = ''; + + /** + * The Subject of the message. + * + * @var string + */ + public $Subject = ''; + + /** + * An HTML or plain text message body. + * If HTML then call isHTML(true). + * + * @var string + */ + public $Body = ''; + + /** + * The plain-text message body. + * This body can be read by mail clients that do not have HTML email + * capability such as mutt & Eudora. + * Clients that can read HTML will view the normal Body. + * + * @var string + */ + public $AltBody = ''; + + /** + * An iCal message part body. + * Only supported in simple alt or alt_inline message types + * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator. + * + * @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ + * @see http://kigkonsult.se/iCalcreator/ + * + * @var string + */ + public $Ical = ''; + + /** + * Value-array of "method" in Contenttype header "text/calendar" + * + * @var string[] + */ + protected static $IcalMethods = [ + self::ICAL_METHOD_REQUEST, + self::ICAL_METHOD_PUBLISH, + self::ICAL_METHOD_REPLY, + self::ICAL_METHOD_ADD, + self::ICAL_METHOD_CANCEL, + self::ICAL_METHOD_REFRESH, + self::ICAL_METHOD_COUNTER, + self::ICAL_METHOD_DECLINECOUNTER, + ]; + + /** + * The complete compiled MIME message body. + * + * @var string + */ + protected $MIMEBody = ''; + + /** + * The complete compiled MIME message headers. + * + * @var string + */ + protected $MIMEHeader = ''; + + /** + * Extra headers that createHeader() doesn't fold in. + * + * @var string + */ + protected $mailHeader = ''; + + /** + * Word-wrap the message body to this number of chars. + * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance. + * + * @see static::STD_LINE_LENGTH + * + * @var int + */ + public $WordWrap = 0; + + /** + * Which method to use to send mail. + * Options: "mail", "sendmail", or "smtp". + * + * @var string + */ + public $Mailer = 'mail'; + + /** + * The path to the sendmail program. + * + * @var string + */ + public $Sendmail = '/usr/sbin/sendmail'; + + /** + * Whether mail() uses a fully sendmail-compatible MTA. + * One which supports sendmail's "-oi -f" options. + * + * @var bool + */ + public $UseSendmailOptions = true; + + /** + * The email address that a reading confirmation should be sent to, also known as read receipt. + * + * @var string + */ + public $ConfirmReadingTo = ''; + + /** + * The hostname to use in the Message-ID header and as default HELO string. + * If empty, PHPMailer attempts to find one with, in order, + * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value + * 'localhost.localdomain'. + * + * @see PHPMailer::$Helo + * + * @var string + */ + public $Hostname = ''; + + /** + * An ID to be used in the Message-ID header. + * If empty, a unique id will be generated. + * You can set your own, but it must be in the format "", + * as defined in RFC5322 section 3.6.4 or it will be ignored. + * + * @see https://tools.ietf.org/html/rfc5322#section-3.6.4 + * + * @var string + */ + public $MessageID = ''; + + /** + * The message Date to be used in the Date header. + * If empty, the current date will be added. + * + * @var string + */ + public $MessageDate = ''; + + /** + * SMTP hosts. + * Either a single hostname or multiple semicolon-delimited hostnames. + * You can also specify a different port + * for each host by using this format: [hostname:port] + * (e.g. "smtp1.example.com:25;smtp2.example.com"). + * You can also specify encryption type, for example: + * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465"). + * Hosts will be tried in order. + * + * @var string + */ + public $Host = 'localhost'; + + /** + * The default SMTP server port. + * + * @var int + */ + public $Port = 25; + + /** + * The SMTP HELO/EHLO name used for the SMTP connection. + * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find + * one with the same method described above for $Hostname. + * + * @see PHPMailer::$Hostname + * + * @var string + */ + public $Helo = ''; + + /** + * What kind of encryption to use on the SMTP connection. + * Options: '', static::ENCRYPTION_STARTTLS, or static::ENCRYPTION_SMTPS. + * + * @var string + */ + public $SMTPSecure = ''; + + /** + * Whether to enable TLS encryption automatically if a server supports it, + * even if `SMTPSecure` is not set to 'tls'. + * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid. + * + * @var bool + */ + public $SMTPAutoTLS = true; + + /** + * Whether to use SMTP authentication. + * Uses the Username and Password properties. + * + * @see PHPMailer::$Username + * @see PHPMailer::$Password + * + * @var bool + */ + public $SMTPAuth = false; + + /** + * Options array passed to stream_context_create when connecting via SMTP. + * + * @var array + */ + public $SMTPOptions = []; + + /** + * SMTP username. + * + * @var string + */ + public $Username = ''; + + /** + * SMTP password. + * + * @var string + */ + public $Password = ''; + + /** + * SMTP auth type. + * Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2, attempted in that order if not specified. + * + * @var string + */ + public $AuthType = ''; + + /** + * An instance of the PHPMailer OAuth class. + * + * @var OAuth + */ + protected $oauth; + + /** + * The SMTP server timeout in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. + * + * @var int + */ + public $Timeout = 300; + + /** + * Comma separated list of DSN notifications + * 'NEVER' under no circumstances a DSN must be returned to the sender. + * If you use NEVER all other notifications will be ignored. + * 'SUCCESS' will notify you when your mail has arrived at its destination. + * 'FAILURE' will arrive if an error occurred during delivery. + * 'DELAY' will notify you if there is an unusual delay in delivery, but the actual + * delivery's outcome (success or failure) is not yet decided. + * + * @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY + */ + public $dsn = ''; + + /** + * SMTP class debug output mode. + * Debug output level. + * Options: + * * SMTP::DEBUG_OFF: No output + * * SMTP::DEBUG_CLIENT: Client messages + * * SMTP::DEBUG_SERVER: Client and server messages + * * SMTP::DEBUG_CONNECTION: As SERVER plus connection status + * * SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed + * + * @see SMTP::$do_debug + * + * @var int + */ + public $SMTPDebug = 0; + + /** + * How to handle debug output. + * Options: + * * `echo` Output plain-text as-is, appropriate for CLI + * * `html` Output escaped, line breaks converted to `
    `, appropriate for browser output + * * `error_log` Output to error log as configured in php.ini + * By default PHPMailer will use `echo` if run from a `cli` or `cli-server` SAPI, `html` otherwise. + * Alternatively, you can provide a callable expecting two params: a message string and the debug level: + * + * ```php + * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; + * ``` + * + * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug` + * level output is used: + * + * ```php + * $mail->Debugoutput = new myPsr3Logger; + * ``` + * + * @see SMTP::$Debugoutput + * + * @var string|callable|\Psr\Log\LoggerInterface + */ + public $Debugoutput = 'echo'; + + /** + * Whether to keep SMTP connection open after each message. + * If this is set to true then to close the connection + * requires an explicit call to smtpClose(). + * + * @var bool + */ + public $SMTPKeepAlive = false; + + /** + * Whether to split multiple to addresses into multiple messages + * or send them all in one message. + * Only supported in `mail` and `sendmail` transports, not in SMTP. + * + * @var bool + */ + public $SingleTo = false; + + /** + * Storage for addresses when SingleTo is enabled. + * + * @var array + */ + protected $SingleToArray = []; + + /** + * Whether to generate VERP addresses on send. + * Only applicable when sending via SMTP. + * + * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path + * @see http://www.postfix.org/VERP_README.html Postfix VERP info + * + * @var bool + */ + public $do_verp = false; + + /** + * Whether to allow sending messages with an empty body. + * + * @var bool + */ + public $AllowEmpty = false; + + /** + * DKIM selector. + * + * @var string + */ + public $DKIM_selector = ''; + + /** + * DKIM Identity. + * Usually the email address used as the source of the email. + * + * @var string + */ + public $DKIM_identity = ''; + + /** + * DKIM passphrase. + * Used if your key is encrypted. + * + * @var string + */ + public $DKIM_passphrase = ''; + + /** + * DKIM signing domain name. + * + * @example 'example.com' + * + * @var string + */ + public $DKIM_domain = ''; + + /** + * DKIM Copy header field values for diagnostic use. + * + * @var bool + */ + public $DKIM_copyHeaderFields = true; + + /** + * DKIM Extra signing headers. + * + * @example ['List-Unsubscribe', 'List-Help'] + * + * @var array + */ + public $DKIM_extraHeaders = []; + + /** + * DKIM private key file path. + * + * @var string + */ + public $DKIM_private = ''; + + /** + * DKIM private key string. + * + * If set, takes precedence over `$DKIM_private`. + * + * @var string + */ + public $DKIM_private_string = ''; + + /** + * Callback Action function name. + * + * The function that handles the result of the send email action. + * It is called out by send() for each email sent. + * + * Value can be any php callable: http://www.php.net/is_callable + * + * Parameters: + * bool $result result of the send action + * array $to email addresses of the recipients + * array $cc cc email addresses + * array $bcc bcc email addresses + * string $subject the subject + * string $body the email body + * string $from email address of sender + * string $extra extra information of possible use + * "smtp_transaction_id' => last smtp transaction id + * + * @var string + */ + public $action_function = ''; + + /** + * What to put in the X-Mailer header. + * Options: An empty string for PHPMailer default, whitespace/null for none, or a string to use. + * + * @var string|null + */ + public $XMailer = ''; + + /** + * Which validator to use by default when validating email addresses. + * May be a callable to inject your own validator, but there are several built-in validators. + * The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option. + * + * @see PHPMailer::validateAddress() + * + * @var string|callable + */ + public static $validator = 'php'; + + /** + * An instance of the SMTP sender class. + * + * @var SMTP + */ + protected $smtp; + + /** + * The array of 'to' names and addresses. + * + * @var array + */ + protected $to = []; + + /** + * The array of 'cc' names and addresses. + * + * @var array + */ + protected $cc = []; + + /** + * The array of 'bcc' names and addresses. + * + * @var array + */ + protected $bcc = []; + + /** + * The array of reply-to names and addresses. + * + * @var array + */ + protected $ReplyTo = []; + + /** + * An array of all kinds of addresses. + * Includes all of $to, $cc, $bcc. + * + * @see PHPMailer::$to + * @see PHPMailer::$cc + * @see PHPMailer::$bcc + * + * @var array + */ + protected $all_recipients = []; + + /** + * An array of names and addresses queued for validation. + * In send(), valid and non duplicate entries are moved to $all_recipients + * and one of $to, $cc, or $bcc. + * This array is used only for addresses with IDN. + * + * @see PHPMailer::$to + * @see PHPMailer::$cc + * @see PHPMailer::$bcc + * @see PHPMailer::$all_recipients + * + * @var array + */ + protected $RecipientsQueue = []; + + /** + * An array of reply-to names and addresses queued for validation. + * In send(), valid and non duplicate entries are moved to $ReplyTo. + * This array is used only for addresses with IDN. + * + * @see PHPMailer::$ReplyTo + * + * @var array + */ + protected $ReplyToQueue = []; + + /** + * The array of attachments. + * + * @var array + */ + protected $attachment = []; + + /** + * The array of custom headers. + * + * @var array + */ + protected $CustomHeader = []; + + /** + * The most recent Message-ID (including angular brackets). + * + * @var string + */ + protected $lastMessageID = ''; + + /** + * The message's MIME type. + * + * @var string + */ + protected $message_type = ''; + + /** + * The array of MIME boundary strings. + * + * @var array + */ + protected $boundary = []; + + /** + * The array of available languages. + * + * @var array + */ + protected $language = []; + + /** + * The number of errors encountered. + * + * @var int + */ + protected $error_count = 0; + + /** + * The S/MIME certificate file path. + * + * @var string + */ + protected $sign_cert_file = ''; + + /** + * The S/MIME key file path. + * + * @var string + */ + protected $sign_key_file = ''; + + /** + * The optional S/MIME extra certificates ("CA Chain") file path. + * + * @var string + */ + protected $sign_extracerts_file = ''; + + /** + * The S/MIME password for the key. + * Used only if the key is encrypted. + * + * @var string + */ + protected $sign_key_pass = ''; + + /** + * Whether to throw exceptions for errors. + * + * @var bool + */ + protected $exceptions = false; + + /** + * Unique ID used for message ID and boundaries. + * + * @var string + */ + protected $uniqueid = ''; + + /** + * The PHPMailer Version number. + * + * @var string + */ + const VERSION = '6.1.4'; + + /** + * Error severity: message only, continue processing. + * + * @var int + */ + const STOP_MESSAGE = 0; + + /** + * Error severity: message, likely ok to continue processing. + * + * @var int + */ + const STOP_CONTINUE = 1; + + /** + * Error severity: message, plus full stop, critical error reached. + * + * @var int + */ + const STOP_CRITICAL = 2; + + /** + * SMTP RFC standard line ending. + * + * @var string + */ + protected static $LE = "\r\n"; + + /** + * The maximum line length supported by mail(). + * + * Background: mail() will sometimes corrupt messages + * with headers headers longer than 65 chars, see #818. + * + * @var int + */ + const MAIL_MAX_LINE_LENGTH = 63; + + /** + * The maximum line length allowed by RFC 2822 section 2.1.1. + * + * @var int + */ + const MAX_LINE_LENGTH = 998; + + /** + * The lower maximum line length allowed by RFC 2822 section 2.1.1. + * This length does NOT include the line break + * 76 means that lines will be 77 or 78 chars depending on whether + * the line break format is LF or CRLF; both are valid. + * + * @var int + */ + const STD_LINE_LENGTH = 76; + + /** + * Constructor. + * + * @param bool $exceptions Should we throw external exceptions? + */ + public function __construct($exceptions = null) + { + if (null !== $exceptions) { + $this->exceptions = (bool) $exceptions; + } + //Pick an appropriate debug output format automatically + $this->Debugoutput = (strpos(PHP_SAPI, 'cli') !== false ? 'echo' : 'html'); + } + + /** + * Destructor. + */ + public function __destruct() + { + //Close any open SMTP connection nicely + $this->smtpClose(); + } + + /** + * Call mail() in a safe_mode-aware fashion. + * Also, unless sendmail_path points to sendmail (or something that + * claims to be sendmail), don't pass params (not a perfect fix, + * but it will do). + * + * @param string $to To + * @param string $subject Subject + * @param string $body Message Body + * @param string $header Additional Header(s) + * @param string|null $params Params + * + * @return bool + */ + private function mailPassthru($to, $subject, $body, $header, $params) + { + //Check overloading of mail function to avoid double-encoding + if (ini_get('mbstring.func_overload') & 1) { + $subject = $this->secureHeader($subject); + } else { + $subject = $this->encodeHeader($this->secureHeader($subject)); + } + //Calling mail() with null params breaks + if (!$this->UseSendmailOptions || null === $params) { + $result = @mail($to, $subject, $body, $header); + } else { + $result = @mail($to, $subject, $body, $header, $params); + } + + return $result; + } + + /** + * Output debugging info via user-defined method. + * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug). + * + * @see PHPMailer::$Debugoutput + * @see PHPMailer::$SMTPDebug + * + * @param string $str + */ + protected function edebug($str) + { + if ($this->SMTPDebug <= 0) { + return; + } + //Is this a PSR-3 logger? + if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { + $this->Debugoutput->debug($str); + + return; + } + //Avoid clash with built-in function names + if (is_callable($this->Debugoutput) && !in_array($this->Debugoutput, ['error_log', 'html', 'echo'])) { + call_user_func($this->Debugoutput, $str, $this->SMTPDebug); + + return; + } + switch ($this->Debugoutput) { + case 'error_log': + //Don't output, just log + error_log($str); + break; + case 'html': + //Cleans up output a bit for a better looking, HTML-safe output + echo htmlentities( + preg_replace('/[\r\n]+/', '', $str), + ENT_QUOTES, + 'UTF-8' + ), "
    \n"; + break; + case 'echo': + default: + //Normalize line breaks + $str = preg_replace('/\r\n|\r/m', "\n", $str); + echo gmdate('Y-m-d H:i:s'), + "\t", + //Trim trailing space + trim( + //Indent for readability, except for trailing break + str_replace( + "\n", + "\n \t ", + trim($str) + ) + ), + "\n"; + } + } + + /** + * Sets message type to HTML or plain. + * + * @param bool $isHtml True for HTML mode + */ + public function isHTML($isHtml = true) + { + if ($isHtml) { + $this->ContentType = static::CONTENT_TYPE_TEXT_HTML; + } else { + $this->ContentType = static::CONTENT_TYPE_PLAINTEXT; + } + } + + /** + * Send messages using SMTP. + */ + public function isSMTP() + { + $this->Mailer = 'smtp'; + } + + /** + * Send messages using PHP's mail() function. + */ + public function isMail() + { + $this->Mailer = 'mail'; + } + + /** + * Send messages using $Sendmail. + */ + public function isSendmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (false === stripos($ini_sendmail_path, 'sendmail')) { + $this->Sendmail = '/usr/sbin/sendmail'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'sendmail'; + } + + /** + * Send messages using qmail. + */ + public function isQmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (false === stripos($ini_sendmail_path, 'qmail')) { + $this->Sendmail = '/var/qmail/bin/qmail-inject'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'qmail'; + } + + /** + * Add a "To" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addAddress($address, $name = '') + { + return $this->addOrEnqueueAnAddress('to', $address, $name); + } + + /** + * Add a "CC" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addCC($address, $name = '') + { + return $this->addOrEnqueueAnAddress('cc', $address, $name); + } + + /** + * Add a "BCC" address. + * + * @param string $address The email address to send to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addBCC($address, $name = '') + { + return $this->addOrEnqueueAnAddress('bcc', $address, $name); + } + + /** + * Add a "Reply-To" address. + * + * @param string $address The email address to reply to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + public function addReplyTo($address, $name = '') + { + return $this->addOrEnqueueAnAddress('Reply-To', $address, $name); + } + + /** + * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer + * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still + * be modified after calling this function), addition of such addresses is delayed until send(). + * Addresses that have been added already return false, but do not throw exceptions. + * + * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $address The email address to send, resp. to reply to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + protected function addOrEnqueueAnAddress($kind, $address, $name) + { + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + $pos = strrpos($address, '@'); + if (false === $pos) { + // At-sign is missing. + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $kind, + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + $params = [$kind, $address, $name]; + // Enqueue addresses with IDN until we know the PHPMailer::$CharSet. + if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) { + if ('Reply-To' !== $kind) { + if (!array_key_exists($address, $this->RecipientsQueue)) { + $this->RecipientsQueue[$address] = $params; + + return true; + } + } elseif (!array_key_exists($address, $this->ReplyToQueue)) { + $this->ReplyToQueue[$address] = $params; + + return true; + } + + return false; + } + + // Immediately add standard addresses without IDN. + return call_user_func_array([$this, 'addAnAddress'], $params); + } + + /** + * Add an address to one of the recipient arrays or to the ReplyTo array. + * Addresses that have been added already return false, but do not throw exceptions. + * + * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $address The email address to send, resp. to reply to + * @param string $name + * + * @throws Exception + * + * @return bool true on success, false if address already used or invalid in some way + */ + protected function addAnAddress($kind, $address, $name = '') + { + if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) { + $error_message = sprintf( + '%s: %s', + $this->lang('Invalid recipient kind'), + $kind + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + if (!static::validateAddress($address)) { + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $kind, + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + if ('Reply-To' !== $kind) { + if (!array_key_exists(strtolower($address), $this->all_recipients)) { + $this->{$kind}[] = [$address, $name]; + $this->all_recipients[strtolower($address)] = true; + + return true; + } + } elseif (!array_key_exists(strtolower($address), $this->ReplyTo)) { + $this->ReplyTo[strtolower($address)] = [$address, $name]; + + return true; + } + + return false; + } + + /** + * Parse and validate a string containing one or more RFC822-style comma-separated email addresses + * of the form "display name
    " into an array of name/address pairs. + * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. + * Note that quotes in the name part are removed. + * + * @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation + * + * @param string $addrstr The address list string + * @param bool $useimap Whether to use the IMAP extension to parse the list + * + * @return array + */ + public static function parseAddresses($addrstr, $useimap = true) + { + $addresses = []; + if ($useimap && function_exists('imap_rfc822_parse_adrlist')) { + //Use this built-in parser if it's available + $list = imap_rfc822_parse_adrlist($addrstr, ''); + foreach ($list as $address) { + if (('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress( + $address->mailbox . '@' . $address->host + )) { + $addresses[] = [ + 'name' => (property_exists($address, 'personal') ? $address->personal : ''), + 'address' => $address->mailbox . '@' . $address->host, + ]; + } + } + } else { + //Use this simpler parser + $list = explode(',', $addrstr); + foreach ($list as $address) { + $address = trim($address); + //Is there a separate name part? + if (strpos($address, '<') === false) { + //No separate name, just use the whole thing + if (static::validateAddress($address)) { + $addresses[] = [ + 'name' => '', + 'address' => $address, + ]; + } + } else { + list($name, $email) = explode('<', $address); + $email = trim(str_replace('>', '', $email)); + if (static::validateAddress($email)) { + $addresses[] = [ + 'name' => trim(str_replace(['"', "'"], '', $name)), + 'address' => $email, + ]; + } + } + } + } + + return $addresses; + } + + /** + * Set the From and FromName properties. + * + * @param string $address + * @param string $name + * @param bool $auto Whether to also set the Sender address, defaults to true + * + * @throws Exception + * + * @return bool + */ + public function setFrom($address, $name = '', $auto = true) + { + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + // Don't validate now addresses with IDN. Will be done in send(). + $pos = strrpos($address, '@'); + if ((false === $pos) + || ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported()) + && !static::validateAddress($address)) + ) { + $error_message = sprintf( + '%s (From): %s', + $this->lang('invalid_address'), + $address + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + $this->From = $address; + $this->FromName = $name; + if ($auto && empty($this->Sender)) { + $this->Sender = $address; + } + + return true; + } + + /** + * Return the Message-ID header of the last email. + * Technically this is the value from the last time the headers were created, + * but it's also the message ID of the last sent message except in + * pathological cases. + * + * @return string + */ + public function getLastMessageID() + { + return $this->lastMessageID; + } + + /** + * Check that a string looks like an email address. + * Validation patterns supported: + * * `auto` Pick best pattern automatically; + * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0; + * * `pcre` Use old PCRE implementation; + * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; + * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. + * * `noregex` Don't use a regex: super fast, really dumb. + * Alternatively you may pass in a callable to inject your own validator, for example: + * + * ```php + * PHPMailer::validateAddress('user@example.com', function($address) { + * return (strpos($address, '@') !== false); + * }); + * ``` + * + * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator. + * + * @param string $address The email address to check + * @param string|callable $patternselect Which pattern to use + * + * @return bool + */ + public static function validateAddress($address, $patternselect = null) + { + if (null === $patternselect) { + $patternselect = static::$validator; + } + if (is_callable($patternselect)) { + return $patternselect($address); + } + //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 + if (strpos($address, "\n") !== false || strpos($address, "\r") !== false) { + return false; + } + switch ($patternselect) { + case 'pcre': //Kept for BC + case 'pcre8': + /* + * A more complex and more permissive version of the RFC5322 regex on which FILTER_VALIDATE_EMAIL + * is based. + * In addition to the addresses allowed by filter_var, also permits: + * * dotless domains: `a@b` + * * comments: `1234 @ local(blah) .machine .example` + * * quoted elements: `'"test blah"@example.org'` + * * numeric TLDs: `a@b.123` + * * unbracketed IPv4 literals: `a@192.168.0.1` + * * IPv6 literals: 'first.last@[IPv6:a1::]' + * Not all of these will necessarily work for sending! + * + * @see http://squiloople.com/2009/12/20/email-address-validation/ + * @copyright 2009-2010 Michael Rushton + * Feel free to use and redistribute this code. But please keep this copyright notice. + */ + return (bool) preg_match( + '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . + '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . + '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . + '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . + '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . + '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . + '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . + '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . + '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', + $address + ); + case 'html5': + /* + * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. + * + * @see http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) + */ + return (bool) preg_match( + '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . + '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', + $address + ); + case 'php': + default: + return filter_var($address, FILTER_VALIDATE_EMAIL) !== false; + } + } + + /** + * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the + * `intl` and `mbstring` PHP extensions. + * + * @return bool `true` if required functions for IDN support are present + */ + public static function idnSupported() + { + return function_exists('idn_to_ascii') && function_exists('mb_convert_encoding'); + } + + /** + * Converts IDN in given email address to its ASCII form, also known as punycode, if possible. + * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet. + * This function silently returns unmodified address if: + * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form) + * - Conversion to punycode is impossible (e.g. required PHP functions are not available) + * or fails for any reason (e.g. domain contains characters not allowed in an IDN). + * + * @see PHPMailer::$CharSet + * + * @param string $address The email address to convert + * + * @return string The encoded address in ASCII form + */ + public function punyencodeAddress($address) + { + // Verify we have required functions, CharSet, and at-sign. + $pos = strrpos($address, '@'); + if (!empty($this->CharSet) && + false !== $pos && + static::idnSupported() + ) { + $domain = substr($address, ++$pos); + // Verify CharSet string is a valid one, and domain properly encoded in this CharSet. + if ($this->has8bitChars($domain) && @mb_check_encoding($domain, $this->CharSet)) { + $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet); + //Ignore IDE complaints about this line - method signature changed in PHP 5.4 + $errorcode = 0; + if (defined('INTL_IDNA_VARIANT_UTS46')) { + $punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_UTS46); + } elseif (defined('INTL_IDNA_VARIANT_2003')) { + $punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_2003); + } else { + $punycode = idn_to_ascii($domain, $errorcode); + } + if (false !== $punycode) { + return substr($address, 0, $pos) . $punycode; + } + } + } + + return $address; + } + + /** + * Create a message and send it. + * Uses the sending method specified by $Mailer. + * + * @throws Exception + * + * @return bool false on error - See the ErrorInfo property for details of the error + */ + public function send() + { + try { + if (!$this->preSend()) { + return false; + } + + return $this->postSend(); + } catch (Exception $exc) { + $this->mailHeader = ''; + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + } + + /** + * Prepare a message for sending. + * + * @throws Exception + * + * @return bool + */ + public function preSend() + { + if ('smtp' === $this->Mailer + || ('mail' === $this->Mailer && stripos(PHP_OS, 'WIN') === 0) + ) { + //SMTP mandates RFC-compliant line endings + //and it's also used with mail() on Windows + static::setLE("\r\n"); + } else { + //Maintain backward compatibility with legacy Linux command line mailers + static::setLE(PHP_EOL); + } + //Check for buggy PHP versions that add a header with an incorrect line break + if ('mail' === $this->Mailer + && ((PHP_VERSION_ID >= 70000 && PHP_VERSION_ID < 70017) + || (PHP_VERSION_ID >= 70100 && PHP_VERSION_ID < 70103)) + && ini_get('mail.add_x_header') === '1' + && stripos(PHP_OS, 'WIN') === 0 + ) { + trigger_error( + 'Your version of PHP is affected by a bug that may result in corrupted messages.' . + ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . + ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', + E_USER_WARNING + ); + } + + try { + $this->error_count = 0; // Reset errors + $this->mailHeader = ''; + + // Dequeue recipient and Reply-To addresses with IDN + foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) { + $params[1] = $this->punyencodeAddress($params[1]); + call_user_func_array([$this, 'addAnAddress'], $params); + } + if (count($this->to) + count($this->cc) + count($this->bcc) < 1) { + throw new Exception($this->lang('provide_address'), self::STOP_CRITICAL); + } + + // Validate From, Sender, and ConfirmReadingTo addresses + foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) { + $this->$address_kind = trim($this->$address_kind); + if (empty($this->$address_kind)) { + continue; + } + $this->$address_kind = $this->punyencodeAddress($this->$address_kind); + if (!static::validateAddress($this->$address_kind)) { + $error_message = sprintf( + '%s (%s): %s', + $this->lang('invalid_address'), + $address_kind, + $this->$address_kind + ); + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new Exception($error_message); + } + + return false; + } + } + + // Set whether the message is multipart/alternative + if ($this->alternativeExists()) { + $this->ContentType = static::CONTENT_TYPE_MULTIPART_ALTERNATIVE; + } + + $this->setMessageType(); + // Refuse to send an empty message unless we are specifically allowing it + if (!$this->AllowEmpty && empty($this->Body)) { + throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL); + } + + //Trim subject consistently + $this->Subject = trim($this->Subject); + // Create body before headers in case body makes changes to headers (e.g. altering transfer encoding) + $this->MIMEHeader = ''; + $this->MIMEBody = $this->createBody(); + // createBody may have added some headers, so retain them + $tempheaders = $this->MIMEHeader; + $this->MIMEHeader = $this->createHeader(); + $this->MIMEHeader .= $tempheaders; + + // To capture the complete message when using mail(), create + // an extra header list which createHeader() doesn't fold in + if ('mail' === $this->Mailer) { + if (count($this->to) > 0) { + $this->mailHeader .= $this->addrAppend('To', $this->to); + } else { + $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;'); + } + $this->mailHeader .= $this->headerLine( + 'Subject', + $this->encodeHeader($this->secureHeader($this->Subject)) + ); + } + + // Sign with DKIM if enabled + if (!empty($this->DKIM_domain) + && !empty($this->DKIM_selector) + && (!empty($this->DKIM_private_string) + || (!empty($this->DKIM_private) + && static::isPermittedPath($this->DKIM_private) + && file_exists($this->DKIM_private) + ) + ) + ) { + $header_dkim = $this->DKIM_Add( + $this->MIMEHeader . $this->mailHeader, + $this->encodeHeader($this->secureHeader($this->Subject)), + $this->MIMEBody + ); + $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . static::$LE . + static::normalizeBreaks($header_dkim) . static::$LE; + } + + return true; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + } + + /** + * Actually send a message via the selected mechanism. + * + * @throws Exception + * + * @return bool + */ + public function postSend() + { + try { + // Choose the mailer and send through it + switch ($this->Mailer) { + case 'sendmail': + case 'qmail': + return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); + case 'smtp': + return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); + case 'mail': + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + default: + $sendMethod = $this->Mailer . 'Send'; + if (method_exists($this, $sendMethod)) { + return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); + } + + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + } + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + } + + return false; + } + + /** + * Send mail using the $Sendmail program. + * + * @see PHPMailer::$Sendmail + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function sendmailSend($header, $body) + { + $header = rtrim($header, "\r\n ") . static::$LE . static::$LE; + + // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + if (!empty($this->Sender) && self::isShellSafe($this->Sender)) { + if ('qmail' === $this->Mailer) { + $sendmailFmt = '%s -f%s'; + } else { + $sendmailFmt = '%s -oi -f%s -t'; + } + } elseif ('qmail' === $this->Mailer) { + $sendmailFmt = '%s'; + } else { + $sendmailFmt = '%s -oi -t'; + } + + $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender); + + if ($this->SingleTo) { + foreach ($this->SingleToArray as $toAddr) { + $mail = @popen($sendmail, 'w'); + if (!$mail) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + fwrite($mail, 'To: ' . $toAddr . "\n"); + fwrite($mail, $header); + fwrite($mail, $body); + $result = pclose($mail); + $this->doCallback( + ($result === 0), + [$toAddr], + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); + if (0 !== $result) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + } else { + $mail = @popen($sendmail, 'w'); + if (!$mail) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + fwrite($mail, $header); + fwrite($mail, $body); + $result = pclose($mail); + $this->doCallback( + ($result === 0), + $this->to, + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); + if (0 !== $result) { + throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + + return true; + } + + /** + * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters. + * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows. + * + * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report + * + * @param string $string The string to be validated + * + * @return bool + */ + protected static function isShellSafe($string) + { + // Future-proof + if (escapeshellcmd($string) !== $string + || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""]) + ) { + return false; + } + + $length = strlen($string); + + for ($i = 0; $i < $length; ++$i) { + $c = $string[$i]; + + // All other characters have a special meaning in at least one common shell, including = and +. + // Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. + // Note that this does permit non-Latin alphanumeric characters based on the current locale. + if (!ctype_alnum($c) && strpos('@_-.', $c) === false) { + return false; + } + } + + return true; + } + + /** + * Check whether a file path is of a permitted type. + * Used to reject URLs and phar files from functions that access local file paths, + * such as addAttachment. + * + * @param string $path A relative or absolute path to a file + * + * @return bool + */ + protected static function isPermittedPath($path) + { + return !preg_match('#^[a-z]+://#i', $path); + } + + /** + * Send mail using the PHP mail() function. + * + * @see http://www.php.net/manual/en/book.mail.php + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function mailSend($header, $body) + { + $header = rtrim($header, "\r\n ") . static::$LE . static::$LE; + + $toArr = []; + foreach ($this->to as $toaddr) { + $toArr[] = $this->addrFormat($toaddr); + } + $to = implode(', ', $toArr); + + $params = null; + //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver + //A space after `-f` is optional, but there is a long history of its presence + //causing problems, so we don't use one + //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html + //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Example problem: https://www.drupal.org/node/1057954 + // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) { + $params = sprintf('-f%s', $this->Sender); + } + if (!empty($this->Sender) && static::validateAddress($this->Sender)) { + $old_from = ini_get('sendmail_from'); + ini_set('sendmail_from', $this->Sender); + } + $result = false; + if ($this->SingleTo && count($toArr) > 1) { + foreach ($toArr as $toAddr) { + $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); + $this->doCallback($result, [$toAddr], $this->cc, $this->bcc, $this->Subject, $body, $this->From, []); + } + } else { + $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); + $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From, []); + } + if (isset($old_from)) { + ini_set('sendmail_from', $old_from); + } + if (!$result) { + throw new Exception($this->lang('instantiate'), self::STOP_CRITICAL); + } + + return true; + } + + /** + * Get an instance to use for SMTP operations. + * Override this function to load your own SMTP implementation, + * or set one with setSMTPInstance. + * + * @return SMTP + */ + public function getSMTPInstance() + { + if (!is_object($this->smtp)) { + $this->smtp = new SMTP(); + } + + return $this->smtp; + } + + /** + * Provide an instance to use for SMTP operations. + * + * @return SMTP + */ + public function setSMTPInstance(SMTP $smtp) + { + $this->smtp = $smtp; + + return $this->smtp; + } + + /** + * Send mail via SMTP. + * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. + * + * @see PHPMailer::setSMTPInstance() to use a different class. + * + * @uses \PHPMailer\PHPMailer\SMTP + * + * @param string $header The message headers + * @param string $body The message body + * + * @throws Exception + * + * @return bool + */ + protected function smtpSend($header, $body) + { + $header = rtrim($header, "\r\n ") . static::$LE . static::$LE; + $bad_rcpt = []; + if (!$this->smtpConnect($this->SMTPOptions)) { + throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); + } + //Sender already validated in preSend() + if ('' === $this->Sender) { + $smtp_from = $this->From; + } else { + $smtp_from = $this->Sender; + } + if (!$this->smtp->mail($smtp_from)) { + $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); + throw new Exception($this->ErrorInfo, self::STOP_CRITICAL); + } + + $callbacks = []; + // Attempt to send to all recipients + foreach ([$this->to, $this->cc, $this->bcc] as $togroup) { + foreach ($togroup as $to) { + if (!$this->smtp->recipient($to[0], $this->dsn)) { + $error = $this->smtp->getError(); + $bad_rcpt[] = ['to' => $to[0], 'error' => $error['detail']]; + $isSent = false; + } else { + $isSent = true; + } + + $callbacks[] = ['issent'=>$isSent, 'to'=>$to[0]]; + } + } + + // Only send the DATA command if we have viable recipients + if ((count($this->all_recipients) > count($bad_rcpt)) && !$this->smtp->data($header . $body)) { + throw new Exception($this->lang('data_not_accepted'), self::STOP_CRITICAL); + } + + $smtp_transaction_id = $this->smtp->getLastTransactionID(); + + if ($this->SMTPKeepAlive) { + $this->smtp->reset(); + } else { + $this->smtp->quit(); + $this->smtp->close(); + } + + foreach ($callbacks as $cb) { + $this->doCallback( + $cb['issent'], + [$cb['to']], + [], + [], + $this->Subject, + $body, + $this->From, + ['smtp_transaction_id' => $smtp_transaction_id] + ); + } + + //Create error message for any bad addresses + if (count($bad_rcpt) > 0) { + $errstr = ''; + foreach ($bad_rcpt as $bad) { + $errstr .= $bad['to'] . ': ' . $bad['error']; + } + throw new Exception($this->lang('recipients_failed') . $errstr, self::STOP_CONTINUE); + } + + return true; + } + + /** + * Initiate a connection to an SMTP server. + * Returns false if the operation failed. + * + * @param array $options An array of options compatible with stream_context_create() + * + * @throws Exception + * + * @uses \PHPMailer\PHPMailer\SMTP + * + * @return bool + */ + public function smtpConnect($options = null) + { + if (null === $this->smtp) { + $this->smtp = $this->getSMTPInstance(); + } + + //If no options are provided, use whatever is set in the instance + if (null === $options) { + $options = $this->SMTPOptions; + } + + // Already connected? + if ($this->smtp->connected()) { + return true; + } + + $this->smtp->setTimeout($this->Timeout); + $this->smtp->setDebugLevel($this->SMTPDebug); + $this->smtp->setDebugOutput($this->Debugoutput); + $this->smtp->setVerp($this->do_verp); + $hosts = explode(';', $this->Host); + $lastexception = null; + + foreach ($hosts as $hostentry) { + $hostinfo = []; + if (!preg_match( + '/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/', + trim($hostentry), + $hostinfo + )) { + $this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry)); + // Not a valid host entry + continue; + } + // $hostinfo[1]: optional ssl or tls prefix + // $hostinfo[2]: the hostname + // $hostinfo[3]: optional port number + // The host string prefix can temporarily override the current setting for SMTPSecure + // If it's not specified, the default value is used + + //Check the host name is a valid name or IP address before trying to use it + if (!static::isValidHost($hostinfo[2])) { + $this->edebug($this->lang('invalid_host') . ' ' . $hostinfo[2]); + continue; + } + $prefix = ''; + $secure = $this->SMTPSecure; + $tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure); + if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) { + $prefix = 'ssl://'; + $tls = false; // Can't have SSL and TLS at the same time + $secure = static::ENCRYPTION_SMTPS; + } elseif ('tls' === $hostinfo[1]) { + $tls = true; + // tls doesn't use a prefix + $secure = static::ENCRYPTION_STARTTLS; + } + //Do we need the OpenSSL extension? + $sslext = defined('OPENSSL_ALGO_SHA256'); + if (static::ENCRYPTION_STARTTLS === $secure || static::ENCRYPTION_SMTPS === $secure) { + //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled + if (!$sslext) { + throw new Exception($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL); + } + } + $host = $hostinfo[2]; + $port = $this->Port; + if (array_key_exists(3, $hostinfo) && is_numeric($hostinfo[3]) && $hostinfo[3] > 0 && $hostinfo[3] < 65536) { + $port = (int) $hostinfo[3]; + } + if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { + try { + if ($this->Helo) { + $hello = $this->Helo; + } else { + $hello = $this->serverHostname(); + } + $this->smtp->hello($hello); + //Automatically enable TLS encryption if: + // * it's not disabled + // * we have openssl extension + // * we are not already using SSL + // * the server offers STARTTLS + if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) { + $tls = true; + } + if ($tls) { + if (!$this->smtp->startTLS()) { + throw new Exception($this->lang('connect_host')); + } + // We must resend EHLO after TLS negotiation + $this->smtp->hello($hello); + } + if ($this->SMTPAuth && !$this->smtp->authenticate( + $this->Username, + $this->Password, + $this->AuthType, + $this->oauth + )) { + throw new Exception($this->lang('authenticate')); + } + + return true; + } catch (Exception $exc) { + $lastexception = $exc; + $this->edebug($exc->getMessage()); + // We must have connected, but then failed TLS or Auth, so close connection nicely + $this->smtp->quit(); + } + } + } + // If we get here, all connection attempts have failed, so close connection hard + $this->smtp->close(); + // As we've caught all exceptions, just report whatever the last one was + if ($this->exceptions && null !== $lastexception) { + throw $lastexception; + } + + return false; + } + + /** + * Close the active SMTP session if one exists. + */ + public function smtpClose() + { + if ((null !== $this->smtp) && $this->smtp->connected()) { + $this->smtp->quit(); + $this->smtp->close(); + } + } + + /** + * Set the language for error messages. + * Returns false if it cannot load the language file. + * The default language is English. + * + * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") + * @param string $lang_path Path to the language file directory, with trailing separator (slash) + * + * @return bool + */ + public function setLanguage($langcode = 'en', $lang_path = '') + { + // Backwards compatibility for renamed language codes + $renamed_langcodes = [ + 'br' => 'pt_br', + 'cz' => 'cs', + 'dk' => 'da', + 'no' => 'nb', + 'se' => 'sv', + 'rs' => 'sr', + 'tg' => 'tl', + ]; + + if (isset($renamed_langcodes[$langcode])) { + $langcode = $renamed_langcodes[$langcode]; + } + + // Define full set of translatable strings in English + $PHPMAILER_LANG = [ + 'authenticate' => 'SMTP Error: Could not authenticate.', + 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', + 'data_not_accepted' => 'SMTP Error: data not accepted.', + 'empty_message' => 'Message body empty', + 'encoding' => 'Unknown encoding: ', + 'execute' => 'Could not execute: ', + 'file_access' => 'Could not access file: ', + 'file_open' => 'File Error: Could not open file: ', + 'from_failed' => 'The following From address failed: ', + 'instantiate' => 'Could not instantiate mail function.', + 'invalid_address' => 'Invalid address: ', + 'invalid_hostentry' => 'Invalid hostentry: ', + 'invalid_host' => 'Invalid host: ', + 'mailer_not_supported' => ' mailer is not supported.', + 'provide_address' => 'You must provide at least one recipient email address.', + 'recipients_failed' => 'SMTP Error: The following recipients failed: ', + 'signing' => 'Signing Error: ', + 'smtp_connect_failed' => 'SMTP connect() failed.', + 'smtp_error' => 'SMTP server error: ', + 'variable_set' => 'Cannot set or reset variable: ', + 'extension_missing' => 'Extension missing: ', + ]; + if (empty($lang_path)) { + // Calculate an absolute path so it can work if CWD is not here + $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR; + } + //Validate $langcode + if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { + $langcode = 'en'; + } + $foundlang = true; + $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; + // There is no English translation file + if ('en' !== $langcode) { + // Make sure language file path is readable + if (!static::isPermittedPath($lang_file) || !file_exists($lang_file)) { + $foundlang = false; + } else { + // Overwrite language-specific strings. + // This way we'll never have missing translation keys. + $foundlang = include $lang_file; + } + } + $this->language = $PHPMAILER_LANG; + + return (bool) $foundlang; // Returns false if language not found + } + + /** + * Get the array of strings for the current language. + * + * @return array + */ + public function getTranslations() + { + return $this->language; + } + + /** + * Create recipient headers. + * + * @param string $type + * @param array $addr An array of recipients, + * where each recipient is a 2-element indexed array with element 0 containing an address + * and element 1 containing a name, like: + * [['joe@example.com', 'Joe User'], ['zoe@example.com', 'Zoe User']] + * + * @return string + */ + public function addrAppend($type, $addr) + { + $addresses = []; + foreach ($addr as $address) { + $addresses[] = $this->addrFormat($address); + } + + return $type . ': ' . implode(', ', $addresses) . static::$LE; + } + + /** + * Format an address for use in a message header. + * + * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name like + * ['joe@example.com', 'Joe User'] + * + * @return string + */ + public function addrFormat($addr) + { + if (empty($addr[1])) { // No name provided + return $this->secureHeader($addr[0]); + } + + return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . + ' <' . $this->secureHeader($addr[0]) . '>'; + } + + /** + * Word-wrap message. + * For use with mailers that do not automatically perform wrapping + * and for quoted-printable encoded messages. + * Original written by philippe. + * + * @param string $message The message to wrap + * @param int $length The line length to wrap to + * @param bool $qp_mode Whether to run in Quoted-Printable mode + * + * @return string + */ + public function wrapText($message, $length, $qp_mode = false) + { + if ($qp_mode) { + $soft_break = sprintf(' =%s', static::$LE); + } else { + $soft_break = static::$LE; + } + // If utf-8 encoding is used, we will need to make sure we don't + // split multibyte characters when we wrap + $is_utf8 = static::CHARSET_UTF8 === strtolower($this->CharSet); + $lelen = strlen(static::$LE); + $crlflen = strlen(static::$LE); + + $message = static::normalizeBreaks($message); + //Remove a trailing line break + if (substr($message, -$lelen) === static::$LE) { + $message = substr($message, 0, -$lelen); + } + + //Split message into lines + $lines = explode(static::$LE, $message); + //Message will be rebuilt in here + $message = ''; + foreach ($lines as $line) { + $words = explode(' ', $line); + $buf = ''; + $firstword = true; + foreach ($words as $word) { + if ($qp_mode && (strlen($word) > $length)) { + $space_left = $length - strlen($buf) - $crlflen; + if (!$firstword) { + if ($space_left > 20) { + $len = $space_left; + if ($is_utf8) { + $len = $this->utf8CharBoundary($word, $len); + } elseif ('=' === substr($word, $len - 1, 1)) { + --$len; + } elseif ('=' === substr($word, $len - 2, 1)) { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = substr($word, $len); + $buf .= ' ' . $part; + $message .= $buf . sprintf('=%s', static::$LE); + } else { + $message .= $buf . $soft_break; + } + $buf = ''; + } + while ($word !== '') { + if ($length <= 0) { + break; + } + $len = $length; + if ($is_utf8) { + $len = $this->utf8CharBoundary($word, $len); + } elseif ('=' === substr($word, $len - 1, 1)) { + --$len; + } elseif ('=' === substr($word, $len - 2, 1)) { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = (string) substr($word, $len); + + if ($word !== '') { + $message .= $part . sprintf('=%s', static::$LE); + } else { + $buf = $part; + } + } + } else { + $buf_o = $buf; + if (!$firstword) { + $buf .= ' '; + } + $buf .= $word; + + if ('' !== $buf_o && strlen($buf) > $length) { + $message .= $buf_o . $soft_break; + $buf = $word; + } + } + $firstword = false; + } + $message .= $buf . static::$LE; + } + + return $message; + } + + /** + * Find the last character boundary prior to $maxLength in a utf-8 + * quoted-printable encoded string. + * Original written by Colin Brown. + * + * @param string $encodedText utf-8 QP text + * @param int $maxLength Find the last character boundary prior to this length + * + * @return int + */ + public function utf8CharBoundary($encodedText, $maxLength) + { + $foundSplitPos = false; + $lookBack = 3; + while (!$foundSplitPos) { + $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); + $encodedCharPos = strpos($lastChunk, '='); + if (false !== $encodedCharPos) { + // Found start of encoded character byte within $lookBack block. + // Check the encoded byte value (the 2 chars after the '=') + $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); + $dec = hexdec($hex); + if ($dec < 128) { + // Single byte character. + // If the encoded char was found at pos 0, it will fit + // otherwise reduce maxLength to start of the encoded char + if ($encodedCharPos > 0) { + $maxLength -= $lookBack - $encodedCharPos; + } + $foundSplitPos = true; + } elseif ($dec >= 192) { + // First byte of a multi byte character + // Reduce maxLength to split at start of character + $maxLength -= $lookBack - $encodedCharPos; + $foundSplitPos = true; + } elseif ($dec < 192) { + // Middle byte of a multi byte character, look further back + $lookBack += 3; + } + } else { + // No encoded character found + $foundSplitPos = true; + } + } + + return $maxLength; + } + + /** + * Apply word wrapping to the message body. + * Wraps the message body to the number of chars set in the WordWrap property. + * You should only do this to plain-text bodies as wrapping HTML tags may break them. + * This is called automatically by createBody(), so you don't need to call it yourself. + */ + public function setWordWrap() + { + if ($this->WordWrap < 1) { + return; + } + + switch ($this->message_type) { + case 'alt': + case 'alt_inline': + case 'alt_attach': + case 'alt_inline_attach': + $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap); + break; + default: + $this->Body = $this->wrapText($this->Body, $this->WordWrap); + break; + } + } + + /** + * Assemble message headers. + * + * @return string The assembled headers + */ + public function createHeader() + { + $result = ''; + + $result .= $this->headerLine('Date', '' === $this->MessageDate ? self::rfcDate() : $this->MessageDate); + + // To be created automatically by mail() + if ($this->SingleTo) { + if ('mail' !== $this->Mailer) { + foreach ($this->to as $toaddr) { + $this->SingleToArray[] = $this->addrFormat($toaddr); + } + } + } elseif (count($this->to) > 0) { + if ('mail' !== $this->Mailer) { + $result .= $this->addrAppend('To', $this->to); + } + } elseif (count($this->cc) === 0) { + $result .= $this->headerLine('To', 'undisclosed-recipients:;'); + } + + $result .= $this->addrAppend('From', [[trim($this->From), $this->FromName]]); + + // sendmail and mail() extract Cc from the header before sending + if (count($this->cc) > 0) { + $result .= $this->addrAppend('Cc', $this->cc); + } + + // sendmail and mail() extract Bcc from the header before sending + if (( + 'sendmail' === $this->Mailer || 'qmail' === $this->Mailer || 'mail' === $this->Mailer + ) + && count($this->bcc) > 0 + ) { + $result .= $this->addrAppend('Bcc', $this->bcc); + } + + if (count($this->ReplyTo) > 0) { + $result .= $this->addrAppend('Reply-To', $this->ReplyTo); + } + + // mail() sets the subject itself + if ('mail' !== $this->Mailer) { + $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject))); + } + + // Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 + // https://tools.ietf.org/html/rfc5322#section-3.6.4 + if ('' !== $this->MessageID && preg_match('/^<.*@.*>$/', $this->MessageID)) { + $this->lastMessageID = $this->MessageID; + } else { + $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname()); + } + $result .= $this->headerLine('Message-ID', $this->lastMessageID); + if (null !== $this->Priority) { + $result .= $this->headerLine('X-Priority', $this->Priority); + } + if ('' === $this->XMailer) { + $result .= $this->headerLine( + 'X-Mailer', + 'PHPMailer ' . self::VERSION . ' (https://github.com/PHPMailer/PHPMailer)' + ); + } else { + $myXmailer = trim($this->XMailer); + if ($myXmailer) { + $result .= $this->headerLine('X-Mailer', $myXmailer); + } + } + + if ('' !== $this->ConfirmReadingTo) { + $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>'); + } + + // Add custom headers + foreach ($this->CustomHeader as $header) { + $result .= $this->headerLine( + trim($header[0]), + $this->encodeHeader(trim($header[1])) + ); + } + if (!$this->sign_key_file) { + $result .= $this->headerLine('MIME-Version', '1.0'); + $result .= $this->getMailMIME(); + } + + return $result; + } + + /** + * Get the message MIME type headers. + * + * @return string + */ + public function getMailMIME() + { + $result = ''; + $ismultipart = true; + switch ($this->message_type) { + case 'inline': + $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); + $result .= $this->textLine(' boundary="' . $this->boundary[1] . '"'); + break; + case 'attach': + case 'inline_attach': + case 'alt_attach': + case 'alt_inline_attach': + $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_MIXED . ';'); + $result .= $this->textLine(' boundary="' . $this->boundary[1] . '"'); + break; + case 'alt': + case 'alt_inline': + $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';'); + $result .= $this->textLine(' boundary="' . $this->boundary[1] . '"'); + break; + default: + // Catches case 'plain': and case '': + $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); + $ismultipart = false; + break; + } + // RFC1341 part 5 says 7bit is assumed if not specified + if (static::ENCODING_7BIT !== $this->Encoding) { + // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE + if ($ismultipart) { + if (static::ENCODING_8BIT === $this->Encoding) { + $result .= $this->headerLine('Content-Transfer-Encoding', static::ENCODING_8BIT); + } + // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible + } else { + $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); + } + } + + if ('mail' !== $this->Mailer) { +// $result .= static::$LE; + } + + return $result; + } + + /** + * Returns the whole MIME message. + * Includes complete headers and body. + * Only valid post preSend(). + * + * @see PHPMailer::preSend() + * + * @return string + */ + public function getSentMIMEMessage() + { + return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . static::$LE . static::$LE . $this->MIMEBody; + } + + /** + * Create a unique ID to use for boundaries. + * + * @return string + */ + protected function generateId() + { + $len = 32; //32 bytes = 256 bits + $bytes = ''; + if (function_exists('random_bytes')) { + try { + $bytes = random_bytes($len); + } catch (\Exception $e) { + //Do nothing + } + } elseif (function_exists('openssl_random_pseudo_bytes')) { + /** @noinspection CryptographicallySecureRandomnessInspection */ + $bytes = openssl_random_pseudo_bytes($len); + } + if ($bytes === '') { + //We failed to produce a proper random string, so make do. + //Use a hash to force the length to the same as the other methods + $bytes = hash('sha256', uniqid((string) mt_rand(), true), true); + } + + //We don't care about messing up base64 format here, just want a random string + return str_replace(['=', '+', '/'], '', base64_encode(hash('sha256', $bytes, true))); + } + + /** + * Assemble the message body. + * Returns an empty string on failure. + * + * @throws Exception + * + * @return string The assembled message body + */ + public function createBody() + { + $body = ''; + //Create unique IDs and preset boundaries + $this->uniqueid = $this->generateId(); + $this->boundary[1] = 'b1_' . $this->uniqueid; + $this->boundary[2] = 'b2_' . $this->uniqueid; + $this->boundary[3] = 'b3_' . $this->uniqueid; + + if ($this->sign_key_file) { + $body .= $this->getMailMIME() . static::$LE; + } + + $this->setWordWrap(); + + $bodyEncoding = $this->Encoding; + $bodyCharSet = $this->CharSet; + //Can we do a 7-bit downgrade? + if (static::ENCODING_8BIT === $bodyEncoding && !$this->has8bitChars($this->Body)) { + $bodyEncoding = static::ENCODING_7BIT; + //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit + $bodyCharSet = static::CHARSET_ASCII; + } + //If lines are too long, and we're not already using an encoding that will shorten them, + //change to quoted-printable transfer encoding for the body part only + if (static::ENCODING_BASE64 !== $this->Encoding && static::hasLineLongerThanMax($this->Body)) { + $bodyEncoding = static::ENCODING_QUOTED_PRINTABLE; + } + + $altBodyEncoding = $this->Encoding; + $altBodyCharSet = $this->CharSet; + //Can we do a 7-bit downgrade? + if (static::ENCODING_8BIT === $altBodyEncoding && !$this->has8bitChars($this->AltBody)) { + $altBodyEncoding = static::ENCODING_7BIT; + //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit + $altBodyCharSet = static::CHARSET_ASCII; + } + //If lines are too long, and we're not already using an encoding that will shorten them, + //change to quoted-printable transfer encoding for the alt body part only + if (static::ENCODING_BASE64 !== $altBodyEncoding && static::hasLineLongerThanMax($this->AltBody)) { + $altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE; + } + //Use this as a preamble in all multipart message types + $mimepre = 'This is a multi-part message in MIME format.' . static::$LE; + switch ($this->message_type) { + case 'inline': + $body .= $mimepre; + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + $body .= $this->attachAll('inline', $this->boundary[1]); + break; + case 'attach': + $body .= $mimepre; + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'inline_attach': + $body .= $mimepre; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); + $body .= $this->textLine(' boundary="' . $this->boundary[2] . '";'); + $body .= $this->textLine(' type="' . static::CONTENT_TYPE_TEXT_HTML . '"'); + $body .= static::$LE; + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + $body .= $this->attachAll('inline', $this->boundary[2]); + $body .= static::$LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'alt': + $body .= $mimepre; + $body .= $this->getBoundary( + $this->boundary[1], + $altBodyCharSet, + static::CONTENT_TYPE_PLAINTEXT, + $altBodyEncoding + ); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[1], + $bodyCharSet, + static::CONTENT_TYPE_TEXT_HTML, + $bodyEncoding + ); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + if (!empty($this->Ical)) { + $method = static::ICAL_METHOD_REQUEST; + foreach (static::$IcalMethods as $imethod) { + if (stripos($this->Ical, 'METHOD:' . $imethod) !== false) { + $method = $imethod; + break; + } + } + $body .= $this->getBoundary( + $this->boundary[1], + '', + static::CONTENT_TYPE_TEXT_CALENDAR . '; method=' . $method, + '' + ); + $body .= $this->encodeString($this->Ical, $this->Encoding); + $body .= static::$LE; + } + $body .= $this->endBoundary($this->boundary[1]); + break; + case 'alt_inline': + $body .= $mimepre; + $body .= $this->getBoundary( + $this->boundary[1], + $altBodyCharSet, + static::CONTENT_TYPE_PLAINTEXT, + $altBodyEncoding + ); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= static::$LE; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); + $body .= $this->textLine(' boundary="' . $this->boundary[2] . '";'); + $body .= $this->textLine(' type="' . static::CONTENT_TYPE_TEXT_HTML . '"'); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[2], + $bodyCharSet, + static::CONTENT_TYPE_TEXT_HTML, + $bodyEncoding + ); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + $body .= $this->attachAll('inline', $this->boundary[2]); + $body .= static::$LE; + $body .= $this->endBoundary($this->boundary[1]); + break; + case 'alt_attach': + $body .= $mimepre; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';'); + $body .= $this->textLine(' boundary="' . $this->boundary[2] . '"'); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[2], + $altBodyCharSet, + static::CONTENT_TYPE_PLAINTEXT, + $altBodyEncoding + ); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[2], + $bodyCharSet, + static::CONTENT_TYPE_TEXT_HTML, + $bodyEncoding + ); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + if (!empty($this->Ical)) { + $method = static::ICAL_METHOD_REQUEST; + foreach (static::$IcalMethods as $imethod) { + if (stripos($this->Ical, 'METHOD:' . $imethod) !== false) { + $method = $imethod; + break; + } + } + $body .= $this->getBoundary( + $this->boundary[2], + '', + static::CONTENT_TYPE_TEXT_CALENDAR . '; method=' . $method, + '' + ); + $body .= $this->encodeString($this->Ical, $this->Encoding); + } + $body .= $this->endBoundary($this->boundary[2]); + $body .= static::$LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'alt_inline_attach': + $body .= $mimepre; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';'); + $body .= $this->textLine(' boundary="' . $this->boundary[2] . '"'); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[2], + $altBodyCharSet, + static::CONTENT_TYPE_PLAINTEXT, + $altBodyEncoding + ); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= static::$LE; + $body .= $this->textLine('--' . $this->boundary[2]); + $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); + $body .= $this->textLine(' boundary="' . $this->boundary[3] . '";'); + $body .= $this->textLine(' type="' . static::CONTENT_TYPE_TEXT_HTML . '"'); + $body .= static::$LE; + $body .= $this->getBoundary( + $this->boundary[3], + $bodyCharSet, + static::CONTENT_TYPE_TEXT_HTML, + $bodyEncoding + ); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= static::$LE; + $body .= $this->attachAll('inline', $this->boundary[3]); + $body .= static::$LE; + $body .= $this->endBoundary($this->boundary[2]); + $body .= static::$LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + default: + // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types + //Reset the `Encoding` property in case we changed it for line length reasons + $this->Encoding = $bodyEncoding; + $body .= $this->encodeString($this->Body, $this->Encoding); + break; + } + + if ($this->isError()) { + $body = ''; + if ($this->exceptions) { + throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL); + } + } elseif ($this->sign_key_file) { + try { + if (!defined('PKCS7_TEXT')) { + throw new Exception($this->lang('extension_missing') . 'openssl'); + } + + $file = tempnam(sys_get_temp_dir(), 'srcsign'); + $signed = tempnam(sys_get_temp_dir(), 'mailsign'); + file_put_contents($file, $body); + + //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197 + if (empty($this->sign_extracerts_file)) { + $sign = @openssl_pkcs7_sign( + $file, + $signed, + 'file://' . realpath($this->sign_cert_file), + ['file://' . realpath($this->sign_key_file), $this->sign_key_pass], + [] + ); + } else { + $sign = @openssl_pkcs7_sign( + $file, + $signed, + 'file://' . realpath($this->sign_cert_file), + ['file://' . realpath($this->sign_key_file), $this->sign_key_pass], + [], + PKCS7_DETACHED, + $this->sign_extracerts_file + ); + } + + @unlink($file); + if ($sign) { + $body = file_get_contents($signed); + @unlink($signed); + //The message returned by openssl contains both headers and body, so need to split them up + $parts = explode("\n\n", $body, 2); + $this->MIMEHeader .= $parts[0] . static::$LE . static::$LE; + $body = $parts[1]; + } else { + @unlink($signed); + throw new Exception($this->lang('signing') . openssl_error_string()); + } + } catch (Exception $exc) { + $body = ''; + if ($this->exceptions) { + throw $exc; + } + } + } + + return $body; + } + + /** + * Return the start of a message boundary. + * + * @param string $boundary + * @param string $charSet + * @param string $contentType + * @param string $encoding + * + * @return string + */ + protected function getBoundary($boundary, $charSet, $contentType, $encoding) + { + $result = ''; + if ('' === $charSet) { + $charSet = $this->CharSet; + } + if ('' === $contentType) { + $contentType = $this->ContentType; + } + if ('' === $encoding) { + $encoding = $this->Encoding; + } + $result .= $this->textLine('--' . $boundary); + $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); + $result .= static::$LE; + // RFC1341 part 5 says 7bit is assumed if not specified + if (static::ENCODING_7BIT !== $encoding) { + $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); + } + $result .= static::$LE; + + return $result; + } + + /** + * Return the end of a message boundary. + * + * @param string $boundary + * + * @return string + */ + protected function endBoundary($boundary) + { + return static::$LE . '--' . $boundary . '--' . static::$LE; + } + + /** + * Set the message type. + * PHPMailer only supports some preset message types, not arbitrary MIME structures. + */ + protected function setMessageType() + { + $type = []; + if ($this->alternativeExists()) { + $type[] = 'alt'; + } + if ($this->inlineImageExists()) { + $type[] = 'inline'; + } + if ($this->attachmentExists()) { + $type[] = 'attach'; + } + $this->message_type = implode('_', $type); + if ('' === $this->message_type) { + //The 'plain' message_type refers to the message having a single body element, not that it is plain-text + $this->message_type = 'plain'; + } + } + + /** + * Format a header line. + * + * @param string $name + * @param string|int $value + * + * @return string + */ + public function headerLine($name, $value) + { + return $name . ': ' . $value . static::$LE; + } + + /** + * Return a formatted mail line. + * + * @param string $value + * + * @return string + */ + public function textLine($value) + { + return $value . static::$LE; + } + + /** + * Add an attachment from a path on the filesystem. + * Never use a user-supplied path to a file! + * Returns false if the file could not be found or read. + * Explicitly *does not* support passing URLs; PHPMailer is not an HTTP client. + * If you need to do that, fetch the resource yourself and pass it in via a local file or string. + * + * @param string $path Path to the attachment + * @param string $name Overrides the attachment name + * @param string $encoding File encoding (see $Encoding) + * @param string $type File extension (MIME) type + * @param string $disposition Disposition to use + * + * @throws Exception + * + * @return bool + */ + public function addAttachment( + $path, + $name = '', + $encoding = self::ENCODING_BASE64, + $type = '', + $disposition = 'attachment' + ) { + try { + if (!static::isPermittedPath($path) || !@is_file($path)) { + throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); + } + + // If a MIME type is not specified, try to work it out from the file name + if ('' === $type) { + $type = static::filenameToType($path); + } + + $filename = (string) static::mb_pathinfo($path, PATHINFO_BASENAME); + if ('' === $name) { + $name = $filename; + } + + if (!$this->validateEncoding($encoding)) { + throw new Exception($this->lang('encoding') . $encoding); + } + + $this->attachment[] = [ + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, // isStringAttachment + 6 => $disposition, + 7 => $name, + ]; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + + return true; + } + + /** + * Return the array of attachments. + * + * @return array + */ + public function getAttachments() + { + return $this->attachment; + } + + /** + * Attach all file, string, and binary attachments to the message. + * Returns an empty string on failure. + * + * @param string $disposition_type + * @param string $boundary + * + * @throws Exception + * + * @return string + */ + protected function attachAll($disposition_type, $boundary) + { + // Return text of body + $mime = []; + $cidUniq = []; + $incl = []; + + // Add all attachments + foreach ($this->attachment as $attachment) { + // Check if it is a valid disposition_filter + if ($attachment[6] === $disposition_type) { + // Check for string attachment + $string = ''; + $path = ''; + $bString = $attachment[5]; + if ($bString) { + $string = $attachment[0]; + } else { + $path = $attachment[0]; + } + + $inclhash = hash('sha256', serialize($attachment)); + if (in_array($inclhash, $incl, true)) { + continue; + } + $incl[] = $inclhash; + $name = $attachment[2]; + $encoding = $attachment[3]; + $type = $attachment[4]; + $disposition = $attachment[6]; + $cid = $attachment[7]; + if ('inline' === $disposition && array_key_exists($cid, $cidUniq)) { + continue; + } + $cidUniq[$cid] = true; + + $mime[] = sprintf('--%s%s', $boundary, static::$LE); + //Only include a filename property if we have one + if (!empty($name)) { + $mime[] = sprintf( + 'Content-Type: %s; name="%s"%s', + $type, + $this->encodeHeader($this->secureHeader($name)), + static::$LE + ); + } else { + $mime[] = sprintf( + 'Content-Type: %s%s', + $type, + static::$LE + ); + } + // RFC1341 part 5 says 7bit is assumed if not specified + if (static::ENCODING_7BIT !== $encoding) { + $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, static::$LE); + } + + //Only set Content-IDs on inline attachments + if ((string) $cid !== '' && $disposition === 'inline') { + $mime[] = 'Content-ID: <' . $this->encodeHeader($this->secureHeader($cid)) . '>' . static::$LE; + } + + // If a filename contains any of these chars, it should be quoted, + // but not otherwise: RFC2183 & RFC2045 5.1 + // Fixes a warning in IETF's msglint MIME checker + // Allow for bypassing the Content-Disposition header totally + if (!empty($disposition)) { + $encoded_name = $this->encodeHeader($this->secureHeader($name)); + if (preg_match('/[ ()<>@,;:"\/\[\]?=]/', $encoded_name)) { + $mime[] = sprintf( + 'Content-Disposition: %s; filename="%s"%s', + $disposition, + $encoded_name, + static::$LE . static::$LE + ); + } elseif (!empty($encoded_name)) { + $mime[] = sprintf( + 'Content-Disposition: %s; filename=%s%s', + $disposition, + $encoded_name, + static::$LE . static::$LE + ); + } else { + $mime[] = sprintf( + 'Content-Disposition: %s%s', + $disposition, + static::$LE . static::$LE + ); + } + } else { + $mime[] = static::$LE; + } + + // Encode as string attachment + if ($bString) { + $mime[] = $this->encodeString($string, $encoding); + } else { + $mime[] = $this->encodeFile($path, $encoding); + } + if ($this->isError()) { + return ''; + } + $mime[] = static::$LE; + } + } + + $mime[] = sprintf('--%s--%s', $boundary, static::$LE); + + return implode('', $mime); + } + + /** + * Encode a file attachment in requested format. + * Returns an empty string on failure. + * + * @param string $path The full path to the file + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * + * @return string + */ + protected function encodeFile($path, $encoding = self::ENCODING_BASE64) + { + try { + if (!static::isPermittedPath($path) || !file_exists($path)) { + throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); + } + $file_buffer = file_get_contents($path); + if (false === $file_buffer) { + throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); + } + $file_buffer = $this->encodeString($file_buffer, $encoding); + + return $file_buffer; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + + return ''; + } + } + + /** + * Encode a string in requested format. + * Returns an empty string on failure. + * + * @param string $str The text to encode + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * + * @throws Exception + * + * @return string + */ + public function encodeString($str, $encoding = self::ENCODING_BASE64) + { + $encoded = ''; + switch (strtolower($encoding)) { + case static::ENCODING_BASE64: + $encoded = chunk_split( + base64_encode($str), + static::STD_LINE_LENGTH, + static::$LE + ); + break; + case static::ENCODING_7BIT: + case static::ENCODING_8BIT: + $encoded = static::normalizeBreaks($str); + // Make sure it ends with a line break + if (substr($encoded, -(strlen(static::$LE))) !== static::$LE) { + $encoded .= static::$LE; + } + break; + case static::ENCODING_BINARY: + $encoded = $str; + break; + case static::ENCODING_QUOTED_PRINTABLE: + $encoded = $this->encodeQP($str); + break; + default: + $this->setError($this->lang('encoding') . $encoding); + if ($this->exceptions) { + throw new Exception($this->lang('encoding') . $encoding); + } + break; + } + + return $encoded; + } + + /** + * Encode a header value (not including its label) optimally. + * Picks shortest of Q, B, or none. Result includes folding if needed. + * See RFC822 definitions for phrase, comment and text positions. + * + * @param string $str The header value to encode + * @param string $position What context the string will be used in + * + * @return string + */ + public function encodeHeader($str, $position = 'text') + { + $matchcount = 0; + switch (strtolower($position)) { + case 'phrase': + if (!preg_match('/[\200-\377]/', $str)) { + // Can't use addslashes as we don't know the value of magic_quotes_sybase + $encoded = addcslashes($str, "\0..\37\177\\\""); + if (($str === $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { + return $encoded; + } + + return "\"$encoded\""; + } + $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); + break; + /* @noinspection PhpMissingBreakStatementInspection */ + case 'comment': + $matchcount = preg_match_all('/[()"]/', $str, $matches); + //fallthrough + case 'text': + default: + $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); + break; + } + + if ($this->has8bitChars($str)) { + $charset = $this->CharSet; + } else { + $charset = static::CHARSET_ASCII; + } + + // Q/B encoding adds 8 chars and the charset ("` =??[QB]??=`"). + $overhead = 8 + strlen($charset); + + if ('mail' === $this->Mailer) { + $maxlen = static::MAIL_MAX_LINE_LENGTH - $overhead; + } else { + $maxlen = static::MAX_LINE_LENGTH - $overhead; + } + + // Select the encoding that produces the shortest output and/or prevents corruption. + if ($matchcount > strlen($str) / 3) { + // More than 1/3 of the content needs encoding, use B-encode. + $encoding = 'B'; + } elseif ($matchcount > 0) { + // Less than 1/3 of the content needs encoding, use Q-encode. + $encoding = 'Q'; + } elseif (strlen($str) > $maxlen) { + // No encoding needed, but value exceeds max line length, use Q-encode to prevent corruption. + $encoding = 'Q'; + } else { + // No reformatting needed + $encoding = false; + } + + switch ($encoding) { + case 'B': + if ($this->hasMultiBytes($str)) { + // Use a custom function which correctly encodes and wraps long + // multibyte strings without breaking lines within a character + $encoded = $this->base64EncodeWrapMB($str, "\n"); + } else { + $encoded = base64_encode($str); + $maxlen -= $maxlen % 4; + $encoded = trim(chunk_split($encoded, $maxlen, "\n")); + } + $encoded = preg_replace('/^(.*)$/m', ' =?' . $charset . "?$encoding?\\1?=", $encoded); + break; + case 'Q': + $encoded = $this->encodeQ($str, $position); + $encoded = $this->wrapText($encoded, $maxlen, true); + $encoded = str_replace('=' . static::$LE, "\n", trim($encoded)); + $encoded = preg_replace('/^(.*)$/m', ' =?' . $charset . "?$encoding?\\1?=", $encoded); + break; + default: + return $str; + } + + return trim(static::normalizeBreaks($encoded)); + } + + /** + * Check if a string contains multi-byte characters. + * + * @param string $str multi-byte text to wrap encode + * + * @return bool + */ + public function hasMultiBytes($str) + { + if (function_exists('mb_strlen')) { + return strlen($str) > mb_strlen($str, $this->CharSet); + } + + // Assume no multibytes (we can't handle without mbstring functions anyway) + return false; + } + + /** + * Does a string contain any 8-bit chars (in any charset)? + * + * @param string $text + * + * @return bool + */ + public function has8bitChars($text) + { + return (bool) preg_match('/[\x80-\xFF]/', $text); + } + + /** + * Encode and wrap long multibyte strings for mail headers + * without breaking lines within a character. + * Adapted from a function by paravoid. + * + * @see http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 + * + * @param string $str multi-byte text to wrap encode + * @param string $linebreak string to use as linefeed/end-of-line + * + * @return string + */ + public function base64EncodeWrapMB($str, $linebreak = null) + { + $start = '=?' . $this->CharSet . '?B?'; + $end = '?='; + $encoded = ''; + if (null === $linebreak) { + $linebreak = static::$LE; + } + + $mb_length = mb_strlen($str, $this->CharSet); + // Each line must have length <= 75, including $start and $end + $length = 75 - strlen($start) - strlen($end); + // Average multi-byte ratio + $ratio = $mb_length / strlen($str); + // Base64 has a 4:3 ratio + $avgLength = floor($length * $ratio * .75); + + $offset = 0; + for ($i = 0; $i < $mb_length; $i += $offset) { + $lookBack = 0; + do { + $offset = $avgLength - $lookBack; + $chunk = mb_substr($str, $i, $offset, $this->CharSet); + $chunk = base64_encode($chunk); + ++$lookBack; + } while (strlen($chunk) > $length); + $encoded .= $chunk . $linebreak; + } + + // Chomp the last linefeed + return substr($encoded, 0, -strlen($linebreak)); + } + + /** + * Encode a string in quoted-printable format. + * According to RFC2045 section 6.7. + * + * @param string $string The text to encode + * + * @return string + */ + public function encodeQP($string) + { + return static::normalizeBreaks(quoted_printable_encode($string)); + } + + /** + * Encode a string using Q encoding. + * + * @see http://tools.ietf.org/html/rfc2047#section-4.2 + * + * @param string $str the text to encode + * @param string $position Where the text is going to be used, see the RFC for what that means + * + * @return string + */ + public function encodeQ($str, $position = 'text') + { + // There should not be any EOL in the string + $pattern = ''; + $encoded = str_replace(["\r", "\n"], '', $str); + switch (strtolower($position)) { + case 'phrase': + // RFC 2047 section 5.3 + $pattern = '^A-Za-z0-9!*+\/ -'; + break; + /* + * RFC 2047 section 5.2. + * Build $pattern without including delimiters and [] + */ + /* @noinspection PhpMissingBreakStatementInspection */ + case 'comment': + $pattern = '\(\)"'; + /* Intentional fall through */ + case 'text': + default: + // RFC 2047 section 5.1 + // Replace every high ascii, control, =, ? and _ characters + $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; + break; + } + $matches = []; + if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { + // If the string contains an '=', make sure it's the first thing we replace + // so as to avoid double-encoding + $eqkey = array_search('=', $matches[0], true); + if (false !== $eqkey) { + unset($matches[0][$eqkey]); + array_unshift($matches[0], '='); + } + foreach (array_unique($matches[0]) as $char) { + $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); + } + } + // Replace spaces with _ (more readable than =20) + // RFC 2047 section 4.2(2) + return str_replace(' ', '_', $encoded); + } + + /** + * Add a string or binary attachment (non-filesystem). + * This method can be used to attach ascii or binary data, + * such as a BLOB record from a database. + * + * @param string $string String attachment data + * @param string $filename Name of the attachment + * @param string $encoding File encoding (see $Encoding) + * @param string $type File extension (MIME) type + * @param string $disposition Disposition to use + * + * @throws Exception + * + * @return bool True on successfully adding an attachment + */ + public function addStringAttachment( + $string, + $filename, + $encoding = self::ENCODING_BASE64, + $type = '', + $disposition = 'attachment' + ) { + try { + // If a MIME type is not specified, try to work it out from the file name + if ('' === $type) { + $type = static::filenameToType($filename); + } + + if (!$this->validateEncoding($encoding)) { + throw new Exception($this->lang('encoding') . $encoding); + } + + // Append to $attachment array + $this->attachment[] = [ + 0 => $string, + 1 => $filename, + 2 => static::mb_pathinfo($filename, PATHINFO_BASENAME), + 3 => $encoding, + 4 => $type, + 5 => true, // isStringAttachment + 6 => $disposition, + 7 => 0, + ]; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + + return true; + } + + /** + * Add an embedded (inline) attachment from a file. + * This can include images, sounds, and just about any other document type. + * These differ from 'regular' attachments in that they are intended to be + * displayed inline with the message, not just attached for download. + * This is used in HTML messages that embed the images + * the HTML refers to using the $cid value. + * Never use a user-supplied path to a file! + * + * @param string $path Path to the attachment + * @param string $cid Content ID of the attachment; Use this to reference + * the content when using an embedded image in HTML + * @param string $name Overrides the attachment name + * @param string $encoding File encoding (see $Encoding) + * @param string $type File MIME type + * @param string $disposition Disposition to use + * + * @throws Exception + * + * @return bool True on successfully adding an attachment + */ + public function addEmbeddedImage( + $path, + $cid, + $name = '', + $encoding = self::ENCODING_BASE64, + $type = '', + $disposition = 'inline' + ) { + try { + if (!static::isPermittedPath($path) || !@is_file($path)) { + throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); + } + + // If a MIME type is not specified, try to work it out from the file name + if ('' === $type) { + $type = static::filenameToType($path); + } + + if (!$this->validateEncoding($encoding)) { + throw new Exception($this->lang('encoding') . $encoding); + } + + $filename = (string) static::mb_pathinfo($path, PATHINFO_BASENAME); + if ('' === $name) { + $name = $filename; + } + + // Append to $attachment array + $this->attachment[] = [ + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, // isStringAttachment + 6 => $disposition, + 7 => $cid, + ]; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + + return true; + } + + /** + * Add an embedded stringified attachment. + * This can include images, sounds, and just about any other document type. + * If your filename doesn't contain an extension, be sure to set the $type to an appropriate MIME type. + * + * @param string $string The attachment binary data + * @param string $cid Content ID of the attachment; Use this to reference + * the content when using an embedded image in HTML + * @param string $name A filename for the attachment. If this contains an extension, + * PHPMailer will attempt to set a MIME type for the attachment. + * For example 'file.jpg' would get an 'image/jpeg' MIME type. + * @param string $encoding File encoding (see $Encoding), defaults to 'base64' + * @param string $type MIME type - will be used in preference to any automatically derived type + * @param string $disposition Disposition to use + * + * @throws Exception + * + * @return bool True on successfully adding an attachment + */ + public function addStringEmbeddedImage( + $string, + $cid, + $name = '', + $encoding = self::ENCODING_BASE64, + $type = '', + $disposition = 'inline' + ) { + try { + // If a MIME type is not specified, try to work it out from the name + if ('' === $type && !empty($name)) { + $type = static::filenameToType($name); + } + + if (!$this->validateEncoding($encoding)) { + throw new Exception($this->lang('encoding') . $encoding); + } + + // Append to $attachment array + $this->attachment[] = [ + 0 => $string, + 1 => $name, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => true, // isStringAttachment + 6 => $disposition, + 7 => $cid, + ]; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + + return false; + } + + return true; + } + + /** + * Validate encodings. + * + * @param string $encoding + * + * @return bool + */ + protected function validateEncoding($encoding) + { + return in_array( + $encoding, + [ + self::ENCODING_7BIT, + self::ENCODING_QUOTED_PRINTABLE, + self::ENCODING_BASE64, + self::ENCODING_8BIT, + self::ENCODING_BINARY, + ], + true + ); + } + + /** + * Check if an embedded attachment is present with this cid. + * + * @param string $cid + * + * @return bool + */ + protected function cidExists($cid) + { + foreach ($this->attachment as $attachment) { + if ('inline' === $attachment[6] && $cid === $attachment[7]) { + return true; + } + } + + return false; + } + + /** + * Check if an inline attachment is present. + * + * @return bool + */ + public function inlineImageExists() + { + foreach ($this->attachment as $attachment) { + if ('inline' === $attachment[6]) { + return true; + } + } + + return false; + } + + /** + * Check if an attachment (non-inline) is present. + * + * @return bool + */ + public function attachmentExists() + { + foreach ($this->attachment as $attachment) { + if ('attachment' === $attachment[6]) { + return true; + } + } + + return false; + } + + /** + * Check if this message has an alternative body set. + * + * @return bool + */ + public function alternativeExists() + { + return !empty($this->AltBody); + } + + /** + * Clear queued addresses of given kind. + * + * @param string $kind 'to', 'cc', or 'bcc' + */ + public function clearQueuedAddresses($kind) + { + $this->RecipientsQueue = array_filter( + $this->RecipientsQueue, + static function ($params) use ($kind) { + return $params[0] !== $kind; + } + ); + } + + /** + * Clear all To recipients. + */ + public function clearAddresses() + { + foreach ($this->to as $to) { + unset($this->all_recipients[strtolower($to[0])]); + } + $this->to = []; + $this->clearQueuedAddresses('to'); + } + + /** + * Clear all CC recipients. + */ + public function clearCCs() + { + foreach ($this->cc as $cc) { + unset($this->all_recipients[strtolower($cc[0])]); + } + $this->cc = []; + $this->clearQueuedAddresses('cc'); + } + + /** + * Clear all BCC recipients. + */ + public function clearBCCs() + { + foreach ($this->bcc as $bcc) { + unset($this->all_recipients[strtolower($bcc[0])]); + } + $this->bcc = []; + $this->clearQueuedAddresses('bcc'); + } + + /** + * Clear all ReplyTo recipients. + */ + public function clearReplyTos() + { + $this->ReplyTo = []; + $this->ReplyToQueue = []; + } + + /** + * Clear all recipient types. + */ + public function clearAllRecipients() + { + $this->to = []; + $this->cc = []; + $this->bcc = []; + $this->all_recipients = []; + $this->RecipientsQueue = []; + } + + /** + * Clear all filesystem, string, and binary attachments. + */ + public function clearAttachments() + { + $this->attachment = []; + } + + /** + * Clear all custom headers. + */ + public function clearCustomHeaders() + { + $this->CustomHeader = []; + } + + /** + * Add an error message to the error container. + * + * @param string $msg + */ + protected function setError($msg) + { + ++$this->error_count; + if ('smtp' === $this->Mailer && null !== $this->smtp) { + $lasterror = $this->smtp->getError(); + if (!empty($lasterror['error'])) { + $msg .= $this->lang('smtp_error') . $lasterror['error']; + if (!empty($lasterror['detail'])) { + $msg .= ' Detail: ' . $lasterror['detail']; + } + if (!empty($lasterror['smtp_code'])) { + $msg .= ' SMTP code: ' . $lasterror['smtp_code']; + } + if (!empty($lasterror['smtp_code_ex'])) { + $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex']; + } + } + } + $this->ErrorInfo = $msg; + } + + /** + * Return an RFC 822 formatted date. + * + * @return string + */ + public static function rfcDate() + { + // Set the time zone to whatever the default is to avoid 500 errors + // Will default to UTC if it's not set properly in php.ini + date_default_timezone_set(@date_default_timezone_get()); + + return date('D, j M Y H:i:s O'); + } + + /** + * Get the server hostname. + * Returns 'localhost.localdomain' if unknown. + * + * @return string + */ + protected function serverHostname() + { + $result = ''; + if (!empty($this->Hostname)) { + $result = $this->Hostname; + } elseif (isset($_SERVER) && array_key_exists('SERVER_NAME', $_SERVER)) { + $result = $_SERVER['SERVER_NAME']; + } elseif (function_exists('gethostname') && gethostname() !== false) { + $result = gethostname(); + } elseif (php_uname('n') !== false) { + $result = php_uname('n'); + } + if (!static::isValidHost($result)) { + return 'localhost.localdomain'; + } + + return $result; + } + + /** + * Validate whether a string contains a valid value to use as a hostname or IP address. + * IPv6 addresses must include [], e.g. `[::1]`, not just `::1`. + * + * @param string $host The host name or IP address to check + * + * @return bool + */ + public static function isValidHost($host) + { + //Simple syntax limits + if (empty($host) + || !is_string($host) + || strlen($host) > 256 + || !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+])$/', $host) + ) { + return false; + } + //Looks like a bracketed IPv6 address + if (strlen($host) > 2 && substr($host, 0, 1) === '[' && substr($host, -1, 1) === ']') { + return filter_var(substr($host, 1, -1), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false; + } + //If removing all the dots results in a numeric string, it must be an IPv4 address. + //Need to check this first because otherwise things like `999.0.0.0` are considered valid host names + if (is_numeric(str_replace('.', '', $host))) { + //Is it a valid IPv4 address? + return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false; + } + if (filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false) { + //Is it a syntactically valid hostname? + return true; + } + + return false; + } + + /** + * Get an error message in the current language. + * + * @param string $key + * + * @return string + */ + protected function lang($key) + { + if (count($this->language) < 1) { + $this->setLanguage(); // set the default language + } + + if (array_key_exists($key, $this->language)) { + if ('smtp_connect_failed' === $key) { + //Include a link to troubleshooting docs on SMTP connection failure + //this is by far the biggest cause of support questions + //but it's usually not PHPMailer's fault. + return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; + } + + return $this->language[$key]; + } + + //Return the key as a fallback + return $key; + } + + /** + * Check if an error occurred. + * + * @return bool True if an error did occur + */ + public function isError() + { + return $this->error_count > 0; + } + + /** + * Add a custom header. + * $name value can be overloaded to contain + * both header name and value (name:value). + * + * @param string $name Custom header name + * @param string|null $value Header value + */ + public function addCustomHeader($name, $value = null) + { + if (null === $value) { + // Value passed in as name:value + $this->CustomHeader[] = explode(':', $name, 2); + } else { + $this->CustomHeader[] = [$name, $value]; + } + } + + /** + * Returns all custom headers. + * + * @return array + */ + public function getCustomHeaders() + { + return $this->CustomHeader; + } + + /** + * Create a message body from an HTML string. + * Automatically inlines images and creates a plain-text version by converting the HTML, + * overwriting any existing values in Body and AltBody. + * Do not source $message content from user input! + * $basedir is prepended when handling relative URLs, e.g. and must not be empty + * will look for an image file in $basedir/images/a.png and convert it to inline. + * If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email) + * Converts data-uri images into embedded attachments. + * If you don't want to apply these transformations to your HTML, just set Body and AltBody directly. + * + * @param string $message HTML message string + * @param string $basedir Absolute path to a base directory to prepend to relative paths to images + * @param bool|callable $advanced Whether to use the internal HTML to text converter + * or your own custom converter @return string $message The transformed message Body + * + * @throws Exception + * + * @see PHPMailer::html2text() + */ + public function msgHTML($message, $basedir = '', $advanced = false) + { + preg_match_all('/(? 1 && '/' !== substr($basedir, -1)) { + // Ensure $basedir has a trailing / + $basedir .= '/'; + } + foreach ($images[2] as $imgindex => $url) { + // Convert data URIs into embedded images + //e.g. "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" + if (preg_match('#^data:(image/(?:jpe?g|gif|png));?(base64)?,(.+)#', $url, $match)) { + if (count($match) === 4 && static::ENCODING_BASE64 === $match[2]) { + $data = base64_decode($match[3]); + } elseif ('' === $match[2]) { + $data = rawurldecode($match[3]); + } else { + //Not recognised so leave it alone + continue; + } + //Hash the decoded data, not the URL, so that the same data-URI image used in multiple places + //will only be embedded once, even if it used a different encoding + $cid = substr(hash('sha256', $data), 0, 32) . '@phpmailer.0'; // RFC2392 S 2 + + if (!$this->cidExists($cid)) { + $this->addStringEmbeddedImage( + $data, + $cid, + 'embed' . $imgindex, + static::ENCODING_BASE64, + $match[1] + ); + } + $message = str_replace( + $images[0][$imgindex], + $images[1][$imgindex] . '="cid:' . $cid . '"', + $message + ); + continue; + } + if (// Only process relative URLs if a basedir is provided (i.e. no absolute local paths) + !empty($basedir) + // Ignore URLs containing parent dir traversal (..) + && (strpos($url, '..') === false) + // Do not change urls that are already inline images + && 0 !== strpos($url, 'cid:') + // Do not change absolute URLs, including anonymous protocol + && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url) + ) { + $filename = static::mb_pathinfo($url, PATHINFO_BASENAME); + $directory = dirname($url); + if ('.' === $directory) { + $directory = ''; + } + // RFC2392 S 2 + $cid = substr(hash('sha256', $url), 0, 32) . '@phpmailer.0'; + if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) { + $basedir .= '/'; + } + if (strlen($directory) > 1 && '/' !== substr($directory, -1)) { + $directory .= '/'; + } + if ($this->addEmbeddedImage( + $basedir . $directory . $filename, + $cid, + $filename, + static::ENCODING_BASE64, + static::_mime_types((string) static::mb_pathinfo($filename, PATHINFO_EXTENSION)) + ) + ) { + $message = preg_replace( + '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', + $images[1][$imgindex] . '="cid:' . $cid . '"', + $message + ); + } + } + } + } + $this->isHTML(); + // Convert all message body line breaks to LE, makes quoted-printable encoding work much better + $this->Body = static::normalizeBreaks($message); + $this->AltBody = static::normalizeBreaks($this->html2text($message, $advanced)); + if (!$this->alternativeExists()) { + $this->AltBody = 'This is an HTML-only message. To view it, activate HTML in your email application.' + . static::$LE; + } + + return $this->Body; + } + + /** + * Convert an HTML string into plain text. + * This is used by msgHTML(). + * Note - older versions of this function used a bundled advanced converter + * which was removed for license reasons in #232. + * Example usage: + * + * ```php + * // Use default conversion + * $plain = $mail->html2text($html); + * // Use your own custom converter + * $plain = $mail->html2text($html, function($html) { + * $converter = new MyHtml2text($html); + * return $converter->get_text(); + * }); + * ``` + * + * @param string $html The HTML text to convert + * @param bool|callable $advanced Any boolean value to use the internal converter, + * or provide your own callable for custom conversion + * + * @return string + */ + public function html2text($html, $advanced = false) + { + if (is_callable($advanced)) { + return $advanced($html); + } + + return html_entity_decode( + trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), + ENT_QUOTES, + $this->CharSet + ); + } + + /** + * Get the MIME type for a file extension. + * + * @param string $ext File extension + * + * @return string MIME type of file + */ + public static function _mime_types($ext = '') + { + $mimes = [ + 'xl' => 'application/excel', + 'js' => 'application/javascript', + 'hqx' => 'application/mac-binhex40', + 'cpt' => 'application/mac-compactpro', + 'bin' => 'application/macbinary', + 'doc' => 'application/msword', + 'word' => 'application/msword', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'class' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'dms' => 'application/octet-stream', + 'exe' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'psd' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'so' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => 'application/pdf', + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => 'application/vnd.ms-excel', + 'ppt' => 'application/vnd.ms-powerpoint', + 'wbxml' => 'application/vnd.wap.wbxml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'gtar' => 'application/x-gtar', + 'php3' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'php' => 'application/x-httpd-php', + 'phtml' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => 'application/x-tar', + 'xht' => 'application/xhtml+xml', + 'xhtml' => 'application/xhtml+xml', + 'zip' => 'application/zip', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mp2' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'm4a' => 'audio/mp4', + 'mpga' => 'audio/mpeg', + 'aif' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'wav' => 'audio/x-wav', + 'mka' => 'audio/x-matroska', + 'bmp' => 'image/bmp', + 'gif' => 'image/gif', + 'jpeg' => 'image/jpeg', + 'jpe' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'png' => 'image/png', + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'webp' => 'image/webp', + 'heif' => 'image/heif', + 'heifs' => 'image/heif-sequence', + 'heic' => 'image/heic', + 'heics' => 'image/heic-sequence', + 'eml' => 'message/rfc822', + 'css' => 'text/css', + 'html' => 'text/html', + 'htm' => 'text/html', + 'shtml' => 'text/html', + 'log' => 'text/plain', + 'text' => 'text/plain', + 'txt' => 'text/plain', + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'vcf' => 'text/vcard', + 'vcard' => 'text/vcard', + 'ics' => 'text/calendar', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'wmv' => 'video/x-ms-wmv', + 'mpeg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mp4' => 'video/mp4', + 'm4v' => 'video/mp4', + 'mov' => 'video/quicktime', + 'qt' => 'video/quicktime', + 'rv' => 'video/vnd.rn-realvideo', + 'avi' => 'video/x-msvideo', + 'movie' => 'video/x-sgi-movie', + 'webm' => 'video/webm', + 'mkv' => 'video/x-matroska', + ]; + $ext = strtolower($ext); + if (array_key_exists($ext, $mimes)) { + return $mimes[$ext]; + } + + return 'application/octet-stream'; + } + + /** + * Map a file name to a MIME type. + * Defaults to 'application/octet-stream', i.e.. arbitrary binary data. + * + * @param string $filename A file name or full path, does not need to exist as a file + * + * @return string + */ + public static function filenameToType($filename) + { + // In case the path is a URL, strip any query string before getting extension + $qpos = strpos($filename, '?'); + if (false !== $qpos) { + $filename = substr($filename, 0, $qpos); + } + $ext = static::mb_pathinfo($filename, PATHINFO_EXTENSION); + + return static::_mime_types($ext); + } + + /** + * Multi-byte-safe pathinfo replacement. + * Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe. + * + * @see http://www.php.net/manual/en/function.pathinfo.php#107461 + * + * @param string $path A filename or path, does not need to exist as a file + * @param int|string $options Either a PATHINFO_* constant, + * or a string name to return only the specified piece + * + * @return string|array + */ + public static function mb_pathinfo($path, $options = null) + { + $ret = ['dirname' => '', 'basename' => '', 'extension' => '', 'filename' => '']; + $pathinfo = []; + if (preg_match('#^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^.\\\\/]+?)|))[\\\\/.]*$#m', $path, $pathinfo)) { + if (array_key_exists(1, $pathinfo)) { + $ret['dirname'] = $pathinfo[1]; + } + if (array_key_exists(2, $pathinfo)) { + $ret['basename'] = $pathinfo[2]; + } + if (array_key_exists(5, $pathinfo)) { + $ret['extension'] = $pathinfo[5]; + } + if (array_key_exists(3, $pathinfo)) { + $ret['filename'] = $pathinfo[3]; + } + } + switch ($options) { + case PATHINFO_DIRNAME: + case 'dirname': + return $ret['dirname']; + case PATHINFO_BASENAME: + case 'basename': + return $ret['basename']; + case PATHINFO_EXTENSION: + case 'extension': + return $ret['extension']; + case PATHINFO_FILENAME: + case 'filename': + return $ret['filename']; + default: + return $ret; + } + } + + /** + * Set or reset instance properties. + * You should avoid this function - it's more verbose, less efficient, more error-prone and + * harder to debug than setting properties directly. + * Usage Example: + * `$mail->set('SMTPSecure', static::ENCRYPTION_STARTTLS);` + * is the same as: + * `$mail->SMTPSecure = static::ENCRYPTION_STARTTLS;`. + * + * @param string $name The property name to set + * @param mixed $value The value to set the property to + * + * @return bool + */ + public function set($name, $value = '') + { + if (property_exists($this, $name)) { + $this->$name = $value; + + return true; + } + $this->setError($this->lang('variable_set') . $name); + + return false; + } + + /** + * Strip newlines to prevent header injection. + * + * @param string $str + * + * @return string + */ + public function secureHeader($str) + { + return trim(str_replace(["\r", "\n"], '', $str)); + } + + /** + * Normalize line breaks in a string. + * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. + * Defaults to CRLF (for message bodies) and preserves consecutive breaks. + * + * @param string $text + * @param string $breaktype What kind of line break to use; defaults to static::$LE + * + * @return string + */ + public static function normalizeBreaks($text, $breaktype = null) + { + if (null === $breaktype) { + $breaktype = static::$LE; + } + // Normalise to \n + $text = str_replace(["\r\n", "\r"], "\n", $text); + // Now convert LE as needed + if ("\n" !== $breaktype) { + $text = str_replace("\n", $breaktype, $text); + } + + return $text; + } + + /** + * Return the current line break format string. + * + * @return string + */ + public static function getLE() + { + return static::$LE; + } + + /** + * Set the line break format string, e.g. "\r\n". + * + * @param string $le + */ + protected static function setLE($le) + { + static::$LE = $le; + } + + /** + * Set the public and private key files and password for S/MIME signing. + * + * @param string $cert_filename + * @param string $key_filename + * @param string $key_pass Password for private key + * @param string $extracerts_filename Optional path to chain certificate + */ + public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '') + { + $this->sign_cert_file = $cert_filename; + $this->sign_key_file = $key_filename; + $this->sign_key_pass = $key_pass; + $this->sign_extracerts_file = $extracerts_filename; + } + + /** + * Quoted-Printable-encode a DKIM header. + * + * @param string $txt + * + * @return string + */ + public function DKIM_QP($txt) + { + $line = ''; + $len = strlen($txt); + for ($i = 0; $i < $len; ++$i) { + $ord = ord($txt[$i]); + if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord === 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) { + $line .= $txt[$i]; + } else { + $line .= '=' . sprintf('%02X', $ord); + } + } + + return $line; + } + + /** + * Generate a DKIM signature. + * + * @param string $signHeader + * + * @throws Exception + * + * @return string The DKIM signature value + */ + public function DKIM_Sign($signHeader) + { + if (!defined('PKCS7_TEXT')) { + if ($this->exceptions) { + throw new Exception($this->lang('extension_missing') . 'openssl'); + } + + return ''; + } + $privKeyStr = !empty($this->DKIM_private_string) ? + $this->DKIM_private_string : + file_get_contents($this->DKIM_private); + if ('' !== $this->DKIM_passphrase) { + $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); + } else { + $privKey = openssl_pkey_get_private($privKeyStr); + } + if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { + openssl_pkey_free($privKey); + + return base64_encode($signature); + } + openssl_pkey_free($privKey); + + return ''; + } + + /** + * Generate a DKIM canonicalization header. + * Uses the 'relaxed' algorithm from RFC6376 section 3.4.2. + * Canonicalized headers should *always* use CRLF, regardless of mailer setting. + * + * @see https://tools.ietf.org/html/rfc6376#section-3.4.2 + * + * @param string $signHeader Header + * + * @return string + */ + public function DKIM_HeaderC($signHeader) + { + //Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]` + //@see https://tools.ietf.org/html/rfc5322#section-2.2 + //That means this may break if you do something daft like put vertical tabs in your headers. + //Unfold header lines + $signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader); + //Break headers out into an array + $lines = explode("\r\n", $signHeader); + foreach ($lines as $key => $line) { + //If the header is missing a :, skip it as it's invalid + //This is likely to happen because the explode() above will also split + //on the trailing LE, leaving an empty line + if (strpos($line, ':') === false) { + continue; + } + list($heading, $value) = explode(':', $line, 2); + //Lower-case header name + $heading = strtolower($heading); + //Collapse white space within the value, also convert WSP to space + $value = preg_replace('/[ \t]+/', ' ', $value); + //RFC6376 is slightly unclear here - it says to delete space at the *end* of each value + //But then says to delete space before and after the colon. + //Net result is the same as trimming both ends of the value. + //By elimination, the same applies to the field name + $lines[$key] = trim($heading, " \t") . ':' . trim($value, " \t"); + } + + return implode("\r\n", $lines); + } + + /** + * Generate a DKIM canonicalization body. + * Uses the 'simple' algorithm from RFC6376 section 3.4.3. + * Canonicalized bodies should *always* use CRLF, regardless of mailer setting. + * + * @see https://tools.ietf.org/html/rfc6376#section-3.4.3 + * + * @param string $body Message Body + * + * @return string + */ + public function DKIM_BodyC($body) + { + if (empty($body)) { + return "\r\n"; + } + // Normalize line endings to CRLF + $body = static::normalizeBreaks($body, "\r\n"); + + //Reduce multiple trailing line breaks to a single one + return rtrim($body, "\r\n") . "\r\n"; + } + + /** + * Create the DKIM header and body in a new message header. + * + * @param string $headers_line Header lines + * @param string $subject Subject + * @param string $body Body + * + * @throws Exception + * + * @return string + */ + public function DKIM_Add($headers_line, $subject, $body) + { + $DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms + $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization methods of header & body + $DKIMquery = 'dns/txt'; // Query method + $DKIMtime = time(); + //Always sign these headers without being asked + $autoSignHeaders = [ + 'From', + 'To', + 'CC', + 'Date', + 'Subject', + 'Reply-To', + 'Message-ID', + 'Content-Type', + 'Mime-Version', + 'X-Mailer', + ]; + if (stripos($headers_line, 'Subject') === false) { + $headers_line .= 'Subject: ' . $subject . static::$LE; + } + $headerLines = explode(static::$LE, $headers_line); + $currentHeaderLabel = ''; + $currentHeaderValue = ''; + $parsedHeaders = []; + $headerLineIndex = 0; + $headerLineCount = count($headerLines); + foreach ($headerLines as $headerLine) { + $matches = []; + if (preg_match('/^([^ \t]*?)(?::[ \t]*)(.*)$/', $headerLine, $matches)) { + if ($currentHeaderLabel !== '') { + //We were previously in another header; This is the start of a new header, so save the previous one + $parsedHeaders[] = ['label' => $currentHeaderLabel, 'value' => $currentHeaderValue]; + } + $currentHeaderLabel = $matches[1]; + $currentHeaderValue = $matches[2]; + } elseif (preg_match('/^[ \t]+(.*)$/', $headerLine, $matches)) { + //This is a folded continuation of the current header, so unfold it + $currentHeaderValue .= ' ' . $matches[1]; + } + ++$headerLineIndex; + if ($headerLineIndex >= $headerLineCount) { + //This was the last line, so finish off this header + $parsedHeaders[] = ['label' => $currentHeaderLabel, 'value' => $currentHeaderValue]; + } + } + $copiedHeaders = []; + $headersToSignKeys = []; + $headersToSign = []; + foreach ($parsedHeaders as $header) { + //Is this header one that must be included in the DKIM signature? + if (in_array($header['label'], $autoSignHeaders, true)) { + $headersToSignKeys[] = $header['label']; + $headersToSign[] = $header['label'] . ': ' . $header['value']; + if ($this->DKIM_copyHeaderFields) { + $copiedHeaders[] = $header['label'] . ':' . //Note no space after this, as per RFC + str_replace('|', '=7C', $this->DKIM_QP($header['value'])); + } + continue; + } + //Is this an extra custom header we've been asked to sign? + if (in_array($header['label'], $this->DKIM_extraHeaders, true)) { + //Find its value in custom headers + foreach ($this->CustomHeader as $customHeader) { + if ($customHeader[0] === $header['label']) { + $headersToSignKeys[] = $header['label']; + $headersToSign[] = $header['label'] . ': ' . $header['value']; + if ($this->DKIM_copyHeaderFields) { + $copiedHeaders[] = $header['label'] . ':' . //Note no space after this, as per RFC + str_replace('|', '=7C', $this->DKIM_QP($header['value'])); + } + //Skip straight to the next header + continue 2; + } + } + } + } + $copiedHeaderFields = ''; + if ($this->DKIM_copyHeaderFields && count($copiedHeaders) > 0) { + //Assemble a DKIM 'z' tag + $copiedHeaderFields = ' z='; + $first = true; + foreach ($copiedHeaders as $copiedHeader) { + if (!$first) { + $copiedHeaderFields .= static::$LE . ' |'; + } + //Fold long values + if (strlen($copiedHeader) > self::STD_LINE_LENGTH - 3) { + $copiedHeaderFields .= substr( + chunk_split($copiedHeader, self::STD_LINE_LENGTH - 3, static::$LE . ' '), + 0, + -strlen(static::$LE . ' ') + ); + } else { + $copiedHeaderFields .= $copiedHeader; + } + $first = false; + } + $copiedHeaderFields .= ';' . static::$LE; + } + $headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE; + $headerValues = implode(static::$LE, $headersToSign); + $body = $this->DKIM_BodyC($body); + $DKIMlen = strlen($body); // Length of body + $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body + $ident = ''; + if ('' !== $this->DKIM_identity) { + $ident = ' i=' . $this->DKIM_identity . ';' . static::$LE; + } + //The DKIM-Signature header is included in the signature *except for* the value of the `b` tag + //which is appended after calculating the signature + //https://tools.ietf.org/html/rfc6376#section-3.5 + $dkimSignatureHeader = 'DKIM-Signature: v=1;' . + ' d=' . $this->DKIM_domain . ';' . + ' s=' . $this->DKIM_selector . ';' . static::$LE . + ' a=' . $DKIMsignatureType . ';' . + ' q=' . $DKIMquery . ';' . + ' l=' . $DKIMlen . ';' . + ' t=' . $DKIMtime . ';' . + ' c=' . $DKIMcanonicalization . ';' . static::$LE . + $headerKeys . + $ident . + $copiedHeaderFields . + ' bh=' . $DKIMb64 . ';' . static::$LE . + ' b='; + //Canonicalize the set of headers + $canonicalizedHeaders = $this->DKIM_HeaderC( + $headerValues . static::$LE . $dkimSignatureHeader + ); + $signature = $this->DKIM_Sign($canonicalizedHeaders); + $signature = trim(chunk_split($signature, self::STD_LINE_LENGTH - 3, static::$LE . ' ')); + + return static::normalizeBreaks($dkimSignatureHeader . $signature) . static::$LE; + } + + /** + * Detect if a string contains a line longer than the maximum line length + * allowed by RFC 2822 section 2.1.1. + * + * @param string $str + * + * @return bool + */ + public static function hasLineLongerThanMax($str) + { + return (bool) preg_match('/^(.{' . (self::MAX_LINE_LENGTH + strlen(static::$LE)) . ',})/m', $str); + } + + /** + * Allows for public read access to 'to' property. + * Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * + * @return array + */ + public function getToAddresses() + { + return $this->to; + } + + /** + * Allows for public read access to 'cc' property. + * Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * + * @return array + */ + public function getCcAddresses() + { + return $this->cc; + } + + /** + * Allows for public read access to 'bcc' property. + * Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * + * @return array + */ + public function getBccAddresses() + { + return $this->bcc; + } + + /** + * Allows for public read access to 'ReplyTo' property. + * Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * + * @return array + */ + public function getReplyToAddresses() + { + return $this->ReplyTo; + } + + /** + * Allows for public read access to 'all_recipients' property. + * Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * + * @return array + */ + public function getAllRecipientAddresses() + { + return $this->all_recipients; + } + + /** + * Perform a callback. + * + * @param bool $isSent + * @param array $to + * @param array $cc + * @param array $bcc + * @param string $subject + * @param string $body + * @param string $from + * @param array $extra + */ + protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from, $extra) + { + if (!empty($this->action_function) && is_callable($this->action_function)) { + call_user_func($this->action_function, $isSent, $to, $cc, $bcc, $subject, $body, $from, $extra); + } + } + + /** + * Get the OAuth instance. + * + * @return OAuth + */ + public function getOAuth() + { + return $this->oauth; + } + + /** + * Set an OAuth instance. + */ + public function setOAuth(OAuth $oauth) + { + $this->oauth = $oauth; + } +} diff --git a/plugins/PHPMailer/src/POP3.php b/plugins/PHPMailer/src/POP3.php new file mode 100644 index 0000000..50d5f0c --- /dev/null +++ b/plugins/PHPMailer/src/POP3.php @@ -0,0 +1,419 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2019 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer POP-Before-SMTP Authentication Class. + * Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication. + * 1) This class does not support APOP authentication. + * 2) Opening and closing lots of POP3 connections can be quite slow. If you need + * to send a batch of emails then just perform the authentication once at the start, + * and then loop through your mail sending script. Providing this process doesn't + * take longer than the verification period lasts on your POP3 server, you should be fine. + * 3) This is really ancient technology; you should only need to use it to talk to very old systems. + * 4) This POP3 class is deliberately lightweight and incomplete, implementing just + * enough to do authentication. + * If you want a more complete class there are other POP3 classes for PHP available. + * + * @author Richard Davey (original author) + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + */ +class POP3 +{ + /** + * The POP3 PHPMailer Version number. + * + * @var string + */ + const VERSION = '6.1.4'; + + /** + * Default POP3 port number. + * + * @var int + */ + const DEFAULT_PORT = 110; + + /** + * Default timeout in seconds. + * + * @var int + */ + const DEFAULT_TIMEOUT = 30; + + /** + * Debug display level. + * Options: 0 = no, 1+ = yes. + * + * @var int + */ + public $do_debug = 0; + + /** + * POP3 mail server hostname. + * + * @var string + */ + public $host; + + /** + * POP3 port number. + * + * @var int + */ + public $port; + + /** + * POP3 Timeout Value in seconds. + * + * @var int + */ + public $tval; + + /** + * POP3 username. + * + * @var string + */ + public $username; + + /** + * POP3 password. + * + * @var string + */ + public $password; + + /** + * Resource handle for the POP3 connection socket. + * + * @var resource + */ + protected $pop_conn; + + /** + * Are we connected? + * + * @var bool + */ + protected $connected = false; + + /** + * Error container. + * + * @var array + */ + protected $errors = []; + + /** + * Line break constant. + */ + const LE = "\r\n"; + + /** + * Simple static wrapper for all-in-one POP before SMTP. + * + * @param string $host The hostname to connect to + * @param int|bool $port The port number to connect to + * @param int|bool $timeout The timeout value + * @param string $username + * @param string $password + * @param int $debug_level + * + * @return bool + */ + public static function popBeforeSmtp( + $host, + $port = false, + $timeout = false, + $username = '', + $password = '', + $debug_level = 0 + ) { + $pop = new self(); + + return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level); + } + + /** + * Authenticate with a POP3 server. + * A connect, login, disconnect sequence + * appropriate for POP-before SMTP authorisation. + * + * @param string $host The hostname to connect to + * @param int|bool $port The port number to connect to + * @param int|bool $timeout The timeout value + * @param string $username + * @param string $password + * @param int $debug_level + * + * @return bool + */ + public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0) + { + $this->host = $host; + // If no port value provided, use default + if (false === $port) { + $this->port = static::DEFAULT_PORT; + } else { + $this->port = (int) $port; + } + // If no timeout value provided, use default + if (false === $timeout) { + $this->tval = static::DEFAULT_TIMEOUT; + } else { + $this->tval = (int) $timeout; + } + $this->do_debug = $debug_level; + $this->username = $username; + $this->password = $password; + // Reset the error log + $this->errors = []; + // connect + $result = $this->connect($this->host, $this->port, $this->tval); + if ($result) { + $login_result = $this->login($this->username, $this->password); + if ($login_result) { + $this->disconnect(); + + return true; + } + } + // We need to disconnect regardless of whether the login succeeded + $this->disconnect(); + + return false; + } + + /** + * Connect to a POP3 server. + * + * @param string $host + * @param int|bool $port + * @param int $tval + * + * @return bool + */ + public function connect($host, $port = false, $tval = 30) + { + // Are we already connected? + if ($this->connected) { + return true; + } + + //On Windows this will raise a PHP Warning error if the hostname doesn't exist. + //Rather than suppress it with @fsockopen, capture it cleanly instead + set_error_handler([$this, 'catchWarning']); + + if (false === $port) { + $port = static::DEFAULT_PORT; + } + + // connect to the POP3 server + $this->pop_conn = fsockopen( + $host, // POP3 Host + $port, // Port # + $errno, // Error Number + $errstr, // Error Message + $tval + ); // Timeout (seconds) + // Restore the error handler + restore_error_handler(); + + // Did we connect? + if (false === $this->pop_conn) { + // It would appear not... + $this->setError( + "Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr" + ); + + return false; + } + + // Increase the stream time-out + stream_set_timeout($this->pop_conn, $tval, 0); + + // Get the POP3 server response + $pop3_response = $this->getResponse(); + // Check for the +OK + if ($this->checkResponse($pop3_response)) { + // The connection is established and the POP3 server is talking + $this->connected = true; + + return true; + } + + return false; + } + + /** + * Log in to the POP3 server. + * Does not support APOP (RFC 2828, 4949). + * + * @param string $username + * @param string $password + * + * @return bool + */ + public function login($username = '', $password = '') + { + if (!$this->connected) { + $this->setError('Not connected to POP3 server'); + } + if (empty($username)) { + $username = $this->username; + } + if (empty($password)) { + $password = $this->password; + } + + // Send the Username + $this->sendString("USER $username" . static::LE); + $pop3_response = $this->getResponse(); + if ($this->checkResponse($pop3_response)) { + // Send the Password + $this->sendString("PASS $password" . static::LE); + $pop3_response = $this->getResponse(); + if ($this->checkResponse($pop3_response)) { + return true; + } + } + + return false; + } + + /** + * Disconnect from the POP3 server. + */ + public function disconnect() + { + $this->sendString('QUIT'); + //The QUIT command may cause the daemon to exit, which will kill our connection + //So ignore errors here + try { + @fclose($this->pop_conn); + } catch (Exception $e) { + //Do nothing + } + } + + /** + * Get a response from the POP3 server. + * + * @param int $size The maximum number of bytes to retrieve + * + * @return string + */ + protected function getResponse($size = 128) + { + $response = fgets($this->pop_conn, $size); + if ($this->do_debug >= 1) { + echo 'Server -> Client: ', $response; + } + + return $response; + } + + /** + * Send raw data to the POP3 server. + * + * @param string $string + * + * @return int + */ + protected function sendString($string) + { + if ($this->pop_conn) { + if ($this->do_debug >= 2) { //Show client messages when debug >= 2 + echo 'Client -> Server: ', $string; + } + + return fwrite($this->pop_conn, $string, strlen($string)); + } + + return 0; + } + + /** + * Checks the POP3 server response. + * Looks for for +OK or -ERR. + * + * @param string $string + * + * @return bool + */ + protected function checkResponse($string) + { + if (strpos($string, '+OK') !== 0) { + $this->setError("Server reported an error: $string"); + + return false; + } + + return true; + } + + /** + * Add an error to the internal error store. + * Also display debug output if it's enabled. + * + * @param string $error + */ + protected function setError($error) + { + $this->errors[] = $error; + if ($this->do_debug >= 1) { + echo '
    ';
    +            foreach ($this->errors as $e) {
    +                print_r($e);
    +            }
    +            echo '
    '; + } + } + + /** + * Get an array of error messages, if any. + * + * @return array + */ + public function getErrors() + { + return $this->errors; + } + + /** + * POP3 connection error handler. + * + * @param int $errno + * @param string $errstr + * @param string $errfile + * @param int $errline + */ + protected function catchWarning($errno, $errstr, $errfile, $errline) + { + $this->setError( + 'Connecting to the POP3 server raised a PHP warning:' . + "errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline" + ); + } +} diff --git a/plugins/PHPMailer/src/SMTP.php b/plugins/PHPMailer/src/SMTP.php new file mode 100644 index 0000000..c693f4d --- /dev/null +++ b/plugins/PHPMailer/src/SMTP.php @@ -0,0 +1,1370 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2019 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * PHPMailer RFC821 SMTP email transport class. + * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server. + * + * @author Chris Ryan + * @author Marcus Bointon + */ +class SMTP +{ + /** + * The PHPMailer SMTP version number. + * + * @var string + */ + const VERSION = '6.1.4'; + + /** + * SMTP line break constant. + * + * @var string + */ + const LE = "\r\n"; + + /** + * The SMTP port to use if one is not specified. + * + * @var int + */ + const DEFAULT_PORT = 25; + + /** + * The maximum line length allowed by RFC 5321 section 4.5.3.1.6, + * *excluding* a trailing CRLF break. + * + * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 + * + * @var int + */ + const MAX_LINE_LENGTH = 998; + + /** + * The maximum line length allowed for replies in RFC 5321 section 4.5.3.1.5, + * *including* a trailing CRLF line break. + * + * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.5 + * + * @var int + */ + const MAX_REPLY_LENGTH = 512; + + /** + * Debug level for no output. + * + * @var int + */ + const DEBUG_OFF = 0; + + /** + * Debug level to show client -> server messages. + * + * @var int + */ + const DEBUG_CLIENT = 1; + + /** + * Debug level to show client -> server and server -> client messages. + * + * @var int + */ + const DEBUG_SERVER = 2; + + /** + * Debug level to show connection status, client -> server and server -> client messages. + * + * @var int + */ + const DEBUG_CONNECTION = 3; + + /** + * Debug level to show all messages. + * + * @var int + */ + const DEBUG_LOWLEVEL = 4; + + /** + * Debug output level. + * Options: + * * self::DEBUG_OFF (`0`) No debug output, default + * * self::DEBUG_CLIENT (`1`) Client commands + * * self::DEBUG_SERVER (`2`) Client commands and server responses + * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status + * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages. + * + * @var int + */ + public $do_debug = self::DEBUG_OFF; + + /** + * How to handle debug output. + * Options: + * * `echo` Output plain-text as-is, appropriate for CLI + * * `html` Output escaped, line breaks converted to `
    `, appropriate for browser output + * * `error_log` Output to error log as configured in php.ini + * Alternatively, you can provide a callable expecting two params: a message string and the debug level: + * + * ```php + * $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; + * ``` + * + * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug` + * level output is used: + * + * ```php + * $mail->Debugoutput = new myPsr3Logger; + * ``` + * + * @var string|callable|\Psr\Log\LoggerInterface + */ + public $Debugoutput = 'echo'; + + /** + * Whether to use VERP. + * + * @see http://en.wikipedia.org/wiki/Variable_envelope_return_path + * @see http://www.postfix.org/VERP_README.html Info on VERP + * + * @var bool + */ + public $do_verp = false; + + /** + * The timeout value for connection, in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. + * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. + * + * @see http://tools.ietf.org/html/rfc2821#section-4.5.3.2 + * + * @var int + */ + public $Timeout = 300; + + /** + * How long to wait for commands to complete, in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. + * + * @var int + */ + public $Timelimit = 300; + + /** + * Patterns to extract an SMTP transaction id from reply to a DATA command. + * The first capture group in each regex will be used as the ID. + * MS ESMTP returns the message ID, which may not be correct for internal tracking. + * + * @var string[] + */ + protected $smtp_transaction_id_patterns = [ + 'exim' => '/[\d]{3} OK id=(.*)/', + 'sendmail' => '/[\d]{3} 2.0.0 (.*) Message/', + 'postfix' => '/[\d]{3} 2.0.0 Ok: queued as (.*)/', + 'Microsoft_ESMTP' => '/[0-9]{3} 2.[\d].0 (.*)@(?:.*) Queued mail for delivery/', + 'Amazon_SES' => '/[\d]{3} Ok (.*)/', + 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', + 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', + ]; + + /** + * The last transaction ID issued in response to a DATA command, + * if one was detected. + * + * @var string|bool|null + */ + protected $last_smtp_transaction_id; + + /** + * The socket for the server connection. + * + * @var ?resource + */ + protected $smtp_conn; + + /** + * Error information, if any, for the last SMTP command. + * + * @var array + */ + protected $error = [ + 'error' => '', + 'detail' => '', + 'smtp_code' => '', + 'smtp_code_ex' => '', + ]; + + /** + * The reply the server sent to us for HELO. + * If null, no HELO string has yet been received. + * + * @var string|null + */ + protected $helo_rply; + + /** + * The set of SMTP extensions sent in reply to EHLO command. + * Indexes of the array are extension names. + * Value at index 'HELO' or 'EHLO' (according to command that was sent) + * represents the server name. In case of HELO it is the only element of the array. + * Other values can be boolean TRUE or an array containing extension options. + * If null, no HELO/EHLO string has yet been received. + * + * @var array|null + */ + protected $server_caps; + + /** + * The most recent reply received from the server. + * + * @var string + */ + protected $last_reply = ''; + + /** + * Output debugging info via a user-selected method. + * + * @param string $str Debug string to output + * @param int $level The debug level of this message; see DEBUG_* constants + * + * @see SMTP::$Debugoutput + * @see SMTP::$do_debug + */ + protected function edebug($str, $level = 0) + { + if ($level > $this->do_debug) { + return; + } + //Is this a PSR-3 logger? + if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { + $this->Debugoutput->debug($str); + + return; + } + //Avoid clash with built-in function names + if (is_callable($this->Debugoutput) && !in_array($this->Debugoutput, ['error_log', 'html', 'echo'])) { + call_user_func($this->Debugoutput, $str, $level); + + return; + } + switch ($this->Debugoutput) { + case 'error_log': + //Don't output, just log + error_log($str); + break; + case 'html': + //Cleans up output a bit for a better looking, HTML-safe output + echo gmdate('Y-m-d H:i:s'), ' ', htmlentities( + preg_replace('/[\r\n]+/', '', $str), + ENT_QUOTES, + 'UTF-8' + ), "
    \n"; + break; + case 'echo': + default: + //Normalize line breaks + $str = preg_replace('/\r\n|\r/m', "\n", $str); + echo gmdate('Y-m-d H:i:s'), + "\t", + //Trim trailing space + trim( + //Indent for readability, except for trailing break + str_replace( + "\n", + "\n \t ", + trim($str) + ) + ), + "\n"; + } + } + + /** + * Connect to an SMTP server. + * + * @param string $host SMTP server IP or host name + * @param int $port The port number to connect to + * @param int $timeout How long to wait for the connection to open + * @param array $options An array of options for stream_context_create() + * + * @return bool + */ + public function connect($host, $port = null, $timeout = 30, $options = []) + { + static $streamok; + //This is enabled by default since 5.0.0 but some providers disable it + //Check this once and cache the result + if (null === $streamok) { + $streamok = function_exists('stream_socket_client'); + } + // Clear errors to avoid confusion + $this->setError(''); + // Make sure we are __not__ connected + if ($this->connected()) { + // Already connected, generate error + $this->setError('Already connected to a server'); + + return false; + } + if (empty($port)) { + $port = self::DEFAULT_PORT; + } + // Connect to the SMTP server + $this->edebug( + "Connection: opening to $host:$port, timeout=$timeout, options=" . + (count($options) > 0 ? var_export($options, true) : 'array()'), + self::DEBUG_CONNECTION + ); + $errno = 0; + $errstr = ''; + if ($streamok) { + $socket_context = stream_context_create($options); + set_error_handler([$this, 'errorHandler']); + $this->smtp_conn = stream_socket_client( + $host . ':' . $port, + $errno, + $errstr, + $timeout, + STREAM_CLIENT_CONNECT, + $socket_context + ); + restore_error_handler(); + } else { + //Fall back to fsockopen which should work in more places, but is missing some features + $this->edebug( + 'Connection: stream_socket_client not available, falling back to fsockopen', + self::DEBUG_CONNECTION + ); + set_error_handler([$this, 'errorHandler']); + $this->smtp_conn = fsockopen( + $host, + $port, + $errno, + $errstr, + $timeout + ); + restore_error_handler(); + } + // Verify we connected properly + if (!is_resource($this->smtp_conn)) { + $this->setError( + 'Failed to connect to server', + '', + (string) $errno, + $errstr + ); + $this->edebug( + 'SMTP ERROR: ' . $this->error['error'] + . ": $errstr ($errno)", + self::DEBUG_CLIENT + ); + + return false; + } + $this->edebug('Connection: opened', self::DEBUG_CONNECTION); + // SMTP server can take longer to respond, give longer timeout for first read + // Windows does not have support for this timeout function + if (strpos(PHP_OS, 'WIN') !== 0) { + $max = (int) ini_get('max_execution_time'); + // Don't bother if unlimited + if (0 !== $max && $timeout > $max) { + @set_time_limit($timeout); + } + stream_set_timeout($this->smtp_conn, $timeout, 0); + } + // Get any announcement + $announce = $this->get_lines(); + $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER); + + return true; + } + + /** + * Initiate a TLS (encrypted) session. + * + * @return bool + */ + public function startTLS() + { + if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) { + return false; + } + + //Allow the best TLS version(s) we can + $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT; + + //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT + //so add them back in manually if we can + if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; + } + + // Begin encrypted connection + set_error_handler([$this, 'errorHandler']); + $crypto_ok = stream_socket_enable_crypto( + $this->smtp_conn, + true, + $crypto_method + ); + restore_error_handler(); + + return (bool) $crypto_ok; + } + + /** + * Perform SMTP authentication. + * Must be run after hello(). + * + * @see hello() + * + * @param string $username The user name + * @param string $password The password + * @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2) + * @param OAuth $OAuth An optional OAuth instance for XOAUTH2 authentication + * + * @return bool True if successfully authenticated + */ + public function authenticate( + $username, + $password, + $authtype = null, + $OAuth = null + ) { + if (!$this->server_caps) { + $this->setError('Authentication is not allowed before HELO/EHLO'); + + return false; + } + + if (array_key_exists('EHLO', $this->server_caps)) { + // SMTP extensions are available; try to find a proper authentication method + if (!array_key_exists('AUTH', $this->server_caps)) { + $this->setError('Authentication is not allowed at this stage'); + // 'at this stage' means that auth may be allowed after the stage changes + // e.g. after STARTTLS + + return false; + } + + $this->edebug('Auth method requested: ' . ($authtype ?: 'UNSPECIFIED'), self::DEBUG_LOWLEVEL); + $this->edebug( + 'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']), + self::DEBUG_LOWLEVEL + ); + + //If we have requested a specific auth type, check the server supports it before trying others + if (null !== $authtype && !in_array($authtype, $this->server_caps['AUTH'], true)) { + $this->edebug('Requested auth method not available: ' . $authtype, self::DEBUG_LOWLEVEL); + $authtype = null; + } + + if (empty($authtype)) { + //If no auth mechanism is specified, attempt to use these, in this order + //Try CRAM-MD5 first as it's more secure than the others + foreach (['CRAM-MD5', 'LOGIN', 'PLAIN', 'XOAUTH2'] as $method) { + if (in_array($method, $this->server_caps['AUTH'], true)) { + $authtype = $method; + break; + } + } + if (empty($authtype)) { + $this->setError('No supported authentication methods found'); + + return false; + } + $this->edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL); + } + + if (!in_array($authtype, $this->server_caps['AUTH'], true)) { + $this->setError("The requested authentication method \"$authtype\" is not supported by the server"); + + return false; + } + } elseif (empty($authtype)) { + $authtype = 'LOGIN'; + } + switch ($authtype) { + case 'PLAIN': + // Start authentication + if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { + return false; + } + // Send encoded username and password + if (!$this->sendCommand( + 'User & Password', + base64_encode("\0" . $username . "\0" . $password), + 235 + ) + ) { + return false; + } + break; + case 'LOGIN': + // Start authentication + if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { + return false; + } + if (!$this->sendCommand('Username', base64_encode($username), 334)) { + return false; + } + if (!$this->sendCommand('Password', base64_encode($password), 235)) { + return false; + } + break; + case 'CRAM-MD5': + // Start authentication + if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { + return false; + } + // Get the challenge + $challenge = base64_decode(substr($this->last_reply, 4)); + + // Build the response + $response = $username . ' ' . $this->hmac($challenge, $password); + + // send encoded credentials + return $this->sendCommand('Username', base64_encode($response), 235); + case 'XOAUTH2': + //The OAuth instance must be set up prior to requesting auth. + if (null === $OAuth) { + return false; + } + $oauth = $OAuth->getOauth64(); + + // Start authentication + if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { + return false; + } + break; + default: + $this->setError("Authentication method \"$authtype\" is not supported"); + + return false; + } + + return true; + } + + /** + * Calculate an MD5 HMAC hash. + * Works like hash_hmac('md5', $data, $key) + * in case that function is not available. + * + * @param string $data The data to hash + * @param string $key The key to hash with + * + * @return string + */ + protected function hmac($data, $key) + { + if (function_exists('hash_hmac')) { + return hash_hmac('md5', $data, $key); + } + + // The following borrowed from + // http://php.net/manual/en/function.mhash.php#27225 + + // RFC 2104 HMAC implementation for php. + // Creates an md5 HMAC. + // Eliminates the need to install mhash to compute a HMAC + // by Lance Rushing + + $bytelen = 64; // byte length for md5 + if (strlen($key) > $bytelen) { + $key = pack('H*', md5($key)); + } + $key = str_pad($key, $bytelen, chr(0x00)); + $ipad = str_pad('', $bytelen, chr(0x36)); + $opad = str_pad('', $bytelen, chr(0x5c)); + $k_ipad = $key ^ $ipad; + $k_opad = $key ^ $opad; + + return md5($k_opad . pack('H*', md5($k_ipad . $data))); + } + + /** + * Check connection state. + * + * @return bool True if connected + */ + public function connected() + { + if (is_resource($this->smtp_conn)) { + $sock_status = stream_get_meta_data($this->smtp_conn); + if ($sock_status['eof']) { + // The socket is valid but we are not connected + $this->edebug( + 'SMTP NOTICE: EOF caught while checking if connected', + self::DEBUG_CLIENT + ); + $this->close(); + + return false; + } + + return true; // everything looks good + } + + return false; + } + + /** + * Close the socket and clean up the state of the class. + * Don't use this function without first trying to use QUIT. + * + * @see quit() + */ + public function close() + { + $this->setError(''); + $this->server_caps = null; + $this->helo_rply = null; + if (is_resource($this->smtp_conn)) { + // close the connection and cleanup + fclose($this->smtp_conn); + $this->smtp_conn = null; //Makes for cleaner serialization + $this->edebug('Connection: closed', self::DEBUG_CONNECTION); + } + } + + /** + * Send an SMTP DATA command. + * Issues a data command and sends the msg_data to the server, + * finializing the mail transaction. $msg_data is the message + * that is to be send with the headers. Each header needs to be + * on a single line followed by a with the message headers + * and the message body being separated by an additional . + * Implements RFC 821: DATA . + * + * @param string $msg_data Message data to send + * + * @return bool + */ + public function data($msg_data) + { + //This will use the standard timelimit + if (!$this->sendCommand('DATA', 'DATA', 354)) { + return false; + } + + /* The server is ready to accept data! + * According to rfc821 we should not send more than 1000 characters on a single line (including the LE) + * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into + * smaller lines to fit within the limit. + * We will also look for lines that start with a '.' and prepend an additional '.'. + * NOTE: this does not count towards line-length limit. + */ + + // Normalize line breaks before exploding + $lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data)); + + /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field + * of the first line (':' separated) does not contain a space then it _should_ be a header and we will + * process all lines before a blank line as headers. + */ + + $field = substr($lines[0], 0, strpos($lines[0], ':')); + $in_headers = false; + if (!empty($field) && strpos($field, ' ') === false) { + $in_headers = true; + } + + foreach ($lines as $line) { + $lines_out = []; + if ($in_headers && $line === '') { + $in_headers = false; + } + //Break this line up into several smaller lines if it's too long + //Micro-optimisation: isset($str[$len]) is faster than (strlen($str) > $len), + while (isset($line[self::MAX_LINE_LENGTH])) { + //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on + //so as to avoid breaking in the middle of a word + $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' '); + //Deliberately matches both false and 0 + if (!$pos) { + //No nice break found, add a hard break + $pos = self::MAX_LINE_LENGTH - 1; + $lines_out[] = substr($line, 0, $pos); + $line = substr($line, $pos); + } else { + //Break at the found point + $lines_out[] = substr($line, 0, $pos); + //Move along by the amount we dealt with + $line = substr($line, $pos + 1); + } + //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1 + if ($in_headers) { + $line = "\t" . $line; + } + } + $lines_out[] = $line; + + //Send the lines to the server + foreach ($lines_out as $line_out) { + //RFC2821 section 4.5.2 + if (!empty($line_out) && $line_out[0] === '.') { + $line_out = '.' . $line_out; + } + $this->client_send($line_out . static::LE, 'DATA'); + } + } + + //Message data has been sent, complete the command + //Increase timelimit for end of DATA command + $savetimelimit = $this->Timelimit; + $this->Timelimit *= 2; + $result = $this->sendCommand('DATA END', '.', 250); + $this->recordLastTransactionID(); + //Restore timelimit + $this->Timelimit = $savetimelimit; + + return $result; + } + + /** + * Send an SMTP HELO or EHLO command. + * Used to identify the sending server to the receiving server. + * This makes sure that client and server are in a known state. + * Implements RFC 821: HELO + * and RFC 2821 EHLO. + * + * @param string $host The host name or IP to connect to + * + * @return bool + */ + public function hello($host = '') + { + //Try extended hello first (RFC 2821) + return $this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host); + } + + /** + * Send an SMTP HELO or EHLO command. + * Low-level implementation used by hello(). + * + * @param string $hello The HELO string + * @param string $host The hostname to say we are + * + * @return bool + * + * @see hello() + */ + protected function sendHello($hello, $host) + { + $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); + $this->helo_rply = $this->last_reply; + if ($noerror) { + $this->parseHelloFields($hello); + } else { + $this->server_caps = null; + } + + return $noerror; + } + + /** + * Parse a reply to HELO/EHLO command to discover server extensions. + * In case of HELO, the only parameter that can be discovered is a server name. + * + * @param string $type `HELO` or `EHLO` + */ + protected function parseHelloFields($type) + { + $this->server_caps = []; + $lines = explode("\n", $this->helo_rply); + + foreach ($lines as $n => $s) { + //First 4 chars contain response code followed by - or space + $s = trim(substr($s, 4)); + if (empty($s)) { + continue; + } + $fields = explode(' ', $s); + if (!empty($fields)) { + if (!$n) { + $name = $type; + $fields = $fields[0]; + } else { + $name = array_shift($fields); + switch ($name) { + case 'SIZE': + $fields = ($fields ? $fields[0] : 0); + break; + case 'AUTH': + if (!is_array($fields)) { + $fields = []; + } + break; + default: + $fields = true; + } + } + $this->server_caps[$name] = $fields; + } + } + } + + /** + * Send an SMTP MAIL command. + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more recipient + * commands may be called followed by a data command. + * Implements RFC 821: MAIL FROM: . + * + * @param string $from Source address of this message + * + * @return bool + */ + public function mail($from) + { + $useVerp = ($this->do_verp ? ' XVERP' : ''); + + return $this->sendCommand( + 'MAIL FROM', + 'MAIL FROM:<' . $from . '>' . $useVerp, + 250 + ); + } + + /** + * Send an SMTP QUIT command. + * Closes the socket if there is no error or the $close_on_error argument is true. + * Implements from RFC 821: QUIT . + * + * @param bool $close_on_error Should the connection close if an error occurs? + * + * @return bool + */ + public function quit($close_on_error = true) + { + $noerror = $this->sendCommand('QUIT', 'QUIT', 221); + $err = $this->error; //Save any error + if ($noerror || $close_on_error) { + $this->close(); + $this->error = $err; //Restore any error from the quit command + } + + return $noerror; + } + + /** + * Send an SMTP RCPT command. + * Sets the TO argument to $toaddr. + * Returns true if the recipient was accepted false if it was rejected. + * Implements from RFC 821: RCPT TO: . + * + * @param string $address The address the message is being sent to + * @param string $dsn Comma separated list of DSN notifications. NEVER, SUCCESS, FAILURE + * or DELAY. If you specify NEVER all other notifications are ignored. + * + * @return bool + */ + public function recipient($address, $dsn = '') + { + if (empty($dsn)) { + $rcpt = 'RCPT TO:<' . $address . '>'; + } else { + $dsn = strtoupper($dsn); + $notify = []; + + if (strpos($dsn, 'NEVER') !== false) { + $notify[] = 'NEVER'; + } else { + foreach (['SUCCESS', 'FAILURE', 'DELAY'] as $value) { + if (strpos($dsn, $value) !== false) { + $notify[] = $value; + } + } + } + + $rcpt = 'RCPT TO:<' . $address . '> NOTIFY=' . implode(',', $notify); + } + + return $this->sendCommand( + 'RCPT TO', + $rcpt, + [250, 251] + ); + } + + /** + * Send an SMTP RSET command. + * Abort any transaction that is currently in progress. + * Implements RFC 821: RSET . + * + * @return bool True on success + */ + public function reset() + { + return $this->sendCommand('RSET', 'RSET', 250); + } + + /** + * Send a command to an SMTP server and check its return code. + * + * @param string $command The command name - not sent to the server + * @param string $commandstring The actual command to send + * @param int|array $expect One or more expected integer success codes + * + * @return bool True on success + */ + protected function sendCommand($command, $commandstring, $expect) + { + if (!$this->connected()) { + $this->setError("Called $command without being connected"); + + return false; + } + //Reject line breaks in all commands + if ((strpos($commandstring, "\n") !== false) || (strpos($commandstring, "\r") !== false)) { + $this->setError("Command '$command' contained line breaks"); + + return false; + } + $this->client_send($commandstring . static::LE, $command); + + $this->last_reply = $this->get_lines(); + // Fetch SMTP code and possible error code explanation + $matches = []; + if (preg_match('/^([\d]{3})[ -](?:([\d]\\.[\d]\\.[\d]{1,2}) )?/', $this->last_reply, $matches)) { + $code = (int) $matches[1]; + $code_ex = (count($matches) > 2 ? $matches[2] : null); + // Cut off error code from each response line + $detail = preg_replace( + "/{$code}[ -]" . + ($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . '/m', + '', + $this->last_reply + ); + } else { + // Fall back to simple parsing if regex fails + $code = (int) substr($this->last_reply, 0, 3); + $code_ex = null; + $detail = substr($this->last_reply, 4); + } + + $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); + + if (!in_array($code, (array) $expect, true)) { + $this->setError( + "$command command failed", + $detail, + $code, + $code_ex + ); + $this->edebug( + 'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply, + self::DEBUG_CLIENT + ); + + return false; + } + + $this->setError(''); + + return true; + } + + /** + * Send an SMTP SAML command. + * Starts a mail transaction from the email address specified in $from. + * Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more recipient + * commands may be called followed by a data command. This command + * will send the message to the users terminal if they are logged + * in and send them an email. + * Implements RFC 821: SAML FROM: . + * + * @param string $from The address the message is from + * + * @return bool + */ + public function sendAndMail($from) + { + return $this->sendCommand('SAML', "SAML FROM:$from", 250); + } + + /** + * Send an SMTP VRFY command. + * + * @param string $name The name to verify + * + * @return bool + */ + public function verify($name) + { + return $this->sendCommand('VRFY', "VRFY $name", [250, 251]); + } + + /** + * Send an SMTP NOOP command. + * Used to keep keep-alives alive, doesn't actually do anything. + * + * @return bool + */ + public function noop() + { + return $this->sendCommand('NOOP', 'NOOP', 250); + } + + /** + * Send an SMTP TURN command. + * This is an optional command for SMTP that this class does not support. + * This method is here to make the RFC821 Definition complete for this class + * and _may_ be implemented in future. + * Implements from RFC 821: TURN . + * + * @return bool + */ + public function turn() + { + $this->setError('The SMTP TURN command is not implemented'); + $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT); + + return false; + } + + /** + * Send raw data to the server. + * + * @param string $data The data to send + * @param string $command Optionally, the command this is part of, used only for controlling debug output + * + * @return int|bool The number of bytes sent to the server or false on error + */ + public function client_send($data, $command = '') + { + //If SMTP transcripts are left enabled, or debug output is posted online + //it can leak credentials, so hide credentials in all but lowest level + if (self::DEBUG_LOWLEVEL > $this->do_debug && + in_array($command, ['User & Password', 'Username', 'Password'], true)) { + $this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT); + } else { + $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); + } + set_error_handler([$this, 'errorHandler']); + $result = fwrite($this->smtp_conn, $data); + restore_error_handler(); + + return $result; + } + + /** + * Get the latest error. + * + * @return array + */ + public function getError() + { + return $this->error; + } + + /** + * Get SMTP extensions available on the server. + * + * @return array|null + */ + public function getServerExtList() + { + return $this->server_caps; + } + + /** + * Get metadata about the SMTP server from its HELO/EHLO response. + * The method works in three ways, dependent on argument value and current state: + * 1. HELO/EHLO has not been sent - returns null and populates $this->error. + * 2. HELO has been sent - + * $name == 'HELO': returns server name + * $name == 'EHLO': returns boolean false + * $name == any other string: returns null and populates $this->error + * 3. EHLO has been sent - + * $name == 'HELO'|'EHLO': returns the server name + * $name == any other string: if extension $name exists, returns True + * or its options (e.g. AUTH mechanisms supported). Otherwise returns False. + * + * @param string $name Name of SMTP extension or 'HELO'|'EHLO' + * + * @return string|bool|null + */ + public function getServerExt($name) + { + if (!$this->server_caps) { + $this->setError('No HELO/EHLO was sent'); + + return; + } + + if (!array_key_exists($name, $this->server_caps)) { + if ('HELO' === $name) { + return $this->server_caps['EHLO']; + } + if ('EHLO' === $name || array_key_exists('EHLO', $this->server_caps)) { + return false; + } + $this->setError('HELO handshake was used; No information about server extensions available'); + + return; + } + + return $this->server_caps[$name]; + } + + /** + * Get the last reply from the server. + * + * @return string + */ + public function getLastReply() + { + return $this->last_reply; + } + + /** + * Read the SMTP server's response. + * Either before eof or socket timeout occurs on the operation. + * With SMTP we can tell if we have more lines to read if the + * 4th character is '-' symbol. If it is a space then we don't + * need to read anything else. + * + * @return string + */ + protected function get_lines() + { + // If the connection is bad, give up straight away + if (!is_resource($this->smtp_conn)) { + return ''; + } + $data = ''; + $endtime = 0; + stream_set_timeout($this->smtp_conn, $this->Timeout); + if ($this->Timelimit > 0) { + $endtime = time() + $this->Timelimit; + } + $selR = [$this->smtp_conn]; + $selW = null; + while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { + //Must pass vars in here as params are by reference + if (!stream_select($selR, $selW, $selW, $this->Timelimit)) { + $this->edebug( + 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', + self::DEBUG_LOWLEVEL + ); + break; + } + //Deliberate noise suppression - errors are handled afterwards + $str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH); + $this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL); + $data .= $str; + // If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled), + // or 4th character is a space or a line break char, we are done reading, break the loop. + // String array access is a significant micro-optimisation over strlen + if (!isset($str[3]) || $str[3] === ' ' || $str[3] === "\r" || $str[3] === "\n") { + break; + } + // Timed-out? Log and break + $info = stream_get_meta_data($this->smtp_conn); + if ($info['timed_out']) { + $this->edebug( + 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', + self::DEBUG_LOWLEVEL + ); + break; + } + // Now check if reads took too long + if ($endtime && time() > $endtime) { + $this->edebug( + 'SMTP -> get_lines(): timelimit reached (' . + $this->Timelimit . ' sec)', + self::DEBUG_LOWLEVEL + ); + break; + } + } + + return $data; + } + + /** + * Enable or disable VERP address generation. + * + * @param bool $enabled + */ + public function setVerp($enabled = false) + { + $this->do_verp = $enabled; + } + + /** + * Get VERP address generation mode. + * + * @return bool + */ + public function getVerp() + { + return $this->do_verp; + } + + /** + * Set error messages and codes. + * + * @param string $message The error message + * @param string $detail Further detail on the error + * @param string $smtp_code An associated SMTP error code + * @param string $smtp_code_ex Extended SMTP code + */ + protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '') + { + $this->error = [ + 'error' => $message, + 'detail' => $detail, + 'smtp_code' => $smtp_code, + 'smtp_code_ex' => $smtp_code_ex, + ]; + } + + /** + * Set debug output method. + * + * @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it + */ + public function setDebugOutput($method = 'echo') + { + $this->Debugoutput = $method; + } + + /** + * Get debug output method. + * + * @return string + */ + public function getDebugOutput() + { + return $this->Debugoutput; + } + + /** + * Set debug output level. + * + * @param int $level + */ + public function setDebugLevel($level = 0) + { + $this->do_debug = $level; + } + + /** + * Get debug output level. + * + * @return int + */ + public function getDebugLevel() + { + return $this->do_debug; + } + + /** + * Set SMTP timeout. + * + * @param int $timeout The timeout duration in seconds + */ + public function setTimeout($timeout = 0) + { + $this->Timeout = $timeout; + } + + /** + * Get SMTP timeout. + * + * @return int + */ + public function getTimeout() + { + return $this->Timeout; + } + + /** + * Reports an error number and string. + * + * @param int $errno The error number returned by PHP + * @param string $errmsg The error message returned by PHP + * @param string $errfile The file the error occurred in + * @param int $errline The line number the error occurred on + */ + protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0) + { + $notice = 'Connection failed.'; + $this->setError( + $notice, + $errmsg, + (string) $errno + ); + $this->edebug( + "$notice Error #$errno: $errmsg [$errfile line $errline]", + self::DEBUG_CONNECTION + ); + } + + /** + * Extract and return the ID of the last SMTP transaction based on + * a list of patterns provided in SMTP::$smtp_transaction_id_patterns. + * Relies on the host providing the ID in response to a DATA command. + * If no reply has been received yet, it will return null. + * If no pattern was matched, it will return false. + * + * @return bool|string|null + */ + protected function recordLastTransactionID() + { + $reply = $this->getLastReply(); + + if (empty($reply)) { + $this->last_smtp_transaction_id = null; + } else { + $this->last_smtp_transaction_id = false; + foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) { + if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) { + $this->last_smtp_transaction_id = trim($matches[1]); + break; + } + } + } + + return $this->last_smtp_transaction_id; + } + + /** + * Get the queue/transaction ID of the last SMTP transaction + * If no reply has been received yet, it will return null. + * If no pattern was matched, it will return false. + * + * @return bool|string|null + * + * @see recordLastTransactionID() + */ + public function getLastTransactionID() + { + return $this->last_smtp_transaction_id; + } +} diff --git a/plugins/datetimepicker-master/.gitignore b/plugins/datetimepicker-master/.gitignore new file mode 100644 index 0000000..7229fd1 --- /dev/null +++ b/plugins/datetimepicker-master/.gitignore @@ -0,0 +1,3 @@ +.idea +node_modules +bower_components/ \ No newline at end of file diff --git a/plugins/datetimepicker-master/.travis.yml b/plugins/datetimepicker-master/.travis.yml new file mode 100644 index 0000000..7d8588b --- /dev/null +++ b/plugins/datetimepicker-master/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "8" +services: + - xvfb \ No newline at end of file diff --git a/plugins/datetimepicker-master/MIT-LICENSE.txt b/plugins/datetimepicker-master/MIT-LICENSE.txt new file mode 100644 index 0000000..2e68e7d --- /dev/null +++ b/plugins/datetimepicker-master/MIT-LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2013 http://xdsoft.net + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/plugins/datetimepicker-master/README.md b/plugins/datetimepicker-master/README.md new file mode 100644 index 0000000..ac1d926 --- /dev/null +++ b/plugins/datetimepicker-master/README.md @@ -0,0 +1,81 @@ +# jQuery DateTimePicker +[Demo and Documentation](https://xdsoft.net/jqplugins/datetimepicker/) + +[![Build Status](https://travis-ci.org/xdan/datetimepicker.svg?branch=master)](https://travis-ci.org/xdan/datetimepicker) +[![npm version](https://badge.fury.io/js/jquery-datetimepicker.svg)](https://badge.fury.io/js/jquery-datetimepicker) +[![npm](https://img.shields.io/npm/dm/jquery-datetimepicker.svg)](https://www.npmjs.com/package/jquery-datetimepicker) + +PLEASE. Help me update the documentation. +[Doc.tpl](https://github.com/xdan/datetimepicker/blob/master/doc.tpl) +This file will be automatically displayed on the site + +# Installation + +```bash +npm install jquery-datetimepicker +``` +OR +```bash +yarn add jquery-datetimepicker +``` +or download [zip](https://github.com/xdan/datetimepicker/releases) +# datetimepicker +============== + +**!!! In the latest version the 'lang' option is obsolete. The language setting is now global. !!!** + +Use this: +```javascript +jQuery.datetimepicker.setLocale('en'); +``` +[Documentation][doc] + +jQuery Plugin Date and Time Picker + +DateTimePicker + +![ScreenShot](https://raw.github.com/xdan/datetimepicker/master/screen/1.png) + +DatePicker + +![ScreenShot](https://raw.github.com/xdan/datetimepicker/master/screen/2.png) + +TimePicker + +![ScreenShot](https://raw.github.com/xdan/datetimepicker/master/screen/3.png) + +Options to highlight individual dates or periods + +![ScreenShot](https://raw.github.com/Mingpao/datetimepicker/master/screen/4.png) + +![ScreenShot](https://raw.github.com/Mingpao/datetimepicker/master/screen/5.png) + +![ScreenShot](https://raw.github.com/Mingpao/datetimepicker/master/screen/6.png) + +[doc]: https://xdsoft.net/jqplugins/datetimepicker/ + +### JS Build help + +**Requires Node and NPM** [Download and install node.js](http://nodejs.org/download/). + +Install: + +1. Install `bower` globally with `npm install -g bower`. +2. Run `npm install`. npm will look at `package.json` and automatically install the necessary dependencies. +3. Run `bower install`, which installs front-end packages defined in `bower.json`. + +Notice: If you use Bower v1.5.2, you will get the error: `The "main" field cannot contain minified files` +You can regress to version 1.3.12 + +1. `npm uninstall bower -g` +2. `npm install -g bower@1.3.12` + +Build: + +First install npm requirements: `npm install -g uglifycss concat-cli` +Then build the files: `npm run build` + +When the build completes, you'll have the following files: +- **build/jquery.datetimepicker.full.js** - browser file +- **build/jquery.datetimepicker.full.min.js** - browser minified file +- **build/jquery.datetimepicker.min.js** - amd module style minified file diff --git a/plugins/datetimepicker-master/bower.json b/plugins/datetimepicker-master/bower.json new file mode 100644 index 0000000..5eb0123 --- /dev/null +++ b/plugins/datetimepicker-master/bower.json @@ -0,0 +1,56 @@ +{ + "name": "datetimepicker", + "version": "2.5.11", + "main": [ + "build/jquery.datetimepicker.full.min.js", + "jquery.datetimepicker.css" + ], + "ignore": [ + "**/screen", + "**/datetimepicker.jquery.json", + "**/*.png", + "**/*.txt", + "**/*.md", + "**/*.html", + "**/*.tpl", + "**/jquery.js", + "bower_components", + "node_modules" + ], + "keywords": [ + "calendar", + "date", + "time", + "form", + "datetime", + "datepicker", + "timepicker", + "datetimepicker", + "validation", + "ui", + "scroller", + "picker", + "i18n", + "input", + "jquery", + "touch" + ], + "authors": [ + { + "name": "Chupurnov Valeriy", + "email": "chupurnov@gmail.com", + "homepage": "http://xdsoft.net/contacts.html" + } + ], + "dependencies": { + "jquery": ">= 1.7.2", + "jquery-mousewheel": ">= 3.1.13", + "php-date-formatter": ">= 1.3.3" + }, + "license": "MIT", + "homepage": "http://xdsoft.net/jqplugins/datetimepicker/", + "repository": { + "type": "git", + "url": "git://github.com:xdan/datetimepicker.git" + } +} diff --git a/plugins/datetimepicker-master/build/jquery.datetimepicker.full.js b/plugins/datetimepicker-master/build/jquery.datetimepicker.full.js new file mode 100644 index 0000000..b02df5c --- /dev/null +++ b/plugins/datetimepicker-master/build/jquery.datetimepicker.full.js @@ -0,0 +1,2953 @@ +/*! + * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 + * @version 1.3.6 + * + * Date formatter utility library that allows formatting date/time variables or Date objects using PHP DateTime format. + * This library is a standalone javascript library and does not depend on other libraries or plugins like jQuery. The + * library also adds support for Universal Module Definition (UMD). + * + * @see http://php.net/manual/en/function.date.php + * + * For more JQuery plugins visit http://plugins.krajee.com + * For more Yii related demos visit http://demos.krajee.com + */!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():t.DateFormatter=e()}("undefined"!=typeof self?self:this,function(){var t,e;return e={DAY:864e5,HOUR:3600,defaults:{dateSettings:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["AM","PM"],ordinal:function(t){var e=t%10,n={1:"st",2:"nd",3:"rd"};return 1!==Math.floor(t%100/10)&&n[e]?n[e]:"th"}},separators:/[ \-+\/.:@]/g,validParts:/[dDjlNSwzWFmMntLoYyaABgGhHisueTIOPZcrU]/g,intParts:/[djwNzmnyYhHgGis]/g,tzParts:/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,tzClip:/[^-+\dA-Z]/g},getInt:function(t,e){return parseInt(t,e?e:10)},compare:function(t,e){return"string"==typeof t&&"string"==typeof e&&t.toLowerCase()===e.toLowerCase()},lpad:function(t,n,r){var a=t.toString();return r=r||"0",a.length=0;u--)"S"===r[u]&&r.splice(u,1);for(a=t.replace(g.separators,"\x00").split("\x00"),u=0;uo?"20":"19")+i):o,h=!0;break;case"m":case"n":case"M":case"F":if(isNaN(o)){if(s=g.getMonth(i),!(s>0))return null;y.month=s}else{if(!(o>=1&&12>=o))return null;y.month=o}h=!0;break;case"d":case"j":if(!(o>=1&&31>=o))return null;y.day=o,h=!0;break;case"g":case"h":if(c=r.indexOf("a")>-1?r.indexOf("a"):r.indexOf("A")>-1?r.indexOf("A"):-1,d=a[c],-1!==c)f=e.compare(d,p.meridiem[0])?0:e.compare(d,p.meridiem[1])?12:-1,o>=1&&12>=o&&-1!==f?y.hour=o%12===0?f:o+f:o>=0&&23>=o&&(y.hour=o);else{if(!(o>=0&&23>=o))return null;y.hour=o}m=!0;break;case"G":case"H":if(!(o>=0&&23>=o))return null;y.hour=o,m=!0;break;case"i":if(!(o>=0&&59>=o))return null;y.min=o,m=!0;break;case"s":if(!(o>=0&&59>=o))return null;y.sec=o,m=!0}if(h===!0){var D=y.year||0,v=y.month?y.month-1:0,S=y.day||1;y.date=new Date(D,v,S,y.hour,y.min,y.sec,0)}else{if(m!==!0)return null;y.date=new Date(0,0,0,y.hour,y.min,y.sec,0)}return y.date},guessDate:function(t,n){if("string"!=typeof t)return t;var r,a,u,i,o,s,c=this,f=t.replace(c.separators,"\x00").split("\x00"),l=/^[djmn]/g,d=n.match(c.validParts),g=new Date,h=0;if(!l.test(d[0]))return t;for(u=0;ur?r:4,a=e.getInt(4>r?a.toString().substr(0,4-r)+o:o.substr(0,4)),!a)return null;g.setFullYear(a);break;case 3:g.setHours(s);break;case 4:g.setMinutes(s);break;case 5:g.setSeconds(s)}i=o.substr(h),i.length>0&&f.splice(u+1,0,i)}return g},parseFormat:function(t,n){var r,a=this,u=a.dateSettings,i=/\\?(.?)/gi,o=function(t,e){return r[t]?r[t]():e};return r={d:function(){return e.lpad(r.j(),2)},D:function(){return u.daysShort[r.w()]},j:function(){return n.getDate()},l:function(){return u.days[r.w()]},N:function(){return r.w()||7},w:function(){return n.getDay()},z:function(){var t=new Date(r.Y(),r.n()-1,r.j()),n=new Date(r.Y(),0,1);return Math.round((t-n)/e.DAY)},W:function(){var t=new Date(r.Y(),r.n()-1,r.j()-r.N()+3),n=new Date(t.getFullYear(),0,4);return e.lpad(1+Math.round((t-n)/e.DAY/7),2)},F:function(){return u.months[n.getMonth()]},m:function(){return e.lpad(r.n(),2)},M:function(){return u.monthsShort[n.getMonth()]},n:function(){return n.getMonth()+1},t:function(){return new Date(r.Y(),r.n(),0).getDate()},L:function(){var t=r.Y();return t%4===0&&t%100!==0||t%400===0?1:0},o:function(){var t=r.n(),e=r.W(),n=r.Y();return n+(12===t&&9>e?1:1===t&&e>9?-1:0)},Y:function(){return n.getFullYear()},y:function(){return r.Y().toString().slice(-2)},a:function(){return r.A().toLowerCase()},A:function(){var t=r.G()<12?0:1;return u.meridiem[t]},B:function(){var t=n.getUTCHours()*e.HOUR,r=60*n.getUTCMinutes(),a=n.getUTCSeconds();return e.lpad(Math.floor((t+r+a+e.HOUR)/86.4)%1e3,3)},g:function(){return r.G()%12||12},G:function(){return n.getHours()},h:function(){return e.lpad(r.g(),2)},H:function(){return e.lpad(r.G(),2)},i:function(){return e.lpad(n.getMinutes(),2)},s:function(){return e.lpad(n.getSeconds(),2)},u:function(){return e.lpad(1e3*n.getMilliseconds(),6)},e:function(){var t=/\((.*)\)/.exec(String(n))[1];return t||"Coordinated Universal Time"},I:function(){var t=new Date(r.Y(),0),e=Date.UTC(r.Y(),0),n=new Date(r.Y(),6),a=Date.UTC(r.Y(),6);return t-e!==n-a?1:0},O:function(){var t=n.getTimezoneOffset(),r=Math.abs(t);return(t>0?"-":"+")+e.lpad(100*Math.floor(r/60)+r%60,4)},P:function(){var t=r.O();return t.substr(0,3)+":"+t.substr(3,2)},T:function(){var t=(String(n).match(a.tzParts)||[""]).pop().replace(a.tzClip,"");return t||"UTC"},Z:function(){return 60*-n.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(i,o)},r:function(){return"D, d M Y H:i:s O".replace(i,o)},U:function(){return n.getTime()/1e3||0}},o(t,t)},formatDate:function(t,n){var r,a,u,i,o,s=this,c="",f="\\";if("string"==typeof t&&(t=s.parseDate(t,n),!t))return null;if(t instanceof Date){for(u=n.length,r=0;u>r;r++)o=n.charAt(r),"S"!==o&&o!==f&&(r>0&&n.charAt(r-1)===f?c+=o:(i=s.parseFormat(o,t),r!==u-1&&s.intParts.test(o)&&"S"===n.charAt(r+1)&&(a=e.getInt(i)||0,i+=s.dateSettings.ordinal(a)),c+=i));return c}return""}},t}); +/** + * @preserve jQuery DateTimePicker + * @homepage http://xdsoft.net/jqplugins/datetimepicker/ + * @author Chupurnov Valeriy () + */ + +/** + * @param {jQuery} $ + */ +var datetimepickerFactory = function ($) { + 'use strict'; + + var default_options = { + i18n: { + ar: { // Arabic + months: [ + "كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول" + ], + dayOfWeekShort: [ + "Ù†", "Ø«", "ع", "Ø®", "ج", "س", "Ø­" + ], + dayOfWeek: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت", "الأحد"] + }, + ro: { // Romanian + months: [ + "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie" + ], + dayOfWeekShort: [ + "Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ" + ], + dayOfWeek: ["Duminică", "Luni", "MarÅ£i", "Miercuri", "Joi", "Vineri", "Sâmbătă"] + }, + id: { // Indonesian + months: [ + "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember" + ], + dayOfWeekShort: [ + "Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab" + ], + dayOfWeek: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"] + }, + is: { // Icelandic + months: [ + "Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ãgúst", "September", "Október", "Nóvember", "Desember" + ], + dayOfWeekShort: [ + "Sun", "Mán", "Þrið", "Mið", "Fim", "Fös", "Lau" + ], + dayOfWeek: ["Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur"] + }, + bg: { // Bulgarian + months: [ + "Януари", "Февруари", "Март", "Ðприл", "Май", "Юни", "Юли", "ÐвгуÑÑ‚", "Септември", "Октомври", "Ðоември", "Декември" + ], + dayOfWeekShort: [ + "Ðд", "Пн", "Ð’Ñ‚", "Ср", "Чт", "Пт", "Сб" + ], + dayOfWeek: ["ÐеделÑ", "Понеделник", "Вторник", "СрÑда", "Четвъртък", "Петък", "Събота"] + }, + fa: { // Persian/Farsi + months: [ + 'ÙØ±ÙˆØ±Ø¯ÛŒÙ†', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسÙند' + ], + dayOfWeekShort: [ + 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه' + ], + dayOfWeek: ["یک‌شنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنج‌شنبه", "جمعه", "شنبه", "یک‌شنبه"] + }, + ru: { // Russian + months: [ + 'Январь', 'Февраль', 'Март', 'Ðпрель', 'Май', 'Июнь', 'Июль', 'ÐвгуÑÑ‚', 'СентÑбрь', 'ОктÑбрь', 'ÐоÑбрь', 'Декабрь' + ], + dayOfWeekShort: [ + "Ð’Ñ", "Пн", "Ð’Ñ‚", "Ср", "Чт", "Пт", "Сб" + ], + dayOfWeek: ["ВоÑкреÑенье", "Понедельник", "Вторник", "Среда", "Четверг", "ПÑтница", "Суббота"] + }, + uk: { // Ukrainian + months: [ + 'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'ВереÑень', 'Жовтень', 'ЛиÑтопад', 'Грудень' + ], + dayOfWeekShort: [ + "Ðд", "Пн", "Ð’Ñ‚", "Ср", "Чт", "Пт", "Сб" + ], + dayOfWeek: ["ÐеділÑ", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ÑтницÑ", "Субота"] + }, + en: { // English + months: [ + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + ], + dayOfWeekShort: [ + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + ], + dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + }, + el: { // Ελληνικά + months: [ + "ΙανουάÏιος", "ΦεβÏουάÏιος", "ΜάÏτιος", "ΑπÏίλιος", "Μάιος", "ΙοÏνιος", "ΙοÏλιος", "ΑÏγουστος", "ΣεπτέμβÏιος", "ΟκτώβÏιος", "ÎοέμβÏιος", "ΔεκέμβÏιος" + ], + dayOfWeekShort: [ + "ΚυÏ", "Δευ", "ΤÏι", "Τετ", "Πεμ", "ΠαÏ", "Σαβ" + ], + dayOfWeek: ["ΚυÏιακή", "ΔευτέÏα", "ΤÏίτη", "ΤετάÏτη", "Πέμπτη", "ΠαÏασκευή", "Σάββατο"] + }, + de: { // German + months: [ + 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' + ], + dayOfWeekShort: [ + "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" + ], + dayOfWeek: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"] + }, + nl: { // Dutch + months: [ + "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december" + ], + dayOfWeekShort: [ + "zo", "ma", "di", "wo", "do", "vr", "za" + ], + dayOfWeek: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"] + }, + tr: { // Turkish + months: [ + "Ocak", "Åžubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "AÄŸustos", "Eylül", "Ekim", "Kasım", "Aralık" + ], + dayOfWeekShort: [ + "Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts" + ], + dayOfWeek: ["Pazar", "Pazartesi", "Salı", "ÇarÅŸamba", "PerÅŸembe", "Cuma", "Cumartesi"] + }, + fr: { //French + months: [ + "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" + ], + dayOfWeekShort: [ + "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" + ], + dayOfWeek: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"] + }, + es: { // Spanish + months: [ + "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" + ], + dayOfWeekShort: [ + "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb" + ], + dayOfWeek: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"] + }, + th: { // Thai + months: [ + 'มà¸à¸£à¸²à¸„ม', 'à¸à¸¸à¸¡à¸ à¸²à¸žà¸±à¸™à¸˜à¹Œ', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'à¸à¸£à¸à¸Žà¸²à¸„ม', 'สิงหาคม', 'à¸à¸±à¸™à¸¢à¸²à¸¢à¸™', 'ตุลาคม', 'พฤศจิà¸à¸²à¸¢à¸™', 'ธันวาคม' + ], + dayOfWeekShort: [ + 'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.' + ], + dayOfWeek: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุà¸à¸£à¹Œ", "เสาร์", "อาทิตย์"] + }, + pl: { // Polish + months: [ + "styczeÅ„", "luty", "marzec", "kwiecieÅ„", "maj", "czerwiec", "lipiec", "sierpieÅ„", "wrzesieÅ„", "październik", "listopad", "grudzieÅ„" + ], + dayOfWeekShort: [ + "nd", "pn", "wt", "Å›r", "cz", "pt", "sb" + ], + dayOfWeek: ["niedziela", "poniedziaÅ‚ek", "wtorek", "Å›roda", "czwartek", "piÄ…tek", "sobota"] + }, + pt: { // Portuguese + months: [ + "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" + ], + dayOfWeekShort: [ + "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" + ], + dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] + }, + ch: { // Simplified Chinese + months: [ + "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "乿œˆ", "åæœˆ", "å一月", "å二月" + ], + dayOfWeekShort: [ + "æ—¥", "一", "二", "三", "å››", "五", "å…­" + ] + }, + se: { // Swedish + months: [ + "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" + ], + dayOfWeekShort: [ + "Sön", "MÃ¥n", "Tis", "Ons", "Tor", "Fre", "Lör" + ] + }, + km: { // Khmer (ភាសាážáŸ’មែរ) + months: [ + "មករា​", "កុម្ភៈ", "មិនា​", "មáŸážŸáž¶â€‹", "ឧសភា​", "មិážáž»áž“ា​", "កក្កដា​", "សីហា​", "កញ្ញា​", "ážáž»áž›áž¶â€‹", "វិច្ឆិកា", "ធ្នូ​" + ], + dayOfWeekShort: ["អាទិ​", "áž…áŸáž“្ទ​", "អង្គារ​", "ពុធ​", "ព្រហ​​", "សុក្រ​", "សៅរáŸ"], + dayOfWeek: ["អាទិážáŸ’យ​", "áž…áŸáž“្ទ​", "អង្គារ​", "ពុធ​", "ព្រហស្បážáž·áŸâ€‹", "សុក្រ​", "សៅរáŸ"] + }, + kr: { // Korean + months: [ + "1ì›”", "2ì›”", "3ì›”", "4ì›”", "5ì›”", "6ì›”", "7ì›”", "8ì›”", "9ì›”", "10ì›”", "11ì›”", "12ì›”" + ], + dayOfWeekShort: [ + "ì¼", "ì›”", "í™”", "수", "목", "금", "토" + ], + dayOfWeek: ["ì¼ìš”ì¼", "월요ì¼", "화요ì¼", "수요ì¼", "목요ì¼", "금요ì¼", "토요ì¼"] + }, + it: { // Italian + months: [ + "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" + ], + dayOfWeekShort: [ + "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" + ], + dayOfWeek: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] + }, + da: { // Dansk + months: [ + "Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December" + ], + dayOfWeekShort: [ + "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" + ], + dayOfWeek: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"] + }, + no: { // Norwegian + months: [ + "Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember" + ], + dayOfWeekShort: [ + "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" + ], + dayOfWeek: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag'] + }, + ja: { // Japanese + months: [ + "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月" + ], + dayOfWeekShort: [ + "æ—¥", "月", "ç«", "æ°´", "木", "金", "土" + ], + dayOfWeek: ["日曜", "月曜", "ç«æ›œ", "水曜", "木曜", "金曜", "土曜"] + }, + vi: { // Vietnamese + months: [ + "Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12" + ], + dayOfWeekShort: [ + "CN", "T2", "T3", "T4", "T5", "T6", "T7" + ], + dayOfWeek: ["Chá»§ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy"] + }, + sl: { // SlovenÅ¡Äina + months: [ + "Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December" + ], + dayOfWeekShort: [ + "Ned", "Pon", "Tor", "Sre", "ÄŒet", "Pet", "Sob" + ], + dayOfWeek: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "ÄŒetrtek", "Petek", "Sobota"] + }, + cs: { // ÄŒeÅ¡tina + months: [ + "Leden", "Únor", "BÅ™ezen", "Duben", "KvÄ›ten", "ÄŒerven", "ÄŒervenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec" + ], + dayOfWeekShort: [ + "Ne", "Po", "Út", "St", "ÄŒt", "Pá", "So" + ] + }, + hu: { // Hungarian + months: [ + "Január", "Február", "Március", "Ãprilis", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December" + ], + dayOfWeekShort: [ + "Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo" + ], + dayOfWeek: ["vasárnap", "hétfÅ‘", "kedd", "szerda", "csütörtök", "péntek", "szombat"] + }, + az: { //Azerbaijanian (Azeri) + months: [ + "Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr" + ], + dayOfWeekShort: [ + "B", "Be", "Ça", "Ç", "Ca", "C", "Åž" + ], + dayOfWeek: ["Bazar", "Bazar ertÉ™si", "ÇərÅŸÉ™nbÉ™ axÅŸamı", "ÇərÅŸÉ™nbÉ™", "CümÉ™ axÅŸamı", "CümÉ™", "ŞənbÉ™"] + }, + bs: { //Bosanski + months: [ + "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" + ], + dayOfWeekShort: [ + "Ned", "Pon", "Uto", "Sri", "ÄŒet", "Pet", "Sub" + ], + dayOfWeek: ["Nedjelja","Ponedjeljak", "Utorak", "Srijeda", "ÄŒetvrtak", "Petak", "Subota"] + }, + ca: { //Català + months: [ + "Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre" + ], + dayOfWeekShort: [ + "Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds" + ], + dayOfWeek: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"] + }, + 'en-GB': { //English (British) + months: [ + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + ], + dayOfWeekShort: [ + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + ], + dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + }, + et: { //"Eesti" + months: [ + "Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember" + ], + dayOfWeekShort: [ + "P", "E", "T", "K", "N", "R", "L" + ], + dayOfWeek: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev"] + }, + eu: { //Euskara + months: [ + "Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua" + ], + dayOfWeekShort: [ + "Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La." + ], + dayOfWeek: ['Igandea', 'Astelehena', 'Asteartea', 'Asteazkena', 'Osteguna', 'Ostirala', 'Larunbata'] + }, + fi: { //Finnish (Suomi) + months: [ + "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu" + ], + dayOfWeekShort: [ + "Su", "Ma", "Ti", "Ke", "To", "Pe", "La" + ], + dayOfWeek: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"] + }, + gl: { //Galego + months: [ + "Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec" + ], + dayOfWeekShort: [ + "Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab" + ], + dayOfWeek: ["Domingo", "Luns", "Martes", "Mércores", "Xoves", "Venres", "Sábado"] + }, + hr: { //Hrvatski + months: [ + "SijeÄanj", "VeljaÄa", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac" + ], + dayOfWeekShort: [ + "Ned", "Pon", "Uto", "Sri", "ÄŒet", "Pet", "Sub" + ], + dayOfWeek: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "ÄŒetvrtak", "Petak", "Subota"] + }, + ko: { //Korean (한국어) + months: [ + "1ì›”", "2ì›”", "3ì›”", "4ì›”", "5ì›”", "6ì›”", "7ì›”", "8ì›”", "9ì›”", "10ì›”", "11ì›”", "12ì›”" + ], + dayOfWeekShort: [ + "ì¼", "ì›”", "í™”", "수", "목", "금", "토" + ], + dayOfWeek: ["ì¼ìš”ì¼", "월요ì¼", "화요ì¼", "수요ì¼", "목요ì¼", "금요ì¼", "토요ì¼"] + }, + lt: { //Lithuanian (lietuvių) + months: [ + "Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "RugpjÅ«Äio", "RugsÄ—jo", "Spalio", "LapkriÄio", "Gruodžio" + ], + dayOfWeekShort: [ + "Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Å eÅ¡" + ], + dayOfWeek: ["Sekmadienis", "Pirmadienis", "Antradienis", "TreÄiadienis", "Ketvirtadienis", "Penktadienis", "Å eÅ¡tadienis"] + }, + lv: { //Latvian (LatvieÅ¡u) + months: [ + "JanvÄris", "FebruÄris", "Marts", "AprÄ«lis ", "Maijs", "JÅ«nijs", "JÅ«lijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris" + ], + dayOfWeekShort: [ + "Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St" + ], + dayOfWeek: ["SvÄ“tdiena", "Pirmdiena", "Otrdiena", "TreÅ¡diena", "Ceturtdiena", "Piektdiena", "Sestdiena"] + }, + mk: { //Macedonian (МакедонÑки) + months: [ + "јануари", "февруари", "март", "април", "мај", "јуни", "јули", "авгуÑÑ‚", "Ñептември", "октомври", "ноември", "декември" + ], + dayOfWeekShort: [ + "нед", "пон", "вто", "Ñре", "чет", "пет", "Ñаб" + ], + dayOfWeek: ["Ðедела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота"] + }, + mn: { //Mongolian (Монгол) + months: [ + "1-Ñ€ Ñар", "2-Ñ€ Ñар", "3-Ñ€ Ñар", "4-Ñ€ Ñар", "5-Ñ€ Ñар", "6-Ñ€ Ñар", "7-Ñ€ Ñар", "8-Ñ€ Ñар", "9-Ñ€ Ñар", "10-Ñ€ Ñар", "11-Ñ€ Ñар", "12-Ñ€ Ñар" + ], + dayOfWeekShort: [ + "Дав", "МÑг", "Лха", "Пүр", "БÑн", "БÑм", "ÐÑм" + ], + dayOfWeek: ["Даваа", "МÑгмар", "Лхагва", "ПүрÑв", "БааÑан", "БÑмба", "ÐÑм"] + }, + 'pt-BR': { //Português(Brasil) + months: [ + "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" + ], + dayOfWeekShort: [ + "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb" + ], + dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] + }, + sk: { //SlovenÄina + months: [ + "Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December" + ], + dayOfWeekShort: [ + "Ne", "Po", "Ut", "St", "Å t", "Pi", "So" + ], + dayOfWeek: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Å tvrtok", "Piatok", "Sobota"] + }, + sq: { //Albanian (Shqip) + months: [ + "Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor" + ], + dayOfWeekShort: [ + "Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Shtu" + ], + dayOfWeek: ["E Diel", "E Hënë", "E MartÄ“", "E Mërkurë", "E Enjte", "E Premte", "E Shtunë"] + }, + 'sr-YU': { //Serbian (Srpski) + months: [ + "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" + ], + dayOfWeekShort: [ + "Ned", "Pon", "Uto", "Sre", "Äet", "Pet", "Sub" + ], + dayOfWeek: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "ÄŒetvrtak", "Petak", "Subota"] + }, + sr: { //Serbian Cyrillic (СрпÑки) + months: [ + "јануар", "фебруар", "март", "април", "мај", "јун", "јул", "авгуÑÑ‚", "Ñептембар", "октобар", "новембар", "децембар" + ], + dayOfWeekShort: [ + "нед", "пон", "уто", "Ñре", "чет", "пет", "Ñуб" + ], + dayOfWeek: ["Ðедеља","Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота"] + }, + sv: { //Svenska + months: [ + "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" + ], + dayOfWeekShort: [ + "Sön", "MÃ¥n", "Tis", "Ons", "Tor", "Fre", "Lör" + ], + dayOfWeek: ["Söndag", "MÃ¥ndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"] + }, + 'zh-TW': { //Traditional Chinese (ç¹é«”中文) + months: [ + "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "乿œˆ", "åæœˆ", "å一月", "å二月" + ], + dayOfWeekShort: [ + "æ—¥", "一", "二", "三", "å››", "五", "å…­" + ], + dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] + }, + zh: { //Simplified Chinese (简体中文) + months: [ + "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "乿œˆ", "åæœˆ", "å一月", "å二月" + ], + dayOfWeekShort: [ + "æ—¥", "一", "二", "三", "å››", "五", "å…­" + ], + dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] + }, + ug:{ // Uyghur(ئۇيغۇرچە) + months: [ + "1-ئاي","2-ئاي","3-ئاي","4-ئاي","5-ئاي","6-ئاي","7-ئاي","8-ئاي","9-ئاي","10-ئاي","11-ئاي","12-ئاي" + ], + dayOfWeek: [ + "يەكشەنبە", "دۈشەنبە","سەيشەنبە","چارشەنبە","پەيشەنبە","جۈمە","شەنبە" + ] + }, + he: { //Hebrew (עברית) + months: [ + 'ינו×ר', 'פברו×ר', 'מרץ', '×פריל', 'מ××™', 'יוני', 'יולי', '×וגוסט', 'ספטמבר', '×וקטובר', 'נובמבר', 'דצמבר' + ], + dayOfWeekShort: [ + '×\'', 'ב\'', '×’\'', 'ד\'', '×”\'', 'ו\'', 'שבת' + ], + dayOfWeek: ["ר×שון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ר×שון"] + }, + hy: { // Armenian + months: [ + "Õ€Õ¸Ö‚Õ¶Õ¾Õ¡Ö€", "Õ“Õ¥Õ¿Ö€Õ¾Õ¡Ö€", "Õ„Õ¡Ö€Õ¿", "Ô±ÕºÖ€Õ«Õ¬", "Õ„Õ¡ÕµÕ«Õ½", "Õ€Õ¸Ö‚Õ¶Õ«Õ½", "Õ€Õ¸Ö‚Õ¬Õ«Õ½", "Õ•Õ£Õ¸Õ½Õ¿Õ¸Õ½", "ÕÕ¥ÕºÕ¿Õ¥Õ´Õ¢Õ¥Ö€", "Õ€Õ¸Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€", "Õ†Õ¸ÕµÕ¥Õ´Õ¢Õ¥Ö€", "Ô´Õ¥Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€" + ], + dayOfWeekShort: [ + "Ô¿Õ«", "ÔµÖ€Õ¯", "ÔµÖ€Ö„", "Õ‰Õ¸Ö€", "Õ€Õ¶Õ£", "ÕˆÖ‚Ö€Õ¢", "Õ‡Õ¢Õ©" + ], + dayOfWeek: ["Ô¿Õ«Ö€Õ¡Õ¯Õ«", "ÔµÖ€Õ¯Õ¸Ö‚Õ·Õ¡Õ¢Õ©Õ«", "ÔµÖ€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«", "Õ‰Õ¸Ö€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«", "Õ€Õ«Õ¶Õ£Õ·Õ¡Õ¢Õ©Õ«", "ÕˆÖ‚Ö€Õ¢Õ¡Õ©", "Õ‡Õ¡Õ¢Õ¡Õ©"] + }, + kg: { // Kyrgyz + months: [ + 'Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'ÐÑк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы' + ], + dayOfWeekShort: [ + "Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише" + ], + dayOfWeek: [ + "Жекшемб", "Дүйшөмб", "Шейшемб", "Шаршемб", "Бейшемби", "Жума", "Ишенб" + ] + }, + rm: { // Romansh + months: [ + "Schaner", "Favrer", "Mars", "Avrigl", "Matg", "Zercladur", "Fanadur", "Avust", "Settember", "October", "November", "December" + ], + dayOfWeekShort: [ + "Du", "Gli", "Ma", "Me", "Gie", "Ve", "So" + ], + dayOfWeek: [ + "Dumengia", "Glindesdi", "Mardi", "Mesemna", "Gievgia", "Venderdi", "Sonda" + ] + }, + ka: { // Georgian + months: [ + 'იáƒáƒœáƒ•áƒáƒ áƒ˜', 'თებერვáƒáƒšáƒ˜', 'მáƒáƒ áƒ¢áƒ˜', 'áƒáƒžáƒ áƒ˜áƒšáƒ˜', 'მáƒáƒ˜áƒ¡áƒ˜', 'ივნისი', 'ივლისი', 'áƒáƒ’ვისტáƒ', 'სექტემბერი', 'áƒáƒ¥áƒ¢áƒáƒ›áƒ‘ერი', 'ნáƒáƒ”მბერი', 'დეკემბერი' + ], + dayOfWeekShort: [ + "კვ", "áƒáƒ áƒ¨", "სáƒáƒ›áƒ¨", "áƒáƒ—ხ", "ხუთ", "პáƒáƒ ", "შáƒáƒ‘" + ], + dayOfWeek: ["კვირáƒ", "áƒáƒ áƒ¨áƒáƒ‘áƒáƒ—ი", "სáƒáƒ›áƒ¨áƒáƒ‘áƒáƒ—ი", "áƒáƒ—ხშáƒáƒ‘áƒáƒ—ი", "ხუთშáƒáƒ‘áƒáƒ—ი", "პáƒáƒ áƒáƒ¡áƒ™áƒ”ვი", "შáƒáƒ‘áƒáƒ—ი"] + }, + kk: { // Kazakh + months: [ + 'Қаңтар', 'Ðқпан', 'Ðаурыз', 'Сәуір', 'Мамыр', 'МауÑым', 'Шілде', 'Тамыз', 'Қыркүйек', 'Қазан', 'Қараша', 'ЖелтоқÑан' + ], + dayOfWeekShort: [ + "Жк", "ДÑ", "СÑ", "Ср", "БÑ", "Жм", "Сб" + ], + dayOfWeek: ["ЖекÑенбі", "ДүйÑенбі", "СейÑенбі", "СәрÑенбі", "БейÑенбі", "Жұма", "Сенбі"] + } + }, + + ownerDocument: document, + contentWindow: window, + + value: '', + rtl: false, + + format: 'Y/m/d H:i', + formatTime: 'H:i', + formatDate: 'Y/m/d', + + startDate: false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05', + step: 60, + monthChangeSpinner: true, + + closeOnDateSelect: false, + closeOnTimeSelect: true, + closeOnWithoutClick: true, + closeOnInputClick: true, + openOnFocus: true, + + timepicker: true, + datepicker: true, + weeks: false, + + defaultTime: false, // use formatTime format (ex. '10:00' for formatTime: 'H:i') + defaultDate: false, // use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05') + + minDate: false, + maxDate: false, + minTime: false, + maxTime: false, + minDateTime: false, + maxDateTime: false, + + allowTimes: [], + opened: false, + initTime: true, + inline: false, + theme: '', + touchMovedThreshold: 5, + + onSelectDate: function () {}, + onSelectTime: function () {}, + onChangeMonth: function () {}, + onGetWeekOfYear: function () {}, + onChangeYear: function () {}, + onChangeDateTime: function () {}, + onShow: function () {}, + onClose: function () {}, + onGenerate: function () {}, + + withoutCopyright: true, + inverseButton: false, + hours12: false, + next: 'xdsoft_next', + prev : 'xdsoft_prev', + dayOfWeekStart: 0, + parentID: 'body', + timeHeightInTimePicker: 25, + timepickerScrollbar: true, + todayButton: true, + prevButton: true, + nextButton: true, + defaultSelect: true, + + scrollMonth: true, + scrollTime: true, + scrollInput: true, + + lazyInit: false, + mask: false, + validateOnBlur: true, + allowBlank: true, + yearStart: 1950, + yearEnd: 2050, + monthStart: 0, + monthEnd: 11, + style: '', + id: '', + fixed: false, + roundTime: 'round', // ceil, floor + className: '', + weekends: [], + highlightedDates: [], + highlightedPeriods: [], + allowDates : [], + allowDateRe : null, + disabledDates : [], + disabledWeekDays: [], + yearOffset: 0, + beforeShowDay: null, + + enterLikeTab: true, + showApplyButton: false, + insideParent: false, + }; + + var dateHelper = null, + defaultDateHelper = null, + globalLocaleDefault = 'en', + globalLocale = 'en'; + + var dateFormatterOptionsDefault = { + meridiem: ['AM', 'PM'] + }; + + var initDateFormatter = function(){ + var locale = default_options.i18n[globalLocale], + opts = { + days: locale.dayOfWeek, + daysShort: locale.dayOfWeekShort, + months: locale.months, + monthsShort: $.map(locale.months, function(n){ return n.substring(0, 3) }) + }; + + if (typeof DateFormatter === 'function') { + dateHelper = defaultDateHelper = new DateFormatter({ + dateSettings: $.extend({}, dateFormatterOptionsDefault, opts) + }); + } + }; + + var dateFormatters = { + moment: { + default_options:{ + format: 'YYYY/MM/DD HH:mm', + formatDate: 'YYYY/MM/DD', + formatTime: 'HH:mm', + }, + formatter: { + parseDate: function (date, format) { + if(isFormatStandard(format)){ + return defaultDateHelper.parseDate(date, format); + } + var d = moment(date, format); + return d.isValid() ? d.toDate() : false; + }, + + formatDate: function (date, format) { + if(isFormatStandard(format)){ + return defaultDateHelper.formatDate(date, format); + } + return moment(date).format(format); + }, + + formatMask: function(format){ + return format + .replace(/Y{4}/g, '9999') + .replace(/Y{2}/g, '99') + .replace(/M{2}/g, '19') + .replace(/D{2}/g, '39') + .replace(/H{2}/g, '29') + .replace(/m{2}/g, '59') + .replace(/s{2}/g, '59'); + }, + } + } + } + + // for locale settings + $.datetimepicker = { + setLocale: function(locale){ + var newLocale = default_options.i18n[locale] ? locale : globalLocaleDefault; + if (globalLocale !== newLocale) { + globalLocale = newLocale; + // reinit date formatter + initDateFormatter(); + } + }, + + setDateFormatter: function(dateFormatter) { + if(typeof dateFormatter === 'string' && dateFormatters.hasOwnProperty(dateFormatter)){ + var df = dateFormatters[dateFormatter]; + $.extend(default_options, df.default_options); + dateHelper = df.formatter; + } + else { + dateHelper = dateFormatter; + } + }, + }; + + var standardFormats = { + RFC_2822: 'D, d M Y H:i:s O', + ATOM: 'Y-m-d\TH:i:sP', + ISO_8601: 'Y-m-d\TH:i:sO', + RFC_822: 'D, d M y H:i:s O', + RFC_850: 'l, d-M-y H:i:s T', + RFC_1036: 'D, d M y H:i:s O', + RFC_1123: 'D, d M Y H:i:s O', + RSS: 'D, d M Y H:i:s O', + W3C: 'Y-m-d\TH:i:sP' + } + + var isFormatStandard = function(format){ + return Object.values(standardFormats).indexOf(format) === -1 ? false : true; + } + + $.extend($.datetimepicker, standardFormats); + + // first init date formatter + initDateFormatter(); + + // fix for ie8 + if (!window.getComputedStyle) { + window.getComputedStyle = function (el) { + this.el = el; + this.getPropertyValue = function (prop) { + var re = /(-([a-z]))/g; + if (prop === 'float') { + prop = 'styleFloat'; + } + if (re.test(prop)) { + prop = prop.replace(re, function (a, b, c) { + return c.toUpperCase(); + }); + } + return el.currentStyle[prop] || null; + }; + return this; + }; + } + if (!Array.prototype.indexOf) { + Array.prototype.indexOf = function (obj, start) { + var i, j; + for (i = (start || 0), j = this.length; i < j; i += 1) { + if (this[i] === obj) { return i; } + } + return -1; + }; + } + + Date.prototype.countDaysInMonth = function () { + return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate(); + }; + + $.fn.xdsoftScroller = function (options, percent) { + return this.each(function () { + var timeboxparent = $(this), + pointerEventToXY = function (e) { + var out = {x: 0, y: 0}, + touch; + if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') { + touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; + out.x = touch.clientX; + out.y = touch.clientY; + } else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') { + out.x = e.clientX; + out.y = e.clientY; + } + return out; + }, + getWheelDelta = function (e) { + var deltaY = 0; + + if ('detail' in e) { deltaY = e.detail; } + if ('wheelDelta' in e) { deltaY = -e.wheelDelta / 120; } + if ('wheelDeltaY' in e) { deltaY = -e.wheelDeltaY / 120; } + if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) { deltaY = 0; } + + deltaY *= 10; + + if ('deltaY' in e) { deltaY = -e.deltaY; } + + if (deltaY && e.deltaMode) { + if (e.deltaMode === 1) { + deltaY *= 40; + } else { + deltaY *= 800; + } + } + + return deltaY; + }, + timebox, + timeboxTop = 0, + parentHeight, + height, + scrollbar, + scroller, + maximumOffset = 100, + start = false, + startY = 0, + startTop = 0, + h1 = 0, + touchStart = false, + startTopScroll = 0, + calcOffset = function () {}; + + if (percent === 'hide') { + timeboxparent.find('.xdsoft_scrollbar').hide(); + return; + } + + if (!$(this).hasClass('xdsoft_scroller_box')) { + timebox = timeboxparent.children().eq(0); + timeboxTop = Math.abs(parseInt(timebox.css('marginTop'), 10)); + parentHeight = timeboxparent[0].clientHeight; + height = timebox[0].offsetHeight; + scrollbar = $('
    '); + scroller = $('
    '); + scrollbar.append(scroller); + + timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar); + calcOffset = function calcOffset(event) { + var offset = pointerEventToXY(event).y - startY + startTopScroll; + if (offset < 0) { + offset = 0; + } + if (offset + scroller[0].offsetHeight > h1) { + offset = h1 - scroller[0].offsetHeight; + } + timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]); + }; + + scroller + .on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) { + if (!parentHeight) { + timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); + } + + startY = pointerEventToXY(event).y; + startTopScroll = parseInt(scroller.css('marginTop'), 10); + h1 = scrollbar[0].offsetHeight; + + if (event.type === 'mousedown' || event.type === 'touchstart') { + if (options.ownerDocument) { + $(options.ownerDocument.body).addClass('xdsoft_noselect'); + } + $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft_scroller', function arguments_callee() { + $([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft_scroller', arguments_callee) + .off('mousemove.xdsoft_scroller', calcOffset) + .removeClass('xdsoft_noselect'); + }); + $(options.ownerDocument.body).on('mousemove.xdsoft_scroller', calcOffset); + } else { + touchStart = true; + event.stopPropagation(); + event.preventDefault(); + } + }) + .on('touchmove', function (event) { + if (touchStart) { + event.preventDefault(); + calcOffset(event); + } + }) + .on('touchend touchcancel', function () { + touchStart = false; + startTopScroll = 0; + }); + + timeboxparent + .on('scroll_element.xdsoft_scroller', function (event, percentage) { + if (!parentHeight) { + timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]); + } + percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage; + timeboxTop = parseFloat(Math.abs((timebox[0].offsetHeight - parentHeight) * percentage).toFixed(4)); + + scroller.css('marginTop', maximumOffset * percentage); + timebox.css('marginTop', -timeboxTop); + }) + .on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) { + var percent, sh; + parentHeight = timeboxparent[0].clientHeight; + height = timebox[0].offsetHeight; + percent = parentHeight / height; + sh = percent * scrollbar[0].offsetHeight; + if (percent > 1) { + scroller.hide(); + } else { + scroller.show(); + scroller.css('height', parseInt(sh > 10 ? sh : 10, 10)); + maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight; + if (noTriggerScroll !== true) { + timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || timeboxTop / (height - parentHeight)]); + } + } + }); + + timeboxparent.on('mousewheel', function (event) { + var deltaY = getWheelDelta(event.originalEvent); + var top = Math.max(0, timeboxTop - deltaY); + timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]); + event.stopPropagation(); + return false; + }); + + timeboxparent.on('touchstart', function (event) { + start = pointerEventToXY(event); + startTop = timeboxTop; + }); + + timeboxparent.on('touchmove', function (event) { + if (start) { + event.preventDefault(); + var coord = pointerEventToXY(event); + timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]); + } + }); + + timeboxparent.on('touchend touchcancel', function () { + start = false; + startTop = 0; + }); + } + timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); + }); + }; + + $.fn.datetimepicker = function (opt, opt2) { + var result = this, + KEY0 = 48, + KEY9 = 57, + _KEY0 = 96, + _KEY9 = 105, + CTRLKEY = 17, + CMDKEY = 91, + DEL = 46, + ENTER = 13, + ESC = 27, + BACKSPACE = 8, + ARROWLEFT = 37, + ARROWUP = 38, + ARROWRIGHT = 39, + ARROWDOWN = 40, + TAB = 9, + F5 = 116, + AKEY = 65, + CKEY = 67, + VKEY = 86, + ZKEY = 90, + YKEY = 89, + ctrlDown = false, + cmdDown = false, + options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options), + + lazyInitTimer = 0, + createDateTimePicker, + destroyDateTimePicker, + + lazyInit = function (input) { + input + .on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function initOnActionCallback() { + if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) { + return; + } + clearTimeout(lazyInitTimer); + lazyInitTimer = setTimeout(function () { + + if (!input.data('xdsoft_datetimepicker')) { + createDateTimePicker(input); + } + input + .off('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', initOnActionCallback) + .trigger('open.xdsoft'); + }, 100); + }); + }; + + createDateTimePicker = function (input) { + var datetimepicker = $('
    '), + xdsoft_copyright = $(''), + datepicker = $('
    '), + month_picker = $('
    ' + + '
    ' + + '
    ' + + '
    '), + calendar = $('
    '), + timepicker = $('
    '), + timeboxparent = timepicker.find('.xdsoft_time_box').eq(0), + timebox = $('
    '), + applyButton = $(''), + + monthselect = $('
    '), + yearselect = $('
    '), + triggerAfterOpen = false, + XDSoft_datetime, + + xchangeTimer, + timerclick, + current_time_index, + setPos, + timer = 0, + _xdsoft_datetime, + forEachAncestorOf; + + if (options.id) { + datetimepicker.attr('id', options.id); + } + if (options.style) { + datetimepicker.attr('style', options.style); + } + if (options.weeks) { + datetimepicker.addClass('xdsoft_showweeks'); + } + if (options.rtl) { + datetimepicker.addClass('xdsoft_rtl'); + } + + datetimepicker.addClass('xdsoft_' + options.theme); + datetimepicker.addClass(options.className); + + month_picker + .find('.xdsoft_month span') + .after(monthselect); + month_picker + .find('.xdsoft_year span') + .after(yearselect); + + month_picker + .find('.xdsoft_month,.xdsoft_year') + .on('touchstart mousedown.xdsoft', function (event) { + var select = $(this).find('.xdsoft_select').eq(0), + val = 0, + top = 0, + visible = select.is(':visible'), + items, + i; + + month_picker + .find('.xdsoft_select') + .hide(); + if (_xdsoft_datetime.currentTime) { + val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear'](); + } + + select[visible ? 'hide' : 'show'](); + for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) { + if (items.eq(i).data('value') === val) { + break; + } else { + top += items[0].offsetHeight; + } + } + + select.xdsoftScroller(options, top / (select.children()[0].offsetHeight - (select[0].clientHeight))); + event.stopPropagation(); + return false; + }); + + var handleTouchMoved = function (event) { + var evt = event.originalEvent; + var touchPosition = evt.touches ? evt.touches[0] : evt; + this.touchStartPosition = this.touchStartPosition || touchPosition; + var xMovement = Math.abs(this.touchStartPosition.clientX - touchPosition.clientX); + var yMovement = Math.abs(this.touchStartPosition.clientY - touchPosition.clientY); + var distance = Math.sqrt(xMovement * xMovement + yMovement * yMovement); + if(distance > options.touchMovedThreshold) { + this.touchMoved = true; + } + } + + month_picker + .find('.xdsoft_select') + .xdsoftScroller(options) + .on('touchstart mousedown.xdsoft', function (event) { + var evt = event.originalEvent; + this.touchMoved = false; + this.touchStartPosition = evt.touches ? evt.touches[0] : evt; + event.stopPropagation(); + event.preventDefault(); + }) + .on('touchmove', '.xdsoft_option', handleTouchMoved) + .on('touchend mousedown.xdsoft', '.xdsoft_option', function () { + if (!this.touchMoved) { + if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) { + _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); + } + + var year = _xdsoft_datetime.currentTime.getFullYear(); + if (_xdsoft_datetime && _xdsoft_datetime.currentTime) { + _xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value')); + } + + $(this).parent().parent().hide(); + + datetimepicker.trigger('xchange.xdsoft'); + if (options.onChangeMonth && typeof options.onChangeMonth === 'function') { + options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + + if (year !== _xdsoft_datetime.currentTime.getFullYear() && typeof options.onChangeYear === 'function') { + options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + } + }); + + datetimepicker.getValue = function () { + return _xdsoft_datetime.getCurrentTime(); + }; + + datetimepicker.setOptions = function (_options) { + var highlightedDates = {}; + + options = $.extend(true, {}, options, _options); + + if (_options.allowTimes && Array.isArray(_options.allowTimes) && _options.allowTimes.length) { + options.allowTimes = $.extend(true, [], _options.allowTimes); + } + + if (_options.weekends && Array.isArray(_options.weekends) && _options.weekends.length) { + options.weekends = $.extend(true, [], _options.weekends); + } + + if (_options.allowDates && Array.isArray(_options.allowDates) && _options.allowDates.length) { + options.allowDates = $.extend(true, [], _options.allowDates); + } + + if (_options.allowDateRe && Object.prototype.toString.call(_options.allowDateRe)==="[object String]") { + options.allowDateRe = new RegExp(_options.allowDateRe); + } + + if (_options.highlightedDates && Array.isArray(_options.highlightedDates) && _options.highlightedDates.length) { + $.each(_options.highlightedDates, function (index, value) { + var splitData = $.map(value.split(','), $.trim), + exDesc, + hDate = new HighlightedDate(dateHelper.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style + keyDate = dateHelper.formatDate(hDate.date, options.formatDate); + if (highlightedDates[keyDate] !== undefined) { + exDesc = highlightedDates[keyDate].desc; + if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) { + highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc; + } + } else { + highlightedDates[keyDate] = hDate; + } + }); + + options.highlightedDates = $.extend(true, [], highlightedDates); + } + + if (_options.highlightedPeriods && Array.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) { + highlightedDates = $.extend(true, [], options.highlightedDates); + $.each(_options.highlightedPeriods, function (index, value) { + var dateTest, // start date + dateEnd, + desc, + hDate, + keyDate, + exDesc, + style; + if (Array.isArray(value)) { + dateTest = value[0]; + dateEnd = value[1]; + desc = value[2]; + style = value[3]; + } + else { + var splitData = $.map(value.split(','), $.trim); + dateTest = dateHelper.parseDate(splitData[0], options.formatDate); + dateEnd = dateHelper.parseDate(splitData[1], options.formatDate); + desc = splitData[2]; + style = splitData[3]; + } + + while (dateTest <= dateEnd) { + hDate = new HighlightedDate(dateTest, desc, style); + keyDate = dateHelper.formatDate(dateTest, options.formatDate); + dateTest.setDate(dateTest.getDate() + 1); + if (highlightedDates[keyDate] !== undefined) { + exDesc = highlightedDates[keyDate].desc; + if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) { + highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc; + } + } else { + highlightedDates[keyDate] = hDate; + } + } + }); + + options.highlightedDates = $.extend(true, [], highlightedDates); + } + + if (_options.disabledDates && Array.isArray(_options.disabledDates) && _options.disabledDates.length) { + options.disabledDates = $.extend(true, [], _options.disabledDates); + } + + if (_options.disabledWeekDays && Array.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) { + options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays); + } + + if ((options.open || options.opened) && (!options.inline)) { + input.trigger('open.xdsoft'); + } + + if (options.inline) { + triggerAfterOpen = true; + datetimepicker.addClass('xdsoft_inline'); + input.after(datetimepicker).hide(); + } + + if (options.inverseButton) { + options.next = 'xdsoft_prev'; + options.prev = 'xdsoft_next'; + } + + if (options.datepicker) { + datepicker.addClass('active'); + } else { + datepicker.removeClass('active'); + } + + if (options.timepicker) { + timepicker.addClass('active'); + } else { + timepicker.removeClass('active'); + } + + if (options.value) { + _xdsoft_datetime.setCurrentTime(options.value); + if (input && input.val) { + input.val(_xdsoft_datetime.str); + } + } + + if (isNaN(options.dayOfWeekStart)) { + options.dayOfWeekStart = 0; + } else { + options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7; + } + + if (!options.timepickerScrollbar) { + timeboxparent.xdsoftScroller(options, 'hide'); + } + + if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) { + options.minDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.minDate), options.formatDate); + } + + if (options.maxDate && /^[\+\-](.*)$/.test(options.maxDate)) { + options.maxDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate); + } + + if (options.minDateTime && /^\+(.*)$/.test(options.minDateTime)) { + options.minDateTime = _xdsoft_datetime.strToDateTime(options.minDateTime).dateFormat(options.formatDate); + } + + if (options.maxDateTime && /^\+(.*)$/.test(options.maxDateTime)) { + options.maxDateTime = _xdsoft_datetime.strToDateTime(options.maxDateTime).dateFormat(options.formatDate); + } + + applyButton.toggle(options.showApplyButton); + + month_picker + .find('.xdsoft_today_button') + .css('visibility', !options.todayButton ? 'hidden' : 'visible'); + + month_picker + .find('.' + options.prev) + .css('visibility', !options.prevButton ? 'hidden' : 'visible'); + + month_picker + .find('.' + options.next) + .css('visibility', !options.nextButton ? 'hidden' : 'visible'); + + setMask(options); + + if (options.validateOnBlur) { + input + .off('blur.xdsoft') + .on('blur.xdsoft', function () { + if (options.allowBlank && (!$(this).val().trim().length || + (typeof options.mask === "string" && $(this).val().trim() === options.mask.replace(/[0-9]/g, '_')))) { + $(this).val(null); + datetimepicker.data('xdsoft_datetime').empty(); + } else { + var d = dateHelper.parseDate($(this).val(), options.format); + if (d) { // parseDate() may skip some invalid parts like date or time, so make it clear for user: show parsed date/time + $(this).val(dateHelper.formatDate(d, options.format)); + } else { + var splittedHours = +([$(this).val()[0], $(this).val()[1]].join('')), + splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join('')); + + // parse the numbers as 0312 => 03:12 + if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) { + $(this).val([splittedHours, splittedMinutes].map(function (item) { + return item > 9 ? item : '0' + item; + }).join(':')); + } else { + $(this).val(dateHelper.formatDate(_xdsoft_datetime.now(), options.format)); + } + } + datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val()); + } + + datetimepicker.trigger('changedatetime.xdsoft'); + datetimepicker.trigger('close.xdsoft'); + }); + } + options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1; + + datetimepicker + .trigger('xchange.xdsoft') + .trigger('afterOpen.xdsoft'); + }; + + datetimepicker + .data('options', options) + .on('touchstart mousedown.xdsoft', function (event) { + event.stopPropagation(); + event.preventDefault(); + yearselect.hide(); + monthselect.hide(); + return false; + }); + + //scroll_element = timepicker.find('.xdsoft_time_box'); + timeboxparent.append(timebox); + timeboxparent.xdsoftScroller(options); + + datetimepicker.on('afterOpen.xdsoft', function () { + timeboxparent.xdsoftScroller(options); + }); + + datetimepicker + .append(datepicker) + .append(timepicker); + + if (options.withoutCopyright !== true) { + datetimepicker + .append(xdsoft_copyright); + } + + datepicker + .append(month_picker) + .append(calendar) + .append(applyButton); + + if (options.insideParent) { + $(input).parent().append(datetimepicker); + } else { + $(options.parentID).append(datetimepicker); + } + + XDSoft_datetime = function () { + var _this = this; + _this.now = function (norecursion) { + var d = new Date(), + date, + time; + + if (!norecursion && options.defaultDate) { + date = _this.strToDateTime(options.defaultDate); + d.setFullYear(date.getFullYear()); + d.setMonth(date.getMonth()); + d.setDate(date.getDate()); + } + + d.setFullYear(d.getFullYear()); + + if (!norecursion && options.defaultTime) { + time = _this.strtotime(options.defaultTime); + d.setHours(time.getHours()); + d.setMinutes(time.getMinutes()); + d.setSeconds(time.getSeconds()); + d.setMilliseconds(time.getMilliseconds()); + } + return d; + }; + + _this.isValidDate = function (d) { + if (Object.prototype.toString.call(d) !== "[object Date]") { + return false; + } + return !isNaN(d.getTime()); + }; + + _this.setCurrentTime = function (dTime, requireValidDate) { + if (typeof dTime === 'string') { + _this.currentTime = _this.strToDateTime(dTime); + } + else if (_this.isValidDate(dTime)) { + _this.currentTime = dTime; + } + else if (!dTime && !requireValidDate && options.allowBlank && !options.inline) { + _this.currentTime = null; + } + else { + _this.currentTime = _this.now(); + } + + datetimepicker.trigger('xchange.xdsoft'); + }; + + _this.empty = function () { + _this.currentTime = null; + }; + + _this.getCurrentTime = function () { + return _this.currentTime; + }; + + _this.nextMonth = function () { + + if (_this.currentTime === undefined || _this.currentTime === null) { + _this.currentTime = _this.now(); + } + + var month = _this.currentTime.getMonth() + 1, + year; + if (month === 12) { + _this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1); + month = 0; + } + + year = _this.currentTime.getFullYear(); + + _this.currentTime.setDate( + Math.min( + new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), + _this.currentTime.getDate() + ) + ); + _this.currentTime.setMonth(month); + + if (options.onChangeMonth && typeof options.onChangeMonth === 'function') { + options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + + if (year !== _this.currentTime.getFullYear() && typeof options.onChangeYear === 'function') { + options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + + datetimepicker.trigger('xchange.xdsoft'); + return month; + }; + + _this.prevMonth = function () { + + if (_this.currentTime === undefined || _this.currentTime === null) { + _this.currentTime = _this.now(); + } + + var month = _this.currentTime.getMonth() - 1; + if (month === -1) { + _this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1); + month = 11; + } + _this.currentTime.setDate( + Math.min( + new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), + _this.currentTime.getDate() + ) + ); + _this.currentTime.setMonth(month); + if (options.onChangeMonth && typeof options.onChangeMonth === 'function') { + options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + datetimepicker.trigger('xchange.xdsoft'); + return month; + }; + + _this.getWeekOfYear = function (datetime) { + if (options.onGetWeekOfYear && typeof options.onGetWeekOfYear === 'function') { + var week = options.onGetWeekOfYear.call(datetimepicker, datetime); + if (typeof week !== 'undefined') { + return week; + } + } + var onejan = new Date(datetime.getFullYear(), 0, 1); + + //First week of the year is th one with the first Thursday according to ISO8601 + if (onejan.getDay() !== 4) { + onejan.setMonth(0, 1 + ((4 - onejan.getDay()+ 7) % 7)); + } + + return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7); + }; + + _this.strToDateTime = function (sDateTime) { + var tmpDate = [], timeOffset, currentTime; + + if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) { + return sDateTime; + } + + tmpDate = /^([+-]{1})(.*)$/.exec(sDateTime); + + if (tmpDate) { + tmpDate[2] = dateHelper.parseDate(tmpDate[2], options.formatDate); + } + + if (tmpDate && tmpDate[2]) { + timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000; + currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset); + } else { + currentTime = sDateTime ? dateHelper.parseDate(sDateTime, options.format) : _this.now(); + } + + if (!_this.isValidDate(currentTime)) { + currentTime = _this.now(); + } + + return currentTime; + }; + + _this.strToDate = function (sDate) { + if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) { + return sDate; + } + + var currentTime = sDate ? dateHelper.parseDate(sDate, options.formatDate) : _this.now(true); + if (!_this.isValidDate(currentTime)) { + currentTime = _this.now(true); + } + return currentTime; + }; + + _this.strtotime = function (sTime) { + if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) { + return sTime; + } + var currentTime = sTime ? dateHelper.parseDate(sTime, options.formatTime) : _this.now(true); + if (!_this.isValidDate(currentTime)) { + currentTime = _this.now(true); + } + return currentTime; + }; + + _this.str = function () { + var format = options.format; + if (options.yearOffset) { + format = format.replace('Y', _this.currentTime.getFullYear() + options.yearOffset); + format = format.replace('y', String(_this.currentTime.getFullYear() + options.yearOffset).substring(2, 4)); + } + return dateHelper.formatDate(_this.currentTime, format); + }; + _this.currentTime = this.now(); + }; + + _xdsoft_datetime = new XDSoft_datetime(); + + applyButton.on('touchend click', function (e) {//pathbrite + e.preventDefault(); + datetimepicker.data('changed', true); + _xdsoft_datetime.setCurrentTime(getCurrentValue()); + input.val(_xdsoft_datetime.str()); + datetimepicker.trigger('close.xdsoft'); + }); + month_picker + .find('.xdsoft_today_button') + .on('touchend mousedown.xdsoft', function () { + datetimepicker.data('changed', true); + _xdsoft_datetime.setCurrentTime(0, true); + datetimepicker.trigger('afterOpen.xdsoft'); + }).on('dblclick.xdsoft', function () { + var currentDate = _xdsoft_datetime.getCurrentTime(), minDate, maxDate; + currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()); + minDate = _xdsoft_datetime.strToDate(options.minDate); + minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); + if (currentDate < minDate) { + return; + } + maxDate = _xdsoft_datetime.strToDate(options.maxDate); + maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()); + if (currentDate > maxDate) { + return; + } + input.val(_xdsoft_datetime.str()); + input.trigger('change'); + datetimepicker.trigger('close.xdsoft'); + }); + month_picker + .find('.xdsoft_prev,.xdsoft_next') + .on('touchend mousedown.xdsoft', function () { + var $this = $(this), + timer = 0, + stop = false; + + (function arguments_callee1(v) { + if ($this.hasClass(options.next)) { + _xdsoft_datetime.nextMonth(); + } else if ($this.hasClass(options.prev)) { + _xdsoft_datetime.prevMonth(); + } + if (options.monthChangeSpinner) { + if (!stop) { + timer = setTimeout(arguments_callee1, v || 100); + } + } + }(500)); + + $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee2() { + clearTimeout(timer); + stop = true; + $([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft', arguments_callee2); + }); + }); + + timepicker + .find('.xdsoft_prev,.xdsoft_next') + .on('touchend mousedown.xdsoft', function () { + var $this = $(this), + timer = 0, + stop = false, + period = 110; + (function arguments_callee4(v) { + var pheight = timeboxparent[0].clientHeight, + height = timebox[0].offsetHeight, + top = Math.abs(parseInt(timebox.css('marginTop'), 10)); + /** + * Fixes a bug which happens if: + * top is < the timeHeightInTimePicker, it will cause the up arrow to stop working + * same for the down arrow if it's not exactly on the pixel + */ + if (top < options.timeHeightInTimePicker) { + top = options.timeHeightInTimePicker; + } else if ($this.hasClass(options.next) && (height - pheight) < top) { + timebox.css('marginTop', '-' + height + 'px'); + } + + if ($this.hasClass(options.next) && (height - pheight) > top) { + timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px'); + } else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) { + timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px'); + } + /** + * Fixed bug: + * When using css3 transition, it will cause a bug that you cannot scroll the timepicker list. + * The reason is that the transition-duration time, if you set it to 0, all things fine, otherwise, this + * would cause a bug when you use jquery.css method. + * Let's say: * { transition: all .5s ease; } + * jquery timebox.css('marginTop') will return the original value which is before you clicking the next/prev button, + * meanwhile the timebox[0].style.marginTop will return the right value which is after you clicking the + * next/prev button. + * + * What we should do: + * Replace timebox.css('marginTop') with timebox[0].style.marginTop. + */ + timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox[0].style.marginTop, 10) / (height - pheight))]); + period = (period > 10) ? 10 : period - 10; + if (!stop) { + timer = setTimeout(arguments_callee4, v || period); + } + }(500)); + $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee5() { + clearTimeout(timer); + stop = true; + $([options.ownerDocument.body, options.contentWindow]) + .off('touchend mouseup.xdsoft', arguments_callee5); + }); + }); + + xchangeTimer = 0; + // base handler - generating a calendar and timepicker + datetimepicker + .on('xchange.xdsoft', function (event) { + clearTimeout(xchangeTimer); + xchangeTimer = setTimeout(function () { + + if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null || isNaN(_xdsoft_datetime.currentTime.getTime())) { + _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); + } + + var table = '', + start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0), + i = 0, + j, + today = _xdsoft_datetime.now(), + maxDate = false, + minDate = false, + minDateTime = false, + maxDateTime = false, + hDate, + day, + d, + y, + m, + w, + classes = [], + customDateSettings, + newRow = true, + time = '', + h, + line_time, + description; + + while (start.getDay() !== options.dayOfWeekStart) { + start.setDate(start.getDate() - 1); + } + + table += ''; + + if (options.weeks) { + table += ''; + } + + for (j = 0; j < 7; j += 1) { + table += ''; + } + + table += ''; + table += ''; + + if (options.maxDate !== false) { + maxDate = _xdsoft_datetime.strToDate(options.maxDate); + maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999); + } + + if (options.minDate !== false) { + minDate = _xdsoft_datetime.strToDate(options.minDate); + minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); + } + + if (options.minDateTime !== false) { + minDateTime = _xdsoft_datetime.strToDate(options.minDateTime); + minDateTime = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), minDateTime.getHours(), minDateTime.getMinutes(), minDateTime.getSeconds()); + } + + if (options.maxDateTime !== false) { + maxDateTime = _xdsoft_datetime.strToDate(options.maxDateTime); + maxDateTime = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), maxDateTime.getHours(), maxDateTime.getMinutes(), maxDateTime.getSeconds()); + } + + var maxDateTimeDay; + if (maxDateTime !== false) { + maxDateTimeDay = ((maxDateTime.getFullYear() * 12) + maxDateTime.getMonth()) * 31 + maxDateTime.getDate(); + } + + while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) { + classes = []; + i += 1; + + day = start.getDay(); + d = start.getDate(); + y = start.getFullYear(); + m = start.getMonth(); + w = _xdsoft_datetime.getWeekOfYear(start); + description = ''; + + classes.push('xdsoft_date'); + + if (options.beforeShowDay && typeof options.beforeShowDay.call === 'function') { + customDateSettings = options.beforeShowDay.call(datetimepicker, start); + } else { + customDateSettings = null; + } + + if(options.allowDateRe && Object.prototype.toString.call(options.allowDateRe) === "[object RegExp]"){ + if(!options.allowDateRe.test(dateHelper.formatDate(start, options.formatDate))){ + classes.push('xdsoft_disabled'); + } + } + + if(options.allowDates && options.allowDates.length>0){ + if(options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate)) === -1){ + classes.push('xdsoft_disabled'); + } + } + + var currentDay = ((start.getFullYear() * 12) + start.getMonth()) * 31 + start.getDate(); + if ((maxDate !== false && start > maxDate) || (minDateTime !== false && start < minDateTime) || (minDate !== false && start < minDate) || (maxDateTime !== false && currentDay > maxDateTimeDay) || (customDateSettings && customDateSettings[0] === false)) { + classes.push('xdsoft_disabled'); + } + + if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) { + classes.push('xdsoft_disabled'); + } + + if (options.disabledWeekDays.indexOf(day) !== -1) { + classes.push('xdsoft_disabled'); + } + + if (input.is('[disabled]')) { + classes.push('xdsoft_disabled'); + } + + if (customDateSettings && customDateSettings[1] !== "") { + classes.push(customDateSettings[1]); + } + + if (_xdsoft_datetime.currentTime.getMonth() !== m) { + classes.push('xdsoft_other_month'); + } + + if ((options.defaultSelect || datetimepicker.data('changed')) && dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) { + classes.push('xdsoft_current'); + } + + if (dateHelper.formatDate(today, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) { + classes.push('xdsoft_today'); + } + + if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) { + classes.push('xdsoft_weekend'); + } + + if (options.highlightedDates[dateHelper.formatDate(start, options.formatDate)] !== undefined) { + hDate = options.highlightedDates[dateHelper.formatDate(start, options.formatDate)]; + classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style); + description = hDate.desc === undefined ? '' : hDate.desc; + } + + if (options.beforeShowDay && typeof options.beforeShowDay === 'function') { + classes.push(options.beforeShowDay(start)); + } + + if (newRow) { + table += ''; + newRow = false; + if (options.weeks) { + table += ''; + } + } + + table += ''; + + if (start.getDay() === options.dayOfWeekStartPrev) { + table += ''; + newRow = true; + } + + start.setDate(d + 1); + } + table += '
    ' + options.i18n[globalLocale].dayOfWeekShort[(j + options.dayOfWeekStart) % 7] + '
    ' + w + '' + + '
    ' + d + '
    ' + + '
    '; + + calendar.html(table); + + month_picker.find('.xdsoft_label span').eq(0).text(options.i18n[globalLocale].months[_xdsoft_datetime.currentTime.getMonth()]); + month_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear() + options.yearOffset); + + // generate timebox + time = ''; + h = ''; + m = ''; + + var minTimeMinutesOfDay = 0; + if (options.minTime !== false) { + var t = _xdsoft_datetime.strtotime(options.minTime); + minTimeMinutesOfDay = 60 * t.getHours() + t.getMinutes(); + } + var maxTimeMinutesOfDay = 24 * 60; + if (options.maxTime !== false) { + var t = _xdsoft_datetime.strtotime(options.maxTime); + maxTimeMinutesOfDay = 60 * t.getHours() + t.getMinutes(); + } + + if (options.minDateTime !== false) { + var t = _xdsoft_datetime.strToDateTime(options.minDateTime); + var currentDayIsMinDateTimeDay = dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(t, options.formatDate); + if (currentDayIsMinDateTimeDay) { + var m = 60 * t.getHours() + t.getMinutes(); + if (m > minTimeMinutesOfDay) minTimeMinutesOfDay = m; + } + } + + if (options.maxDateTime !== false) { + var t = _xdsoft_datetime.strToDateTime(options.maxDateTime); + var currentDayIsMaxDateTimeDay = dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(t, options.formatDate); + if (currentDayIsMaxDateTimeDay) { + var m = 60 * t.getHours() + t.getMinutes(); + if (m < maxTimeMinutesOfDay) maxTimeMinutesOfDay = m; + } + } + + line_time = function line_time(h, m) { + var now = _xdsoft_datetime.now(), current_time, + isALlowTimesInit = options.allowTimes && Array.isArray(options.allowTimes) && options.allowTimes.length; + now.setHours(h); + h = parseInt(now.getHours(), 10); + now.setMinutes(m); + m = parseInt(now.getMinutes(), 10); + classes = []; + var currentMinutesOfDay = 60 * h + m; + if (input.is('[disabled]') || (currentMinutesOfDay >= maxTimeMinutesOfDay) || (currentMinutesOfDay < minTimeMinutesOfDay)) { + classes.push('xdsoft_disabled'); + } + + current_time = new Date(_xdsoft_datetime.currentTime); + current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10)); + + if (!isALlowTimesInit) { + current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step); + } + + if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && ((!isALlowTimesInit && options.step > 59) || current_time.getMinutes() === parseInt(m, 10))) { + if (options.defaultSelect || datetimepicker.data('changed')) { + classes.push('xdsoft_current'); + } else if (options.initTime) { + classes.push('xdsoft_init_time'); + } + } + if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) { + classes.push('xdsoft_today'); + } + time += '
    ' + dateHelper.formatDate(now, options.formatTime) + '
    '; + }; + + if (!options.allowTimes || !Array.isArray(options.allowTimes) || !options.allowTimes.length) { + for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) { + for (j = 0; j < 60; j += options.step) { + var currentMinutesOfDay = i * 60 + j; + if (currentMinutesOfDay < minTimeMinutesOfDay) continue; + if (currentMinutesOfDay >= maxTimeMinutesOfDay) continue; + h = (i < 10 ? '0' : '') + i; + m = (j < 10 ? '0' : '') + j; + line_time(h, m); + } + } + } else { + for (i = 0; i < options.allowTimes.length; i += 1) { + h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours(); + m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes(); + line_time(h, m); + } + } + + timebox.html(time); + + opt = ''; + + for (i = parseInt(options.yearStart, 10); i <= parseInt(options.yearEnd, 10); i += 1) { + opt += '
    ' + (i + options.yearOffset) + '
    '; + } + yearselect.children().eq(0) + .html(opt); + + for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) { + opt += '
    ' + options.i18n[globalLocale].months[i] + '
    '; + } + monthselect.children().eq(0).html(opt); + $(datetimepicker) + .trigger('generate.xdsoft'); + }, 10); + event.stopPropagation(); + }) + .on('afterOpen.xdsoft', function () { + if (options.timepicker) { + var classType, pheight, height, top; + if (timebox.find('.xdsoft_current').length) { + classType = '.xdsoft_current'; + } else if (timebox.find('.xdsoft_init_time').length) { + classType = '.xdsoft_init_time'; + } + if (classType) { + pheight = timeboxparent[0].clientHeight; + height = timebox[0].offsetHeight; + top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1; + if ((height - pheight) < top) { + top = height - pheight; + } + timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]); + } else { + timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]); + } + } + }); + + timerclick = 0; + calendar + .on('touchend click.xdsoft', 'td', function (xdevent) { + xdevent.stopPropagation(); // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap + timerclick += 1; + var $this = $(this), + currentTime = _xdsoft_datetime.currentTime; + + if (currentTime === undefined || currentTime === null) { + _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); + currentTime = _xdsoft_datetime.currentTime; + } + + if ($this.hasClass('xdsoft_disabled')) { + return false; + } + + currentTime.setDate(1); + currentTime.setFullYear($this.data('year')); + currentTime.setMonth($this.data('month')); + currentTime.setDate($this.data('date')); + + datetimepicker.trigger('select.xdsoft', [currentTime]); + + input.val(_xdsoft_datetime.str()); + + if (options.onSelectDate && typeof options.onSelectDate === 'function') { + options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); + } + + datetimepicker.data('changed', true); + datetimepicker.trigger('xchange.xdsoft'); + datetimepicker.trigger('changedatetime.xdsoft'); + if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) { + datetimepicker.trigger('close.xdsoft'); + } + setTimeout(function () { + timerclick = 0; + }, 200); + }); + + timebox + .on('touchstart', 'div', function (xdevent) { + this.touchMoved = false; + }) + .on('touchmove', 'div', handleTouchMoved) + .on('touchend click.xdsoft', 'div', function (xdevent) { + if (!this.touchMoved) { + xdevent.stopPropagation(); + var $this = $(this), + currentTime = _xdsoft_datetime.currentTime; + + if (currentTime === undefined || currentTime === null) { + _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); + currentTime = _xdsoft_datetime.currentTime; + } + + if ($this.hasClass('xdsoft_disabled')) { + return false; + } + currentTime.setHours($this.data('hour')); + currentTime.setMinutes($this.data('minute')); + datetimepicker.trigger('select.xdsoft', [currentTime]); + + datetimepicker.data('input').val(_xdsoft_datetime.str()); + + if (options.onSelectTime && typeof options.onSelectTime === 'function') { + options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); + } + datetimepicker.data('changed', true); + datetimepicker.trigger('xchange.xdsoft'); + datetimepicker.trigger('changedatetime.xdsoft'); + if (options.inline !== true && options.closeOnTimeSelect === true) { + datetimepicker.trigger('close.xdsoft'); + } + } + }); + + datepicker + .on('mousewheel.xdsoft', function (event) { + if (!options.scrollMonth) { + return true; + } + if (event.deltaY < 0) { + _xdsoft_datetime.nextMonth(); + } else { + _xdsoft_datetime.prevMonth(); + } + return false; + }); + + input + .on('mousewheel.xdsoft', function (event) { + if (!options.scrollInput) { + return true; + } + if (!options.datepicker && options.timepicker) { + current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0; + if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) { + current_time_index += event.deltaY; + } + if (timebox.children().eq(current_time_index).length) { + timebox.children().eq(current_time_index).trigger('mousedown'); + } + return false; + } + if (options.datepicker && !options.timepicker) { + datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]); + if (input.val) { + input.val(_xdsoft_datetime.str()); + } + datetimepicker.trigger('changedatetime.xdsoft'); + return false; + } + }); + + datetimepicker + .on('changedatetime.xdsoft', function (event) { + if (options.onChangeDateTime && typeof options.onChangeDateTime === 'function') { + var $input = datetimepicker.data('input'); + options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event); + delete options.value; + $input.trigger('change'); + } + }) + .on('generate.xdsoft', function () { + if (options.onGenerate && typeof options.onGenerate === 'function') { + options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + if (triggerAfterOpen) { + datetimepicker.trigger('afterOpen.xdsoft'); + triggerAfterOpen = false; + } + }) + .on('click.xdsoft', function (xdevent) { + xdevent.stopPropagation(); + }); + + current_time_index = 0; + + /** + * Runs the callback for each of the specified node's ancestors. + * + * Return FALSE from the callback to stop ascending. + * + * @param {DOMNode} node + * @param {Function} callback + * @returns {undefined} + */ + forEachAncestorOf = function (node, callback) { + do { + node = node.parentNode; + + if (!node || callback(node) === false) { + break; + } + } while (node.nodeName !== 'HTML'); + }; + + /** + * Sets the position of the picker. + * + * @returns {undefined} + */ + setPos = function () { + var dateInputOffset, + dateInputElem, + verticalPosition, + left, + position, + datetimepickerElem, + dateInputHasFixedAncestor, + $dateInput, + windowWidth, + verticalAnchorEdge, + datetimepickerCss, + windowHeight, + windowScrollTop; + + $dateInput = datetimepicker.data('input'); + dateInputOffset = $dateInput.offset(); + dateInputElem = $dateInput[0]; + + verticalAnchorEdge = 'top'; + verticalPosition = (dateInputOffset.top + dateInputElem.offsetHeight) - 1; + left = dateInputOffset.left; + position = "absolute"; + + windowWidth = $(options.contentWindow).width(); + windowHeight = $(options.contentWindow).height(); + windowScrollTop = $(options.contentWindow).scrollTop(); + + if ((options.ownerDocument.documentElement.clientWidth - dateInputOffset.left) < datepicker.parent().outerWidth(true)) { + var diff = datepicker.parent().outerWidth(true) - dateInputElem.offsetWidth; + left = left - diff; + } + + if ($dateInput.parent().css('direction') === 'rtl') { + left -= (datetimepicker.outerWidth() - $dateInput.outerWidth()); + } + + if (options.fixed) { + verticalPosition -= windowScrollTop; + left -= $(options.contentWindow).scrollLeft(); + position = "fixed"; + } else { + dateInputHasFixedAncestor = false; + + forEachAncestorOf(dateInputElem, function (ancestorNode) { + if (ancestorNode === null) { + return false; + } + + if (options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position') === 'fixed') { + dateInputHasFixedAncestor = true; + return false; + } + }); + + if (dateInputHasFixedAncestor && !options.insideParent) { + position = 'fixed'; + + //If the picker won't fit entirely within the viewport then display it above the date input. + if (verticalPosition + datetimepicker.outerHeight() > windowHeight + windowScrollTop) { + verticalAnchorEdge = 'bottom'; + verticalPosition = (windowHeight + windowScrollTop) - dateInputOffset.top; + } else { + verticalPosition -= windowScrollTop; + } + } else { + if (verticalPosition + datetimepicker[0].offsetHeight > windowHeight + windowScrollTop) { + verticalPosition = dateInputOffset.top - datetimepicker[0].offsetHeight + 1; + } + } + + if (verticalPosition < 0) { + verticalPosition = 0; + } + + if (left + dateInputElem.offsetWidth > windowWidth) { + left = windowWidth - dateInputElem.offsetWidth; + } + } + + datetimepickerElem = datetimepicker[0]; + + forEachAncestorOf(datetimepickerElem, function (ancestorNode) { + var ancestorNodePosition; + + ancestorNodePosition = options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position'); + + if (ancestorNodePosition === 'relative' && windowWidth >= ancestorNode.offsetWidth) { + left = left - ((windowWidth - ancestorNode.offsetWidth) / 2); + return false; + } + }); + + datetimepickerCss = { + position: position, + left: options.insideParent ? dateInputElem.offsetLeft : left, + top: '', //Initialize to prevent previous values interfering with new ones. + bottom: '' //Initialize to prevent previous values interfering with new ones. + }; + + if (options.insideParent) { + datetimepickerCss[verticalAnchorEdge] = dateInputElem.offsetTop + dateInputElem.offsetHeight; + } else { + datetimepickerCss[verticalAnchorEdge] = verticalPosition; + } + + datetimepicker.css(datetimepickerCss); + }; + + datetimepicker + .on('open.xdsoft', function (event) { + var onShow = true; + if (options.onShow && typeof options.onShow === 'function') { + onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); + } + if (onShow !== false) { + datetimepicker.show(); + setPos(); + $(options.contentWindow) + .off('resize.xdsoft', setPos) + .on('resize.xdsoft', setPos); + + if (options.closeOnWithoutClick) { + $([options.ownerDocument.body, options.contentWindow]).on('touchstart mousedown.xdsoft', function arguments_callee6() { + datetimepicker.trigger('close.xdsoft'); + $([options.ownerDocument.body, options.contentWindow]).off('touchstart mousedown.xdsoft', arguments_callee6); + }); + } + } + }) + .on('close.xdsoft', function (event) { + var onClose = true; + month_picker + .find('.xdsoft_month,.xdsoft_year') + .find('.xdsoft_select') + .hide(); + if (options.onClose && typeof options.onClose === 'function') { + onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); + } + if (onClose !== false && !options.opened && !options.inline) { + datetimepicker.hide(); + } + event.stopPropagation(); + }) + .on('toggle.xdsoft', function () { + if (datetimepicker.is(':visible')) { + datetimepicker.trigger('close.xdsoft'); + } else { + datetimepicker.trigger('open.xdsoft'); + } + }) + .data('input', input); + + timer = 0; + + datetimepicker.data('xdsoft_datetime', _xdsoft_datetime); + datetimepicker.setOptions(options); + + function getCurrentValue() { + var ct = false, time; + + if (options.startDate) { + ct = _xdsoft_datetime.strToDate(options.startDate); + } else { + ct = options.value || ((input && input.val && input.val()) ? input.val() : ''); + if (ct) { + ct = _xdsoft_datetime.strToDateTime(ct); + if (options.yearOffset) { + ct = new Date(ct.getFullYear() - options.yearOffset, ct.getMonth(), ct.getDate(), ct.getHours(), ct.getMinutes(), ct.getSeconds(), ct.getMilliseconds()); + } + } else if (options.defaultDate) { + ct = _xdsoft_datetime.strToDateTime(options.defaultDate); + if (options.defaultTime) { + time = _xdsoft_datetime.strtotime(options.defaultTime); + ct.setHours(time.getHours()); + ct.setMinutes(time.getMinutes()); + } + } + } + + if (ct && _xdsoft_datetime.isValidDate(ct)) { + datetimepicker.data('changed', true); + } else { + ct = ''; + } + + return ct || 0; + } + + function setMask(options) { + + var isValidValue = function (mask, value) { + var reg = mask + .replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1') + .replace(/_/g, '{digit+}') + .replace(/([0-9]{1})/g, '{digit$1}') + .replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}') + .replace(/\{digit[\+]\}/g, '[0-9_]{1}'); + return (new RegExp(reg)).test(value); + }, + getCaretPos = function (input) { + try { + if (options.ownerDocument.selection && options.ownerDocument.selection.createRange) { + var range = options.ownerDocument.selection.createRange(); + return range.getBookmark().charCodeAt(2) - 2; + } + if (input.setSelectionRange) { + return input.selectionStart; + } + } catch (e) { + return 0; + } + }, + setCaretPos = function (node, pos) { + node = (typeof node === "string" || node instanceof String) ? options.ownerDocument.getElementById(node) : node; + if (!node) { + return false; + } + if (node.createTextRange) { + var textRange = node.createTextRange(); + textRange.collapse(true); + textRange.moveEnd('character', pos); + textRange.moveStart('character', pos); + textRange.select(); + return true; + } + if (node.setSelectionRange) { + node.setSelectionRange(pos, pos); + return true; + } + return false; + }; + + if(options.mask) { + input.off('keydown.xdsoft'); + } + + if (options.mask === true) { + if (dateHelper.formatMask) { + options.mask = dateHelper.formatMask(options.format) + } else { + options.mask = options.format + .replace(/Y/g, '9999') + .replace(/F/g, '9999') + .replace(/m/g, '19') + .replace(/d/g, '39') + .replace(/H/g, '29') + .replace(/i/g, '59') + .replace(/s/g, '59'); + } + } + + if (typeof options.mask === 'string') { + if (!isValidValue(options.mask, input.val())) { + input.val(options.mask.replace(/[0-9]/g, '_')); + setCaretPos(input[0], 0); + } + + input.on('paste.xdsoft', function (event) { + // couple options here + // 1. return false - tell them they can't paste + // 2. insert over current characters - minimal validation + // 3. full fledged parsing and validation + // let's go option 2 for now + + // fires multiple times for some reason + + // https://stackoverflow.com/a/30496488/1366033 + var clipboardData = event.clipboardData || event.originalEvent.clipboardData || window.clipboardData, + pastedData = clipboardData.getData('text'), + val = this.value, + pos = this.selectionStart + + var valueBeforeCursor = val.substr(0, pos); + var valueAfterPaste = val.substr(pos + pastedData.length); + + val = valueBeforeCursor + pastedData + valueAfterPaste; + pos += pastedData.length; + + if (isValidValue(options.mask, val)) { + this.value = val; + setCaretPos(this, pos); + } else if (val.trim() === '') { + this.value = options.mask.replace(/[0-9]/g, '_'); + } else { + input.trigger('error_input.xdsoft'); + } + + event.preventDefault(); + return false; + }); + + input.on('keydown.xdsoft', function (event) { + var val = this.value, + key = event.which, + pos = this.selectionStart, + selEnd = this.selectionEnd, + hasSel = pos !== selEnd, + digit; + + // only alow these characters + if (((key >= KEY0 && key <= KEY9) || + (key >= _KEY0 && key <= _KEY9)) || + (key === BACKSPACE || key === DEL)) { + + // get char to insert which is new character or placeholder ('_') + digit = (key === BACKSPACE || key === DEL) ? '_' : + String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key); + + // we're deleting something, we're not at the start, and have normal cursor, move back one + // if we have a selection length, cursor actually sits behind deletable char, not in front + if (key === BACKSPACE && pos && !hasSel) { + pos -= 1; + } + + // don't stop on a separator, continue whatever direction you were going + // value char - keep incrementing position while on separator char and we still have room + // del char - keep decrementing position while on separator char and we still have room + while (true) { + var maskValueAtCurPos = options.mask.substr(pos, 1); + var posShorterThanMaskLength = pos < options.mask.length; + var posGreaterThanZero = pos > 0; + var notNumberOrPlaceholder = /[^0-9_]/; + var curPosOnSep = notNumberOrPlaceholder.test(maskValueAtCurPos); + var continueMovingPosition = curPosOnSep && posShorterThanMaskLength && posGreaterThanZero + + // if we hit a real char, stay where we are + if (!continueMovingPosition) break; + + // hitting backspace in a selection, you can possibly go back any further - go forward + pos += (key === BACKSPACE && !hasSel) ? -1 : 1; + + } + + if (event.metaKey) { // cmd has been pressed + pos = 0; + hasSel = true; + } + + if (hasSel) { + // pos might have moved so re-calc length + var selLength = selEnd - pos + + // if we have a selection length we will wipe out entire selection and replace with default template for that range + var defaultBlank = options.mask.replace(/[0-9]/g, '_'); + var defaultBlankSelectionReplacement = defaultBlank.substr(pos, selLength); + var selReplacementRemainder = defaultBlankSelectionReplacement.substr(1) // might be empty + + var valueBeforeSel = val.substr(0, pos); + var insertChars = digit + selReplacementRemainder; + var charsAfterSelection = val.substr(pos + selLength); + + val = valueBeforeSel + insertChars + charsAfterSelection + + } else { + var valueBeforeCursor = val.substr(0, pos); + var insertChar = digit; + var valueAfterNextChar = val.substr(pos + 1); + + val = valueBeforeCursor + insertChar + valueAfterNextChar + } + + if (val.trim() === '') { + // if empty, set to default + val = defaultBlank + } else { + // if at the last character don't need to do anything + if (pos === options.mask.length) { + event.preventDefault(); + return false; + } + } + + // resume cursor location + pos += (key === BACKSPACE) ? 0 : 1; + // don't stop on a separator, continue whatever direction you were going + while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) { + pos += (key === BACKSPACE) ? 0 : 1; + } + + if (isValidValue(options.mask, val)) { + this.value = val; + setCaretPos(this, pos); + } else if (val.trim() === '') { + this.value = options.mask.replace(/[0-9]/g, '_'); + } else { + input.trigger('error_input.xdsoft'); + } + } else { + if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) { + return true; + } + } + + event.preventDefault(); + return false; + }); + } + } + + _xdsoft_datetime.setCurrentTime(getCurrentValue()); + + input + .data('xdsoft_datetimepicker', datetimepicker) + .on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function () { + if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) { + return; + } + if (!options.openOnFocus) { + return; + } + clearTimeout(timer); + timer = setTimeout(function () { + if (input.is(':disabled')) { + return; + } + + triggerAfterOpen = true; + _xdsoft_datetime.setCurrentTime(getCurrentValue(), true); + if(options.mask) { + setMask(options); + } + datetimepicker.trigger('open.xdsoft'); + }, 100); + }) + .on('keydown.xdsoft', function (event) { + var elementSelector, + key = event.which; + if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) { + elementSelector = $("input:visible,textarea:visible,button:visible,a:visible"); + datetimepicker.trigger('close.xdsoft'); + elementSelector.eq(elementSelector.index(this) + 1).focus(); + return false; + } + if ([TAB].indexOf(key) !== -1) { + datetimepicker.trigger('close.xdsoft'); + return true; + } + }) + .on('blur.xdsoft', function () { + datetimepicker.trigger('close.xdsoft'); + }); + }; + destroyDateTimePicker = function (input) { + var datetimepicker = input.data('xdsoft_datetimepicker'); + if (datetimepicker) { + datetimepicker.data('xdsoft_datetime', null); + datetimepicker.remove(); + input + .data('xdsoft_datetimepicker', null) + .off('.xdsoft'); + $(options.contentWindow).off('resize.xdsoft'); + $([options.contentWindow, options.ownerDocument.body]).off('mousedown.xdsoft touchstart'); + if (input.unmousewheel) { + input.unmousewheel(); + } + } + }; + $(options.ownerDocument) + .off('keydown.xdsoftctrl keyup.xdsoftctrl') + .off('keydown.xdsoftcmd keyup.xdsoftcmd') + .on('keydown.xdsoftctrl', function (e) { + if (e.keyCode === CTRLKEY) { + ctrlDown = true; + } + }) + .on('keyup.xdsoftctrl', function (e) { + if (e.keyCode === CTRLKEY) { + ctrlDown = false; + } + }) + .on('keydown.xdsoftcmd', function (e) { + if (e.keyCode === CMDKEY) { + cmdDown = true; + } + }) + .on('keyup.xdsoftcmd', function (e) { + if (e.keyCode === CMDKEY) { + cmdDown = false; + } + }); + + this.each(function () { + var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input; + if (datetimepicker) { + if (typeof opt === 'string') { + switch (opt) { + case 'show': + $(this).select().focus(); + datetimepicker.trigger('open.xdsoft'); + break; + case 'hide': + datetimepicker.trigger('close.xdsoft'); + break; + case 'toggle': + datetimepicker.trigger('toggle.xdsoft'); + break; + case 'destroy': + destroyDateTimePicker($(this)); + break; + case 'reset': + this.value = this.defaultValue; + if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(dateHelper.parseDate(this.value, options.format))) { + datetimepicker.data('changed', false); + } + datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value); + break; + case 'validate': + $input = datetimepicker.data('input'); + $input.trigger('blur.xdsoft'); + break; + default: + if (datetimepicker[opt] && typeof datetimepicker[opt] === 'function') { + result = datetimepicker[opt](opt2); + } + } + } else { + datetimepicker + .setOptions(opt); + } + return 0; + } + if (typeof opt !== 'string') { + if (!options.lazyInit || options.open || options.inline) { + createDateTimePicker($(this)); + } else { + lazyInit($(this)); + } + } + }); + + return result; + }; + + $.fn.datetimepicker.defaults = default_options; + + function HighlightedDate(date, desc, style) { + "use strict"; + this.date = date; + this.desc = desc; + this.style = style; + } +}; +;(function (factory) { + if ( typeof define === 'function' && define.amd ) { + // AMD. Register as an anonymous module. + define(['jquery', 'jquery-mousewheel'], factory); + } else if (typeof exports === 'object') { + // Node/CommonJS style for Browserify + module.exports = factory(require('jquery'));; + } else { + // Browser globals + factory(jQuery); + } +}(datetimepickerFactory)); + + + +/*! + * jQuery Mousewheel 3.1.13 + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + */ + +(function (factory) { + if ( typeof define === 'function' && define.amd ) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node/CommonJS style for Browserify + module.exports = factory; + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { + + var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'], + toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ? + ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'], + slice = Array.prototype.slice, + nullLowestDeltaTimeout, lowestDelta; + + if ( $.event.fixHooks ) { + for ( var i = toFix.length; i; ) { + $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; + } + } + + var special = $.event.special.mousewheel = { + version: '3.1.12', + + setup: function() { + if ( this.addEventListener ) { + for ( var i = toBind.length; i; ) { + this.addEventListener( toBind[--i], handler, false ); + } + } else { + this.onmousewheel = handler; + } + // Store the line height and page height for this particular element + $.data(this, 'mousewheel-line-height', special.getLineHeight(this)); + $.data(this, 'mousewheel-page-height', special.getPageHeight(this)); + }, + + teardown: function() { + if ( this.removeEventListener ) { + for ( var i = toBind.length; i; ) { + this.removeEventListener( toBind[--i], handler, false ); + } + } else { + this.onmousewheel = null; + } + // Clean up the data we added to the element + $.removeData(this, 'mousewheel-line-height'); + $.removeData(this, 'mousewheel-page-height'); + }, + + getLineHeight: function(elem) { + var $elem = $(elem), + $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent'](); + if (!$parent.length) { + $parent = $('body'); + } + return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16; + }, + + getPageHeight: function(elem) { + return $(elem).height(); + }, + + settings: { + adjustOldDeltas: true, // see shouldAdjustOldDeltas() below + normalizeOffset: true // calls getBoundingClientRect for each event + } + }; + + $.fn.extend({ + mousewheel: function(fn) { + return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel'); + }, + + unmousewheel: function(fn) { + return this.unbind('mousewheel', fn); + } + }); + + + function handler(event) { + var orgEvent = event || window.event, + args = slice.call(arguments, 1), + delta = 0, + deltaX = 0, + deltaY = 0, + absDelta = 0, + offsetX = 0, + offsetY = 0; + event = $.event.fix(orgEvent); + event.type = 'mousewheel'; + + // Old school scrollwheel delta + if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; } + if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; } + if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; } + if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; } + + // Firefox < 17 horizontal scrolling related to DOMMouseScroll event + if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { + deltaX = deltaY * -1; + deltaY = 0; + } + + // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy + delta = deltaY === 0 ? deltaX : deltaY; + + // New school wheel delta (wheel event) + if ( 'deltaY' in orgEvent ) { + deltaY = orgEvent.deltaY * -1; + delta = deltaY; + } + if ( 'deltaX' in orgEvent ) { + deltaX = orgEvent.deltaX; + if ( deltaY === 0 ) { delta = deltaX * -1; } + } + + // No change actually happened, no reason to go any further + if ( deltaY === 0 && deltaX === 0 ) { return; } + + // Need to convert lines and pages to pixels if we aren't already in pixels + // There are three delta modes: + // * deltaMode 0 is by pixels, nothing to do + // * deltaMode 1 is by lines + // * deltaMode 2 is by pages + if ( orgEvent.deltaMode === 1 ) { + var lineHeight = $.data(this, 'mousewheel-line-height'); + delta *= lineHeight; + deltaY *= lineHeight; + deltaX *= lineHeight; + } else if ( orgEvent.deltaMode === 2 ) { + var pageHeight = $.data(this, 'mousewheel-page-height'); + delta *= pageHeight; + deltaY *= pageHeight; + deltaX *= pageHeight; + } + + // Store lowest absolute delta to normalize the delta values + absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) ); + + if ( !lowestDelta || absDelta < lowestDelta ) { + lowestDelta = absDelta; + + // Adjust older deltas if necessary + if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { + lowestDelta /= 40; + } + } + + // Adjust older deltas if necessary + if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { + // Divide all the things by 40! + delta /= 40; + deltaX /= 40; + deltaY /= 40; + } + + // Get a whole, normalized value for the deltas + delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta); + deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta); + deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta); + + // Normalise offsetX and offsetY properties + if ( special.settings.normalizeOffset && this.getBoundingClientRect ) { + var boundingRect = this.getBoundingClientRect(); + offsetX = event.clientX - boundingRect.left; + offsetY = event.clientY - boundingRect.top; + } + + // Add information to the event object + event.deltaX = deltaX; + event.deltaY = deltaY; + event.deltaFactor = lowestDelta; + event.offsetX = offsetX; + event.offsetY = offsetY; + // Go ahead and set deltaMode to 0 since we converted to pixels + // Although this is a little odd since we overwrite the deltaX/Y + // properties with normalized deltas. + event.deltaMode = 0; + + // Add event and delta to the front of the arguments + args.unshift(event, delta, deltaX, deltaY); + + // Clearout lowestDelta after sometime to better + // handle multiple device types that give different + // a different lowestDelta + // Ex: trackpad = 3 and mouse wheel = 120 + if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); } + nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200); + + return ($.event.dispatch || $.event.handle).apply(this, args); + } + + function nullLowestDelta() { + lowestDelta = null; + } + + function shouldAdjustOldDeltas(orgEvent, absDelta) { + // If this is an older event and the delta is divisable by 120, + // then we are assuming that the browser is treating this as an + // older mouse wheel event and that we should divide the deltas + // by 40 to try and get a more usable deltaFactor. + // Side note, this actually impacts the reported scroll distance + // in older browsers and can cause scrolling to be slower than native. + // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false. + return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0; + } + +})); diff --git a/plugins/datetimepicker-master/build/jquery.datetimepicker.full.min.js b/plugins/datetimepicker-master/build/jquery.datetimepicker.full.min.js new file mode 100644 index 0000000..7947c33 --- /dev/null +++ b/plugins/datetimepicker-master/build/jquery.datetimepicker.full.min.js @@ -0,0 +1 @@ +var DateFormatter;!function(){"use strict";var D,s,r,a,n;D=function(e,t){return"string"==typeof e&&"string"==typeof t&&e.toLowerCase()===t.toLowerCase()},s=function(e,t,a){var n=a||"0",r=e.toString();return r.length'),u=L('
    '),d.append(u),l.addClass("xdsoft_scroller_box").append(d),p=function(e){var t=a(e).y-r+g;t<0&&(t=0),t+u[0].offsetHeight>h&&(t=h-u[0].offsetHeight),l.trigger("scroll_element.xdsoft_scroller",[c?t/c:0])},u.on("touchstart.xdsoft_scroller mousedown.xdsoft_scroller",function(e){i||l.trigger("resize_scroll.xdsoft_scroller",[y]),r=a(e).y,g=parseInt(u.css("marginTop"),10),h=d[0].offsetHeight,"mousedown"===e.type||"touchstart"===e.type?(D.ownerDocument&&L(D.ownerDocument.body).addClass("xdsoft_noselect"),L([D.ownerDocument.body,D.contentWindow]).on("touchend mouseup.xdsoft_scroller",function e(){L([D.ownerDocument.body,D.contentWindow]).off("touchend mouseup.xdsoft_scroller",e).off("mousemove.xdsoft_scroller",p).removeClass("xdsoft_noselect")}),L(D.ownerDocument.body).on("mousemove.xdsoft_scroller",p)):(t=!0,e.stopPropagation(),e.preventDefault())}).on("touchmove",function(e){t&&(e.preventDefault(),p(e))}).on("touchend touchcancel",function(){t=!1,g=0}),l.on("scroll_element.xdsoft_scroller",function(e,t){i||l.trigger("resize_scroll.xdsoft_scroller",[t,!0]),t=1'),e=L(''),g=L('
    '),F=L('
    '),C=L('
    '),o=L('
    '),u=o.find(".xdsoft_time_box").eq(0),P=L('
    '),i=L(''),Y=L('
    '),A=L('
    '),s=!1,d=0;I.id&&_.attr("id",I.id),I.style&&_.attr("style",I.style),I.weeks&&_.addClass("xdsoft_showweeks"),I.rtl&&_.addClass("xdsoft_rtl"),_.addClass("xdsoft_"+I.theme),_.addClass(I.className),F.find(".xdsoft_month span").after(Y),F.find(".xdsoft_year span").after(A),F.find(".xdsoft_month,.xdsoft_year").on("touchstart mousedown.xdsoft",function(e){var t,a,n=L(this).find(".xdsoft_select").eq(0),r=0,o=0,i=n.is(":visible");for(F.find(".xdsoft_select").hide(),W.currentTime&&(r=W.currentTime[L(this).hasClass("xdsoft_month")?"getMonth":"getFullYear"]()),n[i?"hide":"show"](),t=n.find("div.xdsoft_option"),a=0;aI.touchMovedThreshold&&(this.touchMoved=!0)};function f(){var e,t=!1;return I.startDate?t=W.strToDate(I.startDate):(t=I.value||(O&&O.val&&O.val()?O.val():""))?(t=W.strToDateTime(t),I.yearOffset&&(t=new Date(t.getFullYear()-I.yearOffset,t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))):I.defaultDate&&(t=W.strToDateTime(I.defaultDate),I.defaultTime&&(e=W.strtotime(I.defaultTime),t.setHours(e.getHours()),t.setMinutes(e.getMinutes()))),t&&W.isValidDate(t)?_.data("changed",!0):t="",t||0}function c(m){var h=function(e,t){var a=e.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,"\\$1").replace(/_/g,"{digit+}").replace(/([0-9]{1})/g,"{digit$1}").replace(/\{digit([0-9]{1})\}/g,"[0-$1_]{1}").replace(/\{digit[\+]\}/g,"[0-9_]{1}");return new RegExp(a).test(t)},g=function(e,t){if(!(e="string"==typeof e||e instanceof String?m.ownerDocument.getElementById(e):e))return!1;if(e.createTextRange){var a=e.createTextRange();return a.collapse(!0),a.moveEnd("character",t),a.moveStart("character",t),a.select(),!0}return!!e.setSelectionRange&&(e.setSelectionRange(t,t),!0)};m.mask&&O.off("keydown.xdsoft"),!0===m.mask&&(E.formatMask?m.mask=E.formatMask(m.format):m.mask=m.format.replace(/Y/g,"9999").replace(/F/g,"9999").replace(/m/g,"19").replace(/d/g,"39").replace(/H/g,"29").replace(/i/g,"59").replace(/s/g,"59")),"string"===L.type(m.mask)&&(h(m.mask,O.val())||(O.val(m.mask.replace(/[0-9]/g,"_")),g(O[0],0)),O.on("paste.xdsoft",function(e){var t=(e.clipboardData||e.originalEvent.clipboardData||window.clipboardData).getData("text"),a=this.value,n=this.selectionStart;return a=a.substr(0,n)+t+a.substr(n+t.length),n+=t.length,h(m.mask,a)?(this.value=a,g(this,n)):""===L.trim(a)?this.value=m.mask.replace(/[0-9]/g,"_"):O.trigger("error_input.xdsoft"),e.preventDefault(),!1}),O.on("keydown.xdsoft",function(e){var t,a=this.value,n=e.which,r=this.selectionStart,o=this.selectionEnd,i=r!==o;if(48<=n&&n<=57||96<=n&&n<=105||8===n||46===n){for(t=8===n||46===n?"_":String.fromCharCode(96<=n&&n<=105?n-48:n),8===n&&r&&!i&&(r-=1);;){var s=m.mask.substr(r,1),d=r",I.weeks&&(l+=""),e=0;e<7;e+=1)l+=""+I.i18n[R].dayOfWeekShort[(e+I.dayOfWeekStart)%7]+"";for(l+="",l+="",!1!==I.maxDate&&(h=W.strToDate(I.maxDate),h=new Date(h.getFullYear(),h.getMonth(),h.getDate(),23,59,59,999)),!1!==I.minDate&&(g=W.strToDate(I.minDate),g=new Date(g.getFullYear(),g.getMonth(),g.getDate())),!1!==I.minDateTime&&(p=W.strToDate(I.minDateTime),p=new Date(p.getFullYear(),p.getMonth(),p.getDate(),p.getHours(),p.getMinutes(),p.getSeconds())),!1!==I.maxDateTime&&(D=W.strToDate(I.maxDateTime),D=new Date(D.getFullYear(),D.getMonth(),D.getDate(),D.getHours(),D.getMinutes(),D.getSeconds())),!1!==D&&(u=31*(12*D.getFullYear()+D.getMonth())+D.getDate());c",v=!1,I.weeks&&(l+=""+o+"")),l+='
    '+n+"
    ",f.getDay()===I.dayOfWeekStartPrev&&(l+="",v=!0),f.setDate(n+1)}l+="",C.html(l),F.find(".xdsoft_label span").eq(0).text(I.i18n[R].months[W.currentTime.getMonth()]),F.find(".xdsoft_label span").eq(1).text(W.currentTime.getFullYear()+I.yearOffset),M=k="";var x=0;if(!1!==I.minTime){var T=W.strtotime(I.minTime);x=60*T.getHours()+T.getMinutes()}var S=1440;if(!1!==I.maxTime){T=W.strtotime(I.maxTime);S=60*T.getHours()+T.getMinutes()}if(!1!==I.minDateTime){T=W.strToDateTime(I.minDateTime);if(E.formatDate(W.currentTime,I.formatDate)===E.formatDate(T,I.formatDate)){var M=60*T.getHours()+T.getMinutes();x'+E.formatDate(n,I.formatTime)+""},I.allowTimes&&L.isArray(I.allowTimes)&&I.allowTimes.length)for(c=0;c'+(c+I.yearOffset)+"";for(A.children().eq(0).html(H),c=parseInt(I.monthStart,10),H="";c<=parseInt(I.monthEnd,10);c+=1)H+='
    '+I.i18n[R].months[c]+"
    ";Y.children().eq(0).html(H),L(_).trigger("generate.xdsoft")},10),e.stopPropagation()}).on("afterOpen.xdsoft",function(){var e,t,a,n;I.timepicker&&(P.find(".xdsoft_current").length?e=".xdsoft_current":P.find(".xdsoft_init_time").length&&(e=".xdsoft_init_time"),e?(t=u[0].clientHeight,(a=P[0].offsetHeight)-t<(n=P.find(e).index()*I.timeHeightInTimePicker+1)&&(n=a-t),u.trigger("scroll_element.xdsoft_scroller",[parseInt(n,10)/(a-t)])):u.trigger("scroll_element.xdsoft_scroller",[0]))}),n=0,C.on("touchend click.xdsoft","td",function(e){e.stopPropagation(),n+=1;var t=L(this),a=W.currentTime;if(null==a&&(W.currentTime=W.now(),a=W.currentTime),t.hasClass("xdsoft_disabled"))return!1;a.setDate(1),a.setFullYear(t.data("year")),a.setMonth(t.data("month")),a.setDate(t.data("date")),_.trigger("select.xdsoft",[a]),O.val(W.str()),I.onSelectDate&&L.isFunction(I.onSelectDate)&&I.onSelectDate.call(_,W.currentTime,_.data("input"),e),_.data("changed",!0),_.trigger("xchange.xdsoft"),_.trigger("changedatetime.xdsoft"),(1f+c?(u="bottom",a=f+c-e.top):a-=c):a+_[0].offsetHeight>f+c&&(a=e.top-_[0].offsetHeight+1),a<0&&(a=0),n+t.offsetWidth>d&&(n=d-t.offsetWidth)),o=_[0],h(o,function(e){if("relative"===I.contentWindow.getComputedStyle(e).getPropertyValue("position")&&d>=e.offsetWidth)return n-=(d-e.offsetWidth)/2,!1}),l={position:r,left:I.insideParent?t.offsetLeft:n,top:"",bottom:""},I.insideParent?l[u]=t.offsetTop+t.offsetHeight:l[u]=a,_.css(l)},_.on("open.xdsoft",function(e){var t=!0;I.onShow&&L.isFunction(I.onShow)&&(t=I.onShow.call(_,W.currentTime,_.data("input"),e)),!1!==t&&(_.show(),r(),L(I.contentWindow).off("resize.xdsoft",r).on("resize.xdsoft",r),I.closeOnWithoutClick&&L([I.ownerDocument.body,I.contentWindow]).on("touchstart mousedown.xdsoft",function e(){_.trigger("close.xdsoft"),L([I.ownerDocument.body,I.contentWindow]).off("touchstart mousedown.xdsoft",e)}))}).on("close.xdsoft",function(e){var t=!0;F.find(".xdsoft_month,.xdsoft_year").find(".xdsoft_select").hide(),I.onClose&&L.isFunction(I.onClose)&&(t=I.onClose.call(_,W.currentTime,_.data("input"),e)),!1===t||I.opened||I.inline||_.hide(),e.stopPropagation()}).on("toggle.xdsoft",function(){_.is(":visible")?_.trigger("close.xdsoft"):_.trigger("open.xdsoft")}).data("input",O),d=0,_.data("xdsoft_datetime",W),_.setOptions(I),W.setCurrentTime(f()),O.data("xdsoft_datetimepicker",_).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function(){O.is(":disabled")||O.data("xdsoft_datetimepicker").is(":visible")&&I.closeOnInputClick||I.openOnFocus&&(clearTimeout(d),d=setTimeout(function(){O.is(":disabled")||(s=!0,W.setCurrentTime(f(),!0),I.mask&&c(I),_.trigger("open.xdsoft"))},100))}).on("keydown.xdsoft",function(e){var t,a=e.which;return-1!==[D].indexOf(a)&&I.enterLikeTab?(t=L("input:visible,textarea:visible,button:visible,a:visible"),_.trigger("close.xdsoft"),t.eq(t.index(this)+1).focus(),!1):-1!==[T].indexOf(a)?(_.trigger("close.xdsoft"),!0):void 0}).on("blur.xdsoft",function(){_.trigger("close.xdsoft")})},r=function(e){var t=e.data("xdsoft_datetimepicker");t&&(t.data("xdsoft_datetime",null),t.remove(),e.data("xdsoft_datetimepicker",null).off(".xdsoft"),L(I.contentWindow).off("resize.xdsoft"),L([I.contentWindow,I.ownerDocument.body]).off("mousedown.xdsoft touchstart"),e.unmousewheel&&e.unmousewheel())},L(I.ownerDocument).off("keydown.xdsoftctrl keyup.xdsoftctrl").off("keydown.xdsoftcmd keyup.xdsoftcmd").on("keydown.xdsoftctrl",function(e){e.keyCode===p&&(N=!0)}).on("keyup.xdsoftctrl",function(e){e.keyCode===p&&(N=!1)}).on("keydown.xdsoftcmd",function(e){91===e.keyCode&&!0}).on("keyup.xdsoftcmd",function(e){91===e.keyCode&&!1}),this.each(function(){var t,e=L(this).data("xdsoft_datetimepicker");if(e){if("string"===L.type(H))switch(H){case"show":L(this).select().focus(),e.trigger("open.xdsoft");break;case"hide":e.trigger("close.xdsoft");break;case"toggle":e.trigger("toggle.xdsoft");break;case"destroy":r(L(this));break;case"reset":this.value=this.defaultValue,this.value&&e.data("xdsoft_datetime").isValidDate(E.parseDate(this.value,I.format))||e.data("changed",!1),e.data("xdsoft_datetime").setCurrentTime(this.value);break;case"validate":e.data("input").trigger("blur.xdsoft");break;default:e[H]&&L.isFunction(e[H])&&(o=e[H](a))}else e.setOptions(H);return 0}"string"!==L.type(H)&&(!I.lazyInit||I.open||I.inline?n(L(this)):(t=L(this)).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function e(){t.is(":disabled")||t.data("xdsoft_datetimepicker")||(clearTimeout(i),i=setTimeout(function(){t.data("xdsoft_datetimepicker")||n(t),t.off("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",e).trigger("open.xdsoft")},100))}))}),o},L.fn.datetimepicker.defaults=s};!function(e){"function"==typeof define&&define.amd?define(["jquery","jquery-mousewheel"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(datetimepickerFactory),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(c){var m,h,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],g=Array.prototype.slice;if(c.event.fixHooks)for(var a=e.length;a;)c.event.fixHooks[e[--a]]=c.event.mouseHooks;var p=c.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],n,!1);else this.onmousewheel=n;c.data(this,"mousewheel-line-height",p.getLineHeight(this)),c.data(this,"mousewheel-page-height",p.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],n,!1);else this.onmousewheel=null;c.removeData(this,"mousewheel-line-height"),c.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=c(e),a=t["offsetParent"in c.fn?"offsetParent":"parent"]();return a.length||(a=c("body")),parseInt(a.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return c(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function n(e){var t,a=e||window.event,n=g.call(arguments,1),r=0,o=0,i=0,s=0,d=0;if((e=c.event.fix(a)).type="mousewheel","detail"in a&&(i=-1*a.detail),"wheelDelta"in a&&(i=a.wheelDelta),"wheelDeltaY"in a&&(i=a.wheelDeltaY),"wheelDeltaX"in a&&(o=-1*a.wheelDeltaX),"axis"in a&&a.axis===a.HORIZONTAL_AXIS&&(o=-1*i,i=0),r=0===i?o:i,"deltaY"in a&&(r=i=-1*a.deltaY),"deltaX"in a&&(o=a.deltaX,0===i&&(r=-1*o)),0!==i||0!==o){if(1===a.deltaMode){var u=c.data(this,"mousewheel-line-height");r*=u,i*=u,o*=u}else if(2===a.deltaMode){var l=c.data(this,"mousewheel-page-height");r*=l,i*=l,o*=l}if(t=Math.max(Math.abs(i),Math.abs(o)),(!h||tdiv>div{background:#f5f5f5;border-top:1px solid #ddd;color:#666;font-size:12px;text-align:center;border-collapse:collapse;cursor:pointer;border-bottom-width:0;height:25px;line-height:25px}.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div:first-child{border-top-width:0}.xdsoft_datetimepicker .xdsoft_today_button:hover,.xdsoft_datetimepicker .xdsoft_next:hover,.xdsoft_datetimepicker .xdsoft_prev:hover{opacity:1;-ms-filter:"alpha(opacity=100)"}.xdsoft_datetimepicker .xdsoft_label{display:inline;position:relative;z-index:9999;margin:0;padding:5px 3px;font-size:14px;line-height:20px;font-weight:bold;background-color:#fff;float:left;width:182px;text-align:center;cursor:pointer}.xdsoft_datetimepicker .xdsoft_label:hover>span{text-decoration:underline}.xdsoft_datetimepicker .xdsoft_label:hover i{opacity:1.0}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select{border:1px solid #ccc;position:absolute;right:0;top:30px;z-index:101;display:none;background:#fff;max-height:160px;overflow-y:hidden}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select.xdsoft_monthselect{right:-7px}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select.xdsoft_yearselect{right:2px}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option:hover{color:#fff;background:#ff8000}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option{padding:2px 10px 2px 5px;text-decoration:none !important}.xdsoft_datetimepicker .xdsoft_label>.xdsoft_select>div>.xdsoft_option.xdsoft_current{background:#3af;box-shadow:#178fe5 0 1px 3px 0 inset;color:#fff;font-weight:700}.xdsoft_datetimepicker .xdsoft_month{width:100px;text-align:right}.xdsoft_datetimepicker .xdsoft_calendar{clear:both}.xdsoft_datetimepicker .xdsoft_year{width:48px;margin-left:5px}.xdsoft_datetimepicker .xdsoft_calendar table{border-collapse:collapse;width:100%}.xdsoft_datetimepicker .xdsoft_calendar td>div{padding-right:5px}.xdsoft_datetimepicker .xdsoft_calendar th{height:25px}.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th{width:14.2857142%;background:#f5f5f5;border:1px solid #ddd;color:#666;font-size:12px;text-align:right;vertical-align:middle;padding:0;border-collapse:collapse;cursor:pointer;height:25px}.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar th{width:12.5%}.xdsoft_datetimepicker .xdsoft_calendar th{background:#f1f1f1}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today{color:#3af}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_default{background:#ffe9d2;box-shadow:#ffb871 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_mint{background:#c1ffc9;box-shadow:#00dd1c 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default,.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current{background:#3af;box-shadow:#178fe5 0 1px 3px 0 inset;color:#fff;font-weight:700}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month,.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled,.xdsoft_datetimepicker .xdsoft_time_box>div>div.xdsoft_disabled{opacity:.5;-ms-filter:"alpha(opacity=50)";cursor:default}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled{opacity:.2;-ms-filter:"alpha(opacity=20)"}.xdsoft_datetimepicker .xdsoft_calendar td:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div:hover{color:#fff !important;background:#ff8000 !important;box-shadow:none !important}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current.xdsoft_disabled:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current.xdsoft_disabled:hover{background:#3af !important;box-shadow:#178fe5 0 1px 3px 0 inset !important;color:#fff !important}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover,.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_disabled:hover{color:inherit !important;background:inherit !important;box-shadow:inherit !important}.xdsoft_datetimepicker .xdsoft_calendar th{font-weight:700;text-align:center;color:#999;cursor:default}.xdsoft_datetimepicker .xdsoft_copyright{color:#ccc !important;font-size:10px;clear:both;float:none;margin-left:8px}.xdsoft_datetimepicker .xdsoft_copyright a{color:#eee !important}.xdsoft_datetimepicker .xdsoft_copyright a:hover{color:#aaa !important}.xdsoft_time_box{position:relative;border:1px solid #ccc}.xdsoft_scrollbar>.xdsoft_scroller{background:#ccc !important;height:20px;border-radius:3px}.xdsoft_scrollbar{position:absolute;width:7px;right:0;top:0;bottom:0;cursor:pointer}.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_scrollbar{left:0;right:auto}.xdsoft_scroller_box{position:relative}.xdsoft_datetimepicker.xdsoft_dark{box-shadow:0 5px 15px -5px rgba(255,255,255,0.506);background:#000;border-bottom:1px solid #444;border-left:1px solid #333;border-right:1px solid #333;border-top:1px solid #333;color:#ccc}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box{border-bottom:1px solid #222}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box>div>div{background:#0a0a0a;border-top:1px solid #222;color:#999}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label{background-color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label>.xdsoft_select{border:1px solid #333;background:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label>.xdsoft_select>div>.xdsoft_option:hover{color:#000;background:#007fff}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label>.xdsoft_select>div>.xdsoft_option.xdsoft_current{background:#c50;box-shadow:#b03e00 0 1px 3px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label i,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_prev,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_next,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_today_button{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUExQUUzOTA0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUExQUUzOTE0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQTFBRTM4RTQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQTFBRTM4RjQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp0VxGEAAAIASURBVHja7JrNSgMxEMebtgh+3MSLr1T1Xn2CHoSKB08+QmR8Bx9A8e7RixdB9CKCoNdexIugxFlJa7rNZneTbLIpM/CnNLsdMvNjM8l0mRCiQ9Ye61IKCAgZAUnH+mU3MMZaHYChBnJUDzWOFZdVfc5+ZFLbrWDeXPwbxIqrLLfaeS0hEBVGIRQCEiZoHQwtlGSByCCdYBl8g8egTTAWoKQMRBRBcZxYlhzhKegqMOageErsCHVkk3hXIFooDgHB1KkHIHVgzKB4ADJQ/A1jAFmAYhkQqA5TOBtocrKrgXwQA8gcFIuAIO8sQSA7hidvPwaQGZSaAYHOUWJABhWWw2EMIH9QagQERU4SArJXo0ZZL18uvaxejXt/Em8xjVBXmvFr1KVm/AJ10tRe2XnraNqaJvKE3KHuUbfK1E+VHB0q40/y3sdQSxY4FHWeKJCunP8UyDdqJZenT3ntVV5jIYCAh20vT7ioP8tpf6E2lfEMwERe+whV1MHjwZB7PBiCxcGQWwKZKD62lfGNnP/1poFAA60T7rF1UgcKd2id3KDeUS+oLWV8DfWAepOfq00CgQabi9zjcgJVYVD7PVzQUAUGAQkbNJTBICDhgwYTjDYD6XeW08ZKh+A4pYkzenOxXUbvZcWz7E8ykRMnIHGX1XPl+1m2vPYpL+2qdb8CDAARlKFEz/ZVkAAAAABJRU5ErkJggg==)}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{background:#0a0a0a;border:1px solid #222;color:#999}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{background:#0e0e0e}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_today{color:#c50}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_default{background:#ffe9d2;box-shadow:#ffb871 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_mint{background:#c1ffc9;box-shadow:#00dd1c 0 1px 4px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_default,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_current,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current{background:#c50;box-shadow:#b03e00 0 1px 3px 0 inset;color:#000}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td:hover,.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box>div>div:hover{color:#000 !important;background:#007fff !important}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{color:#666}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright{color:#333 !important}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a{color:#111 !important}.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a:hover{color:#555 !important}.xdsoft_dark .xdsoft_time_box{border:1px solid #333}.xdsoft_dark .xdsoft_scrollbar>.xdsoft_scroller{background:#333 !important}.xdsoft_datetimepicker .xdsoft_save_selected{display:block;border:1px solid #ddd !important;margin-top:5px;width:100%;color:#454551;font-size:13px}.xdsoft_datetimepicker .blue-gradient-button{font-family:"museo-sans","Book Antiqua",sans-serif;font-size:12px;font-weight:300;color:#82878c;height:28px;position:relative;padding:4px 17px 4px 33px;border:1px solid #d7d8da;background:-moz-linear-gradient(top,#fff 0,#f4f8fa 73%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(73%,#f4f8fa));background:-webkit-linear-gradient(top,#fff 0,#f4f8fa 73%);background:-o-linear-gradient(top,#fff 0,#f4f8fa 73%);background:-ms-linear-gradient(top,#fff 0,#f4f8fa 73%);background:linear-gradient(to bottom,#fff 0,#f4f8fa 73%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff',endColorstr='#f4f8fa',GradientType=0)}.xdsoft_datetimepicker .blue-gradient-button:hover,.xdsoft_datetimepicker .blue-gradient-button:focus,.xdsoft_datetimepicker .blue-gradient-button:hover span,.xdsoft_datetimepicker .blue-gradient-button:focus span{color:#454551;background:-moz-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#f4f8fa),color-stop(73%,#FFF));background:-webkit-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:-o-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:-ms-linear-gradient(top,#f4f8fa 0,#FFF 73%);background:linear-gradient(to bottom,#f4f8fa 0,#FFF 73%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f4f8fa',endColorstr='#FFF',GradientType=0)} diff --git a/plugins/datetimepicker-master/build/jquery.datetimepicker.min.js b/plugins/datetimepicker-master/build/jquery.datetimepicker.min.js new file mode 100644 index 0000000..b29bfda --- /dev/null +++ b/plugins/datetimepicker-master/build/jquery.datetimepicker.min.js @@ -0,0 +1,2 @@ +var datetimepickerFactory=function(L){"use strict";var s={i18n:{ar:{months:["كانون الثاني","شباط","آذار","نيسان","مايو","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],dayOfWeekShort:["Ù†","Ø«","ع","Ø®","ج","س","Ø­"],dayOfWeek:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت","الأحد"]},ro:{months:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],dayOfWeekShort:["Du","Lu","Ma","Mi","Jo","Vi","Sâ"],dayOfWeek:["Duminică","Luni","MarÅ£i","Miercuri","Joi","Vineri","Sâmbătă"]},id:{months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],dayOfWeekShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],dayOfWeek:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},is:{months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ãgúst","September","Október","Nóvember","Desember"],dayOfWeekShort:["Sun","Mán","Þrið","Mið","Fim","Fös","Lau"],dayOfWeek:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur"]},bg:{months:["Януари","Февруари","Март","Ðприл","Май","Юни","Юли","ÐвгуÑÑ‚","Септември","Октомври","Ðоември","Декември"],dayOfWeekShort:["Ðд","Пн","Ð’Ñ‚","Ср","Чт","Пт","Сб"],dayOfWeek:["ÐеделÑ","Понеделник","Вторник","СрÑда","Четвъртък","Петък","Събота"]},fa:{months:["ÙØ±ÙˆØ±Ø¯ÛŒÙ†","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسÙند"],dayOfWeekShort:["یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],dayOfWeek:["یک‌شنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنج‌شنبه","جمعه","شنبه","یک‌شنبه"]},ru:{months:["Январь","Февраль","Март","Ðпрель","Май","Июнь","Июль","ÐвгуÑÑ‚","СентÑбрь","ОктÑбрь","ÐоÑбрь","Декабрь"],dayOfWeekShort:["Ð’Ñ","Пн","Ð’Ñ‚","Ср","Чт","Пт","Сб"],dayOfWeek:["ВоÑкреÑенье","Понедельник","Вторник","Среда","Четверг","ПÑтница","Суббота"]},uk:{months:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","ВереÑень","Жовтень","ЛиÑтопад","Грудень"],dayOfWeekShort:["Ðд","Пн","Ð’Ñ‚","Ср","Чт","Пт","Сб"],dayOfWeek:["ÐеділÑ","Понеділок","Вівторок","Середа","Четвер","П'ÑтницÑ","Субота"]},en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},el:{months:["ΙανουάÏιος","ΦεβÏουάÏιος","ΜάÏτιος","ΑπÏίλιος","Μάιος","ΙοÏνιος","ΙοÏλιος","ΑÏγουστος","ΣεπτέμβÏιος","ΟκτώβÏιος","ÎοέμβÏιος","ΔεκέμβÏιος"],dayOfWeekShort:["ΚυÏ","Δευ","ΤÏι","Τετ","Πεμ","ΠαÏ","Σαβ"],dayOfWeek:["ΚυÏιακή","ΔευτέÏα","ΤÏίτη","ΤετάÏτη","Πέμπτη","ΠαÏασκευή","Σάββατο"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],dayOfWeekShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayOfWeek:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},nl:{months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],dayOfWeekShort:["zo","ma","di","wo","do","vr","za"],dayOfWeek:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},tr:{months:["Ocak","Åžubat","Mart","Nisan","Mayıs","Haziran","Temmuz","AÄŸustos","Eylül","Ekim","Kasım","Aralık"],dayOfWeekShort:["Paz","Pts","Sal","Çar","Per","Cum","Cts"],dayOfWeek:["Pazar","Pazartesi","Salı","ÇarÅŸamba","PerÅŸembe","Cuma","Cumartesi"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayOfWeekShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],dayOfWeek:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dayOfWeekShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],dayOfWeek:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"]},th:{months:["มà¸à¸£à¸²à¸„ม","à¸à¸¸à¸¡à¸ à¸²à¸žà¸±à¸™à¸˜à¹Œ","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","à¸à¸£à¸à¸Žà¸²à¸„ม","สิงหาคม","à¸à¸±à¸™à¸¢à¸²à¸¢à¸™","ตุลาคม","พฤศจิà¸à¸²à¸¢à¸™","ธันวาคม"],dayOfWeekShort:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],dayOfWeek:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุà¸à¸£à¹Œ","เสาร์","อาทิตย์"]},pl:{months:["styczeÅ„","luty","marzec","kwiecieÅ„","maj","czerwiec","lipiec","sierpieÅ„","wrzesieÅ„","październik","listopad","grudzieÅ„"],dayOfWeekShort:["nd","pn","wt","Å›r","cz","pt","sb"],dayOfWeek:["niedziela","poniedziaÅ‚ek","wtorek","Å›roda","czwartek","piÄ…tek","sobota"]},pt:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},ch:{months:["一月","二月","三月","四月","五月","六月","七月","八月","乿œˆ","åæœˆ","å一月","å二月"],dayOfWeekShort:["æ—¥","一","二","三","å››","五","å…­"]},se:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","MÃ¥n","Tis","Ons","Tor","Fre","Lör"]},km:{months:["មករា​","កុម្ភៈ","មិនា​","មáŸážŸáž¶â€‹","ឧសភា​","មិážáž»áž“ា​","កក្កដា​","សីហា​","កញ្ញា​","ážáž»áž›áž¶â€‹","វិច្ឆិកា","ធ្នូ​"],dayOfWeekShort:["អាទិ​","áž…áŸáž“្ទ​","អង្គារ​","ពុធ​","ព្រហ​​","សុក្រ​","សៅរáŸ"],dayOfWeek:["អាទិážáŸ’យ​","áž…áŸáž“្ទ​","អង្គារ​","ពុធ​","ព្រហស្បážáž·áŸâ€‹","សុក្រ​","សៅរáŸ"]},kr:{months:["1ì›”","2ì›”","3ì›”","4ì›”","5ì›”","6ì›”","7ì›”","8ì›”","9ì›”","10ì›”","11ì›”","12ì›”"],dayOfWeekShort:["ì¼","ì›”","í™”","수","목","금","토"],dayOfWeek:["ì¼ìš”ì¼","월요ì¼","화요ì¼","수요ì¼","목요ì¼","금요ì¼","토요ì¼"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],dayOfWeek:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"]},da:{months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},no:{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"]},ja:{months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeekShort:["æ—¥","月","ç«","æ°´","木","金","土"],dayOfWeek:["日曜","月曜","ç«æ›œ","水曜","木曜","金曜","土曜"]},vi:{months:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],dayOfWeekShort:["CN","T2","T3","T4","T5","T6","T7"],dayOfWeek:["Chá»§ nhật","Thứ hai","Thứ ba","Thứ tư","Thứ năm","Thứ sáu","Thứ bảy"]},sl:{months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],dayOfWeekShort:["Ned","Pon","Tor","Sre","ÄŒet","Pet","Sob"],dayOfWeek:["Nedelja","Ponedeljek","Torek","Sreda","ÄŒetrtek","Petek","Sobota"]},cs:{months:["Leden","Únor","BÅ™ezen","Duben","KvÄ›ten","ÄŒerven","ÄŒervenec","Srpen","Září","Říjen","Listopad","Prosinec"],dayOfWeekShort:["Ne","Po","Út","St","ÄŒt","Pá","So"]},hu:{months:["Január","Február","Március","Ãprilis","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],dayOfWeekShort:["Va","Hé","Ke","Sze","Cs","Pé","Szo"],dayOfWeek:["vasárnap","hétfÅ‘","kedd","szerda","csütörtök","péntek","szombat"]},az:{months:["Yanvar","Fevral","Mart","Aprel","May","Iyun","Iyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],dayOfWeekShort:["B","Be","Ça","Ç","Ca","C","Åž"],dayOfWeek:["Bazar","Bazar ertÉ™si","ÇərÅŸÉ™nbÉ™ axÅŸamı","ÇərÅŸÉ™nbÉ™","CümÉ™ axÅŸamı","CümÉ™","ŞənbÉ™"]},bs:{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sri","ÄŒet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","ÄŒetvrtak","Petak","Subota"]},ca:{months:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],dayOfWeekShort:["Dg","Dl","Dt","Dc","Dj","Dv","Ds"],dayOfWeek:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"]},"en-GB":{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},et:{months:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],dayOfWeekShort:["P","E","T","K","N","R","L"],dayOfWeek:["Pühapäev","Esmaspäev","Teisipäev","Kolmapäev","Neljapäev","Reede","Laupäev"]},eu:{months:["Urtarrila","Otsaila","Martxoa","Apirila","Maiatza","Ekaina","Uztaila","Abuztua","Iraila","Urria","Azaroa","Abendua"],dayOfWeekShort:["Ig.","Al.","Ar.","Az.","Og.","Or.","La."],dayOfWeek:["Igandea","Astelehena","Asteartea","Asteazkena","Osteguna","Ostirala","Larunbata"]},fi:{months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],dayOfWeekShort:["Su","Ma","Ti","Ke","To","Pe","La"],dayOfWeek:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"]},gl:{months:["Xan","Feb","Maz","Abr","Mai","Xun","Xul","Ago","Set","Out","Nov","Dec"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Xov","Ven","Sab"],dayOfWeek:["Domingo","Luns","Martes","Mércores","Xoves","Venres","Sábado"]},hr:{months:["SijeÄanj","VeljaÄa","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],dayOfWeekShort:["Ned","Pon","Uto","Sri","ÄŒet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","ÄŒetvrtak","Petak","Subota"]},ko:{months:["1ì›”","2ì›”","3ì›”","4ì›”","5ì›”","6ì›”","7ì›”","8ì›”","9ì›”","10ì›”","11ì›”","12ì›”"],dayOfWeekShort:["ì¼","ì›”","í™”","수","목","금","토"],dayOfWeek:["ì¼ìš”ì¼","월요ì¼","화요ì¼","수요ì¼","목요ì¼","금요ì¼","토요ì¼"]},lt:{months:["Sausio","Vasario","Kovo","Balandžio","Gegužės","Birželio","Liepos","RugpjÅ«Äio","RugsÄ—jo","Spalio","LapkriÄio","Gruodžio"],dayOfWeekShort:["Sek","Pir","Ant","Tre","Ket","Pen","Å eÅ¡"],dayOfWeek:["Sekmadienis","Pirmadienis","Antradienis","TreÄiadienis","Ketvirtadienis","Penktadienis","Å eÅ¡tadienis"]},lv:{months:["JanvÄris","FebruÄris","Marts","AprÄ«lis ","Maijs","JÅ«nijs","JÅ«lijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],dayOfWeekShort:["Sv","Pr","Ot","Tr","Ct","Pk","St"],dayOfWeek:["SvÄ“tdiena","Pirmdiena","Otrdiena","TreÅ¡diena","Ceturtdiena","Piektdiena","Sestdiena"]},mk:{months:["јануари","февруари","март","април","мај","јуни","јули","авгуÑÑ‚","Ñептември","октомври","ноември","декември"],dayOfWeekShort:["нед","пон","вто","Ñре","чет","пет","Ñаб"],dayOfWeek:["Ðедела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота"]},mn:{months:["1-Ñ€ Ñар","2-Ñ€ Ñар","3-Ñ€ Ñар","4-Ñ€ Ñар","5-Ñ€ Ñар","6-Ñ€ Ñар","7-Ñ€ Ñар","8-Ñ€ Ñар","9-Ñ€ Ñар","10-Ñ€ Ñар","11-Ñ€ Ñар","12-Ñ€ Ñар"],dayOfWeekShort:["Дав","МÑг","Лха","Пүр","БÑн","БÑм","ÐÑм"],dayOfWeek:["Даваа","МÑгмар","Лхагва","ПүрÑв","БааÑан","БÑмба","ÐÑм"]},"pt-BR":{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},sk:{months:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],dayOfWeekShort:["Ne","Po","Ut","St","Å t","Pi","So"],dayOfWeek:["Nedeľa","Pondelok","Utorok","Streda","Å tvrtok","Piatok","Sobota"]},sq:{months:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],dayOfWeekShort:["Die","Hën","Mar","Mër","Enj","Pre","Shtu"],dayOfWeek:["E Diel","E Hënë","E MartÄ“","E Mërkurë","E Enjte","E Premte","E Shtunë"]},"sr-YU":{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sre","Äet","Pet","Sub"],dayOfWeek:["Nedelja","Ponedeljak","Utorak","Sreda","ÄŒetvrtak","Petak","Subota"]},sr:{months:["јануар","фебруар","март","април","мај","јун","јул","авгуÑÑ‚","Ñептембар","октобар","новембар","децембар"],dayOfWeekShort:["нед","пон","уто","Ñре","чет","пет","Ñуб"],dayOfWeek:["Ðедеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота"]},sv:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","MÃ¥n","Tis","Ons","Tor","Fre","Lör"],dayOfWeek:["Söndag","MÃ¥ndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"]},"zh-TW":{months:["一月","二月","三月","四月","五月","六月","七月","八月","乿œˆ","åæœˆ","å一月","å二月"],dayOfWeekShort:["æ—¥","一","二","三","å››","五","å…­"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},zh:{months:["一月","二月","三月","四月","五月","六月","七月","八月","乿œˆ","åæœˆ","å一月","å二月"],dayOfWeekShort:["æ—¥","一","二","三","å››","五","å…­"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},ug:{months:["1-ئاي","2-ئاي","3-ئاي","4-ئاي","5-ئاي","6-ئاي","7-ئاي","8-ئاي","9-ئاي","10-ئاي","11-ئاي","12-ئاي"],dayOfWeek:["يەكشەنبە","دۈشەنبە","سەيشەنبە","چارشەنبە","پەيشەنبە","جۈمە","شەنبە"]},he:{months:["ינו×ר","פברו×ר","מרץ","×פריל","מ××™","יוני","יולי","×וגוסט","ספטמבר","×וקטובר","נובמבר","דצמבר"],dayOfWeekShort:["×'","ב'","×’'","ד'","×”'","ו'","שבת"],dayOfWeek:["ר×שון","שני","שלישי","רביעי","חמישי","שישי","שבת","ר×שון"]},hy:{months:["Õ€Õ¸Ö‚Õ¶Õ¾Õ¡Ö€","Õ“Õ¥Õ¿Ö€Õ¾Õ¡Ö€","Õ„Õ¡Ö€Õ¿","Ô±ÕºÖ€Õ«Õ¬","Õ„Õ¡ÕµÕ«Õ½","Õ€Õ¸Ö‚Õ¶Õ«Õ½","Õ€Õ¸Ö‚Õ¬Õ«Õ½","Õ•Õ£Õ¸Õ½Õ¿Õ¸Õ½","ÕÕ¥ÕºÕ¿Õ¥Õ´Õ¢Õ¥Ö€","Õ€Õ¸Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€","Õ†Õ¸ÕµÕ¥Õ´Õ¢Õ¥Ö€","Ô´Õ¥Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€"],dayOfWeekShort:["Ô¿Õ«","ÔµÖ€Õ¯","ÔµÖ€Ö„","Õ‰Õ¸Ö€","Õ€Õ¶Õ£","ÕˆÖ‚Ö€Õ¢","Õ‡Õ¢Õ©"],dayOfWeek:["Ô¿Õ«Ö€Õ¡Õ¯Õ«","ÔµÖ€Õ¯Õ¸Ö‚Õ·Õ¡Õ¢Õ©Õ«","ÔµÖ€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«","Õ‰Õ¸Ö€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«","Õ€Õ«Õ¶Õ£Õ·Õ¡Õ¢Õ©Õ«","ÕˆÖ‚Ö€Õ¢Õ¡Õ©","Õ‡Õ¡Õ¢Õ¡Õ©"]},kg:{months:["Үчтүн айы","Бирдин айы","Жалган Куран","Чын Куран","Бугу","Кулжа","Теке","Баш Оона","ÐÑк Оона","Тогуздун айы","Жетинин айы","Бештин айы"],dayOfWeekShort:["Жек","Дүй","Шей","Шар","Бей","Жум","Ише"],dayOfWeek:["Жекшемб","Дүйшөмб","Шейшемб","Шаршемб","Бейшемби","Жума","Ишенб"]},rm:{months:["Schaner","Favrer","Mars","Avrigl","Matg","Zercladur","Fanadur","Avust","Settember","October","November","December"],dayOfWeekShort:["Du","Gli","Ma","Me","Gie","Ve","So"],dayOfWeek:["Dumengia","Glindesdi","Mardi","Mesemna","Gievgia","Venderdi","Sonda"]},ka:{months:["იáƒáƒœáƒ•áƒáƒ áƒ˜","თებერვáƒáƒšáƒ˜","მáƒáƒ áƒ¢áƒ˜","áƒáƒžáƒ áƒ˜áƒšáƒ˜","მáƒáƒ˜áƒ¡áƒ˜","ივნისი","ივლისი","áƒáƒ’ვისტáƒ","სექტემბერი","áƒáƒ¥áƒ¢áƒáƒ›áƒ‘ერი","ნáƒáƒ”მბერი","დეკემბერი"],dayOfWeekShort:["კვ","áƒáƒ áƒ¨","სáƒáƒ›áƒ¨","áƒáƒ—ხ","ხუთ","პáƒáƒ ","შáƒáƒ‘"],dayOfWeek:["კვირáƒ","áƒáƒ áƒ¨áƒáƒ‘áƒáƒ—ი","სáƒáƒ›áƒ¨áƒáƒ‘áƒáƒ—ი","áƒáƒ—ხშáƒáƒ‘áƒáƒ—ი","ხუთშáƒáƒ‘áƒáƒ—ი","პáƒáƒ áƒáƒ¡áƒ™áƒ”ვი","შáƒáƒ‘áƒáƒ—ი"]},kk:{months:["Қаңтар","Ðқпан","Ðаурыз","Сәуір","Мамыр","МауÑым","Шілде","Тамыз","Қыркүйек","Қазан","Қараша","ЖелтоқÑан"],dayOfWeekShort:["Жк","ДÑ","СÑ","Ср","БÑ","Жм","Сб"],dayOfWeek:["ЖекÑенбі","ДүйÑенбі","СейÑенбі","СәрÑенбі","БейÑенбі","Жұма","Сенбі"]}},ownerDocument:document,contentWindow:window,value:"",rtl:!1,format:"Y/m/d H:i",formatTime:"H:i",formatDate:"Y/m/d",startDate:!1,step:60,monthChangeSpinner:!0,closeOnDateSelect:!1,closeOnTimeSelect:!0,closeOnWithoutClick:!0,closeOnInputClick:!0,openOnFocus:!0,timepicker:!0,datepicker:!0,weeks:!1,defaultTime:!1,defaultDate:!1,minDate:!1,maxDate:!1,minTime:!1,maxTime:!1,minDateTime:!1,maxDateTime:!1,allowTimes:[],opened:!1,initTime:!0,inline:!1,theme:"",touchMovedThreshold:5,onSelectDate:function(){},onSelectTime:function(){},onChangeMonth:function(){},onGetWeekOfYear:function(){},onChangeYear:function(){},onChangeDateTime:function(){},onShow:function(){},onClose:function(){},onGenerate:function(){},withoutCopyright:!0,inverseButton:!1,hours12:!1,next:"xdsoft_next",prev:"xdsoft_prev",dayOfWeekStart:0,parentID:"body",timeHeightInTimePicker:25,timepickerScrollbar:!0,todayButton:!0,prevButton:!0,nextButton:!0,defaultSelect:!0,scrollMonth:!0,scrollTime:!0,scrollInput:!0,lazyInit:!1,mask:!1,validateOnBlur:!0,allowBlank:!0,yearStart:1950,yearEnd:2050,monthStart:0,monthEnd:11,style:"",id:"",fixed:!1,roundTime:"round",className:"",weekends:[],highlightedDates:[],highlightedPeriods:[],allowDates:[],allowDateRe:null,disabledDates:[],disabledWeekDays:[],yearOffset:0,beforeShowDay:null,enterLikeTab:!0,showApplyButton:!1,insideParent:!1},E=null,o=null,V="en",a={meridiem:["AM","PM"]},r=function(){var e=s.i18n[V],t={days:e.dayOfWeek,daysShort:e.dayOfWeekShort,months:e.months,monthsShort:L.map(e.months,function(e){return e.substring(0,3)})};"function"==typeof DateFormatter&&(E=o=new DateFormatter({dateSettings:L.extend({},a,t)}))},n={moment:{default_options:{format:"YYYY/MM/DD HH:mm",formatDate:"YYYY/MM/DD",formatTime:"HH:mm"},formatter:{parseDate:function(e,t){if(i(t))return o.parseDate(e,t);var a=moment(e,t);return!!a.isValid()&&a.toDate()},formatDate:function(e,t){return i(t)?o.formatDate(e,t):moment(e).format(t)},formatMask:function(e){return e.replace(/Y{4}/g,"9999").replace(/Y{2}/g,"99").replace(/M{2}/g,"19").replace(/D{2}/g,"39").replace(/H{2}/g,"29").replace(/m{2}/g,"59").replace(/s{2}/g,"59")}}}};L.datetimepicker={setLocale:function(e){var t=s.i18n[e]?e:"en";V!==t&&(V=t,r())},setDateFormatter:function(e){if("string"==typeof e&&n.hasOwnProperty(e)){var t=n[e];L.extend(s,t.default_options),E=t.formatter}else E=e}};var t={RFC_2822:"D, d M Y H:i:s O",ATOM:"Y-m-dTH:i:sP",ISO_8601:"Y-m-dTH:i:sO",RFC_822:"D, d M y H:i:s O",RFC_850:"l, d-M-y H:i:s T",RFC_1036:"D, d M y H:i:s O",RFC_1123:"D, d M Y H:i:s O",RSS:"D, d M Y H:i:s O",W3C:"Y-m-dTH:i:sP"},i=function(e){return-1!==Object.values(t).indexOf(e)};function m(e,t,a){this.date=e,this.desc=t,this.style=a}L.extend(L.datetimepicker,t),r(),window.getComputedStyle||(window.getComputedStyle=function(a){return this.el=a,this.getPropertyValue=function(e){var t=/(-([a-z]))/g;return"float"===e&&(e="styleFloat"),t.test(e)&&(e=e.replace(t,function(e,t,a){return a.toUpperCase()})),a.currentStyle[e]||null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var a,o;for(a=t||0,o=this.length;a'),u=L('
    '),d.append(u),l.addClass("xdsoft_scroller_box").append(d),p=function(e){var t=a(e).y-r+g;t<0&&(t=0),t+u[0].offsetHeight>h&&(t=h-u[0].offsetHeight),l.trigger("scroll_element.xdsoft_scroller",[c?t/c:0])},u.on("touchstart.xdsoft_scroller mousedown.xdsoft_scroller",function(e){i||l.trigger("resize_scroll.xdsoft_scroller",[y]),r=a(e).y,g=parseInt(u.css("marginTop"),10),h=d[0].offsetHeight,"mousedown"===e.type||"touchstart"===e.type?(D.ownerDocument&&L(D.ownerDocument.body).addClass("xdsoft_noselect"),L([D.ownerDocument.body,D.contentWindow]).on("touchend mouseup.xdsoft_scroller",function e(){L([D.ownerDocument.body,D.contentWindow]).off("touchend mouseup.xdsoft_scroller",e).off("mousemove.xdsoft_scroller",p).removeClass("xdsoft_noselect")}),L(D.ownerDocument.body).on("mousemove.xdsoft_scroller",p)):(t=!0,e.stopPropagation(),e.preventDefault())}).on("touchmove",function(e){t&&(e.preventDefault(),p(e))}).on("touchend touchcancel",function(){t=!1,g=0}),l.on("scroll_element.xdsoft_scroller",function(e,t){i||l.trigger("resize_scroll.xdsoft_scroller",[t,!0]),t=1'),e=L(''),g=L('
    '),F=L('
    '),C=L('
    '),n=L('
    '),u=n.find(".xdsoft_time_box").eq(0),P=L('
    '),i=L(''),A=L('
    '),Y=L('
    '),s=!1,d=0;I.id&&_.attr("id",I.id),I.style&&_.attr("style",I.style),I.weeks&&_.addClass("xdsoft_showweeks"),I.rtl&&_.addClass("xdsoft_rtl"),_.addClass("xdsoft_"+I.theme),_.addClass(I.className),F.find(".xdsoft_month span").after(A),F.find(".xdsoft_year span").after(Y),F.find(".xdsoft_month,.xdsoft_year").on("touchstart mousedown.xdsoft",function(e){var t,a,o=L(this).find(".xdsoft_select").eq(0),r=0,n=0,i=o.is(":visible");for(F.find(".xdsoft_select").hide(),W.currentTime&&(r=W.currentTime[L(this).hasClass("xdsoft_month")?"getMonth":"getFullYear"]()),o[i?"hide":"show"](),t=o.find("div.xdsoft_option"),a=0;aI.touchMovedThreshold&&(this.touchMoved=!0)};function f(){var e,t=!1;return I.startDate?t=W.strToDate(I.startDate):(t=I.value||(w&&w.val&&w.val()?w.val():""))?(t=W.strToDateTime(t),I.yearOffset&&(t=new Date(t.getFullYear()-I.yearOffset,t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))):I.defaultDate&&(t=W.strToDateTime(I.defaultDate),I.defaultTime&&(e=W.strtotime(I.defaultTime),t.setHours(e.getHours()),t.setMinutes(e.getMinutes()))),t&&W.isValidDate(t)?_.data("changed",!0):t="",t||0}function c(m){var h=function(e,t){var a=e.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,"\\$1").replace(/_/g,"{digit+}").replace(/([0-9]{1})/g,"{digit$1}").replace(/\{digit([0-9]{1})\}/g,"[0-$1_]{1}").replace(/\{digit[\+]\}/g,"[0-9_]{1}");return new RegExp(a).test(t)},g=function(e,t){if(!(e="string"==typeof e||e instanceof String?m.ownerDocument.getElementById(e):e))return!1;if(e.createTextRange){var a=e.createTextRange();return a.collapse(!0),a.moveEnd("character",t),a.moveStart("character",t),a.select(),!0}return!!e.setSelectionRange&&(e.setSelectionRange(t,t),!0)};m.mask&&w.off("keydown.xdsoft"),!0===m.mask&&(E.formatMask?m.mask=E.formatMask(m.format):m.mask=m.format.replace(/Y/g,"9999").replace(/F/g,"9999").replace(/m/g,"19").replace(/d/g,"39").replace(/H/g,"29").replace(/i/g,"59").replace(/s/g,"59")),"string"===L.type(m.mask)&&(h(m.mask,w.val())||(w.val(m.mask.replace(/[0-9]/g,"_")),g(w[0],0)),w.on("paste.xdsoft",function(e){var t=(e.clipboardData||e.originalEvent.clipboardData||window.clipboardData).getData("text"),a=this.value,o=this.selectionStart;return a=a.substr(0,o)+t+a.substr(o+t.length),o+=t.length,h(m.mask,a)?(this.value=a,g(this,o)):""===L.trim(a)?this.value=m.mask.replace(/[0-9]/g,"_"):w.trigger("error_input.xdsoft"),e.preventDefault(),!1}),w.on("keydown.xdsoft",function(e){var t,a=this.value,o=e.which,r=this.selectionStart,n=this.selectionEnd,i=r!==n;if(48<=o&&o<=57||96<=o&&o<=105||8===o||46===o){for(t=8===o||46===o?"_":String.fromCharCode(96<=o&&o<=105?o-48:o),8===o&&r&&!i&&(r-=1);;){var s=m.mask.substr(r,1),d=r",I.weeks&&(l+=""),e=0;e<7;e+=1)l+=""+I.i18n[V].dayOfWeekShort[(e+I.dayOfWeekStart)%7]+"";for(l+="",l+="",!1!==I.maxDate&&(h=W.strToDate(I.maxDate),h=new Date(h.getFullYear(),h.getMonth(),h.getDate(),23,59,59,999)),!1!==I.minDate&&(g=W.strToDate(I.minDate),g=new Date(g.getFullYear(),g.getMonth(),g.getDate())),!1!==I.minDateTime&&(p=W.strToDate(I.minDateTime),p=new Date(p.getFullYear(),p.getMonth(),p.getDate(),p.getHours(),p.getMinutes(),p.getSeconds())),!1!==I.maxDateTime&&(D=W.strToDate(I.maxDateTime),D=new Date(D.getFullYear(),D.getMonth(),D.getDate(),D.getHours(),D.getMinutes(),D.getSeconds())),!1!==D&&(u=31*(12*D.getFullYear()+D.getMonth())+D.getDate());c",k=!1,I.weeks&&(l+=""+n+"")),l+='
    '+o+"
    ",f.getDay()===I.dayOfWeekStartPrev&&(l+="",k=!0),f.setDate(o+1)}l+="",C.html(l),F.find(".xdsoft_label span").eq(0).text(I.i18n[V].months[W.currentTime.getMonth()]),F.find(".xdsoft_label span").eq(1).text(W.currentTime.getFullYear()+I.yearOffset),O=x="";var b=0;if(!1!==I.minTime){var T=W.strtotime(I.minTime);b=60*T.getHours()+T.getMinutes()}var S=1440;if(!1!==I.maxTime){T=W.strtotime(I.maxTime);S=60*T.getHours()+T.getMinutes()}if(!1!==I.minDateTime){T=W.strToDateTime(I.minDateTime);if(E.formatDate(W.currentTime,I.formatDate)===E.formatDate(T,I.formatDate)){var O=60*T.getHours()+T.getMinutes();b'+E.formatDate(o,I.formatTime)+""},I.allowTimes&&L.isArray(I.allowTimes)&&I.allowTimes.length)for(c=0;c'+(c+I.yearOffset)+"";for(Y.children().eq(0).html(H),c=parseInt(I.monthStart,10),H="";c<=parseInt(I.monthEnd,10);c+=1)H+='
    '+I.i18n[V].months[c]+"
    ";A.children().eq(0).html(H),L(_).trigger("generate.xdsoft")},10),e.stopPropagation()}).on("afterOpen.xdsoft",function(){var e,t,a,o;I.timepicker&&(P.find(".xdsoft_current").length?e=".xdsoft_current":P.find(".xdsoft_init_time").length&&(e=".xdsoft_init_time"),e?(t=u[0].clientHeight,(a=P[0].offsetHeight)-t<(o=P.find(e).index()*I.timeHeightInTimePicker+1)&&(o=a-t),u.trigger("scroll_element.xdsoft_scroller",[parseInt(o,10)/(a-t)])):u.trigger("scroll_element.xdsoft_scroller",[0]))}),o=0,C.on("touchend click.xdsoft","td",function(e){e.stopPropagation(),o+=1;var t=L(this),a=W.currentTime;if(null==a&&(W.currentTime=W.now(),a=W.currentTime),t.hasClass("xdsoft_disabled"))return!1;a.setDate(1),a.setFullYear(t.data("year")),a.setMonth(t.data("month")),a.setDate(t.data("date")),_.trigger("select.xdsoft",[a]),w.val(W.str()),I.onSelectDate&&L.isFunction(I.onSelectDate)&&I.onSelectDate.call(_,W.currentTime,_.data("input"),e),_.data("changed",!0),_.trigger("xchange.xdsoft"),_.trigger("changedatetime.xdsoft"),(1f+c?(u="bottom",a=f+c-e.top):a-=c):a+_[0].offsetHeight>f+c&&(a=e.top-_[0].offsetHeight+1),a<0&&(a=0),o+t.offsetWidth>d&&(o=d-t.offsetWidth)),n=_[0],h(n,function(e){if("relative"===I.contentWindow.getComputedStyle(e).getPropertyValue("position")&&d>=e.offsetWidth)return o-=(d-e.offsetWidth)/2,!1}),l={position:r,left:I.insideParent?t.offsetLeft:o,top:"",bottom:""},I.insideParent?l[u]=t.offsetTop+t.offsetHeight:l[u]=a,_.css(l)},_.on("open.xdsoft",function(e){var t=!0;I.onShow&&L.isFunction(I.onShow)&&(t=I.onShow.call(_,W.currentTime,_.data("input"),e)),!1!==t&&(_.show(),r(),L(I.contentWindow).off("resize.xdsoft",r).on("resize.xdsoft",r),I.closeOnWithoutClick&&L([I.ownerDocument.body,I.contentWindow]).on("touchstart mousedown.xdsoft",function e(){_.trigger("close.xdsoft"),L([I.ownerDocument.body,I.contentWindow]).off("touchstart mousedown.xdsoft",e)}))}).on("close.xdsoft",function(e){var t=!0;F.find(".xdsoft_month,.xdsoft_year").find(".xdsoft_select").hide(),I.onClose&&L.isFunction(I.onClose)&&(t=I.onClose.call(_,W.currentTime,_.data("input"),e)),!1===t||I.opened||I.inline||_.hide(),e.stopPropagation()}).on("toggle.xdsoft",function(){_.is(":visible")?_.trigger("close.xdsoft"):_.trigger("open.xdsoft")}).data("input",w),d=0,_.data("xdsoft_datetime",W),_.setOptions(I),W.setCurrentTime(f()),w.data("xdsoft_datetimepicker",_).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function(){w.is(":disabled")||w.data("xdsoft_datetimepicker").is(":visible")&&I.closeOnInputClick||I.openOnFocus&&(clearTimeout(d),d=setTimeout(function(){w.is(":disabled")||(s=!0,W.setCurrentTime(f(),!0),I.mask&&c(I),_.trigger("open.xdsoft"))},100))}).on("keydown.xdsoft",function(e){var t,a=e.which;return-1!==[D].indexOf(a)&&I.enterLikeTab?(t=L("input:visible,textarea:visible,button:visible,a:visible"),_.trigger("close.xdsoft"),t.eq(t.index(this)+1).focus(),!1):-1!==[T].indexOf(a)?(_.trigger("close.xdsoft"),!0):void 0}).on("blur.xdsoft",function(){_.trigger("close.xdsoft")})},r=function(e){var t=e.data("xdsoft_datetimepicker");t&&(t.data("xdsoft_datetime",null),t.remove(),e.data("xdsoft_datetimepicker",null).off(".xdsoft"),L(I.contentWindow).off("resize.xdsoft"),L([I.contentWindow,I.ownerDocument.body]).off("mousedown.xdsoft touchstart"),e.unmousewheel&&e.unmousewheel())},L(I.ownerDocument).off("keydown.xdsoftctrl keyup.xdsoftctrl").off("keydown.xdsoftcmd keyup.xdsoftcmd").on("keydown.xdsoftctrl",function(e){e.keyCode===p&&(N=!0)}).on("keyup.xdsoftctrl",function(e){e.keyCode===p&&(N=!1)}).on("keydown.xdsoftcmd",function(e){91===e.keyCode&&!0}).on("keyup.xdsoftcmd",function(e){91===e.keyCode&&!1}),this.each(function(){var t,e=L(this).data("xdsoft_datetimepicker");if(e){if("string"===L.type(H))switch(H){case"show":L(this).select().focus(),e.trigger("open.xdsoft");break;case"hide":e.trigger("close.xdsoft");break;case"toggle":e.trigger("toggle.xdsoft");break;case"destroy":r(L(this));break;case"reset":this.value=this.defaultValue,this.value&&e.data("xdsoft_datetime").isValidDate(E.parseDate(this.value,I.format))||e.data("changed",!1),e.data("xdsoft_datetime").setCurrentTime(this.value);break;case"validate":e.data("input").trigger("blur.xdsoft");break;default:e[H]&&L.isFunction(e[H])&&(n=e[H](a))}else e.setOptions(H);return 0}"string"!==L.type(H)&&(!I.lazyInit||I.open||I.inline?o(L(this)):(t=L(this)).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function e(){t.is(":disabled")||t.data("xdsoft_datetimepicker")||(clearTimeout(i),i=setTimeout(function(){t.data("xdsoft_datetimepicker")||o(t),t.off("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",e).trigger("open.xdsoft")},100))}))}),n},L.fn.datetimepicker.defaults=s};!function(e){"function"==typeof define&&define.amd?define(["jquery","jquery-mousewheel"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(datetimepickerFactory); + diff --git a/plugins/datetimepicker-master/datetimepicker.jquery.json b/plugins/datetimepicker-master/datetimepicker.jquery.json new file mode 100644 index 0000000..fbaa3c4 --- /dev/null +++ b/plugins/datetimepicker-master/datetimepicker.jquery.json @@ -0,0 +1,47 @@ +{ + "name": "datetimepicker", + "version": "2.5.4", + "title": "jQuery Date and Time picker", + "description": "jQuery plugin for date, time, or datetime manipulation in form", + "keywords": [ + "calendar", + "date", + "time", + "form", + "datetime", + "datepicker", + "timepicker", + "datetimepicker", + "validation", + "ui", + "scroller", + "picker", + "i18n", + "input", + "jquery", + "touch" + ], + "author": { + "name": "Chupurnov Valeriy", + "email": "chupurnov@gmail.com", + "url": "http://xdsoft.net/contacts.html" + }, + "maintainers": [{ + "name": "Chupurnov Valeriy", + "email": "chupurnov@gmail.com", + "url": "http://xdsoft.net" + }], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/xdan/datetimepicker/blob/master/MIT-LICENSE.txt" + } + ], + "bugs": "https://github.com/xdan/datetimepicker/issues", + "homepage": "http://xdsoft.net/jqplugins/datetimepicker/", + "docs": "http://xdsoft.net/jqplugins/datetimepicker/", + "download": "https://github.com/xdan/datetimepicker/archive/master.zip", + "dependencies": { + "jquery": ">=1.7" + } +} \ No newline at end of file diff --git a/plugins/datetimepicker-master/doc.tpl b/plugins/datetimepicker-master/doc.tpl new file mode 100644 index 0000000..196c722 --- /dev/null +++ b/plugins/datetimepicker-master/doc.tpl @@ -0,0 +1,1015 @@ +

    DateTimepicker

    +

    +

    Use mask DateTimepicker

    +

    +

    TimePicker

    +

    +

    DatePicker

    +

    +

    Inline DateTimePicker

    +

    +

    Dark theme

    +

    + +[include scripts/pp/reklama1.php] +

    How do I use it?

    +

    First include to page css and js files

    +
    <!-- this should go after your </body> -->
    +<link rel="stylesheet" type="text/css" href="jquery.datetimepicker.css"/ >
    +<script src="jquery.js"></script>
    +<script src="build/jquery.datetimepicker.full.min.js"></script>
    +

    Examples

    +
    +

    Simple init DateTimePicker Example #

    +

    HTML

    +
    <input id="datetimepicker" type="text" >
    +

    javaScript

    +
    jQuery('#datetimepicker').datetimepicker();
    +

    Result

    +

    + +
    +

    i18n DatePicker Example #

    +

    All supported languages here

    +

    javaScript

    +
    jQuery.datetimepicker.setLocale('de');
    +
    +jQuery('#datetimepicker1').datetimepicker({
    + i18n:{
    +  de:{
    +   months:[
    +    'Januar','Februar','März','April',
    +    'Mai','Juni','Juli','August',
    +    'September','Oktober','November','Dezember',
    +   ],
    +   dayOfWeek:[
    +    "So.", "Mo", "Di", "Mi", 
    +    "Do", "Fr", "Sa.",
    +   ]
    +  }
    + },
    + timepicker:false,
    + format:'d.m.Y'
    +});
    +

    Result

    +

    + +
    +

    Only TimePicker Example #

    +

    javaScript

    +
    jQuery('#datetimepicker2').datetimepicker({
    +  datepicker:false,
    +  format:'H:i'
    +});
    +

    Result

    +

    + +

    Date Time Picker start date #

    +

    javaScript

    +
    jQuery('#datetimepicker_start_time').datetimepicker({
    +  startDate:'+1971/05/01'//or 1986/12/08
    +});
    +

    Result

    +

    + +

    Date Time Picker from unixtime #

    +

    javaScript

    +
    jQuery('#datetimepicker_unixtime').datetimepicker({
    +  format:'unixtime'
    +});
    +

    Result

    +

    + +
    +

    Inline DateTimePicker Example #

    +

    javaScript

    +
    jQuery('#datetimepicker3').datetimepicker({
    +  format:'d.m.Y H:i',
    +  inline:true,
    +  lang:'ru'
    +});
    +

    Result

    +

    + +
    +

    Icon trigger #

    +

    Click the icon next to the input field to show the datetimepicker

    +

    javaScript

    +
    jQuery('#datetimepicker4').datetimepicker({
    +  format:'d.m.Y H:i',
    +  lang:'ru'
    +});
    +

    and handler onclick event

    +
    jQuery('#image_button').click(function(){
    +  jQuery('#datetimepicker4').datetimepicker('show'); //support hide,show and destroy command
    +});
    +

    Result

    +
    +
    +
    +
    +
    + + +
    +

    allowTimes options TimePicker Example #

    +

    javaScript

    +
    jQuery('#datetimepicker5').datetimepicker({
    + datepicker:false,
    + allowTimes:[
    +  '12:00', '13:00', '15:00', 
    +  '17:00', '17:05', '17:20', '19:00', '20:00'
    + ]
    +});
    +

    Result

    +

    + +
    +

    handler onChangeDateTime Example #

    +

    javaScript

    +
    jQuery('#datetimepicker6').datetimepicker({
    +  timepicker:false,
    +  onChangeDateTime:function(dp,$input){
    +    alert($input.val())
    +  }
    +});
    +

    Result

    +

    + +
    +

    minDate and maxDate Example #

    +

    javaScript

    +
    jQuery('#datetimepicker7').datetimepicker({
    + timepicker:false,
    + formatDate:'Y/m/d',
    + minDate:'-1970/01/02',//yesterday is minimum date(for today use 0 or -1970/01/01)
    + maxDate:'+1970/01/02'//tomorrow is maximum date calendar
    +});
    +

    Result

    +

    + +
    +

    Use mask input Example #

    +

    javaScript

    +
    jQuery('#datetimepicker_mask').datetimepicker({
    + timepicker:false,
    + mask:true, // '9999/19/39 29:59' - digit is the maximum possible for a cell
    +});
    +

    Result

    +

    + +
    +

    Set options runtime DateTimePicker #

    +

    If select day is Saturday, the minimum set 11:00, otherwise 8:00

    +

    javaScript

    +
    var logic = function( currentDateTime ){
    +  // 'this' is jquery object datetimepicker
    +  if( currentDateTime.getDay()==6 ){
    +    this.setOptions({
    +      minTime:'11:00'
    +    });
    +  }else
    +    this.setOptions({
    +      minTime:'8:00'
    +    });
    +};
    +jQuery('#datetimepicker_rantime').datetimepicker({
    +  onChangeDateTime:logic,
    +  onShow:logic
    +});
    +

    Result

    +

    + +
    +

    After generating a calendar called the event onGenerate #

    +

    Invert settings minDate and maxDate

    +

    javaScript

    +
    jQuery('#datetimepicker8').datetimepicker({
    +  onGenerate:function( ct ){
    +    jQuery(this).find('.xdsoft_date')
    +      .toggleClass('xdsoft_disabled');
    +  },
    +  minDate:'-1970/01/2',
    +  maxDate:'+1970/01/2',
    +  timepicker:false
    +});
    +

    Result

    +

    + +
    +

    disable all weekend #

    +

    javaScript

    +
    jQuery('#datetimepicker9').datetimepicker({
    +  onGenerate:function( ct ){
    +    jQuery(this).find('.xdsoft_date.xdsoft_weekend')
    +      .addClass('xdsoft_disabled');
    +  },
    +  weekends:['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014'],
    +  timepicker:false
    +});
    +

    Result

    +

    + +
    +

    Use another date parser/formatter#

    +

    By default, datetimepicker uses php-date-formatter for parsing and formatting the date and time displayed. You can replace the library by setting a custom DateFormatter. Simply supply an object that implements the parseDate and formatDate methods. This example uses the popular MomentJS library:

    +
    $.datetimepicker.setDateFormatter({
    +    parseDate: function (date, format) {
    +        var d = moment(date, format);
    +        return d.isValid() ? d.toDate() : false;
    +    },
    +    
    +    formatDate: function (date, format) {
    +        return moment(date).format(format);
    +    },
    +
    +    //Optional if using mask input
    +    formatMask: function(format){
    +        return format
    +            .replace(/Y{4}/g, '9999')
    +            .replace(/Y{2}/g, '99')
    +            .replace(/M{2}/g, '19')
    +            .replace(/D{2}/g, '39')
    +            .replace(/H{2}/g, '29')
    +            .replace(/m{2}/g, '59')
    +            .replace(/s{2}/g, '59');
    +    }
    +});
    +
    +

    After this, you can init datetimepicker with moment.js format

    +
    jQuery('#datetimepicker').datetimepicker({
    +  format:'DD.MM.YYYY h:mm a',
    +  formatTime:'h:mm a',
    +  formatDate:'DD.MM.YYYY'
    +});
    +

    Because of its popularity, moment.js has a pre-defined configuration that can be enabled with:

    +
    $.datetimepicker.setDateFormatter('moment');
    +
    +

    Range between date#

    +

    javaScript

    +
    jQuery(function(){
    + jQuery('#date_timepicker_start').datetimepicker({
    +  format:'Y/m/d',
    +  onShow:function( ct ){
    +   this.setOptions({
    +    maxDate:jQuery('#date_timepicker_end').val()?jQuery('#date_timepicker_end').val():false
    +   })
    +  },
    +  timepicker:false
    + });
    + jQuery('#date_timepicker_end').datetimepicker({
    +  format:'Y/m/d',
    +  onShow:function( ct ){
    +   this.setOptions({
    +    minDate:jQuery('#date_timepicker_start').val()?jQuery('#date_timepicker_start').val():false
    +   })
    +  },
    +  timepicker:false
    + });
    +});
    +

    Result

    +

    Start End

    + +[include scripts/pp/reklama2.php] +{module 147} +

    Full options list

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Name defaultDescrEx.
    lazyInitfalseInitializing plugin occurs only when the user interacts. Greatly accelerates plugin work with a large number of fields
    parentID'body'Attach datetimepicker to this element, which can be either a selector or a DOM/JQuery element +
    {parentID:'#parent'}
    +
    valuenullCurrent value datetimepicker. If it is set, ignored input.value +
    {value:'12.03.2013',
    + format:'d.m.Y'}
    +
    langenLanguage i18n
    + +ar - Arabic +
    az - Azerbaijanian (Azeri) +
    bg - Bulgarian +
    bs - Bosanski +
    ca - Català +
    ch - Simplified Chinese +
    cs - Čeština +
    da - Dansk +
    de - German +
    el - Ελληνικά +
    en - English +
    en-GB - English (British) +
    es - Spanish +
    et - "Eesti" +
    eu - Euskara +
    fa - Persian +
    fi - Finnish (Suomi) +
    fr - French +
    gl - Galego +
    he - Hebrew (עברית) +
    hr - Hrvatski +
    hu - Hungarian +
    id - Indonesian +
    it - Italian +
    ja - Japanese +
    ko - Korean (한국어) +
    kr - Korean +
    lt - Lithuanian (lietuvių) +
    lv - Latvian (Latviešu) +
    mk - Macedonian (МакедонÑки) +
    mn - Mongolian (Монгол) +
    nl - Dutch +
    no - Norwegian +
    pl - Polish +
    pt - Portuguese +
    pt-BR - Português(Brasil) +
    ro - Romanian +
    ru - Russian +
    se - Swedish +
    sk - SlovenÄina +
    sl - SlovenÅ¡Äina +
    sq - Albanian (Shqip) +
    sr - Serbian Cyrillic (СрпÑки) +
    sr-YU - Serbian (Srpski) +
    sv - Svenska +
    th - Thai +
    tr - Turkish +
    uk - Ukrainian +
    vi - Vietnamese +
    zh - Simplified Chinese (简体中文) +
    zh-TW - Traditional Chinese (ç¹é«”中文) +
    + + +
    +
    $.datetimepicker.setLocale('ru');
    +
    formatY/m/d H:iFormat datetime. More Also there is a special type of «unixtime» +
    {format:'H'}
    +{format:'Y'}{format:'unixtime'}
    +
    formatDateY/m/dFormat date for minDate and maxDate +
    {formatDate:'d.m.Y'}
    +
    formatTimeH:i Similarly, formatDate . But for minTime and maxTime +
    {formatTime:'H'}
    +
    step60Step time +
    {step:5}
    +
    closeOnDateSelect0 +
    {closeOnDateSelect:true}
    +
    closeOnWithoutClicktrue +
    { closeOnWithoutClick :false}
    +
    validateOnBlurtrueVerify datetime value from input, when losing focus. If value is not valid datetime, then to value inserts the current datetime +
    { validateOnBlur:false}
    +
    timepickertrue +
    {timepicker:false}
    +
    datepickertrue +
    {datepicker:false}
    +
    weeksfalseShow week number +
    {weeks:true}
    +
    theme'default'Setting a color scheme. Now only supported default and dark theme +
    {theme:'dark'}
    +
    minDatefalse +
    {minDate:0} // today
    +{minDate:'2013/12/03'}
    +{minDate:'-1970/01/02'} // yesterday
    +{minDate:'05.12.2013',formatDate:'d.m.Y'}
    +
    maxDatefalse +
    {maxDate:0}
    +{maxDate:'2013/12/03'}
    +{maxDate:'+1970/01/02'} // tomorrow
    +{maxDate:'05.12.2013',formatDate:'d.m.Y'}
    +
    startDatefalsecalendar set date use starDate +
    {startDate:'1987/12/03'}
    +{startDate:new Date()}
    +{startDate:'+1970/01/02'} // tomorrow
    +{startDate:'08.12.1986',formatDate:'d.m.Y'}
    +
    defaultDatefalseif input value is empty, calendar set date use defaultDate +
    {defaultDate:'1987/12/03'}
    +{defaultDate:new Date()}
    +{defaultDate:'+1970/01/02'} // tomorrow
    +{defaultDate:'08.12.1986',formatDate:'d.m.Y'}
    +
    defaultTimefalseif input value is empty, timepicker set time use defaultTime +
    {defaultTime:'05:00'}
    +{defaultTime:'33-12',formatTime:'i-H'}
    +
    minTimefalse +
    {minTime:0,}// now
    +{minTime:new Date()}
    +{minTime:'12:00'}
    +{minTime:'13:45:34',formatTime:'H:i:s'}
    +
    maxTimefalse +
    {maxTime:0,}
    +{maxTime:'12:00'}
    +{maxTime:'13:45:34',formatTime:'H:i:s'}
    +
    allowTimes[] +
    {allowTimes:[
    +  '09:00',
    +  '11:00',
    +  '12:00',
    +  '21:00'
    +]}
    +
    maskfalseUse mask for input. true - automatically generates a mask on the field 'format', Digit from 0 to 9, set the highest possible digit for the value. For example: the first digit of hours can not be greater than 2, and the first digit of the minutes can not be greater than 5 +
    {mask:'9999/19/39',format:'Y/m/d'}
    +{mask:true,format:'Y/m/d'} // automatically generate a mask 9999/99/99
    +{mask:'29:59',format:'H:i'} //
    +{mask:true,format:'H:i'} //automatically generate a mask 99:99
    +
    openedfalse
    yearOffset0Year offset for Buddhist era
    inlinefalse
    todayButtontrueShow button "Go To Today"
    defaultSelecttrueHighlight the current date even if the input is empty
    allowBlankfalseAllow field to be empty even with the option validateOnBlur in true
    timepickerScrollbartrue
    onSelectDatefunction(){} +
    onSelectDate:function(ct,$i){
    +  alert(ct.dateFormat('d/m/Y'))
    +}
    +
    onSelectTimefunction(current_time,$input){}
    onChangeMonthfunction(current_time,$input){}
    onChangeYearfunction(current_time,$input){}
    onChangeDateTimefunction(current_time,$input){}
    onShowfunction(current_time,$input){}
    onClosefunction(current_time,$input){}
    onSelectDate:function(ct,$i){
    +  $i.datetimepicker('destroy');
    +}
    onGeneratefunction(current_time,$input){}trigger after construct calendar and timepicker
    withoutCopyrighttrue
    inverseButtonfalse
    scrollMonthtrue
    scrollTimetrue
    scrollInputtrue
    hours12false
    yearStart1950Start value for fast Year selector
    yearEnd2050End value for fast Year selector
    roundTimeroundRound time in timepicker, possible values: round, ceil, floor +
    {roundTime:'floor'}
    +
    dayOfWeekStart0 +

    Star week DatePicker. Default Sunday - 0.

    +

    Monday - 1 ...

    +
    className
    weekends[] +
    ['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014']
    +
    disabledDates[]

    Disbale all dates in list

    +
    {disabledDates: ['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014'], formatDate:'d.m.Y'}
    +
    allowDates[]

    Allow all dates in list

    +
    {allowDates: ['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014'], formatDate:'d.m.Y'}
    +
    allowDateRe[]

    Use Regex to check dates

    +
    {format:'Y-m-d',allowDateRe:'\d{4}-(03-31|06-30|09-30|12-31)' }
    +
    disabledWeekDays[]

    Disable days listed by index

    +
    [0, 3, 4]
    +
    id
    style
    ownerDocumentdocumentThe ownerDocument object for the datetimepicker to properly attach events and calc position (iframe support).
    contentWindowwindowThe contentWindow object that contains the datetimepicker to properly attach events (iframe support).
    +
    +

    Methods

    +

    show

    +

    Show Datetimepicker

    +
    $('#input').datetimepicker();
    +$('button.somebutton').on('click', function () {
    +    $('#input').datetimepicker('show');
    +});
    +

    hide

    +

    Hide Datetimepicker

    +
    $('#input').datetimepicker();
    +$(window).on('resize', function () {
    +    $('#input').datetimepicker('hide');
    +});
    +

    toggle

    +

    Sgow/Hide Datetimepicker

    +
    $('#input').datetimepicker();
    +$('button.trigger').on('click', function () {
    +    $('#input').datetimepicker('toggle');
    +});
    +

    destroy

    +

    Destroy datetimepicker

    +
    $('#input').datetimepicker();
    +$('#input').datetimepicker('destroy');
    +
    +

    reset

    +

    Reset datetimepicker's value

    +
    $('#input').datetimepicker();
    +$('#input').val('12/01/2006');
    +$('#input')
    +    .datetimepicker('show')
    +    .datetimepicker('reset')
    +
    +

    validate

    +

    Validate datetimepicker's value

    +
    $('#input').datetimepicker();
    +$('#input').datetimepicker(validate)
    +
    +

    setOptions

    +

    Set datetimepicker's options

    +
    $('#input').datetimepicker({format: 'd.m.Y'});
    +$('#input').datetimepicker('setOptions', {format: 'd/m/Y'});
    +//or
    +$('#input').datetimepicker({format: 'd/m/Y'});
    +
    +

    getValue

    +

    Get current datetimepicker's value (Date object)

    +
    $('#input').datetimepicker();
    +$('button.somebutton').on('click', function () {
    +    var d = $('#input').datetimepicker('getValue');
    +    console.log(d.getFullYear());
    +});
    +
    diff --git a/plugins/datetimepicker-master/index.html b/plugins/datetimepicker-master/index.html new file mode 100644 index 0000000..e91c133 --- /dev/null +++ b/plugins/datetimepicker-master/index.html @@ -0,0 +1,225 @@ + + + + + + + + + +

    Homepage

    +

    DateTimePicker

    +

    +

    DateTimePickers selected by class

    + + +

    Mask DateTimePicker

    +

    +

    TimePicker

    +

    +

    DatePicker

    +

    +

    Inline DateTimePicker

    + +

    +

    Button Trigger

    + +

    TimePicker allows time

    +

    +

    Destroy DateTimePicker

    + +

    Set options runtime DateTimePicker

    + +

    If select day is Saturday, the minimum set 11:00, otherwise 8:00

    +

    onGenerate

    + +

    disable all weekend

    + +

    Default date and time

    + +

    Show inline

    + Show/Hide + +

    Disable Specific Dates

    +

    Disable the dates 2 days from now.

    + +

    Custom Date Styling

    +

    Make the background of the date 2 days from now bright red.

    + +

    Dark theme

    +

    thank for this https://github.com/lampslave

    + +

    Date time format and locale

    +

    + + + + + + + + + + + diff --git a/plugins/datetimepicker-master/jquery.datetimepicker.css b/plugins/datetimepicker-master/jquery.datetimepicker.css new file mode 100644 index 0000000..4ed981a --- /dev/null +++ b/plugins/datetimepicker-master/jquery.datetimepicker.css @@ -0,0 +1,568 @@ +.xdsoft_datetimepicker { + box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.506); + background: #fff; + border-bottom: 1px solid #bbb; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; + border-top: 1px solid #ccc; + color: #333; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 8px; + padding-left: 0; + padding-top: 2px; + position: absolute; + z-index: 9999; + -moz-box-sizing: border-box; + box-sizing: border-box; + display: none; +} +.xdsoft_datetimepicker.xdsoft_rtl { + padding: 8px 0 8px 8px; +} + +.xdsoft_datetimepicker iframe { + position: absolute; + left: 0; + top: 0; + width: 75px; + height: 210px; + background: transparent; + border: none; +} + +/*For IE8 or lower*/ +.xdsoft_datetimepicker button { + border: none !important; +} + +.xdsoft_noselect { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} + +.xdsoft_noselect::selection { background: transparent } +.xdsoft_noselect::-moz-selection { background: transparent } + +.xdsoft_datetimepicker.xdsoft_inline { + display: inline-block; + position: static; + box-shadow: none; +} + +.xdsoft_datetimepicker * { + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; + margin: 0; +} + +.xdsoft_datetimepicker .xdsoft_datepicker, .xdsoft_datetimepicker .xdsoft_timepicker { + display: none; +} + +.xdsoft_datetimepicker .xdsoft_datepicker.active, .xdsoft_datetimepicker .xdsoft_timepicker.active { + display: block; +} + +.xdsoft_datetimepicker .xdsoft_datepicker { + width: 224px; + float: left; + margin-left: 8px; +} +.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_datepicker { + float: right; + margin-right: 8px; + margin-left: 0; +} + +.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_datepicker { + width: 256px; +} + +.xdsoft_datetimepicker .xdsoft_timepicker { + width: 58px; + float: left; + text-align: center; + margin-left: 8px; + margin-top: 0; +} +.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker { + float: right; + margin-right: 8px; + margin-left: 0; +} + +.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker { + margin-top: 8px; + margin-bottom: 3px +} + +.xdsoft_datetimepicker .xdsoft_monthpicker { + position: relative; + text-align: center; +} + +.xdsoft_datetimepicker .xdsoft_label i, +.xdsoft_datetimepicker .xdsoft_prev, +.xdsoft_datetimepicker .xdsoft_next, +.xdsoft_datetimepicker .xdsoft_today_button { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC); +} + +.xdsoft_datetimepicker .xdsoft_label i { + opacity: 0.5; + background-position: -92px -19px; + display: inline-block; + width: 9px; + height: 20px; + vertical-align: middle; +} + +.xdsoft_datetimepicker .xdsoft_prev { + float: left; + background-position: -20px 0; +} +.xdsoft_datetimepicker .xdsoft_today_button { + float: left; + background-position: -70px 0; + margin-left: 5px; +} + +.xdsoft_datetimepicker .xdsoft_next { + float: right; + background-position: 0 0; +} + +.xdsoft_datetimepicker .xdsoft_next, +.xdsoft_datetimepicker .xdsoft_prev , +.xdsoft_datetimepicker .xdsoft_today_button { + background-color: transparent; + background-repeat: no-repeat; + border: 0 none; + cursor: pointer; + display: block; + height: 30px; + opacity: 0.5; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; + outline: medium none; + overflow: hidden; + padding: 0; + position: relative; + text-indent: 100%; + white-space: nowrap; + width: 20px; + min-width: 0; +} + +.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev, +.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next { + float: none; + background-position: -40px -15px; + height: 15px; + width: 30px; + display: block; + margin-left: 14px; + margin-top: 7px; +} +.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_prev, +.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_next { + float: none; + margin-left: 0; + margin-right: 14px; +} + +.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev { + background-position: -40px 0; + margin-bottom: 7px; + margin-top: 0; +} + +.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box { + height: 151px; + overflow: hidden; + border-bottom: 1px solid #ddd; +} + +.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div { + background: #f5f5f5; + border-top: 1px solid #ddd; + color: #666; + font-size: 12px; + text-align: center; + border-collapse: collapse; + cursor: pointer; + border-bottom-width: 0; + height: 25px; + line-height: 25px; +} + +.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div > div:first-child { + border-top-width: 0; +} + +.xdsoft_datetimepicker .xdsoft_today_button:hover, +.xdsoft_datetimepicker .xdsoft_next:hover, +.xdsoft_datetimepicker .xdsoft_prev:hover { + opacity: 1; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; +} + +.xdsoft_datetimepicker .xdsoft_label { + display: inline; + position: relative; + z-index: 9999; + margin: 0; + padding: 5px 3px; + font-size: 14px; + line-height: 20px; + font-weight: bold; + background-color: #fff; + float: left; + width: 182px; + text-align: center; + cursor: pointer; +} + +.xdsoft_datetimepicker .xdsoft_label:hover>span { + text-decoration: underline; +} + +.xdsoft_datetimepicker .xdsoft_label:hover i { + opacity: 1.0; +} + +.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select { + border: 1px solid #ccc; + position: absolute; + right: 0; + top: 30px; + z-index: 101; + display: none; + background: #fff; + max-height: 160px; + overflow-y: hidden; +} + +.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_monthselect{ right: -7px } +.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_yearselect{ right: 2px } +.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover { + color: #fff; + background: #ff8000; +} + +.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option { + padding: 2px 10px 2px 5px; + text-decoration: none !important; +} + +.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current { + background: #33aaff; + box-shadow: #178fe5 0 1px 3px 0 inset; + color: #fff; + font-weight: 700; +} + +.xdsoft_datetimepicker .xdsoft_month { + width: 100px; + text-align: right; +} + +.xdsoft_datetimepicker .xdsoft_calendar { + clear: both; +} + +.xdsoft_datetimepicker .xdsoft_year{ + width: 48px; + margin-left: 5px; +} + +.xdsoft_datetimepicker .xdsoft_calendar table { + border-collapse: collapse; + width: 100%; + +} + +.xdsoft_datetimepicker .xdsoft_calendar td > div { + padding-right: 5px; +} + +.xdsoft_datetimepicker .xdsoft_calendar th { + height: 25px; +} + +.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th { + width: 14.2857142%; + background: #f5f5f5; + border: 1px solid #ddd; + color: #666; + font-size: 12px; + text-align: right; + vertical-align: middle; + padding: 0; + border-collapse: collapse; + cursor: pointer; + height: 25px; +} +.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar th { + width: 12.5%; +} + +.xdsoft_datetimepicker .xdsoft_calendar th { + background: #f1f1f1; +} + +.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today { + color: #33aaff; +} + +.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_default { + background: #ffe9d2; + box-shadow: #ffb871 0 1px 4px 0 inset; + color: #000; +} +.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_mint { + background: #c1ffc9; + box-shadow: #00dd1c 0 1px 4px 0 inset; + color: #000; +} + +.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default, +.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current, +.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current { + background: #33aaff; + box-shadow: #178fe5 0 1px 3px 0 inset; + color: #fff; + font-weight: 700; +} + +.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month, +.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled, +.xdsoft_datetimepicker .xdsoft_time_box >div >div.xdsoft_disabled { + opacity: 0.5; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; + cursor: default; +} + +.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled { + opacity: 0.2; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)"; +} + +.xdsoft_datetimepicker .xdsoft_calendar td:hover, +.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div:hover { + color: #fff !important; + background: #ff8000 !important; + box-shadow: none !important; +} + +.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current.xdsoft_disabled:hover, +.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current.xdsoft_disabled:hover { + background: #33aaff !important; + box-shadow: #178fe5 0 1px 3px 0 inset !important; + color: #fff !important; +} + +.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover, +.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_disabled:hover { + color: inherit !important; + background: inherit !important; + box-shadow: inherit !important; +} + +.xdsoft_datetimepicker .xdsoft_calendar th { + font-weight: 700; + text-align: center; + color: #999; + cursor: default; +} + +.xdsoft_datetimepicker .xdsoft_copyright { + color: #ccc !important; + font-size: 10px; + clear: both; + float: none; + margin-left: 8px; +} + +.xdsoft_datetimepicker .xdsoft_copyright a { color: #eee !important } +.xdsoft_datetimepicker .xdsoft_copyright a:hover { color: #aaa !important } + +.xdsoft_time_box { + position: relative; + border: 1px solid #ccc; +} +.xdsoft_scrollbar >.xdsoft_scroller { + background: #ccc !important; + height: 20px; + border-radius: 3px; +} +.xdsoft_scrollbar { + position: absolute; + width: 7px; + right: 0; + top: 0; + bottom: 0; + cursor: pointer; +} +.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_scrollbar { + left: 0; + right: auto; +} +.xdsoft_scroller_box { + position: relative; +} + +.xdsoft_datetimepicker.xdsoft_dark { + box-shadow: 0 5px 15px -5px rgba(255, 255, 255, 0.506); + background: #000; + border-bottom: 1px solid #444; + border-left: 1px solid #333; + border-right: 1px solid #333; + border-top: 1px solid #333; + color: #ccc; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box { + border-bottom: 1px solid #222; +} +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div { + background: #0a0a0a; + border-top: 1px solid #222; + color: #999; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label { + background-color: #000; +} +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select { + border: 1px solid #333; + background: #000; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover { + color: #000; + background: #007fff; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current { + background: #cc5500; + box-shadow: #b03e00 0 1px 3px 0 inset; + color: #000; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label i, +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_prev, +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_next, +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_today_button { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUExQUUzOTA0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUExQUUzOTE0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQTFBRTM4RTQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQTFBRTM4RjQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp0VxGEAAAIASURBVHja7JrNSgMxEMebtgh+3MSLr1T1Xn2CHoSKB08+QmR8Bx9A8e7RixdB9CKCoNdexIugxFlJa7rNZneTbLIpM/CnNLsdMvNjM8l0mRCiQ9Ye61IKCAgZAUnH+mU3MMZaHYChBnJUDzWOFZdVfc5+ZFLbrWDeXPwbxIqrLLfaeS0hEBVGIRQCEiZoHQwtlGSByCCdYBl8g8egTTAWoKQMRBRBcZxYlhzhKegqMOageErsCHVkk3hXIFooDgHB1KkHIHVgzKB4ADJQ/A1jAFmAYhkQqA5TOBtocrKrgXwQA8gcFIuAIO8sQSA7hidvPwaQGZSaAYHOUWJABhWWw2EMIH9QagQERU4SArJXo0ZZL18uvaxejXt/Em8xjVBXmvFr1KVm/AJ10tRe2XnraNqaJvKE3KHuUbfK1E+VHB0q40/y3sdQSxY4FHWeKJCunP8UyDdqJZenT3ntVV5jIYCAh20vT7ioP8tpf6E2lfEMwERe+whV1MHjwZB7PBiCxcGQWwKZKD62lfGNnP/1poFAA60T7rF1UgcKd2id3KDeUS+oLWV8DfWAepOfq00CgQabi9zjcgJVYVD7PVzQUAUGAQkbNJTBICDhgwYTjDYD6XeW08ZKh+A4pYkzenOxXUbvZcWz7E8ykRMnIHGX1XPl+1m2vPYpL+2qdb8CDAARlKFEz/ZVkAAAAABJRU5ErkJggg==); +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td, +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th { + background: #0a0a0a; + border: 1px solid #222; + color: #999; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th { + background: #0e0e0e; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_today { + color: #cc5500; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_default { + background: #ffe9d2; + box-shadow: #ffb871 0 1px 4px 0 inset; + color:#000; +} +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_mint { + background: #c1ffc9; + box-shadow: #00dd1c 0 1px 4px 0 inset; + color:#000; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_default, +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_current, +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current { + background: #cc5500; + box-shadow: #b03e00 0 1px 3px 0 inset; + color: #000; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td:hover, +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div:hover { + color: #000 !important; + background: #007fff !important; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th { + color: #666; +} + +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright { color: #333 !important } +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a { color: #111 !important } +.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a:hover { color: #555 !important } + +.xdsoft_dark .xdsoft_time_box { + border: 1px solid #333; +} + +.xdsoft_dark .xdsoft_scrollbar >.xdsoft_scroller { + background: #333 !important; +} +.xdsoft_datetimepicker .xdsoft_save_selected { + display: block; + border: 1px solid #dddddd !important; + margin-top: 5px; + width: 100%; + color: #454551; + font-size: 13px; +} +.xdsoft_datetimepicker .blue-gradient-button { + font-family: "museo-sans", "Book Antiqua", sans-serif; + font-size: 12px; + font-weight: 300; + color: #82878c; + height: 28px; + position: relative; + padding: 4px 17px 4px 33px; + border: 1px solid #d7d8da; + background: -moz-linear-gradient(top, #fff 0%, #f4f8fa 73%); + /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(73%, #f4f8fa)); + /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #fff 0%, #f4f8fa 73%); + /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #fff 0%, #f4f8fa 73%); + /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #fff 0%, #f4f8fa 73%); + /* IE10+ */ + background: linear-gradient(to bottom, #fff 0%, #f4f8fa 73%); + /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fff', endColorstr='#f4f8fa',GradientType=0 ); +/* IE6-9 */ +} +.xdsoft_datetimepicker .blue-gradient-button:hover, .xdsoft_datetimepicker .blue-gradient-button:focus, .xdsoft_datetimepicker .blue-gradient-button:hover span, .xdsoft_datetimepicker .blue-gradient-button:focus span { + color: #454551; + background: -moz-linear-gradient(top, #f4f8fa 0%, #FFF 73%); + /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4f8fa), color-stop(73%, #FFF)); + /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #f4f8fa 0%, #FFF 73%); + /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #f4f8fa 0%, #FFF 73%); + /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #f4f8fa 0%, #FFF 73%); + /* IE10+ */ + background: linear-gradient(to bottom, #f4f8fa 0%, #FFF 73%); + /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f8fa', endColorstr='#FFF',GradientType=0 ); + /* IE6-9 */ +} diff --git a/plugins/datetimepicker-master/jquery.datetimepicker.js b/plugins/datetimepicker-master/jquery.datetimepicker.js new file mode 100644 index 0000000..89fdfff --- /dev/null +++ b/plugins/datetimepicker-master/jquery.datetimepicker.js @@ -0,0 +1,2718 @@ +/** + * @preserve jQuery DateTimePicker + * @homepage http://xdsoft.net/jqplugins/datetimepicker/ + * @author Chupurnov Valeriy () + */ + +/** + * @param {jQuery} $ + */ +var datetimepickerFactory = function ($) { + 'use strict'; + + var default_options = { + i18n: { + ar: { // Arabic + months: [ + "كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول" + ], + dayOfWeekShort: [ + "Ù†", "Ø«", "ع", "Ø®", "ج", "س", "Ø­" + ], + dayOfWeek: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت", "الأحد"] + }, + ro: { // Romanian + months: [ + "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie" + ], + dayOfWeekShort: [ + "Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ" + ], + dayOfWeek: ["Duminică", "Luni", "MarÅ£i", "Miercuri", "Joi", "Vineri", "Sâmbătă"] + }, + id: { // Indonesian + months: [ + "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember" + ], + dayOfWeekShort: [ + "Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab" + ], + dayOfWeek: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"] + }, + is: { // Icelandic + months: [ + "Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ãgúst", "September", "Október", "Nóvember", "Desember" + ], + dayOfWeekShort: [ + "Sun", "Mán", "Þrið", "Mið", "Fim", "Fös", "Lau" + ], + dayOfWeek: ["Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur"] + }, + bg: { // Bulgarian + months: [ + "Януари", "Февруари", "Март", "Ðприл", "Май", "Юни", "Юли", "ÐвгуÑÑ‚", "Септември", "Октомври", "Ðоември", "Декември" + ], + dayOfWeekShort: [ + "Ðд", "Пн", "Ð’Ñ‚", "Ср", "Чт", "Пт", "Сб" + ], + dayOfWeek: ["ÐеделÑ", "Понеделник", "Вторник", "СрÑда", "Четвъртък", "Петък", "Събота"] + }, + fa: { // Persian/Farsi + months: [ + 'ÙØ±ÙˆØ±Ø¯ÛŒÙ†', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسÙند' + ], + dayOfWeekShort: [ + 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه' + ], + dayOfWeek: ["یک‌شنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنج‌شنبه", "جمعه", "شنبه", "یک‌شنبه"] + }, + ru: { // Russian + months: [ + 'Январь', 'Февраль', 'Март', 'Ðпрель', 'Май', 'Июнь', 'Июль', 'ÐвгуÑÑ‚', 'СентÑбрь', 'ОктÑбрь', 'ÐоÑбрь', 'Декабрь' + ], + dayOfWeekShort: [ + "Ð’Ñ", "Пн", "Ð’Ñ‚", "Ср", "Чт", "Пт", "Сб" + ], + dayOfWeek: ["ВоÑкреÑенье", "Понедельник", "Вторник", "Среда", "Четверг", "ПÑтница", "Суббота"] + }, + uk: { // Ukrainian + months: [ + 'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'ВереÑень', 'Жовтень', 'ЛиÑтопад', 'Грудень' + ], + dayOfWeekShort: [ + "Ðд", "Пн", "Ð’Ñ‚", "Ср", "Чт", "Пт", "Сб" + ], + dayOfWeek: ["ÐеділÑ", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ÑтницÑ", "Субота"] + }, + en: { // English + months: [ + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + ], + dayOfWeekShort: [ + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + ], + dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + }, + el: { // Ελληνικά + months: [ + "ΙανουάÏιος", "ΦεβÏουάÏιος", "ΜάÏτιος", "ΑπÏίλιος", "Μάιος", "ΙοÏνιος", "ΙοÏλιος", "ΑÏγουστος", "ΣεπτέμβÏιος", "ΟκτώβÏιος", "ÎοέμβÏιος", "ΔεκέμβÏιος" + ], + dayOfWeekShort: [ + "ΚυÏ", "Δευ", "ΤÏι", "Τετ", "Πεμ", "ΠαÏ", "Σαβ" + ], + dayOfWeek: ["ΚυÏιακή", "ΔευτέÏα", "ΤÏίτη", "ΤετάÏτη", "Πέμπτη", "ΠαÏασκευή", "Σάββατο"] + }, + de: { // German + months: [ + 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' + ], + dayOfWeekShort: [ + "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" + ], + dayOfWeek: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"] + }, + nl: { // Dutch + months: [ + "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december" + ], + dayOfWeekShort: [ + "zo", "ma", "di", "wo", "do", "vr", "za" + ], + dayOfWeek: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"] + }, + tr: { // Turkish + months: [ + "Ocak", "Åžubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "AÄŸustos", "Eylül", "Ekim", "Kasım", "Aralık" + ], + dayOfWeekShort: [ + "Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts" + ], + dayOfWeek: ["Pazar", "Pazartesi", "Salı", "ÇarÅŸamba", "PerÅŸembe", "Cuma", "Cumartesi"] + }, + fr: { //French + months: [ + "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" + ], + dayOfWeekShort: [ + "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" + ], + dayOfWeek: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"] + }, + es: { // Spanish + months: [ + "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" + ], + dayOfWeekShort: [ + "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb" + ], + dayOfWeek: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"] + }, + th: { // Thai + months: [ + 'มà¸à¸£à¸²à¸„ม', 'à¸à¸¸à¸¡à¸ à¸²à¸žà¸±à¸™à¸˜à¹Œ', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'à¸à¸£à¸à¸Žà¸²à¸„ม', 'สิงหาคม', 'à¸à¸±à¸™à¸¢à¸²à¸¢à¸™', 'ตุลาคม', 'พฤศจิà¸à¸²à¸¢à¸™', 'ธันวาคม' + ], + dayOfWeekShort: [ + 'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.' + ], + dayOfWeek: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุà¸à¸£à¹Œ", "เสาร์", "อาทิตย์"] + }, + pl: { // Polish + months: [ + "styczeÅ„", "luty", "marzec", "kwiecieÅ„", "maj", "czerwiec", "lipiec", "sierpieÅ„", "wrzesieÅ„", "październik", "listopad", "grudzieÅ„" + ], + dayOfWeekShort: [ + "nd", "pn", "wt", "Å›r", "cz", "pt", "sb" + ], + dayOfWeek: ["niedziela", "poniedziaÅ‚ek", "wtorek", "Å›roda", "czwartek", "piÄ…tek", "sobota"] + }, + pt: { // Portuguese + months: [ + "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" + ], + dayOfWeekShort: [ + "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" + ], + dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] + }, + ch: { // Simplified Chinese + months: [ + "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "乿œˆ", "åæœˆ", "å一月", "å二月" + ], + dayOfWeekShort: [ + "æ—¥", "一", "二", "三", "å››", "五", "å…­" + ] + }, + se: { // Swedish + months: [ + "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" + ], + dayOfWeekShort: [ + "Sön", "MÃ¥n", "Tis", "Ons", "Tor", "Fre", "Lör" + ] + }, + km: { // Khmer (ភាសាážáŸ’មែរ) + months: [ + "មករា​", "កុម្ភៈ", "មិនា​", "មáŸážŸáž¶â€‹", "ឧសភា​", "មិážáž»áž“ា​", "កក្កដា​", "សីហា​", "កញ្ញា​", "ážáž»áž›áž¶â€‹", "វិច្ឆិកា", "ធ្នូ​" + ], + dayOfWeekShort: ["អាទិ​", "áž…áŸáž“្ទ​", "អង្គារ​", "ពុធ​", "ព្រហ​​", "សុក្រ​", "សៅរáŸ"], + dayOfWeek: ["អាទិážáŸ’យ​", "áž…áŸáž“្ទ​", "អង្គារ​", "ពុធ​", "ព្រហស្បážáž·áŸâ€‹", "សុក្រ​", "សៅរáŸ"] + }, + kr: { // Korean + months: [ + "1ì›”", "2ì›”", "3ì›”", "4ì›”", "5ì›”", "6ì›”", "7ì›”", "8ì›”", "9ì›”", "10ì›”", "11ì›”", "12ì›”" + ], + dayOfWeekShort: [ + "ì¼", "ì›”", "í™”", "수", "목", "금", "토" + ], + dayOfWeek: ["ì¼ìš”ì¼", "월요ì¼", "화요ì¼", "수요ì¼", "목요ì¼", "금요ì¼", "토요ì¼"] + }, + it: { // Italian + months: [ + "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" + ], + dayOfWeekShort: [ + "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" + ], + dayOfWeek: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] + }, + da: { // Dansk + months: [ + "Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December" + ], + dayOfWeekShort: [ + "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" + ], + dayOfWeek: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"] + }, + no: { // Norwegian + months: [ + "Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember" + ], + dayOfWeekShort: [ + "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" + ], + dayOfWeek: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag'] + }, + ja: { // Japanese + months: [ + "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月" + ], + dayOfWeekShort: [ + "æ—¥", "月", "ç«", "æ°´", "木", "金", "土" + ], + dayOfWeek: ["日曜", "月曜", "ç«æ›œ", "水曜", "木曜", "金曜", "土曜"] + }, + vi: { // Vietnamese + months: [ + "Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12" + ], + dayOfWeekShort: [ + "CN", "T2", "T3", "T4", "T5", "T6", "T7" + ], + dayOfWeek: ["Chá»§ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy"] + }, + sl: { // SlovenÅ¡Äina + months: [ + "Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December" + ], + dayOfWeekShort: [ + "Ned", "Pon", "Tor", "Sre", "ÄŒet", "Pet", "Sob" + ], + dayOfWeek: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "ÄŒetrtek", "Petek", "Sobota"] + }, + cs: { // ÄŒeÅ¡tina + months: [ + "Leden", "Únor", "BÅ™ezen", "Duben", "KvÄ›ten", "ÄŒerven", "ÄŒervenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec" + ], + dayOfWeekShort: [ + "Ne", "Po", "Út", "St", "ÄŒt", "Pá", "So" + ] + }, + hu: { // Hungarian + months: [ + "Január", "Február", "Március", "Ãprilis", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December" + ], + dayOfWeekShort: [ + "Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo" + ], + dayOfWeek: ["vasárnap", "hétfÅ‘", "kedd", "szerda", "csütörtök", "péntek", "szombat"] + }, + az: { //Azerbaijanian (Azeri) + months: [ + "Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr" + ], + dayOfWeekShort: [ + "B", "Be", "Ça", "Ç", "Ca", "C", "Åž" + ], + dayOfWeek: ["Bazar", "Bazar ertÉ™si", "ÇərÅŸÉ™nbÉ™ axÅŸamı", "ÇərÅŸÉ™nbÉ™", "CümÉ™ axÅŸamı", "CümÉ™", "ŞənbÉ™"] + }, + bs: { //Bosanski + months: [ + "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" + ], + dayOfWeekShort: [ + "Ned", "Pon", "Uto", "Sri", "ÄŒet", "Pet", "Sub" + ], + dayOfWeek: ["Nedjelja","Ponedjeljak", "Utorak", "Srijeda", "ÄŒetvrtak", "Petak", "Subota"] + }, + ca: { //Català + months: [ + "Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre" + ], + dayOfWeekShort: [ + "Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds" + ], + dayOfWeek: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"] + }, + 'en-GB': { //English (British) + months: [ + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + ], + dayOfWeekShort: [ + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + ], + dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + }, + et: { //"Eesti" + months: [ + "Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember" + ], + dayOfWeekShort: [ + "P", "E", "T", "K", "N", "R", "L" + ], + dayOfWeek: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev"] + }, + eu: { //Euskara + months: [ + "Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua" + ], + dayOfWeekShort: [ + "Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La." + ], + dayOfWeek: ['Igandea', 'Astelehena', 'Asteartea', 'Asteazkena', 'Osteguna', 'Ostirala', 'Larunbata'] + }, + fi: { //Finnish (Suomi) + months: [ + "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu" + ], + dayOfWeekShort: [ + "Su", "Ma", "Ti", "Ke", "To", "Pe", "La" + ], + dayOfWeek: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"] + }, + gl: { //Galego + months: [ + "Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec" + ], + dayOfWeekShort: [ + "Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab" + ], + dayOfWeek: ["Domingo", "Luns", "Martes", "Mércores", "Xoves", "Venres", "Sábado"] + }, + hr: { //Hrvatski + months: [ + "SijeÄanj", "VeljaÄa", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac" + ], + dayOfWeekShort: [ + "Ned", "Pon", "Uto", "Sri", "ÄŒet", "Pet", "Sub" + ], + dayOfWeek: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "ÄŒetvrtak", "Petak", "Subota"] + }, + ko: { //Korean (한국어) + months: [ + "1ì›”", "2ì›”", "3ì›”", "4ì›”", "5ì›”", "6ì›”", "7ì›”", "8ì›”", "9ì›”", "10ì›”", "11ì›”", "12ì›”" + ], + dayOfWeekShort: [ + "ì¼", "ì›”", "í™”", "수", "목", "금", "토" + ], + dayOfWeek: ["ì¼ìš”ì¼", "월요ì¼", "화요ì¼", "수요ì¼", "목요ì¼", "금요ì¼", "토요ì¼"] + }, + lt: { //Lithuanian (lietuvių) + months: [ + "Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "RugpjÅ«Äio", "RugsÄ—jo", "Spalio", "LapkriÄio", "Gruodžio" + ], + dayOfWeekShort: [ + "Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Å eÅ¡" + ], + dayOfWeek: ["Sekmadienis", "Pirmadienis", "Antradienis", "TreÄiadienis", "Ketvirtadienis", "Penktadienis", "Å eÅ¡tadienis"] + }, + lv: { //Latvian (LatvieÅ¡u) + months: [ + "JanvÄris", "FebruÄris", "Marts", "AprÄ«lis ", "Maijs", "JÅ«nijs", "JÅ«lijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris" + ], + dayOfWeekShort: [ + "Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St" + ], + dayOfWeek: ["SvÄ“tdiena", "Pirmdiena", "Otrdiena", "TreÅ¡diena", "Ceturtdiena", "Piektdiena", "Sestdiena"] + }, + mk: { //Macedonian (МакедонÑки) + months: [ + "јануари", "февруари", "март", "април", "мај", "јуни", "јули", "авгуÑÑ‚", "Ñептември", "октомври", "ноември", "декември" + ], + dayOfWeekShort: [ + "нед", "пон", "вто", "Ñре", "чет", "пет", "Ñаб" + ], + dayOfWeek: ["Ðедела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота"] + }, + mn: { //Mongolian (Монгол) + months: [ + "1-Ñ€ Ñар", "2-Ñ€ Ñар", "3-Ñ€ Ñар", "4-Ñ€ Ñар", "5-Ñ€ Ñар", "6-Ñ€ Ñар", "7-Ñ€ Ñар", "8-Ñ€ Ñар", "9-Ñ€ Ñар", "10-Ñ€ Ñар", "11-Ñ€ Ñар", "12-Ñ€ Ñар" + ], + dayOfWeekShort: [ + "Дав", "МÑг", "Лха", "Пүр", "БÑн", "БÑм", "ÐÑм" + ], + dayOfWeek: ["Даваа", "МÑгмар", "Лхагва", "ПүрÑв", "БааÑан", "БÑмба", "ÐÑм"] + }, + 'pt-BR': { //Português(Brasil) + months: [ + "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" + ], + dayOfWeekShort: [ + "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb" + ], + dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] + }, + sk: { //SlovenÄina + months: [ + "Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December" + ], + dayOfWeekShort: [ + "Ne", "Po", "Ut", "St", "Å t", "Pi", "So" + ], + dayOfWeek: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Å tvrtok", "Piatok", "Sobota"] + }, + sq: { //Albanian (Shqip) + months: [ + "Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor" + ], + dayOfWeekShort: [ + "Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Shtu" + ], + dayOfWeek: ["E Diel", "E Hënë", "E MartÄ“", "E Mërkurë", "E Enjte", "E Premte", "E Shtunë"] + }, + 'sr-YU': { //Serbian (Srpski) + months: [ + "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" + ], + dayOfWeekShort: [ + "Ned", "Pon", "Uto", "Sre", "Äet", "Pet", "Sub" + ], + dayOfWeek: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "ÄŒetvrtak", "Petak", "Subota"] + }, + sr: { //Serbian Cyrillic (СрпÑки) + months: [ + "јануар", "фебруар", "март", "април", "мај", "јун", "јул", "авгуÑÑ‚", "Ñептембар", "октобар", "новембар", "децембар" + ], + dayOfWeekShort: [ + "нед", "пон", "уто", "Ñре", "чет", "пет", "Ñуб" + ], + dayOfWeek: ["Ðедеља","Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота"] + }, + sv: { //Svenska + months: [ + "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" + ], + dayOfWeekShort: [ + "Sön", "MÃ¥n", "Tis", "Ons", "Tor", "Fre", "Lör" + ], + dayOfWeek: ["Söndag", "MÃ¥ndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"] + }, + 'zh-TW': { //Traditional Chinese (ç¹é«”中文) + months: [ + "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "乿œˆ", "åæœˆ", "å一月", "å二月" + ], + dayOfWeekShort: [ + "æ—¥", "一", "二", "三", "å››", "五", "å…­" + ], + dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] + }, + zh: { //Simplified Chinese (简体中文) + months: [ + "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "乿œˆ", "åæœˆ", "å一月", "å二月" + ], + dayOfWeekShort: [ + "æ—¥", "一", "二", "三", "å››", "五", "å…­" + ], + dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] + }, + ug:{ // Uyghur(ئۇيغۇرچە) + months: [ + "1-ئاي","2-ئاي","3-ئاي","4-ئاي","5-ئاي","6-ئاي","7-ئاي","8-ئاي","9-ئاي","10-ئاي","11-ئاي","12-ئاي" + ], + dayOfWeek: [ + "يەكشەنبە", "دۈشەنبە","سەيشەنبە","چارشەنبە","پەيشەنبە","جۈمە","شەنبە" + ] + }, + he: { //Hebrew (עברית) + months: [ + 'ינו×ר', 'פברו×ר', 'מרץ', '×פריל', 'מ××™', 'יוני', 'יולי', '×וגוסט', 'ספטמבר', '×וקטובר', 'נובמבר', 'דצמבר' + ], + dayOfWeekShort: [ + '×\'', 'ב\'', '×’\'', 'ד\'', '×”\'', 'ו\'', 'שבת' + ], + dayOfWeek: ["ר×שון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ר×שון"] + }, + hy: { // Armenian + months: [ + "Õ€Õ¸Ö‚Õ¶Õ¾Õ¡Ö€", "Õ“Õ¥Õ¿Ö€Õ¾Õ¡Ö€", "Õ„Õ¡Ö€Õ¿", "Ô±ÕºÖ€Õ«Õ¬", "Õ„Õ¡ÕµÕ«Õ½", "Õ€Õ¸Ö‚Õ¶Õ«Õ½", "Õ€Õ¸Ö‚Õ¬Õ«Õ½", "Õ•Õ£Õ¸Õ½Õ¿Õ¸Õ½", "ÕÕ¥ÕºÕ¿Õ¥Õ´Õ¢Õ¥Ö€", "Õ€Õ¸Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€", "Õ†Õ¸ÕµÕ¥Õ´Õ¢Õ¥Ö€", "Ô´Õ¥Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€" + ], + dayOfWeekShort: [ + "Ô¿Õ«", "ÔµÖ€Õ¯", "ÔµÖ€Ö„", "Õ‰Õ¸Ö€", "Õ€Õ¶Õ£", "ÕˆÖ‚Ö€Õ¢", "Õ‡Õ¢Õ©" + ], + dayOfWeek: ["Ô¿Õ«Ö€Õ¡Õ¯Õ«", "ÔµÖ€Õ¯Õ¸Ö‚Õ·Õ¡Õ¢Õ©Õ«", "ÔµÖ€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«", "Õ‰Õ¸Ö€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«", "Õ€Õ«Õ¶Õ£Õ·Õ¡Õ¢Õ©Õ«", "ÕˆÖ‚Ö€Õ¢Õ¡Õ©", "Õ‡Õ¡Õ¢Õ¡Õ©"] + }, + kg: { // Kyrgyz + months: [ + 'Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'ÐÑк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы' + ], + dayOfWeekShort: [ + "Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише" + ], + dayOfWeek: [ + "Жекшемб", "Дүйшөмб", "Шейшемб", "Шаршемб", "Бейшемби", "Жума", "Ишенб" + ] + }, + rm: { // Romansh + months: [ + "Schaner", "Favrer", "Mars", "Avrigl", "Matg", "Zercladur", "Fanadur", "Avust", "Settember", "October", "November", "December" + ], + dayOfWeekShort: [ + "Du", "Gli", "Ma", "Me", "Gie", "Ve", "So" + ], + dayOfWeek: [ + "Dumengia", "Glindesdi", "Mardi", "Mesemna", "Gievgia", "Venderdi", "Sonda" + ] + }, + ka: { // Georgian + months: [ + 'იáƒáƒœáƒ•áƒáƒ áƒ˜', 'თებერვáƒáƒšáƒ˜', 'მáƒáƒ áƒ¢áƒ˜', 'áƒáƒžáƒ áƒ˜áƒšáƒ˜', 'მáƒáƒ˜áƒ¡áƒ˜', 'ივნისი', 'ივლისი', 'áƒáƒ’ვისტáƒ', 'სექტემბერი', 'áƒáƒ¥áƒ¢áƒáƒ›áƒ‘ერი', 'ნáƒáƒ”მბერი', 'დეკემბერი' + ], + dayOfWeekShort: [ + "კვ", "áƒáƒ áƒ¨", "სáƒáƒ›áƒ¨", "áƒáƒ—ხ", "ხუთ", "პáƒáƒ ", "შáƒáƒ‘" + ], + dayOfWeek: ["კვირáƒ", "áƒáƒ áƒ¨áƒáƒ‘áƒáƒ—ი", "სáƒáƒ›áƒ¨áƒáƒ‘áƒáƒ—ი", "áƒáƒ—ხშáƒáƒ‘áƒáƒ—ი", "ხუთშáƒáƒ‘áƒáƒ—ი", "პáƒáƒ áƒáƒ¡áƒ™áƒ”ვი", "შáƒáƒ‘áƒáƒ—ი"] + }, + kk: { // Kazakh + months: [ + 'Қаңтар', 'Ðқпан', 'Ðаурыз', 'Сәуір', 'Мамыр', 'МауÑым', 'Шілде', 'Тамыз', 'Қыркүйек', 'Қазан', 'Қараша', 'ЖелтоқÑан' + ], + dayOfWeekShort: [ + "Жк", "ДÑ", "СÑ", "Ср", "БÑ", "Жм", "Сб" + ], + dayOfWeek: ["ЖекÑенбі", "ДүйÑенбі", "СейÑенбі", "СәрÑенбі", "БейÑенбі", "Жұма", "Сенбі"] + } + }, + + ownerDocument: document, + contentWindow: window, + + value: '', + rtl: false, + + format: 'Y/m/d H:i', + formatTime: 'H:i', + formatDate: 'Y/m/d', + + startDate: false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05', + step: 60, + monthChangeSpinner: true, + + closeOnDateSelect: false, + closeOnTimeSelect: true, + closeOnWithoutClick: true, + closeOnInputClick: true, + openOnFocus: true, + + timepicker: true, + datepicker: true, + weeks: false, + + defaultTime: false, // use formatTime format (ex. '10:00' for formatTime: 'H:i') + defaultDate: false, // use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05') + + minDate: false, + maxDate: false, + minTime: false, + maxTime: false, + minDateTime: false, + maxDateTime: false, + + allowTimes: [], + opened: false, + initTime: true, + inline: false, + theme: '', + touchMovedThreshold: 5, + + onSelectDate: function () {}, + onSelectTime: function () {}, + onChangeMonth: function () {}, + onGetWeekOfYear: function () {}, + onChangeYear: function () {}, + onChangeDateTime: function () {}, + onShow: function () {}, + onClose: function () {}, + onGenerate: function () {}, + + withoutCopyright: true, + inverseButton: false, + hours12: false, + next: 'xdsoft_next', + prev : 'xdsoft_prev', + dayOfWeekStart: 0, + parentID: 'body', + timeHeightInTimePicker: 25, + timepickerScrollbar: true, + todayButton: true, + prevButton: true, + nextButton: true, + defaultSelect: true, + + scrollMonth: true, + scrollTime: true, + scrollInput: true, + + lazyInit: false, + mask: false, + validateOnBlur: true, + allowBlank: true, + yearStart: 1950, + yearEnd: 2050, + monthStart: 0, + monthEnd: 11, + style: '', + id: '', + fixed: false, + roundTime: 'round', // ceil, floor + className: '', + weekends: [], + highlightedDates: [], + highlightedPeriods: [], + allowDates : [], + allowDateRe : null, + disabledDates : [], + disabledWeekDays: [], + yearOffset: 0, + beforeShowDay: null, + + enterLikeTab: true, + showApplyButton: false, + insideParent: false, + }; + + var dateHelper = null, + defaultDateHelper = null, + globalLocaleDefault = 'en', + globalLocale = 'en'; + + var dateFormatterOptionsDefault = { + meridiem: ['AM', 'PM'] + }; + + var initDateFormatter = function(){ + var locale = default_options.i18n[globalLocale], + opts = { + days: locale.dayOfWeek, + daysShort: locale.dayOfWeekShort, + months: locale.months, + monthsShort: $.map(locale.months, function(n){ return n.substring(0, 3) }) + }; + + if (typeof DateFormatter === 'function') { + dateHelper = defaultDateHelper = new DateFormatter({ + dateSettings: $.extend({}, dateFormatterOptionsDefault, opts) + }); + } + }; + + var dateFormatters = { + moment: { + default_options:{ + format: 'YYYY/MM/DD HH:mm', + formatDate: 'YYYY/MM/DD', + formatTime: 'HH:mm', + }, + formatter: { + parseDate: function (date, format) { + if(isFormatStandard(format)){ + return defaultDateHelper.parseDate(date, format); + } + var d = moment(date, format); + return d.isValid() ? d.toDate() : false; + }, + + formatDate: function (date, format) { + if(isFormatStandard(format)){ + return defaultDateHelper.formatDate(date, format); + } + return moment(date).format(format); + }, + + formatMask: function(format){ + return format + .replace(/Y{4}/g, '9999') + .replace(/Y{2}/g, '99') + .replace(/M{2}/g, '19') + .replace(/D{2}/g, '39') + .replace(/H{2}/g, '29') + .replace(/m{2}/g, '59') + .replace(/s{2}/g, '59'); + }, + } + } + } + + // for locale settings + $.datetimepicker = { + setLocale: function(locale){ + var newLocale = default_options.i18n[locale] ? locale : globalLocaleDefault; + if (globalLocale !== newLocale) { + globalLocale = newLocale; + // reinit date formatter + initDateFormatter(); + } + }, + + setDateFormatter: function(dateFormatter) { + if(typeof dateFormatter === 'string' && dateFormatters.hasOwnProperty(dateFormatter)){ + var df = dateFormatters[dateFormatter]; + $.extend(default_options, df.default_options); + dateHelper = df.formatter; + } + else { + dateHelper = dateFormatter; + } + }, + }; + + var standardFormats = { + RFC_2822: 'D, d M Y H:i:s O', + ATOM: 'Y-m-d\TH:i:sP', + ISO_8601: 'Y-m-d\TH:i:sO', + RFC_822: 'D, d M y H:i:s O', + RFC_850: 'l, d-M-y H:i:s T', + RFC_1036: 'D, d M y H:i:s O', + RFC_1123: 'D, d M Y H:i:s O', + RSS: 'D, d M Y H:i:s O', + W3C: 'Y-m-d\TH:i:sP' + } + + var isFormatStandard = function(format){ + return Object.values(standardFormats).indexOf(format) === -1 ? false : true; + } + + $.extend($.datetimepicker, standardFormats); + + // first init date formatter + initDateFormatter(); + + // fix for ie8 + if (!window.getComputedStyle) { + window.getComputedStyle = function (el) { + this.el = el; + this.getPropertyValue = function (prop) { + var re = /(-([a-z]))/g; + if (prop === 'float') { + prop = 'styleFloat'; + } + if (re.test(prop)) { + prop = prop.replace(re, function (a, b, c) { + return c.toUpperCase(); + }); + } + return el.currentStyle[prop] || null; + }; + return this; + }; + } + if (!Array.prototype.indexOf) { + Array.prototype.indexOf = function (obj, start) { + var i, j; + for (i = (start || 0), j = this.length; i < j; i += 1) { + if (this[i] === obj) { return i; } + } + return -1; + }; + } + + Date.prototype.countDaysInMonth = function () { + return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate(); + }; + + $.fn.xdsoftScroller = function (options, percent) { + return this.each(function () { + var timeboxparent = $(this), + pointerEventToXY = function (e) { + var out = {x: 0, y: 0}, + touch; + if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') { + touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; + out.x = touch.clientX; + out.y = touch.clientY; + } else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') { + out.x = e.clientX; + out.y = e.clientY; + } + return out; + }, + getWheelDelta = function (e) { + var deltaY = 0; + + if ('detail' in e) { deltaY = e.detail; } + if ('wheelDelta' in e) { deltaY = -e.wheelDelta / 120; } + if ('wheelDeltaY' in e) { deltaY = -e.wheelDeltaY / 120; } + if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) { deltaY = 0; } + + deltaY *= 10; + + if ('deltaY' in e) { deltaY = -e.deltaY; } + + if (deltaY && e.deltaMode) { + if (e.deltaMode === 1) { + deltaY *= 40; + } else { + deltaY *= 800; + } + } + + return deltaY; + }, + timebox, + timeboxTop = 0, + parentHeight, + height, + scrollbar, + scroller, + maximumOffset = 100, + start = false, + startY = 0, + startTop = 0, + h1 = 0, + touchStart = false, + startTopScroll = 0, + calcOffset = function () {}; + + if (percent === 'hide') { + timeboxparent.find('.xdsoft_scrollbar').hide(); + return; + } + + if (!$(this).hasClass('xdsoft_scroller_box')) { + timebox = timeboxparent.children().eq(0); + timeboxTop = Math.abs(parseInt(timebox.css('marginTop'), 10)); + parentHeight = timeboxparent[0].clientHeight; + height = timebox[0].offsetHeight; + scrollbar = $('
    '); + scroller = $('
    '); + scrollbar.append(scroller); + + timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar); + calcOffset = function calcOffset(event) { + var offset = pointerEventToXY(event).y - startY + startTopScroll; + if (offset < 0) { + offset = 0; + } + if (offset + scroller[0].offsetHeight > h1) { + offset = h1 - scroller[0].offsetHeight; + } + timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]); + }; + + scroller + .on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) { + if (!parentHeight) { + timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); + } + + startY = pointerEventToXY(event).y; + startTopScroll = parseInt(scroller.css('marginTop'), 10); + h1 = scrollbar[0].offsetHeight; + + if (event.type === 'mousedown' || event.type === 'touchstart') { + if (options.ownerDocument) { + $(options.ownerDocument.body).addClass('xdsoft_noselect'); + } + $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft_scroller', function arguments_callee() { + $([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft_scroller', arguments_callee) + .off('mousemove.xdsoft_scroller', calcOffset) + .removeClass('xdsoft_noselect'); + }); + $(options.ownerDocument.body).on('mousemove.xdsoft_scroller', calcOffset); + } else { + touchStart = true; + event.stopPropagation(); + event.preventDefault(); + } + }) + .on('touchmove', function (event) { + if (touchStart) { + event.preventDefault(); + calcOffset(event); + } + }) + .on('touchend touchcancel', function () { + touchStart = false; + startTopScroll = 0; + }); + + timeboxparent + .on('scroll_element.xdsoft_scroller', function (event, percentage) { + if (!parentHeight) { + timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]); + } + percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage; + timeboxTop = parseFloat(Math.abs((timebox[0].offsetHeight - parentHeight) * percentage).toFixed(4)); + + scroller.css('marginTop', maximumOffset * percentage); + timebox.css('marginTop', -timeboxTop); + }) + .on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) { + var percent, sh; + parentHeight = timeboxparent[0].clientHeight; + height = timebox[0].offsetHeight; + percent = parentHeight / height; + sh = percent * scrollbar[0].offsetHeight; + if (percent > 1) { + scroller.hide(); + } else { + scroller.show(); + scroller.css('height', parseInt(sh > 10 ? sh : 10, 10)); + maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight; + if (noTriggerScroll !== true) { + timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || timeboxTop / (height - parentHeight)]); + } + } + }); + + timeboxparent.on('mousewheel', function (event) { + var deltaY = getWheelDelta(event.originalEvent); + var top = Math.max(0, timeboxTop - deltaY); + timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]); + event.stopPropagation(); + return false; + }); + + timeboxparent.on('touchstart', function (event) { + start = pointerEventToXY(event); + startTop = timeboxTop; + }); + + timeboxparent.on('touchmove', function (event) { + if (start) { + event.preventDefault(); + var coord = pointerEventToXY(event); + timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]); + } + }); + + timeboxparent.on('touchend touchcancel', function () { + start = false; + startTop = 0; + }); + } + timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); + }); + }; + + $.fn.datetimepicker = function (opt, opt2) { + var result = this, + KEY0 = 48, + KEY9 = 57, + _KEY0 = 96, + _KEY9 = 105, + CTRLKEY = 17, + CMDKEY = 91, + DEL = 46, + ENTER = 13, + ESC = 27, + BACKSPACE = 8, + ARROWLEFT = 37, + ARROWUP = 38, + ARROWRIGHT = 39, + ARROWDOWN = 40, + TAB = 9, + F5 = 116, + AKEY = 65, + CKEY = 67, + VKEY = 86, + ZKEY = 90, + YKEY = 89, + ctrlDown = false, + cmdDown = false, + options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options), + + lazyInitTimer = 0, + createDateTimePicker, + destroyDateTimePicker, + + lazyInit = function (input) { + input + .on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function initOnActionCallback() { + if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) { + return; + } + clearTimeout(lazyInitTimer); + lazyInitTimer = setTimeout(function () { + + if (!input.data('xdsoft_datetimepicker')) { + createDateTimePicker(input); + } + input + .off('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', initOnActionCallback) + .trigger('open.xdsoft'); + }, 100); + }); + }; + + createDateTimePicker = function (input) { + var datetimepicker = $('
    '), + xdsoft_copyright = $(''), + datepicker = $('
    '), + month_picker = $('
    ' + + '
    ' + + '
    ' + + '
    '), + calendar = $('
    '), + timepicker = $('
    '), + timeboxparent = timepicker.find('.xdsoft_time_box').eq(0), + timebox = $('
    '), + applyButton = $(''), + + monthselect = $('
    '), + yearselect = $('
    '), + triggerAfterOpen = false, + XDSoft_datetime, + + xchangeTimer, + timerclick, + current_time_index, + setPos, + timer = 0, + _xdsoft_datetime, + forEachAncestorOf; + + if (options.id) { + datetimepicker.attr('id', options.id); + } + if (options.style) { + datetimepicker.attr('style', options.style); + } + if (options.weeks) { + datetimepicker.addClass('xdsoft_showweeks'); + } + if (options.rtl) { + datetimepicker.addClass('xdsoft_rtl'); + } + + datetimepicker.addClass('xdsoft_' + options.theme); + datetimepicker.addClass(options.className); + + month_picker + .find('.xdsoft_month span') + .after(monthselect); + month_picker + .find('.xdsoft_year span') + .after(yearselect); + + month_picker + .find('.xdsoft_month,.xdsoft_year') + .on('touchstart mousedown.xdsoft', function (event) { + var select = $(this).find('.xdsoft_select').eq(0), + val = 0, + top = 0, + visible = select.is(':visible'), + items, + i; + + month_picker + .find('.xdsoft_select') + .hide(); + if (_xdsoft_datetime.currentTime) { + val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear'](); + } + + select[visible ? 'hide' : 'show'](); + for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) { + if (items.eq(i).data('value') === val) { + break; + } else { + top += items[0].offsetHeight; + } + } + + select.xdsoftScroller(options, top / (select.children()[0].offsetHeight - (select[0].clientHeight))); + event.stopPropagation(); + return false; + }); + + var handleTouchMoved = function (event) { + var evt = event.originalEvent; + var touchPosition = evt.touches ? evt.touches[0] : evt; + this.touchStartPosition = this.touchStartPosition || touchPosition; + var xMovement = Math.abs(this.touchStartPosition.clientX - touchPosition.clientX); + var yMovement = Math.abs(this.touchStartPosition.clientY - touchPosition.clientY); + var distance = Math.sqrt(xMovement * xMovement + yMovement * yMovement); + if(distance > options.touchMovedThreshold) { + this.touchMoved = true; + } + } + + month_picker + .find('.xdsoft_select') + .xdsoftScroller(options) + .on('touchstart mousedown.xdsoft', function (event) { + var evt = event.originalEvent; + this.touchMoved = false; + this.touchStartPosition = evt.touches ? evt.touches[0] : evt; + event.stopPropagation(); + event.preventDefault(); + }) + .on('touchmove', '.xdsoft_option', handleTouchMoved) + .on('touchend mousedown.xdsoft', '.xdsoft_option', function () { + if (!this.touchMoved) { + if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) { + _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); + } + + var year = _xdsoft_datetime.currentTime.getFullYear(); + if (_xdsoft_datetime && _xdsoft_datetime.currentTime) { + _xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value')); + } + + $(this).parent().parent().hide(); + + datetimepicker.trigger('xchange.xdsoft'); + if (options.onChangeMonth && typeof options.onChangeMonth === 'function') { + options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + + if (year !== _xdsoft_datetime.currentTime.getFullYear() && typeof options.onChangeYear === 'function') { + options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + } + }); + + datetimepicker.getValue = function () { + return _xdsoft_datetime.getCurrentTime(); + }; + + datetimepicker.setOptions = function (_options) { + var highlightedDates = {}; + + options = $.extend(true, {}, options, _options); + + if (_options.allowTimes && Array.isArray(_options.allowTimes) && _options.allowTimes.length) { + options.allowTimes = $.extend(true, [], _options.allowTimes); + } + + if (_options.weekends && Array.isArray(_options.weekends) && _options.weekends.length) { + options.weekends = $.extend(true, [], _options.weekends); + } + + if (_options.allowDates && Array.isArray(_options.allowDates) && _options.allowDates.length) { + options.allowDates = $.extend(true, [], _options.allowDates); + } + + if (_options.allowDateRe && Object.prototype.toString.call(_options.allowDateRe)==="[object String]") { + options.allowDateRe = new RegExp(_options.allowDateRe); + } + + if (_options.highlightedDates && Array.isArray(_options.highlightedDates) && _options.highlightedDates.length) { + $.each(_options.highlightedDates, function (index, value) { + var splitData = $.map(value.split(','), $.trim), + exDesc, + hDate = new HighlightedDate(dateHelper.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style + keyDate = dateHelper.formatDate(hDate.date, options.formatDate); + if (highlightedDates[keyDate] !== undefined) { + exDesc = highlightedDates[keyDate].desc; + if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) { + highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc; + } + } else { + highlightedDates[keyDate] = hDate; + } + }); + + options.highlightedDates = $.extend(true, [], highlightedDates); + } + + if (_options.highlightedPeriods && Array.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) { + highlightedDates = $.extend(true, [], options.highlightedDates); + $.each(_options.highlightedPeriods, function (index, value) { + var dateTest, // start date + dateEnd, + desc, + hDate, + keyDate, + exDesc, + style; + if (Array.isArray(value)) { + dateTest = value[0]; + dateEnd = value[1]; + desc = value[2]; + style = value[3]; + } + else { + var splitData = $.map(value.split(','), $.trim); + dateTest = dateHelper.parseDate(splitData[0], options.formatDate); + dateEnd = dateHelper.parseDate(splitData[1], options.formatDate); + desc = splitData[2]; + style = splitData[3]; + } + + while (dateTest <= dateEnd) { + hDate = new HighlightedDate(dateTest, desc, style); + keyDate = dateHelper.formatDate(dateTest, options.formatDate); + dateTest.setDate(dateTest.getDate() + 1); + if (highlightedDates[keyDate] !== undefined) { + exDesc = highlightedDates[keyDate].desc; + if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) { + highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc; + } + } else { + highlightedDates[keyDate] = hDate; + } + } + }); + + options.highlightedDates = $.extend(true, [], highlightedDates); + } + + if (_options.disabledDates && Array.isArray(_options.disabledDates) && _options.disabledDates.length) { + options.disabledDates = $.extend(true, [], _options.disabledDates); + } + + if (_options.disabledWeekDays && Array.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) { + options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays); + } + + if ((options.open || options.opened) && (!options.inline)) { + input.trigger('open.xdsoft'); + } + + if (options.inline) { + triggerAfterOpen = true; + datetimepicker.addClass('xdsoft_inline'); + input.after(datetimepicker).hide(); + } + + if (options.inverseButton) { + options.next = 'xdsoft_prev'; + options.prev = 'xdsoft_next'; + } + + if (options.datepicker) { + datepicker.addClass('active'); + } else { + datepicker.removeClass('active'); + } + + if (options.timepicker) { + timepicker.addClass('active'); + } else { + timepicker.removeClass('active'); + } + + if (options.value) { + _xdsoft_datetime.setCurrentTime(options.value); + if (input && input.val) { + input.val(_xdsoft_datetime.str); + } + } + + if (isNaN(options.dayOfWeekStart)) { + options.dayOfWeekStart = 0; + } else { + options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7; + } + + if (!options.timepickerScrollbar) { + timeboxparent.xdsoftScroller(options, 'hide'); + } + + if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) { + options.minDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.minDate), options.formatDate); + } + + if (options.maxDate && /^[\+\-](.*)$/.test(options.maxDate)) { + options.maxDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate); + } + + if (options.minDateTime && /^\+(.*)$/.test(options.minDateTime)) { + options.minDateTime = _xdsoft_datetime.strToDateTime(options.minDateTime).dateFormat(options.formatDate); + } + + if (options.maxDateTime && /^\+(.*)$/.test(options.maxDateTime)) { + options.maxDateTime = _xdsoft_datetime.strToDateTime(options.maxDateTime).dateFormat(options.formatDate); + } + + applyButton.toggle(options.showApplyButton); + + month_picker + .find('.xdsoft_today_button') + .css('visibility', !options.todayButton ? 'hidden' : 'visible'); + + month_picker + .find('.' + options.prev) + .css('visibility', !options.prevButton ? 'hidden' : 'visible'); + + month_picker + .find('.' + options.next) + .css('visibility', !options.nextButton ? 'hidden' : 'visible'); + + setMask(options); + + if (options.validateOnBlur) { + input + .off('blur.xdsoft') + .on('blur.xdsoft', function () { + if (options.allowBlank && (!$(this).val().trim().length || + (typeof options.mask === "string" && $(this).val().trim() === options.mask.replace(/[0-9]/g, '_')))) { + $(this).val(null); + datetimepicker.data('xdsoft_datetime').empty(); + } else { + var d = dateHelper.parseDate($(this).val(), options.format); + if (d) { // parseDate() may skip some invalid parts like date or time, so make it clear for user: show parsed date/time + $(this).val(dateHelper.formatDate(d, options.format)); + } else { + var splittedHours = +([$(this).val()[0], $(this).val()[1]].join('')), + splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join('')); + + // parse the numbers as 0312 => 03:12 + if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) { + $(this).val([splittedHours, splittedMinutes].map(function (item) { + return item > 9 ? item : '0' + item; + }).join(':')); + } else { + $(this).val(dateHelper.formatDate(_xdsoft_datetime.now(), options.format)); + } + } + datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val()); + } + + datetimepicker.trigger('changedatetime.xdsoft'); + datetimepicker.trigger('close.xdsoft'); + }); + } + options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1; + + datetimepicker + .trigger('xchange.xdsoft') + .trigger('afterOpen.xdsoft'); + }; + + datetimepicker + .data('options', options) + .on('touchstart mousedown.xdsoft', function (event) { + event.stopPropagation(); + event.preventDefault(); + yearselect.hide(); + monthselect.hide(); + return false; + }); + + //scroll_element = timepicker.find('.xdsoft_time_box'); + timeboxparent.append(timebox); + timeboxparent.xdsoftScroller(options); + + datetimepicker.on('afterOpen.xdsoft', function () { + timeboxparent.xdsoftScroller(options); + }); + + datetimepicker + .append(datepicker) + .append(timepicker); + + if (options.withoutCopyright !== true) { + datetimepicker + .append(xdsoft_copyright); + } + + datepicker + .append(month_picker) + .append(calendar) + .append(applyButton); + + if (options.insideParent) { + $(input).parent().append(datetimepicker); + } else { + $(options.parentID).append(datetimepicker); + } + + XDSoft_datetime = function () { + var _this = this; + _this.now = function (norecursion) { + var d = new Date(), + date, + time; + + if (!norecursion && options.defaultDate) { + date = _this.strToDateTime(options.defaultDate); + d.setFullYear(date.getFullYear()); + d.setMonth(date.getMonth()); + d.setDate(date.getDate()); + } + + d.setFullYear(d.getFullYear()); + + if (!norecursion && options.defaultTime) { + time = _this.strtotime(options.defaultTime); + d.setHours(time.getHours()); + d.setMinutes(time.getMinutes()); + d.setSeconds(time.getSeconds()); + d.setMilliseconds(time.getMilliseconds()); + } + return d; + }; + + _this.isValidDate = function (d) { + if (Object.prototype.toString.call(d) !== "[object Date]") { + return false; + } + return !isNaN(d.getTime()); + }; + + _this.setCurrentTime = function (dTime, requireValidDate) { + if (typeof dTime === 'string') { + _this.currentTime = _this.strToDateTime(dTime); + } + else if (_this.isValidDate(dTime)) { + _this.currentTime = dTime; + } + else if (!dTime && !requireValidDate && options.allowBlank && !options.inline) { + _this.currentTime = null; + } + else { + _this.currentTime = _this.now(); + } + + datetimepicker.trigger('xchange.xdsoft'); + }; + + _this.empty = function () { + _this.currentTime = null; + }; + + _this.getCurrentTime = function () { + return _this.currentTime; + }; + + _this.nextMonth = function () { + + if (_this.currentTime === undefined || _this.currentTime === null) { + _this.currentTime = _this.now(); + } + + var month = _this.currentTime.getMonth() + 1, + year; + if (month === 12) { + _this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1); + month = 0; + } + + year = _this.currentTime.getFullYear(); + + _this.currentTime.setDate( + Math.min( + new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), + _this.currentTime.getDate() + ) + ); + _this.currentTime.setMonth(month); + + if (options.onChangeMonth && typeof options.onChangeMonth === 'function') { + options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + + if (year !== _this.currentTime.getFullYear() && typeof options.onChangeYear === 'function') { + options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + + datetimepicker.trigger('xchange.xdsoft'); + return month; + }; + + _this.prevMonth = function () { + + if (_this.currentTime === undefined || _this.currentTime === null) { + _this.currentTime = _this.now(); + } + + var month = _this.currentTime.getMonth() - 1; + if (month === -1) { + _this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1); + month = 11; + } + _this.currentTime.setDate( + Math.min( + new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), + _this.currentTime.getDate() + ) + ); + _this.currentTime.setMonth(month); + if (options.onChangeMonth && typeof options.onChangeMonth === 'function') { + options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + datetimepicker.trigger('xchange.xdsoft'); + return month; + }; + + _this.getWeekOfYear = function (datetime) { + if (options.onGetWeekOfYear && typeof options.onGetWeekOfYear === 'function') { + var week = options.onGetWeekOfYear.call(datetimepicker, datetime); + if (typeof week !== 'undefined') { + return week; + } + } + var onejan = new Date(datetime.getFullYear(), 0, 1); + + //First week of the year is th one with the first Thursday according to ISO8601 + if (onejan.getDay() !== 4) { + onejan.setMonth(0, 1 + ((4 - onejan.getDay()+ 7) % 7)); + } + + return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7); + }; + + _this.strToDateTime = function (sDateTime) { + var tmpDate = [], timeOffset, currentTime; + + if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) { + return sDateTime; + } + + tmpDate = /^([+-]{1})(.*)$/.exec(sDateTime); + + if (tmpDate) { + tmpDate[2] = dateHelper.parseDate(tmpDate[2], options.formatDate); + } + + if (tmpDate && tmpDate[2]) { + timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000; + currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset); + } else { + currentTime = sDateTime ? dateHelper.parseDate(sDateTime, options.format) : _this.now(); + } + + if (!_this.isValidDate(currentTime)) { + currentTime = _this.now(); + } + + return currentTime; + }; + + _this.strToDate = function (sDate) { + if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) { + return sDate; + } + + var currentTime = sDate ? dateHelper.parseDate(sDate, options.formatDate) : _this.now(true); + if (!_this.isValidDate(currentTime)) { + currentTime = _this.now(true); + } + return currentTime; + }; + + _this.strtotime = function (sTime) { + if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) { + return sTime; + } + var currentTime = sTime ? dateHelper.parseDate(sTime, options.formatTime) : _this.now(true); + if (!_this.isValidDate(currentTime)) { + currentTime = _this.now(true); + } + return currentTime; + }; + + _this.str = function () { + var format = options.format; + if (options.yearOffset) { + format = format.replace('Y', _this.currentTime.getFullYear() + options.yearOffset); + format = format.replace('y', String(_this.currentTime.getFullYear() + options.yearOffset).substring(2, 4)); + } + return dateHelper.formatDate(_this.currentTime, format); + }; + _this.currentTime = this.now(); + }; + + _xdsoft_datetime = new XDSoft_datetime(); + + applyButton.on('touchend click', function (e) {//pathbrite + e.preventDefault(); + datetimepicker.data('changed', true); + _xdsoft_datetime.setCurrentTime(getCurrentValue()); + input.val(_xdsoft_datetime.str()); + datetimepicker.trigger('close.xdsoft'); + }); + month_picker + .find('.xdsoft_today_button') + .on('touchend mousedown.xdsoft', function () { + datetimepicker.data('changed', true); + _xdsoft_datetime.setCurrentTime(0, true); + datetimepicker.trigger('afterOpen.xdsoft'); + }).on('dblclick.xdsoft', function () { + var currentDate = _xdsoft_datetime.getCurrentTime(), minDate, maxDate; + currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()); + minDate = _xdsoft_datetime.strToDate(options.minDate); + minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); + if (currentDate < minDate) { + return; + } + maxDate = _xdsoft_datetime.strToDate(options.maxDate); + maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()); + if (currentDate > maxDate) { + return; + } + input.val(_xdsoft_datetime.str()); + input.trigger('change'); + datetimepicker.trigger('close.xdsoft'); + }); + month_picker + .find('.xdsoft_prev,.xdsoft_next') + .on('touchend mousedown.xdsoft', function () { + var $this = $(this), + timer = 0, + stop = false; + + (function arguments_callee1(v) { + if ($this.hasClass(options.next)) { + _xdsoft_datetime.nextMonth(); + } else if ($this.hasClass(options.prev)) { + _xdsoft_datetime.prevMonth(); + } + if (options.monthChangeSpinner) { + if (!stop) { + timer = setTimeout(arguments_callee1, v || 100); + } + } + }(500)); + + $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee2() { + clearTimeout(timer); + stop = true; + $([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft', arguments_callee2); + }); + }); + + timepicker + .find('.xdsoft_prev,.xdsoft_next') + .on('touchend mousedown.xdsoft', function () { + var $this = $(this), + timer = 0, + stop = false, + period = 110; + (function arguments_callee4(v) { + var pheight = timeboxparent[0].clientHeight, + height = timebox[0].offsetHeight, + top = Math.abs(parseInt(timebox.css('marginTop'), 10)); + /** + * Fixes a bug which happens if: + * top is < the timeHeightInTimePicker, it will cause the up arrow to stop working + * same for the down arrow if it's not exactly on the pixel + */ + if (top < options.timeHeightInTimePicker) { + top = options.timeHeightInTimePicker; + } else if ($this.hasClass(options.next) && (height - pheight) < top) { + timebox.css('marginTop', '-' + height + 'px'); + } + + if ($this.hasClass(options.next) && (height - pheight) > top) { + timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px'); + } else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) { + timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px'); + } + /** + * Fixed bug: + * When using css3 transition, it will cause a bug that you cannot scroll the timepicker list. + * The reason is that the transition-duration time, if you set it to 0, all things fine, otherwise, this + * would cause a bug when you use jquery.css method. + * Let's say: * { transition: all .5s ease; } + * jquery timebox.css('marginTop') will return the original value which is before you clicking the next/prev button, + * meanwhile the timebox[0].style.marginTop will return the right value which is after you clicking the + * next/prev button. + * + * What we should do: + * Replace timebox.css('marginTop') with timebox[0].style.marginTop. + */ + timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox[0].style.marginTop, 10) / (height - pheight))]); + period = (period > 10) ? 10 : period - 10; + if (!stop) { + timer = setTimeout(arguments_callee4, v || period); + } + }(500)); + $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee5() { + clearTimeout(timer); + stop = true; + $([options.ownerDocument.body, options.contentWindow]) + .off('touchend mouseup.xdsoft', arguments_callee5); + }); + }); + + xchangeTimer = 0; + // base handler - generating a calendar and timepicker + datetimepicker + .on('xchange.xdsoft', function (event) { + clearTimeout(xchangeTimer); + xchangeTimer = setTimeout(function () { + + if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null || isNaN(_xdsoft_datetime.currentTime.getTime())) { + _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); + } + + var table = '', + start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0), + i = 0, + j, + today = _xdsoft_datetime.now(), + maxDate = false, + minDate = false, + minDateTime = false, + maxDateTime = false, + hDate, + day, + d, + y, + m, + w, + classes = [], + customDateSettings, + newRow = true, + time = '', + h, + line_time, + description; + + while (start.getDay() !== options.dayOfWeekStart) { + start.setDate(start.getDate() - 1); + } + + table += ''; + + if (options.weeks) { + table += ''; + } + + for (j = 0; j < 7; j += 1) { + table += ''; + } + + table += ''; + table += ''; + + if (options.maxDate !== false) { + maxDate = _xdsoft_datetime.strToDate(options.maxDate); + maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999); + } + + if (options.minDate !== false) { + minDate = _xdsoft_datetime.strToDate(options.minDate); + minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); + } + + if (options.minDateTime !== false) { + minDateTime = _xdsoft_datetime.strToDate(options.minDateTime); + minDateTime = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), minDateTime.getHours(), minDateTime.getMinutes(), minDateTime.getSeconds()); + } + + if (options.maxDateTime !== false) { + maxDateTime = _xdsoft_datetime.strToDate(options.maxDateTime); + maxDateTime = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), maxDateTime.getHours(), maxDateTime.getMinutes(), maxDateTime.getSeconds()); + } + + var maxDateTimeDay; + if (maxDateTime !== false) { + maxDateTimeDay = ((maxDateTime.getFullYear() * 12) + maxDateTime.getMonth()) * 31 + maxDateTime.getDate(); + } + + while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) { + classes = []; + i += 1; + + day = start.getDay(); + d = start.getDate(); + y = start.getFullYear(); + m = start.getMonth(); + w = _xdsoft_datetime.getWeekOfYear(start); + description = ''; + + classes.push('xdsoft_date'); + + if (options.beforeShowDay && typeof options.beforeShowDay.call === 'function') { + customDateSettings = options.beforeShowDay.call(datetimepicker, start); + } else { + customDateSettings = null; + } + + if(options.allowDateRe && Object.prototype.toString.call(options.allowDateRe) === "[object RegExp]"){ + if(!options.allowDateRe.test(dateHelper.formatDate(start, options.formatDate))){ + classes.push('xdsoft_disabled'); + } + } + + if(options.allowDates && options.allowDates.length>0){ + if(options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate)) === -1){ + classes.push('xdsoft_disabled'); + } + } + + var currentDay = ((start.getFullYear() * 12) + start.getMonth()) * 31 + start.getDate(); + if ((maxDate !== false && start > maxDate) || (minDateTime !== false && start < minDateTime) || (minDate !== false && start < minDate) || (maxDateTime !== false && currentDay > maxDateTimeDay) || (customDateSettings && customDateSettings[0] === false)) { + classes.push('xdsoft_disabled'); + } + + if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) { + classes.push('xdsoft_disabled'); + } + + if (options.disabledWeekDays.indexOf(day) !== -1) { + classes.push('xdsoft_disabled'); + } + + if (input.is('[disabled]')) { + classes.push('xdsoft_disabled'); + } + + if (customDateSettings && customDateSettings[1] !== "") { + classes.push(customDateSettings[1]); + } + + if (_xdsoft_datetime.currentTime.getMonth() !== m) { + classes.push('xdsoft_other_month'); + } + + if ((options.defaultSelect || datetimepicker.data('changed')) && dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) { + classes.push('xdsoft_current'); + } + + if (dateHelper.formatDate(today, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) { + classes.push('xdsoft_today'); + } + + if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) { + classes.push('xdsoft_weekend'); + } + + if (options.highlightedDates[dateHelper.formatDate(start, options.formatDate)] !== undefined) { + hDate = options.highlightedDates[dateHelper.formatDate(start, options.formatDate)]; + classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style); + description = hDate.desc === undefined ? '' : hDate.desc; + } + + if (options.beforeShowDay && typeof options.beforeShowDay === 'function') { + classes.push(options.beforeShowDay(start)); + } + + if (newRow) { + table += ''; + newRow = false; + if (options.weeks) { + table += ''; + } + } + + table += ''; + + if (start.getDay() === options.dayOfWeekStartPrev) { + table += ''; + newRow = true; + } + + start.setDate(d + 1); + } + table += '
    ' + options.i18n[globalLocale].dayOfWeekShort[(j + options.dayOfWeekStart) % 7] + '
    ' + w + '' + + '
    ' + d + '
    ' + + '
    '; + + calendar.html(table); + + month_picker.find('.xdsoft_label span').eq(0).text(options.i18n[globalLocale].months[_xdsoft_datetime.currentTime.getMonth()]); + month_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear() + options.yearOffset); + + // generate timebox + time = ''; + h = ''; + m = ''; + + var minTimeMinutesOfDay = 0; + if (options.minTime !== false) { + var t = _xdsoft_datetime.strtotime(options.minTime); + minTimeMinutesOfDay = 60 * t.getHours() + t.getMinutes(); + } + var maxTimeMinutesOfDay = 24 * 60; + if (options.maxTime !== false) { + var t = _xdsoft_datetime.strtotime(options.maxTime); + maxTimeMinutesOfDay = 60 * t.getHours() + t.getMinutes(); + } + + if (options.minDateTime !== false) { + var t = _xdsoft_datetime.strToDateTime(options.minDateTime); + var currentDayIsMinDateTimeDay = dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(t, options.formatDate); + if (currentDayIsMinDateTimeDay) { + var m = 60 * t.getHours() + t.getMinutes(); + if (m > minTimeMinutesOfDay) minTimeMinutesOfDay = m; + } + } + + if (options.maxDateTime !== false) { + var t = _xdsoft_datetime.strToDateTime(options.maxDateTime); + var currentDayIsMaxDateTimeDay = dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(t, options.formatDate); + if (currentDayIsMaxDateTimeDay) { + var m = 60 * t.getHours() + t.getMinutes(); + if (m < maxTimeMinutesOfDay) maxTimeMinutesOfDay = m; + } + } + + line_time = function line_time(h, m) { + var now = _xdsoft_datetime.now(), current_time, + isALlowTimesInit = options.allowTimes && Array.isArray(options.allowTimes) && options.allowTimes.length; + now.setHours(h); + h = parseInt(now.getHours(), 10); + now.setMinutes(m); + m = parseInt(now.getMinutes(), 10); + classes = []; + var currentMinutesOfDay = 60 * h + m; + if (input.is('[disabled]') || (currentMinutesOfDay >= maxTimeMinutesOfDay) || (currentMinutesOfDay < minTimeMinutesOfDay)) { + classes.push('xdsoft_disabled'); + } + + current_time = new Date(_xdsoft_datetime.currentTime); + current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10)); + + if (!isALlowTimesInit) { + current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step); + } + + if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && ((!isALlowTimesInit && options.step > 59) || current_time.getMinutes() === parseInt(m, 10))) { + if (options.defaultSelect || datetimepicker.data('changed')) { + classes.push('xdsoft_current'); + } else if (options.initTime) { + classes.push('xdsoft_init_time'); + } + } + if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) { + classes.push('xdsoft_today'); + } + time += '
    ' + dateHelper.formatDate(now, options.formatTime) + '
    '; + }; + + if (!options.allowTimes || !Array.isArray(options.allowTimes) || !options.allowTimes.length) { + for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) { + for (j = 0; j < 60; j += options.step) { + var currentMinutesOfDay = i * 60 + j; + if (currentMinutesOfDay < minTimeMinutesOfDay) continue; + if (currentMinutesOfDay >= maxTimeMinutesOfDay) continue; + h = (i < 10 ? '0' : '') + i; + m = (j < 10 ? '0' : '') + j; + line_time(h, m); + } + } + } else { + for (i = 0; i < options.allowTimes.length; i += 1) { + h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours(); + m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes(); + line_time(h, m); + } + } + + timebox.html(time); + + opt = ''; + + for (i = parseInt(options.yearStart, 10); i <= parseInt(options.yearEnd, 10); i += 1) { + opt += '
    ' + (i + options.yearOffset) + '
    '; + } + yearselect.children().eq(0) + .html(opt); + + for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) { + opt += '
    ' + options.i18n[globalLocale].months[i] + '
    '; + } + monthselect.children().eq(0).html(opt); + $(datetimepicker) + .trigger('generate.xdsoft'); + }, 10); + event.stopPropagation(); + }) + .on('afterOpen.xdsoft', function () { + if (options.timepicker) { + var classType, pheight, height, top; + if (timebox.find('.xdsoft_current').length) { + classType = '.xdsoft_current'; + } else if (timebox.find('.xdsoft_init_time').length) { + classType = '.xdsoft_init_time'; + } + if (classType) { + pheight = timeboxparent[0].clientHeight; + height = timebox[0].offsetHeight; + top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1; + if ((height - pheight) < top) { + top = height - pheight; + } + timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]); + } else { + timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]); + } + } + }); + + timerclick = 0; + calendar + .on('touchend click.xdsoft', 'td', function (xdevent) { + xdevent.stopPropagation(); // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap + timerclick += 1; + var $this = $(this), + currentTime = _xdsoft_datetime.currentTime; + + if (currentTime === undefined || currentTime === null) { + _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); + currentTime = _xdsoft_datetime.currentTime; + } + + if ($this.hasClass('xdsoft_disabled')) { + return false; + } + + currentTime.setDate(1); + currentTime.setFullYear($this.data('year')); + currentTime.setMonth($this.data('month')); + currentTime.setDate($this.data('date')); + + datetimepicker.trigger('select.xdsoft', [currentTime]); + + input.val(_xdsoft_datetime.str()); + + if (options.onSelectDate && typeof options.onSelectDate === 'function') { + options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); + } + + datetimepicker.data('changed', true); + datetimepicker.trigger('xchange.xdsoft'); + datetimepicker.trigger('changedatetime.xdsoft'); + if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) { + datetimepicker.trigger('close.xdsoft'); + } + setTimeout(function () { + timerclick = 0; + }, 200); + }); + + timebox + .on('touchstart', 'div', function (xdevent) { + this.touchMoved = false; + }) + .on('touchmove', 'div', handleTouchMoved) + .on('touchend click.xdsoft', 'div', function (xdevent) { + if (!this.touchMoved) { + xdevent.stopPropagation(); + var $this = $(this), + currentTime = _xdsoft_datetime.currentTime; + + if (currentTime === undefined || currentTime === null) { + _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); + currentTime = _xdsoft_datetime.currentTime; + } + + if ($this.hasClass('xdsoft_disabled')) { + return false; + } + currentTime.setHours($this.data('hour')); + currentTime.setMinutes($this.data('minute')); + datetimepicker.trigger('select.xdsoft', [currentTime]); + + datetimepicker.data('input').val(_xdsoft_datetime.str()); + + if (options.onSelectTime && typeof options.onSelectTime === 'function') { + options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); + } + datetimepicker.data('changed', true); + datetimepicker.trigger('xchange.xdsoft'); + datetimepicker.trigger('changedatetime.xdsoft'); + if (options.inline !== true && options.closeOnTimeSelect === true) { + datetimepicker.trigger('close.xdsoft'); + } + } + }); + + datepicker + .on('mousewheel.xdsoft', function (event) { + if (!options.scrollMonth) { + return true; + } + if (event.deltaY < 0) { + _xdsoft_datetime.nextMonth(); + } else { + _xdsoft_datetime.prevMonth(); + } + return false; + }); + + input + .on('mousewheel.xdsoft', function (event) { + if (!options.scrollInput) { + return true; + } + if (!options.datepicker && options.timepicker) { + current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0; + if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) { + current_time_index += event.deltaY; + } + if (timebox.children().eq(current_time_index).length) { + timebox.children().eq(current_time_index).trigger('mousedown'); + } + return false; + } + if (options.datepicker && !options.timepicker) { + datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]); + if (input.val) { + input.val(_xdsoft_datetime.str()); + } + datetimepicker.trigger('changedatetime.xdsoft'); + return false; + } + }); + + datetimepicker + .on('changedatetime.xdsoft', function (event) { + if (options.onChangeDateTime && typeof options.onChangeDateTime === 'function') { + var $input = datetimepicker.data('input'); + options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event); + delete options.value; + $input.trigger('change'); + } + }) + .on('generate.xdsoft', function () { + if (options.onGenerate && typeof options.onGenerate === 'function') { + options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); + } + if (triggerAfterOpen) { + datetimepicker.trigger('afterOpen.xdsoft'); + triggerAfterOpen = false; + } + }) + .on('click.xdsoft', function (xdevent) { + xdevent.stopPropagation(); + }); + + current_time_index = 0; + + /** + * Runs the callback for each of the specified node's ancestors. + * + * Return FALSE from the callback to stop ascending. + * + * @param {DOMNode} node + * @param {Function} callback + * @returns {undefined} + */ + forEachAncestorOf = function (node, callback) { + do { + node = node.parentNode; + + if (!node || callback(node) === false) { + break; + } + } while (node.nodeName !== 'HTML'); + }; + + /** + * Sets the position of the picker. + * + * @returns {undefined} + */ + setPos = function () { + var dateInputOffset, + dateInputElem, + verticalPosition, + left, + position, + datetimepickerElem, + dateInputHasFixedAncestor, + $dateInput, + windowWidth, + verticalAnchorEdge, + datetimepickerCss, + windowHeight, + windowScrollTop; + + $dateInput = datetimepicker.data('input'); + dateInputOffset = $dateInput.offset(); + dateInputElem = $dateInput[0]; + + verticalAnchorEdge = 'top'; + verticalPosition = (dateInputOffset.top + dateInputElem.offsetHeight) - 1; + left = dateInputOffset.left; + position = "absolute"; + + windowWidth = $(options.contentWindow).width(); + windowHeight = $(options.contentWindow).height(); + windowScrollTop = $(options.contentWindow).scrollTop(); + + if ((options.ownerDocument.documentElement.clientWidth - dateInputOffset.left) < datepicker.parent().outerWidth(true)) { + var diff = datepicker.parent().outerWidth(true) - dateInputElem.offsetWidth; + left = left - diff; + } + + if ($dateInput.parent().css('direction') === 'rtl') { + left -= (datetimepicker.outerWidth() - $dateInput.outerWidth()); + } + + if (options.fixed) { + verticalPosition -= windowScrollTop; + left -= $(options.contentWindow).scrollLeft(); + position = "fixed"; + } else { + dateInputHasFixedAncestor = false; + + forEachAncestorOf(dateInputElem, function (ancestorNode) { + if (ancestorNode === null) { + return false; + } + + if (options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position') === 'fixed') { + dateInputHasFixedAncestor = true; + return false; + } + }); + + if (dateInputHasFixedAncestor && !options.insideParent) { + position = 'fixed'; + + //If the picker won't fit entirely within the viewport then display it above the date input. + if (verticalPosition + datetimepicker.outerHeight() > windowHeight + windowScrollTop) { + verticalAnchorEdge = 'bottom'; + verticalPosition = (windowHeight + windowScrollTop) - dateInputOffset.top; + } else { + verticalPosition -= windowScrollTop; + } + } else { + if (verticalPosition + datetimepicker[0].offsetHeight > windowHeight + windowScrollTop) { + verticalPosition = dateInputOffset.top - datetimepicker[0].offsetHeight + 1; + } + } + + if (verticalPosition < 0) { + verticalPosition = 0; + } + + if (left + dateInputElem.offsetWidth > windowWidth) { + left = windowWidth - dateInputElem.offsetWidth; + } + } + + datetimepickerElem = datetimepicker[0]; + + forEachAncestorOf(datetimepickerElem, function (ancestorNode) { + var ancestorNodePosition; + + ancestorNodePosition = options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position'); + + if (ancestorNodePosition === 'relative' && windowWidth >= ancestorNode.offsetWidth) { + left = left - ((windowWidth - ancestorNode.offsetWidth) / 2); + return false; + } + }); + + datetimepickerCss = { + position: position, + left: options.insideParent ? dateInputElem.offsetLeft : left, + top: '', //Initialize to prevent previous values interfering with new ones. + bottom: '' //Initialize to prevent previous values interfering with new ones. + }; + + if (options.insideParent) { + datetimepickerCss[verticalAnchorEdge] = dateInputElem.offsetTop + dateInputElem.offsetHeight; + } else { + datetimepickerCss[verticalAnchorEdge] = verticalPosition; + } + + datetimepicker.css(datetimepickerCss); + }; + + datetimepicker + .on('open.xdsoft', function (event) { + var onShow = true; + if (options.onShow && typeof options.onShow === 'function') { + onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); + } + if (onShow !== false) { + datetimepicker.show(); + setPos(); + $(options.contentWindow) + .off('resize.xdsoft', setPos) + .on('resize.xdsoft', setPos); + + if (options.closeOnWithoutClick) { + $([options.ownerDocument.body, options.contentWindow]).on('touchstart mousedown.xdsoft', function arguments_callee6() { + datetimepicker.trigger('close.xdsoft'); + $([options.ownerDocument.body, options.contentWindow]).off('touchstart mousedown.xdsoft', arguments_callee6); + }); + } + } + }) + .on('close.xdsoft', function (event) { + var onClose = true; + month_picker + .find('.xdsoft_month,.xdsoft_year') + .find('.xdsoft_select') + .hide(); + if (options.onClose && typeof options.onClose === 'function') { + onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); + } + if (onClose !== false && !options.opened && !options.inline) { + datetimepicker.hide(); + } + event.stopPropagation(); + }) + .on('toggle.xdsoft', function () { + if (datetimepicker.is(':visible')) { + datetimepicker.trigger('close.xdsoft'); + } else { + datetimepicker.trigger('open.xdsoft'); + } + }) + .data('input', input); + + timer = 0; + + datetimepicker.data('xdsoft_datetime', _xdsoft_datetime); + datetimepicker.setOptions(options); + + function getCurrentValue() { + var ct = false, time; + + if (options.startDate) { + ct = _xdsoft_datetime.strToDate(options.startDate); + } else { + ct = options.value || ((input && input.val && input.val()) ? input.val() : ''); + if (ct) { + ct = _xdsoft_datetime.strToDateTime(ct); + if (options.yearOffset) { + ct = new Date(ct.getFullYear() - options.yearOffset, ct.getMonth(), ct.getDate(), ct.getHours(), ct.getMinutes(), ct.getSeconds(), ct.getMilliseconds()); + } + } else if (options.defaultDate) { + ct = _xdsoft_datetime.strToDateTime(options.defaultDate); + if (options.defaultTime) { + time = _xdsoft_datetime.strtotime(options.defaultTime); + ct.setHours(time.getHours()); + ct.setMinutes(time.getMinutes()); + } + } + } + + if (ct && _xdsoft_datetime.isValidDate(ct)) { + datetimepicker.data('changed', true); + } else { + ct = ''; + } + + return ct || 0; + } + + function setMask(options) { + + var isValidValue = function (mask, value) { + var reg = mask + .replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1') + .replace(/_/g, '{digit+}') + .replace(/([0-9]{1})/g, '{digit$1}') + .replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}') + .replace(/\{digit[\+]\}/g, '[0-9_]{1}'); + return (new RegExp(reg)).test(value); + }, + getCaretPos = function (input) { + try { + if (options.ownerDocument.selection && options.ownerDocument.selection.createRange) { + var range = options.ownerDocument.selection.createRange(); + return range.getBookmark().charCodeAt(2) - 2; + } + if (input.setSelectionRange) { + return input.selectionStart; + } + } catch (e) { + return 0; + } + }, + setCaretPos = function (node, pos) { + node = (typeof node === "string" || node instanceof String) ? options.ownerDocument.getElementById(node) : node; + if (!node) { + return false; + } + if (node.createTextRange) { + var textRange = node.createTextRange(); + textRange.collapse(true); + textRange.moveEnd('character', pos); + textRange.moveStart('character', pos); + textRange.select(); + return true; + } + if (node.setSelectionRange) { + node.setSelectionRange(pos, pos); + return true; + } + return false; + }; + + if(options.mask) { + input.off('keydown.xdsoft'); + } + + if (options.mask === true) { + if (dateHelper.formatMask) { + options.mask = dateHelper.formatMask(options.format) + } else { + options.mask = options.format + .replace(/Y/g, '9999') + .replace(/F/g, '9999') + .replace(/m/g, '19') + .replace(/d/g, '39') + .replace(/H/g, '29') + .replace(/i/g, '59') + .replace(/s/g, '59'); + } + } + + if (typeof options.mask === 'string') { + if (!isValidValue(options.mask, input.val())) { + input.val(options.mask.replace(/[0-9]/g, '_')); + setCaretPos(input[0], 0); + } + + input.on('paste.xdsoft', function (event) { + // couple options here + // 1. return false - tell them they can't paste + // 2. insert over current characters - minimal validation + // 3. full fledged parsing and validation + // let's go option 2 for now + + // fires multiple times for some reason + + // https://stackoverflow.com/a/30496488/1366033 + var clipboardData = event.clipboardData || event.originalEvent.clipboardData || window.clipboardData, + pastedData = clipboardData.getData('text'), + val = this.value, + pos = this.selectionStart + + var valueBeforeCursor = val.slice(0, pos); + var valueAfterPaste = val.slice(pos + pastedData.length); + + val = valueBeforeCursor + pastedData + valueAfterPaste; + pos += pastedData.length; + + if (isValidValue(options.mask, val)) { + this.value = val; + setCaretPos(this, pos); + } else if (val.trim() === '') { + this.value = options.mask.replace(/[0-9]/g, '_'); + } else { + input.trigger('error_input.xdsoft'); + } + + event.preventDefault(); + return false; + }); + + input.on('keydown.xdsoft', function (event) { + var val = this.value, + key = event.which, + pos = this.selectionStart, + selEnd = this.selectionEnd, + hasSel = pos !== selEnd, + digit; + + // only alow these characters + if (((key >= KEY0 && key <= KEY9) || + (key >= _KEY0 && key <= _KEY9)) || + (key === BACKSPACE || key === DEL)) { + + // get char to insert which is new character or placeholder ('_') + digit = (key === BACKSPACE || key === DEL) ? '_' : + String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key); + + // we're deleting something, we're not at the start, and have normal cursor, move back one + // if we have a selection length, cursor actually sits behind deletable char, not in front + if (key === BACKSPACE && pos && !hasSel) { + pos -= 1; + } + + // don't stop on a separator, continue whatever direction you were going + // value char - keep incrementing position while on separator char and we still have room + // del char - keep decrementing position while on separator char and we still have room + while (true) { + var maskValueAtCurPos = options.mask.slice(pos, pos+1); + var posShorterThanMaskLength = pos < options.mask.length; + var posGreaterThanZero = pos > 0; + var notNumberOrPlaceholder = /[^0-9_]/; + var curPosOnSep = notNumberOrPlaceholder.test(maskValueAtCurPos); + var continueMovingPosition = curPosOnSep && posShorterThanMaskLength && posGreaterThanZero + + // if we hit a real char, stay where we are + if (!continueMovingPosition) break; + + // hitting backspace in a selection, you can possibly go back any further - go forward + pos += (key === BACKSPACE && !hasSel) ? -1 : 1; + + } + + if (event.metaKey) { // cmd has been pressed + pos = 0; + hasSel = true; + } + + if (hasSel) { + // pos might have moved so re-calc length + var selLength = selEnd - pos + + // if we have a selection length we will wipe out entire selection and replace with default template for that range + var defaultBlank = options.mask.replace(/[0-9]/g, '_'); + var defaultBlankSelectionReplacement = defaultBlank.slice(pos, pos+selLength); + var selReplacementRemainder = defaultBlankSelectionReplacement.slice(1) // might be empty + + var valueBeforeSel = val.slice(0, pos); + var insertChars = digit + selReplacementRemainder; + var charsAfterSelection = val.slice(pos + selLength); + + val = valueBeforeSel + insertChars + charsAfterSelection + + } else { + var valueBeforeCursor = val.slice(0, pos); + var insertChar = digit; + var valueAfterNextChar = val.slice(pos + 1); + + val = valueBeforeCursor + insertChar + valueAfterNextChar + } + + if (val.trim() === '') { + // if empty, set to default + val = defaultBlank + } else { + // if at the last character don't need to do anything + if (pos === options.mask.length) { + event.preventDefault(); + return false; + } + } + + // resume cursor location + pos += (key === BACKSPACE) ? 0 : 1; + // don't stop on a separator, continue whatever direction you were going + while (/[^0-9_]/.test(options.mask.slice(pos, pos+1)) && pos < options.mask.length && pos > 0) { + pos += (key === BACKSPACE) ? 0 : 1; + } + + if (isValidValue(options.mask, val)) { + this.value = val; + setCaretPos(this, pos); + } else if (val.trim() === '') { + this.value = options.mask.replace(/[0-9]/g, '_'); + } else { + input.trigger('error_input.xdsoft'); + } + } else { + if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) { + return true; + } + } + + event.preventDefault(); + return false; + }); + } + } + + _xdsoft_datetime.setCurrentTime(getCurrentValue()); + + input + .data('xdsoft_datetimepicker', datetimepicker) + .on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function () { + if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) { + return; + } + if (!options.openOnFocus) { + return; + } + clearTimeout(timer); + timer = setTimeout(function () { + if (input.is(':disabled')) { + return; + } + + triggerAfterOpen = true; + _xdsoft_datetime.setCurrentTime(getCurrentValue(), true); + if(options.mask) { + setMask(options); + } + datetimepicker.trigger('open.xdsoft'); + }, 100); + }) + .on('keydown.xdsoft', function (event) { + var elementSelector, + key = event.which; + if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) { + elementSelector = $("input:visible,textarea:visible,button:visible,a:visible"); + datetimepicker.trigger('close.xdsoft'); + elementSelector.eq(elementSelector.index(this) + 1).focus(); + return false; + } + if ([TAB].indexOf(key) !== -1) { + datetimepicker.trigger('close.xdsoft'); + return true; + } + }) + .on('blur.xdsoft', function () { + datetimepicker.trigger('close.xdsoft'); + }); + }; + destroyDateTimePicker = function (input) { + var datetimepicker = input.data('xdsoft_datetimepicker'); + if (datetimepicker) { + datetimepicker.data('xdsoft_datetime', null); + datetimepicker.remove(); + input + .data('xdsoft_datetimepicker', null) + .off('.xdsoft'); + $(options.contentWindow).off('resize.xdsoft'); + $([options.contentWindow, options.ownerDocument.body]).off('mousedown.xdsoft touchstart'); + if (input.unmousewheel) { + input.unmousewheel(); + } + } + }; + $(options.ownerDocument) + .off('keydown.xdsoftctrl keyup.xdsoftctrl') + .off('keydown.xdsoftcmd keyup.xdsoftcmd') + .on('keydown.xdsoftctrl', function (e) { + if (e.keyCode === CTRLKEY) { + ctrlDown = true; + } + }) + .on('keyup.xdsoftctrl', function (e) { + if (e.keyCode === CTRLKEY) { + ctrlDown = false; + } + }) + .on('keydown.xdsoftcmd', function (e) { + if (e.keyCode === CMDKEY) { + cmdDown = true; + } + }) + .on('keyup.xdsoftcmd', function (e) { + if (e.keyCode === CMDKEY) { + cmdDown = false; + } + }); + + this.each(function () { + var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input; + if (datetimepicker) { + if (typeof opt === 'string') { + switch (opt) { + case 'show': + $(this).select().focus(); + datetimepicker.trigger('open.xdsoft'); + break; + case 'hide': + datetimepicker.trigger('close.xdsoft'); + break; + case 'toggle': + datetimepicker.trigger('toggle.xdsoft'); + break; + case 'destroy': + destroyDateTimePicker($(this)); + break; + case 'reset': + this.value = this.defaultValue; + if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(dateHelper.parseDate(this.value, options.format))) { + datetimepicker.data('changed', false); + } + datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value); + break; + case 'validate': + $input = datetimepicker.data('input'); + $input.trigger('blur.xdsoft'); + break; + default: + if (datetimepicker[opt] && typeof datetimepicker[opt] === 'function') { + result = datetimepicker[opt](opt2); + } + } + } else { + datetimepicker + .setOptions(opt); + } + return 0; + } + if (typeof opt !== 'string') { + if (!options.lazyInit || options.open || options.inline) { + createDateTimePicker($(this)); + } else { + lazyInit($(this)); + } + } + }); + + return result; + }; + + $.fn.datetimepicker.defaults = default_options; + + function HighlightedDate(date, desc, style) { + "use strict"; + this.date = date; + this.desc = desc; + this.style = style; + } +}; +;(function (factory) { + if ( typeof define === 'function' && define.amd ) { + // AMD. Register as an anonymous module. + define(['jquery', 'jquery-mousewheel'], factory); + } else if (typeof exports === 'object') { + // Node/CommonJS style for Browserify + module.exports = factory(require('jquery'));; + } else { + // Browser globals + factory(jQuery); + } +}(datetimepickerFactory)); + + diff --git a/plugins/datetimepicker-master/jquery.js b/plugins/datetimepicker-master/jquery.js new file mode 100644 index 0000000..da41706 --- /dev/null +++ b/plugins/datetimepicker-master/jquery.js @@ -0,0 +1,6 @@ +/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery-1.10.2.min.map +*/ +(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="
    ",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
    a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
    t
    ",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
    ",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t +}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:x.support.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); +u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("' : ''); + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort) { + var changeMonth = this._get(inst, 'changeMonth'); + var changeYear = this._get(inst, 'changeYear'); + var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); + var html = '
    '; + var monthHtml = ''; + // month selection + if (secondary || !changeMonth) + monthHtml += '' + monthNames[drawMonth] + ''; + else { + var inMinYear = (minDate && minDate.getFullYear() == drawYear); + var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); + monthHtml += ''; + } + if (!showMonthAfterYear) + html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); + // year selection + if ( !inst.yearshtml ) { + inst.yearshtml = ''; + if (secondary || !changeYear) + html += '' + drawYear + ''; + else { + // determine range of years to display + var years = this._get(inst, 'yearRange').split(':'); + var thisYear = new Date().getFullYear(); + var determineYear = function(value) { + var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : + (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : + parseInt(value, 10))); + return (isNaN(year) ? thisYear : year); + }; + var year = determineYear(years[0]); + var endYear = Math.max(year, determineYear(years[1] || '')); + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + inst.yearshtml += ''; + + html += inst.yearshtml; + inst.yearshtml = null; + } + } + html += this._get(inst, 'yearSuffix'); + if (showMonthAfterYear) + html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; + html += '
    '; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function(inst, offset, period) { + var year = inst.drawYear + (period == 'Y' ? offset : 0); + var month = inst.drawMonth + (period == 'M' ? offset : 0); + var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + + (period == 'D' ? offset : 0); + var date = this._restrictMinMax(inst, + this._daylightSavingAdjust(new Date(year, month, day))); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if (period == 'M' || period == 'Y') + this._notifyChange(inst); + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var newDate = (minDate && date < minDate ? minDate : date); + newDate = (maxDate && newDate > maxDate ? maxDate : newDate); + return newDate; + }, + + /* Notify change of month/year. */ + _notifyChange: function(inst) { + var onChange = this._get(inst, 'onChangeMonthYear'); + if (onChange) + onChange.apply((inst.input ? inst.input[0] : null), + [inst.selectedYear, inst.selectedMonth + 1, inst]); + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function(inst) { + var numMonths = this._get(inst, 'numberOfMonths'); + return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function(inst, minMax) { + return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function(year, month) { + return new Date(year, month, 1).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function(inst, offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(inst); + var date = this._daylightSavingAdjust(new Date(curYear, + curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); + if (offset < 0) + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + return this._isInRange(inst, date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + return ((!minDate || date.getTime() >= minDate.getTime()) && + (!maxDate || date.getTime() <= maxDate.getTime())); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function(inst) { + var shortYearCutoff = this._get(inst, 'shortYearCutoff'); + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return {shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), + monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; + }, + + /* Format the given date for display. */ + _formatDate: function(inst, day, month, year) { + if (!day) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = (day ? (typeof day == 'object' ? day : + this._daylightSavingAdjust(new Date(year, month, day))) : + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); + } +}); + +/* + * Bind hover events for datepicker elements. + * Done via delegate so the binding only occurs once in the lifetime of the parent div. + * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. + */ +function bindHover(dpDiv) { + var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; + return dpDiv.delegate(selector, 'mouseout', function() { + $(this).removeClass('ui-state-hover'); + if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); + if (this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); + }) + .delegate(selector, 'mouseover', function(){ + if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) { + $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); + $(this).addClass('ui-state-hover'); + if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); + if (this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); + } + }); +} + +/* jQuery extend now ignores nulls! */ +function extendRemove(target, props) { + $.extend(target, props); + for (var name in props) + if (props[name] == null || props[name] == undefined) + target[name] = props[name]; + return target; +}; + +/* Invoke the datepicker functionality. + @param options string - a command, optionally followed by additional parameters or + Object - settings for attaching new datepicker functionality + @return jQuery object */ +$.fn.datepicker = function(options){ + + /* Verify an empty collection wasn't passed - Fixes #6976 */ + if ( !this.length ) { + return this; + } + + /* Initialise the date picker. */ + if (!$.datepicker.initialized) { + $(document).mousedown($.datepicker._checkExternalClick). + find(document.body).append($.datepicker.dpDiv); + $.datepicker.initialized = true; + } + + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + return this.each(function() { + typeof options == 'string' ? + $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this].concat(otherArgs)) : + $.datepicker._attachDatepicker(this, options); + }); +}; + +$.datepicker = new Datepicker(); // singleton instance +$.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); +$.datepicker.version = "1.9.2"; + +// Workaround for #4055 +// Add another global to avoid noConflict issues with inline event handlers +window['DP_jQuery_' + dpuuid] = $; + +})(jQuery); + +(function( $, undefined ) { + +var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ", + sizeRelatedOptions = { + buttons: true, + height: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + width: true + }, + resizableRelatedOptions = { + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true + }; + +$.widget("ui.dialog", { + version: "1.9.2", + options: { + autoOpen: true, + buttons: {}, + closeOnEscape: true, + closeText: "close", + dialogClass: "", + draggable: true, + hide: null, + height: "auto", + maxHeight: false, + maxWidth: false, + minHeight: 150, + minWidth: 150, + modal: false, + position: { + my: "center", + at: "center", + of: window, + collision: "fit", + // ensure that the titlebar is never outside the document + using: function( pos ) { + var topOffset = $( this ).css( pos ).offset().top; + if ( topOffset < 0 ) { + $( this ).css( "top", pos.top - topOffset ); + } + } + }, + resizable: true, + show: null, + stack: true, + title: "", + width: 300, + zIndex: 1000 + }, + + _create: function() { + this.originalTitle = this.element.attr( "title" ); + // #5742 - .attr() might return a DOMElement + if ( typeof this.originalTitle !== "string" ) { + this.originalTitle = ""; + } + this.oldPosition = { + parent: this.element.parent(), + index: this.element.parent().children().index( this.element ) + }; + this.options.title = this.options.title || this.originalTitle; + var that = this, + options = this.options, + + title = options.title || " ", + uiDialog, + uiDialogTitlebar, + uiDialogTitlebarClose, + uiDialogTitle, + uiDialogButtonPane; + + uiDialog = ( this.uiDialog = $( "
    " ) ) + .addClass( uiDialogClasses + options.dialogClass ) + .css({ + display: "none", + outline: 0, // TODO: move to stylesheet + zIndex: options.zIndex + }) + // setting tabIndex makes the div focusable + .attr( "tabIndex", -1) + .keydown(function( event ) { + if ( options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE ) { + that.close( event ); + event.preventDefault(); + } + }) + .mousedown(function( event ) { + that.moveToTop( false, event ); + }) + .appendTo( "body" ); + + this.element + .show() + .removeAttr( "title" ) + .addClass( "ui-dialog-content ui-widget-content" ) + .appendTo( uiDialog ); + + uiDialogTitlebar = ( this.uiDialogTitlebar = $( "
    " ) ) + .addClass( "ui-dialog-titlebar ui-widget-header " + + "ui-corner-all ui-helper-clearfix" ) + .bind( "mousedown", function() { + // Dialog isn't getting focus when dragging (#8063) + uiDialog.focus(); + }) + .prependTo( uiDialog ); + + uiDialogTitlebarClose = $( "" ) + .addClass( "ui-dialog-titlebar-close ui-corner-all" ) + .attr( "role", "button" ) + .click(function( event ) { + event.preventDefault(); + that.close( event ); + }) + .appendTo( uiDialogTitlebar ); + + ( this.uiDialogTitlebarCloseText = $( "" ) ) + .addClass( "ui-icon ui-icon-closethick" ) + .text( options.closeText ) + .appendTo( uiDialogTitlebarClose ); + + uiDialogTitle = $( "" ) + .uniqueId() + .addClass( "ui-dialog-title" ) + .html( title ) + .prependTo( uiDialogTitlebar ); + + uiDialogButtonPane = ( this.uiDialogButtonPane = $( "
    " ) ) + .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ); + + ( this.uiButtonSet = $( "
    " ) ) + .addClass( "ui-dialog-buttonset" ) + .appendTo( uiDialogButtonPane ); + + uiDialog.attr({ + role: "dialog", + "aria-labelledby": uiDialogTitle.attr( "id" ) + }); + + uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection(); + this._hoverable( uiDialogTitlebarClose ); + this._focusable( uiDialogTitlebarClose ); + + if ( options.draggable && $.fn.draggable ) { + this._makeDraggable(); + } + if ( options.resizable && $.fn.resizable ) { + this._makeResizable(); + } + + this._createButtons( options.buttons ); + this._isOpen = false; + + if ( $.fn.bgiframe ) { + uiDialog.bgiframe(); + } + + // prevent tabbing out of modal dialogs + this._on( uiDialog, { keydown: function( event ) { + if ( !options.modal || event.keyCode !== $.ui.keyCode.TAB ) { + return; + } + + var tabbables = $( ":tabbable", uiDialog ), + first = tabbables.filter( ":first" ), + last = tabbables.filter( ":last" ); + + if ( event.target === last[0] && !event.shiftKey ) { + first.focus( 1 ); + return false; + } else if ( event.target === first[0] && event.shiftKey ) { + last.focus( 1 ); + return false; + } + }}); + }, + + _init: function() { + if ( this.options.autoOpen ) { + this.open(); + } + }, + + _destroy: function() { + var next, + oldPosition = this.oldPosition; + + if ( this.overlay ) { + this.overlay.destroy(); + } + this.uiDialog.hide(); + this.element + .removeClass( "ui-dialog-content ui-widget-content" ) + .hide() + .appendTo( "body" ); + this.uiDialog.remove(); + + if ( this.originalTitle ) { + this.element.attr( "title", this.originalTitle ); + } + + next = oldPosition.parent.children().eq( oldPosition.index ); + // Don't try to place the dialog next to itself (#8613) + if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { + next.before( this.element ); + } else { + oldPosition.parent.append( this.element ); + } + }, + + widget: function() { + return this.uiDialog; + }, + + close: function( event ) { + var that = this, + maxZ, thisZ; + + if ( !this._isOpen ) { + return; + } + + if ( false === this._trigger( "beforeClose", event ) ) { + return; + } + + this._isOpen = false; + + if ( this.overlay ) { + this.overlay.destroy(); + } + + if ( this.options.hide ) { + this._hide( this.uiDialog, this.options.hide, function() { + that._trigger( "close", event ); + }); + } else { + this.uiDialog.hide(); + this._trigger( "close", event ); + } + + $.ui.dialog.overlay.resize(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + if ( this.options.modal ) { + maxZ = 0; + $( ".ui-dialog" ).each(function() { + if ( this !== that.uiDialog[0] ) { + thisZ = $( this ).css( "z-index" ); + if ( !isNaN( thisZ ) ) { + maxZ = Math.max( maxZ, thisZ ); + } + } + }); + $.ui.dialog.maxZ = maxZ; + } + + return this; + }, + + isOpen: function() { + return this._isOpen; + }, + + // the force parameter allows us to move modal dialogs to their correct + // position on open + moveToTop: function( force, event ) { + var options = this.options, + saveScroll; + + if ( ( options.modal && !force ) || + ( !options.stack && !options.modal ) ) { + return this._trigger( "focus", event ); + } + + if ( options.zIndex > $.ui.dialog.maxZ ) { + $.ui.dialog.maxZ = options.zIndex; + } + if ( this.overlay ) { + $.ui.dialog.maxZ += 1; + $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ; + this.overlay.$el.css( "z-index", $.ui.dialog.overlay.maxZ ); + } + + // Save and then restore scroll + // Opera 9.5+ resets when parent z-index is changed. + // http://bugs.jqueryui.com/ticket/3193 + saveScroll = { + scrollTop: this.element.scrollTop(), + scrollLeft: this.element.scrollLeft() + }; + $.ui.dialog.maxZ += 1; + this.uiDialog.css( "z-index", $.ui.dialog.maxZ ); + this.element.attr( saveScroll ); + this._trigger( "focus", event ); + + return this; + }, + + open: function() { + if ( this._isOpen ) { + return; + } + + var hasFocus, + options = this.options, + uiDialog = this.uiDialog; + + this._size(); + this._position( options.position ); + uiDialog.show( options.show ); + this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null; + this.moveToTop( true ); + + // set focus to the first tabbable element in the content area or the first button + // if there are no tabbable elements, set focus on the dialog itself + hasFocus = this.element.find( ":tabbable" ); + if ( !hasFocus.length ) { + hasFocus = this.uiDialogButtonPane.find( ":tabbable" ); + if ( !hasFocus.length ) { + hasFocus = uiDialog; + } + } + hasFocus.eq( 0 ).focus(); + + this._isOpen = true; + this._trigger( "open" ); + + return this; + }, + + _createButtons: function( buttons ) { + var that = this, + hasButtons = false; + + // if we already have a button pane, remove it + this.uiDialogButtonPane.remove(); + this.uiButtonSet.empty(); + + if ( typeof buttons === "object" && buttons !== null ) { + $.each( buttons, function() { + return !(hasButtons = true); + }); + } + if ( hasButtons ) { + $.each( buttons, function( name, props ) { + var button, click; + props = $.isFunction( props ) ? + { click: props, text: name } : + props; + // Default to a non-submitting button + props = $.extend( { type: "button" }, props ); + // Change the context for the click callback to be the main element + click = props.click; + props.click = function() { + click.apply( that.element[0], arguments ); + }; + button = $( "", props ) + .appendTo( that.uiButtonSet ); + if ( $.fn.button ) { + button.button(); + } + }); + this.uiDialog.addClass( "ui-dialog-buttons" ); + this.uiDialogButtonPane.appendTo( this.uiDialog ); + } else { + this.uiDialog.removeClass( "ui-dialog-buttons" ); + } + }, + + _makeDraggable: function() { + var that = this, + options = this.options; + + function filteredUi( ui ) { + return { + position: ui.position, + offset: ui.offset + }; + } + + this.uiDialog.draggable({ + cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", + handle: ".ui-dialog-titlebar", + containment: "document", + start: function( event, ui ) { + $( this ) + .addClass( "ui-dialog-dragging" ); + that._trigger( "dragStart", event, filteredUi( ui ) ); + }, + drag: function( event, ui ) { + that._trigger( "drag", event, filteredUi( ui ) ); + }, + stop: function( event, ui ) { + options.position = [ + ui.position.left - that.document.scrollLeft(), + ui.position.top - that.document.scrollTop() + ]; + $( this ) + .removeClass( "ui-dialog-dragging" ); + that._trigger( "dragStop", event, filteredUi( ui ) ); + $.ui.dialog.overlay.resize(); + } + }); + }, + + _makeResizable: function( handles ) { + handles = (handles === undefined ? this.options.resizable : handles); + var that = this, + options = this.options, + // .ui-resizable has position: relative defined in the stylesheet + // but dialogs have to use absolute or fixed positioning + position = this.uiDialog.css( "position" ), + resizeHandles = typeof handles === 'string' ? + handles : + "n,e,s,w,se,sw,ne,nw"; + + function filteredUi( ui ) { + return { + originalPosition: ui.originalPosition, + originalSize: ui.originalSize, + position: ui.position, + size: ui.size + }; + } + + this.uiDialog.resizable({ + cancel: ".ui-dialog-content", + containment: "document", + alsoResize: this.element, + maxWidth: options.maxWidth, + maxHeight: options.maxHeight, + minWidth: options.minWidth, + minHeight: this._minHeight(), + handles: resizeHandles, + start: function( event, ui ) { + $( this ).addClass( "ui-dialog-resizing" ); + that._trigger( "resizeStart", event, filteredUi( ui ) ); + }, + resize: function( event, ui ) { + that._trigger( "resize", event, filteredUi( ui ) ); + }, + stop: function( event, ui ) { + $( this ).removeClass( "ui-dialog-resizing" ); + options.height = $( this ).height(); + options.width = $( this ).width(); + that._trigger( "resizeStop", event, filteredUi( ui ) ); + $.ui.dialog.overlay.resize(); + } + }) + .css( "position", position ) + .find( ".ui-resizable-se" ) + .addClass( "ui-icon ui-icon-grip-diagonal-se" ); + }, + + _minHeight: function() { + var options = this.options; + + if ( options.height === "auto" ) { + return options.minHeight; + } else { + return Math.min( options.minHeight, options.height ); + } + }, + + _position: function( position ) { + var myAt = [], + offset = [ 0, 0 ], + isVisible; + + if ( position ) { + // deep extending converts arrays to objects in jQuery <= 1.3.2 :-( + // if (typeof position == 'string' || $.isArray(position)) { + // myAt = $.isArray(position) ? position : position.split(' '); + + if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) { + myAt = position.split ? position.split( " " ) : [ position[ 0 ], position[ 1 ] ]; + if ( myAt.length === 1 ) { + myAt[ 1 ] = myAt[ 0 ]; + } + + $.each( [ "left", "top" ], function( i, offsetPosition ) { + if ( +myAt[ i ] === myAt[ i ] ) { + offset[ i ] = myAt[ i ]; + myAt[ i ] = offsetPosition; + } + }); + + position = { + my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " + + myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]), + at: myAt.join( " " ) + }; + } + + position = $.extend( {}, $.ui.dialog.prototype.options.position, position ); + } else { + position = $.ui.dialog.prototype.options.position; + } + + // need to show the dialog to get the actual offset in the position plugin + isVisible = this.uiDialog.is( ":visible" ); + if ( !isVisible ) { + this.uiDialog.show(); + } + this.uiDialog.position( position ); + if ( !isVisible ) { + this.uiDialog.hide(); + } + }, + + _setOptions: function( options ) { + var that = this, + resizableOptions = {}, + resize = false; + + $.each( options, function( key, value ) { + that._setOption( key, value ); + + if ( key in sizeRelatedOptions ) { + resize = true; + } + if ( key in resizableRelatedOptions ) { + resizableOptions[ key ] = value; + } + }); + + if ( resize ) { + this._size(); + } + if ( this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", resizableOptions ); + } + }, + + _setOption: function( key, value ) { + var isDraggable, isResizable, + uiDialog = this.uiDialog; + + switch ( key ) { + case "buttons": + this._createButtons( value ); + break; + case "closeText": + // ensure that we always pass a string + this.uiDialogTitlebarCloseText.text( "" + value ); + break; + case "dialogClass": + uiDialog + .removeClass( this.options.dialogClass ) + .addClass( uiDialogClasses + value ); + break; + case "disabled": + if ( value ) { + uiDialog.addClass( "ui-dialog-disabled" ); + } else { + uiDialog.removeClass( "ui-dialog-disabled" ); + } + break; + case "draggable": + isDraggable = uiDialog.is( ":data(draggable)" ); + if ( isDraggable && !value ) { + uiDialog.draggable( "destroy" ); + } + + if ( !isDraggable && value ) { + this._makeDraggable(); + } + break; + case "position": + this._position( value ); + break; + case "resizable": + // currently resizable, becoming non-resizable + isResizable = uiDialog.is( ":data(resizable)" ); + if ( isResizable && !value ) { + uiDialog.resizable( "destroy" ); + } + + // currently resizable, changing handles + if ( isResizable && typeof value === "string" ) { + uiDialog.resizable( "option", "handles", value ); + } + + // currently non-resizable, becoming resizable + if ( !isResizable && value !== false ) { + this._makeResizable( value ); + } + break; + case "title": + // convert whatever was passed in o a string, for html() to not throw up + $( ".ui-dialog-title", this.uiDialogTitlebar ) + .html( "" + ( value || " " ) ); + break; + } + + this._super( key, value ); + }, + + _size: function() { + /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content + * divs will both have width and height set, so we need to reset them + */ + var nonContentHeight, minContentHeight, autoHeight, + options = this.options, + isVisible = this.uiDialog.is( ":visible" ); + + // reset content sizing + this.element.show().css({ + width: "auto", + minHeight: 0, + height: 0 + }); + + if ( options.minWidth > options.width ) { + options.width = options.minWidth; + } + + // reset wrapper sizing + // determine the height of all the non-content elements + nonContentHeight = this.uiDialog.css({ + height: "auto", + width: options.width + }) + .outerHeight(); + minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); + + if ( options.height === "auto" ) { + // only needed for IE6 support + if ( $.support.minHeight ) { + this.element.css({ + minHeight: minContentHeight, + height: "auto" + }); + } else { + this.uiDialog.show(); + autoHeight = this.element.css( "height", "auto" ).height(); + if ( !isVisible ) { + this.uiDialog.hide(); + } + this.element.height( Math.max( autoHeight, minContentHeight ) ); + } + } else { + this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); + } + + if (this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); + } + } +}); + +$.extend($.ui.dialog, { + uuid: 0, + maxZ: 0, + + getTitleId: function($el) { + var id = $el.attr( "id" ); + if ( !id ) { + this.uuid += 1; + id = this.uuid; + } + return "ui-dialog-title-" + id; + }, + + overlay: function( dialog ) { + this.$el = $.ui.dialog.overlay.create( dialog ); + } +}); + +$.extend( $.ui.dialog.overlay, { + instances: [], + // reuse old instances due to IE memory leak with alpha transparency (see #5185) + oldInstances: [], + maxZ: 0, + events: $.map( + "focus,mousedown,mouseup,keydown,keypress,click".split( "," ), + function( event ) { + return event + ".dialog-overlay"; + } + ).join( " " ), + create: function( dialog ) { + if ( this.instances.length === 0 ) { + // prevent use of anchors and inputs + // we use a setTimeout in case the overlay is created from an + // event that we're going to be cancelling (see #2804) + setTimeout(function() { + // handle $(el).dialog().dialog('close') (see #4065) + if ( $.ui.dialog.overlay.instances.length ) { + $( document ).bind( $.ui.dialog.overlay.events, function( event ) { + // stop events if the z-index of the target is < the z-index of the overlay + // we cannot return true when we don't want to cancel the event (#3523) + if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) { + return false; + } + }); + } + }, 1 ); + + // handle window resize + $( window ).bind( "resize.dialog-overlay", $.ui.dialog.overlay.resize ); + } + + var $el = ( this.oldInstances.pop() || $( "
    " ).addClass( "ui-widget-overlay" ) ); + + // allow closing by pressing the escape key + $( document ).bind( "keydown.dialog-overlay", function( event ) { + var instances = $.ui.dialog.overlay.instances; + // only react to the event if we're the top overlay + if ( instances.length !== 0 && instances[ instances.length - 1 ] === $el && + dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE ) { + + dialog.close( event ); + event.preventDefault(); + } + }); + + $el.appendTo( document.body ).css({ + width: this.width(), + height: this.height() + }); + + if ( $.fn.bgiframe ) { + $el.bgiframe(); + } + + this.instances.push( $el ); + return $el; + }, + + destroy: function( $el ) { + var indexOf = $.inArray( $el, this.instances ), + maxZ = 0; + + if ( indexOf !== -1 ) { + this.oldInstances.push( this.instances.splice( indexOf, 1 )[ 0 ] ); + } + + if ( this.instances.length === 0 ) { + $( [ document, window ] ).unbind( ".dialog-overlay" ); + } + + $el.height( 0 ).width( 0 ).remove(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + $.each( this.instances, function() { + maxZ = Math.max( maxZ, this.css( "z-index" ) ); + }); + this.maxZ = maxZ; + }, + + height: function() { + var scrollHeight, + offsetHeight; + // handle IE + if ( $.ui.ie ) { + scrollHeight = Math.max( + document.documentElement.scrollHeight, + document.body.scrollHeight + ); + offsetHeight = Math.max( + document.documentElement.offsetHeight, + document.body.offsetHeight + ); + + if ( scrollHeight < offsetHeight ) { + return $( window ).height() + "px"; + } else { + return scrollHeight + "px"; + } + // handle "good" browsers + } else { + return $( document ).height() + "px"; + } + }, + + width: function() { + var scrollWidth, + offsetWidth; + // handle IE + if ( $.ui.ie ) { + scrollWidth = Math.max( + document.documentElement.scrollWidth, + document.body.scrollWidth + ); + offsetWidth = Math.max( + document.documentElement.offsetWidth, + document.body.offsetWidth + ); + + if ( scrollWidth < offsetWidth ) { + return $( window ).width() + "px"; + } else { + return scrollWidth + "px"; + } + // handle "good" browsers + } else { + return $( document ).width() + "px"; + } + }, + + resize: function() { + /* If the dialog is draggable and the user drags it past the + * right edge of the window, the document becomes wider so we + * need to stretch the overlay. If the user then drags the + * dialog back to the left, the document will become narrower, + * so we need to shrink the overlay to the appropriate size. + * This is handled by shrinking the overlay before setting it + * to the full document size. + */ + var $overlays = $( [] ); + $.each( $.ui.dialog.overlay.instances, function() { + $overlays = $overlays.add( this ); + }); + + $overlays.css({ + width: 0, + height: 0 + }).css({ + width: $.ui.dialog.overlay.width(), + height: $.ui.dialog.overlay.height() + }); + } +}); + +$.extend( $.ui.dialog.overlay.prototype, { + destroy: function() { + $.ui.dialog.overlay.destroy( this.$el ); + } +}); + +}( jQuery ) ); + +(function( $, undefined ) { + +var rvertical = /up|down|vertical/, + rpositivemotion = /up|left|vertical|horizontal/; + +$.effects.effect.blind = function( o, done ) { + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + direction = o.direction || "up", + vertical = rvertical.test( direction ), + ref = vertical ? "height" : "width", + ref2 = vertical ? "top" : "left", + motion = rpositivemotion.test( direction ), + animation = {}, + show = mode === "show", + wrapper, distance, margin; + + // if already wrapped, the wrapper's properties are my property. #6245 + if ( el.parent().is( ".ui-effects-wrapper" ) ) { + $.effects.save( el.parent(), props ); + } else { + $.effects.save( el, props ); + } + el.show(); + wrapper = $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + + distance = wrapper[ ref ](); + margin = parseFloat( wrapper.css( ref2 ) ) || 0; + + animation[ ref ] = show ? distance : 0; + if ( !motion ) { + el + .css( vertical ? "bottom" : "right", 0 ) + .css( vertical ? "top" : "left", "auto" ) + .css({ position: "absolute" }); + + animation[ ref2 ] = show ? margin : distance + margin; + } + + // start at 0 if we are showing + if ( show ) { + wrapper.css( ref, 0 ); + if ( ! motion ) { + wrapper.css( ref2, margin + distance ); + } + } + + // Animate + wrapper.animate( animation, { + duration: o.duration, + easing: o.easing, + queue: false, + complete: function() { + if ( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); + +}; + +})(jQuery); + +(function( $, undefined ) { + +$.effects.effect.bounce = function( o, done ) { + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + + // defaults: + mode = $.effects.setMode( el, o.mode || "effect" ), + hide = mode === "hide", + show = mode === "show", + direction = o.direction || "up", + distance = o.distance, + times = o.times || 5, + + // number of internal animations + anims = times * 2 + ( show || hide ? 1 : 0 ), + speed = o.duration / anims, + easing = o.easing, + + // utility: + ref = ( direction === "up" || direction === "down" ) ? "top" : "left", + motion = ( direction === "up" || direction === "left" ), + i, + upAnim, + downAnim, + + // we will need to re-assemble the queue to stack our animations in place + queue = el.queue(), + queuelen = queue.length; + + // Avoid touching opacity to prevent clearType and PNG issues in IE + if ( show || hide ) { + props.push( "opacity" ); + } + + $.effects.save( el, props ); + el.show(); + $.effects.createWrapper( el ); // Create Wrapper + + // default distance for the BIGGEST bounce is the outer Distance / 3 + if ( !distance ) { + distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; + } + + if ( show ) { + downAnim = { opacity: 1 }; + downAnim[ ref ] = 0; + + // if we are showing, force opacity 0 and set the initial position + // then do the "first" animation + el.css( "opacity", 0 ) + .css( ref, motion ? -distance * 2 : distance * 2 ) + .animate( downAnim, speed, easing ); + } + + // start at the smallest distance if we are hiding + if ( hide ) { + distance = distance / Math.pow( 2, times - 1 ); + } + + downAnim = {}; + downAnim[ ref ] = 0; + // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here + for ( i = 0; i < times; i++ ) { + upAnim = {}; + upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; + + el.animate( upAnim, speed, easing ) + .animate( downAnim, speed, easing ); + + distance = hide ? distance * 2 : distance / 2; + } + + // Last Bounce when Hiding + if ( hide ) { + upAnim = { opacity: 0 }; + upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; + + el.animate( upAnim, speed, easing ); + } + + el.queue(function() { + if ( hide ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + }); + + // inject all the animations we just queued to be first in line (after "inprogress") + if ( queuelen > 1) { + queue.splice.apply( queue, + [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); + } + el.dequeue(); + +}; + +})(jQuery); + +(function( $, undefined ) { + +$.effects.effect.clip = function( o, done ) { + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + direction = o.direction || "vertical", + vert = direction === "vertical", + size = vert ? "height" : "width", + position = vert ? "top" : "left", + animation = {}, + wrapper, animate, distance; + + // Save & Show + $.effects.save( el, props ); + el.show(); + + // Create Wrapper + wrapper = $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + animate = ( el[0].tagName === "IMG" ) ? wrapper : el; + distance = animate[ size ](); + + // Shift + if ( show ) { + animate.css( size, 0 ); + animate.css( position, distance / 2 ); + } + + // Create Animation Object: + animation[ size ] = show ? distance : 0; + animation[ position ] = show ? 0 : distance / 2; + + // Animate + animate.animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( !show ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); + +}; + +})(jQuery); + +(function( $, undefined ) { + +$.effects.effect.drop = function( o, done ) { + + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + direction = o.direction || "left", + ref = ( direction === "up" || direction === "down" ) ? "top" : "left", + motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg", + animation = { + opacity: show ? 1 : 0 + }, + distance; + + // Adjust + $.effects.save( el, props ); + el.show(); + $.effects.createWrapper( el ); + + distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]( true ) / 2; + + if ( show ) { + el + .css( "opacity", 0 ) + .css( ref, motion === "pos" ? -distance : distance ); + } + + // Animation + animation[ ref ] = ( show ? + ( motion === "pos" ? "+=" : "-=" ) : + ( motion === "pos" ? "-=" : "+=" ) ) + + distance; + + // Animate + el.animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); +}; + +})(jQuery); + +(function( $, undefined ) { + +$.effects.effect.explode = function( o, done ) { + + var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3, + cells = rows, + el = $( this ), + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + + // show and then visibility:hidden the element before calculating offset + offset = el.show().css( "visibility", "hidden" ).offset(), + + // width and height of a piece + width = Math.ceil( el.outerWidth() / cells ), + height = Math.ceil( el.outerHeight() / rows ), + pieces = [], + + // loop + i, j, left, top, mx, my; + + // children animate complete: + function childComplete() { + pieces.push( this ); + if ( pieces.length === rows * cells ) { + animComplete(); + } + } + + // clone the element for each row and cell. + for( i = 0; i < rows ; i++ ) { // ===> + top = offset.top + i * height; + my = i - ( rows - 1 ) / 2 ; + + for( j = 0; j < cells ; j++ ) { // ||| + left = offset.left + j * width; + mx = j - ( cells - 1 ) / 2 ; + + // Create a clone of the now hidden main element that will be absolute positioned + // within a wrapper div off the -left and -top equal to size of our pieces + el + .clone() + .appendTo( "body" ) + .wrap( "
    " ) + .css({ + position: "absolute", + visibility: "visible", + left: -j * width, + top: -i * height + }) + + // select the wrapper - make it overflow: hidden and absolute positioned based on + // where the original was located +left and +top equal to the size of pieces + .parent() + .addClass( "ui-effects-explode" ) + .css({ + position: "absolute", + overflow: "hidden", + width: width, + height: height, + left: left + ( show ? mx * width : 0 ), + top: top + ( show ? my * height : 0 ), + opacity: show ? 0 : 1 + }).animate({ + left: left + ( show ? 0 : mx * width ), + top: top + ( show ? 0 : my * height ), + opacity: show ? 1 : 0 + }, o.duration || 500, o.easing, childComplete ); + } + } + + function animComplete() { + el.css({ + visibility: "visible" + }); + $( pieces ).remove(); + if ( !show ) { + el.hide(); + } + done(); + } +}; + +})(jQuery); + +(function( $, undefined ) { + +$.effects.effect.fade = function( o, done ) { + var el = $( this ), + mode = $.effects.setMode( el, o.mode || "toggle" ); + + el.animate({ + opacity: mode + }, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: done + }); +}; + +})( jQuery ); + +(function( $, undefined ) { + +$.effects.effect.fold = function( o, done ) { + + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + hide = mode === "hide", + size = o.size || 15, + percent = /([0-9]+)%/.exec( size ), + horizFirst = !!o.horizFirst, + widthFirst = show !== horizFirst, + ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ], + duration = o.duration / 2, + wrapper, distance, + animation1 = {}, + animation2 = {}; + + $.effects.save( el, props ); + el.show(); + + // Create Wrapper + wrapper = $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + distance = widthFirst ? + [ wrapper.width(), wrapper.height() ] : + [ wrapper.height(), wrapper.width() ]; + + if ( percent ) { + size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ]; + } + if ( show ) { + wrapper.css( horizFirst ? { + height: 0, + width: size + } : { + height: size, + width: 0 + }); + } + + // Animation + animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size; + animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0; + + // Animate + wrapper + .animate( animation1, duration, o.easing ) + .animate( animation2, duration, o.easing, function() { + if ( hide ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + }); + +}; + +})(jQuery); + +(function( $, undefined ) { + +$.effects.effect.highlight = function( o, done ) { + var elem = $( this ), + props = [ "backgroundImage", "backgroundColor", "opacity" ], + mode = $.effects.setMode( elem, o.mode || "show" ), + animation = { + backgroundColor: elem.css( "backgroundColor" ) + }; + + if (mode === "hide") { + animation.opacity = 0; + } + + $.effects.save( elem, props ); + + elem + .show() + .css({ + backgroundImage: "none", + backgroundColor: o.color || "#ffff99" + }) + .animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( mode === "hide" ) { + elem.hide(); + } + $.effects.restore( elem, props ); + done(); + } + }); +}; + +})(jQuery); + +(function( $, undefined ) { + +$.effects.effect.pulsate = function( o, done ) { + var elem = $( this ), + mode = $.effects.setMode( elem, o.mode || "show" ), + show = mode === "show", + hide = mode === "hide", + showhide = ( show || mode === "hide" ), + + // showing or hiding leaves of the "last" animation + anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ), + duration = o.duration / anims, + animateTo = 0, + queue = elem.queue(), + queuelen = queue.length, + i; + + if ( show || !elem.is(":visible")) { + elem.css( "opacity", 0 ).show(); + animateTo = 1; + } + + // anims - 1 opacity "toggles" + for ( i = 1; i < anims; i++ ) { + elem.animate({ + opacity: animateTo + }, duration, o.easing ); + animateTo = 1 - animateTo; + } + + elem.animate({ + opacity: animateTo + }, duration, o.easing); + + elem.queue(function() { + if ( hide ) { + elem.hide(); + } + done(); + }); + + // We just queued up "anims" animations, we need to put them next in the queue + if ( queuelen > 1 ) { + queue.splice.apply( queue, + [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); + } + elem.dequeue(); +}; + +})(jQuery); + +(function( $, undefined ) { + +$.effects.effect.puff = function( o, done ) { + var elem = $( this ), + mode = $.effects.setMode( elem, o.mode || "hide" ), + hide = mode === "hide", + percent = parseInt( o.percent, 10 ) || 150, + factor = percent / 100, + original = { + height: elem.height(), + width: elem.width(), + outerHeight: elem.outerHeight(), + outerWidth: elem.outerWidth() + }; + + $.extend( o, { + effect: "scale", + queue: false, + fade: true, + mode: mode, + complete: done, + percent: hide ? percent : 100, + from: hide ? + original : + { + height: original.height * factor, + width: original.width * factor, + outerHeight: original.outerHeight * factor, + outerWidth: original.outerWidth * factor + } + }); + + elem.effect( o ); +}; + +$.effects.effect.scale = function( o, done ) { + + // Create element + var el = $( this ), + options = $.extend( true, {}, o ), + mode = $.effects.setMode( el, o.mode || "effect" ), + percent = parseInt( o.percent, 10 ) || + ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ), + direction = o.direction || "both", + origin = o.origin, + original = { + height: el.height(), + width: el.width(), + outerHeight: el.outerHeight(), + outerWidth: el.outerWidth() + }, + factor = { + y: direction !== "horizontal" ? (percent / 100) : 1, + x: direction !== "vertical" ? (percent / 100) : 1 + }; + + // We are going to pass this effect to the size effect: + options.effect = "size"; + options.queue = false; + options.complete = done; + + // Set default origin and restore for show/hide + if ( mode !== "effect" ) { + options.origin = origin || ["middle","center"]; + options.restore = true; + } + + options.from = o.from || ( mode === "show" ? { + height: 0, + width: 0, + outerHeight: 0, + outerWidth: 0 + } : original ); + options.to = { + height: original.height * factor.y, + width: original.width * factor.x, + outerHeight: original.outerHeight * factor.y, + outerWidth: original.outerWidth * factor.x + }; + + // Fade option to support puff + if ( options.fade ) { + if ( mode === "show" ) { + options.from.opacity = 0; + options.to.opacity = 1; + } + if ( mode === "hide" ) { + options.from.opacity = 1; + options.to.opacity = 0; + } + } + + // Animate + el.effect( options ); + +}; + +$.effects.effect.size = function( o, done ) { + + // Create element + var original, baseline, factor, + el = $( this ), + props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ], + + // Always restore + props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ], + + // Copy for children + props2 = [ "width", "height", "overflow" ], + cProps = [ "fontSize" ], + vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ], + hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ], + + // Set options + mode = $.effects.setMode( el, o.mode || "effect" ), + restore = o.restore || mode !== "effect", + scale = o.scale || "both", + origin = o.origin || [ "middle", "center" ], + position = el.css( "position" ), + props = restore ? props0 : props1, + zero = { + height: 0, + width: 0, + outerHeight: 0, + outerWidth: 0 + }; + + if ( mode === "show" ) { + el.show(); + } + original = { + height: el.height(), + width: el.width(), + outerHeight: el.outerHeight(), + outerWidth: el.outerWidth() + }; + + if ( o.mode === "toggle" && mode === "show" ) { + el.from = o.to || zero; + el.to = o.from || original; + } else { + el.from = o.from || ( mode === "show" ? zero : original ); + el.to = o.to || ( mode === "hide" ? zero : original ); + } + + // Set scaling factor + factor = { + from: { + y: el.from.height / original.height, + x: el.from.width / original.width + }, + to: { + y: el.to.height / original.height, + x: el.to.width / original.width + } + }; + + // Scale the css box + if ( scale === "box" || scale === "both" ) { + + // Vertical props scaling + if ( factor.from.y !== factor.to.y ) { + props = props.concat( vProps ); + el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from ); + el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to ); + } + + // Horizontal props scaling + if ( factor.from.x !== factor.to.x ) { + props = props.concat( hProps ); + el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from ); + el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to ); + } + } + + // Scale the content + if ( scale === "content" || scale === "both" ) { + + // Vertical props scaling + if ( factor.from.y !== factor.to.y ) { + props = props.concat( cProps ).concat( props2 ); + el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from ); + el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to ); + } + } + + $.effects.save( el, props ); + el.show(); + $.effects.createWrapper( el ); + el.css( "overflow", "hidden" ).css( el.from ); + + // Adjust + if (origin) { // Calculate baseline shifts + baseline = $.effects.getBaseline( origin, original ); + el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y; + el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x; + el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y; + el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x; + } + el.css( el.from ); // set top & left + + // Animate + if ( scale === "content" || scale === "both" ) { // Scale the children + + // Add margins/font-size + vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps); + hProps = hProps.concat([ "marginLeft", "marginRight" ]); + props2 = props0.concat(vProps).concat(hProps); + + el.find( "*[width]" ).each( function(){ + var child = $( this ), + c_original = { + height: child.height(), + width: child.width(), + outerHeight: child.outerHeight(), + outerWidth: child.outerWidth() + }; + if (restore) { + $.effects.save(child, props2); + } + + child.from = { + height: c_original.height * factor.from.y, + width: c_original.width * factor.from.x, + outerHeight: c_original.outerHeight * factor.from.y, + outerWidth: c_original.outerWidth * factor.from.x + }; + child.to = { + height: c_original.height * factor.to.y, + width: c_original.width * factor.to.x, + outerHeight: c_original.height * factor.to.y, + outerWidth: c_original.width * factor.to.x + }; + + // Vertical props scaling + if ( factor.from.y !== factor.to.y ) { + child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from ); + child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to ); + } + + // Horizontal props scaling + if ( factor.from.x !== factor.to.x ) { + child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from ); + child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to ); + } + + // Animate children + child.css( child.from ); + child.animate( child.to, o.duration, o.easing, function() { + + // Restore children + if ( restore ) { + $.effects.restore( child, props2 ); + } + }); + }); + } + + // Animate + el.animate( el.to, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( el.to.opacity === 0 ) { + el.css( "opacity", el.from.opacity ); + } + if( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + if ( !restore ) { + + // we need to calculate our new positioning based on the scaling + if ( position === "static" ) { + el.css({ + position: "relative", + top: el.to.top, + left: el.to.left + }); + } else { + $.each([ "top", "left" ], function( idx, pos ) { + el.css( pos, function( _, str ) { + var val = parseInt( str, 10 ), + toRef = idx ? el.to.left : el.to.top; + + // if original was "auto", recalculate the new value from wrapper + if ( str === "auto" ) { + return toRef + "px"; + } + + return val + toRef + "px"; + }); + }); + } + } + + $.effects.removeWrapper( el ); + done(); + } + }); + +}; + +})(jQuery); + +(function( $, undefined ) { + +$.effects.effect.shake = function( o, done ) { + + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "effect" ), + direction = o.direction || "left", + distance = o.distance || 20, + times = o.times || 3, + anims = times * 2 + 1, + speed = Math.round(o.duration/anims), + ref = (direction === "up" || direction === "down") ? "top" : "left", + positiveMotion = (direction === "up" || direction === "left"), + animation = {}, + animation1 = {}, + animation2 = {}, + i, + + // we will need to re-assemble the queue to stack our animations in place + queue = el.queue(), + queuelen = queue.length; + + $.effects.save( el, props ); + el.show(); + $.effects.createWrapper( el ); + + // Animation + animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance; + animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2; + animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2; + + // Animate + el.animate( animation, speed, o.easing ); + + // Shakes + for ( i = 1; i < times; i++ ) { + el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing ); + } + el + .animate( animation1, speed, o.easing ) + .animate( animation, speed / 2, o.easing ) + .queue(function() { + if ( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + }); + + // inject all the animations we just queued to be first in line (after "inprogress") + if ( queuelen > 1) { + queue.splice.apply( queue, + [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); + } + el.dequeue(); + +}; + +})(jQuery); + +(function( $, undefined ) { + +$.effects.effect.slide = function( o, done ) { + + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "width", "height" ], + mode = $.effects.setMode( el, o.mode || "show" ), + show = mode === "show", + direction = o.direction || "left", + ref = (direction === "up" || direction === "down") ? "top" : "left", + positiveMotion = (direction === "up" || direction === "left"), + distance, + animation = {}; + + // Adjust + $.effects.save( el, props ); + el.show(); + distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ); + + $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + + if ( show ) { + el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance ); + } + + // Animation + animation[ ref ] = ( show ? + ( positiveMotion ? "+=" : "-=") : + ( positiveMotion ? "-=" : "+=")) + + distance; + + // Animate + el.animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); +}; + +})(jQuery); + +(function( $, undefined ) { + +$.effects.effect.transfer = function( o, done ) { + var elem = $( this ), + target = $( o.to ), + targetFixed = target.css( "position" ) === "fixed", + body = $("body"), + fixTop = targetFixed ? body.scrollTop() : 0, + fixLeft = targetFixed ? body.scrollLeft() : 0, + endPosition = target.offset(), + animation = { + top: endPosition.top - fixTop , + left: endPosition.left - fixLeft , + height: target.innerHeight(), + width: target.innerWidth() + }, + startPosition = elem.offset(), + transfer = $( '
    ' ) + .appendTo( document.body ) + .addClass( o.className ) + .css({ + top: startPosition.top - fixTop , + left: startPosition.left - fixLeft , + height: elem.innerHeight(), + width: elem.innerWidth(), + position: targetFixed ? "fixed" : "absolute" + }) + .animate( animation, o.duration, o.easing, function() { + transfer.remove(); + done(); + }); +}; + +})(jQuery); + +(function( $, undefined ) { + +var mouseHandled = false; + +$.widget( "ui.menu", { + version: "1.9.2", + defaultElement: "
      ", + delay: 300, + options: { + icons: { + submenu: "ui-icon-carat-1-e" + }, + menus: "ul", + position: { + my: "left top", + at: "right top" + }, + role: "menu", + + // callbacks + blur: null, + focus: null, + select: null + }, + + _create: function() { + this.activeMenu = this.element; + this.element + .uniqueId() + .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) + .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length ) + .attr({ + role: this.options.role, + tabIndex: 0 + }) + // need to catch all clicks on disabled menu + // not possible through _on + .bind( "click" + this.eventNamespace, $.proxy(function( event ) { + if ( this.options.disabled ) { + event.preventDefault(); + } + }, this )); + + if ( this.options.disabled ) { + this.element + .addClass( "ui-state-disabled" ) + .attr( "aria-disabled", "true" ); + } + + this._on({ + // Prevent focus from sticking to links inside menu after clicking + // them (focus should always stay on UL during navigation). + "mousedown .ui-menu-item > a": function( event ) { + event.preventDefault(); + }, + "click .ui-state-disabled > a": function( event ) { + event.preventDefault(); + }, + "click .ui-menu-item:has(a)": function( event ) { + var target = $( event.target ).closest( ".ui-menu-item" ); + if ( !mouseHandled && target.not( ".ui-state-disabled" ).length ) { + mouseHandled = true; + + this.select( event ); + // Open submenu on click + if ( target.has( ".ui-menu" ).length ) { + this.expand( event ); + } else if ( !this.element.is( ":focus" ) ) { + // Redirect focus to the menu + this.element.trigger( "focus", [ true ] ); + + // If the active item is on the top level, let it stay active. + // Otherwise, blur the active item since it is no longer visible. + if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { + clearTimeout( this.timer ); + } + } + } + }, + "mouseenter .ui-menu-item": function( event ) { + var target = $( event.currentTarget ); + // Remove ui-state-active class from siblings of the newly focused menu item + // to avoid a jump caused by adjacent elements both having a class with a border + target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" ); + this.focus( event, target ); + }, + mouseleave: "collapseAll", + "mouseleave .ui-menu": "collapseAll", + focus: function( event, keepActiveItem ) { + // If there's already an active item, keep it active + // If not, activate the first item + var item = this.active || this.element.children( ".ui-menu-item" ).eq( 0 ); + + if ( !keepActiveItem ) { + this.focus( event, item ); + } + }, + blur: function( event ) { + this._delay(function() { + if ( !$.contains( this.element[0], this.document[0].activeElement ) ) { + this.collapseAll( event ); + } + }); + }, + keydown: "_keydown" + }); + + this.refresh(); + + // Clicks outside of a menu collapse any open menus + this._on( this.document, { + click: function( event ) { + if ( !$( event.target ).closest( ".ui-menu" ).length ) { + this.collapseAll( event ); + } + + // Reset the mouseHandled flag + mouseHandled = false; + } + }); + }, + + _destroy: function() { + // Destroy (sub)menus + this.element + .removeAttr( "aria-activedescendant" ) + .find( ".ui-menu" ).andSelf() + .removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" ) + .removeAttr( "role" ) + .removeAttr( "tabIndex" ) + .removeAttr( "aria-labelledby" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "aria-hidden" ) + .removeAttr( "aria-disabled" ) + .removeUniqueId() + .show(); + + // Destroy menu items + this.element.find( ".ui-menu-item" ) + .removeClass( "ui-menu-item" ) + .removeAttr( "role" ) + .removeAttr( "aria-disabled" ) + .children( "a" ) + .removeUniqueId() + .removeClass( "ui-corner-all ui-state-hover" ) + .removeAttr( "tabIndex" ) + .removeAttr( "role" ) + .removeAttr( "aria-haspopup" ) + .children().each( function() { + var elem = $( this ); + if ( elem.data( "ui-menu-submenu-carat" ) ) { + elem.remove(); + } + }); + + // Destroy menu dividers + this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" ); + }, + + _keydown: function( event ) { + var match, prev, character, skip, regex, + preventDefault = true; + + function escape( value ) { + return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ); + } + + switch ( event.keyCode ) { + case $.ui.keyCode.PAGE_UP: + this.previousPage( event ); + break; + case $.ui.keyCode.PAGE_DOWN: + this.nextPage( event ); + break; + case $.ui.keyCode.HOME: + this._move( "first", "first", event ); + break; + case $.ui.keyCode.END: + this._move( "last", "last", event ); + break; + case $.ui.keyCode.UP: + this.previous( event ); + break; + case $.ui.keyCode.DOWN: + this.next( event ); + break; + case $.ui.keyCode.LEFT: + this.collapse( event ); + break; + case $.ui.keyCode.RIGHT: + if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { + this.expand( event ); + } + break; + case $.ui.keyCode.ENTER: + case $.ui.keyCode.SPACE: + this._activate( event ); + break; + case $.ui.keyCode.ESCAPE: + this.collapse( event ); + break; + default: + preventDefault = false; + prev = this.previousFilter || ""; + character = String.fromCharCode( event.keyCode ); + skip = false; + + clearTimeout( this.filterTimer ); + + if ( character === prev ) { + skip = true; + } else { + character = prev + character; + } + + regex = new RegExp( "^" + escape( character ), "i" ); + match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { + return regex.test( $( this ).children( "a" ).text() ); + }); + match = skip && match.index( this.active.next() ) !== -1 ? + this.active.nextAll( ".ui-menu-item" ) : + match; + + // If no matches on the current filter, reset to the last character pressed + // to move down the menu to the first item that starts with that character + if ( !match.length ) { + character = String.fromCharCode( event.keyCode ); + regex = new RegExp( "^" + escape( character ), "i" ); + match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { + return regex.test( $( this ).children( "a" ).text() ); + }); + } + + if ( match.length ) { + this.focus( event, match ); + if ( match.length > 1 ) { + this.previousFilter = character; + this.filterTimer = this._delay(function() { + delete this.previousFilter; + }, 1000 ); + } else { + delete this.previousFilter; + } + } else { + delete this.previousFilter; + } + } + + if ( preventDefault ) { + event.preventDefault(); + } + }, + + _activate: function( event ) { + if ( !this.active.is( ".ui-state-disabled" ) ) { + if ( this.active.children( "a[aria-haspopup='true']" ).length ) { + this.expand( event ); + } else { + this.select( event ); + } + } + }, + + refresh: function() { + var menus, + icon = this.options.icons.submenu, + submenus = this.element.find( this.options.menus ); + + // Initialize nested menus + submenus.filter( ":not(.ui-menu)" ) + .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) + .hide() + .attr({ + role: this.options.role, + "aria-hidden": "true", + "aria-expanded": "false" + }) + .each(function() { + var menu = $( this ), + item = menu.prev( "a" ), + submenuCarat = $( "" ) + .addClass( "ui-menu-icon ui-icon " + icon ) + .data( "ui-menu-submenu-carat", true ); + + item + .attr( "aria-haspopup", "true" ) + .prepend( submenuCarat ); + menu.attr( "aria-labelledby", item.attr( "id" ) ); + }); + + menus = submenus.add( this.element ); + + // Don't refresh list items that are already adapted + menus.children( ":not(.ui-menu-item):has(a)" ) + .addClass( "ui-menu-item" ) + .attr( "role", "presentation" ) + .children( "a" ) + .uniqueId() + .addClass( "ui-corner-all" ) + .attr({ + tabIndex: -1, + role: this._itemRole() + }); + + // Initialize unlinked menu-items containing spaces and/or dashes only as dividers + menus.children( ":not(.ui-menu-item)" ).each(function() { + var item = $( this ); + // hyphen, em dash, en dash + if ( !/[^\-—–\s]/.test( item.text() ) ) { + item.addClass( "ui-widget-content ui-menu-divider" ); + } + }); + + // Add aria-disabled attribute to any disabled menu item + menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); + + // If the active item has been removed, blur the menu + if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { + this.blur(); + } + }, + + _itemRole: function() { + return { + menu: "menuitem", + listbox: "option" + }[ this.options.role ]; + }, + + focus: function( event, item ) { + var nested, focused; + this.blur( event, event && event.type === "focus" ); + + this._scrollIntoView( item ); + + this.active = item.first(); + focused = this.active.children( "a" ).addClass( "ui-state-focus" ); + // Only update aria-activedescendant if there's a role + // otherwise we assume focus is managed elsewhere + if ( this.options.role ) { + this.element.attr( "aria-activedescendant", focused.attr( "id" ) ); + } + + // Highlight active parent menu item, if any + this.active + .parent() + .closest( ".ui-menu-item" ) + .children( "a:first" ) + .addClass( "ui-state-active" ); + + if ( event && event.type === "keydown" ) { + this._close(); + } else { + this.timer = this._delay(function() { + this._close(); + }, this.delay ); + } + + nested = item.children( ".ui-menu" ); + if ( nested.length && ( /^mouse/.test( event.type ) ) ) { + this._startOpening(nested); + } + this.activeMenu = item.parent(); + + this._trigger( "focus", event, { item: item } ); + }, + + _scrollIntoView: function( item ) { + var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight; + if ( this._hasScroll() ) { + borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0; + paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0; + offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop; + scroll = this.activeMenu.scrollTop(); + elementHeight = this.activeMenu.height(); + itemHeight = item.height(); + + if ( offset < 0 ) { + this.activeMenu.scrollTop( scroll + offset ); + } else if ( offset + itemHeight > elementHeight ) { + this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight ); + } + } + }, + + blur: function( event, fromFocus ) { + if ( !fromFocus ) { + clearTimeout( this.timer ); + } + + if ( !this.active ) { + return; + } + + this.active.children( "a" ).removeClass( "ui-state-focus" ); + this.active = null; + + this._trigger( "blur", event, { item: this.active } ); + }, + + _startOpening: function( submenu ) { + clearTimeout( this.timer ); + + // Don't open if already open fixes a Firefox bug that caused a .5 pixel + // shift in the submenu position when mousing over the carat icon + if ( submenu.attr( "aria-hidden" ) !== "true" ) { + return; + } + + this.timer = this._delay(function() { + this._close(); + this._open( submenu ); + }, this.delay ); + }, + + _open: function( submenu ) { + var position = $.extend({ + of: this.active + }, this.options.position ); + + clearTimeout( this.timer ); + this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) ) + .hide() + .attr( "aria-hidden", "true" ); + + submenu + .show() + .removeAttr( "aria-hidden" ) + .attr( "aria-expanded", "true" ) + .position( position ); + }, + + collapseAll: function( event, all ) { + clearTimeout( this.timer ); + this.timer = this._delay(function() { + // If we were passed an event, look for the submenu that contains the event + var currentMenu = all ? this.element : + $( event && event.target ).closest( this.element.find( ".ui-menu" ) ); + + // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway + if ( !currentMenu.length ) { + currentMenu = this.element; + } + + this._close( currentMenu ); + + this.blur( event ); + this.activeMenu = currentMenu; + }, this.delay ); + }, + + // With no arguments, closes the currently active menu - if nothing is active + // it closes all menus. If passed an argument, it will search for menus BELOW + _close: function( startMenu ) { + if ( !startMenu ) { + startMenu = this.active ? this.active.parent() : this.element; + } + + startMenu + .find( ".ui-menu" ) + .hide() + .attr( "aria-hidden", "true" ) + .attr( "aria-expanded", "false" ) + .end() + .find( "a.ui-state-active" ) + .removeClass( "ui-state-active" ); + }, + + collapse: function( event ) { + var newItem = this.active && + this.active.parent().closest( ".ui-menu-item", this.element ); + if ( newItem && newItem.length ) { + this._close(); + this.focus( event, newItem ); + } + }, + + expand: function( event ) { + var newItem = this.active && + this.active + .children( ".ui-menu " ) + .children( ".ui-menu-item" ) + .first(); + + if ( newItem && newItem.length ) { + this._open( newItem.parent() ); + + // Delay so Firefox will not hide activedescendant change in expanding submenu from AT + this._delay(function() { + this.focus( event, newItem ); + }); + } + }, + + next: function( event ) { + this._move( "next", "first", event ); + }, + + previous: function( event ) { + this._move( "prev", "last", event ); + }, + + isFirstItem: function() { + return this.active && !this.active.prevAll( ".ui-menu-item" ).length; + }, + + isLastItem: function() { + return this.active && !this.active.nextAll( ".ui-menu-item" ).length; + }, + + _move: function( direction, filter, event ) { + var next; + if ( this.active ) { + if ( direction === "first" || direction === "last" ) { + next = this.active + [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" ) + .eq( -1 ); + } else { + next = this.active + [ direction + "All" ]( ".ui-menu-item" ) + .eq( 0 ); + } + } + if ( !next || !next.length || !this.active ) { + next = this.activeMenu.children( ".ui-menu-item" )[ filter ](); + } + + this.focus( event, next ); + }, + + nextPage: function( event ) { + var item, base, height; + + if ( !this.active ) { + this.next( event ); + return; + } + if ( this.isLastItem() ) { + return; + } + if ( this._hasScroll() ) { + base = this.active.offset().top; + height = this.element.height(); + this.active.nextAll( ".ui-menu-item" ).each(function() { + item = $( this ); + return item.offset().top - base - height < 0; + }); + + this.focus( event, item ); + } else { + this.focus( event, this.activeMenu.children( ".ui-menu-item" ) + [ !this.active ? "first" : "last" ]() ); + } + }, + + previousPage: function( event ) { + var item, base, height; + if ( !this.active ) { + this.next( event ); + return; + } + if ( this.isFirstItem() ) { + return; + } + if ( this._hasScroll() ) { + base = this.active.offset().top; + height = this.element.height(); + this.active.prevAll( ".ui-menu-item" ).each(function() { + item = $( this ); + return item.offset().top - base + height > 0; + }); + + this.focus( event, item ); + } else { + this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() ); + } + }, + + _hasScroll: function() { + return this.element.outerHeight() < this.element.prop( "scrollHeight" ); + }, + + select: function( event ) { + // TODO: It should never be possible to not have an active item at this + // point, but the tests don't trigger mouseenter before click. + this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); + var ui = { item: this.active }; + if ( !this.active.has( ".ui-menu" ).length ) { + this.collapseAll( event, true ); + } + this._trigger( "select", event, ui ); + } +}); + +}( jQuery )); + +(function( $, undefined ) { + +$.ui = $.ui || {}; + +var cachedScrollbarWidth, + max = Math.max, + abs = Math.abs, + round = Math.round, + rhorizontal = /left|center|right/, + rvertical = /top|center|bottom/, + roffset = /[\+\-]\d+%?/, + rposition = /^\w+/, + rpercent = /%$/, + _position = $.fn.position; + +function getOffsets( offsets, width, height ) { + return [ + parseInt( offsets[ 0 ], 10 ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), + parseInt( offsets[ 1 ], 10 ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) + ]; +} +function parseCss( element, property ) { + return parseInt( $.css( element, property ), 10 ) || 0; +} + +$.position = { + scrollbarWidth: function() { + if ( cachedScrollbarWidth !== undefined ) { + return cachedScrollbarWidth; + } + var w1, w2, + div = $( "
      " ), + innerDiv = div.children()[0]; + + $( "body" ).append( div ); + w1 = innerDiv.offsetWidth; + div.css( "overflow", "scroll" ); + + w2 = innerDiv.offsetWidth; + + if ( w1 === w2 ) { + w2 = div[0].clientWidth; + } + + div.remove(); + + return (cachedScrollbarWidth = w1 - w2); + }, + getScrollInfo: function( within ) { + var overflowX = within.isWindow ? "" : within.element.css( "overflow-x" ), + overflowY = within.isWindow ? "" : within.element.css( "overflow-y" ), + hasOverflowX = overflowX === "scroll" || + ( overflowX === "auto" && within.width < within.element[0].scrollWidth ), + hasOverflowY = overflowY === "scroll" || + ( overflowY === "auto" && within.height < within.element[0].scrollHeight ); + return { + width: hasOverflowX ? $.position.scrollbarWidth() : 0, + height: hasOverflowY ? $.position.scrollbarWidth() : 0 + }; + }, + getWithinInfo: function( element ) { + var withinElement = $( element || window ), + isWindow = $.isWindow( withinElement[0] ); + return { + element: withinElement, + isWindow: isWindow, + offset: withinElement.offset() || { left: 0, top: 0 }, + scrollLeft: withinElement.scrollLeft(), + scrollTop: withinElement.scrollTop(), + width: isWindow ? withinElement.width() : withinElement.outerWidth(), + height: isWindow ? withinElement.height() : withinElement.outerHeight() + }; + } +}; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var atOffset, targetWidth, targetHeight, targetOffset, basePosition, + target = $( options.of ), + within = $.position.getWithinInfo( options.within ), + scrollInfo = $.position.getScrollInfo( within ), + targetElem = target[0], + collision = ( options.collision || "flip" ).split( " " ), + offsets = {}; + + if ( targetElem.nodeType === 9 ) { + targetWidth = target.width(); + targetHeight = target.height(); + targetOffset = { top: 0, left: 0 }; + } else if ( $.isWindow( targetElem ) ) { + targetWidth = target.width(); + targetHeight = target.height(); + targetOffset = { top: target.scrollTop(), left: target.scrollLeft() }; + } else if ( targetElem.preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + targetWidth = targetHeight = 0; + targetOffset = { top: targetElem.pageY, left: targetElem.pageX }; + } else { + targetWidth = target.outerWidth(); + targetHeight = target.outerHeight(); + targetOffset = target.offset(); + } + // clone to reuse original targetOffset later + basePosition = $.extend( {}, targetOffset ); + + // force my and at to have valid horizontal and vertical positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[ this ] || "" ).split( " " ), + horizontalOffset, + verticalOffset; + + if ( pos.length === 1) { + pos = rhorizontal.test( pos[ 0 ] ) ? + pos.concat( [ "center" ] ) : + rvertical.test( pos[ 0 ] ) ? + [ "center" ].concat( pos ) : + [ "center", "center" ]; + } + pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; + pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; + + // calculate offsets + horizontalOffset = roffset.exec( pos[ 0 ] ); + verticalOffset = roffset.exec( pos[ 1 ] ); + offsets[ this ] = [ + horizontalOffset ? horizontalOffset[ 0 ] : 0, + verticalOffset ? verticalOffset[ 0 ] : 0 + ]; + + // reduce to just the positions without the offsets + options[ this ] = [ + rposition.exec( pos[ 0 ] )[ 0 ], + rposition.exec( pos[ 1 ] )[ 0 ] + ]; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + if ( options.at[ 0 ] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[ 0 ] === "center" ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[ 1 ] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[ 1 ] === "center" ) { + basePosition.top += targetHeight / 2; + } + + atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); + basePosition.left += atOffset[ 0 ]; + basePosition.top += atOffset[ 1 ]; + + return this.each(function() { + var collisionPosition, using, + elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseCss( this, "marginLeft" ), + marginTop = parseCss( this, "marginTop" ), + collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, + collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, + position = $.extend( {}, basePosition ), + myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); + + if ( options.my[ 0 ] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[ 0 ] === "center" ) { + position.left -= elemWidth / 2; + } + + if ( options.my[ 1 ] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[ 1 ] === "center" ) { + position.top -= elemHeight / 2; + } + + position.left += myOffset[ 0 ]; + position.top += myOffset[ 1 ]; + + // if the browser doesn't support fractions, then round for consistent results + if ( !$.support.offsetFractions ) { + position.left = round( position.left ); + position.top = round( position.top ); + } + + collisionPosition = { + marginLeft: marginLeft, + marginTop: marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[ i ] ] ) { + $.ui.position[ collision[ i ] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], + my: options.my, + at: options.at, + within: within, + elem : elem + }); + } + }); + + if ( $.fn.bgiframe ) { + elem.bgiframe(); + } + + if ( options.using ) { + // adds feedback as second argument to using callback, if present + using = function( props ) { + var left = targetOffset.left - position.left, + right = left + targetWidth - elemWidth, + top = targetOffset.top - position.top, + bottom = top + targetHeight - elemHeight, + feedback = { + target: { + element: target, + left: targetOffset.left, + top: targetOffset.top, + width: targetWidth, + height: targetHeight + }, + element: { + element: elem, + left: position.left, + top: position.top, + width: elemWidth, + height: elemHeight + }, + horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", + vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" + }; + if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { + feedback.horizontal = "center"; + } + if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { + feedback.vertical = "middle"; + } + if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { + feedback.important = "horizontal"; + } else { + feedback.important = "vertical"; + } + options.using.call( this, props, feedback ); + }; + } + + elem.offset( $.extend( position, { using: using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, + outerWidth = within.width, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = withinOffset - collisionPosLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, + newOverRight; + + // element is wider than within + if ( data.collisionWidth > outerWidth ) { + // element is initially over the left side of within + if ( overLeft > 0 && overRight <= 0 ) { + newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; + position.left += overLeft - newOverRight; + // element is initially over right side of within + } else if ( overRight > 0 && overLeft <= 0 ) { + position.left = withinOffset; + // element is initially over both left and right sides of within + } else { + if ( overLeft > overRight ) { + position.left = withinOffset + outerWidth - data.collisionWidth; + } else { + position.left = withinOffset; + } + } + // too far left -> align with left edge + } else if ( overLeft > 0 ) { + position.left += overLeft; + // too far right -> align with right edge + } else if ( overRight > 0 ) { + position.left -= overRight; + // adjust based on position and margin + } else { + position.left = max( position.left - collisionPosLeft, position.left ); + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollTop : within.offset.top, + outerHeight = data.within.height, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = withinOffset - collisionPosTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, + newOverBottom; + + // element is taller than within + if ( data.collisionHeight > outerHeight ) { + // element is initially over the top of within + if ( overTop > 0 && overBottom <= 0 ) { + newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; + position.top += overTop - newOverBottom; + // element is initially over bottom of within + } else if ( overBottom > 0 && overTop <= 0 ) { + position.top = withinOffset; + // element is initially over both top and bottom of within + } else { + if ( overTop > overBottom ) { + position.top = withinOffset + outerHeight - data.collisionHeight; + } else { + position.top = withinOffset; + } + } + // too far up -> align with top + } else if ( overTop > 0 ) { + position.top += overTop; + // too far down -> align with bottom edge + } else if ( overBottom > 0 ) { + position.top -= overBottom; + // adjust based on position and margin + } else { + position.top = max( position.top - collisionPosTop, position.top ); + } + } + }, + flip: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.offset.left + within.scrollLeft, + outerWidth = within.width, + offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = collisionPosLeft - offsetLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + data.at[ 0 ] === "right" ? + -data.targetWidth : + 0, + offset = -2 * data.offset[ 0 ], + newOverRight, + newOverLeft; + + if ( overLeft < 0 ) { + newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; + if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { + position.left += myOffset + atOffset + offset; + } + } + else if ( overRight > 0 ) { + newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; + if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { + position.left += myOffset + atOffset + offset; + } + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.offset.top + within.scrollTop, + outerHeight = within.height, + offsetTop = within.isWindow ? within.scrollTop : within.offset.top, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = collisionPosTop - offsetTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, + top = data.my[ 1 ] === "top", + myOffset = top ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + data.at[ 1 ] === "bottom" ? + -data.targetHeight : + 0, + offset = -2 * data.offset[ 1 ], + newOverTop, + newOverBottom; + if ( overTop < 0 ) { + newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; + if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) { + position.top += myOffset + atOffset + offset; + } + } + else if ( overBottom > 0 ) { + newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; + if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) { + position.top += myOffset + atOffset + offset; + } + } + } + }, + flipfit: { + left: function() { + $.ui.position.flip.left.apply( this, arguments ); + $.ui.position.fit.left.apply( this, arguments ); + }, + top: function() { + $.ui.position.flip.top.apply( this, arguments ); + $.ui.position.fit.top.apply( this, arguments ); + } + } +}; + +// fraction support test +(function () { + var testElement, testElementParent, testElementStyle, offsetLeft, i, + body = document.getElementsByTagName( "body" )[ 0 ], + div = document.createElement( "div" ); + + //Create a "fake body" for testing based on method used in jQuery.support + testElement = document.createElement( body ? "div" : "body" ); + testElementStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if ( body ) { + $.extend( testElementStyle, { + position: "absolute", + left: "-1000px", + top: "-1000px" + }); + } + for ( i in testElementStyle ) { + testElement.style[ i ] = testElementStyle[ i ]; + } + testElement.appendChild( div ); + testElementParent = body || document.documentElement; + testElementParent.insertBefore( testElement, testElementParent.firstChild ); + + div.style.cssText = "position: absolute; left: 10.7432222px;"; + + offsetLeft = $( div ).offset().left; + $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11; + + testElement.innerHTML = ""; + testElementParent.removeChild( testElement ); +})(); + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + // offset option + (function( $ ) { + var _position = $.fn.position; + $.fn.position = function( options ) { + if ( !options || !options.offset ) { + return _position.call( this, options ); + } + var offset = options.offset.split( " " ), + at = options.at.split( " " ); + if ( offset.length === 1 ) { + offset[ 1 ] = offset[ 0 ]; + } + if ( /^\d/.test( offset[ 0 ] ) ) { + offset[ 0 ] = "+" + offset[ 0 ]; + } + if ( /^\d/.test( offset[ 1 ] ) ) { + offset[ 1 ] = "+" + offset[ 1 ]; + } + if ( at.length === 1 ) { + if ( /left|center|right/.test( at[ 0 ] ) ) { + at[ 1 ] = "center"; + } else { + at[ 1 ] = at[ 0 ]; + at[ 0 ] = "center"; + } + } + return _position.call( this, $.extend( options, { + at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ], + offset: undefined + } ) ); + }; + }( jQuery ) ); +} + +}( jQuery ) ); + +(function( $, undefined ) { + +$.widget( "ui.progressbar", { + version: "1.9.2", + options: { + value: 0, + max: 100 + }, + + min: 0, + + _create: function() { + this.element + .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .attr({ + role: "progressbar", + "aria-valuemin": this.min, + "aria-valuemax": this.options.max, + "aria-valuenow": this._value() + }); + + this.valueDiv = $( "
      " ) + .appendTo( this.element ); + + this.oldValue = this._value(); + this._refreshValue(); + }, + + _destroy: function() { + this.element + .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .removeAttr( "role" ) + .removeAttr( "aria-valuemin" ) + .removeAttr( "aria-valuemax" ) + .removeAttr( "aria-valuenow" ); + + this.valueDiv.remove(); + }, + + value: function( newValue ) { + if ( newValue === undefined ) { + return this._value(); + } + + this._setOption( "value", newValue ); + return this; + }, + + _setOption: function( key, value ) { + if ( key === "value" ) { + this.options.value = value; + this._refreshValue(); + if ( this._value() === this.options.max ) { + this._trigger( "complete" ); + } + } + + this._super( key, value ); + }, + + _value: function() { + var val = this.options.value; + // normalize invalid value + if ( typeof val !== "number" ) { + val = 0; + } + return Math.min( this.options.max, Math.max( this.min, val ) ); + }, + + _percentage: function() { + return 100 * this._value() / this.options.max; + }, + + _refreshValue: function() { + var value = this.value(), + percentage = this._percentage(); + + if ( this.oldValue !== value ) { + this.oldValue = value; + this._trigger( "change" ); + } + + this.valueDiv + .toggle( value > this.min ) + .toggleClass( "ui-corner-right", value === this.options.max ) + .width( percentage.toFixed(0) + "%" ); + this.element.attr( "aria-valuenow", value ); + } +}); + +})( jQuery ); + +(function( $, undefined ) { + +// number of pages in a slider +// (how many times can you page up/down to go through the whole range) +var numPages = 5; + +$.widget( "ui.slider", $.ui.mouse, { + version: "1.9.2", + widgetEventPrefix: "slide", + + options: { + animate: false, + distance: 0, + max: 100, + min: 0, + orientation: "horizontal", + range: false, + step: 1, + value: 0, + values: null + }, + + _create: function() { + var i, handleCount, + o = this.options, + existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), + handle = "", + handles = []; + + this._keySliding = false; + this._mouseSliding = false; + this._animateOff = true; + this._handleIndex = null; + this._detectOrientation(); + this._mouseInit(); + + this.element + .addClass( "ui-slider" + + " ui-slider-" + this.orientation + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" + + ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) ); + + this.range = $([]); + + if ( o.range ) { + if ( o.range === true ) { + if ( !o.values ) { + o.values = [ this._valueMin(), this._valueMin() ]; + } + if ( o.values.length && o.values.length !== 2 ) { + o.values = [ o.values[0], o.values[0] ]; + } + } + + this.range = $( "
      " ) + .appendTo( this.element ) + .addClass( "ui-slider-range" + + // note: this isn't the most fittingly semantic framework class for this element, + // but worked best visually with a variety of themes + " ui-widget-header" + + ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) ); + } + + handleCount = ( o.values && o.values.length ) || 1; + + for ( i = existingHandles.length; i < handleCount; i++ ) { + handles.push( handle ); + } + + this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) ); + + this.handle = this.handles.eq( 0 ); + + this.handles.add( this.range ).filter( "a" ) + .click(function( event ) { + event.preventDefault(); + }) + .mouseenter(function() { + if ( !o.disabled ) { + $( this ).addClass( "ui-state-hover" ); + } + }) + .mouseleave(function() { + $( this ).removeClass( "ui-state-hover" ); + }) + .focus(function() { + if ( !o.disabled ) { + $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" ); + $( this ).addClass( "ui-state-focus" ); + } else { + $( this ).blur(); + } + }) + .blur(function() { + $( this ).removeClass( "ui-state-focus" ); + }); + + this.handles.each(function( i ) { + $( this ).data( "ui-slider-handle-index", i ); + }); + + this._on( this.handles, { + keydown: function( event ) { + var allowed, curVal, newVal, step, + index = $( event.target ).data( "ui-slider-handle-index" ); + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + case $.ui.keyCode.END: + case $.ui.keyCode.PAGE_UP: + case $.ui.keyCode.PAGE_DOWN: + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + event.preventDefault(); + if ( !this._keySliding ) { + this._keySliding = true; + $( event.target ).addClass( "ui-state-active" ); + allowed = this._start( event, index ); + if ( allowed === false ) { + return; + } + } + break; + } + + step = this.options.step; + if ( this.options.values && this.options.values.length ) { + curVal = newVal = this.values( index ); + } else { + curVal = newVal = this.value(); + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + newVal = this._valueMin(); + break; + case $.ui.keyCode.END: + newVal = this._valueMax(); + break; + case $.ui.keyCode.PAGE_UP: + newVal = this._trimAlignValue( curVal + ( (this._valueMax() - this._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.PAGE_DOWN: + newVal = this._trimAlignValue( curVal - ( (this._valueMax() - this._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + if ( curVal === this._valueMax() ) { + return; + } + newVal = this._trimAlignValue( curVal + step ); + break; + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + if ( curVal === this._valueMin() ) { + return; + } + newVal = this._trimAlignValue( curVal - step ); + break; + } + + this._slide( event, index, newVal ); + }, + keyup: function( event ) { + var index = $( event.target ).data( "ui-slider-handle-index" ); + + if ( this._keySliding ) { + this._keySliding = false; + this._stop( event, index ); + this._change( event, index ); + $( event.target ).removeClass( "ui-state-active" ); + } + } + }); + + this._refreshValue(); + + this._animateOff = false; + }, + + _destroy: function() { + this.handles.remove(); + this.range.remove(); + + this.element + .removeClass( "ui-slider" + + " ui-slider-horizontal" + + " ui-slider-vertical" + + " ui-slider-disabled" + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" ); + + this._mouseDestroy(); + }, + + _mouseCapture: function( event ) { + var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle, + that = this, + o = this.options; + + if ( o.disabled ) { + return false; + } + + this.elementSize = { + width: this.element.outerWidth(), + height: this.element.outerHeight() + }; + this.elementOffset = this.element.offset(); + + position = { x: event.pageX, y: event.pageY }; + normValue = this._normValueFromMouse( position ); + distance = this._valueMax() - this._valueMin() + 1; + this.handles.each(function( i ) { + var thisDistance = Math.abs( normValue - that.values(i) ); + if ( distance > thisDistance ) { + distance = thisDistance; + closestHandle = $( this ); + index = i; + } + }); + + // workaround for bug #3736 (if both handles of a range are at 0, + // the first is always used as the one with least distance, + // and moving it is obviously prevented by preventing negative ranges) + if( o.range === true && this.values(1) === o.min ) { + index += 1; + closestHandle = $( this.handles[index] ); + } + + allowed = this._start( event, index ); + if ( allowed === false ) { + return false; + } + this._mouseSliding = true; + + this._handleIndex = index; + + closestHandle + .addClass( "ui-state-active" ) + .focus(); + + offset = closestHandle.offset(); + mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" ); + this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { + left: event.pageX - offset.left - ( closestHandle.width() / 2 ), + top: event.pageY - offset.top - + ( closestHandle.height() / 2 ) - + ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) - + ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) + + ( parseInt( closestHandle.css("marginTop"), 10 ) || 0) + }; + + if ( !this.handles.hasClass( "ui-state-hover" ) ) { + this._slide( event, index, normValue ); + } + this._animateOff = true; + return true; + }, + + _mouseStart: function() { + return true; + }, + + _mouseDrag: function( event ) { + var position = { x: event.pageX, y: event.pageY }, + normValue = this._normValueFromMouse( position ); + + this._slide( event, this._handleIndex, normValue ); + + return false; + }, + + _mouseStop: function( event ) { + this.handles.removeClass( "ui-state-active" ); + this._mouseSliding = false; + + this._stop( event, this._handleIndex ); + this._change( event, this._handleIndex ); + + this._handleIndex = null; + this._clickOffset = null; + this._animateOff = false; + + return false; + }, + + _detectOrientation: function() { + this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; + }, + + _normValueFromMouse: function( position ) { + var pixelTotal, + pixelMouse, + percentMouse, + valueTotal, + valueMouse; + + if ( this.orientation === "horizontal" ) { + pixelTotal = this.elementSize.width; + pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); + } else { + pixelTotal = this.elementSize.height; + pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); + } + + percentMouse = ( pixelMouse / pixelTotal ); + if ( percentMouse > 1 ) { + percentMouse = 1; + } + if ( percentMouse < 0 ) { + percentMouse = 0; + } + if ( this.orientation === "vertical" ) { + percentMouse = 1 - percentMouse; + } + + valueTotal = this._valueMax() - this._valueMin(); + valueMouse = this._valueMin() + percentMouse * valueTotal; + + return this._trimAlignValue( valueMouse ); + }, + + _start: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + return this._trigger( "start", event, uiHash ); + }, + + _slide: function( event, index, newVal ) { + var otherVal, + newValues, + allowed; + + if ( this.options.values && this.options.values.length ) { + otherVal = this.values( index ? 0 : 1 ); + + if ( ( this.options.values.length === 2 && this.options.range === true ) && + ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) ) + ) { + newVal = otherVal; + } + + if ( newVal !== this.values( index ) ) { + newValues = this.values(); + newValues[ index ] = newVal; + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal, + values: newValues + } ); + otherVal = this.values( index ? 0 : 1 ); + if ( allowed !== false ) { + this.values( index, newVal, true ); + } + } + } else { + if ( newVal !== this.value() ) { + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal + } ); + if ( allowed !== false ) { + this.value( newVal ); + } + } + } + }, + + _stop: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "stop", event, uiHash ); + }, + + _change: function( event, index ) { + if ( !this._keySliding && !this._mouseSliding ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "change", event, uiHash ); + } + }, + + value: function( newValue ) { + if ( arguments.length ) { + this.options.value = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, 0 ); + return; + } + + return this._value(); + }, + + values: function( index, newValue ) { + var vals, + newValues, + i; + + if ( arguments.length > 1 ) { + this.options.values[ index ] = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, index ); + return; + } + + if ( arguments.length ) { + if ( $.isArray( arguments[ 0 ] ) ) { + vals = this.options.values; + newValues = arguments[ 0 ]; + for ( i = 0; i < vals.length; i += 1 ) { + vals[ i ] = this._trimAlignValue( newValues[ i ] ); + this._change( null, i ); + } + this._refreshValue(); + } else { + if ( this.options.values && this.options.values.length ) { + return this._values( index ); + } else { + return this.value(); + } + } + } else { + return this._values(); + } + }, + + _setOption: function( key, value ) { + var i, + valsLength = 0; + + if ( $.isArray( this.options.values ) ) { + valsLength = this.options.values.length; + } + + $.Widget.prototype._setOption.apply( this, arguments ); + + switch ( key ) { + case "disabled": + if ( value ) { + this.handles.filter( ".ui-state-focus" ).blur(); + this.handles.removeClass( "ui-state-hover" ); + this.handles.prop( "disabled", true ); + this.element.addClass( "ui-disabled" ); + } else { + this.handles.prop( "disabled", false ); + this.element.removeClass( "ui-disabled" ); + } + break; + case "orientation": + this._detectOrientation(); + this.element + .removeClass( "ui-slider-horizontal ui-slider-vertical" ) + .addClass( "ui-slider-" + this.orientation ); + this._refreshValue(); + break; + case "value": + this._animateOff = true; + this._refreshValue(); + this._change( null, 0 ); + this._animateOff = false; + break; + case "values": + this._animateOff = true; + this._refreshValue(); + for ( i = 0; i < valsLength; i += 1 ) { + this._change( null, i ); + } + this._animateOff = false; + break; + case "min": + case "max": + this._animateOff = true; + this._refreshValue(); + this._animateOff = false; + break; + } + }, + + //internal value getter + // _value() returns value trimmed by min and max, aligned by step + _value: function() { + var val = this.options.value; + val = this._trimAlignValue( val ); + + return val; + }, + + //internal values getter + // _values() returns array of values trimmed by min and max, aligned by step + // _values( index ) returns single value trimmed by min and max, aligned by step + _values: function( index ) { + var val, + vals, + i; + + if ( arguments.length ) { + val = this.options.values[ index ]; + val = this._trimAlignValue( val ); + + return val; + } else { + // .slice() creates a copy of the array + // this copy gets trimmed by min and max and then returned + vals = this.options.values.slice(); + for ( i = 0; i < vals.length; i+= 1) { + vals[ i ] = this._trimAlignValue( vals[ i ] ); + } + + return vals; + } + }, + + // returns the step-aligned value that val is closest to, between (inclusive) min and max + _trimAlignValue: function( val ) { + if ( val <= this._valueMin() ) { + return this._valueMin(); + } + if ( val >= this._valueMax() ) { + return this._valueMax(); + } + var step = ( this.options.step > 0 ) ? this.options.step : 1, + valModStep = (val - this._valueMin()) % step, + alignValue = val - valModStep; + + if ( Math.abs(valModStep) * 2 >= step ) { + alignValue += ( valModStep > 0 ) ? step : ( -step ); + } + + // Since JavaScript has problems with large floats, round + // the final value to 5 digits after the decimal point (see #4124) + return parseFloat( alignValue.toFixed(5) ); + }, + + _valueMin: function() { + return this.options.min; + }, + + _valueMax: function() { + return this.options.max; + }, + + _refreshValue: function() { + var lastValPercent, valPercent, value, valueMin, valueMax, + oRange = this.options.range, + o = this.options, + that = this, + animate = ( !this._animateOff ) ? o.animate : false, + _set = {}; + + if ( this.options.values && this.options.values.length ) { + this.handles.each(function( i ) { + valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100; + _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + if ( that.options.range === true ) { + if ( that.orientation === "horizontal" ) { + if ( i === 0 ) { + that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); + } + if ( i === 1 ) { + that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } else { + if ( i === 0 ) { + that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); + } + if ( i === 1 ) { + that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + lastValPercent = valPercent; + }); + } else { + value = this.value(); + valueMin = this._valueMin(); + valueMax = this._valueMax(); + valPercent = ( valueMax !== valueMin ) ? + ( value - valueMin ) / ( valueMax - valueMin ) * 100 : + 0; + _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + + if ( oRange === "min" && this.orientation === "horizontal" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "horizontal" ) { + this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + if ( oRange === "min" && this.orientation === "vertical" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "vertical" ) { + this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + +}); + +}(jQuery)); + +(function( $ ) { + +function modifier( fn ) { + return function() { + var previous = this.element.val(); + fn.apply( this, arguments ); + this._refresh(); + if ( previous !== this.element.val() ) { + this._trigger( "change" ); + } + }; +} + +$.widget( "ui.spinner", { + version: "1.9.2", + defaultElement: "", + widgetEventPrefix: "spin", + options: { + culture: null, + icons: { + down: "ui-icon-triangle-1-s", + up: "ui-icon-triangle-1-n" + }, + incremental: true, + max: null, + min: null, + numberFormat: null, + page: 10, + step: 1, + + change: null, + spin: null, + start: null, + stop: null + }, + + _create: function() { + // handle string values that need to be parsed + this._setOption( "max", this.options.max ); + this._setOption( "min", this.options.min ); + this._setOption( "step", this.options.step ); + + // format the value, but don't constrain + this._value( this.element.val(), true ); + + this._draw(); + this._on( this._events ); + this._refresh(); + + // turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + this._on( this.window, { + beforeunload: function() { + this.element.removeAttr( "autocomplete" ); + } + }); + }, + + _getCreateOptions: function() { + var options = {}, + element = this.element; + + $.each( [ "min", "max", "step" ], function( i, option ) { + var value = element.attr( option ); + if ( value !== undefined && value.length ) { + options[ option ] = value; + } + }); + + return options; + }, + + _events: { + keydown: function( event ) { + if ( this._start( event ) && this._keydown( event ) ) { + event.preventDefault(); + } + }, + keyup: "_stop", + focus: function() { + this.previous = this.element.val(); + }, + blur: function( event ) { + if ( this.cancelBlur ) { + delete this.cancelBlur; + return; + } + + this._refresh(); + if ( this.previous !== this.element.val() ) { + this._trigger( "change", event ); + } + }, + mousewheel: function( event, delta ) { + if ( !delta ) { + return; + } + if ( !this.spinning && !this._start( event ) ) { + return false; + } + + this._spin( (delta > 0 ? 1 : -1) * this.options.step, event ); + clearTimeout( this.mousewheelTimer ); + this.mousewheelTimer = this._delay(function() { + if ( this.spinning ) { + this._stop( event ); + } + }, 100 ); + event.preventDefault(); + }, + "mousedown .ui-spinner-button": function( event ) { + var previous; + + // We never want the buttons to have focus; whenever the user is + // interacting with the spinner, the focus should be on the input. + // If the input is focused then this.previous is properly set from + // when the input first received focus. If the input is not focused + // then we need to set this.previous based on the value before spinning. + previous = this.element[0] === this.document[0].activeElement ? + this.previous : this.element.val(); + function checkFocus() { + var isActive = this.element[0] === this.document[0].activeElement; + if ( !isActive ) { + this.element.focus(); + this.previous = previous; + // support: IE + // IE sets focus asynchronously, so we need to check if focus + // moved off of the input because the user clicked on the button. + this._delay(function() { + this.previous = previous; + }); + } + } + + // ensure focus is on (or stays on) the text field + event.preventDefault(); + checkFocus.call( this ); + + // support: IE + // IE doesn't prevent moving focus even with event.preventDefault() + // so we set a flag to know when we should ignore the blur event + // and check (again) if focus moved off of the input. + this.cancelBlur = true; + this._delay(function() { + delete this.cancelBlur; + checkFocus.call( this ); + }); + + if ( this._start( event ) === false ) { + return; + } + + this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event ); + }, + "mouseup .ui-spinner-button": "_stop", + "mouseenter .ui-spinner-button": function( event ) { + // button will add ui-state-active if mouse was down while mouseleave and kept down + if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) { + return; + } + + if ( this._start( event ) === false ) { + return false; + } + this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event ); + }, + // TODO: do we really want to consider this a stop? + // shouldn't we just stop the repeater and wait until mouseup before + // we trigger the stop event? + "mouseleave .ui-spinner-button": "_stop" + }, + + _draw: function() { + var uiSpinner = this.uiSpinner = this.element + .addClass( "ui-spinner-input" ) + .attr( "autocomplete", "off" ) + .wrap( this._uiSpinnerHtml() ) + .parent() + // add buttons + .append( this._buttonHtml() ); + + this.element.attr( "role", "spinbutton" ); + + // button bindings + this.buttons = uiSpinner.find( ".ui-spinner-button" ) + .attr( "tabIndex", -1 ) + .button() + .removeClass( "ui-corner-all" ); + + // IE 6 doesn't understand height: 50% for the buttons + // unless the wrapper has an explicit height + if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) && + uiSpinner.height() > 0 ) { + uiSpinner.height( uiSpinner.height() ); + } + + // disable spinner if element was already disabled + if ( this.options.disabled ) { + this.disable(); + } + }, + + _keydown: function( event ) { + var options = this.options, + keyCode = $.ui.keyCode; + + switch ( event.keyCode ) { + case keyCode.UP: + this._repeat( null, 1, event ); + return true; + case keyCode.DOWN: + this._repeat( null, -1, event ); + return true; + case keyCode.PAGE_UP: + this._repeat( null, options.page, event ); + return true; + case keyCode.PAGE_DOWN: + this._repeat( null, -options.page, event ); + return true; + } + + return false; + }, + + _uiSpinnerHtml: function() { + return ""; + }, + + _buttonHtml: function() { + return "" + + "" + + "" + + "" + + "" + + "" + + ""; + }, + + _start: function( event ) { + if ( !this.spinning && this._trigger( "start", event ) === false ) { + return false; + } + + if ( !this.counter ) { + this.counter = 1; + } + this.spinning = true; + return true; + }, + + _repeat: function( i, steps, event ) { + i = i || 500; + + clearTimeout( this.timer ); + this.timer = this._delay(function() { + this._repeat( 40, steps, event ); + }, i ); + + this._spin( steps * this.options.step, event ); + }, + + _spin: function( step, event ) { + var value = this.value() || 0; + + if ( !this.counter ) { + this.counter = 1; + } + + value = this._adjustValue( value + step * this._increment( this.counter ) ); + + if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) { + this._value( value ); + this.counter++; + } + }, + + _increment: function( i ) { + var incremental = this.options.incremental; + + if ( incremental ) { + return $.isFunction( incremental ) ? + incremental( i ) : + Math.floor( i*i*i/50000 - i*i/500 + 17*i/200 + 1 ); + } + + return 1; + }, + + _precision: function() { + var precision = this._precisionOf( this.options.step ); + if ( this.options.min !== null ) { + precision = Math.max( precision, this._precisionOf( this.options.min ) ); + } + return precision; + }, + + _precisionOf: function( num ) { + var str = num.toString(), + decimal = str.indexOf( "." ); + return decimal === -1 ? 0 : str.length - decimal - 1; + }, + + _adjustValue: function( value ) { + var base, aboveMin, + options = this.options; + + // make sure we're at a valid step + // - find out where we are relative to the base (min or 0) + base = options.min !== null ? options.min : 0; + aboveMin = value - base; + // - round to the nearest step + aboveMin = Math.round(aboveMin / options.step) * options.step; + // - rounding is based on 0, so adjust back to our base + value = base + aboveMin; + + // fix precision from bad JS floating point math + value = parseFloat( value.toFixed( this._precision() ) ); + + // clamp the value + if ( options.max !== null && value > options.max) { + return options.max; + } + if ( options.min !== null && value < options.min ) { + return options.min; + } + + return value; + }, + + _stop: function( event ) { + if ( !this.spinning ) { + return; + } + + clearTimeout( this.timer ); + clearTimeout( this.mousewheelTimer ); + this.counter = 0; + this.spinning = false; + this._trigger( "stop", event ); + }, + + _setOption: function( key, value ) { + if ( key === "culture" || key === "numberFormat" ) { + var prevValue = this._parse( this.element.val() ); + this.options[ key ] = value; + this.element.val( this._format( prevValue ) ); + return; + } + + if ( key === "max" || key === "min" || key === "step" ) { + if ( typeof value === "string" ) { + value = this._parse( value ); + } + } + + this._super( key, value ); + + if ( key === "disabled" ) { + if ( value ) { + this.element.prop( "disabled", true ); + this.buttons.button( "disable" ); + } else { + this.element.prop( "disabled", false ); + this.buttons.button( "enable" ); + } + } + }, + + _setOptions: modifier(function( options ) { + this._super( options ); + this._value( this.element.val() ); + }), + + _parse: function( val ) { + if ( typeof val === "string" && val !== "" ) { + val = window.Globalize && this.options.numberFormat ? + Globalize.parseFloat( val, 10, this.options.culture ) : +val; + } + return val === "" || isNaN( val ) ? null : val; + }, + + _format: function( value ) { + if ( value === "" ) { + return ""; + } + return window.Globalize && this.options.numberFormat ? + Globalize.format( value, this.options.numberFormat, this.options.culture ) : + value; + }, + + _refresh: function() { + this.element.attr({ + "aria-valuemin": this.options.min, + "aria-valuemax": this.options.max, + // TODO: what should we do with values that can't be parsed? + "aria-valuenow": this._parse( this.element.val() ) + }); + }, + + // update the value without triggering change + _value: function( value, allowAny ) { + var parsed; + if ( value !== "" ) { + parsed = this._parse( value ); + if ( parsed !== null ) { + if ( !allowAny ) { + parsed = this._adjustValue( parsed ); + } + value = this._format( parsed ); + } + } + this.element.val( value ); + this._refresh(); + }, + + _destroy: function() { + this.element + .removeClass( "ui-spinner-input" ) + .prop( "disabled", false ) + .removeAttr( "autocomplete" ) + .removeAttr( "role" ) + .removeAttr( "aria-valuemin" ) + .removeAttr( "aria-valuemax" ) + .removeAttr( "aria-valuenow" ); + this.uiSpinner.replaceWith( this.element ); + }, + + stepUp: modifier(function( steps ) { + this._stepUp( steps ); + }), + _stepUp: function( steps ) { + this._spin( (steps || 1) * this.options.step ); + }, + + stepDown: modifier(function( steps ) { + this._stepDown( steps ); + }), + _stepDown: function( steps ) { + this._spin( (steps || 1) * -this.options.step ); + }, + + pageUp: modifier(function( pages ) { + this._stepUp( (pages || 1) * this.options.page ); + }), + + pageDown: modifier(function( pages ) { + this._stepDown( (pages || 1) * this.options.page ); + }), + + value: function( newVal ) { + if ( !arguments.length ) { + return this._parse( this.element.val() ); + } + modifier( this._value ).call( this, newVal ); + }, + + widget: function() { + return this.uiSpinner; + } +}); + +}( jQuery ) ); + +(function( $, undefined ) { + +var tabId = 0, + rhash = /#.*$/; + +function getNextTabId() { + return ++tabId; +} + +function isLocal( anchor ) { + return anchor.hash.length > 1 && + anchor.href.replace( rhash, "" ) === + location.href.replace( rhash, "" ) + // support: Safari 5.1 + // Safari 5.1 doesn't encode spaces in window.location + // but it does encode spaces from anchors (#8777) + .replace( /\s/g, "%20" ); +} + +$.widget( "ui.tabs", { + version: "1.9.2", + delay: 300, + options: { + active: null, + collapsible: false, + event: "click", + heightStyle: "content", + hide: null, + show: null, + + // callbacks + activate: null, + beforeActivate: null, + beforeLoad: null, + load: null + }, + + _create: function() { + var that = this, + options = this.options, + active = options.active, + locationHash = location.hash.substring( 1 ); + + this.running = false; + + this.element + .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" ) + .toggleClass( "ui-tabs-collapsible", options.collapsible ) + // Prevent users from focusing disabled tabs via click + .delegate( ".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function( event ) { + if ( $( this ).is( ".ui-state-disabled" ) ) { + event.preventDefault(); + } + }) + // support: IE <9 + // Preventing the default action in mousedown doesn't prevent IE + // from focusing the element, so if the anchor gets focused, blur. + // We don't have to worry about focusing the previously focused + // element since clicking on a non-focusable element should focus + // the body anyway. + .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() { + if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) { + this.blur(); + } + }); + + this._processTabs(); + + if ( active === null ) { + // check the fragment identifier in the URL + if ( locationHash ) { + this.tabs.each(function( i, tab ) { + if ( $( tab ).attr( "aria-controls" ) === locationHash ) { + active = i; + return false; + } + }); + } + + // check for a tab marked active via a class + if ( active === null ) { + active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); + } + + // no active tab, set to false + if ( active === null || active === -1 ) { + active = this.tabs.length ? 0 : false; + } + } + + // handle numbers: negative, out of range + if ( active !== false ) { + active = this.tabs.index( this.tabs.eq( active ) ); + if ( active === -1 ) { + active = options.collapsible ? false : 0; + } + } + options.active = active; + + // don't allow collapsible: false and active: false + if ( !options.collapsible && options.active === false && this.anchors.length ) { + options.active = 0; + } + + // Take disabling tabs via class attribute from HTML + // into account and update option properly. + if ( $.isArray( options.disabled ) ) { + options.disabled = $.unique( options.disabled.concat( + $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { + return that.tabs.index( li ); + }) + ) ).sort(); + } + + // check for length avoids error when initializing empty list + if ( this.options.active !== false && this.anchors.length ) { + this.active = this._findActive( this.options.active ); + } else { + this.active = $(); + } + + this._refresh(); + + if ( this.active.length ) { + this.load( options.active ); + } + }, + + _getCreateEventData: function() { + return { + tab: this.active, + panel: !this.active.length ? $() : this._getPanelForTab( this.active ) + }; + }, + + _tabKeydown: function( event ) { + var focusedTab = $( this.document[0].activeElement ).closest( "li" ), + selectedIndex = this.tabs.index( focusedTab ), + goingForward = true; + + if ( this._handlePageNav( event ) ) { + return; + } + + switch ( event.keyCode ) { + case $.ui.keyCode.RIGHT: + case $.ui.keyCode.DOWN: + selectedIndex++; + break; + case $.ui.keyCode.UP: + case $.ui.keyCode.LEFT: + goingForward = false; + selectedIndex--; + break; + case $.ui.keyCode.END: + selectedIndex = this.anchors.length - 1; + break; + case $.ui.keyCode.HOME: + selectedIndex = 0; + break; + case $.ui.keyCode.SPACE: + // Activate only, no collapsing + event.preventDefault(); + clearTimeout( this.activating ); + this._activate( selectedIndex ); + return; + case $.ui.keyCode.ENTER: + // Toggle (cancel delayed activation, allow collapsing) + event.preventDefault(); + clearTimeout( this.activating ); + // Determine if we should collapse or activate + this._activate( selectedIndex === this.options.active ? false : selectedIndex ); + return; + default: + return; + } + + // Focus the appropriate tab, based on which key was pressed + event.preventDefault(); + clearTimeout( this.activating ); + selectedIndex = this._focusNextTab( selectedIndex, goingForward ); + + // Navigating with control key will prevent automatic activation + if ( !event.ctrlKey ) { + // Update aria-selected immediately so that AT think the tab is already selected. + // Otherwise AT may confuse the user by stating that they need to activate the tab, + // but the tab will already be activated by the time the announcement finishes. + focusedTab.attr( "aria-selected", "false" ); + this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" ); + + this.activating = this._delay(function() { + this.option( "active", selectedIndex ); + }, this.delay ); + } + }, + + _panelKeydown: function( event ) { + if ( this._handlePageNav( event ) ) { + return; + } + + // Ctrl+up moves focus to the current tab + if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) { + event.preventDefault(); + this.active.focus(); + } + }, + + // Alt+page up/down moves focus to the previous/next tab (and activates) + _handlePageNav: function( event ) { + if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) { + this._activate( this._focusNextTab( this.options.active - 1, false ) ); + return true; + } + if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) { + this._activate( this._focusNextTab( this.options.active + 1, true ) ); + return true; + } + }, + + _findNextTab: function( index, goingForward ) { + var lastTabIndex = this.tabs.length - 1; + + function constrain() { + if ( index > lastTabIndex ) { + index = 0; + } + if ( index < 0 ) { + index = lastTabIndex; + } + return index; + } + + while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) { + index = goingForward ? index + 1 : index - 1; + } + + return index; + }, + + _focusNextTab: function( index, goingForward ) { + index = this._findNextTab( index, goingForward ); + this.tabs.eq( index ).focus(); + return index; + }, + + _setOption: function( key, value ) { + if ( key === "active" ) { + // _activate() will handle invalid values and update this.options + this._activate( value ); + return; + } + + if ( key === "disabled" ) { + // don't use the widget factory's disabled handling + this._setupDisabled( value ); + return; + } + + this._super( key, value); + + if ( key === "collapsible" ) { + this.element.toggleClass( "ui-tabs-collapsible", value ); + // Setting collapsible: false while collapsed; open first panel + if ( !value && this.options.active === false ) { + this._activate( 0 ); + } + } + + if ( key === "event" ) { + this._setupEvents( value ); + } + + if ( key === "heightStyle" ) { + this._setupHeightStyle( value ); + } + }, + + _tabId: function( tab ) { + return tab.attr( "aria-controls" ) || "ui-tabs-" + getNextTabId(); + }, + + _sanitizeSelector: function( hash ) { + return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : ""; + }, + + refresh: function() { + var options = this.options, + lis = this.tablist.children( ":has(a[href])" ); + + // get disabled tabs from class attribute from HTML + // this will get converted to a boolean if needed in _refresh() + options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) { + return lis.index( tab ); + }); + + this._processTabs(); + + // was collapsed or no tabs + if ( options.active === false || !this.anchors.length ) { + options.active = false; + this.active = $(); + // was active, but active tab is gone + } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) { + // all remaining tabs are disabled + if ( this.tabs.length === options.disabled.length ) { + options.active = false; + this.active = $(); + // activate previous tab + } else { + this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) ); + } + // was active, active tab still exists + } else { + // make sure active index is correct + options.active = this.tabs.index( this.active ); + } + + this._refresh(); + }, + + _refresh: function() { + this._setupDisabled( this.options.disabled ); + this._setupEvents( this.options.event ); + this._setupHeightStyle( this.options.heightStyle ); + + this.tabs.not( this.active ).attr({ + "aria-selected": "false", + tabIndex: -1 + }); + this.panels.not( this._getPanelForTab( this.active ) ) + .hide() + .attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }); + + // Make sure one tab is in the tab order + if ( !this.active.length ) { + this.tabs.eq( 0 ).attr( "tabIndex", 0 ); + } else { + this.active + .addClass( "ui-tabs-active ui-state-active" ) + .attr({ + "aria-selected": "true", + tabIndex: 0 + }); + this._getPanelForTab( this.active ) + .show() + .attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }); + } + }, + + _processTabs: function() { + var that = this; + + this.tablist = this._getList() + .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) + .attr( "role", "tablist" ); + + this.tabs = this.tablist.find( "> li:has(a[href])" ) + .addClass( "ui-state-default ui-corner-top" ) + .attr({ + role: "tab", + tabIndex: -1 + }); + + this.anchors = this.tabs.map(function() { + return $( "a", this )[ 0 ]; + }) + .addClass( "ui-tabs-anchor" ) + .attr({ + role: "presentation", + tabIndex: -1 + }); + + this.panels = $(); + + this.anchors.each(function( i, anchor ) { + var selector, panel, panelId, + anchorId = $( anchor ).uniqueId().attr( "id" ), + tab = $( anchor ).closest( "li" ), + originalAriaControls = tab.attr( "aria-controls" ); + + // inline tab + if ( isLocal( anchor ) ) { + selector = anchor.hash; + panel = that.element.find( that._sanitizeSelector( selector ) ); + // remote tab + } else { + panelId = that._tabId( tab ); + selector = "#" + panelId; + panel = that.element.find( selector ); + if ( !panel.length ) { + panel = that._createPanel( panelId ); + panel.insertAfter( that.panels[ i - 1 ] || that.tablist ); + } + panel.attr( "aria-live", "polite" ); + } + + if ( panel.length) { + that.panels = that.panels.add( panel ); + } + if ( originalAriaControls ) { + tab.data( "ui-tabs-aria-controls", originalAriaControls ); + } + tab.attr({ + "aria-controls": selector.substring( 1 ), + "aria-labelledby": anchorId + }); + panel.attr( "aria-labelledby", anchorId ); + }); + + this.panels + .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) + .attr( "role", "tabpanel" ); + }, + + // allow overriding how to find the list for rare usage scenarios (#7715) + _getList: function() { + return this.element.find( "ol,ul" ).eq( 0 ); + }, + + _createPanel: function( id ) { + return $( "
      " ) + .attr( "id", id ) + .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) + .data( "ui-tabs-destroy", true ); + }, + + _setupDisabled: function( disabled ) { + if ( $.isArray( disabled ) ) { + if ( !disabled.length ) { + disabled = false; + } else if ( disabled.length === this.anchors.length ) { + disabled = true; + } + } + + // disable tabs + for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) { + if ( disabled === true || $.inArray( i, disabled ) !== -1 ) { + $( li ) + .addClass( "ui-state-disabled" ) + .attr( "aria-disabled", "true" ); + } else { + $( li ) + .removeClass( "ui-state-disabled" ) + .removeAttr( "aria-disabled" ); + } + } + + this.options.disabled = disabled; + }, + + _setupEvents: function( event ) { + var events = { + click: function( event ) { + event.preventDefault(); + } + }; + if ( event ) { + $.each( event.split(" "), function( index, eventName ) { + events[ eventName ] = "_eventHandler"; + }); + } + + this._off( this.anchors.add( this.tabs ).add( this.panels ) ); + this._on( this.anchors, events ); + this._on( this.tabs, { keydown: "_tabKeydown" } ); + this._on( this.panels, { keydown: "_panelKeydown" } ); + + this._focusable( this.tabs ); + this._hoverable( this.tabs ); + }, + + _setupHeightStyle: function( heightStyle ) { + var maxHeight, overflow, + parent = this.element.parent(); + + if ( heightStyle === "fill" ) { + // IE 6 treats height like minHeight, so we need to turn off overflow + // in order to get a reliable height + // we use the minHeight support test because we assume that only + // browsers that don't support minHeight will treat height as minHeight + if ( !$.support.minHeight ) { + overflow = parent.css( "overflow" ); + parent.css( "overflow", "hidden"); + } + maxHeight = parent.height(); + this.element.siblings( ":visible" ).each(function() { + var elem = $( this ), + position = elem.css( "position" ); + + if ( position === "absolute" || position === "fixed" ) { + return; + } + maxHeight -= elem.outerHeight( true ); + }); + if ( overflow ) { + parent.css( "overflow", overflow ); + } + + this.element.children().not( this.panels ).each(function() { + maxHeight -= $( this ).outerHeight( true ); + }); + + this.panels.each(function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + }) + .css( "overflow", "auto" ); + } else if ( heightStyle === "auto" ) { + maxHeight = 0; + this.panels.each(function() { + maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); + }).height( maxHeight ); + } + }, + + _eventHandler: function( event ) { + var options = this.options, + active = this.active, + anchor = $( event.currentTarget ), + tab = anchor.closest( "li" ), + clickedIsActive = tab[ 0 ] === active[ 0 ], + collapsing = clickedIsActive && options.collapsible, + toShow = collapsing ? $() : this._getPanelForTab( tab ), + toHide = !active.length ? $() : this._getPanelForTab( active ), + eventData = { + oldTab: active, + oldPanel: toHide, + newTab: collapsing ? $() : tab, + newPanel: toShow + }; + + event.preventDefault(); + + if ( tab.hasClass( "ui-state-disabled" ) || + // tab is already loading + tab.hasClass( "ui-tabs-loading" ) || + // can't switch durning an animation + this.running || + // click on active header, but not collapsible + ( clickedIsActive && !options.collapsible ) || + // allow canceling activation + ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { + return; + } + + options.active = collapsing ? false : this.tabs.index( tab ); + + this.active = clickedIsActive ? $() : tab; + if ( this.xhr ) { + this.xhr.abort(); + } + + if ( !toHide.length && !toShow.length ) { + $.error( "jQuery UI Tabs: Mismatching fragment identifier." ); + } + + if ( toShow.length ) { + this.load( this.tabs.index( tab ), event ); + } + this._toggle( event, eventData ); + }, + + // handles show/hide for selecting tabs + _toggle: function( event, eventData ) { + var that = this, + toShow = eventData.newPanel, + toHide = eventData.oldPanel; + + this.running = true; + + function complete() { + that.running = false; + that._trigger( "activate", event, eventData ); + } + + function show() { + eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" ); + + if ( toShow.length && that.options.show ) { + that._show( toShow, that.options.show, complete ); + } else { + toShow.show(); + complete(); + } + } + + // start out by hiding, then showing, then completing + if ( toHide.length && this.options.hide ) { + this._hide( toHide, this.options.hide, function() { + eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); + show(); + }); + } else { + eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); + toHide.hide(); + show(); + } + + toHide.attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }); + eventData.oldTab.attr( "aria-selected", "false" ); + // If we're switching tabs, remove the old tab from the tab order. + // If we're opening from collapsed state, remove the previous tab from the tab order. + // If we're collapsing, then keep the collapsing tab in the tab order. + if ( toShow.length && toHide.length ) { + eventData.oldTab.attr( "tabIndex", -1 ); + } else if ( toShow.length ) { + this.tabs.filter(function() { + return $( this ).attr( "tabIndex" ) === 0; + }) + .attr( "tabIndex", -1 ); + } + + toShow.attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }); + eventData.newTab.attr({ + "aria-selected": "true", + tabIndex: 0 + }); + }, + + _activate: function( index ) { + var anchor, + active = this._findActive( index ); + + // trying to activate the already active panel + if ( active[ 0 ] === this.active[ 0 ] ) { + return; + } + + // trying to collapse, simulate a click on the current active header + if ( !active.length ) { + active = this.active; + } + + anchor = active.find( ".ui-tabs-anchor" )[ 0 ]; + this._eventHandler({ + target: anchor, + currentTarget: anchor, + preventDefault: $.noop + }); + }, + + _findActive: function( index ) { + return index === false ? $() : this.tabs.eq( index ); + }, + + _getIndex: function( index ) { + // meta-function to give users option to provide a href string instead of a numerical index. + if ( typeof index === "string" ) { + index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) ); + } + + return index; + }, + + _destroy: function() { + if ( this.xhr ) { + this.xhr.abort(); + } + + this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" ); + + this.tablist + .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) + .removeAttr( "role" ); + + this.anchors + .removeClass( "ui-tabs-anchor" ) + .removeAttr( "role" ) + .removeAttr( "tabIndex" ) + .removeData( "href.tabs" ) + .removeData( "load.tabs" ) + .removeUniqueId(); + + this.tabs.add( this.panels ).each(function() { + if ( $.data( this, "ui-tabs-destroy" ) ) { + $( this ).remove(); + } else { + $( this ) + .removeClass( "ui-state-default ui-state-active ui-state-disabled " + + "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" ) + .removeAttr( "tabIndex" ) + .removeAttr( "aria-live" ) + .removeAttr( "aria-busy" ) + .removeAttr( "aria-selected" ) + .removeAttr( "aria-labelledby" ) + .removeAttr( "aria-hidden" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "role" ); + } + }); + + this.tabs.each(function() { + var li = $( this ), + prev = li.data( "ui-tabs-aria-controls" ); + if ( prev ) { + li.attr( "aria-controls", prev ); + } else { + li.removeAttr( "aria-controls" ); + } + }); + + this.panels.show(); + + if ( this.options.heightStyle !== "content" ) { + this.panels.css( "height", "" ); + } + }, + + enable: function( index ) { + var disabled = this.options.disabled; + if ( disabled === false ) { + return; + } + + if ( index === undefined ) { + disabled = false; + } else { + index = this._getIndex( index ); + if ( $.isArray( disabled ) ) { + disabled = $.map( disabled, function( num ) { + return num !== index ? num : null; + }); + } else { + disabled = $.map( this.tabs, function( li, num ) { + return num !== index ? num : null; + }); + } + } + this._setupDisabled( disabled ); + }, + + disable: function( index ) { + var disabled = this.options.disabled; + if ( disabled === true ) { + return; + } + + if ( index === undefined ) { + disabled = true; + } else { + index = this._getIndex( index ); + if ( $.inArray( index, disabled ) !== -1 ) { + return; + } + if ( $.isArray( disabled ) ) { + disabled = $.merge( [ index ], disabled ).sort(); + } else { + disabled = [ index ]; + } + } + this._setupDisabled( disabled ); + }, + + load: function( index, event ) { + index = this._getIndex( index ); + var that = this, + tab = this.tabs.eq( index ), + anchor = tab.find( ".ui-tabs-anchor" ), + panel = this._getPanelForTab( tab ), + eventData = { + tab: tab, + panel: panel + }; + + // not remote + if ( isLocal( anchor[ 0 ] ) ) { + return; + } + + this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); + + // support: jQuery <1.8 + // jQuery <1.8 returns false if the request is canceled in beforeSend, + // but as of 1.8, $.ajax() always returns a jqXHR object. + if ( this.xhr && this.xhr.statusText !== "canceled" ) { + tab.addClass( "ui-tabs-loading" ); + panel.attr( "aria-busy", "true" ); + + this.xhr + .success(function( response ) { + // support: jQuery <1.8 + // http://bugs.jquery.com/ticket/11778 + setTimeout(function() { + panel.html( response ); + that._trigger( "load", event, eventData ); + }, 1 ); + }) + .complete(function( jqXHR, status ) { + // support: jQuery <1.8 + // http://bugs.jquery.com/ticket/11778 + setTimeout(function() { + if ( status === "abort" ) { + that.panels.stop( false, true ); + } + + tab.removeClass( "ui-tabs-loading" ); + panel.removeAttr( "aria-busy" ); + + if ( jqXHR === that.xhr ) { + delete that.xhr; + } + }, 1 ); + }); + } + }, + + // TODO: Remove this function in 1.10 when ajaxOptions is removed + _ajaxSettings: function( anchor, event, eventData ) { + var that = this; + return { + url: anchor.attr( "href" ), + beforeSend: function( jqXHR, settings ) { + return that._trigger( "beforeLoad", event, + $.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) ); + } + }; + }, + + _getPanelForTab: function( tab ) { + var id = $( tab ).attr( "aria-controls" ); + return this.element.find( this._sanitizeSelector( "#" + id ) ); + } +}); + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + + // helper method for a lot of the back compat extensions + $.ui.tabs.prototype._ui = function( tab, panel ) { + return { + tab: tab, + panel: panel, + index: this.anchors.index( tab ) + }; + }; + + // url method + $.widget( "ui.tabs", $.ui.tabs, { + url: function( index, url ) { + this.anchors.eq( index ).attr( "href", url ); + } + }); + + // TODO: Remove _ajaxSettings() method when removing this extension + // ajaxOptions and cache options + $.widget( "ui.tabs", $.ui.tabs, { + options: { + ajaxOptions: null, + cache: false + }, + + _create: function() { + this._super(); + + var that = this; + + this._on({ tabsbeforeload: function( event, ui ) { + // tab is already cached + if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) { + event.preventDefault(); + return; + } + + ui.jqXHR.success(function() { + if ( that.options.cache ) { + $.data( ui.tab[ 0 ], "cache.tabs", true ); + } + }); + }}); + }, + + _ajaxSettings: function( anchor, event, ui ) { + var ajaxOptions = this.options.ajaxOptions; + return $.extend( {}, ajaxOptions, { + error: function( xhr, status ) { + try { + // Passing index avoid a race condition when this method is + // called after the user has selected another tab. + // Pass the anchor that initiated this request allows + // loadError to manipulate the tab content panel via $(a.hash) + ajaxOptions.error( + xhr, status, ui.tab.closest( "li" ).index(), ui.tab[ 0 ] ); + } + catch ( error ) {} + } + }, this._superApply( arguments ) ); + }, + + _setOption: function( key, value ) { + // reset cache if switching from cached to not cached + if ( key === "cache" && value === false ) { + this.anchors.removeData( "cache.tabs" ); + } + this._super( key, value ); + }, + + _destroy: function() { + this.anchors.removeData( "cache.tabs" ); + this._super(); + }, + + url: function( index ){ + this.anchors.eq( index ).removeData( "cache.tabs" ); + this._superApply( arguments ); + } + }); + + // abort method + $.widget( "ui.tabs", $.ui.tabs, { + abort: function() { + if ( this.xhr ) { + this.xhr.abort(); + } + } + }); + + // spinner + $.widget( "ui.tabs", $.ui.tabs, { + options: { + spinner: "Loading…" + }, + _create: function() { + this._super(); + this._on({ + tabsbeforeload: function( event, ui ) { + // Don't react to nested tabs or tabs that don't use a spinner + if ( event.target !== this.element[ 0 ] || + !this.options.spinner ) { + return; + } + + var span = ui.tab.find( "span" ), + html = span.html(); + span.html( this.options.spinner ); + ui.jqXHR.complete(function() { + span.html( html ); + }); + } + }); + } + }); + + // enable/disable events + $.widget( "ui.tabs", $.ui.tabs, { + options: { + enable: null, + disable: null + }, + + enable: function( index ) { + var options = this.options, + trigger; + + if ( index && options.disabled === true || + ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) !== -1 ) ) { + trigger = true; + } + + this._superApply( arguments ); + + if ( trigger ) { + this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + } + }, + + disable: function( index ) { + var options = this.options, + trigger; + + if ( index && options.disabled === false || + ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) === -1 ) ) { + trigger = true; + } + + this._superApply( arguments ); + + if ( trigger ) { + this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + } + } + }); + + // add/remove methods and events + $.widget( "ui.tabs", $.ui.tabs, { + options: { + add: null, + remove: null, + tabTemplate: "
    • #{label}
    • " + }, + + add: function( url, label, index ) { + if ( index === undefined ) { + index = this.anchors.length; + } + + var doInsertAfter, panel, + options = this.options, + li = $( options.tabTemplate + .replace( /#\{href\}/g, url ) + .replace( /#\{label\}/g, label ) ), + id = !url.indexOf( "#" ) ? + url.replace( "#", "" ) : + this._tabId( li ); + + li.addClass( "ui-state-default ui-corner-top" ).data( "ui-tabs-destroy", true ); + li.attr( "aria-controls", id ); + + doInsertAfter = index >= this.tabs.length; + + // try to find an existing element before creating a new one + panel = this.element.find( "#" + id ); + if ( !panel.length ) { + panel = this._createPanel( id ); + if ( doInsertAfter ) { + if ( index > 0 ) { + panel.insertAfter( this.panels.eq( -1 ) ); + } else { + panel.appendTo( this.element ); + } + } else { + panel.insertBefore( this.panels[ index ] ); + } + } + panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ).hide(); + + if ( doInsertAfter ) { + li.appendTo( this.tablist ); + } else { + li.insertBefore( this.tabs[ index ] ); + } + + options.disabled = $.map( options.disabled, function( n ) { + return n >= index ? ++n : n; + }); + + this.refresh(); + if ( this.tabs.length === 1 && options.active === false ) { + this.option( "active", 0 ); + } + + this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + return this; + }, + + remove: function( index ) { + index = this._getIndex( index ); + var options = this.options, + tab = this.tabs.eq( index ).remove(), + panel = this._getPanelForTab( tab ).remove(); + + // If selected tab was removed focus tab to the right or + // in case the last tab was removed the tab to the left. + // We check for more than 2 tabs, because if there are only 2, + // then when we remove this tab, there will only be one tab left + // so we don't need to detect which tab to activate. + if ( tab.hasClass( "ui-tabs-active" ) && this.anchors.length > 2 ) { + this._activate( index + ( index + 1 < this.anchors.length ? 1 : -1 ) ); + } + + options.disabled = $.map( + $.grep( options.disabled, function( n ) { + return n !== index; + }), + function( n ) { + return n >= index ? --n : n; + }); + + this.refresh(); + + this._trigger( "remove", null, this._ui( tab.find( "a" )[ 0 ], panel[ 0 ] ) ); + return this; + } + }); + + // length method + $.widget( "ui.tabs", $.ui.tabs, { + length: function() { + return this.anchors.length; + } + }); + + // panel ids (idPrefix option + title attribute) + $.widget( "ui.tabs", $.ui.tabs, { + options: { + idPrefix: "ui-tabs-" + }, + + _tabId: function( tab ) { + var a = tab.is( "li" ) ? tab.find( "a[href]" ) : tab; + a = a[0]; + return $( a ).closest( "li" ).attr( "aria-controls" ) || + a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF\-]/g, "" ) || + this.options.idPrefix + getNextTabId(); + } + }); + + // _createPanel method + $.widget( "ui.tabs", $.ui.tabs, { + options: { + panelTemplate: "
      " + }, + + _createPanel: function( id ) { + return $( this.options.panelTemplate ) + .attr( "id", id ) + .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) + .data( "ui-tabs-destroy", true ); + } + }); + + // selected option + $.widget( "ui.tabs", $.ui.tabs, { + _create: function() { + var options = this.options; + if ( options.active === null && options.selected !== undefined ) { + options.active = options.selected === -1 ? false : options.selected; + } + this._super(); + options.selected = options.active; + if ( options.selected === false ) { + options.selected = -1; + } + }, + + _setOption: function( key, value ) { + if ( key !== "selected" ) { + return this._super( key, value ); + } + + var options = this.options; + this._super( "active", value === -1 ? false : value ); + options.selected = options.active; + if ( options.selected === false ) { + options.selected = -1; + } + }, + + _eventHandler: function() { + this._superApply( arguments ); + this.options.selected = this.options.active; + if ( this.options.selected === false ) { + this.options.selected = -1; + } + } + }); + + // show and select event + $.widget( "ui.tabs", $.ui.tabs, { + options: { + show: null, + select: null + }, + _create: function() { + this._super(); + if ( this.options.active !== false ) { + this._trigger( "show", null, this._ui( + this.active.find( ".ui-tabs-anchor" )[ 0 ], + this._getPanelForTab( this.active )[ 0 ] ) ); + } + }, + _trigger: function( type, event, data ) { + var tab, panel, + ret = this._superApply( arguments ); + + if ( !ret ) { + return false; + } + + if ( type === "beforeActivate" ) { + tab = data.newTab.length ? data.newTab : data.oldTab; + panel = data.newPanel.length ? data.newPanel : data.oldPanel; + ret = this._super( "select", event, { + tab: tab.find( ".ui-tabs-anchor" )[ 0], + panel: panel[ 0 ], + index: tab.closest( "li" ).index() + }); + } else if ( type === "activate" && data.newTab.length ) { + ret = this._super( "show", event, { + tab: data.newTab.find( ".ui-tabs-anchor" )[ 0 ], + panel: data.newPanel[ 0 ], + index: data.newTab.closest( "li" ).index() + }); + } + return ret; + } + }); + + // select method + $.widget( "ui.tabs", $.ui.tabs, { + select: function( index ) { + index = this._getIndex( index ); + if ( index === -1 ) { + if ( this.options.collapsible && this.options.selected !== -1 ) { + index = this.options.selected; + } else { + return; + } + } + this.anchors.eq( index ).trigger( this.options.event + this.eventNamespace ); + } + }); + + // cookie option + (function() { + + var listId = 0; + + $.widget( "ui.tabs", $.ui.tabs, { + options: { + cookie: null // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } + }, + _create: function() { + var options = this.options, + active; + if ( options.active == null && options.cookie ) { + active = parseInt( this._cookie(), 10 ); + if ( active === -1 ) { + active = false; + } + options.active = active; + } + this._super(); + }, + _cookie: function( active ) { + var cookie = [ this.cookie || + ( this.cookie = this.options.cookie.name || "ui-tabs-" + (++listId) ) ]; + if ( arguments.length ) { + cookie.push( active === false ? -1 : active ); + cookie.push( this.options.cookie ); + } + return $.cookie.apply( null, cookie ); + }, + _refresh: function() { + this._super(); + if ( this.options.cookie ) { + this._cookie( this.options.active, this.options.cookie ); + } + }, + _eventHandler: function() { + this._superApply( arguments ); + if ( this.options.cookie ) { + this._cookie( this.options.active, this.options.cookie ); + } + }, + _destroy: function() { + this._super(); + if ( this.options.cookie ) { + this._cookie( null, this.options.cookie ); + } + } + }); + + })(); + + // load event + $.widget( "ui.tabs", $.ui.tabs, { + _trigger: function( type, event, data ) { + var _data = $.extend( {}, data ); + if ( type === "load" ) { + _data.panel = _data.panel[ 0 ]; + _data.tab = _data.tab.find( ".ui-tabs-anchor" )[ 0 ]; + } + return this._super( type, event, _data ); + } + }); + + // fx option + // The new animation options (show, hide) conflict with the old show callback. + // The old fx option wins over show/hide anyway (always favor back-compat). + // If a user wants to use the new animation API, they must give up the old API. + $.widget( "ui.tabs", $.ui.tabs, { + options: { + fx: null // e.g. { height: "toggle", opacity: "toggle", duration: 200 } + }, + + _getFx: function() { + var hide, show, + fx = this.options.fx; + + if ( fx ) { + if ( $.isArray( fx ) ) { + hide = fx[ 0 ]; + show = fx[ 1 ]; + } else { + hide = show = fx; + } + } + + return fx ? { show: show, hide: hide } : null; + }, + + _toggle: function( event, eventData ) { + var that = this, + toShow = eventData.newPanel, + toHide = eventData.oldPanel, + fx = this._getFx(); + + if ( !fx ) { + return this._super( event, eventData ); + } + + that.running = true; + + function complete() { + that.running = false; + that._trigger( "activate", event, eventData ); + } + + function show() { + eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" ); + + if ( toShow.length && fx.show ) { + toShow + .animate( fx.show, fx.show.duration, function() { + complete(); + }); + } else { + toShow.show(); + complete(); + } + } + + // start out by hiding, then showing, then completing + if ( toHide.length && fx.hide ) { + toHide.animate( fx.hide, fx.hide.duration, function() { + eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); + show(); + }); + } else { + eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); + toHide.hide(); + show(); + } + } + }); +} + +})( jQuery ); + +(function( $ ) { + +var increments = 0; + +function addDescribedBy( elem, id ) { + var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ); + describedby.push( id ); + elem + .data( "ui-tooltip-id", id ) + .attr( "aria-describedby", $.trim( describedby.join( " " ) ) ); +} + +function removeDescribedBy( elem ) { + var id = elem.data( "ui-tooltip-id" ), + describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ), + index = $.inArray( id, describedby ); + if ( index !== -1 ) { + describedby.splice( index, 1 ); + } + + elem.removeData( "ui-tooltip-id" ); + describedby = $.trim( describedby.join( " " ) ); + if ( describedby ) { + elem.attr( "aria-describedby", describedby ); + } else { + elem.removeAttr( "aria-describedby" ); + } +} + +$.widget( "ui.tooltip", { + version: "1.9.2", + options: { + content: function() { + return $( this ).attr( "title" ); + }, + hide: true, + // Disabled elements have inconsistent behavior across browsers (#8661) + items: "[title]:not([disabled])", + position: { + my: "left top+15", + at: "left bottom", + collision: "flipfit flip" + }, + show: true, + tooltipClass: null, + track: false, + + // callbacks + close: null, + open: null + }, + + _create: function() { + this._on({ + mouseover: "open", + focusin: "open" + }); + + // IDs of generated tooltips, needed for destroy + this.tooltips = {}; + // IDs of parent tooltips where we removed the title attribute + this.parents = {}; + + if ( this.options.disabled ) { + this._disable(); + } + }, + + _setOption: function( key, value ) { + var that = this; + + if ( key === "disabled" ) { + this[ value ? "_disable" : "_enable" ](); + this.options[ key ] = value; + // disable element style changes + return; + } + + this._super( key, value ); + + if ( key === "content" ) { + $.each( this.tooltips, function( id, element ) { + that._updateContent( element ); + }); + } + }, + + _disable: function() { + var that = this; + + // close open tooltips + $.each( this.tooltips, function( id, element ) { + var event = $.Event( "blur" ); + event.target = event.currentTarget = element[0]; + that.close( event, true ); + }); + + // remove title attributes to prevent native tooltips + this.element.find( this.options.items ).andSelf().each(function() { + var element = $( this ); + if ( element.is( "[title]" ) ) { + element + .data( "ui-tooltip-title", element.attr( "title" ) ) + .attr( "title", "" ); + } + }); + }, + + _enable: function() { + // restore title attributes + this.element.find( this.options.items ).andSelf().each(function() { + var element = $( this ); + if ( element.data( "ui-tooltip-title" ) ) { + element.attr( "title", element.data( "ui-tooltip-title" ) ); + } + }); + }, + + open: function( event ) { + var that = this, + target = $( event ? event.target : this.element ) + // we need closest here due to mouseover bubbling, + // but always pointing at the same event target + .closest( this.options.items ); + + // No element to show a tooltip for or the tooltip is already open + if ( !target.length || target.data( "ui-tooltip-id" ) ) { + return; + } + + if ( target.attr( "title" ) ) { + target.data( "ui-tooltip-title", target.attr( "title" ) ); + } + + target.data( "ui-tooltip-open", true ); + + // kill parent tooltips, custom or native, for hover + if ( event && event.type === "mouseover" ) { + target.parents().each(function() { + var parent = $( this ), + blurEvent; + if ( parent.data( "ui-tooltip-open" ) ) { + blurEvent = $.Event( "blur" ); + blurEvent.target = blurEvent.currentTarget = this; + that.close( blurEvent, true ); + } + if ( parent.attr( "title" ) ) { + parent.uniqueId(); + that.parents[ this.id ] = { + element: this, + title: parent.attr( "title" ) + }; + parent.attr( "title", "" ); + } + }); + } + + this._updateContent( target, event ); + }, + + _updateContent: function( target, event ) { + var content, + contentOption = this.options.content, + that = this, + eventType = event ? event.type : null; + + if ( typeof contentOption === "string" ) { + return this._open( event, target, contentOption ); + } + + content = contentOption.call( target[0], function( response ) { + // ignore async response if tooltip was closed already + if ( !target.data( "ui-tooltip-open" ) ) { + return; + } + // IE may instantly serve a cached response for ajax requests + // delay this call to _open so the other call to _open runs first + that._delay(function() { + // jQuery creates a special event for focusin when it doesn't + // exist natively. To improve performance, the native event + // object is reused and the type is changed. Therefore, we can't + // rely on the type being correct after the event finished + // bubbling, so we set it back to the previous value. (#8740) + if ( event ) { + event.type = eventType; + } + this._open( event, target, response ); + }); + }); + if ( content ) { + this._open( event, target, content ); + } + }, + + _open: function( event, target, content ) { + var tooltip, events, delayedShow, + positionOption = $.extend( {}, this.options.position ); + + if ( !content ) { + return; + } + + // Content can be updated multiple times. If the tooltip already + // exists, then just update the content and bail. + tooltip = this._find( target ); + if ( tooltip.length ) { + tooltip.find( ".ui-tooltip-content" ).html( content ); + return; + } + + // if we have a title, clear it to prevent the native tooltip + // we have to check first to avoid defining a title if none exists + // (we don't want to cause an element to start matching [title]) + // + // We use removeAttr only for key events, to allow IE to export the correct + // accessible attributes. For mouse events, set to empty string to avoid + // native tooltip showing up (happens only when removing inside mouseover). + if ( target.is( "[title]" ) ) { + if ( event && event.type === "mouseover" ) { + target.attr( "title", "" ); + } else { + target.removeAttr( "title" ); + } + } + + tooltip = this._tooltip( target ); + addDescribedBy( target, tooltip.attr( "id" ) ); + tooltip.find( ".ui-tooltip-content" ).html( content ); + + function position( event ) { + positionOption.of = event; + if ( tooltip.is( ":hidden" ) ) { + return; + } + tooltip.position( positionOption ); + } + if ( this.options.track && event && /^mouse/.test( event.type ) ) { + this._on( this.document, { + mousemove: position + }); + // trigger once to override element-relative positioning + position( event ); + } else { + tooltip.position( $.extend({ + of: target + }, this.options.position ) ); + } + + tooltip.hide(); + + this._show( tooltip, this.options.show ); + // Handle tracking tooltips that are shown with a delay (#8644). As soon + // as the tooltip is visible, position the tooltip using the most recent + // event. + if ( this.options.show && this.options.show.delay ) { + delayedShow = setInterval(function() { + if ( tooltip.is( ":visible" ) ) { + position( positionOption.of ); + clearInterval( delayedShow ); + } + }, $.fx.interval ); + } + + this._trigger( "open", event, { tooltip: tooltip } ); + + events = { + keyup: function( event ) { + if ( event.keyCode === $.ui.keyCode.ESCAPE ) { + var fakeEvent = $.Event(event); + fakeEvent.currentTarget = target[0]; + this.close( fakeEvent, true ); + } + }, + remove: function() { + this._removeTooltip( tooltip ); + } + }; + if ( !event || event.type === "mouseover" ) { + events.mouseleave = "close"; + } + if ( !event || event.type === "focusin" ) { + events.focusout = "close"; + } + this._on( true, target, events ); + }, + + close: function( event ) { + var that = this, + target = $( event ? event.currentTarget : this.element ), + tooltip = this._find( target ); + + // disabling closes the tooltip, so we need to track when we're closing + // to avoid an infinite loop in case the tooltip becomes disabled on close + if ( this.closing ) { + return; + } + + // only set title if we had one before (see comment in _open()) + if ( target.data( "ui-tooltip-title" ) ) { + target.attr( "title", target.data( "ui-tooltip-title" ) ); + } + + removeDescribedBy( target ); + + tooltip.stop( true ); + this._hide( tooltip, this.options.hide, function() { + that._removeTooltip( $( this ) ); + }); + + target.removeData( "ui-tooltip-open" ); + this._off( target, "mouseleave focusout keyup" ); + // Remove 'remove' binding only on delegated targets + if ( target[0] !== this.element[0] ) { + this._off( target, "remove" ); + } + this._off( this.document, "mousemove" ); + + if ( event && event.type === "mouseleave" ) { + $.each( this.parents, function( id, parent ) { + $( parent.element ).attr( "title", parent.title ); + delete that.parents[ id ]; + }); + } + + this.closing = true; + this._trigger( "close", event, { tooltip: tooltip } ); + this.closing = false; + }, + + _tooltip: function( element ) { + var id = "ui-tooltip-" + increments++, + tooltip = $( "
      " ) + .attr({ + id: id, + role: "tooltip" + }) + .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " + + ( this.options.tooltipClass || "" ) ); + $( "
      " ) + .addClass( "ui-tooltip-content" ) + .appendTo( tooltip ); + tooltip.appendTo( this.document[0].body ); + if ( $.fn.bgiframe ) { + tooltip.bgiframe(); + } + this.tooltips[ id ] = element; + return tooltip; + }, + + _find: function( target ) { + var id = target.data( "ui-tooltip-id" ); + return id ? $( "#" + id ) : $(); + }, + + _removeTooltip: function( tooltip ) { + tooltip.remove(); + delete this.tooltips[ tooltip.attr( "id" ) ]; + }, + + _destroy: function() { + var that = this; + + // close open tooltips + $.each( this.tooltips, function( id, element ) { + // Delegate to close method to handle common cleanup + var event = $.Event( "blur" ); + event.target = event.currentTarget = element[0]; + that.close( event, true ); + + // Remove immediately; destroying an open tooltip doesn't use the + // hide animation + $( "#" + id ).remove(); + + // Restore the title + if ( element.data( "ui-tooltip-title" ) ) { + element.attr( "title", element.data( "ui-tooltip-title" ) ); + element.removeData( "ui-tooltip-title" ); + } + }); + } +}); + +}( jQuery ) ); \ No newline at end of file diff --git a/scripts/jquery.autocomplete.js b/scripts/jquery.autocomplete.js new file mode 100644 index 0000000..53dc4ae --- /dev/null +++ b/scripts/jquery.autocomplete.js @@ -0,0 +1,11 @@ +/* +* jQuery Autocomplete plugin 1.1 +* +* Copyright (c) 2009 Jörn Zaefferer +* +* Dual licensed under the MIT and GPL licenses: +* http://www.opensource.org/licenses/mit-license.php +* http://www.gnu.org/licenses/gpl.html +* +* Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $ */ +(function(e){e.fn.extend({autocomplete:function(t,n){var r=typeof t=="string";n=e.extend({},e.Autocompleter.defaults,{url:r?t:null,data:r?null:t,delay:r?e.Autocompleter.defaults.delay:10,max:n&&!n.scroll?10:150},n);n.highlight=n.highlight||function(e){return e};n.formatMatch=n.formatMatch||n.formatItem;return this.each(function(){new e.Autocompleter(this,n)})},result:function(e){return this.bind("result",e)},search:function(e){return this.trigger("search",[e])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(e){return this.trigger("setOptions",[e])},unautocomplete:function(){return this.trigger("unautocomplete")}});e.Autocompleter=function(t,n){function p(){var r=c.selected();if(!r)return false;var s=r.result;o=s;if(n.multiple){var u=v(i.val());if(u.length>1){var a=n.multipleSeparator.length;var f=e(t).selection().start;var l,h=0;e.each(u,function(e,t){h+=t.length;if(f<=h){l=e;return false}h+=a});u[l]=s;s=u.join(n.multipleSeparator)}s+=n.multipleSeparator}i.val(s);b();i.trigger("result",[r.data,r.value]);return true}function d(e,t){if(f==r.DEL){c.hide();return}var s=i.val();if(!t&&s==o)return;o=s;s=m(s);if(s.length>=n.minChars){i.addClass(n.loadingClass);if(!n.matchCase)s=s.toLowerCase();E(s,w,b)}else{x();c.hide()}}function v(t){if(!t)return[""];if(!n.multiple)return[e.trim(t)];return e.map(t.split(n.multipleSeparator),function(n){return e.trim(t).length?e.trim(n):null})}function m(r){if(!n.multiple)return r;var i=v(r);if(i.length==1)return i[0];var s=e(t).selection().start;if(s==r.length){i=v(r)}else{i=v(r.replace(r.substring(s),""))}return i[i.length-1]}function g(s,u){if(n.autoFill&&m(i.val()).toLowerCase()==s.toLowerCase()&&f!=r.BACKSPACE){i.val(i.val()+u.substring(m(o).length));e(t).selection(o.length,o.length+u.length)}}function y(){clearTimeout(s);s=setTimeout(b,200)}function b(){var e=c.visible();c.hide();clearTimeout(s);x();if(n.mustMatch){i.search(function(e){if(!e){if(n.multiple){var t=v(i.val()).slice(0,-1);i.val(t.join(n.multipleSeparator)+(t.length?n.multipleSeparator:""))}else{i.val("");i.trigger("result",null)}}})}}function w(e,t){if(t&&t.length&&a){x();c.display(t,e);g(e,t[0].value);c.show()}else{b()}}function E(r,i,s){if(!n.matchCase)r=r.toLowerCase();var o=u.load(r);if(o&&o.length){i(r,o)}else if(typeof n.url=="string"&&n.url.length>0){var a={timestamp:+(new Date)};e.each(n.extraParams,function(e,t){a[e]=typeof t=="function"?t():t});e.ajax({mode:"abort",port:"autocomplete"+t.name,dataType:n.dataType,url:n.url,data:e.extend({q:m(r),limit:n.max},a),success:function(e){var t=n.parse&&n.parse(e)||S(e);u.add(r,t);i(r,t)}})}else{c.emptyList();s(r)}}function S(t){var r=[];var i=t.split("\n");for(var s=0;s1&&!c.visible()){d(0,true)}}).bind("search",function(){function n(e,n){var r;if(n&&n.length){for(var s=0;s1?arguments[1]:null;e.each(v(i.val()),function(e,t){E(t,n,n)})}).bind("flushCache",function(){u.flush()}).bind("setOptions",function(){e.extend(n,arguments[1]);if("data"in arguments[1])u.populate()}).bind("unautocomplete",function(){c.unbind();i.unbind();e(t.form).unbind(".autocomplete")});};e.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(e){return e[0]},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(e,t){return e.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+t.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"$1")},scroll:true,scrollHeight:180};e.Autocompleter.Cache=function(t){function i(e,n){if(!t.matchCase)e=e.toLowerCase();var r=e.indexOf(n);if(t.matchContains=="word"){r=e.toLowerCase().search("\\b"+n.toLowerCase())}if(r==-1)return false;return r==0||t.matchContains}function s(e,i){if(r>t.cacheLength){u()}if(!n[e]){r++}n[e]=i}function o(){if(!t.data)return false;var n={},r=0;if(!t.url)t.cacheLength=1;n[""]=[];for(var i=0,o=t.data.length;i0){var a=n[u];e.each(a,function(e,t){if(i(t.value,s)){o.push(t)}})}}return o}else if(n[s]){return n[s]}else if(t.matchSubset){for(var f=s.length-1;f>=t.minChars;f--){var a=n[s.substr(0,f)];if(a){var o=[];e.each(a,function(e,t){if(i(t.value,s)){o[o.length]=t}});return o}}}return null}}};e.Autocompleter.Select=function(t,n,r,i){function p(){if(!l)return;c=e("
      ").hide().addClass(t.resultsClass).css("position","absolute").appendTo(document.body);h=e("
        ").appendTo(c).mouseover(function(t){if(d(t).nodeName&&d(t).nodeName.toUpperCase()=="LI"){u=e("li",h).removeClass(s.ACTIVE).index(d(t));e(d(t)).addClass(s.ACTIVE)}}).click(function(t){e(d(t)).addClass(s.ACTIVE);r();n.focus();return false}).mousedown(function(){i.mouseDownOnSelect=true}).mouseup(function(){i.mouseDownOnSelect=false});if(t.width>0)c.css("width",t.width);l=false}function d(e){var t=e.target;while(t&&t.tagName!="LI")t=t.parentNode;if(!t)return[];return t}function v(e){o.slice(u,u+1).removeClass(s.ACTIVE);m(e);var n=o.slice(u,u+1).addClass(s.ACTIVE);if(t.scroll){var r=0;o.slice(0,u).each(function(){r+=this.offsetHeight});if(r+n[0].offsetHeight-h.scrollTop()>h[0].clientHeight){h.scrollTop(r+n[0].offsetHeight-h.innerHeight())}else if(r=o.size()){u=0}}function g(e){return t.max&&t.max").html(t.highlight(i,f)).addClass(r%2==0?"ac_even":"ac_odd").appendTo(h)[0];e.data(l,"ac_data",a[r])}o=h.find("li");if(t.selectFirst){o.slice(0,1).addClass(s.ACTIVE);u=0}if(e.fn.bgiframe)h.bgiframe()}var s={ACTIVE:"ac_over"};var o,u=-1,a,f="",l=true,c,h;return{display:function(e,t){p();a=e;f=t;y()},next:function(){v(1)},prev:function(){v(-1)},pageUp:function(){if(u!=0&&u-8<0){v(-u)}else{v(-8)}},pageDown:function(){if(u!=o.size()-1&&u+8>o.size()){v(o.size()-1-u)}else{v(8)}},hide:function(){c&&c.hide();o&&o.removeClass(s.ACTIVE);u=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(o.filter("."+s.ACTIVE)[0]||t.selectFirst&&o[0])},show:function(){var r=e(n).offset();c.css({width:typeof t.width=="string"||t.width>0?t.width:e(n).width(),top:r.top+n.offsetHeight,left:r.left}).show();if(t.scroll){h.scrollTop(0);h.css({maxHeight:t.scrollHeight,overflow:"auto"});if(e.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var i=0;o.each(function(){i+=this.offsetHeight});var s=i>t.scrollHeight;h.css("height",s?t.scrollHeight:i);if(!s){o.width(h.width()-parseInt(o.css("padding-left"))-parseInt(o.css("padding-right")))}}}},selected:function(){var t=o&&o.filter("."+s.ACTIVE).removeClass(s.ACTIVE);return t&&t.length&&e.data(t[0],"ac_data")},emptyList:function(){h&&h.empty()},unbind:function(){c&&c.remove()}}};e.fn.selection=function(e,t){if(e!==undefined){return this.each(function(){if(this.createTextRange){var n=this.createTextRange();if(t===undefined||e==t){n.move("character",e);n.select()}else{n.collapse(true);n.moveStart("character",e);n.moveEnd("character",t);n.select()}}else if(this.setSelectionRange){this.setSelectionRange(e,t)}else if(this.selectionStart){this.selectionStart=e;this.selectionEnd=t}})}var n=this[0];if(n.createTextRange){var r=document.selection.createRange(),i=n.value,s="<->",o=r.text.length;r.text=s;var u=n.value.indexOf(s);n.value=i;this.selection(u,u+o);return{start:u,end:u+o}}else if(n.selectionStart!==undefined){return{start:n.selectionStart,end:n.selectionEnd}}}})(jQuery) \ No newline at end of file diff --git a/scripts/jquery.dataTables.js b/scripts/jquery.dataTables.js new file mode 100644 index 0000000..fb522fc --- /dev/null +++ b/scripts/jquery.dataTables.js @@ -0,0 +1,28 @@ +/*! DataTables 1.10.3 + * ©2008-2014 SpryMedia Ltd - datatables.net/license + */ + +/** + * @summary DataTables + * @description Paginate, search and order HTML tables + * @version 1.10.3 + * @file jquery.dataTables.js + * @author SpryMedia Ltd (www.sprymedia.co.uk) + * @contact www.sprymedia.co.uk/contact + * @copyright Copyright 2008-2014 SpryMedia Ltd. + * + * This source file is free software, available under the following license: + * MIT license - http://datatables.net/license + * + * This source file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. + * + * For details please refer to: http://www.datatables.net + */ + +/*jslint evil: true, undef: true, browser: true */ +/*globals $,require,jQuery,define,_selector_run,_selector_opts,_selector_first,_selector_row_indexes,_ext,_Api,_api_register,_api_registerPlural,_re_new_lines,_re_html,_re_formatted_numeric,_re_escape_regex,_empty,_intVal,_numToDecimal,_isNumber,_isHtml,_htmlNumeric,_pluck,_pluck_order,_range,_stripHtml,_unique,_fnBuildAjax,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnAjaxDataSrc,_fnAddColumn,_fnColumnOptions,_fnAdjustColumnSizing,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnVisbleColumns,_fnGetColumns,_fnColumnTypes,_fnApplyColumnDefs,_fnHungarianMap,_fnCamelToHungarian,_fnLanguageCompat,_fnBrowserDetect,_fnAddData,_fnAddTr,_fnNodeToDataIndex,_fnNodeToColumnIndex,_fnGetCellData,_fnSetCellData,_fnSplitObjNotation,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnGetDataMaster,_fnClearTable,_fnDeleteIndex,_fnInvalidateRow,_fnGetRowElements,_fnCreateTr,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAddOptionsHtml,_fnDetectHeader,_fnGetUniqueThs,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnFilterCreateSearch,_fnEscapeRegex,_fnFilterData,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnInfoMacros,_fnInitialise,_fnInitComplete,_fnLengthChange,_fnFeatureHtmlLength,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnFeatureHtmlTable,_fnScrollDraw,_fnApplyToChildren,_fnCalculateColumnWidths,_fnThrottle,_fnConvertToWidth,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnScrollBarWidth,_fnSortFlatten,_fnSort,_fnSortAria,_fnSortListener,_fnSortAttachListener,_fnSortingClasses,_fnSortData,_fnSaveState,_fnLoadState,_fnSettingsFromNode,_fnLog,_fnMap,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnLengthOverflow,_fnRenderer,_fnDataSource,_fnRowAttributes*/ +!function(t,e,n){!function(t){"use strict";"function"==typeof define&&define.amd?define("datatables",["jquery"],t):"object"==typeof exports?t(require("jquery")):jQuery&&!jQuery.fn.dataTable&&t(jQuery)}(function(a){"use strict";function r(t){var e,n,o="a aa ai ao as b fn i m o s ",i={};a.each(t,function(a){e=a.match(/^([^A-Z]+?)([A-Z])/),e&&-1!==o.indexOf(e[1]+" ")&&(n=a.replace(e[0],e[2].toLowerCase()),i[n]=a,"o"===e[1]&&r(t[a]))}),t._hungarianMap=i}function o(t,e,i){t._hungarianMap||r(t);var s;a.each(e,function(r){s=t._hungarianMap[r],s===n||!i&&e[s]!==n||("o"===s.charAt(0)?(e[s]||(e[s]={}),a.extend(!0,e[s],e[r]),o(t[s],e[s],i)):e[s]=e[r])})}function i(t){var e=$e.defaults.oLanguage,n=t.sZeroRecords;!t.sEmptyTable&&n&&"No data available in table"===e.sEmptyTable&&ke(t,t,"sZeroRecords","sEmptyTable"),!t.sLoadingRecords&&n&&"Loading..."===e.sLoadingRecords&&ke(t,t,"sZeroRecords","sLoadingRecords"),t.sInfoThousands&&(t.sThousands=t.sInfoThousands);var a=t.sDecimal;a&&qe(a)}function s(t){Sn(t,"ordering","bSort"),Sn(t,"orderMulti","bSortMulti"),Sn(t,"orderClasses","bSortClasses"),Sn(t,"orderCellsTop","bSortCellsTop"),Sn(t,"order","aaSorting"),Sn(t,"orderFixed","aaSortingFixed"),Sn(t,"paging","bPaginate"),Sn(t,"pagingType","sPaginationType"),Sn(t,"pageLength","iDisplayLength"),Sn(t,"searching","bFilter");var e=t.aoSearchCols;if(e)for(var n=0,a=e.length;a>n;n++)e[n]&&o($e.models.oSearch,e[n])}function l(t){Sn(t,"orderable","bSortable"),Sn(t,"orderData","aDataSort"),Sn(t,"orderSequence","asSorting"),Sn(t,"orderDataType","sortDataType")}function u(t){var e=t.oBrowser,n=a("
        ").css({position:"absolute",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(a("
        ").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(a('
        ').css({width:"100%",height:10}))).appendTo("body"),r=n.find(".test");e.bScrollOversize=100===r[0].offsetWidth,e.bScrollbarLeft=1!==r.offset().left,n.remove()}function c(t,e,a,r,o,i){var s,l=r,u=!1;for(a!==n&&(s=a,u=!0);l!==o;)t.hasOwnProperty(l)&&(s=u?e(s,t[l],l,t):t[l],u=!0,l+=i);return s}function f(t,n){var r=$e.defaults.column,o=t.aoColumns.length,i=a.extend({},$e.models.oColumn,r,{nTh:n?n:e.createElement("th"),sTitle:r.sTitle?r.sTitle:n?n.innerHTML:"",aDataSort:r.aDataSort?r.aDataSort:[o],mData:r.mData?r.mData:o,idx:o});t.aoColumns.push(i);var s=t.aoPreSearchCols;s[o]=a.extend({},$e.models.oSearch,s[o]),d(t,o,null)}function d(t,e,r){var i=t.aoColumns[e],s=t.oClasses,u=a(i.nTh);if(!i.sWidthOrig){i.sWidthOrig=u.attr("width")||null;var c=(u.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);c&&(i.sWidthOrig=c[1])}r!==n&&null!==r&&(l(r),o($e.defaults.column,r),r.mDataProp===n||r.mData||(r.mData=r.mDataProp),r.sType&&(i._sManualType=r.sType),r.className&&!r.sClass&&(r.sClass=r.className),a.extend(i,r),ke(i,r,"sWidth","sWidthOrig"),"number"==typeof r.iDataSort&&(i.aDataSort=[r.iDataSort]),ke(i,r,"aDataSort"));var f=i.mData,d=I(f),h=i.mRender?I(i.mRender):null,p=function(t){return"string"==typeof t&&-1!==t.indexOf("@")};i._bAttrSrc=a.isPlainObject(f)&&(p(f.sort)||p(f.type)||p(f.filter)),i.fnGetData=function(t,e,a){var r=d(t,e,n,a);return h&&e?h(r,e,t,a):r},i.fnSetData=function(t,e,n){return A(f)(t,e,n)},"number"!=typeof f&&(t._rowReadObject=!0),t.oFeatures.bSort||(i.bSortable=!1,u.addClass(s.sSortableNone));var g=-1!==a.inArray("asc",i.asSorting),b=-1!==a.inArray("desc",i.asSorting);i.bSortable&&(g||b)?g&&!b?(i.sSortingClass=s.sSortableAsc,i.sSortingClassJUI=s.sSortJUIAscAllowed):!g&&b?(i.sSortingClass=s.sSortableDesc,i.sSortingClassJUI=s.sSortJUIDescAllowed):(i.sSortingClass=s.sSortable,i.sSortingClassJUI=s.sSortJUI):(i.sSortingClass=s.sSortableNone,i.sSortingClassJUI="")}function h(t){if(t.oFeatures.bAutoWidth!==!1){var e=t.aoColumns;Se(t);for(var n=0,a=e.length;a>n;n++)e[n].nTh.style.width=e[n].sWidth}var r=t.oScroll;(""!==r.sY||""!==r.sX)&&be(t),Ee(t,null,"column-sizing",[t])}function p(t,e){var n=v(t,"bVisible");return"number"==typeof n[e]?n[e]:null}function g(t,e){var n=v(t,"bVisible"),r=a.inArray(e,n);return-1!==r?r:null}function b(t){return v(t,"bVisible").length}function v(t,e){var n=[];return a.map(t.aoColumns,function(t,a){t[e]&&n.push(a)}),n}function S(t){var e,a,r,o,i,s,l,u,c,f=t.aoColumns,d=t.aoData,h=$e.ext.type.detect;for(e=0,a=f.length;a>e;e++)if(l=f[e],c=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){for(r=0,o=h.length;o>r;r++){for(i=0,s=d.length;s>i&&(c[i]===n&&(c[i]=T(t,i,e,"type")),u=h[r](c[i],t),u&&"html"!==u);i++);if(u){l.sType=u;break}}l.sType||(l.sType="string")}}function m(t,e,r,o){var i,s,l,u,c,d,h,p=t.aoColumns;if(e)for(i=e.length-1;i>=0;i--){h=e[i];var g=h.targets!==n?h.targets:h.aTargets;for(a.isArray(g)||(g=[g]),l=0,u=g.length;u>l;l++)if("number"==typeof g[l]&&g[l]>=0){for(;p.length<=g[l];)f(t);o(g[l],h)}else if("number"==typeof g[l]&&g[l]<0)o(p.length+g[l],h);else if("string"==typeof g[l])for(c=0,d=p.length;d>c;c++)("_all"==g[l]||a(p[c].nTh).hasClass(g[l]))&&o(c,h)}if(r)for(i=0,s=r.length;s>i;i++)o(i,r[i])}function D(t,e,n,r){var o=t.aoData.length,i=a.extend(!0,{},$e.models.oRow,{src:n?"dom":"data"});i._aData=e,t.aoData.push(i);for(var s=t.aoColumns,l=0,u=s.length;u>l;l++)n&&w(t,o,l,T(t,o,l)),s[l].sType=null;return t.aiDisplayMaster.push(o),(n||!t.oFeatures.bDeferRender)&&H(t,o,n,r),o}function y(t,e){var n;return e instanceof a||(e=a(e)),e.map(function(e,a){return n=j(t,a),D(t,n.data,a,n.cells)})}function _(t,e){return e._DT_RowIndex!==n?e._DT_RowIndex:null}function C(t,e,n){return a.inArray(n,t.aoData[e].anCells)}function T(t,e,a,r){var o=t.iDraw,i=t.aoColumns[a],s=t.aoData[e]._aData,l=i.sDefaultContent,u=i.fnGetData(s,r,{settings:t,row:e,col:a});if(u===n)return t.iDrawError!=o&&null===l&&(We(t,0,"Requested unknown parameter "+("function"==typeof i.mData?"{function}":"'"+i.mData+"'")+" for row "+e,4),t.iDrawError=o),l;if(u!==s&&null!==u||null===l){if("function"==typeof u)return u.call(s)}else u=l;return null===u&&"display"==r?"":u}function w(t,e,n,a){var r=t.aoColumns[n],o=t.aoData[e]._aData;r.fnSetData(o,a,{settings:t,row:e,col:n})}function x(t){return a.map(t.match(/(\\.|[^\.])+/g),function(t){return t.replace(/\\./g,".")})}function I(t){if(a.isPlainObject(t)){var e={};return a.each(t,function(t,n){n&&(e[t]=I(n))}),function(t,a,r,o){var i=e[a]||e._;return i!==n?i(t,a,r,o):t}}if(null===t)return function(t){return t};if("function"==typeof t)return function(e,n,a,r){return t(e,n,a,r)};if("string"!=typeof t||-1===t.indexOf(".")&&-1===t.indexOf("[")&&-1===t.indexOf("("))return function(e){return e[t]};var r=function(t,e,a){var o,i,s,l;if(""!==a)for(var u=x(a),c=0,f=u.length;f>c;c++){if(o=u[c].match(mn),i=u[c].match(Dn),o){u[c]=u[c].replace(mn,""),""!==u[c]&&(t=t[u[c]]),s=[],u.splice(0,c+1),l=u.join(".");for(var d=0,h=t.length;h>d;d++)s.push(r(t[d],e,l));var p=o[0].substring(1,o[0].length-1);t=""===p?s:s.join(p);break}if(i)u[c]=u[c].replace(Dn,""),t=t[u[c]]();else{if(null===t||t[u[c]]===n)return n;t=t[u[c]]}}return t};return function(e,n){return r(e,n,t)}}function A(t){if(a.isPlainObject(t))return A(t._);if(null===t)return function(){};if("function"==typeof t)return function(e,n,a){t(e,"set",n,a)};if("string"!=typeof t||-1===t.indexOf(".")&&-1===t.indexOf("[")&&-1===t.indexOf("("))return function(e,n){e[t]=n};var e=function(t,a,r){for(var o,i,s,l,u,c=x(r),f=c[c.length-1],d=0,h=c.length-1;h>d;d++){if(i=c[d].match(mn),s=c[d].match(Dn),i){c[d]=c[d].replace(mn,""),t[c[d]]=[],o=c.slice(),o.splice(0,d+1),u=o.join(".");for(var p=0,g=a.length;g>p;p++)l={},e(l,a[p],u),t[c[d]].push(l);return}s&&(c[d]=c[d].replace(Dn,""),t=t[c[d]](a)),(null===t[c[d]]||t[c[d]]===n)&&(t[c[d]]={}),t=t[c[d]]}f.match(Dn)?t=t[f.replace(Dn,"")](a):t[f.replace(mn,"")]=a};return function(n,a){return e(n,a,t)}}function F(t){return hn(t.aoData,"_aData")}function L(t){t.aoData.length=0,t.aiDisplayMaster.length=0,t.aiDisplay.length=0}function P(t,e,a){for(var r=-1,o=0,i=t.length;i>o;o++)t[o]==e?r=o:t[o]>e&&t[o]--;-1!=r&&a===n&&t.splice(r,1)}function R(t,e,a,r){var o,i,s=t.aoData[e];if("dom"!==a&&(a&&"auto"!==a||"dom"!==s.src)){var l,u=s.anCells;if(u)for(o=0,i=u.length;i>o;o++){for(l=u[o];l.childNodes.length;)l.removeChild(l.firstChild);u[o].innerHTML=T(t,e,o,"display")}}else s._aData=j(t,s).data;s._aSortData=null,s._aFilterData=null;var c=t.aoColumns;if(r!==n)c[r].sType=null;else for(o=0,i=c.length;i>o;o++)c[o].sType=null;N(s)}function j(t,e){var n,r,o,i=[],s=e.firstChild,l=0,u=t.aoColumns,c=t._rowReadObject,f=c?{}:[],d=function(t,e){if("string"==typeof t){var n=t.indexOf("@");if(-1!==n){var a=t.substring(n+1),r=A(t);r(f,e.getAttribute(a))}}},h=function(t){if(r=u[l],o=a.trim(t.innerHTML),r&&r._bAttrSrc){var e=A(r.mData._);e(f,o),d(r.mData.sort,t),d(r.mData.type,t),d(r.mData.filter,t)}else c?(r._setter||(r._setter=A(r.mData)),r._setter(f,o)):f.push(o);l++};if(s)for(;s;)n=s.nodeName.toUpperCase(),("TD"==n||"TH"==n)&&(h(s),i.push(s)),s=s.nextSibling;else{i=e.anCells;for(var p=0,g=i.length;g>p;p++)h(i[p])}return{data:f,cells:i}}function H(t,n,a,r){var o,i,s,l,u,c=t.aoData[n],f=c._aData,d=[];if(null===c.nTr){for(o=a||e.createElement("tr"),c.nTr=o,c.anCells=d,o._DT_RowIndex=n,N(c),l=0,u=t.aoColumns.length;u>l;l++)s=t.aoColumns[l],i=a?r[l]:e.createElement(s.sCellType),d.push(i),(!a||s.mRender||s.mData!==l)&&(i.innerHTML=T(t,n,l,"display")),s.sClass&&(i.className+=" "+s.sClass),s.bVisible&&!a?o.appendChild(i):!s.bVisible&&a&&i.parentNode.removeChild(i),s.fnCreatedCell&&s.fnCreatedCell.call(t.oInstance,i,T(t,n,l),f,n,l);Ee(t,"aoRowCreatedCallback",null,[o,f,n])}c.nTr.setAttribute("role","row")}function N(t){var e=t.nTr,n=t._aData;if(e){if(n.DT_RowId&&(e.id=n.DT_RowId),n.DT_RowClass){var r=n.DT_RowClass.split(" ");t.__rowc=t.__rowc?vn(t.__rowc.concat(r)):r,a(e).removeClass(t.__rowc.join(" ")).addClass(n.DT_RowClass)}n.DT_RowData&&a(e).data(n.DT_RowData)}}function W(t){var e,n,r,o,i,s=t.nTHead,l=t.nTFoot,u=0===a("th, td",s).length,c=t.oClasses,f=t.aoColumns;for(u&&(o=a("
    ").appendTo(s)),e=0,n=f.length;n>e;e++)i=f[e],r=a(i.nTh).addClass(i.sClass),u&&r.appendTo(o),t.oFeatures.bSort&&(r.addClass(i.sSortingClass),i.bSortable!==!1&&(r.attr("tabindex",t.iTabIndex).attr("aria-controls",t.sTableId),Le(t,i.nTh,e))),i.sTitle!=r.html()&&r.html(i.sTitle),Be(t,"header")(t,r,i,c);if(u&&E(t.aoHeader,s),a(s).find(">tr").attr("role","row"),a(s).find(">tr>th, >tr>td").addClass(c.sHeaderTH),a(l).find(">tr>th, >tr>td").addClass(c.sFooterTH),null!==l){var d=t.aoFooter[0];for(e=0,n=d.length;n>e;e++)i=f[e],i.nTf=d[e].cell,i.sClass&&a(i.nTf).addClass(i.sClass)}}function k(t,e,r){var o,i,s,l,u,c,f,d,h,p=[],g=[],b=t.aoColumns.length;if(e){for(r===n&&(r=!1),o=0,i=e.length;i>o;o++){for(p[o]=e[o].slice(),p[o].nTr=e[o].nTr,s=b-1;s>=0;s--)t.aoColumns[s].bVisible||r||p[o].splice(s,1);g.push([])}for(o=0,i=p.length;i>o;o++){if(f=p[o].nTr)for(;c=f.firstChild;)f.removeChild(c);for(s=0,l=p[o].length;l>s;s++)if(d=1,h=1,g[o][s]===n){for(f.appendChild(p[o][s].cell),g[o][s]=1;p[o+d]!==n&&p[o][s].cell==p[o+d][s].cell;)g[o+d][s]=1,d++;for(;p[o][s+h]!==n&&p[o][s].cell==p[o][s+h].cell;){for(u=0;d>u;u++)g[o+u][s+h]=1;h++}a(p[o][s].cell).attr("rowspan",d).attr("colspan",h)}}}}function O(t){var e=Ee(t,"aoPreDrawCallback","preDraw",[t]);if(-1!==a.inArray(!1,e))return void pe(t,!1);var r=[],o=0,i=t.asStripeClasses,s=i.length,l=(t.aoOpenRows.length,t.oLanguage),u=t.iInitDisplayStart,c="ssp"==Xe(t),f=t.aiDisplay;t.bDrawing=!0,u!==n&&-1!==u&&(t._iDisplayStart=c?u:u>=t.fnRecordsDisplay()?0:u,t.iInitDisplayStart=-1);var d=t._iDisplayStart,h=t.fnDisplayEnd();if(t.bDeferLoading)t.bDeferLoading=!1,t.iDraw++,pe(t,!1);else if(c){if(!t.bDestroying&&!X(t))return}else t.iDraw++;if(0!==f.length)for(var p=c?0:d,g=c?t.aoData.length:h,v=p;g>v;v++){var S=f[v],m=t.aoData[S];null===m.nTr&&H(t,S);var D=m.nTr;if(0!==s){var y=i[o%s];m._sRowStripe!=y&&(a(D).removeClass(m._sRowStripe).addClass(y),m._sRowStripe=y)}Ee(t,"aoRowCallback",null,[D,m._aData,o,v]),r.push(D),o++}else{var _=l.sZeroRecords;1==t.iDraw&&"ajax"==Xe(t)?_=l.sLoadingRecords:l.sEmptyTable&&0===t.fnRecordsTotal()&&(_=l.sEmptyTable),r[0]=a("",{"class":s?i[0]:""}).append(a(""));C.find("tfoot th, tfoot td").css("width","");var T=C.find("tbody tr");for(m=J(e,C.find("thead")[0]),n=0;nn;n++)u[n].sWidth=Te(m.eq(n).width());D&&(l.style.width=Te(D)),!D&&!d||e._reszEvt||(a(t).bind("resize.DT-"+e.sInstance,me(function(){h(e)})),e._reszEvt=!0)}function me(t,e){var a,r,o=e!==n?e:200;return function(){var e=this,i=+new Date,s=arguments;a&&a+o>i?(clearTimeout(r),r=setTimeout(function(){a=n,t.apply(e,s)},o)):a?(a=i,t.apply(e,s)):a=i}}function De(t,n){if(!t)return 0;var r=a("
    ").css("width",Te(t)).appendTo(n||e.body),o=r[0].offsetWidth;return r.remove(),o}function ye(t,e){var n=t.oScroll;if(n.sX||n.sY){var r=n.sX?0:n.iBarWidth;e.style.width=Te(a(e).outerWidth()-r)}}function _e(t,e){var n=Ce(t,e);if(0>n)return null;var r=t.aoData[n];return r.nTr?r.anCells[e]:a("
    ").appendTo(this)),x.nTHead=M[0];var U=a(this).children("tbody");0===U.length&&(U=a("").appendTo(this)),x.nTBody=U[0];var B=a(this).children("tfoot");if(0===B.length&&O.length>0&&(""!==x.oScroll.sX||""!==x.oScroll.sY)&&(B=a("").appendTo(this)),0===B.length||0===B.children().length?a(this).addClass(I.sNoFooter):B.length>0&&(x.nTFoot=B[0],E(x.aoFooter,x.nTFoot)),g.aaData)for(b=0;bo;o++)r(t[o]);else r(t);this.context=vn(n),e&&this.push.apply(this,e.toArray?e.toArray():e),this.selector={rows:null,cols:null,opts:null},ze.extend(this,this,Tn)},$e.Api=ze,ze.prototype={concat:wn.concat,context:[],each:function(t){for(var e=0,n=this.length;n>e;e++)t.call(this,this[e],e,this);return this},eq:function(t){var e=this.context;return e.length>t?new ze(e[t],this[t]):null},filter:function(t){var e=[];if(wn.filter)e=wn.filter.call(this,t,this);else for(var n=0,a=this.length;a>n;n++)t.call(this,this[n],n,this)&&e.push(this[n]);return new ze(this.context,e)},flatten:function(){var t=[];return new ze(this.context,t.concat.apply(t,this.toArray()))},join:wn.join,indexOf:wn.indexOf||function(t,e){for(var n=e||0,a=this.length;a>n;n++)if(this[n]===t)return n;return-1},iterator:function(t,e,a){var r,o,i,s,l,u,c,f,d=[],h=this.context,p=this.selector;for("string"==typeof t&&(a=e,e=t,t=!1),o=0,i=h.length;i>o;o++){var g=new ze(h[o]);if("table"===e)r=a.call(g,h[o],o),r!==n&&d.push(r);else if("columns"===e||"rows"===e)r=a.call(g,h[o],this[o],o),r!==n&&d.push(r);else if("column"===e||"column-rows"===e||"row"===e||"cell"===e)for(c=this[o],"column-rows"===e&&(u=Rn(h[o],p.opts)),s=0,l=c.length;l>s;s++)f=c[s],r="cell"===e?a.call(g,h[o],f.row,f.column,o,s):a.call(g,h[o],f,o,s,u),r!==n&&d.push(r)}if(d.length){var b=new ze(h,t?d.concat.apply([],d):d),v=b.selector;return v.rows=p.rows,v.cols=p.cols,v.opts=p.opts,b}return this},lastIndexOf:wn.lastIndexOf||function(){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(t){var e=[];if(wn.map)e=wn.map.call(this,t,this);else for(var n=0,a=this.length;a>n;n++)e.push(t.call(this,this[n],n));return new ze(this.context,e)},pluck:function(t){return this.map(function(e){return e[t]})},pop:wn.pop,push:wn.push,reduce:wn.reduce||function(t,e){return c(this,t,e,0,this.length,1)},reduceRight:wn.reduceRight||function(t,e){return c(this,t,e,this.length-1,-1,-1)},reverse:wn.reverse,selector:null,shift:wn.shift,sort:wn.sort,splice:wn.splice,toArray:function(){return wn.slice.call(this)},to$:function(){return a(this)},toJQuery:function(){return a(this)},unique:function(){return new ze(this.context,vn(this))},unshift:wn.unshift},ze.extend=function(t,e,n){if(e&&(e instanceof ze||e.__dt_wrapper)){var r,o,i,s=function(t,e,n){return function(){var a=e.apply(t,arguments);return ze.extend(a,a,n.methodExt),a}};for(r=0,o=n.length;o>r;r++)i=n[r],e[i.name]="function"==typeof i.val?s(t,i.val,i):a.isPlainObject(i.val)?{}:i.val,e[i.name].__dt_wrapper=!0,ze.extend(t,e[i.name],i.propExt)}},ze.register=Qe=function(t,e){if(a.isArray(t))for(var n=0,r=t.length;r>n;n++)ze.register(t[n],e);else{var o,i,s,l,u=t.split("."),c=Tn,f=function(t,e){for(var n=0,a=t.length;a>n;n++)if(t[n].name===e)return t[n];return null};for(o=0,i=u.length;i>o;o++){l=-1!==u[o].indexOf("()"),s=l?u[o].replace("()",""):u[o];var d=f(c,s);d||(d={name:s,val:{},methodExt:[],propExt:[]},c.push(d)),o===i-1?d.val=e:c=l?d.methodExt:d.propExt}}},ze.registerPlural=Ze=function(t,e,r){ze.register(t,r),ze.register(e,function(){var t=r.apply(this,arguments);return t===this?this:t instanceof ze?t.length?a.isArray(t[0])?new ze(t.context,t[0]):t[0]:n:t})};var In=function(t,e){if("number"==typeof t)return[e[t]];var n=a.map(e,function(t){return t.nTable});return a(n).filter(t).map(function(){var t=a.inArray(this,n);return e[t]}).toArray()};Qe("tables()",function(t){return t?new ze(In(t,this.context)):this}),Qe("table()",function(t){var e=this.tables(t),n=e.context;return n.length?new ze(n[0]):e}),Ze("tables().nodes()","table().node()",function(){return this.iterator("table",function(t){return t.nTable})}),Ze("tables().body()","table().body()",function(){return this.iterator("table",function(t){return t.nTBody})}),Ze("tables().header()","table().header()",function(){return this.iterator("table",function(t){return t.nTHead})}),Ze("tables().footer()","table().footer()",function(){return this.iterator("table",function(t){return t.nTFoot})}),Ze("tables().containers()","table().container()",function(){return this.iterator("table",function(t){return t.nTableWrapper})}),Qe("draw()",function(t){return this.iterator("table",function(e){M(e,t===!1)})}),Qe("page()",function(t){return t===n?this.page.info().page:this.iterator("table",function(e){de(e,t)})}),Qe("page.info()",function(){if(0===this.context.length)return n;var t=this.context[0],e=t._iDisplayStart,a=t._iDisplayLength,r=t.fnRecordsDisplay(),o=-1===a;return{page:o?0:Math.floor(e/a),pages:o?1:Math.ceil(r/a),start:e,end:t.fnDisplayEnd(),length:a,recordsTotal:t.fnRecordsTotal(),recordsDisplay:r}}),Qe("page.len()",function(t){return t===n?0!==this.context.length?this.context[0]._iDisplayLength:n:this.iterator("table",function(e){ue(e,t)})});var An=function(t,e,n){if("ssp"==Xe(t)?M(t,e):(pe(t,!0),B(t,[],function(n){L(t);for(var a=G(t,n),r=0,o=a.length;o>r;r++)D(t,a[r]);M(t,e),pe(t,!1)})),n){var a=new ze(t);a.one("draw",function(){n(a.ajax.json())})}};Qe("ajax.json()",function(){var t=this.context;return t.length>0?t[0].json:void 0}),Qe("ajax.params()",function(){var t=this.context;return t.length>0?t[0].oAjaxData:void 0}),Qe("ajax.reload()",function(t,e){return this.iterator("table",function(n){An(n,e===!1,t)})}),Qe("ajax.url()",function(t){var e=this.context;return t===n?0===e.length?n:(e=e[0],e.ajax?a.isPlainObject(e.ajax)?e.ajax.url:e.ajax:e.sAjaxSource):this.iterator("table",function(e){a.isPlainObject(e.ajax)?e.ajax.url=t:e.ajax=t})}),Qe("ajax.url().load()",function(t,e){return this.iterator("table",function(n){An(n,e===!1,t)})});var Fn=function(t,e){var r,o,i,s,l,u,c=[],f=typeof t;for(t&&"string"!==f&&"function"!==f&&t.length!==n||(t=[t]),i=0,s=t.length;s>i;i++)for(o=t[i]&&t[i].split?t[i].split(","):[t[i]],l=0,u=o.length;u>l;l++)r=e("string"==typeof o[l]?a.trim(o[l]):o[l]),r&&r.length&&c.push.apply(c,r);return c},Ln=function(t){return t||(t={}),t.filter&&!t.search&&(t.search=t.filter),{search:t.search||"none",order:t.order||"current",page:t.page||"all"}},Pn=function(t){for(var e=0,n=t.length;n>e;e++)if(t[e].length>0)return t[0]=t[e],t.length=1,t.context=[t.context[e]],t;return t.length=0,t},Rn=function(t,e){var n,r,o,i=[],s=t.aiDisplay,l=t.aiDisplayMaster,u=e.search,c=e.order,f=e.page;if("ssp"==Xe(t))return"removed"===u?[]:gn(0,l.length);if("current"==f)for(n=t._iDisplayStart,r=t.fnDisplayEnd();r>n;n++)i.push(s[n]);else if("current"==c||"applied"==c)i="none"==u?l.slice():"applied"==u?s.slice():a.map(l,function(t){return-1===a.inArray(t,s)?t:null});else if("index"==c||"original"==c)for(n=0,r=t.aoData.length;r>n;n++)"none"==u?i.push(n):(o=a.inArray(n,s),(-1===o&&"removed"==u||o>=0&&"applied"==u)&&i.push(n));return i},jn=function(t,e,n){return Fn(e,function(e){var r=ln(e);if(null!==r&&!n)return[r];var o=Rn(t,n);if(null!==r&&-1!==a.inArray(r,o))return[r];if(!e)return o;var i=pn(t.aoData,o,"nTr");return"function"==typeof e?a.map(o,function(n){var a=t.aoData[n];return e(n,a._aData,a.nTr)?n:null}):e.nodeName&&-1!==a.inArray(e,i)?[e._DT_RowIndex]:a(i).filter(e).map(function(){return this._DT_RowIndex}).toArray()})};Qe("rows()",function(t,e){t===n?t="":a.isPlainObject(t)&&(e=t,t=""),e=Ln(e);var r=this.iterator("table",function(n){return jn(n,t,e)});return r.selector.rows=t,r.selector.opts=e,r}),Qe("rows().nodes()",function(){return this.iterator("row",function(t,e){return t.aoData[e].nTr||n})}),Qe("rows().data()",function(){return this.iterator(!0,"rows",function(t,e){return pn(t.aoData,e,"_aData")})}),Ze("rows().cache()","row().cache()",function(t){return this.iterator("row",function(e,n){var a=e.aoData[n];return"search"===t?a._aFilterData:a._aSortData})}),Ze("rows().invalidate()","row().invalidate()",function(t){return this.iterator("row",function(e,n){R(e,n,t)})}),Ze("rows().indexes()","row().index()",function(){return this.iterator("row",function(t,e){return e})}),Ze("rows().remove()","row().remove()",function(){var t=this;return this.iterator("row",function(e,n,r){var o=e.aoData;o.splice(n,1);for(var i=0,s=o.length;s>i;i++)null!==o[i].nTr&&(o[i].nTr._DT_RowIndex=i);a.inArray(n,e.aiDisplay);P(e.aiDisplayMaster,n),P(e.aiDisplay,n),P(t[r],n,!1),Je(e)})}),Qe("rows.add()",function(t){var e=this.iterator("table",function(e){var n,a,r,o=[];for(a=0,r=t.length;r>a;a++)n=t[a],o.push(n.nodeName&&"TR"===n.nodeName.toUpperCase()?y(e,n)[0]:D(e,n));return o}),n=this.rows(-1);return n.pop(),n.push.apply(n,e.toArray()),n}),Qe("row()",function(t,e){return Pn(this.rows(t,e))}),Qe("row().data()",function(t){var e=this.context;return t===n?e.length&&this.length?e[0].aoData[this[0]]._aData:n:(e[0].aoData[this[0]]._aData=t,R(e[0],this[0],"data"),this)}),Qe("row().node()",function(){var t=this.context;return t.length&&this.length?t[0].aoData[this[0]].nTr||null:null}),Qe("row.add()",function(t){t instanceof a&&t.length&&(t=t[0]);var e=this.iterator("table",function(e){return t.nodeName&&"TR"===t.nodeName.toUpperCase()?y(e,t)[0]:D(e,t)});return this.row(e[0])});var Hn=function(t,e,n,r){var o=[],i=function(e,n){if(e.nodeName&&"tr"===e.nodeName.toLowerCase())o.push(e);else{var r=a("").addClass(n);a("td",r).addClass(n).html(e)[0].colSpan=b(t),o.push(r[0])}};if(a.isArray(n)||n instanceof a)for(var s=0,l=n.length;l>s;s++)i(n[s],r);else i(n,r);e._details&&e._details.remove(),e._details=a(o),e._detailsShow&&e._details.insertAfter(e.nTr)},Nn=function(t,e){var a=t.context;if(a.length){var r=a[0].aoData[e!==n?e:t[0]];r._details&&(r._details.remove(),r._detailsShow=n,r._details=n)}},Wn=function(t,e){var n=t.context;if(n.length&&t.length){var a=n[0].aoData[t[0]];a._details&&(a._detailsShow=e,e?a._details.insertAfter(a.nTr):a._details.detach(),kn(n[0]))}},kn=function(t){var e=new ze(t),n=".dt.DT_details",a="draw"+n,r="column-visibility"+n,o="destroy"+n,i=t.aoData;e.off(a+" "+r+" "+o),hn(i,"_details").length>0&&(e.on(a,function(n,a){t===a&&e.rows({page:"current"}).eq(0).each(function(t){var e=i[t];e._detailsShow&&e._details.insertAfter(e.nTr)})}),e.on(r,function(e,n){if(t===n)for(var a,r=b(n),o=0,s=i.length;s>o;o++)a=i[o],a._details&&a._details.children("td[colspan]").attr("colspan",r)}),e.on(o,function(n,a){if(t===a)for(var r=0,o=i.length;o>r;r++)i[r]._details&&Nn(e,r)}))},On="",Mn=On+"row().child",Un=Mn+"()";Qe(Un,function(t,e){var a=this.context;return t===n?a.length&&this.length?a[0].aoData[this[0]]._details:n:(t===!0?this.child.show():t===!1?Nn(this):a.length&&this.length&&Hn(a[0],a[0].aoData[this[0]],t,e),this)}),Qe([Mn+".show()",Un+".show()"],function(){return Wn(this,!0),this}),Qe([Mn+".hide()",Un+".hide()"],function(){return Wn(this,!1),this}),Qe([Mn+".remove()",Un+".remove()"],function(){return Nn(this),this}),Qe(Mn+".isShown()",function(){var t=this.context;return t.length&&this.length?t[0].aoData[this[0]]._detailsShow||!1:!1});var En=/^(.+):(name|visIdx|visible)$/,Jn=function(t,e,n,a,r){for(var o=[],i=0,s=r.length;s>i;i++)o.push(T(t,r[i],e));return o},Bn=function(t,e,n){var r=t.aoColumns,o=hn(r,"sName"),i=hn(r,"nTh");return Fn(e,function(e){var s=ln(e);if(""===e)return gn(r.length);if(null!==s)return[s>=0?s:r.length+s];if("function"==typeof e){var l=Rn(t,n);return a.map(r,function(n,a){return e(a,Jn(t,a,0,0,l),i[a])?a:null})}var u="string"==typeof e?e.match(En):"";if(!u)return a(i).filter(e).map(function(){return a.inArray(this,i)}).toArray();switch(u[2]){case"visIdx":case"visible":var c=parseInt(u[1],10);if(0>c){var f=a.map(r,function(t,e){return t.bVisible?e:null});return[f[f.length+c]]}return[p(t,c)];case"name":return a.map(o,function(t,e){return t===u[1]?e:null})}})},Xn=function(t,e,r,o){var i,s,l,u,c=t.aoColumns,f=c[e],d=t.aoData;if(r===n)return f.bVisible;if(f.bVisible!==r){if(r){var p=a.inArray(!0,hn(c,"bVisible"),e+1);for(s=0,l=d.length;l>s;s++)u=d[s].nTr,i=d[s].anCells,u&&u.insertBefore(i[e],i[p]||null)}else a(hn(t.aoData,"anCells",e)).detach();f.bVisible=r,k(t,t.aoHeader),k(t,t.aoFooter),(o===n||o)&&(h(t),(t.oScroll.sX||t.oScroll.sY)&&be(t)),Ee(t,null,"column-visibility",[t,e,r]),je(t)}};Qe("columns()",function(t,e){t===n?t="":a.isPlainObject(t)&&(e=t,t=""),e=Ln(e);var r=this.iterator("table",function(n){return Bn(n,t,e)});return r.selector.cols=t,r.selector.opts=e,r}),Ze("columns().header()","column().header()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].nTh})}),Ze("columns().footer()","column().footer()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].nTf})}),Ze("columns().data()","column().data()",function(){return this.iterator("column-rows",Jn)}),Ze("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].mData})}),Ze("columns().cache()","column().cache()",function(t){return this.iterator("column-rows",function(e,n,a,r,o){return pn(e.aoData,o,"search"===t?"_aFilterData":"_aSortData",n)})}),Ze("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(t,e,n,a,r){return pn(t.aoData,r,"anCells",e)})}),Ze("columns().visible()","column().visible()",function(t,e){return this.iterator("column",function(a,r){return t===n?a.aoColumns[r].bVisible:Xn(a,r,t,e)})}),Ze("columns().indexes()","column().index()",function(t){return this.iterator("column",function(e,n){return"visible"===t?g(e,n):n})}),Qe("columns.adjust()",function(){return this.iterator("table",function(t){h(t)})}),Qe("column.index()",function(t,e){if(0!==this.context.length){var n=this.context[0];if("fromVisible"===t||"toData"===t)return p(n,e);if("fromData"===t||"toVisible"===t)return g(n,e)}}),Qe("column()",function(t,e){return Pn(this.columns(t,e))});var Vn=function(t,e,r){var o,i,s,l,u,c,f,d=t.aoData,h=Rn(t,r),p=pn(d,h,"anCells"),g=a([].concat.apply([],p)),b=t.aoColumns.length;return Fn(e,function(e){var r="function"==typeof e;if(null===e||e===n||r){for(i=[],s=0,l=h.length;l>s;s++)for(o=h[s],u=0;b>u;u++)c={row:o,column:u},r?(f=t.aoData[o],e(c,T(t,o,u),f.anCells[u])&&i.push(c)):i.push(c);return i}return a.isPlainObject(e)?[e]:g.filter(e).map(function(t,e){return o=e.parentNode._DT_RowIndex,{row:o,column:a.inArray(e,d[o].anCells)}}).toArray()})};Qe("cells()",function(t,e,r){if(a.isPlainObject(t)&&(typeof t.row!==n?(r=e,e=null):(r=t,t=null)),a.isPlainObject(e)&&(r=e,e=null),null===e||e===n)return this.iterator("table",function(e){return Vn(e,t,Ln(r))});var o,i,s,l,u,c=this.columns(e,r),f=this.rows(t,r),d=this.iterator("table",function(t,e){for(o=[],i=0,s=f[e].length;s>i;i++)for(l=0,u=c[e].length;u>l;l++)o.push({row:f[e][i],column:c[e][l]});return o});return a.extend(d.selector,{cols:e,rows:t,opts:r}),d}),Ze("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(t,e,n){return t.aoData[e].anCells[n]})}),Qe("cells().data()",function(){return this.iterator("cell",function(t,e,n){return T(t,e,n)})}),Ze("cells().cache()","cell().cache()",function(t){return t="search"===t?"_aFilterData":"_aSortData",this.iterator("cell",function(e,n,a){return e.aoData[n][t][a]})}),Ze("cells().render()","cell().render()",function(t){return this.iterator("cell",function(e,n,a){return T(e,n,a,t)})}),Ze("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(t,e,n){return{row:e,column:n,columnVisible:g(t,n)}})}),Qe(["cells().invalidate()","cell().invalidate()"],function(t){var e=this.selector;return this.rows(e.rows,e.opts).invalidate(t),this}),Qe("cell()",function(t,e,n){return Pn(this.cells(t,e,n))}),Qe("cell().data()",function(t){var e=this.context,a=this[0];return t===n?e.length&&a.length?T(e[0],a[0].row,a[0].column):n:(w(e[0],a[0].row,a[0].column,t),R(e[0],a[0].row,"data",a[0].column),this)}),Qe("order()",function(t,e){var r=this.context;return t===n?0!==r.length?r[0].aaSorting:n:("number"==typeof t?t=[[t,e]]:a.isArray(t[0])||(t=Array.prototype.slice.call(arguments)),this.iterator("table",function(e){e.aaSorting=t.slice()}))}),Qe("order.listener()",function(t,e,n){return this.iterator("table",function(a){Le(a,t,e,n)})}),Qe(["columns().order()","column().order()"],function(t){var e=this;return this.iterator("table",function(n,r){var o=[];a.each(e[r],function(e,n){o.push([n,t])}),n.aaSorting=o})}),Qe("search()",function(t,e,r,o){var i=this.context;return t===n?0!==i.length?i[0].oPreviousSearch.sSearch:n:this.iterator("table",function(n){n.oFeatures.bFilter&&Y(n,a.extend({},n.oPreviousSearch,{sSearch:t+"",bRegex:null===e?!1:e,bSmart:null===r?!0:r,bCaseInsensitive:null===o?!0:o}),1)})}),Ze("columns().search()","column().search()",function(t,e,r,o){return this.iterator("column",function(i,s){var l=i.aoPreSearchCols;return t===n?l[s].sSearch:void(i.oFeatures.bFilter&&(a.extend(l[s],{sSearch:t+"",bRegex:null===e?!1:e,bSmart:null===r?!0:r,bCaseInsensitive:null===o?!0:o}),Y(i,i.oPreviousSearch,1)))})}),Qe("state()",function(){return this.context.length?this.context[0].oSavedState:null}),Qe("state.clear()",function(){return this.iterator("table",function(t){t.fnStateSaveCallback.call(t.oInstance,t,{})})}),Qe("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null}),Qe("state.save()",function(){return this.iterator("table",function(t){je(t)})}),$e.versionCheck=$e.fnVersionCheck=function(t){for(var e,n,a=$e.version.split("."),r=t.split("."),o=0,i=r.length;i>o;o++)if(e=parseInt(a[o],10)||0,n=parseInt(r[o],10)||0,e!==n)return e>n;return!0},$e.isDataTable=$e.fnIsDataTable=function(t){var e=a(t).get(0),n=!1;return a.each($e.settings,function(t,a){(a.nTable===e||a.nScrollHead===e||a.nScrollFoot===e)&&(n=!0)}),n},$e.tables=$e.fnTables=function(t){return jQuery.map($e.settings,function(e){return!t||t&&a(e.nTable).is(":visible")?e.nTable:void 0})},$e.util={throttle:me},$e.camelToHungarian=o,Qe("$()",function(t,e){var n=this.rows(e).nodes(),r=a(n); +return a([].concat(r.filter(t).toArray(),r.find(t).toArray()))}),a.each(["on","one","off"],function(t,e){Qe(e+"()",function(){var t=Array.prototype.slice.call(arguments);t[0].match(/\.dt\b/)||(t[0]+=".dt");var n=a(this.tables().nodes());return n[e].apply(n,t),this})}),Qe("clear()",function(){return this.iterator("table",function(t){L(t)})}),Qe("settings()",function(){return new ze(this.context,this.context)}),Qe("data()",function(){return this.iterator("table",function(t){return hn(t.aoData,"_aData")}).flatten()}),Qe("destroy()",function(e){return e=e||!1,this.iterator("table",function(n){var r,o=n.nTableWrapper.parentNode,i=n.oClasses,s=n.nTable,l=n.nTBody,u=n.nTHead,c=n.nTFoot,f=a(s),d=a(l),h=a(n.nTableWrapper),p=a.map(n.aoData,function(t){return t.nTr});n.bDestroying=!0,Ee(n,"aoDestroyCallback","destroy",[n]),e||new ze(n).columns().visible(!0),h.unbind(".DT").find(":not(tbody *)").unbind(".DT"),a(t).unbind(".DT-"+n.sInstance),s!=u.parentNode&&(f.children("thead").detach(),f.append(u)),c&&s!=c.parentNode&&(f.children("tfoot").detach(),f.append(c)),f.detach(),h.detach(),n.aaSorting=[],n.aaSortingFixed=[],Pe(n),a(p).removeClass(n.asStripeClasses.join(" ")),a("th, td",u).removeClass(i.sSortable+" "+i.sSortableAsc+" "+i.sSortableDesc+" "+i.sSortableNone),n.bJUI&&(a("th span."+i.sSortIcon+", td span."+i.sSortIcon,u).detach(),a("th, td",u).each(function(){var t=a("div."+i.sSortJUIWrapper,this);a(this).append(t.contents()),t.detach()})),!e&&o&&o.insertBefore(s,n.nTableReinsertBefore),d.children().detach(),d.append(p),f.css("width",n.sDestroyWidth).removeClass(i.sTable),r=n.asDestroyStripes.length,r&&d.children().each(function(t){a(this).addClass(n.asDestroyStripes[t%r])});var g=a.inArray(n,$e.settings);-1!==g&&$e.settings.splice(g,1)})}),$e.version="1.10.3",$e.settings=[],$e.models={},$e.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0},$e.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null},$e.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null},$e.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(t){try{return JSON.parse((-1===t.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+t.sInstance+"_"+location.pathname))}catch(e){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(t,e){try{(-1===t.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+t.sInstance+"_"+location.pathname,JSON.stringify(e))}catch(n){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:a.extend({},$e.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null},r($e.defaults),$e.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null},r($e.defaults.column),$e.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:n,oAjaxData:n,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==Xe(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==Xe(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var t=this._iDisplayLength,e=this._iDisplayStart,n=e+t,a=this.aiDisplay.length,r=this.oFeatures,o=r.bPaginate;return r.bServerSide?o===!1||-1===t?e+a:Math.min(e+t,this._iRecordsDisplay):!o||n>a||-1===t?a:n},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{}},$e.ext=Ye={classes:{},errMode:"alert",feature:[],search:[],internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:$e.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:$e.version},a.extend(Ye,{afnFiltering:Ye.search,aTypes:Ye.type.detect,ofnSearch:Ye.type.search,oSort:Ye.type.order,afnSortData:Ye.order,aoFeatures:Ye.feature,oApi:Ye.internal,oStdClasses:Ye.classes,oPagination:Ye.pager}),a.extend($e.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter form-group",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length form-group",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""}),function(){var t="";t="";var e=t+"ui-state-default",n=t+"css_right ui-icon ui-icon-",r=t+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";a.extend($e.ext.oJUIClasses,$e.ext.classes,{sPageButton:"fg-button ui-button "+e,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:e+" sorting_asc",sSortDesc:e+" sorting_desc",sSortable:e+" sorting",sSortableAsc:e+" sorting_asc_disabled",sSortableDesc:e+" sorting_desc_disabled",sSortableNone:e+" sorting_disabled",sSortJUIAsc:n+"triangle-1-n",sSortJUIDesc:n+"triangle-1-s",sSortJUI:n+"carat-2-n-s",sSortJUIAscAllowed:n+"carat-1-n",sSortJUIDescAllowed:n+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+e,sScrollFoot:"dataTables_scrollFoot "+e,sHeaderTH:e,sFooterTH:e,sJUIHeader:r+" ui-corner-tl ui-corner-tr",sJUIFooter:r+" ui-corner-bl ui-corner-br"})}();var qn=$e.ext.pager;a.extend(qn,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},simple_numbers:function(t,e){return["previous",Ve(t,e),"next"]},full_numbers:function(t,e){return["first","previous",Ve(t,e),"next","last"]},_numbers:Ve,numbers_length:7}),a.extend(!0,$e.ext.renderer,{pageButton:{_:function(t,n,r,o,i,s){var l,u,c=t.oClasses,f=t.oLanguage.oPaginate,d=0,h=function(e,n){var o,p,g,b,v=function(e){de(t,e.data.action,!0)};for(o=0,p=n.length;p>o;o++)if(b=n[o],a.isArray(b)){var S=a("<"+(b.DT_el||"div")+"/>").appendTo(e);h(S,b)}else{switch(l="",u="",b){case"ellipsis":e.append("");break;case"first":l=f.sFirst,u=b+(i>0?"":" "+c.sPageButtonDisabled);break;case"previous":l=f.sPrevious,u=b+(i>0?"":" "+c.sPageButtonDisabled);break;case"next":l=f.sNext,u=b+(s-1>i?"":" "+c.sPageButtonDisabled);break;case"last":l=f.sLast,u=b+(s-1>i?"":" "+c.sPageButtonDisabled);break;default:l=b+1,u=i===b?c.sPageButtonActive:""}l&&(g=a("",{"class":c.sPageButton+" "+u,"aria-controls":t.sTableId,"data-dt-idx":d,tabindex:t.iTabIndex,id:0===r&&"string"==typeof b?t.sTableId+"_"+b:null}).html(l).appendTo(e),Me(g,{action:b},v),d++)}};try{var p=a(e.activeElement).data("dt-idx");h(a(n).empty(),o),null!==p&&a(n).find("[data-dt-idx="+p+"]").focus()}catch(g){}}}});var Gn=function(t,e,n,a){return 0===t||t&&"-"!==t?(e&&(t=un(t,e)),t.replace&&(n&&(t=t.replace(n,"")),a&&(t=t.replace(a,""))),1*t):-1/0};return a.extend(Ye.type.order,{"date-pre":function(t){return Date.parse(t)||0},"html-pre":function(t){return sn(t)?"":t.replace?t.replace(/<.*?>/g,"").toLowerCase():t+""},"string-pre":function(t){return sn(t)?"":"string"==typeof t?t.toLowerCase():t.toString?t.toString():""},"string-asc":function(t,e){return e>t?-1:t>e?1:0},"string-desc":function(t,e){return e>t?1:t>e?-1:0}}),qe(""),a.extend($e.ext.type.detect,[function(t,e){var n=e.oLanguage.sDecimal;return cn(t,n)?"num"+n:null},function(t){if(!(!t||t instanceof Date||nn.test(t)&&an.test(t)))return null;var e=Date.parse(t);return null!==e&&!isNaN(e)||sn(t)?"date":null},function(t,e){var n=e.oLanguage.sDecimal;return cn(t,n,!0)?"num-fmt"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return dn(t,n)?"html-num"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return dn(t,n,!0)?"html-num-fmt"+n:null},function(t){return sn(t)||"string"==typeof t&&-1!==t.indexOf("<")?"html":null}]),a.extend($e.ext.type.search,{html:function(t){return sn(t)?t:"string"==typeof t?t.replace(tn," ").replace(en,""):""},string:function(t){return sn(t)?t:"string"==typeof t?t.replace(tn," "):t}}),a.extend(!0,$e.ext.renderer,{header:{_:function(t,e,n,r){a(t.nTable).on("order.dt.DT",function(a,o,i,s){if(t===o){var l=n.idx;e.removeClass(n.sSortingClass+" "+r.sSortAsc+" "+r.sSortDesc).addClass("asc"==s[l]?r.sSortAsc:"desc"==s[l]?r.sSortDesc:n.sSortingClass)}})},jqueryui:function(t,e,n,r){a("
    ").addClass(r.sSortJUIWrapper).append(e.contents()).append(a("").addClass(r.sSortIcon+" "+n.sSortingClassJUI)).appendTo(e),a(t.nTable).on("order.dt.DT",function(a,o,i,s){if(t===o){var l=n.idx;e.removeClass(r.sSortAsc+" "+r.sSortDesc).addClass("asc"==s[l]?r.sSortAsc:"desc"==s[l]?r.sSortDesc:n.sSortingClass),e.find("span."+r.sSortIcon).removeClass(r.sSortJUIAsc+" "+r.sSortJUIDesc+" "+r.sSortJUI+" "+r.sSortJUIAscAllowed+" "+r.sSortJUIDescAllowed).addClass("asc"==s[l]?r.sSortJUIAsc:"desc"==s[l]?r.sSortJUIDesc:n.sSortingClassJUI)}})}}}),$e.render={number:function(t,e,n,a){return{display:function(r){var o=0>r?"-":"";r=Math.abs(parseFloat(r));var i=parseInt(r,10),s=n?e+(r-i).toFixed(n).substring(2):"";return o+(a||"")+i.toString().replace(/\B(?=(\d{3})+(?!\d))/g,t)+s}}}},a.extend($e.ext.internal,{_fnExternApiFunc:Ge,_fnBuildAjax:B,_fnAjaxUpdate:X,_fnAjaxParameters:V,_fnAjaxUpdateDraw:q,_fnAjaxDataSrc:G,_fnAddColumn:f,_fnColumnOptions:d,_fnAdjustColumnSizing:h,_fnVisibleToColumnIndex:p,_fnColumnIndexToVisible:g,_fnVisbleColumns:b,_fnGetColumns:v,_fnColumnTypes:S,_fnApplyColumnDefs:m,_fnHungarianMap:r,_fnCamelToHungarian:o,_fnLanguageCompat:i,_fnBrowserDetect:u,_fnAddData:D,_fnAddTr:y,_fnNodeToDataIndex:_,_fnNodeToColumnIndex:C,_fnGetCellData:T,_fnSetCellData:w,_fnSplitObjNotation:x,_fnGetObjectDataFn:I,_fnSetObjectDataFn:A,_fnGetDataMaster:F,_fnClearTable:L,_fnDeleteIndex:P,_fnInvalidateRow:R,_fnGetRowElements:j,_fnCreateTr:H,_fnBuildHead:W,_fnDrawHead:k,_fnDraw:O,_fnReDraw:M,_fnAddOptionsHtml:U,_fnDetectHeader:E,_fnGetUniqueThs:J,_fnFeatureHtmlFilter:$,_fnFilterComplete:Y,_fnFilterCustom:z,_fnFilterColumn:Q,_fnFilter:Z,_fnFilterCreateSearch:K,_fnEscapeRegex:te,_fnFilterData:ee,_fnFeatureHtmlInfo:re,_fnUpdateInfo:oe,_fnInfoMacros:ie,_fnInitialise:se,_fnInitComplete:le,_fnLengthChange:ue,_fnFeatureHtmlLength:ce,_fnFeatureHtmlPaginate:fe,_fnPageChange:de,_fnFeatureHtmlProcessing:he,_fnProcessingDisplay:pe,_fnFeatureHtmlTable:ge,_fnScrollDraw:be,_fnApplyToChildren:ve,_fnCalculateColumnWidths:Se,_fnThrottle:me,_fnConvertToWidth:De,_fnScrollingWidthAdjust:ye,_fnGetWidestNode:_e,_fnGetMaxLenString:Ce,_fnStringToCss:Te,_fnScrollBarWidth:we,_fnSortFlatten:xe,_fnSort:Ie,_fnSortAria:Ae,_fnSortListener:Fe,_fnSortAttachListener:Le,_fnSortingClasses:Pe,_fnSortData:Re,_fnSaveState:je,_fnLoadState:He,_fnSettingsFromNode:Ne,_fnLog:We,_fnMap:ke,_fnBindAction:Me,_fnCallbackReg:Ue,_fnCallbackFire:Ee,_fnLengthOverflow:Je,_fnRenderer:Be,_fnDataSource:Xe,_fnRowAttributes:N,_fnCalculateEnd:function(){}}),a.fn.dataTable=$e,a.fn.dataTableSettings=$e.settings,a.fn.dataTableExt=$e.ext,a.fn.DataTable=function(t){return a(this).dataTable(t).api()},a.each($e,function(t,e){a.fn.DataTable[t]=e}),a.fn.dataTable})}(window,document); \ No newline at end of file diff --git a/scripts/jquery.datetimepicker.full.min.js b/scripts/jquery.datetimepicker.full.min.js new file mode 100644 index 0000000..7947c33 --- /dev/null +++ b/scripts/jquery.datetimepicker.full.min.js @@ -0,0 +1 @@ +var DateFormatter;!function(){"use strict";var D,s,r,a,n;D=function(e,t){return"string"==typeof e&&"string"==typeof t&&e.toLowerCase()===t.toLowerCase()},s=function(e,t,a){var n=a||"0",r=e.toString();return r.length
    '),u=L('
    '),d.append(u),l.addClass("xdsoft_scroller_box").append(d),p=function(e){var t=a(e).y-r+g;t<0&&(t=0),t+u[0].offsetHeight>h&&(t=h-u[0].offsetHeight),l.trigger("scroll_element.xdsoft_scroller",[c?t/c:0])},u.on("touchstart.xdsoft_scroller mousedown.xdsoft_scroller",function(e){i||l.trigger("resize_scroll.xdsoft_scroller",[y]),r=a(e).y,g=parseInt(u.css("marginTop"),10),h=d[0].offsetHeight,"mousedown"===e.type||"touchstart"===e.type?(D.ownerDocument&&L(D.ownerDocument.body).addClass("xdsoft_noselect"),L([D.ownerDocument.body,D.contentWindow]).on("touchend mouseup.xdsoft_scroller",function e(){L([D.ownerDocument.body,D.contentWindow]).off("touchend mouseup.xdsoft_scroller",e).off("mousemove.xdsoft_scroller",p).removeClass("xdsoft_noselect")}),L(D.ownerDocument.body).on("mousemove.xdsoft_scroller",p)):(t=!0,e.stopPropagation(),e.preventDefault())}).on("touchmove",function(e){t&&(e.preventDefault(),p(e))}).on("touchend touchcancel",function(){t=!1,g=0}),l.on("scroll_element.xdsoft_scroller",function(e,t){i||l.trigger("resize_scroll.xdsoft_scroller",[t,!0]),t=1'),e=L('
    '),g=L('
    '),F=L('
    '),C=L('
    '),o=L('
    '),u=o.find(".xdsoft_time_box").eq(0),P=L('
    '),i=L(''),Y=L('
    '),A=L('
    '),s=!1,d=0;I.id&&_.attr("id",I.id),I.style&&_.attr("style",I.style),I.weeks&&_.addClass("xdsoft_showweeks"),I.rtl&&_.addClass("xdsoft_rtl"),_.addClass("xdsoft_"+I.theme),_.addClass(I.className),F.find(".xdsoft_month span").after(Y),F.find(".xdsoft_year span").after(A),F.find(".xdsoft_month,.xdsoft_year").on("touchstart mousedown.xdsoft",function(e){var t,a,n=L(this).find(".xdsoft_select").eq(0),r=0,o=0,i=n.is(":visible");for(F.find(".xdsoft_select").hide(),W.currentTime&&(r=W.currentTime[L(this).hasClass("xdsoft_month")?"getMonth":"getFullYear"]()),n[i?"hide":"show"](),t=n.find("div.xdsoft_option"),a=0;aI.touchMovedThreshold&&(this.touchMoved=!0)};function f(){var e,t=!1;return I.startDate?t=W.strToDate(I.startDate):(t=I.value||(O&&O.val&&O.val()?O.val():""))?(t=W.strToDateTime(t),I.yearOffset&&(t=new Date(t.getFullYear()-I.yearOffset,t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))):I.defaultDate&&(t=W.strToDateTime(I.defaultDate),I.defaultTime&&(e=W.strtotime(I.defaultTime),t.setHours(e.getHours()),t.setMinutes(e.getMinutes()))),t&&W.isValidDate(t)?_.data("changed",!0):t="",t||0}function c(m){var h=function(e,t){var a=e.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,"\\$1").replace(/_/g,"{digit+}").replace(/([0-9]{1})/g,"{digit$1}").replace(/\{digit([0-9]{1})\}/g,"[0-$1_]{1}").replace(/\{digit[\+]\}/g,"[0-9_]{1}");return new RegExp(a).test(t)},g=function(e,t){if(!(e="string"==typeof e||e instanceof String?m.ownerDocument.getElementById(e):e))return!1;if(e.createTextRange){var a=e.createTextRange();return a.collapse(!0),a.moveEnd("character",t),a.moveStart("character",t),a.select(),!0}return!!e.setSelectionRange&&(e.setSelectionRange(t,t),!0)};m.mask&&O.off("keydown.xdsoft"),!0===m.mask&&(E.formatMask?m.mask=E.formatMask(m.format):m.mask=m.format.replace(/Y/g,"9999").replace(/F/g,"9999").replace(/m/g,"19").replace(/d/g,"39").replace(/H/g,"29").replace(/i/g,"59").replace(/s/g,"59")),"string"===L.type(m.mask)&&(h(m.mask,O.val())||(O.val(m.mask.replace(/[0-9]/g,"_")),g(O[0],0)),O.on("paste.xdsoft",function(e){var t=(e.clipboardData||e.originalEvent.clipboardData||window.clipboardData).getData("text"),a=this.value,n=this.selectionStart;return a=a.substr(0,n)+t+a.substr(n+t.length),n+=t.length,h(m.mask,a)?(this.value=a,g(this,n)):""===L.trim(a)?this.value=m.mask.replace(/[0-9]/g,"_"):O.trigger("error_input.xdsoft"),e.preventDefault(),!1}),O.on("keydown.xdsoft",function(e){var t,a=this.value,n=e.which,r=this.selectionStart,o=this.selectionEnd,i=r!==o;if(48<=n&&n<=57||96<=n&&n<=105||8===n||46===n){for(t=8===n||46===n?"_":String.fromCharCode(96<=n&&n<=105?n-48:n),8===n&&r&&!i&&(r-=1);;){var s=m.mask.substr(r,1),d=r",I.weeks&&(l+=""),e=0;e<7;e+=1)l+="";for(l+="",l+="",!1!==I.maxDate&&(h=W.strToDate(I.maxDate),h=new Date(h.getFullYear(),h.getMonth(),h.getDate(),23,59,59,999)),!1!==I.minDate&&(g=W.strToDate(I.minDate),g=new Date(g.getFullYear(),g.getMonth(),g.getDate())),!1!==I.minDateTime&&(p=W.strToDate(I.minDateTime),p=new Date(p.getFullYear(),p.getMonth(),p.getDate(),p.getHours(),p.getMinutes(),p.getSeconds())),!1!==I.maxDateTime&&(D=W.strToDate(I.maxDateTime),D=new Date(D.getFullYear(),D.getMonth(),D.getDate(),D.getHours(),D.getMinutes(),D.getSeconds())),!1!==D&&(u=31*(12*D.getFullYear()+D.getMonth())+D.getDate());c",v=!1,I.weeks&&(l+="")),l+='",f.getDay()===I.dayOfWeekStartPrev&&(l+="",v=!0),f.setDate(n+1)}l+="
    ",{valign:"top",colSpan:b(t),"class":t.oClasses.sRowEmpty}).html(_))[0]}Ee(t,"aoHeaderCallback","header",[a(t.nTHead).children("tr")[0],F(t),d,h,f]),Ee(t,"aoFooterCallback","footer",[a(t.nTFoot).children("tr")[0],F(t),d,h,f]);var C=a(t.nTBody);C.children().detach(),C.append(a(r)),Ee(t,"aoDrawCallback","draw",[t]),t.bSorted=!1,t.bFiltered=!1,t.bDrawing=!1}function M(t,e){var n=t.oFeatures,a=n.bSort,r=n.bFilter;a&&Ie(t),r?Y(t,t.oPreviousSearch):t.aiDisplay=t.aiDisplayMaster.slice(),e!==!0&&(t._iDisplayStart=0),t._drawHold=e,O(t),t._drawHold=!1}function U(t){var e=t.oClasses,n=a(t.nTable),r=a("
    ").insertBefore(n),o=t.oFeatures,i=a("
    ",{id:t.sTableId+"_wrapper","class":e.sWrapper+(t.nTFoot?"":" "+e.sNoFooter)});t.nHolding=r[0],t.nTableWrapper=i[0],t.nTableReinsertBefore=t.nTable.nextSibling;for(var s,l,u,c,f,d,h=t.sDom.split(""),p=0;p")[0],c=h[p+1],"'"==c||'"'==c){for(f="",d=2;h[p+d]!=c;)f+=h[p+d],d++;if("H"==f?f=e.sJUIHeader:"F"==f&&(f=e.sJUIFooter),-1!=f.indexOf(".")){var g=f.split(".");u.id=g[0].substr(1,g[0].length-1),u.className=g[1]}else"#"==f.charAt(0)?u.id=f.substr(1,f.length-1):u.className=f;p+=d}i.append(u),i=a(u)}else if(">"==l)i=i.parent();else if("l"==l&&o.bPaginate&&o.bLengthChange)s=ce(t);else if("f"==l&&o.bFilter)s=$(t);else if("r"==l&&o.bProcessing)s=he(t);else if("t"==l)s=ge(t);else if("i"==l&&o.bInfo)s=re(t);else if("p"==l&&o.bPaginate)s=fe(t);else if(0!==$e.ext.feature.length)for(var b=$e.ext.feature,v=0,S=b.length;S>v;v++)if(l==b[v].cFeature){s=b[v].fnInit(t);break}if(s){var m=t.aanFeatures;m[l]||(m[l]=[]),m[l].push(s),i.append(s)}}r.replaceWith(i)}function E(t,e){var n,r,o,i,s,l,u,c,f,d,h,p=a(e).children("tr"),g=function(t,e,n){for(var a=t[e];a[n];)n++;return n};for(t.splice(0,t.length),o=0,l=p.length;l>o;o++)t.push([]);for(o=0,l=p.length;l>o;o++)for(n=p[o],c=0,r=n.firstChild;r;){if("TD"==r.nodeName.toUpperCase()||"TH"==r.nodeName.toUpperCase())for(f=1*r.getAttribute("colspan"),d=1*r.getAttribute("rowspan"),f=f&&0!==f&&1!==f?f:1,d=d&&0!==d&&1!==d?d:1,u=g(t,o,c),h=1===f?!0:!1,s=0;f>s;s++)for(i=0;d>i;i++)t[o+i][u+s]={cell:r,unique:h},t[o+i].nTr=n;r=r.nextSibling}}function J(t,e,n){var a=[];n||(n=t.aoHeader,e&&(n=[],E(n,e)));for(var r=0,o=n.length;o>r;r++)for(var i=0,s=n[r].length;s>i;i++)!n[r][i].unique||a[i]&&t.bSortCellsTop||(a[i]=n[r][i].cell);return a}function B(t,e,n){if(Ee(t,"aoServerParams","serverParams",[e]),e&&a.isArray(e)){var r={},o=/(.*?)\[\]$/;a.each(e,function(t,e){var n=e.name.match(o);if(n){var a=n[0];r[a]||(r[a]=[]),r[a].push(e.value)}else r[e.name]=e.value}),e=r}var i,s=t.ajax,l=t.oInstance;if(a.isPlainObject(s)&&s.data){i=s.data;var u=a.isFunction(i)?i(e):i;e=a.isFunction(i)&&u?u:a.extend(!0,e,u),delete s.data}var c={data:e,success:function(e){var a=e.error||e.sError;a&&t.oApi._fnLog(t,0,a),t.json=e,Ee(t,null,"xhr",[t,e]),n(e)},dataType:"json",cache:!1,type:t.sServerMethod,error:function(e,n){var a=t.oApi._fnLog;"parsererror"==n?a(t,0,"Invalid JSON response",1):4===e.readyState&&a(t,0,"Ajax error",7),pe(t,!1)}};t.oAjaxData=e,Ee(t,null,"preXhr",[t,e]),t.fnServerData?t.fnServerData.call(l,t.sAjaxSource,a.map(e,function(t,e){return{name:e,value:t}}),n,t):t.sAjaxSource||"string"==typeof s?t.jqXHR=a.ajax(a.extend(c,{url:s||t.sAjaxSource})):a.isFunction(s)?t.jqXHR=s.call(l,e,n,t):(t.jqXHR=a.ajax(a.extend(c,s)),s.data=i)}function X(t){return t.bAjaxDataGet?(t.iDraw++,pe(t,!0),B(t,V(t),function(e){q(t,e)}),!1):!0}function V(t){var e,n,r,o,i=t.aoColumns,s=i.length,l=t.oFeatures,u=t.oPreviousSearch,c=t.aoPreSearchCols,f=[],d=xe(t),h=t._iDisplayStart,p=l.bPaginate!==!1?t._iDisplayLength:-1,g=function(t,e){f.push({name:t,value:e})};g("sEcho",t.iDraw),g("iColumns",s),g("sColumns",hn(i,"sName").join(",")),g("iDisplayStart",h),g("iDisplayLength",p);var b={draw:t.iDraw,columns:[],order:[],start:h,length:p,search:{value:u.sSearch,regex:u.bRegex}};for(e=0;s>e;e++)r=i[e],o=c[e],n="function"==typeof r.mData?"function":r.mData,b.columns.push({data:n,name:r.sName,searchable:r.bSearchable,orderable:r.bSortable,search:{value:o.sSearch,regex:o.bRegex}}),g("mDataProp_"+e,n),l.bFilter&&(g("sSearch_"+e,o.sSearch),g("bRegex_"+e,o.bRegex),g("bSearchable_"+e,r.bSearchable)),l.bSort&&g("bSortable_"+e,r.bSortable);l.bFilter&&(g("sSearch",u.sSearch),g("bRegex",u.bRegex)),l.bSort&&(a.each(d,function(t,e){b.order.push({column:e.col,dir:e.dir}),g("iSortCol_"+t,e.col),g("sSortDir_"+t,e.dir)}),g("iSortingCols",d.length));var v=$e.ext.legacy.ajax;return null===v?t.sAjaxSource?f:b:v?f:b}function q(t,e){var a=function(t,a){return e[t]!==n?e[t]:e[a]},r=a("sEcho","draw"),o=a("iTotalRecords","recordsTotal"),i=a("iTotalDisplayRecords","recordsFiltered");if(r){if(1*rl;l++)D(t,s[l]);t.aiDisplay=t.aiDisplayMaster.slice(),t.bAjaxDataGet=!1,O(t),t._bInitComplete||le(t,e),t.bAjaxDataGet=!0,pe(t,!1)}function G(t,e){var r=a.isPlainObject(t.ajax)&&t.ajax.dataSrc!==n?t.ajax.dataSrc:t.sAjaxDataProp;return"data"===r?e.aaData||e[r]:""!==r?I(r)(e):e}function $(t){var n=t.oClasses,r=t.sTableId,o=t.oLanguage,i=t.oPreviousSearch,s=t.aanFeatures,l='',u=o.sSearch,c=a("
    ",{id:s.f?null:r+"_filter","class":n.sFilter}).append('
    '+l+"
    "),f=function(){var e=(s.f,this.value?this.value:"");e!=i.sSearch&&(Y(t,{sSearch:e,bRegex:i.bRegex,bSmart:i.bSmart,bCaseInsensitive:i.bCaseInsensitive}),t._iDisplayStart=0,O(t))},d=null!==t.searchDelay?t.searchDelay:"ssp"===Xe(t)?400:0,h=a("input",c).val(i.sSearch).attr("placeholder",o.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT",d?me(f,d):f).bind("keypress.DT",function(t){return 13==t.keyCode?!1:void 0}).attr("aria-controls",r);return a(t.nTable).on("search.dt.DT",function(n,a){if(t===a)try{h[0]!==e.activeElement&&h.val(i.sSearch)}catch(r){}}),c[0]}function Y(t,e,a){var r=t.oPreviousSearch,o=t.aoPreSearchCols,i=function(t){r.sSearch=t.sSearch,r.bRegex=t.bRegex,r.bSmart=t.bSmart,r.bCaseInsensitive=t.bCaseInsensitive},s=function(t){return t.bEscapeRegex!==n?!t.bEscapeRegex:t.bRegex};if(S(t),"ssp"!=Xe(t)){Z(t,e.sSearch,a,s(e),e.bSmart,e.bCaseInsensitive),i(e);for(var l=0;lo;o++){for(var s=[],l=0,u=r.length;u>l;l++)n=r[l],e=t.aoData[n],a[o](t,e._aFilterData,n,e._aData,l)&&s.push(n);r.length=0,r.push.apply(r,s)}}function Q(t,e,n,a,r,o){if(""!==e)for(var i,s=t.aiDisplay,l=K(e,a,r,o),u=s.length-1;u>=0;u--)i=t.aoData[s[u]]._aFilterData[n],l.test(i)||s.splice(u,1)}function Z(t,e,n,a,r,o){var i,s,l,u=K(e,a,r,o),c=t.oPreviousSearch.sSearch,f=t.aiDisplayMaster;if(0!==$e.ext.search.length&&(n=!0),s=ee(t),e.length<=0)t.aiDisplay=f.slice();else for((s||n||c.length>e.length||0!==e.indexOf(c)||t.bSorted)&&(t.aiDisplay=f.slice()),i=t.aiDisplay,l=i.length-1;l>=0;l--)u.test(t.aoData[i[l]]._sFilterRow)||i.splice(l,1)}function K(t,e,n,r){if(t=e?t:te(t),n){var o=a.map(t.match(/"[^"]+"|[^ ]+/g)||"",function(t){if('"'===t.charAt(0)){var e=t.match(/^"(.*)"$/);t=e?e[1]:t}return t.replace('"',"")});t="^(?=.*?"+o.join(")(?=.*?")+").*$"}return new RegExp(t,r?"i":"")}function te(t){return t.replace(rn,"\\$1")}function ee(t){var e,n,a,r,o,i,s,l,u=t.aoColumns,c=$e.ext.type.search,f=!1;for(n=0,r=t.aoData.length;r>n;n++)if(l=t.aoData[n],!l._aFilterData){for(i=[],a=0,o=u.length;o>a;a++)e=u[a],e.bSearchable?(s=T(t,n,a,"filter"),c[e.sType]&&(s=c[e.sType](s)),null===s&&(s=""),"string"!=typeof s&&s.toString&&(s=s.toString())):s="",s.indexOf&&-1!==s.indexOf("&")&&(yn.innerHTML=s,s=_n?yn.textContent:yn.innerText),s.replace&&(s=s.replace(/[\r\n]/g,"")),i.push(s);l._aFilterData=i,l._sFilterRow=i.join(" "),f=!0}return f}function ne(t){return{search:t.sSearch,smart:t.bSmart,regex:t.bRegex,caseInsensitive:t.bCaseInsensitive}}function ae(t){return{sSearch:t.search,bSmart:t.smart,bRegex:t.regex,bCaseInsensitive:t.caseInsensitive}}function re(t){var e=t.sTableId,n=t.aanFeatures.i,r=a("

    ",{"class":t.oClasses.sInfo,id:n?null:e+"_info"});return n||(t.aoDrawCallback.push({fn:oe,sName:"information"}),r.attr("role","status").attr("aria-live","polite"),a(t.nTable).attr("aria-describedby",e+"_info")),r[0]}function oe(t){var e=t.aanFeatures.i;if(0!==e.length){var n=t.oLanguage,r=t._iDisplayStart+1,o=t.fnDisplayEnd(),i=t.fnRecordsTotal(),s=t.fnRecordsDisplay(),l=s?n.sInfo:n.sInfoEmpty;s!==i&&(l+=" "+n.sInfoFiltered),l+=n.sInfoPostFix,l=ie(t,l);var u=n.fnInfoCallback;null!==u&&(l=u.call(t.oInstance,t,r,o,i,s,l)),a(e).html(l)}}function ie(t,e){var n=t.fnFormatNumber,a=t._iDisplayStart+1,r=t._iDisplayLength,o=t.fnRecordsDisplay(),i=-1===r;return e.replace(/_START_/g,n.call(t,a)).replace(/_END_/g,n.call(t,t.fnDisplayEnd())).replace(/_MAX_/g,n.call(t,t.fnRecordsTotal())).replace(/_TOTAL_/g,n.call(t,o)).replace(/_PAGE_/g,n.call(t,i?1:Math.ceil(a/r))).replace(/_PAGES_/g,n.call(t,i?1:Math.ceil(o/r)))}function se(t){var e,n,a,r=t.iInitDisplayStart,o=t.aoColumns,i=t.oFeatures;if(!t.bInitialised)return void setTimeout(function(){se(t)},200);for(U(t),W(t),k(t,t.aoHeader),k(t,t.aoFooter),pe(t,!0),i.bAutoWidth&&Se(t),e=0,n=o.length;n>e;e++)a=o[e],a.sWidth&&(a.nTh.style.width=Te(a.sWidth));M(t);var s=Xe(t);"ssp"!=s&&("ajax"==s?B(t,[],function(n){var a=G(t,n);for(e=0;e",{name:n+"_length","aria-controls":n,"class":e.sLengthSelect}),u=0,c=i.length;c>u;u++)l[0][u]=new Option(s[u],i[u]);var f=a("

    ").addClass(e.sLength);return t.aanFeatures.l||(f[0].id=n+"_length"),f.append('
    '+l[0].outerHTML+"
    "),a("select",f).val(t._iDisplayLength).bind("change.DT",function(){ue(t,a(this).val()),O(t)}),a(t.nTable).bind("length.dt.DT",function(e,n,r){t===n&&a("select",f).val(r)}),f[0]}function fe(t){var e=t.sPaginationType,n=$e.ext.pager[e],r="function"==typeof n,o=function(t){O(t)},i=a("
    ").addClass(t.oClasses.sPaging+e)[0],s=t.aanFeatures;return r||n.fnInit(t,i,o),s.p||(i.id=t.sTableId+"_paginate",t.aoDrawCallback.push({fn:function(t){if(r){var e,a,i=t._iDisplayStart,l=t._iDisplayLength,u=t.fnRecordsDisplay(),c=-1===l,f=c?0:Math.ceil(i/l),d=c?1:Math.ceil(u/l),h=n(f,d);for(e=0,a=s.p.length;a>e;e++)Be(t,"pageButton")(t,s.p[e],e,h,f,d)}else n.fnUpdate(t,o)},sName:"pagination"})),i}function de(t,e,n){var a=t._iDisplayStart,r=t._iDisplayLength,o=t.fnRecordsDisplay();0===o||-1===r?a=0:"number"==typeof e?(a=e*r,a>o&&(a=0)):"first"==e?a=0:"previous"==e?(a=r>=0?a-r:0,0>a&&(a=0)):"next"==e?o>a+r&&(a+=r):"last"==e?a=Math.floor((o-1)/r)*r:We(t,0,"Unknown paging action: "+e,5);var i=t._iDisplayStart!==a;return t._iDisplayStart=a,i&&(Ee(t,null,"page",[t]),n&&O(t)),i}function he(t){return a("
    ",{id:t.aanFeatures.r?null:t.sTableId+"_processing","class":t.oClasses.sProcessing}).html(t.oLanguage.sProcessing).insertBefore(t.nTable)[0]}function pe(t,e){t.oFeatures.bProcessing&&a(t.aanFeatures.r).css("display",e?"block":"none"),Ee(t,null,"processing",[t,e])}function ge(t){var e=a(t.nTable);e.attr("role","grid");var n=t.oScroll;if(""===n.sX&&""===n.sY)return t.nTable;var r=n.sX,o=n.sY,i=t.oClasses,s=e.children("caption"),l=s.length?s[0]._captionSide:null,u=a(e[0].cloneNode(!1)),c=a(e[0].cloneNode(!1)),f=e.children("tfoot"),d="
    ",h=function(t){return t?Te(t):null};n.sX&&"100%"===e.attr("width")&&e.removeAttr("width"),f.length||(f=null);var p=a(d,{"class":i.sScrollWrapper}).append(a(d,{"class":i.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:r?h(r):"100%"}).append(a(d,{"class":i.sScrollHeadInner}).css({"box-sizing":"content-box",width:n.sXInner||"100%"}).append(u.removeAttr("id").css("margin-left",0).append(e.children("thead")))).append("top"===l?s:null)).append(a(d,{"class":i.sScrollBody}).css({overflow:"auto",height:h(o),width:h(r)}).append(e));f&&p.append(a(d,{"class":i.sScrollFoot}).css({overflow:"hidden",border:0,width:r?h(r):"100%"}).append(a(d,{"class":i.sScrollFootInner}).append(c.removeAttr("id").css("margin-left",0).append(e.children("tfoot")))).append("bottom"===l?s:null));var g=p.children(),b=g[0],v=g[1],S=f?g[2]:null;return r&&a(v).scroll(function(){var t=this.scrollLeft;b.scrollLeft=t,f&&(S.scrollLeft=t)}),t.nScrollHead=b,t.nScrollBody=v,t.nScrollFoot=S,t.aoDrawCallback.push({fn:be,sName:"scrolling"}),p[0]}function be(t){var e,n,r,o,i,s,l,u,c,f=t.oScroll,d=f.sX,h=f.sXInner,g=f.sY,b=f.iBarWidth,v=a(t.nScrollHead),S=v[0].style,m=v.children("div"),D=m[0].style,y=m.children("table"),_=t.nScrollBody,C=a(_),T=_.style,w=a(t.nScrollFoot),x=w.children("div"),I=x.children("table"),A=a(t.nTHead),F=a(t.nTable),L=F[0],P=L.style,R=t.nTFoot?a(t.nTFoot):null,j=t.oBrowser,H=j.bScrollOversize,N=[],W=[],k=[],O=function(t){var e=t.style;e.paddingTop="0",e.paddingBottom="0",e.borderTopWidth="0",e.borderBottomWidth="0",e.height=0};if(F.children("thead, tfoot").remove(),i=A.clone().prependTo(F),e=A.find("tr"),r=i.find("tr"),i.find("th, td").removeAttr("tabindex"),R&&(s=R.clone().prependTo(F),n=R.find("tr"),o=s.find("tr")),d||(T.width="100%",v[0].style.width="100%"),a.each(J(t,i),function(e,n){l=p(t,e),n.style.width=t.aoColumns[l].sWidth}),R&&ve(function(t){t.style.width=""},o),f.bCollapse&&""!==g&&(T.height=C[0].offsetHeight+A[0].offsetHeight+"px"),c=F.outerWidth(),""===d?(P.width="100%",H&&(F.find("tbody").height()>_.offsetHeight||"scroll"==C.css("overflow-y"))&&(P.width=Te(F.outerWidth()-b))):""!==h?P.width=Te(h):c==C.width()&&C.height()c-b&&(P.width=Te(c))):P.width=Te(c),c=F.outerWidth(),ve(O,r),ve(function(t){k.push(t.innerHTML),N.push(Te(a(t).css("width")))},r),ve(function(t,e){t.style.width=N[e]},e),a(r).height(0),R&&(ve(O,o),ve(function(t){W.push(Te(a(t).css("width")))},o),ve(function(t,e){t.style.width=W[e]},n),a(o).height(0)),ve(function(t,e){t.innerHTML='
    '+k[e]+"
    ",t.style.width=N[e]},r),R&&ve(function(t,e){t.innerHTML="",t.style.width=W[e]},o),F.outerWidth()_.offsetHeight||"scroll"==C.css("overflow-y")?c+b:c,H&&(_.scrollHeight>_.offsetHeight||"scroll"==C.css("overflow-y"))&&(P.width=Te(u-b)),(""===d||""!==h)&&We(t,1,"Possible column misalignment",6)):u="100%",T.width=Te(u),S.width=Te(u),R&&(t.nScrollFoot.style.width=Te(u)),g||H&&(T.height=Te(L.offsetHeight+b)),g&&f.bCollapse){T.height=Te(g);var M=d&&L.offsetWidth>_.offsetWidth?b:0;L.offsetHeight<_.offsetHeight&&(T.height=Te(L.offsetHeight+M))}var U=F.outerWidth();y[0].style.width=Te(U),D.width=Te(U);var E=F.height()>_.clientHeight||"scroll"==C.css("overflow-y"),B="padding"+(j.bScrollbarLeft?"Left":"Right");D[B]=E?b+"px":"0px",R&&(I[0].style.width=Te(U),x[0].style.width=Te(U),x[0].style[B]=E?b+"px":"0px"),C.scroll(),!t.bSorted&&!t.bFiltered||t._drawHold||(_.scrollTop=0)}function ve(t,e,n){for(var a,r,o=0,i=0,s=e.length;s>i;){for(a=e[i].firstChild,r=n?n[i].firstChild:null;a;)1===a.nodeType&&(n?t(a,r,o):t(a,o),o++),a=a.nextSibling,r=n?r.nextSibling:null;i++}}function Se(e){var n,r,o,i,s,l=e.nTable,u=e.aoColumns,c=e.oScroll,f=c.sY,d=c.sX,p=c.sXInner,g=u.length,S=v(e,"bVisible"),m=a("th",e.nTHead),D=l.getAttribute("width"),y=l.parentNode,_=!1;for(n=0;n
    ").html(T(t,n,e,"display"))[0]}function Ce(t,e){for(var n,a=-1,r=-1,o=0,i=t.aoData.length;i>o;o++)n=T(t,o,e,"display")+"",n=n.replace(Cn,""),n.length>a&&(a=n.length,r=o);return r}function Te(t){return null===t?"0px":"number"==typeof t?0>t?"0px":t+"px":t.match(/\d$/)?t+"px":t}function we(){if(!$e.__scrollbarWidth){var t=a("

    ").css({width:"100%",height:200,padding:0})[0],e=a("

    ").css({position:"absolute",top:0,left:0,width:200,height:150,padding:0,overflow:"hidden",visibility:"hidden"}).append(t).appendTo("body"),n=t.offsetWidth;e.css("overflow","scroll");var r=t.offsetWidth;n===r&&(r=e[0].clientWidth),e.remove(),$e.__scrollbarWidth=n-r}return $e.__scrollbarWidth}function xe(t){var e,r,o,i,s,l,u,c=[],f=t.aoColumns,d=t.aaSortingFixed,h=a.isPlainObject(d),p=[],g=function(t){t.length&&!a.isArray(t[0])?p.push(t):p.push.apply(p,t)};for(a.isArray(d)&&g(d),h&&d.pre&&g(d.pre),g(t.aaSorting),h&&d.post&&g(d.post),e=0;er;r++)s=i[r],l=f[s].sType||"string",p[e]._idx===n&&(p[e]._idx=a.inArray(p[e][1],f[s].asSorting)),c.push({src:u,col:s,dir:p[e][1],index:p[e]._idx,type:l,formatter:$e.ext.type.order[l+"-pre"]});return c}function Ie(t){var e,n,a,r,o,i=[],s=$e.ext.type.order,l=t.aoData,u=(t.aoColumns,0),c=t.aiDisplayMaster;for(S(t),o=xe(t),e=0,n=o.length;n>e;e++)r=o[e],r.formatter&&u++,Re(t,r.col);if("ssp"!=Xe(t)&&0!==o.length){for(e=0,a=c.length;a>e;e++)i[c[e]]=e;c.sort(u===o.length?function(t,e){var n,a,r,s,u,c=o.length,f=l[t]._aSortData,d=l[e]._aSortData;for(r=0;c>r;r++)if(u=o[r],n=f[u.col],a=d[u.col],s=a>n?-1:n>a?1:0,0!==s)return"asc"===u.dir?s:-s;return n=i[t],a=i[e],a>n?-1:n>a?1:0}:function(t,e){var n,a,r,u,c,f,d=o.length,h=l[t]._aSortData,p=l[e]._aSortData;for(r=0;d>r;r++)if(c=o[r],n=h[c.col],a=p[c.col],f=s[c.type+"-"+c.dir]||s["string-"+c.dir],u=f(n,a),0!==u)return u;return n=i[t],a=i[e],a>n?-1:n>a?1:0})}t.bSorted=!0}function Ae(t){for(var e,n,a=t.aoColumns,r=xe(t),o=t.oLanguage.oAria,i=0,s=a.length;s>i;i++){var l=a[i],u=l.asSorting,c=l.sTitle.replace(/<.*?>/g,""),f=l.nTh;f.removeAttribute("aria-sort"),l.bSortable?(r.length>0&&r[0].col==i?(f.setAttribute("aria-sort","asc"==r[0].dir?"ascending":"descending"),n=u[r[0].index+1]||u[0]):n=u[0],e=c+("asc"===n?o.sSortAscending:o.sSortDescending)):e=c,f.setAttribute("aria-label",e)}}function Fe(t,e,r,o){var i,s=t.aoColumns[e],l=t.aaSorting,u=s.asSorting,c=function(t,e){var r=t._idx; +return r===n&&(r=a.inArray(t[1],u)),r+1e;e++)r=o[e].src,a(hn(t.aoData,"anCells",r)).removeClass(i+(2>e?e+1:3));for(e=0,n=s.length;n>e;e++)r=s[e].src,a(hn(t.aoData,"anCells",r)).addClass(i+(2>e?e+1:3))}t.aLastSort=s}function Re(t,e){var n,a=t.aoColumns[e],r=$e.ext.order[a.sSortDataType];r&&(n=r.call(t.oInstance,t,e,g(t,e)));for(var o,i,s=$e.ext.type.order[a.sType+"-pre"],l=0,u=t.aoData.length;u>l;l++)o=t.aoData[l],o._aSortData||(o._aSortData=[]),(!o._aSortData[e]||r)&&(i=r?n[l]:T(t,l,e,"sort"),o._aSortData[e]=s?s(i):i)}function je(t){if(t.oFeatures.bStateSave&&!t.bDestroying){var e={time:+new Date,start:t._iDisplayStart,length:t._iDisplayLength,order:a.extend(!0,[],t.aaSorting),search:ne(t.oPreviousSearch),columns:a.map(t.aoColumns,function(e,n){return{visible:e.bVisible,search:ne(t.aoPreSearchCols[n])}})};Ee(t,"aoStateSaveParams","stateSaveParams",[t,e]),t.oSavedState=e,t.fnStateSaveCallback.call(t.oInstance,t,e)}}function He(t){var e,n,r=t.aoColumns;if(t.oFeatures.bStateSave){var o=t.fnStateLoadCallback.call(t.oInstance,t);if(o&&o.time){var i=Ee(t,"aoStateLoadParams","stateLoadParams",[t,o]);if(-1===a.inArray(!1,i)){var s=t.iStateDuration;if(!(s>0&&o.time<+new Date-1e3*s)&&r.length===o.columns.length){for(t.oLoadedState=a.extend(!0,{},o),t._iDisplayStart=o.start,t.iInitDisplayStart=o.start,t._iDisplayLength=o.length,t.aaSorting=[],a.each(o.order,function(e,n){t.aaSorting.push(n[0]>=r.length?[0,n[1]]:n)}),a.extend(t.oPreviousSearch,ae(o.search)),e=0,n=o.columns.length;n>e;e++){var l=o.columns[e];r[e].bVisible=l.visible,a.extend(t.aoPreSearchCols[e],ae(l.search))}Ee(t,"aoStateLoaded","stateLoaded",[t,o])}}}}}function Ne(t){var e=$e.settings,n=a.inArray(t,hn(e,"nTable"));return-1!==n?e[n]:null}function We(e,n,a,r){if(a="DataTables warning: "+(null!==e?"table id="+e.sTableId+" - ":"")+a,r&&(a+=". For more information about this error, please see http://datatables.net/tn/"+r),n)t.console&&console.log&&console.log(a);else{var o=$e.ext,i=o.sErrMode||o.errMode;if("alert"!=i)throw new Error(a);''/*alert(a)*/}}function ke(t,e,r,o){return a.isArray(r)?void a.each(r,function(n,r){a.isArray(r)?ke(t,e,r[0],r[1]):ke(t,e,r)}):(o===n&&(o=r),void(e[r]!==n&&(t[o]=e[r])))}function Oe(t,e,n){var r;for(var o in e)e.hasOwnProperty(o)&&(r=e[o],a.isPlainObject(r)?(a.isPlainObject(t[o])||(t[o]={}),a.extend(!0,t[o],r)):t[o]=n&&"data"!==o&&"aaData"!==o&&a.isArray(r)?r.slice():r);return t}function Me(t,e,n){a(t).bind("click.DT",e,function(e){t.blur(),n(e)}).bind("keypress.DT",e,function(t){13===t.which&&(t.preventDefault(),n(t))}).bind("selectstart.DT",function(){return!1})}function Ue(t,e,n,a){n&&t[e].push({fn:n,sName:a})}function Ee(t,e,n,r){var o=[];return e&&(o=a.map(t[e].slice().reverse(),function(e){return e.fn.apply(t.oInstance,r)})),null!==n&&a(t.nTable).trigger(n+".dt",r),o}function Je(t){var e=t._iDisplayStart,n=t.fnDisplayEnd(),a=t._iDisplayLength;e>=n&&(e=n-a),(-1===a||0>e)&&(e=0),t._iDisplayStart=e}function Be(t,e){var n=t.renderer,r=$e.ext.renderer[e];return a.isPlainObject(n)&&n[e]?r[n[e]]||r._:"string"==typeof n?r[n]||r._:r._}function Xe(t){return t.oFeatures.bServerSide?"ssp":t.ajax||t.sAjaxSource?"ajax":"dom"}function Ve(t,e){var n=[],a=qn.numbers_length,r=Math.floor(a/2);return a>=e?n=gn(0,e):r>=t?(n=gn(0,a-2),n.push("ellipsis"),n.push(e-1)):t>=e-1-r?(n=gn(e-(a-2),e),n.splice(0,0,"ellipsis"),n.splice(0,0,0)):(n=gn(t-1,t+2),n.push("ellipsis"),n.push(e-1),n.splice(0,0,"ellipsis"),n.splice(0,0,0)),n.DT_el="span",n}function qe(t){a.each({num:function(e){return Gn(e,t)},"num-fmt":function(e){return Gn(e,t,on)},"html-num":function(e){return Gn(e,t,en)},"html-num-fmt":function(e){return Gn(e,t,en,on)}},function(e,n){Ye.type.order[e+t+"-pre"]=n})}function Ge(t){return function(){var e=[Ne(this[$e.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return $e.ext.internal[t].apply(this,e)}}var $e,Ye,ze,Qe,Ze,Ke={},tn=/[\r\n]/g,en=/<.*?>/g,nn=/^[\w\+\-]/,an=/[\w\+\-]$/,rn=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),on=/[',$£€¥%\u2009\u202F]/g,sn=function(t){return t&&t!==!0&&"-"!==t?!1:!0},ln=function(t){var e=parseInt(t,10);return!isNaN(e)&&isFinite(t)?e:null},un=function(t,e){return Ke[e]||(Ke[e]=new RegExp(te(e),"g")),"string"==typeof t&&"."!==e?t.replace(/\./g,"").replace(Ke[e],"."):t},cn=function(t,e,n){var a="string"==typeof t;return e&&a&&(t=un(t,e)),n&&a&&(t=t.replace(on,"")),sn(t)||!isNaN(parseFloat(t))&&isFinite(t)},fn=function(t){return sn(t)||"string"==typeof t},dn=function(t,e,n){if(sn(t))return!0;var a=fn(t);return a&&cn(bn(t),e,n)?!0:null},hn=function(t,e,a){var r=[],o=0,i=t.length;if(a!==n)for(;i>o;o++)t[o]&&t[o][e]&&r.push(t[o][e][a]);else for(;i>o;o++)t[o]&&r.push(t[o][e]);return r},pn=function(t,e,a,r){var o=[],i=0,s=e.length;if(r!==n)for(;s>i;i++)o.push(t[e[i]][a][r]);else for(;s>i;i++)o.push(t[e[i]][a]);return o},gn=function(t,e){var a,r=[];e===n?(e=0,a=t):(a=e,e=t);for(var o=e;a>o;o++)r.push(o);return r},bn=function(t){return t.replace(en,"")},vn=function(t){var e,n,a,r=[],o=t.length,i=0;t:for(n=0;o>n;n++){for(e=t[n],a=0;i>a;a++)if(r[a]===e)continue t;r.push(e),i++}return r},Sn=function(t,e,a){t[e]!==n&&(t[a]=t[e])},mn=/\[.*?\]$/,Dn=/\(\)$/,yn=a("
    ")[0],_n=yn.textContent!==n,Cn=/<.*?>/g;$e=function(t){this.$=function(t,e){return this.api(!0).$(t,e)},this._=function(t,e){return this.api(!0).rows(t,e).data()},this.api=function(t){return new ze(t?Ne(this[Ye.iApiIndex]):this)},this.fnAddData=function(t,e){var r=this.api(!0),o=a.isArray(t)&&(a.isArray(t[0])||a.isPlainObject(t[0]))?r.rows.add(t):r.row.add(t);return(e===n||e)&&r.draw(),o.flatten().toArray()},this.fnAdjustColumnSizing=function(t){var e=this.api(!0).columns.adjust(),a=e.settings()[0],r=a.oScroll;t===n||t?e.draw(!1):(""!==r.sX||""!==r.sY)&&be(a)},this.fnClearTable=function(t){var e=this.api(!0).clear();(t===n||t)&&e.draw()},this.fnClose=function(t){this.api(!0).row(t).child.hide()},this.fnDeleteRow=function(t,e,a){var r=this.api(!0),o=r.rows(t),i=o.settings()[0],s=i.aoData[o[0][0]];return o.remove(),e&&e.call(this,i,s),(a===n||a)&&r.draw(),s},this.fnDestroy=function(t){this.api(!0).destroy(t)},this.fnDraw=function(t){this.api(!0).draw(!t)},this.fnFilter=function(t,e,a,r,o,i){var s=this.api(!0);null===e||e===n?s.search(t,a,r,i):s.column(e).search(t,a,r,i),s.draw()},this.fnGetData=function(t,e){var a=this.api(!0);if(t!==n){var r=t.nodeName?t.nodeName.toLowerCase():"";return e!==n||"td"==r||"th"==r?a.cell(t,e).data():a.row(t).data()||null}return a.data().toArray()},this.fnGetNodes=function(t){var e=this.api(!0);return t!==n?e.row(t).node():e.rows().nodes().flatten().toArray()},this.fnGetPosition=function(t){var e=this.api(!0),n=t.nodeName.toUpperCase();if("TR"==n)return e.row(t).index();if("TD"==n||"TH"==n){var a=e.cell(t).index();return[a.row,a.columnVisible,a.column]}return null},this.fnIsOpen=function(t){return this.api(!0).row(t).child.isShown()},this.fnOpen=function(t,e,n){return this.api(!0).row(t).child(e,n).show().child()[0]},this.fnPageChange=function(t,e){var a=this.api(!0).page(t);(e===n||e)&&a.draw(!1)},this.fnSetColumnVis=function(t,e,a){var r=this.api(!0).column(t).visible(e);(a===n||a)&&r.columns.adjust().draw()},this.fnSettings=function(){return Ne(this[Ye.iApiIndex])},this.fnSort=function(t){this.api(!0).order(t).draw()},this.fnSortListener=function(t,e,n){this.api(!0).order.listener(t,e,n)},this.fnUpdate=function(t,e,a,r,o){var i=this.api(!0);return a===n||null===a?i.row(e).data(t):i.cell(e,a).data(t),(o===n||o)&&i.columns.adjust(),(r===n||r)&&i.draw(),0},this.fnVersionCheck=Ye.fnVersionCheck;var e=this,r=t===n,c=this.length;r&&(t={}),this.oApi=this.internal=Ye.internal;for(var h in $e.ext.internal)h&&(this[h]=Ge(h));return this.each(function(){var h,p={},g=c>1?Oe(p,t,!0):t,b=0,v=this.getAttribute("id"),S=!1,_=$e.defaults;if("table"!=this.nodeName.toLowerCase())return void We(null,0,"Non-table node initialisation ("+this.nodeName+")",2);s(_),l(_.column),o(_,_,!0),o(_.column,_.column,!0),o(_,g);var C=$e.settings;for(b=0,h=C.length;h>b;b++){if(C[b].nTable==this){var T=g.bRetrieve!==n?g.bRetrieve:_.bRetrieve,w=g.bDestroy!==n?g.bDestroy:_.bDestroy;if(r||T)return C[b].oInstance;if(w){C[b].oInstance.fnDestroy();break}return void We(C[b],0,"Cannot reinitialise DataTable",3)}if(C[b].sTableId==this.id){C.splice(b,1);break}}(null===v||""===v)&&(v="DataTables_Table_"+$e.ext._unique++,this.id=v);var x=a.extend(!0,{},$e.models.oSettings,{nTable:this,oApi:e.internal,oInit:g,sDestroyWidth:a(this)[0].style.width,sInstance:v,sTableId:v});C.push(x),x.oInstance=1===e.length?e:a(this).dataTable(),s(g),g.oLanguage&&i(g.oLanguage),g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=a.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]),g=Oe(a.extend(!0,{},_),g),ke(x.oFeatures,g,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]),ke(x,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]),ke(x.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]),ke(x.oLanguage,g,"fnInfoCallback"),Ue(x,"aoDrawCallback",g.fnDrawCallback,"user"),Ue(x,"aoServerParams",g.fnServerParams,"user"),Ue(x,"aoStateSaveParams",g.fnStateSaveParams,"user"),Ue(x,"aoStateLoadParams",g.fnStateLoadParams,"user"),Ue(x,"aoStateLoaded",g.fnStateLoaded,"user"),Ue(x,"aoRowCallback",g.fnRowCallback,"user"),Ue(x,"aoRowCreatedCallback",g.fnCreatedRow,"user"),Ue(x,"aoHeaderCallback",g.fnHeaderCallback,"user"),Ue(x,"aoFooterCallback",g.fnFooterCallback,"user"),Ue(x,"aoInitComplete",g.fnInitComplete,"user"),Ue(x,"aoPreDrawCallback",g.fnPreDrawCallback,"user");var I=x.oClasses;if(g.bJQueryUI?(a.extend(I,$e.ext.oJUIClasses,g.oClasses),g.sDom===_.sDom&&"lfrtip"===_.sDom&&(x.sDom='<"H"lfr>t<"F"ip>'),x.renderer?a.isPlainObject(x.renderer)&&!x.renderer.header&&(x.renderer.header="jqueryui"):x.renderer="jqueryui"):a.extend(I,$e.ext.classes,g.oClasses),a(this).addClass(I.sTable),(""!==x.oScroll.sX||""!==x.oScroll.sY)&&(x.oScroll.iBarWidth=we()),x.oScroll.sX===!0&&(x.oScroll.sX="100%"),x.iInitDisplayStart===n&&(x.iInitDisplayStart=g.iDisplayStart,x._iDisplayStart=g.iDisplayStart),null!==g.iDeferLoading){x.bDeferLoading=!0;var A=a.isArray(g.iDeferLoading);x._iRecordsDisplay=A?g.iDeferLoading[0]:g.iDeferLoading,x._iRecordsTotal=A?g.iDeferLoading[1]:g.iDeferLoading}""!==g.oLanguage.sUrl?(x.oLanguage.sUrl=g.oLanguage.sUrl,a.getJSON(x.oLanguage.sUrl,null,function(t){i(t),o(_.oLanguage,t),a.extend(!0,x.oLanguage,g.oLanguage,t),se(x)}),S=!0):a.extend(!0,x.oLanguage,g.oLanguage),null===g.asStripeClasses&&(x.asStripeClasses=[I.sStripeOdd,I.sStripeEven]);var F=x.asStripeClasses,L=a("tbody tr:eq(0)",this);-1!==a.inArray(!0,a.map(F,function(t){return L.hasClass(t)}))&&(a("tbody tr",this).removeClass(F.join(" ")),x.asDestroyStripes=F.slice());var P,R=[],H=this.getElementsByTagName("thead");if(0!==H.length&&(E(x.aoHeader,H[0]),R=J(x)),null===g.aoColumns)for(P=[],b=0,h=R.length;h>b;b++)P.push(null);else P=g.aoColumns;for(b=0,h=P.length;h>b;b++)f(x,R?R[b]:null);if(m(x,g.aoColumnDefs,P,function(t,e){d(x,t,e)}),L.length){var N=function(t,e){return t.getAttribute("data-"+e)?e:null};a.each(j(x,L[0]).cells,function(t,e){var a=x.aoColumns[t];if(a.mData===t){var r=N(e,"sort")||N(e,"order"),o=N(e,"filter")||N(e,"search");(null!==r||null!==o)&&(a.mData={_:t+".display",sort:null!==r?t+".@data-"+r:n,type:null!==r?t+".@data-"+r:n,filter:null!==o?t+".@data-"+o:n},d(x,t))}})}var W=x.oFeatures;if(g.bStateSave&&(W.bStateSave=!0,He(x,g),Ue(x,"aoDrawCallback",je,"state_save")),g.aaSorting===n){var k=x.aaSorting;for(b=0,h=k.length;h>b;b++)k[b][1]=x.aoColumns[b].asSorting[0]}Pe(x),W.bSort&&Ue(x,"aoDrawCallback",function(){if(x.bSorted){var t=xe(x),e={};a.each(t,function(t,n){e[n.src]=n.dir}),Ee(x,null,"order",[x,t,e]),Ae(x)}}),Ue(x,"aoDrawCallback",function(){(x.bSorted||"ssp"===Xe(x)||W.bDeferRender)&&Pe(x)},"sc"),u(x);var O=a(this).children("caption").each(function(){this._captionSide=a(this).css("caption-side")}),M=a(this).children("thead");0===M.length&&(M=a("
    "+I.i18n[R].dayOfWeekShort[(e+I.dayOfWeekStart)%7]+"
    "+o+"
    '+n+"
    ",C.html(l),F.find(".xdsoft_label span").eq(0).text(I.i18n[R].months[W.currentTime.getMonth()]),F.find(".xdsoft_label span").eq(1).text(W.currentTime.getFullYear()+I.yearOffset),M=k="";var x=0;if(!1!==I.minTime){var T=W.strtotime(I.minTime);x=60*T.getHours()+T.getMinutes()}var S=1440;if(!1!==I.maxTime){T=W.strtotime(I.maxTime);S=60*T.getHours()+T.getMinutes()}if(!1!==I.minDateTime){T=W.strToDateTime(I.minDateTime);if(E.formatDate(W.currentTime,I.formatDate)===E.formatDate(T,I.formatDate)){var M=60*T.getHours()+T.getMinutes();x'+E.formatDate(n,I.formatTime)+""},I.allowTimes&&L.isArray(I.allowTimes)&&I.allowTimes.length)for(c=0;c'+(c+I.yearOffset)+"";for(A.children().eq(0).html(H),c=parseInt(I.monthStart,10),H="";c<=parseInt(I.monthEnd,10);c+=1)H+='
    '+I.i18n[R].months[c]+"
    ";Y.children().eq(0).html(H),L(_).trigger("generate.xdsoft")},10),e.stopPropagation()}).on("afterOpen.xdsoft",function(){var e,t,a,n;I.timepicker&&(P.find(".xdsoft_current").length?e=".xdsoft_current":P.find(".xdsoft_init_time").length&&(e=".xdsoft_init_time"),e?(t=u[0].clientHeight,(a=P[0].offsetHeight)-t<(n=P.find(e).index()*I.timeHeightInTimePicker+1)&&(n=a-t),u.trigger("scroll_element.xdsoft_scroller",[parseInt(n,10)/(a-t)])):u.trigger("scroll_element.xdsoft_scroller",[0]))}),n=0,C.on("touchend click.xdsoft","td",function(e){e.stopPropagation(),n+=1;var t=L(this),a=W.currentTime;if(null==a&&(W.currentTime=W.now(),a=W.currentTime),t.hasClass("xdsoft_disabled"))return!1;a.setDate(1),a.setFullYear(t.data("year")),a.setMonth(t.data("month")),a.setDate(t.data("date")),_.trigger("select.xdsoft",[a]),O.val(W.str()),I.onSelectDate&&L.isFunction(I.onSelectDate)&&I.onSelectDate.call(_,W.currentTime,_.data("input"),e),_.data("changed",!0),_.trigger("xchange.xdsoft"),_.trigger("changedatetime.xdsoft"),(1f+c?(u="bottom",a=f+c-e.top):a-=c):a+_[0].offsetHeight>f+c&&(a=e.top-_[0].offsetHeight+1),a<0&&(a=0),n+t.offsetWidth>d&&(n=d-t.offsetWidth)),o=_[0],h(o,function(e){if("relative"===I.contentWindow.getComputedStyle(e).getPropertyValue("position")&&d>=e.offsetWidth)return n-=(d-e.offsetWidth)/2,!1}),l={position:r,left:I.insideParent?t.offsetLeft:n,top:"",bottom:""},I.insideParent?l[u]=t.offsetTop+t.offsetHeight:l[u]=a,_.css(l)},_.on("open.xdsoft",function(e){var t=!0;I.onShow&&L.isFunction(I.onShow)&&(t=I.onShow.call(_,W.currentTime,_.data("input"),e)),!1!==t&&(_.show(),r(),L(I.contentWindow).off("resize.xdsoft",r).on("resize.xdsoft",r),I.closeOnWithoutClick&&L([I.ownerDocument.body,I.contentWindow]).on("touchstart mousedown.xdsoft",function e(){_.trigger("close.xdsoft"),L([I.ownerDocument.body,I.contentWindow]).off("touchstart mousedown.xdsoft",e)}))}).on("close.xdsoft",function(e){var t=!0;F.find(".xdsoft_month,.xdsoft_year").find(".xdsoft_select").hide(),I.onClose&&L.isFunction(I.onClose)&&(t=I.onClose.call(_,W.currentTime,_.data("input"),e)),!1===t||I.opened||I.inline||_.hide(),e.stopPropagation()}).on("toggle.xdsoft",function(){_.is(":visible")?_.trigger("close.xdsoft"):_.trigger("open.xdsoft")}).data("input",O),d=0,_.data("xdsoft_datetime",W),_.setOptions(I),W.setCurrentTime(f()),O.data("xdsoft_datetimepicker",_).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function(){O.is(":disabled")||O.data("xdsoft_datetimepicker").is(":visible")&&I.closeOnInputClick||I.openOnFocus&&(clearTimeout(d),d=setTimeout(function(){O.is(":disabled")||(s=!0,W.setCurrentTime(f(),!0),I.mask&&c(I),_.trigger("open.xdsoft"))},100))}).on("keydown.xdsoft",function(e){var t,a=e.which;return-1!==[D].indexOf(a)&&I.enterLikeTab?(t=L("input:visible,textarea:visible,button:visible,a:visible"),_.trigger("close.xdsoft"),t.eq(t.index(this)+1).focus(),!1):-1!==[T].indexOf(a)?(_.trigger("close.xdsoft"),!0):void 0}).on("blur.xdsoft",function(){_.trigger("close.xdsoft")})},r=function(e){var t=e.data("xdsoft_datetimepicker");t&&(t.data("xdsoft_datetime",null),t.remove(),e.data("xdsoft_datetimepicker",null).off(".xdsoft"),L(I.contentWindow).off("resize.xdsoft"),L([I.contentWindow,I.ownerDocument.body]).off("mousedown.xdsoft touchstart"),e.unmousewheel&&e.unmousewheel())},L(I.ownerDocument).off("keydown.xdsoftctrl keyup.xdsoftctrl").off("keydown.xdsoftcmd keyup.xdsoftcmd").on("keydown.xdsoftctrl",function(e){e.keyCode===p&&(N=!0)}).on("keyup.xdsoftctrl",function(e){e.keyCode===p&&(N=!1)}).on("keydown.xdsoftcmd",function(e){91===e.keyCode&&!0}).on("keyup.xdsoftcmd",function(e){91===e.keyCode&&!1}),this.each(function(){var t,e=L(this).data("xdsoft_datetimepicker");if(e){if("string"===L.type(H))switch(H){case"show":L(this).select().focus(),e.trigger("open.xdsoft");break;case"hide":e.trigger("close.xdsoft");break;case"toggle":e.trigger("toggle.xdsoft");break;case"destroy":r(L(this));break;case"reset":this.value=this.defaultValue,this.value&&e.data("xdsoft_datetime").isValidDate(E.parseDate(this.value,I.format))||e.data("changed",!1),e.data("xdsoft_datetime").setCurrentTime(this.value);break;case"validate":e.data("input").trigger("blur.xdsoft");break;default:e[H]&&L.isFunction(e[H])&&(o=e[H](a))}else e.setOptions(H);return 0}"string"!==L.type(H)&&(!I.lazyInit||I.open||I.inline?n(L(this)):(t=L(this)).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function e(){t.is(":disabled")||t.data("xdsoft_datetimepicker")||(clearTimeout(i),i=setTimeout(function(){t.data("xdsoft_datetimepicker")||n(t),t.off("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",e).trigger("open.xdsoft")},100))}))}),o},L.fn.datetimepicker.defaults=s};!function(e){"function"==typeof define&&define.amd?define(["jquery","jquery-mousewheel"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(datetimepickerFactory),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(c){var m,h,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],g=Array.prototype.slice;if(c.event.fixHooks)for(var a=e.length;a;)c.event.fixHooks[e[--a]]=c.event.mouseHooks;var p=c.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],n,!1);else this.onmousewheel=n;c.data(this,"mousewheel-line-height",p.getLineHeight(this)),c.data(this,"mousewheel-page-height",p.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],n,!1);else this.onmousewheel=null;c.removeData(this,"mousewheel-line-height"),c.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=c(e),a=t["offsetParent"in c.fn?"offsetParent":"parent"]();return a.length||(a=c("body")),parseInt(a.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return c(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function n(e){var t,a=e||window.event,n=g.call(arguments,1),r=0,o=0,i=0,s=0,d=0;if((e=c.event.fix(a)).type="mousewheel","detail"in a&&(i=-1*a.detail),"wheelDelta"in a&&(i=a.wheelDelta),"wheelDeltaY"in a&&(i=a.wheelDeltaY),"wheelDeltaX"in a&&(o=-1*a.wheelDeltaX),"axis"in a&&a.axis===a.HORIZONTAL_AXIS&&(o=-1*i,i=0),r=0===i?o:i,"deltaY"in a&&(r=i=-1*a.deltaY),"deltaX"in a&&(o=a.deltaX,0===i&&(r=-1*o)),0!==i||0!==o){if(1===a.deltaMode){var u=c.data(this,"mousewheel-line-height");r*=u,i*=u,o*=u}else if(2===a.deltaMode){var l=c.data(this,"mousewheel-page-height");r*=l,i*=l,o*=l}if(t=Math.max(Math.abs(i),Math.abs(o)),(!h||t0},u=function(e){return e&&!(e.style.overflow&&"hidden"===e.style.overflow)&&(e.clientWidth&&e.scrollWidth>e.clientWidth||e.clientHeight&&e.scrollHeight>e.clientHeight)},g=function(e,t){var n=parseInt(e,10)||0;return t&&f(e)&&(n=s.getViewport()[t]/100*n),Math.ceil(n)},m=function(e,t){return g(e,t)+"px"};n.extend(s,{version:"2.1.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!d,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'
    ',image:'',iframe:'",error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeChange:n.noop,beforeClose:n.noop,afterClose:n.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(e,t){return e&&(n.isPlainObject(t)||(t={}),!1!==s.close(!0))?(n.isArray(e)||(e=p(e)?n(e).get():[e]),n.each(e,function(o,a){var r,l,c,d,f,u,g,m={};"object"===n.type(a)&&(a.nodeType&&(a=n(a)),p(a)?(m={href:a.data("fancybox-href")||a.attr("href"),title:a.data("fancybox-title")||a.attr("title"),isDom:!0,element:a},n.metadata&&n.extend(!0,m,a.metadata())):m=a),r=t.href||m.href||(h(a)?a:null),l=t.title!==i?t.title:m.title||"",c=t.content||m.content,d=c?"html":t.type||m.type,!d&&m.isDom&&(d=a.data("fancybox-type"),d||(f=a.prop("class").match(/fancybox\.(\w+)/),d=f?f[1]:null)),h(r)&&(d||(s.isImage(r)?d="image":s.isSWF(r)?d="swf":"#"===r.charAt(0)?d="inline":h(a)&&(d="html",c=a)),"ajax"===d&&(u=r.split(/\s+/,2),r=u.shift(),g=u.shift())),c||("inline"===d?r?c=n(h(r)?r.replace(/.*(?=#[^\s]+$)/,""):r):m.isDom&&(c=a):"html"===d?c=r:d||r||!m.isDom||(d="inline",c=a)),n.extend(m,{href:r,type:d,content:c,title:l,selector:g}),e[o]=m}),s.opts=n.extend(!0,{},s.defaults,t),t.keys!==i&&(s.opts.keys=t.keys?n.extend({},s.defaults.keys,t.keys):!1),s.group=e,s._start(s.opts.index)):void 0},cancel:function(){var e=s.coming;e&&!1!==s.trigger("onCancel")&&(s.hideLoading(),s.ajaxLoad&&s.ajaxLoad.abort(),s.ajaxLoad=null,s.imgPreload&&(s.imgPreload.onload=s.imgPreload.onerror=null),e.wrap&&e.wrap.stop(!0,!0).trigger("onReset").remove(),s.coming=null,s.current||s._afterZoomOut(e))},close:function(e){s.cancel(),!1!==s.trigger("beforeClose")&&(s.unbindEvents(),s.isActive&&(s.isOpen&&e!==!0?(s.isOpen=s.isOpened=!1,s.isClosing=!0,n(".fancybox-item, .fancybox-nav").remove(),s.wrap.stop(!0,!0).removeClass("fancybox-opened"),s.transitions[s.current.closeMethod]()):(n(".fancybox-wrap").stop(!0).trigger("onReset").remove(),s._afterZoomOut())))},play:function(e){var t=function(){clearTimeout(s.player.timer)},n=function(){t(),s.current&&s.player.isActive&&(s.player.timer=setTimeout(s.next,s.current.playSpeed))},i=function(){t(),r.unbind(".player"),s.player.isActive=!1,s.trigger("onPlayEnd")},o=function(){s.current&&(s.current.loop||s.current.index=o.index?"next":"prev"],s.router=n||"jumpto",o.loop&&(0>e&&(e=o.group.length+e%o.group.length),e%=o.group.length),o.group[e]!==i&&(s.cancel(),s._start(e)))},reposition:function(e,t){var i,o=s.current,a=o?o.wrap:null;a&&(i=s._getPosition(t),e&&"scroll"===e.type?(delete i.position,a.stop(!0,!0).animate(i,200)):(a.css(i),o.pos=n.extend({},o.dim,i)))},update:function(e){var t=e&&e.type,n=!t||"orientationchange"===t;n&&(clearTimeout(c),c=null),s.isOpen&&!c&&(c=setTimeout(function(){var i=s.current;i&&!s.isClosing&&(s.wrap.removeClass("fancybox-tmp"),(n||"load"===t||"resize"===t&&i.autoResize)&&s._setDimension(),"scroll"===t&&i.canShrink||s.reposition(e),s.trigger("onUpdate"),c=null)},n&&!d?0:300))},toggle:function(e){s.isOpen&&(s.current.fitToView="boolean"===n.type(e)?e:!s.current.fitToView,d&&(s.wrap.removeAttr("style").addClass("fancybox-tmp"),s.trigger("onUpdate")),s.update())},hideLoading:function(){r.unbind(".loading"),n("#fancybox-loading").remove()},showLoading:function(){var e,t;s.hideLoading(),e=n('
    ').click(s.cancel).appendTo("body"),r.bind("keydown.loading",function(e){27===(e.which||e.keyCode)&&(e.preventDefault(),s.cancel())}),s.defaults.fixed||(t=s.getViewport(),e.css({position:"absolute",top:.5*t.h+t.y,left:.5*t.w+t.x}))},getViewport:function(){var t=s.current&&s.current.locked||!1,n={x:a.scrollLeft(),y:a.scrollTop()};return t?(n.w=t[0].clientWidth,n.h=t[0].clientHeight):(n.w=d&&e.innerWidth?e.innerWidth:a.width(),n.h=d&&e.innerHeight?e.innerHeight:a.height()),n},unbindEvents:function(){s.wrap&&p(s.wrap)&&s.wrap.unbind(".fb"),r.unbind(".fb"),a.unbind(".fb")},bindEvents:function(){var e,t=s.current;t&&(a.bind("orientationchange.fb"+(d?"":" resize.fb")+(t.autoCenter&&!t.locked?" scroll.fb":""),s.update),e=t.keys,e&&r.bind("keydown.fb",function(o){var a=o.which||o.keyCode,r=o.target||o.srcElement;return 27===a&&s.coming?!1:void(o.ctrlKey||o.altKey||o.shiftKey||o.metaKey||r&&(r.type||n(r).is("[contenteditable]"))||n.each(e,function(e,r){return t.group.length>1&&r[a]!==i?(s[e](r[a]),o.preventDefault(),!1):n.inArray(a,r)>-1?(s[e](),o.preventDefault(),!1):void 0}))}),n.fn.mousewheel&&t.mouseWheel&&s.wrap.bind("mousewheel.fb",function(e,i,o,a){for(var r=e.target||null,l=n(r),c=!1;l.length&&!(c||l.is(".fancybox-skin")||l.is(".fancybox-wrap"));)c=u(l[0]),l=n(l).parent();0===i||c||s.group.length>1&&!t.canShrink&&(a>0||o>0?s.prev(a>0?"down":"left"):(0>a||0>o)&&s.next(0>a?"up":"right"),e.preventDefault())}))},trigger:function(e,t){var i,o=t||s.coming||s.current;if(o){if(n.isFunction(o[e])&&(i=o[e].apply(o,Array.prototype.slice.call(arguments,1))),i===!1)return!1;o.helpers&&n.each(o.helpers,function(t,i){i&&s.helpers[t]&&n.isFunction(s.helpers[t][e])&&s.helpers[t][e](n.extend(!0,{},s.helpers[t].defaults,i),o)}),r.trigger(e)}},isImage:function(e){return h(e)&&e.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(e){return h(e)&&e.match(/\.(swf)((\?|#).*)?$/i)},_start:function(e){var t,i,o,a,r,l={};if(e=g(e),t=s.group[e]||null,!t)return!1;if(l=n.extend(!0,{},s.opts,t),a=l.margin,r=l.padding,"number"===n.type(a)&&(l.margin=[a,a,a,a]),"number"===n.type(r)&&(l.padding=[r,r,r,r]),l.modal&&n.extend(!0,l,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),l.autoSize&&(l.autoWidth=l.autoHeight=!0),"auto"===l.width&&(l.autoWidth=!0),"auto"===l.height&&(l.autoHeight=!0),l.group=s.group,l.index=e,s.coming=l,!1===s.trigger("beforeLoad"))return void(s.coming=null);if(o=l.type,i=l.href,!o)return s.coming=null,s.current&&s.router&&"jumpto"!==s.router?(s.current.index=e,s[s.router](s.direction)):!1;if(s.isActive=!0,("image"===o||"swf"===o)&&(l.autoHeight=l.autoWidth=!1,l.scrolling="visible"),"image"===o&&(l.aspectRatio=!0),"iframe"===o&&d&&(l.scrolling="scroll"),l.wrap=n(l.tpl.wrap).addClass("fancybox-"+(d?"mobile":"desktop")+" fancybox-type-"+o+" fancybox-tmp "+l.wrapCSS).appendTo(l.parent||"body"),n.extend(l,{skin:n(".fancybox-skin",l.wrap),outer:n(".fancybox-outer",l.wrap),inner:n(".fancybox-inner",l.wrap)}),n.each(["Top","Right","Bottom","Left"],function(e,t){l.skin.css("padding"+t,m(l.padding[e]))}),s.trigger("onReady"),"inline"===o||"html"===o){if(!l.content||!l.content.length)return s._error("content")}else if(!i)return s._error("href");"image"===o?s._loadImage():"ajax"===o?s._loadAjax():"iframe"===o?s._loadIframe():s._afterLoad()},_error:function(e){n.extend(s.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:e,content:s.coming.tpl.error}),s._afterLoad()},_loadImage:function(){var e=s.imgPreload=new Image;e.onload=function(){this.onload=this.onerror=null,s.coming.width=this.width/s.opts.pixelRatio,s.coming.height=this.height/s.opts.pixelRatio,s._afterLoad()},e.onerror=function(){this.onload=this.onerror=null,s._error("image")},e.src=s.coming.href,e.complete!==!0&&s.showLoading()},_loadAjax:function(){var e=s.coming;s.showLoading(),s.ajaxLoad=n.ajax(n.extend({},e.ajax,{url:e.href,error:function(e,t){s.coming&&"abort"!==t?s._error("ajax",e):s.hideLoading()},success:function(t,n){"success"===n&&(e.content=t,s._afterLoad())}}))},_loadIframe:function(){var e=s.coming,t=n(e.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",d?"auto":e.iframe.scrolling).attr("src",e.href);n(e.wrap).bind("onReset",function(){try{n(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(e){}}),e.iframe.preload&&(s.showLoading(),t.one("load",function(){n(this).data("ready",1),d||n(this).bind("load.fb",s.update),n(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),s._afterLoad()})),e.content=t.appendTo(e.inner),e.iframe.preload||s._afterLoad()},_preloadImages:function(){var e,t,n=s.group,i=s.current,o=n.length,a=i.preload?Math.min(i.preload,o-1):0;for(t=1;a>=t;t+=1)e=n[(i.index+t)%o],"image"===e.type&&e.href&&((new Image).src=e.href)},_afterLoad:function(){var e,t,i,o,a,r,l=s.coming,c=s.current,d="fancybox-placeholder";if(s.hideLoading(),l&&s.isActive!==!1){if(!1===s.trigger("afterLoad",l,c))return l.wrap.stop(!0).trigger("onReset").remove(),void(s.coming=null);switch(c&&(s.trigger("beforeChange",c),c.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),s.unbindEvents(),e=l,t=l.content,i=l.type,o=l.scrolling,n.extend(s,{wrap:e.wrap,skin:e.skin,outer:e.outer,inner:e.inner,current:e,previous:c}),a=e.href,i){case"inline":case"ajax":case"html":e.selector?t=n("
    ").html(t).find(e.selector):p(t)&&(t.data(d)||t.data(d,n('
    ').insertAfter(t).hide()),t=t.show().detach(),e.wrap.bind("onReset",function(){n(this).find(t).length&&t.hide().replaceAll(t.data(d)).data(d,!1)}));break;case"image":t=e.tpl.image.replace("{href}",a);break;case"swf":t='',r="",n.each(e.swf,function(e,n){t+='',r+=" "+e+'="'+n+'"'}),t+='"}p(t)&&t.parent().is(e.inner)||e.inner.append(t),s.trigger("beforeShow"),e.inner.css("overflow","yes"===o?"scroll":"no"===o?"hidden":o),s._setDimension(),s.reposition(),s.isOpen=!1,s.coming=null,s.bindEvents(),s.isOpened?c.prevMethod&&s.transitions[c.prevMethod]():n(".fancybox-wrap").not(e.wrap).stop(!0).trigger("onReset").remove(),s.transitions[s.isOpened?e.nextMethod:e.openMethod](),s._preloadImages()}},_setDimension:function(){var e,t,i,o,a,r,l,c,d,p,h,u,y,x,v,w=s.getViewport(),b=0,k=!1,C=!1,O=s.wrap,W=s.skin,_=s.inner,S=s.current,T=S.width,L=S.height,E=S.minWidth,R=S.minHeight,j=S.maxWidth,P=S.maxHeight,H=S.scrolling,M=S.scrollOutside?S.scrollbarWidth:0,A=S.margin,I=g(A[1]+A[3]),D=g(A[0]+A[2]);if(O.add(W).add(_).width("auto").height("auto").removeClass("fancybox-tmp"),e=g(W.outerWidth(!0)-W.width()),t=g(W.outerHeight(!0)-W.height()),i=I+e,o=D+t,a=f(T)?(w.w-i)*g(T)/100:T,r=f(L)?(w.h-o)*g(L)/100:L,"iframe"===S.type){if(x=S.content,S.autoHeight&&1===x.data("ready"))try{x[0].contentWindow.document.location&&(_.width(a).height(9999),v=x.contents().find("body"),M&&v.css("overflow-x","hidden"),r=v.outerHeight(!0))}catch(z){}}else(S.autoWidth||S.autoHeight)&&(_.addClass("fancybox-tmp"),S.autoWidth||_.width(a),S.autoHeight||_.height(r),S.autoWidth&&(a=_.width()),S.autoHeight&&(r=_.height()),_.removeClass("fancybox-tmp"));if(T=g(a),L=g(r),d=a/r,E=g(f(E)?g(E,"w")-i:E),j=g(f(j)?g(j,"w")-i:j),R=g(f(R)?g(R,"h")-o:R),P=g(f(P)?g(P,"h")-o:P),l=j,c=P,S.fitToView&&(j=Math.min(w.w-i,j),P=Math.min(w.h-o,P)),u=w.w-I,y=w.h-D,S.aspectRatio?(T>j&&(T=j,L=g(T/d)),L>P&&(L=P,T=g(L*d)),E>T&&(T=E,L=g(T/d)),R>L&&(L=R,T=g(L*d))):(T=Math.max(E,Math.min(T,j)),S.autoHeight&&"iframe"!==S.type&&(_.width(T),L=_.height()),L=Math.max(R,Math.min(L,P))),S.fitToView)if(_.width(T).height(L),O.width(T+e),p=O.width(),h=O.height(),S.aspectRatio)for(;(p>u||h>y)&&T>E&&L>R&&!(b++>19);)L=Math.max(R,Math.min(P,L-10)),T=g(L*d),E>T&&(T=E,L=g(T/d)),T>j&&(T=j,L=g(T/d)),_.width(T).height(L),O.width(T+e),p=O.width(),h=O.height();else T=Math.max(E,Math.min(T,T-(p-u))),L=Math.max(R,Math.min(L,L-(h-y)));M&&"auto"===H&&r>L&&u>T+e+M&&(T+=M),_.width(T).height(L),O.width(T+e),p=O.width(),h=O.height(),k=(p>u||h>y)&&T>E&&L>R,C=S.aspectRatio?l>T&&c>L&&a>T&&r>L:(l>T||c>L)&&(a>T||r>L),n.extend(S,{dim:{width:m(p),height:m(h)},origWidth:a,origHeight:r,canShrink:k,canExpand:C,wPadding:e,hPadding:t,wrapSpace:h-W.outerHeight(!0),skinSpace:W.height()-L}),!x&&S.autoHeight&&L>R&&P>L&&!C&&_.height("auto")},_getPosition:function(e){var t=s.current,n=s.getViewport(),i=t.margin,o=s.wrap.width()+i[1]+i[3],a=s.wrap.height()+i[0]+i[2],r={position:"absolute",top:i[0],left:i[3]};return t.autoCenter&&t.fixed&&!e&&a<=n.h&&o<=n.w?r.position="fixed":t.locked||(r.top+=n.y,r.left+=n.x),r.top=m(Math.max(r.top,r.top+(n.h-a)*t.topRatio)),r.left=m(Math.max(r.left,r.left+(n.w-o)*t.leftRatio)),r},_afterZoomIn:function(){var e=s.current;e&&(s.isOpen=s.isOpened=!0,s.wrap.css("overflow","visible").addClass("fancybox-opened"),s.update(),(e.closeClick||e.nextClick&&s.group.length>1)&&s.inner.css("cursor","pointer").bind("click.fb",function(t){n(t.target).is("a")||n(t.target).parent().is("a")||(t.preventDefault(),s[e.closeClick?"close":"next"]())}),e.closeBtn&&n(e.tpl.closeBtn).appendTo(s.skin).bind("click.fb",function(e){e.preventDefault(),s.close()}),e.arrows&&s.group.length>1&&((e.loop||e.index>0)&&n(e.tpl.prev).appendTo(s.outer).bind("click.fb",s.prev),(e.loop||e.index
    ').appendTo(s.coming?s.coming.parent:e.parent),this.fixed=!1,e.fixed&&s.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(e){var t=this;e=n.extend({},this.defaults,e),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(e),this.fixed||(a.bind("resize.overlay",n.proxy(this.update,this)),this.update()),e.closeClick&&this.overlay.bind("click.overlay",function(e){return n(e.target).hasClass("fancybox-overlay")?(s.isActive?s.close():t.close(),!1):void 0}),this.overlay.css(e.css).show()},close:function(){var e,t;a.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(n(".fancybox-margin").removeClass("fancybox-margin"),e=a.scrollTop(),t=a.scrollLeft(),this.el.removeClass("fancybox-lock"),a.scrollTop(e).scrollLeft(t)),n(".fancybox-overlay").remove().hide(),n.extend(this,{overlay:null,fixed:!1})},update:function(){var e,n="100%";this.overlay.width(n).height("100%"),l?(e=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),r.width()>e&&(n=r.width())):r.width()>a.width()&&(n=r.width()),this.overlay.width(n).height(r.height())},onReady:function(e,t){var i=this.overlay;n(".fancybox-overlay").stop(!0,!0),i||this.create(e),e.locked&&this.fixed&&t.fixed&&(i||(this.margin=r.height()>a.height()?n("html").css("margin-right").replace("px",""):!1),t.locked=this.overlay.append(t.wrap),t.fixed=!1),e.showEarly===!0&&this.beforeShow.apply(this,arguments)},beforeShow:function(e,t){var i,o;t.locked&&(this.margin!==!1&&(n("*").filter(function(){return"fixed"===n(this).css("position")&&!n(this).hasClass("fancybox-overlay")&&!n(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),i=a.scrollTop(),o=a.scrollLeft(),this.el.addClass("fancybox-lock"),a.scrollTop(i).scrollLeft(o)),this.open(e)},onUpdate:function(){this.fixed||this.update()},afterClose:function(e){this.overlay&&!s.coming&&this.overlay.fadeOut(e.speedOut,n.proxy(this.close,this))}},s.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(e){var t,i,o=s.current,a=o.title,r=e.type;if(n.isFunction(a)&&(a=a.call(o.element,o)),h(a)&&""!==n.trim(a)){switch(t=n('
    '+a+"
    "),r){case"inside":i=s.skin;break;case"outside":i=s.wrap;break;case"over":i=s.inner;break;default:i=s.skin,t.appendTo("body"),l&&t.width(t.width()),t.wrapInner(''),s.current.margin[2]+=Math.abs(g(t.css("margin-bottom")))}t["top"===e.position?"prependTo":"appendTo"](i)}}},n.fn.fancybox=function(e){var t,i=n(this),o=this.selector||"",a=function(a){var r,l,c=n(this).blur(),d=t;a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||c.is(".fancybox-wrap")||(r=e.groupAttr||"data-fancybox-group",l=c.attr(r),l||(r="rel",l=c.get(0)[r]),l&&""!==l&&"nofollow"!==l&&(c=o.length?n(o):i,c=c.filter("["+r+'="'+l+'"]'),d=c.index(this)),e.index=d,s.open(c,e)!==!1&&a.preventDefault())};return e=e||{},t=e.index||0,o&&e.live!==!1?r.undelegate(o,"click.fb-start").delegate(o+":not('.fancybox-item, .fancybox-nav')","click.fb-start",a):i.unbind("click.fb-start").bind("click.fb-start",a),this.filter("[data-fancybox-start=1]").trigger("click"),this},r.ready(function(){var t,a;n.scrollbarWidth===i&&(n.scrollbarWidth=function(){var e=n('
    ').appendTo("body"),t=e.children(),i=t.innerWidth()-t.height(99).innerWidth();return e.remove(),i}),n.support.fixedPosition===i&&(n.support.fixedPosition=function(){var e=n('
    ').appendTo("body"),t=20===e[0].offsetTop||15===e[0].offsetTop;return e.remove(),t}()),n.extend(s.defaults,{scrollbarWidth:n.scrollbarWidth(),fixed:n.support.fixedPosition,parent:n("body")}),t=n(e).width(),o.addClass("fancybox-lock-test"),a=n(e).width(),o.removeClass("fancybox-lock-test"),n("").appendTo("head")})}(window,document,jQuery); \ No newline at end of file diff --git a/scripts/jquery.marquee.min.js b/scripts/jquery.marquee.min.js new file mode 100644 index 0000000..f39cb0c --- /dev/null +++ b/scripts/jquery.marquee.min.js @@ -0,0 +1,21 @@ +/* + * Marquee jQuery Plug-in + * + * Copyright 2009 Giva, Inc. (http://www.givainc.com/labs/) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Date: 2009-05-20 + * Rev: 1.0.01 + */ +(function(A){A.marquee={version:"1.0.01"};A.fn.marquee=function(E){var F=typeof arguments[0]=="string"&&arguments[0];var D=F&&Array.prototype.slice.call(arguments,1)||arguments;var C=(this.length==0)?null:A.data(this[0],"marquee");if(C&&F&&this.length){if(F.toLowerCase()=="object"){return C}else{if(C[F]){var B;this.each(function(G){var H=A.data(this,"marquee")[F].apply(C,D);if(G==0&&H){if(!!H.jquery){B=A([]).add(H)}else{B=H;return false}}else{if(!!H&&!!H.jquery){B=B.add(H)}}});return B||this}else{return this}}}else{return this.each(function(){new A.Marquee(this,E)})}};A.Marquee=function(E,Q){Q=A.extend({},A.Marquee.defaults,Q);var O=this,M=A(E),F=M.find("> li"),H=-1,G=false,L=false,N=0;A.data(M[0],"marquee",O);this.pause=function(){G=true;P()};this.resume=function(){G=false;D()};this.update=function(){var R=F.length;F=M.find("> li");if(R<=1){D()}};function K(R){if(F.filter("."+Q.cssShowing).length>0){return false}var T=F.eq(R);if(A.isFunction(Q.beforeshow)){Q.beforeshow.apply(O,[M,T])}var S={top:(Q.yScroll=="top"?"-":"+")+T.outerHeight()+"px",left:0};M.data("marquee.showing",true);T.addClass(Q.cssShowing);T.css(S).animate({top:"0px"},Q.showSpeed,Q.fxEasingShow,function(){if(A.isFunction(Q.show)){Q.show.apply(O,[M,T])}M.data("marquee.showing",false);J(T)})}function J(S,R){if(L==true){return false}R=R||Q.pauseSpeed;if(C(S)){setTimeout(function(){if(L==true){return false}var V=S.outerWidth(),T=V*-1,U=parseInt(S.css("left"),10);S.animate({left:T+"px"},((V+U)*Q.scrollSpeed),Q.fxEasingScroll,function(){I(S)})},R)}else{if(F.length>1){setTimeout(function(){if(L==true){return false}S.animate({top:(Q.yScroll=="top"?"+":"-")+M.innerHeight()+"px"},Q.showSpeed,Q.fxEasingScroll);I(S)},R)}}}function I(R){if(A.isFunction(Q.aftershow)){Q.aftershow.apply(O,[M,R])}R.removeClass(Q.cssShowing);B()}function P(){L=true;if(M.data("marquee.showing")!=true){F.filter("."+Q.cssShowing).dequeue().stop()}}function D(){L=false;if(M.data("marquee.showing")!=true){J(F.filter("."+Q.cssShowing),1)}}if(Q.pauseOnHover){M.hover(function(){if(G){return false}P()},function(){if(G){return false}D()})}function C(R){return(R.outerWidth()>M.innerWidth())}function B(){H++;if(H>=F.length){if(!isNaN(Q.loop)&&Q.loop>0&&(++N>=Q.loop)){return false}H=0}K(H)}if(A.isFunction(Q.init)){Q.init.apply(O,[M,Q])}B()};A.Marquee.defaults={yScroll:"top",showSpeed:850,scrollSpeed:12,pauseSpeed:5000,pauseOnHover:true,loop:-1,fxEasingShow:"swing",fxEasingScroll:"linear",cssShowing:"marquee-showing",init:null,beforeshow:null,show:null,aftershow:null}})(jQuery); \ No newline at end of file diff --git a/scripts/jquery.multiselect.filter.js b/scripts/jquery.multiselect.filter.js new file mode 100644 index 0000000..88e04b9 --- /dev/null +++ b/scripts/jquery.multiselect.filter.js @@ -0,0 +1,172 @@ +/* jshint forin:true, noarg:true, noempty:true, eqeqeq:true, boss:true, undef:true, curly:true, browser:true, jquery:true */ +/* + * jQuery MultiSelect UI Widget Filtering Plugin 1.5pre + * Copyright (c) 2012 Eric Hynds + * + * http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ + * + * Depends: + * - jQuery UI MultiSelect widget + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ +(function($) { + var rEscape = /[\-\[\]{}()*+?.,\\\^$|#\s]/g; + + $.widget('ech.multiselectfilter', { + + options: { + label: 'Filter:', + width: null, /* override default width set in css file (px). null will inherit */ + placeholder: 'Enter keywords', + autoReset: false + }, + + _create: function() { + var opts = this.options; + + // get the multiselect instance + var instance = (this.instance = $(this.element).data('multiselect')); + + // store header; add filter class so the close/check all/uncheck all links can be positioned correctly + var header = (this.header = instance.menu.find('.ui-multiselect-header').addClass('ui-multiselect-hasfilter')); + + // wrapper elem + var wrapper = (this.wrapper = $('
    ' + (opts.label.length ? opts.label : '') + '
    ').prependTo(this.header)); + + // reference to the actual inputs + this.inputs = instance.menu.find('input[type="checkbox"], input[type="radio"]'); + + // build the input box + this.input = wrapper.find('input').bind({ + keydown: function(e) { + // prevent the enter key from submitting the form / closing the widget + if(e.which === 13) { + e.preventDefault(); + } + }, + keyup: $.proxy(this._handler, this), + click: $.proxy(this._handler, this) + }); + + // cache input values for searching + this.updateCache(); + + // rewrite internal _toggleChecked fn so that when checkAll/uncheckAll is fired, + // only the currently filtered elements are checked + instance._toggleChecked = function(flag, group) { + var $inputs = (group && group.length) ? group : this.labels.find('input'); + + // do not include hidden elems if the menu isn't open. + var selector = instance._isOpen ? ':disabled, :hidden' : ':disabled'; + + $inputs = $inputs + .not(selector) + .each(this._toggleState('checked', flag)); + + // update text + this.update(); + + // gather an array of the values that actually changed + var values = $inputs.map(function() { + return this.value; + }).get(); + + // select option tags + this.element.find('option').filter(function() { + if(!this.disabled && $.inArray(this.value, values) > -1) { + _self._toggleState('selected', flag).call(this); + } + }); + + // trigger the change event on the select + if($inputs.length) { + this.element.trigger('change'); + } + }; + + // rebuild cache when multiselect is updated + var doc = $(document).bind('multiselectrefresh', $.proxy(function() { + this.updateCache(); + this._handler(); + }, this)); + + // automatically reset the widget on close? + if(this.options.autoReset) { + doc.bind('multiselectclose', $.proxy(this._reset, this)); + } + }, + + // thx for the logic here ben alman + _handler: function(e) { + var term = $.trim(this.input[0].value.toLowerCase()), + + // speed up lookups + rows = this.rows, inputs = this.inputs, cache = this.cache; + + if(!term) { + rows.show(); + } else { + rows.hide(); + + var regex = new RegExp(term.replace(rEscape, "\\$&"), 'gi'); + + this._trigger("filter", e, $.map(cache, function(v, i) { + if(v.search(regex) !== -1) { + rows.eq(i).show(); + return inputs.get(i); + } + + return null; + })); + } + + // show/hide optgroups + this.instance.menu.find(".ui-multiselect-optgroup-label").each(function() { + var $this = $(this); + var isVisible = $this.nextUntil('.ui-multiselect-optgroup-label').filter(function() { + return $.css(this, "display") !== 'none'; + }).length; + + $this[isVisible ? 'show' : 'hide'](); + }); + }, + + _reset: function() { + this.input.val('').trigger('keyup'); + }, + + updateCache: function() { + // each list item + this.rows = this.instance.menu.find(".ui-multiselect-checkboxes li:not(.ui-multiselect-optgroup-label)"); + + // cache + this.cache = this.element.children().map(function() { + var elem = $(this); + + // account for optgroups + if(this.tagName.toLowerCase() === "optgroup") { + elem = elem.children(); + } + + return elem.map(function() { + return this.innerHTML.toLowerCase(); + }).get(); + }).get(); + }, + + widget: function() { + return this.wrapper; + }, + + destroy: function() { + $.Widget.prototype.destroy.call(this); + this.input.val('').trigger("keyup"); + this.wrapper.remove(); + } + }); + +})(jQuery); diff --git a/scripts/jquery.multiselect.js b/scripts/jquery.multiselect.js new file mode 100644 index 0000000..a879506 --- /dev/null +++ b/scripts/jquery.multiselect.js @@ -0,0 +1,727 @@ +/* jshint forin:true, noarg:true, noempty:true, eqeqeq:true, boss:true, undef:true, curly:true, browser:true, jquery:true */ +/* + * jQuery MultiSelect UI Widget 1.14pre + * Copyright (c) 2012 Eric Hynds + * + * http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ + * + * Depends: + * - jQuery 1.4.2+ + * - jQuery UI 1.8 widget factory + * + * Optional: + * - jQuery UI effects + * - jQuery UI position utility + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ +(function($, undefined) { + + var multiselectID = 0; + var $doc = $(document); + + $.widget("ech.multiselect", { + + // default options + options: { + header: true, + height: 175, + minWidth: 225, + classes: '', + checkAllText: 'Check all', + uncheckAllText: 'Uncheck all', + noneSelectedText: 'Select options', + selectedText: '# selected', + selectedList: 0, + show: null, + hide: null, + autoOpen: false, + multiple: true, + position: {} + }, + + _create: function() { + var el = this.element.hide(); + var o = this.options; + + this.speed = $.fx.speeds._default; // default speed for effects + this._isOpen = false; // assume no + + // create a unique namespace for events that the widget + // factory cannot unbind automatically. Use eventNamespace if on + // jQuery UI 1.9+, and otherwise fallback to a custom string. + this._namespaceID = this.eventNamespace || ('multiselect' + multiselectID); + + var button = (this.button = $('')) + .addClass('ui-multiselect ui-widget ui-state-default ui-corner-all') + .addClass(o.classes) + .attr({ 'title':el.attr('title'), 'aria-haspopup':true, 'tabIndex':el.attr('tabIndex') }) + .insertAfter(el), + + buttonlabel = (this.buttonlabel = $('')) + .html(o.noneSelectedText) + .appendTo(button), + + menu = (this.menu = $('
    ')) + .addClass('ui-multiselect-menu ui-widget ui-widget-content ui-corner-all') + .addClass(o.classes) + .appendTo(document.body), + + header = (this.header = $('
    ')) + .addClass('ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix') + .appendTo(menu), + + headerLinkContainer = (this.headerLinkContainer = $('
      ')) + .addClass('ui-helper-reset') + .html(function() { + if(o.header === true) { + return '
    • ' + o.checkAllText + '
    • ' + o.uncheckAllText + '
    • '; + } else if(typeof o.header === "string") { + return '
    • ' + o.header + '
    • '; + } else { + return ''; + } + }) + .append('
    • ') + .appendTo(header), + + checkboxContainer = (this.checkboxContainer = $('
        ')) + .addClass('ui-multiselect-checkboxes ui-helper-reset') + .appendTo(menu); + + // perform event bindings + this._bindEvents(); + + // build menu + this.refresh(true); + + // some addl. logic for single selects + if(!o.multiple) { + menu.addClass('ui-multiselect-single'); + } + + // bump unique ID + multiselectID++; + }, + + _init: function() { + if(this.options.header === false) { + this.header.hide(); + } + if(!this.options.multiple) { + this.headerLinkContainer.find('.ui-multiselect-all, .ui-multiselect-none').hide(); + } + if(this.options.autoOpen) { + this.open(); + } + if(this.element.is(':disabled')) { + this.disable(); + } + }, + + refresh: function(init) { + var el = this.element; + var o = this.options; + var menu = this.menu; + var checkboxContainer = this.checkboxContainer; + var optgroups = []; + var html = ""; + var id = el.attr('id') || multiselectID++; // unique ID for the label & option tags + + // build items + el.find('option').each(function(i) { + var $this = $(this); + var parent = this.parentNode; + var title = this.innerHTML; + var description = this.title; + var value = this.value; + var inputID = 'ui-multiselect-' + (this.id || id + '-option-' + i); + var isDisabled = this.disabled; + var isSelected = this.selected; + var labelClasses = [ 'ui-corner-all' ]; + var liClasses = (isDisabled ? 'ui-multiselect-disabled ' : ' ') + this.className; + var optLabel; + + // is this an optgroup? + if(parent.tagName === 'OPTGROUP') { + optLabel = parent.getAttribute('label'); + + // has this optgroup been added already? + if($.inArray(optLabel, optgroups) === -1) { + html += '
      • ' + optLabel + '
      • '; + optgroups.push(optLabel); + } + } + + if(isDisabled) { + labelClasses.push('ui-state-disabled'); + } + + // browsers automatically select the first option + // by default with single selects + if(isSelected && !o.multiple) { + labelClasses.push('ui-state-active'); + } + + html += '
      • '; + + // create the label + html += '
      • '; + }); + + // insert into the DOM + checkboxContainer.html(html); + + // cache some moar useful elements + this.labels = menu.find('label'); + this.inputs = this.labels.children('input'); + + // set widths + this._setButtonWidth(); + this._setMenuWidth(); + + // remember default value + this.button[0].defaultValue = this.update(); + + // broadcast refresh event; useful for widgets + if(!init) { + this._trigger('refresh'); + } + }, + + // updates the button text. call refresh() to rebuild + update: function() { + var o = this.options; + var $inputs = this.inputs; + var $checked = $inputs.filter(':checked'); + var numChecked = $checked.length; + var value; + + if(numChecked === 0) { + value = o.noneSelectedText; + } else { + if($.isFunction(o.selectedText)) { + value = o.selectedText.call(this, numChecked, $inputs.length, $checked.get()); + } else if(/\d/.test(o.selectedList) && o.selectedList > 0 && numChecked <= o.selectedList) { + value = $checked.map(function() { return $(this).next().html(); }).get().join(', '); + } else { + value = o.selectedText.replace('#', numChecked).replace('#', $inputs.length); + } + } + + this._setButtonValue(value); + + return value; + }, + + // this exists as a separate method so that the developer + // can easily override it. + _setButtonValue: function(value) { + this.buttonlabel.text(value); + }, + + // binds events + _bindEvents: function() { + var self = this; + var button = this.button; + + function clickHandler() { + self[ self._isOpen ? 'close' : 'open' ](); + return false; + } + + // webkit doesn't like it when you click on the span :( + button + .find('span') + .bind('click.multiselect', clickHandler); + + // button events + button.bind({ + click: clickHandler, + keypress: function(e) { + switch(e.which) { + case 27: // esc + case 38: // up + case 37: // left + self.close(); + break; + case 39: // right + case 40: // down + self.open(); + break; + } + }, + mouseenter: function() { + if(!button.hasClass('ui-state-disabled')) { + $(this).addClass('ui-state-hover'); + } + }, + mouseleave: function() { + $(this).removeClass('ui-state-hover'); + }, + focus: function() { + if(!button.hasClass('ui-state-disabled')) { + $(this).addClass('ui-state-focus'); + } + }, + blur: function() { + $(this).removeClass('ui-state-focus'); + } + }); + + // header links + this.header.delegate('a', 'click.multiselect', function(e) { + // close link + if($(this).hasClass('ui-multiselect-close')) { + self.close(); + + // check all / uncheck all + } else { + self[$(this).hasClass('ui-multiselect-all') ? 'checkAll' : 'uncheckAll'](); + } + + e.preventDefault(); + }); + + // optgroup label toggle support + this.menu.delegate('li.ui-multiselect-optgroup-label a', 'click.multiselect', function(e) { + e.preventDefault(); + + var $this = $(this); + var $inputs = $this.parent().nextUntil('li.ui-multiselect-optgroup-label').find('input:visible:not(:disabled)'); + var nodes = $inputs.get(); + var label = $this.parent().text(); + + // trigger event and bail if the return is false + if(self._trigger('beforeoptgrouptoggle', e, { inputs:nodes, label:label }) === false) { + return; + } + + // toggle inputs + self._toggleChecked( + $inputs.filter(':checked').length !== $inputs.length, + $inputs + ); + + self._trigger('optgrouptoggle', e, { + inputs: nodes, + label: label, + checked: nodes[0].checked + }); + }) + .delegate('label', 'mouseenter.multiselect', function() { + if(!$(this).hasClass('ui-state-disabled')) { + self.labels.removeClass('ui-state-hover'); + $(this).addClass('ui-state-hover').find('input').focus(); + } + }) + .delegate('label', 'keydown.multiselect', function(e) { + e.preventDefault(); + + switch(e.which) { + case 9: // tab + case 27: // esc + self.close(); + break; + case 38: // up + case 40: // down + case 37: // left + case 39: // right + self._traverse(e.which, this); + break; + case 13: // enter + $(this).find('input')[0].click(); + break; + } + }) + .delegate('input[type="checkbox"], input[type="radio"]', 'click.multiselect', function(e) { + var $this = $(this); + var val = this.value; + var checked = this.checked; + var tags = self.element.find('option'); + + // bail if this input is disabled or the event is cancelled + if(this.disabled || self._trigger('click', e, { value: val, text: this.title, checked: checked }) === false) { + e.preventDefault(); + return; + } + + // make sure the input has focus. otherwise, the esc key + // won't close the menu after clicking an item. + $this.focus(); + + // toggle aria state + $this.attr('aria-selected', checked); + + // change state on the original option tags + tags.each(function() { + if(this.value === val) { + this.selected = checked; + } else if(!self.options.multiple) { + this.selected = false; + } + }); + + // some additional single select-specific logic + if(!self.options.multiple) { + self.labels.removeClass('ui-state-active'); + $this.closest('label').toggleClass('ui-state-active', checked); + + // close menu + self.close(); + } + + // fire change on the select box + self.element.trigger("change"); + + // setTimeout is to fix multiselect issue #14 and #47. caused by jQuery issue #3827 + // http://bugs.jquery.com/ticket/3827 + setTimeout($.proxy(self.update, self), 10); + }); + + // close each widget when clicking on any other element/anywhere else on the page + $doc.bind('mousedown.' + this._namespaceID, function(e) { + if(self._isOpen && !$.contains(self.menu[0], e.target) && !$.contains(self.button[0], e.target) && e.target !== self.button[0]) { + self.close(); + } + }); + + // deal with form resets. the problem here is that buttons aren't + // restored to their defaultValue prop on form reset, and the reset + // handler fires before the form is actually reset. delaying it a bit + // gives the form inputs time to clear. + $(this.element[0].form).bind('reset.multiselect', function() { + setTimeout($.proxy(self.refresh, self), 10); + }); + }, + + // set button width + _setButtonWidth: function() { + var width = this.element.outerWidth(); + var o = this.options; + + if(/\d/.test(o.minWidth) && width < o.minWidth) { + width = o.minWidth; + } + + // set widths + this.button.outerWidth(width); + }, + + // set menu width + _setMenuWidth: function() { + var m = this.menu; + m.outerWidth(this.button.outerWidth()); + }, + + // move up or down within the menu + _traverse: function(which, start) { + var $start = $(start); + var moveToLast = which === 38 || which === 37; + + // select the first li that isn't an optgroup label / disabled + $next = $start.parent()[moveToLast ? 'prevAll' : 'nextAll']('li:not(.ui-multiselect-disabled, .ui-multiselect-optgroup-label)')[ moveToLast ? 'last' : 'first'](); + + // if at the first/last element + if(!$next.length) { + var $container = this.menu.find('ul').last(); + + // move to the first/last + this.menu.find('label')[ moveToLast ? 'last' : 'first' ]().trigger('mouseover'); + + // set scroll position + $container.scrollTop(moveToLast ? $container.height() : 0); + + } else { + $next.find('label').trigger('mouseover'); + } + }, + + // This is an internal function to toggle the checked property and + // other related attributes of a checkbox. + // + // The context of this function should be a checkbox; do not proxy it. + _toggleState: function(prop, flag) { + return function() { + if(!this.disabled) { + this[ prop ] = flag; + } + + if(flag) { + this.setAttribute('aria-selected', true); + } else { + this.removeAttribute('aria-selected'); + } + }; + }, + + _toggleChecked: function(flag, group) { + var $inputs = (group && group.length) ? group : this.inputs; + var self = this; + + // toggle state on inputs + $inputs.each(this._toggleState('checked', flag)); + + // give the first input focus + $inputs.eq(0).focus(); + + // update button text + this.update(); + + // gather an array of the values that actually changed + var values = $inputs.map(function() { + return this.value; + }).get(); + + // toggle state on original option tags + this.element + .find('option') + .each(function() { + if(!this.disabled && $.inArray(this.value, values) > -1) { + self._toggleState('selected', flag).call(this); + } + }); + + // trigger the change event on the select + if($inputs.length) { + this.element.trigger("change"); + } + }, + + _toggleDisabled: function(flag) { + this.button.attr({ 'disabled':flag, 'aria-disabled':flag })[ flag ? 'addClass' : 'removeClass' ]('ui-state-disabled'); + + var inputs = this.menu.find('input'); + var key = "ech-multiselect-disabled"; + + if(flag) { + // remember which elements this widget disabled (not pre-disabled) + // elements, so that they can be restored if the widget is re-enabled. + inputs = inputs.filter(':enabled').data(key, true) + } else { + inputs = inputs.filter(function() { + return $.data(this, key) === true; + }).removeData(key); + } + + inputs + .attr({ 'disabled':flag, 'arial-disabled':flag }) + .parent()[ flag ? 'addClass' : 'removeClass' ]('ui-state-disabled'); + + this.element.attr({ + 'disabled':flag, + 'aria-disabled':flag + }); + }, + + // open the menu + open: function(e) { + var self = this; + var button = this.button; + var menu = this.menu; + var speed = this.speed; + var o = this.options; + var args = []; + + // bail if the multiselectopen event returns false, this widget is disabled, or is already open + if(this._trigger('beforeopen') === false || button.hasClass('ui-state-disabled') || this._isOpen) { + return; + } + + var $container = menu.find('ul').last(); + var effect = o.show; + + // figure out opening effects/speeds + if($.isArray(o.show)) { + effect = o.show[0]; + speed = o.show[1] || self.speed; + } + + // if there's an effect, assume jQuery UI is in use + // build the arguments to pass to show() + if(effect) { + args = [ effect, speed ]; + } + + // set the scroll of the checkbox container + $container.scrollTop(0).height(o.height); + + // positon + this.position(); + + // show the menu, maybe with a speed/effect combo + $.fn.show.apply(menu, args); + + // select the first option + // triggering both mouseover and mouseover because 1.4.2+ has a bug where triggering mouseover + // will actually trigger mouseenter. the mouseenter trigger is there for when it's eventually fixed + this.labels.eq(0).trigger('mouseover').trigger('mouseenter').find('input').trigger('focus'); + + button.addClass('ui-state-active'); + this._isOpen = true; + this._trigger('open'); + }, + + // close the menu + close: function() { + if(this._trigger('beforeclose') === false) { + return; + } + + var o = this.options; + var effect = o.hide; + var speed = this.speed; + var args = []; + + // figure out opening effects/speeds + if($.isArray(o.hide)) { + effect = o.hide[0]; + speed = o.hide[1] || this.speed; + } + + if(effect) { + args = [ effect, speed ]; + } + + $.fn.hide.apply(this.menu, args); + this.button.removeClass('ui-state-active').trigger('blur').trigger('mouseleave'); + this._isOpen = false; + this._trigger('close'); + }, + + enable: function() { + this._toggleDisabled(false); + }, + + disable: function() { + this._toggleDisabled(true); + }, + + checkAll: function(e) { + this._toggleChecked(true); + this._trigger('checkAll'); + }, + + uncheckAll: function() { + this._toggleChecked(false); + this._trigger('uncheckAll'); + }, + + getChecked: function() { + return this.menu.find('input').filter(':checked'); + }, + + destroy: function() { + // remove classes + data + $.Widget.prototype.destroy.call(this); + + // unbind events + $doc.unbind(this._namespaceID); + + this.button.remove(); + this.menu.remove(); + this.element.show(); + + return this; + }, + + isOpen: function() { + return this._isOpen; + }, + + widget: function() { + return this.menu; + }, + + getButton: function() { + return this.button; + }, + + position: function() { + var o = this.options; + + // use the position utility if it exists and options are specifified + if($.ui.position && !$.isEmptyObject(o.position)) { + o.position.of = o.position.of || button; + + this.menu + .show() + .position(o.position) + .hide(); + + // otherwise fallback to custom positioning + } else { + var pos = this.button.offset(); + + this.menu.css({ + top: pos.top + this.button.outerHeight(), + left: pos.left + }); + } + }, + + // react to option changes after initialization + _setOption: function(key, value) { + var menu = this.menu; + + switch(key) { + case 'header': + menu.find('div.ui-multiselect-header')[value ? 'show' : 'hide'](); + break; + case 'checkAllText': + menu.find('a.ui-multiselect-all span').eq(-1).text(value); + break; + case 'uncheckAllText': + menu.find('a.ui-multiselect-none span').eq(-1).text(value); + break; + case 'height': + menu.find('ul').last().height(parseInt(value, 10)); + break; + case 'minWidth': + this.options[key] = parseInt(value, 10); + this._setButtonWidth(); + this._setMenuWidth(); + break; + case 'selectedText': + case 'selectedList': + case 'noneSelectedText': + this.options[key] = value; // these all needs to update immediately for the update() call + this.update(); + break; + case 'classes': + menu.add(this.button).removeClass(this.options.classes).addClass(value); + break; + case 'multiple': + menu.toggleClass('ui-multiselect-single', !value); + this.options.multiple = value; + this.element[0].multiple = value; + this.refresh(); + break; + case 'position': + this.position(); + } + + $.Widget.prototype._setOption.apply(this, arguments); + } + }); + +})(jQuery); diff --git a/scripts/jquery.nicescroll.min.js b/scripts/jquery.nicescroll.min.js new file mode 100644 index 0000000..312ddd4 --- /dev/null +++ b/scripts/jquery.nicescroll.min.js @@ -0,0 +1,111 @@ +/* jquery.nicescroll 3.2.0 InuYaksa*2013 MIT http://areaaperta.com/nicescroll */(function(e){var y=!1,D=!1,J=5E3,K=2E3,x=0,L=function(){var e=document.getElementsByTagName("script"),e=e[e.length-1].src.split("?")[0];return 0f){if(b.getScrollTop()>=b.page.maxh)return!0}else if(0>=b.getScrollTop())return!0;b.scrollmom&&b.scrollmom.stop(); +b.lastdeltay+=f;b.debounced("mousewheely",function(){var d=b.lastdeltay;b.lastdeltay=0;b.rail.drag||b.doScrollBy(d)},120)}d.stopImmediatePropagation();return d.preventDefault()}var b=this;this.version="3.4.0";this.name="nicescroll";this.me=c;this.opt={doc:e("body"),win:!1};e.extend(this.opt,F);this.opt.snapbackspeed=80;if(k)for(var q in b.opt)"undefined"!=typeof k[q]&&(b.opt[q]=k[q]);this.iddoc=(this.doc=b.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/BODY|HTML/.test(b.opt.win?b.opt.win[0].nodeName: +this.doc[0].nodeName);this.haswrapper=!1!==b.opt.win;this.win=b.opt.win||(this.ispage?e(window):this.doc);this.docscroll=this.ispage&&!this.haswrapper?e(window):this.win;this.body=e("body");this.iframe=this.isfixed=this.viewport=!1;this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName;this.istextarea="TEXTAREA"==this.win[0].nodeName;this.forcescreen=!1;this.canshowonmouseevent="scroll"!=b.opt.autohidemode;this.page=this.view=this.onzoomout=this.onzoomin=this.onscrollcancel= +this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;this.observerremover=this.observer=this.scrollmom=this.scrollrunning=this.checkrtlmode=!1;do this.id="ascrail"+K++;while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor= +this.rail=!1;this.visibility=!0;this.hidden=this.locked=!1;this.cursoractive=!0;this.overflowx=b.opt.overflowx;this.overflowy=b.opt.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=M();var f=e.extend({},this.detected);this.ishwscroll=(this.canhwscroll=f.hastransform&&b.opt.hwacceleration)&&b.haswrapper;this.istouchcapable=!1;f.cantouch&&(f.ischrome&&!f.isios&&!f.isandroid)&&(this.istouchcapable= +!0,f.cantouch=!1);f.cantouch&&(f.ismozilla&&!f.isios)&&(this.istouchcapable=!0,f.cantouch=!1);b.opt.enablemouselockapi||(f.hasmousecapture=!1,f.haspointerlock=!1);this.delayed=function(d,c,g,e){var f=b.delaylist[d],h=(new Date).getTime();if(!e&&f&&f.tt)return!1;f&&f.tt&&clearTimeout(f.tt);if(f&&f.last+g>h&&!f.tt)b.delaylist[d]={last:h+g,tt:setTimeout(function(){b.delaylist[d].tt=0;c.call()},g)};else if(!f||!f.tt)b.delaylist[d]={last:h,tt:0},setTimeout(function(){c.call()},0)};this.debounced=function(d, +c,g){var f=b.delaylist[d];(new Date).getTime();b.delaylist[d]=c;f||setTimeout(function(){var c=b.delaylist[d];b.delaylist[d]=!1;c.call()},g)};this.synched=function(d,c){b.synclist[d]=c;(function(){b.onsync||(v(function(){b.onsync=!1;for(d in b.synclist){var c=b.synclist[d];c&&c.call(b);b.synclist[d]=!1}}),b.onsync=!0)})();return d};this.unsynched=function(d){b.synclist[d]&&(b.synclist[d]=!1)};this.css=function(d,c){for(var g in c)b.saved.css.push([d,g,d.css(g)]),d.css(g,c[g])};this.scrollTop=function(d){return"undefined"== +typeof d?b.getScrollTop():b.setScrollTop(d)};this.scrollLeft=function(d){return"undefined"==typeof d?b.getScrollLeft():b.setScrollLeft(d)};BezierClass=function(b,c,g,f,e,h,l){this.st=b;this.ed=c;this.spd=g;this.p1=f||0;this.p2=e||1;this.p3=h||0;this.p4=l||1;this.ts=(new Date).getTime();this.df=this.ed-this.st};BezierClass.prototype={B2:function(b){return 3*b*b*(1-b)},B3:function(b){return 3*b*(1-b)*(1-b)},B4:function(b){return(1-b)*(1-b)*(1-b)},getNow:function(){var b=1-((new Date).getTime()-this.ts)/ +this.spd,c=this.B2(b)+this.B3(b)+this.B4(b);return 0>b?this.ed:this.st+Math.round(this.df*c)},update:function(b,c){this.st=this.getNow();this.ed=b;this.spd=c;this.ts=(new Date).getTime();this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};f.hastranslate3d&&f.isios&&this.doc.css("-webkit-backface-visibility","hidden");var r=function(){var d=b.doc.css(f.trstyle);return d&&"matrix"==d.substr(0,6)?d.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/): +!1};this.getScrollTop=function(d){if(!d){if(d=r())return 16==d.length?-d[13]:-d[5];if(b.timerscroll&&b.timerscroll.bz)return b.timerscroll.bz.getNow()}return b.doc.translate.y};this.getScrollLeft=function(d){if(!d){if(d=r())return 16==d.length?-d[12]:-d[4];if(b.timerscroll&&b.timerscroll.bh)return b.timerscroll.bh.getNow()}return b.doc.translate.x};this.notifyScrollEvent=document.createEvent?function(b){var c=document.createEvent("UIEvents");c.initUIEvent("scroll",!1,!0,window,1);b.dispatchEvent(c)}: +document.fireEvent?function(b){var c=document.createEventObject();b.fireEvent("onscroll");c.cancelBubble=!0}:function(b,c){};f.hastranslate3d&&b.opt.enabletranslate3d?(this.setScrollTop=function(d,c){b.doc.translate.y=d;b.doc.translate.ty=-1*d+"px";b.doc.css(f.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0px)");c||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(d,c){b.doc.translate.x=d;b.doc.translate.tx=-1*d+"px";b.doc.css(f.trstyle,"translate3d("+b.doc.translate.tx+ +","+b.doc.translate.ty+",0px)");c||b.notifyScrollEvent(b.win[0])}):(this.setScrollTop=function(d,c){b.doc.translate.y=d;b.doc.translate.ty=-1*d+"px";b.doc.css(f.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");c||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(d,c){b.doc.translate.x=d;b.doc.translate.tx=-1*d+"px";b.doc.css(f.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");c||b.notifyScrollEvent(b.win[0])})}else this.getScrollTop=function(){return b.docscroll.scrollTop()}, +this.setScrollTop=function(d){return b.docscroll.scrollTop(d)},this.getScrollLeft=function(){return b.docscroll.scrollLeft()},this.setScrollLeft=function(d){return b.docscroll.scrollLeft(d)};this.getTarget=function(b){return!b?!1:b.target?b.target:b.srcElement?b.srcElement:!1};this.hasParent=function(b,c){if(!b)return!1;for(var g=b.target||b.srcElement||b||!1;g&&g.id!=c;)g=g.parentNode||!1;return!1!==g};var u={thin:1,medium:3,thick:5};this.getOffset=function(){if(b.isfixed)return{top:parseFloat(b.win.css("top")), +left:parseFloat(b.win.css("left"))};if(!b.viewport)return b.win.offset();var d=b.win.offset(),c=b.viewport.offset();return{top:d.top-c.top+b.viewport.scrollTop(),left:d.left-c.left+b.viewport.scrollLeft()}};this.updateScrollBar=function(d){if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()}),b.railh&&b.railh.css({width:b.win.innerWidth()});else{var c=b.getOffset(),g=c.top,f=c.left,g=g+l(b.win,"border-top-width",!0);b.win.outerWidth();b.win.innerWidth();var f=f+(b.rail.align?b.win.outerWidth()- +l(b.win,"border-right-width")-b.rail.width:l(b.win,"border-left-width")),e=b.opt.railoffset;e&&(e.top&&(g+=e.top),b.rail.align&&e.left&&(f+=e.left));b.locked||b.rail.css({top:g,left:f,height:d?d.h:b.win.innerHeight()});b.zoom&&b.zoom.css({top:g+1,left:1==b.rail.align?f-20:f+b.rail.width+4});b.railh&&!b.locked&&(g=c.top,f=c.left,d=b.railh.align?g+l(b.win,"border-top-width",!0)+b.win.innerHeight()-b.railh.height:g+l(b.win,"border-top-width",!0),f+=l(b.win,"border-left-width"),b.railh.css({top:d,left:f, +width:b.railh.width}))}};this.doRailClick=function(d,c,g){var f;b.locked||(b.cancelEvent(d),c?(c=g?b.doScrollLeft:b.doScrollTop,f=g?(d.pageX-b.railh.offset().left-b.cursorwidth/2)*b.scrollratio.x:(d.pageY-b.rail.offset().top-b.cursorheight/2)*b.scrollratio.y,c(f)):(c=g?b.doScrollLeftBy:b.doScrollBy,f=g?b.scroll.x:b.scroll.y,d=g?d.pageX-b.railh.offset().left:d.pageY-b.rail.offset().top,g=g?b.view.w:b.view.h,f>=d?c(g):c(-g)))};b.hasanimationframe=v;b.hascancelanimationframe=w;b.hasanimationframe?b.hascancelanimationframe|| +(w=function(){b.cancelAnimationFrame=!0}):(v=function(b){return setTimeout(b,15-Math.floor(+new Date/1E3)%16)},w=clearInterval);this.init=function(){b.saved.css=[];if(f.isie7mobile)return!0;f.hasmstouch&&b.css(b.ispage?e("html"):b.win,{"-ms-touch-action":"none"});b.zindex="auto";b.zindex=!b.ispage&&"auto"==b.opt.zindex?h()||"auto":b.opt.zindex;!b.ispage&&"auto"!=b.zindex&&b.zindex>x&&(x=b.zindex);b.isie&&(0==b.zindex&&"auto"==b.opt.zindex)&&(b.zindex="auto");if(!b.ispage||!f.cantouch&&!f.isieold&& +!f.isie9mobile){var d=b.docscroll;b.ispage&&(d=b.haswrapper?b.win:b.doc);f.isie9mobile||b.css(d,{"overflow-y":"hidden"});b.ispage&&f.isie7&&("BODY"==b.doc[0].nodeName?b.css(e("html"),{"overflow-y":"hidden"}):"HTML"==b.doc[0].nodeName&&b.css(e("body"),{"overflow-y":"hidden"}));f.isios&&(!b.ispage&&!b.haswrapper)&&b.css(e("body"),{"-webkit-overflow-scrolling":"touch"});var c=e(document.createElement("div"));c.css({position:"relative",top:0,"float":"right",width:b.opt.cursorwidth,height:"0px","background-color":b.opt.cursorcolor, +border:b.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":b.opt.cursorborderradius,"-moz-border-radius":b.opt.cursorborderradius,"border-radius":b.opt.cursorborderradius});c.hborder=parseFloat(c.outerHeight()-c.innerHeight());b.cursor=c;var g=e(document.createElement("div"));g.attr("id",b.id);g.addClass("nicescroll-rails");var l,k,n=["left","right"],G;for(G in n)k=n[G],(l=b.opt.railpadding[k])?g.css("padding-"+k,l+"px"):b.opt.railpadding[k]=0;g.append(c);g.width=Math.max(parseFloat(b.opt.cursorwidth), +c.outerWidth())+b.opt.railpadding.left+b.opt.railpadding.right;g.css({width:g.width+"px",zIndex:b.zindex,background:b.opt.background,cursor:"default"});g.visibility=!0;g.scrollable=!0;g.align="left"==b.opt.railalign?0:1;b.rail=g;c=b.rail.drag=!1;b.opt.boxzoom&&(!b.ispage&&!f.isieold)&&(c=document.createElement("div"),b.bind(c,"click",b.doZoom),b.zoom=e(c),b.zoom.css({cursor:"pointer","z-index":b.zindex,backgroundImage:"url("+L+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),b.opt.dblclickzoom&& +b.bind(b.win,"dblclick",b.doZoom),f.cantouch&&b.opt.gesturezoom&&(b.ongesturezoom=function(d){1.5d.scale&&b.doZoomOut(d);return b.cancelEvent(d)},b.bind(b.win,"gestureend",b.ongesturezoom)));b.railh=!1;if(b.opt.horizrailenabled){b.css(d,{"overflow-x":"hidden"});c=e(document.createElement("div"));c.css({position:"relative",top:0,height:b.opt.cursorwidth,width:"0px","background-color":b.opt.cursorcolor,border:b.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":b.opt.cursorborderradius, +"-moz-border-radius":b.opt.cursorborderradius,"border-radius":b.opt.cursorborderradius});c.wborder=parseFloat(c.outerWidth()-c.innerWidth());b.cursorh=c;var m=e(document.createElement("div"));m.attr("id",b.id+"-hr");m.addClass("nicescroll-rails");m.height=Math.max(parseFloat(b.opt.cursorwidth),c.outerHeight());m.css({height:m.height+"px",zIndex:b.zindex,background:b.opt.background});m.append(c);m.visibility=!0;m.scrollable=!0;m.align="top"==b.opt.railvalign?0:1;b.railh=m;b.railh.drag=!1}b.ispage? +(g.css({position:"fixed",top:"0px",height:"100%"}),g.align?g.css({right:"0px"}):g.css({left:"0px"}),b.body.append(g),b.railh&&(m.css({position:"fixed",left:"0px",width:"100%"}),m.align?m.css({bottom:"0px"}):m.css({top:"0px"}),b.body.append(m))):(b.ishwscroll?("static"==b.win.css("position")&&b.css(b.win,{position:"relative"}),d="HTML"==b.win[0].nodeName?b.body:b.win,b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":g.width+4}),d.append(b.zoom)),g.css({position:"absolute",top:0}), +g.align?g.css({right:0}):g.css({left:0}),d.append(g),m&&(m.css({position:"absolute",left:0,bottom:0}),m.align?m.css({bottom:0}):m.css({top:0}),d.append(m))):(b.isfixed="fixed"==b.win.css("position"),d=b.isfixed?"fixed":"absolute",b.isfixed||(b.viewport=b.getViewport(b.win[0])),b.viewport&&(b.body=b.viewport,!1==/relative|absolute/.test(b.viewport.css("position"))&&b.css(b.viewport,{position:"relative"})),g.css({position:d}),b.zoom&&b.zoom.css({position:d}),b.updateScrollBar(),b.body.append(g),b.zoom&& +b.body.append(b.zoom),b.railh&&(m.css({position:d}),b.body.append(m))),f.isios&&b.css(b.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),f.isie&&b.opt.disableoutline&&b.win.attr("hideFocus","true"),f.iswebkit&&b.opt.disableoutline&&b.win.css({outline:"none"}));!1===b.opt.autohidemode?(b.autohidedom=!1,b.rail.css({opacity:b.opt.cursoropacitymax}),b.railh&&b.railh.css({opacity:b.opt.cursoropacitymax})):!0===b.opt.autohidemode?(b.autohidedom=e().add(b.rail),f.isie8&& +(b.autohidedom=b.autohidedom.add(b.cursor)),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh)),b.railh&&f.isie8&&(b.autohidedom=b.autohidedom.add(b.cursorh))):"scroll"==b.opt.autohidemode?(b.autohidedom=e().add(b.rail),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh))):"cursor"==b.opt.autohidemode?(b.autohidedom=e().add(b.cursor),b.railh&&(b.autohidedom=b.autohidedom.add(b.cursorh))):"hidden"==b.opt.autohidemode&&(b.autohidedom=!1,b.hide(),b.locked=!1);if(f.isie9mobile)b.scrollmom=new H(b),b.onmangotouch= +function(d){d=b.getScrollTop();var c=b.getScrollLeft();if(d==b.scrollmom.lastscrolly&&c==b.scrollmom.lastscrollx)return!0;var g=d-b.mangotouch.sy,f=c-b.mangotouch.sx;if(0!=Math.round(Math.sqrt(Math.pow(f,2)+Math.pow(g,2)))){var p=0>g?-1:1,e=0>f?-1:1,h=+new Date;b.mangotouch.lazy&&clearTimeout(b.mangotouch.lazy);80s?s=Math.round(s/2):s>b.page.maxh&&(s=b.page.maxh+Math.round((s-b.page.maxh)/2)):(0>s&&(h=s=0),s>b.page.maxh&&(s=b.page.maxh,h=0));if(b.railh&&b.railh.scrollable){var m=b.rail.drag.sl-k;b.ishwscroll&&b.opt.bouncescroll?0>m?m=Math.round(m/2):m>b.page.maxw&&(m=b.page.maxw+ +Math.round((m-b.page.maxw)/2)):(0>m&&(l=m=0),m>b.page.maxw&&(m=b.page.maxw,l=0))}g=!1;if(b.rail.drag.dl)g=!0,"v"==b.rail.drag.dl?m=b.rail.drag.sl:"h"==b.rail.drag.dl&&(s=b.rail.drag.st);else{var p=Math.abs(p),k=Math.abs(k),n=b.opt.directionlockdeadzone;if("v"==b.rail.drag.ck){if(p>n&&k<=0.3*p)return b.rail.drag=!1,!0;k>n&&(b.rail.drag.dl="f",e("body").scrollTop(e("body").scrollTop()))}else if("h"==b.rail.drag.ck){if(k>n&&p<=0.3*az)return b.rail.drag=!1,!0;p>n&&(b.rail.drag.dl="f",e("body").scrollLeft(e("body").scrollLeft()))}}b.synched("touchmove", +function(){b.rail.drag&&2==b.rail.drag.pt&&(b.prepareTransition&&b.prepareTransition(0),b.rail.scrollable&&b.setScrollTop(s),b.scrollmom.update(l,h),b.railh&&b.railh.scrollable?(b.setScrollLeft(m),b.showCursor(s,m)):b.showCursor(s),f.isie10&&document.selection.clear())});f.ischrome&&b.istouchcapable&&(g=!1);if(g)return b.cancelEvent(d)}}}b.onmousedown=function(d,c){if(!(b.rail.drag&&1!=b.rail.drag.pt)){if(b.locked)return b.cancelEvent(d);b.cancelScroll();b.rail.drag={x:d.clientX,y:d.clientY,sx:b.scroll.x, +sy:b.scroll.y,pt:1,hr:!!c};var g=b.getTarget(d);!b.ispage&&f.hasmousecapture&&g.setCapture();b.isiframe&&!f.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"}));return b.cancelEvent(d)}};b.onmouseup=function(d){if(b.rail.drag&&(f.hasmousecapture&&document.releaseCapture(),b.isiframe&&!f.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents),1==b.rail.drag.pt))return b.rail.drag=!1,b.cancelEvent(d)};b.onmousemove=function(d){if(b.rail.drag&& +1==b.rail.drag.pt){if(f.ischrome&&0==d.which)return b.onmouseup(d);b.cursorfreezed=!0;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(d.clientX-b.rail.drag.x);0>b.scroll.x&&(b.scroll.x=0);var c=b.scrollvaluemaxw;b.scroll.x>c&&(b.scroll.x=c)}else b.scroll.y=b.rail.drag.sy+(d.clientY-b.rail.drag.y),0>b.scroll.y&&(b.scroll.y=0),c=b.scrollvaluemax,b.scroll.y>c&&(b.scroll.y=c);b.synched("mousemove",function(){b.rail.drag&&1==b.rail.drag.pt&&(b.showCursor(),b.rail.drag.hr?b.doScrollLeft(Math.round(b.scroll.x* +b.scrollratio.x),b.opt.cursordragspeed):b.doScrollTop(Math.round(b.scroll.y*b.scrollratio.y),b.opt.cursordragspeed))});return b.cancelEvent(d)}};if(f.cantouch||b.opt.touchbehavior)b.onpreventclick=function(d){if(b.preventclick)return b.preventclick.tg.onclick=b.preventclick.click,b.preventclick=!1,b.cancelEvent(d)},b.bind(b.win,"mousedown",b.ontouchstart),b.onclick=f.isios?!1:function(d){return b.lastmouseup?(b.lastmouseup=!1,b.cancelEvent(d)):!0},b.opt.grabcursorenabled&&f.cursorgrabvalue&&(b.css(b.ispage? +b.doc:b.win,{cursor:f.cursorgrabvalue}),b.css(b.rail,{cursor:f.cursorgrabvalue}));else{var r=function(d){if(b.selectiondrag){if(d){var c=b.win.outerHeight();d=d.pageY-b.selectiondrag.top;0=c&&(d-=c);b.selectiondrag.df=d}0!=b.selectiondrag.df&&(b.doScrollBy(2*-Math.floor(b.selectiondrag.df/6)),b.debounced("doselectionscroll",function(){r()},50))}};b.hasTextSelected="getSelection"in document?function(){return 0b.page.maxh?b.doScrollTop(b.page.maxh):(b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y)), +b.scroll.x=Math.round(b.getScrollLeft()*(1/b.scrollratio.x)),b.cursoractive&&b.noticeCursor());b.scroll.y&&0==b.getScrollTop()&&b.doScrollTo(Math.floor(b.scroll.y*b.scrollratio.y));return b};this.resize=b.onResize;this.lazyResize=function(d){d=isNaN(d)?30:d;b.delayed("resize",b.resize,d);return b};this._bind=function(d,c,g,f){b.events.push({e:d,n:c,f:g,b:f,q:!1});d.addEventListener?d.addEventListener(c,g,f||!1):d.attachEvent?d.attachEvent("on"+c,g):d["on"+c]=g};this.jqbind=function(d,c,g){b.events.push({e:d, +n:c,f:g,q:!0});e(d).bind(c,g)};this.bind=function(d,c,g,e){var h="jquery"in d?d[0]:d;"mousewheel"==c?"onwheel"in b.win?b._bind(h,"wheel",g,e||!1):(d="undefined"!=typeof document.onmousewheel?"mousewheel":"DOMMouseScroll",n(h,d,g,e||!1),"DOMMouseScroll"==d&&n(h,"MozMousePixelScroll",g,e||!1)):h.addEventListener?(f.cantouch&&/mouseup|mousedown|mousemove/.test(c)&&b._bind(h,"mousedown"==c?"touchstart":"mouseup"==c?"touchend":"touchmove",function(b){if(b.touches){if(2>b.touches.length){var d=b.touches.length? +b.touches[0]:b;d.original=b;g.call(this,d)}}else b.changedTouches&&(d=b.changedTouches[0],d.original=b,g.call(this,d))},e||!1),b._bind(h,c,g,e||!1),f.cantouch&&"mouseup"==c&&b._bind(h,"touchcancel",g,e||!1)):b._bind(h,c,function(d){if((d=d||window.event||!1)&&d.srcElement)d.target=d.srcElement;"pageY"in d||(d.pageX=d.clientX+document.documentElement.scrollLeft,d.pageY=d.clientY+document.documentElement.scrollTop);return!1===g.call(h,d)||!1===e?b.cancelEvent(d):!0})};this._unbind=function(b,c,g,f){b.removeEventListener? +b.removeEventListener(c,g,f):b.detachEvent?b.detachEvent("on"+c,g):b["on"+c]=!1};this.unbindAll=function(){for(var d=0;d +(b.newscrolly-h)*(e-h)||0>(b.newscrollx-l)*(c-l))&&b.cancelScroll();!1==b.opt.bouncescroll&&(0>e?e=0:e>b.page.maxh&&(e=b.page.maxh),0>c?c=0:c>b.page.maxw&&(c=b.page.maxw));if(b.scrollrunning&&c==b.newscrollx&&e==b.newscrolly)return!1;b.newscrolly=e;b.newscrollx=c;b.newscrollspeed=g||!1;if(b.timer)return!1;b.timer=setTimeout(function(){var g=b.getScrollTop(),h=b.getScrollLeft(),l,k;l=c-h;k=e-g;l=Math.round(Math.sqrt(Math.pow(l,2)+Math.pow(k,2)));l=b.newscrollspeed&&1=b.newscrollspeed&&(l*=b.newscrollspeed);b.prepareTransition(l,!0);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);0c?c=0:c>b.page.maxh&&(c=b.page.maxh);0>e?e=0:e>b.page.maxw&&(e=b.page.maxw);if(c!=b.newscrolly||e!=b.newscrollx)return b.doScrollPos(e,c,b.opt.snapbackspeed);b.onscrollend&&b.scrollrunning&&b.onscrollend.call(b,{type:"scrollend",current:{x:e,y:c},end:{x:b.newscrollx,y:b.newscrolly}});b.scrollrunning= +!1}):(this.doScrollLeft=function(c,f){var g=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(c,g,f)},this.doScrollTop=function(c,f){var g=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(g,c,f)},this.doScrollPos=function(c,f,g){function e(){if(b.cancelAnimationFrame)return!0;b.scrollrunning=!0;if(r=1-r)return b.timer=v(e)||1;var c=0,d=sy=b.getScrollTop();if(b.dst.ay){var d=b.bzscroll?b.dst.py+b.bzscroll.getNow()*b.dst.ay:b.newscrolly,g=d-sy;if(0>g&&db.newscrolly)d= +b.newscrolly;b.setScrollTop(d);d==b.newscrolly&&(c=1)}else c=1;var f=sx=b.getScrollLeft();if(b.dst.ax){f=b.bzscroll?b.dst.px+b.bzscroll.getNow()*b.dst.ax:b.newscrollx;g=f-sx;if(0>g&&fb.newscrollx)f=b.newscrollx;b.setScrollLeft(f);f==b.newscrollx&&(c+=1)}else c+=1;2==c?(b.timer=0,b.cursorfreezed=!1,b.bzscroll=!1,b.scrollrunning=!1,0>d?d=0:d>b.page.maxh&&(d=b.page.maxh),0>f?f=0:f>b.page.maxw&&(f=b.page.maxw),f!=b.newscrollx||d!=b.newscrolly?b.doScrollPos(f,d):b.onscrollend&&b.onscrollend.call(b, +{type:"scrollend",current:{x:sx,y:sy},end:{x:b.newscrollx,y:b.newscrolly}})):b.timer=v(e)||1}f="undefined"==typeof f||!1===f?b.getScrollTop(!0):f;if(b.timer&&b.newscrolly==f&&b.newscrollx==c)return!0;b.timer&&w(b.timer);b.timer=0;var h=b.getScrollTop(),l=b.getScrollLeft();(0>(b.newscrolly-h)*(f-h)||0>(b.newscrollx-l)*(c-l))&&b.cancelScroll();b.newscrolly=f;b.newscrollx=c;if(!b.bouncescroll||!b.rail.visibility)0>b.newscrolly?b.newscrolly=0:b.newscrolly>b.page.maxh&&(b.newscrolly=b.page.maxh);if(!b.bouncescroll|| +!b.railh.visibility)0>b.newscrollx?b.newscrollx=0:b.newscrollx>b.page.maxw&&(b.newscrollx=b.page.maxw);b.dst={};b.dst.x=c-l;b.dst.y=f-h;b.dst.px=l;b.dst.py=h;var k=Math.round(Math.sqrt(Math.pow(b.dst.x,2)+Math.pow(b.dst.y,2)));b.dst.ax=b.dst.x/k;b.dst.ay=b.dst.y/k;var n=0,q=k;0==b.dst.x?(n=h,q=f,b.dst.ay=1,b.dst.py=0):0==b.dst.y&&(n=l,q=c,b.dst.ax=1,b.dst.px=0);k=b.getTransitionSpeed(k);g&&1>=g&&(k*=g);b.bzscroll=0=b.page.maxh||l==b.page.maxw&&c>=b.page.maxw)&&b.checkContentSize();var r=1;b.cancelAnimationFrame=!1;b.timer=1;b.onscrollstart&&!b.scrollrunning&&b.onscrollstart.call(b,{type:"scrollstart",current:{x:l,y:h},request:{x:c,y:f},end:{x:b.newscrollx,y:b.newscrolly},speed:k});e();(h==b.page.maxh&&f>=h||l==b.page.maxw&&c>=l)&&b.checkContentSize();b.noticeCursor()}},this.cancelScroll=function(){b.timer&&w(b.timer);b.timer=0;b.bzscroll=!1;b.scrollrunning=!1;return b}):(this.doScrollLeft=function(c, +f){var g=b.getScrollTop();b.doScrollPos(c,g,f)},this.doScrollTop=function(c,f){var g=b.getScrollLeft();b.doScrollPos(g,c,f)},this.doScrollPos=function(c,f,g){var e=c>b.page.maxw?b.page.maxw:c;0>e&&(e=0);var h=f>b.page.maxh?b.page.maxh:f;0>h&&(h=0);b.synched("scroll",function(){b.setScrollTop(h);b.setScrollLeft(e)})},this.cancelScroll=function(){});this.doScrollBy=function(c,f){var g=0,g=f?Math.floor((b.scroll.y-c)*b.scrollratio.y):(b.timer?b.newscrolly:b.getScrollTop(!0))-c;if(b.bouncescroll){var e= +Math.round(b.view.h/2);g<-e?g=-e:g>b.page.maxh+e&&(g=b.page.maxh+e)}b.cursorfreezed=!1;py=b.getScrollTop(!0);if(0>g&&0>=py)return b.noticeCursor();if(g>b.page.maxh&&py>=b.page.maxh)return b.checkContentSize(),b.noticeCursor();b.doScrollTop(g)};this.doScrollLeftBy=function(c,f){var g=0,g=f?Math.floor((b.scroll.x-c)*b.scrollratio.x):(b.timer?b.newscrollx:b.getScrollLeft(!0))-c;if(b.bouncescroll){var e=Math.round(b.view.w/2);g<-e?g=-e:g>b.page.maxw+e&&(g=b.page.maxw+e)}b.cursorfreezed=!1;px=b.getScrollLeft(!0); +if(0>g&&0>=px||g>b.page.maxw&&px>=b.page.maxw)return b.noticeCursor();b.doScrollLeft(g)};this.doScrollTo=function(c,f){f&&Math.round(c*b.scrollratio.y);b.cursorfreezed=!1;b.doScrollTop(c)};this.checkContentSize=function(){var c=b.getContentSize();(c.h!=b.page.h||c.w!=b.page.w)&&b.resize(!1,c)};b.onscroll=function(c){b.rail.drag||b.cursorfreezed||b.synched("scroll",function(){b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.railh&&(b.scroll.x=Math.round(b.getScrollLeft()*(1/b.scrollratio.x))); +b.noticeCursor()})};b.bind(b.docscroll,"scroll",b.onscroll);this.doZoomIn=function(c){if(!b.zoomactive){b.zoomactive=!0;b.zoomrestore={style:{}};var h="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),g=b.win[0].style,l;for(l in h){var k=h[l];b.zoomrestore.style[k]="undefined"!=typeof g[k]?g[k]:""}b.zoomrestore.style.width=b.win.css("width");b.zoomrestore.style.height=b.win.css("height");b.zoomrestore.padding={w:b.win.outerWidth()-b.win.width(),h:b.win.outerHeight()- +b.win.height()};f.isios4&&(b.zoomrestore.scrollTop=e(window).scrollTop(),e(window).scrollTop(0));b.win.css({position:f.isios4?"absolute":"fixed",top:0,left:0,"z-index":x+100,margin:"0px"});h=b.win.css("backgroundColor");(""==h||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(h))&&b.win.css("backgroundColor","#fff");b.rail.css({"z-index":x+101});b.zoom.css({"z-index":x+102});b.zoom.css("backgroundPosition","0px -18px");b.resizeZoom();b.onzoomin&&b.onzoomin.call(b);return b.cancelEvent(c)}};this.doZoomOut= +function(c){if(b.zoomactive)return b.zoomactive=!1,b.win.css("margin",""),b.win.css(b.zoomrestore.style),f.isios4&&e(window).scrollTop(b.zoomrestore.scrollTop),b.rail.css({"z-index":b.zindex}),b.zoom.css({"z-index":b.zindex}),b.zoomrestore=!1,b.zoom.css("backgroundPosition","0px 0px"),b.onResize(),b.onzoomout&&b.onzoomout.call(b),b.cancelEvent(c)};this.doZoom=function(c){return b.zoomactive?b.doZoomOut(c):b.doZoomIn(c)};this.resizeZoom=function(){if(b.zoomactive){var c=b.getScrollTop();b.win.css({width:e(window).width()- +b.zoomrestore.padding.w+"px",height:e(window).height()-b.zoomrestore.padding.h+"px"});b.onResize();b.setScrollTop(Math.min(b.page.maxh,c))}};this.init();e.nicescroll.push(this)},H=function(e){var c=this;this.nc=e;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.time=function(){return+new Date};this.reset=function(e,l){c.stop();var k=c.time();c.steptime= +0;c.lasttime=k;c.speedx=0;c.speedy=0;c.lastx=e;c.lasty=l;c.lastscrollx=-1;c.lastscrolly=-1};this.update=function(e,l){var k=c.time();c.steptime=k-c.lasttime;c.lasttime=k;var k=l-c.lasty,t=e-c.lastx,b=c.nc.getScrollTop(),q=c.nc.getScrollLeft(),b=b+k,q=q+t;c.snapx=0>q||q>c.nc.page.maxw;c.snapy=0>b||b>c.nc.page.maxh;c.speedx=t;c.speedy=k;c.lastx=e;c.lasty=l};this.stop=function(){c.nc.unsynched("domomentum2d");c.timer&&clearTimeout(c.timer);c.timer=0;c.lastscrollx=-1;c.lastscrolly=-1};this.doSnapy=function(e, +l){var k=!1;0>l?(l=0,k=!0):l>c.nc.page.maxh&&(l=c.nc.page.maxh,k=!0);0>e?(e=0,k=!0):e>c.nc.page.maxw&&(e=c.nc.page.maxw,k=!0);k&&c.nc.doScrollPos(e,l,c.nc.opt.snapbackspeed)};this.doMomentum=function(e){var l=c.time(),k=e?l+e:c.lasttime;e=c.nc.getScrollLeft();var t=c.nc.getScrollTop(),b=c.nc.page.maxh,q=c.nc.page.maxw;c.speedx=0=l-k;if(0>t||t>b||0>e||e>q)k=!1;e=c.speedx&&k?c.speedx:!1;if(c.speedy&&k&&c.speedy||e){var f=Math.max(16, +c.steptime);50r||r>q))e=0.1;if(c.speedy&&(u=Math.floor(c.lastscrolly-c.speedy*(1-c.demulxy)),c.lastscrolly=u,0>u||u>b))e=0.1;c.demulxy=Math.min(1,c.demulxy+e);c.nc.synched("domomentum2d", +function(){c.speedx&&(c.nc.getScrollLeft()!=c.chkx&&c.stop(),c.chkx=r,c.nc.setScrollLeft(r));c.speedy&&(c.nc.getScrollTop()!=c.chky&&c.stop(),c.chky=u,c.nc.setScrollTop(u));c.timer||(c.nc.hideCursor(),c.doSnapy(r,u))});1>c.demulxy?c.timer=setTimeout(d,f):(c.stop(),c.nc.hideCursor(),c.doSnapy(r,u))};d()}else c.doSnapy(c.nc.getScrollLeft(),c.nc.getScrollTop())}},A=e.fn.scrollTop;e.cssHooks.pageYOffset={get:function(k,c,h){return(c=e.data(k,"__nicescroll")||!1)&&c.ishwscroll?c.getScrollTop():A.call(k)}, +set:function(k,c){var h=e.data(k,"__nicescroll")||!1;h&&h.ishwscroll?h.setScrollTop(parseInt(c)):A.call(k,c);return this}};e.fn.scrollTop=function(k){if("undefined"==typeof k){var c=this[0]?e.data(this[0],"__nicescroll")||!1:!1;return c&&c.ishwscroll?c.getScrollTop():A.call(this)}return this.each(function(){var c=e.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollTop(parseInt(k)):A.call(e(this),k)})};var B=e.fn.scrollLeft;e.cssHooks.pageXOffset={get:function(k,c,h){return(c=e.data(k,"__nicescroll")|| +!1)&&c.ishwscroll?c.getScrollLeft():B.call(k)},set:function(k,c){var h=e.data(k,"__nicescroll")||!1;h&&h.ishwscroll?h.setScrollLeft(parseInt(c)):B.call(k,c);return this}};e.fn.scrollLeft=function(k){if("undefined"==typeof k){var c=this[0]?e.data(this[0],"__nicescroll")||!1:!1;return c&&c.ishwscroll?c.getScrollLeft():B.call(this)}return this.each(function(){var c=e.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollLeft(parseInt(k)):B.call(e(this),k)})};var C=function(k){var c=this;this.length= +0;this.name="nicescrollarray";this.each=function(e){for(var h=0;h + * @link http://thomasjbradley.ca/lab/signature-pad + * @link https://github.com/thomasjbradley/signature-pad + * @copyright 2013 Thomas J Bradley + * @license BSD-3-CLAUSE + * @version 2.4.1 + */ +!function($){function SignaturePad(selector,options){function clearMouseLeaveTimeout(){clearTimeout(mouseLeaveTimeout),mouseLeaveTimeout=!1,mouseButtonDown=!1}function drawLine(e,newYOffset){var offset,newX,newY;return e.preventDefault(),offset=$(e.target).offset(),clearTimeout(mouseLeaveTimeout),mouseLeaveTimeout=!1,"undefined"!=typeof e.changedTouches?(newX=Math.floor(e.changedTouches[0].pageX-offset.left),newY=Math.floor(e.changedTouches[0].pageY-offset.top)):(newX=Math.floor(e.pageX-offset.left),newY=Math.floor(e.pageY-offset.top)),previous.x===newX&&previous.y===newY?!0:(null===previous.x&&(previous.x=newX),null===previous.y&&(previous.y=newY),newYOffset&&(newY+=newYOffset),canvasContext.beginPath(),canvasContext.moveTo(previous.x,previous.y),canvasContext.lineTo(newX,newY),canvasContext.lineCap=settings.penCap,canvasContext.stroke(),canvasContext.closePath(),output.push({lx:newX,ly:newY,mx:previous.x,my:previous.y}),previous.x=newX,previous.y=newY,settings.onDraw&&"function"==typeof settings.onDraw&&settings.onDraw.apply(self),void 0)}function stopDrawing(e){e?drawLine(e,1):(touchable?canvas.each(function(){this.removeEventListener("touchmove",drawLine)}):canvas.unbind("mousemove.signaturepad"),output.length>0&&settings.onDrawEnd&&"function"==typeof settings.onDrawEnd&&settings.onDrawEnd.apply(self)),previous.x=null,previous.y=null,settings.output&&output.length>0&&$(settings.output,context).val(JSON.stringify(output))}function drawSigLine(){return settings.lineWidth?(canvasContext.beginPath(),canvasContext.lineWidth=settings.lineWidth,canvasContext.strokeStyle=settings.lineColour,canvasContext.moveTo(settings.lineMargin,settings.lineTop),canvasContext.lineTo(element.width-settings.lineMargin,settings.lineTop),canvasContext.stroke(),canvasContext.closePath(),void 0):!1}function clearCanvas(){canvasContext.clearRect(0,0,element.width,element.height),canvasContext.fillStyle=settings.bgColour,canvasContext.fillRect(0,0,element.width,element.height),settings.displayOnly||drawSigLine(),canvasContext.lineWidth=settings.penWidth,canvasContext.strokeStyle=settings.penColour,$(settings.output,context).val(""),output=[],stopDrawing()}function onMouseMove(e,o){null==previous.x?drawLine(e,1):drawLine(e,o)}function startDrawing(e,touchObject){touchable?touchObject.addEventListener("touchmove",onMouseMove,!1):canvas.bind("mousemove.signaturepad",onMouseMove),drawLine(e,1)}function disableCanvas(){eventsBound=!1,canvas.each(function(){this.removeEventListener&&(this.removeEventListener("touchend",stopDrawing),this.removeEventListener("touchcancel",stopDrawing),this.removeEventListener("touchmove",drawLine)),this.ontouchstart&&(this.ontouchstart=null)}),$(document).unbind("mouseup.signaturepad"),canvas.unbind("mousedown.signaturepad"),canvas.unbind("mousemove.signaturepad"),canvas.unbind("mouseleave.signaturepad"),$(settings.clear,context).unbind("click.signaturepad")}function initDrawEvents(e){return eventsBound?!1:(eventsBound=!0,$("input").blur(),"undefined"!=typeof e.changedTouches&&(touchable=!0),touchable?(canvas.each(function(){this.addEventListener("touchend",stopDrawing,!1),this.addEventListener("touchcancel",stopDrawing,!1)}),canvas.unbind("mousedown.signaturepad")):($(document).bind("mouseup.signaturepad",function(){mouseButtonDown&&(stopDrawing(),clearMouseLeaveTimeout())}),canvas.bind("mouseleave.signaturepad",function(e){mouseButtonDown&&stopDrawing(e),mouseButtonDown&&!mouseLeaveTimeout&&(mouseLeaveTimeout=setTimeout(function(){stopDrawing(),clearMouseLeaveTimeout()},500))}),canvas.each(function(){this.ontouchstart=null})),void 0)}function drawIt(){$(settings.typed,context).hide(),clearCanvas(),canvas.each(function(){this.ontouchstart=function(e){e.preventDefault(),mouseButtonDown=!0,initDrawEvents(e),startDrawing(e,this)}}),canvas.bind("mousedown.signaturepad",function(e){e.preventDefault(),mouseButtonDown=!0,initDrawEvents(e),startDrawing(e)}),$(settings.clear,context).bind("click.signaturepad",function(e){e.preventDefault(),clearCanvas()}),$(settings.typeIt,context).bind("click.signaturepad",function(e){e.preventDefault(),typeIt()}),$(settings.drawIt,context).unbind("click.signaturepad"),$(settings.drawIt,context).bind("click.signaturepad",function(e){e.preventDefault()}),$(settings.typeIt,context).removeClass(settings.currentClass),$(settings.drawIt,context).addClass(settings.currentClass),$(settings.sig,context).addClass(settings.currentClass),$(settings.typeItDesc,context).hide(),$(settings.drawItDesc,context).show(),$(settings.clear,context).show()}function typeIt(){clearCanvas(),disableCanvas(),$(settings.typed,context).show(),$(settings.drawIt,context).bind("click.signaturepad",function(e){e.preventDefault(),drawIt()}),$(settings.typeIt,context).unbind("click.signaturepad"),$(settings.typeIt,context).bind("click.signaturepad",function(e){e.preventDefault()}),$(settings.output,context).val(""),$(settings.drawIt,context).removeClass(settings.currentClass),$(settings.typeIt,context).addClass(settings.currentClass),$(settings.sig,context).removeClass(settings.currentClass),$(settings.drawItDesc,context).hide(),$(settings.clear,context).hide(),$(settings.typeItDesc,context).show(),typeItCurrentFontSize=typeItDefaultFontSize=$(settings.typed,context).css("font-size").replace(/px/,"")}function type(val){var typed=$(settings.typed,context),cleanedVal=val.replace(/>/g,">").replace(/oldLength&&typed.outerWidth()>element.width)for(;typed.outerWidth()>element.width;)typeItCurrentFontSize--,typed.css("font-size",typeItCurrentFontSize+"px");if(oldLength>typeItNumChars&&typed.outerWidth()+edgeOffsettypeItCurrentFontSize)for(;typed.outerWidth()+edgeOffsettypeItCurrentFontSize;)typeItCurrentFontSize++,typed.css("font-size",typeItCurrentFontSize+"px")}function onBeforeValidate(context,settings){$("p."+settings.errorClass,context).remove(),context.removeClass(settings.errorClass),$("input, label",context).removeClass(settings.errorClass)}function onFormError(errors,context,settings){errors.nameInvalid&&(context.prepend(['

        ',settings.errorMessage,"

        "].join("")),$(settings.name,context).focus(),$(settings.name,context).addClass(settings.errorClass),$("label[for="+$(settings.name).attr("id")+"]",context).addClass(settings.errorClass)),errors.drawInvalid&&context.prepend(['

        ',settings.errorMessageDraw,"

        "].join(""))}function validateForm(){var valid=!0,errors={drawInvalid:!1,nameInvalid:!1},onBeforeArguments=[context,settings],onErrorArguments=[errors,context,settings];return settings.onBeforeValidate&&"function"==typeof settings.onBeforeValidate?settings.onBeforeValidate.apply(self,onBeforeArguments):onBeforeValidate.apply(self,onBeforeArguments),settings.drawOnly&&output.length<1&&(errors.drawInvalid=!0,valid=!1),""===$(settings.name,context).val()&&(errors.nameInvalid=!0,valid=!1),settings.onFormError&&"function"==typeof settings.onFormError?settings.onFormError.apply(self,onErrorArguments):onFormError.apply(self,onErrorArguments),valid}function drawSignature(paths,context,saveOutput){for(var i in paths)"object"==typeof paths[i]&&(context.beginPath(),context.moveTo(paths[i].mx,paths[i].my),context.lineTo(paths[i].lx,paths[i].ly),context.lineCap=settings.penCap,context.stroke(),context.closePath(),saveOutput&&output.push({lx:paths[i].lx,ly:paths[i].ly,mx:paths[i].mx,my:paths[i].my}))}function init(){parseFloat((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)||[0,"4_2"])[1].replace("_","."))<4.1&&($.fn.Oldoffset=$.fn.offset,$.fn.offset=function(){var result=$(this).Oldoffset();return result.top-=window.scrollY,result.left-=window.scrollX,result}),$(settings.typed,context).bind("selectstart.signaturepad",function(e){return $(e.target).is(":input")}),canvas.bind("selectstart.signaturepad",function(e){return $(e.target).is(":input")}),!element.getContext&&FlashCanvas&&FlashCanvas.initElement(element),element.getContext&&(canvasContext=element.getContext("2d"),$(settings.sig,context).show(),settings.displayOnly||(settings.drawOnly||($(settings.name,context).bind("keyup.signaturepad",function(){type($(this).val())}),$(settings.name,context).bind("blur.signaturepad",function(){type($(this).val())}),$(settings.drawIt,context).bind("click.signaturepad",function(e){e.preventDefault(),drawIt()})),settings.drawOnly||"drawIt"===settings.defaultAction?drawIt():typeIt(),settings.validateFields&&($(selector).is("form")?$(selector).bind("submit.signaturepad",function(){return validateForm()}):$(selector).parents("form").bind("submit.signaturepad",function(){return validateForm()})),$(settings.sigNav,context).show()))}var self=this,settings=$.extend({},$.fn.signaturePad.defaults,options),context=$(selector),canvas=$(settings.canvas,context),element=canvas.get(0),canvasContext=null,previous={x:null,y:null},output=[],mouseLeaveTimeout=!1,mouseButtonDown=!1,touchable=!1,eventsBound=!1,typeItDefaultFontSize=30,typeItCurrentFontSize=typeItDefaultFontSize,typeItNumChars=0;$.extend(self,{init:function(){init()},updateOptions:function(options){$.extend(settings,options)},regenerate:function(paths){self.clearCanvas(),$(settings.typed,context).hide(),"string"==typeof paths&&(paths=JSON.parse(paths)),drawSignature(paths,canvasContext,!0),settings.output&&$(settings.output,context).length>0&&$(settings.output,context).val(JSON.stringify(output))},clearCanvas:function(){clearCanvas()},getSignature:function(){return output},getSignatureString:function(){return JSON.stringify(output)},getSignatureImage:function(){var tmpCanvas=document.createElement("canvas"),tmpContext=null,data=null;return tmpCanvas.style.position="absolute",tmpCanvas.style.top="-999em",tmpCanvas.width=element.width,tmpCanvas.height=element.height,document.body.appendChild(tmpCanvas),!tmpCanvas.getContext&&FlashCanvas&&FlashCanvas.initElement(tmpCanvas),tmpContext=tmpCanvas.getContext("2d"),tmpContext.fillStyle=settings.bgColour,tmpContext.fillRect(0,0,element.width,element.height),tmpContext.lineWidth=settings.penWidth,tmpContext.strokeStyle=settings.penColour,drawSignature(output,tmpContext),data=tmpCanvas.toDataURL.apply(tmpCanvas,arguments),document.body.removeChild(tmpCanvas),tmpCanvas=null,data},validateForm:function(){return validateForm()}})}$.fn.signaturePad=function(options){var api=null;return this.each(function(){$.data(this,"plugin-signaturePad")?(api=$.data(this,"plugin-signaturePad"),api.updateOptions(options)):(api=new SignaturePad(this,options),api.init(),$.data(this,"plugin-signaturePad",api))}),api},$.fn.signaturePad.defaults={defaultAction:"typeIt",displayOnly:!1,drawOnly:!1,canvas:"canvas",sig:".sig",sigNav:".sigNav",bgColour:"#ffffff",penColour:"#145394",penWidth:2,penCap:"round",lineColour:"#ccc",lineWidth:2,lineMargin:5,lineTop:35,name:".name",typed:".typed",clear:".clearButton",typeIt:".typeIt a",drawIt:".drawIt a",typeItDesc:".typeItDesc",drawItDesc:".drawItDesc",output:".output",currentClass:"current",validateFields:!0,errorClass:"error",errorMessage:"Please enter your name",errorMessageDraw:"Please sign the document",onBeforeValidate:null,onFormError:null,onDraw:null,onDrawEnd:null}}(jQuery); \ No newline at end of file diff --git a/scripts/jquery.unveil.js b/scripts/jquery.unveil.js new file mode 100644 index 0000000..8cfeb25 --- /dev/null +++ b/scripts/jquery.unveil.js @@ -0,0 +1,56 @@ +/** + * jQuery Unveil + * A very lightweight jQuery plugin to lazy load images + * http://luis-almeida.github.com/unveil + * + * Licensed under the MIT license. + * Copyright 2013 Luís Almeida + * https://github.com/luis-almeida + */ + +;(function($) { + + $.fn.unveil = function(threshold, callback) { + + var $w = $(window), + th = threshold || 0, + retina = window.devicePixelRatio > 1, + attrib = retina? "data-src-retina" : "data-src", + images = this, + loaded; + + this.one("unveil", function() { + var source = this.getAttribute(attrib); + source = source || this.getAttribute("data-src"); + if (source) { + this.setAttribute("src", source); + if (typeof callback === "function") callback.call(this); + } + }); + + function unveil() { + var inview = images.filter(function() { + var $e = $(this); + if ($e.is(":hidden")) return; + + var wt = $w.scrollTop(), + wb = wt + $w.height(), + et = $e.offset().top, + eb = et + $e.height(); + + return eb >= wt - th && et <= wb + th; + }); + + loaded = inview.trigger("unveil"); + images = images.not(loaded); + } + + $w.on("scroll.unveil resize.unveil lookup.unveil", unveil); + + unveil(); + + return this; + + }; + +})(window.jQuery || window.Zepto); diff --git a/scripts/jquery.validate.js b/scripts/jquery.validate.js new file mode 100644 index 0000000..e702917 --- /dev/null +++ b/scripts/jquery.validate.js @@ -0,0 +1,11 @@ +/*! + * jQuery Validation Plugin 1.11.1 + * + * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ + * http://docs.jquery.com/Plugins/Validation + * + * Copyright 2013 Jörn Zaefferer + * Released under the MIT license: + * http://www.opensource.org/licenses/mit-license.php + */ +(function(e){e.extend(e.fn,{validate:function(t){if(!this.length){if(t&&t.debug&&window.console){console.warn("Nothing selected, can't validate, returning nothing.")}return}var n=e.data(this[0],"validator");if(n){return n}this.attr("novalidate","novalidate");n=new e.validator(t,this[0]);e.data(this[0],"validator",n);if(n.settings.onsubmit){this.validateDelegate(":submit","click",function(t){if(n.settings.submitHandler){n.submitButton=t.target}if(e(t.target).hasClass("cancel")){n.cancelSubmit=true}if(e(t.target).attr("formnovalidate")!==undefined){n.cancelSubmit=true}});this.submit(function(t){function r(){var r;if(n.settings.submitHandler){if(n.submitButton){r=e("").attr("name",n.submitButton.name).val(e(n.submitButton).val()).appendTo(n.currentForm)}n.settings.submitHandler.call(n,n.currentForm,t);if(n.submitButton){r.remove()}return false}return true}if(n.settings.debug){t.preventDefault()}if(n.cancelSubmit){n.cancelSubmit=false;return r()}if(n.form()){if(n.pendingRequest){n.formSubmitted=true;return false}return r()}else{n.focusInvalid();return false}})}return n},valid:function(){if(e(this[0]).is("form")){return this.validate().form()}else{var t=true;var n=e(this[0].form).validate();this.each(function(){t=t&&n.element(this)});return t}},removeAttrs:function(t){var n={},r=this;e.each(t.split(/\s/),function(e,t){n[t]=r.attr(t);r.removeAttr(t)});return n},rules:function(t,n){var r=this[0];if(t){var i=e.data(r.form,"validator").settings;var s=i.rules;var o=e.validator.staticRules(r);switch(t){case"add":e.extend(o,e.validator.normalizeRule(n));delete o.messages;s[r.name]=o;if(n.messages){i.messages[r.name]=e.extend(i.messages[r.name],n.messages)}break;case"remove":if(!n){delete s[r.name];return o}var u={};e.each(n.split(/\s/),function(e,t){u[t]=o[t];delete o[t]});return u}}var a=e.validator.normalizeRules(e.extend({},e.validator.classRules(r),e.validator.attributeRules(r),e.validator.dataRules(r),e.validator.staticRules(r)),r);if(a.required){var f=a.required;delete a.required;a=e.extend({required:f},a)}return a}});e.extend(e.expr[":"],{blank:function(t){return!e.trim(""+e(t).val())},filled:function(t){return!!e.trim(""+e(t).val())},unchecked:function(t){return!e(t).prop("checked")}});e.validator=function(t,n){this.settings=e.extend(true,{},e.validator.defaults,t);this.currentForm=n;this.init()};e.validator.format=function(t,n){if(arguments.length===1){return function(){var n=e.makeArray(arguments);n.unshift(t);return e.validator.format.apply(this,n)}}if(arguments.length>2&&n.constructor!==Array){n=e.makeArray(arguments).slice(1)}if(n.constructor!==Array){n=[n]}e.each(n,function(e,n){t=t.replace(new RegExp("\\{"+e+"\\}","g"),function(){return n})});return t};e.extend(e.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:e([]),errorLabelContainer:e([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(e,t){this.lastActive=e;if(this.settings.focusCleanup&&!this.blockFocusCleanup){if(this.settings.unhighlight){this.settings.unhighlight.call(this,e,this.settings.errorClass,this.settings.validClass)}this.addWrapper(this.errorsFor(e)).hide()}},onfocusout:function(e,t){if(!this.checkable(e)&&(e.name in this.submitted||!this.optional(e))){this.element(e)}},onkeyup:function(e,t){if(t.which===9&&this.elementValue(e)===""){return}else if(e.name in this.submitted||e===this.lastElement){this.element(e)}},onclick:function(e,t){if(e.name in this.submitted){this.element(e)}else if(e.parentNode.name in this.submitted){this.element(e.parentNode)}},highlight:function(t,n,r){if(t.type==="radio"){this.findByName(t.name).addClass(n).removeClass(r)}else{e(t).addClass(n).removeClass(r)}},unhighlight:function(t,n,r){if(t.type==="radio"){this.findByName(t.name).removeClass(n).addClass(r)}else{e(t).removeClass(n).addClass(r)}}},setDefaults:function(t){e.extend(e.validator.defaults,t)},messages:{required:"Please select one of the options.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:e.validator.format("Please enter no more than {0} characters."),minlength:e.validator.format("Please enter at least {0} characters."),rangelength:e.validator.format("Please enter a value between {0} and {1} characters long."),range:e.validator.format("Please enter a value between {0} and {1}."),max:e.validator.format("Please enter a value less than or equal to {0}."),min:e.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function t(t){var n=e.data(this[0].form,"validator"),r="on"+t.type.replace(/^validate/,"");if(n.settings[r]){n.settings[r].call(n,this[0],t)}}this.labelContainer=e(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||e(this.currentForm);this.containers=e(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var n=this.groups={};e.each(this.settings.groups,function(t,r){if(typeof r==="string"){r=r.split(/\s/)}e.each(r,function(e,r){n[r]=t})});var r=this.settings.rules;e.each(r,function(t,n){r[t]=e.validator.normalizeRule(n)});e(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, "+"[type='number'], [type='search'] ,[type='tel'], [type='url'], "+"[type='email'], [type='datetime'], [type='date'], [type='month'], "+"[type='week'], [type='time'], [type='datetime-local'], "+"[type='range'], [type='color'] ","focusin focusout keyup",t).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",t);if(this.settings.invalidHandler){e(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();e.extend(this.submitted,this.errorMap);this.invalid=e.extend({},this.errorMap);if(!this.valid()){e(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var e=0,t=this.currentElements=this.elements();t[e];e++){this.check(t[e])}return this.valid()},element:function(t){t=this.validationTargetFor(this.clean(t));this.lastElement=t;this.prepareElement(t);this.currentElements=e(t);var n=this.check(t)!==false;if(n){delete this.invalid[t.name]}else{this.invalid[t.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return n},showErrors:function(t){if(t){e.extend(this.errorMap,t);this.errorList=[];for(var n in t){this.errorList.push({message:t[n],element:this.findByName(n)[0]})}this.successList=e.grep(this.successList,function(e){return!(e.name in t)})}if(this.settings.showErrors){this.settings.showErrors.call(this,this.errorMap,this.errorList)}else{this.defaultShowErrors()}},resetForm:function(){if(e.fn.resetForm){e(this.currentForm).resetForm()}this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var t=0;for(var n in e){t++}return t},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()===0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{e(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}}},findLastActive:function(){var t=this.lastActive;return t&&e.grep(this.errorList,function(e){return e.element.name===t.name}).length===1&&t},elements:function(){var t=this,n={};return e(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){if(!this.name&&t.settings.debug&&window.console){console.error("%o has no name assigned",this)}if(this.name in n||!t.objectLength(e(this).rules())){return false}n[this.name]=true;return true})},clean:function(t){return e(t)[0]},errors:function(){var t=this.settings.errorClass.replace(" ",".");return e(this.settings.errorElement+"."+t,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=e([]);this.toHide=e([]);this.currentElements=e([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(e){this.reset();this.toHide=this.errorsFor(e)},elementValue:function(t){var n=e(t).attr("type"),r=e(t).val();if(n==="radio"||n==="checkbox"){return e("input[name='"+e(t).attr("name")+"']:checked").val()}if(typeof r==="string"){return r.replace(/\r/g,"")}return r},check:function(t){t=this.validationTargetFor(this.clean(t));var n=e(t).rules();var r=false;var i=this.elementValue(t);var s;for(var o in n){var u={method:o,parameters:n[o]};try{s=e.validator.methods[o].call(this,i,t,u.parameters);if(s==="dependency-mismatch"){r=true;continue}r=false;if(s==="pending"){this.toHide=this.toHide.not(this.errorsFor(t));return}if(!s){this.formatAndAdd(t,u);return false}}catch(a){if(this.settings.debug&&window.console){console.log("Exception occurred when checking element "+t.id+", check the '"+u.method+"' method.",a)}throw a}}if(r){return}if(this.objectLength(n)){this.successList.push(t)}return true},customDataMessage:function(t,n){return e(t).data("msg-"+n.toLowerCase())||t.attributes&&e(t).attr("data-msg-"+n.toLowerCase())},customMessage:function(e,t){var n=this.settings.messages[e];return n&&(n.constructor===String?n:n[t])},findDefined:function(){for(var e=0;eWarning: No message defined for "+t.name+"")},formatAndAdd:function(t,n){var r=this.defaultMessage(t,n.method),i=/\$?\{(\d+)\}/g;if(typeof r==="function"){r=r.call(this,n.parameters,t)}else if(i.test(r)){r=e.validator.format(r.replace(i,"{$1}"),n.parameters)}this.errorList.push({message:r,element:t});this.errorMap[t.name]=r;this.submitted[t.name]=r},addWrapper:function(e){if(this.settings.wrapper){e=e.add(e.parent(this.settings.wrapper))}return e},defaultShowErrors:function(){var e,t;for(e=0;this.errorList[e];e++){var n=this.errorList[e];if(this.settings.highlight){this.settings.highlight.call(this,n.element,this.settings.errorClass,this.settings.validClass)}this.showLabel(n.element,n.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(e=0;this.successList[e];e++){this.showLabel(this.successList[e])}}if(this.settings.unhighlight){for(e=0,t=this.validElements();t[e];e++){this.settings.unhighlight.call(this,t[e],this.settings.errorClass,this.settings.validClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return e(this.errorList).map(function(){return this.element})},showLabel:function(t,n){var r=this.errorsFor(t);if(r.length){r.removeClass(this.settings.validClass).addClass(this.settings.errorClass);r.html(n)}else{if(this.settings.wrapper){r=r.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(r).length){if(this.settings.errorPlacement){this.settings.errorPlacement(r,e(t))}else{r.insertAfter(t)}}}if(!n&&this.settings.success){r.text("");if(typeof this.settings.success==="string"){r.addClass(this.settings.success)}else{this.settings.success(r,t)}}this.toShow=this.toShow.add(r)},errorsFor:function(t){var n=this.idOrName(t);return this.errors().filter(function(){return e(this).attr("for")===n})},idOrName:function(e){return this.groups[e.name]||(this.checkable(e)?e.name:e.id||e.name)},validationTargetFor:function(e){if(this.checkable(e)){e=this.findByName(e.name).not(this.settings.ignore)[0]}return e},checkable:function(e){return/radio|checkbox/i.test(e.type)},findByName:function(t){return e(this.currentForm).find("[name='"+t+"']")},getLength:function(t,n){switch(n.nodeName.toLowerCase()){case"select":return e("option:selected",n).length;case"input":if(this.checkable(n)){return this.findByName(n.name).filter(":checked").length}}return t.length},depend:function(e,t){return this.dependTypes[typeof e]?this.dependTypes[typeof e](e,t):true},dependTypes:{"boolean":function(e,t){return e},string:function(t,n){return!!e(t,n.form).length},"function":function(e,t){return e(t)}},optional:function(t){var n=this.elementValue(t);return!e.validator.methods.required.call(this,n,t)&&"dependency-mismatch"},startRequest:function(e){if(!this.pending[e.name]){this.pendingRequest++;this.pending[e.name]=true}},stopRequest:function(t,n){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[t.name];if(n&&this.pendingRequest===0&&this.formSubmitted&&this.form()){e(this.currentForm).submit();this.formSubmitted=false}else if(!n&&this.pendingRequest===0&&this.formSubmitted){e(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false}},previousValue:function(t){return e.data(t,"previousValue")||e.data(t,"previousValue",{old:null,valid:true,message:this.defaultMessage(t,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},number:{number:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(t,n){if(t.constructor===String){this.classRuleSettings[t]=n}else{e.extend(this.classRuleSettings,t)}},classRules:function(t){var n={};var r=e(t).attr("class");if(r){e.each(r.split(" "),function(){if(this in e.validator.classRuleSettings){e.extend(n,e.validator.classRuleSettings[this])}})}return n},attributeRules:function(t){var n={};var r=e(t);var i=r[0].getAttribute("type");for(var s in e.validator.methods){var o;if(s==="required"){o=r.get(0).getAttribute(s);if(o===""){o=true}o=!!o}else{o=r.attr(s)}if(/min|max/.test(s)&&(i===null||/number|range|text/.test(i))){o=Number(o)}if(o){n[s]=o}else if(i===s&&i!=="range"){n[s]=true}}if(n.maxlength&&/-1|2147483647|524288/.test(n.maxlength)){delete n.maxlength}return n},dataRules:function(t){var n,r,i={},s=e(t);for(n in e.validator.methods){r=s.data("rule-"+n.toLowerCase());if(r!==undefined){i[n]=r}}return i},staticRules:function(t){var n={};var r=e.data(t.form,"validator");if(r.settings.rules){n=e.validator.normalizeRule(r.settings.rules[t.name])||{}}return n},normalizeRules:function(t,n){e.each(t,function(r,i){if(i===false){delete t[r];return}if(i.param||i.depends){var s=true;switch(typeof i.depends){case"string":s=!!e(i.depends,n.form).length;break;case"function":s=i.depends.call(n,n);break}if(s){t[r]=i.param!==undefined?i.param:true}else{delete t[r]}}});e.each(t,function(r,i){t[r]=e.isFunction(i)?i(n):i});e.each(["minlength","maxlength"],function(){if(t[this]){t[this]=Number(t[this])}});e.each(["rangelength","range"],function(){var n;if(t[this]){if(e.isArray(t[this])){t[this]=[Number(t[this][0]),Number(t[this][1])]}else if(typeof t[this]==="string"){n=t[this].split(/[\s,]+/);t[this]=[Number(n[0]),Number(n[1])]}}});if(e.validator.autoCreateRanges){if(t.min&&t.max){t.range=[t.min,t.max];delete t.min;delete t.max}if(t.minlength&&t.maxlength){t.rangelength=[t.minlength,t.maxlength];delete t.minlength;delete t.maxlength}}return t},normalizeRule:function(t){if(typeof t==="string"){var n={};e.each(t.split(/\s/),function(){n[this]=true});t=n}return t},addMethod:function(t,n,r){e.validator.methods[t]=n;e.validator.messages[t]=r!==undefined?r:e.validator.messages[t];if(n.length<3){e.validator.addClassRules(t,e.validator.normalizeRule(t))}},methods:{required:function(t,n,r){if(!this.depend(r,n)){return"dependency-mismatch"}if(n.nodeName.toLowerCase()==="select"){var i=e(n).val();return i&&i.length>0}if(this.checkable(n)){return this.getLength(t,n)>0}return e.trim(t).length>0},email:function(e,t){return this.optional(t)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(e)},url:function(e,t){return this.optional(t)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)},date:function(e,t){return this.optional(t)||!/Invalid|NaN/.test((new Date(e)).toString())},dateISO:function(e,t){return this.optional(t)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(e)},number:function(e,t){return this.optional(t)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e)},digits:function(e,t){return this.optional(t)||/^\d+$/.test(e)},creditcard:function(e,t){if(this.optional(t)){return"dependency-mismatch"}if(/[^0-9 \-]+/.test(e)){return false}var n=0,r=0,i=false;e=e.replace(/\D/g,"");for(var s=e.length-1;s>=0;s--){var o=e.charAt(s);r=parseInt(o,10);if(i){if((r*=2)>9){r-=9}}n+=r;i=!i}return n%10===0},minlength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i>=r},maxlength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i<=r},rangelength:function(t,n,r){var i=e.isArray(t)?t.length:this.getLength(e.trim(t),n);return this.optional(n)||i>=r[0]&&i<=r[1]},min:function(e,t,n){return this.optional(t)||e>=n},max:function(e,t,n){return this.optional(t)||e<=n},range:function(e,t,n){return this.optional(t)||e>=n[0]&&e<=n[1]},equalTo:function(t,n,r){var i=e(r);if(this.settings.onfocusout){i.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){e(n).valid()})}return t===i.val()},remote:function(t,n,r){if(this.optional(n)){return"dependency-mismatch"}var i=this.previousValue(n);if(!this.settings.messages[n.name]){this.settings.messages[n.name]={}}i.originalMessage=this.settings.messages[n.name].remote;this.settings.messages[n.name].remote=i.message;r=typeof r==="string"&&{url:r}||r;if(i.old===t){return i.valid}i.old=t;var s=this;this.startRequest(n);var o={};o[n.name]=t;e.ajax(e.extend(true,{url:r,mode:"abort",port:"validate"+n.name,dataType:"json",data:o,success:function(r){s.settings.messages[n.name].remote=i.originalMessage;var o=r===true||r==="true";if(o){var u=s.formSubmitted;s.prepareElement(n);s.formSubmitted=u;s.successList.push(n);delete s.invalid[n.name];s.showErrors()}else{var a={};var f=r||s.defaultMessage(n,"remote");a[n.name]=i.message=e.isFunction(f)?f(t):f;s.invalid[n.name]=true;s.showErrors(a)}i.valid=o;s.stopRequest(n,o)}},r));return"pending"}}});e.format=e.validator.format})(jQuery);(function(e){var t={};if(e.ajaxPrefilter){e.ajaxPrefilter(function(e,n,r){var i=e.port;if(e.mode==="abort"){if(t[i]){t[i].abort()}t[i]=r}})}else{var n=e.ajax;e.ajax=function(r){var i=("mode"in r?r:e.ajaxSettings).mode,s=("port"in r?r:e.ajaxSettings).port;if(i==="abort"){if(t[s]){t[s].abort()}t[s]=n.apply(this,arguments);return t[s]}return n.apply(this,arguments)}}})(jQuery);(function(e){e.extend(e.fn,{validateDelegate:function(t,n,r){return this.bind(n,function(n){var i=e(n.target);if(i.is(t)){return r.apply(i,arguments)}})}})})(jQuery) \ No newline at end of file diff --git a/scripts/moment.min.js b/scripts/moment.min.js new file mode 100644 index 0000000..57cd2d4 --- /dev/null +++ b/scripts/moment.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function f(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(m(e,t))return;return 1}function r(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function a(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){for(var n=[],s=0;s>>0,s=0;sFe(e)?(r=e+1,a-Fe(e)):(r=e,a);return{year:r,dayOfYear:o}}function Ae(e,t,n){var s,i,r=Ge(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+je(i=e.year()-1,t,n):a>je(e.year(),t,n)?(s=a-je(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function je(e,t,n){var s=Ge(e,t,n),i=Ge(e+1,t,n);return(Fe(e)-s+i)/7}C("w",["ww",2],"wo","week"),C("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),A("week",5),A("isoWeek",5),ce("w",te),ce("ww",te,Q),ce("W",te),ce("WW",te,Q),ge(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=Z(e)});function Ie(e,t){return e.slice(t,7).concat(e.slice(0,t))}C("d",0,"do","day"),C("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),C("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),C("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),C("e",0,0,"weekday"),C("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),A("day",11),A("weekday",11),A("isoWeekday",11),ce("d",te),ce("e",te),ce("E",te),ce("dd",function(e,t){return t.weekdaysMinRegex(e)}),ce("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ce("dddd",function(e,t){return t.weekdaysRegex(e)}),ge(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:y(n).invalidWeekday=e}),ge(["d","e","E"],function(e,t,n,s){t[s]=Z(e)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$e="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),qe=de,Be=de,Je=de;function Qe(){function e(e,t){return t.length-e.length}for(var t,n,s,i,r=[],a=[],o=[],u=[],l=0;l<7;l++)t=_([2e3,1]).day(l),n=me(this.weekdaysMin(t,"")),s=me(this.weekdaysShort(t,"")),i=me(this.weekdays(t,"")),r.push(n),a.push(s),o.push(i),u.push(n),u.push(s),u.push(i);r.sort(e),a.sort(e),o.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Ke(e,t){C(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}C("H",["HH",2],0,"hour"),C("h",["hh",2],0,Xe),C("k",["kk",2],0,function(){return this.hours()||24}),C("hmm",0,0,function(){return""+Xe.apply(this)+T(this.minutes(),2)}),C("hmmss",0,0,function(){return""+Xe.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),C("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),C("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),L("hour","h"),A("hour",13),ce("a",et),ce("A",et),ce("H",te),ce("h",te),ce("k",te),ce("HH",te,Q),ce("hh",te,Q),ce("kk",te,Q),ce("hmm",ne),ce("hmmss",se),ce("Hmm",ne),ce("Hmmss",se),ye(["H","HH"],Me),ye(["k","kk"],function(e,t,n){var s=Z(e);t[Me]=24===s?0:s}),ye(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ye(["h","hh"],function(e,t,n){t[Me]=Z(e),y(n).bigHour=!0}),ye("hmm",function(e,t,n){var s=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s)),y(n).bigHour=!0}),ye("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s,2)),t[Se]=Z(e.substr(i)),y(n).bigHour=!0}),ye("Hmm",function(e,t,n){var s=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s))}),ye("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Me]=Z(e.substr(0,s)),t[De]=Z(e.substr(s,2)),t[Se]=Z(e.substr(i))});var tt=z("Hours",!0);var nt,st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Te,monthsShort:Ne,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:$e,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},it={},rt={};function at(e){return e?e.toLowerCase().replace("_","-"):e}function ot(e){for(var t,n,s,i,r=0;r=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s=t-1)break;t--}r++}return nt}function ut(t){var e;if(void 0===it[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=nt._abbr,require("./locale/"+t),lt(e)}catch(e){it[t]=null}return it[t]}function lt(e,t){var n;return e&&((n=r(t)?dt(e):ht(e,t))?nt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),nt._abbr}function ht(e,t){if(null===t)return delete it[e],null;var n,s=st;if(t.abbr=e,null!=it[e])Y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=it[e]._config;else if(null!=t.parentLocale)if(null!=it[t.parentLocale])s=it[t.parentLocale]._config;else{if(null==(n=ut(t.parentLocale)))return rt[t.parentLocale]||(rt[t.parentLocale]=[]),rt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return it[e]=new x(b(s,t)),rt[e]&&rt[e].forEach(function(e){ht(e.name,e.config)}),lt(e),it[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return nt;if(!o(e)){if(t=ut(e))return t;e=[e]}return ot(e)}function ct(e){var t,n=e._a;return n&&-2===y(e).overflow&&(t=n[ve]<0||11xe(n[pe],n[ve])?ke:n[Me]<0||24je(n,r,a)?y(e)._overflowWeeks=!0:null!=u?y(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[pe]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=St(e._a[pe],s[pe]),(e._dayOfYear>Fe(r)||0===e._dayOfYear)&&(y(e)._overflowDayOfYear=!0),n=Ve(r,0,e._dayOfYear),e._a[ve]=n.getUTCMonth(),e._a[ke]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=u[t]=s[t];for(;t<7;t++)e._a[t]=u[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Me]&&0===e._a[De]&&0===e._a[Se]&&0===e._a[Ye]&&(e._nextDay=!0,e._a[Me]=0),e._d=(e._useUTC?Ve:function(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,u),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Me]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(y(e).weekdayMismatch=!0)}}function Ot(e){if(e._f!==f.ISO_8601)if(e._f!==f.RFC_2822){e._a=[],y(e).empty=!0;for(var t,n,s,i,r,a,o,u=""+e._i,l=u.length,h=0,d=H(e._f,e._locale).match(N)||[],c=0;cn.valueOf():n.valueOf()"}),pn.toJSON=function(){return this.isValid()?this.toISOString():null},pn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},pn.unix=function(){return Math.floor(this.valueOf()/1e3)},pn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},pn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},pn.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},pn.isLocal=function(){return!!this.isValid()&&!this._isUTC},pn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},pn.isUtc=At,pn.isUTC=At,pn.zoneAbbr=function(){return this._isUTC?"UTC":""},pn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},pn.dates=n("dates accessor is deprecated. Use date instead.",fn),pn.months=n("months accessor is deprecated. Use month instead",Ue),pn.years=n("years accessor is deprecated. Use year instead",Le),pn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),pn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e,t={};return v(t,this),(t=bt(t))._a?(e=(t._isUTC?_:Tt)(t._a),this._isDSTShifted=this.isValid()&&0 0) { + name.splice(i - 1, 2); + i -= 2; + } + } + } + //end trimDots + + name = name.join("/"); + } else if (name.indexOf('./') === 0) { + // No baseName, so this is ID is resolved relative + // to baseUrl, pull off the leading dot. + name = name.substring(2); + } + } + + //Apply map config if available. + if ((baseParts || starMap) && map) { + nameParts = name.split('/'); + + for (i = nameParts.length; i > 0; i -= 1) { + nameSegment = nameParts.slice(0, i).join("/"); + + if (baseParts) { + //Find the longest baseName segment match in the config. + //So, do joins on the biggest to smallest lengths of baseParts. + for (j = baseParts.length; j > 0; j -= 1) { + mapValue = map[baseParts.slice(0, j).join('/')]; + + //baseName segment has config, find if it has one for + //this name. + if (mapValue) { + mapValue = mapValue[nameSegment]; + if (mapValue) { + //Match, update name to the new value. + foundMap = mapValue; + foundI = i; + break; + } + } + } + } + + if (foundMap) { + break; + } + + //Check for a star map match, but just hold on to it, + //if there is a shorter segment match later in a matching + //config, then favor over this star map. + if (!foundStarMap && starMap && starMap[nameSegment]) { + foundStarMap = starMap[nameSegment]; + starI = i; + } + } + + if (!foundMap && foundStarMap) { + foundMap = foundStarMap; + foundI = starI; + } + + if (foundMap) { + nameParts.splice(0, foundI, foundMap); + name = nameParts.join('/'); + } + } + + return name; + } + + function makeRequire(relName, forceSync) { + return function () { + //A version of a require function that passes a moduleName + //value for items that may need to + //look up paths relative to the moduleName + var args = aps.call(arguments, 0); + + //If first arg is not require('string'), and there is only + //one arg, it is the array form without a callback. Insert + //a null so that the following concat is correct. + if (typeof args[0] !== 'string' && args.length === 1) { + args.push(null); + } + return req.apply(undef, args.concat([relName, forceSync])); + }; + } + + function makeNormalize(relName) { + return function (name) { + return normalize(name, relName); + }; + } + + function makeLoad(depName) { + return function (value) { + defined[depName] = value; + }; + } + + function callDep(name) { + if (hasProp(waiting, name)) { + var args = waiting[name]; + delete waiting[name]; + defining[name] = true; + main.apply(undef, args); + } + + if (!hasProp(defined, name) && !hasProp(defining, name)) { + throw new Error('No ' + name); + } + return defined[name]; + } + + //Turns a plugin!resource to [plugin, resource] + //with the plugin being undefined if the name + //did not have a plugin prefix. + function splitPrefix(name) { + var prefix, + index = name ? name.indexOf('!') : -1; + if (index > -1) { + prefix = name.substring(0, index); + name = name.substring(index + 1, name.length); + } + return [prefix, name]; + } + + /** + * Makes a name map, normalizing the name, and using a plugin + * for normalization if necessary. Grabs a ref to plugin + * too, as an optimization. + */ + makeMap = function (name, relName) { + var plugin, + parts = splitPrefix(name), + prefix = parts[0]; + + name = parts[1]; + + if (prefix) { + prefix = normalize(prefix, relName); + plugin = callDep(prefix); + } + + //Normalize according + if (prefix) { + if (plugin && plugin.normalize) { + name = plugin.normalize(name, makeNormalize(relName)); + } else { + name = normalize(name, relName); + } + } else { + name = normalize(name, relName); + parts = splitPrefix(name); + prefix = parts[0]; + name = parts[1]; + if (prefix) { + plugin = callDep(prefix); + } + } + + //Using ridiculous property names for space reasons + return { + f: prefix ? prefix + '!' + name : name, //fullName + n: name, + pr: prefix, + p: plugin + }; + }; + + function makeConfig(name) { + return function () { + return (config && config.config && config.config[name]) || {}; + }; + } + + handlers = { + require: function (name) { + return makeRequire(name); + }, + exports: function (name) { + var e = defined[name]; + if (typeof e !== 'undefined') { + return e; + } else { + return (defined[name] = {}); + } + }, + module: function (name) { + return { + id: name, + uri: '', + exports: defined[name], + config: makeConfig(name) + }; + } + }; + + main = function (name, deps, callback, relName) { + var cjsModule, depName, ret, map, i, + args = [], + callbackType = typeof callback, + usingExports; + + //Use name if no relName + relName = relName || name; + + //Call the callback to define the module, if necessary. + if (callbackType === 'undefined' || callbackType === 'function') { + //Pull out the defined dependencies and pass the ordered + //values to the callback. + //Default to [require, exports, module] if no deps + deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; + for (i = 0; i < deps.length; i += 1) { + map = makeMap(deps[i], relName); + depName = map.f; + + //Fast path CommonJS standard dependencies. + if (depName === "require") { + args[i] = handlers.require(name); + } else if (depName === "exports") { + //CommonJS module spec 1.1 + args[i] = handlers.exports(name); + usingExports = true; + } else if (depName === "module") { + //CommonJS module spec 1.1 + cjsModule = args[i] = handlers.module(name); + } else if (hasProp(defined, depName) || + hasProp(waiting, depName) || + hasProp(defining, depName)) { + args[i] = callDep(depName); + } else if (map.p) { + map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); + args[i] = defined[depName]; + } else { + throw new Error(name + ' missing ' + depName); + } + } + + ret = callback ? callback.apply(defined[name], args) : undefined; + + if (name) { + //If setting exports via "module" is in play, + //favor that over return value and exports. After that, + //favor a non-undefined return value over exports use. + if (cjsModule && cjsModule.exports !== undef && + cjsModule.exports !== defined[name]) { + defined[name] = cjsModule.exports; + } else if (ret !== undef || !usingExports) { + //Use the return value from the function. + defined[name] = ret; + } + } + } else if (name) { + //May just be an object definition for the module. Only + //worry about defining if have a module name. + defined[name] = callback; + } + }; + + requirejs = require = req = function (deps, callback, relName, forceSync, alt) { + if (typeof deps === "string") { + if (handlers[deps]) { + //callback in this case is really relName + return handlers[deps](callback); + } + //Just return the module wanted. In this scenario, the + //deps arg is the module name, and second arg (if passed) + //is just the relName. + //Normalize module name, if it contains . or .. + return callDep(makeMap(deps, callback).f); + } else if (!deps.splice) { + //deps is a config object, not an array. + config = deps; + if (config.deps) { + req(config.deps, config.callback); + } + if (!callback) { + return; + } + + if (callback.splice) { + //callback is an array, which means it is a dependency list. + //Adjust args if there are dependencies + deps = callback; + callback = relName; + relName = null; + } else { + deps = undef; + } + } + + //Support require(['a']) + callback = callback || function () {}; + + //If relName is a function, it is an errback handler, + //so remove it. + if (typeof relName === 'function') { + relName = forceSync; + forceSync = alt; + } + + //Simulate async callback; + if (forceSync) { + main(undef, deps, callback, relName); + } else { + //Using a non-zero value because of concern for what old browsers + //do, and latest browsers "upgrade" to 4 if lower value is used: + //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout: + //If want a value immediately, use require('id') instead -- something + //that works in almond on the global level, but not guaranteed and + //unlikely to work in other AMD implementations. + setTimeout(function () { + main(undef, deps, callback, relName); + }, 4); + } + + return req; + }; + + /** + * Just drops the config on the floor, but returns req in case + * the config return value is used. + */ + req.config = function (cfg) { + return req(cfg); + }; + + /** + * Expose module registry for debugging and tooling + */ + requirejs._defined = defined; + + define = function (name, deps, callback) { + if (typeof name !== 'string') { + throw new Error('See almond README: incorrect module build, no module name'); + } + + //This module may not have dependencies + if (!deps.splice) { + //deps is not an array, so probably means + //an object literal or factory function for + //the value. Adjust args. + callback = deps; + deps = []; + } + + if (!hasProp(defined, name) && !hasProp(waiting, name)) { + waiting[name] = [name, deps, callback]; + } + }; + + define.amd = { + jQuery: true + }; +}()); + +S2.requirejs = requirejs;S2.require = require;S2.define = define; +} +}()); +S2.define("almond", function(){}); + +/* global jQuery:false, $:false */ +S2.define('jquery',[],function () { + var _$ = jQuery || $; + + if (_$ == null && console && console.error) { + console.error( + 'Select2: An instance of jQuery or a jQuery-compatible library was not ' + + 'found. Make sure that you are including jQuery before Select2 on your ' + + 'web page.' + ); + } + + return _$; +}); + +S2.define('select2/utils',[ + 'jquery' +], function ($) { + var Utils = {}; + + Utils.Extend = function (ChildClass, SuperClass) { + var __hasProp = {}.hasOwnProperty; + + function BaseConstructor () { + this.constructor = ChildClass; + } + + for (var key in SuperClass) { + if (__hasProp.call(SuperClass, key)) { + ChildClass[key] = SuperClass[key]; + } + } + + BaseConstructor.prototype = SuperClass.prototype; + ChildClass.prototype = new BaseConstructor(); + ChildClass.__super__ = SuperClass.prototype; + + return ChildClass; + }; + + function getMethods (theClass) { + var proto = theClass.prototype; + + var methods = []; + + for (var methodName in proto) { + var m = proto[methodName]; + + if (typeof m !== 'function') { + continue; + } + + if (methodName === 'constructor') { + continue; + } + + methods.push(methodName); + } + + return methods; + } + + Utils.Decorate = function (SuperClass, DecoratorClass) { + var decoratedMethods = getMethods(DecoratorClass); + var superMethods = getMethods(SuperClass); + + function DecoratedClass () { + var unshift = Array.prototype.unshift; + + var argCount = DecoratorClass.prototype.constructor.length; + + var calledConstructor = SuperClass.prototype.constructor; + + if (argCount > 0) { + unshift.call(arguments, SuperClass.prototype.constructor); + + calledConstructor = DecoratorClass.prototype.constructor; + } + + calledConstructor.apply(this, arguments); + } + + DecoratorClass.displayName = SuperClass.displayName; + + function ctr () { + this.constructor = DecoratedClass; + } + + DecoratedClass.prototype = new ctr(); + + for (var m = 0; m < superMethods.length; m++) { + var superMethod = superMethods[m]; + + DecoratedClass.prototype[superMethod] = + SuperClass.prototype[superMethod]; + } + + var calledMethod = function (methodName) { + // Stub out the original method if it's not decorating an actual method + var originalMethod = function () {}; + + if (methodName in DecoratedClass.prototype) { + originalMethod = DecoratedClass.prototype[methodName]; + } + + var decoratedMethod = DecoratorClass.prototype[methodName]; + + return function () { + var unshift = Array.prototype.unshift; + + unshift.call(arguments, originalMethod); + + return decoratedMethod.apply(this, arguments); + }; + }; + + for (var d = 0; d < decoratedMethods.length; d++) { + var decoratedMethod = decoratedMethods[d]; + + DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod); + } + + return DecoratedClass; + }; + + var Observable = function () { + this.listeners = {}; + }; + + Observable.prototype.on = function (event, callback) { + this.listeners = this.listeners || {}; + + if (event in this.listeners) { + this.listeners[event].push(callback); + } else { + this.listeners[event] = [callback]; + } + }; + + Observable.prototype.trigger = function (event) { + var slice = Array.prototype.slice; + var params = slice.call(arguments, 1); + + this.listeners = this.listeners || {}; + + // Params should always come in as an array + if (params == null) { + params = []; + } + + // If there are no arguments to the event, use a temporary object + if (params.length === 0) { + params.push({}); + } + + // Set the `_type` of the first object to the event + params[0]._type = event; + + if (event in this.listeners) { + this.invoke(this.listeners[event], slice.call(arguments, 1)); + } + + if ('*' in this.listeners) { + this.invoke(this.listeners['*'], arguments); + } + }; + + Observable.prototype.invoke = function (listeners, params) { + for (var i = 0, len = listeners.length; i < len; i++) { + listeners[i].apply(this, params); + } + }; + + Utils.Observable = Observable; + + Utils.generateChars = function (length) { + var chars = ''; + + for (var i = 0; i < length; i++) { + var randomChar = Math.floor(Math.random() * 36); + chars += randomChar.toString(36); + } + + return chars; + }; + + Utils.bind = function (func, context) { + return function () { + func.apply(context, arguments); + }; + }; + + Utils._convertData = function (data) { + for (var originalKey in data) { + var keys = originalKey.split('-'); + + var dataLevel = data; + + if (keys.length === 1) { + continue; + } + + for (var k = 0; k < keys.length; k++) { + var key = keys[k]; + + // Lowercase the first letter + // By default, dash-separated becomes camelCase + key = key.substring(0, 1).toLowerCase() + key.substring(1); + + if (!(key in dataLevel)) { + dataLevel[key] = {}; + } + + if (k == keys.length - 1) { + dataLevel[key] = data[originalKey]; + } + + dataLevel = dataLevel[key]; + } + + delete data[originalKey]; + } + + return data; + }; + + Utils.hasScroll = function (index, el) { + // Adapted from the function created by @ShadowScripter + // and adapted by @BillBarry on the Stack Exchange Code Review website. + // The original code can be found at + // http://codereview.stackexchange.com/q/13338 + // and was designed to be used with the Sizzle selector engine. + + var $el = $(el); + var overflowX = el.style.overflowX; + var overflowY = el.style.overflowY; + + //Check both x and y declarations + if (overflowX === overflowY && + (overflowY === 'hidden' || overflowY === 'visible')) { + return false; + } + + if (overflowX === 'scroll' || overflowY === 'scroll') { + return true; + } + + return ($el.innerHeight() < el.scrollHeight || + $el.innerWidth() < el.scrollWidth); + }; + + Utils.escapeMarkup = function (markup) { + var replaceMap = { + '\\': '\', + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''', + '/': '/' + }; + + // Do not try to escape the markup if it's not a string + if (typeof markup !== 'string') { + return markup; + } + + return String(markup).replace(/[&<>"'\/\\]/g, function (match) { + return replaceMap[match]; + }); + }; + + // Append an array of jQuery nodes to a given element. + Utils.appendMany = function ($element, $nodes) { + // jQuery 1.7.x does not support $.fn.append() with an array + // Fall back to a jQuery object collection using $.fn.add() + if ($.fn.jquery.substr(0, 3) === '1.7') { + var $jqNodes = $(); + + $.map($nodes, function (node) { + $jqNodes = $jqNodes.add(node); + }); + + $nodes = $jqNodes; + } + + $element.append($nodes); + }; + + return Utils; +}); + +S2.define('select2/results',[ + 'jquery', + './utils' +], function ($, Utils) { + function Results ($element, options, dataAdapter) { + this.$element = $element; + this.data = dataAdapter; + this.options = options; + + Results.__super__.constructor.call(this); + } + + Utils.Extend(Results, Utils.Observable); + + Results.prototype.render = function () { + var $results = $( + '
          ' + ); + + if (this.options.get('multiple')) { + $results.attr('aria-multiselectable', 'true'); + } + + this.$results = $results; + + return $results; + }; + + Results.prototype.clear = function () { + this.$results.empty(); + }; + + Results.prototype.displayMessage = function (params) { + var escapeMarkup = this.options.get('escapeMarkup'); + + this.clear(); + this.hideLoading(); + + var $message = $( + '
        • ' + ); + + var message = this.options.get('translations').get(params.message); + + $message.append( + escapeMarkup( + message(params.args) + ) + ); + + $message[0].className += ' select2-results__message'; + + this.$results.append($message); + }; + + Results.prototype.hideMessages = function () { + this.$results.find('.select2-results__message').remove(); + }; + + Results.prototype.append = function (data) { + this.hideLoading(); + + var $options = []; + + if (data.results == null || data.results.length === 0) { + if (this.$results.children().length === 0) { + this.trigger('results:message', { + message: 'noResults' + }); + } + + return; + } + + data.results = this.sort(data.results); + + for (var d = 0; d < data.results.length; d++) { + var item = data.results[d]; + + var $option = this.option(item); + + $options.push($option); + } + + this.$results.append($options); + }; + + Results.prototype.position = function ($results, $dropdown) { + var $resultsContainer = $dropdown.find('.select2-results'); + $resultsContainer.append($results); + }; + + Results.prototype.sort = function (data) { + var sorter = this.options.get('sorter'); + + return sorter(data); + }; + + Results.prototype.highlightFirstItem = function () { + var $options = this.$results + .find('.select2-results__option[aria-selected]'); + + var $selected = $options.filter('[aria-selected=true]'); + + // Check if there are any selected options + if ($selected.length > 0) { + // If there are selected options, highlight the first + $selected.first().trigger('mouseenter'); + } else { + // If there are no selected options, highlight the first option + // in the dropdown + $options.first().trigger('mouseenter'); + } + + this.ensureHighlightVisible(); + }; + + Results.prototype.setClasses = function () { + var self = this; + + this.data.current(function (selected) { + var selectedIds = $.map(selected, function (s) { + return s.id.toString(); + }); + + var $options = self.$results + .find('.select2-results__option[aria-selected]'); + + $options.each(function () { + var $option = $(this); + + var item = $.data(this, 'data'); + + // id needs to be converted to a string when comparing + var id = '' + item.id; + + if ((item.element != null && item.element.selected) || + (item.element == null && $.inArray(id, selectedIds) > -1)) { + $option.attr('aria-selected', 'true'); + } else { + $option.attr('aria-selected', 'false'); + } + }); + + }); + }; + + Results.prototype.showLoading = function (params) { + this.hideLoading(); + + var loadingMore = this.options.get('translations').get('searching'); + + var loading = { + disabled: true, + loading: true, + text: loadingMore(params) + }; + var $loading = this.option(loading); + $loading.className += ' loading-results'; + + this.$results.prepend($loading); + }; + + Results.prototype.hideLoading = function () { + this.$results.find('.loading-results').remove(); + }; + + Results.prototype.option = function (data) { + var option = document.createElement('li'); + option.className = 'select2-results__option'; + + var attrs = { + 'role': 'treeitem', + 'aria-selected': 'false' + }; + + if (data.disabled) { + delete attrs['aria-selected']; + attrs['aria-disabled'] = 'true'; + } + + if (data.id == null) { + delete attrs['aria-selected']; + } + + if (data._resultId != null) { + option.id = data._resultId; + } + + if (data.title) { + option.title = data.title; + } + + if (data.children) { + attrs.role = 'group'; + attrs['aria-label'] = data.text; + delete attrs['aria-selected']; + } + + for (var attr in attrs) { + var val = attrs[attr]; + + option.setAttribute(attr, val); + } + + if (data.children) { + var $option = $(option); + + var label = document.createElement('strong'); + label.className = 'select2-results__group'; + + var $label = $(label); + this.template(data, label); + + var $children = []; + + for (var c = 0; c < data.children.length; c++) { + var child = data.children[c]; + + var $child = this.option(child); + + $children.push($child); + } + + var $childrenContainer = $('
            ', { + 'class': 'select2-results__options select2-results__options--nested' + }); + + $childrenContainer.append($children); + + $option.append(label); + $option.append($childrenContainer); + } else { + this.template(data, option); + } + + $.data(option, 'data', data); + + return option; + }; + + Results.prototype.bind = function (container, $container) { + var self = this; + + var id = container.id + '-results'; + + this.$results.attr('id', id); + + container.on('results:all', function (params) { + self.clear(); + self.append(params.data); + + if (container.isOpen()) { + self.setClasses(); + self.highlightFirstItem(); + } + }); + + container.on('results:append', function (params) { + self.append(params.data); + + if (container.isOpen()) { + self.setClasses(); + } + }); + + container.on('query', function (params) { + self.hideMessages(); + self.showLoading(params); + }); + + container.on('select', function () { + if (!container.isOpen()) { + return; + } + + self.setClasses(); + self.highlightFirstItem(); + }); + + container.on('unselect', function () { + if (!container.isOpen()) { + return; + } + + self.setClasses(); + self.highlightFirstItem(); + }); + + container.on('open', function () { + // When the dropdown is open, aria-expended="true" + self.$results.attr('aria-expanded', 'true'); + self.$results.attr('aria-hidden', 'false'); + + self.setClasses(); + self.ensureHighlightVisible(); + }); + + container.on('close', function () { + // When the dropdown is closed, aria-expended="false" + self.$results.attr('aria-expanded', 'false'); + self.$results.attr('aria-hidden', 'true'); + self.$results.removeAttr('aria-activedescendant'); + }); + + container.on('results:toggle', function () { + var $highlighted = self.getHighlightedResults(); + + if ($highlighted.length === 0) { + return; + } + + $highlighted.trigger('mouseup'); + }); + + container.on('results:select', function () { + var $highlighted = self.getHighlightedResults(); + + if ($highlighted.length === 0) { + return; + } + + var data = $highlighted.data('data'); + + if ($highlighted.attr('aria-selected') == 'true') { + self.trigger('close', {}); + } else { + self.trigger('select', { + data: data + }); + } + }); + + container.on('results:previous', function () { + var $highlighted = self.getHighlightedResults(); + + var $options = self.$results.find('[aria-selected]'); + + var currentIndex = $options.index($highlighted); + + // If we are already at te top, don't move further + if (currentIndex === 0) { + return; + } + + var nextIndex = currentIndex - 1; + + // If none are highlighted, highlight the first + if ($highlighted.length === 0) { + nextIndex = 0; + } + + var $next = $options.eq(nextIndex); + + $next.trigger('mouseenter'); + + var currentOffset = self.$results.offset().top; + var nextTop = $next.offset().top; + var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset); + + if (nextIndex === 0) { + self.$results.scrollTop(0); + } else if (nextTop - currentOffset < 0) { + self.$results.scrollTop(nextOffset); + } + }); + + container.on('results:next', function () { + var $highlighted = self.getHighlightedResults(); + + var $options = self.$results.find('[aria-selected]'); + + var currentIndex = $options.index($highlighted); + + var nextIndex = currentIndex + 1; + + // If we are at the last option, stay there + if (nextIndex >= $options.length) { + return; + } + + var $next = $options.eq(nextIndex); + + $next.trigger('mouseenter'); + + var currentOffset = self.$results.offset().top + + self.$results.outerHeight(false); + var nextBottom = $next.offset().top + $next.outerHeight(false); + var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset; + + if (nextIndex === 0) { + self.$results.scrollTop(0); + } else if (nextBottom > currentOffset) { + self.$results.scrollTop(nextOffset); + } + }); + + container.on('results:focus', function (params) { + params.element.addClass('select2-results__option--highlighted'); + }); + + container.on('results:message', function (params) { + self.displayMessage(params); + }); + + if ($.fn.mousewheel) { + this.$results.on('mousewheel', function (e) { + var top = self.$results.scrollTop(); + + var bottom = self.$results.get(0).scrollHeight - top + e.deltaY; + + var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0; + var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height(); + + if (isAtTop) { + self.$results.scrollTop(0); + + e.preventDefault(); + e.stopPropagation(); + } else if (isAtBottom) { + self.$results.scrollTop( + self.$results.get(0).scrollHeight - self.$results.height() + ); + + e.preventDefault(); + e.stopPropagation(); + } + }); + } + + this.$results.on('mouseup', '.select2-results__option[aria-selected]', + function (evt) { + var $this = $(this); + + var data = $this.data('data'); + + if ($this.attr('aria-selected') === 'true') { + if (self.options.get('multiple')) { + self.trigger('unselect', { + originalEvent: evt, + data: data + }); + } else { + self.trigger('close', {}); + } + + return; + } + + self.trigger('select', { + originalEvent: evt, + data: data + }); + }); + + this.$results.on('mouseenter', '.select2-results__option[aria-selected]', + function (evt) { + var data = $(this).data('data'); + + self.getHighlightedResults() + .removeClass('select2-results__option--highlighted'); + + self.trigger('results:focus', { + data: data, + element: $(this) + }); + }); + }; + + Results.prototype.getHighlightedResults = function () { + var $highlighted = this.$results + .find('.select2-results__option--highlighted'); + + return $highlighted; + }; + + Results.prototype.destroy = function () { + this.$results.remove(); + }; + + Results.prototype.ensureHighlightVisible = function () { + var $highlighted = this.getHighlightedResults(); + + if ($highlighted.length === 0) { + return; + } + + var $options = this.$results.find('[aria-selected]'); + + var currentIndex = $options.index($highlighted); + + var currentOffset = this.$results.offset().top; + var nextTop = $highlighted.offset().top; + var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset); + + var offsetDelta = nextTop - currentOffset; + nextOffset -= $highlighted.outerHeight(false) * 2; + + if (currentIndex <= 2) { + this.$results.scrollTop(0); + } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) { + this.$results.scrollTop(nextOffset); + } + }; + + Results.prototype.template = function (result, container) { + var template = this.options.get('templateResult'); + var escapeMarkup = this.options.get('escapeMarkup'); + + var content = template(result, container); + + if (content == null) { + container.style.display = 'none'; + } else if (typeof content === 'string') { + container.innerHTML = escapeMarkup(content); + } else { + $(container).append(content); + } + }; + + return Results; +}); + +S2.define('select2/keys',[ + +], function () { + var KEYS = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + SHIFT: 16, + CTRL: 17, + ALT: 18, + ESC: 27, + SPACE: 32, + PAGE_UP: 33, + PAGE_DOWN: 34, + END: 35, + HOME: 36, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 + }; + + return KEYS; +}); + +S2.define('select2/selection/base',[ + 'jquery', + '../utils', + '../keys' +], function ($, Utils, KEYS) { + function BaseSelection ($element, options) { + this.$element = $element; + this.options = options; + + BaseSelection.__super__.constructor.call(this); + } + + Utils.Extend(BaseSelection, Utils.Observable); + + BaseSelection.prototype.render = function () { + var $selection = $( + '' + ); + + this._tabindex = 0; + + if (this.$element.data('old-tabindex') != null) { + this._tabindex = this.$element.data('old-tabindex'); + } else if (this.$element.attr('tabindex') != null) { + this._tabindex = this.$element.attr('tabindex'); + } + + $selection.attr('title', this.$element.attr('title')); + $selection.attr('tabindex', this._tabindex); + + this.$selection = $selection; + + return $selection; + }; + + BaseSelection.prototype.bind = function (container, $container) { + var self = this; + + var id = container.id + '-container'; + var resultsId = container.id + '-results'; + + this.container = container; + + this.$selection.on('focus', function (evt) { + self.trigger('focus', evt); + }); + + this.$selection.on('blur', function (evt) { + self._handleBlur(evt); + }); + + this.$selection.on('keydown', function (evt) { + self.trigger('keypress', evt); + + if (evt.which === KEYS.SPACE) { + evt.preventDefault(); + } + }); + + container.on('results:focus', function (params) { + self.$selection.attr('aria-activedescendant', params.data._resultId); + }); + + container.on('selection:update', function (params) { + self.update(params.data); + }); + + container.on('open', function () { + // When the dropdown is open, aria-expanded="true" + self.$selection.attr('aria-expanded', 'true'); + self.$selection.attr('aria-owns', resultsId); + + self._attachCloseHandler(container); + }); + + container.on('close', function () { + // When the dropdown is closed, aria-expanded="false" + self.$selection.attr('aria-expanded', 'false'); + self.$selection.removeAttr('aria-activedescendant'); + self.$selection.removeAttr('aria-owns'); + + self.$selection.focus(); + + self._detachCloseHandler(container); + }); + + container.on('enable', function () { + self.$selection.attr('tabindex', self._tabindex); + }); + + container.on('disable', function () { + self.$selection.attr('tabindex', '-1'); + }); + }; + + BaseSelection.prototype._handleBlur = function (evt) { + var self = this; + + // This needs to be delayed as the active element is the body when the tab + // key is pressed, possibly along with others. + window.setTimeout(function () { + // Don't trigger `blur` if the focus is still in the selection + if ( + (document.activeElement == self.$selection[0]) || + ($.contains(self.$selection[0], document.activeElement)) + ) { + return; + } + + self.trigger('blur', evt); + }, 1); + }; + + BaseSelection.prototype._attachCloseHandler = function (container) { + var self = this; + + $(document.body).on('mousedown.select2.' + container.id, function (e) { + var $target = $(e.target); + + var $select = $target.closest('.select2'); + + var $all = $('.select2.select2-container--open'); + + $all.each(function () { + var $this = $(this); + + if (this == $select[0]) { + return; + } + + var $element = $this.data('element'); + + $element.select2('close'); + }); + }); + }; + + BaseSelection.prototype._detachCloseHandler = function (container) { + $(document.body).off('mousedown.select2.' + container.id); + }; + + BaseSelection.prototype.position = function ($selection, $container) { + var $selectionContainer = $container.find('.selection'); + $selectionContainer.append($selection); + }; + + BaseSelection.prototype.destroy = function () { + this._detachCloseHandler(this.container); + }; + + BaseSelection.prototype.update = function (data) { + throw new Error('The `update` method must be defined in child classes.'); + }; + + return BaseSelection; +}); + +S2.define('select2/selection/single',[ + 'jquery', + './base', + '../utils', + '../keys' +], function ($, BaseSelection, Utils, KEYS) { + function SingleSelection () { + SingleSelection.__super__.constructor.apply(this, arguments); + } + + Utils.Extend(SingleSelection, BaseSelection); + + SingleSelection.prototype.render = function () { + var $selection = SingleSelection.__super__.render.call(this); + + $selection.addClass('select2-selection--single'); + + $selection.html( + '' + + '' + + '' + + '' + ); + + return $selection; + }; + + SingleSelection.prototype.bind = function (container, $container) { + var self = this; + + SingleSelection.__super__.bind.apply(this, arguments); + + var id = container.id + '-container'; + + this.$selection.find('.select2-selection__rendered').attr('id', id); + this.$selection.attr('aria-labelledby', id); + + this.$selection.on('mousedown', function (evt) { + // Only respond to left clicks + if (evt.which !== 1) { + return; + } + + self.trigger('toggle', { + originalEvent: evt + }); + }); + + this.$selection.on('focus', function (evt) { + // User focuses on the container + }); + + this.$selection.on('blur', function (evt) { + // User exits the container + }); + + container.on('focus', function (evt) { + if (!container.isOpen()) { + self.$selection.focus(); + } + }); + + container.on('selection:update', function (params) { + self.update(params.data); + }); + }; + + SingleSelection.prototype.clear = function () { + this.$selection.find('.select2-selection__rendered').empty(); + }; + + SingleSelection.prototype.display = function (data, container) { + var template = this.options.get('templateSelection'); + var escapeMarkup = this.options.get('escapeMarkup'); + + return escapeMarkup(template(data, container)); + }; + + SingleSelection.prototype.selectionContainer = function () { + return $(''); + }; + + SingleSelection.prototype.update = function (data) { + if (data.length === 0) { + this.clear(); + return; + } + + var selection = data[0]; + + var $rendered = this.$selection.find('.select2-selection__rendered'); + var formatted = this.display(selection, $rendered); + + $rendered.empty().append(formatted); + $rendered.prop('title', selection.title || selection.text); + }; + + return SingleSelection; +}); + +S2.define('select2/selection/multiple',[ + 'jquery', + './base', + '../utils' +], function ($, BaseSelection, Utils) { + function MultipleSelection ($element, options) { + MultipleSelection.__super__.constructor.apply(this, arguments); + } + + Utils.Extend(MultipleSelection, BaseSelection); + + MultipleSelection.prototype.render = function () { + var $selection = MultipleSelection.__super__.render.call(this); + + $selection.addClass('select2-selection--multiple'); + + $selection.html( + '
              ' + ); + + return $selection; + }; + + MultipleSelection.prototype.bind = function (container, $container) { + var self = this; + + MultipleSelection.__super__.bind.apply(this, arguments); + + this.$selection.on('click', function (evt) { + self.trigger('toggle', { + originalEvent: evt + }); + }); + + this.$selection.on( + 'click', + '.select2-selection__choice__remove', + function (evt) { + // Ignore the event if it is disabled + if (self.options.get('disabled')) { + return; + } + + var $remove = $(this); + var $selection = $remove.parent(); + + var data = $selection.data('data'); + + self.trigger('unselect', { + originalEvent: evt, + data: data + }); + } + ); + }; + + MultipleSelection.prototype.clear = function () { + this.$selection.find('.select2-selection__rendered').empty(); + }; + + MultipleSelection.prototype.display = function (data, container) { + var template = this.options.get('templateSelection'); + var escapeMarkup = this.options.get('escapeMarkup'); + + return escapeMarkup(template(data, container)); + }; + + MultipleSelection.prototype.selectionContainer = function () { + var $container = $( + '
            • ' + + '' + + '×' + + '' + + '
            • ' + ); + + return $container; + }; + + MultipleSelection.prototype.update = function (data) { + this.clear(); + + if (data.length === 0) { + return; + } + + var $selections = []; + + for (var d = 0; d < data.length; d++) { + var selection = data[d]; + + var $selection = this.selectionContainer(); + var formatted = this.display(selection, $selection); + + $selection.append(formatted); + $selection.prop('title', selection.title || selection.text); + + $selection.data('data', selection); + + $selections.push($selection); + } + + var $rendered = this.$selection.find('.select2-selection__rendered'); + + Utils.appendMany($rendered, $selections); + }; + + return MultipleSelection; +}); + +S2.define('select2/selection/placeholder',[ + '../utils' +], function (Utils) { + function Placeholder (decorated, $element, options) { + this.placeholder = this.normalizePlaceholder(options.get('placeholder')); + + decorated.call(this, $element, options); + } + + Placeholder.prototype.normalizePlaceholder = function (_, placeholder) { + if (typeof placeholder === 'string') { + placeholder = { + id: '', + text: placeholder + }; + } + + return placeholder; + }; + + Placeholder.prototype.createPlaceholder = function (decorated, placeholder) { + var $placeholder = this.selectionContainer(); + + $placeholder.html(this.display(placeholder)); + $placeholder.addClass('select2-selection__placeholder') + .removeClass('select2-selection__choice'); + + return $placeholder; + }; + + Placeholder.prototype.update = function (decorated, data) { + var singlePlaceholder = ( + data.length == 1 && data[0].id != this.placeholder.id + ); + var multipleSelections = data.length > 1; + + if (multipleSelections || singlePlaceholder) { + return decorated.call(this, data); + } + + this.clear(); + + var $placeholder = this.createPlaceholder(this.placeholder); + + this.$selection.find('.select2-selection__rendered').append($placeholder); + }; + + return Placeholder; +}); + +S2.define('select2/selection/allowClear',[ + 'jquery', + '../keys' +], function ($, KEYS) { + function AllowClear () { } + + AllowClear.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + if (this.placeholder == null) { + if (this.options.get('debug') && window.console && console.error) { + console.error( + 'Select2: The `allowClear` option should be used in combination ' + + 'with the `placeholder` option.' + ); + } + } + + this.$selection.on('mousedown', '.select2-selection__clear', + function (evt) { + self._handleClear(evt); + }); + + container.on('keypress', function (evt) { + self._handleKeyboardClear(evt, container); + }); + }; + + AllowClear.prototype._handleClear = function (_, evt) { + // Ignore the event if it is disabled + if (this.options.get('disabled')) { + return; + } + + var $clear = this.$selection.find('.select2-selection__clear'); + + // Ignore the event if nothing has been selected + if ($clear.length === 0) { + return; + } + + evt.stopPropagation(); + + var data = $clear.data('data'); + + for (var d = 0; d < data.length; d++) { + var unselectData = { + data: data[d] + }; + + // Trigger the `unselect` event, so people can prevent it from being + // cleared. + this.trigger('unselect', unselectData); + + // If the event was prevented, don't clear it out. + if (unselectData.prevented) { + return; + } + } + + this.$element.val(this.placeholder.id).trigger('change'); + + this.trigger('toggle', {}); + }; + + AllowClear.prototype._handleKeyboardClear = function (_, evt, container) { + if (container.isOpen()) { + return; + } + + if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) { + this._handleClear(evt); + } + }; + + AllowClear.prototype.update = function (decorated, data) { + decorated.call(this, data); + + if (this.$selection.find('.select2-selection__placeholder').length > 0 || + data.length === 0) { + return; + } + + var $remove = $( + '' + + '×' + + '' + ); + $remove.data('data', data); + + this.$selection.find('.select2-selection__rendered').prepend($remove); + }; + + return AllowClear; +}); + +S2.define('select2/selection/search',[ + 'jquery', + '../utils', + '../keys' +], function ($, Utils, KEYS) { + function Search (decorated, $element, options) { + decorated.call(this, $element, options); + } + + Search.prototype.render = function (decorated) { + var $search = $( + '' + ); + + this.$searchContainer = $search; + this.$search = $search.find('input'); + + var $rendered = decorated.call(this); + + this._transferTabIndex(); + + return $rendered; + }; + + Search.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('open', function () { + self.$search.trigger('focus'); + }); + + container.on('close', function () { + self.$search.val(''); + self.$search.removeAttr('aria-activedescendant'); + self.$search.trigger('focus'); + }); + + container.on('enable', function () { + self.$search.prop('disabled', false); + + self._transferTabIndex(); + }); + + container.on('disable', function () { + self.$search.prop('disabled', true); + }); + + container.on('focus', function (evt) { + self.$search.trigger('focus'); + }); + + container.on('results:focus', function (params) { + self.$search.attr('aria-activedescendant', params.id); + }); + + this.$selection.on('focusin', '.select2-search--inline', function (evt) { + self.trigger('focus', evt); + }); + + this.$selection.on('focusout', '.select2-search--inline', function (evt) { + self._handleBlur(evt); + }); + + this.$selection.on('keydown', '.select2-search--inline', function (evt) { + evt.stopPropagation(); + + self.trigger('keypress', evt); + + self._keyUpPrevented = evt.isDefaultPrevented(); + + var key = evt.which; + + if (key === KEYS.BACKSPACE && self.$search.val() === '') { + var $previousChoice = self.$searchContainer + .prev('.select2-selection__choice'); + + if ($previousChoice.length > 0) { + var item = $previousChoice.data('data'); + + self.searchRemoveChoice(item); + + evt.preventDefault(); + } + } + }); + + // Try to detect the IE version should the `documentMode` property that + // is stored on the document. This is only implemented in IE and is + // slightly cleaner than doing a user agent check. + // This property is not available in Edge, but Edge also doesn't have + // this bug. + var msie = document.documentMode; + var disableInputEvents = msie && msie <= 11; + + // Workaround for browsers which do not support the `input` event + // This will prevent double-triggering of events for browsers which support + // both the `keyup` and `input` events. + this.$selection.on( + 'input.searchcheck', + '.select2-search--inline', + function (evt) { + // IE will trigger the `input` event when a placeholder is used on a + // search box. To get around this issue, we are forced to ignore all + // `input` events in IE and keep using `keyup`. + if (disableInputEvents) { + self.$selection.off('input.search input.searchcheck'); + return; + } + + // Unbind the duplicated `keyup` event + self.$selection.off('keyup.search'); + } + ); + + this.$selection.on( + 'keyup.search input.search', + '.select2-search--inline', + function (evt) { + // IE will trigger the `input` event when a placeholder is used on a + // search box. To get around this issue, we are forced to ignore all + // `input` events in IE and keep using `keyup`. + if (disableInputEvents && evt.type === 'input') { + self.$selection.off('input.search input.searchcheck'); + return; + } + + var key = evt.which; + + // We can freely ignore events from modifier keys + if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { + return; + } + + // Tabbing will be handled during the `keydown` phase + if (key == KEYS.TAB) { + return; + } + + self.handleSearch(evt); + } + ); + }; + + /** + * This method will transfer the tabindex attribute from the rendered + * selection to the search box. This allows for the search box to be used as + * the primary focus instead of the selection container. + * + * @private + */ + Search.prototype._transferTabIndex = function (decorated) { + this.$search.attr('tabindex', this.$selection.attr('tabindex')); + this.$selection.attr('tabindex', '-1'); + }; + + Search.prototype.createPlaceholder = function (decorated, placeholder) { + this.$search.attr('placeholder', placeholder.text); + }; + + Search.prototype.update = function (decorated, data) { + var searchHadFocus = this.$search[0] == document.activeElement; + + this.$search.attr('placeholder', ''); + + decorated.call(this, data); + + this.$selection.find('.select2-selection__rendered') + .append(this.$searchContainer); + + this.resizeSearch(); + if (searchHadFocus) { + this.$search.focus(); + } + }; + + Search.prototype.handleSearch = function () { + this.resizeSearch(); + + if (!this._keyUpPrevented) { + var input = this.$search.val(); + + this.trigger('query', { + term: input + }); + } + + this._keyUpPrevented = false; + }; + + Search.prototype.searchRemoveChoice = function (decorated, item) { + this.trigger('unselect', { + data: item + }); + + this.$search.val(item.text); + this.handleSearch(); + }; + + Search.prototype.resizeSearch = function () { + this.$search.css('width', '25px'); + + var width = ''; + + if (this.$search.attr('placeholder') !== '') { + width = this.$selection.find('.select2-selection__rendered').innerWidth(); + } else { + var minimumWidth = this.$search.val().length + 1; + + width = (minimumWidth * 0.75) + 'em'; + } + + this.$search.css('width', width); + }; + + return Search; +}); + +S2.define('select2/selection/eventRelay',[ + 'jquery' +], function ($) { + function EventRelay () { } + + EventRelay.prototype.bind = function (decorated, container, $container) { + var self = this; + var relayEvents = [ + 'open', 'opening', + 'close', 'closing', + 'select', 'selecting', + 'unselect', 'unselecting' + ]; + + var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting']; + + decorated.call(this, container, $container); + + container.on('*', function (name, params) { + // Ignore events that should not be relayed + if ($.inArray(name, relayEvents) === -1) { + return; + } + + // The parameters should always be an object + params = params || {}; + + // Generate the jQuery event for the Select2 event + var evt = $.Event('select2:' + name, { + params: params + }); + + self.$element.trigger(evt); + + // Only handle preventable events if it was one + if ($.inArray(name, preventableEvents) === -1) { + return; + } + + params.prevented = evt.isDefaultPrevented(); + }); + }; + + return EventRelay; +}); + +S2.define('select2/translation',[ + 'jquery', + 'require' +], function ($, require) { + function Translation (dict) { + this.dict = dict || {}; + } + + Translation.prototype.all = function () { + return this.dict; + }; + + Translation.prototype.get = function (key) { + return this.dict[key]; + }; + + Translation.prototype.extend = function (translation) { + this.dict = $.extend({}, translation.all(), this.dict); + }; + + // Static functions + + Translation._cache = {}; + + Translation.loadPath = function (path) { + if (!(path in Translation._cache)) { + var translations = require(path); + + Translation._cache[path] = translations; + } + + return new Translation(Translation._cache[path]); + }; + + return Translation; +}); + +S2.define('select2/diacritics',[ + +], function () { + var diacritics = { + '\u24B6': 'A', + '\uFF21': 'A', + '\u00C0': 'A', + '\u00C1': 'A', + '\u00C2': 'A', + '\u1EA6': 'A', + '\u1EA4': 'A', + '\u1EAA': 'A', + '\u1EA8': 'A', + '\u00C3': 'A', + '\u0100': 'A', + '\u0102': 'A', + '\u1EB0': 'A', + '\u1EAE': 'A', + '\u1EB4': 'A', + '\u1EB2': 'A', + '\u0226': 'A', + '\u01E0': 'A', + '\u00C4': 'A', + '\u01DE': 'A', + '\u1EA2': 'A', + '\u00C5': 'A', + '\u01FA': 'A', + '\u01CD': 'A', + '\u0200': 'A', + '\u0202': 'A', + '\u1EA0': 'A', + '\u1EAC': 'A', + '\u1EB6': 'A', + '\u1E00': 'A', + '\u0104': 'A', + '\u023A': 'A', + '\u2C6F': 'A', + '\uA732': 'AA', + '\u00C6': 'AE', + '\u01FC': 'AE', + '\u01E2': 'AE', + '\uA734': 'AO', + '\uA736': 'AU', + '\uA738': 'AV', + '\uA73A': 'AV', + '\uA73C': 'AY', + '\u24B7': 'B', + '\uFF22': 'B', + '\u1E02': 'B', + '\u1E04': 'B', + '\u1E06': 'B', + '\u0243': 'B', + '\u0182': 'B', + '\u0181': 'B', + '\u24B8': 'C', + '\uFF23': 'C', + '\u0106': 'C', + '\u0108': 'C', + '\u010A': 'C', + '\u010C': 'C', + '\u00C7': 'C', + '\u1E08': 'C', + '\u0187': 'C', + '\u023B': 'C', + '\uA73E': 'C', + '\u24B9': 'D', + '\uFF24': 'D', + '\u1E0A': 'D', + '\u010E': 'D', + '\u1E0C': 'D', + '\u1E10': 'D', + '\u1E12': 'D', + '\u1E0E': 'D', + '\u0110': 'D', + '\u018B': 'D', + '\u018A': 'D', + '\u0189': 'D', + '\uA779': 'D', + '\u01F1': 'DZ', + '\u01C4': 'DZ', + '\u01F2': 'Dz', + '\u01C5': 'Dz', + '\u24BA': 'E', + '\uFF25': 'E', + '\u00C8': 'E', + '\u00C9': 'E', + '\u00CA': 'E', + '\u1EC0': 'E', + '\u1EBE': 'E', + '\u1EC4': 'E', + '\u1EC2': 'E', + '\u1EBC': 'E', + '\u0112': 'E', + '\u1E14': 'E', + '\u1E16': 'E', + '\u0114': 'E', + '\u0116': 'E', + '\u00CB': 'E', + '\u1EBA': 'E', + '\u011A': 'E', + '\u0204': 'E', + '\u0206': 'E', + '\u1EB8': 'E', + '\u1EC6': 'E', + '\u0228': 'E', + '\u1E1C': 'E', + '\u0118': 'E', + '\u1E18': 'E', + '\u1E1A': 'E', + '\u0190': 'E', + '\u018E': 'E', + '\u24BB': 'F', + '\uFF26': 'F', + '\u1E1E': 'F', + '\u0191': 'F', + '\uA77B': 'F', + '\u24BC': 'G', + '\uFF27': 'G', + '\u01F4': 'G', + '\u011C': 'G', + '\u1E20': 'G', + '\u011E': 'G', + '\u0120': 'G', + '\u01E6': 'G', + '\u0122': 'G', + '\u01E4': 'G', + '\u0193': 'G', + '\uA7A0': 'G', + '\uA77D': 'G', + '\uA77E': 'G', + '\u24BD': 'H', + '\uFF28': 'H', + '\u0124': 'H', + '\u1E22': 'H', + '\u1E26': 'H', + '\u021E': 'H', + '\u1E24': 'H', + '\u1E28': 'H', + '\u1E2A': 'H', + '\u0126': 'H', + '\u2C67': 'H', + '\u2C75': 'H', + '\uA78D': 'H', + '\u24BE': 'I', + '\uFF29': 'I', + '\u00CC': 'I', + '\u00CD': 'I', + '\u00CE': 'I', + '\u0128': 'I', + '\u012A': 'I', + '\u012C': 'I', + '\u0130': 'I', + '\u00CF': 'I', + '\u1E2E': 'I', + '\u1EC8': 'I', + '\u01CF': 'I', + '\u0208': 'I', + '\u020A': 'I', + '\u1ECA': 'I', + '\u012E': 'I', + '\u1E2C': 'I', + '\u0197': 'I', + '\u24BF': 'J', + '\uFF2A': 'J', + '\u0134': 'J', + '\u0248': 'J', + '\u24C0': 'K', + '\uFF2B': 'K', + '\u1E30': 'K', + '\u01E8': 'K', + '\u1E32': 'K', + '\u0136': 'K', + '\u1E34': 'K', + '\u0198': 'K', + '\u2C69': 'K', + '\uA740': 'K', + '\uA742': 'K', + '\uA744': 'K', + '\uA7A2': 'K', + '\u24C1': 'L', + '\uFF2C': 'L', + '\u013F': 'L', + '\u0139': 'L', + '\u013D': 'L', + '\u1E36': 'L', + '\u1E38': 'L', + '\u013B': 'L', + '\u1E3C': 'L', + '\u1E3A': 'L', + '\u0141': 'L', + '\u023D': 'L', + '\u2C62': 'L', + '\u2C60': 'L', + '\uA748': 'L', + '\uA746': 'L', + '\uA780': 'L', + '\u01C7': 'LJ', + '\u01C8': 'Lj', + '\u24C2': 'M', + '\uFF2D': 'M', + '\u1E3E': 'M', + '\u1E40': 'M', + '\u1E42': 'M', + '\u2C6E': 'M', + '\u019C': 'M', + '\u24C3': 'N', + '\uFF2E': 'N', + '\u01F8': 'N', + '\u0143': 'N', + '\u00D1': 'N', + '\u1E44': 'N', + '\u0147': 'N', + '\u1E46': 'N', + '\u0145': 'N', + '\u1E4A': 'N', + '\u1E48': 'N', + '\u0220': 'N', + '\u019D': 'N', + '\uA790': 'N', + '\uA7A4': 'N', + '\u01CA': 'NJ', + '\u01CB': 'Nj', + '\u24C4': 'O', + '\uFF2F': 'O', + '\u00D2': 'O', + '\u00D3': 'O', + '\u00D4': 'O', + '\u1ED2': 'O', + '\u1ED0': 'O', + '\u1ED6': 'O', + '\u1ED4': 'O', + '\u00D5': 'O', + '\u1E4C': 'O', + '\u022C': 'O', + '\u1E4E': 'O', + '\u014C': 'O', + '\u1E50': 'O', + '\u1E52': 'O', + '\u014E': 'O', + '\u022E': 'O', + '\u0230': 'O', + '\u00D6': 'O', + '\u022A': 'O', + '\u1ECE': 'O', + '\u0150': 'O', + '\u01D1': 'O', + '\u020C': 'O', + '\u020E': 'O', + '\u01A0': 'O', + '\u1EDC': 'O', + '\u1EDA': 'O', + '\u1EE0': 'O', + '\u1EDE': 'O', + '\u1EE2': 'O', + '\u1ECC': 'O', + '\u1ED8': 'O', + '\u01EA': 'O', + '\u01EC': 'O', + '\u00D8': 'O', + '\u01FE': 'O', + '\u0186': 'O', + '\u019F': 'O', + '\uA74A': 'O', + '\uA74C': 'O', + '\u01A2': 'OI', + '\uA74E': 'OO', + '\u0222': 'OU', + '\u24C5': 'P', + '\uFF30': 'P', + '\u1E54': 'P', + '\u1E56': 'P', + '\u01A4': 'P', + '\u2C63': 'P', + '\uA750': 'P', + '\uA752': 'P', + '\uA754': 'P', + '\u24C6': 'Q', + '\uFF31': 'Q', + '\uA756': 'Q', + '\uA758': 'Q', + '\u024A': 'Q', + '\u24C7': 'R', + '\uFF32': 'R', + '\u0154': 'R', + '\u1E58': 'R', + '\u0158': 'R', + '\u0210': 'R', + '\u0212': 'R', + '\u1E5A': 'R', + '\u1E5C': 'R', + '\u0156': 'R', + '\u1E5E': 'R', + '\u024C': 'R', + '\u2C64': 'R', + '\uA75A': 'R', + '\uA7A6': 'R', + '\uA782': 'R', + '\u24C8': 'S', + '\uFF33': 'S', + '\u1E9E': 'S', + '\u015A': 'S', + '\u1E64': 'S', + '\u015C': 'S', + '\u1E60': 'S', + '\u0160': 'S', + '\u1E66': 'S', + '\u1E62': 'S', + '\u1E68': 'S', + '\u0218': 'S', + '\u015E': 'S', + '\u2C7E': 'S', + '\uA7A8': 'S', + '\uA784': 'S', + '\u24C9': 'T', + '\uFF34': 'T', + '\u1E6A': 'T', + '\u0164': 'T', + '\u1E6C': 'T', + '\u021A': 'T', + '\u0162': 'T', + '\u1E70': 'T', + '\u1E6E': 'T', + '\u0166': 'T', + '\u01AC': 'T', + '\u01AE': 'T', + '\u023E': 'T', + '\uA786': 'T', + '\uA728': 'TZ', + '\u24CA': 'U', + '\uFF35': 'U', + '\u00D9': 'U', + '\u00DA': 'U', + '\u00DB': 'U', + '\u0168': 'U', + '\u1E78': 'U', + '\u016A': 'U', + '\u1E7A': 'U', + '\u016C': 'U', + '\u00DC': 'U', + '\u01DB': 'U', + '\u01D7': 'U', + '\u01D5': 'U', + '\u01D9': 'U', + '\u1EE6': 'U', + '\u016E': 'U', + '\u0170': 'U', + '\u01D3': 'U', + '\u0214': 'U', + '\u0216': 'U', + '\u01AF': 'U', + '\u1EEA': 'U', + '\u1EE8': 'U', + '\u1EEE': 'U', + '\u1EEC': 'U', + '\u1EF0': 'U', + '\u1EE4': 'U', + '\u1E72': 'U', + '\u0172': 'U', + '\u1E76': 'U', + '\u1E74': 'U', + '\u0244': 'U', + '\u24CB': 'V', + '\uFF36': 'V', + '\u1E7C': 'V', + '\u1E7E': 'V', + '\u01B2': 'V', + '\uA75E': 'V', + '\u0245': 'V', + '\uA760': 'VY', + '\u24CC': 'W', + '\uFF37': 'W', + '\u1E80': 'W', + '\u1E82': 'W', + '\u0174': 'W', + '\u1E86': 'W', + '\u1E84': 'W', + '\u1E88': 'W', + '\u2C72': 'W', + '\u24CD': 'X', + '\uFF38': 'X', + '\u1E8A': 'X', + '\u1E8C': 'X', + '\u24CE': 'Y', + '\uFF39': 'Y', + '\u1EF2': 'Y', + '\u00DD': 'Y', + '\u0176': 'Y', + '\u1EF8': 'Y', + '\u0232': 'Y', + '\u1E8E': 'Y', + '\u0178': 'Y', + '\u1EF6': 'Y', + '\u1EF4': 'Y', + '\u01B3': 'Y', + '\u024E': 'Y', + '\u1EFE': 'Y', + '\u24CF': 'Z', + '\uFF3A': 'Z', + '\u0179': 'Z', + '\u1E90': 'Z', + '\u017B': 'Z', + '\u017D': 'Z', + '\u1E92': 'Z', + '\u1E94': 'Z', + '\u01B5': 'Z', + '\u0224': 'Z', + '\u2C7F': 'Z', + '\u2C6B': 'Z', + '\uA762': 'Z', + '\u24D0': 'a', + '\uFF41': 'a', + '\u1E9A': 'a', + '\u00E0': 'a', + '\u00E1': 'a', + '\u00E2': 'a', + '\u1EA7': 'a', + '\u1EA5': 'a', + '\u1EAB': 'a', + '\u1EA9': 'a', + '\u00E3': 'a', + '\u0101': 'a', + '\u0103': 'a', + '\u1EB1': 'a', + '\u1EAF': 'a', + '\u1EB5': 'a', + '\u1EB3': 'a', + '\u0227': 'a', + '\u01E1': 'a', + '\u00E4': 'a', + '\u01DF': 'a', + '\u1EA3': 'a', + '\u00E5': 'a', + '\u01FB': 'a', + '\u01CE': 'a', + '\u0201': 'a', + '\u0203': 'a', + '\u1EA1': 'a', + '\u1EAD': 'a', + '\u1EB7': 'a', + '\u1E01': 'a', + '\u0105': 'a', + '\u2C65': 'a', + '\u0250': 'a', + '\uA733': 'aa', + '\u00E6': 'ae', + '\u01FD': 'ae', + '\u01E3': 'ae', + '\uA735': 'ao', + '\uA737': 'au', + '\uA739': 'av', + '\uA73B': 'av', + '\uA73D': 'ay', + '\u24D1': 'b', + '\uFF42': 'b', + '\u1E03': 'b', + '\u1E05': 'b', + '\u1E07': 'b', + '\u0180': 'b', + '\u0183': 'b', + '\u0253': 'b', + '\u24D2': 'c', + '\uFF43': 'c', + '\u0107': 'c', + '\u0109': 'c', + '\u010B': 'c', + '\u010D': 'c', + '\u00E7': 'c', + '\u1E09': 'c', + '\u0188': 'c', + '\u023C': 'c', + '\uA73F': 'c', + '\u2184': 'c', + '\u24D3': 'd', + '\uFF44': 'd', + '\u1E0B': 'd', + '\u010F': 'd', + '\u1E0D': 'd', + '\u1E11': 'd', + '\u1E13': 'd', + '\u1E0F': 'd', + '\u0111': 'd', + '\u018C': 'd', + '\u0256': 'd', + '\u0257': 'd', + '\uA77A': 'd', + '\u01F3': 'dz', + '\u01C6': 'dz', + '\u24D4': 'e', + '\uFF45': 'e', + '\u00E8': 'e', + '\u00E9': 'e', + '\u00EA': 'e', + '\u1EC1': 'e', + '\u1EBF': 'e', + '\u1EC5': 'e', + '\u1EC3': 'e', + '\u1EBD': 'e', + '\u0113': 'e', + '\u1E15': 'e', + '\u1E17': 'e', + '\u0115': 'e', + '\u0117': 'e', + '\u00EB': 'e', + '\u1EBB': 'e', + '\u011B': 'e', + '\u0205': 'e', + '\u0207': 'e', + '\u1EB9': 'e', + '\u1EC7': 'e', + '\u0229': 'e', + '\u1E1D': 'e', + '\u0119': 'e', + '\u1E19': 'e', + '\u1E1B': 'e', + '\u0247': 'e', + '\u025B': 'e', + '\u01DD': 'e', + '\u24D5': 'f', + '\uFF46': 'f', + '\u1E1F': 'f', + '\u0192': 'f', + '\uA77C': 'f', + '\u24D6': 'g', + '\uFF47': 'g', + '\u01F5': 'g', + '\u011D': 'g', + '\u1E21': 'g', + '\u011F': 'g', + '\u0121': 'g', + '\u01E7': 'g', + '\u0123': 'g', + '\u01E5': 'g', + '\u0260': 'g', + '\uA7A1': 'g', + '\u1D79': 'g', + '\uA77F': 'g', + '\u24D7': 'h', + '\uFF48': 'h', + '\u0125': 'h', + '\u1E23': 'h', + '\u1E27': 'h', + '\u021F': 'h', + '\u1E25': 'h', + '\u1E29': 'h', + '\u1E2B': 'h', + '\u1E96': 'h', + '\u0127': 'h', + '\u2C68': 'h', + '\u2C76': 'h', + '\u0265': 'h', + '\u0195': 'hv', + '\u24D8': 'i', + '\uFF49': 'i', + '\u00EC': 'i', + '\u00ED': 'i', + '\u00EE': 'i', + '\u0129': 'i', + '\u012B': 'i', + '\u012D': 'i', + '\u00EF': 'i', + '\u1E2F': 'i', + '\u1EC9': 'i', + '\u01D0': 'i', + '\u0209': 'i', + '\u020B': 'i', + '\u1ECB': 'i', + '\u012F': 'i', + '\u1E2D': 'i', + '\u0268': 'i', + '\u0131': 'i', + '\u24D9': 'j', + '\uFF4A': 'j', + '\u0135': 'j', + '\u01F0': 'j', + '\u0249': 'j', + '\u24DA': 'k', + '\uFF4B': 'k', + '\u1E31': 'k', + '\u01E9': 'k', + '\u1E33': 'k', + '\u0137': 'k', + '\u1E35': 'k', + '\u0199': 'k', + '\u2C6A': 'k', + '\uA741': 'k', + '\uA743': 'k', + '\uA745': 'k', + '\uA7A3': 'k', + '\u24DB': 'l', + '\uFF4C': 'l', + '\u0140': 'l', + '\u013A': 'l', + '\u013E': 'l', + '\u1E37': 'l', + '\u1E39': 'l', + '\u013C': 'l', + '\u1E3D': 'l', + '\u1E3B': 'l', + '\u017F': 'l', + '\u0142': 'l', + '\u019A': 'l', + '\u026B': 'l', + '\u2C61': 'l', + '\uA749': 'l', + '\uA781': 'l', + '\uA747': 'l', + '\u01C9': 'lj', + '\u24DC': 'm', + '\uFF4D': 'm', + '\u1E3F': 'm', + '\u1E41': 'm', + '\u1E43': 'm', + '\u0271': 'm', + '\u026F': 'm', + '\u24DD': 'n', + '\uFF4E': 'n', + '\u01F9': 'n', + '\u0144': 'n', + '\u00F1': 'n', + '\u1E45': 'n', + '\u0148': 'n', + '\u1E47': 'n', + '\u0146': 'n', + '\u1E4B': 'n', + '\u1E49': 'n', + '\u019E': 'n', + '\u0272': 'n', + '\u0149': 'n', + '\uA791': 'n', + '\uA7A5': 'n', + '\u01CC': 'nj', + '\u24DE': 'o', + '\uFF4F': 'o', + '\u00F2': 'o', + '\u00F3': 'o', + '\u00F4': 'o', + '\u1ED3': 'o', + '\u1ED1': 'o', + '\u1ED7': 'o', + '\u1ED5': 'o', + '\u00F5': 'o', + '\u1E4D': 'o', + '\u022D': 'o', + '\u1E4F': 'o', + '\u014D': 'o', + '\u1E51': 'o', + '\u1E53': 'o', + '\u014F': 'o', + '\u022F': 'o', + '\u0231': 'o', + '\u00F6': 'o', + '\u022B': 'o', + '\u1ECF': 'o', + '\u0151': 'o', + '\u01D2': 'o', + '\u020D': 'o', + '\u020F': 'o', + '\u01A1': 'o', + '\u1EDD': 'o', + '\u1EDB': 'o', + '\u1EE1': 'o', + '\u1EDF': 'o', + '\u1EE3': 'o', + '\u1ECD': 'o', + '\u1ED9': 'o', + '\u01EB': 'o', + '\u01ED': 'o', + '\u00F8': 'o', + '\u01FF': 'o', + '\u0254': 'o', + '\uA74B': 'o', + '\uA74D': 'o', + '\u0275': 'o', + '\u01A3': 'oi', + '\u0223': 'ou', + '\uA74F': 'oo', + '\u24DF': 'p', + '\uFF50': 'p', + '\u1E55': 'p', + '\u1E57': 'p', + '\u01A5': 'p', + '\u1D7D': 'p', + '\uA751': 'p', + '\uA753': 'p', + '\uA755': 'p', + '\u24E0': 'q', + '\uFF51': 'q', + '\u024B': 'q', + '\uA757': 'q', + '\uA759': 'q', + '\u24E1': 'r', + '\uFF52': 'r', + '\u0155': 'r', + '\u1E59': 'r', + '\u0159': 'r', + '\u0211': 'r', + '\u0213': 'r', + '\u1E5B': 'r', + '\u1E5D': 'r', + '\u0157': 'r', + '\u1E5F': 'r', + '\u024D': 'r', + '\u027D': 'r', + '\uA75B': 'r', + '\uA7A7': 'r', + '\uA783': 'r', + '\u24E2': 's', + '\uFF53': 's', + '\u00DF': 's', + '\u015B': 's', + '\u1E65': 's', + '\u015D': 's', + '\u1E61': 's', + '\u0161': 's', + '\u1E67': 's', + '\u1E63': 's', + '\u1E69': 's', + '\u0219': 's', + '\u015F': 's', + '\u023F': 's', + '\uA7A9': 's', + '\uA785': 's', + '\u1E9B': 's', + '\u24E3': 't', + '\uFF54': 't', + '\u1E6B': 't', + '\u1E97': 't', + '\u0165': 't', + '\u1E6D': 't', + '\u021B': 't', + '\u0163': 't', + '\u1E71': 't', + '\u1E6F': 't', + '\u0167': 't', + '\u01AD': 't', + '\u0288': 't', + '\u2C66': 't', + '\uA787': 't', + '\uA729': 'tz', + '\u24E4': 'u', + '\uFF55': 'u', + '\u00F9': 'u', + '\u00FA': 'u', + '\u00FB': 'u', + '\u0169': 'u', + '\u1E79': 'u', + '\u016B': 'u', + '\u1E7B': 'u', + '\u016D': 'u', + '\u00FC': 'u', + '\u01DC': 'u', + '\u01D8': 'u', + '\u01D6': 'u', + '\u01DA': 'u', + '\u1EE7': 'u', + '\u016F': 'u', + '\u0171': 'u', + '\u01D4': 'u', + '\u0215': 'u', + '\u0217': 'u', + '\u01B0': 'u', + '\u1EEB': 'u', + '\u1EE9': 'u', + '\u1EEF': 'u', + '\u1EED': 'u', + '\u1EF1': 'u', + '\u1EE5': 'u', + '\u1E73': 'u', + '\u0173': 'u', + '\u1E77': 'u', + '\u1E75': 'u', + '\u0289': 'u', + '\u24E5': 'v', + '\uFF56': 'v', + '\u1E7D': 'v', + '\u1E7F': 'v', + '\u028B': 'v', + '\uA75F': 'v', + '\u028C': 'v', + '\uA761': 'vy', + '\u24E6': 'w', + '\uFF57': 'w', + '\u1E81': 'w', + '\u1E83': 'w', + '\u0175': 'w', + '\u1E87': 'w', + '\u1E85': 'w', + '\u1E98': 'w', + '\u1E89': 'w', + '\u2C73': 'w', + '\u24E7': 'x', + '\uFF58': 'x', + '\u1E8B': 'x', + '\u1E8D': 'x', + '\u24E8': 'y', + '\uFF59': 'y', + '\u1EF3': 'y', + '\u00FD': 'y', + '\u0177': 'y', + '\u1EF9': 'y', + '\u0233': 'y', + '\u1E8F': 'y', + '\u00FF': 'y', + '\u1EF7': 'y', + '\u1E99': 'y', + '\u1EF5': 'y', + '\u01B4': 'y', + '\u024F': 'y', + '\u1EFF': 'y', + '\u24E9': 'z', + '\uFF5A': 'z', + '\u017A': 'z', + '\u1E91': 'z', + '\u017C': 'z', + '\u017E': 'z', + '\u1E93': 'z', + '\u1E95': 'z', + '\u01B6': 'z', + '\u0225': 'z', + '\u0240': 'z', + '\u2C6C': 'z', + '\uA763': 'z', + '\u0386': '\u0391', + '\u0388': '\u0395', + '\u0389': '\u0397', + '\u038A': '\u0399', + '\u03AA': '\u0399', + '\u038C': '\u039F', + '\u038E': '\u03A5', + '\u03AB': '\u03A5', + '\u038F': '\u03A9', + '\u03AC': '\u03B1', + '\u03AD': '\u03B5', + '\u03AE': '\u03B7', + '\u03AF': '\u03B9', + '\u03CA': '\u03B9', + '\u0390': '\u03B9', + '\u03CC': '\u03BF', + '\u03CD': '\u03C5', + '\u03CB': '\u03C5', + '\u03B0': '\u03C5', + '\u03C9': '\u03C9', + '\u03C2': '\u03C3' + }; + + return diacritics; +}); + +S2.define('select2/data/base',[ + '../utils' +], function (Utils) { + function BaseAdapter ($element, options) { + BaseAdapter.__super__.constructor.call(this); + } + + Utils.Extend(BaseAdapter, Utils.Observable); + + BaseAdapter.prototype.current = function (callback) { + throw new Error('The `current` method must be defined in child classes.'); + }; + + BaseAdapter.prototype.query = function (params, callback) { + throw new Error('The `query` method must be defined in child classes.'); + }; + + BaseAdapter.prototype.bind = function (container, $container) { + // Can be implemented in subclasses + }; + + BaseAdapter.prototype.destroy = function () { + // Can be implemented in subclasses + }; + + BaseAdapter.prototype.generateResultId = function (container, data) { + var id = container.id + '-result-'; + + id += Utils.generateChars(4); + + if (data.id != null) { + id += '-' + data.id.toString(); + } else { + id += '-' + Utils.generateChars(4); + } + return id; + }; + + return BaseAdapter; +}); + +S2.define('select2/data/select',[ + './base', + '../utils', + 'jquery' +], function (BaseAdapter, Utils, $) { + function SelectAdapter ($element, options) { + this.$element = $element; + this.options = options; + + SelectAdapter.__super__.constructor.call(this); + } + + Utils.Extend(SelectAdapter, BaseAdapter); + + SelectAdapter.prototype.current = function (callback) { + var data = []; + var self = this; + + this.$element.find(':selected').each(function () { + var $option = $(this); + + var option = self.item($option); + + data.push(option); + }); + + callback(data); + }; + + SelectAdapter.prototype.select = function (data) { + var self = this; + + data.selected = true; + + // If data.element is a DOM node, use it instead + if ($(data.element).is('option')) { + data.element.selected = true; + + this.$element.trigger('change'); + + return; + } + + if (this.$element.prop('multiple')) { + this.current(function (currentData) { + var val = []; + + data = [data]; + data.push.apply(data, currentData); + + for (var d = 0; d < data.length; d++) { + var id = data[d].id; + + if ($.inArray(id, val) === -1) { + val.push(id); + } + } + + self.$element.val(val); + self.$element.trigger('change'); + }); + } else { + var val = data.id; + + this.$element.val(val); + this.$element.trigger('change'); + } + }; + + SelectAdapter.prototype.unselect = function (data) { + var self = this; + + if (!this.$element.prop('multiple')) { + return; + } + + data.selected = false; + + if ($(data.element).is('option')) { + data.element.selected = false; + + this.$element.trigger('change'); + + return; + } + + this.current(function (currentData) { + var val = []; + + for (var d = 0; d < currentData.length; d++) { + var id = currentData[d].id; + + if (id !== data.id && $.inArray(id, val) === -1) { + val.push(id); + } + } + + self.$element.val(val); + + self.$element.trigger('change'); + }); + }; + + SelectAdapter.prototype.bind = function (container, $container) { + var self = this; + + this.container = container; + + container.on('select', function (params) { + self.select(params.data); + }); + + container.on('unselect', function (params) { + self.unselect(params.data); + }); + }; + + SelectAdapter.prototype.destroy = function () { + // Remove anything added to child elements + this.$element.find('*').each(function () { + // Remove any custom data set by Select2 + $.removeData(this, 'data'); + }); + }; + + SelectAdapter.prototype.query = function (params, callback) { + var data = []; + var self = this; + + var $options = this.$element.children(); + + $options.each(function () { + var $option = $(this); + + if (!$option.is('option') && !$option.is('optgroup')) { + return; + } + + var option = self.item($option); + + var matches = self.matches(params, option); + + if (matches !== null) { + data.push(matches); + } + }); + + callback({ + results: data + }); + }; + + SelectAdapter.prototype.addOptions = function ($options) { + Utils.appendMany(this.$element, $options); + }; + + SelectAdapter.prototype.option = function (data) { + var option; + + if (data.children) { + option = document.createElement('optgroup'); + option.label = data.text; + } else { + option = document.createElement('option'); + + if (option.textContent !== undefined) { + option.textContent = data.text; + } else { + option.innerText = data.text; + } + } + + if (data.id) { + option.value = data.id; + } + + if (data.disabled) { + option.disabled = true; + } + + if (data.selected) { + option.selected = true; + } + + if (data.title) { + option.title = data.title; + } + + var $option = $(option); + + var normalizedData = this._normalizeItem(data); + normalizedData.element = option; + + // Override the option's data with the combined data + $.data(option, 'data', normalizedData); + + return $option; + }; + + SelectAdapter.prototype.item = function ($option) { + var data = {}; + + data = $.data($option[0], 'data'); + + if (data != null) { + return data; + } + + if ($option.is('option')) { + data = { + id: $option.val(), + text: $option.text(), + disabled: $option.prop('disabled'), + selected: $option.prop('selected'), + title: $option.prop('title') + }; + } else if ($option.is('optgroup')) { + data = { + text: $option.prop('label'), + children: [], + title: $option.prop('title') + }; + + var $children = $option.children('option'); + var children = []; + + for (var c = 0; c < $children.length; c++) { + var $child = $($children[c]); + + var child = this.item($child); + + children.push(child); + } + + data.children = children; + } + + data = this._normalizeItem(data); + data.element = $option[0]; + + $.data($option[0], 'data', data); + + return data; + }; + + SelectAdapter.prototype._normalizeItem = function (item) { + if (!$.isPlainObject(item)) { + item = { + id: item, + text: item + }; + } + + item = $.extend({}, { + text: '' + }, item); + + var defaults = { + selected: false, + disabled: false + }; + + if (item.id != null) { + item.id = item.id.toString(); + } + + if (item.text != null) { + item.text = item.text.toString(); + } + + if (item._resultId == null && item.id && this.container != null) { + item._resultId = this.generateResultId(this.container, item); + } + + return $.extend({}, defaults, item); + }; + + SelectAdapter.prototype.matches = function (params, data) { + var matcher = this.options.get('matcher'); + + return matcher(params, data); + }; + + return SelectAdapter; +}); + +S2.define('select2/data/array',[ + './select', + '../utils', + 'jquery' +], function (SelectAdapter, Utils, $) { + function ArrayAdapter ($element, options) { + var data = options.get('data') || []; + + ArrayAdapter.__super__.constructor.call(this, $element, options); + + this.addOptions(this.convertToOptions(data)); + } + + Utils.Extend(ArrayAdapter, SelectAdapter); + + ArrayAdapter.prototype.select = function (data) { + var $option = this.$element.find('option').filter(function (i, elm) { + return elm.value == data.id.toString(); + }); + + if ($option.length === 0) { + $option = this.option(data); + + this.addOptions($option); + } + + ArrayAdapter.__super__.select.call(this, data); + }; + + ArrayAdapter.prototype.convertToOptions = function (data) { + var self = this; + + var $existing = this.$element.find('option'); + var existingIds = $existing.map(function () { + return self.item($(this)).id; + }).get(); + + var $options = []; + + // Filter out all items except for the one passed in the argument + function onlyItem (item) { + return function () { + return $(this).val() == item.id; + }; + } + + for (var d = 0; d < data.length; d++) { + var item = this._normalizeItem(data[d]); + + // Skip items which were pre-loaded, only merge the data + if ($.inArray(item.id, existingIds) >= 0) { + var $existingOption = $existing.filter(onlyItem(item)); + + var existingData = this.item($existingOption); + var newData = $.extend(true, {}, item, existingData); + + var $newOption = this.option(newData); + + $existingOption.replaceWith($newOption); + + continue; + } + + var $option = this.option(item); + + if (item.children) { + var $children = this.convertToOptions(item.children); + + Utils.appendMany($option, $children); + } + + $options.push($option); + } + + return $options; + }; + + return ArrayAdapter; +}); + +S2.define('select2/data/ajax',[ + './array', + '../utils', + 'jquery' +], function (ArrayAdapter, Utils, $) { + function AjaxAdapter ($element, options) { + this.ajaxOptions = this._applyDefaults(options.get('ajax')); + + if (this.ajaxOptions.processResults != null) { + this.processResults = this.ajaxOptions.processResults; + } + + AjaxAdapter.__super__.constructor.call(this, $element, options); + } + + Utils.Extend(AjaxAdapter, ArrayAdapter); + + AjaxAdapter.prototype._applyDefaults = function (options) { + var defaults = { + data: function (params) { + return $.extend({}, params, { + q: params.term + }); + }, + transport: function (params, success, failure) { + var $request = $.ajax(params); + + $request.then(success); + $request.fail(failure); + + return $request; + } + }; + + return $.extend({}, defaults, options, true); + }; + + AjaxAdapter.prototype.processResults = function (results) { + return results; + }; + + AjaxAdapter.prototype.query = function (params, callback) { + var matches = []; + var self = this; + + if (this._request != null) { + // JSONP requests cannot always be aborted + if ($.isFunction(this._request.abort)) { + this._request.abort(); + } + + this._request = null; + } + + var options = $.extend({ + type: 'GET' + }, this.ajaxOptions); + + if (typeof options.url === 'function') { + options.url = options.url.call(this.$element, params); + } + + if (typeof options.data === 'function') { + options.data = options.data.call(this.$element, params); + } + + function request () { + var $request = options.transport(options, function (data) { + var results = self.processResults(data, params); + + if (self.options.get('debug') && window.console && console.error) { + // Check to make sure that the response included a `results` key. + if (!results || !results.results || !$.isArray(results.results)) { + console.error( + 'Select2: The AJAX results did not return an array in the ' + + '`results` key of the response.' + ); + } + } + + callback(results); + }, function () { + // Attempt to detect if a request was aborted + // Only works if the transport exposes a status property + if ($request.status && $request.status === '0') { + return; + } + + self.trigger('results:message', { + message: 'errorLoading' + }); + }); + + self._request = $request; + } + + if (this.ajaxOptions.delay && params.term != null) { + if (this._queryTimeout) { + window.clearTimeout(this._queryTimeout); + } + + this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); + } else { + request(); + } + }; + + return AjaxAdapter; +}); + +S2.define('select2/data/tags',[ + 'jquery' +], function ($) { + function Tags (decorated, $element, options) { + var tags = options.get('tags'); + + var createTag = options.get('createTag'); + + if (createTag !== undefined) { + this.createTag = createTag; + } + + var insertTag = options.get('insertTag'); + + if (insertTag !== undefined) { + this.insertTag = insertTag; + } + + decorated.call(this, $element, options); + + if ($.isArray(tags)) { + for (var t = 0; t < tags.length; t++) { + var tag = tags[t]; + var item = this._normalizeItem(tag); + + var $option = this.option(item); + + this.$element.append($option); + } + } + } + + Tags.prototype.query = function (decorated, params, callback) { + var self = this; + + this._removeOldTags(); + + if (params.term == null || params.page != null) { + decorated.call(this, params, callback); + return; + } + + function wrapper (obj, child) { + var data = obj.results; + + for (var i = 0; i < data.length; i++) { + var option = data[i]; + + var checkChildren = ( + option.children != null && + !wrapper({ + results: option.children + }, true) + ); + + var checkText = option.text === params.term; + + if (checkText || checkChildren) { + if (child) { + return false; + } + + obj.data = data; + callback(obj); + + return; + } + } + + if (child) { + return true; + } + + var tag = self.createTag(params); + + if (tag != null) { + var $option = self.option(tag); + $option.attr('data-select2-tag', true); + + self.addOptions([$option]); + + self.insertTag(data, tag); + } + + obj.results = data; + + callback(obj); + } + + decorated.call(this, params, wrapper); + }; + + Tags.prototype.createTag = function (decorated, params) { + var term = $.trim(params.term); + + if (term === '') { + return null; + } + + return { + id: term, + text: term + }; + }; + + Tags.prototype.insertTag = function (_, data, tag) { + data.unshift(tag); + }; + + Tags.prototype._removeOldTags = function (_) { + var tag = this._lastTag; + + var $options = this.$element.find('option[data-select2-tag]'); + + $options.each(function () { + if (this.selected) { + return; + } + + $(this).remove(); + }); + }; + + return Tags; +}); + +S2.define('select2/data/tokenizer',[ + 'jquery' +], function ($) { + function Tokenizer (decorated, $element, options) { + var tokenizer = options.get('tokenizer'); + + if (tokenizer !== undefined) { + this.tokenizer = tokenizer; + } + + decorated.call(this, $element, options); + } + + Tokenizer.prototype.bind = function (decorated, container, $container) { + decorated.call(this, container, $container); + + this.$search = container.dropdown.$search || container.selection.$search || + $container.find('.select2-search__field'); + }; + + Tokenizer.prototype.query = function (decorated, params, callback) { + var self = this; + + function createAndSelect (data) { + // Normalize the data object so we can use it for checks + var item = self._normalizeItem(data); + + // Check if the data object already exists as a tag + // Select it if it doesn't + var $existingOptions = self.$element.find('option').filter(function () { + return $(this).val() === item.id; + }); + + // If an existing option wasn't found for it, create the option + if (!$existingOptions.length) { + var $option = self.option(item); + $option.attr('data-select2-tag', true); + + self._removeOldTags(); + self.addOptions([$option]); + } + + // Select the item, now that we know there is an option for it + select(item); + } + + function select (data) { + self.trigger('select', { + data: data + }); + } + + params.term = params.term || ''; + + var tokenData = this.tokenizer(params, this.options, createAndSelect); + + if (tokenData.term !== params.term) { + // Replace the search term if we have the search box + if (this.$search.length) { + this.$search.val(tokenData.term); + this.$search.focus(); + } + + params.term = tokenData.term; + } + + decorated.call(this, params, callback); + }; + + Tokenizer.prototype.tokenizer = function (_, params, options, callback) { + var separators = options.get('tokenSeparators') || []; + var term = params.term; + var i = 0; + + var createTag = this.createTag || function (params) { + return { + id: params.term, + text: params.term + }; + }; + + while (i < term.length) { + var termChar = term[i]; + + if ($.inArray(termChar, separators) === -1) { + i++; + + continue; + } + + var part = term.substr(0, i); + var partParams = $.extend({}, params, { + term: part + }); + + var data = createTag(partParams); + + if (data == null) { + i++; + continue; + } + + callback(data); + + // Reset the term to not include the tokenized portion + term = term.substr(i + 1) || ''; + i = 0; + } + + return { + term: term + }; + }; + + return Tokenizer; +}); + +S2.define('select2/data/minimumInputLength',[ + +], function () { + function MinimumInputLength (decorated, $e, options) { + this.minimumInputLength = options.get('minimumInputLength'); + + decorated.call(this, $e, options); + } + + MinimumInputLength.prototype.query = function (decorated, params, callback) { + params.term = params.term || ''; + + if (params.term.length < this.minimumInputLength) { + this.trigger('results:message', { + message: 'inputTooShort', + args: { + minimum: this.minimumInputLength, + input: params.term, + params: params + } + }); + + return; + } + + decorated.call(this, params, callback); + }; + + return MinimumInputLength; +}); + +S2.define('select2/data/maximumInputLength',[ + +], function () { + function MaximumInputLength (decorated, $e, options) { + this.maximumInputLength = options.get('maximumInputLength'); + + decorated.call(this, $e, options); + } + + MaximumInputLength.prototype.query = function (decorated, params, callback) { + params.term = params.term || ''; + + if (this.maximumInputLength > 0 && + params.term.length > this.maximumInputLength) { + this.trigger('results:message', { + message: 'inputTooLong', + args: { + maximum: this.maximumInputLength, + input: params.term, + params: params + } + }); + + return; + } + + decorated.call(this, params, callback); + }; + + return MaximumInputLength; +}); + +S2.define('select2/data/maximumSelectionLength',[ + +], function (){ + function MaximumSelectionLength (decorated, $e, options) { + this.maximumSelectionLength = options.get('maximumSelectionLength'); + + decorated.call(this, $e, options); + } + + MaximumSelectionLength.prototype.query = + function (decorated, params, callback) { + var self = this; + + this.current(function (currentData) { + var count = currentData != null ? currentData.length : 0; + if (self.maximumSelectionLength > 0 && + count >= self.maximumSelectionLength) { + self.trigger('results:message', { + message: 'maximumSelected', + args: { + maximum: self.maximumSelectionLength + } + }); + return; + } + decorated.call(self, params, callback); + }); + }; + + return MaximumSelectionLength; +}); + +S2.define('select2/dropdown',[ + 'jquery', + './utils' +], function ($, Utils) { + function Dropdown ($element, options) { + this.$element = $element; + this.options = options; + + Dropdown.__super__.constructor.call(this); + } + + Utils.Extend(Dropdown, Utils.Observable); + + Dropdown.prototype.render = function () { + var $dropdown = $( + '' + + '' + + '' + ); + + $dropdown.attr('dir', this.options.get('dir')); + + this.$dropdown = $dropdown; + + return $dropdown; + }; + + Dropdown.prototype.bind = function () { + // Should be implemented in subclasses + }; + + Dropdown.prototype.position = function ($dropdown, $container) { + // Should be implmented in subclasses + }; + + Dropdown.prototype.destroy = function () { + // Remove the dropdown from the DOM + this.$dropdown.remove(); + }; + + return Dropdown; +}); + +S2.define('select2/dropdown/search',[ + 'jquery', + '../utils' +], function ($, Utils) { + function Search () { } + + Search.prototype.render = function (decorated) { + var $rendered = decorated.call(this); + + var $search = $( + '' + + '' + + '' + ); + + this.$searchContainer = $search; + this.$search = $search.find('input'); + + $rendered.prepend($search); + + return $rendered; + }; + + Search.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + this.$search.on('keydown', function (evt) { + self.trigger('keypress', evt); + + self._keyUpPrevented = evt.isDefaultPrevented(); + }); + + // Workaround for browsers which do not support the `input` event + // This will prevent double-triggering of events for browsers which support + // both the `keyup` and `input` events. + this.$search.on('input', function (evt) { + // Unbind the duplicated `keyup` event + $(this).off('keyup'); + }); + + this.$search.on('keyup input', function (evt) { + self.handleSearch(evt); + }); + + container.on('open', function () { + self.$search.attr('tabindex', 0); + + self.$search.focus(); + + window.setTimeout(function () { + self.$search.focus(); + }, 0); + }); + + container.on('close', function () { + self.$search.attr('tabindex', -1); + + self.$search.val(''); + }); + + container.on('focus', function () { + if (container.isOpen()) { + self.$search.focus(); + } + }); + + container.on('results:all', function (params) { + if (params.query.term == null || params.query.term === '') { + var showSearch = self.showSearch(params); + + if (showSearch) { + self.$searchContainer.removeClass('select2-search--hide'); + } else { + self.$searchContainer.addClass('select2-search--hide'); + } + } + }); + }; + + Search.prototype.handleSearch = function (evt) { + if (!this._keyUpPrevented) { + var input = this.$search.val(); + + this.trigger('query', { + term: input + }); + } + + this._keyUpPrevented = false; + }; + + Search.prototype.showSearch = function (_, params) { + return true; + }; + + return Search; +}); + +S2.define('select2/dropdown/hidePlaceholder',[ + +], function () { + function HidePlaceholder (decorated, $element, options, dataAdapter) { + this.placeholder = this.normalizePlaceholder(options.get('placeholder')); + + decorated.call(this, $element, options, dataAdapter); + } + + HidePlaceholder.prototype.append = function (decorated, data) { + data.results = this.removePlaceholder(data.results); + + decorated.call(this, data); + }; + + HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { + if (typeof placeholder === 'string') { + placeholder = { + id: '', + text: placeholder + }; + } + + return placeholder; + }; + + HidePlaceholder.prototype.removePlaceholder = function (_, data) { + var modifiedData = data.slice(0); + + for (var d = data.length - 1; d >= 0; d--) { + var item = data[d]; + + if (this.placeholder.id === item.id) { + modifiedData.splice(d, 1); + } + } + + return modifiedData; + }; + + return HidePlaceholder; +}); + +S2.define('select2/dropdown/infiniteScroll',[ + 'jquery' +], function ($) { + function InfiniteScroll (decorated, $element, options, dataAdapter) { + this.lastParams = {}; + + decorated.call(this, $element, options, dataAdapter); + + this.$loadingMore = this.createLoadingMore(); + this.loading = false; + } + + InfiniteScroll.prototype.append = function (decorated, data) { + this.$loadingMore.remove(); + this.loading = false; + + decorated.call(this, data); + + if (this.showLoadingMore(data)) { + this.$results.append(this.$loadingMore); + } + }; + + InfiniteScroll.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('query', function (params) { + self.lastParams = params; + self.loading = true; + }); + + container.on('query:append', function (params) { + self.lastParams = params; + self.loading = true; + }); + + this.$results.on('scroll', function () { + var isLoadMoreVisible = $.contains( + document.documentElement, + self.$loadingMore[0] + ); + + if (self.loading || !isLoadMoreVisible) { + return; + } + + var currentOffset = self.$results.offset().top + + self.$results.outerHeight(false); + var loadingMoreOffset = self.$loadingMore.offset().top + + self.$loadingMore.outerHeight(false); + + if (currentOffset + 50 >= loadingMoreOffset) { + self.loadMore(); + } + }); + }; + + InfiniteScroll.prototype.loadMore = function () { + this.loading = true; + + var params = $.extend({}, {page: 1}, this.lastParams); + + params.page++; + + this.trigger('query:append', params); + }; + + InfiniteScroll.prototype.showLoadingMore = function (_, data) { + return data.pagination && data.pagination.more; + }; + + InfiniteScroll.prototype.createLoadingMore = function () { + var $option = $( + '
            • ' + ); + + var message = this.options.get('translations').get('loadingMore'); + + $option.html(message(this.lastParams)); + + return $option; + }; + + return InfiniteScroll; +}); + +S2.define('select2/dropdown/attachBody',[ + 'jquery', + '../utils' +], function ($, Utils) { + function AttachBody (decorated, $element, options) { + this.$dropdownParent = options.get('dropdownParent') || $(document.body); + + decorated.call(this, $element, options); + } + + AttachBody.prototype.bind = function (decorated, container, $container) { + var self = this; + + var setupResultsEvents = false; + + decorated.call(this, container, $container); + + container.on('open', function () { + self._showDropdown(); + self._attachPositioningHandler(container); + + if (!setupResultsEvents) { + setupResultsEvents = true; + + container.on('results:all', function () { + self._positionDropdown(); + self._resizeDropdown(); + }); + + container.on('results:append', function () { + self._positionDropdown(); + self._resizeDropdown(); + }); + } + }); + + container.on('close', function () { + self._hideDropdown(); + self._detachPositioningHandler(container); + }); + + this.$dropdownContainer.on('mousedown', function (evt) { + evt.stopPropagation(); + }); + }; + + AttachBody.prototype.destroy = function (decorated) { + decorated.call(this); + + this.$dropdownContainer.remove(); + }; + + AttachBody.prototype.position = function (decorated, $dropdown, $container) { + // Clone all of the container classes + $dropdown.attr('class', $container.attr('class')); + + $dropdown.removeClass('select2'); + $dropdown.addClass('select2-container--open'); + + $dropdown.css({ + position: 'absolute', + top: -999999 + }); + + this.$container = $container; + }; + + AttachBody.prototype.render = function (decorated) { + var $container = $(''); + + var $dropdown = decorated.call(this); + $container.append($dropdown); + + this.$dropdownContainer = $container; + + return $container; + }; + + AttachBody.prototype._hideDropdown = function (decorated) { + this.$dropdownContainer.detach(); + }; + + AttachBody.prototype._attachPositioningHandler = + function (decorated, container) { + var self = this; + + var scrollEvent = 'scroll.select2.' + container.id; + var resizeEvent = 'resize.select2.' + container.id; + var orientationEvent = 'orientationchange.select2.' + container.id; + + var $watchers = this.$container.parents().filter(Utils.hasScroll); + $watchers.each(function () { + $(this).data('select2-scroll-position', { + x: $(this).scrollLeft(), + y: $(this).scrollTop() + }); + }); + + $watchers.on(scrollEvent, function (ev) { + var position = $(this).data('select2-scroll-position'); + $(this).scrollTop(position.y); + }); + + $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, + function (e) { + self._positionDropdown(); + self._resizeDropdown(); + }); + }; + + AttachBody.prototype._detachPositioningHandler = + function (decorated, container) { + var scrollEvent = 'scroll.select2.' + container.id; + var resizeEvent = 'resize.select2.' + container.id; + var orientationEvent = 'orientationchange.select2.' + container.id; + + var $watchers = this.$container.parents().filter(Utils.hasScroll); + $watchers.off(scrollEvent); + + $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); + }; + + AttachBody.prototype._positionDropdown = function () { + var $window = $(window); + + var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); + var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); + + var newDirection = null; + + var offset = this.$container.offset(); + + offset.bottom = offset.top + this.$container.outerHeight(false); + + var container = { + height: this.$container.outerHeight(false) + }; + + container.top = offset.top; + container.bottom = offset.top + container.height; + + var dropdown = { + height: this.$dropdown.outerHeight(false) + }; + + var viewport = { + top: $window.scrollTop(), + bottom: $window.scrollTop() + $window.height() + }; + + var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); + var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); + + var css = { + left: offset.left, + top: container.bottom + }; + + // Determine what the parent element is to use for calciulating the offset + var $offsetParent = this.$dropdownParent; + + // For statically positoned elements, we need to get the element + // that is determining the offset + if ($offsetParent.css('position') === 'static') { + $offsetParent = $offsetParent.offsetParent(); + } + + var parentOffset = $offsetParent.offset(); + + css.top -= parentOffset.top; + css.left -= parentOffset.left; + + if (!isCurrentlyAbove && !isCurrentlyBelow) { + newDirection = 'below'; + } + + if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { + newDirection = 'above'; + } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { + newDirection = 'below'; + } + + if (newDirection == 'above' || + (isCurrentlyAbove && newDirection !== 'below')) { + css.top = container.top - parentOffset.top - dropdown.height; + } + + if (newDirection != null) { + this.$dropdown + .removeClass('select2-dropdown--below select2-dropdown--above') + .addClass('select2-dropdown--' + newDirection); + this.$container + .removeClass('select2-container--below select2-container--above') + .addClass('select2-container--' + newDirection); + } + + this.$dropdownContainer.css(css); + }; + + AttachBody.prototype._resizeDropdown = function () { + var css = { + width: this.$container.outerWidth(false) + 'px' + }; + + if (this.options.get('dropdownAutoWidth')) { + css.minWidth = css.width; + css.position = 'relative'; + css.width = 'auto'; + } + + this.$dropdown.css(css); + }; + + AttachBody.prototype._showDropdown = function (decorated) { + this.$dropdownContainer.appendTo(this.$dropdownParent); + + this._positionDropdown(); + this._resizeDropdown(); + }; + + return AttachBody; +}); + +S2.define('select2/dropdown/minimumResultsForSearch',[ + +], function () { + function countResults (data) { + var count = 0; + + for (var d = 0; d < data.length; d++) { + var item = data[d]; + + if (item.children) { + count += countResults(item.children); + } else { + count++; + } + } + + return count; + } + + function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { + this.minimumResultsForSearch = options.get('minimumResultsForSearch'); + + if (this.minimumResultsForSearch < 0) { + this.minimumResultsForSearch = Infinity; + } + + decorated.call(this, $element, options, dataAdapter); + } + + MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { + if (countResults(params.data.results) < this.minimumResultsForSearch) { + return false; + } + + return decorated.call(this, params); + }; + + return MinimumResultsForSearch; +}); + +S2.define('select2/dropdown/selectOnClose',[ + +], function () { + function SelectOnClose () { } + + SelectOnClose.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('close', function (params) { + self._handleSelectOnClose(params); + }); + }; + + SelectOnClose.prototype._handleSelectOnClose = function (_, params) { + if (params && params.originalSelect2Event != null) { + var event = params.originalSelect2Event; + + // Don't select an item if the close event was triggered from a select or + // unselect event + if (event._type === 'select' || event._type === 'unselect') { + return; + } + } + + var $highlightedResults = this.getHighlightedResults(); + + // Only select highlighted results + if ($highlightedResults.length < 1) { + return; + } + + var data = $highlightedResults.data('data'); + + // Don't re-select already selected resulte + if ( + (data.element != null && data.element.selected) || + (data.element == null && data.selected) + ) { + return; + } + + this.trigger('select', { + data: data + }); + }; + + return SelectOnClose; +}); + +S2.define('select2/dropdown/closeOnSelect',[ + +], function () { + function CloseOnSelect () { } + + CloseOnSelect.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('select', function (evt) { + self._selectTriggered(evt); + }); + + container.on('unselect', function (evt) { + self._selectTriggered(evt); + }); + }; + + CloseOnSelect.prototype._selectTriggered = function (_, evt) { + var originalEvent = evt.originalEvent; + + // Don't close if the control key is being held + if (originalEvent && originalEvent.ctrlKey) { + return; + } + + this.trigger('close', { + originalEvent: originalEvent, + originalSelect2Event: evt + }); + }; + + return CloseOnSelect; +}); + +S2.define('select2/i18n/en',[],function () { + // English + return { + errorLoading: function () { + return 'The results could not be loaded.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Please delete ' + overChars + ' character'; + + if (overChars != 1) { + message += 's'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Please enter ' + remainingChars + ' or more characters'; + + return message; + }, + loadingMore: function () { + return 'Loading more results…'; + }, + maximumSelected: function (args) { + var message = 'You can only select ' + args.maximum + ' item'; + + if (args.maximum != 1) { + message += 's'; + } + + return message; + }, + noResults: function () { + return 'No results found'; + }, + searching: function () { + return 'Searching…'; + } + }; +}); + +S2.define('select2/defaults',[ + 'jquery', + 'require', + + './results', + + './selection/single', + './selection/multiple', + './selection/placeholder', + './selection/allowClear', + './selection/search', + './selection/eventRelay', + + './utils', + './translation', + './diacritics', + + './data/select', + './data/array', + './data/ajax', + './data/tags', + './data/tokenizer', + './data/minimumInputLength', + './data/maximumInputLength', + './data/maximumSelectionLength', + + './dropdown', + './dropdown/search', + './dropdown/hidePlaceholder', + './dropdown/infiniteScroll', + './dropdown/attachBody', + './dropdown/minimumResultsForSearch', + './dropdown/selectOnClose', + './dropdown/closeOnSelect', + + './i18n/en' +], function ($, require, + + ResultsList, + + SingleSelection, MultipleSelection, Placeholder, AllowClear, + SelectionSearch, EventRelay, + + Utils, Translation, DIACRITICS, + + SelectData, ArrayData, AjaxData, Tags, Tokenizer, + MinimumInputLength, MaximumInputLength, MaximumSelectionLength, + + Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, + AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, + + EnglishTranslation) { + function Defaults () { + this.reset(); + } + + Defaults.prototype.apply = function (options) { + options = $.extend(true, {}, this.defaults, options); + + if (options.dataAdapter == null) { + if (options.ajax != null) { + options.dataAdapter = AjaxData; + } else if (options.data != null) { + options.dataAdapter = ArrayData; + } else { + options.dataAdapter = SelectData; + } + + if (options.minimumInputLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MinimumInputLength + ); + } + + if (options.maximumInputLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MaximumInputLength + ); + } + + if (options.maximumSelectionLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MaximumSelectionLength + ); + } + + if (options.tags) { + options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); + } + + if (options.tokenSeparators != null || options.tokenizer != null) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + Tokenizer + ); + } + + if (options.query != null) { + var Query = require(options.amdBase + 'compat/query'); + + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + Query + ); + } + + if (options.initSelection != null) { + var InitSelection = require(options.amdBase + 'compat/initSelection'); + + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + InitSelection + ); + } + } + + if (options.resultsAdapter == null) { + options.resultsAdapter = ResultsList; + + if (options.ajax != null) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + InfiniteScroll + ); + } + + if (options.placeholder != null) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + HidePlaceholder + ); + } + + if (options.selectOnClose) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + SelectOnClose + ); + } + } + + if (options.dropdownAdapter == null) { + if (options.multiple) { + options.dropdownAdapter = Dropdown; + } else { + var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); + + options.dropdownAdapter = SearchableDropdown; + } + + if (options.minimumResultsForSearch !== 0) { + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + MinimumResultsForSearch + ); + } + + if (options.closeOnSelect) { + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + CloseOnSelect + ); + } + + if ( + options.dropdownCssClass != null || + options.dropdownCss != null || + options.adaptDropdownCssClass != null + ) { + var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); + + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + DropdownCSS + ); + } + + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + AttachBody + ); + } + + if (options.selectionAdapter == null) { + if (options.multiple) { + options.selectionAdapter = MultipleSelection; + } else { + options.selectionAdapter = SingleSelection; + } + + // Add the placeholder mixin if a placeholder was specified + if (options.placeholder != null) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + Placeholder + ); + } + + if (options.allowClear) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + AllowClear + ); + } + + if (options.multiple) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + SelectionSearch + ); + } + + if ( + options.containerCssClass != null || + options.containerCss != null || + options.adaptContainerCssClass != null + ) { + var ContainerCSS = require(options.amdBase + 'compat/containerCss'); + + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + ContainerCSS + ); + } + + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + EventRelay + ); + } + + if (typeof options.language === 'string') { + // Check if the language is specified with a region + if (options.language.indexOf('-') > 0) { + // Extract the region information if it is included + var languageParts = options.language.split('-'); + var baseLanguage = languageParts[0]; + + options.language = [options.language, baseLanguage]; + } else { + options.language = [options.language]; + } + } + + if ($.isArray(options.language)) { + var languages = new Translation(); + options.language.push('en'); + + var languageNames = options.language; + + for (var l = 0; l < languageNames.length; l++) { + var name = languageNames[l]; + var language = {}; + + try { + // Try to load it with the original name + language = Translation.loadPath(name); + } catch (e) { + try { + // If we couldn't load it, check if it wasn't the full path + name = this.defaults.amdLanguageBase + name; + language = Translation.loadPath(name); + } catch (ex) { + // The translation could not be loaded at all. Sometimes this is + // because of a configuration problem, other times this can be + // because of how Select2 helps load all possible translation files. + if (options.debug && window.console && console.warn) { + console.warn( + 'Select2: The language file for "' + name + '" could not be ' + + 'automatically loaded. A fallback will be used instead.' + ); + } + + continue; + } + } + + languages.extend(language); + } + + options.translations = languages; + } else { + var baseTranslation = Translation.loadPath( + this.defaults.amdLanguageBase + 'en' + ); + var customTranslation = new Translation(options.language); + + customTranslation.extend(baseTranslation); + + options.translations = customTranslation; + } + + return options; + }; + + Defaults.prototype.reset = function () { + function stripDiacritics (text) { + // Used 'uni range + named function' from http://jsperf.com/diacritics/18 + function match(a) { + return DIACRITICS[a] || a; + } + + return text.replace(/[^\u0000-\u007E]/g, match); + } + + function matcher (params, data) { + // Always return the object if there is nothing to compare + if ($.trim(params.term) === '') { + return data; + } + + // Do a recursive check for options with children + if (data.children && data.children.length > 0) { + // Clone the data object if there are children + // This is required as we modify the object to remove any non-matches + var match = $.extend(true, {}, data); + + // Check each child of the option + for (var c = data.children.length - 1; c >= 0; c--) { + var child = data.children[c]; + + var matches = matcher(params, child); + + // If there wasn't a match, remove the object in the array + if (matches == null) { + match.children.splice(c, 1); + } + } + + // If any children matched, return the new object + if (match.children.length > 0) { + return match; + } + + // If there were no matching children, check just the plain object + return matcher(params, match); + } + + var original = stripDiacritics(data.text).toUpperCase(); + var term = stripDiacritics(params.term).toUpperCase(); + + // Check if the text contains the term + if (original.indexOf(term) > -1) { + return data; + } + + // If it doesn't contain the term, don't return anything + return null; + } + + this.defaults = { + amdBase: './', + amdLanguageBase: './i18n/', + closeOnSelect: true, + debug: false, + dropdownAutoWidth: false, + escapeMarkup: Utils.escapeMarkup, + language: EnglishTranslation, + matcher: matcher, + minimumInputLength: 0, + maximumInputLength: 0, + maximumSelectionLength: 0, + minimumResultsForSearch: 0, + selectOnClose: false, + sorter: function (data) { + return data; + }, + templateResult: function (result) { + return result.text; + }, + templateSelection: function (selection) { + return selection.text; + }, + theme: 'default', + width: 'resolve' + }; + }; + + Defaults.prototype.set = function (key, value) { + var camelKey = $.camelCase(key); + + var data = {}; + data[camelKey] = value; + + var convertedData = Utils._convertData(data); + + $.extend(this.defaults, convertedData); + }; + + var defaults = new Defaults(); + + return defaults; +}); + +S2.define('select2/options',[ + 'require', + 'jquery', + './defaults', + './utils' +], function (require, $, Defaults, Utils) { + function Options (options, $element) { + this.options = options; + + if ($element != null) { + this.fromElement($element); + } + + this.options = Defaults.apply(this.options); + + if ($element && $element.is('input')) { + var InputCompat = require(this.get('amdBase') + 'compat/inputData'); + + this.options.dataAdapter = Utils.Decorate( + this.options.dataAdapter, + InputCompat + ); + } + } + + Options.prototype.fromElement = function ($e) { + var excludedData = ['select2']; + + if (this.options.multiple == null) { + this.options.multiple = $e.prop('multiple'); + } + + if (this.options.disabled == null) { + this.options.disabled = $e.prop('disabled'); + } + + if (this.options.language == null) { + if ($e.prop('lang')) { + this.options.language = $e.prop('lang').toLowerCase(); + } else if ($e.closest('[lang]').prop('lang')) { + this.options.language = $e.closest('[lang]').prop('lang'); + } + } + + if (this.options.dir == null) { + if ($e.prop('dir')) { + this.options.dir = $e.prop('dir'); + } else if ($e.closest('[dir]').prop('dir')) { + this.options.dir = $e.closest('[dir]').prop('dir'); + } else { + this.options.dir = 'ltr'; + } + } + + $e.prop('disabled', this.options.disabled); + $e.prop('multiple', this.options.multiple); + + if ($e.data('select2Tags')) { + if (this.options.debug && window.console && console.warn) { + console.warn( + 'Select2: The `data-select2-tags` attribute has been changed to ' + + 'use the `data-data` and `data-tags="true"` attributes and will be ' + + 'removed in future versions of Select2.' + ); + } + + $e.data('data', $e.data('select2Tags')); + $e.data('tags', true); + } + + if ($e.data('ajaxUrl')) { + if (this.options.debug && window.console && console.warn) { + console.warn( + 'Select2: The `data-ajax-url` attribute has been changed to ' + + '`data-ajax--url` and support for the old attribute will be removed' + + ' in future versions of Select2.' + ); + } + + $e.attr('ajax--url', $e.data('ajaxUrl')); + $e.data('ajax--url', $e.data('ajaxUrl')); + } + + var dataset = {}; + + // Prefer the element's `dataset` attribute if it exists + // jQuery 1.x does not correctly handle data attributes with multiple dashes + if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { + dataset = $.extend(true, {}, $e[0].dataset, $e.data()); + } else { + dataset = $e.data(); + } + + var data = $.extend(true, {}, dataset); + + data = Utils._convertData(data); + + for (var key in data) { + if ($.inArray(key, excludedData) > -1) { + continue; + } + + if ($.isPlainObject(this.options[key])) { + $.extend(this.options[key], data[key]); + } else { + this.options[key] = data[key]; + } + } + + return this; + }; + + Options.prototype.get = function (key) { + return this.options[key]; + }; + + Options.prototype.set = function (key, val) { + this.options[key] = val; + }; + + return Options; +}); + +S2.define('select2/core',[ + 'jquery', + './options', + './utils', + './keys' +], function ($, Options, Utils, KEYS) { + var Select2 = function ($element, options) { + if ($element.data('select2') != null) { + $element.data('select2').destroy(); + } + + this.$element = $element; + + this.id = this._generateId($element); + + options = options || {}; + + this.options = new Options(options, $element); + + Select2.__super__.constructor.call(this); + + // Set up the tabindex + + var tabindex = $element.attr('tabindex') || 0; + $element.data('old-tabindex', tabindex); + $element.attr('tabindex', '-1'); + + // Set up containers and adapters + + var DataAdapter = this.options.get('dataAdapter'); + this.dataAdapter = new DataAdapter($element, this.options); + + var $container = this.render(); + + this._placeContainer($container); + + var SelectionAdapter = this.options.get('selectionAdapter'); + this.selection = new SelectionAdapter($element, this.options); + this.$selection = this.selection.render(); + + this.selection.position(this.$selection, $container); + + var DropdownAdapter = this.options.get('dropdownAdapter'); + this.dropdown = new DropdownAdapter($element, this.options); + this.$dropdown = this.dropdown.render(); + + this.dropdown.position(this.$dropdown, $container); + + var ResultsAdapter = this.options.get('resultsAdapter'); + this.results = new ResultsAdapter($element, this.options, this.dataAdapter); + this.$results = this.results.render(); + + this.results.position(this.$results, this.$dropdown); + + // Bind events + + var self = this; + + // Bind the container to all of the adapters + this._bindAdapters(); + + // Register any DOM event handlers + this._registerDomEvents(); + + // Register any internal event handlers + this._registerDataEvents(); + this._registerSelectionEvents(); + this._registerDropdownEvents(); + this._registerResultsEvents(); + this._registerEvents(); + + // Set the initial state + this.dataAdapter.current(function (initialData) { + self.trigger('selection:update', { + data: initialData + }); + }); + + // Hide the original select + $element.addClass('select2-hidden-accessible'); + $element.attr('aria-hidden', 'true'); + + // Synchronize any monitored attributes + this._syncAttributes(); + + $element.data('select2', this); + }; + + Utils.Extend(Select2, Utils.Observable); + + Select2.prototype._generateId = function ($element) { + var id = ''; + + if ($element.attr('id') != null) { + id = $element.attr('id'); + } else if ($element.attr('name') != null) { + id = $element.attr('name') + '-' + Utils.generateChars(2); + } else { + id = Utils.generateChars(4); + } + + id = id.replace(/(:|\.|\[|\]|,)/g, ''); + id = 'select2-' + id; + + return id; + }; + + Select2.prototype._placeContainer = function ($container) { + $container.insertAfter(this.$element); + + var width = this._resolveWidth(this.$element, this.options.get('width')); + + if (width != null) { + $container.css('width', width); + } + }; + + Select2.prototype._resolveWidth = function ($element, method) { + var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; + + if (method == 'resolve') { + var styleWidth = this._resolveWidth($element, 'style'); + + if (styleWidth != null) { + return styleWidth; + } + + return this._resolveWidth($element, 'element'); + } + + if (method == 'element') { + var elementWidth = $element.outerWidth(false); + + if (elementWidth <= 0) { + return 'auto'; + } + + return elementWidth + 'px'; + } + + if (method == 'style') { + var style = $element.attr('style'); + + if (typeof(style) !== 'string') { + return null; + } + + var attrs = style.split(';'); + + for (var i = 0, l = attrs.length; i < l; i = i + 1) { + var attr = attrs[i].replace(/\s/g, ''); + var matches = attr.match(WIDTH); + + if (matches !== null && matches.length >= 1) { + return matches[1]; + } + } + + return null; + } + + return method; + }; + + Select2.prototype._bindAdapters = function () { + this.dataAdapter.bind(this, this.$container); + this.selection.bind(this, this.$container); + + this.dropdown.bind(this, this.$container); + this.results.bind(this, this.$container); + }; + + Select2.prototype._registerDomEvents = function () { + var self = this; + + this.$element.on('change.select2', function () { + self.dataAdapter.current(function (data) { + self.trigger('selection:update', { + data: data + }); + }); + }); + + this.$element.on('focus.select2', function (evt) { + self.trigger('focus', evt); + }); + + this._syncA = Utils.bind(this._syncAttributes, this); + this._syncS = Utils.bind(this._syncSubtree, this); + + if (this.$element[0].attachEvent) { + this.$element[0].attachEvent('onpropertychange', this._syncA); + } + + var observer = window.MutationObserver || + window.WebKitMutationObserver || + window.MozMutationObserver + ; + + if (observer != null) { + this._observer = new observer(function (mutations) { + $.each(mutations, self._syncA); + $.each(mutations, self._syncS); + }); + this._observer.observe(this.$element[0], { + attributes: true, + childList: true, + subtree: false + }); + } else if (this.$element[0].addEventListener) { + this.$element[0].addEventListener( + 'DOMAttrModified', + self._syncA, + false + ); + this.$element[0].addEventListener( + 'DOMNodeInserted', + self._syncS, + false + ); + this.$element[0].addEventListener( + 'DOMNodeRemoved', + self._syncS, + false + ); + } + }; + + Select2.prototype._registerDataEvents = function () { + var self = this; + + this.dataAdapter.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerSelectionEvents = function () { + var self = this; + var nonRelayEvents = ['toggle', 'focus']; + + this.selection.on('toggle', function () { + self.toggleDropdown(); + }); + + this.selection.on('focus', function (params) { + self.focus(params); + }); + + this.selection.on('*', function (name, params) { + if ($.inArray(name, nonRelayEvents) !== -1) { + return; + } + + self.trigger(name, params); + }); + }; + + Select2.prototype._registerDropdownEvents = function () { + var self = this; + + this.dropdown.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerResultsEvents = function () { + var self = this; + + this.results.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerEvents = function () { + var self = this; + + this.on('open', function () { + self.$container.addClass('select2-container--open'); + }); + + this.on('close', function () { + self.$container.removeClass('select2-container--open'); + }); + + this.on('enable', function () { + self.$container.removeClass('select2-container--disabled'); + }); + + this.on('disable', function () { + self.$container.addClass('select2-container--disabled'); + }); + + this.on('blur', function () { + self.$container.removeClass('select2-container--focus'); + }); + + this.on('query', function (params) { + if (!self.isOpen()) { + self.trigger('open', {}); + } + + this.dataAdapter.query(params, function (data) { + self.trigger('results:all', { + data: data, + query: params + }); + }); + }); + + this.on('query:append', function (params) { + this.dataAdapter.query(params, function (data) { + self.trigger('results:append', { + data: data, + query: params + }); + }); + }); + + this.on('keypress', function (evt) { + var key = evt.which; + + if (self.isOpen()) { + if (key === KEYS.ESC || key === KEYS.TAB || + (key === KEYS.UP && evt.altKey)) { + self.close(); + + evt.preventDefault(); + } else if (key === KEYS.ENTER) { + self.trigger('results:select', {}); + + evt.preventDefault(); + } else if ((key === KEYS.SPACE && evt.ctrlKey)) { + self.trigger('results:toggle', {}); + + evt.preventDefault(); + } else if (key === KEYS.UP) { + self.trigger('results:previous', {}); + + evt.preventDefault(); + } else if (key === KEYS.DOWN) { + self.trigger('results:next', {}); + + evt.preventDefault(); + } + } else { + if (key === KEYS.ENTER || key === KEYS.SPACE || + (key === KEYS.DOWN && evt.altKey)) { + self.open(); + + evt.preventDefault(); + } + } + }); + }; + + Select2.prototype._syncAttributes = function () { + this.options.set('disabled', this.$element.prop('disabled')); + + if (this.options.get('disabled')) { + if (this.isOpen()) { + this.close(); + } + + this.trigger('disable', {}); + } else { + this.trigger('enable', {}); + } + }; + + Select2.prototype._syncSubtree = function (evt, mutations) { + var changed = false; + var self = this; + + // Ignore any mutation events raised for elements that aren't options or + // optgroups. This handles the case when the select element is destroyed + if ( + evt && evt.target && ( + evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP' + ) + ) { + return; + } + + if (!mutations) { + // If mutation events aren't supported, then we can only assume that the + // change affected the selections + changed = true; + } else if (mutations.addedNodes && mutations.addedNodes.length > 0) { + for (var n = 0; n < mutations.addedNodes.length; n++) { + var node = mutations.addedNodes[n]; + + if (node.selected) { + changed = true; + } + } + } else if (mutations.removedNodes && mutations.removedNodes.length > 0) { + changed = true; + } + + // Only re-pull the data if we think there is a change + if (changed) { + this.dataAdapter.current(function (currentData) { + self.trigger('selection:update', { + data: currentData + }); + }); + } + }; + + /** + * Override the trigger method to automatically trigger pre-events when + * there are events that can be prevented. + */ + Select2.prototype.trigger = function (name, args) { + var actualTrigger = Select2.__super__.trigger; + var preTriggerMap = { + 'open': 'opening', + 'close': 'closing', + 'select': 'selecting', + 'unselect': 'unselecting' + }; + + if (args === undefined) { + args = {}; + } + + if (name in preTriggerMap) { + var preTriggerName = preTriggerMap[name]; + var preTriggerArgs = { + prevented: false, + name: name, + args: args + }; + + actualTrigger.call(this, preTriggerName, preTriggerArgs); + + if (preTriggerArgs.prevented) { + args.prevented = true; + + return; + } + } + + actualTrigger.call(this, name, args); + }; + + Select2.prototype.toggleDropdown = function () { + if (this.options.get('disabled')) { + return; + } + + if (this.isOpen()) { + this.close(); + } else { + this.open(); + } + }; + + Select2.prototype.open = function () { + if (this.isOpen()) { + return; + } + + this.trigger('query', {}); + }; + + Select2.prototype.close = function () { + if (!this.isOpen()) { + return; + } + + this.trigger('close', {}); + }; + + Select2.prototype.isOpen = function () { + return this.$container.hasClass('select2-container--open'); + }; + + Select2.prototype.hasFocus = function () { + return this.$container.hasClass('select2-container--focus'); + }; + + Select2.prototype.focus = function (data) { + // No need to re-trigger focus events if we are already focused + if (this.hasFocus()) { + return; + } + + this.$container.addClass('select2-container--focus'); + this.trigger('focus', {}); + }; + + Select2.prototype.enable = function (args) { + if (this.options.get('debug') && window.console && console.warn) { + console.warn( + 'Select2: The `select2("enable")` method has been deprecated and will' + + ' be removed in later Select2 versions. Use $element.prop("disabled")' + + ' instead.' + ); + } + + if (args == null || args.length === 0) { + args = [true]; + } + + var disabled = !args[0]; + + this.$element.prop('disabled', disabled); + }; + + Select2.prototype.data = function () { + if (this.options.get('debug') && + arguments.length > 0 && window.console && console.warn) { + console.warn( + 'Select2: Data can no longer be set using `select2("data")`. You ' + + 'should consider setting the value instead using `$element.val()`.' + ); + } + + var data = []; + + this.dataAdapter.current(function (currentData) { + data = currentData; + }); + + return data; + }; + + Select2.prototype.val = function (args) { + if (this.options.get('debug') && window.console && console.warn) { + console.warn( + 'Select2: The `select2("val")` method has been deprecated and will be' + + ' removed in later Select2 versions. Use $element.val() instead.' + ); + } + + if (args == null || args.length === 0) { + return this.$element.val(); + } + + var newVal = args[0]; + + if ($.isArray(newVal)) { + newVal = $.map(newVal, function (obj) { + return obj.toString(); + }); + } + + this.$element.val(newVal).trigger('change'); + }; + + Select2.prototype.destroy = function () { + this.$container.remove(); + + if (this.$element[0].detachEvent) { + this.$element[0].detachEvent('onpropertychange', this._syncA); + } + + if (this._observer != null) { + this._observer.disconnect(); + this._observer = null; + } else if (this.$element[0].removeEventListener) { + this.$element[0] + .removeEventListener('DOMAttrModified', this._syncA, false); + this.$element[0] + .removeEventListener('DOMNodeInserted', this._syncS, false); + this.$element[0] + .removeEventListener('DOMNodeRemoved', this._syncS, false); + } + + this._syncA = null; + this._syncS = null; + + this.$element.off('.select2'); + this.$element.attr('tabindex', this.$element.data('old-tabindex')); + + this.$element.removeClass('select2-hidden-accessible'); + this.$element.attr('aria-hidden', 'false'); + this.$element.removeData('select2'); + + this.dataAdapter.destroy(); + this.selection.destroy(); + this.dropdown.destroy(); + this.results.destroy(); + + this.dataAdapter = null; + this.selection = null; + this.dropdown = null; + this.results = null; + }; + + Select2.prototype.render = function () { + var $container = $( + '' + + '' + + '' + + '' + ); + + $container.attr('dir', this.options.get('dir')); + + this.$container = $container; + + this.$container.addClass('select2-container--' + this.options.get('theme')); + + $container.data('element', this.$element); + + return $container; + }; + + return Select2; +}); + +S2.define('select2/compat/utils',[ + 'jquery' +], function ($) { + function syncCssClasses ($dest, $src, adapter) { + var classes, replacements = [], adapted; + + classes = $.trim($dest.attr('class')); + + if (classes) { + classes = '' + classes; // for IE which returns object + + $(classes.split(/\s+/)).each(function () { + // Save all Select2 classes + if (this.indexOf('select2-') === 0) { + replacements.push(this); + } + }); + } + + classes = $.trim($src.attr('class')); + + if (classes) { + classes = '' + classes; // for IE which returns object + + $(classes.split(/\s+/)).each(function () { + // Only adapt non-Select2 classes + if (this.indexOf('select2-') !== 0) { + adapted = adapter(this); + + if (adapted != null) { + replacements.push(adapted); + } + } + }); + } + + $dest.attr('class', replacements.join(' ')); + } + + return { + syncCssClasses: syncCssClasses + }; +}); + +S2.define('select2/compat/containerCss',[ + 'jquery', + './utils' +], function ($, CompatUtils) { + // No-op CSS adapter that discards all classes by default + function _containerAdapter (clazz) { + return null; + } + + function ContainerCSS () { } + + ContainerCSS.prototype.render = function (decorated) { + var $container = decorated.call(this); + + var containerCssClass = this.options.get('containerCssClass') || ''; + + if ($.isFunction(containerCssClass)) { + containerCssClass = containerCssClass(this.$element); + } + + var containerCssAdapter = this.options.get('adaptContainerCssClass'); + containerCssAdapter = containerCssAdapter || _containerAdapter; + + if (containerCssClass.indexOf(':all:') !== -1) { + containerCssClass = containerCssClass.replace(':all:', ''); + + var _cssAdapter = containerCssAdapter; + + containerCssAdapter = function (clazz) { + var adapted = _cssAdapter(clazz); + + if (adapted != null) { + // Append the old one along with the adapted one + return adapted + ' ' + clazz; + } + + return clazz; + }; + } + + var containerCss = this.options.get('containerCss') || {}; + + if ($.isFunction(containerCss)) { + containerCss = containerCss(this.$element); + } + + CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter); + + $container.css(containerCss); + $container.addClass(containerCssClass); + + return $container; + }; + + return ContainerCSS; +}); + +S2.define('select2/compat/dropdownCss',[ + 'jquery', + './utils' +], function ($, CompatUtils) { + // No-op CSS adapter that discards all classes by default + function _dropdownAdapter (clazz) { + return null; + } + + function DropdownCSS () { } + + DropdownCSS.prototype.render = function (decorated) { + var $dropdown = decorated.call(this); + + var dropdownCssClass = this.options.get('dropdownCssClass') || ''; + + if ($.isFunction(dropdownCssClass)) { + dropdownCssClass = dropdownCssClass(this.$element); + } + + var dropdownCssAdapter = this.options.get('adaptDropdownCssClass'); + dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter; + + if (dropdownCssClass.indexOf(':all:') !== -1) { + dropdownCssClass = dropdownCssClass.replace(':all:', ''); + + var _cssAdapter = dropdownCssAdapter; + + dropdownCssAdapter = function (clazz) { + var adapted = _cssAdapter(clazz); + + if (adapted != null) { + // Append the old one along with the adapted one + return adapted + ' ' + clazz; + } + + return clazz; + }; + } + + var dropdownCss = this.options.get('dropdownCss') || {}; + + if ($.isFunction(dropdownCss)) { + dropdownCss = dropdownCss(this.$element); + } + + CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter); + + $dropdown.css(dropdownCss); + $dropdown.addClass(dropdownCssClass); + + return $dropdown; + }; + + return DropdownCSS; +}); + +S2.define('select2/compat/initSelection',[ + 'jquery' +], function ($) { + function InitSelection (decorated, $element, options) { + if (options.get('debug') && window.console && console.warn) { + console.warn( + 'Select2: The `initSelection` option has been deprecated in favor' + + ' of a custom data adapter that overrides the `current` method. ' + + 'This method is now called multiple times instead of a single ' + + 'time when the instance is initialized. Support will be removed ' + + 'for the `initSelection` option in future versions of Select2' + ); + } + + this.initSelection = options.get('initSelection'); + this._isInitialized = false; + + decorated.call(this, $element, options); + } + + InitSelection.prototype.current = function (decorated, callback) { + var self = this; + + if (this._isInitialized) { + decorated.call(this, callback); + + return; + } + + this.initSelection.call(null, this.$element, function (data) { + self._isInitialized = true; + + if (!$.isArray(data)) { + data = [data]; + } + + callback(data); + }); + }; + + return InitSelection; +}); + +S2.define('select2/compat/inputData',[ + 'jquery' +], function ($) { + function InputData (decorated, $element, options) { + this._currentData = []; + this._valueSeparator = options.get('valueSeparator') || ','; + + if ($element.prop('type') === 'hidden') { + if (options.get('debug') && console && console.warn) { + console.warn( + 'Select2: Using a hidden input with Select2 is no longer ' + + 'supported and may stop working in the future. It is recommended ' + + 'to use a ` + $value ) { + echo ''; + } + ?> + +
          +
          +
          +
          Is Hide Title
          +
          + +
          +
          + + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'content' => [ + 'type' => 'textarea', + 'title' => $lang['Content'] + ], + // 'file' => [ + // 'type' => 'file', + // 'title' => $lang['photo'], + // 'folder' => 'Announcement', + // 'size' => '* 1000px x 375px' + // ] + ]) ; + ?> + +
          +
          +
          +
          +
          + + + /> +
          +
          + * 1000px x 375px +
          +
          + +
          +
          +
          + + + + +
          +
          + + + + +
          +
          Is Signature
          +
          + + +
          +
          + +
          +
          Is Signature Retick
          +
          + + +
          +
          + +
          +
          Status
          +
          + +
          +
          + + +
          +
          +
          + + + +
          +
          + + + +
          + + + + query( $mysqli_query." ORDER BY a.announcement_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          +
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + + +
          + + + +
          +
          + + + + +
          +
          + + + + +
          +
          +
          + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['announcement_id'] ; + $title = dataFilter($row_page['title']) ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + ' ; + } + ?> + +
          + + '.dataFilter($row_page['user_name']).''.$title.''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-advance.php b/setting-advance.php new file mode 100644 index 0000000..f914009 --- /dev/null +++ b/setting-advance.php @@ -0,0 +1,125 @@ +query("SELECT post_id, post_title, post_link, post_content FROM system_post + WHERE post_type = 'page-advance' AND post_categories = 'page-advance' AND post_trash = '0' LIMIT 1") ; + +// check if page exists +if ($mysqli_page->num_rows == 0){ + // insert into database + $mysqli->query("INSERT INTO system_post + (post_type, post_categories, post_date, post_modified, post_trash) VALUES + ('page-advance', 'page-advance', '".TODAYDATE."', '".TODAYDATE."', '0')") ; + // set page id in variable + $page = $mysqli->insert_id ; + // refresh page + header("Location:setting-advance.php?page=".$page."") ; + exit ; +}else{ + // set query as array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + // set page id in variable + $page = $row_page['post_id'] ; +} + +if (isset($type) && $type == 'edit' && $_POST['hide'] == 1){ + + // keep value in variable + $page_content = resetString(escapeString($_POST['content'])) ; + $array_timeout = array('old' => $row_page['post_title'], + 'new' => $timeout) ; + + // update database + $mysqli->query("UPDATE system_post SET + post_title = '".escapeString($_POST['advance_from'])."', + post_link = '".escapeString($_POST['advance_to'])."', + post_content = '".escapeString($_POST['advance_remark'])."', + post_modified = '".TODAYDATE."' + WHERE post_id = '".$page."'") ; + + // refresh page + header("Location:setting-advance.php?page=".$page."&success=1") ; + exit ; +} + +// start header here +include 'requires/page_header.php' ; +include 'requires/page_top.php' ; + +?> +
          +
          + +
          +
          +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + + +
          +
          +
          +
          +
          +
          +
          +
          +
          + + \ No newline at end of file diff --git a/setting-branch.php b/setting-branch.php new file mode 100644 index 0000000..592ccb8 --- /dev/null +++ b/setting-branch.php @@ -0,0 +1,750 @@ +query("SELECT * FROM branch + WHERE branch_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + $page_content = resetString(escapeString($_POST['content'])) ; + $branch_email_footer = resetString(escapeString($_POST['branch_email_footer'])) ; + $branch_geometry = escapeString($_POST['branch_geometry']) ; + $hq_branch = escapeString($_POST['hq_branch']) ; + $branch_show = escapeString($_POST['branch_show']) ; + $branch_binding_id = escapeString($_POST['branch_binding_id']) ; + $branch_hr_contact = escapeString($_POST['branch_hr_contact']) ; + $branch_hr_email = escapeString($_POST['branch_hr_email']) ; + $branch_hr_cc = escapeString($_POST['branch_hr_cc']) ; + + if( $branch_show == '' ){ + $branch_show = 'no'; + } + + if ( $page == '' ){ + $mysqli->query("INSERT INTO branch (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE branch SET + branch_name = '".$page_title."', + branch_content = '".$page_content."', + branch_email_footer = '".$branch_email_footer."', + branch_hq = '".$hq_branch."', + branch_show = '".$branch_show."', + branch_binding_id = '".$branch_binding_id."', + branch_geometry = '".$branch_geometry."', + branch_hr_contact = '".$branch_hr_contact."', + branch_hr_email = '".$branch_hr_email."', + branch_hr_cc = '".$branch_hr_cc."', + updated_at = '".TODAYDATE."' + WHERE branch_id = '".$page."'") ; + + // refresh page + header("Location:setting-branch.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'hr-branch-new') ) ){ + header('Location: index.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + +
          +
          + + + '.$lang['thank_you_your_branch_has_been_updated'].' +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          +
          + > +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + > +
          +
          +
          +
          Binding Branch ID
          +
          + +
          +
          + +
          + +
          +
          HR Contact
          +
          + +
          +
          +
          +
          HR Email
          +
          + +
          +
          +
          +
          HR CC
          +
          + + * put comma if cc more, example : 1@gmail.com, 2@gmail.com +
          +
          + +
          + +
          +
          +
          + + +
          +
          + +
          + +
          +
          Email Footer
          +
          + + +
          +
          + +
          + +
          +
          +
          +
          +
          + +
          +
          +
          + +
          +
          +
          + + + + +
          +
          + +
          +
          +
          +
          + + + + + + + + + query($mysqli_query." ORDER BY branch_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          +
          search
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + +
          + + +
          +
          + + + + +
          +
          + + +
          +
          listing
          +
          + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['branch_id'] ; + $title = dataFilter($row_page['branch_name']) ; + + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
          '.$title.''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-chief.php b/setting-chief.php new file mode 100644 index 0000000..8622269 --- /dev/null +++ b/setting-chief.php @@ -0,0 +1,307 @@ +query("SELECT * FROM setting_chief + WHERE chief_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_chief (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE setting_chief SET + chief_desc = '".$page_title."', + chief_totaldepartment = '".escapeString($_POST['chief_totaldepartment'])."', + chief_format = '".escapeString($_POST['chief_format'])."', + chief_salary_type = '".escapeString($_POST['chief_salary_type'])."', + chief_period = '".escapeString($_POST['chief_period'])."', + updated_at = '".TODAYDATE."' + WHERE chief_id = '".$page."'") ; + + // refresh page + header("Location:setting-chief.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + +
          +
          + + + '.$lang['thank_you_your_chief_has_been_updated'].' +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          + +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          + + query($mysqli_query." ORDER BY chief_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          + +
          +
          + + + + +
          +
          + +
          +
          +
          + + + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['chief_id'] ; + $title = dataFilter($row_page['chief_desc']) ; + + echo ' + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + ' ; + } + ?> + +
          '.$title.''.dataFilter($row_page['chief_totaldepartment']).''.dataFilter($row_page['chief_format']).''.dataFilter($row_page['chief_salary_type']).''.dataFilter($row_page['chief_period']).''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-eis.php b/setting-eis.php new file mode 100644 index 0000000..42705a0 --- /dev/null +++ b/setting-eis.php @@ -0,0 +1,275 @@ +query("SELECT * FROM setting_salary_tax + WHERE tax_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + $employee_rate = $_POST['employee_rate']; + $employee_rate = ($employee_rate != '' ? $employee_rate : '0') ; + + $employer_rate = $_POST['employer_rate']; + $employer_rate = ($employer_rate != '' ? $employer_rate : '0') ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_salary_tax (created_at, tax_type) VALUES ('".TODAYDATE."', 'EIS')") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE setting_salary_tax SET + tax_title = '".$page_title."', + employee_rate = '".$employee_rate."', + employer_rate = '".$employer_rate."', + updated_at = '".TODAYDATE."' + WHERE tax_id = '".$page."'") ; + + // refresh page + header("Location:setting-eis.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + +
          + + + Thank you, the details have been saved. +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          Employee EIS Rate (%)
          +
          + +
          +
          +
          +
          Employer EIS Rate (%)
          +
          + +
          +
          + +
          +
          +
          + + + +
          +
          +
          +
          +
          + + query($mysqli_query." ORDER BY tax_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          + + + +
          + +
          +
          + + + + +
          +
          + +
          +
          +
          + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['tax_id'] ; + $title = $row_page['tax_title'] ; + + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
          '.$title.''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-employment-schedule-date.php b/setting-employment-schedule-date.php new file mode 100644 index 0000000..eaa1386 --- /dev/null +++ b/setting-employment-schedule-date.php @@ -0,0 +1,103 @@ +query("SELECT * FROM setting_employment_schedule + WHERE deleted_at IS NULL LIMIT 1") ; +if ( $mysqli_page->num_rows == 0 ){ + $mysqli->query( "INSERT INTO setting_employment_schedule + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $page_id = $mysqli->insert_id ; +}else{ + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $page_id = $row_page['schedule_id'] ; + $weekdays = json_decode( $row_page['weekdays'] ) ; +} + +// update database +if ( $_POST['hide'] == 1 ){ + + // update database + $mysqli->query("UPDATE setting_employment_schedule SET + weekdays = '".json_encode($_POST['weekdays'])."' + WHERE schedule_id = '".$page_id."'") ; + + // refresh page + header("Location:?page_mode=edit&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; +} + +// start header here +include 'requires/page_header.php'; +include 'requires/page_top.php'; + +?> + +
          + + '.$lang['Thank you details has been updated'].'
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          + +
          +
          Weekday / Time
          +
          + +
          +
          + +
          +
          +
          + + +
          +
          + +
          +
          +
          + + + \ No newline at end of file diff --git a/setting-epf.php b/setting-epf.php new file mode 100644 index 0000000..e417fc7 --- /dev/null +++ b/setting-epf.php @@ -0,0 +1,275 @@ +query("SELECT * FROM setting_salary_tax + WHERE tax_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + $employee_rate = $_POST['employee_rate']; + $employee_rate = ($employee_rate != '' ? $employee_rate : '0') ; + + $employer_rate = $_POST['employer_rate']; + $employer_rate = ($employer_rate != '' ? $employer_rate : '0') ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_salary_tax (created_at, tax_type) VALUES ('".TODAYDATE."', 'EPF')") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE setting_salary_tax SET + tax_title = '".$page_title."', + employee_rate = '".$employee_rate."', + employer_rate = '".$employer_rate."', + updated_at = '".TODAYDATE."' + WHERE tax_id = '".$page."'") ; + + // refresh page + header("Location:setting-epf.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + +
          + + + Thank you, the details have been saved. +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          Employee EPF Rate (%)
          +
          + +
          +
          +
          +
          Employer EPF Rate (%)
          +
          + +
          +
          + +
          +
          +
          + + + +
          +
          +
          +
          +
          + + query($mysqli_query." ORDER BY tax_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          + + + +
          + +
          +
          + + + + +
          +
          + +
          +
          +
          + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['tax_id'] ; + $title = $row_page['tax_title'] ; + + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
          '.$title.''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-holiday.php b/setting-holiday.php new file mode 100644 index 0000000..6aa5b78 --- /dev/null +++ b/setting-holiday.php @@ -0,0 +1,277 @@ +query("SELECT * FROM setting_holiday + WHERE holiday_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + $holiday_date = escapeString($_POST['holiday_date']) ; + $holiday_year = date('Y', strtotime($holiday_date)) ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_holiday (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE setting_holiday SET + holiday_name = '".$page_title."', + holiday_date = '".$holiday_date."', + holiday_year = '".$holiday_year."', + updated_at = '".TODAYDATE."' + WHERE holiday_id = '".$page."'") ; + + // refresh page + header("Location:setting-holiday.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + +
          +
          + + + '.$lang['thank_you_your_holiday_has_been_updated'].' +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + + + + +
          +
          +
          +
          +
          +
          + + + query($mysqli_query." ORDER BY holiday_id") ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          + + +
          +
          + + + + +
          +
          + + +
          +
          +
          + +
          +
          + +
          + + '.$date_time.'' ; + ?> + +
          + +
          +
          + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['holiday_id'] ; + $title = dataFilter($row_page['holiday_name']) ; + + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
          '.$title.''.resetDateFormat($row_page['holiday_date']).''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-hostel.php b/setting-hostel.php new file mode 100644 index 0000000..30d22ce --- /dev/null +++ b/setting-hostel.php @@ -0,0 +1,276 @@ +query("SELECT * FROM setting_hostel + WHERE hostel_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_hostel (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // hostel more -> early + $mores = [] ; + $early_key = $_POST['early_key'] ; + foreach ( $early_key as $key => $value ){ + $mores[] = [ + 'more_from' => $_POST['early_from'][$value], + 'more_to' => $_POST['early_to'][$value], + 'more_days' => $_POST['early_days'][$value] + ] ; + } + + // update database + $mysqli->query("UPDATE setting_hostel SET + hostel_desc = '".$page_title."', + updated_at = '".TODAYDATE."' + WHERE hostel_id = '".$page."'") ; + + // refresh page + header("Location:setting-hostel.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + +
          +
          + + + '.$lang['thank_you_your_hostel_has_been_updated'].' +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          +
          + +
          +
          + +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          + + query($mysqli_query." ORDER BY hostel_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          + +
          +
          + + + + +
          +
          + +
          +
          +
          + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['hostel_id'] ; + $title = dataFilter($row_page['hostel_desc']) ; + + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
          '.$title.''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-knowledge.php b/setting-knowledge.php new file mode 100644 index 0000000..9135b3f --- /dev/null +++ b/setting-knowledge.php @@ -0,0 +1,275 @@ +query("SELECT * FROM setting_knowledge + WHERE knowledge_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_knowledge (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // knowledge more -> early + $mores = [] ; + $early_key = $_POST['early_key'] ; + foreach ( $early_key as $key => $value ){ + $mores[] = [ + 'more_from' => $_POST['early_from'][$value], + 'more_to' => $_POST['early_to'][$value], + 'more_days' => $_POST['early_days'][$value] + ] ; + } + + // update database + $mysqli->query("UPDATE setting_knowledge SET + knowledge_desc = '".$page_title."', + updated_at = '".TODAYDATE."' + WHERE knowledge_id = '".$page."'") ; + + // refresh page + header("Location:setting-knowledge.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + +
          +
          + + + '.$lang['thank_you_your_knowledge_has_been_updated'].' +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          +
          + +
          +
          + +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          + + query($mysqli_query." ORDER BY knowledge_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          + +
          +
          + + + + +
          +
          + +
          +
          +
          + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['knowledge_id'] ; + $title = dataFilter($row_page['knowledge_desc']) ; + + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
          '.$title.''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-leave.php b/setting-leave.php new file mode 100644 index 0000000..ad326ab --- /dev/null +++ b/setting-leave.php @@ -0,0 +1,441 @@ +query("SELECT * FROM setting_leave + WHERE leave_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_leave (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // leave more -> early + $mores = [] ; + $early_key = $_POST['early_key'] ; + foreach ( $early_key as $key => $value ){ + $mores[] = [ + 'more_from' => $_POST['early_from'][$value], + 'more_to' => $_POST['early_to'][$value], + 'more_days' => $_POST['early_days'][$value] + ] ; + } + + // update database + $mysqli->query("UPDATE setting_leave SET + leave_name = '".$page_title."', + leave_code = '".escapeString($_POST['leave_code'])."', + leave_rules = '".json_encode($mores)."', + updated_at = '".TODAYDATE."' + WHERE leave_id = '".$page."'") ; + + // remove all salary more first + $mysqli->query("UPDATE setting_leave_more SET + deleted_at = '".TODAYDATE."' + WHERE leave_id = '".$page."'") ; + + $key = array("attendance_allowance"); + foreach($key as $v){ + $early_key = $_POST[$v.'_key'] ; + if(arrayCheck($early_key)){ + foreach ( $early_key as $key => $value ){ + $mysqli->query("INSERT INTO setting_leave_more + (leave_id, more_type, more_from, more_to, more_amount, created_at, updated_at) VALUES + ('".$page."', '".$v."', '".$_POST[$v.'_from'][$value]."', '".$_POST[$v.'_to'][$value]."', '".$_POST[$v.'_amount'][$value]."', '".TODAYDATE."', '".TODAYDATE."' )") ; + } + } + } + + // refresh page + header("Location:setting-leave.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + + + +
          +
          + ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          + +
          + +
          +
          +
          + + + + + + + + + + + +
          + +
           
          + +
          +
          + +
          + +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          + + query($mysqli_query." ORDER BY leave_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          + +
          +
          + + + + +
          +
          + +
          +
          listing
          +
          + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['leave_id'] ; + $title = dataFilter($row_page['leave_name']) ; + + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
          '.$title.''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-letterhead.php b/setting-letterhead.php new file mode 100644 index 0000000..6c1ac63 --- /dev/null +++ b/setting-letterhead.php @@ -0,0 +1,320 @@ +query("SELECT * FROM setting_letterhead + WHERE letterhead_id = '".$page."' LIMIT 1"); + if( $mysqli_page->num_rows > 0 ){ + $row_page = $mysqli_page->fetch_assoc() ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_desc = escapeString($_POST['description']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_letterhead (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE setting_letterhead SET + ".$image_query." + letterhead_type = '".escapeString($_POST['letterhead_type'])."', + letterhead_title = '".$page_title."', + letterhead_content = '".$page_desc."', + updated_at = '".TODAYDATE."' + WHERE letterhead_id = '".$page."'") ; + + // refresh page + header("Location:setting-letterhead.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( $page_mode == 'new' && !permissionCheck($row_user, 'user-letterhead-new') ){ + header('Location: app-association-category.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> +
          +
          + ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          + +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          + +
          + +
          +
          +
          + + + +
          +
          + + +
          + +
          + *IEA Form*
          + - [IEAASSIGNEDBY]
          + - [IEAWORKERNAME]
          + - [IEAWORKERIC]
          + - [IEAPOSITION]
          + - [IEAINCHARGEBY]
          + - [IEASALARY]
          + - [IEAALLOWANCE]
          + - [IEACOMISSION]
          +
          + +
          +
          +
          + + query($mysqli_query." ORDER BY letterhead_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          +
          search
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + +
          + + +
          +
          + + + + +
          +
          + + +
          +
          listing
          +
          + + + + + + + + + + + num_rows > 0 ){ + while( $row_page = $mysqli_page->fetch_assoc() ){ + $id = $row_page['letterhead_id'] ; + + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
          '.ucwords( $row_page['letterhead_type'] ).''.dataFilter( $row_page['letterhead_title'] ).''.resetDateFormat( $row_page['created_at'] ).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-position.php b/setting-position.php new file mode 100644 index 0000000..9f69d57 --- /dev/null +++ b/setting-position.php @@ -0,0 +1,517 @@ +query("SELECT * FROM setting_job_position + WHERE job_position_id = '".$page."' LIMIT 1"); + + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_job_position (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE setting_job_position SET + job_position_code = '".escapeString($_POST['code'])."', + job_position_show_al = '".escapeString($_POST['show_al'])."', + updated_at = '".TODAYDATE."' + WHERE job_position_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $job_position_desc = escapeString( $_POST['job_position_desc_'.$klang] ) ; + + checkLangUpdate( 'setting_job_position_translation', 'job_position_id', $page, $klang, [ + 'job_position_desc' => [ 'type' => 'input', 'value' => $job_position_desc ] + ] ) ; + } + + // refresh page + $_SESSION['system_result'] = 'success-updated' ; + echo ''; + + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'hr-position-list-new') ) ){ + header('Location: index.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + + + + +
          +
          + + + + '.$lang['thank_you_your_position_has_been_updated'].' + +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> + +
          +
          +
          +
          + + [ + 'type' => 'input', + 'title' => $lang['name'] + ] + ]) ; + ?> + +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          + + +
          +
          +
          + + + +
          +
          + +
          +
          +
          +
          +
          + getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + $styleArrayTitle = array( + 'font' => array( + 'bold' => true , + 'color' => array( 'rgb' => '000000' ) , + 'size' => 15 + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ); + + $styleArrayDay = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayBg1 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'AFABAB') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayBg2 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'FFDA65') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArray = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayLeft = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT, + ) + ) ; + + $styleArray2 = array( + 'alignment' => array( + //'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER, + ) + ) ; + + + $count = 1 ; + $firstChar = 'A' ; + $lastChar = 'E' ; + + // title name + $objPHPExcel->getActiveSheet()->mergeCells( $firstChar.$count.':'.$lastChar.$count ) ; + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count.':'.$lastChar.$count )->applyFromArray( $styleArrayTitle ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, 'Position List' ) ; + $count++ ; + + + $setChar = $firstChar ; + $objPHPExcel->getActiveSheet()->getStyle($setChar.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, 'No' ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, 'Title' ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, 'Date' ) ; + + + // loop all attendance record + + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY job_position_id") ; + if ( $mysqli_page->num_rows > 0 ){ + + $count_no = 0 ; + while ( $row_page = $mysqli_page->fetch_assoc() ){ + + $count++ ; + $count_no++ ; + $setChar = $firstChar ; + + $objPHPExcel->getActiveSheet()->getStyle($setChar.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, $count_no ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, dataFilter($row_page['job_position_desc']) ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, dataFilter($row_page['created_at']) ) ; + } + } + + // Submission from + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; + } + + // load pagination + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY a.job_position_id LIMIT $start_from, " . LIMIT) ; + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + + // start header here + + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + + ?> + +
          +
          + + + +
          +
          search
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + + +
          + + +
          +
          + + + + +
          +
          + + +
          +
          +
          + + + + + + + + + + + num_rows > 0){ + + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + echo ' + + + + + + + '; + + } + + }else{ + + echo ' + + + + + + + ' ; + } + + ?> + +
          '.dataFilter($row_page['job_position_desc']).''.dataFilter($row_page['job_position_code']).''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-rms-bill-category.php b/setting-rms-bill-category.php new file mode 100644 index 0000000..32d1f30 --- /dev/null +++ b/setting-rms-bill-category.php @@ -0,0 +1,375 @@ +query("SELECT * FROM rms_bill_category + WHERE category_id = '".$category_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $category_id == '' ){ + $mysqli->query( "INSERT INTO rms_bill_category + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $category_id = $mysqli->insert_id ; + } + + // resize image + // set image in variable + // $image = $_FILES["image"]["name"] ; + // $image_query = '' ; + // $remove_photo = $_POST['remove_photo'] ; + // if ($remove_photo == 1){ + // $image = '' ; + // $image_query = "file = ''," ; + // } + + // if ( $image != '' ){ + // $get_image = pathinfo($image) ; + + // $create_image = reCreateImage('RmsBillCategory', $category_id, $category_id, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // // Image uploads when exists + // if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + // $resizeObj = new resize($create_image['original']) ; // Initialise load image + // foreach($create_image['crop'] as $value){ + // // Resize image (options: exact, portrait, landscape, auto, crop) + // $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + // $resizeObj -> saveImage($value['source'], 70) ; // Save image + // } + // $get_image = pathinfo($create_image['image']) ; + // $image_query = "file = '".$create_image['image']."'," ; + // } + // } + + // update database + $mysqli->query( "UPDATE rms_bill_category SET + status = '".escapeString($_POST['status'])."' + WHERE category_id = '".$category_id."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + + checkLangUpdate( 'rms_bill_category_translation', 'category_id', $category_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:setting-rms-bill-category.php?page_mode=edit&category_id=".$category_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'rms-bill-category-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'rms-bill-category-edit') ) ){ + header('Location: setting-rms-bill-category.php') ; + exit ; + } + + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
          +
          + + '.$lang['Thank you details has been updated'].'
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          + + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + + + +
          +
          Status
          +
          + +
          +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          + + + query( $mysqli_query." ORDER BY a.category_id DESC LIMIT $start_from, " . LIMIT ) ; + + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          +
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + +
          + + +
          +
          + + + + +
          +
          + + +
          +
          +
          + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['category_id'] ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + + ' ; + } + ?> + +
          Created Date
          ' ; + if ( permissionCheck($row_user, 'rms-bill-category-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['title']).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-rms-bill-item.php b/setting-rms-bill-item.php new file mode 100644 index 0000000..3e4ecbe --- /dev/null +++ b/setting-rms-bill-item.php @@ -0,0 +1,501 @@ +query("SELECT * FROM rms_bill_item + WHERE item_id = '".$item_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $item_id == '' ){ + $mysqli->query( "INSERT INTO rms_bill_item + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $item_id = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('RmsBillItem', $item_id, $item_id, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + // update database + $mysqli->query( "UPDATE rms_bill_item SET + ".$image_query." + category_id = '".escapeString($_POST['category_id'])."', + biller_code = '".escapeString($_POST['biller_code'])."', + min_amount = '".escapeString($_POST['min_amount'])."', + max_amount = '".escapeString($_POST['max_amount'])."', + is_reference1 = '".escapeString($_POST['is_reference1'])."', + is_reference2 = '".escapeString($_POST['is_reference2'])."', + is_reference3 = '".escapeString($_POST['is_reference3'])."', + is_reference4 = '".escapeString($_POST['is_reference4'])."', + status = '".escapeString($_POST['status'])."' + WHERE item_id = '".$item_id."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + checkLangUpdate( 'rms_bill_item_translation', 'item_id', $item_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ], + 'content' => [ 'type' => 'input', 'value' => $content ], + 'reference1' => [ 'type' => 'input', 'value' => escapeString( $_POST['reference1_'.$klang] ) ], + 'reference2' => [ 'type' => 'input', 'value' => escapeString( $_POST['reference2_'.$klang] ) ], + 'reference3' => [ 'type' => 'input', 'value' => escapeString( $_POST['reference3_'.$klang] ) ], + 'reference4' => [ 'type' => 'input', 'value' => escapeString( $_POST['reference4_'.$klang] ) ] + ] ) ; + } + + // refresh page + header("Location:setting-rms-bill-item.php?page_mode=edit&item_id=".$item_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'rms-bill-item-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'rms-bill-item-edit') ) ){ + header('Location: setting-rms-bill-item.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
          +
          + + '.$lang['Thank you details has been updated'].'
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          + + [ + 'type' => 'input', + 'title' => $lang['title'] + ], + 'content' => [ + 'type' => 'input', + 'title' => $lang['Content'] + ], + 'reference1' => [ + 'type' => 'input', + 'title' => $lang['Reference'].' 1' + ], + 'reference2' => [ + 'type' => 'input', + 'title' => $lang['Reference'].' 2' + ], + 'reference3' => [ + 'type' => 'input', + 'title' => $lang['Reference'].' 3' + ], + 'reference4' => [ + 'type' => 'input', + 'title' => $lang['Reference'].' 4' + ] + ]) ; + ?> + +
          +
          Category
          +
          + +
          +
          +
          +
          +
          +
          +
          + + + /> +
          +
          +
          +
          + +
          +
          +
          + + + + +
          +
          + + + + +
          +
          Biller Code
          +
          + +
          +
          + +
          + +
          +
          Min Amount
          +
          + +
          +
          +
          +
          Max Amount
          +
          + +
          +
          +
          +
          Is Reference 1
          +
          + +
          +
          +
          +
          Is Reference 2
          +
          + +
          +
          +
          +
          Is Reference 3
          +
          + +
          +
          +
          +
          Is Reference 4
          +
          + +
          +
          + +
          + +
          +
          Status
          +
          + +
          +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          + + + query( $mysqli_query." ORDER BY a.item_id DESC LIMIT $start_from, " . LIMIT ) ; + + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // require components + $categories = [] ; + $mysqli_category = $mysqli->query("SELECT a.category_id, b.title FROM rms_bill_category a + LEFT JOIN rms_bill_category_translation b ON ( a.category_id = b.category_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' ORDER BY a.sortable") ; + if ( $mysqli_category->num_rows > 0 ){ + while ( $row_category = $mysqli_category->fetch_assoc() ){ + $categories[$row_category['category_id']] = dataFilter($row_category['title']) ; + } + } + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          +
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + +
          + + +
          +
          + + + + +
          +
          + + +
          +
          +
          + + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['item_id'] ; + + echo ' + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + ' ; + } + ?> + +
          Created Date
          ' ; + if ( permissionCheck($row_user, 'rms-bill-item-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['title']).''.dataFilter($categories[$row_page['category_id']]).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-rms-prepaid-deno.php b/setting-rms-prepaid-deno.php new file mode 100644 index 0000000..963f8c7 --- /dev/null +++ b/setting-rms-prepaid-deno.php @@ -0,0 +1,373 @@ +query("SELECT * FROM rms_prepaid_deno + WHERE deno_id = '".$deno_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $deno_id == '' ){ + $mysqli->query( "INSERT INTO rms_prepaid_deno + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $deno_id = $mysqli->insert_id ; + } + + // update database + $mysqli->query( "UPDATE rms_prepaid_deno SET + ".$image_query." + item_id = '".escapeString($_POST['item_id'])."', + deno_code = '".escapeString($_POST['deno_code'])."', + amount = '".escapeString($_POST['amount'])."', + status = '".escapeString($_POST['status'])."' + WHERE deno_id = '".$deno_id."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + checkLangUpdate( 'rms_prepaid_deno_translation', 'deno_id', $deno_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:setting-rms-prepaid-deno.php?page_mode=edit&deno_id=".$deno_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'rms-prepaid-deno-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'rms-prepaid-deno-edit') ) ){ + header('Location: setting-rms-prepaid-deno.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
          +
          + + '.$lang['Thank you details has been updated'].'
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          + + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
          +
          Category
          +
          + +
          +
          + +
          +
          Deno Code
          +
          + +
          +
          +
          +
          Amount
          +
          + +
          +
          + +
          +
          Status
          +
          + +
          +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          + + + query( $mysqli_query." ORDER BY a.deno_id DESC LIMIT $start_from, " . LIMIT ) ; + + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + + // require component + $items = [] ; + $mysqli_item = $mysqli->query("SELECT a.item_id, b.title FROM rms_prepaid_item a + LEFT JOIN rms_prepaid_item_translation b ON ( a.item_id = b.item_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en' ORDER BY a.sortable") ; + if ( $mysqli_item->num_rows > 0 ){ + while ( $row_item = $mysqli_item->fetch_assoc() ){ + $items[$row_item['item_id']] = dataFilter($row_item['title']) ; + } + } + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          +
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + +
          + + +
          +
          + + + + +
          +
          + + +
          +
          +
          + + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['deno_id'] ; + + echo ' + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + ' ; + } + ?> + +
          Created Date
          ' ; + if ( permissionCheck($row_user, 'rms-prepaid-deno-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['title']).''.dataFilter($items[$row_page['item_id']]).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-rms-prepaid-item.php b/setting-rms-prepaid-item.php new file mode 100644 index 0000000..a8b4663 --- /dev/null +++ b/setting-rms-prepaid-item.php @@ -0,0 +1,374 @@ +query("SELECT * FROM rms_prepaid_item + WHERE item_id = '".$item_id."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + if ( $item_id == '' ){ + $mysqli->query( "INSERT INTO rms_prepaid_item + ( created_at ) VALUES + ( '".TODAYDATE."' )" ) ; + $item_id = $mysqli->insert_id ; + } + + // resize image + // set image in variable + $image = $_FILES["image"]["name"] ; + $image_query = '' ; + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "file = ''," ; + } + + if ( $image != '' ){ + $get_image = pathinfo($image) ; + + $create_image = reCreateImage('RmsPrepaidItem', $item_id, $item_id, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source'], 70) ; // Save image + } + $get_image = pathinfo($create_image['image']) ; + $image_query = "file = '".$create_image['image']."'," ; + } + } + + // update database + $mysqli->query( "UPDATE rms_prepaid_item SET + ".$image_query." + status = '".escapeString($_POST['status'])."' + WHERE item_id = '".$item_id."'" ) ; + + foreach ( $LANGS as $klang => $vlang ){ + $title = escapeString( $_POST['title_'.$klang] ) ; + $content = escapeString( $_POST['content_'.$klang] ) ; + + checkLangUpdate( 'rms_prepaid_item_translation', 'item_id', $item_id, $klang, [ + 'title' => [ 'type' => 'input', 'value' => $title ] + ] ) ; + } + + // refresh page + header("Location:setting-rms-prepaid-item.php?page_mode=edit&item_id=".$item_id."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'rms-prepaid-item-new') ) || + ( $page_mode == 'edit' && !permissionCheck($row_user, 'rms-prepaid-item-edit') ) ){ + header('Location: setting-rms-prepaid-item.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
          +
          + + '.$lang['Thank you details has been updated'].'
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          + + [ + 'type' => 'input', + 'title' => $lang['title'] + ] + ]) ; + ?> + +
          +
          +
          +
          +
          + + + /> +
          +
          +
          +
          + +
          +
          +
          + + + + +
          +
          + + + + +
          +
          Status
          +
          + +
          +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          + + + query( $mysqli_query." ORDER BY a.item_id DESC LIMIT $start_from, " . LIMIT ) ; + + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          +
          search
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + +
          + +
          +
          + + + + +
          +
          + + +
          +
          listing
          +
          + + + + + + + + + + + + num_rows > 0){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + // default variable + $id = $row_page['item_id'] ; + + echo ' + + + + + + + '; + } + }else{ + echo ' + + + + + + + + ' ; + } + ?> + +
          Created Date
          ' ; + if ( permissionCheck($row_user, 'rms-prepaid-item-edit') ){ + echo ' + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilter($row_page['title']).''.resetStatus($row_page['status']).''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-section.php b/setting-section.php new file mode 100644 index 0000000..2b0a8c7 --- /dev/null +++ b/setting-section.php @@ -0,0 +1,481 @@ +query("SELECT * FROM setting_job_section + WHERE job_section_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_job_section (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE setting_job_section SET + job_section_code = '".escapeString($_POST['code'])."', + updated_at = '".TODAYDATE."' + WHERE job_section_id = '".$page."'") ; + + foreach ( $LANGS as $klang => $vlang ){ + $job_section_desc = escapeString( $_POST['job_section_desc_'.$klang] ) ; + + checkLangUpdate( 'setting_job_section_translation', 'job_section_id', $page, $klang, [ + 'job_section_desc' => [ 'type' => 'input', 'value' => $job_section_desc ] + ] ) ; + } + + // refresh page + header("Location:setting-section.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'hr-section-list-new') ) ){ + header('Location: index.php') ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + +
          +
          + + + '.$lang['thank_you_your_section_has_been_updated'].' +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          + + [ + 'type' => 'input', + 'title' => $lang['name'] + ] + ]) ; + ?> + +
          +
          +
          + +
          +
          + +
          +
          +
          + + + +
          +
          + +
          +
          +
          +
          + + getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + $styleArrayTitle = array( + 'font' => array( + 'bold' => true , + 'color' => array( 'rgb' => '000000' ) , + 'size' => 15 + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ); + + $styleArrayDay = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayBg1 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'AFABAB') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayBg2 = array( + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'color' => array('rgb' => 'FFDA65') + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArray = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + ) + ) ; + + $styleArrayLeft = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'alignment' => array( + 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT, + ) + ) ; + + $styleArray2 = array( + 'alignment' => array( + //'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, + 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER, + ) + ) ; + + $styleArrayRed = array( + 'font' => array( + 'color' => array('rgb' => 'FF0000'), + )); + + $count = 1 ; + $firstChar = 'A' ; + $lastChar = 'E' ; + + // title name + $objPHPExcel->getActiveSheet()->mergeCells( $firstChar.$count.':'.$lastChar.$count ) ; + $objPHPExcel->getActiveSheet()->getStyle( $firstChar.$count.':'.$lastChar.$count )->applyFromArray( $styleArrayTitle ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $firstChar.$count, 'Section List' ) ; + $count++ ; + + $setChar = $firstChar ; + $objPHPExcel->getActiveSheet()->getStyle($setChar.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, 'No' ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, 'Title' ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, 'Date' ) ; + + // loop all attendance record + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY job_section_id") ; + if ( $mysqli_page->num_rows > 0 ){ + $count_no = 0 ; + while ( $row_page = $mysqli_page->fetch_assoc() ){ + + $count++ ; + $count_no++ ; + $setChar = $firstChar ; + + $objPHPExcel->getActiveSheet()->getStyle($setChar.$count)->applyFromArray( $styleArray ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, $count_no ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, dataFilter($row_page['job_section_desc']) ) ; + $setChar++ ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $setChar.$count, dataFilter($row_page['created_at']) ) ; + + } + } + + // Submission from + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; + header( 'Content-Dissection: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; + } + + // load pagination + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY job_section_id LIMIT $start_from, " . LIMIT) ; + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          +
          search
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + +
          + + +
          +
          + + + + +
          +
          + + +
          +
          listing
          +
          + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + echo ' + + + + + + '; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
          '.dataFilter($row_page['job_section_desc']).''.dataFilter($row_page['job_section_code']).''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-sick.php b/setting-sick.php new file mode 100644 index 0000000..2d65f00 --- /dev/null +++ b/setting-sick.php @@ -0,0 +1,364 @@ +query("SELECT * FROM setting_sick + WHERE sick_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $sick_mc_fee = escapeString($_POST['sick_mc_fee']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_sick (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + } + + // sick more -> early + $mores = [] ; + $early_key = $_POST['early_key'] ; + foreach ( $early_key as $key => $value ){ + $mores[] = [ + 'more_from' => $_POST['early_from'][$value], + 'more_to' => $_POST['early_to'][$value], + 'more_days' => $_POST['early_days'][$value] + ] ; + } + + // update database + $mysqli->query("UPDATE setting_sick SET + sick_mc_fee = '".$sick_mc_fee."', + sick_name = '".$page_title."', + sick_code = '".escapeString($_POST['sick_code'])."', + sick_rules = '".json_encode($mores)."', + updated_at = '".TODAYDATE."' + WHERE sick_id = '".$page."'") ; + + // add system log + $array_remark = array('old' => array('title' => $row_page['sick_name']), + 'new' => array('title' => $page_title)) ; + // refresh page + header("Location:setting-sick.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + + + +
          +
          + + + '.$lang['thank_you_your_sick_has_been_updated'].' +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          + +
          + +
          +
          +
          + + + + + + + + + + + +
          + +
           
          + +
          +
          + +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          + query($mysqli_query." ORDER BY sick_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          + +
          + + +
          + +
          +
          + + + + +
          +
          + +
          +
          +
          + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['sick_id'] ; + $title = dataFilter($row_page['sick_name']) ; + + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
          '.$title.''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-slip.php b/setting-slip.php new file mode 100644 index 0000000..da20bab --- /dev/null +++ b/setting-slip.php @@ -0,0 +1,103 @@ +query("SELECT * FROM setting_salary_tax WHERE tax_type = 'slip_month_setting' LIMIT 1"); + if(mysqli_num_rows($query_setting) <= 0){ + $update = $mysqli->query("INSERT INTO setting_salary_tax( tax_title, tax_type) VALUES ('$month_setting','slip_month_setting')"); + }else{ + $result_setting = mysqli_fetch_assoc($query_setting); + $setting_id = $result_setting['tax_id']; + $update = $mysqli->query("UPDATE setting_salary_tax SET tax_title = '$month_setting' WHERE tax_id = '$setting_id'"); + } + if($update){ + $_SESSION['system_result'] = 'success-updated' ; + header("Location:setting-slip.php?page_mode=all") ; + exit ; + } +} + +$query_setting = $mysqli->query("SELECT * FROM setting_salary_tax WHERE tax_type = 'slip_month_setting' LIMIT 1"); +if(mysqli_num_rows($query_setting) > 0){ + $result_setting = mysqli_fetch_assoc($query_setting); +} + +// active menu bar +$active_main_menu = 'setting' ; +$active_sub_menu = 'setting-salary' ; +$active_menu = 'setting-slip' ; + +// start header here +include 'requires/page_header.php'; +include 'requires/page_top.php'; + +// mode type | all list | new | edit +switch($page_mode){ + + // all hostel list + case 'all' : + default : + ?> +
          + + + Thank you, the details have been saved. +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          Generate Salary slip for
          +
          + +
          +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + + \ No newline at end of file diff --git a/setting-socso.php b/setting-socso.php new file mode 100644 index 0000000..4b58278 --- /dev/null +++ b/setting-socso.php @@ -0,0 +1,275 @@ +query("SELECT * FROM setting_salary_tax + WHERE tax_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + $employee_rate = $_POST['employee_rate']; + $employee_rate = ($employee_rate != '' ? $employee_rate : '0') ; + + $employer_rate = $_POST['employer_rate']; + $employer_rate = ($employer_rate != '' ? $employer_rate : '0') ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_salary_tax (created_at, tax_type) VALUES ('".TODAYDATE."', 'SOCSO')") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE setting_salary_tax SET + tax_title = '".$page_title."', + employee_rate = '".$employee_rate."', + employer_rate = '".$employer_rate."', + updated_at = '".TODAYDATE."' + WHERE tax_id = '".$page."'") ; + + // refresh page + header("Location:setting-socso.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + +
          + + + Thank you, the details have been saved. +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          Employee SOCSO Rate (%)
          +
          + +
          +
          +
          +
          Employer SOCSO Rate (%)
          +
          + +
          +
          + +
          +
          +
          + + + +
          +
          +
          +
          +
          + + query($mysqli_query." ORDER BY tax_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          + + + +
          + +
          +
          + + + + +
          +
          + +
          +
          +
          + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['tax_id'] ; + $title = $row_page['tax_title'] ; + + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
          '.$title.''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-website-page-menu.php b/setting-website-page-menu.php new file mode 100644 index 0000000..a91cade --- /dev/null +++ b/setting-website-page-menu.php @@ -0,0 +1,267 @@ +query("UPDATE system_post SET + post_content = '".$temp_permission2."' + WHERE post_type = 'website-page-menu'") ; +} + +$mysqli_page = $mysqli->query("SELECT * FROM system_post + WHERE post_type = 'website-page-menu' LIMIT 1") ; +// check table exsits +if ($mysqli_page->num_rows > 0){ + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; +} + +$array_page_remove = [] ; + +$array_page_remove['dashboard'] = [ + "dashboard" => + [ + "dashboard" => "Dashboard" + ] +]; +$array_page_remove['hr'] = [ + "staff-application" => [ + "application-form" => "Application Form", + "application-pending-list" => "Pending", + "application-processing-list" => "Processing", + "application-processing-manager-approved" => "Processing - Manager Approved", + "application-processing-manager-rejected" => "Processing - Manager Rejected", + "application-processing-interview-slot" => "Processing - Interview Slot", + "application-interview-list" => "Interview", + "application-reschedule-list" => "Reschedule", + "application-kiv-list" => "Keep In View", + "application-offer-list" => "Offer", + "application-confirmation-list" => "Confirmation", + "application-terminate-list" => "Terminate", + "application-reject-list" => "Reject" + ], + "staff" => [ + "staff-list" => "List", + "staff-adjustment" => "Point Adjustment", + "staff-point-history" => "Point History", + "staff-adjustment-wallet" => "Wallet Adjustment", + "staff-resign-list" => "Resign", + "staff-run-away-list" => "Run Away", + "staff-warning-list" => "Warning" + ], + "merit-points" => [ + "hr-merit-points-movement" => "Movement", + "hr-merit-points-adjustment" => "Adjustment", + "hr-merit-points-task" => "Task", + ], + "attendance" => [ + "attendance-list" => "List", + "attendance-report" => "Report", + "attendance-qrcode" => "Qrcode", + "attendance-health" => "Health" + ], + "leave" => [ + "leave" => "Leave" + ], + "advance" => [ + "advance" => "Advance" + ], + "payment-slip" => [ + "payment-slip" => "Payment Slip" + ], + "salary" => [ + "salary-list" => "Salary" + ] +] ; +$array_page_remove['task'] = [ + "task-list" => [ + "task-list" => "List", + "task-report" => "Report" + ] +] ; +$array_page_remove['service'] = [ + "announcement" => [ + "announcement" => "Announcement" + ], + "inbox" => [ + "inbox" => "Inbox" + ], + "our-inbox" => [ + "our-suggestion" => "Suggestion", + "our-request" => "Request", + "our-main-request" => "Main Category", + "our-sub-request" => "Sub Category", + "our-grievance" => "Grievance" + ], + "form-submission" => [ + "form-headcount" => "Headcount Requisition", + "form-nomination" => "Nomination", + "form-resignation" => "Resignation Letter", + "form-submission-category" => "Category" + ], + "redeem" => [ + "redeem-list" => "List", + "redeem-category" => "Category" + ], + "association" => [ + "association-list" => "List", + "association-category" => "Category" + ], + "training" => [ + "training" => "Training" + ], + "form" => [ + "form-list" => "List", + "form-main-category" => "Main Category", + "form-sub-category" => "Sub Category" + ], + "handbook" => [ + "handbook-list" => "List", + "handbook-main-category" => "Main Category", + "handbook-sub-category" => "Sub Category" + ], + "catalog" => [ + "catalog-list" => "List", + "catalog-main-category" => "Main Category", + "catalog-sub-category" => "Sub Category" + ] +] ; +$array_page_remove['report'] = [ + "report" => [ + "year-end-cut-off" => "Year End Cut Off" + ] +] ; +$array_page_remove['import'] = [ + "import" => [ + "import-full-attendance" => "Import Full Attendance", + "import-outstanding-employee" => "Import Outstanding Employee", + "import-lateness-board" => "Import Lateness Board", + "import-point" => "Import Point" + ] +] ; +$array_page_remove['visitor'] = [ + "visitor-list" => [ + "visitor-list" => "List" + ] +] ; +$array_page_remove['setting'] = [ + "user-setting" => [ + "user-user" => "User", + "user-new-user" => "New User" + ], + "service-annoucment" => [ + "user-notification" => "Notification", + "user-new-notification" => "New Notification", + "user-letterhead" => "Letterhead" + ], + "hr-setting" => [ + "hr-branch" => "Branch", + "hr-working-hours" => "Working Hours", + "hr-leave-setting" => "Leave Setting", + "hr-sick-setting" => "Sick Setting", + "hr-holiday-list" => "Holiday List", + "hr-hostel-list" => "Hostel List", + "hr-knowledge-list" => "Knowledge List", + "hr-department-list" => "Department List", + "hr-section-list" => "Section List", + "hr-position-list" => "Designation List", + "hr-advance-setting" => "Advance Setting", + "hr-chief-list" => "Chief List", + "employment-schedule-date" => "Schedule Interview Date" + ], + "app-setting" => [ + "app-welcome-screen" => "Welcome Screen", + "app-pop-up" => "Pop Up", + "app-service" => "Sevice", + "app-page" => "Page", + "app-menu" => "Menu", + "app-support" => "Support", + "app-password" => "Password", + "app-difficulty" => "Difficulty", + "app-adjustment" => "Adjustment", + "app-point" => "Point Adjustment", + "profile-star" => "Star", + "profile-point" => "Point", + "profile-achievement" => "Achievement", + "profile-tier" => "Tier" + ], + "salary-setting" => [ + "setting-salary" => "Salary Setting" + ], + "rms-setting" => [ + "setting-rms" => "RMS Setting" + ] +] ; +// print_r($row_page['post_content']);exit(); +$page_menu = '' ; +foreach ( $array_page_remove as $key1 => $value1 ){ + $page_menu .= ' +
          +
          '.str_replace('-', ' ', $key1).'
          ' ; + + foreach ( $value1 as $key2 => $value2 ){ + + $page_menu .= ' +
          +
          '.str_replace('-', ' ', $key2).'
          +
          ' ; + + foreach ( $value2 as $key3 => $value3 ){ + + $page_menu .= ' + ' ; + + } + + $page_menu .= ' +
          +
          ' ; + + } + + $page_menu .= ' +
          ' ; +} + + +// start header here +include 'requires/page_header.php' ; +include 'requires/page_top.php' ; +?> +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-working.php b/setting-working.php new file mode 100644 index 0000000..9711e1e --- /dev/null +++ b/setting-working.php @@ -0,0 +1,808 @@ +query("SELECT * FROM setting_working_group + WHERE group_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + $boolean_add_working = false ; + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_working_group (created_at) VALUES ('".TODAYDATE."')") ; + $page = $mysqli->insert_id ; + $boolean_add_working = true ; + } + + // update database + $mysqli->query("UPDATE setting_working_group SET + group_name = '".$page_title."', + updated_at = '".TODAYDATE."' + WHERE group_id = '".$page."'") ; + + $working_hours = $_POST['working_hours'] ; + foreach ( $working_hours as $key => $value ){ + + $working_day = $value ; + $working_on = ( !empty($_POST['working_on'][$value]) ? 'yes' : 'no' ) ; + $working_if_flexi = ( !empty($_POST['working_if_flexi'][$value]) ? 'yes' : 'no' ) ; + $working_if_include_rest = ( !empty($_POST['working_if_include_rest'][$value]) ? 'yes' : 'no' ) ; + $working_if_ot = ( !empty($_POST['working_if_ot'][$value]) ? 'yes' : 'no' ) ; + $working_if_fixed_work = ( !empty($_POST['working_if_fixed_work'][$value]) ? 'yes' : 'no' ) ; + $working_direct_day = ( !empty($_POST['working_direct_day'][$value]) ? 'yes' : 'no' ) ; + $working_if_ot_morning = ( !empty($_POST['working_if_ot_morning'][$value]) ? 'yes' : 'no' ) ; + $working_if_offduty = ( !empty($_POST['working_if_offduty'][$value]) ? 'yes' : 'no' ) ; + $working_if_deduct_offduty = ( !empty($_POST['working_if_deduct_offduty'][$value]) ? 'yes' : 'no' ) ; + $working_day_calculation = $_POST['working_day_calculation'][$value] ; + $working_morning_start = $_POST['working_morning_start'][$value] ; + $working_morning_end = $_POST['working_morning_end'][$value] ; + $working_period_before = $_POST['working_period_before'][$value] ; + $working_break_start = $_POST['working_break_start'][$value] ; + $working_break_end = $_POST['working_break_end'][$value] ; + $working_break_end_include_ot = $_POST['working_break_end_include_ot'][$value] ; + $working_afternoon_start = $_POST['working_afternoon_start'][$value] ; + $working_afternoon_end = $_POST['working_afternoon_end'][$value] ; + $working_shortbreak_start = $_POST['working_shortbreak_start'][$value] ; + $working_shortbreak_end = $_POST['working_shortbreak_end'][$value] ; + $working_night_start = $_POST['working_night_start'][$value] ; + $working_night_end = $_POST['working_night_end'][$value] ; + $working_ot_start = $_POST['working_ot_start'][$value] ; + $working_total_hours = $_POST['working_total_hours'][$value] ; + $working_total_hours = ( $working_total_hours <= '24:00' ? $working_total_hours : '24:00' ) ; + $working_total_rest_hours = $_POST['working_total_rest_hours'][$value] ; + $working_total_rest_hours = ( $working_total_rest_hours <= '24:00' ? $working_total_rest_hours : '24:00' ) ; + $working_rest_range_from = $_POST['working_rest_range_from'][$value] ; + $working_rest_range_from = ( $working_rest_range_from != '' ? $working_rest_range_from : NULL ) ; + $working_rest_range_to = $_POST['working_rest_range_to'][$value] ; + $working_rest_range_to = ( $working_rest_range_from != '' && $working_rest_range_to != '' ? $working_rest_range_to : $working_rest_range_from ) ; + $working_rest_include_ot = $_POST['working_rest_include_ot'][$value] ; + $working_rest_include_ot = ( $working_rest_include_ot != '' ? $working_rest_include_ot : NULL ) ; + //second + $working_total_rest_hours2 = $_POST['working_total_rest_hours2'][$value] ; + $working_total_rest_hours2 = ( $working_total_rest_hours2 <= '24:00' ? $working_total_rest_hours2 : '24:00' ) ; + $working_rest_range_from2 = $_POST['working_rest_range_from2'][$value] ; + $working_rest_range_from2 = ( $working_rest_range_from2 != '' ? $working_rest_range_from2 : NULL ) ; + $working_rest_range_to2 = $_POST['working_rest_range_to2'][$value] ; + $working_rest_range_to2 = ( $working_rest_range_from2 != '' && $working_rest_range_to2 != '' ? $working_rest_range_to2 : $working_rest_range_from2 ) ; + + $working_rounding_ot = $_POST['working_rounding_ot'][$value] ; + + $working_count_offduty = $_POST['working_count_offduty'][$value] ; + $working_count_offduty = ( $working_count_offduty <= '24:00' ? $working_count_offduty : '24:00' ) ; + + $working_max_ot = $_POST['working_max_ot'][$value] ; + $working_max_ot = ( $working_max_ot != '' ? $working_max_ot : NULL ) ; + + // check if exsits + $check_working = $mysqli->query("SELECT * FROM setting_working + WHERE group_id = '".$page."' AND working_day = '".$value."' LIMIT 1") ; + if ( $check_working->num_rows == 0 ){ + $mysqli->query("INSERT INTO setting_working + (created_at) VALUES + ('".TODAYDATE."')") ; + $working_id = $mysqli->insert_id ; + }else{ + $row_working = $check_working->fetch_assoc() ; + $working_id = $row_working['working_id'] ; + } + + // if morning end > morning start + $working_next_day = 'no' ; + if ( $working_break_start > $working_break_end ){ + $working_next_day = 'yes' ; + } + + $working_morning_end = date('H:i:s', strtotime($working_morning_start.' -1 seconds')) ; + + $mysqli->query("UPDATE setting_working SET + group_id = '".$page."', + working_day = '".$working_day."', + working_on = '".$working_on."', + working_next_day = '".$working_next_day."', + working_if_include_rest = '".$working_if_include_rest."', + working_if_ot = '".$working_if_ot."', + working_direct_day = '".$working_direct_day."', + working_if_ot_morning = '".$working_if_ot_morning."', + working_if_flexi = '".$working_if_flexi."', + working_if_fixed_work = '".$working_if_fixed_work."', + working_day_calculation = '".$working_day_calculation."', + working_morning_start = '".$working_morning_start."', + working_morning_end = '".$working_morning_end."', + working_period_before = '".$working_period_before."', + working_break_start = '".$working_break_start."', + working_break_end = '".$working_break_end."', + working_break_end_include_ot = '".$working_break_end_include_ot."', + working_afternoon_start = '".$working_afternoon_start."', + working_afternoon_end = '".$working_afternoon_end."', + working_shortbreak_start = '".$working_shortbreak_start."', + working_shortbreak_end = '".$working_shortbreak_end."', + working_night_start = '".$working_night_start."', + working_night_end = '".$working_night_end."', + working_ot_start = '".$working_ot_start."', + working_total_hours = '".$working_total_hours."', + working_total_rest_hours = '".$working_total_rest_hours."', + working_total_rest_hours = '".$working_total_rest_hours."', + working_rest_range_from = ".( $working_rest_range_from != '' ? "'".$working_rest_range_from."'" : "NULL").", + working_rest_range_to = ".( $working_rest_range_to != '' ? "'".$working_rest_range_to."'" : "NULL").", + working_rest_include_ot = '".$working_rest_include_ot."', + working_total_rest_hours2 = '".$working_total_rest_hours2."', + working_rest_range_from2 = ".( $working_rest_range_from2 != '' ? "'".$working_rest_range_from2."'" : "NULL").", + working_rest_range_to2 = ".( $working_rest_range_to2 != '' ? "'".$working_rest_range_to2."'" : "NULL").", + working_rounding_ot = '".$working_rounding_ot."', + working_if_offduty = '".$working_if_offduty."', + working_count_offduty = '".$working_count_offduty."', + working_if_deduct_offduty = '".$working_if_deduct_offduty."', + working_max_ot = ".( $working_max_ot != '' ? "'".$working_max_ot."'" : "NULL").", + updated_at = '".TODAYDATE."' + WHERE working_id = '".$working_id."'") ; + + } + + // add system log + $array_remark = array('old' => array('title' => $row_page['working_name']), + 'new' => array('title' => $page_title)) ; + // refresh page + header("Location:setting-working.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + + + +
          +
          + ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          + +
          +
          +
          +
          +
          +
          + +
          +
          + + $lang['monday'], + '2' => $lang['tuesday'], + '3' => $lang['wednesday'], + '4' => $lang['thursday'], + '5' => $lang['friday'], + '6' => $lang['saturday'], + '7' => $lang['sunday'] ] ; + + if ( $page != '' ){ + $set_workings = [] ; + $get_query = $mysqli->query("SELECT * FROM setting_working + WHERE group_id = '".$page."'") ; + if ( $get_query->num_rows > 0 ){ + while ( $value = $get_query->fetch_assoc() ){ + $set_workings[$value['working_day']] = [ + 'working_on' => $value['working_on'], + 'working_if_flexi' => $value['working_if_flexi'], + 'working_next_day' => $value['working_next_day'], + 'working_if_include_rest' => $value['working_if_include_rest'], + 'working_if_ot' => $value['working_if_ot'], + 'working_if_fixed_work' => $value['working_if_fixed_work'], + 'working_day_calculation' => $value['working_day_calculation'], + 'working_morning_start' => $value['working_morning_start'], + 'working_morning_end' => $value['working_morning_end'], + 'working_period_before' => $value['working_period_before'], + 'working_break_start' => $value['working_break_start'], + 'working_break_end' => $value['working_break_end'], + 'working_break_end_include_ot' => $value['working_break_end_include_ot'], + 'working_afternoon_start' => $value['working_afternoon_start'], + 'working_afternoon_end' => $value['working_afternoon_end'], + 'working_shortbreak_start' => $value['working_shortbreak_start'], + 'working_shortbreak_end' => $value['working_shortbreak_end'], + 'working_night_start' => $value['working_night_start'], + 'working_night_end' => $value['working_night_end'], + 'working_ot_start' => $value['working_ot_start'], + 'working_direct_day' => $value['working_direct_day'], + 'working_if_ot_morning' => $value['working_if_ot_morning'], + 'working_total_hours' => $value['working_total_hours'], + 'working_total_rest_hours' => $value['working_total_rest_hours'], + 'working_rest_range_from' => $value['working_rest_range_from'], + 'working_rest_range_to' => $value['working_rest_range_to'], + 'working_rest_include_ot' => $value['working_rest_include_ot'], + 'working_total_rest_hours2' => $value['working_total_rest_hours2'], + 'working_rest_range_from2' => $value['working_rest_range_from2'], + 'working_rest_range_to2' => $value['working_rest_range_to2'], + 'working_rounding_ot' => $value['working_rounding_ot'], + 'working_if_offduty' => $value['working_if_offduty'], + 'working_count_offduty' => $value['working_count_offduty'], + 'working_if_deduct_offduty' => $value['working_if_deduct_offduty'], + 'working_max_ot' => $value['working_max_ot'] + ] ; + } + } + }else{ + $set_workings = [] ; + for ( $a = 1 ; $a <= 7 ; $a++ ){ + + $set_workings[$a] = [ + 'working_on' => 'yes', + 'working_if_flexi' => 'no', + 'working_next_day' => 'no', + 'working_if_include_rest' => 'no', + 'working_if_ot' => 'no', + 'working_direct_day' => 'no', + 'working_if_ot_morning' => 'no', + 'working_if_fixed_work' => 'no', + 'working_day_calculation' => '00:01:00', + 'working_morning_start' => '08:00:00', + 'working_morning_end' => '08:00:00', + 'working_period_before' => '0', + 'working_break_start' => '09:00:00', + 'working_break_end' => '18:00:00', + 'working_break_end_include_ot' => '00:00:00', + 'working_total_hours' => '08:00:00', + 'working_total_rest_hours' => '01:00:00', + 'working_rest_range_from' => '01:00:00', + 'working_rest_range_to' => '01:00:00', + 'working_rest_include_ot' => '00:00:00', + 'working_total_rest_hours2' => '01:00:00', + 'working_rest_range_from2' => '01:00:00', + 'working_rest_range_to2' => '01:00:00', + 'working_rounding_ot' => '1', + 'working_if_offduty' => 'no', + 'working_count_offduty' => '00:00:00', + 'working_if_deduct_offduty' => 'no', + 'working_max_ot' => '00:00' + ] ; + + } + } + + foreach ( $set_workings as $key => $value ){ + + ?> + +
          +
          + +
          + + +
          + +
          + +
          + +
          +
          + +
          + +
          + +
          +
          + +
          + +
          + +
          +
          + + +
          +
          +
          > + +
          + +
          +
          + + +
          +
          +
          + +
          + +
          +
          +
          +
          + +
          + +
          +
          +
          > + +
          + +
          +
          + +
          +
          +
          +
          + +
          + + +
          +
          + +
          +
          + +
          + +
          +
          +
          > + +
          + +
          +
          + +
          +
          +
          +
          + +
          + + +
          +
          + + +
          + +
          + +
          +
          +
          +
          > + +
          + + +
          +
          +
          + +
          + + * +
          +
          +
          + +
          + + +
          + + * +
          + + +
          +
          +
          + +
          +
          + +
          +
          +
          +
          + +
          + + + + +
          +
          +
          + + + + +
          +
          + +
          +
          +
          +
          + + + + alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; + } + // query type + $search_query = '' ; + + // search query + if ($search != ''){ + $search_query .= " AND (group_name LIKE '%".$search."%')" ; + } + + // form submit + if ($_POST['hide'] == '1' && $_POST['hide_status'] == 'action'){ + // trash item + switch($_POST['page_action']){ + case 'trash': + $mysqli_query = "UPDATE " . setting_working_group . " SET + deleted_at = '".TODAYDATE."' + WHERE group_id = " ; + $trash_page = trashPage('working', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search ; + + // page query + $mysqli_query = "SELECT * FROM setting_working_group + WHERE deleted_at IS NULL " . $search_query ; + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY group_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          + + +
          +
          + + + + +
          +
          + + +
          +
          +
          + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['group_id'] ; + $title = dataFilter($row_page['group_name']) ; + + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
          '.$title.''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/setting-zakat.php b/setting-zakat.php new file mode 100644 index 0000000..063e11e --- /dev/null +++ b/setting-zakat.php @@ -0,0 +1,275 @@ +query("SELECT * FROM setting_salary_tax + WHERE tax_id = '".$page."' LIMIT 1"); + if ($mysqli_page->num_rows > 0){ + // keep query value in array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + $submit_type = 'edit' ; + } + + // update database + if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ + + // keep value in variable + $page_title = escapeString($_POST['title']) ; + $page_title = ($page_title != '' ? $page_title : 'No Title') ; + + $employee_rate = $_POST['employee_rate']; + $employee_rate = ($employee_rate != '' ? $employee_rate : '0') ; + + $employer_rate = $_POST['employer_rate']; + $employer_rate = ($employer_rate != '' ? $employer_rate : '0') ; + + if ( $page == '' ){ + $mysqli->query("INSERT INTO setting_salary_tax (created_at, tax_type) VALUES ('".TODAYDATE."', 'ZAKAT')") ; + $page = $mysqli->insert_id ; + } + + // update database + $mysqli->query("UPDATE setting_salary_tax SET + tax_title = '".$page_title."', + employee_rate = '".$employee_rate."', + employer_rate = '".$employer_rate."', + updated_at = '".TODAYDATE."' + WHERE tax_id = '".$page."'") ; + + // refresh page + header("Location:setting-zakat.php?page_mode=edit&page=".$page."&success=1") ; + $_SESSION['system_result'] = 'success-updated' ; + exit ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + + ?> + + + +
          + + + Thank you, the details have been saved. +
          ' ; + break ; + } + unset($_SESSION['system_result']) ; + } + ?> +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          Employee Zakat Rate (%)
          +
          + +
          +
          +
          +
          Employer Zakat Rate (%)
          +
          + +
          +
          + +
          +
          +
          + + + +
          +
          +
          +
          +
          + + query($mysqli_query." ORDER BY tax_id LIMIT $start_from, " . LIMIT) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          + + + +
          + +
          +
          + + + + +
          +
          + +
          +
          +
          + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['tax_id'] ; + $title = $row_page['tax_title'] ; + + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
          '.$title.''.resetDateFormat($row_page['created_at']).' +
          + + +
          +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          + \ No newline at end of file diff --git a/sftp-config.json b/sftp-config.json new file mode 100644 index 0000000..5c88de7 --- /dev/null +++ b/sftp-config.json @@ -0,0 +1,45 @@ +{ + // The tab key will cycle through the settings when first created + // Visit https://codexns.io/products/sftp_for_subime/settings for help + + // sftp, ftp or ftps + "type": "sftp", + + "save_before_upload": true, + "upload_on_save": true, + "sync_down_on_open": false, + "sync_skip_deletes": false, + "sync_same_age": false, + "confirm_downloads": false, + "confirm_sync": true, + "confirm_overwrite_newer": false, + + "host": "ftp.worknova.co", + "user": "worknovaco", + "password": "Srrq.}?1_$fE", + "remote_path": "/home/worknovaco/public_html/system/", + "port": "8288", + + "ignore_regexes": [ + "\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json", + "sftp-settings\\.json", "/venv/", "\\.svn/", "\\.jpg/", "\\.hg/", "\\.git/", + "\\.bzr", "_darcs", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini", "/Doc/", "/flags/", "/cgi-bin/", "/\\.well-known/", "/PHPExcel/", "/libphonenumber-for-php/", "/Plugins/", "/Ckeditor/", "/ckeditor/", "php\\.ini/" + ], + //"file_permissions": "664", + //"dir_permissions": "775", + + //"extra_list_connections": 0, + + "connect_timeout": 30, + //"keepalive": 120, + //"ftp_passive_mode": true, + //"ftp_obey_passive_host": false, + //"ssh_key_file": "~/.ssh/id_rsa", + //"sftp_flags": ["-F", "/path/to/ssh_config"], + + //"preserve_modification_times": false, + //"remote_time_offset_in_hours": 0, + //"remote_encoding": "utf-8", + //"remote_locale": "C", + //"allow_config_upload": false, +} diff --git a/staff_achievement.php b/staff_achievement.php new file mode 100644 index 0000000..82b877b --- /dev/null +++ b/staff_achievement.php @@ -0,0 +1,65 @@ +query("SELECT staff_id, staff_star, staff_point_achievement, staff_point, staff_achievement FROM staff + WHERE deleted_at IS NULL AND ( staff_date_resigned >= '".date("Y-m-d",time())."' OR staff_date_resigned = '0000-00-00' OR staff_date_resigned IS NULL )") ; + +if ( $staffs_q->num_rows > 0 ){ + + $yesterday_day = date( 'Y-m-d', strtotime( '-1 days' ) ) ; + $year_end = date( 'Y', strtotime( '-1 days' ) ) ; + $is_year_end = ( date( 'm-d', strtotime( '-1 days' ) ) == '12-31' ? true : false ) ; + $is_year_end = true ; + + while ( $staff = $staffs_q->fetch_assoc() ){ + + $staff_id = $staff['staff_id'] ; + $staff_star = $staff['staff_star'] ; + $staff_point_achievement = $staff['staff_point_achievement'] ; + $staff_achievement = $staff['staff_achievement'] ; + $staff_point = $staff['staff_point'] ; + + // $mysqli->query( "INSERT INTO staff_monthly_achievement + // ( reported_at, staff_id, staff_point_achievement, staff_star, staff_achievement ) VALUES + // ( '".$yesterday_day."', '".$staff_id."', '".$staff_point_achievement."', '".$staff_star."', '".$staff_achievement."' )" ) ; + + // $staff_point_achievement = ( $staff_point_achievement <= 0 ? $staff_point_achievement : 0 ) ; + + // $mysqli->query( "UPDATE staff SET + // staff_star = '0', + // staff_point_achievement = '".$staff_point_achievement."' + // WHERE staff_id = '".$staff_id."'" ) ; + + echo '----' ; + echo "\n" ; + echo $staff_id ; + echo "\n" ; + + + if ( $is_year_end ){ + $mysqli->query( "INSERT INTO staff_point_movement_cutoff + ( `staff_id`, `cutoff_year`, `amount` ) VALUES + ( '".$staff_id."', '".$year_end."', '".$staff_point."' )" ) ; + + $last_cutoff_id = $mysqli->insert_id ; + + if ( $staff_point < 0 || $staff_point > 0 ){ + $point_amount = -( $staff_point ) ; + + echo $staff_point ; + echo "\n" ; + echo $point_amount ; + echo "\n" ; + echo "\n" ; + echo "\n" ; + echo "\n" ; + + pointMovement( 'staff_point_movement_cutoff', $last_cutoff_id, 'reset', 'normal', $staff_id, $point_amount, 'Year end reset point to zero' ) ; + } + } + + } +} +?> \ No newline at end of file diff --git a/synctoall.php b/synctoall.php new file mode 100644 index 0000000..5930200 --- /dev/null +++ b/synctoall.php @@ -0,0 +1,60 @@ + '137.59.110.220', 'database' => 'mrsb_systemnew', 'username' => 'mrsb_systemnew', 'password' => '7*YQ@@J?xTed' ], + [ 'host' => '137.59.110.220', 'database' => 'mrsb_system2', 'username' => 'mrsb_system2', 'password' => 'G^WjC39%HumN' ], + [ 'host' => '137.59.109.229', 'database' => 'seow_hrnew', 'username' => 'seow_hrnew', 'password' => 'its@123#ips' ], + [ 'host' => '110.4.41.139', 'database' => 'itssyste_ips2', 'username' => 'itssyste_ips2', 'password' => 'its@123#ips' ], + [ 'host' => '110.4.41.139', 'database' => 'itssystem_demoadvance', 'username' => 'itssystem_demoadvance', 'password' => 'its@123#ips' ], + [ 'host' => '137.59.110.220', 'database' => 'kindlemindcommy_hr', 'username' => 'kindlemindcommy_hr', 'password' => 'its@123#ips' ], + [ 'host' => '137.59.110.220', 'database' => 'kindlemindcommy_hr2', 'username' => 'kindlemindcommy_hr2', 'password' => 'its@123#ips' ] +] ; + + +$html = '' ; + + +// staff_adjustmentwallet +// staff_wallet_movement +// setting_wallet + +foreach ( $listing as $k => $v ){ + + // request database + $host = $v['host'] ; + $username = $v['username'] ; + $password = $v['password'] ; + $database = $v['database'] ; + $mysqli = new mysqli($host, $username, $password, $database) ; + $mysqli->set_charset("utf8") ; + date_default_timezone_set('Asia/Singapore') ; + + $success = 'no' ; + if ( $mysqli->query( "ALTER TABLE `staff_leave` CHANGE `leave_type` `leave_type` ENUM('unpaid','annual','sick','maternity') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;" ) ){ + $success = 'yes' ; + } + + + $html .= ' + + + + + + ' ; + +} + + +$html .= '
          '.( $k+1 ).''.$v['database'].''.ucwords( $success ).''.$mysqli->error.'
          ' ; + +echo $html ; + + + diff --git a/task-report.php b/task-report.php new file mode 100644 index 0000000..bcd23ef --- /dev/null +++ b/task-report.php @@ -0,0 +1,289 @@ + $v ){ + $search_department_url .= '&search_department%5B'.$k.'%5D='.$v; + } + } +} +if ( $search_tier != '' ){ + $search_query .= " AND a.staff_tier = '".$search_tier."'" ; +} +if ( $search_datefrom != '' ){ + if ( $search_dateto != '' ){ + $search_query .= " AND a.created_at BETWEEN '".$search_datefrom." 00:00:00' AND '".$search_dateto." 23:59:59'" ; + }else{ + $search_query .= " AND a.created_at LIKE '%".$search_datefrom."%'" ; + } +} + +// set search url +$search_url = 'is_app='.$is_app.'&search='.$search.'&search_name='.$search_name.'&search_idno='.$search_idno.'&search_branch='.$search_branch.'&search_tier='.$search_tier . $search_department_url ; + +// page query +$mysqli_query = "SELECT a.staff_id, a.staff_name, a.staff_idno, a.staff_tier, + ( select COUNT(task_id) from task where created_by = a.staff_id ) as total_created, + ( select COUNT(task_id) from task where assigned_by = a.staff_id ) as total_assigned, + ( select COUNT(task_id) from task_joinstaff where staff_id = a.staff_id ) as total_executed + FROM staff a + WHERE a.deleted_at IS NULL AND ( a.staff_date_resigned >= '".date("Y-m-d",time())."' OR a.staff_date_resigned = '0000-00-00' OR a.staff_date_resigned IS NULL )" . $search_query . $user_branch_permission_sql_a ; +$mysqli_page = $mysqli->query( $mysqli_query." ORDER BY a.staff_tier ASC, a.staff_idno ASC LIMIT $start_from, " . LIMIT ) ; + +// load pagination +$page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + +// all required parameter +// get all branch +$branch = [] ; +$get_branch = $mysqli->query("SELECT branch_id, branch_name FROM branch + WHERE deleted_at IS NULL") ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// department check list +$department = [] ; +$get_department = $mysqli->query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; +if ( $get_department->num_rows > 0 ){ + while ( $row_department = $get_department->fetch_assoc() ){ + $department[$row_department['department_id']] = $row_department['department_desc'] ; + } +} + +// 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 ; + } +} + +// start header here +include 'requires/page_header.php' ; +include 'requires/page_top.php' ; +?> + + + + + + +
          +
          + + +
          +
          search
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + +
          + +
          +
          listing
          +
          + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ){ + + echo ' + ' ; + if ( $is_app != 'yes' ){ + echo ' + ' ; + } + echo ' + + + + + + + '; + } + }else{ + echo ' + + + '.( $is_app != 'yes' ? '' : '' ).' + + + + + + ' ; + } + ?> + +
          ActionTierIDNameTotal CreatedTotal AssignedTotal Executed
          + + '.dataFilter($row_page['staff_tier']).''.dataFilter($row_page['staff_idno']).''.dataFilter($row_page['staff_name']).' + '.( $row_page['total_created'] > 0 ? $row_page['total_created'] : '' ).' + + '.( $row_page['total_assigned'] > 0 ? $row_page['total_assigned'] : '' ).' + + '.( $row_page['total_executed'] > 0 ? $row_page['total_executed'] : '' ).' +
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + + \ No newline at end of file diff --git a/task.php b/task.php new file mode 100644 index 0000000..83edd9d --- /dev/null +++ b/task.php @@ -0,0 +1,827 @@ +query("SELECT a.department_id, b.department_desc FROM setting_department a + LEFT JOIN setting_department_translation b ON ( a.department_id = b.department_id ) + WHERE a.deleted_at IS NULL AND b.lang = 'en'") ; +if($mysqli_department->num_rows > 0){ + while($row_department = $mysqli_department->fetch_assoc()){ + $array_department[$row_department['department_id']] = $row_department['department_desc']; + } +} + +$array_staff = []; + +$mysqli_staff = $mysqli->query("SELECT staff_id,staff_name FROM staff WHERE deleted_at is null"); +if($mysqli_staff->num_rows > 0){ + while($row_staff = $mysqli_staff->fetch_assoc()){ + $array_staff[$row_staff['staff_id']] = $row_staff['staff_name']; + } +} + +// keep parameter in value +$page = escapeString($_GET['page']) ; +$page_mode = escapeString($_GET['page_mode']) ; +$type = escapeString($_GET['type']) ; +$search = escapeString($_GET['search']) ; +$search_staffid = escapeString($_GET['search_staffid']) ; +$search_mode = escapeString($_GET['search_mode']) ; + +// active menu bar +$active_main_menu = 'task' ; +$active_sub_menu = 'task-list' ; +$active_menu = 'task-list' ; + +// mode type | all list | new | edit +switch($page_mode){ + //view item + case 'view': + + //define initial data + $department_name = $staff_name_created = $staff_name_assigned = '-'; + $staff_name_executed = [] ; + + //get all data + $mysqli_page = $mysqli->query("SELECT * FROM task WHERE task_id = '".$page."' "); + + if($mysqli_page->num_rows > 0){ + $row_page = $mysqli_page->fetch_assoc(); + + //handle task status + $status = taskStatusButton($row_page['status']); + + //handle task difficulty + $difficulty_color = setDifficulty($row_page['difficulty']); + + $task_type = resetTaskType($row_page['task_type']); + + //todo summary + if($row_page['todo_list'] > 0){ + $todo = $row_page['todo_done'].' / '.$row_page['todo_list']; + }else{ + $todo = '-'; + } + + + //get department name + if($row_page['department_id'] != '' && $row_page['department_id'] != '0'){ + $department_name = getDepartmentName($row_page['department_id']); + } + + //get create task staff + if($row_page['created_by'] != '' && $row_page['created_by'] != '0'){ + $staff_name_created = getStaffName($row_page['created_by']); + } + + //get assign task staff + if($row_page['assigned_by'] != '' && $row_page['assigned_by'] != '0'){ + $staff_name_assigned = getStaffName($row_page['assigned_by']); + } + + //get execute task staff + $select_executed = $mysqli->query( "SELECT staff_id FROM task_joinstaff WHERE task_id = '".$page."'" ) ; + if ( $select_executed->num_rows > 0 ){ + while ( $row_executed = $select_executed->fetch_assoc() ){ + $staff_name_executed[] = getStaffName($row_executed['staff_id']); + } + } + + //get reject task staff + if($row_page['rejected_by'] != '' && $row_page['rejected_by'] != '0'){ + $staff_name_rejected = getStaffName($row_page['rejected_by']); + } + + //get all todo list + $mysqli_todo = $mysqli->query("SELECT * FROM task_todo WHERE task_id = '".$page."' AND deleted_at IS NULL ORDER BY sortable ASC, todo_id ASC"); + + $mysqli_rejected = $mysqli->query("SELECT * FROM task_rejected WHERE task_id='".$page."' AND deleted_at IS NULL"); + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + + + +
          +
          + +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          + +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          + + + +
          +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          + + + + + + + + + + + + + num_rows > 0 ){ + while( $row_todo = $mysqli_todo->fetch_assoc() ){ + $staff_name_done = '-'; + + if($row_todo['is_done'] == 'yes'){ + $is_done = ''; + }else{ + $is_done = ''; + } + + //get create task staff + if($row_todo['done_by'] != '' && $row_todo['done_by'] != '0'){ + $staff_name_done = getStaffName($row_todo['done_by']); + } + + $mysqli_image = $mysqli->query("SELECT file, filetype FROM task_media WHERE todo_id = '".$row_todo['todo_id']."' AND deleted_at IS NULL") ; + + $mysqli_remark = $mysqli->query("SELECT title FROM task_todo_remark WHERE todo_id = '".$row_todo['todo_id']."' AND deleted_at IS NULL") ; + + echo ' + + + + + + + + '; + } + } + ?> + +
          '.dataFilter($row_todo['title']).''.$is_done.''.$staff_name_done.''.resetDateFormat($row_todo['done_at']).'' ; + if( $mysqli_image->num_rows > 0 ){ + while( $row_image = $mysqli_image->fetch_assoc() ){ + + switch ( $row_image['filetype'] ){ + case 'jpg' : + case 'jpeg' : + case 'png' : + echo ' + + ' ; + break ; + default : + echo ' + + ' ; + } + + } + }else{ + echo '-'; + } + echo ' + ' ; + if( $mysqli_remark->num_rows > 0 ){ + while( $row_remark = $mysqli_remark->fetch_assoc() ){ + echo $row_remark['title'].'
          '; + } + }else{ + echo '-'; + } + echo ' +
          +
          +
          +
          + +
          +
          +
          +
          +
          +
          +
          +
          + + + + + + + + + + num_rows > 0 ){ + while( $row_rejected = $mysqli_rejected->fetch_assoc() ){ + echo ' + + + + + '; + } + }else{ + echo ' + + + + + ' ; + } + ?> + +
          '.dataFilter($row_rejected['title']).''.resetDateFormat($row_rejected['done_at']).''.dataFilter($row_rejected['remark']).'
          '.$lang['no_data'].'
          +
          +
          +
          +
          +
          + + query("UPDATE task SET + deleted_at = '".TODAYDATE."' + WHERE task_id = '".$_GET['id']."' ") ; + + header('Location: '.PATH.'task.php?page_mode=list'); + + + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search.'&search_staffid='.$search_staffid.'&search_mode='.$search_mode ; + + // page query + $mysqli_query = "SELECT * FROM task a + WHERE a.deleted_at IS NULL " . $search_query.$user_branch_permission_sql_task ; + // print_r($mysqli_query);exit; + // export excel + if ( $export == 'yes' ){ + + include 'PhpExcel/PHPExcel.php' ; + + $page_filename = 'Task-'.date( 'Ymd', time() ) ; + $objPHPExcel = new PHPExcel() ; + $objPHPExcel->getProperties() + ->setCreator(COMPANY) + ->setTitle(COMPANY) + ->setSubject(COMPANY) + ->setDescription(COMPANY) + ->setKeywords(COMPANY) + ->setCategory(COMPANY) ; + + $objPHPExcel->getActiveSheet()->setTitle( $page_filename ) ; + $objPHPExcel->setActiveSheetIndex(0); + $objWriter = PHPExcel_IOFactory::createWriter( $objPHPExcel, 'Excel5' ) ; + + // default parameter + $count = 1 ; + $char = 'A' ; + $count_staff = 1 ; + + $array_title = array( 'No.', 'Task', 'Task Type', 'Status', 'Department','Created By', 'Difficulty','Todo','start date','End Date','Created At' ) ; + + $newChar = $char ; + foreach( $array_title as $k => $v ){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( $newChar.$count, $v ) ; + $newChar++ ; + } + $count++ ; + + $redeem_q = $mysqli->query( $mysqli_query ) ; + if ( $redeem_q->num_rows > 0 ){ + while ( $redeem_page = $redeem_q->fetch_assoc() ){ + // default variable + $id = $redeem_page['task_id'] ; + + //handle task status + $status = $redeem_page['status']; + + //handle task difficulty + $difficulty_color = setDifficulty($redeem_page['difficulty']); + + $task_type = resetTaskType($redeem_page['task_type']); + + //get department name + if($redeem_page['department_id'] != '' && $redeem_page['department_id'] != '0'){ + $department_name = getDepartmentName($redeem_page['department_id']); + } + + //get create task staff + if($redeem_page['created_by'] != '' && $redeem_page['created_by'] != '0'){ + $staff_name_created = getStaffName($redeem_page['created_by']); + } + + $todo = $redeem_page['todo_done'].' / '.$redeem_page['todo_list']; + + + $newChar = $char ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $count_staff ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($redeem_page['title']) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, $task_type ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, ucfirst($status) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($department_name != '' ? $department_name : 'Cross Department') ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($staff_name_created) ) ; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($redeem_page['difficulty']) ); + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, dataFilter($todo) ); + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, resetDateFormat($redeem_page['date_start']) ); + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, resetDateFormat($redeem_page['date_end']) ); + $objPHPExcel->setActiveSheetIndex(0)->setCellValue( ($newChar++).$count, resetDateFormat($redeem_page['created_at']) ) ; + + $count++ ; + $count_staff++ ; + } + } + + header( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' ) ; + header( 'Content-Disposition: attachment;filename="'.$page_filename.'.xls"' ) ; + header( 'Cache-Control: max-age=0' ) ; + // save to pc + ob_clean(); + $objWriter->save('php://output') ; + header( "Refresh: 0" ) ; + exit ; + + } + + // print_r($mysqli_query);exit; + + $mysqli_page = $mysqli->query( $mysqli_query." ORDER BY a.task_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + ?> + + + +
          +
          + + +
          +
          search
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + + + +
          +
          +
          +
          +
          + +
          + +
          +
          listing + +
          +
          + + + + + + + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + // default variable + $id = $row_page['task_id'] ; + + //handle task status + $status = taskStatusButton($row_page['status']); + + //handle task difficulty + $difficulty_color = setDifficulty($row_page['difficulty']); + + $task_type = resetTaskType($row_page['task_type']); + + //get department name + if($row_page['department_id'] != '' && $row_page['department_id'] != '0'){ + $department_name = getDepartmentName($row_page['department_id']); + } + + //get create task staff + if($row_page['created_by'] != '' && $row_page['created_by'] != '0'){ + $staff_name_created = getStaffName($row_page['created_by']); + } + + $todo = $row_page['todo_done'].' / '.$row_page['todo_list']; + + echo ' + + + + + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + + + + + + ' ; + } + ?> + +
          + '; + + if($row_user['user_permission'] == 'admin' || permissionCheck($row_user, 'task-list-trash')){ + echo'| + + '; + } + + + + echo' + '.dataFilter($row_page['title']).''.$task_type.'
          '.$status.'
          '.dataFilter($department_name != '' ? $department_name : 'Cross Department').''.dataFilter($staff_name_created).''.dataFilter($row_page['difficulty']).''.dataFilter($todo).''.resetDateFormat($row_page['date_start']).''.resetDateFormat($row_page['date_end']).''.resetDateFormat($row_page['created_at']).''.resetDateFormat($row_page['updated_at']).'
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/test.php b/test.php new file mode 100644 index 0000000..726989f --- /dev/null +++ b/test.php @@ -0,0 +1,491 @@ +modify('+1 day'); // Include the last day + +$dates = []; +$interval = new DateInterval('P1D'); // 1 day interval +$date_period = new DatePeriod($start_date, $interval, $end_date); + +foreach ($date_period as $date) { + $dates[] = $date->format('Y-m-d'); +} + + + +$select = $mysqli->query("select * from staff where deleted_at is null and staff_id = '138'") ; + +if ( $select->num_rows > 0 ){ + + while ( $row = $select->fetch_assoc() ){ + + foreach ( $dates as $k => $v ){ + + $selectattendance = $mysqli->query("SELECT * FROM `staff_attendance_list` WHERE `staff_id` = '".$row['staff_id']."' and list_date LIKE '%".$v."%' and deleted_at is null;") ; + + if ( $selectattendance->num_rows == 0 ){ + echo $row['staff_id'] . ' : ' . $v ; + echo "\n\n" ; + } + + } + + echo "\n\n" ; + echo "\n\n" ; + echo "\n\n" ; + echo "\n\n" ; + + + } +} + + + + + + +exit; + + + + + +$a = '' ; + + +$b = json_decode($a, true) ; + +$c = $b['2']['data'] ; + +$select_staff = $mysqli->query("select * from staff where branch_id = '1'") ; +if ( $select_staff->num_rows > 0 ){ + while ($row_staff = $select_staff->fetch_assoc() ){ + + $check = false ; + foreach ( $c as $k => $v ){ + if ( $v['badgenumber'] == $row_staff['staff_idno'] ){ + $check = true ; + } + } + + if ( !$check ){ + + // $mysqli->query("update staff set updated_at = '".date("Y-m-d H:i:s", time())."' where staff_id = '".$row_staff['staff_id']."'") ; + + echo "update staff set updated_at = '".date("Y-m-d H:i:s", time())."' where staff_id = '".$row_staff['staff_id']."' ;" ; + echo "\n\n" ; + } + + } +} + + +exit ; + + +// $mysqli->query("UPDATE `staff_leave_month` SET +// `given_date` = '2023-06-01' +// WHERE `given_date` = '0000-00-00'"); + + + + + + +exit ; +$select = $mysqli->query( "SELECT SUM(given_day) as total, staff_id FROM staff_leave_month + GROUP BY staff_id" ) ; + + +while ( $row = $select->fetch_assoc() ){ + + + $get_leave_year = $mysqli->query("SELECT leave_year_id, leave_record_days FROM staff_leave_year + WHERE deleted_at IS NULL AND staff_id = '".$row['staff_id']."' AND leave_type = 'annual' AND leave_year = '2023' LIMIT 1") ; + if ( $get_leave_year->num_rows > 0 ){ + $row_leave_year = $get_leave_year->fetch_assoc() ; + + + $staff = $mysqli->query( "SELECT leave_given_days FROM staff_leave_year + WHERE leave_type = 'annual' AND leave_year = '2023' AND staff_id = '".$row['staff_id']."'" ) ; + $row_staff = $staff->fetch_assoc() ; + + $extra_days = ( $row_staff['leave_given_days'] - $row['total'] ) ; + if ( $extra_days > 0 ){ + + echo "INSERT INTO staff_leave_month + ( leave_year_id, staff_id, given_month, given_day ) VALUES + ( '".$row_leave_year['leave_year_id']."', '".$row['staff_id']."', '6', '".$extra_days."' )" ; + + print_r('
          ') ; + print_r('
          ') ; + + + // $mysqli->query( "INSERT INTO staff_leave_month + // ( leave_year_id, staff_id, given_month, given_day ) VALUES + // ( '".$row_leave_year['leave_year_id']."', '".$row['staff_id']."', '6', '".$extra_days."' )" ) ; + + // $mysqli->query( "UPDATE staff_leave_year SET + // leave_days = leave_days + ".$extra_days." + // WHERE leave_year_id = '".$row_leave_year['leave_year_id']."'" ) ; + + print_r('
          ') ; + print_r($row) ; + print_r('
          ') ; + print_r($extra_days) ; + print_r('
          ') ; + print_r('
          ') ; + print_r('
          ') ; + print_r('
          ') ; + + + } + + } + +} + + + + + + + + + + + + + + +exit ; +$select = $mysqli->query( "SELECT * FROM staff_leave_year + WHERE leave_type = 'annual' AND leave_year = '2023'" ) ; + + + + + + +// // Define the plaintext, IV, and encryption key +// $plaintext = '{"CompanyID":"1","IsActive":"1"}'; +// $key = '1234567890030188'; +// $iv = 'Info-TechGateWay' ; + +// // Encrypt the plaintext using AES-256-CBC +// $ciphertext = openssl_encrypt($plaintext, 'aes-128-cbc', $key, OPENSSL_RAW_DATA, $iv); + +// // Encode the ciphertext in base64 for output +// $output = base64_encode($ciphertext); + +// echo $output; + +// exit ; + + + + + + + + + + + + + + +exit ; +$rms_call = rmsCall( 'pinless/getproductidlistbymobilenumber', $rms_content ) ; +print_r($rms_call) ; + +exit ; + + + +$parameter = [ + 'referenceId' => 'TESTBO000043', + 'countryCode' => '60', + 'mobileNumber' => '176168619' +] ; + +$post = 'POST' ; +$path = 'https://api-qa.molreloads.com/terminal/v1/pinless/getproductidlistbymobilenumber' ; +$content = json_encode($parameter) ; +// $datetime = gmdate("Y-m-d\TH:i:s\Z") ; +$datetime = '2023-05-07T12:36:32Z' ; +$terminal = 'IPSSB01001' ; +// $terminal = '000300001' ; +$terminaltobase64 = base64_encode($terminal) ; +$key = '3566977797971712' ; +// $key = '0806105298910204' ; + +$data = $post . $path . $content . $datetime . $terminal ; + +$signature = hash_hmac("sha1", $data, $key) ; +$signaturetobase64 = base64_encode($signature) ; + + + +echo 'Post: '.$post ; +echo '
          ' ; +echo 'Path: '.$path ; +echo '
          ' ; +echo 'Content: '.$content ; +echo '
          ' ; +echo 'Datetime: '.$datetime ; +echo '
          ' ; +echo 'Terminal: '.$terminal ; +echo '
          ' ; +echo 'Terminal Base64: '.$terminaltobase64 ; +echo '
          ' ; +echo 'Secret Key: '.$key ; +echo '
          ' ; +echo 'Signature Before: '.$data ; +echo '
          ' ; +echo 'Signature: '.$signature ; +echo '
          ' ; +echo 'Signature Base64: '.$signaturetobase64 ; +echo '
          ' ; +echo '
          ' ; +echo '
          ' ; +print_r(array( + 'Authorization: mol-req-sign '.$terminaltobase64.':'.$signaturetobase64, + 'Content-Type: application/json', + 'x-mol-date-time: '.$datetime +)) ; + + +$curl = curl_init(); + +curl_setopt_array($curl, array( + CURLOPT_URL => $path, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => $content, + CURLOPT_HTTPHEADER => array( + 'authorization: mol-req-sign '.$terminaltobase64.':'.$signaturetobase64, + 'content-type: application/json', + 'x-mol-date-time: '.$datetime + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; + + + + +exit ; + +?> + + + + + + + + + + + + + +
          +
          +
          + + + + + +query("SELECT * FROM setting_point where point_from = 'task' AND deleted_at IS NULL") ; +if ( $select_point->num_rows > 0 ){ + while ( $row_point = $select_point->fetch_assoc() ){ + $array_point[$row_point['point_type']][$row_point['difficulty']] = $row_point['point_value'] ; + } +} + + +$select_task = $mysqli->query("SELECT * FROM task where status = 'approved' AND deleted_at IS NULL ORDER BY task_id DESC") ; + + +if ( $select_task->num_rows > 0 ){ + while ( $row_task = $select_task->fetch_assoc() ){ + + $point_earn = $array_point[$row_task['task_type']][$row_task['difficulty']] ; + + $extra = ( $point_earn + $row_task['extra'] ) ; + + $earned_assigned = ( $row_task['incentive'] + $extra ) ; + $earned_executed = ( $row_task['incentive2'] + $extra ) ; + + echo $row_task['task_type'] . ' : ' . $row_task['difficulty'] . ' = ' . $extra ; + echo "\n" ; + echo $row_task['incentive'] . ' : ' . $row_task['incentive2'] ; + echo "\n" ; + echo $row_task['task_so'] . " : " . $row_task['assigned_by'] . ' : ( '.$earned_assigned.' : '.$earned_executed.' ) ' ; + echo "\n" ; + + $select_movement = $mysqli->query("SELECT * FROM staff_point_movement WHERE from_table = 'task' AND from_id = '".$row_task['task_id']."' AND remark LIKE '%Earn incentive from task%'") ; + if ( $select_movement->num_rows > 0 ){ + while ( $row_movement = $select_movement->fetch_assoc() ){ + + echo $row_movement['remark'] . " : " . $row_movement['staff_id'] . " : " . $row_movement['amount'] ; + echo "\n" ; + } + } + + echo "\n" ; + echo "\n" ; + echo "\n" ; + echo "\n" ; + echo "\n" ; + + } +} + + + + + + + + + + + + +exit ; + + +$array = [ + [ 'table' => 'announcement_translation', 'key' => 'announcement_id', 'related' => [ 'title', 'content' ] ], + [ 'table' => 'app_menu_translation', 'key' => 'menu_id', 'related' => [ 'title', 'content' ] ], + [ 'table' => 'app_page_translation', 'key' => 'page_id', 'related' => [ 'title', 'content' ] ], + [ 'table' => 'app_screen_translation', 'key' => 'screen_id', 'related' => [ 'title', 'content' ] ], + [ 'table' => 'app_service_translation', 'key' => 'service_id', 'related' => [ 'title' ] ], + [ 'table' => 'app_support_translation', 'key' => 'support_id', 'related' => [ 'name' ] ], + [ 'table' => 'association_category_translation', 'key' => 'category_id', 'related' => [ 'title' ] ], + [ 'table' => 'association_translation', 'key' => 'association_id', 'related' => [ 'title', 'content' ] ], + [ 'table' => 'form_category_translation', 'key' => 'category_id', 'related' => [ 'title' ] ], + [ 'table' => 'form_translation', 'key' => 'form_id', 'related' => [ 'title' ] ], + [ 'table' => 'handbook_category_translation', 'key' => 'category_id', 'related' => [ 'title' ] ], + [ 'table' => 'handbook_translation', 'key' => 'handbook_id', 'related' => [ 'title' ] ], + [ 'table' => 'nomination_translation', 'key' => 'nomination_id', 'related' => [ 'title', 'content' ] ], + [ 'table' => 'profile_achievement_translation', 'key' => 'achievement_id', 'related' => [ 'title', 'content' ] ], + [ 'table' => 'profile_point_translation', 'key' => 'point_id', 'related' => [ 'title', 'sub', 'content' ] ], + [ 'table' => 'profile_star_translation', 'key' => 'star_id', 'related' => [ 'title', 'content' ] ], + [ 'table' => 'profile_tier_translation', 'key' => 'tier_id', 'related' => [ 'title', 'sub', 'content' ] ], + [ 'table' => 'redeem_translation', 'key' => 'redeem_id', 'related' => [ 'title', 'content' ] ], + [ 'table' => 'setting_adjustment_translation', 'key' => 'adjustment_id', 'related' => [ 'title' ] ], + [ 'table' => 'setting_department_translation', 'key' => 'department_id', 'related' => [ 'department_desc' ] ], + [ 'table' => 'setting_difficulty_translation', 'key' => 'difficulty_id', 'related' => [ 'title' ] ], + [ 'table' => 'setting_job_position_translation', 'key' => 'job_position_id', 'related' => [ 'job_position_desc' ] ], + [ 'table' => 'setting_job_section_translation', 'key' => 'job_section_id', 'related' => [ 'job_section_desc' ] ], + [ 'table' => 'setting_request_sub_translation', 'key' => 'sub_id', 'related' => [ 'title' ] ], + [ 'table' => 'setting_request_translation', 'key' => 'main_id', 'related' => [ 'title' ] ], + [ 'table' => 'training_translation', 'key' => 'training_id', 'related' => [ 'title', 'content' ] ] +] ; + + + +foreach ( $array as $k => $v ){ + + $table_from = str_replace( '_translation', '', $v['table'] ) ; + $table_to = $v['table'] ; + + $select = $mysqli->query( "SELECT * FROM " . $table_from ) ; + if ( $select->num_rows > 0 ){ + while ( $row = $select->fetch_assoc() ){ + + $insert_key = '' ; + $insert_value = '' ; + foreach ( $v['related'] as $krelated => $vrelated ){ + $insert_key .= ", " . $vrelated ; + $insert_value .= ", '" . $row[$vrelated] . "'" ; + } + + // echo "INSERT INTO " . $table_to . " + // ( ".$v['key']." ".$insert_key." ) VALUES + // ( '".$row[$v['key']]."' ".$insert_value." )" ; + // echo '
          ' ; + // echo '
          ' ; + // echo '
          ' ; + // echo '
          ' ; + // echo '
          ' ; + + foreach ( $LANGS as $klang => $vlang ){ + $mysqli->query( "INSERT INTO " . $table_to . " + ( lang, ".$v['key']." ".$insert_key." ) VALUES + ( '".$klang."', '".$row[$v['key']]."' ".$insert_value." )" ) ; + } + + } + } + +} + + + + + + + + + +// $staff_info['staff_name'] = 'Jimmy' ; +// $staff_info['staff_email'] = 'Jimmy@ips.com.my' ; +// $leave_type = 'Test' ; + + +// // send email when apply leave +// $content = ' +// Hello Team,

          +// Please approve '.$staff_info['staff_name'].' leave.

          +//

          +// The approval for this application belongs to you, so do keep this e-mail safe.' ; + +// $mailer = new Mailer() ; +// $mailer->from = EMAILNOREPLY ; +// $mailer->to = $EMAILCC ; +// $mailer->cc = [ $staff_info['staff_email'] ] ; +// $mailer->subject = ucwords($leave_type).' leave request from '.$staff_info['staff_name'] ; +// $mailer->body = $content ; +// $mailer->send() ; \ No newline at end of file diff --git a/testform1.php b/testform1.php new file mode 100644 index 0000000..25ddde8 --- /dev/null +++ b/testform1.php @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/testform2.php b/testform2.php new file mode 100644 index 0000000..401e955 --- /dev/null +++ b/testform2.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/testform3.php b/testform3.php new file mode 100644 index 0000000..e0f0dc5 --- /dev/null +++ b/testform3.php @@ -0,0 +1,6 @@ + + + Testform3 + + + \ No newline at end of file diff --git a/txt/ignored.md b/txt/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/update.php b/update.php new file mode 100644 index 0000000..a0e4879 --- /dev/null +++ b/update.php @@ -0,0 +1,50 @@ + 0 ){ + $status = '203' ; + + if ( $mysqli->query( "INSERT INTO formheadcount + ( `branch_id`, `staff_id`, `type`, `title`, `content`, `status` ) VALUES + ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$array['suggest_type']."', '".$array['title']."', '".$array['content']."', 'pending' )" ) ){ + $status = '200' ; + + $boolean_submit = true ; + $formheadcount_id = $mysqli->insert_id ; + + $formheadcount_so = 'SG'.strPad( 6, $formheadcount_id ) ; + $mysqli->query( "UPDATE formheadcount SET + formheadcount_so = '".$formheadcount_so."' + WHERE formheadcount_id = '".$formheadcount_id."'" ) ; + + if ( checkExists($photos) ){ + foreach ( $photos as $k => $v ){ + if ( $v['type'] == 'local' ){ + $file_upload = ( $v['file'] ) ; + $upload = uploadImage( 'Suggestion', $formheadcount_id.'-'.$formheadcount_id, $file_upload ) ; + if ( $upload['status'] != '200' ){ + $count_upload++ ; + }else{ + $mysqli->query( "INSERT INTO formheadcount_media + ( formheadcount_id, file, filetype ) VALUES + ( '".$formheadcount_id."', '".$upload['data']['file_name']."', '".$upload['data']['file_type']."' )" ) ; + $status = '200' ; + } + } + } + } + } + } +} + +require( $require_sub.'footer.php' ) ; +?> \ No newline at end of file diff --git a/uploads/Announcement/1120x350/ignored.md b/uploads/Announcement/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Announcement/300x200/ignored.md b/uploads/Announcement/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Announcement/350x350/ignored.md b/uploads/Announcement/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Announcement/550x350/ignored.md b/uploads/Announcement/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Announcement/800xauto/ignored.md b/uploads/Announcement/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Announcement/b/ignored.md b/uploads/Announcement/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Announcement/m/ignored.md b/uploads/Announcement/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Announcement/original/ignored.md b/uploads/Announcement/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppMenu/1120x350/ignored.md b/uploads/AppMenu/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppMenu/300x200/ignored.md b/uploads/AppMenu/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppMenu/350x350/ignored.md b/uploads/AppMenu/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppMenu/550x350/ignored.md b/uploads/AppMenu/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppMenu/800xauto/ignored.md b/uploads/AppMenu/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppMenu/b/ignored.md b/uploads/AppMenu/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppMenu/m/ignored.md b/uploads/AppMenu/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppMenu/original/ignored.md b/uploads/AppMenu/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppPage/1120x350/ignored.md b/uploads/AppPage/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppPage/300x200/ignored.md b/uploads/AppPage/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppPage/350x350/ignored.md b/uploads/AppPage/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppPage/550x350/ignored.md b/uploads/AppPage/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppPage/800xauto/ignored.md b/uploads/AppPage/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppPage/b/ignored.md b/uploads/AppPage/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppPage/m/ignored.md b/uploads/AppPage/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppPage/original/ignored.md b/uploads/AppPage/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppScreen/1120x350/ignored.md b/uploads/AppScreen/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppScreen/300x200/ignored.md b/uploads/AppScreen/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppScreen/350x350/ignored.md b/uploads/AppScreen/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppScreen/550x350/ignored.md b/uploads/AppScreen/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppScreen/800xauto/ignored.md b/uploads/AppScreen/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppScreen/b/ignored.md b/uploads/AppScreen/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppScreen/m/ignored.md b/uploads/AppScreen/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppScreen/original/ignored.md b/uploads/AppScreen/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AppService/10.png b/uploads/AppService/10.png new file mode 100644 index 0000000..256f6a1 Binary files /dev/null and b/uploads/AppService/10.png differ diff --git a/uploads/AppService/12.png b/uploads/AppService/12.png new file mode 100644 index 0000000..9a78afa Binary files /dev/null and b/uploads/AppService/12.png differ diff --git a/uploads/AppService/13.png b/uploads/AppService/13.png new file mode 100644 index 0000000..34a3787 Binary files /dev/null and b/uploads/AppService/13.png differ diff --git a/uploads/AppService/14.png b/uploads/AppService/14.png new file mode 100644 index 0000000..c31ead2 Binary files /dev/null and b/uploads/AppService/14.png differ diff --git a/uploads/AppService/15.png b/uploads/AppService/15.png new file mode 100644 index 0000000..a363f5d Binary files /dev/null and b/uploads/AppService/15.png differ diff --git a/uploads/AppService/16.png b/uploads/AppService/16.png new file mode 100644 index 0000000..7de002a Binary files /dev/null and b/uploads/AppService/16.png differ diff --git a/uploads/AppService/17.png b/uploads/AppService/17.png new file mode 100644 index 0000000..97d0687 Binary files /dev/null and b/uploads/AppService/17.png differ diff --git a/uploads/AppService/18.png b/uploads/AppService/18.png new file mode 100644 index 0000000..1ea96a2 Binary files /dev/null and b/uploads/AppService/18.png differ diff --git a/uploads/AppService/19.png b/uploads/AppService/19.png new file mode 100644 index 0000000..61fa429 Binary files /dev/null and b/uploads/AppService/19.png differ diff --git a/uploads/AppService/20.png b/uploads/AppService/20.png new file mode 100644 index 0000000..2365104 Binary files /dev/null and b/uploads/AppService/20.png differ diff --git a/uploads/AppService/21.png b/uploads/AppService/21.png new file mode 100644 index 0000000..b0faba6 Binary files /dev/null and b/uploads/AppService/21.png differ diff --git a/uploads/AppService/22.png b/uploads/AppService/22.png new file mode 100644 index 0000000..3ed7c1b Binary files /dev/null and b/uploads/AppService/22.png differ diff --git a/uploads/AppService/23.png b/uploads/AppService/23.png new file mode 100644 index 0000000..a969c06 Binary files /dev/null and b/uploads/AppService/23.png differ diff --git a/uploads/AppService/24.png b/uploads/AppService/24.png new file mode 100644 index 0000000..cf78035 Binary files /dev/null and b/uploads/AppService/24.png differ diff --git a/uploads/AppService/26.png b/uploads/AppService/26.png new file mode 100644 index 0000000..f56c389 Binary files /dev/null and b/uploads/AppService/26.png differ diff --git a/uploads/AppService/27.png b/uploads/AppService/27.png new file mode 100644 index 0000000..0ebca7d Binary files /dev/null and b/uploads/AppService/27.png differ diff --git a/uploads/AppService/3.png b/uploads/AppService/3.png new file mode 100644 index 0000000..27c805c Binary files /dev/null and b/uploads/AppService/3.png differ diff --git a/uploads/AppService/4.png b/uploads/AppService/4.png new file mode 100644 index 0000000..42fbb28 Binary files /dev/null and b/uploads/AppService/4.png differ diff --git a/uploads/AppService/5.png b/uploads/AppService/5.png new file mode 100644 index 0000000..63cc053 Binary files /dev/null and b/uploads/AppService/5.png differ diff --git a/uploads/AppService/6.png b/uploads/AppService/6.png new file mode 100644 index 0000000..e6cf928 Binary files /dev/null and b/uploads/AppService/6.png differ diff --git a/uploads/Association/1120x350/ignored.md b/uploads/Association/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Association/300x200/ignored.md b/uploads/Association/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Association/350x350/ignored.md b/uploads/Association/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Association/550x350/ignored.md b/uploads/Association/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Association/800xauto/ignored.md b/uploads/Association/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Association/b/ignored.md b/uploads/Association/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Association/m/ignored.md b/uploads/Association/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Association/original/ignored.md b/uploads/Association/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationCategory/1120x350/ignored.md b/uploads/AssociationCategory/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationCategory/300x200/ignored.md b/uploads/AssociationCategory/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationCategory/350x350/ignored.md b/uploads/AssociationCategory/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationCategory/550x350/ignored.md b/uploads/AssociationCategory/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationCategory/800xauto/ignored.md b/uploads/AssociationCategory/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationCategory/b/ignored.md b/uploads/AssociationCategory/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationCategory/m/ignored.md b/uploads/AssociationCategory/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationCategory/original/ignored.md b/uploads/AssociationCategory/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationGallery/1120x350/ignored.md b/uploads/AssociationGallery/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationGallery/300x200/ignored.md b/uploads/AssociationGallery/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationGallery/350x350/ignored.md b/uploads/AssociationGallery/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationGallery/550x350/ignored.md b/uploads/AssociationGallery/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationGallery/800xauto/ignored.md b/uploads/AssociationGallery/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationGallery/b/ignored.md b/uploads/AssociationGallery/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationGallery/ignored.md b/uploads/AssociationGallery/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationGallery/m/ignored.md b/uploads/AssociationGallery/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/AssociationGallery/original/ignored.md b/uploads/AssociationGallery/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Branch/1120x350/ignored.md b/uploads/Branch/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Branch/300x200/ignored.md b/uploads/Branch/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Branch/350x350/ignored.md b/uploads/Branch/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Branch/550x350/ignored.md b/uploads/Branch/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Branch/800xauto/ignored.md b/uploads/Branch/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Branch/b/ignored.md b/uploads/Branch/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Branch/m/ignored.md b/uploads/Branch/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Branch/original/ignored.md b/uploads/Branch/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Catalog/1120x350/ignored.md b/uploads/Catalog/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Catalog/300x200/ignored.md b/uploads/Catalog/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Catalog/350x350/ignored.md b/uploads/Catalog/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Catalog/550x350/ignored.md b/uploads/Catalog/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Catalog/800xauto/ignored.md b/uploads/Catalog/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Catalog/b/ignored.md b/uploads/Catalog/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Catalog/m/ignored.md b/uploads/Catalog/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Catalog/original/ignored.md b/uploads/Catalog/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/CatalogCategory/1120x350/ignored.md b/uploads/CatalogCategory/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/CatalogCategory/300x200/ignored.md b/uploads/CatalogCategory/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/CatalogCategory/350x350/ignored.md b/uploads/CatalogCategory/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/CatalogCategory/550x350/ignored.md b/uploads/CatalogCategory/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/CatalogCategory/800xauto/ignored.md b/uploads/CatalogCategory/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/CatalogCategory/b/ignored.md b/uploads/CatalogCategory/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/CatalogCategory/m/ignored.md b/uploads/CatalogCategory/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/CatalogCategory/original/ignored.md b/uploads/CatalogCategory/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Customer/1120x350/ignored.md b/uploads/Customer/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Customer/300x200/ignored.md b/uploads/Customer/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Customer/350x350/ignored.md b/uploads/Customer/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Customer/550x350/ignored.md b/uploads/Customer/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Customer/800xauto/ignored.md b/uploads/Customer/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Customer/b/ignored.md b/uploads/Customer/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Customer/m/ignored.md b/uploads/Customer/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Customer/original/ignored.md b/uploads/Customer/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Department/1120x350/ignored.md b/uploads/Department/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Department/300x200/ignored.md b/uploads/Department/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Department/350x350/ignored.md b/uploads/Department/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Department/550x350/ignored.md b/uploads/Department/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Department/800xauto/ignored.md b/uploads/Department/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Department/b/ignored.md b/uploads/Department/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Department/m/ignored.md b/uploads/Department/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Department/original/ignored.md b/uploads/Department/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Designer/1120x350/ignored.md b/uploads/Designer/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Designer/300x200/ignored.md b/uploads/Designer/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Designer/350x350/ignored.md b/uploads/Designer/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Designer/550x350/ignored.md b/uploads/Designer/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Designer/800xauto/ignored.md b/uploads/Designer/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Designer/b/ignored.md b/uploads/Designer/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Designer/m/ignored.md b/uploads/Designer/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Designer/original/ignored.md b/uploads/Designer/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Documentation/1120x350/ignored.md b/uploads/Documentation/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Documentation/300x200/ignored.md b/uploads/Documentation/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Documentation/350x350/ignored.md b/uploads/Documentation/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Documentation/550x350/ignored.md b/uploads/Documentation/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Documentation/800xauto/ignored.md b/uploads/Documentation/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Documentation/b/ignored.md b/uploads/Documentation/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Documentation/m/ignored.md b/uploads/Documentation/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Documentation/original/ignored.md b/uploads/Documentation/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Employment/1120x350/ignored.md b/uploads/Employment/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Employment/300x200/ignored.md b/uploads/Employment/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Employment/350x350/ignored.md b/uploads/Employment/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Employment/550x350/ignored.md b/uploads/Employment/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Employment/800xauto/ignored.md b/uploads/Employment/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Employment/b/ignored.md b/uploads/Employment/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Employment/m/ignored.md b/uploads/Employment/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Employment/original/ignored.md b/uploads/Employment/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Grievance/1120x350/ignored.md b/uploads/Grievance/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Grievance/300x200/ignored.md b/uploads/Grievance/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Grievance/350x350/ignored.md b/uploads/Grievance/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Grievance/550x350/ignored.md b/uploads/Grievance/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Grievance/800xauto/ignored.md b/uploads/Grievance/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Grievance/b/ignored.md b/uploads/Grievance/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Grievance/m/ignored.md b/uploads/Grievance/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Grievance/original/ignored.md b/uploads/Grievance/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Handbook/1120x350/ignored.md b/uploads/Handbook/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Handbook/300x200/ignored.md b/uploads/Handbook/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Handbook/350x350/ignored.md b/uploads/Handbook/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Handbook/550x350/ignored.md b/uploads/Handbook/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Handbook/800xauto/ignored.md b/uploads/Handbook/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Handbook/b/ignored.md b/uploads/Handbook/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Handbook/m/ignored.md b/uploads/Handbook/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Handbook/original/ignored.md b/uploads/Handbook/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/HandbookCategory/1120x350/ignored.md b/uploads/HandbookCategory/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/HandbookCategory/300x200/ignored.md b/uploads/HandbookCategory/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/HandbookCategory/350x350/ignored.md b/uploads/HandbookCategory/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/HandbookCategory/550x350/ignored.md b/uploads/HandbookCategory/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/HandbookCategory/800xauto/ignored.md b/uploads/HandbookCategory/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/HandbookCategory/b/ignored.md b/uploads/HandbookCategory/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/HandbookCategory/m/ignored.md b/uploads/HandbookCategory/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/HandbookCategory/original/ignored.md b/uploads/HandbookCategory/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Inbox/1120x350/ignored.md b/uploads/Inbox/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Inbox/300x200/ignored.md b/uploads/Inbox/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Inbox/350x350/ignored.md b/uploads/Inbox/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Inbox/550x350/ignored.md b/uploads/Inbox/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Inbox/800xauto/ignored.md b/uploads/Inbox/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Inbox/b/ignored.md b/uploads/Inbox/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Inbox/m/ignored.md b/uploads/Inbox/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Inbox/original/ignored.md b/uploads/Inbox/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Leave/1120x350/ignored.md b/uploads/Leave/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Leave/300x200/ignored.md b/uploads/Leave/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Leave/350x350/ignored.md b/uploads/Leave/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Leave/550x350/ignored.md b/uploads/Leave/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Leave/800xauto/ignored.md b/uploads/Leave/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Leave/b/ignored.md b/uploads/Leave/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Leave/m/ignored.md b/uploads/Leave/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Leave/original/ignored.md b/uploads/Leave/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Level/1120x350/ignored.md b/uploads/Level/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Level/300x200/ignored.md b/uploads/Level/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Level/350x350/ignored.md b/uploads/Level/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Level/550x350/ignored.md b/uploads/Level/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Level/800xauto/ignored.md b/uploads/Level/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Level/b/ignored.md b/uploads/Level/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Level/m/ignored.md b/uploads/Level/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Level/original/ignored.md b/uploads/Level/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Location/1120x350/ignored.md b/uploads/Location/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Location/300x200/ignored.md b/uploads/Location/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Location/350x350/ignored.md b/uploads/Location/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Location/550x350/ignored.md b/uploads/Location/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Location/800xauto/ignored.md b/uploads/Location/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Location/b/ignored.md b/uploads/Location/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Location/m/ignored.md b/uploads/Location/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Location/original/ignored.md b/uploads/Location/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Pop-up/1120x350/ignored.md b/uploads/Pop-up/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Pop-up/300x200/ignored.md b/uploads/Pop-up/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Pop-up/350x350/ignored.md b/uploads/Pop-up/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Pop-up/550x350/ignored.md b/uploads/Pop-up/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Pop-up/800xauto/ignored.md b/uploads/Pop-up/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Pop-up/b/ignored.md b/uploads/Pop-up/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Pop-up/m/ignored.md b/uploads/Pop-up/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Pop-up/original/ignored.md b/uploads/Pop-up/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Product/1120x350/ignored.md b/uploads/Product/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Product/300x200/ignored.md b/uploads/Product/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Product/350x350/ignored.md b/uploads/Product/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Product/550x350/ignored.md b/uploads/Product/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Product/800xauto/ignored.md b/uploads/Product/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Product/b/ignored.md b/uploads/Product/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Product/m/ignored.md b/uploads/Product/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Product/original/ignored.md b/uploads/Product/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileAchievement/1120x350/ignored.md b/uploads/ProfileAchievement/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileAchievement/300x200/ignored.md b/uploads/ProfileAchievement/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileAchievement/350x350/ignored.md b/uploads/ProfileAchievement/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileAchievement/550x350/ignored.md b/uploads/ProfileAchievement/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileAchievement/800xauto/ignored.md b/uploads/ProfileAchievement/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileAchievement/b/ignored.md b/uploads/ProfileAchievement/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileAchievement/m/ignored.md b/uploads/ProfileAchievement/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileAchievement/original/ignored.md b/uploads/ProfileAchievement/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfilePoint/1120x350/ignored.md b/uploads/ProfilePoint/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfilePoint/300x200/ignored.md b/uploads/ProfilePoint/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfilePoint/350x350/ignored.md b/uploads/ProfilePoint/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfilePoint/550x350/ignored.md b/uploads/ProfilePoint/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfilePoint/800xauto/ignored.md b/uploads/ProfilePoint/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfilePoint/b/ignored.md b/uploads/ProfilePoint/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfilePoint/m/ignored.md b/uploads/ProfilePoint/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfilePoint/original/ignored.md b/uploads/ProfilePoint/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileStar/1120x350/ignored.md b/uploads/ProfileStar/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileStar/300x200/ignored.md b/uploads/ProfileStar/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileStar/350x350/ignored.md b/uploads/ProfileStar/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileStar/550x350/ignored.md b/uploads/ProfileStar/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileStar/800xauto/ignored.md b/uploads/ProfileStar/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileStar/b/ignored.md b/uploads/ProfileStar/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileStar/m/ignored.md b/uploads/ProfileStar/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileStar/original/ignored.md b/uploads/ProfileStar/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileTier/1120x350/ignored.md b/uploads/ProfileTier/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileTier/300x200/ignored.md b/uploads/ProfileTier/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileTier/350x350/ignored.md b/uploads/ProfileTier/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileTier/550x350/ignored.md b/uploads/ProfileTier/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileTier/800xauto/ignored.md b/uploads/ProfileTier/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileTier/b/ignored.md b/uploads/ProfileTier/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileTier/m/ignored.md b/uploads/ProfileTier/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/ProfileTier/original/ignored.md b/uploads/ProfileTier/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Redeem/1120x350/ignored.md b/uploads/Redeem/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Redeem/300x200/ignored.md b/uploads/Redeem/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Redeem/350x350/ignored.md b/uploads/Redeem/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Redeem/550x350/ignored.md b/uploads/Redeem/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Redeem/800xauto/ignored.md b/uploads/Redeem/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Redeem/b/ignored.md b/uploads/Redeem/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Redeem/m/ignored.md b/uploads/Redeem/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Redeem/original/ignored.md b/uploads/Redeem/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RedeemCategory/1120x350/ignored.md b/uploads/RedeemCategory/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RedeemCategory/300x200/ignored.md b/uploads/RedeemCategory/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RedeemCategory/350x350/ignored.md b/uploads/RedeemCategory/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RedeemCategory/550x350/ignored.md b/uploads/RedeemCategory/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RedeemCategory/800xauto/ignored.md b/uploads/RedeemCategory/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RedeemCategory/b/ignored.md b/uploads/RedeemCategory/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RedeemCategory/m/ignored.md b/uploads/RedeemCategory/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RedeemCategory/original/ignored.md b/uploads/RedeemCategory/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Request/1120x350/ignored.md b/uploads/Request/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Request/300x200/ignored.md b/uploads/Request/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Request/350x350/ignored.md b/uploads/Request/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Request/550x350/ignored.md b/uploads/Request/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Request/800xauto/ignored.md b/uploads/Request/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Request/b/ignored.md b/uploads/Request/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Request/m/ignored.md b/uploads/Request/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Request/original/ignored.md b/uploads/Request/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RequestGallery/1120x350/ignored.md b/uploads/RequestGallery/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RequestGallery/300x200/ignored.md b/uploads/RequestGallery/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RequestGallery/350x350/ignored.md b/uploads/RequestGallery/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RequestGallery/550x350/ignored.md b/uploads/RequestGallery/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RequestGallery/800xauto/ignored.md b/uploads/RequestGallery/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RequestGallery/b/ignored.md b/uploads/RequestGallery/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RequestGallery/ignored.md b/uploads/RequestGallery/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RequestGallery/m/ignored.md b/uploads/RequestGallery/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RequestGallery/original/ignored.md b/uploads/RequestGallery/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillCategory/1120x350/ignored.md b/uploads/RmsBillCategory/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillCategory/300x200/ignored.md b/uploads/RmsBillCategory/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillCategory/350x350/ignored.md b/uploads/RmsBillCategory/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillCategory/550x350/ignored.md b/uploads/RmsBillCategory/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillCategory/800xauto/ignored.md b/uploads/RmsBillCategory/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillCategory/b/ignored.md b/uploads/RmsBillCategory/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillCategory/ignored.md b/uploads/RmsBillCategory/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillCategory/m/ignored.md b/uploads/RmsBillCategory/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillCategory/original/ignored.md b/uploads/RmsBillCategory/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillItem/1120x350/ignored.md b/uploads/RmsBillItem/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillItem/300x200/ignored.md b/uploads/RmsBillItem/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillItem/350x350/ignored.md b/uploads/RmsBillItem/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillItem/550x350/ignored.md b/uploads/RmsBillItem/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillItem/800xauto/ignored.md b/uploads/RmsBillItem/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillItem/b/ignored.md b/uploads/RmsBillItem/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillItem/ignored.md b/uploads/RmsBillItem/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillItem/m/ignored.md b/uploads/RmsBillItem/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsBillItem/original/ignored.md b/uploads/RmsBillItem/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsPrepaidItem/1120x350/ignored.md b/uploads/RmsPrepaidItem/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsPrepaidItem/300x200/ignored.md b/uploads/RmsPrepaidItem/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsPrepaidItem/350x350/ignored.md b/uploads/RmsPrepaidItem/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsPrepaidItem/550x350/ignored.md b/uploads/RmsPrepaidItem/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsPrepaidItem/800xauto/ignored.md b/uploads/RmsPrepaidItem/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsPrepaidItem/b/ignored.md b/uploads/RmsPrepaidItem/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsPrepaidItem/ignored.md b/uploads/RmsPrepaidItem/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsPrepaidItem/m/ignored.md b/uploads/RmsPrepaidItem/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/RmsPrepaidItem/original/ignored.md b/uploads/RmsPrepaidItem/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Staff/1120x350/ignored.md b/uploads/Staff/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Staff/300x200/ignored.md b/uploads/Staff/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Staff/350x350/ignored.md b/uploads/Staff/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Staff/550x350/ignored.md b/uploads/Staff/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Staff/800xauto/ignored.md b/uploads/Staff/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Staff/b/ignored.md b/uploads/Staff/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Staff/m/ignored.md b/uploads/Staff/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Staff/original/ignored.md b/uploads/Staff/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/StaffImage/1120x350/ignored.md b/uploads/StaffImage/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/StaffImage/300x200/ignored.md b/uploads/StaffImage/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/StaffImage/350x350/ignored.md b/uploads/StaffImage/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/StaffImage/550x350/ignored.md b/uploads/StaffImage/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/StaffImage/800xauto/ignored.md b/uploads/StaffImage/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/StaffImage/b/ignored.md b/uploads/StaffImage/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/StaffImage/m/ignored.md b/uploads/StaffImage/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/StaffImage/original/ignored.md b/uploads/StaffImage/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Suggestion/1120x350/ignored.md b/uploads/Suggestion/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Suggestion/300x200/ignored.md b/uploads/Suggestion/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Suggestion/350x350/ignored.md b/uploads/Suggestion/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Suggestion/550x350/ignored.md b/uploads/Suggestion/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Suggestion/800xauto/ignored.md b/uploads/Suggestion/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Suggestion/b/ignored.md b/uploads/Suggestion/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Suggestion/m/ignored.md b/uploads/Suggestion/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Suggestion/original/ignored.md b/uploads/Suggestion/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Task/b/ignored.md b/uploads/Task/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Task/ignored.md b/uploads/Task/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Training/1120x350/ignored.md b/uploads/Training/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Training/300x200/ignored.md b/uploads/Training/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Training/350x350/ignored.md b/uploads/Training/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Training/550x350/ignored.md b/uploads/Training/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Training/800xauto/ignored.md b/uploads/Training/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Training/b/ignored.md b/uploads/Training/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Training/m/ignored.md b/uploads/Training/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Training/original/ignored.md b/uploads/Training/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/TrainingGallery/1120x350/ignored.md b/uploads/TrainingGallery/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/TrainingGallery/300x200/ignored.md b/uploads/TrainingGallery/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/TrainingGallery/350x350/ignored.md b/uploads/TrainingGallery/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/TrainingGallery/550x350/ignored.md b/uploads/TrainingGallery/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/TrainingGallery/800xauto/ignored.md b/uploads/TrainingGallery/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/TrainingGallery/b/ignored.md b/uploads/TrainingGallery/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/TrainingGallery/ignored.md b/uploads/TrainingGallery/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/TrainingGallery/m/ignored.md b/uploads/TrainingGallery/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/TrainingGallery/original/ignored.md b/uploads/TrainingGallery/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/User/1120x350/ignored.md b/uploads/User/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/User/300x200/ignored.md b/uploads/User/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/User/350x350/ignored.md b/uploads/User/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/User/550x350/ignored.md b/uploads/User/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/User/800xauto/ignored.md b/uploads/User/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/User/b/ignored.md b/uploads/User/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/User/m/ignored.md b/uploads/User/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/User/original/ignored.md b/uploads/User/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Visitor/1120x350/ignored.md b/uploads/Visitor/1120x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Visitor/300x200/ignored.md b/uploads/Visitor/300x200/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Visitor/350x350/ignored.md b/uploads/Visitor/350x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Visitor/550x350/ignored.md b/uploads/Visitor/550x350/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Visitor/800xauto/ignored.md b/uploads/Visitor/800xauto/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Visitor/b/ignored.md b/uploads/Visitor/b/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Visitor/ignored.md b/uploads/Visitor/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Visitor/m/ignored.md b/uploads/Visitor/m/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/uploads/Visitor/original/ignored.md b/uploads/Visitor/original/ignored.md new file mode 100644 index 0000000..e69de29 diff --git a/user.php b/user.php new file mode 100644 index 0000000..d7105c9 --- /dev/null +++ b/user.php @@ -0,0 +1,1338 @@ + + [ + "dashboard-view" => "View Dashboard" + ] +]; +$array_permission2['visitor'] = [ + "visitor" => [ + "visitor-list-view" => "View Visitor" + ] +] ; +$array_permission2['hr'] = [ + "staff-application" => [ + "application-form-view" => "View Application Form", + "application-form-new" => "New Application Form", + "application-list-view" => "View Application List", + "application-list-edit" => "Edit Application", + "application-list-update" => "Update Status Application Form" + ], + "staff" => [ + "staff-list-view" => "View Staff List", + "staff-resign-list-view" => "View Staff Resign List", + "staff-run-away-list-view" => "View Staff Run Away List", + + + "staff-list-new" => "New Staff", + "staff-list-edit" => "Edit Staff", + "staff-list-update" => "Update Status Staff", + "staff-list-trash" => "Trash Staff", + "staff-adjustment-view" => "View Point Adjustment List", + "staff-adjustment-new" => "New Point Adjustment", + "staff-adjustment-wallet-view" => "View Wallet Adjustment List", + "staff-adjustment-wallet-new" => "New Wallet Adjustment" + ], + "merit-points" => [ + "hr-merit-points-movement-view" => "View Merit Points Movement", + "hr-merit-points-adjustment-view" => "View Merit Points Adjustment", + "hr-merit-points-task-view" => "View Merit Points Task", + ], + "attendance" => [ + "attendance-list-view" => "View Attendance List", + "attendance-list-edit" => "Edit Attendance", + "attendance-list-report" => "View Attendance Report", + "attendance-attendance-reprocessing" => "Attendance Reprocessing", + "attendance-list-qrcode" => "View Qrcode", + "attendance-list-qrcode-topunch" => "Punch Card", + "attendance-health-view" => "View Health", + "attendance-health-new" => "New Health", + "attendance-health-update" => "Edit Health" + ], + "leave" => [ + "leave-view" => "View Leave List", + "leave-new" => "New Leave", + "leave-update" => "Edit Leave", + ] +] ; + +$array_permission2['salary'] = [ + "salary-list" => [ + "salary-view" => "View Salary List" + ] +] ; +$array_permission2['task'] = [ + "task-list" => [ + "task-list-view" => "View Task List", + "task-list-trash" => "Trash Task", + "task-report-view" => "View Report List" + ] +] ; +$array_permission2['service'] = [ + "announcement" => [ + "announcement-view" => "View Announcement List", + "announcement-new" => "New Announcement", + "announcement-trash" => "Trash Announcement" + ], + "inbox" => [ + "inbox-view" => "View Inbox", + "inbox-new" => "New Inbox", + "inbox-trash" => "Trash Inbox" + ], + "our-inbox" => [ + "our-suggestion-view" => "View Suggestion List", + "our-suggestion-edit" => "Edit Suggestion", + "our-suggestion-trash" => "Trash Suggestion", + "our-request-view" => "View Request List", + "our-request-edit" => "Edit Request", + "our-request-trash" => "Trash Request", + "our-category-gallery" => "View Request Gallery", + "our-category-main-view" => "View Main Category List", + "our-category-main-new" => "New Main Category", + "our-category-main-edit" => "Edit Main Category", + "our-category-main-trash" => "Trash Main Category", + "our-category-main-stock" => "Control Main Category Stock", + "our-category-sub-view" => "View Sub Category List", + "our-category-sub-new" => "New Sub Category", + "our-category-sub-edit" => "Edit Sub Category", + "our-category-sub-trash" => "Trash Sub Category", + "our-category-sub-stock" => "Control Sub Category Stock", + "our-grievance-view" => "View Grievance List", + "our-grievance-edit" => "Edit Grievance", + "our-grievance-trash" => "Trash Grievance" + ], + "form-submission" => [ + "form-headcount-view" => "View Headcount List", + "form-headcount-edit" => "Edit Headcount", + "form-headcount-trash" => "Trash Headcount", + "form-nomination-view" => "View Nomination List", + "form-nomination-trash" => "Trash Nomination", + "form-nomination-question-view" => "View Nomination Question", + "form-nomination-question-new" => "New Nomination Question", + "form-nomination-question-edit" => "Edit Nomination Question", + "form-nomination-question-trash" => "Trash Nomination Question", + "form-resignation-view" => "View resignation List", + "form-resignation-edit" => "Edit resignation", + "form-resignation-trash" => "Trash resignation", + "form-submission-category-view" => "View Category", + "form-submission-category-new" => "New Category", + "form-submission-category-edit" => "Edit Category", + "form-submission-category-trash" => "Trash Category" + ], + "redeem" => [ + "redeem-list-view" => "View Redeem List", + "redeem-list-new" => "New Redeem", + "redeem-list-edit" => "Edit Redeem", + "redeem-list-trash" => "Trash Redeem" + ], + "association" => [ + "association-list-view" => "View Association List", + "association-list-new" => "New Association", + "association-list-edit" => "Edit Association", + "association-list-trash" => "Trash Association", + "association-list-qr" => "Qr Code Association", + "association-list-gallery-category" => "View Association Gallery Category", + "association-list-gallery" => "View Association Gallery", + "association-category-view" => "View Category", + "association-category-new" => "New Category", + "association-category-edit" => "Edit Category", + "association-category-trash" => "Trash Category" + ], + "training" => [ + "training-view" => "View Training List", + "training-new" => "New Training", + "training-edit" => "Edit Training", + "training-trash" => "Trash Training", + "training-qr" => "QR Code Training", + "training-gallery-category" => "View Training Gallery Category", + "training-gallery" => "View Training Gallery", + ], + "form" => [ + "form-list-view" => "View Form List", + "form-list-new" => "New Form", + "form-list-edit" => "Edit Form", + "form-list-trash" => "Trash Form" + ], + "handbook" => [ + "handbook-list-view" => "View Handbook List", + "handbook-list-new" => "New Handbook", + "handbook-list-edit" => "Edit Handbook", + "handbook-list-trash" => "Trash Handbook" + ] +] ; +$array_permission2['import'] = [ + "import" => [ + "import-full-attendance-view" => "View Import Full Attendance List", + "import-full-attendance-upload" => "Upload Full Attendance List", + "import-full-attendance-trash" => "Trash Full Attendance List", + "import-outstanding-employee-view" => "View Import Outstanding Employee List", + "import-outstanding-employee-upload" => "Upload Outstanding Employee List", + "import-outstanding-employee-trash" => "Trash Outstanding Employee List", + "import-lateness-board-view" => "View Import Lateness Board List", + "import-lateness-board-upload" => "Upload Lateness Board List", + "import-lateness-board-trash" => "Trash Lateness Board List", + "import-point-view" => "View Import Point List", + "import-point-upload" => "Upload Point List", + ] +] ; +$array_permission2['report'] = [ + "year-end-cut-off" => [ + "year-end-cut-off-view" => "View Year End Cut Off Report" + ] +] ; +$array_permission2['setting'] = [ + "user-setting" => [ + "user-user-view" => "User", + "user-new-user-new" => "New User", + "user-user-edit" => "Edit User", + "user-user-update" => "Update User" + ], + "service-annoucment" => [ + "user-notification-view" => "View Notification List", + "user-notification-edit" => "Edit Notification", + "user-notification-trash" => "Trash Notification", + "user-letterhead-view" => "View Letterhead List", + "user-letterhead-new" => "New Letterhead", + "user-letterhead-edit" => "Edit Letterhead", + "user-letterhead-trash" => "Trash Letterhead" + ], + "hr-setting" => [ + "hr-branch-view" => "View Branch List", + "hr-branch-new" => "New Branch", + "hr-branch-edit" => "Edit Branch", + "hr-branch-trash" => "Trash Branch", + "hr-working-hours-view" => "View Working Hours List", + "hr-working-hours-new" => "New Working Hours", + "hr-working-hours-edit" => "Edit Working Hours", + "hr-working-hours-trash" => "Trash Working Hours", + "hr-department-list-View" => "ViewDepartment List", + "hr-department-list-new" => "New Department", + "hr-department-list-edit" => "Edit Department", + "hr-department-list-trash" => "Trash Department", + "hr-section-list-view" => "View Section List", + "hr-section-list-new" => "New Section", + "hr-section-list-edit" => "Edit Section", + "hr-section-list-trash" => "Trash Section", + "hr-position-list-view" => "View Designation List", + "hr-position-list-new" => "New Designation", + "hr-position-list-edit" => "Edit Designation", + "hr-position-list-trash" => "Trash Designation" + ], + "app-setting" => [ + "app-welcome-screen-view" => "View Welcome Screen List", + "app-welcome-screen-new" => "New Welcome Screen", + "app-welcome-screen-edit" => "Edit Welcome Screen", + "app-welcome-screen-trash" => "Trash Welcome Screen", + "app-pop-up-view" => "View Pop Up", + "app-pop-up-edit" => "Edit Pop Up", + "app-service-view" => "View Sevice List", + "app-service-edit" => "Edit Sevice", + "app-service-trash" => "Trash Sevice", + "app-page-view" => "View Page List", + "app-page-new" => "New Page", + "app-page-edit" => "Edit Page", + "app-page-trash" => "Trash Page", + "app-menu-view" => "View Menu List", + "app-menu-new" => "New Menu", + "app-menu-edit" => "Edit Menu", + "app-menu-trash" => "Trash Menu", + "app-support-view" => "View Support List", + "app-support-new" => "New Support", + "app-support-edit" => "Edit Support", + "app-support-trash" => "Trash Support", + "app-pasword-view" => "View Password List", + "app-pasword-edit" => "Edit Password", + "app-difficulty-view" => "View Difficulty List", + "app-difficulty-new" => "New Difficulty", + "app-difficulty-edit" => "Edit Difficulty", + "app-difficulty-trash" => "Trash Difficulty", + "app-adjustment-view" => "View Adjustment List", + "app-adjustment-new" => "New Adjustment", + "app-adjustment-edit" => "Edit Adjustment", + "app-adjustment-trash" => "Trash Adjustment", + "app-point-view" => "View Point Adjustment List", + "app-point-new" => "New Point Adjustment", + "app-point-edit" => "Edit Point Adjustment", + "app-adjustment-group-view" => "View Adjustment Group List", + "app-adjustment-group-new" => "New Adjustment Group", + "app-adjustment-group-edit" => "Edit Adjustment Group", + "app-adjustment-group-trash" => "Trash Adjustment Group", + "profile-star-view" => "View Star List", + "profile-star-edit" => "Edit Star", + "profile-point-view" => "View Point List", + "profile-point-edit" => "Edit Point", + "profile-achievement-view" => "View Achievement List", + "profile-achievement-edit" => "Edit Achievement", + "profile-tier-view" => "Tier List", + "profile-tier-edit" => "Edit Tier" + ] +] ; + +// keep parameter in value +$page = escapeString($_GET['page']) ; +$page_mode = escapeString($_GET['page_mode']) ; +$order = escapeString($_GET['order']) ; +$type = escapeString($_GET['type']) ; +$search = escapeString($_GET['search']) ; + +// get all branch +$branch_all = [] ; +$get_branch = $mysqli->query("SELECT * FROM branch + WHERE deleted_at IS NULL") ; +if ( $get_branch->num_rows > 0 ){ + while ( $row_branch = $get_branch->fetch_assoc() ){ + $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; + } +} + +// get all requires +$tier_list = [] ; +$tier_list_id = [] ; +$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 DESC") ; +if ( $mysqli_tier->num_rows > 0 ){ + while ( $row_tier = $mysqli_tier->fetch_assoc() ){ + $tier_list[] = $row_tier ; + $tier_list_id[$row_tier['tier_id']] = $row_tier['title'] ; + } +} + +// form submit +if ($_POST['hide'] == 1){ + + $call = escapeString($_POST['call']) ; + $username = escapeString($_POST['username']) ; + $email = escapeString($_POST['email']) ; + $fullname = escapeString($_POST['fullname']) ; + $password = escapeString($_POST['password']) ; + $permission = escapeString($_POST['permission']) ; + $branch = escapeString($_POST['branch']) ; + $colour = escapeString($_POST['colour']) ; + $verification_code = escapeString($_POST['verification_code']) ; + $user_is_interview_by = escapeString($_POST['user_is_interview_by']) ; + $hide_user_id = escapeString($_POST['hide_user_id']) ; + $branch_permission = $_POST['branch_permission'] ; + $branch_permission = json_encode($branch_permission) ; + + $permission2 = ($_POST['permission2']) ; + $temp_permission2 = multipleArrayTo($permission2) ; + + $boolean_redirect = false ; + + if ($username != '' && $email != '' && $fullname != ''){ + + // query for user + $user_query = ($hide_user_id != '' ? " AND user_id != '".$hide_user_id."'" : '') ; + + // if not admin + if ( $row_user['user_permission'] != 'admin' ){ + $user_query .= " AND user_permission != 'admin'" ; + $permission = 'user' ; + $verification_code = 'no' ; + $user_is_interview_by = 'no' ; + } + + // check user exsits + $mysqli_check_user = $mysqli->query("SELECT * FROM system_user + WHERE user_name = '".$username."' AND user_trash = '0' ".$user_query." LIMIT 1") ; + // check if username exsits + if ($mysqli_check_user->num_rows > 0){ + $boolean_user = false ; + }else{ + $boolean_user = true ; + } + // password + $boolean_password = false ; + if (strlen($password) >= 6){ + $boolean_password = true ; + } + // check user status + if ($boolean_user){ + + // set image in variable + $image = $_FILES["image"]["name"] ; + // remove photo + $remove_photo = $_POST['remove_photo'] ; + if ($remove_photo == 1){ + $image = '' ; + $image_query = "user_signature = ''," ; + } + + $temp_user_tier = [] ; + foreach ( $_POST['user_tier'] as $kusertier => $vusertier ){ + $temp_user_tier[] = escapeString($vusertier) ; + } + $user_tier = implode(',', $temp_user_tier) ; + + + // check status + switch($_POST['hide_status']){ + case 'new' : + + // check permission + if ( !permissionCheck($row_user, 'user-new') ){ + header('Location: index.php') ; + exit ; + } + + // reset password + $code = rand(0, 9999) ; + $password = md5(md5($password).$code) ; + + // check password + if ($boolean_password){ + // check password + $mysqli->query( "INSERT INTO system_user + (user_tier, user_call, user_name, user_email, user_password, user_code, user_fullname, user_permission, user_permission2, user_branch, user_verification_type, user_colour, user_last_login, user_date, user_modified, user_trash, user_permission_branch) VALUES + ('".$user_tier."', '".$call."', '".$username."', '".$email."', '".$password."', '".$code."', '".$fullname."', '".$permission."', '".$temp_permission2."', '".$branch."', '".$verification_code."', '".$colour."', '".TODAYDATE."', '".TODAYDATE."', '".TODAYDATE."', '0', '".$branch_permission."')") ; + $page = $mysqli->insert_id ; + $boolean_redirect = true ; + }else{ + $boolean_password = false ; + } + + break ; + case 'edit' : + + // check permission + if ( !permissionCheck($row_user, 'user-update') ){ + header('Location: index.php') ; + exit ; + } + + // password null + if (strlen($password) == 0){ + // set boolean = true + $boolean_password = true ; + }else{ + if (strlen($password) >= 6){ + // set boolean = true + $boolean_password = true ; + // reset password + $code = rand(0, 9999) ; + $password = md5(md5($password).$code) ; + // query for password + $password_query = " + user_password = '".$password."', + user_code = '".$code."'," ; + } + } + + // check boolean status + if ($boolean_password){ + + // customer join company + $mysqli_page = $mysqli->query("SELECT * FROM system_user + WHERE user_id = '".$page."' AND user_trash = '0' LIMIT 1") ; + // set query as array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + + // check is admin can edit permission + if ( $row_user['user_permission'] == 'admin' ){ + $admin_query = "user_verification_type = '".$verification_code."', + user_is_interview_by = '".$user_is_interview_by."', + user_colour = '".$colour."', + user_tier = '".$user_tier."', + user_permission = '".$permission."', + user_permission_branch = '".$branch_permission."', + user_permission2 = '".$temp_permission2."'," ; + } + + $mysqli->query("UPDATE system_user SET + user_call = '".$call."', + user_name = '".$username."', + user_email = '".$email."', + ".$password_query." + ".$admin_query." + ".$image_query." + user_fullname = '".$fullname."', + user_modified = '".TODAYDATE."' + WHERE user_id = '".$page."'") ; + } + break ; + + } + // resize image + $create_image = reCreateImage('User', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; + // Image uploads when exists + if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ + $resizeObj = new resize($create_image['original']) ; // Initialise load image + foreach($create_image['crop'] as $value){ + // Resize image (options: exact, portrait, landscape, auto, crop) + $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; + $resizeObj -> saveImage($value['source']) ; // Save image + } + // update database + $mysqli->query("UPDATE system_user SET + user_signature = '".$create_image['image']."' + WHERE user_id = '".$page."'"); + } + // new user + if ($boolean_redirect){ + // redirect to main page + header("Location: user.php?page_mode=all") ; + exit ; + } + }else{ + $boolean_password = true ; + } + } +} + +// mode type | all list | new | edit +switch($page_mode){ + + // new customer + case 'new' : + + // check permission + if ( !permissionCheck($row_user, 'user-new-user-new') ){ + header('Location: index.php') ; + exit ; + } + + // active menu bar + $active_main_menu = 'setting' ; + $active_sub_menu = 'setting-user' ; + $active_menu = 'user-new' ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> +
          +
          + +
          +
          +
          + +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          + + +
          +
          +
          + +
          +
          + + + +
          +
          +
          + +
          +
          + $value1 ){ + + $permission2 .= ' +
          +
          '.str_replace('-', ' ', $key1).'
          ' ; + + foreach ( $value1 as $key2 => $value2 ){ + + $permission2 .= ' +
          +
          '.str_replace('-', ' ', $key2).'
          +
          ' ; + + foreach ( $value2 as $key3 => $value3 ){ + + $permission2 .= ' + ' ; + + } + + $permission2 .= ' +
          +
          ' ; + + } + + $permission2 .= ' +
          ' ; + + } + ?> +
          +
          2
          +
          + +
          +
          +
          +
          +
          + + +
          +
          +
          +
          Is Interview By
          +
          + + +
          +
          + + +
          +
          +
          + + + + +
          +
          +
          +
          +
          +
          +
          + query("SELECT * FROM system_user + WHERE user_permission = 'admin' AND user_trash = '0'") ; + // check admin person + if ($mysqli_admin->num_rows > 1){ + // set to false + $boolean_user_admin = true ; + } + } + + // form submit + if ($_POST['hide'] == '2' && $_POST['hide_status'] == 'trash' && $boolean_user_admin){ + switch($_POST['page_action']){ + case 'trash': + $mysqli_query = "UPDATE " . system_user . " SET + user_trash = '1' + WHERE user_id = " ; + $trash_page = trashPage('user', $mysqli, $mysqli_query, $_POST['multiple_trash']) ; + break; + } + } + + // active page + $active_main_menu = 'setting' ; + $active_sub_menu = 'setting-user' ; + $active_menu = 'user' ; + + // if not admin + $admin_query = ''; + if ($row_user['user_permission'] != 'admin'){ + $admin_query = " AND user_permission != 'admin'" ; + } + + // customer join company + $mysqli_page = $mysqli->query("SELECT * FROM system_user + WHERE user_id = '".$page."' AND user_trash = '0' ".$admin_query." LIMIT 1") ; + + // check table exsits + if ($mysqli_page->num_rows == 0){ + header("Location: user.php?page_mode=all") ; + exit ; + }else{ + // set query as array + $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> +
          + +
          +
          + + + +
          +
          +
          + + + + + +
          +
          +
          + + + +
          + ' ; + if (!$boolean_user){ + echo $lang['sorry_username_exsits'] .'
          ' ; + } + if (!$boolean_password){ + echo $lang['sorry_password_must_at_least_6_digits'] .'
          ' ; + } + echo ' +
          ' ; + } + ?> +
          +
          +
          +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          +
          +
          +  '.$lang['remove_photo'].' + + + ' ; + }else{ + echo ' + + ' ; + } + ?> +
          +
          + + +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          +
          +
          +
          + +
          +
          + + + +
          +
          +
          + +
          +
          + $value1 ){ + + $permission2 .= ' +
          +
          '.str_replace('-', ' ', $key1).'
          ' ; + + foreach ( $value1 as $key2 => $value2 ){ + + $permission2 .= ' +
          +
          '.str_replace('-', ' ', $key2).'
          +
          ' ; + + foreach ( $value2 as $key3 => $value3 ){ + + $permission2 .= ' + ' ; + + } + + $permission2 .= ' +
          +
          ' ; + + } + + $permission2 .= ' +
          ' ; + + } + ?> +
          +
          2
          +
          + +
          +
          +
          +
          +
          + /> + /> +
          +
          +
          +
          Is Interview By
          +
          + /> + /> +
          +
          + + + +
          +
          +
          + + + + +
          +
          + + +
          +
          +
          +
          +
          + + query($mysqli_query." ORDER BY user_id LIMIT $start_from, " . LIMIT) ; + + // set search url + $search_url = 'search='.$search ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query); + + + if ($_POST['hide'] == '1' && $_POST['hide_status'] == 'action'){ + switch($_POST['page_action']){ + case 'export-excel-sql' : + require('PHPExcel/Classes/PHPExcel.php'); + // Create new PHPExcel object + $objPHPExcel = new PHPExcel(); + + // set letter + $letters = array(); + $letter = 'A'; + while ($letter !== 'AAA') { + $letters[] = $letter++; + } + + // get array header + $HeaderArray = array( + 'Code(20)', + 'Description' + ); + // Set document properties + $objPHPExcel->getProperties()->setCreator("IPS") + ->setLastModifiedBy("CMS") + ->setTitle("System Export Excel") + ->setSubject("System Export Excel") + ->setDescription("System Export Excel") + ->setKeywords("System Excel") + ->setCategory("System Excel"); + + // Add some data + if (arrayCheck($HeaderArray)){ + $cound_header = 1; + $count = 0; + foreach($HeaderArray as $key => $header_name){ + // if sub exist + if (arrayCheck($header_name)){ + + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($letters[$count].$cound_header, $key); + $count_sub_header = $cound_header; + $sub_count = $count; + $count_sub_header++; + foreach($header_name as $header_name_sub){ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($letters[$sub_count].$count_sub_header, $header_name_sub); + // continue first layer + $count = $sub_count; + // add second layer + $sub_count++; + } + }else{ + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($letters[$count].$cound_header, $header_name); + } + // merge value + $begin = $count; + //$end = $count+15; + $end = $count; + + $count++; + } + } + + $mysqli_page = $mysqli->query($mysqli_query." ORDER BY user_id ") ; + if ($mysqli_page->num_rows > 0){ + + $array_customer = array() ; + $count = 2 ; + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + if($row_page['user_name']!= '' ){ + $objPHPExcel->setActiveSheetIndex(0) + ->setCellValue('A'.$count, 'A'.$row_page['user_id']) + ->setCellValue('B'.$count, dataFilterDash($row_page['user_name'])); + $count++; + } + } + + } + // file name + $fileName = "User_" .time(); + + // Rename worksheet + $objPHPExcel->getActiveSheet()->setTitle($fileName); + + // Set active sheet index to the first sheet, so Excel opens this as the first sheet + $objPHPExcel->setActiveSheetIndex(0); + + // Save Excel 2007 file + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); + + //Setting the header type + header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); + header('Content-Disposition: attachment;filename="'.$fileName.'.xlsx"'); + header('Cache-Control: max-age=0'); + + // save to pc + $objWriter->save('php://output'); + header("Refresh: 0") ; + exit ; + break ; + } + } + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          +
          question
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + +
          +
          listing
          +
          + + + +
          + + + + + + + + + + + + + + + + + + + num_rows > 0){ + while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ + + $lat = dataFilter($row_page['user_last_latitude']) ; + $lot = dataFilter($row_page['user_last_longtitude']) ; + $coordinates = ($lat != '' && $lot != '' ? true : false) ; + + echo ' + + + + + + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + + + + + + ' ; + } + ?> + +
          '.dataFilter($row_page['user_name']).''.dataFilter($row_page['user_email']).''.dataFilter($row_page['user_fullname']).'' ; + $level = '' ; + switch($row_page['user_permission']){ + case 'admin' : $level = 'Super Admin' ; break ; + case 'user' : $level = 'User' ; break ; + case 'request' : $level = 'Request' ; break ; + } + echo $level.' + '.dataFilterDash($row_page['user_verification']).''.resetDateTimeFormat($row_page['user_verification_date']).''.resetDateFormat($row_page['user_last_login']).'' ; + if ($coordinates){ + echo ' + + '.$lat.', + '.$lot.' + + ' ; + }else{ + echo '-' ; + } + echo ' + '.dataFilterDash($row_page['user_last_ip']).''.dataFilterDash($row_page['user_last_device']).''.date('Y-m-d H:i:s', strtotime($row_page['user_modified'])).''.( ($row_page['user_login_cookies'] != '' && permissionCheck($row_user, 'user-user-edit') ) ? '' : '-').'
          '.$lang['no_data'].'
          +
          + +
          +
          +
          +
          + \ No newline at end of file diff --git a/visitation/index.php b/visitation/index.php new file mode 100644 index 0000000..6187f10 --- /dev/null +++ b/visitation/index.php @@ -0,0 +1,266 @@ += TODAYDAY && $visited_dated_to >= $visited_dated_from ){ + + $status = '260' ; + + $mobile = $dial . $mobile ; + + if ( $mysqli->query( "INSERT INTO visitor + ( `name`, `mobile`, `email`, `identity`, `nationality`, `visitor_company`, `car_plate`, `branch`, `remark`, `contact_person`, `reason`, `question1`, `question2`, `question3`, `question4`, `question5`, `question6`, `visited_at`, `visited_at_to`, `category` ) VALUES + ( '".$name."', '".$mobile."', '".$email."', '".$identity."', '".$nationality."', '".$visitor_company."', '".$car_plate."', '".$branch."', '".$remark."', '".$contact_person."', '".$reason."', '".$question1."', '".$question2."', '".$question3."', '".$question4."', '".$question5."', '".$question6."', '".$visited_dated_from."', '".$visited_dated_to."', '".$category."' )" ) ){ + + $status = '200' ; + + $visitor_id = $mysqli->insert_id ; + + $branch_hr_contact = '' ; + $branch_hr_email = '' ; + $branch_hr_cc = [] ; + $branch_email_footer = '' ; + $mysqli_query = "SELECT branch_hr_email, branch_hr_cc, branch_hr_contact, branch_email_footer FROM branch WHERE + deleted_at IS NULL AND branch_id = '".$branch."' LIMIT 1" ; + $mysqli_branch = $mysqli->query($mysqli_query) ; + if ( $mysqli_branch->num_rows > 0 ){ + $row_branch = $mysqli_branch->fetch_assoc() ; + $branch_hr_contact = dataFilter( $row_branch['branch_hr_contact'] ) ; + $branch_hr_email = dataFilter( $row_branch['branch_hr_email'] ) ; + $branch_hr_cc = explodeToArray( $row_branch['branch_hr_cc'] ) ; + $branch_email_footer = entityDecode( dataFilter( $row_branch['branch_email_footer'] ) ) ; + } + + + + + $body = 'Dear valued visitor, good day. Thank you for your visit request submission, we will review and get back to you.

          by ' . COMPANY . $branch_email_footer ; + $body_sms = 'Dear valued visitor, good day. Thank you for your visit request submission, we will review and get back to you.' ; + + $mailer = new Mailer() ; + $mailer->from = $branch_hr_email ; + $mailer->fromname = COMPANY ; + $mailer->to = [ $email ] ; + if ( count($branch_hr_cc) > 0 ){ + $mailer->cc = $branch_hr_cc ; + } + $mailer->subject = 'Visitor Form Submission' ; + $mailer->body = $body ; + $mailer->send() ; + + if ( substr( $mobile, 0, 2 ) == '60' || substr( $mobile, 0, 3 ) == '+60' || + substr( $mobile, 0, 2 ) == '65' || substr( $mobile, 0, 3 ) == '+65' ){ + $sms = new Sms() ; + $sms->to = $mobile ; + $sms->message = $body_sms ; + $sms->send() ; + } + + header( "Location : qrcode.php?visitor_id=".$visitor_id.'&token='.setSecret( $visitor_id ) ) ; + exit ; + + } + + } + + } + + $_SESSION['error'] = $status ; + header('Refresh: 0') ; + exit ; +} + + +$dial_code = ' +["+60","+65","+1","+7","+12","+13","+15","+16","+20","+21","+22","+23","+24","+25","+26","+27","+29","+30","+31","+32","+33","+34","+35","+36","+37","+38","+39","+40","+41","+42","+43","+44","+45","+46","+47","+48","+49","+50","+51","+52","+53","+54","+55","+56","+57","+58","+59","+61","+62","+63","+64","+66","+67","+68","+69","+73","+81","+82","+84","+85","+86","+87","+88","+90","+91","+92","+93","+94","+95","+96","+97","+98","+99"]' ; +$get_dial_code = json_decode( $dial_code, true ) ; + +include '../requires/page_header.php' ; +include 'requires.php' ; + +$more_scripts = showMessage( $_SESSION['error'], $message ) ; +?> + + + + \ No newline at end of file diff --git a/visitation/language.php b/visitation/language.php new file mode 100644 index 0000000..4b43526 --- /dev/null +++ b/visitation/language.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/visitation/qrcode.php b/visitation/qrcode.php new file mode 100644 index 0000000..a354d61 --- /dev/null +++ b/visitation/qrcode.php @@ -0,0 +1,207 @@ +query( "SELECT * FROM visitor + WHERE deleted_at IS NULL AND visitor_id = '".$visitor_id."' LIMIT 1" ) ; +if ( $select_visitor->num_rows == 0 || setSecret( $visitor_id ) != $token ){ + header('Location: index.php') ; + exit ; +} + +$row_visitor = $select_visitor->fetch_assoc() ; + +// get branch name +$branch_name = '' ; +$mysqli_query = "SELECT branch_id, branch_name FROM branch + WHERE branch_id = '".$row_visitor['branch']."' LIMIT 1" ; +$mysqli_branch = $mysqli->query($mysqli_query) ; +if ( $mysqli_branch->num_rows > 0 ){ + $row_branch = $mysqli_branch->fetch_assoc() ; + $branch_name = $row_branch['branch_name'] ; +} + +$qrcode = 'VT|'.$visitor_id ; +$outputqrcode = generateQrcode( '', $qrcode, $qrcode ) ; + + +include '../requires/page_header.php' ; +include 'requires.php' ; + +$more_scripts = showMessage( $_SESSION['error'], $message ) ; +?> + + + + \ No newline at end of file diff --git a/visitation/requires.php b/visitation/requires.php new file mode 100644 index 0000000..3424835 --- /dev/null +++ b/visitation/requires.php @@ -0,0 +1,21 @@ + + + + diff --git a/visitor.php b/visitor.php new file mode 100644 index 0000000..93b7887 --- /dev/null +++ b/visitor.php @@ -0,0 +1,549 @@ +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; +} + +// mode type | all list | new | edit +switch($page_mode){ + case 'edit': + $mysqli_page = $mysqli->query("SELECT * FROM visitor WHERE visitor_id = '".$page."'"); + + if( $mysqli_page->num_rows == 0 ){ + header( "Location: visitor.php" ) ; + exit ; + } + + $row_page = $mysqli_page->fetch_assoc(); + + + + if ( $_POST['hide'] == 1 ){ + + $status = escapeString( $_POST['status'] ) ; + + // if ( $row_page['status'] == 'tested' ){ + if ( $row_page['status'] == 'pending' ){ + + $branch_hr_contact = '' ; + $branch_hr_email = '' ; + $branch_hr_cc = [] ; + $branch_email_footer = '' ; + $mysqli_query = "SELECT branch_hr_email, branch_hr_cc, branch_hr_contact, branch_email_footer FROM branch WHERE + deleted_at IS NULL AND branch_id = '".$row_page['branch']."' LIMIT 1" ; + $mysqli_branch = $mysqli->query($mysqli_query) ; + if ( $mysqli_branch->num_rows > 0 ){ + $row_branch = $mysqli_branch->fetch_assoc() ; + $branch_hr_contact = dataFilter( $row_branch['branch_hr_contact'] ) ; + $branch_hr_email = dataFilter( $row_branch['branch_hr_email'] ) ; + $branch_hr_cc = explodeToArray( $row_branch['branch_hr_cc'] ) ; + $branch_email_footer = entityDecode( dataFilter( $row_branch['branch_email_footer'] ) ) ; + } + + + + $boolean_update = false ; + $title = '' ; + $body = '' ; + $body_sms = '' ; + if ( $status == 'tested-approved' ){ + $boolean_update = true ; + $title = 'Visitor Confirmation' ; + + // send email / sms + $body = 'Dear valued visitor, good day. Your application form has been approved.

          Kindly present your QR code to us during the visitation date via below link: '.PATH.'visitation/qrcode.php?visitor_id='.$page.'&token='.setSecret( $page ).'.

          Thank you and have a nice day.

          by ' . COMPANY ; + $body_sms = 'Dear valued visitor, good day. Your application form has been approved. Kindly present your QR code to us during the visitation date via below link: '.PATH.'visitation/qrcode.php?visitor_id='.$page.'&token='.setSecret( $page ).' Thank you and have a nice day.' ; + } + + if ( $status == 'tested-rejected' ){ + $boolean_update = true ; + $title = 'Visitor Rejected' ; + $body = 'Dear valued visitor, good day. Sorry to inform that your visitation request has been rejected.

          by ' . COMPANY ; + $body_sms = 'Dear valued visitor, good day. Sorry to inform that your visitation request has been rejected.' ; + } + + if ( $boolean_update ){ + + if ( $mysqli->query( "UPDATE visitor SET + status = '".$status."' + WHERE visitor_id = '".$page."'" ) ){ + + $mailer = new Mailer() ; + $mailer->from = $branch_hr_email ; + $mailer->to = [ $row_page['email'] ] ; + if ( count($branch_hr_cc) > 0 ){ + $mailer->cc = $branch_hr_cc ; + } + $mailer->subject = $title ; + $mailer->body = $body ; + $mailer->send() ; + + if ( substr( $row_page['mobile'], 0, 2 ) == '60' || substr( $row_page['mobile'], 0, 3 ) == '+60' || + substr( $row_page['mobile'], 0, 2 ) == '65' || substr( $row_page['mobile'], 0, 3 ) == '+65' ){ + $sms = new Sms() ; + $sms->to = $row_page['mobile'] ; + $sms->message = $body_sms ; + $sms->send() ; + } + + header( "Refresh: 0" ) ; + exit ; + + } + + } + + } + + } + + // start header here + include 'requires/page_header.php'; + include 'requires/page_top.php'; + ?> + + +
          + +
          +
          +
          +
          +
          +
          Appointment Date
          +
          + +
          +
          +
          +
          Branch To Visit
          +
          + query($mysqli_query) ; + if ( $mysqli_branch->num_rows > 0 ){ + $row_branch = $mysqli_branch->fetch_assoc() ; + $branch_name = $row_branch['branch_name'] ; + } + ?> + +
          +
          +
          +
          Visitor Category
          +
          + +
          +
          +
          +
          Visitor Name
          +
          + +
          +
          +
          +
          Contact Number
          +
          + +
          +
          +
          +
          Email
          +
          + +
          +
          +
          +
          NRIC / Passport No
          +
          + +
          +
          +
          +
          Nationality
          +
          + +
          +
          +
          +
          Visitor Company
          +
          + +
          +
          +
          +
          Car Plate
          +
          + +
          +
          +
          +
          Reason To Visit
          +
          + +
          +
          +
          +
          Contact Person
          +
          + +
          +
          + + +
          +
          +
          + +
          + + + + +
          +
          +
          + + + +
          +
          +
          +
          + + + + Download + +
          +
          +
          + + +
          +
          Status
          +
          + +
          +
          + + +
          +
          +
          + + + +
          +
          + + +
          +
          +
          + + + + + +
          +
          +
          + +
          +
          +
          + + + + + + + + + + + query( "SELECT * FROM visitor_checkin WHERE visitor_id = '".$page."' AND deleted_at IS NULL" ) ; + + if ( $select_checkin->num_rows > 0 ){ + $count_no = 0 ; + while ( $row_checkin = $select_checkin->fetch_assoc() ){ + $count_no++ ; ?> + + + + + + + + +
          No.FileCheckin At
          . + +
          +
          +
          + +
          +
          + +
          + + = '".$new_date_visit."' OR a.visited_at_to LIKE '%".$new_date_visit."%' ) " ; + } + if( $date_created != ''){ + $search_query .= " AND a.created_at LIKE '%".date( 'Y-m-d', strtotime( $date_created ) )."%'" ; + } + if( $category != ''){ + $search_query .= " AND a.category LIKE '%".$category."%'" ; + } + + // pagination + if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + $start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + // set search url + $search_url = 'search='.$search ; + + // page query + $mysqli_query = "SELECT a.visitor_id, a.branch, a.category, a.name, a.mobile, a.email, a.identity, a.nationality, a.status, a.visited_at, visited_at_to, a.created_at, b.branch_name FROM visitor a + LEFT JOIN branch b ON ( a.branch = b.branch_id ) + WHERE a.deleted_at IS NULL " . $search_query . str_replace( 'branch_id', 'branch', $user_branch_permission_sql ) ; + $mysqli_page = $mysqli->query( $mysqli_query." ORDER BY a.visitor_id DESC LIMIT $start_from, " . LIMIT ) ; + + // load pagination + $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; + + // start header here + include 'requires/page_header.php' ; + include 'requires/page_top.php' ; + + ?> + +
          +
          + + +
          +
          + search +
          +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + + + +
          +
          +
          +
          +
          + +
          + +
          +
          + listing +
          +
          + + + + + + + + + + + + + + + + + + num_rows > 0 ){ + while ( $row_page = $mysqli_page->fetch_assoc() ){ + echo ' + + + + + + + + + + + + + '; + } + }else{ + echo ' + + + + + + + + + + + + + + '; + } + ?> + +
          + + '.ucwords($row_page['branch_name']).''.dataFilter($row_page['category']).''.dataFilter($row_page['name']).''.dataFilter($row_page['mobile']).''.dataFilter($row_page['email']).''.dataFilter($row_page['identity']).''.dataFilter($row_page['nationality']).''.taskStatusButton($row_page['status']).''.$row_page['visited_at'].' ~ '.$row_page['visited_at_to'].''.$row_page['created_at'].'
          '.$lang['no_data'].'
          + +
          +
          +
          +
          +
          + \ No newline at end of file diff --git a/year-end-cut-off.php b/year-end-cut-off.php new file mode 100644 index 0000000..84b957a --- /dev/null +++ b/year-end-cut-off.php @@ -0,0 +1,203 @@ +alert("Sorry You Don\'t Have The Permission.")'; + + header('Location: index.php') ; + exit ; +} + +//nav menu +$active_main_menu = 'report' ; +$active_sub_menu = 'year-end-cut-off' ; + + +// keep parameter in value + +$page = escapeString($_GET['page']) ; + +$page_mode = escapeString($_GET['page_mode']) ; + +$type = escapeString($_GET['type']) ; + +$search = escapeString($_GET['search']) ; + +$search_name = escapeString($_GET['search_name']) ; + +$search_idno = escapeString($_GET['search_idno']) ; + +$search_year = ( ($_GET['search_year'] !='' && preg_match("/[2][0][0-9][0-9]/u", $_GET['search_year'])) ? escapeString($_GET['search_year']) : date('Y')); + +$export_excel = escapeString($_GET['export-excel']); + +$show_another_script = true ; + +$hide_title = false ; + +// page header +$letter_head = getOwnerCompanyLetterHead($_SESSION['url_get_branch_admin']) ; + +$search_query = '' ; + +if( $search_name != ''){ + $search_query .= " AND b.staff_name LIKE '%".$search_name."%'" ; +} + +if( $search_idno != ''){ + $search_query .= " AND b.staff_idno LIKE '%".$search_idno."%'" ; +} + +if ( $search_year != '' && is_numeric($search_year) ) { + $search_query .= " AND Year(a.created_at) = '".$search_year."'" ; +}else{ + $search_query .= " AND Year(a.created_at) = Year(Now())" ; +} + + +//pagination +if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) + + +$start_from = ($product_page - 1) * LIMIT ; //end next and prev page + + +$mysqli_cutoff = $mysqli->query("SELECT a.*, b.staff_name, b.staff_idno FROM staff_point_movement_cutoff a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.staff_id != '' AND a.deleted_at IS NULL ".$search_query." ".$user_branch_permission_sql_b." ORDER BY a.amount DESC LIMIT $start_from, ".LIMIT) ; + + + +$mysqli_cutoff_query = "SELECT a.*, b.staff_name, b.staff_idno FROM staff_point_movement_cutoff a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.staff_id != '' AND a.deleted_at IS NULL ".$search_query." ".$user_branch_permission_sql_b." ORDER BY a.amount DESC"; + +$search_url = 'page_mode=all&search_name='.$search_name.'&search_idno='.$search_idno.'&search_year='.$search_year ; + +$page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_cutoff_query) ; + +if ($export_excel != '' && $export_excel == 'export_eae') { + $page_export_file_name = 'Year End Cut Off Report-'; + + $t_title_header_excel = 'Year End Cut Off Report ('.$search_year.')'; + + $array_header_excel = array( + 'Year', + 'ID', + 'Name', + 'Point' + ) ; + + $mysqli_export = $mysqli->query( $mysqli_cutoff_query ) ; + + if ( $mysqli_export->num_rows > 0 ){ + while ( $mysqli_export_page = $mysqli_export->fetch_assoc() ){ + + $array_body_excel[] = array( + $mysqli_export_page['cutoff_year']-1, + $mysqli_export_page['staff_idno'], + $mysqli_export_page['staff_name'], + $mysqli_export_page['amount'] + ) ; + } + } + + include 'export_excel_default.php'; +} + +include 'requires/page_header.php'; + +include 'requires/page_top.php'; +?> + + +
          + + +
          + +
          +
          +
          + +
          + +
          +
          +
          + +
          + +
          +
          +
          +
          + + + +
          +
          +
          +
          +
          + +
          +
          +
          + + + + + + + + + + + num_rows > 0){ + while ($row_cutoff = $mysqli_cutoff->fetch_assoc()){ + + echo ' + + + + + ' ; + echo ' + ' ; + } + }else{ + echo ' + + + + + + ' ; + } + ?> + +
          '.dataFilter($row_cutoff['cutoff_year']-1).''.dataFilter($row_cutoff['staff_idno']).''.dataFilter($row_cutoff['staff_name']).''.dataFilter($row_cutoff['amount']).'
          '.$lang['no_data'].'
          + +
          +
          +
          + + \ No newline at end of file