enviroment

This commit is contained in:
Flatlogic Bot 2026-01-09 01:34:44 +00:00
parent 372b8a01cd
commit 2369b242ea
4 changed files with 244 additions and 145 deletions

108
assets/css/custom.css Normal file
View File

@ -0,0 +1,108 @@
:root {
--primary-color: #4F46E5;
--secondary-color: #10B981;
--bg-light: #F9FAFB;
--surface-white: #FFFFFF;
--text-dark: #111827;
--text-muted: #6B7280;
}
body {
background-color: var(--bg-light);
font-family: 'Inter', sans-serif;
color: var(--text-dark);
}
.navbar-brand {
font-weight: 700;
}
.hero-section {
background: linear-gradient(120deg, var(--primary-color) 0%, #7c3aed 100%);
padding: 6rem 0;
color: white;
}
.hero-section h1 {
font-size: 3.5rem;
font-weight: 800;
}
.hero-section p {
font-size: 1.25rem;
max-width: 600px;
margin: 1rem auto 2rem;
}
.btn-primary {
background-color: var(--primary-color);
border-color: var(--primary-color);
font-weight: 600;
padding: 0.75rem 1.5rem;
border-radius: 0.5rem;
transition: background-color 0.2s ease-in-out;
}
.btn-primary:hover {
background-color: #4338ca;
border-color: #4338ca;
}
.event-section {
padding: 5rem 0;
}
.event-card {
border: none;
border-radius: 0.75rem;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
height: 100%;
}
.event-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.event-card .card-body {
padding: 1.75rem;
}
.event-card .card-title {
font-size: 1.25rem;
font-weight: 600;
color: var(--text-dark);
}
.event-card .card-subtitle {
color: var(--primary-color);
font-weight: 500;
}
.event-card .card-text {
color: var(--text-muted);
}
.price-tag {
background-color: var(--secondary-color);
color: white;
font-weight: 700;
font-size: 1.1rem;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
position: absolute;
top: 1.5rem;
right: 1.5rem;
}
.price-tag.free {
background-color: var(--primary-color);
}
.footer {
background-color: var(--surface-white);
padding: 2rem 0;
border-top: 1px solid #e5e7eb;
}

1
assets/js/main.js Normal file
View File

@ -0,0 +1 @@
// Future JavaScript enhancements will go here.

View File

@ -0,0 +1,37 @@
<?php
require_once __DIR__ . '/../config.php';
try {
$pdo = db();
// Create events table
$pdo->exec("CREATE TABLE IF NOT EXISTS events (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
description TEXT,
event_date DATETIME NOT NULL,
location VARCHAR(255),
price DECIMAL(10, 2) DEFAULT 0.00,
status ENUM('pending', 'accepted', 'rejected') NOT NULL DEFAULT 'pending',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);");
// Check if table is empty before seeding
$stmt = $pdo->query("SELECT COUNT(*) FROM events");
if ($stmt->fetchColumn() == 0) {
// Seed data
$pdo->exec("INSERT INTO events (title, event_date, location, status, price) VALUES
('Community Tech Conference 2026', '2026-03-15 09:00:00', 'City Convention Center', 'accepted', 49.99),
('Local Music Festival', '2026-04-22 18:00:00', 'Downtown Park', 'accepted', 25.00),
('Art & Design Expo', '2026-05-10 11:00:00', 'Grand Exhibition Hall', 'pending', 15.00),
('Startup Pitch Night', '2026-05-20 19:00:00', 'Innovation Hub', 'accepted', 0.00),
('Health & Wellness Retreat', '2026-06-05 10:00:00', 'Serenity Resort', 'rejected', 350.00);
");
echo "Database table 'events' created and seeded successfully." . PHP_EOL;
} else {
echo "Database table 'events' already exists and contains data. Seeding skipped." . PHP_EOL;
}
} catch (PDOException $e) {
die("Database migration failed: " . $e->getMessage());
}

241
index.php
View File

@ -1,150 +1,103 @@
<?php <!DOCTYPE html>
declare(strict_types=1);
@ini_set('display_errors', '1');
@error_reporting(E_ALL);
@date_default_timezone_set('UTC');
$phpVersion = PHP_VERSION;
$now = date('Y-m-d H:i:s');
?>
<!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Style</title> <title>EventJet - Your Gateway to Exclusive Events</title>
<?php
// Read project preview data from environment <meta name="description" content="<?php echo htmlspecialchars($_SERVER['PROJECT_DESCRIPTION'] ?? 'Find and book tickets for the best events in town.'); ?>">
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? ''; <!-- Open Graph / Twitter Card meta tags are managed by the platform. Do not add them here. -->
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
?> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<?php if ($projectDescription): ?> <link rel="preconnect" href="https://fonts.googleapis.com">
<!-- Meta description --> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' /> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<!-- Open Graph meta tags --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<!-- Twitter meta tags --> <link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<?php endif; ?>
<?php if ($projectImageUrl): ?>
<!-- Open Graph image -->
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<!-- Twitter image -->
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<?php endif; ?>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<style>
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
}
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
}
body::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
animation: bg-pan 20s linear infinite;
z-index: -1;
}
@keyframes bg-pan {
0% { background-position: 0% 0%; }
100% { background-position: 100% 100%; }
}
main {
padding: 2rem;
}
.card {
background: var(--card-bg-color);
border: 1px solid var(--card-border-color);
border-radius: 16px;
padding: 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}
.loader {
margin: 1.25rem auto 1.25rem;
width: 48px;
height: 48px;
border: 3px solid rgba(255, 255, 255, 0.25);
border-top-color: #fff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.hint {
opacity: 0.9;
}
.sr-only {
position: absolute;
width: 1px; height: 1px;
padding: 0; margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap; border: 0;
}
h1 {
font-size: 3rem;
font-weight: 700;
margin: 0 0 1rem;
letter-spacing: -1px;
}
p {
margin: 0.5rem 0;
font-size: 1.1rem;
}
code {
background: rgba(0,0,0,0.2);
padding: 2px 6px;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
footer {
position: absolute;
bottom: 1rem;
font-size: 0.8rem;
opacity: 0.7;
}
</style>
</head> </head>
<body> <body>
<main>
<div class="card"> <nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
<h1>Analyzing your requirements and generating your website…</h1> <div class="container">
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes"> <a class="navbar-brand" href="/">
<span class="sr-only">Loading…</span> <i class="bi bi-calendar-check"></i>
</div> EventJet
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p> </a>
<p class="hint">This page will update automatically as the plan is implemented.</p> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p> <span class="navbar-toggler-icon"></span>
</div> </button>
</main> <div class="collapse navbar-collapse" id="navbarNav">
<footer> <ul class="navbar-nav ms-auto">
Page updated: <?= htmlspecialchars($now) ?> (UTC) <li class="nav-item"><a class="nav-link" href="#">Home</a></li>
</footer> <li class="nav-item"><a class="nav-link" href="#events">Events</a></li>
<li class="nav-item"><a class="nav-link" href="#">Login</a></li>
<li class="nav-item"><a class="nav-link btn btn-primary text-white ms-2 px-3 py-2" href="#">Register</a></li>
</ul>
</div>
</div>
</nav>
<main>
<section class="hero-section text-center">
<div class="container">
<h1>Discover Your Next Great Event</h1>
<p>From tech conferences to music festivals, find and book your ticket to the most exciting events happening near you.</p>
<a href="#events" class="btn btn-primary btn-lg">Browse Events</a>
</div>
</section>
<section id="events" class="event-section">
<div class="container">
<h2 class="text-center mb-5 fw-bold">Upcoming Events</h2>
<div class="row g-4">
<?php
try {
require_once __DIR__ . '/db/config.php';
$pdo = db();
$stmt = $pdo->prepare("SELECT * FROM events WHERE status = 'accepted' ORDER BY event_date ASC");
$stmt->execute();
$events = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (empty($events)) {
echo "<p class='text-center text-muted'>No upcoming events found. Please check back later!</p>";
} else {
foreach ($events as $event) {
$event_date = new DateTime($event['event_date']);
$price = floatval($event['price']);
$price_display = $price > 0 ? '$' . number_format($price, 2) : 'FREE';
$price_class = $price > 0 ? '' : 'free';
echo '<div class="col-lg-4 col-md-6">
<div class="card event-card">
<div class="card-body position-relative">
<div class="price-tag ' . $price_class . '">' . $price_display . '</div>
<h5 class="card-subtitle mb-2 text-muted">' . $event_date->format('M d, Y \a\t h:i A') . '</h5>
<h4 class="card-title mb-2">' . htmlspecialchars($event['title']) . '</h4>
<p class="card-text"><i class="bi bi-geo-alt-fill"></i> ' . htmlspecialchars($event['location']) . '</p>
<a href="#" class="btn btn-outline-primary stretched-link">View Details</a>
</div>
</div>
</div>';
}
}
} catch (Exception $e) {
error_log("Event Fetch Error: " . $e->getMessage());
echo "<p class='text-center text-danger'>We're sorry, but there was an error fetching events. Please try again later.</p>";
}
?>
</div>
</div>
</section>
</main>
<footer class="footer">
<div class="container text-center">
<p class="text-muted mb-0">&copy; <?php echo date("Y"); ?> EventJet. All rights reserved.</p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body> </body>
</html> </html>