File Manager
Editing: requests_page.php
<?php $host = "127.0.0.1:3306"; // Change if your MySQL server is hosted elsewhere $username = "u404542307_dacotywebsites"; // Your MySQL username $password = "daCotywebs1te5"; // Your MySQL password $database = "u404542307_eizon"; // Your MySQL database name try { $pdo = new PDO("mysql:host=$host;dbname=$database", $username, $password); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { die("Could not connect to the database: " . $e->getMessage()); } $sql = "SELECT * FROM requests ORDER BY created_at DESC"; $stmt = $pdo->query($sql); $requests = $stmt->fetchAll(PDO::FETCH_ASSOC); ?> <!DOCTYPE html> <html lang="en"> <head> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-Z6RR2PMZW4"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-Z6RR2PMZW4'); </script> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Product Requests</title> <meta name="description" content="Explore product requests from users on Eizon. Offer what others need or find inspiration for your next sale. Connecting buyers and sellers has never been easier."> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"> <link rel="stylesheet" href="e-commerce.css"> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> <link rel="manifest" href="/site.webmanifest"> <link rel="manifest" href="/manifest.json"> </head> <body> <?php include 'header.php'; ?> <br><br> <div> <div style="display:flex;justify-content:space-around;margin-top:20px;"> <h2 style="margin:0;">Product Requests</h2> <button class="dashboardRequests" style="background-color:#40e351;border:none;Border-radius:5px;padding:10px;"> <a href="/add_request" style="text-decoration:none;color:white;"><b>+ Add Request</b></a> </button> </div> <?php foreach ($requests as $request): ?> <div style="border: 1px solid #ccc; padding: 15px; margin-bottom: 10px;"> <h3><?= htmlspecialchars($request['product_name']) ?></h3> <p><strong>Description:</strong> <?= htmlspecialchars($request['description']) ?></p> <p><strong>Location:</strong> <?= htmlspecialchars($request['location']) ?></p> <p><strong>Contact:</strong> <a href="https://wa.me/<?= htmlspecialchars($request['country_code'] . $request['phone_number']) ?>?text=Habari, I saw your request for <?= urlencode($request['product_name']) ?> on eizononline.com. I'd like to discuss it." target="_blank">Contact via WhatsApp</a></p> </div> <?php endforeach; ?> </div> <?php include 'footer.php'; ?> <script src="e-commerce.js"></script> </body> </html>
💾 Save
⬅ Back