Compare commits

..

No commits in common. "ai-dev" and "master" have entirely different histories.

11 changed files with 126 additions and 780 deletions

View File

@ -1,152 +0,0 @@
/* Aperture - Custom Styles */
:root {
--bg-dark: #0D1117;
--surface: #161B22;
--primary: #58A6FF;
--primary-darker: #3081F7;
--text-primary: #C9D1D9;
--text-headings: #F0F6FC;
--border-color: #30363d;
}
body {
background-color: var(--bg-dark);
color: var(--text-primary);
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1, h2, h3, h4, h5, h6 {
color: var(--text-headings);
font-weight: 700;
}
.navbar {
background-color: rgba(13, 17, 23, 0.8);
backdrop-filter: blur(10px);
border-bottom: 1px solid var(--border-color);
}
.navbar-brand {
font-weight: 700;
color: var(--text-headings);
}
.nav-link {
color: var(--text-primary);
}
.nav-link:hover {
color: var(--text-headings);
}
.btn-primary {
background-image: linear-gradient(45deg, var(--primary), var(--primary-darker));
border: none;
border-radius: 0.75rem;
font-weight: 600;
padding: 0.75rem 1.5rem;
transition: transform 0.2s ease-in-out;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 4px 20px rgba(88, 166, 255, 0.3);
}
.btn-secondary {
background-color: var(--surface);
border: 1px solid var(--border-color);
color: var(--text-headings);
border-radius: 0.75rem;
font-weight: 600;
padding: 0.75rem 1.5rem;
}
.btn-secondary:hover {
background-color: #21262d;
}
.hero {
padding: 8rem 0;
background-image: url('https://picsum.photos/seed/aperture-hero/1600/900');
background-size: cover;
background-position: center;
position: relative;
}
.hero::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(13, 17, 23, 0.7);
}
.hero .container {
position: relative;
z-index: 2;
}
.section {
padding: 6rem 0;
}
.feature-card, .offer-explorer-card {
background-color: var(--surface);
border: 1px solid var(--border-color);
border-radius: 0.75rem;
padding: 2rem;
height: 100%;
}
.social-proof img {
filter: grayscale(100%) contrast(0.5);
opacity: 0.6;
transition: all 0.3s ease;
max-height: 40px;
}
.social-proof img:hover {
filter: none;
opacity: 1;
}
.form-control, .form-select {
background-color: var(--bg-dark);
border-color: var(--border-color);
color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
background-color: var(--bg-dark);
border-color: var(--primary);
color: var(--text-primary);
box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25);
}
.table {
--bs-table-bg: var(--surface);
--bs-table-striped-bg: #21262d;
--bs-table-color: var(--text-primary);
--bs-table-border-color: var(--border-color);
}
.footer {
background-color: var(--surface);
padding: 3rem 0;
border-top: 1px solid var(--border-color);
}
/* Contact Form Status */
#contact-form-status p {
margin-bottom: 0;
text-align: center;
font-weight: 600;
}
.text-success {
color: #28a745 !important;
}
.text-danger {
color: #dc3545 !important;
}
.text-info {
color: #0dcaf0 !important;
}

View File

@ -1,97 +0,0 @@
document.addEventListener('DOMContentLoaded', function () {
const offerForm = document.getElementById('offer-explorer-form');
const resultsTableBody = document.getElementById('offer-results-body');
const mockOffers = [
{ provider: 'AWS', gpu: 'H100', region: 'us-east-1', price: 2.10, spot: true },
{ provider: 'GCP', gpu: 'H100', region: 'us-central1', price: 2.25, spot: true },
{ provider: 'Azure', gpu: 'H100', region: 'eastus', price: 2.30, spot: false },
{ provider: 'CoreWeave', gpu: 'H100', region: 'us-east', price: 1.89, spot: false },
{ provider: 'RunPod', gpu: 'H100', region: 'us-east', price: 1.79, spot: true },
{ provider: 'AWS', gpu: 'A100', region: 'us-west-2', price: 1.10, spot: true },
{ provider: 'GCP', gpu: 'A100', region: 'us-east4', price: 1.20, spot: true },
{ provider: 'Vast.ai', gpu: 'A100', region: 'us-west', price: 0.95, spot: true },
{ provider: 'AWS', gpu: 'RTX 4090', region: 'eu-west-1', price: 0.70, spot: true },
{ provider: 'RunPod', gpu: 'RTX 4090', region: 'eu-central-1', price: 0.65, spot: true },
];
if (offerForm) {
offerForm.addEventListener('submit', function (e) {
e.preventDefault();
const gpuType = document.getElementById('gpuType').value;
const spotOk = document.getElementById('spotOk').checked;
const filteredOffers = mockOffers.filter(offer => {
const gpuMatch = gpuType === 'any' || offer.gpu === gpuType;
const spotMatch = !spotOk || offer.spot === true;
return gpuMatch && spotMatch;
});
renderResults(filteredOffers);
});
}
function renderResults(offers) {
if (!resultsTableBody) return;
resultsTableBody.innerHTML = '';
if (offers.length === 0) {
resultsTableBody.innerHTML = '<tr><td colspan="5" class="text-center">No matching offers found.</td></tr>';
return;
}
offers.forEach(offer => {
const row = `
<tr>
<td>${offer.provider}</td>
<td>${offer.gpu}</td>
<td>${offer.region}</td>
<td>$${offer.price.toFixed(2)}</td>
<td>${offer.spot ? '<span class="badge bg-success">Yes</span>' : '<span class="badge bg-warning text-dark">No</span>'}</td>
</tr>
`;
resultsTableBody.innerHTML += row;
});
}
// Initial render with all offers
renderResults(mockOffers);
// Contact Form Handler
const contactForm = document.getElementById('contact-form');
if (contactForm) {
contactForm.addEventListener('submit', function (e) {
e.preventDefault();
const statusDiv = document.getElementById('contact-form-status');
const submitButton = contactForm.querySelector('button[type="submit"]');
statusDiv.innerHTML = '<p class="text-info">Sending...</p>';
submitButton.disabled = true;
const formData = new FormData(this);
fetch('contact.php', {
method: 'POST',
body: formData
})
.then(response => response.json().then(data => ({ ok: response.ok, data })))
.then(({ ok, data }) => {
if (ok) {
statusDiv.innerHTML = `<p class="text-success">${data.success}</p>`;
contactForm.reset();
} else {
statusDiv.innerHTML = `<p class="text-danger">${data.error || 'An unknown error occurred.'}</p>`;
}
})
.catch(error => {
console.error('Error:', error);
statusDiv.innerHTML = '<p class="text-danger">A network error occurred. Please try again.</p>';
})
.finally(() => {
submitButton.disabled = false;
});
});
}
});

View File

@ -1,41 +0,0 @@
<?php
header('Content-Type: application/json');
// Allow only POST requests
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);
echo json_encode(['error' => 'Method Not Allowed']);
exit;
}
// Include the MailService
require_once __DIR__ . '/mail/MailService.php';
// Get and sanitize inputs
$name = trim($_POST['name'] ?? '');
$email = trim($_POST['email'] ?? '');
$message = trim($_POST['message'] ?? '');
// Basic validation
if (empty($name) || empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL) || empty($message)) {
http_response_code(400);
echo json_encode(['error' => 'Please fill out all fields correctly.']);
exit;
}
// Prepare email details
$subject = 'New Contact Form Submission from Aperture Website';
// Send the email using the MailService.
// The `$to` address is omitted to use the default from the .env configuration.
$res = MailService::sendContactMessage($name, $email, $message, null, $subject);
// Respond to the client
if (!empty($res['success'])) {
echo json_encode(['success' => 'Thank you for your message! We will get back to you shortly.']);
} else {
http_response_code(500);
// Note: In a real app, you would log the detailed error.
// error_log('MailService Error: ' . ($res['error'] ?? 'Unknown error'));
echo json_encode(['error' => 'Sorry, there was an error sending your message. Please try again later.']);
}

View File

@ -1,42 +0,0 @@
<?php
session_start();
if (!isset($_SESSION['user_id'])) {
header('Location: login.php');
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard - Aperture</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<header class="app-header">
<div class="container">
<div class="header-content">
<a href="index.php" class="logo">Aperture</a>
<nav class="main-nav">
<a href="logout.php">Logout</a>
</nav>
</div>
</div>
</header>
<main class="container page-section">
<h2>Welcome, <?php echo htmlspecialchars($_SESSION['username']); ?>!</h2>
<p>This is your dashboard. You are successfully logged in.</p>
</main>
<footer class="app-footer">
<div class="container">
<p>&copy; <?php echo date('Y'); ?> Aperture. All rights reserved. | <a href="privacy.php">Privacy Policy</a></p>
</div>
</footer>
</body>
</html>

View File

@ -1,19 +0,0 @@
<?php
require_once __DIR__ . '/config.php';
try {
$pdo = db();
$migrationsDir = __DIR__ . '/migrations';
$migrationFiles = glob($migrationsDir . '/*.sql');
foreach ($migrationFiles as $file) {
echo "Running migration: " . basename($file) . "\n";
$sql = file_get_contents($file);
$pdo->exec($sql);
echo "Success.\n";
}
} catch (PDOException $e) {
die("Database migration failed: " . $e->getMessage());
}

View File

@ -1,7 +0,0 @@
CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL UNIQUE,
email VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

329
index.php
View File

@ -1,224 +1,131 @@
<!DOCTYPE html>
<?php
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">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Aperture The Intelligent Compute Fabric</title>
<meta name="description" content="Aperture is the unified compute layer for AI: submit once, run anywhere—cheapest, fastest, compliant.">
<!-- Open Graph -->
<meta property="og:title" content="Aperture The Intelligent Compute Fabric">
<meta property="og:description" content="Submit AI workloads once, run anywhere on the globally optimal compute.">
<meta property="og:image" content="https://picsum.photos/seed/aperture-og/1200/630">
<meta property="og:url" content="[YOUR_APP_URL]">
<meta property="og:type" content="website">
<!-- Styles -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>New Style</title>
<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;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<script src="https://unpkg.com/feather-icons"></script>
<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>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="#">
<i data-feather="aperture" class="me-2"></i> Aperture
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item"><a class="nav-link" href="#features">Features</a></li>
<li class="nav-item"><a class="nav-link" href="#contact">Contact</a></li>
<li class="nav-item"><a class="nav-link" href="login.php">Login</a></li>
<li class="nav-item ms-lg-3"><a class="btn btn-primary" href="register.php">Register</a></li>
</ul>
</div>
</div>
</nav>
<!-- Hero -->
<header class="hero text-white text-center">
<div class="container">
<h1 class="display-3 fw-bold mb-4">Unified Compute, Unlocked.</h1>
<p class="lead mb-5 col-lg-8 mx-auto">Aperture is the intelligent compute layer for AI. Submit once, run anywhere—cheapest, fastest, compliant.</p>
<div>
<a href="#" class="btn btn-primary btn-lg">Get Started</a>
<a href="#" class="btn btn-secondary btn-lg ms-3">View Docs</a>
</div>
</div>
</header>
<!-- Social Proof -->
<section class="py-5">
<div class="container text-center">
<p class="text-uppercase small text-muted mb-4">Routing workloads across the world's best providers</p>
<div class="d-flex flex-wrap justify-content-center align-items-center">
<img src="https://upload.wikimedia.org/wikipedia/commons/9/93/Amazon_Web_Services_Logo.svg" alt="AWS Logo" class="mx-4 my-2">
<img src="https://upload.wikimedia.org/wikipedia/commons/2/2f/Google_Cloud_logo.svg" alt="Google Cloud Logo" class="mx-4 my-2">
<img src="https://upload.wikimedia.org/wikipedia/commons/e/e5/Microsoft_Azure_Logo.svg" alt="Azure Logo" class="mx-4 my-2">
<img src="https://upload.wikimedia.org/wikipedia/commons/4/4b/Cloudflare_Logo.svg" alt="Cloudflare Logo" class="mx-4 my-2" style="max-height: 30px;">
<img src="https://images.g2crowd.com/uploads/product/image/social_landscape/social_landscape_bf039841426276a8238599575e7043d5/coreweave.png" alt="CoreWeave Logo" class="mx-4 my-2">
</div>
</div>
</section>
<!-- Main Content -->
<main>
<!-- Feature 1: Offer Explorer -->
<section id="features" class="section">
<div class="container">
<div class="row align-items-center g-5">
<div class="col-lg-6">
<h2>Find Optimal Compute, Instantly.</h2>
<p class="lead text-muted">Query our global index of compute providers to find the perfect balance of price, performance, and availability for your workload. Stop overpaying for idle instances.</p>
<img src="https://picsum.photos/seed/aperture-f1/800/600" class="img-fluid rounded-3 mt-4" alt="Diagram showing a job being routed to multiple cloud providers">
<div class="card">
<h1>Analyzing your requirements and generating your website…</h1>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
<span class="sr-only">Loading…</span>
</div>
<div class="col-lg-6">
<div class="offer-explorer-card">
<h4 class="mb-4">Compute Offer Explorer</h4>
<form id="offer-explorer-form">
<div class="row g-3">
<div class="col-md-6">
<label for="gpuType" class="form-label">GPU Type</label>
<select id="gpuType" class="form-select">
<option value="any">Any</option>
<option value="H100">NVIDIA H100</option>
<option value="A100">NVIDIA A100</option>
<option value="RTX 4090">NVIDIA RTX 4090</option>
</select>
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWiZZy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
<p class="hint">This page will update automatically as the plan is implemented.</p>
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
</div>
<div class="col-md-6 d-flex align-items-end">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="spotOk" checked>
<label class="form-check-label" for="spotOk">Spot Instances OK</label>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary mt-4 w-100">Search Offers</button>
</form>
<div class="mt-4">
<table class="table table-hover">
<thead>
<tr>
<th>Provider</th>
<th>GPU</th>
<th>Region</th>
<th>Price/hr</th>
<th>Spot</th>
</tr>
</thead>
<tbody id="offer-results-body">
<!-- JS will populate this -->
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Feature 2: How it works -->
<section class="section bg-darker">
<div class="container">
<div class="text-center col-lg-8 mx-auto">
<h2 class="mb-3">A Smarter Way to Run AI</h2>
<p class="lead text-muted">Aperture decouples your workload from the underlying infrastructure, so you can focus on building, not billing.</p>
</div>
<div class="row g-4 mt-5 text-center">
<div class="col-md-4">
<div class="feature-card">
<i data-feather="upload-cloud" class="text-primary mb-3" style="width: 48px; height: 48px;"></i>
<h4>1. Submit Job</h4>
<p>Define your workload, data, and constraints using our simple API or web console.</p>
</div>
</div>
<div class="col-md-4">
<div class="feature-card">
<i data-feather="cpu" class="text-primary mb-3" style="width: 48px; height: 48px;"></i>
<h4>2. Orchestrate</h4>
<p>Aperture's intelligent scheduler finds the globally optimal compute to run your job.</p>
</div>
</div>
<div class="col-md-4">
<div class="feature-card">
<i data-feather="terminal" class="text-primary mb-3" style="width: 48px; height: 48px;"></i>
<h4>3. Run & Monitor</h4>
<p>We deploy your job, monitor its status, and stream logs and metrics back to you.</p>
</div>
</div>
</div>
<div class="text-center mt-5">
<img src="https://picsum.photos/seed/aperture-f2/800/600" class="img-fluid rounded-3 mt-4" alt="A dashboard showing cost savings and performance metrics">
</div>
</div>
</section>
</main>
<!-- Contact Section -->
<section id="contact" class="section">
<div class="container">
<div class="text-center col-lg-8 mx-auto">
<h2 class="mb-3">Get in Touch</h2>
<p class="lead text-muted">Have questions about pricing, features, or anything else? Our team is ready to answer all your questions.</p>
</div>
<div class="row justify-content-center mt-5">
<div class="col-lg-8">
<div class="feature-card">
<form id="contact-form">
<div class="row g-3">
<div class="col-md-6">
<label for="name" class="form-label">Full Name</label>
<input type="text" class="form-control" id="name" name="name" required>
</div>
<div class="col-md-6">
<label for="email" class="form-label">Email Address</label>
<input type="email" class="form-control" id="email" name="email" required>
</div>
<div class="col-12">
<label for="message" class="form-label">Message</label>
<textarea class="form-control" id="message" name="message" rows="5" required></textarea>
</div>
</div>
<button type="submit" class="btn btn-primary mt-4 w-100">Send Message</button>
</form>
<div id="contact-form-status" class="mt-3"></div>
<p class="text-muted small mt-3 text-center">
<strong>Note:</strong> This is for testing purposes only. Flatlogic does not guarantee usage of the mail server. Please set up your own SMTP in <code>.env</code>.
</p>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-md-6">
<p>&copy; <?php echo date("Y"); ?> Aperture, Inc. All rights reserved.</p>
</div>
<div class="col-md-6 text-md-end">
<a href="privacy.php" class="text-decoration-none me-3">Privacy Policy</a>
<a href="#" class="text-decoration-none">Terms of Service</a>
</div>
</div>
</div>
<footer>
Page updated: <?= htmlspecialchars($now) ?> (UTC)
</footer>
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
<script>
feather.replace()
</script>
</body>
</html>

View File

@ -1,88 +0,0 @@
<?php
require_once 'db/config.php';
session_start();
if (isset($_SESSION['user_id'])) {
header('Location: dashboard.php');
exit;
}
$error = '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$email = $_POST['email'] ?? '';
$password = $_POST['password'] ?? '';
if (empty($email) || empty($password)) {
$error = 'Please fill in all fields.';
} else {
try {
$pdo = db();
$stmt = $pdo->prepare("SELECT * FROM users WHERE email = ?");
$stmt->execute([$email]);
$user = $stmt->fetch();
if ($user && password_verify($password, $user['password'])) {
$_SESSION['user_id'] = $user['id'];
$_SESSION['username'] = $user['username'];
header('Location: dashboard.php');
exit;
} else {
$error = 'Invalid email or password.';
}
} catch (PDOException $e) {
$error = 'Database error: ' . $e->getMessage();
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - Aperture</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<header class="app-header">
<div class="container">
<div class="header-content">
<a href="index.php" class="logo">Aperture</a>
<nav class="main-nav">
<a href="index.php#features">Features</a>
<a href="index.php#contact">Contact</a>
<a href="register.php">Register</a>
</nav>
</div>
</div>
</header>
<main class="container page-section">
<section class="auth-form">
<h2>Login</h2>
<?php if ($error): ?>
<div class="form-message error-message"><?php echo $error; ?></div>
<?php endif; ?>
<form action="login.php" method="POST">
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" name="password" required>
</div>
<button type="submit" class="btn btn-primary">Login</button>
</form>
</section>
</main>
<footer class="app-footer">
<div class="container">
<p>&copy; <?php echo date('Y'); ?> Aperture. All rights reserved. | <a href="privacy.php">Privacy Policy</a></p>
</div>
</footer>
</body>
</html>

View File

@ -1,6 +0,0 @@
<?php
session_start();
session_unset();
session_destroy();
header('Location: index.php');
exit;

View File

@ -1,18 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Privacy Policy - Aperture</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css">
</head>
<body class="bg-dark text-light">
<div class="container py-5">
<h1 class="display-4">Privacy Policy</h1>
<p class="lead">This is a placeholder for the Privacy Policy.</p>
<p>Details about data collection, usage, and protection will be provided here.</p>
<a href="/" class="btn btn-primary">Go back home</a>
</div>
</body>
</html>

View File

@ -1,91 +0,0 @@
<?php
require_once 'db/config.php';
session_start();
$error = '';
$success = '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$username = $_POST['username'] ?? '';
$email = $_POST['email'] ?? '';
$password = $_POST['password'] ?? '';
if (empty($username) || empty($email) || empty($password)) {
$error = 'Please fill in all fields.';
} else {
try {
$pdo = db();
$stmt = $pdo->prepare("SELECT * FROM users WHERE username = ? OR email = ?");
$stmt->execute([$username, $email]);
if ($stmt->fetch()) {
$error = 'Username or email already exists.';
} else {
$hashed_password = password_hash($password, PASSWORD_DEFAULT);
$stmt = $pdo->prepare("INSERT INTO users (username, email, password) VALUES (?, ?, ?)");
$stmt->execute([$username, $email, $hashed_password]);
$success = 'Registration successful! You can now log in.';
}
} catch (PDOException $e) {
$error = 'Database error: ' . $e->getMessage();
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register - Aperture</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<header class="app-header">
<div class="container">
<div class="header-content">
<a href="index.php" class="logo">Aperture</a>
<nav class="main-nav">
<a href="index.php#features">Features</a>
<a href="index.php#contact">Contact</a>
<a href="login.php">Login</a>
</nav>
</div>
</div>
</header>
<main class="container page-section">
<section class="auth-form">
<h2>Create an Account</h2>
<?php if ($error): ?>
<div class="form-message error-message"><?php echo $error; ?></div>
<?php endif; ?>
<?php if ($success): ?>
<div class="form-message success-message"><?php echo $success; ?></div>
<?php endif; ?>
<form action="register.php" method="POST">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" name="password" required>
</div>
<button type="submit" class="btn btn-primary">Register</button>
</form>
</section>
</main>
<footer class="app-footer">
<div class="container">
<p>&copy; <?php echo date('Y'); ?> Aperture. All rights reserved. | <a href="privacy.php">Privacy Policy</a></p>
</div>
</footer>
</body>
</html>