#!/usr/bin/perl -w use Fcntl qw(:flock); use CGI qw(:all); use CGI::Carp qw(fatalsToBrowser); use strict; print header; #################################################### # If statement that controls the pages that load # #################################################### if (! param) { pageone(); } elsif (defined param('pageone')) { pageone(); } elsif (defined param('pagetwo')) { pagetwo(); } elsif (defined param('pagethree')) { pagethree(); } elsif (defined param('pagefour')) { pagefour(); } else { pagefive(); sendmail(); } ################################### # This is the first subroutine # # which actually loads the form # ################################### sub pageone { my $val1=param("reBrand"); my $val2=param("reModel"); my $val3=param("reAge"); my $val4=param("reCPU"); my $val5=param("reHDD"); my $val6=param("reHDC"); my $val7=param("reRAM"); my $val8=param("reOS"); my $val9=param("reText"); my $val10=param("upBrand"); my $val11=param("upModel"); my $val12=param("upAge"); my $val13=param("upCPU"); my $val14=param("upHDD"); my $val15=param("upHDC"); my $val16=param("upRAM"); my $val17=param("upOS"); my $val18=param("upText"); my $val19=param("compNum"); my $val20=param("roomNum"); my $val21=param("foot"); my $val22=param("netType"); my $val23=param("line"); my $val24=param("ISP"); my $val25=param("win9x"); my $val26=param("winXP"); my $val27=param("win2000"); my $val28=param("linux"); my $val29=param("fileShare"); my $val30=param("printShare"); my $val31=param("netShare"); my $val32=param("fileSec"); my $val33=param("netBack"); my $val34=param("gaming"); my $val35=param("netText"); my $val36=param("custname"); my $val37=param("email"); my $val38=param("street"); my $val39=param("city"); my $val40=param("state"); my $val41=param("zip"); my $val42=param("country"); my $val43=param("phone"); my $val44=param("comments"); ######################################################## # These are the Arrays created to hold # # the of the varialbes: # # valueArray contains the variables and their values # # nameArray contains the names of the hidden fields # ######################################################## my @valueArray=($val1, $val2, $val3, $val4, $val5, $val6, $val7, $val8, $val9, $val10, $val11, $val12, $val13, $val14, $val15, $val16, $val17, $val18, $val19, $val20, $val21, $val22, $val23, $val24, $val25, $val26, $val27, $val28, $val29, $val30, $val31, $val32, $val33, $val34, $val35. $val36. $val37. $val38. $val39. $val40. $val41. $val42. $val43. $val44,); my @nameArray=('reBrand', 'reModel', 'reAge', 'reCPU', 'reHDD', 'reHDC', 'reRAM', 'reOS', 'reText', 'upBrand', 'upModel', 'upAge', 'upCPU', 'upHDD', 'upHDC', 'upRAM', 'upOS', 'upText', 'compNum', 'roomNum', 'foot', 'netType', 'line', 'ISP', 'win9x', 'winXP', 'win2000', 'linux', 'fileShare', 'printShare', 'netShare', 'fileSec', 'netBack', 'gaming', 'netText', 'custname', 'email', 'street', 'city', 'state', 'zip', 'country', 'phone', 'comments'); print< Tornado Interactive: Service Form
Welcome to the Tornado Interactive Service Form! Use the tabs at the top of the form to navigate to the section you want to fill out. Once you have entered all of your information, simply click the submit button to proceed!
Repair
Upgrade
Networking
Brand:
Model:
Age:
CPU:
HDD Size:
HDD Free:
RAM:
OS:
Additional Information
Please begin by giving us some information about your system, and outlining the problem that you are having. If you are unsure what to put in a specific field, look here for instructions on how to get the information you need.
 
PAGE_ONE2 ; } ################################################ # This is the Second Subroutine # # which pulls the values from the form and # # stores them, while displaying another form # # to gather contact information # ################################################ sub pagetwo { ######################################## # These are the variables created to # # store the values of the different # # fields in the form # ######################################## my $val1=param("reBrand"); my $val2=param("reModel"); my $val3=param("reAge"); my $val4=param("reCPU"); my $val5=param("reHDD"); my $val6=param("reHDC"); my $val7=param("reRAM"); my $val8=param("reOS"); my $val9=param("reText"); my $val10=param("upBrand"); my $val11=param("upModel"); my $val12=param("upAge"); my $val13=param("upCPU"); my $val14=param("upHDD"); my $val15=param("upHDC"); my $val16=param("upRAM"); my $val17=param("upOS"); my $val18=param("upText"); my $val19=param("compNum"); my $val20=param("roomNum"); my $val21=param("foot"); my $val22=param("netType"); my $val23=param("line"); my $val24=param("ISP"); my $val25=param("win9x"); my $val26=param("winXP"); my $val27=param("win2000"); my $val28=param("linux"); my $val29=param("fileShare"); my $val30=param("printShare"); my $val31=param("netShare"); my $val32=param("fileSec"); my $val33=param("netBack"); my $val34=param("gaming"); my $val35=param("netText"); my $val36=param("custname"); my $val37=param("email"); my $val38=param("street"); my $val39=param("city"); my $val40=param("state"); my $val41=param("zip"); my $val42=param("country"); my $val43=param("phone"); my $val44=param("comments"); ######################################################## # These are the Arrays created to hold # # the of the varialbes: # # valueArray contains the variables and their values # # nameArray contains the names of the hidden fields # ######################################################## my @valueArray=($val1, $val2, $val3, $val4, $val5, $val6, $val7, $val8, $val9, $val10, $val11, $val12, $val13, $val14, $val15, $val16, $val17, $val18, $val19, $val20, $val21, $val22, $val23, $val24, $val25, $val26, $val27, $val28, $val29, $val30, $val31, $val32, $val33, $val34, $val35. $val36. $val37. $val38. $val39. $val40. $val41. $val42. $val43. $val44,); my @nameArray=('reBrand', 'reModel', 'reAge', 'reCPU', 'reHDD', 'reHDC', 'reRAM', 'reOS', 'reText', 'upBrand', 'upModel', 'upAge', 'upCPU', 'upHDD', 'upHDC', 'upRAM', 'upOS', 'upText', 'compNum', 'roomNum', 'foot', 'netType', 'line', 'ISP', 'win9x', 'winXP', 'win2000', 'linux', 'fileShare', 'printShare', 'netShare', 'fileSec', 'netBack', 'gaming', 'netText', 'custname', 'email', 'street', 'city', 'state', 'zip', 'country', 'phone', 'comments'); my $i=0; my $j=0; my $k=0; my $m=0; ########################################## # This section tests for the length of # # section of the form # ########################################## for ($i=0;$i<35;$i++) { my $l=0; $l= length($valueArray[$i]); $k= $k+$l; } for ($i=9;$i<18;$i++) { my $l=0; $l= length($valueArray[$i]); $j= $j+$l; } for ($i=18;$i<35;$i++) { my $l=0; $l= length($valueArray[$i]); $m= $m+$l; } my $num=$k+$j+$m; ########################################### # Here the lengths are added together # # And the following if statement # # Checks to insure that the form # # contains more than 11 characters. # # If it doesn't an insuffeciant data # # page appears asking them to try again # # But if it does, then the contact # # information page is loaded. # ########################################### if ($num < 11) { print< Tornado Interactive: Insufficient
Insufficient Data!

PAGE_INS print "$val18"; for ($i=0;$i<34;$i++) { print " \n"; } print "
\n"; print<
PAGE_INS2 } else { my @discArray=('Brand', 'Model', 'Age', 'CPU', 'HDD Size', 'HDD Capacity', 'RAM', 'OS', 'Comments', 'Brand', 'Model', 'Age', 'CPU', 'HDD Size', 'HDD Capacity', 'RAM', 'OS', 'Comments', 'Number of Computers', 'Number of Rooms', 'Footage', 'Type of Network', 'Line', 'ISP', 'Windows 95/98/ME', 'Windows XP', 'Windows 2000', 'Linux', 'File Sharing', 'Print Sharing', 'Internet Sharing', 'Files Security', 'Network Backup', 'Network Gaming', 'Comments', 'Name', 'Email', 'Street', 'City', 'State', 'Zip', 'Country', 'Phone', 'Comments'); my $i=0; my $k=9; my $m=18; my $m2=24; my $m3=28; my $c=35; my $x=0; my $y=9; my $z=18; my $z2=35; my $reLen=0; my $upLen=0; my $netLen=0; my $conLen=0; ################################################ # This section tests for the length of the # # three sections again, and stores the length # # in the corresponding variable. # ################################################ for ($x=0;$x<8;$x++) { my $enough=0; $enough=length($valueArray[$x]); $reLen=$reLen+$enough; } for ($y=9;$y<18;$y++) { my $enough=0; $enough=length($valueArray[$y]); $upLen=$upLen+$enough; } for ($z=18;$z<34;$z++) { my $enough=0; $enough=length($valueArray[$z]); $netLen=$netLen+$enough; } for ($z2=35;$z2<45;$z2++) { my $enough=0; $enough=length($valueArray[$z2]); $conLen=$conLen+$enough; } print< Tornado Interactive: Verify Your Entry
Thank you for filling out our Repair, Upgrade, and Networking form! Please take a few seconds to look over your entry. If you need to make any changes, click the Back Button to return to the form and alter your information. Or, if everything is correct, just click the Next Button to Proceed! Remember, the more information you provide, the easier it will be for us to help you!
PAGE_THREE ############################################### # Here I use if statements to test if there # # are any vaules in the separate sections of # # the form. If there are values it prints # # a heading and a bulleted list of the # # values that were entered. If not, the # # heading and list is skipped. The first one # # is broken down with comments. # ############################################### ######################################################### # if statement that checks to see if there are values # ######################################################### if ($reLen > 0) { ############################################### # If there are values it prints the heading # ############################################### if ($upLen < 1 && $netLen < 1) { print< Repair:
    RELEN } else { print< Repair:
      RELEN2 } ########################## # Loop to print values # ########################## for ($i=0;$i<9;$i++) { ################################################# # Checks the length of the each field's value # ################################################# my $enough=length($valueArray[$i]); ############################################################# # If the value is 0, the increment on the loop is skipped # # and that value and description in the arrays won't show # # up. # ############################################################# next if ($enough == 0); ###################################### # Prints the description and value # ###################################### print "
    • $discArray[$i]\: $valueArray[$i]\n"; } #################################################### # Prints the closing tags for the bulleted lists # #################################################### print "
    \n"; } if ($upLen > 0) { if ($reLen < 1 && $netLen > 0) { print< Upgrade:
      UPLEN } elsif ($reLen > 0 && $netLen < 1) { print<
      Upgrade:
        UPLEN2 } elsif ($reLen < 1 && $netLen < 1) { print< Upgrade:
          UPLEN3 } else { print "
          Upgrade\:
            \n"; } for ($k=9;$k<18;$k++) { my $enough=length($valueArray[$k]); next if ($enough == 0); print "
          • $discArray[$k]\: $valueArray[$k]\n"; } print "

          \n"; } my $mLen=0; my $osLen=24; my $nLen=0; my $netwLen=28; for ($osLen=24;$osLen<28;$osLen++) { my $enough=length($valueArray[$osLen]); $mLen=$mLen+$enough; } for ($netwLen=28;$netwLen<35;$netwLen++) { my $enough=length($valueArray[$netwLen]); $nLen=$nLen+$enough; } if ($netLen > 0) { if ($reLen > 0 || $upLen > 0) { print<
      Networking:
        NETLEN } else { print< Networking:
          NETLENB } for ($m=18;$m<24;$m++) { my $enough=length($valueArray[$m]); if ($discArray[$m] =~ "Type of Network") { if ($valueArray[$m] =~ "PtP") { print "
        • $discArray[$m]\: Peer-to-Peer\n"; } elsif ($valueArray[$m] =~ "CS") { print "
        • $discArray[$m]\: Client-Server\n"; } else { print "
        • No Network Type Selected"; } } else { next if ($enough == 0); print "
        • $discArray[$m]\: $valueArray[$m]\n"; } } print "
        • Operating Systems\:
            "; for ($m2=24;$m2<28;$m2++) { if ($valueArray[$m2] =~ "on") { print "
          1. $discArray[$m2]"; } } if ($mLen == 0) { print "
          2. No Operating System Selected!"; } print "
        • Network Features:
            "; for ($m3=28;$m3<34;$m3++) { my $enough=length($valueArray[$m3]); next if ($enough == 0); print "
          1. $discArray[$m3]\n"; } if ($nLen == 0) { print "
          2. No Network Features Selected!"; } my $comlen=length($valueArray[34]); if ($comlen > 0) { print "
        • Comments\: $valueArray[34] \n"; print "
        \n"; } else { print "
      "; } } my $num1=0; for ($num1=0;$num1<45;$num1++) { my $enough=length($valueArray[$num1]); next if ($enough == 0); print " \n"; } print<
      PAGE_THREEC } sub pagethree { my $val1=param("reBrand"); my $val2=param("reModel"); my $val3=param("reAge"); my $val4=param("reCPU"); my $val5=param("reHDD"); my $val6=param("reHDC"); my $val7=param("reRAM"); my $val8=param("reOS"); my $val9=param("reText"); my $val10=param("upBrand"); my $val11=param("upModel"); my $val12=param("upAge"); my $val13=param("upCPU"); my $val14=param("upHDD"); my $val15=param("upHDC"); my $val16=param("upRAM"); my $val17=param("upOS"); my $val18=param("upText"); my $val19=param("compNum"); my $val20=param("roomNum"); my $val21=param("foot"); my $val22=param("netType"); my $val23=param("line"); my $val24=param("ISP"); my $val25=param("win9x"); my $val26=param("winXP"); my $val27=param("win2000"); my $val28=param("linux"); my $val29=param("fileShare"); my $val30=param("printShare"); my $val31=param("netShare"); my $val32=param("fileSec"); my $val33=param("netBack"); my $val34=param("gaming"); my $val35=param("netText"); my $val36=param("custname"); my $val37=param("email"); my $val38=param("street"); my $val39=param("city"); my $val40=param("state"); my $val41=param("zip"); my $val42=param("country"); my $val43=param("phone"); my $val44=param("comments"); ######################################################## # These are the Arrays created to hold # # the of the varialbes: # # valueArray contains the variables and their values # # nameArray contains the names of the hidden fields # ######################################################## my @valueArray=($val1, $val2, $val3, $val4, $val5, $val6, $val7, $val8, $val9, $val10, $val11, $val12, $val13, $val14, $val15, $val16, $val17, $val18, $val19, $val20, $val21, $val22, $val23, $val24, $val25, $val26, $val27, $val28, $val29, $val30, $val31, $val32, $val33, $val34, $val35, $val36, $val37, $val38, $val39, $val40, $val41, $val42, $val43, $val44,); my @nameArray=('reBrand', 'reModel', 'reAge', 'reCPU', 'reHDD', 'reHDC', 'reRAM', 'reOS', 'reText', 'upBrand', 'upModel', 'upAge', 'upCPU', 'upHDD', 'upHDC', 'upRAM', 'upOS', 'upText', 'compNum', 'roomNum', 'foot', 'netType', 'line', 'ISP', 'win9x', 'winXP', 'win2000', 'linux', 'fileShare', 'printShare', 'netShare', 'fileSec', 'netBack', 'gaming', 'netText', 'custname', 'email', 'street', 'city', 'state', 'zip', 'country', 'phone', 'comments'); print< Tornado Interactive: Contact Information
      In need of help? This is the right place to be! Here you can tell us if you are having problems with your service. Or if you aren't a customer yet, and would like to be, you can contact us through here as well! Remember, the more information you provide, the easier it will be for us to help you!
      *Required Fields
      Full Name:*
      Email Address:*
      Address:
      City:
      State:
      Postal Code:
      Country:
      Phone Number:
      Requests:
      PAGE_TWO ############################################### # This section is a loop created to # # print hidden fields containing the values # # of the previous form so that they may # # be passed to the next subroutine. # ############################################### for ($i=0;$i<45;$i++) { my $enough=length($valueArray[$i]); next if($enough == 0); print " \n"; } print< PAGE_TWOB } ############################################ # Eventually this subroutine will display # # A confirmation page and a also contain # # A sendmail program, but right now I am # # Just using it to test the display of # # the data and the functionality of the # # form. # ############################################ sub pagefour { ############################################# # Again the values from the form. # # Eventually I will add in the values # # for the contact information page as # # well. # ############################################# my $val1=param("reBrand"); my $val2=param("reModel"); my $val3=param("reAge"); my $val4=param("reCPU"); my $val5=param("reHDD"); my $val6=param("reHDC"); my $val7=param("reRAM"); my $val8=param("reOS"); my $val9=param("reText"); my $val10=param("upBrand"); my $val11=param("upModel"); my $val12=param("upAge"); my $val13=param("upCPU"); my $val14=param("upHDD"); my $val15=param("upHDC"); my $val16=param("upRAM"); my $val17=param("upOS"); my $val18=param("upText"); my $val19=param("compNum"); my $val20=param("roomNum"); my $val21=param("foot"); my $val22=param("netType"); my $val23=param("line"); my $val24=param("ISP"); my $val25=param("win9x"); my $val26=param("winXP"); my $val27=param("win2000"); my $val28=param("linux"); my $val29=param("fileShare"); my $val30=param("printShare"); my $val31=param("netShare"); my $val32=param("fileSec"); my $val33=param("netBack"); my $val34=param("gaming"); my $val35=param("netText"); my $val36=param("custname"); my $val37=param("email"); my $val38=param("street"); my $val39=param("city"); my $val40=param("state"); my $val41=param("zip"); my $val42=param("country"); my $val43=param("phone"); my $val44=param("comments"); ############################################# # The same array's as before but with an # # additional array: # # discArray displays the description for # # the values rather than the name of # # the fields that they are in. # ############################################# my @valueArray=($val1, $val2, $val3, $val4, $val5, $val6, $val7, $val8, $val9, $val10, $val11, $val12, $val13, $val14, $val15, $val16, $val17, $val18, $val19, $val20, $val21, $val22, $val23, $val24, $val25, $val26, $val27, $val28, $val29, $val30, $val31, $val32, $val33, $val34, $val35, $val36, $val37, $val38, $val39, $val40, $val41, $val42, $val43, $val44); my @nameArray=('reBrand', 'reModel', 'reAge', 'reCPU', 'reHDD', 'reHDC', 'reRAM', 'reOS', 'reText', 'upBrand', 'upModel', 'upAge', 'upCPU', 'upHDD', 'upHDC', 'upRAM', 'upOS', 'upText', 'compNum', 'roomNum', 'foot', 'netType', 'line', 'ISP', 'win9x', 'winXP', 'win2000', 'linux', 'fileShare', 'printShare', 'netShare', 'fileSec', 'netBack', 'gaming', 'netText', 'custname', 'email', 'street', 'city', 'state', 'zip', 'country', 'phone', 'comments'); my @discArray=('Brand', 'Model', 'Age', 'CPU', 'HDD Size', 'HDD Capacity', 'RAM', 'OS', 'Comments', 'Brand', 'Model', 'Age', 'CPU', 'HDD Size', 'HDD Capacity', 'RAM', 'OS', 'Comments', 'Number of Computers', 'Number of Rooms', 'Footage', 'Type of Network', 'Line', 'ISP', 'Windows 95/98/ME', 'Windows XP', 'Windows 2000', 'Linux', 'File Sharing', 'Print Sharing', 'Internet Sharing', 'Files Security', 'Network Backup', 'Network Gaming', 'Comments', 'Name', 'Email', 'Street', 'City', 'State', 'Zip', 'Country', 'Phone', 'Comments'); my $i=0; my $k=9; my $m=18; my $m2=24; my $m3=28; my $c=35; my $x=0; my $y=9; my $z=18; my $z2=35; my $reLen=0; my $upLen=0; my $netLen=0; my $conLen=0; ################################################ # This section tests for the length of the # # three sections again, and stores the length # # in the corresponding variable. # ################################################ for ($x=0;$x<8;$x++) { my $enough=0; $enough=length($valueArray[$x]); $reLen=$reLen+$enough; } for ($y=9;$y<18;$y++) { my $enough=0; $enough=length($valueArray[$y]); $upLen=$upLen+$enough; } for ($z=18;$z<34;$z++) { my $enough=0; $enough=length($valueArray[$z]); $netLen=$netLen+$enough; } for ($z2=35;$z2<45;$z2++) { my $enough=0; $enough=length($valueArray[$z2]); $conLen=$conLen+$enough; } my $namEnough=length($val36); my $mailEnough=length($val37); if ($namEnough < 1 || $mailEnough < 1) { print< Tornado Interactive: Insufficient Data!
      Insufficient Data!

      The following required information is not complete:
        PAGE_INSU if ($namEnough < 1) { print "
      • Name
      • \n"; } if ($mailEnough < 1) { print "
      • Email
      • \n"; } print "

      \n"; for ($i=0;$i<45;$i++) { print " \n"; } print "
      \n"; print<
      PAGE_INSU2 } else { print< Tornado Interactive: Verify Your Entry
      Please take a few seconds to look over your contact information. If we don't have your correct information, then we cannot contact you regarding your request. If you need to make any changes, the Bext Button. Or, if everything is correct, simply click the Next Button to submit your request!
      PAGE_THREE ############################################### # Here I use if statements to test if there # # are any vaules in the separate sections of # # the form. If there are values it prints # # a heading and a bulleted list of the # # values that were entered. If not, the # # heading and list is skipped. The first one # # is broken down with comments. # ############################################### ######################################################### # if statement that checks to see if there are values # ######################################################### if ($conLen > 0) { print<
      Contact Info:
        CONLEN for ($c=35;$c<46;$c++) { my $enough=length($valueArray[$c]); next if ($enough == 0); print "
      • $discArray[$c]\: $valueArray[$c]\n"; } print "
      "; } my $num1=0; for ($num1=0;$num1<45;$num1++) { my $enough=length($valueArray[$num1]); next if ($enough == 0); print " \n"; } print<
      PAGE_THREEC } } sub pagefive { print< Tornado Interactive: Thanks!
      Thank you for submitting your request to us! We look forward to working with you in the near future. In a few moments you should receive a confirmation E-Mail notifying you that your request was received. Typical response time is within 24 hours.

      PAGE_THANKS } sub sendmail { my $val1=param("reBrand"); my $val2=param("reModel"); my $val3=param("reAge"); my $val4=param("reCPU"); my $val5=param("reHDD"); my $val6=param("reHDC"); my $val7=param("reRAM"); my $val8=param("reOS"); my $val9=param("reText"); my $val10=param("upBrand"); my $val11=param("upModel"); my $val12=param("upAge"); my $val13=param("upCPU"); my $val14=param("upHDD"); my $val15=param("upHDC"); my $val16=param("upRAM"); my $val17=param("upOS"); my $val18=param("upText"); my $val19=param("compNum"); my $val20=param("roomNum"); my $val21=param("foot"); my $val22=param("netType"); my $val23=param("line"); my $val24=param("ISP"); my $val25=param("win9x"); my $val26=param("winXP"); my $val27=param("win2000"); my $val28=param("linux"); my $val29=param("fileShare"); my $val30=param("printShare"); my $val31=param("netShare"); my $val32=param("fileSec"); my $val33=param("netBack"); my $val34=param("gaming"); my $val35=param("netText"); my $val36=param("custname"); my $val37=param("email"); my $val38=param("street"); my $val39=param("city"); my $val40=param("state"); my $val41=param("zip"); my $val42=param("country"); my $val43=param("phone"); my $val44=param("comments"); my $sendmail="/usr/sbin/sendmail -t"; my $i=0; my $k=9; my $m=18; my $m2=24; my $m3=28; my $c=35; my $x=0; my $y=9; my $z=18; my $z2=35; my $reLen=0; my $upLen=0; my $netwLen=0; my $conLen=0; ############################################# # The same array's as before but with an # # additional array: # # discArray displays the description for # # the values rather than the name of # # the fields that they are in. # ############################################# my @valueArray=($val1, $val2, $val3, $val4, $val5, $val6, $val7, $val8, $val9, $val10, $val11, $val12, $val13, $val14, $val15, $val16, $val17, $val18, $val19, $val20, $val21, $val22, $val23, $val24, $val25, $val26, $val27, $val28, $val29, $val30, $val31, $val32, $val33, $val34, $val35, $val36, $val37, $val38, $val39, $val40, $val41, $val42, $val43, $val44); my @nameArray=('reBrand', 'reModel', 'reAge', 'reCPU', 'reHDD', 'reHDC', 'reRAM', 'reOS', 'reText', 'upBrand', 'upModel', 'upAge', 'upCPU', 'upHDD', 'upHDC', 'upRAM', 'upOS', 'upText', 'compNum', 'roomNum', 'foot', 'netType', 'line', 'ISP', 'win9x', 'winXP', 'win2000', 'linux', 'fileShare', 'printShare', 'netShare', 'fileSec', 'netBack', 'gaming', 'netText', 'custname', 'email', 'street', 'city', 'state', 'zip', 'country', 'phone', 'comments'); my @discArray=('Brand', 'Model', 'Age', 'CPU', 'HDD Size', 'HDD Capacity', 'RAM', 'OS', 'Comments', 'Brand', 'Model', 'Age', 'CPU', 'HDD Size', 'HDD Capacity', 'RAM', 'OS', 'Comments', 'Number of Computers', 'Number of Rooms', 'Footage', 'Type of Network', 'Line', 'ISP', 'Windows 95/98/ME', 'Windows XP', 'Windows 2000', 'Linux', 'File Sharing', 'Print Sharing', 'Internet Sharing', 'Files Security', 'Network Backup', 'Network Gaming', 'Comments', 'Name', 'Email', 'Street', 'City', 'State', 'Zip', 'Country', 'Phone', 'Comments'); my $to="Josh\@TornadoInteractive.com"; my $to2="Matt\@TornadoInteractive.com"; my $to3="Support\@TornadoInteractive.com"; open (MAIL, "|$sendmail") || die "Can't start sendmail: $!"; print MAIL< 0) { ############################################### # If there are values it prints the heading # ############################################### print MAIL "Repair:\n"; ########################## # Loop to print values # ########################## for ($i=0;$i<9;$i++) { ################################################# # Checks the length of the each field's value # ################################################# my $enough=length($valueArray[$i]); ############################################################# # If the value is 0, the increment on the loop is skipped # # and that value and description in the arrays won't show # # up. # ############################################################# next if ($enough == 0); ###################################### # Prints the description and value # ###################################### print MAIL " $discArray[$i]\: $valueArray[$i]\n"; } #################################################### # Prints the closing tags for the bulleted lists # #################################################### print MAIL "\n"; } if ($upLen > 0) { print MAIL "Upgrade:\n"; for ($k=9;$k<18;$k++) { my $enough=length($valueArray[$k]); next if ($enough == 0); print MAIL " $discArray[$k]\: $valueArray[$k]\n"; } print MAIL "\n"; } my $mLen=0; my $osLen=24; my $nLen=0; my $netLen=28; for ($osLen=24;$osLen<28;$osLen++) { my $enough=length($valueArray[$osLen]); $mLen=$mLen+$enough; } for ($netLen=28;$netLen<35;$netLen++) { my $enough=length($valueArray[$netLen]); $nLen=$nLen+$enough; } if ($netwLen > 0) { print MAIL "Networking:\n"; for ($m=18;$m<24;$m++) { my $enough=length($valueArray[$m]); if ($discArray[$m] =~ "Type of Network") { if ($valueArray[$m] =~ "PtP") { print MAIL " $discArray[$m]\: Peer-to-Peer\n"; } elsif ($valueArray[$m] =~ "CS") { print MAIL " $discArray[$m]\: Client-Server\n"; } else { print MAIL " No Network Type Selected\n"; } } else { next if ($enough == 0); print MAIL " $discArray[$m]\: $valueArray[$m]\n"; } } print MAIL " Operating Systems\:\n"; for ($m2=24;$m2<28;$m2++) { if ($valueArray[$m2] =~ "on") { print MAIL " $discArray[$m2]\n"; } } if ($mLen == 0) { print MAIL " No Operating System Selected!\n"; } print MAIL " Network Features:\n"; for ($m3=28;$m3<34;$m3++) { my $enough=length($valueArray[$m3]); next if ($enough == 0); print MAIL " $discArray[$m3]\n"; } if ($nLen == 0) { print MAIL " No Network Features Selected!"; } print MAIL " $discArray[34]\: $valueArray[34] \n\n"; } if ($conLen > 0) { print MAIL "Contact Info:\n"; for ($c=35;$c<44;$c++) { my $enough=length($valueArray[$c]); next if ($enough == 0); print MAIL " $discArray[$c]\: $valueArray[$c]\n"; } print MAIL "\n"; } ##################### # This is the end # ##################### print MAIL "TORNADO INTERACTIVE IS THE SHIZNITT!!!!!!!!"; close(MAIL); open (MAIL, "|$sendmail") || die "Can't start sendmail: $!"; print MAIL< 0) { ############################################### # If there are values it prints the heading # ############################################### print MAIL "Repair:\n"; ########################## # Loop to print values # ########################## for ($i=0;$i<9;$i++) { ################################################# # Checks the length of the each field's value # ################################################# my $enough=length($valueArray[$i]); ############################################################# # If the value is 0, the increment on the loop is skipped # # and that value and description in the arrays won't show # # up. # ############################################################# next if ($enough == 0); ###################################### # Prints the description and value # ###################################### print MAIL " $discArray[$i]\: $valueArray[$i]\n"; } #################################################### # Prints the closing tags for the bulleted lists # #################################################### print MAIL "\n"; } if ($upLen > 0) { print MAIL "Upgrade:\n"; for ($k=9;$k<18;$k++) { my $enough=length($valueArray[$k]); next if ($enough == 0); print MAIL " $discArray[$k]\: $valueArray[$k]\n"; } print MAIL "\n"; } my $mLen=0; my $osLen=24; my $nLen=0; my $netLen=28; for ($osLen=24;$osLen<28;$osLen++) { my $enough=length($valueArray[$osLen]); $mLen=$mLen+$enough; } for ($netLen=28;$netLen<35;$netLen++) { my $enough=length($valueArray[$netLen]); $nLen=$nLen+$enough; } if ($netwLen > 0) { print MAIL "Networking:\n"; for ($m=18;$m<24;$m++) { my $enough=length($valueArray[$m]); if ($discArray[$m] =~ "Type of Network") { if ($valueArray[$m] =~ "PtP") { print MAIL " $discArray[$m]\: Peer-to-Peer\n"; } elsif ($valueArray[$m] =~ "CS") { print MAIL " $discArray[$m]\: Client-Server\n"; } else { print MAIL " No Network Type Selected\n"; } } else { next if ($enough == 0); print MAIL " $discArray[$m]\: $valueArray[$m]\n"; } } print MAIL " Operating Systems\:\n"; for ($m2=24;$m2<28;$m2++) { if ($valueArray[$m2] =~ "on") { print MAIL " $discArray[$m2]\n"; } } if ($mLen == 0) { print MAIL " No Operating System Selected!\n"; } print MAIL " Network Features:\n"; for ($m3=28;$m3<34;$m3++) { my $enough=length($valueArray[$m3]); next if ($enough == 0); print MAIL " $discArray[$m3]\n"; } if ($nLen == 0) { print MAIL " No Network Features Selected!"; } print MAIL " $discArray[34]\: $valueArray[34] \n\n"; } if ($conLen > 0) { print MAIL "Contact Info:\n"; for ($c=35;$c<44;$c++) { my $enough=length($valueArray[$c]); next if ($enough == 0); print MAIL " $discArray[$c]\: $valueArray[$c]\n"; } print MAIL "\n"; } ##################### # This is the end # ##################### print MAIL "We look forward to working with you in the near future!\n\n"; print MAIL "Thank you,\n"; print MAIL "Matthew Maynes\n"; print MAIL "Josh Burns\n"; print MAIL "Owners, Tornado Interactive"; close(MAIL); } }