EVOLUTION-NINJA
Edit File: weaving_fabric.php
<style> .ui-jqgrid { text-transform: capitalize !important; } .tablediv { text-transform: uppercase !important; } .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } #Completed_Order { display:none; } #Weaving_Inprocess { display:none; } </style> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Weaving Fabric Details </h3> <div class="page-bar"> <ul class="page-breadcrumb"> <li><i class="fa fa-home"></i> <a href="https://swansilk.co/dashboard/dashboard_fun">Home</a> <i class="fa fa-angle-right"></i> <a href="#" > Weaving Fabric </a></li> </ul> </div> <?php if(empty($access_row)) { } else { if($access_row->insert_id == '1') { ?> <form action="<?php echo base_url(); ?>out_source/weaving_fabric_data" method="post" class="form-horizontal"> <b>To insert data click here:</b> <input type="hidden" name="url_link" value="<?php echo $val; ?>"> <input type="submit" name="Insert" value="Insert" /> </form> <?php } else { ?> <?php } }?> <input type="hidden" id="preview_id" class="preview_id" value="<?php if(empty($access_row)) { } else { echo $access_row->preview_id; } ?>" > <input type="hidden" id="edit_id" class="edit_id" value="<?php if(empty($access_row)) { } else { echo $access_row->edit_id; } ?>" > <input type="submit" id="less" value="View" onclick="show();"/> <input type="submit" id="more" value="View" onclick="hide();" /> <br><br> <input type="hidden" value="<?php echo $ref; ?>" id="ref_id" > <input type="hidden" value="<?php echo $url_val; ?>" id="url_ref" style="width: 230px;" > <div id ="weavinf_panel" class="weavinf_panel"> <div id = "jaytab" class="jaytab"> <table id="list2"></table> <div id="pager2"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <br/> <input type="hidden" id="checked_ids" class="checked_ids"/> <div id="myModall" class="modal fade" role="dialog" style="color:#000;"> <div class="modal-dialog" style="width:80%" > <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Weaving Fabric Details</h4> </div> <div class="modal-body"> <fieldset> <div > <input type="hidden" id="row_id" name="row_id" > <div class="row"> <div class="col-md-8"> <div class="form-group"> <label class="control-label col-md-3">Status :</label> <div class="col-md-9 "> <select name="statuss" id="statuss" class="form-control"> <option value="Select">Select</option> <option value="NOT YET">NOT YET</option> <option value="PARTLY">PARTLY</option> <option value="COMPLETED">COMPLETED</option> </select> </div> </div> </div><br/> </div> <!-- row -4--> <br/> <button id="generate" class="btn btn-primary generate" value="Generate" style="margin-left:40% !important;" data-dismiss="modal" >Submit</button> </div> </div> </div> </div> </div> </div> </div> <!-- End BEGIN CONTAINER --> <!-- BEGIN FOOTER --> <style> #weavinf_panel { overflow-x:scroll; } #table_approved_indent { display:none; } #refresh_list3 { display:none !important; } #search_list2 { display:none !important; } #list2_122_t { height:0px !important; } list2_136_t { height:12px !important; } .scroll { height:12px !important; } .ui-jqgrid-btable { } .ui-jqgrid-titlebar { background: rgb(72,91,127) !important; color: white !important; } .ui-common-table { height:12px !important; } #refresh_list2 { display:none !important; } #client_edit { padding-right:12px !important; } @media only screen and (min-width:320px) and (max-width:641px){ .ui-jqgrid { margin-left: 1px !important; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 100% !important; padding-left: 0 !important; } #editmodlist2 { width:90% !important; } #sData span, #cData span { margin-left: 0 !important; } } @media only screen and (min-width:641px) and (max-width:991px){ .ui-jqgrid { margin-left: 1px !important; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 100% !important; padding-left:0 !important; padding-right:9px !important; } } .colCell { cursor: pointer; cursor: hand; } </style> <script src="<?php echo base_url(); ?>assets/js/sweetalert.min.js" type="text/javascript"></script> <link href="<?php echo base_url(); ?>assets/css/sweetalert.min.css" rel="stylesheet" type="text/css" > <!-- The link to the CSS that the grid needs --> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <link href="<?php echo base_url('assets/css/sweetalert2.min.css');?>" rel="stylesheet"/> <script src="<?php echo base_url('assets/js/sweetalert2.min.js');?>"></script> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <!-- This is the localization file of the grid controlling messages, labels, etc. <!-- We support more than 40 localizations --> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/i18n/grid.locale-en.min.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <!-- The link to the CSS that the grid needs --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid.min.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid-bootstrap.min.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid-bootstrap-ui.min.css'); ?>" /> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" /> <script> $("#less").click(function() { $("#more").show(); $("#less").hide(); }); </script> <script> $("#more").click(function() { $("#less").show(); $("#more").hide(); }); </script> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <script> <!---------------------------compelte indent -----------------------------------------> $(document).ready(function (){ $('#more').hide(); var ll; var l=$("#ref_id").val(); jQuery("#list2").jqGrid({ url:"<?php echo base_url('out_source/weaving_fabric_grid_details')?>/s"+l+"/", datatype: "json", colNames:['Id','Delevery date','OSL','Article','Planned Width','Width','Reed','Reed Width','PPC','Quality','Design','DTL Shade','Warp Planned Mtr','Weft Planned Mtr','Weaving Factory','Finished Weight Per Mtr','Piece Length','Ordered Mtrs','Weaving Delivery Date','Tentative Delivery Date','Status','preview','Status','Summary'], colModel:[ {name:'id',index:'id',hidden:true, editable:true,width:70}, {name:'delivery_date',index:'delivery_date', width:60,editable:false}, {name:'osl_no',index:'osl_no', width:60,editable:false}, {name:'article',index:'article', width:45,editable:false,editrules:{required: true}}, {name:'selWidth',index:'selWidth', editable:false,editrules:{required: true},width:50}, {name:'width',index:'width', editable:false,editrules:{required: true},width:50}, {name:'reed',index:'reed',editable:false,hidden:true,width:50, editrules : {edithidden:true}}, {name:'reed_width',index:'reed_width',hidden:true, width:50,editable:false, editrules : {edithidden:true}}, {name:'ppc',index:'ppc', width:60,hidden:true}, {name:'quality',index:'quality',editable:false,editrules:{required: true},width:70}, {name:'design',index:'design', editable:false,width:50}, {name:'sslShade',index:'sslShade', width:55,editable:false}, {name:'warp_pland_mtr',index:'warp_pland_mtr', width:60,editable:false}, {name:'weft_pland_mtr',index:'weft_pland_mtr', width:60,editable:false}, {name:'weaving_factory',index:'weaving_factory', editable:false,width:50}, {name:'finished_weight',index:'finished_weight',hidden:true, width:50}, {name:'piece_length',index:'piece_length',editable:false,editrules:{required: true},width:50}, {name:'ordered_mtrs',index:'ordered_mtrs', width:50,editable:false}, {name:'weaving_date',index:'weaving_date', width:55,editable:false,editrules:{required: true},formatter: 'date', formatoptions: { newformat: 'd/m/Y'}}, {name:'tentative_date',index:'tentative_date', classes:'input-daterange',hidden:true,width:50,editable:true,editrules:{required: true}}, // {name:'fabric_details',index:'fabric_details', classes:'received_date',editrules:{required: true},width:50}, // {name:'status', index:'status', width:100, align:'center', sortable:false,editable:true, edittype:'select',formatter: 'select',editoptions:{value:{'Waiting for Yarn' :' Waiting for Yarn','Received Yarn' :'Received Yarn','Winding & Warping' :'Winding & Warping','Weaving' :'Weaving','Completed' :'Completed', // } } }, { name: 'fabric_details', index: 'fabric_details', classes:'colCell',width:100, align: 'center', formatter: 'text', editoptions: { value: '1:0' }, formatoptions: { disabled: false }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun($(this))" '; } }, {name:' ',index:' ',align: "center",editable:false,editrules:{required: true}, width:100,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_preview($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='PREVIEW' onclick='some_function' \>"; }}, {name:'confirm_status',index:'confirm_status', width:50,editable:false}, {name:' ',index:' ',align: "center",editable:false,editrules:{required: true}, width:100,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_goods_preview($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='Summary' onclick='some_function' \>"; }} ], height: 'auto', rowNum:50, rowTotal: 20000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager2", // sortname:'id', viewrecords: true, gridview: true, onSelectRow: function(id){ if(id && id!==ll){ jQuery('#list2').jqGrid('restoreRow',ll); jQuery('#list2').jqGrid('editRow',id,true,pickdates); ll=id; } }, editurl: "<?php echo base_url('out_source/edit_tentative_goods_details');?>", autowidth: true, sortorder:"asc", loadonce:true, caption:"Weaving Fabric Details", subGrid: true, subGridRowExpanded: function(subgrid_id, row_id) { var subgrid_table_id; //alert(row_id); swan_id=row_id; //alert(swan_id); subgrid_table_id = subgrid_id+"_t"; jQuery("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>"); jQuery("#"+subgrid_table_id).jqGrid({ url:"<?php echo base_url('out_source/weaving_subgrid');?>/s"+row_id+"/", //data:{'sub_id':123}, mtype : "get", datatype: "json", colNames:['Id','Article','Finished Weight','Weaving Factory','Ordered Mtrs','Received Mtrs','Received Date','Location','Piece No.','Invoice/DC No.','Received By'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'article',index:'article', width:80,editable:true,editrules:{required: true}}, {name:'finished_weight',index:'finished_weight', width:110,editable:true,editrules:{required: true}}, //{name:'received_weight',index:'received_weight', width:110,editable:true,editrules:{required: true}}, {name:'factory',index:'factory', width:100,editable:true,editrules:{required: true}}, {name:'ordered_mtrs',index:'ordered_mtrs', editable:true,editrules:{required: true},width:110}, {name:'received_mtrs',index:'received_mtrs', editable:true,editrules:{required: true},width:100}, {name:'rec_date', index:'rec_date', width:100,editable:true,editrules:{required: true}}, {name:'location',index:'location', editable:true,editrules:{required: true},width:120}, {name:'piece_no',index:'piece_no', width:80,editable:true,editrules:{required: true}}, {name:'in_dc_val',index:'in_dc_val', width:100,editable:true,editrules:{required: true}}, {name:'rec_by',index:'rec_by', width:105,editable:true,editrules:{required: true}}, ], height: 'auto', rowNum:2000000000000000, sortname: 'num', sortorder: "asc" }); } }); function pickdates(id){ jQuery("#"+id+"_tentative_date","#list2").datepicker({dateFormat:"dd/mm/yy"}); } //$("#list2").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required jQuery("#list2").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list2").jqGrid('navGrid','#pager2', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); // $("#list2").navButtonAdd('#pager2', // { caption:"Add", // buttonicon:"ui-icon-plus", // onClickButton: addRow, // position: "last", // title:"", // cursor: "pointer", // id:"service_add" // } // ); }); function fun(rowId) { var id = rowId.closest('tr').attr('id'); var v=$('#edit_id').val(); if(v == 1) { $('#row_id').val(id); $('#myModall').modal('show'); } else { swal({ title: "You Don't Have Access For This Edit", text: "", }); } } function fun_goods_preview(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#preview_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("out_source/outsource_weaving_summary1_preview"); ?>', data:{'as':as}, async:false, success:function(data) { var objData = jQuery.parseJSON(data); var v=objData.fetch; if(v.confirm == 'No') { swal({ title: "This OSL # is not confirmed in Issued to Loom, Please Confirm First", text: "", }); } else { var url_r=$('#url_ref').val(); if(url_r == '1') { window.location.href = '<?php echo base_url('out_source/outsource_weaving_summary_preview');?>/'+ '?id='+as; } else if(url_r == '2') { window.location.href = '<?php echo base_url('out_source/outsource_weaving_summary_preview');?>/'+ '?id='+as; } else if(url_r == '3') { window.location.href = '<?php echo base_url('out_source/outsource_weaving_summary_preview');?>/'+ '?id='+as; } else if(url_r == '4') { window.location.href = '<?php echo base_url('out_source/outsource_weaving_summary_preview');?>/'+ '?id='+as; } } } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function fun_preview(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#preview_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("out_source/outsource_weaving_delivery_preview"); ?>', data:{'as':as}, async:false, success:function() { var url_r=$('#url_ref').val(); if(url_r == '1') { window.location.href = '<?php echo base_url('out_source/outsource_weaving_delivery_preview');?>/'+ '?id='+as; } else if(url_r == '2') { window.location.href = '<?php echo base_url('out_source/outsource_wo_weaving_delivery_preview');?>/'+ '?id='+as; } else if(url_r == '3') { window.location.href = '<?php echo base_url('out_source/outsource_wo_weaving_delivery_view');?>/'+ '?id='+as; } else if(url_r == '4') { window.location.href = '<?php echo base_url('out_source/wo_outsource_weaving_delivery_preview');?>/'+ '?id='+as; } } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function show () { // // Position of the name column var colPos = 0; var navGrid = $('#list2'); // alert(navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[colPos + 6].name)); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[colPos].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[3].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[4].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[5].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[6].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[7].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[8].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[9].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[10].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[11].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[12].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[13].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[14].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[15].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[16].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[17].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[18].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[19].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[20].name); } function hide() { var colPos = 0; var navGrid = $('#list2'); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[3].name); //navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[4].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[5].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[6].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[7].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[8].name); //navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[9].name); //navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[10].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[11].name); //navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[12].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[13].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[14].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[15].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[16].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[17].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[18].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[19].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[20].name); } </script> <script> $("#generate").click(function(e) { e.preventDefault(); var status =$('#statuss').val(); var row_id =$('#row_id').val(); //alert(status); //alert(row_id); $.ajax({ url:"<?php echo base_url('out_source/insert_weaving_fabric_data');?>", type:"POST", data:{'row_id':row_id,'status':status}, async:false, success:function(data){ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); }); </script> <style> .preview { padding-bottom:3px !important; padding-top:3px !important; } </style> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" />