CS 433a Assignment 2 -- L.U.C.I. System Documentation

November 9, 2001

Lizard Used Car Inventory System

By using a Lizard, I have cleverly enabled the use of the acronym "LUCI". Cute, eh?

System Limitation

Ideally, I'd like to have implemented checkboxes to allow multiple entry deletion but I couldn't figure out how to use arrays that way in time.

Files and What they do:

addcar.php (Employee and Admin Access Only)
This contains the form for adding a car entry and passes the user-input to addconfirm.php

addconfirm.php (Employee and Admin Access Only)
This takes the form from addcar.php and INSERTS it into the database. It then displays the values of the entry it just inserted and requires the user to COMMIT or ROLLBACK on that decision. It also uploads any associated file (car picture), changes it's name to avoid naming collisions with other entries, and then transfers it to the permanenent storage area, defined in tchim.inc. banner.html
A simple banner, no functionality.

bottomheader.php
Probably more accurately described as pagefooter.php. Any .php file that includes this will append a "back" link to itself as well as a stylish ruler and the server date/time it was last modified (dependant on client activation of Javascript).

commit.php
Contains the mySQL command to COMMIT an operation. Called by addconfirm,deleteconfirm and updateconfirm.

confirmbottomheader.php
Another "footer" file which is like bottom head but instead of a "back" link, provides the user with the option to call COMMIT or ROLLBACK.

deletecar.php (Admin Access Only)
Contains a form which allows the user to choose a car to delete. Actually, just the ID is chosen and sent to deleteconfirm for the dirty work. Probably should rename this to "deleteselect."

deleteconfirm.php (Admin Access Only)
Takes the ID sent by deletecar.php, searches the database for it and deletes the associated entry, INCLUDING any uploaded files that it was associated with.

index.htm
Main page. Uses frames. Has three of them: banner, table of cotents and main.

logout.php
This logs the user out of the Inventory Management system.

management.php
This does alot of things. If the user hasn't been properly logged on yet, then it will prompt the user to login and authenticate the user's login name and password. If not authenticated, then prompts for the user login name and password again. When the user is authenticated, it will register the user's accesslevel with the global session registry so other pages can tell whether its okay to let that user to access it. It also presents the user with some management inventory commands (add,edit,delete,view DB and logout).

rollback.php
Like commit.php but instead of COMMIT, it calls ROLLBACK.

tchim.inc
This is basically my global header file which contains things like image pathnames, how many entries we're allowed to see featured, etc. Also contains an include to the DBCONNECT script.

toc.html
Table of Contents for public interface. Points to viewfeatures.php (Show Room), viewactive.php (Other Active Cars) and management.php (Inventory Management).

updatecaredit.php (Employee and Admin Access Only)
This displays the current values of all the attributes of the car that was slected in updateselect, for editing. Sends the input into updateconfirm.php. NOTE: It's possible to remove an associated image file to a car by updating the image to be nothing.

updateconfirm.php (Employee and Admin Access Only)
This recieves input from updatecaredit.php and updates the appropriate table in the DB. It also takes car to upload a new image file (if it was specified) and delete the old image file (if necessary).

updateselect.php (Employee and Admin Access Only)
This displays all the vehiles in the Database and lets the user decide which one to delete. It sends the ID of that one to updatecaredit.php

validateAdmin.inc
Whichever file includes this script will check the global session registry to see if the accesslevel is equal to "ADMIN". If NOT, then it immediately stops the script and sends out a "You're not authorized to use this" message to screen.

validateEmployee.inc
Like validateAdmin but checks to see if the accesslevel is either EMPLOYEE OR ADMIN before stopping the script.

viewactive.php
Lists active cars (not featured, not inactive) five rows at a time (default defined in tchim.inc), and generates links to the next page of itself.

viewCar.php
Formats data and calls viewcar.thtml to display the results. Look at all the information of a single car.

viewcar.thtml
HTML template file that displays a single car. Called by addconfirm.php, updateconfirm.php, viewactive.php, andviewCar.php

viewdb.php (Employee and Admin Access Only)
A non-required page that shows the entire contents of the DB (essential a SELECT * FROM db). Available through the Inventory Management Screen only.

viewfeatured.php
Displays all the show room FEATURED vehicles. If the number of cars with status "FEATURE" in the database is found to exceed the maximum allowed featured (defined in tchim.inc), then it will automatically convert the oldest entries (inferred from ID number, as it's non-unique sequential) to ACTIVE status.

./images:
Subdir containing all the uploaded images.

./pagepics
Subdir containing all the image files for the web site.

./tmpimages
Subdir used for "temp storage" of recently uploaded image files, so that the .php can validate them.

Back