-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
123 lines (107 loc) · 4.62 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
# database
include("inc/db.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>HappyHolidayHome - Home</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="icon" type="image/x-icon" href="assets/img/logo.jpg">
<link rel="stylesheet" href="assets/css/index.css">
<link rel="stylesheet" href="assets/css/header.css">
<link rel="stylesheet" href="assets/css/footer.css">
<link rel="stylesheet" href="assets/css/responsive.css">
<script>
function validateDates() {
const checkInDate = new Date(document.forms["searchForm"]["checkIn"].value);
const checkOutDate = new Date(document.forms["searchForm"]["checkOut"].value);
if (checkInDate > checkOutDate) {
alert("Check-in date cannot be greater than the check-out date.");
return false;
}
return true;
}
</script>
</head>
<body>
<!-- Nav Bar -->
<header>
<nav class="navbar">
<div class="logo">
<a href="index.php">
<img src="assets/img/logo.jpg" alt="Logo" style="width: 30px; height: auto;">
</a>
</div>
<ul class="nav-links">
<?php if (isset($_SESSION['loggedin']) && $_SESSION['loggedin']) : ?>
<!-- Display this for logged-in users -->
<li><a href="index.php">Home</a></li>
<li><a href="users/about.php">About</a></li>
<li><a href="users/contact.php">Contact Us</a></li>
<li class="dropdown">
<span class="profile-info">
<img src="assets/img/user.png" alt="Profile Icon" class="profile-icon">
<?php echo $_SESSION['name']; ?>
</span>
<ul class="dropdown-content">
<li><a href="users/profile.php">My Profile</a></li>
<li><a href="users/reservations.php">My Reservations</a></li>
<li><a href="users/logout.php">Logout</a></li>
</ul>
</li>
<?php else : ?>
<!-- Display this for unregistered users -->
<li><a href="index.php">Home</a></li>
<li><a href="users/about.php">About</a></li>
<li><a href="users/contact.php">Contact Us</a></li>
<li><a href="users/login.php">Login</a></li>
<li><a href="users/signup.php">Sign Up</a></li>
<?php endif; ?>
</ul>
</nav>
</header>
<div class="container">
<form name="searchForm" action="users/search.php" method="GET" class="form" onsubmit="return validateDates();">
<label>Location:</label>
<input type="text" name="location" placeholder="Your Location" required>
<label>Check-In:</label>
<input type="date" name="checkIn" required>
<label>Check-Out:</label>
<input type="date" name="checkOut" required>
<button type="submit" name="search" class="btn btn-success">Search</button>
<button type="reset" name="reset" class="btn btn-danger">Reset</button>
</form>
</div>
<!-- Footer -->
<footer class="footer">
<div class="footer-content">
<a href="index.php">
<img src="assets/img/logo.jpg" alt="Logo" style="width: 100px; height: auto;">
</a>
<div class="footer-links">
<a href="index.php">Home</a>
<a href="users/about.php">About Us</a>
<a href="users/contact.php">Contact Us</a>
</div>
</div>
<div class="footer-info">
<p>HappyHolidayHome</p>
<br>
<p>Made with ❤️ by Adhiraj Saha</p>
<br>
<p>Connect with me on:</p>
<br>
<a href="https://www.linkedin.com/in/adhirajsaha" target="_blank" rel="noopener noreferrer">
<i class="fa-brands fa-2x fa-linkedin" style="color: #ffffff;"></i>
</a>
<a href="https://github.com/adhirajcs" target="_blank" rel="noopener noreferrer">
<i class="fa-brands fa-2x fa-github" style="color: #ffffff;"></i>
</a>
</div>
</footer>
</body>
</html>