first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
$must_login = true ;
|
||||
$require_path = '../../' ;
|
||||
$require_sub = '../' ;
|
||||
require( $require_path.'extensions/sms.php' ) ;
|
||||
require( $require_path.'extensions/mailer.php' ) ;
|
||||
require( $require_sub.'header.php' ) ;
|
||||
|
||||
if ( $boolean_login ){
|
||||
$status = '300' ;
|
||||
|
||||
if ( $array['password'] != '' ){
|
||||
$status = '205' ;
|
||||
|
||||
$password = $staff_info['staff_id'].strPad( 6, rand(000000, 999999) ) ;
|
||||
$enc_password = passwordEncrypt( $array['password'] ) ;
|
||||
|
||||
if ( $mysqli->query( "UPDATE staff SET
|
||||
staff_password = '".$enc_password."'
|
||||
WHERE staff_id = '".$staff_info['staff_id']."'" ) ){
|
||||
|
||||
$status = '208' ;
|
||||
|
||||
$mailer = new Mailer() ;
|
||||
$mailer->from = EMAILNOREPLY ;
|
||||
$mailer->to = [ $staff_info['staff_email'] ] ;
|
||||
$mailer->subject = 'Change password' ;
|
||||
$mailer->body = 'Your new password was success change to ' . $array['password'] ;
|
||||
if ( $mailer->send() ){
|
||||
$status = '200' ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
require( $require_sub.'footer.php' ) ;
|
||||
?>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
$must_login = false ;
|
||||
$require_path = '../../' ;
|
||||
$require_sub = '../' ;
|
||||
require( $require_path.'extensions/sms.php' ) ;
|
||||
require( $require_path.'extensions/mailer.php' ) ;
|
||||
require( $require_sub.'header.php' ) ;
|
||||
|
||||
$status = '300' ;
|
||||
|
||||
if ( $array['staff_idno'] != '' && $array['username'] != '' ){
|
||||
$status = '290' ;
|
||||
|
||||
$mysqli_staff = $mysqli->query("SELECT staff_id, staff_idno, staff_username, staff_email, staff_mobileno FROM staff
|
||||
WHERE deleted_at IS NULL AND ( staff_date_resigned IS NULL OR staff_date_resigned = '0000-00-00' ) AND staff_idno = '".$array['staff_idno']."' AND staff_username = '".$array['username']."' LIMIT 1") ;
|
||||
|
||||
if ( $mysqli_staff->num_rows > 0 ){
|
||||
$status = '204' ;
|
||||
|
||||
$row_staff = $mysqli_staff->fetch_assoc() ;
|
||||
|
||||
$password = $row_staff['staff_id'].strPad( 6, rand(000000, 999999) ) ;
|
||||
$enc_password = passwordEncrypt( $password ) ;
|
||||
|
||||
if ( $mysqli->query( "UPDATE staff SET
|
||||
staff_password = '".$enc_password."'
|
||||
WHERE staff_id = '".$row_staff['staff_id']."'" ) ){
|
||||
|
||||
$status = '208' ;
|
||||
|
||||
$mailer = new Mailer() ;
|
||||
$mailer->from = EMAILNOREPLY ;
|
||||
$mailer->to = [ $row_staff['staff_email'] ] ;
|
||||
$mailer->subject = 'Reset password' ;
|
||||
$mailer->body = 'Your temporary password is ' . $password ;
|
||||
if ( $mailer->send() ){
|
||||
$status = '200' ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
require( $require_sub.'footer.php' ) ;
|
||||
?>
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
$must_login = false ;
|
||||
$require_path = '../../' ;
|
||||
$require_sub = '../' ;
|
||||
require( $require_sub.'header.php' ) ;
|
||||
|
||||
$username = $array['username'] ;
|
||||
$password = $array['password'] ;
|
||||
$token = $array['token'] ;
|
||||
|
||||
$status = '300' ;
|
||||
|
||||
if ( $username != '' && $password != '' ){
|
||||
$status = '284' ;
|
||||
|
||||
$password = passwordEncrypt( $password ) ;
|
||||
$mysqli_staff = $mysqli->query("SELECT staff_id, staff_idno, staff_name, staff_shortname, staff_username, staff_email, staff_mobileno, staff_image, job_position_id, job_section_id, branch_id, staff_point_achievement, staff_point, staff_wallet, staff_tier, staff_achievement, staff_star, staff_settings, country_id FROM staff
|
||||
WHERE deleted_at IS NULL AND ( staff_date_resigned IS NULL OR staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND staff_username = '".$username."' AND staff_password = '".$password."' LIMIT 1") ;
|
||||
if ( $mysqli_staff->num_rows > 0 ){
|
||||
$status = '200' ;
|
||||
|
||||
$row_staff = $mysqli_staff->fetch_array(MYSQLI_ASSOC) ;
|
||||
|
||||
$code = time().strPad( 6, rand(000000, 999999) ) ;
|
||||
$tokencode = $row_staff['staff_id'] . '_' . $code . md5($code) ;
|
||||
|
||||
$mysqli->query( "INSERT INTO staff_token
|
||||
( staff_id, platform, token ) VALUES
|
||||
( '".$row_staff['staff_id']."', '".$array['platform']."', '".$tokencode."' )" ) ;
|
||||
|
||||
if ( $array['notification'] != '' ){
|
||||
|
||||
$select_notification = $mysqli->query( "SELECT * FROM staff_notification
|
||||
WHERE notification = '".$array['notification']."' LIMIT 1" ) ;
|
||||
if ( $select_notification->num_rows == 0 ){
|
||||
$mysqli->query( "INSERT INTO staff_notification
|
||||
( notification, staff_id ) VALUES
|
||||
( '".$array['notification']."', '".$row_staff['staff_id']."' )" ) ;
|
||||
}else{
|
||||
$mysqli->query( "UPDATE staff_notification SET
|
||||
staff_id = '".$row_staff['staff_id']."'
|
||||
WHERE notification = '".$array['notification']."'" ) ;
|
||||
}
|
||||
}
|
||||
|
||||
$row_staff['staff_image'] = ( $row_staff['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_staff['staff_image']) : '' ) ;
|
||||
$row_staff['token'] = $tokencode ;
|
||||
$row_staff['staff_settings'] = ( $row_staff['staff_settings'] != '' ? json_decode($row_staff['staff_settings'], true) : [] ) ;
|
||||
|
||||
|
||||
$get_tier = getTier( $row_staff['staff_tier'], $array['lang'] ) ;
|
||||
$row_staff['staff_tier_level'] = $get_tier['level'] ;
|
||||
$row_staff['staff_tier_title'] = $get_tier['title'] ;
|
||||
$row_staff['staff_tier_is_task'] = $get_tier['is_task'] ;
|
||||
$row_staff['staff_tier_is_task_assigned'] = $get_tier['is_task_assigned'] ;
|
||||
$row_staff['staff_tier_is_task_incentive'] = $get_tier['is_task_incentive'] ;
|
||||
$row_staff['staff_tier_is_task_incentive2'] = $get_tier['is_task_incentive2'] ;
|
||||
$row_staff['staff_tier_is_task_extra'] = $get_tier['is_task_extra'] ;
|
||||
$row_staff['staff_tier_is_adjustment'] = $get_tier['is_adjustment'] ;
|
||||
|
||||
$row_staff['staff_star'] = ( $row_staff['staff_star'] + 0 ) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$data = $row_staff ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
require( $require_sub.'footer.php' ) ;
|
||||
?>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$must_login = false ;
|
||||
$require_path = '../../' ;
|
||||
$require_sub = '../' ;
|
||||
require( $require_sub.'header.php' ) ;
|
||||
|
||||
$username = $array['username'] ;
|
||||
$name = $array['name'] ;
|
||||
$mobile = $array['mobile'] ;
|
||||
$email = $array['email'] ;
|
||||
$password = $array['password'] ;
|
||||
$token = $array['token'] ;
|
||||
|
||||
$status = '300' ;
|
||||
|
||||
if ( $username != '' && $name != '' && $mobile != '' && $email != '' && $password != '' ){
|
||||
$status = '289' ;
|
||||
|
||||
$mysqli_staff = $mysqli->query( "SELECT staff_id, staff_idno, staff_name, staff_shortname, staff_username, staff_email, staff_mobileno, staff_image, job_position_id, job_section_id, staff_point_achievement, staff_point, staff_wallet, staff_tier, staff_achievement, staff_star FROM staff
|
||||
WHERE deleted_at IS NULL AND staff_username = '".$username."' LIMIT 1" ) ;
|
||||
if ( $mysqli_staff->num_rows == 0 ){
|
||||
$status = '200' ;
|
||||
|
||||
$password = passwordEncrypt( $password ) ;
|
||||
$mysqli->query( "INSERT INTO staff
|
||||
( staff_name, staff_username, staff_email, staff_mobileno, staff_password, staff_date_resigned, staff_run_away ) VALUES
|
||||
( '".$name."', '".$username."', '".$email."', '".$mobile."', '".$password."', '".TODAYDAY."', 'yes' )" ) ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
require( $require_sub.'footer.php' ) ;
|
||||
?>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
$must_login = true ;
|
||||
$require_path = '../../' ;
|
||||
$require_sub = '../' ;
|
||||
require( $require_path.'extensions/sms.php' ) ;
|
||||
require( $require_path.'extensions/mailer.php' ) ;
|
||||
require( $require_sub.'header.php' ) ;
|
||||
|
||||
if ( $boolean_login ){
|
||||
$status = '300' ;
|
||||
|
||||
if ( $array['password'] != '' ){
|
||||
$status = '205' ;
|
||||
|
||||
$password = $staff_info['staff_id'].strPad( 6, rand(000000, 999999) ) ;
|
||||
$enc_password = passwordEncrypt( $array['password'] ) ;
|
||||
|
||||
if ( $mysqli->query( "UPDATE staff SET
|
||||
staff_password = '".$enc_password."'
|
||||
WHERE staff_id = '".$staff_info['staff_id']."'" ) ){
|
||||
|
||||
$status = '208' ;
|
||||
|
||||
$mailer = new Mailer() ;
|
||||
$mailer->from = EMAILNOREPLY ;
|
||||
$mailer->to = [ $staff_info['staff_email'] ] ;
|
||||
$mailer->subject = 'Change password' ;
|
||||
$mailer->body = 'Your new password was success change to ' . $array['password'] ;
|
||||
if ( $mailer->send() ){
|
||||
$status = '200' ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
require( $require_sub.'footer.php' ) ;
|
||||
?>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
$must_login = false ;
|
||||
$require_path = '../../' ;
|
||||
$require_sub = '../' ;
|
||||
require( $require_sub.'header.php' ) ;
|
||||
|
||||
$status = '300' ;
|
||||
$test_file = $array['test_file'] ;
|
||||
|
||||
// if ( $array['name'] != '' && $array['mobile'] != '' && $array['temperature'] != '' ){
|
||||
if ( $array['name'] != '' && $array['mobile'] != '' ){
|
||||
$status = '203' ;
|
||||
|
||||
/*
|
||||
$test_filename = '' ;
|
||||
$test_filetype = '' ;
|
||||
foreach ( $test_file as $k => $v ){
|
||||
if ( $v['type'] == 'local' ){
|
||||
$file_upload = ( $v['file'] ) ;
|
||||
$upload = uploadImage( 'Visitor', md5( $array['name'] ), $file_upload ) ;
|
||||
if ( $upload['status'] != '200' ){
|
||||
$count_upload++ ;
|
||||
}else{
|
||||
$test_filename = $upload['data']['file_name'] ;
|
||||
$test_filetype = $upload['data']['file_type'] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $test_file != '' ){
|
||||
|
||||
if ( $mysqli->query( "INSERT INTO visitor
|
||||
( name, mobile, temperature, test_file, test_filetype ) VALUES
|
||||
( '".$array['name']."', '".$array['mobile']."', '".$array['temperature']."', '".$test_filename."', '".$test_filetype."' )" ) ){
|
||||
$status = '200' ;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
if ( $mysqli->query( "INSERT INTO visitor
|
||||
( name, mobile ) VALUES
|
||||
( '".$array['name']."', '".$array['mobile']."' )" ) ){
|
||||
$status = '200' ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
require( $require_sub.'footer.php' ) ;
|
||||
?>
|
||||
Reference in New Issue
Block a user