SlideShare a Scribd company logo
A
PROJECT REPORT
ON
“COVID-19 MANAGEMENT SYSTEM”
Submitted in partial fulfilment
for the degree
of
BACHELOR OF COMPUTER APPLICATION (BCA)
Semester VI
by
1) Ms. Naina Sangole
2) Ms. Chetana Nimje
3) Ms. Prachi Dhawale
4) Ms. Sejal Meshram
SADABAI RAISONI WOMEN’S COLLEGE
Affiliated to
S.N.D.T Women’s University, Mumbai.
[2021-2022]
ACKNOWLEDGEMENT
With the completion of a report for a project on “Covid-19 Management System'', it
has given us immense pleasure and knowledge. We are sincerely thankful to Mrs. Amina Vali
(Principal, SRWC) and Project Guide, Mrs. Ashwini Ankar who have cooperated with us at
different stages during the preparation of this project.
Our Sincere thanks to staff of I.T Department without whose help it would not have
been possible for us to complete this report.
We would also like to thank the entire library and non-teaching staff for their constant
support while preparing this report.
PROJECTEES
Ms. Naina Sangole
Ms. Chetana Nimje
Ms. Prachi Dhawale
Ms. Sejal Meshram
(BCA FINAL YEAR)
CERTIFICATE
This is to certify that the project report entitled “Covid-19 Management System”
submitted by [Ms. Naina Sangole, Ms. Chetana Nimje, Ms. Prachi Dhawale, Ms. Sejal
Meshram] as a partial fulfilment for the requirement of BCA III year examination of the
Shreemati Nathibai Damodar Thackersey (S.N.D.T) Women’s University, Mumbai for the
academic session 2021-2022 is an original software project carried out under the supervision
and guidance of
Mrs. Ashwini Ankar has undergone the requisite duration as prescribed by the Shreemati
Nathibai Damodar Thackersey (S.N.D.T) Women’s University, Mumbai for the project work.
PROJECT GUIDE HEAD/PRINCIPAL
Signature: Signature:
Name: Mrs. Ashwini Ankar Name: Mrs. Amina Vali
Date: Date:
College Seal
INTERNAL EXAMINER EXTERNAL EXAMINER
Signature: Signature:
Name: Name:
Date: Date:
CONTENTS
SR.NO TOPICS PAGE NO
1. Abstract 1
2. Introduction 2
3. Literature Survey 3
3.1 Survey Existing System 4
3.2 Limitation existing system or Research gap 5
3.3 Problem Statement and Objectives 6
3.4 Scope 7
4. Proposed System 8
4.1 Analysis / Flowchart 9
4.2 Details of Hardware and Software 10 – 11
4.3 Design Details 12 – 13
4.4 Methodology 14
5. Screenshots 15 – 23
6. Coding 24 – 119
7. Conclusion 120
8. Bibliography 121
1
Abstract
The COVID-19 pandemic has broadly disrupted biomedical treatment and research including
non-invasive brain stimulation (NIBS). Moreover, the rapid onset of societal disruption and
evolving regulatory restrictions may not have allowed for systematic planning of how clinical
and research work may continue throughout the pandemic or be restarted as restrictions are
abated. The urgency to provide and develop NIBS as an intervention for diverse neurological
and mental health indications, and as a catalyst of fundamental brain research, is not
dampened by the parallel efforts to address the most life-threatening aspects of COVID-19;
rather in many cases the need for NIBS is heightened including the potential to mitigate
mental health consequences related to COVID-19.
To facilitate the re-establishment of access to NIBS clinical services and research operations
during the current COVID-19 pandemic and possible future outbreaks, we develop and
discuss a framework for balancing the importance of NIBS operations with safety
considerations, while addressing the needs of all stakeholders. We focus on Transcranial
Magnetic Stimulation (TMS) and low intensity transcranial Electrical Stimulation (tES) -
including transcranial Direct Current Stimulation (tDCS) and transcranial Alternating Current
Stimulation (tACS). Methods The present consensus paper provides guidelines and good
practices for managing and reopening NIBS clinics and laboratories through the immediate
and ongoing stages of COVID-19.
The document reflects the analysis of experts with domain relevant expertise spanning NIBS
technology, clinical services, and basic and clinical research – with an international
perspective. We outline regulatory aspects, human resources, NIBS optimization, as well as
accommodations for specific demographics. Results A model based on three phases (early
COVID-19 impact, current practices, and future preparation) with an 11-step checklist
(spanning removing or streamlining in-person protocols, incorporating telemedicine, and
addressing COVID-19-associated adverse events) is proposed. Recommendations on
implementing social distancing and sterilization of NIBS related equipment, specific
considerations of COVID-19 positive populations including mental health comorbidities, as
well as considerations regarding regulatory and human resource in the era of COVID-19 are
outlined. We discuss COVID-19 considerations specifically for clinical (sub-)populations
including pediatric, stroke, addiction, and the elderly.
2
INTRODUCTION
Coronavirus disease (COVID-19) is an infectious disease caused by a newly discovered
coronavirus. Most people who fall sick with COVID-19 will experience mild to moderate
symptoms and recover without special treatment.
Covid-19 management system is a project to track covid testing and users can register for
vaccines in one click. You can track corona cases in one click. Get covid report in one click.
As We have mentioned above, this Covid 19 Management System has 3 modules and each
of these has different restrictions. The Administrator Side is the admin panel of the system
where the management can manage the records in the system. The Admin panel requires an
admin credential in order to access the features and functions of the said module. The User
Module is the side of the system where the individuals can register their information and
schedule their testing time slot. On Public Website, this module mostly contains static
information about the purpose of the application and other details.
COVID-19 is a biological challenge, but as with so many things, materials science and
engineering can play a significant role in defeating it. The TMS COVID-19 Materials Needs
Exchange strives to connect organizations and programs on the front lines of the COVID-19
pandemic with TMS members who can render materials or manufacturing assistance,
resources, and/or expertise.
COVID-19 was first recognized in December 2019 and within months evolved into a global
pandemic declared by the World Health Organization (WHO) in March 2020. To avert its
rapid spread, country-specific restrictions have been introduced spanning strict
social/physical distancing measures, stay-at-home orders and even lockdowns, workplace
closings and furloughs/layoffs, postponing of elective procedures in medical centers to
preserve medical resources, suspending many in-person medical consultation and clinic
visits, or substituting these face-to-face consultations with remote interventions, e.g.
telecommunications.
Rapid collection and testing of appropriate specimens from patients meeting the suspect case
definition for COVID-19 is a priority for clinical management and outbreak control and
should be guided by a laboratory expert. Suspect cases should be screened for the virus with
nucleic acid amplification tests (NAAT), such as RT-PCR.
3
LITERATURE SURVEY
The survey addressing the impact of the COVID-19 pandemic was sent to institutions applying
NIBS (research laboratories and NIBS clinics) across the world. Replies were received from
29 institutions representing 17 countries.
These responses thus reflect the “situation on the ground” at the time of assessment with
ongoing remediation methods addressed later in this paper.
Mainly depending on the national and local restrictions in response to the COVID-19 outbreak
and the nature of protocols (e.g., type of technology, trial stage, clinical population), there were
substantial discrepancies in the extent to which neuromodulation operations were disrupted.
A systematic literature review was conducted using the Preferred Reporting Items for
Systematic Reviews and Meta-Analyses – PRISMA (Moher et al., 2009).
4
SURVEY EXISTING SYSTEM
The existing Covid-19 testing, if you want to test your covid symptoms because of covid you
have to move from one place to another place in a city. We have to look for transportation, But
the drawback of the transportation system is that you cannot decide the time limit and major
concern is the weight for transportation and also the safety in this covid situation. If we want
to check the report immediately, we can use this way.
● Using manual lab services, we have to go to the lab physically in this scenario. It
requires more time & more calculation.
● In lab services manually, the prices of testing is fixed and it is dangerous in covid
peak seasons.
● In this service, you can take the report in one click and also you can book the testing
as per your needs.
5
LIMITATION EXISTING SYSTEM OR RESEARCH GAP
As we have checked that people had to visit labs for covid test and for collecting reports. Some
people travel for distance for covid test, due to all these circumstances we have created this
project. The project titled ‘COVID-19 MANAGEMENT SYSTEM’ is developed by the health
services and direction and with their help. The system is tested and the performance of the
system is found to be acceptable.
All the necessary output is created. The system is found to be user-friendly with help messages
for the staff and admin.
The system was implemented successfully. The manpower and working hours needed to
operate the system was less and it was seen to be more secure. Thus, the Project was completed
successfully.
6
PROBLEM STATEMENT AND OBJECTIVES
This general Covid-19 management system site program will help many people who want to
take the RT-PCR test. This is a very helpful project.
1. Save time on manpower tasks
2. Less manpower
3. Increase your online visibility
4. Implement an effective vaccine management
5. Manage distribution functions
6. Increase safety
Accurate reports of covid-19
7
SCOPE
It is still mature and fully enthusiastic. Any requirements, this project is completed but still,
they want to update and modify some modules. We are always thinking about association
requirements also growing day by day.
We always want to implement something more. This project is completed when you watch, but
we want to implement more things.
⮚ Online Chat
⮚ Overseas Service
⮚ Service Request On chat
⮚ Extending geographical research
⮚ More Safety
8
PROPOSED SYSTEM
Our corona warrior system will help you to overcome all the above problems. This System will
give the assurity to customers that their vaccination can be done within the specific time slots
according to the distance of location. This system is not concerned with the weight of the
person. This system is quick and can be used in fast cases, for example if you want to get a
vaccine you can register on this website.
FEASIBILITY STUDY:
1. Technical Feasibility Study: The System is Technically feasible because here we are
using PHP platform / MySQL database which is free to use even for commercial
purposes. From the user’s point of view, it is feasible because it can fulfill users’
requirements and maintain their records and additional features like deciding specific
time slots are also available.
2. Operational Feasibility Study: Operational Feasibility is the measure of how well the
proposed system solves the problem and specifies the requirements in system
development. Our System is Operational Feasibility because it is admin-based software.
Admin will get a multiple task where She or He can authority that creates admin,
Registering Customer, tracking etc. admin gets a single module to do these operations.
3. Economical Feasibility Study: The purpose of the Economic Feasibility is to
demonstrate the net benefit of the proposed system. Our system is economically feasible
as the basic amount will be decided by the system depending on distance and the admin
will decide the timeslot and according to that. It is Admin-Based system so there is no
problem with additional charges, Customers just need to book the slot with the location
where he /she wants to give the covid sample test. Which they want to deliver at a
particular place and they have to give only minimum charges.
9
ANALYSIS / FLOWCHART
10
DETAILS OF HARDWARE AND SOFTWARE
Front End:
PHP: - PHP is a server-side scripting language designed for web development but also used
as a general-purpose programming language. While PHP originally stood for Personal Home
Page, it now stands for PHP: Hypertext Preprocessor, a recursive backronym code is
interpreted by a web server with a PHP processor module, which generates the resulting web
page: PHP commands can be embedded directly into an HTML source document rather than
calling an external file to process data.
HTML: - HTML or HyperText Markup Language is the main markup language for creating
web pages and other information that can be displayed in a web browser. HTML tags most
commonly come in pairs like and, although some tags represent empty elements and so are
unpaired, for example Error! Filename not specified. The first tag in a pair is the start tag,
and the second tag is the end tag (they are also called opening tags and closing tags).
BACK END:
MYSQL: - MySQL ("My S-Q-L", officially, but also called "My Sequel") is (as of July
2013) the world's second most widely used open-source relational database management
system (RDBMS). LAMP is an acronym for "Linux, Apache, MySQL, Perl/PHP/Python."
Applications which use MySQL databases include: TYPO3, MODx, Joomla, WordPress,
phpBB, MyBB, Drupal and other software. MySQL is also used in many high-profile, large-
scale websites, including Wikipedia, Google (though not for searches), Facebook, Twitter,
Flickr, and YouTube.
Technology:
● CSS: - CSS is a cascading style sheet which is used to give a designer look at HTML
using the external file.
● Javascript: - Javascript is used for client-side scripting which can help in using
validation on the website and many more other functions.
11
● XAMPP: - XAMPP is a free and open-source cross-platform web server solution stack
package developed by Apache Friends, consisting mainly of the Apache HTTP
Server, MariaDB database, and interpreters for scripts written in the PHP and Perl
programming languages.
● jQuery: - jQuery is a fast and concise JavaScript library. jQuery simplifies HTML
document traversing, event handling, animating, and Ajax interactions for Rapid Web
Development.
● Bootstrap: -Bootstrap themes also feature various UI components and page. Layouts
that can be employed to create websites. You can think of them as website templates
created with Bootstrap in mind.
[ Hardware Requirement]: -
CPU: Intel (R) Core (TM) i5 CPU M 520 @2.40GHz
Video: CPU built - in graphics {LCD / LED / TFT etc.}
Memory: 2.0 GB (2.0 GB x 1 ) RAM
HDD: 160 GB
Disk Drive: UGB portable
Input / Output: Multimedia mouse and Keyboard
12
DESIGN DETAILS
An important job of a system analyst is to make sure that the new design is implemented and
established standards. The implementation simply means conversion of new or revised system
design into an operational one.
Implementation of new system involved following task:
● IMPLEMENTATION: Implementation is activity considered as conversion of old
system into new system. The term system implementation is defined as the conversion
of design and coded system into the actual operation. This new system gradually
replaces the old system with the new one. Part by part the old system phased out and
new system Part by part phased in the result produced by each part of new system is
compared against the result of new system, errors are found out and removed once the
confidence is developed in a particular part of the new system, that part of the new
system is phased in and corresponding part of the old system is phased out. This method
is continuing for each and every part of the new system. The new system is slowly
phased in with the old system and slowly phased out.
● EVALUATION: After the implementation stage another stage in project development
is evaluation of the project. After keeping in working condition for some time all the
errors that might occur in program execution have shown up. The programmers need
to correct them so that the same errors are not repeated again and become program user-
friendly. 58 Maintenance Definitions and context Software maintenance sustains the
software product throughout its life cycle Modification requests are logged and tracked,
the impact of proposed changes determined, code is modified, testing is conducted, and
a new version of the software products released. Training is provided to users .Software
maintenance is the modification of a software product after delivery to correct faults,
to improve performance or other attributes, or to adapt the product to a modified
environment.
● THE SOFTWARE MAINTENANCE CONTEXT: Existing software - Software -
Modified software. In software engineering, software maintenance is the process of
enhancing and optimizing deployed software (software release),, as well as remedying
defects. Software maintenance is one the phases in the software development process,
and follows deployment of the software into the field. The software maintenance phase
13
involves changes to the software in order to correct defects and deficiencies found
during field usage as well as the addition of new functionality to improve the software
usability and applicability. Software maintenance involves a number of specific
techniques. One technique is static slicing, which is used to identify all the program
code that can modify some variable. It is generally useful in refractory program code
and was specifically useful in assuring Y2K compliance. The software maintenance
phase is an explicit part of the waterfall model of the software development process
which was developed during the structured programming movement of computer
programming. The other major model, the spiral model developed during the object-
oriented movement of software engineering makes no explicit mention of a
maintenance phase. Nevertheless, this activity is notable, considering the fact that two-
thirds of a software system's lifetime cost involves maintenance. In a formal software
development environment, the developing organization or team will have some
mechanisms to document and track defects and deficiencies. Software just like most
other typically released with a known set of defects and deficiencies. The software is
released with the issue because the development organization decides the utility and
value of the software at a particular level of quality over weighs the impact of known
defects and deficiencies. The known issues are normally documented in a letter of
operational considerations or release notes so that the user of the software will be able
to work around the known issues and will know when the use of the software would be
inappropriate for particular tasks. With the release of the software, other undocumented
defects and deficiencies will be discovered by the users of the software. As these issues
are reported into the development organization, they will be entered into the defect
tracking system. The people involved in the software maintenance are expected to work
on these known issues, address them, and prepare for a new release of the software,
known as a maintenance release, which will address the documented issue.
14
METHODOLOGY
The project titled ‘COVID-19 MANAGEMENT SYSTEM’ was developed by the health
services and direction and with their help. The system was tested and the performance of the
system was found to be acceptable.
All the necessary output was created. The system was found to be user-friendly with help
messages for the staff and admin.
The system was implemented successfully. The manpower and working hours needed to
operate the system was less and it was seen to be more secure. Thus, the Project was completed
successfully.
● Admin Panel
● Corona Tracker
● Testing Management
● Testing Details
● Track Report
● Information about Covid
15
SCREENSHOTS
1. Home Page
2. Live Tracker
16
3. Login
4. Admin Dashboard
17
5. Testing Dashboard
6. Search Reports
18
7. Testing Details
8. Database
19
Input Screen
Output Screen
20
21
Input Screen
Output Screen
22
Input Screen
Output Screen
23
24
CODING
ADMIN DASHBOARD CODE:
<?php
session_start();
include('includes/config.php');
if(isset($_POST['login']))
{
$uname=$_POST['username'];
$Password=md5($_POST['inputpwd']);
$query=mysqli_query($con,"select ID from tbladmin where AdminuserName='$uname'
&& Password='$Password' ");
$ret=mysqli_fetch_array($query);
if($ret>0){
$_SESSION['aid']=$ret['ID'];
header('location:dashboard.php');
}
else{
echo "<script>alert('Invalid Details.');</script>";
}
}
?>
25
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Covid 19 Warrior | Admin Login</title>
<!-- Custom fonts for this template-->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,
700,
700i,800,800i,900,900i" rel="stylesheet">
<!-- Custom styles for this template-->
<link href="css/sb-admin-2.min.css" rel="stylesheet">
</head>
<body class="bg-gradient-info">
<div class="container">
<!-- Outer Row -->
<div class="row justify-content-center">
<div class="col-xl-10 col-lg-12 col-md-9">
<h3 align="center" style="margin-top:4%;color:#fff;font-weight: bold">Covid-19 Warrior
Portal</h3>
<div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body p-0">
<!-- Nested Row within Card Body -->
26
<form name="login" method="post">
<div class="row">
<div class="col-lg-6 d-none d-lg-block bg-login-image"></div>
<div class="col-lg-6">
<div class="p-5">
<div class="text-center">
<h1 class="h4 text-gray-900 mb-4">Welcome Back!</h1>
</div>
<form class="user">
<div class="form-group">
<input type="text" class="form-control" name="username"
id="username" placeholder="Enter username" required="true">
</div>
<div class="form-group">
<input type="password" class="form-control" name="inputpwd"
id="inputpwd" placeholder="Password">
</div>
<input type="submit" name="login" class="btn btn-info btn-user btn-block"
value="login">
</form>
<hr>
<div class="text-center">
<a class="small" href="password-recovery.php" style="font-
weight:bold">Forgot Password?</a>
</div>
<div class="text-center">
<a class="small" href="index.php" style="font-weight:bold;"><i
class="fa fa-home" aria-hidden="true"></i> Home Page</a>
27
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="js/sb-admin-2.min.js"></script>
</body>
</html>
Homepage:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
28
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Covid-19 Warriors</title>
<! - - Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/scrolling-nav.css" rel="stylesheet">
</head>
<body id="page-top">
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-success fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">Covid-19 Warriors Portal</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-
target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-
label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#about">Coronavirus </a>
29
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#services">Covid-19 Symptoms</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#contact">Prevention</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger"
href="https://public.domo.com/cards/dJ45D">Live Tracker</a>
</li>
<li class="nav-item active">
<a class="nav-link js-scroll-trigger" href="new-user-testing.php">Testing</a>
</li>
<li class="nav-item active">
<a class="nav-link js-scroll-trigger" href="live-test-updates.php">Test Updates</a>
</li>
<li class="nav-item active">
<a class="nav-link js-scroll-trigger" href="patient-search-report.php">Covid
Report</a>
</li>
<li class="nav-item active">
<a class="nav-link js-scroll-trigger" href="login.php">Login</a>
30
</li>
</ul>
</div>
</div>
</nav>
<header class="bg-info text-white">
<div class="container text-center">
<h1>COVID19 Warriors</h1>
<p class="lead">COVID19 - Testing Management System</p>
</div>
</header>
<section id="about">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto" >
<h2>About this page</h2>
<p class="lead">Coronavirus disease (COVID-19) is an infectious disease caused by a
newly discovered coronavirus. Most people infected with the COVID-19, virus will experience
mild to moderate, respiratory illness & recover without requiring special treatment. Older
people and those with underlying medical problem like cardiovascular disease.</p>
<p class="lead">The COVID-19 virus spread primarily through droplet of saliva or
discharge from the nose when an infected person coughs or sneezes so it’s important that you
also practice respiratory etiquette.</p>
</div>
31
</div>
</div>
</section>
<section id="services" class="bg-light">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<h2>Covid-19 Symptoms</h2>
<hr />
<p><strong>Hight Fever 2-14 days!</strong><br />
Reported illnesses have ranged from mild symptoms to severe illness and death</p>
<hr />
<p><strong>Dry Cough 2-14 days!</strong><br />
Reported illnesses have ranged from mild symptoms to severe illness and death</p>
<hr />
<p><strong>Shortness of breath!</strong><br />
Reported illnesses have ranged from mild symptoms to severe illness and death</p>
</div>
</div>
</div>
</section>
<section id="contact">
<div class="container">
32
<div class="row">
<div class="col-lg-8 mx-auto">
<h2>Prevention</h2>
<ul>
<li>Wash your Hands often</li>
<li>Wear A Face mask</li>
<li>Avoid contact with sick people</li>
<li>Always cover your cough or sneeze</li>
</ul>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="py-5 bg-info">
<div class="container">
<p class="m-0 text-center text-white">Copyright &copy; Corona Warriors Website
2021</p>
</div>
<!-- /.container -->
</footer>
<!-- Bootstrap core JavaScript -->
33
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Plugin JavaScript -->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom JavaScript for this theme -->
<script src="js/scrolling-nav.js"></script>
</body>
</html>
NEW TEST:
<?php session_start();
//DB conncetion
include_once('includes/config.php');
//error_reporting(0);
//validating Session
if (strlen($_SESSION['aid']==0)) {
header('location:logout.php');
} else{
?>
<!DOCTYPE html>
34
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Covid-Tms | New Test Request</title>
<!-- Custom fonts for this template -->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,
700,700i,800,800i,900,900i” rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/sb-admin-2.min.css" rel="stylesheet">
<!-- Custom styles for this page -->
<link href="vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">
</head>
<body id="page-top">
<!-- Page Wrapper -->
<div id="wrapper">
<!-- Sidebar -->
35
<?php include_once('includes/sidebar.php');?>
<!-- End of Sidebar -->
<!-- Content Wrapper -->
<div id="content-wrapper" class="d-flex flex-column">
<!-- Main Content -->
<div id="content">
<!-- Topbar -->
<?php include_once('includes/topbar.php');?>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="container-fluid">
<!-- Page Heading -->
<h1 class="h3 mb-2 text-gray-800">New Test Requests</h1>
<!-- DataTales Example -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">New Test Requests</h6>
</div>
<div class="card-body">
<div class="table-responsive">
<form name="assignto" method="post">
<table class="table table-bordered" id="dataTable" width="100%"
cellspacing="0">
36
<thead>
<tr>
<th>Sno.</th>
<th>Order No.</th>
<th>Patient Name</th>
<th>Mobile No.</th>
<th>Test Type</th>
<th>Time Slot</th>
<th>Reg. Date</th>
<th>Action</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Sno. </th>
<th>Order No.</th>
<th>Patient Name</th>
<th>Mobile No.</th>
<th>Test Type</th>
<th>Time Slot</th>
<th>Reg. Date</th>
<th>Action</th>
</tr>
37
</tfoot>
<tbody>
<?php $query=mysqli_query($con,"select
tbltestrecord.OrderNumber,tblpatients.FullName,tblpatients.MobileNumber,tbltestrecord.Test
Type,tbltestrecord.TestTimeSlot,tbltestrecord.RegistrationDate,tbltestrecord.id as testid from
tbltestrecord
join tblpatients on tblpatients.MobileNumber=tbltestrecord.PatientMobileNumber
where ReportStatus is null
");
$cnt=1;
while($row=mysqli_fetch_array($query)){
?>
<tr>
<td><?php echo $cnt;?></td>
<td><?php echo $row['OrderNumber'];?></td>
<td><?php echo $row['FullName'];?></td>
<td><?php echo $row['MobileNumber'];?></td>
<td><?php echo $row['TestType'];?></td>
<td><?php echo $row['TestTimeSlot'];?></td>
<td><?php echo $row['RegistrationDate'];?></td>
<td>
<a href="test-details.php?tid=<?php echo $row['testid'];?>&&oid=<?php
echo $row['OrderNumber'];?>" class="btn btn-info btn-sm">View Details</a>
</td>
38
</tr>
<?php $cnt++;} ?>
</tbody>
</table>
</form>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
<!-- Footer -->
<?php include_once('includes/footer.php');?>
<!-- End of Footer -->
</div>
<!-- End of Content Wrapper -->
</div>
<!-- End of Page Wrapper -->
<!-- Scroll to Top Button-->
<?php include_once('includes/footer2.php');?>
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
39
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="js/sb-admin-2.min.js"></script>
<!-- Page level plugins -->
<script src="vendor/datatables/jquery.dataTables.min.js"></script>
<script src="vendor/datatables/dataTables.bootstrap4.min.js"></script>
<!-- Page level custom scripts -->
<script src="js/demo/datatables-demo.js"></script>
</body>
</html>
<?php } ?>
/**
* Get error messages.
*
* @return array
*/
protected function get_messages()
{
40
$lang_file =
__DIR__.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR.$this-
>lang.'.php';
$messages = require $lang_file;
if ($validation_methods_errors = self::$validation_methods_errors) {
$messages = array_merge($messages, $validation_methods_errors);
}
return $messages;
}
/**
* Process the validation errors and return human readable error messages.
*
* @param bool $convert_to_string = false
* @param string $field_class
* @param string $error_class
*
* @return array
* @return string
*/
public function get_readable_errors($convert_to_string = false, $field_class = 'gump-field',
$error_class = 'gump-error-message')
{
41
if (empty($this->errors)) {
return ($convert_to_string) ? null : array();
}
$resp = array();
// Error messages
$messages = $this->get_messages();
foreach ($this->errors as $e) {
$field = ucwords(str_replace($this->fieldCharsToRemove, chr(32), $e['field']));
$param = $e['param'];
// Let's fetch explicit field names if they exist
if (array_key_exists($e['field'], self::$fields)) {
$field = self::$fields[$e['field']];
// If param is a field (i.e. equalsfield validator)
if (array_key_exists($param, self::$fields)) {
$param = self::$fields[$e['param']];
}
}
// Messages
42
if (isset($messages[$e['rule']])) {
if (is_array($param)) {
$param = implode(', ', $param);
}
$message = str_replace('{param}', $param, str_replace('{field}', '<span
class="'.$field_class.'">'.$field.'</span>', $messages[$e['rule']]));
$resp[] = $message;
} else {
throw new Exception ('Rule "'.$e['rule'].'" does not have an error message');
}
}
if (!$convert_to_string) {
return $resp;
} else {
$buffer = '';
foreach ($resp as $s) {
$buffer .= "<span class="$error_class">$s</span>";
}
return $buffer;
}
}
/**
43
* Process the validation errors and return an array of errors with field names as keys.
*
* @param $convert_to_string
*
* @return array | null (if empty)
*/
public function get_errors_array($convert_to_string = null)
{
if (empty($this->errors)) {
return ($convert_to_string) ? null : array();
}
$resp = array();
// Error messages
$messages = $this->get_messages();
foreach ($this->errors as $e)
{
$field = ucwords(str_replace(array('_', '-'), chr(32), $e['field']));
$param = $e['param'];
// Let's fetch explicit field names if they exist
44
if (array_key_exists($e['field'], self::$fields)) {
$field = self::$fields[$e['field']];
// If param is a field (i.e. equalsfield validator)
if (array_key_exists($param, self::$fields)) {
$param = self::$fields[$e['param']];
}
}
// Messages
if (isset($messages[$e['rule']])) {
// Show first validation error and don't allow to be overwritten
if (!isset($resp[$e['field']])) {
if (is_array($param)) {
$param = implode(', ', $param);
}
$message = str_replace('{param}', $param, str_replace('{field}', $field,
$messages[$e['rule']]));
$resp[$e['field']] = $message;
}
} else {
throw new Exception ('Rule "'.$e['rule'].'" does not have an error message');
}
45
}
return $resp;
}
/**
* Filter the input data according to the specified filter set.
*
* @param mixed $input
* @param array $filterset
*
* @throws Exception
*
* @return mixed
*
* @throws Exception
*/
public function filter(array $input, array $filterset)
{
foreach ($filterset as $field => $filters) {
if (!array_key_exists($field, $input)) {
continue;
}
46
$filters = explode('|', $filters);
foreach ($filters as $filter)
{
$params = null;
if (strstr($filter, ',') !== false) {
$filter = explode(',', $filter);
$params = array_slice($filter, 1, count($filter) - 1);
$filter = $filter[0];
}
if (is_array($input[$field])) {
$input_array = &$input[$field];
} else {
$input_array = array(&$input[$field]);
}
foreach ($input_array as &$value) {
if (is_callable(array($this, 'filter_'.$filter))) {
$method = 'filter_'.$filter;
$value = $this->$method($value, $params);
} elseif (function_exists($filter)) {
$value = $filter($value);
47
} elseif (isset(self::$filter_methods[$filter])) {
$value = call_user_func(self::$filter_methods[$filter], $value, $params);
} else {
throw new Exception("Filter method '$filter' does not exist.");
}
}
}
}
return $input;
}
// ** ------------------------- Filters --------------------------------------- ** //
/**
* Replace noise words in a string
(http://tax.cchgroup.com/help/Avoiding_noise_words_in_your_search.htm).
*
* Usage: '<index>' => 'noise_words'
*
* @param string $value
* @param array $params
*
* @return string
48
*/
protected function filter_noise_words($value, $params = null)
{
$value = preg_replace('/ss+/u', chr(32), $value);
$value = " $value ";
$words = explode(',', self::$en_noise_words);
foreach ($words as $word) {
$word = trim($word);
$word = " $word "; // Normalize
if (stripos($value, $word) !== false) {
$value = str_ireplace($word, chr(32), $value);
}
}
return trim($value);
}
/**
* Remove all known punctuation from a string.
*
* Usage: '<index>' => 'rmpunctuataion'
*
* @param string $value
49
* @param array $params
*
* @return string
*/
protected function filter_rmpunctuation($value, $params = null)
{
return preg_replace("/(?![.=$'€%-])p{P}/u", '', $value);
}
/**
* Sanitize the string by removing any script tags.
*
* Usage: '<index>' => 'sanitize_string'
*
* @param string $value
* @param array $params
*
* @return string
*/
protected function filter_sanitize_string($value, $params = null)
{
return filter_var($value, FILTER_SANITIZE_STRING);
}
50
/**
* Sanitize the string by urlencoding characters.
*
* Usage: '<index>' => 'urlencode'
*
* @param string $value
* @param array $params
*
* @return string
*/
protected function filter_urlencode($value, $params = null)
{
return filter_var($value, FILTER_SANITIZE_ENCODED);
}
/**
* Sanitize the string by converting HTML characters to their HTML entities.
*
* Usage: '<index>' => 'htmlencode'
*
* @param string $value
* @param array $params
51
*
* @return string
*/
protected function filter_htmlencode($value, $params = null)
{
return filter_var($value, FILTER_SANITIZE_SPECIAL_CHARS);
}
/**
* Sanitize the string by removing illegal characters from emails.
*
* Usage: '<index>' => 'sanitize_email'
*
* @param string $value
* @param array $params
*
* @return string
*/
protected function filter_sanitize_email($value, $params = null)
{
return filter_var($value, FILTER_SANITIZE_EMAIL);
}
52
/**
* Sanitize the string by removing illegal characters from numbers.
*
* @param string $value
* @param array $params
*
* @return string
*/
protected function filter_sanitize_numbers($value, $params = null)
{
return filter_var($value, FILTER_SANITIZE_NUMBER_INT);
}
/**
* Sanitize the string by removing illegal characters from float numbers.
*
* @param string $value
* @param array $params
*
* @return string
*/
protected function filter_sanitize_floats($value, $params = null)
{
53
return filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT,
FILTER_FLAG_ALLOW_FRACTION);
}
/**
* Filter out all HTML tags except the defined basic tags.
*
* @param string $value
* @param array $params
*
* @return string
*/
protected function filter_basic_tags($value, $params = null)
{
return strip_tags($value, self::$basic_tags);
}
/**
* Convert the provided numeric value to a whole number.
*
* @param string $value
* @param array $params
*
* @return string
54
*/
protected function filter_whole_number($value, $params = null)
{
return intval($value);
}
/**
* Convert MS Word special characters to web safe characters.
* [“, ”, ‘, ’, –, …] => [", ", ', ', -, ...]
*
* @param string $value
* @param array $params
*
* @return string
*/
protected function filter_ms_word_characters($value, $params = null)
{
$word_open_double = '“';
$word_close_double = '”';
$web_safe_double = '"';
$value = str_replace(array($word_open_double, $word_close_double), $web_safe_double,
$value);
$word_open_single = '‘';
55
$word_close_single = '’';
$web_safe_single = "'";
$value = str_replace(array($word_open_single, $word_close_single), $web_safe_single,
$value);
$word_em = '–';
$web_safe_em = '-';
$value = str_replace($word_em, $web_safe_em, $value);
$word_ellipsis = '…';
$web_safe_em = '...';
$value = str_replace($word_ellipsis, $web_safe_em, $value);
return $value;
}
// ** ------------------------- Validators ------------------------------------ ** //
/**
* Verify that a value is contained within the pre-defined value set.
*
* Usage: '<index>' => 'contains,value value value'
*
* @param string $field
* @param array $input
* @param null $param
*
56
* @return mixed
*/
protected function validate_contains($field, $input, $param = null)
{
if (!isset($input[$field])) {
return;
}
$param = trim(strtolower($param));
$value = trim(strtolower($input[$field]));
if (preg_match_all('#'(.+?)'#', $param, $matches, PREG_PATTERN_ORDER)) {
$param = $matches[1];
} else {
$param = explode(chr(32), $param);
}
if (in_array($value, $param)) { // valid, return nothing
return;
}
return array(
57
'field' => $field,
'value' => $value,
'rule' => __FUNCTION__,
'param' => $param,
);
}
/**
* Verify that a value is contained within the pre-defined value set.
* OUTPUT: will NOT show the list of values.
*
* Usage: '<index>' => 'contains_list,value;value;value'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_contains_list($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
58
$param = trim(strtolower($param));
$value = trim(strtolower($input[$field]));
$param = explode(';', $param);
// consider: in_array(strtolower($value), array_map('strtolower', $param)
if (in_array($value, $param)) { // valid, return nothing
return;
} else {
return array(
'field' => $field,
'value' => $value,
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Verify that a value is NOT contained within the pre-defined value set.
59
* OUTPUT: will NOT show the list of values.
*
* Usage: '<index>' => 'doesnt_contain_list,value;value;value'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_doesnt_contain_list($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
$param = trim(strtolower($param));
$value = trim(strtolower($input[$field]));
$param = explode(';', $param);
if (!in_array($value, $param)) { // valid, return nothing
return;
60
} else {
return array(
'field' => $field,
'value' => $value,
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Check if the specified key is present and not empty.
*
* Usage: '<index>' => 'required'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_required($field, $input, $param = null)
{
61
if (isset($input[$field]) && ($input[$field] === false || $input[$field] === 0 ||
$input[$field] === 0.0 || $input[$field] === '0' || !empty($input[$field]))) {
return;
}
return array(
'field' => $field,
'value' => null,
'rule' => __FUNCTION__,
'param' => $param,
);
}
/**
* Determine if the provided email is valid.
*
* Usage: '<index>' => 'valid_email'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
62
*/
protected function validate_valid_email($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!filter_var($input[$field], FILTER_VALIDATE_EMAIL)) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided value length is less or equal to a specific value.
*
* Usage: '<index>' => 'max_len,240'
*
* @param string $field
63
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_max_len($field, $input, $param = null)
{
if (!isset($input[$field])) {
return;
}
if (function_exists('mb_strlen')) {
if (mb_strlen($input[$field]) <= (int) $param) {
return;
}
} else {
if (strlen($input[$field]) <= (int) $param) {
return;
}
}
return array(
'field' => $field,
64
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
/**
* Determine if the provided value length is more or equal to a specific value.
*
* Usage: '<index>' => 'min_len,4'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_min_len($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
65
}
if (function_exists('mb_strlen')) {
if (mb_strlen($input[$field]) >= (int) $param) {
return;
}
} else {
if (strlen($input[$field]) >= (int) $param) {
return;
}
}
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
/**
* Determine if the provided value length matches a specific value.
*
66
* Usage: '<index>' => 'exact_len,5'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_exact_len($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (function_exists('mb_strlen')) {
if (mb_strlen($input[$field]) == (int) $param) {
return;
}
} else {
if (strlen($input[$field]) == (int) $param) {
return;
}
}
67
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
/**
* Determine if the provided value contains only alpha characters.
*
* Usage: '<index>' => 'alpha'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_alpha($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
68
return;
}
if (!preg_match('/^([a-
zÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ])+$/i',
$input[$field]) !== false) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided value contains only alpha-numeric characters.
*
* Usage: '<index>' => 'alpha_numeric'
*
* @param string $field
* @param array $input
* @param null $param
69
*
* @return mixed
*/
protected function validate_alpha_numeric($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!preg_match('/^([a-z0-
9ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ])+$/i',
$input[$field]) !== false) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided value contains only alpha characters with dashed and
underscores.
70
*
* Usage: '<index>' => 'alpha_dash'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_alpha_dash($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!preg_match('/^([a-z0-
9ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ_-])+$/i',
$input[$field]) !== false) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
71
'param' => $param,
);
}
}
/**
* Determine if the provided value contains only alpha numeric characters with spaces.
*
* Usage: '<index>' => 'alpha_numeric_space'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_alpha_numeric_space($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
72
if (!preg_match("/^([a-z0-
9ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿs])+$/i",
$input[$field]) !== false) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided value contains only alpha numeric characters with spaces.
*
* Usage: '<index>' => 'alpha_space'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
73
protected function validate_alpha_space($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!preg_match("/^([0-9a-
zÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿs])+$/i",
$input[$field]) !== false) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided value is a valid number or numeric string.
*
* Usage: '<index>' => 'numeric'
*
74
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_numeric($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!is_numeric($input[$field])) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
75
* Determine if the provided value is a valid integer.
*
* Usage: '<index>' => 'integer'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_integer($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (filter_var($input[$field], FILTER_VALIDATE_INT) === false) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
76
}
/**
* Determine if the provided value is a PHP accepted boolean.
*
* Usage: '<index>' => 'boolean'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_boolean($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field]) && $input[$field] !== 0) {
return;
}
$booleans = array('1','true',true,1,'0','false',false,0,'yes','no','on','off');
if (in_array($input[$field], $booleans, true )) {
return;
}
77
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
/**
* Determine if the provided value is a valid float.
*
* Usage: '<index>' => 'float'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_float($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
78
return;
}
if (filter_var($input[$field], FILTER_VALIDATE_FLOAT) === false) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided value is a valid URL.
*
* Usage: '<index>' => 'valid_url'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
79
*/
protected function validate_valid_url($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!filter_var($input[$field], FILTER_VALIDATE_URL)) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if a URL exists & is accessible.
*
* Usage: '<index>' => 'url_exists'
*
* @param string $field
80
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_url_exists($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
$url = parse_url(strtolower($input[$field]));
if (isset($url['host'])) {
$url = $url['host'];
}
if (function_exists('checkdnsrr')) {
if (checkdnsrr($url) === false) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
81
'param' => $param,
);
}
} else {
if (gethostbyname($url) == $url) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
}
/**
* Determine if the provided value is a valid IP address.
*
* Usage: '<index>' => 'valid_ip'
*
* @param string $field
* @param array $input
*
82
* @return mixed
*/
protected function validate_valid_ip($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!filter_var($input[$field], FILTER_VALIDATE_IP) !== false) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided value is a valid IPv4 address.
*
* Usage: '<index>' => 'valid_ipv4'
*
83
* @param string $field
* @param array $input
*
* @return mixed
*
* @see http://pastebin.com/UvUPPYK0
*/
/*
* What about private networks? http://en.wikipedia.org/wiki/Private_network
* What about loop-back address? 127.0.0.1
*/
protected function validate_valid_ipv4($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!filter_var($input[$field], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
// removed !== FALSE
return array(
'field' => $field,
84
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided value is a valid IPv6 address.
*
* Usage: '<index>' => 'valid_ipv6'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_valid_ipv6($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
85
if (!filter_var($input[$field], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the input is a valid credit card number.
*
* See: http://stackoverflow.com/questions/174730/what-is-the-best-way-to-validate-a-
credit-card-in-php
* Usage: '<index>' => 'valid_cc'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_valid_cc($field, $input, $param = null)
86
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
$number = preg_replace('/D/', '', $input[$field]);
if (function_exists('mb_strlen')) {
$number_length = mb_strlen($number);
} else {
$number_length = strlen($number);
}
$parity = $number_length % 2;
$total = 0;
for ($i = 0; $i < $number_length; ++$i) {
$digit = $number[$i];
if ($i % 2 == $parity) {
$digit *= 2;
87
if ($digit > 9) {
$digit -= 9;
}
}
$total += $digit;
}
if ($total % 10 == 0) {
return; // Valid
}
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
/**
* Determine if the input is a valid human name [Credits to http://github.com/ben-s].
*
88
* See: https://github.com/Wixel/GUMP/issues/5
* Usage: '<index>' => 'valid_name'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_valid_name($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!preg_match("/^([a-
zÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïñðòóôõöùúûüýÿ '-])+$/i",
$input[$field]) !== false) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
89
}
}
/**
* Determine if the provided input is likely to be a street address using weak detection.
*
* Usage: '<index>' => 'street_address'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_street_address($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
// Theory: 1 number, 1 or more spaces, 1 or more words
$hasLetter = preg_match('/[a-zA-Z]/', $input[$field]);
$hasDigit = preg_match('/d/', $input[$field]);
$hasSpace = preg_match('/s/', $input[$field]);
90
$passes = $hasLetter && $hasDigit && $hasSpace;
if (!$passes) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided value is a valid IBAN.
*
* Usage: '<index>' => 'iban'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
91
protected function validate_iban($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
static $character = array(
'A' => 10, 'C' => 12, 'D' => 13, 'E' => 14, 'F' => 15, 'G' => 16,
'H' => 17, 'I' => 18, 'J' => 19, 'K' => 20, 'L' => 21, 'M' => 22,
'N' => 23, 'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27, 'S' => 28,
'T' => 29, 'U' => 30, 'V' => 31, 'W' => 32, 'X' => 33, 'Y' => 34,
'Z' => 35, 'B' => 11
);
if (!preg_match("/A[A-Z]{2}d{2} ?[A-Zd]{4}( ?d{4}){1,} ?d{1,4}z/",
$input[$field])) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
92
$iban = str_replace(' ', '', $input[$field]);
$iban = substr($iban, 4).substr($iban, 0, 4);
$iban = strtr($iban, $character);
if (bcmod($iban, 97) != 1) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided input is a valid date (ISO 8601).
*
* Usage: '<index>' => 'date'
*
* @param string $field
* @param string $input date ('Y-m-d') or datetime ('Y-m-d H:i:s')
* @param null $param
*
93
* @return mixed
*/
protected function validate_date($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
$cdate1 = date('Y-m-d', strtotime($input[$field]));
$cdate2 = date('Y-m-d H:i:s', strtotime($input[$field]));
if ($cdate1 != $input[$field] && $cdate2 != $input[$field]) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided input meets age requirement (ISO 8601).
94
*
* Usage: '<index>' => 'min_age,13'
*
* @param string $field
* @param string $input date ('Y-m-d') or datetime ('Y-m-d H:i:s')
* @param string $param int
*
* @return mixed
*/
protected function validate_min_age($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
$cdate1 = new DateTime(date('Y-m-d', strtotime($input[$field])));
$today = new DateTime(date('d-m-Y'));
$interval = $cdate1->diff($today);
$age = $interval->y;
if ($age <= $param) {
return array(
95
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided numeric value is lower or equal to a specific value.
*
* Usage: '<index>' => 'max_numeric,50'
*
* @param string $field
* @param array $input
* @param null $param
*
* @return mixed
*/
protected function validate_max_numeric($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
96
}
if (is_numeric($input[$field]) && is_numeric($param) && ($input[$field] <= $param))
{
return;
}
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
/**
* Determine if the provided numeric value is higher or equal to a specific value.
*
* Usage: '<index>' => 'min_numeric,1'
*
* @param string $field
* @param array $input
* @param null $param
97
* @return mixed
*/
protected function validate_min_numeric($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (is_numeric($input[$field]) && is_numeric($param) && ($input[$field] >= $param))
{
return;
}
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
/**
* Determine if the provided value starts with param.
98
*
* Usage: '<index>' => 'starts,Z'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_starts($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (strpos($input[$field], $param) !== 0) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
99
/**
* Checks if a file was uploaded.
*
* Usage: '<index>' => 'required_file'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_required_file($field, $input, $param = null)
{
if (!isset($input[$field])) {
return;
}
if (is_array($input[$field]) && $input[$field]['error'] !== 4) {
return;
}
return array(
'field' => $field,
'value' => $input[$field],
100
'rule' => __FUNCTION__,
'param' => $param,
);
}
/**
* Check the uploaded file for extension for now
* checks only the ext should add mime type check.
*
* Usage: '<index>' => 'extension,png;jpg;gif
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_extension($field, $input, $param = null)
{
if (!isset($input[$field])) {
return;
}
if (is_array($input[$field]) && $input[$field]['error'] !== 4) {
101
$param = trim(strtolower($param));
$allowed_extensions = explode(';', $param);
$path_info = pathinfo($input[$field]['name']);
$extension = $path_info['extension'];
if (in_array($extension, $allowed_extensions)) {
return;
}
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Determine if the provided field value equals current field value.
*
*
102
* Usage: '<index>' => 'equalsfield,Z'
*
* @param string $field
* @param string $input
* @param string $param field to compare with
*
* @return mixed
*/
protected function validate_equalsfield($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if ($input[$field] == $input[$param]) {
return;
}
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
103
);
}
/**
* Determine if the provided field value is a valid GUID (v4)
*
* Usage: '<index>' => 'guidv4'
*
* @param string $field
* @param string $input
* @param string $param field to compare with
* @return mixed
*/
protected function validate_guidv4($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (preg_match("/{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-
9]{12}}?$/", $input[$field])) {
return;
}
104
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
/**
* Trims whitespace only when the value is a scalar.
*
* @param mixed $value
*
* @return mixed
*/
private function trimScalar($value)
{
if (is_scalar($value)) {
$value = trim($value);
}
return $value;
}
105
/**
* Determine if the provided value is a valid phone number.
*
* Usage: '<index>' => 'phone_number'
*
* @param string $field
* @param array $input
*
* @return mixed
*
* Examples:
*
* 555-555-5555: valid
* 5555425555: valid
* 555 555 5555: valid
* 1(519) 555-4444: valid
* 1 (519) 555-4422: valid
* 1-555-555-5555: valid
* 1-(555)-555-5555: valid
*/
protected function validate_phone_number($field, $input, $param = null)
{
106
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
$regex = '/^(d[s-]?)?[([s-]{0,2}?d{3}[)]s-]{0,2}?d{3}[s-]?d{4}$/i';
if (!preg_match($regex, $input[$field])) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* Custom regex validator.
*
* Usage: '<index>' => 'regex,/your-regex-expression/'
*
* @param string $field
* @param array $input
*
107
* @return mixed
*/
protected function validate_regex($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
$regex = $param;
if (!preg_match($regex, $input[$field])) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
* JSON validator.
*
* Usage: '<index>' => 'valid_json_string'
108
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_valid_json_string($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!is_string($input[$field]) || !is_object(json_decode($input[$field]))) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
}
/**
109
* Check if an input is an array and if the size is more or equal to a specific value.
*
* Usage: '<index>' => 'valid_array_size_greater,1'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_valid_array_size_greater($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!is_array($input[$field]) || sizeof($input[$field]) < (int)$param) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
110
}
/**
* Check if an input is an array and if the size is less or equal to a specific value.
*
* Usage: '<index>' => 'valid_array_size_lesser,1'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_valid_array_size_lesser($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!is_array($input[$field]) || sizeof($input[$field]) > (int)$param) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
111
'param' => $param,
);
}
}
/**
* Check if an input is an array and if the size is equal to a specific value.
*
* Usage: '<index>' => 'valid_array_size_equal,1'
*
* @param string $field
* @param array $input
*
* @return mixed
*/
protected function validate_valid_array_size_equal($field, $input, $param = null)
{
if (!isset($input[$field]) || empty($input[$field])) {
return;
}
if (!is_array($input[$field]) || sizeof($input[$field]) == (int)$param) {
return array(
'field' => $field,
'value' => $input[$field],
'rule' => __FUNCTION__,
'param' => $param,
);
}
112
}
}
ADMIN PANEL
<?php include 'includes/connection.php';?>
<?php include 'includes/header.php';?>
<?php include 'includes/navbar.php';?>
<?php
if (isset($_POST['recover'])) {
$email = mysqli_real_escape_string($conn , $_POST['email']);
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$query = "SELECT email FROM users WHERE email = '$email'";
$run = mysqli_query($conn , $query) or die (mysqli_error($conn) );
if (mysqli_num_rows($run) > 0) {
function generateRandomString($length = 5) {
return
substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST
UVWXYZ"), 0, $length);
}
$token_tmp = generateRandomString();
$token = md5($token_tmp);
113
$url = $_SERVER['REQUEST_URI'];
$parts = explode('/',$url);
$dir = $_SERVER['SERVER_NAME'];
for ($i = 0; $i < count($parts) - 1; $i++) {
$dir .= $parts[$i] . "/";
}
require 'PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'collegenotesgallery@gmail.com'; // SMTP username
$mail->Password = 'collegegallery'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->setFrom('collegenotesgallery@gmail.com', 'Admin');
$mail->addReplyTo('collegenotesgallery@gmail.com', 'Admin');
$mail->addAddress($email);
$mail->isHTML(true); // Set email format to HTML
114
$bodyContent = '<h1>Recover Password Link: </h1>';
$bodyContent .= 'http://' . $dir . 'verifytoken.php?token='.$token;
$mail->Subject = 'Email from collegenotesgallery ';
$mail->Body = $bodyContent;
$query2 = "UPDATE users set token = '$token' WHERE email = '$email'";
$run = mysqli_query($conn , $query2) or die(mysqli_error($conn));
$count = mysqli_affected_rows($conn);
if($mail->send() && ($count > 0)) {
echo "<center> <font color = 'green' >Email with recover password link has been sent
</font><center> " ;
} else {
echo "<center> <font color = 'red' >'Message could not be sent.'</font><center> ";
echo "<center> <font color = 'red' >'Mailer Error: ' . $mail->ErrorInfo </font><center> ";
}
}
else {
echo "<center> <font color = 'red' > Entered email does not match to any record
</font><center> ";
}
115
}
else {
echo "<center> <font color = 'red' > Invalid email type </font><center> ";
}
}
?>
<div class="login-card">
<h1>Recover Password</h1><br>
<form action = "" method="POST">
<input type="text" name="email" placeholder="Enter your Email" required="">
<input type="submit" name="recover" class="login login-submit" value="send">
</form>
<div class="login-help">
<a href="signup.php">Register</a> • <a href="login.php">Login</a>
</div>
</div>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script>
</body>
</html>
116
VALIDATION CHECK
Validation on password fields: Passwords should be greater than 4 characters. Password field
should not remain empty.
Validation on textbox field: This field should not remain empty and invalid.
Validation on Column password of user, admin, login form table: This column has a unique
key and not null constraint defined on it.
VALIDATION CODING:
1. <!DOCTYPE html>
2. <html>
3. <head>
4. <style>
5. .error {color: #FF0001;}
6. </style>
7. </head>
8. <body>
9.
10. <?php
11. // define variables to empty values
12. $nameErr = $emailErr = $mobilenoErr = $genderErr = $websiteErr = $agreeErr = "";
13. $name = $email = $mobileno = $gender = $website = $agree = "";
14.
15. //Input fields validation
16. if ($_SERVER["REQUEST_METHOD"] == "POST") {
17.
18. //String Validation
19. if (emptyempty($_POST["name"])) {
20. $nameErr = "Name is required";
21. } else {
22. $name = input_data($_POST["name"]);
23. // check if name only contains letters and whitespace
24. if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
25. $nameErr = "Only alphabets and white space are allowed";
26. }
27. }
28.
29. //Email Validation
30. if (emptyempty($_POST["email"])) {
31. $emailErr = "Email is required";
32. } else {
33. $email = input_data($_POST["email"]);
34. // check that the e-mail address is well-formed
35. if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
36. $emailErr = "Invalid email format";
117
37. }
38. }
39.
40. //Number Validation
41. if (emptyempty($_POST["mobileno"])) {
42. $mobilenoErr = "Mobile no is required";
43. } else {
44. $mobileno = input_data($_POST["mobileno"]);
45. // check if mobile no is well-formed
46. if (!preg_match ("/^[0-9]*$/", $mobileno) ) {
47. $mobilenoErr = "Only numeric value is allowed.";
48. }
49. //check mobile no length should not be less and greator than 10
50. if (strlen ($mobileno) != 10) {
51. $mobilenoErr = "Mobile no must contain 10 digits.";
52. }
53. }
54.
55. //URL Validation
56. if (emptyempty($_POST["website"])) {
57. $website = "";
58. } else {
59. $website = input_data($_POST["website"]);
60. // check if URL address syntax is valid
61. if (!preg_match("/b(?:(?:https?|ftp)://|www.)[-a-z0-9+&@#/%?=~_|!:,.;]*[-a-
z0-9+&@#/%=~_|]/i",$website)) {
62. $websiteErr = "Invalid URL";
63. }
64. }
65.
66. //Empty Field Validation
67. if (emptyempty ($_POST["gender"])) {
68. $genderErr = "Gender is required";
69. } else {
70. $gender = input_data($_POST["gender"]);
71. }
72.
73. //Checkbox Validation
74. if (!isset($_POST['agree'])){
75. $agreeErr = "Accept terms of services before submit.";
76. } else {
77. $agree = input_data($_POST["agree"]);
78. }
79. }
80. function input_data($data) {
81. $data = trim($data);
82. $data = stripslashes($data);
83. $data = htmlspecialchars($data);
84. return $data;
85. }
118
86. ?>
87.
88. <h2>Registration Form</h2>
89. <span class = "error">* required field </span>
90. <br><br>
91. <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);
?>" >
92. Name:
93. <input type="text" name="name">
94. <span class="error">* <?php echo $nameErr; ?> </span>
95. <br><br>
96. E-mail:
97. <input type="text" name="email">
98. <span class="error">* <?php echo $emailErr; ?> </span>
99. <br><br>
100. Mobile No:
101. <input type="text" name="mobileno">
102. <span class="error">* <?php echo $mobilenoErr; ?> </span>
103. <br><br>
104. Website:
105. <input type="text" name="website">
106. <span class="error"><?php echo $websiteErr; ?> </span>
107. <br><br>
108. Gender:
109. <input type="radio" name="gender" value="male"> Male
110. <input type="radio" name="gender" value="female"> Female
111. <input type="radio" name="gender" value="other"> Other
112. <span class="error">* <?php echo $genderErr; ?> </span>
113. <br><br>
114. Agree to Terms of Service:
115. <input type="checkbox" name="agree">
116. <span class="error">* <?php echo $agreeErr; ?> </span>
117. <br><br>
118. <input type="submit" name="submit" value="Submit">
119. <br><br>
120. </form>
121.
122. <?php
123. if(isset($_POST['submit'])) {
124. if($nameErr == "" && $emailErr == "" && $mobilenoErr == "" && $genderErr ==
"" && $websiteErr == "" && $agreeErr == "") {
125. echo "<h3 color = #FF0001> <b>You have sucessfully registered.</b> </h3>";
126. echo "<h2>Your Input:</h2>";
127. echo "Name: " .$name;
128. echo "<br>";
129. echo "Email: " .$email;
130. echo "<br>";
131. echo "Mobile No: " .$mobileno;
132. echo "<br>";
133. echo "Website: " .$website;
119
134. echo "<br>";
135. echo "Gender: " .$gender;
136. } else {
137. echo "<h3> <b>You didn't filled up the form correctly.</b> </h3>";
138. }
139. }
140. ?>
141. </body>
142. </html>
120
CONCLUSION
The project titled ‘CORONA WARRIORS’ was developed by the health services and direction
and with their help. The system was tested and the performance of the system was found to be
acceptable.
All the necessary output was created. The system was found to be user-friendly with help
messages for the staff and admin.
The system was implemented successfully. The manpower and working hours needed to
operate the system was less and it was seen to be more secure. Thus, the Project was completed
successfully.
121
BIBLIOGRAPHY
Books:
1. HTML & CSS: Design and Build Websites by Jon Duckett
2. Learning PHP, MySQL, JavaScript, CSS & HTML5: A Step-by-Step Guide to Creating
Dynamic Websites by Robin Nixon
3. Head First HTML with CSS & XHTML by Elisabeth Freeman and Eric Freeman
4. PHP & MySQL: Server-side Web Development by Jon Duckett
5. CSS Secrets: Better Solutions to Everyday Web Design Problems by Lea Vero
Links:
1. https://www.w3schools.com/html/
2. https://html.com/
3. https://www.tutorialspoint.com/php/index.htm
4. https://www.codecademy.com/learn/learn-php

More Related Content

Similar to ONE BG 9307554036.pdf

Covid-19 Data Analysis and Visualization
Covid-19 Data Analysis and VisualizationCovid-19 Data Analysis and Visualization
Covid-19 Data Analysis and Visualization
IRJET Journal
 
Cloud Based Covid 19 Testing Management System
Cloud Based Covid 19 Testing Management SystemCloud Based Covid 19 Testing Management System
Cloud Based Covid 19 Testing Management System
ijtsrd
 
Design and development of a fuzzy explainable expert system for a diagnostic ...
Design and development of a fuzzy explainable expert system for a diagnostic ...Design and development of a fuzzy explainable expert system for a diagnostic ...
Design and development of a fuzzy explainable expert system for a diagnostic ...
IJECEIAES
 
Medic - Artificially Intelligent System for Healthcare Services ...
Medic - Artificially Intelligent System for Healthcare Services              ...Medic - Artificially Intelligent System for Healthcare Services              ...
Medic - Artificially Intelligent System for Healthcare Services ...
IRJET Journal
 
Management of patient information trends and challenges in member states
Management of patient information trends and challenges in member statesManagement of patient information trends and challenges in member states
Management of patient information trends and challenges in member states
Dr Lendy Spires
 
Survey On Machine Learning Based Patient Monitoring Algorithm Using Oxygen Sa...
Survey On Machine Learning Based Patient Monitoring Algorithm Using Oxygen Sa...Survey On Machine Learning Based Patient Monitoring Algorithm Using Oxygen Sa...
Survey On Machine Learning Based Patient Monitoring Algorithm Using Oxygen Sa...
IRJET Journal
 
Presentation at 2007 Annual Meeting of VA Patient Safety Managers and Officers
Presentation at 2007 Annual Meeting of VA Patient Safety Managers and OfficersPresentation at 2007 Annual Meeting of VA Patient Safety Managers and Officers
Presentation at 2007 Annual Meeting of VA Patient Safety Managers and Officers
Noel Eldridge
 
COVID-19 knowledge-based system for diagnosis in Iraq using IoT environment
COVID-19 knowledge-based system for diagnosis in Iraq using IoT environmentCOVID-19 knowledge-based system for diagnosis in Iraq using IoT environment
COVID-19 knowledge-based system for diagnosis in Iraq using IoT environment
nooriasukmaningtyas
 
Symptom-Based Prediction of COVID-19 using Machine Learning Models with SMOTE...
Symptom-Based Prediction of COVID-19 using Machine Learning Models with SMOTE...Symptom-Based Prediction of COVID-19 using Machine Learning Models with SMOTE...
Symptom-Based Prediction of COVID-19 using Machine Learning Models with SMOTE...
IRJET Journal
 
GLI TB Diagnostics Connectivity Guide 2016
GLI TB Diagnostics Connectivity Guide 2016GLI TB Diagnostics Connectivity Guide 2016
GLI TB Diagnostics Connectivity Guide 2016
SystemOne
 
ADAPTIVE LEARNING EXPERT SYSTEM FOR DIAGNOSIS AND MANAGEMENT OF VIRAL HEPATITIS
ADAPTIVE LEARNING EXPERT SYSTEM FOR DIAGNOSIS AND MANAGEMENT OF VIRAL HEPATITISADAPTIVE LEARNING EXPERT SYSTEM FOR DIAGNOSIS AND MANAGEMENT OF VIRAL HEPATITIS
ADAPTIVE LEARNING EXPERT SYSTEM FOR DIAGNOSIS AND MANAGEMENT OF VIRAL HEPATITIS
ijaia
 
Adaptive Learning Expert System for Diagnosis and Management of Viral Hepatitis
Adaptive Learning Expert System for Diagnosis and Management of Viral HepatitisAdaptive Learning Expert System for Diagnosis and Management of Viral Hepatitis
Adaptive Learning Expert System for Diagnosis and Management of Viral Hepatitis
gerogepatton
 
Sepsis Prediction Using Machine Learning
Sepsis Prediction Using Machine LearningSepsis Prediction Using Machine Learning
Sepsis Prediction Using Machine Learning
IRJET Journal
 
Design and Development of Cold Chain Monitoring System
Design and Development of Cold Chain Monitoring SystemDesign and Development of Cold Chain Monitoring System
Design and Development of Cold Chain Monitoring System
Lihguong Jang
 
Systematic review of quality standards for medical devices and practice measu...
Systematic review of quality standards for medical devices and practice measu...Systematic review of quality standards for medical devices and practice measu...
Systematic review of quality standards for medical devices and practice measu...
Pubrica
 
Structure and development of a clinical decision support system: application ...
Structure and development of a clinical decision support system: application ...Structure and development of a clinical decision support system: application ...
Structure and development of a clinical decision support system: application ...
komalicarol
 
Clinical Transformation, Part II
Clinical Transformation, Part IIClinical Transformation, Part II
Clinical Transformation, Part II
Medsphere
 
LoRa driven medical adherence system
LoRa driven medical adherence systemLoRa driven medical adherence system
LoRa driven medical adherence system
journalBEEI
 
IOT BASED HEALTH MONITORING SYSTEM FOR COVID 19 PATIENT
IOT BASED HEALTH MONITORING SYSTEM FOR COVID 19 PATIENTIOT BASED HEALTH MONITORING SYSTEM FOR COVID 19 PATIENT
IOT BASED HEALTH MONITORING SYSTEM FOR COVID 19 PATIENT
IRJET Journal
 
applicationofcomputersinepidemiologyandpublichealth_anjalimam_220617064511.pdf
applicationofcomputersinepidemiologyandpublichealth_anjalimam_220617064511.pdfapplicationofcomputersinepidemiologyandpublichealth_anjalimam_220617064511.pdf
applicationofcomputersinepidemiologyandpublichealth_anjalimam_220617064511.pdf
Soujannya Kundu Chowdhury
 

Similar to ONE BG 9307554036.pdf (20)

Covid-19 Data Analysis and Visualization
Covid-19 Data Analysis and VisualizationCovid-19 Data Analysis and Visualization
Covid-19 Data Analysis and Visualization
 
Cloud Based Covid 19 Testing Management System
Cloud Based Covid 19 Testing Management SystemCloud Based Covid 19 Testing Management System
Cloud Based Covid 19 Testing Management System
 
Design and development of a fuzzy explainable expert system for a diagnostic ...
Design and development of a fuzzy explainable expert system for a diagnostic ...Design and development of a fuzzy explainable expert system for a diagnostic ...
Design and development of a fuzzy explainable expert system for a diagnostic ...
 
Medic - Artificially Intelligent System for Healthcare Services ...
Medic - Artificially Intelligent System for Healthcare Services              ...Medic - Artificially Intelligent System for Healthcare Services              ...
Medic - Artificially Intelligent System for Healthcare Services ...
 
Management of patient information trends and challenges in member states
Management of patient information trends and challenges in member statesManagement of patient information trends and challenges in member states
Management of patient information trends and challenges in member states
 
Survey On Machine Learning Based Patient Monitoring Algorithm Using Oxygen Sa...
Survey On Machine Learning Based Patient Monitoring Algorithm Using Oxygen Sa...Survey On Machine Learning Based Patient Monitoring Algorithm Using Oxygen Sa...
Survey On Machine Learning Based Patient Monitoring Algorithm Using Oxygen Sa...
 
Presentation at 2007 Annual Meeting of VA Patient Safety Managers and Officers
Presentation at 2007 Annual Meeting of VA Patient Safety Managers and OfficersPresentation at 2007 Annual Meeting of VA Patient Safety Managers and Officers
Presentation at 2007 Annual Meeting of VA Patient Safety Managers and Officers
 
COVID-19 knowledge-based system for diagnosis in Iraq using IoT environment
COVID-19 knowledge-based system for diagnosis in Iraq using IoT environmentCOVID-19 knowledge-based system for diagnosis in Iraq using IoT environment
COVID-19 knowledge-based system for diagnosis in Iraq using IoT environment
 
Symptom-Based Prediction of COVID-19 using Machine Learning Models with SMOTE...
Symptom-Based Prediction of COVID-19 using Machine Learning Models with SMOTE...Symptom-Based Prediction of COVID-19 using Machine Learning Models with SMOTE...
Symptom-Based Prediction of COVID-19 using Machine Learning Models with SMOTE...
 
GLI TB Diagnostics Connectivity Guide 2016
GLI TB Diagnostics Connectivity Guide 2016GLI TB Diagnostics Connectivity Guide 2016
GLI TB Diagnostics Connectivity Guide 2016
 
ADAPTIVE LEARNING EXPERT SYSTEM FOR DIAGNOSIS AND MANAGEMENT OF VIRAL HEPATITIS
ADAPTIVE LEARNING EXPERT SYSTEM FOR DIAGNOSIS AND MANAGEMENT OF VIRAL HEPATITISADAPTIVE LEARNING EXPERT SYSTEM FOR DIAGNOSIS AND MANAGEMENT OF VIRAL HEPATITIS
ADAPTIVE LEARNING EXPERT SYSTEM FOR DIAGNOSIS AND MANAGEMENT OF VIRAL HEPATITIS
 
Adaptive Learning Expert System for Diagnosis and Management of Viral Hepatitis
Adaptive Learning Expert System for Diagnosis and Management of Viral HepatitisAdaptive Learning Expert System for Diagnosis and Management of Viral Hepatitis
Adaptive Learning Expert System for Diagnosis and Management of Viral Hepatitis
 
Sepsis Prediction Using Machine Learning
Sepsis Prediction Using Machine LearningSepsis Prediction Using Machine Learning
Sepsis Prediction Using Machine Learning
 
Design and Development of Cold Chain Monitoring System
Design and Development of Cold Chain Monitoring SystemDesign and Development of Cold Chain Monitoring System
Design and Development of Cold Chain Monitoring System
 
Systematic review of quality standards for medical devices and practice measu...
Systematic review of quality standards for medical devices and practice measu...Systematic review of quality standards for medical devices and practice measu...
Systematic review of quality standards for medical devices and practice measu...
 
Structure and development of a clinical decision support system: application ...
Structure and development of a clinical decision support system: application ...Structure and development of a clinical decision support system: application ...
Structure and development of a clinical decision support system: application ...
 
Clinical Transformation, Part II
Clinical Transformation, Part IIClinical Transformation, Part II
Clinical Transformation, Part II
 
LoRa driven medical adherence system
LoRa driven medical adherence systemLoRa driven medical adherence system
LoRa driven medical adherence system
 
IOT BASED HEALTH MONITORING SYSTEM FOR COVID 19 PATIENT
IOT BASED HEALTH MONITORING SYSTEM FOR COVID 19 PATIENTIOT BASED HEALTH MONITORING SYSTEM FOR COVID 19 PATIENT
IOT BASED HEALTH MONITORING SYSTEM FOR COVID 19 PATIENT
 
applicationofcomputersinepidemiologyandpublichealth_anjalimam_220617064511.pdf
applicationofcomputersinepidemiologyandpublichealth_anjalimam_220617064511.pdfapplicationofcomputersinepidemiologyandpublichealth_anjalimam_220617064511.pdf
applicationofcomputersinepidemiologyandpublichealth_anjalimam_220617064511.pdf
 

ONE BG 9307554036.pdf

  • 1. A PROJECT REPORT ON “COVID-19 MANAGEMENT SYSTEM” Submitted in partial fulfilment for the degree of BACHELOR OF COMPUTER APPLICATION (BCA) Semester VI by 1) Ms. Naina Sangole 2) Ms. Chetana Nimje 3) Ms. Prachi Dhawale 4) Ms. Sejal Meshram SADABAI RAISONI WOMEN’S COLLEGE Affiliated to S.N.D.T Women’s University, Mumbai. [2021-2022]
  • 2. ACKNOWLEDGEMENT With the completion of a report for a project on “Covid-19 Management System'', it has given us immense pleasure and knowledge. We are sincerely thankful to Mrs. Amina Vali (Principal, SRWC) and Project Guide, Mrs. Ashwini Ankar who have cooperated with us at different stages during the preparation of this project. Our Sincere thanks to staff of I.T Department without whose help it would not have been possible for us to complete this report. We would also like to thank the entire library and non-teaching staff for their constant support while preparing this report. PROJECTEES Ms. Naina Sangole Ms. Chetana Nimje Ms. Prachi Dhawale Ms. Sejal Meshram (BCA FINAL YEAR)
  • 3. CERTIFICATE This is to certify that the project report entitled “Covid-19 Management System” submitted by [Ms. Naina Sangole, Ms. Chetana Nimje, Ms. Prachi Dhawale, Ms. Sejal Meshram] as a partial fulfilment for the requirement of BCA III year examination of the Shreemati Nathibai Damodar Thackersey (S.N.D.T) Women’s University, Mumbai for the academic session 2021-2022 is an original software project carried out under the supervision and guidance of Mrs. Ashwini Ankar has undergone the requisite duration as prescribed by the Shreemati Nathibai Damodar Thackersey (S.N.D.T) Women’s University, Mumbai for the project work. PROJECT GUIDE HEAD/PRINCIPAL Signature: Signature: Name: Mrs. Ashwini Ankar Name: Mrs. Amina Vali Date: Date: College Seal INTERNAL EXAMINER EXTERNAL EXAMINER Signature: Signature: Name: Name: Date: Date:
  • 4. CONTENTS SR.NO TOPICS PAGE NO 1. Abstract 1 2. Introduction 2 3. Literature Survey 3 3.1 Survey Existing System 4 3.2 Limitation existing system or Research gap 5 3.3 Problem Statement and Objectives 6 3.4 Scope 7 4. Proposed System 8 4.1 Analysis / Flowchart 9 4.2 Details of Hardware and Software 10 – 11 4.3 Design Details 12 – 13 4.4 Methodology 14 5. Screenshots 15 – 23 6. Coding 24 – 119 7. Conclusion 120 8. Bibliography 121
  • 5. 1 Abstract The COVID-19 pandemic has broadly disrupted biomedical treatment and research including non-invasive brain stimulation (NIBS). Moreover, the rapid onset of societal disruption and evolving regulatory restrictions may not have allowed for systematic planning of how clinical and research work may continue throughout the pandemic or be restarted as restrictions are abated. The urgency to provide and develop NIBS as an intervention for diverse neurological and mental health indications, and as a catalyst of fundamental brain research, is not dampened by the parallel efforts to address the most life-threatening aspects of COVID-19; rather in many cases the need for NIBS is heightened including the potential to mitigate mental health consequences related to COVID-19. To facilitate the re-establishment of access to NIBS clinical services and research operations during the current COVID-19 pandemic and possible future outbreaks, we develop and discuss a framework for balancing the importance of NIBS operations with safety considerations, while addressing the needs of all stakeholders. We focus on Transcranial Magnetic Stimulation (TMS) and low intensity transcranial Electrical Stimulation (tES) - including transcranial Direct Current Stimulation (tDCS) and transcranial Alternating Current Stimulation (tACS). Methods The present consensus paper provides guidelines and good practices for managing and reopening NIBS clinics and laboratories through the immediate and ongoing stages of COVID-19. The document reflects the analysis of experts with domain relevant expertise spanning NIBS technology, clinical services, and basic and clinical research – with an international perspective. We outline regulatory aspects, human resources, NIBS optimization, as well as accommodations for specific demographics. Results A model based on three phases (early COVID-19 impact, current practices, and future preparation) with an 11-step checklist (spanning removing or streamlining in-person protocols, incorporating telemedicine, and addressing COVID-19-associated adverse events) is proposed. Recommendations on implementing social distancing and sterilization of NIBS related equipment, specific considerations of COVID-19 positive populations including mental health comorbidities, as well as considerations regarding regulatory and human resource in the era of COVID-19 are outlined. We discuss COVID-19 considerations specifically for clinical (sub-)populations including pediatric, stroke, addiction, and the elderly.
  • 6. 2 INTRODUCTION Coronavirus disease (COVID-19) is an infectious disease caused by a newly discovered coronavirus. Most people who fall sick with COVID-19 will experience mild to moderate symptoms and recover without special treatment. Covid-19 management system is a project to track covid testing and users can register for vaccines in one click. You can track corona cases in one click. Get covid report in one click. As We have mentioned above, this Covid 19 Management System has 3 modules and each of these has different restrictions. The Administrator Side is the admin panel of the system where the management can manage the records in the system. The Admin panel requires an admin credential in order to access the features and functions of the said module. The User Module is the side of the system where the individuals can register their information and schedule their testing time slot. On Public Website, this module mostly contains static information about the purpose of the application and other details. COVID-19 is a biological challenge, but as with so many things, materials science and engineering can play a significant role in defeating it. The TMS COVID-19 Materials Needs Exchange strives to connect organizations and programs on the front lines of the COVID-19 pandemic with TMS members who can render materials or manufacturing assistance, resources, and/or expertise. COVID-19 was first recognized in December 2019 and within months evolved into a global pandemic declared by the World Health Organization (WHO) in March 2020. To avert its rapid spread, country-specific restrictions have been introduced spanning strict social/physical distancing measures, stay-at-home orders and even lockdowns, workplace closings and furloughs/layoffs, postponing of elective procedures in medical centers to preserve medical resources, suspending many in-person medical consultation and clinic visits, or substituting these face-to-face consultations with remote interventions, e.g. telecommunications. Rapid collection and testing of appropriate specimens from patients meeting the suspect case definition for COVID-19 is a priority for clinical management and outbreak control and should be guided by a laboratory expert. Suspect cases should be screened for the virus with nucleic acid amplification tests (NAAT), such as RT-PCR.
  • 7. 3 LITERATURE SURVEY The survey addressing the impact of the COVID-19 pandemic was sent to institutions applying NIBS (research laboratories and NIBS clinics) across the world. Replies were received from 29 institutions representing 17 countries. These responses thus reflect the “situation on the ground” at the time of assessment with ongoing remediation methods addressed later in this paper. Mainly depending on the national and local restrictions in response to the COVID-19 outbreak and the nature of protocols (e.g., type of technology, trial stage, clinical population), there were substantial discrepancies in the extent to which neuromodulation operations were disrupted. A systematic literature review was conducted using the Preferred Reporting Items for Systematic Reviews and Meta-Analyses – PRISMA (Moher et al., 2009).
  • 8. 4 SURVEY EXISTING SYSTEM The existing Covid-19 testing, if you want to test your covid symptoms because of covid you have to move from one place to another place in a city. We have to look for transportation, But the drawback of the transportation system is that you cannot decide the time limit and major concern is the weight for transportation and also the safety in this covid situation. If we want to check the report immediately, we can use this way. ● Using manual lab services, we have to go to the lab physically in this scenario. It requires more time & more calculation. ● In lab services manually, the prices of testing is fixed and it is dangerous in covid peak seasons. ● In this service, you can take the report in one click and also you can book the testing as per your needs.
  • 9. 5 LIMITATION EXISTING SYSTEM OR RESEARCH GAP As we have checked that people had to visit labs for covid test and for collecting reports. Some people travel for distance for covid test, due to all these circumstances we have created this project. The project titled ‘COVID-19 MANAGEMENT SYSTEM’ is developed by the health services and direction and with their help. The system is tested and the performance of the system is found to be acceptable. All the necessary output is created. The system is found to be user-friendly with help messages for the staff and admin. The system was implemented successfully. The manpower and working hours needed to operate the system was less and it was seen to be more secure. Thus, the Project was completed successfully.
  • 10. 6 PROBLEM STATEMENT AND OBJECTIVES This general Covid-19 management system site program will help many people who want to take the RT-PCR test. This is a very helpful project. 1. Save time on manpower tasks 2. Less manpower 3. Increase your online visibility 4. Implement an effective vaccine management 5. Manage distribution functions 6. Increase safety Accurate reports of covid-19
  • 11. 7 SCOPE It is still mature and fully enthusiastic. Any requirements, this project is completed but still, they want to update and modify some modules. We are always thinking about association requirements also growing day by day. We always want to implement something more. This project is completed when you watch, but we want to implement more things. ⮚ Online Chat ⮚ Overseas Service ⮚ Service Request On chat ⮚ Extending geographical research ⮚ More Safety
  • 12. 8 PROPOSED SYSTEM Our corona warrior system will help you to overcome all the above problems. This System will give the assurity to customers that their vaccination can be done within the specific time slots according to the distance of location. This system is not concerned with the weight of the person. This system is quick and can be used in fast cases, for example if you want to get a vaccine you can register on this website. FEASIBILITY STUDY: 1. Technical Feasibility Study: The System is Technically feasible because here we are using PHP platform / MySQL database which is free to use even for commercial purposes. From the user’s point of view, it is feasible because it can fulfill users’ requirements and maintain their records and additional features like deciding specific time slots are also available. 2. Operational Feasibility Study: Operational Feasibility is the measure of how well the proposed system solves the problem and specifies the requirements in system development. Our System is Operational Feasibility because it is admin-based software. Admin will get a multiple task where She or He can authority that creates admin, Registering Customer, tracking etc. admin gets a single module to do these operations. 3. Economical Feasibility Study: The purpose of the Economic Feasibility is to demonstrate the net benefit of the proposed system. Our system is economically feasible as the basic amount will be decided by the system depending on distance and the admin will decide the timeslot and according to that. It is Admin-Based system so there is no problem with additional charges, Customers just need to book the slot with the location where he /she wants to give the covid sample test. Which they want to deliver at a particular place and they have to give only minimum charges.
  • 14. 10 DETAILS OF HARDWARE AND SOFTWARE Front End: PHP: - PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. While PHP originally stood for Personal Home Page, it now stands for PHP: Hypertext Preprocessor, a recursive backronym code is interpreted by a web server with a PHP processor module, which generates the resulting web page: PHP commands can be embedded directly into an HTML source document rather than calling an external file to process data. HTML: - HTML or HyperText Markup Language is the main markup language for creating web pages and other information that can be displayed in a web browser. HTML tags most commonly come in pairs like and, although some tags represent empty elements and so are unpaired, for example Error! Filename not specified. The first tag in a pair is the start tag, and the second tag is the end tag (they are also called opening tags and closing tags). BACK END: MYSQL: - MySQL ("My S-Q-L", officially, but also called "My Sequel") is (as of July 2013) the world's second most widely used open-source relational database management system (RDBMS). LAMP is an acronym for "Linux, Apache, MySQL, Perl/PHP/Python." Applications which use MySQL databases include: TYPO3, MODx, Joomla, WordPress, phpBB, MyBB, Drupal and other software. MySQL is also used in many high-profile, large- scale websites, including Wikipedia, Google (though not for searches), Facebook, Twitter, Flickr, and YouTube. Technology: ● CSS: - CSS is a cascading style sheet which is used to give a designer look at HTML using the external file. ● Javascript: - Javascript is used for client-side scripting which can help in using validation on the website and many more other functions.
  • 15. 11 ● XAMPP: - XAMPP is a free and open-source cross-platform web server solution stack package developed by Apache Friends, consisting mainly of the Apache HTTP Server, MariaDB database, and interpreters for scripts written in the PHP and Perl programming languages. ● jQuery: - jQuery is a fast and concise JavaScript library. jQuery simplifies HTML document traversing, event handling, animating, and Ajax interactions for Rapid Web Development. ● Bootstrap: -Bootstrap themes also feature various UI components and page. Layouts that can be employed to create websites. You can think of them as website templates created with Bootstrap in mind. [ Hardware Requirement]: - CPU: Intel (R) Core (TM) i5 CPU M 520 @2.40GHz Video: CPU built - in graphics {LCD / LED / TFT etc.} Memory: 2.0 GB (2.0 GB x 1 ) RAM HDD: 160 GB Disk Drive: UGB portable Input / Output: Multimedia mouse and Keyboard
  • 16. 12 DESIGN DETAILS An important job of a system analyst is to make sure that the new design is implemented and established standards. The implementation simply means conversion of new or revised system design into an operational one. Implementation of new system involved following task: ● IMPLEMENTATION: Implementation is activity considered as conversion of old system into new system. The term system implementation is defined as the conversion of design and coded system into the actual operation. This new system gradually replaces the old system with the new one. Part by part the old system phased out and new system Part by part phased in the result produced by each part of new system is compared against the result of new system, errors are found out and removed once the confidence is developed in a particular part of the new system, that part of the new system is phased in and corresponding part of the old system is phased out. This method is continuing for each and every part of the new system. The new system is slowly phased in with the old system and slowly phased out. ● EVALUATION: After the implementation stage another stage in project development is evaluation of the project. After keeping in working condition for some time all the errors that might occur in program execution have shown up. The programmers need to correct them so that the same errors are not repeated again and become program user- friendly. 58 Maintenance Definitions and context Software maintenance sustains the software product throughout its life cycle Modification requests are logged and tracked, the impact of proposed changes determined, code is modified, testing is conducted, and a new version of the software products released. Training is provided to users .Software maintenance is the modification of a software product after delivery to correct faults, to improve performance or other attributes, or to adapt the product to a modified environment. ● THE SOFTWARE MAINTENANCE CONTEXT: Existing software - Software - Modified software. In software engineering, software maintenance is the process of enhancing and optimizing deployed software (software release),, as well as remedying defects. Software maintenance is one the phases in the software development process, and follows deployment of the software into the field. The software maintenance phase
  • 17. 13 involves changes to the software in order to correct defects and deficiencies found during field usage as well as the addition of new functionality to improve the software usability and applicability. Software maintenance involves a number of specific techniques. One technique is static slicing, which is used to identify all the program code that can modify some variable. It is generally useful in refractory program code and was specifically useful in assuring Y2K compliance. The software maintenance phase is an explicit part of the waterfall model of the software development process which was developed during the structured programming movement of computer programming. The other major model, the spiral model developed during the object- oriented movement of software engineering makes no explicit mention of a maintenance phase. Nevertheless, this activity is notable, considering the fact that two- thirds of a software system's lifetime cost involves maintenance. In a formal software development environment, the developing organization or team will have some mechanisms to document and track defects and deficiencies. Software just like most other typically released with a known set of defects and deficiencies. The software is released with the issue because the development organization decides the utility and value of the software at a particular level of quality over weighs the impact of known defects and deficiencies. The known issues are normally documented in a letter of operational considerations or release notes so that the user of the software will be able to work around the known issues and will know when the use of the software would be inappropriate for particular tasks. With the release of the software, other undocumented defects and deficiencies will be discovered by the users of the software. As these issues are reported into the development organization, they will be entered into the defect tracking system. The people involved in the software maintenance are expected to work on these known issues, address them, and prepare for a new release of the software, known as a maintenance release, which will address the documented issue.
  • 18. 14 METHODOLOGY The project titled ‘COVID-19 MANAGEMENT SYSTEM’ was developed by the health services and direction and with their help. The system was tested and the performance of the system was found to be acceptable. All the necessary output was created. The system was found to be user-friendly with help messages for the staff and admin. The system was implemented successfully. The manpower and working hours needed to operate the system was less and it was seen to be more secure. Thus, the Project was completed successfully. ● Admin Panel ● Corona Tracker ● Testing Management ● Testing Details ● Track Report ● Information about Covid
  • 20. 16 3. Login 4. Admin Dashboard
  • 21. 17 5. Testing Dashboard 6. Search Reports
  • 24. 20
  • 27. 23
  • 28. 24 CODING ADMIN DASHBOARD CODE: <?php session_start(); include('includes/config.php'); if(isset($_POST['login'])) { $uname=$_POST['username']; $Password=md5($_POST['inputpwd']); $query=mysqli_query($con,"select ID from tbladmin where AdminuserName='$uname' && Password='$Password' "); $ret=mysqli_fetch_array($query); if($ret>0){ $_SESSION['aid']=$ret['ID']; header('location:dashboard.php'); } else{ echo "<script>alert('Invalid Details.');</script>"; } } ?>
  • 29. 25 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <title>Covid 19 Warrior | Admin Login</title> <!-- Custom fonts for this template--> <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i, 700, 700i,800,800i,900,900i" rel="stylesheet"> <!-- Custom styles for this template--> <link href="css/sb-admin-2.min.css" rel="stylesheet"> </head> <body class="bg-gradient-info"> <div class="container"> <!-- Outer Row --> <div class="row justify-content-center"> <div class="col-xl-10 col-lg-12 col-md-9"> <h3 align="center" style="margin-top:4%;color:#fff;font-weight: bold">Covid-19 Warrior Portal</h3> <div class="card o-hidden border-0 shadow-lg my-5"> <div class="card-body p-0"> <!-- Nested Row within Card Body -->
  • 30. 26 <form name="login" method="post"> <div class="row"> <div class="col-lg-6 d-none d-lg-block bg-login-image"></div> <div class="col-lg-6"> <div class="p-5"> <div class="text-center"> <h1 class="h4 text-gray-900 mb-4">Welcome Back!</h1> </div> <form class="user"> <div class="form-group"> <input type="text" class="form-control" name="username" id="username" placeholder="Enter username" required="true"> </div> <div class="form-group"> <input type="password" class="form-control" name="inputpwd" id="inputpwd" placeholder="Password"> </div> <input type="submit" name="login" class="btn btn-info btn-user btn-block" value="login"> </form> <hr> <div class="text-center"> <a class="small" href="password-recovery.php" style="font- weight:bold">Forgot Password?</a> </div> <div class="text-center"> <a class="small" href="index.php" style="font-weight:bold;"><i class="fa fa-home" aria-hidden="true"></i> Home Page</a>
  • 31. 27 </div> </div> </div> </div> </form> </div> </div> </div> </div> </div> <!-- Bootstrap core JavaScript--> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Custom scripts for all pages--> <script src="js/sb-admin-2.min.js"></script> </body> </html> Homepage: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8">
  • 32. 28 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <title>Covid-19 Warriors</title> <! - - Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/scrolling-nav.css" rel="stylesheet"> </head> <body id="page-top"> <!-- Navigation --> <nav class="navbar navbar-expand-lg navbar-dark bg-success fixed-top" id="mainNav"> <div class="container"> <a class="navbar-brand js-scroll-trigger" href="#page-top">Covid-19 Warriors Portal</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data- target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria- label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarResponsive"> <ul class="navbar-nav ml-auto"> <li class="nav-item"> <a class="nav-link js-scroll-trigger" href="#about">Coronavirus </a>
  • 33. 29 </li> <li class="nav-item"> <a class="nav-link js-scroll-trigger" href="#services">Covid-19 Symptoms</a> </li> <li class="nav-item"> <a class="nav-link js-scroll-trigger" href="#contact">Prevention</a> </li> <li class="nav-item"> <a class="nav-link js-scroll-trigger" href="https://public.domo.com/cards/dJ45D">Live Tracker</a> </li> <li class="nav-item active"> <a class="nav-link js-scroll-trigger" href="new-user-testing.php">Testing</a> </li> <li class="nav-item active"> <a class="nav-link js-scroll-trigger" href="live-test-updates.php">Test Updates</a> </li> <li class="nav-item active"> <a class="nav-link js-scroll-trigger" href="patient-search-report.php">Covid Report</a> </li> <li class="nav-item active"> <a class="nav-link js-scroll-trigger" href="login.php">Login</a>
  • 34. 30 </li> </ul> </div> </div> </nav> <header class="bg-info text-white"> <div class="container text-center"> <h1>COVID19 Warriors</h1> <p class="lead">COVID19 - Testing Management System</p> </div> </header> <section id="about"> <div class="container"> <div class="row"> <div class="col-lg-8 mx-auto" > <h2>About this page</h2> <p class="lead">Coronavirus disease (COVID-19) is an infectious disease caused by a newly discovered coronavirus. Most people infected with the COVID-19, virus will experience mild to moderate, respiratory illness & recover without requiring special treatment. Older people and those with underlying medical problem like cardiovascular disease.</p> <p class="lead">The COVID-19 virus spread primarily through droplet of saliva or discharge from the nose when an infected person coughs or sneezes so it’s important that you also practice respiratory etiquette.</p> </div>
  • 35. 31 </div> </div> </section> <section id="services" class="bg-light"> <div class="container"> <div class="row"> <div class="col-lg-8 mx-auto"> <h2>Covid-19 Symptoms</h2> <hr /> <p><strong>Hight Fever 2-14 days!</strong><br /> Reported illnesses have ranged from mild symptoms to severe illness and death</p> <hr /> <p><strong>Dry Cough 2-14 days!</strong><br /> Reported illnesses have ranged from mild symptoms to severe illness and death</p> <hr /> <p><strong>Shortness of breath!</strong><br /> Reported illnesses have ranged from mild symptoms to severe illness and death</p> </div> </div> </div> </section> <section id="contact"> <div class="container">
  • 36. 32 <div class="row"> <div class="col-lg-8 mx-auto"> <h2>Prevention</h2> <ul> <li>Wash your Hands often</li> <li>Wear A Face mask</li> <li>Avoid contact with sick people</li> <li>Always cover your cough or sneeze</li> </ul> </div> </div> </div> </section> <!-- Footer --> <footer class="py-5 bg-info"> <div class="container"> <p class="m-0 text-center text-white">Copyright &copy; Corona Warriors Website 2021</p> </div> <!-- /.container --> </footer> <!-- Bootstrap core JavaScript -->
  • 37. 33 <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Plugin JavaScript --> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Custom JavaScript for this theme --> <script src="js/scrolling-nav.js"></script> </body> </html> NEW TEST: <?php session_start(); //DB conncetion include_once('includes/config.php'); //error_reporting(0); //validating Session if (strlen($_SESSION['aid']==0)) { header('location:logout.php'); } else{ ?> <!DOCTYPE html>
  • 38. 34 <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <title>Covid-Tms | New Test Request</title> <!-- Custom fonts for this template --> <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i, 700,700i,800,800i,900,900i” rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/sb-admin-2.min.css" rel="stylesheet"> <!-- Custom styles for this page --> <link href="vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet"> </head> <body id="page-top"> <!-- Page Wrapper --> <div id="wrapper"> <!-- Sidebar -->
  • 39. 35 <?php include_once('includes/sidebar.php');?> <!-- End of Sidebar --> <!-- Content Wrapper --> <div id="content-wrapper" class="d-flex flex-column"> <!-- Main Content --> <div id="content"> <!-- Topbar --> <?php include_once('includes/topbar.php');?> <!-- End of Topbar --> <!-- Begin Page Content --> <div class="container-fluid"> <!-- Page Heading --> <h1 class="h3 mb-2 text-gray-800">New Test Requests</h1> <!-- DataTales Example --> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">New Test Requests</h6> </div> <div class="card-body"> <div class="table-responsive"> <form name="assignto" method="post"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
  • 40. 36 <thead> <tr> <th>Sno.</th> <th>Order No.</th> <th>Patient Name</th> <th>Mobile No.</th> <th>Test Type</th> <th>Time Slot</th> <th>Reg. Date</th> <th>Action</th> </tr> </thead> <tfoot> <tr> <th>Sno. </th> <th>Order No.</th> <th>Patient Name</th> <th>Mobile No.</th> <th>Test Type</th> <th>Time Slot</th> <th>Reg. Date</th> <th>Action</th> </tr>
  • 41. 37 </tfoot> <tbody> <?php $query=mysqli_query($con,"select tbltestrecord.OrderNumber,tblpatients.FullName,tblpatients.MobileNumber,tbltestrecord.Test Type,tbltestrecord.TestTimeSlot,tbltestrecord.RegistrationDate,tbltestrecord.id as testid from tbltestrecord join tblpatients on tblpatients.MobileNumber=tbltestrecord.PatientMobileNumber where ReportStatus is null "); $cnt=1; while($row=mysqli_fetch_array($query)){ ?> <tr> <td><?php echo $cnt;?></td> <td><?php echo $row['OrderNumber'];?></td> <td><?php echo $row['FullName'];?></td> <td><?php echo $row['MobileNumber'];?></td> <td><?php echo $row['TestType'];?></td> <td><?php echo $row['TestTimeSlot'];?></td> <td><?php echo $row['RegistrationDate'];?></td> <td> <a href="test-details.php?tid=<?php echo $row['testid'];?>&&oid=<?php echo $row['OrderNumber'];?>" class="btn btn-info btn-sm">View Details</a> </td>
  • 42. 38 </tr> <?php $cnt++;} ?> </tbody> </table> </form> </div> </div> </div> </div> <!-- /.container-fluid --> </div> <!-- End of Main Content --> <!-- Footer --> <?php include_once('includes/footer.php');?> <!-- End of Footer --> </div> <!-- End of Content Wrapper --> </div> <!-- End of Page Wrapper --> <!-- Scroll to Top Button--> <?php include_once('includes/footer2.php');?> <!-- Bootstrap core JavaScript--> <script src="vendor/jquery/jquery.min.js"></script>
  • 43. 39 <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Custom scripts for all pages--> <script src="js/sb-admin-2.min.js"></script> <!-- Page level plugins --> <script src="vendor/datatables/jquery.dataTables.min.js"></script> <script src="vendor/datatables/dataTables.bootstrap4.min.js"></script> <!-- Page level custom scripts --> <script src="js/demo/datatables-demo.js"></script> </body> </html> <?php } ?> /** * Get error messages. * * @return array */ protected function get_messages() {
  • 44. 40 $lang_file = __DIR__.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR.$this- >lang.'.php'; $messages = require $lang_file; if ($validation_methods_errors = self::$validation_methods_errors) { $messages = array_merge($messages, $validation_methods_errors); } return $messages; } /** * Process the validation errors and return human readable error messages. * * @param bool $convert_to_string = false * @param string $field_class * @param string $error_class * * @return array * @return string */ public function get_readable_errors($convert_to_string = false, $field_class = 'gump-field', $error_class = 'gump-error-message') {
  • 45. 41 if (empty($this->errors)) { return ($convert_to_string) ? null : array(); } $resp = array(); // Error messages $messages = $this->get_messages(); foreach ($this->errors as $e) { $field = ucwords(str_replace($this->fieldCharsToRemove, chr(32), $e['field'])); $param = $e['param']; // Let's fetch explicit field names if they exist if (array_key_exists($e['field'], self::$fields)) { $field = self::$fields[$e['field']]; // If param is a field (i.e. equalsfield validator) if (array_key_exists($param, self::$fields)) { $param = self::$fields[$e['param']]; } } // Messages
  • 46. 42 if (isset($messages[$e['rule']])) { if (is_array($param)) { $param = implode(', ', $param); } $message = str_replace('{param}', $param, str_replace('{field}', '<span class="'.$field_class.'">'.$field.'</span>', $messages[$e['rule']])); $resp[] = $message; } else { throw new Exception ('Rule "'.$e['rule'].'" does not have an error message'); } } if (!$convert_to_string) { return $resp; } else { $buffer = ''; foreach ($resp as $s) { $buffer .= "<span class="$error_class">$s</span>"; } return $buffer; } } /**
  • 47. 43 * Process the validation errors and return an array of errors with field names as keys. * * @param $convert_to_string * * @return array | null (if empty) */ public function get_errors_array($convert_to_string = null) { if (empty($this->errors)) { return ($convert_to_string) ? null : array(); } $resp = array(); // Error messages $messages = $this->get_messages(); foreach ($this->errors as $e) { $field = ucwords(str_replace(array('_', '-'), chr(32), $e['field'])); $param = $e['param']; // Let's fetch explicit field names if they exist
  • 48. 44 if (array_key_exists($e['field'], self::$fields)) { $field = self::$fields[$e['field']]; // If param is a field (i.e. equalsfield validator) if (array_key_exists($param, self::$fields)) { $param = self::$fields[$e['param']]; } } // Messages if (isset($messages[$e['rule']])) { // Show first validation error and don't allow to be overwritten if (!isset($resp[$e['field']])) { if (is_array($param)) { $param = implode(', ', $param); } $message = str_replace('{param}', $param, str_replace('{field}', $field, $messages[$e['rule']])); $resp[$e['field']] = $message; } } else { throw new Exception ('Rule "'.$e['rule'].'" does not have an error message'); }
  • 49. 45 } return $resp; } /** * Filter the input data according to the specified filter set. * * @param mixed $input * @param array $filterset * * @throws Exception * * @return mixed * * @throws Exception */ public function filter(array $input, array $filterset) { foreach ($filterset as $field => $filters) { if (!array_key_exists($field, $input)) { continue; }
  • 50. 46 $filters = explode('|', $filters); foreach ($filters as $filter) { $params = null; if (strstr($filter, ',') !== false) { $filter = explode(',', $filter); $params = array_slice($filter, 1, count($filter) - 1); $filter = $filter[0]; } if (is_array($input[$field])) { $input_array = &$input[$field]; } else { $input_array = array(&$input[$field]); } foreach ($input_array as &$value) { if (is_callable(array($this, 'filter_'.$filter))) { $method = 'filter_'.$filter; $value = $this->$method($value, $params); } elseif (function_exists($filter)) { $value = $filter($value);
  • 51. 47 } elseif (isset(self::$filter_methods[$filter])) { $value = call_user_func(self::$filter_methods[$filter], $value, $params); } else { throw new Exception("Filter method '$filter' does not exist."); } } } } return $input; } // ** ------------------------- Filters --------------------------------------- ** // /** * Replace noise words in a string (http://tax.cchgroup.com/help/Avoiding_noise_words_in_your_search.htm). * * Usage: '<index>' => 'noise_words' * * @param string $value * @param array $params * * @return string
  • 52. 48 */ protected function filter_noise_words($value, $params = null) { $value = preg_replace('/ss+/u', chr(32), $value); $value = " $value "; $words = explode(',', self::$en_noise_words); foreach ($words as $word) { $word = trim($word); $word = " $word "; // Normalize if (stripos($value, $word) !== false) { $value = str_ireplace($word, chr(32), $value); } } return trim($value); } /** * Remove all known punctuation from a string. * * Usage: '<index>' => 'rmpunctuataion' * * @param string $value
  • 53. 49 * @param array $params * * @return string */ protected function filter_rmpunctuation($value, $params = null) { return preg_replace("/(?![.=$'€%-])p{P}/u", '', $value); } /** * Sanitize the string by removing any script tags. * * Usage: '<index>' => 'sanitize_string' * * @param string $value * @param array $params * * @return string */ protected function filter_sanitize_string($value, $params = null) { return filter_var($value, FILTER_SANITIZE_STRING); }
  • 54. 50 /** * Sanitize the string by urlencoding characters. * * Usage: '<index>' => 'urlencode' * * @param string $value * @param array $params * * @return string */ protected function filter_urlencode($value, $params = null) { return filter_var($value, FILTER_SANITIZE_ENCODED); } /** * Sanitize the string by converting HTML characters to their HTML entities. * * Usage: '<index>' => 'htmlencode' * * @param string $value * @param array $params
  • 55. 51 * * @return string */ protected function filter_htmlencode($value, $params = null) { return filter_var($value, FILTER_SANITIZE_SPECIAL_CHARS); } /** * Sanitize the string by removing illegal characters from emails. * * Usage: '<index>' => 'sanitize_email' * * @param string $value * @param array $params * * @return string */ protected function filter_sanitize_email($value, $params = null) { return filter_var($value, FILTER_SANITIZE_EMAIL); }
  • 56. 52 /** * Sanitize the string by removing illegal characters from numbers. * * @param string $value * @param array $params * * @return string */ protected function filter_sanitize_numbers($value, $params = null) { return filter_var($value, FILTER_SANITIZE_NUMBER_INT); } /** * Sanitize the string by removing illegal characters from float numbers. * * @param string $value * @param array $params * * @return string */ protected function filter_sanitize_floats($value, $params = null) {
  • 57. 53 return filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); } /** * Filter out all HTML tags except the defined basic tags. * * @param string $value * @param array $params * * @return string */ protected function filter_basic_tags($value, $params = null) { return strip_tags($value, self::$basic_tags); } /** * Convert the provided numeric value to a whole number. * * @param string $value * @param array $params * * @return string
  • 58. 54 */ protected function filter_whole_number($value, $params = null) { return intval($value); } /** * Convert MS Word special characters to web safe characters. * [“, ”, ‘, ’, –, …] => [", ", ', ', -, ...] * * @param string $value * @param array $params * * @return string */ protected function filter_ms_word_characters($value, $params = null) { $word_open_double = '“'; $word_close_double = '”'; $web_safe_double = '"'; $value = str_replace(array($word_open_double, $word_close_double), $web_safe_double, $value); $word_open_single = '‘';
  • 59. 55 $word_close_single = '’'; $web_safe_single = "'"; $value = str_replace(array($word_open_single, $word_close_single), $web_safe_single, $value); $word_em = '–'; $web_safe_em = '-'; $value = str_replace($word_em, $web_safe_em, $value); $word_ellipsis = '…'; $web_safe_em = '...'; $value = str_replace($word_ellipsis, $web_safe_em, $value); return $value; } // ** ------------------------- Validators ------------------------------------ ** // /** * Verify that a value is contained within the pre-defined value set. * * Usage: '<index>' => 'contains,value value value' * * @param string $field * @param array $input * @param null $param *
  • 60. 56 * @return mixed */ protected function validate_contains($field, $input, $param = null) { if (!isset($input[$field])) { return; } $param = trim(strtolower($param)); $value = trim(strtolower($input[$field])); if (preg_match_all('#'(.+?)'#', $param, $matches, PREG_PATTERN_ORDER)) { $param = $matches[1]; } else { $param = explode(chr(32), $param); } if (in_array($value, $param)) { // valid, return nothing return; } return array(
  • 61. 57 'field' => $field, 'value' => $value, 'rule' => __FUNCTION__, 'param' => $param, ); } /** * Verify that a value is contained within the pre-defined value set. * OUTPUT: will NOT show the list of values. * * Usage: '<index>' => 'contains_list,value;value;value' * * @param string $field * @param array $input * * @return mixed */ protected function validate_contains_list($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; }
  • 62. 58 $param = trim(strtolower($param)); $value = trim(strtolower($input[$field])); $param = explode(';', $param); // consider: in_array(strtolower($value), array_map('strtolower', $param) if (in_array($value, $param)) { // valid, return nothing return; } else { return array( 'field' => $field, 'value' => $value, 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Verify that a value is NOT contained within the pre-defined value set.
  • 63. 59 * OUTPUT: will NOT show the list of values. * * Usage: '<index>' => 'doesnt_contain_list,value;value;value' * * @param string $field * @param array $input * * @return mixed */ protected function validate_doesnt_contain_list($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } $param = trim(strtolower($param)); $value = trim(strtolower($input[$field])); $param = explode(';', $param); if (!in_array($value, $param)) { // valid, return nothing return;
  • 64. 60 } else { return array( 'field' => $field, 'value' => $value, 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Check if the specified key is present and not empty. * * Usage: '<index>' => 'required' * * @param string $field * @param array $input * @param null $param * * @return mixed */ protected function validate_required($field, $input, $param = null) {
  • 65. 61 if (isset($input[$field]) && ($input[$field] === false || $input[$field] === 0 || $input[$field] === 0.0 || $input[$field] === '0' || !empty($input[$field]))) { return; } return array( 'field' => $field, 'value' => null, 'rule' => __FUNCTION__, 'param' => $param, ); } /** * Determine if the provided email is valid. * * Usage: '<index>' => 'valid_email' * * @param string $field * @param array $input * @param null $param * * @return mixed
  • 66. 62 */ protected function validate_valid_email($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!filter_var($input[$field], FILTER_VALIDATE_EMAIL)) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided value length is less or equal to a specific value. * * Usage: '<index>' => 'max_len,240' * * @param string $field
  • 67. 63 * @param array $input * @param null $param * * @return mixed */ protected function validate_max_len($field, $input, $param = null) { if (!isset($input[$field])) { return; } if (function_exists('mb_strlen')) { if (mb_strlen($input[$field]) <= (int) $param) { return; } } else { if (strlen($input[$field]) <= (int) $param) { return; } } return array( 'field' => $field,
  • 68. 64 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } /** * Determine if the provided value length is more or equal to a specific value. * * Usage: '<index>' => 'min_len,4' * * @param string $field * @param array $input * @param null $param * * @return mixed */ protected function validate_min_len($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return;
  • 69. 65 } if (function_exists('mb_strlen')) { if (mb_strlen($input[$field]) >= (int) $param) { return; } } else { if (strlen($input[$field]) >= (int) $param) { return; } } return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } /** * Determine if the provided value length matches a specific value. *
  • 70. 66 * Usage: '<index>' => 'exact_len,5' * * @param string $field * @param array $input * @param null $param * * @return mixed */ protected function validate_exact_len($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (function_exists('mb_strlen')) { if (mb_strlen($input[$field]) == (int) $param) { return; } } else { if (strlen($input[$field]) == (int) $param) { return; } }
  • 71. 67 return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } /** * Determine if the provided value contains only alpha characters. * * Usage: '<index>' => 'alpha' * * @param string $field * @param array $input * @param null $param * * @return mixed */ protected function validate_alpha($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) {
  • 72. 68 return; } if (!preg_match('/^([a- zÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ])+$/i', $input[$field]) !== false) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided value contains only alpha-numeric characters. * * Usage: '<index>' => 'alpha_numeric' * * @param string $field * @param array $input * @param null $param
  • 73. 69 * * @return mixed */ protected function validate_alpha_numeric($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!preg_match('/^([a-z0- 9ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ])+$/i', $input[$field]) !== false) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided value contains only alpha characters with dashed and underscores.
  • 74. 70 * * Usage: '<index>' => 'alpha_dash' * * @param string $field * @param array $input * @param null $param * * @return mixed */ protected function validate_alpha_dash($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!preg_match('/^([a-z0- 9ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ_-])+$/i', $input[$field]) !== false) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__,
  • 75. 71 'param' => $param, ); } } /** * Determine if the provided value contains only alpha numeric characters with spaces. * * Usage: '<index>' => 'alpha_numeric_space' * * @param string $field * @param array $input * @param null $param * * @return mixed */ protected function validate_alpha_numeric_space($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; }
  • 76. 72 if (!preg_match("/^([a-z0- 9ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿs])+$/i", $input[$field]) !== false) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided value contains only alpha numeric characters with spaces. * * Usage: '<index>' => 'alpha_space' * * @param string $field * @param array $input * @param null $param * * @return mixed */
  • 77. 73 protected function validate_alpha_space($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!preg_match("/^([0-9a- zÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿs])+$/i", $input[$field]) !== false) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided value is a valid number or numeric string. * * Usage: '<index>' => 'numeric' *
  • 78. 74 * @param string $field * @param array $input * @param null $param * * @return mixed */ protected function validate_numeric($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!is_numeric($input[$field])) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /**
  • 79. 75 * Determine if the provided value is a valid integer. * * Usage: '<index>' => 'integer' * * @param string $field * @param array $input * @param null $param * * @return mixed */ protected function validate_integer($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (filter_var($input[$field], FILTER_VALIDATE_INT) === false) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); }
  • 80. 76 } /** * Determine if the provided value is a PHP accepted boolean. * * Usage: '<index>' => 'boolean' * * @param string $field * @param array $input * @param null $param * * @return mixed */ protected function validate_boolean($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field]) && $input[$field] !== 0) { return; } $booleans = array('1','true',true,1,'0','false',false,0,'yes','no','on','off'); if (in_array($input[$field], $booleans, true )) { return; }
  • 81. 77 return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } /** * Determine if the provided value is a valid float. * * Usage: '<index>' => 'float' * * @param string $field * @param array $input * @param null $param * * @return mixed */ protected function validate_float($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) {
  • 82. 78 return; } if (filter_var($input[$field], FILTER_VALIDATE_FLOAT) === false) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided value is a valid URL. * * Usage: '<index>' => 'valid_url' * * @param string $field * @param array $input * @param null $param * * @return mixed
  • 83. 79 */ protected function validate_valid_url($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!filter_var($input[$field], FILTER_VALIDATE_URL)) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if a URL exists & is accessible. * * Usage: '<index>' => 'url_exists' * * @param string $field
  • 84. 80 * @param array $input * @param null $param * * @return mixed */ protected function validate_url_exists($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } $url = parse_url(strtolower($input[$field])); if (isset($url['host'])) { $url = $url['host']; } if (function_exists('checkdnsrr')) { if (checkdnsrr($url) === false) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__,
  • 85. 81 'param' => $param, ); } } else { if (gethostbyname($url) == $url) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } } /** * Determine if the provided value is a valid IP address. * * Usage: '<index>' => 'valid_ip' * * @param string $field * @param array $input *
  • 86. 82 * @return mixed */ protected function validate_valid_ip($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!filter_var($input[$field], FILTER_VALIDATE_IP) !== false) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided value is a valid IPv4 address. * * Usage: '<index>' => 'valid_ipv4' *
  • 87. 83 * @param string $field * @param array $input * * @return mixed * * @see http://pastebin.com/UvUPPYK0 */ /* * What about private networks? http://en.wikipedia.org/wiki/Private_network * What about loop-back address? 127.0.0.1 */ protected function validate_valid_ipv4($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!filter_var($input[$field], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { // removed !== FALSE return array( 'field' => $field,
  • 88. 84 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided value is a valid IPv6 address. * * Usage: '<index>' => 'valid_ipv6' * * @param string $field * @param array $input * * @return mixed */ protected function validate_valid_ipv6($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; }
  • 89. 85 if (!filter_var($input[$field], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the input is a valid credit card number. * * See: http://stackoverflow.com/questions/174730/what-is-the-best-way-to-validate-a- credit-card-in-php * Usage: '<index>' => 'valid_cc' * * @param string $field * @param array $input * * @return mixed */ protected function validate_valid_cc($field, $input, $param = null)
  • 90. 86 { if (!isset($input[$field]) || empty($input[$field])) { return; } $number = preg_replace('/D/', '', $input[$field]); if (function_exists('mb_strlen')) { $number_length = mb_strlen($number); } else { $number_length = strlen($number); } $parity = $number_length % 2; $total = 0; for ($i = 0; $i < $number_length; ++$i) { $digit = $number[$i]; if ($i % 2 == $parity) { $digit *= 2;
  • 91. 87 if ($digit > 9) { $digit -= 9; } } $total += $digit; } if ($total % 10 == 0) { return; // Valid } return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } /** * Determine if the input is a valid human name [Credits to http://github.com/ben-s]. *
  • 92. 88 * See: https://github.com/Wixel/GUMP/issues/5 * Usage: '<index>' => 'valid_name' * * @param string $field * @param array $input * * @return mixed */ protected function validate_valid_name($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!preg_match("/^([a- zÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖßÙÚÛÜÝàáâãäåçèéêëìíîïñðòóôõöùúûüýÿ '-])+$/i", $input[$field]) !== false) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, );
  • 93. 89 } } /** * Determine if the provided input is likely to be a street address using weak detection. * * Usage: '<index>' => 'street_address' * * @param string $field * @param array $input * * @return mixed */ protected function validate_street_address($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } // Theory: 1 number, 1 or more spaces, 1 or more words $hasLetter = preg_match('/[a-zA-Z]/', $input[$field]); $hasDigit = preg_match('/d/', $input[$field]); $hasSpace = preg_match('/s/', $input[$field]);
  • 94. 90 $passes = $hasLetter && $hasDigit && $hasSpace; if (!$passes) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided value is a valid IBAN. * * Usage: '<index>' => 'iban' * * @param string $field * @param array $input * * @return mixed */
  • 95. 91 protected function validate_iban($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } static $character = array( 'A' => 10, 'C' => 12, 'D' => 13, 'E' => 14, 'F' => 15, 'G' => 16, 'H' => 17, 'I' => 18, 'J' => 19, 'K' => 20, 'L' => 21, 'M' => 22, 'N' => 23, 'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27, 'S' => 28, 'T' => 29, 'U' => 30, 'V' => 31, 'W' => 32, 'X' => 33, 'Y' => 34, 'Z' => 35, 'B' => 11 ); if (!preg_match("/A[A-Z]{2}d{2} ?[A-Zd]{4}( ?d{4}){1,} ?d{1,4}z/", $input[$field])) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); }
  • 96. 92 $iban = str_replace(' ', '', $input[$field]); $iban = substr($iban, 4).substr($iban, 0, 4); $iban = strtr($iban, $character); if (bcmod($iban, 97) != 1) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided input is a valid date (ISO 8601). * * Usage: '<index>' => 'date' * * @param string $field * @param string $input date ('Y-m-d') or datetime ('Y-m-d H:i:s') * @param null $param *
  • 97. 93 * @return mixed */ protected function validate_date($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } $cdate1 = date('Y-m-d', strtotime($input[$field])); $cdate2 = date('Y-m-d H:i:s', strtotime($input[$field])); if ($cdate1 != $input[$field] && $cdate2 != $input[$field]) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided input meets age requirement (ISO 8601).
  • 98. 94 * * Usage: '<index>' => 'min_age,13' * * @param string $field * @param string $input date ('Y-m-d') or datetime ('Y-m-d H:i:s') * @param string $param int * * @return mixed */ protected function validate_min_age($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } $cdate1 = new DateTime(date('Y-m-d', strtotime($input[$field]))); $today = new DateTime(date('d-m-Y')); $interval = $cdate1->diff($today); $age = $interval->y; if ($age <= $param) { return array(
  • 99. 95 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided numeric value is lower or equal to a specific value. * * Usage: '<index>' => 'max_numeric,50' * * @param string $field * @param array $input * @param null $param * * @return mixed */ protected function validate_max_numeric($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return;
  • 100. 96 } if (is_numeric($input[$field]) && is_numeric($param) && ($input[$field] <= $param)) { return; } return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } /** * Determine if the provided numeric value is higher or equal to a specific value. * * Usage: '<index>' => 'min_numeric,1' * * @param string $field * @param array $input * @param null $param
  • 101. 97 * @return mixed */ protected function validate_min_numeric($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (is_numeric($input[$field]) && is_numeric($param) && ($input[$field] >= $param)) { return; } return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } /** * Determine if the provided value starts with param.
  • 102. 98 * * Usage: '<index>' => 'starts,Z' * * @param string $field * @param array $input * * @return mixed */ protected function validate_starts($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (strpos($input[$field], $param) !== 0) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } }
  • 103. 99 /** * Checks if a file was uploaded. * * Usage: '<index>' => 'required_file' * * @param string $field * @param array $input * * @return mixed */ protected function validate_required_file($field, $input, $param = null) { if (!isset($input[$field])) { return; } if (is_array($input[$field]) && $input[$field]['error'] !== 4) { return; } return array( 'field' => $field, 'value' => $input[$field],
  • 104. 100 'rule' => __FUNCTION__, 'param' => $param, ); } /** * Check the uploaded file for extension for now * checks only the ext should add mime type check. * * Usage: '<index>' => 'extension,png;jpg;gif * * @param string $field * @param array $input * * @return mixed */ protected function validate_extension($field, $input, $param = null) { if (!isset($input[$field])) { return; } if (is_array($input[$field]) && $input[$field]['error'] !== 4) {
  • 105. 101 $param = trim(strtolower($param)); $allowed_extensions = explode(';', $param); $path_info = pathinfo($input[$field]['name']); $extension = $path_info['extension']; if (in_array($extension, $allowed_extensions)) { return; } return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Determine if the provided field value equals current field value. * *
  • 106. 102 * Usage: '<index>' => 'equalsfield,Z' * * @param string $field * @param string $input * @param string $param field to compare with * * @return mixed */ protected function validate_equalsfield($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if ($input[$field] == $input[$param]) { return; } return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param,
  • 107. 103 ); } /** * Determine if the provided field value is a valid GUID (v4) * * Usage: '<index>' => 'guidv4' * * @param string $field * @param string $input * @param string $param field to compare with * @return mixed */ protected function validate_guidv4($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (preg_match("/{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0- 9]{12}}?$/", $input[$field])) { return; }
  • 108. 104 return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } /** * Trims whitespace only when the value is a scalar. * * @param mixed $value * * @return mixed */ private function trimScalar($value) { if (is_scalar($value)) { $value = trim($value); } return $value; }
  • 109. 105 /** * Determine if the provided value is a valid phone number. * * Usage: '<index>' => 'phone_number' * * @param string $field * @param array $input * * @return mixed * * Examples: * * 555-555-5555: valid * 5555425555: valid * 555 555 5555: valid * 1(519) 555-4444: valid * 1 (519) 555-4422: valid * 1-555-555-5555: valid * 1-(555)-555-5555: valid */ protected function validate_phone_number($field, $input, $param = null) {
  • 110. 106 if (!isset($input[$field]) || empty($input[$field])) { return; } $regex = '/^(d[s-]?)?[([s-]{0,2}?d{3}[)]s-]{0,2}?d{3}[s-]?d{4}$/i'; if (!preg_match($regex, $input[$field])) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * Custom regex validator. * * Usage: '<index>' => 'regex,/your-regex-expression/' * * @param string $field * @param array $input *
  • 111. 107 * @return mixed */ protected function validate_regex($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } $regex = $param; if (!preg_match($regex, $input[$field])) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /** * JSON validator. * * Usage: '<index>' => 'valid_json_string'
  • 112. 108 * * @param string $field * @param array $input * * @return mixed */ protected function validate_valid_json_string($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!is_string($input[$field]) || !is_object(json_decode($input[$field]))) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); } } /**
  • 113. 109 * Check if an input is an array and if the size is more or equal to a specific value. * * Usage: '<index>' => 'valid_array_size_greater,1' * * @param string $field * @param array $input * * @return mixed */ protected function validate_valid_array_size_greater($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!is_array($input[$field]) || sizeof($input[$field]) < (int)$param) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); }
  • 114. 110 } /** * Check if an input is an array and if the size is less or equal to a specific value. * * Usage: '<index>' => 'valid_array_size_lesser,1' * * @param string $field * @param array $input * * @return mixed */ protected function validate_valid_array_size_lesser($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!is_array($input[$field]) || sizeof($input[$field]) > (int)$param) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__,
  • 115. 111 'param' => $param, ); } } /** * Check if an input is an array and if the size is equal to a specific value. * * Usage: '<index>' => 'valid_array_size_equal,1' * * @param string $field * @param array $input * * @return mixed */ protected function validate_valid_array_size_equal($field, $input, $param = null) { if (!isset($input[$field]) || empty($input[$field])) { return; } if (!is_array($input[$field]) || sizeof($input[$field]) == (int)$param) { return array( 'field' => $field, 'value' => $input[$field], 'rule' => __FUNCTION__, 'param' => $param, ); }
  • 116. 112 } } ADMIN PANEL <?php include 'includes/connection.php';?> <?php include 'includes/header.php';?> <?php include 'includes/navbar.php';?> <?php if (isset($_POST['recover'])) { $email = mysqli_real_escape_string($conn , $_POST['email']); if (filter_var($email, FILTER_VALIDATE_EMAIL)) { $query = "SELECT email FROM users WHERE email = '$email'"; $run = mysqli_query($conn , $query) or die (mysqli_error($conn) ); if (mysqli_num_rows($run) > 0) { function generateRandomString($length = 5) { return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST UVWXYZ"), 0, $length); } $token_tmp = generateRandomString(); $token = md5($token_tmp);
  • 117. 113 $url = $_SERVER['REQUEST_URI']; $parts = explode('/',$url); $dir = $_SERVER['SERVER_NAME']; for ($i = 0; $i < count($parts) - 1; $i++) { $dir .= $parts[$i] . "/"; } require 'PHPMailer/PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'collegenotesgallery@gmail.com'; // SMTP username $mail->Password = 'collegegallery'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 587; // TCP port to connect to $mail->setFrom('collegenotesgallery@gmail.com', 'Admin'); $mail->addReplyTo('collegenotesgallery@gmail.com', 'Admin'); $mail->addAddress($email); $mail->isHTML(true); // Set email format to HTML
  • 118. 114 $bodyContent = '<h1>Recover Password Link: </h1>'; $bodyContent .= 'http://' . $dir . 'verifytoken.php?token='.$token; $mail->Subject = 'Email from collegenotesgallery '; $mail->Body = $bodyContent; $query2 = "UPDATE users set token = '$token' WHERE email = '$email'"; $run = mysqli_query($conn , $query2) or die(mysqli_error($conn)); $count = mysqli_affected_rows($conn); if($mail->send() && ($count > 0)) { echo "<center> <font color = 'green' >Email with recover password link has been sent </font><center> " ; } else { echo "<center> <font color = 'red' >'Message could not be sent.'</font><center> "; echo "<center> <font color = 'red' >'Mailer Error: ' . $mail->ErrorInfo </font><center> "; } } else { echo "<center> <font color = 'red' > Entered email does not match to any record </font><center> "; }
  • 119. 115 } else { echo "<center> <font color = 'red' > Invalid email type </font><center> "; } } ?> <div class="login-card"> <h1>Recover Password</h1><br> <form action = "" method="POST"> <input type="text" name="email" placeholder="Enter your Email" required=""> <input type="submit" name="recover" class="login login-submit" value="send"> </form> <div class="login-help"> <a href="signup.php">Register</a> • <a href="login.php">Login</a> </div> </div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script> </body> </html>
  • 120. 116 VALIDATION CHECK Validation on password fields: Passwords should be greater than 4 characters. Password field should not remain empty. Validation on textbox field: This field should not remain empty and invalid. Validation on Column password of user, admin, login form table: This column has a unique key and not null constraint defined on it. VALIDATION CODING: 1. <!DOCTYPE html> 2. <html> 3. <head> 4. <style> 5. .error {color: #FF0001;} 6. </style> 7. </head> 8. <body> 9. 10. <?php 11. // define variables to empty values 12. $nameErr = $emailErr = $mobilenoErr = $genderErr = $websiteErr = $agreeErr = ""; 13. $name = $email = $mobileno = $gender = $website = $agree = ""; 14. 15. //Input fields validation 16. if ($_SERVER["REQUEST_METHOD"] == "POST") { 17. 18. //String Validation 19. if (emptyempty($_POST["name"])) { 20. $nameErr = "Name is required"; 21. } else { 22. $name = input_data($_POST["name"]); 23. // check if name only contains letters and whitespace 24. if (!preg_match("/^[a-zA-Z ]*$/",$name)) { 25. $nameErr = "Only alphabets and white space are allowed"; 26. } 27. } 28. 29. //Email Validation 30. if (emptyempty($_POST["email"])) { 31. $emailErr = "Email is required"; 32. } else { 33. $email = input_data($_POST["email"]); 34. // check that the e-mail address is well-formed 35. if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { 36. $emailErr = "Invalid email format";
  • 121. 117 37. } 38. } 39. 40. //Number Validation 41. if (emptyempty($_POST["mobileno"])) { 42. $mobilenoErr = "Mobile no is required"; 43. } else { 44. $mobileno = input_data($_POST["mobileno"]); 45. // check if mobile no is well-formed 46. if (!preg_match ("/^[0-9]*$/", $mobileno) ) { 47. $mobilenoErr = "Only numeric value is allowed."; 48. } 49. //check mobile no length should not be less and greator than 10 50. if (strlen ($mobileno) != 10) { 51. $mobilenoErr = "Mobile no must contain 10 digits."; 52. } 53. } 54. 55. //URL Validation 56. if (emptyempty($_POST["website"])) { 57. $website = ""; 58. } else { 59. $website = input_data($_POST["website"]); 60. // check if URL address syntax is valid 61. if (!preg_match("/b(?:(?:https?|ftp)://|www.)[-a-z0-9+&@#/%?=~_|!:,.;]*[-a- z0-9+&@#/%=~_|]/i",$website)) { 62. $websiteErr = "Invalid URL"; 63. } 64. } 65. 66. //Empty Field Validation 67. if (emptyempty ($_POST["gender"])) { 68. $genderErr = "Gender is required"; 69. } else { 70. $gender = input_data($_POST["gender"]); 71. } 72. 73. //Checkbox Validation 74. if (!isset($_POST['agree'])){ 75. $agreeErr = "Accept terms of services before submit."; 76. } else { 77. $agree = input_data($_POST["agree"]); 78. } 79. } 80. function input_data($data) { 81. $data = trim($data); 82. $data = stripslashes($data); 83. $data = htmlspecialchars($data); 84. return $data; 85. }
  • 122. 118 86. ?> 87. 88. <h2>Registration Form</h2> 89. <span class = "error">* required field </span> 90. <br><br> 91. <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" > 92. Name: 93. <input type="text" name="name"> 94. <span class="error">* <?php echo $nameErr; ?> </span> 95. <br><br> 96. E-mail: 97. <input type="text" name="email"> 98. <span class="error">* <?php echo $emailErr; ?> </span> 99. <br><br> 100. Mobile No: 101. <input type="text" name="mobileno"> 102. <span class="error">* <?php echo $mobilenoErr; ?> </span> 103. <br><br> 104. Website: 105. <input type="text" name="website"> 106. <span class="error"><?php echo $websiteErr; ?> </span> 107. <br><br> 108. Gender: 109. <input type="radio" name="gender" value="male"> Male 110. <input type="radio" name="gender" value="female"> Female 111. <input type="radio" name="gender" value="other"> Other 112. <span class="error">* <?php echo $genderErr; ?> </span> 113. <br><br> 114. Agree to Terms of Service: 115. <input type="checkbox" name="agree"> 116. <span class="error">* <?php echo $agreeErr; ?> </span> 117. <br><br> 118. <input type="submit" name="submit" value="Submit"> 119. <br><br> 120. </form> 121. 122. <?php 123. if(isset($_POST['submit'])) { 124. if($nameErr == "" && $emailErr == "" && $mobilenoErr == "" && $genderErr == "" && $websiteErr == "" && $agreeErr == "") { 125. echo "<h3 color = #FF0001> <b>You have sucessfully registered.</b> </h3>"; 126. echo "<h2>Your Input:</h2>"; 127. echo "Name: " .$name; 128. echo "<br>"; 129. echo "Email: " .$email; 130. echo "<br>"; 131. echo "Mobile No: " .$mobileno; 132. echo "<br>"; 133. echo "Website: " .$website;
  • 123. 119 134. echo "<br>"; 135. echo "Gender: " .$gender; 136. } else { 137. echo "<h3> <b>You didn't filled up the form correctly.</b> </h3>"; 138. } 139. } 140. ?> 141. </body> 142. </html>
  • 124. 120 CONCLUSION The project titled ‘CORONA WARRIORS’ was developed by the health services and direction and with their help. The system was tested and the performance of the system was found to be acceptable. All the necessary output was created. The system was found to be user-friendly with help messages for the staff and admin. The system was implemented successfully. The manpower and working hours needed to operate the system was less and it was seen to be more secure. Thus, the Project was completed successfully.
  • 125. 121 BIBLIOGRAPHY Books: 1. HTML & CSS: Design and Build Websites by Jon Duckett 2. Learning PHP, MySQL, JavaScript, CSS & HTML5: A Step-by-Step Guide to Creating Dynamic Websites by Robin Nixon 3. Head First HTML with CSS & XHTML by Elisabeth Freeman and Eric Freeman 4. PHP & MySQL: Server-side Web Development by Jon Duckett 5. CSS Secrets: Better Solutions to Everyday Web Design Problems by Lea Vero Links: 1. https://www.w3schools.com/html/ 2. https://html.com/ 3. https://www.tutorialspoint.com/php/index.htm 4. https://www.codecademy.com/learn/learn-php