EVOLUTION-NINJA
Edit File: po_genereted_list_old.php
<?php $this->load->view('includes/header');?> <link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"> <section class="content-header"> <h1>Generated WO List </h1> </section> <!--- section 1 --> <section class="content"> <div class="row" style=""> <div class="col-sm-1"></div> <div id = "jaytab3" style="margin-top:3%" class="col-sm-10 grid"> <div class="grid_div"></div> <table id="list3"></table> <div id="pager3"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> </div> <!--- col-sm-8 --> <div class="col-sm-0 col-md-1"></div> </section> <!--- section 2 --> <style type="text/css"> .form-control:focus, input[type="Submit"]:focus, input[type="button"]:focus { border-color: #FF0000; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(255, 0, 0, 0.6); } #FrmGrid_list3 { //width: 100% !important; } .ui-jqdialog .ui-jqdialog-titlebar { height: 29px !important; background-color: #001a00; color: white; padding-left: 10px; } .fm-button { height: 21px !important; padding: 1px; margin-right: 10px !important; height: 21px !important; width: 50%; margin-top: -7px !important; } .ui-jqdialog-content td.navButton { padding-top: 12px !important; } .ui-jqgrid .ui-jqgrid-titlebar { height: 27px !important; background:#AF0100 !important; color:white !important; } .ui-jqgrid-bdiv { //height: 232px !important; } .ui-widget-overlay { z-index:0 !important; } .ui-widget-header { background: #1e7ad7 !important; } .ui-jqgrid-hdiv ui-state-default { width: 873px !important; cursor: default!important } ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #fed22f; background: #ffe45c; } .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { font-weight: bold; color: black; } .ui-jqgrid .ui-jqgrid-bdiv { overflow-y: scroll; //overflow-x: hidden; } .agr_appr { font-weight:bold !important; color:#AF0100; cursor: pointer; } </style> <!-- This is the Javascript file of jqGrid --> <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.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.css'); ?>" /> <!-- 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.css'); ?>" /> <script src="<?php echo base_url('assets/js/jquery-ui.js'); ?>" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function (){ jQuery("#list3").jqGrid({ url:"<?php echo site_url('work_order_wo_generated_list')?>", mtype : "post", datatype: "json", colNames:['SI','Vendor','WO NO','Date','Currency','Vendor Address','CANCEL','EDIT','VIEW','MAIL'], colModel:[ {name:'id',index:'id', width:150, hidden:true,editable:false,key:true}, {name:'vendor',index:'vendor', width:150, editable:false}, {name:'po_no',index:'po_no', width:150,editable:false}, {name:'date',index:'date', width:150, editable:false}, {name:'currency',index:'currency', width:150, editable:false}, {name:'vendor_address',index:'vendor_address', width:150, editable:false}, {name:'cancel_status',index:'cancel_status',classes:'agr_appr',align: "center",editable:false,editrules:{required: true}, width:100,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_cancel($(this))" '; }}, {name:'edit',index:'edit',align: "center",editable:false,search:false,editrules:{required: true}, width:80,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_edit($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='EDIT' \>"; }}, {name:'view',index:'view',align: "center",editable:false,search:false,editrules:{required: true}, width:80,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_view($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='VIEW' \>"; }}, {name:'send_mail',index:'send_mail',align: "center",editable:false,search:false,editrules:{required: true}, width:80,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="send_wo_mail($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='SEND' \>"; }}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager3", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: false, emptyrecords: 'No records to display', //multiselect: true, // multiboxonly: true, loadonce:true, caption:" WO generated List", subGrid: true, subGridRowExpanded: function(subgrid_id, row_id) { var subgrid_table_id; //alert(row_id); id=row_id; //alert(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 site_url('gss/wo_subgrid');?>?id="+id, mtype : "get", datatype: "json", colNames:['SI','Product Name','Description','Indent','Project','Purpose','Value','SGST','CGST','IGST','Total Value'], colModel:[ {name:'id',index:'id', width:50, hidden:true,editable:false,key:true}, {name:'product_name',index:'product_name', width:100, editable:false}, {name:'description',index:'description', width:150, editable:false}, {name:'indent',index:'indent', width:70, editable:false}, {name:'project_name',index:'project_name', width:150, editable:false}, {name:'purpose_no',index:'purpose_no', width:150, editable:false}, {name:'inr_value',index:'inr_value', width:70, editable:false}, {name:'sgst',index:'sgst', width:70, editable:false}, {name:'cgst',index:'cgst', width:70,editable:false}, {name:'igst',index:'igst', width:70, editable:false}, {name:'total_value',index:'total_value', width:70, editable:false}, ], height: 'auto', rowNum:20, sortname: 'num', sortorder: "asc" }); } }); $("#list3").jqGrid("setLabel", "rn", "SL"); $("#list3").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list3").jqGrid('navGrid','#pager3', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); $("#list3").navButtonAdd('#pager2', { caption:"Edit", buttonicon:"ui-icon-pencil", onClickButton: editRow, position: "last", title:"", cursor: "pointer", id:"client_edit" } ); $("#list3").navButtonAdd('#pager2', { caption:"Delete", buttonicon:"ui-icon-trash", onClickButton: deleteRow, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); }); function fun_edit(rowId) { var id = rowId.closest('tr').attr('id'); window.location.href = "<?php echo site_url('edit-work-order-po');?>?id="+id; } function fun_view(rowId) { var id = rowId.closest('tr').attr('id'); window.location.href = "<?php echo site_url('view-work-order-wo');?>?id="+id; } function genarate_po() { id = jQuery("#list3").jqGrid('getGridParam','selarrrow'); var row = $("#list3").jqGrid('getGridParam','selrow'); if(row != null ) { window.location.href = "<?php echo site_url('generate-po');?>?id="+id; } else $( "#dialogSelectRow3" ).dialog(); } function fun_cancel(rowId) { var id = rowId.closest('tr').attr('id'); var app = $("#list3").jqGrid('getRowData',id); app=app.cancel_status; if(app=="CANCEL") { swal({ title: "Are you sure?", text: "Do you want to cancel this PO?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("cancel-wo")?>', data : {management_id:id}, success:function(response) { response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { toastr["success"](response.message); location.reload(); } } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else { swal({ title: "Are you sure?", text: "Do you want to uncancel this commission?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("cancelled-wo")?>', data : {management_id:id}, success:function(response) { response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { toastr["success"](response.message); location.reload(); } } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } } function send_wo_mail(rowId) { // alert(); var id = rowId.closest('tr').attr('id'); //alert(id); $.ajax({ type : 'post', url : '<?php echo site_url("gss/send_email")?>', data : {'id':id}, async:false, success:function() { // alert('success'); } }); } </script> <?php $this->load->view('includes/footer');?>