Exemplo n.º 1
0
 public static function retornarVista($validacion = '')
 {
     switch (self::$_accion) {
         case 'mensaje':
             $datos = array();
             $plantilla = "vista/html/enlace_inicio.html";
             $enlace = self::_vista($datos, $plantilla);
             $plantilla = "vista/html/plantilla.html";
             $salida = self::$_mensaje;
             $datos = array("titulo" => self::$_titulo, "enlace" => $enlace, "opcion" => '', "formulario" => $salida);
             $html = self::_vista($datos, $plantilla);
             print $html;
             break;
         case 'formulario':
             self::$_mensaje = $validacion->controlErrores();
             $plantilla = "vista/html/formulario_insertar.html";
             $datos = array("mensaje" => self::$_mensaje, "validacionNombre" => $validacion->validateField("nombre"), "nombre" => $validacion->setValue("nombre"));
             $formulario = self::_vista($datos, $plantilla);
             $plantilla = "vista/html/plantilla.html";
             $datos = array("titulo" => self::$_titulo, "enlace" => '', "opcion" => self::$_opcion, "formulario" => $formulario);
             $html = self::_vista($datos, $plantilla);
             print $html;
             break;
     }
 }
Exemplo n.º 2
0
 public static function retornarVista($validacion = '')
 {
     switch (self::$_accion) {
         case 'mensaje':
             $datos = array();
             $plantilla = "vista/html/enlace_inicio.html";
             $enlaceLogin = self::_vista($datos, $plantilla);
             $salida = self::$_mensaje;
             if (self::$_enlaceRegistro) {
                 $plantilla = "vista/html/enlace_registro.html";
                 $enlaceRegistro = self::_vista($datos, $plantilla);
             } else {
                 $enlaceRegistro = '';
             }
             $plantilla = "vista/html/plantilla.html";
             $datos = array("titulo" => self::$_titulo, "enlaceLogin" => $enlaceLogin, "enlaceRegistro" => $enlaceRegistro, "formulario" => $salida);
             $html = self::_vista($datos, $plantilla);
             print $html;
             break;
         case 'login':
             self::$_mensaje = $validacion->controlErrores();
             $plantilla = "vista/html/formulario_loguear.html";
             $datos = array("mensaje" => self::$_mensaje, "validacionUsuario" => $validacion->validateField("usuario"), "usuario" => $validacion->setValue("usuario"), "validacionClave" => $validacion->validateField("clave"));
             $formulario = self::_vista($datos, $plantilla);
             $plantilla = "vista/html/plantilla.html";
             $datos = array("titulo" => self::$_titulo, "enlaceLogin" => '', "enlaceRegistro" => '', "formulario" => $formulario);
             $html = self::_vista($datos, $plantilla);
             print $html;
             break;
         case 'registro':
             self::$_mensaje = $validacion->controlErrores();
             $plantilla = "vista/html/formulario_insertar.html";
             $datos = array("mensaje" => self::$_mensaje, "validacionUsuario" => $validacion->validateField("usuario"), "usuario" => $validacion->setValue("usuario"), "validacionClave" => $validacion->validateField("clave"), "clave" => $validacion->setValue("clave"), "validacionNombre" => $validacion->validateField("nombre"), "nombre" => $validacion->setValue("nombre"), "validacionApellidos" => $validacion->validateField("apellidos"), "apellidos" => $validacion->setValue("apellidos"), "validacionEmail" => $validacion->validateField("email"), "email" => $validacion->setValue("email"));
             $formulario = self::_vista($datos, $plantilla);
             $plantilla = "vista/html/plantilla.html";
             $datos = array("titulo" => self::$_titulo, "enlaceLogin" => '', "enlaceRegistro" => '', "formulario" => $formulario);
             $html = self::_vista($datos, $plantilla);
             print $html;
             break;
     }
 }
Exemplo n.º 3
0
 public static function retornarVista($validacion = '')
 {
     switch (self::$_accion) {
         case 'mensaje':
             $datos = array();
             $plantilla = "vista/html/enlace_inicio.html";
             $enlace = self::_vista($datos, $plantilla);
             $plantilla = "vista/html/plantilla.html";
             $salida = self::$_mensaje;
             $datos = array("titulo" => self::$_titulo, "enlace" => $enlace, "opcion" => '', "formulario" => $salida);
             $html = self::_vista($datos, $plantilla);
             print $html;
             break;
         case 'listar':
             foreach (self::$_notas as $nota) {
                 $datos = array("id" => $nota->getId(), "asignatura" => $_POST["asignatura"], "nota" => $nota->getNota(), "curso" => $nota->getCurso(), "alumno" => $nota->getAlumno());
                 $plantilla = "vista/html/fila.html";
                 self::$_listado .= self::_vista($datos, $plantilla);
             }
             $datos = array();
             $plantilla = "vista/html/enlace_inicio.html";
             $enlace = self::_vista($datos, $plantilla);
             $plantilla = "vista/html/listado.html";
             $datos = array("numFilas" => self::$_numFilas, "listado" => self::$_listado);
             $salida = self::_vista($datos, $plantilla);
             $plantilla = "vista/html/plantilla.html";
             $datos = array("titulo" => self::$_titulo, "enlace" => $enlace, "opcion" => self::$_opcion, "formulario" => $salida);
             $html = self::_vista($datos, $plantilla);
             print $html;
             break;
         case 'formulario':
             self::$_mensaje = $validacion->controlErrores();
             $plantilla = "vista/html/formulario_buscar.html";
             $datos = array("mensaje" => self::$_mensaje, "validacionCodigo" => $validacion->validateField("codigo"), "codigo" => $validacion->setValue("codigo"));
             $formulario = self::_vista($datos, $plantilla);
             $plantilla = "vista/html/plantilla.html";
             $datos = array("titulo" => self::$_titulo, "enlace" => '', "opcion" => self::$_opcion, "formulario" => $formulario);
             $html = self::_vista($datos, $plantilla);
             print $html;
             break;
     }
 }
Exemplo n.º 4
0
 public static function retornarVista($validacion = '')
 {
     switch (self::$_accion) {
         case 'mensaje':
             $datos = array();
             $plantilla = "vista/html/enlace_inicio.html";
             $enlace = self::_vista($datos, $plantilla);
             $plantilla = "vista/html/plantilla.html";
             $salida = self::$_mensaje;
             $datos = array("titulo" => self::$_titulo, "enlace" => $enlace, "opcion" => '', "formulario" => $salida);
             $html = self::_vista($datos, $plantilla);
             print $html;
             break;
         case 'listar':
             $datos = array("codigo" => $_POST['codigo'], "nombre" => self::$_nombre, "precio" => self::$_precio, "cantidad" => self::$_cantidad);
             if (isset($_POST['mostrarprecio']) and $_POST['mostrarprecio'] == 'S' and isset($_POST['mostrarcantidad']) and $_POST['mostrarcantidad'] == 'S') {
                 $plantillaFila = "vista/html/fila_precio_cantidad.html";
                 $plantillaListado = "vista/html/listado_precio_cantidad.html";
             } elseif (isset($_POST['mostrarprecio']) and $_POST['mostrarprecio'] == 'S') {
                 $plantillaFila = "vista/html/fila_precio.html";
                 $plantillaListado = "vista/html/listado_precio.html";
             } elseif (isset($_POST['mostrarcantidad']) and $_POST['mostrarcantidad'] == 'S') {
                 $plantillaFila = "vista/html/fila_cantidad.html";
                 $plantillaListado = "vista/html/listado_cantidad.html";
             } else {
                 $plantillaFila = "vista/html/fila.html";
                 $plantillaListado = "vista/html/listado.html";
             }
             self::$_listado = self::_vista($datos, $plantillaFila);
             $datos = array();
             $plantilla = "vista/html/enlace_inicio.html";
             $enlace = self::_vista($datos, $plantilla);
             $datos = array("listado" => self::$_listado);
             $salida = self::_vista($datos, $plantillaListado);
             $plantilla = "vista/html/plantilla.html";
             $datos = array("titulo" => self::$_titulo, "enlace" => $enlace, "opcion" => self::$_opcion, "formulario" => $salida);
             $html = self::_vista($datos, $plantilla);
             print $html;
             break;
         case 'formulario':
             self::$_mensaje = $validacion->controlErrores();
             $plantilla = "vista/html/formulario_buscar.html";
             $datos = array("mensaje" => self::$_mensaje, "validacionCodigo" => $validacion->validateField("codigo"), "codigo" => $validacion->setValue("codigo"));
             $formulario = self::_vista($datos, $plantilla);
             $plantilla = "vista/html/plantilla.html";
             $datos = array("titulo" => self::$_titulo, "enlace" => '', "opcion" => self::$_opcion, "formulario" => $formulario);
             $html = self::_vista($datos, $plantilla);
             print $html;
             break;
     }
 }