Faserplanung
* Schächte/Verteiler
This commit is contained in:
@@ -0,0 +1,244 @@
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
<link href="<?= self::getResourcePath() ?>assets/css/select2-cstm.css?<?= date('U') ?>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<!-- 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"><a
|
||||
href="<?= self::getUrl("FiberPlanDispatcher") ?>">Verteiler/Schächte</a></li>
|
||||
<li class="breadcrumb-item active"><?= ($fiberplandispatchers->id) ? "bearbeiten" : "Neu" ?></li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title"><?= ($fiberplandispatchers->id) ? "Verteiler/Schacht bearbeiten" : "Neuer Verteiler/Schacht" ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<?php
|
||||
if (!$me->permissions->isAdmin) {
|
||||
foreach ($networkaddresses as $networkaddress) {
|
||||
if ($me->address->id == $networkaddress->address_id) {
|
||||
$allowedNetworks[$networkaddress->network_id] = "ok";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<style>
|
||||
.fa-circle-plus {
|
||||
color: #00b125;
|
||||
cursor: pointer;
|
||||
font-size: 17px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.remove-sleeve {
|
||||
cursor: pointer;
|
||||
color: #ff0606;
|
||||
font-size: 17px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<h4 class="header-title mb-2"><?= ($fiberplandispatchers->id) ? "Verteiler/Schacht bearbeiten" : "Neuer Verteiler/Schacht" ?></h4>
|
||||
<div class="col-12">
|
||||
<form class="form-horizontal" method="post"
|
||||
action="<?= self::getUrl("FiberPlanDispatcher", "save") ?>">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<input type="hidden" name="id" value="<?= $fiberplandispatchers->id ?>"/>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-4 col-form-label" for="network_id">Netzgebiet
|
||||
*</label>
|
||||
<div class="col-lg-5">
|
||||
|
||||
<select class="select2 form-control "
|
||||
name="network_id" id="network_id">
|
||||
<option value=""> </option>
|
||||
<?php foreach ($networks as $key => $network):
|
||||
if (!$me->permissions->isAdmin) {
|
||||
if (!array_key_exists($network->id, $allowedNetworks)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<option value="<?= $network->id ?>" <?= ($fiberplandispatchers->network_id == $network->id) ? "selected='selected'" : "" ?>><?= ($network->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-4 col-form-label" for="gps_lat">Beschreibung
|
||||
*</label>
|
||||
<div class="col-lg-4">
|
||||
<input type="text" required="required" step="any"
|
||||
class="form-control" name="description" id="description"
|
||||
value="<?= $fiberplandispatchers->description ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-4 col-form-label" for="object_type">Objekt Typ
|
||||
*</label>
|
||||
<div class="col-lg-4">
|
||||
<select class="select2 form-control" required="required"
|
||||
name="object_type" id="object_type">
|
||||
<option value="1" <?= ($fiberplandispatchers->object_type == '1') ? "selected='selected'" : "" ?>>
|
||||
Verteiler
|
||||
</option>
|
||||
<option value="2" <?= ($fiberplandispatchers->object_type == '2') ? "selected='selected'" : "" ?>>
|
||||
Schacht
|
||||
</option>
|
||||
<option value="3" <?= ($fiberplandispatchers->object_type == '3') ? "selected='selected'" : "" ?>>
|
||||
Greenfield
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-4 col-form-label" for="type">Typ</label>
|
||||
<div class="col-lg-4">
|
||||
<textarea id="type" name="type"
|
||||
class="form-control"><?= $fiberplandispatchers->type ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-4 col-form-label" for="gps_lat">GPS
|
||||
Breite/Länge</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="number" step="any" class="form-control" name="gps_lat"
|
||||
id="gps_lat" placeholder="GPS Breite"
|
||||
value="<?= $fiberplandispatchers->gps_lat ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3">
|
||||
<input type="number" step="any" class="form-control" name="gps_long"
|
||||
id="gps_long" placeholder="GPS Länge"
|
||||
value="<?= $fiberplandispatchers->gps_long ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-4 col-form-label" for="comment">Kommentar</label>
|
||||
<div class="col-lg-5">
|
||||
<textarea id="comment" name="comment"
|
||||
class="form-control"><?= $fiberplandispatchers->comment ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sleeves-main" class="col-6" <?= ($fiberplandispatchers->object_type == 2) ? "" : 'style="display:none"' ?>>
|
||||
<div class="row">
|
||||
<h4>Muffe(n) <i class="fa-regular fa-circle-plus add-sleeve"></i>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="sleeves-div">
|
||||
<?php
|
||||
if ($sleeves):
|
||||
foreach ($sleeves as $sleeve) : ?>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-3 col-form-label"
|
||||
>Muffe <i data-popid="5"
|
||||
class="fa-regular fa-circle-minus remove-sleeve"></i></label>
|
||||
<div class="col-lg-4">
|
||||
<input type="text" required="required" step="any"
|
||||
class="form-control" name="sleeves[]"
|
||||
value="<?= $sleeve['name']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
</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>
|
||||
<a href="<?= self::getUrl("FiberPlanDispatcher") ?>">
|
||||
<button type="button" class="btn btn-secondary">Abbrechen</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#network_id").select2({placeholder: ""});
|
||||
$("#object_type").select2();
|
||||
|
||||
// disable mousewheel on a 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')
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$("body").on("click", ".remove-sleeve", function () {
|
||||
$(this).closest('.form-group').remove();
|
||||
});
|
||||
|
||||
$("body").on("change", "#object_type", function (){
|
||||
if ($(this).val()=="2")
|
||||
{
|
||||
$('#sleeves-main').show()
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#sleeves-main').hide()
|
||||
$('#sleeves-div').empty()
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$("body").on("click", ".add-sleeve", function () {
|
||||
if ($('#sleeves-div').find('.form-group').length < 5) {
|
||||
$('#sleeves-div').append(`<div class="form-group row">
|
||||
<label class="col-lg-3 col-form-label"
|
||||
>Muffe <i data-popid="5" class="fa-regular fa-circle-minus remove-sleeve"></i></label>
|
||||
<div class="col-lg-4">
|
||||
<input type="text" required="required" step="any"
|
||||
class="form-control" name="sleeves[]"
|
||||
value="">
|
||||
</div>
|
||||
</div>`);
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
;
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
$objecttype[1] = 'Verteiler';
|
||||
$objecttype[2] = 'Schacht';
|
||||
$objecttype[3] = 'Greenfield';
|
||||
|
||||
?>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<!-- 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">Verteiler und Schächte</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Verteiler und Schächte</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
|
||||
<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 Verteiler und Schächte</h4>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<a class="btn btn-primary mb-2" href="<?= self::getUrl("FiberPlanDispatcher", "add") ?>"><i
|
||||
class="fas fa-plus"></i> Neuen Verteiler/Schacht anlegen</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
|
||||
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
|
||||
|
||||
<table id="datatable" class="table table-striped table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Netzgebiet</th>
|
||||
<th class="text-center">Beschreibung</th>
|
||||
<th class="text-center">Objektart</th>
|
||||
<th class="text-center">Type</th>
|
||||
<th class="text-center">Koordinaten</th>
|
||||
<th class="text-center">Kommentar</th>
|
||||
<th class="edit-weight"></th>
|
||||
</tr>
|
||||
<tr id="filterrow">
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<thead>
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($fiberplandispatchers as $fiberplandispatcher): ?>
|
||||
<?php
|
||||
if ($fiberplandispatcher->gps_lat) {
|
||||
$mapslink = '<a
|
||||
title="Google-Maps: ' . $fiberplandispatcher->gps_lat . ' , ' . $fiberplandispatcher->gps_long . '"
|
||||
class="mapsLink"
|
||||
href="http://maps.google.com/?q=' . $fiberplandispatcher->gps_lat . ' , ' . $fiberplandispatcher->gps_long . '"
|
||||
target="_blank">' . rtrim($fiberplandispatcher->gps_lat, 0) . ' , ' . rtrim($fiberplandispatcher->gps_long, 0) . '</a>';
|
||||
} else {
|
||||
$mapslink = 'N/A';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $fiberplandispatcher->network->name ?></td>
|
||||
<td><?= $fiberplandispatcher->description ?></td>
|
||||
<td class="text-center"><?= $objecttype[$fiberplandispatcher->object_type] ?></td>
|
||||
<td class="text-left"><?= nl2br($fiberplandispatcher->type) ?></td>
|
||||
<td class="text-center"><?= $mapslink ?></td>
|
||||
<td class="text-left"><?= nl2br($fiberplandispatcher->comment) ?></td>
|
||||
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?= self::getUrl("FiberPlanDispatcher", "edit", ["id" => $fiberplandispatcher->id]) ?>"><i
|
||||
class="far fa-edit" title="Bearbeiten"></i></a>
|
||||
<a href="<?= self::getUrl("FiberPlanDispatcher", "delete", ["id" => $fiberplandispatcher->id]) ?>"
|
||||
onclick="if(!confirm('Verteiler/Schacht wirklich löschen?')) return false;"
|
||||
class="text-danger"
|
||||
title="Löschen"><i class="fas fa-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var hidesearch = [6];
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>
|
||||
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
Reference in New Issue
Block a user