85 lines
2.5 KiB
PHP
85 lines
2.5 KiB
PHP
<!doctype html>
|
|
<?php
|
|
include 'query.php';
|
|
if (isset($_GET['id'])){
|
|
$action='update&id='.$_GET['id'].'';
|
|
$result = slcmhs($_GET['id']);
|
|
while($data = mysql_fetch_array($result)) {
|
|
$nim = $data['nim'];
|
|
$nama = $data['nama'];
|
|
$alamat = $data['alamat'];
|
|
$telp = $data['telp'];
|
|
$asal = $data['asal'];
|
|
$foto = $data['foto'];
|
|
}
|
|
}
|
|
else $action='insert';
|
|
?>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Document</title>
|
|
<link href="style.css" rel="stylesheet">
|
|
<link href="bootstrap.min.css" rel="stylesheet">
|
|
<style type="text/css">
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="page-header">
|
|
<h1>Registrasi</h1>
|
|
</div>
|
|
<form method="post" action="query.php?action=<?php echo $action ?>" enctype="multipart/form-data">
|
|
<fieldset>
|
|
<legend>Data</legend>
|
|
<table>
|
|
<tr>
|
|
<td width="300px">Nama</td>
|
|
<td width="30px">:</td>
|
|
<td><input type="text" name="nama" value="<?php if (isset($_GET['id'])) echo $nama; ?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>NIM</td>
|
|
<td>:</td>
|
|
<td><input type="text" name="nim" value="<?php if (isset($_GET['id'])) echo $nim; ?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Alamat</td>
|
|
<td>:</td>
|
|
<td><input type="text" name="alamat" value="<?php if (isset($_GET['id'])) echo $alamat; ?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Telp</td>
|
|
<td>:</td>
|
|
<td><input type="text" name="telp" value="<?php if (isset($_GET['id'])) echo $telp; ?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Sekolah Asal</td>
|
|
<td>:</td>
|
|
<td><input type="text" name="asal" value="<?php if (isset($_GET['id'])) echo $asal; ?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Photo</td>
|
|
<td>:</td>
|
|
<td>
|
|
<?php if (!empty($foto)){
|
|
?>
|
|
<img src="<?php echo $foto ?>" height="200" width="300"></img>
|
|
<?php
|
|
}else{
|
|
?>
|
|
<input type="file" name="file" id="file">
|
|
<?php } ?>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</fieldset>
|
|
<div style="text-align:center;margin:20px;">
|
|
<a href="index.php"><button type="button" class="btn"><i class=" icon-ban-circle"></i> Cancel</button></a>
|
|
<button type="submit" name="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> Save</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</body>
|
|
</html>
|