EVOLUTION-NINJA
Edit File: sam_sdk_pgm.php
<style> .ui-jqgrid { text-transform: capitalize !important; } .tablediv { text-transform: uppercase !important; } .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } </style> <?php //include("menu.php"); ?> <!-- BEGIN CONTENT --> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Transaction Input details </h3> <?php $this->load->view('templates/nav_menu'); ?> <?php if(empty($access_row)) { } else { if($access_row->insert_id == '1') { ?> <form action="<?php echo base_url(); ?>marketing/transactions_order_input_demo" method="post" class="form-horizontal"> <b>To insert data click here:</b> <input type="submit" name="Insert" value="Insert" /><br><br> </form> <?php } else { ?> <?php } }?> <input type="text" id="delete_id" class="delete_id" value="<?php if(empty($access_row)){ } else { echo $access_row->delete_id; } ?>" > <input type="text" id="insert_id" class="insert_id" value="<?php if(empty($access_row)){ } else { echo $access_row->insert_id; } ?>" > <input type="text" id="preview_id" class="preview_id" value="<?php if(empty($access_row)){ } else { echo $access_row->preview_id; } ?>" > <input type="text" id="edit_id" class="edit_id" value="<?php if(empty($access_row)){ } else { echo $access_row->edit_id; } ?>" > <!-- END PAGE HEADER--> <!-- BEGIN DASHBOARD STATS --> <!--<div class="caption"> <i class="fa fa-globe" style="border:1px solid"></i>Transaction Input details </div>--> <!--<a href="javascript:;" class="reload"> </a>--> <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> <!-- END DASHBOARD STATS --> </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> $(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_id1').value=obj.customerID; } }); } </script> <script> function adddetails() { var customer=$("#customer").val(); var date=$("#date").val(); var product_type=$("#product_type").val(); var description=$("#description").val(); var size=$("#size").val(); var min_quality=$("#min_quality").val(); var customer_id=$("#customer_id").val(); var currency= $("#currency").val(); var article=$("#article").val(); var design=$("#design").val(); var price=$("#price").val(); var image=$("#image").val(); var reference= $("#reference").val(); var terms=$("#terms").val(); var quality= $("#quality").val(); var color=$("#color").val(); var composition=$("#composition").val(); var note=$("#note").val(); $.ajax({ url:"<?php echo base_url('request/customer_insert')?>", type:"POST", data:{'customer':customer,'date':date,'product_type':product_type,'description':description,'size':size,'min_quality':min_quality,'customer_id':customer_id,'currency':currency,'article':article,'design':design,'price':price,'image':image,'reference':reference,'terms':terms,'quality':quality,'color':color,'composition':composition,'note':note}, async:false, success:function(data){ alert('Successfully Added.'); //$("#editmodlist2").remove(); window.location.reload(); } }); } </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; } </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 --> <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; } .col_delete { padding-left:8px !important; padding-right:7px !important; padding-bottom: 6px !important; } .col_pre { display: inline; padding-left: 32px !important; padding-right: 33px !important; margin-top:5px !important; padding-bottom: 6px !important; } </style> <style> .col_delete { display: initial !important; padding-left: 6px !important; padding-right: 11px !important; padding-bottom: 6px !important; } </style> <!-----------------datepicker-------------> <script src="<?php echo base_url(); ?>assets/js/sweetalert.min.js" type="text/javascript"></script> <link href="<?php echo base_url(); ?>assets/css/sweetalert.min.css" rel="stylesheet" type="text/css" > <!-- The link to the CSS that the grid needs --> <script> $(document).ready(function (){ jQuery("#list2").jqGrid({ url:'<?php echo base_url('marketing/getorder_details')?>', mtype : "post", datatype: "json", colNames:['Id','OSL No','File No', 'Mode Of Order', 'Party Order No','Performa Invoice','Order Confirmation','Order Input Details'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'oslNo',index:'oslNo', width:50,editable:true,width:100}, {name:'fileNo',index:'fileNo',editable:true, width:100}, {name:'orderMode',index:'orderMode',editable:true,editrules:{required: true},editoptions: {size:10, maxlength: 10}, width:100}, {name:'orderNo',index:'orderNo',edittype:'text',editable:true,editrules:{required: true}, width:100}, {name:'preview1',index:'preview1',align: "center",editable:false,editrules:{required: true}, width:100,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_preview1($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='PREVIEW' \>"; }}, {name:'preview2',index:'preview2',align: "center",editable:false,editrules:{required: true}, width:100,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_preview2($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='PREVIEW' \>"; }}, {name:'preview3',index:'preview3',align: "center",editable:false,editrules:{required: true}, width:100,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_preview3($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='PREVIEW' \>"; }}, // {name:'preview1',index:'preview1',editable:false, width:100,formatter:'showlink',classes:'fa fa-eye col_pre',formatoptions:{baseLinkUrl:'<?php echo base_url('marketing/preview')?>'}}, // {name:'preview2',index:'preview2',editable:false, width:100,formatter:'showlink',classes:'fa fa-eye col_pre',formatoptions:{baseLinkUrl:'<?php echo base_url('marketing/orederconfirmation')?>'}}, // {name:'preview3',index:'preview3',editable:false, width:100,formatter:'showlink',classes:'fa fa-eye col_pre',formatoptions:{baseLinkUrl:'<?php echo base_url('marketing/orderinput')?>'}}, ], height: 'auto', rowNum:50, rowTotal: 20000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager2", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", //multiple: true, loadonce:true, caption:"Transactions Order Details", subGrid: true, subGridRowExpanded: function(subgrid_id, row_id) { // we pass two parameters // subgrid_id is a id of the div tag created within a table // the row_id is the id of the row // If we want to pass additional parameters to the url we can use // the method getRowData(row_id) - which returns associative array in type name-value // here we can easy construct the following 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('marketing/subgrid');?>/s"+row_id+"/", //data:{'sub_id':123}, mtype : "get", datatype: "json", colNames: ['Id','Article No','Unit','Width','Sub Order Type','Description','Total Quantity','Total Value','Created By','Order Confirm','Confirm By','Edit','Delete'], colModel: [ {name:'id',index:'id',hidden:true, width:50,editable:true,width:20}, {name:'articleNo',index:'articleNo', width:70,height:12}, //{name:'buyerShade',index:'buyerShade', width:80,height:12}, {name:'unit',index:'unit', width:60,height:12}, {name:'width',index:'width', width:80,height:12}, {name:'subOrderType',index:'subOrderType', width:110,height:12}, {name:'description',index:'description', width:100,height:12}, {name:'totalQuantity',index:'totalQuantity', width:90,height:12}, {name:'totalValue',index:'totalValue', width:90,height:12}, {name:'created_by',index:'created_by', width:90,height:12}, { name: 'orderConfirm', index: 'orderConfirm', width:80, align: 'center', formatter: 'checkbox', editoptions: { value: '1:0' }, formatoptions: { disabled: false }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun($(this))" '; } }, {name:'confirm_by',index:'confirm_by', width:90,height:12}, {name:'edit',index:'edit',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' value='EDIT' \>"; }}, {name:'delete',index:'delete',align: "center",editable:false,editrules:{required: true}, width:100,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_delete($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='DELETE' \>"; }}, //{name:'edit',index:'edit',editable:true,editrules:{required: true}, width:66,formatter:'showlink',classes:'fa fa-pencil-square-o col_delete',formatoptions:{baseLinkUrl:'<?php echo base_url('marketing/edit_form')?>'}}, //{name:'delete',index:'delete',editable:true,editrules:{required: true}, width:80,classes:'fa fa-trash-o col_delete',formatter:'showlink',formatoptions:{baseLinkUrl:'<?php echo base_url('marketing/delete_form')?>'}}, ], height: 'auto', rowNum:200000000000000000000, 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:"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 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("marketing/edit_form"); ?>', data:{'as':as}, async:false, success:function() { window.location.href = '<?php echo base_url('marketing/edit_form');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Edit", text: "", }); } } function fun_delete(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#delete_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("marketing/delete_form"); ?>', data:{'as':as}, async:false, success:function() { window.location.href = '<?php echo base_url('marketing/delete_form');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Edit", text: "", }); } } function fun_preview3(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#preview_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("marketing/orderinput"); ?>', data:{'as':as}, async:false, success:function() { window.location.href = '<?php echo base_url('marketing/orderinput');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function fun_preview1(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#preview_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("marketing/preview"); ?>', data:{'as':as}, async:false, success:function() { window.location.href = '<?php echo base_url('marketing/preview');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function fun_preview2(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#preview_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("marketing/orederconfirmation"); ?>', data:{'as':as}, async:false, success:function() { window.location.href = '<?php echo base_url('marketing/orederconfirmation');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Preview", 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) { $.ajax({ url:"<?php echo base_url('marketing/add_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); } else{ } } }); } else if (confirmMsg==false) { $.ajax({ url:"<?php echo base_url('marketing/add')?>", type:"POST", data:{'id':id}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); } else{ } } }); } } function editRow() { // Get the currently selected row var row = $("#list2").jqGrid('getGridParam','selrow'); //alert('hai'); if( row != null ) $("#list2").jqGrid('editGridRow',row, { modal:true,jqModal:true, recreateForm: true, beforeSubmit: function(postdata,formid){ var id=$("#id").val(); //alert(id); var oslNo=$("#oslNo").val(); var fileNo=$("#fileNo").val(); var orderMode=$("#orderMode").val(); var orderNo=$("#orderNo").val(); //alert(id); $.ajax({ url:"<?php echo base_url('marketing/customer_update')?>", type:"POST", data:{'id':id,'oslNo':oslNo,'fileNo':fileNo,'orderMode':orderMode,'orderNo':orderNo}, async:false, success:function(data){ if(data==""){ alert('Successfully Updated.'); $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); window.location.reload(); } else{ window.location.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); // A pop-up dialog will appear to confirm the selected action if( row != null ) $("#list2").jqGrid( 'delGridRow', row, { modal:true,jqModal:true, recreateForm: true, beforeSubmit: function(postdata,formid){ $.ajax({ url:"<?php echo base_url('marketing/customer_delete')?>", type:"POST", data:{'id':row}, async:false, success:function(data){ if(data==""){ //alert('Successfully Updated.'); $("#delmodlist2").remove(); window.location.reload(); //$("#list2").trigger("reloadGrid"); } else{ // alert('Successful'); $("#delmodlist2").remove(); window.location.reload(); $("#list2").trigger("reloadGrid"); } } }); }, reloadAfterSubmit:false, closeAfterDelete: true, afterSubmit : function(response, postdata) { } }); else $( "#dialogSelectRow" ).dialog(); } </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; } } #sData span, #cData span { margin-left: 3px; } #sData { height: 29px; } #cData { height: 29px; } .jqgfirstrow { height: 0px !important; } </style> <style> @media only screen and (min-width:320px) and (min-height:640px){ #gbox_list2{ width:1052px !important; } #gview_list2{ width:100% !important; } .ui-jqgrid-hdiv{ width:100% !important; } .ui-jqgrid-htable{ width:100% !important; } #list2{ width:100% !important; } } </style>