EVOLUTION-NINJA
Edit File: yarn_location_details.php
<script> $( document ).ready(function() { var v=$('#location').val(); var yarn_type=$('#yarn_type').val(); if(yarn_type == 'raw_yarn') { $('#yarn_remnant_table').hide(); $('#yarn_twisting_table').hide(); $('#table_dyed_table').hide(); $('#table_swan_dyed').hide(); $('#yarn_raw_table').show(); $('#yarn_type').val('raw_yarn'); raw_function(); } else if(yarn_type == 'twisted_yarn') { $('#table_dyed_table').hide(); $('#table_swan_dyed').hide(); $('#yarn_raw_table').hide(); $('#yarn_type').val('twisted_yarn'); twisting_function(); } else if(yarn_type == 'dyed_yarn') { $('#yarn_remnant_table').hide(); $('#yarn_twisting_table').hide(); //$('#table_dyed_table').show(); $('#table_swan_dyed').hide(); $('#yarn_raw_table').hide(); $('#yarn_type').val('dyed_yarn'); dyed_function(); } else if(yarn_type == 'swan_yarn') { $('#yarn_remnant_table').hide(); $('#yarn_twisting_table').hide(); $('#table_dyed_table').hide(); //$('#table_swan_dyed').show(); $('#yarn_type').val('swan_yarn'); $('#yarn_raw_table').hide(); swan_function(); } else if(yarn_type == 'remnant_yarn') { $('#yarn_twisting_table').hide(); $('#table_dyed_table').hide(); //$('#table_swan_dyed').show(); $('#yarn_type').val('remnant_yarn'); $('#yarn_raw_table').hide(); $('#yarn_remnant_table').hide(); remnant_function(); } }); </script> <style> #refresh_list6 { display:none !important; } #refresh_list4 { display:none !important; } #refresh_list5 { display:none !important; } .ui-jqgrid { text-transform: capitalize !important; } .tablediv { text-transform: uppercase !important; } .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } </style> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Yarn Stock Details </h3> <span class="close-right" ><a href="<?php echo base_url('stock_history_details/yarn_stock_details');?>" style="font-size: 18px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 5px;text-decoration:none;">Back</a></span> <br><br> <!--<input type="text" id="location" class="location" name="location" value="all" >--> <input type="hidden" id="yarn_type" class="yarn_type" name="yarn_type" value="<?php echo $yarn_type; ?>"> <input type="hidden" id="location" class="location" name="location" value="<?php echo $location; ?>"> <input type="hidden" id="preview_id" class="preview_id" name="location" value="<?php echo $preview_id; ?>"> <div id="table_swan_dyed" style="display:none;"> <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> <div id="yarn_raw_table"> <div id = "jaytab1" class="jaytab"> <table id="list3"></table> <div id="pager3"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="yarn_twisting_table" style="display:none;"> <div id = "jaytab2" class="jaytab"> <table id="list4"></table> <div id="pager4"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="table_dyed_table" style="display:none;"> <div id = "jaytab3" class="jaytab"> <table id="list5"></table> <div id="pager5"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="yarn_remnant_table" style="display:none;"> <div id = "jaytab3" class="jaytab"> <table id="list6"></table> <div id="pager6"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> </div> </div> </div> <!-- End BEGIN CONTAINER --> <!-- BEGIN FOOTER --> <!-- BEGIN FOOTER --> <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'); ?>" /> <style> .ss{ padding-right: 0 !important; padding-left: 0 !important; } .form-control { width:65% !important; height:27px !important; padding: 3px 12px !important; border-radius: 0px !important; //margin-bottom:15px; } label { font-weight: normal; text-align: left; } .hr-line{ border-top: 1px solid #465A81; } .well-sm { padding: 3px !important; border-radius: 0px !important; } input[type="file"] { padding-bottom: 28px !important; height: 25px !important; color:transparent; } .portlet.box.blue-madison { border: 1px solid #fff !important; border-top: 0; background:#fff !important; } #table_approved_indent { display:none; } #refresh_list3 { display:none !important; } @media only screen and (min-width:320px) and (max-width:640px) { } </style> <!-----------------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'); ?>" /> <style type="text/css"> .ss{ padding-right: 0 !important; padding-left: 0 !important; } label { font-weight: normal; text-align: left; } .hr-line{ border-top: 1px solid #465A81; } .well-sm { padding: 3px !important; border-radius: 0px !important; } input[type="file"] { padding-bottom: 28px !important; height: 25px !important; color:transparent; } .portlet.box.blue-madison { border: 1px solid #fff !important; border-top: 0; background:#fff !important; } input[type=file] { display: none; } .ui-jqgrid .ui-jqgrid-caption { text-align: left; background: rgb(72,91,127); color: white; } .ui-jqdialog .ui-jqdialog-titlebar { padding: .1em .1em; min-height: 35px; background: rgb(72,91,127); color: white; } .ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: -9px; } #sData { height: 27px; } #cData { height: 27px; } #dData { height: 27px; } #eData { height: 27px; } .coledit { cursor:pointer; padding-right: 22px !important; padding-left: 23px !important; margin-top: 4px !important; color:bold !important; } .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { overflow: hidden; white-space: pre; } </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <script> function remnant_function() { $('#yarn_remnant_table').show(); var l=$("#location").val(); //alert(l); jQuery("#list6").jqGrid({ url:"<?php echo base_url('out_source/fetch_remnants_grid_data');?>/"+l+"/",page:1, //url:"<?php echo base_url('out_source/fetch_swan_data')?>", datatype: "json", colNames:['Id','OSL#','Yarn Details','Yarn Denier','Yarn Specification','Shades','Color Code','Lot','Bale','Bag','Net Weight','Location','Received Date','Received By','Preview'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'osl_no',index:'osl_no', width:90,editable:false}, {name:'yarn_name',index:'yarn_name', editable:true,editrules:{required: true},width:90}, {name:'yarn_den',index:'yarn_den', width:80,editable:true,editrules:{required: true}}, {name:'yarn_spec',index:'yarn_spec', width:70,editable:true,editrules:{required: true}}, {name:'yarn_ssl_shade',index:'yarn_ssl_shade', width:90,editable:true,editrules:{required: true}}, {name:'color_code',index:'color_code', width:90,editable:true,editrules:{required: true}}, {name:'yarn_lot',index:'yarn_lot', width:70,editable:true,editrules:{required: true}}, {name:'yarn_bale',index:'yarn_bale', width:70,editable:true,editrules:{required: true}}, {name:'bag',index:'issue_net_wt', width:70,editable:true,editrules:{required: true}}, {name:'rements_stock',index:'rements_stock', width:70,editable:true,editrules:{required: true}}, {name:'remnants_location',index:'remnants_location', width:90,editable:true,editrules:{required: true}}, {name:'rements_approved_date',index:'rements_approved_date', width:90,editable:true,editrules:{required: true}}, {name:'rements_approval_by',index:'rements_approval_by', width:90,editable:true,editrules:{required: true}}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:90,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_remnants_preview($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='PREVIEW' onclick='some_function' \>"; }}, ], height: 'auto', rowNum:50, rowTotal: 20000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager6", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", loadonce:true, caption:"Remnants Yarn Details", footerrow: true, loadComplete: function () { // var sumOfPrice_issue_net_wt = jQuery("#list6").jqGrid('getCol','issue_net_wt',false,'sum'); var sumOfPrice_rements = jQuery("#list6").jqGrid('getCol','rements_stock',false,'sum'); jQuery("#list6").jqGrid('footerData', 'set', { bag: 'Total:', rements_stock: sumOfPrice_rements.toFixed(2) }); }, }); //$("#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 } ); } function fun_remnants_preview(rowId) { var id = rowId.closest('tr').attr('id'); //alert(id); var as=id; var v=$('#preview_id').val(); // alert(v); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("stock_history_details/yarn_remnants_preview"); ?>', data:{'id':as}, async:false, success:function() { window.location.href = '<?php echo base_url('stock_history_details/yarn_remnants_preview');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } <!----------------------------------access controll -------------------------------> function swan_function() { $('#table_swan_dyed').show(); var l=$("#location").val(); //alert(l); jQuery("#list2").jqGrid({ url:"<?php echo base_url('out_source/fetch_swan_grid_data');?>/"+l+"/",page:1, //url:"<?php echo base_url('out_source/fetch_swan_data')?>", datatype: "json", colNames:['Id','OSL No.','Issue #','Yarn Quality','Yarn Type','Yarn Name','Yarn Denier','Yarn Specification','DTL Shade','Color Code','Dyed Weight','Location','Received Date','Preview'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'osl_no',index:'osl_no', width:100,editable:false}, {name:'issue_no',index:'issue_no', width:100,editable:true,editrules:{required: true}}, {name:'yarn_quality',index:'yarn_quality', width:100,editable:true,editrules:{required: true}}, {name:'yarn_type',index:'yarn_type', width:100,editable:true,editrules:{required: true}}, {name:'yarnName',index:'yarnName', width:100,editable:true,editrules:{required: true}}, {name:'yarnSpecification',index:'yarnSpecification', width:100,editable:true,editrules:{required: true}}, {name:'yarnDenier',index:'yarnDenier', width:100,editable:true,editrules:{required: true}}, {name:'shade',index:'shade', editable:true,editrules:{required: true},width:100}, {name:'color_code',index:'color_code',classes:'edit',hidden:true, editable:true,editrules:{required: true},width:100}, {name:'rec_dyed_qua',index:'rec_dyed_qua', width:100,editable:true,editrules:{required: true}}, {name:'location',index:'location', width:100,editable:true,editrules:{required: true}}, {name:'rec_date',index:'rec_date', width:90,editable:true,editrules:{required: true}}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:130,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_swan_preview($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='PREVIEW' 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, autowidth: true, sortorder:"asc", loadonce:true, caption:"Swan Yarn Dyed Details", footerrow: true, loadComplete: function () { var sumOfPrice_rec_dyed_qua = jQuery("#list2").jqGrid('getCol','rec_dyed_qua',false,'sum'); jQuery("#list2").jqGrid('footerData', 'set', { shade: 'Total:', rec_dyed_qua: sumOfPrice_rec_dyed_qua.toFixed(2) }); }, }); //$("#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 } ); } function fun_edit(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#edit_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("vendor/indent_id"); ?>', data:{'as':as}, async:false, success:function() { window.location.href = '<?php echo base_url('vendor/indent_id');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Edit", text: "", }); } } function fun1(rowId) { // var rowid = 123; var id = rowId.closest('tr').attr('id'); //alert(id); var confirmMsg= confirm("Do You Want To Confirm!"); if (confirmMsg==true) { swal({ title: 'Remarks', input: 'text', showCancelButton: true, confirmButtonText: 'Submit', showLoaderOnConfirm: true, }).then(function (email) { $.ajax({ //alert(email); url:"<?php echo base_url('vendor/add_yes_confirmation')?>", type:"POST", data:{'id':id,'remarks':email}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); $("#jaytab").trigger("reloadGrid"); $("#jqGrid").trigger("reloadGrid"); //window.location.reload(); window.location = "<?php echo base_url('vendor/indent_grid')?>"; } else{ window.location = "<?php echo base_url('vendor/indent_grid')?>"; } } }); swal({ type: 'success', // title: 'Approved By', // html: '' + email }) }) ///alert(email); } else if (confirmMsg==false) { $.ajax({ url:"<?php echo base_url('vendor/add_no_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); //window.location.reload(); window.location = "<?php echo base_url('vendor/indent_grid')?>"; } else{ window.location = "<?php echo base_url('vendor/indent_grid')?>"; } } }); } } function fun_swan_preview(rowId) { var id = rowId.closest('tr').attr('id'); //alert(id); var as=id; var v=$('#preview_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("stock_history_details/yarn_stock_swan_preview"); ?>', data:{'id':as}, async:false, success:function() { window.location.href = '<?php echo base_url('stock_history_details/yarn_stock_swan_preview');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function deleteRow() { // Get the currently selected row var row = $("#list2").jqGrid('getGridParam','selrow'); $("#id").val(row); if( row != null ) $("#list2").jqGrid('delGridRow',row, { modal:true,jqModal:true, recreateForm: true, beforeSubmit: function(postdata,formid){ $.ajax({ url:"<?php echo base_url('vendor/vendor_delete');?>", type:"POST", data:{'id':row}, async:false, success:function(data){ if(data==""){ alert('Successfully Deleted'); $("#delmodlist2").remove(); $("#list2").trigger("reloadGrid"); window.location.reload(); } else{ alert('Successfully Deleted'); $("#delmodlist2").remove(); $("#list2").trigger("reloadGrid"); window.location.reload(); } } }); }, closeAfterEdit: true, reloadAfterSubmit:false, afterSubmit : false }); else $( "#dialogSelectRow" ).dialog(); } <!---------------------------approved indent -----------------------------------------> function raw_function() { // $('#list3').jqGrid('clearGridData'); // //$('#list3').jqGrid('setGridParam', {data: dataToLoad}); // $('#list3').trigger('reloadGrid'); $('#yarn_raw_table').show(); var l=$("#location").val(); // alert(l); jQuery("#list3").jqGrid({ url:"<?php echo base_url('out_source/fetch_yarn_raw_details_data');?>/"+l+"/",page:1, type:'GET', datatype: "json", colNames:['Id','Purpose','Yarn Details','Yarn Denier','Yarn Specification','Lot','Bale','Gross Weight','Net Weight','Location','Received Date','Preview'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'purpose',index:'purpose', width:120,editable:false}, {name:'yarnname',index:'yarnname', editable:true,editrules:{required: true},width:120}, {name:'yarndenier',index:'yarndenier', width:120,editable:true,editrules:{required: true}}, // {name:'yarnDenier',index:'yarnDenier', width:120,editable:true,editrules:{required: true}}, {name:'yarnspecification',index:'yarnspecification', width:120,editable:true,editrules:{required: true}}, {name:'lot',index:'lot', width:120,editable:true,editrules:{required: true}}, {name:'bale',index:'bale', width:120,editable:true,editrules:{required: true}}, // {name:'issue_gross_weight',index:'issue_gross_weight', width:120,editable:true,editrules:{required: true}}, { name: 'issue_gross_weight', index: 'issue_gross_weight', width: 100, align: 'center',formatter: 'number', formatoptions: { decimalSeparator: ".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.0000' }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="gross_fun1($(this))" '; } }, { name: 'issue_net_weight', index: 'issue_net_weight', width: 100, align: 'center',formatter: 'number', formatoptions: { decimalSeparator: ".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.0000' }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="net_fun1($(this))" '; } }, {name:'consumed_at',index:'consumed_at', width:120,editable:true,editrules:{required: true}}, {name:'rec_date',index:'rec_date', width:90,editable:true,editrules:{required: true}}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:150,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' \>"; }}, ], height: 'auto', rowNum:50, rowTotal: 20000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager3", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", loadonce:true, caption:"Yarn Raw Details", footerrow: true, loadComplete: function () { var sumOfPrice_issue_net_weight = jQuery("#list3").jqGrid('getCol','issue_net_weight',false,'sum'); var sumOfPrice_issue_gross_weight = jQuery("#list3").jqGrid('getCol','issue_gross_weight',false,'sum'); jQuery("#list3").jqGrid('footerData', 'set', { bale: 'Total:', issue_gross_weight: sumOfPrice_issue_gross_weight.toFixed(2) , issue_net_weight: sumOfPrice_issue_net_weight.toFixed(2) }); }, }); //$("#list2").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required jQuery("#list3").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list3").jqGrid('navGrid','#pager3', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } function gross_fun1(rowId) { //var rowid = 123; var id = rowId.closest('tr').attr('id'); //alert(id); $.ajax({ //alert(email); url:"<?php echo base_url('stock_history_details/yarn_stock_modal_val')?>", type:"POST", data:{'id':id}, success:function(data){ var objData = jQuery.parseJSON(data); var g_w = objData.issue_gross_weight; if(g_w < 1) { swal({ title: 'Do You Want To Set This Value To 0', // input: 'text', showCancelButton: true, confirmButtonText: 'OK', showLoaderOnConfirm: true, }).then(function (email) { $.ajax({ //alert(email); url:"<?php echo base_url('stock_history_details/add_gross_zero_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ window.location.reload(); } }); }) ///alert(email); } else { } } }); } function net_fun1(rowId) { //var rowid = 123; var id = rowId.closest('tr').attr('id'); //alert(id); $.ajax({ //alert(email); url:"<?php echo base_url('stock_history_details/yarn_stock_modal_val')?>", type:"POST", data:{'id':id}, success:function(data){ var objData = jQuery.parseJSON(data); var n_w = objData.issue_net_weight; if(n_w < 1) { swal({ title: 'Do You Want To Set This Value To 0', // input: 'text', showCancelButton: true, confirmButtonText: 'OK', showLoaderOnConfirm: true, }).then(function (email) { $.ajax({ //alert(email); url:"<?php echo base_url('stock_history_details/add_net_zero_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ window.location.reload(); } }); }) ///alert(email); } else { } } }); } function fun(rowId) { // var rowid = 123; var id = rowId.closest('tr').attr('id'); //alert(id); var confirmMsg= confirm("Do You Want To Confirm!"); if (confirmMsg==true) { swal({ title: 'Remarks', input: 'text', showCancelButton: true, confirmButtonText: 'Submit', showLoaderOnConfirm: true, }).then(function (email) { $.ajax({ //alert(email); url:"<?php echo base_url('vendor/add_yes_confirmation')?>", type:"POST", data:{'id':id,'remarks':email}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list3").trigger("reloadGrid"); $("#jaytab").trigger("reloadGrid"); $("#jqGrid").trigger("reloadGrid"); window.location.reload(); } else{ } } }); swal({ type: 'success', // title: 'Approved By', // html: '' + email }) }) ///alert(email); } else if (confirmMsg==false) { $.ajax({ url:"<?php echo base_url('vendor/add_no_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list3").trigger("reloadGrid"); window.location.reload(); } else{ } } }); } } function twisting_function() { $('#yarn_twisting_table').show(); var l=$("#location").val(); // alert(l); jQuery("#list4").jqGrid({ url:"<?php echo base_url('out_source/fetch_yarn_twisting_grid_data');?>/"+l+"/",page:1, datatype: "json", colNames:['Id','Purpose','Yarn Details','Yarn Denier','Yarn Specification','Shades','Lot','Bale','Gross Weight','Net Weight','Location','Received Date','Preview'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'purpose',index:'purpose', width:100,editable:false}, {name:'yarnname',index:'yarnname', editable:true,editrules:{required: true},width:100}, {name:'yarndenier',index:'yarndenier', width:100,editable:true,editrules:{required: true}}, // {name:'yarnDenier',index:'yarnDenier', width:120,editable:true,editrules:{required: true}}, {name:'yarnspecification',index:'yarnspecification', width:100,editable:true,editrules:{required: true}}, {name:'shades',index:'shades', width:90,editable:true,editrules:{required: true}}, {name:'lot',index:'lot', width:100,editable:true,editrules:{required: true}}, {name:'bale',index:'bale', width:100,editable:true,editrules:{required: true}}, // {name:'issue_gross_weight',index:'issue_gross_weight', width:100,editable:true,editrules:{required: true}}, // {name:'issue_net_weight',index:'issue_net_weight', width:100,editable:true,editrules:{required: true}}, { name: 'issue_gross_weight', index: 'issue_gross_weight', width: 100, align: 'center', cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="gross_fun1($(this))" '; } }, { name: 'issue_net_weight', index: 'issue_net_weight', width: 90, align: 'center', cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="net_fun1($(this))" '; } }, {name:'consumed_at',index:'consumed_at', width:100,editable:true,editrules:{required: true}}, {name:'rec_date',index:'rec_date', width:90,editable:true,editrules:{required: true}}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:130,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' \>"; }}, ], // colNames:['Id','Purpose','Yarn Details','Yarn Name','Yarn Denier','Yarn Specification','Yarn Shades','Lot','Bale','Net Weight'], // colModel:[ // {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, // {name:'purpose',index:'purpose', width:100,editable:false}, // {name:'yarnName',index:'yarnName', editable:true,editrules:{required: true},width:220}, // {name:'yarn_quality',index:'yarn_quality', width:100,editable:true,editrules:{required: true}}, // // {name:'yarn_type',index:'yarn_type', width:100,editable:true,editrules:{required: true}}, // {name:'yarnDenier',index:'yarnDenier', width:120,editable:true,editrules:{required: true}}, // {name:'yarnSpecification',index:'yarnSpecification', width:120,editable:true,editrules:{required: true}}, // {name:'shades',index:'shades', width:100,editable:true,editrules:{required: true}}, // {name:'lot',index:'lot', width:100,editable:true,editrules:{required: true}}, // {name:'bale',index:'lot', width:90,editable:true,editrules:{required: true}}, // {name:'net_weight',index:'net_weight', width:90,editable:true,editrules:{required: true}}, // ], height: 'auto', rowNum:50, rowTotal: 20000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager4", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", loadonce:true, caption:"Yarn Twisting Details", footerrow: true, loadComplete: function () { var sumOfPrice_issue_net_weight = jQuery("#list5").jqGrid('getCol','issue_net_weight',false,'sum'); var sumOfPrice_issue_gross_weight = jQuery("#list5").jqGrid('getCol','issue_gross_weight',false,'sum'); jQuery("#list5").jqGrid('footerData', 'set', { bale: 'Total:', issue_gross_weight: sumOfPrice_issue_gross_weight.toFixed(2) , issue_net_weight: sumOfPrice_issue_net_weight.toFixed(2) }); }, }); //$("#list2").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required jQuery("#list4").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list4").jqGrid('navGrid','#pager4', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } function dyed_function() { $('#table_dyed_table').show(); var l=$("#location").val(); ///alert(l); jQuery("#list5").jqGrid({ url:"<?php echo base_url('out_source/fetch_yarn_dyed_grid_data');?>/"+l+"/",page:1, datatype: "json", colNames:['Id','Purpose','Yarn Details','Yarn Denier','Yarn Specification','Shades','Color Code','Lot','Bale','Gross Weight','Net Weight','Location','Received Date','Preview'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'purpose',index:'purpose', width:120,editable:false}, {name:'yarnname',index:'yarnname', editable:true,editrules:{required: true},width:100}, {name:'yarndenier',index:'yarndenier', width:100,editable:true,editrules:{required: true}}, // {name:'yarnDenier',index:'yarnDenier', width:120,editable:true,editrules:{required: true}}, {name:'yarnspecification',index:'yarnspecification', width:100,editable:true,editrules:{required: true}}, {name:'shades',index:'shades', width:100,editable:true,editrules:{required: true}}, {name:'color_code',index:'color_code', width:100,editable:true,editrules:{required: true}}, {name:'lot',index:'lot', width:100,editable:true,editrules:{required: true}}, {name:'bale',index:'bale', width:100,editable:true,editrules:{required: true}}, // {name:'issue_gross_weight',index:'issue_gross_weight', width:100,editable:true,editrules:{required: true}}, // {name:'issue_net_weight',index:'issue_net_weight', width:100,editable:true,editrules:{required: true}}, { name: 'issue_gross_weight', index: 'issue_gross_weight', width: 100, align: 'center', cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="gross_fun1($(this))" '; } }, { name: 'issue_net_weight', index: 'issue_net_weight', width: 100, align: 'center', cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="net_fun1($(this))" '; } }, {name:'consumed_at',index:'consumed_at', width:100,editable:true,editrules:{required: true}}, {name:'rec_date',index:'rec_date', width:90,editable:true,editrules:{required: true}}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:120,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' \>"; }}, ], height: 'auto', rowNum:50, rowTotal: 20000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager5", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", loadonce:true, caption:"Yarn Dyed Details", footerrow: true, loadComplete: function () { var sumOfPrice_issue_net_weight = jQuery("#list5").jqGrid('getCol','issue_net_weight',false,'sum'); var sumOfPrice_issue_gross_weight = jQuery("#list5").jqGrid('getCol','issue_gross_weight',false,'sum'); jQuery("#list5").jqGrid('footerData', 'set', { bale: 'Total:', issue_gross_weight: sumOfPrice_issue_gross_weight.toFixed(2) , issue_net_weight: sumOfPrice_issue_net_weight.toFixed(2) }); }, }); //$("#list2").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required jQuery("#list5").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list5").jqGrid('navGrid','#pager5', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } function fun_preview(rowId) { var id = rowId.closest('tr').attr('id'); //alert(id); var as=id; var v=$('#preview_id').val(); // alert(v); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("stock_history_details/yarn_stock_preview"); ?>', data:{'id':as}, async:false, success:function() { window.location.href = '<?php echo base_url('stock_history_details/yarn_stock_preview');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } </script> <style> #refresh_list4,#refresh_list5 { display:none !important; } .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'); ?>" /> <script> $(document).ready(function() { $( "#customer" ).autocomplete({ source: '<?php echo base_url('request/auto_sea'); ?>', }); }); function searchname() { var customer = document.getElementById('customer').value; $.ajax({ url:"<?php echo base_url('request/search_by_fetch')?>", dataType: "json", data:{'customer':customer}, type:"POST", async:true, success:function(data) { // alert('hai'); var obj=JSON.parse(data); document.getElementById('customer_id').value=obj[0].customerID; } }); } </script> <style> #jaytab{ width:100%; overflow:auto; } } #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-common-table { height:12px !important; } #refresh_list2 { display:none !important; } #client_edit { padding-right:12px !important; } #list2 { width: 1050px; height: 0px !important; } #gbox_list2 { height: auto !important; } #gview_list2 { height: auto !important; } @media only screen and (min-width:320px) and (max-width:641px){ .ui-jqgrid { margin-left: 1px !important; } .radio-list { margin-left:7% !important; } #table_pending_indent{ overflow-x: scroll; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 600px !important; padding-left: 0 !important; } #jaytab1 { margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 300px !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; } } #sData span, #cData span { margin-left: 3px; } #sData { height: 29px; } #cData { height: 29px; } .jqgfirstrow { height: 0px !important; } </style>