EVOLUTION-NINJA
Edit File: remnants_stock_transfer_data.php
<style> .form-control { height: 22px !important; } </style> <script> $(function () { $("#del_date").datepicker({ dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true }); }); $(function () { $("#deying_delivery_date").datepicker({ dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true }); }); </script> <?php if (date('m') <= 3) {//Upto June 2014-2015 $financial_year = (date('y')-1) . '-' . date('y'); } else {//After June 2015-2016 $financial_year = date('y') . '-' . (date('y') + 1); } ?> <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('stock/fabric_stock_grid?prop_id=1'); ?>" > Remnants </a></li> </ul> </div> <div id="twisting"> <form action="" method="post" class="transfer_modal_application"> <div class="portlet-body form"> <div class="content-wrapper"> <section class="body-middle"> <div class="twisting"> <table style="width:100%;border: 1px solid black;"> <tr style="background:#337AB7; color:#fff;"> <td colspan="14" style="padding:5px !important;"><strong>Stock Transfer</strong></td> </tr> <tr style="border: 1px solid black;"> <td colspan="14" style="padding:5px !important;color:black;">Transferred Id               :   <input type="text" class="text-input1 transfer_id" id="transfer_id" name="transfer_id" style="width: 240px;border: transparent;" value="<?php echo $f0; ?>" readonly="readonly"> </td> <input type="hidden" id="trans_id" name="trans_id" class="trans_id" value="<?php echo $financial_year; ?>"> <input type="hidden" id="transfer_id_val" name="transfer_id_val" class="transfer_id_val" value="<?php echo $f1; ?>"> </tr> <tr style="border: 1px solid black;"> <td colspan="14" style="padding:5px !important;color:black;">Product Type               :   <input type="text" class="text-input1 product_type" id="product_type" name="product_type" style="width: 240px;border: transparent;" value="<?php echo 'REMNANTS'; ?>" readonly="readonly"> </td> </tr> <tr style="border: 1px solid black;"> <td colspan="14" style="padding:5px !important;color:black;">Product Location        : <select id="product_location" name="product_location" onchange="location_change()" style="width: 240px;border: transparent;"> <?php if(isset($consumed_at)) { foreach($consumed_at as $consumed_at) { ?> <option value="<?php echo $consumed_at->id; ?>" <?php if($consumed_at->id == $f2) {echo "selected";}?>><?php echo $consumed_at->consumed_at; ?></option> <?php }} ?> </select></td> </tr> <tr style="border: 1px solid black;"> <td colspan="14" style="padding:5px !important;color:black;">Transferred Location   : <select id="transfer_location" name="transfer_location" style="width: 240px;border: transparent;"> <option value="">Select</option> <?php if(isset($location)) { foreach($location as $location) { ?> <option value="<?php echo $location->id; ?>" <?php if($location->id == $f3) {echo "selected";}?> ><?php echo $location->consumed_at; ?></option> <?php }} ?> </select></td> </tr> <tr style="border: 1px solid black;"> <td colspan="14" style="padding:5px !important;color:black;">Transferred Date           : <input type="text" class="text-input1 sys_date" id="transfer_date" name="transfer_date" value="<?php echo Date('d-m-Y'); ?>" style="width: 240px;border: transparent;" readonly> </td> </tr> <tr style="border: 1px solid black;"> <td colspan="14" style="padding:5px !important;color:black;">Transferred By               : <input type="text" class="text-input1 sys_date " id="transfer_by" name="transfer_by" value="<?php echo $approved_by; ?>" readonly style="width: 240px;border: transparent;"> </td> </tr> <tr style="border: 1px solid black;"> <td colspan="14" style="padding:5px !important;color:black;">Remarks                        : <input type="text" class="text-input1 sys_date" id="remarks" name="remarks" value="<?php echo $f4; ?>" style="width: 899px;border: transparent;"> </td> </tr> <!-- <tr> <td colspan="14">Finishing Type : <?php if(empty($edit_data->article)){ ?> <select id="finishing_type" name="finishing_type" class="text-input1 finishing_type" style="width: 17%;text-align: center;"> <option value="">select</option> <?php foreach ($getresult as $getresult) {?> <option value="<?php echo $getresult->fabricType; ?>"><?php echo $getresult->fabricType; ?></option> <?php } ?> </select> <?php } ?></td> </tr> <tr> <td colspan="14">Comments : <input type="text" class="text-input1 comment openDatePicker" id="comment" name="comment" data-provide="datepicker"></td> </tr>--> </table> </div> <!---------------------------------------------------------Fabric Table------------------------------------------------------------------> <div class="fabric_material" > <table style="width:100%"> <tr style="background:#337AB7; color:#fff;"> <td colspan="13"><strong>Transfer Data</strong> <a style="margin-left: 25%;color:#fff;" onclick="m_function()" > <i class="fa fa-plus"></i></a></td> </tr> <tr class="material-tr"> <td>SI #</td> <td>OSL#</td> <td>Yarn Details</td> <td>Yarn Denier</td> <td>Yarn Specification</td> <td>Color Code</td> <td>Shade</td> <td>Lot</td> <td>Bale</td> <td>Bag</td> <td>Remnants</td> <td>Transfer Remnants</td> <td>Balanced Remnants</td> </tr> <tbody class="transfer_fabric" id="transfer_fabric" name="transfer_fabric"> <?php $i=1; foreach($result as $rr) { foreach($rr as $r) { ?> <tr> <td style="width:4%;text-align:right;"><?php echo $i; ?></td> <td style="width:5%;"><input type="text" class="text-input osl_no" name="osl_no[]" id="osl_no" value="<?php echo $r->osl_no; ?>" readonly="readonly"><input type="hidden" class="text-input ref_id" name="ref_id[]" id="ref_id" value="<?php echo $r->id; ?>" ></td> <td style="width:8%;"><input type="text" class="text-input yarn_name" name="yarn_name[] " id="yarn_name" value="<?php echo $r->yarn_name; ?>" readonly="readonly"></td> <td style="width:5%;"><input type="text" class="text-input yarn_den" name="yarn_den[]" id="yarn_den" value="<?php echo $r->yarn_den; ?>" readonly="readonly"></td> <td style="width:17%;"><input type="text" class="text-input yarn_spec " name="yarn_spec[]" id="yarn_spec" value="<?php echo $r->yarn_spec; ?>" readonly="readonly"></td> <td style="width:8%;"><input type="text" class="text-input color_code" style="text-align:right;" name="color_code[]" id="color_code" value="<?php echo $r->color_code; ?>" readonly="readonly"></td> <td style="width:8%;"><input type="text" class="text-input yarn_ssl_shade" style="text-align:right;" name="yarn_ssl_shade[]" id="yarn_ssl_shade" value="<?php echo $r->yarn_ssl_shade; ?>" readonly="readonly"></td> <td style="width:5%;"><input type="text" class="text-input yarn_lot" style="text-align:right;" name="yarn_lot[]" id="yarn_lot" value="<?php echo $r->yarn_lot; ?>" readonly="readonly"></td> <td style="width:5%;"><input type="text" class="text-input yarn_bale" style="text-align:right;" name="yarn_bale[]" id="yarn_bale" value="<?php echo $r->yarn_bale; ?>" readonly="readonly"></td> <td style="width:10%;"><input type="text" class="text-input bag" style="text-align:right;" name="bag[]" id="bag" value="<?php echo $r->bag; ?>" readonly="readonly"></td> <td style="width:10%;"><input type="text" class="text-input rements<?php echo $i; ?> rem" style="text-align:right;" name="rements[]" id="rements" value="<?php echo $r->rements_stock; ?>"></td> <td style="width:10%;"><input type="text" class="text-input issued_netweight<?php echo $i; ?> issued_wt " style="text-align:right;" name="issued_netweight[]" value="<?php echo $r->rements_stock; ?>" id="issued_netweight" onkeyup="issue_net_weight(<?php echo $i; ?>)"></td> <td style="width:10%;"><input type="text" class="text-input balanced_netweight<?php echo $i; ?> bal_wt " style="text-align:right;" name="balanced_netweight[]" value="<?php echo '0.00'; ?>" id="balanced_netweight" ></td> </tr> <?php $i++; } } ?> </tbody> </table> </div> </section> </div> <!--- content-wrapper ----> </div> <!--- portlet-body form ---> <!----------------------------------------------------End modal---------------------------------------------------------------------------------> <div class="modal-footer"> <button name="submit_data" type="submit" id="submit_data" class="btn center-block submit ss" style="background:rgb(35,134,202);color:white;float: left; ">Submit</button> <a href="<?php echo base_url(); ?>stock/fabric_stock_grid?prop_id=1" class="btn default" style="background:rgb(35,134,202);color:white;float: left;">Cancel</a> </div> </form> </div> <!--------------------------------------------Modal ------------------------------------------------------------------> </fieldset> </div> </div> </div> </div> </div> <!-- page-content --> </div> </div> <!-- page-content --> </div> <!-- page-content-wrapper --> <style> #dying{ display:none; } .form-horizontal .radio-inline { padding-top: 2px !important; margin-top: 0; margin-bottom: 0; } .form-horizontal .radio > span { margin-top: -3px !important; } .skin-blue .wrapper, .skin-blue .left-side { background-color: #ffffff !important; } .skin-blue .main-sidebar { background-color: #e6e6e6 !important; } @media only screen and (min-width:641px) and (max-width:991px) { .form-group label{ padding-left:20px !important; } } .body-middle { //width:550px; padding-top: 20px; padding-left: 20px; padding-right: 20px; color:#000; } .twisting { padding-bottom:50px; } .twisting table, th, td { border: 1px solid black; border-collapse: collapse; } .twisting th, td { padding:5px; } .text-input { border: initial; width:100%; } .text-input1 { border: initial; width:80%; } .material-tr td { text-align:center; } #ui-id-1 { display: none; width: 350px; top: 258px; overflow-x: hidden !important; overflow-y: scroll !important; height: 203px !important; } #ui-id-2 { display: none; width: 350px; top: 258px; overflow-x: hidden !important; overflow-y: scroll !important; height: 203px !important; } </style> <!--<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" >--> <script> function location_change() { var loc=$('#product_location').val(); if(loc != '1') { $("#transfer_location").children("option[value^=" + '1' + "]").show() } $("#transfer_location").children("option[value^=" + loc + "]").hide() } function m_function() { var as1=$('#transfer_id').val(); var as2=$('#transfer_id_val').val(); var as3=$('#product_location').val(); var as4=$('#transfer_location').val(); var as5=$('#remarks').val(); $.ajax({ url:"<?php echo base_url('stock/remnants_stock');?>", type:"POST", data:{}, async:false, success:function(data) { window.location.href = '<?php echo base_url('stock/remnants_stock');?>/'+ '?id='+as1+'/'+as2+'/'+as3+'/'+as4+'/'+as5; } }); } </script> <!-----------------------------------after submit-------------------------------------------------------------> <!--------------------main submit----------------------------> <link href="<?php echo base_url('assets/css/sweetalert2.min.css');?>" rel="stylesheet"/> <script src="<?php echo base_url('assets/js/sweetalert2.min.js');?>"></script> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script> $('.transfer_modal_application').submit(function(e){ e.preventDefault(); formdata = new FormData($(this)[0]); $.ajax({ type : 'post', url : '<?php echo base_url('stock/add_remnants_transfer_application_form');?>', data : formdata, contentType: false, processData: false, success:function(response) { var obj = jQuery.parseJSON(response); if(obj == 'exist') { var confirmMsg= confirm("This Transferred Id Is Already Existed Do You Want To change Trasferred Id!"); if (confirmMsg==true) { var str=$('#product_type').val(); window.location.reload(); } else if (confirmMsg==false) { window.location.href = '<?php echo base_url('stock/remnants_stock_grid?prop_id=1'); ?>'; } } else { window.location.href = '<?php echo base_url('stock/remnants_stock_grid?prop_id=1'); ?>'; } } }); }); </script> <!-----------------------------calculations---------------------------------------------> <script> function issue_net_weight(i) { $('.issued_netweight'+i).on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); var rements =$('.rements'+i).val(); var issued_netweight =$('.issued_netweight'+i).val(); if(parseFloat(issued_netweight) > parseFloat(rements)) { swal({ title: "Issued Net Weight is Exceeded", text: "", }); $('.issued_netweight'+i).val(rements); } else { var balanced_weight = rements - issued_netweight ; $('.balanced_netweight'+i).val(balanced_weight.toFixed(2)); } } </script> <style> .content-wrapper{ overflow:auto !important; } .modal-dialog{ width:70% !important; } .ss{ margin-left:415px; } @media only screen and (min-width:320px) and (max-width:640px){ .modal-dialog{ width:1000px !important; } #myModal , #myModal_weft{ width:100% !important; overflow-x:scroll; } .ss{ margin-left:0px; } } </style>