<?php
include("session.php");
?>
<!DOCTYPE html>
<html>
  <?php
   include("head.php"); ?>
<body>
    <div id="wrapper">
       <?php
        include ("menu.php");
       ?>

        <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
        <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
        <div class="navbar-header">
            <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
            
        </div>
            <ul class="nav navbar-top-links navbar-right">

                <li>
                    <a href="index.php">
                    
                        <i class="fa fa-sign-out"></i> Salir
                    </a>
                </li>
                
            </ul>

        </nav>
        </div>
               
        <div class="row">
            <div class="col-lg-12">
                 <div class="ibox float-e-margins">
                    
                            <div class="ibox-title">
                                <div class="pull-right">
                                             <script languaje="javascript"> 
function popup(){ 
   window.open("subir2.php", "Adjuntar archivo", 'width=400,height=450,location=yes,scrollbars=yes'); 
} 
</script>
<button onclick="popup()" class="btn btn-primary" data-toggle="modal" >Agregar Documento</button>
                                </div>
                                
                            </div>
                            <?php
include("conexion.php");
//  consulta MySQL
$query = 'SELECT id, name, description, ruta, tipo, size FROM archivos';

$result = mysqli_query($conexion, $query) or die('Consulta fallida: ' . mysqli_error($conexion));

?>

<table class="table table-striped">
    
    <thead>
    <tr>
      <th>ID</th>
      <th>NOMBRE</th>
      <th>DESCRIPCION</th>
      <th>RUTA</th>
      <th>TIPO</th>
      <th>TAMAÑO</th>
    </tr>
    </thead>
<?php while ($row = mysqli_fetch_array($conexion, $query)){?>
  <td><?php echo $rowc['id_pedido']; ?></td>
  <td><?php $row['id'] ?></td>
    <td><?php $row['name'] ?></td>
    <td><?php $row['description'] ?></td>
    <td><?php $row['ruta'] ?></td>
    <td><?php $row['tipo'] ?></td>
    <td><?php $row['size'] ?></td>
  
<?php } ?>
</table>
 <!-- MODAL -->
    </div>
    <?php include("script.php"); ?>

       <script type="text/javascript">
           <?php
                    if (isset($_GET['id'])) {
                    ?>
                    $('#myModal').modal('show');
                      <?php                       }  
           ?>


          
       </script>
</body>
</html>