Advertisement
Guest User

tr_po

a guest
Jun 17th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 14.52 KB | None | 0 0
  1. <?php   require_once("../lib/fn_lib.php");
  2.     session_start();
  3.     isAjax();
  4.     privilegesPage();
  5.         $data1="PO Customer".date("Y-m-d H:i:s");
  6.         $_SESSION['token_input'] = generate_token($data1);
  7. ?>
  8. <style type="text/css">
  9.         a{
  10.          text-decoration: none;  
  11.         }
  12.         a:hover{
  13.          text-decoration: underline;
  14.         }
  15.         #field_form {
  16.             background:#EBF4FB none repeat scroll 0 0;
  17.             border:2px solid #B7DDF2;
  18.             width: 90%;
  19.                 margin-bottom: 2px;
  20.         }
  21.         .field_form_confirm {
  22.             border:2px solid #B7DDF2;
  23.             width: 700px;
  24.                 margin-bottom: 2px;
  25.         }
  26.         legend {
  27.             color: #fff;
  28.             background: #888888;
  29.             border: 1px solid #781351;
  30.             padding: 2px 2px
  31.         }
  32. </style>
  33. <script type="text/javascript">    
  34. // grid detail po customer atau item barang
  35. $(function(){
  36.     $('#tt').datagrid({
  37.         url: 'data/data_tr_po_customer2_temp.php',
  38.         rownumbers: true,
  39.         pagination:true,
  40.         width:750,
  41.         striped:true,
  42.         toolbar:'#toolbar2',
  43.         frozenColumns:[[
  44.             {field:'ck',checkbox:'true',title:'all',width:75,align:'center'},
  45.             {field:'id',title:'id',width:205, hidden:true},  
  46.             {field:'kode_produk',title:'Kode Produk',width:100},  
  47.             {field:'produk',title:'Produk',width:175},  
  48.             {field:'satuan',title:'Satuan',width:100},
  49.             {field:'qty',title:'Qty',width:250}
  50.         ]]
  51.     });
  52.    
  53.     //tambah po customer
  54.     $('#form_po_customer2').form({
  55.             url:'process/fse_po_customer2.php',  
  56.             onSubmit:function(){  
  57.                 return $(this).form('validate');
  58.             },
  59.             success: function(result){
  60.                             var result = eval('('+result+')');
  61.                             if (result.success){
  62.                                 $.messager.show({
  63.                                     title: 'Success',
  64.                                     msg: result.msg
  65.                                 });
  66.                                                 $('#tt').datagrid('reload');
  67.                                                 $('#tt3').datagrid('reload');
  68.                                                 $('#form_po_customer2').form('clear');
  69.                             } else {
  70.                                 $.messager.show({
  71.                                     title: 'Error',
  72.                                     msg: result.msg
  73.                                 });
  74.                             }
  75.                         }
  76.             });
  77. })
  78.  
  79. // tombol edit po customer
  80. $("#tb_edit_detail_po_customer").live('click',function(){
  81.       $('#dlg-buttons').show();  
  82.         var row = $('#tt').datagrid('getSelected');
  83.         if (row){
  84.                 var f_url = 'po_customer_detail_temp';
  85.                 $.ajax({
  86.                     url: "template/form/fa_"+f_url+".php?id="+row.id,
  87.                     dataType: 'json',
  88.                     timeout: 2000,
  89.                     error: function() {
  90.                                
  91.                     },
  92.                     success: function(xr){
  93.                         var ctn = xr.content;
  94.                         editUser(xr.ftitle,f_url+".php?id="+row.id,ctn.replace(/\\/,""),xr.dtitle);
  95.                     }  
  96.                 })
  97.             }
  98.            
  99.         })
  100.  
  101. function tb_hapus_po_customer3(){
  102.             $.messager.confirm('Konfirmasi','Yakin untuk menghapus?',function(hapusOK){
  103.         if (hapusOK){
  104.         var ids = [];  
  105.                 var rowss = $('#tt3').datagrid('getSelections');  
  106.                     for(var i=0; i<rowss.length; i++){  
  107.                     ids.push(rowss[i].id);  
  108.                 }
  109.                 $.ajax({
  110.                   type: 'POST',
  111.                   url: 'process/del_po_customer.php',
  112.                   data:{ var_array:ids },
  113.                  
  114.                   success: function(result){
  115.                             var result = eval('('+result+')');
  116.                             if (result.success){
  117.                                 $.messager.show({
  118.                                     title: 'Success',
  119.                                     msg: result.msg
  120.                                 });
  121.                                 $('#tt3').datagrid('reload');
  122.                             } else {
  123.                                 $.messager.show({
  124.                                     title: 'Error',
  125.                                     msg: result.msg
  126.                                 });
  127.                             }
  128.                         }
  129.                 });
  130.                 }
  131.                 })
  132. };      
  133.  
  134. $(function(){                
  135.            $('#tb-detil-po_customer').linkbutton({  
  136.                 iconCls: 'icon-hamburg-zoom'  
  137.             });
  138.    
  139.             $('#tb_edit_detail_po_customer').linkbutton({  
  140.                 iconCls: 'icon-edit'  
  141.             });
  142.  
  143.             $('#tb_tambah_detail_po_customer').linkbutton({  
  144.                 iconCls: 'icon-add'  
  145.             });
  146.             $('#tb_hapus_detail_po_customer').linkbutton({  
  147.                 iconCls: 'icon-remove'  
  148.             });
  149.        
  150.             $('#order_customer2').linkbutton({
  151.                 iconCls: 'icon-hamburg-refresh'
  152.             });
  153.        
  154.             $("#tb_tambah_detail_po_customer").live('click',function(){
  155.             $('#dlg-buttons').show();  
  156.             var f_url = 'po_customer_detail_temp';
  157.             buildForm(f_url);
  158.             })
  159.  
  160.             $('#submit').linkbutton({
  161.                 iconCls: 'icon-standard-new'
  162.             });
  163.  
  164.             $('#tipe').combobox({
  165.                 panelHeight:'auto'
  166.             });
  167.             $('#id_credit_status').combobox({
  168.               panelHeight:'auto'
  169.             });
  170.  
  171.             $('#status_po_customer').combobox({
  172.                 panelHeight:'auto'
  173.             });
  174.             $('#tgl_po_customer').datebox({})
  175.             $('#id_customer').combogrid({
  176.                 panelWidth:450,
  177.                                 width:250,
  178.                 url: 'template/json/combogrid/cb_customer.php',
  179.                 idField:'id',
  180.                 textField:'nama_customer',
  181.                 mode:'remote',
  182.                                 fitColumns:true,
  183.                 columns:[[
  184.                                         {field:'kode_customer',title:'Kode',align:'left',width:80},
  185.                     {field:'nama_customer',title:'Customer',align:'left',width:250}
  186.                 ]]
  187.             });
  188.    
  189.             $('#detailproduk1,#detailproduk2,#detailproduk3,#detailproduk4').combogrid({
  190.                                        panelWidth:250,
  191.                                        width:250,
  192.                                        url: 'template/json/combogrid/cb_produk.php',
  193.                                        idField:'kode_produk',
  194.                                        textField:'nama_produk',
  195.                                        mode:'remote',
  196.                                        fitColumns:true,
  197.                                        columns:[[
  198.                                                {field:'kode_produk',title:'Kode',align:'left',width:60},
  199.                                                {field:'nama_produk',title:'Produk',align:'left',width:160}
  200.                                        ]]
  201.            });
  202.     })
  203.    
  204. </script>
  205. <script>
  206.         $(function(){
  207.             $('#tt3').datagrid({
  208.                 onLoadSuccess:function(){
  209.                     var merges = [];
  210.                     for(var i=0; i<merges.length; i++)
  211.                         $('#tt3').datagrid('mergeCells',{
  212.                         });
  213.                 }
  214.             });
  215.         });
  216.                 $('#tb_edit_po_customer3').linkbutton({  
  217.                     iconCls: 'icon-edit'  
  218.                 });
  219.  
  220.                 $('#tb_tambah_po_customer3').linkbutton({  
  221.                     iconCls: 'icon-add'  
  222.                 });
  223.                
  224.                 $('#tb_hapus_po_customer3').linkbutton({  
  225.                     iconCls: 'icon-remove'  
  226.                 });
  227.                
  228.                 $("#tb_edit_po_customer3").live('click',function(){
  229. //                $('#dlg-buttons').show();  
  230.                   var row = $('#tt3').datagrid('getSelected');
  231.                   if (row){
  232.                       $('#form_po_customer2').form('clear');
  233.                       $('#form_po_customer2').form('load',row);
  234.  
  235.                           var f_url = 'tr_po_customer2';
  236.                           $.ajax({
  237.                                           url: "data/"+f_url+".php?id="+row.id,
  238.                                           dataType: 'json',
  239.                                           timeout: 2000,
  240.                                           error: function() {
  241.                                           },
  242.                                           success: function(xr){
  243.                                                   var ctn = xr.content;
  244.                                                   editUser(xr.ftitle,f_url+".php?id="+row.id,ctn.replace(/\\/,""),xr.dtitle);
  245.                                           }
  246.                                   })
  247.  
  248.                           $('#tt').datagrid({
  249.                                       url: "data/data_tr_po_customer2_temp_edit.php?token_input="+row.token_input,
  250.                                       rownumbers: true,
  251.                                       pagination:true,
  252.                                       striped:true,
  253.                                       toolbar:'#toolbar2',
  254.                                       frozenColumns:[[
  255.                                           {field:'ck',checkbox:'true',title:'all',width:75,align:'center'},
  256.                                           {field:'id',title:'id',width:205, hidden:true},  
  257.                                           {field:'kode_produk',title:'Kode Produk',width:80},  
  258.                                           {field:'produk',title:'Produk',width:175},  
  259.                                           {field:'satuan',title:'Satuan',width:70},
  260.                                           {field:'qty',title:'Qty',width:250}
  261.                                       ]]
  262.                                   });            
  263.                       }        
  264.                   })
  265.     </script>
  266. <form id="form_po_customer2" method="POST" class="uniForm">
  267.     <table width="60%" border="0">
  268.         <tr>
  269.           <td>
  270.               <fieldset id="field_form"><legend><b>Purchase Order Customer</b></legend>
  271.         <table width="100%" border="0">
  272.             <tr>
  273.                 <td width="15%"><strong>No. PO Cust</strong></td>
  274.                 <td width="35%">
  275.                     <input type='hidden' name='id' id='id'>
  276.                     <input type='text' name='token_input' id='token_input' value="<?php echo $_SESSION['token_input'];?>">
  277.                     <input name="nopo" class="easyui-validatebox" data-options="required: true, width: 200, prompt: 'prompt1...'" autocomplete="off"/>
  278.                 </td>
  279.                 <td width="15%"><strong>PO. Date</strong></td>
  280.                 <td width="35%">
  281.                     <input class='easyui-validatebox' required='true' name='tgl_po_customer' id='tgl_po_customer' style="width: auto;" autocomplete="off"/>
  282.                 </td>
  283.             </tr>
  284.             <tr><td><strong>Customer</strong></td>
  285.                 <td><input class='easyui-validatebox' required='true' name='id_customer' id='id_customer' size="25"/>&nbsp;</td>
  286.                 <td><strong>Keterangan</strong></td>
  287.                 <td rowspan="2"><textarea name="keterangan" rows="3" cols="35" autocomplete="off"></textarea></td>
  288.             </tr>
  289.             <tr><td height="21">&nbsp;</td>
  290.                 <td>&nbsp;</td>
  291.                 <td>&nbsp;</td>
  292.             </tr>
  293.             <tr align="left">
  294.               <td colspan="4">
  295.                   <fieldset id="field_form">
  296.                       <legend><b>Detail Item PO Customer</b></legend>
  297.                       <table id='tt'>
  298.                       </table>
  299.                   </fieldset>
  300.               </td>
  301.             </tr>
  302.             <tr align="left">
  303.                 <td colspan="4">
  304.                     <a href="javascript:void(0)" id="submit" class="easyui-linkbutton" onclick="$('#form_po_customer2').submit();">Save</a>
  305.                     <a href="javascript:void(0)" id="order_customer2" class="easyui-linkbutton" onclick="$('#form_po_customer2').form('clear')">Reset</a>
  306.                 </td>
  307.             </tr>
  308.         </table>
  309.               </td>
  310.               </tr>
  311.     </table>
  312. </form>
  313.  
  314.  
  315. <!--    <table id='tt'>
  316.     </table>-->
  317.     <table id="tt3" title="Purchase Order Customer"
  318.             url="./data/data_tr_po_customer2.php"
  319.             singleSelect="true" iconCls="icon-layout" rownumbers="true"
  320.             idField="itemid" pagination="true" toolbar="#toolbar3">
  321.         <thead frozen="true">
  322.             <tr>
  323.                                 <th field="ck" width="75" align="center" checkbox="true">All</th>
  324.                 <th field="kode_customer" width="70" align="center">Cust. Code</th>
  325.                 <th field="customer" width="250">Customer</th>
  326.             </tr>
  327.         </thead>
  328.         <thead>
  329.             <tr>
  330.                                 <th rowspan="2" field="nopo" width="175">PO. Number</th>
  331.                                 <th rowspan="2" field="tglpo" width="110">PO. Date</th>
  332.                 <th colspan="9">Quantity</th>
  333.                 <th rowspan="2" field="keterangan" width="150" align="left">Keterangan</th>
  334.                 <th rowspan="2" field="statusdelivery" width="100">St.PPBJ</th>
  335.                                 <th rowspan="2" field="statusdelivery" width="100">St.NPBJ</th>
  336.                                 <th rowspan="2" field="statusdelivery" width="100">St.NPPB</th>
  337.                                 <th rowspan="2" field="statusdelivery" width="100">St.Delivery</th>
  338.             </tr>
  339.             <tr>    
  340.                 <th field="col_ufr" width="80" align="center">UFR</th>
  341.                 <th field="col_hdr" width="80" align="center">HDR</th>
  342.                 <th field="col_f37" width="80" align="center">F37</th>
  343.                 <th field="col_f55" width="80" align="center">F55</th>
  344.                 <th field="col_abs" width="80" align="center">ABS</th>
  345.                 <th field="col_hdc" width="80" align="center">HDC</th>
  346.                 <th field="col_ufp" width="80" align="center">UFP</th>
  347.                 <th field="col_mfr" width="80" align="center">MFR</th>
  348.                 <th field="col_silvic" width="80" align="center">SILVIC</th>                                                                
  349.             </tr>
  350.         </thead>
  351.     </table>
  352. <!--        tombol menu detail -->
  353.     <div id="toolbar2">
  354.         <a href="#"  plain="true" id="tb_tambah_detail_po_customer">Add</a>
  355.         <a href="#"  plain="true" id="tb_edit_detail_po_customer">Edit</a>  
  356.         <a href="#"  plain="true" onclick="tb_hapus_detail_po_customer()" id="tb_hapus_detail_po_customer">Hapus</a>  
  357.     </div>  
  358.  
  359. <!--tombol menu grid besar-->
  360.     <div id="toolbar3">
  361.         <a href="#"  plain="true" id="tb_tambah_po_customer3">Add</a>
  362.         <a href="#"  plain="true" id="tb_edit_po_customer3">Edit</a>  
  363.         <a href="#"  plain="true" onclick="tb_hapus_po_customer3()" id="tb_hapus_po_customer3">Hapus</a>  
  364.     </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement