<?php
$koneksi = mysql_connect("localhost", "root",
"") or die("Gagal koneksi ke server.");
mysql_select_db("rental") or die("Gagal membuka
database.");
?>
<html>
<head>
</head>
<body>
<table width="1024" border="1"
align="center">
<tr>
<td><table width="100%"
border="0">
<tr>
<td
align="center"><h3>Selamat Datang</h3></td>
</tr>
</table></td>
</tr>
<tr>
<td><div
align="center">
<p><a
href="tambah_mobil.php"><strong>Tambah
Data</strong></a> </p>
<table width="800"
border="1" align="center">
<tr>
<td
width="104"
align="center"><h4>No.</h4></td>
<td width="104"
align="center"><h4>Id Mobil</h4></td>
<td width="168" align="center"><h4>Jenis
Mobil</h4></td>
<td width="112"
align="center"><h4>No Polisi</h4></td>
<td width="108"
align="center"><h4>Tarif Sewa</h4></td>
<td width="100"
align="center"><h4>Keterangan</h4></td>
<td width="95"
align="center"><h4>Action</h4></td>
</tr>
<?php
$query = "select * from mobil";
$hasil = mysql_query($query, $koneksi) or die("Gagal
melakukan query.");
$no=1;
while ($buff = mysql_fetch_array($hasil)) {
?>
<tr align=center>
<td
height="26"><?php echo $no; ?></td>
<td height="26"><?php echo
$buff['id_mobil']; ?></td>
<td><?php echo $buff['jenis_mobil'];
?></td>
<td><?php echo $buff['no_polisi'];
?></td>
<td><?php echo $buff['tarif_sewa'];
?></td>
<td><?php echo
$buff['keterangan'];?></td>
<td align="center">
<a href="edit_mobil.php?id_mobil=<?php
echo $buff['id_mobil']; ?>">Edit</a>
<a
href="hapus_mobil.php?id_mobil=<?php echo $buff['id_mobil'];
?>">Hapus</a></td>
</tr>
<?php
$no++;
};
mysql_close($koneksi);
?>
<p> </p>
</div></td>
</tr>
</table></td>
</tr>
</table>
</table>
<form id="form1" name="form1"
method="post" action="admin.php">
<input type="submit" name="button"
id="button" value="Back" />
</form>
</body>
</html>