Cyber F Rent Pages 1
Cyber F Rent Pages 1
ON
J.BALAJI M.C.A
Kothapeta, Vijayawada
2023-24
KAKARAPARTI BHAVANARAYANA COLLEGE (AUTONOMOUS)
(Sponsored by S.K.P.V.V. Hindu High School Committee)
Kothapeta, Vijayawada.
CERTIFICATE
This is to certify that the work entitled “CYBER CAFÉ MANAGEMENT SYSTEM” submitted by
A.VENKATA NARESH bearing Reg No K3222547 in the partial fulfilment of Vocational at
KRISHNA UNIVERSITY, MACHILIPATNAM. During the academic Year 2023 to 2024. It is
certified that all the corrections/suggestions indicated for internal for assessment have been in cooperative in the
project work has been approved as its satisfied academic requirements in respect of project work prescribed for
the above degree
.
External Examiner
DECLARATION
The Project work entitled ‘CYBER CAFÉ MANAGEMENT SYSTEM’ is a record of
bonafide work carried out by me, submitted in partial fulfilment for the award of
BACHELOR
OF DEGREE in COMPUTER APPLICATION to the KRISHNA UNIVERSITY,
MACHILIPATNAM. The result embodied in this project work has not been submitted to
any other University or Institute for the award of any degree or diploma.
This project work is a golden opportunity for learning and self-development. We consider
our self very lucky to have so many people lead us through in completion of this project.
We express our sincere thanks to the management and our beloved principal DR.G.
KRISHNAVENI for providing such wonderful facilities required encouragement in
completion of this entire project work.
We would like to thank all the other faculty members, technical staff and supporting staff
who have provided their contribution in the completion this project work.
⮚ Back ground 7
1. System Objectives 8-9
2. System context 10-11
3. Functional requirements 12-13
4. Non-Functional requirements 14-15
5. Future requirements 16-17
6. System Requirement Specification 18
By integrating these features, the Cyber Cafe Management System not only
improves operational efficiency but also enhances customer satisfaction, making
it an essential tool for modern cyber cafes. The system is adaptable to various
business sizes and can be customized to meet specific needs, ensuring scalability
as the cafe grows.
1. Manual Operations: Many cyber cafes rely on manual processes for user
registration, billing, and tracking time, leading to errors and delays.
2. Customer Management: Difficulty in managing user accounts and
preferences can result in a poor customer experience, with long wait times
and inconsistent service.
3. Time Tracking: Inaccurate tracking of computer usage can lead to disputes
over billing and resource allocation, affecting both customers and the cafe's
profitability.
4. Resource Allocation: Without an effective system, managing the availability
and usage of computers and peripherals can be chaotic, leading to
underutilization or overbooking.
5. Reporting and Analytics: Lack of comprehensive reporting tools makes it
challenging for cafe owners to analyze sales trends, monitor performance,
and make informed business decisions.
6. Security Concerns: Ensuring data security and user privacy is critical, yet
many cafes lack proper systems to safeguard sensitive information.
The Cyber Cafe Management System aims to address these problems by providing
an integrated solution that automates operations, enhances customer service, and
improves overall management efficiency.
1.2 Proposed System
The Cyber Cafe Management System is designed to provide an integrated, efficient,
and user-friendly solution for managing cyber cafes. The key components and
features of the proposed system include:
2. SYSTEM ANALYSIS
The Cyber Cafe Management System involves a comprehensive analysis to ensure it meets the
needs of both customers and management. This analysis includes the following components:
1. Requirements Gathering
● Functional Requirments:
o User registration and authentication o Real-time
monitoring of computer usage o Automated billing
based on time used o Management of user accounts and
preferences
o Reporting tools for usage statistics and financial
performance ● Non-Functional Requirements:
o Usability: Intuitive interface for both customers and staff o
Security: Protection of user data and transactions o
Performance: Quick response times for user interactions
o Scalability: Ability to add more computers or features
without major redesign
2. System Architecture
● Client-Server Model:
o Client Side: User interface accessible via computers in the cafe, allowing
customers to register, log in, and view available services.
o Server Side: Centralized database and application server handling data storage,
processing requests, and generating reports.
3. Database Design
● Entities:
o Users: Stores user information, login credentials, and session history.
o Computers: Tracks the status (available, in use) and specifications of each
computer. o Sessions: Records active sessions, including start and end
times, and billing information.
o Payments: Manages payment records, including methods and amounts.
● Relationships:
o One-to-many relationship between Users and Sessions. o One-to-one
relationship between Sessions and Payments.
4. Use Case Analysis
● Actors:
o Customers: Register, log in, and use computer services.
o Staff: Manage users, monitor usage, and handle billing.
o Administrators: Oversee the system, generate reports,
and manage settings.
5. Technology Stack
● Frontend: HTML, CSS, JavaScript for user interface development.
● Backend: PHP or Node.js for server-side processing.
● Database: MySQL or PostgreSQL for data storage.
● Frameworks: Bootstrap for responsive design; Express.js for backend routing.
6. Implementation Considerations
● Security Measures: Implementation of encryption for sensitive data, secure
authentication methods, and regular backups.
● User Training: Providing staff with training on system operations to ensure smooth
adoption.
● Feedback Mechanism: Establishing a method for users and staff to provide feedback for
continuous improvement.
Conclusion
The system analysis of the Cyber Cafe Management System lays the groundwork for a robust
solution that effectively addresses the challenges faced by cyber cafes. By focusing on both
functional and non-functional requirements, the system is designed to enhance operational
efficiency, improve customer satisfaction, and provide valuable insights for management.
2.1 Back ground
Cyber cafes emerged in the late 1990s and early 2000s, providing public access to computers and
the internet, especially in areas where personal computers and broadband connections were not
widely available. These establishments became popular gathering spots for individuals seeking
online access for various purposes, including gaming, browsing, and studying.
As technology evolved, the dynamics of cyber cafes changed significantly. While they remain
essential in some regions, many cafes face challenges in maintaining efficient operations due to
increasing competition from personal devices and mobile internet access. Additionally, the rise of
digital platforms has transformed user expectations, requiring cafes to offer a seamless and
userfriendly experience.
Key Factors Influencing the Need for a Management System:
1. Operational Efficiency: Cyber cafes often rely on manual processes for user
management, billing, and resource tracking, leading to inefficiencies and increased
chances of error. Automating these tasks can streamline operations significantly.
2. Customer Experience: With a growing emphasis on customer service, cafes need
systems that allow for quick registration, easy session management, and efficient billing to
enhance user satisfaction.
3. Resource Management: As cafes have limited computers and peripherals, effective
management of these resources is crucial. A management system can help track usage in
real time, optimizing resource allocation.
4. Data Security and Privacy: Protecting user data and ensuring compliance with privacy
regulations has become increasingly important. A robust management system can address
these concerns through secure authentication and data handling practices.
5. Competitive Edge: With the proliferation of internet access points and personal devices,
cyber cafes must differentiate themselves. Offering a modern management system can
improve operational capabilities and customer loyalty through features like loyalty
programs and promotions.
Conclusion
The Cyber Cafe Management System aims to address the unique challenges faced by cyber cafes
in today’s digital landscape. By automating essential operations and enhancing the overall
customer experience, the system provides a viable solution for cafes looking to thrive in a
competitive market. This background sets the stage for understanding the necessity and benefits of
implementing a comprehensive management system tailored to the needs of cyber cafes.
2.2 System Objectives
The primary objectives of the Cyber Cafe Management System are designed to
enhance operational efficiency, improve customer satisfaction, and provide
robust management capabilities. Key objectives include:
1. Automation of Operation
Streamline processes such as user registration, session management, and
billing to reduce manual errors and save time for staff.
2. Real-Time Tracking
Implement real-time monitoring of computer usage to ensure accurate billing
and effective resource allocation, allowing users to see available systems
instantly.
Conclusion
1. System Boundaries:
The Cyber Cafe Management System encompasses various components that
interact with each other to provide a cohesive management solution. The primary
boundaries include:
User Interface:-
Customer-facing interface for logging in, managing sessions, and making
payments.
Admin interface for staff to manage user accounts, monitor usage, and generate
reports.
Database Management:-
A centralized database storing user information, session logs, billing records,
and inventory of resources.
Server-side Processing:-
Business logic for handling user requests, managing sessions, calculating
bills, and generating reports.
2. Key Components:
Users:-
Customers who access the cafe’s services.
Staff members responsible for managing operations and customer support.
Admins who oversee system functions and manage configurations.
Hardware:-
Computers and peripherals available for customer use.
Server infrastructure that hosts the system and database.
Software:-
The Cyber Cafe Management System itself, including the front-end and
backend applications.
Any additional software for payment processing and data analytics.
3. External Interfaces:
Payment Gateways:-
Integration with external payment systems to facilitate secure transactions.
Internet Services:-
Access to the internet for users, allowing them to browse, play games, or use
applications online.
Support Services:-
IT support for system maintenance, troubleshooting, and updates.
4. Interactions:
User Interactions
Customers log in to create sessions, manage their profiles, and make
payments.
Staff members manage user sessions, address customer inquiries, and oversee
resource allocation.
Data Flow:-
User data flows into the database during registration and session creation.
Billing information is generated based on real-time usage data.
5.Operational Environment
Physical Environment:-
The cyber cafe itself, including layout, seating arrangements, and the overall
atmosphere.
Technological Environment:-
The system operates on local network infrastructure within the cafe, requiring
reliable internet access and hardware.
Functional Requirements
The functional requirements outline the specific behaviors and functions that the
Cyber Cafe Management System must support to meet the needs of its users. These
requirements detail the capabilities of the system in terms of user interactions, data
processing, and overall management.
1. User Management:
● Users must be able to create accounts with personal details (name,
email, phone number).
● Users must log in securely with a username and password.
● Users should be able to view and update their profiles, including
password changes and personal preferences
2. Session Management:
● Staff can initiate a user session when a customer logs in, automatically
starting the timer for usage.
4.Resource Management:
The system must track which computers are available or currently in use.
Owners should be able to view daily, weekly, and monthly sales reports.
7. Security Features
● Data Encryption:
8. User Support ●
Conclusion
These functional requirements are essential for building a comprehensive Cyber
Cafe Management System that meets the operational needs of the cafe, enhances
user experience, and ensures effective management of resources. Each requirement
contributes to a cohesive system that is user-friendly, efficient, and secure,
ultimately supporting the cafe's goals.
Non-functional Requirements:
1. Performance
● Response Time: The system should respond to user actions (e.g., login,
billing) within 2 seconds under normal load.
● Throughput: The system should support a minimum of 50 concurrent users
without degradation of performance.
2. Scalability
● The system should be able to scale up to handle increased user loads (e.g.,
during peak hours) without requiring major architectural changes.
3. Availability
● The system should have an uptime of 99.5% or higher, ensuring it is available
to users almost all the time.
4. Usability
● The user interface should be intuitive and easy to navigate, allowing users to
complete tasks with minimal training.
● Accessibility features should be implemented to accommodate users with
disabilities.
5. Security
● User data must be protected using encryption, especially during transactions
and personal information storage.
● The system should implement authentication and authorization controls to
prevent unauthorized access.
6. Maintainability
● The codebase should be modular and well-documented to facilitate easy
updates and maintenance.
● The system should support easy troubleshooting and debugging processes.
7. Interoperability
● The system should be able to integrate with other systems (e.g., payment
gateways, inventory systems) seamlessly.
9. Compliance
● The system should adhere to relevant regulations (e.g., GDPR for user data
protection) and industry standards.
10. Localization
● The system should support multiple languages to cater to a diverse user base.
These non-functional requirements help ensure that the Cyber Cafe Management
System not only meets functional needs but also provides a reliable, secure, and
user-friendly experience.
Future requirements:
When considering future requirements for a Cyber Cafe Management System, it’s
essential to anticipate technological advancements and evolving user needs. Here
are some potential future requirements to think about:
1. Cloud Integration
● Cloud Storage: Transitioning to a cloud-based model for data storage and
management to improve accessibility and reduce hardware costs.
● Remote Access: Allowing management and users to access the system
remotely through secure web applications or mobile apps.
2. Mobile Compatibility
● Mobile App Development: Creating a mobile application for users to reserve
computers, manage accounts, and make payments directly from their devices.
● Responsive Design: Ensuring the web interface is fully responsive for optimal
use on various devices.
8. Environmental Sustainability
● Energy Management Systems: Implementing tools to monitor and optimize
energy consumption in the cafe.
● Recycling Programs: Integrating features that promote recycling and
sustainability efforts.
MONITOR : 15inch
KEYBOARD :USB
MOUSE :USB
SOFTWARE:
WINDOWS :11
]
FEASIBILITY ANALYSIS:
A feasibility analysis is an essential part of project planning, assessing whether a
Cyber Cafe Management System project is viable from various perspectives. Here’s
a structured approach to conducting a feasibility analysis:
1. Technical Feasibility
2. Economic Feasibility
3. Operational Feasibility
● User Acceptance: Consider if the target users (staff, customers) will accept
and adapt to the new system.
● Training Requirements: Identify the need for training staff and users, and
evaluate the resources available for training.
● Process Changes: Assess how the system will impact existing workflows
and operations in the cyber cafe.
4. Legal Feasibility
5. Schedule Feasibility
6. Market Feasibility
● Market Research: Analyze the target market for the cyber cafe and
understand user needs and preferences.
● Competitive Analysis: Evaluate existing solutions in the market, identifying
strengths and weaknesses that your system can address.
Summary
After conducting this feasibility analysis, you should be able to determine whether
the Cyber Cafe Management System project is viable in terms of technical,
economic, operational, legal, schedule, and market considerations. The findings will
help inform decision-making and guide the development process effectively.
SYSTEM ANALYSIS
Use case view:
A use case view provides a visual representation of the interactions between users
(actors) and the system, capturing the functional requirements and helping to clarify
the system's behavior. Here's a breakdown of the use case view for a Cyber Cafe
Management System:
Actors
Use Cases
Here are some key use cases for the Cyber Cafe Management System:
1. User Registration
○ Actor: Customer
○ Description: The customer registers for an account.
○ Preconditions: The customer has access to the registration page.
○ Postconditions: The customer’s information is stored in the system.
2. User Login
○ Actor: Customer
○ Description: The customer logs into their account.
○ Preconditions: The customer has a registered account.
○ Postconditions: The customer is granted access to their dashboard.
3. Reserve Computer
○ Actor: Customer
○ Description: The customer reserves a computer for a specified time.
○ Preconditions: The customer is logged in and computers are available.
○ Postconditions: The reservation is confirmed and recorded in the
system.
4. Start Session
○ Actor: Customer
○ Description: The customer starts their reserved session.
○ Preconditions: The customer has a reservation.
○ Postconditions: The system begins tracking the session duration.
5. Payment Processing
○ Actor: Customer
○ Description: The customer pays for their session.
○ Preconditions: The session has ended.
○ Postconditions: Payment is processed, and a receipt is generated.
6. Manage Computer Resources
○ Actor: Staff
○ Description: The staff manages available computers and resources.
○ Preconditions: Staff is logged into the admin interface. ○
Postconditions: Computer status is updated.
7. Generate Reports
○ Actor: Administrator
○ Description: The administrator generates usage and financial reports.
○ Preconditions: Admin is logged in.
○ Postconditions: Reports are generated and can be exported.
8. User Profile Management
○ Actor: Customer
○ Description: The customer updates their profile information. ○
Preconditions: The customer is logged in.
○ Postconditions: The customer’s profile is updated in the system.
Use Case Diagram
You can represent these use cases visually in a diagram. Here’s a simplified
description of how it might look:
Graphical depiction:
1. Admin
2. User
Admin:
UML NOTATION:
User:
A cosmetic product project allows customers to browse, select, and purchase
cosmetic products online without the need to visit physical stores.
UML NOTATION:
User
ADMIN
USER
USE-CASE DIAGRAM:
Actors:
Use Cases:
Diagram Layout:
In a typical use-case diagram:
+-------------------------------------+
| Cyber Cafe Management |
| |
| [Register Account] |
| [Login] o|
| [Reserve Computer] o|
| [Check Availability] o|
| [Start Session] o|
| [End Session] o|
| [Print Invoice] /|
| |
| [Manage User Accounts] |
| [View Reports] |
| [Manage Equipment] |
+-------------------------------------+
^ ^ ^
| | |
+----+ +---+ +---+
|Customer| |Staff/ |Admin|
| | |Operator| |
+--------+ +-------+-----+
Additional Notes:
● Each use case can have further details such as preconditions, postconditions,
and specific scenarios (success and failure paths).
● Consider using a UML tool (like Lucidchart, Draw.io, etc.) to create a more
formal diagram.
This framework should help you visualize the interactions within a Cyber Cafe
Management System effectively!
ACTIVITY DIGRAM:
This Activity Diagram represents the flow of the login activity in a cosmetic products e-commerce
website. It illustrates how users can log in to access features such as browsing products, adding
items to cart, and completing purchases securely. The login process ensures that only
authenticated users can access the website's functionalities.
1. Objective:
● The objective of the login activity is to authenticate users and grant them access to the
website's features based on their credentials.
2. Start and End States:
● The workflow begins with the user accessing the login page.
● It ends once the user successfully logs in or decides to exit the login process.
3. Objects and Flows:
● Objects such as "User Credentials" (username and password) are utilized in the
login process.
● Object flows connect the user credentials input by the user to the authentication
system.
4. Responsibilities and Swim Lanes:
● Swim lanes represent different entities responsible for performing
activities.
● “User" is responsible for inputting their credentials. ● “Authentication
System" is responsible for verifying the credentials.
5. Transitions:
● Directed arrows represent transitions between activities.
● Upon entering credentials, the system verifies them.
● If credentials are valid, the user is granted access to the website's features.
● If credentials are invalid, an error message is displayed, prompting the user to retry
or seek assistance.
6. Decision Point:
● Decision diamonds denote points where the workflow may branch into alternate
flows
● Based on the validity of the credentials, the workflow may proceed to either
successful login or error handling.
7. Concurrent Workflows and Synchronization:
● Synchronization bars depict forking and joining of concurrent workflows.
● Concurrent activities, such as inputting credentials and verifying them, are
synchronized to ensure coherence in the login process.
8. Specifications:
● Actions, triggers, and guard conditions are defined in the specifications of each
model element to ensure accurate execution of the login activity.
Database Design
Database design is the systematic structuring of data in accordance with a predefined
database model. This process involves determining the necessary data to be stored and
establishing relationships between data elements. In SQLite, database designers utilize
SQL commands to define the structure and relationships within the database.
CODING
INDEX.PHP :-
<?php
session_start(); error_reporting(0);
include('includes/dbconnection.php');
if(isset($_POST['login']))
{
$adminuser=$_POST['username'];
$password=md5($_POST['password']);
$query=mysqli_query($con,"select ID from tbladmin where
UserName='$adminuser' && Password='$password' ");
$ret=mysqli_fetch_array($query);
if($ret>0){
$_SESSION['ccmsaid']=$ret['ID'];
header('location:dashboard.php');
}
else{
$msg="Invalid Details.";
}
}
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<title>CCMS Admin Login</title>
<link rel="apple-touch-icon" href="apple-icon.png">
<link rel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="vendors/font-
awesome/css/fontawesome.min.css">
<link rel="stylesheet" href="vendors/themify-icons/css/themify-icons.css">
<link rel="stylesheet" href="vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="vendors/selectFX/css/cs-skin-elastic.css"><link
rel="stylesheet" href="assets/css/style.css">
<link
href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800'
rel='stylesheet' type='text/css'> </head>
<body class="bg-dark" style=" background-image: url('images/neno.jpg');">
<body class="bg-dark" style=" background-repeat: no-repeat;">
<div class="sufee-login d-flex align-content-center flex-wrap" >
<div class="container">
<div class="login-content">
<div class="login-logo">
<h3 style="color: lightyellow; font-family: 'Bell MT', sans-serif; font-size:
36px;"><b>Cyber Cafe Management System</b></h3>
<hr style="border-color: orange;" />
</div>
<div class="login-form">
<form action="" method="post" name="login">
<p style="font-size:20px; color:red" aline="center"> <?php
if($msg){ echo $msg;
} ?> </p>
<div class="form-group">
<label><b><i>User Name</i></b></label>
<input type="text" class="form-control" placeholder="User
Name" required="true" name="username">
</div>
<div class="form-group">
<label><i><b>Password</b></i></label>
<input type="password" class="form-control"
placeholder="Password" name="password" required="true">
</div>
<div class="checkbox">
<label class="pull-right">
<a href="forgot-password.php">Forgot Password?</a>
</label>
</div>
<button type="submit" class="btn btn-success btn-flat m-b-
30 m-t-30" name="login"><b>Sign in</b></button>
</form>
</div>
</div>
</div>
</div>
<script src="vendors/jquery/dist/jquery.min.js"></script>
<script src="vendors/popper.js/dist/umd/popper.min.js"></script>
<script src="vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>
Dashboard.PHP :
<!doctype html>
<html class="no-js" lang="en">
<head>
<title>CCMS Admin Dashboard</title>
<link rel="apple-touch-icon" href="apple-icon.png">
<link rel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="vendors/font-
awesome/css/fontawesome.min.css">
<link rel="stylesheet" href="vendors/themify-icons/css/themify-icons.css">
<link rel="stylesheet" href="vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="vendors/selectFX/css/cs-skin-elastic.css">
<link rel="stylesheet" href="vendors/jqvmap/dist/jqvmap.min.css">
<link rel="stylesheet" href="assets/css/style.css">
<link
href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800'
rel='stylesheet' type='text/css'>
</head>
<body class="bg-dark" style="background-image: url('images/Cyber-
CafeClipart.jpg'); background-repeat: no-repeat; background-size: cover;">
<?php session_start();
error_reporting(0);
include('includes/dbconnection.php'); if
(strlen($_SESSION['ccmsaid'] == 0)) {
header('location:logout.php');
}
?>
<?php include_once('includes/sidebar.php');?>
<div id="right-panel" class="right-panel">
<?php include_once('includes/header.php');?>
<div class="breadcrumbs">
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1>Dashboard</h1>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="page-header float-right">
<div class="page-title">
<ol class="breadcrumb text-right">
<li class="active">Dashboard</li>
</ol>
</div>
</div>
</div>
</div>
<div class="content mt-3">
<a href="view-allusers.php" target="_blank">
<div class="col-sm-6 col-lg-6">
<div class="card text-white bg-flat-color-4">
<div class="card-body pb-0">
<?php $query = mysqli_query($con, "SELECT * FROM
tblusers");
$usercounts = mysqli_num_rows($query); ?>
<h3 class="mb-0">
<span class="count"><?php echo $usercounts; ?></span>
</h3>
<p class="text-light">Total Number of Users</p>
<div class="chart-wrapper px-3" style="height:70px;" height="70">
<canvas id="widgetChart4"></canvas>
</div>
</div>
</div>
</div>
</a>
<a href="manage-computer.php" target="_blank">
<div class="col-sm-6 col-lg-6">
<div class="card text-white bg-flat-color-2">
<div class="card-body pb-0">
<?php $query1 = mysqli_query($con, "SELECT * FROM
tblcomputers");
$totalcomp = mysqli_num_rows($query1); ?>
<h3 class="mb-0">
<span class="count"><?php echo $totalcomp; ?></span>
</h3>
<p class="text-light">Total Computers</p>
<div class="chart-wrapper px-0" style="height:70px;"
height="70">
<canvas id="widgetChart2"></canvas>
</div>
</div>
</div>
</div>
</a>
<a href="manage-newusers.php" target="_blank">
<div class="col-sm-6 col-lg-6">
<div class="card text-white bg-flat-color-3">
<div class="card-body pb-0">
<?php $query = mysqli_query($con, "SELECT * FROM tblusers
WHERE Status IS NULL OR Status=''");
$newusers = mysqli_num_rows($query); ?>
<h3 class="mb-0">
<span class="count"><?php echo $newusers; ?></span>
</h3>
<p class="text-light">Total New Users (Still in Cafe)</p>
<div class="chart-wrapper px-3" style="height:70px;" height="70">
<canvas id="widgetChart4"></canvas>
</div>
</div>
</div>
</div>
</a>
<a href="manage-olduser.php" target="_blank">
<div class="col-sm-6 col-lg-6">
<div class="card text-white bg-flat-color-5">
<div class="card-body pb-0">
<?php $query = mysqli_query($con, "SELECT * FROM
tblusers WHERE Status='Out'");
$outusers = mysqli_num_rows($query); ?>
<h3 class="mb-0">
<span class="count"><?php echo $outusers; ?></span>
</h3>
<p class="text-light">Old Users (Out from Cafe)</p>
<div class="chart-wrapper px-3" style="height:70px;" height="70">
<canvas id="widgetChart4"></canvas>
</div>
</div>
</div>
</div>
</a>
</div> <!-- .content -->
</div><!-- /#right-panel →
<script src="vendors/jquery/dist/jquery.min.js"></script>
<script src="vendors/popper.js/dist/umd/popper.min.js"></script>
<script src="vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="assets/js/main.js"></script>
<script src="vendors/chart.js/dist/Chart.bundle.min.js"></script>
<script src="assets/js/dashboard.js"></script>
<script src="assets/js/widgets.js"></script>
<script src="vendors/jqvmap/dist/jquery.vmap.min.js"></script>
<script
src="vendors/jqvmap/examples/js/jquery.vmap.sampledata.js"></script>
<script src="vendors/jqvmap/dist/maps/jquery.vmap.world.js"></script>
<script>
(function($) { "use strict";
jQuery('#vmap').vectorMap({
map: 'world_en',
backgroundColor: null, color:
'#ffffff', hoverOpacity: 0.7,
selectedColor: '#1de9b6',
enableZoom: true, showTooltip:
true, values: sample_data,
scaleColors: ['#1de9b6', '#03a9f5'],
normalizeFunction: 'polynomial'
});
})(jQuery);
</script>
</body>
</html>
ADD COMPUTERS:
<?php
session_start(); error_reporting(0);
include('includes/dbconnection.php'); if
(strlen($_SESSION['ccmsaid']==0)) {
header('location:logout.php');
} else{
if(isset($_POST['submit']))
{
$cmsaid=$_SESSION['ccmsaid'];
$compname=$_POST['compname'];
$comploc=$_POST['comploc'];
$idadd=$_POST['idadd'];
$query=mysqli_query($con,"insert into
tblcomputers(ComputerName,ComputerLocation,IPAdd)
value('$compname','$comploc','$idadd')");
if ($query) {
echo '<script>alert("Computer Detail has been added.")</script>'; echo
"<script>window.location.href ='add-computer.php'</script>";
}
else
{
echo '<script>alert("Something Went Wrong. Please try again")</script>';
}
}
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<title>CCMS Add Computers</title>
<link rel="apple-touch-icon" href="apple-icon.png">
<link rel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="vendors/font-
awesome/css/fontawesome.min.css">
<link rel="stylesheet" href="vendors/themify-icons/css/themify-icons.css">
<link rel="stylesheet" href="vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="vendors/selectFX/css/cs-skin-elastic.css">
<link rel="stylesheet" href="assets/css/style.css">
<link
href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800'
rel='stylesheet' type='text/css'>
</head>
<body>
<!-- Left Panel -->
<?php include_once('includes/sidebar.php');?>
<div id="right-panel" class="right-panel">
<!-- Header-->
<?php include_once('includes/header.php');?>
<div class="breadcrumbs">
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1>Computer Details</h1>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="page-header float-right">
<div class="page-title">
<ol class="breadcrumb text-right">
<li><a href="dashboard.php">Dashboard</a></li>
<li><a href="add-computer.php">Computer Details</a></li>
<li class="active">Add</li>
</ol>
</div>
</div>
</div>
</div>
<div class="content mt-3">
<div class="animated fadeIn">
<div class="row">
<div class="col-lg-6">
<!-- .card -->
</div>
<!--/.col-->
<div class="col-lg-12">
<div class="card">
<div class="card-
header"><strong>Computer</strong><small> Details</small></div>
<form name="computer" method="post" action="">
<p style="font-size:16px; color:red" align="center"> <?php
if($msg){ echo $msg;
} ?> </p>
<div class="card-body card-block">
<?php
session_start(); error_reporting(0);
include('includes/dbconnection.php'); if
(strlen($_SESSION['ccmsaid']==0)) {
header('location:logout.php');
} else{
if(isset($_POST['submit']))
{
$cmsaid=$_SESSION['ccmsaid'];
$username=$_POST['username'];
$uadd=$_POST['uadd'];
$mobilenumber=$_POST['mobilenumber'];
$email=$_POST['email'];
$cname=$_POST['cname'];
$idproof=$_POST['idproof'];
$entryid=mt_rand(100000000, 999999999); $query=mysqli_query($con,"insert
into
tblusers(EntryID,UserName,UserAddress,MobileNumber,Email,ComputerNam
e,IDProof)
value('$entryid','$username','$uadd','$mobilenumber','$email','$cname','$idproof
')"); if ($query) { echo '<script>alert("User Detail has been
added.")</script>'; echo "<script>window.location.href ='add-
users.php'</script>";
}
else
{
echo '<script>alert("Something Went Wrong. Please try again.")</script>';
}
}
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<title>CCMS User Details</title>
<link rel="apple-touch-icon" href="apple-icon.png">
<link rel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="vendors/font-
awesome/css/fontawesome.min.css">
<link rel="stylesheet" href="vendors/themify-icons/css/themify-icons.css">
<link rel="stylesheet" href="vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="vendors/selectFX/css/cs-skin-elastic.css">
<link rel="stylesheet" href="assets/css/style.css">
<link
href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800'
rel='stylesheet' type='text/css'>
</head>
<body>
<!-- Left Panel -->
<?php include_once('includes/sidebar.php');?>
<div id="right-panel" class="right-panel">
<!-- Header-->
<?php include_once('includes/header.php');?>
<div class="breadcrumbs">
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1>User Detail</h1>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="page-header float-right">
<div class="page-title">
<ol class="breadcrumb text-right">
<li><a href="dashboard.php">Dashboard</a></li>
<li><a href="add-users.php">User Detail</a></li>
<li class="active">Add</li>
</ol>
</div>
</div>
</div>
</div>
<div class="content mt-3">
<div class="animated fadeIn">
<div class="row">
<div class="col-lg-6">
<!-- .card -->
</div>
<!--/.col-->
<div class="col-lg-12">
<div class="card">
<div class="card-header"><strong>User</strong><small>
Details</small></div>
<form name="computer" method="post" action="">
<p style="font-size:16px; color:red" align="center"> <?php if($msg){
echo $msg;
} ?> </p>
<div class="card-body card-block">
<div class="form-group"><label for="company" class=" form-
controllabel">User Name</label><input type="text" name="username"
value="" class="form-control" id="username" required="true"></div>
<div class="form-group"><label for="street" class=" form-control-label">User
Address</label><textarea type="text" name="uadd" value="" id="uadd"
class="form-control" required="true"></textarea></div>
<div class="row form-group">
<div class="col-12">
<div class="form-group"><label for="city" class=" form-controllabel">Mobile
Number</label><input type="text" name="mobilenumber" id="mobilenumber"
value="" class="form-control" required="true" maxlength="10" pattern="[0-
9]+"></div>
</div>
<div class="col-12">
<div class="form-group"><label for="city" class=" form-
controllabel">Email</label><input type="email" name="email" id="email"
value="" class="form-control" required="true"></div>
</div>
<div class="col-12">
<div class="form-group"><label for="city"
class=" form-control-label">Computer Name</label><select type="text"
name="cname" id="cname" value="" class="form-control" required="true">
<option value="">Choose Computer</option>
<?php $query=mysqli_query($con,"select * from
tblcomputers"); while($row=mysqli_fetch_array($query))
{
?>
<option value="<?php echo $row['ID'];?>"><?php echo
$row['ComputerName'];?>-(<?php echo
$row['ComputerLocation'];?>)</option>
<?php } ?>
</select></div>
</div>
<div class="col-12">
<div class="form-group"><label for="city"
class=" form-control-label">ID Proof</label><input type="text"
name="idproof" id="idproof" value="" class="form-control"
required="true"></div>
</div>
</div>
</div>
<div class="card-footer">
<p style="text-align: center;"><button
type="submit" class="btn btn-primary btn-sm" name="submit" id="submit">
<i class="fa fa-dot-circle-o"></i> Add
</button></p>
</div>
</div>
</form>
</div>
</div>
</div><!-- .animated -->
</div><!-- .content -->
</div><!-- /#right-panel -->
<!-- Right Panel -->
<script src="vendors/jquery/dist/jquery.min.js"></script>
<script src="vendors/popper.js/dist/umd/popper.min.js"></script>
<script src="vendors/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="vendors/jquery-
validationunobtrusive/dist/jquery.validate.unobtrusive.min.js"></script>
<script
src="vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>
<?php } ?>
Admin Profile:
<?php
session_start(); error_reporting(0);
include('includes/dbconnection.php'); if
(strlen($_SESSION['ccmsaid']==0)) {
header('location:logout.php');
} else{
if(isset($_POST['submit']))
{
$adminid=$_SESSION['ccmsaid'];
$AName=$_POST['adminname'];
$mobno=$_POST['mobilenumber'];
$email=$_POST['email'];
$query=mysqli_query($con, "update tbladmin set AdminName='$AName',
MobileNumber ='$mobno', Email= '$email' where ID='$adminid'"); if
($query) {
$msg="Admin profile has been updated.";
}
else
{
$msg="Something Went Wrong. Please try again.";
}
}
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<title> Admin Profile</title>
<link rel="apple-touch-icon" href="apple-icon.png">
<link rel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="vendors/font-
awesome/css/fontawesome.min.css">
<link rel="stylesheet" href="vendors/themify-icons/css/themify-icons.css">
<link rel="stylesheet" href="vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="vendors/selectFX/css/cs-skin-elastic.css">
<link rel="stylesheet" href="assets/css/style.css">
<link
href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800'
rel='stylesheet' type='text/css'>
</head>
<body>
<!-- Left Panel -->
<?php include_once('includes/sidebar.php');?>
<div id="right-panel" class="right-panel">
<!-- Header-->
<?php include_once('includes/header.php');?>
<div class="breadcrumbs">
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1>Admin Profile</h1>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="page-header float-right">
<div class="page-title">
<ol class="breadcrumb text-right">
<li><a href="dashboard.php">Dashboard</a></li>
<li><a href="adminprofile.php">Admin Profile</a></li>
<li class="active">Update</li>
</ol>
</div>
</div>
</div>
</div>
<div class="content mt-3">
<div class="animated fadeIn">
<div class="row">
<div class="col-lg-6">
<!-- .card -->
</div>
<!--/.col-->
<div class="col-lg-12">
<div class="card">
<div class="card-header"><strong>Admin</strong><small>
Profile</small></div>
<form name="profile" method="post" action="">
<p style="font-size:16px; color:red" align="center"> <?php if($msg){
echo $msg;
} ?> </p>
<div class="card-body card-block">
<?php
$adminid=$_SESSION['ccmsaid'];
$ret=mysqli_query($con,"select * from tbladmin where ID='$adminid'");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {
?>
<div class="form-group"><label for="company" class=" form-
controllabel">Admin Name</label><input type="text" name="adminname"
value="<?php echo $row['AdminName'];?>" class="form-control"
required='true'></div>
<div class="form-group"><label for="vat" class=" form-control-label">User
Name</label><input type="text" name="username" value="<?php echo
$row['UserName'];?>" class="form-control" readonly=""></div> <div
class="form-group"><label for="street" class=" form-
controllabel">Contact Number</label><input type="text"
name="mobilenumber" value="<?php echo $row['MobileNumber'];?>"
class="form-control" maxlength='10' required='true'></div>
<div class="row form-group">
<div class="col-12">
<div class="form-group"><label for="city" class=" form-
controllabel">Email</label><input type="email" name="email" value="<?php
echo
$row['Email'];?>" class="form-control" required='true'></div>
</div>
<div class="col-12">
<div class="form-group"><label for="postal-code" class=" form-
controllabel">Admin Registration Date</label><input type="text" name=""
value="<?php echo $row['AdminRegdate'];?>" readonly=""
class="formcontrol"></div>
</div>
</div>
</div>
<?php } ?>
<div class="card-footer">
<p style="text-align: center;">
<button type="submit" class="btn btn-primary btn-sm" name="submit"
id="submit">
<i class="fa fa-dot-circle-o"></i> Update
</button></p>
</div>
</div>
</form>
</div>
</div>
</div><!-- .animated -->
</div><!-- .content -->
</div><!-- /#right-panel -->
<!-- Right Panel -->
<script src="vendors/jquery/dist/jquery.min.js"></script>
<script
src="vendors/popper.js/dist/umd/popper.min.js"></script>
<script
src="vendors/jqueryvalidation/dist/jquery.validate.min.js"></script>
<script src="vendors/jquery-
validationunobtrusive/dist/jquery.validate.unobtrusive.min.js"></script>
<script
src="vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="assets/js/main.js"></script> </body>
</html>
<?php } ?>
CHANGE PASSWORD.PHP:
<?php
session_start(); error_reporting(0);
include('includes/dbconnection.php'); error_reporting(0);
if (strlen($_SESSION['ccmsaid']==0)) {
header('location:logout.php');
} else{
if(isset($_POST['submit']))
{
$adminid=$_SESSION['ccmsaid'];
$cpassword=md5($_POST['currentpassword']);
$newpassword=md5($_POST['newpassword']);
$query=mysqli_query($con,"select ID from tbladmin where ID='$adminid' and
Password='$cpassword'"); $row=mysqli_fetch_array($query); if($row>0){
$ret=mysqli_query($con,"update tbladmin set Password='$newpassword' where
ID='$adminid'");
$msg= "Your password successully changed";
} else {
$msg="Your current password is wrong";
}
}
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<title>CCMS Change Password</title>
<link rel="apple-touch-icon" href="apple-icon.png">
<link rel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="vendors/font-awesome/css/fontawesome.min.css">
<link rel="stylesheet" href="vendors/themify-icons/css/themify-icons.css">
<link rel="stylesheet" href="vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="vendors/selectFX/css/cs-skin-elastic.css">
<link rel="stylesheet" href="assets/css/style.css">
<href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800'
rel='stylesheet' type='text/css'> <script type="text/javascript"> function
checkpass()
{
if(document.changepassword.newpassword.value!=document.changepassword.
confirmpassword.value)
{
alert('New Password and Confirm Password field does not match');
document.changepassword.confirmpassword.focus(); return false;
}
return true;
}
</script>
</head>
<body>
<!-- Left Panel -->
<?php include_once('includes/sidebar.php');?>
<div id="right-panel" class="right-panel">
<!-- Header-->
<?php include_once('includes/header.php');?>
<div class="breadcrumbs">
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1>Change Password</h1>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="page-header float-right">
<div class="page-title">
<ol class="breadcrumb text-right">
<li><a href="dashboard.php">Dashboard</a></li>
<li><a href="change-password.php">Change
Password</a></li>
<li class="active">Change</li>
</ol>
</div>
</div>
</div>
</div>
<div class="content mt-3">
<div class="animated fadeIn">
<div class="row">
<div class="col-lg-6">
<!-- .card -->
</div>
<!--/.col-->
<div class="col-lg-12">
<div class="card">
<div class="card-header"><strong>Change</strong><small>
Password</small></div>
<form name="changepassword" method="post" onsubmit="return checkpass();"
action="">
<p style="font-size:16px; color:red" align="center"> <?php if($msg){
echo $msg;
} ?> </p>
<div class="card-body card-block">
<?php
$adminid=$_SESSION['ccmsaid'];
$ret=mysqli_query($con,"select * from tbladmin where ID='$adminid'");
$cnt=1;
while ($row=mysqli_fetch_array($ret)) {
?>
<div class="form-group"><label for="company" class=" form-
controllabel">Current Password</label><input type="password"
name="currentpassword" id="currentpassword" class="form-control"
required=""></div>
<div class="form-group"><label for="vat" class=" form-control-label">New
Password</label><input type="password" name="newpassword"
class="formcontrol" required=""></div>
<div class="form-group"><label for="street" class=" form-
controllabel">Confirm Password</label><input type="password"
name="confirmpassword" id="confirmpassword" value=""
class="formcontrol"></div>
</div>
<?php } ?>
<div class="card-footer">
<p style="text-align: center;"><button
type="submit" class="btn btn-primary btn-sm" name="submit" id="submit">
<i class="fa fa-dot-circle-o"></i> Change
</button></p>
</div>
</div>
</form>
</div>
</div>
</div><!-- .animated -->
</div><!-- .content -->
</div><!-- /#right-panel -->
<!-- Right Panel -->
<script src="vendors/jquery/dist/jquery.min.js"></script>
<script
src="vendors/popper.js/dist/umd/popper.min.js"></script>
<script src="vendors/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="vendors/jquery-
validationunobtrusive/dist/jquery.validate.unobtrusive.min.js"></script>
<script
src="vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>
<?php } ?>
SEARCH.PHP:
<?php
session_start(); error_reporting(0);
include('includes/dbconnection.php'); if
(strlen($_SESSION['ccmsaid']==0)) {
header('location:logout.php');
} else{
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<title>CCMS Search</title>
<link rel="apple-touch-icon" href="apple-icon.png">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="vendors/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="vendors/themify-icons/css/themify-icons.css">
<link rel="stylesheet" href="vendors/flag-icon-css/css/flag-icon.min.css">
<link rel="stylesheet" href="vendors/selectFX/css/cs-skin-elastic.css">
<link rel="stylesheet" href="assets/css/style.css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800'
rel='stylesheet' type='text/css'>
</head>
<body>
<!-- Left Panel -->
<?php include_once('includes/sidebar.php');?>
<div id="right-panel" class="right-panel">
<!-- Header-->
<?php include_once('includes/header.php');?>
<div class="breadcrumbs">
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1>Search Users</h1>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="page-header float-right">
<div class="page-title">
<ol class="breadcrumb text-right">
<li><a href="dashboard.php">Dashboard</a></li>
<li><a href="search.php">Search Users</a></li>
<li class="active">Users</li>
</ol>
</div>
</div>
</div>
</div>
<div class="content mt-3">
<div class="animated fadeIn">
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<strong class="card-title">Search Users</strong>
</div>
<form name="search" method="post" style="padding-top: 20px" >
<div class="row">
<div class="col-12">
<div class="card-box">
<div class="form-group row">
<label class="col-4 col-form-label" for="example-email"
style="padding-left: 50px"><strong>Search by Username or Entry ID</strong></label>
<div class="col-6">
<input id="searchdata" type="text" name="searchdata"
required="true" class="form-control">
</div>
</div>
<div class="card-footer">
<p style="text-align: center;"><button type="submit"
class="btn btn-primary btn-sm" name="search" id="submit">
<i class="fa fa-dot-circle-o"></i> Search
</button></p>
</div>
</div>
</form>
<?php
if(isset($_POST['search']))
{
$sdata=$_POST['searchdata'];
?>
<h4 align="center">Result against "<?php echo $sdata;?>" keyword </h4>
<div class="card-body">
<table class="table">
<thead>
<tr>
<tr>
<th>S.NO</th>
<th>User ID</th>
<th>User Name</th>
<th>In Time</th>
<th>Action</th>
</tr>
</tr>
</thead>
<?php
$ret=mysqli_query($con,"select *from tblusers where EntryID like '%$sdata%' || UserName
like '%$sdata%' ");
$num=mysqli_num_rows($ret);
if($num>0){ $cnt=1;
while ($row=mysqli_fetch_array($ret)) {
?>
<tr>
<td><?php echo $cnt;?></td>
<td><?php echo $row['EntryID'];?></td>
<td><?php echo $row['UserName'];?></td>
<td><?php echo $row['InTime'];?></td>
<td><a href="view-user-detail.php?upid=<?php echo $row['ID'];?>" class="btn
btn-primary btn-sm">View</a></td>
</tr>
<?php
$cnt=$cnt+1;
} } else { ?>
<tr>
<td colspan="8"> No record found against this search</td>
</tr>
<?php } }?>
</table>
</div>
</div>
</div>
</div>
</div><!-- .animated -->
</div><!-- .content -->
</div><!-- /#right-panel -->
<!-- Right Panel -->
<script src="vendors/jquery/dist/jquery.min.js"></script>
<script src="vendors/popper.js/dist/umd/popper.min.js"></script>
<script src="vendors/bootstrap/dist/js/bootstrap.min.js"></script>?>
SCREENSHOTS
HOME PAGE:
LOGIN PAGE:
ADMIN PAGE:
SEARCH PAGE:
2. Database Design
• Design and implement the database schema using MySQL. The main tables
might include:
• Users: Store user data (both customers and staff).
• sql
db_code
<?php
// Start the session to track user data
session_start();
// Database connection (PDO) try
{
$pdo = new PDO('mysql:host=localhost;dbname=cyber_cafe', 'root', 'password');
$pdo->setAttribute(PDO::ATTR_ERRMODE,
PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
die("Connection failed: " . $e->getMessage());
}
// Check if user is logged in, otherwise redirect to login page if
(!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
}
// Handle form submission (Login or Session start)
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// Handle login if
(isset($_POST['login'])) {
$email = $_POST['email'];
$password = $_POST['password'];
// Query to verify user credentials
$stmt = $pdo->prepare("SELECT * FROM users WHERE email = :email");
$stmt->execute(['email' => $email]);
$user = $stmt->fetch();
if ($user && password_verify($password, $user['password'])) {
$_SESSION['user_id'] = $user['user_id'];
$_SESSION['user_name'] = $user['name'];
$_SESSION['role'] = $user['role'];
header("Location: dashboard.php");
exit();
} else {
$error_message = "Invalid login credentials.";
}
}
// Handle session start (for customers)
if (isset($_POST['start_session'])) {
$user_id = $_SESSION['user_id'];
$stmt = $pdo->prepare("INSERT INTO sessions (user_id, start_time)
VALUES (:user_id, NOW())");
$stmt->execute(['user_id' => $user_id]);
$session_id = $pdo->lastInsertId(); // Get the last inserted session ID
$_SESSION['session_id'] = $session_id;
}
}
// Fetch user sessions for the dashboard
$stmt = $pdo->prepare("SELECT * FROM sessions WHERE user_id = :user_id");
$stmt->execute(['user_id' => $_SESSION['user_id']]);
$sessions = $stmt->fetchAll();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cyber Cafe Management</title>
</head>
<body>
<?php if (isset($error_message)): ?>
<p style="color:red;"><?php echo $error_message; ?></p>
<?php endif; ?>
<!-- Display a form to login or start session -->
<?php if (!isset($_SESSION['user_id'])): ?>
<h2>Login</h2>
<form method="POST">
<label for="email">Email:</label>
<input type="email" name="email" required>
<label for="password">Password:</label>
<input type="password" name="password" required>
<button type="submit" name="login">Login</button>
</form>
<?php else: ?>
<!-- If logged in, show user dashboard -->
<h2>Welcome, <?php echo $_SESSION['user_name']; ?></h2>
<p>Role: <?php echo $_SESSION['role']; ?></p>
<!-- Start a new session for the customer -->
<form method="POST">
<button type="submit" name="start_session">Start New Session</button>
</form>
<h3>Your Sessions:</h3>
<ul>
<?php foreach ($sessions as $session): ?>
<li>
Session ID: <?php echo $session['session_id']; ?> |
Start Time: <?php echo $session['start_time']; ?> |
<?php if ($session['end_time']): ?>
End Time: <?php echo $session['end_time']; ?> |
Total Time: <?php echo $session['total_time']; ?> minutes
<?php else: ?>
<span style="color:green;">Active</span>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<a href="logout.php">Logout</a>
<?php endif; ?>
</body>
</html>
Conclusion:
The System Implementation Phase for a Cyber Cafe Management
System involves setting up the development environment,
designing the database, implementing core features (user
authentication, session management, billing), and thorough testing
before deployment. This phase is critical for ensuring that the
system works as intended and meets the needs of both customers
and cafe administrators.
REFRENCES:
https://youtu.be/qaf4cDPsW68
https://youtu.be/qaf4cDPsW87
https://youtu.be/VGYf4cDPsW8