/
home2
/
reumatologia
/
public_html
/
admin
/
Upload File
HOME
<?php require_once('../inc_library.php'); /* obtenemos datos enviados */ $Fecha = strval($_REQUEST['Fecha']); $Titulo = strval($_REQUEST['Titulo']); $Hora = strval($_REQUEST['Hora']); $Encuentro = strval($_REQUEST['Encuentro']); $Organizador = strval($_REQUEST['Organizador']); $Disponible = intval($_REQUEST['Disponible']); $Video = strval($_REQUEST['Video']); $Unisar = intval($_REQUEST['Unisar']); $IGG4 = intval($_REQUEST['IGG4']); $arrKeywords = $_REQUEST['keyword']; $Submit = (isset($_REQUEST['Submitted'])); /* declaramos e instanciamos variables necesarias */ $err = 0; $oEducacion = new Educacion(); $oEducaciones = new Educaciones(); $oKeywords = new Keywords(); /* validaciones... */ if ($Encuentro == '') $err |= 1; if ($Fecha == '') $err |= 2; if ($Titulo == '') $err |= 4; /* si no hay errores... */ if ($err == 0) { $oEducacion->Fecha = $Fecha; $oEducacion->Titulo = $Titulo; $oEducacion->Hora = $Hora; $oEducacion->Encuentro = $Encuentro; $oEducacion->Organizador = $Organizador; $oEducacion->Disponible = $Disponible; $oEducacion->Video = $Video; $oEducacion->Unisar = $Unisar; $oEducacion->IGG4 = $IGG4; /* creamos el registro */ $oEducacion = $oEducaciones->Create($oEducacion); if ($arrKeywords) { foreach ($arrKeywords as $keyword) { $oKeyword = new Keyword(); $oKeyword->IdEducacion = $oEducacion->IdEducacion; $oKeyword->Nombre = $keyword; $oKeywords->Create($oKeyword); } } header('Content-type: application/json'); echo json_encode(array("Success" => true, "Error" => "")); } else { header('Content-type: application/json'); echo json_encode(array("Success" => false, "Error" => utf8_encode($err. "Error al crear el evento."))); } ?>