<?php  include 'sesion.php';


if ($cat_user == 9){

  header("Location:index_usuario_tienda.php");
  exit;

};

?>
 <?php  include '../url_amigable.php';?>
 <?php include 'concha.php';
        include '../concha_extras.php';
 ?>
<!DOCTYPE html>
<html lang="es">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<!-- Required meta tags -->

	<meta name="description" content="Panel de Administracion">
	<meta name="author" content="<?php echo $nombresitio ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title><?php echo $nombresitio ?> - Panel de Administracion</title>
  <!--link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'-->
  <link href="https://fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900&display=swap" rel="stylesheet">
  <link rel="shortcut icon" href="" type="image/x-icon">
	<link rel="apple-touch-icon" href="">

	<!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">

  <!-- Link to your css file -->
	<link rel="stylesheet" href="">
<script
  src="https://code.jquery.com/jquery-3.5.1.min.js"
  integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
  crossorigin="anonymous"></script>
  <script src="../js/jquery.fittext.js"></script>



  <!--script type="text/javascript" src="//recursos.radiosnethosting.com/ckeditor/ckeditor.js"></script-->

    <style>

        .carousel-cell {
          width: 66%;
          margin-right: 5px;
        }

        .display-flex{
            display: flex;
            justify-content: center;
            align-items: center;
        }

        *{
            border-radius: 0!important;

        }

        body {
            background-image: url(../fondeux.jpg);
            background-position:top center;
            background-repeat: repeat-x;
            background-color:#EBEBEB;
            height:100%;
        }

        .btn, a, h1, h2, h3, h4, h5, h6, b{
          font-family: 'Montserrat', sans-serif;
        }

        .btn, h1, h2, h3, h4, h5, h6 {
          font-weight: 600;
        }

        .navbar {
            position: relative;
        min-height: 50px;
        padding-bottom:  20px;
        /* border: 1px solid transparent; */

        }

      .btn-primary {
        color: #fff!important;
        background-color: #0066FF;
        border-color: #0066FF;
            }

        .page-header{
            margin: 0;
            padding: 1em;
            background-color: #0066FF;
            border: 0;
            text-align:center;
        }

        .page-header h2{

            color: #ffffff;
            font-weight: bold;
        }

        .bloqueAzul{
          /*  background-color: #0066FF;*/
          /* border: 1px solid #e4e4e4;*/
          /*  padding: 1em;*/
            text-align: center;
        }

        .bloqueAzul .div {
          border: 1px solid #e4e4e4;
            background-color: #fff;
        }

        ul{
            list-style: none;
            padding: 0;
        }

        .far{
            color:#0066FF;
        }
        .faso {
            color:#fff;
        }

        .colorAzul h3{
            color:#0066FF;

        }

        /* Small devices (landscape phones, 576px and up) */
        @media (min-width: 576px) {
            .listaPublis {
            column-count: 1;
              }
        }

        /* Medium devices (tablets, 768px and up) The navbar toggle appears at this breakpoint */
        @media (min-width: 768px) {
            .listaPublis {
            column-count: 2;
              }
        }

        /* Large devices (desktops, 992px and up) */
        @media (min-width: 992px) {
            .listaPublis {
            column-count: 3;
           }
        }

    </style>

    <script language=javascript>
      function ventanaSecundaria (URL){
        window.open(URL,"ventana1","width=550,height=450,scrollbars=NO")
      }
    </script>

</head>

    <body>


        <div class="container" style="background-color:#F1F2ED;">

            <?php include 'menu.php';  ?>

        </div>

        <div  style="background-color:#fff;" class="container pt-3">

            <div class="page-header" style="text-align:center;">

                <h2>NOTICIAS CARGADAS</h2>

            </div>





            <form id="form1" name="form1" method="GET" action="buscar_noticias.php">

                          <div align="center"><span class="Estilo20">BUSCAR UNA NOTICIA        </span>

                              <input name="busqueda" type="text" class="Estilo43" id="busqueda" size="25" />

                                <input name="button" type="submit" class="Estilo43" id="button" value="Buscar Noticias »" />

                                  </div>

            </form>





        <hr />

        Filtrar por Categorías:<p>

           <form id="form1" name="form1" method="GET" action="filtrar_noticias.php">

              <select name="ID_cat" class="Estilo4" id="cat5">

                      <option value="0" selected="selected">Seleccione --></option>

                      <?php
                      
                      $sql = "SELECT * FROM categorias ORDER BY nombre";
                      $consulta = $conn->query($sql);
                      while ($row = $consulta->fetch_assoc())
                      {
                        $ID = $row["ID"];
                        $nombre = $row["nombre"];
                        ?>
                        <option value="<?php echo $ID ?>"> <?php echo $nombre ?> </option>
                      <?}
                      $consulta->free_result();
                      ?>

              </select>

              <input name="button3" type="submit" class="Estilo43" id="button3" value="Filtrar Noticias »" />
          </form>

        <hr />



        <br />

            <table width="893" border="0" align="center" bordercolor="#D4D0C8">

              <tr>

                <td valign="top" class="Estilo1"><?

                    //NOMBRE DEL ARCHIVO PHP

                    $pagina = "filtrar_noticias.php";

                    //NOMBRE DE LA TABLA ADONDE SE QUIERE REALIZAR LA CONSULTA

                    $tabla = "notas";

                    //CANTIDAD DE RESULTADOS POR TABLA

                    $c = 15;



                    $ID_cat = (int)$_GET['ID_cat'];

                    $i = $_GET['i'];

                    $p = $_GET['p'];

                    if ($i == NULL) {$i = 0; $p = 1;} else {};

                            
                            $sql = "SELECT * FROM $tabla WHERE cat = '$ID_cat' ORDER BY ID desc LIMIT $i,$c";
                            $consulta = $conn->query($sql);
                            while ($row = $consulta->fetch_assoc())
                            {
                            $i_d = 0;
                            $ID = $row["ID"];
                            $titulo = $row["titulo"];
                            $fechapub  = $row["fechapub"];
                            $carpetafoto  = $row["carpetafoto"];
                            $foto = $row["foto"];
                            $destacado = $row["destacado"];
                            $audio = $row["audio"];
                            $d = $row["d"];
                            $youtube = $row["youtube"];
                            $m = $row["m"];
                            $ver = $row["ver"];
                            $a = $row["a"];
                            $color = $row["color"];
                            $visitas = $row["visitas"];
                            $impresiones = $row["impresiones"];
                            $ext_img = $row["ext_img"];
                            $fecha = "$d - $m - $a";
                            $editor = $row["editor"];
                            $des_cat = $row["des_cat"];
                            $cat = $row["cat"];
                            ?>

                    <?php include 'mostrar_notisnew.php';?>

                    <?
                    }
                    $consulta->free_result();
                    ?>









                    <div align="center" class="Estilo1" style="font-size:30px">

                      <?php if ($p == 1) {} else { ?>

                      &laquo;&laquo; <a href="<?php echo $pagina ?>?i=<?php echo $i - $c; ?>&amp;p=<?php echo $p - 1; ?>&ID_cat=<?php echo $ID_cat ?>">Anterior</a>

                      <?php }?>

                      -

                      <?php if ($p == $cant) {} else { ?>

                      <a href="<?php echo $pagina ?>?i=<?php echo $i + $c; ?>&amp;p=<?php echo $p + 1; ?>&ID_cat=<?php echo $ID_cat ?>">Siguiente</a> &raquo;&raquo;

                      <?php }?>

                    </div>

                  <br />



                  </td>

              </tr>

            </table>

        </td>

    </tr>

  </div>






                <!-- jQuery first, then Popper.js, then Bootstrap JS -->
                <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
                  <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" integrity="sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s" crossorigin="anonymous"></script>
                <!-- JavaScript -->


             <script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.js"></script>
             <script type="text/javascript">
             window.setInterval(function(){
               $('.grid').isotope({
               itemSelector: '.grid-item'
             });
             }, 500);
             </script>
                <script>
                    var elem = document.querySelector('.grido');
                    var iso = new Isotope( elem, {
                    // options
                    itemSelector: '.grido-item',
                    layoutMode: 'fitRows'
                    });

                </script>

                  <script>
                  $(".tamañoMenu").fitText(1.2, { minFontSize: '12px', maxFontSize: '32px' });





              /*var a = $(".tamañoMenu");

              setInterval(() => {
                      console.log(a[0].style.fontSize);
              }, 1000);*/

              </script>
   <script src="https://use.fontawesome.com/releases/v5.8.1/js/all.js" integrity="sha384-g5uSoOSBd7KkhAMlnQILrecXvzst9TdC09/VM+pjDTCM+1il8RHz5fKANTFFb+gQ" crossorigin="anonymous"></script>
  </body>

  </html>
