case "pinjam":
echo '
<form action="simpan_pinjam.php" method="post" enctype="multipart/form-data" name="tambah">
<table width="452" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="red">
<tr>
<td height="40" align="center" bgcolor="black"><strong><font color="white">Meminjam Buku</font></strong></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><table width="452" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td>Tanggal</td>
<td>:</td>
<td> <select name="tgl">
<?php
for($angka=1; $angka<=31; $angka++){
echo "<option value=$angka>$angka</option>";
}
?>
</select> - <select name="bln">
<?php
for($angka_bln=1; $angka_bln<=12; $angka_bln++){
echo "<option value=$angka_bln>$angka_bln</option>";
}
?>
</select> - <select name="thn">
<?php
for($angka_tahun=2000; $angka_tahun<=2020; $angka_tahun++){
echo "<option value=$angka_tahun>$angka_tahun</option>";
}
?>
</select></td>
</tr>
<tr>
<td>No Id</td>
<td>:</td>
<td> <select name="no_id">
<?php
$sql="SELECT * FROM anggota";
$hasil_query=mysql_query($sql);
while($baris=mysql_fetch_object($hasil_query))
{
echo "<option value=$baris->no_id>$baris->no_id</option>";
}
?>
</select></td>
</tr>
<tr>
<td>Kode Buku</td>
<td>:</td>
<td> <select name="kode_buku">
<?php
$sql="SELECT * FROM buku";
$hasil_query=mysql_query($sql);
while($baris=mysql_fetch_object($hasil_query))
{
echo "<option value=$baris->kode_buku>$baris->kode_buku</option>";
}
?>
</select></td>
</tr>
<tr><td colspan="3" align="center"><input name="Pinjam" type="submit" id="Pinjam" value="Pinjam">
</tr>
</table></td>
</tr>
</table>
</form>
';
break;
<?php
// kode sebelumnya.......
case "pinjam":
?>
<form action="simpan_pinjam.php" method="post" enctype="multipart/form-data" name="tambah">
<table width="452" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="red">
<tr>
<td height="40" align="center" bgcolor="black"><strong><font color="white">Meminjam Buku</font></strong></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><table width="452" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td>Tanggal</td>
<td>:</td>
<td> <select name="tgl">
<?php
for($angka=1; $angka<=31; $angka++){
echo "<option value=$angka>$angka</option>";
}
?>
</select> - <select name="bln">
<?php
for($angka_bln=1; $angka_bln<=12; $angka_bln++){
echo "<option value=$angka_bln>$angka_bln</option>";
}
?>
</select> - <select name="thn">
<?php
for($angka_tahun=2000; $angka_tahun<=2020; $angka_tahun++){
echo "<option value=$angka_tahun>$angka_tahun</option>";
}
?>
</select></td>
</tr>
<tr>
<td>No Id</td>
<td>:</td>
<td> <select name="no_id">
<?php
$sql="SELECT * FROM anggota";
$hasil_query=mysql_query($sql);
while($baris=mysql_fetch_object($hasil_query))
{
echo "<option value=$baris->no_id>$baris->no_id</option>";
}
?>
</select></td>
</tr>
<tr>
<td>Kode Buku</td>
<td>:</td>
<td> <select name="kode_buku">
<?php
$sql="SELECT * FROM buku";
$hasil_query=mysql_query($sql);
while($baris=mysql_fetch_object($hasil_query))
{
echo "<option value=$baris->kode_buku>$baris->kode_buku</option>";
}
?>
</select></td>
</tr>
<tr><td colspan="3" align="center"><input name="Pinjam" type="submit" id="Pinjam" value="Pinjam">
</tr>
</table></td>
</tr>
</table>
</form>
<?php
break;
//kode selanjutnya.......