EVOLUTION-NINJA
Edit File: design_weaving_grid.php
<script> function planningtypes(str) { if(str=="current_development") { $('#completed_design').hide(); $('#pending_article').hide(); $('#current_development').show(); $('#type').val('current'); $('#current').show(); $('#pending').hide(); $('#final').hide(); } else if(str=="pending_article") { $('#completed_design').hide(); $("#list3").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); $('#pending_article').show(); $('#current_development').hide(); $('#type').val('pending'); $('#current').hide(); $('#pending').show(); $('#final').hide(); } else if(str=="completed_design") { $('#completed_design').show(); $('#pending_article').hide(); $('#current_development').hide(); $('#type').val('complete'); $('#current').hide(); $('#pending').hide(); $('#final').show(); } } </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; } .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"> Design Weaving Program </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="#" > Design Weaving Program </a></li> </ul> </div> <?php if(empty($access_row)) { } else { if($access_row->insert_id == '1') { ?> <form action="<?php echo base_url(); ?>design_weaving/design_weaving_pgm" method="post" class="form-horizontal"> <b>To insert data click here:</b> <input type="hidden" value="<?php echo $url_val; ?>" id="url_reference_val" name="url_reference_val" style="width: 230px;" > <input type="submit" name="Insert" value="Insert" /><br><br> </form> <input type="button" name="co" onclick="attachments()" value="View Attachments" /> <?php } else { ?> <?php } }?> <input type="hidden" id="insert_id" class="insert_id" value="<?php if(empty($access_row)){ } else { echo $access_row->insert_id; } ?>" > <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="hidden" id="delete_id" class="delete_id" value="<?php if(empty($access_row)){ } else { echo $access_row->delete_id; } ?>" > <input type="hidden" id="approval_id" class="approval_id" value="<?php if(empty($access_row)){ } else { echo $access_row->approval_id; } ?>" > <input type="hidden" id="hhh_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" checked="checked" name="planningorder" id="planningorder" onclick="planningtypes('current_development')" /> Current Development </label> <span class="badge"><?php echo $current_design_weaving; ?></span> <label class="radio-inline"> <input type="radio" name="planningorder" id="planningorder" onclick="planningtypes('pending_article')" /> Pending for Article</label> <span class="badge"><?php echo $pending_design_weaving; ?></span> <label class="radio-inline"> <input type="radio" name="planningorder" id="planningorder" onclick="planningtypes('completed_design')" /> Completed Designs</label> <span class="badge"><?php echo $complete_design_weaving; ?></span> <?php } else { ?> <label class="radio-inline"> <input type="radio" checked="checked" name="planningorder" id="planningorder" onclick="planningtypes('current_development')" /> Current Development </label> <label class="radio-inline"> <input type="radio" name="planningorder" id="planningorder" onclick="planningtypes('pending_article')" /> Pending for Article</label> <label class="radio-inline"> <input type="radio" name="planningorder" id="planningorder" onclick="planningtypes('completed_design')" /> Completed Designs</label> <?php } ?> <?php if(empty($access_row)) { } else { if($access_row->preview_id == '1') { ?> <input type="submit" id="generate_submit" value="Submit" class="generate_submit" style="float: right; !important;margin-right: 22px;"/> <?php } else { ?> <?php } }?> <span class="current" id="current" > <input type="submit" id="less_current" value="view" onclick="show_current();" style="float: right;margin-right: 12px;"/> <input type="submit" id="more_current" value="view" onclick="hide_current();" style="display:none;float: right;margin-right: 12px;"/> </span> <span class="pending" id="pending" style="display:none;"> <input type="submit" id="less_pending" value="view" onclick="show_pending();" style="float: right;margin-right: 12px;"/> <input type="submit" id="more_pending" value="view" onclick="hide_pending();" style="display:none;float: right;margin-right: 12px;" /> </span> <span class="final" id="final" style="display:none;"> <input type="submit" id="less_final" value="view" onclick="show_final();" style="float: right;margin-right: 12px;"/> <input type="submit" id="more_final" value="view" onclick="hide_final();" style="display:none;float: right;margin-right: 12px;"/> </span> </div> <br/> <div id="current_development" class="table-responsive"> <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="pending_article" class="table-responsive" style="display:none;"> <div id = "jaytab" 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="completed_design" class="table-responsive" style="display:none;"> <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> <form action="<?php echo base_url('design_weaving/multiple_select_ids'); ?>" method="post" class="form"> <input type="hidden" id="type" name="type" value="<?php echo "current"; ?>"> <input type="hidden" id="checked_ids" name="checked_ids" class="checked_ids"> <input type="hidden" value="<?php echo $ref; ?>" name="reference_val" id="reference_val" > </form> </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'); ?>" /> <script> $("#less_current").click(function() { $("#more_current").show(); $("#less_current").hide(); }); $("#more_current").click(function() { $("#less_current").show(); $("#more_current").hide(); }); $("#less_pending").click(function() { $("#more_pending").show(); $("#less_pending").hide(); }); $("#more_pending").click(function() { $("#less_pending").show(); $("#more_pending").hide(); }); $("#less_final").click(function() { $("#more_final").show(); $("#less_final").hide(); }); $("#more_final").click(function() { $("#less_final").show(); $("#more_final").hide(); }); </script> <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> <script> function getDesignAndQuality(articleNo) { $.ajax({ type: "post", url: "<?php echo base_url(); ?>marketing/getDesignAndQuality", data: "articleNo=" + articleNo, success: function (data) { var objData = jQuery.parseJSON(data); document.getElementById("design").value = objData.design; document.getElementById("quality").value = objData.quality; } }); } </script> <!-----------------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; } </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <script> <!----------------------------------Current Development -------------------------------> $(document).ready(function (){ var l=$("#ref_id").val(); jQuery("#list2").jqGrid({ url:"<?php echo base_url('design_weaving/current_development_grid')?>/s"+l+"/", datatype: "json", colNames:['Id','ID','SELECT','DATE','IN-HOUSE DESIGN','DESIGN#','REED','EPC','TOATL ENDS','WEFT RATIO','AVG PPC','WEAVE','Attachments','DESIGNER','CREATED BY','EDIT','PREVIEW','DELETE','FINALIZE'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'uni_id',index:'uni_id',hidden:false, editable:true,width:100}, {name:'edit',index:'edit',align: "center",editable:false,editrules:{required: true}, width:130,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick=" " '; },formatter:function (cellvalue, options, rowObject) { return "<input type='checkbox' value=id \>"; }}, {name:'current_date',index:'current_date', width:120,editable:false}, {name:'inhouse_final_design',index:'inhouse_final_design', width:120,editable:true,editrules:{required: true}}, {name:'design',index:'design', width:120,editable:true,editrules:{required: true}}, {name:'reed',index:'reed', width:120,editable:true,hidden:true,editrules:{required: true}}, {name:'epc',index:'epc', width:120,editable:true,hidden:true,editrules:{required: true}}, {name:'warp_ttl_ends',index:'warp_ttl_ends', width:120,editable:true,editrules:{required: true}}, {name:'weft_ratio',index:'weft_ratio', hidden:true,width:120,editable:true,editrules:{required: true}}, {name:'weft_ttl_ppc',index:'weft_ttl_ppc', width:120,editable:true,editrules:{required: true}}, {name:'weave',index:'weave', editable:true,editrules:{required: true},width:120}, {name:'attachments',index:'attachments',width:50,editable:true,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_radio_val($(this))" '; }, formatter: function radio(cellValue, option) { return '<input type="radio" name="radio_' + option.id + '" />'; } }, {name:'design_name',index:'design_name',hidden:true, width:120,editable:true,editrules:{required: true}}, {name:'created_by',index:'created_by', width:120,editable:false}, {name:'preview',index:'preview',align: "center",editable:false,editrules:{required: true}, width:200,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_edit_pgm($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='Edit' onclick='some_function' classes='preview' \>"; }}, {name:'preview',index:'preview',align: "center",editable:false,editrules:{required: true}, width:200,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_preview($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='PREVIEW' onclick='some_function' classes='preview' \>"; }}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:200,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_design_delete($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='DELETE' onclick='some_function' classes='preview' \>"; }}, {name:'status',index:'status',align: "center",editable:false,editrules:{required: true}, width:150,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun1($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='checkbox' id='check' class='check' value='SELECT' \>"; }}, ], 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:"asc", loadonce:true, caption:"Current Development Details", }); //$("#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_design_delete(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; // alert(as); var v=$('#delete_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("design_weaving/design_weaving_delete"); ?>', data:{'as':as}, async:false, success:function() { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); } else { swal({ title: "You Don't Have Access For This Delete", text: "", }); } } function fun_back_development(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("design_weaving/design_weaving_update_preview"); ?>', data:{'as':as}, async:false, success:function() { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); $("#list3").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); $("#list4").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); } function fun_preview(rowId) { var v=$('#preview_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("design_weaving/design_weaving_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('design_weaving/design_weaving_preview');?>/'+ '?id='+as; } else if(url_r == '2') { window.location.href = '<?php echo base_url('design_weaving/design_weaving_view');?>/'+ '?id='+as; } else if(url_r == '3') { window.location.href = '<?php echo base_url('design_weaving/dsgn_weaving_preview');?>/'+ '?id='+as; } else if(url_r == '4') { window.location.href = '<?php echo base_url('design_weaving/design_weaving_data');?>/'+ '?id='+as; } } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function fun_edit_pgm(rowId) { var v=$('#edit_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("design_weaving/current_development_edit"); ?>', data:{'as':as}, async:false, success:function() { var url_r=$('#url_ref').val(); if(url_r == '1') { window.location.href = '<?php echo base_url('design_weaving/current_development_edit');?>/'+ '?id='+as; } else if(url_r == '2') { window.location.href = '<?php echo base_url('design_weaving/design_current_development_edit');?>/'+ '?id='+as; } else if(url_r == '3') { window.location.href = '<?php echo base_url('design_weaving/design_weaving_current_development_edit');?>/'+ '?id='+as; } else if(url_r == '4') { window.location.href = '<?php echo base_url('design_weaving/dsgn_weaving_current_development_edit');?>/'+ '?id='+as; } } }); } else { swal({ title: "You Don't Have Access For This Edit", text: "", }); } } function fun1(rowId) { var v=$('#approval_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); $.ajax({ url:"<?php echo base_url('design_weaving/finalize_inhouse_confirmation')?>", type:"POST", data:{'id':id}, success:function(data) { var obj = jQuery.parseJSON(data); if(obj == "not_entered") { swal({ title: "Fill In-House Final Design Field", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } else { var id = rowId.closest('tr').attr('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({ url:"<?php echo base_url('design_weaving/finalize_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"); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } else{ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } }); swal({ type: 'success', // title: 'Approved By', // html: '' + 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(); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } else{ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } }); } } } }); } else { swal({ title: "You Don't Have Access For This Approval", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } function show_current () { var colPos = 0; var navGrid = $('#list2'); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[2].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); } function hide_current() { var colPos = 0; var navGrid = $('#list2'); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[1].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[2].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[7].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[8].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[10].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[11].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[13].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")[1].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); } <!----------------------------------Pending for Article -------------------------------> $(document).ready(function (){ var l=$("#ref_id").val(); jQuery("#list3").jqGrid({ url:"<?php echo base_url('design_weaving/pending_article_grid')?>/s"+l+"/", datatype: "json", colNames:['Id','ID','SELECT','DATE','IN-HOUSE DESIGN','DESIGN#','REED','EPC','TOATL ENDS','WEFT RATIO','AVG PPC','WEAVE','Attachments','DESIGNER','FINALIZED BY','EDIT','DELETE','PREVIEW','Back to Current Development'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:70}, {name:'uni_id',index:'uni_id',hidden:false, width:50,editable:true,width:80}, {name:'edit',index:'edit',align: "center",editable:false,editrules:{required: true}, width:130,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick=" " '; },formatter:function (cellvalue, options, rowObject) { return "<input type='checkbox' value=id \>"; }}, {name:'current_date',index:'current_date', width:100,editable:false}, {name:'inhouse_final_design',index:'inhouse_final_design', width:100,editable:true,editrules:{required: true}}, {name:'design',index:'design', width:100,editable:true,editrules:{required: true}}, {name:'reed',index:'reed', width:100,editable:true,hidden:true,editrules:{required: true}}, {name:'epc',index:'epc', width:100,editable:true,hidden:true,editrules:{required: true}}, {name:'warp_ttl_ends',index:'warp_ttl_ends', width:90,editable:true,editrules:{required: true}}, {name:'weft_ratio',index:'weft_ratio', hidden:true,width:80,editable:true,editrules:{required: true}}, {name:'weft_ttl_ppc',index:'weft_ttl_ppc', width:80,editable:true,editrules:{required: true}}, {name:'weave',index:'weave', editable:true,editrules:{required: true},width:90}, {name:'attachments',index:'attachments',width:50,editable:true,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_radio_val($(this))" '; }, formatter: function radio(cellValue, option) { return '<input type="radio" name="radio_' + option.id + '" />'; } }, {name:'design_name',index:'design_name',hidden:true, width:100,editable:true,editrules:{required: true}}, {name:'approved_by',index:'approved_by', width:100,editable:false}, {name:'preview',index:'preview',align: "center",editable:false,editrules:{required: true}, width:100,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_edit($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='Edit' onclick='some_function' classes='preview' \>"; }}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:200,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_design_delete1($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='DELETE' onclick='some_function' classes='preview' \>"; }}, {name:'preview',index:'preview',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' class='fa fa-eye' value='PREVIEW' onclick='some_function' classes='preview' \>"; }}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:100,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_back_development($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='Back To Current Development' onclick='some_function' classes='preview' \>"; }}, ], height: 'auto', rowNum:50, rowTotal: 200000000000000000000000000, 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:"Pending For Article Details", }); //$("#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 fun_design_delete1(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; // alert(as); var v=$('#delete_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("design_weaving/design_weaving_delete"); ?>', data:{'as':as}, async:false, success:function() { $("#list3").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); } else { swal({ title: "You Don't Have Access For This Delete", text: "", }); } } function fun_edit(rowId) { var v=$('#edit_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("design_weaving/pending_article_edit"); ?>', data:{'as':as}, async:false, success:function() { var url_r=$('#url_ref').val(); if(url_r == '1') { window.location.href = '<?php echo base_url('design_weaving/pending_article_edit');?>/'+ '?id='+as; } else if(url_r == '2') { window.location.href = '<?php echo base_url('design_weaving/design_pending_article_edit');?>/'+ '?id='+as; } else if(url_r == '3') { window.location.href = '<?php echo base_url('design_weaving/design_weaving_pending_article_edit');?>/'+ '?id='+as; } else if(url_r == '4') { window.location.href = '<?php echo base_url('design_weaving/dsgn_weaving_pending_article_edit');?>/'+ '?id='+as; } } }); } else { swal({ title: "You Don't Have Access For This Edit", text: "", }); } } function show_pending () { var colPos = 0; var navGrid = $('#list3'); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[2].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); } function hide_pending() { var colPos = 0; var navGrid = $('#list3'); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[1].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[2].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[7].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[8].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[10].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[11].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[13].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")[1].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); } <!----------------------------------Completed Designs -------------------------------> $(document).ready(function (){ var l=$("#ref_id").val(); jQuery("#list4").jqGrid({ url:"<?php echo base_url('design_weaving/complete_design_grid')?>/s"+l+"/", datatype: "json", colNames:['Id','ID','SELECT','DATE','ARTICLE','FINISHED WIDTH','IN-HOUSE DESIGN','DESIGN#','REED','EPC','TOATL ENDS','WEFT RATIO','AVG PPC','WEAVE','Attachments','DESIGNER','COMPLETED BY','PREVIEW'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:50}, {name:'uni_id',index:'uni_id',hidden:false, width:50,editable:true,width:50}, {name:'edit',index:'edit',align: "center",editable:false,editrules:{required: true}, width:130,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick=" " '; },formatter:function (cellvalue, options, rowObject) { return "<input type='checkbox' value=id \>"; }}, {name:'current_date',index:'current_date', width:90,editable:false}, {name:'article',index:'article', width:85,editable:false}, {name:'finished_width',index:'finished_width', width:85,editable:false}, {name:'inhouse_final_design',index:'inhouse_final_design', width:90,editable:true,editrules:{required: true}}, {name:'design',index:'design', width:100,editable:true,editrules:{required: true}}, {name:'reed',index:'reed',hidden:true, width:100,editable:true,editrules:{required: true}}, {name:'epc',index:'epc',hidden:true, width:100,editable:true,editrules:{required: true}}, {name:'warp_ttl_ends',index:'warp_ttl_ends', width:90,editable:true,editrules:{required: true}}, {name:'weft_ratio',index:'weft_ratio',hidden:true, width:100,editable:true,editrules:{required: true}}, {name:'avg_ppc',index:'avg_ppc',hidden:true, width:100,editable:true,editrules:{required: true}}, {name:'weave',index:'weave', editable:true,editrules:{required: true},width:90}, {name:'attachments',index:'attachments',width:50,editable:true,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_radio_val($(this))" '; }, formatter: function radio(cellValue, option) { return '<input type="radio" name="radio_' + option.id + '" />'; } }, // {name:'reed',index:'reed', editable:true,editrules:{required: true},width:120}, // {name:'epc',index:'epc', editable:true,editrules:{required: true},width:120}, // {name:'reed_width',index:'reed_width', width:120,editable:false}, {name:'design_name',index:'design_name', width:100,editable:true,editrules:{required: true}}, {name:'finalized_by',index:'finalized_by', width:100,editable:false}, {name:'preview',index:'preview',align: "center",editable:false,editrules:{required: true}, width:95,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_final_preview($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='PREVIEW' onclick='some_function' classes='preview' \>"; }}, ], 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:"asc", loadonce:true, caption:"Completed Design Details", }); //$("#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 fun_final_preview(rowId) { var v=$('#preview_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("design_weaving/design_weaving_final_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('design_weaving/design_weaving_final_preview');?>/'+ '?id='+as; } else if(url_r == '2') { window.location.href = '<?php echo base_url('design_weaving/design_weaving_final_view');?>/'+ '?id='+as; } else if(url_r == '3') { window.location.href = '<?php echo base_url('design_weaving/designweaving_final_preview');?>/'+ '?id='+as; } else if(url_r == '4') { window.location.href = '<?php echo base_url('design_weaving/dsgn_weaving_final_preview');?>/'+ '?id='+as; } } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function show_final () { var colPos = 0; var navGrid = $('#list4'); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[2].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('showCol', navGrid.getGridParam("colModel")[16].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[17].name); } function hide_final() { var colPos = 0; var navGrid = $('#list4'); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[1].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[2].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[7].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[9].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[10].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[12].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[13].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[15].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")[1].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> <style> .preview { padding-bottom:3px !important; padding-top:3px !important; } .preview { padding-bottom:3px !important; padding-top:3px !important; } .tablediv { width: auto !important; overflow: scroll !important; } .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { overflow: hidden; white-space: pre; } </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; } }); } $("#generate_submit").on('click', function () { var id=''; $("input[type=checkbox]:checked").each(function() { id += $(this).closest('tr').attr('id') + "|"; }); $(".checked_ids").val(''); $(".checked_ids").val(id); $(".form").submit(); }); function fun_radio_val(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var m=$('#hhh_id').val(as); // alert(as); // var n=$('#ref_id').val(as); } function attachments(){ // var id = rowId.closest('tr').attr('id'); var as=$('#hhh_id').val(); //var as=id; alert(as); var v=$('#edit_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("design_weaving/view_image"); ?>', data:{'as':as}, async:false, success:function() { var url_r=$('#url_ref').val(); if(url_r == '1') { // window.location.href = '<?php echo base_url('marketing/orderinput');?>/'+ '?id='+as; window.open('<?php echo base_url('design_weaving/view_image');?>/'+as); } } }); } else { swal({ title: "You Don't Have Access For This ", text: "", }); } } </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>