74 lines
2.0 KiB
PHP
74 lines
2.0 KiB
PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html>
|
|
|
|
<head>
|
|
<title><?php echo $judul; ?></title>
|
|
<link rel="stylesheet" type="text/css" href="../../css/css2.css">
|
|
<script>
|
|
function myFunction(id)
|
|
{
|
|
var url="<?php echo base_url();?>";
|
|
var r=confirm("Do you want to delete this?");
|
|
if (r==true)
|
|
{
|
|
window.location = url+"index.php/barang_controller/delete/"+id;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="wrapper">
|
|
<div class="header"><a href="v_admin.php"><img src="../../image/Untitled-3.png" /></a>
|
|
</div>
|
|
|
|
<div class="header2">
|
|
<a href="<?php echo base_url().'index.php/user_controller/logout'; ?>"><button id="bt2">Logout</button></a>
|
|
</div>
|
|
|
|
<div class="sidebar1">
|
|
<ul class="nav">
|
|
<li><a href="">Kelola Data Barang</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="content">
|
|
|
|
<div class="barang">
|
|
<h3>Daftar Barang</h3>
|
|
<table border="3">
|
|
<thead>
|
|
<tr>
|
|
<th>Nama Barang</th>
|
|
<th>Harga</th>
|
|
<th>Action</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
foreach($daftar_barang as $barang){
|
|
?>
|
|
<tr>
|
|
<td><?php echo $barang->nama; ?></td>
|
|
<td><?php echo $barang->harga; ?></td>
|
|
<td><?php echo '<a href="'.base_url().'index.php/barang_controller/edit/'.$barang->id.'"><button id="bt">Edit</button></a>' ?>
|
|
<button id="bt" onclick="myFunction(<?php echo $barang->id;?>)">Delete</button>
|
|
</td>
|
|
</tr>
|
|
<?php } ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|