EVOLUTION-NINJA
Edit File: edit_suborder_madeups.php
<script src="<?php echo base_url('assets/js/jquery.table2excel.js');?>"></script> <script src="<?php echo base_url('assets/js/jspdf.debug.js');?>"></script> <script src="<?php echo base_url('assets/js/jspdf.min.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/shim.min.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/xlsx.full.min.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/Blob.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/FileSaver.js');?>"></script> <script type="text/ecmascript" src="<?php echo base_url('assets/js/jquery.min.js');?>"></script> <script src="<?php echo base_url('assets/js/bootstrap.min.js');?>"></script> <script type="text/ecmascript" src="<?php echo base_url('assets/js/jquery.jqGrid.min.js');?>"></script> <script type="text/ecmascript" src="<?php echo base_url('assets/js/grid.locale-en.js');?>"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.js"></script> <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.css" rel="stylesheet"/> <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_func() { window.location.href = "<?php echo base_url('reports/inspected_fabric'); ?>" } </script> <div class="page-content-wrapper"> <div class="page-content"> <div class="page-bar"> <ul class="page-breadcrumb"> <li><i class="fa fa-home"></i> <a href="<?php echo base_url();?>dashboard/dashboard_fun">Home</a> <i class="fa fa-angle-right"></i> <a href="<?php echo base_url();?>dashboard/dashboard_fun" > Dashboard </a></li> </ul> </div> <input type="hidden" id="usertype" class="usertype" value="<?php echo $usertype; ?>" > <input type="hidden" id="delete_id" class="delete_id" value="<?php if(empty($access_row)){ } else { echo $access_row->delete_id; } ?>" > <input type="hidden" id="insert_id" class="insert_id" value="<?php if(empty($access_row)){ } else { echo $access_row->insert_id; } ?>" > <input type="hidden" id="preview_id" class="preview_id" value="<?php if(empty($access_row)){ } else { echo $access_row->preview_id; } ?>" > <input type="hidden" id="edit_id" class="edit_id" value="<?php if(empty($access_row)){ } else { echo $access_row->edit_id; } ?>" > <input type="hidden" id="approval_id" class="approval_id" value="<?php if(empty($access_row)){ } else { echo $access_row->approval_id; } ?>" > <input type="hidden" value="<?php echo $ref; ?>" id="ref_id" > <input type="hidden" value="<?php echo $url_val; ?>" id="url_ref" style="width: 230px;" > <form action="" method="post" class="transfer_modal_application"> <div class="row"> <div class="col-sm-12"> <div class="portlet box blue"> <div class="portlet-title"> <div class="caption" style="color:black;"> </div> </div> <div class="portlet-body"> <div class="table-scrollable"> <table class="table table-striped table-bordered table-hover" style="color:black;"> <thead> <tr id="m"> <td style="width:3%;"><b>Sl No</b></td> <td style="width:3%;"><b>OslNo</b></td> <td style="width:3%;"><b>SubOrderType</b></td> <td style="width:3%;"><b>Width</b></td> <td style="width:3%;"><b>ArticleNo</b></td> <td style="width:3%;"><b>Design</b></td> <td style="width:3%;"><b>BuyerShade</b></td> <!--<td style="width:5%;"><b>ShadeName</b></td>--> <!--<td style="width:5%;"><b>Quantity</b></td>--> <td style="width:5%;"><b>Case Qnty</b></td> <td style="width:5%;"><b>Net Wt</b></td> <td style="width:5%;"><b>Gross Wt</b></td> <td style="width:5%;"><b>Box Dimension</b></td> <td style="width:5%;"><b>Sequence</b></td> </tr> </thead> <?php $i=0; $j=0; $k = 0; $tab_ids = array(); if(count($result) == 0){ ?> <h2>Not Planned Yet....</h2> <?php return; }else{ $tab_id_new = ''; foreach($result as $r1){ foreach($r1 as $r){ $i++; $table_id = "added_warp_Rows".$i; $table_class = "case_class".$i; $total_case_id = 'total_case'.$i; $tab = 'closet_weft_row'.$i; $tab1 = 'removeButtonn'.$i; $box='boxdimen'.$i; if($tab_id_new == '') $tab_id_new = $r->id; else $tab_id_new = $tab_id_new."w".$r->id; ?> <tbody id= <?php echo $table_id; ?> > <tr id =<?php echo $tab; ?> > <td style="width:3%;"><?php echo $i; ?></td> <input type="hidden" name="tab_id[]" id="tab_id" value="<?php echo $r->id; ?>" readonly> <input type="hidden" name="ref_id[]" id="ref_id" value="<?php echo $r->ref_id; ?>" readonly> <td style="width:3%;"><input type="text" name="oslno[]" id="oslno" value="<?php echo $r->oslNo; ?>" readonly></td> <td style="width:3%;"><input type="text" name="ordertype[]" id="ordertype" value="<?php echo $r->orderType; ?>" readonly></td> <td style="width:3%;"><input type="text" name="width[]" id="" value="<?php echo $r->width; ?>" readonly></td> <td style="width:3%;"><input type="text" name="article[]" id="" value="<?php echo $r->article; ?>" readonly></td> <td style="width:3%;"><input type="text" name="design[]" id="" value="<?php echo $r->design; ?>" readonly></td> <td style="width:3%;"><input type="text" name="buyershade[]" id="" value="<?php echo $r->buyerShade; ?>" readonly></td> <input type="hidden" name="ssl_shade[]" id="" value="<?php echo $r->sslShade; ?>" readonly> <input type="hidden" name="quty[]" id="" value="<?php echo $r->quantity; ?>" readonly> <input type="hidden" name="customer[]" id="" value="<?php echo $r->customer_id; ?>" readonly> <input type="hidden" name="sku[]" id="" value="<?php echo $r->sku_no; ?>" readonly> <input type="hidden" name="desc[]" id="" value="<?php echo $r->description; ?>" readonly> <td style="width:5%;"><input type="text" onchange="calculate_total_case()" name="case[]" class = <?php echo $table_class; ?> id="" style="width:70px" value="<?php echo $r->Case; ?>"></td> <td style="width:5%;"><input type="text" name="net_wt[]" id="" style="width:70px" value="<?php echo $r->net_wt; ?>"></td> <td style="width:5%;"><input type="text" name="gross_wt[]" id="" style="width:70px" value="<?php echo $r->gross_wt; ?>"></td> <td style="width:5%;" > <select id=<?php echo $box; ?> name="boxdimen[]" onclick="boxdimention(<?php echo $i; ?>)"> <option><?php echo $r->box_dimention; ?></option> </select> </td> <td style="width:5%;" ><input type="text" style="width:70px" id="" name="sequence[]" value="<?php echo $r->sequence; ?>" ></td> <td style="width:5%;" ><a id="addButton" class="btn blue addButton" onclick="addMore_weft_Rows(<?php echo $r->ref_id; ?>,<?php echo $i; ?>);"><i class="fa fa-plus"></i></a></td> <td style="width:5%;"><a id= <?php echo $tab1; ?> class="btn blue addButton" onclick="delete_row(<?php echo $r->id; ?>)"> <i class="fa fa-minus"></i></a></td> --> </tr> </tbody> <?php } }} ?> </table> <input type="hidden" value="<?php echo $i; ?>" id="rowid_val"> <input type="hidden" value="<?php echo $i; ?>" id="row"> <input type="hidden" value="<?php echo $i; ?>" id="row_numbers"> <button type="submit" class="btn btn-primary" id="">UPDATE</button> <button type="button" class="btn btn-primary" id=""><a class="btn btn-primary" href="<?php echo base_url('madeups_billing/index') ?>">Cancel</a></button> <button type="button" class="btn btn-primary" onclick="delete_all('<?php echo $tab_id_new; ?>')" id="">DELETE ALL</button> </form> </div> </div> </div> </div> </div><!--row 11 end--> </div> </div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="export_table" class="export_table"></table></div> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="print_table" class="print_table"></table> </div> <script> var i=20; // $( document ).ready(function() { // calculate_total_case(); // }); // function calculate_total_case() { // var total_rows = $('#row_numbers').val(); // var l = 0; // for(l = 1; l <= total_rows; l++){ // var sum = 0; // $('.case_class'+l).each(function(){ // sum += parseFloat(this.value); // }); // document.getElementById('total_case'+l).innerHTML = sum; // } // } function addMore_weft_Rows(id, talble_id) { var table = "added_warp_Rows"+talble_id; var i = $('#rowid_val').val(); i++; console.log(i); var content=''; content += '<tr id="closet_weft_row' + i + '">'; content += '<input type="hidden" name="tab_id[]" id="tab_id" value="new" readonly> '; content += '<td style="width:5%;"><input type="hidden" value="'+i+'" class="row" style="margin-left:0px;margin-right:0px;border: transparent !important;"></td> '; content += '<input type="hidden" value="" class="id" name="ref_id[]" id="ref_id' + i + '" style="margin-left:0px;margin-right:0px;border: transparent !important;"readonly>'; content += '<td style="width:5%;"><input type="text" value="" class="oslno" name="oslno[]" id="oslno' + i + '" style="margin-left:0px;margin-right:0px;border: transparent !important;" readonly></td>'; content += '<td style="width:5%;"><input type="text" value="" class="ordertype" name="ordertype[]" id="ordertype'+ i +'" style="margin-left:0px;margin-right:0px;" readonly></td>'; content += '<td style="width:5%;"><input type="text" value="" class="width" name="width[]" id="width' + i + '" style="margin-left:0px;margin-right:0px;" readonly></td>'; content += '<td style="width:5%;"><input type="text" value="" class="article" name="article[]" id="article' + i + '" style="margin-left:0px;margin-right:0px;" readonly></td>'; content += '<td style="width:5%;"><input type="text" value="" class="design" name="design[]" id="design' + i + '" style="margin-left:0px;margin-right:0px;" readonly></td>'; content += '<td style="width:5%;"><input type="text" value="" class="buyershade" name="buyershade[]" id="buyershade' + i + '" style="margin-left:0px;margin-right:0px;" readonly></td>'; content += '<input type="hidden" value="" class="ssl_shade" name="ssl_shade[]" id="ssl_shade' + i + '" style="margin-left:0px;margin-right:0px;" readonly>'; content += '<input type="hidden" value="" class="quty" name="quty[]" id="quty' + i + '" style="margin-left:0px;margin-right:0px;" readonly>'; content += '<input type="hidden" value="" class="customer" name="customer[]" id="customer' + i + '" style="margin-left:0px;margin-right:0px;" readonly>'; content += '<input type="hidden" value="" class="sku" name="sku[]" id="sku' + i + '" style="margin-left:0px;margin-right:0px;" readonly>'; content += '<input type="hidden" value="" class="desc" name="desc[]" id="desc' + i + '" style="margin-left:0px;margin-right:0px;" readonly>'; content += '<td style="width:5%;"><input name="case[]" class = "case_class'+talble_id+'" onchange="calculate_total_case()" value="" id="case'+ i +'" type="text" style = "width:70px" ></td>'; content += '<td style="width:5%;"><input name="net_wt[]" value="" id="net_wt'+ i +'" type="text" style = "width:70px"></td>'; content += '<td style="width:5%;"><input name="gross_wt[]" value="" id="gross_wt'+ i +'" type="text" style = "width:70px"></td>'; content += '<td style="width:5%;"><select name="boxdimen[]" value="" id="boxdimen'+ i +'" type="text"></select></td>'; content += '<td style="width:5%;"><input name="sequence[]" value="" id="seq'+ i +'" type="text" style = "width:70px"></td>'; content += '<td style="width:5%;"><a id="removeButtonn' + i + '" onclick="remove_weft_Row('+ i +');" class="btn blue addButton"> <i class="fa fa-minus"></i></a> </td>'; content += '</tr>'; $('#rowid_val').val(i); $("#"+table).append(content); $.ajax({ type: "post", url: "<?php echo base_url(); ?>madeups_billing/get_autofill", data:{'id':id,'i':i}, success: function (data) { var objData = jQuery.parseJSON(data); obj=objData.quantity; obj1=objData.delievry_quantity; obj2=objData.i; // obj1=objData.delievry_quantity; obj_emp=objData.emp_loc; $("#ref_id"+i).val(obj.id); $("#oslno"+i).val(obj.oslNo); $("#ordertype"+i).val(obj.subOrderType); $("#width"+i).val(obj.width); $("#article"+i).val(obj.articleNo); $("#design"+i).val(obj.design); $("#buyershade"+i).val(obj.buyerShade); $("#ssl_shade"+i).val(obj.shadeName); $("#quty"+i).val(obj.quantity); $("#net_wt"+i).val(obj.net_wt); $("#gross_wt"+i).val(obj.gross_wt); $("#customer"+i).val(obj.fileNo); $("#sku"+i).val(obj.skuNo); $("#desc"+i).val(obj.description); // $("#boxdimen"+i).val(obj.box_dimention); h=obj.box_dimention; $("#case"+i).val(obj.piececase); var content = ''; content += '<option>'+ h +'</option>'; $.each(obj1,function(key,val) { //alert(val.yarnSpecification); content += '<option>'+val.box_dimention+'</option>'; }); $('#boxdimen'+ i).html(content); calculate_total_case(); } }); } function remove_weft_Row(removeNum) { $('#removeButtonn'+ removeNum).closest('#closet_weft_row'+ removeNum).remove(); // calculate_total_case(); // alert(removeNum); } $('.transfer_modal_application').submit(function(e){ // alert('hii'); e.preventDefault(); formdata = new FormData($(this)[0]); $.ajax({ url:"<?php echo base_url('madeups_billing/update_suborder_form');?>", type:"POST", data: formdata, contentType: false, processData: false, success:function(data) { var objdata=jQuery.parseJSON(data); if(objdata.result==1) { console.log(objdata); alert('SuccessFullyUpdated'); window.location.href = '<?php echo base_url('madeups_billing');?>'; }else { alert('SomethingWentWrong'); } } }); }); function boxdimention(k){ var t='boxdimen'+k; // alert(t); $.ajax({ type:'post', url:'<?php echo base_url("madeups_billing/madeus_box_data"); ?>', data:'', async:false, success: function (response12) { response12 = jQuery.parseJSON(response12); console.log(response12); for(var i=0; i<response12.length; i++){ var mode = ''; mode +='<option>'+response12[i].box_dimention+'</option>'; $('#'+t).append(mode); } } }); } function delete_all(ids){ var id = ids; var confirmMsg1 = confirm("Are You Sure Do You Want To Delete All!"); if (confirmMsg1 ==true) { $.ajax({ url:"<?php echo base_url('madeups_billing/delete_planned_data_all')?>", type:"POST", data:{'id':id}, success:function(html){ location.reload(true); } }); } else if (confirmMsg1 == false) { location.reload(true); } } function delete_row(m){ var id=m; var confirmMsg= confirm("Are You Sure Do You Want To Delete This!"); if (confirmMsg==true) { $.ajax({ url:"<?php echo base_url('madeups_billing/delete_planned_data')?>", type:"POST", data:{'id':id}, success:function(html){ location.reload(true); } }); } else if (confirmMsg==false) { location.reload(true); } } </script>