62 lines
1.9 KiB
PHP
62 lines
1.9 KiB
PHP
<?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);
|
|
|
|
?>
|
|
<!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';?>
|
|
<h1>Benutzerprofil</h1>
|
|
<div class="inhalt">
|
|
<table class="table">
|
|
<caption>Deine Nachfragen:</caption>
|
|
<th>Eintrag</th>
|
|
<th>Typ</th>
|
|
<th>Menge</th>
|
|
<th>Qualität</th>
|
|
<th>Lieferdatum</th>
|
|
<th>Günstigstes Angebot</th>
|
|
<?php
|
|
foreach ($db->query("SELECT * FROM nachfrager
|
|
LEFT JOIN anbieter
|
|
ON nachfrager.erfassungs_id = anbieter.erfassungs_id
|
|
WHERE nachfrager.benutzer_id = $user_id") as $row) {
|
|
echo
|
|
"<tr>" .
|
|
"<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>" .
|
|
"<td>" . htmlentities($row['nachfr_lieferdatum']) . " " . "</td>" .
|
|
"<td>"; if (!empty(htmlentities($row['angebot_preis'])))
|
|
{echo
|
|
"Fr. " . htmlentities($row['angebot_preis']) . " " . "</td>";
|
|
}else{echo
|
|
"k. Angeb. bisher" . " " . "</td>";
|
|
}
|
|
echo
|
|
"</tr>";
|
|
}
|
|
?>
|
|
</table>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|