Tìm hiểu PHP sprintf() Function (ok)
<style type="text/css" media="screen">
.board {
position: relative;
width: 80%;
margin: 0 auto;
}
.screen {
text-align: center;
padding: 10px 0;
color: #fff;
font-size: 1.2em;
background: #F75959;
font-weight: bold;
border-radius: 10px;
margin: 10px 0;
}
.chairs {
position: absolute;
}
.chairs div {
padding: 10px 0;
font-weight: bold;
}
table.seats {
width: 40%;
margin: 0 auto;
border-spacing: 2px;
border-collapse: separate;
}
table.seats td {
padding: 9px;
background: #058576;
border-top-right-radius: 10px;
border-top-left-radius: 10px;
color: #fff;
font-size: 15px;
font-weight: bold;
cursor: pointer;
}
table.seats td.empty {
background: none;
cursor: none;
}
</style>
<?php
$rows = array('A','B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K');
?>
<div class="board">
<div class="screen">Màn hình</div>
<div class="chairs">
<?php
foreach ($rows as $row) {
echo sprintf("<div>%s</div>",$row);
}
?>
</div>
<table class="seats">
<tbody>
<?php
foreach ($rows as $row) {
?>
<tr>
<?php
for ($i = 1; $i < 17; $i++) {
$dataseat=sprintf("%s_%02d",$row,$i);
echo sprintf("<td dataseat='%s'>%02d</td>",$dataseat,$i);
if($i == 8) {
echo '<td class="empty"> </td><td class="empty"> </td><td class="empty"> </td><td class="empty"> </td>';
}
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
</div>

PreviousĐưa con trỏ đến vị trí đầu tiên và sau đó lai fetch tiếp trong mysql (ok)NextSymfony là gì? Hướng dẫn cách cài đặt và cấu hình Symfony dễ dàng
Last updated