25.04.2024, 12:05
Code:
<?php
$titel='Web-Portal | Webportal';
require("includes/reporting_error.php");
require("includes/config.php");
require("includes/header.php");
require("includes/menu.php");
require("includes/mysql.php");
$statement = $pdo->prepare("SELECT * FROM tbl_user WHERE tbl_user.online = '1'");
$statement -> execute();
?>
<div id="content" class="p-4 p-md-5 pt-5">
<br>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home"
aria-selected="true">Webportal Testseite Laptop</a>
</li>
</ul>
<br>
<div>
<button type="button" class="btn btn-outline-primary btn-test" value="button1" id="button1" ><i class="fa fa-refresh"></i></button>
<button type="button" class="btn btn-outline-primary btn-test" value="button2" id="button2" ><i class="fa fa-info"></i></button>
</div>
<p class="paragraph-index" style="margin: 10px">derzeit angemeldete Test-Benutzer :</p>
<div id="table_user"><!-- <div Anfang load> -->
<table class="table table-striped table-bordered table-sm">
<thead>
<tr>
<th scope="col">User-Id</th>
<th scope="col">E-Mail</th>
<th scope="col">Smartphone</th>
</tr>
</thead>
<tbody>
<?php while ($datensatz = $statement->fetch(PDO::FETCH_ASSOC)) : ?>
<tr>
<td scope="row"><?= htmlspecialchars ($datensatz['userid']); ?></td>
<td scope="row"><?= htmlspecialchars ($datensatz['email']); ?></td>
<td scope="row"><?= htmlspecialchars ($datensatz['mobilfunk']); ?></td>
<td scope="row" style="width:25px"><button class="btn-danger btn-btn3"
value="<?= htmlspecialchars ($datensatz['userid']); ?>">
<i class="fa fa-ban"></i></button></td>
</tr>
<?php endwhile ?>
</tbody>
</table>
</div> <!-- <div Ende load> -->
<?php
require("includes/footer.php");
?>
Code:
$("#button1").click(function(){
$("#table_user").load(window.location.href + " #table_user");
});
wurde das div id="table_user" neugeladen, hat der Button in der Tabelle keine Funktion mehr.