MADI (STU)  and IGIP annual conference in Moscow

Registration

If you allready registered, you may enter the personal page or look at bill.

#!/usr/bin/perl use DBI; use CGI::Carp qw (fatalsToBrowser); use CGI; use ZM::Template; use ZM::SSI; $DBuser="igip2008"; $DBpassword="i2g0i0p8"; $DBname="igip2008"; $DBhost="localhost"; $members_tbl="members"; #print "Cache-control: no-cache\n"; #print "Content-type: text/html; charset=windows-1251\n\n"; $CGI::POST_MAX = 10000000; $MAX_img_FILE_SIZE = 10000; $DEBUG=0; our $dbh = DBI->connect("DBI:mysql:$DBname:$DBhost",$DBuser,$DBpassword,{ PrintError => 0}) || die $DBI::errstr; our $cgi = new CGI; our $image=$cgi->param('userfile'); our $ru = $cgi->param('ru'); our $fio=$cgi->param('fio'); our $pass=$cgi->param('pass'); our $status = $cgi->param('status'); our $company=$cgi->param('company'); our $gender = $cgi->param('gender'); our $title = $cgi->param('title');; our $country =$cgi->param('country'); our $city=$cgi->param('city'); our $address=$cgi->param('address'); our $email=$cgi->param('email'); our $phone=$cgi->param('phone'); our $add_info = $cgi->param('add_info'); our $igip_num = $cgi->param('igip_num'); our $bus_hotel = $cgi->param('bus_hotel'); our $air_arrival = $cgi->param('air_arrival'); our $air_num_arrival = $cgi->param('air_num_arrival'); our $bus_airport = $cgi->param('bus_airport'); our $air_dep = $cgi->param('air_dep'); our $air_num_dep = $cgi->param('air_num_dep'); our $shuttle_remarks = $cgi->param('shuttle_remarks'); our $invoice_adress = $cgi->param('invoice_adress'); our @fldnames = (fio, pass, status, company, gender, title, country, city, address, email, phone, add_info, igip_num, bus_hotel, air_arrival, air_num_arrival, bus_airport, air_dep, air_num_dep, shuttle_remarks, invoice_adress); foreach my $n (@fldnames) { $nname = "q".$n; $$nname = $dbh->quote($$n); } if($cgi->param('do_add') ne 'Submit' && $cgi->param('do_add') ne 'Отправить') { print "Content-type: text/html; charset=windows-1251\n\n"; print form_simple(); } else { if(fields_correct()) { insert_info(); } else { print "Cache-control: no-cache\n"; print "Content-type: text/html; charset=windows-1251\n\n"; print qq(

Error in data was occured. Please check the form and try again.

); #Заполняем форму my %form; foreach my $n (@fldnames) {$form{$n} = $$n} print form_filled(\%form); } } $dbh->disconnect(); exit; ################################# sub form_simple { my $tpl = new ZM::Template; $tpl->src('./tmpl/form.tmpl'); if($ru eq 'ru') {$tpl->ru('ru')} return $tpl->htmlString; } ################################# sub form_filled { my $flds = shift; my $tpl = new ZM::Template; $tpl->src('./tmpl/form.tmpl'); foreach $fld (keys %$flds) { #Cool %) #filling form $tpl->$fld("$flds->{$fld}"); } $tpl->ru('ru') if ($ru eq 'ru'); return $tpl->htmlString; } ################################# sub fields_correct { # print "Content-type: text/html\n\n"; if ($gender ne 'male' && $gender ne 'female') {return 0} if ($status ne 'Guest' && $status ne 'Student' && $status ne 'IGIP member'&& $status ne 'Simposium participant') {return 0} # print "$_ = $$_
" foreach(qw(fio pass company country city address email phone)); if ( $fio eq '' || $pass eq '' || $company eq '' || $country eq '' || $city eq '' || $address eq '' || $email eq '' || $phone eq '' ) { return 0; } else { return 1; } } ###################################### sub insert_info { $q = "INSERT INTO `$members_tbl` ( id, fio, pass, status, company, gender, title, country, city, address, email, phone, add_info, igip_num, bus_hotel, air_arrival, air_num_arrival, bus_airport, air_dep, air_num_dep, shuttle_remarks, invoice_adress ) VALUES( '', $qfio, MD5($qpass), $qstatus, $qcompany, $qgender, $qtitle, $qcountry, $qcity, $qaddress, $qemail, $qphone, $qadd_info, $qigip_num, $qbus_hotel, $qair_arrival, $qair_num_arrival, $qbus_airport, $qair_dep, $qair_num_dep, $qshuttle_remarks, $qinvoice_adress )"; #print "Content-type: text/html\n\n"; #print $q; if($dbh->do($q)) { if($id = $dbh->{'mysql_insertid'} ) { if($image ne '') { open PFILE, ">./foto/$id.jpg"; binmode PFILE; print PFILE while (<$image>); close(PFILE); } } $tmp = new ZM::Template; if($ru eq 'ru') { $tmp->src("./ru_reg_ok.shtml"); $tmp->fio($fio); $tmp->id($id); if($gender = 'male'){$mrms = 'мистер'} else {$mrms = 'миссис'} $tmp->mrms($mrms); print "Content-type: text/html\n\n"; print $tmp->htmlString; } else { $tmp->src("./reg_ok.shtml"); $tmp->fio($fio); $tmp->id($id); if($gender = 'male'){$mrms = 'mr'} else {$mrms = 'ms'} $tmp->mrms($mrms); print "Content-type: text/html\n\n"; print $tmp->htmlString; } } else { print "Location: reg_err.shtml\n\n"; } }