![]() 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/domains/soundstudiopro.com/private_html/ |
<?php
session_start();
// Check if user is logged in
if (!isset($_SESSION['user_id'])) {
header('Location: /auth/login.php');
exit;
}
require_once 'config/database.php';
$pdo = getDBConnection();
$current_user_id = $_SESSION['user_id'];
// Get current user info
$stmt = $pdo->prepare("SELECT id, name, email, is_admin FROM users WHERE id = ?");
$stmt->execute([$current_user_id]);
$current_user = $stmt->fetch();
// Get Charles's info
$stmt = $pdo->prepare("SELECT id, name, email FROM users WHERE name LIKE '%charles%' OR email LIKE '%charles%'");
$stmt->execute();
$charles = $stmt->fetch();
// Get tracks for current user
$stmt = $pdo->prepare("SELECT COUNT(*) as count FROM music_tracks WHERE user_id = ?");
$stmt->execute([$current_user_id]);
$current_user_tracks = $stmt->fetch()['count'];
// Get tracks for Charles
$charles_tracks = 0;
if ($charles) {
$stmt = $pdo->prepare("SELECT COUNT(*) as count FROM music_tracks WHERE user_id = ?");
$stmt->execute([$charles['id']]);
$charles_tracks = $stmt->fetch()['count'];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Track Display Fix - SoundStudioPro</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
background: #1a1a1a;
color: white;
}
.container {
background: rgba(255, 255, 255, 0.05);
padding: 30px;
border-radius: 12px;
margin: 20px 0;
}
.status {
padding: 15px;
border-radius: 8px;
margin: 15px 0;
}
.success { background: rgba(34, 197, 94, 0.2); border: 1px solid rgba(34, 197, 94, 0.5); }
.warning { background: rgba(245, 158, 11, 0.2); border: 1px solid rgba(245, 158, 11, 0.5); }
.error { background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.5); }
.info { background: rgba(59, 130, 246, 0.2); border: 1px solid rgba(59, 130, 246, 0.5); }
.btn {
display: inline-block;
padding: 12px 24px;
background: #667eea;
color: white;
text-decoration: none;
border-radius: 8px;
margin: 10px 5px;
border: none;
cursor: pointer;
}
.btn:hover { background: #5a67d8; }
.btn-danger { background: #ef4444; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #22c55e; }
.btn-success:hover { background: #16a34a; }
pre {
background: rgba(0, 0, 0, 0.3);
padding: 15px;
border-radius: 8px;
overflow-x: auto;
font-size: 14px;
}
</style>
</head>
<body>
<h1>🔧 Track Display Fix</h1>
<div class="container">
<h2>👤 Current Session Status</h2>
<div class="status info">
<strong>Logged in as:</strong> <?= htmlspecialchars($current_user['name']) ?> (ID: <?= $current_user['id'] ?>)<br>
<strong>Email:</strong> <?= htmlspecialchars($current_user['email']) ?><br>
<strong>Admin Status:</strong> <?= $current_user['is_admin'] ? 'Yes' : 'No' ?><br>
<strong>Tracks in Library:</strong> <?= $current_user_tracks ?>
</div>
</div>
<?php if ($charles): ?>
<div class="container">
<h2>👤 Charles's Account Status</h2>
<div class="status info">
<strong>Name:</strong> <?= htmlspecialchars($charles['name']) ?> (ID: <?= $charles['id'] ?>)<br>
<strong>Email:</strong> <?= htmlspecialchars($charles['email']) ?><br>
<strong>Tracks in Library:</strong> <?= $charles_tracks ?>
</div>
</div>
<?php endif; ?>
<div class="container">
<h2>🎯 Issue Analysis</h2>
<?php if ($current_user['id'] == $charles['id']): ?>
<div class="status error">
<strong>❌ PROBLEM IDENTIFIED:</strong> You are currently logged in as Charles!<br>
The track transfer worked correctly, but you're viewing Charles's library instead of the admin library.
</div>
<h3>🛠️ Solution:</h3>
<ol>
<li><strong>Log out of Charles's account:</strong> <a href="/auth/logout.php" class="btn btn-danger">Logout</a></li>
<li><strong>Log in as admin:</strong> <a href="/auth/login.php" class="btn">Login as Admin</a></li>
<li><strong>Check admin library:</strong> <a href="/library.php" class="btn btn-success">View Admin Library</a></li>
</ol>
<?php elseif ($current_user['is_admin']): ?>
<div class="status success">
<strong>✅ STATUS:</strong> You are logged in as admin and should see the transferred tracks in your library.
</div>
<h3>🔍 If tracks are still not showing:</h3>
<ol>
<li><strong>Clear browser cache:</strong> Press Ctrl+F5 (or Cmd+Shift+R on Mac) to force refresh</li>
<li><strong>Check admin library:</strong> <a href="/library.php" class="btn btn-success">View Admin Library</a></li>
<li><strong>Check admin track management:</strong> <a href="/admin.php?tab=tracks" class="btn">Admin Track Management</a></li>
</ol>
<?php else: ?>
<div class="status warning">
<strong>⚠️ STATUS:</strong> You are logged in as a regular user, not admin.
</div>
<h3>🛠️ To see the transferred tracks:</h3>
<ol>
<li><strong>Log in as admin:</strong> <a href="/auth/login.php" class="btn">Login as Admin</a></li>
<li><strong>Check admin library:</strong> <a href="/library.php" class="btn btn-success">View Admin Library</a></li>
</ol>
<?php endif; ?>
</div>
<div class="container">
<h2>📊 Database Verification</h2>
<p>To verify the track transfer was successful, check the admin track management:</p>
<a href="/admin.php?tab=tracks" class="btn">Admin Track Management</a>
<a href="/admin.php?tab=orphaned" class="btn">Orphaned Tracks</a>
</div>
<div class="container">
<h2>🔄 Quick Actions</h2>
<a href="/library.php" class="btn btn-success">View My Library</a>
<a href="/admin.php" class="btn">Admin Panel</a>
<a href="/auth/logout.php" class="btn btn-danger">Logout</a>
<button onclick="clearCache()" class="btn">Clear Browser Cache</button>
</div>
<script>
function clearCache() {
if (confirm('Clear browser cache and reload the page?')) {
// Clear cache if available
if ('caches' in window) {
caches.keys().then(function(names) {
for (let name of names) caches.delete(name);
});
}
// Force reload
window.location.reload(true);
}
}
</script>
</body>
</html>