EVOLUTION-NINJA
Edit File: design_weaving_preview.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($indent_p == 'indent_po') { ?> <span class="close-right" ><a href="<?php echo base_url(); ?>design_weaving/design_weaving_program?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(); ?>design_weaving/design_weaving_program?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(); ?>design_weaving/design_weaving_program?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(); ?>design_weaving/design_weaving_program?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 } ?> </div> <div class="content-wrapper print" id="print_report" style="padding:10px;"> <div class="table-responsive"> <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;">GSTN: 29AACCS4515R1ZR     PAN: AACCS45155R     CIN: U17112KA1986PTC007683</td> </tr> <tr> <td colspan="12" style="text-align:center;font-weight:600;text-decoration: underline;">DESIGN WEAVING</td> </tr> <tr> <td colspan="10"></td> <td colspan="2" style="text-align:right;"> </td> </tr> <!--<tr> <td colspan="10"><?php 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;">PO# : <?php echo $fetch->po_no; ?></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="10"></td> <td colspan="2" style="text-align:right;">Currency : <?php echo $fetch->currency; ?></td> </tr>--> <br/><br/> <tr> <td colspan="12"> </td> </tr> </table> </div> <div class="table-responsive"> <p colspan="12" style="font-weight:600;text-decoration: underline;">Design Weaving Details</p> <table border="1" style="width:100%;border-spacing:0;margin-top: 1%;" cellpadding="5px"> <thead> <tr> <th style="text-align:center;">ID</th> <th style="text-align:center;">Date</th> <th style="text-align:center;">Design Name</th> <th style="text-align:center;">Loom Width</th> <th style="text-align:center;">EPC</th> <th style="text-align:center;">Reed</th> <th style="text-align:center;">Weft Ratio</th> <!--<th>Remarks</th>--> <th style="text-align:center;">Weave</th> <th style="text-align:center;">Design</th> <th style="text-align:center;">Reed Width</th> <th style="text-align:center;">Warp Total Ends</th> <th style="text-align:center;">PPC</th> <th style="text-align:center;">Avg PPC</th> <th style="text-align:center;">Fabric Length</th> </tr> </thead> <tbody> <tr ><td style="text-align:center;"><?php echo $fetch_data->uni_id; ?></td> <td style="text-align:center;"><?php echo $fetch_data->current_date; ?></td> <td style="text-align:center;"><?php echo $fetch_data->design_name; ?></td> <td style="text-align:center;"><?php echo $fetch_data->loom_width; ?></td> <td style="text-align:center;"><?php echo $fetch_data->epc ; ?></td> <td style="text-align:center;"><?php echo $fetch_data->reed; ?></td> <td style="text-align:center;"><?php echo $fetch_data->weft_ratio; ?></td> <!--<td><?php echo $fetch_data->remarks; ?></td>--> <td style="text-align:center;"><?php echo $fetch_data->weave; ?></td> <td style="text-align:center;"><?php echo $fetch_data->design; ?></td> <td style="text-align:center;"><?php echo $fetch_data->reed_width; ?></td> <td style="text-align:center;"><?php echo $fetch_data->warp_ttl_ends; ?></td> <td style="text-align:center;"><?php echo number_format((float) $total_ppc->ppc, 2, '.', ''); ?></td> <td style="text-align:center;"><?php echo number_format((float) $fetch_data->weft_ttl_ppc, 2, '.', ''); ?></td> <td style="text-align:center;"><?php echo $fetch_data->fabric_len; ?></td> </tr> <tr colspan="14"> <td colspan="14"> <b style="margin-right: 12px !important;">Remarks     : </b> <?php echo $fetch_data->remarks; ?> </td> </tr> </tbody> </table> </div> <div class="table-responsive"> <table border="1" style="width:100%;border-spacing:0;margin-top: 1%;" cellpadding="5px"> <thead> <tr> <th style="text-align:center;">Sl. no.</th> <th style="text-align:center;">Warp / Weft</th> <th style="text-align:center;">Yarn Name</th> <th style="text-align:center;">NO. of Ends / PPC</th> <th style="text-align:center;">No Cramming / Cramming</th> <th style="text-align:center;">Color</th> </tr> </thead> <tbody> <?php $i=1 ?> <?php if(isset($fetch_warp_data)) { foreach($fetch_warp_data as $key=>$val) { ?> <tr> <td style="text-align:center;"><?php echo $i; ?></td> <td style="text-align:center;"><?php echo 'Warp'; ?></td> <td style="text-align:center;"><?php echo $val->yarnName .' '. $val->yarnSpecification .' '. $val->yarnDenier; ?></td> <td style="text-align:center;"><?php echo $val->no_ends; ?></td> <td></td> <td style="text-align:center;"><?php echo $val->warp_color; ?></td> </tr> <?php $i++; } } ?> <?php $j=1 ?> <?php if(isset($fetch_weft_data)) { foreach($fetch_weft_data as $key=>$value) { ?> <tr> <td style="text-align:center;"><?php echo $j; ?></td> <td style="text-align:center;"><?php echo 'Weft'; ?></td> <td style="text-align:center;"><?php echo $value->yarnName .' '. $value->yarnSpecification .' '. $value->yarnDenier; ?></td> <td style="text-align:center;"><?php echo $value->ppc; ?></td> <td style="text-align:center;"><?php echo $value->cram; ?></td> <td style="text-align:center;"><?php echo $value->weft_color; ?></td> </tr> <?php $j++; } } ?> </tbody> </table> </div> </div> <!--- content-wrapper ----> <!------------- content-wrapper END -----------------------------------------------------------------------------------------------------> <?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> @media only screen and (min-width:320px) and (min-height:640px){ #print_report{ <!--width:900px !important; overflow:auto !important; overflow-x: scroll !important;--> } .content-wrapper { overflow-x: scroll !important; } } </style>