-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
257 lines (235 loc) · 8.69 KB
/
index.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?php
require_once '.htconfig.php';
require_once 'System.php';
require_once 'Mail.php';
function perform_send_mail($to, $subject, $body) {
$headers = [
'From' => $GLOBALS['MAIL_FROM'],
'To' => $to,
'Subject' => $subject,
'CC' => $GLOBALS['MAIL_CC'],
'Content-Type' => 'text/html; charset=utf-8',
'Reply-To' => $GLOBALS['MAIL_REPLY_TO']
];
$smtp = Mail::factory('smtp', $GLOBALS['MAIL_CONFIG']);
$mail = $smtp->send(array($to, $GLOBALS['MAIL_CC']), $headers, $body);
if (PEAR::isError($mail)) {
echo('<p>FEHLER: ' . $mail->getMessage() . '</p>');
return false;
} else {
return true;
}
}
function perform_information($email) {
return perform_send_mail($email, 'TU Darmstadt Informatik: Interesse an der UE', '
<p>
Hallo UE-Interessierte*r,
</p>
<p>
du hast angegeben, dass du dich für die Universitätserfahrung der Informatik an der TU Darmstadt interessierst. Das freut uns :)
</p>
<p>
Weitere Informationen findet du unter https://d120.de/ue. Wenn du weiterhin Interesse an der Teilnahme hast, schreibe uns einfach eine E-Mail an ue@d120.de. Du kannst dich natürlich auch gerne bei Fragen an uns
wenden. Wenn du dich anmeldest, schreibe uns bitte die folgenden Infos:
<ul>
<li>deinen Namen,</li>
<li>dein voraussichtliches Unistartsemester,</li>
<li>mögliche Wochentage/Zeiträume für einen UE-Termin, soweit bekannt,</li>
<li>und, wenn du eine Teilnahmebestätigung für die Schule haben möchtest: Name und Anschrift der Schule.</li>
</ul>
</p>
<p>
Liebe Grüße <br>
Die UE-Orga <br>
Stefanie Blümer <br>
Tim Pollandt
</p>');
}
function perform_question($email, $sender, $message) {
return perform_send_mail($email, 'TU Darmstadt, Informatik: Fragen zur UE', "
<p>
Hallo $sender,
</p>
<p>
Wir haben die folgende Anfrage von dir erhalten und werden diese Zeitnah bearbeiten:
</p
<p>
" . htmlspecialchars($message) . "
</p>
<p>
Liebe Grüße <br>
Die UE-Orga <br>
Stefanie Blümer <br>
Tim Pollandt
</p>
");
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
switch ($_GET['action']) {
case 'information':
$success = perform_information($_POST['email']);
break;
case 'question':
$success = perform_question($_POST['email'], $_POST['name'], $_POST['message']);
break;
default:
$success = false;
break;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="robots" content="noindex, follow">
<link rel="stylesheet" href="bootstrap.min.css">
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
<title>UE :: Kontakt</title>
</head>
<body>
<script>
$(function() {
setTimeout(function() {
$(".alert").alert('close');
}, 2000);
});
</script>
<div class="container" style="margin-top: 5ex;">
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($success) {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<strong>Anmeldung erfolgreich.</strong> Wir haben deine Anmeldung erhalten. Du wirst in Kürze eine E-Mail erhalten. Bitte überprüfe auch deinen Spam-Ordner.
<button type="button" class="close" data-dismiss="alert">×</button>
</div>
<?php
} else {
?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<strong>Hoppla, es ist etwas schief gelaufen.</strong> Bitte versuche es später erneut.
<button type="button" class="close" data-dismiss="alert">×</button>
</div>
<?php
}
}
?>
<div class="jumbotron">
<h1 class="display-4">Informationen zur UE erhalten</h1>
<p class="lead">Melde dich hier an, um eine E-Mail mit weiteren Informationen zur UE zu erhalten.</p>
<form class="needs-validation" action="?action=information" method="POST" autocomplete="off">
<div class="form-group">
<label for="email">E-Mail-Adresse</label>
<input type="email" class="form-control" id="email" name="email" autocomplete="off" required>
</div>
<button type="submit" class="btn btn-primary">Informationen Erhalten</button>
</form>
</div>
<div class="jumbotron">
<h1 class="display-4">Fragen zur UE</h1>
<p class="lead">Hier kannst du Fragen stellen, die wir zeitnah beantworten werden.</p>
<form class="needs-validation" action="?action=question" method="POST" autocomplete="off">
<div class="form-row">
<div class="col-md-6">
<div class="form-group">
<label for="email">E-Mail-Adresse</label>
<input type="email" class="form-control" id="email" name="email" autocomplete="off" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="name">Absender</label>
<input type="text" class="form-control" id="name" name="name" autocomplete="off" required>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<div class="form-group">
<label for="message">Mitteilung</label>
<textarea class="form-control" id="message" name="message"></textarea>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<button type="submit" class="btn btn-primary">Anmelden</button>
</div>
</div>
</form>
</div>
<!--
<div class="jumbotron">
<h1 class="display-4">Anmeldung zur UE</h1>
<p class="lead">Hier kannst du dich direkt zur UE anmelden, wir werden dich dann in naher Zukunft kontakieren.</p>
<form class="needs-validation" action="?action=register" method="POST" autocomplete="off">
<div class="form-row">
<div class="col-md-6">
<div class="form-group">
<label for="email">E-Mail-Adresse</label>
<input type="email" class="form-control" id="email" name="email" autocomplete="off" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="name">Absender</label>
<input type="text" class="form-control" id="name" name="name" autocomplete="off" required>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<div class="form-group">
<label for="start_season">Voraussichtliches Startsemester</label>
<input type="number" class="form-control" id="start_season" name="start_season">
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<div class="form-group">
<label for="timeframe">Mögliche Wochentage für einen UE-Termin</label>
<div class="form-check form-check-inline" id="timeframe">
<input type="checkbox" class="form-check-input" id="monday" name="monday">
<label class="form-check-label" for="monday">Monday</label>
</div>
<div class="form-check form-check-inline" id="timeframe">
<input type="checkbox" class="form-check-input" id="tuesday" name="tuesday">
<label class="form-check-label" for="tuesday">Dienstag</label>
</div>
<div class="form-check form-check-inline" id="timeframe">
<input type="checkbox" class="form-check-input" id="wednesday" name="wednesday">
<label class="form-check-label" for="wednesday">Mittwoch</label>
</div>
<div class="form-check form-check-inline" id="timeframe">
<input type="checkbox" class="form-check-input" id="thursday" name="thursday">
<label class="form-check-label" for="thursday">Donnerstag</label>
</div>
<div class="form-check form-check-inline" id="timeframe">
<input type="checkbox" class="form-check-input" id="friday" name="friday">
<label class="form-check-label" for="friday">Freitag</label>
</div>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<div class="form-group">
<label for="message">Mitteilung</label>
<textarea class="form-control" id="message" name="message"></textarea>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<button type="submit" class="btn btn-primary">Anmelden</button>
</div>
</div>
</form>
</div>
-->
</div>
</body>
</html>