* Device Backups können nun automatisch übers Tool getriggert werden Zeiterfassung Update * Vorbereitung für ZA Buchungen
167 lines
7.6 KiB
PHP
167 lines
7.6 KiB
PHP
<?php
|
|
$pagination_baseurl = $this->getUrl($Mod, "Index");
|
|
$pagination_baseurl_params = ["filter" => $filter];
|
|
$pagination_entity_name = "Device";
|
|
?>
|
|
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
|
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
|
|
type="text/css"/>
|
|
<style>
|
|
|
|
|
|
</style>
|
|
<!-- 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">Devices</li>
|
|
</ol>
|
|
</div>
|
|
<h4 class="page-title">Devices</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 Devices</h4>
|
|
</div>
|
|
<div class="float-right ">
|
|
<a class="btn btn-primary mb-2" href="<?= self::getUrl("Device", "add") ?>"><i
|
|
class="fas fa-plus"></i><span
|
|
class="d-none d-lg-inline"> Neues Device anlegen</span></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<table id="datatable" class="table table-striped table-hover table-sm font-13">
|
|
<thead>
|
|
<tr>
|
|
<th class="all">Device Name</th>
|
|
<th class="text-center ">Geräte Typ</th>
|
|
<th class="text-center ">Hersteller</th>
|
|
<th class="text-center ">Pop/Adresse</th>
|
|
<th class="text-center all">IP-Adresse</th>
|
|
<th class="text-center">Mac-Adresse</th>
|
|
<th class="text-center">Seriennummer</th>
|
|
<th class="text-center">Preis</th>
|
|
<th class="text-center text-nowrap ml-2 mr-2">max. Leistung</th>
|
|
<th class="text-center">Backup</th>
|
|
<th class="edit-width"></th>
|
|
</tr>
|
|
<tr id="filterrow">
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
<th class="pr-1"></th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
|
|
foreach ($devices as $device):
|
|
if ($device->price != "0.00") {
|
|
$price = $device->price;
|
|
} else {
|
|
$price = $device->devicetype->price;
|
|
}
|
|
if ($device->power != "0.0") {
|
|
$power = $device->power;
|
|
} else {
|
|
$power = $device->devicetype->power;
|
|
}
|
|
|
|
if ($device->last_config_backup) {
|
|
if (time() - $device->last_config_backup <= 172800) {
|
|
$backup = '<i class="fa-regular fa-circle-check"><span style="display: none">OK</span></i>';
|
|
} else {
|
|
$backup = '<i class="fa-regular fa-circle-xmark" title="Letztes Configbackup älter als 48 Stunden"><span style="display: none">AGED</span></i>';
|
|
}
|
|
|
|
|
|
} else {
|
|
$backup = '<i class="fa-regular fa-ban" title="Kein Configbackup"><span style="display: none">N/A</span></i>';
|
|
}
|
|
if ($device->autobackup==1) {
|
|
$backup = '<i class="fa-regular fa-circle-a mr-1"><span style="display: none">Auto</span></i>'.$backup;
|
|
}
|
|
if ($device->pop->id) {
|
|
$destination = '<a href="' . self::getUrl("Pop", "Detail", ["id" => $device->pop->id]) . '">' . $device->pop->name . '</a>';
|
|
} else if ($device->addr_street) {
|
|
$address = $device->addr_street . " " . $device->addr_number . ", " . $device->addr_zip . " " . $device->addr_city;
|
|
$destination = '<a title="Google-Maps: ' . $address . '" class="mapsLink" href="http://maps.google.com/?q=' . $address . '" target="_blank">' . $address . '</a>';
|
|
} else if ($device->gps_lat) {
|
|
$address = $device->gps_lat . " , " . $device->gps_long;
|
|
$destination = '<a title="Google-Maps: ' . $address . '" class="mapsLink" href="http://maps.google.com/?q=' . $address . '" target="_blank">' . $address . '</a>';
|
|
} else {
|
|
$destination = '';
|
|
}
|
|
?>
|
|
|
|
<tr>
|
|
<td class="text-nowrap">
|
|
<a class=" text-nowrap"
|
|
href="<?= self::getUrl("Device", "Detail", ["id" => $device->id]) ?>"><?= $device->name ?></a>
|
|
</td>
|
|
<td class="text-center"><?= $device->devicetype->name ?></td>
|
|
<td class="text-center"><?= $device->devicetype->devicemanufactor->name ?></td>
|
|
<td class="text-center text-nowrap"><?= $destination ?></td>
|
|
|
|
|
|
<td class="text-center"><?= $device->ip ?></td>
|
|
<td class="text-center"><?= $device->mac ?></td>
|
|
<td class="text-center"><?= $device->serial ?></td>
|
|
<td class="text-right text-nowrap"><?= $price ?> €</td>
|
|
<td class="text-right text-nowrap"><?= $power ?> Watt</td>
|
|
<td class="text-center"><?= $backup ?></td>
|
|
|
|
|
|
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em; width: 80px">
|
|
<a href="<?= self::getUrl("Device", "edit", ["id" => $device->id]) ?>"><i
|
|
class="far fa-edit" title="Bearbeiten"></i></a>
|
|
<a href="<?= self::getUrl("Device", "delete", ["id" => $device->id]) ?>"
|
|
onclick="if(!confirm('Device 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 = [7, 8, 10];
|
|
var columndefs = {type: 'ip-address', targets: 4};
|
|
|
|
var columnfilter = [9];
|
|
var columnoptions = '<option value=""></option><option value="OK">OK</option><option value="AGED">AGED</option><option value="N/A">N/A</option><option value="Auto">AUTO</option>';
|
|
$(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"); ?>
|