EVOLUTION-NINJA
Edit File: outstanding_statement_view.php
<?php $this->load->view('includes/admin_dashboard_header');?> <div id="wrapper"> <!-- Navigation --> <?php $this->load->view('includes/admin_menu');?> <div id="page-wrapper"> <div class="container-fluid"> <section class="admin_heading"> <div class="col-sm-12"> <h3>Outstanding Statement</h3> </div> <div class="col-sm-12"> <div id = "jaytab" style="width: 100%; margin-top:1%;"> <p>Last Updated Date and Time is : <?php if(empty($time)) { echo "Data not found"; }else{ echo $time->createdate; } ?></p> <table id="list2"></table> <div id="pager2"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> </section> <input type="hidden" id="demo"/> <input type="hidden" id="demo1"/> <input type="hidden" id="demo2"/> <?php $ci =& get_instance(); $base_url = base_url(); ?> <!-- /.row end--> </div> <!-- /.container-fluid --> </div> <!-- /#page-wrapper --> </div> <?php $this->load->view('includes/admin_dashboard_footer');?> <style> @media only screen and (min-width:320px) and (max-width:641px){ .ui-jqgrid { margin-left: 1px !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; } .text_color a{ color:white !important; } </style> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/jquery.jqGrid.js'); ?>"></script> <!-- This is the Javascript file of jqGrid --> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/i18n/grid.locale-en.js'); ?>"></script> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <script> $(document).ready(function (){ jQuery("#list2").jqGrid({ url:"<?php echo site_url('controller/outstanding_insert');?>", mtype : "post", datatype: "json", colNames:['SI','Partner Code','Partner Name', 'Invoice Number','Invoice ref. No','Invoice Date','Invoice Value (INR)','Due Date'], colModel:[ {name:'id',index:'id',hidden:true, width:150,editable:true,editoptions:{size:25}}, {name:'partner_code',index:'partner_code', width:100,editable:true,editoptions:{size:25}}, {name:'partner_name',index:'partner_name', width:250,editable:true,editoptions:{size:25}}, {name:'invoice_number',index:'invoice_number', width:150,editable:true,editrules:{required:true},editoptions:{size:25}}, {name:'invoice_ref_no',index:'invoice_ref_no', width:150,editable:true,editoptions:{size:50}}, {name:'invoicedate',index:'invoicedate', width:100,editable:true,editoptions:{size:25}}, {name:'invoice_value',index:'invoice_value', width:150,editable:true,editoptions:{size:25}}, {name:'due_date',index:'due_date', width:100,editable:true,editoptions:{size:25}}, ], rowNum:50, rowTotal: 2000, rowList : [50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager2", sortname:'id', viewrecords: true, loadonce:true, gridview: true, autowidth: true, sortorder:"asc", caption:"Outstanding Statement" }); $("#list2").jqGrid('filterToolbar',{searchOperators : false});//for multisearch code,remove if not required $("#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" } ); //$('#pager2').css("height", "auto"); // $("#list2").navButtonAdd('#pager2', // { caption:"Add", // buttonicon:"ui-icon-plus", // onClickButton: addRow, // position: "last", // title:"", // cursor:"pointer", // id:"client_add" // } // ); // $("#list2").navButtonAdd('#pager2', // { caption:"Edit", // buttonicon:"ui-icon-pencil", // onClickButton: editRow, // position: "last", // title:"", // cursor: "pointer", // id:"client_edit" // } // ); // $("#list2").navButtonAdd('#pager2', // { caption:"Delete", // buttonicon:"ui-icon-trash", // onClickButton: deleteRow, // position: "last", // title:"", // cursor: "pointer", // id:"client_delete" // } // ); }); function addRow() { // Get the currently selected row $("#list2").jqGrid('editGridRow','new', { modal:true,jqModal:true, recreateForm: true, beforeSubmit: function(postdata,formid){ var partner_code = $("#partner_code").val(); var partner_name = $("#partner_name").val(); var invoice_number = $("#invoice_number").val(); var invoice_ref_no = $("#invoice_ref_no").val(); var invoicedate = $("#invoicedate").val(); var invoice_value = $("#invoice_value").val(); var due_date = $("#due_date").val(); alert("sending Email to "+partner_name) var myAge = prompt("Enter the Cc to :","") alert("you are sending Cc to:"+ myAge) if (myAge!=null) { x=myAge; document.getElementById("demo1").value=x; } var cc=$("#demo1").val(); $.ajax({ url:"<?php echo site_url('controller/outstanding_add');?>", type:"POST", data:{'partner_code':partner_code,'partner_name':partner_name,'invoice_number':invoice_number,'invoice_ref_no':invoice_ref_no,'invoicedate':invoicedate,'invoice_value':invoice_value,'due_date':due_date,'cc':cc}, async:false, success:function(data){ alert('Successfully Added.'); $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); // $("#list2").trigger("reloadGrid"); // jQuery('#list2').jqGrid('addRow',finance_id,true,reload()); } }); }, closeAfterAdd: true, reloadAfterSubmit:false, closeOnEscape:true, clearAfterAdd: true, afterSubmit :false }); } function editRow() { // Get the currently selected row var row = $("#list2").jqGrid('getGridParam','selrow'); if( row != null ) $("#list2").jqGrid('editGridRow',row, { modal:true,jqModal:true, recreateForm: true, beforeSubmit: function(postdata,formid){ var id = $("#id").val(); var partner_code = $("#partner_code").val(); var partner_name = $("#partner_name").val(); var invoice_number = $("#invoice_number").val(); var invoice_ref_no = $("#invoice_ref_no").val(); var invoicedate = $("#invoicedate").val(); var invoice_value = $("#invoice_value").val(); var due_date = $("#due_date").val(); alert("sending Email to "+email) var myAge = prompt("Enter the Cc to :","") alert("you are sending Cc to:"+ myAge) if (myAge!=null) { x=myAge; document.getElementById("demo").value=x; } var cc=$("#demo").val(); $.ajax({ url:"<?php echo site_url('controller/outstanding_edit');?>", type:"POST", data:{'id':id,'partner_code':partner_code,'partner_name':partner_name,'invoice_number':invoice_number,'invoice_ref_no':invoice_ref_no,'invoicedate':invoicedate,'invoice_value':invoice_value,'due_date':due_date,'cc':cc}, async:false, success:function(data){ if(data==""){ alert(' .'); } else{ alert('Successfully Updated.'); $("#editmodlist2").remove(); //$("#list2").trigger("reloadGrid"); jQuery('#list2').jqGrid('editRow',id,true,reload()); } } }); }, closeAfterEdit: true, reloadAfterSubmit:false, afterSubmit : false }); else $( "#dialogSelectRow" ).dialog(); } function deleteRow() { // Get the currently selected row var row = $("#list2").jqGrid('getGridParam','selrow'); $("#id").val(row); if( row != null ) $("#list2").jqGrid('delGridRow',row, { modal:true,jqModal:true, recreateForm: true, beforeSubmit: function(postdata,formid){ alert("sending Email to "+email) var myAge = prompt("Enter the Cc to :","") alert("you are sending Cc to:"+ myAge) if (myAge!=null) { x=myAge; document.getElementById("demo2").value=x; } var cc=$("#demo2").val(); $.ajax({ url:"<?php echo site_url('controller/outstanding_delete');?>", type:"POST", data:{'id':row,'cc':cc}, async:false, success:function(data){ if(data==""){ alert('Successfully Deleted.'); } else { alert('Successfully Deleted'); $("#delmodlist2").remove(); $("#list2").trigger("reloadGrid"); } } }); }, closeAfterEdit: true, reloadAfterSubmit:false, afterSubmit : false }); else $( "#dialogSelectRow" ).dialog(); } </script> <!-- Bootstrap Core JavaScript --> <script src="<?php echo base_url('admin_assets/js/bootstrap.min.js');?>"></script> <script src="<?php echo base_url('admin_assets/js/plugins/morris/raphael.min.js');?>"></script> <script src="<?php echo base_url('admin_assets/js/plugins/morris/morris.min.js');?>"></script> <script src="<?php echo base_url('admin_assets/js/plugins/morris/morris-data.js');?>"></script>