EVOLUTION-NINJA
Edit File: tailoring_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 == 'monthly_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('packing_list/tailoring_transaction_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> <?php } ?> <div class="content-wrapper print" id="print_report" style="padding:0px;"> <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;">TRANSACTION SUMMARY</td> </tr> <tr> <td colspan="10"></td> <td colspan="2" style="text-align:right;"> </td> </tr> <tr> <td colspan="10"></td> <td colspan="2" style="text-align:right;"><!--OSL / PO No. : <?php //echo $fetch->osl_no; ?>--><br/> Date : <?php echo date("d-m-Y"); ?></td> </tr> <tr> <td colspan="6" style="padding-top: 1%;text-align:left;"></td> <td colspan="6" style="text-align:right;"> Previous Month Balance : <?php echo $pre_data->credit - $pre_data->debit; ?></td> </tr> <tr> <td colspan="12"> <p style="text-align: left;padding-top: 1%;"></p> </td> </tr> </table> <!------------------------------------------------pkg list--------------------------------------------------------> <!-----------------------------------------------Pkg Details ----------------------------------------------------> <table border="1" style="width:100%;border-spacing:0;margin-top: 1%;" cellpadding="2px"> <p style="padding-top: 1%; text-align:left;"><b>Tailoring Transaction List</b></p> <thead> <tr> <th style="width:3%;">SL No.</th> <th style="width:10%;">Account</th> <th style="width:45%;">Narration</th> <th style="width:11%;">Debit</th> <th style="width:5%;">Credit</th> <th style="width:11%;">Total Balance</th> <th style="width:5%;">Transaction Date</th> <th style="width:5%;">Created By</th> <th style="width:5%;">Created At</th> <!--<th>SL No.</th>--> <!--<th>Account</th>--> <!--<th>Narration</th>--> <!--<th>Debit</th>--> <!--<th>Credit</th>--> <!--<th>Total Balance</th>--> <!--<th>Transaction Date</th>--> <!--<th>Created By</th>--> <!--<th>Created At</th>--> </tr> </thead> <tbody style="padding-top: 1%; text-align:left;"> <?php //print_r($preview_data);die();?> <?php $i=1; ?> <?php if(!empty($preview_data)) { $debit_total = 0; $credit_total = 0; foreach($preview_data as $fetch_data){ $debit_total = $debit_total+$fetch_data->debit; $credit_total = $credit_total+$fetch_data->credit;?> <tr > <td><?php echo $i; ?></td> <td><?php echo $fetch_data->b_name; ?></td> <td><?php echo $fetch_data->narration; ?></td> <td><?php echo $fetch_data->debit; ?></td> <td><?php echo $fetch_data->credit; ?></td> <td><?php echo $fetch_data->credit-$fetch_data->debit; ?></td> <td><?php echo date("d-m-Y",strtotime($fetch_data->transaction_date)); ?></td> <td><?php echo $fetch_data->created; ?></td> <td><?php echo date("d-m-Y",strtotime($fetch_data->created_at)); ?></td> </tr> <?php $i++; } }?> </tbody> <tfoot> <tr> <td></td> <td></td> <td></td> <td ><strong style="float:left;">Total Expenses INR:<?php echo $debit_total;?></strong></td> <td></td> <td><strong style="float:left;">Total Balance INR:<?php $total = $credit_total-$debit_total; echo $total;?></strong></td> <td></td> <td></td> <td></td> </tr> </tfoot> </table> <table style="width:100%;border-spacing:0;margin-top: 5%;" cellpadding="2px"> <tr> <td colspan="" style="text-align:left;width: 76%;">Approved By</td> <td colspan="" style="text-align:left;">Verified By</td> </tr> </table> <!-----------------------------------------------Invoice Details ----------------------------------------------------> <!-----------------------------------------------Box Details ---------------------------------------------------> </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> .content-wrapper{ overflow:auto !important; } table th, table td { padding:3px; } </style>