everseiko/application/views/vAdminStaff.php

94 lines
2.8 KiB
PHP
Raw Normal View History

2020-01-02 23:02:57 +07:00
<script>
$(document).ready(function() {
$('#stafflist').dataTable();
});
function deleteUser(id)
{
var url="<?php echo base_url();?>";
var r=confirm("Do you want to delete this?");
if (r==true)
{
window.location = url+"user/delete_user/"+id;
}
else
{
return false;
}
}
</script>
<div class="well-white">
<div class="navbar">
<div class="navbar-inner">
<a class="brand"><i class="icon-user"></i> List Sales</a>
</div>
</div>
</div>
<div class="well-white stafflist">
<a data-toggle="modal" href="#myModal" class="btn pull-right" href=""><i class="icon-plus-sign"></i>Tambah</a>
<br /><br />
<table cellpadding="0" cellspacing="0" border="0" class="table display" id="stafflist">
<thead>
<tr>
<th><i class="icon-user"></i> Name</th>
<th><i class="icon-info-sign"></i> Username</th>
<th><i class="icon-tags"></i> Role</th>
<th><i class="icon-wrench"></i> Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>Mark</td>
<td>Mark</td>
<td>Jawa Tengah</td>
<td align="center">
<button class="btn btn-small btn-danger disabled">Delete</button>
</td>
</tr>
<?php
foreach($user as $puser){
?>
<tr>
<td><?php echo $puser->nama; ?></td>
<td><?php echo $puser->username; ?></td>
<td><?php echo $puser->role; ?></td>
<td align="center">
<button class="btn btn-small btn-danger" onclick="deleteUser('<?php echo $puser->username; ?>')">Delete</button>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!--modal-->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h3 id="myModalLabel">Add New User</h3>
</div>
<form class="form-horizontal" action="<?php echo base_url(); ?>user/insert_user" method="post">
<div class="modal-body">
<label class="control-label">Nama :</label>
<div class="controls">
<input type="text" placeholder="Nama" name="nama">
</div><br />
<label class="control-label">Username :</label>
<div class="controls">
<input type="text" placeholder="Username" name="username">
</div><br />
<label class="control-label">Password :</label>
<div class="controls">
<input type="password" placeholder="Password" name="password">
</div><br />
<label class="control-label">Role :</label>
<div class="controls">
<input type="text" placeholder="Role" name="role">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>