/** * funcion que establece la relacion de los nuevos eventos con los participantes. */ function setNewEvent() { $participante = new participantesModel(); $result = $participante->setNewEvent($_POST['id_participante'], $_POST['id_evento'], $_POST['forma_pago']); if ($result) { $respuesta = array('estatus' => 200, 'msg' => 'LOS CAMBIOS SE GUARDARON CORRECTAMENTE', 'url' => PATH_SITE . 'perfil/'); } else { $respuesta = array('estatus' => 500, 'msg' => 'ERROR AL GUARDAR LOS CAMBIOS'); } echo json_encode($respuesta); }
/** * Funcion que se ejecuta cuando el pago de paypal es correcto * @param integer $id [description] */ public function SuccessPayment($id = 0) { $participante = new participantesModel(); $id_participante = $_GET['id_participante']; $id_evento = $_GET['id_evento']; $precio = $_GET['precio']; $tipo_asistencia = $_GET['tipo']; $result = $participante->setNewEvent($id_participante, $id_evento, 4, $costo_evento, $tipo_asistencia); //guardamos el pago en la base de datos. if ($result) { $id_participantes_eventos = $participante->getLastInsert(); //obtenemos el id del registro guardado. $pago = new eventosModel(); $pago->updatePago(1, $id_participantes_eventos); $this->cargarVista("EL PAGO SE REALIZO CORRECTAMENTE.", "success", "fa fa-thumbs-o-up"); } else { $this->CancelPayment(); } }