add simak to git repo
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
include('../koneksi.php');
|
||||
$key=$_POST['key'];
|
||||
if ($key=='simpan_terapkan') {
|
||||
$belanja=$_POST['belanja'];
|
||||
$thn=$_POST['thn'];
|
||||
$rh=$_POST['rh'];
|
||||
$msb_kategori_id=$_POST['msb_kategori_id'];
|
||||
pg_query("UPDATE sub_kegiatan SET msb_kategori_id=$msb_kategori_id WHERE thn='$thn' AND kegiatan='$belanja' AND rh='$rh'");
|
||||
} else
|
||||
if ($key=='batal_terapkan') {
|
||||
$belanja=$_POST['belanja'];
|
||||
$thn=$_POST['thn'];
|
||||
$rh=$_POST['rh'];
|
||||
pg_query("UPDATE sub_kegiatan SET msb_kategori_id=NULL WHERE thn='$thn' AND kegiatan='$belanja' AND rh='$rh'");
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
include('../koneksi.php');
|
||||
$thn=$_POST['thn_dpa'];
|
||||
?>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div class="row" style="margin-top:-15px">
|
||||
<div class="col-lg-12">
|
||||
<p class="judul_page"><i class="mdi mdi-settings m-r-5"></i> Setting : Manajemen Persyaratan Pembayaran</p>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="form-group m-r-10 bap">
|
||||
<label for="exampleInputName2">Belanja</label>
|
||||
<select class="form-control" id="belanja">
|
||||
<option>-- Pilih Belanja --</option>
|
||||
<?php
|
||||
$d1=pg_query("SELECT DISTINCT k.kegiatan,CASE WHEN k.rh!='' THEN CONCAT(k.rh,' - ') ELSE '' END,
|
||||
k.rh, NULLIF(regexp_replace(k.rh,'\D','','g'),'')::numeric, k.msb_kategori_id
|
||||
FROM sub_kegiatan k LEFT OUTER JOIN ppkom o ON (o.id=k.ppkom_id)
|
||||
WHERE k.thn='$thn' ORDER BY NULLIF(regexp_replace(k.rh,'\D','','g'),'')::numeric ASC,k.kegiatan ASC");
|
||||
while($r1=pg_fetch_array($d1)) {
|
||||
?>
|
||||
<option value="<?php echo $r1[0]."-".$r1[2]; ?>"><?php echo "<i class='fa fa-check'></i>".$r1[1]."".$r1[0] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group m-r-10 bap">
|
||||
<label for="exampleInputName2">Kategori</label>
|
||||
<select class="form-control" id="msb_kategori_id">
|
||||
<option value="0">-- Pilih Kategori --</option>
|
||||
<?php
|
||||
$d=pg_query("SELECT id,nama,jenis FROM msb_kategori ORDER BY id ASC");
|
||||
while($r=pg_fetch_array($d)) {
|
||||
?>
|
||||
<option value="<?php echo $r[0]; ?>"><?php echo $r[2].' - '.$r[1]?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="tabel_msb_syarat"></div>
|
||||
|
||||
<button class="btn btn-block btn-danger" id="btn_terapkan">Terapkan</button>
|
||||
-->
|
||||
<div id="tabel_msb_hasil"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="modal_terapkan" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<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">Terapkan</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="modal_body_terapkan"></div>
|
||||
<div class="modal-footer no-border">
|
||||
<button type="button" class="btn btn-default waves-effect" data-dismiss="modal" id="keluar_terapkan">Keluar</button>
|
||||
<button type="button" class="btn btn-teal waves-effect waves-light" id="simpan_terapkan">Terapkan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$('#btn_terapkan').hide();
|
||||
|
||||
var thn_dpa = $("#thn_dpa option:selected").text();
|
||||
$('#tabel_msb_hasil').load('app/msb_syarat/tabel_hasil.php', {thn:thn_dpa});
|
||||
|
||||
/*
|
||||
$('#belanja').on('select2:open', function (e) {
|
||||
$('#msb_kategori_id').val('0');
|
||||
$('#msb_kategori_id').trigger('change');
|
||||
$("#tabel_msb_syarat").hide();
|
||||
$('#btn_terapkan').hide();
|
||||
});
|
||||
*/
|
||||
|
||||
$('#simpan_terapkan').click(function(){
|
||||
var belanja=$('#msb_belanja').val();
|
||||
var rh=$('#msb_rh').val();
|
||||
var msb_kategori_id=$('#msb_kategori_id').val();
|
||||
var thn = $("#thn_dpa option:selected").text();
|
||||
var key='simpan_terapkan';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/msb_syarat/crud.php",
|
||||
data: 'belanja='+belanja
|
||||
+'&rh='+rh
|
||||
+'&msb_kategori_id='+msb_kategori_id
|
||||
+'&thn='+thn
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
$('#modal_terapkan').modal('hide');
|
||||
$('body').removeClass('modal-open');
|
||||
$('.modal-backdrop').remove();
|
||||
alert('tersimpan..');
|
||||
var thn_dpa = $("#thn_dpa option:selected").text();
|
||||
$('#tabel_msb_hasil').load('app/msb_syarat/tabel_hasil.php', {thn:thn_dpa});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
include('../koneksi.php');
|
||||
$belanja=$_POST['belanja'];
|
||||
$rh=$_POST['rh'];
|
||||
?>
|
||||
<span style="font-family:InterSB;font-size:14px"><?php echo $belanja; ?></span>
|
||||
<hr>
|
||||
<input type="hidden" id="msb_belanja" value="<?php echo $belanja; ?>">
|
||||
<input type="hidden" id="msb_rh" value="<?php echo $rh; ?>">
|
||||
|
||||
<div class="form-group m-r-10">
|
||||
<label for="exampleInputName2">Kategori Persyaratan</label>
|
||||
<select class="form-control" id="msb_kategori_id">
|
||||
<option value="0">-- Pilih Kategori --</option>
|
||||
<?php
|
||||
$d=pg_query("SELECT id,nama,jenis FROM msb_kategori ORDER BY id ASC");
|
||||
while($r=pg_fetch_array($d)) {
|
||||
?>
|
||||
<option value="<?php echo $r[0]; ?>"><?php echo $r[2].' - '.$r[1]?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="tabel_msb_syarat"></div>
|
||||
|
||||
<script>
|
||||
$("#msb_kategori_id").select2();
|
||||
|
||||
$('#msb_kategori_id').change(function(){
|
||||
var msb_kategori_id = $('#msb_kategori_id').val();
|
||||
$('#tabel_msb_syarat').load('app/msb_syarat/tabel.php',{msb_kategori_id:msb_kategori_id});
|
||||
$("#tabel_msb_syarat").show();
|
||||
$('#btn_terapkan').show();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
include('../koneksi.php');
|
||||
$msb_kategori_id=$_POST['msb_kategori_id'];
|
||||
?>
|
||||
<table id="tabel_data_msb_syarat" class="table table-condensed table-striped table-bordered" style="font-size:13px">
|
||||
<thead style="color:grey;font-family:InterSB">
|
||||
<tr width="40">
|
||||
<td align="center">No</td>
|
||||
<td align="center">Kelengkapan</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="color:black;font-family:Inter">
|
||||
<?php
|
||||
$no=1;
|
||||
$d=pg_query("SELECT id,msb_kategori_id,item FROM msb_item WHERE msb_kategori_id=$msb_kategori_id");
|
||||
while($r=pg_fetch_array($d)) {
|
||||
?>
|
||||
<tr>
|
||||
<td align="center"><?php echo $no; ?></td>
|
||||
<td><?php echo $r[2]; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$no++;
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
include('../koneksi.php');
|
||||
$thn=$_POST['thn'];
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
/*$('button[name="sub"]').popover();
|
||||
$('button[name="revisi_kd_panggil"]').popover();
|
||||
$('button[name="detail"]').popover();*/
|
||||
$('button[name="batalkan"]').popover();
|
||||
$('button[name="tentukan"]').popover();
|
||||
$("#tabel_data_msb_hasil").DataTable({"stateSave": true,"paging": false,"lengthChange": true,"searching": true,"ordering": false,"info": true,"autoWidth": false});
|
||||
</script>
|
||||
|
||||
<table id="tabel_data_msb_hasil" class="table table-condensed table-striped table-bordered" style="font-size:13px">
|
||||
<thead style="color:grey;font-family:InterSB">
|
||||
<tr width="40">
|
||||
<td align="center" width="30">No</td>
|
||||
<td align="center" width="400">Belanja</td>
|
||||
<td align="center" width="30">H</td>
|
||||
<td align="center" width="400">Kategori Persyaratan</td>
|
||||
<td align="center" width="60">Tools</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="color:black;font-family:Inter">
|
||||
<?php
|
||||
$no=1;
|
||||
$d=pg_query("SELECT DISTINCT k.kegiatan,CASE WHEN k.rh!='' THEN CONCAT(k.rh,' - ') ELSE '' END,
|
||||
k.rh, NULLIF(regexp_replace(k.rh,'\D','','g'),'')::numeric, k.msb_kategori_id,m.nama,m.jenis
|
||||
FROM sub_kegiatan k
|
||||
LEFT OUTER JOIN msb_kategori m ON (m.id=k.msb_kategori_id)
|
||||
WHERE k.thn='$thn' ORDER BY NULLIF(regexp_replace(k.rh,'\D','','g'),'')::numeric ASC,k.kegiatan ASC");
|
||||
while($r=pg_fetch_array($d)) {
|
||||
?>
|
||||
<tr>
|
||||
<td align="center" class="kiri"><?php echo $no; ?></td>
|
||||
<td><?php echo $r[0]; ?></td>
|
||||
<td align="center"><?php echo $r[2]; ?></td>
|
||||
<td><?php if (($r[5]==NULL) || ($r[5]=='')) {} else {echo $r[6].' - '.$r[5];} ?></td>
|
||||
<td align="center" class="kanan">
|
||||
<?php
|
||||
if (($r[5]==NULL) || ($r[5]=='')) {
|
||||
?>
|
||||
<button type="button" name="tentukan" style="height:22px;"class="btn btn-default btn-xs tentukan" id="<?php echo $r['kegiatan'].'$%^'.$r['rh'];?>" data-content="Tentukan Kategori" rel="popover" data-placement="top" data-trigger="hover">
|
||||
<i class="fa fa-question"></i>
|
||||
</button>
|
||||
<?php } else { ?>
|
||||
<button type="button" name="batalkan" style="height:22px;"class="btn btn-danger btn-xs batalkan" id="<?php echo $r['kegiatan'].'$%^'.$r['rh'];?>" data-content="Batalkan Kategori" rel="popover" data-placement="top" data-trigger="hover">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$no++;
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$("#tabel_data_msb_hasil").on('click','.tentukan',function(){
|
||||
var data_id = $(this).attr('id');
|
||||
var currentRow=$(this).closest("tr");
|
||||
var belanja = currentRow.find("td:eq(1)").text();
|
||||
var thn_dpa = $("#thn_dpa option:selected").text();
|
||||
var chars = data_id.split('$%^');
|
||||
var rh = chars[1];
|
||||
$('#modal_terapkan').modal('show');
|
||||
$('#modal_body_terapkan').html("");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/msb_syarat/modal.php",
|
||||
data: 'data_id='+data_id
|
||||
+'&belanja='+belanja
|
||||
+'&rh='+rh
|
||||
+'&thn='+thn_dpa,
|
||||
success: function(data){
|
||||
$('#modal_body_terapkan').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#tabel_data_msb_hasil").on('click','.batalkan',function(){
|
||||
var data_id = $(this).attr('id');
|
||||
var currentRow=$(this).closest("tr");
|
||||
var belanja = currentRow.find("td:eq(1)").text();
|
||||
var thn_dpa = $("#thn_dpa option:selected").text();
|
||||
var chars = data_id.split('$%^');
|
||||
var rh = chars[1];
|
||||
var key = 'batal_terapkan';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "app/msb_syarat/crud.php",
|
||||
data: 'belanja='+belanja
|
||||
+'&rh='+rh
|
||||
+'&thn='+thn_dpa
|
||||
+'&key='+key,
|
||||
success: function(data){
|
||||
alert('tersimpan..');
|
||||
var thn_dpa = $("#thn_dpa option:selected").text();
|
||||
$('#tabel_msb_hasil').load('app/msb_syarat/tabel_hasil.php', {thn:thn_dpa});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user