Added Stats inside ConstructionConsent
This commit is contained in:
@@ -89,6 +89,96 @@ $pagination_entity_name = "Zustimmungserklärungen";
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<button class="btn btn-primary collapsed"
|
||||
type="button"
|
||||
data-toggle="collapse"
|
||||
data-target="#collapsibleCard"
|
||||
aria-expanded="true"
|
||||
aria-controls="collapsibleCard">
|
||||
<i class="fas fa-chevron-up chevron-icon"></i>
|
||||
Statistiken umschalten
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<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;">
|
||||
|
||||
<?php
|
||||
$cardConfig = [
|
||||
[
|
||||
'key' => null,
|
||||
'header' => 'Liste der Zustimmungserklärungen',
|
||||
'icon' => 'fas fa-file-signature',
|
||||
'text' => 'Objekttyp',
|
||||
'sub' => [
|
||||
'Straße/Grundstück ['.$stats['street'].']',
|
||||
'Gebäude ['.$stats['building'].']'
|
||||
],
|
||||
'color' => '#6c757d'
|
||||
],
|
||||
[
|
||||
'key' => 'inspection_planner',
|
||||
'header' => 'Begehung Planer durchgeführt',
|
||||
'icon' => 'fas fa-clipboard-check',
|
||||
'denominator' => $stats['building'],
|
||||
'color' => '#28a745'
|
||||
],
|
||||
[
|
||||
'key' => 'conduit_installed_building',
|
||||
'header' => 'Leerrohr im Gebäude',
|
||||
'icon' => 'fas fa-house-user',
|
||||
'denominator' => $stats['building'],
|
||||
'color' => '#17a2b8'
|
||||
],
|
||||
[
|
||||
'key' => 'conduit_installed_ftu',
|
||||
'header' => 'Leerrohr bis HAK',
|
||||
'icon' => 'fas fa-road',
|
||||
'denominator' => $stats['street'],
|
||||
'color' => '#f5b902'
|
||||
],
|
||||
[
|
||||
'key' => 'inhouse_cabling',
|
||||
'header' => 'Inhouse erledigt',
|
||||
'icon' => 'fas fa-plug',
|
||||
'denominator' => $stats['building'],
|
||||
'color' => '#007bff'
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($cardConfig as $config) {
|
||||
$height = 96 + 25 * (isset($config['sub']) ? count($config['sub']) : 0);
|
||||
$text = $config['key'] ?
|
||||
$stats[$config['key']].' / '.$config['denominator'].' ('.
|
||||
round(($stats[$config['key']]/$config['denominator'])*100).'%)' :
|
||||
$config['text'];
|
||||
?>
|
||||
<div class="card">
|
||||
<div class="card-body p-0" style="background-color: <?= $config['color'] ?>">
|
||||
<div class="p-2" style="height: <?= $height ?>px">
|
||||
<div class="float-right">
|
||||
<i class="<?= $config['icon'] ?> text-white widget-icon font-24"></i>
|
||||
</div>
|
||||
<h5 class="text-white font-weight-normal mt-0"><?= $config['header'] ?></h5>
|
||||
<h3 class="mt-2 text-white"><?= $text ?></h3>
|
||||
<?php if(isset($config['sub'])): ?>
|
||||
<div class="text-white font-weight-light tt-dashboard-display-card-sub-header-container">
|
||||
<?php foreach($config['sub'] as $sub): ?>
|
||||
<p class="mb-0"><?= $sub ?></p>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
|
||||
Reference in New Issue
Block a user