/
home
/
u764571690
/
domains
/
ojaspunj.com
/
public_html
/
/home/u764571690/domains/ojaspunj.com/public_html
mkdir
upload
Name
Size
Mode
Actions
api/
-
0755
rm
app/
-
0755
rm
billing/
-
0755
rm
certificates/
-
0755
rm
css/
-
0755
rm
detail image/
-
0755
rm
favicon_io/
-
0755
rm
fontawesome/
-
0755
rm
fonts/
-
0755
rm
image/
-
0755
rm
indeximage/
-
0755
rm
js/
-
0755
rm
OFFER PRODUCT/
-
0755
rm
offer product/
-
0755
rm
our product/
-
0755
rm
productdetail/
-
0755
rm
qwertyuiopasdfghjklzxcvbnmmnbvcxzlkjhgfdsapoiuytrewqqazwsxedcrfvtgbyhnujmikolppolikujmyhntgbrfvedcwsxqazasdfghjklpoiuytrewqzxcvbnmqwasedrftgyhjuikoplkjhgfdsazxcvbnmkoiuyhgtfrdeswqaszxdfcvgfdewwsdwasjdjfoifsdnjfhsudhfgjdssdhfgushfgbdghuifgbdgvhsdfg/
-
0755
rm
scholarship/
-
0755
rm
upload product/
-
0755
rm
vendor/
-
0755
rm
.htaccess
2654
0644
edit
dl
rm
about.php
23570
0644
edit
dl
rm
add_certificate.php
7159
0644
edit
dl
rm
add_offer_product.php
9101
0644
edit
dl
rm
add_our_product.php
7146
0644
edit
dl
rm
add_product.php
7186
0644
edit
dl
rm
admin_dashboard.php
27932
0644
edit
dl
rm
admin_login.php
4991
0644
edit
dl
rm
android-chrome-192x192.png
26999
0644
edit
dl
rm
android-chrome-512x512.png
130182
0644
edit
dl
rm
apple-touch-icon.png
24276
0644
edit
dl
rm
bmi.html
11059
0644
edit
dl
rm
buy.php
34458
0644
edit
dl
rm
check_session.php
3228
0644
edit
dl
rm
composer-setup.php
58444
0644
edit
dl
rm
composer.json
99
0644
edit
dl
rm
composer.lock
47706
0644
edit
dl
rm
composer.phar
3125568
0644
edit
dl
rm
config.php
246
0644
edit
dl
rm
contact.php
5852
0644
edit
dl
rm
create_remember_tokens.php
573
0644
edit
dl
rm
dashboard.php
140056
0644
edit
dl
rm
db_connect.php
712
0644
edit
dl
rm
delete_product.php
2567
0644
edit
dl
rm
edit_offer_product.php
7258
0644
edit
dl
rm
favicon-16x16.png
738
0644
edit
dl
rm
favicon.ico
15406
0644
edit
dl
rm
favicon.png
1958
0644
edit
dl
rm
get_product_detail_filename.php
647
0644
edit
dl
rm
google8752ffcd74dff0e8.html
53
0644
edit
dl
rm
googledc4255937cf5f8da.html
53
0644
edit
dl
rm
google_oauth.php
6539
0644
edit
dl
rm
index.php
69621
0644
edit
dl
rm
loading.html
584
0644
edit
dl
rm
log.php
596
0644
edit
dl
rm
login.php
17416
0644
edit
dl
rm
logout.php
598
0644
edit
dl
rm
my_orders.php
13285
0644
edit
dl
rm
order_success.php
3544
0644
edit
dl
rm
our_certificate.php
10809
0644
edit
dl
rm
our_product.php
9589
0644
edit
dl
rm
privacypolicy.php
4277
0644
edit
dl
rm
product1.php
22023
0644
edit
dl
rm
profile.php
18426
0644
edit
dl
rm
refund.php
6282
0644
edit
dl
rm
register.php
15800
0644
edit
dl
rm
robots.txt
742
0644
edit
dl
rm
savitrfoundationscholarship.php
160332
0644
edit
dl
rm
sitemap.xml
935
0644
edit
dl
rm
specialoffer.php
13234
0644
edit
dl
rm
terms$condition.php
6412
0644
edit
dl
rm
verify_payment.php
19770
0644
edit
dl
rm
view.php
4870
0644
edit
dl
rm
x.php
19056
0644
edit
dl
rm
Edit:
/home/u764571690/domains/ojaspunj.com/public_html/my_orders.php
(13285B)
<?php session_start(); require_once 'db_connect.php'; date_default_timezone_set('Asia/Kolkata'); // Check if user is logged in if (!isset($_SESSION['user_id'])) { header('Location: login.php'); exit(); } $user_id = $_SESSION['user_id']; // Fetch all orders for the user $sql = "SELECT o.*, GROUP_CONCAT( CONCAT( oi.product_id, ':', oi.table_name, ':', oi.quantity, ':', oi.price, ':', CASE WHEN oi.table_name = 'products' THEN p.image WHEN oi.table_name = 'our_products' THEN op.image WHEN oi.table_name = 'offer_products' THEN ofp.image END ) SEPARATOR '||' ) as order_items, (SELECT GROUP_CONCAT( CONCAT( status, ':', status_date, ':', COALESCE(notes, '') ) ORDER BY status_date DESC SEPARATOR '||' ) FROM order_tracking WHERE order_id = o.order_id) as tracking_info FROM orders o LEFT JOIN order_items oi ON o.order_id = oi.order_id LEFT JOIN products p ON oi.product_id = p.id LEFT JOIN our_products op ON oi.product_id = op.id LEFT JOIN offer_products ofp ON oi.product_id = ofp.id WHERE o.user_id = ? GROUP BY o.order_id ORDER BY o.created_at DESC"; $stmt = $conn->prepare($sql); $stmt->bind_param("i", $user_id); $stmt->execute(); $result = $stmt->get_result(); $orders = $result->fetch_all(MYSQLI_ASSOC); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My Orders - Ojas Punj</title> <link rel="shortcut icon" href="/favicon_io/favicon.ico" type="image/x-icon"> <link rel="icon" type="image/png" href="/image/logo.png"> <link rel="stylesheet" href="fonts/poppins/poppins.css"> <link rel="stylesheet" href="fontawesome/css/all.min.css"> <style> :root { --primary-color: #2E7D32; --accent-color: #4CAF50; --bg-color: #f8f9fa; --card-bg: #ffffff; --text-color: #2c3e50; } body { font-family: 'Poppins', sans-serif; background: linear-gradient(135deg, #f8f9fa 60%, #e0f2f1 100%); min-height: 100vh; margin: 0; padding: 20px; } .container { max-width: 1200px; margin: 0 auto; padding: 20px; } h1 { color: var(--text-color); text-align: center; margin-bottom: 30px; } .order-card { background: white; border-radius: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); margin-bottom: 30px; overflow: hidden; } .order-header { background: var(--primary-color); color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; } .order-id { font-weight: 600; font-size: 1.1rem; } .order-date { font-size: 0.9rem; } .order-status { background: #e8f5e9; color: var(--primary-color); padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: 500; } .order-items { padding: 20px; } .order-item { display: flex; align-items: center; padding: 15px; border-bottom: 1px solid #eee; } .order-item:last-child { border-bottom: none; } .item-details { flex-grow: 1; } .item-name { font-weight: 600; margin-bottom: 5px; } .item-meta { color: #666; font-size: 0.9rem; } .item-price { font-weight: 600; color: var(--primary-color); } .order-total { background: #f8f9fa; padding: 15px 20px; text-align: right; font-weight: 600; font-size: 1.1rem; } .no-orders { text-align: center; padding: 50px 20px; color: #666; } .no-orders i { font-size: 3rem; color: #ddd; margin-bottom: 20px; } @media (max-width: 768px) { .order-header { flex-direction: column; gap: 10px; text-align: center; } .order-item { flex-direction: column; text-align: center; gap: 10px; } .item-details { text-align: center; } } .tracking-timeline { padding: 20px; background: #f8f9fa; border-bottom: 1px solid #eee; } .tracking-event { padding: 10px 0; border-left: 3px solid var(--primary-color); padding-left: 20px; margin-left: 10px; position: relative; } .tracking-event:before { content: ''; position: absolute; left: -8px; top: 15px; width: 13px; height: 13px; border-radius: 50%; background: var(--primary-color); } .event-status { font-weight: 600; color: var(--primary-color); } .event-date { font-size: 0.9rem; color: #666; margin: 5px 0; } .event-notes { font-size: 0.9rem; color: #666; margin-top: 5px; } .tracking-status { padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: 500; display: inline-block; } .status-placed { background: #e3f2fd; color: #1976d2; } .status-shipped { background: #fff3e0; color: #f57c00; } .status-delivered { background: #e8f5e9; color: #2e7d32; } .delivery-date { font-size: 0.8rem; color: #666; margin-top: 5px; } .order-item-image { width: 80px; height: 80px; object-fit: cover; border-radius: 5px; margin-right: 15px; } </style> </head> <body> <div class="container"> <h1>My Orders</h1> <?php if (empty($orders)): ?> <div class="no-orders"> <i class="fas fa-shopping-bag"></i> <p>You haven't placed any orders yet.</p> </div> <?php else: ?> <?php foreach ($orders as $order): ?> <div class="order-card"> <div class="order-header"> <div> <div class="order-id">Order #<?php echo $order['order_id']; ?></div> <div class="order-date"><?php $timestamp = strtotime($order['created_at']); $ist_timestamp = $timestamp + (5.5 * 3600); // Add 5.5 hours for IST echo date('d M Y, h:i A', $ist_timestamp); ?></div> </div> <div class="order-status"> <?php $tracking_status = $order['tracking_status']; $status_class = ''; switch($tracking_status) { case 'placed': $status_class = 'status-placed'; break; case 'shipped': $status_class = 'status-shipped'; break; case 'delivered': $status_class = 'status-delivered'; break; } ?> <span class="tracking-status <?php echo $status_class; ?>"> <?php if ($tracking_status === 'placed') { echo 'Order Placed'; } else { echo ucfirst($tracking_status); } ?> </span> <?php if ($tracking_status === 'delivered' && !empty($order['delivery_date'])): ?> <div class="delivery-date"> Delivered on: <?php $delivery_date = new DateTime($order['delivery_date']); $delivery_date->setTimezone(new DateTimeZone('Asia/Kolkata')); echo $delivery_date->format('d M Y'); ?> </div> <?php endif; ?> </div> </div> <?php if (!empty($order['tracking_info'])): ?> <div class="tracking-timeline"> <?php $tracking_events = explode('||', $order['tracking_info']); foreach ($tracking_events as $event): list($status, $date, $notes) = explode(':', $event); ?> <div class="tracking-event"> <div class="event-status"> <?php if ($status === 'placed') { echo 'Order Placed'; } else { echo ucfirst($status); } ?> </div> <div class="event-date"><?php echo date('d M Y, h:i A', strtotime($date)); ?></div> <?php if (!empty($notes)): ?> <div class="event-notes"><?php echo htmlspecialchars($notes); ?></div> <?php endif; ?> </div> <?php endforeach; ?> </div> <?php endif; ?> <div class="order-items"> <?php $items = explode('||', $order['order_items']); foreach ($items as $item): list($product_id, $table_name, $quantity, $price, $image) = explode(':', $item); $imagePath = 'upload product/'; if ($table_name === 'our_products') { $imagePath = 'our product/'; } elseif ($table_name === 'offer_products') { $imagePath = 'OFFER PRODUCT/'; } ?> <div class="order-item"> <img src="<?php echo htmlspecialchars($imagePath . $image); ?>" alt="Product Image" class="order-item-image"> <div class="item-details"> <div class="item-name">Product ID: <?php echo htmlspecialchars($product_id); ?></div> <div class="item-meta">Quantity: <?php echo htmlspecialchars($quantity); ?></div> <div class="item-price">₹<?php echo number_format($price * $quantity, 2); ?></div> </div> </div> <?php endforeach; ?> </div> <div class="order-total"> Total: ₹<?php echo number_format($order['total_amount'], 2); ?> </div> </div> <?php endforeach; ?> <?php endif; ?> </div> </body> </html>
Save
cmd:
run