0% found this document useful (0 votes)
16 views

documentation

The document outlines a project titled 'Thika Main Hostel Management System' submitted by Ruth Waithera Nyambura as part of her Bachelor of Science in Information Technology at Mount Kenya University. It details the project's objectives, which include automating hostel management tasks such as student registration, payment processing, and communication between students and hostel managers. The project aims to enhance efficiency, accuracy, and security while addressing existing issues with manual management systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

documentation

The document outlines a project titled 'Thika Main Hostel Management System' submitted by Ruth Waithera Nyambura as part of her Bachelor of Science in Information Technology at Mount Kenya University. It details the project's objectives, which include automating hostel management tasks such as student registration, payment processing, and communication between students and hostel managers. The project aims to enhance efficiency, accuracy, and security while addressing existing issues with manual management systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

MOUNT KENYA UNIVERSITY

SCHOOL OF COMPUTING AND INFORMATICS


DEPARTMENT OF INFORMATION TECHNOLOGY

PROJECT TITLE: THIKA MAIN HOSTEL MANAGEMENT SYSTEM

BY: RUTH WAITHERA NYAMBURA


REG NO: BIT/2022/52070

This project was submitted in partial fulfilment of requirement for the Mount
Kenya University awards of BACHELOR OF SCIENCE IN INFORMATION
TECHNOLOGY.

1
DECLARATION
I hereby declare that this project report is based on my original work except for the
citations and quotations which have been fully acknowledged .I also declare that it has
not been previously and concurrently submitted for any other degree or award at
Mount Kenya University

Name: Ruth Waithera Nyambura

Signature: ………………………………………………………

ID no: BIT/2022/52070

Date: ………………………………………………………………

SUPERVISOR
The undersigned hereby indicates that the report has been submitted to Mount Kenya
University with my consent and that it is an accurate account of the project completed by
the student mentioned above under my supervision.

Signature:………………………………… Date:………………………………………………

2
DEDICATION

This project is dedicated to my family for their support throughout my educational journey. I also
dedicate it to God for giving me life and breadth to pursue my education.

3
ACKNOWLEDGEMENTS

I would like to thank everyone who contributed to the successful completion of this project. I
would especially like to express my gratitude to my project supervisor, Madam Elena Mwai for
her advice and guidance throughout the progress of this project. I would also like to thank my
fellow students for their constructive criticism which helped me to improve on my project
implementation

4
Contents
Table of Contents

DECLARATION ............................................................................................................................ 2
DEDICATION…………………………………………………………………………………….3
ACKNOWLEDGEMENTS……………………………………………………………………….4
Contents…………………………………………………………………………………………...5
LIST OF TABLES AND FIGURES ……………………………………………………………..7
CHAPTER ONE……………………………………………………...............................………...8
1.1 Background ....................................................................................................................... 8
1.2 Problem Statement............................................................................................................. 8
1.4 Proposed Project Title ....................................................................................................... 9
1.5 Project Objectives. ............................................................................................................ 9
1.6 Project Scope ................................................................................................................... 10
1.7 Project Justification ......................................................................................................... 11
1.8 Project Risks and Mitigation ........................................................................................... 11
1.9 Proposed Project Budget ................................................................................................. 12
CHAPTER TWO: LITERATURE REVIEW……………………………………………………15
2.1 Introduction ..................................................................................................................... 15
2.2 Case Studies: ................................................................................................................... 15
2.2.1 NavHostel –Hostel management system .......................................................................... 15
2.2.2 eZee Absolute –hostel management system .................................................................... 18
CHAPTER THREE: METHODOLOGY………………………………………………………..20
3.1 introduction ..................................................................................................................... 20
3.2 Research design. .............................................................................................................. 20
3.3 Requirement gathering .................................................................................................... 20
3.4 sampling .......................................................................................................................... 21
3.5 data analysis .................................................................................................................... 22
3.6 system development methodology .................................................................................. 22
3.7 tools and technologies ..................................................................................................... 22
3.7.1 Database Tools ............................................................................................................. 22
3.7.2 Programming Languages ............................................................................................. 23
3.8 system implementation and testing ................................................................................. 23
CHAPTER FOUR: SYSTEM ANALYSIS AND REQUIREMENT MODELING .................... 25
4.1 Introduction ......................................................................................................................... 25

5
4.2 System Overview ................................................................................................................ 25
Processes: .............................................................................................................................. 25

4.3 Data Flow: ....................................................................................................................... 26


4.5 Data Flow Diagrams ....................................................................................................... 29
4.6 System Analysis .................................................................................................................. 31
4.6.1 Performance Analysis: ................................................................................................. 31
4.6.2 Security Analysis: ........................................................................................................ 31
4.6.3 Usability Analysis: ....................................................................................................... 31
4.7.1 Functional Requirements ................................................................................................. 32
CHAPTER FIVE: SYSTEM DESIGN ......................................................................................... 34
5.1 Introduction ......................................................................................................................... 34
5.2 Interface Design .................................................................................................................. 34
5.2 Input design ......................................................................................................................... 35
5.3 Database Design .................................................................................................................. 37
5.3.1 Conceptual Database Design ....................................................................................... 37
5.4 Logical Database Design ................................................................................................ 40
CHAPTER SIX: SYSTEM IMPLEMENTATION ...................................................................... 41
6.1 Introduction ......................................................................................................................... 41
6.2 Tools Used for Coding and Testing .................................................................................... 41
6.2.1 Coding Tools ................................................................................................................ 41
6.3 System Test Plan ................................................................................................................. 42
Objectives .............................................................................................................................. 42
Scope ..................................................................................................................................... 42

6.4 Testing Approach ............................................................................................................ 43


6.5 Test Cases ........................................................................................................................... 43
6.7 Proposed Change over Technique ....................................................................................... 45
CHAPTER SEVEN: LIMITATIONS, CONCLUSIONS, AND RECOMMENDATIONS ........ 47
7.1 Limitations .......................................................................................................................... 47
7.2 Recommendations ............................................................................................................... 48
7.3 Conclusion .......................................................................................................................... 49
JOURNAL ARTICLE ........................................................................................................... 50
APPENDICES .............................................................................................................................. 51

6
LIST OF TABLES AND FIGURES

Table 1: proposed budget .............................................................................................................. 12


Table 2: project scheduling ........................................................................................................... 13
Table 3:Test cases ......................................................................................................................... 44
Figure 1 : gantt chart ..................................................................................................................... 14
Figure 2 : Nav Hostel .................................................................................................................... 17
Figure 3 : Nav Hostel Dashboard ................................................................................................... 18
Figure 4: Ezee Absolute Hostel Dashboard .................................................................................. 19
Figure 5: Use case Diagram .......................................................................................................... 28
Figure 6: Student Level DFD ........................................................................................................ 29
Figure 7: Admin Level 1 DFD ...................................................................................................... 30
Figure 8: Student Dashboard ......................................................................................................... 34
Figure 9 : Admin Dashboard ......................................................................................................... 35
Figure 10: Admin Registration ..................................................................................................... 35
Figure 11: Student Registration form ............................................................................................ 36
Figure 12 : Admin and Student log in form .................................................................................. 36
Figure 13: ER Diagram ................................................................................................................. 39

7
CHAPTER ONE
1.1 Background

In our current era of automated systems it is not advisable to be using manual systems.
Hostels without an automated management systems have a hard time in performing all
their activities to achieve the set goals and expecttions.Thika Main Hostel is a hostel
located in Thika Runda and it hosts most students male and female from different
institutions around Thika .

The hostel consists of two parts the male hostels and the female hostel.it is further divided
into 2 parts where one part of the hostel pays 6500 Kenya shillings while the other part
pays 8500 Kenya shillings per month. The hostel has a maximum of 45 rooms.23 rooms
belong to the female students while the rest 22 rooms belong to the male students. Half of
the rooms where they pay 6500 they accommodate 3 students each and the rest
accommodate a maximum of 1 students.

There are 3 hostel managers, a watchman, 2 cleaners and regular people who are
employed to help the 2 cleaners clean the compound.

1.2 Problem Statement

Throughout its existence, the hostel had used manual data entry. Most activities performed by
hand which is tiresome and time consuming the main problems that the system aimed to address
were:

Poor communication between the hostel managers and the students.

Physical booking of the hostels,

Poor maintaining of the students record and details, room details, payment details.

Time wastage to the hostel managers as they move room to room identifying the number of
students in each room and the number of empty beds.

Poor retrieving system of the previous information and previous records.

Poor payment methods and physical writing of receipts.


Also new students who know nothing about the hostel were not able to access any information
concerning the hostel unless they physically visit the hostel, thus reducing the accessibility and
visibility, of the hostel.

8
1.3 Proposed Solution

Instead of calling and booking the hostels physically, the new system allows students to book and
register for the hostel from anywhere and at any time.

Students are also able to make payments through the system without needing to collect physical
receipts. The payments are reflected in the system automatically, and if a receipt is required,
hostel managers no longer have to write them manually; instead, the system will generate and
print them automatically after a student makes a payment via M-Pesa or card payments.

The system provides a secure way for hostel administrators to store inventory records, student
details, payment information, employee records, and previous transactions in a less tiresome and
easily retrievable manner.

Additionally, the system enables students to interact with hostel managers through a platform
where they can submit complaints and suggestions.

A notice board feature that was introduced, allows hostel managers to post important information
that all students could read on the student dashboard.

A rule based Chabot and a thika hostel website was developed to allow the new students to have
knowledge about the hostel and also it helps improve financial performance of the hostel due to
increased visibility and accessibility.

Furthermore, the system simplifies room allocation by keeping track of vacant rooms, allowing
administrators to efficiently add or remove students and employees as needed, thereby
streamlining the management of Thika Main Hostels.

1.4 Proposed Project Title

Thika Main Hostel Management System.

1.5 Project Objectives.

The primary objective of this project was to develop a robust and user friendly hostel management
system that offers a wide range of features and functionalities.
The specific objectives included:
• To ensure easy booking and registration of the students to the hostel.
• To ensure payment of the hostel fee from anywhere using M-pesa and other banking
services where there is no need for student to go to the office to provide proof of
payment.

9
• To ensure easy retrieving of previous data.
• To ensure safety of all data that is payment details , students details , inventory details ,
employee details,

• To improve communication between the Thika Main hostel managers and the students

• To ensure easy collection of data thus easy management of the hostel.

1.6 Project Scope

The system Thika Main Hostel system includes several interconnected modules (components)
that work together to ensure that tasks are streamlined:

Student registration module: facilitates registrations and enrollment process, capturing


all students’ details.

Database management module: manages all users data.it has authenticated


and security mechanisms that ensures secure access wit login credentials and
implement role based access to students and admin.

Financial management module: which involves recording payment either done


using cash or sent via M-pesa and other ways of payment and keep records of it.

Communication and notification module: which will entail submitting of complaints,


providing suggestions, posting notices to the residents of the hostels.

Inventory and employee management module: captures number of rooms,


chairs, utensils, bed, routers and number of employees in the hostel.

1.7 Project Justification

This project utilizes technology to enhance efficiency, accuracy and security ultimately benefitting
the entire hostel community.

10
• The improved hostel system helps increase efficiency since it automates manual
works like book keeping.

• It helps improve accuracy since it eliminates data errors and mistakes that may be
done by a human when inputting or recording data.

• The system helps improve data security since it is difficult for someone to steal data
from computers which have passwords compared to the risk of one easily taking
away the record books.

• The system helps improve communication between the students and the managers. It
will be easy for students to reporting issues affecting them easily through the system
anytime without fear, and also share on how they would like the facilities to be
improved without necessarily the manager collecting the views directly from
students.

• It helps in cost saving since there is less operational costs with manual record
keeping and financial management.

• The system is also less tiresome since most of the work is automated, thus reducing
manual labor.

• It helps boost the student’s satisfaction since it enables online booking, facilitates
maintenance requests, and offers more convenient experience.

1.8 Project Risks and Mitigation

• System security vulnerabilities

Mitigation: data encryptions and regular security audits.

• Data breaches

Mitigation: staff training on data security and regular backups.

• System downtime
Mitigation: through regular maintenance of the system.
• Difficulty in training users of the system:
Mitigation: comprehensive training and documentation provided to users addressing
potential challenges associated with system adoption and usage.

11
1.9 Proposed Project Budget

Table 1: proposed budget

TASK DETAILS AMOUNT


Purchase of hardware • Purchase of a laptop KS 24,000
• Other hardware
needed
• Network devices e.g.
router, Ethernet cables
Software expenses Domain hosting fees Ksh 6000

Stationery • Rubbers Ksh 1500


• Pencils
• Pen
• Sharpeners
• Mark pens
Internet With at least 10mbps Ksh 3000

miscellaneous Issues that may arise while the Ksh 3000


project is being undertaken
,during development period
testing training repair and
maintenance
Total : ksh 37500

1.10 Project Scheduling

Table 2: project scheduling

PHASE DURATION TASKS

12
Phase 1 : • Defined project scope
project initiation Defined objectives
8 days • Defined deliverables

Phase 2 : • Collected data from the
hostel manager, employees
Requirements gathering and
29 days students
• Understanding the
user needs
and system
functionality.
Phase 3 : Designed the visual
interpretation to give the
System design 71 days look of the system and its
features.

Phase 4 : • Developed back end.


Coding Adding
System development 78 days • features.

Initial testing of the system
by developers.

Phase 5: 15 days • Performed unit testing on all


features in the system.
Testing and quality control Identified and fix initial
• bugs.

Phase 6: 8 days • Deploy the system to some


of the users like the hostel
Deployment and launching
manager to understand
whether they are impressed
or not.
• Prepare the system for its
production
• Conduct final testing and
user acceptance.

Phase 7 : • Train all the students ,


employees ,the hostel
Training 8 days manager how the system
works and operates

Phase 8 : • System upgrades


Addressing issues that arise
Final deployment and usage Lifetime • time to time in the system.
• Provide updates e.g.
security updates

13
Figure 1 : gantt chart

14
CHAPTER 2: LITERATURE REVIEW

2.1 Introduction

The literature review undertaken aimed to present an overview of the diverse hostel management
systems available and elucidate their various features. Its primary objective was to delve into the
existing body of knowledge concerning the development of hostel management systems. This
was achieved through an examination of research papers, and practical case studies, with the
intent of providing insights into the technological and organizational aspects involved in creating
and implementing effective hostel management systems.

Throughout the review, a comprehensive exploration was conducted into the potential benefits
and challenges associated with these systems. Particular attention was given to understanding
how these systems contribute to the improvement of administrative processes, enhancement of
communication, payment methods, and the fostering of collaboration among various
stakeholders within the hostels.

2.2 Case Studies:

Studies have shown that adoption of digital management systems in hostels have led to
significant improvements in operational efficiency.
Examples of existing hostel management systems supporting this review include:

2.2.1 NavHostel –Hostel management system

It is a system developed by Navtark Solutions Company that provides automated room


allocation, real-time inventory tracking, automated communications and robust security
features.
It is designed to enhance efficiency by automating many manual tasks involved in hostel
management, thereby improving the resident’s experience. This hostel management
system solves a number of the problems listed that the system intended to develop can
solve.
Its features include:
Fees Collection. Collect student’s fees, generate and print receipts, generate fees invoices, view
payments reports, generate student statement, and more.

15
Student Management. Enroll students, get parents details, view/update/delete students. Connect
siblings and parents. Manage the promotion of students.

Staff Management. Capture staff details, update and delete the records, upload and manage
important documents, and group them by departments/sections.

Bulk SMS. Send fees balance alerts and reminders, send general messages to parents,
communicate with your staff via SMS. Get Instant delivery report.

16
Figure 2 : Nav Hostel

17
Figure 3 : Nav Hostel Dashboard

2.2.2 eZee Absolute –hostel management system

It is a hostel management system that handles reservations, channel management, promotions.


It is designed to optimize revenues by adjusting prices based on the occupancy and demands, it
supports multiple demands and it is very suitable for hostel chains.

This system although it does not solve all of the problem listed, for the development of
a new Thika Main Management System, was a perfect case study since it provides
insight on how to book the hostel from anywhere, and how to adjust hostel prices, the
communication chains, and these insights greatly helped in development of a new
system.
The Key operations covered by this system are:
Online admissions with Inquiry Management.
Fees management with Payment Gateway.

18
Figure 4: Ezee Absolute Hostel Dashboard

19
CHAPTER 3: METHODOLOGY

3.1 introduction

Thika Main Hostel System is a system designed to streamline the administrative and
management processes associated with the normal running of the thika main hostel, thereby
improving the efficiency and enhancing the user experience for both the management and
residents of the hostel.
The methodology of developing the Thika Main Hostel Management System involves:

3.2 Research design.

The research design outlines the approach taken to conduct the study. It includes the
approach taken to perform the research. It employs a combination of descriptive and
developmental research designs. The research include methods of analyzing the
acquired data which is done with quantitative analysis to collect numerical data on
hostel operations ,occupancy rates and measurable features and qualitative analysis to
explore experiences and opinions of hostel residents and managers to identify key
requirements and design specifications.

3.3 Requirement gathering

This phase include understanding and documenting the requirements of the Thika
Main Hostel Management System .it includes data collection to understand the
existing system and how to improve it per the user’s specifications. The data
collection methods include:

3.3.1 Primary methods

Interviews.
This style of data collection was among the best and most effective and was
beneficial to the research. All users, however, did not have the privilege of
being interviewed as this technique also proved to be among the most time
consuming. Only the hostel manager and a few students the interviews
involved one to one conversations with the students and management of the
hostel where they were asked questions relating to the hostel system and how
it can be improved and they gave their answers to the interviewer. Some of the
questions asked were like what are the limitations of the current manual
system? The interview was recorded in a full format on a Digital Camera and
also on a piece of paper by the interviewer.

Questionnaires

Almost all proposed users of the said system had the privilege of having submitted
their view via the questionnaire method. A list of different questions for different
users was sent to the users via hard copies and soft copies through whatsapp .Each
question was tailored to the nature and scope of our research. Each user was given

20
a fixed time to fill and submit the questionnaire after which the submission would
not be accepted. This method had its flaws (like some dishonest answers) that
prompted the use of the other methods too. A list of questions on a form had
questions pertaining the management system of the hostel. Example of these
questions include:
Would you like a new system?
Is the existing system tiresome?
Are you okay with the hostel booking process?

Observation
It is a simpler way of collecting data about the hostel since I went to the hostel
physically and observed how the rooms are allocated when new students come
to the hostel, the booking process and other things that I need to develop the
management system. This was much easier and cost effective.

Reporting
This technique was kept open after the Questionnaire and it allowed students
and hostel managers to report anything that they thought could be beneficial to
the success of the research. It was kept open because of the thinking that
maybe some users would be willing to give honest information following the
flaws that originated from the Questionnaire method.

3.3.2 Secondary methods

I reviewed the existing system data and its documentations to identify areas of Improvement.
Information on the Internet
I used the internet to find the secondary data. This is because data was easy to find there and could
be downloaded with a click of a button.

3.4 sampling

Since there is a large number of the students in the hostel and all must be
represented collecting data from each student s tiresome a sample size of about 5
students is used to ensure statically significant results.
Random sampling technique is used to ensure a representative sample of the
hostel resident’s also purposive sampling technique is used to select specific
hostel managers and staff with relevant experience.

3.5 data analysis


This is the process of modeling, and analyzing data to extract insights that support decisionmaking.
We took a look at all the data we had collected from the data collection stage and selectively
analyzed it for further description. The following methods were applied:

21
3.5.1 Qualitative Data Analysis Software
Since the data included qualitative responses (open-ended questions), qualitative analysis software
was used to categorize, code, and interpret text data to uncover themes and patterns.

3.5.2 Descriptive Analysis


Descriptive analysis is a statistical method used to summarize and describe the main features of a
dataset. This technique was used to provide valuable insights into the data collected and helped
stakeholders understand the characteristics and trends within the dataset.

3.6 system development methodology

The study will adopt the System Development Life Cycle (SDLC) agile model,
including planning, analysis, design, implementation, testing, and maintenance
phases. This model is great since it prioritizes on flexibility and customer satisfaction,
and can easily be incremented to meet customer’s specifications. Also it can be
changed where the customers are not satisfied with the end result.

3.7 tools and technologies

Developing the system to be an effective HMS required careful consideration of software tools,
database solutions, and programming languages to ensure scalability, efficiency, and user-
friendliness. The following tools and techniques were used to design and develop the System:

3.7.1 Database Tools


MySQL- a database tool .it was used to manage all the database transactions of the system, to
ensure integrity. Its features, reliability, and extensibility made it suitable for storing and
managing various types of data within a hostel .It also required minimal setup hence reliable and
efficient for the developer.
3.7.2 Programming Languages

HTML. The Hypertext Markup Language or HTML is the standard markup language for
documents designed to be displayed in a web browser. HTML was used to create the various
pages of the application, such as student profiles, class schedules, attendance records, and
more.

CSS. Cascading Style Sheets was used to style the HTML elements, making the system
visually appealing and user-friendly. CSS was be employed to design the layout, colors,
typography, and overall aesthetics of the application. It ensured a consistent and
professional look across all pages and elements.

22
JavaScript. JavaScript is a dynamic scripting language that adds interactivity and
functionality to web pages. In this system, JavaScript was used for tasks such as interactive
calendars. It enhances user experience by providing responsive and engaging features on
the front end.

PHP. Hypertext Preprocessor a server side programming language used for web
development, it was used to develop the back end operations of the system.

XAMPP. A local server package for running php and MySQL .it provided a complete
environment to run the system locally.

3.8 system implementation and testing

This was a critical step to ensure that the system functioned as intended, meets user requirements,
and is free of errors. Comprehensive testing enabled us identify and rectify issues early in the
development process, leading to a more robust and reliable system.

The tests done included:


Unit Testing: Individual components, modules, or functions of the system were tested in isolation
to ensure they work as intended. This was be performed during the coding phase.

Integration Testing: Multiple components were tested together to ensure they interacted
correctly. This helped identify issues that might arise from the integration of various modules.

Functional Testing: The system's functionalities were tested against the defined requirements.
This ensured that users can perform tasks accurately and efficiently.
User Acceptance Testing (UAT): Real users (students, hostel managers) tested the system in a
controlled environment to validate its usability and overall user experience.
Security Testing: The system's security measures, such as user authentication and data protection,
were tested to identify vulnerabilities and ensure sensitive information is safeguarded.

Usability Testing: This assessed the system's user-friendliness and ease of use, ensuring that
users can navigate through the interface and perform tasks intuitively.

23
CHAPTER FOUR: SYSTEM ANALYSIS AND REQUIREMENT
MODELING

4.1 Introduction

System analysis and requirement modeling serve as foundational pillars in the successful
development and implementation this HMS. This chapter delves into the intricacies of the new
system, employing various modeling tools such as flow charts, Data Flow Diagrams (DFDs), and
Use Cases to shed light on its functionality.

Understanding the operations of the new system was very important as it provided a baseline for
implementing it and ensured that the system was accepted by the stakeholders. System analysis
allowed us to dissect the intricacies of the Hostel system, unveiling its strengths and
shortcomings. Additionally, requirement modeling guided the delineation of what the proposed
project must accomplish, so it served as a blueprint for developers and stakeholders for the
successful building of the system.

4.2 System Overview Processes:

The hostel’s new system has automated manual processes that were predominantly managed
through traditional spreadsheets. The Thika Main Hostel System significantly enhances
efficiency, accuracy, and overall management of various facets of daily hostel operations. These
processes encompass various facets of daily hostel operations. The key processes automated
include:

Student Enrollment: In the new Hostel system, student enrollment is seamlessly facilitated
through automated forms, eliminating the need for manual entry into spreadsheets. The system
assigns rooms, and schedules based on predefined criteria, reducing the time and effort
traditionally invested in manual calculations.

24
Financial Management: hostel fees transactions are now seamlessly recorded through the
automated financial management module of the hostel system. This feature eliminates manual
data entry errors.
Online Booking and Payments: students from any point of the earth can book the hostel and pay
automatically using mpesa, airtel money and atm cards online without needing to physically come
to the hostel. Once they book and pay a room is reserved for them.

The new Hostel System represents a paradigm shift in hostel management, replacing manual
workflows with an integrated system that not only reduces the administrative burden but also
enhances the overall effectiveness of hostel operations.

4.3 Data Flow:

To visualize the data flow within the system, I employed Use cases and Data Flow Diagrams. The
information flow is characterized by:

Input: The new hostel system streamlines data input by providing user-friendly interfaces for
students and administrator’s .This allows for efficient and accurate data entry directly into the
system.

Processing: The hostel system automates data processing, eliminating the need for manual
calculations and record-keeping in spreadsheets. Intelligent algorithms within the system handle
tasks such as enrollment, bookings tracking, and financial transactions seamlessly.

Output: The Thika Main Hostel System generates comprehensive receipts, student records, room
records, bookings records and financial summaries automatically. This eliminates the manual
effort involved in extracting information from spreadsheets, ensuring that the output is not only
swift but also error-free. The system provides a centralized and real-time view of data,
contributing to improved decision-making and overall operational efficiency.

4.4 Use Cases:

The main operations in the system revolve around key stakeholders and their interactions with the
system in order to perform their daily tasks:

25
Administrator: Manages student enrollment, ensuring accurate data entry. Administrators also
oversees financial transactions and generates financial reports, manages rooms, notices,
communications, and bookings and keeps records of everything.

Students: Receives notices, books and pays the hostel fees, and receives and sends messages to
the admin who is also the hostel manager .They interact with the system primarily through the
student dashboard.

26
Figure 5: Use case Diagram

27
4.5 Data Flow Diagrams

The Data Flow Diagrams below provide a visual representation of how data flows within the
system, depicting processes, data sources, data destinations, data storage, and the various data
flows between these components

Hostel Hostel management


Management Input
Student System
System

Hostel
Management Add, delete edit,
System Admin Student, and
Bookings

Add, delete, and


Edit Notice,
Employees, room
And messages
Level 0 DFDs

FigureE 6: Student Level DFD

28
Figure 7: Admin Level 1 DFD

29
4.6 System Analysis
4.6.1 Performance Analysis:

Scalability: The system is scalable enough to accommodate future growth in student enrollment
and data volume.

Response Time: For critical functions such as booking trends and gender based analytics, faster
response time is achieved.

Reliability: The system is highly reliable for it minimizes downtime and disruptions in the daily
operations of the hostel.

4.6.2 Security Analysis:

Access Control: Successful Implementation of role-based access control was achieved to restrict
system access based on user roles (administrator and students).

Data Backup: automated SQL backups to prevent data loss.

Error handling: the system displays error messages to users but logs full details in the database.

Secure log in system: users must log in using username and password which is hashed and must
be of a certain length and must have special characters to make it stronger.

4.6.3 Usability Analysis:

User Interface: The user interface is intuitive and user-friendly hence it minimized the learning
curve for end-users.

Real-time Dashboards: The system Included real-time dashboards for quick insights into key
metrics and system performance.

Training: The development team provided training sessions for system users to ensure effective
utilization and maximize productivity.

Support: Established a robust support system to address user queries and issues promptly.

30
4.7 Requirement definitions and specifications for the project

After an analysis of the old system with regard to the weaknesses identified by the users and
what they said they wanted in the new system, the following requirements were identified as
mandatory for the new system:
4.7.1 Functional Requirements

Automation of Routine Tasks. The proposed system presented the opportunity to automate
routine tasks such as data entry, online booking of the hostel, and improved communication in the
hostel.

Benefit: Automation reduced the likelihood of errors, enhanced efficiency, and freed up valuable
time for administrators.

Centralized Information Hub. The new system serves as a centralized information hub,
providing real-time updates and fostering collaboration among administrators and students.

Benefit: Improved accessibility facilitated better communication, leading to a more engaged and
informed hostel community.

Streamlined Financial Management. Implementing an integrated financial management module


which includes M-pesa payments and card payments streamlined fee collection and financial
reporting.

Benefit: Enhanced financial transparency, accuracy, and security contribute to better financial
management and decision-making.

Improved User Experience. Enhancing the user interface and providing adequate training
improved the overall user experience for administrators, students and other stakeholders.

Benefit: A user-friendly system encouraged adoption, reduced resistance to change, and


maximized the system's effectiveness.

31
4.7.2 Non-functional Requirements
• Reliability The system must function as expected all the time
• Availability The system must function properly whenever it is needed
• Performance The system must function in a reasonable amount of time despite fluctuations in
load
• Scalability The system must accommodate more users without disruptions
• Usability The system must be easy to use for all users
• Portability The system must be usable on a wide range of devices

32
CHAPTER FIVE: SYSTEM DESIGN

5.1 Introduction
This chapter explains the overall system architecture, including the database design. It clearly
explains the role of each module and its function to the system.

This chapter aims to serve as a guiding document for readers and stakeholders, facilitating a
deeper comprehension of the intricate design decisions that form the foundation of the
implemented school management system.

5.2 Interface Design


The user interface of the system plays a fundamental role in supporting a positive experience for
users. It incorporates all the visual and interactive components that the admin and students use to
access and interact with the content and tools of the Thika Main Hostel System.

Figure 8: Student Dashboard

33
Figure 9 : Admin Dashboard

5.2 Input design


Input design focuses on creating user-friendly forms, interfaces, and input mechanisms for entering
and processing data within the Thika Main Hostel System platform. The admin and students are
expected to sign up or log in to access the system.

Figure 10: Admin Registration

34
Figure 11: Student Registration form

Figure 12: Admin and Student log in form

35
5.3 Database Design
5.3.1 Conceptual Database Design

In the conceptual database design phase, modeling tools are utilized, specifically Entity
Relationship Diagrams (ERD), to outline a high-level representation of the database structure for
the Thika Main Hostel System. This conceptual model serves as a foundation for organizing and
understanding the essential components of the database.

The entities include:

Users: represents administrator’s e.g. The hostel managers overseeing the hostel management
systems and students. It has the following attributes ID (primary Key), Username, Password,
Role, Created at, gender, email, parents contact, health conditions, student Id, Reset token.

Rooms: Id, room number, gender, capacity, available, price and category.

Payments: Id, student_id, amount, transaction ID and payment date.

Notices: ID, title, content, created at.

Messages: Id, sender id, receiver id, message text, status and time stamp.

Inventory items: id, category id, name, quantity, condition status, room id, and Assigned to.

Inventory Categories: id and name.

Employees: Id, name and position.

Bookings: Id, student id, gender, room number, payment amount, booking date and student name.

5.3.2 The Database Relationships are:

Admin - Student relationship: connects admin and students, one admin can manage multiple
students.
Students – Bookings Relationship: connects students and bookings where one student can book
only once in a month.

36
Admin – Employee Relationship: connects admin and employees, one admin can manage multiple
employees.

Admin – Notices Relationship: connects admin and notices one admin can send multiple notices
to students.

Admin – Messages Relationship: connects admin and messages, one admin can send messages to
multiple student entities.

Student – Messages Relationship: connects students to messages one student can send messages to
one admin alone.

Admin – Bookings Relationship: connects admin to bookings one admin can manage many
bookings entities.

Admin – Payments Relationship: connects admin to payments one admin can manage multiple
payment entities.

Admin – Inventory Relationship: connects admin to inventories one admin can manage multiple
inventories.

37
Figure 13: ER Diagram

38
5.4 Logical Database Design

In logical database design, the conceptual model was translated into a logical model for the Thika
Main Hostel System, specifying tables, fields, primary keys, foreign keys, and other necessary
database constraints. Normalization techniques were also used to ensure data integrity.

The Tables include:

Users table: the fields include: ID (primary Key), Username, Password, Role, and Created at,
gender, email, parents contact, health conditions, student Id, Reset token.

Rooms table: with fields Id (primary key), room number, gender, capacity, available, price and
category.

Payments table: with fields: Id (primary key), student_id (foreign key), amount, and transaction
ID and payment date.

Notices table: with fields: ID (primary key), title, and content, created at.

Messages table: with fields: Id (primary key), sender id, receiver id, message text, and status and
time stamp.

Inventory items table: with fields: id (primary key), category id, name, quantity, condition status,
room id (foreign key), and Assigned to.

Inventory Categories tables: with fields: id (primary key) and name.

Employees table: with fields: Id (primary key), name and position.

Bookings table: with fields: Id (primary key), student id (foreign key), gender, room number,
payment amount, booking date and student name.

39
CHAPTER SIX: SYSTEM IMPLEMENTATION

6.1 Introduction
The system implementation phase was a crucial part of making Thika Main Hostel System a
reality. In this chapter, we'll go over the tools used for coding and testing, our plan for testing the
system, how we did the testing, and the ways we plan to switch to using the new system
seamlessly.

This chapter serves as a compass, delineating the coding and testing tools, the strategic system test
plan, intricacies of testing procedures, and the proposed methodologies for seamless changeover.
This chapter involves ensuring the alignment of the system with envisioned functionalities and
objectives.

6.2 Tools Used for Coding and Testing


In building Thika Main Hostel System, carefully selected tools for coding and testing were used to
ensure a smooth and reliable development process
6.2.1 Coding Tools

HTML. The Hypertext Markup Language or HTML is the standard markup language for
documents designed to be displayed in a web browser. HTML was used to create the various
pages of the application, such as student profiles, class schedules, attendance records, and
more.

CSS. Cascading Style Sheets was used to style the HTML elements, making the system
visually appealing and user-friendly. CSS was be employed to design the layout, colors,
typography, and overall aesthetics of the application. It ensured a consistent and
professional look across all pages and elements.

JavaScript. JavaScript is a dynamic scripting language that adds interactivity and


functionality to web pages. In this system, JavaScript was used for tasks such as interactive
calendars. It enhances user experience by providing responsive and engaging features on
the front end.

PHP. Hypertext Preprocessor a server side programming language used for web
development, it was used to develop the back end operations of the system.
XAMPP. A local server package for running php and MySQL .it provided a complete
environment to run the system locally.

40
6.3 System Test Plan
The System Test Plan outlines the comprehensive strategy for validating the Thika Main Hostel
System in its entirety. This testing phase aims to ensure that the system functions seamlessly,
meeting its specified requirements and delivering a reliable and user-friendly experience.
Objectives
The key objectives of the System Test Plan are as follows:
i. Functional Validation: Confirm that all system functionalities, as outlined in the
requirements documentation, operate as intended.

ii. Performance Evaluation: Assess the system's responsiveness and scalability under
different loads and usage scenarios.

iii. Security Assurance: Verify that adequate measures are in place to safeguard sensitive
data and protect against unauthorized access.

iv. Compatibility Testing: Ensure the Thika Main Hostel System operates smoothly across
various browsers and devices.

v. Usability Assessment: Evaluate the user interface and overall user experience to
guarantee ease of use and accessibility

Scope
The scope of the System Test Plan encompasses the entire Thika Main Hostel System, including
but not limited to:

Student and Admin Management Modules


Bookings Tracking
Communication and Notice Features
Security Protocols and Access Controls

6.4 Testing Approach


The System Testing approach involved a combination of manual and automated testing methods:
Manual Testing: performed hands-on validation using sample data to critical functionalities,
ensuring they align with specified requirements

41
Automated Testing: Automation tools, such as Selenium, were used for repetitive and
regression testing, enhancing efficiency.

User Acceptance Testing (UAT): End-users participated in UAT to assess the system's usability
and validate its alignment with their expectations.

6.5 Test Cases


Security Testing:
Access Control Testing: we ensured that only authorized users had access to sensitive data and
functionalities.

Vulnerability Assessment: We also conducted regular vulnerability assessments to identify and


mitigate potential security risks.

Password Encryption: All passwords are encrypted to ensure security.


Unit Testing:
We tested individual components (functions, classes, modules) in isolation to verify their
correctness.

The tool used was pytest. It is a framework for writing and executing unit tests in a systematic and
organized manner.

Integration Testing:
Component Integration: Verified that different components of the system worked seamlessly
together.

Data Flow Testing: Ensured proper flow of data between interconnected modules.
The tool used for this testing was Selenium.
Usability Testing:
User Feedback: Gathered feedback from potential end-users to assess the system's user
friendliness.

User Workflows: Tested common user workflows to ensure intuitive navigation and ease of use.
Functionality Testing:
We verified that each system requirement was implemented correctly.
Positive and Negative Testing: Checked expected behavior under normal conditions and
validated error-handling mechanisms.

Manual Testing: Conducted manual testing for critical functionalities, ensuring alignment with
specifications.

42
UI Testing:
Responsive Design Testing: Ensured that the user interface remained functional and aesthetically
pleasing across different devices and screen sizes.

Cross-Browser Testing: Validated consistent UI rendering on various web browsers.


Database Testing:
Data Integrity: We ensured that data stored in the database maintained accuracy and consistency.
Data Migration Testing: Validated the correctness of data migration processes during system
upgrades.

Table 3: Test cases

Test Case Description Test Case Step Expected Results Status


Type
Functionality Test student Initiate the student Student is successfully Pass
Test enrollment process. enrollment process, added to the system, with
providing valid details. accurate data.

Test removing of Admin can view all Delete the right entity Pass
student from students and deletes from the hostel. They can
hostel. whoever he wishes to. no longer login.

Usability Test Evaluate user login Log in with valid User seamlessly navigates Pass.
experience. credentials, navigating through the system, and
through system
the interface is intuitive.
features.

Users can use the Log in using a phone, The system should be Pass.
system from tablet, and desktop responsive and adjust
different devices computers.

according to the screen


sizes.

Security Test Verify password Attempt to create a Password creation is Pass.


rules are working new password that rejected, system enforces
violates rules. password rules.

Verify security Attempt to login User authentication Pass.


breaches. without proper failed.
credentials.

43
Verify role based admin trying to log in Login fails. Pass.
Access. to students portal
Database Test Verify data Add, update, and delete Database records Pass.
integrity in the student records while accurately reflect
changes made, and no
student database. monitoring database
data integrity issues are
integrity. observed.

Test Interaction Enroll a student or Enrollment is Pass.


between teacher to school and successfully reflected in
enrollment and see if the changes are the database and user can
database integrity. reflected and if they log in.
can login.

6.7 Proposed Change over Technique


Here, we'll talk about how we plan to switch from the old system to our new one. This involves
moving data, teaching people how to use the new system, and making sure there's help available if
anyone needs it. We want the transition to be smooth. In a nutshell, this chapter is about how we
made our Thika Main Hostel System come to life, making sure it works well, and planning how
we'll switch to using it.

The proposed technique is Parallel Adoption Description:

The Parallel Adoption technique involves running both the existing manual system and the new
Thika Main Hostel System concurrently for a defined period. This approach aims to minimize
disruptions and facilitate a gradual transition from the manual processes to the automated system.

Implementation Steps:
Data Migration: We begin by transferring a subset of data from the manual system to the new
Thika Main Hostel System. This data included non-sensitive information, such as student details.

44
Parallel Operation: Run the manual system and the new system side by side. Users will have
access to both systems during this phase.

User Training: Conduct comprehensive training sessions for all users, emphasizing the features
and benefits of the new system. Provide user guides and tutorials to support the learning process.

Gradual Transition: Encourage users to gradually shift their daily operations to the new system.
Monitor user engagement and address any concerns or challenges promptly.
Feedback Collection: Establish channels for feedback from users regarding their experience with
the new system. Use this feedback to make continuous improvements during the parallel
operation.

Advantages:
Smooth Transition: Users can gradually adapt to the new system without abrupt changes,
minimizing potential resistance.

Risk Mitigation: Operating both systems in parallel allows for real-time issue identification and
resolution.
Challenges:
Resource Intensive: Maintaining and supporting two systems simultaneously can be
resourceintensive.

45
CHAPTER SEVEN: LIMITATIONS, CONCLUSIONS, AND
RECOMMENDATIONS

7.1 Limitations
During the development and research phase of this Hostel system, certain limitations were
encountered. It is crucial to acknowledge these challenges to provide a comprehensive
understanding of the project's scope and potential areas for future improvement. The identified
limitations include:

Accessibility: Ensuring accessibility for all users, including those with disabilities, is an ongoing
challenge. Efforts to make the platform compliant with accessibility standards are ongoing.
Financial Constraints: Budget constraints posed challenges in acquiring additional resources and
tools that could have further enhanced the functionality and user experience of the school
management system. Adequate financial resources are essential for optimal system development
and deployment.

User Cooperation: Encountering resistance and limited cooperation from end-users during the
requirements gathering, testing and implementation phases hindered the collection of
comprehensive feedback. This affected the ability to tailor the system precisely to the users'
needs and preferences.

Integration Challenges: Difficulties in integrating the hostel system with existing system data
and all the applications of the hostel.

User Adoption: Resistance to Change: Some users, have demonstrated resistance to adopting the
new system, affecting its successful integration into daily workflows.

7.2 Recommendations
In light of the identified limitations and the overall findings, we propose the following
recommendations to enhance the TMHS and guide future endeavors:

Bulk SMS sending: bulk SMS messages sending to students to remind them of fee payments in
case some of the students don’t regularly access the system.

46
Report generations: In future, the system will be able to generate reports like print financial and
bookings reports after some time.

AI integration: in future AI may be added to the chatbot to improve the chatbot efficiency. Also
AI should be added to the system to help hostel managers predict bookings and gender
distribution based on the previous records.

Extended Testing Period: Allocate a more extensive testing period to thoroughly evaluate the
system's performance under various conditions. This will facilitate the identification and
resolution of potential issues that may arise during prolonged usage.

Regular Security Audits: Conduct regular security audits to identify and address potential
vulnerabilities in the system. This proactive approach will help safeguard sensitive data and
ensure compliance with data protection standards.

Cloud Integration: Explore cloud integration options to enhance system accessibility, scalability,
and reliability. Cloud-based solutions can facilitate remote access, data storage, and efficient
system maintenance.

Regular Security Audits: Conduct regular security audits to identify and address potential
vulnerabilities in the system. This proactive approach will help safeguard sensitive data and
ensure compliance with data protection standards.

Cloud Integration: Explore cloud integration options to enhance system accessibility, scalability,
and reliability. Cloud-based solutions can facilitate remote access, data storage, and efficient
system maintenance.

User Training and Engagement: Implement comprehensive user training programs and
engagement strategies to encourage active participation and collaboration, overcoming potential
resistance from end-users.

Continuous Improvement and maintenance: Establish a system of continuous improvement,


incorporating user feedback and emerging technologies to ensure the TMHS remains adaptive and
relevant over time.

7.3 Conclusion

In summary, our journey from planning to making the Thika Main Hostel System reality has been
a mix of learning, creating, and making things work in real life. This part ties together what was
thought at the start, what was discovered in research, and what actually happened when we put

47
our system into action. It shows why the new Thika Main Hostel System is important in the daily
activities of Thika Main Hostel.

The system works well because it follows the ideas that were started with and what was learned
from research. The good results we saw in real situations confirm that the methods and choices
were right. The system is not just a theory; it really helps in everyday situations in the Hostel.

By looking at how the system works in reality and real world data, it was found it can solve many
problems. It makes hostel tasks easier, improves communication, and makes things run smoother.
The system isn't just for now, it's designed to keep helping the hostel in the long run.

48
REFERENCES

JOURNAL ARTICLES

Akinyi, J (2018). The Role of Technology in Improving Hostel Management in Kenyan


Universities .journal of Higher Education Management , 5(2), 45-56.

Omondi, P. (2019). Adoption of Hostel Management Systems in Kenyan Public


Universities: Challenges and Opportunities. East African Journal of Education and Social
Sciences, 10(3), 89-102.
Wanjiru, M. (2020). Enhancing Student Satisfaction through Efficient Hostel Management
Systems: A Case Study of Kenyatta University. African Journal of Education Studies,
12(1), 112-125.
Mwangi, T.9 (2021). Evaluating the Effectiveness of Hostel Management Systems in Kenya:
A Focus on Room Allocation and Fee Management. Journal of Educational Administration
and policy studies, 15 (4), 130-144.
O Shoewu, SA Braimah, O Duduyeni (2016): Design and Implementation of Hostel
Management Systems. The Pacific Journal of Science and technology .17 (2) 189196.
Kelly Oluoch, Miriam M Ndunge, Alloys W Musuya (2019). The influence of availability
of college hostel accommodation facilities on students’ academic performance in Kenya
medical training colleges in western Kenya region. African Journal of education and
practice. 4(1), 58-72.
WEBSITES
College Hostel Management Software by Initio (2010)
Hostel management system retrieved from www.ezeeabsolute.com

BOOKS
Bryman, A. (2016). Social research methods (5th ed.). Oxford University Press.

49
APPENDICES

Appendix 1: User Manual


The following instructions are for machines running on Microsoft Windows operating system
versions windows 7, windows 8, windows 8.1 or windows 10.

• Install XAMP server with PHP version 5.5.12 or above and MySQL version 5.6.17 or
above on the windows machine.

• Open a browser window and type http://127.0.0.1/ ThikaMainHostelSystem/index.php in


order to load the home page of the application on the browser window.

• Click on the ‘get started’ link on the home page at the top of the page in order to register as
a voter and log in.

• To register as a hostel student click on the register button, enter your details and click
register button, you will have successfully registered.

• Type http://127.0.0.1/ThikaMainHostelsystem/login.php into the address bar to oversee all


hostel managements of the hostel.

• After registering, the student logs in and is directed to the dashboard they can explore the
dashboard where there is book hostel, contact us and log out.

• For the admin log in and explore the dashboard by clicking on the various descriptive links
to perform different actions on the system.

• Click the ‘log out’ link on any page you are currently in to end your current session.

Appendix 3: Project Schedule Table

PROJECT SCHEDULE TABLE

50
PHASE DURATION TASKS

Phase 1 : • Defined project scope


Defined objectives
project initiation 8 days • Defined deliverables

Phase 2 : • Collected data from the
hostel manager, employees
Requirements gathering and
29 days students
• Understanding the
user needs
and system
functionality.
Phase 3 : Designed the visual
interpretation to give the
System design 71 days look of the system and its
features.

Phase 4 : • Developed back end.


Coding Adding
System development 78 days • features.

Initial testing of the system
by developers.

Phase 5: 15 days • Performed unit testing on all


features in the system.
Testing and quality control Identified and fix initial bugs.

Phase 6: 8 days • Deploy the system to some


of the users like the hostel
Deployment and launching
manager to understand
whether they are impressed
or not.
• Prepare the system for its
production
• Conduct final testing and
user acceptance.

Phase 7 : • Train all the students ,


employees ,the hostel
Training 8 days manager how the system
works and operates

Phase 8 : • System upgrades


Addressing issues that arise
Final deployment and Lifetime • time to time in the system.
usage

51
• Provide updates e.g.
security updates

Appendix 4: Project budget

The following table shows the project budget by considering all requirements. This includes
hardware, software and any services paid for during the project period. It also includes the day to
day costs for the researcher.

TASK DETAILS AMOUNT


Purchase of hardware • Purchase of a laptop KS 24,000
• Other hardware
needed
• Network devices e.g.
router, Ethernet cables
Software expenses Domain hosting fees Ksh 6000

Stationery • Rubbers Ksh 1500


• Pencils
• Pen
• Sharpeners
• Mark pens
Internet With at least 10mbps Ksh 3000

miscellaneous Issues that may arise while the Ksh 3000


project is being undertaken
,during development period
testing training repair and
maintenance
Total : ksh 37500

Appendix 5: Questionnaire Questions


Would you like a new system?
Is the existing system tiresome?
Are you okay with the hostel booking process?

52
Appendix 6: Sample system codes
HTML interface codes

<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Thika Main Hostels</title>

<link rel="stylesheet" href="CSS/index.css">


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

</head>
<body>

<!-- Navigation Bar -->


<nav class="navbar">

<ul class="nav-links">
<li><a href="#home" class="active">Home</a></li>
<li><a href="#facilities">Facilities</a></li>
<li><a href="#gallery">Gallery</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#location">Location</a></li>
<li><a href="chatbot.php">Chatbot</a></li>
</ul>

<div class="menu-toggle">&#9776;</div>

</nav>

53
<!-- Welcome Section -->
<header id="home" class="welcome">
<h1>Welcome to Thika Main Hostels</h1>
<p>Your ideal student accommodation with modern facilities.</p>
<a href="login.php" class="signup-btn">Get Started</a>
</header>

</body>
<!-- Facilities Section -->
<section id="facilities" class="facilities">
<h2>Facilities We Offer</h2>
<div class="facility-list">
<div class="facility">
<i class="fas fa-bed"></i>
<h3>Comfortable Rooms</h3>
</div>
<div class="facility">
<i class="fas fa-wifi"></i>
<h3>Free WiFi</h3>
</div>
<div class="facility">
<i class="fas fa-tshirt"></i>
<h3>Laundry Services</h3>
</div>
<div class="facility">
<i class="fas fa-shower"></i>
<h3>Clean Bathrooms</h3>
</div>
<div class="facility">
<i class="fas fa-utensils"></i>
<h3>Dining Area</h3>
</div>
<div class="facility">
<i class="fas fa-shield-alt"></i>
<h3>24/7 Security</h3>
</div>
</div>
</section>
<!-- Gallery Section -->
<section id="gallery" class="gallery">
<h2>Our Hostel Gallery</h2>
<div class="gallery-grid">
<img src="images/image1.jpg" alt="Hostel Room">
<img src="images/image2.jpg" alt="Common Area">
<img src="images/image3.jpg" alt="Dining Area">

54
<img src="images/image4.jpg" alt="Laundry Room">
<img src="images/image5.jpg" alt="Study Area">
<img src="images/image6.jpg" alt="Security Entrance">
</div>
</section>
<!-- Contact Us Section -->
<section id="contact" class="contact">
<h2>Contact Us</h2>
<p>Get in touch with us on social media:</p>
<div class="social-icons">
<a href="https://wa.me/0746549240" target="_blank"><i class="fab fa-whatsapp"></i> WhatsApp</a>
<a href="https://www.instagram.com/simplyruth_?igsh=dTAzNW12cHQ5Y3Zo" target="_blank"><i
class="fab fa-instagram"></i> Instagram</a>
<a href="https://www.facebook.com/share/1B2RRcP9cD/" target="_blank"><i class="fab
fafacebook"></i> Facebook</a>
</div>
</section>
<!-- Location Section -->
<section id="location" class="location">
<h2>Our Location</h2>
<p>Find us on the map:</p>
<div class="map-container">
<iframe
src="https://www.openstreetmap.org/export/embed.html?bbox=37.0867%2C-1.0508%2C37.0887%2C-
1.0488&layer=mapnik&marker=-1.0498374%2C37.0877246"
width="100%" height="300"
style="border:0;">
</iframe>
</div>
</section>

</html>
<?php include "includes/footer.php"; ?>

Users registration codes

<?php
session_start();
include "includes/header.php";
include 'database/db.php';

55
error_reporting(E_ALL);
ini_set('display_errors', 1);

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$username = trim($_POST['username']);
$password = trim($_POST['password']);
$role = $_POST['role'];
$email = trim($_POST['email'] ?? '');

// Validate password strength


if (!preg_match('/^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/',
$password)) {
echo "Error: Password must be at least 8 characters long and include an uppercase letter, a lowercase
letter, a number, and a special character."; exit();
}

// Check if email already exists


$stmt = $conn->prepare("SELECT COUNT(*) AS count FROM users WHERE email = ?"); $stmt-
>bind_param("s", $email);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_assoc();
$email_count = $row['count'];
$stmt->close();

if ($email_count > 0) {
echo "<script>alert('Error: This email is already registered.');
window.location.href='register.php';</script>"; exit();
}

// Hash password
$hashed_password = password_hash($password, PASSWORD_DEFAULT);

// Restrict admin registration to one user


if ($role == 'admin') {
$result = $conn->query("SELECT COUNT(*) AS admin_count FROM users WHERE role = 'admin'");
$row = $result->fetch_assoc();

if ($row['admin_count'] > 0) {
echo "Error: Only one admin can be registered.";
exit();
}

56
}

// Student-specific fields
$gender = $_POST['gender'] ?? null;
$parents_contacts = $_POST['parents_contacts'] ?? null;
$health_conditions = $_POST['health_conditions'] ?? null;

// Insert user into database

57
$stmt = $conn->prepare("INSERT INTO users (username, password, role, gender, email, parents_contacts,
health_conditions)
VALUES (?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("sssssss", $username, $hashed_password, $role, $gender, $email, $parents_contacts,
$health_conditions);

if ($stmt->execute()) {
$_SESSION["login"] = "Registration successful";
header("Location: login.php"); exit(); } else {
echo "Error: " . $conn->error;
}

$stmt->close();
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Register</title>
<link rel="stylesheet" href="css/register.css">
<script>
function toggleStudentFields() {
const role = document.getElementById('role').value;
document.getElementById('student-fields').style.display = (role === 'student') ? 'block' : 'none';
}

function validatePassword() { const password =


document.getElementById('password').value; const errorMessage =
document.getElementById('password-error');
const regex = /^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;

if (!regex.test(password)) {
errorMessage.innerText = "Password must be at least 8 characters, include uppercase, lowercase,
number, and special character."; return false;
} else {
errorMessage.innerText = "";
return true;
}
}
</script>
</head>
<body>

58
<div class="form-container">
<form method="POST" action="register.php" onsubmit="return validatePassword()">
<h2>Thika Main Hostel</h2>

<label for="username">Username:</label>
<input type="text" name="username" required>

<label for="password">Password:</label>
<input type="password" name="password" id="password" required pattern="(?=.*[A-
Z])(?=.*[a-z])(?=.*\d)(?=.*[@$!%*?&]).{8,}"
title="Must be at least 8 characters, include uppercase, lowercase, number, and special
character." onkeyup="validatePassword()">
<small id="password-error" style="color: red;"></small>

<label for="role">Register As:</label>


<select name="role" id="role" onchange="toggleStudentFields()" required>
<option value="admin">Admin</option>
<option value="student">Student</option>
</select>

<!-- Student-specific fields -->


<div id="student-fields" style="display: none;">
<label for="gender">Gender:</label>
<select name="gender">
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>

<label for="email">Email:</label>
<input type="email" name="email" maxlength="255" placeholder="Enter your email"
required>

<label for="parents_contacts">Parent Contact:</label>


<input type="text" name="parents_contacts" maxlength="15" placeholder="Enter your parent's
contact" required>

<label for="health_conditions">Health Conditions:</label>


<textarea name="health_conditions" rows="3" placeholder="Describe any health
conditions"></textarea>
</div>

59
<button type="submit">Register</button><br>
<p>Already have an account? <a href="login.php">Login here</a></p>
</form>
</div>
</body>
</html>

60

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy