-
Notifications
You must be signed in to change notification settings - Fork 0
/
addCustomer.php
77 lines (73 loc) · 2.61 KB
/
addCustomer.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
<?php
$level = 2;
include "head.php";
if (isset($_GET['id']))
{
$action = "updateCustomer";
$title = "bearbeiten";
$customer = getCustomerByID($_GET['id']);
}
else
{
$action = "insertCustomer";
$title = "hinzufügen";
}
?>
<div class="container">
<h1>Kund*in <?php echo $title; ?></h1>
<?php printMessage(); ?>
<form class="form-horizontal" role="form" method="POST" action="result.php">
<div class="form-group">
<div class="col-sm-4">
<input type="text" class="form-control" name="firstname" placeholder="Vorname"
<?php if(isset($customer)) echo 'value="'.$customer->firstname.'"'; ?>required>
</div>
</div>
<div class="form-group">
<div class="col-sm-4">
<input type="text" class="form-control" name="lastname" placeholder="Nachname"
<?php if(isset($customer)) echo 'value="'.$customer->lastname.'"'; ?> required>
</div>
</div>
<div class="form-group">
<div class="col-sm-4">
<input type="text" class="form-control" name="company" placeholder="Firma"
<?php if(isset($customer)) echo 'value="'.$customer->company.'"'; ?> >
</div>
</div>
<div class="form-group">
<div class="col-sm-4">
<input type="text" class="form-control" name="road" placeholder="Straße"
<?php if(isset($customer)) echo 'value="'.$customer->road.'"'; ?> required>
</div>
</div>
<div class="form-group">
<div class="col-sm-4">
<input type="text" class="form-control" name="zip" placeholder="PLZ"
<?php if(isset($customer)) echo 'value="'.$customer->zip.'"'; ?> required>
</div>
</div>
<div class="form-group">
<div class="col-sm-4">
<input type="text" class="form-control" name="city" placeholder="Ort"
<?php if(isset($customer)) echo 'value="'.$customer->city.'"'; ?> required>
</div>
</div>
<div class="form-group">
<div class="col-sm-4">
<input type="text" class="form-control" name="country" placeholder="Staat"
<?php if(isset($customer)) echo 'value="'.$customer->country.'"'; ?> required>
</div>
</div>
<div class="form-group">
<div class="col-sm-4">
<button type="submit" name="<?php echo $action; ?>" value="<?php if(isset($customer))echo $customer->ID; ?>" class="btn btn-default"> <?php echo ucfirst($title); ?> </button>
<?php if(isset($customer)) : ?>
<button type="submit" name="deleteCustomer" value="<?php echo $customer->ID; ?>" class="btn btn-default"> Löschen </button>
<?php endif; ?>
</div>
</div>
</form>
</div>
</div>
<?php include "footer.php";?>