<?php include 'sesion.php';?>
<?php include 'concha.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 rel="shortcut icon" href="" type="image/x-icon">
	<link rel="apple-touch-icon" href="">
	<!-- Bootstrap CSS -->
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
	<!-- Link to your css file -->
	<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>

  <style type="text/css">

      *{
          border-radius: 0!important;
          
      }

      body {
          background-image: url(../fondeux.jpg);
      }

      .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:#0066FF;
      } 
      
      .colorAzul h3{
          color:#0066FF;
          
      }
      
  </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 role="main" style="background-color:#fff;" class="container pt-3">
    
            <div class="page-header" style="text-align:center;">
  
                <h2><? echo $idioma_100690 ?></h2>

            </div>

            <div class="col-12 my-3 text-center">

              <div class="container-fluid">
        
                          <div class="row border">

                            <div class="col-4 align-middle">
                                <h4><?php echo $idioma_100691?></h4>
                            </div>
                            
                            <div class="col-4 align-middle">
                                <h4><?php echo $idioma_100692?></h4>
                            </div>
                            
                            <div class="col-4">&nbsp;</div>

                          </div>

                          <?php 
                          

                            $sql = "SELECT * FROM menu WHERE IDsub = 0 ORDER BY ID";

                            $consulta = $conn->query($sql);
                            while ($row = $consulta->fetch_assoc())
                            {
                            $ID= $row["ID"];
                            $IDM= $row["ID"];
                            $nombre = $row["nombre"];
                            $tipo = $row["tipo"];
                            $link = $row["link"];

                          ?>

                          <div class="row border-top my-4">

                            <div class="col-2 col-sm-1 d-flex justify-content-end align-items-center">
                               
                                    <a class="btn btn-outline-primary" href="eliminar_boton_menu.php?ID=<?php echo $ID ?>">
                                        <i class="fas fa-times"></i>
                                    </a>
                                    
                            </div>
                            
                            <div class="col-5 col-sm-6 d-flex align-items-center justify-content-around" >
                                <b><?php echo $ID ?></b>
                                <b><?php echo $nombre ?></b>
                                <p><?php echo $tipo ?></p>
                            </div>

                            <div class="col-5 col-sm-5"> 
                            
                              <ul class="d-flex justify-content-end">
                                <li><a class="btn btn-outline-primary mt-2" href="cambiar_lugar_boton_menu.php?ID=<?php echo $ID ?>"><?php echo $idioma_100696?></a></li>
                                <li><a class="btn btn-outline-primary mt-2" href="agregar_boton_menu.php?IDsub=<?php echo $ID; ?> "><?php echo $idioma_100695?></a></li>
                              
                              </ul>   
                              
                            </div>
                          
                          </div>
    
                          <?php 
                            $sql4 = "SELECT * FROM menu WHERE IDsub = '$IDM' ORDER BY ID";
                            $consulta4 = $conn->query($sql4);
                           while ($row4 = $consulta4->fetch_assoc())
                            {
                            $ID = $row4["ID"];
                            $nombre = $row4["nombre"];
                            $tipo = $row4["tipo"];
                            $link = $row4["link"];
                            ?>
                              
                              <div class="row">
                                 
                                <div class="col-3 d-flex justify-content-end">
                                   
                                    <a class="btn btn-outline-primary" href="eliminar_boton_menu.php?ID=<?php echo $ID ?>">
                                        
                                         <i class="fas fa-times"></i>
                                         
                                    </a>
                                    
                                </div>
                                
                                <div class="col-9 col-sm-9 border-bottom d-flex justify-content-between align-items-center">
                                    
                                    <ul class="p-0 m-0 d-flex justify-content-between align-items-center">
                                        
                                        <li>
                                            
                                            <b><p class="p-1 m-1 text-capitalize"><?php echo $nombre ?></p></b>
                                        
                                        </li>
                                        
                                        <li>
                                            
                                            <i><p class="p-1 m-1 text-capitalize"><?php echo $tipo ?></p></i>
                                            
                                        </li>
                                        
                                    </ul>
                                    
                                    <ul class="p-0 m-0 d-flex justify-content-between align-items-center">
                                        
                                        <?php if ($tipo == 'seccion') {?> 
                                        
                                        <li>
                                            
                                            <a class="btn btn-outline-primary" href="actualizar_seccion.php?menu=<?php echo $ID ?>"><? echo $idioma_100858?></a>
                                            
                                        </li>
                                        
                                        <?php } else {};?>
                                    
                                        <li>
                                            
                                            <a class="btn btn-outline-primary" href="cambiar_lugar_boton_menu.php?ID=<?php echo $ID ?>">
                                                
                                                <? echo $idioma_editar?>
                                                 
                                            </a>
                                            
                                        </li>
                                        
                                    </ul>
                                    
                                </div>
                                
                              </div>
                              

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


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

                          <div class="row my-3">
                          <?

                                include 'concha.php';
                              
                                $sql = "SELECT ID FROM menu ORDER BY ID desc LIMIT 1";
                                $consulta = $conn->query($sql);
                                while ($row = $consulta->fetch_assoc())
                                {
                                $ID_lal = $row["ID"];
                                }
                                $consulta->free_result();

                                ?>    
                            <div class="col-12  text-center">
                              <a class="btn btn-primary" href="agregar_boton_menu.php?ID=<? echo $ID_lal + 1?>"><?php echo $idioma_100697?></a>
                            </div>
                          </div>
                        <div class="container-fluid">
                            <div class="row d-none">
                              <td class="Estilo29"><hr />
                                <p align="center"><span class="Estilo41">CAMBIAR EL SEPARADOR</span><br /> 
                                  <span class="Estilo41" style=";font-family:<?php echo $style_menu ?>;"><?php echo $separador ?></span></p>
                                <form id="form2" name="form1" method="post" action="form_cambiar_separador.php">
                                  <div align="center">por 
                                    <select name="s" class="Estilo41" id="s">
                                      <option value="">Ninguno</option>
                                      <option>:</option>
                                      <option>-</option>
                                      <option>|</option>
                                      <option>/</option>
                                      <option>\</option>
                                      <option>|</option>
                                      <option>~</option>
                                    </select>
                                    <br />
                                    <br />
                                    <input name="button2" type="submit" class="Estilo41" id="button2" value="CAMBIAR" />
                                  </div>
                                </form>
                              <p></p></td>
                            </div>

                                <div class="row">
                                    <div class="col-12 text-center">
                                      <b><? echo $idioma_actualizar?> sección</b>
                                    </div>

                                  <?
                              
                                  $sql = "SELECT * FROM menu";
                                  $consulta = $conn->query($sql);
                                  while ($row = $consulta->fetch_assoc())
                                  {
                                    $ID = $row["ID"];
                                    $tipo = $row["tipo"];
                                    $titulo = $row["nombre"];
                                  ?>     
                            
                                    <?php if ($tipo == 'seccion') {?>
                                    <div class="col-6 border-bottom mb-3">
                                      <p><?php echo $titulo ?></p>  
                                      <a class="btn btn-outline-primary mb-3" href="actualizar_seccion.php?menu=<?php echo $ID ?>"><? echo $idioma_actualizar?></a>
                                    </div>
                                    

                                    <?php };?>

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

                        
                                  

              </div>

            </div>
</div>
  <!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
    
<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 defer src="https://use.fontawesome.com/releases/v5.8.1/js/all.js" integrity="sha384-g5uSoOSBd7KkhAMlnQILrecXvzst9TdC09/VM+pjDTCM+1il8RHz5fKANTFFb+gQ" crossorigin="anonymous"></script>   
</body>
</html>
