<?php
  include 'header.php';
  
  if (isset($_GET['num'])) {
	$tnumbs = $_GET['num'];
	$select = mysqli_query($link, "SELECT * FROM track_update WHERE track_num = '$tnumbs' ORDER BY id DESC ");
	if (mysqli_num_rows($select) > 0) {

	}else{
		echo "<script>alert('It has not been updated yet');window.location.href = 'dashboard.php'; </script>";
	}
}else{
	echo "<script>window.location.href = 'dashboard.php'; </script>";
}
?>

			
		<!-- BEGIN mobile-sidebar-backdrop -->
		<button class="app-sidebar-mobile-backdrop" data-toggle-target=".app" data-toggle-class="app-sidebar-mobile-toggled"></button>
		<!-- END mobile-sidebar-backdrop -->
		
		<!-- BEGIN #content -->
		<div id="content" class="app-content">
			<!-- BEGIN container -->
			<div class="container">
				<!-- BEGIN row -->
				<div class="row justify-content-center">
					<!-- BEGIN col-10 -->
					<div class="col-xl-10">
						<!-- BEGIN row -->
						<div class="row">
							<!-- BEGIN col-9 -->
							<div class="col-xl-9">
							
								
							
								<hr class="mb-4">
								
								<!-- BEGIN #formControls -->
								<div id="formControls" class="mb-5">
									<h4>TRACKERS</h4>
									
							        <div class="card">
            <div class="card-body">
                
        
   <div class="tabel-main">
                  <table id="expendable-data-table" class="table display nowrap">
                    <thead>
                    <tr>
                           <th>#</th>
                          <th>Location</th>
                          <th>Status</th>
                          <th>Date</th>
                          <th>Time</th>
                          <th>Note</th>
                          <th>Updated At</th>
                        </tr>
                    </thead>

                    <tbody>
                        
                        <?php 
                        $i = 0;
                        	
                        	while ($row = mysqli_fetch_assoc($select)) {
                        			$i++
                         ?>

                         	
                         <tr>
                         	<td><?php echo $i; ?></td>
                         	
                          <td><b><?php echo $row['current_location'] ?></b></td>
                         	<td><b><?php echo $row['status'] ?></b></td>
                         	<td><b><?php echo $row['date'] ?></b></td>
                         	<td><b><?php echo $row['time'] ?></b></td>
                         	<td><b><?php echo $row['note'] ?></b></td>
                         	<td><b><?php echo $row['updated_at'] ?></b></td>
                         	

                            
                     <?php } ?>

                      </tbody>
                  </table>

                </div>
        
        </div>
            </div>
        </div>
								</div>
								<!-- END #formControls -->
								
							
								
							
								
								
					
							</div>
							<!-- END col-9-->
							
							
						</div>
						<!-- END row -->
					</div>
					<!-- END col-10 -->
				</div>
				<!-- END row -->
			</div>
			<!-- END container -->
		</div>
		<!-- END #content -->
		
	<?php include 'footer.php'; ?>