You are on page 1of 155

Department Of

Computer Science
UBIT

University Of Karachi

BLOOD FINDER (Web Application)


A PROJECT REPORT
Submitted by

ABDUL BARI (EP#1250001)


FARHAN RIFFAT (EP#1250013)
MUHAMMAD HASAN SAROSH (EP#1250094)
Of

BACHELOR OF SCIENCE
In

SOFTWARE ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE

UNIVERSITY OF KARACHI
Project Supervisor: Sir Muhammad Saeed

Preface
1

About This Book


This report provides an extensive coverage of our project named Blood
Finder. This book is primarily intended for those who wants to donate their
blood when people need it.
An accessible, inclusive society is a strong society. Technologies that welcome everyone,
everywhere, send a powerful message to each individual that we are all connected, and that our
contributions are more valuable when they are more widely harvested and shared.

ACKNOWLEDGMENT

First and foremost, we would like to thank our Almighty ALLAH, for providing us the strength, courage
of conviction and the strong sense of dedication to our project that enabled us to take it to the level that it
has achieved today. Undoubtedly, we wouldnt have been now here, if it weren't for His Mercy and
Blessings.

To our family, thank you for letting us do what we want to do, supporting out decisions as crazy as they
may be. You are always there for us. Our deepest love and gratitude goes to our fathers and mothers who
played such a vital role all through our life by always placing our interests ahead of theirs. This project
work is dedicated to our parents, thank you for seeing us through every step of the way, for praying for us
and with us during times of trouble, and for rejoicing with us over very little triumph. During our studies
our family constantly provided us the hope that we needed to complete my higher education. Also thanks
to all other member of our family and friends whose love and prayers are with us all the time.

This Work would have been impossible without the copious amounts of help, patience, and encouragement from
our kind supervisor Sir Muhammad Saeed. We would like to thank him for teaching us so much and for
inspiring us with the example of hard work, providing great help and key information throughout the time
required for the completion of this project report.

DECLARATION
We hereby declare that this project report is based on our original work except for citations and
quotations which have been duly acknowledged. We also declare that it has not been previously
and concurrently submitted for any other degree or award at University of Karachi.

Name: Abdul Bari


Name: Farhan Riffat

Signature ________________
Signature ________________

Name: Muhammad Hasan Sarosh Signature ________________

CERTIFICATE

I certify that this project report entitled Blood Finder was prepared by Abdul Bari, Farhan
Riffat and Muhammad Hasan Sarosh has met the required standard for submission in partial
fulfillment of the requirements for the award of BS in Software Engineering at University of
Karachi.

Approved by,
Signature: _________________________
Supervisor: Sir Muhammad Saeed
Date: _________________________

INTRODUCTION OF GROUP MEMBERS


ABDUL BARI
is web developer. He plays an important role in the development of this software. He is a student
of software engineering department of UBIT Karachi University and currently working as a
trainee developer at RIKSOF software house.
In this project the basic responsibilities include: developing the web interface by
working in part with each team member as the team member makes advances in his work.

FARHAN RIFFAT
is a Front-End. He is a student of software engineering department of UBIT Karachi University
and working as a trainee UI/UX developer at RIKSOF software house. He plays an important
role in the development of this software. He resolves to find a UX problems and better way of
designing User Interface. He can be the best Front-End, UI/UX developer.

MUHAMMAD HASAN SAROSH


is the Team-Lead for developing this project from just a project to a.
The responsibility was to: design the workflow, develop the APIs and all operations done
in this project, from designing the database to monitoring the project schedule. The idea was
proposed by the team lead, generating the requirements, guidance to problem, motivate and
inspire team members.

DEDICATION
All thanks and gratitude is due only to ALLAH, the most gracious, the most merciful and the
most beneficial, who bestowed upon me enlightenment, courage and energy to undertake and
complete this project.

This humble effort is

Dedicated to our

Parents & Project Advisor

We thank, pray for and promise them to do whatever is possible in our powers to comfort them and
promote their good mission for the noble cause of spreading education and development of human
beings. They have served us with their best efforts and have brought us up to be the persons we are
today, may Almighty ALLAH bless them.

BLOOD FINDER

ABSTRACT

he Blood Finder is a web-based and facebook application

which helps people to find the blood donors near their location.
In our world where people are suffering from several blood
diseases and having a lot of accidents in which people lost their
blood. This application will help those people to contact blood
donars of their group near them so their precious life can be safe.

Contents
CHAPTER 1
INTRODUCTION
1.1

OVERVIEW

1.2

RATIONALE

1.3

AIMS

AND

12
13

FOR THE

RESEARCH

OBJECTIVES

13
14

1.4

SCOPE AND LIMITATION

14

1.5

FUTURE ENHANCEMENT

15

1.6

SELECTION

15

1.7

CURRENT SYSTEM

15

1.8

BACKGROUND

16

1.9

METHODOLOGY

OF DEVELOPMENT TOOLS

OF THE PROJECT

19

CHAPTER 2
LITERATURE

REVIEW

20

2.1

INTRODUCTION

21

2.2

METHODOLOGY

21

2.3

CONCEPT

22

2.4

INTERACTIVITY

23

2.5

INTEGRATION

23

2.6

BENEFITS OF IMPLEMENTING FREE-ROAMING VIRTUAL CAMPUS

24

2.7

IMPROVING ARCHITECTURAL VISUALIZATIONS

24

AND DEFINITION

AND INTERACTIVITY

CHAPTER 3
RESEARCH METHODOLOGY

26

3.1

INTRODUCTION

27

3.2

THEORETICAL BACKGROUND

27

3.3

BLOCK DIAGRAM

28

3.4

SOFTWARE ENGINEERING PROCESS MODEL

29

3.5

REQUIREMENTS DEFINITION

29

3.6

PROJECT MONITORING METHODS

30

3.7
3.8

PROJECT MANAGEMENT METHODS


RISK ANALYSIS AND MANAGEMENT

31

32

CHAPTER 4
DETAIL DESIGN

37

4.1

SYSTEM ARCHITECTURE DESIGN

38

4.2

FUNCTION DESIGN DESCRIPTION

41

4.3

FUNCTIONAL DESCRIPTION

43

4.4

SYSTEM INTERFACE DESIGN

44

CHAPTER 5
TESTING
5.1

55

UNIT TESTING

56

CHAPTER 6
PLANNING

58

AND COST ESTIMATION

6.1.1 DEFINE PROJECT CONCEPT

AND

PURPOSE

59

6.1.2 MODULE # 1 3D MODELS

59

A.
59

REQUIREMENT ANALYSIS

B.
59

PROGRAM DESIGN

C.
59

PROGRAM DESIGN

D.
60
E. PRESENT

FTR
FORMAL MODULE

#1

TO COMPILE PROJECT MODULE

#1

60

DOCUMENTATION TO PROJECT ADVISOR

6.1.3 MODULE # 2 LIGHTING & TEXTURING

60

A.
60

REQUIREMENT ANALYSIS

B.
60

PROGRAM DESIGN

C.
60

PROGRAM DESIGN

D.
61
E. PRESENT

FTR
FORMAL MODULE

#2

TO COMPILE PROJECT MODULE

DOCUMENTATION TO PROJECT ADVISOR

6.1.4 MODULE # 3 LOGIC SCRIPTING

10

DOCUMENTATION

#2

DOCUMENTATION

61

61

A.
61

REQUIREMENT ANALYSIS

B.
61

PROGRAM DESIGN

C.
61

CODING

D.
62

FTR

E. PRESENT

FORMAL MODULE

6.1.5 SYSTEM OPERATION

6.2

#3

TO COMPILE PROJECT MODULE

DOCUMENTATION TO PROJECT ADVISOR

AND MAINTENANCE

AND

#3

UNIT TESTING

DOCUMENTATION

62
62

A.
62

ERROR CORRECTION

B.
62

ENHANCEMENTS

C.
62

ADAPTATION

PROJECT COST ESTIMATION

63

CHAPTER 7
CONCLUSION

AND FUTURE SCOPE

65

7.1

CONCLUSION

66

7.2

FUTURE SCOPE

67

REFERENCES

68

CHAPTER 8
SOURCE CODE
69

11

12

INTRODUCTION

CHAPTER 1

13

1 Introduction
1.1 Overview
The idea of this project hit us when we saw a lot of terrorism
activities in our country in which a lot of people got injured and lose
their blood and ultimately lose their lifes.

1.2 Rationale for the Research


The objective of the project is to provide a product that residents
of society can enjoy, news pasted on the notice board and other trivia
spread through chitchat and gossip.
Web-Application will be available for the registered residents.
All system information is maintained in a database
by the union president.
The server will process the data collected from the web.
The server will be connected directly with MongoDB database.
A webpage will be developed to read the stored data inside the
database.

1.3 Aims and Objectives

14

The idea of this project hit us when we notice the residents and union presidents
are not synchronized with the budget of society and all are having quarrel among
them and with the presidents.
Beneficial for homeowners as they can keep a track of all the developments in their
society, write complaints, post notices to society management.
The benefits of the project are given as follows:
Establish a connection between the users

Not only can maintenance bills be viewed and paid on the portal but also
provides transparency on how the treasury funds are being utilized in a
society

1.4 Scope and Limitations


The purpose of this document is to explain in detail every
stage of this project from the problem statement to the implementation
phase. This Document is a final report for graduation project course for
the department of Computer Science University of Karachi in Karachi.

1.5 Future Enhancement


Having an online resident portal available for tenants is a valuable asset, but it
wont do anyone much good if people dont use it. Many apartment communities
encourage residents to register and use the portal by holding raffles, sweepstakes
and contests with prizes. The prizes can be anything from a certain currency off of
next months rent or a gift certificate to a popular local business to a tablet, cash
prize or just about anything else! Not only will this encourage tenants to use the
portal, but it will further bring evidence to the fact that you care about them and
value them as part of your community.
The main idea here regarding an online resident portal is that it makes residents
happy. When residents are happy, it makes managements jobs easier, which makes
management happy. A safe, happy and active neighborhood is something every
tenant and manager wants, and it is at the heart of a successful rental business.

15

People by nature enjoy feeling wanted and appreciated; by making your property
the very best it can be for your residents, you are showing them that your team
values them and that you appreciate them that you care about their happiness.
Happy residents are much more likely to take care of their homes, are more likely to
remain in their leases longer, and are also much more likely to refer their friends
and acquaintances to your property. This all means a great reputation for your
apartment community and better business, as well.

1.6 Selection of Development Tools


The software requirement for the development of this software is:
1.

Node.js is intended to build scalable network

programs easily. So, it can be used to develop web applications accountable


to high traffic.
2.

JavaScript is used for the programming the logic of

3.

MongoDB is a document database that provides high

the application.

performance, high availability, and easy scalability.


4.

Bootstrap

is

the

most

popular

HTML,

CSS,

and

JavaScript framework for developing responsive, mobile-first web sites.


Bootstrap is a front end framework, that is, an interface for the user.

1.8 _ EXISTING SYSTEMS


Ufortunately in our local market there isnt any such
portal system for societies and apartments.
But some form Indian market are listed below which
provide portals to societies:
ApartmentAdda https://apartmentadda.com/
16

Apnacomplex https://www.apnacomplex.com/
Society123 http://www.society123.com/
1.8.2 Websites
Tutorial downloaded from http://www.lynda.com/
http://www.w3schools.com/ and solution to problems from
http://www.stackoverflow.com/

1.9 Methodology
This segment should elaborate the technical challenges and merits of the project
including the proposed solution that to the said problem. A project can be divided into
four major phases as follow:

1.9.1 Design phase:


Well be using agile software development model SCRUM.

1.9.2 Implementation phase:


Our implementation scheme will totally be software (web-based).

1.9.3 Testing phase:


Our testing plan will be based on unit testing.

1.9.4 Evaluation phase:


The main feature that well be evaluating in our project is the draw distance i.e.
optimized graphics of the virtualized version of our campus.

17

18

LITERATURE REVIEW

CHAPTER 2

2 LITERATURE REVIEW
2.1 Introduction
19

The purpose of this document is to explain in detail every stage of this project from
the problem statement to the implementation phase. This Document is a final
report for graduation project course for the department of Computer Science
University

of

Karachi

in

Karachi.

Now a days web application is making life easy for people. Like ordering food,
getting location, path finding, booking your movie ticket etc. But there was no
mechanism for society portal in our city Karachi.

2.2 Methodology
In the previous paragraph we established that the intention of this work is to
show the potential benefits and implications to dedicate ourselves to creating this
beautiful Product, that helps Residents of the Neighbourhood Rise High, together.
This will be done by presenting a review of the most relevant information that can
be currently found by searching over the internet. Some limitations are necessary to
be established in order to properly fulfill this task.
First, the attention of this work was given to research that has directly been
done to develop elements of analysis regarding society portal methodologies.
And second, we will use the contents that will be reviewed by the team.

2.3 Concept and definition


Society/Apartment Portal System
First the administrator interact with the system through his account,
administrator should be able to register on the web-portal in order to log in and
manage the apartments information, after logging in as admin there will be view
from which admin can manage the accounts of the users and perform CRUD
20

operation on the accounts and other services, i.e. to set notifications for users for
rental expenses and other services for the residents.
There will be different view for almost each operation performed by admin. An
administrator should also be able to log in to the web-portal where he/she can
administer the system by for instance editing apartments or user information.

2.4 Interactivity
Human Computer Interaction (HCI) is the process by which we humans
interact with computers or any other electronic media. Interaction can be done
using a variety of media. The most basic medium to interact with a computer is a
keyboard, or a mouse or both but with the advancement in the field of technology.

2.5 Integration and Interactivity


A first-time user of the web based portal system should see the homepage when
he/she opens the exact URI, there will be a navigation bar from which user can
navigate from one place to another to use the services provided by this web based
application.
The particular user can use all the services of the portal which do not need any
login.
Other services will be treated to user after he/she is login, for login a user
must sign up and choose a unique username so that each user can be distinguish
easily. Login page will have two fields asking for username and password, and there
will be option that either we want to login as user or admin. After logging in as user
there will be user friendly view of profile page of user, so user can manage his/her
account. And use the entertaining services provided by portal system.

21

2.6 Benefits
The software acts as a network of housing society where residents can
communicate with each other on availability of vendors, maids, drivers etc
* Not only can maintenance bills be viewed and paid on the portal but also provides
transparency on how the treasury funds are being utilized in a society
* Beneficial for homeowners as they can keep a track of all the developments in
their society, write complaints, post notices to society management
* Manage property documents, parking lots, clubhouse fees, and CCTV viewing
* Instant online voting for or against any proposal for the society

2.7Improving Architectural Visualizations through Interactive


Applications
Just as cities are getting smarter, one can't expect housing societies to
continue in the old fashioned way, like official news pasted on the notice board and
other interesting trivia spread through chitchat and gossip.
More and more housing societies in cities and towns are opting for online
solutions to manage their works. We were among the first to see business
opportunity in the housing society sector.

2.8 Conclusion
The literature review done in this section provides a conclusive result that architecture is
ready for the 21st century. It just needs a proper make-over.
Based on the research we can say our crime reporting application is easy to use
are compare to others in the market.
22

Based on the visual information provided by the authors of the literature


references that were considered to develop this research, we can conclude that the interactive
walkthroughs of architecture are being developed all around the world.
We also found out that no one in Pakistan is developing interactive tours of their
architectural sites. So, its only right to bring Pakistan into the 21st century.
Finally we can confidently say that all the literature that weve done proves that

RESEARCH METHODLOGY

there is a need for interactive walkthroughs.

23

CHAPTER 3

3 RESEARCH METHODLOGY
3.1 Introduction
The idea of this project hit us when we notice the residents and union presidents
are not synchronized with the budget of society and all are having quarrel among
them and with the presidents.
Beneficial for homeowners as they can keep a track of all the developments in their
society, write complaints, post notices to society management.

3.2 Software Engineering Process Model


The application development for this project will be done using the agile software
development

model.

Agile

software

development

is

group

of

software

development methods in which requirements and solutions evolve through


collaboration between self-organizing, cross-functional teams. It promotes adaptive
planning, evolutionary development, early delivery, continuous improvement, and
encourages rapid and flexible response to change .

3.3 Requirements Definition


In this phase, the customer will be asked to determine the minimum set of features
to be supported (the "needs"), as well as the ideal system desired (the "wants"). It
is important to establish these priorities as many projects are constrained by time
and there are specific needs that must be met within a specific time frame. Once
24

the requirements have been established and prioritized, a more detailed timetable
will be determined.
For requirement elicitation and analysis we use the following technique:

1. Interviewing and questionnaires.


2. Storyboarding.
3. Prototyping.
4. User Stories.
We also make use case diagram activity diagram, sequence diagrams, class
diagrams
That is mention in detail design chapter (Chapter # 4)

3.4 Project Monitoring Methods


The project will be tracked using the following methods:
3.4.1 Thrice a week Team Meetings
Thrice a week Team Meetings will be facilitated by the Team Leader and attended by
all Team Members. Each Team Member will be required to submit a progress
verbally report for each of their respective terms. At this time problems or potential
problems will also be discussed. Suggestions will be made for resolution.
3.4.2 Schedule Tracking
The schedule will be regularly reviewed comparing actual milestones to planned
milestones as denoted in the project schedule. In addition, the task start dates will
be reviewed to ensure the schedule is not slipping. If there are start date delays or if
it looks like milestones may not be achieved on schedule, the Team Leader will be
contacted to discuss and resolve the potential delays.

25

3.4.3 Process Reviews


Monthly software process reviews will be performed to ensure that the project is
headed in the intended direction and in a timely fashion.

3.4.4 Task Tracking


Task Tracking will be tracks the task is done or not in the moment as
we schedule it. If a task is depended to the other task or tasks, then this task
or tasks are high priority for competence soon as possible to reduce the
dependency between tasks.

3.5 Project Management Methods


3.5.1 Risk Management
As a part of risk management, sources of risk will be identified, addressed, and
mitigated before they threaten successful completion of a project. The two
primary

risk

management

elements

are

risk

assessment

(identifying,

analyzing, and prioritizing) and risk control (management planning, resolution,


and

monitoring)

which

is

discuss

in

risk

mitigation,

monitoring

and

management.
3.5.2 Requirements Management
Initial requirements will be established but these requirements are subject to
change and must be monitored and managed. Managing requirements will
include capturing, tracking, and controlling requirements, as well as any
changes to them. This will establish and maintain a common understanding,

26

between the customer and development team, of the requirements to be


addressed by the project.
3.5.3Tracking and Oversight
The project accomplishments will be tracked and reviewed with respect to the
project plan. Corrective action will be taken as necessary based on actual
accomplishments and results.
3.5.4 Process Management
In managing the project, the processes (tasks) involved in managing the
project will also be continuously monitored and reviewed. This will include to
planning, defining, implementing, monitoring, measuring, and improving
processes under project management and producing process documentation
and improvement plans.

3.6 Risk Analysis and Management


RISK MITIGATION, MONITORING AND MANAGEMENT:
r1:Risk Mitigation
r2: Risk Monitoring
r3: Risk Management

3.6.1 Project Risk:


Risk
Work not according
to scheduling

27

Probabilit
y
Low

Impac
t
High

RMMM
r1:Work complete out of date assign. Not
flow hand over date, City bad condition.
r2: Weekly check Scheduling if task complete
after due date.
r3: Remote access (internet), give more time.

Personnel (employee
relationship)

High

High

Resources
(Power, experience)

Medium

Mediu
m

Required Problem
(Not understood by
project manager,
employee and client)

Medium

High

Project complexity
and size

Medium

High

r1:Not working together.


r2: Note employee behavior in combine
meeting
r3: Take individual meeting and also combine
meeting. Take response from each employee.
r1:No external source for electricity, nonprofessional.
r2: Work not complete on time also work
brings to a standstill.
r3: increase budget, acquire assist from
teacher.
r1: Not clear scope of project
r2: due to un experience complexity in
working
r3: use internet resources to study deeply
about requirement (e.g. if client is not
understand what you want to say, take sketch
to present him about your thought)
r1:Not good analysis of requirement
r2: Some tasks may be not complete on time
r3: Consider all the things during scheduling.

3.6.2 Technical Risks:


Risk
Design

Implementation

28

Probabilit
y
High

Medium

Impac RMMM
t
High r1/r2: Mistake in designing phase. Not perfect
analyze of project.
r3: It can be management via third party
(teachers help) and also find liability in
analysis phase.
High r1/r2: Mistake in implementation phase. Not
accurate design of project.
r3: It can be management by using internet
resources and also find problem in design
phase.

Interface

Medium

High

Verification

Medium

High

Maintenance

Medium

High

Technology

Medium

High

r1:Not according to customer, poor


communication with customer.
r2: Customer find objectionable interface
which is given to him
r3: Clearly satisfied about customer needs.
r1: Not correct build.
r2: Verified by customer.
r3: Verification and validation of complete
project.
r1/r2: No documentation and no backup
recovery.
r3: Take documentation and no backup
recovery.
r1:Users fail to use the new system
effectively and efficiently
r2: Check it is built on customer demand
r3: Plan for a detailed Training Needs
Analysis and put in place an appropriate
training programmer. Consider how to coach
and support users after live date.

3.6.3 Business Risks:


Risk
Build an excellent
product that has no
one really wants
(market risk)

Build a product that


has no longer fit into
overall business
strategy for the
company ( strategic
risk)

29

Probabilit
y
Low

Medium

Impac RMMM
t
High r1:Not clearly define customer and market
needs.
r2: monitor system according to market
needs.
r3: Before starting complete search the scope
of product.
High r1:use for only specific purpose
r2: Do not full fill the needs of customer
r3: Add more feature to enhance product

Build a product that


sale force doesnt
understand how to
sell

High

High

r1:Build product according to market need


r2: Consider things that will exert a pull on
customer according to his need.
r3: Present demo via video or trail version.

3.6.4 Few other Risks:


Risk

Team members become


sick

Probabili
ty

Impact

High

Low

RMMM

r1:Due to over work.


r2: Ensure the plan has contingency built into it
to allow for less than expected resource
availability.
r3: Provide more facilities according to their
performance.

Key team member


becomes available

Solution does not meet


the customer needs

Medium

Mediu
m

Low

High

r1:Work stop due to his absence


r2: By documentations it can be monitor.
r3: Ensure project procedures include good
knowledge sharing and documentation so that
the thought process, designs and decisions are
not lost.
r1:Customer not satisfied its needs.
r2: Efficient analysis of project.
r3: Ensure good participation and collaboration
involving representatives.

System failures

High

Mediu
m

r1: Due to low quality of equipment. Server


down.
r2: Check the system performance perfectly.
r3: Ensure the plan includes appropriate backup,
recovery, and disaster recovery procedures.

Select package does


not support process
design.

30

Medium

High

r1/r2: The design practice which we indicated is


not such efficient work according to customer
need. Customers dont like user interface.
r3: By prototyping (UI) check by customer
before delivery.

Prioritizations does not


match internal
customers needs

Medium

Mediu
m

r1:Not follow work which is essential and dont


perform it first.
r2: Check each work done according to its
priority
r3: While performing each task, Priority defines
must be considered.

Reduced Benefit due to


lack of co-ordination of
projects

High

High

Unrealistic delivery
date

Low

High

Medium

High

Low

Mediu
m

Customer will change


requirement

Medium

High

Lack of training on tool

Medium

Mediu
m

High

High

Lack of documentation

Poor development
environment

Team member are not


experience

31

r1:Not working together.


r2: meeting individual and get feedback of other
employee
r3: Each team member co-ordinate with each
other.
r1: Short period of time and also more work in
less time
r2: Consider overall conditions before assigning
date
r3: Before scheduling take some extra days.
r1:No documentation or poor documentation
r2: Timely check documentation
r3: Take backup of data
r1:Congested, disorderly environment
r2: Get feedback from employee
r3: Increase Budget and take acceptable place
r1:customer to satisfied current product or not
accurate telling his need or new ideas concurs in
his mind.
r2: Taking feedback from customer as during the
project. Check him by prototyping his need.
r3: Rescheduling the project.
r1:Due to use of new platform
r2: Customer feel difficulty in using product
r3: Provide tool kit to easily use product
r1:Due to not a professional workers
r2: Meeting with project advisor
r3: Working together, helps each other and also
helps from teachers.

32

DETAIL DESIGN
CHAPTER 4

33

4 Detail Design
4.1 System Architectural Design
4.1.1SYSTEM ARCHITECTURE
With the web application, the users will be able to find and use their utilities.
The result will be based on the criteria the user inputs. There are several
utilities and it will be possible for the administrator of the system to manage
the options for those criteria that have that.
Firstly the user has to be signup for the account which would be going to
administrator for the verification, next successfully verified now the user is
ready to login and go for the utilities.
The basic utility for the user is the payroll system, in which the user can
store its budget criteria and further depend on user.

4.1.2PORTAL ARCHITECTURE
The Portal Server hosts the User Interface (UI), part of the core
implementation of the portal. The UI handles incoming HTTP requests,
builds HTML responses, and returns the appropriate portal pages to each
client.

34

4.2 Function Design Description


4.2.1 Multi-Level Data Flow Design for Function Process

35

4.3 Functional Description


This section includes the requirements that specify all the fundamental
actions of the software system.
There are two types of users that interact with the system: users of the
web application and administrators. Each of these three types of users has
different use of the system so each of them has their own requirements.
The web application users can only use the application to find their
utilities. This means that the user have to be able to search for utilities
provided to them, choose a utility from that search and then navigate to it.
Also provide the request to administration.
The administrators interact with the web portal. They are managing the
overall system so there is no incorrect information within it. The
administrator can manage the information for each resident as well as
provide correct information and manage the accounts system.

4.3.1 Common Characteristics of Admin and Users


36

Following are the characteristics of admin:

4.3.1.1 Community Messaging (Chatting)


When you opt to participate in a social network community, you can pick and
choose those individuals whose likes and dislikes are similar to yours and
build your network around those commonalities. For instance, if you are a
chess aficionado or a book lover, you can find and interact with those who
share your interest. Because you are connecting digitally instead of having to
physically attend meetings, you have the luxury of joining many more groups
and communities. You can meet with your friends anytime you have an
Internet connection and whenever you find them online.

4.3.1.2 TV Channel Streaming


Streaming media is multimedia that is constantly received by and
presented to an end-user while being delivered by a provider. A client media
player can begin playing the data (such as a movie) before the entire file
has been transmitted. Distinguishing delivery method from the media
distributed applies specifically to telecommunications networks, as most of
the delivery systems are either inherently streaming (e.g., radio, television)
or inherently non streaming (e.g., books, video cassettes, audio CDs).

4.3.1.3 Online Reservation/ Reservation Approval


Commonly referred to by such names as online scheduling is a Web-based
that allows individuals to conveniently and securely book their appointments
and reservations online through any Web-connected device, such as a
computer, laptop, smartphone or tablet for any such type of events within
the community.
In addition to online systems also come equipped with e-mail which the
system sends out to residents for whether the request is approved or not.

37

4.3.1.4 Service Request/ Request Forwarding


This is simple step towards the email system where request is being made by
the users for any sort of services regarding apartment maintenance and then
the request is forward to the concerned person responsible for the labor work
by the admin.

4.4System Interface Design


Graphic User Interface Design
This section provides the interface for the Web application.
4.4.1 User Screen
This is the main screen that the user will see when using the application.

i)

User Screen

Home page Preview

38

Login Screen

39

Create a new Account

40

Services owned by Admin

41

Services owned by users (residents)

42

Payroll Preview

43

New Account to approve/discard

44

Residents Info Preview

45

Notification Preview

46

Messages Preview

47

48

49

TESTING

CHAPTER 5

50

5 Testing
5.1 Unit Testing Snapshots
For testing we take many snapshots to show that we perform testing on it to
check notification, messages, new account approval and residents information is
occurring and is fine in use.

i)

Testing
The screen or preview shown in the previous chapter shows that the work is in
smooth flow.
Messages are occurring successfully.
Notification is based on respective residents by their respective admins.
Signup requirement approval is also shown.
Residents information can also be given when required this is also done in the
previous chapter.

51

PLANNING AND COST


ESTIMATION
CHAPTER 6

52

6 PLANNING AND COST ESTIMATION


6.1 FYP Design Flow / Activities
6.1.1 Define Project Concept and Purpose
a.Meet with advisor and identify overall system needs and requirements
b.
Formal Technical Review (FTR) to clearly define project
c.Define Project Scope and Purpose
d.
Process Model
e.Define Process Model
f. Define team structure and responsibility
g.
Risk
h.
Risk Analysis and Management
i. Risk Management Paradigm
j. Risk Mitigation, Monitoring and Management
k.
Define project tasks and schedule
l. Assign project resources and estimate size using the FP method
m.
Define monitoring and management methods
n.
FTR to compile project plan documentation
o.
Submit formal project plan to advisor
p.
Present formal project plan to FYPC

6.1.1

Module# 1 DataBase Design

A. Requirement Analysis
a.
Database modeling
b.
Project cost
c.
Design Admin modules
B. FTR to compile project module # 1 documentation
C. Present formal module # 1 documentation to project advisor

6.1.2
A.

53

Module # 2 LIGHTING & TEXTURING


Requirement Analysis
a.Start date and due date of task
b.
Define interface requirements
c.UX

B.
Program Design
a. Start date and due date of task
b. Define interface requirements
c. UX
C.

FTR to compile project module # 2 documentation

D.

Present formal module # 2 documentation to project advisor

6.1.3
A.

Requirement Analysis
a.Define client requirements
b.
Project status
c.JavaScript Logic scripting

B.

Program Design
a.
JavaScript logic scripting

C.

Coding and Unit Testing


a.
Define client requirements
b. Project status
c.
Nodejs-server logic scripting

D.

FTR to compile project module # 3 documentation

E.

Present formal module # 3 documentation to project advisor

6.1.4
A.
a.
b.
c.
d.
e.
f.
g.
h.
i.
j.
54

Module # 3 LOGIC SCRIPTING

Integration and system testing


Integration and test project manager/Admin module
Account Access
User account modification
Report generation
Deadline notification
Client Expense
Resource Record Detail
Time tracking
Show priority
Customizable
Project status

k.
l.
m.

Billing
Project team
Project cost

B.
a.
b.
c.
d.
e.
f.
g.
h.
i.
j.
k.
l.

Integration and test Employees module


Assign Task
To-Do Lists
File Sharing
Events
Calendar
Text Documents
Discussion
Customizable
Start date and due date of task
Task Reminder
Time Record
Chat

C.
a.
b.
c.
d.
e.
f.
g.
h.

Integration and test Client module


Bug tracking
Project status
Online payment
Client communication
Customizable
Dues (payment)
Feed back
Assign priority

D.

FTR to compile project module # 3 documentation

E.

Present formal module # 3 documentation to project advisor

6.1.5
A.

55

System operation and maintenance

Error correction
a.
Meet with customer/Advisor to review/compile customer/Advisor
driven bug report
b. Compile internally generated bug report
c.
FTR to review complete bug report
d. Implement and test software corrections
e.
Release software corrections to customer

B.

Enhancements
a.
Meet with customer/Advisor to discuss requested feature
enhancements
b. FTR to review requested feature enhancements
c.
Implement and test feature enhancements
d. Release feature enhancements to customer

C.

Adaptation
a.
FTR to analyze market trends to detect possible future
incompatibilities
b. Meet with customer to discuss options regarding software upgrades
that will ensure future compatibility
c.
Implement and test required adaptations

6.2 Project Resources and Cost Estimation


6.2.1Project Cost
The project cost estimation was performed using the function point (FP) method and
applying it to all major subtasks defined by the project scope.

FUNCTION POINTS ESTIMATION FORM

Determine Unadjusted Function Point Count

56

Name

Type

Complexity

value

Logic Scripts
Collision detection

EI
EI

High
Average

6
4

Text Document

EI

low

User i/p (10)

EI

Average

Project Team

EI

Average

Time Records (2)

EI

Average

Project Cost

EI

Average

Project Name (3)date, priority

EI

High

User profile

EI

Average

Upcoming Event

EU

low

Show Priority

EU

High

History

EU

Average

Gantt Chart/Time Line

EU

High

Reporting

EU

Average

Bug Tracking

EU

Average

Project Status

EU

Average

Billing

EU

Average

Time Tracking

EU

low

Something else

EQ

Average

Hullaballoo

EQ

Average

Client Communication

EQ

Average

Chat

EQ

low

Internal Logical File(7)

ILF

Average

10

Daily Progress

EIF

Average

Searching

EIF

High

10

Task Reminder

EIF

Average

Skills Profile of each Employee

EIF

Average

Unadjusted Function Point Total

57

303

Determine Value Adjustment Factor

Rate

System Complexity
1

How many panels are there?

2
3
4

How is graphics processing handled


Was response time or throughput required by the user?
How heavily used is the current hardware platform?

3
3
4

5
6
7
8

I/O Complexity
What is the latency of the application?
3
What percentage of the information is entered online?
4
Was the application designed for end-user efficiency?
5
How many internal logical files are updated by the web
application?
5

9
10
11
12
13
14

Application Complexity
Does the application have extensive logical or math processing?
Was the application developed to meet one or many user needs?
How difficult is conversion and installation?
How effective/automated are startup, backup, and recovery?
Was the application designed for multiple sites/organizations?
Was the application designed to facilitate change?

3
5
1
5
5
5

Value Adjustment Factor

56

Determine Function Points


Function Point (FP) = Unadjusted Function Points * (0.65 + 0.01 * Value Adjustment
Factor)
FP = 303 * (0.65 + 0.01 * 56)
FP = 366.63

6.2 Team Structure and Responsibility

58

6.3.1

Team Structure:

Ego-less Programming Structure (Control Decentralized)


We chose to have an ego-less programming structure for following reasons:
1. Our team size is relatively small.
2. Team members cover all areas

so

that

no

one

person

or

group monopolizes any one specific area of work


3. Decisions are made by consensus.
4. The degree of communication required is high.
Given these situations, a control decentralized team structure can be successfully
applied. Decentralized teams generally generate more and better solutions. In
addition, a decentralized team structure results in higher morale than a centralized
structure.
Team Members and Responsibilities
Team Leader: Arsalan Hussain
The responsibility was to: design the workflow and all operations done in this
project, from designing the database to monitoring the project schedule. The idea
was proposed by the team lead, generating the requirements, guidance to problem,
motivate and inspire team members. And focus on the big picture of development
to sale out this product.

Programmers/logic scripting:
Programmers/logic scripting: Abdul Bari
The programming and logic is done for the movement of the camera, the
collision detection of the rooms and GUI programming.
UI/UX:

59

UI/UX: Ayaz bin Mukhtar


resolves to find a UX problems and better way of designing User
Interface.
Testers:
Testers: Abdul Bari, Arsalan Hussain
Testers are mainly responsible for testing the main application. They are
also responsible for doing various small stuff to help each other out.

60

Conclusion and future scope


CHAPTER 7

61

8 Conclusion and Future Scope


7.1 Conclusion
is a web portal that provides tools to effectively manage and easily maintain the almost
all aspects of your residential complex, be it Apartment Complexes, Private Layouts,
Row houses, Villas or even a Colony. Your Association can register with our Society
Portal and create an online space for your community to manage the association
activities.
Part of your responsibility as an administrator is to do everything you can to make your
residents feel safe, welcome, comfortable and significant within the apartment
community. An administrator also uses the web-portal in order to administer the system
and keep the information accurate. The administrator can, for instance, verify owners
and manage user information.
With the web application, the users will be able to find and use their
utilities. The result will be based on the criteria the user inputs. There
are several utilities and it will be possible for the administrator of the
system to manage the options for those criteria that have that.

7.2 Future Scope


Having an online resident portal available for tenants is a valuable asset, but it wont do
anyone much good if people dont use it. Many apartment communities encourage
residents to register and use the portal by holding raffles, sweepstakes and contests with
prizes. The prizes can be anything from a certain currency off of next months rent or a gift
certificate to a popular local business to a tablet, cash prize or just about anything else! Not
only will this encourage tenants to use the portal, but it will further bring evidence to the
fact that you care about them and value them as part of your community.

62

The main idea here regarding an online resident portal is that it makes residents happy.
When residents are happy, it makes managements jobs easier, which makes management
happy. A safe, happy and active neighborhood is something every tenant and manager
wants, and it is at the heart of a successful rental business.
People by nature enjoy feeling wanted and appreciated; by making your property the very
best it can be for your residents, you are showing them that your team values them and that
you appreciate them that you care about their happiness. Happy residents are much more
likely to take care of their homes, are more likely to remain in their leases longer, and are
also much more likely to refer their friends and acquaintances to your property. This all
means a great reputation for your apartment community and better business, as well.
Just as cities are getting smarter, one can't expect housing societies to continue in the old
fashioned way, like official news pasted on the notice board and other interesting trivia
spread through chitchat and gossip.
More and more housing societies in cities and towns are opting for online solutions to
manage their works. We were among the first to see business opportunity in the housing
society sector; now there are many more players offering ERP.

63

References:
[1] http://blogs.cornell.edu/gateshall/3dinteractive/
[2]http://www.ysu.edu/campusmap/
[3] http://campusmap.lsu.edu/map/framesetup.asp
[4] http://www.neduet.edu.pk/aboutus/tour/university_tour.html
[5] http://timesofindia.indiatimes.com/city/mumbai/Mumbai-housing-societies-go-hi-tech-withonline-community-portals/articleshow/42485287.cms

64

SOURCE CODE

CHAPTER 8

65

JS code files
Routes
Routes->collection.js
var express = require('express');
var router = express.Router();
var db=require('../DataBase/db');
router.get('/', function(req, res, next) {
res.render('col');
});
router.post('/',function(req,res,next){
});
module.exports = router;

Routes->dashboards.js
var express = require('express');
var router = express.Router();
var db=require("../DataBase/db");

var adminname;

router.post('/',function(req,res) {
console.log("dashboard");

var Login_detail = {
"U_Name": req.body.U_name,
"Password": req.body.P_word
};

console.log(req.body.U_name);

if(req.body.opt=="User"){
db.LoginUser(Login_detail)
66

.then(function(data){
if(data.length==0){
res.redirect("/");
}
else {
req.session.myUser=Login_detail.U_Name;
adminname=data[0].Admin_Name;

res.render('users');
}},function (errObj) {
console.log("inside request error");
res.send(errObj);
})
}
if(req.body.opt=="Admin") {
db.LoginAdmin(Login_detail)
.then(function (data) {
if (data.length == 0) {
res.redirect("/");
}
else {
req.session.myAdmin = Login_detail.U_Name;
db.Request(req.session.myAdmin).
then(function (data) {
console.log(data);
res.render('adminpp',{account:data});
//res.render('admindashboard',{messages:data,
username:Login_detail.U_Name})
}, function (errObj) {
console.log("inside request error");
res.send(errObj);
})

67

}
}, function (errObj) {
console.log("inside request error");
res.send(errObj);
})
}

});

router.get('/',function(req,res){
if(!req.session.myUser && !req.session.myAdmin){
res.send("Page Not Found");
}
else{
if(req.session.myAdmin){
db.Request(req.session.myAdmin).
then(function (data) {
console.log(req.session.myAdmin);
console.log(data);
res.render('adminpp',{account:data});
//res.render('admindashboard',{messages:data,
username:Login_detail.U_Name})
}, function (errObj) {
console.log("inside request error");
res.send(errObj);
})
}
else{
if(req.session.myUser)
res.render("users")
}

68

}
})

function Adminname(){
var a=adminname
return a;
}

router.admin_name = Adminname;

module.exports = router;

Routes->expense.js
var express=require('express');
var router=express.Router();

router.get('/',function(req,res){
res.render('exp');
});

module.exports=router;

Routes->index.js
var express = require('express');
var router = express.Router();
var db=require('../DataBase/db');
/* GET home page. */
router.get('/', function(req, res, next) {
//res.render('index', { title: 'Express' });
if(!req.session.myUser) {
res.render('index');
}
else{res.send("login already");}
});
69

router.post('/signout',function(req,res){
req.session.destroy();
});

router.get('/payroll',function(req,res){
res.render('payroll');
});

router.post('/expenses',function(req,res){
var expenseData={
Utility_Bill:req.body.utbll,
Other_Bill:req.body.otbll,
Salaries:req.body.salee,
Misc_Services:req.body.mchrgg,
Total:req.body.tulexx
};
db.Expenses(expenseData).
then(function(){
console.log("abcd");
res.send("successfully saved");
},function(errObj){
console.log("abc");
res.send(errObj);
})

});

router.post('/salaries',function(req,res){
var salariesData={

70

Employee_ID:req.body.empid,
Employee_Name:req.body.empn,
Salary_Month:req.body.samo,
Salary_Amount:req.body.samount
};

db.Salary(salariesData).
then(function(){
res.send("successfully saved");
},function(errObj){
res.send(errObj);
})
});

router.post('/funds',function(req,res){
var fundsData={
Apartment_ID:req.body.aptid,
Billing_Month:req.body.mont,
Paid_Cash:req.body.pdcash,
Due_Months:req.body.dum,
Due_Cash:req.body.dcash,
Balance:req.body.bal,
Total:req.body.tul
};

db.Funds(fundsData).
then(function(){
res.send("successfully saved");
},function(errObj){
res.send(errObj);
})
});

71

router.post('/requests',function(req,res){
if(req.session.myAdmin && req.body.approval=="accept"){
db.Approval_Requests(req.session.myAdmin).
then(function(data){
console.log(data);
res.send(data);
},function(errObj){
console.log(errObj)
res.send(errObj);
})
}
});

router.get('/Resident_Info',function(req,res){
if(req.session.myAdmin)
{
db.Resident_Info(req.session.myAdmin).
then(function(data){
console.log(data);
res.render("Resident_info",{info:data});
},function(errObj){
console.log(errObj);
res.send(errObj);
})
}

else{
res.render("error",{message:"404",error:"Page Not Found"});
}
});

72

var note="old";
router.post('/notification',function(req,res){
if(req.session.myAdmin){

var noti={
Subject:req.body.subject,
Text:req.body.text,
Admin_Name:req.session.myAdmin
}
db.Notifications(noti).
then(function(){
note="new";
res.send("success");
},function(errObj){
res.send(errObj);
})
}
})

router.post('/message',function(req,res){
if(req.session.myUser){

var mess={
To:req.body.to,
From:req.session.myUser,
Sub:req.body.sub,
Message:req.body.text
}

73

db.Message(mess).
then(function(){
console.log("successs");
res.send("success");
},function(errObj){
res.send(errObj);
})
}
else{
if(req.session.myAdmin){
var mess={
To:req.body.to,
From:req.session.myAdmin,
Sub:req.body.sub,
Message:req.body.text
}

db.Message(mess).
then(function(){
console.log("successs");
res.send("success");
},function(errObj){
res.send(errObj);
})
}
}

})

router.post('/view_message',function(req,res) {
if (req.session.myUser) {
db.View_Message(req.session.myUser).

74

then(function (data) {
console.log("succes");
res.send(data);
}, function (errObj) {
res.send(errObj);
})
}
else{
if(req.session.myAdmin){
db.View_Message(req.session.myAdmin).
then(function (data) {
console.log("succes");
res.send(data);
}, function (errObj) {
res.send(errObj);
})
}
}
})

router.get('/view_payroll',function(req,res){
if(req.session.myAdmin){
db.View_Expenses(req.session.myAdmin).
then(function (data) {
console.log(data);
res.send(data);
}, function (errObj) {
res.send(errObj);
})
}
})

75

router.post('/view_notification',function(req,res){
if(req.session.myUser){
db.View_Notification().
then(function(data){
data["note"]="old";
console.log("successs");
res.send(data);
},function(errObj){
res.send(errObj);
})
}
})

router.post('/view_message',function(req,res){
if(req.session.myUser){
db.View_Message().
then(function(data){
console.log("successs");
res.send(data);
},function(errObj){
res.send(errObj);
})
}
})

router.get('/apartment_info',function(req,res){
if(req.session.myAdmin){

res.render('apartmentinfo');
}
else{

76

res.render('error',{message:404,error:"page not found"});


}
})

router.post('/apartment_info',function(req,res){
if(req.session.myAdmin){
db.Apartment_Info(req.body.fno,req.session.myAdmin).
then(function(data){
if(data.length!=0)
{res.send(data);}
else{
res.send("no user")
}
},function(errObj){
res.send(errObj);
})

})

router.get('/information',function(req,res){
if(req.session.myUser){
db.Flat(req.session.myUser).
then(function(data){
db.Apartment_Info(data[0].Flat_No).
then(function(data){
res.render('ainfo',{info:data});
},function(errObj){
res.send(errObj);
})

77

},function(errObj){
res.send(errObj);
})
}
})

router.post('/approve',function(req,res){
console.log(req.body.User_Name);
console.log(req.body.response);
if(req.session.myAdmin){
db.Confirm(req.body.User_Name,req.body.response,req.session.myAdmin).
then(function(data){
res.render('ainfo',{info:data});
},function(errObj){
res.send(errObj);
})
}

})

module.exports = router;

Routes->live_streaming.js
var express = require('express');
var router = express.Router();
router.get('/', function(req, res, next) {
if(req.session.myUser){
res.render('live_streaming');
}
else{
res.render('signin');
}
});
78

module.exports = router;

Routes->salary.js
var express = require('express');
var router = express.Router();
var db=require('../DataBase/db');

router.get('/', function(req, res, next) {


res.render('salemp');
});

router.post('/',function(req,res,next){

});

module.exports = router;

Routes->sign_up.js
var express = require('express');
var router = express.Router();
var db=require('../DataBase/db');

router.get('/' , function(req,res,next){
res.render('signup');
});

router.post('/', function(req,res){
if(req.body.opt=="User"){
var UserToSave= {
"Flat_No": req.body.Flno,
"Family_Members": req.body.Nom,
"User_Name": req.body.Uname,

79

"Password": req.body.Pass,
"Admin_Name":req.body.adname,
"status":"Required Approval"
}
db.SaveUser(UserToSave)
.then(function(){
res.send({status:"request send for approval"});
}, function(errObj){
res.send({status:false,err:errObj});
})
}
else{
if(req.body.opt=="Admin"){
var AdminToSave={
"Flat_No": req.body.Flno,
"Family_Members": req.body.Nom,
"User_Name": req.body.Uname,
"Password": req.body.Pass
}
db.SaveAdmin(AdminToSave)
.then(function(){
req.session.myAdmin=req.body.Uname;
res.redirect('/dashboard');
}, function(errObj){
res.send({status:false,err:errObj});
})
}
}
});

module.exports=router;

Routes->users.js
80

var express = require('express');


var router = express.Router();

/* GET users listing. */


router.get('/', function(req, res, next) {
res.send('respond with a resource');
});

module.exports = router;

app.js
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var session=require("express-session");

var routes = require('./routes/index');


var users = require('./routes/users');
//var dashboard = require('./routes/dashboard');
var dash=require('./routes/dashboards');
var sign_up = require('./routes/sign_up');
var salary = require('./routes/salary');
var expense=require('./routes/expense');
var collection=require('./routes/collection');
var live_streaming=require('./routes/live_streaming');

var app = express();


81

// view engine setup


app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');

// uncomment after placing your favicon in /public


//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use(session({
secret: 'I dont have any secret',
resave: false,
saveUninitialized: true
}))

app.use('/', routes);
app.use('/users', users);
app.use('/dashboard',dash);
app.use('/sign_up',sign_up);
app.use('/salary',salary);
app.use('/expense',expense);
app.use('/collection',collection);
app.use('/live_streaming',live_streaming);

// catch 404 and forward to error handler


app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;

82

next(err);
});

// error handlers

// development error handler


// will print stacktrace
if (app.get('env') === 'development') {
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err
});
});
}

// production error handler


// no stacktraces leaked to user
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {}
});
});

module.exports = app;

db.js
var mongoose=require('mongoose');
var q= require ('q');
83

//var db=mongoose.connect("mongodb://localhost/FYP");
var
db=mongoose.connect("mongodb://sheikhbari:abc123@ds035663.mongolab.com:35663/fyp
");
var admin_check = require("../routes/dashboards.js");

var users=mongoose.model("users",{
Flat_No: String,
Family_Members: Number,
User_Name: String,
Password: String,
Admin_Name: String,
status: String
});

exports.SaveUser=function(user_info){
var deferred= q.defer();
var user=new users(user_info);
user.save(function(err,data){
if(err){
console.log("error");
console.log(err);
deferred.reject(err);
}
else{
console.log("USer Saved Successfully");
deferred.resolve();
}
});
return deferred.promise;
}

var admins=mongoose.model("admins",{
84

Flat_No: String,
Family_Members: Number,
User_Name: String,
Password: String
});

exports.SaveAdmin=function(admin_info){
var deferred= q.defer();
var admin=new admins(admin_info);
admin.save(function(err,data){
if(err){
console.log("error");
console.log(err);
deferred.reject(err);
}
else{
console.log("Admin Saved Successfully");
deferred.resolve();
}
});
return deferred.promise;
}

exports.LoginUser=function(user_info){

var deferred= q.defer();


users.find({'User_Name': user_info.U_Name,
'Password':user_info.Password},function(err,data){
if(err){
console.log("error");
console.log(err);

85

deferred.reject(err);
}
else{
console.log("successful");
//console.log(data);
deferred.resolve(data);
}
})
return deferred.promise;
}

exports.LoginAdmin=function(admin_info){
var deferred= q.defer();
admins.find({'User_Name': admin_info.U_Name,
'Password':admin_info.Password},function(err,data){
if(err){
console.log("error");
console.log(err);
deferred.reject(err);
}
else{
console.log("successful");
//console.log(data);
deferred.resolve(data);
}
})
return deferred.promise;
}

exports.Flat=function(user_info){
var deferred= q.defer();
users.find({'User_Name': user_info},function(err,data){

86

if(err){
console.log("error");
console.log(err);
deferred.reject(err);
}
else{
console.log("successful");
//console.log(data);
deferred.resolve(data);
}
})
return deferred.promise;
}

exports.Request=function(user){
console.log("inside request db");
var deferred= q.defer();
users.count({'status':"Required Approval",'Admin_Name':user},function(err,data){
if(err){
console.log(err);
deferred.reject(err);
}
else{
console.log(data);
deferred.resolve(data);
}});
return deferred.promise;

87

var expenses=mongoose.model("expenses",{
Utility_Bill: Number,
Other_Bill: Number,
Salaries: Number,
Misc_Services: Number,
Total: Number,
Date: {type:Date,default:Date.now()}
});

exports.Expenses=function(expense_data){
var deferred= q.defer();
var expense= new expenses(expense_data);
expense.save(function(err,data){
if(err){
console.log("error");
console.log(err);
deferred.reject(err);
}
else{
console.log("expense saved successfully");
deferred.resolve();
}
});
return deferred.promise;
}

exports.View_Expenses=function(admin){
var deferred= q.defer();
expenses.find({Admin_Name:admin},function(err,data){
if(err){
console.log(err);
deferred.reject();

88

}
else{
console.log("success");
deferred.resolve();
}
})
return deferred.promise;
}

var salaries=mongoose.model("salary",{
Employee_ID: String,
Employee_Name: String,
Salary_Month: String,
Salary_Amount: Number,
Date:{type:Date,default:Date.now()}
});

exports.Salary=function(salary_data){
var deferred= q.defer();
var salary=new salaries(salary_data);
salary.save(function(err,data){
if(err){
console.log("error");
deferred.reject();
}
else{
console.log("sucess");
deferred.resolve();
}

})
return deferred.promise;

89

var funds=mongoose.model("funds",{
Apartment_ID: String,
Billing_Month: String,
Paid_Cash: Number,
Due_Months: Number,
Due_Cash: Number,
Balance: Number,
Total: Number,
Date: {type:Date,default: Date.now()}
});

exports.Funds=function(funds_data){
var deferred= q.defer();
var fund=new funds(funds_data);
fund.save(function(err,data){
if(err){
console.log(err);
deferred.reject();
}
else{
console.log("success");
deferred.resolve();
}
})

return deferred.promise;
}

exports.Approval_Requests=function(admin_name){
var deferred= q.defer();

90

users.find({'status':"Required Approval",'Admin_Name':admin_name},function(err,data){
if(err){
console.log("error");
console.log(err);
deferred.reject(err);
}
else{
console.log("successful");
//console.log(data);
deferred.resolve(data);
}
})
return deferred.promise;
}

exports.Resident_Info=function(admin){
var deferred= q.defer();
//users.find({"User_Name":{$ne:"sheikhbari"}},function(err,data){
users.find({Admin_Name:admin},
{Flat_No:1,User_Name:1,Family_Members:1,_id:0},function(err,data){
if(err){
console.log(err);
deferred.reject(err);
}
else{
console.log(data);
deferred.resolve(data);
}
})
return deferred.promise;
}

91

var notification=mongoose.model("notification",{
Subject: String,
Text: String,
Admin_Name: String,
Date: {type:Date,default:Date.now()}
});

exports.Notifications=function(noti){
var deferred= q.defer();
var notif=new notification(noti);
notif.save(function(err,data){
if(err){
console.log(err);
deferred.reject();
}
else{
console.log("success");
deferred.resolve();
}
})
return deferred.promise;
}

var message=mongoose.model("messages",{
To: String,
From:String,
Sub: String,
Message: String,
Date: {type:Date,default:Date.now()}
});

exports.Message=function(mess){

92

var deferred= q.defer();


var msg=new message(mess);
msg.save(function(err,data){
if(err){
console.log(err);
deferred.reject();
}
else{
console.log("successss");
deferred.resolve();
}
})
return deferred.promise;
}

exports.View_Notification=function(){
var deferred= q.defer();
var a=admin_check.admin_name();
//notification.findOne(function(err,data){
notification.findOne({Admin_Name:a},function(err,data){
if(err){
console.log(err);
deferred.reject(err);
}
else{
//console.log(data);
deferred.resolve(data);
}
}).sort({Date: -1})
var a=admin_check.admin_name();

return deferred.promise;

93

exports.View_Message=function(info){
var deferred= q.defer();
//my query
//db.messages.aggregate([{$group:{ _id: "$To", Message:{$push:"$Message"}}}])
message.find({'To':info},{'_id':0,'To':0,'__v':0},function(err,data){
if(err){
console.log(err);
deferred.reject(err);
}
else{
console.log(data);
deferred.resolve(data);
}
}).sort({Date:-1})
return deferred.promise;
}

exports.Apartment_Info=function(info,admin){
var deferred= q.defer();
funds.find({'Apartment_ID': info,Admin_Name:admin},
{'_id':0,'Apartment_ID':0,'__v':0,'Date':0},function(err,data){
if(err){
console.log("error");
console.log(err);
deferred.reject(err);
}
else{
console.log("successful");
deferred.resolve(data);
}

94

})
return deferred.promise;
}

exports.Confirm=function(username,status,admin){
var deferred= q.defer();
if(status=="accept"){
users.update({User_Name:username,Admin_Name:admin},{$set:
{status:"Approved"}},function(err,data){
if(err){
console.log("error");
console.log(err);
deferred.reject(err);
}
else{
console.log("successful");
deferred.resolve(data);
}
})
}
if(status=="discard"){
users.remove({User_Name:username},function(err,data){
if(err){
console.log("error");
console.log(err);
deferred.reject(err);
}
else{
console.log("successful");
deferred.resolve(data);
}
})

95

}
return deferred.promise;
}

.ejs code files


Adminpp.ejs
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<title>Admin Panel</title>

<!-- Bootstrap Core CSS -->


<link href='/stylesheets/css/bootstrap.min.css' rel="stylesheet">
<!-- <link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<!-- Custom CSS -->


<link href='/stylesheets/css/grayscale.css' rel="stylesheet">

<!-- Custom Fonts -->


<link href='/font-awesome/css/font-awesome.min.css' rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic"
rel="stylesheet" type="text/css">

96

<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet"


type="text/css">
<link href='/stylesheets/css/style.css' rel="stylesheet" type="text/css">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

<script src="/javascripts/myApp.js"></script>

<script>
var Confirm=0;
function values() {

Confirm = document.getElementById("toconfirm").textContent;
if(Confirm!=0){
document.getElementById("confirm_button").style.color="red";
}
}

function signout(){
xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST","/signout", true);
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
string=xmlhttp.responseText;
}
}
xmlhttp.send();

97

function Notify(){
$.ajax({
type:"POST",
url:"/notification",
data:{subject:document.getElementById("subj").value,
text:document.getElementById("noti").value
},
success: function(){
document.getElementById("Noti_Close").click();
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 500) {
alert('Internal error: ' + jqXHR.responseText);
} else {
alert('Unexpected error.');
}
}
});
}

//message code here


var a=0;
var mydata={};
function Approval() {
if (Confirm != 0) {
$.ajax({
type: "POST",
url: "/requests",
data: {approval:"accept"},
success: function (data) {

98

a=data.length;
console.log(a);
mydata=data;
console.log(mydata);
Approve(mydata);
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 500) {
alert('Internal error: ' + jqXHR.responseText);
} else {
alert('Unexpected error.');
}
}
})
}
else{
alert("no request to approve");
}
}
var i=0;
function Approve(info){
document.getElementById("nog").innerHTML="User Name:
"+info[i].User_Name+"<br>"+"Flat_No: "+info[i].Flat_No+"<br>"+"Family_Members:
"+info[i].Family_Members;
console.log(info[i].User_Name);

function Confirmation(con){
$.ajax({
type: "Post",
url: '/approve',
data: {response:con,
99

User_Name: mydata[i].User_Name
},
success: function (data) {
i=i+1;
a=a-1;

if(a!=0){
console.log(a);
Approve(mydata);
console.log(mydata);
}
else{
Confirm=0;
document.getElementById("confirm_button").style.color="";
$('#req').modal('hide');
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 500) {
alert('Internal error: ' + jqXHR.responseText);
} else {
alert('Unexpected error.');
}
}

})
}
</script>

</head>

<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top" onload="values()">

100

<!-- Navigation -->


<nav class="navbar navbar-custom navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" datatarget=".navbar-main-collapse">
<i class="fa fa-bars"></i>
</button>
<a class="navbar-brand page-scroll" href="#page-top">
<i class="fa fa-laptop"></i> <span class="light">ADMIN PANEL</span>
</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right navbar-main-collapse">
<ul class="nav navbar-nav">
<!-- Hidden li included to remove active class from about link when scrolled up
past about section -->
<li class="hidden">
<a href="#page-top"></a>
</li>
<li>
<a class="page-scroll" href="#contact">Contact</a>
</li>
<li class="dropdown">
<a href="#actions" class="page-scroll dropdown-toggle" datatoggle="dropdown" >Actions</a>

<ul class="dropdown-menu">
<li><a href="#">Apartment Status</a></li>
<li><a href="/payroll">Payroll</a></li>
<li><a href="#">Accounts Approval</a></li>

101

<li><a href="/Resident_Info">Residents Info.</a></li>


<li><a href="#">Send Public Notifications</a></li>
<li><a href="#">Send Message</a></li>
</ul>
</li>
<!--<li class="dropdown">
<a class="page-scroll " data-toggle="dropdown" href="#">
<span class="caret"></span></a>

</li>-->
<li>
<a href="/" onclick="signout()">Sign Out</a>
</li>

</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>

<!-- Intro Header -->


<!--<header class="intro">
<div class="intro-body">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1 class="brand-heading">PORTAL SYSTEM</h1>
<p class="intro-text">A Portal System to Satisfy the needs of
customers</p>
<a href="#about" class="btn btn-circle page-scroll">
<i class="fa fa-angle-double-down animated"></i>

102

</a>
</div>
</div>
</div>
</div>
</header>-->

<!-- About Section -->

<section id="actions" class="container content-section text-center">


<!-- <div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>About Grayscale</h2>
<p>Grayscale is a free Bootstrap 3 theme created by Start Bootstrap. It can be
yours right now, simply download the template on <a
href="http://startbootstrap.com/template-overviews/grayscale/">the preview page</a>.
The theme is open source, and you can use it for any purpose, personal or commercial.</p>
<p>This theme features stock photos by <a
href="http://gratisography.com/">Gratisography</a> along with a custom Google Maps skin
courtesy of <a href="http://snazzymaps.com/">Snazzy Maps</a>.</p>
<p>Grayscale includes full HTML, CSS, and custom JavaScript files along with
LESS files for easy customization.</p>
</div>
</div>-->
<div class="row">
<div class="col-sm-6 col-md-3">
<div class="thumbnail">
<img class="img-class" src="images/img/home.png"
alt="Generic placeholder thumbnail">
</div>
<div class="caption">
<h3>Apartment Info.</h3>
<p>check apartments status</p>
<p>
103

<a href="/apartment_info" class="btn btn-default" role="button">


Status
</a>

</p>
</div>
</div>

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


<div class="thumbnail">
<img class="img-class" src="images/img/keep.png"
alt="Generic placeholder thumbnail">
</div>
<div class="caption">
<h3>Payroll</h3>
<p>check out accounts</p>
<p>
<a href="/payroll" class="btn btn-default" role="button" >
Payroll
</a>

</p>
</div>
</div>

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


<div class="thumbnail">
<img class="img-class" src="images/img/account.png"
alt="Generic placeholder thumbnail">
</div>
<div class="caption">
<p hidden id="toconfirm"> <%= account %> </p>

104

<h3>Accounts</h3>
<p>Approve residents accounts</p>
<p>
<a href="#req" class="btn btn-default" id="confirm_button" role="button" datatoggle="modal" onclick="Approval()" >
Approve
</a>

</p>
<div id="req" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" ariahidden="true">&times;</button>
<h4 class="modal-title" id="nog1">Request</h4>
</div>
<div class="modal-body">
<p id="nog">No request To approve</p>

</div>
<div class="modal-footer">

<button type="button" class="btn btn-default" value="approve"


onclick="Confirmation('accept')">Approve</button>
<button type="button" class="btn btn-default" value="discard"
onclick="Confirmation('discard')">Discard</button>

</div>
</div>
</div>
</div>
</div>

105

</div>

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


<div class="thumbnail">
<img class="img-class" src="images/img/family.png"
alt="Generic placeholder thumbnail">
</div>
<div class="caption">
<h3>Residents Info.</h3>
<p>Residents information</p>
<p>
<a href="/Resident_Info" class="btn btn-default" role="button" >
Residents
</a>

</p>
</div>
</div>
<br>
<br>
<br>

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


<div class="thumbnail">
<img class="img-class" src="images/img/note.png"
alt="Generic placeholder thumbnail">
</div>
<div class="caption">
<h3>notifications</h3>
<p>send public notifications</p>
<p>
<a href="#myModal" class="btn btn-default" role="button" data-toggle="modal">

106

Notify
</a>

</p>
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" ariahidden="true">&times;</button>
<h4 class="modal-title" id="nog">Send Notification</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="control-label col-sm-2" id="nog" for="subj">Subject:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="subj" name="subj" placeholder="Enter
subject">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" id="nog" for="noti">Notification:</label>
<div class="col-sm-10">
<textarea class="form-control" rows="5" id="noti" name="noti" placeholder="Write
something"></textarea>
</div>
</div>

<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal"
id="Noti_Close">Close</button>
<button type="button" class="btn btn-default"
onclick="Notify()">Send</button>
107

</div>
</form>
</div>

</div>
</div>
</div>
</div>

</div>

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


<div class="thumbnail">
<img class="img-class" src="images/img/message.png"
alt="Generic placeholder thumbnail">
</div>
<div class="caption">
<h3>Message</h3>
<p>send private message</p>
<p>
<a href="#yModal" class="btn btn-default" role="button" data-toggle="modal">
send
</a>
<a href="#not" class="btn btn-default" role="button" data-toggle="modal"
onclick="View_Message()">
view
</a>

</p>
<div id="yModal" class="modal fade">
<div class="modal-dialog">

108

<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" ariahidden="true">&times;</button>
<h4 class="modal-title" id="nog">Send Message</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="control-label col-sm-2" for="to" id="nog">To:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="to" name="to" placeholder="Enter Id">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="subjm" id="nog">Subject:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="subjm" name="subjm"
placeholder="Enter subject">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="mess" id="nog">Message:</label>
<div class="col-sm-10">
<textarea class="form-control" rows="5" id="mess" name="mess" placeholder="Write
Message"></textarea>
</div>
</div>

<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal"
id="mess_close">Close</button>
<button type="button" class="btn btn-default"
onclick="Message()">Send</button>
109

</div>
</form>
</div>

</div>
</div>
</div>
<div id="not" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" ariahidden="true">&times;</button>
<h4 class="modal-title" id="nog3">New Message</h4>
</div>
<div class="modal-body" id="list">
<p id="nog2">Check out new messages from here</p>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" datadismiss="modal">Okay</button>

</div>
</div>
</div>
</div>
</div>
</div> </div>
</section>
<!-- Contact Section -->
<section id="contact" class="container content-section text-center">
<div class="row">
110

<div class="col-lg-8 col-lg-offset-2">


<h2>Contact</h2>
<p>Feel free to email us to provide some feedback on our web, give us
suggestions for new amendments and updates</p>

<ul class="list-inline banner-social-buttons">


<li>
<a href="#" class="btn btn-default btn-lg"><i class="fa fa-twitter fafw"></i> <span class="network-name">Twitter</span></a>
</li>
<li>
<a href="#" class="btn btn-default btn-lg"><i class="fa fa-facebook fafw"></i> <span class="network-name">Facebook</span></a>
</li>
<li>
<a href="#" class="btn btn-default btn-lg"><i class="fa fa-google-plus fafw"></i> <span class="network-name">Google+</span></a>
</li>
</ul>
</div>
</div>
</section>

<!-- Map Section -->

<!-- Footer -->


<footer>
<div class="container text-center">
<p>Copyright &copy; Apartment Portal 2015</p>
</div>
</footer>

<!-- jQuery -->

111

<script src="/javascripts/js/jquery.js"></script>

<!-- Bootstrap Core JavaScript -->


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

<!-- Plugin JavaScript -->


<script src="/javascripts/js/jquery.easing.min.js"></script>

<!-- Google Maps API Key - Use your own API key to enable the map feature. More
information on the Google Maps API can be found at https://developers.google.com/maps/
-->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?
key=AIzaSyCRngKslUGJTlibkQ3FkfTxj3Xss1UlZDA&sensor=false"></script>

<!-- Custom Theme JavaScript -->


<script src="/javascripts/js/grayscale.js"></script>

<script src="/javascripts/myApp.js"></script>

</body>

</html>

apartmentinfo.ejs
<html>
<head>

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

<!-- Custom CSS -->

<!-- Custom Fonts -->


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

<link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic"
rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet"
type="text/css">
<link href='/stylesheets/css/style.css' rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

<script>
function Apartment_Info() {
var fno = document.getElementById("fno").value;
$.ajax({
type: "post",
url: "/apartment_info",
data: {fno:fno},
success: function (data) {
if(data!="no user")
Table_create(data);
else{alert("no data available");}
},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 500) {
alert('Internal error: ' + jqXHR.responseText);
} else {
alert('Unexpected error.');
}
}
})
}

function Table_create(infor){
document.getElementById("tablebody").innerHTML="";
var len=infor.length;
var table=document.getElementById("tablebody");
113

for(var i=0;i<len;i++){
var row = table.insertRow(0);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
var cell4 = row.insertCell(3);
var cell5 = row.insertCell(4);
var cell6 = row.insertCell(5);
cell1.innerHTML = infor[i].Billing_Month;
cell2.innerHTML = infor[i].Paid_Cash;
cell3.innerHTML = infor[i].Due_Months;
cell3.innerHTML = infor[i].Due_Cash;
cell3.innerHTML = infor[i].Balance;
cell3.innerHTML = infor[i].Total;
}
document.getElementById("table").removeAttribute("hidden");

</script>
</head>
<body>
<div class="container">
<label> Flat_Number:</label>
<input type="text" id="fno" name="fno">
<input type="button" value="Search" onclick="Apartment_Info()">
</div>

<div class="container" id="table" hidden>


<table class="table table-striped" id="myTable">
<thead>

114

<tr>
<th>Billing Month</th>
<th>Paid Cash</th>
<th>Due Months</th>
<th>Due Cash</th>
<th>Balance</th>
<th>Total</th>
</tr>
</thead>
<tbody id="tablebody">

</tbody>
</table>
</div>

<script src="/javascripts/js/jquery.js"></script>

<!-- Bootstrap Core JavaScript -->


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

<!-- Plugin JavaScript -->


<script src="/javascripts/js/jquery.easing.min.js"></script>

<!-- Google Maps API Key - Use your own API key to enable the map feature. More
information on the Google Maps API can be found at https://developers.google.com/maps/
-->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?
key=AIzaSyCRngKslUGJTlibkQ3FkfTxj3Xss1UlZDA&sensor=false"></script>

<!-- Custom Theme JavaScript -->


<script src="/javascripts/js/grayscale.js"></script>

115

</body>
</html>

index.ejs
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<title>Apartment Portal</title>

<!-- Bootstrap Core CSS -->


<link href='/stylesheets/css/bootstrap.min.css' rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<!-- Custom CSS -->


<link href='/stylesheets/css/grayscale.css' rel="stylesheet">

<!-- Custom Fonts -->


<link href='/font-awesome/css/font-awesome.min.css' rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic"
rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet"
type="text/css">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

116

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

</head>

<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">

<!-- Navigation -->


<nav class="navbar navbar-custom navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" datatarget=".navbar-main-collapse">
<i class="fa fa-bars"></i>
</button>
<a class="navbar-brand page-scroll" href="#page-top">
<i class="fa fa-play-circle"></i> <span class="light">Apartment</span>
Portal
</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right navbar-main-collapse">
<ul class="nav navbar-nav">
<!-- Hidden li included to remove active class from about link when scrolled up
past about section -->
<li class="hidden">
<a href="#page-top"></a>
</li>
<li>
<a class="page-scroll" href="#about">About</a>

117

</li>
<li>
<a class="page-scroll" href="#services">Services</a>
<ul class="dropdown-menu">
<li>payroll</li>
</ul>
</li>
<li>
<a class="page-scroll" href="#contact">Contact</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>

<!-- Intro Header -->


<header class="intro">
<div class="intro-body">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1 class="brand-heading">PORTAL SYSTEM</h1>
<p class="intro-text">A Portal System to Satisfy the needs of residents</p>
<a href="#about" class="btn btn-circle page-scroll">
<i class="fa fa-angle-double-down animated"></i>
</a>
</div>
</div>
</div>
</div>

118

</header>

<!-- About Section -->


<section id="about" class="container content-section text-center">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>About Our Portal System</h2>
<p>Our portal System is designed to satisfy the needs of residents. To entertain
residents through chatting and online TV. Residents can also manage there accounts
also</p>
<h2>Join hands with us.</h2>
</div>
</div>
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<ul class="list-inline banner-social-buttons">
<li>
<a href="#simodal" class="btn btn-default btn-lg" role="button" datatoggle="modal"><span>Sign In</span></a>
<div id="simodal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" ariahidden="true">&times;</button>
<h4 class="modal-title" id="nog">Sign in</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form" action="/dashboard"
method="post">
<div class="form-group" >
<label class="control-label col-sm-2" id="nog" for="usn">Username:</label>
<div class="col-sm-10">

119

<input type="text" class="form-control" id="Uname" name="U_name"


placeholder="Type Username">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" id="nog" for="pas">Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="pass" name="P_word"
placeholder="Type Password">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="optn" id="nog">Sign in As:</label>
<div class="col-sm-10">
<select class="form-control" id="opt" name="opt">
<option name="user">User</option>
<option name="admin">Admin</option>

</select>
</div>
</div>

<div class="modal-footer">
<button type="button" class="btn btn-danger" datadismiss="modal">Close</button>
<button type="submit" class="btn btn-default">Sign in</button>
</div>
</form>
</div>

</div>
</div>
</div>

120

</li>
<li>
<a href="#sumodal" class="btn btn-default btn-lg"role="button" datatoggle="modal"><span>Sign Up</span></a>
<div id="sumodal" class="modal fade">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" ariahidden="true">&times;</button>
<h4 class="modal-title" id="nog">Sign Up</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form" action="/sign_up" method="post">
<div class="form-group">
<label class="control-label col-sm-2" id="nog" for="flno">Flat No:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="Flno" name="Flno" placeholder="Type
Flat number">
</div>
</div>

<div class="form-group">
<label class="control-label col-sm-2" id="nog" for="nod">No of Dependents:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="Nom" name="Nom" placeholder="Total
family members">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" id="nog" for="usnu">Username:</label>
<div class="col-sm-10">

121

<input type="text" class="form-control" id="Uname" name="Uname"


placeholder="Type Username">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" id="nog" for="pasd">Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="Pass" name="Pass"
placeholder="Type Password">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" id="nog" for="repasd">Confirm
Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="Cpass" name="Cpass"
placeholder="Retype Password">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" id="nog" for="aname">Admin Name:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="adname" name="adname"
placeholder="Type Your's Admin name">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="optn" id="nog">Sign Up As:</label>
<div class="col-sm-10">
<select class="form-control" id="opt" name="opt">
<option id="user" name="user">User</option>
<option id="admin" name="admin">Admin</option>

</select>
122

</div>
</div>

<div class="modal-footer">
<button type="button" class="btn btn-primary" datadismiss="modal">Close</button>
<button type="submit" class="btn btn-default">Sign up</button>
</div>
</form>
</div>

</div>
</div>
</div>
</li>

</ul>
</div>
</div>
<br>
<div class="gallery-section">
<div class="container">
<div class="col-lg-8 col-lg-offset-2">
<h2>know about us</h2>
<p>View Gallery</p>
<a href="#" class="btn btn-default btn-lg">gallery</a>

</div>
</div>

</div>
</section>

123

<!-- services section -->


<section id="services" class="content-section text-center">
<h2>Services we provide</h2>
<p>Which Helps you through and Entertain You</p>
<div class="services-section">
<div class="container">
<div class="col-lg-8 col-lg-offset-2">
<h2>Manage Your Accounts</h2>
<p>Through Payroll System</p>
<a href="#" class="btn btn-default btn-lg">Payroll</a>

</div>
</div>

</div>
<br>
<div class="tv-section">
<div class="container">
<div class="col-lg-8 col-lg-offset-2">
<h2>Watch Online TV!</h2>
<p>Through online Streaming</p>
<a href="live_streaming" class="btn btn-default btn-lg">Television</a>

</div>
</div>

</div>
<br>
<div class="chat-section">
<div class="container">
<div class="col-lg-8 col-lg-offset-2">

124

<h2>Connect With Your friends</h2>


<p>Through Chatting</p>
<a href="#" class="btn btn-default btn-lg">Chatting</a>

</div>
</div>

</div>
</section>

<!-- Contact Section -->


<section id="contact" class="container content-section text-center">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>Contact Us</h2>
<p>Feel free to email us to provide some feedback on our services, give us
suggestions for new services and betterment, or to just say hello!</p>
<ul class="list-inline banner-social-buttons">
<li>
<a href="https://www.facebook.com/apartmentportal" class="btn btn-default
btn-lg"><i class="fa fa-facebook fa-fw"></i> <span class="networkname">Facebook</span></a>
</li>
<li>
<a href="http://www.twitter.com" class="btn btn-default btn-lg"><i
class="fa fa-twitter fa-fw"></i> <span class="network-name">twitter</span></a>
</li>
<li>
<a href="http://www.plus.google.com" class="btn btn-default btn-lg"><i
class="fa fa-google-plus fa-fw"></i> <span class="network-name">Google+</span></a>
</li>
</ul>
</div>
</div>
125

</section>

<!-- Footer -->


<footer>
<div class="container text-center">
<p>Copyright &copy; Apartment Portal 2015</p>
</div>
</footer>

<!-- jQuery -->


<script src="/javascripts/js/jquery.js"></script>

<!-- Bootstrap Core JavaScript -->


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

<!-- Plugin JavaScript -->


<script src="/javascripts/js/jquery.easing.min.js"></script>

<!-- Custom Theme JavaScript -->


<script src="/javascripts/js/grayscale.js"></script>

</body>

</html>

live_streaming
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
126

<title>television</title>
</head>
<body>
<body bgcolor="#000000" style="margin: 0px; padding: 0px;" leftmargin="0"
topmargin="0" marginheight="0" marginwidth="0">

<iframe width="600" height="430" src="http://rt.com/on-air/embed/" frameborder="0"


allowfullscreen=""></iframe>

<div class="videoBoxContainer" id="html1" style="position: absolute; overflow: hidden;


width: 600px; height: 430px; top: 0px; left: 0px; z-index: 2; display: none;">
<script>
document.write('<a href="http://cdn.adstract.com/adstract/tags/xdirect/xdirect.html?
p=66701052&serverdomain=adstrac&ct=html&ap=1304&cb=[CACHEBUSTER]"
target="_blank"><img src="http://cdn.adstract.com/adstract/creatives/66441063" alt=""
width="600" height="430" /></a>');
</script><a href="http://cdn.adstract.com/adstract/tags/xdirect/xdirect.html?
p=66701052&amp;serverdomain=adstrac&amp;ct=html&amp;ap=1304&amp;cb=[CACHEB
USTER]" target="_blank"><img src="http://cdn.adstract.com/adstract/creatives/66441063"
alt="" width="0" height="0" style="display: none !important; visibility: hidden !important;
opacity: 0 !important; background-position: 600px 430px;"></a>
<div id="button3" style="position: absolute; right: 3px; top: 230px; width: 15px; height:
15px; visibility: visible;"><span
onmouseup="document.getElementById('html1').style.display='none'"
onmouseover="document.getElementById('button3').style.top='230';document.getElement
ById('button1').style.left='470'"><img src="http://i45.tinypic.com/qow28w.png" alt=""
height="9" width="9"></span></div>

<br>
<br>
<!-- Histats.com START (hidden counter)-->
<script type="text/javascript">document.write(unescape("%3Cscript src=
%27http://s10.histats.com/js15.js%27 type=%27text/javascript%27%3E%3C/script
%3E"));</script><script src="http://s10.histats.com/js15.js"
type="text/javascript"></script>
<a href="http://www.histats.com" target="_blank" title="html hit counter"><script
type="text/javascript">

127

try {Histats.start(1,1852587,4,0,0,0,"");
Histats.track_hits();} catch(err){};
</script>
<script type="text/javascript" language="JavaScript"
src="http://s4.histats.com/stats/0.php?
1852587&amp;@f16&amp;@g1&amp;@h1&amp;@i1&amp;@j1436472636288&amp;@k0&a
mp;@l1&amp;@m&amp;@n0&amp;@ohttp%3A%2F%2Ffancystreams.com%2Ftvcat
%2Fnewstv.php&amp;@q0&amp;@r0&amp;@s0&amp;@ten-US&amp;@u1366&amp;@vhttp
%3A%2F%2Fwww.fancystreams.com%2Findexnews.html&amp;@w">

</script>
</a>
<noscript>&lt;a href="http://www.histats.com" target="_blank"&gt;&lt;img
src="http://sstatic1.histats.com/0.gif?1852587&amp;101" alt="html hit counter"
border="0"&gt;&lt;/a&gt;</noscript>
<!-- Histats.com END -->

</div></body>
</body>
</html>

Payroll.ejs
<!DOCTYPE html>
<html lang="en">

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

<!-- Custom CSS -->


<link href='/stylesheets/css/grayscale.css' rel="stylesheet">

<!-- Custom Fonts -->


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

128

<link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic"
rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet"
type="text/css">
<link href='/stylesheets/css/style.css' rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
function Expenses(){
var utbl=document.getElementById("utbl").value;
var otbl=document.getElementById("otbl").value;
var sale=document.getElementById("sale").value;
var mchrg=document.getElementById("mchrg").value;
var tulex=document.getElementById("tulex").value;

$.ajax({
type:"POST",
url:"/expenses",
data:{
utbll:utbl,
otbll:otbl,
salee:sale,
mchrgg:mchrg,
tulexx:tulex
},
success: function(abc){
alert(abc);
},
error:function(jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 500) {
alert('Internal error: ' + jqXHR.responseText);
} else {
alert('Unexpected error.');
}
129

}
});
}

function Funds(){
$.ajax({
type:"POST",
url:"/funds",
data:{
aptid:document.getElementById("aptid").value,
mont:document.getElementById("mont").value,
pdcash:document.getElementById("pdcash").value,
dum:document.getElementById("dum").value,
dcash:document.getElementById("dcash").value,
bal:document.getElementById("bal").value,
tul:document.getElementById("tul").value
},
success:function(response){
alert(response);
},
error:function(textstatus, errorThrown) {
alert('text status ' + textstatus + ', err ' + errorThrown);
}
});
}

function Salaries(){
$.ajax({
type:"POST",
url:"/salaries",
data:{

130

empid:document.getElementById("empid").value,
empn:document.getElementById("empn").value,
samo:document.getElementById("samo").value,
samount:document.getElementById("samount").value
},
success:function(){
alert("success");
},
error:function(jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 500) {
alert('Internal error: ' + jqXHR.responseText);
} else {
alert('Unexpected error.');
}
}
});
}

</script>

</head>
<body>
<h1
style="padding:20px;">PAYROLL</h1>
<hr>
<div class="container">
<h2 style="padding-top:20px;">expenses<p class="lead"></p></h2>

<form role="form" class="form-horizontal" id="expenses" name="expenses">

<div class="form-group">
<label class="col-sm-1" for="utbls">Utility Bills:</label>

131

<div class="col-sm-10"><input type="text" class="form-control" id="utbl" name="utbl"


placeholder="Utility Bills Expenses"></div>
</div>
<div class="form-group">
<label class="col-sm-1" for="otbls">Other Bills:</label>
<div class="col-sm-10"><input type="text" class="form-control" id="otbl" name="otbl"
placeholder="water tanker, etc"></div>
</div>
<div class="form-group">
<div class="col-sm-4"><label>Salaries:</label><input type="text" class="form-control"
placeholder="salr" id="sale" name="sale"></div>
<div class="col-sm-3"><label>Misc. Services:</label><input type="text" class="formcontrol" placeholder="Other Charges" id="mchrg" name="mchrg"></div>

<div class="col-sm-4"><label>Total:</label><input type="text" class="form-control"


placeholder="Total expense" id="tulex" name="tulex"></div>
</div>

<div class="form-group">
<div class="col-sm-6">
<input type="button" class="btn btn-info pull-left" onclick="Expenses()"
value="Submit"/>
</div>
</div>

</form>
<hr>
</div>
<div class="container">
<h2 style="padding-top:20px;">funds<p class="lead"></p></h2>

<form role="form" class="form-horizontal" id="funds">

132

<div class="form-group">
<label class="col-sm-1" for="aptid">Apartment ID:</label>
<div class="col-sm-10"><input type="text" class="form-control" id="aptid"
name="aptid" placeholder="Type Apartment id"></div>
</div>
<div class="form-group">
<label class="col-sm-1" for="bilmo">Billing Month:</label>
<div class="col-sm-10"><select class="form-control" id="mont" name="mont"
placeholder="Select Month">
<option>Jan</option>
<option>Feb</option>
<option>Mar</option>
<option>Apr</option>
<option>May</option>
<option>Jun</option>
<option>Jul</option>
<option>Aug</option>
<option>Sep</option>
<option>Oct</option>
<option>Nov</option>
<option>Dec</option>
</select></div>
</div>
<div class="form-group">
<div class="col-sm-5"><label>Paid Cash:</label><input type="text" class="formcontrol" placeholder="Paid Cash" id="pdcash" name="pdcash">
</div>
<div class="col-sm-6"><label>Due Months:</label><select class="form-control"
id="dum" name="dum" placeholder="Number of Months">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>

133

<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select></div>
</div>
<div class="form-group">
<div class="col-sm-4"><label>Due Cash:</label><input type="text" class="formcontrol" placeholder="Due Cash" id="dcash" name="dcash"></div>
<div class="col-sm-3"><label>Balance:</label><input type="text" class="form-control"
placeholder="Balance" id="bal" name="bal"></div>

<div class="col-sm-4"><label>Total:</label><input type="text" class="form-control"


placeholder="Total" id="tul" name="tul"></div>
</div>
<div class="form-group">

<div class="col-sm-6">
<input type="button" class="btn btn-success pull-left" value="Submit"
onclick="Funds()"/>
</div>
</div>
</form>
<hr>
</div>
<div class="container">
<h2 style="padding-top:20px;">salaries<p class="lead"></p></h2>
<form role="form" class="form-horizontal" id="salaries">

134

<div class="form-group">
<label class="col-sm-1" for="empl">Employee ID:</label>
<div class="col-sm-10"><input type="text" class="form-control" id="empid"
name="empid" placeholder="Type Employee id"></div>
</div>
<div class="form-group">
<label class="col-sm-1" for="emplnm">Employee Name:</label>
<div class="col-sm-10"><input type="text" class="form-control" id="empn"
name="empn" placeholder="Type Employee name"></div>
</div>
<div class="form-group">
<div class="col-sm-6"><label for="samonth">Salary Month:</label><select
class="form-control" id="samo" name="samo" placeholder="Select Month">
<option>Jan</option>
<option>Feb</option>
<option>Mar</option>
<option>Apr</option>
<option>May</option>
<option>Jun</option>
<option>Jul</option>
<option>Aug</option>
<option>Sep</option>
<option>Oct</option>
<option>Nov</option>
<option>Dec</option>
</select></div>
<div class="col-sm-5"><label>Salary Amount:</label><input type="text" class="formcontrol" placeholder="Amount" id="samount" name="samount">
</div>
</div>
<div class="form-group">

135

<div class="col-sm-6">
<input type="button" class="btn btn-primary pull-left" value="Submit"
onclick="Salaries()"/>

</div>

</div>
</form>

<hr>
<a href="/view_payroll" class="btn btn-default" role="button" >
View
</a>
</div>

<footer>
<div class="container text-center">
<p>Copyright &copy; Apartment Portal 2015</p>
</div>
</footer>
<!-- jQuery -->
<script src="/javascripts/js/jquery.js"></script>

<!-- Bootstrap Core JavaScript -->


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

<!-- Plugin JavaScript -->


<script src="/javascripts/js/jquery.easing.min.js"></script>

<!-- Google Maps API Key - Use your own API key to enable the map feature. More
information on the Google Maps API can be found at https://developers.google.com/maps/
-->

136

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?


key=AIzaSyCRngKslUGJTlibkQ3FkfTxj3Xss1UlZDA&sensor=false"></script>

<!-- Custom Theme JavaScript -->


<script src="/javascripts/js/grayscale.js"></script>
</body>
</html>

Residents_info.ejs
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script
src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

<script>
window.onload=function() {
var data =<%- JSON.stringify(info) %>;
var len=data.length;
var table=document.getElementById("tablebody");
for(var i=0;i<len;i++){
var row = table.insertRow(0);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
cell1.innerHTML = data[i].User_Name;
cell2.innerHTML = data[i].Flat_No;
cell3.innerHTML = data[i].Family_Members;
}

137

</script>

</head>

<body>

<div class="container">
<table class="table table-striped" id="myTable">
<thead>
<tr>
<th>Username</th>
<th>Flat Number</th>
<th>Family Members</th>
</tr>
</thead>
<tbody id="tablebody">

</tbody>
</table>
</div>

</body>
</html>

signup.ejs
<!DOCTYPE html>
<html lang="en">
<head>
<title>Sign up!</title>
<meta charset="utf-8">
138

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


<link rel="stylesheet"
href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script
src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>

</head>
<style type="text/css">
#bt{
margin-left: 50pt;
}
</style>
<body>

<div class="container">
<h2>Sign Up Here</h2>
<form class="form-horizontal" role="form" action="/sign_up" method="post">

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


<div class="form-group">
<label for="Fname" class="col-md-4 control-label">First Name:</label>
<div class="col-md-8">
<input type="text" class="form-control" id="Fname" name="Fname"
placeholder="Fisrt Name">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="form-group">
<label for="Lname" class="col-md-4 control-label">Last Name:</label>
<div class="col-md-8">

139

<input type="text" class="form-control" id="Lname" name="Lname"


placeholder="Last Name">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="form-group">
<label for="cnic" class="col-md-4 control-label">CNIC:</label>
<div class="col-md-8">
<input type="text" class="form-control" id="cnic" name="cnic" placeholder="Your's
CNIC">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="form-group">
<label for="Flno" class="col-md-4 control-label">Flat no:</label>
<div class="col-md-8">
<input type="text" class="form-control" id="Flno" name="Flno" placeholder="Your
Flat no.">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="form-group">
<label for="Nom" class="col-md-6 control-label">Total family Members:</label>
<div class="col-md-6">
<input type="text" class="form-control" id="Nom" name="Nom" placeholder="No.
Of Members">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">

140

<div class="form-group">
<label for="email" class="col-md-4 control-label">Email:</label>
<div class="col-md-8">
<input type="email" class="form-control" id="email" name="email"
placeholder="your email id">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="form-group">
<label for="Uname" class="col-md-4 control-label">User Name:</label>
<div class="col-md-8">
<input type="text" class="form-control" id="Uname" name="Uname"
placeholder="User name">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="form-group">
<label for="Pass" class="col-md-4 control-label">Password:</label>
<div class="col-md-8">
<input type="password" class="form-control" id="Pass" name="Pass"
placeholder="Password">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="form-group">
<label for="Cpass" class="col-md-4 control-label">Confirm Password:</label>
<div class="col-md-8">
<input type="password" class="form-control" id="Cpass" name="Cpass"
placeholder="Retype Password">
</div>

141

</div>
</div>
<div class="col-sm-6 col-md-3 col-lg-4">
<div class="form-group">
<div class="col-md-12">
<button type="submit" class="btn btn-primary" id="bt">Sign Up</button>
</div>
</div>
</div>
</form>
</div>

</body>
</html>
users.ejs
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<title>User</title>

<!-- Bootstrap Core CSS -->


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

<!-- Custom CSS -->

142

<link href='/stylesheets/css/grayscale.css' rel="stylesheet">


<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<!-- Custom Fonts -->


<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic"
rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet"
type="text/css">
<link href='/stylesheets/css/style.css' rel="stylesheet" type="text/css">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

<script src="/javascripts/myApp.js"></script>

<script>
function signout(){
xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST","/signout", true);
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
string=xmlhttp.responseText;
}
}
xmlhttp.send();
}

143

function View_Notification(){
$.ajax({
type:"POST",
url:"/view_notification",
success:function(data){
console.log(data);
//console.log(document.getElementById("myLI").parentNode.nodeName;)
//alert(document.getElementById("nog").textContent);

document.getElementById("nog").innerHTML=data.Text;
document.getElementById("nog1").innerHTML=data.Subject;

},
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 500) {
alert('Internal error: ' + jqXHR.responseText);
} else {
alert('Unexpected error.');
}
}
})
}

</script>

</head>

<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">

<!-- Navigation -->


<nav class="navbar navbar-custom navbar-fixed-top" role="navigation">
<div class="container">

144

<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" datatarget=".navbar-main-collapse">
<i class="fa fa-bars"></i>
</button>
<a class="navbar-brand page-scroll" href="#page-top">
<i class="fa fa-user"></i> <span class="light">Welcome</span>
</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right navbar-main-collapse">
<ul class="nav navbar-nav">
<!-- Hidden li included to remove active class from about link when scrolled up
past about section -->
<li class="hidden">
<a href="#page-top"></a>
</li>
<li>
<a class="page-scroll" href="#contact">Contact US</a>
</li>
<li class="dropdown">
<a href="#actions" class="page-scroll dropdown-toggle" datatoggle="dropdown" >Actions</a>

<ul class="dropdown-menu">
<li><a href="#">Account</a></li>
<li><a href="#">Notifications</a></li>
<li><a href="#">Messages</a></li>
<li><a href="/live_streaming">Television</a></li>
</ul>
</li>
<!--<li class="dropdown">

145

<a class="page-scroll " data-toggle="dropdown" href="#">


<span class="caret"></span></a>

</li>-->
<li>
<a href="/" onclick="signout()">Sign Out</a>
</li>

</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>

<!-- Intro Header -->


<!--<header class="intro">
<div class="intro-body">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1 class="brand-heading">PORTAL SYSTEM</h1>
<p class="intro-text">A Portal System to Satisfy the needs of
customers</p>
<a href="#about" class="btn btn-circle page-scroll">
<i class="fa fa-angle-double-down animated"></i>
</a>
</div>
</div>
</div>
</div>
</header>-->

146

<!-- About Section -->

<section id="actions" class="container content-section text-center">


<!-- <div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>About Grayscale</h2>
<p>Grayscale is a free Bootstrap 3 theme created by Start Bootstrap. It can be
yours right now, simply download the template on <a
href="http://startbootstrap.com/template-overviews/grayscale/">the preview page</a>.
The theme is open source, and you can use it for any purpose, personal or commercial.</p>
<p>This theme features stock photos by <a
href="http://gratisography.com/">Gratisography</a> along with a custom Google Maps skin
courtesy of <a href="http://snazzymaps.com/">Snazzy Maps</a>.</p>
<p>Grayscale includes full HTML, CSS, and custom JavaScript files along with
LESS files for easy customization.</p>
</div>
</div>-->
<div class="row">
<div class="col-sm-6 col-md-3">
<div class="thumbnail">
<img class="img-class" src="/images/img/keep.png"
alt="Generic placeholder thumbnail">
</div>
<div class="caption">
<h3>Payroll</h3>
<p>Inquire your Balance</p>
<p>
<a href="/information" class="btn btn-default" role="button">
Account
</a>

</p>
</div>
147

</div>

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


<div class="thumbnail">
<img class="img-class" src="/images/img/note.png"
alt="Generic placeholder thumbnail">
</div>
<div class="caption">
<h3>Notifications</h3>
<p>check out notifications</p>
<p>
<a href="#notif" class="btn btn-default" role="button" data-toggle="modal"
onclick="View_Notification()">
Notifications
</a>

</p>
<div id="notif" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" ariahidden="true">&times;</button>
<h4 class="modal-title" id="nog1">New Notification</h4>
</div>
<div class="modal-body">
<p id="nog">Check out new notifications from here</p>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" datadismiss="modal">Okay</button>

148

</div>
</div>
</div>
</div>
</div>
</div>

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


<div class="thumbnail">
<img class="img-class" src="/images/img/message.png"
alt="Generic placeholder thumbnail">
</div>
<div class="caption">
<h3>Messages</h3>
<p>Check out Messages</p>
<p>
<a href="#not" class="btn btn-default" role="button" data-toggle="modal"
onclick="View_Message()">
View
</a>
<a href="#send" class="btn btn-default" role="button" data-toggle="modal">
send
</a>

</p>
<div id="not" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" ariahidden="true">&times;</button>
<h4 class="modal-title" id="nog3">New Message</h4>
</div>
149

<div class="modal-body" id="list">


<p id="nog2">Check out new messages from here</p>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" datadismiss="modal">Okay</button>

</div>
</div>
</div>
</div>
<div id="send" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" ariahidden="true">&times;</button>
<h4 class="modal-title" id="nog">message to admin</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="control-label col-sm-2" for="to" id="nog">To:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="to" name="to"
placeholder="Enter Id">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" id="nog" for="subj">Subject:</label>
<div class="col-sm-10">

150

<input type="text" class="form-control" id="subjm" name="subjm"


placeholder="Enter subject">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" id="nog" for="noti">Message:</label>
<div class="col-sm-10">
<textarea class="form-control" rows="5" id="mess" name="mess" placeholder="Write
something"></textarea>
</div>
</div>

<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal"
id="mess_close">Close</button>
<button type="button" class="btn btn-default"
onclick="Message()">Send</button>
</div>
</form>
</div>

</div>
</div>
</div>
</div>
</div>

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


<div class="thumbnail">
<img class="img-class" src="/images/img/tele.png"
alt="Generic placeholder thumbnail">
</div>
<div class="caption">

151

<h3>Television</h3>
<p>Watch Online TV!</p>
<p>
<a href="/live_streaming" class="btn btn-default" role="button">
Television
</a>

</p>
</div>
</div>
<br>
<br>
<br>

</div>
</section>
<!-- Contact Section -->
<section id="contact" class="container content-section text-center">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>Contact</h2>
<p>Feel free to email us to provide some feedback on our web, give us
suggestions for new amendments and updates</p>

<ul class="list-inline banner-social-buttons">


<li>
<a href="#" class="btn btn-default btn-lg"><i class="fa fa-twitter fafw"></i> <span class="network-name">Twitter</span></a>
</li>
<li>
<a href="#" class="btn btn-default btn-lg"><i class="fa fa-facebook fafw"></i> <span class="network-name">Facebook</span></a>

152

</li>
<li>
<a href="#" class="btn btn-default btn-lg"><i class="fa fa-google-plus fafw"></i> <span class="network-name">Google+</span></a>
</li>
</ul>
</div>
</div>
</section>

<!-- Map Section -->

<!-- Footer -->


<footer>
<div class="container text-center">
<p>Copyright &copy; Apartment Portal 2015</p>
</div>
</footer>

<!-- jQuery -->


<script src="/javascripts/js/jquery.js"></script>

<!-- Bootstrap Core JavaScript -->


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

<!-- Plugin JavaScript -->


<script src="/javascripts/js/jquery.easing.min.js"></script>

<!-- Google Maps API Key - Use your own API key to enable the map feature. More
information on the Google Maps API can be found at https://developers.google.com/maps/
-->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?
key=AIzaSyCRngKslUGJTlibkQ3FkfTxj3Xss1UlZDA&sensor=false"></script>

153

<!-- Custom Theme JavaScript -->


<script src="/javascripts/js/grayscale.js"></script>

</body>

</html>

154

You might also like