Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- tr.style15 th {border:solid 1px #000000;background-color:#66CCCC}
- tr.style8 td {border:solid 1px #000000;}
- .center {text-align:center}
- </style>
- <table width="766" border="1" cellspacing="1" cellpadding="1">
- <thead>
- <tr class="style15">
- <th width="25">No</th>
- <th width="50">Hari </th>
- <th>Jam</th>
- <th width="302">Matakuliah</th>
- <th width="30">SKS</th>
- <th width="130">Dosen Pengajar</th>
- <th width="150">Ruang</th>
- </tr>
- </thead>
- <tbody>
- <?php
- include "koneksi.php";
- $sql="SELECT
- COUNT(1) AS jml,
- a.hari,
- GROUP_CONCAT(b.namadosen SEPARATOR '|') AS namadosen,
- GROUP_CONCAT(c.jammengajar SEPARATOR '|') AS jammengajar,
- GROUP_CONCAT(d.namamk SEPARATOR '|') AS namamk,
- GROUP_CONCAT(d.sks SEPARATOR '|') AS sks,
- GROUP_CONCAT(e.namaruang SEPARATOR '|') AS namaruang
- FROM
- tbljadwal a
- JOIN tbldosen b USING(kodedosen)
- JOIN tblwaktu c USING(koderuang)
- JOIN tblmatakuliah d USING(kodemk)
- JOIN tblruang e USING(koderuang)
- WHERE
- a.tingkatsemester = '".$_GET['angka']."'
- GROUP BY
- a.hari";
- $result = mysql_query($sql);
- $records=array();
- $no=0;
- while($r=mysql_fetch_array($result))
- {
- $count=0;
- $jml=$r['jml'];
- $namadosen=explode('|',$r['namadosen']);
- $jammengajar=explode('|',$r['jammengajar']);
- $namamk=explode('|',$r['namamk']);
- $sks=explode('|',$r['sks']);
- $namaruang=explode('|',$r['namaruang']);
- for($i=0;$i<$jml;++$i)
- {
- echo "
- <tr class='style8'>
- <td>".++$no."</td>"
- .(++$count==1?($jml==1?"<td>".$r['hari']."</td>":"<td rowspan='".$jml.">".$r['hari']."</td>"):"")
- ."<td>".$jammengajar[$i]."</td>
- <td>".$namamk[$i]."</td>
- <td class='center'>".$sks[$i]."</td>
- <td class='center'>".$namadosen[$i]."</td>
- <td class='center'>".$namaruangan[$i]."</td>
- </tr>
- ";
- }
- }
- ?>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement