#!h:/xampp/perl/bin/perl -w
# PERL MODULES WE WILL BE USING
use DBI;
use DBD::mysql;
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use dbConnect;
require "ap_messages_config.pl"; #PULL IN THE FILE THAT CREATES EACH HTML RESPONSE PAGE
#INCLUDES THE SUB 'STYLE' FOR CSS
$q = new CGI;
print $q->header();
my @values = split(/=/,$ENV{QUERY_STRING});
my $customer_get = $values[1];
my $customer_post = $q->param('customer_post');
my $num_buildings = "";
my $errors = "";
my @parameters = $q->param(); #THIS JUST STORES THE NAMES OF THE PARAMETERS. TO PRINT ITS VALUE, USE
#param($parameters[0]) . "
\n";
#################################################################################################################
############################## BEGIN MAIN PROGRAM ###############################################################
#################################################################################################################
#style ();
print $q->start_html();
if (($q->param('section_number')) < 2) {
sectionOne($customer_get);
}
if (($q->param('section_number')) eq "2") {
sectionTwo();
}
if (($q->param('section_number')) eq "3") {
sectionThree($customer_post);
}
if (($q->param('section_number')) eq "4") {
sectionFour();
}
print $q->end_html();
#################################################################################################################
############################## BEGIN MAIN PROGRAM ###############################################################
#################################################################################################################
############################################## SUBROUTINES ######################################################
=pod
sub javaScript() {
# USE CGI 'start_html' TO ADD JAVASCRIPT TO HEADER
print $q->start_html(
-title=>'Enter AP Names',
-script=> {
-language => 'javascript',
-src => '../scripts/hideDiv.js'
}
);
style ();
}
=cut
################################## HTML PAGE TO ASK USER NUMBER OF BUILDINGS #####################################
sub sectionOne() {
print "Section One.
\n";
print "The value of \$customer_get is: $customer_get.
\n";
print "The value of \$customer_post is: $customer_post.
\n";
print "Enter the Number of Buildings:\n";
print "
You entered the following building names. If they are correct, select 'Submit' to add them to the database for customer $customer | \n"; print "
"; print ""; print " | \n"; print "
"; print "Building $building_nums[$i]: $buildings[$i]"; print ""; print " | \n"; print "