77 lines
2.7 KiB
PHP
77 lines
2.7 KiB
PHP
<?php
|
|
include('koneksi.php');
|
|
?>
|
|
|
|
|
|
|
|
<div class="row"><div class="col-lg-3">
|
|
<!--<div class="input-group">
|
|
<input type="text" id="thn"class="form-control" placeholder="Tahun">
|
|
<span class="input-group-btn">
|
|
<button type="button" class="btn waves-effect waves-light btn-default" id="view"> <i class="fa fa-search"></i> </button>
|
|
|
|
</span>
|
|
</div> -->
|
|
<div class="form-group search-box" style="margin-top:-2px">
|
|
<input type="text" iid="thn"class="form-control product-search" placeholder="Tahun">
|
|
<button type="button" class="btn btn-search" id="view"><i class="fa fa-search"></i></button>
|
|
</div>
|
|
<button type="button" class="btn waves-effect waves-light btn-danger" id="import"><i class="fa fa-arrow-circle-down m-r-5"></i>Import</button>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div id="tabel_import"></div>
|
|
<script>
|
|
$('#import').hide();
|
|
$('#view').click(function(){
|
|
var thn=$('#thn').val();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/master/import/tabel.php",
|
|
data: 'thn='+thn,
|
|
success: function(data){
|
|
var thn=$('#thn').val();
|
|
var key='cek_jumlah';
|
|
$('#tabel_import').load('app/master/import/tabel.php',{thn:thn});
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/master/import/crud.php",
|
|
data: 'thn='+thn
|
|
+'&key='+key,
|
|
success: function(data){
|
|
if (data=='ada') {
|
|
$('#tabel_import').show();
|
|
$('#import').show();
|
|
} else {
|
|
alert('data tidak ada..');
|
|
$('#import').hide();
|
|
$('#tabel_import').hide();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
$('#thn').focusin(function(){
|
|
$('#thn').val('');
|
|
$('#tabel_import').hide();
|
|
$('#import').hide();
|
|
});
|
|
|
|
|
|
$('#import').click(function(){
|
|
var thn=$('#thn').val();
|
|
var key='import';
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/master/import/crud.php",
|
|
data: 'thn='+thn
|
|
+'&key='+key,
|
|
success: function(data){alert(data);
|
|
alert('import selesai..');
|
|
}
|
|
});
|
|
});
|
|
</script>
|