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)

Web Interface for Adding and Editing a new records (New)

Hints and Programming Techniques (Same)

Sample Input / Output Web Page 1

Supplier Database

matches        Add New Supplier #

                      

Result for: ListAll
Supplier Name Phone Product List
1230001 John 90901234 asx102=30;dcp211=100;dyp205=25;fhf123=10;
1230002 Peter 93003333 dcp102=20;dcp211=80;fnf205=35;ssx180=15;
1230003 Jane 94001222 asx108=30;asx118=40;asx128=50;asx138=60;

Sample Edit-Single Web Page 2

Supplier Database

matches        Add New Supplier #

                      

Edit #1230001

Supplier Name Phone Product List
94001

Sample Updated Web Page 3 (after pressing Update in Page 2)

Supplier Database

matches        Add New Supplier #

                      

Updated Records

Supplier Name Phone Product List
94001 John 77109933 asx102=30;dcp211=100;dyp205=25;fhf123=50;

Sample Edit-Single Web Page 4 (After adding a record 1230009)

Supplier Database

matches        Add New Supplier #

                      

Edit #1230009
Supplier Name Phone Product List
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.