-
Notifications
You must be signed in to change notification settings - Fork 0
/
abfrage.php
88 lines (78 loc) · 3.66 KB
/
abfrage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<html>
<head>
<title>Willkommen auf EasyBay!</title>
<meta charset="utf-8">
<link rel="stylesheet" href="main.css" type="text/css">
<link href="lightbox.css" rel="stylesheet" />
<script src="jquery-2.1.4.min.js"></script>
<script src="lightbox.min.js"></script>
</head>
<body>
<div id="header">
<a href="http://localhost/index.html"><div id="logo"></div></a>
<a href="http://localhost/index.html"><div id="tit">EasyBay</div></a>
<a href="http://jugendhackt.de"><div id="fiech1"></div></a><a href="http://jugendhackt.de"><div id="brille"></div></a><a href="http://jugendhackt.de"><div id="fiech2"></div></a>
</div>
<div id="body">
<div id="mainframe">
<div id="content" class="clearfix">
<?php
mysql_connect("localhost", "root");
mysql_select_db("lager");
switch ($_GET["kategorie"]) {
case 1:
switch ($_GET["ort"]) {
case 1:
$x = mysql_query("SELECT * FROM `artikel` WHERE reserviert='0'");
break;
case 2:
$x = mysql_query("SELECT * FROM `artikel` WHERE OID='Dresden' AND reserviert='0'");
break;
case 3:
$x = mysql_query("SELECT * FROM `artikel` WHERE OID='Berlin' AND reserviert='0'");
break;
}
break;
case 2:
switch ($_GET["ort"]) {
case 1:
$x = mysql_query("SELECT * FROM `artikel` WHERE KID='baumaterial' AND reserviert='0'");
break;
case 2:
$x = mysql_query("SELECT * FROM `artikel` WHERE KID='baumaterial' AND OID='Dresden' AND reserviert='0'");
break;
case 3:
$x = mysql_query("SELECT * FROM `artikel` WHERE KID='baumaterial' AND OID='Berlin' AND reserviert='0'");
break;
}
break;
case 3:
switch ($_GET["ort"]) {
case 1:
$x = mysql_query("SELECT * FROM `artikel` WHERE KID='technik' AND reserviert='0'");
break;
case 2:
$x = mysql_query("SELECT * FROM `artikel` WHERE KID='technik' AND OID='Dresden' AND reserviert='0'");
break;
case 3:
$x = mysql_query("SELECT * FROM `artikel` WHERE KID='technik' AND OID='Berlin' AND reserviert='0'");
break;
}
break;
default:
echo "ERROR";
}
echo "<table border=1><tr><td>Artikel</td><td>Kategorie</td><td>Lagerort</td><td>Reservieren</td></tr>";
while ($dx = mysql_fetch_assoc($x)){
echo "<tr><td>" . $dx["name"] . "</td><td>" . $dx["KID"] . "</td><td>" . $dx["OID"] . "</td><td>" . "<a href='reservieren.php?AID=" . $dx["AID"] . "&BID=" . $_GET["nutzer"] . "'>Reservieren</a>";
}
echo "</table>";
mysql_close();
?>
<a href="javascript:history.back()">zurück</a>
</div>
</div>
</div>
<div id="footer"><div id="copy">© 2015</div></div>
</body>
</html>