WBP Part B-1
WBP Part B-1
IF-TY
Group No : 06
Microproject Topic :
Date:
Managing sports facilities properly is important for easy ground bookings and well-
organized events. This project creates a Cricket Ground Booking System where users can
search, view, and book cricket grounds quickly. The system makes the booking process
simple by removing paperwork, avoiding scheduling issues, and making it easy for players,
teams, and event organizers to find available grounds. With features like real-time
availability, easy booking, and a user-friendly design, this system makes the process
smooth and stress-free. It helps users focus on playing the game while handling all booking
tasks efficiently.
0.2 Aim:
Prepare a Report on a detailed study of how to create a website for Cricket Ground Booking
System.
0.6 Code:-
Cricket-Ground-Booking/
│── index.php
│── bookings.txt
│── assets/
│ ├── images/
│ │ ├── cricket-ground.jpg
│ │ ├── login.jpg
│ │ ├── book.jpg
│ │ ├── show.jpg
│ ├── style.css
│── book.php
│── cricket.php
│── home.php
│── login.php
│── logout.php
│── register.php
│── show.php
Login.php
<html>
<head>
<style>
body { font-family: Arial, sans-serif; text-align: center; }
nav { background: #333; padding: 10px; }
nav a { color: white; text-decoration: none; padding: 15px; font-size: 16px; }
nav a:hover { background: #555; border-radius: 5px; }
form { margin: 20px auto; width: 300px; }
table { margin: auto; border-collapse: collapse; }
th, td { padding: 10px; border: 1px solid black; }
.booked { background-color: red; color: white; }
</style>
Book.php
<html>
<head>
<style>
body { font-family: Arial, sans-serif; text-align: center; }
nav { background: #333; padding: 10px; }
nav a { color: white; text-decoration: none; padding: 15px; font-size: 16px; }
nav a:hover { background: #555; border-radius: 5px; }
form { margin: 20px auto; width: 300px; }
table { margin: auto; border-collapse: collapse; }
th, td { padding: 10px; border: 1px solid black; }
.booked { background-color: red; color: white; }
</style>
$filename = "bookings.txt";
Show.php
<html>
<head>
<style>
body { font-family: Arial, sans-serif; text-align: center; }
nav { background: #333; padding: 10px; }
nav a { color: white; text-decoration: none; padding: 15px; font-size: 16px; }
nav a:hover { background: #555; border-radius: 5px; }
form { margin: 20px auto; width: 300px; }
table { margin: auto; border-collapse: collapse; }
th, td { padding: 10px; border: 1px solid black; }
.booked { background-color: red; color: white; }
</style>
Register.php
<html>
<head>
<style>
body { font-family: Arial, sans-serif; text-align: center; }
nav { background: #333; padding: 10px; }
nav a { color: white; text-decoration: none; padding: 15px; font-size: 16px; }
nav a:hover { background: #555; border-radius: 5px; }
form { margin: 20px auto; width: 300px; }
table { margin: auto; border-collapse: collapse; }
th, td { padding: 10px; border: 1px solid black; }
.booked { background-color: red; color: white; }
</style>
Logout.php
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<?php
session_start();
session_destroy();
header("Location: home.php");
exit;
?>
</html>
Home.php
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="style.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to Cricket Ground Booking</title>
<link rel="stylesheet" href="style.css">
<style>
body { font-family: Arial, sans-serif; text-align: center; background-color: #f8f9fa; margin: 0; }
h1 { color: #008000; margin-top: 20px; }
.container { width: 80%; margin: auto; padding: 20px; }
.cards { display: flex; justify-content: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.card {
background: white;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
padding: 20px;
width: 250px;
text-align: center;
transition: 0.3s;
}
.card:hover { transform: scale(1.05); }
.card img { width: 100%; border-radius: 10px; }
.card a { display: block; margin-top: 10px; text-decoration: none; color: white; background:
#28a745; padding: 8px; border-radius: 5px; }
.card a:hover { background: #218838; }
</style>
</head>
<body>
<?php
if (isset($_SESSION['user'])) {
echo "<h2>Hello, " . htmlspecialchars($_SESSION['user']) . "!</h2>";
} else {
echo "<h2>Please <a href='login.php'>Login</a> or <a href='register.php'>Register</a> to
continue.</h2>";
}
?>
<div class="container">
<p>
Our online Cricket Ground Booking System makes it easy to schedule your game slots
effortlessly.
Whether you're a casual player or a serious team, we offer a seamless booking experience.
Join us and enjoy hassle-free cricket ground reservations!
</p>
<div class="cards">
<div class="card">
<img src="images/book.jpg" alt="Book Ground">
<h3>Book a Ground</h3>
<p>Reserve your slot instantly with our online booking system.</p>
<a href="book.php">Book Now</a>
</div>
<div class="card">
<img src="images/login.jpg" alt="Login">
<h3>User Login</h3>
<p>Access your account and manage bookings with ease.</p>
<a href="login.php">Login</a>
</div>
<div class="card">
<img src="images/show.jpg" alt="Show Bookings">
<h3>View Bookings</h3>
<p>Check your booked slots and upcoming matches.</p>
<a href="show.php">View Bookings</a>
</div>
</div>
</div>
</body>
</html>
Index.php
<?php
session_start();
$newBooking = "$date|$time|$name\n";
// Save booking
file_put_contents($filename, $newBooking, FILE_APPEND);
echo "<script>alert('Booking successful!');</script>";
}
<html>
<head>
<title>Cricket Ground Booking</title>
<style>
body { font-family: Arial, sans-serif; text-align: center; }
nav { background: #333; padding: 10px; }
nav a { color: white; text-decoration: none; padding: 10px; }
form { margin: 20px auto; width: 300px; }
table { margin: auto; border-collapse: collapse; }
th, td { padding: 10px; border: 1px solid black; }
.booked { background-color: red; color: white; }
</style>
<nav>
<a href="home.php">Home</a>
<a href="login.php">Login</a>
<a href="logout.php">Logout</a>
<a href="book.php">Book Ground</a>
<a href="show.php">Show Bookings</a>
</nav>
Mrs. M.M.Mali
(Course Co-ordinator)