![]() 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/-5efeb520/ |
<?php
session_start();
require_once 'config/database.php';
require_once 'includes/translations.php';
$eventId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
$passwordError = false;
$passwordSubmitted = false;
if ($eventId <= 0) {
header('Location: /events.php');
exit;
}
$pdo = getDBConnection();
// Check if password was submitted
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['party_password'])) {
$passwordSubmitted = true;
$submittedPassword = $_POST['party_password'] ?? '';
// Get event with password
$stmt = $pdo->prepare("
SELECT
e.*,
u.name AS creator_name
FROM events e
JOIN users u ON e.creator_id = u.id
WHERE e.id = ? AND e.status = 'published' AND e.is_private_party = 1
LIMIT 1
");
$stmt->execute([$eventId]);
$event = $stmt->fetch(PDO::FETCH_ASSOC);
if ($event && !empty($event['party_password'])) {
if ($submittedPassword === $event['party_password']) {
// Password correct - set session
// Ensure session is active
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
$_SESSION['party_access_' . $eventId] = true;
$_SESSION['party_access_time_' . $eventId] = time();
// Redirect back to events page so the event appears in the list
// The user can then click on it to view via modal
header('Location: /events.php?event=' . $eventId);
exit;
} else {
$passwordError = true;
}
}
}
// Get event details
$stmt = $pdo->prepare("
SELECT
e.*,
u.name AS creator_name
FROM events e
JOIN users u ON e.creator_id = u.id
WHERE e.id = ? AND e.status = 'published' AND e.is_private_party = 1
LIMIT 1
");
$stmt->execute([$eventId]);
$event = $stmt->fetch(PDO::FETCH_ASSOC);
// If event doesn't exist or isn't private, redirect
if (!$event) {
header('Location: /event_details.php?id=' . $eventId);
exit;
}
// Check if user already has access
if (isset($_SESSION['party_access_' . $eventId]) &&
isset($_SESSION['party_access_time_' . $eventId]) &&
(time() - $_SESSION['party_access_time_' . $eventId]) < 3600) { // 1 hour access
header('Location: /event_details.php?id=' . $eventId);
exit;
}
$host = $_SERVER['HTTP_HOST'] ?? 'soundstudiopro.com';
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https://' : 'http://';
$baseUrl = $scheme . $host;
$title = $event['title'] ?? 'Private Party';
$coverImage = $event['cover_image'] ?? '';
if ($coverImage && $coverImage[0] !== '/') {
$coverImage = '/' . $coverImage;
}
$coverImageUrl = $coverImage ? $baseUrl . $coverImage : $baseUrl . '/assets/images/og-image.png';
$page_title = 'Private Party Access - ' . htmlspecialchars($title) . ' - SoundStudioPro';
include 'includes/header.php';
?>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
overflow: hidden;
height: 100vh;
}
.party-gate-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
background-size: 400% 400%;
animation: gradientShift 15s ease infinite;
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
z-index: 9999;
}
@keyframes gradientShift {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.party-gate-content {
position: relative;
max-width: 500px;
width: 100%;
background: rgba(15, 23, 42, 0.95);
backdrop-filter: blur(20px);
border-radius: 32px;
padding: 3rem;
box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5),
0 0 0 1px rgba(255, 255, 255, 0.1),
inset 0 1px 0 rgba(255, 255, 255, 0.1);
text-align: center;
animation: gateEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gateEntrance {
0% {
opacity: 0;
transform: scale(0.8) translateY(20px);
}
100% {
opacity: 1;
transform: scale(1) translateY(0);
}
}
.party-gate-icon {
font-size: 4rem;
margin-bottom: 1.5rem;
background: linear-gradient(135deg, #f093fb 0%, #4facfe 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
animation: iconPulse 2s ease-in-out infinite;
}
@keyframes iconPulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.1); }
}
.party-gate-title {
font-size: 2rem;
font-weight: 800;
color: #fff;
margin-bottom: 0.5rem;
background: linear-gradient(135deg, #f093fb 0%, #4facfe 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.party-gate-subtitle {
font-size: 1rem;
color: rgba(255, 255, 255, 0.7);
margin-bottom: 2rem;
line-height: 1.6;
}
.party-gate-form {
margin-top: 2rem;
}
.party-gate-input-wrapper {
position: relative;
margin-bottom: 1.5rem;
}
.party-gate-input {
width: 100%;
padding: 1rem 1.5rem;
background: rgba(255, 255, 255, 0.05);
border: 2px solid rgba(255, 255, 255, 0.1);
border-radius: 16px;
color: #fff;
font-size: 1.1rem;
transition: all 0.3s ease;
outline: none;
}
.party-gate-input:focus {
border-color: rgba(139, 92, 246, 0.6);
background: rgba(255, 255, 255, 0.08);
box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}
.party-gate-input::placeholder {
color: rgba(255, 255, 255, 0.4);
}
.party-gate-error {
color: #ff6b6b;
font-size: 0.9rem;
margin-top: 0.5rem;
display: block;
animation: shake 0.5s ease;
}
@keyframes shake {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-10px); }
75% { transform: translateX(10px); }
}
.party-gate-button {
width: 100%;
padding: 1rem 2rem;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
border-radius: 16px;
color: #fff;
font-size: 1.1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
position: relative;
overflow: hidden;
}
.party-gate-button::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: left 0.5s ease;
}
.party-gate-button:hover::before {
left: 100%;
}
.party-gate-button:hover {
transform: translateY(-2px);
box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}
.party-gate-button:active {
transform: translateY(0);
}
.party-gate-event-preview {
margin-top: 2rem;
padding-top: 2rem;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.party-gate-event-image {
width: 100%;
height: 200px;
object-fit: cover;
border-radius: 16px;
margin-bottom: 1rem;
border: 2px solid rgba(255, 255, 255, 0.1);
}
.party-gate-event-title {
color: rgba(255, 255, 255, 0.9);
font-size: 1.2rem;
font-weight: 600;
margin-bottom: 0.5rem;
}
.party-gate-event-creator {
color: rgba(255, 255, 255, 0.6);
font-size: 0.9rem;
}
.party-particles {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
overflow: hidden;
}
.particle {
position: absolute;
width: 4px;
height: 4px;
background: rgba(255, 255, 255, 0.6);
border-radius: 50%;
animation: float 15s infinite linear;
}
@keyframes float {
0% {
transform: translateY(100vh) translateX(0) rotate(0deg);
opacity: 0;
}
10% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
transform: translateY(-100px) translateX(100px) rotate(360deg);
opacity: 0;
}
}
</style>
<div class="party-gate-container">
<div class="party-particles" id="particles"></div>
<div class="party-gate-content">
<div class="party-gate-icon">
<i class="fas fa-lock"></i>
</div>
<h1 class="party-gate-title">Private Password Party</h1>
<p class="party-gate-subtitle">This is an exclusive event. Enter the password to access.</p>
<?php if (!empty($event['cover_image'])): ?>
<div class="party-gate-event-preview">
<img src="<?= htmlspecialchars($coverImageUrl) ?>" alt="<?= htmlspecialchars($event['title']) ?>" class="party-gate-event-image">
<div class="party-gate-event-title"><?= htmlspecialchars($event['title']) ?></div>
<div class="party-gate-event-creator">by <?= htmlspecialchars($event['creator_name']) ?></div>
</div>
<?php endif; ?>
<form method="POST" class="party-gate-form" id="partyGateForm">
<div class="party-gate-input-wrapper">
<input
type="password"
name="party_password"
class="party-gate-input"
placeholder="Enter party password..."
required
autofocus
autocomplete="off"
>
<?php if ($passwordError): ?>
<span class="party-gate-error">Incorrect password. Please try again.</span>
<?php endif; ?>
</div>
<button type="submit" class="party-gate-button">
<i class="fas fa-unlock"></i> Enter Party
</button>
</form>
</div>
</div>
<script>
// Create floating particles
function createParticles() {
const container = document.getElementById('particles');
const particleCount = 30;
for (let i = 0; i < particleCount; i++) {
const particle = document.createElement('div');
particle.className = 'particle';
particle.style.left = Math.random() * 100 + '%';
particle.style.animationDelay = Math.random() * 15 + 's';
particle.style.animationDuration = (10 + Math.random() * 10) + 's';
container.appendChild(particle);
}
}
createParticles();
// Auto-focus input on load
document.querySelector('.party-gate-input').focus();
// Handle form submission
document.getElementById('partyGateForm').addEventListener('submit', function(e) {
const button = this.querySelector('.party-gate-button');
const originalText = button.innerHTML;
button.disabled = true;
button.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Checking...';
// Re-enable after 3 seconds in case of error
setTimeout(() => {
button.disabled = false;
button.innerHTML = originalText;
}, 3000);
});
</script>
<?php include 'includes/footer.php'; ?>