index.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <!doctype html>
  2. <html class="no-js" lang="">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="x-ua-compatible" content="ie=edge">
  6. <title></title>
  7. <meta name="description" content="">
  8. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  9. <link rel="stylesheet" href="<?php echo basename(__DIR__) ?>/css/main.css">
  10. </head>
  11. <body>
  12. <?php require_once __DIR__ . '/db.php' ?>
  13. <?php require_once __DIR__ . '/error-handler.php' ?>
  14. <?php $link = connect() ?>
  15. <table class="flat-table">
  16. <tbody>
  17. <tr>
  18. <th>No</th>
  19. <th>Ciudad</th>
  20. <th>Distrito</th>
  21. <th>Población</th>
  22. <th>País</th>
  23. <th>Continente</th>
  24. <th>Región</th>
  25. </tr>
  26. <?php $i = 0 ?>
  27. <?php $use_generator = isset($_REQUEST['gen']) ? $_REQUEST['gen'] : false ?>
  28. <?php $rows = $use_generator ? get_cities_details_using_generator($link) : get_cities_details_traditional_style($link) ?>
  29. <?php foreach ($rows as $row): ?>
  30. <?php dump_to_console(sprintf('HTML > Volcando detalles de la fila: %u', ++$i)) ?>
  31. <tr>
  32. <td><?php echo $i ?></td>
  33. <td><?php echo $row['CityName'] ?></td>
  34. <td><?php echo $row['District'] ?></td>
  35. <td><?php echo $row['Population'] ?></td>
  36. <td><?php echo $row['CountryName'] ?></td>
  37. <td><?php echo $row['Continent'] ?></td>
  38. <td><?php echo $row['Region'] ?></td>
  39. </tr>
  40. <?php endforeach ?>
  41. </tbody>
  42. <tfoot>
  43. <tr>
  44. <td colspan="7">Table CSS Style: <a href="https://codepen.io/njessen/pen/naLCv">https://codepen.io/njessen/pen/naLCv</a></td>
  45. </tr>
  46. </tfoot>
  47. </table>
  48. </body>
  49. </html>