Download as pdf or txt
Download as pdf or txt
You are on page 1of 82

DECLARATION

I declare that this project was written by me and that it has not been presented before, for the
award of a degree and that all references are duly acknowledged.

Muhammad Khatim Yusuf __________________ ________________


Name of student Signature Date

ii
CERTIFICATION
This is to certify that this project work titled “DESIGN AND IMPLEMENTATION

OF HOSTEL ALLOCATION SYSTEM” meets the standard of writing undergraduate

project report for Bachelor of Science in Computer Science of Kano University

of Science and Technology, Wudil.

Dr. Salisu Mamman Abdurrahman ________________ ________________


Supervisor Signature Date

Kamaluddeen Yarima _________________ __________________


Project Coordinator Signature Date

Prof. Saleh El-Yakub Abdullahi _________________ __________________


External Examiner Signature Date

Dr. Salisu Mamman Abdurrahman __________________ _________________


Head of Department Signature Date

iii
DEDICATION
I dedicate this project work to Almighty Allah (S.W.A) for his protection,

guidance, provision and sufficient grace. I also dedicate this to all those who

contributed to my little success in life, especially my beloved parents.

iv
ACKNOWLEDGEMENT
Special thanks to almighty Allah for making it possible for me to write this project

successfully. My special and endless gratitude goes to my beloved parents who always stand

for me in all ways, to ensure that I succeed in my academic carrier.

I will also like to acknowledge the help of my brothers and sisters whose gratitude remained

firmly towards my current and future carrier.

Special thanks to the hardworking lecturers in the Department who work tirelessly to ensure

that they produce the best students in the university, most especially my level coordinator and

my H.O.D., without them, I would be nowhere near where I am today.

Finally, I will also like to acknowledge the help of my dear colleagues, together we started

this, with the help of one another we survived all the hardships and difficulties, these

memories remain unforgettable.

v
ABSTRACT
Managing the student accommodation application and allocation processes in most Nigerian

tertiary institutions is a complex and time-consuming task if done manually. This project

work deals with the problems of allocating hostels to student in Kano University of Science

and Technology Wudil and to avoid the problems which occur when carried out manually.

The aim of this project work is to produce a system that will automatically allocate rooms to

students in a fair way, even if demand exceeds supply. We have conducted requirements

gathering of our new proposed system by conducting interviews to the students, hostel

managers as well as observing how the manual allocation system works in order to design our

new proposed system. The objective of such system is to facilitate the process of hostel

application and allocation process by developing a web based hostel allocation system.

vi
TABLE OF CONTENTS
DECLARATION......................................................................................................................ii

CERTIFICATION ................................................................................................................. iii

DEDICATION......................................................................................................................... iv

ACKNOWLEDGEMENT ....................................................................................................... v

ABSTRACT ............................................................................................................................. vi

TABLE OF CONTENTS ......................................................................................................vii

LIST OF FIGURES ................................................................................................................ ix

LIST OF TABLES ................................................................................................................... x

CHAPTER ONE (INTRODUCTION)................................................................................... 1

1.0 Introduction ................................................................................................................. 1

1.2 Statement of the Problem ............................................................................................ 2

1.3 Aims and Objectives .................................................................................................. 2

1.6 Project Organization .................................................................................................... 4

CHAPTER TWO (LITERATURE REVIEW) ..................................................................... 5

2.0 Introduction ................................................................................................................. 5

2.1 Empirical Review (Review of Related Works) ........................................................... 5

2.2 Conceptual Review ..................................................................................................... 7

CHAPTER THREE (SYSTEM ANALYSIS AND DESIGN) ............................................ 10

3.0 Introduction ............................................................................................................... 10

3.1 Methodology ............................................................................................................. 10

3.2 Requirements Gathering and Analysis ...................................................................... 10

3.3 System Analysis ........................................................................................................ 11

3.3.1 Proposed System ................................................................................................ 12

3.3.2 Functional Requirements ................................................................................... 12

3.3.3 Non-functional Requirements ............................................................................ 13

3.3.7 Feasibility Analysis ............................................................................................ 15

vii
3.3.9 Purpose of the System ....................................................................................... 16

3.4 System Design ........................................................................................................... 16

3.5 Analysis Model ......................................................................................................... 17

3.5.1 Use Cases of the Proposed System .................................................................... 17

3.5.2 Class Diagram of the Proposed System ............................................................. 18

3.5.3 Sequence Diagram ............................................................................................. 19

3.5.4 Program Structure Chart .................................................................................... 20

3.6 Database Design ........................................................................................................ 21

3.6.1 The Entity Relationship Model .......................................................................... 21

3.6.2 Entity Relationship Diagram.............................................................................. 22

3.7 System Requirement ................................................................................................. 23

CHAPTER FOUR (TESTING AND IMPLEMENTATION) ........................................... 26

4.1 Introduction ............................................................................................................... 26

4.2 System Implementation ............................................................................................. 26

4.3 Implementation of GUI ............................................................................................. 27

4.4 Testing ....................................................................................................................... 33

CHAPTER FIVE (SUMMARY, CONCLUSION AND RECOMMENDATION) .......... 39

5.1 Summary ................................................................................................................... 39

5.2 Conclusion................................................................................................................. 39

5.3 Recommendations ..................................................................................................... 40

REFERENCES ....................................................................................................................... 41

APPENDIX A ......................................................................................................................... 44

SOURCE CODE .................................................................................................................. 44

APPENDIX B ......................................................................................................................... 68

DATABASE......................................................................................................................... 68

APPENDIX C ......................................................................................................................... 73

ABBREVIATIONS .............................................................................................................. 73

viii
LIST OF FIGURES
Figure 3.1: The Component Phase of System Analysis ........................................................... 12
Figure 3.2: System Design ....................................................................................................... 17
Figure 3.3: Use-case of the Proposed System .......................................................................... 18
Figure 3.4: Class Diagram of the proposed system ................................................................. 19
Figure 3.5: Admin Sequence Diagram..................................................................................... 19
Figure 3.6: Student Sequence Diagram ................................................................................... 20
Figure 3.7: Program Structure Chart of the Proposed System ................................................. 21
Figure 3.8: Entity Relationship Diagram ................................................................................. 22

ix
LIST OF TABLES
Table 3.1: Hardware Requirements ...…………………………………………....………….23
Table 3.2: Software Requirements.……………………………………………….....……....24
Table 4.1: Admin Login Test Case ………………………………………………………....33
Table 4.2: Add Hall Test Case………………………………………………………………34
Table 4.3: User Make Payment ……………………………………………………………..35
Table 4.4: User Registration………………………………………………………………....36

x
CHAPTER ONE
INTRODUCION

1.0 Introduction

Universities are considered the main provider of knowledge in various fields.

Different universities are located in different place. Students from different parts of the

country come to study in Kano University of Science and Technology, Wudil in search of

knowledge, hence there must be the need for accommodation. Management of hostel

activities involves receipt of application and payment from students, room allocation, record

keeping etc. Automatic hostel allocation system involves the use of the World-Wide Web, the

Internet and computers to aid this process.

With traditional hostel allocation system, lots of problems occur which includes

students paying for accommodation and not getting one, also due to large number of

occupants, the management cannot provide the accurate details of occupancy in a particular

hall. Since the traditional hostel registration system makes use of tedious administrative tasks,

lots paper work and time, the goal of the hostel allocation system is to provide a

computerized process that is stress free, reliable, quick and easy to both the students and the

staff in charge of the registration and hostel allocation processes.

As the educational world is moving faster and becoming more competitive, almost

every university started to use an automated hostel allocation system, or newer technologies

to facilitate their task, to have more time, and to be in pace with this fast moving IT world.

Thus, a hostel allocation system will be able to cater for a wide range of requirements either

for students or hostel staff in the university.

1
1.1 Background of the Study

Hostel accommodation is a popular option for students who are moving from a regional area,
interstate or overseas to study. They often provide a good short-term option until something
more permanent can be arranged.

Hostels generally provide a furnished bedroom with access to a shared bathroom and kitchen,
laundry, lounge area and recreation facilities (such as pool tables and arcade game machines).
You may find that meals are provided, although this is not always the case. There is
sometimes the option to stay in dorm-style or twin-share rooms, and short-term rental options
are generally available.

1.2 Statement of the Problem

The growing number of students in KUST Wudil has posed a lot of accommodation problem
on the part of students and school management. Students at the beginning of each session
waste half of the semester looking for accommodation. The few hostels that exist in the
university are not properly managed. Statistics of the number of rooms required to match the
growing number of students are far-fetched. Most often, students pay for hostel fee and end
up not getting one due to lack of bed space. Hostel administrators cannot give accurate
information of the occupancy of a particular room. These and many more form the statement
of the problem that necessitated this project work.

1.3 Aims and Objectives

The main aim of this project is to design and implement an online hostel allocation system.
The specific objectives of the study are:

1) To design and develop a central database system that would serve as hostel
database, which will contain information on all the rooms, halls, and occupants of
the hostels.

2
2) To design a web-based hostel allocation system, which enables students to apply
and get allocated to hostel rooms automatically.
3) To design a system that enable students to pay for accommodation online.

1.4 Significance of the Study


The new system designed for web-based student’s hostel allocation will among other things:

1. Facilitate timely and automatic allocation of hostel rooms to students.


2. Check the hostel occupancy at any time for information management.
3. Enable management to plan on improving hostel living condition.
4. Have first-hand information on the statistics of students in the hostel.

1.5 Scope and Limitation


This project is limited to a development of a web-based hostel allocation system. Our
proposed system provides the following functionalities:
1. Validation of student identity.
2. Student application for accommodation.
3. Automatic room allocation.
4. Hostel rooms and halls management.
5. Online payment for accommodation.

Some functionalities and features supposed to be in Hostel Allocation System software are
not covered in this project work, among the limitations are:
1. Room Reservation for students
2. Change allocation by Admin
The project work will be carried out using KANO UNIVERSITY OF SCIENCE AND
TECHNOLOGY, WUDIL hostels as case study.

1.6 Methodology

Selecting the relevant Software development life cycle (SDLC) is important for the
success of any software project. The software development models are the
methodologies that are being selected for the development of a software project. In this

3
project, agile approach of developing software is used as the research methodology. Agile is a
structured and iterative approach to project management and product development. Agile
allows creating a project incrementally, dividing it into small pieces. One of its main benefits
is the ability to adapt and change at any step and to supply only relevant products to the
market. Detailed of the methodology is discussed in chapter three of this project report.

1.6 Project Organization

This project report is organized as follows:

In Chapter 2, we give an overview of the related work on automated hostel allocation system.
In Chapter 3, we present the methodology used for developing our proposed system. Chapter
4 discusses system implementation and testing. Chapter 5 concludes the project report and
present our recommendation on how to improve the system in future.

4
CHAPTER TWO
LITERATURE REVIEW

2.0 Introduction

This chapter covers the related work in the area of automated hostel allocation system. We
start by discussing the empirical review (which is usually described as the critical review of
the existing academic works/literatures on this project topic) of different systems developed
previously to address the problem outlined in Chapter 1 of this project report. We then give a
conceptual review (which captures all the explanations on the concepts that are associated
with the research topic in logical order).

2.1 Empirical Review (Review of Related Works)

2.1.1 Student Residence Management System

Iraba Marie Louise (2009), developed the Student Residence Management System to
facilitate application for accommodation online and to help the staff to manage the different
residence activities such as controlling booking, payments and room allocation. The Student
Residence Management System was able to notify and confirm all room allocations. Room
allocation confirmations were sent by email to students who were given accommodation. The
web-based system was able to address problems encountered by users within the current
residence administration system. The proposed system found optimal matching for user
requirements, and management of residences. System implementation was carried out using
PHP, MySQL, PHPMyAdmin and Apache, which are the open source applications.

2.1.2 College Student Allocation System


Asmahani Binti MohdZin (2007), developed the College Student Allocation System. Here are
the traditional methods in use; firstly, students must get the college application forms from
the college officer. Next students must fill up the forms. The due date for application is fixed.
They must attach together their passport size photo, and their parents' monthly salary slips.
The HEP officer's faces difficulties to process the application forms. The process of key in
the data takes a longer tune. The objectives of this research was to identify all the
requirement specification of College Student Allocation System (CSAS), to model the design

5
of College Student Allocation System (CSAS) based on requirement specification and to
develop the prototype of the College Student Allocation System adopting web application
framework that is Mamboserver. This research project is about developing College Student
Allocation System using Wampserver and web application framework in UiTM. This
research is an improvement of the college student allocation system to make it more effective
in college management the design of College Student Allocation System (CSAS) based on
requirement specification. The limitation of this project is focusing on the colleges that are
situated nearby the faculties.

2.1.3 Online Hotel Reservation System


Anjorin Beatrice Omoleye (2005), developed Online Hotel Reservation System “case study
of Solton international hotel and resort”. The problem encountered in the existing system was
that thousands of guests file (registration) are processed manually. In a situation where a
guest registration file is missing and the officer in charge is making a sequential search
through the file to get information about the guest. The problem becomes complex if the
information is not in the specified location and this leads to searching through archives when
the necessary documents are available, it often takes a long time to get them into the required
format. The approach administered to curbing the problem of the existing system (manual
system) was to design a website for Solton international hotel and resort, so as to reduce the
cost of transportation by prospective guests in the existing system; to provide a
communication medium that can serve in any place including the bedroom and to ensure
accuracy. Help participants to understand technology’s current potential and impact on their
businesses. The system implementation was carried out using PHP, MySQL, and Apache
Server.

2.1.4 Online Hotel Reservation


Akanfe Adeyemi Abas (2005), developed an Online Hotel Reservation (case study of
Tamarin hotel), the problem in the previous system encountered involves the manual moving
of files, in this case, a large number of guests’ data or information can easily be handled. The
proposed system was developed so as to give useful, accurate, timely and well-formatted
information about guests. The system implementation was carried out using MySQL for the
database for the day-to-day activities of booking rooms, PHP, HTML and Apache server was
used as the web server. This would enable them to automate their entire business processes,

6
by allowing them to run their businesses dynamically or interactively and rapid decision
making.

2.1.5 Web-Based Classroom Allocation System


Peter Bougie, (2012), developed a web-based classroom allocation system. Often, a
manual process was used in the allocation of classrooms and keeping track of the classroom.
A better way to consistently and effectively allocate classrooms is to use a computer-assisted
system that will keep track of all classrooms on campus along with specific details about
those rooms that can automatically suggest efficient pairings with the courses offered for a
given semester. The efficiency was being judged based on many factors, most importantly
being that the size of each room is used effectively. The new system accommodates the most
important factors mentioned before. Other factors such as making sure that each course has a
room with the required resources for that class and that the rooms should conform to
departmental preferences are also considered. Meetings were held weekly with the
stakeholders to cover the current progress as well as introducing new requirements. Due to
the SOA of the system it made for easy segmentation of the system and an easy way to show
where progress has been made. The implementation was carried out using MySQL as a
backend, Amahi Server to run MySQL and the built in Glassfish web server that comes with
NetBeans which were ran on Windows 7 Professional system.

2.2 Conceptual Review

2.2.1 Hostel
An establishment which provides inexpensive food and lodging for a specific group of
people, such as students, workers, or travellers. Hostels provide lower priced sociable
accommodation where guests can rent a bed, usually a bunk bed, in a dormitory and share a
bathroom, lounge and sometimes a kitchen. Rooms can be mixed or single-sex, and private
rooms may also be available (Bowen, H. E., & Daniels, M. J. 2011).

7
2.2.1.1 Types of Hostel Rooms
According to Gavin Edwards (2010), there are two hostel room categories
1. Dorm Rooms
All hostels have Dorm rooms. They are rooms which you share with fellow students.
The average dorm room has four beds. Beds are usually single or bunks. There may
be lockers or safety deposit boxes where you can store your valuables in the room
also.
2. Private Rooms
These rooms are not shared with other students, they are similar to those found at
other types of accommodation (hotels, lodges), but they too have their variations.

2.2.1.2 Advantages for Living in Hostel


1. It offers you independence: You can sleep whenever you want to, you do not bath
for weeks and no one would scold you, literally you can do anything you wish.
2. You get to know new people from different parts of the world, this increases your
exposure to different cultures of the world and of states of your own country.
3. You start realising the harsh realities of this world, how some people backstab
others, how someone who always speaks bitterly to you is actually the one who
cares most about you.
4. Self-discipline improves immensely.
5. You make friends for life.

2.2.1.3 Disadvantages for Living in Hostel


1. Food of hostel mess sucks. You will miss your home cooked food.
2. Homesickness is also a disadvantage according to some.
3. You are independent. Being independent is as much a disadvantage as much it is an
advantage, because independence comes at a cost, you will have to clean your room
on your own, no one is going to help you with that, you will have to wash your
clothes by yourself, etc.

8
2.2.2 A System
According to Whitten, Bentley, and Dittman, (2004), a system is a group of interrelated
components working together towards a common goal by accepting input and producing
output in an organized transformation process. The basic three components of a system
include Input, processing and output.

2.2.3 Hostel Allocation System


The online hostel allocation system is a web based software to provide students automatic
accommodation to the university hostel more efficiently.

2.2.4 Database Management System (DBMS)


According to Jay G. and Brad B, (2001), DBMS is a program (or a group of programs) that
provide access to a database. The DBMS permits an organization to centralize data, manage
them efficiently and provide access to the stored data by application program.

2.2.5 PHP
According to Luke W. and Laura T, (2001), Hypertext Preprocessor (or simply PHP) is a
general-purpose programming language originally designed for web development. PHP
originally stood for Personal Home Page, but it now stands for the recursive initialism PHP:
Hypertext Preprocessor.

2.2.6 MySQL
("My S-Q-L") is an open-source relational database management system (RDBMS) (Luke W.
and Laura T, 2001). Its name is a combination of “My”, the name of co-founders Michael
Widenius's daughter, and "SQL", the abbreviation for Structured Query Language.

9
CHAPTER THREE
SYSTEM ANALYSIS AND DESIGN

3.0 Introduction

In this chapter, the basic methodology for the research project and the key element of the
system design methods are described. This chapter is primarily concern with the study of an
existing system with the intention of improving on it through better procedure and methods.
A detail description of the approach in the determination of system requirement, followed by
design techniques deployed, then techniques used to implement the proposed system will be
carried out.

3.1 Methodology

In this project, agile approach of developing software is used as the methodology. The main
purpose of using agile approach on this project is its flexibility as it encourages stakeholders
provides inputs at all stages. It also allows developers to work on core functionalities and
vital features. Hostel allocation system is a kind of complicated software with much
functionality to be used mostly by students. As a result, several functionalities need to be
implemented. This and other reasons make this approach the best for developing the system.

Agile is a structured and iterative approach to project management and product development.
Agile allows creating a project incrementally, dividing it into small pieces. One of its main
benefits is its flexibility and the ability to adapt and change at any step.

3.2 Requirements Gathering and Analysis

All possible requirement of the system to be developed are captured in this phase and
documented in a requirement specification document.

10
3.2.1 System Design:

The requirement specifications from the first phase are studied in this phase and the system
design is prepared. This system design is helps in specifying hardware and system
requirement and helps in defining the overall system architecture.

3.2.2 Implementation:

With inputs from the system design, the system is first developed in small programs called
unit; which are integrated in the next phase. Each unit is developed and tested for its
functionality, which is referred to as Unit Testing.

3.2.3 Integration and Testing:

All the units developed in the implementation phase are integrated into a system after testing
of each unit. Post integration; the entire system is tested for any faults and failures.

3.2.4 Maintenance:

There are some issues which come up in the client environment. To fix those issues, patches
are released. Also to enhance the product some better versions are released. Maintenance is
done to deliver these changes in the customer environment.

3.3 System Analysis

This is the process of studying a current situation with the intention of improving of through
better procedure and methods. It may involve breaking the system into smaller group and also
identifying the problems area. System analysis has become a very demanding field in recent
years. It directly deals with the organizations system of modernization. To develop a new
system, it is very important to have a clear idea about the existing system (Saleh, 2012).
System analysis can be categorized into four parts.

i. System planning and initial investigation


ii. Information Gathering
iii. Applying analysis tools for structured analysis
iv. Feasibility study
v. Cost/ Benefit analysis.

11
The analysis of the proposed system for the Hostel Allocation System will be the main focus
of attention in this section. This system phase itself consist of component phase.

Figure 3.1: The Component Phase of System Analysis

3.3.1 Proposed System


The proposed system will eliminate the major problem of the manual allocation system,
which results in students paying for accommodation and not getting rooms at last.

This system will allow students to conveniently get accommodation in the university without
having to face difficulties like queues in the banks, during form submission as well as when
searching for their names after allocation list has been pasted in the notice board.

The proposed system as well makes it easy for the porter to know exactly which student is in
which room without having to follow and search it manually on paper sheet by sheet.

3.3.2 Functional Requirements


The functional requirements of the system are:

1. The porter of the hostel can Create halls (hostel blocks) and set the maximum number
of rooms each hall can have.

12
2. The porter of the hostel can Create room types, set price for each room type and set
the maximum number of students each room can accommodate.
3. The porter of the hostel can add, edit and delete a room or hall when necessary.
4. The system can verify registration number of each student, with the university
students’ database before allowing any student to make use of it.
5. A student, after verification, can edit their profile and as well change their password.
6. A verified student can Apply for a room and make online payment.
7. A student can print a copy of their allocation invoice after successful payment,
containing their profile and the allocation details as well.
8. After successful payment, a student can view the list of their roommates (if any) and
can also print it as well.

3.3.3 Non-functional Requirements


1. Safety, the system must have the ability to prevent illegal or incorrect
operations from porters or students by using certain tools such as validation
control.
2. Understandability, which makes it easy for students to use and deal with.
3. User friendly, by developing good interface and data accessibility, must be easy.
4. Secure and private, to prevent unauthorized access to the system.
5. The system developed for the purpose of supporting integration between
existing and future systems.
6. Performance, the system must be fast.
7.

3.3.4 Preliminary Investigation

The process of hostel allocation in KUST Wudil is done manually. It usually involves a
student going to the students’ affairs division to purchase a registration form. Upon filling
such form, the student proceeds to any branch of zenith bank to pay the accommodation fee,
and then returns to the students’ affairs division and submit the filled form and the bank teller
to the porter’s office. The porter on his part gathers all the submitted forms and then makes a
random list of students and divides the list according to rooms available. Once that manual
list is completed, then it is printed and pasted on the students’ affairs notice board. Finally,
students come and check the list against their names or registration number. Once a student

13
sees their name, they check the room number allocated to them and snap it with a phone for
evidence. This is the usual process followed every year.

This process has lots of problems such as difficulties in managing the hostel records, lots of
paper work, difficult way of making payment, lack of good evidence of showing room
membership etc. Therefore, there is need for a proposed solution to the current method.

3.3.5 Requirement Analysis

Requirement analysis can be said to identify investigation, documenting and analyzing


requirements of the system. The first investigation step of the need of a system, is a major
activity of problem analysis. Requirement analysis is one of the major parts of system
analysis. Requirement analysis is the most difficult part of software development. In any
system development, perfect requirement analysis must be carried out to ensure a good and
reliable system, as any error occurred in this stage, may result in total failure of the whole
project. This project analyzed each and every aspect of the requirement phase and concluded
that a system is needed where allocation process should be made online and automatically.
This can be achieved by building a web based application which can be used to handle
registration, application, payment, automatic allocation and providing a better evidence of
membership in an easiest and user friendly environment.

3.3.6 Fact Finding

Fact finding is process of collection of data and information based on techniques which
contain sampling of existing documents, research, observation, questionnaires, interviews,
prototyping and joint requirements planning. Fact-finding techniques are used in the early
stage of System Development Life Cycle including system analysis phase, design and post
implementation review. By studying the Requirements, we can easily find out how the
system works and in which field it need to develop the process model of the new system.
During preliminary investigation and requirement analysis, the various features of automatic
allocation systems (such as hotel reservation and room allocation websites) are observed and
embedded in this project.

14
3.3.7 Feasibility Analysis
Systems analysis involves a feasibility study to determine whether that solution is feasible, or
achievable, given the organization’s resources and constraints. There are following
dimensions of the feasibility. Two major areas of feasibility are addressed in this project:

a. Technical Feasibility: Technical feasibility means the proposed solution can be


implemented with the available hardware, software and technical resource. The existing
resources are: System software which are XAMPP (Cross-Platform(X) apache(A) MySQL(M)
PHP(P) and perl(P)) Server and any Web Browser. Therefore, the system is said to be
technically feasible because the solution of the problem can be easily implemented in the
present hardware and software environment.

b. Operational Feasibility: The web based Hostel Allocation System is a straight


forward and easy to use system. With a little knowledge of computer, the user can be able to
work well with the system without the need for any training. As is common for any new
software at the beginning, things may appear a little unfamiliar. But if the system is gradually
used it will be found to be quite easy to operate, and the user will become skilled in short
time. This is the reason why this system is operationally feasible too.

3.3.8 Sources and Types of Data

The data used in this study were collected from two sources of data collection, the primary
and secondary source.

3.3.8.1 Primary Data Source: The primary source came mainly from direct observation of
events, thus carrying out personal or online interviews and through questionnaire.

a) Interview

We made use of interview method of data collection. This is a physical conversation between
us and the hostel management staff in the university student affairs division.

b) Questionnaire

I made use of structured questionnaire method of data collection which was shared with some
students in both male and female students’ hostels in the university. A Structured
Questionnaire is the type of questionnaire which restricts the respondent from the answers
provided for him for the questions. They are normally “yes or no”, “true or false” answers.

15
3.3.8.2 Secondary Data Source

This constitutes the existing literature on the subject matter of this research such as:

a) Textbooks.

b) Search Engines.

3.3.9 Purpose of the System


The purpose of the system is to allow online payment and an automatic allocation of hostel
rooms to the students, which significantly reduces the difficulties and problems being faced
with the manual means of hostel allocation in KUST Wudil. Main advantages of the system
are:

1. The proper management of the data.


2. Performing the work more efficiently, accurately and quickly.
3. Reduces paperwork.
4. Reduces man power.
5. Easier for users than the manual way.

3.4 System Design

System design is the process of designing the elements of a system such as the architecture,
modules and components, the different interfaces of those components and the data that goes
through that system. This system is designed to allow input, processing, and output of hostel
allocation system to be carried out by a computer system. However, the information and
result obtained from system analysis stage are to be used in designing and developing the an
effective and efficient system that is expected to solve the problems being faced by the
existing system.

The design or architecture of the system can be described using four major sections. The web
server (apache) is the core of the system it is the section where all services of the system are
carried out. The relational database (MySQL) serves as the store of the system where all the
records of the system are stored as it is created in the server of the system and can be
accessed by using the MySQL queries. The middleware (PHP) is a set of programs that takes
users requests from the browser. The middle is between the browsers to the system database
process it and returns the result to the user through the browser. The middle is between the

16
browser and the server. The browser (internet) provides the user where to type the URL of
the system in order to access the user interface to interact with the system. The System
Design is shown in the next diagram.

Figure 3.2: System Design

3.5 Analysis Model

This refers to a model developed to learn all aspects of a problem domain to determine the
best way to solve a specific set of user needs. In this section we describe the system design of
hostel allocation system that show the Use case diagrams, class diagram, sequence diagrams,
and the program structure chart.

3.5.1 Use Cases of the Proposed System


A use case diagram is a graphic depiction of the interactions among the elements of a system.
A use case is a methodology used in system analysis to identify, clarify, and organize system
requirements. A use case defines a goal-oriented set of interactions between external actors
and the system under consideration. Actors are parties outside the system that interact with
the system (Summerville I. 2007).

17
Figure 3.3: Use-case of the Proposed System

3.5.2 Class Diagram of the Proposed System


Class diagram describe the attributes and operations of a class and also the constraints
imposed on the system. The class diagrams are widely used in the modeling of object
oriented system because they are only UML diagrams, which can be mapped directly with
object-oriented languages. (Summerville I. 2007)

18
Figure 3.4: Class Diagram of the proposed system

3.5.3 Sequence Diagram


A sequence diagram is a graphical description of objects participating in a use case or
scenario, sequence diagrams are derived from the use cases module and The structure of the
sequence diagram help us to determine how decentralized the system is.

Figure 3.5: Admin Sequence Diagram

19
Figure 3.6: Student Sequence Diagram

3.5.4 Program Structure Chart


A structure chart is a top-down modular design tool, constructed of squares representing the
different modules in the system, and lines that connect them. The lines represent the
connection and or ownership between activities and sub activities as they are used in
organization charts. In structured analysis structure charts, according to Peter, B. (2012), "are
used to specify the high-level design, or architecture, of a computer program. As a design
tool, they aid the programmer in dividing and conquering a large software problem, that is,
recursively breaking a problem down into parts that are small enough to be understood by a
human brain. The process is called top down design, or functional decomposition
Programmers use a structure chart to build a program in a manner similar to how an architect
uses a blueprint to build a house. In the design stage, the chart is drawn and used as a way for
the client and the various software designers to communicate. During the actual building of
the program (implementation), the chart is continually referred to as "the master-plan".

20
Figure 3.7: Program Structure Chart of the Proposed System

3.6 Database Design


The data in the system are stored and retrieved from the database. Designing the database is
part of the system design. Data elements to be stored have been identified at analysis stage.
They are put together to design the data storage and retrieval system. A database is a
collection of interrelated data stored with minimum redundancy to serve many users quickly
and efficiently. The general objective is to make data processing easy, quick, inexpensive and
flexible for the user. MySQL has been chosen for developing the relevant databases in this
project.

3.6.1 The Entity Relationship Model


It is a method for designing database; it represents data by entities that have attributes.

21
Entities have a relation with one another which the result of the process is normalized
database that facilitates access and avoid duplicate data. It represents the real elements with
three main concepts explained below, “Entity, Relationship and Attribute”

An entity is a thing about which we store data, for person, a bank account, a building. In the
original presentation, Jay, G. & Brad, B. (2001) described an entity as a “thing which can be
distinctly identified’’ So an entity can be a person, object, event, or concept about which we
wish to store data.

A relationship is a link or association between entities. Relations are usually denoted by verb
phrases.

An attribute is a property or characteristics for an entity. For example, an entity STUDENT


may have attributes name, registration number, age etc.

3.6.2 Entity Relationship Diagram


The Entity Relationship Diagram is used to give some visual representation of the
relationship between entities. Therefore, the ERD is used for the data modeling technique.

Figure 3.8: Entity Relationship Diagram

22
3.7 System Requirement

The system requirement has to do with the two basic components of the computer system.
These are the hardware and software requirements.
3.7.1 Hardware Specification

Computer hardware is a group of physical components that consist of a computer system


(tangible). These computer modules include monitor, keyboard, hard drive disk, mouse,
printers, and CPU. In this project, the list of all the hardware requirements that will be used in
implementing the system is given. Table 3.1. Shows the hardware requirements of the
system.

Table 3.1 Hardware Requirements

Hardware Minimum Recommended Description

Processor Dual core G630 2.70GHz. Core i53330 3.00GHz. This device is used to process
instruction in a computer
system.

RAM D1 1GB. D3 8GB. This hardware is used to store


temporary data in the system.

Hard disk 80GBSATA. 1TB SATA. This device will be used to


store data in the system
permanently.

Monitor Benq G615HDPL (15 17 inch Samsung This device will be used
inch wide 1366*768). E1720NRX. displaying the interface of the
system during the designing.

Mouse AVF waterproof key& Logitech MK200 This devices will be used in
and mouse. key& mouse. designing the system keyboard
keyboard for typing code and mouse for
selecting and clicking
functions.

23
Printer L11D inkjet. Epson Tx121 3 in one. This device will be used to
print, scan and copy any
documents when designing the
system.

3.7.2 Software Specification

Software is a set of machine-readable instruction that direct the computer to perform specific
operation. According to Somerville, (2007) software process is a set of activities that lead to
the production of a software product. Software requirements also helps to know what kinds of
software are needed in implementing the system.

Table 3.2 Software Requirements

Software Minimum Recommended Description

Database MySQL Server. MySQL Server R2. MySQL is a server software


that will be used to store record
in the proposed system.

Windows Windows XP. Windows 8, Windows This is the operating system that
Operating System 10, Mac OS, and the proposed system will run
(OS) LINUX. on.

Design Tool Notepad++. Visual Studio Code. A software tool that will be
used to create and edit system
interface.

Microsoft office Microsoft office Microsoft office Software package for


2003. 2013/2016. documentation.

UML tool Rational Rose Microsoft Visio 2016. Microsoft Visio is a modeling
Enterprise Edition tools that will be used to draw
98. UML diagrams like use case,
class diagram, activity diagram
etc.

24
Programming PHP PHP They are the language that will
Language be used for writing the codes of
HTML HTML
the new system.
JAVASCRIPT. JAVASCRIPT.

XAMPP Server XAMPP Server XAMPP Server XAMP Server is a server site
Version 2.0. Version 3.2.1. tool that will be used to connect
the web pages to database and
run on the web browsers.

25
CHAPTER FOUR
SYSTEM IMPLEMENTATION AND TESTING

4.1 Introduction

This chapter is the kernel of the project and so it contains the system implementation phase of
the design. It also contains system testing to ensure the effectiveness and efficiency of the
developed system functionalities, as well as some screen shots of the designed software.

4.2 System Implementation

Implementation phase is the final phase of any system development following a specific
methodology (Software Development Life Circle). This phase involves the implementation of
the purchased software and coding of the custom-written software. Implementation is the
final phase of the Software Development Life Circle, it is of two-step process (system
implementation and operation) and testing (Sommerville I. 2007), during this stage, system
specifications are turned into a working system that is tested and then put into use by the
clients. This phase includes coding, testing, and installation of the software.

System implementation is the process of implementing a system into actual one by designing
the interface where users can access the functions of the system. Interface design is the
process of defining how the system will interact with external system (Sommerville I. 2007).
Also the user interfaces describe the way or process in which the user will interact with the
system and the type of input and output that the system accepts and produces. Almost all the
interfaces used in any system consist of navigation mechanism, input mechanism and output
mechanism.

 Navigation mechanism: navigation mechanism is the way or process in which the


user gives instruction to the system and tells it what to do. E.g. by clicking of a
button.
 Input mechanism: Input mechanism is the way or process in which the system
captures or grasps information. E.g. registration form
 Output mechanism: Output mechanism is the way in which the system provides
information or output to the user of the system through output devices like
monitor, printer.

26
4.3 Implementation of GUI
Finally, during the system implementations, some Graphical User interfaces (GUI) will be
shown in a form of screenshots and their functionalities with brief details of each.

4.3.1 Home Page

The home page is basically the main page of the system. It provides the link to where a new
user registers with the system by verifying their registration number. It also provides access

to login form both for admin and the user.

Fig. 4.1 Home Page

4.3.2 Registration Page

This is where the user gets registered with the system by entering their registration number
for verification and confirmation if they are student of KUST Wudil.

27
Fig. 4.2 Registration Page

4.3.3 Student Dashboard

This is basically the main page of the user. It provides the links to all functionality offered by
the system to the user. It displays the full profile of the student and contains the links to pages
such as Apply for Room, View Roommates, Update Profile etc.

Fig. 4.3 Students Dashboard

28
4.3.4 Select Hall

This is the page where a student selects the hall from which they want to be allocated with a
room.

Fig. 4.4 Select Hall


4.3.5 Payment Gateway

This is the page where the students pay for accommodation using their VISA or
MASTERCARD. A simulation of the real payment gateway was designed since te system is
currently working under localhost.

Fig. 4.5 Payment Gateway

29
4.3.6. Allocation Voucher

30
This is a sample of the voucher printed by a student after successful payment.
31
Fig. 4.6 Room Allocation Voucher

4.3.7 Admin Dashboard

This is basically the main page of the admin. It provides the links to all functionality offered
by the system to the admin. It displays the main table of halls and contains the links to pages
such Add Room, Manage Room Type etc.

Fig. 4.7 Admin Dashboard

4.3.8 Add Hall

This is the page where the admin can add new hostel halls to system.

32
Fig. 4.8 Add Hall

4.3.9 Add Room

This is the page where admin can add rooms to the hostel halls and set maximum number of
students per room.

Fig 4.9 Add Room

4.4 Testing

33
System testing of software or hardware is a test conducted on a completed, integrated system
to evaluate the system's compliance with its specified requirements.

Hostel allocation system is a software designed to be used mostly by students of KUST


Wudil and the hostel management staff. As a result, a sample database of some selected
students is created to enable us test the software and see if it works as expected.

In the software main database, we created a table of preregistered students from which the
system validates if the user is a student of KUST Wudil or not. The system provides access if
the function returns true, and decline if otherwise. All individual components such as user
login, admin login, application process, payment process, halls management etc. have been
tested individually and confirmed working. Some of the individual components test-cases are
shown later in this chapter, in the test-case tables 4.1, 4.2, 4.3 and 4.4.

4.4.1 Importance of Testing Software System

 To demonstrate to the developer and the users that the software meets its
specified requirements.
 To discover faults or defects in the software before its final release for usage.
 To have confidence on the software developed.
System testing involves integrating two or more components that implement system functions
or features and then testing this integrated system. In waterfall methodology, system testing is
concerned with testing the entire system. It includes integration testing and release testing.

Testing the system will involve using unit test, such that each unit in the software is check for
accuracy and functionality.

The below tables shows all the important functions in the developed system been tested and
verified that only valid information were inserted into the corresponding table inside the
database.

4.4.2 Admin Login Test Case

Table 4.1 Admin Login Test Case

Test ID 1.1

Function. Login.

34
Input If successful. If unsuccessful Test Status

Username: System displays An error message displays Successful.


admin dashboard if username or Password
Admin
which contains is invalid.
Password: xxxx activities like add
halls, add rooms,
manage room type
etc.

Brief description Only an Admin can access this by using his valid username and
password.

This will help the Admin to get access to the system.

Fig. 4.10 Admin Login Form

4.4.3 Add Hall Test Case

Table 4.2 Add Hall Test Case

Test Admin Adding Halls 1.2

Function Add Hall Status

Input: Hall name, Hall If successful: If unsuccessful: no text Successfully added


image and select either record has been field will be null. if no error
the hall is for male or added.

35
female.

Hall details System saves the All columns display error Successful Added
data in the database. message or particular error if no error.
in a particular text filed.

Brief description This function is only for admin to add new hostel halls in to the system
including hall name, hall image and hall gender

Fig. 4.11 Add Hall Form

4.4.4 User Make Payment

Table 4.3 User make payment

Test User Make Payment 1.3

Function Make Payment Status

36
Input: Card NO, If successful: If unsuccessful: no text Successful
Expiry Date, CVV and Payment has been field will be null. payment if no
card PIN. added. error.

Payment details System save the All columns display Successful


data in the error message or payment if no
database. particular error in a error.
particular text filed.

Brief description This function allow only user to make payment for
accommodation, so that they can get allocated to hostel rooms
automatically and print their voucher.

Fig 4.12 Payment Form

4.4.5 User Registration Test Case

Fig. 4.4 User Registration

Test User Registration 1.4

Function Verify Student Status

Input: Registration If successful: If unsuccessful: Successful Added if no


Number for record has been system replies “You

37
verification verified and are not a student of error.
system displays KUST WUDIL” and
student name returns to the Home
and ask to create Page.
password.

Student details System save the All columns display


data in the error message or
database. particular error in a
particular text filed.

Brief description This function allow student to register with the system by verifying their
Registration Number, so that they can apply for Accommodation.

Fig. 4.13 Verification & Registration Forms

38
CHAPTER FIVE
SUMMARY, CONCLUSION AND RECOMMENDATIONS

5.1 Summary

HOSTEL ALLOCATION SYSTEM is very useful for hostel allocation in Kano University of
Science and Technology, Wudil. This hostel allocation software is designed for students and
management of KUST Wudil for managing various activities in the hostel. For the past few
years the numbers of educational institutions are increasing rapidly, thereby the numbers of
hostels are also increasing for the accommodation of the students in this institution. And
hence there is a lot of strain on the staff who are running the hostel, and software’s are not
usually used in this context. This particular project deals with the problems on managing a
hostel and avoids the problems which occur when carried manually. Identification of the
drawbacks of the existing system leads to the designing of computerized system that will be
compatible and provides some improvements to the existing system, which is more user
friendly and more GUI oriented.

5.2 Conclusion

39
The introduction of automatic hostel allocation system focuses on saving cost, improving the
efficiency of the processes involved in both application and management of hostels and
makes the overall procedure stress free. The hostel allocation system is aimed at streamlining
the application and management process of hostels for both students and the administrators in
charge of the procedures involved. The system after it was implemented has eliminated
unnecessary administrative tasks and reduced or even avoided paper work. This system will
help improve productivity and reliability of the hostel registration and management process in
a more efficient manner.

5.3 Recommendations

The proposed system has considerable potential for future development. In future a survey
should be carried out among the students involved in the testing of the system. A
questionnaire should be designed and consist of questions like: Was the system user friendly,
did you get any problem for using the system, did the system take time to respond, did you
like the automated assessment, are you satisfied with such a system.

It is recommended that further enhancement should be carried out on this project work so that
necessary amendment and improvement can be made to get a perfect system. Such
improvement may include:

 Room reservation feature on the user part: This will allow a student to reserve a room
for a short period of time say 48 hours, so that in case a student can’t pay for a room
instantly, or having issues with the payment gateway, an option is provided to reserve
a bed space and make the payment later.
 Change allocation feature on the admin part: This allows admin to be able to change
room for a student after automatic allocation, in case there is a chaos or any
reasonable issue with a student, admin can easily change allocation for that student.
 Search Feature on Admin Part: A search module should be integrated on the Admin
part to allow the admin easily locate a particular students room using the registration
number as the search key.

40
REFERENCES
Akanfe, A. A. (2005). An online hotel reservation (a case study of tamarin hotel):
a thesis submitted to the Department of Computer Science at the Federal University
of Technology Akure in partial fulfilment of B.TECH in computer science.
Anjorin, B. O. (2005). Online hotel reservation system (a case study of Solton
International Hotel and Resort): A thesis submitted to the Department of Computer
Science at the Federal University of Technology Akure in partial fulfilment of
B.TECH in computer science.
Asmahani, B. M. (2007). Student college Allocation. A thesis submitted to the
Department of Information Technology and quantitative science at the Universiti
Teknologi Mara in partial fulfilment of BSc (HONS) in information technology.
Bowen, H. E., & Daniels, M. J. (2011). Hosteling as a pathway to cross-cultural

understanding. Tourism Review International, 14, 189-199.


doi:10.3727/154427211X13092645879973

Gavin, E. (2010). College students’ knowledge of hostels and what factors influence
their intent to stay. A thesis submitted in partial fulfilment of the requirement for the
degree of (M. Sc.) Hospitality Management and Dietetics, Kansas State University.
Idris, H.A. (2010). Development of a Web Portal System Project. A thesis submitted at

Ahmadu Bello University Zaria, in partial fulfilment of BSc (HONS) in Computer


Science.

41
Iraba, M. L. (2009). Student residence management system. A thesis submitted at the

University of Western Cape in partial fulfilment of BSc (HONS) in Computer Science.

Jay, G. & Brad, B. (2001). MYSQL/PHP Database Application: M&T Books Publishing.

Jugović, A., Kovačić, M., & Safić, D. (2010). Choice of destination, accommodation and

transportation in times of economic crisis. Tourism and Hospitality Management,


16(2), 165-180.

Luke, W. & Laura, T. (2001). PHP and MYSQL Web Development: Short Hotel

Management. Sams Publishing: Sekhar, S.P. et al pp 172-181.

PerlScripts & JavaScripts (2006). MySQL Tutorial, Database Commands, Beginners


Guide: http://www.perlscriptsjavascripts.com/tutorials/mys ql/index.html. Accessed
2/5/19.
Peter, B. (2012). A Web-Based Classroom Allocation System: a manuscript submitted

to the Department of Computer Science University of Wisconsin-LaCrosse in partial


fulfilment of the requirements for the degree of master of software engineering.

Segun, O. O. (2014). Development of an Automated Hostel Facility Management System.


Journal of Science and Engineering. 5 (1): 1-10.
Shoewu, O., & Duduyemi, O. (2016). Design and Implementation of Hostel Management
System (HOMASY): LASU as Case Study. Pacific Journal of Science and
Technology. 17(2):189-196.
Sommerville, I. (2007). Software Engineering, eighth edition. Edinburgh Gate Harlow Essex

CM20 2JE England, Addison-Wesley Publisher Limited.

Terry, F.M. (2013), (2011), (2007), (2004). Web Development & Design Foundation with

HTML5. Pearson Education Inc., Addison-Wesley Publishing.

Thompson, A. (2003a). Business Feasibility Studies: Dimensions of Business Viability.


Perth Best Entrepreneur.
Whitten, Bentley & Dittman (2004). System Analysis and Design Methods (5th ed).
McGrawHill: New York, NY.

42
43
APPENDIX A
SOURCE CODE
1. HOME PAGE
<?php session_start();?>

<!DOCTYPE html>

<html lang="en">

<head>

<?php

// include ('marquee.php')

?>

<meta charset="UTF-8">

<meta content="width=device-width",initial-scale=1">

<title>Hostel Allocation System (HAS)</title>

<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">

<link rel="stylesheet" href="fontawesome/css/font-awesome.min.css">

<script type="text/javascript" src="js/jquery-2.1.0.min.js"></script>

<script src="js/bootstrap.min.js"></script>

<link rel="stylesheet" href="style.css">

<!-- <style>

</style> -->

</head>

<body>

<IMG SRC="header1.jpg" ALT="some text" WIDTH=100% HEIGHT=145>

<?php include ('marquee.php');?>

44
<div class="">

<div style="color:white">

<div class= "container">

<form class="form-horizontal" role="form" action="login.php" method="POST" >

<div class="form-group">

<label class="control-label col-sm-4 text-white" style="color: white"><h4>Registration Number:</h4></label>

<div class="col-sm-4">

<input name="username" type="text" class="form-control" placeholder="Registration Number" autofocus


required>

</div>

</div>

<div class="form-group">

<label class="control-label col-sm-4"><h4>Password:</h4></label>

<div class="col-sm-4">

<input name="password" type="password" class="form-control" placeholder="Password" autofocus required>

</div>

</div>

<div class="form-group">

<label class="control-label col-sm-4"> <h4>Account Type:</h4> </label>

<div class="col-sm-4">

<select name="type" class="form-control">

<option value="student">Student</option>

45
<option value="admin">Admin</option>

</select>

</div>

</div>

<div class="form-group">

<div class="col-sm-offset-4 col-sm-5">

<div style="color:#fff5ee">

<button name="login" type="submit" class="btn btn-primary">Login</button>

<a href="forgot_pass.php" class="btn btn-danger">Forgot Password </a><br><br>

<h3>New Student?</h3> <a href="register.php" class="btn btn-success">Register</a>

</div>

</div>

</div>

</form>

</div>

</div>

</div>

</body>

</html>

2. STUDENT DASHBOARD PAGE

<?php require'db.php' ?>

46
<?php

session_start();

//error_reporting(0);

if(!isset($_SESSION['student_id'])){

if(isset($_SESSION['admin_id'])){

header("Location: admin.php");

header("Location: index.php");

$student_id = $_SESSION['student_id'];

$std_query = mysqli_query($db, "SELECT * FROM students

WHERE student_id='$student_id'")or die(mysqli_error());

$std_row = mysqli_fetch_array($std_query);

?>

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta content="width=device-width",initial-scale=1">

<title>Dashboard - Hostel Allocation System (HAS)</title>

<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">

<link rel="stylesheet" href="style/style.css">

<link rel="stylesheet" href="style.css">

<link rel="stylesheet" href="fontawesome/assets/css/font-awesome.min.css>

<script type="text/javascript" src="js/jquery-2.1.0.min.js"></script>

47
<script src="js/bootstrap.min.js"></script>

<style>

body{

background-color: #e9e9e9;

</style>

</head>

<body>

<IMG SRC="header1.jpg" ALT="some text" WIDTH=100% HEIGHT=140>

<?php include('student_nav.php');

$query = mysqli_query($db, "SELECT * FROM students a

LEFT JOIN halls b ON a.hall_id=b.hall_id

LEFT JOIN room c ON a.room_id=c.room_id

WHERE student_id='$student_id'")or die(mysqli_error($db));

$count = mysqli_num_rows($query);

$row = mysqli_fetch_array($query);

?>

<div class="container">

<!-- <div style="color:white"> -->

48
<div class="row">

<div class="col-md-12">

<span style="font-size: 30px; color:white;"> Welcome, <?php echo $std_row['fullname']; ?> </span>

<span class="pull-right">

<?php

if($row['room_id'] == 0 || $std_row['hall_id'] == 0){

echo '<a href="apply_hall.php" class="btn btn-success">Apply for Accomodation </a>';

}elseif($row['verify'] == 'processing'){

echo '<span class="fa fa-angle-double-right"></span> <h4><b class="text-primary">Hostel Application


still Processing </b></h4>';

}else{

// echo "<b>".$row['hall_name'].", ".$row['room_name']."</b>";

?>

</span>

<br><br><br>

<div class="clearfix"></div>

<div class="container">

<div class="row">

<div class="col-md-1">

</div>

<div class="col-md-10">

49
<div class="well">

<div style="color:black">

<h3><strong> Current Accomodation: </strong></h3>

<?php

if($row['room_id'] != 0){ ?>

<div class="col-md-6">

<h4><p> <strong>Hall: </strong> <?php echo $row['hall_name']; ?> <br>

<strong>Room: </strong> <?php echo $row['room_name']; ?>

</p></h4>

</div>

<div class="col-md-6">

<div class="pull-right"> <a href="voucher.php" class="btn btn-danger" style="margin-left:30px">Re-


Print Voucher </a> </div>

<div class="pull-right"> <a href="roommates.php" class="btn btn-danger">Show Room Mates


</a> </div>

</div>

<?php }else{

echo "<h4 align='center'><strong>You Currently do not have any accomodation, Apply for the
available room immediately</strong></h4>";

} ?>

<!-- PART FOR USER DATAT -->

<br><br>

<b> <br> <hr> <b>

<div style="text-align: center ;"><h1><b><u> Student Details </u></b></h1> </div>

50
<div class="row">

<div class="container-fluid">

<div class="col-md-8">

<form action="update.php" method="post">

<div class="form-group">

<div class="col-md-3"><label>Full name:</label></div>

<div class="col-md-9"><input type="text" name="fullname" value="<?php echo


$std_row['fullname']; ?>" class="form-control" disabled/></div><br>

</div>

<div class="form-group">

<div class="col-md-3"><label>Registration NO:</label></div>

<div class="col-md-9"><input type="text" name="reg_no" value="<?php echo


$std_row['reg_no']; ?>" class="form-control" disabled/></div> <br>

</div>

<div class="form-group">

<div class="col-md-3"><label>Department:</label></div>

<div class="col-md-9"><input type="text" name="dept" value="<?php echo


$std_row['department']; ?>" class="form-control" disabled/></div> <br>

</div>

<div class="form-group">

<div class="col-md-3"><label>Level:</label></div>

<div class="col-md-9"><input type="text" name="level" value="<?php echo


$std_row['level']; ?>" class="form-control" disabled/></div> <br>

</div>

<div class="form-group">

<div class="col-md-3"><label>Email:</label></div>

<div class="col-md-9"><input type="text" name="email" value="<?php echo


$std_row['email']; ?>" class="form-control" disabled/></div> <br>

51
</div>

<div class="form-group">

<div class="col-md-3"><label>Phone NO:</label></div>

<div class="col-md-9"><input type="text" name="phone" value="<?php echo


$std_row['phone']; ?>" class="form-control" disabled/></div> <br>

</div>

<div class="form-group">

<div class="col-md-3"><label>Date of Birth:</label></div>

<div class="col-md-9"><input type="text" name="age" value="<?php echo $std_row['age'];


?>" class="form-control" disabled/></div> <br>

</div>

<div class="form-group">

<div class="col-md-3"><label>Resident Address:</label></div>

<div class="col-md-9">

<textarea name="addr" cols="20" class="form-control" disabled><?php echo


$std_row['address']; ?></textarea></div>

</div>

<!-- <div class="col-md-9">

<textarea name="addr" cols="20" class="form-control"><?php echo $std_row['address'];


?></textarea>

</div> -->

<div class="col-md-3"></div>

<div class="col-md-8">

<br>

52
</div>

<div class="col-md-1"></div>

</form>

</div> <br>

<div class="col-md-4">

<div style="text-align: center;">

<img src="photo/<?php echo $row['photo'] ?>" width="40%" height="40%"/>

</div>

</div>

</div>

</div>

<br>

<div class="clearfix"></div>

</div>

</div>

</div>

<div class="col-md-1">

</div>

</div>

</div>

53
<?php

/* $sid = $_SESSION['student_id'];

$pstd_query = mysqli_query($db, "SELECT * FROM students

WHERE student_id='$sid'")or die(mysqli_error());

$pstd_row = mysqli_fetch_array($pstd_query);

if($std_row['hall_id'] == 0){

$pquery = mysqli_query($db, "SELECT * FROM students

WHERE student_id='$sid'")or die(mysqli_error());

}else{

$pquery = mysqli_query($db, "SELECT * FROM students a

LEFT JOIN halls b ON a.hall_id=b.hall_id

LEFT JOIN room c ON a.room_id=c.room_id

WHERE student_id='$sid'")or die(mysqli_error());

$row = mysqli_fetch_array($pquery); */

?>

<script src="js/jquery-3.3.1.min.js"></script>

<script src="bootstrap/js/bootstrap.min.js"></script>

</body>

</html>

3. ADMIN DASHBOARD

<?php require'db.php' ?>

54
<?php

session_start();

//error_reporting(0);

if(!isset($_SESSION['admin_id'])){

header("Location: index.php");

$admin_id = $_SESSION['admin_id'];

$adm_query = mysqli_query($db, "SELECT * FROM admin

WHERE admin_id='$admin_id'")or die(mysqli_error());

$adm_row = mysqli_fetch_array($adm_query);

$app_query = mysqli_query($db, "SELECT * FROM students WHERE verify='processing'")or die(mysqli_error());

$app_count = mysqli_num_rows($app_query);

?>

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta content="width=device-width",initial-scale=1">

<title>Admin Dashboard - Hostel Allocation System (HAS)</title>

<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">

<link rel="stylesheet" href="style/style.css">

<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">

<link rel="stylesheet" href="datatables/dataTables.bootstrap.css">

<link rel="stylesheet" href="style.css">

<script type="text/javascript" src="js/jquery-2.1.0.min.js"></script>

<script src="js/bootstrap.min.js"></script>

55
<style>

body{

background-color: #e9e9e9;

</style>

</head>

<body>

<IMG SRC="header1.jpg" ALT="some text" WIDTH=100% HEIGHT=140>

<?php include('admin_nav.php');

$hall_query = mysqli_query($db, "SELECT * FROM halls")or die(mysqli_error());

?>

<div class="container">

<div style="color:black">

<div class="row">

<div class="col-md-12">

<span style="font-size: 30px; color:white;"> Welcome, <?php echo $adm_row['fullname']; ?> </span>

<br><br><br>

<div class="clearfix"></div>

<div class="row">

<div class="col-md-2"></div>

<div class="col-md-8">

<div class="well">

56
<a href="add_hall.php" class="btn btn-success pull-right">

<span class="fa fa-plus"></span> Add Hall </a> <br><br>

<?php if(mysqli_num_rows($hall_query) == 0){

echo "<h3 align='center'>There are no Halls on this System </h3>";

}else{?>

<table id="example2" class="table table-bordered table-striped">

<thead>

<tr>

<th>S/N</th>

<th>Hall Name</th>

<th>For</th>

<th>Rooms</th>

<!-- <th>Capacity</th> -->

<th>View</th>

<th>Action</th>

</tr>

</thead>

<?php

$i = 1;

while($hall_row = mysqli_fetch_array($hall_query)){

$hid = $hall_row['hall_id'];

$rq = mysqli_query($db, "SELECT * FROM room WHERE hall_id = '$hid'")or die(mysqli_error());

$rcount = mysqli_num_rows($rq);

/* $cap = 0;

while($rrow = mysqli_fetch_array($rq)){

$cap = $rrow['capacity'] + $cap;

57
} */

?>

<tr>

<td><?php echo $i; ?></td>

<td> <strong><?php echo $hall_row['hall_name']; ?> </striong>

<!-- <small><a href="rooms.php?hall=<?php echo $hall_row['hall_id']; ?>">[Check


Rooms]</a></small> -->

</td>

<td><?php echo $hall_row['hall_for']; ?> </td>

<td><?php echo $rcount; ?> </td>

<!-- <td><?php echo $cap; ?> </td> -->

<td><a href="hall_room.php?id=<?php echo $hall_row['hall_id']; ?>" class="btn btn-info"> View


Rooms </a></td>

<td><a href="hall_edit.php?id=<?php echo $hall_row['hall_id']; ?>" class="btn btn-success btn-


sm"><span class="fa fa-edit"></span> Edit</a>

<a href="hall_delete.php?id=<?php echo $hall_row['hall_id']; ?>" class="btn btn-danger btn-


sm"><span class="fa fa-times"></span> Delete </a> </td>

</tr>

<?php

++$i;

} ?>

</table>

<?php } ?>

</div>

</div>

<div class="col-md-2"></div>

</div>

</div>

58
</div>

</div>

</div>

<script>

$(function () {

$("#example1").DataTable();

$('#example2').DataTable({

"paging": true,

"lengthChange": false,

"searching": false,

"ordering": true,

"info": true,

"autoWidth": false

});

});

</script>

<script src="datatables/jquery.dataTables.min.js"></script>

<script src="datatables/dataTables.bootstrap.min.js"></script>

<script src="js/jquery-3.3.1.min.js"></script>

<script src="bootstrap/js/bootstrap.min.js"></script>

</body>

59
</html>

4. USER/ADMIN LOGIN FORM

<?php session_start();

include('db.php');

if(isset($_POST['login']))

$username = $_POST['username'];

$password = $_POST['password'];

if($_POST['type'] == 'admin'){

$query = mysqli_query($db,"SELECT * FROM admin WHERE username = '$username' AND password =


'$password'")or die(mysqli_error($con));

$row = mysqli_fetch_array($query);

//Get user details from db

$name = $row['fullname'];

$counter = mysqli_num_rows($query);

$id = $row['admin_id'];

if ($counter == 0)

echo "<script type='text/javascript'>alert('Invalid Username or Password!')</script>";

60
echo "<script>document.location='index.php'</script>";

}else{

$_SESSION['admin_id'] = $id;

$_SESSION['admin_name'] = $name;

echo "<script type='text/javascript'>alert('Login Successful')</script>";

echo "<script type='text/javascript'>document.location='admin.php'</script>";

}elseif($_POST['type'] == 'student'){

$query = mysqli_query($db,"SELECT * FROM students WHERE reg_no = '$username' AND password =


'$password'")or die(mysqli_error($con));

$row = mysqli_fetch_array($query);

//Get user details from db

$name = $row['fullname'];

$counter = mysqli_num_rows($query);

$id = $row['student_id'];

if ($counter == 0)

61
echo "<script type='text/javascript'>alert('Invalid Registration Number or Password! Please REGISTER
if you have not done so!')</script>";

echo "<script>document.location='index.php'</script>";

}else{

$_SESSION['student_id'] = $id;

$_SESSION['student_name'] = $name;

echo "<script type='text/javascript'>alert('Login Successful')</script>";

echo "<script type='text/javascript'>document.location='dashboard.php'</script>";

?>

5. DATABASE CONNECTION

<?php

$db = mysqli_connect("localhost","root","","has");

// Check connection

if (mysqli_connect_errno())

echo "Failed to connect to MySQL: " . mysqli_connect_error();

?>

6. ADD HALL PAGE

<?php require'db.php' ?>

62
<?php

session_start();

//error_reporting(0);

if(!isset($_SESSION['admin_id'])){

header("Location: index.php");

$admin_id = $_SESSION['admin_id'];

$adm_query = mysqli_query($db, "SELECT * FROM admin

WHERE admin_id='$admin_id'")or die(mysqli_error());

$adm_row = mysqli_fetch_array($adm_query);

$app_query = mysqli_query($db, "SELECT * FROM students WHERE verify='processing'")or die(mysqli_error());

$app_count = mysqli_num_rows($app_query);

if(isset($_POST['submit'])){

$hall_name = $_POST['name'];

$hall_for = $_POST['for'];

//$rooms = $_POST['rooms'];

//$space = $_POST['space'];

//$capacity = $_POST['capacity'];

$rooms = 0;

$space = 0;

$capacity = $rooms * $space;

$rand = mt_rand(100000, 999999);

$target_dir = "img_hall/";

$target_file = $target_dir . $rand ."_" . basename($_FILES["image"]["name"]);

$uploadOk = 1;

63
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);

mysqli_query($db, "INSERT INTO halls SET hall_name='$hall_name', room_number='$rooms', hall_for='$hall_for',


capacity='$capacity', hall_img='$target_file'")or die(mysqli_error());

/* $g = mysqli_query($db, "SELECT * FROM halls WHERE hall_name='$hall_name' AND hall_for='$hall_for'")or


die(mysqli_error());

$grow = mysqli_fetch_array($g);

$h_id = $grow['hall_id'];

for($i = 1; $i <= $rooms; $i++){

$room_name = "Room ".$i;

mysqli_query($db, "INSERT INTO rooms SET hall_id = '$h_id', room_name = '$room_name',


room_capacity='$space'")or die(mysqli_error());

} */

//after mysql query

move_uploaded_file($_FILES["image"]["tmp_name"], $target_file);

echo "<script type='text/javascript'>alert('Hall Succesfully Added')</script>";

echo"<script>document.location='admin.php'</script>";

?>

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta content="width=device-width",initial-scale=1">

<title>Add New Hall - Hostel Allocation System (HAS)</title>

<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">

64
<link rel="stylesheet" href="style/style.css">

<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">

<link rel="stylesheet" href="datatables/dataTables.bootstrap.css">

<link rel="stylesheet" href="style.css">

<script type="text/javascript" src="js/jquery-2.1.0.min.js"></script>

<script src="js/bootstrap.min.js"></script>

<style>

body{

background-color: #e9e9e9;

</style>

</head>

<body>

<IMG SRC="header1.jpg" ALT="some text" WIDTH=100% HEIGHT=140>

<?php include('admin_nav.php'); ?>

<div class="container">

<div class="row">

<div class="col-md-12">

<span style="font-size: 30px; color:white"> Add New Hall </span>

<br><br><br>

<div class="clearfix"></div>

<div class="row">

<div class="col-md-2"></div>

65
<div class="col-md-8">

<div class="well">

<div class="pull-left"><a href="admin.php" class="btn btn-info btn-sm"><< Back </a></div> <br><br>

<form method="post" action="" enctype="multipart/form-data">

<div class="form-group">

<label>Hall Name</label>

<input type="text" name="name" class="form-control" required>

<div class="form-group">

<label>Hall For</label>

<select name="for" class="form-control" required>

<option>--please select--</option>

<option>Male</option>

<option>Female</option>

</select>

</div>

<!-- <div class="form-group">

<label>Number of Rooms</label>

<input type="number" name="rooms" class="form-control" required>

</div>

<div class="form-group">

<label>Bed Spaces for each Room</label>

<input type="number" name="space" class="form-control" required>

</div>

66
<div class="form-group">

<label>Hall Capacity</label>

<input type="text" name="capacity" class="form-control" disabled required>

</div> -->

<div class="form-group">

<button name="submit" class="btn btn-success">Add Hall</button>

</div>

</div>

</div>

<div class="col-md-2"></div>

</div>

</div>

</div>

</div>

<script src="datatables/jquery.dataTables.min.js"></script>

<script src="datatables/dataTables.bootstrap.min.js"></script>

<script src="js/jquery-3.3.1.min.js"></script>

<script src="bootstrap/js/bootstrap.min.js"></script>

</body>

</html>

67
APPENDIX B
DATABASE
Database Table Structure

Admin

Students

68
Halls

Rooms

Pre_Registered_Students

69
Payment_Cards

Room_Type

Database Table Screenshots

1. Overall database of Hostel Allocation System

70
2. Students Table

3. Halls Table

71
4. Table Pre Registered Students

72
APPENDIX C
ABBREVIATIONS
1. PHP: Hypertext PreProcessor.

2. MySQL: My Structured Query Language.

3. HTML: HyperText Markup Language.

4. XAMPP: Cross-platform (X) Aphache, MySQL, PHP and Perl.

5. KUST: Kano University of Science and Technology.

6. UML: Unified Modelling Language.

7. CSS: Cascading Style Sheet.

8. HAS: Hostel Allocation System.

9. OS: Operating System.

73

You might also like