����JFIF��`�`�����Viewing File: /home/u820193700/domains/throtllr.in/public_html/admin/view_sell_request.php
<?php
require_once '../includes/db.php';
require_once '../includes/functions.php';
if(!is_logged_in()) { redirect("login.php"); }

$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
if (!$id) redirect('manage_sell_requests.php');

if($_SERVER['REQUEST_METHOD'] === 'POST') {
    $status = $_POST['status'] ?? 'pending';
    $upd = $pdo->prepare("UPDATE sell_requests SET status=? WHERE id=?");
    $upd->execute([$status, $id]);
    redirect("view_sell_request.php?id=$id&msg=updated");
}

$stmt = $pdo->prepare("SELECT * FROM sell_requests WHERE id = ?");
$stmt->execute([$id]);
$req = $stmt->fetch();
if (!$req) redirect('manage_sell_requests.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>View Sell Request - ReOwn Admin</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="admin.css">
</head>
<body>
<?php include 'admin_sidebar.php'; ?>
<div id="main-content">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h2>Request: <?php echo htmlspecialchars($req['reference_id']); ?></h2>
        <a href="manage_sell_requests.php" class="btn btn-outline-light"><i class="fas fa-arrow-left me-2"></i> Back</a>
    </div>

    <div class="row g-4">
        <div class="col-lg-8">
            <div class="glass-card p-4">
                <h4 class="mb-3">Bike Details</h4>
                <table class="table table-dark table-striped">
                    <tr><th>Model Name</th><td><?php echo htmlspecialchars($req['model_name']); ?></td></tr>
                    <tr><th>Year</th><td><?php echo htmlspecialchars($req['year']); ?></td></tr>
                    <tr><th>KM Driven</th><td><?php echo htmlspecialchars($req['km_driven']); ?></td></tr>
                    <tr><th>Registration No.</th><td><?php echo htmlspecialchars($req['registration_number'] ?? 'N/A'); ?></td></tr>
                    <tr><th>Expected Price</th><td>₹ <?php echo htmlspecialchars($req['expected_price'] ?? '0'); ?></td></tr>
                    <tr><th>Description</th><td><?php echo nl2br(htmlspecialchars($req['description'] ?? '')); ?></td></tr>
                </table>
                <h4 class="mt-4 mb-3">Customer Details</h4>
                <table class="table table-dark table-striped">
                    <tr><th>Name</th><td><?php echo htmlspecialchars($req['name']); ?></td></tr>
                    <tr><th>Phone</th><td><?php echo htmlspecialchars($req['phone']); ?></td></tr>
                    <tr><th>Email</th><td><?php echo htmlspecialchars($req['email'] ?? 'N/A'); ?></td></tr>
                    <tr><th>City</th><td><?php echo htmlspecialchars($req['city']); ?></td></tr>
                </table>

                <h4 class="mt-5 mb-3">Uploaded Media</h4>
                
                <h5>Images</h5>
                <div class="d-flex flex-wrap gap-2 mb-4">
                    <?php
                    if (!empty($req['images_folder']) && file_exists('../' . $req['images_folder'])) {
                        $files = scandir('../' . $req['images_folder']);
                        $hasImages = false;
                        foreach ($files as $file) {
                            $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
                            if (in_array($ext, ['jpg', 'jpeg', 'png', 'gif', 'webp'])) {
                                $hasImages = true;
                                echo '<a href="../' . htmlspecialchars($req['images_folder'] . $file) . '" target="_blank">';
                                echo '<img src="../' . htmlspecialchars($req['images_folder'] . $file) . '" class="img-thumbnail border-secondary bg-dark" style="width: 150px; height: 100px; object-fit: cover;">';
                                echo '</a>';
                            }
                        }
                        if (!$hasImages) {
                            echo '<p class="text-muted">No images found.</p>';
                        }
                    } else {
                        echo '<p class="text-muted">No images uploaded.</p>';
                    }
                    ?>
                </div>

                <h5>Video</h5>
                <?php if (!empty($req['video_url'])): ?>
                    <video src="../<?php echo htmlspecialchars($req['video_url']); ?>" controls class="w-100 rounded border border-secondary" style="max-height: 400px; background: #000;"></video>
                <?php else: ?>
                    <p class="text-muted">No video uploaded.</p>
                <?php endif; ?>
            </div>
        </div>
        
        <div class="col-lg-4">
            <div class="glass-card p-4">
                <h4 class="mb-3">Update Status</h4>
                <?php if(isset($_GET['msg']) && $_GET['msg']=='updated'): ?>
                    <div class="alert alert-success py-2">Status updated!</div>
                <?php endif; ?>
                <form method="POST">
                    <select name="status" class="form-select bg-dark text-white border-secondary mb-3">
                        <option value="pending" <?php echo $req['status']=='pending'?'selected':''; ?>>Pending</option>
                        <option value="reviewing" <?php echo $req['status']=='reviewing'?'selected':''; ?>>Reviewing</option>
                        <option value="approved" <?php echo $req['status']=='approved'?'selected':''; ?>>Approved</option>
                        <option value="rejected" <?php echo $req['status']=='rejected'?'selected':''; ?>>Rejected</option>
                    </select>
                    <button type="submit" class="btn btn-primary w-100">Save Status</button>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
</html>
Back to Directory �������}�!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������������������������������������������������������������������� ������w�!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������ ��?��_��+��?��(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(�����