EVOLUTION-NINJA
Edit File: c_forms_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"> <!-- Page Heading --> <div class="row"> <div class="col-lg-12"> <!-- <h1 class="page-header"> Dashboard <small>Statistics Overview</small> </h1> <ol class="breadcrumb"> <li class="active"> <i class="fa fa-user" aria-hidden="true"></i> Manage Users </li> </ol>--> </div> </div> <section class="admin_heading"> <div class="col-sm-12"> <h3>C-Forms</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> <?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 (){ //var l=$("#loc").val(); //alert(l); jQuery("#list2").jqGrid({ url:"<?php echo site_url('controller/cform_insert');?>", mtype : "post", datatype: "json", colNames:['SI','Partner Code','Partner Name', 'Month','Quarter','Invoice Number','Date','Invoice Date','Taxable Amount','CST','Total Invoice Value','State '], colModel:[ {name:'id',index:'id', width:50, hidden:true,key:true,editable:true}, {name:'partner_code',index:'partner_code', width:100,editable:true,editoptions:{size:25}}, {name:'partner_name',index:'partner_name', width:200,editable:true,editoptions:{size:25}}, {name:'month',index:'month', width:100,editable:true,editrules:{required:true},editoptions:{size:25}}, {name:'quarter',index:'quarter', width:150,editable:true,editoptions:{size:50}}, {name:'invoice_number',index:'invoice_number', width:200,editable:true,editoptions:{size:25}}, {name:'date',index:'date', width:100,editable:true,editoptions:{size:25}}, {name:'invoicedate',index:'invoicedate', width:100,editable:true,editoptions:{size:25}}, {name:'taxable_amount',index:'taxable_amount', width:100,editable:true,editoptions:{size:25}}, {name:'cst',index:'cst', width:100,editable:true,editoptions:{size:25}}, {name:'invoice_value',index:'invoice_value', width:150,editable:true,editoptions:{size:25}}, {name:'state',index:'state', width:150,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:"C-Forms" }); $("#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" } ); }); 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 month = $("#month").val(); var quarter = $("#quarter").val(); var invoice_number = $("#invoice_number").val(); var date = $("#date").val(); var invoicedate = $("#invoicedate").val(); var taxable_amount = $("#taxable_amount").val(); var cst = $("#cst").val(); var invoice_value = $("#invoice_value").val(); var state = $("#state").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/cform_add');?>", type:"POST", data:{'partner_code':partner_code,'partner_name':partner_name,'month':month,'quarter':quarter,'invoice_number':invoice_number,'date':date,'invoicedate':invoicedate,'taxable_amount':taxable_amount,'cst':cst,'invoice_value':invoice_value,'state':state,'cc':cc}, async:false, success:function(data){ alert('Successfully Added.'); $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); } }); }, 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 month = $("#month").val(); var quarter = $("#quarter").val(); var invoice_number = $("#invoice_number").val(); var date = $("#date").val(); var invoicedate = $("#invoicedate").val(); var taxable_amount = $("#taxable_amount").val(); var cst = $("#cst").val(); var invoice_value = $("#invoice_value").val(); var state = $("#state").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/cform_edit');?>", type:"POST", data:{'id':id,'partner_code':partner_code,'partner_name':partner_name,'month':month,'quarter':quarter,'invoice_number':invoice_number,'date':date,'invoicedate':invoicedate,'taxable_amount':taxable_amount,'cst':cst,'invoice_value':invoice_value,'state':state,'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/cform_delete');?>", type:"POST", data:{'id':row,'cc':cc}, async:false, success:function(data){ if(data==""){ alert('Successfully .'); } else{ alert('Successfully Deleted'); $("#delmodlist2").remove(); $("#list2").trigger("reloadGrid"); } } }); }, closeAfterEdit: true, reloadAfterSubmit:false, afterSubmit : false }); else $( "#dialogSelectRow" ).dialog(); } </script>