#!/usr/bin/perl -s # submit.pl # --------- # Beta tester's submission page. require 'vxcgi.pl'; require 'vxcookie.pl'; require 'vxmail.pl'; require 'vxform.pl'; require 'globals.pl'; $title = "Puzzlepalooza Bug Submission Form"; %os = ( 'a1' => 'ME', 'a2' => '98', 'a3' => '95', 'n2p' => '2000 Professional', 'n2s' => '2000 Server', 'n2x' => 'XP (Beta)', 'n3' => 'NT 3.x', 'n4' => 'NT 4.x', ); %ver = ( '0.90' => '0.90', '0.91' => '0.91', '0.92' => '0.92', '0.93' => '0.93', '0.94' => '0.94', '0.95' => '0.95', '0.96' => '0.96', '0.97' => '0.97', '0.98' => '0.98', '0.99' => '0.99', ); %colors = ( '1' => 'True Color (24 or 32 bit mode)', '2' => 'High Color (16 bit mode)', '3' => '256 Colors (8 bit mode)', 'unk' => '(Unknown)', ); %res = ( '0640' => '640x480', '0800' => '800x600', '1024' => '1024x768', '1152' => '1152x864', '1280' => '1280x1024', '1600' => '1600x1200+', 'other' => '(Other)', 'unk' => '(Unknown)', ); %sev = ( '1' => 'Suggestion', '2' => 'Aesthetics issue', '3' => 'Tuning / efficiency issue', '4' => 'Miscellaneous bug', '5' => 'Program aborts with an error message', '6' => 'Program aborts with "Debug assertion failed!"', '7' => 'Program aborts with a system error message', '8' => 'Program hangs', '9' => 'Entire system hangs', ); cgi_vars(); #$submitted = '1'; #$name = 'Mike Lorenz'; #$email = 'mlorenz@visionx.com'; #$os = 'n2p'; #$ver = '0.9'; #$colors = '1'; #$res = '1024'; #$sev = '5'; #$vcard = 'ELSA'; #$where = 'Somewhere'; #$subject = 'The program crashes'; #$desc = 'Long description goes here'; if (!$submitted) { cgi_header(); header(); get_cookies(); if (!$name) { $name = $cookies{pp_name} } if (!$email) { $email = $cookies{pp_email} } print <<".";


. print <<".";

. $res = $cookies{pp_res} ? $cookies{pp_res} : '1024'; $sev = $cookies{pp_sev} ? $cookies{pp_sev} : '4'; form_text ('Your Name', 'name', $name, 40); form_text ('Your Email Address', 'email', $email, 40); form_drop_id('Windows Version', 'os', $cookies{pp_os}, \%os); form_drop_id('Puzzle Program Version', 'ver', $cookies{pp_ver}, \%ver); form_text ('Video Card (brand, model)', 'vcard', $cookies{pp_vcard}, 40, 0, 'How do I find this?'); form_drop_id('Video Mode (Colors)', 'colors', $cookies{pp_colors}, \%colors, 0, 'How do I find this?'); form_drop_id('Video Resolution', 'res', $res, \%res, 0, 'How do I find this?'); print "\n"; form_drop_id('Bug Severity', 'sev', $sev, \%sev); form_text ('Where does bug occur?', 'where', $where, 50, 0, '(one sentence)'); form_text ('Summary of bug', 'subject', $subject, 80, 0, '(one sentence)'); form_edit ('Bug Description', 'desc', $desc, 70, 30, '(provide as much detail as possible)', 'soft'); print <<".";
 




Submission Tips:


  . } else # process submission { $err = ""; if (!$name) { $err .= "

Error: You must specify your name." } if (!$email) { $err .= "

Error: You must specify your email address." } if (!$vcard) { $err .= "

Error: You must specify your video card brand and type." } if (!$where) { $err .= "

Error: You must specify where the bug occurred." } if (!$subject) { $err .= "

Error: You must specify a brief description of the bug." } if (!$desc) { $err .= "

Error: You must specify a detailed description of the bug." } $s = email_error($email); if ($s) { $err .= "

Error: $s" } if ($err) { fatal("$error") } set_cookie('pp_name', $name, 90); set_cookie('pp_email', $email, 90); set_cookie('pp_os', $os, 90); set_cookie('pp_ver', $ver, 90); set_cookie('pp_vcard', $vcard, 90); set_cookie('pp_colors', $colors,90); set_cookie('pp_res', $res, 90); set_cookie('pp_sev', $sev, 90); $msg = <<"."; Name ............ $name Email ........... $email Win Version ..... Windows $os{$os} PP Version ...... $ver{$ver} Video Card ...... $vcard Video Colors .... $colors{$colors} Video Res ....... $res{$res} Bug Severity .... $sev - $sev{$sev} Bug Location .... $where Bug Summary ..... $subject $desc . send_email('felix@visionx.com, mlorenz@visionx.com, mricci@visionx.com', "$name <$email>", "PPBUG SEV $sev: $subject", $msg); send_email($email, 'felix@visionx.com', "PPBUG SEV $sev: $subject", "THIS IS A CONFIRMATION OF YOUR PUZZLEPALOOZA BUG REPORT:\n\n$msg"); fatal("Your bug has been reported to Felix, and a confirmation copy has been emailed to you as well. Thank you for taking the time to beta test Puzzlepalooza!"); } footer(); #------------------------------------------------- sub fatal { my ($msg) = @_; cgi_header(); header(); print <<".";
$msg
. footer(); die; } #------------------------------------------------- sub header { print <<"."; $title


$title


. } #------------------------------------------------- sub footer { print <<".";

. }