<?php
session_start();
require_once 'db_config.php';
// Check if user is logged in
if (!isset($_SESSION['user_id'])) {
header('Location: login.php?redirect=myFiles.php');
exit;
}
$username = $_SESSION['username'];
$plan_type = $_SESSION['plan_type'];
// Handle logout
if (isset($_GET['logout'])) {
session_destroy();
header('Location: index.php');
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Files - DevBrewing.com</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
.top-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
padding: 0 10px;
}
.logo {
font-size: 1.5rem;
font-weight: 700;
color: white;
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.header-buttons {
display: flex;
gap: 10px;
align-items: center;
}
.user-info {
color: white;
font-size: 0.9rem;
margin-right: 15px;
text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.plan-badge {
background: rgba(255, 255, 255, 0.3);
padding: 2px 8px;
border-radius: 12px;
font-size: 0.8rem;
margin-left: 5px;
}
.plan-badge.free { background: rgba(156, 163, 175, 0.8); }
.plan-badge.creator { background: rgba(59, 130, 246, 0.8); }
.plan-badge.professional { background: rgba(245, 158, 11, 0.8); }
.nav-btn, .settings-btn, .logout-btn {
background: rgba(255, 255, 255, 0.2);
border: 2px solid rgba(255, 255, 255, 0.3);
color: white;
padding: 10px 20px;
border-radius: 25px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
text-decoration: none;
display: inline-block;
}
.nav-btn:hover, .settings-btn:hover, .logout-btn:hover {
background: rgba(255, 255, 255, 0.3);
border-color: rgba(255, 255, 255, 0.5);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.logout-btn {
background: rgba(239, 68, 68, 0.7);
border-color: rgba(239, 68, 68, 0.8);
}
.logout-btn:hover {
background: rgba(239, 68, 68, 0.9);
border-color: rgba(239, 68, 68, 1);
}
h1 {
text-align: center;
color: white;
font-size: 2.5rem;
margin-bottom: 2rem;
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.breadcrumb {
background: rgba(255, 255, 255, 0.1);
color: white;
padding: 10px 20px;
border-radius: 10px;
margin-bottom: 2rem;
backdrop-filter: blur(10px);
}
.breadcrumb a {
color: #fbbf24;
text-decoration: none;
}
.breadcrumb a:hover {
text-decoration: underline;
}
.grid {
display: grid;
gap: 20px;
grid-template-columns: 1fr;
}
/* Desktop layout - 4 columns */
@media (min-width: 768px) {
.grid {
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
}
.file-card {
background: rgba(255, 255, 255, 0.95);
border-radius: 16px;
padding: 2rem;
text-align: center;
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
transition: all 0.3s ease;
cursor: pointer;
backdrop-filter: blur(10px);
border: 1px solid rgba(255,255,255,0.2);
min-height: 250px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
}
.file-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 40px rgba(0,0,0,0.3);
background: rgba(255, 255, 255, 1);
}
.file-card.new-item {
border: 2px dashed rgba(255,255,255,0.5);
background: rgba(255, 255, 255, 0.1);
}
.file-card.new-item:hover {
background: rgba(255, 255, 255, 0.2);
border-color: rgba(255,255,255,0.8);
}
.file-icon {
font-size: 3.5rem;
margin-bottom: 1rem;
display: block;
}
.file-title {
font-size: 1.5rem;
font-weight: 700;
color: #2d3748;
margin-bottom: 0.5rem;
}
.file-card.new-item .file-title {
color: white;
}
.file-description {
color: #4a5568;
line-height: 1.6;
font-size: 0.95rem;
}
.file-card.new-item .file-description {
color: rgba(255,255,255,0.9);
}
.file-meta {
position: absolute;
top: 10px;
right: 10px;
background: rgba(59, 130, 246, 0.9);
color: white;
font-size: 0.7rem;
padding: 4px 8px;
border-radius: 12px;
font-weight: 600;
}
.file-meta.recent {
background: rgba(34, 197, 94, 0.9);
}
.file-meta.shared {
background: rgba(245, 158, 11, 0.9);
}
.stats-bar {
background: rgba(255, 255, 255, 0.1);
color: white;
padding: 15px;
border-radius: 10px;
margin-bottom: 2rem;
backdrop-filter: blur(10px);
display: flex;
justify-content: space-around;
text-align: center;
}
.stat-item {
flex: 1;
}
.stat-number {
font-size: 1.5rem;
font-weight: 700;
}
.stat-label {
font-size: 0.9rem;
opacity: 0.9;
}
/* Mobile - full width cards */
@media (max-width: 767px) {
.logo {
font-size: 1.2rem;
}
.nav-btn, .settings-btn, .logout-btn {
padding: 8px 16px;
font-size: 0.9rem;
}
.header-buttons {
gap: 8px;
}
.user-info {
font-size: 0.8rem;
margin-right: 10px;
}
.file-card {
min-height: 200px;
padding: 1.5rem;
}
.file-icon {
font-size: 3rem;
}
.file-title {
font-size: 1.3rem;
}
h1 {
font-size: 2rem;
}
.stats-bar {
flex-direction: column;
gap: 10px;
}
}
/* Tablet - 2 columns */
@media (min-width: 768px) and (max-width: 1024px) {
.grid {
grid-template-columns: repeat(2, 1fr);
}
}
/* Large desktop - 4 columns */
@media (min-width: 1025px) {
.grid {
grid-template-columns: repeat(4, 1fr);
}
}
</style>
</head>
<body>
<div class="container">
<header class="top-header">
<div class="logo">My Files</div>
<div class="header-buttons">
<div class="user-info">
<?php echo htmlspecialchars($username); ?>
<span class="plan-badge <?php echo $plan_type; ?>"><?php echo ucfirst($plan_type); ?></span>
</div>
<a href="index.php" class="nav-btn">← Dashboard</a>
<button class="settings-btn">⚙️ Settings</button>
<a href="?logout=1" class="logout-btn">Logout</a>
</div>
</header>
<div class="breadcrumb">
<a href="index.php">Dashboard</a> / My Files
</div>
<h1>File Management</h1>
<div class="stats-bar">
<div class="stat-item">
<div class="stat-number">0</div>
<div class="stat-label">Sites</div>
</div>
<div class="stat-item">
<div class="stat-number">0</div>
<div class="stat-label">Projects</div>
</div>
<div class="stat-item">
<div class="stat-number">0 MB</div>
<div class="stat-label">Storage Used</div>
</div>
<div class="stat-item">
<div class="stat-number"><?php echo $plan_type === 'free' ? '100 MB' : ($plan_type === 'creator' ? '1 GB' : '10 GB'); ?></div>
<div class="stat-label">Storage Limit</div>
</div>
</div>
<div class="grid">
<!-- New Site -->
<div class="file-card new-item">
<span class="file-icon">🌐</span>
<h2 class="file-title">New Site</h2>
<p class="file-description">Create a new website project with templates and hosting</p>
</div>
<!-- New Project -->
<div class="file-card new-item">
<span class="file-icon">📁</span>
<h2 class="file-title">New Project</h2>
<p class="file-description">Start a new development project with version control</p>
</div>
<!-- My Sites -->
<div class="file-card">
<span class="file-icon">🏠</span>
<h2 class="file-title">My Sites</h2>
<p class="file-description">View and manage all your published websites</p>
<div class="file-meta">0 sites</div>
</div>
<!-- Projects -->
<div class="file-card">
<span class="file-icon">💼</span>
<h2 class="file-title">Projects</h2>
<p class="file-description">Access your development projects and repositories</p>
<div class="file-meta">0 projects</div>
</div>
<!-- Recent Files -->
<div class="file-card">
<span class="file-icon">🕒</span>
<h2 class="file-title">Recent Files</h2>
<p class="file-description">Quick access to your recently modified files</p>
<div class="file-meta recent">Recent</div>
</div>
<!-- Shared Files -->
<div class="file-card">
<span class="file-icon">👥</span>
<h2 class="file-title">Shared</h2>
<p class="file-description">Files and projects shared with you by other users</p>
<div class="file-meta shared">Shared</div>
</div>
<!-- Trash -->
<div class="file-card">
<span class="file-icon">🗑️</span>
<h2 class="file-title">Trash</h2>
<p class="file-description">Recover deleted files and projects</p>
<div class="file-meta">Empty</div>
</div>
<!-- Cloud Storage -->
<div class="file-card">
<span class="file-icon">☁️</span>
<h2 class="file-title">Cloud Storage</h2>
<p class="file-description">Access your cloud-synced files and backups</p>
<div class="file-meta">Synced</div>
</div>
</div>
</div>
</body>
</html>