Cosmology and fundamental physics with current and future
ESO facilities
3rd Azores School on Observational Cosmology
5th Azores International Advanced School in Space Sciences27 August - 02 September 2017, Angra do Heroísmo, Açores, Portugal
die();
exit();
require_once($_SERVER['DOCUMENT_ROOT'] . "/../includes/smtp.php");
$tablename = $confAcronym . "_reg";
$today = date('Y-m-d');
$todayDT = date('Y-m-d H:i:s');
$flag_error = 0;
$flag_done = 0;
//if ($today < '201603150100') {
// Criar o objecto
$position = isset($_POST['position']) ? $_POST['position'] : NULL;
$firstname = isset($_POST['firstname']) ? $_POST['firstname'] : NULL;
$lastname = isset($_POST['lastname']) ? $_POST['lastname'] : NULL;
$email = isset($_POST['email']) ? $_POST['email'] : NULL;
$institution = isset($_POST['institution']) ? $_POST['institution'] : NULL;
$talk = isset($_POST['talk']) ? $_POST['talk'] : NULL;
$talkTitle = isset($_POST['talkTitle']) ? $_POST['talkTitle'] : NULL;
$talkAbstract = isset($_POST['talkAbstract']) ? $_POST['talkAbstract'] : NULL;
$phdDate = isset($_POST['phdDate']) ? $_POST['phdDate'] : NULL;
$docs = isset($_FILES["docs"]["name"]) ? $_FILES["docs"]["name"] : NULL;
$checkBoxPrivacy = isset($_POST['checkBoxPrivacy']) ? $_POST['checkBoxPrivacy'] : NULL;
if (isset($_POST['submit']) && $_POST['submit']) {
// Verificação dos resultados
$positionEmpty = !$position ? 1 : NULL;
$firstnameEmpty = !$firstname ? 1 : NULL;
$lastnameEmpty = !$lastname ? 1 : NULL;
$emailEmpty = !$email ? 1 : NULL;
$institutionEmpty = !$institution ? 1 : NULL;
$talkEmpty = !$talk ? 1 : NULL;
$talkTitleEmpty = !$talkTitle ? 1 : NULL;
$talkAbstractEmpty = !$talkAbstract ? 1 : NULL;
$phdDateEmpty = !$phdDate ? 1 : NULL;
$docsEmpty = !$docs ? 1 : NULL;
$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;
$sql = "SELECT count(id) FROM $tablename WHERE email='$email'";
$result = mysql_query($sql);
$row = mysql_fetch_row($result);
if ($row[0] == 0) $emailVerify = NULL;
else $emailVerify = 1;
// remover caracteres estranhos
$firstname_db = htmlspecialchars($firstname, ENT_QUOTES);
$lastname_db = htmlspecialchars($lastname, ENT_QUOTES);
$institution_db = htmlspecialchars($institution, ENT_QUOTES);
$docs_db = htmlspecialchars($docs, ENT_QUOTES);
if ($talk == 'yes') {
$talk_db = 1;
} else {
$talk_db = 0;
}
$talkTitle_db = htmlspecialchars($talkTitle, ENT_QUOTES);
$talkAbstract_db = htmlspecialchars($talkAbstract, ENT_QUOTES);
if ($emailVerify > 0) {
$emailAlreadyRegister = 1;
} else {
$emailAlreadyRegister = NULL;
}
// flag error
if ($positionEmpty || $firstnameEmpty || $lastnameEmpty || $emailEmpty || $institutionEmpty || $phdDateEmpty || $talkEmpty || $docsEmpty || $checkBoxPrivacyEmpty) $flag_error=1;
error_log($flag_error);
if (!$talkEmpty && $talk_db && ($talkTitleEmpty || $talkAbstractEmpty)) $flag_error=2;
error_log($flag_error);
if ($emailError || $emailVerify) $flag_error=3;
error_log($flag_error);
// introdução dos valores na base de dados em caso de nao existencia de erro
if (!$flag_error) {
$sql = "INSERT INTO `$tablename` VALUES (NULL,
'$position',
'$firstname_db',
'$lastname_db',
'$email',
'$institution_db',
'$talk_db',
'$talkTitle_db',
'$talkAbstract_db',
'$phdDate',
'$docs_db',
'$todayDT',
'0',
'0'
)";
$result = mysql_query($sql);
if (!$result) die(mysql_error() . "
" . $sql);
$regId = mysql_insert_id();
$flag_done = 1;
// upload file
$target_dir = "/web/iastro/html/research/conferences/azores17/uploads/";
$target_file = $target_dir . $regId . "-" . basename($_FILES["docs"]["name"]);
move_uploaded_file($_FILES["docs"]["tmp_name"], $target_file);
}
}
if ($flag_done) {
if ($talk_db) {
$msg_talk = "
Talk title: " . $talkTitle . "
Talk abstract:
" . $talkAbstract;
} else {
$msg_talk = "";
}
$mail = new smtp();
$mail_conn = $mail->openConnection();
if (!$mail_conn) die ("Connection to SMTP unavailable.");
$mail->setFrom("azores17@iastro.pt");
$mail->setFromName("Azores17 LOC");
$mail->setSubject("Azores17 registration acknowledgment");
$mail->setTo($email);
$mail->setCc("azores17@iastro.pt");
$mail->setMessage("
Dear ". $firstname . " ". $lastname .",
This is an automated message. Your application 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.
Name: " . $firstname . " " . $lastname . "
E-mail: " . $email . "
Institution: " . $institution . "
Status: " . $position . "
Date of PhD: " . $phdDate . "
Short talk: " . $talk . $msg_talk . "
Best regards,
Azores17 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 azores17@iastro.pt.
Thank you.
Name: echo $firstname . " " . $lastname; ?>
E-mail: echo $email; ?>
Institution: echo $institution; ?>
}
if (!$flag_done){
?>
Applications
The school will accept applications from 10 January to 31 March 2017. Applicants should fill the application form below. We expect to select a maximum of 40 students.
Eligible applicants must be current PhD students (or exceptional Masters students), or post-docs having obtained the PhD after 31 December 2015 (with allowances for maternity leave, etc). The application will include a motivation letter, a CV, and an endorsment letter from the student's supervisor (or a certificate with the PhD award date, for post-docs).
Students offered one of the places will be expected to confirm acceptance and pay (by bank transfer) a registration fee of 200,00 Euros. On the other hand, we expect to be able to cover the accommodation of some of the students (the exact number of which will be determined later, once we have a final budget).
For any questions/inquiries, please contact us at azores17@iastro.pt.
}
/*
} else echo "
The registration for this conference is now closed.
";
*/
?>