-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherfassung.php
More file actions
64 lines (54 loc) · 1.47 KB
/
Copy patherfassung.php
File metadata and controls
64 lines (54 loc) · 1.47 KB
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
<?php
include "component_search.php";
include "class.php";
if(isset($_POST["button"])) {
if(!isset($_POST["komponente"]) and !isset($_POST["name"]) and !isset($_POST["tel"]) and !isset($_POST["adresse"])) {
$error = "Bitte alles ausfüllen.";
} else {
$reklamation = new Reklamation();
$reklamation->produkt = $_POST["product"];
$reklamation->komponente = $_POST["komponente"];
$reklamation->reklamateur->name = $_POST["name"];
$reklamation->reklamateur->anschrift = $_POST["adresse"];
$reklamation->reklamateur->tel = $_POST["tel"];
$reklamation->save();
}
}
?>
<!doctype html>
<html>
<head>
<title>Reklamation erfassen</title>
</head>
<body>
<h1>Reklamation erfassen</h1>
<?php
if(!isset($_POST["button"])) :
?>
<form action="erfassung.php" method="post">
<select name="komponente">
<?php
foreach(get_components($_POST["product"]) as $komponente) {
echo "<option>".$komponente."</option>";
}
?>
</select><br>
Name: <input type="text" name="name" placeholder="Name eingeben" /><br>
Adresse: <input type="text" name="adresse" placeholder="Adresse eingeben" /><br>
Tel-Nr.: <input type="text" name="tel" placeholder="Tel-Nr. eingeben" /><br/>
<input type="hidden" name="product" value="<?php echo $_POST["product"]; ?>" />
<input type="submit" name="button" value="Senden" />
</form>
<?php
elseif (isset($error)) :
?>
<p><?php echo $error; ?></p>
<?php
else :
?>
<p>Reklamation wurde erfasst</p>
<?php
endif;
?>
</body>
</html>