Casa Gemma Documentation Sept 23
-
Upload
mark-christopher-guardaquivil-olegario -
Category
Documents
-
view
61 -
download
0
description
Transcript of Casa Gemma Documentation Sept 23
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 1/72
5-1
C.G.H.O.B.S.CASA GEMMA
HOTELONLINE BOOKING
SYSTEM
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 2/72
5-1
PROJECT PROPOSAL TITLE PAGE
CGHOBS
(CASA GEMMA HOTEL ONLINE BOOKING SYSTEM)
A Project ProposalPresented to
The Faculty of STI College Koronadal
In Partial Fulfillment
Of the Requirements
For the degree of
(Bachelor of Science Information Technology)
By:
Carpio, McHope B.
Gundran, Jaybee L.
Laminero, Kenneth B.
Olegario, Mark Christopher G.
______________________________
Mary Joy M. Velasco
Project Adviser
August 14, 2013
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 3/72
5-1
ADVISERS RECOMMENDATION SHEET
STI College Koronadal
ADVISERS RECOMMENDATION SHEET
This Project Proposal Entitled
CGHOBS
(CASA GEMMA HOTEL ONLINE BOOKING SYSTEM)
By:
Carpio, McHope B.
Gundran, Jaybee L.
Laminero, Kenneth B.
Olegario, Mark Christopher G.
And submitted in partial fulfillment of theSubmitted in partial fulfillment of the requirements of the
Bachelor of Science in Information TechnologyHas been examined and is hereby recommended
For acceptance and approval
_____________________
Mary Joy M. Velasco
Project Adviser
September 14, 2013
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 4/72
5-1
APPROVAL SHEET
STI College Koronadal
CGHOBS
(CASA GEMMA HOTEL ONLINE BOOKING SYSTEM)
Developed by:
Carpio, McHope B.
Gundran, Jaybee L.
Laminero, Kenneth B.
Olegario, Mark Christopher G.
After having been presented is hereby approved
By the following members of the panel
_____________________________
Edgar Mel Dacut
Project Coordinator
September 14, 2013
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 5/72
5-1
Abstract
Online hotel reservations are a popular method for booking hotel rooms. Travelers can
book rooms on a computer by using online security to protect their privacy and financial
information and by using several online travel agents to compare prices and facilities at
different hotels.
Prior to the Internet, travelers could write, telephone the hotel directly, or use a travel
agent to make a reservation. Nowadays, online travel agents have pictures of hotels and
rooms, information on prices and deals, and even information on local resorts. Many also
allow reviews of the traveler to be recorded with the online travel agent.
Online hotel reservations are also helpful for making last minute travel arrangements.
Hotels may drop the price of a room if some rooms are still available. There are several
websites that specialize in searches for deals on rooms.
Large hotel chains typically have direct connections to the airline national distribution
systems (GDS) (Sabre, Galileo, Amadeus, and Worldspan). These in turn provide hotel
information directly to the hundreds of thousands of travel agents that align themselves with
one of these systems. Individual hotels and small hotel chains often cannot afford the expense
of these direct connections and turn to other companies to provide the connections.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 6/72
5-1
Preface
An increasing number of hotels are building their own websites to allow them to market their
hotels directly to consumers. Non-franchise chain hotels require a "booking engine" application to be
attached to their website to permit people to book rooms in real time. One advantage of booking with
the hotel directly is the use of the hotel's full cancellation policy as well as not needing a deposit in
most situations.
The online booking engine applications are supported by Content management system(CMS).
Since the operation of the CASA Gemma Hotel, they used a manual method of booking and
reservation, which make their transaction a hassle, the proponents believe that the proposed
system will make the hotel transaction more efficient and reliable, thus enables the owner to
monitor hotel transactions and revenues.
The purpose of this study is to provide the company a reliable and efficient hotel
online booking system that will enable them to expand their market using the web
technologies. With the proposed system, the hotel management would be more secure and
well-organized.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 7/72
5-1
Chapter I
INTRODUCTION
1.1 Statement of the Problem
Based on the investigation conducted, the proponents have found out that the
company is using a manual booking of guests with the aid of Microsoft Excel and a
booking form for the customers.
In the process of carrying out of this function, these are the problems that have been
encountered by the Front Desk Officer of CASA Gemma Hotel, Delay in Generation
of reports, Difficulty in tracking the overall status of booking and reservation, Manual
tracking of records, data loss due to unsaved excel files.
The study aimed to devise an online hotel booking system, it is designed to
cater booking and reservation either trough walk-in, telephone or online transaction.
It is aimed to help desk officer to lessen their workloads in terms of booking
transactions, and for the manager, to open the database with ease, view and print the
reports and invoices without hassle.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 8/72
5-1
1.2 Current State of the Technology
Airfare reservation systems over attributes like information quality, system
use, system quality, service quality, and customer loyalty. Their results show that
North American-based websites outperform Asian-based ones. Landvogt (2004)
evaluates several online booking engines over 23 different criteria, like overall user
friendliness, payment method, instant confirmation, reliability, and invoicing function
among others. These criteria present some of the system’s functions and design
principles discussed further in the current paper. Law and Wong (2003) find the three
most important factors that contribute to a successful website, according to the on-line
purchasers, are secure payment methods, different price ranges of products/services,
and user-friendly system. Law and Hsu (2006) assess the dimensions of hotel websites
(information regarding the reservation, hotel facilities, contact details of the property,
surrounding area and website management) and attributes in each dimension mostly
valued by online users. Some of the most important website attributes are found to be
the room rates, availability and security of payments (in the reservation information
dimension), the location maps, hotel and room amenities (in facilities information),
telephone, address and email of the hotel (for contact information), transportation to
the hotel, airports and sights (for surrounding area information), and up-to-date
information, multilingual site and short download time (for website management). So
and Morrison (2004) applies similar criteria for website evaluation but they group
them into technical, Marketing, consumer perspective and destination information
perspective criteria.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 9/72
5-1
1.3 Objectives
1.3.1 General Objectives
This study aimed to provide an Online Booking system for CASA Gemma
hotel.
1.3.2 Specific Objectives
To develop an online booking system that will help the company expand
their marketing with the use of web services.
To provide a user friendly interface for the system that will help the front
desk do their duty without a hassle.
To provide a book report, sales report that needed by the hotel administrator
To provide a convenient booking for the guests online.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 10/72
5-1
1.3.3 Scope and Limitations
Scope
The CASA Gemma Hotel still uses a manual procedure in keeping records of their
clients and past, current and upcoming reservation of event and rooms. In making a
reservation the client must fill-up some forms such as waiver booking form and the
reservation form before proceeding to the cashier for payment. This type of process best
applies to walk-in customers only since they have the privilege of looking around the rooms
and facilities. As for phone call reservation same process applies but it takes more time
because of too many inquiries and question, and because it is not a face-to-face transaction
error is inevitable. With the use of online reservation system created by the proponents, this
will help the company in updating and improving their current system. The company will
have their own website with a user-friendly interface wherein customers can easily book a
room or plan an event through online giving them an easier way and hassle free reservation.
Since their records are only kept in a filing cabinet, it can easily be accessed by any staff in
the company, the online system will feature a registration and security module. This
registration module will allow every level of access to register to the system administrators
and customers. The adding of new customers in the database will be done by filling up an
application form which will be recorded in the database and the proposed system will
automatically generate an ID number that will also serve as proof that they are a registered
user. The user will then give personal information such as name, address, age, contact
numbers and email address. In addition, this module will also verify if the user has an existing
record and will prompt a message that the user account already exists and if not, it will be
recorded in the database. In terms of security, the proposed system will include a log-in form.
This will have two (2) levels of access. The first will be the administrator of the system and
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 11/72
5-1
the customer for the second level of access. The authorized users will have a unique username
and password, at least six to twelve (6-12) characters long and case sensitive. The user will be
allowed three (3) consecutive times of entering an invalid user name and password
combination. If ever the user exceeded the number of times in entering the invalid password,
forgot password which will generate a new password and send an email containing their log-
in details to the registered email address on their account. As for booking/planning an event,
the user will have the ability to manage and choose the rooms they need and will allow them
to set the date and time depending on its availability. In addition to that they can also make a
reservation for a certain type of events and add any additional services that they might need to
provide that there must be at least a minimum of three (3) days interval before the exact date
of the reservation. When reserving for a room the client must fill-up a form provided within
the site, he/she must indicate the date of the reservation (date and time to check-in and date
and time of possible checkout), the number of adults and the number children before
submitting the form. Same goes for planning an event, the user is required to fill-up a form,
he/she has must chose a type of event packages offered by the resort, indicate the target date
of the event and the possible number of visitors. After submitting the form a notification
message will be sent to the email address of the client confirming that the reservation is
successfully made, the notification will include details about the reservation, its total amount,
and the deadline of the reservationCancelation of any reservation can be made a day before
the target date, no refunds for the clients who already deposited their down-payment. The log-
in module is the registered user way of gaining access to the additional content of the website
not available to unregistered guest. The monitoring module will display an overview of the
system, the administrator is the only authorized person to view and manipulate the content of
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 12/72
5-1
this module (Calendar Overview, Room Overview, Confirmed Reservation Overview,
Pending Reservation Overview, Not Completed Reservations and User Overview). The report
module displays all the past, present and upcoming reservations/ events held in the resort
which can be viewed in a month or week display. This will also generate a report about which
month has the most reservations made, reservations/events that has been cancelled either by
the client or terminated by the system and what type of event packages is usually availed by
their clients. In file maintenance administrator can edit, update and add new offers to their
system, updating of account user is also included. The Help/Frequently Asked Questions
(FAQ) module answers the often encountered problems by the users and it also includes the
location map of the resort. The about module contains information about the resort, packages
offered. The proponents will be using PHP 5 as the front-end and MySQL as the back-end in
this system. The proponents chose PHP because of its open source in addition to that it also
runs on different platforms compatible with almost all servers used today. The Proponents
chose MySQL 5 as the data source because it is flexible and allows quick development in the
database and it is free to download. The use of a domain name over the internet will also be
required to successfully implement the online reservation. There will be assigned personnel in
order to develop the said proposed system such as the researcher, analyst and programmer.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 13/72
5-1
Limitation
The system will not be accepting payments through credit cards, ATM cards, checks, or debit
cards. It will only cater payments in a form of cash. In case a user forgot his/her password, the
system will not provide a password retrieval function but instead the user can ask for a new
password that can only be given by an administrator. The system’s scope doesn’t include the
payments for damage facility or equipment in a hotel.
The system will not provide financial reports. The system only displays other services offered
by the company but it is not included in the reservation form, the client can only reserve the
room and packages displayed in the website. Asking for any add-ons must be done directly to
any authorized person in the company. If the user is not registered member no possible
transaction can be done other than viewing the whole website, in terms of client inquiry the
administrator can only send a reply to any message sent by the client at a given time. Payment
for the reservation made is not included in the system, the customer must personally pay
through visiting the resort or depositing their payment to the company’s bank account which
is displayed in the site. The admin can only update/edit the price for each room and function
halls but he/she can’t edit the content of other modules such as the about module, other
services and rates. Also there is no audit trail included in the system.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 14/72
5-1
CHAPTER II
THEORETICAL FRAMEWORK
2.1 Introduction
The theoretical framework of the study is a structure that can hold or support a theory
of a research work. It presents the theory which explains why the problem under study exists.
Thus, the theoretical framework is but a theory that serves as a basis for conducting research.
Hotel Management involves a combination of various skills like management, marketing,
human resources development, interpersonal skills, dexterity and financial management.
Hotels are major employment generator in the tourism industry. Work in the area of Hotel
Management involves ensuring that all operations, including accommodation, food and drink
and other hotel services run smoothly.
With the need to simplify the managing of hotel transactions, comes the involvement of
computer system, known as hotel property management system. It is computer software that
helps attain the goals of a hotel manager. The automated management of hotel transactions,
security of data, and accuracy of reports are some of the numerous purposes of the hotel
management system.
Hotel transaction is crucial and should be done accurately and fast. Data being gathered from
guests should be stored efficiently and managed properly. The focus of this project is to help
hotel owners manage transactions efficiently and effectively. It will provide efficient reports
and better data management to show transparency in both the owner and the employee.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 15/72
5-1
2.2
IBM worked for six years with American Airlines to develop a reservation system
that would allow the company to quickly track, fill and file records of the hundreds of
passengers that packed its new jets. The system was an enormous success, and similar models
were later sold to Pan Am and Delta. The Sabre system enabled a major transformation not
only of airline reservations, but also of revenue management, cargo, pricing, scheduling and
operations. More significantly, Sabre paved the way for real-time online transactions-also
known as Online Transaction Processing (OLTP)-a precursor of everything from ATM
machines to Internet commerce. SABRE In 1962 Two IBM 7090 mainframes form the
backbone of the SABRE reservation system for American Airlines. As the first airline
reservation system to work live over phone lines, SABRE linked high-speed computers with
data communications to handle seat inventory and passenger records in more than 50 cities.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 16/72
5-1
2.3
Many economists have often described ‘Hotel Business’ as unique and different from many
other business. The hotel is selling both goods and services. It not only provides both tangible
intangible services, but one of its unusual characteristics is also that it is one of the very few
places where production and consumption occur simultaneously; for example, ordering
subsequent preparation, services and consumption of food items. Both the products and
services are offered on credit transactions .No other business allows the customer an
immediate line of credit, for example, the moment he registers ,his credit purchase starts with
the room and a sequence of financial charges throughout the facilities without immediately
paying for them at the ‘point of purchase’. For example, purchase of food in restaurant, drinks
in bar valet services, etc. no other business offers as varied a range of services and products at
the same place as hotel business. Each hotel must offer lodging, food and protection to their
guest and assume a liability for guest property, provide a high standard of hygiene, cleanliness
and sanitation and should conform to the minimum requirements of the state regarding safe
hotel construction such as height of buildings, municipal-by-laws, fire and safety standard so
no.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 17/72
5-1
2.4 Summary
As the proponents investigated the current situation and compared it to solutions
available, the proponents found out that many of the time consuming routines and mistakes
could be easily prevented with a comprehensive Online Booking System. The efficiency of a
business can often be measured in how well the business is able to cultivate data and transfer
it into meaningful information. Fact based management leads to better business decisions, but
needs accurate information in real time.
A typical Online Booking System solution consists of hardware which includes
Personal Computers, cash drawer, receipt printers, and software that runs on the hardware. It
could be said that software is in the end more important for the user, since all the important
business operations depend on it. But the compatibility between the software and hardware is
equally important, because they are interconnected and depend on each other.Because in the
end it is not the price of the actual product, but the overall project that determines the total
amount of investment and the return of it.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 18/72
5-1
CHAPTER III
CASA Gemma Hotel Management System
3.1 Introduction
This chapter established the systematic tools and the specification of the hardware and
software used to develop this system. The proponents used the Data flow to describe how the
system transforms information, define how it is processed and stored and identify how the
information flows through the processes. They also used an Entity Relationship (ER) diagram
to illustrate the relationships between entities in a database. The compatibility between the
software and hardware is equally important, because they are interconnected and depend on
each other.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 19/72
5-1
3.2 System Design Specification
The proponents used the waterfall model approach to provide step by step process to
accomplish the final system development. In communication, all of the system requirements
are acquired. These requirements will be the objectives of designing the final result of the
system. After all requirements are gathered, the development should be planned towards
specific time to accomplish the system.
Scheduling and estimation towards the development cycle should be designed and
predicted precisely to prevent miscommunication against client. Before beginning to construct
the system, the framework of the system should be determined through the system
requirements. Later, the construction will follow the model design to produce a system that
fulfills the requirements. The construction of the system will follow the model design that has
been created in modeling phase. After the development is finished, the system will be
implemented, and then there will be feedbacks towards the implementation to enhance the
existing system into a better one. If there are any problems, the system will be reassessed
through the first step to gather new requirements.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 20/72
5-1
Waterfall Approach
Figure 1. Waterfall Model
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 21/72
5-1
Requirement Gathering and Analysis
In this phase, the proponent gathered all possible requirements of the system to be developed.
The group interviewed the owner of the CASA Gemma Hotel and identified some problems
that need to be solved. These requirements were analyzed for their validity, and the possibility
of incorporating the requirements in the system to be developed is also studied.
System Design
The requirements gathered by the proponents from the first phase were studied in this phase
and a system design is prepared. System design helps in specifying hardware and system
requirements and also helps in defining the overall system architecture.
Implementation
This phase involves the writing of codes for the modules that make up the system. There is
also a need to review the code and individually test the functionality of each module.
The group divides the work in modules/units ad actual coding was started. Each unit was
developed and tested for bugs
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 22/72
5-1
Testing
This phase includes integrations of all modules in the system and tests them as a single system
for all of the used cases, making sure that modules meet the requirements.
As specified earlier, the system was first divided into units. The group integrated these units
into a complete system and tested it to check if all modules/units coordinate with each other
and the system as a whole behaves the way the specification requires.
Deployment of System
This is the phase of the deployment of software system in the production environment. The
system will be ready in an installer. The group will deploy the system at CASA Gemma for
pilot implementation.
Maintenance
The maintenance of CASA Gemma may request the proponents’ assistance needed for the
system. If errors may occur during operations, the proponents are willing to fix the problem.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 23/72
5-1
3.2.1 Context Diagram Level 0
Personnel/Staff
Hotel Reservation
Management System
0.0
Customer
Generate Report/s
Update Records
Cancellation
Input Records
Reservation
Inquiry
Reservation
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 24/72
5-1
Context Diagram Level 1
Record
Administrator/Staff Information
Transaction
1.0
Customer DatabaseCustomer Records
1.4
Reports
1.5
New
1.1
Add Customer Info.
Facility/Room/Service
Database
Records
Query
Confirm Reservation
Customer Records
Display Info.
Transaction Details
New Records
Generated
Report/Receipt
Customer
Confirm Availability
Check
Availability
1.2
Confirm
Reservation
1.3
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 25/72
5-1
Context Diagram Level 2
Find
Info’s Info’s
Edit/
Update
2.2
Display Info
Deleted
Info.
Administrator
Generated
Report/Receipt
Records
2.0
Update Item/s
Updated
Add Info.
Add
2.1
Delete
2.3
2.4
Find
2.5
Customer DatabaseCustomer
Records
Queried Info
Transaction
Details
Delete
Info.
Edited/Updated
RecordsNew Records
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 26/72
5-1
3.2.3 Level 3
Administrator
Generated
Reports
Rooms
3.0
Rooms Database
Info’s
Add
3.1
Delete
3.3
3.4
Find
3.5
Update/
Edit
3.2
Add Rooms Update/Edit
RecordsDelete Records Display Records Find Info’s
New Records
New Records Deleted Room
Records
Queried Records
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 27/72
5-1
Context Diagram Level 4
Administrator
Generated
Report
Facilities
4.0
Facility Records
Info’s
Add
4.1
Delete
4.3
4.4
Find
4.5
Update
4.2
Add RecordsNew Records Delete Records Display Records Find Info’s
New Records
Updated Records Deleted Records
Records
Queried Info’s
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 28/72
5-1
Context Diagram Level 5
Administrator
Generated
Report
Services
5.0
Services Records
Info’s
Add
5.1
Delete
5.3
5.4
Find
5.5
Update
5.2
Add RecordsNew Records Delete Records Display Records Find Info’s
New Records
Updated Records Deleted Records
Records
Queried Info’s
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 29/72
5-1
Context Diagram Level 6
Administrator/
Audit
Report
Customer Records
Reports
6.0
Generate
Reports
Facility Database
Rooms Database
Services Records
User’s Database
Rooms
Records
Services
Records
User’s
Records
Facility
Records
Cutsome
rRecords
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 30/72
5-1
3.2.2 Data Flow Diagram
3.2.3 Entity-Relationship Diagram
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 31/72
5-1
D. Conceptual Schema
Entities
3.2.4 Definition of Relationships
3.2.5 Data Dictionary
3.2.6 Operational Constraints
3.2.7 Input/ Transactions/Output Screens
3.2.8 Relational Schema
3.2.9 Functional Dependencies
3.2.10 Final Relations
3.2.11 Indexes
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 32/72
5-1
3.3 Summary
In developing the proposed system, the proponents used the most reliable methods and
processes to develop and implement the proposed study. Systematic tools are used to
accomplish best results. This process helped to understand and simplify complex variables.
The Waterfall model approach helped the proponents in making the step by step process to be
performed. Data Flow Diagram and Entity Relationship Diagram served as the basis to know
the flow of the systems’ transactions.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 33/72
5-1
CHAPTER IV PERFORMANCE ANALYSIS
4.1 Introduction
In this chapter, all the resources gathered by the proponents came from CASA Gemma
Hotel Staff and owner. The proponents acquired the data needed in this study through
interviewing the staff of the secretary and the owner of the CASA Gemma Hotel and by
asking the suggestions of each member of the group. Tests are conducted on the internal
structures and the functionality of an application.
4.2 Experimental
The proponents divided the experiment into two major parts: the black and the white
box testing.
In the white box test, the proponents decided to test the system every after a model
was finished. The test was conducted by the actual members of the group. Many bugs were
found and fixed until the module was declared as clear from errors.
In the black box test, the proponents decided to test the system for two of the available
The secretary and owner Mrs. Lora Uy. The test was conducted to evaluate the user
friendliness and effectiveness of the system. Minor changes were made about the terms used
after the test according to their suggestions and commentaries about the system. The
comments were also resolved immediately after the test. No comments were said about the
user friendliness of the system.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 34/72
5-1
4.3 Results and Analysis
As a result of the black and white box tests, the proponents improved the quality of the
system in accordance of the needs of the end users. Multiple revisions were made after each
test until the system reached its current form. As a result, the ‘The Hotel Online Booking
System’ worked in accordance with the end user’s needs.
4.4 Summary
The proponents’ research was successful in achieving information needed to develop
the proposed system for the CASA Gemma Hotel. By interviewing the end users of the
proposed system, the proponents understood the flow and the current problems that occurred
in their company and by thoroughly examining the internal structures of the system. After the
proponents conducted multiple tests and improvements in the system, the proponents
concluded that the system is working properly.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 35/72
5-1
CHAPTER V
Conclusion Based on the information stated in Chapter I and based on the data gathered, the proponents
surmise that the CASA Gemma Hotel and Convention Center is in need of an online booking
system upgrade and have come up with the appropriate solution. The proponents have devised
a system that will streamline the procedure of processing booking and reservations with an
online booking and reservation system with the following modules:
Increasing the security and confidentiality of each file and report by providing a security
module, a log-in form that will have two (2) levels of access. The first will be the
administrator of the system and the customer for the second level of access. Each will have a
unique username and password thus making the system more secured not only for the
company but also to other users of the system. In addition, only those who are registered
members of the system will have the privileged of reserving and booking of rooms and
events, thus restricting unregistered members from reserving/booking a room or event,
making their system more organized and efficient.
With the implementation of MySQL 5.0 as the system's back end which is more advance and
has additional features compare to other databases, the company will have the benefit of a less
expensive data storage because it is popular and free to download in addition it is very
customizable, the user can customize its function with the knowledge of technical know-
how. Furthermore data’s that are stored in MySQL are very accessible and can be easily
manipulated with a basic knowledge of Structured Query Language (SQL) which is easy to
learn and use, and is available on different operating systems moreover creating backup for
the saved data’s will provide ease for every user of the system.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 36/72
5-1
The system will provide a monitoring module that will display an overview of the system
which is accessible only to the admin. With this the admin can easily view which dates are
available or unavailable for any event reservation, this will also indicate which room/function
halls are available for reservation; furthermore the system will also provide an organized view
of confirmed reservation, pending reservations, not completed reservation and user’s
overview and since it is computerized and done in real time, every reservation done will
automatically be counted and will display the remaining available dates and room/function
halls.
Searching and retrieving of records would be easier since there would be a search module that
would filter all the needed records. Having a search module will lessen the time of looking for
records that is done manually on the existing system.
Upgrading to online base system will help the company to increase their exposure to other
possible client/s in and out of the country. Moreover the website will have twenty four (24)
hours access for end users. Aside from increasing the company’s exposure, this will also serve
as their competitive marketing strategy promotion of their company to overcome the other
competitor’s innovation.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 37/72
5-1
BIBLIOGRAPHY
1. Dagdag, Lourdes A., et al. Fundamentals of Research and Business Correspondence,
Ramar Printing Press, Sta Cruz, Manila: 2001
2. SIGALA, M., Lockwood, A. & Jones, P. (2001). Strategic implementation and IT:
Gaining competitive advantage from the hotel reservation process. International
Journal of Contemporary Hospitality Management, Vol. 17 (3), p. 364-371.
3. Donaghy, K., Beattie, U. and McDowell, D. (1997) Implementing YM: lessons from
the hotel sector, International Journal of Contemporary Hospitality Management , 9
(2) 50-54
4. WARD-85: Ward, Paul T.; Stephen J. Mellor (1985). Structured Development for
Real-Time Systems: Volume 2, Essential Modeling Techniques. Prentice-Hall
(Yourdon Press). ISBN 0-13-854787-4. (ISBN 978-0-13-854787-5)
5. Ivanov, Stanislav, Conceptual Marketing Framework for Online Hotel Reservation System
Design (November 5, 2008). Tourism Today, Vol. 8/2008, pp. 7-32. Available at SSRN:
http://ssrn.com/abstract=1296040 or http://dx.doi.org/10.2139/ssrn.1296040
6. Carroll, B., J. Siguaw (2003) the evolution of electronic distribution: Effects on hotels
and intermediaries.
The Cornell Hotel and Restaurant Administration Quarterly
44(4), pp. 38-50
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 38/72
5-1
ACKNOWLEDGEMENT
The proponents would like to extend their sincere & heartfelt gratitude to everyone
who have helped them in this endeavor. Without their active guidance, help, cooperation &
encouragement, the proponents would not have made headway on the project.
The proponents are indebted to their adviser Ma’am Mary Joy Velasco for her conscientious
guidance and encouragement to accomplish this assignment.
They are extremely thankful and are grateful to the program coordinator Sir Edgar Mel Dacut
for his valuable guidance and support in the completion of this project.
They also acknowledge with a deep sense of reverence, and gratitude their parents and
members of their family, who have always supported them morally as well us financially.
The sense gratitude goes to those who helped despite having their names missed out here.
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 39/72
5-1
APPENDICES
APPENDIX A
APPENDIX B
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 40/72
5-1
APPENDIX C
1. System Requirements
Software: Windows OS (XP, 7)
Web Browser (Chrome, Firefox, Opera)
Joomla (for system administrator)
Xampp Server (for system administrator)
FileZilla or any FTP software (for system administrator)
Hardware:
LAN cable
Router
Internet Connection Printer (dot matrix preferred)
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 41/72
5-1
SCREENSHOTS:
Home Page
Rooms
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 42/72
5-1
Gallery
MAP
Contact Us
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 43/72
5-1
About Us
CODES
TERMS AND CONDITIONS<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Agua Frio Garden Resort | Terms and Condition</title>
</head>
<body>
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 44/72
5-1
<p><strong>TERMS AND CONDITIONS</strong></p>
<ol>
<ul>
<li>Charges shall be on Cash Basis, valid and acceptable credit cards, or authorized credit line of the hotel. </li>
<li>Personal checks are not acceptable for payments.</li>
<li>Check-out time is 12:00 o’clock noon the hotel may refuse extended accommodation.</li>
<li>We request that you register your visitor beyond 10:00 pm. In compliance with the Philippine Hotel Code.The
hotel will bill you accordingly.</li><li>The Hotel reserves the right to institute necessary action on the following cases:</li>
<li>Failure of the guest to follow hotel house rules and polices.</li>
<li>Failure to pay an outstanding account upon demand.</li>
<li>When the guest is confirmed to be a carrier of any communicable disease.</li>
<li>The guest agrees that the venue of any legal action arising out of this registration shall be the proper court of
Koronadal City only to pay attorney’s fee equivalent to 25% of the claims plus the cost of the expenses of the
law suit.</li>
<li>Maximum number of occupants allowed:</li>
<li>3 persons for the Duplex/Family Suite</li>
<li>2 persons for the Double/Deluxe</li>
<li>It is hotel policy for guest to leave the key with front desk personnel should guest leave hotel premises.</li>
</ul>
</body>
</html>
SAVE COMMENT
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("reserve_db", $con);
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
// use "now"-1 to get the current gmt time
$date = date('Y-m-d');
$sql=mysql_query("INSERT INTO rescomment (sender, email, message, date) VALUES
('$name','$email','$message', '$date')");
header("location: contactus.html");
mysql_close($con)
?>
ROOM RESERVE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Casa Gemma</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="layout.css" rel="stylesheet" type="text/css" />
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 45/72
5-1
<!-- Script for input validation dude -->
<script src="../lib/jquery-1.7.2.js" type="text/javascript"></script>
<script src="../jquery.validate.js" type="text/javascript"></script>
<script type="text/javascript">
$.validator.setDefaults({
submitHandler: function() { alert("submitted!"); }});
$().ready(function() {
// validate the room form when it is submitted
$("#room").validate();
</script>
<!-- End Validation -->
<!--sa input that accept number only-->
<SCRIPT language=Javascript>
<!--
function isNumberKey(evt)
{var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
//-->
</SCRIPT>
<!--end sa nivo slider--><?php
$arival = $_POST['start'];
$departure = $_POST['end'];
$adults = $_POST['person'];
?>
<body id="page1" onload="new ElementMaxHeight();">
<div id="main">
<!-- header -->
<div id="header">
<div class="row-1">
<div class="wrapper">
<div class="logo">
<h1><a href="#">Casa Gemma </a></h1>
<em>hotel and convention center </em></div>
<div class="phones">(083)82-310<br />
(083)82-366</div>
</div>
</div>
<div class="row-2">
<div class="indent">
<!-- header-box begin -->
<div class="header-box">
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 46/72
5-1
<div class="inner">
<ul class="nav">
<li><a href="index.html" class="current">Home page</a></li>
<li><a href="services.html">rooms</a></li>
<li><a href="gallery.html">Gallery</a></li>
<!--<li><a href="restaurant.html">Restaurant</a></li> -->
<li><a href="testimonials.html">Testimonials</a></li>
<li><a href="booking.html">contact us</a></li><li><a href="aboutus.html">About us</a></li>
</ul>
</div>
</div>
<!-- header-box end -->
</div>
</div>
</div>
<!-- content -->
<div id="content">
<div id="leftPan">
<div id="services">
<h2 align="center">AVAILABLE ROOMS </h2><p align="center">
<div align="center">
<ul>
<p>Check In Date :<?php echo $arival; ?><br />
Check Out Date :<?php echo $departure; ?><br />
Number of Persons : <?php echo $adults; ?></p>
</ul>
</div>
</div>
<div id="featured">
<div align="center">
<form action="reserve.php" method="post" onsubmit="return validateForm()" name="room">
<div>
<input name="start" type="hidden" value="<?php echo $arival; ?>" />
<input name="end" type="hidden" value="<?php echo $departure; ?>" />
<input name="adult" type="hidden" value="<?php echo $adults; ?>" />
<input name="roomno" type="hidden" value="<?php echo $selectedroom; ?>" />
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("reserve_db", $con);
function formatMoney($number, $fractional=false) {
if ($fractional) {
$number = sprintf('%.2f', $number);
}
while (true) {
$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
if ($replaced != $number) {
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 47/72
5-1
$number = $replaced;
} else {
break;
}
}
return $number;
}
$result = mysql_query("select category.categoryName, room.image, room.roomNo, room.roomname, room.beds,
room.noOfPerson,room.rate from room, category where category.categoryid = room.categoryid and
room.noOfPerson='$adults' and roomno not in(select roomno from reservation where resStatus <> 'Checkout' and
checkoutdate between '$arival' and '$departure' or checkindate between '$arival' and '$departure' and checkindate
<='$arival' and checkoutdate >='$departure' and reservation.roomno and resStatus <> 'Checkout')group by roomno");
$i=0;
/*'<label>'.$i.')'. */
while($row = mysql_fetch_array($result))
{
$roomno = $row['roomNo'];
$i=$i+1;
if (empty($roomno)){
echo '<p>'.'Sorry, rooms may have been occupied on your prescribed check-in date'.'</p>';
}
else
{
echo '<table width="490" border="0">';
echo '<tr>';
echo '<td>'.'</label>'.'<input name="selectroom" type="radio" value="'.$roomno.'" required />'.' Room No: '.'<input
name="roomno" type="text" size="4" readonly="readonly" value="'.$roomno.'" />'.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td width="200" rowspan="10">'.'<img width=180 height=124 alt="Unable to View" src="' . $row['image'] .
'"/>'.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td>'.'Room Name: '.$row['roomname'].'</td>';
echo '</tr>';
echo '<tr>';
echo '<td>'.'Category: '.$row['categoryName'].'</td>';
echo '</tr>';
echo '<tr>';
echo '<td width="340">';
$rt=$row['rate'];
echo 'Php ';
echo formatMoney($rt, true);
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>'.'Maximum Person Capacity: '.$row['beds'].'</td>';
echo '</tr>';
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 48/72
5-1
echo '<tr>';
echo '<td>'.'Maximum Bed Capacity: '.$row['noOfPerson'].'</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo ' '.' '.' '.' '.' '.' '.' '.' '.' '.' '.'<input name="roomid"
type="submit" value="Reserve" align="middle" width="60" height="30" onclick="setDifference(this.form);" />';
echo '</td>';echo '</tr>';
echo '</table>';
echo '</br>';
echo '</br>';
echo '</br>';
//$roomno = $row['roomNo'];
/* send selectroom[] values to the next page which is the selected roomno from the this form */
}
}
mysql_close($con);
?>
</form></div>
<div class="clear"></div>
</div>
</div>
<!-- FOOTER -->
</div>
</div>
<!-- footer -->
<div id="footer">
<ul class="nav">
<li><a href="index.html">Home</a>|</li>
<li><a href="services.html">Rooms</a>|</li>
<li><a href="gallery.html">Gallery</a>|</li>
<li><a href="testimonials.html">Map</a>|</li>
<li><a href="booking.html">Contact us </a>|</li>
<li><a href="aboutus.html"> About us</a></li>
</ul>
<div align=center></div>
<div class="wrapper">
</div></div>
</div>
</body>
</html>
RESERVE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 49/72
5-1
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="layout.css" rel="stylesheet" type="text/css" />
<script src="maxheight.js" type="text/javascript"></script>
<style type="text/css">
<!--
.style1 {font-family: Geneva, Arial, Helvetica, sans-serif;font-weight: bold;}
.style2 {font-family: Geneva, Arial, Helvetica, sans-serif}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Casa Gemma | Reservation</title>
<!-- Script for input validation dude -->
<script src="../lib/jquery-1.7.2.js" type="text/javascript"></script>
<script src="../jquery.validate.js" type="text/javascript"></script>
<!-- input validation -->
<script type="text/javascript">
$.validator.setDefaults({submitHandler: function() { alert("submitted!"); }
});
$().ready(function() {
// validate the form1 form when it is submitted
$("#form1").validate();
</script>
<!-- End Validation -->
<!-- email validation -->
<script type="text/javascript">
function val()
{
var emailaddress=document.forms["form1"]["emailaddress"].value;
var atpos=emailaddress.indexOf("@");
var dotpos=emailaddress.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=f.length)
{
alert("Not a valid e-mail address");
document.forms["form1"]["emailaddress"].select();
return false;
}
var contactnumber = document.forms["form1"]["contactnumber"].value;
var pattern = /^\d{10}$/;
if (pattern.test(contactnumber)) {
return true;
}
else
{
alert("It is not valid mobile number. Input 11 digits number!");
return false;
}
}
</script>
<!-- check terms and condition -->
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 50/72
5-1
<script type="text/javascript">
function checkterms() {
document.form1.Submit.disabled=true;
if(document.form1.condition.checked==true){
document.form1.Submit.disabled=false;
}
if(document.form1.condition.checked==false){
document.form1.Submit.enabled=false;}
}
<!-- input that accepts letters only -->
function alpha(e) {
var k;
document.all ? k = e.keyCode : k = e.which;
return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8 || k == 32);
}
</script>
<!--sa input that accept number only-->
<SCRIPT language=Javascript>
<!--function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
//-->
</SCRIPT>
<?php
$arival = $_POST['start'];
$departure = $_POST['end'];
$selectedroom = $_POST['selectroom'];
?>
</head>
<body>
<div id="main">
<div id="header">
<div class="row-1">
<div class="wrapper">
<div class="logo">
<h1><a href="#">Casa Gemma </a></h1>
<em>hotel and convention center </em></div>
<div class="phones">(083)82-310<br />
(083)82-366</div>
</div>
</div>
<div class="row-2">
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 51/72
5-1
<div class="indent">
<!-- header-box begin -->
<div class="header-box">
<div class="inner">
<ul class="nav">
<li><a href="index.html" class="current">Home page</a></li>
<li><a href="services.html">Rooms</a></li>
<li><a href="gallery.html">Gallery</a></li><li><a href="map.html">map</a></li>
<li><a href="contactus.html">contact us</a></li>
<li><a href="aboutus.html">About us</a></li>
</ul>
</div>
</div>
<!-- header-box end -->
</div>
</div>
</div>
<div id="content">
<div class="gallery">
</div>
<div class="field">
<h2 align="center">PERSONAL INFORMATION </h2>
<div align="center">
</div>
<form id="form1" method="post" onsubmit="return val()" action="index2.php" name="form1">
<fieldset>
<div align="center">
<span class="row-1"><span class="wrapper">
<input name="start" type="hidden" value="<?php echo $arival; ?>" />
<input name="end" type="hidden" value="<?php echo $departure; ?>" />
<input name="adult" type="hidden" value="<?php echo $adults; ?>" />
<input name="roomno" type="hidden" value="<?php echo $selectedroom; ?>" />
</span></span>
All fields with symbol(*) must be filled up
<table height="331" border="0" align="center">
<tr>
<td height="30"><div align="right" class="style1">First Name: </div></td>
<td><input name="fname" type="text" id="fname" onkeypress="return alpha(event)" maxlength="30" required />
*</td>
</tr>
<tr>
<td height="30"><div align="right" class="style1">Middle Name: </div></td>
<td><input name="mname" type="text" id="mname" onkeypress="return alpha(event)" maxlength="30" required />
*</td>
</tr>
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 52/72
5-1
<tr>
<td height="30"><div align="right" class="style1">Last Name: </div></td>
<td><input name="lname" type="text" id="lname" onkeypress="return alpha(event)" maxlength="30" required />
*</td>
</tr>
<tr>
<td height="30"><div align="right" class="style1">Address: </div></td>
<td><input type="text" name="address" required />*</td>
</tr>
<tr>
<td height="30"><div align="right" class="style1">Mobile Number: </div></td>
<td><input name="contactnumber" type="text" id="contactnumber" onkeypress="return isNumberKey(event)"
minlength="11" maxlength="15" required />
*</td>
</tr>
<tr>
<td height="30"><div align="right" class="style1">Email Address: </div></td>
<td><input name="emailaddress" type="email" id="emailaddress" required />
*</td>
</tr>
<tr><td height="30"><div align="right" class="style1">Nationality: </div></td>
<td><select name="nationality" id="nationality">
<option selected="selected">Filipino</option>
<option>Afghan</option><option>Albanian</option><option>Algerian</option><option>Andorran</option><option
>Angolan</option><option>Antiguans</option> <option>Argentine
</option><option>Armenian</option><option>Australian</option><option>Austrian</option><option>Azerbaijani</
option><option>Bahamian</option><option>Bahraini</option><option>Bangladeshi</option><option>Barbadian</o
ption><option>Belarusian</option><option>Belgian</option><option>Belizean</option><option>Beninese</option>
<option>Bhutanese</option><option>Bolivian</option><option>Bosniak</option><option>Brazilian</option><optio
n>Bruneian</option><option>Bulgarian</option><option>Burundian</option><option>Cambodian</option><option
>Cameroonian</option><option>Cape
Verdian</option><option>Chadian</option><option>Chilean</option><option>Chinese</option><option>Colombian
</option><option>Comoran</option><option>Congolese</option><option>Costa
Rican</option><option>Ivorian</option><option>Croatian</option><option>Cuban</option><option>Cypriot</optio
n><option>Czech</option><option>Danish</option><option>Dominican</option><option>Ecuadorean</option><op
tion>Egyptian</option><option>Equatorial
</option><option>Eritrean</option><option>Estonian</option><option>Ethiopian</option><option>Finnish</option
><option>French</option><option>Gabonese</option><option>Gambian</option><option>Georgian</option><opti
on>German</option><option>Ghanaian</option><option>Greek</option><option>Grenadan</option><option>Guat
emalan</option><option>Guinean</option><option>Haitian</option><option>Honduran</option><option>Hungaria
n</option><option>Icelander</option><option>Indian</option><option>Indonesian</option><option>Iranian</opti
on><option>Irish</option><option>Israeli</option><option>Italian</option><option>Jamaican</option><option>Jap
anese</option><option>Jordanian</option><option>Kazakhstani</option><option>Kenyan</option><option>North
Korean</option><option>South
Korean</option><option>Kuwaiti</option><option>Lao</option><option>Latvian</option><option>Lebanese</opti
on><option>Liberian</option><option>Libyan</option><option>Lithuanian</option><option>Macedonian</option>
<option>Malaysian</option><option>Maldivan</option><option>Malian</option><option>Maltese</option><optio
n>Marshallese</option><option>Mexican</option><option>Micronesian</option><option>Mongolian</option><opt
ion>Moroccan</option>
<option>Burmese</option><option>Netherlander</option><option>Nicaraguan</option><option>Nigerien
</option><option>Nigerian</option><option>Norwegian</option><option>Omani</option><option>Pakistani</opti
on><option>Panamanian</option><option>Paraguayan</option><option>Peruvian</option><option>Filipino</optio
n><option>Polish</option><option>Portuguese</option><option>Qatari</option><option>Romanian</option><opti
on>Russian</option><option>Samoan</option><option>San Marinese</option><option> Sao
Tomean</option><option>Saudi
Arabian</option><option>Serbs</option><option>Singaporean</option><option>Slovakian</option><option>Sloven
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 53/72
5-1
ian</option><option>Somali</option><option>South African</option><option>Spanish</option><option>Sri
Lankan</option><option>Sudanese</option><option>Swedish</option><option>Swiss</option><option>Syrian</opt
ion><option>Taiwanese</option><option>Thai</option><option>Turkish</option><option>Ugandan</option><optio
n>Ukrainian</option><option>Emirati</option><option>English,
</option><option>American</option><option>Uruguayan</option><option>Venezuelan</option><option>Vietname
se</option><option>Yemenite</option><option>Zambian</option><option>Zimbabwea</option>
</select></td>
</tr><tr>
<td height="30"><div align="right" class="style1">Passport No: </div></td>
<td><input name="passportno" type="text" id="passportno" maxlength="20" /></td>
</tr>
<tr>
<td height="30"><div align="right" class="style1">Company: </div></td>
<td><input name="company" type="text" id="company" /></td>
</tr>
<tr>
<td height="30"><div align="right" class="style1">Check-in Date: </div></td>
<td><input name="checkindate" type="text" id="checkindate" value="<?php echo $arival; ?>" size="10"
readonly="read" /></td>
</tr><tr>
<td height="30"><div align="right" class="style1">Check-out Date: </div></td>
<td><input name="checkoutdate" type="text" id="checkoutdate" value="<?php echo $departure; ?>" size="10"
readonly="read" /></td>
</tr>
<tr>
<td height="30"><div align="right" class="style1">Room No: </div></td>
<td><input name="roomno" type="text" id="roomno" value="<?php echo $selectedroom; ?>" size="4"
maxlength="3" readonly="read" /></td>
</tr>
<tr>
<td height="67"><div align="right" class="style2"><strong>Mode of Payment: </strong></div></td>
<td><select name="paymenttype" id="paymenttype">
<option selected="selected">BANK REMITTANCE</option>
<option>CASH</option>
<option>CHECK</option>
<option>SMART MONEY</option>
<option>G-CASH</option>
</select></td><br />
<tr><td></td><td>NOTE: We don't accept online <br />
or credit card payments</td>
</tr>
</tr>
<tr>
<td height="45"><div align="right">
<input name="condition" type="checkbox" onClick="checkterms()" id="condition" />
</div></td>
<td>I agree to<a href="images/terms and condition.jpg" target="_blank"> terms and conditions</a></td>
</tr>
</table>
<input type="submit" id="Submit" name="Submit" disabled="disabled" value="Submit Reservation" />
</div>
</fieldset>
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 54/72
5-1
</form>
<div class="button">
</div>
</li>
</ul>
</div>
</div>
<div id="footer">
<ul class="nav">
<li><a href="index.html">Home</a>|</li>
<li><a href="services.html">Rooms</a>|</li>
<li><a href="gallery.html">Gallery</a>|</li>
<li><a href="map.html">Map</a>|</li>
<li><a href="contactus.html">Contact us </a>|</li>
<li><a href="aboutus.html">About us</a></li>
</ul>
<div class="wrapper">
</div>
</div></div>
</body>
</html>
INDEX 2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Casa Gemma | Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="layout.css" rel="stylesheet" type="text/css" />
<!--sa calendar-->
<script type="text/javascript" src="js/datepicker.js"></script>
<link href="css/demo.css" rel="stylesheet" type="text/css" />
<link href="css/datepicker.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
//<![CDATA[
/*
A "Reservation Date" example using two datePickers
--------------------------------------------------
* Functionality
1. When the page loads:
- We clear the value of the two inputs (to clear any values cached by the browser)
- We set an "onchange" event handler on the startDate input to call the setReservationDates function
2. When a start date is selected
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 55/72
5-1
- We set the low range of the endDate datePicker to be the start date the user has just selected
- If the endDate input already has a date stipulated and the date falls before the new start date then we clear
the input's value
* Caveats (aren't there always)
- This demo has been written for dates that have NOT been split across three inputs
*/
function makeTwoChars(inp) {
return String(inp).length < 2 ? "0" + inp : inp;
}
function initialiseInputs() {
// Clear any old values from the inputs (that might be cached by the browser after a page reload)
document.getElementById("sd").value = "";
document.getElementById("ed").value = "";
// Add the onchange event handler to the start date input
datePickerController.addEvent(document.getElementById("sd"), "change", setReservationDates);
}
var initAttempts = 0;
function setReservationDates(e) {
// Internet Explorer will not have created the datePickers yet so we poll the datePickerController Object using a
setTimeout
// until they become available (a maximum of ten times in case something has gone horribly wrong)
try {
var sd = datePickerController.getDatePicker("sd");
var ed = datePickerController.getDatePicker("ed");
} catch (err) {
if(initAttempts++ < 10) setTimeout("setReservationDates()", 50);
return;
}
// Check the value of the input is a date of the correct format
var dt = datePickerController.dateFormat(this.value, sd.format.charAt(0) == "m");
// If the input's value cannot be parsed as a valid date then return
if(dt == 0) return;
// At this stage we have a valid YYYYMMDD date
// Grab the value set within the endDate input and parse it using the dateFormat method
// N.B: The second parameter to the dateFormat function, if TRUE, tells the function to favour the m-d-y date
format
var edv = datePickerController.dateFormat(document.getElementById("ed").value, ed.format.charAt(0) == "m");
// Set the low range of the second datePicker to be the date parsed from the first
ed.setRangeLow( dt );
// If theres a value already present within the end date input and it's smaller than the start date
// then clear the end date value
if(edv < dt) {
document.getElementById("ed").value = "";
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 56/72
5-1
}
}
function removeInputEvents() {
// Remove the onchange event handler set within the function initialiseInputs
datePickerController.removeEvent(document.getElementById("sd"), "change", setReservationDates);
}
datePickerController.addEvent(window, 'load', initialiseInputs);
datePickerController.addEvent(window, 'unload', removeInputEvents);
//]]>
</script>
<!--sa error trapping-->
<script type="text/javascript">
function validateForm()
{
var x=document.forms["index"]["start"].value;
if (x==null || x=="")
{
alert("Please enter your Check-In Date(Click the Calendar Icon)");return false;
}
var y=document.forms["index"]["end"].value;
if (y==null || y=="")
{
alert("Please enter your Check-Out Date(Click the Calendar Icon)");
return false;
}
var z=document.forms["index"]["person"].value;
if (z==null || z=="")
{
alert("Please enter Number of Person");
return false;
}
}
</script>
<script src="maxheight.js" type="text/javascript"></script>
<!--[if lt IE 7]>
<link href="ie_style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="ie_png.js"></script>
<script type="text/javascript">ie_png.fix('.png, #header .row-2, #header .nav li a, #content, .gallery l i');</script>
<![endif]-->
<style type="text/css">
<!--
.style6 {
font-size: 70px;
font-family: "brush Script MT";
}
-->
</style>
</head>
<body id="page1" onload="new ElementMaxHeight();">
<!-- like us on facebook dude -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 57/72
5-1
var js, f js = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<?php
$arival = $_POST['start'];
$departure = $_POST['end'];
$roomno = $_POST['roomno'];
?>
<?php
@mysql_connect("localhost","root","") or die("Cannot connect to database");
@mysql_select_db("reserve_db") or die("No database");
$fname = $_POST['fname'];$mname = $_POST['mname'];
$lname = $_POST['lname'];
$address = $_POST['address'];
$contactnumber = $_POST['contactnumber'];
$emailaddress = $_POST['emailaddress'];
$nationality = $_POST['nationality'];
$passportno = $_POST['passportno'];
$company = $_POST['company'];
$paymenttype = $_POST['paymenttype'];
/*$roomNo = $_POST['roomNo'];*/
date_default_timezone_set('Asia/Manila');
$date = date('Y-m-d');
//$tim = date("h:m:s",time());
$tim=date("h:i:s", strtotime("now"-1));
//$tim='<script type="text/javascript">document.write(Date("HH:MM:ss"))
require_once "formvalidator.php";
$show_form=true;
$query = "INSERT INTO customer_info (fname, mname, lname, address, contactnumber, emailaddress,
nationality, passportno, company) VALUES ('$fname', '$mname', '$lname', '$address', '$contactnumber',
'$emailaddress', '$nationality', '$passportno', '$company')";
$result = mysql_query("SELECT customerid FROM customer_info ORDER BY
customerid DESC LIMIT 1");
$row= mysql_fetch_array($result);
$to = $row['customerid'];
if ($to == ""){
$id = 1;
}
else {
$id = $to + 1;
}
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 58/72
5-1
$query1= "INSERT INTO request (customerid, requestdate, requesttime)
VALUES ('$id', '$date', '$tim')";
?>
<?php
$request = mysql_query("SELECT requestid FROM request ORDER BY requestid DESC LIMIT 1");
$row= mysql_fetch_array($request);
$req = $row['requestid'];
if ($req == ""){
$reqid = 1;
}
else {
$reqid = $req + 1;
}
$query2 = "INSERT INTO reservation (requestid, roomno, checkindate,checkoutdate, paymenttype, resstatus) VALUES ('$reqid','$roomno', '$arival', '$departure', '$paymenttype',
'pending')";
if (!mysql_query($query)) {
die('Error: ' . mysql_error());
}
if (!mysql_query($query1)) {
die('Error: ' . mysql_error());
}
if (!mysql_query($query2)) {
die('Error: ' . mysql_error());
}
print '<script type="text/javascript">';
print 'alert("Reservation Submitted." +"\n" + "A mail will be sent immediately into your email address for
the transaction of payment." +"\n" + "\n" + "The reservation will be cancelled if payment does not occur before
twelve(12) hours." +"\n" + "Thank You!")';
print '</script>';
mysql_close();
?>
<div id="main">
<!-- header -->
<div id="header">
<div class="row-1">
<div class="wrapper">
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 59/72
5-1
<div class="logo">
<h1 align="left"><a href="#" class="style6">Casa Gemma </a></h1>
<em>hotel and convention center </em></div>
<div class="phones">(083)82-310<br />
(083)82-366</div>
</div>
</div>
<div class="row-2">
<div class="indent">
<!-- header-box begin -->
<div class="header-box">
<div class="inner">
<ul class="nav">
<li><a href="index.html" class="current">Home page</a></li>
<li><a href="services.html">rooms</a></li>
<li><a href="gallery.html">Gallery</a></li>
<!--<li><a href="restaurant.html">Restaurant</a></li> -->
<li><a href="map.html">map</a></li>
<li><a href="contactus.html">contact us</a></li>
<li><a href="aboutus.html">About us</a></li></ul>
</div>
</div>
<!-- header-box end -->
</div>
</div>
</div>
<!-- content -->
<div id="content">
<div class="gallery">
<!--<ul>
<li><a href="#"><img alt="" src="images/2page-img1.jpg" /></a></li>
<li><a href="#"><img alt="" src="images/2page-img2.jpg" /></a></li>
<li><a href="#"><img alt="" src="images/2page-img3.jpg" /></a></li>
<li><a href="#"><img alt="" src="images/2page-img4.jpg" /></a></li>
<li><a href="#"><img alt="" src="images/2page-img5.jpg" /></a></li>
<li><a href="#"><img alt="" src="images/2page-img6.jpg" /></a></li>
</ul> -->
</div>
<div class="wrapper">
<div class="aside maxheight">
<!-- box begin -->
<div class="box maxheight">
<div class="inner">
<form method="post" action="room_reserve.php" name="index" onsubmit="return validateForm()">
<h3 align="center">Reservation</h3>
<table width="186" border="0">
<tr>
<td width="69"><div align="right">
<label>Arrival: </label>
</div></td>
<td width="101"><input type="text" class="w8em format-y-m-d highlight-days-67 range-low-today" name="start"
id="sd" value="" maxlength="10" readonly="readonly" /></td>
</tr>
<tr>
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 60/72
5-1
<td><div align="right">
<label>Departure: </label>
</div></td>
<td><input type="text" class="w8em format-y-m-d highlight-days-67 range-low-today" name="end" id="ed" value=""
maxlength="10" readonly="readonly" /></td>
</tr>
<tr>
<td><div align="right"><label>Persons: </label>
</div></td>
<!--<td><select name="adult" class="ed" >
<option>1</option>
<option>2</option>
<option>3</option>
</select></td>-->
<td><select name="person" id="person">
<option selected="selected">2</option>
<option>3</option>
<option>4</option>
</select></td>
</tr>
<tr><td><div align="right"></div></td>
<td><input name="Input" type="submit" value="Check Availability" id="button" /></td>
</tr>
</table>
<br />
<br />
<!-- like us on facebook -->
<div class="fb-like-box" data-href="http://www.facebook.com/pages/Agua-Frio-Garden-Resort-Hotel-and-
Restaurant/129045257127360?ref=ts" data-width="180" data-height="280" data-colorscheme="dark" data-show-
faces="true" data-border-color="green" data-stream="false" data-header="true"></div>
</form>
</div>
</div>
<!-- box end -->
</div>
<div class="content">
<div class="indent">
<h2>Casa gemma is happy to welcome you!</h2>
<img class="img-indent png" alt="" src="images/home.jpg" />
<p align="justify" class="alt-top">Come alone or bring your family with you, stay here for a night or for weeks, stay
here while on business trip or at some kind of conference - either way our hotel and resort is the best possible
variant.</p>
<div align="justify">Feel free to contact us anytime in case you have any questions or concerns.
</div>
<div class="clear"></div>
<div class="line-hor"></div>
<div class="wrapper line-ver">
<div class="col-1">
<h3>Amenities</h3>
<ul>
<div align="justify">
<p>Functions room for weddings, birthdays, reunions, seminars, and other occassions, Casa Gemma Hotel and
Convention Center offers the following amenities: </p>
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 61/72
5-1
</div>
<div align="justify"></div>
<li>Cable TV on all rooms </li>
<li> restaurant for your favorite cuisines </li>
<li>Fully Airconditioned Rooms </li>
<li>
<div align="justify">24 hours security </div></li>
<li>24 hours room service </li>
<li>hot and cold shower</li>
<li>wifi ready</li>
<li>Restaurant available at 7 a.m.</li>
<li>Standby generator set</li>
<li>function rooms</li>
<li>refrigerator on suite rooms</li>
<li>free breakfast</li>
<li>accepts catering for all ocassions </li>
<li></li>
</ul>
</div><div class="col-2">
<h3>Location</h3>
<p>We are located at the heart of the city.</p>
<p>Located near malls, pharmacy and banks </p>
<dl class="contacts-list">
<dt>General Santos Drive ,</dt>
<dt>Koronadal City, South Cotabato</dt>
<dt>9506 Philippines</dt>
<dd>+638382310</dd>
<dt>+638382366</dt>
<dd> </dd>
<dt>[email protected]</dt>
</dl>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- footer -->
<div id="footer">
<ul class="nav">
<li><a href="index.html">Home</a>|</li>
<li><a href="services.html">Rooms</a>|</li>
<li><a href="gallery.html">Gallery</a>|</li>
<!--<li><a href="#">Restaurant</a>|</li> -->
<li><a href="map.html">Map</a>|</li>
<li><a href="contactus.html">Contact us </a>|</li>
<li><a href="aboutus.html">About us</a></li>
</ul>
</div>
</div>
</body>
</html>
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 62/72
5-1
FORM VALIDATOR
<?PHP
/*
-------------------------------------------------------------------------
PHP Form Validator (formvalidator.php)
Version 1.1
This program is free software published under the
terms of the GNU Lesser General Public License.
This program is distributed in the hope that it will
be useful - WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
For updates, please visit:
http://www.html-form-guide.com/php-form/php-form-validation.html
Questions & comments please send to [email protected]
-------------------------------------------------------------------------
*/
/*** Carries information about each of the form validations
*/
class ValidatorObj
{
var $variable_name;
var $validator_string;
var $error_string;
}
/**
* Base class for custom validation objects
**/
class CustomValidator
{
function DoValidate(&$formars,&$error_hash)
{
return true;
}
}
/** Default error messages*/
define("E_VAL_REQUIRED_VALUE","Please enter the value for %s");
define("E_VAL_MAXLEN_EXCEEDED","Maximum length exceeded for %s.");
define("E_VAL_MINLEN_CHECK_FAILED","Please enter input with length more than %d for %s");
define("E_VAL_ALNUM_CHECK_FAILED","Please provide an alpha-numeric input for %s");
define("E_VAL_ALNUM_S_CHECK_FAILED","Please provide an alpha-numeric input for %s");
define("E_VAL_NUM_CHECK_FAILED","Please provide numeric input for %s");
define("E_VAL_ALPHA_CHECK_FAILED","Please provide alphabetic input for %s");
define("E_VAL_ALPHA_S_CHECK_FAILED","Please provide alphabetic input for %s");
define("E_VAL_EMAIL_CHECK_FAILED","Please provide a valid email address");
define("E_VAL_LESSTHAN_CHECK_FAILED","Enter a value less than %f for %s");
define("E_VAL_GREATERTHAN_CHECK_FAILED","Enter a value greater than %f for %s");
define("E_VAL_REGEXP_CHECK_FAILED","Please provide a valid input for %s");
define("E_VAL_DONTSEL_CHECK_FAILED","Wrong option selected for %s");
define("E_VAL_SELMIN_CHECK_FAILED","Please select minimum %d options for %s");
define("E_VAL_SELONE_CHECK_FAILED","Please select an option for %s");
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 63/72
5-1
define("E_VAL_EQELMNT_CHECK_FAILED","Value of %s should be same as that of %s");
define("E_VAL_NEELMNT_CHECK_FAILED","Value of %s should not be same as that of %s");
/**
* FormValidator: The main class that does all the form validations
**/class FormValidator
{
var $validator_array;
var $error_hash;
var $custom_validators;
function FormValidator()
{
$this->validator_array = array();
$this->error_hash = array();
$this->custom_validators=array();
}
function AddCustomValidator(&$customv){
array_push($this->custom_validators,$customv);
}
function addValidation($variable,$validator,$error)
{
$validator_obj = new ValidatorObj();
$validator_obj->variable_name = $variable;
$validator_obj->validator_string = $validator;
$validator_obj->error_string = $error;
array_push($this->validator_array,$validator_obj);
}
function GetErrors()
{
return $this->error_hash;
}
function ValidateForm()
{
$bret = true;
$error_string="";
$error_to_display = "";
if(strcmp($_SERVER['REQUEST_METHOD'],'POST')==0)
{
$form_variables = $_POST;
}
else
{
$form_variables = $_GET;
}
$vcount = count($this->validator_array);
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 64/72
5-1
foreach($this->validator_array as $val_obj)
{
if(!$this->ValidateObject($val_obj,$form_variables,$error_string))
{
$bret = false;
$this->error_hash[$val_obj->variable_name] = $error_string;
}}
if(true == $bret && count($this->custom_validators) > 0)
{
foreach( $this->custom_validators as $custom_val)
{
if(false == $custom_val->DoValidate($form_variables,$this->error_hash))
{
$bret = false;
}
}
}
return $bret;
}
function ValidateObject($validatorobj,$formvariables,&$error_string)
{
$bret = true;
$splitted = explode("=",$validatorobj->validator_string);
$command = $splitted[0];
$command_value = '';
if(isset($splitted[1]) && strlen($splitted[1])>0)
{
$command_value = $splitted[1];
}
$default_error_message="";
$input_value ="";
if(isset($formvariables[$validatorobj->variable_name]))
{
$input_value = $formvariables[$validatorobj->variable_name];
}
$bret = $this->ValidateCommand($command,$command_value,$input_value,
$default_error_message,
$validatorobj-
>variable_name,
$formvariables);
if(false == $bret)
{
if(isset($validatorobj->error_string) &&
strlen($validatorobj->error_string)>0)
{
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 65/72
5-1
$error_string = $validatorobj->error_string;
}
else
{
$error_string = $default_error_message;
}
}//if return $bret;
}
function validate_req($input_value, &$default_error_message,$variable_name)
{
$bret = true;
if(!isset($input_value) ||
strlen($input_value) <=0)
{
$bret=false;
$default_error_message = sprintf(E_VAL_REQUIRED_VALUE,$variable_name);
}
return $bret;
}
function validate_maxlen($input_value,$max_len,$variable_name,&$default_error_message)
{
$bret = true;
if(isset($input_value) )
{
$input_length = strlen($input_value);
if($input_length > $max_len)
{
$bret=false;
$default_error_message =
sprintf(E_VAL_MAXLEN_EXCEEDED,$variable_name);
}
}
return $bret;
}
function validate_minlen($input_value,$min_len,$variable_name,&$default_error_message)
{
$bret = true;
if(isset($input_value) )
{
$input_length = strlen($input_value);
if($input_length < $min_len)
{
$bret=false;
$default_error_message =
sprintf(E_VAL_MINLEN_CHECK_FAILED,$min_len,$variable_name);
}
}
return $bret;
}
function test_datatype($input_value,$reg_exp)
{
if(ereg($reg_exp,$input_value))
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 66/72
5-1
{
return false;
}
return true;
}
function validate_email($email)
{return eregi("^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$", $email);
}
function validate_for_numeric_input($input_value,&$validation_success)
{
$more_validations=true;
$validation_success = true;
if(strlen($input_value)>0)
{
if(false == is_numeric($input_value))
{
$validation_success = false;$more_validations=false;
}
}
else
{
$more_validations=false;
}
return $more_validations;
}
function validate_lessthan($command_value,$input_value,
$variable_name,&$default_error_message)
{
$bret = true;
if(false == $this->validate_for_numeric_input($input_value,
$bret))
{
return $bret;
}
if($bret)
{
$lessthan = doubleval($command_value);
$float_inputval = doubleval($input_value);
if($float_inputval >= $lessthan)
{
$default_error_message = sprintf(E_VAL_LESSTHAN_CHECK_FAILED,
$lessthan,
$variable_name);
$bret = false;
}//if
}
return $bret ;
}
function validate_greaterthan($command_value,$input_value,$variable_name,&$default_error_message)
{
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 67/72
5-1
$bret = true;
if(false == $this->validate_for_numeric_input($input_value,$bret))
{
return $bret;
}
if($bret)
{
$greaterthan = doubleval($command_value);$float_inputval = doubleval($input_value);
if($float_inputval <= $greaterthan)
{
$default_error_message = sprintf(E_VAL_GREATERTHAN_CHECK_FAILED,
$greaterthan,
$variable_name);
$bret = false;
}//if
}
return $bret ;
}
function validate_select($input_value,$command_value,&$default_error_message,$variable_name)
{$bret=false;
if(is_array($input_value))
{
foreach($input_value as $value)
{
if($value == $command_value)
{
$bret=true;
break;
}
}
}
else
{
if($command_value == $input_value)
{
$bret=true;
}
}
if(false == $bret)
{
$default_error_message = sprintf(E_VAL_SHOULD_SEL_CHECK_FAILED,
$command_value,$variable_name);
}
return $bret;
}
function validate_dontselect($input_value,$command_value,&$default_error_message,$variable_name)
{
$bret=true;
if(is_array($input_value))
{
foreach($input_value as $value)
{
if($value == $command_value)
{
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 68/72
5-1
$bret=false;
$default_error_message =
sprintf(E_VAL_DONTSEL_CHECK_FAILED,$variable_name);
break;
}
}
}
else{
if($command_value == $input_value)
{
$bret=false;
$default_error_message =
sprintf(E_VAL_DONTSEL_CHECK_FAILED,$variable_name);
}
}
return $bret;
}
functionValidateCommand($command,$command_value,$input_value,&$default_error_message,$variable_name,$formvaria
bles)
{
$bret=true;
switch($command)
{
case 'req':
{
$bret = $this->validate_req($input_value,
$default_error_message,$variable_name);
break;
}
case 'maxlen':
{
$max_len = intval($command_value);
$bret = $this-
>validate_maxlen($input_value,$max_len,$variable_name,
$default_error_message);
break;
}
case 'minlen':
{
$min_len = intval($command_value);
$bret = $this-
>validate_minlen($input_value,$min_len,$variable_name,
$default_error_message);
break;
}
case 'alnum':
{
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 69/72
5-1
$bret= $this->test_datatype($input_value,"[^A-
Za-z0-9]");
if(false == $bret)
{
$default_error_message =
sprintf(E_VAL_ALNUM_CHECK_FAILED,$variable_name);
}
break;}
case 'alnum_s':
{
$bret= $this->test_datatype($input_value,"[^A-
Za-z0-9 ]");
if(false == $bret)
{
$default_error_message =
sprintf(E_VAL_ALNUM_S_CHECK_FAILED,$variable_name);
}
break;
}
case 'num':
case 'numeric':
{
$bret= $this->test_datatype($input_value,"[^0-
9]");
if(false == $bret)
{
$default_error_message =
sprintf(E_VAL_NUM_CHECK_FAILED,$variable_name);
}
break;
}
case 'alpha':
{
$bret= $this->test_datatype($input_value,"[^A-
Za-z]");
if(false == $bret)
{
$default_error_message =
sprintf(E_VAL_ALPHA_CHECK_FAILED,$variable_name);
}
break;
}
case 'alpha_s':
{
$bret= $this->test_datatype($input_value,"[^A-
Za-z ]");
if(false == $bret)
{
$default_error_message =
sprintf(E_VAL_ALPHA_S_CHECK_FAILED,$variable_name);
}
break;
}
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 70/72
5-1
case 'email':
{
if(isset($input_value) &&
strlen($input_value)>0)
{
$bret= $this-
>validate_email($input_value);
if(false == $bret){
$default_error_message =
E_VAL_EMAIL_CHECK_FAILED;
}
}
break;
}
case "lt":
case "lessthan":
{
$bret = $this-
>validate_lessthan($command_value,
$input_value,
$variable_name,
$default_error_message);
break;
}
case "gt":
case "greaterthan":
{
$bret = $this-
>validate_greaterthan($command_value,
$input_value,
$variable_name,
$default_error_message);
break;
}
case "regexp":
{
if(isset($input_value) &&
strlen($input_value)>0)
{
if(!preg_match("$command_value",$input_value))
{
$bret=false;
$default_error_message =
sprintf(E_VAL_REGEXP_CHECK_FAILED,$variable_name);
}
}
break;
}
case "dontselect":
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 71/72
5-1
case "dontselectchk":
case "dontselectradio":
{
$bret = $this->validate_dontselect($input_value,
$command_value,
$default_error_message,
$variable_name);
break;
}//case
case "shouldselchk":
case "selectradio":
{
$bret = $this->validate_select($input_value,
$command_value,
$default_error_message,
$variable_name);
break;
}//casecase "selmin":
{
$min_count = intval($command_value);
if(isset($input_value))
{
if($min_count > 1)
{
$bret = (count($input_value) >= $min_count
)?true:false;
}
else
{
$bret = true;
}
}
else
{
$bret= false;
$default_error_message =
sprintf(E_VAL_SELMIN_CHECK_FAILED,$min_count,$variable_name);
}
break;
}//case
case "selone":
{
if(false == isset($input_value)||
strlen($input_value)<=0)
{
$bret= false;
$default_error_message =
sprintf(E_VAL_SELONE_CHECK_FAILED,$variable_name);
}
break;
}
7/18/2019 Casa Gemma Documentation Sept 23
http://slidepdf.com/reader/full/casa-gemma-documentation-sept-23 72/72
case "eqelmnt":
{
if(isset($formvariables[$command_value]) &&
strcmp($input_value,$formvariables[$command_value])==0 )
{
$bret=true;}
else
{
$bret= false;
$default_error_message =
sprintf(E_VAL_EQELMNT_CHECK_FAILED,$variable_name,$command_value);
}
break;
}
case "neelmnt":
{
if(isset($formvariables[$command_value]) &&
strcmp($input_value,$formvariables[$command_value]) !=0 ){
$bret=true;
}
else
{
$bret= false;
$default_error_message =
sprintf(E_VAL_NEELMNT_CHECK_FAILED,$variable_name,$command_value);
}
break;
}
}//switch
return $bret;
}//validdate command
}
?>