<!DOCTYPE html>
<html lang="en">
<head>
	<title>Loading</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="icon" type="image/png" href="images/icons/favicon.ico"/>
	<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
	<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
	<link rel="stylesheet" type="text/css" href="css/util.css">
	<link rel="stylesheet" type="text/css" href="css/main.css">
        <link rel="stylesheet" type="text/css" href="css/progress.css">
	<script>
	let timeToReload = <?php echo $reloadTime; ?>;
	</script>
</head>
<body>
<div id="myProgress">
  <div id="myBar"></div>
</div>
	<div class="bg-g1 size1 flex-w flex-col-c-sb p-l-15 p-r-15 p-t-55 p-b-35 respon1">
		<span></span>
		<div class="flex-col-c p-t-50 p-b-50">
			<h3 class="l1-txt1 txt-center p-b-10">
				<?php if ($isNetworked) { echo "Network Connected"; } else {  echo "No Network Detected"; } ?>
			</h3>

			<p class="txt-center l1-txt2 p-b-60">
				<?php if ($hasInternet && !isset($isConnecting)) { echo "Looks like we can reach the internet too!"; } elseif (!$hasInternet && isset($isConnecting)) { echo "Please wait while we restart and connect..."; } else { echo "Uh Oh! We can't reach the internet. :("; } ?>
			</p>

			<div class="flex-w flex-c cd100 p-b-82">
				<div class="flex-col-c-m size2 how-countdown">
					<span class="l1-txt3 p-b-9 days"><?php echo $ipoctets[0]; ?></span>
				</div>

				<div class="flex-col-c-m size2 how-countdown">
					<span class="l1-txt3 p-b-9 hours"><?php echo $ipoctets[1]; ?></span>
				</div>

				<div class="flex-col-c-m size2 how-countdown">
					<span class="l1-txt3 p-b-9 minutes"><?php echo $ipoctets[2]; ?></span>
				</div>

				<div class="flex-col-c-m size2 how-countdown">
					<span class="l1-txt3 p-b-9 seconds"><?php echo $ipoctets[3]; ?></span>
				</div>
			</div>
		</div>

		<button class="flex-c-m s1-txt2 size3 how-btn"  data-toggle="modal" data-target="#subscribe">
			Setup WIFI Connection
		</button>

		<span class="s1-txt3 txt-center">
			Contact support for assistance
		</span>
		
	</div>

	<!-- Modal Login -->
	<div class="modal fade" id="subscribe" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="modal-dialog" role="document" data-dismiss="modal">
			<div class="modal-subscribe where1-parent bg0 bor2 size4 p-t-54 p-b-100 p-l-15 p-r-15">
				<button class="btn-close-modal how-btn2 fs-26 where1 trans-04">
					<i class="zmdi zmdi-close"></i>
				</button>

				<div class="wsize1 m-lr-auto">
					<h3 class="m1-txt1 txt-center p-b-36">
						<span class="bor1 p-b-6">Enter Your Wifi Details</span>
					</h3>


					<form class="contact100-form validate-form">
						<div class="wrap-input100 m-b-10 validate-input" data-validate = "SSID is required">
							<select class="form-control form-control-lg s1-txt4 placeholder0 input100" style="border:0; outline:0; height: 46px; padding: 0 25px;" name="SSID" placeholder="SSID" id="wifiscan">
							<option value="selectItem">Looking for wireless networks...</option>
							</select>
							<span class="focus-input100"></span>
						</div>

						<div class="wrap-input100 m-b-20 validate-input" data-validate = "Passphrase">
							<input class="s1-txt4 placeholder0 input100" type="password" name="passphrase" placeholder="Passphrase">
							<span class="focus-input100"></span>
						</div>

						<div class="w-full">
							<button class="flex-c-m s1-txt2 size5 how-btn1 trans-04">
								Connect
							</button>
						</div>
					</form>

					<p class="s1-txt5 txt-center wsize2 m-lr-auto p-t-20">
						<span id="wifistatus"></span>
					</p>
				</div>
			</div>

		</div>
	</div>
	<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
	<script src="vendor/bootstrap/js/popper.js"></script>
	<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
	<script src="vendor/select2/select2.min.js"></script>
	<script src="js/main.js"></script>
        <?php if (isset($isConnecting)) { ?><script>$.get( "reboot_me.php?key=973ehbn93e7hb", function( data ) { console.log('Reboot requested!'); });</script><?php } ?>
</body>
</html>
