IberiCos 201629-31 March 2016, Vila do Conde, Portugal
require_once($_SERVER['DOCUMENT_ROOT'] . "/../includes/smtp.php");
$today = date('YmdHi');
// Criar o objecto
$email = isset($_POST['email']) ? $_POST['email'] : NULL;
$title = isset($_POST['title']) ? $_POST['title'] : NULL;
$abstract = isset($_POST['abstract']) ? $_POST['abstract'] : NULL;
$arxiv = isset($_POST['arxiv']) ? $_POST['arxiv'] : NULL;
$checkBoxPrivacy = isset($_POST['checkBoxPrivacy']) ? $_POST['checkBoxPrivacy'] : NULL;
$flag_done = isset($_POST['flag_done']) ? $_POST['flag_done'] : NULL;
$emailAlreadyRegistered = 1;
$double = NULL;
if (isset($_POST['submit']) && $_POST['submit']) {
$remote_ip = $_SERVER['REMOTE_ADDR'];
if ($remote_ip != "192.168.20.101") die();
$title_db = mysql_real_escape_string($title);
$abstract_db = mysql_real_escape_string($abstract);
$arxiv_db = mysql_real_escape_string($arxiv);
$email_db = mysql_real_escape_string($email);
// Verificação dos resultados
$titleEmpty = !$title ? 1 : NULL;
$abstractEmpty = !$abstract ? 1 : NULL;
//$emailVerify = mysql_num_rows(mysql_query("SELECT id FROM `" . $confAcronym . "_reg` WHERE email='$email_db' AND accepted = '1'"));
$emailVerify = mysql_num_rows(mysql_query("SELECT id FROM `" . $confAcronym . "_reg` WHERE email = '$email_db'"));
$checkBoxPrivacyEmpty = !isset($_POST['checkBoxPrivacy']) ? 1 : NULL;
if ($emailVerify > 0) {
$emailAlreadyRegistered = 1;
} else {
$emailAlreadyRegistered = NULL;
}
// introdução dos valores na base de dados em caso de nao existencia de erro
if (!$titleEmpty && !$abstractEmpty && !$checkBoxPrivacyEmpty && $emailAlreadyRegistered) {
$sql = "INSERT INTO `" . $confAcronym ."_abs` VALUES (NULL,'$email_db','$title_db','$abstract_db', '$arxiv_db','0','0','0')";
$result = mysql_query($sql);
if (!$result) die(mysql_error() . "
" . $sql);
$flag_done=1;
}
}
$textTop = "
If you encounter any problems or questions please contact us at IberiCos2016@iastro.pt. Thank you.
Please note: Abstract submission deadline is Monday, February 29. In order
to submit your abstract you must first fill the registration form, and
must use below the same e-mail you provided therein. All fields below are
mandatory, except the DOI or arxiv reference. Upon successful submission of the form you
will receive a confirmation e-mail.
Please input the email used for the registration
" ?>
if ((isset($_POST['submit']))){
/*if ($doubleAbstract > 0) {
$textTop="
You already submitted an abstract for a talk.
If you believe this to be an error, please send an email to life-origins2015@iastro.pt.";
}
*/?>
if (!isset($emailAlreadyRegistered)) { ?>
$textTop="
A valid and accepted registration using this e-mail address was not found. If you already registered, please make sure that this is the same e-mail address you used in your registration. If you haven't registered, please proceed to the registration before submiting your abstract.
If you believe this to be an error, please contact us at IberiCos2016@iastro.pt"; ?>
} elseif ($flag_done) {
$firstName = sql_ifget_value('`' . $confAcronym . '_reg`','firstname',"email='$email_db'");
$lastName = sql_ifget_value('`' . $confAcronym . '_reg`','lastname',"email='$email_db'");
$institute = sql_ifget_value('`' . $confAcronym . '_reg`','institute',"email='$email_db'");
$mail = new smtp();
$mail_conn = $mail->openConnection();
if (!$mail_conn) die ("Connection to SMTP unavailable.");
$mail->setFrom("IberiCos2016@iastro.pt");
$mail->setFromName("IberiCos 2016 Conference LOC");
$mail->setSubject("IberiCos 2016 Conference abstract submission");
$mail->setTo($email);
$mail->setCc("IberiCos2016@iastro.pt");
$mail->setMessage("
Dear ". $firstName . " ". $lastName .",
This is an automated message. Your abstract has been sucessfully submited. \n
Thank you.
Name: ".$lastName.", ".$firstName."
E-mail: ".$email."
Institution: ".$institute."
Abstract title: ".$title."
Best regards,
IberiCos 2016 Conference LOC");
$mail->send();
?>
Your abstract has been sucessfully submited. Thank you.
Information
Name: echo $lastName .", ".$firstName; ?>
E-mail: echo $email; ?>
Institute: echo $institute; ?>
Title: echo $title; ?>
}
}
if (!$flag_done)
{
?>
echo $textTop ?>
}
?>