STUDENT RESULT MANAGEMENT SYSTEM Final
STUDENT RESULT MANAGEMENT SYSTEM Final
B. SURIYA PRAKASH.
J. MAREESWARI.
P. ANGEL
S. GAYATHRI
STUDENT RESULT MANAGEMENT SYSTEM
AIM:
To create a application in student result management system using HTML and SQL
Database.
DESCRIPTION:
Student Result Management System (SRMS) provides a simple interface for
maintenance of student information. It can be used by educational institutes or
colleges to maintain the records of students easily. The creation and management
of accurate, up-to-date information regarding a students’ academic career is
critically important in the university as well as colleges.
TECHNOLOGIES USED
▪ HTML
▪ CSS
▪ JAVA SCRIPT
▪ PHP
▪ SQL
HTML
HTML is a hypertext markup language which is in reality a backbone of any website.
Every website can’t be structured without the knowledge of html. If we make our
web page only with the help of html, than we can’t add many of the effective
features in a web page, for making a web page more effective we use various
platforms such as CSS.
System starts with login page, one for admin login where the admin can make
updation,deletion,insertion etc, in the student database. And the other for student
login, student can enter class and rollnumber. Then the student will able to see his
results.User name and password to be able to access the system.
CONCLUSION
This paper assists in automating the existing manual system. This is a paperless work.
It can be monitored and controlled remotely. It reduces the man power required. It
provides accurate information always. Malpractice can be reduced. All years
together gathered information can be saved and can be accessed at any time. The
data which is stored in the repository helps in taking intelligent decisions by the
management. So it is better to have a Web Based Information Management system.
All the stakeholders, faculty and management can get the required information
without delay. This system is essential in the colleges/hostels and universities.
SYSTEM’S CODINGS:
ADD CLASSES
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./css/home.css">
<link rel="stylesheet" href="./css/form.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="./css/font-awesome-4.7.0/css/font-awesome.css">
<title>Add Class</title>
</head>
<body>
<div class="title">
<a href="dashboard.php"><img src="./images/logo1.png" alt="" class="logo"></a>
<span class="heading">Dashboard</span>
<a href="logout.php" style="color: white"><span class="fa fa-sign-out fa-
2x">Logout</span></a>
</div>
<div class="nav">
<ul>
<li class="dropdown" onclick="toggleDisplay('1')">
<a href="" class="dropbtn">Classes  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="1">
<a href="add_classes.php">Add Class</a>
<a href="manage_classes.php">Manage Class</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('2')">
<a href="#" class="dropbtn">Students  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="2">
<a href="add_students.php">Add Students</a>
<a href="manage_students.php">Manage Students</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('3')">
<a href="#" class="dropbtn">Results  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="3">
<a href="add_results.php">Add Results</a>
<a href="manage_results.php">Manage Results</a>
</div>
</li>
</ul>
</div>
<div class="main">
<form action="" method="post">
<fieldset>
<legend>Add Class</legend>
<input type="text" name="class_name" placeholder="Class Name">
<input type="text" name="class_id" placeholder="Class ID">
<input type="submit" value="Submit">
</fieldset>
</form>
</div>
<div class="footer">
<!-- <span>Designed & Coded By Jibin Thomas</span> -->
</div>
</body>
</html>
<?php
include('init.php');
include('session.php');
if (isset($_POST['class_name'],$_POST['class_id'])) {
$name=$_POST["class_name"];
$id=$_POST["class_id"];
// validation
if (empty($name) or empty($id) or preg_match("/[a-z]/i",$id)) {
if(empty($name))
echo '<p class="error">Please enter class</p>';
if(empty($id))
echo '<p class="error">Please enter class id</p>';
if(preg_match("/[a-z]/i",$id))
echo '<p class="error">Please enter valid class id</p>';
exit();
}
$sql = "INSERT INTO `class` (`name`, `id`) VALUES ('$name', '$id')";
$result=mysqli_query($conn,$sql);
if (!$result) {
echo '<script language="javascript">';
echo 'alert("Invalid class name or class id")';
echo '</script>';
} else{
echo '<script language="javascript">';
echo 'alert("Successful)';
echo '</script>';
}
}
?>
ADD RESULTS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./css/home.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="./css/font-awesome-4.7.0/css/font-awesome.css">
<link rel="stylesheet" href="./css/form.css">
<title>Dashboard</title>
</head>
<body>
<div class="title">
<a href="dashboard.php"><img src="./images/logo1.png" alt="" class="logo"></a>
<span class="heading">Dashboard</span>
<a href="logout.php" style="color: white"><span class="fa fa-sign-out fa-
2x">Logout</span></a>
</div>
<div class="nav">
<ul>
<li class="dropdown" onclick="toggleDisplay('1')">
<a href="" class="dropbtn">Classes  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="1">
<a href="add_classes.php">Add Class</a>
<a href="manage_classes.php">Manage Class</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('2')">
<a href="#" class="dropbtn">Students  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="2">
<a href="add_students.php">Add Students</a>
<a href="manage_students.php">Manage Students</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('3')">
<a href="#" class="dropbtn">Results  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="3">
<a href="add_results.php">Add Results</a>
<a href="manage_results.php">Manage Results</a>
</div>
</li>
</ul>
</div>
<div class="main">
<form action="" method="post">
<fieldset>
<legend>Enter Marks</legend>
<?php
include("init.php");
include("session.php");
$select_class_query="SELECT `name` from `class`";
$class_result=mysqli_query($conn,$select_class_query);
//select class
echo '<select name="class_name">';
echo '<option selected disabled>Select Class</option>';
while($row = mysqli_fetch_array($class_result)) {
$display=$row['name'];
echo '<option value="'.$display.'">'.$display.'</option>';
}
echo'</select>';
?>
<input type="text" name="rno" placeholder="Roll No">
<input type="text" name="p1" id="" placeholder="Design and analysis of
algorithms">
<input type="text" name="p2" id="" placeholder="Database management
systems">
<input type="text" name="p3" id="" placeholder="Probability and queueing
theory">
<input type="text" name="p4" id="" placeholder="Operating systems">
<input type="text" name="p5" id="" placeholder="Software engineering">
<input type="text" name="p6" id="" placeholder="Computer architecture">
<input type="submit" value="Submit">
</fieldset>
</form>
</div>
</body>
</html>
<?php
if(isset($_POST['rno'],$_POST['p1'],$_POST['p2'],$_POST['p3'],$_POST['p4'],$_POST['p5']
,$_POST['p6']))
{
$rno=$_POST['rno'];
if(!isset($_POST['class_name']))
$class_name=null;
else
$class_name=$_POST['class_name'];
$p1=(int)$_POST['p1'];
$p2=(int)$_POST['p2'];
$p3=(int)$_POST['p3'];
$p4=(int)$_POST['p4'];
$p5=(int)$_POST['p5'];
$p5=(int)$_POST['p5'];
$p6=(int)$_POST['p6'];
$marks=$p1+$p2+$p3+$p4+$p5+$p6;
$percentage=$marks/6;
// validation
if (empty($class_name) or empty($rno) or $p1>100 or $p2>100 or $p3>100 or
$p4>100 or $p5>100 or $p6>100 or $p1<0 or $p2<0 or $p3<0 or $p4<0 or $p5<0 or $p6<0 )
{
if(empty($class_name))
echo '<p class="error">Please select class</p>';
if(empty($rno))
echo '<p class="error">Please enter roll number</p>';
if(preg_match("/[a-z]/i",$rno))
echo '<p class="error">Please enter valid roll number</p>';
if(preg_match("/[a-z]/i",$marks))
echo '<p class="error">Please enter valid marks</p>';
if($p1>100 or $p2>100 or $p3>100 or $p4>100 or $p5>100 or $p6>100 or $p1<0 or
$p2<0 or $p3<0 or $p4<0 or $p5<0 or $p6<0 )
echo '<p class="error">Please enter valid marks</p>';
exit();
}
$name=mysqli_query($conn,"SELECT `name` FROM `students` WHERE `rno`='$rno'
and `class_name`='$class_name'");
while($row = mysqli_fetch_array($name)) {
$display=$row['name'];
echo $display; }
$sql="INSERT INTO `result` (`name`, `rno`, `class`, `p1`, `p2`, `p3`, `p4`, `p5`,`p6`,
`marks`, `percentage`) VALUES ('$display', '$rno', '$class_name', '$p1', '$p2', '$p3', '$p4',
'$p5', '$p6','$marks', '$percentage')";
$sql=mysqli_query($conn,$sql);
if (!$sql) {
echo '<script language="javascript">';
echo 'alert("Invalid Details")';
echo '</script>';
}
else{
echo '<script language="javascript">';
echo 'alert("Successful")';
echo '</script>';
}
}
?>
ADD STUDENTS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./css/home.css">
<link rel="stylesheet" type="text/css" href="./css/form.css" media="all">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="./css/font-awesome-4.7.0/css/font-awesome.css">
<title>Add Students</title>
</head>
<body>
<div class="title">
<a href="dashboard.php"><img src="./images/logo1.png" alt="" class="logo"></a>
<span class="heading">Dashboard</span>
<a href="logout.php" style="color: white"><span class="fa fa-sign-out fa-
2x">Logout</span></a>
</div>
<div class="nav">
<ul>
<li class="dropdown" onclick="toggleDisplay('1')">
<a href="" class="dropbtn">Classes  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="1">
<a href="add_classes.php">Add Class</a>
<a href="manage_classes.php">Manage Class</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('2')">
<a href="#" class="dropbtn">Students  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="2">
<a href="add_students.php">Add Students</a>
<a href="manage_students.php">Manage Students</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('3')">
<a href="#" class="dropbtn">Results  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="3">
<a href="add_results.php">Add Results</a>
<a href="manage_results.php">Manage Results</a>
</div>
</li>
</ul>
</div>
<div class="main">
<form action="" method="post">
<fieldset>
<legend>Add Student</legend>
<input type="text" name="student_name" placeholder="Student Name">
<input type="text" name="roll_no" placeholder="Roll No">
<?php
include('init.php');
include('session.php');
$class_result=mysqli_query($conn,"SELECT `name` FROM `class`");
echo '<select name="class_name">';
echo '<option selected disabled>Select Class</option>';
while($row = mysqli_fetch_array($class_result)){
$display=$row['name'];
echo '<option value="'.$display.'">'.$display.'</option>';
}
echo'</select>'
?>
<input type="submit" value="Submit">
</fieldset>
</form>
</div>
<div class="footer">
<!-- <span>© Designed & Coded By Jibin Thomas</span> -->
</div>
</body>
</html>
<?php
if(isset($_POST['student_name'],$_POST['roll_no'])) {
$name=$_POST['student_name'];
$rno=$_POST['roll_no'];
if(!isset($_POST['class_name']))
$class_name=null;
else
$class_name=$_POST['class_name'];
// validation
if (empty($name) or empty($rno) or empty($class_name) or preg_match("/[a-z]/i",$rno)
or !preg_match("/^[a-zA-Z ]*$/",$name)) {
if(empty($name))
echo '<p class="error">Please enter name</p>';
if(empty($class_name))
echo '<p class="error">Please select your class</p>';
if(empty($rno))
echo '<p class="error">Please enter your roll number</p>';
if(preg_match("/[a-z]/i",$rno))
echo '<p class="error">Please enter valid roll number</p>';
if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
echo '<p class="error">No numbers or symbols allowed in name</p>';
}
exit();
}
$sql = "INSERT INTO `students` (`name`, `rno`, `class_name`) VALUES ('$name',
'$rno', '$class_name')";
$result=mysqli_query($conn,$sql);
if (!$result) {
echo '<script language="javascript">';
echo 'alert("Invalid Details")';
echo '</script>';
}
else{
echo '<script language="javascript">';
echo 'alert("Successful")';
echo '</script>';
}
}
?>
DASHBOARD
<?php
include("init.php");
$no_of_classes=mysqli_fetch_array(mysqli_query($conn,"SELECT COUNT(*) FROM
`class`"));
$no_of_students=mysqli_fetch_array(mysqli_query($conn,"SELECT COUNT(*) FROM
`students`"));
$no_of_result=mysqli_fetch_array(mysqli_query($conn,"SELECT COUNT(*) FROM
`result`"));
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./css/home.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="./css/font-awesome-4.7.0/css/font-awesome.css">
<link rel="stylesheet" href="normalize.css">
<title>Dashboard</title>
<style>
.main{
border-radius: 10px;
border-width: 5px;
border-style: solid;
padding: 20px;
margin: 7% 20% 0 20%;
}
</style>
</head>
<body>
<div class="title">
<a href="dashboard.php"><img src="./images/logo1.png" alt="" class="logo"></a>
<span class="heading">Dashboard</span>
<a href="logout.php" style="color: white"><span class="fa fa-sign-out fa-
2x">Logout</span></a>
</div>
<div class="nav">
<ul>
<li class="dropdown" onclick="toggleDisplay('1')">
<a href="" class="dropbtn">Classes  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="1">
<a href="add_classes.php">Add Class</a>
<a href="manage_classes.php">Manage Class</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('2')">
<a href="#" class="dropbtn">Students  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="2">
<a href="add_students.php">Add Students</a>
<a href="manage_students.php">Manage Students</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('3')">
<a href="#" class="dropbtn">Results  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="3">
<a href="add_results.php">Add Results</a>
<a href="manage_results.php">Manage Results</a>
</div>
</li>
</ul>
</div>
<div class="main">
<?php
echo '<p>Number of classes:'.$no_of_classes[0].'</p>';
echo '<p>Number of students:'.$no_of_students[0].'</p>';
echo '<p>Number of results:'.$no_of_result[0].'</p>';
?>
</div>
<div class="footer">
<!-- <span>Designed & Coded By Jibin Thomas</span> -->
</div>
</body>
</html>
<?php
include('session.php');
?>
INDEX
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="./css/homepage.css">
<link rel="stylesheet" href="./css/font-awesome-4.7.0/css/font-awesome.css">
<title>Homepage</title>
</head>
<body>
<div align ="center">
<h1> AAA COLLEGE OF ENGINEERING AND TECHNOLOGY</h1>
<h2> Mini project by CSE</h2>
<h1> Student Result Management System</h1>
</div>
<div class="nav">
<ul>
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="login.php">Admin Login</a>
</li>
<li class="dropdown" onclick="toggleDisplay('1')">
<a href="#" class="dropbtn">Faculties  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="1">
<a href="">CS8451</a>
<a href="">CS8492</a>
<a href="">MA8402</a>
<a href="">CS8493</a>
<a href="">CS8494</a>
<a href="">CS8493</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('2')">
<a href="#" class="dropbtn">Student  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="2">
<a href="">Admissions</a>
<a href="">Scholarship</a>
<a href="">Examination</a>
<a href="./login.php">Results</a>
<a href="">Manage Results</a>
</div>
</li>
</ul>
</div>
<div class="slider">
<img src="images/aaacollege.jpg" class="slider-image" alt="img">
</div>
<div class="main">
<span>About This Project</span>
<p>The main objective of the project is to provide the examination result to the
student in a simple way.
This project is useful for students and institutions for getting the results in simple manner.
By a result analyzer with subject status and marks is an application tool for displaying the
results in secure way.</p>
<p>
<h2>This Project Submited by_B.Suriyaprakash </h2>
<h2> J.Mareeswari</h2>
<h2>P.Angel </h2>
<h2> S.Gayathri </h2>
</p>
</div>
</div>
</body>
</html>
Init
<?php
$servername = "localhost";
$username = "root";
$password = "";
$conn = mysqli_connect($servername, $username, $password);
$db = mysqli_select_db($conn,'srms');
?>
LOGIN
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index Page</title>
<link rel="stylesheet" href="css/login.css">
<link rel="stylesheet" href="./font-awesome-4.7.0/css/font-awesome.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
</head>
<body>
<div class="title">
<span>Student Result Management System</span>
</div>
<div class="main">
<div class="login">
<form action="" method="post" name="login">
<fieldset>
<legend class="heading">Admin Login</legend>
<input type="text" name="userid" placeholder="Email" autocomplete="off">
<input type="password" name="password" placeholder="Password"
autocomplete="off">
<input type="submit" value="Login">
</fieldset>
</form>
</div>
<div class="search">
<form action="./student.php" method="get">
<fieldset>
<legend class="heading">For Students</legend>
<?php
include('init.php');
$class_result=mysqli_query($conn,"SELECT `name` FROM `class`");
echo '<select name="class">';
echo '<option selected disabled>Select Class</option>';
while($row = mysqli_fetch_array($class_result)){
$display=$row['name'];
echo '<option value="'.$display.'">'.$display.'</option>';
}
echo'</select>'
?>
<input type="text" name="rn" placeholder="Roll No">
<input type="submit" value="Get Result">
</fieldset>
</form>
</div>
</div>
</body>
</html>
<?php
include("init.php");
session_start();
if (isset($_POST["userid"],$_POST["password"]))
{
$username=$_POST["userid"];
$password=$_POST["password"];
$sql = "SELECT userid FROM admin_login WHERE userid='$username' and password
= '$password'";
$result=mysqli_query($conn,$sql);
// $row=mysqli_fetch_array($result);
$count=mysqli_num_rows($result);
if($count==1) {
$_SESSION['login_user']=$username;
header("Location: dashboard.php");
}else {
echo '<script language="javascript">';
echo 'alert("Invalid Username or Password")';
echo '</script>';
}
}
?>
LOGOUT
<?php
session_start();
if(session_destroy()) {
header("Location: login.php");
echo '<script language="javascript">';
echo 'alert("Logout successful")';
echo '</script>';
}
?>
Manage classes:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/home.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="./css/font-awesome-4.7.0/css/font-awesome.css">
<link rel="stylesheet" type='text/css' href="css/manage.css">
<title>Dashboard</title>
</head>
<body>
<div class="title">
<a href="dashboard.php"><img src="./images/logo1.png" alt="" class="logo"></a>
<span class="heading">Dashboard</span>
<a href="logout.php" style="color: white"><span class="fa fa-sign-out fa-
2x">Logout</span></a>
</div>
<div class="nav">
<ul>
<li class="dropdown" onclick="toggleDisplay('1')">
<a href="" class="dropbtn">Classes  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="1">
<a href="add_classes.php">Add Class</a>
<a href="manage_classes.php">Manage Class</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('2')">
<a href="#" class="dropbtn">Students  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="2">
<a href="add_students.php">Add Students</a>
<a href="manage_students.php">Manage Students</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('3')">
<a href="#" class="dropbtn">Results  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="3">
<a href="add_results.php">Add Results</a>
<a href="manage_results.php">Manage Results</a>
</div>
</li>
</ul>
</div>
<div class="main">
<?php
include('init.php');
include('session.php');
$db = mysqli_select_db($conn,'srms');
$sql = "SELECT `name`, `id` FROM `class`";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
echo "<table>
<caption>Manage Classes</caption>
<tr>
<th>ID</th>
<th>NAME</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "0 results";
}
?>
</div>
</body>
</html>
Manage result:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./css/home.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="./css/font-awesome-4.7.0/css/font-awesome.css">
<link rel="stylesheet" href="./css/form.css">
<title>Dashboard</title>
</head>
<body>
<div class="title">
<a href="dashboard.php"><img src="./images/logo1.png" alt="" class="logo"></a>
<span class="heading">Dashboard</span>
<a href="logout.php" style="color: white"><span class="fa fa-sign-out fa-
2x">Logout</span></a>
</div>
<div class="nav">
<ul>
<li class="dropdown" onclick="toggleDisplay('1')">
<a href="" class="dropbtn">Classes  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="1">
<a href="add_classes.php">Add Class</a>
<a href="manage_classes.php">Manage Class</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('2')">
<a href="#" class="dropbtn">Students  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="2">
<a href="add_students.php">Add Students</a>
<a href="manage_students.php">Manage Students</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('3')">
<a href="#" class="dropbtn">Results  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="3">
<a href="add_results.php">Add Results</a>
<a href="manage_results.php">Manage Results</a>
</div>
</li>
</ul>
</div>
<div class="main">
<br><br>
<form action="" method="post">
<fieldset>
<legend>Delete Result</legend>
<?php
include('init.php');
include('session.php');
$class_result=mysqli_query($conn,"SELECT `name` FROM `class`");
echo '<select name="class_name">';
echo '<option selected disabled>Select Class</option>';
while($row = mysqli_fetch_array($class_result)){
$display=$row['name'];
echo '<option value="'.$display.'">'.$display.'</option>';
}
echo'</select>'
?>
<input type="text" name="rno" placeholder="Roll No">
<input type="submit" value="Delete">
</fieldset>
</form>
<br><br>
<form action="" method="post">
<fieldset>
<legend>Update Result</legend>
<?php
$class_result=mysqli_query($conn,"SELECT `name` FROM `class`");
echo '<select name="class">';
echo '<option selected disabled>Select Class</option>';
while($row = mysqli_fetch_array($class_result)){
$display=$row['name'];
echo '<option value="'.$display.'">'.$display.'</option>';
}
echo'</select>'
?>
<input type="text" name="rn" placeholder="Roll No">
<input type="text" name="p1" id="" placeholder="Design and analysis of
algorithms">
<input type="text" name="p2" id="" placeholder="Database management
systems">
<input type="text" name="p3" id="" placeholder="Probability and queueing
theory">
<input type="text" name="p4" id="" placeholder="Operating systems">
<input type="text" name="p5" id="" placeholder="Software engineering">
<input type="text" name="p6" id="" placeholder="Computer architecture">
<input type="submit" value="Update">
</fieldset>
</form>
</div>
<!-- <div class="footer">
<span>Designed & Coded By Jibin Thomas</span>
</div> -->
</body>
</html>
<?php
if(isset($_POST['class_name'],$_POST['rno'])) {
$class_name=$_POST['class_name'];
$rno=$_POST['rno'];
echo $class_name;
echo $rno;
$delete_sql=mysqli_query($conn,"DELETE from `result` where `rno`='$rno' and
`class`='$class_name'");
if(!$delete_sql){
echo '<script language="javascript">';
echo 'alert("Not available")';
echo '</script>';
} else {
echo '<script language="javascript">';
echo 'alert("Deleted")';
echo '</script>';
}
}
if(isset($_POST['rn'],$_POST['p1'],$_POST['p2'],$_POST['p3'],$_POST['p4'],$_POST['p5'],
$_POST['p6'],$_POST['class'])) {
$rno=$_POST['rn'];
$class_name=$_POST['class'];
$p1=(int)$_POST['p1'];
$p2=(int)$_POST['p2'];
$p3=(int)$_POST['p3'];
$p4=(int)$_POST['p4'];
$p5=(int)$_POST['p5'];
$p6=(int)$_POST['p6'];
$marks=$p1+$p2+$p3+$p4+$p5+$p6;
$percentage=$marks/6;
$sql="UPDATE `result` SET
`p1`='$p1',`p2`='$p2',`p3`='$p3',`p4`='$p4',`p5`='$p5',`p6`,=`$p6`,`marks`='$marks',`percenta
ge`='$percentage' WHERE `rno`='$rno' and `class`='$class_name'";
$update_sql=mysqli_query($conn,$sql);
if(!$update_sql){
echo '<script language="javascript">';
echo 'alert("Invalid Details")';
echo '</script>';
} else {
echo '<script language="javascript">';
echo 'alert("Updated")';
echo '</script>';
}
}
?>
Manage students:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/home.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="./css/font-awesome-4.7.0/css/font-awesome.css">
<link rel="stylesheet" type='text/css' href="css/manage.css">
<title>Dashboard</title>
</head>
<body>
<div class="title">
<a href="dashboard.php"><img src="./images/logo1.png" alt="" class="logo"></a>
<span class="heading">Dashboard</span>
<a href="logout.php" style="color: white"><span class="fa fa-sign-out fa-
2x">Logout</span></a>
</div>
<div class="nav">
<ul>
<li class="dropdown" onclick="toggleDisplay('1')">
<a href="" class="dropbtn">Classes  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="1">
<a href="add_classes.php">Add Class</a>
<a href="manage_classes.php">Manage Class</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('2')">
<a href="#" class="dropbtn">Students  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="2">
<a href="add_students.php">Add Students</a>
<a href="manage_students.php">Manage Students</a>
</div>
</li>
<li class="dropdown" onclick="toggleDisplay('3')">
<a href="#" class="dropbtn">Results  
<span class="fa fa-angle-down"></span>
</a>
<div class="dropdown-content" id="3">
<a href="add_results.php">Add Results</a>
<a href="manage_results.php">Manage Results</a>
</div>
</li>
</ul>
</div>
<div class="main">
<?php
include('init.php');
include('session.php');
$sql = "SELECT `name`, `rno`, `class_name` FROM `students`";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
echo "<table>
<caption>Manage Students</caption>
<tr>
<th>NAME</th>
<th>ROLL NO</th>
<th>CLASS</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['rno'] . "</td>";
echo "<td>" . $row['class_name'] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "0 Students";
}
?>
</div>
<div class="footer">
<!-- <span>Designed & Coded By Jibin Thomas</span> -->
</div>
</body>
</html>
Session:
<?php
include('init.php');
session_start();
$db = mysqli_select_db($conn,'srms');
$user_check = $_SESSION['login_user'];
$ses_sql = mysqli_query($conn,"select userid from admin_login where userid=
'$user_check'");
$row = mysqli_fetch_array($ses_sql);
$login_session = $row['userid'];
if(!isset($_SESSION['login_user'])){
header("Location:login.php");
}
?>
Student:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./css/student.css">
<title>Result</title>
</head>
<body>
<?php
include("init.php");
if(!isset($_GET['class']))
$class=null;
else
$class=$_GET['class'];
$rn=$_GET['rn'];
// validation
if (empty($class) or empty($rn) or preg_match("/[a-z]/i",$rn)) {
if(empty($class))
echo '<p class="error">Please select your class</p>';
if(empty($rn))
echo '<p class="error">Please enter your roll number</p>';
if(preg_match("/[a-z]/i",$rn))
echo '<p class="error">Please enter valid roll number</p>';
exit();
}
$name_sql=mysqli_query($conn,"SELECT `name` FROM `students` WHERE `rno`='$rn'
and `class_name`='$class'");
while($row = mysqli_fetch_assoc($name_sql))
{
$name = $row['name'];
}
$result_sql=mysqli_query($conn,"SELECT `p1`, `p2`, `p3`, `p4`, `p5`,`p6`, `marks`,
`percentage` FROM `result` WHERE `rno`='$rn' and `class`='$class'");
while($row = mysqli_fetch_assoc($result_sql))
{
$p1 = $row['p1'];
$p2 = $row['p2'];
$p3 = $row['p3'];
$p4 = $row['p4'];
$p5 = $row['p5'];
$p6 = $row['p6'];
$mark = $row['marks'];
$percentage = $row['percentage'];
}
if(mysqli_num_rows($result_sql)==0){
echo "no result";
exit();
}
?>
<div class="container">
<div class="details">
<span>Name:</span> <?php echo $name ?> <br>
<span>Class:</span> <?php echo $class; ?> <br>
<span>Roll No:</span> <?php echo $rn; ?> <br>
</div>
<div class="main">
<div class="s1">
<p>Subjects</p>
<p>Design and analysis of algorithms</p>
<p>Database management systems</p>
<p>Probability and queueing theory</p>
<p>Operating systems</p>
<p>Software engineering</p>
<p>Computer architecture</p>
</div>
<div class="s2">
<p>Marks</p>
<?php echo '<p>'.$p1.'</p>';?>
<?php echo '<p>'.$p2.'</p>';?>
<?php echo '<p>'.$p3.'</p>';?>
<?php echo '<p>'.$p4.'</p>';?>
<?php echo '<p>'.$p5.'</p>';?>
<?php echo '<p>'.$p6.'</p>';?>
</div>
</div>
<div class="result">
<?php echo '<p>Total Marks: '.$mark.'</p>';?>
<?php echo '<p>Percentage: '.$percentage.'%</p>';?>
</div>
<div class="button">
<button onclick="window.print()">Print Result</button>
</div>
</div>
</body>
</html>
QUERIES:
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- Database: `srms`
-- --------------------------------------------------------
-- Table structure for table `admin`
CREATE TABLE `admin` (`id` int(11) NOT NULL,`UserName` varchar(100) DEFAULT
NULL,`Password` varchar(100) DEFAULT NULL,`updationDate` timestamp NULL
DEFAULT NULL)ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`id`, `UserName`, `Password`, `updationDate`) VALUES
(1, 'admin', 'f925916e2754e5e03f75dd58a5733251', '2022-01-01 10:30:57');
-- --------------------------------------------------------
-- Table structure for table `admin_login`
CREATE TABLE `admin_login`(`userid` varchar(30) NOT NULL,`password` varchar(30)
NOT NULL)ENGINE=InnoDB DEFAULT CHARSET=latin1
ROW_FORMAT=COMPACT;
-- Dumping data for table `admin_login`
INSERT INTO `admin_login` (`userid`, `password`) VALUES('admin', '123');
-- --------------------------------------------------------
-- Table structure for table `class`
CREATE TABLE `class`(`name` varchar(30) NOT NULL,`id` number(20) NOT
NULL)ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Dumping data for table `class`
INSERT INTO `class` (`name`, `id`) VALUES('CSE', 20221);
-- --------------------------------------------------------
-- Table structure for table `result`
CREATE TABLE `result` (`name` varchar(30) NOT NULL,`rno` text(20) NOT
NULL,`class` varchar(30) NOT NULL,`p1` int(3) NOT NULL,`p2` int(3) NOT NULL,`p3`
int(3) NOT NULL,`p4` int(3) NOT NULL,`p5` int(3) NOT NULL,`p6` int(10) NOT
NULL,`marks` int(3) NOT NULL,`percentage` float NOT NULL)ENGINE=InnoDB
DEFAULT CHARSET=latin1;
-- Dumping data for table `result`
-- Table structure for table `students`
--CREATE TABLE `students`(`name` varchar(30) NOT NULL,`rno` text(20) NOT
NULL,`class_name` varchar(30) NOT NULL)ENGINE=InnoDB DEFAULT
CHARSET=latin1;
-- Dumping data for table `students`
-- --------------------------------------------------------
-- Table structure for table `tblclasses`
--CREATE TABLE `tblclasses` (`id` number(20) NOT NULL,`ClassName` varchar(80)
DEFAULT NULL,`ClassNameNumeric` int(4) DEFAULT NULL,`Section` varchar(5)
DEFAULT NULL,`CreationDate` timestamp NULL DEFAULT
current_timestamp(),`UpdationDate` timestamp NULL DEFAULT NULL)ENGINE=InnoDB
DEFAULT CHARSET=latin1;
-- Dumping data for table `tblclasses`
--INSERT INTO `tblclasses` (`id`, `ClassName`, `ClassNameNumeric`, `Section`,
`CreationDate`, `UpdationDate`) VALUES
-- ----------------------------------------------------------
Table structure for table `tblnotice`
--CREATE TABLE `tblnotice` (`id` number(20) NOT NULL,`noticeTitle` varchar(255)
DEFAULT NULL,`noticeDetails` mediumtext DEFAULT NULL,`postingDate` timestamp
NULL DEFAULT current_timestamp())ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
-- Table structure for table `tblresult`
--CREATE TABLE `tblresult` (`id` number(20) NOT NULL,`StudentId` int(11) DEFAULT
NULL,`ClassId` int(11) DEFAULT NULL,`SubjectId` int(11) DEFAULT NULL,`marks`
int(11) DEFAULT NULL,`PostingDate` timestamp NULL DEFAULT
current_timestamp(),`UpdationDate` timestamp NULL DEFAULT NULL)ENGINE=InnoDB
DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
-- Table structure for table `tblstudents`
--CREATE TABLE `tblstudents` (`StudentId` number(20) NOT NULL,`StudentName`
varchar(100) DEFAULT NULL,`RollId` varchar(100) DEFAULT NULL,`StudentEmail`
varchar(100) DEFAULT NULL,`Gender` varchar(10) DEFAULT NULL,`DOB`
varchar(100) DEFAULT NULL,`ClassId` int(11) DEFAULT NULL,`RegDate` timestamp
NULL DEFAULT current_timestamp(),`UpdationDate` timestamp NULL DEFAULT
NULL,`Status` int(1) DEFAULT NULL)ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Dumping data for table `tblstudents`
-- Table structure for table `tblsubjectcombination`
--CREATE TABLE `tblsubjectcombination`(`id` number(20) NOT NULL,`ClassId` int(11)
DEFAULT NULL,`SubjectId` int(11) DEFAULT NULL,`status` int(1) DEFAULT
NULL,`CreationDate` timestamp NULL DEFAULT current_timestamp(),`Updationdate`
timestamp NULL DEFAULT NULL ON UPDATE current_timestamp())ENGINE=InnoDB
DEFAULT CHARSET=latin1;
-- Dumping data for table `tblsubjectcombination`
--INSERT INTO `tblsubjectcombination` (`id`, `ClassId`, `SubjectId`, `status`,
`CreationDate`, `Updationdate`) VALUES
-- --------------------------------------------------------
-- Table structure for table `tblsubjects`
--CREATE TABLE `tblsubjects` (`id` int(11) NOT NULL,`SubjectName` varchar(100) NOT
NULL,`SubjectCode` varchar(100) DEFAULT NULL,`Creationdate` timestamp NULL
DEFAULT current_timestamp(),`UpdationDate` timestamp NULL DEFAULT NULL)
ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Dumping data for table `tblsubjects`
-- Indexes for dumped tables
-- Indexes for table `admin`
--ALTER TABLE `admin`ADD PRIMARY KEY (`id`);
-- Indexes for table `admin_login`
ALTER TABLE `admin_login`ADD PRIMARY KEY (`userid`);
-- Indexes for table `class`
--ALTER TABLE `class`ADD PRIMARY KEY (`name`),ADD UNIQUE KEY `id` (`id`);
-- Indexes for table `result`
--ALTER TABLE `result`ADD KEY `class` (`class`),ADD KEY `name` (`name`,`rno`);
-- Indexes for table `students`
--ALTER TABLE `students`ADD PRIMARY KEY (`name`,`rno`),ADD KEY `class_name`
(`class_name`);
-- Indexes for table `tblclasses`
--ALTER TABLE `tblclasses`ADD PRIMARY KEY (`id`);
-- Indexes for table `tblnotice`
--ALTER TABLE `tblnotice`ADD PRIMARY KEY (`id`);
-- Indexes for table `tblresult`
--ALTER TABLE `tblresult`ADD PRIMARY KEY (`id`);
-- Indexes for table `tblstudents`
--ALTER TABLE `tblstudents`ADD PRIMARY KEY (`StudentId`);
-- Indexes for table `tblsubjectcombination`
--ALTER TABLE `tblsubjectcombination`ADD PRIMARY KEY (`id`);
-- Indexes for table `tblsubjects`
--ALTER TABLE `tblsubjects`ADD PRIMARY KEY (`id`);
-- AUTO_INCREMENT for dumped tables
-- AUTO_INCREMENT for table `admin`
--ALTER TABLE `admin`MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT=2;
-- AUTO_INCREMENT for table `tblclasses`
--ALTER TABLE `tblclasses`MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT=10;
-- AUTO_INCREMENT for table `tblnotice`
--ALTER TABLE `tblnotice`MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT=5;
-- AUTO_INCREMENT for table `tblresult`
--ALTER TABLE `tblresult`MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT=22;
-- AUTO_INCREMENT for table `tblstudents`
--ALTER TABLE `tblstudents`MODIFY `StudentId` int(11) NOT NULL
AUTO_INCREMENT, AUTO_INCREMENT=7;
-- AUTO_INCREMENT for table `tblsubjectcombination`
--ALTER TABLE `tblsubjectcombination`MODIFY `id` int(11) NOT NULL
AUTO_INCREMENT, AUTO_INCREMENT=32;
-- AUTO_INCREMENT for table `tblsubjects`
--ALTER TABLE `tblsubjects`MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT=11;
-- Constraints for dumped tables
-- Constraints for table `result`
--ALTER TABLE `result`ADD CONSTRAINT `result_ibfk_1` FOREIGN KEY (`class`)
REFERENCES `class` (`name`),ADD CONSTRAINT `result_ibfk_2` FOREIGN KEY
(`name`,`rno`) REFERENCES `students` (`name`, `rno`);
-- Constraints for table `students`
--ALTER TABLE `students`ADD CONSTRAINT `students_ibfk_1` FOREIGN KEY
(`class_name`) REFERENCES `class` (`name`);COMMIT;
----------------------------------------------------------------------------------------------------------------
---------
OUTPUT:
RESULT:
Thus the program to create a application in student result management system using
HTML and SQL Database has been written, executed and the output was verified
successfully.