EVOLUTION-NINJA
Edit File: pending_order_grid.php
<style> .ui-jqgrid { text-transform: capitalize !important; } #client_delete { display:none; } .tablediv { text-transform: uppercase !important; } .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } .jaytab { overflow-x: hidden !important; } </style> <script> //$('#table_planned').hide(); function planningtypes(str) { if(str=="productlist") { $('#table_planned').hide(); $('#table_unplanned').hide(); $('#productgrid').show(); $('#generate').show(); } else if(str=="unconfirmed") { $('#table_unplanned').hide(); $('#productgrid').hide(); $('#table_planned').show(); $('#generate').hide(); } else if(str=="confirmed") { $('#table_planned').hide(); $('#table_unplanned').show(); $('#productgrid').hide(); $('#generate').hide(); } } </script> <style> .checkbox-success input[type="checkbox"]:checked + label::before { background-color: #5cb85c!important; border-color: #5cb85c !important; } .checkbox-success input[type="checkbox"]:checked + label::after { color: #fff !important; } </style> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Pending Order Details </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="#" > Pending PO </a></li> </ul> </div> <?php if(empty($access_row)) {?> <input type="hidden" id="insert_id" class="insert_id" value="<?php echo '0' ?>" > <input type="hidden" id="edit_id" class="edit_id" value="<?php echo '0'; ?>" > <?php } else { ?> <input type="hidden" id="insert_id" class="insert_id" value="<?php echo $access_row->insert_id; ?>" > <input type="hidden" id="edit_id" class="edit_id" value="<?php echo $access_row->edit_id; ?>" > <input type="hidden" id="delete_id" class="delete_id" value="<?php echo $access_row->delete_id; ?>" > <?php } ?> <div class="radio-list" style="margin-left: 2%;"> <div id="unplanned"> <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> <form action="<?php echo base_url('vendor/generated_product_wish_list'); ?>" method="post" class="form"> <input type="hidden" id="ids" name="ids" class="ids"> </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'); ?>" /> <style> thead{ background-color:rgb(87,142,190) !important; color:white !important; } #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; } #productgrid{ //height:380px; //overflow-y: scroll; } @media only screen and (min-width:320px) and (min-height:640px){ } </style> <script> $("#generate").on('click', function () { //alert(); var checkbox_value = ""; $(":checkbox").each(function () { var ischecked = $(this).is(":checked"); if (ischecked) { checkbox_value += $(this).val() + "|"; } }); // alert(checkbox_value); if(checkbox_value=="") { swal({ title: "Please Select the Products.", text: "", }); } else { var ids= $(".ids").val(checkbox_value); // alert(ids); $(".form").submit(); // <!-- $.ajax({ // type: "post", // url: "<?php echo base_url(); ?>vendor/generated_product_wish_list", // data: "checkbox_value=" + checkbox_value, // success: function (data) { // window.location.href = '<?php echo base_url('vendor/po_generate');?>'; // } // });--> } }); 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-------------> <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" 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 { padding-bottom: 8px !important; display: initial !important; cursor:pointer; text-align: right; padding-right: 23px !important; padding-left: 13px !important; } .coleditt { padding-bottom: 8px !important; display: initial !important; padding-left: 9px !important; padding-right: 8px !important; } .coledit1 { text-align: right; padding-right: 27px !important; padding-left: 27px !important; } .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { overflow: hidden; white-space: pre; } </style> <style> #table_planned { display:none; } #table_unplanned { display:none; } .jqgfirstrow { height: 0px !important; } .list1 { height: 0px !important; } </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <style> #refresh_list1 { display:none; } </style> <script> $(document).ready(function (){ //var l=$("#loc").val(); //alert(l); jQuery("#list2").jqGrid({ url:"<?php echo base_url('quality_check/add_indent_grid')?>", datatype: "json", colNames:['Id','Required ON','Product','Width','Shades','Quantity','Product Type','Indent No','Department','Purpose','Indent By'], colModel:[ {name:'id',index:'id',hidden:true, editable:true,width:200}, {name:'required_on',index:'required_on', editable:true,editrules:{required: true},width:500}, {name:'add_product',index:'add_product', editable:true,editrules:{required: true},width:500}, {name:'width',index:'width', editable:true,editrules:{required: true},width:500}, {name:'shades',index:'shades', editable:true,editrules:{required: true},width:500}, {name:'quantity',index:'quantity', editable:true,editrules:{required: true},width:500}, {name:'product_type',index:'product_type', editable:true,editrules:{required: true},width:500}, {name:'indent_no',index:'indent_no', width:370,editable:false}, {name:'department',index:'department', width:370,editable:true,editrules:{required: true}}, {name:'purpose',index:'purpose', editable:true,editrules:{required: true},width:500}, {name:'indented_by',index:'indented_by', editable:true,editrules:{required: true},width:500}, ], 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:"Confirmed Indent 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/add_indent_subgrid');?>/s"+row_id+"/", //data:{'sub_id':123}, mtype : "get", datatype: "json", colNames:['Id','Product','Quantity','Unit','Purpose/OSL No.','Required On','Approve','Approved By','Action','Generate PO','Delete','Remark'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true}, {name:'add_product',index:'add_product', width:300,editable:true,editrules:{required: true}}, {name:'quantity',index:'quantity', editable:true,editrules:{required: true},width:60}, {name:'unit',index:'unit', editable:true,editrules:{required: true},width:50}, {name:'purpose', index:'purpose', width:200,editable:true,editrules:{required: true}}, {name:'required_on',index:'required_on', editable:true,editrules:{required: true},width:80}, { name: 'confirm', index: 'confirm', width: 60, align: 'center', formatter: 'checkbox', editoptions: { value: '1:0' }, formatoptions: { disabled: false }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun($(this))" '; } }, {name:'approved_by',index:'approved_by', width:90,editable:true,editrules:{required: true}}, {name:'edit',index:'edit',align: "center",editable:false,editrules:{required: true}, width:80,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_edit1($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='SELECT' \>"; }}, {name:'generate_po',index:'generate_po',align: "center",editable:false,editrules:{required: true}, width:90,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_generate($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='GENERATE' \>"; }}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:80,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_delete($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='DELETE' \>"; }}, {name:'remark',index:'remark', width:250,editable:true,editrules:{required: true}} // {name:'edit',index:'edit',align: "right",editable:true,style:'cursor:pointer',editrules:{required: true},width:102,classes:'fa fa-pencil-square-o coledit',formatter:'showlink',formatoptions:{baseLinkUrl:'<?php echo base_url('vendor/indent_id')?>'}}, // {name:'generate_po',index:'generate_po',align: "right",editable:true,style:'cursor:pointer',editrules:{required: true},width:102,classes:'fa fa-refresh coleditt',formatter:'showlink',formatoptions:{baseLinkUrl:'<?php echo base_url('vendor/purchase_order_indent_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:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); $("#list2").navButtonAdd('#pager2', { caption:"Delete", buttonicon:"ui-icon-trash", onClickButton: deleteRow, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); }); function fun_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("vendor/vendor_delete_fun"); ?>', 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_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 fun_edit1(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 fun_generate(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#insert_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("vendor/purchase_order_indent_id"); ?>', data:{'as':as}, async:false, success:function() { window.location.href = '<?php echo base_url('vendor/purchase_order_indent_id');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Generate", text: "", }); } } 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(); $("#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) { $.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(); } else{ } } }); } } 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/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(); } 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> <style> #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; } #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 { width: auto !important; overflow: auto !important; } #sData span, #cData span { } #sData { height: 29px; } #cData { height: 29px; } .jqgfirstrow { height: 0px !important; } .jaytab { overflow-x:scroll; } </style>