Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once("../lib/fn_lib.php");
- session_start();
- isAjax();
- privilegesPage();
- $data1="PO Customer".date("Y-m-d H:i:s");
- $_SESSION['token_input'] = generate_token($data1);
- ?>
- <style type="text/css">
- a{
- text-decoration: none;
- }
- a:hover{
- text-decoration: underline;
- }
- #field_form {
- background:#EBF4FB none repeat scroll 0 0;
- border:2px solid #B7DDF2;
- width: 90%;
- margin-bottom: 2px;
- }
- .field_form_confirm {
- border:2px solid #B7DDF2;
- width: 700px;
- margin-bottom: 2px;
- }
- legend {
- color: #fff;
- background: #888888;
- border: 1px solid #781351;
- padding: 2px 2px
- }
- </style>
- <script type="text/javascript">
- // grid detail po customer atau item barang
- $(function(){
- $('#tt').datagrid({
- url: 'data/data_tr_po_customer2_temp.php',
- rownumbers: true,
- pagination:true,
- width:750,
- striped:true,
- toolbar:'#toolbar2',
- frozenColumns:[[
- {field:'ck',checkbox:'true',title:'all',width:75,align:'center'},
- {field:'id',title:'id',width:205, hidden:true},
- {field:'kode_produk',title:'Kode Produk',width:100},
- {field:'produk',title:'Produk',width:175},
- {field:'satuan',title:'Satuan',width:100},
- {field:'qty',title:'Qty',width:250}
- ]]
- });
- //tambah po customer
- $('#form_po_customer2').form({
- url:'process/fse_po_customer2.php',
- onSubmit:function(){
- return $(this).form('validate');
- },
- success: function(result){
- var result = eval('('+result+')');
- if (result.success){
- $.messager.show({
- title: 'Success',
- msg: result.msg
- });
- $('#tt').datagrid('reload');
- $('#tt3').datagrid('reload');
- $('#form_po_customer2').form('clear');
- } else {
- $.messager.show({
- title: 'Error',
- msg: result.msg
- });
- }
- }
- });
- })
- // tombol edit po customer
- $("#tb_edit_detail_po_customer").live('click',function(){
- $('#dlg-buttons').show();
- var row = $('#tt').datagrid('getSelected');
- if (row){
- var f_url = 'po_customer_detail_temp';
- $.ajax({
- url: "template/form/fa_"+f_url+".php?id="+row.id,
- dataType: 'json',
- timeout: 2000,
- error: function() {
- },
- success: function(xr){
- var ctn = xr.content;
- editUser(xr.ftitle,f_url+".php?id="+row.id,ctn.replace(/\\/,""),xr.dtitle);
- }
- })
- }
- })
- function tb_hapus_po_customer3(){
- $.messager.confirm('Konfirmasi','Yakin untuk menghapus?',function(hapusOK){
- if (hapusOK){
- var ids = [];
- var rowss = $('#tt3').datagrid('getSelections');
- for(var i=0; i<rowss.length; i++){
- ids.push(rowss[i].id);
- }
- $.ajax({
- type: 'POST',
- url: 'process/del_po_customer.php',
- data:{ var_array:ids },
- success: function(result){
- var result = eval('('+result+')');
- if (result.success){
- $.messager.show({
- title: 'Success',
- msg: result.msg
- });
- $('#tt3').datagrid('reload');
- } else {
- $.messager.show({
- title: 'Error',
- msg: result.msg
- });
- }
- }
- });
- }
- })
- };
- $(function(){
- $('#tb-detil-po_customer').linkbutton({
- iconCls: 'icon-hamburg-zoom'
- });
- $('#tb_edit_detail_po_customer').linkbutton({
- iconCls: 'icon-edit'
- });
- $('#tb_tambah_detail_po_customer').linkbutton({
- iconCls: 'icon-add'
- });
- $('#tb_hapus_detail_po_customer').linkbutton({
- iconCls: 'icon-remove'
- });
- $('#order_customer2').linkbutton({
- iconCls: 'icon-hamburg-refresh'
- });
- $("#tb_tambah_detail_po_customer").live('click',function(){
- $('#dlg-buttons').show();
- var f_url = 'po_customer_detail_temp';
- buildForm(f_url);
- })
- $('#submit').linkbutton({
- iconCls: 'icon-standard-new'
- });
- $('#tipe').combobox({
- panelHeight:'auto'
- });
- $('#id_credit_status').combobox({
- panelHeight:'auto'
- });
- $('#status_po_customer').combobox({
- panelHeight:'auto'
- });
- $('#tgl_po_customer').datebox({})
- $('#id_customer').combogrid({
- panelWidth:450,
- width:250,
- url: 'template/json/combogrid/cb_customer.php',
- idField:'id',
- textField:'nama_customer',
- mode:'remote',
- fitColumns:true,
- columns:[[
- {field:'kode_customer',title:'Kode',align:'left',width:80},
- {field:'nama_customer',title:'Customer',align:'left',width:250}
- ]]
- });
- $('#detailproduk1,#detailproduk2,#detailproduk3,#detailproduk4').combogrid({
- panelWidth:250,
- width:250,
- url: 'template/json/combogrid/cb_produk.php',
- idField:'kode_produk',
- textField:'nama_produk',
- mode:'remote',
- fitColumns:true,
- columns:[[
- {field:'kode_produk',title:'Kode',align:'left',width:60},
- {field:'nama_produk',title:'Produk',align:'left',width:160}
- ]]
- });
- })
- </script>
- <script>
- $(function(){
- $('#tt3').datagrid({
- onLoadSuccess:function(){
- var merges = [];
- for(var i=0; i<merges.length; i++)
- $('#tt3').datagrid('mergeCells',{
- });
- }
- });
- });
- $('#tb_edit_po_customer3').linkbutton({
- iconCls: 'icon-edit'
- });
- $('#tb_tambah_po_customer3').linkbutton({
- iconCls: 'icon-add'
- });
- $('#tb_hapus_po_customer3').linkbutton({
- iconCls: 'icon-remove'
- });
- $("#tb_edit_po_customer3").live('click',function(){
- // $('#dlg-buttons').show();
- var row = $('#tt3').datagrid('getSelected');
- if (row){
- $('#form_po_customer2').form('clear');
- $('#form_po_customer2').form('load',row);
- var f_url = 'tr_po_customer2';
- $.ajax({
- url: "data/"+f_url+".php?id="+row.id,
- dataType: 'json',
- timeout: 2000,
- error: function() {
- },
- success: function(xr){
- var ctn = xr.content;
- editUser(xr.ftitle,f_url+".php?id="+row.id,ctn.replace(/\\/,""),xr.dtitle);
- }
- })
- $('#tt').datagrid({
- url: "data/data_tr_po_customer2_temp_edit.php?token_input="+row.token_input,
- rownumbers: true,
- pagination:true,
- striped:true,
- toolbar:'#toolbar2',
- frozenColumns:[[
- {field:'ck',checkbox:'true',title:'all',width:75,align:'center'},
- {field:'id',title:'id',width:205, hidden:true},
- {field:'kode_produk',title:'Kode Produk',width:80},
- {field:'produk',title:'Produk',width:175},
- {field:'satuan',title:'Satuan',width:70},
- {field:'qty',title:'Qty',width:250}
- ]]
- });
- }
- })
- </script>
- <form id="form_po_customer2" method="POST" class="uniForm">
- <table width="60%" border="0">
- <tr>
- <td>
- <fieldset id="field_form"><legend><b>Purchase Order Customer</b></legend>
- <table width="100%" border="0">
- <tr>
- <td width="15%"><strong>No. PO Cust</strong></td>
- <td width="35%">
- <input type='hidden' name='id' id='id'>
- <input type='text' name='token_input' id='token_input' value="<?php echo $_SESSION['token_input'];?>">
- <input name="nopo" class="easyui-validatebox" data-options="required: true, width: 200, prompt: 'prompt1...'" autocomplete="off"/>
- </td>
- <td width="15%"><strong>PO. Date</strong></td>
- <td width="35%">
- <input class='easyui-validatebox' required='true' name='tgl_po_customer' id='tgl_po_customer' style="width: auto;" autocomplete="off"/>
- </td>
- </tr>
- <tr><td><strong>Customer</strong></td>
- <td><input class='easyui-validatebox' required='true' name='id_customer' id='id_customer' size="25"/> </td>
- <td><strong>Keterangan</strong></td>
- <td rowspan="2"><textarea name="keterangan" rows="3" cols="35" autocomplete="off"></textarea></td>
- </tr>
- <tr><td height="21"> </td>
- <td> </td>
- <td> </td>
- </tr>
- <tr align="left">
- <td colspan="4">
- <fieldset id="field_form">
- <legend><b>Detail Item PO Customer</b></legend>
- <table id='tt'>
- </table>
- </fieldset>
- </td>
- </tr>
- <tr align="left">
- <td colspan="4">
- <a href="javascript:void(0)" id="submit" class="easyui-linkbutton" onclick="$('#form_po_customer2').submit();">Save</a>
- <a href="javascript:void(0)" id="order_customer2" class="easyui-linkbutton" onclick="$('#form_po_customer2').form('clear')">Reset</a>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </form>
- <!-- <table id='tt'>
- </table>-->
- <table id="tt3" title="Purchase Order Customer"
- url="./data/data_tr_po_customer2.php"
- singleSelect="true" iconCls="icon-layout" rownumbers="true"
- idField="itemid" pagination="true" toolbar="#toolbar3">
- <thead frozen="true">
- <tr>
- <th field="ck" width="75" align="center" checkbox="true">All</th>
- <th field="kode_customer" width="70" align="center">Cust. Code</th>
- <th field="customer" width="250">Customer</th>
- </tr>
- </thead>
- <thead>
- <tr>
- <th rowspan="2" field="nopo" width="175">PO. Number</th>
- <th rowspan="2" field="tglpo" width="110">PO. Date</th>
- <th colspan="9">Quantity</th>
- <th rowspan="2" field="keterangan" width="150" align="left">Keterangan</th>
- <th rowspan="2" field="statusdelivery" width="100">St.PPBJ</th>
- <th rowspan="2" field="statusdelivery" width="100">St.NPBJ</th>
- <th rowspan="2" field="statusdelivery" width="100">St.NPPB</th>
- <th rowspan="2" field="statusdelivery" width="100">St.Delivery</th>
- </tr>
- <tr>
- <th field="col_ufr" width="80" align="center">UFR</th>
- <th field="col_hdr" width="80" align="center">HDR</th>
- <th field="col_f37" width="80" align="center">F37</th>
- <th field="col_f55" width="80" align="center">F55</th>
- <th field="col_abs" width="80" align="center">ABS</th>
- <th field="col_hdc" width="80" align="center">HDC</th>
- <th field="col_ufp" width="80" align="center">UFP</th>
- <th field="col_mfr" width="80" align="center">MFR</th>
- <th field="col_silvic" width="80" align="center">SILVIC</th>
- </tr>
- </thead>
- </table>
- <!-- tombol menu detail -->
- <div id="toolbar2">
- <a href="#" plain="true" id="tb_tambah_detail_po_customer">Add</a>
- <a href="#" plain="true" id="tb_edit_detail_po_customer">Edit</a>
- <a href="#" plain="true" onclick="tb_hapus_detail_po_customer()" id="tb_hapus_detail_po_customer">Hapus</a>
- </div>
- <!--tombol menu grid besar-->
- <div id="toolbar3">
- <a href="#" plain="true" id="tb_tambah_po_customer3">Add</a>
- <a href="#" plain="true" id="tb_edit_po_customer3">Edit</a>
- <a href="#" plain="true" onclick="tb_hapus_po_customer3()" id="tb_hapus_po_customer3">Hapus</a>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement