ok
Direktori : /proc/thread-self/root/home2/selectio/www/ramali.in/ |
Current File : //proc/thread-self/root/home2/selectio/www/ramali.in/order-complete.php |
<?php include "header.php"; ob_start(); $encryptionKey = 'RAMALI'; $decodedUrl = base64_decode(urldecode($_GET['code'])); $iv = substr($decodedUrl, 0, 16); $encryptedUrl = substr($decodedUrl, 16); $decryptedUrl = openssl_decrypt($encryptedUrl, 'aes-256-cbc', $encryptionKey, 0, $iv); error_log("SELECT id,final_total,status,payment_method FROM orders WHERE id=".$_GET['code']); $query = $pdo->prepare("SELECT id,final_total,status,payment_method FROM orders WHERE id=".$_GET['code']); $query->execute(); $order = $query->fetchAll(PDO::FETCH_ASSOC); if(isset($_GET['code'])){ $user_id = $_SESSION['ramali_textiles']['id']; $order_id = $_GET['code']; $amount = $_GET['amount']; $payment_method = "Online paid"; $trasaction_id = ""; // 1) Delete - Cart Items $query = $pdo->prepare("DELETE FROM `cart` WHERE user_id=?"); $query->execute(array($user_id)); // 2) Order Details - Update Here $query = $pdo->prepare("UPDATE orders SET total=?,final_total=?,payment_method=?,status=?,active_status=?,order_status=?,transaction_id=? WHERE id=?"); $query->execute(array($amount,$amount,$payment_method,1,1,1,$order_id,$trasaction_id)); // 3) Order Items - Update Here $query = $pdo->prepare("UPDATE order_items SET status=?,active_status=? WHERE order_id=?"); $query->execute(array(1,1,$order_id)); // 4) Transaction $query = $pdo->prepare("UPDATE transactions SET type=?,amount=?,status=?,transaction_id=? WHERE order_id=?"); $query->execute(array($payment_method,1,1,$order_id,$trasaction_id)); } ?> <style> ul.order-view.list-style-none li { width: 20%; float: left; text-align: center; } #scroll-top.show { opacity: 1; bottom: 40px; } @media (min-width: 340px) and (max-width: 479px) { ul.order-view.list-style-none li { width: 50% !important; float: left; text-align: left !important; padding-bottom: 15px; } a.btn.btn-dark.btn-rounded.btn-icon-left.btn-back { font-size: 13px; padding: 10px; width: 100%; } } </style> <!-- Start of Main --> <main class="main order"> <!-- Start of PageContent --> <div class="page-content mb-10 pb-2"> <div class="container"> <div class="order-success text-center font-weight-bolder text-dark"> <img src="images/logo/order.gif" style="width: 50%;"> </div> <!-- End of Order Success --> <ul class="order-view list-style-none"> <li> <label>Order number</label> <br> <strong><?= $order[0]['id']?></strong> </li> <li> <label>Status</label> <br> <strong><?= $order[0]['status']?></strong> </li> <li> <label>Date</label> <br> <strong><?= date('Y-M-D') ?></strong> </li> <li> <label>Total</label> <br> <strong> <i class="bi bi-currency-rupee"></i> <?= $order[0]['final_total']?></strong> </li> <li> <label>Payment method</label> <br> <strong><?= $order[0]['payment_method']?></strong> </li> </ul> <!-- End of Order View --> <!-- End of Account Address --> <div class="bac"> <!--<a href="index.php" class="btn btn-dark btn-rounded btn-icon-left btn-back">--> <a href="index.php" class="btn btn-dark btn-rounded btn-icon-left btn-back mt-6"> <i class="w-icon-long-arrow-left"></i>Back To List</a> </div> </div> </div> <!-- End of PageContent --> </main> <!-- End of Main --> <?php include "footer.php"?>