suche erstellt und verschiedene kleine anpassungen an der darstellung

This commit is contained in:
Ivan Hörler 2017-03-02 13:59:32 +01:00
parent d8239f4122
commit d9e8bc3347
3 changed files with 37 additions and 9 deletions

View File

@ -30,8 +30,9 @@
<th>Typ</th>
<th>Menge</th>
<th>Qualität</th>
<th>Lieferdatum</th>
<th>Günstigstes Angebot</th>
<th>Lieferung</th>
<th>Angebot</th>
<th colspan="2">Günstigstes Angebot</th>
<?php
foreach ($db->query("SELECT * FROM nachfrager
LEFT JOIN anbieter
@ -44,6 +45,7 @@
"<td>" . htmlentities($row['nachfr_menge']) . "&nbsp;" . "</td>" .
"<td>" . htmlentities($row['nachfr_quali']) . "&nbsp;" . "</td>" .
"<td>" . htmlentities($row['nachfr_lieferdatum']) . "&nbsp;" . "</td>" .
"<td>" . substr(htmlentities($row['angebot_datum']),0,10) . "&nbsp;" . "</td>" .
"<td>"; if (!empty(htmlentities($row['angebot_preis'])))
{echo
"Fr. " . htmlentities($row['angebot_preis']) . "&nbsp;" . "</td>";
@ -62,7 +64,7 @@
"</td>" .
"</tr>";
}
}
}
?>
</table>
</div>

View File

@ -51,7 +51,11 @@ nav{
.btn{
font-size: 14px;
height:45px;
}
.sbtn{
font-size: 12px;
height:30px;
padding: 0px 0px 0px 0px;
}
.signin-form, .body-container
{
@ -112,6 +116,7 @@ th{
}
td{
font-size: 14px;
word-wrap:break-word;
}
th, td {
border-bottom: 1px solid #ddd;
@ -131,7 +136,6 @@ div > .eingabe{
.table{
width:730px;
table-layout:fixed;
word-wrap:break-word;
}
.table-unvsible{
@ -140,6 +144,6 @@ div > .eingabe{
width:730px;
}
caption{
padding: 15px 0px 15px 0px;
padding: 15px 0px 15px 0px;
font-size: 24px;
}

View File

@ -11,6 +11,22 @@
$stmt->execute(array(":user_id"=>$user_id));
$userRow=$stmt->fetch(PDO::FETCH_ASSOC);
//collect Search
if (isset($_GET['keywords'])) {
$keywords = $_GET['keywords'];
$query = $db->query("
SELECT *
FROM nachfrager
WHERE nachfr_typ LIKE '%{$keywords}%'
OR nachfr_beschr LIKE '%{$keywords}%'
");
} else {
$query = $db->query("
SELECT *
FROM nachfrager
");
}
?>
<!DOCTYPE html>
@ -26,7 +42,11 @@
<h1>Suchen</h1>
<p>Suchen Sie ein Teil?
</p>
<p>grenzen Sie die Liste ein: < - suche - > </p>
<p>grenzen Sie die Liste ein:</p>
<form method="GET" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" >
<input type="search" name="keywords" autocomplete="off" placeholder="suche" onkeydown="searchq();"/>
<input type="submit" value=">>"/>
</form>
</div>
<div class="inhalt">
<table class="table">
@ -37,7 +57,8 @@
<th>Qualität</th>
<th>Lieferdatum</th>
<?php
foreach ($db->query("SELECT * FROM nachfrager") as $row) {
if ($query->rowCount()) {
while ($row = $query->fetch()) {
echo
"<tr>" .
"<td>" . substr(htmlentities($row['nachfr_datum']),0,10) . "&nbsp;" . "</td>" .
@ -48,7 +69,8 @@
"<td>" . "<a href='angebot.php?id=" . $row['erfassungs_id'] . "'> Details --> </a>" . "</td>" .
"</tr>";
}
?>
}
?>
</table>
</div>
</body>