EVOLUTION-NINJA
Edit File: fabric_emb_details.php
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.min.css"> <script src="//cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.jquery.min.js"></script> <script> $(document).ready(function(){ $(".designing_drop_down").chosen({}); //$(".shades").chosen({}); }); </script> <style> .chosen-results { height:300px !important; } .table-responsive { overflow-x:inherit !important; } </style> <script> function m_function() { var as=$('#fin_location').val(); var as1=$('#work_order').val(); var as2=$('#vendor_name').val(); var as3=$('#finishing_type').val(); var as4=$('#sys_date').val(); var as5=$('#comment').val(); //var as6=$('#work_order_num').val(); var as6=$('#work_order_num').val(); $.ajax({ type:'post', url:'<?php echo base_url("out_source/fabric_embroidry_data"); ?>', data:{'as':as}, async:false, success:function() { window.location.href = '<?php echo base_url('out_source/fabric_embroidry_data');?>/'+ '?id='+as+'/'+as1+'/'+as2+'/'+as3+'/'+as4+'/'+as5+'/'+as6; } }); // window.location.href="<?php echo base_url('out_source/fabric_embroidry_data'); ?>/s"+location+"/"; } </script> <script> $(document).ready(function() { $( "#vendor_name" ).autocomplete({ source: '<?php echo base_url('vendor/auto_names'); ?>', }); }); $(function () { $("#sys_date").datepicker({ dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true }); }); $(document).ready(function () { $('input[type="radio"]').click(function () { if ($(this).attr("value") == "all") { $("#all_location").show(); $("#ho_location").hide(); $("#peenya_location").hide(); $("#tailoring_location").hide(); $("#nandi_location").hide(); } if ($(this).attr("value") == "ho") { $("#ho_location").show(); $("#peenya_location").hide(); $("#all_location").hide(); $("#tailoring_location").hide(); $("#nandi_location").hide(); } if ($(this).attr("value") == "peenya") { $("#ho_location").hide(); $("#peenya_location").show(); $("#all_location").hide(); $("#tailoring_location").hide(); $("#nandi_location").hide(); } if ($(this).attr("value") == "nandi") { $("#tailoring_location").hide(); $("#nandi_location").show(); $("#ho_location").hide(); $("#peenya_location").hide(); $("#all_location").hide(); } if ($(this).attr("value") == "tailoring") { $("#tailoring_location").show(); $("#nandi_location").hide(); $("#ho_location").hide(); $("#peenya_location").hide(); $("#all_location").hide(); } }); }); </script> <style> .form-control { height: 22px !important; } #yarn-body1 { display:none; } #yarn-body2 { display:none; } #yarn-raw-body { display:none; } </style> <?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('out_source/fabric_embroidry_grid?prop_id=1'); ?>" > Fabric Finishing / Embroidery </a></li> </ul> </div> <div id="twisting"> <div class="portlet-body form"> <div class="content-wrapper"> <section class="body-middle"> <div class="twisting"> <table style="width:100%"> <tr style="background:#337AB7; color:#fff;"> <td colspan="14"><strong>Fabric</strong></td> </tr> <tr> <td colspan="14">Work Order#         :     <input type="text" class="text-input1 work_order" value="<?php echo $f1; ?>" id="work_order" name="work_order"></td> <input type="hidden" class="text-input1 work_order_num" value="<?php echo $f6; ?>" id="work_order_num" name="work_order_num"> </tr> <tr> <td colspan="14">Vendor Name       :     <input type="text" class="text-input1 vendor_name" id="vendor_name" name="vendor_name" value="<?php echo $neww; ?>"></td> </tr> <tr> <td colspan="14">Finishing Type       :     <select id="finishing_type" name="finishing_type" class="text-input1 finishing_type" style="width: 17%;text-align: center;"> <?php foreach ($getresult as $getresult) {?> <option value="<?php echo $getresult->fabricID; ?>" <?php if($getresult->fabricID == $f3) {echo "selected";}?> style="text-transform: uppercase !important"><?php echo $getresult->fabricType; ?></option> <?php } ?> </select> </td> </tr> <tr> <td colspan="14">Location Name     :     <select id="fin_location" name="fin_location" style="width: 175px;border: transparent;padding-top: 4px; padding-bottom: 5px;"> <?php if(isset($consumed_at)) { foreach($consumed_at as $consumed_at) { ?> <option value="<?php echo $consumed_at->id; ?>" <?php if($consumed_at->id == $f7) {echo "selected";}?>><?php echo $consumed_at->consumed_at; ?></option> <?php }} ?> </select></td> </tr> <tr> <td colspan="14">Delivery Date       :     <input type="text" class="text-input1 sys_date openDatePicker" id="sys_date" name="sys_date" data-provide="datepicker" value="<?php echo $f4; ?>"></td> </tr> <tr> <td colspan="14">Comments           :     <input type="text" class="text-input1 comment openDatePicker" id="comment" name="comment" value="<?php echo $f5; ?>" data-provide="datepicker"></td> </tr> </table> </div> <div class="material"> <table style="width:100%"> <tr style="background:#337AB7; color:#fff;"> <td colspan="13"><strong>Fabric Issues</strong> <button style="margin-left: 25%;color:#fff;" id="waeving_modal" onclick="m_function()" name="weaving_modal"> <i class="fa fa-plus" style="color:#337AB7;;"></i></button</td> </tr> <tr class="material-tr"> <td>SI #</td> <td>Article(PRODUCT)</td> <td>PO# / OSL No.</td> <td>Supplier Piece No</td> <td>width</td> <td>Design</td> <td>Shade</td> <td>Received Weight</td> <td>Stock Mtrs</td> <td>Issue stock</td> <td>Balanced Weight</td> <td>Balanced Stock</td> </tr> <tbody class="yarnTbody" id="yarnTbody" name="yarnTbody"> <?php $i= 1; foreach($result as $v) { foreach($v as $r) { ?> <tr > <td style="width:4% !important;text-align:right;"><input type="text" name="id" id="id" class="id" value="<?php echo $i; ?>" style="width:20px !important;border:0px !important;padding:0px !important;" readonly="readonly"/><input type="hidden" class="sl_id" id="sl_id" value="<?php echo $r->id; ?>" ></td> <td style="width:15% !important;text-align:right;"><input type="text" name="product_name" id="product_name" class="product_name" value="<?php echo $r->product_name; ?>" style="width:200px !important;border:0px !important;padding:0px !important;" readonly="readonly"/></td> <td style="width:5% !important;text-align:right; padding:0px !important;" ><input type="text" name="po_no" id="po_no" class="po_no" value="<?php echo $r->po_no; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td> <td style="width:8% !important;text-align:right; padding:0px !important;"><input type="text" name="ssl_po_no" id="ssl_po_no" class="ssl_po_no" value="<?php echo $r->ssl_pc_no; ?>" style="width:120px !important;border:0px !important" readonly="readonly"/></td> <td style="width:8% !important;text-align:right; padding:0px !important;"><input type="text" name="width" id="width" class="width" value="<?php echo $r->width; ?>" style="width:120px !important;border:0px !important" readonly="readonly"/></td> <td style="width:8% !important;text-align:right; padding:0px !important;" class="search_design"> <?php if($r->design == '') { ?> <select id="design" class="design designing_drop_down" style="border:transparent;"> <option value=""></option> <?php foreach($design_master as $design) { ?> <option value="<?php echo $design->designmp; ?>"><?php echo $design->designmp; ?></option> <?php } ?> </select> <?php } else { ?> <input type="text" name="design" id="design" class="design" value="<?php echo $r->design; ?>" style="width:120px !important;border:0px !important" readonly="readonly"/> <?php } ?> </td> <td style="width:8% !important;text-align:right; padding:0px !important;"> <!--<select id="shades" class="shades" style="border:transparent;"> <option value="<?php //echo $r->shades; ?>"><?php //echo $r->shades; ?></option> <?php //if(isset($shade_master)) { foreach($shade_master as $shade) { ?> <option value="<?php //echo $shade->shadeName; ?>" <?php //if($r->shades == $shade->shadeName) { echo "selected"; }?> ><?php //echo $shade->shadeName; ?></option> <?php// }} ?> </select> --> <input type="text" name="shades" id="shades" class="shades" value="<?php echo $r->shades; ?>" style="width:120px !important;border:0px !important" /> </td> <td style="width:8% !important;text-align:right; padding:0px !important;"><input type="text" name="rec__mtrs" id="inspected_mtrs" class="rec_m rec_mtrs<?php echo $i; ?>" value="<?php echo $r->rec_weight; ?>" style="width:120px !important;border:0px !important" readonly="readonly"/></td> <td style="width:8% !important;text-align:right; padding:0px !important;"><input type="text" name="inspected_mtrs" id="inspected_mtrs" class="inspected_m inspected_mtrs<?php echo $i; ?>" value="<?php echo $r->balanced_mtrs; ?>" style="width:120px !important;border:0px !important" readonly="readonly"/></td> <td style="width:8% !important;text-align:right; padding:0px !important;"><input type="text" name="issue_stock" id="issue_stock" class="issue_stock<?php echo $i; ?> issuestock" value="<?php echo $r->balanced_mtrs; ?>" style="width:120px !important;border:0px !important" onkeyup="dyeing_unitvalue(this.value,<?php echo $i; ?>)" /></td> <td style="width:8% !important;text-align:right; padding:0px !important;"><input type="text" name="balanced_weight" id="balanced_weight" class="balanced_weight<?php echo $i; ?> balweight" value="<?php echo '0.00'; ?>" style="width:120px !important;border:0px !important" readonly="readonly"/></td> <td style="width:8% !important;text-align:right; padding:0px !important;"><input type="text" name="balanced_stock" id="balanced_stock" class="balanced_stock<?php echo $i; ?> balstock" value="<?php echo '0.00'; ?>" style="width:120px !important;border:0px !important" readonly="readonly"/></td> </tr> <?php $i++; } }?> </tbody> </table> </div> </section> </div> <!--- content-wrapper ----> </div> <!--- portlet-body form ---> <input type="hidden" class="ids" > <div class="modal-footer"> <!--<button name="submit_data" id="submit_data" class="btn center-block submit" style="background:rgb(35,134,202);color:white">Submit</button>--> <button name="submit_data" 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(); ?>out_source/fabric_embroidry_grid?prop_id=1" class="btn default" style="background:rgb(35,134,202);color:white;float: left;">Cancel</a> </div> </div> <div id="myModal_weft_dying" class="modal fade" role="dialog" style="color:#000;"> <div class="modal-dialog" > <!-- Modal content--> <div class="modal-content" style="height: 600px !important;overflow-x: scroll;width: 1282px;"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Fabric Details</h4> </div> <div class="modal-body"> <fieldset> <div > <button id="generate" class="btn btn-primary generate" value="Generate" style="float:right;" data-dismiss="modal" >Submit</button> <!-- <input type="text" id="myInput" onkeyup="myFunction_filetr()" placeholder="Search for names.." title="Type in a name"> <input type="text" id="search" placeholder=" live search"></input>--> <!-- Form Name --> <div class="row" style="padding-bottom:15px;"> <div class="col-sm-4"></div> <div class="col-sm-6"> <select id="location_name" onchange="location_function()" name="location_name" style="border: transparent;padding-top: 4px; padding-bottom: 5px;"> <option value="">Select Location</option> <?php if(isset($location)) { foreach($location as $consumed_at) { ?> <option value="<?php echo $consumed_at->consumed_at; ?>"><?php echo $consumed_at->consumed_at; ?></option> <?php }} ?> </select> <!--<label class="radio-inline"><input type="radio" name="optradio" checked value="all">ALL</label> <label class="radio-inline"><input type="radio" name="optradio" value="ho">HO </label> <label class="radio-inline"><input type="radio" name="optradio" value="peenya">Peenya Dyeing</label> <label class="radio-inline"><input type="radio" name="optradio" value="nandi">Nandi </label> <label class="radio-inline"><input type="radio" name="optradio" value="tailoring">Peenya Tailoring</label>--> </div> <div class="col-sm-4"></div> </div> <!-- radio button ---> <div id="all_location"> <div class="portlet-body" id="portlet-body"> <div class="col-xs-6"> <label class="col-sm-2 col-xs-2" style="padding-right:0 !important;"><b>Search :</b> </label> <input type="text" id="search_yarn_swan" onkeyup="swan_myFunction()" class=" col-xs-5" placeholder="Type to search"> </div> <br/><br/> <table class="table table-striped table-bordered table-hover"> <thead> <tr> <th> Select Fabric </th> <th> Location </th> <th> Vendor Name / Factory </th> <th> PO# / OSL No. </th> <th> DTL Piece No </th> <th> Supplier Piece No </th> <!-- <th> Quantity </th> <th> Received Quantity </th>--> <th> Article(PRODUCT) </th> <th> Width </th> <th> Design </th> <th> Shade </th> <th> Received Weight </th> <th> Inspected Mtrs </th> <!-- <th> Rejected Mtrs </th> <th> Stage </th> --> </tr> </thead> <tbody id="swan_dyed_body"> <?php $i=1; if(isset($details)) { foreach($details as $twisting) { ?> <tr> <td ><input type="checkbox" name="id" id="id" class="yarn_raw_id" value="<?php echo $twisting->id; ?>" style="width:20px !important;border:0px !important;padding:0px !important;"/><input type="hidden" value="<?php echo $twisting->id; ?>"></td> <td ><input type="text" name="m_c_name" id="m_c_name" class="m_c_name" value="<?php echo $twisting->consumed_at; ?>" style="width:100px !important;border:0px !important;padding:0px !important;" readonly="readonly"/></td> <td ><input type="text" name="m_yarn_name" id="m_yarn_name" class="m_yarn_name" value="<?php echo $twisting->vendor_name; ?>" style="width:100px !important;border:0px !important;padding:0px !important;" readonly="readonly"/></td> <td ><input type="text" name="m_yarn_name" id="m_yarn_name" class="m_yarn_name" value="<?php echo $twisting->po_no; ?>" style="width:100px !important;border:0px !important;padding:0px !important;" readonly="readonly"/></td> <td ><input type="text" name="m_yarn_specification" id="m_yarn_specification" class="m_yarn_name" value="<?php echo $twisting->ssl_pc_no; ?>" style="width:120px !important;border:0px !important" readonly="readonly"/></td> <td ><input type="text" name="m_yarn_denier" id="m_yarn_denier" class="m_yarn_name" value="<?php echo $twisting->piece_no; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td> <!--<td ><input type="text" name="lot" id="lot" class="m_yarn_name" value="<?php echo $twisting->quantity; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td> <td ><input type="text" name="lot" id="lot" class="m_yarn_name" value="<?php echo $twisting->rec_goods; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td>--> <!--<td ><input type="text" name="bale" id="bale" class="m_yarn_name" value="<?php echo $twisting->bal_goods; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td>--> <td ><input type="text" name="bale" id="bale" class="m_yarn_name" value="<?php echo $twisting->product_name; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td> <td ><input type="text" name="bale" id="bale" class="m_yarn_name" value="<?php echo $twisting->width; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td> <td ><input type="text" name="bale" id="bale" class="m_yarn_name" value="<?php echo $twisting->design; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td> <td ><input type="text" name="bale" id="bale" class="m_yarn_name" value="<?php echo $twisting->shades; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td> <td ><input type="text" name="bale" id="bale" class="m_yarn_name" value="<?php echo $twisting->rec_weight; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td> <td ><input type="text" name="bale" id="bale" class="m_yarn_name" value="<?php echo $twisting->balanced_mtrs; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td> <!-- <td ><input type="text" name="bale" id="bale" class="m_yarn_name" value="<?php echo $twisting->rejected_mtrs; ?>" style="width:60px !important;border:0px !important" readonly="readonly"/></td> --> </tr> <?php $i++; }} ?> </tbody> </table> </div> </fieldset> </div> <div id="ho_location" style="display:none;"> <div class="portlet-body" id="portlet-body"> <div class="col-xs-6"> <label class="col-sm-2 col-xs-2" style="padding-right:0 !important;"><b>Search :</b> </label> <input type="text" id="search_yarn_swan" onkeyup="swan_myFunction()" class=" col-xs-5" placeholder="Type to search"> </div> <br/><br/> <table class="table table-striped table-bordered table-hover" style="width: 98% !important;max-width: 100%;margin-bottom: 20px;margin-left: 9px !important;"> <thead> <tr> <th> Select Fabric </th> <th> Location </th> <th> Vendor Name / Factory </th> <th> PO# / OSL No. </th> <th> DTL Piece No </th> <th> Supplier Piece No </th> <!-- <th> Quantity </th> <th> Received Quantity </th>--> <th> Article(PRODUCT) </th> <th> Width </th> <th> Design </th> <th> Shade </th> <th> Received Weight </th> <th> Inspected Mtrs </th> <!-- <th> Rejected Mtrs </th> <th> Stage </th> --> </tr> </thead> <tbody id="swan_dyed_body"> </tbody> </table> </div> </fieldset> </div> </div> </div> </div> </div> <!-- page-content --> </div> <!-- page-content-wrapper --> <script> function dyeing_unitvalue(str,i) { var quty_kgs =$('.inspected_mtrs'+i).val(); var rec_kgs =$('.rec_mtrs'+i).val(); var result= parseFloat(rec_kgs) / parseFloat(quty_kgs); var rate_inr =$('.issue_stock'+i).val(); var r_stock = parseFloat(result) * parseFloat(rate_inr); var b_wgt = parseFloat(rec_kgs) - parseFloat(r_stock); var inr_val = parseFloat(quty_kgs) - parseFloat(rate_inr); $('.balanced_stock'+i).val(inr_val.toFixed(2)); $('.balanced_weight'+i).val(b_wgt.toFixed(2)); } var $rows = $('#sample tr'); $('#search_warp').keyup(function() { var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase(); $rows.show().filter(function() { var text = $(this).text().replace(/\s+/g, ' ').toLowerCase(); return !~text.indexOf(val); }).hide(); }); </script> <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> sl_id=[]; issue_stock=[]; balanced_stock=[]; inspected_m=[]; balanced_weight=[]; rec_m=[]; $("#submit_data").click(function(e) { e.preventDefault(); //alert(); // $('.product_name').each(function () { // product_name.push($(this).val()); // }); // $('.po_no').each(function () { // po_no.push($(this).val()); // }); // $('.ssl_pc_no').each(function () { // ssl_pc_no.push($(this).val()); // }); // $('.width').each(function () { // width.push($(this).val()); // }); // $('.shades').each(function () { // shades.push($(this).val()); // }); $('.sl_id').each(function () { sl_id.push($(this).val()); }); $('.inspected_m').each(function () { inspected_m.push($(this).val()); }); $('.issuestock').each(function () { issue_stock.push($(this).val()); }); $('.balstock').each(function () { balanced_stock.push($(this).val()); }); $('.balweight').each(function () { balanced_weight.push($(this).val()); }); $('.rec_m').each(function () { rec_m.push($(this).val()); }); var ids =$('.ids').val(); //'ids':checkbox_value //alert(ids); var work_order =$('#work_order').val(); var work_order_num =$('#work_order_num').val(); var vendor_name =$('#vendor_name').val(); var sys_date =$('#sys_date').val(); var finishing_type =$('#finishing_type').val(); var comment =$('#comment').val(); var i=0; var t=0; i=parseFloat(issue_stock); t=parseFloat(inspected_m); //alert(issue_stock); //alert(inspected_m); if(i > t) { swal({ title: "Issued Stock is Exceeded", text: "", }); //alert('Issued Stock is Exceeded'); issue_stock.length=0; inspected_m.length=0; balanced_stock.length=0; sl_id.length=0; } else { $.ajax({ url:"<?php echo base_url('out_source/insert_embroidry_data');?>", type:"POST", data:{'balanced_weight':balanced_weight,'rec_m':rec_m,'work_order_num':work_order_num,'work_order':work_order,'vendor_name':vendor_name,'sys_date':sys_date,'comment':comment,'finishing_type':finishing_type,'sl_id':sl_id,'balanced_stock':balanced_stock,'issue_stock':issue_stock,'ids':ids}, async:false, success:function(data){ // swal({ // title: "Issued Stock is Exceeded", // text: "", // }); window.location.href = '<?php echo base_url('out_source/fabric_embroidry_grid?prop_id=1');?>'; } }); } }); $(document).ready(function(){ $('#issue_stock').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); }); </script> <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> <style> // .content-wrapper{ // // overflow:auto !important; // } .modal-dialog{ width:70% !important; } .ss{ margin-left:415px; } .modal-content{ margin-left:-170px; } @media only screen and (min-width:320px) and (max-width:640px){ .modal-dialog{ width:1200px !important; } #myModal_weft_dying{ width:100% !important; overflow-x:scroll; } .ss{ margin-left:0px; } .modal-content{ margin-left:0px; } } </style>