php-crud-oop/view.php
2020-01-02 23:24:47 +07:00

68 lines
1.9 KiB
PHP

<!doctype html>
<?php
include('database.php');
include('mahasiswa.php');
$mhs = new Mahasiswa();
$mhs->connect();
$car = $_GET['id'];
$mhs->select('mahasiswa','*',"nim='$car'");
$res = $mhs->getResult();
?>
<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">
body{
background-color: #f3f3f3;
}
.container{
margin:100px;
background-color: #fff;
box-shadow:0 1px 3px rgba(0,0,0,.5);
padding: 10px;
}
</style>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>Informasi</h1>
</div>
<table class="table">
<tr>
<td rowspan="5" width="200"><img src="<?php if (!empty($res['foto'])) echo $res['foto']; else echo 'upload/nophoto.jpg'; ?>" width="200" height="300"/></td>
<td width="100">Nama</td>
<td width="10">:</td>
<td><?php echo $res['nama']; ?></td>
</tr>
<tr>
<td>NIM</td>
<td>:</td>
<td><?php echo $res['nim']; ?></td>
</tr>
<tr>
<td>Alamat</td>
<td>:</td>
<td><?php echo $res['alamat']; ?></td>
</tr>
<tr>
<td>Telp</td>
<td>:</td>
<td><?php echo $res['telp']; ?></td>
</tr>
<tr>
<td>Sekolah Asal</td>
<td>:</td>
<td><?php echo $res['asal']; ?></td>
</tr>
</table>
<div style="text-align:center;">
<a href="index.php"><button class="btn"><i class="icon-arrow-left"></i> Back</button></a>
<a href="<?php echo 'form.php?id='.$res['nim'] ?>"><button class="btn"><i class="icon-edit"></i> Update</button></a>
</div>
</div>
</body>
</html>