EVOLUTION-NINJA
Edit File: pkg_list_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_preview') { ?> <span class="close-right" ><a href="<?php echo base_url('packing_list/paking_list_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('packing_list/paking_list_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('packing_list/paking_list_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('packing_list/paking_list_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 } ?></div> <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;">PACKING LIST 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;"><br/> Date : <?php echo date("d-m-Y"); ?></td> </tr> <tr> <td colspan="2" style="padding-top: 1%;">Sir / Madam,</td> <td colspan="8"></td> </tr> <tr> <td colspan="12"> <p style="padding-left:5%;padding-top: 1%;">We requested you to process our Packing List.</p> </td> </tr> </table> <table border="1" style="width:100%;border-spacing:0;margin-top: 1%;" cellpadding="5px"> <thead> <tr> <th>Invoice No.</th> <th>Date</th> <th>Customer Name</th> <th>Customer ID </th> <th>Unit</th> <th>Invoice Date</th> <th>Created By</th> <th>Created Date</th> </tr> </thead> <tbody> <tr > <td><?php echo $fetch->invoice_num; ?></td> <td><?php echo $fetch->sys_date; ?></td> <td><?php echo $fetch->customer_name; ?></td> <td><?php echo $fetch->order_no ; ?></td> <td><?php echo $fetch->units; ?></td> <td><?php echo $fetch->invoice_date; ?></td> <td><?php echo $fetch->created_by; ?></td> <td><?php echo $fetch->created_at; ?></td> </tr> </tbody> </table> <table border="1" style="width:100%;border-spacing:0;margin-top: 1%;" cellpadding="2px"> <p style="padding-top: 1%;"><b>Packing List</b></p> <thead> <tr> <th>SL No.</th> <th>Customer Order #</th> <th>DTL #</th> <th>Shade</th> <th>BuyerShade</th> <th>SSL Piece#</th> <th>Width</th> <th>Article</th> <th>Exp Qty</th> <th>Exp Wt</th> <th>Allo Wt</th> <th>Order Type</th> <th>SKU No.</th> <th>Box#</th> </tr> </thead> <tbody> <?php $i=1; ?> <?php if(isset($pkg_data)) { foreach($pkg_data as $key=>$fetch_data){ ?> <tr > <td><?php echo $i; ?></td> <?php if(empty($osl_det[$key])) { ?> <td><?php echo $fetch_data->customer_name; ?></td> <?php } else { ?> <td><?php echo $osl_det[$key]->orderNo; ?></td> <?php } ?> <td><?php echo $fetch_data->po_no; ?></td> <td><?php echo $fetch_data->shades; ?></td> <td><?php echo $fetch_data->buyer_shades; ?></td> <td><?php echo $fetch_data->ssl_pc_no; ?></td> <td><?php echo $fetch_data->width ; ?></td> <td><?php echo $fetch_data->article; ?></td> <td><?php echo $fetch_data->exp_qty; ?></td> <td><?php echo $fetch_data->exp_wt; ?></td> <td><?php echo $fetch_data->allo_wt; ?></td> <td><?php echo $fetch_data->order_type; ?></td> <td><?php echo $fetch_data->skuno; ?></td> <td><?php echo $fetch_data->box_id; ?></td> </tr> <?php $i++; } } ?> </tbody> </table> <table border="1" style="width:100%;border-spacing:0;margin-top: 1%;" cellpadding="5px"> <p style="padding-top: 1%;"><b>Invoice List</b></p> <thead> <tr> <th>SL No.</th> <th>Description</th> <th>Article</th> <th>Width</th> <th>design</th> <th>Shade</th> <th>Qty</th> <th>Wt</th> <th>Buyer Shade</th> <th>Unit Price</th> <th>Order Type</th> <th>Value</th> <th>Currency</th> <th>Terms</th> </tr> </thead> <tbody> <?php $i=1; ?> <?php if(isset($invoice_data)) { foreach($invoice_data as $key=>$fetch_data){ ?> <tr > <td><?php echo $i; ?></td> <?php if($fetch_data->description == '' && !empty($desc_data[$key])) { ?> <td><?php echo $desc_data[$key]->description; ?></td> <?php } else { ?> <td><?php echo $fetch_data->description; ?></td> <?php } ?> <td><?php echo $fetch_data->article; ?></td> <td><?php echo $fetch_data->width ; ?></td> <td><?php echo $fetch_data->design ; ?></td> <td><?php echo $fetch_data->shades; ?></td> <td><?php echo $fetch_data->stock_wt; ?></td> <td><?php echo $fetch_data->stock_qty; ?></td> <td><?php echo $fetch_data->buyershade; ?></td> <td><?php echo $fetch_data->unitprice; ?></td> <td><?php echo $fetch_data->ordertype; ?></td> <td><?php echo $fetch_data->values_es; ?></td> <td><?php echo $fetch_data->currency; ?></td> <td><?php echo $fetch_data->contarct_type; ?></td> </tr> <?php $i++; } } ?> <tr > <td colspan='14'><input type="text" style="width:23%;border:transparent; " value="<?php echo $fetch->discount_name . ' : ' . $fetch->discount; ?>" > <input type="text" style="width:26%;border:transparent; " value="<?php echo 'Other Charges : ' . $fetch->other_charges; ?>" > <?php if($fetch->total_value == 0 || $fetch->total_value == 0.00) { ?> <input type="text" style="width:29%; border:transparent;" value=" <?php echo 'Total : ' . number_format((float) $fetch_sum_amt_invoice->values_es, 2, '.', ''); ?>" > <?php } else { ?> <input type="text" style="width:29%; border:transparent;" value=" <?php echo 'Total : ' . $fetch->total_value; ?>" > <?php } ?> <input type="text" style="width:19%;border:transparent; " value="<?php echo 'Total Quantity : ' . number_format((float) $total_invoice_qty_data->stock_wt, 2, '.', ''); ?>" > </td> </tr> </tbody> </table> <table border="1" style="width:100%;border-spacing:0;margin-top: 1%;" cellpadding="5px"> <p style="padding-top: 1%;"><b>Box List</b></p> <thead> <tr> <th>SL No.</th> <th>BOX #</th> <th>Total PCS</th> <th>Total Net Wt</th> <th>Gross Wt</th> <th>Box Tare Wt</th> <th>Box Size</th> </tr> </thead> <tbody> <?php $i=1; ?> <?php if(isset($box_data)) { foreach($box_data as $key=>$val){ ?> <tr > <td><?php echo $i; ?></td> <td><?php echo $val->box_id; ?></td> <td><?php echo $total_p[$key]->total_pcs; ?></td> <td><?php echo number_format((float)$net_w[$key]->net_wt, 2, '.', ''); ?></td> <td><?php echo number_format((float)$gross_w[$key]->gross_wt, 2, '.', ''); ?></td> <td><?php echo number_format((float)$tare_w[$key]->tare_wt, 2, '.', ''); ?></td> <td><?php echo $val->box_dimension; ?></td> </tr> <?php $i++; } } ?> <tr > <td colspan='14'><input type="text" style="width:26%;border:transparent; " > <input type="text" style="width:18%;border:transparent; " value="<?php echo 'Total Net weight : ' . number_format((float) $net_box_data->net_wt, 2, '.', ''); ?>" readonly> <input type="text" style="width:23%;border:transparent; " value="<?php echo 'Total Gross Weight : ' . number_format((float) $gross_box_data->gross_wt, 2, '.', ''); ?>" readonly> </td> </tr> </tbody> </table> <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%;">Marketing Dept.</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> < <?php function convert_number_to_words($no) { $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> </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> <style> .content-wrapper{ overflow:auto !important; } </style>