| Server IP : 173.209.174.21 / Your IP : 216.73.216.89 Web Server : Apache/2.4.58 (Ubuntu) System : Linux wcfs-server 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : nodor ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/vendorset/Vendorapp/backup files/ |
Upload File : |
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();
include 'config.php'; // Include the configuration file
// Check if config.php is loading correctly
echo "Config file loaded successfully.<br>";
// Test if admin is logged in
if (!isset($_SESSION['admin_logged_in'])) {
header("Location: admin_login.php");
exit();
}
// Database connection using constants from config.php
$conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
// Test database connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
} else {
echo "Database connected successfully.<br>";
}
// Fetch vendor data
$result = $conn->query("SELECT * FROM vendors");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
}
h2 {
color: #1E90FF;
}
.logout {
text-align: right;
margin-bottom: 20px;
}
.logout a {
color: #1E90FF;
text-decoration: none;
font-weight: bold;
}
.logout a:hover {
text-decoration: underline;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
table, th, td {
border: 1px solid #CCCCCC;
padding: 10px;
text-align: left;
}
th {
background-color: #1E90FF;
color: white;
}
</style>
</head>
<body>
<div class="logout">
<a href="logout.php">Logout</a>
</div>
<h2>Admin Dashboard - Registered Vendors</h2>
<table>
<tr>
<th>Full Name</th>
<th>Email</th>
<th>Phone</th>
<th>Address</th>
<th>City</th>
<th>State</th>
<th>Zip</th>
<th>Website</th>
<th>Description</th>
<th>Spots Requested</th>
<th>Payment Status</th>
</tr>
<?php
if ($result && $result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>" . htmlspecialchars($row['name']) . "</td>";
echo "<td>" . htmlspecialchars($row['email']) . "</td>";
echo "<td>" . htmlspecialchars($row['phone']) . "</td>";
echo "<td>" . htmlspecialchars(isset($row['address']) ? $row['address'] : 'N/A') . "</td>";
echo "<td>" . htmlspecialchars(isset($row['city']) ? $row['city'] : 'N/A') . "</td>";
echo "<td>" . htmlspecialchars(isset($row['state']) ? $row['state'] : 'N/A') . "</td>";
echo "<td>" . htmlspecialchars(isset($row['zip']) ? $row['zip'] : 'N/A') . "</td>";
echo "<td>" . htmlspecialchars(isset($row['website']) ? $row['website'] : 'N/A') . "</td>";
echo "<td>" . htmlspecialchars(isset($row['description']) ? $row['description'] : 'N/A') . "</td>";
echo "<td>" . htmlspecialchars(isset($row['spots_requested']) ? $row['spots_requested'] : 'N/A') . "</td>";
echo "<td>" . htmlspecialchars(isset($row['payment_status']) ? $row['payment_status'] : 'N/A') . "</td>";
echo "</tr>";
}
} else {
echo "<tr><td colspan='11'>No vendors registered.</td></tr>";
}
$conn->close();
?>
</table>
</body>
</html>