ok
Direktori : /home/pequenacapitolio/www/administrador/ |
Current File : /home/pequenacapitolio/www/administrador/projetos_admin.php |
<?php include '../conexao.php'; // ############# INSERE PAGINA ################### if (isset($_GET["act"]) && $_GET["act"] == "inserir") { $pag_cliente = $_POST["cliente"]; $pag_industria = $_POST["industria"]; $dados_cat = array( 'cliente' => $pag_cliente, 'industria' => $pag_industria, ); $conn->prepare("INSERT INTO projetos (cliente,industria) VALUES (:cliente, :industria)")->execute($dados_cat); sleep(2); $pagedit = $conn->query("SELECT idprojeto FROM projetos ORDER BY idprojeto DESC LIMIT 1"); $pagedit2 = $pagedit->fetch(PDO::FETCH_OBJ); $redirect = "/administrador/projeto_detalhe_admin.php?&id=$pagedit2->idprojeto"; //$redirect = "http://www.tchaudor.com.br/administrador/projetos_admin.php"; header("location:$redirect"); } // ############# DELETA PAGINA ################### if (isset($_GET["act"]) && $_GET["act"] == "excluir") { $pag_exclui = $_GET["id"]; $dados_cat = array( 'id' => $pag_exclui, ); $conn->prepare("DELETE FROM projetos WHERE idprojeto = :id")->execute($dados_cat); $redirect = "/administrador/projetos_admin.php"; //$redirect = "http://www.tchaudor.com.br/administrador/projetos_admin.php"; header("location:$redirect"); } ?> <!DOCTYPE html> <html> <head> <?php include 'include_head.php';?> </head> <body class="hold-transition skin-blue sidebar-mini"> <!-- Site wrapper --> <div class="wrapper"> <?php include 'estrutura_menu.php';?> <!-- =============================================== --> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <div class="col-md-12" style="background: #fff;border-bottom: 1px solid #bbbbbb"> <div class="col-md-12" style="text-align: left;padding-left: 0px"> <p style="color: #040404;font-weight: 700;font-size: 32px;margin-top: 1%;margin-bottom: 0px">Gerenciamento Pequena Capitólio</p> </div> <div class="col-md-8" style="height: 34px;padding-left: 0px"> <p style="color: #3a3a3a;font-size: 14px;">Tela Inicial/Gerenciamento Pequena Capitólio</p> </div> <div class="col-md-4" style="text-align: right;margin-bottom: 1%"> <!-- <a href="categorias_projetos_admin.php" class="btn btn-primary btn-flat" style="margin-right: 4%">Gerenciar Categorias</a> --> <!-- <a href="#" data-toggle="modal" data-target="#modal-inserir" class="btn btn-primary btn-flat">Inserir Página Interna</a> --> </div> </div> <div class="col-md-12" style="height: 22px"> </div> <!-- Main content --> <section class="content"> <?php $pag = $conn->query("SELECT idprojeto,cliente FROM projetos ORDER BY idprojeto DESC"); ?> <div class="row"> <div class="col-xs-12"> <div class="box" style="border-top:5px solid #408db9"> <div class="box-body table-responsive no-padding"> <!-- <a href="#" data-toggle="modal" data-target="#modal-inserir" class="btn btn-primary btn-flat" style="float:right; margin:20px;">Inserir Projeto</a> --> </div> <!-- /.box-header --> <div class="box-body table-responsive no-padding"> <?php while ($paginas = $pag->fetch(PDO::FETCH_OBJ)) {?> <div class="col-md-4" style="padding-top: 3%;background: #fff"> <div class="box box-widget widget-user"> <!-- Add the bg color to the header using any of the bg-* classes --> <div class="widget-user-header bg-aqua-active"> <h3 class="widget-user-username"><?php echo $paginas->cliente ?></h3> <!-- <h5 class="widget-user-desc"><?php echo $depo->titulo ?></h5> --> </div> <div class="widget-user-image"> <!-- <img class="img-circle" style="background: #ddd;height: 90px;width: 90px" src="uploads/imagens/<?php echo $depo->foto ?>" alt="User Avatar"> --> </div> <div class="box-footer"> <div class="row"> <div class="col-sm-4 border-right"> <div class="description-block"> <!-- <a href="#" data-toggle="modal" data-target="#modal-inserir" class="btn btn-primary btn-flat" style="margin-right: 4%;background: #00a7d0;border-color: #00a7d0">Inserir </a> --> <!-- <a href="#" data-toggle="modal" data-target="#modal-foto<?php echo $paginas->idprojeto ?>"><i style="margin-right:20px;" class="fas fa-camera"></i></a> --> </div> <!-- /.description-block --> </div> <!-- /.col --> <div class="col-sm-4 border-right"> <div class="description-block"> <!-- <a href="#" data-toggle="modal" data-target="#modal-inserir" class="btn btn-primary btn-flat" style="margin-right: 4%;background: #00a7d0;border-color: #00a7d0">Inserir </a> --> <a href="projeto_detalhe_admin.php?&id=<?php echo $paginas->idprojeto ?>"><i style="margin-right:20px;" class="fas fa-pencil-alt"></i></a> </div> <!-- /.description-block --> </div> <!-- /.col --> <div class="col-sm-4"> <div class="description-block"> <!-- <a href="#" data-toggle="modal" data-target="#modal-inserir" class="btn btn-primary btn-flat" style="margin-right: 4%;background: #00a7d0;border-color: #00a7d0">Inserir</a> --> <a href="projetos_admin.php?act=excluir&id=<?php echo $paginas->idprojeto ?>"><i class="fas fa-trash-alt"></i></a> </div> <!-- /.description-block --> </div> <!-- /.col --> </div> <!-- /.row --> </div> </div> </div> <?php }?> </table> </div> <!-- /.box-body --> </div> <!-- /.box --> </div> </div> </section> <!-- /.content --> </div> <!-- /.content-wrapper --> <?php include 'estrutura_rodape.php';?> <!-- ########## MODAL INSERIR ########## --> <div class="modal fade" id="modal-inserir"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span></button> <h4 class="modal-title">Inserir Especialidade</h4> </div> <div class="modal-body"> <div class="row"> <form action="projetos_admin.php?act=inserir" method="POST" enctype="multipart/form-data"> <div class="col-xs-12 pad"> <input type="text" name="cliente" class="form-control" placeholder="Titulo*" required> </div> <div class="col-xs-12 pad"> <input type="text" name="industria" class="form-control" placeholder="Subtitulo"> </div> <div class="col-xs-12 pad"> <button type="submit" class="btn btn-primary" style="margin-top:20px;">Cadastrar</button> </div> </form> </div> </div> <!-- <div class="modal-footer"> <button type="button" class="btn btn-default pull-left" data-dismiss="modal">Fechar</button> </div> --> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <!-- /.modal --> <!-- Add the sidebar's background. This div must be placed immediately after the control sidebar --> <div class="control-sidebar-bg"></div> </div> <!-- ./wrapper --> <!-- jQuery 3 --> <script src="bower_components/jquery/dist/jquery.min.js"></script> <!-- Bootstrap 3.3.7 --> <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <!-- SlimScroll --> <script src="bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script> <!-- FastClick --> <script src="bower_components/fastclick/lib/fastclick.js"></script> <!-- CK Editor --> <script src="bower_components/ckeditor/ckeditor.js"></script> <!-- AdminLTE App --> <script src="dist/js/adminlte.min.js"></script> <!-- AdminLTE for demo purposes --> <script src="dist/js/demo.js"></script> <script> $(document).ready(function () { $('.sidebar-menu').tree() }) </script> <script> $(function () { // Replace the <textarea id="editor1"> with a CKEditor // instance, using default configuration. CKEDITOR.replace('editor1') //bootstrap WYSIHTML5 - text editor $('.textarea').wysihtml5() }) </script> <script type="text/javascript"> $("#site").click(function(){ if ($("#sitehidden").val() == "1") { $("#sitehidden").val("0"); }else{ $("#sitehidden").val("1"); } }); $("#app").click(function(){ if ($("#apphidden").val() == "1") { $("#apphidden").val("0"); }else{ $("#apphidden").val("1"); } }); $("#sistema").click(function(){ if ($("#sistemahidden").val() == "1") { $("#sistemahidden").val("0"); }else{ $("#sistemahidden").val("1"); } }); function reloadPage(){ location.reload(true); } </script> <?php $scriptmodal = $conn->query("SELECT paginas.idpagina, paginas.titulo as titulopagina, paginas.id_categoria, paginas.subtitulo, paginas.corpo, categorias_paginas.titulo as titulocategoria FROM paginas inner join categorias_paginas on paginas.id_categoria = categorias_paginas.idcategorias order by idpagina desc"); // ##### SELECT IGUAL O DA LISTA COM MESMA ORDENAÇÃO PARA QUE TENHA O MESMO RESULTADO ####### while ($pagscript = $scriptmodal->fetch(PDO::FETCH_OBJ)) { // ######### LAÇO DE REPETIÇÃO SCRIPT CKEDITOR - MODAL CONFORME SELECT ANTERIOR ?> <script> $(function () { // Replace the <textarea id="editor1"> with a CKEditor // instance, using default configuration. CKEDITOR.replace('editor<?php echo $pagscript->idpagina+1 ?>') //bootstrap WYSIHTML5 - text editor $('.textarea').wysihtml5() }) </script> <?php }?> </body> </html>