831 PHP
831 PHP
CODE :
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<style type="text/css">
body{
background-image: url(image/1.jpg);
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
.home_details{
color: #fff;
font-family: inherit;
font-size: 74px;
.font{
color: #F9522E;
.btnHome{
font-family: inherit;
background-color: #F9522E;
font-size: 18px;
border-style: none;
.btnHome:hover{
background-color: orange;
cursor: pointer;
</style>
</head>
<body>
<div id="container">
<?php include("nav.php");
?>
<br>
</h1>
</div>
<?php include("footer.php");
?>
</body>
</html>
ADMIN MODULE:
1) ADMIN LOGIN :
CODE:
<?php
session_start();
?>
<!DOCTYPE html>
<head>
</head>
<body>
<div class="login-box">
<h1>Admin Login</h1>
<form method="POST">
<p>Username</p>
<p>Password</p>
</form>
</div>
<?php
if(isset($_POST['login'])){
$result=mysqli_query($conn,$query);
if(mysqli_num_rows($result)==1){
// session_start();//
$_SESSION['username']=$_POST['Admin_username'];
header("location:adminDash.php");
else{
}}
?>
</body>
</html>
CODE:
<?php
session_start();
?>
<?php include("connection.php")?>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
</style>
</head>
<body>
<label for="check">
</label>
<div class="sidebar">
<header><img src="image/Re.png">
</header>
<ul>
<li><a href="adminLogout.php">logout</a></li>
</ul>
</div>
<div class="sidebar2">
<?php
echo "<table>";
echo "<tr>
<th>ID</th>
<th>Via City</th>
<th>Destination</th>
<th>Bus Name</th>
<th>Departure Date</th>
<th>Departure Time</th>
<th>Cost</th>
<th>Update</th>
<th>Delete</th>
</tr>";
while ($row=mysqli_fetch_array($sqldata,MYSQLI_ASSOC))
echo "<tr><td>";
echo $row['id'];
echo "</td><td>";
echo $row['via_city'];
echo "</td><td>";
echo $row['destination'];
echo "</td><td>";
echo $row['bus_name'];
echo "</td><td>";
echo $row['departure_date'];
echo "</td><td>";
echo $row['departure_time'];
echo "</td><td>";
echo $row['cost'];
echo "</td>"
?>
<td>
Update
</a>
</button>
</td><td>
</a>
</button>
</td></tr>
<?php
echo "</table>";
?>
<br>
</div>
</body>
</html>
CODE:
<?php
session_start();
?>
<?php include("connection.php")?>
<!DOCTYPE html>
<html>
<head>
<title>Routes adding</title>
<style type="text/css">
</style>
</head>
<body>
<label for="check">
</label>
<div class="sidebar">
<header><img src="image/Re.png">
</header>
<ul>
<li><a href="adminLogout.php">logout</a></li>
</ul>
</div>
<div class="sidebar2">
<?php
if(isset($_POST['routeAdd'])){
$via_city=$_POST['via_city'];
$destination=$_POST['destination'];
$bus_name=$_POST['bus_name'];
$dep_date=$_POST['departure_date'];
$dep_time=$_POST['departure_time'];
$cost=$_POST['cost'];
if($conn->connect_error {
else
$stmt=$conn->prepare("INSERT INTO
route(via_city,destination,bus_name,departure_date,departure_time,cost) VALUES(?,?,?,?,?,?)");
$stmt->bind_param("sssssi",$via_city,$destination,$bus_name,$dep_date, $dep_time,$cost);
$stmt->execute();
$stmt->close();
$conn->close(); }
} ?>
<div class="wrapper">
<div class="registration_form">
<div class="title">
Routes adding
</div>
<div class="form_wrap">
<div class="input_wrap">
</div>
<div class="input_wrap">
<label for="title">Destination</label>
</div>
<div class="input_wrap">
</div>
<div class="input_wrap">
</div>
<div class="input_wrap">
</div>
<div class="input_wrap">
<label for="title">Cost</label>
</div>
<div class="input_wrap">
</body>
</html>
session_start();
?>
<?php include("connection.php")?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<label for="check">
</label>
<div class="sidebar">
<header><img src="image/Re.png">
<ul>
<li><a href="adminLogout.php">logout</a></li>
</ul>
</div>
<?php
if(isset($_POST['routeUpdate'])){
$id=$_POST['id'];
$via_city=$_POST['Via_city'];
$destination=$_POST['destination'];
$bus_name=$_POST['bus_name'];
$dep_date=$_POST['departure_date'];
$dep_time=$_POST['departure_time'];
$cost=$_POST['cost'];
$query_run=mysqli_query($conn,$query);
if($query_run){
else{
}}
?>
<div class="sidebar2">
<div class="wrapper">
<div class="registration_form">
<div class="title">
</div>
<div class="form_wrap">
<div class="input_wrap">
<label for="title">Id</label>
</div>
<div class="input_wrap">
<label for="title">Via_city</label>
</div>
<div class="input_wrap">
<label for="title">Destination</label>
</div>
<div class="input_wrap">
</div>
<div class="input_wrap">
</div>
<div class="input_wrap">
</div>
<div class="input_wrap">
<label for="title">Cost</label>
</div>
<div class="input_wrap">
</div></div></form></div></div></div>
</body>
</html>
include 'connection.php';
$ID = $_GET['id'];
$query = mysqli_query($conn,$sql);
window.location.href='adminDash.php';
</script>");
?>
<?php
session_start();
include("connection.php")
?>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
</head>
<body>
<label for="check">
</label>
<div class="sidebar">
<header><img src="image/Re.png">
</header>
<ul>
<li><a href="PaymentManage.php">Transaction</a></li>
<li><a href="adminLogout.php">logout</a></li>
</ul>
</div>
<div class="sidebar2">
<?php
echo "<table>";
echo "<tr>
<th>ID</th>
<th>bus_name</th>
<th>Tel Number</th>
<th>Update</th>
<th>Delete</th>
</tr>";
while ($row=mysqli_fetch_array($sqldata,MYSQLI_ASSOC))
echo "<tr><td>";
echo $row['id'];
echo "</td><td>";
echo $row['Bus_Name'];
echo "</td><td>";
echo $row['Tel'];
echo "</td>";
?>
<td>
Update
</a>
</button>
</td><td>
</button>
</td></tr>
<?php }
echo "</table>";
?>
</div>
</body>
</html>
<?php
session_start();
?>
<?php include("connection.php")?>
<!DOCTYPE html>
<html>
<head>
<title>Routes adding</title>
<style type="text/css">
</style>
</head>
<body>
<label for="check">
</label>
<div class="sidebar">
<header><img src="image/Re.png">
</header>
<ul>
<li><a href="adminLogout.php">logout</a></li>
</ul>
</div>
<div class="sidebar2">
<?php
if(isset($_POST['AddBus'])){
//$id=$_POST['id'];
$nameOFbus=$_POST['bus_name'];
$tel=$_POST['tel'];
if($conn->connect_error {
else{
$stmt->bind_param("ss", $nameOFbus,$tel);
$stmt->execute();
window.location.href='ManagesBuses.php';
</script>");
$stmt->close();
$conn->close();
} }
?>
<div class="wrapper">
<div class="registration_form">
<div class="title">
Bus adding
</div>
<div class="form_wrap">
<div class="input_wrap">
</div>
<div class="input_wrap">
<label for="title">Telephone</label>
</div>
<div class="input_wrap">
</div></div></form></div></div></div>
</body>
</html>
CODE :
<?php
session_start();
include("connection.php");
?>
<?php include("connection.php")?>
<!DOCTYPE html>
<html>
<head>
<title>Booking Manage</title>
</head>
<body>
<label for="check">
</label>
<div class="sidebar">
<header><img src="image/Re.png">
</header>
<ul>
<li><a href="adminLogout.php">logout</a></li>
</ul>
</div>
<div class="sidebar2">
<?php
echo "<table>";
echo "<tr>
<th>ID</th>
<th>Passenger Name</th>
<th>Tel</th>
<th>E-mail</th>
<th>Boarding Place</th>
<th>His/Her Destination</th>
<th>Update</th>
<th>Delete</th>
</tr>";
while ($row=mysqli_fetch_array($sqldata,MYSQLI_ASSOC)) {
echo "<tr><td>";
echo $row['id'];
echo "</td><td>";
echo $row['passenger_name'];
echo "</td><td>";
echo $row['telephone'];
echo "</td><td>";
echo $row['email'];
echo "</td><td>";
echo $row['boarding_place'];
echo "</td><td>";
echo $row['Your_destination'];
echo "</td>";
?>
<td>
</button>
</td>
<td>
</button>
</td></tr>
<?php }
echo "</table>";?>
<?php ?>
</div>
</body>
</html>
5) ADMIN LOGOUT :
<?php
session_start();
if(isset($_SESSION['username']))
unset($_SESSION['username']);
header("Location: adminLogin.php");
die;
?>
USER MODULE:
1) USER SIGNUP :
CODE :
<!DOCTYPE html>
<head>
<meta charset="utf-8">
</head>
<body>
<div class="confirm">
<?php
session_start();
include("connection.php");
include("function.php");
if($_SERVER['REQUEST_METHOD'] == "POST")
$user_name = $_POST['user_name'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$password = $_POST['password'];
$con_pass=$_POST['cpassword'];
if($password==$con_pass){
$user_id = random_num(20);
mysqli_query($conn,$query);
window.location.href='Login.php';
</script>"); }
else{
}}
else{
} }
?>
</div>
<div class="wrapper">
<div class="registration_form">
<div class="title">
</div>
<div class="form_wrap">
<div class="input_grp">
<div class="input_wrap">
</div>
<div class="input_wrap">
</div>
</div>
<div class="input_wrap">
</div>
<div class="input_wrap">
<label for="uname">Username</label>
</div>
<div class="input_wrap">
<label for="password">Password</label>
</div>
<div class="input_wrap">
</div>
<div class="input_wrap">
</body>
</html>
2) USER LOGIN :
CODE:
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>EZfare Login</title>
</head>
<body>
<?php
session_start();
include("connection.php");
include("function.php");
if($_SERVER['REQUEST_METHOD'] == "POST")
$user_name = $_POST['user_name'];
$password = $_POST['password'];
if($result){
$user_data = mysqli_fetch_assoc($result)
$_SESSION['user_id'] = $user_data['user_id'];
header("Location:viewBus.php");
die;
} } }
}else
} }
?>
<div class="login-box">
<form method="post">
<p>Username</p>
<p>Password</p>
</form>
</div>
</body>
</html>
<?php
session_start();
include("connection.php");
include("function.php");
$user_data = check_login($conn);
?>
<?php include("connection.php")?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<label for="check">
</label>
<div class="sidebar">
<header><img src="image/Re.png">
</header>
<ul>
<li><a href="profile.php">Profile</a></li>
<li><a href="logout.php">logout</a></li>
</ul>
</div>
<div class="sidebar2">
<?php
echo "<table>";
echo "<tr>
<th>ID</th>
<th>Via City</th>
<th>Destination</th>
<th>Bus Name</th>
<th>Departure Date</th>
<th>Departure Time</th>
<th>Cost</th>
<th>Booking</th>
</tr>";
while ($row=mysqli_fetch_array($sqldata,MYSQLI_ASSOC))
echo "<tr><td>";
echo $row['id'];
echo "</td><td>";
echo $row['via_city'];
echo "</td><td>";
echo $row['destination'];
echo "</td><td>";
echo $row['bus_name'];
echo "</td><td>";
echo $row['departure_date'];
echo "</td><td>";
echo $row['departure_time'];
echo "</td><td>";
echo $row['cost'];
echo "</td>";
?>
<td>
Book Now
</a>
</button>
</td></tr>
<?php }
echo "</table>";
?>
</div>
</body>
</html>
Code:
<?php
session_start();
include("connection.php");
include("function.php");
$user_data = check_login($conn);
?>
<?php include("connection.php")?>
<!DOCTYPE html>
<html>
<head>
<title>booking page</title>
</head>
<body>
<label for="check">
</label>
<div class="sidebar">
<header><img src="image/Re.png">
</header>
<ul>
<li><a href="profile.php">Profile</a></li>
<li><a href="logout.php">logout</a></li>
</ul>
</div>
<div class="sidebar2">
<?php
?>
<?php
if(isset($_POST['AddBooking'])){
$passenger=$_POST['passenger_name'];
$tel=$_POST['tel'];
$email=$_POST['email'];
$board_place=$_POST['board_place'];
$desti=$_POST['Your_destination'];
if($conn->connect_error) {
else {
$stmt=$conn->prepare("INSERT INTO
booking(passenger_name,telephone,email,boarding_place,Your_destination) VALUES(?,?,?,?,?)");
$stmt->bind_param("sssss",$passenger,$tel,$email,$board_place,$desti);
$stmt->execute();
$stmt->close();
$conn->close();
} }
<div class="registration_form">
<div class="title">
Geting A Ticket...
</div>
<div class="form_wrap">
<div class="input_wrap">
</div>
<div class="input_wrap">
<label for="title">Telephone</label>
</div>
<div class="input_wrap">
<label for="title">E-mail</label>
</div>
<div class="input_wrap">
</div>
<div class="input_wrap">
</div>
<div class="input_wrap">
</body>
</html>
5) USER PROFILE :
Code:
<?php
session_start();
include("connection.php");
include("function.php");
$user_data = check_login($conn);
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body >
<div class="wrapper">
<div class="left">
<br>
</div>
</div>
<div class="right"><b>
<h3>Account Information</h3><hr/><br/>
<br>
<button class="btn3">Update</button></a>
<a href="logout.php">
<button class="btn3">Logout</button></a>
<button class="btn3">Delete</button></a></b>
</div>
</body>
</html>
<?php
session_start()
?>
<?php
include("connection.php");
?>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
</head>
<body>
<?php
if(isset($_POST['updateprofile'])){
$id=$_POST['id'];
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$email=$_POST['email'];
$username=$_POST['user_name'];
$password=$_POST['password'];
$query_run=mysqli_query($conn,$query);
if($query_run){
window.location.href='profile.php';
</script>"); }
else{
<div class="registration_form">
<div class="title">
</div>
<div class="form_wrap">
<div class="input_grp">
<div class="input_wrap">
</div>
<div class="input_wrap">
</div> </div>
<div class="input_wrap">
<label for="title">Id</label>
</div>
<div class="input_wrap">
</div>
<div class="input_wrap">
<label for="uname">Username</label>
</div>
<div class="input_wrap">
<label for="password">Password</label>
</div>
<div class="input_wrap">
</body>
</html>
include 'connection.php';
$ID = $_GET['id'];
$query = mysqli_query($conn,$sql);
window.location.href='Login.php';
</script>");
?>
6) USER LOGOUT :
<?php
session_start();
if(isset($_SESSION['user_id']))
{
unset($_SESSION['user_id']);
}
echo ("<script LANGUAGE='JavaScript'>
window.alert('Do you need to Logout?');
window.location.href='Login.php';
</script>"
//header("Location: Login.php");
die;