1
MOBILE BASED ATTENDANCESYSTEM
Submitted by:
Abhishek Kumar
Abhishek Kumar Jha
Akhil Kumar Panday
Amardeep Prakash
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
DR.B.C.ROY ENGINEERING COLLEGE, DURGAPUR-713206
MAY 2019
2
MOBILE BASED ATTENDANCESYSTEM
For the partial fulfillment of the requirement to award the degree
Of
Bachelor of Technology
In
Computer Science and Engineering
by
Abhishek Kumar 12000115007
Abhishek Kumar Jha 12000115010
Akhil Kumar Panday 12000115013
Amardeep Prakash 12000115016
Supervisor: Dr. Bappaditya Das
---------------------------------------
DEPARTMENT OF COMPUTERSCIENCE AND ENGINEERING
DR.B.C.ROY ENGINEERING COLLEGE, DURGAPUR-713206
MAY 2019
3
DEPARTMENT OF COMPUTERSCIENCE AND ENGINEERING
Dr.B.C.ROY ENGINEERING COLLEGE, DURGAPUR-713206,WB.
DECLARATION
We declare that this written submission represents my ideas in my own words and where others’
ideas or words have been included, we have adequately cited and referenced the original sources.
We also declare that we have adhered to all principles of academic honesty and integrity and have
not misrepresented or fabricated or falsified any idea/data/fact/source in my submission. We
understand that any violation of the above will because for disciplinary action by the Institute and
can also evoke penal action from the sources which have thus not been properly cited or from whom
proper permission has not been taken when needed.
----------------------------------------------------------
Abhishek Kumar (12000115007)
Abhishek Kumar Jha (12000115010)
Akhil Kumar Panday (12000115013)
Amardeep Prakash (12000115016)
----------------------------------------------
4
DEPARTMENT OF COMPUTERSCIENCE AND ENGINEERING
Dr.B.C.ROY ENGINEERING COLLEGE, DURGAPUR-713206,WB.
RECOMMENDATION
This is to recommend that the work undertaken in this report “Mobile BasedAttendance
System” has been carried out by “Abhishek Kumar, Abhishek Kumar Jha, Akhil Kumar
Panday, Amardeep Prakash,” under my supervision and guidance during the academic year
2018-19. This may be accepted in partial fulfilment of the requirements for the award of the
degree of Bachelor of Technology (Computer Science and Engineering).
---------------------------------
Dr. Bappaditya Das
Supervisor
-----------------------------
Dr. Chandan Koner
Head of the CSE Department
5
DEPARTMENTOF COMPUTERSCIENCEAND ENGINEERING
Dr.B.C.ROY ENGINEERING COLLEGE, DURGAPUR-713206,WB.
APPROVAL
This project report entitled “Mobile BasedAttendance System ” has been carried out by
“Abhishek Kumar, Abhishek Kumar Jha, Akhil Kumar Panday, Amardeep Prakash”is
approved for the degree of B.tech in Computer Science and Engineering.
Examiners
Dr. Bappaditya Das
(Supervisor)
Dr.Chandan Koner
(HOD CSE)
Project coordinator
Date ----------
Time _____________
6
DEPARTMENT OF COMPUTERSCIENCE AND ENGINEERING
Dr.B.C.ROY ENGINEERING COLLEGE, DURGAPUR-713206,WB.
ACKNOWELEDGEMENT
With great pleasure and deep sense of gratitude, we convey our indebtedness to our respected
teacher Dr. Bappaditya Das for his inspiring guidance, constructive criticism and valuable
suggestions throughout the project work. We sincerely thanks to our friends who have patiently
extended all sorts of help for accomplishing this work.
Abhishek Kumar
Abhishek Kumar Jha
Akhil Kumar Panday
Amardeep Prakash
7
ABSTRACT
Now a days, it is highly possible to adapt mobile computing in various applications. The
portability, open source nature of smart phones and android development platform has made the
development of application software for various environments as handy. Smartphone applications
are resulted in paper less work, easy to use and time saving in nature. The wireless
communication technology of smart phone enables the information transfer from the current client
to remote database server, where ever the network range is available
The Attendance Management System is a mobile computing software application, which focusses
on an activity or function, which is based on management information system of academic
institutions. In this work, the systems functionalities are categorized as a group and the similarities
in grouped functionalities are designed and developed with reuse of software components.
8
CONTENTS
TOPIC PAGE NUMBER
1. INTRODUCTION
1.1. Problem Definition
1.2. ProjectOverview
1.3. Hardware Required
1.4. Software Required
9
10
11
2. LITERATURE SURVEY
2.1. Existing System
2.2. ProposedSystem
2.3. FeasibilityStudy
12
13
3. PROJECT DESIGN
3.1. E-R Diagram
3.2. Use Case Diagram
3.3. Activity Diagram
3.4. DFD
3.5. Snapshots
3.6. Coding
3.7. Testing
3.8. Advantages of Project
3.9. DisadvantagesofProject
14
15
16-18
19-21
22-26
27-52
53
56
57
4. CONCLUSION 58
5. BIBLIOGRAPHY 60
9
1. INTRODUCTION
In the current scenario of various educational institutions to manage and maintaining student
information is very tough task for any one. The whole academic record of the student information
consist of monitoring their performance and progress changes periodically which is very huge
workload on lecturers to handle and keep on updating the progress report of each and every
student in against of their respective scheduled classes. The traditional way of taking attendance
through the lecturers is a manually in a register book in which they are used to do a manual
calculation to maintain monthly attendance database of the students. Such system takes so much
time to generate record and many times its creates an error also as it follow manual traditional
system
1.1. Problem Definition
Apart from this error problems some time many more problems are generated like lost of
attendance register book or manually fake data inserted through unknown recourses which are
really not authorized for that work. In order to reduce all these problems and concern overcome
through this problem, a smart mobile based application is generated to increase its efficiency
as well as its security by sending all information about the students to the authorized web based
admin panel server as it linked in the proposed mobile application. It is a beneficial step in
every way for our future E-schools.
It consist of five modules such as admin controlling, teachers authentication, student
authentication, displaying digital register, submitting final report to the given admin web based
server. This android based application used by the teacher to login and through its subject id
and class id display the digital register for the particular class students and finally submit it to
the authorized admin panel. As it already defined that the admin panel is totally web based
secured web site which is authorized to make changes in any of the database of the students as
well as the teachers
10
Therefore, it is crucial to reinforce the use of the mobile based attendance application to register
system in order to improve the traditional process of recording and reporting the student’s
attendance in the higher educational organizations
1.2.PROJECTOVERVIEW
All the above systems are time consuming and unsafe. In the proposed project Android based
attendance system is designed which is less time consuming, safe and easy to implement
because-
User Friendly: - This software is user friendly as it is simple to use and the user doesn’t need
any special training to use this software. Data evaluation, data storing and retrieval is easy and
doesn’t need any heavy calculation or method. The UI is simple and easy to understand.
Easy and Fast report generation: Reports are generated automatically fast in an easy way
after each month for the teacher to keep a track on the students attendance record and notify
the students with minimum attendance to attend classes.
Minimal paper work: There is no paper work required. Data are stored automatically in the
system. Evaluation are done automatically. Hence it is cost effective too.
Time Saving: Data storing, data retrieval, data evaluation is done at minimum time hence it is
time saving producing data with minimal errors.
1.3. Hardware Requirement
Processor : All compatible
Memory : minimum 512mb RAM
Network : internet connection
11
Others : mouse, keyboard, system
1.4. Software Requirement
Platform : All compatible
Framework : Android
12
2. LITERATURE SURVEY
2.1. Existing System
Todayfaculty take attendance through pen paper based with is the oldest method of
taking attendance. In has many cons and it limit the access of seeing and tracking
students overall attendance
Problem with current scenario
In the present system all work is done on paper. The whole session attendance is
stored in register and at the and of the sessionthe 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’thave 75% attendance get a notice.
Limitations of Present System
2.2. ProposedSystem
The purposeof developing attendance management system is to computerized the
tradition way of taking attendance. Another purposefor developing this software is
to generate the report automatically at the end of the session or in the between of the
session
Features:
 User friendly
 Reports are easily generated
 Very less paper work
 Computer Operator Control
13
2.3. FEASIBILITY STUDY
This system is feasible because of the following reasons:
Economically Feasibility: This software is economic from school or colleges point of view.
It is cost effective as use of paper has been eliminated .It is time effective since evaluation of
attendance and report generation is done in less amount of time with minimal errors.
Technical feasibility: This software is technically feasible since there are no extra hardware
requirements. The only requirement is an android smartphone with minimum version 4.2 jelly
Bean.
Behavioral Feasibility: This software is very simple to use. The user doesn’t need any special
training to use this software. The software has been designed keeping the users point of view
14
3. PROJECT DESIGN
3.1. E-R Diagram
15
3.2. Use Case Diagram
16
3.3. Activity Diagram
17
3.2.2 StudentActivity Diagram
18
19
3.4. DFD
20
21
22
3.5. SNAPSHOTS
SPLASH SCREEN MAIN PAGE
23
FACULTY LOGIN ADMIN LOGIN
24
25
26
27
3.6. CODING
JAVA CODE
Homepage
package com.frost.attendance;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
public class homepage extends AppCompatActivity {
Button btnNotice,btnFaculty,btnAdmin,btnStudent;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_homepage);
btnNotice= (Button)findViewById(R.id.btnnotice);
btnAdmin=(Button)findViewById(R.id.btnadmin);
btnFaculty=(Button)findViewById(R.id.btnfaculty);
btnStudent=(Button)findViewById(R.id.btnstudent);
btnNotice.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(homepage.this,Notice.class);
startActivity(intent);
}
});
btnAdmin.setOnClickListener(new View.OnClickListener() {
28
@Override
public void onClick(View view) {
Intent i1= new Intent(homepage.this,AdminLoginScreen.class);
startActivity(i1);
}
});
btnFaculty.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i2= new Intent(homepage.this,FacultyLoginScreen.class);
startActivity(i2);
}
});
btnStudent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i3=new Intent(homepage.this,StudentLogin.class);
startActivity(i3);
}
});
}
}
ADMIN LOGIN SCREEN
package com.frost.attendance;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
29
import android.widget.EditText;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
public class AdminLoginScreen extends AppCompatActivity {
private EditText editTextusername, editTextpassword;
private Button btnadminlogin;
// private ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin_login_screen);
/* if(SharedPrefManager.getInstance(this).isLoggedIn()) {
finish();
startActivity(new Intent(this, adminmanager.class));
return;
} */
editTextusername = (EditText) findViewById(R.id.txtemailid);
editTextpassword = (EditText) findViewById(R.id.txtpassword);
btnadminlogin = (Button) findViewById(R.id.btnlogin);
btnadminlogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
30
loginadmin();
}
});
// progressDialog.setMessage("Please Wait...");
}
private void loginadmin() {
final String username = editTextusername.getText().toString().trim();
final String emailid = editTextusername.getText().toString().trim();
final String password = editTextpassword.getText().toString().trim();
// progressDialog.show();
StringRequest stringRequest = new StringRequest(
Request.Method.POST,
Constants.URL_LOGIN,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
// progressDialog.dismiss();
try {
JSONObject obj = new JSONObject(response);
if (!obj.getBoolean("error")) {
SharedPrefManager.getInstance(getApplicationContext())
.userLogin(
obj.getInt("adminid"),
obj.getString("username"),
obj.getString("emailid")
);
startActivity(new Intent(getApplicationContext(), adminmanager.class));
Toast.makeText(getApplicationContext(),"Login
Succesfull",Toast.LENGTH_LONG).show();
finish();
} else {
Toast.makeText(
getApplicationContext(),
"Invalid Username or Password",
Toast.LENGTH_LONG
31
).show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
//progressDialog.dismiss();
Toast.makeText(getApplicationContext(),error.getMessage(),Toast.LENGTH_LONG).show();
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<>();
params.put("username", username);
params.put("password", password);
return params;
}
};
RequestHandler.getInstance(this).addToRequestQueue(stringRequest);
}
}
ADD FACULTY
package com.frost.attendance;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
32
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
public class addfaculty extends AppCompatActivity {
private EditText txtfacultyname, txtfacultyusername, txtfacultyemailid, txtmobileno,
txtfacultyadd, txtfacultypass;
private Button btnsubmit;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_addfaculty);
/* if(SharedPrefManager.getInstance(this).isLoggedIn()){
finish();
startActivity(new Intent(this, AdminLoginScreen.class));
return;
} */
txtfacultyname = (EditText) findViewById(R.id.txtfacultyname);
txtfacultyusername = (EditText) findViewById(R.id.txtfacultyusername);
txtfacultyemailid = (EditText) findViewById(R.id.txtfacultyemailid);
txtmobileno = (EditText) findViewById(R.id.txtmobileno);
txtfacultyadd = (EditText) findViewById(R.id.txtfacultyadd);
33
txtfacultypass = (EditText) findViewById(R.id.txtfacultypass);
btnsubmit = (Button) findViewById(R.id.btnsubmit);
btnsubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
registerfaculy();
// Toast.makeText(getApplicationContext(),"login success",
Toast.LENGTH_LONG).show();
}
});
}
private void registerfaculy() {
final String name = txtfacultyname.getText().toString().trim();
final String username = txtfacultyusername.getText().toString().trim();
final String email = txtfacultyemailid.getText().toString().trim();
final String mobileno = txtmobileno.getText().toString().trim();
final String address = txtfacultyadd.getText().toString().trim();
final String password = txtfacultypass.getText().toString().trim();
StringRequest stringRequest = new StringRequest(Request.Method.POST,
Constants.URL_REGISTER,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
// progressDialog.dismiss();
try {
JSONObject jsonObject = new JSONObject(response);
Toast.makeText(getApplicationContext(), jsonObject.getString("message"),
Toast.LENGTH_LONG).show();
} catch (JSONException e) {
e.printStackTrace();
}
}
},
34
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
// progressDialog.hide();
Toast.makeText(getApplicationContext(), error.getMessage(),
Toast.LENGTH_LONG).show();
REQUEST HANDLER
package com.frost.attendance;
import android.content.Context;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
public class RequestHandler {
private static RequestHandler mInstance; private RequestQueue mRequestQueue;
private static Context mCtx;
private RequestHandler(Context context) {
mCtx = context;
mRequestQueue = getRequestQueue();
}
public static synchronized RequestHandler getInstance(Context context) {
if (mInstance == null) {
mInstance = new RequestHandler(context);
}
return mInstance;
}
public RequestQueue getRequestQueue() {
if (mRequestQueue == null) {
// getApplicationContext() is key, it keeps you from leaking the
// Activity or BroadcastReceiver if someone passes one in.
mRequestQueue = Volley.newRequestQueue(mCtx.getApplicationContext());
35
}
return mRequestQueue;
}
public <T> void addToRequestQueue(Request<T> req) {
getRequestQueue().add(req);
}
}
SHARED PREFRENCE
package com.frost.attendance;
import android.content.Context;
import android.content.SharedPreferences;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
public class SharedPrefManager {
private static SharedPrefManager mInstance;
private static Context mCtx;
private static final String SHARED_PREF_NAME = "mysharedpref12";
private static final String KEY_USERNAME = "username";
private static final String KEY_USER_EMAIL = "emailid";
private static final String KEY_USER_ID = "adminid";
private SharedPrefManager(Context context) {
mCtx = context;
}
public static synchronized SharedPrefManager getInstance(Context context) {
if (mInstance == null) {
mInstance = new SharedPrefManager(context);
}
36
return mInstance;
}
public boolean userLogin(int adminid, String username, String emailid){
SharedPreferences sharedPreferences =
mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putInt(KEY_USER_ID, adminid);
editor.putString(KEY_USER_EMAIL, emailid);
editor.putString(KEY_USERNAME, username);
editor.apply();
return true;
}
public boolean facultyLogin(int id, String username, String email){
SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME,
Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putInt(KEY_USER_ID, id);
editor.putString(KEY_USER_EMAIL, email);
editor.putString(KEY_USERNAME, username);
editor.apply();
return true;
}
public boolean isLoggedIn(){
SharedPreferences sharedPreferences =
mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
if(sharedPreferences.getString(KEY_USERNAME, null) != null){
return true;
}
return false;
37
}
public boolean logout(){
SharedPreferences sharedPreferences =
mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.clear();
editor.apply();
return true;
}
public String getUsername(){
SharedPreferences sharedPreferences =
mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
return sharedPreferences.getString(KEY_USERNAME, null);
}
public String getUserEmail(){
SharedPreferences sharedPreferences =
mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
return sharedPreferences.getString(KEY_USER_EMAIL, null);
}
}
XML FILE
HOMEPAGE XML CODE
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
38
android:paddingRight="16dp"
tools:context=".homepage"
android:background="@drawable/screenbackground">
<LinearLayout
android:layout_marginTop="60dp"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content">
<Button
android:id="@+id/btnfaculty"
android:background="@mipmap/ic_faculty"
android:layout_width="150dp"
android:layout_height="150dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="FACULTY"
android:textStyle="bold" />
<Button
android:id="@+id/btnadmin"
android:background="@mipmap/ic_admin"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginTop="40dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ADMIN"
39
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:gravity="center"
android:orientation="vertical"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content">
<Button
android:id="@+id/btnstudent"
android:background="@mipmap/ic_student"
android:layout_width="150dp"
android:layout_height="150dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="STUDENT"
android:textStyle="bold" />
<Button
android:id="@+id/btnnotice"
android:background="@mipmap/ic_notice"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginTop="40dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NOTICE"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
40
</RelativeLayout>
PHP CODE
CONNECTION TO DATABASE
<?php
DEFINE('DB_USER','root');
DEFINE('DB_PASS','');
DEFINE('DB_HOST','localhost');
DEFINE('DB_DB','attendance');
DEFINE('EMAIL',1);
DEFINE('PHONE',2);
DEFINE('ROLL',3);
DEFINE('CODE',4);
DEFINE('NAME',5);
DEFINE('NUMBER',6);
function connectTo() {
41
/*
Does -> Connects to data base
Returns -> Connection object
*/
$con = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_DB);
return $con;
}
function sqlReady($input) {
/*
Takes -> Any string
Returns -> Escapes the string
*/
$con = connectTo();
$string = mysqli_real_escape_string($con,$input);
$con->close();
return $string;
}
function hashPass($pass,$rounds = 9) {
/*
Takes -> Password
Returns -> Hashes the password using blow-fish algorithm
*/
42
$salt = "";
$i = -1;
$saltChars = array_merge(range(0,9),range('a','z'),range('A','Z'));
while(++$i < 22)
$salt .= $saltChars[array_rand($saltChars)];
return crypt($pass, sprintf('$2y$%02d$', $rounds) . $salt);
}
function verifyPass($input,$pass) {
/*
Takes -> 2 Password strings
Returns -> true if matches false if doesn't
*/
return crypt($input,$pass) == $pass? true : false ;
}
function respond($as,$what) {
/*
Takes -> key and value
Does -> Dies by printing json_encoded array having the key and value
*/
die(json_encode(array($as=>$what)));
}
function updateSession($email) {
/*
43
Takes -> email
Does -> Updates the SESSION variable as per the email
*/
$con = connectTo();
$exists = $con->query("select * from `attendance`.`teacher` where email = '$email'");
$exists = $exists->fetch_assoc();
$_SESSION['name'] = $exists['name'];
$_SESSION['email'] = $exists['email'];
$_SESSION['phone'] = $exists['phone'];
$_SESSION['teacher_id'] = $exists['uid'];
$_SESSION['classes'] = 0;
$classes = $con->query('select uid from `objects` where teacher_uid =
'.$_SESSION['teacher_id']);
if($classes && $con->affected_rows) {
$cls = array();
while($a = $classes->fetch_array()) {
$cls[] = $a[0];
}
$_SESSION['classes'] = $cls;
}
$con->close();
session_write_close();
}
44
function verify($type,$input) {
/*
Takes -> Type of regex checker and the input
Does -> Computes the regex
Returns -> Returns true and false
*/
$reEmail = '/^([S]+)@([S]+).([S]+)$/';
$rePhone = '/^[0-9]{10}$/';
$reCode = '/^([a-zA-Z]{3}-[0-9]{3})$/';
$reRoll = '/^([0-9]{3})/([a-zA-z]{3})/([0-9]{2})$/';
$reName = '/^[a-zA-Z ']+$/';
$reNum = '/^[0-9]+$/';
$m;
switch($type) {
case EMAIL :
preg_match($reEmail,$input,$m);
break;
case PHONE :
preg_match($rePhone,$input,$m);
break;
case CODE :
preg_match($reCode,$input,$m);
break;
45
case ROLL :
preg_match($reRoll,$input,$m);
break;
case NAME :
preg_match($reName,$input,$m);
break;
case NUMBER :
preg_match($reNum,$input,$m);
break;
}
return count($m) == 0? false : true;
}
?>
TAKE ATTENDANCE
<?php
require_once('defines.php');
class Node {
/*************
PROPERTIES
**************/
const rollNumberRegex = '/([0-9]+)(/[a-zA-Z]+/[0-9]{2})/';
46
private $teacher; // teacher_id
private $subjectCode;
private $section;
private $year;
private $semester;
private $numberOfDays;
private $records = array(); // array of key value paired array for each student
ADD CLASS PHP CODE
<?php include 'php/node_class.php'; ?>
<html>
<head>
<link rel="stylesheet" href="css/style.css"/>
<title>Teacher Dashboard</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/teacher.js"></script>
<!-- Custom styles for this template -->
<link href="navbar-fixed-top.css" rel="stylesheet">
</head>
47
<!-- Fixed navbar -->
<!-- <nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-
target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">Online Attendance</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="teacher.php">Dashboard</a></li>
<li><a href="profile.php">Profile</a></li>
<li><a href="statistics.php">Statistics</a></li>
<li><a href="about.php">About</a></li>
<li><a href="contact.php">Contact</a></li>
<li><a href="logout.php">Logout</a></li>
48
</ul>
</div><!--/.nav-collapse -->
<!-- </div>
</nav></br></br></br></br> -->
<body style="background-color:#B993D6;">
<div class="container">
<?php
$name = $_SESSION['name'];
$classes = $_SESSION['classes'];
$teacher_id = $_SESSION['teacher_id'];
echo '<h2>Welcome , '.$name.'.</h2>';
echo '<div class="wrapper">';
// FOR EACH CLASS , GET IT'S INFO AND PREPARE A LINK
$n = new Node;
if(!$classes) {
echo '<h3 class="no-classes">You haven't taken any class yet!</h3>';
} else {
echo '<h3 class="no-classes">Click on a class to take attendance.</h3>';
foreach($classes as $class_id) {
49
$node = $n->retrieveObjecti($class_id,$teacher_id) or die("No such record");
$code = $node->getCode();
$section = $node->getSection();
$year = $node->getYear();
$numClasses = $node->getDays();
$link = 'take.php?cN='.$class_id;
echo '<div class="class">
<button class="btn btn-danger delete-class-warning" data-toggle="modal" data-
target=".delete-warning">&times;</button>
<a class="no-decoration" href="'.$link.'">
<div><strong>Code</strong> : <span class="code">'.$code.'</span></div>
<div><strong>Section</strong> : <span class="section">'.$section.'</span></div>
<div><strong>Year</strong> : <span class="year">'.$year.'</span></div>
<div><strong>Classes</strong> : '.$numClasses.'</div>
</div></a>';
}
}
echo '<div class="class" data-toggle="modal" data-target=".bs-example-modal-lg"
id="addClass">
<span class="glyphicon glyphicon-plus"></span>
</div>
</div>';
?>
50
</div>
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-
labelledby="addClass" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<h2 class="text-center"> Add Class </h2>
<hr>
<div id="add_class_form">
<select class="form-control" name="year">
<?php foreach(range(date('Y',time()),1983) as $r) echo '<option>'.$r.'</option>'; ?>
</select>
<input class="form-control" name="code" placeholder="Code , Eg : ITE-101">
<select class="form-control" name="section">
<option value="-1">Choose Section</option>
<?php foreach(range(1,3) as $r) echo '<option>'.$r.'</option>'; ?>
</select>
<select class="form-control" name="semester">
<option value="-1">Choose Semester</option>
<?php foreach(range(1,8) as $r) echo '<option>'.$r.'</option>'; ?>
</select>
<input class="form-control" name="start" placeholder="Starting Roll Number (Eg.
100/CO/19)">
51
<input class="form-control" name="end" placeholder="Ending Roll Number (Eg.
150/CO/19)">
<button class="btn btn-primary" id="add">Add Class</button>
<button class="btn" id="cancel">Cancel</button>
</div>
</div>
</div>
</div>
<div class="modal fade delete-warning" tabindex="-1" role="dialog" aria-labelledby="delete-
warning" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<h2 class="text-center"> Do you really want to delete <br> <span class="warning-
class"></span> ?</h2>
<hr>
<div class="text-center">
<p>
Are you sure you want to delete <span class="warning-class"></span> ? <br>
You can't undo this action.
</p>
<button class="btn btn-danger delete-class-code">Delete</button> <button class="btn
btn-primary" onclick="$('.delete-warning').modal('hide');">Cancel</button>
</div>
</div>
52
</div>
</div>
</body>
</html>
53
3.7. TESTING
(1) Unit Testing: Unit testing focuses verification effort on the smallest unit of
software design- the software component or module. The unit test is white-box
oriented. The unit testing implemented in every module of student attendance
management System. by giving correct manual input to the system,the datas are
stored in database and retrieved. If you want required module to access input or
get the output from the End user. any error will accrued the time will provide
handler to show what type of error will accrued
(2) System Testing: System testing is actually a series of different tests whose primary
purpose is to fully exercise the computer-based system. Below we have described
the two types of testing which have been taken for this project. it is to check all
modules worked on input basis .if you want change any values or inputs will
change all information. so specified input is must.
(3) Performance Testing: Performance testing is designed to test the run-time
performance of software within the context of an integrated system.
Performance testing occurs throughout all steps in the testing process. Even at
the unit level, the performance of an individual module may be assessed as
white-box tests are conducted. This project reduce attendance table, codes. it
will generate report fast.no have extra time or waiting of results .entered correct
data will show result few millisecond. just used only low memory of our system.
Automatically do not getting access atanother software. Get user permission and
access to other applications.
:
 Unit Testing
Unit testing focuses verification efforts on the smallest unit of the software design, the
module. This is also known as “Module Testing”. The modules are tested separately. This testing
carried out during programming stage itself. In this testing each module is found to be working
satisfactorily as regards to the expected output from the module.
54
 Integration Testing
Data can be grossed across an interface; one module can have adverse efforts on another.
Integration testing is systematic testing for construction the program structure while at the same
time conducting tests to uncover errors associated with in the interface. The objective is to take unit
tested modules and build a program structure. All the modules are combined and tested as a whole.
Here correction is difficult because the isolation of cause is complicate by the vast expense of the
entire program. Thus in the integration testing stop, all the errors uncovered are corrected for the
text testing steps.
System testing
System testing is the stage of implementation that is aimed at ensuring that the system works
accurately and efficiently for live operation commences. Testing is vital to the success of the system.
System testing makes a logical assumption that if all the parts of the system are correct, then goal
will be successfully achieved.
55
Validation Testing
At the conclusion of integration testing software is completely assembled as a package,
interfacing errors have been uncovered and corrected and a final series of software tests begins,
validation test begins. Validation test can be defined in many ways. But the simple definition is
that validation succeeds when the software function in a manner that can reasonably expected by
the customer. After validation test has been conducted one of two possible conditions exists.
One is the function or performance characteristics confirm to specifications and are
accepted and the other is deviation from specification is uncovered and a deficiency list is created.
Proposed system under consideration has been tested by using validation testing and found to be
working satisfactorily.
 Output Testing
After performing validation testing, the next step is output testing of the proposed system since no
system could be useful if it does not produce the required output in the specified format. Asking the
users about the format required by them tests the outputs generated by the system under
consideration. Here the output format is considered in two ways, one is on the screen and other is
the printed format. The output format on the screen is found to be correct as the format was designed
in the system designed phase according to the user needs.
For the hard copy also the output comes as the specified requirements by the users.
Hence output testing does not result any corrections in the system.User Acceptance Testing
56
User acceptance of a system is the key factor of the success of any system. The system
under study is tested for the user acceptance by constantly keeping in touch with the prospective
system users at the time of developing and making changes wherever required.
3.8. ADVANTAGES OF PROJECT
Collect and store data automatically
With the help of software, data can be automatically collected and stored. Those data can later be
used for calculating attendance of the employees or students. Thus attendance can be managed
well.
Serve as a helping hand to administrative tasks
The software helps to cut off administrative tasks. Management of attendance is a tedious task for
administration. But it becomes easier and faster by the usage of online attendance software.
Helps to eliminate errors caused by humans
Humans are prone to make errors. Some of the errors may be serious to handle. Using software,
human errors can be eliminated completely.
Possible to update and maintain attendance records
It is a difficult task to update and maintain attendance manually. One can easily update and
maintain attendance records with the help of software. And those records will be accurate and free
from errors.
Saves money by improving employee performance and productivity
57
Attendance software can restrict unnecessary movements of employees. Laziness of employees
can be reduced and thus helps to increase productivity. Hence software can increase profit for
your organization. Productivity and employee performance is increased by the implementation of
attendance software in institutions. There will be less possibility for absenteeism as well after this
software is installed.
3.9. DISADVANTAGES
 Increased Equipment expense:
Organization has to spend more money on device, badges and passes. But in manual way of
taking attendance, there is not much expense involved. All they require is a register and a pen to
mark the attendance.
 Difficult to maintain and repair
As it is a software, there is a need for proper maintenance. It is difficult to maintain and repair a
software. Though it might be rare, once it is damaged, there would be expense for the sake of
repairing.
 System is ineffective if there is no power supply
Software becomes useless if there is no power supply. The whole system works on power. But
this is not the case with the manual way of taking attendance.
Just like a coin is having two sides, each and everything in the world has negative as well as
positive sides. Depending upon the requirements, each company will have different software.
Only thing that can be done is to keep in mind these drawbacks and manage it well for efficient
management of attendance.
58
4. CONCLUSION
By this system Attendance marking and report generation becomes easy. Less
chances of malfunctioning are there. The system has reached a steady state
where all bugs have been eliminated.
The system is operated at a high level of efficiency and all the teachers and user
associated with the system understands its advantage. It was intended to solve as
requirement specification. In future this system can be implemented to automate
most of the educational systems and it can be designed for cross platform.
This project is intended to replace the age old system of attendance register with
a digital register which can show its worthiness by its features and ease of use.
With due course of time we intend it to establish a connection with the college
server so as to access and update the attendance over the college LAN. Features
like sending warning messages to the students with low attendance, and a student
portal to check their attendance are planning to get added.
59
GOALS
 Reduced entry work.
 Easy retrieval of information
 Reduced errors due to human intervention
 User friendly screens to enter the data
 Portable and flexible for further enhancement
 Web enabled.
60
5. BIBLIOGRAPHY
The following links were referred during the analysis and execution phase of the
project:
 https://www.tutorialspoint.com/software_engineering/
 https://www.w3schools.com/html/default.asp
 https://www.w3schools.com/css/default.asp
 https://www.w3schools.com/sql/default.asp
 https://explore.easyprojects.net/blog/how-to-write-a-project-report

Mobile Based Attendance System

  • 1.
    1 MOBILE BASED ATTENDANCESYSTEM Submittedby: Abhishek Kumar Abhishek Kumar Jha Akhil Kumar Panday Amardeep Prakash DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING DR.B.C.ROY ENGINEERING COLLEGE, DURGAPUR-713206 MAY 2019
  • 2.
    2 MOBILE BASED ATTENDANCESYSTEM Forthe partial fulfillment of the requirement to award the degree Of Bachelor of Technology In Computer Science and Engineering by Abhishek Kumar 12000115007 Abhishek Kumar Jha 12000115010 Akhil Kumar Panday 12000115013 Amardeep Prakash 12000115016 Supervisor: Dr. Bappaditya Das --------------------------------------- DEPARTMENT OF COMPUTERSCIENCE AND ENGINEERING DR.B.C.ROY ENGINEERING COLLEGE, DURGAPUR-713206 MAY 2019
  • 3.
    3 DEPARTMENT OF COMPUTERSCIENCEAND ENGINEERING Dr.B.C.ROY ENGINEERING COLLEGE, DURGAPUR-713206,WB. DECLARATION We declare that this written submission represents my ideas in my own words and where others’ ideas or words have been included, we have adequately cited and referenced the original sources. We also declare that we have adhered to all principles of academic honesty and integrity and have not misrepresented or fabricated or falsified any idea/data/fact/source in my submission. We understand that any violation of the above will because for disciplinary action by the Institute and can also evoke penal action from the sources which have thus not been properly cited or from whom proper permission has not been taken when needed. ---------------------------------------------------------- Abhishek Kumar (12000115007) Abhishek Kumar Jha (12000115010) Akhil Kumar Panday (12000115013) Amardeep Prakash (12000115016) ----------------------------------------------
  • 4.
    4 DEPARTMENT OF COMPUTERSCIENCEAND ENGINEERING Dr.B.C.ROY ENGINEERING COLLEGE, DURGAPUR-713206,WB. RECOMMENDATION This is to recommend that the work undertaken in this report “Mobile BasedAttendance System” has been carried out by “Abhishek Kumar, Abhishek Kumar Jha, Akhil Kumar Panday, Amardeep Prakash,” under my supervision and guidance during the academic year 2018-19. This may be accepted in partial fulfilment of the requirements for the award of the degree of Bachelor of Technology (Computer Science and Engineering). --------------------------------- Dr. Bappaditya Das Supervisor ----------------------------- Dr. Chandan Koner Head of the CSE Department
  • 5.
    5 DEPARTMENTOF COMPUTERSCIENCEAND ENGINEERING Dr.B.C.ROYENGINEERING COLLEGE, DURGAPUR-713206,WB. APPROVAL This project report entitled “Mobile BasedAttendance System ” has been carried out by “Abhishek Kumar, Abhishek Kumar Jha, Akhil Kumar Panday, Amardeep Prakash”is approved for the degree of B.tech in Computer Science and Engineering. Examiners Dr. Bappaditya Das (Supervisor) Dr.Chandan Koner (HOD CSE) Project coordinator Date ---------- Time _____________
  • 6.
    6 DEPARTMENT OF COMPUTERSCIENCEAND ENGINEERING Dr.B.C.ROY ENGINEERING COLLEGE, DURGAPUR-713206,WB. ACKNOWELEDGEMENT With great pleasure and deep sense of gratitude, we convey our indebtedness to our respected teacher Dr. Bappaditya Das for his inspiring guidance, constructive criticism and valuable suggestions throughout the project work. We sincerely thanks to our friends who have patiently extended all sorts of help for accomplishing this work. Abhishek Kumar Abhishek Kumar Jha Akhil Kumar Panday Amardeep Prakash
  • 7.
    7 ABSTRACT Now a days,it is highly possible to adapt mobile computing in various applications. The portability, open source nature of smart phones and android development platform has made the development of application software for various environments as handy. Smartphone applications are resulted in paper less work, easy to use and time saving in nature. The wireless communication technology of smart phone enables the information transfer from the current client to remote database server, where ever the network range is available The Attendance Management System is a mobile computing software application, which focusses on an activity or function, which is based on management information system of academic institutions. In this work, the systems functionalities are categorized as a group and the similarities in grouped functionalities are designed and developed with reuse of software components.
  • 8.
    8 CONTENTS TOPIC PAGE NUMBER 1.INTRODUCTION 1.1. Problem Definition 1.2. ProjectOverview 1.3. Hardware Required 1.4. Software Required 9 10 11 2. LITERATURE SURVEY 2.1. Existing System 2.2. ProposedSystem 2.3. FeasibilityStudy 12 13 3. PROJECT DESIGN 3.1. E-R Diagram 3.2. Use Case Diagram 3.3. Activity Diagram 3.4. DFD 3.5. Snapshots 3.6. Coding 3.7. Testing 3.8. Advantages of Project 3.9. DisadvantagesofProject 14 15 16-18 19-21 22-26 27-52 53 56 57 4. CONCLUSION 58 5. BIBLIOGRAPHY 60
  • 9.
    9 1. INTRODUCTION In thecurrent scenario of various educational institutions to manage and maintaining student information is very tough task for any one. The whole academic record of the student information consist of monitoring their performance and progress changes periodically which is very huge workload on lecturers to handle and keep on updating the progress report of each and every student in against of their respective scheduled classes. The traditional way of taking attendance through the lecturers is a manually in a register book in which they are used to do a manual calculation to maintain monthly attendance database of the students. Such system takes so much time to generate record and many times its creates an error also as it follow manual traditional system 1.1. Problem Definition Apart from this error problems some time many more problems are generated like lost of attendance register book or manually fake data inserted through unknown recourses which are really not authorized for that work. In order to reduce all these problems and concern overcome through this problem, a smart mobile based application is generated to increase its efficiency as well as its security by sending all information about the students to the authorized web based admin panel server as it linked in the proposed mobile application. It is a beneficial step in every way for our future E-schools. It consist of five modules such as admin controlling, teachers authentication, student authentication, displaying digital register, submitting final report to the given admin web based server. This android based application used by the teacher to login and through its subject id and class id display the digital register for the particular class students and finally submit it to the authorized admin panel. As it already defined that the admin panel is totally web based secured web site which is authorized to make changes in any of the database of the students as well as the teachers
  • 10.
    10 Therefore, it iscrucial to reinforce the use of the mobile based attendance application to register system in order to improve the traditional process of recording and reporting the student’s attendance in the higher educational organizations 1.2.PROJECTOVERVIEW All the above systems are time consuming and unsafe. In the proposed project Android based attendance system is designed which is less time consuming, safe and easy to implement because- User Friendly: - This software is user friendly as it is simple to use and the user doesn’t need any special training to use this software. Data evaluation, data storing and retrieval is easy and doesn’t need any heavy calculation or method. The UI is simple and easy to understand. Easy and Fast report generation: Reports are generated automatically fast in an easy way after each month for the teacher to keep a track on the students attendance record and notify the students with minimum attendance to attend classes. Minimal paper work: There is no paper work required. Data are stored automatically in the system. Evaluation are done automatically. Hence it is cost effective too. Time Saving: Data storing, data retrieval, data evaluation is done at minimum time hence it is time saving producing data with minimal errors. 1.3. Hardware Requirement Processor : All compatible Memory : minimum 512mb RAM Network : internet connection
  • 11.
    11 Others : mouse,keyboard, system 1.4. Software Requirement Platform : All compatible Framework : Android
  • 12.
    12 2. LITERATURE SURVEY 2.1.Existing System Todayfaculty take attendance through pen paper based with is the oldest method of taking attendance. In has many cons and it limit the access of seeing and tracking students overall attendance Problem with current scenario In the present system all work is done on paper. The whole session attendance is stored in register and at the and of the sessionthe 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’thave 75% attendance get a notice. Limitations of Present System 2.2. ProposedSystem The purposeof developing attendance management system is to computerized the tradition way of taking attendance. Another purposefor developing this software is to generate the report automatically at the end of the session or in the between of the session Features:  User friendly  Reports are easily generated  Very less paper work  Computer Operator Control
  • 13.
    13 2.3. FEASIBILITY STUDY Thissystem is feasible because of the following reasons: Economically Feasibility: This software is economic from school or colleges point of view. It is cost effective as use of paper has been eliminated .It is time effective since evaluation of attendance and report generation is done in less amount of time with minimal errors. Technical feasibility: This software is technically feasible since there are no extra hardware requirements. The only requirement is an android smartphone with minimum version 4.2 jelly Bean. Behavioral Feasibility: This software is very simple to use. The user doesn’t need any special training to use this software. The software has been designed keeping the users point of view
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
    27 3.6. CODING JAVA CODE Homepage packagecom.frost.attendance; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.webkit.WebView; import android.widget.Button; public class homepage extends AppCompatActivity { Button btnNotice,btnFaculty,btnAdmin,btnStudent; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_homepage); btnNotice= (Button)findViewById(R.id.btnnotice); btnAdmin=(Button)findViewById(R.id.btnadmin); btnFaculty=(Button)findViewById(R.id.btnfaculty); btnStudent=(Button)findViewById(R.id.btnstudent); btnNotice.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent=new Intent(homepage.this,Notice.class); startActivity(intent); } }); btnAdmin.setOnClickListener(new View.OnClickListener() {
  • 28.
    28 @Override public void onClick(Viewview) { Intent i1= new Intent(homepage.this,AdminLoginScreen.class); startActivity(i1); } }); btnFaculty.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i2= new Intent(homepage.this,FacultyLoginScreen.class); startActivity(i2); } }); btnStudent.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i3=new Intent(homepage.this,StudentLogin.class); startActivity(i3); } }); } } ADMIN LOGIN SCREEN package com.frost.attendance; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button;
  • 29.
    29 import android.widget.EditText; import android.widget.Toast; importcom.android.volley.AuthFailureError; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import org.json.JSONException; import org.json.JSONObject; import java.util.HashMap; import java.util.Map; public class AdminLoginScreen extends AppCompatActivity { private EditText editTextusername, editTextpassword; private Button btnadminlogin; // private ProgressDialog progressDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_admin_login_screen); /* if(SharedPrefManager.getInstance(this).isLoggedIn()) { finish(); startActivity(new Intent(this, adminmanager.class)); return; } */ editTextusername = (EditText) findViewById(R.id.txtemailid); editTextpassword = (EditText) findViewById(R.id.txtpassword); btnadminlogin = (Button) findViewById(R.id.btnlogin); btnadminlogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {
  • 30.
    30 loginadmin(); } }); // progressDialog.setMessage("Please Wait..."); } privatevoid loginadmin() { final String username = editTextusername.getText().toString().trim(); final String emailid = editTextusername.getText().toString().trim(); final String password = editTextpassword.getText().toString().trim(); // progressDialog.show(); StringRequest stringRequest = new StringRequest( Request.Method.POST, Constants.URL_LOGIN, new Response.Listener<String>() { @Override public void onResponse(String response) { // progressDialog.dismiss(); try { JSONObject obj = new JSONObject(response); if (!obj.getBoolean("error")) { SharedPrefManager.getInstance(getApplicationContext()) .userLogin( obj.getInt("adminid"), obj.getString("username"), obj.getString("emailid") ); startActivity(new Intent(getApplicationContext(), adminmanager.class)); Toast.makeText(getApplicationContext(),"Login Succesfull",Toast.LENGTH_LONG).show(); finish(); } else { Toast.makeText( getApplicationContext(), "Invalid Username or Password", Toast.LENGTH_LONG
  • 31.
    31 ).show(); } } catch (JSONExceptione) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { //progressDialog.dismiss(); Toast.makeText(getApplicationContext(),error.getMessage(),Toast.LENGTH_LONG).show(); } }) { @Override protected Map<String, String> getParams() throws AuthFailureError { Map<String, String> params = new HashMap<>(); params.put("username", username); params.put("password", password); return params; } }; RequestHandler.getInstance(this).addToRequestQueue(stringRequest); } } ADD FACULTY package com.frost.attendance; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle;
  • 32.
    32 import android.view.View; import android.widget.Button; importandroid.widget.EditText; import android.widget.Toast; import com.android.volley.AuthFailureError; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import org.json.JSONException; import org.json.JSONObject; import java.util.HashMap; import java.util.Map; public class addfaculty extends AppCompatActivity { private EditText txtfacultyname, txtfacultyusername, txtfacultyemailid, txtmobileno, txtfacultyadd, txtfacultypass; private Button btnsubmit; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_addfaculty); /* if(SharedPrefManager.getInstance(this).isLoggedIn()){ finish(); startActivity(new Intent(this, AdminLoginScreen.class)); return; } */ txtfacultyname = (EditText) findViewById(R.id.txtfacultyname); txtfacultyusername = (EditText) findViewById(R.id.txtfacultyusername); txtfacultyemailid = (EditText) findViewById(R.id.txtfacultyemailid); txtmobileno = (EditText) findViewById(R.id.txtmobileno); txtfacultyadd = (EditText) findViewById(R.id.txtfacultyadd);
  • 33.
    33 txtfacultypass = (EditText)findViewById(R.id.txtfacultypass); btnsubmit = (Button) findViewById(R.id.btnsubmit); btnsubmit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { registerfaculy(); // Toast.makeText(getApplicationContext(),"login success", Toast.LENGTH_LONG).show(); } }); } private void registerfaculy() { final String name = txtfacultyname.getText().toString().trim(); final String username = txtfacultyusername.getText().toString().trim(); final String email = txtfacultyemailid.getText().toString().trim(); final String mobileno = txtmobileno.getText().toString().trim(); final String address = txtfacultyadd.getText().toString().trim(); final String password = txtfacultypass.getText().toString().trim(); StringRequest stringRequest = new StringRequest(Request.Method.POST, Constants.URL_REGISTER, new Response.Listener<String>() { @Override public void onResponse(String response) { // progressDialog.dismiss(); try { JSONObject jsonObject = new JSONObject(response); Toast.makeText(getApplicationContext(), jsonObject.getString("message"), Toast.LENGTH_LONG).show(); } catch (JSONException e) { e.printStackTrace(); } } },
  • 34.
    34 new Response.ErrorListener() { @Override publicvoid onErrorResponse(VolleyError error) { // progressDialog.hide(); Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show(); REQUEST HANDLER package com.frost.attendance; import android.content.Context; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.toolbox.Volley; public class RequestHandler { private static RequestHandler mInstance; private RequestQueue mRequestQueue; private static Context mCtx; private RequestHandler(Context context) { mCtx = context; mRequestQueue = getRequestQueue(); } public static synchronized RequestHandler getInstance(Context context) { if (mInstance == null) { mInstance = new RequestHandler(context); } return mInstance; } public RequestQueue getRequestQueue() { if (mRequestQueue == null) { // getApplicationContext() is key, it keeps you from leaking the // Activity or BroadcastReceiver if someone passes one in. mRequestQueue = Volley.newRequestQueue(mCtx.getApplicationContext());
  • 35.
    35 } return mRequestQueue; } public <T>void addToRequestQueue(Request<T> req) { getRequestQueue().add(req); } } SHARED PREFRENCE package com.frost.attendance; import android.content.Context; import android.content.SharedPreferences; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.toolbox.Volley; public class SharedPrefManager { private static SharedPrefManager mInstance; private static Context mCtx; private static final String SHARED_PREF_NAME = "mysharedpref12"; private static final String KEY_USERNAME = "username"; private static final String KEY_USER_EMAIL = "emailid"; private static final String KEY_USER_ID = "adminid"; private SharedPrefManager(Context context) { mCtx = context; } public static synchronized SharedPrefManager getInstance(Context context) { if (mInstance == null) { mInstance = new SharedPrefManager(context); }
  • 36.
    36 return mInstance; } public booleanuserLogin(int adminid, String username, String emailid){ SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putInt(KEY_USER_ID, adminid); editor.putString(KEY_USER_EMAIL, emailid); editor.putString(KEY_USERNAME, username); editor.apply(); return true; } public boolean facultyLogin(int id, String username, String email){ SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putInt(KEY_USER_ID, id); editor.putString(KEY_USER_EMAIL, email); editor.putString(KEY_USERNAME, username); editor.apply(); return true; } public boolean isLoggedIn(){ SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE); if(sharedPreferences.getString(KEY_USERNAME, null) != null){ return true; } return false;
  • 37.
    37 } public boolean logout(){ SharedPreferencessharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.clear(); editor.apply(); return true; } public String getUsername(){ SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE); return sharedPreferences.getString(KEY_USERNAME, null); } public String getUserEmail(){ SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE); return sharedPreferences.getString(KEY_USER_EMAIL, null); } } XML FILE HOMEPAGE XML CODE <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingLeft="16dp"
  • 38.
    38 android:paddingRight="16dp" tools:context=".homepage" android:background="@drawable/screenbackground"> <LinearLayout android:layout_marginTop="60dp" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:gravity="center" android:orientation="vertical" android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content"> <Button android:id="@+id/btnfaculty" android:background="@mipmap/ic_faculty" android:layout_width="150dp" android:layout_height="150dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="FACULTY" android:textStyle="bold" /> <Button android:id="@+id/btnadmin" android:background="@mipmap/ic_admin" android:layout_width="150dp" android:layout_height="150dp" android:layout_marginTop="40dp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="ADMIN"
  • 39.
    39 android:textStyle="bold" /> </LinearLayout> <LinearLayout android:gravity="center" android:orientation="vertical" android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content"> <Button android:id="@+id/btnstudent" android:background="@mipmap/ic_student" android:layout_width="150dp" android:layout_height="150dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="STUDENT" android:textStyle="bold"/> <Button android:id="@+id/btnnotice" android:background="@mipmap/ic_notice" android:layout_width="150dp" android:layout_height="150dp" android:layout_marginTop="40dp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="NOTICE" android:textStyle="bold" /> </LinearLayout> </LinearLayout>
  • 40.
    40 </RelativeLayout> PHP CODE CONNECTION TODATABASE <?php DEFINE('DB_USER','root'); DEFINE('DB_PASS',''); DEFINE('DB_HOST','localhost'); DEFINE('DB_DB','attendance'); DEFINE('EMAIL',1); DEFINE('PHONE',2); DEFINE('ROLL',3); DEFINE('CODE',4); DEFINE('NAME',5); DEFINE('NUMBER',6); function connectTo() {
  • 41.
    41 /* Does -> Connectsto data base Returns -> Connection object */ $con = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_DB); return $con; } function sqlReady($input) { /* Takes -> Any string Returns -> Escapes the string */ $con = connectTo(); $string = mysqli_real_escape_string($con,$input); $con->close(); return $string; } function hashPass($pass,$rounds = 9) { /* Takes -> Password Returns -> Hashes the password using blow-fish algorithm */
  • 42.
    42 $salt = ""; $i= -1; $saltChars = array_merge(range(0,9),range('a','z'),range('A','Z')); while(++$i < 22) $salt .= $saltChars[array_rand($saltChars)]; return crypt($pass, sprintf('$2y$%02d$', $rounds) . $salt); } function verifyPass($input,$pass) { /* Takes -> 2 Password strings Returns -> true if matches false if doesn't */ return crypt($input,$pass) == $pass? true : false ; } function respond($as,$what) { /* Takes -> key and value Does -> Dies by printing json_encoded array having the key and value */ die(json_encode(array($as=>$what))); } function updateSession($email) { /*
  • 43.
    43 Takes -> email Does-> Updates the SESSION variable as per the email */ $con = connectTo(); $exists = $con->query("select * from `attendance`.`teacher` where email = '$email'"); $exists = $exists->fetch_assoc(); $_SESSION['name'] = $exists['name']; $_SESSION['email'] = $exists['email']; $_SESSION['phone'] = $exists['phone']; $_SESSION['teacher_id'] = $exists['uid']; $_SESSION['classes'] = 0; $classes = $con->query('select uid from `objects` where teacher_uid = '.$_SESSION['teacher_id']); if($classes && $con->affected_rows) { $cls = array(); while($a = $classes->fetch_array()) { $cls[] = $a[0]; } $_SESSION['classes'] = $cls; } $con->close(); session_write_close(); }
  • 44.
    44 function verify($type,$input) { /* Takes-> Type of regex checker and the input Does -> Computes the regex Returns -> Returns true and false */ $reEmail = '/^([S]+)@([S]+).([S]+)$/'; $rePhone = '/^[0-9]{10}$/'; $reCode = '/^([a-zA-Z]{3}-[0-9]{3})$/'; $reRoll = '/^([0-9]{3})/([a-zA-z]{3})/([0-9]{2})$/'; $reName = '/^[a-zA-Z ']+$/'; $reNum = '/^[0-9]+$/'; $m; switch($type) { case EMAIL : preg_match($reEmail,$input,$m); break; case PHONE : preg_match($rePhone,$input,$m); break; case CODE : preg_match($reCode,$input,$m); break;
  • 45.
    45 case ROLL : preg_match($reRoll,$input,$m); break; caseNAME : preg_match($reName,$input,$m); break; case NUMBER : preg_match($reNum,$input,$m); break; } return count($m) == 0? false : true; } ?> TAKE ATTENDANCE <?php require_once('defines.php'); class Node { /************* PROPERTIES **************/ const rollNumberRegex = '/([0-9]+)(/[a-zA-Z]+/[0-9]{2})/';
  • 46.
    46 private $teacher; //teacher_id private $subjectCode; private $section; private $year; private $semester; private $numberOfDays; private $records = array(); // array of key value paired array for each student ADD CLASS PHP CODE <?php include 'php/node_class.php'; ?> <html> <head> <link rel="stylesheet" href="css/style.css"/> <title>Teacher Dashboard</title> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/bootstrap-theme.min.css"> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/teacher.js"></script> <!-- Custom styles for this template --> <link href="navbar-fixed-top.css" rel="stylesheet"> </head>
  • 47.
    47 <!-- Fixed navbar--> <!-- <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data- target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.php">Online Attendance</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <li class="active"><a href="teacher.php">Dashboard</a></li> <li><a href="profile.php">Profile</a></li> <li><a href="statistics.php">Statistics</a></li> <li><a href="about.php">About</a></li> <li><a href="contact.php">Contact</a></li> <li><a href="logout.php">Logout</a></li>
  • 48.
    48 </ul> </div><!--/.nav-collapse --> <!-- </div> </nav></br></br></br></br>--> <body style="background-color:#B993D6;"> <div class="container"> <?php $name = $_SESSION['name']; $classes = $_SESSION['classes']; $teacher_id = $_SESSION['teacher_id']; echo '<h2>Welcome , '.$name.'.</h2>'; echo '<div class="wrapper">'; // FOR EACH CLASS , GET IT'S INFO AND PREPARE A LINK $n = new Node; if(!$classes) { echo '<h3 class="no-classes">You haven't taken any class yet!</h3>'; } else { echo '<h3 class="no-classes">Click on a class to take attendance.</h3>'; foreach($classes as $class_id) {
  • 49.
    49 $node = $n->retrieveObjecti($class_id,$teacher_id)or die("No such record"); $code = $node->getCode(); $section = $node->getSection(); $year = $node->getYear(); $numClasses = $node->getDays(); $link = 'take.php?cN='.$class_id; echo '<div class="class"> <button class="btn btn-danger delete-class-warning" data-toggle="modal" data- target=".delete-warning">&times;</button> <a class="no-decoration" href="'.$link.'"> <div><strong>Code</strong> : <span class="code">'.$code.'</span></div> <div><strong>Section</strong> : <span class="section">'.$section.'</span></div> <div><strong>Year</strong> : <span class="year">'.$year.'</span></div> <div><strong>Classes</strong> : '.$numClasses.'</div> </div></a>'; } } echo '<div class="class" data-toggle="modal" data-target=".bs-example-modal-lg" id="addClass"> <span class="glyphicon glyphicon-plus"></span> </div> </div>'; ?>
  • 50.
    50 </div> <div class="modal fadebs-example-modal-lg" tabindex="-1" role="dialog" aria- labelledby="addClass" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <h2 class="text-center"> Add Class </h2> <hr> <div id="add_class_form"> <select class="form-control" name="year"> <?php foreach(range(date('Y',time()),1983) as $r) echo '<option>'.$r.'</option>'; ?> </select> <input class="form-control" name="code" placeholder="Code , Eg : ITE-101"> <select class="form-control" name="section"> <option value="-1">Choose Section</option> <?php foreach(range(1,3) as $r) echo '<option>'.$r.'</option>'; ?> </select> <select class="form-control" name="semester"> <option value="-1">Choose Semester</option> <?php foreach(range(1,8) as $r) echo '<option>'.$r.'</option>'; ?> </select> <input class="form-control" name="start" placeholder="Starting Roll Number (Eg. 100/CO/19)">
  • 51.
    51 <input class="form-control" name="end"placeholder="Ending Roll Number (Eg. 150/CO/19)"> <button class="btn btn-primary" id="add">Add Class</button> <button class="btn" id="cancel">Cancel</button> </div> </div> </div> </div> <div class="modal fade delete-warning" tabindex="-1" role="dialog" aria-labelledby="delete- warning" aria-hidden="true"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <h2 class="text-center"> Do you really want to delete <br> <span class="warning- class"></span> ?</h2> <hr> <div class="text-center"> <p> Are you sure you want to delete <span class="warning-class"></span> ? <br> You can't undo this action. </p> <button class="btn btn-danger delete-class-code">Delete</button> <button class="btn btn-primary" onclick="$('.delete-warning').modal('hide');">Cancel</button> </div> </div>
  • 52.
  • 53.
    53 3.7. TESTING (1) UnitTesting: Unit testing focuses verification effort on the smallest unit of software design- the software component or module. The unit test is white-box oriented. The unit testing implemented in every module of student attendance management System. by giving correct manual input to the system,the datas are stored in database and retrieved. If you want required module to access input or get the output from the End user. any error will accrued the time will provide handler to show what type of error will accrued (2) System Testing: System testing is actually a series of different tests whose primary purpose is to fully exercise the computer-based system. Below we have described the two types of testing which have been taken for this project. it is to check all modules worked on input basis .if you want change any values or inputs will change all information. so specified input is must. (3) Performance Testing: Performance testing is designed to test the run-time performance of software within the context of an integrated system. Performance testing occurs throughout all steps in the testing process. Even at the unit level, the performance of an individual module may be assessed as white-box tests are conducted. This project reduce attendance table, codes. it will generate report fast.no have extra time or waiting of results .entered correct data will show result few millisecond. just used only low memory of our system. Automatically do not getting access atanother software. Get user permission and access to other applications. :  Unit Testing Unit testing focuses verification efforts on the smallest unit of the software design, the module. This is also known as “Module Testing”. The modules are tested separately. This testing carried out during programming stage itself. In this testing each module is found to be working satisfactorily as regards to the expected output from the module.
  • 54.
    54  Integration Testing Datacan be grossed across an interface; one module can have adverse efforts on another. Integration testing is systematic testing for construction the program structure while at the same time conducting tests to uncover errors associated with in the interface. The objective is to take unit tested modules and build a program structure. All the modules are combined and tested as a whole. Here correction is difficult because the isolation of cause is complicate by the vast expense of the entire program. Thus in the integration testing stop, all the errors uncovered are corrected for the text testing steps. System testing System testing is the stage of implementation that is aimed at ensuring that the system works accurately and efficiently for live operation commences. Testing is vital to the success of the system. System testing makes a logical assumption that if all the parts of the system are correct, then goal will be successfully achieved.
  • 55.
    55 Validation Testing At theconclusion of integration testing software is completely assembled as a package, interfacing errors have been uncovered and corrected and a final series of software tests begins, validation test begins. Validation test can be defined in many ways. But the simple definition is that validation succeeds when the software function in a manner that can reasonably expected by the customer. After validation test has been conducted one of two possible conditions exists. One is the function or performance characteristics confirm to specifications and are accepted and the other is deviation from specification is uncovered and a deficiency list is created. Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily.  Output Testing After performing validation testing, the next step is output testing of the proposed system since no system could be useful if it does not produce the required output in the specified format. Asking the users about the format required by them tests the outputs generated by the system under consideration. Here the output format is considered in two ways, one is on the screen and other is the printed format. The output format on the screen is found to be correct as the format was designed in the system designed phase according to the user needs. For the hard copy also the output comes as the specified requirements by the users. Hence output testing does not result any corrections in the system.User Acceptance Testing
  • 56.
    56 User acceptance ofa system is the key factor of the success of any system. The system under study is tested for the user acceptance by constantly keeping in touch with the prospective system users at the time of developing and making changes wherever required. 3.8. ADVANTAGES OF PROJECT Collect and store data automatically With the help of software, data can be automatically collected and stored. Those data can later be used for calculating attendance of the employees or students. Thus attendance can be managed well. Serve as a helping hand to administrative tasks The software helps to cut off administrative tasks. Management of attendance is a tedious task for administration. But it becomes easier and faster by the usage of online attendance software. Helps to eliminate errors caused by humans Humans are prone to make errors. Some of the errors may be serious to handle. Using software, human errors can be eliminated completely. Possible to update and maintain attendance records It is a difficult task to update and maintain attendance manually. One can easily update and maintain attendance records with the help of software. And those records will be accurate and free from errors. Saves money by improving employee performance and productivity
  • 57.
    57 Attendance software canrestrict unnecessary movements of employees. Laziness of employees can be reduced and thus helps to increase productivity. Hence software can increase profit for your organization. Productivity and employee performance is increased by the implementation of attendance software in institutions. There will be less possibility for absenteeism as well after this software is installed. 3.9. DISADVANTAGES  Increased Equipment expense: Organization has to spend more money on device, badges and passes. But in manual way of taking attendance, there is not much expense involved. All they require is a register and a pen to mark the attendance.  Difficult to maintain and repair As it is a software, there is a need for proper maintenance. It is difficult to maintain and repair a software. Though it might be rare, once it is damaged, there would be expense for the sake of repairing.  System is ineffective if there is no power supply Software becomes useless if there is no power supply. The whole system works on power. But this is not the case with the manual way of taking attendance. Just like a coin is having two sides, each and everything in the world has negative as well as positive sides. Depending upon the requirements, each company will have different software. Only thing that can be done is to keep in mind these drawbacks and manage it well for efficient management of attendance.
  • 58.
    58 4. CONCLUSION By thissystem Attendance marking and report generation becomes easy. Less chances of malfunctioning are there. The system has reached a steady state where all bugs have been eliminated. The system is operated at a high level of efficiency and all the teachers and user associated with the system understands its advantage. It was intended to solve as requirement specification. In future this system can be implemented to automate most of the educational systems and it can be designed for cross platform. This project is intended to replace the age old system of attendance register with a digital register which can show its worthiness by its features and ease of use. With due course of time we intend it to establish a connection with the college server so as to access and update the attendance over the college LAN. Features like sending warning messages to the students with low attendance, and a student portal to check their attendance are planning to get added.
  • 59.
    59 GOALS  Reduced entrywork.  Easy retrieval of information  Reduced errors due to human intervention  User friendly screens to enter the data  Portable and flexible for further enhancement  Web enabled.
  • 60.
    60 5. BIBLIOGRAPHY The followinglinks were referred during the analysis and execution phase of the project:  https://www.tutorialspoint.com/software_engineering/  https://www.w3schools.com/html/default.asp  https://www.w3schools.com/css/default.asp  https://www.w3schools.com/sql/default.asp  https://explore.easyprojects.net/blog/how-to-write-a-project-report