first commit
This commit is contained in:
@@ -0,0 +1,171 @@
|
||||
<?php
|
||||
include '../connect/cms-config.php' ;
|
||||
include '../requires/session.php' ;
|
||||
include '../requires/function.php' ;
|
||||
|
||||
// set value in variable
|
||||
$place = escapeString($_POST['place']) ;
|
||||
$staff_id = escapeString($_POST['staff_id']) ;
|
||||
$type = escapeString($_POST['type']) ;
|
||||
$group_id = escapeString($_POST['group_id']) ;
|
||||
$formula_group = escapeString($_POST['formula_group']);
|
||||
|
||||
// default variable
|
||||
$content = '' ;
|
||||
$result = 'failed' ;
|
||||
|
||||
|
||||
if (!empty($type)){
|
||||
switch ($type) {
|
||||
case 'staff':
|
||||
// array for seaching query
|
||||
$staff_list = [];
|
||||
$staff_id = ( empty($staff_id) ? '0' : $staff_id );
|
||||
if ( $place > 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);
|
||||
?>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
include '../connect/cms-config.php' ;
|
||||
include '../requires/session.php' ;
|
||||
include '../requires/function.php' ;
|
||||
|
||||
// set value in variable
|
||||
$type = escapeString($_GET['type']) ;
|
||||
$page = escapeString($_POST['page']) ;
|
||||
$status = escapeString($_POST['status']) ;
|
||||
|
||||
$result = false ;
|
||||
$update_query = '' ;
|
||||
|
||||
switch($type){
|
||||
case 'update-status' :
|
||||
|
||||
$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) ;
|
||||
$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) ;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
include '../connect/cms-config.php' ;
|
||||
include '../requires/session.php' ;
|
||||
include '../requires/function.php' ;
|
||||
|
||||
$result = 'failed' ;
|
||||
|
||||
// set value in variable
|
||||
$list_staff_id = escapeString($_POST['list_staff_id']) ;
|
||||
$list_date = escapeString($_POST['list_date']) ;
|
||||
$list_health = escapeString($_POST['list_health']) ;
|
||||
|
||||
if ( $list_staff_id != '' && $list_date != '' && $list_health != '' ){
|
||||
|
||||
$mysqli_page = $mysqli->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) ;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
include '../connect/cms-config.php' ;
|
||||
include '../requires/session.php' ;
|
||||
include '../requires/function.php' ;
|
||||
|
||||
$result = 'failed' ;
|
||||
|
||||
// set value in variable
|
||||
$list_id = escapeString($_POST['list_id']) ;
|
||||
$list_work_day = escapeString($_POST['list_work_day']) ;
|
||||
$list_ot_day = escapeString($_POST['list_ot_day']) ;
|
||||
$list_min = escapeString($_POST['list_min']) ;
|
||||
$list_amt = escapeString($_POST['list_amt']) ;
|
||||
$list_fd = escapeString($_POST['list_fd']) ;
|
||||
$list_wt = escapeString($_POST['list_wt']) ;
|
||||
$list_remark = escapeString($_POST['list_remark']) ;
|
||||
|
||||
$list_allow_food = ($list_fd > 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) ;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,229 @@
|
||||
<?php
|
||||
include '../connect/cms-config.php' ;
|
||||
include '../requires/function.php' ;
|
||||
|
||||
$array_other_details = array() ;
|
||||
|
||||
// personal information
|
||||
$position_applied = escapeString($_POST['position_applied']) ;
|
||||
$personal_call = escapeString($_POST['personal_call']) ;
|
||||
$personal_name = escapeString($_POST['personal_name']) ;
|
||||
$personal_nric = escapeString($_POST['personal_nric']) ;
|
||||
$personal_old_nric = escapeString($_POST['personal_old_nric']) ;
|
||||
$personal_dob = escapeString($_POST['personal_dob']) ;
|
||||
$personal_sex = escapeString($_POST['personal_sex']) ;
|
||||
$personal_race = escapeString($_POST['personal_race']) ;
|
||||
$personal_religion = escapeString($_POST['personal_religion']) ;
|
||||
$personal_nationality = escapeString($_POST['personal_nationality']) ;
|
||||
$personal_marital = escapeString($_POST['personal_marital']) ;
|
||||
$personal_mobile = escapeString($_POST['personal_mobile']) ;
|
||||
$personal_tel = escapeString($_POST['personal_tel']) ;
|
||||
$personal_address = escapeString($_POST['personal_address']) ;
|
||||
$personal_email = escapeString($_POST['personal_email']) ;
|
||||
$personal_transport = escapeString($_POST['personal_transport']) ;
|
||||
$personal_type_vehicle = escapeString($_POST['personal_type_vehicle']) ;
|
||||
|
||||
// set image in variable
|
||||
$personal_image = $_FILES["image"]["name"] ;
|
||||
$personal_image_type = $_FILES["image"]["type"] ;
|
||||
|
||||
// family background
|
||||
$family_father_name = escapeString($_POST['family_father_name']) ;
|
||||
$family_father_occupation = escapeString($_POST['family_father_occupation']) ;
|
||||
$family_mother_name = escapeString($_POST['family_mother_name']) ;
|
||||
$family_mother_occupation = escapeString($_POST['family_mother_occupation']) ;
|
||||
$family_spouse_name = escapeString($_POST['family_spouse_name']) ;
|
||||
$family_spouse_occupation = escapeString($_POST['family_spouse_occupation']) ;
|
||||
|
||||
// family member
|
||||
$family_member_key = $_POST['family_member_key'] ;
|
||||
$array_family_member = array() ;
|
||||
if (arrayCheck($family_member_key)){
|
||||
foreach($family_member_key as $key => $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";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
include '../connect/cms-config.php' ;
|
||||
include '../requires/session.php' ;
|
||||
include '../requires/function.php' ;
|
||||
// default variable
|
||||
$type = $_GET['type'] ;
|
||||
$id = escapeString($_POST['id']) ;
|
||||
// check if not null
|
||||
if ($type != ''){
|
||||
switch($type){
|
||||
case 'logout' :
|
||||
// update query
|
||||
$mysqli->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 ;
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
include_once '../connect/cms-config.php' ;
|
||||
include_once '../requires/function.php' ;
|
||||
|
||||
$folder = escapeString($_GET['folder']) ; // name
|
||||
$file = base64_decode(escapeString($_GET['file'])) ; // password
|
||||
$user = escapeString($_GET['user']) ; // user
|
||||
|
||||
// check login
|
||||
$result = 'failed' ;
|
||||
|
||||
if ($_SESSION['system_id'] != '' && $_SESSION['system_name'] != '' && $user == $_SESSION['system_id']){
|
||||
|
||||
if ($folder != '' && $file != ''){
|
||||
|
||||
$degrees = -90 ; //change this to be whatever degree of rotation you want
|
||||
header('Content-type: image/jpeg') ;
|
||||
|
||||
$array_folder = array('small' => '', '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) ;
|
||||
?>
|
||||
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Author David S. Tufts
|
||||
* Company davidscotttufts.com
|
||||
*
|
||||
* Date: 05/25/2003
|
||||
* Usage: <img src="/barcode.php?text=testing" alt="testing" />
|
||||
*/
|
||||
|
||||
// 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<count($code_array1); $Y++ ) {
|
||||
if ( substr($upper_text, ($X-1), 1) == $code_array1[$Y] )
|
||||
$code_string .= $code_array2[$Y] . "1";
|
||||
}
|
||||
}
|
||||
$code_string = "11221211" . $code_string . "1122121";
|
||||
}
|
||||
|
||||
// Pad the edges of the barcode
|
||||
$code_length = 20;
|
||||
if ($print) {
|
||||
$text_height = 30;
|
||||
} else {
|
||||
$text_height = 0;
|
||||
}
|
||||
|
||||
for ( $i=1; $i <= strlen($code_string); $i++ ){
|
||||
$code_length = $code_length + (integer)(substr($code_string,($i-1),1));
|
||||
}
|
||||
|
||||
if ( strtolower($orientation) == "horizontal" ) {
|
||||
$img_width = $code_length*$SizeFactor;
|
||||
$img_height = $size;
|
||||
} else {
|
||||
$img_width = $size;
|
||||
$img_height = $code_length*$SizeFactor;
|
||||
}
|
||||
|
||||
$image = imagecreate($img_width, $img_height + $text_height);
|
||||
$black = imagecolorallocate ($image, 0, 0, 0);
|
||||
$white = imagecolorallocate ($image, 255, 255, 255);
|
||||
|
||||
imagefill( $image, 0, 0, $white );
|
||||
if ( $print ) {
|
||||
imagestring($image, 5, 31, $img_height, $text, $black );
|
||||
}
|
||||
|
||||
$location = 10;
|
||||
for ( $position = 1 ; $position <= strlen($code_string); $position++ ) {
|
||||
$cur_size = $location + ( substr($code_string, ($position-1), 1) );
|
||||
if ( strtolower($orientation) == "horizontal" )
|
||||
imagefilledrectangle( $image, $location*$SizeFactor, 0, $cur_size*$SizeFactor, $img_height, ($position % 2 == 0 ? $white : $black) );
|
||||
else
|
||||
imagefilledrectangle( $image, 0, $location*$SizeFactor, $img_width, $cur_size*$SizeFactor, ($position % 2 == 0 ? $white : $black) );
|
||||
$location = $cur_size;
|
||||
}
|
||||
|
||||
// Draw barcode to the screen or save in a file
|
||||
if ( $filepath=="" ) {
|
||||
header ('Content-type: image/png');
|
||||
imagepng($image);
|
||||
imagedestroy($image);
|
||||
} else {
|
||||
imagepng($image,$filepath);
|
||||
imagedestroy($image);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,253 @@
|
||||
<?php
|
||||
|
||||
# ========================================================================#
|
||||
#
|
||||
# Author: Jarrod Oberto
|
||||
# Version: 1.0
|
||||
# Date: 17-Jan-10
|
||||
# Purpose: Resizes and saves image
|
||||
# Requires : Requires PHP5, GD library.
|
||||
# Usage Example:
|
||||
# include("classes/resize_class.php");
|
||||
# $resizeObj = new resize('images/cars/large/input.jpg');
|
||||
# $resizeObj -> 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);
|
||||
}
|
||||
|
||||
|
||||
## --------------------------------------------------------
|
||||
|
||||
}
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
<footer class="container-fluid footer">
|
||||
Copyright <?= date('Y', time()) ?> © <?= COMPANY ?>. Developed by <a href="http://ips.com.my" target="_blank">IPS Software Sdn. Bhd.</a>
|
||||
<a href="#" class="pull-right scrollToTop"><i class="fa fa-chevron-up"></i></a>
|
||||
</footer>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= COMPANY ?></title>
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="IPS Software Sdn. Bhd.">
|
||||
<meta name="creator" content="IPS Software Sdn. Bhd.">
|
||||
<meta name="robots" content="noindex,nofollow"/>
|
||||
<link type="image/ico" rel="shortcut icon" href="/images/favicon.ico">
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link rel="stylesheet" href="/css/bootstrap.css?v=<?= filemtime($_SERVER['DOCUMENT_ROOT'].'/css/bootstrap.css') ?>" />
|
||||
<link rel="stylesheet" href="/plugins/toastr/toastr.min.css">
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]><script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script><script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script><![endif]-->
|
||||
<script src="/scripts/jquery-1.8.3.js"></script><!-- JQuery v1.8.1 -->
|
||||
<script src="/scripts/jquery-ui-1.11.4.js"></script><!-- drag & drop effect -->
|
||||
<script src="/scripts/underscore-min.js"></script>
|
||||
<script src="/scripts/bootstrap.min.js"></script><!-- Bootstrap -->
|
||||
<script src="/scripts/globalize.min.js"></script><!-- Globalize -->
|
||||
<script src="/scripts/jquery.validate.js"></script><!-- validate -->
|
||||
<script src="/scripts/jquery.autocomplete.js"></script><!-- jquery autocomplete -->
|
||||
<script src="/scripts/jquery.fancybox.js"></script><!-- Fancybox -->
|
||||
<script src="/scripts/fixedThead.js"></script>
|
||||
<script src="/Ckeditor/ckeditor.js"></script><!-- Text Editor -->
|
||||
<script src="/scripts/select2.full.js"></script><!-- Select2 select box -->
|
||||
<script src="/scripts/custom.js"></script><!-- Custom JQuery -->
|
||||
<script src="/scripts/jquery.nicescroll.min.js"></script><!-- NanoScroll -->
|
||||
<script src="/scripts/bootstrap-datepicker.js"></script><!-- Date picker -->
|
||||
<script src="/scripts/jquery.unveil.js"></script><!-- lazy load effect -->
|
||||
<script src="/plugins/toastr/toastr.min.js"></script>
|
||||
<script src="/scripts/all.js?v=<?= filemtime($_SERVER['DOCUMENT_ROOT'].'/scripts/all.js') ?>"></script><!-- All -->
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key="></script>
|
||||
<script src="/scripts/all_map.js"></script><!-- All -->
|
||||
|
||||
</head>
|
||||
<body class="<?= $class_for_body ?>" >
|
||||
@@ -0,0 +1,680 @@
|
||||
<?php
|
||||
$mysqli_page_website = $mysqli->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) ;
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- preloader -->
|
||||
<div class="loading-container"><div class="loading"><div class="l1"><div></div></div><div class="l2"><div></div></div><div class="l3"><div></div></div><div class="l4"><div></div></div></div></div>
|
||||
<!-- end preloader -->
|
||||
<!-- left panel -->
|
||||
<aside class="left-panel">
|
||||
<div class="user text-center">
|
||||
<img src="/images/logo.png" />
|
||||
<h4 class="user-name"><?= dataFilter($row_user['user_fullname']) ?></h4>
|
||||
<div class="dropdown user-login">
|
||||
<button class="btn btn-xs dropdown-toggle btn-rounded" type="button" data-toggle="dropdown" aria-expanded="true">
|
||||
<i class="fa fa-circle status-icon available"></i> <?= $lang['Active']?> <i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
|
||||
<li role="presentation"><a role="menuitem" href="page-logout.php"><i class="fa fa-circle status-icon signout"></i> <?= $lang['Sign out']?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="language">
|
||||
<a href="language.php?lang=en&link=//<?= $_SERVER['HTTP_HOST'].urlencode($_SERVER['REQUEST_URI']) ?>" class="<?= $get_lang == 'en' ? 'active' :'' ?>">ENG</a>
|
||||
<a href="language.php?lang=cn&link=//<?= $_SERVER['HTTP_HOST'].urlencode($_SERVER['REQUEST_URI']) ?>" class="<?= $get_lang == 'cn' ? 'active' :'' ?>">中文</a>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<nav class="navigation">
|
||||
<ul class="list-unstyled">
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'dashboard') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'dashboard-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_main_menu == 'dashboard' ? 'active' : '') ?>">
|
||||
<a href="page-dashboard.php">
|
||||
<i class="fa fa-tachometer"></i> <span class="nav-label"><?= $lang['Dashboard']?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'visitor-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'visitor-list-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_main_menu == 'visitor' ? 'active' : '') ?>">
|
||||
<a href="#"><i class="fa fa-male"></i> <span class="nav-label">Visitor</span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'visitor-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'visitor-list-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'visitor-list' ? 'active' : '') ?>"><a href="visitor.php?page_mode=list"><span class="nav-label">List</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'application-form') || permissionWebsite($row_page_website, 'application-pending-list') || permissionWebsite($row_page_website, 'application-offer-list') || permissionWebsite($row_page_website, 'application-confirmation-list') || permissionWebsite($row_page_website, 'application-terminate-list') || permissionWebsite($row_page_website, 'staff-list') || permissionWebsite($row_page_website, 'staff-resign-list') || permissionWebsite($row_page_website, 'staff-run-away-list') || permissionWebsite($row_page_website, 'staff-warning-list') || permissionWebsite($row_page_website, 'attendance-list') || permissionWebsite($row_page_website, 'attendance-report') || permissionWebsite($row_page_website, 'attendance-qrcode') || permissionWebsite($row_page_website, 'attendance-health') || permissionWebsite($row_page_website, 'leave') || permissionWebsite($row_page_website, 'advance') || permissionWebsite($row_page_website, 'payment-slip') || permissionWebsite($row_page_website, 'hr-merit-points-movement') || permissionWebsite($row_page_website, 'hr-merit-points-adjustment') || permissionWebsite($row_page_website, 'hr-merit-points-task') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'application-form-view') || permissionCheck($row_user, 'application-list-view') || permissionCheck($row_user, 'staff-list-view') || permissionCheck($row_user, 'staff-resign-list-view') || permissionCheck($row_user, 'staff-run-away-list-view') || permissionCheck($row_user, 'staff-warning-list-view') || permissionCheck($row_user, 'attendance-list-view') || permissionCheck($row_user, 'attendance-report-view') || permissionCheck($row_user, 'attendance-qrcode-view') || permissionCheck($row_user, 'attendance-health-view') || permissionCheck($row_user, 'leave-view') || permissionCheck($row_user, 'advance-view') || permissionCheck($row_user, 'payment-slip-view') || permissionCheck($row_user, 'hr-merit-points-movement-view') || permissionCheck($row_user, 'hr-merit-points-adjustment-view') || permissionCheck($row_user, 'hr-merit-points-task-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_main_menu == 'hr' ? 'active' : '') ?>"><a href="#"><i class="fa fa-user"></i> <span class="nav-label"><?= $lang['HR']?></span></a>
|
||||
<ul class="list-unstyled">
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'application-form') || permissionWebsite($row_page_website, 'application-pending-list') || permissionWebsite($row_page_website, 'application-offer-list') || permissionWebsite($row_page_website, 'application-confirmation-list') || permissionWebsite($row_page_website, 'application-terminate-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'application-form-view') || permissionCheck($row_user, 'application-list-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'hr-employment' ? 'active' : '') ?>"><a href="#"><i class="fa fa-user-circle-o" aria-hidden="true"></i> <span class="nav-label"><?= $lang['Staff Application']?></span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'application-form') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'application-form-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-employment-new' ? 'active' : '') ?>"><a href="hr-employment.php?page_mode=new&type=new"><span class="nav-label"><?= $lang['Application Form']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'application-pending-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'application-list-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'hr-letter-pending' ? 'active' : '' ?>"><a href="hr-employment.php?page_mode=all&select_worker=Local&type=pending"><?= $lang['Pending'].' '.$lang['list']?> </a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'application-offer-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'application-list-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'hr-letter-offer' ? 'active' : '' ?>"><a href="hr-employment.php?page_mode=all&select_worker=Local&type=offer"><?= $lang['Offer'].' '.$lang['list']?> </a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'application-confirmation-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'application-list-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'hr-letter-confirmation' ? 'active' : '' ?>"><a href="hr-employment.php?page_mode=all&select_worker=Local&type=confirmation"><?= $lang['Confirmation'].' '.$lang['list']?> </a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'application-terminate-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'application-list-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'hr-letter-terminate' ? 'active' : '' ?>"><a href="hr-employment.php?page_mode=all&select_worker=Local&type=terminate"><?= $lang['Terminate'].' '.$lang['list']?> </a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'staff-list') || permissionWebsite($row_page_website, 'staff-resign-list') || permissionWebsite($row_page_website, 'staff-run-away-list') || permissionWebsite($row_page_website, 'staff-warning-list') || permissionWebsite($row_page_website, 'staff-adjustment') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'staff-list-view') || permissionCheck($row_user, 'staff-resign-list-view') || permissionCheck($row_user, 'staff-run-away-list-view') || permissionCheck($row_user, 'staff-warning-list-view') || permissionCheck($row_user, 'staff-adjustment-view') ){ ?>
|
||||
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'hr-staff' ? 'active' : '') ?>"><a href="#"><i class="fa fa-users" aria-hidden="true"></i> <span class="nav-label"><?= $lang['Staff']?></span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'staff-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'staff-list-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-staff-list' ? 'active' : '') ?>"><a href="hr-staff.php?page_mode=all"> <span class="nav-label"><?= $lang['list']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'staff-point-history') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'staff-point-history-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-staff-point-history' ? 'active' : '') ?>"><a href="hr-staff.php?page_mode=staff-point-history"> <span class="nav-label">Point Movement</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'staff-resign-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'staff-resign-list-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-staff-resgined' ? 'active' : '') ?>"><a href="hr-staff.php?page_mode=resign"> <span class="nav-label"><?= $lang['Resign List']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'staff-run-away-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'staff-run-away-list-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-staff-run-away' ? 'active' : '') ?>"><a href="hr-staff.php?page_mode=run_away"> <span class="nav-label"><?= $lang['Run Away List']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'staff-warning-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'staff-warning-list-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-staff-warning' ? 'active' : '') ?>"><a href="hr-staff-request.php?page_mode=warning"> <span class="nav-label"><?= $lang['Warning Letter']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'staff-adjustment') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'staff-adjustment-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-staff-adjustment' ? 'active' : '') ?>"><a href="hr-staff-adjustment.php?page_mode=all"> <span class="nav-label"><?= $lang['Adjustment']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-merit-points-movement') || permissionWebsite($row_page_website, 'hr-merit-points-adjustment') || permissionWebsite($row_page_website, 'hr-merit-points-task') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-merit-points-movement-view') || permissionCheck($row_user, 'hr-merit-points-adjustment-view') || permissionCheck($row_user, 'hr-merit-points-task-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'hr-merit-points' ? 'active' : '') ?>"><a href="#"><i class="fa fa-bar-chart" aria-hidden="true"></i> <span class="nav-label">Merit Points System</span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-merit-points-movement') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-merit-points-movement-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-merit-points-movement' ? 'active' : '') ?>"><a href="hr-merit-points.php?page_mode=movement"> <span class="nav-label">Movement</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-merit-points-adjustment') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-merit-points-adjustment-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-merit-points-adjustment' ? 'active' : '') ?>"><a href="hr-merit-points.php?page_mode=adjustment"> <span class="nav-label">Adjustment Record</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-merit-points-task') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-merit-points-task-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-merit-points-task' ? 'active' : '') ?>"><a href="hr-merit-points.php?page_mode=task"> <span class="nav-label">Task Record</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'attendance-list') || permissionWebsite($row_page_website, 'attendance-report') || permissionWebsite($row_page_website, 'attendance-qrcode') || permissionWebsite($row_page_website, 'attendance-health') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'attendance-list-view') || permissionCheck($row_user, 'attendance-report-view') || permissionCheck($row_user, 'attendance-qrcode-view') || permissionCheck($row_user, 'attendance-health-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'hr-attendance' ? 'active' : '') ?>"><a href="#"><i class="fa fa-clock-o" aria-hidden="true"></i> <span class="nav-label"><?= $lang['attendance']?></span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'attendance-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'attendance-list-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-attendance-list' ? 'active' : '') ?>"><a href="hr-attendance.php?page_mode=list"><span class="nav-label"><?= $lang['list']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'attendance-report') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'attendance-report-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-attendance-report' ? 'active' : '') ?>"><a href="hr-attendance.php?page_mode=report"><span class="nav-label"><?= $lang['Report']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'attendance-qrcode') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'attendance-qrcode-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-attendance-qrcode' ? 'active' : '') ?>"><a href="hr-attendance.php?page_mode=qrcode"><span class="nav-label"><?= $lang['Qrcode']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'attendance-health') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'attendance-health-view') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-health' ? 'active' : '') ?>"><a href="hr-health.php?page_mode=record-all"><span class="nav-label">Health</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'attendance-list-import') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'attendance-list-import') ){ ?>
|
||||
<li class="<?= ($active_menu == 'hr-staff-attendance' ? 'active' : '') ?>"><a href="hr-staff.php?page_mode=staff-attendance"> <span class="nav-label"><?= $lang['Import']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'leave') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'leave-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'hr-leave' ? 'active' : '') ?>"><a href="hr-leave.php?page_mode=list&ist_type=confirmed"><i class="fa fa-sign-out" aria-hidden="true"></i> <span class="nav-label"><?= $lang['Leave']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'advance') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'advance-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'hr-advance' ? 'active' : '') ?>"><a href="hr-advance.php?page_mode=list"><i class="fa fa-credit-card" aria-hidden="true"></i> <span class="nav-label"><?= $lang['advance']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'payment-slip') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'payment-slip-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'hr-payment-slip' ? 'active' : '') ?>"><a href="hr-payment-slip.php?page_mode=list"><i class="fa fa-money" aria-hidden="true"></i> <span class="nav-label"><?= $lang['payment-slip']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'task-list') || permissionWebsite($row_page_website, 'task-report') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'task-list-view') || permissionCheck($row_user, 'task-report-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_main_menu == 'task' ? 'active' : '') ?>">
|
||||
<a href="#"><i class="fa fa-tasks"></i> <span class="nav-label">Task</span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'task-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'task-list-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'task-list' ? 'active' : '') ?>"><a href="task.php?page_mode=list"><span class="nav-label">List</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'task-report') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'task-report-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'task-report' ? 'active' : '') ?>"><a href="task-report.php"><span class="nav-label">Report</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'announcement') || permissionWebsite($row_page_website, 'inbox') || permissionWebsite($row_page_website, 'our-suggestion') ||permissionWebsite($row_page_website, 'our-main-request') || permissionWebsite($row_page_website, 'our-sub-request') || permissionWebsite($row_page_website, 'our-request') || permissionWebsite($row_page_website, 'redeem-list') || permissionWebsite($row_page_website, 'redeem-category') || permissionWebsite($row_page_website, 'association-list') || permissionWebsite($row_page_website, 'association-category') || permissionWebsite($row_page_website, 'training') || permissionWebsite($row_page_website, 'handbook-list') || permissionWebsite($row_page_website, 'handbook-main-category') || permissionWebsite($row_page_website, 'handbook-sub-category') || permissionWebsite($row_page_website, 'catalog-list') || permissionWebsite($row_page_website, 'catalog-main-category') || permissionWebsite($row_page_website, 'catalog-sub-category') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'announcement-view') || permissionCheck($row_user, 'inbox-view') || permissionCheck($row_user, 'our-suggestion-view') ||permissionCheck($row_user, 'our-main-request-view') || permissionCheck($row_user, 'our-sub-request-view') || permissionCheck($row_user, 'our-request-view') || permissionCheck($row_user, 'redeem-list-view') || permissionCheck($row_user, 'redeem-category-view') || permissionCheck($row_user, 'association-list-view') || permissionCheck($row_user, 'association-category-view') || permissionCheck($row_user, 'training-view') || permissionCheck($row_user, 'handbook-list-view') || permissionCheck($row_user, 'handbook-main-category-view') || permissionCheck($row_user, 'handbook-sub-category-view') || permissionCheck($row_user, 'catalog-list-view') || permissionCheck($row_user, 'catalog-main-category-view') || permissionCheck($row_user, 'catalog-sub-category-view') ){ ?>
|
||||
|
||||
<li class="has-submenu <?= ($active_main_menu == 'service' ? 'active' : '') ?>">
|
||||
<a href="#"><i class="fa fa-briefcase"></i> <span class="nav-label">Service</span></a>
|
||||
<ul class="list-unstyled">
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'announcement') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'announcement-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'service-announcement' ? 'active' : '') ?>"><a href="service-announcement.php?page_mode=list"><i class="fa fa-picture-o" aria-hidden="true"></i> <span class="nav-label"><?= $lang['announcement']?></span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'inbox') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'inbox-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'inbox' ? 'active' : '') ?>"><a href="inbox.php?page_mode=list"><i class="fa fa-newspaper-o" aria-hidden="true"></i> <span class="nav-label">Employee Inbox</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'our-suggestion') || permissionWebsite($row_page_website, 'our-request') ||permissionWebsite($row_page_website, 'our-main-request') || permissionWebsite($row_page_website, 'our-sub-request') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'our-suggestion-view') || permissionCheck($row_user, 'our-request-view') ||permissionCheck($row_user, 'our-main-request-view') || permissionCheck($row_user, 'our-sub-request-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'ourinbox' ? 'active' : '') ?>"><a href="#"><i class="fa fa-comment"></i> <span class="nav-label"><?= COMPANYSHORT ?> Inbox</span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'our-suggestion') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'our-suggestion-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_menu == 'ourinbox-suggestion-list' ? 'active' : '') ?>"><a href="app-suggestion.php?page_mode=list"><span class="nav-label">Suggestion</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'our-request') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'our-request-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_menu == 'ourinbox-request-list' ? 'active' : '') ?>"><a href="app-request.php?page_mode=list"><span class="nav-label">Request</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'our-main-request') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'our-main-request-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_menu == 'service-request-main' ? 'active' : '') ?>"><a href="app-request-main.php?page_mode=list"><span class="nav-label">Main Category</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'our-sub-request') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'our-sub-request-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_menu == 'service-request-sub' ? 'active' : '') ?>"><a href="app-request-sub.php?page_mode=list"><span class="nav-label">Sub Category</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'our-grievance') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'our-grievance-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_menu == 'ourinbox-grievance-list' ? 'active' : '') ?>"><a href="app-grievance.php?page_mode=list"><span class="nav-label">Grievance</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'redeem-list') || permissionWebsite($row_page_website, 'redeem-category') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'redeem-list-view') || permissionCheck($row_user, 'redeem-category-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'redeem' ? 'active' : '') ?>"><a href="#"><i class="fa fa-gift"></i> <span class="nav-label">Redeem</span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'redeem-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'redeem-list-view') ){ ?>
|
||||
<!-- <li class="<?= $active_menu == 'redeem-list-list' ? 'active' : '' ?>"><a href="app-redeem.php?page_mode=all">List</a></li> -->
|
||||
<li class="<?= $active_menu == 'redeem-list-list' ? 'active' : '' ?>"><a href="app-redeem.php?page_mode=category">List</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'redeem-category') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'redeem-category-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'redeem-list-category' ? 'active' : '' ?>"><a href="app-redeem.php?page_mode=category">Category</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'association-list') || permissionWebsite($row_page_website, 'association-category') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'association-list-view') || permissionCheck($row_user, 'association-category-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'association' ? 'active' : '') ?>"><a href="#"><i class="fa fa-share-square"></i> <span class="nav-label">Association</span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'association-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'association-list-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'association-list-list' ? 'active' : '' ?>"><a href="app-association.php?page_mode=all">List</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'association-category') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'association-category-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'association-list-category' ? 'active' : '' ?>"><a href="app-association-category.php?page_mode=all">Category</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'training') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'training-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'training' ? 'active' : '') ?>"><a href="app-training.php?page_mode=all"><i class="fa fa-calendar-o"></i> <span class="nav-label">Training</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'handbook-list') || permissionWebsite($row_page_website, 'handbook-main-category') || permissionWebsite($row_page_website, 'handbook-sub-category') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'handbook-list-view') || permissionCheck($row_user, 'handbook-main-category-view') || permissionCheck($row_user, 'handbook-sub-category-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'handbook' ? 'active' : '') ?>"><a href="#"><i class="fa fa-book"></i> <span class="nav-label">Handbook</span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'handbook-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'handbook-list-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_menu == 'handbook-list-list' ? 'active' : '') ?>"><a href="app-handbook.php?page_mode=list"><span class="nav-label">List</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'handbook-main-category') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'handbook-main-category-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_menu == 'handbook-main-category' ? 'active' : '') ?>"><a href="app-handbook-maincategory.php?page_mode=list"><span class="nav-label">Main Category</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'handbook-sub-category') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'handbook-sub-category-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_menu == 'handbook-sub-category' ? 'active' : '') ?>"><a href="app-handbook-subcategory.php?page_mode=list"><span class="nav-label">Sub Category</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'catalog-list') || permissionWebsite($row_page_website, 'catalog-main-category') || permissionWebsite($row_page_website, 'catalog-sub-category') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'catalog-list-view') || permissionCheck($row_user, 'catalog-main-category-view') || permissionCheck($row_user, 'catalog-sub-category-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'catalog' ? 'active' : '') ?>"><a href="#"><i class="fa fa-product-hunt"></i> <span class="nav-label">Catalog</span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'catalog-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'catalog-list-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_menu == 'catalog-list-list' ? 'active' : '') ?>"><a href="app-catalog.php?page_mode=list"><span class="nav-label">List</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'catalog-main-category') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'catalog-main-category-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_menu == 'catalog-main-category' ? 'active' : '') ?>"><a href="app-catalog-maincategory.php?page_mode=list"><span class="nav-label">Main Category</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'catalog-sub-category') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'catalog-sub-category-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_menu == 'catalog-sub-category' ? 'active' : '') ?>"><a href="app-catalog-subcategory.php?page_mode=list"><span class="nav-label">Sub Category</span></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'user-user') || permissionWebsite($row_page_website, 'user-new-user') || permissionWebsite($row_page_website, 'user-notification') || permissionWebsite($row_page_website, 'user-new-notification') || permissionWebsite($row_page_website, 'user-letterhead') || permissionWebsite($row_page_website, 'hr-branch') || permissionWebsite($row_page_website, 'hr-working-hours') || permissionWebsite($row_page_website, 'hr-leave-setting') || permissionWebsite($row_page_website, 'hr-sick-setting') || permissionWebsite($row_page_website, 'hr-holiday-list') || permissionWebsite($row_page_website, 'hr-hostel-list') || permissionWebsite($row_page_website, 'hr-knowledge-list') || permissionWebsite($row_page_website, 'hr-department-list') || permissionWebsite($row_page_website, 'hr-section-list') || permissionWebsite($row_page_website, 'hr-position-list') || permissionWebsite($row_page_website, 'hr-advance-setting') || permissionWebsite($row_page_website, 'hr-chief-list') || permissionWebsite($row_page_website, 'app-welcome-screen') || permissionWebsite($row_page_website, 'app-pop-up') || permissionWebsite($row_page_website, 'app-service') || permissionWebsite($row_page_website, 'app-page') || permissionWebsite($row_page_website, 'app-menu') || permissionWebsite($row_page_website, 'app-support') || permissionWebsite($row_page_website, 'app-point') || permissionWebsite($row_page_website, 'app-adjustment') || permissionWebsite($row_page_website, 'profile-star') || permissionWebsite($row_page_website, 'profile-point') || permissionWebsite($row_page_website, 'profile-achievement') || permissionWebsite($row_page_website, 'profile-tier') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'user-user-view') || permissionCheck($row_user, 'user-new-user-new') || permissionCheck($row_user, 'user-notification-view') || permissionCheck($row_user, 'user-new-notification-view') || permissionCheck($row_user, 'user-letterhead-view') || permissionCheck($row_user, 'hr-branch-view') || permissionCheck($row_user, 'hr-working-hours-view') || permissionCheck($row_user, 'hr-leave-setting-view') || permissionCheck($row_user, 'hr-sick-setting-view') || permissionCheck($row_user, 'hr-holiday-list-view') || permissionCheck($row_user, 'hr-hostel-list-view') || permissionCheck($row_user, 'hr-knowledge-list-view') || permissionCheck($row_user, 'hr-department-list-view') || permissionCheck($row_user, 'hr-section-list-view') || permissionCheck($row_user, 'hr-position-list-view') || permissionCheck($row_user, 'hr-advance-setting-view') || permissionCheck($row_user, 'hr-chief-list-view') || permissionCheck($row_user, 'app-welcome-screen-view') || permissionCheck($row_user, 'app-pop-up-view') || permissionCheck($row_user, 'app-service-view') || permissionCheck($row_user, 'app-page-view') || permissionCheck($row_user, 'app-menu-view') || permissionCheck($row_user, 'app-support-view') || permissionCheck($row_user, 'app-point-view') || permissionCheck($row_user, 'app-adjustment-view') || permissionCheck($row_user, 'profile-star-view') || permissionCheck($row_user, 'profile-point-view') || permissionCheck($row_user, 'profile-achievement-view') || permissionCheck($row_user, 'profile-tier-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_main_menu == 'setting' ? 'active' : '') ?>"><a href="#"><i class="fa fa-cog"></i> <span class="nav-label"><?= $lang['Settings']?></span></a>
|
||||
<ul class="list-unstyled">
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'user-user') || permissionWebsite($row_page_website, 'user-new-user') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'user-user-view') || permissionCheck($row_user, 'user-new-user-new') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'setting-user' ? 'active' : '') ?>"><a href="#"><i class="fa fa-user-plus"></i> <span class="nav-label"><?= $lang['User'].$lang['setting']?></span></a>
|
||||
<ul class="list-unstyled">
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'user-user') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'user-user-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'user' ? 'active' : '' ?>"><a href="user.php?page_mode=all"><?= $lang['User']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'user-new-user') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'user-new-user-new') ){ ?>
|
||||
<li class="<?= $active_menu == 'user-new' ? 'active' : '' ?>"><a href="user.php?page_mode=new"><?= $lang['New'].$lang['User']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'user-notification') || permissionWebsite($row_page_website, 'user-new-notification') || permissionWebsite($row_page_website, 'user-letterhead') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'user-notification-view') || permissionCheck($row_user, 'user-new-notification-view') || permissionCheck($row_user, 'user-letterhead-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'setting-notification' ? 'active' : '') ?>"><a href="#"><i class="fa fa-user-plus"></i> <span class="nav-label">Service Annoucment</span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'user-notification') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'user-notification-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'page-notification' ? 'active' : '' ?>"><a href="page-notification.php?page_mode=all"><?= $lang['Notification']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'user-new-notification') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'user-new-notification-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'page-notification-new' ? 'active' : '' ?>"><a href="page-notification.php?page_mode=new"><?= $lang['New'].$lang['Notification']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'user-letterhead') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'user-letterhead-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-letterhead' ? 'active' : '' ?>"><a href="setting-letterhead.php?page_mode=all"><?= $lang['Letterhead']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-branch') || permissionWebsite($row_page_website, 'hr-working-hours') || permissionWebsite($row_page_website, 'hr-leave-setting') || permissionWebsite($row_page_website, 'hr-sick-setting') || permissionWebsite($row_page_website, 'hr-holiday-list') || permissionWebsite($row_page_website, 'hr-hostel-list') || permissionWebsite($row_page_website, 'hr-knowledge-list') || permissionWebsite($row_page_website, 'hr-department-list') || permissionWebsite($row_page_website, 'hr-section-list') || permissionWebsite($row_page_website, 'hr-position-list') || permissionWebsite($row_page_website, 'hr-advance-setting') || permissionWebsite($row_page_website, 'hr-chief-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-branch-view') || permissionCheck($row_user, 'hr-working-hours-view') || permissionCheck($row_user, 'hr-leave-setting-view') || permissionCheck($row_user, 'hr-sick-setting-view') || permissionCheck($row_user, 'hr-holiday-list-view') || permissionCheck($row_user, 'hr-hostel-list-view') || permissionCheck($row_user, 'hr-knowledge-list-view') || permissionCheck($row_user, 'hr-department-list-view') || permissionCheck($row_user, 'hr-section-list-view') || permissionCheck($row_user, 'hr-position-list-view') || permissionCheck($row_user, 'hr-advance-setting-view') || permissionCheck($row_user, 'hr-chief-list-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'setting-hr' ? 'active' : '') ?>"><a href="#"><i class="fa fa-users"></i> <span class="nav-label"><?= $lang['HR'].' '.$lang['setting']?></span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-branch') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-branch-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-branch' ? 'active' : '' ?>"><a href="setting-branch.php?page_mode=all"><?= $lang['branch']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-working-hours') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-working-hours-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-working' ? 'active' : '' ?>"><a href="setting-working.php?page_mode=all"><?= $lang['working_hours']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-leave-setting') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-leave-setting-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-leave' ? 'active' : '' ?>"><a href="setting-leave.php?page_mode=all"><?= $lang['Leave'].' '.$lang['setting']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-sick-setting') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-sick-setting-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-sick' ? 'active' : '' ?>"><a href="setting-sick.php?page_mode=all"><?= $lang['sick1'].' '.$lang['setting']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-holiday-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-holiday-list-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-holiday' ? 'active' : '' ?>"><a href="setting-holiday.php?page_mode=all"><?= $lang['Holiday'].' '.$lang['list']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-hostel-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-hostel-list-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-hostel' ? 'active' : '' ?>"><a href="setting-hostel.php?page_mode=all"><?= $lang['Hostel'].' '.$lang['list']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-knowledge-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-knowledge-list-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-knowledge' ? 'active' : '' ?>"><a href="setting-knowledge.php?page_mode=all"><?= $lang['knowledge'].' '.$lang['list']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-department-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-department-list-View') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-department' ? 'active' : '' ?>"><a href="page-department.php?page_mode=all"><?= $lang['Department'].' '.$lang['list']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-section-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-section-list-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-section' ? 'active' : '' ?>"><a href="setting-section.php?page_mode=all"><?= $lang['Section'].' '.$lang['list']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-position-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-position-list-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-position' ? 'active' : '' ?>"><a href="setting-position.php?page_mode=all"><?= $lang['Designation'].' '.$lang['list']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-advance-setting') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-advance-setting-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-advance' ? 'active' : '' ?>"><a href="setting-advance.php?page_mode=all"><?= $lang['advance'].' '.$lang['setting']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'hr-chief-list') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'hr-chief-list-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-hr-chief' ? 'active' : '' ?>"><a href="setting-chief.php?page_mode=all"><?= $lang['Chief'].' '.$lang['list']?></a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( permissionWebsite($row_page_website, 'app-welcome-screen') || permissionWebsite($row_page_website, 'app-pop-up') || permissionWebsite($row_page_website, 'app-service') || permissionWebsite($row_page_website, 'app-page') || permissionWebsite($row_page_website, 'app-menu') || permissionWebsite($row_page_website, 'app-support') || permissionWebsite($row_page_website, 'app-point') || permissionWebsite($row_page_website, 'app-adjustment') || permissionWebsite($row_page_website, 'profile-star') || permissionWebsite($row_page_website, 'profile-point') || permissionWebsite($row_page_website, 'profile-achievement') || permissionWebsite($row_page_website, 'profile-tier') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'app-welcome-screen-view') || permissionCheck($row_user, 'app-pop-up-view') || permissionCheck($row_user, 'app-service-view') || permissionCheck($row_user, 'app-page-view') || permissionCheck($row_user, 'app-menu-view') || permissionCheck($row_user, 'app-support-view') || permissionCheck($row_user, 'app-point-view') || permissionCheck($row_user, 'app-adjustment-view') || permissionCheck($row_user, 'profile-star-view') || permissionCheck($row_user, 'profile-point-view') || permissionCheck($row_user, 'profile-achievement-view') || permissionCheck($row_user, 'profile-tier-view') ){ ?>
|
||||
<li class="has-submenu <?= ($active_sub_menu == 'setting-app' ? 'active' : '') ?>"><a href="#"><i class="fa fa-mobile"></i> <span class="nav-label">App Setting</span></a>
|
||||
<ul class="list-unstyled">
|
||||
<?php if ( permissionWebsite($row_page_website, 'app-welcome-screen') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'app-welcome-screen-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-app-screen' ? 'active' : '' ?>"><a href="app-screen.php?page_mode=all">Welcome Screen</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'app-pop-up') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'app-pop-up-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'app-pop-up' ? 'active' : '' ?>"><a href="app-pop-up.php?page_mode=edit">Pop Up</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'app-service') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'app-service-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-app-service' ? 'active' : '' ?>"><a href="app-service.php?page_mode=all">Service</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'app-page') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'app-page-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-app-page' ? 'active' : '' ?>"><a href="app-page.php?page_mode=all">Page</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'app-menu') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'app-menu-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-app-menu' ? 'active' : '' ?>"><a href="app-menu.php?page_mode=all">Menu</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'app-support') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'app-support-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-app-support' ? 'active' : '' ?>"><a href="app-support.php?page_mode=all">Support</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'app-difficulty') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'app-difficulty-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-app-difficulty' ? 'active' : '' ?>"><a href="app-difficulty.php?page_mode=all">Difficulty</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'app-adjustment') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'app-adjustment-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-app-adjustment' ? 'active' : '' ?>"><a href="app-adjustment.php?page_mode=all">Adjustment</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'profile-star') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'profile-star-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-profile-star' ? 'active' : '' ?>"><a href="profile-star.php?page_mode=all">Star</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'profile-point') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'profile-point-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-profile-point' ? 'active' : '' ?>"><a href="profile-point.php?page_mode=all">Point</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'profile-achievement') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'profile-achievement-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-profile-achievement' ? 'active' : '' ?>"><a href="profile-achievement.php?page_mode=all">Achievement</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php if ( permissionWebsite($row_page_website, 'profile-tier') ){ ?>
|
||||
<?php if ( permissionCheck($row_user, 'profile-tier-view') ){ ?>
|
||||
<li class="<?= $active_menu == 'setting-profile-tier' ? 'active' : '' ?>"><a href="profile-tier.php?page_mode=all">Tier</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<li class="<?= $active_menu == 'logout' ? 'active' : '' ?>"><a href="page-logout.php"><i class="fa fa-sign-out"></i> <span class="nav-label"><?= $lang['Logout']?></span></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</aside>
|
||||
<!-- end left panel -->
|
||||
<!-- section content -->
|
||||
<section class="content">
|
||||
<header class="top-head container-fluid">
|
||||
<button type="button" class="navbar-toggle pull-left">
|
||||
<span class="sr-only"><?= $lang['Toggle navigation']?></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<?php
|
||||
?>
|
||||
<form method="get" role="search" action="<?=$action?>" class="navbar-left app-search pull-left">
|
||||
<input type="hidden" name="selected_page" value="<?= ($s_selected_page!='' ? $s_selected_page : $selected_page) ?>" />
|
||||
<?= ($s_page_mode != ''? '<input type="hidden" name="page_mode" value="'.$s_page_mode.'" />' : ($page_mode != '' ? '<input type="hidden" name="page_mode" value="'.$page_mode.'" />' : '')) ?>
|
||||
<?= ($type != '' ? '<input type="hidden" name="type" value="'.$type.'" />' : '') ?>
|
||||
<?= ($page_status != '' ? '<input type="hidden" name="page_status" value="'.$page_status.'" />' : '<input type="hidden" name="page_status" value="'.$s_page_status.'" />') ?>
|
||||
|
||||
<?= ($id != '' ? '<input type="hidden" name="id" value="'.$id.'" />' : '') ?>
|
||||
<button type="submit" class="app-search-submit"><i class="fa fa-search"></i></button>
|
||||
<input type="text" name="search" class="form-control" value="<?= $search ?>" placeholder="Enter keywords...">
|
||||
<?php
|
||||
// for customer
|
||||
if ($show_map_script){
|
||||
echo '
|
||||
<input type="hidden" name="type" value="'.$type.'" />
|
||||
<input type="hidden" name="latitude" value="'.$current_lat.'" />
|
||||
<input type="hidden" name="longtitude" value="'.$current_lot.'" />
|
||||
<input type="hidden" name="submit" value="'.$submit.'" />
|
||||
<input type="hidden" name="sort_type" value="'.$sort_type.'" />
|
||||
<input type="hidden" name="sortby" value="'.$default_sortby.'" />' ;
|
||||
}
|
||||
echo $show_top_other_script ;
|
||||
?>
|
||||
</form>
|
||||
<?php
|
||||
$get_branch = $mysqli->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 '<div class="panel-heading col-sm-2" style="float:right;">
|
||||
<select class="form-control ui-search-input" onchange="location = this.value;">';
|
||||
while ( $row_branch = $get_branch->fetch_assoc() ){
|
||||
echo '<option value="'.$url_branch_ori.'&url_get_branch_admin_get='.$row_branch['branch_id'].'" '.($_SESSION['url_get_branch_admin'] == $row_branch['branch_id'] ? 'selected' : '').'>'.$row_branch['branch_name'].'</option>';
|
||||
}
|
||||
echo '</select>
|
||||
</div>';
|
||||
|
||||
}
|
||||
}
|
||||
$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 '<div class="panel-heading col-sm-2" style="float:right;">
|
||||
<select class="form-control ui-search-input" onchange="location = this.value;">';
|
||||
while ( $row_branch = $get_branch->fetch_assoc() ){
|
||||
echo '<option value="'.$url_branch_ori.'&url_get_branch_admin_get='.$row_branch['branch_id'].'" '.($_SESSION['url_get_branch_admin'] == $row_branch['branch_id'] ? 'selected' : '').'>'.$row_branch['branch_name'].'</option>';
|
||||
}
|
||||
echo '</select>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</header>
|
||||
<?php
|
||||
echo $echo_script_url;
|
||||
$mysqli_query = "SELECT post_title FROM system_post
|
||||
WHERE post_title != '' AND post_type = 'page-notification' AND post_trash = '0'" ;
|
||||
$mysqli_notification = $mysqli->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 .= '<li class="top_notification">'.dataFilter($row_notification['post_title']) .'</li>' ;
|
||||
}
|
||||
|
||||
echo '
|
||||
<script src="'.PATH.'scripts/jquery.marquee.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function (){
|
||||
$(".marquee").marquee();
|
||||
});
|
||||
</script>
|
||||
<ul class="marquee">
|
||||
'.$top_notification.'
|
||||
</ul>' ;
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
if ($_SESSION["system_id"] == "" || $_SESSION["system_name"] == "" || $_SESSION["system_branch"] == "" || $_SESSION["system_permission"] == ""){
|
||||
// check cookie login
|
||||
checkCookieLogin() ;
|
||||
// redirect page
|
||||
header("Location: ".PATH."index.php") ;
|
||||
exit ;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
include_once '../connect/cms-config.php' ;
|
||||
include_once '../requires/function.php' ;
|
||||
|
||||
// check login
|
||||
if ($_SESSION['system_id'] == '' && $_SESSION['system_name'] == ''){
|
||||
|
||||
$user = escapeString($_POST['user_name']); // name
|
||||
$password = $_POST['user_password'] ; // password
|
||||
|
||||
if ($user != '' && $password != ''){
|
||||
|
||||
// query for user
|
||||
$mysqli_user = $mysqli->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.' ;
|
||||
?>
|
||||
Reference in New Issue
Block a user