application
This commit is contained in:
@@ -397,7 +397,7 @@ include __DIR__ . '/includes/header.php';
|
|||||||
<!-- ============================================================
|
<!-- ============================================================
|
||||||
8. FINAL CTA
|
8. FINAL CTA
|
||||||
============================================================= -->
|
============================================================= -->
|
||||||
<section class="about-cta" id="apply">
|
<!-- <section class="about-cta" id="apply">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="about-cta__inner reveal">
|
<div class="about-cta__inner reveal">
|
||||||
<span class="eyebrow about-eyebrow">Your next chapter</span>
|
<span class="eyebrow about-eyebrow">Your next chapter</span>
|
||||||
@@ -407,7 +407,7 @@ include __DIR__ . '/includes/header.php';
|
|||||||
practical learning path that feels right for you.
|
practical learning path that feels right for you.
|
||||||
</p>
|
</p>
|
||||||
<div class="about-cta__actions">
|
<div class="about-cta__actions">
|
||||||
<a class="btn btn--primary about-btn about-btn--primary" href="index.php#apply">
|
<a class="btn btn--primary about-btn about-btn--primary" href="application.php">
|
||||||
Apply Now
|
Apply Now
|
||||||
<span class="about-btn__arrow" aria-hidden="true"><?= icon('arrow-right') ?></span>
|
<span class="about-btn__arrow" aria-hidden="true"><?= icon('arrow-right') ?></span>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
+585
@@ -0,0 +1,585 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/includes/data.php';
|
||||||
|
|
||||||
|
if (session_status() === PHP_SESSION_NONE) {
|
||||||
|
session_start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Trim and remove control characters from submitted text.
|
||||||
|
*/
|
||||||
|
function application_clean($value): string
|
||||||
|
{
|
||||||
|
if (!is_string($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$value = trim($value);
|
||||||
|
return preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/u', '', $value) ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Keep spreadsheet software from treating a cell as a formula.
|
||||||
|
*/
|
||||||
|
function application_csv_value(string $value): string
|
||||||
|
{
|
||||||
|
if ($value !== '' && strpos('=+-@', $value[0]) !== false) {
|
||||||
|
return "'" . $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pageTitle = 'Apply Now | AI Institute';
|
||||||
|
$pageDescription = 'Submit your candidate dossier to apply for an AI Institute programme.';
|
||||||
|
$activePage = 'apply';
|
||||||
|
|
||||||
|
$genderOptions = ['Male', 'Female', 'Non-binary', 'Prefer not to say'];
|
||||||
|
$educationOptions = ['High School', 'Diploma', "Bachelor's", "Master's", 'PhD', 'Other'];
|
||||||
|
$sourceOptions = ['Search engine', 'Social media', 'Friend/Colleague', 'Advertisement', 'Event', 'Other'];
|
||||||
|
|
||||||
|
$courseOptions = [];
|
||||||
|
foreach ($courses as $courseOption) {
|
||||||
|
$courseOptions[] = [
|
||||||
|
'slug' => $courseOption['slug'] ?? '',
|
||||||
|
'title' => $courseOption['title'] ?? '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$courseSlugs = array_column($courseOptions, 'slug');
|
||||||
|
|
||||||
|
if (empty($_SESSION['application_csrf'])) {
|
||||||
|
$_SESSION['application_csrf'] = bin2hex(random_bytes(32));
|
||||||
|
}
|
||||||
|
$csrfToken = $_SESSION['application_csrf'];
|
||||||
|
|
||||||
|
$requestedCourse = application_clean($_GET['course'] ?? '');
|
||||||
|
|
||||||
|
$old = [
|
||||||
|
'full_name' => '',
|
||||||
|
'phone' => '',
|
||||||
|
'email' => '',
|
||||||
|
'age' => '',
|
||||||
|
'gender' => '',
|
||||||
|
'location' => '',
|
||||||
|
'education' => '',
|
||||||
|
'institution' => '',
|
||||||
|
'occupation' => '',
|
||||||
|
'course' => in_array($requestedCourse, $courseSlugs, true) ? $requestedCourse : '',
|
||||||
|
'ai_experience' => '',
|
||||||
|
'professional_experience' => '',
|
||||||
|
'skills' => '',
|
||||||
|
'career_goal' => '',
|
||||||
|
'source' => '',
|
||||||
|
'message' => '',
|
||||||
|
'terms' => '',
|
||||||
|
];
|
||||||
|
|
||||||
|
$errors = [];
|
||||||
|
$success = false;
|
||||||
|
|
||||||
|
if (($_SERVER['REQUEST_METHOD'] ?? '') === 'POST') {
|
||||||
|
$old = [
|
||||||
|
'full_name' => application_clean($_POST['full_name'] ?? ''),
|
||||||
|
'phone' => application_clean($_POST['phone'] ?? ''),
|
||||||
|
'email' => application_clean($_POST['email'] ?? ''),
|
||||||
|
'age' => application_clean($_POST['age'] ?? ''),
|
||||||
|
'gender' => application_clean($_POST['gender'] ?? ''),
|
||||||
|
'location' => application_clean($_POST['location'] ?? ''),
|
||||||
|
'education' => application_clean($_POST['education'] ?? ''),
|
||||||
|
'institution' => application_clean($_POST['institution'] ?? ''),
|
||||||
|
'occupation' => application_clean($_POST['occupation'] ?? ''),
|
||||||
|
'course' => application_clean($_POST['course'] ?? ''),
|
||||||
|
'ai_experience' => application_clean($_POST['ai_experience'] ?? ''),
|
||||||
|
'professional_experience' => application_clean($_POST['professional_experience'] ?? ''),
|
||||||
|
'skills' => application_clean($_POST['skills'] ?? ''),
|
||||||
|
'career_goal' => application_clean($_POST['career_goal'] ?? ''),
|
||||||
|
'source' => application_clean($_POST['source'] ?? ''),
|
||||||
|
'message' => application_clean($_POST['message'] ?? ''),
|
||||||
|
'terms' => isset($_POST['terms']) ? '1' : '',
|
||||||
|
];
|
||||||
|
|
||||||
|
$honeypot = application_clean($_POST['website'] ?? '');
|
||||||
|
$postedToken = is_string($_POST['csrf_token'] ?? null) ? $_POST['csrf_token'] : '';
|
||||||
|
|
||||||
|
if ($honeypot !== '') {
|
||||||
|
$success = true;
|
||||||
|
} elseif (!hash_equals($csrfToken, $postedToken)) {
|
||||||
|
$errors['form'] = 'Your session expired. Please review your details and submit the form again.';
|
||||||
|
} else {
|
||||||
|
if ($old['full_name'] === '') {
|
||||||
|
$errors['full_name'] = 'Please enter your full name.';
|
||||||
|
} elseif (strlen($old['full_name']) > 120) {
|
||||||
|
$errors['full_name'] = 'Please keep your full name under 120 characters.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$phoneDigits = preg_replace('/\D+/', '', $old['phone']);
|
||||||
|
if ($old['phone'] === '') {
|
||||||
|
$errors['phone'] = 'Please enter your phone number.';
|
||||||
|
} elseif (!preg_match('/^[0-9+\-()\s]+$/', $old['phone']) || strlen($phoneDigits) < 7) {
|
||||||
|
$errors['phone'] = 'Please enter a valid phone number with at least 7 digits.';
|
||||||
|
} elseif (strlen($phoneDigits) > 20) {
|
||||||
|
$errors['phone'] = 'Please enter a phone number with no more than 20 digits.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($old['email'] === '') {
|
||||||
|
$errors['email'] = 'Please enter your email address.';
|
||||||
|
} elseif (!filter_var($old['email'], FILTER_VALIDATE_EMAIL) || strlen($old['email']) > 254) {
|
||||||
|
$errors['email'] = 'Please enter a valid email address.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($old['age'] !== '') {
|
||||||
|
if (!ctype_digit($old['age']) || (int) $old['age'] < 16 || (int) $old['age'] > 100) {
|
||||||
|
$errors['age'] = 'Age must be a number between 16 and 100.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($old['gender'] !== '' && !in_array($old['gender'], $genderOptions, true)) {
|
||||||
|
$errors['gender'] = 'Please choose a valid gender option.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strlen($old['location']) > 150) {
|
||||||
|
$errors['location'] = 'Please keep your location under 150 characters.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($old['education'] !== '' && !in_array($old['education'], $educationOptions, true)) {
|
||||||
|
$errors['education'] = 'Please choose a valid education level.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strlen($old['institution']) > 160) {
|
||||||
|
$errors['institution'] = 'Please keep the institution name under 160 characters.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strlen($old['occupation']) > 160) {
|
||||||
|
$errors['occupation'] = 'Please keep your occupation under 160 characters.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($old['course'] !== '' && !in_array($old['course'], $courseSlugs, true)) {
|
||||||
|
$errors['course'] = 'Please choose a valid course track.';
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (['ai_experience', 'professional_experience', 'skills', 'career_goal', 'message'] as $longField) {
|
||||||
|
if (strlen($old[$longField]) > 5000) {
|
||||||
|
$errors[$longField] = 'Please keep this response under 5,000 characters.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($old['source'] !== '' && !in_array($old['source'], $sourceOptions, true)) {
|
||||||
|
$errors['source'] = 'Please choose a valid option.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($old['terms'] !== '1') {
|
||||||
|
$errors['terms'] = 'Please agree to the Terms to continue.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$errors) {
|
||||||
|
$storageDir = __DIR__ . '/storage';
|
||||||
|
$storageFile = $storageDir . '/applications.csv';
|
||||||
|
$saved = false;
|
||||||
|
|
||||||
|
if (!is_dir($storageDir)) {
|
||||||
|
@mkdir($storageDir, 0775, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$handle = @fopen($storageFile, 'a');
|
||||||
|
|
||||||
|
if ($handle !== false) {
|
||||||
|
if (flock($handle, LOCK_EX)) {
|
||||||
|
$isNewFile = ftell($handle) === 0;
|
||||||
|
|
||||||
|
if ($isNewFile) {
|
||||||
|
fputcsv($handle, [
|
||||||
|
'submitted_at',
|
||||||
|
'full_name',
|
||||||
|
'phone',
|
||||||
|
'email',
|
||||||
|
'age',
|
||||||
|
'gender',
|
||||||
|
'location',
|
||||||
|
'education',
|
||||||
|
'institution',
|
||||||
|
'occupation',
|
||||||
|
'course',
|
||||||
|
'ai_experience',
|
||||||
|
'professional_experience',
|
||||||
|
'skills',
|
||||||
|
'career_goal',
|
||||||
|
'source',
|
||||||
|
'message',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$row = [
|
||||||
|
date('c'),
|
||||||
|
$old['full_name'],
|
||||||
|
$old['phone'],
|
||||||
|
$old['email'],
|
||||||
|
$old['age'],
|
||||||
|
$old['gender'],
|
||||||
|
$old['location'],
|
||||||
|
$old['education'],
|
||||||
|
$old['institution'],
|
||||||
|
$old['occupation'],
|
||||||
|
$old['course'],
|
||||||
|
$old['ai_experience'],
|
||||||
|
$old['professional_experience'],
|
||||||
|
$old['skills'],
|
||||||
|
$old['career_goal'],
|
||||||
|
$old['source'],
|
||||||
|
$old['message'],
|
||||||
|
];
|
||||||
|
|
||||||
|
fputcsv($handle, array_map('application_csv_value', $row));
|
||||||
|
fflush($handle);
|
||||||
|
flock($handle, LOCK_UN);
|
||||||
|
$saved = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose($handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($saved) {
|
||||||
|
$success = true;
|
||||||
|
$old = array_fill_keys(array_keys($old), '');
|
||||||
|
unset($_SESSION['application_csrf']);
|
||||||
|
$_SESSION['application_csrf'] = bin2hex(random_bytes(32));
|
||||||
|
$csrfToken = $_SESSION['application_csrf'];
|
||||||
|
} else {
|
||||||
|
$errors['form'] = 'We could not save your application right now. Please try again in a moment.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
require __DIR__ . '/includes/header.php';
|
||||||
|
?>
|
||||||
|
<main id="main-content" class="application-page">
|
||||||
|
<div class="container">
|
||||||
|
<header class="application-header">
|
||||||
|
<h1 class="application-title">Apply Now</h1>
|
||||||
|
<p class="application-subtitle">Please complete all required fields below to submit your candidate dossier.</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section class="application-card" aria-labelledby="application-card-title">
|
||||||
|
<?php if ($success): ?>
|
||||||
|
<div class="application-success" role="status" aria-live="polite">
|
||||||
|
<span class="application-success__icon"><?= icon('check-circle') ?></span>
|
||||||
|
<h2 class="application-success__title" id="application-card-title">Thank you, your application has been submitted</h2>
|
||||||
|
<p class="application-success__text">Our admissions team will review your details and contact you using the information you provided.</p>
|
||||||
|
<a class="btn btn--primary" href="index.php">Back to Home <?= icon('arrow-right') ?></a>
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<h2 class="application-card__title" id="application-card-title">Applicant Details</h2>
|
||||||
|
|
||||||
|
<?php if (!empty($errors['form'])): ?>
|
||||||
|
<div class="application-alert application-alert--error" role="alert">
|
||||||
|
<?= e($errors['form']) ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<form class="application-form" method="post" novalidate>
|
||||||
|
<input type="hidden" name="csrf_token" value="<?= e($csrfToken) ?>">
|
||||||
|
<div class="application-hp" aria-hidden="true">
|
||||||
|
<label for="website">Website</label>
|
||||||
|
<input type="text" id="website" name="website" tabindex="-1" autocomplete="off">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['full_name']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="full-name">Full Name <span class="application-required" aria-hidden="true">*</span></label>
|
||||||
|
<input
|
||||||
|
class="application-input application-input--standalone"
|
||||||
|
id="full-name"
|
||||||
|
name="full_name"
|
||||||
|
type="text"
|
||||||
|
value="<?= e($old['full_name']) ?>"
|
||||||
|
placeholder="Full name"
|
||||||
|
autocomplete="name"
|
||||||
|
required
|
||||||
|
aria-required="true"
|
||||||
|
aria-invalid="<?= isset($errors['full_name']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="full-name-error"
|
||||||
|
>
|
||||||
|
<span class="application-error" id="full-name-error" data-error-for="full_name" aria-live="polite"><?= e($errors['full_name'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-row">
|
||||||
|
<div class="application-field<?= isset($errors['phone']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="phone">Phone Number <span class="application-required" aria-hidden="true">*</span></label>
|
||||||
|
<div class="application-control">
|
||||||
|
<span class="application-icon"><?= icon('phone') ?></span>
|
||||||
|
<input
|
||||||
|
class="application-input"
|
||||||
|
id="phone"
|
||||||
|
name="phone"
|
||||||
|
type="tel"
|
||||||
|
value="<?= e($old['phone']) ?>"
|
||||||
|
placeholder="+1 (555) 000-0000"
|
||||||
|
autocomplete="tel"
|
||||||
|
inputmode="tel"
|
||||||
|
required
|
||||||
|
aria-required="true"
|
||||||
|
aria-invalid="<?= isset($errors['phone']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="phone-error"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<span class="application-error" id="phone-error" data-error-for="phone" aria-live="polite"><?= e($errors['phone'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['email']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="email">Email <span class="application-required" aria-hidden="true">*</span></label>
|
||||||
|
<div class="application-control">
|
||||||
|
<span class="application-icon"><?= icon('mail') ?></span>
|
||||||
|
<input
|
||||||
|
class="application-input"
|
||||||
|
id="email"
|
||||||
|
name="email"
|
||||||
|
type="email"
|
||||||
|
value="<?= e($old['email']) ?>"
|
||||||
|
placeholder="name@example.com"
|
||||||
|
autocomplete="email"
|
||||||
|
required
|
||||||
|
aria-required="true"
|
||||||
|
aria-invalid="<?= isset($errors['email']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="email-error"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<span class="application-error" id="email-error" data-error-for="email" aria-live="polite"><?= e($errors['email'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-row">
|
||||||
|
<div class="application-field<?= isset($errors['age']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="age">Age</label>
|
||||||
|
<input
|
||||||
|
class="application-input application-input--standalone"
|
||||||
|
id="age"
|
||||||
|
name="age"
|
||||||
|
type="number"
|
||||||
|
min="16"
|
||||||
|
max="100"
|
||||||
|
value="<?= e($old['age']) ?>"
|
||||||
|
placeholder="e.g. 28"
|
||||||
|
inputmode="numeric"
|
||||||
|
aria-invalid="<?= isset($errors['age']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="age-error"
|
||||||
|
>
|
||||||
|
<span class="application-error" id="age-error" data-error-for="age" aria-live="polite"><?= e($errors['age'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['gender']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="gender">Gender – optional</label>
|
||||||
|
<select
|
||||||
|
class="application-select"
|
||||||
|
id="gender"
|
||||||
|
name="gender"
|
||||||
|
aria-invalid="<?= isset($errors['gender']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="gender-error"
|
||||||
|
>
|
||||||
|
<option value="">Select gender (optional)</option>
|
||||||
|
<?php foreach ($genderOptions as $gender): ?>
|
||||||
|
<option value="<?= e($gender) ?>"<?= $old['gender'] === $gender ? ' selected' : '' ?>><?= e($gender) ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<span class="application-error" id="gender-error" data-error-for="gender" aria-live="polite"><?= e($errors['gender'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['location']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="location">Location</label>
|
||||||
|
<div class="application-control">
|
||||||
|
<span class="application-icon"><?= icon('map-pin') ?></span>
|
||||||
|
<input
|
||||||
|
class="application-input"
|
||||||
|
id="location"
|
||||||
|
name="location"
|
||||||
|
type="text"
|
||||||
|
value="<?= e($old['location']) ?>"
|
||||||
|
placeholder="City, Country"
|
||||||
|
autocomplete="address-level2"
|
||||||
|
aria-invalid="<?= isset($errors['location']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="location-error"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<span class="application-error" id="location-error" data-error-for="location" aria-live="polite"><?= e($errors['location'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-row">
|
||||||
|
<div class="application-field<?= isset($errors['education']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="education">Highest education</label>
|
||||||
|
<select
|
||||||
|
class="application-select"
|
||||||
|
id="education"
|
||||||
|
name="education"
|
||||||
|
aria-invalid="<?= isset($errors['education']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="education-error"
|
||||||
|
>
|
||||||
|
<option value="">Select highest education</option>
|
||||||
|
<?php foreach ($educationOptions as $education): ?>
|
||||||
|
<option value="<?= e($education) ?>"<?= $old['education'] === $education ? ' selected' : '' ?>><?= e($education) ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<span class="application-error" id="education-error" data-error-for="education" aria-live="polite"><?= e($errors['education'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['institution']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="institution">Institution</label>
|
||||||
|
<input
|
||||||
|
class="application-input application-input--standalone"
|
||||||
|
id="institution"
|
||||||
|
name="institution"
|
||||||
|
type="text"
|
||||||
|
value="<?= e($old['institution']) ?>"
|
||||||
|
placeholder="University or institution name"
|
||||||
|
autocomplete="organization"
|
||||||
|
aria-invalid="<?= isset($errors['institution']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="institution-error"
|
||||||
|
>
|
||||||
|
<span class="application-error" id="institution-error" data-error-for="institution" aria-live="polite"><?= e($errors['institution'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['occupation']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="occupation">Current occupation</label>
|
||||||
|
<input
|
||||||
|
class="application-input application-input--standalone"
|
||||||
|
id="occupation"
|
||||||
|
name="occupation"
|
||||||
|
type="text"
|
||||||
|
value="<?= e($old['occupation']) ?>"
|
||||||
|
placeholder="e.g. Software Engineer, Researcher, Student"
|
||||||
|
autocomplete="organization-title"
|
||||||
|
aria-invalid="<?= isset($errors['occupation']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="occupation-error"
|
||||||
|
>
|
||||||
|
<span class="application-error" id="occupation-error" data-error-for="occupation" aria-live="polite"><?= e($errors['occupation'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['course']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="course">Course interested in</label>
|
||||||
|
<select
|
||||||
|
class="application-select"
|
||||||
|
id="course"
|
||||||
|
name="course"
|
||||||
|
aria-invalid="<?= isset($errors['course']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="course-error"
|
||||||
|
>
|
||||||
|
<option value="">Select course track</option>
|
||||||
|
<?php foreach ($courseOptions as $courseOption): ?>
|
||||||
|
<option value="<?= e($courseOption['slug']) ?>"<?= $old['course'] === $courseOption['slug'] ? ' selected' : '' ?>><?= e($courseOption['title']) ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<span class="application-error" id="course-error" data-error-for="course" aria-live="polite"><?= e($errors['course'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['ai_experience']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="ai-experience">Previous AI experience</label>
|
||||||
|
<textarea
|
||||||
|
class="application-textarea"
|
||||||
|
id="ai-experience"
|
||||||
|
name="ai_experience"
|
||||||
|
placeholder="Describe any previous experience with machine learning, neural networks, or AI research..."
|
||||||
|
aria-invalid="<?= isset($errors['ai_experience']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="ai-experience-error"
|
||||||
|
><?= e($old['ai_experience']) ?></textarea>
|
||||||
|
<span class="application-error" id="ai-experience-error" data-error-for="ai_experience" aria-live="polite"><?= e($errors['ai_experience'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['professional_experience']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="professional-experience">Professional experience</label>
|
||||||
|
<textarea
|
||||||
|
class="application-textarea"
|
||||||
|
id="professional-experience"
|
||||||
|
name="professional_experience"
|
||||||
|
placeholder="Overview of professional roles, projects, or work history..."
|
||||||
|
aria-invalid="<?= isset($errors['professional_experience']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="professional-experience-error"
|
||||||
|
><?= e($old['professional_experience']) ?></textarea>
|
||||||
|
<span class="application-error" id="professional-experience-error" data-error-for="professional_experience" aria-live="polite"><?= e($errors['professional_experience'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['skills']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="skills">Current skills</label>
|
||||||
|
<textarea
|
||||||
|
class="application-textarea"
|
||||||
|
id="skills"
|
||||||
|
name="skills"
|
||||||
|
placeholder="List programming languages, frameworks, toolkits (e.g. Python, PyTorch, CUDA, C++)..."
|
||||||
|
aria-invalid="<?= isset($errors['skills']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="skills-error"
|
||||||
|
><?= e($old['skills']) ?></textarea>
|
||||||
|
<span class="application-error" id="skills-error" data-error-for="skills" aria-live="polite"><?= e($errors['skills'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['career_goal']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="career-goal">Career goal</label>
|
||||||
|
<textarea
|
||||||
|
class="application-textarea"
|
||||||
|
id="career-goal"
|
||||||
|
name="career_goal"
|
||||||
|
placeholder="What are your career objectives and what do you aim to achieve after this course?"
|
||||||
|
aria-invalid="<?= isset($errors['career_goal']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="career-goal-error"
|
||||||
|
><?= e($old['career_goal']) ?></textarea>
|
||||||
|
<span class="application-error" id="career-goal-error" data-error-for="career_goal" aria-live="polite"><?= e($errors['career_goal'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['source']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="source">How did you hear about us?</label>
|
||||||
|
<select
|
||||||
|
class="application-select"
|
||||||
|
id="source"
|
||||||
|
name="source"
|
||||||
|
aria-invalid="<?= isset($errors['source']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="source-error"
|
||||||
|
>
|
||||||
|
<option value="">Select discovery channel</option>
|
||||||
|
<?php foreach ($sourceOptions as $source): ?>
|
||||||
|
<option value="<?= e($source) ?>"<?= $old['source'] === $source ? ' selected' : '' ?>><?= e($source) ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<span class="application-error" id="source-error" data-error-for="source" aria-live="polite"><?= e($errors['source'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field<?= isset($errors['message']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-label" for="message">Message / questions</label>
|
||||||
|
<textarea
|
||||||
|
class="application-textarea"
|
||||||
|
id="message"
|
||||||
|
name="message"
|
||||||
|
placeholder="Any additional questions, inquiries, or notes for the admissions team..."
|
||||||
|
aria-invalid="<?= isset($errors['message']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="message-error"
|
||||||
|
><?= e($old['message']) ?></textarea>
|
||||||
|
<span class="application-error" id="message-error" data-error-for="message" aria-live="polite"><?= e($errors['message'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-field application-field--check<?= isset($errors['terms']) ? ' has-error' : '' ?>">
|
||||||
|
<label class="application-check" for="terms">
|
||||||
|
<input
|
||||||
|
class="application-check__input"
|
||||||
|
id="terms"
|
||||||
|
name="terms"
|
||||||
|
type="checkbox"
|
||||||
|
value="1"
|
||||||
|
<?= $old['terms'] === '1' ? 'checked' : '' ?>
|
||||||
|
required
|
||||||
|
aria-required="true"
|
||||||
|
aria-invalid="<?= isset($errors['terms']) ? 'true' : 'false' ?>"
|
||||||
|
aria-describedby="terms-error"
|
||||||
|
>
|
||||||
|
<span class="application-check__label">I agree to the Terms and consent to application processing. <span class="application-required" aria-hidden="true">*</span></span>
|
||||||
|
</label>
|
||||||
|
<span class="application-error" id="terms-error" data-error-for="terms" aria-live="polite"><?= e($errors['terms'] ?? '') ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="application-actions">
|
||||||
|
<button class="btn btn--primary application-submit" type="submit">
|
||||||
|
<span class="application-submit__label">Submit Application</span>
|
||||||
|
<?= icon('arrow-right') ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<?php endif; ?>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<?php require __DIR__ . '/includes/footer.php'; ?>
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 14px 16px 16px;
|
padding: 14px 16px 16px;
|
||||||
background: linear-gradient(180deg, var(--card-top) 0%, var(--card-bottom) 100%);
|
background: linear-gradient(180deg, #c1d3da 0%, #9e6a6e 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.courses-page .course-card__tag {
|
.courses-page .course-card__tag {
|
||||||
|
|||||||
+404
-3
@@ -461,7 +461,7 @@ button {
|
|||||||
border-radius: var(--radius-pill);
|
border-radius: var(--radius-pill);
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
font-size: 14px;
|
font-size: 16px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
transition: color var(--transition), background-color var(--transition);
|
transition: color var(--transition), background-color var(--transition);
|
||||||
@@ -1299,7 +1299,7 @@ button {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 14px 16px 16px;
|
padding: 14px 16px 16px;
|
||||||
background: linear-gradient(180deg, var(--card-top) 0%, var(--card-bottom) 100%);
|
background: linear-gradient(180deg, #c1d3da 0%, #9e6a6e 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
#courses .course-card__tag {
|
#courses .course-card__tag {
|
||||||
@@ -1615,7 +1615,7 @@ button {
|
|||||||
margin: 26px 0 0;
|
margin: 26px 0 0;
|
||||||
color: var(--white);
|
color: var(--white);
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family: 'Roboto', sans-serif;
|
||||||
font-size: 10.5px;
|
font-size: 12px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@@ -6056,3 +6056,404 @@ button {
|
|||||||
transition: none !important;
|
transition: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
18. APPLICATION PAGE
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
.application-page {
|
||||||
|
position: relative;
|
||||||
|
padding: calc(var(--header-h) + 72px) 0 110px;
|
||||||
|
background:
|
||||||
|
radial-gradient(circle at 18% 0%, rgba(215, 38, 61, 0.12), transparent 42%),
|
||||||
|
radial-gradient(circle at 85% 20%, rgba(138, 138, 140, 0.08), transparent 38%),
|
||||||
|
var(--bg);
|
||||||
|
font-family: var(--font-main);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-header {
|
||||||
|
max-width: 700px;
|
||||||
|
margin: 0 auto 44px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-title {
|
||||||
|
color: var(--text);
|
||||||
|
font-size: clamp(34px, 5vw, 54px);
|
||||||
|
font-weight: 900;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
line-height: 1.08;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-subtitle {
|
||||||
|
margin-top: 14px;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-card {
|
||||||
|
max-width: 860px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 46px 48px 48px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: var(--radius-lg);
|
||||||
|
background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-card__title {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
color: var(--text);
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: -0.01em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-form {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
gap: 22px;
|
||||||
|
margin-bottom: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-field {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 9px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-form > .application-field {
|
||||||
|
margin-bottom: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-label {
|
||||||
|
color: var(--text);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-required {
|
||||||
|
color: #ff6b7d;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-input,
|
||||||
|
.application-select,
|
||||||
|
.application-textarea {
|
||||||
|
width: 100%;
|
||||||
|
padding: 14px 16px;
|
||||||
|
border: 1px solid var(--border-strong);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background-color: rgba(255, 255, 255, 0.045);
|
||||||
|
color: var(--text);
|
||||||
|
font-family: var(--font-main);
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.45;
|
||||||
|
transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
|
||||||
|
-webkit-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-input::placeholder,
|
||||||
|
.application-textarea::placeholder {
|
||||||
|
color: rgba(255, 255, 255, 0.36);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-input:hover,
|
||||||
|
.application-select:hover,
|
||||||
|
.application-textarea:hover {
|
||||||
|
border-color: rgba(255, 255, 255, 0.26);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-input:focus,
|
||||||
|
.application-select:focus,
|
||||||
|
.application-textarea:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: var(--accent);
|
||||||
|
background-color: rgba(255, 255, 255, 0.06);
|
||||||
|
box-shadow: 0 0 0 3px var(--accent-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-control {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-icon {
|
||||||
|
position: absolute;
|
||||||
|
left: 16px;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: var(--muted-2);
|
||||||
|
pointer-events: none;
|
||||||
|
transition: color var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-icon .icon {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-control .application-input {
|
||||||
|
padding-left: 46px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-control:focus-within .application-icon {
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-select {
|
||||||
|
padding-right: 44px;
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b5b5b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: right 16px center;
|
||||||
|
background-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-select option {
|
||||||
|
background-color: var(--bg-alt);
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-textarea {
|
||||||
|
min-height: 118px;
|
||||||
|
resize: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-error {
|
||||||
|
display: none;
|
||||||
|
color: #ff9aa6;
|
||||||
|
font-size: 12.5px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-field.has-error .application-error {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-field.has-error .application-input,
|
||||||
|
.application-field.has-error .application-select,
|
||||||
|
.application-field.has-error .application-textarea {
|
||||||
|
border-color: #ff5a6f;
|
||||||
|
background-color: rgba(215, 38, 61, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-field.has-error .application-input:focus,
|
||||||
|
.application-field.has-error .application-select:focus,
|
||||||
|
.application-field.has-error .application-textarea:focus {
|
||||||
|
box-shadow: 0 0 0 3px rgba(255, 90, 111, 0.16);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-field.has-error .application-icon {
|
||||||
|
color: #ff8b98;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-field--check {
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-check {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-check__input {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
margin: 2px 0 0;
|
||||||
|
flex: none;
|
||||||
|
border: 1px solid var(--border-strong);
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: rgba(255, 255, 255, 0.045);
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 12px;
|
||||||
|
transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
|
||||||
|
-webkit-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-check__input:checked {
|
||||||
|
border-color: var(--accent);
|
||||||
|
background-color: var(--accent);
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-check__input:focus-visible {
|
||||||
|
outline: none;
|
||||||
|
border-color: var(--accent);
|
||||||
|
box-shadow: 0 0 0 3px var(--accent-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-field.has-error .application-check__input {
|
||||||
|
border-color: #ff5a6f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-check__label {
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-actions {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-submit {
|
||||||
|
width: 100%;
|
||||||
|
padding: 17px 28px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-submit .icon {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-submit[disabled] {
|
||||||
|
opacity: 0.65;
|
||||||
|
cursor: wait;
|
||||||
|
transform: none;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-hp {
|
||||||
|
position: absolute !important;
|
||||||
|
left: -9999px !important;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-alert {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
padding: 14px 18px;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-alert--error {
|
||||||
|
border: 1px solid rgba(255, 90, 111, 0.45);
|
||||||
|
background: rgba(215, 38, 61, 0.12);
|
||||||
|
color: #ffb3bd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-success {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding: 22px 8px 8px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-success__icon {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 78px;
|
||||||
|
height: 78px;
|
||||||
|
margin-bottom: 22px;
|
||||||
|
border: 1px solid var(--accent-border);
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--accent-soft);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-success__icon .icon {
|
||||||
|
width: 38px;
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-success__title {
|
||||||
|
max-width: 560px;
|
||||||
|
color: var(--text);
|
||||||
|
font-size: clamp(23px, 3vw, 30px);
|
||||||
|
font-weight: 800;
|
||||||
|
letter-spacing: -0.01em;
|
||||||
|
line-height: 1.25;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-success__text {
|
||||||
|
max-width: 540px;
|
||||||
|
margin-top: 14px;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 1.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-success .btn {
|
||||||
|
margin-top: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.application-page {
|
||||||
|
padding: calc(var(--header-h) + 48px) 0 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-header {
|
||||||
|
margin-bottom: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-card {
|
||||||
|
padding: 30px 22px 32px;
|
||||||
|
border-radius: var(--radius-md);
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-row {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
gap: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-form > .application-field {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-input,
|
||||||
|
.application-select,
|
||||||
|
.application-textarea {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
.application-card {
|
||||||
|
padding: 26px 16px 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-card__title {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.application-submit {
|
||||||
|
padding: 16px 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.application-input,
|
||||||
|
.application-select,
|
||||||
|
.application-textarea,
|
||||||
|
.application-check__input,
|
||||||
|
.application-icon {
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1394,3 +1394,221 @@
|
|||||||
initCtaSections();
|
initCtaSections();
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
APPLICATION FORM VALIDATION
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
function initApplicationForm() {
|
||||||
|
var form = document.querySelector('.application-form');
|
||||||
|
|
||||||
|
if (!form) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var submitButton = form.querySelector('.application-submit');
|
||||||
|
var submitLabel = form.querySelector('.application-submit__label');
|
||||||
|
var originalLabel = submitLabel ? submitLabel.textContent : 'Submit Application';
|
||||||
|
|
||||||
|
var rules = {
|
||||||
|
full_name: function (input) {
|
||||||
|
var value = input.value.trim();
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
return 'Please enter your full name.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.length > 120) {
|
||||||
|
return 'Please keep your full name under 120 characters.';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
phone: function (input) {
|
||||||
|
var value = input.value.trim();
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
return 'Please enter your phone number.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!/^[0-9+\-()\s]+$/.test(value)) {
|
||||||
|
return 'Please enter a valid phone number.';
|
||||||
|
}
|
||||||
|
|
||||||
|
var digits = value.replace(/\D/g, '');
|
||||||
|
|
||||||
|
if (digits.length < 7) {
|
||||||
|
return 'Please enter a valid phone number with at least 7 digits.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (digits.length > 20) {
|
||||||
|
return 'Please enter a phone number with no more than 20 digits.';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
email: function (input) {
|
||||||
|
var value = input.value.trim();
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
return 'Please enter your email address.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.length > 254 || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
||||||
|
return 'Please enter a valid email address.';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
age: function (input) {
|
||||||
|
var value = input.value.trim();
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!/^\d+$/.test(value)) {
|
||||||
|
return 'Age must be a number between 16 and 100.';
|
||||||
|
}
|
||||||
|
|
||||||
|
var age = parseInt(value, 10);
|
||||||
|
|
||||||
|
if (age < 16 || age > 100) {
|
||||||
|
return 'Age must be a number between 16 and 100.';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
terms: function (input) {
|
||||||
|
if (!input.checked) {
|
||||||
|
return 'Please agree to the Terms to continue.';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function getField(input) {
|
||||||
|
return input ? input.closest('.application-field') : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setError(name, message) {
|
||||||
|
var input = form.querySelector('[name="' + name + '"]');
|
||||||
|
var field = getField(input);
|
||||||
|
var error = form.querySelector('[data-error-for="' + name + '"]');
|
||||||
|
|
||||||
|
if (field) {
|
||||||
|
field.classList.toggle('has-error', Boolean(message));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (input) {
|
||||||
|
input.setAttribute('aria-invalid', message ? 'true' : 'false');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
error.textContent = message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function validateField(input) {
|
||||||
|
var rule = rules[input.name];
|
||||||
|
|
||||||
|
if (!rule) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var message = rule(input);
|
||||||
|
setError(input.name, message);
|
||||||
|
|
||||||
|
return !message;
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.keys(rules).forEach(function (name) {
|
||||||
|
var input = form.querySelector('[name="' + name + '"]');
|
||||||
|
|
||||||
|
if (!input) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
input.addEventListener('blur', function () {
|
||||||
|
var field = getField(input);
|
||||||
|
|
||||||
|
if (field && (field.classList.contains('has-error') || input.value.trim() !== '')) {
|
||||||
|
validateField(input);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
input.addEventListener('input', function () {
|
||||||
|
var field = getField(input);
|
||||||
|
|
||||||
|
if (field && field.classList.contains('has-error')) {
|
||||||
|
validateField(input);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
input.addEventListener('change', function () {
|
||||||
|
var field = getField(input);
|
||||||
|
|
||||||
|
if (field && field.classList.contains('has-error')) {
|
||||||
|
validateField(input);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
var firstInvalid = null;
|
||||||
|
|
||||||
|
Object.keys(rules).forEach(function (name) {
|
||||||
|
var input = form.querySelector('[name="' + name + '"]');
|
||||||
|
|
||||||
|
if (!input) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!validateField(input) && !firstInvalid) {
|
||||||
|
firstInvalid = input;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (firstInvalid) {
|
||||||
|
event.preventDefault();
|
||||||
|
firstInvalid.focus();
|
||||||
|
|
||||||
|
if (firstInvalid.scrollIntoView) {
|
||||||
|
firstInvalid.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (submitButton) {
|
||||||
|
submitButton.disabled = true;
|
||||||
|
submitButton.setAttribute('aria-busy', 'true');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (submitLabel) {
|
||||||
|
submitLabel.textContent = 'Submitting...';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener('pageshow', function () {
|
||||||
|
if (submitButton) {
|
||||||
|
submitButton.disabled = false;
|
||||||
|
submitButton.removeAttribute('aria-busy');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (submitLabel) {
|
||||||
|
submitLabel.textContent = originalLabel;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.readyState === 'loading') {
|
||||||
|
document.addEventListener('DOMContentLoaded', initApplicationForm);
|
||||||
|
} else {
|
||||||
|
initApplicationForm();
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|||||||
+2
-2
@@ -123,7 +123,7 @@ include 'includes/header.php';
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a class="btn btn--primary camp__btn" href="index.php#apply">Apply Now</a>
|
<a class="btn btn--primary camp__btn" href="application.php">Apply Now</a>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
@@ -165,7 +165,7 @@ include 'includes/header.php';
|
|||||||
<h2 class="bc-cta__title">Not sure which bootcamp fits?</h2>
|
<h2 class="bc-cta__title">Not sure which bootcamp fits?</h2>
|
||||||
<p class="bc-cta__text">Tell an advisor what you want to do and we will point you to the right track.</p>
|
<p class="bc-cta__text">Tell an advisor what you want to do and we will point you to the right track.</p>
|
||||||
<div class="bc-cta__actions">
|
<div class="bc-cta__actions">
|
||||||
<a class="btn btn--primary" href="index.php#apply">Apply Now</a>
|
<a class="btn btn--primary" href="application.php">Apply Now</a>
|
||||||
<a class="btn btn--ghost" href="index.php#contact">Talk to an Advisor</a>
|
<a class="btn btn--ghost" href="index.php#contact">Talk to an Advisor</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-1
@@ -426,7 +426,7 @@ include __DIR__ . '/includes/header.php';
|
|||||||
practical learning path that feels right for you.
|
practical learning path that feels right for you.
|
||||||
</p>
|
</p>
|
||||||
<div class="cert-cta__actions">
|
<div class="cert-cta__actions">
|
||||||
<a class="btn btn--primary" href="index.php#apply">
|
<a class="btn btn--primary" href="application.php">
|
||||||
Apply Now
|
Apply Now
|
||||||
<span class="cert-btn-arrow__icon" aria-hidden="true"><?= icon('arrow-right') ?></span>
|
<span class="cert-btn-arrow__icon" aria-hidden="true"><?= icon('arrow-right') ?></span>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ $displayCourses = array_filter($courses, fn($c) => $c['category'] === 'ai-profes
|
|||||||
</div>
|
</div>
|
||||||
<div class="courses-cta__actions">
|
<div class="courses-cta__actions">
|
||||||
<a class="btn btn--light" href="index.php#contact">Talk to an Advisor</a>
|
<a class="btn btn--light" href="index.php#contact">Talk to an Advisor</a>
|
||||||
<a class="btn btn--primary" href="index.php#apply">Apply Now</a>
|
<a class="btn btn--primary" href="application.php">Apply Now</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
+1
-1
@@ -153,7 +153,7 @@ $audience = [
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="course-details__actions">
|
<div class="course-details__actions">
|
||||||
<a class="btn btn--primary" href="index.php#apply">Apply Now</a>
|
<a class="btn btn--primary" href="application.php?course=<?= urlencode($course['slug']) ?>">Apply Now</a>
|
||||||
<a class="btn btn--light" href="index.php#contact">Talk to an Advisor</a>
|
<a class="btn btn--light" href="index.php#contact">Talk to an Advisor</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ $displayCourses = array_filter($courses, fn($c) => $c['category'] === 'digital-m
|
|||||||
</div>
|
</div>
|
||||||
<div class="courses-cta__actions">
|
<div class="courses-cta__actions">
|
||||||
<a class="btn btn--light" href="index.php#contact">Talk to an Advisor</a>
|
<a class="btn btn--light" href="index.php#contact">Talk to an Advisor</a>
|
||||||
<a class="btn btn--primary" href="index.php#apply">Apply Now</a>
|
<a class="btn btn--primary" href="application.php">Apply Now</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ $displayCourses = array_filter($courses, fn($c) => $c['category'] === 'freelance
|
|||||||
</div>
|
</div>
|
||||||
<div class="courses-cta__actions">
|
<div class="courses-cta__actions">
|
||||||
<a class="btn btn--light" href="index.php#contact">Talk to an Advisor</a>
|
<a class="btn btn--light" href="index.php#contact">Talk to an Advisor</a>
|
||||||
<a class="btn btn--primary" href="index.php#apply">Apply Now</a>
|
<a class="btn btn--primary" href="application.php">Apply Now</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ include 'includes/header.php';
|
|||||||
</div>
|
</div>
|
||||||
<div class="courses-cta__actions">
|
<div class="courses-cta__actions">
|
||||||
<a class="btn btn--light" href="index.php#contact">Talk to an Advisor</a>
|
<a class="btn btn--light" href="index.php#contact">Talk to an Advisor</a>
|
||||||
<a class="btn btn--primary" href="index.php#apply">Apply Now</a>
|
<a class="btn btn--primary" href="application.php">Apply Now</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@
|
|||||||
<li><a href="index.php#projects">Resources</a></li>
|
<li><a href="index.php#projects">Resources</a></li>
|
||||||
<!-- TODO: no login page exists yet; update this link once one is available -->
|
<!-- TODO: no login page exists yet; update this link once one is available -->
|
||||||
<li><a href="#apply">Login</a></li>
|
<li><a href="#apply">Login</a></li>
|
||||||
<li><a href="index.php#apply">Apply Now</a></li>
|
<li><a href="application.php">Apply Now</a></li>
|
||||||
<li><a href="index.php#contact">Talk to an Advisor</a></li>
|
<li><a href="index.php#contact">Talk to an Advisor</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ $activePage = $activePage ?? 'home';
|
|||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="nav__actions">
|
<div class="nav__actions">
|
||||||
<a class="btn btn--primary btn--sm nav__cta" href="index.php#apply">Apply Now</a>
|
<a class="btn btn--primary btn--sm nav__cta" href="application.php">Apply Now</a>
|
||||||
<button class="nav-toggle" type="button" aria-expanded="false" aria-controls="primary-nav" aria-label="Open navigation menu">
|
<button class="nav-toggle" type="button" aria-expanded="false" aria-controls="primary-nav" aria-label="Open navigation menu">
|
||||||
<span class="nav-toggle__bar"></span>
|
<span class="nav-toggle__bar"></span>
|
||||||
<span class="nav-toggle__bar"></span>
|
<span class="nav-toggle__bar"></span>
|
||||||
|
|||||||
@@ -439,7 +439,7 @@ require __DIR__ . '/includes/header.php';
|
|||||||
Take the first step toward work that feels more capable, more creative and more yours.
|
Take the first step toward work that feels more capable, more creative and more yours.
|
||||||
</p>
|
</p>
|
||||||
<div class="cta__actions">
|
<div class="cta__actions">
|
||||||
<a class="btn btn--primary" href="#contact">Apply Now</a>
|
<a class="btn btn--primary" href="application.php">Apply Now</a>
|
||||||
<a class="btn btn--ghost" href="#contact">Talk to an Advisor</a>
|
<a class="btn btn--ghost" href="#contact">Talk to an Advisor</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-1
@@ -129,7 +129,7 @@ include 'includes/header.php';
|
|||||||
Talk to an advisor about which course gets you there, or apply today.
|
Talk to an advisor about which course gets you there, or apply today.
|
||||||
</p>
|
</p>
|
||||||
<div class="intern-cta__actions">
|
<div class="intern-cta__actions">
|
||||||
<a class="btn btn--primary" href="index.php#apply">Apply Now</a>
|
<a class="btn btn--primary" href="application.php">Apply Now</a>
|
||||||
<a class="btn btn--ghost" href="index.php#contact">Talk to an Advisor</a>
|
<a class="btn btn--ghost" href="index.php#contact">Talk to an Advisor</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user