Title: Mexican Restaurant
1El Azteca
- Mexican Restaurant
- Prepared by Sandy Nichols
- November 21, 2006
2Table of Contents
- Executive Summary 3
- Site Map 4
- Database Structure 5
- Menu Page
- Flowchart 6
- Pseudo Code 7
- Admin Page
- Flowchart 8
- Pseudo Code 9
- Edit Records
- Flowchart 10
- Pseudo Code 11
- Delete Records
- Flow Chart 12
- Pseudo Code 13
3Executive Summary
The Definitions page will define what is in
popular Mexican dishes. If a person does not know
what a Chalupa is, they can go to the page and
read flat tortilla with beans sprinkled with
cheese and topped with guacamole salad.
Definitions will be taken from the current
printed menu. If restaurant is willing to have
the food photographed, this page could have an
accompanying photo with the definitions. The
about page will be a static page with some light
history about the company, coupled with photos of
beautiful people dining and drinking on the
outdoor patio and listening to the Mariachi band.
This page will be designed to give an overall
feel of the atmosphere. This page may include
pictures of long-term servers willing to be
photographed. Currently the proposed site is
five pages, but should be considered scaleable if
future needs arise. Additions could be a feature
on the many brands of tequilla sold at the bar or
a feature on Mexican specialty drinks. Another
enhancement could be the ability to take online
secured orders for carry-out. Flash components
could add another level of interactivity, like
make your own virtual tacos game.
El Azteca Mexican Restaurant needs a website that
showcases their menu, provides directions, and
gives a general presence on the web. This will
be achieved by storing the menu in a MySQL
database and having PHP dynamically write to the
Menu page. The restaurant also needs a way to
periodically post specials themselves.
Advertised specials are by way of coupons
circulated throughout the community. By building
a photo gallery, they will be able to frequently
upload an image of the coupon directly to their
Home page. This approach preserves the
restaurants current marketing strategy while
providing another means of coupon distribution
through a web presence.
Current Coupon
4Site Map
HOME
ABOUT
Directions
Definitions
MENU
History Patio pics Staff pics
Directions Contact
Specials Coupons
Definitions of Mexican food
Dynamic
Dynamic
Static
Static
Static
Database
Photo Gallery
5Database Structure
M E N U
P H O T O G A L L E R Y (for coupons)
6Flowchart for Menu Page
Visit Menu page
Connect to MySQL
Select db to work with
Query DB by Category Store in variable
Store of records in variable
No records
stop
Is records gt0 ?
Echo Record
Fetch record
stop
7Pseudo Code for Menu Page
Visit Menu page
- OPEN DB ElAzteca
- READ DB
- SET results to a variable
- SET of results to variable
- DOWHILE gt0
- READ results from variable
- WRITE results to page
- CLOSE file
Connect to MySQL
Select db to work with
Query DB by Category Store in variable
Store of records in variable
No records
stop
Is records gt0 ?
Echo Record
Fetch record
stop
8Flowchart for Admin Page
9Pseudo Code for Admin Page
10Flowchart for Editing Records
start
Is record id set?
NO
YES
Record does not exist
Has form Been submitted?
NO
YES
stop
Show form
Update Record DB Where id _GETid
showForm()
stop
Errors?
Connect to DB
NO
YES
Start Session
Query Error Output SQL Mysql_error()
Select DB
Store success Message in Session Var
Query DB For record
stop
Redirect To admin page
Output form With data In elements
stop
End showForm()
11Pseudo Code for Editing Records
- OPEN record id
- READ record id
- IF id not set THEN WRITE error
- IF id set THEN continue
- READ record id
- IF id not submitted THEN show form
- IF id submitted THEN WRITE DB
- END-IF
- IF errors THEN WRITE error
- IF no errors THEN WRITE success
- END-IF
- OPEN Admin page
- CLOSE
start
Is record id set?
NO
YES
Record does not exist
Has form Been submitted?
NO
YES
stop
Show form
showForm()
Update Record DB Where id _GETid
stop
Errors?
Connect to DB
NO
YES
Start Session
Query Error Output SQL Mysql_error()
Select DB
Store success Message in Session Var
Query DB For record
stop
Redirect To admin page
Output form With data In elements
stop
End showForm()
12Flowchart for Deleting Records
start
Is record id set?
NO
YES
Delete Var Set?
No such record
NO
YES
Query DB For Record
stop
Are you sure? Show Record
Delete Record From DB Table Where id _GETid
Delete?
YES
Errors?
NO
YES
NO
Redirect To admin page
Start Session
Query Error Output SQL Mysql_error()
stop
Store success Message in Session Var
stop
Redirect To admin page
stop
13Pseudo Code for Deleting Records
start
Is record id set?
NO
YES
- READ record id
- IF id not set THEN WRITE error
- IF id set THEN continue
- END-IF
- IF delete not confirmed, THEN confirm
- IF delete confirmed THEN delete
- END-IF
- IF errors THEN WRITE error
- IF no errors THEN WRITE success
- OPEN Admin page
- END-IF
- CLOSE
Delete Var Set?
No such record
NO
YES
Query DB For Record
stop
Are you sure? Show Record
Delete Record From DB Table Where id _GETid
Delete?
YES
Errors?
NO
YES
NO
Redirect To admin page
Start Session
Query Error Output SQL Mysql_error()
stop
Store success Message in Session Var
stop
Redirect To admin page
stop
14(No Transcript)