-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathabmelden.php
More file actions
40 lines (35 loc) · 929 Bytes
/
Copy pathabmelden.php
File metadata and controls
40 lines (35 loc) · 929 Bytes
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
<?php
header('Content-Type: text/plain; charset=utf-8');
include "../secret/secret.php";
$mysqli = new mysqli("localhost", $dbuser, $dbpass, "putzplan");
$mysqli->set_charset("utf8");
if ($mysqli->connect_errno) {
die("Verbindung fehlgeschlagen: " . $mysqli->connect_error);
}
$name = $_POST["name"];
$amount = $_POST["amount"];
if ($amount == "Eine Woche") {
$weeks = 0;
}
if ($amount == "Zwei Wochen") {
$weeks = -1;
}
if ($amount == "Drei Wochen") {
$weeks = -2;
}
if ($amount == "Vier Wochen") {
$weeks = -3;
}
$sql = "UPDATE person SET active = $weeks WHERE name = '" . $name . "'";
$stmt = $mysqli->stmt_init();
if ($stmt->prepare($sql)) {
$OK = $stmt->execute();
$last = $mysqli->insert_id;
if ($OK) {
$adresse_id = $mysqli->insert_id;
header('Location: https://patrickbollmann.de/putzplan/');
} else {
echo $stmt->error . "\r\n";
}
}
$mysqli->close();