File "F1a.php"

Full Path: /home/cuautla1/dif.cuautlajalisco.gob.mx/Fraccion1/F1a.php
File size: 2.33 KB
MIME-type: text/html
Charset: utf-8

<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8" />
  <title>Fracción I - Inciso a)</title>
  <link rel="stylesheet" href="../menu.css" />
  <style>
    @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

    body {
      font-family: 'Poppins', sans-serif;
      margin: 0;
      padding: 0;
    }

    main {
      padding: 90px 20px 40px;
      max-width: 1000px;
      margin: 0 auto;
    }

    h1, h2 {
      color: #2b3e5c;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 20px;
    }

    th, td {
      border: 1px solid #ccc;
      padding: 10px;
      text-align: left;
    }

    th {
      background-color: #f0f0f0;
    }

    tr:hover {
      background-color: #f9f9f9;
    }

    a {
      color: #0066cc;
      text-decoration: none;
    }

    a:hover {
      text-decoration: underline;
    }
  </style>
</head>
<body>

  <!-- Carga del menú usando PHP -->
  <?php include("../menu.php"); ?>

  <main>
    <h1>Fracción I - Información necesaria para el ejercicio del derecho a la información pública</h1>
    <h2>Inciso a) La Ley General, la presente Ley y su Reglamento</h2>

    <table>
      <thead>
        <tr>
          <th>Documento</th>
          <th>Enlace</th>
        </tr>
      </thead>
      <tbody>
        <?php
          $ruta = "../Transparencia/Fraccion1/a/";
          if (is_dir($ruta)) {
            $archivos = scandir($ruta);
            foreach ($archivos as $archivo) {
              $ext = strtolower(pathinfo($archivo, PATHINFO_EXTENSION));
              if ($archivo !== "." && $archivo !== ".." && in_array($ext, ['pdf', 'docx'])) {
                $nombre = pathinfo($archivo, PATHINFO_FILENAME);
                $nombre_legible = ucwords(str_replace(['-', '_'], ' ', $nombre));
                echo "<tr>
                        <td>" . htmlspecialchars($nombre_legible) . "</td>
                        <td><a href=\"$ruta$archivo\" target=\"_blank\">Ver documento</a></td>
                      </tr>";
              }
            }
            
          } else {
            echo "<tr><td colspan='2'>⚠️ Carpeta no encontrada: $ruta</td></tr>";
          }
        ?>
      </tbody>
    </table>
  </main>

</body>
</html>