Merge branch 'const-consent-add-filter' into 'master'

ConstructionConsent added new Stats

See merge request fronk/thetool!1042
This commit is contained in:
Luca Haid
2025-02-20 09:22:17 +00:00
2 changed files with 67 additions and 9 deletions

View File

@@ -127,7 +127,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
<div id="collapsibleCard" class="collapse">
<div class="card-body mb-3">
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; grid-gap: 10px;">
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; grid-gap: 10px;">
<?php
$cardConfig = [
@@ -146,7 +146,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
'key' => 'inspection_planner',
'header' => 'Begehung Planer durchgeführt',
'icon' => 'fas fa-clipboard-check',
'denominator' => $stats['building'],
'denominator' => $stats['building'] + $stats['street'],
'color' => '#28a745'
],
[
@@ -198,6 +198,56 @@ $pagination_entity_name = "Zustimmungserklärungen";
</div>
</div>
<?php } ?>
<!-- i have added this to stats and need to show a "traffic light kinda thing round etc" with a grid 2 row 2 col
"status_light_blue" => $status_light_blue,
"status_light_red" => $status_light_red,
"status_light_yellow" => $status_light_yellow,
"status_light_green" => $status_light_green
-->
<div class="card">
<div class="card-body p-0">
<div class="p-2" style="background-color: #f8f9fa">
<h5 class="font-weight-normal mt-0">Anfrageresultat</h5>
</div>
<!-- Horizontal Traffic Light -->
<div style="padding: 20px; background: #333; display: flex; gap: 15px; justify-content: center;">
<div style="display: flex; flex-direction: row; transform: rotate(0deg); gap: 20px;">
<!-- Blue -->
<div style="position: relative; width: 60px; height: 60px;">
<div style="width: 100%; height: 100%; background-color: #337ab7; border-radius: 50%;"></div>
<span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: bold;"><?php echo $stats['status_light_blue']; ?></span>
</div>
<!-- Red -->
<div style="position: relative; width: 60px; height: 60px;">
<div style="width: 100%; height: 100%; background-color: #d9534f; border-radius: 50%;"></div>
<span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: bold;"><?php echo $stats['status_light_red']; ?></span>
</div>
<!-- Yellow -->
<div style="position: relative; width: 60px; height: 60px;">
<div style="width: 100%; height: 100%; background-color: #f0ad4e; border-radius: 50%;"></div>
<span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: bold;"><?php echo $stats['status_light_yellow']; ?></span>
</div>
<!-- Green -->
<div style="position: relative; width: 60px; height: 60px;">
<div style="width: 100%; height: 100%; background-color: #5cb85c; border-radius: 50%;"></div>
<span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: bold;"><?php echo $stats['status_light_green']; ?></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -940,12 +940,16 @@ class ConstructionConsentController extends mfBaseController {
private function generateStats($baseFilter = array()) {
$allCount = ConstructionConsent::count(array_merge(array(), $baseFilter));
$streetCount = ConstructionConsent::count(array_merge(array("object_type" => "street"), $baseFilter));
$buildingCount = ConstructionConsent::count(array_merge(array("object_type" => "building"), $baseFilter));
$inspection_planner = ConstructionConsent::count(array_merge(array("inspection_planner" => "!NULL"), $baseFilter));
$conduit_installed_building = ConstructionConsent::count(array_merge(array("conduit_installed_building" => "!NULL"), $baseFilter));
$conduit_installed_ftu = ConstructionConsent::count(array_merge(array("conduit_installed_ftu" => "!NULL"), $baseFilter));
$inhouse_cabling = ConstructionConsent::count(array_merge(array("inhouse_cabling" => "!NULL"), $baseFilter));
$streetCount = ConstructionConsent::count(array_merge($baseFilter, array("object_type" => "street")));
$buildingCount = ConstructionConsent::count(array_merge($baseFilter, array("object_type" => "building")));
$inspection_planner = ConstructionConsent::count(array_merge($baseFilter, array("inspection_planner" => "!NULL")));
$conduit_installed_building = ConstructionConsent::count(array_merge($baseFilter, array("conduit_installed_building" => "!NULL")));
$conduit_installed_ftu = ConstructionConsent::count(array_merge($baseFilter, array("conduit_installed_ftu" => "!NULL")));
$inhouse_cabling = ConstructionConsent::count(array_merge($baseFilter, array("inhouse_cabling" => "!NULL")));
$status_light_blue = ConstructionConsent::count(array_merge($baseFilter, array("status_light" => "blue")));
$status_light_red = ConstructionConsent::count(array_merge($baseFilter, array("status_light" => "red")));
$status_light_yellow = ConstructionConsent::count(array_merge($baseFilter, array("status_light" => "yellow")));
$status_light_green = ConstructionConsent::count(array_merge($baseFilter, array("status_light" => "green")));
return array(
"all" => $allCount,
@@ -954,7 +958,11 @@ class ConstructionConsentController extends mfBaseController {
"inspection_planner" => $inspection_planner,
"conduit_installed_building" => $conduit_installed_building,
"conduit_installed_ftu" => $conduit_installed_ftu,
"inhouse_cabling" => $inhouse_cabling
"inhouse_cabling" => $inhouse_cabling,
"status_light_blue" => $status_light_blue,
"status_light_red" => $status_light_red,
"status_light_yellow" => $status_light_yellow,
"status_light_green" => $status_light_green
);
}
}