#! /usr/local/bin/perl # # File : Reg.cgi # Purpose : A cgi script is aimed for on-line registration # # Author : Tony # Date : 04/18/96 - # # History : require "Reg.ph"; dbmopen(%DATA, $FileReg, 0644); $msg=0; &days(); &GetTime(); $mon+=1; $tck[$query->param(type)]='checked'; if ($query->param(pay) eq '' && $query->param(cno) !~/^[ ]*$/){ $query->param(pay,'1'); } if ($mon < $regmonth){ $reg='0'; $faxmsg='('.$REGDATE{'1'}.' US$'.$RFee[1].')'; }elsif($mon eq $regmonth && $mday <= $regday){ $reg='0'; $faxmsg='('.$REGDATE{'1'}.' US$'.$RFee[1].')'; }else{ $reg='1'; } $treg=$reg+$query->param(type); $retypemail=0; if ($query->param(Submit) eq 'Send'){ $email=$query->param(email); $email=~s/[ ]*//g; $email2=$query->param(email2); $email2=~s/[ ]*//g; if ($email ne $email2){ $retypemail=1; } } $~=Title; write; #$rr=$query->param(cname); #print ("##$tt,$rr##$test"); $id=$query->param(id); if (!$query->param) { # get a key(id) $flag='1'; while ($flag eq '1'){ open (ID,"$DBDIR/regid"); ($id,$x)=split(/\n/,); close ID; open ID,">$DBDIR/regid"; print ID ($id+1,"\n"); close ID; if ($id < 1000 ){ $id=1000; } if ($DATA{$id} eq ''){$flag='0';} } $~=RegForm; write; }elsif ($query->param(fname) =~/^[ ]*$/ || $query->param(lname) =~/^[ ]*$/ || $query->param(company) =~/^[ ]*$/ || $query->param(address) =~/^[ ]*$/ || $query->param(city) =~/^[ ]*$/ || $query->param(email) =~/^[ ]*$/ || $query->param(email) !~/[@]/ || $query->param(country) =~/^[ ]*$/ || $retypemail ) { if ($query->param(fname) =~/^[ ]*$/){ $string.='first name, '; } if ($query->param(lname) =~/^[ ]*$/){ $string.='last name, '; } if ($query->param(company) =~/^[ ]*$/){ $string.='University/Company, '; } if ($query->param(address) =~/^[ ]*$/){ $string.='Street Address, '; } if ($query->param(city) =~/^[ ]*$/){ $string.='City, '; } if ($query->param(country) =~/^[ ]*$/){ $string.='Country, '; } if ($query->param(email) =~/^[ ]*$/){ $string.='e-mail, '; } chop($string); chop($string); print ("
"); if ($string ne ''){ print ("Please enter your $string information."); } if ($query->param(email) !~/[@]/){ print ("
Your email format is incorrect, please check it."); }elsif ($retypemail){ print ("
Your two E-mails don't match, please check it."); } print ("
"); $~=RegForm; write; }elsif ($query->param(Submit) eq 'Send'){ $~=RegEnd; write; $~=Hidden; write; }elsif ($query->param(Submit) eq 'continue'){ &GetRoom; $~=PayForm; write; $~=Hidden; write; }elsif ($query->param(pay) eq ''){ print ("
Please select one method to pay!
"); &GetRoom; $~=PayForm; write; $~=Hidden; write; }elsif( ($query->param(room) ne '10') && ( (($query->param(tomonth) eq $query->param(frommonth) ) && ( $query->param(today) <= $query->param(fromday) )) || ($query->param(tomonth) < $query->param(frommonth) ) )){ print ("
Invalid check-in or check-out date!!
"); &GetRoom; $~=PayForm; write; $~=Hidden; write; }elsif($query->param(pay) < 9 && &CardCheck($query->param(cno))){ print ("
Invalid Card Number!!
"); &GetRoom; $~=PayForm; write; $~=Hidden; write; }elsif($query->param(pay) < 9 && ($query->param(expire)=~/^[ ]*$/ || $query->param(cname)=~/^[ ]*$/)){ print ("
Please enter your credit card Expiration date and Cardholder Name!!
"); NoRoom: &GetRoom; $~=PayForm; write; $~=Hidden; write; }elsif($query->param(pay) < 9 && $query->param(expire) !~/^[0-9\/ ]*$/){ print ("
Please check your credit card Expiration date format!!
"); NoRoom: &GetRoom; $~=PayForm; write; $~=Hidden; write; }else{ if ($query->param(r_title) =~/^[ ]*$/){ $query->param('r_title',$query->param(fname).' '.$query->param(lname)); } &GetRoom; $room=$query->param(room); $id=$query->param(id); if ($DATA{$id} ne '' || $id eq ''){ UnPackData(\%REG,\$DATA{$id}); if ($REG{fname} ne $query->param(fname) || $REG{lname} ne $query->param(lname)|| $id eq ''){ $flag='1'; while ($flag eq '1'){ open (ID,"$DBDIR/regid"); ($id,$x)=split(/\n/,); close ID; open ID,">$DBDIR/regid"; print ID ($id+1,"\n"); close ID; if ($id < 1000 ){ $id=1000; } if ($DATA{$id} eq ''){$flag='0';} } } } if ($query->param(room) > 10) { #住宿 # 計算住宿天數 if ($query->param(frommonth) eq $query->param(tomonth)) { $days=$query->param(today)-$query->param(fromday); }else { $days=$thisyear[$query->param(frommonth)-1]-$query->param(fromday); for ($x=$query->param(frommonth); $x < $query->param(tomonth)-1 ;$x++){ $days+=$thisyear[$query->param(frommonth) ]; } $days+=$query->param(today); } $RoomFee.="
Please pay the rent at the front desk of the activity center.

"; if ($days <= 0){ print ("
Invalid check-in or check-out date!!
"); goto NoRoom; } if ($ROOM[$room-11] <= 0){ print ("
$HOTEL{$room} was all reserved.
"); goto NoRoom; }else{ open FILE,">>$DBDIR/REG.ROOM"; $ROOM[$room-11]-=1; print FILE join('`',@ROOM); print FILE ":".$query->param(fname).' '.$query->param(lname).":".$query->param(company).":$id\n"; close FILE; } $HotelInfo="

As for hotel accommodation, we will forward your reservation to the hotel.
"; $HotelInfo.="The hotel staff will handle it in batch and contact you directly around
"; $HotelInfo.="November 15. The contact information of the hotel is as follows:

"; $HotelInfo.="Hotel: $HOTEL{$room}
"; $HotelInfo.="Contact person: $HotelContactP{$room}
"; if ($HotelContactE{$room} ne ''){ $HotelInfo.="E-Mail: $HotelContactE{$room}
"; } $HotelInfo.="Telephone: $HotelContactT{$room}
"; $HotelInfo.="Fax: $HotelContactF{$room}

"; }else{ $query->delete(partner); $query->delete(frommonth); $query->delete(fromday); $query->delete(tomonth); $query->delete(today); } # calculate fee $sum=0; $sum+=$RFee[$treg]+$CFee[$reg]*$query->param(com)+$PFee[$reg]*$query->param(pro)+$PageFee*$query->param(page); if ($query->param(pay) eq 9){ # $now=$year.'/'.$mon.'/'.$mday; $PayMethod.="The registration fee is US\$$sum.$faxmsg"; $PayMethod.="
Since you are choosing faxing us the credit card information,
"; $PayMethod.="Please fill in this page and FAX to the conference secretary,
"; $PayMethod.="Miss Cathy Lin 886-2-27824814

"; $PayMethod.="
Credit Card # : ________________________"; $PayMethod.="
Expiration Date : ________________________"; $PayMethod.="
Cardholder Name : ________________________"; $PayMethod.="
Signature :________________________

"; }else{ $PayMethod="We now receive your credit card information for the registration fee US\$$sum.

"; } # if ($query->param(room) ne '10'){ # $hotel.='

Hotel check-in date : '.$query->param(frommonth).'/'.$query->param(fromday).' , check-out date : '.$query->param(tomonth).'/'.$query->param(today).' , Total : '.$days.' night(s)'; # } $query->delete(Submit); $query->delete(id); if ($query->param(pay) eq 9){ $query->delete(cno); $query->delete(expire); $query->delete(cname); $query->delete(cdate); } $~=EndMsg; write; $DATA{$id} = $query->query_string; $mailto=$query->param(email); open TEMP,">mail.tmp"; print TEMP "Reply-to:isaac-adm\@iis.sinica.edu.tw \n"; print TEMP "From:isaac-adm\@iis.sinica.edu.tw \n"; print TEMP "To:$mailto \n"; print TEMP "Subject:ISAAC00 Registration \n\n"; $tempstr=$SEX{$query->param(sex)}." ".$query->param(lname).','; print TEMP "Dear $tempstr\n\n"; print TEMP " Thank you for registering ISAAC00. Your registration ID is $id.\n"; if ($query->param(pay) < 9){ $PayMethod=~s/

/\n\n/g; print TEMP "$PayMethod"; }else{ print TEMP "The registration fee is US\$$sum.$faxmsg\n\n"; } if ($HotelInfo ne ''){ $HotelInfo=~s/
/\n/g; $HotelInfo=~s/

/ /g; print TEMP "$HotelInfo\n\n"; } print TEMP "If you need our assistance, please do not hesitate to let us know.\n\n"; print TEMP "Look forward to seeing you in Taipei.\n\n"; print TEMP "Sincerely\,\n"; print TEMP "ISAAC00 Organizing Committees\n"; close TEMP; system("/usr/bin/mail -f isaac-adm\@iis.sinica.edu.tw $mailto < mail.tmp"); system("/usr/bin/mail -f isaac-adm\@iis.sinica.edu.tw $mailto < isaac-letter") ; if ($query->param(room) > 10){ open TEMP,">mail2.tmp"; print TEMP "Reply-to:$iisContact \n"; print TEMP "From:$iisContact \n"; print TEMP "To:$HotelContactE{$room} \n"; print TEMP "Cc:$iisContact \n"; print TEMP "Subject:ISAAC00 Conference 預訂房間\n\n"; print TEMP "Dear $HotelContactP{$room} \n\n"; print TEMP " 以下是ISAAC00與會人員要預訂貴飯店的房間,煩請處理.\n"; print TEMP "=====================================================\n"; print TEMP "First Name: ".$query->param(fname)."\n"; print TEMP "Last Name: ".$query->param(lname)."\n"; print TEMP " Address: ".$query->param(address)."\n"; print TEMP " Country: ".$query->param(country)."\n"; print TEMP " Tel: ".$query->param(tel)."\n"; print TEMP " Fax: ".$query->param(fax)."\n"; print TEMP " Email: ".$query->param(email)."\n"; print TEMP " Hotel: $HOTEL{$room}\n"; print TEMP " check-in: ".$query->param(frommonth).'/'.$query->param(fromday)."\n"; print TEMP " check-out: ".$query->param(tomonth).'/'.$query->param(today)."\n"; print TEMP "=====================================================\n"; print TEMP "中研院資訊所 林貞妙 電話:(02)27883799分機2216\n"; close TEMP; if ($HotelContactE{$room} eq ''){ system("/usr/bin/mail -f $iisContact $iisContact < mail2.tmp"); # system("/usr/bin/mail -f $iisContact feng\@iis < mail2.tmp"); }else{ system("/usr/bin/mail -f $iisContact $HotelContactE{$room} < mail2.tmp"); # system("/usr/bin/mail -f $iisContact feng\@iis < mail2.tmp"); system("/usr/bin/mail -f $iisContact $iisContact < mail2.tmp"); } } } dbmclose(%DATA);