codeigniter_test2/application/views/HalamanUtama.php
2020-01-02 23:07:40 +07:00

69 lines
1.9 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>Halaman Admin</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"><img src="../../image/Untitled-2.png"class="img" />
<a href="<?php echo base_url().'index.php/user_controller/logout'; ?>" class="link">logout</a></div>
<div class="header2">
</div>
<div class="sidebar1">
<ul class="nav">
<li id="menuchoosen"><a href="">Dashboard</a></li>
<li id="menuunchoosen"><a href="add_barang">Tambah Data Barang</a></li>
</ul>
</div>
<div class="content">
<div class="border">
<div class="bordhead"><p>Data Barang</p>
<table class="tabel" width=700 >
<tr>
<th>Nama Barang</th>
<th>Harga Barang</th>
<th colspan="2">Aksi</th>
</tr>
<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>
</div>
</div>
</div>
</body>
</html>