<?php
 include_once('conexao.php');
 include_once('controller.php');
 $conn         = new Conexao();
?>
<!DOCTYPE html>
<html class="loading" lang="pt-br" data-textdirection="ltr">
  
<!-- Mirrored from pixinvent.com/bootstrap-admin-template/robust/html/ltr/horizontal-top-icon-menu-template/dt-advanced-initialization.html by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 12 Feb 2021 19:26:06 GMT -->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="description" content="Robust admin is super flexible, powerful, clean &amp; modern responsive bootstrap 4 admin template.">
    <meta name="keywords" content="admin template, robust admin template, dashboard template, flat admin template, responsive admin template, web app, crypto dashboard, bitcoin dashboard">
    <!--<meta name="author" content="PIXINVENT">-->
    <title><?php include "titulo.php" ?></title>
    <link rel="apple-touch-icon" href="images/ico/apple-icon-120.png">
     <!--Favicon-->
      <link rel="icon" href="../img/core-img/favicon.png">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i%7CMuli:300,400,500,700" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="fonts/feather/style.min.css">
	<link rel="stylesheet" type="text/css" href="fonts/simple-line-icons/style.min.css">
	<link rel="stylesheet" type="text/css" href="fonts/flag-icon-css/css/flag-icon.min.css">
	<link rel="stylesheet" type="text/css" href="vendors/css/extensions/pace.css">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <!-- BEGIN VENDOR CSS-->
	<link rel="stylesheet" href="assets/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="vendors/css/tables/datatable/datatables.min.css">
    <!-- END VENDOR CSS-->
    <!-- BEGIN ROBUST CSS-->
    <link rel="stylesheet" type="text/css" href="css/app.min.css">
    <!-- END ROBUST CSS-->
    <!-- BEGIN Page Level CSS-->
    <link rel="stylesheet" type="text/css" href="css/core/menu/menu-types/horizontal-top-icon-menu.min.css">
    <!-- END Page Level CSS-->
    <!-- BEGIN Custom CSS-->
    <link rel="stylesheet" type="text/css" href="assets/css/style.css">
    <!-- END Custom CSS-->
	
	<!--Cor Linha Datatable e Paginação-->
	<style>
	.table-striped tbody tr.even.selected, .table-striped tbody tr.odd.selected {
    background-color: #065946 !important;
    color: #FFF;
	}
	
	.pagination .page-item.active .page-link {
    background-color: #065946 !important;
    border-color: #065946 !important;
    }
	
	.pagination .page-link {
    color: #000;
    border: 0px solid #065946 !important;
    }
	
    .card.card-fullscreen {
		display: block;
		z-index: 9999;
		position: fixed;
		width: 100% !important;
		height: 100% !important;
		top: 99px;
		right: 0;
		left: 0;
		bottom: 0;
		overflow: auto;
		}
	
	.btn-primary ~ .dropdown-menu .dropdown-item.active {
    background-color: #065946 !important;
    }
	
	div.dataTables_wrapper div.dataTables_filter {
    text-align: right;
    margin-top: -53px;
	}
	
	
	
	</style>
  </head>
  <body class="horizontal-layout horizontal-top-icon-menu 2-columns   menu-expanded" data-open="hover" data-menu="horizontal-menu" data-col="2-columns">

    <!-- Menu-->
      <?php include "menu.php" ?>
    <!-- Horizontal navigation-->

    <div class="app-content content">
      <div class="content-wrapper">
        <div class="content-header row">
          <div class="content-header-left col-md-6 col-12 mb-2">
            <h3 class="content-header-title"><i class="icon-note"></i>Cadastros</h3>
            <h5 class="content-header-title" style="margin-left: 7px;"><i class="ft-corner-down-right"></i><a href="view-carrossel.php" style="font-size: 12px;">Novo Carrossel</a></h5>
            <h5 class="content-header-title" style="margin-left: 17px;"><i class="ft-corner-down-right"></i><a href="view-lista-carrossel.php" style="font-size: 12px;">Listar Carrossel</a></h5>      
          </div>         
        </div>
        

		<!-- File export table -->
		<section id="file-export">
		   <div class="row justify-content-md-center">
			  <div class="col-md-8">
				 <div class="card" style="margin-top: -100px;">
					<div class="card-header">
					   <h4 class="card-title">Listar Carrossel</h4>
					   <a class="heading-elements-toggle"><i class="fa fa-ellipsis-v font-medium-3"></i></a>
					   <div class="heading-elements">
						  <ul class="list-inline mb-0">
							 <li><a href="view-carrossel.php"><i class="ft-plus-square" style="font-size: 19px;margin-left: 12px;"></i></a></li>
							<!-- <li><i class="ft-printer" data-toggle="modal" data-backdrop="false" data-target="#info" style="font-size: 19px;margin-left: 15px;"></i>-->
							 <li><a data-action="collapse"><i class="ft-minus" style="font-size: 19px;margin-left: 11px;"></i></a></li>
							 <li OnClick="atualiza_table();" ><a data-action="reload"><i class="ft-rotate-cw" style="font-size: 19px;margin-left: 1px;"></i></a></li>
							 <li><a data-action="expand"><i class="ft-maximize" style="font-size: 19px;margin-left: 3px;"></i></a></li>
							 <li><a data-action="close"><i class="ft-x" style="font-size: 19px;margin-left: 3px;"></i></a></li>
							 <script>
								function atualiza_table(){
									$('#dataTables-example2').DataTable().ajax.reload();
								}
							 </script>
						  </ul>
					   </div>
					</div>
					<!--<div class="text-right">
					   <button type="reset" class="btn btn-warning" style="margin-right: 28px;">Novo  <i class="ft-plus-square position-right"></i></button>
					   </div>-->
					<div class="card-content collapse show">
					   <div class="card-body card-dashboard" style="margin-top: -27px;">
						  <table class="table table-striped table-bordered dataTable no-footer" id="dataTables-example2" role="grid" aria-describedby="dataTables-example2_info" style="width: 100%;">
							 <thead>
								<tr>
								   <th style="width: 2%;">Código</th>
								   <th style="width: 57%;">Título</th>
								   <th style="width: 57%;">Imagem</th>
								   <th style="width: 57%;">Situação</th>
								   <th style="width: 23%;">Data Cadastro</th>
								   <th style="width: 18%;">Ações</th>
								</tr>
							 </thead>
						  </table>
					   </div>
					</div>
				 </div>
			  </div>
		   </div>
		</section>
		<!-- File export table -->
		</div>
		</div>
		</div>
		</div>
		</div>

			<!--Começo Modal-->
			<div class="col-lg-4 col-md-6 col-sm-12">
			   <div class="form-group">
				  <div class="modal fade text-left" id="info" tabindex="-1" role="dialog" aria-labelledby="myModalcarrossel" aria-hidden="true">
					 <div class="modal-dialog" role="document">
						<div class="modal-content" style="margin-top: 31%;">
						   <div class="modal-header bg-info white" style="background-color: #065946 !important;">
							  <h4 class="modal-title white" id="myModalcarrossel">Relatórios carrossel</h4>
							  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
							  <span aria-hidden="true">&times;</span>
							  </button>
						   </div>
						   <div class="modal-body">
							  <a href="relatorios/carrossel/relatorio_carrossel.php" target="_blank">
                               <button type="button" class="btn btn-info mr-1">
                               <i class="ft-printer"></i> Simples</button>
							</div>
						   <div class="modal-footer">
							  <a href="view-lista-carrossel.php">
                               <button type="button" class="btn btn-danger mr-1">
                               <i class="ft-x"></i> Cancelar</button>
						   </div>
						</div>
					 </div>
				  </div>
			   </div>
			</div>		
			<!--Fim Modal-->
			
			<!-- Ampliar imagem -->
			  <div class="modal fade" id="myModalImagem" role="dialog">
         <div class="modal-dialog modal-lg">
            <!-- Modal content-->
            <div class="modal-content" style="width: 50%;margin-left: 35%;margin-right: 35%;margin-top: 20%;">
               <div class="modal-header">
                  <h4 class="modal-title">Foto Ampliada</h4>
                  <button data-toggle="tooltip" title="Fechar" onclick="atualiza()" target="Iframe" href="view-carrossel.php" type="button" class="btn btn-default" data-dismiss="modal" style="float: right;position: relative;margin-top: -31px;">X</button>
               </div>
               <div class="modal-body">
                  <!-- Iframe -->
                  <div id="imagem12" >
                  </div>
               </div>
            </div>
         </div>
      </div>
    
    

    <?php include "footer.php" ?>
	<script src="js/sweetalert2@10.js"></script>
    <!-- BEGIN VENDOR JS-->
    <script src="vendors/js/vendors.min.js"></script>
    <!-- BEGIN VENDOR JS-->
    <!-- BEGIN PAGE VENDOR JS-->
    <script src="vendors/js/ui/jquery.sticky.js"></script>
    <script src="vendors/js/charts/jquery.sparkline.min.js"></script>
    <script src="vendors/js/tables/datatable/datatables.min.js"></script>
    <script src="vendors/js/tables/datatable/dataTables.buttons.min.js"></script>
    <script src="vendors/js/tables/buttons.flash.min.js"></script>
    <script src="vendors/js/tables/jszip.min.js"></script>
    <script src="vendors/js/tables/pdfmake.min.js"></script>
    <script src="vendors/js/tables/vfs_fonts.js"></script>
    <script src="vendors/js/tables/buttons.html5.min.js"></script>
    <script src="vendors/js/tables/buttons.print.min.js"></script>
    <!-- END PAGE VENDOR JS-->
    <!-- BEGIN ROBUST JS-->
    <script src="js/core/app-menu.min.js"></script>
    <script src="js/core/app.min.js"></script>
    <script src="js/scripts/customizer.min.js"></script>
    <!-- END ROBUST JS-->
    <!-- BEGIN PAGE LEVEL JS-->
    <script src="js/scripts/ui/breadcrumbs-with-stats.min.js"></script>
   <script src="js/scripts/tables/datatables/datatable-advanced.min.js"></script>
  <!-- <script src="//cdn.datatables.net/plug-ins/1.10.22/i18n/Portuguese-Brasil.json"></script>-->
	<!-- END PAGE LEVEL JS-->
	<!--Função Deletar-->
	<script>
	function ampliaimagem(imagem){
		document.getElementById("imagem12").innerHTML  = '<img src="uploads/carrossel/'+imagem+'" width="100%" height="100%" />';

           } 
	
	function deletar_registro(id,nome,file){
		Swal.fire({
		  title: 'Prosseguir com a exclusão?',
		  text: "O registro "+nome+" será excluído!",
		  icon: 'question',
		  showCancelButton: true,
		  confirmButtonColor: '#3085d6',
		  cancelButtonColor: '#d33',
		  confirmButtonText: 'Sim, prosseguir!',
		  cancelButtonText: 'Cancelar'
		}).then((result) => {
		  if (result.isConfirmed) {
			  
			  $.post("excluir_carrossel.php",{id:id,file:file},function(data){
					$('#dataTables-example2').DataTable().ajax.reload();
				//alert(data);
				//select();
				});	
			
			Swal.fire({
			  position: 'top-end',
			  icon: 'success',
			  title: 'Registro Excluído',
			  showConfirmButton: false,
			  timer: 1500
			})
			
		  }
		})
}	
	</script>
	<script>
	$("#dataTables-example2").dataTable({
			"processing": true,
			"serverSide": false,   
			"autoWidth": true,
			destroy: true,				
			"ajax": "buscar_carrossel.php",
			"deferRender": true,
			select: true,
			dom: 'Blfrtip',
            "order": [[ 0, "desc" ]],
			"pageLength": 25,
			"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tudo"]],
			dom:"Bfrtip",
			buttons: [
					{
						extend: 'copyHtml5',
						text: '<i class="fa fa-files-o" aria-hidden="true"></i>',
						exportOptions: {
							columns: ':visible',
						}
					},
					{
						extend: 'csvHtml5',
						text: '<i class="fa fa-database" aria-hidden="true"></i>',
						exportOptions: {
							columns: ':visible',
						}
					},
					{
						extend: 'excelHtml5',
						text: '<i class="fa fa-file-excel-o" aria-hidden="true"></i>',
						exportOptions: {
							columns: ':visible',
						}
					},
					{
						extend: 'pdfHtml5',
						text: '<i class="fa fa-file-pdf-o" aria-hidden="true"></i>',
						exportOptions: {
							columns: ':visible',
						}
					},
					{
						extend: 'print',
						text: '<i class="fa fa-print" aria-hidden="true"></i>',
						exportOptions: {
							columns: ':visible',
						}
					},
					 /*{ 
						extend: 'colvis', 
						text: '+ Colunas',
						exportOptions: {
						   columns: ':visible'
						}

					},*/
					
					'pageLength'
					
				],
				
				 //"lengthMenu": [ [10, 25, 50, -1], [10, 25, 50, "All"] ],
			
			//buttons:["copy","csv","excel","pdf","print",'pageLength'],
              "bJQueryUI": true,
              "oLanguage": {
                  "sProcessing":   "Processando...",
                  "sLengthMenu":   "Mostrar _MENU_ registros",
                  "sZeroRecords":  "Não foram encontrados resultados",
                  "sInfo":         "Mostrando de _START_ até _END_ de _TOTAL_ registros",
                  "sInfoEmpty":    "Mostrando de 0 até 0 de 0 registros",
                  "sInfoFiltered": "",
                  "sInfoPostFix":  "",
                  "sSearch":       "Buscar:",
                  "sUrl":          "",
				  "lengthMenu": "Display 0 records per page",
                  "oPaginate": {
                      "sFirst":    "Primeiro",
                      "sPrevious": "Anterior",
                      "sNext":     "Seguinte",
                      "sLast":     "Último"
                  },              
			}
    });
	
	</script>
	
	
  </body>

<!-- Mirrored from pixinvent.com/bootstrap-admin-template/robust/html/ltr/horizontal-top-icon-menu-template/dt-advanced-initialization.html by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 12 Feb 2021 19:26:11 GMT -->
</html>