SCRIPT UPDATE PHP
UPDATE
<?php
include 'koneksi.php' ;
@$id = $_GET['id'];
$data = mysqli_query($koneksi, "select * from izin where id_izin='$id'");
$d = mysqli_fetch_array($data);{
?>
<form method="post" action="updateprosesizin.php">
<center><table width="500" height="200" border="10" cellpadding="10" cellspacing="5">
<tr>
<td>ID Izin</td>
<td>:</td>
<td><input type="text" readonly name="id_izin" value="<?php echo $d['id_izin']; ?>"></td></tr>
<tr>
<td>Nama Siswa</td>
<td>:</td>
<td><input type="text" name="nama" value="<?php echo $d['nama']; ?>"></td></tr>
<tr>
<td>Kelas</td>
<td>:</td>
<td><select name="kelas" id="kelas">
<option value="<?php echo $d['kelas'];?>"><?php echo $d['kelas'];?></option>
<?php
include 'koneksi.php';
$query = mysqli_query($koneksi,"select * from kelas");
while($data = mysqli_fetch_array($query))
{
echo"<option value='$data[1]'>$data[1]</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>Jurusan</td>
<td>:</td>
<td><select name="jurusan" id="jurusan">
<option value="<?php echo $d['jurusan'];?>"><?php echo $d['jurusan'];?></option>
<?php
include 'koneksi.php';
$query = mysqli_query($koneksi,"select * from jurusan");
while($data = mysqli_fetch_array($query))
{
echo"<option value='$data[1]'>$data[1]</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>Nama Orang Tua</td>
<td>:</td>
<td><input type="text" name="ortu" value="<?php echo $d['ortu']; ?>">
</td>
</tr>
<tr>
<td>Tanggal Izin</td>
<td>:</td>
<td><input type="date" name="tgl_izin" value="<?php echo $d['tgl_izin']; ?>">
</td>
</tr>
<tr>
<td>Tanggal Masuk</td>
<td>:</td>
<td><input type="date" name="tgl_masuk" value="<?php echo $d['tgl_masuk']; ?>">
</td>
</tr>
<tr>
<td>Alamat</td>
<td><textarea name="alamat" cols="10" rows="3"><?php echo $d['alamat']; ?></textarea></td>
</tr>
<tr>
<td colspan="3">
<input type="submit" name="ok" value="OK">
<a href="showbarang.php"><input type="submit" name="cancel" value="CANCEL"></a></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
<?php
include 'koneksi.php' ;
@$id = $_GET['id'];
$data = mysqli_query($koneksi, "select * from izin where id_izin='$id'");
$d = mysqli_fetch_array($data);{
?>
<form method="post" action="updateprosesizin.php">
<center><table width="500" height="200" border="10" cellpadding="10" cellspacing="5">
<tr>
<td>ID Izin</td>
<td>:</td>
<td><input type="text" readonly name="id_izin" value="<?php echo $d['id_izin']; ?>"></td></tr>
<tr>
<td>Nama Siswa</td>
<td>:</td>
<td><input type="text" name="nama" value="<?php echo $d['nama']; ?>"></td></tr>
<tr>
<td>Kelas</td>
<td>:</td>
<td><select name="kelas" id="kelas">
<option value="<?php echo $d['kelas'];?>"><?php echo $d['kelas'];?></option>
<?php
include 'koneksi.php';
$query = mysqli_query($koneksi,"select * from kelas");
while($data = mysqli_fetch_array($query))
{
echo"<option value='$data[1]'>$data[1]</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>Jurusan</td>
<td>:</td>
<td><select name="jurusan" id="jurusan">
<option value="<?php echo $d['jurusan'];?>"><?php echo $d['jurusan'];?></option>
<?php
include 'koneksi.php';
$query = mysqli_query($koneksi,"select * from jurusan");
while($data = mysqli_fetch_array($query))
{
echo"<option value='$data[1]'>$data[1]</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>Nama Orang Tua</td>
<td>:</td>
<td><input type="text" name="ortu" value="<?php echo $d['ortu']; ?>">
</td>
</tr>
<tr>
<td>Tanggal Izin</td>
<td>:</td>
<td><input type="date" name="tgl_izin" value="<?php echo $d['tgl_izin']; ?>">
</td>
</tr>
<tr>
<td>Tanggal Masuk</td>
<td>:</td>
<td><input type="date" name="tgl_masuk" value="<?php echo $d['tgl_masuk']; ?>">
</td>
</tr>
<tr>
<td>Alamat</td>
<td><textarea name="alamat" cols="10" rows="3"><?php echo $d['alamat']; ?></textarea></td>
</tr>
<tr>
<td colspan="3">
<input type="submit" name="ok" value="OK">
<a href="showbarang.php"><input type="submit" name="cancel" value="CANCEL"></a></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
Comments
Post a Comment
Mohon dengan komentar yang sopan dan membangun