You are on page 1of 143

0

“Hotel management system”


THE PROJECT
PARTIAL FULFILLMENT
OF
M.SC Final
SESSION: 2017-18

SUBMITTED BY: SUBMITTED TO


Surbhi Maheshwari Miss Sudha Kochar

SUBMITTED AT
SHRI JAIN KANYA P.G. MAHADHYALYA, BIKANER
AFFILIATED TO
MAHARAJA GANGA SINGH UNIVERSITY, BIKANER
1
2

ACKNOWLEDGEMENT

We express our deepest gratitude to our COLLEGE MANAGEMENT BODY for


invaluable computer lab infrastructure and blessings.
We are very grateful to our Principal Dr. Sandhya Saksena for
providing us with an environment to complete our project successfully.
I am also grateful to Miss Sudha Kochar, Project
Coordinator- faculty in DOCS who has technical guidance of my project.
We express our sincere thanks to Mr. Pankaj Dadhich, Mrs Vandna Rajvanshi,
Mrs. Padma Joshi, Mr. Pradeep Bishnoi, , Mr. Arpit Chopra, Mr. Deepak Acharya for
constant encouragement and support throughout our course, especially for the useful
suggestions given during the course of the project period.
We also thank all the staff members of our college and technicians for
their help in making this project a successful one.
Finally, we take this opportunity to extend our deep appreciation to our family and
friends, for all that they meant to us during the crucial times of the completion of our project.

Student signature
3

Shri Jain Kanya P.G. Mahavidhyaliya, Bikaner

CERTIFICATE

This is to certify that Surbhi Maheshwari D/O Ramswroop


Maheshwari, who is a regular student of this college of the
M.SC Final ,Computer Science Department has been
permitted to submit the project of “Hotel Management
System” as per the Maharaja Ganga Singh University,
BIKANER rules and regulations. I wish every success in her
life.

Principal
Date Shree Jain Kanya P.G. Mahavidhyalya,
Bikaner
4

Shri Jain Kanya P.G. Mahavidhyaliya, Bikaner

DEPARTMENT OF COMPUTER SCIENCE

CERTIFICATE

This is certifying that Surbhi Maheshwari D/O Ramswroop


Maheshwari a regular student of M.SC Final, Computer Science
Department of our college has conducted Project on " Hotel
Management System".

<co supervisor sig>


Sudha Kochar
5

TABLE OF CONTENTS

Sr.No. Topics Page No.


1. A brief overview of Project 6
2. Profile of problem assign & SDLC 7
3 Study of existing system 13
4 System requirements 13
5 Project plan 14

 Team Structure

 Development schedule

 Programming lang. and development tools


(front end and back end languages)
6 Design 18

 Detailed DFD’s and structure diagram

 Data structure, Database and File


Specification
7 Project Legacy 24

 Current status of project

 Remaining Areas of concern

 Technical and managerial interfaces

 ( Screens)

 Future recommendations
8 Source code 26
9 Requirement Specificaton 136
10 Bibliography 139
6

A brief overview of Project:-


Hotel management system is a web application. It provides users to register on this
application.The aim of this project is to design a hotel management system for running a
hotel business. The system should be as flexible as possible so that it can be used for different
hotels.
An online hotel management system which can be used by Customer to reserve hotel
rooms. User can check the status of rooms and facilities. The administrator will know the
details of the reservations.
Administrator can maintain daily updates in the hotel records. Administrator is must bean authorized
user. He can further change the password. There is the facility for passwordrecovery, logout etc.
The main aim of the entire activity is to automate the process of day to day activities of Hotel like Room
activities, Admission of a New Customer, Assign a room according to customer’s demand, checkout of a
computer and releasing the room etc.
Hotel management system also advertise hotel with the use of social site such as facebook, twitter etc t.
Fundamentally, this project is all about of the online Hotel. This project is designed in the asp.net, css and
html and for the database my sql server is used.
7

Profile of problem assign & SDLC


Meaning of the Project:-
The Meaning of the Project is to give physical existence to the vibrating brain ideas &
thoughts. Project is great source to develop technical skills in the students. During the
programming of project a student goes through different problems & experiences & gets a
change to climb on the roof practically steps step by step through the ladder of theory. Thus
he/she gets adequate practical knowledge atomizes to go at the field & very important aim of
any project is to be as feasible & economic as possible. Actually the word PROJECT consists
of seven alphabets, each of them has a separate meaning.

P For Planning: - Planning is the most to start a work of scheme. If planning is good any
impressive half work is done.

R for Reliable: - Practical & theory vertical material & able guidance & assistance are
achieved from different source to prompt the function of planning area.

J for Join Efforts: - join efforts are much necessary for programming and result and
project many times some problems as books etc. are solved from external source.

E for Economic Time Feasibility: - It is important that the planned scheme is how
much economic time feasible. It is must to analyze estimate for complain of the project.

C for Construction: - After analyzing the program complete project report work is done
to give logical existence of planned scheme.

T for Testing: - Programmer is done before submitting the project after the gadget is ok for
use.
8

SYSTEM DEVELOPMENT LIFE CYCLE

A. Overview
B. System Development Phases
a. Information Planning
b. Requirement Gathering And Analysis
c. Design
d. Coding
e. Testing
C. Feasibility Study
a. Technology Feasibility
b. Economic Feasibility
c. Legal Feasibility
d. Operational Feasibility
e. Schedule Feasibility
f. Market and Real State Feasibility
g. Resource Feasibility
h. Cultural Feasibility

A. Overview:-
Systems Development Life Cycle (SDLC) is any logical process used by a systems
analyst to develop an information system, including requirements, validation, training, and
user ownership. A SDLC should result in a high quality system that meets or exceeds
customer expectations, reaches completion within time and cost estimates, works effectively
and efficiently in the current and planned Information Technology infrastructure, and is
inexpensive to maintain and cost-effective to enhance.

B. System Development Phases:-


Systems Development Life Cycle (SDLC) adheres to important phases that are
essential for developers, such as planning, analysis, design, and implementation, and are
explained in the section below. There are several Systems Development Life Cycle Models in
existence. The oldest model, that was originally regarded as "the Systems Development Life
Cycle" is the waterfall model: a sequence of stages in which the output of each stage becomes
the input for the next. These stages generally follow the same basic steps but many different
waterfall methodologies give the steps different names and the numbers of steps seem to vary
9

between 4 and 7. There is no definitively correct Systems Development Life Cycle model,
but the steps can be characterized and divided in several steps.

a. Information Planning:-
To generate a high-level view of the intended project and
determine the goals of the project. The feasibility study is sometimes used to
present the project to upper management in an attempt to gain funding.
Projects are typically evaluated in three areas of feasibility: economical,
operational, and technical.

b. Requirement Gathering and Analysis:-


The goal of systems analysis is to determine where the
problem is in an attempt to fix the system. This step involves breaking down the
system in different pieces and drawing diagrams to analyze the situation. Analyze
project goals, break down functions that need to be created, and attempt to engage
users so that definite requirements can be defined.

c. Design:-
In systems design functions and operations are described in detail,
including screen layouts, business rules, process diagrams and other
documentation. The output of this stage will describe the new system as a
collection of modules or subsystems.

d. Coding:-
Modular and subsystem programming code will be accomplished
during this stage. Unit testing and module testing are done in this stage by the
developers. This stage is intermingled with the next in that individual modules
will need testing before integration to the main project. Planning in software life
cycle involves setting goals, defining targets, establishing schedules, and
estimating budgets for an entire software project.

e. Testing:-
The code is tested at various levels in software testing. Unit,
system and user acceptance testing are often performed. This is a grey area as
many different opinions exist as to what the stages of testing are and how much if
any iteration occurs. Iteration is not generally part of the waterfall model, but
usually some occurs at this stage.
10

C. Feasibility Study:-

a. Technology and system feasibility:-


The assessment is based on an outline design of system
requirements in terms of Input, Processes, Output, Fields, Programs, and Procedures. This
can be quantified in terms of volumes of data, trends, frequency of updating, etc. in order
to estimate whether the new system will perform adequately or not this means that
feasibility is the study of the based in outline.

b. Economic feasibility:-
Economic analysis is the most frequently used method for
evaluating the effectiveness of a new system. More commonly known as cost/benefit
analysis, the procedure is to determine the benefits and savings that are expected from a
candidate system and compare them with costs. If benefits outweigh costs, then the
decision is made to design and implement the system.

Legal feasibility:-
Determines whether the proposed system conflicts with legal
requirements, e.g. a data processing system must comply with the local Data Protection
Acts.

Operational feasibility:-
Is a measure of how well a proposed system solves the problems,
and takes advantages of the opportunities identified during scope definition and how it
satisfies the requirements identified in the requirements analysis phase of system
development.

c. Schedule feasibility:-
A project will fail if it takes too long to be completed before it is
useful. Typically this means estimating how long the system will take to develop, and if it can
be completed in a given time period using some methods like payback period. Schedule
feasibility is a measure of how reasonable the project timetable is. Given our technical
11

expertise, are the project deadlines reasonable? Some projects are initiated with specific
deadlines.

d. Market and real estate feasibility:-


Market Feasibility Study typically involves testing geographic
locations for a real estate development project, and usually involves parcels of real estate
land. Developers often conduct market studies to determine the best location within a
jurisdiction, and to test alternative land uses for a given parcels. Jurisdictions often require
developers to complete feasibility studies before they will approve a permit application for
retail, commercial, industrial, manufacturing, housing, office or mixed-use project.

e. Resource feasibility:-
This involves questions such as how much time is available
to build the new system, when it can be built, whether it interferes with normal business
operations, type and amount of resources required, dependencies, etc. Contingency and
mitigation plans should also be stated here.

f. Cultural feasibility:-
In this stage, the project's alternatives are evaluated for their
impact on the local and general culture. For example, environmental factors need to be
considered and these factors are to be well known. Further an enterprise's own culture can
clash with the results of the project.
12

Study of existing system:-


ComputerName: Main Pc
Processor: Intel® Petinum® CPU B960 @2.20GHz 2.20GHz
RAM: 4.00 GB
System Type: 64 bit operating system
13

System requirements:-

HARDWARE REQUIREDMENT:-
RAM 512 MB
HARDDISK 97gb

SOFTWARE REQUIREMENT :-
Web server IIS 7.5
Framework .NET 4.0 with c#
Database Server SQL Server 2008
Web browser Chrome

Project plan
 Team Structure
Surbhi Maheshwari
 Development schedule
1) Synopsis-August 2017
2) G.U.I-September-2017
3) Designing-November-2017
14

4) Database Connectivity-January-2018
 Programming lang. and development tools (front end and back end
languages)
1) Front end : Asp.net 4.0
2) Back end : MS Sql Server
INTRODUCTION TO FRONT END APPLICATION:
ASP.NET-
i. Overview-
.NET framework is an essential component of the windows operating system,
which helps in creating applications by integrating different programming
languages, such as c#, Visual Basic, j#, Visual C++. This framework consists of a
virtual execution system called the common language Runtime (CLR) and a set of
class libraries. CLR is a Microsoft product of the common language Infrastructure
(CLI), which are an international standard and a basis for creating execution and
development environments in which language and libraries work together.
Microsoft introduced .NET to bridge the gap and ensure interoperability
between applications created in different languages. The .NET framework is used
to integrate the business logic of an application implemented in various
programming languages and services.

ii. History-
Earlier java was gaining popularity because of its platform-independent
approach. Later Microsoft released the first version of .NET framework 1.0 on Feb.
13, 2002 IDE. The second revised version of .NET took nearly a year to release and
was known as .NET Framework 1.1 Microsoft Visual Studio .NET, better known as
Visual Studio .NET 2003, was also a part of the second release. The next version
of .NET framework, .NET framework 2.0, was released with Visual Studio.NET 2005
on November 07, 2005. .NET Framework 3.0, formerly called WinFX, was then
15

released on November 06, 2006. FRAMEWORK 3.5, was released with Visual Studio
.NET 2008 on November 19, 2007.
iii. Features-
ASP.NET is not just a simple upgrade or the latest version of ASP. ASP.NET
combines unprecedented developer productivity with performance, reliability, and
deployment. Below are the features of ASP.NET.
a) Easy Programming Model- ASP.NET makes building real world Web
applications dramatically easier. ASP.NET server controls enable an HTML-like style
of declarative programming that let you build great pages with far less code than with
classic ASP.
b) Flexible Language Options - ASP.NET lets you leverage your current
programming language skills. Unlike classic ASP, which supports only interpreted
VBScript and JScript, ASP.NET now supports more than 25 .NET languages (built-in
support for VB.NET,
C#, and JScript.NET), giving you unprecedented flexibility in your choice of
language.
c) Great Tool Support – We can harness the full power of ASP.NET using any text
editor, even Notepad. The Enterprise versions of Visual Studio .NET deliver life-cycle
features to help organizations plan, analyze, design, build, test, and coordinate teams
that develop ASP.NET Web applications.
d) Rich Class Framework – Application features that used to be hard to
implement, or required a 3rd-party component, can now be added in just a few lines
of code using the .NET Framework. The .NET Framework offers over 4500 classes
that encapsulate rich functionality like XML, data access, file upload, transactions,
message queuing, SMTP mail, and much more.
e) Compiled execution- ASP.NET is much faster than classic ASP, while
preserving the "just hit save" update model of ASP.ASP.NET will automatically detect
any changes, dynamically compile the files if needed, and store the compiled results
to reuse for subsequent requests.
f) Rich output caching – ASP.NET output caching can dramatically improve
the performance and scalability of your application. When output caching is enabled
on a page, ASP.NET executes the page just once, and saves the result in memory in
16

addition to sending it to the user. When another user requests the same page,
ASP.NET serves the cached result from memory without re-executing the page.
g) Web-Farm Session State – ASP.NET session state lets you share session data
user-specific state values across all machines in your Web farm. Now a user can hit
different servers in the Web farm over multiple requests and still have full access to
her session. Framework are free-threaded, you no longer need to worry about thread
affinity.
h) Easy Deployment – ASP.NET takes the pain out of deploying server
applications. "No touch" application deployment. ASP.NET dramatically simplifies
installation of your application. With ASP.NET, you can deploy an entire application
as easily as an HTML page; just copy it to the server.
i) Dynamic update of running application – ASP.NET update compiled
components without restarting the web server. In the past with classic COM
components, the developer would have to restart the web server each time he
deployed an update. With ASP.NET, you simply copy the component over the
existing DLL; ASP.NET will automatically detect the change and start using the new
code.
iv. Design Goals-
C# is intended to be a simple, modern, general-purpose, object-oriented programming
language. Because software robustness, durability and programmer productivity are
important, the language should include strong type checking, array bounds checking,
and detection of attempts to use uninitialized variables, code portability, and
automatic garbage collection. The language is intended for use in developing software
components that can take advantage of distributed environments. Programmer
portability is very important, especially for those programmers already familiar with
C and C++.

Introduction to Back-End Application


SQL Server 2008 has introduced a new utility Sqlcmd to run ad hoc Transact-SQL
statements and scripts from command prompt. T-SQL commands are entered in
command prompt window and the result is displayed in the same window, unless the
result set is sent to the output files. sqlcmd can execute single TSQL statement as well
as batch file. Sqlcmd utility can connect to earlier versions of SQL Server as well. The
Sqlcmd utility uses the OLE DB provider to execute T-SQL commands, whereas SQL
17

Server Management Studio uses .NET Sqlclient to execute Sqlcmd script, this can
lead to different results in certain cases. (If you have an example of this, please let me
know. I will post it here.)Sqlcmd is an enhanced version of the isql and osql and it
provides way more functionality than the other two options. In other words, Sqlcmd is
a better replacement of isql (which will be deprecated eventually) and osql (not
included in SQL Server 2008 RTM). Sqlcmd can work two modes:
*Batch
*interactive
Indexes and Partitioning
Database administrators are familiar with hard drive partitioning, and database
partitioning is the same concept. Partitioning a database segments several parts of the
table object. This makes sorting and accessing table information when retrieving the
data using a SQL query easier. Indexes also help sort the table information. Indexes
are placed on a table column. They are used on commonly queried columns, so each
time the user retrieves information, the database can quickly find the information.
Both these SQL Server 2008 attributes facilitate faster queries and less wait time for
the user when search information from an application.
Backups and Mirroring
Backups are an essential part of any database management. Backups save the tables,
stored procedures and security information in case of an emergency. Backups are a
part of disaster recovery, which restores database information quickly and reduces the
amount of downtime after a hard drive crash or computer failure. Mirroring backups
is a part of SQL Server 2008. Mirroring backups provides administrators with the
tools needed to backup information across several media devices. Administrators can
automate backups and set them to store to external devices such as an external hard
drive, CD-ROM, DVD or even a network drive.
Scalability
SQL Server 2008 is able to scale with a business's computer hardware needs.
Scalability means the database is able to support business growth, including
expanding hardware design on the network. The SQL Server 2008 database software
is able to support older computer hardware, and it works well with newer hardware
designs. This means the business does not need to upgrade even when buying brand
new server computers. SQL Server 2008 supports 32-bit and 64-bit server operating
18

systems. Additionally, the SQL Server 2008 software requires fewer reboots, so
changes to the software architecture do not need to bring down the server during core
business hours.

Design
 Detailed DFD’s and structure diagram
1.Overview
2. Symbols
3. Physical Data Flow Diagram
4. Logical Data Flow Diagram

 Data Flow Diagram


Graphical description of a system data and how the process the data is known as data
flow diagram. Data flow diagram is a graphical tool which is used to describe and
analyses the movement of data through a system. It does not supply details
descriptions (how) of modules but (what) and (from where) and (to where) of each
and every modules of the organization. The system under consideration may be
manual or automated. In the data flow diagram there are four symbols to develop the
system, which are:-

Arrows or dataflow: - It shows the direction in which particular data is moving e.g.

Circle or bubble process: - It represents a process that transforms incoming data


flow(s) into outgoing data flow(s) e.g.

Open ended boxes or data store: - The destination where the processed input
data is to be store is known as the data store e.g.

Square or external entities: - The entities which are not a part of the System
organization e.g.
19

 Physical data flow diagram: - Based on currently existing system or it is a


graphical model of the current system Comprises of the following:
(1) Content diagrams
(2) First level data flow diagram
Second level data flow diagram

 Logical data flow diagram: - This is based on the requirements of the currently
existing system or it represents the newly proposed system.There are seven rules
govern construction data flow diagram:
(1) Arrows should not cross each other.
(2) Squares, circles and file must bear names.
(3) Decomposed data flow must be balanced.
(4) No two data flows, squares or circle can have the same name.
(5) Draw all data flows around the outside of the diagram.
Choose the meaningful names of data flows, processes and data store. Use strong
verbs followed by nouns

Data structure, Database and File Specification


Database Design
1. Overview
2. Design Process
 Determining Data To Be stored
 Conceptual Schema
 Logical Structuring Data
 Physical Database Design
1. Overview:-
Database design is the process of producing a detailed data model of a database. This logical
data model contains all the needed logical and physical design choices and physical storage
parameters needed to generate a design in a Data Definition Language, which can then be
used to create a database. A fully attributed data model contains detailed attributes for each
entity. The term database design can be used to describe many different parts of the design of
20

an overall database system. Principally, and most correctly, it can be thought of as the logical
design of the base data structures used to store the data. In the relational model these are the
tables and views. In an object database the entities and relationships map directly to object
classes and named relationships.
2. Design Process:-
The process of doing database design generally consists of a number of steps which will be
carried out by the database designer. Not all of these steps will be necessary in all cases.
Usually, the designer must:
 Determine the relationships between the different data elements
 Superimpose a logical structure upon the data on the basis of these relationships.
Within the relational model the final step can generally be broken down into two further steps
that of determining the grouping of information within the system, generally determining
what are the basic objects about which information is being stored, and then determining the
relationships between these groups of information, or objects. This step is not necessary with
an Object database.The tree structure of data may enforce a hierarchical model organization,
with a parent-child relationship table. An Object database will simply use a one-to-many
relationship between instances of an object class. It also introduces the concept of a
hierarchical relationship between object classes, termed inheritance.

 Determining data to be stored


In a majority of cases, a person who is doing the design of a database is a
person with expertise in the area of database design, rather than expertise in the domain from
which the data to be stored is drawn e.g. financial information, biological information etc.
Therefore the data to be stored in the database must be determined in cooperation with a
person who does have expertise in that domain, and who is aware of what data must be stored
within the system.This process is one which is generally considered part of requirements
analysis, and requires skill on the part of the database designer to elicit the needed
information from those with the domain knowledge. This is because those with the necessary
domain knowledge frequently cannot express clearly what their system requirements for the
database are as they are unaccustomed to thinking in terms of the discrete data elements
which must be stored. Data to be stored can be determined by Requirement Specification.
 Conceptual schema
21

Once a database designer is aware of the data which is to be stored


within the database, they must then determine where dependency is within the data.
Sometimes when data is changed you can be changing other data that is not visible. For
example, in a list of names and addresses, assuming a situation where multiple people can
have the same address, but one person cannot have more than one addresses, the name is
dependent upon the address, because if the address is different than the associated name is
different too. However, the other way around is different. One attribute can change and not
another.
 Logically structuring data
Once the relationships and dependencies amongst the various
pieces of information have been determined, it is possible to arrange the data into a logical
structure which can then be mapped into the storage objects supported by the database
management system. In the case of relational databases the storage objects are tables which
store data in rows and columns.
Each table may represent an implementation of either a logical object or a relationship joining
one or more instances of one or more logical objects. Relationships between tables may then
be stored as links connecting child tables with parents.
 Physical database design
The physical design of the database specifies the physical configuration of the
database on the storage media. This includes detailed specification of data elements, data
types, indexing options and other parameters residing in the DBMS data dictionary. It is the
detailed design of a system that includes modules & the database's hardware & software
specifications of the system.

Database Tables:-

Sr.No Table’s Name Description


1. Reg This table will contain information about
customer registration Name, Email Contact
etc.
22

2. booking This table will contain information about


customer’s booking
3. feedback This table will contain information about
customer’s review
4. adminuser This table will contain information about
admin login
5. Room_Master This table will contain information about
room detail

Reg Table BookingTable


23

Feedback Table Room_Master Table

Admin User Table

Project Legacy
 Current status of project:-
24

In our project customer can reserve hotel rooms. User can check the status
of rooms and facilities. The administrator will know the details of the reservations.
Administrator can maintain daily updates in the hotel records. Administrator is must bean authorized
user. He can further change the password. There is the facility for passwordrecovery, logout etc.

 Remaining Areas of concern:-


In this project we can add more services and restaurant services.we can
also add different types of room and images of hotel.

 Technical and managerial interfaces

“Hotel Management System”


Home Page:-
25

Source code:-
Master Page:-
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs"
Inherits="MasterPage" %>
26

<!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 runat="server">
<title>Five Star Hotel</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" />
<script src="maxheight.js" type="text/javascript"></script>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style>
/* Navbar container */
.navbar{
overflow: hidden;
background-color: #333;
font-family: Arial;
width:633px;
float:inherit;
padding:0 0 0 0;
}
/* Links inside the navbar */
.navbar a {
float:inherit;
font-size: 16px;
color:Gray;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
/* The dropdown container */
.dropdown {
float: left;
overflow: hidden;
27

}
/* Dropdown button */
.dropdown .dropbtn {
font-size: 15px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
}
/* Add a red background color to navbar links on hover */
.navbar a:hover, .dropdown:hover .dropbtn {
background-color:transparent;
}
/* Dropdown content (hidden by default) */
.dropdown-content {
display: none;
position: absolute;
background-color:Maroon;
min-width: 80px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;}
/* Links inside the dropdown */
.dropdown-content a {
float: none;
color: black;
padding: 12px 12px;
text-decoration: none;
display: block;
text-align: left;
}

/* Add a grey background color to dropdown links on hover */


.dropdown-content a:hover {
28

background-color:Maroon;
}

/* Show the dropdown menu on hover */


.dropdown:hover .dropdown-content {
display: block;
}
.container {
position: relative;
width: 20%;
}

.image {
display: block;
width: 100%;
height: 90px;
}

.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .5s ease;

.container:hover .overlay {
opacity: 1;
}
29

.text {
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
</style>
<script language="javascript" type="text/javascript">
</script>
</head>
<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="#">Five Star</a></h1>
<em>Hotel</em> <strong>True Luxury</strong> </div>
<div class="phones"> 1-800-412-45-56<br />
1-800-542-64-48 </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="home.aspx">Home page</a></li>
30

<li><a href="services.aspx">Services</a></li>
<li><a href="gallery.aspx">Gallery</a></li>
<li class="dropdown"><a href="#">Log-In</a>
<ul class="dropdown-content">
<li> <a href="ulogin.aspx">User Login</a></li>
<li><a href="alogin.aspx">Admin Login</a></li>
</ul></li>
<li><a href="feedback.aspx">Feedback</a></li>
<li><a href="contact.aspx">Contact us</a></li>
<li><a href="aboutus.aspx">About Us</a></li>
</ul>
</div>
</div>
<!-- header-box end -->
</div>
</div>
</div>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
<div id="footer">
<ul class="nav">
<li><a href="home.aspx">Home</a>|</li>
<li><a href="services.aspx">Services</a>|</li>
<li><a href="gallery.aspx">Gallery</a>|</li>
<li><a href="alogin.aspx">Admin Login</a>|</li>
<li><a href="ulogin.aspx">User Login</a></li>
<li><a href="reg.aspx">Register</a></li>
</ul>
<div class="wrapper">
<div class="fleft">
31

Copyright &copy; 2009 <a href="#"></a>. All Rights Reserved</div>


<div class="fright">
Designed by Surbhi Maheshwari - </div>
</div>
</div>
</body>
</html>

Home.aspx page
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="home.aspx.cs" Inherits="home" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<!-- content -->
<div id="content">
<div class="wrapper">
<div class="aside maxheight">
<!-- box begin -->
<div class="box maxheight">
<div class="inner">
<h3>Reservation:</h3>
<form action="#" id="reservation-form">
<fieldset>
<div class="field">
<label>Check In:</label>

<asp:TextBox ID="TextBox3" runat="server" ReadOnly="True" Width="118px"/>

<asp:ImageButton ID="ImageButton1" runat="server" Height="17px" img


32

src="images/Calendar.gif" Width="21px" onclick="ImageButton1_Click" />


<asp:Calendar ID="Calendar1" runat="server" Visible="false"
onselectionchanged="Calendar1_SelectionChanged1"></asp:Calendar>

</div>
<div class="field">
<label>Check Out:</label>
<asp:TextBox ID="TextBox1" runat="server" ReadOnly="True"/>

<asp:ImageButton ID="ImageButton2" runat="server" Height="17px" img


src="images/Calendar.gif" Width="21px" onclick="ImageButton2_Click" />
<asp:Calendar ID="Calendar2" runat="server" Visible="false"
onselectionchanged="Calendar2_SelectionChanged1"></asp:Calendar>

</div>
<div class="field"> Persons: &nbsp;
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Select Person</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="Plzz enter NO. OF person"
ControlToValidate="DropDownList1"></asp:RequiredFieldValidator><br /><br/>
Rooms:&nbsp;
<asp:DropDownList ID="DropDownList2" runat="server">
33

<asp:ListItem>Select Room </asp:ListItem>


<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
</asp:DropDownList>
</div>
<div>
<asp:Button ID="Button1" runat="server" Text="Check Avalibility"
onclick="Button1_Click" /></div>
</fieldset>
</form>
</div>
</div>
<!-- box end -->
</div>
<div class="content">
<div class="indent">
<h2>FiveStar is happy to welcome you!</h2>
<img class="img-indent png" alt="" src="images/1page-img1.png" />
<p 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 is the best possible variant.</p>
Feel free to contact us anytime in case you have any questions or concerns.
<div class="clear"></div>
<div class="line-hor"></div>
<div class="wrapper line-ver">
<div class="col-1">
34

<h3>Special Offers</h3>
<ul>
<li>FREE wide-screen TV</li>
<li>50% Discount for Restaraunt service</li>
<li>30% Discount for 3 days+ orders</li>
<li>FREE drinks and beverages in rooms</li>
<li>Exclusive souvenirs</li>
</ul>
<div class="button"><span><span><a href="#">Order Now!
</a></span></span></div>
</div>
<div class="col-2">
<h3>Location</h3>
<p>We are located in the center of Prague surrounded by malls and boutiques.</p>
<dl class="contacts-list">
<dt>Gazek st., 210</dt>
<dd>1-800-412-4556</dd>
<dd>1-800-542-6448</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
</div>
</asp:Content>

Home.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
35

using System.Web.UI.WebControls;

public partial class home : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
Calendar1.Visible = true;
}
protected void Calendar1_SelectionChanged1(object sender, EventArgs e)
{
TextBox3.Text = Calendar1.SelectedDate.ToShortDateString();
Calendar1.Visible = false;
}
protected void Calendar2_SelectionChanged1(object sender, EventArgs e)
{
TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();
Calendar2.Visible = false;
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
Calendar2.Visible = true;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
Response.Redirect("ulogin.aspx");
}
}
}
36

Style.css

* { margin:0; padding:0;}
html, body { height:100%;}
body { background:url(images/body-bg.gif) center top #37271c; font-family:Tahoma,
Geneva, sans-serif; font-size:100%; line-height:1.125em; color:#bca695;}

input, select, textarea { font-family:Tahoma, Geneva, sans-serif; font-size:1em;}

.fleft { float:left;}
.fright { float:right;}
.clear { clear:both;}

.alignright { text-align:right;}
.aligncenter { text-align:center;}

.wrapper { width:100%; overflow:hidden;}


.container { width:100%;}

p { margin-bottom:18px;}

/*==================forms====================*/
input, select { vertical-align:middle; font-weight:normal;}
img {border:0; vertical-align:top; text-align:left;}
object { vertical-align:top; outline:none;}

#reservation-form { font-size:.91em; font-weight:bold;}


#reservation-form fieldset { border:none;}
#reservation-form .field { display:block; height:55px;}
37

#reservation-form label { display:block; padding-bottom:4px;}


#reservation-form select { border:1px solid #5d3825; background:#1d110b; color:#bca695;}
#reservation-form select.select1 { width:40px; margin-right:10px;}
#reservation-form select.select2 { width:127px;}
#reservation-form input { width:23px; text-align:center; border:1px solid #5d3825;
background:#1d110b; color:#bca695;}
#reservation-form .button { font-size:1em;}

/*==================list====================*/
ul { list-style:none;}

/*==================other====================*/
.img-indent { margin:0 10px 0 -8px; float:left;}
.img-indent.alt { margin-right:25px;}
.img-box { width:100%; overflow:hidden; padding-bottom:20px;}
.img-box img { float:left; margin:0 20px 0 0;}

.extra-wrap { overflow:hidden; }

.p1 { margin-bottom:9px;}
.p2 { margin-bottom:18px;}
.p3 { margin-bottom:27px;}

.alt-top { padding-top:9px;}

/*==================txt, links, lines, titles====================*/


a {color:#bca695; outline:none;}
a:hover{text-decoration:none;}

h1 { font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-size:60px; line-


height:1em; color:#c30000; text-transform:uppercase; font-weight:normal; letter-spacing:-
2px;}
h1 a { color:#c30000; text-decoration:none;}
38

h2 { font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; color:#c30000; font-size:30px;


line-height:1em; font-weight:normal; margin-bottom:12px; letter-spacing:-1px;}
h3 { font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; color:#c30000; font-size:25px;
line-height:1em; font-weight:normal; margin-bottom:16px;}
h4 { font-size:.91em;}
h5 { font-size:1.33em; color:#c30000; padding-top:10px; margin-bottom:26px;}
h6 { font-size:1em; color:#e7e7e7;}

.txt1 { font-size:.91em;}
.txt2 { color:#c30000; font-size:1.33em; text-transform:uppercase;}

.link1 { display:block; float:left; background:url(images/link1-bgd.gif) left top repeat-x;


color:#fff; text-decoration:none;}
.link1 em { display:block; background:url(images/link1-left.gif) no-repeat left top;}
.link1 b { display:block; background:url(images/link1-right.gif) no-repeat right top;
padding:2px 15px 2px 15px; font-weight:normal; font-style:normal;}
.link1:hover { text-decoration:underline;}

.button { text-align:center; font-size:.91em;}


.button span { display:inline-block; background:url(images/button-side.gif) no-repeat left top;
padding-left:1px;}
.button span span { background:url(images/button-side.gif) no-repeat right top; padding-
right:1px; padding-left:0;}
.button span span a { display:inline-block; background:url(images/button-bg.gif) left top
repeat-x; padding:0 0 3px 0; color:#d5c6bb; width:152px; text-decoration:none; text-
transform:uppercase; font-weight:bold;}
.button span span a:hover { text-decoration:underline;}

.button1 { text-align:center; font-size:.91em;}


.button1 span { display:inline-block; background:url(images/button-side.gif) no-repeat left
top; padding-left:1px;}
.button1 span span { background:url(images/button-side.gif) no-repeat right top; padding-
right:1px; padding-left:0;}
39

.button1 span span a { display:inline-block; background:url(images/button-bg.gif) left top


repeat-x; padding:0 20px 3px 20px; color:#d5c6bb; text-decoration:none; text-
transform:uppercase; font-weight:bold;}
.button1 span span a:hover { text-decoration:underline;}

.line-hor { background:#4d3525; height:1px; overflow:hidden; font-size:0; line-height:0;


margin:21px 0 16px 0;}
.line-ver { background-image:url(images/line-ver.gif); background-repeat:repeat-y;
width:100%;}
.title { margin-bottom:20px;}
/*==================boxes====================*/
.box { background:#1d110b; width:100%;}
.box .inner { padding:21px 30px 30px 28px;}
.dept-list { float:left;}
.dept-list dd { clear:both; text-align:right;}
.dept-list dd span { float:left; padding-right:25px;}
.dept-list dd p { text-align:left;}
/*header*/
#header .row-1 { height:136px; }
#header .row-2 { height:390px; background:url(images/header-bg.png) no-repeat left
bottom;}
#header .row-2.alt { height:278px; background:url(images/header-bg1.png) no-repeat left
bottom; width:100%; padding:0; margin:0;}
#header .row-2 .indent { padding:13px 0 0 13px;}
#header .logo { float:left; padding:40px 0 0 45px;}
#header .logo em { position:absolute; top:25px; text-transform:uppercase; font-style:normal;
font-size:16px; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-weight:bold;
padding-left:5px;}
#header .logo strong { color:#ad0000; font-size:.91em; padding-left:5px;}
#header .phones { float:right; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-
size:25px; line-height:1em; color:#c30000; padding:43px 48px 0 0; letter-spacing:-1px;}
.header-box { background:url(images/header-bg1.jpg) no-repeat left top; width:950px;
height:364px;}
.header-box .inner { padding:307px 0 0 2px;}
40

.header-box-small { background:url(images/header-bg-small.jpg) no-repeat left top;


width:950px; height:252px; }
.header-box-small .inner { padding:195px 0 0 2px;}
#header .nav { width:100%; overflow:hidden;}
#header .nav li { display:inline;}
#header .nav li a { display:block; float:left; width:156px; height:55px; line-height:52px; font-
size:16px; text-transform:uppercase; font-weight:bold; color:#fff; text-decoration:none; font-
family:"Trebuchet MS", Arial, Helvetica, sans-serif; text-align:center; margin-right:2px;
background:url(images/nav-bg1.png) no-repeat left top;}
#header .nav li a:hover { background:url(images/nav-bg2.png) no-repeat left top;}
#header .nav li a.current { background:url(images/nav-bg2.png) no-repeat left top;}
/*content*/
#content { background:url(images/content-bg.png) left top; margin:0 8px; padding:11px
40px 20px 40px;}
#content .indent { padding:17px 0 20px 0;}
#content ul { padding-bottom:20px;}
#content ul li { background:url(images/bull1.gif) no-repeat left 8px; padding:0 0 0 13px;}

.contacts-list dt { font-weight:bold; margin-bottom:10px;}


.contacts-list dd { font-weight:bold;}
#content .gallery { width:100%; }
#content .gallery ul { overflow:hidden; margin:-7px -40px -11px -32px; position:relative;}
#content .gallery ul li { background:url(images/img-wrapper.png) no-repeat left top;
width:155px; height:110px; padding:0; float:left; margin-right:3px;}
#content .gallery ul li img {margin:13px 0 0 11px;}
#content .gallery-images { width:100%;}
#content .gallery-images ul {overflow:hidden; margin:0 -32px -14px 0; position:relative;
padding-bottom:0;}
#content .gallery-images ul li { float:left; padding:0 0 14px 0; background:none; margin-
right:16px;}
#content .img-list li { width:100%; overflow:hidden; background:none; padding:0 0 18px 0;}
#content .img-list li img { float:left; margin:6px 9px 0 0;}
.extra-img { position:relative; margin:0 -9px 0 -8px;}
41

.gallery-main { background:url(images/gallery-wrapper.png) no-repeat left top; width:607px;


height:433px; margin:0 -10px 0 -6px; position:relative;}
.gallery-main .inner { padding:12px 0 0 12px;}
.gallery-main .prev { position:absolute; left:11px; top:12px;}
.gallery-main .next { position:absolute; right:11px; top:12px;}
.list1 { font-size:.91em; padding:4px 0 15px 0;}
.list1 dt { font-weight:bold; color:#e3dad2; margin-bottom:12px; padding:0 0 0 4px;}
.list1 dd { border-bottom:1px solid #57473c; padding:0 5px 7px 4px; margin-bottom:4px;
line-height:1.45em;}
.list1 dd span { float:right;}
.list1 dd.alt { border-bottom:none;}
.list1 dd.last { font-weight:bold; color:#c30000; border-bottom:none;}

#content .list2 { padding-bottom:8px;}


#content .list2 li { font-size:.91em; padding-bottom:8px;}

#content .list3 li a { text-decoration:none;}


#content .list3 li a:hover { text-decoration:underline;}

#content .list4 li { width:100%; overflow:hidden; padding:0; background:none; font-


size:.91em; padding-bottom:15px;}
#content .list4 li img { float:left; margin:0 13px 0 0;}

#content .aside ul { font-size:.91em;}

/*footer*/
#footer { font-family:Arial, Helvetica, sans-serif; padding:28px 40px 35px 40px;}
#footer a { color:#e3dad2;}
#footer .nav { text-align:center; padding-bottom:25px;}
#footer .nav li { display:inline;}
#footer .nav li a { padding:0 48px 0 45px; color:#e3dad2;}

/*==========================================*/
42

Layout.css

#main {width:976px; margin:0 auto; position:relative;}

#header {height:526px; background:url(images/header-bg-top.jpg) no-repeat left top;}


#header.small { height:414px;}
#header, #content, #footer { font-size:0.75em;}

.col-1, .col-2, .col-3 { float:left;}

.aside { float:left; width:236px; margin-right:50px;}


.content { float:left; width:594px; position:relative;}

/*======= index.html =======*/


#page1 #content .line-ver { background-position:297px top;}
#page1 #content .col-1 {width:214px; margin-right:112px;}
#page1 #content .col-2 { width:223px;}
/*======= index-1.html =======*/
#page2 #content .col-1 {width:173px; margin-right:37px;}
#page2 #content .col-2 {width:173px; margin-right:37px;}
#page2 #content .col-3 {width:173px;}
/*======= index-2.html =======*/
#page3 #content .col-1 {width:173px; margin-right:37px;}
#page3 #content .col-2 {width:173px; margin-right:37px;}
#page3 #content .col-3 {width:173px;}

/*=========================*

Ie_png.js
var ie_png = {
ns: 'ie_png',
imgSize: {},
43

createVmlNameSpace: function() { /* enable VML */


if (document.namespaces && !document.namespaces[this.ns]) {
document.namespaces.add(this.ns, 'urn:schemas-microsoft-com:vml');
}
if (window.attachEvent) {
window.attachEvent('onbeforeunload', function() {
ie_png = null;
});
}
},

createVmlStyleSheet: function() { /* style VML, enable behaviors */


/*
Just in case lots of other developers have added
lots of other stylesheets using document.createStyleSheet
and hit the 31-limit mark, let's not use that method!
further reading: http://msdn.microsoft.com/en-
us/library/ms531194(VS.85).aspx
*/
var style = document.createElement('style');
document.documentElement.firstChild.insertBefore(style,
document.documentElement.firstChild.firstChild);
var styleSheet = style.styleSheet;
styleSheet.addRule(this.ns + '\\:*', '{behavior:url(#default#VML)}');
styleSheet.addRule(this.ns + '\\:shape', 'position:absolute;');
styleSheet.addRule('img.' + this.ns + '_sizeFinder', 'behavior:none;
border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;'); /* large
negative top value for avoiding vertical scrollbars for large images, suggested by James
O'Brien, http://www.thanatopsic.org/hendrik/ */
this.styleSheet = styleSheet;
},

readPropertyChange: function() {
var el = event.srcElement;
44

if (event.propertyName.search('background') != -1 ||
event.propertyName.search('border') != -1) {
ie_png.applyVML(el);
}
if (event.propertyName == 'style.display') {
var display = (el.currentStyle.display == 'none') ? 'none' : 'block';
for (var v in el.vml) {
el.vml[v].shape.style.display = display;
}
}
if (event.propertyName.search('filter') != -1) {
ie_png.vmlOpacity(el);
}
},

vmlOpacity: function(el) {
if (el.currentStyle.filter.search('lpha') != -1) {
var trans = el.currentStyle.filter;
trans = parseInt(trans.substring(trans.lastIndexOf('=')+1,
trans.lastIndexOf(')')), 10)/100;
el.vml.color.shape.style.filter = el.currentStyle.filter; /* complete
guesswork */
el.vml.image.fill.opacity = trans; /* complete guesswork */
}
},

handlePseudoHover: function(el) {
setTimeout(function() { /* wouldn't work as intended without setTimeout */
ie_png.applyVML(el);
}, 1);
},

/**
* This is the method to use in a document.
45

* @param {String} selector - REQUIRED - a CSS selector, such as '#doc .container'


**/
fix: function(selector) {
var selectors = selector.split(','); /* multiple selectors supported, no need for
multiple calls to this anymore */
for (var i=0; i<selectors.length; i++) {
this.styleSheet.addRule(selectors[i],
'behavior:expression(ie_png.fixPng(this))'); /* seems to execute the function without adding
it to the stylesheet - interesting... */
}
},

applyVML: function(el) {
el.runtimeStyle.cssText = '';
this.vmlFill(el);
this.vmlOffsets(el);
this.vmlOpacity(el);
if (el.isImg) {
this.copyImageBorders(el);
}
},

attachHandlers: function(el) {
var self = this;
var handlers = {resize: 'vmlOffsets', move: 'vmlOffsets'};
if (el.nodeName == 'A') {
var moreForAs = {mouseleave: 'handlePseudoHover', mouseenter:
'handlePseudoHover', focus: 'handlePseudoHover', blur: 'handlePseudoHover'};
for (var a in moreForAs) {
handlers[a] = moreForAs[a];
}
}
for (var h in handlers) {
el.attachEvent('on' + h, function() {
46

self[handlers[h]](el);
});
}
el.attachEvent('onpropertychange', this.readPropertyChange);
},

giveLayout: function(el) {
el.style.zoom = 1;
if (el.currentStyle.position == 'static') {
el.style.position = 'relative';
}
},

copyImageBorders: function(el) {
var styles = {'borderStyle':true, 'borderWidth':true, 'borderColor':true};
for (var s in styles) {
el.vml.color.shape.style[s] = el.currentStyle[s];
}
},

vmlFill: function(el) {
if (!el.currentStyle) {
return;
} else {
var elStyle = el.currentStyle;
}
for (var v in el.vml) {
el.vml[v].shape.style.zIndex = elStyle.zIndex;
}
el.runtimeStyle.backgroundColor = '';
el.runtimeStyle.backgroundImage = '';
var noColor = (elStyle.backgroundColor == 'transparent');
var noImg = true;
if (elStyle.backgroundImage != 'none' || el.isImg) {
47

if (!el.isImg) {
el.vmlBg = elStyle.backgroundImage;
el.vmlBg = el.vmlBg.substr(5, el.vmlBg.lastIndexOf('")')-5);
}
else {
el.vmlBg = el.src;
}
var lib = this;
if (!lib.imgSize[el.vmlBg]) { /* determine size of loaded image */
var img = document.createElement('img');
lib.imgSize[el.vmlBg] = img;
img.className = lib.ns + '_sizeFinder';
img.runtimeStyle.cssText = 'behavior:none; position:absolute;
left:-10000px; top:-10000px; border:none;'; /* make sure to set behavior to none to prevent
accidental matching of the helper elements! */
img.attachEvent('onload', function() {
this.width = this.offsetWidth; /* weird cache-busting
requirement! */
this.height = this.offsetHeight;
lib.vmlOffsets(el);
});
img.src = el.vmlBg;
img.removeAttribute('width');
img.removeAttribute('height');
document.body.insertBefore(img, document.body.firstChild);
}
el.vml.image.fill.src = el.vmlBg;
noImg = false;
}
el.vml.image.fill.on = !noImg;
el.vml.image.fill.color = 'none';
el.vml.color.shape.style.backgroundColor = elStyle.backgroundColor;
el.runtimeStyle.backgroundImage = 'none';
el.runtimeStyle.backgroundColor = 'transparent';
48

},

/* IE can't figure out what do when the offsetLeft and the clientLeft add up to 1, and
the VML ends up getting fuzzy... so we have to push/enlarge things by 1 pixel and then clip
off the excess */
vmlOffsets: function(el) {
var thisStyle = el.currentStyle;
var size = {'W':el.clientWidth+1, 'H':el.clientHeight+1,
'w':this.imgSize[el.vmlBg].width, 'h':this.imgSize[el.vmlBg].height, 'L':el.offsetLeft,
'T':el.offsetTop, 'bLW':el.clientLeft, 'bTW':el.clientTop};
var fudge = (size.L + size.bLW == 1) ? 1 : 0;

/* vml shape, left, top, width, height, origin */


var makeVisible = function(vml, l, t, w, h, o) {
vml.coordsize = w+','+h;
vml.coordorigin = o+','+o;
vml.path = 'm0,0l'+w+',0l'+w+','+h+'l0,'+h+' xe';
vml.style.width = w + 'px';
vml.style.height = h + 'px';
vml.style.left = l + 'px';
vml.style.top = t + 'px';
};
makeVisible(el.vml.color.shape, (size.L + (el.isImg ? 0 : size.bLW)), (size.T +
(el.isImg ? 0 : size.bTW)), (size.W-1), (size.H-1), 0);
makeVisible(el.vml.image.shape, (size.L + size.bLW), (size.T + size.bTW),
(size.W), (size.H), 1);

var bg = {'X':0, 'Y':0};


var figurePercentage = function(axis, position) {
var fraction = true;
switch(position) {
case 'left':
case 'top':
bg[axis] = 0;
49

break;
case 'center':
bg[axis] = .5;
break;
case 'right':
case 'bottom':
bg[axis] = 1;
break;
default:
if (position.search('%') != -1) {
bg[axis] = parseInt(position)*.01;
}
else {
fraction = false;
}
}
var horz = (axis == 'X');
bg[axis] = Math.ceil(fraction ? ( (size[horz?'W': 'H'] * bg[axis]) -
(size[horz?'w': 'h'] * bg[axis]) ) : parseInt(position));
if (bg[axis] == 0) {
bg[axis]++;
}
};
for (var b in bg) {
figurePercentage(b, thisStyle['backgroundPosition'+b]);
}

el.vml.image.fill.position = (bg.X/size.W) + ',' + (bg.Y/size.H);

var bgR = thisStyle.backgroundRepeat;


var dC = {'T':1, 'R':size.W+fudge, 'B':size.H, 'L':1+fudge}; /* these are
defaults for repeat of any kind */
var altC = { 'X': {'b1': 'L', 'b2': 'R', 'd': 'W'}, 'Y': {'b1': 'T', 'b2': 'B', 'd': 'H'} };
if (bgR != 'repeat') {
50

var c = {'T':(bg.Y), 'R':(bg.X+size.w), 'B':(bg.Y+size.h), 'L':(bg.X)}; /*


these are defaults for no-repeat - clips down to the image location */
if (bgR.search('repeat-') != -1) { /* now let's revert to dC for repeat-x
or repeat-y */
var v = bgR.split('repeat-')[1].toUpperCase();
c[altC[v].b1] = 1;
c[altC[v].b2] = size[altC[v].d];
}
if (c.B > size.H) {
c.B = size.H;
}
el.vml.image.shape.style.clip = 'rect('+c.T+'px '+(c.R+fudge)+'px
'+c.B+'px '+(c.L+fudge)+'px)';
}
else {
el.vml.image.shape.style.clip = 'rect('+dC.T+'px '+dC.R+'px
'+dC.B+'px '+dC.L+'px)';
}
},

fixPng: function(el) {
el.style.behavior = 'none';
if (el.nodeName == 'BODY' || el.nodeName == 'TD' || el.nodeName == 'TR') {
/* elements not supported yet */
return;
}
el.isImg = false;
if (el.nodeName == 'IMG') {
if(el.src.toLowerCase().search(/\.png$/) != -1) {
el.isImg = true;
el.style.visibility = 'hidden';
}
else {
return;
51

}
}
else if (el.currentStyle.backgroundImage.toLowerCase().search('.png') == -1)
{
return;
}
var lib = ie_png;
el.vml = {color: {}, image: {}};
var els = {shape: {}, fill: {}};
for (var r in el.vml) {
for (var e in els) {
var nodeStr = lib.ns + ':' + e;
el.vml[r][e] = document.createElement(nodeStr);
}
el.vml[r].shape.stroked = false;
el.vml[r].shape.appendChild(el.vml[r].fill);
el.parentNode.insertBefore(el.vml[r].shape, el);
}
el.vml.image.shape.fillcolor = 'none'; /* Don't show blank white shapeangle
when waiting for image to load. */
el.vml.image.fill.type = 'tile'; /* Ze magic!! Makes image show up. */
el.vml.color.fill.on = false; /* Actually going to apply vml element's
style.backgroundColor, so hide the whiteness. */

lib.attachHandlers(el);

lib.giveLayout(el);
lib.giveLayout(el.offsetParent);

/* set up element */
lib.applyVML(el);
}

};
52

try {
document.execCommand("BackgroundImageCache", false, true); /* TredoSoft
Multiple IE doesn't like this, so try{} it */
} catch(r) {}
ie_png.createVmlNameSpace();
ie_png.createVmlStyleSheet();

Maxheight.css

var ElementMaxHeight = function() {


this.initialize.apply(this, arguments);
}

ElementMaxHeight.prototype = {
initialize: function(className) {
this.elements = document.getElementsByClassName(className || 'maxheight');
this.textElement = document.createElement('span');
this.textElement.appendChild(document.createTextNode('A'));
this.textElement.style.display = 'block';
this.textElement.style.position = 'absolute';
this.textElement.style.fontSize = '1em';
this.textElement.style.top = '-1000px';
this.textElement.style.left = '-1000px';
document.body.appendChild(this.textElement);
this.textElementHeight = document.getDimensions(this.textElement).height;
var __object = this;
var __checkFontSize = this.checkFontSize;
this.checkFontSizeInterval = window.setInterval(function() {return
__checkFontSize.apply(__object)}, 500);

this.expand();

// Refresh elements height onResize event


var __expand = this.expand;
53

if (window.addEventListener) {
window.addEventListener('resize', function(event) {return __expand.apply(__object,
[( event || window.event)])}, false);
} else if (window.attachEvent) {
window.attachEvent('onresize', function(event) {return __expand.apply(__object, [( event
|| window.event)])});
}
},

expand: function() {
this.reset();
for (var i = 0; i < this.elements.length; i++) {
this.elements[i].style.height =
document.getDimensions(this.elements[i].parentNode).height + 'px';
}
},

reset: function() {
for (var i = 0; i < this.elements.length; i++) {
this.elements[i].style.height = 'auto';
}
},

checkFontSize: function() {
var height = document.getDimensions(this.textElement).height;
if(this.textElementHeight != height) {
this.textElementHeight = height;
this.expand();
}
}
}
if (!!document.evaluate) {
document._getElementsByXPath = function(expression, parentElement) {
var results = [];
54

var query = document.evaluate(expression, parentElement || document,


null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0, length = query.snapshotLength; i < length; i++)
results.push(query.snapshotItem(i));
return results;
}
}
document.getElementsByClassName = function(className, parentElement) {
if (!!document.evaluate) {
var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]";
return document._getElementsByXPath(q, parentElement);
} else {
var children = (parentElement || document.body).getElementsByTagName('*');
var elements = [], child;
for (var i = 0, length = children.length; i < length; i++) {
child = children[i];
if (child.className.length != 0 &&
(child.className == className ||
child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))) {
elements.push(child);
}
}
return elements;
}
}
document.getDimensions = function (element) {
var display = element.style.display;
if (display != 'none' && display != null) { // Safari bug
return {width: element.offsetWidth, height: element.offsetHeight};
}
return {width: originalWidth, height: originalHeight};
}
55

Services Page

Services.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="services.aspx.cs" Inherits="services" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
56

<!-- 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">
<h3>Other Services</h3>
<div class="txt1">
<p>In addition to housing we also offer</p>
<ul class="img-list">
<li> <img alt="" src="images/2page-img7.jpg" /> Premium food (either at our
restaraunt or delivered to your room) </li>
<li> <img alt="" src="images/2page-img8.jpg" /> Drinks and bevarages in your
rooms </li>
<li> <img alt="" src="images/2page-img9.jpg" /> Daily cleaning (included into
your package) </li>
<li> <img alt="" src="images/2page-img10.jpg" /> Free access to our gym and
swimming pool </li>
</ul>
</div>
</div>
</div>
<!-- box end -->
57

</div>
<div class="content">
<div class="indent">
<h2>We offer several kinds of rooms</h2>
<div class="container">
<div class="col-1"> <img alt="" src="images/2page-img11.png" class="extra-img
png"/>
<dl class="list1">
<dt>Discounted Rooms</dt>
<dd>Omnis iste natus error sit volupta- tem accusantium doloremque laudantium,
totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi.</dd>
<dd><span>6-10</span>Floor</dd>
<dd><span>1</span>Rooms</dd>
<dd><span>1</span>Beds</dd>
<dd class="alt"><span>1</span>Baths</dd>
<dd class="last"><span>$49</span>Price:</dd>
</dl>
<div class="button"><span><span><a href="ulogin.aspx">Order Now!
</a></span></span></div>
</div>
<div class="col-2"> <img alt="" src="images/2page-img12.png" class="extra-img
png"/>
<dl class="list1">
<dt>Business Class Rooms</dt>
<dd>Omnis iste natus error sit volupta- tem accusantium doloremque laudantium,
totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi.</dd>
<dd><span>3-5</span>Floor</dd>
<dd><span>2</span>Rooms</dd>
<dd><span>2</span>Beds</dd>
<dd class="alt"><span>1</span>Baths</dd>
<dd class="last"><span>$99</span>Price:</dd>
</dl>
<div class="button"><span><span><a href="ulogin.aspx">Order Now!
</a></span></span></div>
58

</div>
<div class="col-3"> <img alt="" src="images/2page-img13.png" class="extra-img
png"/>
<dl class="list1">
<dt>Premium Rooms</dt>
<dd>Omnis iste natus error sit volupta- tem accusantium doloremque laudantium,
totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi.</dd>
<dd><span>1-2</span>Floor</dd>
<dd><span>3</span>Rooms</dd>
<dd><span>3</span>Beds</dd>
<dd class="alt"><span>2</span>Baths</dd>
<dd class="last"><span>$199</span>Price:</dd>
</dl>
<div class="button"><span><span><a href="ulogin.aspx">Order Now!
</a></span></span></div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</div>
</asp:Content>

Gallery
59

Gallery.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="gallery.aspx.cs" Inherits="gallery" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
60

<div class="gallery">
<div class="container">
<h2>Gallery</h2>
</div>
</div>
<a class="example-image-link" href="images/2.jpg" data-lightbox="example-set"><img
class="example-image" src="images/2.jpg"
alt=""/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="example-image-link"
href="images/19.jpg" data-lightbox="example-set"><img class="example-image"
src="images/19.jpg" alt=""/></a>&nbsp;&nbsp; <a class="example-image-link"
href="images/15.jpg" data-lightbox="example-set"><img class="example-image"
src="images/15.jpg" alt=""/></a> <br /><br />
<a class="example-image-link" href="images/3.jpg" data-lightbox="example-set"><img
class="example-image" src="images/3.jpg"
alt=""/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a class="example-image-link"
href="images/4.jpg" data-lightbox="example-set"><img class="example-image"
src="images/4.jpg" alt=""/></a>&nbsp;&nbsp; <a class="example-image-link"
href="images/14.jpg" data-lightbox="example-set"><img class="example-image"
src="images/14.jpg" alt=""/></a><br /><br />
<a class="example-image-link" href="images/5.jpg" data-lightbox="example-set"><img
class="example-image" src="images/5.jpg"
alt=""/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="example-image-
link" href="images/1.jpg" data-lightbox="example-set"><img class="example-image"
src="images/1.jpg" alt=""/></a>&nbsp;&nbsp; <a class="example-image-link"
href="images/17.jpg" data-lightbox="example-set"><img class="example-image"
src="images/17.jpg" alt=""/></a><br />&nbsp;<br />
<a class="example-image-link" href="images/11.jpg" data-lightbox="example-set"><img
class="example-image" src="images/11.jpg"
alt=""/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a class="example-image-link"
href="images/9.jpg" data-lightbox="example-set"> </a><a class="example-image-link"
href="images/13.jpg" data-lightbox="example-set"><img class="example-image"
src="images/13.jpg" alt=""/></a>&nbsp;&nbsp; <a class="example-image-link"
href="images/9.jpg" data-lightbox="example-set"><img class="example-image"
src="images/9.jpg" alt=""/></a> <br /><br /><a class="example-image-link"
61

href="images/7.jpg" data-lightbox="example-set"><img class="example-image"


src="images/7.jpg" alt=""/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a
class="example-image-link" href="images/6.jpg" data-lightbox="example-set"><img
class="example-image" src="images/6.jpg" alt=""/></a>&nbsp;&nbsp; <a class="example-
image-link" href="images/21.jpg" data-lightbox="example-set"><img class="example-
image" src="images/21.jpg" alt=""/></a> <br /><br /><a class="example-image-link"
href="images/10.jpg" data-lightbox="example-set"><img class="example-image"
src="images/10.jpg" alt=""/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a class="example-image-link" href="images/12.jpg" data-lightbox="example-set"><img
class="example-image" src="images/12.jpg" alt=""/></a>&nbsp;&nbsp;
<a class="example-image-link" href="images/20.jpg" data-lightbox="example-set"><img
class="example-image" src="images/20.jpg" alt=""/></a>
</asp:Content>

About Us
62

About.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="aboutus.aspx.cs" Inherits="aboutus" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

<div align="center" valign="top">


63

<h1>About Us</h1><br /></td>

<img src="images/img2.jpg"
style="text-align:left; height: 347px; width: 473px;" />
<img src="images/img1.jpg"
style="text-align:left; width: 496px; height: 342px;" />

<b>The 5 STAR</b> - An Ecotel Hotel in Rajkot is Asia's first certified eco-friendly


five-star hotel <b>and world's only Ecotel to be certified as ISO 14001.</b> This <a
href="Room_Tariff.aspx" style="color:blue"><u> 50 room hotels</u></a> strategically
located adjacent to the domestic airport making it a convenient place for the business traveler
to stay.<br /> <br />
Everything is designed so as to be unobtrusive. Like The Club Privé room, an exclusive
club floor with a private lounge and butler service. Or the well-appointed business and
conference center to take care of your business needs in Rajkot.<br /><br />
The exclusivity of <b>The 5 STAR</b> is experienced as soon as one enters the
atrium that is serenaded by a 70-foot indoor waterfall. Around the waterfall, on the first
level is <u><font color="#8C2C34">the Boulevard</font></u>, the 24-hour coffee shop. The
beautiful <b> Hotel 5 star</b> growing there give you a feel of the truly <b> The 5 Star</b>
experience. Besides, The Boulevard provides a unique guaranteed time-bound service aptly
called the "Lightening Menu" or the "10 Minute Menu". If the service is even a minute late,
the meal is on the house!<br /><br />
From the first level to the top most.<br />
<u>Mostly Grills</u> the lovely roof top barbecue restaurant serves modern fusion
cuisine. The setting is a very surrealistic Mexican village with a pool by the side and the
breathtaking view of the airport runway on the other.<br /> <br />
</div>
</asp:Content>

Contact Us
64

Contactus.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="contact.aspx.cs" Inherits="contect" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="box">
<div align="center">
<h2>CONTACT US</h2>
<ul>
<li>
<span>Address:</span>
<p>Five Star Hotel<br /> Nokha<br /></p>
</li>
<li><span>Phone:</span>
<p>809478695 <br /></p>
</li>
<li>
<span>E-mail:</span>
<p><a href="home.aspx">Surbhibai@gmail.com</a><br /></p>
65

</li>
<li>
<span>Fax:</span>
<p>809478690 <br /></p></li>
</ul>
</div>
</div>
</asp:Content>

Feedback
66

Feedback.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="feedback.aspx.cs" Inherits="feedback" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div class="box">
<div align="center">
67

<h2> Write Your Comment</h2>


<asp:Label ID="lblname" runat="server" Text="Name" Width="70px"></asp:Label>
<asp:TextBox ID="Txtname" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="lblemail" runat="server" Text="E-mail" Width="70px"></asp:Label>
<asp:TextBox ID="Txtmail" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lblmsg" runat="server" Text="Message" Width="70px"></asp:Label>
<asp:TextBox ID="Txtmsg" TextMode="MultiLine" runat="server"></asp:TextBox>
<br />
<br /><br />
<asp:Button ID="Btn1" runat="server" Text="Submit" onclick="Btn1_Click" />
</div>
</div>
</asp:Content>

Feedback.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;

public partial class feedback : System.Web.UI.Page


{
SqlConnection conn = new
SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);
protected void Page_Load(object sender, EventArgs e)
{

}
68

protected void Btn1_Click(object sender, EventArgs e)


{
conn.Open();
SqlCommand cmd=new SqlCommand("insert into
feedback(name,email,msg)values('"+Txtname.Text+"','"+Txtmail.Text+"','"+Txtmsg.Text+"')
",conn);
cmd.ExecuteNonQuery();
Response.Write("<script type='text/javascript'>alert('Thanks For Your
Comment');</script>");

conn.Close();
Txtmail.Text = "";
Txtmsg.Text = "";
Txtname.Text = "";

}
}
69

User Login

Ulogin.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="ulogin.aspx.cs" Inherits="ulogin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div align ="center">
<h2> Login Here</h2>
<asp:Label ID="Lblname" runat="server" Text="User Name" Width="100px"
></asp:Label>
<asp:TextBox ID="Txtname" runat="server" Width="151px"></asp:TextBox><br />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ErrorMessage="Enter Your Email" ControlToValidate="Txtname"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+
([-.]\w+)*"></asp:RegularExpressionValidator><br />
70

<asp:Label ID="Lblpwd" runat="server" Text="Password" Width="100px"></asp:Label>


<asp:TextBox ID="Txtpwd" TextMode="password" runat="server" Width="155px"
></asp:TextBox><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="Enter Your Password"
ControlToValidate="Txtpwd"></asp:RequiredFieldValidator><br />
<asp:Label ID="Label1" runat="server"></asp:Label><br /><br />
<asp:Button ID="Btnlogin" runat="server" Text="Login" onclick="Btnlogin_Click" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="Btnreset" runat="server" Text="Reset" onclick="Btnreset_Click" />
&nbsp;&nbsp;&nbsp;<br /><br />
<asp:HyperLink ID="HyperLink2" runat="server"
NavigateUrl="~/frgotpwd.aspx">Forget
Password</asp:HyperLink>&nbsp;&nbsp;&nbsp;&nbsp;
<asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/chngpwd.aspx">
Change Password</asp:HyperLink>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [login]"></asp:SqlDataSource>
</div>
<div align ="right" class="alignright">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/reg.aspx">New
User</asp:HyperLink>
</div>
</asp:content>

Ulogin.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI.HtmlControls;
71

using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;
using System.Xml.Linq;
using System.Data;
public partial class ulogin : System.Web.UI.Page
{
SqlConnection conn = new
SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Btnlogin_Click(object sender, EventArgs e)
{
conn.Open();
SqlCommand cmd = new SqlCommand("select cid,name,email,pwd from reg where
email='" + Txtname.Text + "'AND pwd='" + Txtpwd.Text + "'", conn);
dr = cmd.ExecuteReader();
if (dr.Read())
{
Session["cid"] = dr["cid"];
Session["cnm"] = dr["name"];
Session["wronglongin"] = null;
Response.Write("<script type=text/javascript>alert('Successfully login');</script>");
Response.Redirect("user.aspx");
}
else {
Response.Write("<script type=text/javascript>alert('Invalid Username or
Password');</script>"); }
72

dr.Close();
}
void clear(){
Txtname.Text = "";
Txtpwd.Text = "";
Label1.Text = "";}
protected void Btnreset_Click(object sender, EventArgs e)
{ clear();
}
}
73

Registration:-
74

Reg.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="reg.aspx.cs" Inherits="reg1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

<div align="left">
<h2>SIGNUP HERE</h2>
<asp:Label ID="Lblname" runat="server" Text="Name" Width="135px"></asp:Label>
<asp:TextBox ID="Txtname" runat="server" Width="160px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="please fill your name" ControlToValidate="Txtname"
SetFocusOnError="True"></asp:RequiredFieldValidator><br /><br />
<asp:Label ID="Lbllname" runat="server" Text="Last Name"
Width="135px"></asp:Label>
<asp:TextBox ID="Txtlname" runat="server" Width="160px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ErrorMessage="please fill your name" ControlToValidate="Txtlname"
SetFocusOnError="True"></asp:RequiredFieldValidator><br /><br /><br /><br />
<asp:Label ID="Lblemail" runat="server" Text="E_Mail" Width="135px"></asp:Label>
<asp:TextBox ID="Txtemail" runat="server" Width="160px"></asp:TextBox>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator2" runat="server"
ErrorMessage="Enter Your Email" ControlToValidate="Txtemail"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
Width="160"></asp:RegularExpressionValidator>
<br /><br />
<asp:Label ID="Lblpwd" runat="server" Text="Password" Width="135px"></asp:Label>
<asp:TextBox ID="Txtpwd" runat="server" Width="160px"
TextMode="Password"></asp:TextBox><br /><br />
75

<asp:Label ID="Lblcnfrmpwd" runat="server" Text="Confirm Password"


Width="135px"></asp:Label>
<asp:TextBox ID="Txtcnfrmpwd" runat="server" Width="160px"
TextMode="Password"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ErrorMessage="Check Password" ControlToCompare="Txtpwd"
ControlToValidate="Txtcnfrmpwd"></asp:CompareValidator><br /><br />
<asp:Label ID="Label8" runat="server" Text="Security Question" />
<asp:DropDownList ID="Ddques" runat="server" >
<asp:ListItem Selected="True" Value="none"><--select--></asp:ListItem>
<asp:ListItem>What is the name of your childhood friend ?</asp:ListItem>
<asp:ListItem>What was your first phone number ?</asp:ListItem>
<asp:ListItem>What town were you born in ?</asp:ListItem>
<asp:ListItem>What was the name of your first teacher ?</asp:ListItem>
<asp:ListItem>Who is your favourite author ?</asp:ListItem>
<asp:ListItem>What is your favourite food ?</asp:ListItem>
<asp:ListItem>What was the name of your school ?</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7"
InitialValue="none" runat="server"
ControlToValidate="Ddques" ErrorMessage="Select Your Question">Select
Question</asp:RequiredFieldValidator><br /><br />
<asp:Label ID="Lblid" runat="server" Text="Answer" Width="135"></asp:Label>
<asp:TextBox ID="Txtid" runat="server"></asp:TextBox><br /><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator7"
InitialValue="none" runat="server"
ControlToValidate="Ddques" ErrorMessage="nter your answer">Select
Question</asp:RequiredFieldValidator><br /><br />
<asp:Label ID="Lblgender" runat="server" Text="Gender"
Width="135px"></asp:Label>&nbsp;&nbsp;
<asp:RadioButtonList ID="Radiogender" runat="server" Width="160px">
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
76

</asp:RadioButtonList><br />
<asp:Label ID="Lblphone" runat="server" Text="Phone" Width="135px"></asp:Label>
<asp:TextBox ID="Txtphone" runat="server" Width="160px"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ErrorMessage="RegularExpressionValidator" ControlToValidate="Txtphone"
ValidationExpression="[0-9]{10}"></asp:RegularExpressionValidator>
<br /> <br />
<asp:Label ID="Lbladdress" runat="server" Text="Address" Width="135px"></asp:Label>
<asp:TextBox ID="Txtaddress" runat="server" Width="160px"></asp:TextBox><br
/><br />
&nbsp;<asp:Label ID="Lblcity" runat="server" Text="City"
Width="135px"></asp:Label>
<asp:DropDownList ID="Ddcity" runat="server">
<asp:ListItem>Select City</asp:ListItem>
<asp:ListItem>bikaner</asp:ListItem>

<asp:ListItem>Mumbai</asp:ListItem>
<asp:ListItem>Delhi</asp:ListItem>
<asp:ListItem Value="Bangole">Bangalore</asp:ListItem>
<asp:ListItem>Hydrabad</asp:ListItem>
<asp:ListItem>Ahemdabad</asp:ListItem>
<asp:ListItem>Chennai</asp:ListItem>
<asp:ListItem>Kolkata</asp:ListItem>
<asp:ListItem>Surat</asp:ListItem>
<asp:ListItem>Pune</asp:ListItem>
<asp:ListItem>Jaipur</asp:ListItem>
<asp:ListItem>Lucknow</asp:ListItem>
<asp:ListItem>Kanpur</asp:ListItem>
<asp:ListItem>Nagpur</asp:ListItem>
<asp:ListItem>Indore</asp:ListItem>
<asp:ListItem>Thane</asp:ListItem>
<asp:ListItem>Bhopal</asp:ListItem>
<asp:ListItem>Patna</asp:ListItem>
<asp:ListItem>Agra</asp:ListItem>
77

<asp:ListItem>Ranchi</asp:ListItem>
<asp:ListItem>Rajkot</asp:ListItem>
<asp:ListItem>Allahbad</asp:ListItem>
<asp:ListItem>Nashik</asp:ListItem>
<asp:ListItem>Raipur</asp:ListItem>
<asp:ListItem>Kota</asp:ListItem>
<asp:ListItem>Solapur</asp:ListItem>
<asp:ListItem></asp:ListItem>

</asp:DropDownList><br /><br />


<asp:Label ID="Lblcountry" runat="server" Text="Country"
Width="135px"></asp:Label>
<asp:DropDownList ID="Ddcountry" runat="server">
<asp:ListItem>Select Country</asp:ListItem>
<asp:ListItem>Afghanistan</asp:ListItem>
<asp:ListItem>Antarctica</asp:ListItem>
<asp:ListItem>Bangladesh</asp:ListItem>
<asp:ListItem>Belize</asp:ListItem>
<asp:ListItem>Bhutan</asp:ListItem>
<asp:ListItem>Brazil</asp:ListItem>
<asp:ListItem>Canada</asp:ListItem>
<asp:ListItem>China</asp:ListItem>
<asp:ListItem>Denmark</asp:ListItem>
<asp:ListItem>Egypt</asp:ListItem>
<asp:ListItem>France</asp:ListItem>
<asp:ListItem>Greece</asp:ListItem>
<asp:ListItem>Hong Kong</asp:ListItem>
<asp:ListItem>India</asp:ListItem>
<asp:ListItem>Iraq</asp:ListItem>
<asp:ListItem>Japan</asp:ListItem>
<asp:ListItem> Mexico</asp:ListItem>
<asp:ListItem>Nepal</asp:ListItem>
78

</asp:DropDownList><br /><br />


<asp:Label ID="Lblstate" runat="server" Text="State" Width="135px"></asp:Label>
<asp:DropDownList ID="Ddstate" runat="server">
<asp:ListItem>Select State</asp:ListItem>
<asp:ListItem>Rajasthan</asp:ListItem>
<asp:ListItem>Andhrapradesh</asp:ListItem>
<asp:ListItem>Aasam</asp:ListItem>
<asp:ListItem>Bihar</asp:ListItem>
<asp:ListItem>Chandigarh</asp:ListItem>
<asp:ListItem>Delhi</asp:ListItem>
<asp:ListItem>Goa</asp:ListItem>
<asp:ListItem>Harayana</asp:ListItem>
<asp:ListItem>Jammu</asp:ListItem>
<asp:ListItem>Kerla</asp:ListItem>
<asp:ListItem>Maharastra</asp:ListItem>
<asp:ListItem>Manipur</asp:ListItem>
<asp:ListItem>Odisa</asp:ListItem>
<asp:ListItem>Sikkim</asp:ListItem>
<asp:ListItem>Panjab</asp:ListItem>
<asp:ListItem>Tamil Nadu</asp:ListItem>
<asp:ListItem>Tripura</asp:ListItem>
<asp:ListItem>UP</asp:ListItem>
<asp:ListItem>Utara Khand</asp:ListItem>
<asp:ListItem>West Bangal</asp:ListItem>
<asp:ListItem></asp:ListItem>
</asp:DropDownList><br /><br />
<asp:Button ID="Btnsignup" runat="server" Text="Signup" CssClass="button"
onclick="Btnsignup_Click" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="Btnreset" runat="server" Text="Reset" />
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [reg]"></asp:SqlDataSource>
79

</div>
</asp:Content>

Reg.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;
public partial class reg1 : System.Web.UI.Page
{
SqlConnection conn = new
SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Btnsignup_Click(object sender, EventArgs e)
{
conn.Open();
SqlCommand cmd = new SqlCommand("insert into
reg(name,lname,email,pwd,sque,answer,gender,phone,address,city,country,state)values('" +
Txtname.Text + "','" + Txtlname.Text + "','" + Txtemail.Text + "','" + Txtpwd.Text +
"','"+Ddques.Text+"','"+Txtid.Text+"','" + Radiogender.SelectedValue + "','" + Txtphone.Text
+ "','" + Txtaddress.Text + "','" + Ddcity.Text + "','" + Ddcountry.Text + "','" + Ddstate.Text +
"')", conn);
cmd.ExecuteNonQuery();
conn.Close();
Response.Write("<script type='text/javascript'>alert('Registration Success');</script>");
Txtid.Text = "";
80

Txtaddress.Text = "";
Txtcnfrmpwd.Text = "";
Txtemail.Text = "";
Txtlname.Text = "";
Txtname.Text = "";
Txtpwd.Text = "";
Txtphone.Text = "";
Radiogender.Text = "";
Ddcity.Text = " Select City";
Ddcountry.Text = "Select Country";
Ddstate.Text = "Select State";
}

ChangePassword:

Changepassword.aspx
81

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"


AutoEventWireup="true" CodeFile="chngpwd.aspx.cs" Inherits="chngpwd" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div align="center" class="box">
<h2>Change Your Password</h2>
<asp:Label ID="Lblemail" runat="server" Text="E-Mail" Width="165px"></asp:Label>
<asp:TextBox ID="Txtemail" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lbloldpwd" runat="server" Text=" Old Password"
Width="165px"></asp:Label>
<asp:TextBox ID="Txtoldpwd" runat="server"
TextMode="password"></asp:TextBox><br /><br />

<asp:Label ID="Lblpwd" runat="server" Text="New Password"


Width="165px"></asp:Label>
<asp:TextBox ID="Txtpwd" runat="server" TextMode="password"></asp:TextBox><br
/><br />
<asp:Label ID="Lblcpwd" runat="server" Text="Confirm Password"
Width="165px"></asp:Label>
<asp:TextBox ID="TXtcpwd" runat="server"
TextMode="password"></asp:TextBox><br />
<asp:CompareValidator ID="CompareValidator1" runat="server"
ErrorMessage="CheckYour Password" ControlToCompare="TXtpwd"
ControlToValidate="Txtcpwd"></asp:CompareValidator><br />
<asp:Label ID="Label1" runat="server" Text=""></asp:Label><br /><br />
<asp:Button ID="Btnchng" runat="server" Text="Change" onclick="Btnchng_Click"
/><br /><br />
</div>
</asp:Content>

Changepassword.aspx.cs
82

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;
using System.Data;

public partial class chngpwd : System.Web.UI.Page


{
SqlConnection conn = new
SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Btnchng_Click(object sender, EventArgs e)
{
try
{
if (conn.State == ConnectionState.Open)
{
conn.Close();
}
conn.Open();
SqlCommand cmd = new SqlCommand("select pwd from reg where email='" +
Txtemail.Text + "'", conn);
cmd.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
83

if (Txtoldpwd.Text != ds.Tables[0].Rows[0][0].ToString())
{
Label1.Text = "ur password is wrong";
Txtoldpwd.Focus();
}
else
{
if (conn.State == ConnectionState.Open)
{
conn.Close();
}
conn.Open();
SqlCommand cmd1 = new SqlCommand("update reg set pwd ='" + Txtpwd.Text +
"'where email='" + Txtemail.Text + "'", conn);
cmd.CommandType = CommandType.Text;
cmd1.ExecuteNonQuery();
conn.Close();
Label1.Text = "Your Password Changed Successfully";
}
}
catch (Exception)
{
throw;
}
}
}

Forgetpassword
84

Forgetpassword.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="frgotpwd.aspx.cs" Inherits="frgotpwd" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div align="center">
<h2> Get Your Password:</h2>
<asp:Label ID="Lblemail" runat="server" Text="E-Mail" Width="150px"></asp:Label>
<asp:TextBox ID="Txtemail" runat="server"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button1" runat="server" Text="Get Question"
onclick="Button1_Click1" /><br /><br />
<asp:Label ID="Lblque" runat="server" Text="Security Questions"
Width="150px"></asp:Label>
85

<asp:TextBox ID="Txtque" runat="server"></asp:TextBox><br /><br />


<asp:Label ID="Lblans" runat="server" Text="Answer" Width="150px"></asp:Label>
<asp:TextBox ID="Txtans" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lblpwd" runat="server" Text="Your Password"
Width="150px"></asp:Label>
<asp:TextBox ID="Txtpwd" runat="server"></asp:TextBox><br /><br />
<asp:Button ID="Btnchng" runat="server" Text="Find Password"
onclick="Btnchng_Click" />
&nbsp;
</div>
</form>
</asp:Content>

Forgotpassword.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Web.Configuration;
using System.Xml.Linq;
using System.Data;
using System.Web.Security;

public partial class frgotpwd : System.Web.UI.Page


{
SqlConnection conn = new
SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);
SqlCommand cmd;
SqlDataReader dr;
86

protected void Page_Load(object sender, EventArgs e)


{

}
protected void Btnchng_Click(object sender, EventArgs e)
{
if (Txtemail.Text != "" && Txtque.Text != "" && Txtans.Text != "")
{

conn.Open();

cmd = new SqlCommand("SELECT pwd FROM reg where email = '" +


Txtemail.Text + "' AND sque ='" + Txtque.Text + "' AND answer = '" + Txtans.Text + "'",
conn);
dr = cmd.ExecuteReader();

if (dr.Read())
{
Txtpwd.Text = dr[0].ToString();
}
else
{
Response.Write("<script type=text/javascript>alert('Invalid
Information');</script>");
Txtpwd.Text = "";
}
dr.Close();
conn.Close();
}
}

protected void Button1_Click1(object sender, EventArgs e)


{
87

conn.Open();

SqlCommand cmd = new SqlCommand("select sque from reg where email = '" +
Txtemail.Text + "'", conn);
dr = cmd.ExecuteReader();

if (dr.Read())
{
Txtque.Text = dr[0].ToString();
}
else
{
Response.Write("<script type=text/javascript>alert('Invalid Username or
Password');</script>");
}
dr.Close();
conn.Close();

}
}

Booking.
88

Booking.master
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="usermaster.master.cs"
Inherits="usermaster" %>

<!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 runat="server">
<title>Five Star Hotel</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" />
<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>
89

<script type="text/javascript">ie_png.fix('.png, #header .row-2, #header .nav li a, #content,


.gallery li');</script>
<![endif]-->
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<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="#">Five Star</a></h1>
<em>Hotel</em> <strong>True Luxury</strong> </div>
<div class="phones"> 1-800-412-45-56<br />
1-800-542-64-48 </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="services.aspx">Services</a></li>
<li><a href="gallery.aspx">Gallery</a></li>
<li><a href="detail.aspx">Detail</a></li>
<li><a href="user.aspx">User Page</a></li>
<li><a href="home.aspx" >Logout</a></li>
<li><a href="Cancel.aspx">Cancel</a></li>
</ul>
</div>
90

</div>
<!-- header-box end -->
</div>
</div>
</div>

<form id="form1" runat="server">


<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>

User.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/usermaster.master"
AutoEventWireup="true" CodeFile="user.aspx.cs" Inherits="_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div align="center">
<table>
<tr>
<td class="style1">
<asp:Label ID="Lblroom" runat="server" Text="Select Room"
Width="160px"></asp:Label>
</td>
<td class="style2">
<asp:DropDownList ID="Ddroomtype" runat="server" AutoPostBack="True"
DataTextField="room_type" DataValueField="room_type">
<asp:ListItem>Room Type</asp:ListItem>
91

<asp:ListItem>Standrad</asp:ListItem>
<asp:ListItem>Semi-Delux</asp:ListItem>
<asp:ListItem>Delux</asp:ListItem>
<asp:ListItem>Suit</asp:ListItem>
</asp:DropDownList>
</td>
</tr/>
<tr>
<td class="style1">
<asp:Label ID="Lblchkin" runat="server" Text="Check In" Width="160px"></asp:Label>
</td>
<td class="style2">
<asp:TextBox ID="TextBox3" runat="server" ReadOnly="True"/>
<asp:ImageButton ID="ImageButton1" runat="server" Height="17px" img
src="images/Calendar.gif" Width="21px" onclick="ImageButton1_Click" />
<asp:Calendar ID="Calendar1" runat="server" Visible="false"
onselectionchanged="Calendar1_SelectionChanged1"></asp:Calendar>

</td>
</tr>
<tr>
<td class="style1">
<asp:Label ID="Lblchkout" runat="server" Text="No Of Days"
Width="160px"></asp:Label>
</td>
<td class="style2">
<asp:DropDownList ID="Ddnofdays" runat="server">

<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
92

<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>

</asp:DropDownList>
</td>
</tr>
<tr>
<td class="style1">
<asp:Label ID="Lblnroom" runat="server" Text="Number Of Room"
Width="160px"></asp:Label>
</td>
<td class="style2">
<asp:DropDownList ID="Ddnroom" runat="server">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
</asp:DropDownList>
</td>
</tr>

<tr>
<td class="style1">

<asp:Label ID="Lblprsn" runat="server" Text="Number Of Persons"


Width="160px"></asp:Label>
93

</td>
<td class="style2">
<asp:DropDownList ID="Ddprsn" runat="server">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
<asp:ListItem>11</asp:ListItem>

</asp:DropDownList>
</td>
</tr>

<tr>
<td>
<asp:Label ID="Label3" runat="server" Text="Room Type"></asp:Label></td>
<td>
<asp:DropDownList ID="Ddromtype" runat="server">
<asp:ListItem>Select Type</asp:ListItem>
<asp:ListItem>Ac</asp:ListItem>
<asp:ListItem>Non A/c</asp:ListItem>
</asp:DropDownList> &nbsp;
<asp:Button ID="Button2" runat="server" Text="Check Room"
onclick="Button2_Click" />
</td>
</tr>
<tr>
<td class="style1">
94

<asp:Label ID="Lblid" runat="server" Text="Id" Width="160px"></asp:Label>


</td>
<td class="style2">
<asp:TextBox ID="Txtid" runat="server"></asp:TextBox><br /><br />
</td>
</tr>
<tr>
<td class="style1">
<asp:Label ID="Lblname" runat="server" Text="Name" Width="160px"></asp:Label>
</td><td class="style2">
<asp:TextBox ID="Txtname" runat="server"></asp:TextBox></td>
</tr>
<td class="style1">
<div align="center">
<asp:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" />
</div>
</td>
</table>
<asp:Label ID="Label2" runat="server" Visible="False"></asp:Label>
</div>
<br />
</asp:Content>

User.aspx.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Web.Security;
95

using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
SqlCommand cmd, cmd1;
SqlDataReader dr, dr1;
SqlConnection conn = new SqlConnection(@"Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|hotel.mdf;Integrated
Security=True;User Instance=True");
protected void Page_Load(object sender, EventArgs e)
{
if (Session["cid"] != null)
{
Lblid.Visible = true;
Txtid.Visible = true;
Txtname.Visible = true;
Lblname.Text = "Customer Name";
Txtid.Text = Session["cid"].ToString();
Txtname.Text = Session["cnm"].ToString();
Txtid.ReadOnly = true;
Txtname.ReadOnly = true;
}
else
{
Session["wronglongin"] = "yes";
/* Response.Redirect("ulogin.aspx");*/
}
If (!Page.IsPostBack)
{
Page.Header.Title = " Booking";
conn.Open();
cmd = new SqlCommand("SELECT DISTINCT room_type FROM Room_Master", conn);
96

dr = cmd.ExecuteReader();
while (dr.Read())
{
Ddroomtype.Items.Add(dr[0].ToString());
}
dr.Close();
conn.Close();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
conn.Open();
cmd1 = new SqlCommand("select cid,name from reg where cid='" + Txtid.Text +
"',name='" + Txtname.Text + "'");
SqlCommand cmd = new SqlCommand("insert into
booking(selctrom,chckin,noofdays,nofroom,nofperson,roomtype,cid,name)values('" +
Ddroomtype.Text + "','" + TextBox3.Text + "','" + Ddnofdays.Text + "','" + Ddnroom.Text +
"','" + Ddprsn.Text + "','" + Ddromtype.Text + "','" + Txtid.Text + "','" + Txtname.Text + "')",
conn);
cmd.ExecuteNonQuery();
Response.Redirect("detail.aspx");
conn.Close();
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
Calendar1.Visible = true;
}
protected void Calendar1_SelectionChanged1(object sender, EventArgs e)
{
TextBox3.Text = Calendar1.SelectedDate.ToShortDateString();
Calendar1.Visible = false;
}
protected void Button2_Click(object sender, EventArgs e)
{
97

if (TextBox3.Text != "" && Ddnroom.Text != "" && Ddnofdays.Text != "")


{
int totroom = 0, availableroom = 0, bookedroom = 0, r = 0;
conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|
DataDirectory|\hotel.mdf;Integrated Security=True;User Instance=True");
conn.Open();
cmd1 = new SqlCommand("SELECT count(room_type) FROM Room_Master where
room_type ='" + Ddromtype.Text + "'", conn);
dr1 = cmd1.ExecuteReader();
if (dr1.Read())
{
totroom = Convert.ToInt32(dr1[0].ToString());
totroom = 50;
}
//dr1.Close();

conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|


DataDirectory|\hotel.mdf;Integrated Security=True;User Instance=True");
conn.Open();
cmd = new SqlCommand("SELECT count(roomtype) FROM booking where
chckin='" + Convert.ToDateTime(TextBox3.Text) + "' AND roomtype ='" + Ddromtype.Text
+ "'", conn);
dr = cmd.ExecuteReader();
if (dr.Read())
{
bookedroom = Convert.ToInt32(dr[0]);
availableroom = totroom - bookedroom;
}
r = Convert.ToInt32(Ddnroom.Text);
if (availableroom >= r)
{
Button1.Enabled = true;
Label2.Visible = true;
98

Label2.Text = "Rooms Available";


}
else
{
Button1.Enabled = false;
Label2.Visible = true;
Label2.Text = "Sorry, Rooms are NOT Available";
}
dr.Close();
conn.Close();
}
else
{
Response.Write("<script type='text/javascript'>alert('Enter necessary
information');</script>");
}
}}

Booking Cancel

Cancle.aspx
99

<%@ Page Title="" Language="C#" MasterPageFile="~/usermaster.master"


AutoEventWireup="true" CodeFile="cancel.aspx.cs" Inherits="cancel" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div align="center">
<h2> Cancle Your Booking</h2>
<asp:Label ID="Lbluname" runat="server" Text="User Name"
Width="135px"></asp:Label>
<asp:TextBox ID="Txtuname" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lblrno" runat="server" Text="Checkin Date"
Width="135px"></asp:Label>
<asp:TextBox ID="Txtrno" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lblid" runat="server" Text="ID" Width="135px"></asp:Label>
<asp:TextBox ID="Txtid" runat="server"></asp:TextBox><br /><br />
<asp:Button ID="Btncncl" runat="server" Text="Cancel" onclick="Btncncl_Click" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>
</div>
</asp:Content>

Cancle.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;

public partial class cancel : System.Web.UI.Page


100

{
SqlConnection conn=new
SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);

protected void Page_Load(object sender, EventArgs e)


{

}
protected void Btncncl_Click(object sender, EventArgs e)
{
conn.Open();
SqlCommand cmd=new SqlCommand("delete from booking where
cid='"+Txtid.Text+"'",conn);
cmd.ExecuteNonQuery();
Response.Write("<script type='text/javascript'>alert('Your Booking Delete
Successfully');</script>");
conn.Close();
Txtid.Text = "";
Txtrno.Text = "";
Txtuname.Text = "";

}
}

User detail page


101

User detail.aspx

<%@ Page Title="" Language="C#" MasterPageFile="~/usermaster.master"


AutoEventWireup="true" CodeFile="detail.aspx.cs" Inherits="detail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div align="center">
<h2>User Detail</h2>
<asp:Label ID="Lblchkin" runat="server" Text="Check In" Width="130px"></asp:Label>
<asp:TextBox ID="Txtchkin" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lblchkout" runat="server" Text="NO. Of Days"
Width="130px"></asp:Label>
<asp:TextBox ID="Txtchkout" runat="server"></asp:TextBox><br /><br />
102

<asp:Label ID="Lbluser" runat="server" Text="User Name"


Width="130px"></asp:Label>
<asp:TextBox ID="Txtuser" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lblid" runat="server" Text="ID" Width="130px"></asp:Label>
<asp:TextBox ID="Txtid" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lbltype" runat="server" Text="Room Type"
Width="130px"></asp:Label>
<asp:TextBox ID="Txttype" runat="server"></asp:TextBox><br /><br />
</div>
</asp:Content>

User detail.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data.SqlClient;
public partial class detail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Session["UserEmail"] != null)
{
getUserData();
}
if (Session["cid"] != null)
{
Lblid.Visible = true;
103

Txtid.Visible = true;
Txtid.Text = Session["cid"].ToString();
Txtid.ReadOnly = true;
getUserData();
}
}
}
public void getUserData()
{
// SqlConnection cn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionSt
ring);
SqlConnection cn = new SqlConnection(@"Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|hotel.mdf;Integrated
Security=True;User Instance=True");
cn.Open();
SqlCommand cmd1 = new SqlCommand("Select cid ,name,chckin,noofdays,selctrom
From booking where cid='" + Txtid.Text + "'",cn);
// SqlCommand cmd = new SqlCommand("Select cid ,name,chckin,selctrom,roomavlbl
From booking where booking.name='" + Session["UserEmail"].ToString() + "'", cn);
SqlDataReader dr = cmd1.ExecuteReader();
while (dr.Read())
{
Txtchkin.Text = dr["chckin"].ToString();
Txtchkout.Text = dr["noofdays"].ToString();
Txtuser.Text = dr["name"].ToString();
Txtid.Text = dr["cid"].ToString();
Txttype.Text = dr["selctrom"].ToString();
// Txtrno.Text = dr["roomavlbl"].ToString();
}
cn.Close();
}}

Admin page
104

Admin.masterpage
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs"
Inherits="admin_MasterPage" %>
<!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 runat="server">
<title>Five Star Hotel</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" />
<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 li');</script>
105

<![endif]-->
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style>
/* Navbar container */
.navbar{
overflow: hidden;
background-color: #333;
font-family: Arial;
width:633px;
float:inherit;
padding:0 0 0 0;
}
/* Links inside the navbar */
.navbar a {
float:inherit;
font-size: 16px;
color:Gray;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}

/* The dropdown container */


.dropdown {
float: left;
overflow: hidden;
}

/* Dropdown button */
.dropdown .dropbtn {
font-size: 15px;
border: none;
outline: none;
106

color: white;
padding: 14px 16px;
background-color: inherit;
}

/* Add a red background color to navbar links on hover */


.navbar a:hover, .dropdown:hover .dropbtn {
background-color:transparent;
}

/* Dropdown content (hidden by default) */


.dropdown-content {
display: none;
position: absolute;
background-color:Maroon;
min-width: 80px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}

/* Links inside the dropdown */


.dropdown-content a {
float: none;
color: black;
padding: 12px 12px;
text-decoration: none;
display: block;
text-align: left;
}

/* Add a grey background color to dropdown links on hover */


.dropdown-content a:hover {
background-color:Maroon;
}
107

/* Show the dropdown menu on hover */


.dropdown:hover .dropdown-content {
display: block;
}
.container {
position: relative;
width: 20%;
}

.image {
display: block;
width: 100%;
height: 90px;
}

.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .5s ease;

.container:hover .overlay {
opacity: 1;
}

.text {
108

color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
</style>
</head>
<body id="page1" onload="new ElementMaxHeight();">
<div id="main" align="center">
<!-- header -->
<div id="header">
<div class="row-1">
<div class="wrapper">
<div class="logo">
<h1><a href="#">Five Star</a></h1>
<em>Hotel</em> <strong>True Luxury</strong> </div>
<div class="phones"> 1-800-412-45-56<br />
1-800-542-64-48 </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="addadmin.aspx">Add Admin</a></li>
<li><a href="custmrinfo.aspx">Customer Info</a></li>
<li><a href="booking.aspx">Booking</a></li>

<li> <a href="chngpwd.aspx">Change Password</a></li>


109

<li><a href="addroom.aspx">Add room</a></li>


<li class="dropdown"><a href="#">Other</a>
<ul class="dropdown-content">
<li><a href="../home.aspx">Logout</a></li>

<li><a href="viewmsg.aspx">View Feedback</a></li>


</ul></li>
</ul>
</div>
</div>
<!-- header-box end -->
</div>
</div>
</div>

<form id="form1" runat="server">


<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>

Admin.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage.master"
AutoEventWireup="true" CodeFile="admin.aspx.cs" Inherits="admin_admin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
110

<h1 style="font-family: 'Lucida Sans'; font-size: 90px; font-weight: bold; font-style:


oblique; color: #000000;"> Welcome To Admin Panel</h1>
</asp:Content>

Adminlogin:-

AdminLogin.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="alogin.aspx.cs" Inherits="alogin1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div align ="center">
111

<h2>
Admin Login Here</h2>

<asp:Label ID="Lblname" runat="server" Text="Admin" Width="100px" ></asp:Label>


<asp:TextBox ID="Txtname" runat="server" Width="151px"></asp:TextBox><br />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ErrorMessage="Enter Your Email" ControlToValidate="Txtname"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+
([-.]\w+)*"></asp:RegularExpressionValidator>
<br />
<asp:Label ID="Lblpwd" runat="server" Text="Password" Width="100px"></asp:Label>
<asp:TextBox ID="Txtpwd" runat="server" Width="155px"
TextMode="Password"></asp:TextBox><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="Enter Your Password"
ControlToValidate="Txtpwd"></asp:RequiredFieldValidator><br />

<asp:Button ID="Btnlogin" runat="server" Text="Login" onclick="Btnlogin_Click" />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="Btnreset" runat="server" Text="Reset" onclick="Btnreset_Click" />
&nbsp;&nbsp;&nbsp;<asp:Label ID="Label1" runat="server"></asp:Label><br />
<div align="right">
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [adminlogin]"></asp:SqlDataSource>

</div>
</asp:Content>

Adminlogin.aspx.cs
using System;
using System.Collections.Generic;
112

using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;
using System.Xml.Linq;
using System.Data;

public partial class alogin1 : System.Web.UI.Page


{
SqlCommand cmd = new SqlCommand();
SqlConnection conn = new
SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();

protected void Page_Load(object sender, EventArgs e)


{
}

protected void Btnreset_Click(object sender, EventArgs e)


{
clear();
}
protected void Btnlogin_Click(object sender, EventArgs e)
{
cmd.CommandText = "select * from adminuser where Admin_user='" + Txtname.Text
+ "'and Admin_password='" + Txtpwd.Text + "'";
cmd.Connection = conn;
da.SelectCommand = cmd;
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
113

{
Response.Redirect("admin/admin.aspx", true);
}
else
{
Label1.Text = "data not found";
}
}
void clear()
{
Txtname.Text = "";
Txtpwd.Text = "";
Label1.Text = "";
}
}

AddAdmin:-
114

Addadmin.aspx

<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage.master"


AutoEventWireup="true" CodeFile="addadmin.aspx.cs" Inherits="admin_addadmin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div align="center">
<h2>Add Admin Here</h2>
<asp:Label ID="Lblemail" runat="server" Text="Admin E-Mail"
Width="165px"></asp:Label>
<asp:TextBox ID="Txtemail" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lblpwd" runat="server" Text="Admin Password"
Width="165px"></asp:Label>
<asp:TextBox ID="Txtpwd" runat="server" TextMode="Password"></asp:TextBox><br
/><br />
<asp:Label ID="Lblmsg" runat="server" Text=""></asp:Label>
<asp:Button ID="Btnadd" runat="server" Text="Add Admin" onclick="Btnadd_Click"
/><br /><br />
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataKeyNames="Admin_Id"
DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="Admin_Id" HeaderText="Admin_Id"
InsertVisible="False" ReadOnly="True" SortExpression="Admin_Id" />
<asp:BoundField DataField="Admin_User" HeaderText="Admin_User"
SortExpression="Admin_User" />
<asp:BoundField DataField="Admin_Password" HeaderText="Admin_Password"
115

SortExpression="Admin_Password" />
</Columns>
</asp:GridView>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"


ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM adminuser WHERE (Admin_Id = @Admin_Id)"
SelectCommand="SELECT adminuser.* FROM adminuser"
UpdateCommand="UPDATE adminuser SET Admin_User = @Admin_User,
Admin_Password = @Admin_Password WHERE (Admin_Id = @Admin_Id)">
<DeleteParameters>
<asp:Parameter Name="Admin_Id" />
</DeleteParameters>
<UpdateParameters>

<asp:Parameter Name="Admin_User" />


<asp:Parameter Name="Admin_Password" />
<asp:Parameter Name="Admin_Id" />
</UpdateParameters>
</asp:SqlDataSource>

</div>
</div>
</asp:Content>

Addadmin.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
116

using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;
using System.Data;

public partial class admin_addadmin : System.Web.UI.Page


{
SqlConnection conn = new
SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);
public static string show = string.Empty;
DataSet ds;

protected void Page_Load(object sender, EventArgs e)


{
if (Session["Admin"] != null)
{
if (show == "Delete")
{
Lblmsg.Text = "Admin removed Succesfully !!";
show = string.Empty;
}
else if (show == "Add")
{
Lblmsg.Text = "Admin Added Successfully !!";
show = string.Empty;
}
else if (show == "Exists")
{
Lblmsg.Text = "Admin UserName Already Exists !!";
show = string.Empty;
}
// this.fillgrid();
}
117

protected void Btnadd_Click(object sender, EventArgs e)


{
conn.Open();
SqlCommand cmd = new SqlCommand("insert into
adminuser(Admin_User,Admin_Password)values('" + Txtemail.Text + "','" + Txtpwd.Text +
"')", conn);
cmd.ExecuteNonQuery();
conn.Close();
}

Customer info page


118

Customerinfo.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage.master"
AutoEventWireup="true" CodeFile="custmrinfo.aspx.cs" Inherits="admin_custmrinfo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div align=”center”>
<asp:TextBox ID="Txtsrch" runat="server"></asp:TextBox>
<asp:Button ID="Btngo" runat="server" Text="GO" onclick="Btngo_Click" />
</div>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="cid" HeaderText="Customer ID" InsertVisible="False"
ReadOnly="True" SortExpression="cid" />
119

<asp:BoundField DataField="name" HeaderText="Name" SortExpression="name" />


<asp:BoundField DataField="lname" HeaderText="Last Name" SortExpression="lname" />
<asp:BoundField DataField="email" HeaderText="E-Mail" SortExpression="email" />
<asp:BoundField DataField="pwd" HeaderText="Passsword" SortExpression="pwd" />
<asp:BoundField DataField="sque" HeaderText="Securety Question"
SortExpression="sque" />
<asp:BoundField DataField="answer" HeaderText="Answer"
SortExpression="answer" />
<asp:BoundField DataField="gender" HeaderText="Gender"
SortExpression="gender" />
<asp:BoundField DataField="phone" HeaderText="Phone No." SortExpression="phone" />
<asp:BoundField DataField="address" HeaderText="Address"
SortExpression="address" />
<asp:BoundField DataField="city" HeaderText="City" SortExpression="city" />
<asp:BoundField DataField="country" HeaderText="Country"
SortExpression="country" />
<asp:BoundField DataField="state" HeaderText="State" SortExpression="state" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT cid, name, lname, email, pwd, sque, answer, gender, phone, address,
city, country, state FROM reg">
</asp:SqlDataSource>
</asp:Content>

Customerinfo.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;
using System.Data;
120

using System.Xml.Linq;

public partial class admin_custmrinfo : System.Web.UI.Page


{
public static string show = string.Empty;
SqlConnection conn = new
SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);

protected void Page_Load(object sender, EventArgs e)


{
if (!string.IsNullOrWhiteSpace(Request.QueryString["Q"]))
{
string query = Request.QueryString["Q"].ToString();
SqlCommand cmd = new SqlCommand("select *from reg where name like '%" +
Txtsrch.Text + "%'", conn);
conn.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
GridView2.DataSource = ds;
GridView2.DataBind();
conn.Close();
}

}
protected void Button1_Click(object sender, EventArgs e)
{
GridView1.Visible = false;
SqlCommand cmd = new SqlCommand("select *from reg where name like '%" +
Txtsrch.Text + "%'", conn);
conn.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
121

da.Fill(ds);
GridView2.DataSource = ds;
GridView2.DataBind();
conn.Close();

}
}

Booking page

Booking.aspx
122

<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage.master"


AutoEventWireup="true" CodeFile="booking.aspx.cs" Inherits="admin_booking" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<asp:TextBox ID="Txtsrch" runat="server"></asp:TextBox>
<asp:Button ID="Btngo" runat="server" Text="GO" onclick="Btngo_Click" />

<asp:GridView ID="GridView1" runat="server" AllowPaging="True"


AutoGenerateColumns="False" DataKeyNames="id"
DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" />
<asp:BoundField DataField="id" HeaderText="Id" InsertVisible="False"
ReadOnly="True" SortExpression="id" />
<asp:BoundField DataField="selctrom" HeaderText="Select Room"
SortExpression="selctrom" />
<asp:BoundField DataField="chckin" HeaderText="ChEck-IN"
SortExpression="chckin" />
<asp:BoundField DataField="noofdays" HeaderText="NO of Days"
SortExpression="noofdays" />
<asp:BoundField DataField="nofroom" HeaderText="No of Room"
SortExpression="nofroom" />
<asp:BoundField DataField="nofperson" HeaderText="No. ofpPrson"
SortExpression="nofperson" />
<asp:BoundField DataField="roomtype" HeaderText="Room Type"
SortExpression="roomtype" />
<asp:BoundField DataField="cid" HeaderText="Customer Id"
SortExpression="cid" />
<asp:BoundField DataField="name" HeaderText="Name" SortExpression="name" />
</Columns>
</asp:GridView>
123

<asp:SqlDataSource ID="SqlDataSource1" runat="server"


ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM booking WHERE (id = @id)"
SelectCommand="SELECT * FROM booking" >
<DeleteParameters>
<asp:Parameter Name="id" />
</DeleteParameters>

</asp:SqlDataSource>
<br />
<asp:GridView ID="GridView2" runat="server">
</asp:GridView>
</asp:Content>

Booking.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Web.Configuration;
using System.Xml.Linq;
using System.Data;

public partial class admin_booking : System.Web.UI.Page


{
public static string show = string.Empty;
124

SqlConnection conn = new


SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);

protected void Page_Load(object sender, EventArgs e)


{
if (!string.IsNullOrWhiteSpace(Request.QueryString["Q"]))
{
string query = Request.QueryString["Q"].ToString();
SqlCommand cmd = new SqlCommand("select *from booking where name like '%" +
Txtsrch.Text + "%'", conn);
conn.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
GridView2.DataSource = ds;
GridView2.DataBind();
conn.Close();
}

protected void Btngo_Click(object sender, EventArgs e)


{
GridView1.Visible=false;
SqlCommand cmd=new SqlCommand("select *from booking where name like
'%"+Txtsrch.Text+"%'",conn);
conn.Open();
SqlDataAdapter da=new SqlDataAdapter(cmd);
DataSet ds=new DataSet();
da.Fill(ds);
GridView2.DataSource=ds;
125

GridView2.DataBind();
conn.Close();

}
}

ChangePassword

Changepassword.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage.master"
AutoEventWireup="true" CodeFile="chngpwd.aspx.cs" Inherits="admin_chngpwd" %>
126

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div align="center" class="box">
<h2>Change Your Password</h2>
<asp:Label ID="Lblemail" runat="server" Text="E-Mail" Width="165px"></asp:Label>
<asp:TextBox ID="Txtemail" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lbloldpwd" runat="server" Text=" Old Password"
Width="165px"></asp:Label>
<asp:TextBox ID="Txtoldpwd" runat="server"
TextMode="password"></asp:TextBox><br /><br />

<asp:Label ID="Lblpwd" runat="server" Text="New Password"


Width="165px"></asp:Label>
<asp:TextBox ID="Txtpwd" runat="server" TextMode="password"></asp:TextBox><br
/><br />
<asp:Label ID="Lblcpwd" runat="server" Text="Confirm Password"
Width="165px"></asp:Label>
<asp:TextBox ID="TXtcpwd" runat="server"
TextMode="password"></asp:TextBox><br />
<asp:CompareValidator ID="CompareValidator1" runat="server"
ErrorMessage="CheckYour Password" ControlToCompare="TXtpwd"
ControlToValidate="Txtcpwd"></asp:CompareValidator><br />
<asp:Label ID="Label1" runat="server" Text=""></asp:Label><br /><br />
<asp:Button ID="Btnchng" runat="server" Text="Change" onclick="Btnchng_Click"
/><br /><br />

</div>
</asp:Content>
127

Changepassword.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;
using System.Data;

public partial class admin_chngpwd : System.Web.UI.Page


{
SqlConnection conn = new
SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);

protected void Page_Load(object sender, EventArgs e)


{

}
protected void Btnchng_Click(object sender, EventArgs e)
{
try
{
if(conn.State==ConnectionState.Open)
{
conn.Close();
}
conn.Open();
SqlCommand cmd=new SqlCommand("select Admin_Password from adminuser
where Admin_User='"+Txtemail.Text+"'",conn);
128

cmd.CommandType=CommandType.Text;
SqlDataAdapter da=new SqlDataAdapter(cmd);
DataSet ds=new DataSet();
da.Fill(ds);
if(Txtoldpwd.Text!=ds.Tables[0].Rows[0][0].ToString())
{
Label1.Text="ur password is wrong";
Txtoldpwd.Focus();
}
else{
if(conn.State==ConnectionState.Open)
{
conn.Close();
}
conn.Open();
SqlCommand cmd1=new SqlCommand("update adminuser set Admin_Password
='"+Txtpwd.Text+"'where admin_User='"+Txtemail.Text+"'",conn);
cmd.CommandType=CommandType.Text;
cmd1.ExecuteNonQuery();
conn.Close();
Label1.Text="Your Password Changed Successfully";
}
}
catch(Exception)
{
throw;
}
}
}

Addroom page
129

Addroom.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage.master"
AutoEventWireup="true" CodeFile="addroom.aspx.cs" Inherits="admin_addroom" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div align="center">
<div class="box"><h2>Add Room</h2>
<asp:Label ID="Lblromno" runat="server" Text="Room No" Width="100px"></asp:Label>
<asp:TextBox ID="Txtromno" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lbltype" runat="server" Text="Room Type" Width="100px"></asp:Label>
<asp:TextBox ID="Txttype" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lblac" runat="server" Text="AC/NON_AC" Width="100px"></asp:Label>
<asp:TextBox ID="Txtac" runat="server"></asp:TextBox><br /><br />
<asp:Label ID="Lbltarif" runat="server" Text="Room_Tarrif" Width="100px"></asp:Label>
<asp:TextBox ID="Txttarif" runat="server"></asp:TextBox><br /><br />
<asp:Button ID="Btnadd" runat="server" Text="Add" onclick="Btnadd_Click" />

</div></div>
130

</asp:Content>

Addroom.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;

public partial class admin_addroom : System.Web.UI.Page


{
SqlConnection conn = new
SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].Connecti
onString);
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Btnadd_Click(object sender, EventArgs e)
{
conn.Open();
SqlCommand cmd = new SqlCommand("insert into
Room_Master(room_no,room_type,AC_NonAc,room_tariff)values('" + Txtromno.Text + "','"
+ Txttype.Text + "','" + Txtac.Text + "','" + Txttarif.Text + "')", conn);
cmd.ExecuteNonQuery();
conn.Close();
Response.Write("<script type='text/javascript'>alert('Add Room
Successfully');</script>");
Txtac.Text = "";
Txtromno.Text = "";
131

Txttarif.Text = "";
Txttype.Text = "";

}
}

Viewfeedback

ViewFeedback.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage.master"
AutoEventWireup="true" CodeFile="viewmsg.aspx.cs" Inherits="admin_viewmsg" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
132

<div class="box">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataKeyNames="id"
DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" />
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False"
ReadOnly="True" SortExpression="id" />
<asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
<asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
<asp:BoundField DataField="msg" HeaderText="msg" SortExpression="msg" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM feedback WHERE (id = @id)"
SelectCommand="SELECT * FROM feedback">
<DeleteParameters>
<asp:Parameter Name="id" />
</DeleteParameters>
</asp:SqlDataSource>
</div>
</asp:Content>

Software Testing
1. Overview
2. History
3. Software testing topics
a. Scope
b. Functional vs. non-functional testing
c. Defects and failures
4. Testing methods a. The box approach
i. Black box testing
133

ii. White box testing


iii. Grey Box Testing
5. Testing Levels
a. Unit Testing
b. Integration Testing
c. System Testing
d. System Integration Testing
e. Regression Testing
f. Acceptance testing
g. Alpha testing
h. Beta testing
6. The testing process
a. Traditional CMMI or waterfall development mode
l b. Agile or Extreme development model
c. A sample testing cycle
7. Automated testing
a. Testing Tools
b. Measuring software testing

1. Overview:-
Testing can never completely identify all the defects within software. Instead, it furnishes a
criticism or comparison that compares the state and behavior of the product against oracles—
principles or mechanisms by which someone might recognize a problem. These oracles may
include (but are not limited to) specifications, contracts, comparable products, past versions
of the same product, inferences about intended or expected purpose, user or customer
expectations, relevant standards, applicable laws, or other criteria. Software testing is the
process of attempting to make this assessment.

2. History:-
The separation of debugging from testing was initially introduced by Glen ford J. Myers
in 1979. Although his attention was on breakage testing ("a successful test is one that finds a
bug",) it illustrated the desire of the software engineering community to separate fundamental
134

development activities, such as debugging, from that of verification. Dave Gelperin and
William C. Hetzel classified in 1988 the phases and goals in software testing in the following
stages:
 Until 1956 - Debugging oriented
 1957–1978 - Demonstration oriented
 1979–1982 - Destruction oriented
 1983–1987 - Evaluation oriented
 1988–2000 - Prevention oriented

3. Software testing topics

 Scope
A primary purpose for testing is to detect software failures so that defects may be uncovered
and corrected. This is a nontrivial pursuit. Testing cannot establish that a product functions
properly under all conditions but can only establish that it does not function properly under
specific conditions. The scope of software testing often includes examination of code as well
as execution of that code in various environments and conditions as well as examining the
aspects of code: does it do what it is supposed to do and do what it needs to do.

 Functional vs. non-functional testing


Functional testing refers to tests that verify a specific action or function of the code. These are
usually found in the code requirements documentation, although some development
methodologies work from use cases or user stories. Functional tests tend to answer the
question of "can the user do this" or "does this particular feature work".

4. Testing methods:-

 The box approach


Software testing methods are traditionally divided into black box testing and white box
testing. These two approaches are used to describe the point of view that a test engineer takes
when designing test cases.

 Black box testing


135

Black box testing treats the software as a "black box"—without any knowledge of internal
implementation. Black box testing methods include: equivalence partitioning, boundary value
analysis, all-pairs testing, fuzz testing, model-based testing, traceability matrix, exploratory
testing and specification-based testing.

 White box testing


White box testing is when the tester has access to the internal data structures and algorithms
including the code that implement these.

Types of white box testing


The following types of white box testing exist:
 API testing (application programming interface) - Testing of the application using
Public and Private APIs
 Code coverage - creating tests to satisfy some criteria of code coverage (e.g., the test
designer can create tests to cause all statements in the program to be executed at least
once)
 Fault injection methods - improving the coverage of a test by introducing faults to test
code paths
 Mutation testing methods
 Static testing - White box testing includes all static testing

 GreyBox Testing
Grey box testing involves having access to internal data structures and algorithms for
purposes of designing the test cases, but testing at the user, or black-box level. Manipulating
input data and formatting output do not qualify as grey box, because the input and output are
clearly outside of the "black-box" that we are calling the system under test.

Testing Levels:-

 Unit testing
136

Refers to tests that verify the functionality of a specific section of code, usually at the
function level. In an object-oriented environment, this is usually at the class level, and the
minimal unit tests include the constructors and destructors.

 Integration Testing
Integration testing is any type of software testing that seeks to verify the interfaces between
components against a software design. Software components may be integrated in an iterative
way or all together ("big bang"). Normally the former is considered a better practice since it
allows interface issues to be localized more quickly and fixed. Integration testing works to
expose defects in the interfaces and interaction between integrated components.

 System Testing
It tests a completely integrated system to verify that it meets its requirements

 System Integration Testing


System integration testing verifies that a system is integrated to any
external or third party systems defined in the system requirements.

 Regression Testing
Regression testing focuses on finding defects after a major code change has occurred.
Specifically, it seeks to uncover software regressions, or old bugs that have come back. Such
regressions occur whenever software functionality that was previously working correctly
stops working as intended. Common methods of regression testing include re-running
previously run tests and checking whether previously fixed faults have re-emerged. 

 Acceptance testing
Acceptance testing can mean one of two things:
1. A smoke test is used as an acceptance test prior to introducing a new build to the main
testing process, i.e. before integration or regression.
2. Acceptance testing performed by the customer, often in their lab environment on their own
HW, is known as user acceptance testing (UAT). Acceptance testing may be performed as
part of the hand-off process between any two phases of development.
137

 Alpha testing
Alpha testing is simulated or actual operational testing by potential
users/customers or an independent test team at the developers' site. Alpha testing is often
employed for off-the-shelf software as a form of internal acceptance testing, before the
software goes to beta testing.

 Beta testing
Beta testing comes after alpha testing. Versions of the software, known as
beta versions, are released to a limited audience outside of the programming team. The
software is released to groups of people so that further testing can ensure the product has few
faults or bugs.

5. The testing process:-

 Traditional CMMI or waterfall development model


A common practice of software testing is that testing is performed by
an independent group of testers after the functionality is developed, before it is shipped to the
customer.

 Agile or Extreme development model


In counterpoint, some emerging software disciplines
such as extreme programming and the agile software development movement, adhere to a
"test-driven software development" model. In this process, unit tests are written first, by the
software engineers.

 A sample testing cycle


Although variations exist between organizations, there is a typical cycle
for testing. The sample below is common among organizations employing the Waterfall
development model.
138

Requirements analysis:Testing should begin in the requirements phase of the


software development life cycle. During the design phase, testers work with developers in

determining what aspects of a design are testable and with what parameters those tests work.

 Test planning: Test strategy, test plan, test bed creation. Since many activities will
be carried out during testing, a plan is needed.

 Test development: Test procedures, test scenarios, test cases, test datasets, test
scripts to use in testing software.

 Defect Retesting: Once a defect has been dealt with by the development team, it is
retested by the testing team. AKA Resolution testing.

 Regression testing: It is common to have a small test program built of a subset of


tests, for each integration of new, modified, or fixed software, in order to ensure that
the latest delivery has not ruined anything, and that the software product as a whole is
still working correctly.
 Test Closure: Once the test meets the exit criteria, the activities such as capturing
the key outputs, lessons learned, results, logs, documents related to the project are

archived and used as a reference for future projects.

6. Automated testing:-
139

 Testing Tools
Program testing and fault detection can be aided significantly by testing

tools and debuggers. Testing/debug tools include features such as:

 Program monitors, permitting full or partial monitoring of program code including:


 Instruction Set Simulator, permitting complete instruction level monitoring and trace
facilities.
 Program animation, permitting step-by-step execution and conditional breakpoint at
source level or in machine code
 Code coverage reports
 Formatted dump or Symbolic debugging, tools allowing inspection of program
variables on error or at chosen points.
Some of these features may be incorporated into an Integrated Development Environment
(IDE).

IMPLEMENTATION AND MAINTENANCE


Implementationis the process of having system personnel check out and put new equipment
into use, train users, install the new application and construct any files of data needed to use
it. This phase is less creative than system design. Depending on the size of the organization
that will be involved in using the application and the risk involved in its use, system
developers may choose to the operation in only one area of the firm with only one or two
persons. Sometime, they will run both old and new system in parallel way to compare the
results. In still other situations, system developers stop using the old system one and start
using the new one the next. Evaluationof the system is performed to identify its strengthand
weaknesses. The actual evaluation can occur along any of the following dimensions:
1. Operational Evaluation:
assessment of the manner in which the system functions, including case of use, response

time, overall reliability and level of utilization.

2.Organizational Impact: Identification and measurement of benefits to the


organization in such areas as financial concerns, operational efficiency and competitive
impact.
140

3.Development Performance: Evaluation of the development process in


accordance with such yardsticks as overall development time and effort, conformance to
budgets and standards and other project management criteria.
Maintenanceis necessary to eliminate errors in the working system during its working life and
to tune the system to any variation in its working environment. Often small system
deficiencies are found, as system planners must always plan for resource availability to carry
out these maintenance functions. The importance of maintenance is to continue to bring the
new system to Sta

Future recommendations:-
This project can be used in the hotel after adding some more useful modules in the project for
which hotel are providing services.Now a days hotel are providing many other facilities, this project can also
be improvedwith the improvement in the Hotels.

Bibliography:
• Book Reference:
1. Asp.net pragya publication
2. Asp.NET 3.5 Black Book (Dream Teach Press)

• Web Reference:
www.aspsnippets.com
141
142

You might also like