
<?php require'includes/head2.php';
	  require'header.php';
?>

<div class="form" id="form" align="left">
<?php
$current=date('Y-m-d');
require'../connections/conn.php';
$cond="`appointment`.`p_id`=`patient`.`p_id` and `date`<'$current' and `status`=1 ";
if((isset($_POST['p_name']))&&($_POST['p_name']!=""))
{
$p_name=$_POST['p_name'];
$cond.="and `p_name`like'$p_name%'";
}
$p="select * from `appointment`,`patient` where $cond  order by `date`";
$r=$conn->query($p);
echo"<table border=4 width=900px >";?>
	
		<?php
		echo"<tr>
			<th>Name</th><th>Mobile</th><th>Age</th><th>Date</th>
		</tr>";?>
		<form action="" method="POST" enctype="multipart/form-data">
		<tr>
		<td style="text-align:center">
			<input type="text" name="p_name" placeholder="Search By Name" id="tag" >
		</td >
		<td style="text-align:center">
		<input class="button-6" type="submit" name="search" value="Search">
		</td>
		</tr>
	</form><?php
while($row=mysqli_fetch_array($r))
{
	echo"<tr>
			<td>".$row['p_name']."</td><td>".$row['p_mobile']."</td><td style='text-align:center'>".$row['p_age']."</td>
			<td>".$row['date']."</td>";
			/*<td><a href='detail.php?app_id=".$row['app_id']."&&p_id=".$row['p_id']."'>Detail</a></td>
			<td><a href='finish.php?app_id=".$row['app_id']."'>Finish</a></td>";
		*/
		echo"</tr>";
}
echo"</table>";
require 'includes/foot.php';?>

