#!/usr/local/bin/perl # # This reads the values from the zz-signout.html program and then # writes them to a file name 'zz-part2'. This is then combined with # zz-part1 and zz-part3 to create a new zz-signout.html file # require 'cgi-lib.pl'; &ReadParse(*in); print &PrintHeader; %map_loc_nbr = ( "",0, "In Office",1, "Lunch",2, "Out",3, "Coffee Br",4, "Mtg",5, "Vacation",6, "Sick",7, "Work-at-home",8, "Other",9); $N_names = 0; open(PART2, ">zz-part2"); while ( ($nam, $val) = each(%in) ) { ($nameP, $nbrP) = split(/_/,$nam); if ( $nbrP > $N_names ) { $N_names = $nbrP; } if ($nameP =~ /^location$/) { $nbr_val = $map_loc_nbr{$val}; print PART2 "$nameP" . "S[$nbrP] = $nbr_val \n"; } else { $val =~ s/[\r\t\n\f]/-/g; $val =~ s/\"/,/g; $val =~ s/'/,/g; print PART2 "$nameP" . "S[$nbrP] = '$val' \n"; } } $N_names++; print PART2 "var N_names = $N_names \n"; close(PART2); system("cat zz-part1 zz-part2 zz-part3 > zz-signout.html"); open(SIGNOUT,") { print "$_"; } close(SIGNOUT); exit(0);