On
Blood Donor
SUBMITTED TO:
Prof. Humair Razzaq
HOD Computer Science
The Superior College Lahore
SUBMITTED BY:
Muhammad Arham Adeel
Registration No:(SC18-ADPCS-F16-003)
Iftikhar Hussain
Registration No:(SC18-ADPCS-F16-019)
Advisor:
Lecturer Salman Haider
The Superior College Lahore
1
THE SUPERIOR COLLEGE LAHORE.
UNIVERSITY CAMPUS.
2
VISION:
"Facilitating Superior Human Beings"
MISSION:
We are committed to enhance the potentials of students, faculty, staff and all
segments of the society by bringing a positive change in their personal and career
lives, motivating them for self-enlightenment through Quality Education,
Personality Development, True Professionalism and Career Planning; thus, adding
value to our nation, and ultimately to humanity.
3
ACKNOWLEDGEMENT:
FROM:
M Arham Adeel
Iftikhar Hussain
4
Abstract:
Emergency situations, such as accidents, create an immediate and critical need for
specific blood types. In short, blood is a saver of all existing lives. So, in such emergency cases,
it is difficult for hospital staff to collect blood in case of shortage of blood without having
appropriate resources. The purpose of this study was to develop a blood management
information system to assist in the management of blood donor records and ease/or control the
distribution of blood in various parts of the country basing on the hospital demands. Our project
will help to finding the blood donations with constant time at single platform. This project is to
build a web-based, online blood donation system, named Blood Donor. That web application will
serve and the application aims at bringing the donors under one roof so that they can donate
blood easily. Currently the donors have to look for the blood donation camps that cause wastage
of time. That project will improve manual information saving technique and replace manual
methodology with digital web form application. Only Blood donors can register to upload its
profile and visitor can easily get information of donors without registering on our web
application. The entire project has been developed keeping in view of the distributed client
server computing technology, in mind. This system provides an online platform for a quick
access to the required donor. That web application allows to access the whole information about
blood donors, readily scalable and adaptable to meet the complex need of blood; it also supports
all the functionalities of blood donor system. The project includes two main modules donor, and
visitors. Through this application any person who is interested in donating the blood can register
himself in the same way if any organization wants to register itself with this site that can also
register. Donor module is for managing blood donation information and donor can change its
password and other information. If donor has forgot its password than he can reset, it by email
verification process. Donor can also delete its account. The whole project makes work easier for
every person using the software in their required category. Without quick and timely access to
donor records, lobbying and sensitization of blood donors becomes very difficult. The blood
management information system offers functionalities to quick access to donor records collected
from various parts of the Sahiwal city areas.
5
Table of Contents
1 INTRODUCTION ........................................................................................... 11
1.1 Introduction and history.............................................................................................. 12
1.2 Scope of Proposed Solution ......................................................................................... 12
1.3 Relevance to courses..................................................................................................... 13
1.3.1 Introduction to Programming (ICP) ................................................................... 13
1.3.2 Object Oriented Programming (OOP) ............................................................... 13
1.3.3 Database System (DB) .......................................................................................... 13
1.3.4 Software Engineering (SE) ................................................................................... 13
1.3.5 Computer Commufnication and Networking (CCN) ........................................ 13
1.3.6 Web Engineering................................................................................................... 14
1.4 Specific Requirements.................................................................................................. 14
1.4.1 Software Interface ................................................................................................. 14
1.4.2 Functional Requirement ....................................................................................... 14
1.4.3 Non Functional Requirement............................................................................... 16
1.5 Implementation of Blood Donor web ......................................................................... 16
1.5.1 Tool Phase .............................................................................................................. 16
1.5.2 Tools ....................................................................................................................... 17
1.6 Existing System............................................................................................................. 17
1.7 Limitations .................................................................................................................... 17
1.7.1 Advantages............................................................................................................. 18
1.8 Drawbacks of Existing System .................................................................................... 18
1.9 The Necessity ................................................................................................................ 19
2 Methodology & Workplan .............................................................................. 20
2.1 Existing Methodologies ................................................................................................ 21
2.1.1 Advantage and Disadvatages ............................................................................... 22
2.1.2 When to use Spiral model: ................................................................................... 22
2.1.3 Spiral model Diagram: ......................................................................................... 23
3 System Analysic & Design .............................................................................. 24
3.1 Use Cases ..........................................................................................................25
6
3.1.1 Registration ........................................................................................................... 25
3.1.2 Verification ............................................................................................................ 26
3.1.3 Login....................................................................................................................... 27
3.1.4 Profile ..................................................................................................................... 28
3.1.5 Profile Update........................................................................................................ 29
3.1.6 Password Change .................................................................................................. 30
3.1.7 Password Reset ...................................................................................................... 31
3.1.8 Account Delete ....................................................................................................... 32
3.1.9 Account Deactivate ............................................................................................... 33
3.1.10 Search ..................................................................................................................... 34
3.1.11 Heros View ............................................................................................................. 35
3.1.12 Contact and Bug Report ....................................................................................... 36
3.2 Planning & Scheduling ................................................................................................ 37
3.2.1 Gantt chart ............................................................................................................ 37
3.3 Class Diagram............................................................................................................... 38
3.4 Activity Diagram .......................................................................................................... 39
3.5 ER Diagram .................................................................................................................. 40
3.6 Detailed description of the components ..................................................................... 41
3.6.1 Components ........................................................................................................... 41
4 System Implementation ...................................................................................42
4.1 Introduction .................................................................................................................. 43
4.2. Code........................................................................................................................ 43
4.2.1 Signup Code........................................................................................................... 43
4.2.2 Login Code............................................................................................................. 45
4.2.3 Table Code ............................................................................................................. 46
4.2.4 Profile Code ........................................................................................................... 46
4.2.5 Find Profile ............................................................................................................ 48
4.2.6 Send Email ............................................................................................................. 52
4.2.7 Error Code ............................................................................................................. 53
4.3 Screen Shots .................................................................................................................. 55
4.3.1 Fetch/Find Blood Donor Module ......................................................................... 55
7
4.3.2 Contact Report and Bug Report From Module ................................................. 56
4.3.3 About ...................................................................................................................... 57
4.3.4 Registration ........................................................................................................... 61
4.3.5 Login....................................................................................................................... 62
4.3.6 Heros View ............................................................................................................. 63
4.3.7 Error Page ............................................................................................................. 64
4.3.8 Find Area ............................................................................................................... 65
4.3.9 Find Area On Mouse Over Reveal Phone Number ........................................... 66
5 System Testing ................................................................................................. 67
5.1 Unit Testing........................................................................................................................ 68
5.2 Integration Testing ............................................................................................................ 68
8
TABLE OF FIGURES
Figure 1: Spiral Model [1] ............................................................................................................ 23
Figure 2: Donor Registeation [2] .................................................................................................. 25
Figure 3 : Donor Verification[3] ................................................................................................... 26
Figure 4: Donor Login[4].............................................................................................................. 27
Figure 5: Donor Profile [5] ........................................................................................................... 28
Figure 6: Donor Profile Update[6]............................................................................................... 29
Figure 7: Donor Password Change[7].......................................................................................... 30
Figure 8: Donor Password Reset[8] ............................................................................................. 31
Figure 9: Donor Account Delete[9] .............................................................................................. 32
Figure 10: Donor Account Deactivate[10] .................................................................................. 33
Figure 11: Visitor Search For Blood Donor [11] .......................................................................... 34
Figure 12: Heros View[12] ........................................................................................................... 35
Figure 13: Visitor Contact and Bug Report[13] ........................................................................... 36
Figure 14: Gaint Chart [14]........................................................................................................... 37
Figure 15: Class diagram [15]....................................................................................................... 38
Figure 16: Activity Diagram[16] .................................................................................................. 39
Figure 17: ER diagram [17] ......................................................................................................... 40
Figure 18: Fetch/Find Blood Donor Module [18]......................................................................... 55
Figure 19: Contact Report and Bug Report From Module [19].................................................... 56
Figure 20: About [20] ................................................................................................................... 57
Figure 21: Registration [21] ......................................................................................................... 61
Figure 22: Login[22] ..................................................................................................................... 62
Figure 23: Hero’s View [23] ......................................................................................................... 63
Figure 24: Error Page [24] ........................................................................................................... 64
Figure 25: Find Area [25] ............................................................................................................ 65
Figure 26: Find Area On Mouse Over Reveal Phone Number [26] ............................................ 66
9
LIST OF TABLES
Table 1: Requirement .................................................................................................................... 15
Table 2: Login Module Test Case ................................................................................................. 69
Table 3: Signup Module Test Case ............................................................................................... 70
Table 4: Search Module Test Case ............................................................................................... 71
Table 5: Profile View Module Test Case ...................................................................................... 72
Table 6: Profile Update Module Test Case ................................................................................... 73
Table 7: Password Reset Module Test Case ................................................................................. 74
Table 8: Password Change Module Test Case .............................................................................. 75
Table 9: Acoount Delete Module Test Case ................................................................................. 76
Table 10: Account Deactivate Module Test Case......................................................................... 77
10
CHAPTER # 1
INTRODUCTION
11
1 INTRODUCTION
1.1 Introduction and history
Blood Donor is a web application suite designed to improve the quality and management
of blood bank and hospital health care management in the areas of health process analysis and
activity-based costing. That web application is developed for all operating systems those have a
web browser and internet connection also that can run on windows phone, Android, IOSX, Linux
etc. where blood finders, blood banks and hospitals can easily look for donors in their nearby
area who will be available in quick time. There will direct search on index(home) page to find
blood information’s. For search query login is not required. There is a login page or signup page
is attached. These pages are significant for gave your information for donation. donor and visitor
by-default on that page every intruder is a visitor. That type of account can check donors, search
for blood donation, get donors information and location. Donor account type is significant. If
anyone want to give their information for donation of blood then, first it has to registered on that
web application at signup details that person will gave its all significant information.
That project will help for all hospitals, Blood finders, Blood donors and every intruder can get
legal blood information with in constant interval. That account can check donors, search for
blood donation, get donors information and location. Donor account type is significant. If anyone
want to give their information for donation of blood then, first it has to registered on that web
application at signup details that person will gave its all significant information. In this
application we will able to execute live donation information’s and blood valuable data search.
There are major two account categories in our app; Donor, Finder/Visitor. They will locate as
donor as signed up account and finder maybe as direct visitor. Donors who are willing to donate
blood have to register in the system. While registering the donors are requested to give the details such as
Blood Group, Available days when the user can donate blood, Location, etc. When patient or visitor
search for a particular blood with particular area then system will automatically analyses the list of donors
who can donate blood for a particular patient and return a list of required donors.
12
1.3 Relevance to courses
1.3.1 Introduction to Programming (ICP)
A program is a set of instructions that tell the computer to do various things; sometimes the
instruction it has to perform depends on what happened when it performed a previous
instruction. This section gives an overview of the two main ways in which you can give these
instructions, or “commands” as they are usually called. One way uses an interpreter, the other
a compiler. As human languages are too difficult for a computer to understand in an
unambiguous way, commands are usually written in one or other languages specially designed
for the purpose.
13
devices is established using either cable media or wireless media. The best-known computer
network is the Internet.
This tutorial should teach you basics of Data Communication and Computer Network (DCN)
and will also take you through various advance concepts related to Data Communication and
Computer Network.
14
Requirement:
Software Requirements
MySQL Database
AN IOS Devices
Android phone
Hardware Requirements
Ram 512 MB
Android phone
15
1.4.3 Non-functional Requirement
Fast response
Fast result back from Data Base
Auto check Blood Types for donation by PHP artificial intelligence bot
Load Balance
HTML
Hypertext Markup Language is the standard markup language for creating static web
pages and also dynamic web applications.
CSS
CSS is a language that describes the style of an HTML document.CSS describes how
HTML elements should be displayed on a webpage. User interface is generally
developed using CSS.
JAVA SCRIPT
Java script is a high-level, object oriented, interpreted programming language. It is a
language which is also characterized as dynamic, weakly typed, prototype-based.
16
PHP
Hypertext Preprocessor is a server-side scripting language designed for Web
development, but also used as a general-purpose programming language.
Action Script
A scripting language to make more dynamic a HTML page and handle java script
animations. That will automatically have written by Adobe Animate CC tool.
1.5.2 Tools:
Sublime Text 3
That is easy and fast tool to write PHP, HTML, CSS, JS and other native
languages that’s why we use that for major development and code modulation.
Dreamweaver 2018
We initially take start form that tool to write HTML, CSS and JS because that tool
is more user friendly for beginner level. That’s why we take a start form that tool.
Adobe Animate CC
That tool is used for animation modules like auto write text script, SVG
animations etc. That will help to write action script for animation.
Adobe Photoshop
Logo, images, concept pages and prototypes for that web application will
designed in that tool.
1.7 Limitations
There are some limitations for this web application. Those are following:
If more than 3 thousand visitors access same page, then application show temporary
server down notification.
17
There is a bug on contact page, after submit of form that application require a MX
EMAIL configured with blood donor web app. As MX record of any email right now
that’s why that application does not send any email to our server and do nothing after
form sending.
There is a bug in hero’s page. The slider is interactive but for first time when it get load
its content move towards negative right margin but after a single click event its jQuery
get lodes and it adjusts itself at the center of hero’s page.
1.7.1 Advantages
That web application can
Find blood donors in constant time with area vise and blood type restriction.
Handle hounds of visitors plus query rate per second.
Manage donors through registration process.
Protect Donors information from over riding through secure md5 hash password.
Information of Donor can only be changeable after secure login of donor.
Delete and deactivate/suspend donor account through donor panel.
Provide the facility of total visitors on a donor’s profile.
Provide statistics of total registered users on that web application.
Provide facility of registration for Donor and can gave all information of Donor
with in constant O (1) time to visitor. That’s why visitor don’t have to be register
he/she can check all user’s data without registration process.
Provide easiest interference to users so that is a more user-friendly web application.
Show information in pagination so it can fetch information with much faster
manners.
If more than 3 thousand visitors access same page, then application show temporary
server down notification.
There is a bug on contact page, after submit of form that application require a MX
EMAIL configured with blood donor web app. As MX record of any email right now
that’s why that application does not send any email to our server and do nothing after
form sending.
18
1.9 The Necessity
Increase managerial satisfaction
Accurate Records
19
CHAPTER # 2
METHODOLOGY & WORK PLAN
20
2 Methodology & Workplan
2.1 Existing Methodologies
SPIRAL MODEL
“This Spiral model is a combination of iterative development process model and
sequential linear development model i.e. the waterfall model with a very high emphasis on risk
analysis. It allows incremental releases of the product or incremental refinement through each
iteration around the spiral.”
We have used spiral model because that model helps in parallel process where we both of team
members will easily divide that project into modules and will able to work on parallel at same
time that model also provide functionality of change management. If any change is required than
that is the only model where just those models are changed and that process does not effect on
any other module. Here all phases are separated but parallel can process. That’s why that model
gave more reliability and less time to develop that web application in team. Due to all such
reasons we have used spiral model in our project.
The spiral model is similar to the incremental model, with more emphasis placed on risk
analysis. The spiral model has four phases: Planning, Risk Analysis, Engineering and
Evaluation. A software project repeatedly passes through these phases in iterations (called
Spirals in this model). The baseline spiral, starting in the planning phase, requirements are
gathered and risk is assessed.
1. Planning Phase:
Requirements are gathered during the planning phase. Requirements like ‘BRS’ that is
‘Business Requirement Specifications’ and ‘SRS’ that is ‘System Requirement
specifications’.
2. Risk Analysis:
In the risk analysis phase, a process is undertaken to identify risk and alternate solutions.
A prototype is produced at the end of the risk analysis phase. If any risk is found during
the risk analysis, then alternate solutions are suggested and implemented.
21
3. Engineering Phase:
In this phase software is developed, along with testing at the end of the phase. Hence in
this phase the development and testing is done.
4. Evaluation phase:
This phase allows the customer to evaluate the output of the project to date before the
project continues to the next spiral.
Advantages:
Disadvantages:
22
2.1.3 Spiral Model Diagram
23
CHAPTER # 3
SYSTEM ANALYSIS & DESIGN
24
3 System Analysis & Design
3.1 Use Cases
Use cases of Blood Donor are as following:
Registration
Donor
PRE-CONDITION:
1. User have to provide valid email address and name and have to provide a correct
username and password.
2. User have to provide all required information other profile can also be update able after
registration.
POST CONDITION:
1. If details are accurate then send verification email and save user information in
database.
2. Account have to activate and show after verification and single click on verification
link, link mush be expired.
3. Verification link should be expiring after 15 minutes of registration.
4. There should be an option for “resend verification” link.
ALTERNATIVE PATH:
1. On wrong entries of registration id and invalid email address, system shows an error
message to user to re-enter valid details.
25
2. System have to show strength of password and provide suggestion for stronger
password.
3. If Donor already exists, then system should have to show message for existing user
and Display login link for such Donor.
CONSTRAINTS:
If Donor email already exist, then show a message of already exist donor and If username is
already registered then gave an error message of “not available”.
Verifivation
Donor
PRE CONDITION:
1. Donor must verify their account.
2. Send verification link in email address.
3. Click on verification link.
POST CONDITION:
1. Donor can click on the verification link.
. .
26
BASIC PATH:
1. Open email account.
2. Donor can receive the verification link on inbox.
3. Donor can click the link to verify your account.
4. After click, account will be verifying.
CONSTRAINTS:
Donor must Verify account through verification link in email address.
Login
Donor
PRE CONDITION:
1. Donor must enter correct Username and password.
2. After enter correct details the user will click the login button.
POST CONDITION:
1. After login donor profile will be shown.
2. User can manage their account profile after login.
27
BASIC PATH:
1. Type username/email address and password for login.
2. Click the login button.
3. System verifies the user.
4. If user verified through email, then login to this application.
5. For a verified user the entered details must be correct.
CONSTRAINTS:
1. If username/email address or password is wrong, then a message should be displayed
that user email or password is wrong and user does not exist.
2. If user not verified through email, then also show error message.
login
<<include>>
Donor
Profile
PRE CONDITION:
1.Donor must login.
28
POST CONDITION:
1. In case donor can update picture, password.
BASIC PATH:
1. Donor enters user email address and password to login.
2. If donor wants to change the profile go to setting.
3. Click on change the profile button.
4. Select the profile picture in user’s gallery.
5. Click on upload button.
6. Profile picture will change.
7. The changed profile will save in the database.
8. Refresh to check whether the profile has changed or not.
CONSTRAINTS:
1. Donor must login to change profile.
Login
Donor <<include>>
Profile update
29
PRE CONDITION:
1. Donor must Login.
POST CONDITION:
1. Donor can delete data of the profile assigned to him.
. .
BASIC PATH:
1. Enter email address and password for login.
2. Donor will click on delete button.
3. System will provide option to select files.
4. Donor will select required data that is wants to delete.
5. Click on delete button.
6. Information will be update in database.
CONSTRAINTS:
Donor must login to perform those tasks.
Login
<<include>>
Donor
Password change
30
PRE CONDITION:
POST CONDITION:
1. Donor can also use his email id to reset password in case of forgetting password.
BASIC PATH:
1. Type correct username and password then donor login.
2. After donor/user can change the password.
3. Click on change password button. Then Donor can enter new password.
4. Password saved to the database by replacing the existing password.
5. Donor can receive a message to change a password successfully.
CONSTRAINTS:
Login
<<extend>>
Donor
Password Reset
31
PRE CONDITION:
1. Donor can click on login page and after click on password reset.
POST CONDITION:
BASIC PATH:
1. Donor can click the reset password button.
2. After donor can reset password.
3. Donor can reset password through email.
4. Reset password code can be send in email address.
5. Donor can click the link/code.
6. After you can enter new password.
7. Password can be reset.
CONSTRAINTS:
Donor must have email account to perform those tasks.
Login
<<include>>
Donor
Delete
32
PRE CONDITION:
1. User must Login.
POST CONDITION:
1. Donor can delete account through email address or donor can click the delete button to
delete account
. .
BASIC PATH:
1. Enter email address and password for login.
2. Donor will click on delete button.
3. Click on delete button.
4. Account will be deleted.
CONSTRAINTS:
1. Instructor must login to perform those tasks.
Login
<<include>>
Donor Deactivate
33
PRE CONDITION:
1. User must Login.
POST CONDITION:
1. Donor can deactivate account through email address or donor can click the deactivate
button to deactivate account
. .
BASIC PATH:
1. Enter email address and password for login.
2. Door can find the deactivate button.
3. Donor will click on deactivate button.
4. Click on deactivate button.
5. Account will be deactivating.
CONSTRAINTS:
1. Instructor must login to perform those tasks.
Login
<<extend>>
Donor
Search
34
PRE CONDITION:
POST CONDITION:
. .
BASIC PATH:
User can have filtered donor through area wise or blood type wise or through both of
these.
CONSTRAINTS:
Home
<<extend>>
Donor
Heros
35
PRE CONDITION:
POST CONDITION:
Donors will become a hero after donating blood
BASIC PATH:
When door donate its blood its will be a hero.
CONSTRAINTS:
All blood donators will be shown in hero’s page
Donor
PRE CONDITION:
Visitor must be at contact form and fill at least name contact and message box to send
contact form or report a bug.
POST CONDITION:
An email to developer must sent after form submission.
36
BASIC PATH:
A sent message will display to visitor after email successful sent otherwise that will
show an error message
CONSTRAINTS:
IF There is no email address than don’t sent form.
2 4
1 2
0
Planning, Purposal design Phase implementation Testing documentationa
Submitted
37
3.3 Class Diagram
Donor
-username
-password
-time
-signupinfo[]
+find/search()
+Login()
+Signup()
UpdateProfiile()
Resetpassword()
deactivateAccont()
Visitor
-visittime
-device
-PublicIpaddress
+find/Search()
+contact_Form/Report_Bug()
Signup():Donor
Login():Donor
Figure 1: Class diagram [12]
38
3.4 Activity Diagram
Blood Donor
Deactivate_and_Delete_Ac
Login&Signup() UpdateProfile() Search()
count()
if exists then
Go to Profile
Find Donor
Login
Get Donor
True information
Retry
False
UpDate Information
SignUp
Deactivate Account
Chane Profile
Information
Delete Account
Phase
39
3.5 ER Diagram
Donor
PK Email
Password
Username
Bloodgroup
address
city
phonenumber
firstname
Secondname
deactivestate
verified
visitedby
Figure: ER diagram []
40
3.6 Detailed description of the components
3.6.1 Components
Visitor:
Fetch/ Find Blood Donors module
Contact Form and Bug Report Form module
Get Donors information module
Donor:
Registration
Login
Profile view
Profile update
Password reset
Password change
Account Delete
Account Deactivate
Account visits
41
CHAPTER # 4
SYSTEM IMPLEMENTATION
42
4 System Implementation
4.1 Introduction
Project Save Life Connect is an innovative approach to address global health. We provide
immediate access to blood donors in Sahiwal 24 hours a day, 7 days a week! Save Life Connect
is one of several community organizations working together as a network that respond to
disasters or emergency situations in an efficient manner.
What we do?
The ultimate goal of this project is to provide an easy-to-use, easy-to-access, efficient, and
reliable way to get life-saving blood, free of cost. Save Life Connect works with network
partners to connect blood donors. Our network of volunteer blood donors is ready to help save
lives any time, any place. Our automated system works efficiently whenever someone needs a
blood transfusion. Simply search about blood with blood group vise and area vise search than All
related required blood list will be shown at the page.
4.2 Code
4.2.1 Signup Code:
<?php
include(<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', 'blooddonor');
$db =
mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
?> );
session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
43
$myusername = mysqli_real_escape_string($db,$_POST['myusername']);
$mypassword = md5(mysqli_real_escape_string($db,$_POST['mypassword']));
$email = mysqli_real_escape_string($db,$_POST['email']);
$phone = mysqli_real_escape_string($db,$_POST['phone']);
$fname = mysqli_real_escape_string($db,$_POST['fname']);
$lname = mysqli_real_escape_string($db,$_POST['lname']);
$address = mysqli_real_escape_string($db,$_POST['address']);
$city = mysqli_real_escape_string($db,$_POST['city']);
$blood = mysqli_real_escape_string($db,$_POST['myblood']);
$sql="INSERT INTO
donor(username,password,email,phone,fname,lname,address,city,blood,verified,deactive)
values('$myusername','$mypassword','$email','$phone','$fname','$lname','$address','$city','$blood
','unverified','active')";
$result = mysqli_query($db,$sql);
$_SESSION['login'] = "true";
$_SESSION['login_user'] = $myusername;
$_SESSION['email'] = $email;
header("location: profile.php");
else {
?>
44
4.2.2 Login Code:
<?php
include(<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', 'blooddonor');
$db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
?>);
session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST"){
$username = mysqli_real_escape_string($db,$_POST['username']);
$password = mysqli_real_escape_string($db,$_POST['password']);
$sql = "SELECT username FROM user WHERE username = '$username' or email = '$username'
and password = '$password'";
$result = mysqli_query($db,$sql);
$row = mysqli_fetch_array($result,MYSQLI_ASSOC);
$active = $row['active'];
$count = mysqli_num_rows($result);
if($count == 1) {
session_register("username");
45
$_SESSION['login_user'] = $myusername;
header("location: profile.php");
}else {
else {
?>
session_start();
if(!isset($_SESSION['login']))
{$_SESSION['error']="Sorry your are not loged in Please Login First to visit this page";
header('Location: error.php');}
$fname=$_SESSION['fname'];
46
$lname=$_SESSION['lname'];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!--here is my navbar-->
</div>
<br><br>
<main>
47
<div class="container">
<div class="row">
<p><?php
?></p>
</div>
</div>
</div>
</main>
<!--Here is my Footer-->
</body>
</html>
if(!isset($_GET['myblood']))
die("<h1 style='color:red;'>Sorry Not Allowed to enter in this page Enter Blood Information to
get results</h1><script>window.location.href='index.html';</script>");
if (isset($_GET['myblood']))
$blood=$_GET['myblood'];
48
if (isset($_GET['farea']))
$area=$_GET['farea'];
if (isset($_GET['fcity']))
$city=$_GET['fcity'];
echo "".$blood;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
49
<body>
<!--here is my navbar-->
<br><br>
<main>
<div class="container">
<div class="row">
</div>
<div class="card-stacked">
<div class="card-content">
<h4>Name</h4>
<p><i class="material-
icons">location_on</i> <span style="text-decuration:none;"><a href="#">any
50
address</a></span><br> <i class="material-icons">location_city</i> <span class="deep-orange-
text">Sahiwal</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<!--Here is my Footer-->
</body>
</html>
//if variable are filled with information and method is post then do this
if ($_SERVER["REQUEST_METHOD"] == "POST") {
try{
session_start();
//Email information
$admin_email = "mih@asia.com";
if(isset($_POST['pemail']))
$email = $_POST['pemail'];
$comment = $_POST['message'];
if(isset($_POST['pcontact'])){
$contact=$_POST['pcontact'];
$comment.=$contact;
//send email
//Email response
catch(Exception $e){
else{
52
$_SESSION['error']="Restricted area";
header("location: error.php");
?>
session_start();
if(!isset($_SESSION['error']))
{header('Location: index.html');}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
53
<!--here is my navbar-->
<br><br>
<main>
<div class="container">
<div class="row">
<p><?php
</div>
</div>
</div>
</main>
<!--Here is my Footer-->
</body>
</html>
54
4.3 Screen Shots
4.3.1 Fetch/Find Blood Donor Module
55
4.3.2 Contact Form and Bug Report Form module
56
4.3.3 About
57
58
59
60
4.3.4 Registration
61
4.3.5 Login
62
4.3.6 Hero’s view
63
4.3.7 Error Page
64
4.3.8 Find Area
65
4.3.9 Find Area On Mouse Over Reveal Phone Number
66
CHAPTER # 5
SYSTEM TESTING
67
5. System Testing
System Testing is the testing of a complete and fully integrated software product. Usually
software is only one element of a larger computer based system. Ultimately, software is
interfaced with other software/hardware systems. System Testing is actually a series of different
tests whose sole purpose is to exercise the full computer based system.
System test falls under the black box testing category of software testing.
White box testing is the testing of the internal workings or code of a software application. In
contrast, black box or System Testing is the opposite. System test involves the external workings
of the software from the user's perspective.
Unit testing:
Unit testing performed on each module or block of code during
development. Unit Testing is normally done by the programmer who writes the code.
Integration testing
Integration testing done before, during and after integration of a new module into
the main software package. This involves testing of each individual code module.
One piece of software can contain several modules which are often created by several
different programmers. It is crucial to test each module's effect on the entire program
model.
68
Login Module Test Case TEST CASE
Description
Pre-conditions
Dependencies
User should have any mail account otherwise create first mail account
Expected
Step Test Steps Test Data Actual Result Status Notes
Result
1 Navigate to login User=example@g User should be able
User is navigated pass
page mail.com to login
2 Provide invalid User=notexist@g No user found signup User navigated to
pass
username mail.com first signup page
3 Navigate to Navigated with
Valid username Password:1234 pass
dashboard success
Post-conditions
User is validated with database and successfully login to account. The account session details are logged in
database.
69
Signup Module Test Case TEST CASE
Description
Pre-conditions
Dependencies
User should have an email account otherwise first create mail account.
Expected
Step Test Steps Test Data Actual Result Status Notes
Result
1 Navigate to User=example@g User should be able
User is navigated pass
signup page mail.com to signup
2 Verification code User navigated to
User=verify code Successfully Signup pass
sent to mail login page
3 Navigate to Navigated with
Valid username Password:1234 pass
dashboard success
Post-conditions
User is validated with database and successfully verify to account. The account session details are signup in
database.
70
Search Module Test Case TEST CASE
Description
User can easily search by area vise and blood group vise.
Pre-conditions
Dependencies
Expected
Step Test Steps Test Data Actual Result Status Notes
Result
1 All a+ blood donors
Navigate to
User=a+ information will User is navigated pass
Signup page
show.
2 Provide invalid User navigated to
User=c+ No result found pass
blood Group search
Post-conditions
User search for valid area vise or blood group vise to fetch out result.
71
Profile View Module Test Case TEST CASE
Description
Pre-conditions
Dependencies
Expected
Step Test Steps Test Data Actual Result Status Notes
Result
1 Navigate to User information will
User is navigated pass
profile page be shown
Post-conditions
All user information is shown in profile view. User Can be able to change its information
72
Profile Update Module Test Case TEST CASE
Description
Pre-conditions
Dependencies
Expected
Step Test Steps Test Data Actual Result Status Notes
Result
1 Navigate to Information is
User=change data User is navigated pass
update page Successfully Updated
2 Confirm Navigate to Navigated with
Password:1234 pass
Password dashboard success
Post-conditions
73
Password Reset Module Test Case TEST CASE
Description
Pre-conditions
Dependencies
User should have any recovery mail or contact information through which password will reset.
Expected
Step Test Steps Test Data Actual Result Status Notes
Result
1 User is navigated to
Navigate to User=recovery User should be able
create new pass
Forget Password address to reset password
password
2 Provide invalid write valid email or
User=not exist Not able to reset. pass
recovery address phone
Post-conditions
User must be able to reset its own account by verifying its recovery mail.
74
Password Change Module Test Case TEST CASE
Description
Pre-conditions
Dependencies
Expected
Step Test Steps Test Data Actual Result Status Notes
Result
1 Navigate to User=new
Confirm password User is navigated pass
change password password
2 conform Old User=old Password changed User navigated to
pass
password password successfully profile
Post-conditions
User has successfully changed its password after verifying its identity
75
Account Delete Module Test Case TEST CASE
Description
Pre-conditions
Dependencies
Expected
Step Test Steps Test Data Actual Result Status Notes
Result
1 Navigate to
Account is deleted User is native to
conform User=password pass
successfully create account
password page
Post-conditions
76
Account Deactivate Module Test Case TEST CASE
Description
Pre-conditions
Dependencies
User must have to login and verify its password for deactivation
Expected
Step Test Steps Test Data Actual Result Status Notes
Result
1 Account is
Navigate to User=verify User is navigated to
successfully pass
deactivate Page password home page.
deactivated
2 Provide invalid User=wrong User navigated to
Confirm Password pass
password password confirmation page
Post-conditions
77