SlideShare una empresa de Scribd logo
1 de 83
[Student Result Management System]
Submitted By:
[Student name: Nafiz Md Imtiaz Uddin]
[ID: 2520190011]
[Class name: 2019 C.S.T]
To: Mr. Asim Khan
Course Title: PHP (Web application)
JIANGXI UNIVERSITY OF SCIENCE AND TECHNOLOGY
INTRODUCTION
1. Interface (screen shot of all the interfaces in your project. Not: No need for HTML code to print)
I. Login.php (name of the interface and past the screen shot after heading)
II. Registraction.php
III. Home.php
IV. Create Student Class2
V. Show Student Class
VI. Subject Creation
VII. Manage Subjects
VIII. Add Subject Combination
IX. Show Subjects
X. Manage Subjects Combination
XI. Student Admission
XII. Manage Students
XIII. Change Password
2. Adynamic pages (past the dynamic pages PHP code here)
XIV. Login.php (PHP access code)
<?php
include('includes/config.php');
$username = $_POST['user'];
$password = $_POST['pass'];
//to prevent from mysqli injection
$username = stripcslashes($username);
$password = stripcslashes($password);
$username = mysqli_real_escape_string($con, $username);
$password = mysqli_real_escape_string($con, $password);
$sql = "select *from login where username = '$username' and password = '$
password'";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
$count = mysqli_num_rows($result);
if($count == 1){
echo "<h1><center> Login successful </center></h1>";
}
else{
echo "<h1> Login failed. Invalid username or password.</h1>";
}
?>
XV. Registraction.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
$username = "";
$email = "";
$errors = array();
if (isset($_POST['reg_user'])) {
// receive all input values from the form
$username = mysqli_real_escape_string($db, $_POST['username']);
$email = mysqli_real_escape_string($db, $_POST['email']);
$password_1 = mysqli_real_escape_string($db, $_POST['password_1']);
$password_2 = mysqli_real_escape_string($db, $_POST['password_2']);
if (empty($username)) { array_push($errors, "Username is required"); }
if (empty($email)) { array_push($errors, "Email is required"); }
if (empty($password_1)) { array_push($errors, "Password is required"); }
if ($password_1 != $password_2) {
array_push($errors, "The two passwords do not match");
}
// first check the database to make sure
// a user does not already exist with the same username and/or email
$user_check_query = "SELECT * FROM users WHERE username='$username' OR email='$
email' LIMIT 1";
$result = mysqli_query($db, $user_check_query);
$user = mysqli_fetch_assoc($result);
if ($user) { // if user exists
if ($user['username'] === $username) {
array_push($errors, "Username already exists");
}
if ($user['email'] === $email) {
array_push($errors, "email already exists");
}
}
if (count($errors) == 0) {
$password = md5($password_1);
$query = "INSERT INTO users (username, email, password)
VALUES('$username', '$email', '$password')";
mysqli_query($db, $query);
$_SESSION['username'] = $username;
$_SESSION['success'] = "You are now logged in";
header('location: index.php');
}
}
XVI. Home.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
?>
<?php
$sql1 ="SELECT StudentId from tblstudents ";
$query1 = $dbh -> prepare($sql1);
$query1->execute();
$results1=$query1->fetchAll(PDO::FETCH_OBJ);
$totalstudents=$query1->rowCount();
?>
<span class="number counter"><?php ec
ho htmlentities($totalstudents);?></span>
<span class="name">See to manage Stud
ent profile</span>
<span class="bg-
icon"><i class="fa fa-users"></i></span>
</a>
<!-- /.dashboard-stat -->
</div>
<!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -
->
<div class="col-lg-3 col-md-3 col-sm-6 col-
xs-12">
<a class="dashboard-stat bg-
danger" href="manage-subjects.php">
XVII. add-result
<?php include('includes/topbar.php');?>
<!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== -
-><div class="content-wrapper">
<div class="content-container">
<!-- ========== LEFT SIDEBAR ========== -->
<?php include('includes/leftbar.php');?>
<!-- /.left-sidebar -->
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Declare Result</h2>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li class="active">Student Result</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-body">
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<form class="form-
horizontal" method="post">
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Class</label>
<div class="col-sm-10">
<select name="class" class="form-
control clid" id="classid" onChange="getStudent(this.value);" required="required"
>
<option value="">Select Class</option> </select>
</div>
</div>
<div class="form-group">
<label for="date" class="
col-sm-2 control-label ">Student Name</label>
<div class="col-sm-10">
<select name="studentid" clas
s="form-
control stid" id="studentid" required="required" onChange="getresult(this.value);
">
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<div id="reslt">
</div>
</div>
</div>
<div class="form-group">
<label for="date" class="
col-sm-2 control-label">Subjects</label>
<div class="col-sm-10">
<div id="subject">
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-
offset-2 col-sm-10">
<button type="submit"
name="submit" id="submit" class="btn btn-primary">Declare Result</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<!-- /.main-wrapper -->
<script>
$(function($) {
$(".js-states").select2();
$(".js-states-limit").select2({
maximumSelectionLength: 2
});
$(".js-states-hide").select2({
minimumResultsForSearch: Infinity
});
});
</script>
<?PHP } ?>
XVIII. add-students
<?php include('includes/topbar.php');?>
<!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== -
->
<div class="content-wrapper">
<div class="content-container">
<!-- ========== LEFT SIDEBAR ========== -->
<?php include('includes/leftbar.php');?>
<!-- /.left-sidebar -->
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Student Admission</h2>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li class="active">Student Admission</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>Fill the Student info</h5
>
</div>
</div>
<div class="panel-body">
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<form class="form-
horizontal" method="post">
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Full Name</label>
<div class="col-sm-10">
<input type="text" name="fullanme" class="form-
control" id="fullanme" required="required" autocomplete="off">
</div>
</div>
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Rool Id</label>
<div class="col-sm-10">
<input type="text" name="rollid" class="form-
control" id="rollid" maxlength="5" required="required" autocomplete="off">
</div>
</div>
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Email id)</label>
<div class="col-sm-10">
<input type="email" name="emailid" class="form-
control" id="email" required="required" autocomplete="off">
</div>
</div>
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Gender</label>
<div class="col-sm-10">
<input type="radio" name="gender" value="Male" required="required" checked="">Mal
e <input type="radio" name="gender" value="Female" required="required">Female <in
put type="radio" name="gender" value="Other" required="required">Other
</div>
</div>
<div class="form-group">
<label for="default" clas
s="col-sm-2 control-label">Class</label>
<div class="col-sm-10">
<select name="class" class="form-control" id="default" required="required">
<option value="">Select Class</option>
</select>
</div>
</div>
<div class="form-group">
<label for="date" class="
col-sm-2 control-label">DOB</label>
<div class="col-sm-10">
<input type="date" n
ame="dob" class="form-control" id="date">
</div>
</div>
<div class="form-group">
<div class="col-sm-
offset-2 col-sm-10">
<button type="submit"
name="submit" class="btn btn-primary">Add</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div> <?PHP } ?>
XIX. add-subjectcombination
<?php include('includes/topbar.php');?>
<!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== -
->
<div class="content-wrapper">
<div class="content-container">
<!-- ========== LEFT SIDEBAR ========== -->
<?php include('includes/leftbar.php');?>
<!-- /.left-sidebar -->
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Add Subject Combination</h2
>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li> Subjects</li>
<li class="active">Add Subject Combinatio
n</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>Add Subject Combination</
h5>
</div>
</div>
<div class="panel-body">
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<form class="form-
horizontal" method="post">
<div class="form-group">
<label for="default" clas
s="col-sm-2 control-label">Class</label>
<div class="col-sm-10">
<select name="class" class="form-control" id="default" required="required">
<option value="">Select Class</option>
</select>
</div>
</div>
<div class="form-group">
<label for="default" clas
s="col-sm-2 control-label">Subject</label>
<div class="col-sm-10">
<select name="subject" class="form-control" id="default" required="required">
<option value="">Select Subject</option>
<?php $sql = "SELECT * from tblsubjects";
$query = $dbh->prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<option value="<?php echo htmlentities($result-
>id); ?>"><?php echo htmlentities($result->SubjectName); ?></option>
<?php }} ?>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-
offset-2 col-sm-10">
<button type="submit"
name="submit" class="btn btn-primary">Add</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<?PHP } ?>
XX. change-password
<?php include('includes/leftbar.php');?>
<!-- /.left-sidebar -->
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Admin Change Password</h2>
</div>
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li class="active">Admin change password<
/li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
<section class="section">
<div class="container-fluid">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>Admin Change Password</h5
>
</div>
</div>
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<div class="panel-body">
<form name="chngpwd" method="pos
t"  onSubmit="return valid();">
<div class="form-group has-
success">
<label for="success" clas
s="control-label">Current Password</label>
<div class="">
<input type="password" name="password" class=
"form-control" required="required" id="success">
</div>
</div>
<div class="form-
group has-success">
<label for="success" clas
s="control-label">New Password</label>
<div class="">
<input type="password
" name="newpassword" required="required" class="form-control" id="success">
</div>
</div>
<div class="form-group has-
success">
<label for="success" clas
s="control-label">Confirm Password</label>
<div class="">
<input type="password
" name="confirmpassword" class="form-control" required="required" id="success">
</div>
</div>
<div class="form-group has-success">
<div class="">
<button type="submit"
name="submit" class="btn btn-success btn-labeled">Change<span class="btn-
label btn-label-right"><i class="fa fa-check"></i></span></button>
</div>
</form>
</div>
</div>
</div>
<!-- /.col-md-8 col-md-offset-2 -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.section -->
</div>
<!-- /.main-page -->
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<!-- /.main-wrapper -->
<?php } ?>
XXI. create-class
<?php include('includes/leftbar.php');?>
<!-- /.left-sidebar -->
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Create Student Class</h2>
</div>
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li><a href="#">Classes</a></li>
<li class="active">Create Class</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
<section class="section">
<div class="container-fluid">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>Create Student Class</h5>
</div>
</div>
</div>
<?php } ?>
<div class="panel-body">
<form method="post">
<div class="form-group has-
success">
<label for="success" clas
s="control-label">Class Name</label>
<div class="">
<input type="text" na
me="classname" class="form-control" required="required" id="success">
<span class="help-
block">Eg- Third, Fouth,Sixth etc</span>
</div>
</div>
<div class="form-
group has-success">
<label for="success" clas
s="control-label">Class Name in Numeric</label>
<div class="">
<input type="number"
name="classnamenumeric" required="required" class="form-control" id="success">
<span class="help-
block">Eg- 1,2,4,5 etc</span>
</div>
</div>
<div class="form-group has-
success">
<label for="success" clas
s="control-label">Section</label>
<div class="">
<input type="text" na
me="section" class="form-control" required="required" id="success">
<span class="help-
block">Eg- A,B,C etc</span>
</div>
</div>
<div class="form-group has-success">
<div class="">
<button type="submit"
name="submit" class="btn btn-success btn-labeled">Submit<span class="btn-
label btn-label-right"><i class="fa fa-check"></i></span></button>
</div>
</form>
</div>
</div>
</div>
<!-- /.col-md-8 col-md-offset-2 -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.section -->
</div>
<!-- /.main-page -->
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<?php } ?>
XXII. create-subject
<?php include('includes/topbar.php');?>
<!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== -
->
<div class="content-wrapper">
<div class="content-container">
<!-- ========== LEFT SIDEBAR ========== -->
<?php include('includes/leftbar.php');?>
<!-- /.left-sidebar -->
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Subject Creation</h2>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li> Subjects</li>
<li class="active">Create Subject</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>Create Subject</h5>
</div>
</div>
<div class="panel-body">
</div>
<?php } ?>
<form class="form-
horizontal" method="post">
<div class="form-group">
<label for="default" clas
s="col-sm-2 control-label">Subject Name</label>
<div class="col-sm-10">
<input type="text" name="subjectname" class="form-
control" id="default" placeholder="Subject Name" required="required">
</div>
</div>
<div class="form-group">
<label for="default" clas
s="col-sm-2 control-label">Subject Code</label>
<div class="col-sm-10">
<input type="text" name="subjectcode" class="form-
control" id="default" placeholder="Subject Code" required="required">
</div>
</div>
<div class="form-group">
<div class="col-sm-
offset-2 col-sm-10">
<button type="submit"
name="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<?PHP } ?>
XXIII. edit-class
<?php include('includes/leftbar.php');?>
<!-- /.left-sidebar -->
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Update Student Class</h2>
</div>
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li><a href="#">Classes</a></li>
<li class="active">Update Class</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
<section class="section">
<div class="container-fluid">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>Update Student Class info
</h5>
</div>
</div>
</div>
<?php } ?>
<form method="post">
<label for="success" clas
s="control-label">Class Name</label>
<div class="">
<input type="text" na
me="classname" value="<?php echo htmlentities($result-
>ClassName);?>" required="required" class="form-control" id="success">
<span class="help-
block">Eg- Third, Fouth,Sixth etc</span>
</div>
</div>
<div class="form-
group has-success">
<label for="success" clas
s="control-label">Class Name in Numeric</label>
<div class="">
<input type="number"
name="classnamenumeric" value="<?php echo htmlentities($result-
>ClassNameNumeric);?>" required="required" class="form-control" id="success">
<span class="help-
block">Eg- 1,2,4,5 etc</span>
</div>
</div>
<div class="form-group has-
success">
<label for="success" clas
s="control-label">Section</label>
<div class="">
<input type="text" na
me="section" value="<?php echo htmlentities($result->Section);?>" class="form-
control" required="required" id="success">
<span class="help-
block">Eg- A,B,C etc</span>
</div>
</div>
<?php }} ?>
<div class="form-group has-success">
<div class="">
<button type="submit"
name="update" class="btn btn-success btn-labeled">Update<span class="btn-
label btn-label-right"><i class="fa fa-check"></i></span></button>
</div>
</form>
</div>
</div>
</div>
<!-- /.col-md-8 col-md-offset-2 -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.section -->
</div>
<!-- /.main-page -->
<!-- /.right-sidebar -->
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<?php } ?>
XXIV. edit-result
<?php include('includes/topbar.php');?>
<!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== -
->
<div class="content-wrapper">
<div class="content-container">
<!-- ========== LEFT SIDEBAR ========== -->
<?php include('includes/leftbar.php');?>
<!-- /.left-sidebar -->
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Student Result Info</h2>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li class="active">Result Info</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>Update the Result info</h
5>
</div>
</div>
<div class="panel-body">
<?php if($msg){?>
<div class="alert alert-success left-icon-alert" role="alert">
<strong>Well done!</strong><?php echo htmlentities($msg); ?>
</div><?php }
else if($error){?>
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<form class="form-
horizontal" method="post">
<div class="form-group">
<label for="default" class="col-sm-
2 control-label">Class</label>
<div class="col-sm-10">
<?php echo htmlentities($row->ClassName)?>(<?php echo htmlentities($row-
>Section)?>)
</div>
</div>
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Full Name</label>
<div class="col-sm-10">
<?php echo htmlentities($row->StudentName);?>
</div>
</div>
<?php } }?>
<div class="form-group">
<label for="default" class="col-sm-2 control-
label"><?php echo htmlentities($result->SubjectName)?></label>
<div class="col-sm-10">
<input type="hidden" name="id[]" value="<?php echo htmlentities($result-
>resultid)?>">
<input type="text" name="marks[]" class="form-
control" id="marks" value="<?php echo htmlentities($result-
>marks)?>" maxlength="5" required="required" autocomplete="off">
</div>
</div><?php }} ?>
<div class="form-group">
<div class="col-sm-
offset-2 col-sm-10">
<button type="submit"
name="submit" class="btn btn-primary">Update</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<?PHP } ?>
XXV. edit-student
<?php include('includes/topbar.php');?>
<!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== -
->
<div class="content-wrapper">
<div class="content-container">
<!-- ========== LEFT SIDEBAR ========== -->
<?php include('includes/leftbar.php');?>
<!-- /.left-sidebar -->
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Student Admission</h2>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li class="active">Student Admission</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>Fill the Student info</h5
>
</div>
</div>
<div class="panel-body">
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<form class="form-
horizontal" method="post">
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Full Name</label>
<div class="col-sm-10">
<input type="text" name="fullanme" class="form-
control" id="fullanme" value="<?php echo htmlentities($result-
>StudentName)?>" required="required" autocomplete="off">
</div>
</div>
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Rool Id</label>
<div class="col-sm-10">
<input type="text" name="rollid" class="form-
control" id="rollid" value="<?php echo htmlentities($result-
>RollId)?>" maxlength="5" required="required" autocomplete="off">
</div>
</div>
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Email id)</label>
<div class="col-sm-10">
<input type="email" name="emailid" class="form-
control" id="email" value="<?php echo htmlentities($result-
>StudentEmail)?>" required="required" autocomplete="off">
</div>
</div>
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Gender</label>
<div class="col-sm-10">
<?php $gndr=$result->Gender;
if($gndr=="Male")
{
?>
<input type="radio" name="gender" value="Male" required="required" checked>Male <
input type="radio" name="gender" value="Female" required="required">Female <input
type="radio" name="gender" value="Other" required="required">Other
<?php }?>
<?php
if($gndr=="Female")
{
?>
<input type="radio" name="gender" value="Male" required="required" >Male <input t
ype="radio" name="gender" value="Female" required="required" checked>Female <inpu
t type="radio" name="gender" value="Other" required="required">Other
<?php }?>
<?php
if($gndr=="Other")
{
?>
<input type="radio" name="gender" value="Male" required="required" >Male <input t
ype="radio" name="gender" value="Female" required="required">Female <input type="
radio" name="gender" value="Other" required="required" checked>Other
<?php }?>
</div>
</div>
<div class="form-group">
<label for="default" clas
s="col-sm-2 control-label">Class</label>
<div class="col-sm-10">
<input type="text" name="classname" class="form-
control" id="classname" value="<?php echo htmlentities($result-
>ClassName)?>(<?php echo htmlentities($result->Section)?>)" readonly>
</div>
</div>
<div class="form-group">
<label for="date" class="
col-sm-2 control-label">DOB</label>
<div class="col-sm-10">
<input type="date" name="dob" class="form-
control" value="<?php echo htmlentities($result->DOB)?>" id="date">
</div>
</div>
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Reg Date: </label>
<div class="col-sm-10">
<?php echo htmlentities($result->RegDate)?>
</div>
</div>
<div class="form-group">
<label for="default" class="col-sm-2 control-label">Status</label>
<div class="col-sm-10">
<?php $stats=$result->Status;
if($stats=="1")
{
?>
<input type="radio" name="status" value="1" required="required" checked>Active <i
nput type="radio" name="status" value="0" required="required">Block
<?php }?>
<?php
if($stats=="0")
{
?>
<input type="radio" name="status" value="1" required="required" >Active <input ty
pe="radio" name="status" value="0" required="required" checked>Block
<?php }?>
</div>
</div>
<?php }} ?>
<div class="form-group">
<div class="col-sm-
offset-2 col-sm-10">
<button type="submit"
name="submit" class="btn btn-primary">Add</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<?PHP } ?>
XXVI. edit-subject
<?php include('includes/topbar.php');?>
<!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== -
->
<div class="content-wrapper">
<div class="content-container">
<!-- ========== LEFT SIDEBAR ========== -->
<?php include('includes/leftbar.php');?>
<!-- /.left-sidebar -->
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Update Subject</h2>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li> Subjects</li>
<li class="active">Update Subject</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>Update Subject</h5>
</div>
</div>
<div class="panel-body">
<?php if($msg){?>
<div class="alert alert-success left-icon-alert" role="alert">
<strong>Well done!</strong><?php echo htmlentities($msg); ?>
</div><?php }
else if($error){?>
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<form class="form-
horizontal" method="post">
<div class="form-group">
<label for="default" clas
s="col-sm-2 control-label">Subject Name</label>
<div class="col-sm-10">
<input type="text" name="subjectname" value="<?php echo htmlentities($result-
>SubjectName);?>" class="form-
control" id="default" placeholder="Subject Name" required="required">
</div>
</div>
<div class="form-group">
<label for="default" clas
s="col-sm-2 control-label">Subject Code</label>
<div class="col-sm-10">
<input type="text" name="subjectcode" class="form-
control" value="<?php echo htmlentities($result-
>SubjectCode);?>" id="default" placeholder="Subject Code" required="required">
</div>
</div>
<?php }} ?>
<div class="form-group">
<div class="col-sm-
offset-2 col-sm-10">
<button type="submit"
name="Update" class="btn btn-primary">Update</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<?PHP } ?>
XXVII. manage-classes
<?php include('includes/leftbar.php');?>
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Manage Classes</h2>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li> Classes</li>
<li class="active">Manage Classes</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
<section class="section">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>View Classes Info</h5>
</div>
</div>
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<div class="panel-body p-20">
<table id="example" class="displa
y table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>#</th>
<th>Class Name</th>
<th>Class Name Numeri
c</th>
<th>Section</th>
<th>Creation Date</th
>
<th>Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Class Name</th>
<th>Class Name Numeri
c</th>
<th>Section</th>
<th>Creation Date</th
>
<th>Action</th>
</tr>
</tfoot>
<tbody>
<tr>
<td><?php echo htmlentities($cnt);?></td>
<td><?php echo htmlen
tities($result->ClassName);?></td>
<td><?php echo htmlen
tities($result->ClassNameNumeric);?></td>
<td><?php echo htmlen
tities($result->Section);?></td>
<td><?php echo htmlen
tities($result->CreationDate);?></td>
<td>
<a href="edit-class.php?classid=<?php echo htmlentities($result-
>id);?>"><i class="fa fa-edit" title="Edit Record"></i> </a>
</td>
</tr>
<?php $cnt=$cnt+1;}} ?>
</tbody>
</table>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.col-md-12 -->
</div>
</div>
<!-- /.panel -->
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.section -->
</div>
<!-- /.main-page -->
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<!-- /.main-wrapper -->
<?php } ?>
XXVIII. manage-results
<?php include('includes/leftbar.php');?>
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Manage Students</h2>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li> Students</li>
<li class="active">Manage Students</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
<section class="section">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>View Students Info</h5>
</div>
</div>
</div><?php }
else if($error){?>
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<div class="panel-body p-20">
<table id="example" class="displa
y table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>#</th>
<th>Student Name</th>
<th>Roll Id</th>
<th>Class</th>
<th>Reg Date</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Student Name</th>
<th>Roll Id</th>
<th>Class</th>
<th>Reg Date</th>
<th>Status</th>
<th>Action</th>
</tr>
</tfoot>
<tbody>
<tr>
<td><?php echo htmlentities($cnt);?></td>
<td><?php echo htmlen
tities($result->StudentName);?></td>
<td><?php echo htmlen
tities($result->RollId);?></td>
<td><?php echo htmlen
tities($result->ClassName);?>(<?php echo htmlentities($result->Section);?>)</td>
<td><?php echo htmlen
tities($result->RegDate);?></td>
<td><?php if($result
->Status==1){
echo htmlentities('Active');
}
else{
echo htmlentities('Blocked');
}
?></td>
<td>
<a href="edit-result.php?stid=<?php echo htmlentities($result-
>StudentId);?>"><i class="fa fa-edit" title="Edit Record"></i> </a>
</td>
</tr>
<?php $cnt=$cnt+1;}} ?>
</tbody>
</table>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.col-md-12 -->
</div>
</div>
<!-- /.panel -->
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.section -->
</div>
<!-- /.main-page -->
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<!-- /.main-wrapper -->
<?php } ?>
XXIX. manage-students
<?php include('includes/leftbar.php');?>
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Manage Students</h2>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li> Students</li>
<li class="active">Manage Students</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
<section class="section">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>View Students Info</h5>
</div>
</div>
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<div class="panel-body p-20">
<table id="example" class="displa
y table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>#</th>
<th>Student Name</th>
<th>Roll Id</th>
<th>Class</th>
<th>Reg Date</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Student Name</th>
<th>Roll Id</th>
<th>Class</th>
<th>Reg Date</th>
<th>Status</th>
<th>Action</th>
</tr>
</tfoot>
<tbody>
<tr>
<td><?php echo htmlentities($cnt);?></td>
<td><?php echo htmlen
tities($result->StudentName);?></td>
<td><?php echo htmlen
tities($result->RollId);?></td>
<td><?php echo htmlen
tities($result->ClassName);?>(<?php echo htmlentities($result->Section);?>)</td>
<td><?php echo htmlen
tities($result->RegDate);?></td>
<td><?php if($result
->Status==1){
echo htmlentities('Active');
}
else{
echo htmlentities('Blocked');
}
?></td>
<td>
<a href="edit-student.php?stid=<?php echo htmlentities($result-
>StudentId);?>"><i class="fa fa-edit" title="Edit Record"></i> </a>
</td>
</tr>
<?php $cnt=$cnt+1;}} ?>
</tbody>
</table>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.col-md-12 -->
</div>
</div>
<!-- /.panel -->
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.section -->
</div>
<!-- /.main-page -->
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<?php } ?>
XXX. manage-subjectcombination
<?php include('includes/topbar.php');?>
<!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== -
->
<div class="content-wrapper">
<div class="content-container">
<?php include('includes/leftbar.php');?>
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Manage Subjects Combination
</h2>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li> Subjects</li>
<li class="active">Manage Subjects Combin
ation</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
<section class="section">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>View Subjects Combination
Info</h5>
</div>
</div>
<?php if($msg){?>
<div class="alert alert-success left-icon-alert" role="alert">
<strong>Well done!</strong><?php echo htmlentities($msg); ?>
</div><?php }
else if($error){?>
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<div class="panel-body p-20">
<table id="example" class="displa
y table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>#</th>
<th>Class and Section
</th>
<th>Subject </th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Class and Section
</th>
<th>Subject </th>
<th>Status</th>
<th>Action</th>
</tr>
</tfoot>
<tbody>
<tr>
<td><?php echo htmlentities($cnt);?></td>
<td><?php echo htmlen
tities($result->ClassName);?> &nbsp; Section-<?php echo htmlentities($result-
>Section);?></td>
<td><?php echo htmlen
tities($result->SubjectName);?></td>
<td><?php $stts=$res
ult->status;
if($stts=='0')
{
echo htmlentities('Inactive');
}
else
{
echo htmlentities('Active');
}
?></td>
<td>
<?php if($stts=='0')
{ ?>
<a href="manage-subjectcombination.php?acid=<?php echo htmlentities($result-
>scid);?>" onclick="confirm('do you really want to ativate this subject');"><i cl
ass="fa fa-check" title="Acticvate Record"></i> </a><?php } else {?>
<a href="manage-subjectcombination.php?did=<?php echo htmlentities($result-
>scid);?>" onclick="confirm('do you really want to deativate this subject');"><i
class="fa fa-times" title="Deactivate Record"></i> </a>
<?php }?>
</td>
</tr>
<?php $cnt=$cnt+1;}} ?>
</tbody>
</table>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.col-md-12 -->
</div>
</div>
<!-- /.panel -->
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.section -->
</div>
<!-- /.main-page -->
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<?php } ?>
XXXI. manage-subjects
<?php include('includes/topbar.php');?>
<!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== -
->
<div class="content-wrapper">
<div class="content-container">
<?php include('includes/leftbar.php');?>
<div class="main-page">
<div class="container-fluid">
<div class="row page-title-div">
<div class="col-md-6">
<h2 class="title">Manage Subjects</h2>
</div>
<!-- /.col-md-6 text-right -->
</div>
<!-- /.row -->
<div class="row breadcrumb-div">
<div class="col-md-6">
<ul class="breadcrumb">
<li><a href="dashboard.php"><i class="fa
fa-home"></i> Home</a></li>
<li> Subjects</li>
<li class="active">Manage Subjects</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
<section class="section">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">
<div class="panel-title">
<h5>View Subjects Info</h5>
</div>
</div>
<?php if($msg){?>
<div class="alert alert-success left-icon-alert" role="alert">
<strong>Well done!</strong><?php echo htmlentities($msg); ?>
</div><?php }
else if($error){?>
<div class="alert alert-danger left-icon-alert" role="alert">
<strong>Oh snap!</strong> <?php echo
htmlentities($error); ?>
</div>
<?php } ?>
<div class="panel-body p-20">
<table id="example" class="displa
y table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>#</th>
<th>Subject Name</th>
<th>Subject Code</th>
<th>Creation Date</th
>
<th>Updation Date</th
>
<th>Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Subject Name</th
>
<th>Subject Code</th>
<th>Creation Date</th
>
<th>Updation Date</th
>
<th>Action</th>
</tr>
</tfoot>
<tbody>
<tr>
<td><?php echo htmlentities($cnt);?></td>
<td><?php echo htmlen
tities($result->SubjectName);?></td>
<td><?php echo htmlen
tities($result->SubjectCode);?></td>
<td><?php echo htmlen
tities($result->Creationdate);?></td>
<td><?php echo htmlen
tities($result->UpdationDate);?></td>
<td>
<a href="edit-subject.php?subjectid=<?php echo htmlentities($result-
>id);?>"><i class="fa fa-edit" title="Edit Record"></i> </a>
</td>
</tr>
<?php $cnt=$cnt+1;}} ?>
</tbody>
</table>
<!-- /.col-md-12 -->
</div>
</div>
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.col-md-12 -->
</div>
</div>
<!-- /.panel -->
</div>
<!-- /.col-md-6 -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.section -->
</div>
<!-- /.main-page -->
</div>
<!-- /.content-container -->
</div>
<!-- /.content-wrapper -->
</div>
<?php } ?>
XXXII. result
XXXIII. logout
3. Database Access pages (past the Database access pages here)
<?php
// DB credentials.
define('DB_HOST','localhost');
define('DB_USER','root');
define('DB_PASS','');
define('DB_NAME','nafizsql');
// Establish database connection.
try
{
$dbh = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME,DB_USER, DB_PASS,array(PD
O::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"));
}
catch (PDOException $e)
{
exit("Error: " . $e->getMessage());
}
?>
XXXIV. Login.php (just past database code here)
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if($_SESSION['alogin']!=''){
$_SESSION['alogin']='';
}
if(isset($_POST['login']))
{
$uname=$_POST['username'];
$password=md5($_POST['password']);
$sql ="SELECT UserName,Password FROM admin WHERE UserName=:uname and Password=:pa
ssword";
$query= $dbh -> prepare($sql);
$query-> bindParam(':uname', $uname, PDO::PARAM_STR);
$query-> bindParam(':password', $password, PDO::PARAM_STR);
$query-> execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
if($query->rowCount() > 0)
{
$_SESSION['alogin']=$_POST['username'];
echo "<script type='text/javascript'> document.location = 'dashboard.php'; </scri
pt>";
} else{
echo "<script>alert('Invalid Details');</script>";
}
}
?>
XXXV. Registraction.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
$username = "";
$email = "";
$errors = array();
// connect to the database
$db = mysqli_connect('localhost', 'root', '', 'registration');
// REGISTER USER
if (isset($_POST['reg_user'])) {
// receive all input values from the form
$username = mysqli_real_escape_string($db, $_POST['username']);
$email = mysqli_real_escape_string($db, $_POST['email']);
$password_1 = mysqli_real_escape_string($db, $_POST['password_1']);
$password_2 = mysqli_real_escape_string($db, $_POST['password_2']);
// form validation: ensure that the form is correctly filled ...
// by adding (array_push()) corresponding error unto $errors array
if (empty($username)) { array_push($errors, "Username is required"); }
if (empty($email)) { array_push($errors, "Email is required"); }
if (empty($password_1)) { array_push($errors, "Password is required"); }
if ($password_1 != $password_2) {
array_push($errors, "The two passwords do not match");
}
// first check the database to make sure
// a user does not already exist with the same username and/or email
$user_check_query = "SELECT * FROM users WHERE username='$username' OR email='$
email' LIMIT 1";
$result = mysqli_query($db, $user_check_query);
$user = mysqli_fetch_assoc($result);
if ($user) { // if user exists
if ($user['username'] === $username) {
array_push($errors, "Username already exists");
}
if ($user['email'] === $email) {
array_push($errors, "email already exists");
}
}
// Finally, register user if there are no errors in the form
if (count($errors) == 0) {
$password = md5($password_1);//encrypt the password before saving in the data
base
$query = "INSERT INTO users (username, email, password)
VALUES('$username', '$email', '$password')";
mysqli_query($db, $query);
$_SESSION['username'] = $username;
$_SESSION['success'] = "You are now logged in";
header('location: index.php');
}
}
XXXVI. Home.php
<?php
$sql1 ="SELECT StudentId from tblstudents ";
$query1 = $dbh -> prepare($sql1);
$query1->execute();
$results1=$query1->fetchAll(PDO::FETCH_OBJ);
$totalstudents=$query1->rowCount();
?>
<span class="number counter"><?php ec
ho htmlentities($totalstudents);?></span>
<span class="name">See to manage Stud
ent profile</span>
<span class="bg-
icon"><i class="fa fa-users"></i></span>
</a>
<!-- /.dashboard-stat -->
</div>
<!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -
->
<div class="col-lg-3 col-md-3 col-sm-6 col-
xs-12">
<a class="dashboard-stat bg-
danger" href="manage-subjects.php">
<?php
$sql ="SELECT id from tblsubjects ";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$totalsubjects=$query->rowCount();
?>
<?php
$sql2 ="SELECT id from tblclasses ";
$query2 = $dbh -> prepare($sql2);
$query2->execute();
$results2=$query2->fetchAll(PDO::FETCH_OBJ);
$totalclasses=$query2->rowCount();
?>
<?php
$sql3="SELECT distinct StudentId from tblresult ";
$query3 = $dbh -> prepare($sql3);
$query3->execute();
$results3=$query3->fetchAll(PDO::FETCH_OBJ);
$totalresults=$query3->rowCount();
?>
XXXVII. Add-result
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
if(isset($_POST['submit']))
{
$marks=array();
$class=$_POST['class'];
$studentid=$_POST['studentid'];
$mark=$_POST['marks'];
$stmt = $dbh-
>prepare("SELECT tblsubjects.SubjectName,tblsubjects.id FROM tblsubjectcombinatio
n join tblsubjects on tblsubjects.id=tblsubjectcombination.SubjectId WHERE tbls
ubjectcombination.ClassId=:cid order by tblsubjects.SubjectName");
$stmt->execute(array(':cid' => $class));
$sid1=array();
while($row=$stmt->fetch(PDO::FETCH_ASSOC))
{
array_push($sid1,$row['id']);
}
for($i=0;$i<count($mark);$i++){
$mar=$mark[$i];
$sid=$sid1[$i];
$sql="INSERT INTO tblresult(StudentId,ClassId,SubjectId,marks) VALUES(:studentid
,:class,:sid,:marks)";
$query = $dbh->prepare($sql);
$query->bindParam(':studentid',$studentid,PDO::PARAM_STR);
$query->bindParam(':class',$class,PDO::PARAM_STR);
$query->bindParam(':sid',$sid,PDO::PARAM_STR);
$query->bindParam(':marks',$mar,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
$msg="Result info added successfully";
}
else
{
$error="Something went wrong. Please try again";
}
}
}
?>
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
?>
XXXVIII. add-students
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
if(isset($_POST['submit']))
{
$studentname=$_POST['fullanme'];
$roolid=$_POST['rollid'];
$studentemail=$_POST['emailid'];
$gender=$_POST['gender'];
$classid=$_POST['class'];
$dob=$_POST['dob'];
$status=1;
$sql="INSERT INTO tblstudents(StudentName,RollId,StudentEmail,Gender,ClassId,DOB
,Status) VALUES(:studentname,:roolid,:studentemail,:gender,:classid,:dob,:status)
";
$query = $dbh->prepare($sql);
$query->bindParam(':studentname',$studentname,PDO::PARAM_STR);
$query->bindParam(':roolid',$roolid,PDO::PARAM_STR);
$query->bindParam(':studentemail',$studentemail,PDO::PARAM_STR);
$query->bindParam(':gender',$gender,PDO::PARAM_STR);
$query->bindParam(':classid',$classid,PDO::PARAM_STR);
$query->bindParam(':dob',$dob,PDO::PARAM_STR);
$query->bindParam(':status',$status,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
$msg="Student info added successfully";
}
else
{
$error="Something went wrong. Please try again";
}
}
?>
XXXIX. add-subjectcombination
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
if(isset($_POST['submit']))
{
$class=$_POST['class'];
$subject=$_POST['subject'];
$status=1;
$sql="INSERT INTO tblsubjectcombination(ClassId,SubjectId,status) VALUES(:class,
:subject,:status)";
$query = $dbh->prepare($sql);
$query->bindParam(':class',$class,PDO::PARAM_STR);
$query->bindParam(':subject',$subject,PDO::PARAM_STR);
$query->bindParam(':status',$status,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
$msg="Combination added successfully";
}
else
{
$error="Something went wrong. Please try again";
}
}
?>
XL. change-password
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
if(isset($_POST['submit']))
{
$password=md5($_POST['password']);
$newpassword=md5($_POST['newpassword']);
$username=$_SESSION['alogin'];
$sql ="SELECT Password FROM admin WHERE UserName=:username and Password=:pass
word";
$query= $dbh -> prepare($sql);
$query-> bindParam(':username', $username, PDO::PARAM_STR);
$query-> bindParam(':password', $password, PDO::PARAM_STR);
$query-> execute();
$results = $query -> fetchAll(PDO::FETCH_OBJ);
if($query -> rowCount() > 0)
{
$con="update admin set Password=:newpassword where UserName=:username";
$chngpwd1 = $dbh->prepare($con);
$chngpwd1-> bindParam(':username', $username, PDO::PARAM_STR);
$chngpwd1-> bindParam(':newpassword', $newpassword, PDO::PARAM_STR);
$chngpwd1->execute();
$msg="Your Password succesfully changed";
}
else {
$error="Your current password is wrong";
}
}
?>
XLI. create-class
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
if(isset($_POST['submit']))
{
$classname=$_POST['classname'];
$classnamenumeric=$_POST['classnamenumeric'];
$section=$_POST['section'];
$sql="INSERT INTO tblclasses(ClassName,ClassNameNumeric,Section) VALUES(:classna
me,:classnamenumeric,:section)";
$query = $dbh->prepare($sql);
$query->bindParam(':classname',$classname,PDO::PARAM_STR);
$query->bindParam(':classnamenumeric',$classnamenumeric,PDO::PARAM_STR);
$query->bindParam(':section',$section,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
$msg="Class Created successfully";
}
else
{
$error="Something went wrong. Please try again";
}
}
?>
XLII. create-subject
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
if(isset($_POST['submit']))
{
$subjectname=$_POST['subjectname'];
$subjectcode=$_POST['subjectcode'];
$sql="INSERT INTO tblsubjects(SubjectName,SubjectCode) VALUES(:subjectname,:subj
ectcode)";
$query = $dbh->prepare($sql);
$query->bindParam(':subjectname',$subjectname,PDO::PARAM_STR);
$query->bindParam(':subjectcode',$subjectcode,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
$msg="Subject Created successfully";
}
else
{
$error="Something went wrong. Please try again";
}
}
?>
XLIII. edit-class
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
if(isset($_POST['update']))
{
$classname=$_POST['classname'];
$classnamenumeric=$_POST['classnamenumeric'];
$section=$_POST['section'];
$cid=intval($_GET['classid']);
$sql="update tblclasses set ClassName=:classname,ClassNameNumeric=:classnamenume
ric,Section=:section where id=:cid ";
$query = $dbh->prepare($sql);
$query->bindParam(':classname',$classname,PDO::PARAM_STR);
$query->bindParam(':classnamenumeric',$classnamenumeric,PDO::PARAM_STR);
$query->bindParam(':section',$section,PDO::PARAM_STR);
$query->bindParam(':cid',$cid,PDO::PARAM_STR);
$query->execute();
$msg="Data has been updated successfully";
}
?>
XLIV. edit-result
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
$stid=intval($_GET['stid']);
if(isset($_POST['submit']))
{
$rowid=$_POST['id'];
$marks=$_POST['marks'];
foreach($_POST['id'] as $count => $id){
$mrks=$marks[$count];
$iid=$rowid[$count];
for($i=0;$i<=$count;$i++) {
$sql="update tblresult set marks=:mrks where id=:iid ";
$query = $dbh->prepare($sql);
$query->bindParam(':mrks',$mrks,PDO::PARAM_STR);
$query->bindParam(':iid',$iid,PDO::PARAM_STR);
$query->execute();
$msg="Result info updated successfully";
}
}
}
?>
XLV. edit-student
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
$stid=intval($_GET['stid']);
if(isset($_POST['submit']))
{
$studentname=$_POST['fullanme'];
$roolid=$_POST['rollid'];
$studentemail=$_POST['emailid'];
$gender=$_POST['gender'];
$classid=$_POST['class'];
$dob=$_POST['dob'];
$status=$_POST['status'];
$sql="update tblstudents set StudentName=:studentname,RollId=:roolid,StudentEmail
=:studentemail,Gender=:gender,DOB=:dob,Status=:status where StudentId=:stid ";
$query = $dbh->prepare($sql);
$query->bindParam(':studentname',$studentname,PDO::PARAM_STR);
$query->bindParam(':roolid',$roolid,PDO::PARAM_STR);
$query->bindParam(':studentemail',$studentemail,PDO::PARAM_STR);
$query->bindParam(':gender',$gender,PDO::PARAM_STR);
$query->bindParam(':dob',$dob,PDO::PARAM_STR);
$query->bindParam(':status',$status,PDO::PARAM_STR);
$query->bindParam(':stid',$stid,PDO::PARAM_STR);
$query->execute();
$msg="Student info updated successfully";
}
?>
XLVI. edit-subject
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
if(isset($_POST['Update']))
{
$sid=intval($_GET['subjectid']);
$subjectname=$_POST['subjectname'];
$subjectcode=$_POST['subjectcode'];
$sql="update tblsubjects set SubjectName=:subjectname,SubjectCode=:subjectcode w
here id=:sid";
$query = $dbh->prepare($sql);
$query->bindParam(':subjectname',$subjectname,PDO::PARAM_STR);
$query->bindParam(':subjectcode',$subjectcode,PDO::PARAM_STR);
$query->bindParam(':sid',$sid,PDO::PARAM_STR);
$query->execute();
$msg="Subject Info updated successfully";
}
?> <?php
$sid=intval($_GET['subjectid']);
$sql = "SELECT * from tblsubjects where id=:sid";
$query = $dbh->prepare($sql);
$query->bindParam(':sid',$sid,PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
XLVII. find-result
<?php
session_start();
//error_reporting(0);
include('includes/config.php');?>
<?php $sql = "SELECT * from tblclasses";
$query = $dbh->prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
XLVIII. get_student
<?php
include('includes/config.php');
if(!empty($_POST["classid"]))
{
$cid=intval($_POST['classid']);
if(!is_numeric($cid)){
echo htmlentities("invalid Class");exit;
}
else{
$stmt = $dbh-
>prepare("SELECT StudentName,StudentId FROM tblstudents WHERE ClassId= :id order
by StudentName");
$stmt->execute(array(':id' => $cid));
?><option value="">Select Category </option><?php
while($row=$stmt->fetch(PDO::FETCH_ASSOC))
{
?>
<option value="<?php echo htmlentities($row['StudentId']); ?>">
<?php
if(!empty($_POST["studclass"]))
{
$id= $_POST['studclass'];
$dta=explode("$",$id);
$id=$dta[0];
$id1=$dta[1];
$query = $dbh-
>prepare("SELECT StudentId,ClassId FROM tblresult WHERE StudentId=:id1 and ClassI
d=:id ");
//$query= $dbh -> prepare($sql);
$query-> bindParam(':id1', $id1, PDO::PARAM_STR);
$query-> bindParam(':id', $id, PDO::PARAM_STR);
$query-> execute();
$results = $query -> fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query -> rowCount() > 0)
{ ?>
<p>
<?php
echo "<span style='color:red'> Result Already Declare .</span>";
echo "<script>$('#submit').prop('disabled',true);</script>";
?></p>
<?php }
}?>
XLIX. manage-classes
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
?>
<?php if($msg){?>
<div class="alert alert-success left-icon-alert" role="alert">
<strong>Well done!</strong><?php echo htmlentities($msg); ?>
</div><?php }
else if($error){?> <?php $sql = "SELECT * from tblclasses";
$query = $dbh->prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<tr>
<td><?php echo htmlentities($cnt);?></td>
<td><?php echo htmlen
tities($result->ClassName);?></td>
<td><?php echo htmlen
tities($result->ClassNameNumeric);?></td>
<td><?php echo htmlen
tities($result->Section);?></td>
<td><?php echo htmlen
tities($result->CreationDate);?></td>
<td>
<a href="edit-class.php?classid=<?php echo htmlentities($result-
>id);?>"><i class="fa fa-edit" title="Edit Record"></i> </a>
</td>
</tr>
<?php $cnt=$cnt+1;}} ?>
L. manage-results
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
?>
<?php if($msg){?>
<div class="alert alert-success left-icon-alert" role="alert">
<strong>Well done!</strong><?php echo htmlentities($msg); ?>
</div><?php }
else if($error){?>
<?php $sql = "SELECT distinct tblstudents.StudentName,tblstudents.RollId,tblstud
ents.RegDate,tblstudents.StudentId,tblstudents.Status,tblclasses.ClassName,tblcla
sses.Section from tblresult join tblstudents on tblstudents.StudentId=tblresult.S
tudentId join tblclasses on tblclasses.id=tblresult.ClassId";
$query = $dbh->prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
LI. manage-students
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
?> <?php if($msg){?>
<div class="alert alert-success left-icon-alert" role="alert">
<strong>Well done!</strong><?php echo htmlentities($msg); ?>
</div><?php }
else if($error){?>
<?php $sql = "SELECT tblstudents.StudentName,tblstudents.RollId,tblstudents.RegDa
te,tblstudents.StudentId,tblstudents.Status,tblclasses.ClassName,tblclasses.Secti
on from tblstudents join tblclasses on tblclasses.id=tblstudents.ClassId";
$query = $dbh->prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
LII. manage-subjectcombination
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
// for activate Subject
if(isset($_GET['acid']))
{
$acid=intval($_GET['acid']);
$status=1;
$sql="update tblsubjectcombination set status=:status where id=:acid ";
$query = $dbh->prepare($sql);
$query->bindParam(':acid',$acid,PDO::PARAM_STR);
$query->bindParam(':status',$status,PDO::PARAM_STR);
$query->execute();
$msg="Subject Activate successfully";
}
// for Deactivate Subject
if(isset($_GET['did']))
{
$did=intval($_GET['did']);
$status=0;
$sql="update tblsubjectcombination set status=:status where id=:did ";
$query = $dbh->prepare($sql);
$query->bindParam(':did',$did,PDO::PARAM_STR);
$query->bindParam(':status',$status,PDO::PARAM_STR);
$query->execute();
$msg="Subject Deactivate successfully";
}
?>
<?php if($msg){?>
<div class="alert alert-success left-icon-alert" role="alert">
<strong>Well done!</strong><?php echo htmlentities($msg); ?>
</div><?php }
else if($error){?>
<?php $sql = "SELECT tblclasses.ClassName,tblclasses.Section,tblsubjects.SubjectN
ame,tblsubjectcombination.id as scid,tblsubjectcombination.status from tblsubject
combination join tblclasses on tblclasses.id=tblsubjectcombination.ClassId join
tblsubjects on tblsubjects.id=tblsubjectcombination.SubjectId";
$query = $dbh->prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
LIII. manage-subjects
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])=="")
{
header("Location: index.php");
}
else{
?> <?php if($msg){?>
<div class="alert alert-success left-icon-alert" role="alert">
<strong>Well done!</strong><?php echo htmlentities($msg); ?>
</div><?php }
else if($error){?>
<?php $sql = "SELECT * from tblsubjects";
$query = $dbh->prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
LIV. result
<?php
session_start();
error_reporting(0);
include('includes/config.php');
?>
<?php
// code Student Data
$rollid=$_POST['rollid'];
$classid=$_POST['class'];
$_SESSION['rollid']=$rollid;
$_SESSION['classid']=$classid;
$qery = "SELECT tblstudents.StudentName,tblstudents.RollId,tblstudents.RegDate,
tblstudents.StudentId,tblstudents.Status,tblclasses.ClassName,tblclasses.Section
from tblstudents join tblclasses on tblclasses.id=tblstudents.ClassId where tblst
udents.RollId=:rollid and tblstudents.ClassId=:classid ";
$stmt = $dbh->prepare($qery);
$stmt->bindParam(':rollid',$rollid,PDO::PARAM_STR);
$stmt->bindParam(':classid',$classid,PDO::PARAM_STR);
$stmt->execute();
$resultss=$stmt->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($stmt->rowCount() > 0)
{
foreach($resultss as $row)
{ ?>
<p><b>Student Name :</b> <?php echo htmlentities($row->StudentName);?></p>
<p><b>Student Roll Id :</b> <?php echo htmlentities($row->RollId);?>
<p><b>Student Class:</b> <?php echo htmlentities($row-
>ClassName);?>(<?php echo htmlentities($row->Section);?>)
<?php }
?> <?php
// Code for result
$query ="select t.StudentName,t.RollId,t.ClassId,t.marks,SubjectId,tblsubjects.S
ubjectName from (select sts.StudentName,sts.RollId,sts.ClassId,tr.marks,SubjectId
from tblstudents as sts join tblresult as tr on tr.StudentId=sts.StudentId) as
t join tblsubjects on tblsubjects.id=t.SubjectId where (t.RollId=:rollid and t.Cl
assId=:classid)";
$query= $dbh -> prepare($query);
$query->bindParam(':rollid',$rollid,PDO::PARAM_STR);
$query->bindParam(':classid',$classid,PDO::PARAM_STR);
$query-> execute();
$results = $query -> fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($countrow=$query->rowCount()>0)
{
foreach($results as $result){
?>
<tr>
<th scope="row" style="text-align: center"><?php echo htmlentities($cnt);?></th>
<td style="text-align: center"><?php echo htmlentities($result-
>SubjectName);?></td>
<td style="text-align: center"><?php echo htmlentities($totalmarks=$result-
>marks);?></td>
</tr>
<?php
$totlcount+=$totalmarks;
$cnt++;}
?>
LV. logout
<?php
session_start();
$_SESSION = array();
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(session_name(), '', time() - 60*60,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]
);
}
unset($_SESSION['login']);
session_destroy(); // destroy session
header("location:index.php");
?>
4. Database (screen shot of all the tables)
PHP || [Student Result Management System]
PHP || [Student Result Management System]
PHP || [Student Result Management System]

Más contenido relacionado

La actualidad más candente

Online course portal for campus with query system
Online course portal for campus with query systemOnline course portal for campus with query system
Online course portal for campus with query system
ganeshpaul6
 
Online student portal
Online student portalOnline student portal
Online student portal
Zobia Zafar
 
Html5 structure & semantic
Html5 structure & semanticHtml5 structure & semantic
Html5 structure & semantic
Muktadiur Rahman
 
Fee managment system
Fee managment systemFee managment system
Fee managment system
fairy9912
 
College mgmnt system
College mgmnt systemCollege mgmnt system
College mgmnt system
Sayali Birari
 

La actualidad más candente (20)

College management
College managementCollege management
College management
 
Online course portal for campus with query system
Online course portal for campus with query systemOnline course portal for campus with query system
Online course portal for campus with query system
 
Student management system
Student management systemStudent management system
Student management system
 
Basic Crud In Django
Basic Crud In DjangoBasic Crud In Django
Basic Crud In Django
 
Java awt (abstract window toolkit)
Java awt (abstract window toolkit)Java awt (abstract window toolkit)
Java awt (abstract window toolkit)
 
student database management system
student database management systemstudent database management system
student database management system
 
Online Attendance System
Online Attendance SystemOnline Attendance System
Online Attendance System
 
Online student portal
Online student portalOnline student portal
Online student portal
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives
 
Html5 structure & semantic
Html5 structure & semanticHtml5 structure & semantic
Html5 structure & semantic
 
Fee managment system
Fee managment systemFee managment system
Fee managment system
 
Minor project Report for "Quiz Application"
Minor project Report for "Quiz Application"Minor project Report for "Quiz Application"
Minor project Report for "Quiz Application"
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
online blogging system
online blogging systemonline blogging system
online blogging system
 
Presentation Slides of College Management System Report
Presentation Slides of College Management System ReportPresentation Slides of College Management System Report
Presentation Slides of College Management System Report
 
Web Technology Lab files with practical
Web Technology Lab  files with practicalWeb Technology Lab  files with practical
Web Technology Lab files with practical
 
College Management System
College Management SystemCollege Management System
College Management System
 
College Management System project
College Management System projectCollege Management System project
College Management System project
 
College mgmnt system
College mgmnt systemCollege mgmnt system
College mgmnt system
 
Tour and travel management system
Tour and travel management systemTour and travel management system
Tour and travel management system
 

Similar a PHP || [Student Result Management System]

Creating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login SystemCreating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login System
Azharul Haque Shohan
 
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
arcware
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf Conference
 

Similar a PHP || [Student Result Management System] (20)

Creating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login SystemCreating a Simple PHP and MySQL-Based Login System
Creating a Simple PHP and MySQL-Based Login System
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 
Php update and delet operation
Php update and delet operationPhp update and delet operation
Php update and delet operation
 
Building scalable products with WordPress - WordCamp London 2018
Building scalable products with WordPress - WordCamp London 2018Building scalable products with WordPress - WordCamp London 2018
Building scalable products with WordPress - WordCamp London 2018
 
Crafting beautiful software
Crafting beautiful softwareCrafting beautiful software
Crafting beautiful software
 
Migrare da symfony 1 a Symfony2
 Migrare da symfony 1 a Symfony2  Migrare da symfony 1 a Symfony2
Migrare da symfony 1 a Symfony2
 
Bag Of Tricks From Iusethis
Bag Of Tricks From IusethisBag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technology
 
Form demoinplaywithmysql
Form demoinplaywithmysqlForm demoinplaywithmysql
Form demoinplaywithmysql
 
Login and Registration form using oop in php
Login and Registration form using oop in phpLogin and Registration form using oop in php
Login and Registration form using oop in php
 
Separation of concerns - DPC12
Separation of concerns - DPC12Separation of concerns - DPC12
Separation of concerns - DPC12
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of Lithium
 
Command-Oriented Architecture
Command-Oriented ArchitectureCommand-Oriented Architecture
Command-Oriented Architecture
 
Add loop shortcode
Add loop shortcodeAdd loop shortcode
Add loop shortcode
 
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
 
Php (1)
Php (1)Php (1)
Php (1)
 
Diving into php
Diving into phpDiving into php
Diving into php
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
 
Php
PhpPhp
Php
 

Más de Jiangxi University of Science and Technology (江西理工大学)

Más de Jiangxi University of Science and Technology (江西理工大学) (6)

NodeMCU || Controlling and observing a robotic car with a smartphone through...
NodeMCU || Controlling and observing a robotic car with a  smartphone through...NodeMCU || Controlling and observing a robotic car with a  smartphone through...
NodeMCU || Controlling and observing a robotic car with a smartphone through...
 
Flutter-Dart project || Hotel Management System
Flutter-Dart project || Hotel Management SystemFlutter-Dart project || Hotel Management System
Flutter-Dart project || Hotel Management System
 
App inventor || Face Mesh Filter Camera and detection system in AI technolog...
App inventor || Face Mesh Filter Camera and detection  system in AI technolog...App inventor || Face Mesh Filter Camera and detection  system in AI technolog...
App inventor || Face Mesh Filter Camera and detection system in AI technolog...
 
Document of Turbo ++ project|| Railway Reservation System project
Document of Turbo ++  project|| Railway Reservation System projectDocument of Turbo ++  project|| Railway Reservation System project
Document of Turbo ++ project|| Railway Reservation System project
 
Presentation of Turbo C++ || Railway Reservation System project || B.Sc. student
Presentation of Turbo C++ || Railway Reservation System project || B.Sc. studentPresentation of Turbo C++ || Railway Reservation System project || B.Sc. student
Presentation of Turbo C++ || Railway Reservation System project || B.Sc. student
 
App Inventor || Face emotion || Data saver || B.Sc. student task
App Inventor || Face emotion || Data saver || B.Sc. student taskApp Inventor || Face emotion || Data saver || B.Sc. student task
App Inventor || Face emotion || Data saver || B.Sc. student task
 

Último

MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MysoreMuleSoftMeetup
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 

Último (20)

Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfDiuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 

PHP || [Student Result Management System]

  • 1. [Student Result Management System] Submitted By: [Student name: Nafiz Md Imtiaz Uddin] [ID: 2520190011] [Class name: 2019 C.S.T] To: Mr. Asim Khan Course Title: PHP (Web application) JIANGXI UNIVERSITY OF SCIENCE AND TECHNOLOGY INTRODUCTION
  • 2. 1. Interface (screen shot of all the interfaces in your project. Not: No need for HTML code to print) I. Login.php (name of the interface and past the screen shot after heading)
  • 6. VI. Subject Creation VII. Manage Subjects
  • 7. VIII. Add Subject Combination IX. Show Subjects
  • 8. X. Manage Subjects Combination XI. Student Admission
  • 9. XII. Manage Students XIII. Change Password
  • 10. 2. Adynamic pages (past the dynamic pages PHP code here) XIV. Login.php (PHP access code) <?php include('includes/config.php'); $username = $_POST['user']; $password = $_POST['pass']; //to prevent from mysqli injection $username = stripcslashes($username); $password = stripcslashes($password); $username = mysqli_real_escape_string($con, $username); $password = mysqli_real_escape_string($con, $password); $sql = "select *from login where username = '$username' and password = '$ password'"; $result = mysqli_query($con, $sql); $row = mysqli_fetch_array($result, MYSQLI_ASSOC); $count = mysqli_num_rows($result); if($count == 1){ echo "<h1><center> Login successful </center></h1>"; } else{ echo "<h1> Login failed. Invalid username or password.</h1>"; } ?> XV. Registraction.php <?php session_start(); error_reporting(0); include('includes/config.php'); $username = ""; $email = ""; $errors = array();
  • 11. if (isset($_POST['reg_user'])) { // receive all input values from the form $username = mysqli_real_escape_string($db, $_POST['username']); $email = mysqli_real_escape_string($db, $_POST['email']); $password_1 = mysqli_real_escape_string($db, $_POST['password_1']); $password_2 = mysqli_real_escape_string($db, $_POST['password_2']); if (empty($username)) { array_push($errors, "Username is required"); } if (empty($email)) { array_push($errors, "Email is required"); } if (empty($password_1)) { array_push($errors, "Password is required"); } if ($password_1 != $password_2) { array_push($errors, "The two passwords do not match"); } // first check the database to make sure // a user does not already exist with the same username and/or email $user_check_query = "SELECT * FROM users WHERE username='$username' OR email='$ email' LIMIT 1"; $result = mysqli_query($db, $user_check_query); $user = mysqli_fetch_assoc($result); if ($user) { // if user exists if ($user['username'] === $username) { array_push($errors, "Username already exists"); } if ($user['email'] === $email) { array_push($errors, "email already exists"); } } if (count($errors) == 0) { $password = md5($password_1); $query = "INSERT INTO users (username, email, password) VALUES('$username', '$email', '$password')"; mysqli_query($db, $query); $_SESSION['username'] = $username; $_SESSION['success'] = "You are now logged in"; header('location: index.php'); } } XVI. Home.php
  • 12. <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ ?> <?php $sql1 ="SELECT StudentId from tblstudents "; $query1 = $dbh -> prepare($sql1); $query1->execute(); $results1=$query1->fetchAll(PDO::FETCH_OBJ); $totalstudents=$query1->rowCount(); ?> <span class="number counter"><?php ec ho htmlentities($totalstudents);?></span> <span class="name">See to manage Stud ent profile</span> <span class="bg- icon"><i class="fa fa-users"></i></span> </a> <!-- /.dashboard-stat --> </div> <!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 - -> <div class="col-lg-3 col-md-3 col-sm-6 col- xs-12"> <a class="dashboard-stat bg- danger" href="manage-subjects.php"> XVII. add-result <?php include('includes/topbar.php');?> <!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== - -><div class="content-wrapper"> <div class="content-container"> <!-- ========== LEFT SIDEBAR ========== -->
  • 13. <?php include('includes/leftbar.php');?> <!-- /.left-sidebar --> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Declare Result</h2> </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li class="active">Student Result</li> </ul> </div> </div> <!-- /.row --> </div> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-body"> <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <form class="form- horizontal" method="post"> <div class="form-group"> <label for="default" class="col-sm-2 control-label">Class</label>
  • 14. <div class="col-sm-10"> <select name="class" class="form- control clid" id="classid" onChange="getStudent(this.value);" required="required" > <option value="">Select Class</option> </select> </div> </div> <div class="form-group"> <label for="date" class=" col-sm-2 control-label ">Student Name</label> <div class="col-sm-10"> <select name="studentid" clas s="form- control stid" id="studentid" required="required" onChange="getresult(this.value); "> </select> </div> </div> <div class="form-group"> <div class="col-sm-10"> <div id="reslt"> </div> </div> </div> <div class="form-group"> <label for="date" class=" col-sm-2 control-label">Subjects</label> <div class="col-sm-10"> <div id="subject"> </div> </div> </div> <div class="form-group"> <div class="col-sm- offset-2 col-sm-10"> <button type="submit" name="submit" id="submit" class="btn btn-primary">Declare Result</button> </div> </div>
  • 15. </form> </div> </div> </div> <!-- /.col-md-12 --> </div> </div> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <!-- /.main-wrapper --> <script> $(function($) { $(".js-states").select2(); $(".js-states-limit").select2({ maximumSelectionLength: 2 }); $(".js-states-hide").select2({ minimumResultsForSearch: Infinity }); }); </script> <?PHP } ?> XVIII. add-students <?php include('includes/topbar.php');?> <!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== - -> <div class="content-wrapper"> <div class="content-container"> <!-- ========== LEFT SIDEBAR ========== --> <?php include('includes/leftbar.php');?> <!-- /.left-sidebar --> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div">
  • 16. <div class="col-md-6"> <h2 class="title">Student Admission</h2> </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li class="active">Student Admission</li> </ul> </div> </div> <!-- /.row --> </div> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>Fill the Student info</h5 > </div> </div> <div class="panel-body"> <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <form class="form- horizontal" method="post"> <div class="form-group"> <label for="default" class="col-sm-2 control-label">Full Name</label> <div class="col-sm-10">
  • 17. <input type="text" name="fullanme" class="form- control" id="fullanme" required="required" autocomplete="off"> </div> </div> <div class="form-group"> <label for="default" class="col-sm-2 control-label">Rool Id</label> <div class="col-sm-10"> <input type="text" name="rollid" class="form- control" id="rollid" maxlength="5" required="required" autocomplete="off"> </div> </div> <div class="form-group"> <label for="default" class="col-sm-2 control-label">Email id)</label> <div class="col-sm-10"> <input type="email" name="emailid" class="form- control" id="email" required="required" autocomplete="off"> </div> </div> <div class="form-group"> <label for="default" class="col-sm-2 control-label">Gender</label> <div class="col-sm-10"> <input type="radio" name="gender" value="Male" required="required" checked="">Mal e <input type="radio" name="gender" value="Female" required="required">Female <in put type="radio" name="gender" value="Other" required="required">Other </div> </div> <div class="form-group"> <label for="default" clas s="col-sm-2 control-label">Class</label> <div class="col-sm-10">
  • 18. <select name="class" class="form-control" id="default" required="required"> <option value="">Select Class</option> </select> </div> </div> <div class="form-group"> <label for="date" class=" col-sm-2 control-label">DOB</label> <div class="col-sm-10"> <input type="date" n ame="dob" class="form-control" id="date"> </div> </div> <div class="form-group"> <div class="col-sm- offset-2 col-sm-10"> <button type="submit" name="submit" class="btn btn-primary">Add</button> </div> </div> </form> </div> </div> </div> <!-- /.col-md-12 --> </div> </div> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <?PHP } ?> XIX. add-subjectcombination <?php include('includes/topbar.php');?> <!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== - -> <div class="content-wrapper">
  • 19. <div class="content-container"> <!-- ========== LEFT SIDEBAR ========== --> <?php include('includes/leftbar.php');?> <!-- /.left-sidebar --> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Add Subject Combination</h2 > </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li> Subjects</li> <li class="active">Add Subject Combinatio n</li> </ul> </div> </div> <!-- /.row --> </div> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>Add Subject Combination</ h5> </div> </div> <div class="panel-body">
  • 20. <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <form class="form- horizontal" method="post"> <div class="form-group"> <label for="default" clas s="col-sm-2 control-label">Class</label> <div class="col-sm-10"> <select name="class" class="form-control" id="default" required="required"> <option value="">Select Class</option> </select> </div> </div> <div class="form-group"> <label for="default" clas s="col-sm-2 control-label">Subject</label> <div class="col-sm-10"> <select name="subject" class="form-control" id="default" required="required"> <option value="">Select Subject</option> <?php $sql = "SELECT * from tblsubjects"; $query = $dbh->prepare($sql); $query->execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); if($query->rowCount() > 0) { foreach($results as $result) { ?> <option value="<?php echo htmlentities($result- >id); ?>"><?php echo htmlentities($result->SubjectName); ?></option> <?php }} ?> </select> </div> </div> <div class="form-group"> <div class="col-sm- offset-2 col-sm-10"> <button type="submit" name="submit" class="btn btn-primary">Add</button> </div>
  • 21. </div> </form> </div> </div> </div> <!-- /.col-md-12 --> </div> </div> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <?PHP } ?> XX. change-password <?php include('includes/leftbar.php');?> <!-- /.left-sidebar --> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Admin Change Password</h2> </div> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li class="active">Admin change password< /li> </ul> </div> </div>
  • 22. <!-- /.row --> </div> <!-- /.container-fluid --> <section class="section"> <div class="container-fluid"> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>Admin Change Password</h5 > </div> </div> <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <div class="panel-body"> <form name="chngpwd" method="pos t" onSubmit="return valid();"> <div class="form-group has- success"> <label for="success" clas s="control-label">Current Password</label> <div class=""> <input type="password" name="password" class= "form-control" required="required" id="success"> </div> </div> <div class="form- group has-success"> <label for="success" clas s="control-label">New Password</label> <div class="">
  • 23. <input type="password " name="newpassword" required="required" class="form-control" id="success"> </div> </div> <div class="form-group has- success"> <label for="success" clas s="control-label">Confirm Password</label> <div class=""> <input type="password " name="confirmpassword" class="form-control" required="required" id="success"> </div> </div> <div class="form-group has-success"> <div class=""> <button type="submit" name="submit" class="btn btn-success btn-labeled">Change<span class="btn- label btn-label-right"><i class="fa fa-check"></i></span></button> </div> </form> </div> </div> </div> <!-- /.col-md-8 col-md-offset-2 --> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </section> <!-- /.section --> </div> <!-- /.main-page --> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper -->
  • 24. </div> <!-- /.main-wrapper --> <?php } ?> XXI. create-class <?php include('includes/leftbar.php');?> <!-- /.left-sidebar --> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Create Student Class</h2> </div> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li><a href="#">Classes</a></li> <li class="active">Create Class</li> </ul> </div> </div> <!-- /.row --> </div> <!-- /.container-fluid --> <section class="section"> <div class="container-fluid"> <div class="row">
  • 25. <div class="col-md-8 col-md-offset-2"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>Create Student Class</h5> </div> </div> </div> <?php } ?> <div class="panel-body"> <form method="post"> <div class="form-group has- success"> <label for="success" clas s="control-label">Class Name</label> <div class=""> <input type="text" na me="classname" class="form-control" required="required" id="success"> <span class="help- block">Eg- Third, Fouth,Sixth etc</span> </div> </div> <div class="form- group has-success"> <label for="success" clas s="control-label">Class Name in Numeric</label> <div class=""> <input type="number" name="classnamenumeric" required="required" class="form-control" id="success"> <span class="help- block">Eg- 1,2,4,5 etc</span> </div> </div> <div class="form-group has- success"> <label for="success" clas s="control-label">Section</label> <div class=""> <input type="text" na me="section" class="form-control" required="required" id="success"> <span class="help- block">Eg- A,B,C etc</span> </div>
  • 26. </div> <div class="form-group has-success"> <div class=""> <button type="submit" name="submit" class="btn btn-success btn-labeled">Submit<span class="btn- label btn-label-right"><i class="fa fa-check"></i></span></button> </div> </form> </div> </div> </div> <!-- /.col-md-8 col-md-offset-2 --> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </section> <!-- /.section --> </div> <!-- /.main-page --> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <?php } ?> XXII. create-subject
  • 27. <?php include('includes/topbar.php');?> <!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== - -> <div class="content-wrapper"> <div class="content-container"> <!-- ========== LEFT SIDEBAR ========== --> <?php include('includes/leftbar.php');?> <!-- /.left-sidebar --> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Subject Creation</h2> </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li> Subjects</li> <li class="active">Create Subject</li> </ul> </div> </div> <!-- /.row --> </div> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>Create Subject</h5> </div> </div>
  • 28. <div class="panel-body"> </div> <?php } ?> <form class="form- horizontal" method="post"> <div class="form-group"> <label for="default" clas s="col-sm-2 control-label">Subject Name</label> <div class="col-sm-10"> <input type="text" name="subjectname" class="form- control" id="default" placeholder="Subject Name" required="required"> </div> </div> <div class="form-group"> <label for="default" clas s="col-sm-2 control-label">Subject Code</label> <div class="col-sm-10"> <input type="text" name="subjectcode" class="form- control" id="default" placeholder="Subject Code" required="required"> </div> </div> <div class="form-group"> <div class="col-sm- offset-2 col-sm-10"> <button type="submit" name="submit" class="btn btn-primary">Submit</button> </div> </div> </form> </div> </div> </div> <!-- /.col-md-12 --> </div> </div> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div>
  • 29. <?PHP } ?> XXIII. edit-class <?php include('includes/leftbar.php');?> <!-- /.left-sidebar --> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Update Student Class</h2> </div> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li><a href="#">Classes</a></li> <li class="active">Update Class</li> </ul> </div> </div> <!-- /.row --> </div> <!-- /.container-fluid --> <section class="section"> <div class="container-fluid"> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="panel"> <div class="panel-heading"> <div class="panel-title">
  • 30. <h5>Update Student Class info </h5> </div> </div> </div> <?php } ?> <form method="post"> <label for="success" clas s="control-label">Class Name</label> <div class=""> <input type="text" na me="classname" value="<?php echo htmlentities($result- >ClassName);?>" required="required" class="form-control" id="success"> <span class="help- block">Eg- Third, Fouth,Sixth etc</span> </div> </div> <div class="form- group has-success"> <label for="success" clas s="control-label">Class Name in Numeric</label> <div class=""> <input type="number" name="classnamenumeric" value="<?php echo htmlentities($result- >ClassNameNumeric);?>" required="required" class="form-control" id="success"> <span class="help- block">Eg- 1,2,4,5 etc</span> </div> </div> <div class="form-group has- success"> <label for="success" clas s="control-label">Section</label> <div class=""> <input type="text" na me="section" value="<?php echo htmlentities($result->Section);?>" class="form- control" required="required" id="success"> <span class="help- block">Eg- A,B,C etc</span> </div> </div> <?php }} ?> <div class="form-group has-success">
  • 31. <div class=""> <button type="submit" name="update" class="btn btn-success btn-labeled">Update<span class="btn- label btn-label-right"><i class="fa fa-check"></i></span></button> </div> </form> </div> </div> </div> <!-- /.col-md-8 col-md-offset-2 --> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </section> <!-- /.section --> </div> <!-- /.main-page --> <!-- /.right-sidebar --> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <?php } ?> XXIV. edit-result
  • 32. <?php include('includes/topbar.php');?> <!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== - -> <div class="content-wrapper"> <div class="content-container"> <!-- ========== LEFT SIDEBAR ========== --> <?php include('includes/leftbar.php');?> <!-- /.left-sidebar --> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Student Result Info</h2> </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li class="active">Result Info</li> </ul> </div> </div> <!-- /.row --> </div> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>Update the Result info</h 5> </div>
  • 33. </div> <div class="panel-body"> <?php if($msg){?> <div class="alert alert-success left-icon-alert" role="alert"> <strong>Well done!</strong><?php echo htmlentities($msg); ?> </div><?php } else if($error){?> <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <form class="form- horizontal" method="post"> <div class="form-group"> <label for="default" class="col-sm- 2 control-label">Class</label> <div class="col-sm-10"> <?php echo htmlentities($row->ClassName)?>(<?php echo htmlentities($row- >Section)?>) </div> </div> <div class="form-group"> <label for="default" class="col-sm-2 control-label">Full Name</label> <div class="col-sm-10"> <?php echo htmlentities($row->StudentName);?> </div> </div> <?php } }?> <div class="form-group"> <label for="default" class="col-sm-2 control- label"><?php echo htmlentities($result->SubjectName)?></label> <div class="col-sm-10"> <input type="hidden" name="id[]" value="<?php echo htmlentities($result- >resultid)?>"> <input type="text" name="marks[]" class="form- control" id="marks" value="<?php echo htmlentities($result- >marks)?>" maxlength="5" required="required" autocomplete="off"> </div> </div><?php }} ?>
  • 34. <div class="form-group"> <div class="col-sm- offset-2 col-sm-10"> <button type="submit" name="submit" class="btn btn-primary">Update</button> </div> </div> </form> </div> </div> </div> <!-- /.col-md-12 --> </div> </div> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <?PHP } ?> XXV. edit-student <?php include('includes/topbar.php');?> <!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== - -> <div class="content-wrapper"> <div class="content-container"> <!-- ========== LEFT SIDEBAR ========== --> <?php include('includes/leftbar.php');?> <!-- /.left-sidebar --> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Student Admission</h2>
  • 35. </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li class="active">Student Admission</li> </ul> </div> </div> <!-- /.row --> </div> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>Fill the Student info</h5 > </div> </div> <div class="panel-body"> <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <form class="form- horizontal" method="post"> <div class="form-group"> <label for="default" class="col-sm-2 control-label">Full Name</label> <div class="col-sm-10"> <input type="text" name="fullanme" class="form- control" id="fullanme" value="<?php echo htmlentities($result- >StudentName)?>" required="required" autocomplete="off"> </div> </div>
  • 36. <div class="form-group"> <label for="default" class="col-sm-2 control-label">Rool Id</label> <div class="col-sm-10"> <input type="text" name="rollid" class="form- control" id="rollid" value="<?php echo htmlentities($result- >RollId)?>" maxlength="5" required="required" autocomplete="off"> </div> </div> <div class="form-group"> <label for="default" class="col-sm-2 control-label">Email id)</label> <div class="col-sm-10"> <input type="email" name="emailid" class="form- control" id="email" value="<?php echo htmlentities($result- >StudentEmail)?>" required="required" autocomplete="off"> </div> </div> <div class="form-group"> <label for="default" class="col-sm-2 control-label">Gender</label> <div class="col-sm-10"> <?php $gndr=$result->Gender; if($gndr=="Male") { ?> <input type="radio" name="gender" value="Male" required="required" checked>Male < input type="radio" name="gender" value="Female" required="required">Female <input type="radio" name="gender" value="Other" required="required">Other <?php }?> <?php if($gndr=="Female") { ?> <input type="radio" name="gender" value="Male" required="required" >Male <input t ype="radio" name="gender" value="Female" required="required" checked>Female <inpu t type="radio" name="gender" value="Other" required="required">Other <?php }?> <?php if($gndr=="Other") { ?>
  • 37. <input type="radio" name="gender" value="Male" required="required" >Male <input t ype="radio" name="gender" value="Female" required="required">Female <input type=" radio" name="gender" value="Other" required="required" checked>Other <?php }?> </div> </div> <div class="form-group"> <label for="default" clas s="col-sm-2 control-label">Class</label> <div class="col-sm-10"> <input type="text" name="classname" class="form- control" id="classname" value="<?php echo htmlentities($result- >ClassName)?>(<?php echo htmlentities($result->Section)?>)" readonly> </div> </div> <div class="form-group"> <label for="date" class=" col-sm-2 control-label">DOB</label> <div class="col-sm-10"> <input type="date" name="dob" class="form- control" value="<?php echo htmlentities($result->DOB)?>" id="date"> </div> </div> <div class="form-group"> <label for="default" class="col-sm-2 control-label">Reg Date: </label> <div class="col-sm-10"> <?php echo htmlentities($result->RegDate)?> </div> </div> <div class="form-group"> <label for="default" class="col-sm-2 control-label">Status</label> <div class="col-sm-10"> <?php $stats=$result->Status; if($stats=="1") { ?> <input type="radio" name="status" value="1" required="required" checked>Active <i nput type="radio" name="status" value="0" required="required">Block <?php }?>
  • 38. <?php if($stats=="0") { ?> <input type="radio" name="status" value="1" required="required" >Active <input ty pe="radio" name="status" value="0" required="required" checked>Block <?php }?> </div> </div> <?php }} ?> <div class="form-group"> <div class="col-sm- offset-2 col-sm-10"> <button type="submit" name="submit" class="btn btn-primary">Add</button> </div> </div> </form> </div> </div> </div> <!-- /.col-md-12 --> </div> </div> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <?PHP } ?> XXVI. edit-subject <?php include('includes/topbar.php');?>
  • 39. <!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== - -> <div class="content-wrapper"> <div class="content-container"> <!-- ========== LEFT SIDEBAR ========== --> <?php include('includes/leftbar.php');?> <!-- /.left-sidebar --> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Update Subject</h2> </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li> Subjects</li> <li class="active">Update Subject</li> </ul> </div> </div> <!-- /.row --> </div> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>Update Subject</h5> </div> </div> <div class="panel-body">
  • 40. <?php if($msg){?> <div class="alert alert-success left-icon-alert" role="alert"> <strong>Well done!</strong><?php echo htmlentities($msg); ?> </div><?php } else if($error){?> <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <form class="form- horizontal" method="post"> <div class="form-group"> <label for="default" clas s="col-sm-2 control-label">Subject Name</label> <div class="col-sm-10"> <input type="text" name="subjectname" value="<?php echo htmlentities($result- >SubjectName);?>" class="form- control" id="default" placeholder="Subject Name" required="required"> </div> </div> <div class="form-group"> <label for="default" clas s="col-sm-2 control-label">Subject Code</label> <div class="col-sm-10"> <input type="text" name="subjectcode" class="form- control" value="<?php echo htmlentities($result- >SubjectCode);?>" id="default" placeholder="Subject Code" required="required"> </div> </div> <?php }} ?> <div class="form-group"> <div class="col-sm- offset-2 col-sm-10"> <button type="submit" name="Update" class="btn btn-primary">Update</button> </div> </div> </form> </div>
  • 41. </div> </div> <!-- /.col-md-12 --> </div> </div> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <?PHP } ?> XXVII. manage-classes <?php include('includes/leftbar.php');?> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Manage Classes</h2> </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li> Classes</li> <li class="active">Manage Classes</li> </ul> </div> </div> <!-- /.row --> </div> <!-- /.container-fluid --> <section class="section">
  • 42. <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>View Classes Info</h5> </div> </div> <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <div class="panel-body p-20"> <table id="example" class="displa y table table-striped table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>#</th> <th>Class Name</th> <th>Class Name Numeri c</th> <th>Section</th> <th>Creation Date</th > <th>Action</th> </tr> </thead> <tfoot> <tr> <th>#</th> <th>Class Name</th> <th>Class Name Numeri c</th> <th>Section</th> <th>Creation Date</th > <th>Action</th> </tr>
  • 43. </tfoot> <tbody> <tr> <td><?php echo htmlentities($cnt);?></td> <td><?php echo htmlen tities($result->ClassName);?></td> <td><?php echo htmlen tities($result->ClassNameNumeric);?></td> <td><?php echo htmlen tities($result->Section);?></td> <td><?php echo htmlen tities($result->CreationDate);?></td> <td> <a href="edit-class.php?classid=<?php echo htmlentities($result- >id);?>"><i class="fa fa-edit" title="Edit Record"></i> </a> </td> </tr> <?php $cnt=$cnt+1;}} ?> </tbody> </table> <!-- /.col-md-12 --> </div> </div> </div> <!-- /.col-md-6 --> </div> <!-- /.col-md-12 --> </div> </div> <!-- /.panel --> </div> <!-- /.col-md-6 --> </div> <!-- /.row --> </div> <!-- /.container-fluid -->
  • 44. </section> <!-- /.section --> </div> <!-- /.main-page --> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <!-- /.main-wrapper --> <?php } ?> XXVIII. manage-results <?php include('includes/leftbar.php');?> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Manage Students</h2> </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li> Students</li> <li class="active">Manage Students</li> </ul>
  • 45. </div> </div> <!-- /.row --> </div> <!-- /.container-fluid --> <section class="section"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>View Students Info</h5> </div> </div> </div><?php } else if($error){?> <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <div class="panel-body p-20"> <table id="example" class="displa y table table-striped table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>#</th> <th>Student Name</th> <th>Roll Id</th> <th>Class</th> <th>Reg Date</th> <th>Status</th> <th>Action</th> </tr> </thead> <tfoot> <tr>
  • 46. <th>#</th> <th>Student Name</th> <th>Roll Id</th> <th>Class</th> <th>Reg Date</th> <th>Status</th> <th>Action</th> </tr> </tfoot> <tbody> <tr> <td><?php echo htmlentities($cnt);?></td> <td><?php echo htmlen tities($result->StudentName);?></td> <td><?php echo htmlen tities($result->RollId);?></td> <td><?php echo htmlen tities($result->ClassName);?>(<?php echo htmlentities($result->Section);?>)</td> <td><?php echo htmlen tities($result->RegDate);?></td> <td><?php if($result ->Status==1){ echo htmlentities('Active'); } else{ echo htmlentities('Blocked'); } ?></td> <td> <a href="edit-result.php?stid=<?php echo htmlentities($result- >StudentId);?>"><i class="fa fa-edit" title="Edit Record"></i> </a> </td> </tr> <?php $cnt=$cnt+1;}} ?> </tbody> </table> <!-- /.col-md-12 --> </div> </div> </div>
  • 47. <!-- /.col-md-6 --> </div> <!-- /.col-md-12 --> </div> </div> <!-- /.panel --> </div> <!-- /.col-md-6 --> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </section> <!-- /.section --> </div> <!-- /.main-page --> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <!-- /.main-wrapper --> <?php } ?> XXIX. manage-students <?php include('includes/leftbar.php');?> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div">
  • 48. <div class="col-md-6"> <h2 class="title">Manage Students</h2> </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li> Students</li> <li class="active">Manage Students</li> </ul> </div> </div> <!-- /.row --> </div> <!-- /.container-fluid --> <section class="section"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>View Students Info</h5> </div> </div> <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <div class="panel-body p-20">
  • 49. <table id="example" class="displa y table table-striped table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>#</th> <th>Student Name</th> <th>Roll Id</th> <th>Class</th> <th>Reg Date</th> <th>Status</th> <th>Action</th> </tr> </thead> <tfoot> <tr> <th>#</th> <th>Student Name</th> <th>Roll Id</th> <th>Class</th> <th>Reg Date</th> <th>Status</th> <th>Action</th> </tr> </tfoot> <tbody> <tr> <td><?php echo htmlentities($cnt);?></td> <td><?php echo htmlen tities($result->StudentName);?></td> <td><?php echo htmlen tities($result->RollId);?></td> <td><?php echo htmlen tities($result->ClassName);?>(<?php echo htmlentities($result->Section);?>)</td> <td><?php echo htmlen tities($result->RegDate);?></td> <td><?php if($result ->Status==1){ echo htmlentities('Active'); } else{ echo htmlentities('Blocked'); } ?></td> <td>
  • 50. <a href="edit-student.php?stid=<?php echo htmlentities($result- >StudentId);?>"><i class="fa fa-edit" title="Edit Record"></i> </a> </td> </tr> <?php $cnt=$cnt+1;}} ?> </tbody> </table> <!-- /.col-md-12 --> </div> </div> </div> <!-- /.col-md-6 --> </div> <!-- /.col-md-12 --> </div> </div> <!-- /.panel --> </div> <!-- /.col-md-6 --> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </section> <!-- /.section --> </div> <!-- /.main-page --> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper -->
  • 51. </div> <?php } ?> XXX. manage-subjectcombination <?php include('includes/topbar.php');?> <!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== - -> <div class="content-wrapper"> <div class="content-container"> <?php include('includes/leftbar.php');?> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Manage Subjects Combination </h2> </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li> Subjects</li> <li class="active">Manage Subjects Combin ation</li> </ul> </div> </div> <!-- /.row --> </div> <!-- /.container-fluid --> <section class="section">
  • 52. <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>View Subjects Combination Info</h5> </div> </div> <?php if($msg){?> <div class="alert alert-success left-icon-alert" role="alert"> <strong>Well done!</strong><?php echo htmlentities($msg); ?> </div><?php } else if($error){?> <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <div class="panel-body p-20"> <table id="example" class="displa y table table-striped table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>#</th> <th>Class and Section </th> <th>Subject </th> <th>Status</th> <th>Action</th> </tr> </thead> <tfoot> <tr> <th>#</th> <th>Class and Section </th> <th>Subject </th> <th>Status</th>
  • 53. <th>Action</th> </tr> </tfoot> <tbody> <tr> <td><?php echo htmlentities($cnt);?></td> <td><?php echo htmlen tities($result->ClassName);?> &nbsp; Section-<?php echo htmlentities($result- >Section);?></td> <td><?php echo htmlen tities($result->SubjectName);?></td> <td><?php $stts=$res ult->status; if($stts=='0') { echo htmlentities('Inactive'); } else { echo htmlentities('Active'); } ?></td> <td> <?php if($stts=='0') { ?> <a href="manage-subjectcombination.php?acid=<?php echo htmlentities($result- >scid);?>" onclick="confirm('do you really want to ativate this subject');"><i cl ass="fa fa-check" title="Acticvate Record"></i> </a><?php } else {?> <a href="manage-subjectcombination.php?did=<?php echo htmlentities($result- >scid);?>" onclick="confirm('do you really want to deativate this subject');"><i class="fa fa-times" title="Deactivate Record"></i> </a> <?php }?> </td> </tr> <?php $cnt=$cnt+1;}} ?> </tbody> </table> <!-- /.col-md-12 --> </div>
  • 54. </div> </div> <!-- /.col-md-6 --> </div> <!-- /.col-md-12 --> </div> </div> <!-- /.panel --> </div> <!-- /.col-md-6 --> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </section> <!-- /.section --> </div> <!-- /.main-page --> </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <?php } ?> XXXI. manage-subjects <?php include('includes/topbar.php');?> <!-- ========== WRAPPER FOR BOTH SIDEBARS & MAIN CONTENT ========== - -> <div class="content-wrapper">
  • 55. <div class="content-container"> <?php include('includes/leftbar.php');?> <div class="main-page"> <div class="container-fluid"> <div class="row page-title-div"> <div class="col-md-6"> <h2 class="title">Manage Subjects</h2> </div> <!-- /.col-md-6 text-right --> </div> <!-- /.row --> <div class="row breadcrumb-div"> <div class="col-md-6"> <ul class="breadcrumb"> <li><a href="dashboard.php"><i class="fa fa-home"></i> Home</a></li> <li> Subjects</li> <li class="active">Manage Subjects</li> </ul> </div> </div> <!-- /.row --> </div> <!-- /.container-fluid --> <section class="section"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="panel"> <div class="panel-heading"> <div class="panel-title"> <h5>View Subjects Info</h5> </div> </div> <?php if($msg){?> <div class="alert alert-success left-icon-alert" role="alert">
  • 56. <strong>Well done!</strong><?php echo htmlentities($msg); ?> </div><?php } else if($error){?> <div class="alert alert-danger left-icon-alert" role="alert"> <strong>Oh snap!</strong> <?php echo htmlentities($error); ?> </div> <?php } ?> <div class="panel-body p-20"> <table id="example" class="displa y table table-striped table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>#</th> <th>Subject Name</th> <th>Subject Code</th> <th>Creation Date</th > <th>Updation Date</th > <th>Action</th> </tr> </thead> <tfoot> <tr> <th>#</th> <th>Subject Name</th > <th>Subject Code</th> <th>Creation Date</th > <th>Updation Date</th > <th>Action</th> </tr> </tfoot> <tbody> <tr> <td><?php echo htmlentities($cnt);?></td> <td><?php echo htmlen tities($result->SubjectName);?></td> <td><?php echo htmlen tities($result->SubjectCode);?></td>
  • 57. <td><?php echo htmlen tities($result->Creationdate);?></td> <td><?php echo htmlen tities($result->UpdationDate);?></td> <td> <a href="edit-subject.php?subjectid=<?php echo htmlentities($result- >id);?>"><i class="fa fa-edit" title="Edit Record"></i> </a> </td> </tr> <?php $cnt=$cnt+1;}} ?> </tbody> </table> <!-- /.col-md-12 --> </div> </div> </div> <!-- /.col-md-6 --> </div> <!-- /.col-md-12 --> </div> </div> <!-- /.panel --> </div> <!-- /.col-md-6 --> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </section> <!-- /.section --> </div> <!-- /.main-page -->
  • 58. </div> <!-- /.content-container --> </div> <!-- /.content-wrapper --> </div> <?php } ?> XXXII. result XXXIII. logout
  • 59. 3. Database Access pages (past the Database access pages here) <?php // DB credentials. define('DB_HOST','localhost'); define('DB_USER','root'); define('DB_PASS',''); define('DB_NAME','nafizsql'); // Establish database connection. try { $dbh = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME,DB_USER, DB_PASS,array(PD O::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'")); } catch (PDOException $e) { exit("Error: " . $e->getMessage()); } ?> XXXIV. Login.php (just past database code here) <?php session_start(); error_reporting(0); include('includes/config.php'); if($_SESSION['alogin']!=''){ $_SESSION['alogin']=''; } if(isset($_POST['login'])) { $uname=$_POST['username']; $password=md5($_POST['password']); $sql ="SELECT UserName,Password FROM admin WHERE UserName=:uname and Password=:pa ssword"; $query= $dbh -> prepare($sql); $query-> bindParam(':uname', $uname, PDO::PARAM_STR); $query-> bindParam(':password', $password, PDO::PARAM_STR); $query-> execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); if($query->rowCount() > 0) { $_SESSION['alogin']=$_POST['username'];
  • 60. echo "<script type='text/javascript'> document.location = 'dashboard.php'; </scri pt>"; } else{ echo "<script>alert('Invalid Details');</script>"; } } ?> XXXV. Registraction.php <?php session_start(); error_reporting(0); include('includes/config.php'); $username = ""; $email = ""; $errors = array(); // connect to the database $db = mysqli_connect('localhost', 'root', '', 'registration'); // REGISTER USER if (isset($_POST['reg_user'])) { // receive all input values from the form $username = mysqli_real_escape_string($db, $_POST['username']); $email = mysqli_real_escape_string($db, $_POST['email']); $password_1 = mysqli_real_escape_string($db, $_POST['password_1']); $password_2 = mysqli_real_escape_string($db, $_POST['password_2']); // form validation: ensure that the form is correctly filled ... // by adding (array_push()) corresponding error unto $errors array if (empty($username)) { array_push($errors, "Username is required"); } if (empty($email)) { array_push($errors, "Email is required"); } if (empty($password_1)) { array_push($errors, "Password is required"); } if ($password_1 != $password_2) { array_push($errors, "The two passwords do not match"); } // first check the database to make sure
  • 61. // a user does not already exist with the same username and/or email $user_check_query = "SELECT * FROM users WHERE username='$username' OR email='$ email' LIMIT 1"; $result = mysqli_query($db, $user_check_query); $user = mysqli_fetch_assoc($result); if ($user) { // if user exists if ($user['username'] === $username) { array_push($errors, "Username already exists"); } if ($user['email'] === $email) { array_push($errors, "email already exists"); } } // Finally, register user if there are no errors in the form if (count($errors) == 0) { $password = md5($password_1);//encrypt the password before saving in the data base $query = "INSERT INTO users (username, email, password) VALUES('$username', '$email', '$password')"; mysqli_query($db, $query); $_SESSION['username'] = $username; $_SESSION['success'] = "You are now logged in"; header('location: index.php'); } } XXXVI. Home.php <?php $sql1 ="SELECT StudentId from tblstudents "; $query1 = $dbh -> prepare($sql1); $query1->execute(); $results1=$query1->fetchAll(PDO::FETCH_OBJ); $totalstudents=$query1->rowCount(); ?> <span class="number counter"><?php ec ho htmlentities($totalstudents);?></span>
  • 62. <span class="name">See to manage Stud ent profile</span> <span class="bg- icon"><i class="fa fa-users"></i></span> </a> <!-- /.dashboard-stat --> </div> <!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 - -> <div class="col-lg-3 col-md-3 col-sm-6 col- xs-12"> <a class="dashboard-stat bg- danger" href="manage-subjects.php"> <?php $sql ="SELECT id from tblsubjects "; $query = $dbh -> prepare($sql); $query->execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); $totalsubjects=$query->rowCount(); ?> <?php $sql2 ="SELECT id from tblclasses "; $query2 = $dbh -> prepare($sql2); $query2->execute(); $results2=$query2->fetchAll(PDO::FETCH_OBJ); $totalclasses=$query2->rowCount(); ?> <?php $sql3="SELECT distinct StudentId from tblresult "; $query3 = $dbh -> prepare($sql3); $query3->execute(); $results3=$query3->fetchAll(PDO::FETCH_OBJ); $totalresults=$query3->rowCount(); ?> XXXVII. Add-result <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php");
  • 63. } else{ if(isset($_POST['submit'])) { $marks=array(); $class=$_POST['class']; $studentid=$_POST['studentid']; $mark=$_POST['marks']; $stmt = $dbh- >prepare("SELECT tblsubjects.SubjectName,tblsubjects.id FROM tblsubjectcombinatio n join tblsubjects on tblsubjects.id=tblsubjectcombination.SubjectId WHERE tbls ubjectcombination.ClassId=:cid order by tblsubjects.SubjectName"); $stmt->execute(array(':cid' => $class)); $sid1=array(); while($row=$stmt->fetch(PDO::FETCH_ASSOC)) { array_push($sid1,$row['id']); } for($i=0;$i<count($mark);$i++){ $mar=$mark[$i]; $sid=$sid1[$i]; $sql="INSERT INTO tblresult(StudentId,ClassId,SubjectId,marks) VALUES(:studentid ,:class,:sid,:marks)"; $query = $dbh->prepare($sql); $query->bindParam(':studentid',$studentid,PDO::PARAM_STR); $query->bindParam(':class',$class,PDO::PARAM_STR); $query->bindParam(':sid',$sid,PDO::PARAM_STR); $query->bindParam(':marks',$mar,PDO::PARAM_STR); $query->execute(); $lastInsertId = $dbh->lastInsertId(); if($lastInsertId) { $msg="Result info added successfully"; } else { $error="Something went wrong. Please try again"; } } } ?> <?php
  • 64. session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ ?> XXXVIII. add-students <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ if(isset($_POST['submit'])) { $studentname=$_POST['fullanme']; $roolid=$_POST['rollid']; $studentemail=$_POST['emailid']; $gender=$_POST['gender']; $classid=$_POST['class']; $dob=$_POST['dob']; $status=1; $sql="INSERT INTO tblstudents(StudentName,RollId,StudentEmail,Gender,ClassId,DOB ,Status) VALUES(:studentname,:roolid,:studentemail,:gender,:classid,:dob,:status) "; $query = $dbh->prepare($sql); $query->bindParam(':studentname',$studentname,PDO::PARAM_STR); $query->bindParam(':roolid',$roolid,PDO::PARAM_STR); $query->bindParam(':studentemail',$studentemail,PDO::PARAM_STR); $query->bindParam(':gender',$gender,PDO::PARAM_STR); $query->bindParam(':classid',$classid,PDO::PARAM_STR); $query->bindParam(':dob',$dob,PDO::PARAM_STR); $query->bindParam(':status',$status,PDO::PARAM_STR); $query->execute(); $lastInsertId = $dbh->lastInsertId();
  • 65. if($lastInsertId) { $msg="Student info added successfully"; } else { $error="Something went wrong. Please try again"; } } ?> XXXIX. add-subjectcombination <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ if(isset($_POST['submit'])) { $class=$_POST['class']; $subject=$_POST['subject']; $status=1; $sql="INSERT INTO tblsubjectcombination(ClassId,SubjectId,status) VALUES(:class, :subject,:status)"; $query = $dbh->prepare($sql); $query->bindParam(':class',$class,PDO::PARAM_STR); $query->bindParam(':subject',$subject,PDO::PARAM_STR); $query->bindParam(':status',$status,PDO::PARAM_STR); $query->execute(); $lastInsertId = $dbh->lastInsertId(); if($lastInsertId) { $msg="Combination added successfully"; } else { $error="Something went wrong. Please try again";
  • 66. } } ?> XL. change-password <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ if(isset($_POST['submit'])) { $password=md5($_POST['password']); $newpassword=md5($_POST['newpassword']); $username=$_SESSION['alogin']; $sql ="SELECT Password FROM admin WHERE UserName=:username and Password=:pass word"; $query= $dbh -> prepare($sql); $query-> bindParam(':username', $username, PDO::PARAM_STR); $query-> bindParam(':password', $password, PDO::PARAM_STR); $query-> execute(); $results = $query -> fetchAll(PDO::FETCH_OBJ); if($query -> rowCount() > 0) { $con="update admin set Password=:newpassword where UserName=:username"; $chngpwd1 = $dbh->prepare($con); $chngpwd1-> bindParam(':username', $username, PDO::PARAM_STR); $chngpwd1-> bindParam(':newpassword', $newpassword, PDO::PARAM_STR); $chngpwd1->execute(); $msg="Your Password succesfully changed"; } else { $error="Your current password is wrong"; } } ?> XLI. create-class
  • 67. <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ if(isset($_POST['submit'])) { $classname=$_POST['classname']; $classnamenumeric=$_POST['classnamenumeric']; $section=$_POST['section']; $sql="INSERT INTO tblclasses(ClassName,ClassNameNumeric,Section) VALUES(:classna me,:classnamenumeric,:section)"; $query = $dbh->prepare($sql); $query->bindParam(':classname',$classname,PDO::PARAM_STR); $query->bindParam(':classnamenumeric',$classnamenumeric,PDO::PARAM_STR); $query->bindParam(':section',$section,PDO::PARAM_STR); $query->execute(); $lastInsertId = $dbh->lastInsertId(); if($lastInsertId) { $msg="Class Created successfully"; } else { $error="Something went wrong. Please try again"; } } ?> XLII. create-subject <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php");
  • 68. } else{ if(isset($_POST['submit'])) { $subjectname=$_POST['subjectname']; $subjectcode=$_POST['subjectcode']; $sql="INSERT INTO tblsubjects(SubjectName,SubjectCode) VALUES(:subjectname,:subj ectcode)"; $query = $dbh->prepare($sql); $query->bindParam(':subjectname',$subjectname,PDO::PARAM_STR); $query->bindParam(':subjectcode',$subjectcode,PDO::PARAM_STR); $query->execute(); $lastInsertId = $dbh->lastInsertId(); if($lastInsertId) { $msg="Subject Created successfully"; } else { $error="Something went wrong. Please try again"; } } ?> XLIII. edit-class <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ if(isset($_POST['update'])) { $classname=$_POST['classname']; $classnamenumeric=$_POST['classnamenumeric']; $section=$_POST['section']; $cid=intval($_GET['classid']); $sql="update tblclasses set ClassName=:classname,ClassNameNumeric=:classnamenume ric,Section=:section where id=:cid ";
  • 69. $query = $dbh->prepare($sql); $query->bindParam(':classname',$classname,PDO::PARAM_STR); $query->bindParam(':classnamenumeric',$classnamenumeric,PDO::PARAM_STR); $query->bindParam(':section',$section,PDO::PARAM_STR); $query->bindParam(':cid',$cid,PDO::PARAM_STR); $query->execute(); $msg="Data has been updated successfully"; } ?> XLIV. edit-result <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ $stid=intval($_GET['stid']); if(isset($_POST['submit'])) { $rowid=$_POST['id']; $marks=$_POST['marks']; foreach($_POST['id'] as $count => $id){ $mrks=$marks[$count]; $iid=$rowid[$count]; for($i=0;$i<=$count;$i++) { $sql="update tblresult set marks=:mrks where id=:iid "; $query = $dbh->prepare($sql); $query->bindParam(':mrks',$mrks,PDO::PARAM_STR); $query->bindParam(':iid',$iid,PDO::PARAM_STR); $query->execute(); $msg="Result info updated successfully"; } } }
  • 70. ?> XLV. edit-student <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ $stid=intval($_GET['stid']); if(isset($_POST['submit'])) { $studentname=$_POST['fullanme']; $roolid=$_POST['rollid']; $studentemail=$_POST['emailid']; $gender=$_POST['gender']; $classid=$_POST['class']; $dob=$_POST['dob']; $status=$_POST['status']; $sql="update tblstudents set StudentName=:studentname,RollId=:roolid,StudentEmail =:studentemail,Gender=:gender,DOB=:dob,Status=:status where StudentId=:stid "; $query = $dbh->prepare($sql); $query->bindParam(':studentname',$studentname,PDO::PARAM_STR); $query->bindParam(':roolid',$roolid,PDO::PARAM_STR); $query->bindParam(':studentemail',$studentemail,PDO::PARAM_STR); $query->bindParam(':gender',$gender,PDO::PARAM_STR); $query->bindParam(':dob',$dob,PDO::PARAM_STR); $query->bindParam(':status',$status,PDO::PARAM_STR); $query->bindParam(':stid',$stid,PDO::PARAM_STR); $query->execute(); $msg="Student info updated successfully"; } ?> XLVI. edit-subject
  • 71. <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ if(isset($_POST['Update'])) { $sid=intval($_GET['subjectid']); $subjectname=$_POST['subjectname']; $subjectcode=$_POST['subjectcode']; $sql="update tblsubjects set SubjectName=:subjectname,SubjectCode=:subjectcode w here id=:sid"; $query = $dbh->prepare($sql); $query->bindParam(':subjectname',$subjectname,PDO::PARAM_STR); $query->bindParam(':subjectcode',$subjectcode,PDO::PARAM_STR); $query->bindParam(':sid',$sid,PDO::PARAM_STR); $query->execute(); $msg="Subject Info updated successfully"; } ?> <?php $sid=intval($_GET['subjectid']); $sql = "SELECT * from tblsubjects where id=:sid"; $query = $dbh->prepare($sql); $query->bindParam(':sid',$sid,PDO::PARAM_STR); $query->execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); $cnt=1; if($query->rowCount() > 0) { foreach($results as $result) { ?> XLVII. find-result <?php session_start(); //error_reporting(0); include('includes/config.php');?> <?php $sql = "SELECT * from tblclasses";
  • 72. $query = $dbh->prepare($sql); $query->execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); if($query->rowCount() > 0) { foreach($results as $result) { ?> XLVIII. get_student <?php include('includes/config.php'); if(!empty($_POST["classid"])) { $cid=intval($_POST['classid']); if(!is_numeric($cid)){ echo htmlentities("invalid Class");exit; } else{ $stmt = $dbh- >prepare("SELECT StudentName,StudentId FROM tblstudents WHERE ClassId= :id order by StudentName"); $stmt->execute(array(':id' => $cid)); ?><option value="">Select Category </option><?php while($row=$stmt->fetch(PDO::FETCH_ASSOC)) { ?> <option value="<?php echo htmlentities($row['StudentId']); ?>"> <?php if(!empty($_POST["studclass"])) { $id= $_POST['studclass']; $dta=explode("$",$id); $id=$dta[0]; $id1=$dta[1]; $query = $dbh- >prepare("SELECT StudentId,ClassId FROM tblresult WHERE StudentId=:id1 and ClassI d=:id "); //$query= $dbh -> prepare($sql); $query-> bindParam(':id1', $id1, PDO::PARAM_STR); $query-> bindParam(':id', $id, PDO::PARAM_STR);
  • 73. $query-> execute(); $results = $query -> fetchAll(PDO::FETCH_OBJ); $cnt=1; if($query -> rowCount() > 0) { ?> <p> <?php echo "<span style='color:red'> Result Already Declare .</span>"; echo "<script>$('#submit').prop('disabled',true);</script>"; ?></p> <?php } }?> XLIX. manage-classes <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ ?> <?php if($msg){?> <div class="alert alert-success left-icon-alert" role="alert"> <strong>Well done!</strong><?php echo htmlentities($msg); ?> </div><?php } else if($error){?> <?php $sql = "SELECT * from tblclasses"; $query = $dbh->prepare($sql); $query->execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); $cnt=1; if($query->rowCount() > 0) { foreach($results as $result) { ?> <tr> <td><?php echo htmlentities($cnt);?></td>
  • 74. <td><?php echo htmlen tities($result->ClassName);?></td> <td><?php echo htmlen tities($result->ClassNameNumeric);?></td> <td><?php echo htmlen tities($result->Section);?></td> <td><?php echo htmlen tities($result->CreationDate);?></td> <td> <a href="edit-class.php?classid=<?php echo htmlentities($result- >id);?>"><i class="fa fa-edit" title="Edit Record"></i> </a> </td> </tr> <?php $cnt=$cnt+1;}} ?> L. manage-results <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ ?> <?php if($msg){?> <div class="alert alert-success left-icon-alert" role="alert"> <strong>Well done!</strong><?php echo htmlentities($msg); ?> </div><?php } else if($error){?> <?php $sql = "SELECT distinct tblstudents.StudentName,tblstudents.RollId,tblstud ents.RegDate,tblstudents.StudentId,tblstudents.Status,tblclasses.ClassName,tblcla sses.Section from tblresult join tblstudents on tblstudents.StudentId=tblresult.S tudentId join tblclasses on tblclasses.id=tblresult.ClassId"; $query = $dbh->prepare($sql); $query->execute(); $results=$query->fetchAll(PDO::FETCH_OBJ);
  • 75. $cnt=1; if($query->rowCount() > 0) { foreach($results as $result) { ?> LI. manage-students <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ ?> <?php if($msg){?> <div class="alert alert-success left-icon-alert" role="alert"> <strong>Well done!</strong><?php echo htmlentities($msg); ?> </div><?php } else if($error){?> <?php $sql = "SELECT tblstudents.StudentName,tblstudents.RollId,tblstudents.RegDa te,tblstudents.StudentId,tblstudents.Status,tblclasses.ClassName,tblclasses.Secti on from tblstudents join tblclasses on tblclasses.id=tblstudents.ClassId"; $query = $dbh->prepare($sql); $query->execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); $cnt=1; if($query->rowCount() > 0) { foreach($results as $result) { ?> LII. manage-subjectcombination <?php session_start(); error_reporting(0); include('includes/config.php');
  • 76. if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ // for activate Subject if(isset($_GET['acid'])) { $acid=intval($_GET['acid']); $status=1; $sql="update tblsubjectcombination set status=:status where id=:acid "; $query = $dbh->prepare($sql); $query->bindParam(':acid',$acid,PDO::PARAM_STR); $query->bindParam(':status',$status,PDO::PARAM_STR); $query->execute(); $msg="Subject Activate successfully"; } // for Deactivate Subject if(isset($_GET['did'])) { $did=intval($_GET['did']); $status=0; $sql="update tblsubjectcombination set status=:status where id=:did "; $query = $dbh->prepare($sql); $query->bindParam(':did',$did,PDO::PARAM_STR); $query->bindParam(':status',$status,PDO::PARAM_STR); $query->execute(); $msg="Subject Deactivate successfully"; } ?> <?php if($msg){?> <div class="alert alert-success left-icon-alert" role="alert"> <strong>Well done!</strong><?php echo htmlentities($msg); ?> </div><?php } else if($error){?> <?php $sql = "SELECT tblclasses.ClassName,tblclasses.Section,tblsubjects.SubjectN ame,tblsubjectcombination.id as scid,tblsubjectcombination.status from tblsubject combination join tblclasses on tblclasses.id=tblsubjectcombination.ClassId join tblsubjects on tblsubjects.id=tblsubjectcombination.SubjectId"; $query = $dbh->prepare($sql); $query->execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); $cnt=1; if($query->rowCount() > 0)
  • 77. { foreach($results as $result) { ?> LIII. manage-subjects <?php session_start(); error_reporting(0); include('includes/config.php'); if(strlen($_SESSION['alogin'])=="") { header("Location: index.php"); } else{ ?> <?php if($msg){?> <div class="alert alert-success left-icon-alert" role="alert"> <strong>Well done!</strong><?php echo htmlentities($msg); ?> </div><?php } else if($error){?> <?php $sql = "SELECT * from tblsubjects"; $query = $dbh->prepare($sql); $query->execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); $cnt=1; if($query->rowCount() > 0) { foreach($results as $result) { ?> LIV. result <?php session_start(); error_reporting(0); include('includes/config.php'); ?>
  • 78. <?php // code Student Data $rollid=$_POST['rollid']; $classid=$_POST['class']; $_SESSION['rollid']=$rollid; $_SESSION['classid']=$classid; $qery = "SELECT tblstudents.StudentName,tblstudents.RollId,tblstudents.RegDate, tblstudents.StudentId,tblstudents.Status,tblclasses.ClassName,tblclasses.Section from tblstudents join tblclasses on tblclasses.id=tblstudents.ClassId where tblst udents.RollId=:rollid and tblstudents.ClassId=:classid "; $stmt = $dbh->prepare($qery); $stmt->bindParam(':rollid',$rollid,PDO::PARAM_STR); $stmt->bindParam(':classid',$classid,PDO::PARAM_STR); $stmt->execute(); $resultss=$stmt->fetchAll(PDO::FETCH_OBJ); $cnt=1; if($stmt->rowCount() > 0) { foreach($resultss as $row) { ?> <p><b>Student Name :</b> <?php echo htmlentities($row->StudentName);?></p> <p><b>Student Roll Id :</b> <?php echo htmlentities($row->RollId);?> <p><b>Student Class:</b> <?php echo htmlentities($row- >ClassName);?>(<?php echo htmlentities($row->Section);?>) <?php } ?> <?php // Code for result $query ="select t.StudentName,t.RollId,t.ClassId,t.marks,SubjectId,tblsubjects.S ubjectName from (select sts.StudentName,sts.RollId,sts.ClassId,tr.marks,SubjectId from tblstudents as sts join tblresult as tr on tr.StudentId=sts.StudentId) as t join tblsubjects on tblsubjects.id=t.SubjectId where (t.RollId=:rollid and t.Cl assId=:classid)"; $query= $dbh -> prepare($query); $query->bindParam(':rollid',$rollid,PDO::PARAM_STR); $query->bindParam(':classid',$classid,PDO::PARAM_STR); $query-> execute(); $results = $query -> fetchAll(PDO::FETCH_OBJ); $cnt=1; if($countrow=$query->rowCount()>0) { foreach($results as $result){ ?>
  • 79. <tr> <th scope="row" style="text-align: center"><?php echo htmlentities($cnt);?></th> <td style="text-align: center"><?php echo htmlentities($result- >SubjectName);?></td> <td style="text-align: center"><?php echo htmlentities($totalmarks=$result- >marks);?></td> </tr> <?php $totlcount+=$totalmarks; $cnt++;} ?> LV. logout <?php session_start(); $_SESSION = array(); if (ini_get("session.use_cookies")) { $params = session_get_cookie_params(); setcookie(session_name(), '', time() - 60*60, $params["path"], $params["domain"], $params["secure"], $params["httponly"] ); } unset($_SESSION['login']); session_destroy(); // destroy session header("location:index.php"); ?>
  • 80. 4. Database (screen shot of all the tables)