first commit
This commit is contained in:
@@ -0,0 +1,220 @@
|
||||
<?php
|
||||
include("../koneksi.php");
|
||||
$satuan_kerja_id=$_POST['satker'];
|
||||
$jenis_user=$_POST['jenis'];
|
||||
$sess_nama=$_POST['sess_nama'];
|
||||
$bln=$_POST['bln'];
|
||||
$thn=$_POST['thn'];
|
||||
?>
|
||||
|
||||
<script type="text/javascript">$("#tabel_data_skeluar").DataTable({"stateSave":true,"paging": true,"lengthChange": true,"searching": true,"ordering": false,"info": true,"autoWidth": false});</script>
|
||||
|
||||
|
||||
<input type="hidden" id="jenis" value="<?php echo $jenis_user; ?>">
|
||||
<input type="hidden" id="sess_nama" value="<?php echo $sess_nama; ?>">
|
||||
<input type="hidden" id="satker" value="<?php echo $satuan_kerja_id; ?>">
|
||||
<table id="tabel_data_skeluar" class="table table-striped table-condensed" cellpadding="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td width="60px;"><b>No Urut</b></td>
|
||||
<td width="60px;"><b>No Kode</b></td>
|
||||
<!--<td><b>Kepada</b></td>-->
|
||||
<td><b>Perihal</b></td>
|
||||
<!--<td><b>Keterangan</b></td>-->
|
||||
<td><b>Pengolah</b></td>
|
||||
<td width="80px;"><b>Tgl Surat</b></td>
|
||||
<!--<td><b>Tgl Kirim</b></td>-->
|
||||
<td width="120px;"><b>Tujuan</b></td>
|
||||
<td width="80px;" align="center"><b>KNDL</b></td>
|
||||
<td><b>Balasan</b></td>
|
||||
<td><b>Kepada</b></td>
|
||||
<td width="80px;"><b>Tools</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="color:black">
|
||||
<?php
|
||||
$data=pg_query("SELECT s.no_urut,
|
||||
k.kode,
|
||||
k.keterangan,
|
||||
s.kepada,
|
||||
CASE WHEN s.satuan_kerja_dari IS NULL THEN t.nama
|
||||
ELSE
|
||||
(SELECT t2.nama FROM satuan_kerja t2 WHERE t2.id=s.satuan_kerja_dari)
|
||||
END,
|
||||
CASE WHEN s.satuan_kerja_dari IS NULL THEN t.kode_satker
|
||||
ELSE
|
||||
(SELECT k2.kode_satker FROM satuan_kerja k2 WHERE k2.id=s.satuan_kerja_dari)
|
||||
END,
|
||||
s.id,
|
||||
s.perihal,
|
||||
s.id,s.balasan,s.jam_kirim,s.tgl_kirim,
|
||||
s.tgl_surat_keluar,
|
||||
n.tujuan,s.konten,p.kepada,s.no_kendali
|
||||
FROM surat s
|
||||
INNER JOIN kode k ON (k.id=s.kode_id)
|
||||
INNER JOIN satuan_kerja t ON (t.id=s.satuan_kerja_id)
|
||||
INNER JOIN tujuan n ON (n.id=s.tujuan_id)
|
||||
LEFT OUTER JOIN kepada p ON (s.id=p.surat_id)
|
||||
WHERE s.kepada IS NOT NULL
|
||||
".($thn == '' ? "" : "AND EXTRACT(YEAR FROM DATE(s.tgl_surat_keluar))='$thn'")."
|
||||
".($bln == '0' ? "" : "AND EXTRACT(MONTH FROM DATE(s.tgl_surat_keluar))='$bln'")."
|
||||
".($jenis_user == 'Admin' ? "" : "AND s.satuan_kerja_id='$satuan_kerja_id'")."
|
||||
ORDER BY s.no_urut DESC,s.tgl_surat_keluar DESC
|
||||
");
|
||||
while($r=pg_fetch_array($data)) {
|
||||
|
||||
?>
|
||||
<tr <?php if ($r[4] == 'INSTALASI FARMASI') {echo 'style="color:#9900F0"';} else {} ?>>
|
||||
<!--<td class="kiri" align="right"><b><?php echo $r['no_urut']; ?></b></td>-->
|
||||
<td class="kiri"><b><?php
|
||||
if (($r['no_urut']=='') || ($r['no_urut']==NULL)) {} else {
|
||||
$no_pinjam=(int) substr($r['no_urut'],0,5);
|
||||
$no_kendali=sprintf("%05s",$no_pinjam);
|
||||
echo $no_kendali;
|
||||
}
|
||||
?></b></td>
|
||||
<td><b><?php echo $r['kode']; ?></b></td>
|
||||
<!--<td><b><?php echo $r['kepada']; ?></b></td>-->
|
||||
<td style="word-wrap: break-word;min-width: 160px;max-width: 160px;"><b><?php echo $r[7]; ?></b></td>
|
||||
<!--<td style="word-wrap: break-word;min-width: 160px;max-width: 160px;"><b><?php echo $r['konten']; ?></b></td>-->
|
||||
<td><b><?php echo $r[4].' - '.$r[5]; ?></b></td>
|
||||
<!--<td><b><?php echo date('d-m-Y',strtotime($r['tgl_surat_keluar'])); ?></b></td>-->
|
||||
<td><b><?php echo date('d-m-Y',strtotime($r['tgl_surat_keluar'])).' '.date('H:i',strtotime($r['jam_kirim'])); ?></b></td>
|
||||
<td><b><?php echo $r['tujuan']; ?></b></td>
|
||||
<td align="center">
|
||||
<?php if (($r['no_kendali']==NULL) || ($r['no_kendali']=='')) { ?>
|
||||
<!--<?php if ($jenis_user != 'Admin') {} else { ?>
|
||||
<button style="height:22px;" name="add_kendali" class="btn btn-default btn-rounded btn-xs add_kendali" id="<?php echo $r['id'];?>"
|
||||
data-content="Add Kendali" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-plus" style="margin-top:4px"></i>
|
||||
</button>
|
||||
<?php } ?>-->
|
||||
<?php } else {?>
|
||||
<button style="font-family:Arial" class="btn btn-default btn-xs edit_kendali" id="<?php echo $r['id'];?>"><?php echo $r['no_kendali'];?></button>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><b><?php if ($r['balasan']=='f') {echo "TIDAK";} else {echo "YA";} ?></b></td>
|
||||
<td><b><?php echo $r[15]; ?></b></td>
|
||||
<td class="kanan">
|
||||
<?php if (($r[15]=='') ||($r[15]==null)) {} else {?>
|
||||
<button type="button" name="kepada_skeluar" style="height:22px;"class="btn btn-teal btn-xs kepada_skeluar" id="<?php echo $r['id'];?>" data-content="Kepada" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-user"></i>
|
||||
</button>
|
||||
<?php } ?>
|
||||
<button type="button" name="edit_skeluar" style="height:22px;"class="btn btn-primary btn-xs edit_skeluar" id="<?php echo $r['id'];?>" data-content="Edit" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-pencil"></i>
|
||||
</button>
|
||||
<?php
|
||||
if ($r['balasan']=='f') {} else {
|
||||
?>
|
||||
<button type="button" name="proses_disposisi" style="height:22px;"class="btn btn-danger btn-xs proses_disposisi" id="<?php echo $r['id'];?>" data-content="Disposisi" rel="popover" data-placement="top" data-trigger="hover"
|
||||
>
|
||||
<i class="fa fa-arrow-right"></i>
|
||||
</button>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$('button[name="add_kendali"]').popover();
|
||||
$('button[name="kepada_skeluar"]').popover();
|
||||
$('button[name="edit_skeluar"]').popover();
|
||||
$('button[name="proses_disposisi"]').popover();
|
||||
|
||||
$("#tabel_data_skeluar").on('click','.edit_skeluar',function(){
|
||||
var id = $(this).attr('id');
|
||||
var sess_jenis=$('#jenis').val();
|
||||
var sess_satker=$('#satker').val();
|
||||
$('#modal_skeluar').modal('show');
|
||||
$('#modal_body_skeluar').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/skeluar/modal.php",
|
||||
data: 'id='+id
|
||||
+'&sess_jenis='+sess_jenis
|
||||
+'&sess_satker='+sess_satker,
|
||||
success: function(data){
|
||||
$('#modal_body_skeluar').html(data);
|
||||
$('#no_kendali').prop("disabled",true);
|
||||
$('#kepada').first().focus().selected();
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#tabel_data_skeluar").on('click','.proses_disposisi',function(){
|
||||
var id = $(this).attr('id');
|
||||
$('#modal_sdisposisi').modal('show');
|
||||
$('#modal_body_sdisposisi').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/skeluar/modal_dis.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_sdisposisi').html(data);
|
||||
$('#kepada').first().focus().selected();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#tabel_data_skeluar").on('click','.kepada_skeluar',function(){
|
||||
var id = $(this).attr('id');
|
||||
$('#modal_kepada').modal('show');
|
||||
$('#modal_body_kepada').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/skeluar/modal_kepada.php",
|
||||
data: 'id='+id,
|
||||
success: function(data){
|
||||
$('#modal_body_kepada').html(data);
|
||||
$('#kepada_k').first().focus().selected();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#tabel_data_skeluar").on('click','.edit_kendali',function(){
|
||||
var currentRow=$(this).closest("tr");
|
||||
var no_kendali = $.trim(currentRow.find("td:eq(6)").text());
|
||||
var thn = $('#thn').val();
|
||||
var id = $(this).attr('id');
|
||||
$('#modal_edit_kendali').modal('show');
|
||||
$('#modal_body_edit_kendali').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/skeluar/modal_edit_kendali.php",
|
||||
data: 'id='+id
|
||||
+'&no_kendali='+no_kendali
|
||||
+'&thn='+thn,
|
||||
success: function(data){
|
||||
$('#modal_body_edit_kendali').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#tabel_data_skeluar").on('click','.add_kendali',function(){
|
||||
var thn = $('#thn').val();
|
||||
var id = $(this).attr('id');
|
||||
$('#modal_edit_kendali').modal('show');
|
||||
$('#modal_body_edit_kendali').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/skeluar/modal_edit_kendali.php",
|
||||
data: 'id='+id
|
||||
+'&no_kendali='+no_kendali
|
||||
+'&thn='+thn,
|
||||
success: function(data){
|
||||
$('#modal_body_edit_kendali').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user