Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
js ID aus Tabelle ermitteln
#20
Hallo ich noch mal :-), musste erstmal was am Layout der Tabelle ändern.

Jetzt würde ich das ganze nochmals versuchen mit JavaScript zu erstellen!
Aber wie mache ich das mit der Navigation (pagination)?

Also Tabelle und Navigation mit JavaScript.
(pagination aktive) bekomme ich auch nicht hin.

https://oesoft.de

hier der Code:

Code:
<?php
include_once 'dbconnect.php';
header('Content-Type: text/html; charset=utf-8');

$limit = 20;

$page = isset($_GET['page']) ? $_GET['page'] : 1;
$start = ($page - 1) * $limit;
$result = $link->query("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 = 537919488 OR TelegramStorage.Flags = 536870912) ORDER BY ID DESC LIMIT $start, $limit");
$TelegramStorage = $result->fetch_all(MYSQLI_ASSOC);

$result1 = $link->query("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 = 537919488
                          OR TelegramStorage.Flags = 536870912) ORDER BY ID DESC");
                         
$TelegramStorage_Count = $result1->fetch_all(MYSQLI_ASSOC);
$total = $TelegramStorage_Count[0]['id'];
$pages = ceil( $total / $limit );
$next = (int)$page + 1;
if ($next > $pages) { $next = 1; }

?>

<!DOCTYPE html>

  <html lang="de">
   <head>
    <title>monitorOESoft | Entwicklung</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link href="bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" media="screen">
    <link rel="stylesheet" href="style.css" type="text/css" />
    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link href="design.css" rel="stylesheet">

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
    <script src="oesoft.js"></script>
    
   </head>
    <body>
     <div class="topnav">
      <ul class="topnav">
       <li><a class="active" onclick="unerledigt()">Unerledigte Einsätze</a></li>
       <li><a href="https://oesoft.de/oesoft/monitorOESoft.php">Laufende Einsätze</a></li>
       <li><a href="#news">Beendete Einsätze</a></li>
       <li><a data-toggle="modal" data-target="#myModal4">Pager</a></li>
       <li><a onclick="hilfe()">Hilfe</a></li>
      </ul>
     </div>
    
     <div class="table">
      <table class="table_unerledigt" id="table_unerledigt">
       <tbody id="table_unerledigt">
            <tr>
              <?php foreach ($TelegramStorage AS $ausgabe) :?>
               <td class="${col}" style="width: 90px"><?php echo $ausgabe['id']; ?></td>
               <td class="${col}" style="width: 35px">
                <?php if ($ausgabe['Flags'] == "1048576") { echo "<img src='image/air_interface.png'>" ; }
                      if ($ausgabe['Flags'] == "537919488") { echo "<img src='image/air_interface.png'>" ; }
                      if ($ausgabe['Flags'] == "0") { echo "<img src='image/network_interface.png'>" ; }
                      if ($ausgabe['Flags'] == "536870912") { echo "<img src='image/network_interface.png'>" ; }
                ?>
               </td>
               <td class="${col}" style="width: 160px"><?php echo $ausgabe['datum']; ?></td>    
               <td class="${col}" style="width: 90px"><?php echo $ausgabe['Address']; ?></td>    
               <td class="${col}" style="width: 35px">
                <?php if (substr($ausgabe['Address'],7) == "a") { echo "<img src='image/blaulicht.png'>" ; }
                      if (substr($ausgabe['Address'],7) == "b") { echo "<img src='image/limit.png'>" ; }
                      if (substr($ausgabe['Address'],7) == "c") { echo "<img src='image/info.png'>" ; }
                      if (substr($ausgabe['Address'],7) == "d") { echo "<img src='image/stop.png'>" ; }
                ?>
               </td>
               <td class="${col}"><?php echo $ausgabe['bezeichnung']; ?></td>
               <td class="${col}" style="width: 35px">
                   <?php if ($ausgabe['gruppe'] == "FEUERWEHR") { echo "<img src='image/feuerwehr.png'>" ; }
                      if ($ausgabe['gruppe'] == "RETTUNG") { echo "<img src='image/rettung.png'>" ; }
                      if ($ausgabe['gruppe'] == "NAVI") { echo "<img src='image/navi.png'>" ; }
                    
                ?>
               </td>
               <td class="${col}"><?php echo $ausgabe['kommune']; ?></td>
               <td class="${col}"><?php echo $ausgabe['hinweis']; ?></td>
               <td class="${col}"><?php echo $ausgabe['wache']; ?></td>
               <td class="${col}" style="width: 35px"> <button onclick="loeschen()" >Telegram</button></td>
               <td class="${col}" style="width: 35px"> <button onclick="loeschen()" >Löschen</button></td>
            </tr>
          <?php endforeach; ?>
       </tbody>
      </table>
     </div>
    
     <div class="table">
       <?php for ($i = 1; $i<= $pages; $i++) : ?>
        <li class="pagination"><a class="pagination" href="monitorOESoft.php?page=<?= $i; ?>"><?= $i; ?><a/></li>
       <?php endfor; ?>
     </div>
    </body>
  </html>


Angehängte Dateien
.php   monitorOESoft.php (Größe: 7,34 KB / Downloads: 0)
.js   oesoft.js (Größe: 626 Bytes / Downloads: 0)
.css   design.css (Größe: 21,46 KB / Downloads: 0)
Zitieren


Nachrichten in diesem Thema
js ID aus Tabelle ermitteln - von black79 - 18.05.2022, 08:26
RE: js ID aus Tabelle ermitteln - von admin - 18.05.2022, 12:38
RE: js ID aus Tabelle ermitteln - von black79 - 18.05.2022, 14:03
RE: js ID aus Tabelle ermitteln - von admin - 20.05.2022, 17:43
RE: js ID aus Tabelle ermitteln - von black79 - 21.05.2022, 09:39
RE: js ID aus Tabelle ermitteln - von admin - 21.05.2022, 18:45
RE: js ID aus Tabelle ermitteln - von admin - 21.05.2022, 19:15
RE: js ID aus Tabelle ermitteln - von black79 - 21.05.2022, 20:14
RE: js ID aus Tabelle ermitteln - von black79 - 22.05.2022, 14:28
RE: js ID aus Tabelle ermitteln - von admin - 23.05.2022, 23:01
RE: js ID aus Tabelle ermitteln - von black79 - 25.05.2022, 07:52
RE: js ID aus Tabelle ermitteln - von admin - 26.05.2022, 00:20
RE: js ID aus Tabelle ermitteln - von black79 - 26.05.2022, 07:00
RE: js ID aus Tabelle ermitteln - von admin - 23.05.2022, 23:47
RE: js ID aus Tabelle ermitteln - von admin - 24.05.2022, 01:45
RE: js ID aus Tabelle ermitteln - von black79 - 04.06.2022, 13:01
RE: js ID aus Tabelle ermitteln - von black79 - 29.05.2022, 16:25
RE: js ID aus Tabelle ermitteln - von admin - 29.05.2022, 19:53
RE: js ID aus Tabelle ermitteln - von black79 - 31.05.2022, 07:37
RE: js ID aus Tabelle ermitteln - von admin - 31.05.2022, 17:53
RE: js ID aus Tabelle ermitteln - von black79 - 01.06.2022, 07:12
RE: js ID aus Tabelle ermitteln - von admin - 04.06.2022, 13:12
RE: js ID aus Tabelle ermitteln - von admin - 04.06.2022, 19:36
RE: js ID aus Tabelle ermitteln - von black79 - 05.06.2022, 08:08

Gehe zu:


Benutzer, die gerade dieses Thema anschauen:
12 Gast/Gäste