Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck-D-Norris committed Dec 17, 2024
1 parent 4bde531 commit cdcbc40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
1 change: 1 addition & 0 deletions app/src/app/Controllers/Admin/EstadistiquesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public function index($queryParams = [])
// Obtenim les dades del model correcte
$totalContractes = Contract::count();
$totalTreeTypes = TreeType::count();

Check warning on line 15 in app/src/app/Controllers/Admin/EstadistiquesController.php

View check run for this annotation

Codecov / codecov/patch

app/src/app/Controllers/Admin/EstadistiquesController.php#L14-L15

Added lines #L14 - L15 were not covered by tests


// Comprova si $grafiques és null i assegura't que sigui un array

Expand Down
13 changes: 1 addition & 12 deletions app/src/app/Views/Admin/Grafics.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,9 @@
Seleccionar Contrato
</button>
<div id="dropdown-menu" class="absolute bg-white border rounded shadow-lg mt-2 w-48 hidden">
<?php if (!empty($contracts)): ?>
<?php foreach ($contracts as $contract): ?>
<div class="dropdown-item" data-value="<?= htmlspecialchars($contract->id) ?>">
<?= htmlspecialchars($contract->name) ?>
<?php echo $totalContractes; ?>

Check warning on line 25 in app/src/app/Views/Admin/Grafics.php

View check run for this annotation

Codecov / codecov/patch

app/src/app/Views/Admin/Grafics.php#L2-L25

Added lines #L2 - L25 were not covered by tests
</div>
<?php endforeach; ?>
<?php else: ?>
<div class="dropdown-item text-gray-500">No hay contratos disponibles</div>
<?php endif; ?>
</div>
<div>
<p>Contractes: <?php echo $totalContractes; ?></p>
<p>Tipus: <?php echo $totalTreeTypes; ?></p>
</div>

<!-- Charts Container -->
<div id="charts-container" class="grid grid-cols-3 gap-4 bg-gray-100 relative">
Expand Down

0 comments on commit cdcbc40

Please sign in to comment.