XXVII National Meeting of Astronomy and Astrophysics (ENAA)20-21 July 2017, Lisboa, Portugal
die();
exit();
require_once($_SERVER['DOCUMENT_ROOT'] . "/../includes/smtp.php");
$tablename=$confAcronym . "_reg";
// Criar o objecto
$firstname = isset($_POST['firstname']) ? $_POST['firstname'] : NULL;
$lastname = isset($_POST['lastname']) ? $_POST['lastname'] : NULL;
$email = isset($_POST['email_reg']) ? $_POST['email_reg'] : NULL;
$affiliation = isset($_POST['affiliation']) ? $_POST['affiliation'] : NULL;
$student = isset($_POST['student']) ? $_POST['student'] : NULL;
$institute = isset($_POST['institute']) ? $_POST['institute'] : NULL;
$institute_address = isset($_POST['institute_address']) ? $_POST['institute_address'] : NULL;
$institute_vat = isset($_POST['institute_vat']) ? $_POST['institute_vat'] : NULL;
$dinner = isset($_POST['dinner']) ? $_POST['dinner'] : NULL;
$dinner_accomp = isset($_POST['dinner_accomp']) ? $_POST['dinner_accomp'] : NULL;
$food_restr = isset($_POST['food_restr']) ? $_POST['food_restr'] : NULL;
$firstname = trim($firstname);
$lastname = trim($lastname);
$email = trim($email);
$affiliation = trim($affiliation);
$student = trim($student);
$institute = trim($institute);
$institute_address = trim($institute_address);
$institute_vat = trim($institute_vat);
$dinner = trim($dinner);
$dinner_accomp = trim($dinner_accomp);
$food_restr = trim($food_restr);
$checkBoxPrivacy = isset($_POST['checkBoxPrivacy']) ? $_POST['checkBoxPrivacy'] : NULL;
$flag_done = isset($_POST['flag_done']) ? $_POST['flag_done'] : NULL;
$double = NULL;
if (isset($_POST['submit']) && $_POST['submit']) {
// Verificação dos resultados
$firstnameEmpty = !$firstname ? 1 : NULL;
$lastnameEmpty = !$lastname ? 1 : NULL;
$emailEmpty = !$email ? 1 : NULL;
$affiliationEmpty = !$affiliation ? 1 : NULL;
$instituteEmpty = !$institute ? 1 : NULL;
$institute_addressEmpty = !$institute_address ? 1 : NULL;
$institute_vatEmpty = !$institute_vat ? 1 : NULL;
if(!isset($_POST['dinner'])){
$dinnerEmpty=1;
}
if($dinner == 1){
$dinner_details = "You will attend to the conference dinner";
}else{
$dinner_details = "You will not attend to the conference dinner";
}
if($student == 1){
$student_details = "You submited your registration as a student.";
}else{
$student_details = "You did not submit your registration as a student.";
}
$email=strtolower($email);
$query = "SELECT id FROM `$tablename` WHERE email = '$email'";
$emailVerify = mysql_num_rows(mysql_query($query));
$checkBoxPrivacyEmpty = !isset($_POST['checkBoxPrivacy']) ? 1 : NULL;
$emailError= !ereg("[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]", $email) ? 1: NULL;
$firstname_db = mysql_real_escape_string($firstname);
$lastname_db = mysql_real_escape_string($lastname);
$email_db = mysql_real_escape_string($email);
$affiliation_db = mysql_real_escape_string($affiliation);
$student_db = mysql_real_escape_string($student);
$institute_db = mysql_real_escape_string($institute);
$institute_address_db = mysql_real_escape_string($institute_address);
$institute_vat_db = mysql_real_escape_string($institute_vat);
$dinner_db = mysql_real_escape_string($dinner);
$dinner_accomp_db = mysql_real_escape_string($dinner_accomp);
$food_restr_db = mysql_real_escape_string(food_restr);
if ($emailVerify > 0) {
$emailAlreadyRegistered = 1;
} else {
$emailAlreadyRegistered = NULL;
}
// introdução dos valores na base de dados em caso de nao existencia de erro
if (!$dinnerEmpty && !$firstnameEmpty && !$lastnameEmpty && !$emailEmpty && !$emailAlreadyRegistered && !$emailError && !$checkBoxPrivacyEmpty && !$affiliationEmpty) {
$sql = "INSERT INTO `$tablename` VALUES (NULL,
'$firstname_db',
'$lastname_db',
'$email_db',
'$affiliation_db',
'$student_db',
'$dinner_db',
'$dinner_accomp',
'$food_restr',
'0',
'0'
)";
$result = mysql_query($sql);
if (!$result) die(mysql_error() . "
" . $sql);
$flag_done = 1;
}
}
$textTop = "
Please fill the form below to register. Registration fee and payment details will be announced soon.
" ?>
if ((isset($_POST['submit']))){
if (isset($emailError)) $textTop.="
Please insert a valid email address!";
if (isset($emailAlreadyRegistered)) {
$textTop.="
This email is already registered.";
} elseif ($flag_done) {
$mail = new smtp();
$mail_conn = $mail->openConnection();
if (!$mail_conn) die ("Connection to SMTP unavailable.");
$mail->setFrom($confEmail);
$mail->setFromName($confSignature . " LOC");
$mail->setSubject($confSignature . " registration acknowledgment");
$mail->setTo($email_db);
$mail->setCc($confEmail);
$mail->setMessage("
Dear ". $firstname . " ". $lastname .",
This is an automated message. Your registration has been sucessfully submitted.
Please, review your application details below. You can reply to this email if you have any doubt or need to change any information. \n
Thank you.
Personal Details
Name: " . $firstname . " " . $lastname . "
E-mail: " . $email . "
Affiliation: " . $affiliation . "
" . $student_details . "
Dinner Information
" . $dinner_details . "
Accompanying Persons: " . $dinner_accomp . "
Food Restrictions: " . $food_restr . "
Best regards,
" . $confSignature . " LOC");
$mail->send();
?>
Your application has been sucessfully submitted.
An automatic email has been sent with your application details, if you don't receive it, please, send an email to xxviienaa@iastro.pt.
Thank you.
Personal Information
Name: echo $firstname . " " . $lastname; ?>
E-mail: echo $email; ?>
Affiliation: echo $affiliation; ?>
echo $student_details; ?>
Dinner Information
echo $dinner_details; ?>
Accompanying Persons: echo $dinner_accomp; ?>
Food Restrictions: echo $food_restr; ?>
Payment Details
Standard Registration - 60,00 EUR
Student Registration - 40,00 EUR
The payment is made to the Sociedade Portuguesa de Astronomia. You can proceed to the payment of the registration fee through Easypay following the button
You can also pay the registration fee via bank transfer. The bank details are:
IBAN - PT50.0035.0194.00003196330.71
BIC/SWIFT - CGDIPTPL
Please identify cleary your name in the bank transfer and mention ENAA 2017, if possible.
In order to get the invoice/receipt, please remember to insert the NIF of your institution, and it's name and address in the Observations field of the registration and payment
webpage. SPA will handle the ENAA 2017 registration fee payments, and will send the invoice/receipt to the email address provided in the registration page by the participants.
}
}
if (!$flag_done)
{
?>
echo $textTop ?>
Payment Details
Standard Registration - 60,00 EUR
Student Registration - 40,00 EUR
The payment is made to the Sociedade Portuguesa de Astronomia. You can proceed to the payment of the registration fee through Easypay following the button
You can also pay the registration fee via bank transfer. The bank details are:
IBAN - PT50.0035.0194.00003196330.71
BIC/SWIFT - CGDIPTPL
Please identify cleary your name in the bank transfer and mention ENAA 2017, if possible.
In order to get the invoice/receipt, please remember to insert the NIF of your institution, and it's name and address in the Observations field of the registration and payment
webpage. SPA will handle the ENAA 2017 registration fee payments, and will send the invoice/receipt to the email address provided in the registration page by the participants.
For more information, please contact us - xxviienaa@iastro.pt.
}
?>