403Webshell
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_2019_sekolah/application/modules/ssh/views/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : D:/wamp/www/sipapbd_2019_sekolah/application/modules/ssh/views/ssh_form.php
<fieldset class='fieldatas' id='fd_skpd'>
  <legend>Entri Standar Satuan Harga</legend>
</fieldset>

<form id="frm" method="post" action="<?php echo base_url(); ?>ssh/proses">
  <div class="controls-row">
    <div class="control-group pull-left"  data-bind="validationElement: id_rek">
      <label class="control-label" for="kode_rek">Kode Rekening</label>
      <input type="text" class="span2" id="kode_rek" readonly="1" data-bind="value: kd_rek, executeOnEnter: pilih_rek" />
      <div class="controls span5 input-append">
        <input type="text" class="span5" id="nama_rek" readonly="1" data-bind="value: nm_rek, executeOnEnter: pilih_rek" />
        <span class="add-on" data-bind="click: pilih_rek"><i class="icon-folder-open"></i></span>
      </div>
    </div>
  </div>
  <div class="controls-row">
    <label class="control-label" for="kategori">Kategori</label>
    <div class="control-group pull-left">
      <input type="text" id="kategori" name="kategori" data-bind="value: kat" class="span7"/>
    </div>
  </div>

<table id="tableSsh"></table>
<div id="pagerSsh"></div>

<br/>
<div class="controls-row pull-right">
  <input type="button"  data-bind="click: simpan" id="simpan_form" value="Simpan" class="btn btn-primary"/>
  <input type="button" name="back" id="back" value="Kembali" class="btn btn-primary"/>
</div>
</form>

<script type="text/javascript">
function refresh (timeoutPeriod)
{
refresh = setTimeout(function(){window.location.reload(true);},timeoutPeriod);
}
jQuery(document).ready(function() {
  var sel_RincianAnggaran;
  var oldarray = new Array();
  var idrek = new Array();
  var datarek = [];

  var i=0;
  var last;
  var ubah = false;
  var s_next = false;
  var s_prev = false;
  var data_dasar = <?php echo isset($akses) ? $akses : 0; ?>;
  jQuery('#back').click(function() {
    location.href='<?php echo base_url();?>ssh';
  });

  jQuery("#tableSsh").jqGrid({
    url:'clientArray',
    datatype:'local',
    mtype:'POST',
    colNames:['URAIAN','KODE STANDAR','SATUAN','HARGA SATUAN'],
    colModel:[
      {name:'URAIAN',index:'URAIAN',width:550,search:false,hidden:false,sortable: false,editable:true,edittype:'text',editoptions:{maxlength:200},},
      {name:'KODE_STANDAR',index:'KODE_STANDAR',width:200,search:false,sortable: false,editable:true,edittype:'text',editoptions:{maxlength:20},},
      {name:'SATUAN', index:'SATUAN',width:200,editable:true,align:'left',edittype:'text',editoptions:{class :'autocomplete',dataInit: function (elem) {
          value: ListarProveedores2(elem);
                }},sortable: false},
      {name:'HARGA_SATUAN',index:'HARGA_SATUAN',width:200,search:false,sortable: false,editable:true,edittype:'text',editoptions:{maxlength:18},formatter: "currency",align:"right"},
    ],
    scroll:1,
    pager:'#pagerSsh',
    shrinkToFit:false,
    viewrecords:true,
    rownumbers:true,
    gridview:true,
    width:null,
    height:'220',
    onSelectRow:function(id){
      if(id !== last)
      {
        jQuery('#tableSsh').jqGrid('saveRow', last, sukses, 'clientArray', null, after_sukses);
        sel_RincianAnggaran = jQuery('#tableSsh').jqGrid('getGridParam','selrow');
      }
    },
    ondblClickRow: function(id){
      jQuery('#tableSsh').jqGrid('restoreRow', last);
      jQuery('#tableSsh').jqGrid('editRow', id, true, null, null, 'clientArray',

      function(){
        setTimeout(function(){
          jQuery('#tableSsh').focus();
        },100);
      },

            after_sukses, null, after_restore);
      last = id;
    },
    gridComplete: function()
    {
      jQuery('#tableSsh').jqGrid('setSelection',sel_RincianAnggaran);
    }
  });

  function ListarProveedores2(elem) {
    jQuery("#tableSsh").jqGrid('unbindKeys');
    jQuery(elem).autocomplete({
      minLength: 0,
      source: '<?php echo base_url()?>ssh/get_satuan',
      focus: function( event, ui ) {
        jQuery(elem).val(ui.item.label);
        return false;
      },
      change: function (event, ui) {
        if(!ui.item.label){
          jQuery(event.target).val('');
        }
      },
      select: function( event, ui ) {
        jQuery(elem).val( ui.item.label );
        return false;
      }
    })
    .data('ui-autocomplete')._renderItem = function( ul, item ) {
      return jQuery('<li>')
      .append('<a>' + item.label + '</a>' )
      .appendTo( ul );
    };
  }

  bind();
  function bind(){
    jQuery("#tableSsh").jqGrid('bindKeys', {
      onEnter: function(id) {
        editingRowId = id;
        jQuery("#tableSsh").jqGrid('editRow',id,true,null, null, 'clientArray', function(){
          setTimeout(function(){
            jQuery("#tableSsh").focus();
          },100);
        },after_sukses, null, after_restore);
      }
    });
  }

  jQuery("#tableSsh").jqGrid( 'navGrid', '#pagerSsh', {
    edit:false,
    add:true,
    addfunc:add,
    addtext:'Tambah',
    del:true,
    deltext:'Hapus',
    delfunc:Hapus,
    search:false,
    refresh:false
  });

  function add()
  {
    catatan = new Array();
    var tabel = jQuery('#tableSsh').jqGrid('getDataIDs');
    count = tabel.length;
    //catatan = {SATUAN:(count+1),HARGA_SATUAN:""};
    catatan = {HARGA_SATUAN:""};
    jQuery('#tableSsh').jqGrid('restoreRow', last);
    jQuery("#tableSsh").jqGrid('addRowData',count+1,catatan);
    jQuery("#tableSsh").jqGrid('editRow', count+1, true, null, null, 'clientArray', null, after_sukses, null, after_restore);
    last = count+1;

  }

  function Hapus(id)
  {
    if(id)
    {
      var id_fa = jQuery('#id').val();
      var rc = jQuery("#tableSsh").jqGrid('getRowData', id);
      var answer = confirm('Hapus dari daftar?');
      if(answer == true)
      {
        jQuery('#tableSsh').jqGrid('delRowData', id);
      }
    }
  }

  function after_sukses()
  {
    last = null;
    ubah = true;
    jQuery(this).focus();
    bind();
  }

  function after_restore()
  {
    last = null;
    bind();
  }

  function sukses()
  {
    jQuery('#tableSsh').jqGrid('restoreRow', last);
  }

  $('#tableSsh').gridResize();

  ko.validation.init({
    insertMessages: false,
    decorateElement: true,
    errorElementClass: 'error',
  });

  var ModelSSH = function (){
    var self = this;
    self.processing = ko.observable(false);
    self.id_rek = ko.observable(<?php echo isset($data['ID_REKENING']) ? $data['ID_REKENING'] : '' ?>)
      .extend({
      required: {params: true, message: 'Rekening belum dipilih'}
    });
    self.kd_rek = ko.observable('<?php echo isset($data['KODE_REKENING']) ? json_encode($data['KODE_REKENING']) : '' ?>')
    .extend({
      required: {params: true, message: 'Kode Rekening belum dipilih'}
    });
    self.nm_rek = ko.observable(<?php echo isset($data['NAMA_REKENING']) ? json_encode($data['NAMA_REKENING']) : '' ?>);
    self.kat = ko.observable('<?php echo isset($data['KATEGORI']) ? json_encode($data['KATEGORI']) : '' ?>')
      .extend({
        required: {params: true, message: 'Kategori belum dipilih'}
      });
    self.akses_level = ko.observable(<?php echo isset($akses) ? $akses : 0 ?>);
    self.canSave = ko.computed(function(){
      return self.akses_level() >= 3;
    });
  }

  var App = new ModelSSH();

  App.pilih_rek = function(){
    moda = 'rka221';
    var option = {multi:0, mode:moda, tree:1};
    Dialog.pilihRekening(option, function(obj, select){
      var rs = $(obj).jqGrid('getRowData', select[0].id);
      App.id_rek(rs.idrek);
      App.kd_rek(rs.kdrek);
      App.nm_rek(rs.nmrek);
    });
  }


  App.formValidation = function(){
    var errmsg = [];
    if (App.kd_rek() === ''){
      errmsg.push('Kode Rekening belum dipilih.');
    }
    if (App.kat() === ''){
      errmsg.push('Kategori belum di entri.');
    }
    if (jQuery("#tableSsh").jqGrid('getGridParam', 'reccount') === 0) {
      errmsg.push('Belum ada uraian yang di entri.');
    }

    var ik = new Array();
    ik = jQuery("#tableSsh").jqGrid('getGridParam', 'savedRow');

    if(ik.length > 0){
      if(ik[0].id){
        jQuery('#tableSsh').jqGrid('saveRow', ik[0].id, sukses, 'clientArray', null, after_sukses);
      }
    }

    if (errmsg.length > 0) {
      $.pnotify({
      title: 'Perhatian',
      text: errmsg.join('</br>'),
      type: 'warning'
      });
      return false;
    }
    return true;
  }

  App.simpan = function(){
    if (!App.formValidation()){ return }

    var $frm = $('#frm'),
      data = JSON.parse(ko.toJSON(App));
      data['ssh'] = JSON.stringify($('#tableSsh').jqGrid('getRowData'));


    $.ajax({
      url: $frm.attr('action'),
      type: 'post',
      dataType: 'json',
      data: data,
      success: function(res, xhr){
        if (res.id) App.id(res.id);

        $.pnotify({
          title: res.isSuccess ? 'Sukses' : 'Gagal',
          text: res.message,
          type: res.isSuccess ? 'info' : 'error'
        });
      }
    });
  }
  ko.applyBindings(App);
});
</script>

Youez - 2016 - github.com/yon3zu
LinuXploit