D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
salvation.incrediblebengal.com
/
admin
/
Filename :
order-print.php
back
Copy
<?php include 'config.php'; include 'get_session_access.php'; include 'function.php'; include 'style.php'; error_reporting(0); $cust_phone = $_SESSION['customer_phone'] = $_GET['customer_phone']; $cust_name = $_SESSION['customer_name'] = $_GET['customer_name']; $sum_amount = $_SESSION['sum_amount'] = $_GET['sum_amount']; $tableId = $_SESSION['tableId'] = $_GET['tableId']; $gstRate = 5; // $cust_phone = $_SESSION['customer_phone']; // $order_date = getOrderDate(); $ip_add = getUserIp(); $gstAmount = $sum_amount * $gstRate/100; $total_amt = $sum_amount + $gstAmount; $order_type = "dine_in"; $view_ordr = "SELECT * FROM dinein_order WHERE table_id = '$tableId' AND customer_phone = '$cust_phone'"; $run_ordr = mysqli_query($conn, $view_ordr) or die(mysqli_error($conn)); $rec = mysqli_fetch_array($run_ordr); echo $order_id = $rec["order_id"]; $order_date = $_SESSION['order_date'] = $rec["order_date"]; $edit_ordr = "UPDATE dinein_order SET order_status = 'paid' WHERE order_id = '$order_id' AND customer_phone = '$cust_phone'"; $run_edit_ordr = mysqli_query($conn, $edit_ordr) or die("Failed to edit Dine Order."); if ($run_edit_ordr) { echo "<script>alert('Status updated.')</script>"; } $edit_table = mysqli_query($conn, "UPDATE restro_tables SET table_status = '0' WHERE table_id = '$tableId'"); if (!$edit_table){ echo "<script>alert('Table Status not updated.')</script>"; } // $o_date = date('m-Y', $order_date); // $o_date = str_replace("-","", $order_date); // $o_id = "SLG". $order_id . $o_date; $show_kot = "SELECT * FROM kitchen_orderlist WHERE order_id = '$order_id' AND order_date = '$order_date' AND cust_phone = '$cust_phone' AND order_type = '$order_type'"; $run_kot = mysqli_query($conn, $show_kot); if($run_kot->num_rows == ""){ $insrt_kot = mysqli_query($conn, "INSERT INTO kitchen_orderlist(kitchen_id, kitchen_status, cust_phone, order_id, order_date, order_type) VALUES('', '0', '$cust_phone', '$order_id', '$order_date', '$order_type')") or die(mysqli_error($conn)); if ($insrt_kot){ echo "<script>alert('kitchen_orderlist data inserted');</script>"; } else{ echo "<script>alert('kitchen_orderlist data not inserted');</script>"; } } else{ echo "<script>alert('data already exist in kitchen_orderlist List.');</script>"; } $tblOrdrQry = "SELECT * FROM table_orderlist WHERE customer_phone = '$cust_phone' AND order_id = '$order_id'"; $sqltblOrdr = mysqli_query($conn, $tblOrdrQry); while ($tod = mysqli_fetch_assoc($sqltblOrdr)){ $foodId = $tod['food_id']; $foodQty = $tod['food_qty']; $qryUpdate = mysqli_query($conn, "UPDATE `food_item` SET `food_qty` = `food_qty` - $foodQty WHERE `food_id` = $foodId") or mysqli_error($conn); } $show_foodList = "SELECT * FROM table_orderlist WHERE customer_phone = '$cust_phone' AND order_id = '$order_id'"; $sql_food_details = mysqli_query($conn, $show_foodList); ?> <html> <head> <title>Encode Restaurent - Admin Dashboard </title> <style type="text/css"> @import "https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800"; body{margin: 0;padding: 0;} .print_page{width:500px;background:#000;margin:20px auto;font-family: Poppins;} .print_page .print_pageOverlay{background:#fff;} .print_div{background: #fff;padding:15px;} .print_div h4{color:#dd2f6e;margin:10px 0 5px;font-size: 20px;margin: 0;} .print_option{position:absolute;top:15px;right:15px;} .print_option a{border-radius:50px;} .print_div .resaturent_info{text-align: center;width:100%;margin-top:30px;border-bottom:1 px dashed #777;} .print_div .resaturent_info table td img.print_icon{height: 80px;width: 80px;margin:0px auto 10px;} .print_div .resaturent_info table td ul.restaurent_details{padding:0;margin:0px;list-style:none;} .print_div .resaturent_info table td ul.restaurent_details li{text-align:right;font-size:13px;list-style:none;padding:0px 0px;color:#000;} .print_div table, .print_div table caption{width: 100%;margin:15px 0px;display:table;border-collapse: collapse;} .print_div table tbody{width: 100%;} .print_div table tr td{padding:3px 3px;color:#000;font-size:16px;line-height: 1;} .print_div table.order_summary tr td:last-child{float: right;} .print_div table.order_summary tr td img{height:20px;margin-right:5px;} .print_div table.food_list thead{background:#888;} .print_div table.food_list thead tr th{background:#888;color:#fff;text-align: left;padding:7px 10px;font-weight:400;} .print_div table.food_list tbody tr td{border:0px solid #999;padding:7px 10px;font-size:14px;color:#000;} .print_div table.food_list tbody tr:nth-child(odd){background:#e5e5e5;} .print_div table.food_list thead tr th:last-child, .print_div table.food_list tbody tr td:last-child{float:right;} .print_div table.food_list tbody tr:even{background:#c3c3c3;} .print_div table.food_list tfoot{background:#888;} .print_div table.food_list tfoot tr td{padding:7px 10px;color:#fff;} .print_div table.food_list tfoot tr td:last-child{float: right;} .print_footer{position: relative;bottom: 0;width: 100%;text-align: center;} .print_footer p{padding:5px 0px;margin-bottom:0px;display: block;} .print_footer a img.print_logo{height:40px;width:auto;display:block;margin:0px auto;} .p_end{border-top:1px dashed #333;} .print_footer p{text-align: center;padding:10px 0px;margin:0;} .print_footer p:last-child{margin-bottom:10px;padding:0px;font-size:12px;position:relative;} .print_footer p:last-child a{position:relative;font-size:12px;} .print_footer p a img.print_logo{height:16px;width:auto;display:inline-block;margin:0px 5px;} </style> </head> <body class="print_page"> <div class="print_pageOverlay"> <div class="print_div"> <div class="print_option"><a class="btn btn-info border-circle p-2" href="print-pdf/print-dineIn-order.php"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect></svg> </a></div> <div class="resaturent_info"> <table> <tr> <td rowspan="4"><img class="print_icon" src="images/restaurent-logo.png"></td> <td> <ul class="restaurent_details"> <li>Delhi Yummy Bites</li> <li>+91 98745 63210</li> <li>College Para, Siligri</li> <li>GST: 22AABCU9603R1ZX</li> </ul> </td> </tr> </table> </div> <table class="order_summary"> <tr> <td><h4><?php echo $cust_name; ?></h4></td> <td><img src="images/icons/phone-call.png">+91 <?php echo $cust_phone; ?></td> </tr> <tr> <td><?php echo $order_type; ?></td> <td>Table No:<?php echo $tableId; ?></td> </tr> <tr> <td>Order Id: <?php echo $order_id; ?></td> <td><?php echo $order_date; ?></td> </tr> </table> <table class="food_list"> <thead> <tr> <th>Item Name</th> <th>Price</th> <th>Qty</th> <th>Total</th> </tr> </thead> <tbody> <?php while ($res = mysqli_fetch_assoc($sql_food_details)) { ?> <tr> <td> <?php echo $res['food_name']; ?></td> <td>₹ <?php echo $res['food_price']; ?></td> <td> <?php echo $res['food_qty']; ?></td> <td>₹ <?php echo $res['food_subtotal']; ?></td> </tr> <?php } ?> <tr> <td colspan="3">Total Amount</td> <td>₹ <?php echo $sum_amount; ?></td> </tr> </tbody> </table> <table class="food_list"> <tr> <th colspan="3">GST Rate</th> <th>Base Amount</th> <th>GST Amount</th> </tr> <tr> <td colspan="3"> <?php echo $gstRate; ?> %</td> <td><span style="font-family: DejaVu Sans; sans-serif;">₹</span> <?php echo $sum_amount; ?></td> <td><span style="font-family: DejaVu Sans; sans-serif;">₹</span> <?php echo $gstAmount; ?></td> </tr> <tfoot> <tr> <td colspan="4">Total Amount</td> <td><span style="font-family: DejaVu Sans; sans-serif;">₹</span> <?php echo $total_amt; ?></td> </tr> </tfoot> </table> <div class="print_footer"> <p class="p_end">Thank You <a href="billing.php" class="btn btn-primary ml-3">back 2 home</a></p> <p>Powered By: <a href="billing.php"> <img class="print_logo" src="images/logo-black.png"> </a> || A Product by <u class="fs-13"><strong> Encoders Unlimited.</strong></u></p> </div></div> </div> </body> </html>