Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //...
- switch($_GET[act]){
- // Tampil jadwal_dokter
- default:
- ?>
- <h2>Data Jadwal Dokter</h2>
- <input type=button value='Tambah Jadwal Dokter'
- onclick="window.location.href='?menu=jadwal_dokter&act=tambahjadwaldokter';">
- <table>
- <tr>
- <th></th>
- <th>Senin</th>
- <th>Selasa</th>
- <th>Rabu</th>
- <th>Kamis</th>
- <th>Jumat</th>
- <th>Sabtu</th>
- <th>Minggu</th>
- </tr>
- <?php
- $sql="
- SELECT
- waktu,
- IF(hari='SENIN',id_dokter,NULL) AS senin,
- IF(hari='SELASA',id_dokter,NULL) AS selasa,
- IF(hari='RABU',id_dokter,NULL) AS rabu,
- IF(hari='KAMIS',id_dokter,NULL) AS kamis,
- IF(hari='JUMAT',id_dokter,NULL) AS jumat,
- IF(hari='SABTU',id_dokter,NULL) AS sabtu,
- IF(hari='MINGGU',id_dokter,NULL) AS minggu
- FROM jadwal_dokter
- GROUP BY waktu";
- if($tampil=mysql_query($sql)){
- if(mysql_num_rows($tampil)>0){
- while($row=mysql_fetch_object($tampil)){
- echo "
- <tr>
- <td>".$row->waktu."</td>
- <td>".(!empty($row->senin)?$row->senin:' ')."</td>
- <td>".(!empty($row->selasa)?$row->selasa:' ')."</td>
- <td>".(!empty($row->rabu)?$row->rabu:' ')."</td>
- <td>".(!empty($row->kamis)?$row->kamis:' ')."</td>
- <td>".(!empty($row->jumat)?$row->jumat:' ')."</td>
- <td>".(!$empty($row->sabtu)?$row->sabtu:' ')."</td>
- <td>".(!$empty($row->minggu)?$row->minggu:' ')."</td>
- </tr>"
- }
- }
- }
- echo "</table>\n";
- break;
- //...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement