Added Buildings
This commit is contained in:
208
Layout/default/Building/Form.php
Normal file
208
Layout/default/Building/Form.php
Normal file
@@ -0,0 +1,208 @@
|
||||
<?php include(realpath(dirname(__FILE__)."/../")."/header.php"); ?>
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- 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")?>">the-tool</a></li>
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Building")?>">Objekte</a></li>
|
||||
<li class="breadcrumb-item active"><?=($building->id) ? "bearbeiten" : "Neu" ?></li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Objekte</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title mb-2"><?=($network->id) ? "Objekt bearbeiten" : "Neues Objekt"?></h4>
|
||||
|
||||
<form class="form-horizontal" method="post" action="<?=self::getUrl("Building", "save")?>">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<input type="hidden" name="id" value="<?=$building->id?>" />
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="network_id">Netzgebiet</label>
|
||||
<div class="col-lg-10">
|
||||
<select class="select2 form-control " name="network_id" id="building_id">
|
||||
<option></option>
|
||||
<?php foreach($networks as $network): ?>
|
||||
<option value="<?=$network->id?>" <?=($building->network_id == $network->id) ? "selected='selected'" : ""?>><?=($network->name)?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="pop_id">POP</label>
|
||||
<div class="col-lg-10">
|
||||
<select class="select2 form-control " name="pop_id" id="pop_id">
|
||||
<option></option>
|
||||
<?php foreach($networks as $network): ?>
|
||||
<?php foreach($network->pops as $pop): ?>
|
||||
<option value="<?=$pop->id?>" <?=($building->pop_id == $pop->id) ? "selected='selected'" : ""?>><?=$network->name?> - <?=($pop->name)?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="type_id">Objekttyp</label>
|
||||
<div class="col-lg-10">
|
||||
<select class="select2 form-control " name="type_id" id="type_id">
|
||||
<option></option>
|
||||
<?php foreach($types as $type): ?>
|
||||
<option value="<?=$type->id?>" <?=($building->type_id == $type->id) ? "selected='selected'" : ""?>><?=($type->name)?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="code">Objecktcode</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="code" id="code" value="<?=$building->code?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="oan_id">OAN ID</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="oan_id" id="oan_id" value="<?=$building->oan_id?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="street">Straße</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="street" id="street" value="<?=$building->street?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="zip">PLZ</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="zip" id="zip" value="<?=$building->zip?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="city">Ort</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="city" id="city" value="<?=$building->city?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="gps_lat">GPS Länge (N)</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="gps_lat" id="gps_lat" value="<?=$building->gps_lat?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="gps_long">GPS Breite (E)</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="gps_long" id="gps_long" value="<?=$building->gps_long?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="contact">Kontakt</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="contact" id="contact" value="<?=$building->contact?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="phone">Telefon</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="phone" id="phone" value="<?=$building->phone?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="email">Email</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="email" id="email" value="<?=$building->email?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="units">Wohneinheiten</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="number" class="form-control" name="units" id="units" value="<?=$building->units?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="description">Bauabschnitt</label>
|
||||
<div class="col-lg-10">
|
||||
<textarea id="description" class="form-control" name="description" rows="5"><?=$building->description?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="note">Interne Notiz</label>
|
||||
<div class="col-lg-10">
|
||||
<textarea id="note" class="form-control" name="note" rows="5"><?=$building->note?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2"></label>
|
||||
<div class="col-lg-10">
|
||||
<button type="submit" class="btn btn-primary">Speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- end container-fluid -->
|
||||
</div>
|
||||
<!-- end wrapper -->
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#network_id").select2({placeholder: ""});
|
||||
$("#pop_id").select2({placeholder: ""});
|
||||
$("#type_id").select2({placeholder: ""});
|
||||
|
||||
// disable mousewheel on input number field when in focus
|
||||
$('form').on('focus', 'input[type=number]', function (e) {
|
||||
$(this).on('wheel.disableScroll', function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
});
|
||||
$('form').on('blur', 'input[type=number]', function (e) {
|
||||
$(this).off('wheel.disableScroll')
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../")."/footer.php"); ?>
|
||||
74
Layout/default/Building/Index.php
Normal file
74
Layout/default/Building/Index.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php include(realpath(dirname(__FILE__)."/../")."/header.php"); ?>
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- 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")?>">the-tool</a></li>
|
||||
<li class="breadcrumb-item active">Objekte</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Objekte</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<div class="float-left">
|
||||
<h4 class="header-title">Liste aller Objekte</h4>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<a class="btn btn-primary mb-2" href="<?=self::getUrl("Building", "add")?>"><i class="fas fa-plus"></i> Neues Objekt anlegen</a>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped table-hover">
|
||||
<tr>
|
||||
<th>Netzgebiet</th>
|
||||
<th>POP</th>
|
||||
<th>Typ</th>
|
||||
<th>Objektcode</th>
|
||||
<th>OAN ID</th>
|
||||
<th>Adresse</th>
|
||||
<th>Einheiten</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($buildings as $building): ?>
|
||||
<tr>
|
||||
<td><?=$building->network->name?></td>
|
||||
<td><?=$building->pop->name?></td>
|
||||
<td><?=$building->type->name?></td>
|
||||
<td><?=$building->code?></td>
|
||||
<td><?=$building->oan_id?></td>
|
||||
<td>
|
||||
<?=$building->street?><br />
|
||||
<?=$building->zip?> <?=$building->city?>
|
||||
</td>
|
||||
<td><?=$building->units?></td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?=self::getUrl("Building", "edit", ["id" => $building->id])?>"><i class="far fa-edit" title="Objekt Bearbeiten"></i></a>
|
||||
<a href="<?=self::getUrl("Building", "delete", ["id" => $building->id])?>" class="text-danger" onclick="if(!confirm('Objekt wirklich löschen?')) return false;" title="Objekt Löschen"><i class="fas fa-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- end container-fluid -->
|
||||
</div>
|
||||
<!-- end wrapper -->
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../")."/footer.php"); ?>
|
||||
Reference in New Issue
Block a user