herway
This commit is contained in:
parent
952205e132
commit
6461eb73ca
29
api/pexels.php
Normal file
29
api/pexels.php
Normal 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
33
includes/footer.php
Normal file
@ -0,0 +1,33 @@
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="py-4 bg-dark text-white">
|
||||
<div class="container text-center">
|
||||
<p>© <?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
50
includes/header.php
Normal 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
26
includes/pexels.php
Normal 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;
|
||||
}
|
||||
?>
|
||||
95
index.php
95
index.php
@ -1,53 +1,4 @@
|
||||
<?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="#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>
|
||||
<?php require_once 'includes/header.php'; ?>
|
||||
<!-- Hero Section -->
|
||||
<section class="hero-section text-center">
|
||||
<div class="container">
|
||||
@ -101,6 +52,16 @@
|
||||
</div>
|
||||
</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 -->
|
||||
<section id="about" class="py-5 bg-light">
|
||||
<div class="container">
|
||||
@ -125,36 +86,4 @@
|
||||
<a href="contact.php" class="btn btn-primary btn-lg">Contact Us</a>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="py-4 bg-dark text-white">
|
||||
<div class="container text-center">
|
||||
<p>© <?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>
|
||||
<?php require_once 'includes/footer.php'; ?>
|
||||
35
login.php
35
login.php
@ -1,7 +1,9 @@
|
||||
<?php
|
||||
session_start();
|
||||
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 (isset($_SESSION['user_id'])) {
|
||||
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="col-md-6">
|
||||
<div class="card">
|
||||
@ -91,12 +74,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="bg-light text-center py-4 mt-5">
|
||||
<p>© <?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>
|
||||
<?php require_once 'includes/footer.php'; ?>
|
||||
146
my-trips.php
146
my-trips.php
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'db/config.php';
|
||||
require_once 'includes/header.php';
|
||||
|
||||
// Redirect to login if user is not authenticated
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
@ -26,117 +26,53 @@ if (isset($_GET['status']) && $_GET['status'] === 'success') {
|
||||
$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 -->
|
||||
<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>
|
||||
<main class="py-5">
|
||||
<section id="my-trips" class="container">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="h2">My Planned Trips</h1>
|
||||
<a href="trip-setup.php" class="btn btn-primary">Plan a New Trip</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="py-5">
|
||||
<section id="my-trips" class="container">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<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)): ?>
|
||||
<div class="alert alert-success"><?php echo htmlspecialchars($success_message); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($success_message)): ?>
|
||||
<div class="alert alert-success"><?php echo htmlspecialchars($success_message); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($error_message)): ?>
|
||||
<div class="alert alert-danger"><?php echo htmlspecialchars($error_message); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($error_message)): ?>
|
||||
<div class="alert alert-danger"><?php echo htmlspecialchars($error_message); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php if (empty($trips)): ?>
|
||||
<p class="text-center text-muted">You have no planned trips yet.</p>
|
||||
<?php else: ?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-light">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php if (empty($trips)): ?>
|
||||
<p class="text-center text-muted">You have no planned trips yet.</p>
|
||||
<?php else: ?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Destination</th>
|
||||
<th>Date & Time</th>
|
||||
<th>Status</th>
|
||||
<th>Booked On</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($trips as $trip): ?>
|
||||
<tr>
|
||||
<th>Destination</th>
|
||||
<th>Date & Time</th>
|
||||
<th>Status</th>
|
||||
<th>Booked On</th>
|
||||
<td><?php echo htmlspecialchars($trip['destination']); ?></td>
|
||||
<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>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($trips as $trip): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($trip['destination']); ?></td>
|
||||
<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>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="py-4 bg-dark text-white">
|
||||
<div class="container text-center">
|
||||
<p>© <?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>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- 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>
|
||||
<?php require_once 'includes/footer.php'; ?>
|
||||
150
register.php
150
register.php
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
require_once 'includes/header.php';
|
||||
|
||||
$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 -->
|
||||
<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">
|
||||
<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; ?>
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link rel="stylesheet" href="assets/css/custom.css">
|
||||
</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>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="py-4 bg-dark text-white">
|
||||
<div class="container text-center">
|
||||
<p>© <?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>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- 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>
|
||||
<?php require_once 'includes/footer.php'; ?>
|
||||
118
trip-setup.php
118
trip-setup.php
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'db/config.php';
|
||||
require_once 'includes/header.php';
|
||||
|
||||
// Redirect to login if user is not authenticated
|
||||
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 -->
|
||||
<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>
|
||||
<main class="py-5">
|
||||
<section id="trip-setup" class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<div class="card p-4 p-md-5">
|
||||
<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="alert alert-danger"><?php echo htmlspecialchars($error_message); ?></div>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="py-5">
|
||||
<section id="trip-setup" class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<div class="card p-4 p-md-5">
|
||||
<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>
|
||||
<form action="trip-setup.php" method="post">
|
||||
<div class="mb-4">
|
||||
<label for="destination" class="form-label fs-5">Where are you going?</label>
|
||||
<input type="text" class="form-control form-control-lg" id="destination" name="destination" placeholder="e.g., 'Mumbai', 'Delhi Airport Terminal 3'" required>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($error_message)): ?>
|
||||
<div class="alert alert-danger"><?php echo htmlspecialchars($error_message); ?></div>
|
||||
<?php endif; ?>
|
||||
<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>
|
||||
|
||||
<form action="trip-setup.php" method="post">
|
||||
<div class="mb-4">
|
||||
<label for="destination" class="form-label fs-5">Where are you going?</label>
|
||||
<input type="text" class="form-control form-control-lg" id="destination" name="destination" placeholder="e.g., 'Mumbai', 'Delhi Airport Terminal 3'" required>
|
||||
</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 class="text-center mt-5">
|
||||
<button type="submit" class="btn btn-primary btn-lg px-5">Save Trip</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="py-4 bg-dark text-white">
|
||||
<div class="container text-center">
|
||||
<p>© <?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>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- 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>
|
||||
<?php require_once 'includes/footer.php'; ?>
|
||||
Loading…
x
Reference in New Issue
Block a user