Files
thetool/Layout/default/FiberPlanPipe/Detail.php
Daniel Spitzer 1554d6cf72 Faserplanung Vorbereitung für Kabelverschaltung
* Menüpunkt Kabelverschaltung hinzugefügt
 * Initialfiles für Kabelverschaltung
2024-06-30 12:01:56 +02:00

589 lines
24 KiB
PHP

<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<?php
$markers = [];
$typeOption[1] = "Einzel";
$typeOption[2] = "Schutzrohr";
$typeOption[3] = "Verband";
$starting_pointOption[1] = "Greenfield";
$starting_pointOption[2] = "POP";
$starting_pointOption[3] = "Building";
$starting_pointOption[4] = "Schacht-Verteiler";
$fiberplanpipestypes[1] = "Verteiler";
$fiberplanpipestypes[2] = "Schacht";
$fiberplanpipestypes[3] = "Greenfield";
$fiberplanpipestypes[4] = "Abzweigepunkt";
$dimension_v1Option[1] = "MR7";
$dimension_v1Option[2] = "MR14";
$dimension_v1Option[3] = "MR16";
$dimension_v1Option[4] = "MR20";
$dimension_v1Option[5] = "PE32";
$dimension_v1Option[6] = "PE40";
$dimension_v1Option[7] = "PE50";
$dimension_v1Option[8] = "KSR50";
$dimension_v1Option[9] = "KSR80";
$dimension_v1Option[10] = "KSR100";
$dimension_v2Option[1] = "Anzahl";
$dimension_v2Option[2] = "Dimenson";
$dimension_v2Option[3] = "Farben";
$state[10] = 'Geplant';
$state[20] = 'Umsetzung';
$state[30] = 'Fertiggestellt';
foreach ($pipworkeraddresses as $pipworkeraddress):
$Pipeworkers[$pipworkeraddress->id] = $pipworkeraddress->company;
endforeach;
foreach ($fiberplanpipeendpoints as $fiberplanpipeEndpoint):
if ($fiberplanpipeEndpoint->pop_id) {
$networks[$fiberplanpipeEndpoint->pop->network->name] = $fiberplanpipeEndpoint->pop->network->name;
} else if ($fiberplanpipeEndpoint->building_id) {
$networks[$fiberplanpipeEndpoint->building->network->name] = $fiberplanpipeEndpoint->building->network->name;
} else if ($fiberplanpipeEndpoint->fiberPlanDispatcher_id) {
$networks[$fiberplanpipeEndpoint->fiberPlanDispatcher->network->name] = $fiberplanpipeEndpoint->fiberPlanDispatcher->network->name;
}
endforeach;
if ($fiberplanpipes->address_id) {
$responsible = $Pipeworkers[$fiberplanpipes->address_id];
} else {
$responsible = "Person";
}
if ($fiberplanpipes->type == "3") {
$name = "";
if ($fiberplanpipes->fiberPlanPipeTemplate->pipe7x4 && $fiberplanpipes->fiberPlanPipeTemplate->pipe14x10) {
$name = $fiberplanpipes->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipes->fiberPlanPipeTemplate->pipe7x4 . "*7x4" . "/" . $fiberplanpipes->fiberPlanPipeTemplate->pipe14x10 . "*14x10";
} else if ($fiberplanpipes->fiberPlanPipeTemplate->pipe7x4) {
$name = $fiberplanpipes->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipes->fiberPlanPipeTemplate->pipe7x4 . "*7x4";
} else if ($fiberplanpipes->fiberPlanPipeTemplate->pipe14x10) {
$name = $fiberplanpipes->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipes->fiberPlanPipeTemplate->pipe14x10 . "*14x10";
}
$typeDescription = $name;
//
} else {
$typeDescription = $dimension_v1Option[$fiberplanpipes->type_description];
}
?>
<style>
#map {
height: 600px;
width: 100%;
}
.card-border {
border-left: 1px solid #428bca;
border-left-width: 5px;
border-radius: 3px;
}
.fiber-rack-div {
margin-top: 5px;
margin-bottom: 5px;
}
.fiber-color {
color: #0d6efd;
float: right;
margin-left: 5px;
}
.fiber-module-div {
padding-left: 5px;
padding-right: 5px;
margin-left: 5px;
margin-right: 5px;
margin-bottom: 5px;
border: 1px solid #e3e3e3;
}
.sp-border-rl {
padding-left: 5px;
padding-right: 5px;
}
.sp-table-border {
border: 1px solid #bfbfbf;
border-radius: 10px;
display: inline;
}
.sp-table-border > tbody {
padding: 10px;
}
.sp-table-border > thead td {
padding: 10px 0px 0px 0px;
font-weight: bold;
text-align: center;
font-size: 20px;
}
.sp-port-lines {
width: 50px;
border-top: 1px solid #000;
border-bottom: 1px solid #000;
background-color: #000;
}
#olt-splitter td {
height: 30px;
width: 150px;
border: 1px solid #bfbfbf;
margin-top: 15px;
display: block;
border-radius: 5px;
}
#olt-splitter-table thead {
padding: 10px 0px 0px 0px;
font-weight: bold;
font-size: 20px;
}
#olt-splitter-table thead td {
padding-top: 12px;
text-align: center;
}
.sp-splitter-count {
padding: 3px 10px 3px 10px;
width: 50px;
}
.sp-splitter-count-left {
padding: 3px 0px 3px 10px;
width: 50px;
}
.sp-splitter-count-right {
padding: 3px 10px 3px 0px;
width: 50px;
text-align: right;
}
.sp-splitter-count-edit {
-ms-user-select: None;
-moz-user-select: None;
-webkit-user-select: None;
user-select: None;
cursor: pointer;
}
.sp-splitter-count-show {
width: 46px;
display: inline-block;
text-align: center;
cursor: pointer;
text-decoration: underline;
padding-top: 2px;
-ms-user-select: None;
-moz-user-select: None;
-webkit-user-select: None;
user-select: None;
}
.sp-white-border {
border-color: #fff !important;
}
.sp-ont-text {
padding: 0px 5px 0px 5px;
}
.fa-circle-check {
color: #07ad2b;
}
.fa-circle-xmark {
color: #ff0000;
}
.fa-rotate-right {
color: #0d6efd;
cursor: pointer;
}
.ont-refresh-span, .ontdetail-refresh-span {
display: inline-block;
width: 20px;
margin-right: 50px;
min-height: 1px;
color: #0d6efd;
}
.text-decoration-underline {
text-decoration: underline;
cursor: pointer;
}
.condensed-ont th {
padding: 6px 0.85rem 6px 0.85rem !important;
}
.condensed-ont td {
padding: 6px 0.85rem 6px 0.85rem !important;
}
</style>
<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("FiberPlanPipe") ?>">Rohrverzeichnis</a>
</li>
<li class="breadcrumb-item active">Kabelverzeichnis Detail</li>
</ol>
</div>
<h4 class="page-title">Kabel: <span
class="font-weight-normal ml-1"><?= $fiberplanpipes->description ?></span>
<span class="ml-2">
<a href="<?= self::getUrl("FiberPlanPipe", "edit", ["id" => $fiberplanpipes->id, 'returnto' => "fiberplanpipe-detail"]) ?>">
<button class="btn btn-primary">Bearbeiten</button>
</a>
</span></h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-4 card-border">
<div>
<h4>Allgemeine Informationen </h4>
</div>
<div>
<table class="table table-sm">
<tbody>
<tr>
<th class="w-50">Bezeichnung</th>
<td><?= $fiberplanpipes->description ?> </td>
</tr>
<tr>
<th>GisId</th>
<td><?= $fiberplanpipes->gisid ?> </td>
</tr>
<tr>
<th>Länge (m)</th>
<td>
<?= $fiberplanpipes->length ?> Meter
</td>
</tr>
<tr>
<th>Netzgebiet (e)</th>
<td><?= implode(', ', $networks) ?> </td>
</tr>
<tr>
<th>Rohrtyp</th>
<td><?= $typeOption[$fiberplanpipes->type] ?></td>
</tr>
<tr>
<th>Rohrbezeichnung</th>
<td><?= $typeDescription ?> </td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-4 ">
<div>
<h4>&nbsp;</h4>
</div>
<table class="table table-sm">
<tbody>
<tr>
<th>Status</th>
<td><?= $state[$fiberplanpipes->status] ?> </td>
</tr>
<tr>
<th>Zuständig</th>
<td><?= $responsible ?> </td>
</tr>
<tr>
<th>Kontakt</th>
<td><?= $fiberplanpipes->responsible_text ?> </td>
</tr>
<tr>
<th>Bemerkung</th>
<td><?= nl2br($fiberplanpipes->comment) ?> </td>
</tr>
</tbody>
</table>
</div>
<div class="col-3 ">
</div>
</div>
<div class="row pb-3 pt-4 ">
<div class="col-12 text-center card-border">
<div>
<h4 class="text-left mb-3">Schematische Darstellung <i data-toggle="modal"
data-target="#pipemap"
class="fa-duotone fa-map-location-dot font-24"
style="--fa-primary-color: #fa0000; --fa-secondary-color: #232423;margin-left:5px;cursor:pointer"></i>
</h4>
</div>
<div class="ml-2">
<?php
if ($fiberplanpipeendpoints) :
$endpointcounter = count($fiberplanpipeendpoints);
$counter = 1;
foreach ($fiberplanpipeendpoints as $endpoint):
if ($endpoint->pop_id) {
$endpointname = '<a href="' . self::getUrl("Pop", "Detail", ["id" => $endpoint->pop->id]) . '" target="_blank">' . $endpoint->pop->name . '</a>';
$endpointtype = "Pop";
$gps_lat = $endpoint->pop->gps_lat;
$gps_long = $endpoint->pop->gps_long;
} elseif ($endpoint->fiberPlanDispatcher_id) {
$endpointname = $endpoint->fiberPlanDispatcher->description;
$endpointtype = $fiberplanpipestypes[$endpoint->fiberPlanDispatcher->object_type];
$gps_lat = $endpoint->fiberPlanDispatcher->gps_lat;
$gps_long = $endpoint->fiberPlanDispatcher->gps_long;
} elseif ($endpoint->building_id) {
$endpointname = $endpoint->building->street;
$endpointtype = 'Building';
$gps_lat = $endpoint->building->gps_lat;
$gps_long = $endpoint->building->gps_long;
}
$coordinates = "";
if ($gps_lat) {
$coordinates = round($gps_lat, 5) . " , " . round($gps_long, 5);
$coordinates = '<a title="Google-Maps: ' . $coordinates . '" class="mapsLink" href="http://maps.google.com/?q=' . $coordinates . '" target="_blank">' . $coordinates . '</a>';
}
?>
<table class="sp-table-border float-left border-collapse: collapse;"
style="min-height: 150px;">
<thead style="display: inline;">
<tr>
<th colspan="3"
class="text-center font-15">
<div class="pt-2 pl-2 pr-2"><?= $endpointtype; ?></div>
</th>
</tr>
<tr>
<th colspan="3"
class="text-center font-15">
<div class="pl-2 pr-2"><?= $endpointname; ?></div>
</th>
</tr>
<tr>
<th colspan="3"
class="text-center font-13">
<div class="pb-2 pl-2 pr-2"><?= $coordinates ?></div>
</th>
</tr>
</thead>
<?php
$markers[] = array(
"gps_lat" => $gps_lat,
"gps_long" => $gps_long,
"name" => $endpointname,
"type" => $endpointtype
);
?>
</table>
<?php
if ($endpointcounter > $counter) :
?>
<table id="olt-port-table" class="float-left" style="width: 100px">
<thead>
<tr>
<td style="height:40px;"></td>
</tr>
</thead>
<tbody id="olt-ports">
<tr>
<td data-oltport="0"
class="font-13"><?= $fibers[$fiberplancables->fibers]['fibers']; ?></td>
</tr>
<tr>
<td data-oltport="0" class="sp-port-lines"
style="width: 70px;"></td>
</tr>
<tr>
<td data-oltport="0" class="font-13"><?= $pipesub; ?>
</td>
</tr>
</tbody>
</table>
<?php
endif;
$counter++;
endforeach;
endif;
?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="pipemap" tabindex="-1" role="dialog" aria-labelledby="pipemap"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="pipemapLabel">Rohrverzeichnis</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div id="map"></div>
</div>
<div class="row justify-content-center">
<div class="col-lg-1"></div>
<div class="col-lg-9 "><h4>Legende:</h4></div>
</div>
<div class="row justify-content-center">
<div class="col-lg-1"></div>
<div class="col-lg-4"><img src="<?= self::getResourcePath() ?>img/markers/marker-pop.png ">
<label class="font-16"> ... Pop</label></div>
<div class="col-lg-4"><img src="<?= self::getResourcePath() ?>img/markers/marker-home.png ">
<label class="font-16"> ... Building</label></div>
</div>
<div class="row justify-content-center">
<div class="col-lg-1"></div>
<div class="col-lg-4 justify-content-center"><img
src="<?= self::getResourcePath() ?>img/markers/marker-dispatcher.png "> <label
class="font-16"> ... Schacht/Verteiler</label></div>
<div class="col-lg-4"><img
src="<?= self::getResourcePath() ?>img/markers/marker-greenfield.png "> <label
class="font-16"> ... Greenfield</label></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Schließen</button>
</div>
</div>
</div>
</div>
<?php if ($markers) :
?>
<script type="text/javascript">
var fitmap = 0;
var marker = [];
var polylinec;
var polyline;
var map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer('https://mapsneu.wien.gv.at/basemap/{id}/normal/google3857/{z}/{y}/{x}.{imgtype}', {
maxZoom: 19,
id: "geolandbasemap",
imgtype: "png"
}).addTo(map);
L.MakiMarkers.accessToken = '<?=TT_MAPBOX_TILE_API_TOKEN?>';
$(document).ready(function () {
var locations = [<?php
$counter = 0;
$lat = 0;
$long = 0;
foreach ($markers as $marker):
if ($counter > 0) echo ',';
?>
['<?= $marker['name'] ?>', <?= $marker['gps_lat'] ?>, <?= $marker['gps_long'] ?>, '<?= $marker['type'] ?>']
<?php
$lat = $lat + $marker['gps_lat'];
$long = $long + $marker['gps_long'];
$counter++;
endforeach;
$lat = $lat / $counter;
$long = $long / $counter;
?>
];
console.log(locations);
var startlat = <?=$lat ?>;
var startlong = <?=$long ?>;
$('#pipemap').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
map.remove();
map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer('https://mapsneu.wien.gv.at/basemap/{id}/normal/google3857/{z}/{y}/{x}.{imgtype}', {
maxZoom: 19,
id: "geolandbasemap",
imgtype: "png"
}).addTo(map);
var icon_name = "town";
var icon_color = "#ec98a2";
var icon = L.MakiMarkers.icon({icon: icon_name, color: icon_color, size: "l"});
var oldlat;
var oldlong;
for (var i = 0; i < locations.length; i++) {
if (locations[i][1]) {
if (locations[i][3] == "Greenfield") {
icon_name = "garden";
icon_color = "#abbaf0";
} else if (locations[i][3] == "Pop") {
icon_name = "village";
icon_color = "#acf0ab";
} else if (locations[i][3] == "Building") {
icon_name = "home";
icon_color = "#f0abab";
} else {
icon_name = "home";
icon_color = "#e9f0ab";
}
icon = L.MakiMarkers.icon({icon: icon_name, color: icon_color, size: "l"});
marker.push(L.marker([locations[i][1], locations[i][2]], {icon: icon}).addTo(map).bindPopup(locations[i][0]));
if (oldlong) {
polylinec = [
[oldlat, oldlong],
[locations[i][1], locations[i][2]]
];
polyline = L.polyline(polylinec, {color: 'red'}).addTo(map);
polyline = null;
}
oldlong = locations[i][2];
oldlat = locations[i][1];
} else {
oldlong = null;
oldlat = null;
}
}
if (locations.length > 1) {
fitmap = 1;
}
});
$('#pipemap').on('shown.bs.modal', function (event) {
map.invalidateSize();
var group = new L.featureGroup(marker);
map.fitBounds(group.getBounds());
});
});
</script>
<?php endif; ?>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>