first commit
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
include('../../koneksi.php');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('button[name="edit_user"]').popover();
|
||||
$('button[name="aktifkan"]').popover();
|
||||
$("#tabel_data_user").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": false,"info": true,"autoWidth": false});
|
||||
</script>
|
||||
<table id="tabel_data_user" class="table table-striped table-condensed" cellpadding="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><b>ID</b></td>
|
||||
<td><b>Satuan Kerja</b></td>
|
||||
<td><b>Nama</b></td>
|
||||
<td width="100px;"><b>User login</b></td>
|
||||
<td style="display:none"><b>Password</b></td>
|
||||
<td><b>Jenis</b></td>
|
||||
<td><b>Aktif</b></td>
|
||||
<td><b>Status</b></td>
|
||||
<td align="center" width="80px;"><b>Tools</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$data = pg_query("SELECT u.id,s.nama,u.nama,u.password,j.jenis,u.aktif,p.nama,u.jabatan_pegawai_id,u.log_err,u.tanggal_lock
|
||||
FROM data_user u
|
||||
INNER JOIN satuan_kerja s ON (u.satuan_kerja_id=s.id)
|
||||
INNER JOIN jenis_user j ON (j.id=u.jenis_user)
|
||||
LEFT OUTER JOIN data_pegawai p ON (p.id=u.data_pegawai_id)
|
||||
ORDER BY u.id DESC");
|
||||
while($row=pg_fetch_array($data)) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="kiri"><b><?php echo $row[0]; ?></b></td>
|
||||
<td><b><?php echo $row[1]; ?></b></td>
|
||||
<td><b><?php echo $row[6]; ?></b></td>
|
||||
<td><b><?php echo $row[2]; ?></b></td>
|
||||
<td style="display:none"><b><?php echo $row[3]; ?></b></td>
|
||||
<td><b><?php echo $row[4]; ?></b></td>
|
||||
<td><b><?php if ($row[5]=='t') {echo 'ON';} else {echo 'OFF';} ?></td>
|
||||
<td><b>
|
||||
<?php
|
||||
if ($row['tanggal_lock']==NULL) {} else {echo '<span style="color:red">BLOCKED</span><br><span>'. date('d-m-Y H:i',strtotime($row['tanggal_lock'])).'</span>';}
|
||||
?></b></td>
|
||||
<td class="kanan" align="center">
|
||||
<button type="button" name="edit_user" style="height:22px;" class="btn btn-teal btn-xs edit_user" id="<?php echo $row['id'];?>" data-content="Edit Data" rel="popover" data-placement="top" data-trigger="hover">
|
||||
<i class="fa fa fa-pencil"></i>
|
||||
</button>
|
||||
<?php
|
||||
if ($row['tanggal_lock']==NULL) {} else { ?>
|
||||
<button type="button" name="aktifkan" style="height:22px;"class="btn btn-danger btn-xs aktifkan" id="<?php echo $row['id'];?>" data-content="Aktifkan" rel="popover" data-placement="top" data-trigger="hover">
|
||||
<i class="fa fa-check"></i>
|
||||
</button>
|
||||
<?php }
|
||||
?>
|
||||
<!--
|
||||
<button type="button" name="delete_user" style="height:22px;"class="btn btn-danger btn-xs delete_user" id="<?php echo $row['id'];?>" data-content="Hapus" rel="popover" data-placement="top" data-trigger="hover">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$('button[name="edit_user"]').popover();
|
||||
$("#tabel_data_user").on('click','.edit_user',function(){
|
||||
var id = $(this).attr('id');
|
||||
$('#modal_user').modal('show');
|
||||
$('#modal_body_user').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/user/modal.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_user').html(data);
|
||||
$('#nama').first().focus().selected();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#tabel_data_user").on('click','.delete_user',function(){
|
||||
var x = confirm("Anda yakin ingin menghapus ?");
|
||||
if (x) {
|
||||
var key = "delete_user";
|
||||
var id = $(this).attr('id');
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/user/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
$('#tabel_user').load("app/master/user/tabel.php");
|
||||
}
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
|
||||
$("#tabel_data_user").on('click','.aktifkan',function(){
|
||||
var x = confirm("Anda yakin ingin meng-aktifkan ?");
|
||||
if (x) {
|
||||
var key = "aktifkan";
|
||||
var id = $(this).attr('id');
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/master/user/crud.php",
|
||||
data: 'id='+id
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
$('#tabel_user').load("app/master/user/tabel.php");
|
||||
}
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user