Something wrong with my show table


#1
<?php include('server.php') ?> <?php if (!isset($_SESSION['username'])) { $_SESSION['msg'] = "You must log in first"; header('location: login.php'); } if (isset($_GET['logout'])) { session_destroy(); unset($_SESSION['username']); header('location: login.php'); } ?> Data One Services
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="images/icons/logodataone.png"/>
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="fonts/themify/themify-icons.css">
<link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css">
<link rel="stylesheet" type="text/css" href="fonts/elegant-font/html-css/style.css">
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
<link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css">
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<link rel="stylesheet" type="text/css" href="vendor/daterangepicker/daterangepicker.css">
<link rel="stylesheet" type="text/css" href="vendor/slick/slick.css">
<link rel="stylesheet" type="text/css" href="vendor/lightbox2/css/lightbox.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" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script href="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="js/tablefilter.js"></script>
.box{ color: black; padding: 20px; display: none; margin-top: 20px; } select{ width: 50%; padding: 10px 15px; border: 1px solid #007bff; border-radius: 4px; color:#fff; background-color: #007bff; font-size:15px; } .myButton { background-color:#ff6666; -moz-border-radius:28px; -webkit-border-radius:28px; border-radius:28px; border:1px solid black; display:inline-block; cursor:pointer; font-family:Arial; font-size:28px; padding:12px 30px; text-decoration:none; text-shadow:0px 0px 0px #2f6627; } .myButton:hover { background-color:red; } .myButton:active { position:relative; top:1px; }
<!-- Header -->
<header class="header1">
	<!-- Header desktop -->
	<div class="container-menu-header">
		<div class="topbar">
			<div class="topbar-social">
			<!-- notification message -->
			<?php if (isset($_SESSION['success'])) : ?>
				<div class="error success" >
					<h3>
						<?php 
							echo $_SESSION['success']; 
							unset($_SESSION['success']);
						?>
					</h3>
				</div>
			<?php endif ?>
			</div>

			<span class="topbar-child1">
				SLA MONITORING
			</span>
		
			<div class="topbar-child2">
				<span class="topbar-email">
					<?php  if (isset($_SESSION['username'])) : ?>
						<p>Welcome <strong><?php echo $_SESSION['username']; ?></strong></p>
					<?php endif ?>
				</span>
			</div>
		</div>

		<div class="wrap_header">
			<!-- Logo -->
			<a href="index.html" class="logo">
				<img src="images/icons/dataone.png" alt="IMG-LOGO">
			</a>

			<!-- Menu -->
			<div class="wrap_menu">
				<nav class="menu">
					<ul class="main_menu">
						<li>
							<a href="dashboard.php">Dashboard</a>
						</li>

						<li>
							<a href="index.php">All</a>
						</li>
						
						<li>
							<a href="summary.php">Summary</a>
						</li>
						
						<li>
							<a href="report.php">Report</a>
						</li>
						
						<li>
							<a href="config.php">Config</a>
							<ul class="sub_menu">
								<li><a href="addconfig.php">Add Client</a></li>
								<li><a href="config.php">Delete Client</a></li>
								<li><a href="config.php">Update Client</a></li>
							</ul>
						</li>
						
						<li>
							<a href="input.php">Input</a>
						</li>

					</ul>
				</nav>
			</div>

			<!-- Header Icon -->
			<div class="header-icons">
				<div class="myButton">
					<a href="index.php?logout='1'" class="header-wrapicon1 dis-block" style="text-decoration:none;">
						<img src="images/icons/logout.png" class="header-icon1" alt="ICON"> <font color="white" style="font-family:forte;">Logout </font>
					</a>
				</div>
			</div>
		</div>
	</div>

	<!-- Header Mobile -->
	<div class="wrap_header_mobile">
		<!-- Logo moblie -->
		<a href="index.html" class="logo-mobile">
			<img src="images/icons/dataone.png" alt="IMG-LOGO">
		</a>

		<!-- Button show menu -->
		<div class="btn-show-menu">
			<!-- Header Icon mobile -->
			<div class="header-icons-mobile">
				<a href="index.php?logout='1'" style="color: red; text-decoration:none;" class="header-wrapicon1 dis-block">
					<img src="images/icons/logout.png" title="login" class="header-icon1" alt="ICON">
				</a>
			</div>

			<div class="btn-show-menu-mobile hamburger hamburger--squeeze">
				<span class="hamburger-box">
					<span class="hamburger-inner"></span>
				</span>
			</div>
		</div>
	</div>

	<!-- Menu Mobile -->
	<div class="wrap-side-menu" >
		<nav class="side-menu">
			<ul class="main-menu">
				<li class="item-topbar-mobile p-l-20 p-t-8 p-b-8">
					<div class="topbar-child2-mobile">
						<span class="topbar-email">
						<?php  if (isset($_SESSION['username'])) : ?>
							<p>Welcome <strong><?php echo $_SESSION['username']; ?></strong></p>
						<?php endif ?>
						</span>
					</div>
				</li>

				<li class="item-topbar-mobile p-l-10">
					<div class="topbar-social-mobile">
						<?php if (isset($_SESSION['success'])) : ?>
							<div class="error success" >
								<h3>
									<?php 
										echo $_SESSION['success']; 
										unset($_SESSION['success']);
									?>
								</h3>
							</div>
						<?php endif ?>
					</div>
				</li>
				
				<li class="item-menu-mobile">
					<a href="dashboard.php">Dashboard</a>
				</li>
				
				<li class="item-menu-mobile">
					<a href="index.php">All</a>
				</li>
				
				<li class="item-menu-mobile">
					<a href="summary.php">Summary</a>
				</li>
					
				<li class="item-menu-mobile">
					<a href="report.php">Report</a>
				</li>
				
				<li class="item-menu-mobile">
					<a href="config.php">Config</a>
					<ul class="sub-menu">
						<li><a href="addconfig.php">Add Client</a></li>
						<li><a href="config.php">Delete Client</a></li>
						<li><a href="config.php">Update Client</a></li>
					</ul>
					<i class="arrow-main-menu fa fa-angle-right" aria-hidden="true"></i>
				</li>
				
				<li class="item-menu-mobile">
					<a href="input.php">Input</a>
				</li>
			</ul>
		</nav>
	</div>
</header>
<br>
<br>
<?php $query="SHOW TABLES WHERE `Tables_in_sla` NOT LIKE 'users%';"; $result = mysqli_query($db, $query); while($table = mysqli_fetch_array($result)) {
			echo("<option value='".$table[0]."'>".$table[0]."</option>");   

		}
	?>
	</select>
</div>
<?php $result = mysqli_query($db, $query); while($table = mysqli_fetch_array($result)) { echo("
"); ?> $(document).ready(function() {
			<?php echo ("$('table[name=".$table[0]."-table]').tableFilter({ ")?>
			<?php echo ("input : 'input[id=".$table[0]."]',")?>
					
					trigger : {
					
						event 	: "keyup",
						//element : "button[name=btn-filtro]"
					},

					//timeout: 80,

					sort : true,

					//caseSensitive : false, Default

					callback : function() { /* Callback após o filtro */

					},
					
				<?php echo("notFoundElement :'#".$table[0]."-not-found'")?>
				});

				
			});


	</script>
		
		<div class="container" style="margin-top:0px">
		<?php
			$querys = "SELECT * FROM $table[0]";
			$results = mysqli_query($db, $querys);
		?>
		
		<div class="page-header text-center">
			<h3>SLA MONITORING</h3>
		</div>
	
		<div class="row">
			<div class="col-md-10">
				<?php echo("<input type='search' class='form-control' id='".$table[0]."' placeholder='Filter'>");?>
			</div>
			
			<div class="col-md-2">
				<?php echo("<button type='button' class='btn btn-primary btn-block' name='btn-filtro-".$table[0]."'>Search</button>");?>
			</div>
		</div>
		
		<hr>
		
		<div class="row">
		
			<div class="col-md-12">

				<?php echo("<div class='not-found' id='".$table[0]."-not-found' style='display: none;'>No Result Found</div>");?>

				<?php echo("<table name='".$table[0]."-table' class='table table-bordered table-striped'>");?>

					<thead>
						<tr>
							<th data-tsort-type="number">No.</th>
							<th data-tsort-type="number">Job No.</th>
							<th data-tsort-type="text">Job File Name</th>
							<th data-tsort-type="number">Total Account</th>
							<th data-tsort-type="number">Total Sheet</th>
							<th data-tsort-type="number">Total Impression</th>
							<th data-tsort-type="number">Notification Received</th>
							<th data-tsort-type="number">Client Confirmation</th>
							<th data-tsort-type="number">SLA Target</th>
							<td><b>Update / Delete</b></td>
						</tr>
					</thead>
					
					<tbody>
					<?php
						
						$i=1;
						$j=1;
						$k=1;
						if (mysqli_num_rows($results) > 0) {
						// output data of each row
							while($row = $results->fetch_assoc()) {
					?>
						
						<tr>
							<td><?php echo $k++; ?></td>
							<td><?php echo $row["JOB_NO"];?></td>
							<td><?php echo $row["JOB_FILE_NAME"];?></td>
							<td><?php echo $row["TOTAL_ACCOUNT"];?></td>
							<td><?php echo $row["TOTAL_SHEET"];?></td>
							<td><?php echo $row["TOTAL_IMPRESSION"];?></td>
							<td>
								<?php 
									$notification_received = date_create($row["NOTIFICATION_RECEIVED"]);
									echo date_format($notification_received,'d-m-Y');
								?>
								<br>
								<?php 
									$notification_received_t = date_create($row["NOTIFICATION_RECEIVED_T"]);
									echo date_format($notification_received_t,'H:i A');
								?>
							</td>
							<td>
								<?php 
									$client_confirmation = date_create($row["CLIENT_CONFIRMATION"]);
									echo date_format($client_confirmation,'d-m-Y ');
								?>
								<br>
								<?php 
									$client_confirmation_t = date_create($row["CLIENT_CONFIRMATION_T"]);
									echo date_format($client_confirmation_t,'H:i A ');
								?>
							</td>
							
							<td class="poster<?php echo $i++;?>">
								<?php 
									$sla_target = date_create($row["SLA_TARGET"]);
									echo date_format($sla_target,'d-m-Y');
								?>
								
								<br>
								<?php 
									$sla_target_t = date_create($row["SLA_TARGET_T"]);
									echo date_format($sla_target_t,'H:i A ');
								?>
								<style>
									.poster<?php echo $j++;?>{
										color:black;
										background-color:
										<?php
											
											$mydate = $row["SLA_TARGET"];
											$curdate = date('Y-m-d');
											
											
											if($curdate == $mydate)
											{
												echo 'yellow';
											}
											
											else if($curdate > $mydate)
											{
												echo 'red';
											}
											else if($curdate < $mydate)
											{
												echo 'green';
											}
										?>
									
										}
								</style>
								<br>
								<font color="white">
								<?php echo $curdate;?></font>
							</td>
						
							<td>
								<center>
								
								<?php echo("<a href='updateform.php?id=".$row['ID']."&&tb=".$table[0]."' style='text-decoration:none;'> ")?>
									<i class="fa fa-pencil" style="font-size:20px;"></i>
								</a>
								/
								<?php echo("<a href='delete.php?id=".$row['ID']."&&tb=".$table[0]."' style='text-decoration:none;'> ")?>
									<i class="fa fa-trash" style="font-size:20px;"></i>
								</a>
								</center>
							</td>
							
						</tr>
							
					<?php
							}
							} else {
								echo "0 results";
							}	
						
					?>
					</tbody>
						
				</table>
							
			</div>
		
		</div>
	</div>
							
		
	<?php echo("</div>");}?>

<footer class="bg6 p-t-45 p-b-43 p-l-45 p-r-45">
	<div class="t-center p-l-15 p-r-15">
		<div class="t-center s-text8 p-t-20">
			Copyright © 2018 All rights reserved. | This template is made with <i class="fa fa-heart-o" aria-hidden="true"></i> by <a href="https://colorlib.com" target="_blank">Colorlib</a>
		</div>
	</div>
</footer>



<!-- Back to top -->
<div class="btn-back-to-top bg0-hov" id="myBtn">
	<span class="symbol-btn-back-to-top">
		<i class="fa fa-angle-double-up" aria-hidden="true"></i>
	</span>
</div>

<!-- Container Selection1 -->
<div id="dropDownSelect1"></div>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("select").change(function(){
		$(this).find("option:selected").each(function(){
			var optionValue = $(this).attr("value");
			if(optionValue){
				$(".box").not("." + optionValue).hide();
				$("." + optionValue).show();
			} else{
				$(".box").hide();
			}
		});
	}).change();
});
</script>
<script type="text/javascript" src="vendor/jquery/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="vendor/animsition/js/animsition.min.js"></script>
<script type="text/javascript" src="vendor/bootstrap/js/popper.js"></script>
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="vendor/select2/select2.min.js"></script>
<script type="text/javascript" src="vendor/slick/slick.min.js"></script>
<script type="text/javascript" src="js/slick-custom.js"></script>
<script type="text/javascript" src="vendor/countdowntime/countdowntime.js"></script>
<script type="text/javascript" src="vendor/lightbox2/js/lightbox.min.js"></script>
<script type="text/javascript" src="vendor/sweetalert/sweetalert.min.js"></script>
<script src="js/main.js"></script>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="js/tablefilter.js"></script>

#2

How about telling us what the problem is. We are not mind readers.

If your going to post on forums I would highly recommend you read this page first.