| Server IP : 127.0.0.1 / Your IP : 192.168.99.1 Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9 System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64 User : Administrator ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/wamp/www/sipapbd_2021_sekolah/update/application/modules/ssh/views/ |
Upload File : |
<fieldset>
<legend>Standar Satuan Harga</legend>
</fieldset>
<div id="grid_container">
<div id="search" class="row">
</div>
<table id="grid"></table>
<div id="pager"></div>
<div id="loading" class="loading" style="margin-top:10px; margin: auto;"> </div>
</div>
<table id="grid"></table>
<div id="pager"></div>
<div id="loading" class="loading" style="margin-top:10px; margin: auto;"> </div>
<script type="text/javascript">
jQuery(document).ready(function() {
var last;
var data_dasar = <?php echo isset($akses) ? $akses : 0; ?>;
params = {
container : $('#search'),
grid : $('#grid'),
cols : <?php echo json_encode($grid['fields']); ?>,
}
Search.init(params);
jQuery("#grid").jqGrid({
url:'<?php echo base_url()?>ssh/get_daftar',
editurl:'<?php echo base_url()?>ssh/proses_form',
datatype:'json',
mtype:'POST',
colNames:['ID','KODE REKENING','NAMA REKENING','KATEGORI','URAIAN','SATUAN','HARGA',
],
colModel:[
{name:'ID',index:'ID',width:5,search:false,hidden:true},
{name:'KODE_REKENING',index:'KODE_REKENING',width:110,editable:false,edittype:'text',editoptions:{size:150}},
{name:'NAMA_REKENING', index:'NAMA_REKENING',width:350,editable:false,edittype:'text',editoptions:{size:400}},
{name:'KATEGORI',index:'KATEGORI',width:120,editoptions:{size:100},editable:true,edittype:'text'},
{name:'URAIAN',index:'URAIAN',width:280,editoptions:{size:500},editable:true,edittype:'text'},
{name:'SATUAN',index:'SATUAN',width:80,editoptions:{size:80},editable:true,edittype:'text'},
{name:'HARGA',index:'HARGA',width:80,editoptions:{size:80},editable:true,edittype:'text',formatter: "currency", formatoptions:{decimalSeparator:",", thousandsSeparator:"."},align:"right"}
],
rowNum:10,
rowList:[10,20,30],
rownumbers:true,
pager:'#pager',
sortname:'KODE_REKENING',
sortorder:'asc',
viewrecords:true,
shrinkToFit:true,
gridview:true,
multiselect:false,
width:999,
height:'280',
footerrow:false,
ondblClickRow:edit_row,
onSelectRow:restore_row,
gridComplete: function () {
}
});
jQuery("#grid").jqGrid('bindKeys', {"onEnter": edit_row});
jQuery("#grid").jqGrid( 'navGrid', '#pager', {
<?php
if($akses=='2' || $akses=='3')
{
echo"
edit:true,
edittext:'Ubah',
editfunc:edit_row,";?>
add:true,
addtext:'Tambah',
addfunc:function(){
if(data_dasar==3)
{
location.href ='<?php echo base_url()?>ssh/form';
}
else
{
$.pnotify({
title: 'Gagal',
text: 'Tidak bisa ubah data',
type: 'error'
});
}
},
<?php
echo "
del:true,
deltext:'Hapus',
delfunc:del_row,
";
}
else
{
echo"
edit:true,
editicon:'ui-icon-bookmark',
edittext:'Lihat',
edittitle:'Lihat Baris Terpilih',
editfunc:function(id){
var id = jQuery('#grid').jqGrid('getGridParam','selrow');
var data = jQuery('#grid').jqGrid('getRowData',id);
location.href='".base_url()."rka_skpd/form/'+data.ID_FORM_ANGGARAN;
},
add:false,
del:false,
";
}
?>
search:false,
refresh:true,
refreshtext:'Refresh'
},{},{},{},{})
.navButtonAdd('#pager',{
caption:'Cetak',
onClickButton: function(){ preview({"tipe":"daftar"}, jQuery("#grid"))},
title:'Cetak Daftar',
buttonicon:'ui-icon-print',
position:'last'
});
function edit_row(id){
if(data_dasar=='3'){
jQuery('#grid').jqGrid('restoreRow', last);
jQuery('#grid').jqGrid('editRow', id, true, null, null, null, afterrestorefunc, aftersavefunc, errorfunc, null);
last = id;
}else{
$.pnotify({
title: msg.isSuccess ? 'Sukses' : 'Gagal',
text: msg.message,
type: msg.isSuccess ? 'info' : 'error'
});
}
}
function afterrestorefunc(){
$(this).focus();
}
function del_row(id){
if(data_dasar=='3'){
var answer = confirm('Hapus dari daftar?');
if(answer == true)
{
jQuery('#grid').jqGrid('delRowData', id);
jQuery.ajax({
url: '<?php echo base_url()?>ssh/hapus',
data: { id: id},
success: function(response){
var msg = jQuery.parseJSON(response);
$.pnotify({
title: msg.isSuccess ? 'Sukses' : 'Gagal',
text: msg.message,
type: msg.isSuccess ? 'info' : 'error'
});
jQuery('#grid').trigger('reloadGrid');
},
type: "post",
dataType: "html"
});
}
}else{
$.pnotify({
title: 'Gagal',
text: 'Tidak bisa hapus data',
type: 'error'
});
}
}
function restore_row(id){
if(id && id !== last){
jQuery('#grid').jqGrid('restoreRow',last);
last = null;
}
}
function aftersavefunc(id, resp){
var msg = jQuery.parseJSON(resp.responseText);
$.pnotify({
title: msg.isSuccess ? 'Sukses' : 'Gagal',
text: msg.message,
type: msg.isSuccess ? 'info' : 'error'
});
if(msg.id && msg.id != id)
jQuery("#"+id).attr("id", msg.id);
//jQuery('#grid').trigger('reloadGrid');
$(this).focus();
}
function errorfunc(id, resp){
var msg = jQuery.parseJSON(resp.responseText);
if(msg.error){
$.pnotify({
title: 'Gagal',
text: msg.error,
type: 'error'
});
jQuery('#grid').trigger('reloadGrid');
}
}
jQuery('#home').click(function(){
location.href='<?php echo base_url();?>';
});
});
</script>