Professional Documents
Culture Documents
Manual management of hostels is challenging since it involves a lot of work load and time consumption.
The system we have developed can easily manage the hostel details which include: Student records, room
details, and an easy way of allocating the rooms. Main feature of this application is to enable users to
login and update their profile, while choosing the rooms of their choice online. The main tools used to
develop the application are MySQL database and Php scripting language.
[Type text]
2|Page
[Type text]
Table of Contents
INTRODUCTION ......................................................................................................
1. .......................... 6
Scope Definition
........................................................................................................................
1.1. ... 6
Existing System
........................................................................................................................
1.2. .... 6
Proposed System
.........................................................................................................................
1.3. .. 6
Project Management strategy
1.4. ........................................................................................................ 6
2. SYSTEM ANALYSIS AND DESIGN
................................................................................................. 7
CONTEXT DIAGRAM
2.1. ................................................................................................................ 7
ENTITY RELATIONSHIP DIAGRAM
2.2. ...................................................................................... 7
Data Flow Diagram
2.3. ....................................................................................................................... 8
2.3.1.Room Application and Allocation Process
........................................................................... 8
System
Implementation...........................................................................................................
3. .............. 9
DATABASE IMPLEMENTATION
3.1. ............................................................................................. 9
TABLE: APPLICATIONS
3.1.1. ................................................................................................... 9
TABLE: ROOMS
3.1.2. ................................................................................................................. 9
TABLE: STUDENTS
3.1.3. ........................................................................................................... 9
TABLE: USERS
3.1.4. ................................................................................................................. 10
Web Interface
.......................................................................................................................
3.2. ....... 10
Scripting ...........................................................................................................
3.3. ........................... 10
3.3.1.Php is used for server-side scripting.
.................................................................................. 10
Database Connection
3.4. .................................................................................................................. 10
3.5 Site Map
................................................................................................................................
............ 11
SOFTWARE REQUIREMENTS
4. SPECIFICATIONS....................................................................... 12
4.1. Introduction ....................................................................................................... 12
[Type text]
..........................
Purpose .............................................................................................................
4.2. ........................... 12
Scope ..............................................................................................................
4.3. ............................. 12
4.4.ABBREVIATIONS, DEFINITIONS AND ACRONYMS
........................................................ 12
References ........................................................................................................
4.5. ........................... 13
Overview ..........................................................................................................
4.6. ........................... 13
General Description
5. ............................................................................................................................ 13
Product Perspective
5.1. ..................................................................................................................... 13
System Interface
5.1.1. .................................................................................................................. 13
3|Pag
e
[Type text]
User Interface
................................................................................................................
5.1.2. ......13
Hardware Interface
5.1.3. .............................................................................................................. 14
Software Interface
5.1.4. ............................................................................................................... 14
Communication Interface
5.1.5. .................................................................................................... 14
Memory Constraints
5.1.6. ............................................................................................................ 15
Operations ..................................................................................................
5.1.7. .........................15
Site Adaptation requirements
5.1.8. .............................................................................................. 15
Product Functions
5.2. ........................................................................................................................... 15
User Functions
......................................................................................................................
5.2.1. ..15
Student Functions
5.2.2. .................................................................................................................... 15
User Characteristics
5.2.3. ................................................................................................................ 15
General Constraints
5.3. ..................................................................................................................... 16
Assumptions and Dependencies
5.4. .................................................................................................. 16
Specific Requirements
6. ........................................................................................................................ 16
External Interface Requirements
6.1. ................................................................................................. 16
Functional Requirements
6.2. ............................................................................................................ 16
Administrator Functions
6.2.1. ......................................................................................................... 16
Add User
................................................................................................................
6.2.1.1. .........16
View Applicants
6.2.1.2. .............................................................................................................. 16
View Students
................................................................................................................
6.2.1.3. .17
Change Password
6.2.1.4. ............................................................................................................ 17
Student Functions
6.2.2. .................................................................................................................... 17
Profile .........................................................................................................
6.2.2.1. .........................17
6.2.2.2. Apply Room 17
................................................................................................................
[Type text]
....
Status of Application
6.2.2.3. ....................................................................................................... 18
View History
................................................................................................................
6.2.2.4. ...18
Change Password
6.2.2.5. ............................................................................................................ 18
Use Cases
............................................................................................................................
6.3. ............19
Hostel Management System Use Case Diagram
6.3.1. ..................................................................... 19
Login ........................................................................................................
6.3.1.1. .......................19
Manage User Accounts
6.3.1.2. ................................................................................................... 20
Manage Student Activities
6.3.1.3. .............................................................................................. 21
4|Page
[Type text]
6.4. Non-functional Requirements
21
6.4.1. Performance Requirements
21
6.4.2. Design Constraints
22
6.4.3. Standards Compliance
22
6.4.4. Reliability
22
6.4.5. Availability
22
6.4.6. Security
22
6.4.7. Maintainability
22
6.4.8. Portability
22
APPENDIXES
..................................................................................................................................................................
23
Appendix A: (i) Project Task Schedule
..............................................................................................................................................................
23
Appendix A: (ii) Project Gantt Chart
..............................................................................................................................................................
23
Appendix B: Database Relations
..............................................................................................................................................................
23
Screen Shot of the users table
..........................................................................................................................................................
23
Screen Shot of the students table
..........................................................................................................................................................
23
Screen Shot of the rooms table
..........................................................................................................................................................
24
Screen shot of the applicants table
..........................................................................................................................................................
24
Appendix C: Web Interface
..............................................................................................................................................................
24
[Type text]
Appendix D: Php Scripts
..............................................................................................................................................................
26
session.php
..........................................................................................................................................................
26
functions.php
..........................................................................................................................................................
27
applyRoom.php
..........................................................................................................................................................
28
processProfile.php
..........................................................................................................................................................
31
profile.php
..........................................................................................................................................................
32
Appendix E: Database Connection
..............................................................................................................................................................
35
5|Page
[Type text]
1. INTRODUCTION
6|Page
[Type text]
2. SYSTEM ANALYSIS AND DESIGN
Applicatio
n Application
Allocated/Rej Allocate/Rejecte
STUDENT ected HOSTEL MANAGEMENT d HOSTEL
SYSTEM
In the context diagram above, the student applies for a room. The student either gets allocated to a room
or the application is rejected.
USERS
PK USER_ID
USERNAME STUDENTS
HASHED_PASSWORD
ADMIN PK STUD_ID
PK,FK1 USER_ID
FNAME
LNAME
ROOMS GENDER
ASSIGNED_ROOM_I PLACEOFRESIDENCE
PK D PHONENUMBER
ADDRESS
LOCATION PERSONALIMAGE
CONDITION
APPLICATIONS
PK APP_ID
PK,FK1 STUD_ID
ASSIGNED_ROOM_I
PK,FK2 D
PREFERREDROOM
SEMESTER
YEAR
STATUS
[Type text]
7|Page
[Type text]
Student can apply only up to one room, and rooms can have many applicants. Applications can have
many rooms and students.
User
Details User
Verify User Details User
Valid User
Check
Application Applied User Applied Room
Status
Non Valid User
Receipt Payment
Finan
Bill Room Payment ce
In fig 3 above, the system checks for an existing user, who may be a student or administrator, by
authenticating the username and password. If they dont match the details in the database, the system
will return an invalid username and password message. If the credentials match the details in the
database, the system will check the students application status. The system then retrieves the students
application details.
[Type text]
8|Page
[Type text]
3. System Implementation
The system is implemented using Apache web server, MySQL, and PHP. The administrator can access
the backend through PhpMyAdmin console provided by the Apache server.
9|Page
[Type text]
0)
gender No varchar2(6) The students gender; whether Male or Female.
placeOfResi No varchar2(4 The students place of Residence.
dence 5)
phoneNumb No varchar2(2 The students phone number.
er 0)
user_id No int(10) Foreign Key references the users table
address No varchar2(2 The students address.
5)
personalIma No varchar(50) The students Image.
ge
3.3. Scripting
10 | P a g e
3.5 Site Map
INDEX
PROFILE
ADD USER
APPLY
ROOM
VIEW APPLICANTS
STATUS
OF
VIEW STUDENTS APPLICATION
VIEW
HISTORY
CHANGE
PASSWORD
11 | P a
ge
4. SOFTWARE REQUIREMENTS SPECIFICATIONS
Preface
This section contains the Software Requirements Specification (SRS) Document for the Hostel
Managements System (HMS). The main aim is to enable online room application and allocation to the
students.
4.1. Introduction
The following subsections are an overview of the entire Software Requirements Specification (SRS)
document.
4.2. Purpose
This SRS section describes the design decisions and the detailed design needed to implement the system.
It defines the product functions, user characteristics, constraints under which it must operate, how the
system will react to external stimuli, and specific requirements of the system. The document is intended
for the users and the developers of the system.
4.3. Scope
HMS has the main aim of managing room application and allocation in a Web-based environment. The
overall system will consist of HMS Database System and HMS Web Interface. The HMS database system
will supply the fundamental database structure of the entire system whereas its Web Interface will provide
a secure Web interface between the users and the database. HMS aims towards establishing a paperless
office rather than using a manual system.
The objectives of the project are: To enable online room application and allocation in a timely manner, to
enable the students update their details online, to eliminate duplicate data, and to enable a smooth
communication channel between the system administrator and its users,
12 | P a g e
HTML5 Hyper Text Markup Language 5
4.5. References
IEEE Standards 1016-1998, Recommended Practice for Software Design Descriptions
4.6. Overview
This document is prepared in accordance with the IEEE Standards 830-1998, IEEE Recommended
Practice for Software Requirements Specifications.
Section 5.0 of this document gives a general description of HMS. It also provides product perspectives,
product functions, user characteristics, general constraints, and assumptions and dependencies of the
system.
Section 6.0 contains additional design details. It will contain functional and performance
requirements, design constraints, attributes and external interface requirements for the HMS.
5. General Description
This section describes the general factors that affect the HMS and its requirements. This part of SRS
provides a background for the requirements for ease of comprehension.
13 | P a g e
Student Module: Status of Application Student can check their application status.
Student Module: View history Student Students can view history of past applications
Module: Change Password Student Student can change his/her password.
Module: Logout After the student is done using the system, he/she
logs out.
Administrator Module: Add user Admin can add a new user by assigning new user
name and passwords respectively.
Administrator Module: View Applicants Admin can view the applicants by selecting the year
and semester.
Administrator Module: View Students Admin can view the students details.
Administrator Module: Change Password Admin can change his/her password.
Any Personal computer, which can support any X-window or Windows environment with a mouse
support, is acceptable.
Server Side
HMS will be run on a web server, which is installed into the school server.
Apache Web server is installed and will enable HMS to interact with its users. PHP is a server-side
scripting language, which will be used to code the HMS.
Client Side
On the client side the required software product is Internet Explorer/Google Chrome/Mozilla Firefox
supporting at least HTML version 3.2, java enabled, and any operating system that can run the browsers.
14 | P a g e
5.1.6. Memory Constraints
The client computer, which runs the web browser, should have enough physical memory to run this
program.
5.1.7. Operations
The HMS operations needed by the users are described below.
Administrator of the system creates and defines the status of users by (Add User). The user will be
given a unique username and password. The Admin may change their passwords by (Change
Password). The Admin can view applicants and also view the students details.
The student accesses the system by logging in. They can view their profiles and update it
(Profile), Apply room, View Status of Application, View history and change their passwords.
This user has to have at least Window 7/Linux OS and Internet browsing skills for administrating HMS
user profiles.
15 | P a g e
The Student
This user has to have at least Window 7/Linux OS and Internet browsing skills to use the system.
Credit card payment or any other form of payment other than through the finance department
is not allowed on the system.
6. Specific Requirements
Process: The administrator activates the function and enters the username and password of the new user.
The function will also check the database whether the user already exists or not. According to the results,
the system adds the user to the all user list with a confirmation message, or the function displays an error
message.
Input: none
16 | P a g e
Process: The administrator selects the semester and year. The function queries the database for the
students who have applied for rooms.
Output: All applicants with their respective details (user id, preferred room, and assigned room id) will
be displayed.
Input: none
Process: When the administrator logon the system, automatically, all student list is displayed. The
function queries the database for all the students.
Output: List of all students with their respective details (student id, first name, and last name, and
gender, place of residence, phone number, and address) will be displayed.
Process: Administrator activates the function to change the password. The new password and confirm
password fields are entered. If they match, the old password will be updated with the new one.
6.2.2.1. Profile
Introduction: HMS shall enable student to view and update their profile.
Input: none
Process: By this function, the database is queried for all the personal information of the student.
17 | P a g e
Process: By this function, the selected information is stored into the database.
Input: student id
Process: By this function, the database is queried for all the room application information of the student.
Input: student id
Process: By this function, the database is queried for all the previous room application information of the
student.
Process: student activates the function to change the password. The new password and confirm password
fields are entered. If they match, the old password will be updated with the new one.
18 | P a g e
6.3. Use Cases
6.3.1.1. Login
Use Case Login
Name
Introduction This use case describes how a user logs into the HMS.
Pre- None
Conditions
Basic Flow This use case starts when the actor wishes to login to the HMS which requests that the
actor enter his/her username and password. The actor enters his/her username &
19 | P a g e
password. System validates username and password, and if finds correct allow
the actor to log into the system.
Alternate Flow Invalid name and password. If in the basic flow, the actor enters an invalid name and/or
password, the system displays an error message.
The actor can choose to either return to the beginning of the basic flow or cancel the
login, at that point, the use case ends.
Post-Condition If the use case is successful, the actor is logged into the system. If not, the system state
is unchanged.
Introduction This use case allows the administrator to maintain user account. This includes
adding, viewing applicants, view students and changing passwords.
Actors Administrator
Pre-Conditions The administrator must be logged on to the system before the use case begins.
Post-Condition If the use case was successful, the user is added, applicant information is viewed,
view student details, and admin can change his/her password. Otherwise, the system
state is unchanged.
Basic Flow This use case starts when the Administrator wishes to add a user, view applicant,
view student, and change his /her password.
The system requests that the Administrator specify the function he/she would like to
perform (Add User, View Applicant, View Student, or Change Password).
Once the Administrator provides the requested information, one of the sub-flows is
executed
If the Administrator selected Add User, the Add User sub flow is executed.
20 | P a g e
View Applicant sub-flow is executed.
Alternate Flow User Not Found: If a user account with the specified details does not exist, the system
displays an error message. The Administrator can then enter a different User name
or cancel the operation, at which point the use case ends.
Post-Condition The system shall add, view applicant, view student, and change password.
Introduction Allows the student to manage their various activities. This includes View Profile,
Apply Room, View Status of Application, View History, and Change Password.
Actors Student.
Post-Condition If use case is successful, the student can view their profiles, apply room, view status
of application, view history and change password. Otherwise the system state is
unchanged.
Basic Flow Starts when student wishes to view Profile, Apply Room, view Status of Application,
and Change Password. The system requests the Student to specify the function;
he/she would like to perform.
Alternate Flow The system displays an error message if student information is unavailable.
Post-Condition The system shall view Profile, Apply Room, view Status of Application, and Change
Password for the student.
21 | P a g e
The load time for user interface screens should take no longer than two seconds.
6.4.4. Reliability
The system database connectivity has been designed with a persistent connection to ensure system
reliability. The system runs on a dedicated server to ensure that it is reliable at all times.
6.4.5. Availability
The system is available at all times, but a room application is open at the beginning of every semester
to ensure that rooms are available.
6.4.6. Security
The system has an authorization mechanism for users to identify their personal profiles. Therefore,
different users will have different authorization levels to access the data. The system should utilize certain
cryptographic techniques for instance SHA1 algorithm, encrypting passwords.
6.4.7. Maintainability
The system is developed using PHP, and PHP is a cross platform programming language which is easy to
maintain. Most of the PHP variables are global variables.
6.4.8. Portability
The HMS runs on any desktop computer supporting web browsing.
22 | P a g e
APPENDIXES
Index.php
24 | P a g e
25 | P a
ge
Appendix D: Php Scripts
Index.php:
<?php
error_reporting(1);
error_reporting(1);
$con = mysql_connect("localhost","root","","full");
mysql_select_db("full",$con);
//marquee display
$q = "SELECT marquee1 FROM admin WHERE id=1";
$q1 = mysql_query($q);
$disp = mysql_fetch_array($q1);
//echo $disp['marquee1'];
//change footer
$q4 = "SELECT footerinfo FROM admin WHERE id=1";
$q41 = mysql_query($q4);
$footerdisp = mysql_fetch_array($q41);
//echo $footerdisp['footerinfo'];
?>
<html>
<head>
<title>Sample School Project</title>
<link rel="stylesheet" type="text/css" href="engine/css/slideshow.css" media="screen" />
<style type="text/css">.slideshow a#vlb{display:none}</style>
<script type="text/javascript" src="engine/js/mootools.js"></script>
<script type="text/javascript" src="engine/js/visualslideshow.js"></script>
<link rel="stylesheet" type="text/css" href="engine1/style.css" />
<script type="text/javascript" src="engine1/jquery.js"></script>
</th>
</tr>
<tr>
<td height="38" colspan="2" style="background-color:#6E68FF">
<div id="horizontalmenu">
<ul>
<li><a href="index.php" onMouseOver="this.style.color='#FFFFFF'"
onMouseOut="this.style.color='#353535'" style="color:#353535 ; text-decoration:none;"
><b>HOME</b></a></li>
<li><a href="index.php?option=about" onMouseOver="this.style.color='#FFFFFF'"
onMouseOut="this.style.color='#353535'" style="color:#353535 ; text-
decoration:none;"><b>ABOUT</b></a></li>
<li><a href="index.php?option=contact" onMouseOver="this.style.color='#FFFFFF'"
onMouseOut="this.style.color='#353535'" style="color:#353535 ; text-
decoration:none;"><b>CONTACT</b></a></li>
<li><a href="index.php?option=gallery" onMouseOver="this.style.color='#FFFFFF'"
onMouseOut="this.style.color='#353535'" style="color:#353535 ; text-
decoration:none;"><b>GALLERY</b></a></li>
<li><a href="index.php?option=course" onMouseOver="this.style.color='#FFFFFF'"
onMouseOut="this.style.color='#353535'" style="color:#353535 ; text-
decoration:none;"><b>COURSES</b></a></li>
<li><a href="index.php?option=regs" onMouseOver="this.style.color='#FFFFFF'"
onMouseOut="this.style.color='#353535'" style="color:#353535 ; text-
decoration:none;"><b>REGISTRATION</b></a></li>
<li><a href="#" onMouseOver="this.style.color='#FFFFFF'"
onMouseOut="this.style.color='#353535'" style="color:#353535 ; text-
decoration:none;"><b>HOSTEL</b></a>
<ul style="width:100%">
<li style="width:100%"><a href="index.php?option=login"
onMouseOver="this.style.color='#FFFFFF'" onMouseOut="this.style.color='#353535'"
style="color:#353535 ; text-decoration:none;">Hostel Login</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</td>
</tr>
<tr>
<td width="974" height="647" bgcolor="#D9D9D9" style="vertical-align:text-top">
<?php
@$opt = $_GET['option'];
if($opt=="")
{
?>
<center>
<h2><b><font size="+3"><?php echo $colgdisp['colgname'];?>
</font></b></h2>
</center>
<center><img src="images/colg.jpg" width="696" height="488"></center>
<p><center>
<p> </p>
<p><strong><font size="+2"><?php echo $colgdisp['colgname'];?></font></strong> <b>-</b> <font
size="+1"><?php echo $introdisp['colgintro']; ?></font></p>
</center></p>
<?php
error_reporting(1);
}
else{
switch($opt)
{
case 'regs':
include('registration.php') ;
break;
case 'login':
include('login.php');
break;
case 'about':
include('about.php');
break;
case 'contact':
include('contact.php');
break;
case 'gallery':
include('gallery.php');
break;
case 'course':
include ('course.php');
break;
case 'cdrive':
include('cdrive.php');
break;
case 'news':
include('news.php');
break;
case 'sports':
include('sports.php');
break;
case 'admission':
include ('admission.php');
break;
case 'sdp':
include('sdp.php');
break;
case 'wevents':
include('wevents.php');
break;
case 'notice':
include('notice.php');
break;
}}
?>
</td>
<td width="343" style="background-color:#468EFF">
<center><font size="+2"><b style="color:#191B7E"><div style="background-
color:#969BFB">College Updates</div><br></b></font></center>
<marquee direction="up" height="100%" onMouseOver="this.stop();"
onMouseOut="this.start();">
<center><a href="index.php?option=cdrive" style="text-decoration:none"><font
size="+1"><b>Campus Drive</b></font></a></center><br>
<center><a href="index.php?option=news" style="text-decoration:none"><font
size="+1"><b>News</b></font></a></center><br>
<center><a href="index.php?option=sports" style="text-decoration:none"><font
size="+1"><b>Sports Fest</b></font></a></center><br>
<!--<center><a href="" style="text-decoration:none"><font size="+1"><b>Quiz
Competition</b></font></a></center><br>-->
<center><a href="index.php?option=admission" style="text-decoration:none"><font
size="+1"><b>Admission 2014</b></font></a></center><br>
<center><a href="index.php?option=sdp" style="text-decoration:none"><font
size="+1"><b>Student Development Programme</b></font></a></center><br>
<center><a href="index.php?option=wevents" style="text-decoration:none"><font
size="+1"><b>Weekend Events</b></font></a></center><br>
<center><a href="index.php?option=notice" style="text-decoration:none"><font
size="+1"><b>Notice Board</b></font></a></center><br>
<!--<center><a href="" style="text-decoration:none"><font size="+1"><b>Summer
Vacation</b></font></a></center><br>-->
<!--<center><a href="index.php?option=course" style="text-decoration:none"><font
size="+1"><b>Courses Offered</b></font></a></center><br>
<center><a href="index.php?option=gallery" style="text-decoration:none"><font
size="+1"><b>Gallery</b></font></a></center><br>-->
</marquee>
</td>
</tr>
<tr>
<td height="25" colspan="2" style="background-color:#B8AFFF"><center><b>© <?php echo
$footerdisp['footerinfo']; ?></b></center>
<div align="right"><a href="#facebook"><img src="images/f.png" width="30" height="30"
alt=""/></a><a href="#twitter"><img src="images/t.png" width="30" height="30" alt=""/></a><a
href="#youtube"><img src="images/y.png" width="30" height="30" alt=""/></a></div></td>
</tr>
</tbody>
</table>
</html>
session.php
<?php
include("includes/functions.php");
session_start();
logged_in())
{ redirect_to("index.php
");
function logged_in(){
return isset($_SESSION['user_id']);
?>
functions.php
<?php
$mainPage=false;
$magic_quotes_active = get_magic_quotes_gpc();
return $value;
27 | P a g e
if ($location != NULL)
{ header("Location:
{$location}"); exit;
function confirm_query($result_set) {
if (!$result_set) {
}}?>
applyRoom.php
<?php
require_once("includes/session.php");
confirmLogIn();
include("includes/header.php");
include("includes/connectDb.php");
if(isset($_POST['submit']))
{ extract($_POST);
'{$pRoom}','{$sem}','{$year}','NOT ASSIGNED')";
$result=mysql_query($query,$connection);
confirm_query($result);
mysql_close($connection);
28 | P a g e
echo "<tr><td>{$pRoom}</td><td>{$sem}</td><td>{$year}</td><td>NOT
ASSIGNED</td></tr></table>";
?>
name="pRoom"> <option>------</option>
<option>Single</option>
<option>Double</option>
</select>
<label>Semester</label><select name="sem">
<option>------</option>
<option>Spring</option>
<option>Fall</option>
<option>Summer</option>
</select>
<label>Year</label><select name="year">
<option>------</option>
<option>2013</option>
<option>2014</option>
</form>
<?php include("includes/footer.php");?>
processRooms.php
<?php
include("includes/session.php");
29 | P a g e
include("includes/connectDb.php");
$counter=0;
$names=array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
if(isset($_POST['confirmRooms'])){
// extract($_POST);
/ echo $_POST['app'];
{ if(preg_match("[^APP]",$key) )
$counter++;
$count=$counter;
$counter=1;
{ if(preg_match("[^rID]",$key) )
{ if($value==''){
$query.="=0";
else{
$query.="={$value}";
$result=mysql_query($query,$connection);
30 | P a g e
confirm_query($result);
$counter++;
redirect_to("viewApplicants.php");
processProfile.php
<?php
include("includes/session.php");
require_once("includes/connectDb.php");
$target=NULL;
if(isset($_FILES['fUpload'])){ if($_FILES['fUpload']['type']=='image/png'||
$_FILES['fUpload']['type']=='image/jpeg'){
$source=$_FILES['fUpload']['tmp_name'];
$target="images/profile/".basename($_FILES['fUpload']['name']);
$targetName=basename($_FILES['fUpload']['name']);
if(move_uploaded_file($source, $target)){
saveOtherDetails($targetName,$connection);
else{
if($_FILES['fUpload']['error']==UPLOAD_ERR_NO_FILE){
saveOtherDetails($targetName);
//$size=getImageSize($target);
31 | P a g e
// $imgstr.="src=\"$target\" alt=\"uploaded image\" />";
else{
redirect_to("profile.php");
echo $_FILES['fUpload']['error']."<br
function saveOtherDetails($targetName,$connection)
{ extract($_POST);
$targetName=mysql_prep($targetName);
$fname=mysql_prep($fname);
$lname=mysql_prep($lname);
$gender=mysql_prep($gender);
$pnumber=mysql_prep($pnumber);
$pOfRes=mysql_prep($pOfRes);
$address=mysql_prep($address);
phoneNumber = '{$pnumber}',
confirm_query($result);
redirect_to("profile.php");}?>
profile.php
<?php
require_once("includes/session.php");
32 | P a g e
confirmLogIn();
require_once("includes/connectDb.php");
include_once("includes/functions.php");
include("includes/header.php");
$user_id=$_SESSION['user_id'];
confirm_query($result);
if(mysql_num_rows($result)==1){
$found_student=mysql_fetch_array($result);
}
?>
<?php
$html.="<label>Gender</label>";
$html.="<select name='gender'>";
if($found_student['gender']=='Male')
$html.="<option selected='selected'>Male</option>";
$html.="<option>Female</option>";
}
33 | P a g e
else if($found_student['gender']=='Female')
{ $html.="<option
selected='selected'>Female</option>";
$html.="<option>Male</option>";
else
{ $html.="<option>Male</option>";
$html.="<option>Female</option>";
$html.="</select><br />";
$html.="</form>";
if(isset($_POST['submit']))
{ echo $html;
if(!isset($_POST['submit']))
{ if($found_student['personalImage']==NULL)
else if($found_student['personalImage']!=NULL){
$html.="<table class='profile'>";
$html.="<tr><td><strong>First
Name</strong></td><td><span>{$found_student['fName']}</span></td></tr>";
34 | P a g e
$html.="<tr><td><strong>Last Name
</strong></td><td><span>{$found_student['lName']}</span></td></tr>";
$html.="<tr><td><strong>Address</strong>
</td><td><span>{$found_student['address']}</span></td></tr>";
$html.="<tr><td><strong>Gender</strong>
</td><td><span>{$found_student['gender']}</span></td></tr>";
$html.="<tr><td><strong>Place of
Residence</strong></td><td><span>{$found_student['placeOfResidence']}</span></td></tr>";
$html.="<tr><td><strong>Phone
Number</strong></td><td><span>{$found_student['phoneNumber']}</span></td></tr>";
$html.="</form>";
$html.="</table>";
echo $html;
?>
</div>
<?php include("includes/footer.php");
?>
Backend.php:-
<?php
session_start();
error_reporting(1);
if($_SESSION['admin']=="")
{
header('location:admin.php');
}
else
{
//logout
if(isset($_POST['logout']))
{
header('location:adminlogout.php');
}
$con = mysql_connect("localhost","root","","full");
mysql_select_db("full",$con);
//header marquee
if(isset($_POST['m1save']))
{
$marquee = $_POST['marquee1'];
$query = "UPDATE admin SET marquee1='$marquee' WHERE id=1";
mysql_query($query);
$confirm ="<b style='color:red'>Page Saved</b>";
}
//colg name
if(isset($_POST['cnsave']))
{
$cname = $_POST['colgname'];
$query2 = "UPDATE admin SET colgname='$cname' WHERE id=1";
mysql_query($query2);
$confirm2 = "<b style='color:red'>Page Saved</b>";
}
//colg intro
if(isset($_POST['intsave']))
{
$intro = $_POST['colgintro'];
$query3 = "UPDATE admin SET colgintro='$intro' WHERE id=1";
mysql_query($query3);
$confirm3 = "<b style='color:red'>Page Saved</b>";
}
//footer info
if(isset($_POST['footersave']))
{
$footer = $_POST['footerinfo'];
$query4 = "UPDATE admin SET footerinfo='$footer' WHERE id=1";
mysql_query($query4);
$confirm4 = "<b style='color:red'>Page Saved</b>";
}
//about page
if(isset($_POST['aboutsave']))
{
$abouthead = $_POST['abouthead'];
$aboutinfo = $_POST['aboutinfo'];
$query5 = "UPDATE admin SET abouthead='$abouthead' WHERE id=1";
$query6 = "UPDATE admin SET aboutinfo='$aboutinfo' WHERE id=1";
mysql_query($query5);
mysql_query($query6);
$confirm5 = "<b style='color:red'>Page Saved</b>";
}
?>
<div align="center">
<form method="post">
<table width="1328" height="628" border="1">
<tbody>
<tr>
<td colspan="6" bgcolor="#5D5CEC"><center><font size="+2"><strong style="color:
#FFFFFF">Administrator Control Panel</strong></font></center><div align="right"><input
type="submit" value="Logout" name="logout"></div></td>
</tr>
<tr>
<td width="323" height="543">
<center><p><b>[ Content of Header Marquee ]</b>
<textarea placeholder="Input Marquee for the header of the Page!"
name="marquee1"></textarea><br>
<input type="submit" value="Save" name="m1save"><br><?php echo $confirm; ?>
</p></center><br>
<p><center><b>Change College Name : </b><br>
<input type="text" placeholder="College Name" name="colgname" size="50"><input
type="submit" value="Save" name="cnsave"><br><?php echo $confirm2; ?
></center></p><br>
<center><p><b>Change College Intoduction</b><br>
<textarea placeholder="Input Introduction for College" name="colgintro"></textarea><br>
<input type="submit" value="Save" name="intsave"><br><?php echo $confirm3; ?
></p></center><br>
<center><p><b>Change Footer</b><br>
<input type="text" placeholder="copyright information etc," name="footerinfo"
size="50"><br>
<input type="submit" value="Save" name="footersave"><br><?php echo $confirm4; ?
></p></center>
</td>
<td width="475">
<p><center><b>Edit "About" Page</b><br><br>
Page Heading : <input type="text" placeholder="heading" name="abouthead"
size="30"><br><br>
[ Page Content ]<br>
<textarea placeholder="Input Content" name="aboutinfo"></textarea><br>
<input type="submit" value="Save" name="aboutsave"><br><?php echo $confirm5; ?
></p></center>
</td>
<td width="40"> </td>
<td width="57"> </td>
<td width="60"> </td>
<td width="333"> </td>
</tr>
</tbody>
</table>
</form>
</div>
<?php
}
?>
Appendix E: Database Connection
<?php
$connection=mysql_connect("localhost","root","");
if(!$connection){
$db_select=mysql_select_db("hms",$connection);
if(!$db_select){
".mysql_error()); }?>
Registration.php:--
<?php
error_reporting(1);
//mysql Connection
$con =
mysql_connect("localhost","root","","full") or
die(mysql_error());
//select database
mysql_select_db("full",$con);
//captcha
$num1 = range(9,0);
$num2 = range(9,0);
$rnum1 = array_rand($num1);
$rnum2 = array_rand($num2);
$n1 = $num1[$rnum1];
$n2 = $num2[$rnum2];
if(isset($_POST['submit']))
if($_POST['c1']==$_POST['c2'])
$n = $_POST['uname'];
$pass = $_POST['upass'];
$p = md5($pass);//encrypt pass
$em = $_POST['umail'];
$gen = $_POST['gender'];
$mob = $_POST['umob'];
$add = $_POST['address'];
//$img = $_FILES['file']['name'];
mob='$mob'";
$cq = mysql_query($q);
$ret = mysql_num_rows($cq);
if($ret == true)
echo "<center><h2
already exists</h2></center>";
else
{
$query = "INSERT INTO users
VALUES
('','$n','$p','$em','$gen','$mob','$add')";
mysql_query($query);
//mkdir("images/".$_POST['umail']);
//move_uploaded_file($_FILES['file']
['tmp_name'],"images/".$_POST['umail']."/".
$_FILES['file']['name']);
echo "<center><h2
style='color:green'>Details Saved!
</h2></center>";
else
echo '<script>alert("Wrong
//display details
if(isset($_POST['display']))
users");
bgcolor='#B2B8FF' width='500px'>";
echo "<tr><th>User
ID</th><th>UserName</th><th>Password<b
r>(Encrypted)</th><th>Email</th><th>Gend
er</th><th>Mobile
No.</th><th>Image</th><th>Option</th></tr
>";
while($row=
mysql_fetch_array($que))
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "<td>".
$row['username']."</td>";
echo "<td>".
$row['password']."</td>";
echo "<td>".$row['email']."</td>";
echo "<td>".$row['gender']."</td>";
echo "<td>".$row['mob']."</td>";
$e=$row['email'];
$img=$row['image'];
width='70' height='70'/></td>";
echo "<td><a
href='edit.php'>Edit</a>
<a href='delete.php?
email=$e'>Delete</a>
</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
?>
<html>
<head>
<script>
function go()
document.location='./login.php';
function refresh()
document.location='./index.php';
</script>
</head>
<body style="background-color:#E5E5E5">
<div align="center">
<form method="post"
enctype="multipart/form-data">
background-color: #D8D8D8;">
<legend><font
size="+2"><strong>Registration</strong></fo
nt></legend>
<p><b>UserName : </b><input
<p><b>Password : </b><input
type="password" name="upass"
required/>*</p>
name="umail" required/>*</p>
name="gender"
value="m">Male <input type="radio"
name="gender" value="f">Female</p>
<b>Address : </b><textarea
placeholder="Input Address"
name="address"></textarea>
background-color:
#D8D8D8;"><legend><strong>Verification</
strong></legend><p><?php
error_reporting(1);
?>
placeholder="Enter
Sum">*</p></fieldset><br>
value="Register"> <input type="reset"
onClick="refresh()"></p>
</form>
</div>
</body>
</html>
Profile.php:--
<?php
session_start();
error_reporting(1);
if($_SESSION['user']=="")
header('location:index.php');
//mysql Connection
$con =
mysql_connect("localhost","root","","full") or
die(mysql_error());
//select database
mysql_select_db("full",$con);
?>
<html>
<head>
href="engine/css/slideshow.css"
media="screen" />
<style type="text/css">.slideshow
a#vlb{display:none}</style>
<script type="text/javascript"
src="engine/js/mootools.js"></script>
<script type="text/javascript"
src="engine/js/visualslideshow.js"></script>
href="engine1/style.css" />
<script type="text/javascript"
src="engine1/jquery.js"></script>
#horizontalmenu ul
#horizontalmenu li
float:left;
position:relative;
padding-right:89;
display:block;
border-style:inset;
margin-left:20px;
}
#horizontalmenu li ul
display:none;
position:absolute;
display:block;
background:#C4C4C4;
height:auto; width:8em;
#horizontalmenu li ul li
clear:both;
border-style:none;}
</style>
</head>
border="1">
<tbody>
<tr>
style="background-color:#4E4E4E"><div
style="text-
align:left;color:#FFFFFF"><b><font
decoration:none ; color:#FFFFFF">ABC
Group Of
Institutions</a></font></b><marquee
direction="left" height="100%">
This Message will be
</marquee></div></th>
</tr>
<tr>
<!--Slider-->
<div id="wowslider-container1">
<div class="ws_images"><ul>
<li><img src="data1/images/banner_01.jpg"
id="wows1_0"/></li>
<li><img
src="data1/images/highlightnews.jpg"
alt="International Accredition"
title="International Accredition"
id="wows1_1"/></li>
<li><img src="data1/images/img21644.jpg"
<li><img src="data1/images/url.jpg"
</ul></div>
<div class="ws_bullets"><div>
Campus"><img
src="data1/tooltips/banner_01.jpg"
Accredition"><img
src="data1/tooltips/highlightnews.jpg"
alt="International Accredition"/>2</a>
Employement"><img
src="data1/tooltips/img21644.jpg" alt="Best
Overall Employement"/>3</a>
Infrastructure"><img
Infrastructure"/>4</a>
</div></div>
<span class="wsl"></span>
</div>
<script type="text/javascript"
src="engine1/wowslider.js"></script>
<script type="text/javascript"
src="engine1/script.js"></script>
<!--slider end-->
</th>
</tr>
<tr>
style="background-color:#6E68FF">
<div align="center"><a
href="index.php" style="text-
decoration:none ; color:#010101"
id="horizontalmenu
li"><b> &
nbsp; HOME</b></a>
<a href="profile.php?option=about"
style="text-decoration:none ;
color:#010101"><b> &n
bsp; ABO
UT</b></a>
<a href="profile.php?option=mfees"
style="text-decoration:none ;
color:#010101"><b> &n
bsp; MES
S FEES</b></a>
<a href="profile.php?option=rfees"
style="text-decoration:none ;
color:#010101"><b> &n
bsp; ROO
M FEES</b></a>
style="text-decoration:none"><input
type="submit" value="Logout"
name="logout"></a></div></td>
</tr>
<tr>
bgcolor="#D9D9D9" style="vertical-
align:text-top">
<?php
@$opt = $_GET['option'];
if($opt=="")
{
?>
<html>
$_SESSION['user']; ?></center></h1>
</html>
<?php
error_reporting(1);
else{
switch($opt)
case 'regs':
include('registration.php')
break;
case 'login':
include('login.php');
break;
case 'about':
include('about.php');
break;
case 'contact':
include('contact.php');
break;
case 'gallery':
include('gallery.php');
break;
case 'course':
include ('course.php');
break;
case 'mfees':
include('mfees.php');
break;
case 'rfees':
include('rfees.php');
break;
}}
?>
</td>
color:#468EFF">
<center><font size="+2"><b
style="color:#191B7E"><div
style="background-color:#969BFB">College
Updates</div><br></b></font></center>
<marquee direction="up"
height="100%" onMouseOver="this.stop();"
onMouseOut="this.start();">
<center><a href=""
style="text-decoration:none"><font
size="+1"><b>Campus
Drive</b></font></a></center><br>
decoration:none"><font
size="+1"><b>News</b></font></a></center
><br>
decoration:none"><font size="+1"><b>Sports
Fest</b></font></a></center><br>
decoration:none"><font size="+1"><b>Quiz
Competition</b></font></a></center><br>
decoration:none"><font
size="+1"><b>Admission
2014</b></font></a></center><br>
decoration:none"><font
size="+1"><b>Placement
List</b></font></a></center><br>
decoration:none"><font
size="+1"><b>Weekend
Events</b></font></a></center><br>
decoration:none"><font size="+1"><b>Notice
Board</b></font></a></center><br>
decoration:none"><font
size="+1"><b>Summer
Vacation</b></font></a></center><br>
decoration:none"><font
size="+1"><b>Summer
Training</b></font></a></center><br>
<center><a href="index.php?
option=course" style="text-
decoration:none"><font
size="+1"><b>Courses
Offered</b></font></a></center><br>
<center><a href="index.php?
option=gallery" style="text-
decoration:none"><font
size="+1"><b>Gallery</b></font></a></cent
er><br>
</marquee>
</td>
</tr>
<tr>
style="background-
color:#B8AFFF"><center><b>© 2014
by UserName | Managed by
ABC</b></center></td>
</tr>
</tbody>
</table>
</html>