Seismology of the Sun and the Distant Stars 2016
Using Today’s Successes to Prepare the Future
Joint TASC2 & KASC9 Workshop – SPACEINN & HELAS8 Conference11-15 July 2016, Angra do Heroísmo, Terceira-Açores, Portugal
//
die();
exit();
//
require_once($_SERVER['DOCUMENT_ROOT'] . "/../includes/phpmailer/class.phpmailer.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/../includes/phpmailer/class.smtp.php");
$tablename=$confAcronym . "_users";
$tablenameData=$confAcronym . "_regData";
$tablenameInvoice=$confAcronym . "_invoice";
$tablenameFoodRestrictions=$confAcronym . "_foodRestrictions";
// 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;
$institute = isset($_POST['institute']) ? $_POST['institute'] : NULL;
$password = isset($_POST['password']) ? $_POST['password']:NULL;
$checkPassword = isset($_POST['checkPassword']) ? $_POST['checkPassword']:NULL;
$participantList = isset($_POST['participantList']) ? $_POST['participantList']:NULL;
$companion = isset($_POST['companion']) ? $_POST['companion']:NULL;
$companionName = isset($_POST['companionName']) ? $_POST['companionName']:NULL;
$feeType = isset($_POST['feeType']) ? $_POST['feeType']:NULL;
$welcome = isset($_POST['welcome']) ? $_POST['welcome']:NULL;
$dinner = isset($_POST['dinner']) ? $_POST['dinner']:NULL;
$farewell = isset($_POST['farewell']) ? $_POST['farewell']:NULL;
$social1 = isset($_POST['social1']) ? $_POST['social1']:NULL;
$social2 = isset($_POST['social2']) ? $_POST['social2']:NULL;
$social3 = isset($_POST['social3']) ? $_POST['social3']:NULL;
$foodRestrictions = isset($_POST['foodRestrictions']) ? $_POST['foodRestrictions']:NULL;
$instituteInvoice = isset($_POST['instituteInvoice']) ? $_POST['instituteInvoice'] : NULL;
$vatInvoice = isset($_POST['vatInvoice']) ? $_POST['vatInvoice'] : NULL;
$addressInvoice = isset($_POST['addressInvoice']) ? $_POST['addressInvoice'] : NULL;
$zipCodeInvoice = isset($_POST['zipCodeInvoice']) ? $_POST['zipCodeInvoice'] : NULL;
$cityInvoice = isset($_POST['cityInvoice']) ? $_POST['cityInvoice'] : NULL;
$countryInvoice = isset($_POST['countryInvoice']) ? $_POST['countryInvoice'] : NULL;
$checkBoxPrivacy = isset($_POST['checkBoxPrivacy']) ? $_POST['checkBoxPrivacy'] : NULL;
$flag_done = isset($_POST['flag_done']) ? $_POST['flag_done'] : NULL;
$double = NULL;
/*
$remote_ip = $_SERVER['REMOTE_ADDR'];
if ($remote_ip == "192.168.20.101") {
$flag_done = 1;
$_POST['submit'] = TRUE;
}
*/
if (isset($_POST['submit']) && $_POST['submit']) {
// Verificação dos resultados
$firstnameEmpty = !$firstname ? 1 : NULL;
$lastnameEmpty = !$lastname ? 1 : NULL;
$emailEmpty = !$email ? 1 : NULL;
$passwordEmpty = !$password ? 1 : NULL;
$feeTypeEmpty = !$feeType ? 1 : NULL;
$social1Empty = !$social1 ? 1 : NULL;
$social2Empty = !$social2 ? 1 : NULL;
$social3Empty = !$social3 ? 1 : NULL;
$instituteInvoiceEmpty = !$instituteInvoice ? 1 : NULL;
$vatInvoiceEmpty = !$vatInvoice ? 1 : NULL;
$addressInvoiceEmpty = !$addressInvoice ? 1 : NULL;
$zipCodeInvoiceEmpty = !$zipCodeInvoice ? 1 : NULL;
$cityInvoiceEmpty = !$cityInvoice ? 1 : NULL;
$countryInvoiceEmpty = !$countryInvoice ? 1 : NULL;
$checkPasswordEmpty = !$checkPassword ? 1 : NULL;
$passwordVerificationError = ($password != $checkPassword)? 1 : NULL;
$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;
// remover caracteres estranhos
$firstname_db = htmlentities(mysql_real_escape_string($firstname), ENT_QUOTES);
$lastname_db = htmlentities(mysql_real_escape_string($lastname), ENT_QUOTES);
$email_db = htmlentities(mysql_real_escape_string($email), ENT_QUOTES);
$institute_db = htmlentities(mysql_real_escape_string($institute), ENT_QUOTES);
$password_db = hash('sha512', $password);
$companionName_db = htmlentities(mysql_real_escape_string($companionName), ENT_QUOTES);
$foodRestrictions_db = htmlentities(mysql_real_escape_string($foodRestrictions), ENT_QUOTES);
$instituteInvoice_db = htmlentities(mysql_real_escape_string($instituteInvoice), ENT_QUOTES);
$vatInvoice_db = htmlentities(mysql_real_escape_string($vatInvoice), ENT_QUOTES);
$addressInvoice_db = htmlentities(mysql_real_escape_string($addressInvoice), ENT_QUOTES);
$zipCodeInvoice_db = htmlentities(mysql_real_escape_string($zipCodeInvoice), ENT_QUOTES);
$cityInvoice_db = htmlentities(mysql_real_escape_string($cityInvoice), ENT_QUOTES);
if ($emailVerify > 0) {
$emailAlreadyRegistered = 1;
} else {
$emailAlreadyRegistered = NULL;
}
/*
if ($remote_ip == "192.168.20.101") {
$emailError = NULL;
$emailAlreadyRegistered = NULL;
}
*/
// introdução dos valores na base de dados em caso de nao existencia de erro
if (!$firstnameEmpty && !$lastnameEmpty && !$emailEmpty && !$passwordEmpty && !$checkPasswordEmpty&& !$passwordVerificationError && !$emailAlreadyRegistered && !$emailError && !$checkBoxPrivacyEmpty && !$feeTypeEmpty && !$social1Empty && !$social2Empty && !$social3Empty && !$instituteInvoiceEmpty && !$vatInvoiceEmpty && !$addressInvoiceEmpty && !$zipCodeInvoiceEmpty && !$cityInvoiceEmpty && !$countryInvoiceEmpty)
{
$sql_id = "SELECT MAX(id) FROM `$tablename`";
$result_id = mysql_query($sql_id);
if (!$result_id) $id = 0;
else $id = mysql_fetch_row($result_id);
$id = $id[0] + 1;
$id_hash = substr(hash('sha512',substr(hash('sha512',$id), 5, 10)), 5, 10);
$sql = "INSERT INTO `$tablename` VALUES (NULL,
'$firstname_db',
'$lastname_db',
'$email_db',
'$institute_db',
'$password_db',
'$id_hash',
'0',
'0',
'0'
)";
$result = mysql_query($sql);
$sql_data = "INSERT INTO `$tablenameData` VALUES (NULL,
'$id_hash',
'$participantList',
'$companion',
'$companionName_db',
'$feeType',
'$welcome',
'$dinner',
'$farewell',
'$social1',
'$social2',
'$social3',
'0',
'0',
'0',
'0'
)";
$result_data = mysql_query($sql_data);
$sql_invoice = "INSERT INTO `$tablenameInvoice` VALUES (NULL,
'$id_hash',
'$instituteInvoice_db',
'$vatInvoice_db',
'$addressInvoice_db',
'$zipCodeInvoice_db',
'$cityInvoice_db',
'$countryInvoice',
'0',
'0'
)";
$result_invoice = mysql_query($sql_invoice);
$sql_food = "INSERT INTO `$tablenameFoodRestrictions` VALUES (NULL,
'$id_hash',
'$foodRestrictions_db',
'0'
)";
$result_food = mysql_query($sql_food);
if (!$result) die(mysql_error() . "
" . $sql);
$flag_done=1;
} else $textError = "
There was a problem with your registration, please verify the marked fields.
";
}
$textTop="
Please fill the form below to register in this conference.
";
if ((isset($_POST['submit']))){
if (isset($textError)) $textTop.= $textError;
if (isset($emailError)) $textTop.="
Please insert a valid email address!
";
if (isset($emailAlreadyRegistered)) {
$textTop.="
This email is already registered.";
} elseif ($flag_done) {
if ($feeType == 1) {
$totalDue = 300;
$dueDate = "April 24";
}
if ($feeType == 2) {
$totalDue = 380;
$dueDate = "June 1";
}
if ($companion == 1) $totalDue += 90;
$mail = new PHPMailer();
$mail->CharSet = 'UTF-8';
$mail->Encoding = '8bit';
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SetFrom($confEmail, $confSignature . " LOC");
$mail->AddAddress($email, $firstname . " " . $lastname);
$mail->AddCc($confEmail, $confSignature . " LOC");
$mail->Subject = $confSignature . " registration acknowledgment";
$mail->MsgHTML("
Dear ". $firstname_db . " ". $lastname_db .",
This is an automated message. Your registration for the " . $confSignature . " has been successfully submitted.
You may now login and review the submitted information.
Name: ".$lastname_db.", ".$firstname_db."
E-mail: ".$email."
Institution: ".$institute_db. "
Payment information
Payment of the registration fee is due on " . $dueDate . ", 2016. The total amount to be paid for your registration is " . $totalDue . "EUR.
The registration can be paid by bank transfer or through PayPal.
Bank Transfer
We require all international transfers to us to be made with OUR instruction. OUR instruction means you pay all transfer charges.
Please clearly identify your name when doing your transfer, and notify the LOC by e-mail (
SpaceTK16@iastro.pt). In your e-mail, if possible please mention the reference code of the transfer (or any clear identifier), or send us a file with the bank's receipt.
Your registration will only be confirmed once we receive full payment of the registration fee.
Account Holder: Centro de Investigação em Astronomia/Astrofísica da Universidade do Porto
Bank Name: Caixa Geral de Depósitos
Bank Adress: Praca Mouzinho de Albuquerque no 113, Edifício Brasília, PT-4100-359 Porto, Portugal
IBAN CODE : PT50 0035 0160 00061936230 05
SWIFT/BIC CODE: CGDIPTPL
PayPal
Please login and access the Payment Status section.
Best regards,
" . $confSignature . " LOC");
$mail->Send();
?>
Your registration has been successfully submitted. You may now use your email and password to login.
Payment Information
The registration can be paid by bank transfer or through PayPal.
Bank Transfer
We require all international transfers to us to be made with OUR instruction. OUR instruction means you pay all transfer charges.
Please clearly identify your name when doing your transfer, and notify the LOC by e-mail (SpaceTK16@iastro.pt). In your e-mail, if possible, please mention the reference code of the transfer (or any clear identifier), or send us a file with the bank's receipt.
Account Holder: Centro de Investigação em Astronomia/Astrofísica da Universidade do Porto
Bank Name: Caixa Geral de Depósitos
Bank Adress: Praça Mouzinho de Albuquerque no 113, Edifício Brasília, PT-4100-359 Porto, Portugal
IBAN CODE : PT50 0035 0160 00061936230 05
SWIFT/BIC CODE: CGDIPTPL
Your registration will only be confirmed once we receive full payment of the registration fee.
}
}
if (!$flag_done)
{
?>
echo $textTop ?>
}
?>