index rüber
This commit is contained in:
1 parent
b0d62dd23f
commit
3d75806375
2 files changed
+95
-54
No files matched your search
@@ -29,62 +29,10 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mt-5 mb-3 clearfix">
|
||||
<h2 class="pull-left">Vokabel Übersicht</h2>
|
||||
<a href="create.php" class="btn btn-success pull-right"><i class="fa fa-plus"></i> Neue Vokabel</a>
|
||||
<h2 class="pull-left">Vokabel Trainer</h2>
|
||||
<a href="overview.php" class="btn btn-success"><i class="fa fa-plus"></i> Übersicht </a>
|
||||
</div>
|
||||
<?php
|
||||
// Include config file
|
||||
require_once "config.php";
|
||||
|
||||
// Attempt select query execution
|
||||
$sql = "SELECT * FROM vokabeln LIMIT 30";
|
||||
if($result = mysqli_query($link, $sql)){
|
||||
if(mysqli_num_rows($result) > 0){
|
||||
echo '<table class="table table-bordered table-striped">';
|
||||
echo "<thead>";
|
||||
echo "<tr>";
|
||||
echo "<th>#</th>";
|
||||
echo "<th>Vokabel</th>";
|
||||
echo "<th>Stammform</th>";
|
||||
echo "<th>Art (Wortart)</th>";
|
||||
echo "<th>Flexion (Konj./Delk.)</th>";
|
||||
echo "<th>Übersetzung</th>";
|
||||
echo "<th>Lektion</th>";
|
||||
echo "<th>Kommentar / nützl. Hinweis</th>";
|
||||
echo "</tr>";
|
||||
echo "</thead>";
|
||||
echo "<tbody>";
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
echo "<tr>";
|
||||
echo "<td>" . $row['id'] . "</td>";
|
||||
echo "<td>" . $row['vokabel'] . "</td>";
|
||||
echo "<td>" . $row['stammform'] . "</td>";
|
||||
echo "<td>" . $row['art'] . "</td>";
|
||||
echo "<td>" . $row['flexion'] . "</td>";
|
||||
echo "<td>" . $row['uebersetzung'] . "</td>";
|
||||
echo "<td>" . $row['lektion'] . "</td>";
|
||||
echo "<td>" . $row['kommentar'] . "</td>";
|
||||
echo "<td>";
|
||||
echo '<a href="read.php?id='. $row['id'] .'" class="mr-3" title="Ansehen" data-toggle="tooltip"><span class="fa fa-eye"></span></a>';
|
||||
echo '<a href="update.php?id='. $row['id'] .'" class="mr-3" title="Bearbeiten" data-toggle="tooltip"><span class="fa fa-pencil"></span></a>';
|
||||
echo '<a href="delete.php?id='. $row['id'] .'" title="Löschen" data-toggle="tooltip"><span class="fa fa-trash"></span></a>';
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</tbody>";
|
||||
echo "</table>";
|
||||
// Free result set
|
||||
mysqli_free_result($result);
|
||||
} else{
|
||||
echo '<div class="alert alert-danger"><em>Keine Einträge gefunden.</em></div>';
|
||||
}
|
||||
} else{
|
||||
echo "Oha! DB Verbindung klappt nicht. Bitte später versuchen.";
|
||||
}
|
||||
|
||||
// Close connection
|
||||
mysqli_close($link);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user