private static function readView()
 {
     $plantilla = new Template();
     $bd = new BaseDatos();
     $gestor = new ManageArtist($bd);
     $gestorUsuario = new ManageUser($bd);
     $gestorimagenes = new ManageGallery($bd);
     //Carga de plantillas
     $vista = $plantilla->getContents("../_plantilla1/_index.html");
     $nav = $plantilla->getContents("../_plantilla1/_nav.html");
     $login = $plantilla->getContents("../_plantilla1/_login.html");
     $gallery = $plantilla->getContents("../_plantilla1/_gallery.html");
     $artistas_plantilla = $plantilla->getContents("../_plantilla1/_artistas.html");
     $lista_artistas = $plantilla->getContents("../_plantilla1/_lista-artistas.html");
     //Todos los Artistas ------------------------------
     $usuarios = $gestorUsuario->getList();
     $imagenes = $gestorimagenes->getList();
     $elementos = "";
     $elementos_a = "";
     foreach ($usuarios as $key => $artista) {
         if ($artista->getActivo() == 1 || $artista->getPersonal() == 1 || $artista->getAdministrador() == 1) {
             $elemento_i = $plantilla->replace("nombre_artista", $artista->getAlias(), $lista_artistas);
             $elemento_i = $plantilla->replace("mail_artista", $artista->getEmail(), $elemento_i);
             $elementos_a .= $elemento_i;
         }
     }
     if (Request::req("email") == "") {
         $elementos = self::loadImage($plantilla, $gallery, $imagenes, $elementos);
     } else {
         $email = Request::req("email");
         $email_artista = $gestorUsuario->get($email)->getEmail();
         $art_album = $gestor->get($email_artista)->getGaleria();
         $galeria_personalizada = $gestorimagenes->getList();
         foreach ($galeria_personalizada as $key => $imagen) {
             if ($imagen->getId() == $art_album) {
                 $elemento = $plantilla->replace("src", $imagen->getImagen(), $gallery);
                 $elemento = $plantilla->replace("piefoto", $imagen->getDescripcion(), $elemento);
                 $elemento = $plantilla->replace("id_imagen", $imagen->getId_imagen(), $elemento);
                 $elemento = $plantilla->replace("album", $imagen->getId(), $elemento);
                 $elementos .= $elemento;
             }
         }
     }
     $artistas_plantilla = $plantilla->replace("lista_artistas", $elementos_a, $artistas_plantilla);
     $datos = array("nav" => $nav, "work" => "", "edit" => "", "titulo" => "Galeria de Arte", "formulario" => "", "mensajes" => "", "descripcion" => 'Arte por todas partes', "login" => $login, "profile" => "", "upload" => "", "artistas" => $artistas_plantilla, "gallery" => "{$elementos}", "contact" => "");
     echo $plantilla->insertTemplate($vista, $datos);
 }
Exemplo n.º 2
0
<?php

session_start();
require '../clases/AutoCarga.php';
$bd = new DataBase();
$gestor = new ManageUser($bd);
$usuarios = $gestor->getList();
$gestorFB = new ManageUserFB($bd);
$usuariosFB = $gestorFB->getList();
$op = Request::get("op");
$r = Request::get("r");
?>
<!doctype html>
<html lang="es">
<head>
    <title>Lista de Usuarios</title>
    <meta charset="UTF-8">
    <script src="https://apis.google.com/js/platform.js" async defer></script>
    <meta name="google-signin-client_id" content="651943431283-tb9q600cd4v5b8dotsqkdv1gvcmnmab6.apps.googleusercontent.com">
    <link rel="stylesheet" type="text/css" href="../css/estilosAltaNavidad.css">
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../js/scripts.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
</head> 
<body>
    <div id="cont">
        <div id="header"><span class="title"><b>A</b>rt of <b>A</b>rchitecture</span>
            <span class="enlaces">
                <a href="user.php"><b class="selected">Profile</b></a>
                <a href="about.html">About Us</a>
                <a href="quentin.html">Quentin</a>
Exemplo n.º 3
0
<?php

require '../clases/AutoCarga.php';
$bd = new DataBase();
$gestor = new ManageUser($bd);
$clientes = $gestor->getList();
$op = Request::get("op");
$r = Request::get("r");
$page = Request::get("page");
if ($page === null || $page === "") {
    $page = 1;
}
/* Nos devuelve el numero de paginas */
$registros = $gestor->count();
$pages = ceil($registros / Constant::NRPP);
/**/
$order = Request::get("order");
$sort = Request::get("sort");
$orden = "{$order} {$sort}";
$trozoEnlace = "";
if (trim($orden) != "") {
    $trozoEnlace = "&order={$order}&sort={$sort}";
}
$clientes = $gestor->getList($page, trim($orden));
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <link href="../css/estilos.css" rel="stylesheet">
Exemplo n.º 4
0
<?php

require '../clases/AutoCarga.php';
$sesion = new Session();
$sesion->administrador();
$bd = new DataBase();
$gestor = new ManageUser($bd);
$sesion->autentificado();
$user = $sesion->getUser();
$sesion->administrador("viewuser.php");
$error = Request::get("r");
$lista = $gestor->getList();
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>View User</title>
    </head>
    <body>
        <?php 
echo $error;
echo "Admin: " . $user->getEmail() . "--> <a href='phplogout.php'>Logout</a> <br/><br/>";
foreach ($lista as $indice => $usu) {
    echo $usu;
    echo "<a href='vieweditAdmin.php?email={$usu->getEmail()}'>Editar</a>";
    echo '<br/>';
}
?>
        <br/><br/>
        <a href="viewaltaAdmin.php">Alta Usuario</a>
Exemplo n.º 5
0
<?php

require '../clases/AutoCarga.php';
$bd = new BaseDatos();
$modelo = new ManageUser($bd);
$usuario = new Usuario();
$usuarios = $modelo->getList();
$sesion = new Session();
if (!$sesion->isLogged()) {
    header("Location: ../frontend/index.php");
    exit;
} else {
    if ($sesion->getUser()->getAdministrador() != 1 || $sesion->getUser()->getActivo() != 1) {
        header("Location: ../frontend/index.php");
    } else {
        ?>
        <!DOCTYPE HTML>
        <html>
            <head>
                <title>Admin</title>
                <meta name="viewport" content="width=device-width, initial-scale=1">
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                 <link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

                <!-- MetisMenu CSS -->
                <link href  ="../bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">
        
                <!-- Timeline CSS -->
                <link href  ="../dist/css/timeline.css" rel="stylesheet">
        
                <!-- Custom CSS -->
Exemplo n.º 6
0
<?php

require './clases/AutoCarga.php';
$sesion = new Session();
$bd = new DataBase();
$gestor = new ManageUser($bd);
$user = $gestor->getList();
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <h1>Lista de usuarios</h1>
         <?php 
foreach ($user as $indice => $usuario) {
    echo "<h3>Login: "******"</h3>";
    echo "<h3>Nombre: " . $usuario->getName() . "</h3>";
    echo "<h3>Apellido: " . $usuario->getLastname() . "</h3>";
    if ($usuario->getAdmin() == 1) {
        echo "<h3> Es administrador</h3>";
    } else {
        echo "<h3> No es administrador</h3>";
    }
    echo "<a href='phppermisos.php?ID=" . $usuario->getID() . "'>Editar permisos</a> ";
    echo "<a href='phpdeleteUser.php?ID=" . $usuario->getID() . "'>Borrar</a>";
    echo "<hr>";
}
?>
Exemplo n.º 7
0
<?php

require '../clases/AutoCarga.php';
$bd = new DataBase();
$gestor = new ManageUser($bd);
$usuarios = $gestor->getList();
$op = Request::get("op");
$r = Request::get("r");
$page = Request::get("page");
if ($page === null || $page === "") {
    $page = 1;
}
/*Nos devuelve el numero de paginas*/
$registros = $gestor->count();
$pages = ceil($registros / Constant::NRPP);
/**/
$order = Request::get("order");
$sort = Request::get("sort");
$orden = "{$order} {$sort}";
$trozoEnlace = "";
if (trim($orden) != "") {
    $trozoEnlace = "&order={$order}&sort={$sort}";
}
$usuarios = $gestor->getList($page, trim($orden));
?>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
Exemplo n.º 8
0
 private static function viewAdmin($mensaje = "", $tipo = "")
 {
     $sesion = new Session();
     $sesion->autentificado();
     $user = $sesion->getUser();
     $bd = new DataBase();
     $gestor = new ManageUser($bd);
     $usuarios = $gestor->getList();
     $plantilla = new Plantilla('plantillas/index/Theme/index.html');
     $plantilla->insertPlantilla('plantillas/index/user/_view.html', "main");
     $plantilla->insertUserTags($user);
     $plantilla->alerts($mensaje, $tipo);
     $plantilla->insertUsuariosAdmin($usuarios);
     $plantilla->mostrar();
 }
Exemplo n.º 9
0
<?php

require '../clases/AutoCarga.php';
$bd = new DataBase();
$gestor = new ManageUser($bd);
$clientes = $gestor->getList();
$user = Request::post("user");
$password = Request::post("password");
$sesion = new Session();
foreach ($clientes as $indice => $cliente) {
    if ($user == $cliente->getUsuario() && $password == $cliente->getPassword()) {
        echo "LOGINNN";
        if ($cliente->getUsuario() == "admin" && $cliente->getPassword() == "admin") {
            header("Location:../index.php");
        } else {
            $sesion->set("user", $user);
            $sesion->set("id", $cliente->getId_cliente());
            header("Location:../paginasUsuarios/index.php");
        }
    } else {
        echo "NO LOGINN";
    }
}
/*if($clientes->getUsuario() && $clientes->getPassword()){
     $sesion->set("user", $user);
     header("Location:index.php");
}*/
        $session->sendRedirect("login.php");
    }
} else {
    $sesion->sendRedirect("login.php");
}
$pagination = false;
if ($usuarioManager->count() > 6) {
    $page = Request::get("page");
    if ($page === null) {
        $page = 1;
    }
    $pagination = true;
    $pager = new Pager($usuarioManager->count(), 6, $page);
}
if (!$pagination) {
    $usuarios = $usuarioManager->getList(1, "email", $usuarioManager->count());
} else {
    $usuarios = $usuarioManager->getList($page, "email", 6);
}
?>

<!DOCTYPE html>
<html lang="es">
    <head>
        <title>Socializate</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="css/style.css" />
    </head>
    <body>
		<nav>
			<a href="index.php"><img src="resources/logo.png" class="logo"/></a>
 private static function viewIndex()
 {
     $db = new DataBase();
     $manager = new ManageUser($db);
     $managerArt = new ManageArt($db);
     $sesion = new Session();
     $nav = new Template('./template/_navvisit.html');
     if ($sesion->isLogged()) {
         $usuario = $manager->get($sesion->getUser());
         if ($usuario->getAdmin() == 1) {
             $nav = new Template('./template/_navadmin.html');
         } else {
             $nav = new Template('./template/_navuser.html');
         }
     }
     $todosAutores = $manager->getList();
     $autores = "";
     $i = 1;
     foreach ($todosAutores as $autor) {
         $timeline = "";
         $portfolio = "";
         $item = "";
         $portfolioTemplate = "";
         $portfolioItem = "";
         switch ($autor->getStyle()) {
             case "escultura":
                 $portfolioTemplate = "./template/_escultor.html";
                 $portfolioItem = "./template/_escultor_item.html";
                 break;
             case "pintura":
                 $portfolioTemplate = "./template/_pintura.html";
                 $portfolioItem = "./template/_pintura_item.html";
                 break;
             case "fotografia":
                 $portfolioTemplate = "./template/_fotografia.html";
                 $portfolioItem = "./template/_fotografia_item.html";
                 break;
             default:
                 break;
         }
         $todosArt = $managerArt->getList($autor->getEmail());
         foreach ($todosArt as $art) {
             $argsart = array("title" => $art->getTitle(), "image" => $art->getImage(), "cdate" => $art->getCdate());
             $itemTemp = new Template($portfolioItem, $argsart);
             $item .= $itemTemp->get();
         }
         $porTemp = new Template($portfolioTemplate, array("items" => $item));
         $portfolio = $porTemp->get();
         if ($i % 2 == 0) {
             $timeline = 'class="timeline-inverted"';
         }
         $argsaut = array("alias" => $autor->getAlias(), "image" => $autor->getImage(), "description" => $autor->getDescription(), "inverted" => $timeline, "portfolio" => $portfolio);
         $templateAutor = new Template('./template/_author.html', $argsaut);
         $autores .= $templateAutor->get();
         $i++;
     }
     $args = array("linksnav" => $nav->get(), "autores" => $autores);
     $template = new Template('./template/_index.html', $args);
     $template->show();
     $db->close();
 }