0% found this document useful (0 votes)
43 views15 pages

Parking Management System

HAHAHAHHAHHAHAHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views15 pages

Parking Management System

HAHAHAHHAHHAHAHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Republic of the Philippines

TARLAC AGRICULTURAL UNIVERSITY


Camiling, Tarlac

COLLEGE OF ENGINEERING AND TECHNOLOGY

WEB SYSTEM AND TECHNOLOGIES

PARKING MANAGEMENT SYSTEM

Group 5
Jenard Josh S. Balbin
John Alexis S. Dela Cruz
Soony B. Tomas
Christal R. Agbayani

Submitted to:
Renel F. Dumlao
Instructor I
Brief Description:

This Parking Management System was developed using PHP. It is designed to manage parking
operations by tracking parked vehicles, managing users, and organizing parking locations. Users can log
in to the system, view parking details, and manage parking categories and locations. The system provides
functionalities for administrators to oversee the management of parking slots and issue receipts upon
checkout.

Features/Components:

1. User Authentication:

- Login page (‘login.php’): Allows users and administrators to access the system securely using
session management.

2. Parking Management:

- Add, view, and manage parked vehicles, associated categories (like vehicle type), and parking
locations. This is handled in files such as ‘manage_park.php’ and ‘park_list.php’.

3. Parking Location Management:

- The system can handle different parking locations (‘location.php’), allowing administrators to
categorize spaces based on location.

4. Category Management:

- Admins can manage vehicle categories (e.g., car, bike) through ‘manage_category.php’.

5. Receipts and Checkout:

- Functionality for generating and printing receipts (‘print_checkout_receipt.php’ and


‘print_receipt.php’).

6. Dashboard:

- The main page (‘index.php’) is a dashboard showing summaries and offering navigation for
managing various system parts.
All Forms ( Pictures )

1. Login Form (‘login.php’)

Description: The login form allows users and administrators to enter their credentials (username
and password) to access the system.

Fields:

● Username
● Password
● Login

Additional Features: Includes session handling to ensure secure access. If the login is successful,
the user is redirected to the dashboard.
2. Registration Form (likely part of ‘manage_user.php’ or ‘users.php’)

Description: Admins can create new users by providing details such as username, password, and
user role (admin/user).

Fields:

● Name
● Username
● Password
● Confirm Password
● User Type (Admin/Staff)

Purpose: Allows administrators to add and manage system users.


3. Parking Management Form (‘manage_park.php’)

Description: This form is used to manage parking slots and parked vehicles, where users can
input details about vehicles and parking spaces.

Fields:

● Vehicle Category (via dropdown)


● Parking Location (via dropdown)
● Vehicle Name
● Vehicle Registration No.
● Owner Name
● Vehicle Description

Purpose: For adding or updating parked vehicle information in the system.


4. Dashboard (‘index.php’)

Description: The dashboard provides an overview of the system’s operations, such as the number
of parked cars, and parking locations.

Sections:

● Total Parked Vehicles


● Total Checked-Out Vehicles
● Total Available Spots
● Total Categories
● Total Parking Locations

Purpose: A central hub for navigation and managing various system components.
5. Parking Location Management Form (‘manage_location.php’)

Description: Admins can add or modify parking locations (e.g., areas in a parking lot).

Fields:

● Category
● Location
● Area Capacity
● Action

Purpose: To organize and manage where vehicles are parked.


Source Code

Add/Submit (Parking Data) - ‘manage_park.php’

This code allows administrators to add new parking records, such as vehicle details and the
location where the vehicle is parked.

< ?php

include

'db_connect.php';

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

$vehicle_type = $_POST['vehicle_type'];

$location_id = $_POST['location_id'];

$license_plate = $_POST['license_plate'];

// SQL query to insert parking data into the database

$qry = $conn->query("INSERT INTO parked_list (vehicle_type, location_id,


license_plate)

VALUES ('$vehicle_type', '$location_id', '$license_plate')");

if ($qry) {

echo "New parking entry added successfully!";

} else {

echo "Error: ".$conn->error;

? >
Delete (Parking Record) - ‘ajax.php’

This snippet deletes a parked vehicle entry from the database based on its ID, typically through
an AJAX request.

< ?php

include

'db_connect.php';

if (isset($_POST['id'])) {

$id = $_POST['id'];

// SQL query to delete a parking record

$qry = $conn->query("DELETE FROM parked_list WHERE id = $id");

if ($qry) {

echo "Parking record deleted successfully!";

} else {

echo "Error: ".$conn->error;

? >
Update (Parking Record) - ‘manage_park.php’

This code is used to update parking information, such as changing the location or vehicle type
for a parked vehicle.

< ?php

include

'db_connect.php';

if (isset($_POST['id'])) {

$id = $_POST['id'];

$vehicle_type = $_POST['vehicle_type'];

$location_id = $_POST['location_id'];

$license_plate = $_POST['license_plate'];

// SQL query to update parking record

$qry = $conn->query("UPDATE parked_list

SET vehicle_type = '$vehicle_type', location_id = '$location_id',


license_plate = '$license_plate'

WHERE id = $id");

if ($qry) {

echo "Parking record updated successfully!";

} else {

echo "Error: ".$conn->error;

? >
Search (Parking Records) - ‘ajax.php’

This snippet handles searching for parked vehicles based on the license plate or vehicle type.

< ?php

include

'db_connect.php';

if (isset($_POST['search_term'])) {

$search_term = $_POST['search_term'];

// SQL query to search parked vehicles

$qry = $conn->query("SELECT * FROM parked_list WHERE license_plate LIKE


'%$search_term%' OR vehicle_type LIKE '%$search_term%'");

$result =[];

while ($row = $qry->fetch_assoc()) {

$result[] = $row;

echo

json_encode($result);

? >
Login - ‘login.php’

This code snippet handles user authentication, checking the username and password against the
database.

<?php

include 'db_connect.php';

session_start();

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

$username = $_POST['username'];

$password = $_POST['password'];

// SQL query to verify login credentials

$qry = $conn->query("SELECT * FROM users WHERE username = '$username' AND

password = '$password'");

if ($qry->num_rows > 0) {

$_SESSION['login_id'] = $qry->fetch_assoc()['id'];

echo "Login successful!";

header("location: index.php");

} else {

echo "Invalid username or password!";

?>
Logout - ‘logout.php’

This code logs the user out by destroying their session and redirecting them to the login page.

<?php

session_start();

session_destroy(); // Destroy all session data

header("location: login.php"); // Redirect to login page

exit();

?>

Generate Receipt - ‘print_receipt.php’

This snippet generates a receipt after a vehicle has completed parking, including the parking fee
calculation.

<?php

include 'db_connect.php';

if (isset($_GET['id'])) {

$qry = $conn->query("SELECT * FROM parked_list WHERE id = " . $_GET['id']);

$park_data = $qry->fetch_assoc();

$parking_fee = calculate_fee($park_data['entry_time'],

$park_data['exit_time']);

// Print receipt data

echo "<h3>Parking Receipt</h3>";

echo "Vehicle: " . $park_data['vehicle_type'] . "<br>";

echo "License Plate: " . $park_data['license_plate'] . "<br>";

echo "Parking Fee: $" . $parking_fee . "<br>";

function calculate_fee($entry_time, $exit_time) {


// Example: Simple fee calculation based on time difference

$time_diff = strtotime($exit_time) - strtotime($entry_time);

return $time_diff / 3600 * 2; // $2 per hour

?>

Manage Users - ‘manage_user.php’

This snippet allows administrators to manage users, including adding or editing user information.

<?php

include 'db_connect.php';

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

$username = $_POST['username'];

$password = $_POST['password'];

$role = $_POST['role'];

// SQL query to insert or update a user

if (isset($_POST['id'])) {

$qry = $conn->query("UPDATE users SET username = '$username', password

= '$password', role = '$role' WHERE id = " . $_POST['id']);

echo "User updated successfully!";

} else {

$qry = $conn->query("INSERT INTO users (username, password, role)

VALUES ('$username', '$password', '$role')");

echo "New user added successfully!";

?>
View Parked Vehicles - ‘view_parked_details.php’

This code fetches and displays details of parked vehicles, including the location and duration of
parking.

<?php

include 'db_connect.php';

// Fetch parked vehicles

$qry = $conn->query("SELECT p.*, l.location_name FROM parked_list p

INNER JOIN parking_locations l ON p.location_id = l.id");

while ($row = $qry->fetch_assoc()) {

echo "Vehicle: " . $row['vehicle_type'] . "<br>";

echo "License Plate: " . $row['license_plate'] . "<br>";

echo "Location: " . $row['location_name'] . "<br>";

echo "Entry Time: " . $row['entry_time'] . "<br><br>";

?>

You might also like