191 lines
10 KiB
PHP
191 lines
10 KiB
PHP
<?php
|
|
require_once __DIR__ . '/mail/MailService.php';
|
|
|
|
$form_error = '';
|
|
$form_success = '';
|
|
|
|
// Form processing
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
// Sanitize and validate inputs
|
|
$company_name = filter_input(INPUT_POST, 'company_name', FILTER_SANITIZE_STRING);
|
|
$website = filter_input(INPUT_POST, 'website', FILTER_VALIDATE_URL);
|
|
$contact_name = filter_input(INPUT_POST, 'contact_name', FILTER_SANITIZE_STRING);
|
|
$contact_email = filter_input(INPUT_POST, 'contact_email', FILTER_VALIDATE_EMAIL);
|
|
$description = filter_input(INPUT_POST, 'description', FILTER_SANITIZE_STRING);
|
|
$reason = filter_input(INPUT_POST, 'reason', FILTER_SANITIZE_STRING);
|
|
$coc = filter_input(INPUT_POST, 'coc', FILTER_SANITIZE_STRING);
|
|
|
|
if (empty($company_name) || empty($contact_name) || empty($contact_email) || empty($description) || empty($coc)) {
|
|
$form_error = 'Please fill out all required fields and agree to the Code of Conduct.';
|
|
} elseif (!$contact_email) {
|
|
$form_error = 'Please provide a valid email address.';
|
|
} elseif ($website && !$website) {
|
|
$form_error = 'Please provide a valid website URL.';
|
|
} else {
|
|
// Prepare email content
|
|
$subject = "New Pavilion Application: {$company_name}";
|
|
$htmlBody = "
|
|
<h1>New Pavilion Application</h1>
|
|
<p>A new application has been submitted on the website.</p>
|
|
<ul>
|
|
<li><strong>Company Name:</strong> " . htmlspecialchars($company_name) . "</li>
|
|
<li><strong>Website:</strong> " . htmlspecialchars($website) . "</li>
|
|
<li><strong>Contact Name:</strong> " . htmlspecialchars($contact_name) . "</li>
|
|
<li><strong>Contact Email:</strong> " . htmlspecialchars($contact_email) . "</li>
|
|
<li><strong>Description:</strong><br>" . nl2br(htmlspecialchars($description)) . "</li>
|
|
<li><strong>Reason to Join:</strong><br>" . nl2br(htmlspecialchars($reason)) . "</li>
|
|
<li><strong>Agreed to CoC:</strong> Yes</li>
|
|
</ul>
|
|
<p>Please review and follow up with them.</p>
|
|
";
|
|
$textBody = "
|
|
New Pavilion Application
|
|
|
|
Company Name: {$company_name}
|
|
Website: {$website}
|
|
Contact Name: {$contact_name}
|
|
Contact Email: {$contact_email}
|
|
Description:
|
|
{$description}
|
|
|
|
Reason to Join:
|
|
{$reason}
|
|
|
|
Agreed to CoC: Yes
|
|
";
|
|
|
|
// Send email
|
|
$to = null; // Use MAIL_TO from .env
|
|
$options = ['reply_to' => $contact_email];
|
|
$result = MailService::sendMail($to, $subject, $htmlBody, $textBody, $options);
|
|
|
|
if (!empty($result['success'])) {
|
|
// Redirect to 'thanks' page on success
|
|
header("Location: thanks.php?from=apply");
|
|
exit;
|
|
} else {
|
|
// Log error and show a generic message
|
|
error_log("MailService Error: " . ($result['error'] ?? 'Unknown error'));
|
|
$form_error = 'Sorry, there was an error sending your application. Please try again later or contact us directly.';
|
|
}
|
|
}
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Apply to Join | Belarusians Worldwide</title>
|
|
<meta name="description" content="Apply to showcase your startup or project at the first Belarusian pavilion at Web Summit 2025.">
|
|
<meta name="robots" content="noindex, nofollow">
|
|
|
|
<!-- Fonts -->
|
|
<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=IBM+Plex+Sans:wght@400;500&family=Inter:wght@600;700&display=swap" rel="stylesheet">
|
|
|
|
<!-- Bootstrap CSS -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
|
|
|
<!-- Custom CSS -->
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
</head>
|
|
<body>
|
|
|
|
<header>
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
|
<div class="container">
|
|
<a class="navbar-brand fw-bold" href="/">Belarusians Worldwide</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="/#why">Why</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="sponsor.php">Sponsor</a></li>
|
|
<li class="nav-item"><a class="nav-link active" href="apply.php">Apply</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="volunteer.php">Volunteer</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="media.php">Media</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="container my-5">
|
|
<div class="row">
|
|
<div class="col-lg-8 mx-auto">
|
|
<h1 class="mb-4">Apply to Join the Pavilion</h1>
|
|
<p class="lead mb-5">We invite Belarusian startups, companies, and partners to apply to be showcased at our Web Summit pavilion. Fill out the form below, and our team will review your application and get in touch.</p>
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5 class="card-title mb-4">Application Form</h5>
|
|
<?php if ($form_error): ?>
|
|
<div class="alert alert-danger"><?php echo $form_error; ?></div>
|
|
<?php endif; ?>
|
|
<div class="alert alert-info small">
|
|
<p>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> (MAIL_/SMTP_ vars).</p>
|
|
<p class="mb-0">If you do not receive a confirmation, please check your spam folder.</p>
|
|
</div>
|
|
<form action="apply.php" method="POST">
|
|
<div class="row">
|
|
<div class="col-md-6 mb-3">
|
|
<label for="company_name" class="form-label">Company / Project Name</label>
|
|
<input type="text" class="form-control" id="company_name" name="company_name" required>
|
|
</div>
|
|
<div class="col-md-6 mb-3">
|
|
<label for="website" class="form-label">Website</label>
|
|
<input type="url" class="form-control" id="website" name="website" placeholder="https://example.com">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-6 mb-3">
|
|
<label for="contact_name" class="form-label">Contact Person</label>
|
|
<input type="text" class="form-control" id="contact_name" name="contact_name" required>
|
|
</div>
|
|
<div class="col-md-6 mb-3">
|
|
<label for="contact_email" class="form-label">Contact Email</label>
|
|
<input type="email" class="form-control" id="contact_email" name="contact_email" required>
|
|
</div>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="description" class="form-label">Short Description (1-2 sentences)</label>
|
|
<textarea class="form-control" id="description" name="description" rows="3" required></textarea>
|
|
<div class="form-text">What does your company/project do?</div>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="reason" class="form-label">Why do you want to join the pavilion?</label>
|
|
<textarea class="form-control" id="reason" name="reason" rows="3"></textarea>
|
|
<div class="form-text">What do you hope to achieve at Web Summit? (e.g., find investors, partners, talent)</div>
|
|
</div>
|
|
<div class="mb-3 form-check">
|
|
<input type="checkbox" class="form-check-input" id="coc" name="coc" value="1" required>
|
|
<label class="form-check-label" for="coc">I agree to the <a href="code-of-conduct.php" target="_blank">Code of Conduct</a>.</label>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary w-100">Submit Application</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<footer class="footer mt-5">
|
|
<div class="container text-center">
|
|
<p class="mb-1">© <?php echo date("Y"); ?> Belarusians Worldwide. A self-funded, non-state initiative.</p>
|
|
<ul class="list-inline">
|
|
<li class="list-inline-item"><a href="privacy.php">Privacy</a></li>
|
|
<li class="list-inline-item"><a href="code-of-conduct.php">Code of Conduct</a></li>
|
|
<li class="list-inline-item"><a href="media.php">Press</a></li>
|
|
</ul>
|
|
</div>
|
|
</footer>
|
|
|
|
<!-- Bootstrap JS -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
|
<!-- Custom JS -->
|
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
|
</body>
|
|
</html>
|