Features Netzbau-> Dateiablage und Stammdaten->Pops hinzugefügt

This commit is contained in:
Spitzer_Daniel
2023-02-16 15:44:19 +01:00
parent c5d36132d2
commit cf92596ebf
24 changed files with 2371 additions and 23 deletions

View File

@@ -6,6 +6,37 @@ $pagination_entity_name = "Pops";
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<style>
#filterrow input {
width: 100%;
padding: 3px;
box-sizing: border-box;
display: table-header-group;
height: unset;
}
.dataTables_wrapper .dataTables_filter {
float: left;
text-align: left;
}
.dataTables_wrapper .dataTables_length {
float: right;
}
.clear-fa {
margin-left: 5px;
font-size: 23px;
vertical-align: middle;
color: #cb2929;
cursor: pointer;
}
.margina {
margin-left: 30px !important;
margin-top: -5px;
}
</style>
<!-- start page title -->
<div class="row">
<div class="col-12">
@@ -32,16 +63,17 @@ $pagination_entity_name = "Pops";
<h4 class="header-title">Liste aller Pops</h4>
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?= self::getUrl("Pop", "add",['returnto' => "pop"]) ?>"><i
class="fas fa-plus"></i> Neuen Pop anlegen</a>
<a class="btn btn-primary mb-2" href="<?= self::getUrl("Pop", "add", ['returnto' => "pop"]) ?>"><i
class="fas fa-plus"></i> Neuen Pop anlegen</a>
</div>
</div>
</div>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
<table class="table table-striped table-hover">
<table id="datatable" class="table table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th>Netgebiet</th>
@@ -49,8 +81,19 @@ $pagination_entity_name = "Pops";
<th>Vlan Public/Nat</th>
<th>Koordinaten</th>
<th></th>
<th></th>
</tr>
<tr id="filterrow">
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($pops as $pop): ?>
<tr>
@@ -58,20 +101,28 @@ $pagination_entity_name = "Pops";
<td><?= $pop->network->name ?></td>
<td><?= $pop->location ?></td>
<td class="text-center"><?= $pop->vlan_public ?> / <?= $pop->vlan_nat ?></td>
<td class="text-center"><a title="Google-Maps: <?= rtrim($pop->gps_lat,'0') ?> , <?= $pop->gps_long ?>" class="mapsLink" href="http://maps.google.com/?q=<?= $pop->gps_lat ?> , <?= $pop->gps_long ?>" target="_blank"><?= rtrim($pop->gps_lat,'0') ?> , <?= rtrim($pop->gps_long,0) ?></a></td>
<td class="text-center"><a
title="Google-Maps: <?= rtrim($pop->gps_lat, '0') ?> , <?= $pop->gps_long ?>"
class="mapsLink"
href="http://maps.google.com/?q=<?= $pop->gps_lat ?> , <?= $pop->gps_long ?>"
target="_blank"><?= rtrim($pop->gps_lat, '0') ?>
, <?= rtrim($pop->gps_long, 0) ?></a></td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?=self::getUrl("Pop", "edit", ["id" => $pop->id, 'returnto' => "pop"])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?=self::getUrl("Pop", "index")?>" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
<a href="<?= self::getUrl("Pop", "edit", ["id" => $pop->id, 'returnto' => "pop"]) ?>"><i
class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?= self::getUrl("Pop", "index") ?>" class="text-danger" title="Löschen"><i
class="fas fa-trash"></i></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
<!---->
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination-summary.php"); ?>
<!-- --><?php //include(realpath(dirname(__FILE__) . "/../") . "/tpl/pagination.php"); ?>
<!---->
</div>
</div>
@@ -243,6 +294,68 @@ $pagination_entity_name = "Pops";
<?php if(is_array($filter) && count($filter)): ?>
//refreshMap();
<?php endif; ?>
let table;
$('#filterrow th').each(function (i) {
let title = $('#datatable thead th').eq($(this).index()).text();
if ($(this).index() == "5") {
} else {
$(this).html('<input type="text" placeholder="' + title + '" class="form-control" data-index="' + i + '" value="" />');
}
});
table = $('#datatable').DataTable({
buttons: [
{
extend: 'excelHtml5',
text: 'XLSX Export',
className: 'btn-success margina'
}
],
orderCellsTop: true,
stateSave: true,
"initComplete": function () {
$('#datatable_filter').append('<i id="clear_cookie" class="fas fa-times clear-fa" title="Filter löschen" aria-hidden="true" ></i>');
$('#clear_cookie').click(function () {
$('input').val('');
table.search('').columns().search('').draw();
});
},
"dom": 'flBrtip'
});
$('#filterrow').on('keyup', 'input', function () {
table
.column($(this).data('index'))
.search(this.value)
.draw();
});
var state = table.state.loaded();
if (state) {
table.columns().eq(0).each(function (colIdx) {
var colSearch = state.columns[colIdx].search;
if (colSearch.search) {
$('#filterrow').find("[data-index='" + colIdx + "']").val(colSearch.search);
}
});
table.draw();
}
$(document).ready(function () {
});
</script>