in reply to Re: Re: Re: No results from script
in thread No results from script
my $customer_id; $customer_id = param("customer_id"); print header(), start_html (-title => "Order Tracking System", -bgcolo +r => "white"); my $choice = lc (param ("choice")); if ($choice eq "submit") # customer submitted order number { get_customer (); print_results (); } else { print p (escapeHTML ("Logic error, unknown choice: $choice")); } print end_html(); sub get_customer { my ($dbh, $customer_id) = @_; $dbh = WebDB::connect (); my $sth = $dbh->prepare ("SELECT * FROM Shipments WHERE customer_id = +?"); $sth->execute($customer_id); while (my $track_ref = $sth->fetchrow_hashref ()){ push(@customer, $track_ref); } return(\@customer); } sub print_results { my $customer = get_customer($customer_id); print table ({-border => 0}, Tr ({-align => "CENTER", -valign=>"TOP", -BGCOLOR=>"silver", -st +yle=>"font-family: verdana; font-size: 10pt;"}, th ({-width=>"50"},("Customer ID")), th ({-width=>"50"},("Carrier")), th ({-width=>"90"},("Tracking Number")) + )); foreach my $row (@$customer) { print table ({-border => 0}, Tr ({-valign=>"center", -style=>"font-family: verdana; font-size: +10pt;"}, td ($row->{customer_id}), td ($row->{carrier_id}), td ($row->{tracking_number}) )); } print start_form (-action => "http://wwwapps.ups.com/tracking/tracking +.cgi", -method => "POST"), table ( Tr ( td ("UPS Tracking Number:"), td (textfield (-name => "tracknum")) ), ), submit (-name => "choice", -value => "Track"), end_form (); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Re: No results from script
by edoc (Chaplain) on Jun 04, 2003 at 16:00 UTC | |
by b310 (Scribe) on Jun 04, 2003 at 16:12 UTC | |
by edoc (Chaplain) on Jun 04, 2003 at 16:21 UTC | |
by b310 (Scribe) on Jun 04, 2003 at 19:15 UTC | |
by edoc (Chaplain) on Jun 04, 2003 at 23:28 UTC | |
by edoc (Chaplain) on Jun 05, 2003 at 07:28 UTC |