Hostel - Management - System 20
Hostel - Management - System 20
Hostel - Management - System 20
ON
BACHELOR OF TECHNOLOGY
IN
DATA SCIENCE
Submitted by
GANAGAVARAPU CHANDU (20JK1A4406)
PITTALA PRASANNA KUMAR (20JK1A4410)
YANAMADALA-522019 2020-2024
CERTIFICATE
This is to certify that this project work titled “Hostel Management System Using Python”
is the Bonafide work Gangavarapu Chandu (20jk1a4406) ,Pittala Prasanna Kumar
(20jk1a4410) ,Anivireddy Gnana Satyaveni (20jk1a4401) who carried out the work under
supervision and submitted in the partial fulfilment of the requirements for the award of the
degree of Bachelor of Technology in Computer Science & Engineering from JNTU-
Kakinada during the academic year 2022-2023.
External Examiner
We take this occasion to thank God, almighty for blessing us with his grace and
taking our endeavor to a successful culmination. We extend our sincere and heartfelt
thanks to our esteemed guide, ESWAR, for providing us with the right guidance and
advice at crucial junctures and for showing me the right way.
We extend our sincere thanks to our respected Head of the division, Mr
BULLIBABU, for allowing us to use the facilities available. We would like to thank
the other faculty members also, at this occasion. Last but not least, we would like to
thank our friends and family for the support and encouragement they have given us
during the course of our work.
ABSTRACT 10
1. INTRODUCTION 11
1.1 PROJECT AIMS AND OBJECTIVES 11
2. SYSTEM ANALYSIS 14
2.1 FEASIBITY ANALYSIS 14
2.2 ALGORITHMS 16
3. SYSTEM DESIGN 20
3.1 TABLE DESIGN 20
3.2 DATA FLOW DIAGRAM’S 22
4. SYSTEM IMPLEMENTATION 28
4.1 MODULE DESCRIPTION 28
4.2 SCREEN SHOTS 40
5. SYSTEM TESTING 44
5.1 UNIT TESTING 44
5.2 INTEGRATION TESTING 46
6. CONCLUSION & FUTURE SCOPE 48
7. REFERENCES 50
ABSTRACT
During the development of this project I have visited the hostel administration for
collection of data and analyze their problem. We have tried to fulfill most of the desire of
the hostel requirements but due to the lack of time some of the requirements were solved.
The problem analyzed for the hostel were
• Check in/ checkout system for students to keep records of room that have been
reserved.
• Room Reservation system to keep records of the Students and find their room
number.
• To generate report of each room reserved.
Among these problems we have choose the Mark sheet problem and try to make the
project to display Mark sheet of the students with printing facility. The user can also save
record of total number of students in the hostel, information about their faculty and course
the study. We have also attached the form to keep simple record of the teachers.
This software is totally secure with password protected facility. The administrator can
create new user, update them when required and delete them if necessary. The
administrator staff can utilize all the facility provided by the software and all the guest
staff can get some of the facility.
This software also provides the facility to create backup of the database which will help to
retrieve data when the accidental loss in the original database happen.
CHAPTER 1
With the advancement of technology, application areas of computer are rising day by day.
Every sector desires its procurement for fast accurate and automated operations. Therefore
different program are developed to meet the requirement of various types of users i.e.
related to any field.
In terms of security this software is totally secure as it doesn't give access to unauthorized
user as the username and password facility is provided.
I chose Hostel management software as the system seemed simple and easy to use. During
its development we realized that we needed software that may help to manage hostel
activities and various other adjustments.
During this project development, I visited different hostels such as hostel Skyplane ,hostel
top in Jomo Kenyatta University etc and analysis the difficulties of administrative group in
their hostel transaction and provide such solution which may solve their desire problem. I
also ask them about how their activities are operated day to day. I also discuss what is the
best solution of this problem.
Even though I have tried my best effort in making the system error free but some
errors may have crept into it. As this is my first project or system development in
visual basic we have tried my best to make it free from limitations, and maybe I’m
successful. The limitation on the project is the lesson for me to improve it. During
my system development on this project I have faced many problems in testing,
coding, debugging and implementing some rules and regulation.
S.N Details Rs
.
1 Computer (Laptop) N/a
5 Miscellaneous 2,500
Total 6,500
Cost
Operating Feasibility
Feasibility analysis which is necessary to check the manpower viability. It helps to find
whether the existing manpower can handle the new system effectively or not.
3. Password is case-sensitive.
2.2 Algorithm
Step1: Start
Step2: Select User Name
Step3: Enter password
Step4: Click on Login button
If (User ID) and (Password) is Valid then
Unload the user form from memory
and Load and show MDI Main
form.
Else
Display the message “Username and Password
doesn't match” Go to Step2
Step5: Stop
Algorithm for Adding New User
Step1: Start
Step2: Go to system > manage user
Step3: Enter the administrative password to carry out the operation.
Step4: Click on Add New User and a field appears,
Step5: Enter new User name, Password, Confirm Password.
Step6: Click on save button for adding user and cancel button for cancelling operation.
Step7: If all condition remains true then print message “Username Added”,End.
Step1: Start
Step2: Click on the user’s record from the list whom you want to Delete
Step3: Click on the Delete button then print the message “Do you really want to delete this
user”
Step4: If click on yes the user will be deleted
If click on no the operation will be cancelled
Step6: End
Step1: Start
Step2: Go to Customer > New Room Reservation
Step3: Click on Delete Button of the form
Step4: Enter the Reservation Number which you want to delete.
Step5: click on Ok button to delete record or Cancel button to cancel the operation
Step6: If clicked Ok
Print the message “Record Deleted successfully”. And it deletes the record
from the database Else program terminates to main form.
Step7: Stop.
Step1: Start.
Step2: Open Main form >Tools >Database Backup.
Step3: The form opens and asks the user to give the path.
Step4: Click on Ok to create backup or Cancel to cancel operation.
If Ok button is the program creates a backup in the specified path.
Else the program terminates to the previous form.
CHAPTER 3
Admin table
Records table
Student table:
Visitorrecords table
Enter Password
Is Username and NO
password Valid?
Yes
Stop
Yes
Is Record exists?
Print message
NO “Record exists”
Yes
Stop
Yes
Is username exists?
Is Password = NO
confirm password
Yes
Stop
Start
Is username NO
exists?
Stop
Start
Yes / No NO
?
Yes
Stop
Start
Yes
Is Room Vacancy
exists?
Stop
cursor.close()
otp=genotp()
subject='thanks for register'
body=f'use this otp
register{otp}'
sendmail(email,subject,body)
return
render_template('otp.html',otp=otp,userid=userid,username=username,password=pass
word,email=email) else:
flash('Invalid college code')
return
render_template('registration.html')
return
render_template('Registration.html')
@app.route('/otp/<otp>/<userid>/<username>/<password>/
<email>',methods=['GET','POST']) def
otp(otp,userid,username,password,email):
if request.method=='POST':
uotp=request.form['otp']
if otp==uotp:
cursor=mysql.connection.cursor()
cursor.execute('insert into admin values(%s,%s,%s,%s)',
(userid,username,password,email)) mysql.connection.commit()
cursor.close()
return
redirect(url_for('login'))
else:
flash('Wrong
otp') return
render_template('otp.html',otp=otp,userid=userid,username=username,password=password,
email=email)
@app.route('/
login') def
login():
if
session.get('user')
:
cursor=mysql.connection.cursor()
cursor.execute('SELECT userid,password from admin')
books=cursor.fetchall()
cursor.close()
return render_template('Admin-login.html')
@app.route('/
logout')
def logout():
if session.get('user'):
session.pop('user')
return
redirect(url_for('index'))
else:
flash('already logged out!')
return redirect(url_for('index'))
@app.route('/
validate',methods=['POST'])
def validate():
userid=request.form['userid']
password=request.form['password']
cursor=mysql.connection.cursor()
cursor.execute('SELECT userid,password from admin')
data=cursor.fetchall()[0]
userid=data[0]
@app.route('/delete/<id>')
def delete(id):
std_records=cursor.fetchall()
print(std_records)
cursor.close()
std_records=cursor.fetchall()
print(std_records)
cursor.close() if
request.method=='POST':
cursor=mysql.connection.curs
or()
Id=request.form['empCode']
today=date.today()
day=today.day
month=today.month
year=today.year
date_today=f'{year}-{month}-{day}'
Name=request.form['name']
section=request.form['section']
roomno=request.form['roomno']
mobileno=request.form['mobileno']
cursor.execute('select count(*) from records where Id=%s and date=
%s',[Id,date_today]) count=int(cursor.fetchone()[0])
if Id=="" or Name=="" or section=="" or roomno=="" or
mobileno=="": flash('Select The student Id first')
elif count<=1:
flash('The student already gone outside')
else:
cursor=mysql.connection.cursor()
cursor.execute('insert into
records(Id,Name,Section,Roomno,moblieNumber,date) values(%s,%s,%s,%s,%s,
%s)',[Id,Name,section,roomno,mobileno,date_today])
mysql.connection.commit()
cursor.execute('SELECT * from records')
std_records=cursor.fetchall()
cursor.close()
return render_template('Check out
page.html',data1=data1,data=data,details=details,std_records=std_records)
@app.route('/checkoutupdate/
<date>/<id1>')
@app.route('/Delete/<s')
def Delete(sid):
cursor=mysql.connection.cursor()
cursor.execute('Delete from visitor where sid=%s',[sid])
mysql.connection.commit()
cursor.close()
flash('student delete
successfully')
return redirect(url_for('Visitorrecord'))
@app.route('/Update/
<sid>',methods=['GET','POST'])
def Update(sid):
cursor=mysql.connection.cursor()
cursor.execute('select * from visitor where
sid=%s',[sid]) data=cursor.fetchone()
if request.method=='POST':
sid=request.form['sid']
visitorname=request.form['visitorname']
visitormobile=request.form['visitormobile']
roomno =request.form['roomno']
cursor.execute('Update visitor set visitorname=%s,visitormobile=
%s,roomno=%s where sid=%s',[visitorname,visitormobile,roomno,sid])
mysql.connection.commit()
return redirect(url_for('Visitorrecord'))
return render_template('visitorupdate.html',data=data)
@app.route('/Checkoutupdate/
<date>/<id1>')
@app.route('/
forgetpassword',methods=['GET','POST'])
def forget():#after clicking the forget
password
if request.method=='POST':
userid=request.form['userid']# store the id in the rollno
cursor=mysql.connection.cursor()#connection to mysql
cursor.execute('select userid from admin')# fetch the rollno data in the table
students data=cursor.fetchall()#fetching all the rollno data and store it in the
"data" variable
if(int(userid),) in data:# if the given rollno of the user is present in tha database-
>data
cursor.execute('select email from admin where userid=%s',[userid])#it fetches
email related to the rollno data=cursor.fetchone()[0]#fetch the only one email
related to the rollno
print(data)
cursor.close()
subject=f'Reset Password for {data}'
body=f'Reset the password using-
{request.host+url_for("createpassword",token=token(userid,120))}'
sendmail(data,subject,body)
flash('Reset link sent to your mail')
return
redirect(url_for('login'))
else:
return 'Invalid user id'
s=Serializer(app.config['SECRET_KE
Y']) userid=s.loads(token)
['username']
if request.method=='POST':
npass=request.form['npassword']
cpass=request.form['cpassword']
if npass==cpass:
cursor=mysql.connection.cursor()
cursor.execute('update admin set password=%s where
userid=%s',[npass,userid]) mysql.connection.commit()
return 'Password reset Successfull'
else:
return 'Password mismatch'
return
render_template('newpassword.html')
except Exception as e:
print(e)
OUTPUT SCREENS
First of all, welcome to our portal. Here is our portal to solve the grievances of
students.
Here students have to register their details after registration (he/she) to the
portal.
ADMIN REGISTRATION:
ADMIN LOGIN:
CHAPTER 5
GUNTUR ENGINEERING COLLEGE 43 HOSTEL MANAGEMENT SYSTEM
SYSTEM TESTING
The aim of the system testing process was to determine all defects in our
project .The program was subjected to a set of test inputs and various
observations were made and based on these observations it will be decided
whether the program behaves as expected or not. Our Project went through two
levels of testing
1.Unit testing
1. integration testing
Test For the admin moduleTesting admin login form-This form is used for log in of
administrator of the system.In this we enter the username and password if both are
correct administration page will open other wise if any of data is wrong it will get
redirected back to the login page and again ask for username and password
Test for Student login Form-This form is used for log in of Student .In this we enter
thelibraryid, username and password if all these are correct student login page will
open other wise if any of data is wrong it will get redirected back to the login page
and again ask for libraryid, username and password.
Test for account creation- This form is used for new account creation when student
does not fill the form completely it asks again to fill the whole form when he fill the
form fully it gets redirected to page which show waiting for conformation message
as his data will be only added by administrator after verification.
3Test for teacher login module-
Test for teacher login form- This form is used for logg in of teacher .In this we enter
the username and password if all these are correct teacher login page will open other
wise if any of data is wrong it will get redirected back to the login page and again
ask for username and password
.The primary objective is to test the module interfaces in order to ensure that
no errors occur when one module invokes the other module.
The test cases involved are whether valid password and name are entered
or invalid name and password entered.
Registration form:
The test cases are checking whether all details are relevant and are not or check
whether improper data/empty data if any entered.
Test cases are if the required credential are only be retrieved/edited if the
desired input for a forgotten field are correct or not
This project is small package which includes different categories as well as having all
possible features. We have expected that it will be helpful to the, customers as well as
Administrative member.
We will improve this project in future with online room reservation system and also
improve in security by providing a magnetic coated card to permanent students for
automatic check in and check out.
We are waiting for your best suggestion and encouragement which could make us improve
the future programming much better than the one we have carried out.
Conclusion
The software development although is a very difficult task but it can be carried out
successfully with the effort of my work. After the completion of this project we learnt
different things about software and its development. I also learnt to work in a group and
realize its importance.
Thus this project can be a guideline for the beginners and can be example for the
development of a small program.
CHAPTER 7
REFERENCES