private static function readView($gestor) { // $filtro = Request::get("filtro"); // if ($filtro === null) { // $params = array(); // $condicion = "1=1"; // } else { // $params["filtro"] = $filtro . "%"; // $condicion = "Name like :filtro"; // } // // $order = Request::get("order"); // $orderby = "Name, CountryCode, ID"; // if ($order !== null) { // $orderby = "$order, $orderby"; // } // // $registros = $gestor->count($condicion, $params); // $paginacion = new Pager($registros, Request::get("rpp"), Request::get("pagina")); // $parametros = new QueryString(); // // $op = null; // // $listaArtistas = $gestor->getList($paginacion->getPaginaActual(), $orderby, $paginacion->getRpp(), $condicion, $params); $plantillaArtista = file_get_contents('plantillas/_main.html'); $artistabox = file_get_contents('plantillas/_artistabox.html'); $gestorArtista = new ManageArtista(new DataBase()); $listaArtistas = $gestorArtista->getList(); $listaCuadros = ""; foreach ($listaArtistas as $key => $value) { $datosArtista = str_replace('{alias}', $value->getAlias(), $artistabox); $datosArtista = str_replace('{email}', $value->getEmail(), $datosArtista); $listaCuadros .= $datosArtista; } $plantillaArtista = str_replace("{artistabox}", $listaCuadros, $plantillaArtista); echo $plantillaArtista; }
<?php require '../clases/AutoCarga.php'; $bd = new DataBase(); $sesion = new Session(); $gestor = new ManageArtista($bd); $email = Request::post("email"); $clave = Request::post("clave"); $artista = $gestor->get($email); $email = $artista->getEmail(); //si el usuario no existe if ($email === null) { header("Location:login.php?error=exist"); } else { if (sha1($clave) !== $artista->getClave()) { header("Location:login.php?error=clave"); } else { if ($artista->getActivo() === "0") { header("Location:login.php?error=activo"); } else { $sesion->setUser($artista); $sesion->sendRedirect("index.php"); } } }
<?php require '../clases/AutoCarga.php'; $bd = new DataBase(); $gestorArtista = new ManageArtista($bd); $gestorLugar = new ManageLugar($bd); $gestorTipoEvento = new ManageTipoEvento($bd); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <a href="../login/administrador.php">Volver al Menú</a> <h3>Añadir Evento</h3> <form action="insertEvento.php" method="post" > Nombre evento<input type="text" name="nombre"/></br> Fecha<input type="date" name="fecha"/></br> Artista<?php echo Util::getSelect("ID_artista", $gestorArtista->getValuesSelect()); ?> <br> Lugar<?php echo Util::getSelect("ID_lugar", $gestorLugar->getValuesSelect()); ?> <br> Tipo evento<?php echo Util::getSelect("nombre_tipo", $gestorTipoEvento->getValuesSelect());
<?php require './clases/AutoCarga.php'; $bd = new DataBase(); $gestor = new ManageArtista($bd); $artistas = $gestor->getList(); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" type="text/css" href="./estilos/estilos.css"/> </head> <body> <div id="cabeceraIndex"> <div id="logo"> <img src="./estilos/ticket-icon.png" width="250" height="100"/> </div> <nav> <a href="index.php" >Inicio</a> <a href="#" >Artistas</a> <a href="./login/adm.html">Admin</a> </nav> </div> <div id="cuerpoIndex"> <h1>Artistas</h1> <div id="listaArtistas"> <div id="tablaEventos"> <ul>
<?php require '../clases/AutoCarga.php'; $bd = new DataBase(); $gestorEvento = new ManageEvento($bd); $id = Request::get("ID_evento"); $evento = $gestorEvento->get($id); $gestorArtista = new ManageArtista($bd); $gestorLugar = new ManageLugar($bd); $gestorTipo = new ManageTipoEvento($bd); // var_dump($gestorCountry->getValuesSelect()); ?> <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <form action="phpEditarEvento.php" method="post" > <input type="hidden" name="pkID" value="<?php echo $evento->getID_evento(); ?>
<?php require './clases/AutoCarga.php'; require './clases/ManageRelaciones.php'; $bd = new DataBase(); $gestor = new ManageArtista($bd); $ID_artista = Request::get("ID_artista"); $artista = $gestor->get($ID_artista); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" type="text/css" href="./estilos/estilos.css"/> </head> <body> <div id="cabeceraIndex"> <div id="logo"> <img src="./estilos/ticket-icon.png" width="250" height="100"/> </div> <nav> <a href="index.php" >Inicio</a> <a href="artistas.php" >Artistas</a> <a href="./login/adm.html">Admin</a> </nav> </div> <div id="cuerpoIndex"> <?php $nombre = $artista->getNombre_artista();
<img src="./estilos/ticket-icon.png" width="250" height="100"/> </div> <nav> <a href="#" >Inicio</a> <a href="artistas.php" >Artistas</a> <a href="./login/adm.html">Admin</a> </nav> </div> <div id="cuerpoIndex"> <h1>Eventos</h1> <div id="tablaEventos"> <?php $manageEvento = new ManageEvento($bd); $manageLugar = new ManageLugar($bd); $manageArtista = new ManageArtista($bd); $listaEventos = $manageEvento->getList(); ?> <table border="1" class="tablaEventos"> <thead> <th>Evento</th> <th>Fecha</th> <th>Artista</th> <th>Lugar</th> </thead> <?php foreach ($listaEventos as $indice => $evento) { $id2 = $evento->getID_artista(); $artista = $manageArtista->get($evento->getID_artista());
<?php require '../clases/AutoCarga.php'; $bd = new DataBase(); $gestor = new ManageArtista($bd); $id = Request::get("ID_artista"); $f = Request::get("f"); echo "esto es f: " . $f; if ($f === null) { $r = $gestor->delete($id); } else { $r = $gestor->forzarDelete($id); } // var_dump($bd->getError()); header("Location: listarArtistas.php");
<?php require './clases/AutoCarga.php'; $bd = new DataBase(); $gestor = new ManageArtista($bd); $email = Request::get("email"); $sha1 = Request::get("sha1"); if (sha1($email . Constants::SEMILLA) === $sha1) { echo sha1($email . Constants::SEMILLA); $artista = new Usuario(); $artista = $gestor->get($email); $artista->setActivo(1); $r = $gestor->set($artista, $email); echo $r; header("index.php"); }
<?php require '../clases/AutoCarga.php'; $bd = new DataBase(); $gestor = new ManageArtista($bd); $nombre_artista = Request::post("nombre_artista"); $imagen = Request::post("imagen"); $carpeta = "../imagenesArtistas/" . $nombre_artista; if (!file_exists($carpeta)) { //si la carpeta no existe te la crea mkdir($carpeta, 0777, true); } //SUBIR LA IMAGEN DEL ARTISTA $subir = new FileUpload("imagen"); //le pasa el archivo a la clase Fileupload para que lo suba $nombreArchivo = $subir->getNombre(); $name = $_FILES["imagen"]["name"]; $trozos = pathinfo($name); //array $extension = $trozos["extension"]; //extension de la imagen $subir->setDestino("../imagenesArtistas/" . $nombre_artista . "/"); //ruta a donde se va a guardar $subir->setTamaño(2.0E+44); //el tamaño es grande para que no de problemas $subir->setPolitica(FileUpload::RENOMBRAR); $ruta = $nombreArchivo . "." . $extension; //donde se encuentra la imagen if ($subir->upload()) { //se sube el archivp echo 'Archivo subido con éxito';
<?php require '../clases/AutoCarga.php'; require_once '../clases/Google/autoload.php'; require_once '../clases/class.phpmailer.php'; //las últimas versiones también vienen con autoload $sesion = new Session(); $bd = new DataBase(); $gestor = new ManageArtista($bd); //Datos para crear el nuevo usuario $email = Request::post("email"); $clave = Request::post("clave"); $clave2 = Request::post("clave2"); $alias = $email; $fechaalta = date('Y-m-d'); $artista = new Artista($email, sha1($clave), $alias, $fechaalta, 0, 0, "_main1.html"); //Si el email es un email y las claves son iguales, creamos el usuario y le //mandamos el correo de validación if (Filter::isEmail($email) && $clave === $clave2) { //Se comprueba que no exista en la base de datos el nuevo usuario if ($gestor->get($email)->getEmail() != null) { header("Location:altaArtista.php?error=exist"); } else { //$r = Mail::sendMail($email);//Mandamos el email //if($r === "SENT") { $gestor->insert($artista); //Se inserta el usuario en la tabla mkdir("../images/{$email}", 0777, true); header("Location:altaArtista.php?aviso=enviado"); //}else{ // header("Location:altaArtista.php?error=noenviado");