EVOLUTION-NINJA
Edit File: delivery_date_marketing_details.php
<style> .ui-jqgrid { text-transform: capitalize !important; } .tablediv { text-transform: uppercase !important; } .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } </style> <script> function back_function() { window.location.href="<?php echo base_url('marketing/transactions_order_details?prop_id=1'); ?>"; } </script> <?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'); ?> <!-- Modal --> <!--<div class="caption"> <i class="fa fa-globe" style="border:1px solid"></i>Transaction Input details </div>--> <!--<a href="javascript:;" class="reload"> </a>--> <input type="button" name="Insert" data-toggle="modal" data-target="#delivery_date_Modal" value="Select" /> <button type="button" onclick="back_function()" >Back </button> <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> <!-- Modal --> <div id="delivery_date_Modal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content" class="workorder_application"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Choose Delivery Date</h4> </div> <div class="modal-body"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <label class="control-label col-md-3">From Date :</label> <div class="col-md-7"> <input type="text" class="form-control input-group openDatePicker from_delivery_date_required_on" name="from_delivery_date_required_on" id="from_delivery_date_required_on" data-provide="datepicker"> </div> </div> </div> </div> <!-- row -2--> <br/> <div class="row"> <div class="col-md-12"> <div class="form-group"> <label class="control-label col-md-3">To Date :</label> <div class="col-md-7"> <input type="text" class="form-control input-group openDatePicker to_delivery_date_required_on" name="to_delivery_date_required_on" id="to_delivery_date_required_on" data-provide="datepicker"> </div> </div> </div> </div> <!-- row -2--> </div> <div class="modal-footer"> <button class="btn btn-default" data-dismiss="modal">Close</button> <button id="delivery_submit_modal" name="submit" onclick="delievry_submit_button()" class="btn btn-primary">Submit</button> </div> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </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() { $(".to_delivery_date_required_on").datepicker({ dateFormat: "dd-mm-yy", changeMonth: true, changeYear: true }); }); $( document ).ready(function() { $(".from_delivery_date_required_on").datepicker({ dateFormat: "dd-mm-yy", changeMonth: true, changeYear: true }); }); function delievry_submit_button() { var from_required_on =$('#from_delivery_date_required_on').val(); var to_required_on =$('#to_delivery_date_required_on').val(); $.ajax({ url:"<?php echo base_url('marketing/transaction_details');?>", type:"POST", data:{'from_required_on':from_required_on,'to_required_on':to_required_on}, async:false, success:function(data) { window.location.href="<?php echo base_url('marketing/delivery_date_transaction_details'); ?>" } }); } $(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> <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; } #table_approved_indent { display:none; } #refresh_list3 { display:none !important; } @media only screen and (min-width:320px) and (max-width:640px) { } </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; } .coledit { cursor:pointer; padding-right: 22px !important; padding-left: 23px !important; margin-top: 4px !important; color:bold !important; } .ui-jqgrid .ui-jqgrid-bdiv { overflow:hidden; } .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/delivery_date_fetch_getorder_details')?>", mtype : "post", datatype: "json", colNames:['Id','OSL No','File No', 'Mode Of Order', 'Party Order No','Delivery Date','Total Value','Currency','Sub Order Type','Proforma Invoice','Order Confirmation','Order Input Details','Status','Plan status'], 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:'deliveryDate',index:'deliveryDate',edittype:'text', width:100,editrules:{required: true},formatter: 'date', formatoptions: { newformat: 'd-m-Y'}}, {name:'totalValue',index:'totalValue',edittype:'text',editable:true,editrules:{required: true}, width:100}, {name:'currency',index:'currency',edittype:'text',editable:true,editrules:{required: true}, width:100}, {name:'subOrderType',index:'subOrderType',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')?>'}}, {name:'confirm_status',index:'confirm_status',edittype:'text',editable:true,editrules:{required: true}, width:100}, {name:'planningStatus',index:'planningStatus',edittype:'text',editable:true,editrules:{required: true}, width:100}, ], 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:"desc", //multiple: true, loadonce:true, caption:"Transactions Order Details", footerrow: true, loadComplete: function () { var sumOfTotalvalues = jQuery("#list2").jqGrid('getCol','totalValue',false,'sum'); jQuery("#list2").jqGrid('footerData', 'set', { deliveryDate: 'Total:', totalValue: sumOfTotalvalues.toFixed(2) }); }, 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:100,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:155,height:12}, {name:'description',index:'description', width:200,height:12}, {name:'totalQuantity',index:'totalQuantity', width:90,height:12}, {name:'totalValue',index:'totalValue', width:100,height:12}, {name:'created_by',index:'created_by', width:100,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,editable: true, formatter:vehicalFmatter,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_edit($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' id='edit_before_planned' 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' \>"; }}, ], 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:"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 vehicalFmatter (cellvalue, options, rowObject) { a } function fun_edit(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("marketing/edit_form"); ?>', data:{'as':as}, async:false, success:function() { // var url_r=$('#url_ref').val(); window.location.href = '<?php echo base_url('marketing/edit_form');?>/'+ '?id='+as; } }); } function fun_delete(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("marketing/delete_form"); ?>', data:{'as':as}, async:false, success: function (data) { //alert(data); var objData = jQuery.parseJSON(data); if(objData == 'not_deleted') { swal({ title: "This Shade Details Is Already Planned, U Can't Delete It", text: "", }); } else { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } }); } function fun_preview3(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $.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; } }); } function fun_preview1(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $.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; } }); } function fun_preview2(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $.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; } }); } function fun(rowId) { 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").jqGrid('setGridParam',{datatype:'json'}).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").jqGrid('setGridParam',{datatype:'json'}).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"); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } else{ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } }); }, 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(); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); //$("#list2").trigger("reloadGrid"); } else{ // alert('Successful'); $("#delmodlist2").remove(); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); // $("#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> #jaytab{ width:100% !important; overflow-x:scroll !important; } #jaytab1{ width:100% !important; overflow-x:scroll !important; } .tablediv { overflow-x:scroll !important; } #search_list2 { display:none !important; } #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; } .radio-list { margin-left:7% !important; } #table_pending_indent{ //overflow-x: scroll; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; //overflow-x: scroll; //width: 600px !important; padding-left: 0 !important; } #jaytab1 { margin-top: 0 !important; margin-left: 0 !important; //overflow-x: scroll; //width: 300px !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; } #client_delete { display: none; } #cData { height: 29px; } .jqgfirstrow { height: 0px !important; } .preview { padding-bottom:3px !important; padding-top:3px !important; } .preview { padding-bottom:3px !important; padding-top:3px !important; } .tablediv { width: auto !important; // overflow: scroll !important; } .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { overflow: hidden; white-space: pre; } </style>