#!/usr/bin/perl -Tw use CGI qw(:standard); use strict; use lib qw(/export/ext2/www/bartellmachinery/library); use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard escape escapeHTML); use WebDB; my $cust_ref; #reference to customer #@PAGE_START my $dbh = WebDB::connect (); my $page = h3 ({-align=>"center"}, ("Order Tracking System")); #@PAGE_START # get the form parameters $cust_ref->{custid} = param ("custid"); my $choice = lc (param ("choice")); if ($choice eq "submit") # customer submitted ID number { $page .= get_customer ($dbh, $cust_ref); } else { $page .= p (escapeHTML ("Logic error, unknown choice: $choice")); } print header (), start_html (-title => "Order Tracking System", -bgcol +or => "white"); sub get_customer { my ($dbh, $cust_ref) = @_; my ($page); my $sth = $dbh->prepare ("SELECT * FROM Shipments WHERE customer_id = +?"); $sth->execute ($cust_ref->{custid}); my @rows; while (my $order_ref = $sth->fetchrow_hashref ()) { push @rows, Tr ({-style=>"font-family: verdana; font-size: 10pt;"}, td ({-colspan => "2"}, ""), td ({-colspan => "3", -align=>"right", -style=>"font-weight: +700;"}, "Customer ID:"), td (escapeHTML ($order_ref->{customer_id)), ); Tr ({-style=>"font-family: verdana; font-size: 10pt;"}, td ({-colspan => "2"}, ""), td ({-colspan => "3", -align=>"right", -style=>"font-weight: +700;"}, "Tracking Number:"), td (escapeHTML ($order_ref->{tracking_number)), ); $page .= table ({-border => 1, -align => "center"}, return ($page); $sth->finish(); }
In reply to Compilation Error by b310
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |