<?php
	session_start(); 
	include('../conn/connect.php');


	$sql_place = "SELECT * FROM place ORDER BY building,floors";
	$query_place = mysqli_query($conn,$sql_place);


?>
<center>
	<table>
		<tr>
			<th align="center" width="100">
				ตึก
			</th>
			<th align="center" width="100">
				ชั้น
			</th>
			<th align="center" width="200">
				ห้อง
			</th>
			<th align="center" width="350">
				URL
			</th>
			<th align="center" width="150">
				เครื่องมือ
			</th>
		</tr>
<?php
			while ($result_place=mysqli_fetch_array($query_place)) {
?>
					<tr>
						<td align="center">
							<?=$result_place['building']?>
						</td>
						<td align="center">
							<?=$result_place['floors']?>
						</td>
						<td align="center">
							ห้องน้ำ<?php if($result_place['gender']=="f"){ echo"หญิง"; }else if($result_place['gender']=="m"){echo"ชาย";}else{echo"รวม";} ?> <?=$result_place['remark']?>
						</td>
						<td align="left" style="padding: 5px;">
							<a href="<?=$IP_SERVER?>home.php?id=<?=$result_place['ID_place']?>" target="_blank"><?=$IP_SERVER?>home.php?id=<?=$result_place['ID_place']?></a>
						</td>
						<td align="center"><button onclick="javascript:qr_img('<?=$result_place['ID_place']?>');" style="background-color : #FF0000;">QR-code</button>
						</td>

					</tr>
<?php

			}

?>
	</table>
</center>