public function calificar() { $calificacion = new calificacion($this->post); $fecha = date("y-m-d"); $calificacion->set("fecha", $fecha); $this->orm->connect(); $this->orm->insert_data("normal", $calificacion); $this->orm->close(); $this->type_warning = "success"; $this->msg_warning = "Calificación registrada"; $this->temp_aux = 'message.tpl'; $this->engine->assign('calificacion', $calificacion); $this->engine->assign('type_warning', $this->type_warning); $this->engine->assign('msg_warning', $this->msg_warning); }
public function calificar() { $calificacion = new calificacion($this->post); $calificacion->set('fecha', date("y-m-d")); if (!$calificacion->validar_valor()) { throw_exception("Valor de la calificacion a ingresar inválido!"); } $this->orm->connect(); $this->orm->insert_data("normal", $calificacion); $this->orm->close(); $this->type_warning = "success"; $this->msg_warning = "Calificación registrada!"; $this->temp_aux = 'message.tpl'; $this->engine->assign('type_warning', $this->type_warning); $this->engine->assign('msg_warning', $this->msg_warning); }
public function calificar() { $this->engine->assign('codigo', $this->post->codigo); $this->engine->assign('nombre', $this->post->nombre); $this->engine->assign('municipio', $this->post->municipio); $calificacion = new calificacion($this->post); $calificacion->set('fecha', date('Y-m-d')); if (is_empty($calificacion->get('calificacion'))) { throw_exception("Debe ingresar una calificacion"); } elseif ($calificacion->get('calificacion') != 1 and $calificacion->get('calificacion') != 2 and $calificacion->get('calificacion') != 3 and $calificacion->get('calificacion') != 4 and $calificacion->get('calificacion') != 5) { throw_exception("Calificacion invalida, calificacion valida: 1, 2, 3, 4, 5"); } $this->orm->connect(); $this->orm->insert_data("normal", $calificacion); $this->orm->close(); $this->type_warning = "Exito"; $this->msg_warning = "Calificacion registrada"; $this->temp_aux = 'message.tpl'; $this->engine->assign('type_warning', $this->type_warning); $this->engine->assign('msg_warning', $this->msg_warning); }