<?php include_once "../Librerias/Datasource.php"; include_once "../Librerias/AdministradorDao.php"; include_once "../Librerias/Administrador.php"; include_once "../Librerias/Variables.php"; $conn = new Datasource($dbhost, $dbName, $dbUser, $dbPassword); $adao = new AdministradorDao(); $admin = new Administrador(); $admin = $adao->getObject($conn, $_POST["idAdmin"]); $admin->setPrimerNom(utf8_decode($_POST["primerNom"])); $admin->setSegundoNom(utf8_decode($_POST["segundoNom"])); $admin->setPrimerApe(utf8_decode($_POST["primerApe"])); $admin->setSegundoApe(utf8_decode($_POST["segundoApe"])); $admin->setEmail($_POST["email"]); if ($adao->save($conn, $admin)) { ?> <META HTTP-EQUIV="REFRESH" CONTENT="0,URL=../Interfaces/admon.php"> <script type="text/javascript"> alert("Administrador cambiado exitosamente"); </script> <?php } else { echo "<META HTTP-EQUIV='REFRESH' CONTENT='0,URL=../Interfaces/modificarAdmin.php?idAdmin=" . $_POST["idAdmin"] . "'>"; ?> <script type="text/javascript"> alert("Error alterando el registro"); </script> <?php }
</script> <meta http-equiv="refresh" content="0,url=principal.php"> <?php } } else { $conn = new Datasource($dbhost, $dbName, $dbUser, $dbPassword); $adao = new AdministradorDao(); $busqueda = new Administrador(); $admin = new Administrador(); $busqueda->setIdAdministrador($_SESSION["ID"]); $list = $adao->searchMatching($conn, $busqueda); $admin = $list[0]; $pdao = new PerfilDao(); $listPerfiles = $pdao->loadAll($conn); $adminmodificar = new Administrador(); $adminmodificar = $adao->getObject($conn, $_GET["idAdministrador"]); ?> <!DOCTYPE html> <html> <head> <title>Manos de Oro - Inicio</title> <link rel="apple-touch-icon" sizes="57x57" href="../imgs/icono/apple-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="../imgs/icono/apple-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="../imgs/icono/apple-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="../imgs/icono/apple-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="../imgs/icono/apple-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="../imgs/icono/apple-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="../imgs/icono/apple-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="../imgs/icono/apple-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="../imgs/icono/apple-icon-180x180.png"> <link rel="icon" type="image/png" sizes="192x192" href="../imgs/android-icon-192x192.png">
</script> <meta http-equiv="refresh" content="0,url=admon.php"> <?php } else { ?> <script> alert("No tienes permiso para ver esto. Ser\u00e1s redireccionado a tu p\u00e1gina de inicio"); </script> <meta http-equiv="refresh" content="0,url=principal.php"> <?php } } else { $conn = new Datasource($dbhost, $dbName, $dbUser, $dbPassword); $adao = new AdministradorDao(); $pdao = new ProductoDao(); $admin = $adao->getObject($conn, $_SESSION["ID"]); $busqueda = new Producto(); $busqueda->setAceptado(2); $productos = $pdao->searchMatching($conn, $busqueda); $altofoto = 150; $anchofoto = 180; ?> <!DOCTYPE html> <html> <head> <title>Manos de Oro - Contacto</title> <link rel="apple-touch-icon" sizes="57x57" href="../imgs/icono/apple-icon-57x57.png">