-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave.php
More file actions
68 lines (51 loc) · 1.6 KB
/
save.php
File metadata and controls
68 lines (51 loc) · 1.6 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
65
66
67
68
<!DOCTYPE html>
<html>
<head>
<title>Spiegel Infos</title>
<meta name="mobile-web-app-capable" content="yes"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="icon" href="/Info/icon.png"/>
<link rel="shortcut icon" href="/Info/icon.png"/>
<link rel="apple-touch-icon" sizes="48x48" href="/Info/icon_48.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="/Info/icon_72.png"/>
<link rel="apple-touch-icon" sizes="128x128" href="/Info/icon_128.png"/>
<link rel="apple-touch-icon" sizes="196x196" href="/Info/icon_196.png"/>
</head>
<body> <?php
require("db_config.php");
if(isset($_GET['action'])){
$action = $_GET['action'];
if($action=="save"){
$id=$_GET['id'];
$von=$_GET['von'];
$bis=$_GET['bis'];
$info=$_GET['info'];
$color=$_GET['color'];
$bg_color=$_GET['bg_color'];
if($id==-1){
$query = "INSERT INTO info (von, bis, info, color, bg_color) VALUES ('$von','$bis','$info','$color','$bg_color')";
$result = mysql_query($query);
echo 'INSERT';
} else {
$query = "UPDATE info set von='$von' , bis='$bis' , info='$info' , color='$color' , bg_color='$bg_color' where id = $id";
$result = mysql_query($query);
echo 'Update';
}
} else if($action=="delete"){
$id=$_GET['id'];
$query = "DELETE FROM info WHERE id = $id";
$result = mysql_query($query);
echo "DEL";
}
//Cleanup
$query = "DELETE FROM info WHERE von < CURDATE()";
$result = mysql_query($query);
?>
<script>
window.location.replace('index.php')
</script>
<?php
}
?>
</body>
</html>