179 lines
5.8 KiB
PHP
179 lines
5.8 KiB
PHP
<?php
|
|
include("../koneksi.php");
|
|
$riwayat_ship_id=$_POST['riwayat_ship_id'];
|
|
$tujuan_ship=$_POST['tujuan_ship'];
|
|
?>
|
|
<br>
|
|
<input type="hidden" value="<?php echo $riwayat_ship_id; ?>" id="riwayat_ship_id">
|
|
<table class="table table-bordered table-condensed" id="tabel_data_daftar" style="font-family:'RubReg';font-size:13px">
|
|
<thead>
|
|
<tr style="text-align:center;color:black;font-weight:bold">
|
|
<td width="30px;">NO</td>
|
|
<td width="420px;">BERKAS</td>
|
|
<td width="10px;">FILE</td>
|
|
<td width="140px;">STATUS BERKAS</td>
|
|
<td width="80px;">TGL KIRIM</td>
|
|
<td width="80px;">TGL CEK</td>
|
|
<td width="70px;" style="display:none">CEKLIST</td>
|
|
<td width="140px;">KETERANGAN</td>
|
|
<td width="30px;" class="abc">
|
|
<button type="button" name="cekall" style="height:22px;color:green"class="btn btn-default btn-xs cekall" id="<?php echo $riwayat_ship_id;?>">
|
|
<i class="fa fa-check m-r-5"></i>Check All</button>
|
|
</td>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody style="color:black">
|
|
<?php
|
|
$no=1;
|
|
|
|
$d=pg_query("SELECT s.id,s.berkas,b.st_ceklist,b.status,a.id,COALESCE(b.id,0),b.ket,a.data_pegawai_id,b.tgl_upload_dok,b.tgl_cek_dok
|
|
FROM syarat_ship s
|
|
LEFT OUTER JOIN (
|
|
SELECT r1.*,r2.syarat_ship_id
|
|
FROM riwayat_ship r1
|
|
INNER JOIN riwayat_syarat_ship r2 ON (r1.id=r2.riwayat_ship_id)
|
|
WHERE r1.id=$riwayat_ship_id
|
|
) a ON (s.id=a.syarat_ship_id)
|
|
LEFT OUTER JOIN (
|
|
SELECT r2.*
|
|
FROM riwayat_ship r1
|
|
INNER JOIN riwayat_syarat_ship r2 ON (r1.id=r2.riwayat_ship_id)
|
|
WHERE r1.id=$riwayat_ship_id
|
|
) b ON (s.id=b.syarat_ship_id)
|
|
".($tujuan_ship== 'dn' ? "WHERE s.dn='y'" : "
|
|
".($tujuan_ship== 'ln' ? "WHERE s.ln='y'" : "")."
|
|
")."
|
|
");
|
|
while($r=pg_fetch_array($d)) {
|
|
$syarat_ship_id=$r[0];
|
|
$riwayat_ship_id=$r[4];
|
|
$riwayat_syarat_ship_id=$r[5];
|
|
|
|
$l=pg_query("SELECT COUNT(*)
|
|
FROM dok_syarat_ship k INNER JOIN riwayat_syarat_ship s ON (k.riwayat_syarat_ship_id=s.id)
|
|
WHERE k.riwayat_syarat_ship_id=$riwayat_syarat_ship_id AND k.file NOT IN ('')");
|
|
while($rl=pg_fetch_array($l)) {$tf=$rl[0];}
|
|
|
|
$m=pg_query("SELECT COUNT(*)
|
|
FROM pesan_syarat_ship k INNER JOIN riwayat_syarat_ship s ON (k.riwayat_syarat_ship_id=s.id)
|
|
WHERE k.riwayat_syarat_ship_id=$riwayat_syarat_ship_id AND k.baca='f'");
|
|
while($rm=pg_fetch_array($m)) {$tp=$rm[0];}
|
|
|
|
?>
|
|
<tr
|
|
<?php
|
|
if ($tf==0) {echo 'style="color:grey"';} else {echo 'style="color:black"';}
|
|
?>
|
|
>
|
|
<td align="center" class="kiri"><?php echo $no; ?></td>
|
|
<td><?php echo $r['berkas']; ?></td>
|
|
<td align="center">
|
|
<?php if ($tf==0) {} else {?>
|
|
<button type="button" name="file_daftar" style="height:22px;"class="btn btn-default btn-xs file_daftar" id="<?php echo $riwayat_syarat_ship_id;?>" data-content="Download File" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-file m-r-5"></i><span class="sr<?php echo $riwayat_syarat_ship_id;?>" idne="pdf<?php echo $syarat_ship_id;?>"> <?php echo '('.$tf.')'?></span>
|
|
</button>
|
|
<?php } ?>
|
|
</td>
|
|
<td align="center">
|
|
<?php
|
|
if (($tf!=0) && (($r['status']==NULL) || ($r['status']==''))) {
|
|
echo 'Belum verifikasi';
|
|
} else {
|
|
echo $r['status'];
|
|
}
|
|
?>
|
|
</td>
|
|
<td align="center"><?php
|
|
if (($r['tgl_upload_dok']==null) || ($r['tgl_upload_dok']=='1970-01-01 00:00:00')) {} else {
|
|
echo date('d-m-Y',strtotime($r['tgl_upload_dok'])); }
|
|
?>
|
|
</td>
|
|
<td align="center"><?php
|
|
if (($r['tgl_cek_dok']==null) || ($r['tgl_cek_dok']=='1970-01-01 00:00:00')) {} else {
|
|
echo date('d-m-Y',strtotime($r['tgl_cek_dok'])); }
|
|
?>
|
|
</td>
|
|
<td style="display:none"><?php echo $r['st_ceklist']; ?></td>
|
|
<td><?php echo $r['ket']; ?></td>
|
|
<td class="kanan abc" align="center">
|
|
<?php if ($tf==0) {} else {?>
|
|
<button type="button" name="edit_verifikasi" style="height:22px;"class="btn btn-danger btn-xs edit_verifikasi" id="<?php echo $riwayat_syarat_ship_id;?>" data-content="Verifikasi" rel="popover" data-placement="top" data-trigger="hover"
|
|
><i class="fa fa-check"></i></button>
|
|
<?php } ?>
|
|
</td>
|
|
<tr>
|
|
<?php
|
|
$no++;
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
<script>
|
|
|
|
$('button[name="edit_verifikasi"]').popover();
|
|
|
|
$("#tabel_data_daftar").on('click','.file_daftar',function(){
|
|
var riwayat_syarat_ship_id = $(this).attr('id');
|
|
var riwayat_ship_id=$('#riwayat_ship_id').val();
|
|
var currentRow=$(this).closest("tr");
|
|
var berkas = currentRow.find("td:eq(1)").text();
|
|
$('#modal_view').modal('show');
|
|
$('#modal_body_view').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/ship_inbox/modal_view.php",
|
|
data: 'riwayat_syarat_ship_id='+riwayat_syarat_ship_id
|
|
+'&riwayat_ship_id='+riwayat_ship_id
|
|
+'&berkas='+berkas,
|
|
success: function(data){
|
|
$('#modal_body_view').html(data);
|
|
$('#modal_head_view').html('Download File');
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#tabel_data_daftar").on('click','.edit_verifikasi',function(){
|
|
var riwayat_syarat_ship_id = $(this).attr('id');
|
|
var riwayat_ship_id=$('#riwayat_ship_id').val();
|
|
var currentRow=$(this).closest("tr");
|
|
var berkas = currentRow.find("td:eq(1)").text();
|
|
var tujuan_ship=$('#tujuan_ship').val();
|
|
$('#modal_edit_verifikasi').modal('show');
|
|
$('#modal_body_edit_verifikasi').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/ship_inbox/modal_edit_verifikasi.php",
|
|
data: 'riwayat_syarat_ship_id='+riwayat_syarat_ship_id
|
|
+'&riwayat_ship_id='+riwayat_ship_id
|
|
+'&tujuan_ship='+tujuan_ship
|
|
+'&berkas='+berkas,
|
|
success: function(data){
|
|
$('#modal_body_edit_verifikasi').html(data);
|
|
$('#modal_head_edit_verifikasi').html('Verifikasi');
|
|
}
|
|
});
|
|
});
|
|
|
|
$('.cekall').click(function(){
|
|
var x = confirm("Apakah semua item persyaratan sudah benar ?");
|
|
if (x) {
|
|
var riwayat_ship_id = $(this).attr('id');
|
|
var key = 'cekall';
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/ship_inbox/crud.php",
|
|
data: 'riwayat_ship_id='+riwayat_ship_id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
alert('Check all sukses..');
|
|
var riwayat_ship_id=$('#riwayat_ship_id').val();
|
|
var tujuan_ship=$('#tujuan_ship').val();
|
|
$('#tabel_verifikasi').load('app/ship_inbox/tabel_verifikasi.php',{riwayat_ship_id:riwayat_ship_id, tujuan_ship:tujuan_ship});
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
</script>
|