<?php

include "conn.php";
if (isset($_POST['search'])) {
	$search = $_POST['search'];
	
	$query=mysqli_query($conn,"select s.cdestination, s.cons, s.status, t.cdestination, t.cons, t.status  from sec s, third t
	where  s.cons like '%$search%' or t.cons like '%$search%'");

	if(mysqli_num_rows($query)==0){
		echo '<div class="panel panel-default" style="width:235px;">';
		?>
		<span style="margin-left:13px;">No results found</span>
		<?php
		'</div>';
	}
	else{
		echo '<div class="panel panel-default" style="width:235px;">';
		while ($row = mysqli_fetch_array($query)) {
		?>
			
			<span>
			<a href="user.php?id=<?php echo $row['userid']; ?>" 
			style="text-decoration:none; color:black; margin-left:13px;">
			    <?php echo $row['s.cdestination']; ?> <?php echo $row['s.cons']; ?></a>
			</span><br>
			
		<?php
		}
		'</div>';
	}
}
 
?>
 
