30.06.2022, 13:28
Code:
$(document).ready(function(){
setInterval(function(){
$("#table").load(window.location.href + " #table" );
}, 3000);
});
PHP-Code:
<div class="table" id="table">
wieso verschiebt sich das div?
https://oesoft.de
$(document).ready(function(){
setInterval(function(){
$("#table").load(window.location.href + " #table" );
}, 3000);
});
<div class="table" id="table">
nav.pagination {
margin-left: 10px;
border: thin solid;
background-color: silver;
}
<?php
include_once 'dbconnect.php';
$limit = 15;
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$start = ($page - 1) * $limit;
$result = mysqli_query($link, "SELECT TelegramStorage.id, TelegramStorage.Address, TelegramStorage.Flags, TelegramStorage.Message, TelegramStorage.datum, TelegramStorage.unerledigt,
TelegramDescription.address, TelegramDescription.bezeichnung, TelegramDescription.wache, TelegramDescription.color_n, TelegramDescription.hinweis, TelegramDescription.background_n,
TelegramDescription.gruppe, TelegramDescription.kommune, TelegramDescription.kreis, TelegramDescription.bosmon FROM TelegramStorage
JOIN TelegramDescription WHERE LEFT (TelegramStorage.Address, 7) = LEFT(TelegramDescription.address, 7) AND (TelegramDescription.bosmon = 1) AND (TelegramStorage.Flags = 1048576 OR
TelegramStorage.Flags = 0 OR TelegramStorage.Flags = 1 OR TelegramStorage.Flags = 537919488 OR TelegramStorage.Flags = 536870912) ORDER BY ID DESC LIMIT $start, $limit");
$rows = mysqli_fetch_all($result, MYSQLI_ASSOC);
$count = mysqli_query($link, "SELECT count(id) AS id FROM TelegramStorage JOIN TelegramDescription WHERE LEFT (TelegramStorage.Address, 7) = LEFT(TelegramDescription.address, 7)
AND (TelegramDescription.bosmon = 1) AND (TelegramStorage.Flags = 1048576 OR TelegramStorage.Flags = 0 OR TelegramStorage.Flags = 1 OR TelegramStorage.Flags = 537919488
OR TelegramStorage.Flags = 536870912) ORDER BY ID DESC");
$daten = mysqli_fetch_all($count, MYSQLI_ASSOC);
$total = $daten[0]['id'];
$pages = ceil( $total / $limit );
$next = (int)$page + 1;
if ($next > $pages) { $next = 1; }
?>
<nav class="pagination" id="pagination">
<ul class="pagination">
<?php for ($i = 1; $i<= $pages; $i++) : ?>
<li class="pagination"><a href="monitorOESoft_unerledigte_einsaetze.php?page=<?= $i; ?>"> <?= $i; ?> </a></li>
<?php endfor; ?>
</ul>
</nav>
$(document).ready(function(){
setInterval(function(){
$("#table").load(window.location.href + " #table" );
}, 3000);
});
function loadlink() {
$('#table').load(' table', function () {
$(this).unwrap();
});
}
loadlink();
setInterval(function(){
loadlink()
}, 3000);
function refresh() {
$('#pagination').load(' pagination', function () {
$(this).unwrap();
});
}
refresh();
setInterval(function(){
refresh()
}, 2000);
function loadlink() {
$('#table').load(' table', function () {
$(this).unwrap();
});
}
loadlink();
setInterval(function(){
loadlink()
}, 3000);
<div class="table" id="table">
<div class="pagination" id="pagination">