1
|
<?php
|
2
|
require_once("./administration/user.php");
|
3
|
|
4
|
if (!empty($action) && $action == "new_registration") {
|
5
|
|
6
|
$zobrazit_znovu = true;
|
7
|
|
8
|
if (empty($name)) {
|
9
|
$hlaska .= "Jméno musíte vyplnit";
|
10
|
}
|
11
|
else if (empty($surname)) {
|
12
|
$hlaska .= "Příjmení musíte vyplnit";
|
13
|
}
|
14
|
else if (empty($email)) {
|
15
|
$hlaska .= "E-mail musíte vyplnit";
|
16
|
}
|
17
|
else if (!ERegI("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,5}$", $email)) {
|
18
|
$hlaska .= "E-mailová adresa není ve správném tvaru.";
|
19
|
}
|
20
|
else if (empty($nick)) {
|
21
|
$hlaska .= "Nick musíte vyplnit";
|
22
|
}
|
23
|
else if (empty($password) || empty($password2)) {
|
24
|
$hlaska .= "Heslo i heslo pro kontrolu musíte vyplnit";
|
25
|
}
|
26
|
else if ($password != $password2) {
|
27
|
$hlaska .= "Heslo a heslo pro kontrolu se neshoduje";
|
28
|
}
|
29
|
else {
|
30
|
if (nick_exists($nick)) {
|
31
|
$hlaska .= "Uživatel s takovým nickem již existuje, zvolte si prosím jiný";
|
32
|
}
|
33
|
else {
|
34
|
insert_user($name, $surname, $city, $email, $nationality, 1, $nick, $password, false);
|
35
|
$zobrazit_znovu = false;
|
36
|
Header ("Location: ./?n=$nick&p=$password&poprve=ano");
|
37
|
}
|
38
|
}
|
39
|
}
|
40
|
|
41
|
function znova($string) {
|
42
|
global $zobrazit_znovu;
|
43
|
if ($zobrazit_znovu)
|
44
|
echo ' value="'.$string.'"';
|
45
|
}
|
46
|
?>
|
47
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
48
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs">
|
49
|
<head>
|
50
|
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
|
51
|
<meta http-equiv="Content-Language" content="cs" />
|
52
|
<title>Slovník katedry blízkovýchoních studií</title>
|
53
|
<link rel="stylesheet" type="text/css" href="css/kbs.css">
|
54
|
</head>
|
55
|
|
56
|
<body>
|
57
|
<center>
|
58
|
<table align="center">
|
59
|
<thead>
|
60
|
<h3 class="nadpis2">Registrace nového uživatele</h3>
|
61
|
<h5>Vítejte v registraci. <br />
|
62
|
Díky ní si budete moci při příštím zkoušení ověřit,
|
63
|
zda již znáte slovíčka, která jste minule neuměli.</h5>
|
64
|
|
65
|
<?php print_hlasku($hlaska); ?>
|
66
|
</thead>
|
67
|
<tbody>
|
68
|
<form action="" method="POST" name="new_registration_form">
|
69
|
<table align="center" border="0">
|
70
|
<tr class="akt">
|
71
|
<td>jméno*</td>
|
72
|
<td><input type="text" name="name" size="50" maxlength="50"<?php znova($name)?> /></td>
|
73
|
</tr>
|
74
|
<tr class="akt">
|
75
|
<td>příjmení*</td>
|
76
|
<td><input type="text" name="surname" size="50" maxlength="50"<?php znova($surname)?> /></td>
|
77
|
</tr>
|
78
|
<tr class="akt">
|
79
|
<td>město</td>
|
80
|
<td><input type="text" name="city" size="50" maxlength="70"<?php znova($city)?> /></td>
|
81
|
</tr>
|
82
|
<tr class="akt">
|
83
|
<td>e-mail*</td>
|
84
|
<td><input type="text" name="email" size="50" maxlength="80"<?php znova($email)?> /></td>
|
85
|
</tr>
|
86
|
<tr class="akt">
|
87
|
<td>národnost</td>
|
88
|
<td><input type="text" name="nationality" size="50" maxlength="30"<?php znova($nationality)?> /></td>
|
89
|
</tr>
|
90
|
<tr class="akt">
|
91
|
<td>nick*</td>
|
92
|
<td><input type="text" name="nick" size="50" maxlength="30"<?php znova($nick)?> /></td>
|
93
|
</tr>
|
94
|
<tr class="akt">
|
95
|
<td>heslo*</td>
|
96
|
<td><input type="password" name="password" size="50" maxlength="100" onFocus="setFocus(this)" /></td>
|
97
|
</tr>
|
98
|
<tr class="akt">
|
99
|
<td>heslo znovu*</td>
|
100
|
<td><input type="password" name="password2" size="50" maxlength="100" onFocus="setFocus(this)" /></td>
|
101
|
</tr>
|
102
|
<tr class="nadpis_sekce">
|
103
|
<td>
|
104
|
<input type="hidden" name="action" value="new_registration">
|
105
|
</td>
|
106
|
<td><input type="submit" value="Vlož"></td>
|
107
|
</tr>
|
108
|
</form>
|
109
|
</table>
|
110
|
</tbody>
|
111
|
</table>
|
112
|
<h6 align="center"><a href="./">Zpět ke vstupu do slovniku</a></h6>
|
113
|
</center>
|
114
|
</body>
|
115
|
</html>
|