0% found this document useful (0 votes)
39 views

DBMS Project

The document describes a college event management system project. It includes details like team members, problem statement, objectives, requirement analysis, database design including entity relationship diagram and tables, and frontend pages for registration, about us and contact us.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

DBMS Project

The document describes a college event management system project. It includes details like team members, problem statement, objectives, requirement analysis, database design including entity relationship diagram and tables, and frontend pages for registration, about us and contact us.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 40

College-Online Event Management

System
Team Members:
1. Samridhi Kanwar-2022UCM2342
2. Ujjwal Singla-2022UCM2355
3. Prateek Singh-2022UCM2362
CHAPTER 1 INTRODUCTION
1.1 Introduction of the Problem Area-
Abstract- College Event Management System is
developed to assist students and faculties in handling
college events such as Technical fests, and other events
which involves registration of users to the events
through a web application.

1.2 Problem Statement/Purpose of the Project –


The Event Management System is a responsive, dynamic
web application with which the users can interact and
register to events of their choice with ease. This will
eliminate the need for unnecessary paperwork involved.

1.3 Objective of the Project –


Additionally, the system needs to handle payment
information securely and generate relevant reports for
event management. The goal is to improve overall
efficiency, reduce errors and anomalies, and enhance
the user experience.
Keywords: Event Management System, Event
handling, PHP, MYSQL and beneficiaries.

1.4 Find and organize the information required(Requirement


Analysis)—
Requirement Analysis :
 An event management company has several
events. Each event has an event_id(P.K.)
associated with it. It has event (event_id, event_title ,
event_price, participants, img_link, type_id.)

 The event has certain information related to


it. event_info(event_id , date , time, location).
 The event has a type associated with it
event_type(type_id, type_title)
 Each event has participants taking part in
that event. participant( usn , name ,branch, sem,
email,phone,college )
 The event will also have registered
participant details. registered (rid , usn , event_id ).
 Each event also has a staff-Coordinator (stid ,
name , phone , event_id )
 Each event also has a student-Coordinator
(sid , st_name , phone , event_id ).
CHAPTER 3 DESIGN
3.1 ER Model

Link for the above ER Model Diagram is –


https://lucid.app/lucidchart/06d6bbbe-4e95-421f-99c5-f4de277091b3/edit?
viewport_loc=49%2C195%2C2651%2C1276%2C0eqBfotfVGlV&invitationId=inv
_4a2e99a7-f898-4175-b3be-928e1b19917e
3.2 ER to Schema {Divide the information into tables}—

3.5 Set-up the table relationship


1. Event (event_id, event_title , event_price, participants, img_link, type_id.)

Events Table (event):


 event_id (Primary Key)
 event_title
 event_price
 participants
 img_link
 type_id (Foreign Key)

Functional Dependencies:
 {event_id} -> {event_title, event_price, participants, img_link,
type_id}
 {type_id} -> {type_title}
This table is in 3rd Normal Form (3NF) and Boyce-Codd Normal Form
(BCNF) as there are no partial or transitive dependencies.

2. Event_info(event_id , date , time, location)

Event Information Table (event_info):


 event_id (Foreign Key)
 date
 time
 location

Functional Dependencies:
 {event_id} -> {date, time, location}
This table is in 3rd Normal Form (3NF) and Boyce-Codd Normal Form
(BCNF) as there are no partial or transitive dependencies.

3. Event_type(type_id, type_title)
Event Type Table (event_type):
 type_id (Primary Key)
 type_title

Functional Dependencies:
 {type_id} -> {type_title}
This table is in 3rd Normal Form (3NF) and Boyce-Codd Normal Form
(BCNF) as there are no partial or transitive dependencies.

4. Participant(usn , name ,branch, sem, email,phone,college )

Participants Table (participant):


 usn (Primary Key)
 name
 branch
 sem
 email
 phone
 college

Functional Dependencies:
 {usn} -> {name, branch, sem, email, phone, college}
This table is in 3rd Normal Form (3NF) and Boyce-Codd Normal Form
(BCNF) as there are no partial or transitive dependencies.
5. Registered (rid, usn, event_id)

Registered Participants Table (registered):


 rid (Primary Key)
 usn (Foreign Key)
 event_id (Foreign Key)

Functional Dependencies:
 {rid} -> {usn, event_id}
 {usn, event_id} -> {rid}
This table is in 3rd Normal Form (3NF) and Boyce-Codd Normal Form
(BCNF) as there are no partial or transitive dependencies.

6. Staff-Coordinator(stid , name , phone , event_id )

Staff Coordinator Table (staff_coordinator):


 stid (Primary Key)
 name
 phone
 event_id (Foreign Key)

Functional Dependencies:
 {stid} -> {name, phone, event_id}
 {event_id} -> {stid}
This table is in 3rd Normal Form (3NF) and Boyce-Codd Normal Form
(BCNF) as there are no partial or transitive dependencies.

7. Student-Coordinator (sid , st_name , phone , event_id )

Student Coordinator Table (student_coordinator):


 sid (Primary Key)
 st_name
 phone
 event_id (Foreign Key)

Functional Dependencies:
 {sid} -> {st_name, phone, event_id}
 {event_id} -> {sid}
This table is in 3rd Normal Form (3NF) and Boyce-Codd Normal Form
(BCNF) as there are no partial or transitive dependencies.

Xampp tutorial –
The github project link is as follows-
 https://github.com/SamridhiKanwar/
DBMS_project
 First open XAMPP Control.
 Run Apache and My_SQL(Click on start) and
click on admin.
 The database created (cems) will pop up.
 Now open -
http://localhost/College-Event-Management-
System-master/usn.php

1. About Us Page-
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
<?php require 'utils/styles.php'; ?><!--css links. file found in utils
folder-->
</head>
<style>
/* Large rounded green border */
hr.blueline {
border: 10px solid #00004d;
border-radius: 5px;
}
#bj
{
font-size: 22px;
}
</style>
<?php require 'utils/header.php'; ?>
<hr class="blueline">
<div class="col-md-12">
<h1>About Us</h1> <p> Our college Mission is to impart quality technical
education and higher moral ethics associated with skilled training to suit the
modern day technology with innovative concepts,so as to learn to lead the
future with full confidence.</p>
</div>
<hr class="blueline">
</body>
<?php require 'utils/footer.php'; ?>
</html>

2. Contact Us Page-

<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
<?php require 'utils/styles.php'; ?><!--css links. file found in utils
folder-->
<head>
<body>
<?php require 'utils/header.php'; ?><!--header content. file found in
utils folder-->
<div class = "content"><!--body content holder-->
<div class = "container">
<div class = "col-md-12"><!--body content title holder with 12
grid columns-->
<h1 style="color:#003300 ; font-
size:38px ;"><strong>Contact Us</strong></h1><!--body content title-->
</div>
</div>
<div class="container">
<div class="col-md-12">
<hr>
</div>
</div>
<div class="container">
<div class="col-md-6 contacts">
<h1 style="color:#000080 ; font-size:42px ; font-
style:bold "><span class="glyphicon glyphicon-user"></span> College</h1>
<p>
<span class="glyphicon glyphicon-envelope"></span>
Email: [email protected]<br>

<span class="glyphicon glyphicon-phone"></span>


Mobile: 9123456789
</p>
</div>
<div class="col-md-6 contacts">
<h1 style="color:#000080 ; font-size:42px ; font-
style:bold "><span class="glyphicon glyphicon-user"></span> Example</h1>
<p>
<span class="glyphicon glyphicon-envelope"></span>
Email: [email protected]<br>

<span class="glyphicon glyphicon-phone"></span>


Mobile: 9876543210
</p>
</div>
</div>
</div><!--body content div-->
<?php require 'utils/footer.php'; ?><!--footer content. file found
in utils folder-->
</body>
</html>

3. Register Form-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
<?php require 'utils/styles.php'; ?><!--css links. file found in utils
folder-->
</head>
<body>
<?php require 'utils/header.php'; ?>
<div class ="content"><!--body content holder-->
<div class = "container">
<div class ="col-md-6 col-md-offset-3">
<form method="POST">
<label>Student USN:</label><br>
<input type="text" name="usn" class="form-control" required><br><br>

<label>Student Name:</label><br>
<input type="text" name="name" class="form-control" required><br><br>

<label>Branch:</label><br>
<input type="text" name="branch" class="form-control"
required><br><br>

<label>Semester:</label><br>
<input type="text" name="sem" class="form-control" required><br><br>

<label>Email:</label><br>
<input type="text" name="email" class="form-control" required
><br><br>

<label>Phone:</label><br>
<input type="text" name="phone" class="form-control"
required><br><br>
<label>College:</label><br>
<input type="text" name="college" class="form-control"
required><br><br>

<button type="submit" name="update" required>Submit</button><br><br>


<a href="usn.php" ><u>Already registered ?</u></a>
</div>
</div>
</div>
</form>
<?php require 'utils/footer.php'; ?>
</body>
</html>
<?php
if (isset($_POST["update"]))
{
$usn=$_POST["usn"];
$name=$_POST["name"];
$branch=$_POST["branch"];
$sem=$_POST["sem"];
$email=$_POST["email"];
$phone=$_POST["phone"];
$college=$_POST["college"];
if( !empty($usn) || !empty($name) || !empty($branch) || !empty($sem)
|| !empty($email) || !empty($phone) || !empty($college) )
{
include 'classes/db1.php';
$INSERT="INSERT INTO participent
(usn,name,branch,sem,email,phone,college) VALUES('$usn','$name','$branch',
$sem,'$email','$phone','$college')";
if($conn->query($INSERT)===True){
echo "<script>
alert('Registered Successfully!');
window.location.href='usn.php';
</script>";
}
else
{
echo"<script>
alert(' Already registered this usn');
window.location.href='usn.php';
</script>";
}

$conn->close();
}
else
{
echo"<script>
alert('All fields are required');
window.location.href='register.php';
</script>";
}
}
?>

4. Login Page –

<?php
include_once 'classes/db1.php';?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
<title></title>
<style>
span.error{
color: red;
}
</style>
<?php require 'utils/styles.php'; ?><!--css links. file found in utils
folder-->
</head>
<body>
<?php require 'utils/header.php'; ?><!--header content. file found in
utils folder-->
<div class = "content"><!--body content holder-->
<div class = "container">
<div class ="col-md-6 col-md-offset-3">
<form method="POST"><!--form-->
<!--username field-->
<label>UserName:</label><br>
<input type="text" name="name" class="form-control" required><br>
<label>Password</label><br>
<input type="password" name="password" class="form-control"
required><br>
<button type = "submit" name="update" class = "btn btn-default">Login</button>
</form>
</div><!--col md 6 div-->
</div><!--container div-->
</div><!--content div-->
<?php require 'utils/footer.php'; ?><!--footer content. file found in
utils folder-->
</body>
</html>
<?php
if (isset($_POST["update"]))
{
$myusername=$_POST['name'];
$mypassword=$_POST['password'];
if($mypassword=='admin' && $myusername=='admin')
{
echo "<script>
alert('Login Successfull');
window.location.href='adminPage.php';
</script>";
}
else
{
echo "<script>
alert('Invalid credentials');
window.location.href='login_form.php';
</script>";
}
}
?>

5. Admin Page-
<?php
include_once 'classes/db1.php';
$result = mysqli_query($conn,"SELECT * FROM staff_coordinator s ,event_info ef
,student_coordinator st,events e where e.event_id= ef.event_id and e.event_id=
s.event_id and e.event_id= st.event_id");
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
</head>
<body>
<?php include 'utils/adminHeader.php'?>
<div class = "content">
<div class = "container">
<h1>Event details</h1>
<?php
if (mysqli_num_rows($result) > 0) {
?>
<table class="table table-hover" >
<thead>
<tr>
<th>Event_name</th>
<th>No. of Participents</th>
<th>Price</th>
<th>Student Co-ordinator</th>
<th>Staff Co-ordinator</th>
<th>Date</th>
<th>Time</th>
<th>location </th>
</tr>
</thead>
<tbody>
<?php
$i=0;
while($row = mysqli_fetch_array($result)){
echo '<tr>';
echo '<td>' . $row['event_title'] . '</td>';
echo '<td>' . $row['participents'] . '</td>';
echo '<td>' . $row['event_price'] . '</td>';
echo '<td>' . $row['st_name'] . '</td>';
echo '<td>' . $row['name'] . '</td>';
echo '<td>'.$row['Date'].'</td>';
echo '<td>'.$row['time'].'</td>';
echo '<td>'.$row['location'].'</td>';
echo '<td>'
.'<a class="delete" href="deleteEvent.php?id='.
$row['event_id'].'">Delete</a> '
.'</td>';
echo '</tr>';
$i++;
}
?>
</tbody>
</table>
<?php
}
?>
<a class="btn btn-default" href = "createEventForm.php">Create Event</a><!--
register button-->
</div>
</div>
<?php require 'utils/footer.php'; ?>
</body>
</html>

6. Create Event Form-


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
<title></title>
<?php require 'utils/styles.php'; ?><!--css links. file found in utils
folder-->
</head>
<body>
<?php require 'utils/adminHeader.php'; ?>
<form method="POST">
<div class="w3-container">
<div class ="content"><!--body content holder-->
<div class = "container">
<div class ="col-md-6 col-md-offset-3">
<label>Event ID:</label><br>
<input type="number" name="event_id" required class="form-
control"><br><br>
<label>Event Name:</label><br>
<input type="text" name="event_title" required class="form-
control"><br><br>
<label>Event Price:</label><br>
<input type="number" name="event_price" required class="form-
control"><br><br>
<label>Upload Path to Image:</label><br>
<input type="text" name="img_link" required class="form-control"><br><br>
<label>Type_ID </label><br>
<input type="number" name="type_id" required class="form-control"><br><br>
<label>Event Date</label><br>
<input type="date" name="Date" required class="form-control"><br><br>
<label>Event Time</label><br>
<input type="text" name="time" required class="form-control"><br><br>
<label>Event Location</label><br>
<input type="text" name="location" required class="form-control"><br><br>
<label>Staff co-ordinator name</label><br>
<input type="text" name="sname" required class="form-control"><br><br>
<label>Student co-ordinator name</label><br>
<input type="text" name="st_name" required class="form-control"><br><br>
<button type="submit" name="update" class = "btn btn-default pull-
right">Create Event <span class="glyphicon glyphicon-send"></span></button>
<a class="btn btn-default navbar-btn" href = "adminPage.php"><span
class="glyphicon glyphicon-circle-arrow-left"></span> Back</a>
</div></div></div>
</form>
</body>
<?php require 'utils/footer.php'; ?>
</html>
<?php
if (isset($_POST["update"]))
{
$event_id=$_POST["event_id"];
$event_title=$_POST["event_title"];
$event_price=$_POST["event_price"];

$img_link=$_POST["img_link"];
$type_id=$_POST["type_id"];
$name=$_POST["sname"];
$st_name=$_POST["st_name"];
$Date=$_POST["Date"];
$time=$_POST["time"];
$location=$_POST["location"];
if(!empty($event_id) || !empty($event_title) || !empty($event_price) || !
empty($participents) || !empty($img_link) || !empty($type_id) )
{
include 'classes/db1.php';
$INSERT="INSERT INTO
events(event_id,event_title,event_price,img_link,type_id)
VALUES($event_id,'$event_title', $event_price,'$img_link',$type_id);";
$INSERT.= "INSERT INTO event_info (event_id,Date,time,location)
Values ($event_id,'$Date','$time','$location');";
$INSERT.="INSERT into
student_coordinator(sid,st_name,phone,event_id)
values($event_id,'$st_name',NULL,$event_id);";
$INSERT.="INSERT into staff_coordinator(stid,name,phone,event_id)
values($event_id,'$name',NULL,$event_id)";
if($conn->multi_query($INSERT)===True){
echo "<script>
alert('Event Inserted Successfully!');
window.location.href='adminPage.php';
</script>";
}
else
{
echo"<script>
alert('Event already exsists!');
window.location.href='createEventForm.php';
</script>";
}
$conn->close();
}
else
{
echo"<script>
alert('All fields are required');
window.location.href='createEventForm1.php';
</script>";
}
}
?>

7. Student Details-

<?php
include_once 'classes/db1.php';
$result = mysqli_query($conn,"SELECT * FROM events,registered r ,participent p
WHERE events.event_id=r.event_id and r.usn = p.usn order by event_title");
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
<title></title>
<?php require 'utils/styles.php'; ?><!--css links. file found in utils
folder-->
</head>
<body><?php include 'utils/adminHeader.php'?>
<div class = "content">
<div class = "container">
<h1>Student details</h1>
<?php
if (mysqli_num_rows($result) > 0) {
?>
<table class="table table-hover" >
<tr>
<th>USN</th>
<th>Name</th>
<th>Branch</th>
<th>Sem</th>
<th>Email</th>
<th>Phone</th>
<th>College</th>
<th>Event</th>
</tr>
<?php
$i=0;
while($row = mysqli_fetch_array($result)) {
?>
<tr>
<td><?php echo $row["usn"]; ?></td>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["branch"]; ?></td>
<td><?php echo $row["sem"]; ?></td>
<td><?php echo $row["email"]; ?></td>
<td><?php echo $row["phone"]; ?></td>
<td><?php echo $row["college"]; ?></td>
<td><?php echo $row["event_title"]; ?></td>
</tr>
<?php
$i++;
}
?>
</table>
<?php
}
else{
echo "No result found";
}
?>
</div>
</div>
<?php include 'utils/footer.php'?>;
</body>
</html>

8. Student coordinator-

<?php
include_once 'classes/db1.php';
$result = mysqli_query($conn,"SELECT * FROM student_coordinator s ,events e
where e.event_id= s.event_id");
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
<title></title>
<?php require 'utils/styles.php'; ?><!--css links. file found in utils
folder-->

</head>

<body><?php include 'utils/adminHeader.php'?>


<div class = "content">
<div class = "container">
<h1>Student Co-ordinator details</h1>
<?php
if (mysqli_num_rows($result) > 0) {
?>
<table class="table table-hover" >

<tr>
<th>Name</th>
<th>Phone</th>
<th>Event</th>
<th></th>
</tr>
<?php
$i=0;
while($row = mysqli_fetch_array($result)) {
?>
<tr>
<td><?php echo $row["st_name"]; ?></td>
<td><?php echo $row["phone"]; ?></td>
<td><?php echo $row["event_title"]; ?></td>
<td> <?php echo '<a href="updateStudent.php?id='.$row['event_id'].'"
class = "btn btn-default"> Update</a>'?></td>
</tr>
<?php
$i++;
}
?>
</table>
<?php
}
else{
echo "No result found";
}
?>
</div>
</div>
</body>
<?php include 'utils/footer.php';?>
</html>

9. Update details (student coordinator)-


<?php include 'classes/db1.php';
$id=$_GET['id'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
<title></title>
<?php require 'utils/styles.php'; ?><!--css links. file found in utils
folder-->
</head>
<body>
<?php require 'utils/header.php'; ?>
<div class ="content"><!--body content holder-->
<div class = "container">
<div class ="col-md-6 col-md-offset-3">
<form method="POST">
<label>Student co-ordinator name</label><br>
<input type="text" name="st_name" required class="form-control"><br><br>
<label>Student co-ordinator phone</label><br>
<input type="text" name="phone" required class="form-control"><br><br>
<button type="submit" name="update" class = "btn btn-default
">Update</button>
</div>
</div>
</div>
</form>
<?php require 'utils/footer.php'; ?>
</body>
</html>
<?php
if (isset($_POST["update"]))
{
$name=$_POST["st_name"];
$phone=$_POST["phone"];
$sql="UPDATE student_coordinator set phone='$phone',st_name='$name' where
sid='$id'";
if($conn->query($sql)===true)
{
echo"<script>
alert(' Updated Successfully');
window.location.href='stu_cordinator.php';
</script>";
}
else
{
echo"<script>
window.location.href='updateStudent.php';
</script>";
}
}
?>
10. Staff Coordinator details and Update-

<?php
include_once 'classes/db1.php';
$result = mysqli_query($conn,"SELECT * FROM staff_coordinator s ,events e
where e.event_id= s.event_id");
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
<title></title>
<?php require 'utils/styles.php'; ?><!--css links. file found in utils
folder-->

</head>
<body><?php include 'utils/adminHeader.php'?>
<div class = "content">
<div class = "container">
<h1>Staff Co-ordinator details</h1>
<?php
if (mysqli_num_rows($result) > 0) {
?>
<table class="table table-hover" >
<tr>
<th>Name</th>
<th>Phone</th>
<th>Event</th>
<th></th>
</tr>
<?php
$i=0;
while($row = mysqli_fetch_array($result)) {
?>
<tr>
<td><?php echo $row["name"]; ?></td>
<td><?php echo $row["phone"]; ?></td>
<td><?php echo $row["event_title"]; ?></td>
<td> <?php echo '<a href="updateStaff.php?id='.$row['event_id'].'" class
= "btn btn-default"> Update</a>'?></td>
</tr>
<?php
$i++;
}
?>
</table>
<?php
}
else{
echo "No result found";
}
?>
</div>
</div>
</body>
<?php include 'utils/footer.php';?>
</html>

<?php include 'classes/db1.php';


$id=$_GET['id'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
<title></title>
<?php require 'utils/styles.php'; ?><!--css links. file found in utils
folder-->

</head>
<body>
<?php require 'utils/header.php'; ?>
<div class ="content"><!--body content holder-->
<div class = "container">
<div class ="col-md-6 col-md-offset-3">
<form method="POST">
<label>Staff co-ordinator name</label><br>
<input type="text" name="st_name" required class="form-control"><br><br>
<label>Staff co-ordinator phone</label><br>
<input type="text" name="phone" required class="form-control"><br><br>
<button type="submit" name="update" class = "btn btn-default
">Update</button>
</div>
</div>
</div>
</form>
<?php require 'utils/footer.php'; ?>
</body>
</html>
<?php
if (isset($_POST["update"]))
{
$name=$_POST["st_name"];
$phone=$_POST["phone"];
$sql="UPDATE staff_coordinator set phone='$phone',name='$name' where
stid='$id'";
if($conn->query($sql)===true)
{
echo"<script>
alert(' Updated Successfully');
window.location.href='stu_cordinator.php';
</script>";}
else
{
echo"<script>
window.location.href='updateStudent.php';
</script>"}}
?>
11. Registration for an event –
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cems</title>
<?php require 'utils/styles.php'; ?><!--css links. file found in utils
folder-->
</head>
<body>
<?php require 'utils/header.php'; ?>
<div class ="content"><!--body content holder-->
<div class = "container">
<div class ="col-md-6 col-md-offset-3">
<form method="POST">
<label>Student USN:</label><br>
<input type="text" name="usn" class="form-control" required><br><br>
<label>Student Name:</label><br>
<input type="text" name="name" class="form-control" required><br><br>
<label>Branch:</label><br>
<input type="text" name="branch" class="form-control"
required><br><br>
<label>Semester:</label><br>
<input type="text" name="sem" class="form-control" required><br><br>

<label>Email:</label><br>
<input type="text" name="email" class="form-control" required
><br><br>
<label>Phone:</label><br>
<input type="text" name="phone" class="form-control"
required><br><br>

<label>College:</label><br>
<input type="text" name="college" class="form-control"
required><br><br>
<button type="submit" name="update" required>Submit</button><br><br>
<a href="usn.php" ><u>Already registered ?</u></a>
</div>
</div>
</div>
</form>
<?php require 'utils/footer.php'; ?>
</body>
</html>
<?php
if (isset($_POST["update"]))
{
$usn=$_POST["usn"];
$name=$_POST["name"];
$branch=$_POST["branch"];
$sem=$_POST["sem"];
$email=$_POST["email"];
$phone=$_POST["phone"];
$college=$_POST["college"];
if( !empty($usn) || !empty($name) || !empty($branch) || !empty($sem)
|| !empty($email) || !empty($phone) || !empty($college) )
{
include 'classes/db1.php';
$INSERT="INSERT INTO participent
(usn,name,branch,sem,email,phone,college) VALUES('$usn','$name','$branch',
$sem,'$email','$phone','$college')";
if($conn->query($INSERT)===True){
echo "<script>
alert('Registered Successfully!');
window.location.href='usn.php';
</script>";
}
else
{
echo"<script>
alert(' Already registered this usn');
window.location.href='usn.php';
</script>";
}

$conn->close();
}
else
{
echo"<script>
alert('All fields are required');
window.location.href='register.php';
</script>";
}
}
?>

12. To check registered events –


 <?php
 require_once 'utils/header.php';
 require_once 'utils/styles.php';
 $usn=$_POST['usn'];
 include_once 'classes/db1.php';
 $result = mysqli_query($conn, "SELECT * FROM registered
r,staff_coordinator s ,event_info ef ,student_coordinator st,events e
where e.event_id= ef.event_id and e.event_id= s.event_id and
e.event_id= st.event_id and r.usn= '$usn' and r.event_id=e.event_id");
 ?>
 <div class = "content">
 <div class = "container">
 <h1> Registered Events</h1>
 <?php
 if (mysqli_num_rows($result) > 0) {
 ?>
 <table class="table table-hover" >
 <thead>
 <tr>
 <th>Event_name</th>
 <th>Student Co-ordinator</th>
 <th>Staff Co-ordinator</th>
 <th>Date</th>
 <th>Time</th>
 <th>location </th>
 </tr>
 </thead>
 <tbody>
 <?php
 $i=0;
 while($row = mysqli_fetch_array($result)) {
 echo '<tr>';
 echo '<td>' . $row['event_title'] .
'</td>';
 echo '<td>' . $row['st_name'] . '</td>';
 echo '<td>' . $row['name'] . '</td>';
 echo '<td>'.$row['Date'].'</td>';
 echo '<td>'.$row['time'].'</td>';
 echo '<td>'.$row['location'].'</td>';
 echo '</tr>';
 $i++;
 }
 ?>
 </tbody>
 </table>
 <?php }
 else{
 echo 'Not Yet Rgistered any events';

 }?>
 </div>
 </div>
 <?php

 // $result = mysqli_query($conn, );
 ?>
 <div class = "content">
 <div class = "container">
 <h1>Not Registered Events</h1>
 <?php
 if (mysqli_num_rows($result) > 0) {
 ?>
 <table class="table table-hover" >
 <thead>
 <tr>
 <th>Event_name</th>
 <th>Student Co-ordinator</th>
 <th>Staff Co-ordinator</th>
 <th>Date</th>
 <th>Time</th>
 <th>location </th>
 </tr>
 </thead>
 <tbody>
 <?php
 $i=0;
 while($row = mysqli_fetch_array($result)) {
 echo '<tr>';
 echo '<td>' . $row['event_title'] .
'</td>';
 echo '<td>' . $row['st_name'] . '</td>';
 echo '<td>' . $row['name'] . '</td>';
 echo '<td>'.$row['Date'].'</td>';
 echo '<td>'.$row['time'].'</td>';
 echo '<td>'.$row['location'].'</td>';
 echo '</tr>';
 $i++;
 }
 ?>
 </tbody>
 </table>
 <?php }
 else{
 echo 'NOT able fetch';
 }?>
 </div>
 </div> <?php include 'utils/footer.php'; ?>

13. To create event form –


 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
 <title>cems</title>
 <title></title>
 <?php require 'utils/styles.php'; ?><!--css links. file found
in utils folder-->
 </head>
 <body>
 <?php require 'utils/adminHeader.php'; ?>
 <form method="POST">
 <div class="w3-container">
 <div class ="content"><!--body content holder-->
 <div class = "container">
 <div class ="col-md-6 col-md-offset-3">
 <label>Event ID:</label><br>
 <input type="number" name="event_id" required class="form-
control"><br><br>
 <label>Event Name:</label><br>
 <input type="text" name="event_title" required class="form-
control"><br><br>
 <label>Event Price:</label><br>
 <input type="number" name="event_price" required class="form-
control"><br><br>
 <label>Upload Path to Image:</label><br>
 <input type="text" name="img_link" required class="form-
control"><br><br>
 <label>Type_ID </label><br>
 <input type="number" name="type_id" required class="form-
control"><br><br>
 <label>Event Date</label><br>
 <input type="date" name="Date" required class="form-
control"><br><br>
 <label>Event Time</label><br>
 <input type="text" name="time" required class="form-
control"><br><br>
 <label>Event Location</label><br>
 <input type="text" name="location" required class="form-
control"><br><br>
 <label>Staff co-ordinator name</label><br>
 <input type="text" name="sname" required class="form-
control"><br><br>
 <label>Student co-ordinator name</label><br>
 <input type="text" name="st_name" required class="form-
control"><br><br>
 <button type="submit" name="update" class = "btn btn-default pull-
right">Create Event <span class="glyphicon glyphicon-
send"></span></button>
 <a class="btn btn-default navbar-btn" href = "adminPage.php"><span
class="glyphicon glyphicon-circle-arrow-left"></span> Back</a>
 </div></div></div>
 </form>
 </body>
 <?php require 'utils/footer.php'; ?>
 </html>
 <?php
 if (isset($_POST["update"]))
 {
 $event_id=$_POST["event_id"];
 $event_title=$_POST["event_title"];
 $event_price=$_POST["event_price"];

 $img_link=$_POST["img_link"];
 $type_id=$_POST["type_id"];
 $name=$_POST["sname"];
 $st_name=$_POST["st_name"];
 $Date=$_POST["Date"];
 $time=$_POST["time"];
 $location=$_POST["location"];
 if(!empty($event_id) || !empty($event_title) || !
empty($event_price) || !empty($participents) || !empty($img_link) || !
empty($type_id) )
 {
 include 'classes/db1.php';
 $INSERT="INSERT INTO
events(event_id,event_title,event_price,img_link,type_id)
VALUES($event_id,'$event_title', $event_price,'$img_link',$type_id);";
 $INSERT.= "INSERT INTO event_info
(event_id,Date,time,location) Values
($event_id,'$Date','$time','$location');";
 $INSERT.="INSERT into
student_coordinator(sid,st_name,phone,event_id)
values($event_id,'$st_name',NULL,$event_id);";
 $INSERT.="INSERT into
staff_coordinator(stid,name,phone,event_id)
values($event_id,'$name',NULL,$event_id)";
 if($conn->multi_query($INSERT)===True){
 echo "<script>
 alert('Event Inserted Successfully!');
 window.location.href='adminPage.php';
 </script>";
 }
 else
 {
 echo"<script>
 alert('Event already exsists!');
 window.location.href='createEventForm.php';
 </script>";
 }
 $conn->close();
 }
 else
 {
 echo"<script>
 alert('All fields are required');
 window.location.href='createEventForm1.php';
 </script>";
 }
 }
 ?>

14. To delete the event –


 <?php require 'classes/db1.php';
 $id=$_GET['id'];

 $sql="delete from events where event_id='$id';";
 $sql.="delete from event_info where event_id='$id';";
 $sql.="delete from staff_coordinator where event_id='$id';";
 $sql.="delete from student_coordinator where event_id='$id';";
 $sql.="delete from registered where event_id='$id'";
 if($conn->multi_query($sql) === True)
 {
 echo"<script>
 alert('Event Deleted Successfully');
 window.location.href='adminPage.php';
 </script>";
 }
 else{
 echo "Error deleting record".$conn->error;
 }
 $conn->close();
 ?>

THANKS
&
BEST REGARDS
FROM THE
TEAM

You might also like