#!/usr/local/bin/perl ########################################################################### # # # Script de gestion des inscriptions pour Beaune 2002 # # # # # ########################################################################### use CGI ':all'; use CGI::Util qw(escape); use Mail::Sender; require "ctime.pl"; MAIN: { # Repertoire de base (celui qui contient la forme d'enregistrement $base_directory = "/home/www/lyoinfo/beaune"; $base_url = "http://beaune.in2p3.fr"; # $base_directory = "/home/infor/chartoir/public_html"; # $base_url = "http://lyopc128.in2p3.fr/~chartoir"; # Creation d'un objet de requete, on veut pouvoir ecrire des entites HTML $query = new CGI; $query->autoEscape(undef); # Url du script $full_url = $query->url(); if ($query->param()) { &process_this; } else { &print_form; } } # Subroutine de generation de la forme d'interogation sub print_form { #Titre de la page $titre_page = 'Registration Form'; # Ecriture du header HTML print $query->header; print $query->start_html(-title=>$titre_page, -author=>'m.chartoire@ipnl.in2p3.fr', -bgcolor=>'white'); #Titre de la page $titre_page = 'Registration Form'; # Ecriture du titre ... print $query->p(' '); print $query->start_center; print $query->h1($titre_page); print $query->end_center; print $query->p(' '); print $query->p('PAYMENT OF REGISTRATION FEE (until 05-17-02: 500 EUR - after 05-17-02: 600 EUR)'); print $query->ol(li['Bank cheque in EURO to the order of: "Trésorerie de Saclay"', 'Bank transfer (enclosed an official copy of the bank transfer) in EURO ordered to:
"CEA/ Trésorerie de Saclay/Beaune 2002" (Bank charges at your responsability).
Account n° 00021100040 - clé: 68 - Bank Code: 30004 - Guichet Code: 00086
Banque Nationale de Paris
3-5 place de la République
F-91400 ORSAY']); print $query->p('REGISTRATION FEE INCLUDE:'); print $query->ol(li{},,(['Proceedings of the conference (NIM A Special issue)', 'Coffee breaks and lunch for 5 days ', 'All social events (welcome cocktail, wine tasting, dinner at "Château de Meursault")'])); print $query->p(' '); print $query->hr({-align=>CENTER, -width=>'80%', -size=>'2', -noshade}); print $query->start_center; print $query->p('(The fields from "Surname" to "Payment by:" must be filled)'); print $query->end_center; print $query->startform(-method=>'POST', -action=>$full_url); print $query->table({-border=>'0', -cellspacing=>'10' }, Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Title', td({-align=>LEFT}, $query->popup_menu('Title', ['Mr.','Ms.','Mrs.','Dr.','Pr.'])))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Surname (Family Name)', td({-align=>LEFT}, $query->textfield(-name=>'nom', -size=>'25', -maxlength=>'50')))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'First Name ', td({-align=>LEFT}, $query->textfield(-name=>'prenom', -size=>'25', -maxlength=>'50')))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Institution/Laboratory', td({-align=>LEFT}, $query->textfield(-name=>'etablissement', -size=>'30', -maxlength=>'60')))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Address', td({-align=>LEFT}, $query->textfield(-name=>'adresse', -size=>'30', -maxlength=>'60')))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Postal Code', td({-align=>LEFT}, $query->textfield(-name=>'poste', -size=>'10', -maxlength=>'20')))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'City', td({-align=>LEFT}, $query->textfield(-name=>'ville', -size=>'25', -maxlength=>'50')))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Country', td({-align=>LEFT}, $query->textfield(-name=>'pays', -size=>'25', -maxlength=>'50')))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Phone', td({-align=>LEFT}, $query->textfield(-name=>'TEL', -size=>'25', -maxlength=>'50')))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Fax', td({-align=>LEFT}, $query->textfield(-name=>'FAX', -size=>'25', -maxlength=>'50')))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'E-mail', td({-align=>LEFT}, $query->textfield(-name=>'email', -size=>'25', -maxlength=>'50')))), ); print $query->start_center; print $query->table({-border=>'0', -cellspacing=>'10', -wdth=>'80%' }, Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Date of arrival', '
(please click to select)'), td({-align=>LEFT}, $query->popup_menu(-name=>'datea', -values=>['Unknown', 'June 16', 'June 17', 'June 18', 'June 19', 'June 20', 'June 21'], -defaults=>'June 17')), td({-align=>RIGHT}, 'Beaune time of arrival :', '
(in HH:MM 24H format please)'), td({-align=>LEFT}, $query->textfield(-name=>'timea', -size=>'5', -maxlength=>'5'))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Date of departure', '
(please click to select)'), td({-align=>LEFT}, $query->popup_menu(-name=>'dated', -values=>['Unknown', 'June 18', 'June 19', 'June 20', 'June 21'], -defaults=>'June 21')), td({-align=>RIGHT}, 'Beaune time of departure :', '
(in HH:MM 24H format please)'), td({-align=>LEFT}, $query->textfield(-name=>'timed', -size=>'5', -maxlength=>'5'))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'By', '
(please click to select)'), td({-align=>LEFT}, $query->popup_menu(-name=>'by', -values=>['Taxi', 'Train', 'Car',], -defaults=>'Taxi')), td({-align=>RIGHT}, 'Number of accompanying
person(s):
'), td({-align=>LEFT}, $query->textfield(-name=>'accomp', -size=>'2', -maxlength=>'2'))), Tr({-valign=>CENTER},td([' ',' ',' ',' '])), Tr({-valign=>CENTER}, td({-align=>RIGHT}, ' '), td({-align=>RIGHT}, 'Payment by:', '
(please click to select)'), td({-align=>LEFT}, $query->popup_menu(-name=>'fee', -values=>['Bank cheque', 'Bank transfert'], -defaults=>'Bank transfert')), td({-align=>LEFT}, ' ')), ); print $query->hr({-align=>CENTER, -width=>'80%', -size=>'3', -noshade}); print $query->p('To allow for efficient organisation, please indicate which of the following topics you are interest in:'); print $query->end_center; print $query->p(' '); print $query->p('Photodetection in : '); print $query->start_center; print $query->table({-border=>'0', -cellspacing=>'10', -wdth=>'80%', -cols=>'5' }, Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Visible'), td({-align=>LEFT}, $query->radio_group(-name=>'visible', -values=>['Yes', 'No'], -default=>'Yes')), td({},' '), td({-align=>RIGHT}, 'Photomultipliers'), td({-align=>LEFT}, $query->radio_group(-name=>'photomul', -values=>['Yes', 'No'], -default=>'Yes'))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'X'), td({-align=>LEFT}, $query->radio_group(-name=>'X', -values=>['Yes', 'No'], -default=>'Yes')), td({-align=>CENTER}, 'By:'), td({-align=>RIGHT}, 'Solid state devices'), td({-align=>LEFT}, $query->radio_group(-name=>'solid', -values=>['Yes', 'No'], -default=>'Yes'))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Gamma'), td({-align=>LEFT}, $query->radio_group(-name=>'gamma', -values=>['Yes', 'No'], -default=>'Yes')), td({},' '), td({-align=>RIGHT}, 'Hybrid photodetectors'), td({-align=>LEFT}, $query->radio_group(-name=>'hybrid', -values=>['Yes', 'No'], -default=>'Yes'))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, ' '), td({-align=>LEFT}, ' '), td({},' '), td({-align=>RIGHT}, 'Associated electronics'), td({-align=>LEFT}, $query->radio_group(-name=>'associated', -values=>['Yes', 'No'], -default=>'Yes'))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, ' '), td({-align=>LEFT}, ' '), td({},' '), td({-align=>RIGHT}, ' '), td({-align=>LEFT}, ' ')), Tr({-valign=>CENTER}, td({-align=>RIGHT}, ' '), td({-align=>LEFT}, ' '), td({-align=>CENTER},'In:'), td({-align=>RIGHT}, ' '), td({-align=>LEFT}, ' ')), Tr({-valign=>CENTER}, td({-align=>RIGHT}, ' '), td({-align=>LEFT}, ' '), td({},' '), td({-align=>RIGHT}, ' '), td({-align=>LEFT}, ' ')), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Particle Physics'), td({-align=>LEFT}, $query->radio_group(-name=>'particle', -values=>['Yes', 'No'], -default=>'Yes')), td({},' '), td({-align=>RIGHT}, 'Biology'), td({-align=>LEFT}, $query->radio_group(-name=>'biology', -values=>['Yes', 'No'], -default=>'Yes'))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Nuclear Physics'), td({-align=>LEFT}, $query->radio_group(-name=>'nuclear', -values=>['Yes', 'No'], -default=>'Yes')), td({},' '), td({-align=>RIGHT}, 'Medicine'), td({-align=>LEFT}, $query->radio_group(-name=>'medicine', -values=>['Yes', 'No'], -default=>'Yes'))), Tr({-valign=>CENTER}, td({-align=>RIGHT}, 'Astrophysics'), td({-align=>LEFT}, $query->radio_group(-name=>'astrophysics', -values=>['Yes', 'No'], -default=>'Yes')), td({},' '), td({-align=>RIGHT}, 'Industrial applications'), td({-align=>LEFT}, $query->radio_group(-name=>'other', -values=>['Yes', 'No'], -default=>'Yes'))), ); print $query->end_center; print $query->p(' '); print $query->hr({-align=>CENTER, -width=>'80%', -size=>'3', -noshade}); print $query->p(' '); print $query->p($query->submit(-name=>'B1', -value=>'submit'), '   To register on-line, please click here. '); print $query->p($query->reset, '  For a new form, please click here.  '); print $query->endform; print $query->end_html; } # Subroutine de traitement sub process_this { # Recuperation des reponses $title = $query->param('Title'); $nom = $query->param('nom'); $prenom = $query->param('prenom'); $etabli = $query->param('etablissement'); $adresse = $query->param('adresse'); $poste = $query->param('poste'); $ville = $query->param('ville'); $pays = $query->param('pays'); $tel = $query->param('TEL'); $fax = $query->param('FAX'); $email = $query->param('email'); $fee = $query->param('fee'); $datea = $query->param('datea'); $timea = $query->param('timea'); $dated = $query->param('dated'); $timed = $query->param('timed'); $by = $query->param('by'); $accomp = $query->param('accomp'); $visible = $query->param('visible'); $xx = $query->param('X'); $gamma = $query->param('gamma'); $photomul = $query->param('photomul'); $solid = $query->param('solid'); $hybrid = $query->param('hybrid'); $associa = $query->param('associated'); $particle = $query->param('particle'); $nuclear = $query->param('nuclear'); $astro = $query->param('astrophysics'); $biolo = $query->param('biology'); $medic = $query->param('medicine'); $other = $query->param('other'); #A-t'on toutes les reponses obligatoires if ( ($title eq "") || ($nom eq "") || ($prenom eq "") || ($etabli eq "") || ($adresse eq "") || ($poste eq "") || ($ville eq "") || ($pays eq "") || ($tel eq "") || # ($fax eq "") || ($email eq "") || ($datea eq "") || # ($timea eq "") || ($dated eq "") || # ($timed eq "") || ($by eq "") || # ($accomp eq "") || ($fee eq "") ) { $error = 1; &process_error; } else { &process_form; } print $query->end_html; } # Subroutine de traitement et presentation du resultat sub process_form { #Titre de la page $titre_page = 'Registration Confirmation'; # Ecriture du header HTML print $query->header; print $query->start_html(-title=>$titre_page, -author=>'m.chartoire@ipnl.in2p3.fr', -bgcolor=>'white'); #Titre de la page $titre_page = '3rd Beaune Conference'; # Ecriture du titre ... # print $query->p(' '); print $query->start_center; print $query->h1($titre_page); print $query->end_center; # Ecriture d'une ligne d'enregistrement dans le fichier a importer dans exel &write_registration; # Envoi du mail aux gestionnaires d'inscriptions &send_gestion; # Envoi du mail de confirmation &send_client; # Ecriture de la page de confirmation d'enregistrement &write_html; } # Subroutine de traitement des erreurs sub process_error { #Titre de la page $titre_page = 'Registration Form'; # Ecriture du header HTML print $query->header; print $query->start_html(-title=>$titre_page, -author=>'m.chartoire@ipnl.in2p3.fr', -bgcolor=>'white'); #Titre de la page $titre_page = 'Registration Form'; # Ecriture du titre ... print $query->p(' '); print $query->start_center; print $query->h1($titre_page); print $query->end_center; print $query->p(' '); if ($error == 1){ print $query->start_center; print $query->p('At least one mandatory field is missing !'); print $query->p('Go back and complete the form.'); print $query->end_center; } } # Subroutine d'ecriture d'une ligne d'enregistrement dans #le fichier a importer dans exel sub write_registration { $date = &ctime(time); chop $date; $ligne = "$date\t"; $ligne .= "$title\t"; $ligne .= "$nom\t"; $ligne .= "$prenom \t"; $ligne .= "$etabli\t"; $ligne .= "$adresse\t"; $ligne .= "$poste\t"; $ligne .= "$ville\t"; $ligne .= "$pays\t"; $ligne .= "$tel\t"; $ligne .= "$fax\t"; $ligne .= "$email\t"; $ligne .= "$fee\t"; $ligne .= "$datea\t"; $ligne .= "$timea\t"; $ligne .= "$dated\t"; $ligne .= "$timed\t"; $ligne .= "$by\t"; $ligne .= "$accomp\t"; $ligne .= "$visible\t"; $ligne .= "$xx\t"; $ligne .= "$gamma\t"; $ligne .= "$photomul\t"; $ligne .= "$solid\t"; $ligne .= "$hybrid\t"; $ligne .= "$associa\t"; $ligne .= "$particle\t"; $ligne .= "$nuclear\t"; $ligne .= "$astro\t"; $ligne .= "$biolo\t"; $ligne .= "$medic\t"; $ligne .= "$other\t"; open(DATAFILE, ">>$base_directory/registration/registration.data"); print DATAFILE "$ligne\n"; close(DATAFILE); } # Subroutine d'ecriture de la page de confirmation d'enregistrement sub write_html { print $query->start_center; print $query->h1('New developments in photodetection'); # print $query->p(' '); print $query->h2('Registration Confirmation'); print $query->end_center; if ( $fee eq 'Bank transfert'){ print $query->p('This page has to be print and send with an official copy of the BANK TRANSFERT by post to the beaune02 secretary:
Patricia Fauvel
CEA/SACLAY
DAPNIA/SEDI, Bât 141
F-91191 GIF/YVETTE Cedex
France
Fax : (33) 1 69 08 50 13'); } else { print $query->p('This page has to be print and send with your BANK CHEQUE by post to the beaune02 secretary:
Patricia Fauvel
CEA/SACLAY
DAPNIA/SEDI, Bât 141
F-91191 GIF/YVETTE Cedex
France
Fax : (33) 1 69 08 50 13'); } print $query->p('Fees 500 Euro (TTC) until May, 2002 and 600 Euro after'); # print $query->p(' '); print $query->p('You gave the following informations:
'); print table({-border=>'0',-cellpadding=>'2',-cellspacing=>'0', -width=>'100%', -cols=>'5'}, Tr( [ td(['Title', $title,' ',' ',' ']), td(['Surname', $nom,' ',' ',' ']), td(['First name', $prenom,' ',' ',' ']), td(['Institution/laboratory', $etabli,' ',' ',' ']), td(['Postal code', $poste,' ',' ',' ']), td(['City', $ville,' ',' ',' ']), td(['Country', $pays,' ',' ',' ']), td(['Phone', $tel,' ',' ',' ']), td(['fax', $fax,' ',' ',' ']), td(['E-mail', $email,' ',' ',' ']), td([' ',' ',' ',' ',' ']), td(['Payment by',$fee,' ',' ',' ']), td(['Date of arrival',$datea,'Time of arrival',$timea,' ']), td(['Date of departure',$dated,'Time of departure',$timed,' ']), td(['By',$by,'Number of accomp.',$accomp,' ']), ])); print $query->p(''); print $query->p('Your registration is completed. Thank you.

If your E-mail address is correct you will receive a mail confirmation of your registration.'); } # Subroutine d'envoi du mail de confirmation a la personne sub send_client { my $sender; $sender = new Mail::Sender { from => 'beaune2002@ipnl.in2p3.fr', smtp => 'lyoserv1.in2p3.fr', cc => 'm.chartoire@ipnl.in2p3.fr, h.el-mamouni@ipnl.in2p3.fr', replyto => 'beaune@ipnl.in2p3.fr'}; $sender->Open({ to => $email, subject => 'Beaune 2002 registration confirmation'}); $sender->SendLine("Thank you for your registration."); $sender->SendLine; if ( $fee eq 'Bank transfert'){ $sender->SendLine('Do not forgot to send the print copy of the Registration Confirmation web page with an official copy of the Bank Transfert by post to the beaune02 secretary:'); } else { $sender->SendLine('Do not forgot to send the print copy of the Registration Confirmation web page with your Bank Cheque by post to the beaune02 secretary:'); } $sender->SendLine('Patricia Fauvel'); $sender->SendLine('CEA/Saclay'); $sender->SendLine('DAPNIA/SEDI, Bat 141'); $sender->SendLine('F-91191 GIF/YVETTE Cedex'); $sender->SendLine('France'); $sender->SendLine('Fax : (33) 1 69 08 50 13'); $sender->SendLine; $sender->SendLine("Fees 500 Euro (TTC) until May, 2002 and 600 Euro after"); $sender->SendLine; $sender->SendLine("You gave the following informations:"); $sender->SendLine; $sender->SendLine("Identity:"); $sender->SendLine("$title $nom $prenom."); $sender->SendLine; $sender->SendLine("Institution/laboratory: $etabli"); $sender->SendLine; $sender->SendLine("Address: $adresse"); $sender->SendLine("$poste $ville"); $sender->SendLine("$pays"); $sender->SendLine; $sender->SendLine("Phone: $tel"); $sender->SendLine("Fax: $fax"); $sender->SendLine("E-mail: $email"); $sender->SendLine; $sender->SendLine("Payment by: $fee"); $sender->SendLine("Date of arrival: $datea\t Time of arrival: $timea"); $sender->SendLine("Date of departure: $dated\t Time of departure: $timed"); $sender->SendLine("By: $by\t Number of accomp.: $accomp"); $sender->SendLine; $sender->SendLine("Photodetection in :"); $sender->SendLine("Visible: $visible\t\t Photomultipliers:$photomul"); $sender->SendLine("X: $xx\t\t By:\t Solid state devices: $solid"); $sender->SendLine("Gamma: $gamma\t\t Hybrid photodetectors: $hybrid"); $sender->SendLine("\t\t\t Associated electronics: $associa"); $sender->SendLine("\t\t In:"); $sender->SendLine("Particle Physics: $particle\t Biology: $biolo"); $sender->SendLine("Nuclear Physics: $nuclear\t Medicine: $medic"); $sender->SendLine("Astrophysics: $astro\t Industrial applications: $other"); $sender->SendLine; $sender->SendLine; $sender->SendLine("Cheers."); $sender->Close; } # Subroutine d'envoi du mail aux gestionnaires d'inscription sub send_gestion { my $sendgest; $sendgest = new Mail::Sender { from => 'beaune2002@ipnl.in2p3.fr', smtp => 'lyoserv1.in2p3.fr', cc => 'm.chartoire@ipnl.in2p3.fr, h.el-mamouni@ipnl.in2p3.fr', replyto => $email}; $sendgest->Open({ to => 'beaune@ipnl.in2p3.fr', subject => "$nom $prenom Registration to conf. Beaune02"}); $sendgest->SendLine(" Nouvel enregistrement de :"); $sendgest->SendLine("$title $nom $prenom."); $sendgest->SendLine; $sendgest->SendLine("Etablissement : $etabli"); $sendgest->SendLine; $sendgest->SendLine("Adresse : $adresse"); $sendgest->SendLine("$poste $ville"); $sendgest->SendLine("$pays"); $sendgest->SendLine; $sendgest->SendLine("Telephone: $tel"); $sendgest->SendLine("Fax: $fax"); $sendgest->SendLine("E-mail: $email"); $sendgest->SendLine; $sendgest->SendLine("Paiement par : $fee"); $sendgest->SendLine("Date d'arrivee : $datea\t Heure : $timea"); $sendgest->SendLine("Date de depart : $dated\t Heure : $timed"); $sendgest->SendLine("Par : $by\t Nombre d'accompagnant: $accomp"); $sendgest->SendLine; $sendgest->SendLine("Sujets d'interets :"); $sendgest->SendLine("Visible: $visible\t\t Photomultipliers:$photomul"); $sendgest->SendLine("X: $xx\t\t By:\t Solid state devices: $solid"); $sendgest->SendLine("Gamma: $gamma\t\t Hybrid photodetectors: $hybrid"); $sendgest->SendLine("\t\t\t Associated electronics: $associa"); $sendgest->SendLine("\t\t In:"); $sendgest->SendLine("Particle Physics: $particle\t Biology: $biolo"); $sendgest->SendLine("Nuclear Physics: $nuclear\t Medicine: $medic"); $sendgest->SendLine("Astrophysics: $astro\t Industrial applications: $other"); $sendgest->SendLine; $sendgest->Close; }