COMP111: Software Tools (Update:
Dickson Chiu / Eric Lin, Summer 2001)
Lab 12: Web Interface for Supplier
Database 3 - with record add and
delete (Perl) (Demo
Link)
If you have trouble, please raise your hand and the TA will help. You
may use the sample answer of the last lab(s) as a basis for your work in this lab.
Problem Description
Based on Lab 11, you read in text file to initialize a internal Perl data
structure, process user's interactive query from the web, and display results on
a web page. We can also edit and update the data through a web page. Upon update,
the data are written back to the file (refer to Lab 9 for the Perl code to write
the file.) We finalize this mini-project of web-database with add and
delete record.
The appearance need not be identical with the sample provided in this page,
but the information and interaction should be complete.
Input Data File Format (Same as the previous lab)
Original Web Interfaces (Same as the previous lab)
Web Interface for Editing and Update (Same as the previous lab)
Web Interface for Editing and Deleting A Single Record (New)
- For each record in any displayed
table, which may not be a complete list of suppliers (say, the results of a
course list or dept list), include a hyper-link at the supplier-id field for
editing / deleting the single record.
- Upon receiving the parameter for editing a single record, the edit-record screen is
displayed, with a new "Delete" button. Include also the "Update" and "Cancel"
buttons as previously we did. See the sample screen below.
- Upon receiving the "Delete" parameter, write back the data file
without the deleted record, so that the program next time runs without this
record any more.
Web Interface for Adding and Editing a new records (New)
- Add an "Add" button to add new supplier records with a text field
to enter the supplier.
- Upon receiving the parameter "Add", display an error message if
the supplier-id already exists. If we can add the record, go to
the screen for editing / deleting the single record (as described in the
previous paragraph).
Hints and Programming Techniques (Same)
Sample Input / Output Web Page 1
Sample Edit-Single Web Page 2
Sample Updated Web Page 3 (after pressing Update in Page 2)
Sample Edit-Single Web Page 4 (After adding a record 1230009)
Submission
Save your Perl .cgi program as ~/comp111/ans12/ans12.txt
Or you may email your answer to the TA if you have difficulties.