Files
thetool/Layout/default/ConstructionConsent/Index.php
Frank Schubert 6c0d334bbc WIP tmp
2024-11-07 16:28:05 +01:00

154 lines
7.6 KiB
PHP

<?php
$pagination_baseurl = $this->getUrl($Mod,"Index");
$pagination_baseurl_params = ["filter" => $filter];
$pagination_entity_name = "Zustimmungserklärungen";
?>
<?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="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
<li class="breadcrumb-item active">Zustimmmungserklärungen</li>
</ol>
</div>
<h4 class="page-title">Zustimmmungserklärungen</h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body mb-3">
<h4 class="header-title mb-3"><i class="fad fa-filter fa-fw"></i> Filter</h4>
<form method="get" action="<?=self::getUrl("ConstructionConsent")?>">
<div class="row">
<div class="col-2">
<label class="form-label" for="filter_object_type">Objektart</label>
<select name="filter[object_type]" id="filter_object_type" class="form-control">
<option></option>
<option value="building" <?=(array_key_exists("object_type", $filter) && $filter["object_type"] == "building") ? "selected='selected'" : ""?>>Gebäude</option>
<option value="street" <?=(array_key_exists("object_type", $filter) && $filter["object_type"] == "street") ? "selected='selected'" : ""?>>Straße</option>
</select>
</div>
<div class="col-1">
<label class="form-label" for="filter_address">Objektadresse</label>
<input type="text" class="form-control" name="filter[address]" id="filter_address" value="<?=(array_key_exists('address', $filter)) ? $filter['address'] : ""?>" />
</div>
</div>
<div class="row mt-2">
<div class="col">
<button type="submit" class="btn btn-primary"><i class="far fa-search fa-fw"></i> Filter anwenden</button>
<a class="btn btn-secondary" href="<?=self::getUrl("ConstructionConsent", "", ["resetFilter" => 1])?>"><i class="far fa-xmark fa-fw"></i> Filter zurücksetzen</a>
</div>
</div>
</form>
</div>
</div>
<div class="card">
<div class="card-body mb-3">
<div class="row">
<div class="col-12">
<div class="float-left">
<h4 class="header-title">Liste aller Zustimmmungserklärungen</h4>
</div>
<div class="float-right">
<a class="btn btn-primary" href="<?=self::getUrl("ConstructionConsent", "add")?>"><i class="fas fa-plus"></i> Neue Zustimmungserklärung anlegen</a>
</div>
</div>
</div>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
<table class="table table-striped table-hover">
<tr>
<th>Objekttyp</th>
<th>Objektadresse</th>
<th title="Grundstücksnummer">GST-Nr.</th>
<th title="Grundbuch Einlagezahl">EZ</th>
<th>Besitzer</th>
<th>Besitzer Adresse</th>
<th>Besitzer Kontakt</th>
<th>Anfragestatus</th>
<th>Anfrageresultat</th>
<th></th>
</tr>
<?php foreach($items as $item): ?>
<tr>
<td><?=__($item->object_type)?></td>
<td>
<?php if($item->object_type == "street"): ?>
<?=$item->adb_strasse->name?>
<?=$item->adb_strasse->gemeinde->name?>
<?php else: ?>
<?=$item->adb_hausnummer->strasse->name?>
<?=$item->adb_hausnummer->hausnummer?><?=($item->adb_hausnummer->stiege) ? "/".$item->adb_hausnummer->stiege : ""?><br />
<?=$item->adb_hausnummer->plz->plz?>
<?=$item->adb_hausnummer->ortschaft->name?><br />
<?=$item->adb_hausnummer->strasse->gemeinde->name?>
<?php endif; ?>
</td>
<td><?=$item->adb_hausnummer->grund_nr?></td>
<td><?=$item->ez?></td>
<td><?=$item->owner_name?></td>
<td>
<?=$item->owner_street?><br />
<?=$item->owner_zip?> <?=$item->owner_city?><br />
</td>
<td>
<?php if($item->phone): ?>
Tel: <?=$item->phone?><br />
<?php endif; ?>
<?php if($item->fax): ?>
Fax: <?=$item->fax?><br />
<?php endif; ?>
<?php if($item->email): ?>
Email: <?=$item->email?>
<?php endif; ?>
</td>
<td><?=$item->status?></td>
<td><?=$item->result?></td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?=self::getUrl("ConstructionConsent", "view", ["id" => $item->id])?>"><i class="far fa-eyes" title="Anzeigen"></i></a>
<?php if(!$item->result): ?>
<a href="<?=self::getUrl("ConstructionConsent", "edit", ["id" => $item->id])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
<?php if($item->status == "new"): ?>
<a href="<?=self::getUrl("ConstructionConsent", "delete", ["id" => $item->id])?>" onclick="if(!confirm('Zustimmungserklärung wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
<?php endif; ?>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
</div>
</div>
</div>
</div>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>