139 lines
7.6 KiB
PHP
139 lines
7.6 KiB
PHP
<?php
|
|
include("../../koneksi.php");
|
|
$riwayat_kegiatan_id=$_POST['riwayat_kegiatan_id'];
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
$("#tabel_data_mentor").DataTable({"stateSave": true,"paging": true,"lengthChange": true,"searching": true,"ordering": true,"info": true,"autoWidth": false});
|
|
</script>
|
|
<input type="hidden" value="<?php echo $riwayat_kegiatan_id; ?>" id="riwayat_kegiatan_id">
|
|
<table id="tabel_data_mentor" class="table table-striped table-condensed" cellpadding="1">
|
|
<thead>
|
|
<tr>
|
|
<td><b>Nama Mentor</b></td>
|
|
<td><b>Satuan Kerja</b></td>
|
|
<!--<td><b>Gol</b></td>
|
|
<td><b>Sex</b></td>-->
|
|
<td><b>Jab</b></td>
|
|
<td><b>Sebagai</b></td>
|
|
<td width="70px;"><b>Nota Dinas</b></td>
|
|
<td><b>Status</b></td>
|
|
<td align="center" width="60px;"><b>Tools</b></td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$data=pg_query("SELECT p.nama,s.nama,p.golongan,p.ruang,p.jenis_kelamin,
|
|
j.nama,b.nama,r.id,r.status_mentor,r.no_nd
|
|
FROM data_pegawai p
|
|
INNER JOIN riwayat_peserta r ON (p.id=r.data_pegawai_id)
|
|
INNER JOIN satuan_kerja s ON (s.id=p.satuan_kerja)
|
|
INNER JOIN jabatan_pegawai j ON (j.id=p.jabatan_pegawai_id)
|
|
INNER JOIN sebagai b ON (b.id=r.sebagai_id)
|
|
WHERE r.riwayat_kegiatan_id='$riwayat_kegiatan_id'
|
|
AND r.sebagai_id NOT IN ('1','3','5','6')
|
|
ORDER BY r.id ASC
|
|
");
|
|
while($r=pg_fetch_array($data)) {
|
|
?>
|
|
<td class="kiri"><b><?php echo $r[0]; ?></b></td>
|
|
<td><b><?php echo $r[1]; ?></b></td>
|
|
<!-- <td><b><?php if ($r[2]=='-') {echo "-";} else {echo $r[2].'/'.$r[3];} ?></b></td>
|
|
<td><b><?php if ($r[4]=='Laki-laki') {echo "L";} else {echo "P";} ?></b></td>-->
|
|
<td><b><?php echo $r[5]; ?></b></td>
|
|
<td><b><?php echo $r[6]; ?></b></td>
|
|
<td><b>
|
|
<?php if (($r['no_nd']=='') || ($r['no_nd']==null)) {} else { ?>
|
|
TERKIRIM
|
|
<?php } ?>
|
|
</b></td>
|
|
<td><b><?php echo $r['status_mentor']; ?></b></td>
|
|
<td class="kanan" align="left">
|
|
<button type="button" name="edit_data" style="height:22px;"class="btn btn-success btn-xs edit_data" id="<?php echo $r['id'];?>" data-content="Edit Data" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-pencil"></i>
|
|
</button>
|
|
<button type="button" name="hapus_data" style="height:22px;"class="btn btn-danger btn-xs hapus_data" id="<?php echo $r['id'];?>" data-content="Hapus" rel="popover" data-placement="top" data-trigger="hover"
|
|
>
|
|
<i class="fa fa-remove"></i>
|
|
</button>
|
|
<button type="button" name="nd_permohonan_ns" style="height:22px;"class="btn btn-primary btn-xs nd_permohonan_ns" id="<?php echo $r['id'];?>" data-content="Nota Dinas Permohonan Mentor" rel="popover" data-placement="top" data-trigger="hover"
|
|
><i style="margin-top:3px" class="fa fa-envelope"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$('button[name="edit_data"]').popover();
|
|
$('button[name="hapus_data"]').popover();
|
|
$('button[name="nd_permohonan_ns"]').popover();
|
|
|
|
$("#tabel_data_mentor").on('click','.edit_data',function(){
|
|
var id = $(this).attr('id');
|
|
$('#modal_mentor').modal('show');
|
|
$('#modal_body_mentor').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/persiapan/mentor/modal.php",
|
|
data: 'id='+id,
|
|
success: function(data){
|
|
$('#modal_body_mentor').html(data);
|
|
$('#materi').first().focus().selected();
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#tabel_data_mentor").on('click','.hapus_data',function(){
|
|
var x = confirm("Anda yakin ingin menghapus ?");
|
|
if (x) {
|
|
var key = "hapus_data";
|
|
var id = $(this).attr('id');
|
|
var rowElement = $(this).parent().parent();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/persiapan/mentor/crud.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
rowElement.fadeOut(500).remove();
|
|
var riwayat_kegiatan_id=$('#riwayat_kegiatan_id').val();
|
|
$('#tabel_mentor').load("app/persiapan/mentor/tabel.php",{riwayat_kegiatan_id:riwayat_kegiatan_id});
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
|
|
$("#tabel_data_mentor").on('click','.nd_permohonan_ns',function(){
|
|
var riwayat_peserta_id = $(this).attr('id');
|
|
var riwayat_kegiatan_id = $('#riwayat_kegiatan_id').val();
|
|
$('#modal_nd1').modal('show');
|
|
$('#modal_body_nd1').html("");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/persiapan/mentor/modal_nd1.php",
|
|
data: 'riwayat_peserta_id='+riwayat_peserta_id
|
|
+'&riwayat_kegiatan_id='+riwayat_kegiatan_id,
|
|
success: function(data){
|
|
var key="nama_satker";
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/persiapan/mentor/crud.php",
|
|
data: 'riwayat_peserta_id='+riwayat_peserta_id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
$('#modal_head_nd1').html(data);
|
|
}
|
|
});
|
|
$('#modal_body_nd1').html(data);
|
|
$('#no_nd').first().focus().selected();
|
|
}
|
|
});
|
|
});
|
|
</script>
|