/
home2
/
reumatologia
/
public_html
/
admin
/
Upload File
HOME
<?php require_once('../inc_library.php'); require_once('../library/class.tiposusuarios.php'); /* obtenemos datos enviados */ $Plataforma = strval($_REQUEST['Plataforma']); $Asunto = strval(utf8_decode($_REQUEST['Asunto'])); $Mensaje = strval(utf8_decode($_REQUEST['Mensaje'])); $IdTipoUsuario = intval($_REQUEST['IdTipoUsuario']); $Submit = (isset($_REQUEST['Submitted'])); /* declaramos e instanciamos variables necesarias */ $err = 0; $oEnvioPush = new EnvioPush(); $oEnviosPush = new EnviosPush(); /* validaciones... */ if ($Asunto == '') $err |= 1; if ($Mensaje == '') $err |= 2; /* si no hay errores... */ if ($err == 0) { $oEnvioPush->Plataforma = $Plataforma; $oEnvioPush->Asunto = $Asunto; $oEnvioPush->Mensaje = $Mensaje; $oEnvioPush->Fecha = date('d-m-Y H:i:s'); $oEnvioPush->IdTipoUsuario = $IdTipoUsuario; /* creamos el registro */ $oEnvioPush = $oEnviosPush->Create($oEnvioPush); $oEnvioPush->RealizarEnvio(); 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("Debe ingresar el asunto y mensaje"))); } ?>