#!/usr/bin/perl
use CGI;
$q = new CGI;
if (defined ($q->param)) {
$page=$q->param('next');
if ($page eq "customer") {
&customer_info; }
if ($page eq "survey") {
&survey_questions;
}
if ($page eq "hiddendata") {
&hidden_data;
}
}
else {
#print first page
&product_page;
}
sub product_page {
print $q-> header('text/html');
print $q-> start_html('Warranty and Survey');
print $q-> p("Welcome to Joe Bloe ElectronicZ");
print "Which product did you purchase from us?";
print $q-> start_form(-method=>get, -action=>'newwork.cgi');
print "";
print "
".$q-> checkbox_group(-name=>'product', -values=>['computer', 'mp3 player']);
print " ".$q-> submit(-name=>'Submit');
print $q-> end_form;
print $q-> end_html;
}
sub customer_info {
print $q-> header('text/html');
print $q-> start_html('Warranty and Survey');
print $q-> start_form(-method=>get, -action=>'newwork.cgi');
@users_product=$q->param('product');
foreach $i (@users_product) {
print "You have selected"." $i ";
}
print "Please inform us of your details
";
#print "";
print "Full Name: ".$q-> textfield(-name=>'username', -size=>'20', -maxlength=>'100');
print "Gender: ".$q-> radio_group(-name=>'gender', -values=>['M', 'F']);
print "State: ".$q-> popup_menu(-name=>'state', -values=>['-Please Select-', 'QLD', 'N.S.W']);
print "Email: ".$q-> textfield(-name=>'email', -size=>'25', -maxlength=>'50');
print "";
print " ".$q-> reset(-name=>'Reset Details');
print " ".$q-> submit(-name=>'Submit Details');
print $q-> end_form;
print $q-> end_html;
}
sub survey_questions {
print $q-> header('text/html');
print $q-> start_html('Warranty and Survey');
print $q-> start_form(-method=>get, -action=>'newwork.cgi');
print $q-> h1("Survey");
print "";
print "What do you rate the customer service?".$q-> radio_group(-name=>'service', -values=> ['1', '2', '3', '4', '5']);
print "How would you rate the price of the product?".$q-> radio_group(-name=>'price', -values=> ['1', '2', '3', '4', '5']);
print "What do you rate the product overall?".$q-> radio_group(-name=>'product', -values=> ['1', '2', '3', '4', '5']);
print "
".$q-> submit(-name=>'Continue');
print $q-> end_html;
print $q-> end_form;
}
#sub hidden_data {
# print $q-> header('text/html');
# print "";
# print "hello this is hidden";
#}