This commit is contained in:
Flatlogic Bot 2025-10-09 15:53:22 +00:00
parent 952205e132
commit 6461eb73ca
9 changed files with 267 additions and 415 deletions

29
api/pexels.php Normal file
View File

@ -0,0 +1,29 @@
<?php
header('Content-Type: application/json');
require_once __DIR__.'/../includes/pexels.php';
$qs = isset($_GET['queries']) ? explode(',', $_GET['queries']) : ['woman travel','solo travel','night city','road trip','mountains'];
$out = [];
foreach ($qs as $q) {
$u = 'https://api.pexels.com/v1/search?query=' . urlencode(trim($q)) . '&orientation=portrait&per_page=1&page='.rand(1, 100);
$d = pexels_get($u);
if ($d && !empty($d['photos'])) {
$p = $d['photos'][0];
$src = $p['src']['large'] ?? null;
$dest = __DIR__.'/../assets/images/pexels/'.$p['id'].'.jpg';
if ($src) download_to($src, $dest);
$out[] = [
'src' => 'assets/images/pexels/'.$p['id'].'.jpg',
'photographer' => $p['photographer'] ?? 'Unknown',
'photographer_url' => $p['photographer_url'] ?? '',
];
} else {
// Fallback: Picsum
$out[] = [
'src' => 'https://picsum.photos/600/800',
'photographer' => 'Random Picsum',
'photographer_url' => 'https://picsum.photos/'
];
}
}
echo json_encode($out);
?>

33
includes/footer.php Normal file
View File

@ -0,0 +1,33 @@
</main>
<!-- Footer -->
<footer class="py-4 bg-dark text-white">
<div class="container text-center">
<p>&copy; <?php echo date("Y"); ?> HerWay. All Rights Reserved.</p>
<p>
<a href="#" class="text-white">Privacy Policy</a> |
<a href="#" class="text-white">Terms of Service</a>
</p>
</div>
</footer>
<!-- SOS Toast Notification -->
<div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
<div id="sosToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<strong class="me-auto text-danger"><i class="bi bi-exclamation-triangle-fill"></i> SOS Activated</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body">
Your emergency contacts have been notified and are receiving your live location.
</div>
</div>
</div>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js"></script>
</body>
</html>

50
includes/header.php Normal file
View File

@ -0,0 +1,50 @@
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HerWay - Travel Safe, Together</title>
<meta name="description" content="HerWay is a travel safety app for women, providing real-time connections, verified users, and safety features.">
<!-- Google Fonts: Poppins -->
<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=Poppins:wght@400;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">
<!-- Bootstrap Icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<!-- Header -->
<header class="navbar navbar-expand-lg navbar-light bg-light sticky-top">
<div class="container">
<a class="navbar-brand fw-bold" href="index.php">HerWay</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="index.php#features">Features</a></li>
<li class="nav-item"><a class="nav-link" href="index.php#about">About</a></li>
<li class="nav-item"><a class="nav-link" href="index.php#contact">Contact</a></li>
<?php if (isset($_SESSION['user_id'])): ?>
<li class="nav-item"><a class="nav-link" href="my-trips.php">My Trips</a></li>
<li class="nav-item"><a class="btn btn-outline-primary ms-lg-3" href="logout.php">Logout</a></li>
<?php else: ?>
<li class="nav-item"><a class="nav-link" href="login.php">Login</a></li>
<li class="nav-item"><a class="btn btn-primary ms-lg-3" href="register.php">Sign Up</a></li>
<?php endif; ?>
</ul>
</div>
</div>
</header>

26
includes/pexels.php Normal file
View File

@ -0,0 +1,26 @@
<?php
function pexels_key() {
$k = getenv('PEXELS_KEY');
return $k && strlen($k) > 0 ? $k : 'Vc99rnmOhHhJAbgGQoKLZtsaIVfkeownoQNbTj78VemUjKh08ZYRbf18';
}
function pexels_get($url) {
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Authorization: '. pexels_key() ],
CURLOPT_TIMEOUT => 15,
]);
$resp = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($code >= 200 && $code < 300 && $resp) return json_decode($resp, true);
return null;
}
function download_to($srcUrl, $destPath) {
$data = file_get_contents($srcUrl);
if ($data === false) return false;
if (!is_dir(dirname($destPath))) mkdir(dirname($destPath), 0775, true);
return file_put_contents($destPath, $data) !== false;
}
?>

View File

@ -1,53 +1,4 @@
<?php session_start(); ?> <?php require_once 'includes/header.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HerWay - Travel Safe, Together</title>
<meta name="description" content="HerWay is a travel safety app for women, providing real-time connections, verified users, and safety features.">
<!-- Google Fonts: Poppins -->
<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=Poppins:wght@400;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">
<!-- Bootstrap Icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<!-- Header -->
<header class="navbar navbar-expand-lg navbar-light bg-light sticky-top">
<div class="container">
<a class="navbar-brand fw-bold" href="index.php">HerWay</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="#about">About</a></li>
<li class="nav-item"><a class="nav-link" href="#contact">Contact</a></li>
<?php if (isset($_SESSION['user_id'])): ?>
<li class="nav-item"><a class="nav-link" href="my-trips.php">My Trips</a></li>
<li class="nav-item"><a class="btn btn-outline-primary ms-lg-3" href="logout.php">Logout</a></li>
<?php else: ?>
<li class="nav-item"><a class="nav-link" href="login.php">Login</a></li>
<li class="nav-item"><a class="btn btn-primary ms-lg-3" href="register.php">Sign Up</a></li>
<?php endif; ?>
</ul>
</div>
</div>
</header>
<main>
<!-- Hero Section --> <!-- Hero Section -->
<section class="hero-section text-center"> <section class="hero-section text-center">
<div class="container"> <div class="container">
@ -101,6 +52,16 @@
</div> </div>
</section> </section>
<!-- Inspiration Section -->
<section id="inspiration" class="py-5 bg-light">
<div class="container">
<h2 class="text-center mb-5">Inspiration for Your Next Journey</h2>
<div id="image-gallery" class="row g-4">
<!-- Images will be loaded here by JavaScript -->
</div>
</div>
</section>
<!-- About Section --> <!-- About Section -->
<section id="about" class="py-5 bg-light"> <section id="about" class="py-5 bg-light">
<div class="container"> <div class="container">
@ -125,36 +86,4 @@
<a href="contact.php" class="btn btn-primary btn-lg">Contact Us</a> <a href="contact.php" class="btn btn-primary btn-lg">Contact Us</a>
</div> </div>
</section> </section>
</main> <?php require_once 'includes/footer.php'; ?>
<!-- Footer -->
<footer class="py-4 bg-dark text-white">
<div class="container text-center">
<p>&copy; <?php echo date("Y"); ?> HerWay. All Rights Reserved.</p>
<p>
<a href="#" class="text-white">Privacy Policy</a> |
<a href="#" class="text-white">Terms of Service</a>
</p>
</div>
</footer>
<!-- SOS Toast Notification -->
<div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
<div id="sosToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<strong class="me-auto text-danger"><i class="bi bi-exclamation-triangle-fill"></i> SOS Activated</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body">
Your emergency contacts have been notified and are receiving your live location.
</div>
</div>
</div>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js"></script>
</body>
</html>

View File

@ -1,7 +1,9 @@
<?php <?php
session_start();
require_once 'db/config.php'; require_once 'db/config.php';
// The session is started in header.php
require_once 'includes/header.php';
// If user is already logged in, redirect to trip setup // If user is already logged in, redirect to trip setup
if (isset($_SESSION['user_id'])) { if (isset($_SESSION['user_id'])) {
header("Location: trip-setup.php"); header("Location: trip-setup.php");
@ -42,27 +44,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
} }
} }
?> ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - HerWay</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<header class="bg-light py-3">
<div class="container d-flex justify-content-between align-items-center">
<a href="index.php" class="h1 text-decoration-none" style="color: #E83E8C;">HerWay</a>
<nav>
<a href="login.php" class="btn btn-outline-primary me-2">Login</a>
<a href="register.php" class="btn btn-primary">Sign Up</a>
</nav>
</div>
</header>
<main class="container my-5"> <div class="container my-5">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-6"> <div class="col-md-6">
<div class="card"> <div class="card">
@ -91,12 +74,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</div> </div>
</div> </div>
</div> </div>
</main> </div>
<footer class="bg-light text-center py-4 mt-5"> <?php require_once 'includes/footer.php'; ?>
<p>&copy; <?php echo date("Y"); ?> HerWay. All rights reserved.</p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

View File

@ -1,6 +1,6 @@
<?php <?php
session_start();
require_once 'db/config.php'; require_once 'db/config.php';
require_once 'includes/header.php';
// Redirect to login if user is not authenticated // Redirect to login if user is not authenticated
if (!isset($_SESSION['user_id'])) { if (!isset($_SESSION['user_id'])) {
@ -26,117 +26,53 @@ if (isset($_GET['status']) && $_GET['status'] === 'success') {
$success_message = 'Your trip has been successfully saved!'; $success_message = 'Your trip has been successfully saved!';
} }
?> ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Trips - HerWay</title>
<meta name="description" content="View your planned trips on HerWay.">
<!-- Google Fonts: Poppins -->
<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=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
<!-- Bootstrap CSS --> <main class="py-5">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"> <section id="my-trips" class="container">
<div class="d-flex justify-content-between align-items-center mb-4">
<!-- Bootstrap Icons --> <h1 class="h2">My Planned Trips</h1>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"> <a href="trip-setup.php" class="btn btn-primary">Plan a New Trip</a>
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<!-- Header -->
<header class="navbar navbar-expand-lg navbar-light bg-light sticky-top">
<div class="container">
<a class="navbar-brand fw-bold" href="index.php">HerWay</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="index.php#features">Features</a></li>
<li class="nav-item"><a class="nav-link" href="index.php#about">About</a></li>
<li class="nav-item"><a class="nav-link" href="index.php#contact">Contact</a></li>
<?php if (isset($_SESSION['user_id'])): ?>
<li class="nav-item"><a class="nav-link" href="my-trips.php">My Trips</a></li>
<li class="nav-item"><a class="btn btn-outline-primary ms-lg-3" href="logout.php">Logout</a></li>
<?php else: ?>
<li class="nav-item"><a class="nav-link" href="login.php">Login</a></li>
<li class="nav-item"><a class="btn btn-primary ms-lg-3" href="register.php">Sign Up</a></li>
<?php endif; ?>
</ul>
</div>
</div> </div>
</header>
<main class="py-5"> <?php if (!empty($success_message)): ?>
<section id="my-trips" class="container"> <div class="alert alert-success"><?php echo htmlspecialchars($success_message); ?></div>
<div class="d-flex justify-content-between align-items-center mb-4"> <?php endif; ?>
<h1 class="h2">My Planned Trips</h1>
<a href="trip-setup.php" class="btn btn-primary">Plan a New Trip</a>
</div>
<?php if (!empty($success_message)): ?> <?php if (!empty($error_message)): ?>
<div class="alert alert-success"><?php echo htmlspecialchars($success_message); ?></div> <div class="alert alert-danger"><?php echo htmlspecialchars($error_message); ?></div>
<?php endif; ?> <?php endif; ?>
<?php if (!empty($error_message)): ?> <div class="card">
<div class="alert alert-danger"><?php echo htmlspecialchars($error_message); ?></div> <div class="card-body">
<?php endif; ?> <?php if (empty($trips)): ?>
<p class="text-center text-muted">You have no planned trips yet.</p>
<div class="card"> <?php else: ?>
<div class="card-body"> <div class="table-responsive">
<?php if (empty($trips)): ?> <table class="table table-striped table-hover">
<p class="text-center text-muted">You have no planned trips yet.</p> <thead class="table-light">
<?php else: ?> <tr>
<div class="table-responsive"> <th>Destination</th>
<table class="table table-striped table-hover"> <th>Date & Time</th>
<thead class="table-light"> <th>Status</th>
<th>Booked On</th>
</tr>
</thead>
<tbody>
<?php foreach ($trips as $trip): ?>
<tr> <tr>
<th>Destination</th> <td><?php echo htmlspecialchars($trip['destination']); ?></td>
<th>Date & Time</th> <td><?php echo htmlspecialchars(date('D, M j, Y, g:i A', strtotime($trip['trip_time']))); ?></td>
<th>Status</th> <td><span class="badge bg-primary"><?php echo htmlspecialchars(ucfirst($trip['status'])); ?></span></td>
<th>Booked On</th> <td><?php echo htmlspecialchars(date('M j, Y', strtotime($trip['created_at']))); ?></td>
</tr> </tr>
</thead> <?php endforeach; ?>
<tbody> </tbody>
<?php foreach ($trips as $trip): ?> </table>
<tr> </div>
<td><?php echo htmlspecialchars($trip['destination']); ?></td> <?php endif; ?>
<td><?php echo htmlspecialchars(date('D, M j, Y, g:i A', strtotime($trip['trip_time']))); ?></td>
<td><span class="badge bg-primary"><?php echo htmlspecialchars(ucfirst($trip['status'])); ?></span></td>
<td><?php echo htmlspecialchars(date('M j, Y', strtotime($trip['created_at']))); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
</div> </div>
</section>
</main>
<!-- Footer -->
<footer class="py-4 bg-dark text-white">
<div class="container text-center">
<p>&copy; <?php echo date("Y"); ?> HerWay. All Rights Reserved.</p>
<p>
<a href="#" class="text-white">Privacy Policy</a> |
<a href="#" class="text-white">Terms of Service</a>
</p>
</div> </div>
</footer> </section>
</main>
<!-- Bootstrap JS --> <?php require_once 'includes/footer.php'; ?>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js"></script>
</body>
</html>

View File

@ -1,6 +1,6 @@
<?php <?php
session_start();
require_once __DIR__ . '/db/config.php'; require_once __DIR__ . '/db/config.php';
require_once 'includes/header.php';
$errors = []; $errors = [];
@ -51,116 +51,52 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
} }
} }
?> ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register - HerWay</title>
<meta name="description" content="Create an account to join the HerWay community.">
<!-- Google Fonts: Poppins -->
<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=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
<!-- Bootstrap CSS --> <main class="py-5">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"> <section class="container">
<div class="row justify-content-center">
<!-- Bootstrap Icons --> <div class="col-lg-6">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"> <div class="card">
<div class="card-body p-5">
<h2 class="card-title text-center mb-4">Create Your Account</h2>
<?php if (!empty($errors)): ?>
<div class="alert alert-danger">
<?php foreach ($errors as $error): ?>
<p class="mb-0"><?php echo htmlspecialchars($error); ?></p>
<?php endforeach; ?>
</div>
<?php endif; ?>
<!-- Custom CSS --> <form action="register.php" method="POST">
<link rel="stylesheet" href="assets/css/custom.css"> <div class="mb-3">
</head> <label for="name" class="form-label">Full Name</label>
<body> <input type="text" class="form-control" id="name" name="name" required value="<?php echo isset($_POST['name']) ? htmlspecialchars($_POST['name']) : '' ?>">
</div>
<!-- Header --> <div class="mb-3">
<header class="navbar navbar-expand-lg navbar-light bg-light sticky-top"> <label for="email" class="form-label">Email address</label>
<div class="container"> <input type="email" class="form-control" id="email" name="email" required value="<?php echo isset($_POST['email']) ? htmlspecialchars($_POST['email']) : '' ?>">
<a class="navbar-brand fw-bold" href="index.php">HerWay</a> </div>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <div class="mb-3">
<span class="navbar-toggler-icon"></span> <label for="password" class="form-label">Password</label>
</button> <input type="password" class="form-control" id="password" name="password" required>
<div class="collapse navbar-collapse" id="navbarNav"> </div>
<ul class="navbar-nav ms-auto"> <div class="mb-3">
<li class="nav-item"><a class="nav-link" href="index.php#features">Features</a></li> <label for="confirm_password" class="form-label">Confirm Password</label>
<li class="nav-item"><a class="nav-link" href="index.php#about">About</a></li> <input type="password" class="form-control" id="confirm_password" name="confirm_password" required>
<li class="nav-item"><a class="nav-link" href="index.php#contact">Contact</a></li> </div>
<?php if (isset($_SESSION['user_id'])): ?> <div class="d-grid">
<li class="nav-item"><a class="nav-link" href="my-trips.php">My Trips</a></li> <button type="submit" class="btn btn-primary btn-lg">Register</button>
<li class="nav-item"><a class="btn btn-outline-primary ms-lg-3" href="logout.php">Logout</a></li> </div>
<?php else: ?> </form>
<li class="nav-item"><a class="nav-link" href="login.php">Login</a></li> <p class="text-center mt-4">
<li class="nav-item"><a class="btn btn-primary ms-lg-3" href="register.php">Sign Up</a></li> Already have an account? <a href="login.php">Log In</a>
<?php endif; ?> </p>
</ul>
</div>
</div>
</header>
<main class="py-5">
<section class="container">
<div class="row justify-content-center">
<div class="col-lg-6">
<div class="card">
<div class="card-body p-5">
<h2 class="card-title text-center mb-4">Create Your Account</h2>
<?php if (!empty($errors)): ?>
<div class="alert alert-danger">
<?php foreach ($errors as $error): ?>
<p class="mb-0"><?php echo htmlspecialchars($error); ?></p>
<?php endforeach; ?>
</div>
<?php endif; ?>
<form action="register.php" method="POST">
<div class="mb-3">
<label for="name" class="form-label">Full Name</label>
<input type="text" class="form-control" id="name" name="name" required value="<?php echo isset($_POST['name']) ? htmlspecialchars($_POST['name']) : '' ?>">
</div>
<div class="mb-3">
<label for="email" class="form-label">Email address</label>
<input type="email" class="form-control" id="email" name="email" required value="<?php echo isset($_POST['email']) ? htmlspecialchars($_POST['email']) : '' ?>">
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<div class="mb-3">
<label for="confirm_password" class="form-label">Confirm Password</label>
<input type="password" class="form-control" id="confirm_password" name="confirm_password" required>
</div>
<div class="d-grid">
<button type="submit" class="btn btn-primary btn-lg">Register</button>
</div>
</form>
<p class="text-center mt-4">
Already have an account? <a href="login.php">Log In</a>
</p>
</div>
</div> </div>
</div> </div>
</div> </div>
</section>
</main>
<!-- Footer -->
<footer class="py-4 bg-dark text-white">
<div class="container text-center">
<p>&copy; <?php echo date("Y"); ?> HerWay. All Rights Reserved.</p>
<p>
<a href="#" class="text-white">Privacy Policy</a> |
<a href="#" class="text-white">Terms of Service</a>
</p>
</div> </div>
</footer> </section>
</main>
<!-- Bootstrap JS --> <?php require_once 'includes/footer.php'; ?>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js"></script>
</body>
</html>

View File

@ -1,6 +1,6 @@
<?php <?php
session_start();
require_once 'db/config.php'; require_once 'db/config.php';
require_once 'includes/header.php';
// Redirect to login if user is not authenticated // Redirect to login if user is not authenticated
if (!isset($_SESSION['user_id'])) { if (!isset($_SESSION['user_id'])) {
@ -37,102 +37,38 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
} }
} }
?> ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Trip Setup - HerWay</title>
<meta name="description" content="Set up your trip and find safe travel companions with HerWay.">
<!-- Google Fonts: Poppins -->
<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=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
<!-- Bootstrap CSS --> <main class="py-5">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"> <section id="trip-setup" class="container">
<div class="row justify-content-center">
<!-- Bootstrap Icons --> <div class="col-lg-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"> <div class="card p-4 p-md-5">
<h1 class="text-center mb-4">Plan Your Trip</h1>
<!-- Custom CSS --> <p class="text-center text-muted mb-5">Enter your destination and travel time to find verified travel companions.</p>
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head> <?php if (!empty($error_message)): ?>
<body> <div class="alert alert-danger"><?php echo htmlspecialchars($error_message); ?></div>
<!-- Header -->
<header class="navbar navbar-expand-lg navbar-light bg-light sticky-top">
<div class="container">
<a class="navbar-brand fw-bold" href="index.php">HerWay</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="index.php#features">Features</a></li>
<li class="nav-item"><a class="nav-link" href="index.php#about">About</a></li>
<li class="nav-item"><a class="nav-link" href="index.php#contact">Contact</a></li>
<?php if (isset($_SESSION['user_id'])): ?>
<li class="nav-item"><a class="nav-link" href="my-trips.php">My Trips</a></li>
<li class="nav-item"><a class="btn btn-outline-primary ms-lg-3" href="logout.php">Logout</a></li>
<?php else: ?>
<li class="nav-item"><a class="nav-link" href="login.php">Login</a></li>
<li class="nav-item"><a class="btn btn-primary ms-lg-3" href="register.php">Sign Up</a></li>
<?php endif; ?> <?php endif; ?>
</ul>
</div>
</div>
</header>
<main class="py-5"> <form action="trip-setup.php" method="post">
<section id="trip-setup" class="container"> <div class="mb-4">
<div class="row justify-content-center"> <label for="destination" class="form-label fs-5">Where are you going?</label>
<div class="col-lg-8"> <input type="text" class="form-control form-control-lg" id="destination" name="destination" placeholder="e.g., 'Mumbai', 'Delhi Airport Terminal 3'" required>
<div class="card p-4 p-md-5"> </div>
<h1 class="text-center mb-4">Plan Your Trip</h1>
<p class="text-center text-muted mb-5">Enter your destination and travel time to find verified travel companions.</p>
<?php if (!empty($error_message)): ?> <div class="mb-4">
<div class="alert alert-danger"><?php echo htmlspecialchars($error_message); ?></div> <label for="trip_time" class="form-label fs-5">When are you traveling?</label>
<?php endif; ?> <input type="datetime-local" class="form-control form-control-lg" id="trip_time" name="trip_time" required>
</div>
<form action="trip-setup.php" method="post"> <div class="text-center mt-5">
<div class="mb-4"> <button type="submit" class="btn btn-primary btn-lg px-5">Save Trip</button>
<label for="destination" class="form-label fs-5">Where are you going?</label> </div>
<input type="text" class="form-control form-control-lg" id="destination" name="destination" placeholder="e.g., 'Mumbai', 'Delhi Airport Terminal 3'" required> </form>
</div>
<div class="mb-4">
<label for="trip_time" class="form-label fs-5">When are you traveling?</label>
<input type="datetime-local" class="form-control form-control-lg" id="trip_time" name="trip_time" required>
</div>
<div class="text-center mt-5">
<button type="submit" class="btn btn-primary btn-lg px-5">Save Trip</button>
</div>
</form>
</div>
</div> </div>
</div> </div>
</section>
</main>
<!-- Footer -->
<footer class="py-4 bg-dark text-white">
<div class="container text-center">
<p>&copy; <?php echo date("Y"); ?> HerWay. All Rights Reserved.</p>
<p>
<a href="#" class="text-white">Privacy Policy</a> |
<a href="#" class="text-white">Terms of Service</a>
</p>
</div> </div>
</footer> </section>
</main>
<!-- Bootstrap JS --> <?php require_once 'includes/footer.php'; ?>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js"></script>
</body>
</html>