<?php
include_once("connection.php"); 
if (!empty($_POST['sid'])) {

$sid = $_POST['sid'];
$queryls1q = "select * from doctor_master where doctor_id='$sid'";
$resultls1q  = mysqli_query($conn,$queryls1q);	
while($row=mysqli_fetch_array($resultls1q))
{
$doctor_name =  $row['doctor_name'];

}
 
?>

<label>Appointment Schedule <?php echo $doctor_name?></label><br />
<table border = "1" cellpadding="0" cellspacing="0" style="border-collapse:collapse;" width="100%">
<thead>
<tr>
<th><div align="left" style="padding:3px; font-size:12px;">Sr.No.</div></th>
<th><div align="left" style="padding:3px; font-size:12px;">Appointment Date & Time</div></th>
<th><div align="left" style="padding:3px; font-size:12px;">Doctor Name</div></th>
<th><div align="left" style="padding:3px; font-size:12px;">Patient Name</div></th>
</tr>
</thead>
<?php 
$i=1;
$queryls1 = "select * from appointment_details where appointment_date='$sid'";
$resultls1  = mysqli_query($conn,$queryls1);	
while($row=mysqli_fetch_array($resultls1))
{
$appointment_date = $row['appointment_date'];
$appointment_time = $row['appointment_time'];
$doctor_name = $row['doctor_name'];

$patient_name =  $row['patient_name'];
?>
<tr>
<td><div align="left" style="padding:3px; font-size:12px; color:#000000"><?php echo $i; $i++;?></div></td>
<td><div align="left" style="padding:3px; font-size:12px; color:#000000"><?php echo $appointment_date;?><br /><?php echo $appointment_time;?></div></td>
<td><div align="left" style="padding:3px; font-size:12px; color:#000000"><?php echo $doctor_name;?></div></td>
<td><div align="left" style="padding:3px; font-size:12px; color:#000000"><?php echo $patient_name;?></div></td>
</tr>
<?php  }?>
</table>
<?php
} 

?>
