<?php
$PageTitle = "Track Now";
include("./layout/header.php");

if(isset($_POST['submit'])){

	$tid = $_POST['tid'];




	if($tid == ""){

	echo "<script>alert('Please enter a tracking Number')</script>";

	}else{


		$sql= "SELECT * FROM track WHERE pid = '$tid'";
		$result = mysqli_query($link,$sql);
		if(mysqli_num_rows($result) > 0){
		  $row = mysqli_fetch_assoc($result);

		  $pid = $row['pid'];
		  if(isset($row['pid'])){

			  $pid = $row['pid'];



	if($tid == $pid){



	header("Location:result.php?track=$tid");

	}

	else{

		echo "No record for the track number";
	}

}

}

}
}

?>

		<!-- Start Tracking Number Area -->
		<div class="tracking-number-area fun-blue-bg ptb-100">
			<div class="container">
				<div class="row align-items-center">
					<div class="col-lg-6 col-md-4">
						<div class="tracking-logo">
							<img src="assets/img/logo/<?php echo $page['logo'];?>" alt="Image">
						</div>
					</div>
					<div class="col-lg-6 col-md-8">
						<div class="tracking-body">
							<form class="tracking-wrap" action="track.php" method="POST">
								<input type="text" class="input-tracking" placeholder="Type your tracking number" name="tid">
								
								<button class="default-btn active" type="submit" name="submit">Track Now</button>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- End Tracking Number Area -->

		<!-- Start Address Area -->
		<section class="address-area pt-100 pb-70">
			<div class="container">
				<div class="row">
					<div class="col-lg-4 col-md-6">
						<div class="single-address">
							<i class='bx bx-phone-call'></i>
							<h3>Contact</h3>
							<span><?php echo $page['+1(601)980-1178'];?>+1(601)980-1178</a></span> </br>
							
							<p><?php echo $page['info@unfastlogisticsdelivery.com'];?>info@unfastlogisticsdelivery.com</p>
														
						</div>
					</div>
					<div class="col-lg-4 col-md-6">
						<div class="single-address">
							<i class='bx bx-location-plus'></i>
							<h3>Location</h3>
							<span><strong>Find where we are</strong></span> </br>
							
										<span><?php echo $page['baddress'];?></span> </br>
						</div>
					</div>
					<div class="col-lg-4 col-md-6 offset-md-3 offset-lg-0">
						<div class="single-address">
							<i class='bx bx-time'></i>
							<h3>Meet Us</h3>
							<span>Available Hours to meet</span>
							<p>9:00 AM – 8:00 PM</p>
						</div>
					</div>
				</div>
			</div>
		</section>
		<!-- End Address Area -->

		

		<?php
include("./layout/footer.php");

?>