<?php include '../header.php'; $banner = new Album('banner'); /* ============= Deletar imagem =============== */ if ((int) Dbcommand::get('del') > 0 && (int) Dbcommand::get('del') <= $banner->size) { unlink(".." . $banner->photo[Dbcommand::get('del') - 1]->getDir()); /* Deletando arquivo em "../components/img" */ header("Location: index.php?msg=" . $banner->photo[Dbcommand::get('del') - 1]->delete()); /* Deletando registro do banco */ } /* ============= Adicionar imagem =============== */ if (@$_POST) { header("Location: index.php?msg=" . $banner->addPhoto($user->getId())); } ?> <!-- Banner --> <div class="col-xs-12 col-sm-10"> <div class="jumbotron"> <a href="./"><h1>Banners</h1></a> <br/> <?php echo Message::get(); ?> <form enctype="multipart/form-data" action="index.php" method="post"> <fieldset> <div> <h4>Nome:</h4> <input type='text' name='name_photo' class="form-control" placeholder="Digite o Nome do Banner" pattern="^[^<>]{0,255}$" required/> </div>
<div> <input type='password' id='password1' name='password1_user' class="form-control" placeholder="Senha" required/> </div> <div> <input type='password' id='password2' name='password2_user' class="form-control" placeholder="Confirme a senha" required/> </div> <a href="../" class="btn btn-primary pull-left">Voltar</a> <button type="submit" class="btn btn-primary pull-right" >Cadastrar</button> <button type="reset" class="btn btn-primary pull-right" >Cancelar</button> <br /> </fieldset> </form> </div> </div> </div> </div> <?php // Se cadastrado com sucesso, pergunta se pode redirecionar pro Login if (Dbcommand::get("msg") == 6) { ?> <script> var goLogin = confirm("Cadastrado com Sucesso! \nDeseja Logar-se?"); if (goLogin){ location.href="../"; } </script> </body> </html> <?php }
<?php include '../header.php'; if ((int) Dbcommand::get('del') > 0 && (int) Dbcommand::get('del') <= $company->links->size) { $i = Dbcommand::get('del') - 1; $company->links->link[$i]->get(); for ($j = 0; $j < $company->links->link[$i]->album->size; $j++) { unlink("../" . $company->links->link[$i]->album->photo[$j]->getDir()); /* Deletando arquivo em "../components/img" */ } header("Location: index.php?msg=" . $company->links->link[$i]->delete()); // Deletando registro } if (@$_POST) { header("Location: index.php?msg=" . $company->links->addLink($user->getId())); } ?> <!-- Links --> <div class="col-xs-12 col-sm-10"> <div class="jumbotron"> <a href="./"><h1>Links</h1></a> <br /> <?php echo Message::get(); ?> <form enctype="multipart/form-data" action="index.php" method="post"> <fieldset> <div> <h4>Nome:</h4> <input type='text' name='name_link' class="form-control" placeholder="Nome" pattern="^[^<>]{0,255}$" required/>
<?php include_once '../header.php'; $banner = new Album('banner'); if ((int) Dbcommand::get('up') < 1 || (int) Dbcommand::get('up') > $banner->size) { header("Location: index.php"); } else { /* ============= Editar nome e/ou foto =============== */ $i = (int) Dbcommand::get('up') - 1; /* Guarda o indice que foi passado pelo get do nome e foto a ser editado */ if (@$_POST) { if ($_FILES['photo']['name'] != '') { /* Atualiza apenas o nome e foto nova */ $name = Photo::getSendName(); /* Guarda diretorio com novo nome */ if (is_int($name)) { /* Verificando se eh o nome da imagem ou a mensagem de erro (inteiro) */ header("Location: view.php?up=" . ($i + 1) . "&msg=" . $name); } else { unlink("../" . $banner->photo[$i]->getDir()); /* Deletando arquivo em "../components/img" */ header("Location: view.php?up=" . ($i + 1) . "&msg=" . $banner->photo[$i]->update($user->getId(), Dbcommand::getServer() . $name)); /* Adiciona nova foto com novo endereco */ } } else { /* Atualiza apenas o nome passando a url antiga */ header("Location: view.php?up=" . ($i + 1) . "&msg=" . $banner->photo[$i]->update($user->getId(), $banner->photo[$i]->url)); } } ?> <!-- Banner -->
<?php include_once '../header.php'; if ((int) Dbcommand::get('up') < 1 || (int) Dbcommand::get('up') > $company->links->size) { header("Location: index.php"); } else { /* ============= Editar nome e/ou foto =============== */ $i = Dbcommand::get('up') - 1; $company->links->link[$i]->get(); if (@$_POST) { if ($_FILES['photo']['name'] != '') { /* Atualiza apenas o nome e foto nova */ $name = Photo::getSendName(); /* Guarda diretorio com novo nome */ if (is_int($name)) { /* Verificando se eh o nome da imagem ou a mensagem de erro (inteiro) */ header("Location: view.php?up=" . ($i + 1) . "&msg=" . $name); } else { for ($j = 0; $j < $company->links->link[$i]->album->size; $j++) { unlink(".." . $company->links->link[$i]->album->photo[$j]->getDir()); /* Deletando arquivo em "../components/img" */ } header("Location: view.php?up=" . ($i + 1) . "&msg=" . $company->links->link[$i]->update($user->getId(), Dbcommand::getServer() . $name)); } } else { /* Atualiza apenas o nome passando a url antiga */ header("Location: view.php?up=" . ($i + 1) . "&msg=" . $company->links->link[$i]->update($user->getId())); } } ?> <!-- Links -->
<?php $no_need_login = true; $no_visible_elements = true; include '../header.php'; $banner = new Album('empresa'); /* ============= Deletar imagem =============== */ if ((int) Dbcommand::get('del')) { for ($i = 0; $i < $banner->size; $i++) { unlink(".." . $banner->photo[$i]->getDir()); // Deletando arquivo em "../components/img" header("Location: admin.php?msg=" . $banner->photo[$i]->delete()); // Deletando registro } } /* ============= Adicionar imagem =============== */ if (@$_POST) { $company->setName(); header("Location: admin.php?msg=" . $banner->addPhoto($user->getId())); } ?> <div class="container"> <div class="row"> <div class="col-xs-12 col-sm-10"> <div class="jumbotron"> <a href="../"><h1>Logomarca</h1></a> <br/> <?php echo Message::get(); ?>
<?php $no_need_login = true; $no_visible_elements = true; include_once "header.php"; if (Dbcommand::get("logout") == 1) { session_start(); unset($_SESSION['usuario_logado']); session_destroy(); header("Location: login.php"); } if (@$_POST) { header("Location: login.php?msg=" . $user->login()); } ?> <!-- Login --> <div class="container"> <div class="login row"> <div class="col-md-4 formulario well"> <img src="<?php echo $company->album->photo[0]->url; ?> " alt="<?php echo $company->getName(); ?> " /><br/> <?php echo Message::get(); ?> <form action="login.php" method="post">
<?php include '../header.php'; $clients = new Album('clientes'); /* ============= Deletar imagem =============== */ if ((int) Dbcommand::get('del') > 0 && (int) Dbcommand::get('del') <= $clients->size) { unlink(".." . $clients->photo[Dbcommand::get('del') - 1]->getDir()); /* Deletando arquivo em "../components/img" */ header("Location: ./?msg=" . $clients->photo[Dbcommand::get('del') - 1]->delete()); /* Deletando registro do banco */ } /* ============= Adicionar imagem =============== */ if (@$_POST) { header("Location: ./?msg=" . $clients->addPhoto($user->getId())); } ?> <!-- Portfolio --> <div class="col-xs-12 col-sm-10"> <div class="jumbotron"> <a href="./"><h1>Portfólio</h1></a> <br/> <?php echo Message::get(); ?> <form enctype="multipart/form-data" action="index.php" method="post"> <fieldset> <div> <h4>Nome:</h4> <input type='text' name='name_photo' class="form-control" placeholder="Digite o Nome do Cliente" pattern="^[^<>]{0,255}$" required/> </div>