Faserplanung
* Rohrplanung Updates * Migrations
This commit is contained in:
@@ -20,6 +20,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
#map {
|
||||
height: 570px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fa-circle-plus {
|
||||
color: #00b125;
|
||||
cursor: pointer;
|
||||
@@ -35,6 +40,7 @@
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
|
||||
.fa-up {
|
||||
color: #0d6efd;
|
||||
font-size: 17px;
|
||||
@@ -42,6 +48,14 @@
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.fa-down {
|
||||
color: #0d6efd;
|
||||
font-size: 17px;
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
|
||||
@@ -60,184 +74,248 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
|
||||
|
||||
<form class="form-horizontal" method="post"
|
||||
action="<?= self::getUrl("FiberPlanPipe", "save", ["returnto" => $_GET["returnto"]]) ?>">
|
||||
<div class="card">
|
||||
<div class="card ">
|
||||
<div class="card-body">
|
||||
<input type="hidden" name="id" value="<?= $fiberplanpipes->id ?>"/>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="description">Bezeichnung * / Gis
|
||||
Id</label>
|
||||
<div class="col-lg-2">
|
||||
<input required="required" type="text" id="description" name="description"
|
||||
class="form-control"
|
||||
value="<?= $fiberplanpipes->description ?>"/>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<input type="text" id="gisid" name="gisid" placeholder="Gis Id"
|
||||
class="form-control"
|
||||
value="<?= $fiberplanpipes->gisid ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="type">Type *</label>
|
||||
<div class="col-lg-3">
|
||||
<select required="required" id="type" name="type" class="select2 form-control">
|
||||
<option value=""></option>
|
||||
<option value="1" <?= ($fiberplanpipes->type == "1") ? "selected='selected'" : "" ?>>
|
||||
Einzel
|
||||
</option>
|
||||
<option value="2" <?= ($fiberplanpipes->type == "2") ? "selected='selected'" : "" ?>>
|
||||
Schutzrohr
|
||||
</option>
|
||||
<option value="3" <?= ($fiberplanpipes->type == "3") ? "selected='selected'" : "" ?>>
|
||||
Verband
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="dimesion-div"
|
||||
style="<?= ($fiberplanpipes->type == "3") ? "display:none" : "" ?>">
|
||||
<label class="col-lg-2 col-form-label" for="type_description">Dimension *</label>
|
||||
<div class="col-lg-3">
|
||||
<select required="required" <?= ($fiberplanpipes->type == "3") ? 'disabled="disabled"' : "" ?>
|
||||
id="type_description" name="type_description"
|
||||
class="select2 form-control">
|
||||
<option value=""></option>
|
||||
<option value="1" <?= ($fiberplanpipes->type_description == "1") ? "selected='selected'" : "" ?>>
|
||||
MR7
|
||||
</option>
|
||||
<option value="2" <?= ($fiberplanpipes->type_description == "2") ? "selected='selected'" : "" ?>>
|
||||
MR14
|
||||
</option>
|
||||
<option value="3" <?= ($fiberplanpipes->type_description == "3") ? "selected='selected'" : "" ?>>
|
||||
MR16
|
||||
</option>
|
||||
<option value="4" <?= ($fiberplanpipes->type_description == "4") ? "selected='selected'" : "" ?>>
|
||||
MR20
|
||||
</option>
|
||||
<option value="5" <?= ($fiberplanpipes->type_description == "5") ? "selected='selected'" : "" ?>>
|
||||
PE32
|
||||
</option>
|
||||
<option value="6" <?= ($fiberplanpipes->type_description == "6") ? "selected='selected'" : "" ?>>
|
||||
PE40
|
||||
</option>
|
||||
<option value="7" <?= ($fiberplanpipes->type_description == "7") ? "selected='selected'" : "" ?>>
|
||||
PE50
|
||||
</option>
|
||||
<option value="8" <?= ($fiberplanpipes->type_description == "8") ? "selected='selected'" : "" ?>>
|
||||
KSR50
|
||||
</option>
|
||||
<option value="9" <?= ($fiberplanpipes->type_description == "9") ? "selected='selected'" : "" ?>>
|
||||
KSR80
|
||||
</option>
|
||||
<option value="10" <?= ($fiberplanpipes->type_description == "10") ? "selected='selected'" : "" ?>>
|
||||
KSR100
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="dimension-bundle-div"
|
||||
style="<?= ($fiberplanpipes->type < "3" || !$fiberplanpipes->type) ? "display:none" : "" ?>">
|
||||
<label class="col-lg-2 col-form-label" for="fiberplanpipetemplate_id">Multirohr
|
||||
*</label>
|
||||
<div class="col-lg-3">
|
||||
<select <?= ($fiberplanpipes->type < "3" || !$fiberplanpipes->type) ? 'disabled="disabled"' : "" ?>
|
||||
required="required" id="fiberplanpipetemplate_id"
|
||||
name="fiberplanpipetemplate_id"
|
||||
class="select2 form-control">
|
||||
<option value=""></option>
|
||||
<?php foreach ($fiberplanpipetemplates as $fiberplanpipetemplate) :
|
||||
$name = "";
|
||||
if ($fiberplanpipetemplate->pipe7x4 && $fiberplanpipetemplate->pipe14x10) {
|
||||
$name = $fiberplanpipetemplate->name . " " . $fiberplanpipetemplate->pipe7x4 . "*7x4" . "/" . $fiberplanpipetemplate->pipe14x10 . "*14x10";
|
||||
} else if ($fiberplanpipetemplate->pipe7x4) {
|
||||
$name = $fiberplanpipetemplate->name . " " . $fiberplanpipetemplate->pipe7x4 . "*7x4";
|
||||
} else if ($fiberplanpipetemplate->pipe14x10) {
|
||||
$name = $fiberplanpipetemplate->name . " " . $fiberplanpipetemplate->pipe14x10 . "*14x10";
|
||||
}
|
||||
<div class="row">
|
||||
<div class="col col-lg-8">
|
||||
<input type="hidden" name="id" value="<?= $fiberplanpipes->id ?>"/>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="description">Bezeichnung * / Gis
|
||||
Id</label>
|
||||
<div class="col-lg-3">
|
||||
<input required="required" type="text" id="description"
|
||||
name="description"
|
||||
class="form-control"
|
||||
value="<?= $fiberplanpipes->description ?>"/>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<input type="text" id="gisid" name="gisid" placeholder="Gis Id"
|
||||
class="form-control"
|
||||
value="<?= $fiberplanpipes->gisid ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="type">Type *</label>
|
||||
<div class="col-lg-3">
|
||||
<select required="required" id="type" name="type"
|
||||
class="select2 form-control">
|
||||
<option value=""></option>
|
||||
<option value="1" <?= ($fiberplanpipes->type == "1") ? "selected='selected'" : "" ?>>
|
||||
Einzel
|
||||
</option>
|
||||
<option value="2" <?= ($fiberplanpipes->type == "2") ? "selected='selected'" : "" ?>>
|
||||
Schutzrohr
|
||||
</option>
|
||||
<option value="3" <?= ($fiberplanpipes->type == "3") ? "selected='selected'" : "" ?>>
|
||||
Verband
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="dimesion-div"
|
||||
style="<?= ($fiberplanpipes->type == "3") ? "display:none" : "" ?>">
|
||||
<label class="col-lg-2 col-form-label" for="type_description">Dimension
|
||||
*</label>
|
||||
<div class="col-lg-3">
|
||||
<select required="required" <?= ($fiberplanpipes->type == "3") ? 'disabled="disabled"' : "" ?>
|
||||
id="type_description" name="type_description"
|
||||
class="select2 form-control">
|
||||
<option value=""></option>
|
||||
<option value="1" <?= ($fiberplanpipes->type_description == "1") ? "selected='selected'" : "" ?>>
|
||||
MR7
|
||||
</option>
|
||||
<option value="2" <?= ($fiberplanpipes->type_description == "2") ? "selected='selected'" : "" ?>>
|
||||
MR14
|
||||
</option>
|
||||
<option value="3" <?= ($fiberplanpipes->type_description == "3") ? "selected='selected'" : "" ?>>
|
||||
MR16
|
||||
</option>
|
||||
<option value="4" <?= ($fiberplanpipes->type_description == "4") ? "selected='selected'" : "" ?>>
|
||||
MR20
|
||||
</option>
|
||||
<option value="5" <?= ($fiberplanpipes->type_description == "5") ? "selected='selected'" : "" ?>>
|
||||
PE32
|
||||
</option>
|
||||
<option value="6" <?= ($fiberplanpipes->type_description == "6") ? "selected='selected'" : "" ?>>
|
||||
PE40
|
||||
</option>
|
||||
<option value="7" <?= ($fiberplanpipes->type_description == "7") ? "selected='selected'" : "" ?>>
|
||||
PE50
|
||||
</option>
|
||||
<option value="8" <?= ($fiberplanpipes->type_description == "8") ? "selected='selected'" : "" ?>>
|
||||
KSR50
|
||||
</option>
|
||||
<option value="9" <?= ($fiberplanpipes->type_description == "9") ? "selected='selected'" : "" ?>>
|
||||
KSR80
|
||||
</option>
|
||||
<option value="10" <?= ($fiberplanpipes->type_description == "10") ? "selected='selected'" : "" ?>>
|
||||
KSR100
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="dimension-bundle-div"
|
||||
style="<?= ($fiberplanpipes->type < "3" || !$fiberplanpipes->type) ? "display:none" : "" ?>">
|
||||
<label class="col-lg-2 col-form-label" for="fiberplanpipetemplate_id">Multirohr
|
||||
*</label>
|
||||
<div class="col-lg-3">
|
||||
<select <?= ($fiberplanpipes->type < "3" || !$fiberplanpipes->type) ? 'disabled="disabled"' : "" ?>
|
||||
required="required" id="fiberplanpipetemplate_id"
|
||||
name="fiberplanpipetemplate_id"
|
||||
class="select2 form-control">
|
||||
<option value=""></option>
|
||||
<?php foreach ($fiberplanpipetemplates as $fiberplanpipetemplate) :
|
||||
$name = "";
|
||||
if ($fiberplanpipetemplate->pipe7x4 && $fiberplanpipetemplate->pipe14x10) {
|
||||
$name = $fiberplanpipetemplate->name . " " . $fiberplanpipetemplate->pipe7x4 . "*7x4" . "/" . $fiberplanpipetemplate->pipe14x10 . "*14x10";
|
||||
} else if ($fiberplanpipetemplate->pipe7x4) {
|
||||
$name = $fiberplanpipetemplate->name . " " . $fiberplanpipetemplate->pipe7x4 . "*7x4";
|
||||
} else if ($fiberplanpipetemplate->pipe14x10) {
|
||||
$name = $fiberplanpipetemplate->name . " " . $fiberplanpipetemplate->pipe14x10 . "*14x10";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<option <?= ($fiberplanpipetemplate->id == $fiberplanpipes->fiberPlanPipeTemplate_id) ? "selected='selected'" : "" ?>
|
||||
value="<?= $fiberplanpipetemplate->id ?>"><?= $name ?></option>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="length">Länge (m) *</label>
|
||||
<div class="col-lg-2">
|
||||
<input required="required" type="number" step="any" id="length"
|
||||
name="length"
|
||||
class="form-control"
|
||||
value="<?= $fiberplanpipes->length ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="endpoints">
|
||||
<?php if ($fiberplanpipeendpoints) :
|
||||
FiberPlanPipeModel::generateEndpoints($fiberplanpipeendpoints, $networks);
|
||||
else :
|
||||
$randid = rand(1000, 10000);
|
||||
$typeArray[1] = 'Greenfield';
|
||||
$typeArray[2] = 'POP';
|
||||
$typeArray[3] = 'Building';
|
||||
$typeArray[4] = 'Schacht-Verteiler';
|
||||
?>
|
||||
<option <?= ($fiberplanpipetemplate->id == $fiberplanpipes->fiberPlanPipeTemplate_id) ? "selected='selected'" : "" ?>
|
||||
value="<?= $fiberplanpipetemplate->id ?>"><?= $name ?></option>
|
||||
<div class="form-group row endpoint-maindiv">
|
||||
<label class="col-lg-2 col-form-label endpoint-label"
|
||||
for="startpoint_network_id"><span
|
||||
class="label-text">Startpunkt * </span><span
|
||||
class="endpointsymbol"><i id="add-endpoint"
|
||||
class="fa-regular fa-circle-plus"></i></span></label>
|
||||
<div class="col-lg-3">
|
||||
<select id="<?= $randid ?>_endpoint_network_id"
|
||||
required="required"
|
||||
name="endpoint_network_id[]"
|
||||
class="select2 form-control endpoint_network_id ">
|
||||
<option value=""></option>
|
||||
<?php foreach ($networks as $network): ?>
|
||||
<option value="<?= $network->id ?>"><?= $network->name ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<select id="<?= $randid ?>_endpoint_type" required="required"
|
||||
name="endpoint_type[]"
|
||||
class="select2 form-control endpoint_type">
|
||||
<option value=""></option>
|
||||
<?php foreach ($typeArray as $key => $type) : ?>
|
||||
<option value="<?= $key ?>"><?= $type ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2" id="<?= $randid ?>_end-point-building">
|
||||
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="length">Länge (m) *</label>
|
||||
<div class="col-lg-1">
|
||||
<input required="required" type="number" step="any" id="length" name="length"
|
||||
class="form-control"
|
||||
value="<?= $fiberplanpipes->length ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="endpoints">
|
||||
<?php if ($fiberplanpipeendpoints) :
|
||||
FiberPlanPipeModel::generateEndpoints($fiberplanpipeendpoints, $networks);
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="status">Status *</label>
|
||||
<div class="col-lg-2">
|
||||
<select id="status" name="status" class="select2 form-control"
|
||||
required="required">
|
||||
<option value=""></option>
|
||||
<option value="10" <?= ($fiberplanpipes->status == "10") ? "selected='selected'" : "" ?>>
|
||||
Geplant
|
||||
</option>
|
||||
<option value="20" <?= ($fiberplanpipes->status == "20") ? "selected='selected'" : "" ?>>
|
||||
Umsetzung
|
||||
</option>
|
||||
<option value="30" <?= ($fiberplanpipes->status == "30") ? "selected='selected'" : "" ?>>
|
||||
Fertiggestellt
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="responsible">Zuständig</label>
|
||||
<div class="col-lg-2">
|
||||
<select id="responsible" name="responsible" class="select2 form-control">
|
||||
<option value=""></option>
|
||||
<option value="1" <?= ($fiberplanpipes->responsible == "1") ? "selected='selected'" : "" ?>>
|
||||
Tiefbaufirma
|
||||
</option>
|
||||
<option value="2" <?= ($fiberplanpipes->responsible == "2") ? "selected='selected'" : "" ?>>
|
||||
Person
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="responsible-div" class="col-lg-3"
|
||||
style="<?= ($fiberplanpipes->responsible != "1") ? "display:none" : "" ?>">
|
||||
<select id="address_id" name="address_id"
|
||||
class="select2 form-control" <?= ($fiberplanpipes->responsible != "1") ? 'disabled="disabled"' : "" ?> >
|
||||
<option value=""></option>
|
||||
<?php foreach ($pipworkeraddresses as $pipworkeraddress): ?>
|
||||
<option value="<?= $pipworkeraddress->id ?>" <?= ($fiberplanpipes->address_id == $pipworkeraddress->id) ? "selected='selected'" : "" ?>><?= $pipworkeraddress->company ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div id="responsible_text-div" class="col-lg-3">
|
||||
<input id="responsible_text" name="responsible_text"
|
||||
value="<?= $fiberplanpipes->responsible_text ?>"
|
||||
placeholder="Ansprechsperson"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="status">Status *</label>
|
||||
<div class="col-lg-2">
|
||||
<select id="status" name="status" class="select2 form-control"
|
||||
required="required">
|
||||
<option value=""></option>
|
||||
<option value="10" <?= ($fiberplanpipes->status == "10") ? "selected='selected'" : "" ?>>
|
||||
Geplant
|
||||
</option>
|
||||
<option value="20" <?= ($fiberplanpipes->status == "20") ? "selected='selected'" : "" ?>>
|
||||
Umsetzung
|
||||
</option>
|
||||
<option value="30" <?= ($fiberplanpipes->status == "30") ? "selected='selected'" : "" ?>>
|
||||
Fertiggestellt
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="responsible">Zuständig *</label>
|
||||
<div class="col-lg-2">
|
||||
<select id="responsible" name="responsible" class="select2 form-control"
|
||||
required="required">
|
||||
<option value=""></option>
|
||||
<option value="1" <?= ($fiberplanpipes->responsible == "1") ? "selected='selected'" : "" ?>>
|
||||
Tiefbaufirma
|
||||
</option>
|
||||
<option value="2" <?= ($fiberplanpipes->responsible == "2") ? "selected='selected'" : "" ?>>
|
||||
Person
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="responsible-div" class="col-lg-3"
|
||||
style="<?= ($fiberplanpipes->responsible != "1") ? "display:none" : "" ?>">
|
||||
<select id="address_id" name="address_id"
|
||||
class="select2 form-control" <?= ($fiberplanpipes->responsible != "1") ? 'disabled="disabled"' : "" ?> >
|
||||
<option value=""></option>
|
||||
<?php foreach ($pipworkeraddresses as $pipworkeraddress): ?>
|
||||
<option value="<?= $pipworkeraddress->id ?>" <?= ($fiberplanpipes->address_id == $pipworkeraddress->id) ? "selected='selected'" : "" ?>><?= $pipworkeraddress->company ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div id="responsible_text-div" class="col-lg-3">
|
||||
<input id="responsible_text" name="responsible_text"
|
||||
value="<?= $fiberplanpipes->responsible_text ?>"
|
||||
placeholder="Ansprechsperson"
|
||||
class="form-control"/>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="comment">Kommentar</label>
|
||||
<div class="col-lg-3">
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="comment">Kommentar</label>
|
||||
<div class="col-lg-3">
|
||||
<textarea id="comment" name="comment"
|
||||
class="form-control"><?= $fiberplanpipes->comment ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col col-lg-4 align-self-center">
|
||||
<div class="row">
|
||||
<div id="map"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6"><h4>Legende:</h4></div>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-5"><img src="<?= self::getResourcePath() ?>img/markers/marker-pop.png "> <label class="font-16"> ... Pop</label></div>
|
||||
<div class="col-lg-5"><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-5 justify-content-center"><img src="<?= self::getResourcePath() ?>img/markers/marker-dispatcher.png "> <label class="font-16"> ... Schacht/Verteiler</label></div>
|
||||
<div class="col-lg-5"><img src="<?= self::getResourcePath() ?>img/markers/marker-greenfield.png "> <label class="font-16"> ... Greenfield</label></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
@@ -250,7 +328,6 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -259,13 +336,26 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var marker = [];
|
||||
var polylinec;
|
||||
var polyline = [];
|
||||
var fitmap = 0;
|
||||
var map = L.map('map').setView([47.00525090986838, 15.761075762335581], 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?>';
|
||||
|
||||
|
||||
function checkendpoints() {
|
||||
let endpointcounter = $('.endpoint-label').length;
|
||||
let endpointtext;
|
||||
$('.endpoint-label').each(function (index) {
|
||||
|
||||
|
||||
$(this).find('.move-endpoint-up').remove();
|
||||
$(this).find('.move-endpoint-down').remove();
|
||||
if (index == 0) {
|
||||
endpointtext = "Startpunkt";
|
||||
$(this).find('.endpointsymbol').html('<i id="add-endpoint" class="fa-regular fa-circle-plus"></i>');
|
||||
@@ -273,9 +363,13 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
|
||||
endpointtext = 'Standort ' + index;
|
||||
$(this).closest('.endpoint-maindiv').find('.label-text').after('<i title="nach oben verschieben" class="fa-sharp fa-solid fa-up move-endpoint-up"></i>');
|
||||
$(this).find('.endpointsymbol').html('');
|
||||
} else if (endpointcounter - 1 == index) {
|
||||
endpointtext = 'Standort ' + index;
|
||||
$(this).closest('.endpoint-maindiv').find('.label-text').after('<i style="margin-right:22px;" title="nach oben verschieben" class="fa-sharp fa-solid fa-up move-endpoint-up"></i>');
|
||||
$(this).find('.endpointsymbol').html('<i class="fa-regular fa-circle-minus remove-endpoint"></i>');
|
||||
} else if (index > 0) {
|
||||
endpointtext = 'Standort ' + index;
|
||||
$(this).closest('.endpoint-maindiv').find('.label-text').after('<i title="nach oben verschieben" class="fa-sharp fa-solid fa-up move-endpoint-up"></i>');
|
||||
$(this).closest('.endpoint-maindiv').find('.label-text').after('<i title="nach unten verschieben" class="fa-sharp fa-solid fa-down move-endpoint-down"></i><i title="nach oben verschieben" class="fa-sharp fa-solid fa-up move-endpoint-up"></i>');
|
||||
$(this).find('.endpointsymbol').html('<i class="fa-regular fa-circle-minus remove-endpoint"></i>');
|
||||
}
|
||||
|
||||
@@ -288,33 +382,44 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
|
||||
|
||||
const splitid = $(this).attr('id').split('_');
|
||||
let thisid = splitid[0];
|
||||
var options;
|
||||
var options = "";
|
||||
if ($.trim($("#" + thisid + "_endpoint_network_id").val()) != "" && $.trim($("#" + thisid + "_endpoint_type").val())) {
|
||||
|
||||
|
||||
$.getJSON("<?= self::getUrl("FiberPlanPipe", "api", ['do' => 'getBuildingInfo']) ?>&network_id=" + $.trim($("#" + thisid + "_endpoint_network_id").val()) + "&bdtype=" + $.trim($("#" + thisid + "_endpoint_type").val()), {})
|
||||
.done(function (data) {
|
||||
$.each(data, function (k, val) {
|
||||
options = options + '<option value="' + val.id + '">' + val.name + '</option>';
|
||||
options = options + '<option data-gpslat="' + val.gps_lat + '" data-gpslong="' + val.gps_long + '" value="' + val.id + '">' + val.name + '</option>';
|
||||
});
|
||||
$("#" + thisid + "_mid-point-building").empty();
|
||||
$("#" + thisid + "_mid-point-building").append('<select id=' + thisid + '_endpoint" required="required" name="endpoint[]" class="select2 form-control">' + options + '</select>');
|
||||
$("#" + thisid + "_end-point-building").empty();
|
||||
$("#" + thisid + "_end-point-building").append('<select id="' + thisid + '_endpoint" required="required" name="endpoint[]" class="select2 form-control endpoint_endpoint">' + options + '</select>');
|
||||
$(".select2").select2({placeholder: ""});
|
||||
addMarkers();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("body").on("change", ".endpoint_endpoint", function () {
|
||||
addMarkers();
|
||||
});
|
||||
|
||||
$("body").on("click", ".move-endpoint-up", function () {
|
||||
$(this).closest('.endpoint-maindiv').insertBefore($(this).closest('.endpoint-maindiv').prev());
|
||||
checkendpoints();
|
||||
addMarkers();
|
||||
});
|
||||
|
||||
$("body").on("click", ".move-endpoint-down", function () {
|
||||
$(this).closest('.endpoint-maindiv').insertAfter($(this).closest('.endpoint-maindiv').next());
|
||||
checkendpoints();
|
||||
addMarkers();
|
||||
});
|
||||
|
||||
$("body").on("click", ".remove-endpoint", function () {
|
||||
let endpointcounter;
|
||||
$(this).closest('.endpoint-maindiv').remove();
|
||||
checkendpoints();
|
||||
addMarkers();
|
||||
});
|
||||
|
||||
|
||||
@@ -390,79 +495,119 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
|
||||
$(this).off('wheel.disableScroll')
|
||||
});
|
||||
|
||||
function addMarkers() {
|
||||
removeMarkers();
|
||||
removePolyline();
|
||||
var oldlat;
|
||||
var oldlong;
|
||||
var gpsconter=0;
|
||||
$.each($('.endpoint_endpoint'), function (index, value) {
|
||||
if ($(this).find('option:selected').data('gpslat')) {
|
||||
var lat = $(this).find('option:selected').data('gpslat');
|
||||
var lng = $(this).find('option:selected').data('gpslong');
|
||||
var name = $(this).find('option:selected').text();
|
||||
var color = "#acf0ab";
|
||||
var mapicon = "home";
|
||||
var endpointtype = $(this).closest('.endpoint-maindiv').find('.endpoint_type ').val();
|
||||
if (endpointtype == 1) {
|
||||
color = "#abbaf0";
|
||||
mapicon = "garden";
|
||||
} else if (endpointtype == 2) {
|
||||
color = "#acf0ab";
|
||||
mapicon = "village";
|
||||
} else if (endpointtype == 3) {
|
||||
color = "#f0abab";
|
||||
mapicon = "home";
|
||||
} else if (endpointtype == 4) {
|
||||
color = "#e9f0ab";
|
||||
mapicon = "home";
|
||||
}
|
||||
|
||||
var icon = L.MakiMarkers.icon({
|
||||
icon: mapicon,
|
||||
color: color,
|
||||
size: "l"
|
||||
});
|
||||
var markerid = marker.length;
|
||||
$(this).data('markerid', markerid);
|
||||
|
||||
marker.push(L.marker([lat, lng], {icon: icon}).addTo(map));
|
||||
if (index == 0 && fitmap == 0) {
|
||||
map.setView([lat, lng]);
|
||||
}
|
||||
fitmap = 1;
|
||||
if (oldlong) {
|
||||
polylinec = [
|
||||
[oldlat, oldlong],
|
||||
[$(this).find('option:selected').data('gpslat'), $(this).find('option:selected').data('gpslong')]
|
||||
];
|
||||
polyline.push(L.polyline(polylinec, {color: '#f00'}).addTo(map));
|
||||
// polyline.bindTooltip(locations[i][4], {permanent: true});
|
||||
}
|
||||
oldlat = $(this).find('option:selected').data('gpslat');
|
||||
oldlong = $(this).find('option:selected').data('gpslong');
|
||||
gpsconter++;
|
||||
} else {
|
||||
oldlat = "";
|
||||
oldlong = "";
|
||||
}
|
||||
});
|
||||
if (gpsconter > 1) {
|
||||
var group = new L.featureGroup(marker);
|
||||
map.fitBounds(group.getBounds());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function removeMarkers() {
|
||||
$.each(marker, function (index, value) {
|
||||
map.removeLayer(value);
|
||||
});
|
||||
marker.splice(0, marker.length);
|
||||
}
|
||||
|
||||
function removePolyline() {
|
||||
$.each(polyline, function (index, value) {
|
||||
map.removeLayer(value);
|
||||
|
||||
});
|
||||
polyline.splice(0, polyline.length);
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
// map.invalidateSize();
|
||||
addMarkers();
|
||||
$(".select2").select2({placeholder: ""});
|
||||
if ($.trim($("#network_id").val()) != "" && $.trim($("#startpoint_type").val())) {
|
||||
|
||||
$.getJSON("<?= self::getUrl("FiberPlanPipe", "api", ['do' => 'getBuildingInfo']) ?>&network_id=" + $.trim($("#network_id").val()) + "&bdtype=" + $.trim($("#startpoint_type").val()), {})
|
||||
.done(function (data) {
|
||||
var options;
|
||||
$.each(data, function (k, val) {
|
||||
if ($('#startpoint_type').data('startpoint') == val.id) {
|
||||
options = options + '<option selected="selected" value="' + val.id + '">' + val.name + '</option>';
|
||||
} else {
|
||||
options = options + '<option value="' + val.id + '">' + val.name + '</option>';
|
||||
}
|
||||
});
|
||||
$('#starting-point-building').empty();
|
||||
$('#starting-point-building').append('<select id="startpoint" name="startpoint" required="required" class="select2 form-control">' + options + '</select>');
|
||||
$(".select2").select2({placeholder: ""});
|
||||
});
|
||||
}
|
||||
if ($.trim($("#network_id2").val()) != "" && $.trim($("#entpoint_type").val())) {
|
||||
|
||||
|
||||
$.getJSON("<?= self::getUrl("FiberPlanPipe", "api", ['do' => 'getBuildingInfo']) ?>&network_id=" + $.trim($("#network_id2").val()) + "&bdtype=" + $.trim($("#entpoint_type").val()), {})
|
||||
.done(function (data) {
|
||||
var options;
|
||||
$.each(data, function (k, val) {
|
||||
if ($('#entpoint_type').data('endpoint') == val.id) {
|
||||
options = options + '<option selected="selected" value="' + val.id + '">' + val.name + '</option>';
|
||||
} else {
|
||||
options = options + '<option value="' + val.id + '">' + val.name + '</option>';
|
||||
}
|
||||
});
|
||||
$('#end-point-building').empty();
|
||||
$('#end-point-building').append('<select id="endpoint" name="endpoint" required="required" class="select2 form-control">' + options + '</select>');
|
||||
$(".select2").select2({placeholder: ""});
|
||||
});
|
||||
|
||||
}
|
||||
$("body").on("click", "#add-endpoint", function (event) {
|
||||
let randid = Math.floor(Math.random() * 10000);
|
||||
let endpointtype = $('#startpoint_type').html();
|
||||
let endpointcounter = $('.endpoint-maindiv').length + 1;
|
||||
let endpointuparrow = "";
|
||||
let standorttext = "";
|
||||
if (endpointcounter > 1) {
|
||||
endpointuparrow = '<i title="nach oben verschieben" class="fa-sharp fa-solid fa-up move-endpoint-up"></i>';
|
||||
}
|
||||
|
||||
if (endpointcounter <= 7) {
|
||||
$('#endpoints').append(`<div class="form-group row endpoint-maindiv">
|
||||
<label class="col-lg-2 col-form-label endpoint-label" for="` + randid + `_endpoint_network_id"><span class="label-text">Standort ` + $('.endpoint-maindiv').length + ` * </span>` + endpointuparrow + `<span class="endpointsymbol"><i class="fa-regular fa-circle-minus remove-endpoint"></i></span></label>
|
||||
<div class="col-lg-2"><select id="` + randid + `_endpoint_network_id" required="required" name="endpoint_network_id[]"
|
||||
class="select2 form-control endpoint_network_id">` + $('#network_id').html() + `</select></div>
|
||||
<div class="col-lg-3"><select id="` + randid + `_endpoint_network_id" required="required" name="endpoint_network_id[]"
|
||||
class="select2 form-control endpoint_network_id">` + $('#endpoints').find('.endpoint_network_id').eq(endpointcounter - 2).html() + `</select></div>
|
||||
<div class="col-lg-2 ">
|
||||
<select id="` + randid + `_endpoint_type" name="endpoint_type[]" required="required"
|
||||
class="select2 form-control endpoint_type" data-startpoint="" : "" >
|
||||
<option value=""></option>
|
||||
<option value="4">
|
||||
Schacht-Verteiler
|
||||
</option>
|
||||
` + $('#endpoints').find('.endpoint_type').html() + `
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2" id="` + randid + `_mid-point-building">
|
||||
<div class="col-lg-3" id="` + randid + `_end-point-building">
|
||||
|
||||
</div>
|
||||
</div>`);
|
||||
$('#' + randid + '_endpoint_network_id').val($('#network_id').val());
|
||||
$('#' + randid + '_endpoint_network_id').val($('#endpoints').find('.endpoint_network_id').eq(endpointcounter - 2).val());
|
||||
$('#' + randid + '_endpoint_type').val('');
|
||||
checkendpoints();
|
||||
$(".select2").select2({placeholder: ""});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user