D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
salvation.incrediblebengal.com
/
admin
/
Filename :
print_order_summary.php
back
Copy
<?php include'config.php'; include'get_session_access.php'; include'function.php'; if(!empty($_GET['cust_phone']) && $_GET['order_date']) { $cust_phone = $_GET['cust_phone']; $o_date = $_GET['order_date']; $order_date = date("Y-m-d",strtotime($o_date)); } $sql = "SELECT * FROM customer_details WHERE customer_phone = '$cust_phone' AND DATE(order_date) = '$order_date'"; $data = mysqli_query($conn, $sql); $rows = mysqli_fetch_assoc($data); $orderList = mysqli_query($conn, "SELECT * FROM table_orderlist WHERE customer_phone = '$cust_phone'AND DATE(order_date) = '$order_date'"); // $res = mysqli_fetch_array($orderList); // $invoiceDate = date("d/M/Y, H:i:s", strtotime($invoiceValues['order_date'])); $output = ''; $output .= '<table width="100%" border="1" cellpadding="5" cellspacing="0"> <tr> <td colspan="2" align="center" style="font-size:18px"><b>Invoice</b></td> </tr> <tr> <td colspan="2"> <table width="100%" cellpadding="5"> <tr> <td width="65%"> To,<br /> <b>RECEIVER (BILL TO)</b><br /> Name : '.$rows['customer_name'].'<br /> Billing Address : '.$rows['customer_address'].'<br /> </td> <td width="35%"> Invoice No. : '.$rows['customer_id'].'<br /> Invoice Date : '.$rows['order_date'].'<br /> </td> </tr> </table> <br /> <table width="100%" border="1" cellpadding="5" cellspacing="0"> <tr> <th align="left">Sr No.</th> <th align="left">Item Code</th> <th align="left">Item Name</th> <th align="left">Quantity</th> <th align="left">Price</th> <th align="left">Sub Amt.</th> </tr>'; $count = 1; while($res = mysqli_fetch_assoc($orderList)){ $count++; $output .= '<tr><td align="left">'.$count.'</td>'; $output .= '<td>'.$res['food_id'].'</td>'; $output .= '<td>'.$res['food_name'].'</td>'; $output .= '<td>'.$res['food_qty'].'</td>'; $output .= '<td>'.$res['food_price'].'</td>'; $output .= '<td>'.$res['order_subtotal'].'</td>'; $output .= '</tr>'; } $output .= '<tr>'; $output .= '<td align="right" colspan="5">Total Amount: </td>'; $output .= '<td align="left">'.$rows['total_payment'].'</td>'; $output .= '</tr>'; $output .= ' </table> </td> </tr> </table>'; $invoiceFileName = 'Encoders_restro_Dine_Summary_Report.pdf'; // echo $output; include("dompdf/autoload.inc.php"); use Dompdf\Dompdf; // Dompdf\Autoloader(); $dompdf = new Dompdf(); $dompdf->loadHtml(html_entity_decode($output)); $dompdf->setPaper('A4', 'landscape'); $dompdf->render(); $dompdf->stream($invoiceFileName, array("Attachment" => 0)); ?>