 |
|
ตอบความคิดเห็นที่ : 1 เขียนโดย : iieszz เมื่อวันที่ 2013-06-20 19:55:06
รายละเอียดของการตอบ ::
ผมอยากจะทำตารางแสดง ตามรูแบบธรรมดาอ่าครับ ไม่ต้องตรวจสอบอะไร
**แต่ทำได้แล้วครับ นั่งคิดตั้งนาน แต่ก็ขอบคุณมากครับ 
Code (PHP)
$userPermission = array(
'About Us' => array('off', 'off', 'on', 'on', 'on'),
'Schedule' => array('off', 'off', 'on', 'on', 'on'),
'Video' => array('off', 'off', 'on', 'on', 'on'),
'Gallery' => array('off', 'off', 'on', 'on', 'on'),
'Community' => array('off', 'on', 'on', 'on', 'on'),
'Class System' => array('off', 'on', 'off', 'on', 'off'),
'Student System' => array('off', 'on', 'off', 'on', 'off'),
'Special Permission' => array('Report', 'off', 'off', 'off', 'User Managemet Sys.')
);
<table class="twelve">
<thead>
<th class="two"> </th>
<th class="two text-center">Manager(CEO)</th>
<th class="two text-center">Operator</th>
<th class="two text-center">Data Entry</th>
<th class="two text-center">Teacher</th>
<th class="two text-center">Admin</th>
</thead>
<tbody>
<?php foreach ($userPermission as $key => $value): ?>
<tr>
<td class="text-right"><?php echo $key; ?></td>
<?php foreach ($userPermission[$key] as $value): ?>
<td class="text-center">
<?php
if ($value == 'on') {
echo "<img src='images/tick.png' title='ON'>";
} else if ($value == 'off') {
echo "<img src='images/cross.png' title='OFF'>";
} else {
echo "<span class='label success'>" . $value . "</span>";
}
?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
|
 |
 |
 |
 |
Date :
2013-06-21 09:18:03 |
By :
Necrotorture |
|
 |
 |
 |
 |
|
|
 |