Documente Academic
Documente Profesional
Documente Cultură
<div class="row-fluid">
<?php
$query_reg_teacher = mysql_query("select *
from teacher where teacher_status = 'Registered' ")or die(mysql_error());
$count_reg_teacher =
mysql_num_rows($query_reg_teacher);
?>
<div class="span3">
<div class="chart" data-
percent="<?php echo $count_reg_teacher; ?>"><?php echo $count_reg_teacher; ?></div>
<div class="chart-bottom-
heading"><strong>Registered Teacher</strong>
</div>
</div>
<?php
$query_teacher = mysql_query("select *
from teacher")or die(mysql_error());
$count_teacher =
mysql_num_rows($query_teacher);
?>
<div class="span3">
<div class="chart" data-
percent="<?php echo $count_teacher; ?>"><?php echo $count_teacher ?></div>
<div class="chart-bottom-
heading"><strong>Teachers</strong>
</div>
</div>
<?php
$query_student = mysql_query("select *
from student where status='Registered'")or die(mysql_error());
$count_student =
mysql_num_rows($query_student);
?>
<div class="span3">
<div class="chart" data-
percent="<?php echo $count_student ?>"><?php echo $count_student ?></div>
<div class="chart-bottom-
heading"><strong>Registered Students</strong>
</div>
</div>
<?php
$query_student = mysql_query("select *
from student")or die(mysql_error());
$count_student =
mysql_num_rows($query_student);
?>
<div class="span3">
<div class="chart" data-
percent="<?php echo $count_student ?>"><?php echo $count_student ?></div>
<div class="chart-bottom-
heading"><strong>Students</strong>
</div>
</div>
<?php
$query_class = mysql_query("select * from
class")or die(mysql_error());
$count_class =
mysql_num_rows($query_class);
?>
<div class="span3">
<div class="chart" data-
percent="<?php echo $count_class; ?>"><?php echo $count_class; ?></div>
<div class="chart-bottom-
heading"><strong>Class</strong>
</div>
</div>
<?php
$query_file = mysql_query("select * from
files")or die(mysql_error());
$count_file =
mysql_num_rows($query_file);
?>
<div class="span3">
<div class="chart" data-
percent="<?php echo $count_file; ?>"><?php echo $count_file; ?></div>
<div class="chart-bottom-
heading"><strong>Downloadable File</strong>
</div>
</div>
<?php
$query_program = mysql_query("select *
from program")or die(mysql_error());
$count_program =
mysql_num_rows($query_program);
?>
<div class="span3">
<div class="chart" data-
percent="<?php echo $count_program; ?>"><?php echo $count_program; ?></div>
<div class="chart-bottom-
heading"><strong>Programs</strong>
</div>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
</div>
</html>
Header.php
<!DOCTYPE html>
<html class="no-js">
<head>
<title>Administrator | S.O.A.P</title>
<!-- Bootstrap -->
<link href="../images/icon.png" rel="icon" type="image">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"
media="screen">
<link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet"
media="screen">
<link href="bootstrap/css/font-awesome.css" rel="stylesheet"
media="screen">
<link href="bootstrap/css/my_style.css" rel="stylesheet" media="screen">
<link href="vendors/easypiechart/jquery.easy-pie-chart.css"
rel="stylesheet" media="screen">
<link href="assets/styles.css" rel="stylesheet" media="screen">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- calendar css -->
<link href="vendors/fullcalendar/fullcalendar.css" rel="stylesheet"
media="screen">
<script src="vendors/jquery-1.9.1.min.js"></script>
<script src="vendors/modernizr-2.6.2-respond-1.1.0.min.js"></script>
<!-- data table -->
<link href="assets/DT_bootstrap.css" rel="stylesheet" media="screen">
<!-- notification -->
<link href="vendors/jGrowl/jquery.jgrowl.css" rel="stylesheet" media="screen">
<!-- wysiwug -->
<link rel="stylesheet" type="text/css" href="vendors/bootstrap-
wysihtml5/src/bootstrap-wysihtml5.css">
<script src="vendors/jGrowl/jquery.jgrowl.js"></script>
</head>
<?php
include_once('mysql2i.class.php');
include('dbcon.php'); ?>
<div class="row-fluid">
<!-- block -->
<!-- code for adding new enrolled student -->
<div class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Add Student</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form id="add_student"
method="post">
<div class="control-group">
<div class="controls">
<select name="class_id" class="class_id" required>
<option></option>
<?php
$class_query
= mysql_query("select * from class order by class_name");
while($class_row = mysql_fetch_array($class_query)){
?>
<option
value="<?php echo $class_row['class_id']; ?>"><?php echo $class_row['class_name'];
?></option>
<?php } ?>
</select>
</div>
</div>
<div class="control-
group">
<div class="controls">
<input name="un" class="input focused" id="focusedInput"
type="text" placeholder = "ID Number" required>
</div>
</div>
<div class="control-
group">
<div class="controls">
<input name="fn" class="input focused" id="focusedInput"
type="text" placeholder = "Firstname" required>
</div>
</div>
<div class="control-
group">
<div class="controls">
<input name="ln" class="input focused" id="focusedInput"
type="text" placeholder = "Lastname" required>
</div>
</div>
<div
class="control-group">
<div class="controls">
<script>
jQuery(document).ready(function($){
$("#add_student").submit(function(e){
e.preventDefault();
var _this = $(e.target);
var formData = $(this).serialize();
$.ajax({
type: "POST",
url: "save_student.php",
data: formData,
success: function(html){
$.jGrowl("Student Successfully Added", {
header: 'Student Added' });
$('#studentTableDiv').load('student_table.php', function(response){
$("#studentTableDiv").html(response);
$('#example').dataTable( {
"sDom":
"<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
"sPaginationType":
"bootstrap",
"oLanguage": {
"sLengthMenu":
"_MENU_ records per page"
}
} );
$(_this).find(":input").val('');
$(_this).find('select
option').attr('selected',false);
$(_this).find('select
option:first').attr('selected',true);
});
}
});
});
});
</script>
<div class="row-fluid">
<!-- block -->
<!-- code for adding a new teacher employee -->
<div class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Add Teacher</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form id="add_teacher"
method="post">
<div class="control-group">
<div class="controls">
<select name="department" class="department_id" required>
<option></option>
<?php
while($department_row = mysql_fetch_array($department_query)){
?>
<option
value="<?php echo $department_row['department_id']; ?>"><?php echo
$department_row['department_name']; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="control-group">
<div class="controls">
<input class="input focused" name="firstname" id="focusedInput"
type="text" placeholder = "Firstname" required>
</div>
</div>
<div class="control-group">
<div class="controls">
<input class="input focused" name="lastname" id="focusedInput"
type="text" placeholder = "Lastname" required>
</div>
</div>
<div
class="control-group">
<div class="controls">
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
<script>
jQuery(document).ready(function($){
$("#add_teacher").submit(function(e){
e.preventDefault();
var _this = $(e.target);
var formData = $(this).serialize();
$.ajax({
type: "POST",
url: "save_teacher.php",
data: formData,
success: function(html){
$.jGrowl("Teacher Successfully Added", {
header: 'Teacher Added' });
$('#teacherTableDiv').load('teacher_table.php', function(response){
$("#teacherTableDiv").html(response);
$('#example').dataTable( {
"sDom":
"<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
"sPaginationType":
"bootstrap",
"oLanguage": {
"sLengthMenu":
"_MENU_ records per page"
}
} );
$(_this).find(":input").val('');
$(_this).find('select
option').attr('selected',false);
$(_this).find('select
option:first').attr('selected',true);
});
}
});
});
});
</script>
<div class="row-fluid">
<!-- block -->
<!-- code for adding new user of administrator -->
<div class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Add Administrator Account</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form method="post">
<div class="control-
group">
<div class="controls">
<input class="input focused" name="firstname" id="focusedInput"
type="text" placeholder = "Firstname" required>
</div>
</div>
<div class="control-
group">
<div class="controls">
<input class="input focused" name="lastname" id="focusedInput"
type="text" placeholder = "Lastname" required>
</div>
</div>
<div
class="control-group">
<div class="controls">
<input class="input focused" name="username" id="focusedInput"
type="text" placeholder = "Username" required>
</div>
</div>
<div class="control-
group">
<div class="controls">
<input class="input focused" name="password" id="focusedInput"
type="password" placeholder = "Password" required>
</div>
</div>
<div
class="control-group">
<div class="controls">
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
<?php
if (isset($_POST['save'])){
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$username = $_POST['username'];
$password = sha1(md5($_POST['password']));
Activity_log.php -this code is for monitor the time of login and logout of users.
<thead>
<tr>
<!-- code for getting the update of activity log -->
<th>Date</th>
<th>User</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$query = mysql_query("select * from activity_log")or die(mysql_error());
while($row = mysql_fetch_array($query)){
?>
<tr>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Add_class.php - This code is for adding a new type of class that teachers need.
<div class="row-fluid">
<!-- block -->
<!-- code for adding a new type of class that teacher will be use -->
<div class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Add Class</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form method="post">
<div class="control-
group">
<div class="controls">
<input name="class_name" class="input focused" id="focusedInput"
type="text" placeholder = "Course - Year And Section" required>
</div>
</div>
<div
class="control-group">
<div class="controls">
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /block -->
</div><?php
if (isset($_POST['save'])){
$class_name = $_POST['class_name'];
Add_class_event.php
<form id="add_event" class="form-add" method="post">
<h4 class="form-signin-heading"><i class="icon-plus-sign"></i> Add Event</h4>
<input type="text" class="input-block-level datepicker" name="date_start"
id="date01" placeholder="Date Start" required/>
<input type="text" class="input-block-level datepicker" name="date_end" id="date01"
placeholder="Date End" required/>
<input type="text" class="input-block-level" id="event_title" name="title"
placeholder="Title" required/>
<button id="add_event" name="add" class="btn btn-success" type="submit"><i
class="icon-save"></i> Save</button>
</form>
<!-- creating of new event class and save or adding into the database -->
<?php
if (isset($_POST['add'])){
$date_start = $_POST['date_start'];
$date_end = $_POST['date_end'];
$title = $_POST['title'];
<thead>
<tr>
<th>Event</th>
<th>Date</th>
<th></th>
</tr>
</thead>
<tbody>
<?php $event_query =
mysql_query("select * from event where teacher_class_id = '' ")or die(mysql_error());
while($event_row =
mysql_fetch_array($event_query)){
$id =
$event_row['event_id'];
?>
<tr id="del<?php
echo $id; ?>">
<td><?php echo
$event_row['event_title']; ?> </td>
<td><?php echo $event_row['date_start']; ?>
<br>To
<?php echo
$event_row['date_end']; ?>
</td>
<td width="40">
</td>
</tr>
<?php } ?>
</tbody>
</table>
<div class="control-
group">
<div class="controls">
<input class="input focused" id="focusedInput" name="pi"
type="text" placeholder = "Person Incharge">
</div>
</div>
<div
class="control-group">
<div class="controls">
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
<?php
if (isset($_POST['save'])){
$pi = $_POST['pi'];
$d = $_POST['d'];
$query = mysql_query("select * from department where department_name = '$d' and dean = '$pi'
")or die(mysql_error());
$count = mysql_num_rows($query);
<option>1st</option>
<option>2nd</option>
</select>
</div>
</div>
<div class="control-
group">
<label
class="control-label" for="programDescription">Description</label>
<div
class="controls">
<div class="control-
group">
<div
class="controls">
<button name="save"
type="submit" class="btn btn-success"><i class="icon-save"></i> Save</button>
</div>
</div>
</form>
<?php
if
(isset($_POST['save'])){
$program_code =
$_POST['program_code'];
$program_title =
$_POST['program_title'];
$unit =
$_POST['unit'];
$description =
$_POST['description'];
$semester =
$_POST['semester'];
$query =
mysql_query("select * from program where program_code = '$program_code' ")or
die(mysql_error());
$count =
mysql_num_rows($query);
mysql_query("insert
into activity_log (date,username,action) values(NOW(),'$user_username','Add Program
$program_code')")or die(mysql_error());
?>
<script>
window.location =
"program.php";
</script>
<?php
}
}
?>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<div class="row-fluid">
<!-- block -->
<div class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Add School Year</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form method="post">
<div class="control-
group">
<div class="controls">
<input class="input focused" name="school_year" id="focusedInput"
type="text" placeholder = "School Year" required>
</div>
</div>
<div
class="control-group">
<div class="controls">
</div>
</div>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
<?php
if (isset($_POST['save'])){
$school_year = $_POST['school_year'];
Admin_calendar_script.php - function for admin calendar to restore and see automatically the
events, announcement, and also the schedules.
<script>
$(function() {
// Easy pie charts
var calendar = $('#calendar').fullCalendar({
header: {
left: 'prev,next',
center: 'title',
right: 'month,basicWeek,basicDay'
},
droppable: true, // this allows things to be dropped onto the calendar !!!
drop: function(date, allDay) { // this function is called when something is dropped
// we need to copy it, so that multiple events don't have a reference to the same object
var copiedEventObject = $.extend({}, originalEventObject);
},
editable: true,
// US Holidays
events:
[
<?php $event_query = mysql_query("select * from event where teacher_class_id
= '' ")or die(mysql_error());
while($event_row = mysql_fetch_array($event_query)){
?>
{
title : '<?php echo $event_row['event_title']; ?> ',
start : '<?php echo $event_row['date_start']; ?>',
end : '<?php echo $event_row['date_end']; ?>'
},
<?php } ?>
]
});
});
</script>
<thead>
<tr>
<th>File Name</th>
<th>Description</th>
<th>Date Upload</th>
<th>Upload By</th>
<th>Class</th>
</tr>
</thead>
<tbody>
<?php
$query =
mysql_query("select * FROM assignment LEFT JOIN teacher ON teacher.teacher_id =
assignment.teacher_id
<tr>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<thead>
<tr>
<th>File Name</th>
<th>Description</th>
<th>Date Upload</th>
<th>Upload By</th>
<th>Class</th>
</tr>
</thead>
<tbody>
<?php
$query =
mysql_query("select * FROM assignment LEFT JOIN teacher ON teacher.teacher_id =
assignment.teacher_id
<tr>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<thead>
<tr>
<th>File Name</th>
<th>Description</th>
<th>Date Upload</th>
<th>Upload By</th>
<th>Class</th>
</tr>
</thead>
<tbody>
<?php
$query =
mysql_query("select * FROM assignment LEFT JOIN teacher ON teacher.teacher_id =
assignment.teacher_id
<tr>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$class_query =
mysql_query("select * from class")or die(mysql_error());
while($class_row =
mysql_fetch_array($class_query)){
$id =
$class_row['class_id'];
?>
<tr>
<td
width="30">
<input
id="optionsCheckbox" class="uniform_on" name="selector[]" type="checkbox" value="<?php
echo $id; ?>">
</td>
<td><?php
echo $class_row['class_name']; ?></td>
<td
width="40"><a href="edit_class.php<?php echo '?id='.$id; ?>" class="btn btn-primary"><i
class="icon-pencil icon-large"></i> </a></td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Delete_student.php
<?php
include('dbcon.php');
include('session.php');
if (isset($_POST['delete_student'])){
// for deleting a student into the data base
$id=$_POST['selector'];
$N = count($id);
for($i=0; $i < $N; $i++)
{
mysql_query("DELETE FROM student where student_id='$id[$i]'");
mysql_query("DELETE FROM teacher_class_student where student_id='$id[$i]'");
mysql_query("insert into activity_log (date,username,action)
values(NOW(),'$user_username','Deleted Student ID $id[$i]')")or die(mysql_error());
}
header("location: students.php");
}
?>
Delete_user.php
<?php
include('dbcon.php');
include('session.php');
if (isset($_POST['delete_user'])){
$id=$_POST['selector'];
$N = count($id);
// selection for deleting a specific user into the data base
for($i=0; $i < $N; $i++)
{
$result = mysql_query("DELETE FROM users where user_id='$id[$i]'");
mysql_query("insert into activity_log (date,username,action)
values(NOW(),'$user_username','Deleted Administrator Account ID $id[$i]')")or
die(mysql_error());
}
header("location: admin_user.php");
}
?>
Delete_teacher.php
<?php
include('dbcon.php');
include('session.php');
if (isset($_POST['delete_teacher'])){
$id=$_POST['selector'];
$N = count($id);
for($i=0; $i < $N; $i++)
{
$result = mysql_query("DELETE FROM teacher where teacher_id='$id[$i]'");
mysql_query("insert into activity_log (date,username,action)
values(NOW(),'$user_username','Deleted Teacher ID $id[$i]')")or die(mysql_error());
}
header("location: teachers.php");
}
?>
Delete_sy.php - deleting of school year.
<?php
include('dbcon.php');
if (isset($_POST['delete_user'])){
$id=$_POST['selector'];
$N = count($id);
// selection for deleting a specific school year into the data base
for($i=0; $i < $N; $i++)
{
$result = mysql_query("DELETE FROM school_year where school_year_id='$id[$i]'");
}
header("location: school_year.php");
}
?>
Delete_program.php
<?php
include('dbcon.php');
include('session.php');
if (isset($_POST['delete_program'])){
$id=$_POST['selector'];
// selection for deleting a specific program into the data base
$N = count($id);
for($i=0; $i < $N; $i++)
{
$result = mysql_query("DELETE FROM program where program_id='$id[$i]'");
mysql_query("insert into activity_log (date,username,action)
values(NOW(),'$user_username','Deleted Program ID $id[$i]')")or die(mysql_error());
}
header("location: program.php");
}
?>
Delete_event.php
<?php
include('dbcon.php');
$get_id = $_GET['id'];
// for deleting an event into the data base
mysql_query("delete from event where event_id = '$get_id'")or die(mysql_error());
?>
<script>
window.location = 'calendar_of_events.php';
</script>
Delete_department.php
<?php
include('dbcon.php');
include('session.php');
if (isset($_POST['delete_department'])){
$id=$_POST['selector'];
$N = count($id);
for($i=0; $i < $N; $i++)
{
$result = mysql_query("DELETE FROM department where department_id='$id[$i]'");
mysql_query("insert into activity_log (date,username,action)
values(NOW(),'$user_username','Deleted Department ID $id[$i]')")or die(mysql_error());
}
header("location: department.php");
}
?>
Delete_class.php
<?php
include('dbcon.php');
include('session.php');
if (isset($_POST['delete_class'])){
// code for selection of specific class the need to delete
$id=$_POST['selector'];
$N = count($id);
for($i=0; $i < $N; $i++)
{
$result = mysql_query("DELETE FROM class where class_id='$id[$i]'");
mysql_query("insert into activity_log (date,username,action)
values(NOW(),'$user_username','Deleted Class ID $id[$i]')")or die(mysql_error());
}
header("location: class.php");
}
?>
CODE FOR EDITING
Edit_user.php
</div>
<div class="span6" id="">
<div class="row-fluid">
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Admin Users List</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form action="delete_users.php"
method="post">
<table cellpadding="0"
cellspacing="0" border="0" class="table" id="example">
<a data-toggle="modal"
href="#user_delete" id="delete" class="btn btn-danger" name=""><i class="icon-trash icon-
large"></i></a>
<?php
include('modal_delete.php'); ?>
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Username</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($user_query)){
$id = $row['user_id'];
?>
<tr>
<td
width="30">
<input
id="optionsCheckbox" class="uniform_on" name="selector[]" type="checkbox" value="<?php
echo $id; ?>">
</td>
<td
width="40">
<a
href="edit_user.php<?php echo '?id='.$id; ?>" data-toggle="modal" class="btn btn-success"><i
class="icon-pencil icon-large"></i></a>
</td>
</tr>
<?php
} ?>
</tbody>
</table>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
</html>
Edit_teacher.php
</div>
<div class="span6" id="">
<div class="row-fluid">
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Teacher List</div>
</div>
<div class="block-content collapse in">
<div class="span12"
id="teacherTableDiv">
<?php
include('teacher_table.php'); ?>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Edit_student.php
</div>
<div class="span6" id="">
<div class="row-fluid">
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Student List</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form
action="delete_student.php" method="post">
<table cellpadding="0"
cellspacing="0" border="0" class="table" id="example">
<a data-toggle="modal"
href="#student_delete" id="delete" class="btn btn-danger" name=""><i class="icon-trash icon-
large"></i></a>
<?php
include('modal_delete.php'); ?>
<thead>
<tr>
<th></th>
<th>Name</th>
<th>ID Number</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$query = mysql_query("select * from student LEFT JOIN class ON
class.class_id = student.class_id ORDER BY student.student_id DESC") or die(mysql_error());
while ($row = mysql_fetch_array($query)) {
$id = $row['student_id'];
?>
<tr>
<td width="30">
<input
id="optionsCheckbox" class="uniform_on" name="selector[]" type="checkbox" value="<?php
echo $id; ?>">
</td>
<td
width="100"><?php echo $row['class_name']; ?></td>
<td width="30"><a
href="edit_student.php<?php echo '?id='.$id; ?>" class="btn btn-success"><i class="icon-
pencil"></i> </a></td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Edit_school_year.php
</div>
<div class="span6" id="">
<div class="row-fluid">
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">School Year List</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form action="delete_sy.php"
method="post">
<table cellpadding="0"
cellspacing="0" border="0" class="table" id="example">
<a data-toggle="modal"
href="#user_delete" id="delete" class="btn btn-danger" name=""><i class="icon-trash icon-
large"></i></a>
<?php
include('modal_delete.php'); ?>
<thead>
<tr>
<th></th>
<th>School Year</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($user_query)){
$id = $row['school_year_id'];
?>
<tr>
<td
width="30">
<input
id="optionsCheckbox" class="uniform_on" name="selector[]" type="checkbox" value="<?php
echo $id; ?>">
</td>
<td
width="40">
<a
href="edit_school_year.php<?php echo '?id='.$id; ?>" data-toggle="modal" class="btn btn-
success"><i class="icon-pencil icon-large"></i></a>
</td>
</tr>
<?php
} ?>
</tbody>
</table>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
</html>
Edit_program.php
<?php
$query =
mysql_query("select * from program where program_id = '$get_id'")or die(mysql_error());
$row =
mysql_fetch_array($query);
?>
<form class="form-
horizontal" method="post">
<div class="control-
group">
<label
class="control-label" for="programCode">Program Code</label>
<div
class="controls">
<input
type="text" value="<?php echo $row['program_code']; ?>" name="program_code"
id="inputProgramCode" placeholder="Program Code" required>
</div>
</div>
<div class="control-
group">
<label
class="control-label" for="programTitle">Program Title</label>
<div
class="controls">
<input
type="text" value="<?php echo $row['program_title']; ?>" class="span8" name="program_title"
id="inputProgramTitle" placeholder="Program Title" required>
</div>
</div>
<div class="control-
group">
<label
class="control-label" for="NumberOfUnits">Number of Units</label>
<div
class="controls">
<input
type="text" value="<?php echo $row['unit']; ?>" class="span1" name="unit"
id="inputNumberOfUnits" required>
</div>
</div>
<div class="control-
group">
<label
class="control-label" for="programSemester">Semester</label>
<div
class="controls">
<select
name="semester" required>
<option></option>
</select>
</div>
</div>
<div class="control-
group">
<label
class="control-label" for="programDescription">Description</label>
<div
class="controls">
</textarea>
</div>
</div>
<div class="control-
group">
<div
class="controls">
<button
name="update" type="submit" class="btn btn-success"><i class="icon-save icon-large"></i>
Update</button>
</div>
</div>
</form>
<?php
if
(isset($_POST['update'])){
$program_code =
$_POST['program_code'];
$program_title =
$_POST['program_title'];
$unit =
$_POST['unit'];
$description =
$_POST['description'];
$semester =
$_POST['semester'];
mysql_query("update
program set program_code = '$program_code' ,
program_title = '$program_title',
unit = '$unit',
description = '$description',
semester = '$semester'
?>
<script>
window.location =
"program.php";
</script>
<?php
}
?>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Edit_department.php
</div>
<div class="span6" id="">
<div class="row-fluid">
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Department List</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form
action="delete_department.php" method="post">
<table cellpadding="0"
cellspacing="0" border="0" class="table" id="example">
<a data-toggle="modal"
href="#department_delete" id="delete" class="btn btn-danger" name=""><i class="icon-trash
icon-large"></i></a>
<?php
include('modal_delete.php'); ?>
<thead>
<tr>
<th></th>
<th>Department</th>
<th>Pesron In-charge</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($user_query)){
$id = $row['department_id'];
?>
<tr>
<td width="30">
</td>
</tr>
<?php
} ?>
</tbody>
</table>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Edit_class.php
</div>
<div class="span6" id="">
<div class="row-fluid">
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Class List</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form
action="delete_class.php" method="post">
<table cellpadding="0"
cellspacing="0" border="0" class="table" id="example">
<a data-
toggle="modal" href="#class_delete" id="delete" class="btn btn-danger" name=""><i
class="icon-trash icon-large"></i></a>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$class_query =
mysql_query("select * from class")or die(mysql_error());
while($class_row =
mysql_fetch_array($class_query)){
$id =
$class_row['class_id'];
?>
<tr>
<td
width="30">
<input
id="optionsCheckbox" class="uniform_on" name="selector[]" type="checkbox" value="<?php
echo $id; ?>">
</td>
<td><?php
echo $class_row['class_name']; ?></td>
<td
width="40"><a href="edit_class.php<?php echo '?id='.$id; ?>" class="btn btn-success"><i
class="icon-pencil icon-large"></i> </a></td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Login
<?php
include('dbcon.php');
session_start();
// validation of user id if the user is existing and having permission to access the
portal
$username = $_POST['username'];
$password = sha1(md5($_POST['password']));
$_SESSION['id']=$row['user_id'];
echo 'true';
?>
<?php
include('dbcon.php');
include('session.php');
// update the date and time of logout into activity log into user log
mysql_query("update user_log set logout_Date = NOW() where user_id = '$session_id' ")or
die(mysql_error());
session_destroy();
header('location:index.php');
?>
</form>
<script>
jQuery(document).ready(function(){
jQuery("#login_form").submit(function(e){
e.preventDefault();
var formData = jQuery(this).serialize();
$.ajax({
type: "POST",
url: "login.php",
data: formData,
success: function(html){
if(html=='true')
{
$.jGrowl("Welcome to Student Online Access
Portal", { header: 'Access Granted Administrator Account' });
var delay = 2000;
setTimeout(function(){ window.location =
'dashboard.php' }, delay);
}
else
{
$.jGrowl("Please Check your username and
Password", { header: 'Login Failed' });
}
}
});
return false;
});
});
</script>
About.php - code for display the information about mission and vision core values of school.
<?php
$corevalues_row = mysql_fetch_array($corevalues_query);
echo
$corevalues_row['content'];
?>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Add_announcement.php
</div>
</div>
<div class="block-content collapse in">
<div class="span8">
<form class=""
id="add_downloadble" method="post" >
<div class="control-group">
<div class="controls">
<textarea name="content"
id="ckeditor_full"></textarea>
</div>
</div>
<!-- using this script we can use jquery for our function to call the id of
add_downloadable and in the add_downloadable there is the url to save all announcement
"add_announcement_save.php" and if the data is confirm succefully the location will go in the
add_announcement.php -->
<script>
jQuery(document).ready(function($){
$("#add_downloadble").submit(function(e){
e.preventDefault();
var formData = $(this).serialize();
$.ajax({
type: "POST",
url: "add_announcement_save.php",
data: formData,
success: function(html){
$.jGrowl("Announcement Successfully
Added", { header: 'Announcement Added' });
window.location = 'add_announcement.php';
}
});
});
});
</script>
</div>
<div class="span4">
<div class="pull-left">
Check All <input type="checkbox"
name="selectAll" id="checkAll" />
<script>
$("#checkAll").click(function () {
$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>
</div>
<table
cellpadding="0" cellspacing="0" border="0" class="table" id="">
<thead>
<tr>
<th></th>
<th>Class Name</th>
<th>program Code</th>
</tr>
</thead>
<tbody>
while($row =
mysql_fetch_array($query)){
$id =
$row['teacher_class_id'];
?>
<tr id="del<?php
echo $id; ?>">
<td
width="30">
<input
id="" class="" name="selector[]" type="checkbox" value="<?php echo $id; ?>">
</td>
<td><?php
echo $row['class_name']; ?></td>
<td><?php
echo $row['program_code']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="span10">
<hr>
<center>
<div class="control-group">
<div
class="controls">
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
<?php/*
include('teacher_right_sidebar.php') */?>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<?php
include('admin/dbcon.php');
include('session.php');
$content = $_POST['content'];
$id=$_POST['selector'];
$N = count($id);
// use loop to find an specific id of teacher user to identify the owner of new
announcement
for($i=0; $i < $N; $i++)
{
mysql_query("insert into teacher_class_announcements
(teacher_class_id,teacher_id,content,date) values('$id[$i]','$session_id','$content',NOW())")or
die(mysql_error());
mysql_query("insert into notification
(teacher_class_id,notification,date_of_notification,link) value('$id[$i]','Add
Annoucements',NOW(),'announcements_student.php')")or die(mysql_error());
}
?>
Announcements_student.php - getting the teacher announcement from teacher class id that the
student able to see the announcement from teacher.
<?php $class_query =
mysql_query("select * from teacher_class
LEFT JOIN class ON
class.class_id = teacher_class.class_id
LEFT JOIN program
ON program.program_id = teacher_class.program_id
where
teacher_class_id = '$get_id'")or die(mysql_error());
$class_row =
mysql_fetch_array($class_query);
?>
<ul class="breadcrumb">
<li><a href="#"><?php echo
$class_row['class_name']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><?php echo
$class_row['program_code']; ?></a> <span class="divider">/</span></li>
<li><a
href="#"><b>Announcements</b></a></li>
</ul>
<!-- end breadcrumb -->
")or die(mysql_error());
$count =
mysql_num_rows($query_announcement);
if ($count > 0){
while($row =
mysql_fetch_array($query_announcement)){
$id =
$row['teacher_class_announcements_id'];
?>
<div
class="post" id="del<?php echo $id; ?>">
<?php echo
$row['content']; ?>
<hr>
<strong><i
class="icon-calendar"></i> <?php echo $row['date']; ?></strong>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
<script type="text/javascript">
$(document).ready( function() {
$('.remove').click( function() {
var id = $(this).attr("id");
$.ajax({
type: "POST",
url: "remove_announcements.php",
data: ({id: id}),
cache: false,
success: function(html){
$("#del"+id).fadeOut('slow', function(){ $(this).remove();});
$('#'+id).modal('hide');
$.jGrowl("Your Post is Successfully Deleted", { header: 'Data Delete' });
}
});
return false;
});
});
</script>
</div>
</div>
<?php $class_query =
mysql_query("select * from teacher_class
LEFT JOIN class ON
class.class_id = teacher_class.class_id
LEFT JOIN program
ON program.program_id = teacher_class.program_id
where
teacher_class_id = '$get_id'")or die(mysql_error());
$class_row =
mysql_fetch_array($class_query);
?>
<ul class="breadcrumb">
<li><a href="#"><?php echo
$class_row['class_name']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><?php echo
$class_row['program_code']; ?></a> <span class="divider">/</span></li>
<li><a
href="#"><b>Announcements</b></a></li>
</ul>
<!-- end breadcrumb -->
<?php
if (isset($_POST['post'])){
$content =
$_POST['content'];
mysql_query("insert into
teacher_class_announcements (teacher_class_id,teacher_id,content,date)
values('$get_id','$session_id','$content',NOW())")or die(mysql_error());
mysql_query("insert into
notification (teacher_class_id,notification,date_of_notification,link) value('$get_id','Add
Annoucements',NOW(),'announcements_student.php')")or die(mysql_error());
?>
<script>
window.location =
'announcements.php<?php echo '?id='.$get_id; ?>';
</script>
<?php
}
?>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<?php
$query_announcement =
mysql_query("select * from teacher_class_announcements
")or die(mysql_error());
while($row =
mysql_fetch_array($query_announcement)){
$id =
$row['teacher_class_announcements_id'];
?>
<div
class="post" id="del<?php echo $id; ?>">
<?php echo
$row['content']; ?>
<hr>
<strong><i
class="icon-calendar"></i> <?php echo $row['date']; ?></strong>
<div
class="pull-right">
<a class="btn
btn-link" href="#<?php echo $id; ?>" data-toggle="modal" ><i class="icon-remove"></i> </a>
</div>
<div
class="pull-right">
<form
method="post" action="edit_post.php<?php echo '?id='.$get_id; ?>">
<input
type="hidden" name="id" value="<?php echo $id; ?>">
</form>
</div>
</div>
<?php
include("remove_sent_message_modal.php"); ?>
<?php } ?>
</div>
</div>
</div>
<!-- /block -->
</div>
<script type="text/javascript">
$(document).ready( function() {
$('.remove').click( function() {
var id = $(this).attr("id");
$.ajax({
type: "POST",
url: "remove_announcements.php",
data: ({id: id}),
cache: false,
success: function(html){
$("#del"+id).fadeOut('slow', function(){ $(this).remove();});
$('#'+id).modal('hide');
$.jGrowl("Your Post is Successfully Deleted", { header: 'Data Delete' });
}
});
return false;
});
});
</script>
</div>
</div>
Add_student.php – code for teacher if the teacher want to add student in her class from
database .
<ul class="breadcrumb">
<li><a href="#"><?php echo
$class_row['class_name']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><?php echo
$class_row['program_code']; ?></a> <span class="divider">/</span></li>
<li><a href="#">My Students</a><span
class="divider">/</span></li>
<li><a href="#"><b>Add
Student</b></a></li>
</ul>
<button
name="submit" type="submit" class="btn btn-info"><i class="icon-save"></i> Add
Student</button>
<br>
<br>
<thead>
<tr>
<th>Photo</th>
<th>Name</th>
<th>Course Year and Section</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
// using leftjoin to connect the student class
id into teacher class id
// and using while loop the data that hold of query will be find as
specific getting the student id into array
$a = 0 ;
$query =
mysql_query("select * from student LEFT JOIN class on class.class_id = student.class_id
") or
die(mysql_error());
while ($row =
mysql_fetch_array($query)) {
$id = $row['student_id'];
$a++;
?>
<tr>
<input type="hidden"
name="test" value="<?php echo $a; ?>">
// the output will be
here..
<td width="70"><img class="img-rounded" src="<?php echo
$row['profile_pic']; ?>" height="50" width="40"></td>
<td><?php echo $row['firstname'] . " " . $row['lastname']; ?></td>
<td><?php echo
$row['class_name']; ?></td>
<td width="80">
<select
name="add_student<?php echo $a; ?>" class="span12">
<option></option>
<option>Add</option>
</select>
<input type="hidden"
name="student_id<?php echo $a; ?>" value="<?php echo $id; ?>">
<input type="hidden"
name="class_id<?php echo $a; ?>" value="<?php echo $get_id; ?>">
<input type="hidden"
name="teacher_id<?php echo $a; ?>" value="<?php echo $session_id; ?>">
</td>
<?php } ?>
</tr>
</tbody>
</table>
</form>
<?php
if (isset($_POST['submit'])){
$test = $_POST['test'];
for($b = 1; $b <= $test; $b++)
{
$test1 = "student_id".$b;
$test2 = "class_id".$b;
$test3 = "teacher_id".$b;
$test4 = "add_student".$b;
$id = $_POST[$test1];
$class_id = $_POST[$test2];
$teacher_id = $_POST[$test3];
$Add = $_POST[$test4];
</script>
<script>
window.location = "add_student.php<?php echo '?id='.$get_id; ?>";
</script>
<?php
}else if($Add == 'Add'){
?>
<script>
window.location = "my_students.php<?php echo '?id='.$get_id; ?>";
</script>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
$school_year_query_row = mysql_fetch_array($school_year_query);
$school_year =
$school_year_query_row['school_year'];
?>
<li><a
href="#"><b>My Class</b></a><span class="divider">/</span></li>
<li><a
href="#">School Year: <?php echo $school_year_query_row['school_year']; ?></a><span
class="divider">/</span></li>
<li><a
href="#"><b>Quiz</b></a></li>
</ul>
<!-- end breadcrumb -->
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div id="" class="muted pull-right"></div>
</div>
<div class="block-content collapse in">
<div class="span12">
<div class="pull-right">
<a href="teacher_quiz.php"
class="btn btn-info"><i class="icon-arrow-left"></i> Back</a>
</div>
<form class="form-
horizontal" method="post">
<div class="control-
group">
<label
class="control-label" for="inputEmail">Quiz</label>
<div
class="controls">
<select
name="quiz_id">
<option></option>
<?php
$query = mysql_query("select * from quiz where teacher_id = '$session_id'")or
die(mysql_error());
while
($row = mysql_fetch_array($query)){ $id = $row['quiz_id']; ?>
<table
class="table" id="question">
<th></th>
<th>Class</th>
<th>program</th>
<th></th>
<tbody>
<?php $query = mysql_query("select * from teacher_class
LEFT JOIN class ON
class.class_id = teacher_class.class_id
LEFT JOIN program
ON program.program_id = teacher_class.program_id
where teacher_id =
'$session_id' and school_year = '$school_year' ")or die(mysql_error());
$count =
mysql_num_rows($query);
while($row =
mysql_fetch_array($query)){
$id =
$row['teacher_class_id'];
?>
<tr>
<td width="30">
<input id="optionsCheckbox" class="uniform_on"
name="selector[]" type="checkbox" value="<?php echo $id; ?>">
</td>
<td><?php echo $row['class_name']; ?></td>
<td><?php echo $row['program_code']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<div class="control-
group">
<div
class="controls">
<button name="save"
type="submit" class="btn btn-info"><i class="icon-save"></i> Save</button>
</div>
</div>
</form>
$id=$_POST['selector'];
$N =
count($id);
for($i=0; $i <
$N; $i++)
{
mysql_query("insert into class_quiz (teacher_class_id,quiz_time,quiz_id)
values('$id[$i]','$time','$quiz_id')")or die(mysql_error());
window.location = 'teacher_quiz.php';
</script>
<?php
}
?>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
$school_year_query_row = mysql_fetch_array($school_year_query);
$school_year =
$school_year_query_row['school_year'];
?>
<li><a
href="#"><b>My Class</b></a><span class="divider">/</span></li>
<li><a
href="#">School Year: <?php echo $school_year_query_row['school_year']; ?></a><span
class="divider">/</span></li>
<li><a
href="#"><b>Quiz</b></a></li>
</ul>
<!-- end breadcrumb -->
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div id="" class="muted pull-right"></div>
</div>
<div class="block-content collapse in">
<div class="span12">
<div class="pull-right">
<a href="teacher_quiz.php"
class="btn btn-info"><i class="icon-arrow-left"></i> Back</a>
</div>
<form class="form-
horizontal" method="post">
<div class="control-
group">
<label
class="control-label" for="inputEmail">Quiz Title</label>
<div
class="controls">
<input
type="text" name="quiz_title" id="inputEmail" placeholder="Quiz Title">
</div>
</div>
<div class="control-
group">
<label
class="control-label" for="inputPassword">Quiz Description</label>
<div
class="controls">
<input
type="text" class="span8" name="description" id="inputPassword" placeholder="Quiz
Description" required>
</div>
</div>
<div class="control-
group">
<div
class="controls">
<button name="save"
type="submit" class="btn btn-success"><i class="icon-save"></i> Save</button>
</div>
</div>
</form>
<?php
if
(isset($_POST['save'])){
$quiz_title =
$_POST['quiz_title'];
$description =
$_POST['description'];
mysql_query("insert
into quiz (quiz_title,quiz_description,date_added,teacher_id)
values('$quiz_title','$description',NOW(),'$session_id')")or die(mysql_error());
?>
<script>
window.location =
'teacher_quiz.php';
</script>
<?php
}
?>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body></html>
Add_question.php - adding a question for quizzes.
$school_year_query_row = mysql_fetch_array($school_year_query);
$school_year =
$school_year_query_row['school_year'];
?>
<li><a
href="#"><b>My Class</b></a><span class="divider">/</span></li>
<li><a
href="#">School Year: <?php echo $school_year_query_row['school_year']; ?></a><span
class="divider">/</span></li>
<li><a
href="#"><b>Quiz Question</b></a></li>
</ul>
<!-- end breadcrumb -->
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div id="" class="muted pull-right">
<a href="quiz_question.php<?php
echo '?id='.$get_id; ?>" class="btn btn-success"><i class="icon-arrow-left"></i> Back</a>
</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form class="form-horizontal"
method="post">
<div class="control-group">
<label
class="control-label" for="inputPassword">Question</label>
<div
class="controls">
<input
type="number" class="span1" name="points" min=1 max=5 required>
</div>
</div> -->
<div class="control-
group">
<label
class="control-label" for="inputEmail">Question Type:</label>
<div
class="controls">
<select
id="qtype" name="question_tpye" required>
<option value=""></option>
<?php
while($query_question_row = mysql_fetch_array($query_question)){
?>
<?php } ?>
</select>
</div>
</div>
<div class="control-
group">
<label
class="control-label" for="inputEmail"></label>
<div
class="controls">
<div id="opt11">
</div>
<div id="opt12">
</div>
</div>
</div>
<div class="control-group">
<div
class="controls">
<button name="save"
type="submit" class="btn btn-info"><i class="icon-save"></i> Save</button>
</div>
</div>
</form>
<?php
if (isset($_POST['save'])){
$question = $_POST['question'];
$points = $_POST['points'];
$type = $_POST['question_tpye'];
$answer = $_POST['answer'];
$ans1 = $_POST['ans1'];
$ans2 = $_POST['ans2'];
$ans3 = $_POST['ans3'];
$ans4 = $_POST['ans4'];
if ($type == '2'){
mysql_query("insert into quiz_question
(quiz_id,question_text,date_added,answer,question_type_id)
values('$get_id','$question',NOW(),'".$_POST['correctt']."','$type')")or
die(mysql_error());
}else{
?>
<script>
window.location = 'quiz_question.php<?php echo '?id='.$get_id; ?>'
</script>
<?php
}
?>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<script>
jQuery(document).ready(function(){
jQuery("#opt11").hide();
jQuery("#opt12").hide();
jQuery("#opt13").hide();
jQuery("#qtype").change(function(){
var x = jQuery(this).val();
if(x == '1') {
jQuery("#opt11").show();
jQuery("#opt12").hide();
jQuery("#opt13").hide();
} else if(x == '2') {
jQuery("#opt11").hide();
jQuery("#opt12").show();
jQuery("#opt13").hide();
} else {
jQuery("#opt11").hide();
jQuery("#opt12").hide();
jQuery("#opt13").hide();
}
});
});
</script>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Add_class.php - in this code the teacher can add a class from the database created by admin.
<!-- block -->
<div class="block">
<div class="navbar navbar-inner block-header">
<div id="" class="muted pull-left"><h4><i class="icon-plus-sign"></i> Add
class</h4></div>
</div>
<div class="block-content collapse in">
<div class="span12">
<form id="add_class"
method="post" >
<div class="control-
group">
<label>Class
Name:</label>
<div class="controls">
<input
type="hidden" name="session_id" value="<?php echo $session_id; ?>">
<select name="class_id" class="class_id" required>
<option></option>
<?php
$query =
mysql_query("select * from class order by class_name");
while($row =
mysql_fetch_array($query)){
?>
<option
value="<?php echo $row['class_id']; ?>"><?php echo $row['class_name']; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="control-
group">
<label>program:</label>
<div class="controls">
<select name="program_id" class="class_id" required>
<option></option>
<?php
$query =
mysql_query("select * from program order by program_code");
while($row =
mysql_fetch_array($query)){
?>
<option
value="<?php echo $row['program_id']; ?>"><?php echo $row['program_title']; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="control-
group">
<label>School
Year:</label>
<div class="controls">
<?php
$query =
mysql_query("select * from school_year order by school_year DESC");
$row =
mysql_fetch_array($query);
?>
<input
class="span5" type="text" class="" name="school_year" value="<?php echo
$row['school_year']; ?>" readonly >
</div>
</div>
<div
class="control-group">
<div class="controls">
<?php
if (isset($_POST['save'])){
$session_id = $_POST['session_id'];
$program_id =
$_POST['program_id'];
$class_id = $_POST['class_id'];
$school_year =
$_POST['school_year'];
$teacher_class =
mysql_query("select * from teacher_class order by teacher_class_id DESC")or
die(mysql_error());
$teacher_row =
mysql_fetch_array($teacher_class);
$teacher_id =
$teacher_row['teacher_id'];
$teacher_class_id =
$teacher_row['teacher_class_id'];
$insert_query =
mysql_query("select * from student where class_id = '$class_id'")or die(mysql_error());
while($row =
mysql_fetch_array($insert_query)){
$id = $row['student_id'];
mysql_query("insert into
teacher_class_student (student_id,teacher_class_id,teacher_id)
values('$id','$teacher_class_id','$teacher_id') ")or die(mysql_error());
echo "yes";
}
?>
<script>
window.location =
"dashboard_teacher.php";
</script>
<?php
}
}
?>
</div>
</div>
</div>
<!-- /block -->
<?php
include('admin/dbcon.php');
include('session.php');
require("opener_db.php");
$name=$_POST['name'];
$filedesc=$_POST['desc'];
$input_name = basename($_FILES['uploaded_file']['name']);
echo $input_name ;
if ($input_name == ""){
$id=$_POST['selector'];
$N = count($id);
// save and adding a new data of assignment your file that you
attach will be save because of thi code
for($i=0; $i < $N; $i++)
{
mysql_query("INSERT INTO assignment
(fdesc,fdatein,teacher_id,class_id) VALUES ('$filedesc',NOW(),'$session_id','$id[$i]')")or
die(mysql_error());
mysql_query("insert into notification
(teacher_class_id,date_of_notification,link) value('$id[$i]',NOW(),'assignment_student.php')")or
die(mysql_error());
}
}else{
$rd2 = mt_rand(1000, 9999) . "_File";
$filename = basename($_FILES['uploaded_file']['name']);
$ext = substr($filename, strrpos($filename, '.') + 1);
$newname = "uploads/" . $rd2 . "_" . $filename;
$name_notification = 'Add Assignment file name'." ".'<b>'.$name.'</b>';
(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $newname));
$id=$_POST['selector'];
$N = count($id);
for($i=0; $i < $N; $i++)
{
mysql_query("INSERT INTO assignment
(fdesc,floc,fdatein,teacher_id,fname,class_id) VALUES
('$filedesc','$newname',NOW(),'$session_id','$name','$id[$i]')")or die(mysql_error());
mysql_query("insert into notification
(teacher_class_id,notification,date_of_notification,link)
value('$id[$i]','$name_notification',NOW(),'assignment_student.php')")or die(mysql_error());
}
}
?>
Add_assignment.php – adding an assignment but not already restore into the database.
<?php include('header_dashboard.php'); ?>
<?php include('session.php'); ?>
<body id="class_div">
<?php include('navbar_teacher.php'); ?>
<div class="container-fluid">
<div class="row-fluid">
<?php include('teacher_add_assignment_sidebar.php'); ?>
<div class="span9" id="content">
<div class="row-fluid">
<!-- breadcrumb -->
<!-- adding assignment is need to have a school year so i
use array to find th school year data -->
<ul class="breadcrumb">
<?php
$school_year_query =
mysql_query("select * from school_year order by school_year DESC")or die(mysql_error());
$school_year_query_row =
mysql_fetch_array($school_year_query);
$school_year =
$school_year_query_row['school_year'];
?>
<li><a href="#"><b>My
Class</b></a><span class="divider">/</span></li>
<li><a href="#">School Year:
<?php echo $school_year_query_row['school_year']; ?></a></li>
</ul>
<!-- end breadcrumb -->
<!-- block -->
<div class="block">
<div class="navbar navbar-inner block-header">
<div id="count_class" class="muted pull-right">
</div>
</div>
<div class="block-content collapse in">
<div class="span4">
<form class=""
id="add_downloadble" method="post" enctype="multipart/form-data" name="upload" >
<div
class="control-group">
<div class="controls">
<!-- to
attachment of file -->
</div>
</div>
<div
class="control-group">
<div class="controls">
</div>
</div>
<div
class="control-group">
<div class="controls">
</div>
</div>
</div>
<div class="span8">
<div class="alert alert-info"><!-- Check The Class you want to put this
file.</div>
check the specific class to send your assignment -->
<div class="pull-left">
Check All <input type="checkbox"
name="selectAll" id="checkAll" />
<script>
$("#checkAll").click(function () {
$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>
</div>
<table
cellpadding="0" cellspacing="0" border="0" class="table" id="">
<thead>
<tr>
<th></th>
<th>Class Name</th>
<th>program Code</th>
</tr>
</thead>
<tbody>
while($row =
mysql_fetch_array($query)){
$id =
$row['teacher_class_id'];
?>
<tr id="del<?php
echo $id; ?>">
<td
width="30">
<input
id="" class="" name="selector[]" type="checkbox" value="<?php echo $id; ?>">
</td>
<td><?php
echo $row['class_name']; ?></td>
<td><?php
echo $row['program_code']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="span10">
<hr>
<center>
<div class="control-group">
<div
class="controls">
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
<script>
jQuery(document).ready(function($){
$("#add_downloadble").submit(function(e){
$.jGrowl("Uploading File Please Wait......", { sticky: true
});
e.preventDefault();
var _this = $(e.target);
var formData = new FormData($(this)[0]);
$.ajax({
type: "POST",
url: "add_assignment_save.php",
data: formData,
success: function(html){
$.jGrowl("Assignment Successfully Added",
{ header: 'Assignment Added' });
window.location = 'add_assignment.php';
},
cache: false,
contentType: false,
processData: false
});
});
});
</script>
</div>
<?php/*
include('teacher_right_sidebar.php') */?>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Delete_quiz_question.php - deleting of quiz question that you create into the database.
<?php
include('dbcon.php');
if (isset($_POST['backup_delete'])){
$id=$_POST['selector'];
$get_id=$_POST['get_id'];
$N = count($id);
// selection of deleting of quiz
for($i=0; $i < $N; $i++)
{
$result = mysql_query("DELETE FROM quiz_question where
quiz_question_id='$id[$i]'");
}
?>
<script>
window.location = 'quiz_question.php<?php echo '?id='.$get_id ?>';
</script>
<?php
}
?>
<?php
include('dbcon.php');
if (isset($_POST['backup_delete'])){
$id=$_POST['selector'];
$N = count($id);
// selection for deleting of quiz
for($i=0; $i < $N; $i++)
{
$result = mysql_query("DELETE FROM quiz where quiz_id='$id[$i]'");
}
header("location: teacher_quiz.php");
}
?>
<?php
include('admin/dbcon.php');
$id = $_POST['id'];
// deleting of files that attach already
mysql_query("delete from files where file_id = '$id' ")or die(mysql_error());
?>
<?php
include('dbcon.php');
// selection of quiz that you want delete
if (isset($_POST['backup_delete'])){
$get_id=$_GET['id'];
$id=$_POST['selector'];
$N = count($id);
for($i=0; $i < $N; $i++)
{
$result = mysql_query("DELETE FROM class_quiz where class_quiz_id='$id[$i]'")or
die(mysql_error());
}
?>
<script>
window.location = "class_quiz.php<?php echo '?id='.$get_id; ?>"
</script>
<?php
}
?>
Delete_class.php
<?php
include('admin/dbcon.php');
$get_id = $_POST['id'];
// deleting of class easier using this code if you try to delete the class in class teacher it will be
delete already in other like in the student data
mysql_query("delete from teacher_class where teacher_class_id = '$get_id' ")or
die(mysql_error());
mysql_query("delete from teacher_class_student where teacher_class_id = '$get_id' ")or
die(mysql_error());
mysql_query("delete from teacher_class_announcements where teacher_class_id = '$get_id'
")or die(mysql_error());
mysql_query("delete from teacher_notification where teacher_class_id = '$get_id' ")or
die(mysql_error());
mysql_query("delete from class_program_overview where teacher_class_id = '$get_id' ")or
die(mysql_error());
header('location:dashboard_teacher.php');
?>
Delete_backpack.php
<?php
include('dbcon.php');
if (isset($_POST['backup_delete'])){
$id=$_POST['selector'];
$N = count($id);
// if the teacher wants to delete or clear the backap
for($i=0; $i < $N; $i++)
{
$result = mysql_query("DELETE FROM teacher_backpack where file_id='$id[$i]'");
}
header("location: teacher_backpack.php");
}
?>
Delete_assignment.php
<?php
include('admin/dbcon.php');
$id = $_POST['id'];
$get_id = $_POST['get_id'];
// to delete the asignment data into data base
mysql_query("delete from assignment where assignment_id = '$id' ")or die(mysql_error());
?>
<script>
window.location = 'assignment.php<?php echo '?id='.$get_id; ?>'
</script>
EDITING CODE
$school_year_query_row = mysql_fetch_array($school_year_query);
$school_year =
$school_year_query_row['school_year'];
?>
<li><a
href="#"><b>My Class</b></a><span class="divider">/</span></li>
<li><a
href="#">School Year: <?php echo $school_year_query_row['school_year']; ?></a><span
class="divider">/</span></li>
<li><a
href="#"><b>Quiz</b></a></li>
</ul>
<!-- end breadcrumb -->
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div id="" class="muted pull-right"></div>
</div>
<div class="block-content collapse in">
<div class="span12">
<div class="pull-right">
<a href="teacher_quiz.php"
class="btn btn-info"><i class="icon-arrow-left"></i> Back</a>
</div>
<?php
$query = mysql_query("select *
from quiz where quiz_id = '$get_id'")or die(mysql_error());
$row = mysql_fetch_array($query);
?>
<form class="form-
horizontal" method="post">
<div class="control-
group">
<label
class="control-label" for="inputEmail">Quiz Title</label>
<div
class="controls">
<input
type="hidden" name="quiz_id" value="<?php echo $row['quiz_id']; ?>" id="inputEmail"
placeholder="Quiz Title">
<input
type="text" name="quiz_title" value="<?php echo $row['quiz_title']; ?>" id="inputEmail"
placeholder="Quiz Title">
</div>
</div>
<div class="control-
group">
<label
class="control-label" for="inputPassword">Quiz Description</label>
<div
class="controls">
<input
type="text" value="<?php echo $row['quiz_description']; ?>" class="span8" name="description"
id="inputPassword" placeholder="Quiz Description" required>
</div>
</div>
<div class="control-
group">
<div
class="controls">
<button name="save"
type="submit" class="btn btn-success"><i class="icon-save"></i> Save</button>
</div>
</div>
</form>
<?php
if
(isset($_POST['save'])){
$quiz_id =
$_POST['quiz_id'];
$quiz_title =
$_POST['quiz_title'];
$description =
$_POST['description'];
mysql_query("update
quiz set quiz_title = '$quiz_title',quiz_description = '$description' where quiz_id = '$quiz_id'")or
die(mysql_error());
?>
<script>
window.location =
'teacher_quiz.php';
</script>
<?php
}
?>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Edit_question.php
$school_year_query_row = mysql_fetch_array($school_year_query);
$school_year =
$school_year_query_row['school_year'];
?>
<li><a
href="#"><b>My Class</b></a><span class="divider">/</span></li>
<li><a
href="#">School Year: <?php echo $school_year_query_row['school_year']; ?></a><span
class="divider">/</span></li>
<li><a
href="#"><b>Quiz Question</b></a></li>
</ul>
<!-- end breadcrumb -->
<!-- block -->
<div id="block_bg" class="block">
<div class="navbar navbar-inner block-header">
<div id="" class="muted pull-right">
<a href="quiz_question.php<?php
echo '?id='.$get_id; ?>" class="btn btn-success"><i class="icon-arrow-left"></i> Back</a>
</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<?php
$query =
mysql_query("select * FROM quiz_question
LEFT JOIN
question_type on quiz_question.question_type_id = question_type.question_type_id
where quiz_id =
'$get_id' and quiz_question_id = '$quiz_question_id' order by date_added DESC ")or
die(mysql_error());
$row =
mysql_fetch_array($query);
?>
<form class="form-horizontal"
method="post">
<div class="control-group">
<label
class="control-label" for="inputPassword">Question</label>
<div
class="controls">
<input
type="number" class="span1" name="points" min=1 max=5 required>
</div>
</div> -->
<div class="control-
group">
<label
class="control-label" for="inputEmail">Question Type:</label>
<div
class="controls">
<select
id="qtype" name="question_tpye" required>
<option value="<?php echo $row['question_type_id']; ?>" ><?php echo
$row['question_type']; ?></option>
<?php
while($query_question_row = mysql_fetch_array($query_question)){
?>
<?php } ?>
</select>
</div>
</div>
<div class="control-
group">
<label
class="control-label" for="inputEmail"></label>
<div
class="controls">
<div id="opt11">
<?php
$sqlz = mysql_query("SELECT * FROM answers WHERE q_id = ".$_GET['edit']."");
while($rowz = mysql_fetch_array($sqlz)){
if($rowz['choice'] == 'A'){
$a = $rowz['value'];
} else if($rowz['choice'] == 'B'){
$b = $rowz['value'];
} else if($rowz['choice'] == 'C'){
$c = $rowz['value'];
} else if($rowz['choice'] == 'D'){
$d = $rowz['value'];
}
}
?>
A.)<input type="text" name="ans1" size="60" value="<?php echo $a;?>"><input
name="correctm" value="A" <?php if($rowa['correct'] == 'A'){ echo 'checked'; }?>
type="radio"><br /><br />
B.)<input type="text" name="ans2" size="60" value="<?php echo $b;?>"><input
name="correctm" value="B" <?php if($rowa['correct'] == 'B'){ echo 'checked'; }?>
type="radio"><br /><br />
C.)<input type="text" name="ans3" size="60" value="<?php echo $c;?>"><input
name="correctm" value="C" <?php if($rowa['correct'] == 'C'){ echo 'checked'; }?>
type="radio"><br /><br />
D.)<input type="text" name="ans4" size="60" value="<?php echo $d;?>"><input
name="correctm" value="D" <?php if($rowa['correct'] == 'D'){ echo 'checked'; }?>
type="radio"><br /><br />
</div>
<div id="opt12">
<input name="correctt" <?php if($row['answer'] == 'True'){ echo 'checked'; }?>
value="t" type="radio">True<br /><br />
<input name="correctt" <?php if($row['answer'] == 'False'){ echo 'checked'; }?>
value="f" type="radio">False<br /><br />
</div>
</div>
</div>
<div class="control-group">
<div
class="controls">
<button name="save"
type="submit" class="btn btn-info"><i class="icon-save"></i> Save</button>
</div>
</div>
</form>
<?php
if (isset($_POST['save'])){
$question = $_POST['question'];
$points = $_POST['points'];
$type = $_POST['question_tpye'];
$answer = $_POST['answer'];
$ans1 = $_POST['ans1'];
$ans2 = $_POST['ans2'];
$ans3 = $_POST['ans3'];
$ans4 = $_POST['ans4'];
if ($type == '2'){
mysql_query("insert into quiz_question
(quiz_id,question_text,date_added,answer,question_type_id)
values('$get_id','$question',NOW(),'".$_POST['correctt']."','$type')")or
die(mysql_error());
}else{
?>
<script>
window.location = 'quiz_question.php<?php echo '?id='.$get_id; ?>'
</script>
<?php
}
?>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<script>
jQuery(document).ready(function(){
jQuery("#opt11").hide();
jQuery("#opt12").hide();
jQuery("#opt13").hide();
jQuery("#qtype").change(function(){
var x = jQuery(this).val();
if(x == '1') {
jQuery("#opt11").show();
jQuery("#opt12").hide();
jQuery("#opt13").hide();
} else if(x == '2') {
jQuery("#opt11").hide();
jQuery("#opt12").show();
jQuery("#opt13").hide();
}
});
});
</script>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
$get_id1 = $_POST['id'];
?>
<!-- here is the function how you can edit your post -->
<body>
<?php include('navbar_teacher.php'); ?>
<div class="container-fluid">
<div class="row-fluid">
<?php include('annoucement_link.php'); ?>
<div class="span9" id="content">
<div class="row-fluid">
<!-- breadcrumb -->
<?php $class_query =
mysql_query("select * from teacher_class
LEFT JOIN class ON
class.class_id = teacher_class.class_id
LEFT JOIN program
ON program.program_id = teacher_class.program_id
where
teacher_class_id = '$get_id'")or die(mysql_error());
$class_row =
mysql_fetch_array($class_query);
?>
<ul class="breadcrumb">
<li><a href="#"><?php echo
$class_row['class_name']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><?php echo
$class_row['program_code']; ?></a> <span class="divider">/</span></li>
<li><a
href="#"><b>Announcements</b></a></li>
</ul>
<!-- end breadcrumb -->
")or die(mysql_error());
$row =
mysql_fetch_array($query_announcement);
$id =
$row['teacher_class_announcements_id'];
?>
<input type="hidden" name="id"
value="<?php echo $id; ?>">
<textarea name="content"
id="ckeditor_full">
<?php echo $row['content']; ?>
</textarea>
<br>
<button name="post" class="btn btn-
info"><i class="icon-check icon-large"></i> Post</button>
</form>
</div>
<?php
if (isset($_POST['post'])){
$content =
$_POST['content'];
$id = $_POST['id'];
mysql_query("update
teacher_class_announcements set content = '$content' where teacher_class_announcements_id =
'$id' ")or die(mysql_error());
?>
<script>
window.location =
'announcements.php<?php echo '?id='.$get_id; ?>';
</script>
<?php
}
?>
</div>
</div>
<!-- /block -->
</div>
</div>
<script type="text/javascript">
$(document).ready( function() {
$('.remove').click( function() {
var id = $(this).attr("id");
$.ajax({
type: "POST",
url: "remove_announcements.php",
data: ({id: id}),
cache: false,
success: function(html){
$("#del"+id).fadeOut('slow', function(){ $(this).remove();});
$('#'+id).modal('hide');
$.jGrowl("Your Post is Successfully Deleted", { header: 'Data Delete' });
}
});
return false;
});
});
</script>
</div>
</div>
include('header.php');
?>
<!-- the main session the you can see -->
<body id="login">
<div class="container">
<div class="row-fluid">
<div class="span8"><div class="pull-center"><?php
include('title_index.php'); ?></div></div>
<div class="span4"><div class="pull-center"><?php
include('login_form.php'); ?></div></div>
</div>
<div class="row-fluid">
<div class="span12"><div class="index-footer"><?php
include('link.php'); ?></div></div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Login.php - process of validating the data of user if the user is existing and have a permission to
access a account.
<?php
// including the data base to find the data needs
include('admin/dbcon.php');
session_start();
$username = $_POST['username'];
$password = sha1(md5($_POST['password']));
/* student */
$query = "SELECT * FROM student WHERE username='$username'
AND password='$password'";
$result = mysql_query($query)or die(mysql_error());
$row = mysql_fetch_array($result);
$num_row = mysql_num_rows($result);
/* teacher */
$query_teacher = mysql_query("SELECT * FROM teacher WHERE
username='$username' AND password='$password'")or die(mysql_error());
$num_row_teacher = mysql_num_rows($query_teacher);
$row_teahcer = mysql_fetch_array($query_teacher);
}else{
echo 'false';
}
?>
<script type="text/javascript">
$(document).ready(function(){
$('#signin').tooltip('show');
$('#signin').tooltip('hide');
});
</script>
</form>
<script>
jQuery(document).ready(function(){
jQuery("#login_form1").submit(function(e){
e.preventDefault();
var formData =
jQuery(this).serialize();
$.ajax({
type: "POST",
url: "login.php",
data: formData,
success: function(html){
if(html=='true')
{
$.jGrowl("Loading File
Please Wait......", { sticky: true });
$.jGrowl("Welcome to
Student Online Access Portal", { header: 'Access Granted' });
var delay = 1000;
<script type="text/javascript">
$(document).ready(function(){
$('#signin_student').tooltip('show'); $('#signin_student').tooltip('hide');
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('#signin_teacher').tooltip('show'); $('#signin_teacher').tooltip('hide');
});
</script>
<?php
session_start();
session_destroy();
header('location:index.php');
?>
<center>
<div class="control-
group">
<label>To
what class School Year:</label>
<div class="controls">
<input
type="hidden" name="get_id" value="<?php echo $get_id; ?>">
<select name="school_year" class="">
<option></option>
<?php
$query1 =
mysql_query("select * from teacher_class where class_id ='$class_id' and school_year !=
'$school_year'")or die(mysql_error());
while($row =
mysql_fetch_array($query1)){
?>
<div
class="control-group">
<div class="controls">
<button
name="delete_user" class="btn btn-danger"><i class="icon-copy"></i> Copy</button>
</div>
</div>
</center>
<center>
<div class="control-
group">
<label>--------
----Or----------</label>
<div class="control-group">
<div class="controls">
<button
name="copy" class="btn btn-info"><i class="icon-copy"></i> Copy to Backpack</button>
</div>
</div>
</div>
</center>
<center>
<div class="control-
group">
<label>--------
----Or----------</label>
<div class="control-group">
<div class="controls">
<p>Share To:</p>
<div class="control-group">
<label>To:</label>
<div class="controls">
<select name="teacher_id1" class="" required>
<option></option>
<?php
$query =
mysql_query("select * from teacher order by firstname");
while($row =
mysql_fetch_array($query)){
?>
<option
value="<?php echo $row['teacher_id']; ?>"><?php echo $row['firstname']; ?> <?php echo
$row['lastname']; ?> </option>
<?php } ?>
</select>
</div>
</div>
<button
name="share" class="btn btn-success"><i class="icon-copy"></i> Share</button>
</div>
</div>
</div>
</center>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-
hidden="true"><i class="icon-remove icon-large"></i> Close</button>
</div>
</div>
My_classmate.php – this code is for student to easy see her/his classmate in specific class.
$my_student = mysql_query("SELECT *
FROM teacher_class_student
while($row = mysql_fetch_array($my_student)){
$id = $row['teacher_class_student_id'];
?>
<li
id="del<?php echo $id; ?>">
<a
class="classmate_cursor" href="#">
<div><span></span></div>
</a>
<p
class="class"><?php echo $row['lastname'];?></p>
<p
class="program"><?php echo $row['firstname']; ?></p>
</li>
<?php } ?>
</ul>
</tbody>
</table>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
My_classmates_link.php – to connect the student user into other student user and knowing
her/his classmate.
My_student.php – this code is for teacher to make easily see the list of her/his student in
specific class.
while($row = mysql_fetch_array($my_student)){
$id = $row['teacher_class_student_id'];
?>
<li
id="del<?php echo $id; ?>">
<a href="#">
<div>
<span>
<p><?php ?></p>
</span>
</div>
</a>
$(document).ready( function() {
$('.remove').click( function() {
var id = $(this).attr("id");
$.ajax({
type: "POST",
url: "remove_student.php",
cache: false,
success: function(html){
$('#'+id).modal('hide');
});
return false;
});
});
</script>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<div class="pull-right">
Check All <input type="checkbox"
name="selectAll" id="checkAll" />
<script>
$("#checkAll").click(function () {
$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>
</div>
<?php } ?>
$yes = $read_row['student_read'];
?>
<div class="post"
id="del<?php echo $id; ?>">
<?php if ($yes ==
'yes'){
}else{
?>
// selection of
user that where is the notification trigger
<input id=""
name="selector[]" type="checkbox" value="<?php echo $id; ?>">
<?php } ?>
</a>
<hr>
<div class="pull-
right">
<i class="icon-
calendar"></i> <?php echo $row['date_of_notification']; ?>
</div>
</div>
<?php
}
?>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<?php
include('admin/dbcon.php');
include('session.php');
if (isset($_POST['change'])) {
// teacher changing profile pict
$image = addslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_name = addslashes($_FILES['image']['name']);
$image_size = getimagesize($_FILES['image']['tmp_name']);
move_uploaded_file($_FILES["image"]["tmp_name"], "uploads/" .
$_FILES["image"]["name"]);
$location = "uploads/" . $_FILES["image"]["name"];
<script>
window.location =
"dashboard_teacher.php";
</script>
<?php } ?>
<?php
$query_announcement =
mysql_query("select * from message
")or die(mysql_error());
$count_my_message =
mysql_num_rows($query_announcement);
if ($count_my_message != '0'){
while($row =
mysql_fetch_array($query_announcement)){
$id = $row['message_id'];
$sender_id = $row['sender_id'];
$sender_name =
$row['sender_name'];
$reciever_name =
$row['reciever_name'];
?>
<div
class="post" id="del<?php echo $id; ?>">
<div
class="message_content">
<?php echo
$row['content']; ?>
</div>
<hr>
Send by:
<strong><?php echo $row['sender_name']; ?></strong>
<i
class="icon-calendar"></i> <?php echo $row['date_sended']; ?>
<div class="pull-right">
<a class="btn btn-link" href="#reply<?php echo $id; ?>" data-toggle="modal" ><i
class="icon-reply"></i> Reply </a>
</div>
<div class="pull-right">
</div>
</div>
<script type="text/javascript">
$(document).ready( function() {
$('.remove').click( function() {
var id = $(this).attr("id");
$.ajax({
type: "POST",
url: "remove_inbox_message.php",
data: ({id: id}),
cache: false,
success: function(html){
$("#del"+id).fadeOut('slow', function(){ $(this).remove();});
$('#'+id).modal('hide');
$.jGrowl("Your Sent message is Successfully Deleted", { header: 'Data
Delete' });
}
});
return false;
});
});
</script>
<script>
jQuery(document).ready(function(){
jQuery("#reply").submit(function(e){
e.preventDefault();
var id = $('.reply').attr("id");
var _this = $(e.target);
var formData = jQuery(this).serialize();
$.ajax({
type: "POST",
url: "reply.php",
data: formData,
success: function(html){
$.jGrowl("Message Successfully Sent", { header:
'Message Sent' });
$('#reply'+id).modal('hide');
}
});
return false;
});
});
</script>
</div>
<?php include('create_message.php') ?>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<?php
$query_announcement =
mysql_query("select * from message
")or die(mysql_error());
while($row =
mysql_fetch_array($query_announcement)){
$id = $row['message_id'];
?>
<div
class="post" id="del<?php echo $id; ?>">
<div
class="message_content">
<?php echo
$row['content']; ?>
</div>
<hr>
Send by:
<strong><?php echo $row['sender_name']; ?></strong>
<i
class="icon-calendar"></i> <?php echo $row['date_sended']; ?>
<div class="pull-right">
</div>
</div>
<?php } ?>
</div>
</div>
</div>
<!-- /block -->
</div>
<script type="text/javascript">
$(document).ready( function() {
$('.remove').click( function() {
var id = $(this).attr("id");
$.ajax({
type: "POST",
url: "remove_inbox_message.php",
data: ({id: id}),
cache: false,
success: function(html){
$("#del"+id).fadeOut('slow', function(){ $(this).remove();});
$('#'+id).modal('hide');
$.jGrowl("Your Sent message is Successfully Deleted", { header: 'Data
Delete' });
}
});
return false;
});
});
</script>
</div>
<?php include('create_message_teacher.php') ?>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<?php
include('admin/dbcon.php');
include('session.php');
// to change the password
$new_password = sha1(md5($_POST['new_password']));
mysql_query("update teacher set password = '$new_password' where teacher_id =
'$session_id'")or die(mysql_error());
?>
?>
<body id="studentTableDiv">
<?php include('navbar_teacher.php'); ?>
<div class="container-fluid">
<div class="row-fluid">
<?php include('assignment_link.php'); ?>
<div class="span9" id="content">
<div class="row-fluid">
<?php $class_query =
mysql_query("select * from teacher_class
LEFT JOIN class ON
class.class_id = teacher_class.class_id
LEFT JOIN program
ON program.program_id = teacher_class.program_id
where
teacher_class_id = '$get_id'")or die(mysql_error());
$class_row =
mysql_fetch_array($class_query);
?>
<ul class="breadcrumb">
<li><a href="#"><?php echo
$class_row['class_name']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><?php echo
$class_row['program_code']; ?></a> <span class="divider">/</span></li>
<li><a href="#">School Year: <?php echo
$class_row['school_year']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><b>Uploaded
Assignments</b></a></li>
</ul>
<!-- end breadcrumb -->
?>
<div class="alert alert-
info">Submit Assignment in : <?php echo $row1['fname']; ?></div>
<div id="">
<thead>
<tr>
<th>Date Upload</th>
<th>File Name</th>
<th>Description</th>
<th>Submitted by:</th>
<th></th>
<th>Grade</th>
</tr>
</thead>
<tbody>
<?php
$query =
mysql_query("select * FROM student_assignment
LEFT JOIN student
on student.student_id = student_assignment.student_id
where assignment_id
= '$post_id' order by assignment_fdatein DESC")or die(mysql_error());
while($row =
mysql_fetch_array($query)){
$id =
$row['student_assignment_id'];
?>
<tr>
<td><?php echo
$row['assignment_fdatein']; ?></td>
<td><?php echo $row['fname']; ?></td>
<td><?php echo $row['fdesc']; ?></td>
<td><?php echo $row['firstname']." ".$row['lastname']; ?></td>
<td><a href="<?php echo $row['floc']; ?>"><i class="icon-download
icon-large"></i></a></td>
<td width="140">
<form
method="post" action="save_grade.php">
<input type="hidden"
class="span4" name="id" value="<?php echo $id; ?>">
<input type="hidden"
class="span4" name="post_id" value="<?php echo $post_id; ?>">
<input type="hidden"
class="span4" name="get_id" value="<?php echo $get_id; ?>">
<input type="text"
class="span4" name="grade" value="<?php echo $row['grade']; ?>">
<button name="save"
class="btn btn-success" id="btn_s"><i class="icon-save"></i> Save</button>
</form>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
</div>
</div>
<div class="block-content collapse in">
<div class="span12">
<table
cellpadding="0" cellspacing="0" border="0" class="table" id="">
<thead>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($my_student)){
$id = $row['teacher_class_student_id'];
?>
<tr id="del<?php
echo $id; ?>">
<td><?php echo
$row['firstname']; ?></td>
<td><?php echo $row['lastname']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<?php $class_query =
mysql_query("select * from teacher_class
LEFT JOIN class ON
class.class_id = teacher_class.class_id
LEFT JOIN program
ON program.program_id = teacher_class.program_id
where
teacher_class_id = '$get_id'")or die(mysql_error());
$class_row =
mysql_fetch_array($class_query);
$class_id =
$class_row['class_id'];
$school_year =
$class_row['school_year'];
?>
<ul class="breadcrumb">
<li><a href="#"><?php echo
$class_row['class_name']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><?php echo
$class_row['program_code']; ?></a> <span class="divider">/</span></li>
<li><a href="#">School Year: <?php echo
$class_row['school_year']; ?></a> <span class="divider">/</span></li>
<li><a href="#">Progress</a></li>
</ul>
<!-- end breadcrumb -->
<thead>
<tr>
<th>Date Upload</th>
<th>Assignment</th>
<th>Grade</th>
</tr>
</thead>
<tbody>
<?php
$query =
mysql_query("select * FROM student_assignment
LEFT JOIN student
on student.student_id = student_assignment.student_id
RIGHT JOIN
assignment on student_assignment.assignment_id = assignment.assignment_id
WHERE
student_assignment.student_id = '$session_id'
order by fdatein
DESC")or die(mysql_error());
while($row =
mysql_fetch_array($query)){
$id =
$row['student_assignment_id'];
$student_id =
$row['student_id'];
?>
<tr>
<td><?php echo
$row['fdatein']; ?></td>
<td><?php echo $row['fname']; ?></td>
<?php if ($session_id
== $student_id){ ?>
<td>
<span class="badge
badge-success"><?php echo $row['grade']; ?></span>
</td>
<?php }else{ ?>
<td></td>
<?php } ?>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
<table cellpadding="0"
cellspacing="0" border="0" class="table" id="">
<thead>
<tr>
<th>Quiz Title</th>
<th>Description</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$query =
mysql_query("select * FROM class_quiz
LEFT JOIN quiz on
class_quiz.quiz_id = quiz.quiz_id
where
teacher_class_id = '$get_id' order by class_quiz_id DESC ")or die(mysql_error());
while($row =
mysql_fetch_array($query)){
$id =
$row['class_quiz_id'];
$quiz_id =
$row['quiz_id'];
$quiz_time =
$row['quiz_time'];
$query1 =
mysql_query("select * from student_class_quiz where class_quiz_id = '$id' and student_id =
'$session_id'")or die(mysql_error());
$row1 =
mysql_fetch_array($query1);
$grade =
$row1['grade'];
?>
<?php if ($grade
==""){
}else{ ?>
<tr>
<td><?php echo
$row['quiz_title']; ?></td>
<td><?php echo $row['quiz_description']; ?></td>
<td><?php echo $row['quiz_time'] / 60; ?></td>
<td width="200">
<b>Already Taken
Score <?php echo $grade; ?></b>
</td>
<script type="text/javascript">
$(document).ready(function(){
});
</script>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
Read_message.php – this code is for easily read the message from database.
<?php
include('session.php');
include('admin/dbcon.php');
if (isset($_POST['read'])){
$id=$_POST['selector'];
$N = count($id);
for($i=0; $i < $N; $i++)
{
$result = mysql_query("update message set message_status = 'read' where
message_id='$id[$i]'");
}
header("location: student_message.php");
}
?>
<!-- code for replying mail -->
<?php
if (isset($_POST['reply'])){
$sender_id = $_POST['sender_id'];
$sender_name = $_POST['name_of_sender'];
$my_name = $_POST['my_name'];
$my_message = $_POST['my_message'];
}
?>
<?php
include('admin/dbcon.php');
// to save all grade in data base
$id = $_POST['id'];
$post_id = $_POST['post_id'];
$get_id = $_POST['get_id'];
$grade = $_POST['grade'];
mysql_query("update student_assignment set grade = '$grade' where student_assignment_id =
'$id'")or die(mysql_error());
?>
<script>
window.location = 'view_submit_assignment.php<?php echo
'?id='.$get_id.'&'.'post_id='.$post_id; ?>';
</script>
Reply.php - process that the user can reply back into the message from other user.
<?php
include('admin/dbcon.php');
include('session.php');
$sender_id = $_POST['sender_id'];
$sender_name = $_POST['name_of_sender'];
$my_name = $_POST['my_name'];
$my_message = $_POST['my_message'];
// insert into connect the id of sender id into receiver id
mysql_query("insert into message
(reciever_id,content,date_sended,sender_id,reciever_name,sender_name)
values('$sender_id','$my_message',NOW(),'$session_id','$sender_name','$my_name')")or
die(mysql_error());
mysql_query("insert into message_sent
(reciever_id,content,date_sended,sender_id,reciever_name,sender_name)
values('$sender_id','$my_message',NOW(),'$session_id','$sender_name','$my_name')")or
die(mysql_error());
?>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><i class="icon-
remove icon-large"></i> Close</button>
<button type="submit" id="<?php echo $id; ?>" class="btn btn-success reply"><i
class="icon-reply"></i> Reply</button>
</div>
</form>
</div>
<ul class="breadcrumb">
<?php
$sy = $_POST['school_year'];
$school_year_query = mysql_query("select * from
school_year where school_year = '$sy'")or die(mysql_error());
$school_year_query_row =
mysql_fetch_array($school_year_query);
$school_year =
$school_year_query_row['school_year'];
?>
<li><a href="#"><b>My
Class</b></a><span class="divider">/</span></li>
<li><a href="#"><?php echo
$school_year_query_row['school_year']; ?></a></li>
</ul>
<!-- end breadcrumb -->
<ul id="da-
thumbs" class="da-thumbs">
<?php $query =
mysql_query("select * from teacher_class
LEFT JOIN class ON
class.class_id = teacher_class.class_id
LEFT JOIN program
ON program.program_id = teacher_class.program_id
where teacher_id =
'$session_id' and school_year = '$school_year' ")or die(mysql_error());
while($row =
mysql_fetch_array($query)){
$id =
$row['teacher_class_id'];
?>
<li>
<a
href="my_students.php<?php echo '?id='.$id; ?>">
<div>
<span>
</span>
</div>
</a>
<p
class="class"><?php echo $row['class_name']; ?></p>
<p
class="program"><?php echo $row['program_code']; ?></p>
<a
href="#<?php echo $id; ?>" data-toggle="modal"><i class="icon-trash"></i> Remove</a>
</li>
<?php
include("delete_class_modal.php"); ?>
<?php } ?>
</ul>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
<?php include('teacher_right_sidebar.php') ?>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
Send_message_student.php – this code is for students sending message to other user except
admin.
<?php
include('admin/dbcon.php');
include('session.php');
$teacher_id = $_POST['teacher_id'];
$my_message = $_POST['my_message'];
<?php
include('admin/dbcon.php');
include('session.php');
$student_id = $_POST['student_id'];
$my_message = $_POST['my_message'];
Sent_message.php - process when the message is successfully send it will restore into the
database .
<?php
$query_announcement =
mysql_query("select * from message_sent
")or die(mysql_error());
$count_my_message =
mysql_num_rows($query_announcement);
if ($count_my_message != '0'){
while($row =
mysql_fetch_array($query_announcement)){
$id = $row['message_sent_id'];
?>
<div
class="post" id="del<?php echo $id; ?>">
<?php echo
$row['content']; ?>
<hr>
Sent to:
<strong><?php echo $row['reciever_name']; ?></strong>
<i
class="icon-calendar"></i> <?php echo $row['date_sended']; ?>
<div class="pull-right">
</div>
</div>
<?php }}else{ ?>
<div class="alert alert-info"><i
class="icon-info-sign"></i> No Message in your Sent Items</div>
<?php } ?>
</div>
</div>
</div>
<!-- /block -->
</div>
<script type="text/javascript">
$(document).ready( function() {
$('.remove').click( function() {
var id = $(this).attr("id");
$.ajax({
type: "POST",
url: "remove_sent_message.php",
data: ({id: id}),
cache: false,
success: function(html){
$("#del"+id).fadeOut('slow', function(){ $(this).remove();});
$('#'+id).modal('hide');
$.jGrowl("Your Sent message is Successfully Deleted", { header: 'Data
Delete' });
}
});
return false;
});
});
</script>
</div>
<?php include('create_message.php') ?>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
</div>
<div class="span4">
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div class="index-footer">
<?php include('link.php'); ?>
</div>
</div>
</div>
<!-- /container -->
<?php include('footer.php'); ?>
</div> <!-- /container -->
<?php include('script.php'); ?>
</body>
</html>
}else
{
$.jGrowl("Your data is not found in the database", {
header: 'Sign Up Failed' });
}
});
});
</script>
<center>
<a onclick="window.location='index.php'" id="btn_login" name="login"
class="btn" type="submit"><i class="icon-signin icon-large"></i> Click here to Login</a>
</center>
Signup_student.php - function when the student is signing up.
</div>
<div class="span4">
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div class="index-footer">
<?php include('link.php'); ?>
</div>
</div>
</div>
<!-- /container -->
<?php include('footer.php'); ?>
</div> <!-- /container -->
<?php include('script.php'); ?>
</body>
</html>
<?php
$query_announcement =
mysql_query("select * from message
")or die(mysql_error());
$count_my_message =
mysql_num_rows($query_announcement);
if ($count_my_message != '0'){
while($row =
mysql_fetch_array($query_announcement)){
$id = $row['message_id'];
$id_2 = $row['message_id'];
$status = $row['message_status'];
$sender_id = $row['sender_id'];
$sender_name =
$row['sender_name'];
$reciever_name =
$row['reciever_name'];
?>
<div
class="post" id="del<?php echo $id; ?>">
<div
class="message_content">
<?php echo
$row['content']; ?>
</div>
<div
class="pull-right">
<?php if
($status == 'read'){
<hr>
Send by:
<strong><?php echo $row['sender_name']; ?></strong>
<i
class="icon-calendar"></i> <?php echo $row['date_sended']; ?>
<div class="pull-right">
</div>
<div class="pull-right">
<a class="btn btn-link" href="#<?php echo $id; ?>" data-toggle="modal" ><i
class="icon-remove"></i> Remove </a>
</div>
</div>
</div>
</div>
</div>
<!-- /block -->
</div>
<script type="text/javascript">
$(document).ready( function() {
$('.remove').click( function() {
var id = $(this).attr("id");
$.ajax({
type: "POST",
url: "remove_inbox_message.php",
data: ({id: id}),
cache: false,
success: function(html){
$("#del"+id).fadeOut('slow', function(){ $(this).remove();});
$('#'+id).modal('hide');
$.jGrowl("Your Sent message is Successfully Deleted", { header: 'Data
Delete' });
}
});
return false;
});
});
</script>
<script>
jQuery(document).ready(function(){
jQuery("#reply").submit(function(e){
e.preventDefault();
var id = $('.reply').attr("id");
var _this = $(e.target);
var formData = jQuery(this).serialize();
$.ajax({
type: "POST",
url: "reply.php",
data: formData,
success: function(html){
$.jGrowl("Message Successfully Sent", { header:
'Message Sent' });
$('#reply'+id).modal('hide');
}
});
return false;
});
});
</script>
</div>
<?php include('create_message_student.php') ?>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>
</div>
")or die(mysql_error());
$count_my_message =
mysql_num_rows($query_announcement);
if ($count_my_message != '0'){
while($row =
mysql_fetch_array($query_announcement)){
$id = $row['message_id'];
$id_2 = $row['message_id'];
$status = $row['message_status'];
$sender_id = $row['sender_id'];
$sender_name =
$row['sender_name'];
$reciever_name =
$row['reciever_name'];
?>
<div
class="post" id="del<?php echo $id; ?>">
<div
class="message_content">
<?php echo
$row['content']; ?>
</div>
<div
class="pull-right">
<?php if
($status == 'read'){
}else{ ?>
<input id=""
class="" name="selector[]" type="checkbox" value="<?php echo $id; ?>">
<?php } ?>
</div>
<hr>
Send by:
<strong><?php echo $row['sender_name']; ?></strong>
<i
class="icon-calendar"></i> <?php echo $row['date_sended']; ?>
<div class="pull-right">
</div>
<div class="pull-right">
</div>
</div>
<script type="text/javascript">
$(document).ready( function() {
$('.remove').click( function() {
var id = $(this).attr("id");
$.ajax({
type: "POST",
url: "remove_inbox_message.php",
data: ({id: id}),
cache: false,
success: function(html){
$("#del"+id).fadeOut('slow', function(){ $(this).remove();});
$('#'+id).modal('hide');
$.jGrowl("Your Sent message is Successfully Deleted", { header: 'Data
Delete' });
}
});
return false;
});
});
</script>
</div>
<?php include('create_message_student_student.php') ?>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<ul class="breadcrumb">
<?php
$school_year_query = mysql_query("select * from
school_year order by school_year DESC")or die(mysql_error());
$school_year_query_row =
mysql_fetch_array($school_year_query);
$school_year =
$school_year_query_row['school_year'];
?>
<li><a href="#"><b>My
Class</b></a><span class="divider">/</span></li>
<li><a href="#">School Year: <?php echo
$school_year_query_row['school_year']; ?></a></li>
</ul>
<!-- end breadcrumb -->
<div class="pull-right">
Check All <input type="checkbox"
name="selectAll" id="checkAll" />
<script>
$("#checkAll").click(function () {
$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>
</div>
<?php } ?>
$yes = $read_row['student_read'];
?>
<div class="post"
id="del<?php echo $id; ?>">
<?php if ($yes ==
'yes'){
}else{
?>
<input id="" class=""
name="selector[]" type="checkbox" value="<?php echo $id; ?>">
<?php } ?>
</a>
<hr>
<div class="pull-
right">
<i class="icon-
calendar"></i> <?php echo $row['date_of_notification']; ?>
</div>
</div>
<?php
} }else{
?>
<div class="alert alert-info"><i class="icon-info-
sign"></i> No Notifications Found</div>
<?php
}
?>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<?php
include('copy_to_backpack_modal.php'); ?>
<table cellpadding="0"
cellspacing="0" border="0" class="table" id="">
<thead>
<tr>
<th>Quiz Title</th>
<th>Description</th>
<th>Quiz Time (In Minutes)</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$query =
mysql_query("select * FROM class_quiz
LEFT JOIN quiz on
class_quiz.quiz_id = quiz.quiz_id
where
teacher_class_id = '$get_id' order by class_quiz_id DESC ")or die(mysql_error());
while($row =
mysql_fetch_array($query)){
$id =
$row['class_quiz_id'];
$quiz_id =
$row['quiz_id'];
$quiz_time =
$row['quiz_time'];
$query1 =
mysql_query("select * from student_class_quiz where class_quiz_id = '$id' and student_id =
'$session_id'")or die(mysql_error());
$row1 =
mysql_fetch_array($query1);
$grade =
$row1['grade'];
?>
<tr>
<td><?php echo
$row['quiz_title']; ?></td>
<td><?php echo $row['quiz_description']; ?></td>
<td><?php echo $row['quiz_time'] / 60; ?></td>
<td width="200">
<?php if ($grade ==
""){ ?>
<a data-
placement="bottom" title="Take This Quiz" id="<?php echo $id; ?>Download"
href="take_test.php<?php echo '?id='.$get_id ?>&<?php echo 'class_quiz_id='.$id; ?>&<?php
echo 'test=ok' ?>&<?php echo 'quiz_id='.$quiz_id; ?>&<?php echo 'quiz_time='.$quiz_time;
?>"><i class="icon-check icon-large"></i> Take This Quiz</a>
<?php }else{ ?>
<b>Already Taken
Score <?php echo $grade; ?></b>
<?php } ?>
</td>
<script type="text/javascript">
$(document).ready(function(){
});
</script>
</tr>
<?php } ?>
</tbody>
</table>
</form>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<script>
jQuery(document).ready(function(){
jQuery("#signin_student").submit(function(e){
e.preventDefault();
if (password == cpassword){
var formData = jQuery(this).serialize();
$.ajax({
type: "POST",
url: "student_signup.php",
data: formData,
success: function(html){
if(html=='true')
{
$.jGrowl("Welcome to Student Online Access
Portal", { header: 'Sign up Success' });
var delay = 2000;
setTimeout(function(){ window.location =
'dashboard_student.php' }, delay);
}else if(html=='false'){
$.jGrowl("Student Information Does Not
Found In The Database Please Sure to Check Your ID Number or Firstname, Lastname and the
Section You Belong. ", { header: 'Sign Up Failed' });
}
}
});
}else
{
$.jGrowl("Student Information Does Not Found In
The Database", { header: 'Sign Up Failed' });
}
});
});
</script>
<center>
<a onclick="window.location='index.php'" id="btn_login" name="login"
class="btn" type="submit"><i class="icon-signin icon-large"></i> Click here to Login</a>
</center>
<?php
include('admin/dbcon.php');
session_start();
$username = $_POST['username'];
$password = sha1(md5($_POST['password']));
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$class_id = $_POST['class_id'];
// validation of data
$query = mysql_query("select * from student where username='$username' and
firstname='$firstname' and lastname='$lastname' and class_id = '$class_id'")or
die(mysql_error());
$row = mysql_fetch_array($query);
$id = $row['student_id'];
$count = mysql_num_rows($query);
if ($count > 0){
mysql_query("update student set password = '$password', status = 'Registered' where
student_id = '$id'")or die(mysql_error());
$_SESSION['id']=$id;
echo 'true';
}else{
echo 'false';
}
?>
?>
<!-- to submit the assignment and notify it into other user -->
<body id="studentTableDiv">
<?php include('navbar_student.php'); ?>
<div class="container-fluid">
<div class="row-fluid">
<?php include('assignment_link_student.php'); ?>
<div class="span6" id="content">
<div class="row-fluid">
<!-- breadcrumb -->
<?php $class_query =
mysql_query("select * from teacher_class
LEFT JOIN class ON
class.class_id = teacher_class.class_id
LEFT JOIN program
ON program.program_id = teacher_class.program_id
where
teacher_class_id = '$get_id'")or die(mysql_error());
$class_row =
mysql_fetch_array($class_query);
?>
<ul class="breadcrumb">
<li><a href="#"><?php echo
$class_row['class_name']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><?php echo
$class_row['program_code']; ?></a> <span class="divider">/</span></li>
<li><a href="#">School Year: <?php echo
$class_row['school_year']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><b>Uploaded
Assignments</b></a></li>
</ul>
<!-- end breadcrumb -->
?>
<div class="alert alert-
info">Submit Assignment in : <?php echo $row1['fname']; ?></div>
<div id="">
<thead>
<tr>
<th>Date Upload</th>
<th>File Name</th>
<th>Description</th>
<th>Submitted by:</th>
<th>Grade</th>
</tr>
</thead>
<tbody>
<?php
$query =
mysql_query("select * FROM student_assignment
LEFT JOIN student
on student.student_id = student_assignment.student_id
where assignment_id
= '$post_id' order by assignment_fdatein DESC")or die(mysql_error());
while($row =
mysql_fetch_array($query)){
$id =
$row['student_assignment_id'];
$student_id =
$row['student_id'];
?>
<tr>
<td><?php echo
$row['assignment_fdatein']; ?></td>
<td><?php echo $row['fname']; ?></td>
<td><?php echo $row['fdesc']; ?></td>
<td><?php echo $row['firstname']." ".$row['lastname']; ?></td>
<?php if ($session_id
== $student_id){ ?>
<td>
<span class="badge
badge-success"><?php echo $row['grade']; ?></span>
</td>
<?php }else{ ?>
<td></td>
<?php } ?>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
<?php include('submit_assignment_sidebar.php') ?>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>
<?php
if ($count > 0){
}else{
mysql_query("insert into student_class_quiz (class_quiz_id,student_id,student_quiz_time)
values('$class_quiz_id','$session_id','$quiz_time')");
}
?>
<!-- this is for takinga test code theres a counting to limit the time of user to takinga test -->
<body>
<?php include('navbar_student.php'); ?>
<div class="container-fluid">
<div class="row-fluid">
<?php include('student_quiz_link.php'); ?>
<div class="span9" id="content">
<div class="row-fluid">
<!-- breadcrumb -->
<?php $class_query =
mysql_query("select * from teacher_class
LEFT JOIN class ON
class.class_id = teacher_class.class_id
LEFT JOIN program
ON program.program_id = teacher_class.program_id
where
teacher_class_id = '$get_id'")or die(mysql_error());
$class_row =
mysql_fetch_array($class_query);
$class_id =
$class_row['class_id'];
$school_year =
$class_row['school_year'];
?>
<ul class="breadcrumb">
<li><a href="#"><?php echo
$class_row['class_name']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><?php echo
$class_row['program_code']; ?></a> <span class="divider">/</span></li>
<li><a href="#">School Year: <?php echo
$class_row['school_year']; ?></a> <span class="divider">/</span></li>
<li><a href="#"><b>Practice
Quiz</b></a></li>
</ul>
<!-- end breadcrumb -->
<?php
if($_GET['test'] == 'ok'){
/* $sqlp = mysql_query("SELECT * FROM groupcode WHERE course_code =
'".$row['course_code']."'"); */
$sqlp = mysql_query("SELECT * FROM class_quiz WHERE class_quiz_id =
'$class_quiz_id'")or die(mysql_error());
$rowp = mysql_fetch_array($sqlp);
/* mysql_query("UPDATE students SET `time-left` = ".$rowp['time']." WHERE stud_id =
'".$_SESSION['user_id']."'"); */
/* echo $rowp['time']; */
$x=0;
?>
<script>
jQuery(document).ready(function(){
var timer = 1;
jQuery(".questions-table input").hide();
setInterval(function(){
var timer =
jQuery("#timer").text();
jQuery("#timer").load("timer.ajax.php");
if(timer == 0){
jQuery(".questions-table input").hide();
jQuery("#submit-test").show();
jQuery(".questions-table input").show();
}
},990);
});
</script>
<form action="take_test.php<?php echo '?id='.$get_id; ?>&<?php echo
'class_quiz_id='.$class_quiz_id; ?>&<?php echo 'test=done' ?>&<?php echo 'quiz_id='.$quiz_id;
?>&<?php echo 'quiz_time='.$quiz_time; ?>" name="testform" method="POST" id="test-
form">
<?php
$sqla =
mysql_query("select * FROM class_quiz
LEFT JOIN quiz ON
quiz.quiz_id = class_quiz.quiz_id
where
teacher_class_id = '$get_id'
order by date_added
DESC ")or die(mysql_error());
/* $row =
mysql_fetch_array($sqla); */
$rowa =
mysql_fetch_array($sqla);
/* $rowa =
$row['quiz_id']; */
/* $sqla = mysql_query("SELECT * FROM class_quiz WHERE course_code =
'".$row['course_code']."'"); */
?>
<h3>Test Title:
<b><?php echo $rowa['quiz_title'];?></b></h3>
jQuery(document).ready(function(){
var nq = 0;
var qn = 0;
jQuery(".nextq").click(function(){
qn =
jQuery(this).attr('qn');
nq =
parseInt(qn) + 1;
jQuery('#q_' + qn ).fadeOut();
jQuery('#q_' + nq ).show();
});
});
</script>
<table class="questions-table table">
<tr>
<th>#</th>
<th>Question</th>
</tr>
<?php
$sqlw = mysql_query("SELECT * FROM quiz_question where quiz_id = '$quiz_id'
ORDER BY RAND()");
$qt = mysql_num_rows($sqlw);
while($roww = mysql_fetch_array($sqlw)){
?>
<tr id="q_<?php echo $x=$x+1;?>" class="questions">
<td width="30" id="qa"><?php echo $x;?></td>
<td id="qa">
<?php echo $roww['question_text'];?>
<br>
<hr>
<?php
if($roww['question_type_id']=='2'){
?>
<input name="q-<?php echo $roww['quiz_question_id'];?>" value="True" type="radio">
True | <input name="q-<?php echo $roww['quiz_question_id'];?>" value="False"
type="radio"> False
<?php
} else if($roww['question_type_id']=='1') {
$sqly = mysql_query("SELECT * FROM answer WHERE quiz_question_id =
'".$roww['quiz_question_id']."'");
while($rowy = mysql_fetch_array($sqly)){
if($rowy['choices'] == 'A') {
?>
A.)<input name="q-<?php echo $roww['quiz_question_id'];?>" value="A" type="radio">
<?php echo $rowy['answer_text'];?><br /><br />
<?php } else if ($rowy['choices'] == 'B') {?>
B.) <input name="q-<?php echo $roww['quiz_question_id'];?>" value="B"
type="radio"> <?php echo $rowy['answer_text'];?><br /><br />
<?php } else if ($rowy['choices'] == 'C') {?>
C.) <input name="q-<?php echo $roww['quiz_question_id'];?>" value="C"
type="radio"> <?php echo $rowy['answer_text'];?><br /><br />
<?php } else if ($rowy['choices'] == 'D') {?>
D.) <input name="q-<?php echo $roww['quiz_question_id'];?>" value="D"
type="radio"> <?php echo $rowy['answer_text'];?><br /><br />
<?php
}
}
}
?>
<br/>
<button onclick="return false;" qn="<?php echo $x;?>" class="nextq btn btn-success"
id="next_<?php echo $x;?>">NEXT QUESTION <i class="icon-arrow-right"></i> </button>
<input type="hidden" name="x-<?php echo $x;?>" value="<?php echo
$roww['quiz_question_id'];?>">
</td>
</tr>
<?php
}
?>
<tr>
<td></td>
<td>
<button class="btn btn-info" id="submit-test" name="submit_answer"><i class="icon-
check"></i> Submit Answer</button>
<!-- <input type="submit" value="Submit My Answers" class="btn btn-info" id="submit-test"
name="submit_answer"><br /> -->
</td>
</tr>
</table>
<input type="hidden" name="x" value="<?php echo $x;?>">
</form>
<?php
} else if(isset($_POST['submit_answer'])){
$x1 = $_POST['x'];
$score = 0;
for($x=1;$x<=$x1;$x++){
$x2 = $_POST["x-$x"];
$q = $_POST["q-$x2"];
} ?>
<a href="student_quiz_list.php<?php echo '?id='.$get_id; ?>"><i class="icon-arrow-
left"></i> Back</a>
<center>
<h3><br>Your score is <b><?php echo $score; ?></b> out of <b><?php echo ($x-1);
?></b><br/></h3>
</center>
<?php
/* echo "Your Percentage Grade is : <b>".$per."%</b>"; */
mysql_query("UPDATE student_class_quiz SET `student_quiz_time` = 3600, `grade` =
'".$score." out of ".($x-1)."' WHERE student_id = '$session_id' and class_quiz_id =
'$class_quiz_id'")or die(mysql_error());
?>
<script>
window.location = 'student_quiz_list.php<?php echo '?id='.$get_id; ?>';
</script>
<?php
} /* else { */
?>
<br />
<?php
/* $sql = mysql_query("SELECT * FROM students WHERE stud_id =
'".$_SESSION['user_id']."'");
$row = mysql_fetch_array($sql);
if(is_null($row['grade']) AND $row['time-left'] == 3600){ */
?>
<!-- <a href="?test=ok">Take the test now</a> -->
<?php
/* } else if(is_null($row['grade']) AND $row['time-left'] < 3600 AND $row['time-left'] > 0){
*/
?>
<!-- <a href="?test=ok">Continue your test</a> -->
<?php
/* } else if(!is_null($row['grade'])){
$sqlg = mysql_query("SELECT * FROM groupcode WHERE course_code =
'".$row['course_code']."'");
$rowg = mysql_fetch_array($sqlg);
echo "You have already taken <b>".$rowg['course_title']."</b> -
<b>".$rowg['course_code']."</b> test.";
}
if($row['grade']!=''){
mysql_query("UPDATE students SET `time-left` = 3600 WHERE stud_id =
'".$_SESSION['user_id']."'");
echo "<br />Your Grade for this Test is : <b>".$row['grade']."</b>";
}
} */
?>
</div>
<div class="block-content collapse in">
<div class="span12">
</div>
</div>
</div>
<!-- /block -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
<?php include('script.php'); ?>
</body>
</html>