TAG 0 finetuning
This commit is contained in:
parent
0fbd3f2279
commit
be8b5f50f2
6 changed files with 116 additions and 7 deletions
|
@ -42,7 +42,6 @@ switch($_GET["action"]) {
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
header('Location: '.$_SERVER['HTTP_REFERER']);
|
||||
|
||||
|
|
12
index.php
12
index.php
|
@ -20,7 +20,7 @@ function auth(){
|
|||
return true;
|
||||
}
|
||||
|
||||
function get_items(){
|
||||
function get_founditems(){
|
||||
global $mysqli;
|
||||
$res = $mysqli->query("SELECT * FROM items ORDER BY id ASC");
|
||||
$ret = array();
|
||||
|
@ -30,6 +30,16 @@ function get_items(){
|
|||
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";
|
||||
|
||||
if (!auth()) {
|
||||
|
|
94
templates/losttable.php
Normal file
94
templates/losttable.php
Normal 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>
|
|
@ -44,7 +44,7 @@
|
|||
</button>
|
||||
|
||||
<!-- 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">
|
||||
<input type="text" class="form-control" placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2">
|
||||
<div class="input-group-append">
|
||||
|
@ -53,7 +53,7 @@
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form-->
|
||||
|
||||
<!-- Navbar -->
|
||||
<ul class="navbar-nav ml-auto ml-md-0">
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link" href="/?page=table">
|
||||
<i class="fas fa-fw fa-archive"></i>
|
||||
<span>Items</span>
|
||||
<span>Found Items</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
|
@ -27,8 +27,14 @@
|
|||
</a>
|
||||
</li>
|
||||
<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>
|
||||
<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>
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
</tfoot>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach( get_items() as $item){
|
||||
foreach( get_founditems() as $item){
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $item["id"]; ?></td>
|
||||
|
|
Loading…
Reference in a new issue