EVOLUTION-NINJA
Edit File: fabric_madeups_preview_page.php
<?php //include("menu.php"); error_reporting(E_ALL); ?> <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/avinash.min.css" > <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/skin-blue.min.css" > <link rel='shortcut icon' type='image/x-icon' href="<?php echo base_url(); ?>assets/images/samll-big.png"/> <div class="page-content-wrapper"> <div class="page-content"> <div class="row" style=" text-align: right;"> <button class="btn btn-success btn-lg" type="button" id="booking_print" style=" padding-top: 2px; padding-bottom: 3px; padding-left: 15px; padding-right: 15px; background: rgb(72,91,127); color: white; border: initial !important; font-size: 22px;">Print </button> <?php if($madeups_trought == 'm') { ?> <?php if($indent_p == 'indent_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/issue_stock_grid?prop_id=1');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } else if($indent_p == 'today_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/issue_stock_grid?prop_id=2');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } else if($indent_p == 'monthly_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/issue_stock_grid?prop_id=3');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } else if($indent_p == 'year_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/issue_stock_grid?prop_id=4');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } ?> <?php } else if($madeups_trought == 'mm') { ?> <?php if($indent_p == 'indent_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/fabric_delivery_conformation?prop_id=1');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } else if($indent_p == 'today_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/fabric_delivery_conformation?prop_id=2');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } else if($indent_p == 'monthly_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/fabric_delivery_conformation?prop_id=3');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } else if($indent_p == 'year_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/fabric_delivery_conformation?prop_id=4');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } ?> <?php } else if($madeups_trought == 'c') { ?> <?php if($indent_p == 'indent_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/consumable_madeups_details?prop_id=1');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } else if($indent_p == 'today_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/consumable_madeups_details?prop_id=2');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } else if($indent_p == 'monthly_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/consumable_madeups_details?prop_id=3');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } else if($indent_p == 'year_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('madeups/consumable_madeups_details?prop_id=4');?>" style="font-size: 22px;border: 1px solid;padding-left: 15px;padding-right: 15px;background: rgb(72,91,127);color: white;padding-bottom: 7px;text-decoration:none;">Back</a></span> <?php } ?> <?php } ?> </div> <div class="content-wrapper print" id="print_report" style="padding:10px;"> <table style="width:100%;border-spacing:0;"> <tr> <td colspan="11"></td> <td style="text-align:right;">E-mail : sales@swansilk.com</td> </tr> <tr> <td colspan="11"></td> <td style="text-align:right;">Phone : 080-41888298</td> </tr> <tr> <td colspan="12" style="text-align:center;font-weight:900;font-size:20px;font-style:Akashi;">DECO-TEXTIL</td> </tr> <tr> <td colspan="12" style="text-align:center;">"SWAN HOUSE" No:40, 4th cross, Residency Road, Banglore - 560025. INDIA</td> </tr> <tr> <td colspan="12" style="text-align:center;font-weight:600;text-decoration: underline;">ISSUE TO MADEUPS</td> </tr> <tr> <td colspan="10"></td> <td colspan="2" style="text-align:right;"> </td> </tr> <tr> <td colspan="10"><?php if(empty($fetch_address->name)) echo "SWAN SILK PVT LTD" . "<br/>" ."NO 40 4TH CROSS RESIDENCY ROAD". "<br/>". "BANGALORE-560025" . "<br/>". "INDIA "; else echo $fetch_address->name . "<br/>" .$fetch_address->address . "<br/>". $fetch_address->city . "<br/>". $fetch_address->country . "-". $fetch_address->pincode; ?></td> <!-- <td colspan="10"><?php //if(empty($fetch_address->name)) echo "SWAN SILK PVT LTD" . "<br/>" ."NO 40 4TH CROSS RESIDENCY ROAD". "<br/>". "BANGALORE-560025" . "<br/>". "INDIA "; else echo $fetch_address->name . "<br/>" .$fetch_address->address . "<br/>". $fetch_address->city . "<br/>". $fetch_address->country . "-". $fetch_address->pincode; ?></td>--> <td colspan="2" style="text-align:right;"> DTL No. :<?php if(empty($fetch_other)) { echo $fetch_other_data->oslNo; } else { echo $fetch_other->osl; } ?></td> </tr> <tr> <td colspan="10"></td> <td colspan="2" style="text-align:right;">Date : <?php echo date("d-m-Y"); ?></td> </tr> <tr> <td colspan="2" style="padding-top: 1%;">Sir / Madam,</td> <!--<td colspan="2" style="padding-top: 1%;">INDENT NO.114 DT. 23.05.17</td>--> <td colspan="8"></td> </tr> <tr> <td colspan="12"> <p style="padding-left:5%;padding-top: 1%;">We requested you to process Issue To Madeups requirement.</p> </td> </tr> </table> <table border="1" style="width:100%;border-spacing:0;margin-top: 1%;" cellpadding="4px"> <thead> <tr> <th>SL No.</th> <th>DTL #</th> <th>Order Type</th> <th>sIZE</th> <th>Article</th> <th>Design</th> <th>Shade</th> <th>DTL Shade</th> <th>Order Qty</th> <th>Description</th> </tr> </thead> <tbody> <?php $i=1; ?> <?php if(empty($fetch_other)) { ?> <tr > <td><?php echo $i; ?></td> <td><?php echo $fetch_other_data->oslNo; ?></td> <td><?php echo $fetch_other_data->subOrderType; ?></td> <td><?php echo $fetch_other_data->width; ?></td> <td><?php echo $fetch_other_data->articleNo; ?></td> <td><?php echo $fetch_other_data->design ; ?></td> <td><?php echo $fetch_other_data->buyerShade; ?></td> <td><?php echo $fetch_other_data->shadeName; ?></td> <td><?php echo $fetch_other_data->quantity; ?></td> <td><?php echo $fetch_other_data->description; ?></td> </tr> <?php } else { ?> <tr > <td><?php echo $i; ?></td> <td><?php echo $fetch_other->osl; ?></td> <td><?php echo $fetch_other->order_type; ?></td> <td><?php echo $fetch_other->size; ?></td> <td><?php echo $fetch_other->article; ?></td> <td><?php echo $fetch_other->design ; ?></td> <td><?php echo $fetch_other->shades; ?></td> <td><?php echo $fetch_other->ssl_shade; ?></td> <td><?php echo $fetch_other->order_qty; ?></td> <td><?php echo $fetch_other->description; ?></td> </tr> <?php $i++; } ?> </tbody> </table> <div class=""> <!-----Warp Details ----------------------> <br/>Below is the Issue Stock Details <table border="1" class="" style="width:100%;border-spacing:0;margin-top: 1%;margin-bottom: 67px;" cellpadding="2px"> <thead> <tr> <th>SL No.</th> <th>DTL #</th> <th>DTL Piece#</th> <th>Width</th> <th>Article</th> <th>Design</th> <th>Shade</th> <th>Issue Mtrs</th> <th>Issue For</th> <th>Estimated Pcs</th> <th>Issue Date</th> <th>Location</th> <th>Issued By</th> </tr> </thead> <?php if(isset($fetch_fabric)) { $i=1; foreach($fetch_fabric as $f) { ?> <tr > <td><?php echo $i; ?></td> <td><?php echo $f->f_osl; ?></td> <td><?php echo $f->f_ssl_piece; ?></td> <td><?php echo $f->f_width; ?></td> <td><?php echo $f->f_article; ?></td> <td><?php echo $f->f_design ; ?></td> <td><?php echo $f->f_shade; ?></td> <td><?php echo $f->f_issue_mtrs; ?></td> <td><?php echo $f->issued_for; ?></td> <td><?php echo $f->est_pcs; ?></td> <td><?php echo $f->issue_date; ?></td> <td><?php echo $f->location; ?></td> <td><?php echo $f->issued_by; ?></td> </tr> <?php $i++; } } ?> <tr> <td colspan="12" style="text-align:right;">Total Issued Mtrs : <?php if(empty($fetch_fabric_issue_mtrs)) { echo '0.00'; } else { echo number_format((float)$fetch_fabric_issue_mtrs->f_issue_mtrs, 2, '.', ''); } ?> <br/> Total Estimated Pcs : <?php if(empty($fetch_fabric_est_pcs)) { echo '0.00'; } else { echo number_format((float)$fetch_fabric_est_pcs->est_pcs, 2, '.', ''); } ?> </td> </tr> </table> <!-------------Weft Details----------------------> </div> <table style="margin-top:10px;"> <!--<tr> <td><?php echo $fetch_data->comment; ?></td> </tr>--> <tr> <?php if(empty($fetch_address)) { echo ""; } else { ?> <td > Bank Details : <?php echo 'A/c No. '. $fetch_address->ac_no . ',' . $fetch_address->name . ' ' . $fetch_address->bank_address ; ?></td> <?php } ?> </tr> </table> <table style="width:100%;margin-top:20px;"> <tr> <td>FOR SWAN SILK (P) LIMITED</td> <td style="text-align:right;">FOR SWAN SILK (P) LIMITED</td> </tr> <tr > <td style="padding-top:3%;">EXECUTIVE - PURCHASE</td> <td style="text-align:right;padding-top:3%;">DIRECTOR</td> </tr> <tr> <td colspan="2" style="text-align:center; padding-top:5%;">IT IS A COMPUTER GENERATED FORMAT. SIGNATURE IS NOT REQUIRED</td> </tr> </table> </div> <!--- content-wrapper ----> <!------------- content-wrapper END -----------------------------------------------------------------------------------------------------> <script> function myfunction() { // alert(); } </script> <script> $( document ).ready(function() { var shadeID=$('#shadeID').val(); // alert(shadeID); var something = $.ajax({ type: "post", url: "<?php echo base_url(); ?>planning/get_planned_warping_details", data: "subNumber=" + shadeID, success: function (data) { //alert(); var objData = jQuery.parseJSON(data); var obj1 = objData.shadeID; var obj2 = objData.shadeName; var obj4 = objData.resultWarp; // alert(obj4); var obj3 = objData.resultWeft; $('#sslShade_no').val(obj1); $('#sslShade').val(obj2); var content = ''; $("#warp_details").empty(); var i=1; $.each(obj4,function(key,val){ // alert(val.Warp_Specification); var ar_new=objData.sm_warp[key]; var ar_new1=objData.planned_warp_wt[key]; content += '<tr>'; content += '<td><input type="text" class="form-control ourShade_new"'; content += 'value="'+i+'" style="height: 30px; width: 100px; border: transparent;" readonly/></td>'; content += '<td><input type="text" class="form-control ourShade_new"'; content += 'value="'+val.Warp_Quality+'" style="height: 30px; width: 100px; border: transparent;" readonly/></td>'; content += '<td><input type="text" id="buyerShade" class="form-control buyerShade"'; content += 'style="height: 30px; width: 100px; border: transparent;" value="'+val.Warp_Specification+'" readonly/></td>'; content += '<td><input type="text" id="buyerShade" class="form-control buyerShade"'; content += 'style="height: 30px; width: 100px; border: transparent;" value="'+val.Warp_Denier+'" readonly/></td>'; content += '<td><input type="text" id="quantity" class="form-control quantity" '; content += 'style="height: 30px; width: 100px; border: transparent;" value="'+ar_new.warpCode+'" readonly/></td>'; content += '<td><input type="text" class="form-control sub_form_controll unitPrice" '; content += 'style="height: 30px; width: 100px; border: transparent;" value="'+ar_new.warpColor+'" readonly/></td>'; content += '<td><input type="text"class="unitPrice" style="height: 30px; width: 100px; border: transparent;" value="'+ar_new1.warpWt+'" readonly/></td>'; content += '</tr>'; i++; }); $("#warp_details").html(content); var contentt=''; $("#weft_details").empty(); var i=1; $.each(obj3,function(key,val){ var ar_new=objData.sm_weft[key]; var ar_new1=objData.planned_weft_wt[key]; contentt += '<tr>'; //alert(val.Weft_Denier); contentt += '<td><input type="text" class="form-control ourShade_new"'; contentt += 'value="'+i+'" style="height: 30px; width: 100px; border: transparent;" readonly/></td>'; contentt += '<td><input type="text" class="form-control ourShade_new"'; contentt += 'value="'+val.Weft_Quality+'" style="height: 30px; width: 100px; border: transparent;" readonly/></td>'; contentt += '<td><input type="text" id="buyerShade" class="form-control buyerShade"'; contentt += 'style="height: 30px; width: 100px; border: transparent;" value="'+val.Weft_Specification+'" readonly/></td>'; contentt += '<td><input type="text" id="buyerShade" class="form-control buyerShade"'; contentt += 'style="height: 30px; width: 100px; border: transparent;" value="'+val.Weft_Denier+'" readonly/></td>'; contentt += '<td><input type="text" id="quantity" class="form-control quantity" '; contentt += 'style="height: 30px; width: 100px; border: transparent;" value="'+val.PPC+'" readonly/></td>'; contentt += '<td><input type="text" class="form-control sub_form_controll unitPrice" '; contentt += 'style="height: 30px; width: 100px; border: transparent;" value="'+ar_new.weftCode+'"readonly/></td>'; contentt += '<td><input type="text" class="form-control sub_form_controll unitPrice" '; contentt += 'style="height: 30px; width: 100px; border: transparent;" value="'+ar_new.weftColor+'"readonly/></td>'; contentt += '<td><input type="text"class="unitPrice" style="height: 30px; width: 100px; border: transparent;" value="'+ar_new1.weftWt+'" readonly/></td>'; contentt += '</tr>'; i++; }); $("#weft_details").html(contentt); } }); }); </script> <?php function convert_number_to_words($no) { //$no = round($number); //alert(); $hundred = null; $digits_1 = strlen($no); $i = 0; $str = array(); $words = array('0' => '', '1' => 'One', '2' => 'Two', '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six', '7' => 'Seven', '8' => 'Eight', '9' => 'Nine', '10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve', '13' => 'Thirteen', '14' => 'Fourteen', '15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen', '18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty', '30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty', '60' => 'Sixty', '70' => 'Seventy', '80' => 'Eighty', '90' => 'Ninety'); $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore'); while ($i < $digits_1) { $divider = ($i == 2) ? 10 : 100; $number = floor($no % $divider); $no = floor($no / $divider); $i += ($divider == 10) ? 1 : 2; if ($number) { $plural = (($counter = count($str)) && $number > 9) ? 's' : null; $hundred = ($counter == 1 && $str[0]) ? ' And ' : null; $str [] = ($number < 21) ? $words[$number] . " " . $digits[$counter] . $plural . " " . $hundred : $words[floor($number / 10) * 10] . " " . $words[$number % 10] . " " . $digits[$counter] . $plural . " " . $hundred; } else $str[] = null; } $str = array_reverse($str); $result = implode('', $str); return $result ; } ?> </div> <!----- wrapper -----> </div> <script> $(document).ready(function(){ $("#booking_print").click(function(){ var divToPrint=document.getElementById("print_report"); newWin= window.open(""); newWin.document.write(divToPrint.outerHTML); newWin.print(); newWin.close(); }); }); </script> <!--<script> var divContents = $(".print").html(); newWin= window.open(""); newWin.document.write(divContents); newWin.print(); newWin.close(); </script>--> <style> .content-wrapper{ overflow:auto !important; } .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { cursor: not-allowed; background-color: #fdfafa !important; opacity: 1; } </style>