2017-02-16 18:39:11 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("session.php");
|
|
|
|
include 'config.php';
|
|
|
|
require_once("class.user.php");
|
|
|
|
$auth_user = new USER();
|
|
|
|
|
|
|
|
$user_id = $_SESSION['user_session'];
|
|
|
|
|
|
|
|
$stmt = $auth_user->runQuery("SELECT * FROM benutzer WHERE benutzer_id=:user_id");
|
|
|
|
$stmt->execute(array(":user_id"=>$user_id));
|
|
|
|
|
|
|
|
$userRow=$stmt->fetch(PDO::FETCH_ASSOC);
|
2017-03-02 13:59:32 +01:00
|
|
|
|
|
|
|
//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}%'
|
|
|
|
");
|
2017-03-03 12:43:19 +01:00
|
|
|
} else {
|
2017-03-02 13:59:32 +01:00
|
|
|
$query = $db->query("
|
|
|
|
SELECT *
|
|
|
|
FROM nachfrager
|
2017-03-03 12:43:19 +01:00
|
|
|
");
|
2017-03-02 13:59:32 +01:00
|
|
|
}
|
2017-02-16 18:39:11 +01:00
|
|
|
?>
|
2017-02-17 16:14:13 +01:00
|
|
|
|
2017-02-16 18:39:11 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
|
|
<title>Hallo <?php print($userRow['benutzer_name']); ?></title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<?php include 'nav.php';?>
|
2017-02-17 16:14:13 +01:00
|
|
|
<div class="titel">
|
|
|
|
<h1>Suchen</h1>
|
|
|
|
<p>Suchen Sie ein Teil?
|
|
|
|
</p>
|
2017-03-02 13:59:32 +01:00
|
|
|
<p>grenzen Sie die Liste ein:</p>
|
2017-03-03 12:43:19 +01:00
|
|
|
<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=">>"/>
|
2017-03-02 13:59:32 +01:00
|
|
|
</form>
|
2017-02-17 16:14:13 +01:00
|
|
|
</div>
|
|
|
|
<div class="inhalt">
|
2017-02-25 18:26:32 +01:00
|
|
|
<table class="table">
|
2017-02-17 16:14:13 +01:00
|
|
|
<caption>Nachgefragte Teile:</caption>
|
|
|
|
<th>Eintrag</th>
|
|
|
|
<th>Typ</th>
|
|
|
|
<th>Menge</th>
|
|
|
|
<th>Qualität</th>
|
|
|
|
<th>Lieferdatum</th>
|
|
|
|
<?php
|
2017-03-02 13:59:32 +01:00
|
|
|
if ($query->rowCount()) {
|
2017-03-02 20:37:10 +01:00
|
|
|
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
|
2017-02-17 16:14:13 +01:00
|
|
|
echo
|
|
|
|
"<tr>" .
|
2017-02-25 18:26:32 +01:00
|
|
|
"<td>" . substr(htmlentities($row['nachfr_datum']),0,10) . " " . "</td>" .
|
|
|
|
"<td>" . htmlentities($row['nachfr_typ']) . " " . "</td>" .
|
|
|
|
"<td>" . htmlentities($row['nachfr_menge']) . " " . "</td>" .
|
|
|
|
"<td>" . htmlentities($row['nachfr_quali']) . " " . "</td>" .
|
2017-03-02 08:07:31 +01:00
|
|
|
"<td>" . htmlentities($row['nachfr_lieferdatum']) . " " . "</td>" .
|
2017-03-03 12:43:19 +01:00
|
|
|
"<td>" .
|
|
|
|
"<form method='GET' action='angebot.php'>" .
|
|
|
|
"<input class='sbtn' type='submit' value='Details' />" .
|
|
|
|
"<input class='sbtn' type='hidden' name='id' value='".htmlentities($row['erfassungs_id'])."' />" .
|
|
|
|
"</form>" .
|
|
|
|
"</td>" .
|
2017-02-17 16:14:13 +01:00
|
|
|
"</tr>";
|
|
|
|
}
|
2017-03-02 13:59:32 +01:00
|
|
|
}
|
|
|
|
?>
|
2017-02-17 16:14:13 +01:00
|
|
|
</table>
|
|
|
|
</div>
|
2017-02-16 18:39:11 +01:00
|
|
|
</body>
|
|
|
|
</html>
|