EVOLUTION-NINJA
Edit File: preview_add_link_product.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> <span class="close-right" ><a href="<?php echo base_url(); ?>vendor/add_link_product_details" 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> </div> <div class="content-wrapper print" id="print_report" > <table width="100%" style="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:30px;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</td> </tr> <tr> <td colspan="12" style="text-align:center;font-weight:600;text-decoration: underline;">PRODUCT DETAILS</td> </tr> <br/> <br/> <br/> </table> <table border="1" width="100%" style="border-spacing:0;margin-top:3%;" cellpadding="5px"> <?php if($fetch_product_data->product_type == 'Fabrics') { ?> <thead> <tr> <th>SL No.</th> <th>Product(Article) </th> <th>Product Type </th> <th>Product Quality</th> <th>Units </th> <th>CGST</th> <th>SGST </th> <th>IGST </th> <th>Width </th> <th>Weight in GSM</th> <th>Composition</th> <th>Supplier References</th> <th>Construction details</th> </tr> </thead> <tbody> <tr > <td><?php echo '1'; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->product; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->product_type;?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->product_description; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->unit; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->cgst; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->sgst; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->igst; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->width; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->weight; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->construction_details; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->references; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->details; ?></td> </tr> </tbody> <?php } elseif($fetch_product_data->product_type == 'Yarn - Raw' || $fetch_product_data->product_type == 'Yarn - Dyed' || $fetch_product_data->product_type == 'Yarn - Twisted') { ?> <thead> <tr> <th>SL No.</th> <th>Product(Article) </th> <th>Product Type </th> <th>Supplier References</th> <th>Units </th> <th>CGST</th> <th>SGST </th> <th>IGST </th> <th>Mill # </th> <th>Grade</th> </tr> </thead> <tbody> <tr > <td><?php echo '1'; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->product; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->product_type;?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->references; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->unit; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->cgst; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->sgst; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->igst; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->mill; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->grade; ?></td> </tr> </tbody> <?php } elseif($fetch_product_data->product_type == 'Consumables' || $fetch_product_data->product_type == 'Spares' || $fetch_product_data->product_type == 'Services') { ?> <thead> <tr> <th>SL No.</th> <th>Product(Article) </th> <th>Product Description </th> <th>Units </th> <th>CGST</th> <th>SGST </th> <th>IGST </th> </tr> </thead> <tbody> <tr > <td><?php echo '1'; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->product; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->product_description;?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->unit; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->cgst; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->sgst; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->igst; ?></td> </tr> </tbody> <?php } ?> </table> <?php if($fetch_product_data->product_type == 'Yarn - Raw' || $fetch_product_data->product_type == 'Yarn - Dyed' || $fetch_product_data->product_type == 'Yarn - Twisted') { ?> <table border="1" width="100%" style="border-spacing:0;margin-top:3%;" cellpadding="5px"> <thead> <tr> <th>SL No.</th> <th>Yarn Type </th> <th>Yarn Quality </th> <th>Yarn Name</th> <th>Yarn Denier </th> <th>Yarn Specification</th> <th>Hank Length </th> <th>Hank Weight </th> </tr> </thead> <tbody> <tr > <td><?php echo '1'; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->yarntype; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->yarnquality;?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->yarnname; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->yarndenier; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->yarnspecification; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->hanklength; ?></td> <td style="text-transform: uppercase !important;"><?php echo $fetch_product_data->hankweight; ?></td> </tr> </tbody> </table> <?php } ?> <table style="width:100%;margin-top:20px;"> <tr> <td>FOR DECO-TEXTIL</td> <td style="text-align:right;">FOR DECO-TEXTIL</td> </tr> <tr > <td style="padding-top:7%;">EXECUTIVE - PURCHASE</td> <td style="text-align:right;padding-top:7%;">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 -----------------------------------------------------------------------------------------------------> <?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>