EVOLUTION-NINJA
Edit File: yarn_recieved_details_grid.php
<?php //include("menu.php"); error_reporting(E_ALL); ?> <script> function planningtypes(str) { if(str=="yarn_raw") { $('#table_yarn_raw').show(); $('#table_yarn_twisted').hide(); $('#table_yarn_dyed').hide(); } else if(str=="yarn_twisted") { $('#table_yarn_raw').hide(); $('#table_yarn_twisted').show(); $('#table_yarn_dyed').hide(); } else if(str=="yarn_dyed") { $('#table_yarn_raw').hide(); $('#table_yarn_twisted').hide(); $('#table_yarn_dyed').show(); } } </script> <script> function displaycustomer(str) { $.ajax({ type:"post", url:"<?php echo base_url(); ?>display_data/testingcustomer", data:"id="+str, success:function(data) { document.getElementById("dynamicdatamster").innerHTML=data; } }); } </script> <style> .badge { background: -webkit-radial-gradient( 1px -11px, circle, rgba(17, 208, 85, 0.98) 8%, rgb(7, 46, 80) 26px ); background-color: #ef0e0e; border: 1px solid white; border-radius: 12px; color: white; font: bold 12px/9px Helvetica, Verdana, Tahoma; height: 17px; padding: 3px 3px 0 3px; text-align: center; min-width: 19px; margin-bottom: 16px; } </style> <script> $(function () { $("#orderDate").datepicker({ dateFormat: "d-m-yy", changeMonth: true, changeYear: true }); }); </script> <?php //include("menu.php"); ?> <!-- BEGIN CONTENT --> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Yarn Delivery Confirmation </h3> <div class="page-bar"> <ul class="page-breadcrumb"> <li><i class="fa fa-home"></i> <a href="<?php echo base_url(); ?>dashboard/dashboard_fun">Home</a> <i class="fa fa-angle-right"></i> <a href="#" > Yarn </a></li> </ul> </div> <?php $this->load->view('import_module/masters_data_display'); ?> <?php if(empty($access_row)) { } else { if($access_row->insert_id == '1') { ?> <form action="<?php echo base_url(); ?>new_stores/yarn_add_received_details" method="post" class="form-horizontal"> <b>To insert data click here:</b> <input type="hidden" id="delete_id" name="delete_id" class="delete_id" value="<?php if(empty($access_row)){ } else { echo $access_row->delete_id; } ?>" > <input type="submit" name="Insert" value="Insert" /><br><br> </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="delete_id" class="delete_id" value="<?php if(empty($access_row)){ } else { echo $access_row->delete_id; } ?>" > <input type="hidden" id="edit_id" class="delete_id" value="<?php if(empty($access_row)){ } else { echo $access_row->edit_id; } ?>" > <div class="radio-list" style="margin-left: 2%;"> <input type="hidden" value="<?php echo $ref; ?>" id="ref_id" > <input type="hidden" value="<?php echo $url_val; ?>" id="url_ref" style="width: 230px;" > <?php if($ref == 'today_dashboard' || $ref == 'month_dashboard' || $ref == 'year_dashboard') { ?> <label class="radio-inline"> <!-- <input type="radio" name="customerType" value="existing"/>--> <input type="radio" checked="checked" name="planningorder" id="planningorder" onclick="planningtypes('yarn_raw')" /> Yarn - Raw</label><span class="badge"><?php echo $new_yarn_count1; ?></span> <label class="radio-inline"> <input type="radio" name="planningorder" id="planningorder" onclick="planningtypes('yarn_twisted')" /> Yarn - Twisted </label><span class="badge"><?php echo $new_yarn_count2; ?></span> <label class="radio-inline"> <input type="radio" name="planningorder" id="planningorder" onclick="planningtypes('yarn_dyed')" /> Yarn - Dyed</label><span class="badge"><?php echo $new_yarn_count3; ?></span> <?php } else { ?> <label class="radio-inline"> <!-- <input type="radio" name="customerType" value="existing"/>--> <input type="radio" checked="checked" name="planningorder" id="planningorder" onclick="planningtypes('yarn_raw')" /> Yarn - Raw</label> <label class="radio-inline"> <input type="radio" name="planningorder" id="planningorder" onclick="planningtypes('yarn_twisted')" /> Yarn - Twisted </label> <label class="radio-inline"> <input type="radio" name="planningorder" id="planningorder" onclick="planningtypes('yarn_dyed')" /> Yarn - Dyed</label> <?php } ?> </div><br> <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 statuss"> <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" onclick="update_tb()">Submit</button> </div> </div> </div> </div> </div> <!-- ----------------------------Yarn - Raw------------------------------------- --> <div id="table_yarn_raw"> <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> <!-- ----------------------------Yarn - Twisted------------------------------------- --> <div id="table_yarn_twisted"> <div id = "jaytab" 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> <!-- ----------------------------Yarn - Dyed------------------------------------- --> <div id="table_yarn_dyed"> <div id = "jaytab" 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> <!-- END DASHBOARD STATS --> </div> </div> </div> <!-- End BEGIN CONTAINER --> <!-- BEGIN FOOTER --> <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 --> <!-- 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'); ?>" /> <script> $("#addnew").click(function(e){ $.ajax({ url:"<?php echo base_url('request/autofill'); ?>", type:"GET", data:"", async:false, success:function(data){ $('#client_code1').val(data); if(data==''){ alert('Unsuccessful!'); } else{ var obj = jQuery.parseJSON(data); obj.id++; $("#customer").val(obj.customer_name); $("#customer_id").val(obj.customer_id); $("#reference").val(obj.reference); $("#orderDate").val(obj.date); $("#currency").val(obj.currency); $("#terms").val(obj.terms); } } }); e.preventDefault(); }); </script> <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_id1').value=obj.customerID; } }); } </script> <script> function myFunction() { //alert(); var customer = document.getElementById('customer').value; $.ajax({ url:"<?php echo base_url('request/search_by_customer')?>", dataType: "json", data:{'customer':customer}, type:"POST", async:true, success:function(data) { // alert('hai'); if(data=="") { alert('This customer is not a Swansilk Customer'); window.location.reload(); } else { 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> <script> function adddetails() { var customer=$("#customer").val(); var date=$("#date").val(); var product_type=$("#product_type").val(); var description=$("#description").val(); var size=$("#size").val(); var min_quality=$("#min_quality").val(); var customer_id=$("#customer_id").val(); var currency= $("#currency").val(); var article=$("#article").val(); var design=$("#design").val(); var price=$("#price").val(); var image=$("#image").val(); var reference= $("#reference").val(); var terms=$("#terms").val(); var quality= $("#quality").val(); var color=$("#color").val(); var composition=$("#composition").val(); var note=$("#note").val(); $.ajax({ url:"<?php echo base_url('request/customer_insert')?>", type:"POST", data:{'customer':customer,'date':date,'product_type':product_type,'description':description,'size':size,'min_quality':min_quality,'customer_id':customer_id,'currency':currency,'article':article,'design':design,'price':price,'image':image,'reference':reference,'terms':terms,'quality':quality,'color':color,'composition':composition,'note':note}, async:false, success:function(data){ alert('Successfully Added.'); //$("#editmodlist2").remove(); window.location.reload(); } }); } </script> <style> .page-content { min-height:1000px !important; } .tablediv { width:auto !important; overflow-x:scroll; } #search_list2 { display:none !important; } .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; } .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 !important; } .ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: -9px !important; } #sData { height: 27px; } #cData { height: 27px; } #dData { height: 27px; } #eData { height: 27px; } </style> <script> function getDesignAndQuality(articleNo) { $.ajax({ type: "post", url: "<?php echo base_url(); ?>marketing/getDesignAndQuality", data: "articleNo=" + articleNo, success: function (data) { // alert(); var objData = jQuery.parseJSON(data); // document.getElementById("design").value = objData.design; document.getElementById("quality").value = objData.arrArticleDet.quality; var comp=""; $.each(objData.composition, function(key,val){ comp +=val.yarnQuality +":" + ((val.sum)*100).toFixed(2) +"% " ; }); document.getElementById("composition").value = comp; } }); } </script> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <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" type="text/css" href="<?php echo base_url();?>assets/css/bootstrap-datepicker.min.css"/> <script src="<?php echo base_url();?>assets/js/bootstrap-datepicker.min.js"></script> <script> $('.datepicker').datepicker({ format: 'yyyy/mm/dd', }); </script> <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; text-align: right; padding-right: 24px !important; padding-left: 24px !important; } .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { overflow: hidden; white-space: pre; } </style> <style> </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <script> $(document).ready(function (){ var l=$("#ref_id").val(); jQuery("#list2").jqGrid({ url:"<?php echo base_url('vendor/confirmed_po_list_raw')?>/s"+l+"/", datatype: "json", colNames:['Id','PO No','Vendor Name','Date','Currency','Approved By','Remark','Status','Preview'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'po_no',index:'po_no', width:142,editable:false}, {name:'vendor_name',index:'vendor_name', editable:true,editrules:{required: true},width:270}, {name:'g_date',index:'g_date', width:100,editable:true,editrules:{required: true}}, {name:'currency',index:'currency', editable:true,editrules:{required: true},width:50}, {name:'approved_by',index:'approved_by', width:120,editable:true,editrules:{required: true}}, {name:'remark',index:'remark', width:120,editable:true,editrules:{required: true}}, {name:'complition_status',index:'complition_status', width:100,editable:true,editrules:{required: true}}, {name:'preview',index:'preview',align: "center",editable:false,editrules:{required: true}, width:100,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="yarn_raw_preview($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='PREVIEW' onclick='some_function' \>"; }}, ], height: 'auto', rowNum:50, rowTotal: 200000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager2", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", loadonce:true, caption:"Yarn - Raw Product 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('vendor/confirmed_po_list_subgrid');?>/s"+row_id+"/", //data:{'sub_id':123}, mtype : "get", datatype: "json", colNames:['Id','Indent No','Department','Product Name','Quantity','Unit','Rate','INR Value','SGST','CGST','IGST','Total Value','Status'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'indent_no',index:'indent_no', width:150,editable:true,editrules:{required: true}}, {name:'department',index:'department', editable:true,editrules:{required: true},width:100}, {name:'product_name',index:'product_name', width:150,editable:false}, {name:'quantity',index:'quantity', width:80,editable:true,editrules:{required: true}}, {name:'indent_unit',index:'indent_unit', width:80,editable:true,editrules:{required: true}}, {name:'unit',index:'unit', editable:true,editrules:{required: true},width:80}, {name:'inrvalue',index:'inrvalue', width:70,editable:true,editrules:{required: true}}, {name:'sgst',index:'sgst', editable:true,editrules:{required: true},width:55}, {name:'cgst',index:'cgst', editable:true,editrules:{required: true},width:55}, {name:'igst',index:'igst', editable:true,editrules:{required: true},width:55}, {name:'totalvalue',index:'totalvalue', width:90,editable:true,editrules:{required: true}}, {name:'quantity_approval',index:'quantity_approval', width:110,editable:true,editrules:{required: true}, formatter: 'text', editoptions: { value: '1:0' }, formatoptions: { disabled: false }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="update_status('+rawObject.id+')" '; } } ], height: 'auto', rowNum:20000000, sortname: 'num', sortorder: "asc" }); } }); //$("#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:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, multipleGroup:true, caption:"search" } ); // $("#list2").navButtonAdd('#pager2', // { caption:"Delete", // buttonicon:"ui-icon-trash", // onClickButton: deleteRow, // position: "last", // title:"", // cursor: "pointer", // id:"client_delete" // } // ); }); 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/purchase_order_list_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(); } else{ } } }); swal({ type: 'success', // title: 'Approved By', // html: '' + email }) }) ///alert(email); } else if (confirmMsg==false) { $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); } } function yarn_raw_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("new_stores/yarn_raw_preview"); ?>', data:{'id':as}, async:false, success:function() { var url_r=$('#url_ref').val(); if(url_r == '1') { window.open('<?php echo base_url('new_stores/yarn_raw_preview');?>/'+ '?id='+as+'&&type=1'); } else if(url_r == '2') { window.open('<?php echo base_url('new_stores/new_stores_yarn_raw_preview');?>/'+ '?id='+as); } else if(url_r == '3') { window.open('<?php echo base_url('new_stores/yarn_raw_view');?>/'+ '?id='+as); } else if(url_r == '4') { window.open('<?php echo base_url('new_stores/new_stores_yarn_raw_view');?>/'+ '?id='+as); } } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function update_status(key) { // var as = rowId.closest('tr').attr('id'); var as = key; // alert(as); // var dd= document.querySelector('statuss'); // var stat=dd.setAttribute("id", dd+as); var hh=$('.statuss').each(function() { $(this).attr("id", $(this).attr("id") + as); }); console.log(hh[0]); // alert(hh[0]); var v=$('#edit_id').val(); if(v == 1 || v == 2) { $('#row_id').val(as); $('#myModall').modal('show'); } else { swal({ title: "You Don't Have Access For This Edit", text: "", }); } } function update_tb(){ var id=$('#row_id').val(); // alert(id); var status=$("#statuss"+id).val(); $.ajax({ url:"<?php echo base_url('vendor/stat_updt')?>", type:"POST", data:{'id':id,'status':status}, async:false, success:function(data){ alert('Successfully Updated.'); //$("#editmodlist2").remove(); window.location.reload(); } }); } function deleteRow() { // Get the currently selected row var v=$('#delete_id').val(); if(v == 1) { 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/purchase_order_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(); } else { swal({ title: "You Don't Have Access For This Delete", text: "", }); } } </script> <script> $(document).ready(function (){ $('#table_yarn_raw').show(); $('#table_yarn_twisted').hide(); $('#table_yarn_dyed').hide(); var l=$("#ref_id").val(); jQuery("#list4").jqGrid({ url:"<?php echo base_url('vendor/confirmed_po_list_twisted')?>/s"+l+"/", datatype: "json", colNames:['Id','PO No','Vendor Name','Date','Currency','Approved By','Remark','Status','Preview'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'po_no',index:'po_no', width:130,editable:false}, {name:'vendor_name',index:'vendor_name', editable:true,editrules:{required: true},width:142}, {name:'g_date',index:'g_date', width:120,editable:true,editrules:{required: true}}, {name:'currency',index:'rate_inr', editable:true,editrules:{required: true},width:140}, {name:'approved_by',index:'approved_by', width:130,editable:true,editrules:{required: true}}, {name:'remark',index:'remark', width:120,editable:true,editrules:{required: true}}, {name:'complition_status',index:'complition_status', width:100,editable:true,editrules:{required: true}}, {name:'preview',index:'preview',align: "center",editable:false,editrules:{required: true}, width:110,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="yar_twisted_preview($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='PREVIEW' onclick='some_function' \>"; }}, ], height: 'auto', rowNum:50, rowTotal: 200000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager4", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", loadonce:true, caption:"Yarn - Twisted Product 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('vendor/confirmed_po_list_subgrid_twisted');?>/s"+row_id+"/", //data:{'sub_id':123}, mtype : "get", datatype: "json", colNames:['Id','Indent No','Department','Product Name','Shades','Quantity','Unit','Rate','INR Value','SGST','CGST','IGST','Total Value','Status'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'indent_no',index:'indent_no', width:150,editable:true,editrules:{required: true}}, {name:'department',index:'department', editable:true,editrules:{required: true},width:100}, {name:'product_name',index:'product_name', width:150,editable:false}, {name:'shades',index:'shades', width:60,editable:true,editrules:{required: true}}, {name:'quantity',index:'quantity', width:60,editable:true,editrules:{required: true}}, {name:'indent_unit',index:'indent_unit', width:60,editable:true,editrules:{required: true}}, {name:'unit',index:'unit', editable:true,editrules:{required: true},width:55}, {name:'inrvalue',index:'inrvalue', width:70,editable:true,editrules:{required: true}}, {name:'sgst',index:'sgst', editable:true,editrules:{required: true},width:55}, {name:'cgst',index:'cgst', editable:true,editrules:{required: true},width:55}, {name:'igst',index:'igst', editable:true,editrules:{required: true},width:55}, {name:'totalvalue',index:'totalvalue', width:100,editable:true,editrules:{required: true}}, {name:'quantity_approval',index:'quantity_approval', width:90,editable:true,editrules:{required: true}, formatter: 'text', editoptions: { value: '1:0' }, formatoptions: { disabled: false }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="update_status('+rawObject.id+')" '; } } ], height: 'auto', rowNum:20000000, sortname: 'num', sortorder: "asc" }); } }); //$("#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:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, multipleGroup:true, caption:"search" } ); // $("#list4").navButtonAdd('#pager4', // { caption:"Delete", // buttonicon:"ui-icon-trash", // onClickButton: deleteRoww, // position: "last", // title:"", // cursor: "pointer", // id:"client_delete" // } // ); }); 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/purchase_order_list_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(); } else{ } } }); swal({ type: 'success', // title: 'Approved By', // html: '' + email }) }) ///alert(email); } else if (confirmMsg==false) { $("#editmodlist4").remove(); $("#list4").trigger("reloadGrid"); } } function yar_twisted_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("new_stores/yarn_raw_preview"); ?>', data:{'id':as}, async:false, success:function() { var url_r=$('#url_ref').val(); if(url_r == '1') { window.open('<?php echo base_url('new_stores/yarn_raw_preview');?>/'+ '?id='+as+'&&type=2'); } else if(url_r == '2') { window.open('<?php echo base_url('new_stores/new_stores_yarn_raw_preview');?>/'+ '?id='+as); } else if(url_r == '3') { window.open('<?php echo base_url('new_stores/yarn_raw_view');?>/'+ '?id='+as); } else if(url_r == '4') { window.open('<?php echo base_url('new_stores/new_stores_yarn_raw_view');?>/'+ '?id='+as); } // window.location.href = '<?php echo base_url('new_stores/yarn_raw_preview');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function deleteRoww() { // Get the currently selected row var v=$('#delete_id').val(); if(v == 1) { var row = $("#list4").jqGrid('getGridParam','selrow'); $("#id").val(row); if( row != null ) $("#list4").jqGrid('delGridRow',row, { modal:true,jqModal:true, recreateForm: true, beforeSubmit: function(postdata,formid){ $.ajax({ url:"<?php echo base_url('vendor/purchase_order_delete');?>", type:"POST", data:{'id':row}, async:false, success:function(data){ if(data==""){ alert('Successfully Deleted'); $("#delmodlist4").remove(); $("#list4").trigger("reloadGrid"); window.location.reload(); } else{ alert('Successfully Deleted'); $("#delmodlist4").remove(); $("#list4").trigger("reloadGrid"); window.location.reload(); } } }); }, closeAfterEdit: true, reloadAfterSubmit:false, afterSubmit : false }); else $( "#dialogSelectRow" ).dialog(); } else { swal({ title: "You Don't Have Access For This Delete", text: "", }); } } </script> <script> $(document).ready(function (){ var l=$("#ref_id").val(); jQuery("#list5").jqGrid({ url:"<?php echo base_url('vendor/confirmed_po_list_dyed')?>/s"+l+"/", datatype: "json", colNames:['Id','PO No','Vendor Name','Date','Currency','Approved By','Remark','Status','Preview'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'po_no',index:'po_no', width:100,editable:false}, {name:'vendor_name',index:'vendor_name', editable:true,editrules:{required: true},width:155}, {name:'g_date',index:'g_date', width:112,editable:true,editrules:{required: true}}, {name:'currency',index:'rate_inr', editable:true,editrules:{required: true},width:142}, {name:'approved_by',index:'approved_by', width:120,editable:true,editrules:{required: true}}, {name:'remark',index:'remark', width:120,editable:true,editrules:{required: true}}, {name:'complition_status',index:'complition_status', width:100,editable:true,editrules:{required: true}}, {name:'preview',index:'preview',align: "center",editable:false,editrules:{required: true}, width:110,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="yar_dyed_preview($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='PREVIEW' onclick='some_function' \>"; }}, ], height: 'auto', rowNum:50, rowTotal: 20000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager5", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", loadonce:true, caption:"Yarn - Dyed Product 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('vendor/confirmed_po_list_subgrid_dyed');?>/s"+row_id+"/", //data:{'sub_id':123}, mtype : "get", datatype: "json", colNames:['Id','Indent No','Department','Product Name','DTL Shade','Shades','Color Code','Quantity','Unit','Rate','INR Value','SGST','CGST','IGST','Total Value','Status'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'indent_no',index:'indent_no', width:130,editable:true,editrules:{required: true}}, {name:'department',index:'department', editable:true,editrules:{required: true},width:90}, {name:'product_name',index:'product_name', width:190,editable:false}, {name:'shadeName',index:'shadeName', width:110,editable:false}, {name:'shade',index:'shade', width:70,editable:true,editrules:{required: true}}, {name:'color_code',index:'color_code', width:70,editable:true,editrules:{required: true}}, {name:'quantity',index:'quantity', width:70,editable:true,editrules:{required: true}}, {name:'indent_unit',index:'indent_unit', width:50,editable:true,editrules:{required: true}}, {name:'unit',index:'unit', editable:true,editrules:{required: true},width:50}, {name:'inrvalue',index:'inrvalue', width:72,editable:true,editrules:{required: true}}, {name:'sgst',index:'sgst', editable:true,editrules:{required: true},width:50}, {name:'cgst',index:'cgst', editable:true,editrules:{required: true},width:50}, {name:'igst',index:'igst', editable:true,editrules:{required: true},width:50}, {name:'totalvalue',index:'totalvalue', width:80,editable:true,editrules:{required: true}}, {name:'quantity_approval',index:'quantity_approval', width:90,editable:true,editrules:{required: true}, formatter: 'text', editoptions: { value: '1:0' }, formatoptions: { disabled: false }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="update_status('+rawObject.id+')" '; } } ], height: 'auto', rowNum:20000000, sortname: 'num', sortorder: "asc" }); } }); //$("#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:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, multipleGroup:true, caption:"search" } ); // $("#list5").navButtonAdd('#pager5', // { caption:"Delete", // buttonicon:"ui-icon-trash", // onClickButton: deleteRowww, // position: "last", // title:"", // cursor: "pointer", // id:"client_delete" // } // ); }); function fun2(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/purchase_order_list_yes_confirmation')?>", type:"POST", data:{'id':id,'remarks':email}, success:function(data){ if(data==""){ $("#editmodlist5").remove(); $("#list5").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) { $("#editmodlist5").remove(); $("#list5").trigger("reloadGrid"); } } function yar_dyed_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("new_stores/yarn_raw_preview"); ?>', data:{'id':as}, async:false, success:function() { var url_r=$('#url_ref').val(); if(url_r == '1') { window.open('<?php echo base_url('new_stores/yarn_raw_preview');?>/'+ '?id='+as+'&&type=3'); } else if(url_r == '2') { window.open('<?php echo base_url('new_stores/new_stores_yarn_raw_preview');?>/'+ '?id='+as); } else if(url_r == '3') { window.open('<?php echo base_url('new_stores/yarn_raw_view');?>/'+ '?id='+as); } else if(url_r == '4') { window.open('<?php echo base_url('new_stores/new_stores_yarn_raw_view');?>/'+ '?id='+as); } // window.location.href = '<?php echo base_url('new_stores/yarn_raw_preview');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function deleteRowww() { // Get the currently selected row var v=$('#delete_id').val(); if(v == 1) { var row = $("#list5").jqGrid('getGridParam','selrow'); $("#id").val(row); if( row != null ) $("#list5").jqGrid('delGridRow',row, { modal:true,jqModal:true, recreateForm: true, beforeSubmit: function(postdata,formid){ $.ajax({ url:"<?php echo base_url('vendor/purchase_order_delete');?>", type:"POST", data:{'id':row}, async:false, success:function(data){ if(data==""){ alert('Successfully Deleted'); $("#delmodlist5").remove(); $("#list5").trigger("reloadGrid"); window.location.reload(); } else{ alert('Successfully Deleted'); $("#delmodlist5").remove(); $("#list5").trigger("reloadGrid"); window.location.reload(); } } }); }, closeAfterEdit: true, reloadAfterSubmit:false, afterSubmit : false }); else $( "#dialogSelectRow" ).dialog(); } else { swal({ title: "You Don't Have Access For This Delete", text: "", }); } } </script> <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> <script> var form = document.getElementById('formID'); // form has to have ID: <form id="formID"> form.noValidate = true; form.addEventListener('submit', function(event) { // listen for form submitting if (!event.target.checkValidity()) { event.preventDefault(); // dismiss the default functionality alert('Please, fill the form'); // error message } }, false); </script> <script> $(document).ready(function(){ $('#min_quality').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#customer').on('change keyup', function() { var sanitized = $(this).val().replace(/[^a-zA-Z -]+$/,''); $(this).val(sanitized); }); }); </script> <style> #search_list4 { display:none !important; } #refresh_list4 { display:none !important; } #search_list5 { display:none !important; } #refresh_list5 { 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:18px !important; } #list2 { width: 1050px; height: 0px !important; } #gview_list2 { height: auto !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; } } .tablediv { text-transform: uppercase !important; } .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } </style> <script> function remove() { var customer=$("#customer").val(''); var date=$("#date").val(''); var product_type=$("#product_type").val(''); var description=$("#description").val(''); var size=$("#size").val(''); var min_quality=$("#min_quality").val(''); var customer_id=$("#customer_id").val(''); var currency= $("#currency").val(''); var article=$("#article").val(''); var design=$("#design").val(''); var price=$("#price").val(''); var image=$("#image").val(''); var reference= $("#reference").val(''); var terms=$("#terms").val(''); var quality= $("#quality").val(''); var color=$("#color").val(''); var composition=$("#composition").val(''); var note=$("#note").val(''); } </script> <style> #gbox_list2{ width:1300px !important; } #gbox_list4{ width:1300px !important; } #gbox_list5{ width:1300px !important; } #jaytab { overflow-x:scroll; } @media only screen and (min-width:320px) and (min-height:640px){ #gview_list2{ width:100% !important; } .ui-jqgrid-hdiv{ width:100% !important; } .ui-jqgrid-htable{ width:100% !important; } #list2{ width:100% !important; } } @media only screen and (min-width:992px) and (max-width:1258px) { #jaytab { overflow-x:scroll; } } </style>