fix confirmation changes

This commit is contained in:
German Correa 2017-12-01 14:00:38 -03:00
parent c2b63d6100
commit 9b1590d8f1
5 changed files with 33 additions and 153 deletions

View File

@ -3,7 +3,7 @@
function verifyCaptcha(){
$url = 'https://www.google.com/recaptcha/api/siteverify';
$data = array(
'secret' => '6LeLxy4UAAAAABClplWLJUjZ1_nhX_-SI7CuNcm8',
'secret' => '6LesRDsUAAAAAA6t3UgL4U4Foc9njmXX-8HIiLj_',
'response' => $_POST["g-recaptcha-response"]
);
$options = array(
@ -64,17 +64,18 @@ $filename = "2021y22";
// validate the variables ======================================================
$data['nombre'] = $_POST['nombre'];
$data['apellido'] = $_POST['apellido'];
$data['tipodoc'] = $_POST['doctype'];
$data['nrodoc'] = $_POST['docnro'];
$data['direccion'] = $_POST['dir'];
$data['pais'] = $_POST['pais'];
$data['ciudad'] = $_POST['ciudad'];
$data['telefono'] = $_POST['tel'];
$data['email'] = $_POST['email'];
$data['profesion'] = $_POST['profesion'];
$data['trabaja'] = $_POST['trabaja'];
$data['titulo'] = $_POST['titulo'];
$data['llegada'] = $_POST['bda'];
$data['partida'] = $_POST['eda'];
$data['financiacion'] = $_POST['financiacion'];
$data['detallefinan'] = $_POST['detallefinan'];
$data['invitado'] = $_POST['invited'];
$data['carta'] = $_POST['letterinvited'];
$data['roomtype'] = $_POST['roomtype'];
$data['roomate'] = $_POST['roomate'];
if (empty($_POST['nombre']))
$errors['nombre'] = 'Nombre is required.';
@ -82,32 +83,9 @@ if (empty($_POST['nombre']))
if (empty($_POST['apellido']))
$errors['apellido'] = 'Apellido is required.';
if (empty($_POST['doctype']))
$errors['doctype'] = 'No seleccionó un tipo de doc';
if (empty($_POST['docnro']))
$errors['docnro'] = 'No ingreso un documento';
if (empty($_POST['dir']))
$errors['dir'] = 'No ingreso una direccion';
if (empty($_POST['pais']))
$errors['pais'] = 'Ingrese el pais de presedencia';
if (empty($_POST['ciudad']))
$errors['ciudad'] = 'Ingrese ciudad de presedencia';
if (empty($_POST['tel']))
$errors['ciudad'] = 'Telefono de contacto vacio o incorrecto';
if (empty($_POST['email']))
$errors['email'] = 'E-Mail de contacto vacio o incorrecto';
if (empty($_POST['profesion']))
$errors['email'] = 'indique profesion';
if (empty($_POST['trabaja']))
$errors['trabaja'] = 'Indique en el sector que trabaja';
if(empty($_POST['g-recaptcha-response'])){
$errors['recaptcha'] = 'Debe validar el captcha';
}
@ -115,11 +93,6 @@ else if(!verifyCaptcha()){
$errors['recaptcha'] = 'Error en la validación de ReCaptcha';
}
if( !file_exists("2021y22.csv"))
setheaders();
// return a response ===========================================================
// if there are any errors in our errors array, return a success boolean of false
if ( !empty($errors)) {
// if there are items in our errors array, return those errors
@ -128,23 +101,23 @@ if ( !empty($errors)) {
}
else {
$data['success'] = true;
bkpregister();
//bkpregister();
$fila = $data;
registrar($fila);
$mail = $data["email"];
$nombre = $data["nombre"] . " " . $data["apellido"];
$msg = "Hola ". $data["nombre"] ."!\n\n".
"te has registrado al 6to Coloquio Uruguayo de Matemática exitosamente!\n\n".
"Por cualquier consulta escribe a: 6coloquio@cmat.edu.uy\n\n".
"Saludos cordiales,\n\n".
"Comité Organizador, 6to Coloquio Uruguayo de Matemática.";
$headers = 'From: ' . "6coloquio@cmat.edu.uy" . "\r\n" .
'Reply-To: ' . "6coloquio@cmat.edu.uy" . "\r\n" .
$msg = "Hi ". $data["nombre"] ."!\n\n".
"You have been Successfully registered to the workshop on Groups, Geometry and Dynamics!\n\n".
"For any question, write us to: ggdworkshop@cmat.edu.uy\n\n".
"Regards,\n\n".
"Organizing Commite, GGD Workshop.";
$headers = 'From: ' . "ggdworkshop@cmat.edu.uy" . "\r\n" .
'Reply-To: ' . "ggdworkshop@cmat.edu.uy" . "\r\n" .
'Content-Type: ' . "text/plain; charset=UTF-8". "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($mail, 'Registro confirmado. 6to Coloquio Uruguayo de Matemática', $msg, $headers);
mail($mail, 'Registration confirmation for GGDWorkshop', $msg, $headers);
$data['message'] = 'Registro exitoso';
$data['message'] = "Registration Successfully!";
}

14
db.php
View File

@ -1,14 +0,0 @@
<?php
class DB extends SQLite3{
function __construct(){
$this->open('test.db');
}
}
$db = new DB();
if(!$db){
echo $db->lastErrorMsg();
}else{
echo "Opened database successfully\n";
}
?>

View File

@ -1,14 +1,4 @@
<?php include_once 'header.php'; ?>
<style>
.select2-selection, .select2-selection__rendered, .select2-selection__arrow{
height:34px!important;
line-height: 34px!important;
}
.g-recaptcha {
transform:scale(0.87);
transform-origin:0 0;
}
</style>
<script src="js/data.js"></script>
<script src="js/registerform.js"></script>
<div class="row">
@ -106,8 +96,8 @@
Are you asking for support from the conference?
</label>
<div class="radios input-container">
<label class="radio-inline"><input id="sifinan" type="radio" name="financiacion" value="si">Yes</label>
<label class="radio-inline"><input id="nofinan" type="radio" name="financiacion" value="no">No</label>
<label class="radio-inline"><input id="sifinan" type="radio" name="financiacion" value="1">Yes</label>
<label class="radio-inline"><input id="nofinan" type="radio" name="financiacion" value="0">No</label>
</div>
<div class="col-sm-8 alert alert-info" style="margin:10px 0px 5px 0px;">
@ -129,10 +119,10 @@
</label>
<div class="input-container">
<div class="radio">
<label><input id="invited" type="radio" name="invited" value="si">Yes, I was previously invited</label>
<label><input id="invited" type="radio" name="invited" value="1">Yes, I was previously invited</label>
</div>
<div class="radio">
<label><input id="noinvited" type="radio" name="invited" value="no">No, I am applying(Registration committee will notifiy you if accepted)</label>
<label><input id="noinvited" type="radio" name="invited" value="0">No, I am applying(Registration committee will notifiy you if accepted)</label>
</div>
</div>
</div>
@ -142,8 +132,8 @@
Do you need a letter of invitation?
</label>
<div class="input-container">
<label class="radio-inline"><input id="sifinan" type="radio" name="letterinvited" value="si">Yes</label>
<label class="radio-inline"><input id="nofinan" type="radio" name="letterinvited" value="no">No</label>
<label class="radio-inline"><input id="sifinan" type="radio" name="letterinvited" value="1">Yes</label>
<label class="radio-inline"><input id="nofinan" type="radio" name="letterinvited" value="0">No</label>
</div>
</div>
</div>

View File

@ -353,90 +353,21 @@ div.interest-links h4 a{
width: 134px;
padding: 5px;}
.form_settings
{ margin: 15px 0 0 0;}
.form_settings p
{
padding: 0 0 4px 0;
}
#registerform .control-label{
text-align: left;
}
.form_settings span
{ float: left;
width: 100px;
text-align: left;}
.form_settings input, .form_settings textarea
{ padding: 5px;
width: 299px;
font: 100% arial;
border: 1px solid #E5E5DB;
background: #FFF;
color: #47433F;
.select2-selection, .select2-selection__rendered, .select2-selection__arrow{
height:34px!important;
line-height: 34px!important;
}
.form_settings p.inline-input input{
width: 200px;
@media screen and (max-width: 480px) {
.g-recaptcha {
transform:scale(0.87);
transform-origin:0 0;
}
.form_settings select.small{
width:100px;
}
.form_settings input.radio-input{
width: 50px;
}
.form_settings p input[type="radio"]{
width: 50px;
}
.form_settings .submit
{ font: 100% arial;
border: 0;
width: 99px;
margin: 0 0 0 212px;
height: 33px;
padding: 2px 0 3px 0;
cursor: pointer;
background: #3B3B3B;
color: #FFF;}
.form_settings textarea, .form_settings select
{ font: 100% arial;
width: 299px;}
.form_settings select
{ width: 310px;}
.form_settings .checkbox
{ margin: 4px 0;
padding: 0;
width: 14px;
border: 0;
background: none;}
.separator
{ width: 100%;
height: 0;
border-top: 1px solid #D9D5CF;
border-bottom: 1px solid #FFF;
margin: 0 0 20px 0;}
table
{ margin: 10px 0 30px 0;}
table tr th, table tr td
{ background: #3B3B3B;
color: #FFF;
padding: 7px 4px;
text-align: left;}
table tr td
{ background: #E5E5DB;
color: #47433F;
border-top: 1px solid #FFF;}
div.map-responsive{
overflow:hidden;