Professional Documents
Culture Documents
Matthew Lanham
ENTITLED
CheckOutMySeat.com
DEGREE OF
______________________
THESIS ADVISOR
______________________
DEPARTMENTCHAIR
CheckOutMySeat.com
by
Matthew Lanham
2
Abstract
Online ticket purchasing has evolved quite a bit in the last couple years. Many
sites now allow customers to select their own seats for concerts, sports, or any other type
of event. Generally, this is done by presenting a list of available seats to the customer
along with a seating chart that can be used for referencing. If the customers already know
which seats they’d prefer, they might still have to spend some extra time searching
through the listings until their desired seats are found. From a venue’s perspective,
creating a user-friendly interface can be a challenge. Venues will typically have to hire
additional personnel or an outside company to create and manage their online sites, which
becomes very costly.
CheckOutMySeat.com is an online ticketing site that simplifies the purchasing
process on both sides of the transaction. Anyone setting up an event on behalf of a venue
can create their own interactive seating chart using the tools provided. These seating
charts display individual seat locations along with more specific details such as seat
section, row, and pricing. Customers have the benefits of viewing these charts, knowing
which seats are available, and selecting their seats directly from the charts. What makes
this product especially unique is the fact that anyone can create a seating chart. No
knowledge of programming whatsoever is required. With some future development, this
site could potentially rival more mainstream online ticketing agents.
3
Acknowledgements
First and foremost, I would like to thank my family. I would never have made it to
this point without their constant support, encouragement, and love.
I would like to thank my senior design advisor, Dr. Dan Lewis. His guidance has
been essential to both the completion of this project and the success of my undergraduate
career.
I would like to thank all the faculty and staff of the Santa Clara University
Computer Engineering department. The skills and knowledge you have provided me with
over the last four years will allow me to provide the best possible future for myself and
my family.
Finally, I would like to thank my fellow computer engineering students.
Whenever one of us struggled, the others were always ready to lend a helping hand.
We’ve never backed down, we’ve never given up, and now we’ve finally made it.
4
Table of Contents
Abstract ………………………………………3
Acknowledgements ………………………………………4
Table of Contents ………………………………………5
List of Figures ………………………………………7
1. Introduction and Overview ………………………………………8
1.1. Objective ………………………………………8
1.2. Background ………………………………………8
1.3. Product ………………………………………9
2. Development Timeline ………………………………………10
2.1. Deliverable History ………………………………………10
2.2. Website Development ………………………………………11
3. List of Requirements ………………………………………12
3.1. Primary Requirements ………………………………………12
3.2. Secondary Requirements ………………………………………13
4. Use Cases ………………………………………14
4.1. Add Background Image ………………………………………15
4.2. Add Seat Image ………………………………………16
4.3. Create Seat Combination ………………………………………17
4.4. Create Seating Chart ………………………………………18
4.5. Edit Seating Chart ………………………………………19
4.6. Create an Event ………………………………………20
4.7. Purchase Tickets to an Event…………………………………….. 21
5. Technologies Used ………………………………………23
5.1. Hosting ………………………………………23
5.2. Html & CSS ………………………………………23
5.3. PHP ………………………………………23
5.4. JavaScript ………………………………………24
5.5. Database ………………………………………25
6. Conceptual Models ………………………………………28
6.1. Designer Model ………………………………………29
6.2. Customer Model ………………………………………30
7. Flowcharts ………………………………………31
7.1. Seating Chart Creation ………………………………………32
7.2. Ticket Purchasing ………………………………………33
8. Potential Future Enhancements ………………………………34
8.1. Simplify Chart Creation ………………………………………34
8.2. More Improved Overall Interface…………………………………35
5
8.3. Better Editing Options ………………………………………35
8.4. Customer/Venue Profiles ………………………………………35
9. Appendix
9.1. css/default.css ………………………………………………37
9.2. css/extra.css ………………………………………………41
9.3. index.php ………………………………………………43
9.4. top.php ………………………………………………45
9.5. bot.php ………………………………………………46
9.6. createMap.php ………………………………………………47
9.7. editImgs.php ………………………………………………53
9.8. editMaps.php ………………………………………………59
9.9. events.php ………………………………………………63
9.10. funcs.php ………………………………………………67
9.11. purchase.php ………………………………………………80
9.12. records.php ………………………………………………87
9.13. dom-drag.js ………………………………………………89
9.14. moreFuncs.js ………………………………………………92
6
List of Figures
Figure 2.1 – Project Deliverables ………………………………………9
Figure 2.2 – Project Development Timeline ………………………………10
Figure 4.1 – Manage Images Page ………………………………………14
Figure 4.2 – Manage Images Page (2) ………………………………15
Figure 4.3 – Manage Images Page (3) ………………………………16
Figure 4.4 – Create Seating Chart Page Sample ………………………17
Figure 4.5 – Edit Seating Chart Page Sample ………………………………18
Figure 4.6 – View Events Page Sample ………………………………19
Figure 4.7 – Purchase Tickets Page Sample ………………………………21
Figure 5.1 – CSS Style Sheet Sample ………………………………………22
Figure 5.2 – PHP Database Handling Sample………………………………23
Figure 5.3 – JavaScript Updating Background Sample…….……………… 24
Figure 5.4 – Data Structure Legend ………………………………………26
Figure 5.5 – Main Database Structure………………………………………26
Figure 6.1 – Designer Model ………………………………………28
Figure 6.2 – Customer Model ………………………………………29
Figure 7.1 – Seating Chart Creation Flowchart ………………………31
Figure 7.2 – Ticket Purchasing Flowchart ………………………………32
7
1. Introduction and Overview
1.1. Objective
The goal of this project was to develop a product that would provide a simple and
effective method for creating a professional seating chart online. The final product, when
integrated with a ticket purchasing site, gives the customers more control over seating
location without complicating the overall purchasing process. On the other end, the
designers working on behalf of venues have complete control over the design of their
seating charts.
1.2. Background
As an avid sports fan and music lover, I spend a lot of time on ticketmaster.com.
The one problem I have always had with Ticketmaster is that the customer is unable to
select his or her desired seats. Upon searching for tickets to an event, the site will
typically return with the best available seats as determined by the site. Occasionally,
running the search multiple times will yield different results. The next step, especially if
they’re picky about their seating, is for the actor to pull up a seating chart of the venue
and determine if these tickets fulfill their needs. All of this must be accomplished within
the 2-minute page deadline, or the tickets are released, an error message appears, and the
process begins again.
Along with sites like Ticketmaster, ticket exchanging sites are also slowly
becoming more and more popular. These sites typically allow customers who currently
own tickets to an event to sell them online to others. A major advantage for the buyer
here is that they can browse through a list of specific tickets and find the ones that best
suit their needs. The disadvantage is that these tickets are more expensive since most of
the sellers are trying to make some kind of profit. There is also still the issue of
comparing seats with a seating chart back and forth, which can be very time consuming.
8
1.3. Product
The solution I have proposed is a new online ticketing system that speeds up and
simplifies the process of purchasing tickets. The major component is an interactive
design system that grants a venue complete control over their seating charts. The chart
itself displays detailed information on each seat as well as overall availability. Purchasing
seats with this product consists of selecting the desired seats from the interactive chart,
reducing the time needed for comparison with an image of a seating chart. From the
designer’s perspective, this product is both reliable and easy to manage. Ideally, anyone
who wants to sell tickets for an event is able to integrate and use this product with their
site. Everything is fully customizable, including seating location, names, and pricing. At
the same time, it is simple enough so that anyone without much computer experience has
the ability to design a seating chart.
9
2. Development Timeline
10
2.2. Website Development
The table below displays the development process over the quarter and a half
leading up to the Senior Design Conference. The timeline begins with Winter ’08, and
not Fall ’08, because it was around that time that project scope changed (see Section 2.1).
The six processes, shown as columns, represent the major milestones throughout the
project’s development.
11
3. List of Requirements
All of the required features and sub-features for the CheckOutMySeat.com project
have been divided into the following two classes:
• Primary Requirements: These features were vital to the overall scope of the
project. They represent everything needed to satisfy the original project goals
and to ensure a successful project.
• Secondary Requirements: These features are considered secondary because they
were not required for the site to be successful. Many of these features were
implemented to enhance the actor’s experience, add to the appeal, and
increase the flexibility of the site.
To further distinguish the individual features, each class has been further
subdivided based on the following categories:
• Non-Functional: These features provide an improvement to the actor’s overall
experience.
• Functional: These features are more specific and typically address a need
associated with a single page on the site.
12
o Drag-and-drop seats – This provides a simple method for designers to
place seats onto a seating chart.
o Editing a seating chart – This is an important feature for testing and for
enhancing the design aspects of the site.
o Creating events – This provides a vital link between creating a seating
chart and actually purchasing tickets.
o Purchasing tickets – The customer aspect of the site is centered on the
ability to purchase tickets from a seating chart.
o Distinguishing available/unavailable seats – This is an important feature
that enhances the process of purchasing tickets.
13
4. Use Cases
Each use case defines and describes an interaction between an actor and a feature
on the site. Any actor who completes all of the events, in order, of a specific use case will
have accomplished the specified goal. The cases provided are all derived from the project
requirements (see Section 3). The first six cases represent processes that a typical seating
chart designer may experience. The final use case (‘Purchasing Tickets to an Event’)
represents the main experience of the customer who is purchasing tickets to an event. The
overall sequence of use cases is intended to represent the entire ticketing process from
beginning to end.
14
4.1. Add Background Image
Scope: CheckOutMySeat.com
Actor: Any Designer
Goal: Uploading a background image that will be used for a future seating chart
Precondition: Actor must have an image they wish to upload
Typical Sequence of Events:
1) Open Home page
2) Select the ‘Manage Images’ button at the top of the page
3) Under the ‘Backgrounds’ column, select the ‘Add New Background’ link
4) Add the desired name into the ‘Background Name’ field
5) Click on the ‘Browse…’ button and locate the image that will be uploaded
6) Click on the ‘Add Background’ button to upload and save the image
7) Verify that the name now appears in the list (Figure 4.1)
8) Click on the name to view a sample of the image
15
4.2. Add Seat Image
Scope: CheckOutMySeat.com
Actor: Any Designer
Goal: Uploading a seat image that will be used for a future seat combination
Precondition: Actor must have an image they wish to upload
Typical Sequence of Events:
1) Open Home page
2) Select the ‘Manage Images’ button at the top of the page
3) Under the ‘Seats’ column, select the ‘Add New Seat’ link
4) Add the desired name into the ‘Seat Name’ field
5) Click on the ‘Browse…’ button and locate the image that will be uploaded
6) Click on the ‘Add Seat’ button to upload and save the image
7) Verify that the name now appears in the list (Figure 4.2)
8) Click on the name to view a sample of the image
16
4.3. Create Seat Combination
Scope: CheckOutMySeat.com
Actor: Any Designer
Goal: Creating a combination using three different seat images that will represent seat
availability on future seating charts
Precondition: Actor must have at least three uploaded seat images to choose from
Typical Sequence of Events:
1) Open Home page
2) Select the ‘Manage Images’ button at the top of the page
3) Under the ‘Seats’ column, select the ‘Create New Seat Combination’ link
4) Add the desired name into the ‘Seat Combo Name’ field
5) Select an image from the list to represent default/unoccupied seats
6) Select an image to represent actively selected seats
7) Select an image to occupied/unavailable seats
8) Verify that the correct image for each appears to the right of the name (Figure 4.3)
9) Click on the ‘Create Seat Combo’ button to save the seat combination
10) Verify that the name now appears in the list of seat combinations
17
4.4. Create Seating Chart
Scope: CheckOutMySeat.com
Actor: Any Designer
Goal: Creating a seating chart that displays an interactive seating layout
Precondition: At least one available seating combination must exist
Typical Sequence of Events:
1) Open Home page
2) Select the ‘Create Chart’ button at the top of the page
3) Select the desired seat combination
4) Select the desired background by either:
a. Creating a basic background using the provided tools
b. Selecting a pre-saved background
5) Add a name to the chart
6) Click and drag seats to the desired location on the background
7) Double-click seats to add specific seat information (Figure 4.4)
8) Select the ‘Create Seating Chart’ button
9) Verify that the new chart appears on the ‘Manage Charts’ page
18
4.5. Edit Seating Chart
Scope: CheckOutMySeat.com
Actor: Any Designer
Goal: Making changes to or removing a seating chart that has already been created
Precondition: Existing seating chart
Typical Sequence of Events:
1) Open Home page
2) Select the ‘Manage Charts’ button at the top of the page
3) Locate the desired seating chart in the list provided
4) Select the corresponding ‘Edit’ link
5) Change the name in the box to edit the name
6) Double-click any seat to edit each seat’s information (Figure 4.5)
7) When changes have been made, click on the ‘Update Info’ button to save the new
chart
8) Click on the ‘Delete Map’ button to delete the seating chart
19
4.6. Create an Event
Scope: CheckOutMySeat.com
Actor: Any Designer
Goal: Creating an event using any pre-created seating charts for the purpose of selling
tickets
Precondition: Existing seating chart
Typical Sequence of Events:
1) Open Home page
2) Select the ‘Manage Event’ button at the top of the page
3) Click on the ‘Create an Event’ link
4) Add the desired name into the ‘Event Name’ field
5) Add the event’s location into the ‘Location’ field
6) Select a seating chart from the list to be attached to the event
7) Select the appropriate month, day, and year from the lists provided
8) Select the appropriate time from the lists provided
9) Enter a description of the event into the ‘Event Summary’ field
10) Click on the ‘Create Event’ button to create the event
11) Verify that the newly created event and along with all appropriate information
appears in the list (Figure 4.6)
20
4.7. Purchase Tickets to an Event
Scope: CheckOutMySeat.com
Actor: Any Customer
Goal: Reserving seats for a pre-created event using the attached seating chart
Precondition: At least one event, with available seats, must exist
Typical Sequence of Events:
1) Open Home page
2) Select the ‘Purchase Tickets’ button at the top of the page
3) Locate an event with seats still available
4) Select the ‘Purchase’ link for the corresponding event
5) Review the event description to verify that the correct event has been selected
6) Use the legend provided to distinguish available/unavailable seats located on the
seating chart
7) Double-click any desired, available seats to select them
8) Verify that the details of each selected seat appear in the ‘Shopping Cart’ table
upon selection (Figure 4.7)
9) Select the customer’s name from the list provided, or enter the information of a
new customer
10) Verify that the values in the ‘Number of Selected Seats’ and ‘Total Cost’ fields
correspond with the number of selected seats and cumulative price
respectively
11) Click on the ‘Complete Purchase’ button to reserve the seats.
12) Detailed purchasing records can be viewed by clicking the ‘Customer Info’ button
at the top of the page
21
Figure 4.7 – Purchase Tickets Page Sample
22
5. Technologies Used
5.1. Hosting
GoDaddy.com was used to originally purchase the domain name
‘CheckOutMySeat.com’ and to host the site. They provided the database where all of the
collected data was stored. The server they assigned was a Linux server for which they
provided a one year subscription.
5.3. PHP
The PHP code was responsible for processing and interpreting all of the data that
appeared on the site. It provided the main link between the actors and the information
stored in the database. In fact, everything associated with the database was inserted,
updated, removed, or selected using PHP functions with MySQL commands (Figure 5.2).
23
The code was used in this same way to initialize table values and to handle form data
whenever an actor submitted a deliverable.
5.4. JavaScript
The JavaScript code provided the actors with a more flexible and dynamic
interface. The main incentive for using JavaScript was to help minimize page loading
wherever possible by processing minor changes as ‘events’, such as ‘onclick()’ or
‘onmouseover()’. This way, repeatable tasks like selecting a seat from a seating chart or
updating a background image (Figure 5.3) would not require a page load, reducing the
potential risk of clearing any dynamic data. The majority of the scripts were manually
written, with the exception of the scripts pertaining to the drag-and-drop feature (see
dom-drag.js). This open source code was acquired online
(http://www.dynamicdrive.com/dynamicindex11/domdrag/) and was implemented along
with the written scripts.
24
Figure 5.3 – JavaScript Updating Background Sample (from moreFuncs.js)
5.5. Database
The database served as the main method of storage for all data associated with the
site. Each entry into the database was partitioned into one of seven tables and assigned a
unique identification number based of its respective table. Each table was further
partitioned into a collection of attributes, which represented more specific information
such as a customer’s name and phone number (Figure 5.4 & Figure 5.5). All database
manipulation was done using simple MySQL commands. The commands themselves
were sent as they were received from the user-interface using PHP functions. The
following is a description of the tables used for partition database entries:
• Backgrounds – This table stored the basic data and metadata associated with any
background images uploaded by a designer.
• Charts – This table held all the data pertaining to saved seating charts. Upon
completion, all of the information associated with the newly created seating
chart was record here for later editing or purchasing.
• Customers – This was where a customer’s personal information was stored.
Entries in this were used whenever a returning customer wished to purchase
more seats.
25
• Events – The details on each event posted by an actor was stored in this table. The
table was also responsible for keeping track of seat availability.
• IndivSeats – Similar to the Backgrounds table, this was responsible for collecting
data and metadata associated with the uploaded images used to represent
individual seats.
• Purchases – This table stores a complete history of all seat purchases. Entries are
added upon the completion of each purchase and are never removed.
• SeatCombos – This table stored a list of seat images used to make up a seat
combination. These entries were frequently referenced by the seating charts.
26
(Table ame)
(Unique Identifier) A B
(Attribute 1)
(Attribute 2) “the attributes of A are share with B”
…
…
27
6. Conceptual Models
Each conceptual model represents two forms of interaction: the interaction
between an external actor and the website and the interactions amongst the various
elements that make up the site itself. The actors are directly linked to a set of actions
available to them on the website. The action sets, represented as ovals, have been derived
based on the list of requirements (Section 3) and the use cases (Section 4). Both
conceptual models share three common elements, represented as boxes, all of which were
partially derived from the used technologies (Section 5). The shared elements can be
described as follows:
• Client-Side Interface – This interface allows the actors to navigate through and
select their desired action. No data is processed through this interface. Page
information is received from the server-side, interpreted, and presented to the
actor.
• Server-Side Functions – This collection of functions processes all requests sent by
the actors through the provided interface. It also provides the main link
between the client interface and the database. Once the data has been
interpreted, saved, or collected, it is then forwarded to the client-side interface
where it can be viewed by the actor.
• Database – The database is responsible for actually storing collections of data
received from the server-side functions. It does not perform any specific
actions or operations. All commands to manipulate the database are handled
by the server-side functions.
28
6.1. Designer Model
“Designer”
Create &
Add Background Create Seat Create
Edit Seating
& Seat Images Combinations Events
Charts
Server-Side Client-Side
Database
Functions (PHP) Interface
(JavaScript)
(CheckOutMySeat.com)
29
6.2. Customer Model
Server-Side Client-Side
Database Functions (PHP) Interface
(JavaScript)
Review
View Purchase
Purchasing
Events Tickets
History
(CheckOutMySeat.com)
“Customer”
30
7. Flowcharts
The flowcharts below present the schematic representations of two processes that
are vital aspects of the site. Both were selected from the use cases (see Section 4) and
depict the sequence of decisions made by a typical designer or customer. Individual steps
shown as rectangles. Diamonds represent steps that require a decision, all of which have
either a yes or no answer. The following is a description of each flowchart:
• Seating Chart Creation (Figure 7.1) – This is the most important process for
designers. The flowchart depicts every necessary step to create a seating chart,
from accessing the site to saving the finished product. Many of the steps were
derived from the use case in Section 4.4.
• Ticket Purchasing (Figure 7.2) – This is the main process for customers. It shows
the decision making process a customer must undergo in order to reserve a
desired number of seats for an event. Many of the steps in the chart were
derived from the use case in Section 4.7.
31
7.1. Seating Chart Creation
Select Height NO
Double-Click
Add Seat- YES
Seat
Specific Info?
NO
32
7.2. Ticket Purchasing
Select an Event
NO
NO Enter Address
33
8. Potential Future Enhancements
Due to the limited timeframe provided for this project, many of the features in the
original plans were never implemented. They were not vital to this aspect of the project,
but each would be a nice addition. Attempting to implement these features and others
might provide a future engineering student with a fairly challenging design project.
34
could appear dynamically, there would be no limit to a venue’s capacity. In
order to minimize page refreshing, a script would need to be created that
allows an image to be loaded (and position) through an event tag, such as
‘onclick().’
35
customer’s personal information, record purchasing history, and can be used
for any other features that might make online ticketing a fun experience.
• Venue Profiles: This feature would be a little more unique. Venues could use the
same username and password system (possibly linking multiple logins to one
profile) to protect and store seating charts, events, and other venue-related
information. All editing and removal can be managed using these logins as
well.
From a database perspective, both of these features wouldn’t be too difficult to
implement. Each would require an additional table for storing attributes like a username,
password, and any confidential information. Each entry in these tables could be assigned
a unique identification number, similar how the other tables work (see Section 5.5). The
only thing left to do would be to add this unique id attribute to other tables with
confidential entries, such as seating charts or purchasing history. This would create a
form of ownership and could help to better separate important items.
36
9. Appendix (Source Code)
9.1. css/default.css
body {
margin: 20px;
padding: 0;
background: #FFFFFF;
}
ul.menuOptions li{
font: normal .7em Tahoma, Arial, Helvetica, sans-serif;
color: #666666;
}
h1.mainTitle{
font-size: 26pt;
font-family: Arial;
font-style: normal;
font-weight: bold;
color: #FFFFFF;
}
form {
margin: 0;
padding: 0;
}
h1, h2 {
font-family: Georgia, "Times New Roman", Times, serif;
font-weight: normal;
color: #333333;
font-size: 22pt;
}
p, blockquote, ol, ul {
line-height: 160%;
}
a:hover {
text-decoration: none;
}
/* Boxed */
.boxed {
float: left;
clear: left;
width: 200px;
margin: 0 0 10px 0;
padding: 0;
background: #EFF3F9;
}
37
.boxed .heading {
margin-top: 0;
padding: 8px 15px;
background: #5E80BD url(../images/menu_bg.bmp) repeat-x center
bottom;
text-transform: uppercase;
letter-spacing: 2px;
font: bold 1em Tahoma, Arial, Helvetica, sans-serif;
color: #FFFFFF;
}
.boxed .content {
margin: 0;
padding: 5px 14px 10px 14px;
}
.boxed ul {
margin: 0;
padding: 0;
list-style: none;
line-height: normal;
}
.boxed li {
padding: 3px 0;
border-top: 1px dotted #1F1F21;
}
.boxed li.first {
border: none;
}
.boxed a {
padding-left: 10px;
background: url(../images/img4.gif) no-repeat left center;
text-decoration: none;
}
/* Wrapper */
#wrapper {
width: 800px;
margin: 0 auto;
}
/* Pages */
#pages {
float: left;
width: 800px;
height: 150px;
background-color: RoyalBlue;
}
#pages ul {
38
float: right;
margin: 0;
/*Menu Bar Height*/
padding: 35px 20px 5px 5px;
list-style: none;
line-height: normal;
}
#pages li {
display: inline;
}
#pages a {
background: url(../images/menu_bg.bmp);
padding: 5px 10px 5px 10px;
text-decoration: none;
font: bold 1em Tahoma, Arial, Helvetica, sans-serif;
color: #FFFFFF;
}
#pages a:hover {
text-decoration: underline;
}
/* Content */
#content {
clear: both;
padding-top: 10px;
}
/* Posts */
#posts {
float: right;
width: 560px;
padding-right: 20px;
}
.post {
padding-top: 10px;
}
.post .title {
margin: 0;
font-size: 2em;
}
.post .posted {
margin-top: 0;
font: normal .8em Tahoma, Arial, Helvetica, sans-serif;
color: #999999;
}
.post .meta {
margin: 2em 0 3em 0;
border-top: 1px dotted #939A3C;
39
font: normal .8em Tahoma, Arial, Helvetica, sans-serif;
color: #999999;
}
.post .meta p {
margin: 0;
}
/* Archives */
#archives {
}
/* Search */
#search {
}
#search .content {
padding-bottom: 12px;
}
#textfield1 {
width: 156px;
padding: 5px 5px;
border: 1px solid #000000;
font: bold 1em Tahoma, Arial, Helvetica, sans-serif;
color: #000000;
}
#submit1 {
display: none;
}
/* Footer */
#footer {
clear: both;
border-top: 1px dotted #000000;
font: normal .8em Tahoma, Arial, Helvetica, sans-serif;
color: #999999;
}
#footer a {
color: #999999;
}
40
9.2. css/extra.css
div.extraSeats{
position: relative;
}
div.extraSeats img{
position: absolute;
}
img.backImage{
border: 2px solid Blue;
max-width: 700px;
}
table.chartLayout tr td.chartImg{
width: 520px;
}
table.chartLayout tr td.chartEditList{
width: 200px;
}
h3.seatTableHeader{
color: Black;
text-decoration: underline;
}
div.subTitle{
text-decoration: underline;
font-family: Arial;
color: Navy;
font-size: 18pt;
font-weight: normal;
}
div.createTitle{
text-decoration: underline;
font-family: Arial;
color: Navy;
font-size: 15pt;
font-weight: bold;
}
a.createTitle{
text-decoration: underline;
font-family: Arial;
color: Navy;
font-size: 15pt;
font-weight: bold;
}
div.subPageLinks{
color: Blue;
41
}
div.subPageLinks a{
color: Blue;
}
form.addBack{
padding-top: 10px;
}
table.backMainTable{
padding-left: 20px;
}
img.backImgSample{
vertical-align: middle;
max-width: 500px;
}
table.centerCells tr td{
text-align: center;
}
a.blueLink{
color: Blue;
}
div.eventTitle{
text-decoration: underline;
font-family: Arial;
color: Navy;
font-size: 14pt;
font-weight: bold;
}
table.eventBox{
border: 1px solid black;
width: 600px;
}
table.mainPageTable{
border: 1px solid black;
width: 700px;
}
42
9.3. index.php
<?php
include 'top.php';
include 'funcs.php';
$sString = "";
$sString = saveDiv($sString);
mysql_close($db);
}
?>
<div style="padding-left:20px;">
<h2>Welcome to CheckOutMySeat.com!</h2>
<table class='mainPageTable'>
<tr><td>
<div><a href='createMap.php'
class='createTitle'>Create a New Seating Chart</a></div>
<p class='mainPageBlurb'>- Create a customized
seating chart using uploaded background and seat images. The
interactive charts can be attached to events, allowing customers to
select their seats directly from the map.</p>
<br/>
</td></tr>
<tr><td>
<div><a href='events.php' class='createTitle'>Setup
and Manage Events</a></div>
<p class='mainPageBlurb'>- Post events using pre-
created seating charts. Once an event has been posted, customers will
be able to view and purchase available seats.</p>
<br/>
</td></tr>
<tr><td>
<div><a href='purchase.php'
class='createTitle'>Purchase Tickets</a></div>
<p class='mainPageBlurb'>- Customers can purchase
tickets to posted events using the provided seating chart. Each event
provides information on seating availability, including a visual
display showing which seats are currently available or unavailable.
Customers can also record and save their personal information for
future purchases. </p>
<br/>
</td></tr>
<tr><td>
<div><a href='editImgs.php'
class='createTitle'>Upload and Manage Background/Seat Images</a></div>
<p class='mainPageBlurb'>- Customize your seating
chart by uploading your own background and seat images. Multiple seat
images can be arranged into a custom collection representing the images
used for available, active, and unavailable seats.</p>
<br/>
</td></tr>
<tr><td>
43
<div><a href='records.php'
class='createTitle'>Review Customer Data and Purchases</a></div>
<p class='mainPageBlurb'>- After every purchase,
the customer's personal information is stored for use in later
purchases. Each individual transaction is also recorded after a
purchase, allowing customers and venues to review purchasing
history.</p>
<br/>
</td></tr>
</table>
</div>
<?php
include 'bot.php';
?>
44
9.4. top.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>CheckOutMySeat.com</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="css/default.css" rel="stylesheet" type="text/css" />
<link href="css/extra.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="dom-drag.js"></script>
<script type="text/javascript" src="moreFuncs.js"></script>
<script language="JavaScript">
</script>
</head>
<body>
<div id="wrapper">
<!--<div id="header">
<h1><a href="#">(symbol)</a></h1>
<h2><a href="#">of some type</a></h2>
</div>-->
<div id="pages">
<h1 class='mainTitle'>CheckOutMySeat.com</h1>
<ul class='menuOptions'>
<li class="active"><a id="page1"
href="index.php">Home</a></li>
<li><a id="page2" href="createMap.php">Create
Chart</a></li>
<li><a id="page3" href="events.php">Manage
Events</a></li>
<li><a id="page4" href="editMaps.php">Manage
Charts</a></li>
<li><a id="page5" href="editImgs.php">Manage
Images</a></li>
<li><a id="page6" href="purchase.php">Purchase
Tickets</a></li>
<li><a id="page7" href="records.php">Customer
Info</a></li>
</ul>
</div>
<div id="content">
45
9.5. bot.php
<br/><br/><br/><br/>
<div id="footer">
<p>Copyright © 2008 CheckOutMySeat.com, Designed by
Matt Lanham</p>
</div>
</div>
</body>
</html>
46
9.6. createMap.php
<?php
include 'top.php';
include 'funcs.php';
$sImages = "";
$sImageIds = "";
$iCount = 530;
$sResultingMap = "";
$sBackName = "images/output.jpg";
$sCurrentBack = "images/Grey/100100Grey.jpg";
$sChartName;
$sCurrentSeat = "images/test_seat.jpg";
$sCurActSeat = "images/active_seat.jpg";
$iDefCombo;
$sSec = "";
$sRow = "";
$sSeat = "";
$sPrice = "";
$sValid = "";
$sSeatFiles = "";
$sSep = "*";
$sSeatComboList = "";
$sBackList = "";
$result = getSeatCombos();
while($row = mysql_fetch_array($result)){
$rRes = getSeats($row['DefSeat']);
$aDef = mysql_fetch_array($rRes);
$rRes = getSeats($row['ActSeat']);
$aAct = mysql_fetch_array($rRes);
$rRes = getSeats($row['TakSeat']);
$aTak = mysql_fetch_array($rRes);
$sSeatComboList .= "<option value='".$row['ComboId']."'
onclick='updateCurrentCombo(".$row['ComboId'].",
\"seats/".$aDef['FileName']."\", \"seats/".$aAct['FileName']."\",
\"seats/".$aTak['FileName']."\")'>".$row['Name']."</option>";
}
$result = getSeatCombos();
$row = mysql_fetch_array($result);
$iDefCombo = $row['ComboId'];
$rRes = getSeats($row['DefSeat']);
$aDef = mysql_fetch_array($rRes);
$rRes = getSeats($row['ActSeat']);
$aAct = mysql_fetch_array($rRes);
$rRes = getSeats($row['TakSeat']);
$aTak = mysql_fetch_array($rRes);
$sCurrentSeat = "seats/".$aDef['FileName'];
$sCurActSeat = "seats/".$aAct['FileName'];
$sCurTakSeat = "seats/".$aTak['FileName'];
$result = getBackgrounds();
while($row = mysql_fetch_array($result)){
47
$sBackList .= "<option value='".$row['BackId']."'
onclick='updateCreateBack(\"backs/".$row['FileName']."\")'>".$row['Name
']."</option>";
}
if(isset($_POST['x_coords'])){
$sCurrentBack = $_POST['imagePath'];
createNewBackground($sCurrentBack, $_POST['x_coords'],
$_POST['y_coords'], $_POST['actualSeatCount'], $sBackName,
$sCurrentBack);
$sChartName = $_POST['mapName'];
if($sChartName == ""){
$sChartName = "null";
}
48
<table>
<tr>
<td>- Available: </td><td><img id='sampleDef'
src='<?php echo $sCurrentSeat;?>' alt='Available'></td>
</tr>
<tr>
<td>- Selected: </td><td><img id='sampleAct' src='<?php
echo $sCurActSeat;?>' alt='Selected'></td>
</tr>
<tr>
<td>- Unavailable: </td><td><img id='sampleTak'
src='<?php echo $sCurTakSeat;?>' alt='Unavailable'></td>
</tr>
</table>
<br/>
<div class='createTitle'>Background Selection</div>
<div>Select a background image for the seating chart.
There are 3 options:</div>
<form name="backgroundForm" method="post">
<div>1) Create a Simple Image - Color:<select
name='backColor'>
<option value="Grey" <?php echo
($_POST['backColor'] == "Grey")?"selected =
selected'":"";?>>Grey</option>
<option value="Black" <?php echo
($_POST['backColor'] == "Black")?"selected =
selected'":"";?>>Black</option>
<option value="White" <?php echo
($_POST['backColor'] == "White")?"selected =
selected'":"";?>>White</option>
<!--<option value="Red" <?php echo
($_POST['backColor'] == "Red")?"selected =
selected'":"";?>>Red</option>
<option value="Blue" <?php echo
($_POST['backColor'] == "Blue")?"selected =
selected'":"";?>>Blue</option>
<option value="Green" <?php echo
($_POST['backColor'] == "Green")?"selected =
selected'":"";?>>Green</option>
<option value="Yellow" <?php echo
($_POST['backColor'] == "Yellow")?"selected =
selected'":"";?>>Yellow</option>-->
</select>
Width (px): <select name='backWidth'>
<option value="100" <?php echo
($_POST['backWidth'] == 100)?"selected = selected'":"";?>>100</option>
<option value="200" <?php echo
($_POST['backWidth'] == 200)?"selected = selected'":"";?>>200</option>
<option value="300" <?php echo
($_POST['backWidth'] == 300)?"selected = selected'":"";?>>300</option>
<option value="400" <?php echo
($_POST['backWidth'] == 400)?"selected = selected'":"";?>>400</option>
<option value="500" <?php echo
($_POST['backWidth'] == 500)?"selected = selected'":"";?>>500</option>
</select>
Height (px): <select name='backHeight'>
49
<option value="100" <?php echo
($_POST['backHeight'] == 100)?"selected = selected'":"";?>>100</option>
<option value="200" <?php echo
($_POST['backHeight'] == 200)?"selected = selected'":"";?>>200</option>
<option value="300" <?php echo
($_POST['backHeight'] == 300)?"selected = selected'":"";?>>300</option>
<option value="400" <?php echo
($_POST['backHeight'] == 400)?"selected = selected'":"";?>>400</option>
<option value="500" <?php echo
($_POST['backHeight'] == 500)?"selected = selected'":"";?>>500</option>
</select>
<input type='button' onclick="switchBack();"
value='Create Backgound'>
</form>
</div>
<div>2) Select a Previously Uploaded Image: <select>
<?php echo $sBackList;?>
</select></div>
<div>3) Upload Your Own Image at the <a class="blueLink"
href="editImgs.php">Manage Images Page</a>.</div>
<br/>
<div class='createTitle'>Set Chart Name</div>
<div>Name: <input id='nameInput' type="text" value=""
maxlength="255" onblur='updateName();'></div>
<br/>
50
<td><input type='checkbox'
id='checkSec' value='showSec' onclick='checkboxActions("checkSec");'
checked></td><td>Section: </td><td><input id='secField' type="text"
onblur='updateSeatLists("secField", 0);' maxlength="255"></td>
</tr><tr>
<td><input type='checkbox'
id='checkRow' value='showRow' onclick='checkboxActions("checkRow");'
checked></td><td>Row: </td><td><input id='rowField' type="text"
onblur='updateSeatLists("rowField", 0);' maxlength="255"></td>
</tr><tr>
<td><input type='checkbox'
id='checkSeatId' value='showSeatId'
onclick='checkboxActions("checkSeatId");' checked></td><td>Seat ID:
</td><td><input id='seatIdField' type="text"
onblur='updateSeatLists("seatIdField", 0);' maxlength="255"></td>
</tr><tr>
<td><input type='checkbox'
id='checkPrice' value='showPrice'
onclick='checkboxActions("checkPrice");' checked></td><td>Price:
$</td><td><input id='priceField' type="text"
onblur='updateSeatLists("priceField", 0);' maxlength="255"></td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
<br/><br/><br/>
51
<input type="hidden" name="seatList" value="<?php
echo $sSeat;?>">
<input type="hidden" name="seatCheckList"
value="<?php echo $sValid;?>">
<input type="hidden" name="priceList" value="<?php
echo $sPrice;?>">
<input type="hidden" name="priceCheckList"
value="<?php echo $sValid;?>">
</div>
<?php
include 'bot.php';
?>
52
9.7. editImgs.php
<?php
include 'top.php';
include 'funcs.php';
$sBlurb = "";
$sLinkB1 = "<a href='editImgs.php?mode=vsb'>- View Saved
Backgrounds</a>";
$sLinkB2 = "<a href='editImgs.php?mode=anb'>- Add New Background</a>";
$sLinkS1 = "<a href='editImgs.php?mode=vssi'>- View Saved Seat
Images</a>";
$sLinkS2 = "<a href='editImgs.php?mode=vssc'>- View Saved Seat
Combinations</a>";
$sLinkS3 = "<a href='editImgs.php?mode=ans'>- Add New Seat</a>";
$sLinkS4 = "<a href='editImgs.php?mode=cnsc'>- Create New Seat
Combination</a>";
$sDispVSB = "style='display:none;'";
$sDispANB = "style='display:none;'";
$sDispVSSI = "style='display:none;'";
$sDispVSSC = "style='display:none;'";
$sDispANS = "style='display:none;'";
$sDispCNSC = "style='display:none;'";
$sBackTableRows = "";
$sSeatTableRows = "";
$sSeatComboTableRows = "";
$sDefSeatList = "";
$sActSeatList = "";
$sTakSeatList = "";
if(isset($_FILES['backImg'])){
$sMapName = trim($_POST['backName']);
if ($_FILES["backImg"]["error"] > 0)
{
echo "Error: File did not load successfully.<br />";
}
else if($sMapName == ""){
echo "Error: Must enter a name for background.<br />";
}
else if(($_FILES["backImg"]["type"] !=
"image/gif")&&($_FILES["backImg"]["type"] !=
"image/jpeg")&&($_FILES["backImg"]["type"] != "image/bmp")){
echo "Error: Uploaded file must be an image file. <br />";
}
else if(checkBackName($_POST["backName"])){
echo "Error: File name '".$_POST["backName"]."' is already in
use. <br />";
}
else{
move_uploaded_file($_FILES['backImg']['tmp_name'],
"backs/".$_POST["backName"].$_FILES['backImg']['name']);
saveNewBackground($sMapName, $_FILES["backImg"]);
53
}
}
if(isset($_FILES['seatImg'])){
$sMapName = trim($_POST['seatName']);
if ($_FILES["seatImg"]["error"] > 0)
{
echo "Error: File did not load successfully.<br />";
}
else if($sMapName == ""){
echo "Error: Must enter a name for the seat.<br />";
}
else if(($_FILES["seatImg"]["type"] !=
"image/gif")&&($_FILES["seatImg"]["type"] !=
"image/jpeg")&&($_FILES["seatImg"]["type"] != "image/bmp")){
echo "Error: Uploaded file must be an image file. <br />";
}
else if(checkSeatName($_POST["seatName"])){
echo "Error: File name '".$_POST["seatName"]."' is already in
use. <br />";
}
else{
move_uploaded_file($_FILES['seatImg']['tmp_name'],
"seats/".$_POST["seatName"].$_FILES['seatImg']['name']);
saveNewSeat($sMapName, $_FILES["seatImg"]);
}
}
if(isset($_POST["seatComboName"])){
saveSeatCombo($_POST["seatComboName"], $_POST["selDefaultSeat"],
$_POST["selActiveSeat"], $_POST["selTakenSeat"]);
}
if((isset($_GET['mode']))&&($_GET['mode']=="vsb")){
$sLinkB1 = "<b>- View Saved Backgrounds</b>";
$sDispVSB = "";
$sBlurb = "";
$result = getBackgrounds();
while($row = mysql_fetch_array($result)){
$sBackTableRows .= "<tr><td
onclick='setSampleImg(\"backs/".$row['FileName']."\",
\"".$row['Name']."\",
\"backImgSample\")'>".$row['Name']."</td><td>".$row['Size']."Kb</td><td
>".$row['CreatedDate']."</td><td><a
href='editImgs.php?mode=vsb&delB=".$row['BackId']."'>Delete</a></td></t
r>";
}
}
else if((isset($_GET['mode']))&&($_GET['mode']=="anb")){
$sLinkB2 = "<b>- Add New Background</b>";
$sDispANB = "";
}
else if((isset($_GET['mode']))&&($_GET['mode']=="vssi")){
54
$sLinkS1 = "<b>- View Saved Seat Images</b>";
$sDispVSSI = "";
$result = getSeats();
while($row = mysql_fetch_array($result)){
$sSeatTableRows .= "<tr><td
onclick='setSampleImg(\"seats/".$row['FileName']."\",
\"".$row['Name']."\",
\"seatImgSample\")'>".$row['Name']."</td><td>".$row['Size']."Kb</td><td
>".$row['CreatedDate']."</td><td><a
href='editImgs.php?mode=vssi&delS=".$row['SeatId']."'>Delete</a></td></
tr>";
}
}
else if((isset($_GET['mode']))&&($_GET['mode']=="vssc")){
$sLinkS2 = "<b>- View Saved Seat Combinations</b>";
$sDispVSSC = "";
$result = getSeatCombos();
while($row = mysql_fetch_array($result)){
$rRes1 = getSeats($row['DefSeat']);
$aDef = mysql_fetch_array($rRes1);
$rRes2 = getSeats($row['ActSeat']);
$aAct = mysql_fetch_array($rRes2);
$rRes3 = getSeats($row['TakSeat']);
$aTak = mysql_fetch_array($rRes3);
$sSeatComboTableRows .=
"<tr><td>".$row['Name']."</td><td>".$row['CreatedDate']."</td><td>".$aD
ef['Name']."</td><td>".$aAct['Name']."</td><td>".$aTak['Name']."</td><t
d><a
href='editImgs.php?mode=vssc&delC=".$row['ComboId']."'>Delete</a></td><
/tr>";
}
}
else if((isset($_GET['mode']))&&($_GET['mode']=="ans")){
$sLinkS3 = "<b>- Add New Seat</b>";
$sDispANS = "";
}
else if((isset($_GET['mode']))&&($_GET['mode']=="cnsc")){
$sLinkS4 = "<b>- Create New Seat Combination</b>";
$sDispCNSC = "";
$result = getSeats();
while($row = mysql_fetch_array($result)){
$sDefSeatList .= "<option value='".$row['SeatId']."'
onclick='setSampleImg(\"seats/".$row['FileName']."\",
\"".$row['Name']."\", \"dfltSeatSample\")'>".$row['Name']."</option>";
$sActSeatList .= "<option value='".$row['SeatId']."'
onclick='setSampleImg(\"seats/".$row['FileName']."\",
\"".$row['Name']."\", \"activeSeatSample\")'>".$row['Name']."</option>";
$sTakSeatList .= "<option value='".$row['SeatId']."'
onclick='setSampleImg(\"seats/".$row['FileName']."\",
\"".$row['Name']."\", \"tknSeatSample\")'>".$row['Name']."</option>";
}
}
?>
55
<div style="padding-left:20px;">
<h2>Edit Images</h2>
<table border="0">
<tr>
<td style="vertical-align: top;">
<div class='createTitle' id="bMenu">Backgrounds</div>
<div class='subPageLinks' style="width:200px;"><?php
echo $sLinkB1;?></div>
<div class='subPageLinks'><?php echo
$sLinkB2;?></div>
</td>
<td style="width:40px;"></td>
<td>
<div class='createTitle' id="sMenu">Seats</div>
<div class='subPageLinks'><?php echo
$sLinkS1;?></div>
<div class='subPageLinks'><?php echo
$sLinkS2;?></div>
<div class='subPageLinks'><?php echo
$sLinkS3;?></div>
<div class='subPageLinks'><?php echo
$sLinkS4;?></div>
</td>
</tr>
</table>
<br/>
56
<tr>
<td>Background Image:</td><td><input name='backImg'
type="file" size="30"></td>
</tr>
<tr>
<td></td><td align="right"><input type="submit"
value='Add Background'></td>
</tr>
</table>
</form>
57
<tr>
<td></td><td align="right"><input type="submit"
value='Add Seat'></td>
</tr>
</table>
</form>
</div>
<br/><br/>
<?php
include 'bot.php';
?>
58
9.8. editMaps.php
<?php
include 'top.php';
include 'funcs.php';
$sEditRows = "";
$sTitle = "";
$sBackName = "images/output.jpg";
$sMap = "";
$sMapImg = "";
$sCurrentSeat = "";
$sCurActSeat = "";
$sSec = "";
$sSecValid = "";
$sRow = "";
$sRowValid = "";
$sSeat = "";
$sseatValid = "";
$sPrice = "";
$sPriceValid = "";
$sSeatFiles = "";
$sSeatImgs = "";
$sIdList = "";
$iCount = 0;
$sNewName = "";
$sDis = "style='display:none;'";
$iCurID = 0;
if (isset($_GET['divID'])) {
if(isset($_POST['actualSeatCount'])){
updateInfo($_GET['divID'], $_POST['mapName'], $_POST['secList'],
$_POST['secCheckList'], $_POST['rowList'], $_POST['rowCheckList'],
$_POST['seatList'], $_POST['seatCheckList'], $_POST['priceList'],
$_POST['priceCheckList']);
}
$result = showDiv($_GET['divID']);
$row = mysql_fetch_array($result);
$sTitle = $row["ChartName"];
$sNewName = $row["ChartName"];
$rTemp = getSeatCombos($row['ComboId']);
$aStuff = mysql_fetch_array($rTemp);
$rRes = getSeats($aStuff['DefSeat']);
$aDef = mysql_fetch_array($rRes);
$rRes = getSeats($aStuff['ActSeat']);
$aAct = mysql_fetch_array($rRes);
$sCurrentSeat = "seats/".$aDef['FileName'];
$sCurActSeat = "seats/".$aAct['FileName'];
59
$aIds = explode(".", $row['SeatIds']);
$aXcor = explode(".", $row['X_Coords']);
$aYcor = explode(".", $row['Y_Coords']);
$iCount = $row['SeatCount'];
$sDis = "";
$iCurID = $_GET['divID'];
if($aXcor[$i] != 0){
$sSeatImgs .= "<img id='".$aIds[$i]."' class='".$aIds[$i]."'
onmouseout='clearSeatInfo(1);'
onmouseover='displaySeatInfo(\"".$aIds[$i]."\", 1)'
ondblclick='SetActiveSeat(\"".$aIds[$i]."\", 1);'
src='".$sCurrentSeat."'>
<style type='text/css'>
img.".$aIds[$i]."{position:relative; top:".$aYcor[$i]."px;
left:".$aXcor[$i]."px; } </style>";
}
}
$result = showDiv();
while($row = mysql_fetch_array($result)){
$iTally = 0;
$aXcor = explode(".", $row['X_Coords']);
for($i=0; $i<$row['SeatCount']; $i++){
if($aXcor[$i] != 0){
$iTally++;
}
}
$sChartName = $row['ChartName'];
if(($sChartName == null)||($sChartName == "")) $sChartName =
"Image #".$row['MapId'];
$sEditRows .=
"<tr><td>".$sChartName."</td><td>".$iTally."</td><td>".$row['CreatedDat
e']."</td><td><a class='blueLink'
href='editMaps.php?divID=".$row['MapId']."'>Edit</a></td></tr>";
}
?>
60
<div style="padding-left:20px;">
<h2>Edit/Remove Charts</h2><br/>
<br/>
<div class='createTitle'><?php echo $sTitle;?></div>
<div style="display:none;" id='activeSeatId'></div>
<table class='chartLayout'>
<tr>
<td class='chartImg'>
<div <?php echo $sDis;?>>Chart Name: <input
id='nameInput' type="text" value="<?php echo $sNewName;?>"
maxlength="255" onblur='updateName();'></div>
<div class='extraSeats'><?php echo
$sSeatImgs;?></div>
<div><?php echo $sMapBack;?></div>
<input id='expressInfo1' type='text' size='100'
Readonly value='' style='border-width: 0px; font-size: 8pt;'>
<br/>
</td>
<td class='chartEditList' align='right'>
<div id='seatEditList' style="display:none;">
<form>
<table>
<tr>
<td><input type='checkbox'
id='checkSec' value='showSec' onclick='checkboxActions("checkSec");'
checked></td><td>Section: </td><td><input id='secField' type="text"
onblur='updateSeatLists("secField", 1);' maxlength="255"></td>
</tr><tr>
<td><input type='checkbox'
id='checkRow' value='showRow' onclick='checkboxActions("checkRow");'
checked></td><td>Row: </td><td><input id='rowField' type="text"
onblur='updateSeatLists("rowField", 1);' maxlength="255"></td>
</tr><tr>
<td><input type='checkbox'
id='checkSeatId' value='showSeatId'
onclick='checkboxActions("checkSeatId");' checked></td><td>Seat ID:
</td><td><input id='seatIdField' type="text"
onblur='updateSeatLists("seatIdField", 1);' maxlength="255"></td>
</tr><tr>
<td><input type='checkbox'
id='checkPrice' value='showPrice'
onclick='checkboxActions("checkPrice");' checked></td><td>Price:
$</td><td><input id='priceField' type="text"
onblur='updateSeatLists("priceField", 1);' maxlength="255"></td>
61
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
<?php
include 'bot.php';
?>
62
9.9. events.php
<?php
include 'top.php';
include 'funcs.php';
$sDispVSE = "style='display:none;'";
$sDispCAE = "style='display:none;'";
$sDispERE = "style='display:none;'";
$sPrintEvents = "";
$sMapList = "";
$sMonthList = "";
$sDayList = "";
$sYearList = "";
$sHourList = "";
$sMinList = "";
$i;
$result = showDiv();
63
while($row = mysql_fetch_array($result)){
$sChartName = $row['ChartName'];
if(($sChartName == null)||($sChartName == "")) $sChartName =
"Image #".$row['MapId'];
$sMapList .= "<option
value='".$row['MapId']."'>".$sChartName."</option>";
}
if(isset($_POST['eventName'])&&(trim($_POST['eventName']) != "")){
$result = showDiv($_POST['selSeatChart']);
$row = mysql_fetch_array($result);
$sSeatAvail = "";
$aXcor = explode(".", $row['X_Coords']);
$iCapacity = 0;
for($i=0; $i<$row['SeatCount']; $i++){
if($aXcor[$i] != 0){
$iCapacity++;
}
$sSeatAvail .= "0.";
}
saveEvent($_POST['eventName'], $_POST['selSeatChart'],
trim($_POST['eventLoc']), ($_POST['selHour'].":".$_POST['selMin']."
".$_POST['selAmPm']), ($_POST['selMonth']."-".$_POST['selDay']."-
".$_POST['selYear']), $sSeatAvail, $iCapacity,
trim($_POST['eventBlurb']));
}
if((isset($_GET['mode']))&&($_GET['mode']=="cae")){
$sLinkE2 = "<b>- Create an Event</b>";
$sDispCAE = "";
}
else if((isset($_GET['mode']))&&($_GET['mode']=="ere")){
$sLinkE3 = "<b>- Edit/Remove Events</b>";
$sDispERE = "";
}
else{
$sLinkE1 = "<b>- View Events</b>";
$sDispVSE = "";
$result = getEvents();
while($row = mysql_fetch_array($result)){
$sPrintEvents .= "<table class='eventBox'><tr><td><div
class='eventTitle'>".$row['Name']."</div>
<table border='0'>
<tr>
<td><u>Location:</u> ".$row['Location']."</td>
<td style='width:30px;'></td>
<td><u>Date:</u> ".$row['Date']."</td>
</tr>
<tr>
<td><u>Available Seats:</u> ".$row['CurCap']."</td>
<td></td>
64
<td><u>Time:</u> ".$row['Time']."</td>
</tr>
</table>
<div><p><u>Description:</u> ".$row['Blurb']."</p></div>
<div><a class='blueLink'
href='purchase.php?evnt=".$row['EventId']."'>Purchase Tickets to this
Event</a></div>
<div><a class='blueLink'
href='events.php?delE=".$row['EventId']."'>Remove this Event</a></div>
<br/></td></tr></table>
";
}
}
?>
65
<td>
<select id='selHour' name='selHour'>
<?php echo $sHourList;?>
</select>:
<select id='selMin' name='selMin'>
<?php echo $sMinList;?>
</select>
<select id='selAmPm' name='selAmPm'>
<option value='AM'>AM</option><option
value='PM'>PM</option>
</select>
</td>
</tr>
<tr>
<td style='vertical-align:top'>Event Summary
(optional):</td><td><textarea name='eventBlurb' Cols=30
Rows=6></textarea></td>
</tr>
<tr>
<td></td><td align="right"><input type="submit"
value='Create Event'></td>
</tr>
</table>
</form>
</div>
<br/><br/>
<?php
include 'bot.php';
?>
66
9.10. funcs.php
<?php
function saveDiv($sString){
$db = mysql_connect("10.6.166.113", "ThisLanham",
"Broncos7");
if (!$db) {
die('Could not connect(saveMap): ' . mysql_error());
}
mysql_select_db("ThisLanham", $db);
mysql_close($db);
return stripslashes($row[1]);
}
if($iDivId == 0){
$sQuery = "SELECT * FROM Charts ORDER BY MapId ASC;";
$result = mysql_query($sQuery, $db);
mysql_close($db);
return $result;
}
mysql_close($db);
return $result;
}
$i;
67
}
$rBackImg = imagecreatefromjpeg($sOldBack);
$rSeatImg = imagecreatefromjpeg("images/test_seat.jpg");
$iW = imagesx($rSeatImg);
$iH = imagesy($rSeatImg);
$aX = explode(".", $sXCoords);
$aY = explode(".", $sYCoords);
imagejpeg($rBackImg, $sOutName);
}
$rColor;
$rBackImg = imagecreatetruecolor($iWidth, $iHeight);
$sOut = "images/img".$iHeight.$iWidth.$sColor.".jpeg";
switch ($sColor){
case "Black": $rColor = imagecolorallocate($rBackImg,
0, 0, 0); break;
case "White": $rColor = imagecolorallocate($rBackImg,
255, 255, 255); break;
case "Red": $rColor = imagecolorallocate($rBackImg,
255, 0, 0); break;
case "Blue": $rColor = imagecolorallocate($rBackImg,
0, 0, 255); break;
case "Green": $rColor = imagecolorallocate($rBackImg,
0, 255, 0); break;
case "Yellow": $rColor = imagecolorallocate($rBackImg,
255, 255, 0); break;
default: $rColor = imagecolorallocate($rBackImg, 192,
192, 192); //Grey
}
68
$db = mysql_connect("10.6.166.113", "ThisLanham",
"Broncos7");
if (!$db) {
die('Could not connect(saveAllData): '.mysql_error());
}
mysql_select_db("ThisLanham", $db);
$sPrintName = "'".$sName."'";
if($sName == "null") $sPrintName = "null";
mysql_close($db);
return;
}
$sPrintName = "'".$sName."'";
if(($sName == "null")||($sName == "")) $sPrintName = "null";
mysql_close($db);
return;
}
function deleteMap($iID){
69
echo mysql_error();
mysql_close($db);
return;
}
function checkBackName($sName){
mysql_close($db);
$iValue = mysql_num_rows($result);
if($iValue == 0) return 0;
return 1;
}
function checkSeatName($sName){
mysql_close($db);
$iValue = mysql_num_rows($result);
if($iValue == 0) return 0;
return 1;
}
70
}
mysql_select_db("ThisLanham", $db);
mysql_close($db);
return;
}
mysql_close($db);
return;
}
mysql_close($db);
return;
}
71
}
mysql_select_db("ThisLanham", $db);
if($iID == 0){
$sQuery = "SELECT * FROM Backgrounds ORDER BY BackId
ASC;";
$result = mysql_query($sQuery, $db);
mysql_close($db);
return $result;
}
mysql_close($db);
return $result;
}
if($iID == 0){
$sQuery = "SELECT * FROM IndivSeats ORDER BY SeatId
ASC;";
$result = mysql_query($sQuery, $db);
echo mysql_error();
mysql_close($db);
return $result;
}
mysql_close($db);
return $result;
}
72
if($iID == 0){
$sQuery = "SELECT * FROM SeatCombos ORDER BY ComboId
ASC;";
$result = mysql_query($sQuery, $db);
echo mysql_error();
mysql_close($db);
return $result;
}
mysql_close($db);
return $result;
}
function deleteBackground($iID){
mysql_close($db);
return;
}
function deleteSeat($iID){
mysql_close($db);
return;
}
function deleteSeatCombo($iID){
73
$db = mysql_connect("10.6.166.113", "ThisLanham",
"Broncos7");
if (!$db) {
die('Could not connect(deleteSeatCombo):
'.mysql_error());
}
mysql_select_db("ThisLanham", $db);
mysql_close($db);
return;
}
function getComboImages($iID){
$rTemp = getSeatCombos($row['ComboId']);
$aStuff = mysql_fetch_array($rTemp);
$rRes = getSeats($aStuff['DefSeat']);
$aDef = mysql_fetch_array($rRes);
$rRes = getSeats($aStuff['ActSeat']);
$aAct = mysql_fetch_array($rRes);
$rRes = getSeats($aStuff['TakSeat']);
$aTak = mysql_fetch_array($rRes);
$sCurrentSeat = "seats/".$aDef['FileName'];
$sCurActSeat = "seats/".$aAct['FileName'];
$aOut = array(
"DefSeat" => "seats/".$aDef['FileName'],
"ActSeat" => "seats/".$aAct['FileName'],
"TakSeat" => "seats/".$aTak['FileName']);
return $aOut;
}
mysql_close($db);
return;
}
74
$db = mysql_connect("10.6.166.113", "ThisLanham",
"Broncos7");
if (!$db) {
die('Could not connect(getEvents): '.mysql_error());
}
mysql_select_db("ThisLanham", $db);
if($iID == 0){
$sQuery = "SELECT * FROM Events ORDER BY EventId
ASC;";
$result = mysql_query($sQuery, $db);
echo mysql_error();
mysql_close($db);
return $result;
}
mysql_close($db);
return $result;
}
function deleteEvent($iID){
mysql_close($db);
return;
}
75
echo mysql_error();
mysql_close($db);
return;
if($iID == 0){
$sQuery = "SELECT * FROM Customers ORDER BY CustId
ASC;";
$result = mysql_query($sQuery, $db);
echo mysql_error();
mysql_close($db);
return $result;
}
mysql_close($db);
return $result;
}
76
$row = mysql_fetch_array($result);
mysql_close($db);
return $row['CustId'];
}
if(!is_numeric($iPrice)) $iPrice = 0;
mysql_close($db);
return;
}
if($iID == 0){
$sQuery = "SELECT * FROM Purchases ORDER BY PurId
ASC;";
$result = mysql_query($sQuery, $db);
echo mysql_error();
mysql_close($db);
return $result;
}
mysql_close($db);
return $result;
}
function getUsersEventRecords($iID){
77
$db = mysql_connect("10.6.166.113", "ThisLanham",
"Broncos7");
if (!$db) {
die('Could not connect(getUsersEventRecords):
'.mysql_error());
}
mysql_select_db("ThisLanham", $db);
mysql_close($db);
return $result;
}
echo mysql_error();
$aCost = mysql_fetch_array($result);
mysql_close($db);
return $aCost[0];
}
mysql_close($db);
78
return $result;
}
?>
79
9.11. purchase.php
<?php
include 'top.php';
include 'funcs.php';
$sEventTable = "";
$sPrintEvent = "";
$sBackImg = "";
$sSeatImgs = "";
$sOldCustomers = "";
$sDis = "style='display:none;'";
$sExpMonths = "";
$sExpYears = "";
$sTable = "";
$sPossibleSeats = "";
$sPossibleSecs = "";
$sPossibleRows = "";
$sPossibleSIds = "";
$sPossiblePrices = "";
$sBuyMapId = "";
$sBuyEvntId = "";
if(isset($_GET['evnt'])){
$result = getEvents($_GET['evnt']);
$row = mysql_fetch_array($result);
$sBuyEvntId = $_GET['evnt'];
$sDis = "";
$sBuyMapId = $row['MapId'];
$rTemp = showDiv($row['MapId']);
$aMap = mysql_fetch_array($rTemp);
$sBackImg = "<img class='backImage' id='buyBackImage'
src='".$aMap['BackName']."'>";
$sSec = $aMap['Section'];
$sSecValid = $aMap['Sectionstatus'];
$sRow = $aMap['Row'];
80
$sRowValid = $aMap['RowStatus'];
$sSeat = $aMap['SeatId'];
$sseatValid = $aMap['SeatIdStatus'];
$sPrice = $aMap['Price'];
$sPriceValid = $aMap['PriceStatus'];
$sIdList = $aMap['SeatIds'];
$rTemp = getSeatCombos($aMap['ComboId']);
$aCombo = mysql_fetch_array($rTemp);
$rRes = getSeats($aCombo['DefSeat']);
$aDef = mysql_fetch_array($rRes);
$rRes = getSeats($aCombo['ActSeat']);
$aAct = mysql_fetch_array($rRes);
$rRes = getSeats($aCombo['TakSeat']);
$aTak = mysql_fetch_array($rRes);
$sCurrentSeat = "seats/".$aDef['FileName'];
$sCurActSeat = "seats/".$aAct['FileName'];
$sCurTakSeat = "seats/".$aTak['FileName'];
$result = getCustomers();
while($aCList = mysql_fetch_array($result)){
$sOldCustomers .= "<option value='".$aCList['CustId']."'
onclick='hideTable(\"infoEntryTable\", 1)'>".$aCList['FName']."
".$aCList['LName']."</option>";
}
81
$sExpMonths .= "<option value='01'>01</option><option
value='02'>02</option><option value='03'>03</option><option
value='04'>04</option>";
$sExpMonths .= "<option value='05'>05</option><option
value='06'>06</option><option value='07'>07</option><option
value='08'>08</option>";
$sExpMonths .= "<option value='09'>09</option><option
value='10'>10</option><option value='11'>11</option><option
value='12'>12</option>";
for($i=2008; $i<2030; $i++){
$sExpYears .= "<option value='".$i."'>".$i."</option>";
}
$sTable = "<h3 id='seatTableHeader'>Shopping Cart:</h3>
<table id='seatTable' class='centerCells' border='1'>
<tr><th>Section</th><th>Row</th><th>Seat
ID</th><th>Price</th></tr>
";
$sTable .= "
</table>";
}
if(isset($_POST['customerStatus'])){
if((trim($_POST['fName']) == "")&&(trim($_POST['lName']) ==
"")&&($_POST['customerStatus'] == "0")){
echo "Could not process order: You mst enter a name.<br/>";
}
else{
$iBuyerId = "0";
if($_POST['customerStatus'] == "0"){
$iBuyerId = saveCustomer(trim($_POST['fName']),
trim($_POST['lName']), trim($_POST['email']), trim($_POST['street']),
trim($_POST['city']), trim($_POST['state']), trim($_POST['zip']),
trim($_POST['phone']), trim($_POST['cardType']),
trim($_POST['cardNum']), ($_POST['expMonth']."/".$_POST['expYear']));
}
else{
$iBuyerId = $_POST['customerStatus'];
}
82
$aTempSeatList = explode("*", $_POST['buySeatIds']);
$aTempSecList = explode("*", $_POST['buySecs']);
$aTempRowList = explode("*", $_POST['buyRows']);
$aTempSIdList = explode("*", $_POST['buySIds']);
$aTempPriceList = explode("*", $_POST['buyPrices']);
$rTemp = showDiv($_POST['buyMapId']);
$aMap = mysql_fetch_array($rTemp);
$aSeatIdsList = explode(".", $aMap['SeatIds']);
$rTemp = getEvents($_POST['buyEnvtId']);
$aEvent = mysql_fetch_array($rTemp);
$aAvailList = explode(".", $aEvent['SeatAvail']);
$sAvailList = "";
saveRecord($_POST['buyEnvtId'], $_POST['buyMapId'],
$iBuyerId, $aTempSeatList[$i], $aTempSecList[$i], $aTempRowList[$i],
$aTempSIdList[$i], $aTempPriceList[$i]);
}
}
for($j=0; $j<(count($aAvailList)-1); $j++){
$sAvailList .= $aAvailList[$j].".";
}
$iNewCap = ($aEvent['CurCap'] - (count($aTempSeatList) - 1));
83
<div <?php echo $sDis;?>>Double-click to select your
seats.</div>
<table <?php echo $sDis;?>>
<tr>
<td>-Available: </td><td><img src='<?php echo
$sCurrentSeat;?>' alt='Available'></td>
</tr>
<tr>
<td>-Selected: </td><td><img src='<?php echo
$sCurActSeat;?>' alt='Selected'></td>
</tr>
<tr>
<td>-Unavailable: </td><td><img src='<?php echo
$sCurTakSeat;?>' alt='Unavailable'></td>
</tr>
</table>
<div class='extraSeats'><?php echo $sSeatImgs;?></div>
<div><?php echo $sBackImg;?></div>
<input id='expressInfo1' type='text' size='100' Readonly
value='' style='border-width: 0px; font-size: 8pt;'>
<br/>
<form action="purchase.php" name="buyerData"
enctype="multipart/form-data" method="post" <?php echo $sDis;?>>
<table class='purTable' border='0'>
<tr>
<td style='vertical-align:top'>
<div>New/Old Customer: <select
id='customerStatus' name='customerStatus'>
<option value='0'
onclick='hideTable("infoEntryTable", 0)' selected='selected'>New
Customer</option>
<?php echo $sOldCustomers;?>
</select></div><br/>
<table id='infoEntryTable' border="0">
<tr>
<td>First Name:</td><td><input name='fName'
type="text" maxlength="255" size="30"></td>
</tr>
<tr>
<td>Last Name:</td><td><input name='lName'
type="text" maxlength="255" size="30"></td>
</tr>
<tr>
<td>E-Mail:</td><td><input name='email'
type="text" maxlength="255" size="30"></td>
</tr>
<tr>
<td>Street Address:</td><td><input
name='street' type="text" maxlength="255" size="30"></td>
</tr>
<tr>
<td>City:</td><td><input name='city'
type="text" maxlength="255" size="30"></td>
</tr>
<tr>
<td>State:</td><td><input name='state'
type="text" maxlength="30" size="10"></td>
84
</tr>
<tr>
<td>Zip:</td><td><input name='zip'
type="text" maxlength="15" size="15"></td>
</tr>
<tr>
<td>Phone Number:</td><td><input name='phone'
type="text" maxlength="50" size="30"></td>
</tr>
<tr><td><br/></td></tr>
<tr>
<td>Card Type:</td><td><select
name='cardType'>
<option value='VISA'>VISA</option>
<option
value='Mastercard'>Mastercard</option>
<option value='American
Express'>American Express</option>
<option
value='Discover'>Discover</option>
</select></td>
</tr>
<tr>
<td>Card Number:</td><td><input
name='cardNum' type="text" maxlength="50" size="30"></td>
</tr>
<tr>
<td>Expiration Date:</td><td><select
name='expMonth'>
<?php echo $sExpMonths;?>
</select>/
<select name='expYear'>
<?php echo $sExpYears;?>
</select></td>
</tr>
</table>
<div>Number of Selected Seats: <input
id='selectedCount' type='text' size='6' Readonly value='0'
style='border-width: 0px; font-size: 10pt; padding-left:2px;'></div>
<div>Total Cost: $<input id='currentCost'
type='text' size='6' Readonly value='0' style='border-width: 0px; font-
size: 10pt; padding-left:2px;'></div>
<br/>
<input type="hidden" name="buySeatIds"
value="">
<input type="hidden" name="buySecs" value="">
<input type="hidden" name="buyRows" value="">
<input type="hidden" name="buySIds" value="">
<input type="hidden" name="buyPrices" value="">
<input type="hidden" name="buyEnvtId"
value="<?php echo $sBuyEvntId;?>">
<input type="hidden" name="buyMapId"
value="<?php echo $sBuyMapId;?>">
<div align="right"><input type="submit"
onClick='setPurchaseLists()' value='Complete Purchase'></div>
</td>
<td style='width:100px;'></td>
85
<td style='vertical-align:top'>
<br/>
<?php echo $sTable;?>
</td>
</tr>
</table>
</form>
<form name="genMapForm" method="post">
<input type="hidden" name="actualSeatCount"
value="<?php echo $iCount;?>">
<input type="hidden" name="secList" value="<?php echo
$sSec;?>">
<input type="hidden" name="secCheckList" value="<?php
echo $sSecValid;?>">
<input type="hidden" name="rowList" value="<?php echo
$sRow;?>">
<input type="hidden" name="rowCheckList" value="<?php
echo $sRowValid;?>">
<input type="hidden" name="seatList" value="<?php
echo $sSeat;?>">
<input type="hidden" name="seatCheckList"
value="<?php echo $sSeatValid;?>">
<input type="hidden" name="priceList" value="<?php
echo $sPrice;?>">
<input type="hidden" name="priceCheckList"
value="<?php echo $sPriceValid;?>">
<input type="hidden" name="seatFiles" value="<?php
echo $sSeatFiles;?>">
<input type="hidden" name="idList" value="<?php echo
$sIdList;?>">
<input type="hidden" name="curDfltImg" value="<?php
echo $sCurrentSeat;?>">
<input type="hidden" name="curActvImg" value="<?php
echo $sCurActSeat;?>">
<input type="hidden" name="curTakImg" value="<?php
echo $sCurTakSeat;?>">
</div>
<?php
include 'bot.php';
?>
86
9.12. records.php
<?php
include 'top.php';
include 'funcs.php';
$sDispPHist = "style='display:none;'";
$sDispPDet = "style='display:none;'";
$sCustTable = "";
$sHistTable = "";
$sDetTable = "";
$sCustomerName = "";
$sEventName = "";
$result = getCustomers();
while($row = mysql_fetch_array($result)){
$sCustTable .=
"<tr><td>".$row['FName']."</td><td>".$row['LName']."</td><td>".$row['EM
ail']."</td><td>".$row['Phone']."</td><td>".$row['Street']."</td><td>".
$row['City']."</td><td>".$row['State']."</td><td>".$row['Zip']."</td><t
d>".$row['DateJoined']."</td><td><a class='blueLink'
href='records.php?cid=".$row['CustId']."'>View</a></td></tr>";
}
if(isset($_GET['cid'])){
$sDispPHist = "";
$result = getCustomers($_GET['cid']);
$aCInfo = mysql_fetch_array($result);
$sCustomerName = $aCInfo['FName']." ".$aCInfo['LName'];
$rEvt = getUsersEventRecords($_GET['cid']);
while($aEventList = mysql_fetch_array($rEvt)){
$iCost = getTotalEventCost($_GET['cid'],
$aEventList['EventId']);
$rRecs = getEventRecords($_GET['cid'], $aEventList['EventId']);
$rTemp = getEvents($aEventList['EventId']);
$aEvntInfo = mysql_fetch_array($rTemp);
$iTally = 0;
while($aRecs = mysql_fetch_array($rRecs)){
$iTally++;
}
$sHistTable .=
"<tr><td>".$aEvntInfo['Name']."</td><td>".$aEvntInfo['Date']."</td><td>
".$iTally."</td><td>".$iCost."</td><td><a class='blueLink'
href='records.php?cid=".$_GET['cid']."&evnt=".$aEvntInfo['EventId']."'>
Details</a></td></tr>";
}
if(isset($_GET['evnt'])){
$rRecs = getEventRecords($_GET['cid'], $_GET['evnt']);
$rTemp = getEvents($_GET['evnt']);
$aEvntInfo = mysql_fetch_array($rTemp);
$sEventName = $aEvntInfo['Name'];
while($aRecs = mysql_fetch_array($rRecs)){
87
$sDetTable .=
"<tr><td>".$sEventName."</td><td>".(($aRecs['Sec']=="blank")?"":$aRecs[
'Sec'])."</td><td>".(($aRecs['Row']=="blank")?"":$aRecs['Row'])."</td><
td>".(($aRecs['Seat']=="blank")?"":$aRecs['Seat'])."</td><td>".(!is_num
eric($aRecs['Price'])?"0":$aRecs['Price'])."</td><td>".$aRecs['PurDate'
]."</td></tr>";
}
$sDispPDet = "";
}
}
?>
<div style="padding-left:20px;">
<h2>Customer Info</h2>
<div class='createTitle'>Customers:</div>
<table border='1' id='customerTable' class='centerCells'>
<tr>
<th>First Name</th><th>Last
Name</th><th>Email</th><th>Phone</th><th>Street</th><th>City</th><th>St
ate</th><th>Zip</th><th>Customer Since</th><th>History</th>
</tr>
<?php echo $sCustTable;?>
</table>
<br/>
<th>Event</th><th>Section</th><th>Row</th><th>Seat</th><th>Cost</th><th
>Date of Purchase</th>
</tr>
<?php echo $sDetTable;?>
</table>
</div><br/>
</div></div>
<?php
include 'bot.php';
?>
88
9.13. dom-drag.js
/**************************************************
* dom-drag.js
* 09.25.2001
* www.youngpup.net
* Script featured on Dynamic Drive (http://www.dynamicdrive.com)
12.08.2005
**************************************************
* 10.28.2001 - fixed minor bug where events
* sometimes fired off the handle, not the root.
**************************************************/
var Drag = {
obj : null,
start : function(e)
{
var o = Drag.obj = this;
e = Drag.fixE(e);
var y = parseInt(o.vmode ? o.root.style.top :
o.root.style.bottom);
var x = parseInt(o.hmode ? o.root.style.left :
o.root.style.right );
89
o.root.onDragStart(x, y);
o.lastMouseX = e.clientX;
o.lastMouseY = e.clientY;
if (o.hmode) {
if (o.minX != null) o.minMouseX = e.clientX - x +
o.minX;
if (o.maxX != null) o.maxMouseX = o.minMouseX +
o.maxX - o.minX;
} else {
if (o.minX != null) o.maxMouseX = -o.minX + e.clientX
+ x;
if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX
+ x;
}
if (o.vmode) {
if (o.minY != null) o.minMouseY = e.clientY - y +
o.minY;
if (o.maxY != null) o.maxMouseY = o.minMouseY +
o.maxY - o.minY;
} else {
if (o.minY != null) o.maxMouseY = -o.minY + e.clientY
+ y;
if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY
+ y;
}
document.onmousemove = Drag.drag;
document.onmouseup = Drag.end;
return false;
},
drag : function(e)
{
e = Drag.fixE(e);
var o = Drag.obj;
var ey = e.clientY;
var ex = e.clientX;
var y = parseInt(o.vmode ? o.root.style.top :
o.root.style.bottom);
var x = parseInt(o.hmode ? o.root.style.left :
o.root.style.right );
var nx, ny;
90
nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));
if (o.xMapper) nx = o.xMapper(y)
else if (o.yMapper) ny = o.yMapper(x)
Drag.obj.root.onDrag(nx, ny);
return false;
},
end : function()
{
document.onmousemove = null;
document.onmouseup = null;
Drag.obj.root.onDragEnd(
parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]),
fixE : function(e)
{
if (typeof e == 'undefined') e = window.event;
if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
return e;
}
};
91
9.13. moreFuncs.js
//Extra js functions I wrote
var globalSep = "*";
function saveMap(){
document.mainForm.storedMap.value =
document.getElementById('theMap').innerHTML;
document.mainForm.submit();
}
function saveMapData(){
var xpos;
var ypos;
var xposString = "";
var yposString = "";
var check = "";
var maxSeat = document.genMapForm.actualSeatCount.value;
var i;
var idArray = document.genMapForm.idList.value.split(".");
//document.write("width =
"+document.getElementById(idArray[2]).width+", height =
"+document.getElementById(idArray[2]).height);
var imgW = document.getElementById(idArray[2]).width-2; //
original needed to be 11
var imgH = document.getElementById(idArray[2]).height-2; //
original needed to be 11
//document.write("width = "+imgW+", height = "+imgH);
document.genMapForm.x_coords.value = xposString;
document.genMapForm.y_coords.value = yposString;
}
function measureLeft(oElement){
var left = oElement.offsetLeft;
var oParent = oElement.offsetParent;
while(oParent.nodeName != 'BODY'){
left += oParent.offsetLeft;
92
oParent = oParent.offsetParent;
}
return left;
}
function measureTop(oElement){
var top = oElement.offsetTop;
var oParent = oElement.offsetParent;
while(oParent.nodeName != 'BODY'){
top += oParent.offsetTop;
oParent = oParent.offsetParent;
}
return top;
}
function switchBack(){
var iHeight = document.backgroundForm.backHeight.value;
var iWidth = document.backgroundForm.backWidth.value;
var sColor = document.backgroundForm.backColor.value;
var sLocation = "images/"+sColor+"/"+iWidth+iHeight+sColor+".jpg";
document.genMapForm.imagePath.value = sLocation;
document.getElementById("backImage").src = sLocation;
document.getElementById("backImage").width = iWidth;
return;
}
function updateCreateBack(sFile){
document.genMapForm.imagePath.value = sFile;
document.getElementById("backImage").src = sFile;
if(document.getElementById("backImage").width > 700){
document.getElementById("backImage").width = 700;
}
//Seat is unselected
if(sId == sCurActive){
93
document.getElementById("activeSeatId").innerHtml = "";
document.getElementById(sId).src = oldImg;
document.getElementById("seatEditList").style.display =
"none";
}
if(aSeatCh[i] == "1")
document.getElementById("checkSeatId").checked = true;
else document.getElementById("checkSeatId").checked = false;
if(aPriceCh[i] == "1")
document.getElementById("checkPrice").checked = true;
else document.getElementById("checkPrice").checked = false;
checkboxActions("checkSec");
checkboxActions("checkRow");
checkboxActions("checkSeatId");
checkboxActions("checkPrice");
if((aSec[i] == "blank")||(!aSec[i]))
document.getElementById("secField").value = "";
else document.getElementById("secField").value = aSec[i];
if((aRow[i] == "blank")||(!aRow[i]))
document.getElementById("rowField").value = "";
else document.getElementById("rowField").value = aRow[i];
if((aSeat[i] == "blank")||(!aSeat[i]))
document.getElementById("seatIdField").value = "";
else document.getElementById("seatIdField").value = aSeat[i];
94
if((aPrice[i] == "blank")||(!aPrice[i]))
document.getElementById("priceField").value = "";
else document.getElementById("priceField").value = aPrice[i];
return;
}
function SetActiveSeatList(sId){
i = (i-j)-(2*(i-j));
if(!isNaN(aPrice[i])) calPrice = aPrice[i];
//Seat is unselected
if(path == "Selected"){
document.getElementById(sId).src = oldImg;
document.getElementById("selectedCount").value = (count*1)
- 1;
document.getElementById(sId+"tr").style.display = "none";
document.getElementById(sId).alt = "Unselected";
document.getElementById("currentCost").value = (curCost*1)-
calPrice;
}
return;
}
function setPurchaseLists(){
95
var aImgNames = document.genMapForm.posSeat.value.split("*");
var i;
//var j = document.genMapForm.actualSeatCount.value-1;
if(document.getElementById(aImgNames[i]+"tr").style.display ==
""){
document.buyerData.buySeatIds.value =
document.buyerData.buySeatIds.value+aImgNames[i]+globalSep;
document.buyerData.buySecs.value =
document.buyerData.buySecs.value+aSec[i]+globalSep;
document.buyerData.buyRows.value =
document.buyerData.buyRows.value+aRow[i]+globalSep;
document.buyerData.buySIds.value =
document.buyerData.buySIds.value+aSeat[i]+globalSep;
document.buyerData.buyPrices.value =
document.buyerData.buyPrices.value+aPrice[i]+globalSep;
}
}
}
}
function checkboxActions(sBoxId){
if(sBoxId == "checkSec"){
aCheck = document.genMapForm.secCheckList.value.split(".");
if(bActive){
document.getElementById("secField").style.display =
"";
aCheck[i] = "1";
}
else{
document.getElementById("secField").style.display =
"none";
aList =
document.genMapForm.secList.value.split(globalSep);
aList[i] = "blank";
aCheck[i] = "0";
document.genMapForm.secList.value =
aList.join(globalSep);
}
document.genMapForm.secCheckList.value = aCheck.join(".");
}
else if(sBoxId == "checkRow"){
aCheck = document.genMapForm.rowCheckList.value.split(".");
if(bActive){
96
document.getElementById("rowField").style.display =
"";
aCheck[i] = "1";
}
else{
document.getElementById("rowField").style.display =
"none";
aList =
document.genMapForm.rowList.value.split(globalSep);
aList[i] = "blank";
aCheck[i] = "0";
document.genMapForm.rowList.value =
aList.join(globalSep);
}
document.genMapForm.rowCheckList.value = aCheck.join(".");
}
else if(sBoxId == "checkSeatId"){
aCheck = document.genMapForm.seatCheckList.value.split(".");
if(bActive){
document.getElementById("seatIdField").style.display
= "";
aCheck[i] = "1";
}
else{
document.getElementById("seatIdField").style.display
= "none";
aList =
document.genMapForm.seatList.value.split(globalSep);
aList[i] = "blank";
aCheck[i] = "0";
document.genMapForm.seatList.value =
aList.join(globalSep);
}
document.genMapForm.seatCheckList.value = aCheck.join(".");
}
else if(sBoxId == "checkPrice"){
aCheck =
document.genMapForm.priceCheckList.value.split(".");
if(bActive){
document.getElementById("priceField").style.display =
"";
aCheck[i] = "1";
}
else{
document.getElementById("priceField").style.display =
"none";
aList =
document.genMapForm.priceList.value.split(globalSep);
aList[i] = "blank";
aCheck[i] = "0";
document.genMapForm.priceList.value =
aList.join(globalSep);
}
document.genMapForm.priceCheckList.value = aCheck.join(".");
}
return;
97
}
function setLists(iMaxSeat){
document.genMapForm.secList.value = sSec;
document.genMapForm.secCheckList.value = sValid;
document.genMapForm.rowList.value = sRow;
document.genMapForm.rowCheckList.value = sValid;
document.genMapForm.seatList.value = sSeat;
document.genMapForm.seatCheckList.value = sValid;
document.genMapForm.priceList.value = sPrice;
document.genMapForm.priceCheckList.value = sValid;
return;
}
if(key) i = (i-j)-(2*(i-j));
sFieldValue = trimString(sFieldValue);
if(sFieldValue.length == 0) sFieldValue = "blank";
switch(sBoxId){
case "secField":
aList =
document.genMapForm.secList.value.split(globalSep);
aList[i] = sFieldValue;
document.genMapForm.secList.value =
aList.join(globalSep);
break;
case "rowField":
aList =
document.genMapForm.rowList.value.split(globalSep);
aList[i] = sFieldValue;
98
document.genMapForm.rowList.value =
aList.join(globalSep);
break;
case "seatIdField":
aList =
document.genMapForm.seatList.value.split(globalSep);
aList[i] = sFieldValue;
document.genMapForm.seatList.value =
aList.join(globalSep);
break;
case "priceField":
aList =
document.genMapForm.priceList.value.split(globalSep);
aList[i] = sFieldValue;
document.genMapForm.priceList.value =
aList.join(globalSep);
break;
}
return;
}
function trimString(str){
return str;
}
if(key) i = (i-j)-(2*(i-j));
if((aSec[i] != "blank")){
sOut += "Section: "+aSec[i]+" ";
}
if((aRow[i] != "blank")){
sOut += "Row: "+aRow[i]+" ";
}
if((aSeat[i] != "blank")){
99
sOut += "Seat: "+aSeat[i]+" ";
}
if((aPrice[i] != "blank")){
sOut += "Price: $"+aPrice[i];
}
return;
}
function clearSeatInfo(key){
return;
}
var i;
return i;
}
function updateName(){
sName = trimString(sName);
document.genMapForm.mapName.value = sName;
}
document.getElementById(sID).src = sFile;
document.getElementById(sID).alt = sName;
if(document.getElementById(sID).width > 500)
document.getElementById(sID).width = 500;
}
document.genMapForm.seatCombo.value = iComID;
document.genMapForm.curDfltImg.value = sFile;
document.genMapForm.curActvImg.value = sAFile;
document.getElementById("sampleDef").src = sFile;
100
document.getElementById("sampleAct").src = sAFile;
document.getElementById("sampleTak").src = sTFile;
if(iHide == 1) document.getElementById(sID).style.display =
"none";
else document.getElementById(sID).style.display = "";
}
101