SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | include "/class/pdoclass.php"; | |
| 3 | ||
| 4 | $db = new crud(); | |
| 5 | ||
| 6 | $tabel = "tblsiswa"; | |
| 7 | $fild = "*"; | |
| 8 | $db->select($tabel,$fild); | |
| 9 | $hasil = $db->getResult(); | |
| 10 | ||
| 11 | - | echo $hasil; |
| 11 | + | //echo $hasil; |
| 12 | ?> | |
| 13 | <html> | |
| 14 | <head> | |
| 15 | ||
| 16 | <title></title> | |
| 17 | <link type="text/css" rel="stylesheet" href="css/bootstrap.css" /> | |
| 18 | </head> | |
| 19 | <body> | |
| 20 | <form id="FormDtSiswa" name="FormDtSiswa" method="post"> | |
| 21 | - | <table class="table table-hover"> |
| 21 | + | <table class="table table-hover"><thead> |
| 22 | <tr> | |
| 23 | <td>No</td> | |
| 24 | <td>NISN</td> | |
| 25 | <td>Nama</td> | |
| 26 | <td>Asal Sekolah</td> | |
| 27 | <td>Nilai Ujian Nasional</td> | |
| 28 | <td>Nilai Ujian Sekolah</td> | |
| 29 | <td>Nama Ayah</td> | |
| 30 | <td>Nama Ibu</td> | |
| 31 | - | </tr> |
| 31 | + | </tr></thead> |
| 32 | <tbody> | |
| 33 | - | <td></td> |
| 33 | + | <?php |
| 34 | - | </tr> |
| 34 | + | $data=json_decode($hasil, TRUE);//jadikan array dahulu |
| 35 | $s='';$no=1; | |
| 36 | foreach($data['post'] as $row){
| |
| 37 | $s.="<tr>"; | |
| 38 | $s.="<td>".$no++."</td>"; | |
| 39 | $s.="<td>{$row['Nisn']}</td><td>{$row['Nama']}</td>"; //sisanya lanjutkan sendiri
| |
| 40 | $s.="</tr>"; | |
| 41 | } | |
| 42 | print $s;$s=''; | |
| 43 | ?> </tbody> | |
| 44 | </table> | |
| 45 | </form> | |
| 46 | </body> | |
| 47 | </html> |