示例#1
0
 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);
 }
示例#2
0
 public function calificar_parque()
 {
     $calificacion = new calificacion($this->post);
     if ($calificacion->is_valid()) {
         $this->orm->connect();
         $this->orm->insert_data('normal', $calificacion);
         $this->orm->close();
         $this->engine->assign('msg_warning', 'calificacion registrada');
         $this->engine->assign('type_warning', 'success');
     } else {
         $this->engine->assign('msg_warning', 'No se ha podido calificar el parque, por favor verifique que los datos ingresados sean correctos.');
         $this->engine->assign('type_warning', 'warning');
         $this->engine->assign('nota', $calificacion->get('nota'));
         $this->engine->assign('parque', $calificacion->get('parque'));
     }
 }
示例#3
0
 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);
 }
示例#4
0
 public function calificar()
 {
     $calificacion = new calificacion($this->post);
     if (is_empty($calificacion->get('valor'))) {
         throw_exception("Debe ingresar una calificación");
     }
     if ($calificacion->get('valor') < 1 && $calificacion->get('valor') > 5) {
         throw_exception("Calificación inválida");
     }
     $this->orm->connect();
     $this->orm->insert_data("normal", $calificacion);
     $this->orm->close();
     $this->type_warning = "sucess";
     $this->msg_warning = "Claificació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()
 {
     settype($data, 'object');
     $data->fecha = date("y-m-d");
     $data->calificacion = $this->post->calificacion;
     $data->parque = $this->post->parque;
     $calificacion = new calificacion($data);
     if ($calificacion->get("calificacion") < 0 || $calificacion->get("calificacion") > 5) {
         throw_exception("Debe ingresar una calificacion entre 1 y 5");
     }
     $this->orm->connect();
     $this->orm->update_data("normal", $calificacion);
     $this->orm->close();
     $this->type_warning = "sucess";
     $this->msg_warning = "parque calificado correctamente";
     $this->temp_aux = 'message.tpl';
     $this->engine->assign('type_warning', $this->type_warning);
     $this->engine->assign('msg_warning', $this->msg_warning);
 }
示例#6
0
 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);
 }
 public function editarNota()
 {
     $obj = new calificacion();
     $p = $obj->update($_POST);
 }