<?php $url = 'http://'.$_SERVER['SERVER_NAME'].':80'.$_SERVER['REQUEST_URI'];?>

<div id="tb">
    <div title="Transaction" data-options="closable:false" style="padding:10px">
        <div style="height:50%;padding-bottom:10px">
        <table id="dg_hdr"></table> 
        
        <div id="toolbar_hdr">  
          <!-- Material -->
          <?php if($this->url == site_url('matin')){ ?>
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t18') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTbh" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="addForm()">Add</a>  
          <?php }?>
          <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u18') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnUbh" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editForm()">Edit</a> 
          <?php }?>
          <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h17') == 1 && $this->session->userdata('h18') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnHps" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
          <?php }?> 
          <a href="javascript:void(0)" id="btnExcelCeisa" class="easyui-linkbutton" iconCls="icon-xls" plain="true" title="Print">Excel Ceisa</a>
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t18') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTransferCeisa" class="easyui-linkbutton" iconCls="icon-ok" plain="true" style="width:140px">Transfer to Ceisa</a>
          <?php } ?>
          <?php } ?>
          <!-- Material Sub Kontrak-->
          <?php if($this->url == site_url('matinsk')){ ?>
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t19') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTbh" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="addForm()">Add</a>  
          <?php }?>
          <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u19') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnUbh" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editForm()">Edit</a> 
          <?php }?>
          <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h17') == 1 && $this->session->userdata('h19') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnHps" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
          <?php }?> 
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t19') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTransferCeisa" class="easyui-linkbutton" iconCls="icon-ok" plain="true" style="width:140px">Transfer to Ceisa</a>
          <?php } ?>
          <?php } ?>
          <!-- Finished Goods-->
          <?php if($this->url == site_url('fgin')){ ?>
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t20') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTbh" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="addForm()">Add</a>  
          <?php }?>
          <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u20') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnUbh" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editForm()">Edit</a> 
          <?php }?>
          <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h17') == 1 && $this->session->userdata('h20') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnHps" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
          <?php }?> 
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t20') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnJournal" class="easyui-linkbutton" iconCls="icon-ok" plain="true" style="width:120px">Create Journal</a>
          <?php } ?>
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t20') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTransferCeisa" class="easyui-linkbutton" iconCls="icon-ok" plain="true" style="width:140px">Transfer to Ceisa</a>
          <?php } ?>
          <?php } ?>
          <!-- Machine & Equipments-->
          <?php if($this->url == site_url('macin')){ ?>
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t21') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTbh" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="addForm()">Add</a>  
          <?php }?>
          <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u21') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnUbh" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editForm()">Edit</a> 
          <?php }?>
          <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h17') == 1 && $this->session->userdata('h21') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnHps" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
          <?php }?> 
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t21') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTransferCeisa" class="easyui-linkbutton" iconCls="icon-ok" plain="true" style="width:140px">Transfer to Ceisa</a>
          <?php } ?>
          <?php } ?>
          <!-- Scraps-->
          <?php if($this->url == site_url('scin')){ ?>
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t22') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTbh" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="addForm()">Add</a>  
          <?php }?>
          <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u22') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnUbh" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editForm()">Edit</a> 
          <?php }?>
          <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h17') == 1 && $this->session->userdata('h22') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnHps" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
          <?php }?>
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t22') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTransferCeisa" class="easyui-linkbutton" iconCls="icon-ok" plain="true" style="width:140px">Transfer to Ceisa</a>
          <?php } ?> 
          <?php } ?>
          <!-- WIP-->
          <?php if($this->url == site_url('wipin')){ ?>
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t23') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTbh" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="addForm()">Add</a>  
          <?php }?>
          <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u23') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnUbh" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editForm()">Edit</a> 
          <?php }?>
          <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h17') == 1 && $this->session->userdata('h23') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnHps" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
          <?php }?> 
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t23') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTransferCeisa" class="easyui-linkbutton" iconCls="icon-ok" plain="true" style="width:140px">Transfer to Ceisa</a>
          <?php } ?>
          <?php } ?>
          <!-- All In -->
          <a href="javascript:void(0)" id="btnPrint" class="easyui-linkbutton" iconCls="icon-print" plain="true" title="Print">Print Slip</a>
          <span style="display:inline-block;">
          <div style="display:inline-block">
            <label class="control-label">Jenis BC</label>
            <input class="form-control" id="KdJnsDok2" style="width:90%">
          </div>
          &nbsp; &nbsp; &nbsp;
          <input id="q">
          </span>
        </div>
        
        <div id="dlg" class="easyui-dialog" style="width:100%;" inline="false" closed="true" modal="true" buttons="#dlg-buttons">
        <form id="fm" class="form-horizontal" role="form" method="post" style="padding:10px;">
            <input type="submit" id="btnSubmit" name="btnSubmit" style="display:none">
            <input type="hidden" id="matin_id" name="matin_id">
            <table style="table-layout: fixed; width: 100%;">
              <tr>
                <td><label class="control-label">Incoming No.</label></td>
                <td><input class="form-control easyui-textbox" id="matin_no" name="matin_no" style="width:90%" readonly></td>
                <td><label class="control-label">Incoming Type</label></td>
                <td><input class="form-control" name="matin_type" id="matin_type" style="width:90%" required></td>
                <td><label class="control-label">Incoming Date</label></td>
                <td><input class="form-control easyui-datebox" id="matin_date" name="matin_date" maxlength="10" style="width:90%" required></td>
              </tr>
              <tr>
                <?php if($this->url == site_url('matin')){ ?>
                <td><label class="control-label">PO No.</label></td>
                <td>
                  <input class="form-control" name="po_id" id="po_id" style="width:90%" required>
                  <input type="hidden" name="po_no" id="po_no" style="width:90%">
                </td>
                <?php } else { ?>
                <td><label class="control-label">PO No.</label></td>
                <td>
                  <input type="input" name="po_no" style="width:90%">
                </td>
                <?php } ?>
                <td><label class="control-label">Shipper</label></td>
                <td><input class="form-control" name="supplier" id="supplier" style="width:90%"></td>
                <td><label class="control-label">DO Seller No.</label></td>
                <td><input class="form-control easyui-textbox" id="supl_do" name="supl_do" maxlength="10" style="width:90%"></td>
              </tr>
              <tr>
                <td><label class="control-label">Inv No.</label></td>
                <td><input class="form-control easyui-textbox" id="supl_inv" name="supl_inv" style="width:90%"></td>
                <td><label class="control-label">Currency</label></td>
                <td><input class="form-control" name="currency" id="currency" style="width:90%"></td>
                <td><label class="control-label">Kurs</label></td>
                <td><input class="form-control easyui-textbox" id="kurs" name="kurs" style="width:90%"></td>
              </tr>
              <tr>
                <td><label class="control-label">Jenis BC</label></td>
                <td><input class="form-control" id="KdJnsDok" name="KdJnsDok" style="width:90%"></td>
                <td><label class="control-label">No. Dok. Pabean</label></td>
                <td><input class="form-control easyui-textbox" name="NoDaf" id="NoDaf" style="width:90%"></td>
                <td><label class="control-label">Tgl. Dok. Pabean</label></td>
                <td><input class="form-control easyui-datebox" id="TgDaf" name="TgDaf" maxlength="10" style="width:90%"></td>
              </tr>
              <tr>
                <td><label class="control-label">No. Pengajuan</label></td>
                <td><input class="form-control easyui-textbox" name="NoAju" id="NoAju" style="width:90%"></td>
                <td><label class="control-label">Tgl. Pengajuan</label></td>
                <td><input class="form-control easyui-datebox" id="TgAju" name="TgAju" maxlength="10" style="width:90%"></td>
                <td><label class="control-label">Bruto</label></td>
                <td><input class="form-control" id="Bruto" name="Bruto" style="width:90%"></td>
              </tr>
              <tr>
                <td><label class="control-label">CIF</label></td>
                <td><input class="form-control" id="cif" name="cif" style="width:90%"></td>
                <td><label class="control-label">Harga Penyerahan</label></td>
                <td><input class="form-control easyui-numberbox" name="HargaSerah" id="HargaSerah" style="width:90%"></td>
                <td><label class="control-label">Jumlah Barang</label></td>
                <td><input class="form-control easyui-numberbox" name="JmlBarang" id="JmlBarang" style="width:90%"></td>
              </tr>
              <tr>
                <td><label class="control-label">Netto</label></td>
                <td><input class="form-control" id="Netto" name="Netto" style="width:90%"></td>
                <td><label class="control-label col-md-2">Tgl. TTD</label></td>
                <td><input class="form-control easyui-datebox" id="TgTTD" name="TgTTD" maxlength="10" style="width:90%"></td>
                <td><label class="control-label">Jenis Kemasan</label></td>
                <td><input class="form-control" name="packing" id="packing" style="width:90%"></td>
              </tr>

              <?php if($this->url == site_url('fgin')){ ?>
              <tr>
                <td><label class="control-label">Debit</label></td> 
                <td><input class="form-control" name="accountd_id" id="accountd_id" style="width:90%"></td>
                <td><input class="form-control easyui-textbox" name="acctnamed" id="acctnamed" style="width:90%" readonly></td>
              </tr>
              <tr>
                <td><label class="control-label">Credit</label></td>
                <td><input class="form-control" name="accountc_id" id="accountc_id" style="width:90%"></td>
                <td><input class="form-control easyui-textbox" name="acctnamec" id="acctnamec" style="width:90%" readonly></td>
              </tr>
              <?php } ?>
              <?php if($this->url == site_url('wipin')){ ?>
              <tr>
                <td><label class="control-label">Debit</label></td> 
                <td><input class="form-control" name="accountd_id" id="accountd_id_wip" style="width:90%"></td>
                <td><input class="form-control easyui-textbox" name="acctnamed" id="acctnamed_wip" style="width:90%" readonly></td>
              </tr>
              <tr>
                <td><label class="control-label">Credit</label></td>
                <td><input class="form-control" name="accountc_id" id="accountc_id_wip" style="width:90%"></td>
                <td><input class="form-control easyui-textbox" name="acctnamec" id="acctnamec_wip" style="width:90%" readonly></td>
              </tr>
              <?php } ?>
            </table>
        </form>
        </div>
        <div id="dlg-buttons">
            <a href="#" id="btnSim" class="easyui-linkbutton c6" iconCls="icon-ok">Simpan</a>
            <a href="javascript:void(0)" id="btnReset" class="easyui-linkbutton" iconCls="icon-cancel">Kosongkan</a>
        </div>

        </div>
        <div style="height:50%">
            <table id="dg_det"></table>
            <div id="toolbar_det">  
                <!-- Material -->
              <?php if($this->url == site_url('matin')){ ?>
              <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u18') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnUbh2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Edit Qty</a> 
              <a href="javascript:void(0)" id="btnRst2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Reset Qty</a> 
              <?php } ?>
              <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t18') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnSpr2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Input All Qty</a> 
              <?php }?>
              <?php }?>
              <!-- Material Sub Kontrak -->
              <?php if($this->url == site_url('matinsk')){ ?>
              <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t19') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnTbh2" class="easyui-linkbutton" iconCls="icon-add" plain="true">Add</a>  
              <?php } ?>
              <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u19') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnUbh2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Edit Qty</a> 
              <a href="javascript:void(0)" id="btnRst2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Reset Qty</a> 
              <?php } ?>
              <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t19') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnSpr2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Input All Qty</a> 
              <?php }?>
              <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h17') == 1 && $this->session->userdata('h19') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnHps2" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
              <?php }?>
              <?php }?>
              <!-- Finished Goods -->
              <?php if($this->url == site_url('fgin')){ ?>
              <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t20') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnTbh2" class="easyui-linkbutton" iconCls="icon-add" plain="true">Add</a>  
              <?php } ?>
              <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u20') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnUbh2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Edit Qty</a> 
              <a href="javascript:void(0)" id="btnRst2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Reset Qty</a> 
              <?php } ?>
              <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t20') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnSpr2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Input All Qty</a> 
              <?php }?>
              <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h17') == 1 && $this->session->userdata('h20') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnHps2" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
              <?php }?>
              <?php }?>
              <!-- Machine and Equipments -->
              <?php if($this->url == site_url('macin')){ ?>
              <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t21') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnTbh2" class="easyui-linkbutton" iconCls="icon-add" plain="true">Add</a>  
              <?php } ?>
              <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u21') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnUbh2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Edit Qty</a> 
              <a href="javascript:void(0)" id="btnRst2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Reset Qty</a> 
              <?php } ?>
              <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t21') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnSpr2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Input All Qty</a> 
              <?php }?>
              <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h17') == 1 && $this->session->userdata('h21') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnHps2" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
              <?php }?>
              <?php }?>
              <!-- Scrap -->
              <?php if($this->url == site_url('scin')){ ?>
              <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t22') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnTbh2" class="easyui-linkbutton" iconCls="icon-add" plain="true">Add</a>  
              <?php } ?>
              <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u22') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnUbh2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Edit Qty</a> 
              <a href="javascript:void(0)" id="btnRst2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Reset Qty</a> 
              <?php } ?>
              <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t22') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnSpr2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Input All Qty</a> 
              <?php }?>
              <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h17') == 1 && $this->session->userdata('h22') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnHps2" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
              <?php }?>
              <?php }?>
              <!-- WIP -->
              <?php if($this->url == site_url('wipin')){ ?>
              <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t23') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnTbh2" class="easyui-linkbutton" iconCls="icon-add" plain="true">Add</a>  
              <?php } ?>
              <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u17') == 1 && $this->session->userdata('u23') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnUbh2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Edit Qty</a> 
              <a href="javascript:void(0)" id="btnRst2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Reset Qty</a> 
              <?php } ?>
              <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t17') == 1 && $this->session->userdata('t23') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnSpr2" class="easyui-linkbutton" iconCls="icon-edit" plain="true">Input All Qty</a> 
              <?php }?>
              <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h17') == 1 && $this->session->userdata('h23') == 1 ){ ?>
              <a href="javascript:void(0)" id="btnHps2" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
              <?php }?>
              <?php }?>
              <span style="display:inline-block;">
              &nbsp; &nbsp; &nbsp;
              <input id="q_det">
              </span>
            </div>
            <div id="dlg2" class="easyui-dialog" style="width:40%; top:5%;" closed="true" buttons="#dlg2-buttons">
            <form id="fm2"class="form-horizontal" role="form" method="post" style="padding:10px;">
                <input type="submit" id="btnSubmit2" name="btnSubmit2" style="display:none">
                <input type="hidden" id="child_no" name="child_no">
                <tr>
	              <?php	if($this->url != site_url('wipin')) { ?>
                  <td><label class="control-label ">Item Code</label></td><br>
                  <td><input class="form-control" id="mat_id" name="mat_id" style="width:90%" required></td><br>
                  <td><label class="control-label ">Item Description</label></td><br>
                  <td><input class="form-control easyui-textbox" id="NmBarang" name="NmBarang" style="width:100%" readonly></td><br>
                  <td><label class="control-label ">UOM</label></td><br>
                  <td><input class="form-control" id="Sat" name="Sat" style="width:40%" readonly></td><br>
                  <?php if($this->url == site_url('matin')){ ?>
                  <td><label class="control-label ">PO Qty.</label></td><br>
                  <td><input class="form-control" id="poqty" name="poqty" style="width:40%" readonly style="color:brown"></td><br>
                  <td><label class="control-label ">Qty.</label></td><br>
                  <td><input class="form-control" id="qty" name="qty" style="width:40%" style="color:brown"></td><br>
                  <td><label class="control-label ">In Qty.</label></td><br>
                  <td><input class="form-control" id="Dqty2" name="Dqty" style="width:40%" readonly disable></td> before<br>
                  <td><input class="form-control" id="Dqty" name="Dqty" style="width:40%"></td><br>
                  <td><label class="control-label ">Balance.</label></td><br>
                  <td><input class="form-control" id="Bqty" name="balance" style="width:40%" readonly style="color:brown"></td><br>
                  <td><label class="control-label ">Price</label></td><br>
                  <td><input class="form-control" id="price" name="price" style="width:40%"></td><br>
                  <td><label class="control-label ">Amount</label></td><br>
                  <td><input class="form-control" id="amount" name="amount" style="width:40%" readonly></td><b></b>
                  <?php } else { ?>
                  <div style="display:none">
                    <!-- <td><input id="Bqty" disabled></td><br> -->
                  </div>
                  <td><label class="control-label ">Qty.</label></td><br>
                  <td><input class="form-control" id="qty2" name="qty" style="width:40%" style="color:brown"></td><br>
                  <td><label class="control-label ">Price</label></td><br>
                  <td><input class="form-control" id="price2" name="price" style="width:40%"></td><br>
                  <td><label class="control-label ">Amount</label></td><br>
                  <td><input class="form-control" id="amount2" name="amount" style="width:40%" readonly></td><b></b>
                  <?php } ?>
                <?php } else { ?>
                  <div style="display:none">
                    <!-- <td><input id="Bqty" disabled></td><br> -->
                  </div>
                  <td><label class="control-label ">BOM No</label></td><br>
                  <td><input class="form-control" id="bom_id" name="bom_id" style="width:90%" required></td><br>
                  <td><input type="hidden" class="form-control" id="ref_type" name="ref_type" style="width:90%" value="0" required></td><br>
                  <td><input type="hidden" class="form-control" id="ref_no" name="ref_no" style="width:90%" required></td><br>
                  <td><input type="" class="form-control" id="bom_no" name="bom_no" style="width:90%" required></td><br>
                  <td><label class="control-label ">BOM Date</label></td><br>
                  <td><input class="form-control easyui-textbox" id="bom_date" name="bom_date" style="width:100%" readonly></td><br>
                  <td><label class="control-label ">FG Name</label></td><br>
                  <td><input class="form-control easyui-textbox" id="fg_name" name="" style="width:100%" readonly></td><br>
                  <td><input type="hidden" class="form-control easyui-textbox" id="fg_id" name="fg_id" style="width:100%" readonly></td><br>
                  <td><label class="control-label ">BOM Date</label></td><br>
                  <td><input class="form-control easyui-textbox" id="bom_date" name="bom_date" style="width:100%" readonly></td><br>
                  <td><label class="control-label ">Satuan</label></td><br>
                  <td><input class="form-control easyui-textbox" id="Sat" name="Sat" style="width:100%" readonly></td><br>
                <?php } ?>
                </tr>
            </form>
            </div>
            <div id="dlg2-buttons">
                <a href="#" id="btnSim2" class="easyui-linkbutton c6" iconCls="icon-ok">Simpan</a>
                <a href="javascript:void(0)" id="btnReset2" class="easyui-linkbutton" iconCls="icon-cancel">Kosongkan</a>
            </div>
            
            <div id="dlg3" class="easyui-dialog" style="width:40%;" closed="true" buttons="#dlg3-buttons">
            <form id="fm3"class="form-horizontal" role="form" method="post" style="padding:10px;">
                <input type="submit" id="btnSubmit3" name="btnSubmit3" style="display:none">
                <div class="form-group">
                    <label class="control-label col-md-3">Barcode Item</label>
                  <div class="col-md-8">
                    <input class="form-control" id="barcode" name="barcode" style="width:90%" required><label class="checkbox-inline"><input type="checkbox" id="fifo" name="fifo" value="1">FIFO</label>
                  </div>
                </div>                  
            </form>
            </div>
            <div id="dlg3-buttons">
                <a href="#" id="btnSim3" class="easyui-linkbutton c6" iconCls="icon-ok">Simpan</a>
                <a href="javascript:void(0)" id="btnReset3" class="easyui-linkbutton" iconCls="icon-cancel">Kosongkan</a>
            </div>
        </div>
    </div>
    <div title="List View" data-options="closable:false" style="padding:10px">
        <table id="dg_hdrdet"></table>
        <div id="toolbar_hdrdet">  
            <a href="javascript:void(0)" id="btnPrint2" class="easyui-linkbutton" iconCls="icon-print" plain="true" title="Print">Print</a> 
            <a href="javascript:void(0)" id="btnExcel" class="easyui-linkbutton" iconCls="icon-xls" plain="true" title="Excel">Excel</a>
            <span style="display:inline-block;">
            &nbsp; &nbsp; &nbsp;
            <input id="q2">
            </span>
        </div> 
    </div>    
</div>