-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditroom.php
126 lines (112 loc) · 3.19 KB
/
editroom.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Room Management System - Edit</title>
<!-- UIkit CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.1.7/css/uikit.min.css" />
<!-- UIkit JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.1.7/js/uikit.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.1.7/js/uikit-icons.min.js"></script>
</head>
<style media="screen">
/* MODAL STARTS HERE */
.bg-modal-edit {
background-color: rgba(0, 0, 0, 0.8);
width: 100%;
height: 100%;
position: absolute;
top: 0;
display: flex;
justify-content: center;
align-items: center;
}
.modal-contents {
height: 300px;
width: 500px;
background-color: white;
text-align: center;
padding: 20px;
position: relative;
border-radius: 4px;
}
input {
margin: 15px auto;
display: block;
width: 50%;
padding: 8px;
border: 1px solid gray;
}
.close-edit {
position: absolute;
top: 0;
right: 10px;
font-size: 42px;
color: #333;
transform: rotate(45deg);
cursor: pointer;
&:hover {
color: #666;
}
}
.close-add {
position: absolute;
top: 0;
right: 10px;
font-size: 42px;
color: #333;
transform: rotate(45deg);
cursor: pointer;
&:hover {
color: #666;
}
}
.zindex {
z-index: 1;
}
</style>
<body>
<div class="uk-container uk-position-top-left uk-margin-medium-top zindex">
<p class="uk-button uk-button-secondary uk-border-rounded"><a href="index.php">Back</a></p>
</div>
<div class="bg-modal-edit">
<div class="modal-contents">
<!-- Image
<img src="https://s.gravatar.com/avatar/cfe128a2b747c12a7bc719be85d20a40?s=80" alt="" class="uk-margin-bottom uk-border-circle">
-->
<h1 class="uk-text-bold uk-h1">Edit Room's</h1>
<form method="POST">
<div class="uk-margin-bottom">
<select name="selectnotebook"class="uk-select uk-text-center uk-border-rounded uk-margin-small-bottom">
<?php
include 'db.php';
$notebooks_sql = "SELECT * FROM raume";
$notebooks = mysqli_query($con, $notebooks_sql);
while ($row = mysqli_fetch_assoc($notebooks)) {
echo "<option value='". $row['Name'] ."'>". $row['Name'] ."</option>";
}
?>
</select>
</div>
<p>Ist der Raum Belegt ?</p>
<select class="uk-select uk-text-center uk-border-rounded uk-margin-medium-bottom" name="infochange">
<option value="1">Ja</option>
<option value="0">Nein</option>
</select>
<input type="submit" name="submit" class="uk-button-primary uk-button uk-border-rounded" value="Ändern">
</form>
</div>
</div>
</body>
<?php
$notebookname = $_POST['selectnotebook'];
$InfoChange = $_POST['infochange'];
$sql_changes = "UPDATE `raume` SET `belegt` = '$InfoChange' WHERE `raume`.`Name` = '$notebookname'";
if(isset($_POST['submit'])) {
$sql_datachange = mysqli_query($con, $sql_changes);
if ($sql_datachange) {
header('Location: index.php');
}
}
include 'footer.php';
?>