<?php 
session_start();
require_once '../includes/conn.php'; 
?>
<head> 
<title>Training Institute Manager</title>  
<link rel="stylesheet" href="css/table_data_center_with_border_black.css">
<link rel="icon" type="image/x-icon" href="../includes/dim.png"> 
</head>

<body>
    <div class="container-fluid">
<br>

						
			 <center>  <?php 
				  				   $pq=mysqli_query($con,"select * from stuff left join `user` on user.userid=stuff.userid where stuff.userid='".$_SESSION['id']."'");
				   while($pqrow=mysqli_fetch_array($pq)){
				?>
			<span style="font-size:21;font-weight:bold;">
			 <?php echo $pqrow['business_name']; ?>   
			 </span>	
			<?php }?>
			
			</b>
	<br> <span style="font-size:19;">
	Teachers List<br>
	
			 
			 Print Date : <?php echo date("M d, Y") ;?> |  Time   : <?php date_default_timezone_set("Asia/Dhaka"); echo  date("h:i:sa");?>
</span>
<br>
<br>
								</center>

                   <?php  

	$sql = "SELECT * FROM teacher
								left join product on product.product_id = teacher.subject
								where teacher.status=1 ORDER BY teacher.teacher_id asc   ";
	$query = $con->query($sql);
	$countProduct = $query->num_rows;
    
	$table = '
	  <table width="100%" class="table table-bordered">
		
		<tr>    
							<th>SL</th>   
							<th>Id</th>
                                <th>Name</th>
                                <th>Course</th> 
								<th>Phone</th>
								<th>Join Date</th>
							
		</tr>

		<tr>';
		$sl=0;
		 
		while ($result = $query->fetch_assoc()) {
			
			$table .= '<tr>									
									<td><center>'.++$sl.'</center></td> 
									<td><center>'.$result['teacher_id'].' </center></td>
									<td><center>'.$result['teacher_name'].' </center></td>
									<td><center>'.$result['product_name'].' </center></td> 
									<td><center>'.$result['contact_info'].'</center></td>  
									<td><center>'.date("d-M-Y", strtotime($result['join_date'])).'</center></td> 				
			</tr>';	
			
			 
			
		}
		$table .= '
		</tr>
		 
		
	</table>
	';	

	echo $table;



?>	
				
	
</body>
</html>