<?php
$must_login            = true ;
$require_path          = '../../' ;
$require_sub           = '../' ;
require( $require_sub.'header.php' ) ;

if ( $boolean_login ){
	$status   		   = '200' ;

	$is_delete         = 'no' ;
    if ( $staff_info['staff_username'] == 'jimmy' ){
        $is_delete     = 'yes' ;
    }

	$pages       	   = [] ;

	$select            = $mysqli->query( "SELECT a.page_id, b.title FROM app_page a
								   		  LEFT JOIN app_page_translation b ON ( a.page_id = b.page_id )
						                  WHERE a.deleted_at IS NULL AND b.lang = '".$array['lang']."' ORDER BY a.sortable" ) ;
	if ( $select->num_rows > 0 ){
		while ( $row      = $select->fetch_assoc() ){
			$row['id']    = dataFilter( $row['page_id'] ) ;
			$row['title'] = dataFilter( $row['title'] ) ;
			$pages[]      = $row ;
		}
	}

	$generatecode     = generateQrcode( $require_path, $staff_info['staff_idno'], PATH.'hr-staff-vcard.php?staff_idno='.$staff_info['staff_idno'] ) ;


	$data			   = [
		'is_delete'    => $is_delete,
		'pages'        => $pages,
		'namecard'     => $generatecode['url']
	] ;
}

require( $require_sub.'footer.php' ) ;
?>