Files
simak/app/master/user/tabel.php
2025-10-10 09:25:05 +07:00

138 lines
7.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
include('../../koneksi.php');
?>
<script type="text/javascript">$("#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-bordered table-striped table-condensed" cellpadding="1">
<thead>
<tr align="center">
<td><b>Nama</b></td>
<td><b>Username</b></td>
<td><b>Password</b></td>
<td><b>Jenis User</b></td>
<td><b>Paraf</b></td>
<td><b>Aktif</b></td>
<td align="center" width="80px;"><b>Tools</b></td>
</tr>
</thead>
<tbody>
<?php
$data = pg_query("SELECT u.id,u.nama,u.password,j.jenis,u.aktif,p.nama,v.file
FROM data_user u
INNER JOIN jenis_user j ON (j.id=u.jenis_user)
LEFT OUTER JOIN data_pegawai p ON (p.id=u.data_pegawai_id)
LEFT OUTER JOIN vr_ttd v ON (u.id=v.data_user_id)
WHERE j.jenis IN ('Verifikator','Pelunasan', 'Kepala Keuangan', 'Kepala Verifikasi', 'Kepala Perbendaharaan','Akuntan','Bendahara')
ORDER BY u.id DESC");
while($row=pg_fetch_array($data)) {
?>
<tr>
<td class="kiri"><b><?php echo $row[5]; ?></b></td>
<td><b><?php echo $row[1]; ?></b></td>
<td><b><?php echo $row[2]; ?></b></td>
<td><b><?php echo $row[3]; ?></b></td>
<td align="center" style="vertical-align: middle;">
<?php
if ((empty($row['file'])) || ($row['file']=="") || ($row['file']==null)) {
echo "
<img id='blah' style='width:20px;height:20px;' src='app/master/user/ttd/no-avatar.png' />
";
} else {
echo "
<img id='blah' style='width:20px;height:20px;' src='app/master/user/ttd/".$row['file']."' />
";
}
?>
</td>
<td align="center"><b><?php if ($row[4]=='t') {echo 'ON';} else {echo 'OFF';} ?></b></td>
<td align="center" class="kanan">
<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" rel="popover" data-placement="top" data-trigger="hover">
<i class="fa fa fa-pencil"></i>
</button>
<button type="button" name="paraf_pejabat" style="height:22px;" class="btn btn-danger btn-xs paraf_pejabat" id="<?php echo $row['id'];?>" data-content="Upload Tanda Tangan" rel="popover" data-placement="top" data-trigger="hover">
<i class="fa fa fa-viadeo"></i>
</button>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<div id="modal_paraf" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header no-border">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Upload Tanda Tangan</h4>
</div>
<div class="modal-body" id="modal_body_paraf"></div>
</div>
</div>
</div>
<script type="text/javascript">
$('button[name="edit_user"]').popover();
$('button[name="paraf_pejabat"]').popover();
$('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');
var rowElement = $(this).parent().parent();
$.ajax({
type: "POST",
url: "app/master/user/crud.php",
data: 'id='+id
+'&key='+key,
success: function(data){
rowElement.fadeOut(500).remove();
}
});
} else {}
});
$("#tabel_data_user").on('click','.paraf_pejabat',function(){
var id = $(this).attr('id');
$('#modal_paraf').modal('show');
$('#modal_body_paraf').html("");
$.ajax({
type: "POST",
url: "app/master/user/modal_dok.php",
data: 'id='+id,
success: function(data){
$('#modal_body_paraf').html(data);
}
});
});
$("#modal_paraf").on("hidden.bs.modal", function () {
$(this).off('hidden.bs.modal');
});
$("#tabel_data_user").on("contextmenu", "img", function(e) {
return false;
});
</script>