You are on page 1of 1

1 <?

php
2 include('koneksi.php');
3 echo 'Tampilan Keseluruhan Data Tabel Alat
4 <table width="100%" border="1">
5 <tr>
6 <th>Nomer</th>
7 <th>Kode Alat</th>
8 <th>Nama Alat</th>
9 <th>Merek</th>
10 <th>Model</th>
11 <th>Tgl Beli</th>
12 <th>Status</th>
13 <th>Id Ruang</th>
14 <th>Nama Ruang</th>
15 </tr>';
16 $nomer=0;
17 $query = mysql_query("SELECT kode_alat, jenis.nama
,merek,model,tgl_beli,status,
id_ruang,nama_ruang FROM alat,jenis,ruang where (substring(kode_alat,1,2)=kd
and substring(kode_alat,3,2)=kode) and id_ruang=ruang.id ORDER BY kode_alat");
18 while ($hasil=mysql_fetch_array($query)) {
19 $nomer++; 20 $kode_alat = $hasil['kode_alat']; 21
$nama_alat = $hasil[1]; 22 $merek = $hasil['merek']; 23
$model = $hasil[3]; 24 $tgl_beli = $hasil[4]; 25
$status = $hasil[5]; 26 $id_ruang = $hasil[6]; 27
$nama_ruang = $hasil['nama_ruang']; 28 $tgl_beli = explode("-",
$tgl_beli); 29 $tgl_beli = $tgl_beli[2]."-".$tgl_beli[1]."-
".$tgl_beli[0]; 30
31 echo "<tr>
32 <td class='kotak_nomor'>$nomer</td>
33 <td>$kode_alat</td>
34 <td>$nama_alat</td>
35 <td>$model</td>
36 <td>$merek</td>
37 <td>$tgl_beli</td>
38 <td>$status</td>
39 <td>$id_ruang</td>
40 <td>$nama_ruang</td>
41 </tr>";
42 }
43 echo '</table>';
44 ?>

You might also like