59 lines
2.6 KiB
PHP
59 lines
2.6 KiB
PHP
<?php
|
|
$must_login = true ;
|
|
$require_path = '../../../' ;
|
|
$require_sub = '../../' ;
|
|
require( $require_sub.'header.php' ) ;
|
|
|
|
$status = '300' ;
|
|
|
|
$id = $array['id'] ;
|
|
|
|
if ( $id != '' ){
|
|
$status = '303' ;
|
|
|
|
if ( $staff_info['staff_settings']['approvevisitation'] == 'yes' ){
|
|
$status = '201' ;
|
|
|
|
$select = $mysqli->query( "SELECT * FROM visitor
|
|
WHERE deleted_at IS NULL AND visitor_id = '".$id."' AND branch = '".$array['branch_id']."' AND status IN ( 'pending', 'tested-approved' ) LIMIT 1" ) ;
|
|
if ( $select->num_rows > 0 ){
|
|
|
|
$status = '200' ;
|
|
|
|
$row_visitor = $select->fetch_assoc() ;
|
|
|
|
// get branch name
|
|
$branch_name = '' ;
|
|
$mysqli_query = "SELECT branch_id, branch_name FROM branch
|
|
WHERE branch_id = '".$row_visitor['branch']."' LIMIT 1" ;
|
|
$mysqli_branch = $mysqli->query($mysqli_query) ;
|
|
if ( $mysqli_branch->num_rows > 0 ){
|
|
$row_branch = $mysqli_branch->fetch_assoc() ;
|
|
$branch_name = $row_branch['branch_name'] ;
|
|
}
|
|
|
|
$data = [
|
|
'visitor_id' => dataFilter( $row_visitor['visitor_id'] ),
|
|
'appointment_date' => date( 'Y-m-d H:iA', strtotime( $row_visitor['visited_at'] ) ) . ' ~ ' . date( 'Y-m-d H:iA', strtotime( $row_visitor['visited_at_to'] ) ),
|
|
'branch_name' => dataFilter( $branch_name ),
|
|
'visitor_category' => ucwords( dataFilter( $row_visitor['category'] ) ),
|
|
'visitor_name' => dataFilter( $row_visitor['name'] ),
|
|
'contact_number' => dataFilter( $row_visitor['mobile'] ),
|
|
'email' => dataFilter( $row_visitor['email'] ),
|
|
'nric_passport' => dataFilter( $row_visitor['identity'] ),
|
|
'nationality' => dataFilter( $row_visitor['nationality'] ),
|
|
'visitor_company' => ucwords( dataFilter( $row_visitor['visitor_company'] ) ),
|
|
'car_plate' => dataFilter( $row_visitor['car_plate'] ),
|
|
'reason_to_visit' => dataFilter( $row_visitor['reason'] ),
|
|
'contact_person' => dataFilter( $row_visitor['contact_person'] ),
|
|
'status' => dataFilter( $row_visitor['status'] )
|
|
] ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
require( $require_sub.'footer.php' ) ;
|
|
?>
|