| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- /* @var $descargas app\models\Descarga[] */
- /* @var $estaciones array */
- /* @var $primer \DateTime */
- /* @var $ultimo \DateTime */
- ?>
- <style>
- .scroll {
- overflow-x: scroll;
- }
- .celda {
- text-align: center;
- color: #d4d4d4;
- }
- </style>
- <div class="scroll">
- <table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
- <thead>
- <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>
- </thead>
- <tbody>
- <?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"] ?>;" class="celda">
- <?= $d["descargados"] ?> / <?= $d["total"] ?>
- </td>
- <?php else: ?>
- <td></td>
- <?php endif; ?>
- <?php $fecha->add(new \DateInterval("P1D")); ?>
- <?php endwhile ?>
- </tr>
- <?php endforeach ?>
- <?php endforeach ?>
- </tbody>
- </table>
- </div>
|