<?php
include 'connect/cms-config.php' ;
include 'requires/function.php' ;
include 'requires/session.php' ;

require( 'extensions/mailer.php' ) ;
require( 'extensions/sms.php' ) ;

// include the class
include 'requires/class_resize.php' ;

// keep parameter in value
$page 				= escapeString($_GET['page']) ;
$page_mode 			= escapeString($_GET['page_mode']) ;
$type 				= escapeString($_GET['type']) ;
$search 			= escapeString($_GET['search']) ;

// active menu bar
$active_main_menu 	= 'visitor' ;
$active_sub_menu 	= 'visitor-list' ;
$active_menu 		= 'visitor-list' ;

// check permission
if ( !permissionCheck($row_user, 'visitor-list-view') ){
	echo '<script>alert("Sorry You Don\'t Have The Permission.")</script>';
	
	header('Location: index.php') ;
	exit ;
}

// mode type | all list | new | edit
switch($page_mode){
	case 'edit':
		$mysqli_page = $mysqli->query("SELECT * FROM visitor WHERE visitor_id = '".$page."'");

		if( $mysqli_page->num_rows == 0 ){
			header( "Location: visitor.php" ) ;
			exit ;
		}

		$row_page = $mysqli_page->fetch_assoc();



		if ( $_POST['hide'] == 1 ){

			$status 	= escapeString( $_POST['status'] ) ;

			// if ( $row_page['status'] == 'tested' ){
			if ( $row_page['status'] == 'pending' ){

	            $branch_hr_contact   = '' ;
	            $branch_hr_email     = '' ;
	            $branch_hr_cc        = [] ;
	            $branch_email_footer = '' ;
	            $mysqli_query        = "SELECT branch_hr_email, branch_hr_cc, branch_hr_contact, branch_email_footer FROM branch WHERE 
	                                    deleted_at IS NULL AND branch_id = '".$row_page['branch']."' LIMIT 1" ;
	            $mysqli_branch       = $mysqli->query($mysqli_query) ;
	            if ( $mysqli_branch->num_rows > 0 ){
	                $row_branch          = $mysqli_branch->fetch_assoc() ;
	                $branch_hr_contact   = dataFilter( $row_branch['branch_hr_contact'] ) ;
	                $branch_hr_email     = dataFilter( $row_branch['branch_hr_email'] ) ;
	                $branch_hr_cc        = explodeToArray( $row_branch['branch_hr_cc'] ) ;
	                $branch_email_footer = entityDecode( dataFilter( $row_branch['branch_email_footer'] ) ) ;
	            }



				$boolean_update     = false ;
				$title 				= '' ;
				$body 				= '' ;
				$body_sms 		    = '' ;
				if ( $status       == 'tested-approved' ){
					$boolean_update = true ;
					$title 			= 'Visitor Confirmation' ;

					// send email / sms
					$body 			  = 'Dear valued visitor, good day. Your application form has been approved.<br /><br />Kindly present your QR code to us during the visitation date via below link: <a href="'.PATH.'visitation/qrcode.php?visitor_id='.$page.'&token='.setSecret( $page ).'">'.PATH.'visitation/qrcode.php?visitor_id='.$page.'&token='.setSecret( $page ).'</a>.<br /><br />Thank you and have a nice day.<br /><br />by ' . COMPANY ;
					$body_sms  		  = 'Dear valued visitor, good day. Your application form has been approved. Kindly present your QR code to us during the visitation date via below link: '.PATH.'visitation/qrcode.php?visitor_id='.$page.'&token='.setSecret( $page ).' Thank you and have a nice day.' ;
				}

				if ( $status       == 'tested-rejected' ){
					$boolean_update = true ;
					$title 			= 'Visitor Rejected' ;
					$body 			= 'Dear valued visitor, good day. Sorry to inform that your visitation request has been rejected.<br /><br />by ' . COMPANY ;
					$body_sms 	    = 'Dear valued visitor, good day. Sorry to inform that your visitation request has been rejected.' ;
				}

				if ( $boolean_update ){

					if ( $mysqli->query( "UPDATE visitor SET
									 	  status 		  = '".$status."' 
									 	  WHERE visitor_id = '".$page."'" ) ){

						$mailer           = new Mailer() ;
					    $mailer->from     = $branch_hr_email ;
					    $mailer->to       = [ $row_page['email'] ] ;
                        if ( count($branch_hr_cc) > 0 ){
                            $mailer->cc   = $branch_hr_cc ;
                        }
					    $mailer->subject  = $title ;
					    $mailer->body     = $body ;
					    $mailer->send() ;

					    if ( substr( $row_page['mobile'], 0, 2 ) == '60' || substr( $row_page['mobile'], 0, 3 ) == '+60' ||
					    	 substr( $row_page['mobile'], 0, 2 ) == '65' || substr( $row_page['mobile'], 0, 3 ) == '+65' ){
						    $sms          = new Sms() ;
							$sms->to      = $row_page['mobile'] ;
							$sms->message = $body_sms ;
							$sms->send() ;
					    }

						header( "Refresh: 0" ) ;
						exit ;

					}

				}

			}

		}

		// start header here
		include 'requires/page_header.php';
		include 'requires/page_top.php';
		?>
		<span id="hidden_qrcode_link" style="display: none;"><?= PATH.'visitation/qrcode.php?visitor_id='.$page.'&token='.setSecret( $page ) ?></span>

		<div class="warper container-fluid">   	
			<div class="page-header"><h1><?= $lang['Visitor']?> <small><?= $lang[$page_mode] ?></small></h1></div>
            <div class="panel panel-default view-data">
                <div class="panel-heading"></div>
                <div class="panel-body">
                	<form method="post" id="quotationForm" enctype="multipart/form-data" novalidate="novalidate">
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">Appointment Date</div>
	                        <div class="col-sm-9">
	                        	<input type="text" name="visted_dated" class="form-control" disabled value="<?= ( $row_page['visited_at'] != '0000-00-00 00:00:00' ? date( 'Y-m-d H:iA', strtotime( $row_page['visited_at'] ) ) . ' ~ ' . date( 'Y-m-d H:iA', strtotime( $row_page['visited_at_to'] ) ) : '' ) ?>" placeholder="Appointment Date" />
	                        </div>
	                    </div>
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">Branch To Visit</div>
	                        <div class="col-sm-9">
	                        	<?php
								// get branch name
								$branch_name     = '' ;
								$mysqli_query    = "SELECT branch_id, branch_name FROM branch
												    WHERE branch_id = '".$row_page['branch']."' LIMIT 1" ;
								$mysqli_branch   = $mysqli->query($mysqli_query) ;
								if ( $mysqli_branch->num_rows > 0 ){
									$row_branch  = $mysqli_branch->fetch_assoc() ;
									$branch_name = $row_branch['branch_name'] ;
								}
                        		?>
	                        	<input type="text" name="branch" class="form-control" disabled value="<?= $branch_name ?>" placeholder="Branch To Visit">
	                        </div>
	                    </div>
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">Visitor Category</div>
	                        <div class="col-sm-9">
	                        	<input type="text" name="category" class="form-control" disabled value="<?= dataFilter($row_page['category']) ?>" placeholder="Visitor Category">
	                        </div>
	                    </div>
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">Visitor Name</div>
	                        <div class="col-sm-9">
	                        	<input type="text" name="name" class="form-control" disabled value="<?= dataFilter($row_page['name']) ?>" placeholder="Visitor Name">
	                        </div>
	                    </div>
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">Contact Number</div>
	                        <div class="col-sm-9">
	                        	<input type="text" name="mobile" class="form-control" disabled value="<?= dataFilter($row_page['mobile']) ?>" placeholder="Contact Number">
	                        </div>
	                    </div>
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">Email</div>
	                        <div class="col-sm-9">
	                        	<input type="text" name="email" class="form-control" disabled value="<?= dataFilter($row_page['email']) ?>" placeholder="Email">
	                        </div>
	                    </div>
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">NRIC / Passport No</div>
	                        <div class="col-sm-9">
	                        	<input type="text" name="identity" class="form-control" disabled value="<?= dataFilter($row_page['identity']) ?>" placeholder="NRIC / Passport No">
	                        </div>
	                    </div>
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">Nationality</div>
	                        <div class="col-sm-9">
	                        	<input type="text" name="nationality" class="form-control" disabled value="<?= dataFilter($row_page['nationality']) ?>" placeholder="Nationality">
	                        </div>
	                    </div>
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">Visitor Company</div>
	                        <div class="col-sm-9">
	                        	<input type="text" name="visitor_company" class="form-control" disabled value="<?= dataFilter($row_page['visitor_company']) ?>" placeholder="Visitor Company">
	                        </div>
	                    </div>
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">Car Plate</div>
	                        <div class="col-sm-9">
	                        	<input type="text" name="car_plate" class="form-control" disabled value="<?= dataFilter($row_page['car_plate']) ?>" placeholder="Car Plate">
	                        </div>
	                    </div>
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">Reason To Visit</div>
	                        <div class="col-sm-9">
	                        	<input type="text" name="reason" class="form-control" disabled value="<?= dataFilter($row_page['reason']) ?>" placeholder="Visit Reason">
	                        </div>
	                    </div>
						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label"><?= COMPANYSHORT ?> Contact Person</div>
	                        <div class="col-sm-9">
	                        	<input type="text" name="contact_person" class="form-control" disabled value="<?= dataFilter($row_page['contact_person']) ?>" placeholder="<?= COMPANYSHORT ?> Contact Person">
	                        </div>
	                    </div>

	                    <?php if ($row_page['test_file'] != ''){ ?>
	                        <div class="form-group clearfix form-group-pdf">
	                            <div class="col-sm-2 control-label"><?= $lang['preview']?></div>
	                            <div class="col-sm-9">
	                            	<label class="remove_photo"><input type="checkbox" name="remove_photo" class="ui-checkbox tick" value="1">&nbsp;<?= $lang['Remove']?> <?= $lang['File']?></label>
	                            	<div class="rotate_image_box">
				                        <a href="<?=PATH?>uploads/Visitor/b/<?=dataFilter($row_page['test_file'])?>" data-width="500" data-height="500" class="fancybox fancybox_iframe">
				                            <img src="<?=PATH?>uploads/Visitor/<?=dataFilter($row_page['test_file'])?>" max-width="200px" style="width:80px;margin-bottom:0;display:block;top:10px;margin-right:10px;object-fit:contain" />
				                        </a>
				                        <img src="Images/lazy_load_loading.gif" class="rotate_loading" />
				                    </div>
		                        </div>
	                        </div>
	                    <?php } ?>

	                    <?php if ($row_page['visiter_file'] != ''){ ?>
	                        <div class="form-group clearfix form-group-pdf">
	                            <div class="col-sm-2 control-label"><?= $lang['preview']?></div>
	                            <div class="col-sm-9">
	                            	<div class="rotate_image_box">
				                        <a href="<?=PATH?>uploads/Visitor/b/<?=dataFilter($row_page['visiter_file'])?>" data-width="500" data-height="500" class="fancybox fancybox_iframe">
				                            <img src="<?=PATH?>uploads/Visitor/<?=dataFilter($row_page['visiter_file'])?>" max-width="200px" style="width:80px;margin-bottom:0;display:block;top:10px;margin-right:10px;object-fit:contain" />
				                        </a>
				                        <a href="<?=PATH?>uploads/Visitor/b/<?=dataFilter($row_page['visiter_file'])?>" download>Download</a>
				                        <img src="Images/lazy_load_loading.gif" class="rotate_loading" />
				                    </div>
		                        </div>
	                        </div>
	                    <?php } ?>

						<div class="form-group clearfix">
	                        <div class="col-sm-2 control-label">Status</div>
	                        <div class="col-sm-9" >
	                        	<select name="status" class="form-control">
	                        		<option value="pending" <?= ( $row_page['status'] == 'pending' ? 'selected' : '' ) ?> >Pending</option>
                        			<option value="tested-approved" <?= ( $row_page['status'] == 'tested-approved' ? 'selected' : '' ) ?> >Approved</option>
                        			<option value="visited" <?= ( $row_page['status'] == 'visited' ? 'selected' : '' ) ?> >Visited</option>
                        			<option value="tested-rejected" <?= ( $row_page['status'] == 'tested-rejected' ? 'selected' : '' ) ?> >Rejected</option>
	                        	</select>
	                        </div>
	                    </div>

	                    <?php if ( $row_page['status'] == 'pending' ){ ?>
		                    <div class="form-group clearfix">
		                        <div class="col-sm-2 control-label"></div>
		                        <div class="col-sm-9">
		                            <button type="submit" class="btn" style="color:white;background-color: #5e5bd0;float:right; margin-top: 5px;width: 100px;"><?= $lang['submit']?></button>
		                            <input type="hidden" name="hide" value="1">
		                            <input type="hidden" name="page_status" value="<?= $submit_type ?>">
		                        </div>
		                    </div>  
		                <?php } ?>

					</form>
                </div>
            </div>





            <div class="panel panel-default">
                <div class="panel-heading"></div>
                <div class="panel-body">

                	<div class="form-group clearfix">
                        <div class="col-sm-2 control-label"></div>
                        <div class="col-sm-9" >
                        	<table cellpadding="0" cellspacing="0" border="0" class="responsive table table-striped table-bordered" id="basic-datatable">
		                		<thead>
			                		<tr>
			                			<th>No.</th>
			                			<th>File</th>
			                			<th>Checkin At</th>
			                		</tr>
			                	</thead>
			                	<tbody>

				                	<?php
				                	$select_checkin = $mysqli->query( "SELECT * FROM visitor_checkin WHERE visitor_id = '".$page."' AND deleted_at IS NULL" ) ;

				                	if ( $select_checkin->num_rows > 0 ){
				                		$count_no = 0 ;
				                		while ( $row_checkin = $select_checkin->fetch_assoc() ){
				                			$count_no++ ; ?>
				                			<tr>
				                				<td><?= $count_no ?>.</td>
						                        <td>
						                        	<div class="rotate_image_box" style="width: 50px; height: 50px; overflow: hidden; margin: 0 auto; text-align:center;">
							                        	<a href="<?= PATH ?>uploads/Visitor/b/<?= dataFilter($row_checkin['checkin_file']) ?>" data-width="500" data-height="500" class="fancybox fancybox_iframe">
								                            <img src="<?= PATH ?>uploads/Visitor/<?= dataFilter($row_checkin['checkin_file']) ?>" max-width="200px" style="width:50px;margin-bottom:0;display:block;top:10px;margin-right:10px;object-fit:contain" />
								                        </a>
							                        	<a href="<?= PATH ?>uploads/Visitor/b/<?= dataFilter($row_checkin['checkin_file']) ?>" download>Download</a>
								                    </div>
						                        </td>
						                        <td><?= $row_checkin['created_at'] ?></td>
						                    </tr>
				                		<?php }
				                	}
				                	?>

				                </tbody>
			                </table>
                        </div>
                    </div>

                </div>
            </div>

		</div>

		<?php
	break;
	// all visitor list
	case 'all' :
	default :

		$search_name 		= escapeString( $_GET['search_name'] ) ;
		$search_mobile 		= escapeString( $_GET['search_mobile'] ) ;
		$search_email 		= escapeString( $_GET['search_email'] ) ;
		$search_identity 	= escapeString( $_GET['search_identity'] ) ;
		$status 			= escapeString( $_GET['status'] ) ;
		$date_visit 		= escapeString( $_GET['date_visit'] ) ;
		$date_created 		= escapeString( $_GET['date_created'] ) ;
		$category 			= escapeString( $_GET['category'] ) ;


		if( $search_name != ''){
			$search_query .= " AND a.name LIKE '%".$search_name."%'" ;
		}
		if( $search_mobile != ''){
			$search_query .= " AND a.mobile LIKE '%".$search_mobile."%'" ;
		}
		if( $search_email != ''){
			$search_query .= " AND a.email LIKE '%".$search_email."%'" ;
		}
		if( $search_identity != ''){
			$search_query .= " AND a.identity LIKE '%".$search_identity."%'" ;
		}
		if( $status != ''){
			$search_query .= " AND a.status LIKE '".$status."'" ;
		}
		if( $date_visit != ''){
			$new_date_visit = date( 'Y-m-d', strtotime( $date_visit ) ) ;
			$search_query .= " AND ( a.visited_at <= '".$new_date_visit."' OR a.visited_at LIKE '%".$new_date_visit."%' ) AND ( a.visited_at_to >= '".$new_date_visit."' OR a.visited_at_to LIKE '%".$new_date_visit."%' ) " ;
		}
		if( $date_created != ''){
			$search_query .= " AND a.created_at LIKE '%".date( 'Y-m-d', strtotime( $date_created ) )."%'" ;
		}
		if( $category != ''){
			$search_query .= " AND a.category LIKE '%".$category."%'" ;
		}
		
		// pagination
		if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change)
		$start_from = ($product_page - 1) * LIMIT ; //end next and prev page
		
		// set search url
		$search_url = 'search='.$search ;
		
		// page query
		$mysqli_query = "SELECT a.visitor_id, a.branch, a.category, a.name, a.mobile, a.email, a.identity, a.nationality, a.status, a.visited_at, visited_at_to, a.created_at, b.branch_name FROM visitor a
						 LEFT JOIN branch b ON ( a.branch = b.branch_id )
						 WHERE a.deleted_at IS NULL " . $search_query . str_replace( 'branch_id', 'branch', $user_branch_permission_sql ) ;
		$mysqli_page = $mysqli->query( $mysqli_query." ORDER BY a.visitor_id DESC LIMIT $start_from, " . LIMIT ) ;

		// load pagination
		$page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ;
		
		// start header here
		include 'requires/page_header.php' ;
		include 'requires/page_top.php' ;
		
		?>
		<!-- Header Ends -->
		<div class="warper container-fluid">   	
			<div class='container' style="background-color: white; border-radius: 10px;">
				<div class="page-header" style="margin: 30px 0px 0px 0px;padding: 0px;">
					<h1><?= $lang['Visitor']?> <small><?= $lang['list']?></small></h1>
				</div>

				<div class="panel panel-default" id="basic-table-title">
			        <div class="panel-heading">
			        	search
			        </div>
			        <div class="panel-body">
			            <form method="get" class="form-horizontal">
			                <div class="form-group">
			                    <label class="col-sm-2 control-label"><?= $lang['Category'] ?></label>
			                    <div class="col-sm-9">
			                    	<input type="text" name="category" value="<?= $category ?>" class="form-control" />
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-sm-2 control-label"><?= $lang['Name'] ?></label>
			                    <div class="col-sm-9">
			                        <input type="text" name="search_name" value="<?= $search_name ?>" class="form-control" />
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-sm-2 control-label"><?= $lang['Mobile No'] ?></label>
			                    <div class="col-sm-9">
			                        <input type="text" name="search_mobile" value="<?= $search_mobile ?>" class="form-control" />
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-sm-2 control-label"><?= $lang['email'] ?></label>
			                    <div class="col-sm-9">
			                        <input type="text" name="search_email" value="<?= $search_email ?>" class="form-control" />
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-sm-2 control-label"><?= $lang['Identity'] ?></label>
			                    <div class="col-sm-9">
			                        <input type="text" name="search_identity" value="<?= $search_identity ?>" class="form-control" />
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-sm-2 control-label"><?= $lang['status'] ?></label>
			                    <div class="col-sm-9">
	                                <select name="status" class="form-control">
	                                    <option value="">Search</option>
	                                    <option value="pending" <?= ($status == 'pending' ? 'selected' : '') ?>>Pending</option>
	                                    <option value="tested-approved" <?= ($status == 'tested-approved' ? 'selected' : '') ?>>Approved</option>
	                                    <option value="tested-rejected" <?= ($status == 'tested-rejected' ? 'selected' : '') ?>>Rejected</option>
	                                    <option value="visited" <?= ($status == 'visited' ? 'selected' : '') ?>>Visited</option>
	                                </select>
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-sm-2 control-label"><?= $lang['Visit At'] ?></label>
			                    <div class="col-sm-9">
			                        <input class="form-control" name="date_visit" type="date" value="<?= $date_visit ?>">
			                    </div>
			                </div>
			                <div class="form-group">
			                    <label class="col-sm-2 control-label"><?= $lang['Created At'] ?></label>
			                    <div class="col-sm-9">
			                        <input class="form-control" name="date_created" type="date" value="<?= $date_created ?>">
			                    </div>
			                </div>
			                <div class="form-group">
			                    <div class="col-sm-11">
			                        <input type="hidden" name="page_mode" value="<?= $page_mode ?>" />
			                        <input type="hidden" name="search" value="<?= $search ?>" />
			                        <input type="hidden" name="search_staffid" value="<?= $search_staffid ?>" />
			                        <input type="hidden" name="search_mode" value="<?= $search_mode ?>" />
			                        <button type="submit" class="btn" style="color:white;background-color: #5e5bd0;float:right; margin-top: 5px;width: 100px;"><?= $lang['submit'] ?></button>
			                    </div>
			                </div>
			            </form>
			        </div>
			    </div>

	            <form method="post">

	                <div class="panel panel-default">
	                    <div class="panel-heading">
	                    	listing
	                    </div>
	                    <div class="panel-body">
							<table cellpadding="0" cellspacing="0" border="1" class="listing-table responsive table table-striped table-bordered" id="basic-datatable">
								<thead>
									<tr>
										<th><?= $lang['Action']?></th>
										<th><?= $lang['branch']?></th>
										<th><?= $lang['Category']?></th>
										<th><?= $lang['Name']?></th>
										<th><?= $lang['Mobile']?></th>
										<th><?= $lang['email']?></th>
										<th><?= $lang['Identity']?></th>
										<th><?= $lang['Nationality']?></th>
										<th><?= $lang['status']?></th>
										<th><?= $lang['Visit At']?></th>
										<th><?= $lang['Created At']?></th>
									</tr>
								</thead>
								<tbody>
									<?php
									if ( $mysqli_page->num_rows > 0 ){
										while ( $row_page = $mysqli_page->fetch_assoc() ){
											echo '
											 <tr class="odd gradeX">
											 	<td class="align_center">
													<a title="'.$lang['view'].$lang['Visitor'].'" href="visitor.php?page_mode=edit&page='.$row_page['visitor_id'].'"><i class="fa fa-edit"></i></a>
											 	</td>
												<td>'.ucwords($row_page['branch_name']).'</td>
												<td>'.dataFilter($row_page['category']).'</td>
												<td>'.dataFilter($row_page['name']).'</td>
												<td>'.dataFilter($row_page['mobile']).'</td>
												<td>'.dataFilter($row_page['email']).'</td>
												<td>'.dataFilter($row_page['identity']).'</td>
												<td>'.dataFilter($row_page['nationality']).'</td>
												<td class="align_center">'.taskStatusButton($row_page['status']).'</td>
												<td class="align_center">'.$row_page['visited_at'].' ~ '.$row_page['visited_at_to'].'</td>
												<td class="align_center">'.$row_page['created_at'].'</td>
											</tr>';
										}
									}else{
										echo '
										<tr class="odd gradeX">
											<td class="border_none">'.$lang['no_data'].'</td>
											<td class="border_none"></td>
											<td class="border_none"></td>
											<td class="border_none"></td>
											<td class="border_none"></td>
											<td class="border_none"></td>
											<td class="border_none"></td>
											<td class="border_none"></td>
											<td class="border_none"></td>
											<td class="border_none"></td>
											<td class="border_none"></td>
										</tr>
										';
									}
									?>
								</tbody>
							</table>
							<?= $page_pagination['page_pagination'] ?>
	                    </div>
	                </div>
				</form>
			</div>
		</div>
		<?php
	break ;
}
// footer
include 'requires/page_footer.php' ;
?>