| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- /* @var $descargas app\models\Descarga[] */
- /* @var $estaciones array */
- /* @var $primer \DateTime */
- /* @var $ultimo \DateTime */
- ?>
- <style>
- .site-card {
- min-height: 100vh;
- width: 100vw;
- padding: 20px;
- background: #ececec;
- }
- .content {
- width: 100%;
- height: 100%;
- }
- .full-width {
- width: 100%;
- }
- </style>
- <div>
- <table border="1" width="100%" id="tabla">
- <tr>
- <th>pc</th>
- <th>ciudad</th>
- <th>clave</th>
- <th>siglas</th>
- <th>frecuencia</th>
- <?php $f = (clone $primer); ?>
- <?php while($f <= $ultimo): ?>
- <th>
- <?= $f->format("d/m/Y") ?>
- </th>
- <?php $f->add(new \DateInterval("P1D")); ?>
- <?php endwhile; ?>
- </tr>
- <?php $estacion = ""; ?>
- <?php foreach ($estaciones as $pc => $est): ?>
- <?php foreach($est as $clave => $info): ?>
- <tr>
- <td><?= $pc ?></td>
- <td><?= $info['ciudad'] ?></td>
- <td><?= $clave ?></td>
- <td><?= $info['siglas'] ?></td>
- <td><?= $info['frecuencia'] ?></td>
- <?php $fecha = (clone $primer); ?>
- <?php while($fecha <= $ultimo): ?>
- <?php $d = null; ?>
- <?php if(isset($descargas[$pc][$clave][$fecha->format("Y-m-d")])): ?>
- <?php $d = $descargas[$pc][$clave][$fecha->format("Y-m-d")]; ?>
- <?php endif; ?>
- <?php if($d !== null): ?>
- <td style="background-color: <?= $d["color"] ?>; text-align: center ">
- <?= $d["descargados"] ?> / <?= $d["total"] ?>
- </td>
- <?php else: ?>
- <td></td>
- <?php endif; ?>
- <?php $fecha->add(new \DateInterval("P1D")); ?>
- <?php endwhile ?>
- </tr>
- <?php endforeach ?>
- <?php endforeach ?>
- </table>
- </div>
|