TAG 0 finetuning

This commit is contained in:
/jedi/ 2018-12-27 08:52:14 +01:00
parent 0fbd3f2279
commit be8b5f50f2
6 changed files with 116 additions and 7 deletions

View file

@ -42,7 +42,6 @@ switch($_GET["action"]) {
} }
} }
break; break;
} }
header('Location: '.$_SERVER['HTTP_REFERER']); header('Location: '.$_SERVER['HTTP_REFERER']);

View file

@ -20,7 +20,7 @@ function auth(){
return true; return true;
} }
function get_items(){ function get_founditems(){
global $mysqli; global $mysqli;
$res = $mysqli->query("SELECT * FROM items ORDER BY id ASC"); $res = $mysqli->query("SELECT * FROM items ORDER BY id ASC");
$ret = array(); $ret = array();
@ -30,6 +30,16 @@ function get_items(){
return $ret; return $ret;
} }
function get_lostitems(){
global $mysqli;
$res = $mysqli->query("SELECT * FROM lost ORDER BY id ASC");
$ret = array();
while ($row = $res->fetch_assoc()) {
$ret[] = $row;
}
return $ret;
}
$page = isset($_GET["page"])?$_GET["page"]:"dashboard"; $page = isset($_GET["page"])?$_GET["page"]:"dashboard";
if (!auth()) { if (!auth()) {

94
templates/losttable.php Normal file
View file

@ -0,0 +1,94 @@
<?php
/**
* Created by PhpStorm.
* User: jedi
* Date: 12/27/18
* Time: 4:48 AM
*/
?>
<div id="content-wrapper">
<div class="container-fluid">
<!-- Breadcrumbs-->
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="#">Dashboard</a>
</li>
<li class="breadcrumb-item active">Tables</li>
</ol>
<!-- DataTables Example -->
<div class="card mb-3">
<div class="card-header">
<i class="fas fa-table"></i>
Data Table Example</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>ID</th>
<th>was</th>
<th>wann</th>
<th>wo</th>
<th>kontakt</th>
</tr>
</thead>
<tfoot>
<tr>
<th>ID</th>
<th>was</th>
<th>wann</th>
<th>wo</th>
<th>kontakt</th>
</tr>
</tfoot>
<tbody>
<?php
foreach( get_lostitems() as $item){
?>
<tr>
<td><?php echo $item["id"]; ?></td>
<td><?php echo $item["was"]; ?></td>
<td><?php echo $item["wann"]; ?></td>
<td><?php echo $item["wo"]; ?></td>
<td><?php echo $item["contact"]; ?></td>
<!--td>
<?php
foreach(explode(",",$item["tags"]) as $tag){
?>
<span class="label label-default"><?php echo $tag; ?></span>
<?php
}
?>
</td>
<td><?php echo $item["id"]; ?></td-->
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
</div>
<p class="small text-center text-muted my-5">
<em>More table examples coming soon...</em>
</p>
</div>
<!-- /.container-fluid -->
<!-- Sticky Footer -->
<footer class="sticky-footer">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span>Copyright © j3d1 2018</span>
</div>
</div>
</footer>
</div>

View file

@ -44,7 +44,7 @@
</button> </button>
<!-- Navbar Search --> <!-- Navbar Search -->
<form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0"> <!--form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0">
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2"> <input type="text" class="form-control" placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2">
<div class="input-group-append"> <div class="input-group-append">
@ -53,7 +53,7 @@
</button> </button>
</div> </div>
</div> </div>
</form> </form-->
<!-- Navbar --> <!-- Navbar -->
<ul class="navbar-nav ml-auto ml-md-0"> <ul class="navbar-nav ml-auto ml-md-0">

View file

@ -17,7 +17,7 @@
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/?page=table"> <a class="nav-link" href="/?page=table">
<i class="fas fa-fw fa-archive"></i> <i class="fas fa-fw fa-archive"></i>
<span>Items</span> <span>Found Items</span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
@ -27,8 +27,14 @@
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/?page=lost"> <a class="nav-link" href="/?page=losttable">
<i class="fas fa-fw fa-archive"></i> <i class="fas fa-fw fa-archive"></i>
<span>Lost Items</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/?page=lost">
<i class="fas fa-fw fa-plus"></i>
<span>Lost</span> <span>Lost</span>
</a> </a>
</li> </li>

View file

@ -44,7 +44,7 @@
</tfoot> </tfoot>
<tbody> <tbody>
<?php <?php
foreach( get_items() as $item){ foreach( get_founditems() as $item){
?> ?>
<tr> <tr>
<td><?php echo $item["id"]; ?></td> <td><?php echo $item["id"]; ?></td>