![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/.cursor-server/data/User/History/754b5f54/ |
<?php
session_start();
require_once 'includes/db.php';
// Check if user is admin
if (!isset($_SESSION['user_id']) || !isset($_SESSION['is_admin']) || !$_SESSION['is_admin']) {
header('Location: login.php');
exit;
}
$current_tab = $_GET['tab'] ?? 'dashboard';
// Simple data for testing
$users = [
['id' => 1, 'name' => 'Test User', 'email' => 'test@example.com', 'plan' => 'free', 'credits' => 10, 'is_admin' => 0],
['id' => 2, 'name' => 'Admin User', 'email' => 'admin@example.com', 'plan' => 'premium', 'credits' => 100, 'is_admin' => 1]
];
$tracks = [
['id' => 1, 'title' => 'Test Track 1', 'status' => 'complete', 'user_name' => 'Test User'],
['id' => 2, 'title' => 'Test Track 2', 'status' => 'processing', 'user_name' => 'Admin User']
];
$api_stats = [
['provider' => 'Stripe', 'calls' => 100, 'success_rate' => 95],
['provider' => 'PayPal', 'calls' => 50, 'success_rate' => 90]
];
include 'includes/header.php';
?>
<div class="admin-panel">
<div class="container">
<div class="admin-header">
<h1>Admin Control Panel</h1>
<p>Test Version</p>
</div>
<!-- Simple Tab Navigation -->
<div class="admin-tabs">
<a href="?tab=dashboard" class="admin-tab <?= $current_tab === 'dashboard' ? 'active' : '' ?>">Dashboard</a>
<a href="?tab=users" class="admin-tab <?= $current_tab === 'users' ? 'active' : '' ?>">Users</a>
<a href="?tab=tracks" class="admin-tab <?= $current_tab === 'tracks' ? 'active' : '' ?>">Tracks</a>
<a href="?tab=analytics" class="admin-tab <?= $current_tab === 'analytics' ? 'active' : '' ?>">Analytics</a>
</div>
<!-- Tab Content -->
<div class="tab-content">
<?php if ($current_tab === 'dashboard'): ?>
<h2>Dashboard</h2>
<p>Dashboard content here</p>
<?php elseif ($current_tab === 'users'): ?>
<h2>User Management</h2>
<table>
<tr><th>ID</th><th>Name</th><th>Email</th><th>Plan</th></tr>
<?php foreach ($users as $user): ?>
<tr>
<td><?= $user['id'] ?></td>
<td><?= $user['name'] ?></td>
<td><?= $user['email'] ?></td>
<td><?= $user['plan'] ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php elseif ($current_tab === 'tracks'): ?>
<h2>Track Management</h2>
<table>
<tr><th>ID</th><th>Title</th><th>Status</th><th>User</th></tr>
<?php foreach ($tracks as $track): ?>
<tr>
<td><?= $track['id'] ?></td>
<td><?= $track['title'] ?></td>
<td><?= $track['status'] ?></td>
<td><?= $track['user_name'] ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php elseif ($current_tab === 'analytics'): ?>
<h2>Analytics</h2>
<table>
<tr><th>Provider</th><th>Calls</th><th>Success Rate</th></tr>
<?php foreach ($api_stats as $stat): ?>
<tr>
<td><?= $stat['provider'] ?></td>
<td><?= $stat['calls'] ?></td>
<td><?= $stat['success_rate'] ?>%</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
</div>
</div>
</div>
<style>
.admin-panel { padding: 20px; }
.admin-tabs { margin: 20px 0; }
.admin-tab {
padding: 10px 20px;
margin: 0 5px;
background: #333;
color: white;
text-decoration: none;
border-radius: 5px;
}
.admin-tab.active { background: #667eea; }
.tab-content {
background: #222;
padding: 20px;
border-radius: 10px;
margin-top: 20px;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border: 1px solid #444; text-align: left; }
th { background: #333; }
</style>
<?php include 'includes/footer.php'; ?>