<?php
	require 'autoload.php';
	use Parse\ParseClient;
	use Parse\ParseObject;
	use Parse\ParseQuery;
	use Parse\ParseACL;
	use Parse\ParsePush;
	use Parse\ParseUser;
	use Parse\ParseInstallation;
	use Parse\ParseException;
	use Parse\ParseAnalytics;
	use Parse\ParseFile;
	use Parse\ParseCloud;
	
	include 'includes/func.php';
	include 'config.php';
	
	ParseClient::initialize($ApplicationID, $RestAPIKEY, $MasterKey);
	ParseClient::setServerURL($serverURLB4APP, '/');
?>
<?php
	if(!isset($_SESSION["username"])  && !isset($_SESSION["password"]) && !isset($_SESSION["adminRole"])){
		//header('Location: login.php');
	}
	
	$arrBuilding = array();
								
								
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<title>View Beacon</title>
	<?php include 'includes/head.php'; ?>
</head>
<body>
    <div id="wrapper">
        <?php include 'includes/header.php';?>
        <div id="page-wrapper">
            <div class="container-fluid">
                <div class="row">
					<div class="col-lg-12">
						<?php
							if(isset($_GET['uTp'])){
								$objID	=	$_GET['uTp'];
								$qury = new ParseQuery("beacon");
								$result = $qury->get($objID);								
						?>	
                         <h1 class="page-header">
                            <?php echo '<b> Beacon ID: </b>'.$result->get("unique_id").''; ?>
							<a href="manage-beacons.php" class="btn btn-danger pull-right">Go Back</a>
                        </h1>
						<div class="row">
							<div class="col-md-12">
								<div class="panel panel-default">
									  <div class="panel-heading">Beacons Details</div>
									  <div class="panel-body">
											<div class="row">
												<div class="col-md-12">
													<table class="table table-bordered table-hover">
														<tr>
															<td>Unique Id</td>
															<td><?php echo $result->get("unique_id"); ?></td>
														</tr>
														<tr>
															<td>Proximit</td>
															<td><?php echo $result->get("proximity"); ?></td>
														</tr>
														
														<tr>
															<td>Mac Address</td>
															<td><?php echo $result->get("macAddress"); ?></td>
														</tr>
														<tr>
															<td>Proximity UUID</td>
															<td><?php echo $result->get("proximity_uuid"); ?></td>
														</tr>
														<tr>
															<td>Major</td>
															<td><?php echo $result->get("major"); ?></td>
														</tr>
														<tr>
															<td>Minor</td>
															<td><?php echo $result->get("minor"); ?></td>
														</tr>
																												
													</table>
												</div>
											</div>
									  </div>
									</div>
							</div>							
						</div>
						<?php } ?>
                    </div>
					
					
					
                </div>
                <!-- /.row -->
			</div>
            <!-- /.container-fluid -->
        </div>
        <!-- /#page-wrapper -->
    </div>
    <!-- /#wrapper -->
   <?php include 'includes/footer.php'; ?>
    
</body>
</html>