<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<div class="batas">
<h2>ubah buku</h2>
<?php
include"konek.php";
$id=$_GET['id'];
$r=mysql_query("select *from tbuku where id='$id'");
$a=mysql_fetch_array($r);
?>
<form action="update_buku.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<table width="70%" border="1">
<tr>
<td width="22%">judul</td>
<td width="78%"><label>
<input name="judul" value="<?php echo $a['judul'];?>" required="required" type="text" class="text" id="judul" />
</label></td>
</tr>
<tr>
<td>cover</td>
<td><img src="cover/<?php echo $a['cover'];?>" width="50" style="float:left;margin-right:5px;"? /><label>
<input name="cover" type="file" class="text" id="cover" /> <br />pilih untuk mengcover buku</label></td>
</tr>
<tr>
<td>kategori</td>
<td><label>
<select name="kategori" required="required" class="text" id="kategori">
<option select="selected" value="<?php echo $a['kategori'];?>">-kategori-</option>
<?php
$rr=mysql_query("select *from kategori order by kat");
while($ar=mysql_fetch_array($rr)) {
?>
<option value="<?php echo $ar['kat'];?>"><?php echo $ar['kat'];?></option>
<?php }?>
</select>
</label></td>
</tr>
<tr>
<td>penerbit</td>
<td><label>
<select name="penerbit" required="required" class="text" id="penerbit">
<option select="selected" value="<?php echo $a['penerbit'];?>">-penerbit-</option>
<?php
$rr=mysql_query("select *from penerbit order by kat");
while($ar=mysql_fetch_array($rr)) {
?>
<option value="<?php echo $ar['kat'];?>"><?php echo $ar['kat'];?></option>
<?php }?>
</select>
</label></td>
</tr>
<tr>
<td>pengarang</td>
<td><label>
<select name="pengarang" required="required" class="text" id="pengarang">
<option select="selected" value="<?php echo $a['pengarang'];?>">-pengarang-</option>
<?php
$rr=mysql_query("select *from pengarang order by kat");
while($ar=mysql_fetch_array($rr)) {
?>
<option value="<?php echo $ar['kat'];?>"><?php echo $ar['kat'];?></option>
<?php }?>
</select>
</label></td>
</tr>
<tr>
<td>sinopsis</td>
<td><label>
<textarea name="sinopsis" required="required" cols="45" rows="5" class="textarea" id="sinopsis"><?php echo $a['sinopsis'];?></textarea>
</label></td>
</tr>
<tr>
<td>lokasi</td>
<td><label>
<input name="lokasi" required="required" value="<?php echo $a['lokaasi'];?>" type="text" class="text" id="lokasi" />
</label></td>
</tr>
<tr>
<td>harga</td>
<td><label>
<input name="harga" required="required" value="<?php echo $a['harga'];?>" type="text" class="text" id="harga" />
</label></td>
</tr>
<tr>
<td><input name="id" type="hidden" id="id" value="<?php echo $id;?>" /></td>
<td><label>
<input name="button" type="submit" class="tombol" id="button" value="ubah" />
</label>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
No comments:
Post a Comment