Customer Maintenance - democent.bbx
This program generates a customer maintenance form. By default, the form contains no customer data and can be used to create a new customer record. However, if the CGI field "cust_id" is filled in with a valid customer number, that customer record can be edited and updated.
Unlike the prior examples, an HTML document template is not used. Instead, the HTML text is created in the program.
|
An entry form is generated from the CUST$ data template. The cust_id field is hidden and cannot be edited, though it is passed to the democupd.bbx program. Fields indicated with a "show" option are display-only. The program utfrmgn2.wbb constructs the complete form, including Submit, Reset buttons, and a form tag to start the demobbw.sh script into the variable CUSTFORM$. The non-template field "pgm" is specified as a hidden field. As in URL links, this must be specified for the startup program to run the correct program. The democupd.bbx program is used to update the customer file from the contents of the form.
|
Multiple calls to uttags.wbb build the HTML$ document body. Body tags are added, a header is generated, and the complete document is generated into DOCUMENT$. The result is sent to the user, and the program exits. In addition, it is necessary to shuffle HTML$ values with a temporary variable to add surrounding tags, such as <center> and </center> and not double up the text in HTML$ because uttags.wbb always appends to the last argument.
|