Web Development
Web Development
Home
The homepage consists of multiple sections. One section features a header with
navigation links to "Home," "About," "Menu," "Events," "Table Reservation," and
"Login." Another section prominently displays the "New Menu" with an image. There is
also a section that describes the outdoor cafe with an
accompanying image, and another section that
highlights the indoor restaurant with its
corresponding image. Lastly, there is a section
showcasing "New Deals This Week" with three image
placeholders. This layout effectively highlights the
new menu and showcases the variety of dining
options, guiding the user's attention towards the main
elements of the cafe.
About
The design ensures visible balance and gives off a tidy, orderly image. A clear hierarchy
of information is created by breaking the page up
into several sections. The top part is occupied by a
header and is probably meant to hold a hero
picture or other notable piece of information.
Below this, a grid of uniformly sized boxes or
placeholders divides the page, indicating a
modular approach to content layout. This grid
design allows for flexibility in the arrangement of
material and can be adjusted to fit various screen
sizes. Overall, the diagram places a high value on
informational efficiency and visual clarity.
Menu
Simplifying the process of viewing meal selections is a prominent area for menu
categories that are followed by a clear header with necessary navigation links. A search
bar improves the user experience by making item searches more effective. A visually
appealing and well-organized presentation of menu items or promotional content, maybe
augmented with photos, is provided by the content area's grid structure. The general
layout places a premium on user-friendliness and draws attention to the cafe's menu.
Cart
At the top of the page, you will find the heading "Your Cart." Below this heading, there
are two sections, each representing different items in the cart. In each section, there is a
space for the product name, a placeholder for the product image, and a button labeled
"btn" which serves as an Remove option. To proceed to the payment process, users can
simply click the "Checkout" button prominently displayed at the bottom of the page. This
design simplifies the checkout process by incorporating clear design, straightforward text,
and easily clickable buttons, which makes it more user-friendly.
Events
The top of the page has the obvious header "Upcoming Events." Three rectangular boxes,
one for each distinct occurrence, are piled vertically below. The upper part of each box
has placeholder text that is probably meant to contain information about the event,
including the name, date, and time. A call-to-action or button is suggested by a shorter
placeholder at the bottom, possibly for event registration or other information. Users may
quickly scan and identify events of interest thanks to this framework, which offers a clear
and organized overview of future activities.
Reservation
The form, requests the customer's name, reservation date, reservation time, and mobile
number. At the bottom, there is a prominent "Reserve" button that encourages users to
submit their reservation request. The design emphasizes a user-friendly experience for
clients making bookings, featuring a simple and uncomplicated style.
Profile
The user can modify their name, email address, and password in areas on this box-shaped
page. There's also an image placeholder (img) that's probably meant to be a profile photo.
It is surprising to find a "Reservation Time" column on an edit profile page; this could be
a symptom of a mistake in the design or possible user confusion. Additionally
inappropriate in this context is the bottom "Reserve" button, which belongs on a page for
reservations. Although the general design is straightforward, the functioning is unclear.
Login
The design is sleek and user-friendly. The form comprises clear input fields for the user's
name, email, password, and image, each appropriately labeled. The image section
features a file upload button and a preview area. The prominently displayed "Edit Profile"
title conveys the page's purpose with clarity. Employing a consistent color scheme and
simple typography, the overall design adheres to modern design principles, providing an
attractive and functional user experience.
Register
Users can input their personal details into designated fields on the
form, contained within a box. Placeholder text is used to indicate the
fields, with common examples including name, email, password, and
contact details. At the bottom of the form, there is a prominent
"Register Now" button encouraging users to complete their
registration. The design prioritizes simplicity, aiming to streamline the
account creation process for new users. The form is organized
vertically, with the registration button and input fields at the bottom
and the title at the top, offering a straightforward and user-friendly
structure.
Admin
The webpage greets the admin with a personalized message, "Hello,
Admin Welcome," and features five horizontally arranged "btn" buttons
below. These buttons grant access to different sections of the
dashboard. The design is intentionally minimalistic, focusing on
providing easy access to essential administrative functions.The
webpage greets the admin with a personalized message, "Hello, Admin
Welcome," and features five horizontally arranged "btn" buttons below.
These buttons grant access to different sections of the dashboard. The
design is intentionally minimalistic, focusing on providing easy access
to essential administrative functions..
Staff
The employee welcome page features a simple and minimalistic design with a clear
greeting, "Hello, Staff Welcome," positioned at the center. Below the greeting are three
"btn" buttons, corresponding to different sections or tasks accessible to the staff. The
overall layout prioritizes providing a concise welcome message and uncomplicated
navigation options.
Menu Admin
The page presents a user-friendly interface for managing and viewing menu items.
Seamless updates are facilitated by incorporating a form for adding new menu items,
which includes essential fields such as name, description, price, and image. Additionally,
the existing menu items are presented in a tabular format, offering a clear overview of the
menu and simplifying the identification and management of each item through potential
edit or delete operations.
Staff Admin
The wireframe's admin dashboard includes a straightforward user management
component that provides an intuitive interface for both managing existing user accounts
and adding new ones. The table format presents a concise overview of current user
details, while the form for adding new users includes all the necessary fields for user
information. Administrators have the ability to add or remove user accounts as needed,
thanks to the inclusion of edit and delete buttons in the user table.
Manage Reservations
The wireframe displays a reservation management section on the admin dashboard,
presenting a user-friendly interface for viewing reservation details. The page features a
"Refresh" button for updating the displayed data. Below the button, a table is presented,
showing the current reservations with columns for ID, Name, Mobile Number, Date,
Time, and Actions. Although the table is currently empty, it is designed to accommodate
multiple reservation entries. The "Actions" column allows for individual booking
management, including modifying, canceling, or confirming reservations. Overall, the
design is straightforward and focuses on providing a comprehensive overview of
reservations, facilitating efficient administration by the staff and admin.
Manage Orders
This page displays a section of the admin dashboard dedicated to managing customer
orders. The "Manage Orders" page features a user-friendly interface for accessing order
details. Below the title, a table is presented, listing current orders and including columns
for Order ID, Item ID, Quantity, Order Date, and Actions. Although the table is currently
empty, it can accommodate numerous order entries.The order management options, such
as viewing order information, updating order status, and canceling orders, are available
under the "Actions" column. The design is straightforward, aiming to provide a
comprehensive overview of orders and facilitate efficient administration by the staff and
admin.
Home – The main page of the website. Offers quick links to all the all the sections of the
website and gives information about the latest deals.
About – Gives information about the restaurant and a photo gallery.
Menu – Restaurant menu with different cuisine selection allowing users to select and
search food items by the cuisine and the item name.
Events – Gives information about all the upcoming events.
Reserve Table – Easy way for the user to reserve a table.
Profile – Gives user the option to edit their user account data.
Task 2
a)
Home
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>The Gallery Café</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="Style.css">
<link rel="stylesheet"
href="https://unpkg.com/boxicons@latest/css/boxicons.min.css">
<div class="home-img">
<img src="img/home.png">
</div>
</section>
<div class="cafe-text">
<span>The Café</span>
<h2>An Outdoor Café <br> By The Ocean With A Scenic <br>
View</h2>
<p>
The Gallery Café is a neighborhood restaurant founded in 2009
by Danny Meyer.
Today, helmed by Executive Chef Lena Ciardullo, it remains
one of Colombo’s most essential restaurants.
Our menu draws inspiration from the Union Square Greenmarket
and the experience is
centered around warmth, comfort, celebration, and
hospitality. At Union Square Cafe, you will always
find a place to call home.
</p>
<a href="menu.php?cuisine=Drinks" class="btn">Brew</a>
</div>
</section>
<div class="rest-img">
<img src="img/rest.jpg">
</div>
</section>
<div class="menu-container">
<div class="box">
<div class="box-img">
<img src="img/family.png">
</div>
<h2>King Biriyani</h2>
<h3>Family Size</h3>
<i class='bx bx-purchase-tag-alt'></i>
<span>Rs.5500</span>
</div>
<div class="box">
<div class="box-img">
<img src="img/pizza.png">
</div>
<h2>Super Pizza</h2>
<h3>Family Size</h3>
<i class='bx bx-purchase-tag-alt'></i>
<span>Rs.4800</span>
</div>
<div class="box">
<div class="box-img">
<img src="img/dimsum.png">
</div>
<h2>Dim-Sum</h2>
<h3>Family Size</h3>
<i class='bx bx-purchase-tag-alt'></i>
<span>Rs.3200</span>
</div>
</div>
</section>
<section id="contact">
<div class="footer">
<div class="main">
<div class="col">
<h4>Menu Links</h4>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Menu</a></li>
<li><a href="#">Deals</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div class="col">
<h4>Information</h4>
<ul>
<li><a href="#">About Us</a></li>
<li><a href="#">Reservation Information</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Terms & Conditions</a></li>
</ul>
</div>
<div class="col">
<h4>Access Website</h4>
<ul>
<li><a href="adminLogin.php">Admin</a></li>
<li><a href="staffLogin.php">Staff</a></li>
</ul>
</div>
<div class="col">
<h4>Contact Us</h4>
<div class="social">
<a href="#"><i class='bx bxl-facebook'></i></a>
<a href="#"><i class='bx bxl-instagram' ></i></a>
<a href="#"><i class='bx bxl-twitter'></i></a>
<a href="#"><i class='bx bxl-youtube' ></i></a>
</div>
</div>
</div>
</div>
</section>
<div class="about-text">
<span>About Us</span>
<h2>We Serve Authentic <br> Sri Lankan, Chinese and Italian <br>
Food</h2>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting
industry.
Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s,
when an unknown printer took a galley of type and scrambled it to
make a type specimen book.
</p>
<a href="loginForm.php" class="btn">Reserve Table</a>
</div>
</section>
<div class="row">
<div class="column">
<img src="img/image container/1.jpg">
<img src="img/image container/2.jpg">
<img src="img/image container/3.jpg">
</div>
<div class="column">
<img src="img/image container/4.jpg">
<img src="img/image container/5.jpg">
<img src="img/image container/6.jpg">
</div>
<div class="column">
<img src="img/image container/7.jpg">
<img src="img/image container/8.jpg">
<img src="img/image container/9.jpg">
</div>
<div class="column">
<img src="img/image container/10.jpg">
<img src="img/image container/11.jpg">
<img src="img/image container/12.jpg">
</div>
</div>
<section id="contact">
<div class="footer">
<div class="main">
<div class="col">
<h4>Menu Links</h4>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Menu</a></li>
<li><a href="#">Deals</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div class="col">
<h4>Information</h4>
<ul>
<li><a href="#">About Us</a></li>
<li><a href="#">Reservation Information</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Terms & Conditions</a></li>
</ul>
</div>
<div class="col">
<h4>Contact Us</h4>
<div class="social">
<a href="#"><i class='bx bxl-facebook'></i></a>
<a href="#"><i class='bx bxl-instagram' ></i></a>
<a href="#"><i class='bx bxl-twitter'></i></a>
<a href="#"><i class='bx bxl-youtube' ></i></a>
</div>
</div>
</div>
</div>
</section>
<script type="text/javascript" src="about.js"></script>
<script type="text/javascript" src="index.js"></script>
</body>
</html>
Menu
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="menu.css">
<link rel="stylesheet"
href="https://unpkg.com/boxicons@latest/css/boxicons.min.css">
<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@100;200;300;400;500;6
00;700;800;900&display=swap" rel="stylesheet">
<title>Menu</title>
</head>
<body>
<header>
<a href="#" class="logo">The Gallery Café</a>
<div class="hamburger">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</div>
<nav class="nav-bar">
<ul>
<li><a href="Index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="menu.php" class="active">Menu</a></li>
<li><a href="events.html">Events</a></li>
<li><a href="loginForm.php">Reserve Table</a></li>
<li><a href="loginForm.php" class="btn">Login</a></li>
</ul>
</nav>
</header>
<section class="menu" id="menu">
<div class="heading">
<div class="button-search-container">
<a href="menu.php?cuisine=Sri Lankan" class="btn">Sri Lankan</a>
<a href="menu.php?cuisine=Chinese" class="btn">Chinese</a>
<a href="menu.php?cuisine=Italian" class="btn">Italian</a>
<a href="menu.php?cuisine=Drinks" class="btn">Drinks</a>
<form id="search-form" action="menu.php" method="GET">
<input type="text" id="search-input" name="search"
placeholder="Search food items or cuisines...">
<button type="submit">Search</button>
</form>
<a href="loginForm.php"><i class='bx bx-cart btn'></i></a>
</div>
</div>
<div class="menu-container">
<?php while ($row = $result->fetch_assoc()): ?>
<div class="box">
<div class="box-img">
<img src="<?php echo $row['image']; ?>" alt="<?php echo
$row['name']; ?>">
</div>
<h2><?php echo $row['name']; ?></h2>
<h3><?php echo $row['description']; ?></h3>
<i class='bx bx-purchase-tag-alt'></i>
<span>Rs.<?php echo $row['price']; ?></span>
<form action="cart.php" method="POST">
<input type="hidden" name="item_id" value="<?php echo
$row['id']; ?>">
<input type="hidden" name="action" value="add_to_cart">
<button type="submit" class="abtn">Add to Cart</button>
</form>
</div>
<?php endwhile; ?>
</div>
</section>
<section id="contact">
<div class="footer">
<div class="main">
<div class="col">
<h4>Menu Links</h4>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Menu</a></li>
<li><a href="#">Deals</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div class="col">
<h4>Information</h4>
<ul>
<li><a href="#">About Us</a></li>
<li><a href="#">Reservation Information</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Terms & Conditions</a></li>
</ul>
</div>
<div class="col">
<h4>Contact Us</h4>
<div class="social">
<a href="#"><i class='bx bxl-facebook'></i></a>
<a href="#"><i class='bx bxl-instagram'></i></a>
<a href="#"><i class='bx bxl-twitter'></i></a>
<a href="#"><i class='bx bxl-youtube'></i></a>
</div>
</div>
</div>
</div>
</section>
<script type="text/javascript" src="menu.js"></script>
</body>
</html>
Cart
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="cartStyle.css">
<title>Cart</title>
</head>
<body>
<header>
<a href="#" class="logo">The Gallery Café</a>
<div class="nav-bar">
<ul>
<li><a href="Index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="menuUsr.php">Menu</a></li>
<li><a href="#">Events</a></li>
<li><a href="#">Reserve Table</a></li>
<li><a href="loginForm.php" class="btn">Login</a></li>
</ul>
</div>
</header>
<section class="cart">
<h1>Your Cart</h1>
<div class="cart-container">
<?php
if (!isset($_SESSION['cart']) || empty($_SESSION['cart'])) {
echo "<p>Your cart is empty.</p>";
} else {
foreach ($_SESSION['cart'] as $item) {
if (is_array($item)) {
echo '<div class="cart-item">
<div class="cart-img">
<img src="' . htmlspecialchars($item['image']) .
'" alt="' . htmlspecialchars($item['name']) . '">
</div>
<div class="cart-details">
<h2>' . htmlspecialchars($item['name']) . '</h2>
<span>Rs.' . htmlspecialchars($item['price']) .
'</span>
</div>
<form class="remove-item-form" action="cart.php"
method="POST">
<input type="hidden" name="action"
value="remove_from_cart">
<input type="hidden" name="item_id" value="' .
htmlspecialchars($item['id']) . '">
<button type="submit" class="remove-
btn">Remove</button>
</form>
</div>';
}
}
}
?>
</div>
<a href="checkout.php" class="checkout-btn">Checkout</a>
</section>
<footer>
<div class="main">
<div class="col">
<h4>Menu Links</h4>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Menu</a></li>
<li><a href="#">Deals</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div class="col">
<h4>Information</h4>
<ul>
<li><a href="#">About Us</a></li>
<li><a href="#">Reservation Information</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Terms & Conditions</a></li>
</ul>
</div>
<div class="col">
<h4>Contact Us</h4>
<div class="social">
<a href="#"><i class='bx bxl-facebook'></i></a>
<a href="#"><i class='bx bxl-instagram'></i></a>
<a href="#"><i class='bx bxl-twitter'></i></a>
<a href="#"><i class='bx bxl-youtube'></i></a>
</div>
</div>
</div>
</footer>
</body>
</html>
Events
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Café Events - Event Page</title>
<link rel="stylesheet"
href="https://unpkg.com/boxicons@latest/css/boxicons.min.css">
<link rel="stylesheet" href="events.css">
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;6
00;700;800;900&display=swap" rel="stylesheet">
</head>
<body>
<header>
<a href="#" class="logo">The Gallery Café</a>
<div class="hamburger">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</div>
<nav class="nav-bar">
<ul>
<li>
<a href="Index.html">Home</a>
</li>
<li>
<a href="about.html">About</a>
</li>
<li>
<a href="menu.php?cuisine=Sri%20Lankan">Menu</a>
</li>
<li>
<a href="#" class="active">Events</a>
</li>
<li>
<a href="loginForm.php">Reserve Table</a>
</li>
<li>
<a href="loginForm.php" class="btn">Login</a>
</li>
</ul>
</nav>
</header>
<main>
<section class="events">
<div class="container">
<h2 class="heading">Upcoming Events</h2>
<div class="event fade-in">
<h3>Coffee Tasting Night</h3>
<p>Date: September 15, 2024</p>
<p>Time: 7:00 PM - 9:00 PM</p>
<p>Location: Our Café, 123 Coffee Street, Bean Town</p>
<p>Join us for an evening of exquisite coffee tasting!
Experience a variety of unique blends and learn about the art of coffee making
from our expert baristas. Enjoy live music and special discounts on our café
menu.</p>
<button class="btn">Contact Now</button>
</div>
<div class="event fade-in">
<h3>Live Jazz Night</h3>
<p>Date: October 5, 2024</p>
<p>Time: 8:00 PM - 11:00 PM</p>
<p>Location: Our Café, 123 Coffee Street, Bean Town</p>
<p>Enjoy a night of smooth jazz with local artists while
savoring our specialty coffee and pastries. The perfect way to unwind and enjoy
great music in a cozy atmosphere.</p>
<button class="btn">Contact Now</button>
</div>
<div class="event fade-in">
<h3>Barista Workshop</h3>
<p>Date: November 12, 2024</p>
<p>Time: 10:00 AM - 1:00 PM</p>
<p>Location: Our Café, 123 Coffee Street, Bean Town</p>
<p>Learn the art of coffee making from our skilled baristas.
This workshop covers everything from brewing techniques to latte art. Perfect for
coffee enthusiasts looking to enhance their skills.</p>
<button class="btn">Contact Now</button>
</div>
</div>
</section>
</main>
<section id="contact">
<footer class="footer">
<div class="container">
<div class="col">
<h4>Menu Links</h4>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Menu</a></li>
<li><a href="#">Deals</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div class="col">
<h4>Information</h4>
<ul>
<li><a href="#">About Us</a></li>
<li><a href="#">Reservation Information</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Terms & Conditions</a></li>
</ul>
</div>
<div class="col">
<h4>Access Website</h4>
<ul>
<li><a href="adminLogin.php">Admin</a></li>
<li><a href="#">Staff</a></li>
</ul>
</div>
<div class="col">
<h4>Contact Us</h4>
<div class="social">
<a href="#"><i class='bx bxl-facebook'></i></a>
<a href="#"><i class='bx bxl-instagram'></i></a>
<a href="#"><i class='bx bxl-twitter'></i></a>
<a href="#"><i class='bx bxl-youtube'></i></a>
</div>
</div>
</div>
</footer>
</section>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.fade-in').forEach(function(element) {
element.classList.add('show');
});
});
</script>
</body>
</html>
Reserve Table
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Table Booking</title>
<link rel="stylesheet" href="reservation.css">
<link rel='stylesheet'
href='https://unpkg.com/boxicons@2.0.7/css/boxicons.min.css'>
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;6
00;700;800;900&display=swap" rel="stylesheet">
</head>
<body>
<header>
<div class="logo">The Gallery Café</div>
<nav class="nav-bar">
<ul>
<li><a href="usrIndex.html">Home</a></li>
<li><a href="aboutUsr.html">About</a></li>
<li><a href="menuUsr.php?cuisine=Sri%20Lankan">Menu</a></li>
<li><a href="eventsUsr.html">Events</a></li>
<li><a href="#" class="active">Reserve Table</a></li>
</ul>
<li><a href="editProf.php"><i class='bx bx-user-circle bx-tada bx-
rotate-90' ></i></a></li>
</nav>
</header>
<div class="container">
<h1>Book a Table</h1>
<form method="POST" action="">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<button type="submit">Reserve</button>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit Profile</title>
<link rel="stylesheet" href="editProf.css">
<label for="email">Email:</label>
<input type="email" id="email" name="email" value="<?php echo
htmlspecialchars($user['email']); ?>" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password"
placeholder="Enter new password">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<link rel="stylesheet" href="loginStyle.css">
</head>
<body>
<div class="form-container">
<form action="" method="post">
<h3>Login Now</h3>
<?php
if (isset($error)) {
foreach ($error as $errorMsg) {
echo '<span class="error-msg">'.$errorMsg.'</span>';
}
}
?>
<input type="email" name="email" required placeholder="Enter your
email">
<input type="password" name="password" required placeholder="Enter
your password">
<input type="submit" name="submit" value="Login Now" class="form-
btn">
<p>Don't have an account? <a href="registerForm.php">Register
now</a></p>
</form>
</div>
</body>
</html>
Registration
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register</title>
<link rel="stylesheet" href="loginStyle.css">
</head>
<body>
<div class="form-container">
<form action="" method="post">
<h3>Register Now</h3>
<?php
if(isset($error)){
foreach($error as $errorMsg){
echo '<span class="error-msg">'.$errorMsg.'</span>';
}
}
?>
<input type="text" name="name" required placeholder="Enter your
name">
<input type="email" name="email" required placeholder="Enter your
email">
<input type="password" name="password" required placeholder="Enter
your password">
<input type="password" name="cpassword" required placeholder="Confirm
your password">
<input type="submit" name="submit" value="Register Now" class="form-
btn">
<p>Already have an account? <a href="loginForm.php">Login now</a></p>
</form>
</div>
</body>
</html>
Admin Dashboard
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="loginStyle.css">
</head>
<body>
<div class="container">
<div class="content">
<h3>hi, <span>admin</span></h3>
<h1>welcome<span></span></h1>
<p>Edit menu items and manage staff</p>
<a href="adminDashboard.php" class="btn">edit items</a>
<a href="adminStaff.html" class="btn">manage staff</a>
<a href="adminRes.php" class="btn">Check Reservations</a>
<a href="adminOrd.php" class="btn">manage orders</a>
<a href="index.html" class="btn">logout</a>
</div>
</div>
</body>
</html>
Staff Dashboard
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Staff Dashboard</title>
<link rel="stylesheet" href="loginStyle.css">
</head>
<body>
<div class="container">
<div class="content">
<h3>hello, <span>staff</span></h3>
<h1>welcome<span></span></h1>
<p>Check reservations and manage orders</p>
<a href="adminRes.php" class="btn">reservations</a>
<a href="adminOrd.php" class="btn">manage orders</a>
<a href="index.html" class="btn">logout</a>
</div>
</div>
</body>
</html>
Edit Items
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="dash.css">
</head>
<body>
<div class="admin-container">
<h1 class="admin-title">Admin Dashboard</h1>
<form method="POST" enctype="multipart/form-data" class="admin-form">
<div class="form-group">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form-group">
<label for="description">Description:</label>
<textarea id="description" name="description"
required></textarea>
</div>
<div class="form-group">
<label for="price">Price:</label>
<input type="text" id="price" name="price" required>
</div>
<div class="form-group">
<label for="cuisine">Cuisine:</label>
<select id="cuisine" name="cuisine" required>
<option value="Sri Lankan">Sri Lankan</option>
<option value="Italian">Italian</option>
<option value="Chinese">Chinese</option>
<option value="Drinks">Drinks</option>
</select>
</div>
<div class="form-group">
<label for="image">Image:</label>
<input type="file" id="image" name="image" required>
</div>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="adminStaff.css">
</head>
<body>
<div class="container">
<h1>Admin Dashboard</h1>
<div class="form-container">
<h2>Add New User</h2>
<form id="addUserForm" method="post" action="add_user.php">
<label for="newName">Name:</label>
<input type="text" id="newName" name="name" required>
<label for="newEmail">Email:</label>
<input type="email" id="newEmail" name="email" required>
<label for="newPassword">Password:</label>
<input type="password" id="newPassword" name="password" required>
<button type="submit">Add User</button>
</form>
</div>
<table>
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Email</th>
<th>Password</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="userTable">
</tbody>
</table>
</div>
<div id="editModal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<form id="editForm" method="post" action="edit_user.php">
<input type="hidden" id="editId" name="id">
<label for="editName">Name:</label>
<input type="text" id="editName" name="name" required><br><br>
<label for="editEmail">Email:</label>
<input type="email" id="editEmail" name="email" required><br><br>
<label for="editPassword">Password:</label>
<input type="password" id="editPassword" name="password"><br><br>
<button type="submit">Save</button>
</form>
</div>
</div>
<script src="scripts.js"></script>
</body>
</html>
Manage Reservation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Panel</title>
<link rel="stylesheet" href="adminRes.css">
</head>
<body>
<div class="container">
<h1>Manage Reservations</h1>
<?php if (isset($message)) : ?>
<div class="message"><?php echo $message; ?></div>
<?php endif; ?>
<table>
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Mobile Number</th>
<th>Date</th>
<th>Time</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php if (!empty($reservations)) : ?>
<?php foreach ($reservations as $reservation) : ?>
<tr>
<td><?php echo $reservation['id']; ?></td>
<td><?php echo $reservation['name']; ?></td>
<td><?php echo $reservation['mobile_number']; ?></td>
<td><?php echo $reservation['reservation_date'];
?></td>
<td><?php echo $reservation['reservation_time'];
?></td>
<td>
<button onclick="editReservation(<?php echo
$reservation['id']; ?>)">Edit</button>
<button onclick="deleteReservation(<?php echo
$reservation['id']; ?>)">Delete</button>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="6">No reservations found.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<script>
function refreshPage() {
window.location.reload();
}
function editReservation(id) {
fetch('getRes.php?id=' + id)
.then(response => response.json())
.then(data => {
document.getElementById('edit-id').value = data.id;
document.getElementById('edit-name').value = data.name;
document.getElementById('edit-mobile_number').value =
data.mobile_number;
document.getElementById('edit-reservation_date').value =
data.reservation_date;
document.getElementById('edit-reservation_time').value =
data.reservation_time;
document.getElementById('edit-form').style.display = 'block';
});
}
function deleteReservation(id) {
if (confirm('Are you sure you want to delete this reservation?')) {
var form = document.createElement('form');
form.method = 'POST';
form.action = '';
document.body.appendChild(form);
form.submit();
}
}
</script>
</body>
</html>
Manage Orders
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Order Manager</title>
<link rel="stylesheet" href="adminOrd.css">
</head>
<body>
<header>
<a class="logo">Manage Orders</a>
</header>
<section class="orders">
<h1>Manage Orders</h1>
<table>
<thead>
<tr>
<th>Order ID</th>
<th>Item ID</th>
<th>Quantity</th>
<th>Order Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php while ($row = $result->fetch_assoc()): ?>
<tr>
<td><?php echo htmlspecialchars($row['id'] ?? ''); ?></td>
<td><?php echo htmlspecialchars($row['item_id'] ?? '');
?></td>
<td>
<form action="adminOrd.php" method="POST" class="edit-
form">
<input type="hidden" name="order_id" value="<?php
echo htmlspecialchars($row['id'] ?? ''); ?>">
<input type="number" name="quantity" value="<?php
echo htmlspecialchars($row['quantity'] ?? ''); ?>" required>
</td>
<td>
<input type="date" name="order_date" value="<?php
echo htmlspecialchars($row['order_date'] ?? ''); ?>" required>
</form>
</td>
<td class="actions">
<form action="adminOrd.php" method="POST" class="edit-
form">
<input type="hidden" name="order_id" value="<?php
echo htmlspecialchars($row['id'] ?? ''); ?>">
<button type="submit" name="action" value="edit"
class="edit-btn">Edit</button>
</form>
<form action="adminOrd.php" method="POST" class="delete-
form">
<input type="hidden" name="order_id" value="<?php
echo htmlspecialchars($row['id'] ?? ''); ?>">
<button type="submit" name="action" value="delete"
class="delete-btn">Delete</button>
</form>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</section>
<footer>
<p>© Gallery Cafe</p>
</footer>
</body>
</html>
b)
Menu
<?php
session_start();
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "menu";
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM menu_items WHERE 1=1"; // Start with a default query
if (!empty($searchQuery)) {
$searchQuery = $conn->real_escape_string($searchQuery);
$sql .= " AND (name LIKE '%$searchQuery%' OR cuisine LIKE '%$searchQuery%')";
}
if (!empty($cuisine)) {
$cuisine = $conn->real_escape_string($cuisine);
$sql .= " AND cuisine='$cuisine'";
}
$result = $conn->query($sql);
?>
Reservation
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "table_db";
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = $_POST['name'];
$mobile_number = $_POST['mobile_number'];
$reservation_date = $_POST['reservation_date'];
$reservation_time = $_POST['reservation_time'];
if ($stmt->execute()) {
$message = "Reservation successful!";
} else {
$message = "Error: " . $stmt->error;
}
$stmt->close();
}
$conn->close();
?>
Cart
<?php
session_start();
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if ($result->num_rows > 0) {
$item = $result->fetch_assoc();
if ($conn->connect_error) {
die('Connection failed: ' . $conn->connect_error);
}
$user_id = $_SESSION['user_id'];
$user = $result->fetch_assoc();
if (isset($_POST['submit'])) {
$name = mysqli_real_escape_string($conn, $_POST['name']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
$password = !empty($_POST['password']) ? md5($_POST['password']) : null; //
Use MD5 for password hashing
if (move_uploaded_file($fileTmpPath, $destPath)) {
// Update image path in the database
$image = $newFileName;
} else {
echo 'Error moving uploaded file.';
exit();
}
} else {
echo 'Invalid file type or size.';
exit();
}
}
// Prepare query
$update = "UPDATE user_form SET name = ?, email = ?" . ($password ? ",
password = ?" : "") . ", image = ? WHERE id = ?";
$stmt = $conn->prepare($update);
if ($password) {
$stmt->bind_param('ssssi', $name, $email, $password, $image, $user_id);
} else {
$stmt->bind_param('sssi', $name, $email, $image, $user_id);
}
$stmt->execute();
}
$conn->close();
?>
Login
<?php
session_start();
@include 'config.php';
if (isset($_POST['submit'])) {
$email = mysqli_real_escape_string($conn, $_POST['email']);
$pass = md5($_POST['password']);
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$_SESSION['user_id'] = $row['id']; // Set user ID in session
$_SESSION['name'] = $row['name']; // Set user name in session
$stmt->close();
}
?>
Registration
<?php
@include 'config.php';
if(isset($_POST['submit'])) {
$name = mysqli_real_escape_string($conn, $_POST['name']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
$pass = md5($_POST['password']);
$cpass = md5($_POST['cpassword']);
if(mysqli_num_rows($result) > 0) {
$error[] = 'User already exists!';
} else {
if($pass != $cpass) {
$error[] = 'Passwords do not match!';
} else {
$insert = "INSERT INTO user_form(name, email, password)
VALUES('$name', '$email', '$pass')";
mysqli_query($conn, $insert);
header('Location: loginForm.php');
}
}
};
?>
Edit Items
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "menu";
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
Staff Manager
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "staff_db";
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$name = $_POST['name'];
$email = $_POST['email'];
$password = md5($_POST['password']); // Hash the password with MD5
$sql = "INSERT INTO staff_form (name, email, password) VALUES ('$name', '$email',
'$password')";
$conn->close();
header("Location: adminStaff.html");
?>
Manage Reservation
<?php
// Database connection
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "table_db";
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if ($stmt->execute()) {
$message = "Reservation updated successfully!";
} else {
$message = "Error: " . $stmt->error;
}
$stmt->close();
}
if ($stmt->execute()) {
$message = "Reservation deleted successfully!";
} else {
$message = "Error: " . $stmt->error;
}
$stmt->close();
}
// Fetch reservations
$sql = "SELECT * FROM reservation";
$result = $conn->query($sql);
if ($result) {
$reservations = $result->fetch_all(MYSQLI_ASSOC);
} else {
$message = "Error fetching reservations: " . $conn->error;
}
$conn->close();
?>
Manage Orders
<?php
session_start();
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "menu";
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['action'])) {
$order_id = $_POST['order_id'];