Documetation 2
Documetation 2
Arts and Science College , Vaniyambadi, In partial fulfillment of the requirement for
original project work done by NIVETHA.P during the period May-2024 the guidance
PLACE:VANIYAMBADI
DATE:
ACKNOWLEDEMENT
First of all,we thank to the almighty god who showed on his Immense blessing which
helped us to complete this project.
It gives Immense pleasure to express our sincere thanks to ARUNA.T H.O.D of BCA
department for their excellent &faithful discussion that helped us during the course of
the project.
We sincerely and heartily Thankful to the project Incharge MS RANJITHA.C for her
timely advise and kind Cooperation of through times without her innovation guidance
we would not been able to complete this project.
At the outside we would like to express our deep gratitude for project to DR M.
RENU MBA(HR) M. COM, M.PHIL,PGDCA, SET, Principal in Islamiah
women’s Arts and Science College for granting permission & providing the necessary
facilities for successful completion of this project.
CHAPTER 1
INTRODUCTION
ABSTRACT
EXIXTING SYSTEM
PROPOSED SYSTEM
INTRODUCTION
Attendance Management System is software developed for daily student attendance in
particular student in a particular class. The information is sorted by the operators, which will
be provided by the teacher for a particular class. This system will also help in evaluating
attendance eligibility criteria of a student. Since ages, attendance system has remained one of
the most important systems for evaluating the working time of students in any college or
school. In short, this project is used to mark the number of days present/absent in any
Overview:- Attendance Management System basically has main modules for proper
functioning.
The main module is admin which has right for creating space for new batch, entry of new
faculty, updating any subject if necessary,Adding new students or removing the students and
intuitive user interface, it facilitates efficient management of attendance records and related
tasks.
This system empowers administrators to oversee attendance data from a centralized platform,
offering flexibility and convenience. Key features include attendance recording, staff
Administrators can easily monitor attendance trends, manage user accounts, and generate
insightful reports for decision-making purposes. Staff members can efficiently record
This system mainly deal with the maintenance of the student's attendance details. It is
generates the attendance of the student on basis of presence in class. It is maintaining daily
basis of attendance, the staff will be provide with the separate username and password to
The staff handling the particular subject to responsible to make the attendance for all students.
Only if the student presents the particular date, the attendance will be calculated. The student
In the present system all work is done on paper. The whole session attendance is stored in
register and at the end of the session the reports are generated. We are not interested in
generating report in the middle of the session or as per the requirement because it takes more
time in calculation. At the end of session the students who don't have 75% attendance get a
notice.
generated at the end of the session and the student does not get a single chance to improve
their attendance.
• Manual control: All calculations to generate report is done manually so there is greater
chance of errors.
• Lots of paperwork: Existing system requires lot of paper work. Loss of even a single
register/record led to difficult situation because all the papers are needed to generate the
reports.
• Time consuming: Every work is done manually so we cannot generate report in the middle
•Less security: Security of data is less because majority of the records are stored registers.
Moreover, these data can be accessed they can modify any important data.
PROPOSED SYSTEM
This Application is built for automating the processing of attendance. It also enhances the
speed of the performing attendance task easily. It also generates periodic reports to keep a
check on the students who are regular & who are not.
Admin has to login to the system & then in the attendance option they have to select
appropriate class, semester and subject. So this will display the list of the students who are
This system is very useful to the office staff also because they can generate various types of
reports and submit them to respective faculties also or also can be submitted to the College
Coordinator. Office staff can also generate black list of students who have attendance less
• User Friendly:-The proposed system is user friendly because the retrieval and storing of
data is fast and data is maintained efficiently. Moreover the graphical user interface is
provided in the proposed system, which provides user to deal with the system very easily.
• Reports are easily generated:- reports can be easily generated in the proposed system so
user can generate the report as per the requirement (monthly) or in the middle of the session.
User can give the notice to the students so he/she become regular
CHAPTER 2
SYSTEM REQUIREMENT
HARDWARE
SOFTWARE
SYSTEM CONFIGURATION
SYSTEM REQUIREMENT
HARDWARE REQUIREMENT:
A hardware specification defines the hardware requirements and design of a project, such as
communicate the hardware architecture and functionality to the developers, stakeholders, and
users. It also serves as a reference and a guide for the hardware development and testing
process.
SOFTWARE REQUIREMENT:
functionality, and requirements of a software project. It helps to communicate the vision and
scope of the project to the developers, stakeholders, and users. It also serves as a reference
Back-end: MYSQL
The technologies that are used for making this project are:
HTML
CSS
JAVASCRIPT
PHP
MYSQL
HTML:
HTML stands for Hyper Text Markup Language and it is used to create web pages. HTML
uses tags and attributes to describe the structure and formatting of web content. HTML.
consists of various elements, such as headings, lists, images, links, and more, that are
responsible for telling browsers how to display the content. HTML also allows embedding
programs written in a scripting language, such as JavaScript, or styling the appearance of the
content using Cascading Style Sheets (CSS). HTML is the most basic building block of web
CSS:
CSS stands for Cascading Style Sheets and it is a language used to style and layout web
pages. CSS allows you to apply different rules and properties to HTML elements, such as
colors, fonts, margins, padding, borders, backgrounds, and more. CSS also enables you to
create responsive and interactive web designs using features like media queries, transitions,
animations, and flex-box.CSS is one of the core technologies of the web and it is widely
JavaScript is a programming language that can run in web browsers and other environments.
It can create dynamic and interactive web pages, as well as perform various tasks such as data
processing, network communication, and file manipulation. JavaScript is not the same as
Java. They are two different languages that have some similarities in syntax, but different
purposes, features, and paradigms. Java is a compiled, object-oriented, and strongly typed
PHP:
PHP is a server-side scripting language that is widely used for web development. It can create
dynamic and interactive web pages, as well as perform various tasks such as data processing,
network communication, and file manipulation. PHP is open-source, which means it is free to
download and use. It is also easy to use as it can be embedded into HTML.PHP is compatible
with many databases, such as MySQL, PostgreSQL, SQLite, MongoDB, and more. You can
use PHP to connect to these databases and manipulate data using SQL or other query
languages. PHP has many built-in functions and extensions that can help you with various
tasks, such as string manipulation, date and time, file handling, image processing, email
PHP supports object-oriented programming (OOP), which is a paradigm that organizes code
into classes and objects. You can use OOP to create reusable and maintainable code, by using
supports some advanced OOP features, such as interfaces, traits, name spaces, and
anonymous classes.
MYSQL:
MySQL is an open-source relational database management system that allows you to store,
manipulate, and retrieve data using Structured Query Language (SQL).MySQL is a popular
and widely used database management system that can handle various types of data and
queries. It is free and open-source, which means anyone can use it without paying any license
fees. It is cross-platform, which means it can run on different operating systems such as
It is Scalable and reliable, which means it can handle large amounts of data and transactions
with high performance and availability. It supports multiple storage engines, which means it
can use different methods to store and access data, such as InnoDB, Memory, etc. It supports
various programming languages, which means it can interact with many applications and
frameworks written in PHP, Java, Python, Node.js, Perl, etc. It has a rich set of features, such
stored procedures, triggers, views, indexes, full-text search, replication, partitioning, etc.
SYSTEM CONFIGURATION
CHAPTER 3
SYSTEM DESIGN
CLASS DIAGRAM
SEQUENCE DIAGRAM
SYSTEM DESIGN
Input Design:
Input design involves converting user-originated input into a computer-based format, ensuring
data acceptance for computer processing. It's a critical part of overall system design, requiring
Output Design:
Output design focuses on producing meaningful output for users, improving system-user
printouts, considering factors like response time requirements and print formats.
Database Design:
Database design involves two levels: Information Level Design, where user requirements are
gathered and a database designed to meet them, and Physical Level Design, where the
Information Level Design is translated into a design for the specific DBMS to be used. The
objectives of database design include ensuring data integrity, data independence, and
organizing data into proper tables and columns to eliminate data redundancy and improve
data organization.
RDBMS represents the database as a collection of relations or tables, where each row
Relationships between tables are established using keys, including Primary Key, Foreign Key,
Super Key, and Candidate Keys, ensuring Entity and Referential Integrity.
Normalization is carried out in several steps, including transforming data into First Normal
Form (1NF), Second Normal Form (2NF), and Third Normal Form (3NF), to eliminate data
information system. It differs from the system flowchart as it shows the flow of data through
The DFD a way of expressing the system in a graphical format in a modular design was
developed by Larry Constrains. This DFD is also known as "Bubble Chart" has the purpose to
classify the system requirement and to identify the major information that will be a program
in system design.
A Data Flow Diagram is logical model of the system and shows the flow of the data and the
flow of logic so this all thing describes what takes place in a proposed system, not how the
We have noted that the DFD describes what the flow is rather then how they are. processed,
so it means the DFD doesn't depend on the hardware, software, data structure or file
organization.
DFD consist of a series of symbols joined together by a line. There may be a single DFD for
software engineering to visually represent the structure and relationships within a system. It
illustrates the classes, their attributes, methods, and associations, providing a blueprint for
object-oriented design.
Classes serve as blueprints for objects, encapsulating data and behavior. Attributes represent
the characteristics of a class, while methods denote the actions it can perform. Associations
highlight connections between classes, revealing how they collaborate. Multiplicity indicates
the cardinality of associations, defining how many instances of one class are related to
another.
classes and their shared characteristics. Interfaces outline contracts for classes to implement,
Overall, class diagrams enhance communication among development teams, offering a visual
provides a detailed visual representation of the interactions and chronological order of events
within the system. The diagram captures the dynamic aspects of the AMS, showcasing the
flow of messages and actions between various entities involved in the attendance
management process.
The primary actors in the system include students, teachers, and the AMS itself. The sequence
diagram begins with a student initiating the attendance process by logging into the system.
Upon successful authentication, the student's attendance details are retrieved from the system,
reflecting a message exchange between the student and the AMS. Subsequently, the teacher,
another key actor, accesses the system to mark attendance. This action triggers a sequence of
events where the system updates the attendance records and notifies relevant parties, such as
The sequence diagram also illustrates error-handling scenarios, like unsuccessful login
Overall, the sequence diagram acts as a valuable tool for stakeholders, providing a clear
understanding of the interaction flow and dependencies within the online Attendance
Management System.
CHAPTER 4
IMPLEMENTATION
CODING
Login.php
<!DOCTYPE html>
<html lang="en">
<?php
session_start();
include('./db_connect.php');
ob_start();
if(!isset($_SESSION['system'])){
$system = $conn->query("SELECT * FROM system_settings limit 1")->fetch_array();
foreach($system as $k => $v){
$_SESSION['system'][$k] = $v;}
}
ob_end_flush();
?>
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title><?php echo $_SESSION['system']['name'] ?></title>
<?php include('./header.php'); ?>
<?php
if(isset($_SESSION['login_id']))
header("location:index.php?page=home");?>
</head>
<style>
body {
font-family: Arial, sans-serif;
background:linear-gradient(to right,#F89880,#088f8f);
text-align: center;
margin-top: 100px;}
main#main{
width:100%;
height: calc(100%);
display: flex;
}</style>
<body><center>
<main id="main">
<div class="align-self-center w-100">
<h4class="text-whitetext-center"><b><?phpecho $_SESSION['system']['name'] ?></b></h4>
<div id="login-center"row justify-content-center"><div class="card col-md-4">
<div class="card-body"><form id="login-form"><div class="form-group">
<label for="username" class="control-label">Username</label>
<input type="text" id="username" name="username" class="form-control"></div>
<div class="form-group">
<label for="password" class="control-label">Password</label>
<input type="password" id="password" name="password" class="form-control"></div>
</center>
<center><button class="btn-sm btn-block btn-wave col-md-4
btn-primary">Login</button></center></form></div></div></div></div>
</main><a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>
</body>
<script>
$('#login-form').submit(function(e){e.preventDefault()
$('#login-form button[type="button"]').attr('disabled',true).html('Logging in...');
if($(this).find('.alert-danger').length > 0 )
$(this).find('.alert-danger').remove();
$.ajax({
url:'ajax.php?action=login',
method:'POST',
data:$(this).serialize(),error:err=>{
console.log(err)
$('#login-form button[type="button"]').removeAttr('disabled').html('Login');
},success:function(resp){
if(resp == 1){
location.href ='index.php?page=home';
}else{
$('#login-form').prepend('<div class="alert alert-danger">Username or password is
incorrect.</div>')
$('#login-form button[type="button"]').removeAttr('disabled').html('Login');}}
})
})</script>
</html>
Dashboard.php
<?php include 'db_connect.php' ?>
<style>
span.float-right.summary_icon {
font-family: Arial,gerogia;
background:linear-gradient(to right,#F89880,#088f8f);
text-align: center;
margin-top: 100px;
font-size: 3rem;
position: absolute;
right: 1rem;
top: 0;}
.imgs{
margin: .5em;
max-width: calc(100%);
max-height: calc(100%);
}
.imgs img{
max-width: calc(100%);
max-height: calc(100%);
cursor: pointer;}
#imagesCarousel,#imagesCarousel .carousel-inner,#imagesCarousel .carousel-item{
height: 60vh !important;background: black;}
#imagesCarousel .carousel-item.active{
display: flex !important;}
#imagesCarousel .carousel-item-next{
display: flex !important;}
#imagesCarousel .carousel-item img{
margin: auto;}
#imagesCarousel img{
background-image:url(“C:\Users\Raghul\Pictures\Camera Roll\2.jpg");
background-size:cover;
background-repeat:no-repeat;
width: auto!important;
height: auto!important;
max-height: calc(100%)!important;
max-width: calc(100%)!important;}
</style><div class="containe-fluid">
<div class="row mt-3 ml-3 mr-3">
<div class="col-lg-12"><div class="card">
<div class="card-body">
<h3><?php echo "Online Attendance Management System" ?></h3><br><br><br>
<?php echo "Welcome back ". $_SESSION['login_name']."!" ?><hr></div></div>
</div></div></div><script>
$('#manage-records').submit(function(e){
e.preventDefault()
start_load()
$.ajax({ url:'ajax.php?action=save_track',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp)
resp=JSON.parse(resp)
if(resp.status==1){
alert_toast("Data successfully saved",'success')
setTimeout(function(){
location.reload()
},800)}
}})
})
$('#tracking_id').on('keypress',function(e){
if(e.which == 13){
get_person()}
})
$('#check').on('click',function(e){get_person()
}) function get_person(){
start_load()
$.ajax({
url:'ajax.php?action=get_pdetails'
method:"POST",
data:{tracking_id : $('#tracking_id').val()},
success:function(resp){
if(resp){resp = JSON.parse(resp)if(resp.status == 1){
$('#name').html(resp.name)$('#address').html(resp.address)$
('[name="person_id"]').val(resp.id) $('#details').show()end_load() }else if(resp.status == 2){
alert_toast("Unknow tracking id.",'danger'); end_load() } } }
})}
</script>
Course.php
<?php include('db_connect.php');?>
<div class="container-fluid"><div class="col-lg-12"><div class="row">
<!-- FORM Panel --><div class="col-md-4">
<form action="" id="manage-course"><div class="card">
<div class="card-header">Course Form</div><div class="card-body">
<input type="hidden" name="id"><div id="msg"></div>
<div class="form-group">
<label class="control-label">Course</label>
<input type="text" class="form-control" name="course"></div><div class="form-group">
<label class="control-label">Description</label>
<textarea name="description" id="" cols="30" rows="4"
class="formcontrol"></textarea></div></div>
<div class="card-footer"><div class="row"><div class="col-md-12">
<button class="btn btn-sm btn-primary col-sm-3 offset-md-3"> Save</button>
<button class="btn btn-sm btn-default col-sm-3" type="reset"> Cancel</button>
</div></div></div></div></form></div>
<!-- FORM Panel -->
<!-- Table Panel -->
<div class="col-md-8"><div class="card">
<div class="card-header"><b>Course List</b></div><div class="card-body">
<table class="table table-bordered table-hover">
<thead><tr><th class="text-center" width="5%">#</th><th class="text-center">Course</th>
<th class="text-center" width="25%">Action</th>
</tr></thead><tbody><?php$i = 1;
$course = $conn->query("SELECT * FROM courses order by id asc");
while($row=$course->fetch_assoc()):?><tr>
<td class="text-center"><?php echo $i++ ?></td>
<td class=""><p><b><?php echo ucwords($row['course']) ?></b></p>
<small><i><?php echo $row['description'] ?></i></small>
</td><td class="text-center">
<button class="btn btn-sm btn-primary edit_course" type="button" data-id="<?php echo
$row['id'] ?>" data-course="<?php echo $row['course'] ?>" data-description="<?php echo
$row['description'] ?>">Edit</button>
<button class="btn btn-sm btn-danger delete_course" type="button" data-id="<?php echo
$row['id'] ?>">Delete</button>
</td></tr>
<?php endwhile; ?></tbody>
</table></div></div></div>
<!-- Table Panel -->
</div></div></div>
<style>
body {
font-family: Arial, sans-serif;
background:linear-gradient(to right,#F89880,#088f8f);
text-align: center;
margin-top: 100px;
}td{
vertical-align: middle !important;
}
td p {
margin: unset;
}
</style>
<script>
$('#manage-course').on('reset',function(){
$('#msg').html('')
$('input:hidden').val('')
})
$('#manage-course').submit(function(e){
e.preventDefault()
$('#msg').html('')
start_load()
$.ajax({
url:'ajax.php?action=save_course',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
alert_toast("Data successfully saved",'success')
setTimeout(function(){
location.reload()
},1500)
}else if(resp == 2){
$('#msg').html('<div class="alert alert-danger mx-2">Course already exist.</div>')
end_load()
}}})})
$('.edit_course').click(function(){
start_load()
var cat = $('#manage-course')
cat.get(0).reset()
cat.find("[name='id']").val($(this).attr('data-id'))
cat.find("[name='course']").val($(this).attr('data-course'))
cat.find("[name='description']").val($(this).attr('data-description'))
end_load()
})
$('.delete_course').click(function(){
_conf("Are you sure to delete this course?","delete_course",[$(this).attr('data-id')])
})
function delete_course($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_course',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)}}})}
$('table').dataTable()
</script>
Class.php
<?php include('db_connect.php');?>
<div class="container-fluid">
<div class="col-lg-12"><div class="row">
<!-- FORM Panel --><div class="col-md-4">
<form action="" id="manage-class"><div class="card">
<div class="card-header">Class Form</div>
<div class="card-body"><input type="hidden" name="id"><div id="msg"></div>
<select name="course_id" id="course_id" class="custom-select select2">
<option value=""></option><?php
$course = $conn->query("SELECT * FROM courses order by course asc");
while($row=$course->fetch_assoc()):?>
<option value="<?php echo $row['id'] ?>"><?php echo $row['course'] ?></option>
<?php endwhile; ?></select><div class="form-group">
<label class="control-label">Level</label>
<input type="text" class="form-control" name="level"></div><div class="form-group">
<label class="control-label">Section</label><input type="text" class="form-control"
name="section"></div></div><div class="card-footer"><div class="row">
<div class="col-md-12">
<button class="btn btn-sm btn-primary col-sm-3 offset-md-3"> Save</button>
<button class="btn btn-sm btn-default col-sm-3" type="reset"> Cancel</button></div></div>
</div></div></form></div><!-- FORM Panel -->
<!-- Table Panel --><div class="col-md-8"><div class="card"><div class="card-header">
<b>Class List</b></div><div class="card-body"><table class="table table-bordered table-
hover">
<thead><tr><th class="text-center" width="5%">#</th>
<th class="text-center">Class</th>
<th class="text-center" width="25%">Action</th></tr></thead><tbody><?php$i = 1;$class
= $conn->query("SELECT c.*,concat(co.course,' ',c.level,'-',c.section) as `class` FROM
`class` c inner join courses co on co.id = c.course_id order by concat(co.course,'
',c.level,'-',c.section) asc");while($row=$class->fetch_assoc()):?><tr><td class="text-
center"><?php echo $i++ ?></td><td class="">
<p><b><?php echo $row['class'] ?></b></p></td>
<td class="text-center">
<button class="btn btn-sm btn-primary edit_class" type="button" data-id="<?php echo
$row['id'] ?>" data-course_id="<?php echo $row['course_id'] ?>" data-level="<?php echo
$row['level'] ?>" data-section="<?php echo $row['section'] ?>">Edit</button>
<button class="btn btn-sm btn-danger delete_class" type="button" data-id="<?php echo
$row['id'] ?>">Delete</button>
</td></tr>
<?php endwhile; ?></tbody>
</table></div></div></div>
<!-- Table Panel --></div></div></div><style>
body {
font-family: Arial, sans-serif;
background:linear-gradient(to right,#F89880,#088f8f);
text-align: center;
margin-top: 100px;
}td{
vertical-align: middle !important;
}
td p {
margin: unset;
}
</style><script>
$('#manage-class').on('reset',function(){
$('#msg').html('')
$('input:hidden').val('')
$('.select2').val('').trigger('change')
})
$('#manage-class').submit(function(e){
e.preventDefault()
$('#msg').html('')
start_load()
$.ajax({
url:'ajax.php?action=save_class',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
alert_toast("Data successfully saved",'success')
setTimeout(function(){
location.reload()
},1500)}else if(resp == 2){
$('#msg').html('<div class="alert alert-danger mx-2">Class already exist.</div>')
end_load()
}}})})
$('.edit_class').click(function(){
start_load()
var cat = $('#manage-class')
cat.get(0).reset()
cat.find("[name='id']").val($(this).attr('data-id'))
cat.find("[name='course_id']").val($(this).attr('data-course_id')).trigger('change')
cat.find("[name='level']").val($(this).attr('data-level'))
cat.find("[name='section']").val($(this).attr('data-section'))
end_load()
})$('.delete_class').click(function(){
_conf("Are you sure to delete this class?","delete_class",[$(this).attr('data-id')])})
function delete_class($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_class',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)}}
})}
$('table').dataTable()
</script>
Class_subject.php
<?php include('db_connect.php');?>
<div class="container-fluid"><div class="col-lg-12">
<div class="row mb-4 mt-4">
<div class="col-md-12"></div></div>
<div class="row">
<!-- FORM Panel -->
<!-- Table Panel --><div class="col-md-12"><div class="card">
<div class="card-header">
<b>List of Class per Subject</b>
<span class="float:right"><a class="btn btn-primary btn-block btn-sm col-sm-2 float-right"
href="javascript:void(0)" id="new_class_subject">
<i class="fa fa-plus"></i> New Entry</a></span></div><div class="card-body">
<table class="table table-condensed table-bordered table-hover">
<thead><tr><th class="text-center">#</th>
<th class="">Class</th><th class="">Subject</th>
<th class="">Faculty</th>
<th class="text-center">Action</th></tr>
</thead><tbody><?php
$i = 1;
$class_subject = $conn->query("SELECT cs.*,concat(co.course,' ',c.level,'-',c.section) as
`class`,s.subject,f.name as fname FROM class_subject cs inner join `class` c on c.id =
cs.class_id inner join courses co on co.id = c.course_id inner join faculty f on f.id =
cs.faculty_id inner join subjects s on s.id = cs.subject_id order by concat(co.course,'
',c.level,'-',c.section) asc");while($row=$class_subject->fetch_assoc())?><tr>
<td class="text-center"><?php echo $i++ ?></td><td>
<p><b><?php echo $row['class'] ?></b></p>/td>
<td class="">
<p><b><?php echo $row['subject'] ?></b></p>
</td><td class="">
<p><b><?php echo $row['fname'] ?></b></p>
</td>
<td class="text-center">
<button class="btn btn-sm btn-outline-primary edit_class_subject" type="button" data-id="<?
php echo $row['id'] ?>">Edit</button>
<button class="btn btn-sm btn-outline-danger delete_class_subject" type="button" data-
id="<?php echo $row['id'] ?>">Delete</button>
</td></tr>
<?php endwhile; ?>
</tbody>
</table>
</div></div></div>
<!-- Table Panel --></div></div>
</div>
<style>
body {
font-family: Arial, sans-serif;
background:linear-gradient(to right,#F89880,#088f8f);
text-align: center;
margin-top: 100px;}
td{
vertical-align: middle !important
}td p{
margin: unset}
img{
max-width:100px;
max-height: :150px;
}
</style>
<script>
$(document).ready(function(){
$('table').dataTable()
})
$('#new_class_subject').click(function(){
uni_modal("New Entry","manage_class_subject.php","")
})
$('.edit_class_subject').click(function(){
uni_modal("Manage Entry Details","manage_class_subject.php?id="+$(this).attr('data-id'),"")
})
$('.delete_class_subject').click(function(){
_conf("Are you sure to delete this class subject?","delete_class_subject",[$(this).attr('data-
id')])})
function delete_class_subject($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_class_subject',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)}}})}
</script>
Manage_class_subject.php
<?php
include 'db_connect.php';
if(isset($_GET['id'])){
$qry = $conn->query("SELECT * FROM class_subject where id= ".$_GET['id']);
foreach($qry->fetch_array() as $k => $val){$$k=$val;
}
}
?>
<div class="container-fluid">
<form action="" id="manage-class_subject">
<input type="hidden" name="id" value="<?php echo isset($id) ? $id : '' ?>">
<div id="msg" class="form-group"></div>
<div class="form-group">
<label for="" class="control-label">Class</label>
<select name="class_id" id="" class="custom-select select2">
<option value=""></option><?php
$class = $conn->query("SELECT c.*,concat(co.course,' ',c.level,'-',c.section) as `class`
FROM `class` c inner join courses co on co.id = c.course_id order by concat(co.course,'
',c.level,'-',c.section) asc");while($row=$class->fetch_assoc()):?>
<option value="<?php echo $row['id'] ?>"<?php echo isset($class_id) && $class_id ==
$row['id'] ? 'selected' : '' ?>><?php echo $row['class'] ?></option>
<?php endwhile; ?></select></div>
<div class="form-group">
<label for="" class="control-label">Faculty</label>
<select name="faculty_id" id="" class="custom-select select2">
<option value=""></option>
<?php
$class = $conn->query("SELECT * FROM faculty order by name asc");
while($row=$class->fetch_assoc()):
?><option value="<?php echo $row['id'] ?>"<?php echo isset($faculty_id) && $faculty_id
== $row['id'] ? 'selected' : '' ?>><?php echo ucwords($row['name']) ?></option><?php
endwhile; ?></select></div><div class="form-group">
<label for="" class="control-label">Subject</label>
<select name="subject_id" id="" class="custom-select select2">
<option value=""></option>
<?php
$class = $conn->query("SELECT * FROM subjects order by subject asc")
while($row=$class->fetch_assoc()):?>
<option value="<?php echo $row['id'] ?>"<?php echo isset($subject_id) && $subject_id ==
$row['id'] ? 'selected' : '' ?>><?php echo ucwords($row['subject']) ?></option><?php
endwhile; ?</select></div></form>
</div>
<script>$('#manage-class_subject').on('reset',function(){
$('#msg').html('')
$('input:hidden').val('') })
$('#manage-class_subject').submit(function(e){
e.preventDefault()
start_load()
$('#msg').html('')
$.ajax({
url:'ajax.php?action=save_class_subject',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
alert_toast("Data successfully saved.",'success')
setTimeout(function(){
location.reload()
},1000)
}else if(resp == 2){
$('#msg').html('<div class="alert alert-danger mx-2">Data already exist.</div>')
end_load()
}}
})
})
$('.select2').select2({
placeholder:"Please Select here",
width:'100%'})
</script>
Faculty.php
<?php include('db_connect.php');?>
<div class="container-fluid">
<div class="col-lg-12">
<div class="row mb-4 mt-4"><div class="col-md-12"></div>
</div><div class="row">
<!-- FORM Panel -->
<!-- Table Panel -->
<div class="col-md-12"><div class="card">
<div class="card-header">
<b>List of Faculty</b>
<span class="float:right"><a class="btn btn-primary btn-block btn-sm col-sm-2 float-right"
href="javascript:void(0)" id="new_faculty">
<i class="fa fa-plus"></i> New Faculty</a></span>
</div><div class="card-body">
<table class="table table-condensed table-bordered table-hover">
<thead><tr><th class="text-center">#</th>
<th class="">ID #</th><th class="">Name</th>
<th class="">Email</th></tr></thead><tbody>
<?php
$i = 1;
$faculty = $conn->query("SELECT * FROM faculty order by name desc ");
while($row=$faculty->fetch_assoc()):?>
<tr><td class="text-center"><?php echo $i++ ?></td>
<td><p><b><?php echo $row['id_no'] ?></b></p>
</td><td>
<p><b><?php echo ucwords($row['name']) ?></b></p>
</td><td class="">
<p><b><?php echo $row['email'] ?></b></p>
</td><td class="">
<p><b><?php echo $row['contact'] ?></b></p></td><td class="">
<p><b><?php echo $row['address'] ?></b></p>
</td><td class="text-center">
<button class="btn btn-sm btn-outline-primary edit_faculty" type="button" data-id="<?php
echo $row['id'] ?>">Edit</button>
<button class="btn btn-sm btn-outline-danger delete_faculty" type="button" data-id="<?php
echo $row['id'] ?>">Delete</button></td></tr>
<?php endwhile; ?></tbody></table>
</div></div></div><!-- Table Panel -->
</div></div> </div>
<style>
body {
font-family: Arial, sans-serif;
background:linear-gradient(to right,#F89880,#088f8f);
text-align: center;
margin-top: 100px;
}
td{
vertical-align: middle !important;}
td p{
margin: unset
}img{
max-width:100px;
max-height: :150px;
}
</style><script>
$(document).ready(function(){
$('table').dataTable()
})$('#new_faculty').click(function(){
uni_modal("New faculty","manage_faculty.php","mid-large")
})$('.view_payment').click(function(){
uni_modal("facultys Payments","view_payment.php?id="+$(this).attr('data-id'),"large") })
$('.edit_faculty').click(function(){
uni_modal("Manage faculty Details","manage_faculty.php?id="+$(this).attr('data-id'),"mid-
large")})
$('.delete_faculty').click(function(){
_conf("Are you sure to delete this faculty?","delete_faculty",[$(this).attr('data-id')])
})
function delete_faculty($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_faculty',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()},1500)}
}})}
</script>
Manage_faculty.php
<?php
include 'db_connect.php';
if(isset($_GET['id'])){
$qry = $conn->query("SELECT * FROM faculty where id= ".$_GET['id']);
foreach($qry->fetch_array() as $k => $val){
$$k=$val;
}
}
?>
<div class="container-fluid"><form action="" id="manage-faculty">
<input type="hidden" name="id" value="<?php echo isset($id) ? $id : '' ?>">
<div id="msg" class="form-group"></div>
<div class="form-group">
<label for="" class="control-label">ID #</label>
<input type="text" class="form-control" name="id_no" value="<?php echo isset($id_no) ?
$id_no :'' ?>" required>
</div><div class="form-group">
<label for="" class="control-label">Name</label>
<input type="text" class="form-control" name="name" value="<?php echo isset($name) ?
$name :'' ?>" required></div><div class="form-group">
<label for="" class="control-label">Email</label>
<input type="text" class="form-control" name="email" value="<?php echo isset($email) ?
$email :'' ?>" required></div></form></div>
<script>
$('#manage-faculty').on('reset',function(){
$('#msg').html('')
$('input:hidden').val('')})
$('#manage-faculty').submit(function(e){
e.preventDefault()
start_load()
$('#msg').html('')
$.ajax({
url:'ajax.php?action=save_faculty',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
alert_toast("Data successfully saved.",'success')setTimeout(function(){
location.reload()
},1000)
}else if(resp == 2){
$('#msg').html('<div class="alert alert-danger mx-2">ID # already exist.</div>')
end_load()
}}
})})
</script>
Student.php
<?php include('db_connect.php');?>
<div class="container-fluid">
<div class="col-lg-12">
<div class="row mb-4 mt-4">
<div class="col-md-12"></div></div>
<div class="row">
<!-- FORM Panel -->
<!-- Table Panel -->
<div class="col-md-12">
<div class="card">
<div class="card-header">
<b>List of Student</b>
<span class="float:right"><a class="btn btn-primary btn-block btn-sm col-sm-2 float-right"
href="javascript:void(0)" id="new_student">
<i class="fa fa-plus"></i> New Student</a></span></div>
<div class="card-body">
<table class="table table-condensed table-bordered table-hover">
<thead><tr><th class="text-center">#</th>
<th class="">ID #</th>
<th class="">Name</th>
<th class="">Class</th>
<th class="text-center">Action</th>
</tr></thead><tbody><?php
$i = 1;$student = $conn->query("SELECT s.*,concat(co.course,' ',c.level,'-',c.section) as
`class` FROM students s inner join `class` c on c.id = s.class_id inner join courses co on co.id
= c.course_id order by s.name desc ");
while($row=$student->fetch_assoc()):?>
<tr>
<td class="text-center"><?php echo $i++ ?></td>
<td>
<p><b><?php echo $row['id_no'] ?></b></p>
</td><td><p><b><?php echo ucwords($row['name']) ?></b></p></td><td class="">
<p><b><?php echo $row['class'] ?></b></p></td>
<td class="text-center">
<button class="btn btn-sm btn-outline-primary edit_student" type="button" data-id="<?php
echo $row['id'] ?>">Edit</button>
<button class="btn btn-sm btn-outline-danger delete_student" type="button" data-id="<?php
echo $row['id'] ?>">Delete</button>
</td></tr><?php endwhile; ?></tbody></table>
</div></div></div><!-- Table Panel --></div></div></div>
<style>
body {
font-family: Arial, sans-serif;
background:linear-gradient(to right,#F89880,#088f8f);
text-align: center;
margin-top: 100px;
}td{
vertical-align: middle !important;
}
td p{
margin: unset
}img{
max-width:100px;
max-height: :150px;
}
</style>
<script>
$(document).ready(function(){
$('table').dataTable()
})
$('#new_student').click(function(){
uni_modal("New student","manage_student.php","")
})
$('.edit_student').click(function(){
uni_modal("Manage student Details","manage_student.php?id="+$(this).attr('data-id'),"mid-
large")
})$('.delete_student').click(function(){
_conf("Are you sure to delete this student?","delete_student",[$(this).attr('data-id')])
})function delete_student($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_student',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)}}
})}
</script>
Manage_student.php
<?php
include 'db_connect.php';
if(isset($_GET['id'])){
$qry = $conn->query("SELECT * FROM students where id= ".$_GET['id']);
foreach($qry->fetch_array() as $k => $val){
$$k=$val;
}}
?>
<div class="container-fluid">
<form action="" id="manage-student">
<input type="hidden" name="id" value="<?php echo isset($id) ? $id : '' ?>">
<div id="msg" class="form-group"></div>
<div class="form-group">
<label for="" class="control-label">ID #</label>
<input type="text" class="form-control" name="id_no" value="<?php echo isset($id_no) ?
$id_no :'' ?>" required></div>
<div class="form-group">
<label for="" class="control-label">Name</label>
<input type="text" class="form-control" name="name" value="<?php echo isset($name) ?
$name :'' ?>" required>
</div>
<div class="form-group">
<label for="" class="control-label">Class</label>
<select name="class_id" id="" class="custom-select select2">
<option value=""></option>
<?php
$class = $conn->query("SELECT c.*,concat(co.course,' ',c.level,'-',c.section) as `class`
FROM `class` c inner join courses co on co.id = c.course_id order by concat(co.course,'
',c.level,'-',c.section) asc");
while($row=$class->fetch_assoc()):
?>
<option value="<?php echo $row['id'] ?>"<?php echo isset($class_id) && $class_id ==
$row['id'] ? 'selected' : '' ?>><?php echo $row['class'] ?></option>
<?php endwhile; ?>
</select></div></form></div><script>
$('#manage-student').on('reset',function(){
$('#msg').html('')
$('input:hidden').val('')
})
$('#manage-student').submit(function(e){
e.preventDefault()
start_load()
$('#msg').html('')
$.ajax({
url:'ajax.php?action=save_student',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
alert_toast("Data successfully saved.",'success')
setTimeout(function(){
location.reload()
},1000)
}else if(resp == 2){
$('#msg').html('<div class="alert alert-danger mx-2">ID # already exist.</div>')
end_load()
}}
})
}) $('.select2').select2({
placeholder:"Please Select here",
width:'100%'})
</script>
Attendance_record.php
<?php include 'db_connect.php' ?>
<div class="container-fluid"><div class="col-lg-12"><div class="card">
<div class="card-header"><b>Attendance Record's</b></div>
<div class="card-body"><form id="manage-attendance">
<input type="hidden" name="id" value="">
<div class="row justify-content-center">
<label for="" class="mt-2">Class per Subjects</label>
<div class="col-sm-4">
<select name="class_subject_id" id="class_subject_id" class="custom-select select2 input-
sm"><option value=""></option>
<?php
$class = $conn->query("SELECT cs.*,concat(co.course,' ',c.level,'-',c.section) as
`class`,s.subject,f.name as fname FROM class_subject cs inner join `class` c on c.id =
cs.class_id inner join courses co on co.id = c.course_id inner join faculty f on f.id =
cs.faculty_id inner join subjects s on s.id = cs.subject_id ".($_SESSION['login_faculty_id'] ?
" where f.id = {$_SESSION['login_faculty_id']} ":"")." order by concat(co.course,'
',c.level,'-',c.section) asc");
while($row=$class->fetch_assoc()): ?>
<option value="<?php echo $row['id'] ?>" data-cid="<?php echo $row['id'] ?>"<?php echo
isset($class_subject_id) && $class_subject_id == $row['id'] ? 'selected' : '' ?>><?php echo
$row['class'].' '.$row['subject']. ' [ '.$row['fname'].' ]' ?></option><?php endwhile;
?></select></div><div class="col-sm-3"><input type="date" name="doc" id="doc"
value="<?php echo date('Y-m-d') ?>" class="form-control">
</div><div class="col-sm-2">
<button class="btn btn-primary" type="button" id="filter">Filter</button></div></div><hr>
<div class="row"><div class="col-md-12" id='att-list'>
<center><b><h4><i>Please Select Class First.</i></h4></b></center></div>
<div class="col-md-12" style="display: none" id="submit-btn-field"><center>
<button class="btn btn-primary btn-sm col-sm-3" type="button" id="edit_att"><i class="fa
fa-edit" data-id=''></i> Edit</button>
<button class="btn btn-success btn-sm col-sm-3" type="button" id="print_att"><i class="fa
fa-print"></i> Print</button></center></div></div></form></div>
</div></div></div>
<div id="table_clone" style="display: none">
<table width="100%"><tr><td width="50%">
<p>Course: <b class="course"></b></p>
<p>Subject: <b class="subject"></b></p>
</td><td width="50%"><p>Class: <b class="class"></b></p>
<p>Date of Class: <b class="doc"></b></p></td></tr></table>
<table class='table table-bordered table-hover att-list'><thead>
<tr><th class="text-center" width="5%">#</th>
<th width="20%">Student</th><th>Attendance</th></tr></thead><tbody></tbody>
</table></div>
<div id="chk_clone" style="display: none">
<div class="d-flex justify-content-center chk-opts">
<div class="form-check form-check-inline">
<input class="form-check-input present-inp" type="checkbox" value="1" readonly="">
<label class="form-check-label present-lbl">Present</label></div>
<div class="form-check form-check-inline">
<input class="form-check-input absent-inp" type="checkbox" value="0" readonly="">
<label class="form-check-label absent-lbl">Absent</label></div>
<div class="form-check form-check-inline">
<input class="form-check-input late-inp" type="checkbox" value="2" readonly="">
<label class="form-check-label late-lbl">Late</label></div></div></div>
<style>
.present-inp,.absent-inp,.late-inp,.present-lbl,.absent-lbl,.late-lbl{
cursor: pointer;
}
body {
font-family: Arial, sans-serif;
background:linear-gradient(to right,#F89880,#088f8f);
text-align: center;
margin-top: 100px;
}
</style>
<noscript><style>
table.att-list{
width:100%;
border-collapse:collapse
}table.att-list td,table.att-list th{
border:1px solid
}.text-center{
text-align:center
}</style>
</noscript>
<script>$('#filter').click(function(){
start_load()
$.ajax({
url:'ajax.php?action=get_att_record',
method:'POST',
data:{class_subject_id:$('#class_subject_id').val(),doc:$('#doc').val()},
success:function(resp){
if(resp){
resp = JSON.parse(resp)
var _table = $('#table_clone').clone()
$('#att-list').html('')
$('#att-list').append(_table)
var _type = ['Absent','Present','Late'];
var data = !!resp.data ? resp.data : [];
var record = !!resp.record ? resp.record : [];
var attendance_id = !!resp.attendance_id ? resp.attendance_id : '';
if(Object.keys(data).length > 0){
var i = 1;Object.keys(data).map(function(k){
var name = data[k].name;
var id = data[k].id;
var tr = $('<tr></tr>')
//opts.find('.present-inp').attr({'name':'type['+id+']','id':'present_'+id})
// opts.find('.absent-inp').attr({'name':'type['+id+']','id':'absent_'+id})
// opts.find('.late-inp').attr({'name':'type['+id+']','id':'late_'+id})
// opts.find('.present-lbl').attr({'for':'present_'+id})
// opts.find('.absent-lbl').attr({'for':'absent_'+id})
// opts.find('.late-lbl').attr({'for':'late_'+id})
tr.append('<td class="text-center">'+(i++)+'</td>')
tr.append('<td class="">'+(name)+'</td>')
var td = '<td>';
td += '<input type="hidden" name="student_id['+id+']" value="'+id+'">';
td += !!record[k].type ? _type[record[k].type] : '';
td += '</td>';tr.append(td)
_table.find('table.att-list tbody').append(tr)})$('#submit-btn-field').show()
$('#edit_att').attr('data-id',attendance_id)
}else{var tr = $('<tr></tr>')
tr.append('<td class="text-center" colspan="3">No data.</td>')
_table.find('table.att-list tbody').append(tr)
$('#submit-btn-field').attr('data-id','').hide()
$('#edit_att').attr('data-id','')} $('#att-list').html('')
_table.find('.course').text(!!resp.details.course ? resp.details.course : '')
_table.find('.subject').text(!!resp.details.subject ? resp.details.subject : '')
_table.find('.class').text(!!resp.details.class ? resp.details.class : '')
_table.find('.doc').text(!!resp.details.doc ? resp.details.doc : '')
$('#att-list').append(_table.html())
if(Object.keys(record).length > 0){
Object.keys(record).map(k=>{
// console.log('[name="type['+record[k].student_id+']"][value="'+record[k].type+'"]')
$('#attlist').find('[name="type['+record[k].student_id+']"]
[value="'+record[k].type+'"]').prop('checked',true)})}
}},complete:function(){
$("input[readonly]").on('keyup keypress change',function(e){
e.preventDefault()
return false;
});$('#edit_att').click(function(){
location.href = 'index.php?page=check_attendance&attendance_id='+$(this).attr('data-id')})
end_load()}})})
$('#manage-attendance').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'ajax.php?action=save_attendance',
method:'POST',
data:$(this).serialize(),
success:function(resp){
if(resp==1){
alert_toast("Data successfully saved.",'success')
setTimeout(function(){
location.reload()
},1000)
}else if(resp ==2){
alert_toast("Class already has an attendance record with the slected subject and
date.",'danger')
end_load();
}
}
})
})
$('#print_att').click(function(){
var _c = $('#att-list').html();
var ns = $('noscript').clone();
var nw = window.open('','_blank','width=900,height=600')
nw.document.write(_c)
nw.document.write(ns.html())
nw.document.close()
nw.print()
setTimeout(() => {
nw.close()
}, 500);
})
</script>
Attendance_report.php
<?php include 'db_connect.php' ?>
<div class="container-fluid"><div class="col-lg-12">
<div class="card">
<div class="card-header"><b>Attendance Report</b></div>
<div class="card-body">
<form id="manage-attendance">
<input type="hidden" name="id" value="">
<div class="row justify-content-center">
<label for="" class="mt-2">Class per Subjects</label>
<div class="col-sm-4">
<select name="class_subject_id" id="class_subject_id" class="custom-select select2 input-
sm">
<option value=""></option>
<?php
$class = $conn->query("SELECT cs.*,concat(co.course,' ',c.level,'-',c.section) as
`class`,s.subject,f.name as fname FROM class_subject cs inner join `class` c on c.id =
cs.class_id inner join courses co on co.id = c.course_id inner join faculty f on f.id =
cs.faculty_id inner join subjects s on s.id = cs.subject_id ".($_SESSION['login_faculty_id'] ?
" where f.id = {$_SESSION['login_faculty_id']} ":"")." order by concat(co.course,'
',c.level,'-',c.section) asc");
while($row=$class->fetch_assoc()):?>
<option value="<?php echo $row['id'] ?>" data-cid="<?php echo $row['id'] ?>"<?php echo
isset($class_subject_id) && $class_subject_id == $row['id'] ? 'selected' : '' ?>><?php echo
$row['class'].' '.$row['subject']. ' [ '.$row['fname'].' ]' ?></option>
<?php endwhile; ?>
</select></div><label for="" class="mt-2">Month of</label><div class="col-sm-3">
<input type="month" name="doc" id="doc" value="<?php echo date('Y-m') ?>" class="form-
control"></div><div class="col-sm-2">
<button class="btn btn-primary" type="button"
id="filter">Filter</button></div></div><hr><div class="row"><div class="col-md-12"
id='att-list'><center><b><h4><i>Please Select Class First.</i></h4></b></center></div>
<div class="col-md-12" style="display: none" id="submit-btn-field">
<center><button class="btn btn-success btn-sm col-sm-3" type="button" id="print_att"><i
class="fa fa-print"></i> Print</button>
</center></div></div></form></div></div></div></div>
<div id="table_clone" style="display: none"><table width="100%"><tr>
<td width="50%">
<p>Course: <b class="course"></b></p>
<p>Subject: <b class="subject"></b></p>
<p>Total Days of Classes: <b class="noc"></b></p></td><td width="50%"><p>Class: <b
class="class"></b></p><p>Month of: <b class="doc"></b></p></td></tr></table>
<table class='table table-bordered table-hover att-list'><thead><tr>
<th class="text-center" width="5%">#</th><th width="20%">Student</th><th>Present</th>
<th>Late</th><th>Absent</th></tr></thead><tbody></tbody></table></div>
<div id="chk_clone" style="display: none">
<div class="d-flex justify-content-center chk-opts">
<div class="form-check form-check-inline">
<input class="form-check-input present-inp" type="checkbox" value="1" readonly="">
<label class="form-check-label present-lbl">Present</label></div>
<div class="form-check form-check-inline">
<input class="form-check-input absent-inp" type="checkbox" value="0" readonly="">
<label class="form-check-label absent-lbl">Absent</label></div>
<div class="form-check form-check-inline">
<input class="form-check-input late-inp" type="checkbox" value="2" readonly="">
<label class="form-check-label late-lbl">Late</label></div></div></div><style>
.present-inp,.absent-inp,.late-inp,.present-lbl,.absent-lbl,.late-lbl{
cursor: pointer;}
body {
font-family: Arial, sans-serif;
background:linear-gradient(to right,#F89880,#088f8f);
text-align: center;
margin-top: 100px;
}</style><noscript><style>table.att-list{
width:100%;
border-collapse:collapse
}table.att-list td,table.att-list th{border:1px solid}
.text-center{
text-align:center
}</style></noscript><script>
$('#filter').click(function(){start_load()$.ajax({
url:'ajax.php?action=get_att_report',
method:'POST',
data:{class_subject_id:$('#class_subject_id').val(),doc:$('#doc').val()},
success:function(resp){
if(resp){
resp = JSON.parse(resp)
var _table = $('#table_clone').clone()
$('#att-list').html('')
$('#att-list').append(_table)
var _type = ['Absent','Present','Late'];
var data = !!resp.data ? resp.data : [] ;
var record = !!resp.record ? resp.record :[];
var attendance_id = !!resp.attendance_id ? resp.attendance_id : 0;
if(Object.keys(data).length > 0){var i = 1;
Object.keys(data).map(function(k){var name = data[k].name;var id = data[k].id;
var tr = $('<tr></tr>')
// opts.find('.present-inp').attr({'name':'type['+id+']','id':'present_'+id})
// opts.find('.absent-inp').attr({'name':'type['+id+']','id':'absent_'+id})
// opts.find('.late-inp').attr({'name':'type['+id+']','id':'late_'+id})
// opts.find('.present-lbl').attr({'for':'present_'+id})
// opts.find('.absent-lbl').attr({'for':'absent_'+id})
// opts.find('.late-lbl').attr({'for':'late_'+id})
var present=0;
var late=0;
var absent=0;
console.log(Object.keys(record).length)
// record = JSON.parse(record)
if(Object.keys(record).length > 0){
if(record[id].length > 0){
Object.keys(record[id]).map(i=>{
if(record[id][i].type == 0)
absent = parseInt(absent) + 1;
if(record[id][i].type == 1)
present = parseInt(present) + 1;
if(record[id][i].type == 2)
late = parseInt(late) + 1;
})}}
tr.append('<td class="text-center">'+(i++)+'</td>')
tr.append('<td class="">'+(name)+'</td>')
var td = '<td class="text-center">';
td += present;td += '</td>';td += '<td class="text-center">';td += late;td += '</td>';
td += '<td class="text-center">';td += absent;td += '</td>';tr.append(td)
_table.find('table.att-list tbody').append(tr)
})$('#submit-btn-field').show()$('#edit_att').attr('data-id',attendance_id)}else{
var tr = $('<tr></tr>')
tr.append('<td class="text-center" colspan="5">No data.</td>')
_table.find('table.att-list tbody').append(tr)
$('#submit-btn-field').attr('data-id','').hide()
$('#edit_att').attr('data-id','')
}$('#att-list').html('')
_table.find('.course').text(!!resp.details.course ? resp.details.course : '')
_table.find('.subject').text(!!resp.details.subject ? resp.details.subject : '')
_table.find('.class').text(!!resp.details.class ? resp.details.class : '')
_table.find('.doc').text(!!resp.details.doc ? resp.details.doc : '')
_table.find('.noc').text(!!resp.details.noc ? resp.details.noc : '')
_table.find('.noc').text(!!resp.details.noc ? resp.details.noc : '')
$('#att-list').append(_table.html())
if(Object.keys(record).length > 0){
Object.keys(record).map(k=>{
// console.log('[name="type['+record[k].student_id+']"][value="'+record[k].type+'"]')
$('#attlist').find('[name="type['+record[k].student_id+']"]
[value="'+record[k].type+'"]').prop('checked',true)
})}}},
complete:function(){
$("input[readonly]").on('keyup keypress change',function(e){
e.preventDefault()
return false;
});$('#edit_att').click(function(){
location.href = 'index.php?page=check_attendance&attendance_id='+$(this).attr('data-id')})
end_load()}})})
$('#manage-attendance').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'ajax.php?action=save_attendance',
method:'POST',
data:$(this).serialize(),
success:function(resp){
if(resp==1){
alert_toast("Data successfully saved.",'success')
setTimeout(function(){
location.reload()
},1000)
}else if(resp ==2){
alert_toast("Class already has an attendance record with the slected subject and
date.",'danger')
end_load();
}})})
$('#print_att').click(function(){
var _c = $('#att-list').html();
var ns = $('noscript').clone();
var nw = window.open('','_blank','width=900,height=600')
nw.document.write(_c)
nw.document.write(ns.html())
nw.document.close()
nw.print()
setTimeout(() => {nw.close()
}, 500);
})</script>
Check_attendence.php
<?php include 'db_connect.php' ?>
<?php
if(isset($_GET['attendance_id'])){
// echo "SELECT * FROM attendance_list where id = {$_GET['attendance_id']}";
$qry = $conn->query("SELECT * FROM attendance_list where id =
{$_GET['attendance_id']}");
foreach($qry->fetch_array() as $k => $v){
$$k = $v;}}?>
<div class="container-fluid"><div class="col-lg-12"><div class="card"><div class="card-
header"><b>Check Attendance</b></div><div class="card-body">
<form id="manage-attendance">
<input type="hidden" name="id" value="<?php echo isset($id) ? $id : '' ?>">
<div class="row justify-content-center">
<label for="" class="mt-2">Class per Subjects</label><div class="col-sm-4">
<select name="class_subject_id" id="class_subject_id" class="custom-select select2 input-
sm"><option value=""></option>
<?php
$class = $conn->query("SELECT cs.*,concat(co.course,' ',c.level,'-',c.section) as
`class`,s.subject,f.name as fname FROM class_subject cs inner join `class` c on c.id =
cs.class_id inner join courses co on co.id = c.course_id inner join faculty f on f.id =
cs.faculty_id inner join subjects s on s.id = cs.subject_id ".($_SESSION['login_faculty_id'] ?
" where f.id = {$_SESSION['login_faculty_id']} ":"")." order by concat(co.course,'
',c.level,'-',c.section) asc");while($row=$class->fetch_assoc()):
?><option value="<?php echo $row['id'] ?>" data-cid="<?php echo $row['id'] ?>"<?php echo
isset($class_subject_id) && $class_subject_id == $row['id'] ? 'selected' :
(isset($class_subject_id) && $class_subject_id == $row['id'] ? 'selected' :'') ?>><?php echo
$row['class'].' '.$row['subject']. ' [ '.$row['fname'].' ]' ?></option>
<?php endwhile; ?></select></div><div class="col-sm-3">
<input type="date" name="doc" value="<?php echo isset($doc) ? date('Y-m-
d',strtotime($doc)) :date('Y-m-d') ?>" class="form-control"></div></div><hr><div
class="row"><div class="col-md-12" id='att-list'>
<center><b><h4><i>Please Select Class First.</i></h4></b></center></div>
<div class="col-md-12" style="display: none" id="submit-btn-field"><center>
<button class="btn btn-primary btn-sm col-sm-5">Save</button>
</center></div></div></form></div></div></div></div>
<div id="table_clone" style="display: none">
<table class='table table-bordered table-hover'><thead><tr><th>#</th><th>Student</th>
<th>Attendance</th></tr></thead><tbody></tbody></table></div>
<div id="chk_clone" style="display: none">
<div class="d-flex justify-content-center chk-opts">
<div class="form-check form-check-inline">
<input class="form-check-input present-inp" type="checkbox" value="1">
<label class="form-check-label present-lbl">Present</label></div>
<div class="form-check form-check-inline">
<input class="form-check-input absent-inp" type="checkbox" value="0">
<label class="form-check-label absent-lbl">Absent</label></div>
<div class="form-check form-check-inline">
<input class="form-check-input late-inp" type="checkbox" value="2">
<label class="form-check-label late-lbl">Late</label></div></div></div><style>
.present-inp,.absent-inp,.late-inp,.present-lbl,.absent-lbl,.late-lbl{
cursor: pointer;}
body {
font-family: Arial, sans-serif;
background:linear-gradient(to right,#F89880,#088f8f);
text-align: center;
margin-top: 100px;
}</style><script>
$(document).ready(function(){
if('<?php echo isset($class_subject_id) ? 1 : 0 ?>' == 1){
start_load()
$.ajax({
url:'ajax.php?action=get_class_list',
method:'POST',
data:{class_subject_id:$('#class_subject_id').val(),doc:$('#doc').val(),att_id :'<?php echo
isset($id) ? $id : '' ?>' },
success:function(resp){
if(resp){
resp = JSON.parse(resp)
var _table = $('#table_clone table').clone()
$('#att-list').html('')
$('#att-list').append(_table)
var _type = ['Absent','Present','Late'];
var data = resp.data;
var record = resp.record;
var attendance_id = !!resp.attendance_id ? resp.attendance_id : '';
if(Object.keys(data).length > 0){
var i = 1;
Object.keys(data).map(function(k){
var name = data[k].name;
var id = data[k].id;
var tr = $('<tr></tr>')
var opts = $('#chk_clone').clone()
opts.find('.present-inp').attr({'name':'type['+id+']','id':'present_'+id})
opts.find('.absent-inp').attr({'name':'type['+id+']','id':'absent_'+id})
opts.find('.late-inp').attr({'name':'type['+id+']','id':'late_'+id})
opts.find('.present-lbl').attr({'for':'present_'+id})
opts.find('.absent-lbl').attr({'for':'absent_'+id})
opts.find('.late-lbl').attr({'for':'late_'+id})
tr.append('<td class="text-center">'+(i++)+'</td>')
tr.append('<td class="">'+(name)+'</td>')
var td = '<td>';
td += '<input type="hidden" name="student_id['+id+']" value="'+id+'">';td += opts.html();td
+= '</td>';tr.append(td)_table.find('tbody').append(tr)})$('#submit-btn-field').show()
$('#edit_att').attr('data-id',attendance_id)}else{var tr = $('<tr></tr>')
tr.append('<td class="text-center" colspan="3">No data.</td>')
_table.find('tbody').append(tr)
$('#submit-btn-field').attr('data-id','').hide()
$('#edit_att').attr('data-id','')}
$('#att-list').html('')
$('#att-list').append(_table)
if(Object.keys(record).length > 0){
Object.keys(record).map(k=>{
// console.log('[name="type['+record[k].student_id+']"][value="'+record[k].type+'"]')
$('#attlist').find('[name="type['+record[k].student_id+']"]
[value="'+record[k].type+'"]').prop('checked',true)})}}},
complete:function(){
$("input:checkbox").on('keyup keypress change',function(){
var group = "input:checkbox[name='"+$(this).attr("name")+"']";
$(group).prop("checked",false);
$(this).prop("checked",true);});
$('#edit_att').click(function(){
location.href = 'index.php?page=check_attendance&attendance_id='+$(this).attr('data-id')
})end_load()}})}})
$('#class_subject_id').change(function(){
get_data($(this).val())})
window.get_data = function(id){
start_load()$.ajax({
url:'ajax.php?action=get_class_list',
method:'POST',
data:{class_subject_id:id},
success:function(resp){if(resp){
resp = JSON.parse(resp)
var _table = $('#table_clone table').clone()
$('#att-list').html('')
$('#att-list').append(_table)
if(Object.keys(resp).length > 0){
var i = 1;
Object.keys(resp.data).map(function(k){
var name = resp.data[k].name;
var id = resp.data[k].id;
var tr = $('<tr></tr>')
var opts = $('#chk_clone').clone()
opts.find('.present-inp').attr({'name':'type['+id+']','id':'present_'+id})
opts.find('.absent-inp').attr({'name':'type['+id+']','id':'absent_'+id})
opts.find('.late-inp').attr({'name':'type['+id+']','id':'late_'+id})
opts.find('.present-lbl').attr({'for':'present_'+id})
opts.find('.absent-lbl').attr({'for':'absent_'+id})
opts.find('.late-lbl').attr({'for':'late_'+id})
tr.append('<td class="text-center">'+(i++)+'</td>')
tr.append('<td class="">'+(name)+'</td>')
var td = '<td>';td += '<input type="hidden" name="student_id['+id+']" value="'+id+'">';
td += opts.html();
td += '</td>';
tr.append(td)_table.find('tbody').append(tr)
})$('#submit-btn-field').show()}else{var tr = $('<tr></tr>')
tr.append('<td class="text-center" colspan="3">No data.</td>')
_table.find('tbody').append(tr)$('#submit-btn-field').hide()}$('#att-list').html('')
$('#att-list').append(_table)}},complete:function(){
$("input:checkbox").on('keyup keypress change',function(){
// console.log(test)
var group = "input:checkbox[name='"+$(this).attr("name")+"']";
$(group).prop("checked",false);
$(this).prop("checked",true);
});end_load()}})}
$('#manage-attendance').submit(function(e){e.preventDefault()
start_load()
$.ajax({
url:'ajax.php?action=save_attendance',
method:'POST',
data:$(this).serialize(),
success:function(resp){
if(resp==1){
alert_toast("Data successfully saved.",'success')
setTimeout(function(){
location.reload()
},1000)
}else if(resp ==2){
alert_toast("Class already has an attendance record with the slected subject and
date.",'danger')
end_load();}}})})
</script>
User.php
<?php
?><div class="container-fluid"><div class="row"><div class="col-lg-12">
<button class="btn btn-primary float-right btn-sm" id="new_user"><i class="fa fa-plus"></i>
New user</button></div></div><br><div class="col-lg-12"><div class="card ">
<div class="card-header"><b>User List</b></div><div class="card-body">
<table class="table-striped table-bordered"><thead><tr>
<th class="text-center">#</th><th class="text-center">Name</th><th class="text-
center">Username</th><th class="text-center">Type</th><th
class="text-center">Action</th></tr></thead><tbody><?phpinclude 'db_connect.php';
$type = array("","Admin","Staff","Alumnus/Alumna");
$users = $conn->query("SELECT * FROM users order by name asc");
$i = 1;while($row= $users->fetch_assoc()):?><tr><td class="text-center"><?php echo $i++ ?
></td><td><?php echo ucwords($row['name']) ?></td>
<td><?php echo $row['username'] ?></td><td>
<?php echo $type[$row['type']] ?></td><td><center>
<div class="btn-group">
<button type="button" class="btn btn-primary btn-sm">Action</button>
<button type="button" class="btn btn-primary btn-sm dropdown-toggle dropdown-toggle-
split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button><div class="dropdown-menu"><a class="dropdown-item edit_user"
href="javascript:void(0)" data-id = '<?php echo $row['id'] ?>'>Edit</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item delete_user" href="javascript:void(0)" data-id = '<?php echo
$row['id'] ?>'>Delete</a>
</div></div></center>
</td></tr><?php endwhile; ?>
</tbody></table></div></div></div></div>
<style>
body {
font-family: Arial, sans-serif;
background:linear-gradient(to right,#F89880,#088f8f);
text-align: center;
margin-top: 100px;
}</style><script>
$('table').dataTable();
$('#new_user').click(function(){
uni_modal('New User','manage_user.php')})
$('.edit_user').click(function(){
uni_modal('Edit User','manage_user.php?id='+$(this).attr('data-id'))})
$('.delete_user').click(function(){
_conf("Are you sure to delete this user?","delete_user",[$(this).attr('data-id')])})
function delete_user($id){start_load()
$.ajax({
url:'ajax.php?action=delete_user',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)}}})}
</script>
Manage_user.php
<?php
include('db_connect.php');
session_start();if(isset($_GET['id'])){
$user = $conn->query("SELECT * FROM users where id =".$_GET['id']);
foreach($user->fetch_array() as $k =>$v){$meta[$k] = $v;}
}?><div class="container-fluid">
<div id="msg"></div><form action="" id="manage-user">
<input type="hidden" name="id" value="<?php echo isset($meta['id']) ? $meta['id']: '' ?>">
<div class="form-group">
<label for="name">Name</label>
<input type="text" name="name" id="name" class="form-control" value="<?php echo
isset($meta['name']) ? $meta['name']: '' ?>" required></div><div class="form-group">
<label for="username">Username</label><input type="text" name="username"
id="username" class="form-control" value="<?php echo isset($meta['username']) ?
$meta['username']: '' ?>" required autocomplete="off"></div><div class="form-group">
<label for="password">Password</label>
<input type="password" name="password" id="password" class="form-control" value=""
autocomplete="off"><?php if(isset($meta['id'])): ?>
<small><i>Leave this blank if you dont want to change the password.</i></small>
<?php endif; ?></div><?php if(isset($meta['type']) && $meta['type'] == 3): ?>
<input type="hidden" name="type" value="3"><?php else: ?><?phpif(!
isset($_GET['mtype'])): ?><div class="form-group">
<label for="type">User Type</label>
<select name="type" id="type" class="custom-select">
<option value="2"<?php echo isset($meta['type']) && $meta['type'] == 2 ? 'selected': '' ?
>>Staff</option>
<option value="1"<?php echo isset($meta['type']) && $meta['type'] == 1 ? 'selected':'' ?
>>Admin</option>
</select></div><?php endif; ?><?php endif; ?>
</form></div><script>
$('#manage-user').submit(function(e){e.preventDefault();
start_load()
$.ajax({
url:'ajax.php?action=save_user',
method:'POST',
data:$(this).serialize(),
success:function(resp){
if(resp ==1){
alert_toast("Data successfully saved",'success')
setTimeout(function(){
location.reload()
},1500)
}else{
$('#msg').html('<div class="alert alert-danger">Username already exist</div>')
end_load()}}})})
</script>
CHAPTER 5
TESTING
UNIT TESTING
INTEGRATION TESTING
ALPHA TESTING
BETA TESTING
TESTING
SYSTEM TESTING:
System testing is a critical aspect of Software Quality Assurance and represents the ultimate
review of specification, design and coding. Testing is a process of executing a program with
the intent of finding an error. A good test is one that has a probability of finding an as yet
undiscovered error. The purpose of testing is to identify and correct bugs in the developed
system. Nothing is complete without testing. Testing is the vital to the success of the system.
In the code testing the logic of the developed system is tested. For this every module of the
program is executed to find an error. To perform specification test, the examination of the
specifications stating what the program should do and how it should perform under various
conditions.
testing focuses first on the modules in the proposed system to locate errors. This enables to
detect errors in the coding and logic that are contained within that module alone. Those
resulting from the interaction between modules are initially avoided. In unit testing step each
module has to be checked separately.
System testing does not test the software as a whole, but rather than integration of each
module in the system. The primary concern is the compatibility of individual modules. One
has to find areas where modules have been designed with different specifications of data
lengths, type and data element name.
Testing and validation are the most important steps after the implementation of the developed
system. The system testing is performed to ensure that there are no errors in the implemented
system. The software must be executed several times in order to find out the errors in the
different modules of the system.
UNIT TESTING
A Unit Testing corresponds to a screen /form in the package. Unit testing focuses on
verification of the corresponding class or Screen. This testing includes testing of control
paths, interfaces, local data structures, logical decisions, boundary conditions, and error
handling. Unit testing may use Test Drivers, which are control programs to co- ordinate test
case inputs and outputs, and Test stubs, which replace low-level modules. A stub is a dummy
subprogram.
Unit testing for an online Attendance Management System (AMS) involves the systematic
evaluation of individual units or components of the system to ensure their correctness,
reliability, and functionality in isolation. In the context of an AMS project, unit testing is
essential for validating the behavior of specific code segments, functions, or modules,
providing developers with confidence in the reliability of the system's building blocks.
For an AMS, unit testing would encompass testing various aspects of the system's
functionality independently. This includes validating the user authentication module,
confirming that it accurately verifies user credentials and enforces access controls.
Additionally, unit tests for the attendance tracking functionality would ensure that attendance
data is correctly recorded, updated, and retrieved.
The notification system, responsible for sending alerts or reminders, would undergo unit
testing to verify that messages are triggered appropriately, reaching the intended recipients
without errors. Unit testing of reporting functionalities involves ensuring that the system
generates accurate and meaningful reports based on specified parameters.
Unit tests for error-handling mechanisms are crucial, ensuring that the system gracefully
handles unexpected scenarios such as network failures or database errors. By testing each unit
in isolation, developers can identify and address issues early in the development process,
leading to a more robust and reliable AMS.
The primary focus of integration testing in an AMS is to confirm that data flows accurately
between different components. This includes testing the communication pathways between
the user interface, attendance tracking module, database, notification system, and any external
integrations.
For instance, the integration between the user interface and the backend should be thoroughly
tested to verify that user inputs, such as marking attendance or generating reports, are
correctly processed and stored in the database. This ensures that user interactions result in
accurate and reliable data updates.
Database integration testing is crucial to confirm that the AMS interacts correctly with the
underlying database, maintaining data consistency and integrity. It involves validating the
handling of data retrieval, storage, and updates to guarantee the accuracy of attendance
records.
Further more, integration testing for external services, such as email notifications or
authentication systems, ensures that these integrations function seamlessly with the AMS.
Verifying the end-to-end communication between the AMS and external services helps
prevent issues related to data synchronization, access control, and user communication.
During alpha testing, the primary focus is on validating the core features of the AMS. This
includes rigorous testing of attendance tracking functionalities, user authentication, reporting
capabilities, and any other critical components that form the backbone of the system. The goal
is to identify and address any potential issues, such as bugs, usability concerns, or
performance bottlenecks, to ensure that the system meets the specified requirements.
Usability is a key aspect of alpha testing for an AMS. Evaluating the user interface design,
navigation, and overall user experience helps ensure that the system is intuitive and user-
friendly. Feedback collected from alpha testers can be invaluable in refining the user interface
and addressing any usability challenges before the system is deployed more widely.
Security is another critical focus during alpha testing. The AMS undergoes scrutiny to
identify and mitigate potential security vulnerabilities, ensuring that sensitive attendance data
is adequately protected and that the system adheres to established security standards and
protocols.
Additionally, alpha testing provides an opportunity to assess the system's scalability and
performance under realistic conditions. This involves testing the AMS with a representative
number of users to ensure that it can handle the expected load without compromising
performance or responsiveness.
BETA TESTING
Beta testing for an online Attendance Management System (AMS) is a crucial phase in the
software development lifecycle where the system is released to a limited group of external
users to gather feedback and identify potential issues before a full-scale deployment. In the
context of an AMS project, beta testing involves providing access to a select group of end-
users who represent the system's intended audience, allowing them to interact with the system
in real-world scenarios.
During beta testing, the primary goal is to collect valuable insights from users regarding the
system's usability, functionality, and overall performance. This phase serves as a bridge
between internal testing (such as alpha testing) and the final release, providing an opportunity
to address any unforeseen issues that may not have been apparent during earlier testing stages.
Beta testers typically explore various aspects of the AMS, including user authentication,
attendance tracking, reporting functionalities, and any other features relevant to their use.
Feedback from beta testers helps uncover usability concerns, identify potential bugs or
glitches, and assess the system's overall user satisfaction.
One of the key benefits of beta testing for an AMS is the diversity of the user base. Beta
testers may have different roles, responsibilities, and perspectives, providing a more
comprehensive view of how the system performs in real-world scenarios. This diverse
feedback is invaluable for making refinements and improvements to ensure the system aligns
with the varied needs of its users.
Security is also a focal point during beta testing. The system is scrutinized for any potential
vulnerabilities or data security concerns that may not have been apparent in earlier testing
phases. This helps fortify the AMS against potential threats and ensures the protection of
sensitive attendance data.
In summary, beta testing for an online Attendance Management System involves the
controlled release of the system to external users, allowing for real-world evaluation and
feedback. This iterative process contributes to the refinement and optimization of the AMS
before its full-scale deployment, enhancing its overall quality and user satisfaction.
CHAPTER 6
BIBLOGRAPH
REFERENCE
https://www.youtube.com/
www.google.com
www.javatpoint.com
www.tutorialspoint.com
www.guru99.com
https://www.youtube.com/watch?v=rQJNHkEdlx8
www.inettutor.com