<?php include 'sesion.php';?>
<?php include 'concha.php';?>
<!DOCTYPE html>
<html lang="es">
<head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <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 -->

  
        <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
        
        if($estiloweb == 9){
            include 'menu_estilo9.php'; 
            
        } else {
            include 'menu.php'; 
            
        }
      
      ?>
    
</div>

<div role="main" style="background-color:#fff;<?if($estiloweb == 9){echo 'margin-top:120px;';}?>" class="container pt-3">
    
  <div class="page-header" style="text-align:center;">
  
    <h2><? echo $idioma_100601 ?></h2>

  </div>


      <div class="row pt-3">

        <div class="col-12 p-3">

                <form id="form1" name="form1" method="post" action="form_agregar_programa.php" enctype="multipart/form-data">

                    <h3><? echo $idioma_100602 ?></h3>

                    <div class="form-group row px-3">

                        <div class="col-10">
                            <input class="form-control" type="text" name="nombre" id="nombre" />
                        </div>
                        <div class="col-2">
                            <input type="submit" name="button" id="button" class="btn btn-primary" value="<? echo $idioma_100460 ?>" />
                        </div>

                  </div>

                </form>
            
        
        </div>

        <div class="col-12">

              <div class="grid pt-3">

                                  <?
                        
                          $sql = "SELECT * FROM programas ORDER BY nombre";
                          $consulta = $conn->query($sql);
                         while ($row = $consulta->fetch_assoc())
                          {
                          $ID_P = $row["ID"];
                          $nombre = $row["nombre"];
                          $url = $row["url"];
                          $imagen = $row["imagen"];

                          ?>

                    

                      <div class="grid-item col-12 col-sm-4 px-2 mb-3">

                                <div class="col-12 p-3 border">

                                <h4 class="mb-3"><?php echo $nombre ?></h4>
                      
                                <?php if ($imagen == NULL) {} else {?>

                                  <?php if ($url == NULL) {} else {
                                    
                                    ?>
                                  
                                  <a href="<?php echo $url ?>">
                                      <? };?>          
                                    
                                    <div class="text-center mb-3">
                                      <img class="img-fluid" src="<? echo $dom;?>/upload_pic/resize_<?php echo $imagen ?>.jpg" />
                                    </div>

                                  <?php if ($url == NULL) {} else {
                                    
                                    ?>
                                  
                                  </a>
                                                
                                  <? };?>

                                  <? };?>

                                  <ul class="d-flex justify-content-center">
                                    <li><a class="btn btn-outline-primary" href="../poner_imagen_programa.php?ID=<?php echo $ID_P ?>"><? echo $idioma_100460 ?></a></li>
                                    <li><a class="btn btn-link" href="borrar_programa.php?ID=<?php echo $ID_P ?>"><? echo $idioma_100234 ?></a></li>
                                  </ul>

                                <form id="form2" name="form2" method="post" action="form_url_programa.php?ID=<?php echo $ID ?>">

                                  <div class="form-group">

                                    <label><? echo $idioma_100606 ?></label>: 

                                    <input class="form-control mb-3" name="url" type="text" id="url" value="<?php if ($url == NULL) { ?>#<?php } else {echo $url; };?>" />

                                    <input name="ID" type="hidden" value="<?php echo $ID_P ?>" />

                                    <div class="text-center">

                                      <input class="btn btn-outline-primary mb-3" type="submit" name="button2" id="button2" value="<? echo $idioma_enviar?>" />
                                    
                                    </div>

                                    

                                    <p><? echo $idioma_100607 ?></p>
                                    
                                  
                                  </div>
                                  
                                </form>

                            </div>

                      </div>        

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

      </div>
  

  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<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>

