#!/usr/bin/perl =head1 NAME chik.cgi - a robot for competitions with separate starts =head1 DESCRIPTION The robot is a Web CGI interface. It must authentificate the team. If the regnumber and password are corrrect, it sends a message to the team's email and demonstrates the questions on the web. Also, it updates the field "StartTime" and sends message to the secretary "Team NN started at I" =head1 USES MySQL table Chik with the fields: CREATE TABLE Chik (RegNum Int NOT NULL, Name TINYTEXT, Password TINYTEXT, Email TINYTEXT, Started ENUM('Y','N') DEFAULT 'N', StartDate TIMESTAMP(14), Unique(RegNum)); It expects to find the file F<../../cfg/chik/questions.cfg>, with the questions, with the headers and F<../../cfg/chik/f.cfg> with the footers. =head1 AUTHOR Boris Veytsman =head1 DATE $Date: 2000/11/01 04:06:49 $ =head1 VERSION $Revision: 1.2 $ =cut use strict; use CGI qw/:standard/; use DBI; my $secretary="elir\@immisrael.com"; my $SENDMAIL = "/usr/sbin/sendmail"; my $questions = "../../cfg/chik/q.txt"; my $header = "../../cfg/chik/h.html"; my $footer = "../../cfg/f.html"; my $query=new CGI; print $query->header; print $query->start_html(-title=>'Robot turnira CHIK',-bgcolor=>'#fff0e0'); print Include_virtual("../dimrub/db/reklama.html"); print $query->h1({'-align'=>'center'},'Робот турнира ЧИК'); open(HEADER,$header); print
; close HEADER; print "

Сейчас на куличках ", `date`,"

\n"; if ($query->param('Look')) { print_list($query); $query->delete('Look'); } elsif ($query->param('Start')) { $query->delete('Start'); print_questions($query); } print_query($query); open(FOOTER,$footer); print