Files
thetool/Layout/default/AddressDB/View.php
2024-01-23 13:45:10 +01:00

163 lines
7.0 KiB
PHP

<?php
$pagination_entity_name = "Adressen";
?>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);"><?=MFAPPNAME_SLUG?></a></li>
<li class="breadcrumb-item"><a href="javascript: void(0);">GWR / AddressDB</a></li>
<li class="breadcrumb-item active"><?=$address->strasse->name?> <?=$address->hausnummer?>, <?=$address->plz->plz?> <?=$address->ortschaft->name?></li>
</ol>
</div>
<h4 class="page-title">GWR / AddressDB</h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<a href="<?=self::getUrl("AddressDB")?>" class="btn btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Übersicht</a>
<a href="<?=self::getUrl("AddressDB","edit", ['id' => $address->id])?>" class="btn btn-outline-success"><i class="fas fa-edit"></i> Adresse bearbeiten</a>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="card border-top-primary">
<div class="card-body">
<h3 class="text-center mb-3"><?=$address->strasse->name?> <?=$address->hausnummer?>, <?=$address->plz->plz?> <?=$address->ortschaft->name?></h3>
<table class="table table-sm table-striped view-table">
<tr>
<th>OAID</th>
<td class="text-monospace text-pink"><?=$address->oaid?></td>
</tr><tr>
<th>ADRCD</th>
<td class="text-monospace"><?=$address->adrcd?></td>
</tr><tr>
<th>Extref</th>
<td><?=$address->extref?></td>
</tr><tr>
<th>Rimo External ID</th>
<td><?=$address->rimo_id?></td>
</tr><tr>
<th>Netzgebiet</th>
<td><?=$address->netzgebiet->name?></td>
</tr><tr>
<th>Wohneinheiten</th>
<td><?=count($address->wohneinheiten)?></td>
</tr><tr>
<th>GPS Koordinaten</th>
<td>
<?php if($address->gps_lat && $address->gps_long): ?>
<a href="https://maps.google.com/maps?t=k&q=loc:<?=$address->gps_lat?>+<?=$address->gps_long?>" target="_blank"><i class="fas fa-fw fa-globe"></i> <?=$address->gps_lat?>, <?=$address->gps_long?></a>
<?php endif; ?>
</td>
</tr><tr>
<td colspan="2"><h4>Status</h4></td>
</tr><tr>
<th>Status Code</th>
<td class="text-monospace"><?=$address->status->code?></td>
</tr><tr>
<th>Status Text</th>
<td class="text-monospace"><?=$address->status->name?></td>
</tr><tr>
<td colspan="2"><h4>Adresse</h4></td>
</tr><tr>
<th>Straße / Hausnummer</th>
<td><?=$address->strasse->name?> <?=$address->hausnummer?></td>
</tr><tr>
<th>PLZ / Ort</th>
<td><?=$address->plz->plz?> <?=$address->ortschaft->name?></td>
</tr><tr>
<th>Gemeinde</th>
<td><?=$address->strasse->gemeinde->name?></td>
</tr><tr>
<td colspan="2"><h4>GWR Daten</h4></td>
</tr><tr>
<th>GDA Eigenschaft.</th>
<td><?=$address->gdaeigenschaft?></td>
</tr><tr>
<th>Meridian</th>
<td><?=$address->meridian?></td>
</tr><tr>
<th>RW</th>
<td><?=$address->rw?></td>
</tr><tr>
<th>HW</th>
<td><?=$address->hw?></td>
</tr><tr>
<th>Grundstücksnr.</th>
<td><?=$address->grund_nr?></td>
</tr>
</table>
</div>
</div>
</div>
<div class="col-6">
<div class="card border-top-success pl-2 pr-2">
<div class="card-header">
<h4>Wohneinheiten</h4>
</div>
<?php if(is_array($address->wohneinheiten) && count($address->wohneinheiten)): ?>
<table class="table table-sm table-striped table-hover">
<tr>
<th></th>
<th>ID</th>
<th>OAID</th>
<th>Status</th>
<th>Beschreibung</th>
<th>Extref</th>
</tr>
<?php foreach($address->wohneinheiten as $unit): ?>
<tr>
<td><a href="<?=self::getUrl("ADBWohneinheit", "edit", ["id" => $unit->id])?>"><i class="fas fa-edit"></i></a></td>
<td><?=$unit->id?></td>
<td class="text-pink">
<?php if($unit->oaid): ?>
<?php if(OpenAccessIdModel::getFirst(["oaid" => $unit->oaid])): ?>
<a href="<?=self::getUrl("OpenAccessId", "", ["filter" => ["oaid" => $unit->oaid]])?>" class="text-pink" target="_blank"><?=$unit->oaid?></a>
<?php else: ?>
<?=$unit->oaid?>
<?php endif; ?>
<?php endif; ?>
</td>
<td class="text-monospace"><?=$unit->status->code?> - <?=$unit->status->name?></td>
<td><?=((string)$unit) ? "<strong>".(string)$unit."</strong>" : ""?></td>
<td><?=($unit->extref) ? "[".$unit->extref."]" : ""?></td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<a href="<?=self::getUrl("AddressDB")?>" class="btn btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Übersicht</a>
<a href="<?=self::getUrl("AddressDB","edit", ['id' => $address->id])?>" class="btn btn-outline-success"><i class="fas fa-edit"></i> Adresse bearbeiten</a>
</div>
</div>
</div>
</div>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>