Subversion Repositories ALCASAR

Rev

Rev 3038 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3038 Rev 3139
1
<?php
1
<?php
2
 
2
 
3
/********************************************************************
3
/********************************************************************
4
*																	*
4
*																	*
5
*			ALCASAR EMAIL INSCRIPTION								*
5
*			ALCASAR EMAIL INSCRIPTION								*
6
*																	*
6
*																	*
7
*	By K@M3L & T3RRY @ La Plateforme_								*
7
*	By K@M3L & T3RRY @ La Plateforme_								*
8
*	By Rexy															*
8
*	By Rexy															*
9
*	Partie front de la page d'inscription des utilisateurs			*
9
*	Partie front de la page d'inscription des utilisateurs			*
10
*	elle envoi les infos à traiter à la page de traitement			*
10
*	elle envoi les infos à traiter à la page de traitement			*
11
*	via AJAX (email_registration_back)								*
11
*	via AJAX (email_registration_back)								*
12
*																	*
12
*																	*
13
/********************************************************************/
13
/********************************************************************/
14
 
14
 
15
$page = "email_registration";
15
$page = "email_registration";
16
$Language = 'en';
16
$Language = 'en';
17
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
17
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
18
	$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
18
	$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
19
	$Language = strtolower(substr(chop($Langue[0]), 0, 2));
19
	$Language = strtolower(substr(chop($Langue[0]), 0, 2));
20
}
20
}
21
if ($Language === 'es') {	// Spanish
21
if ($Language === 'es') {	// Spanish
22
	$l_title = "Inscripción por e-mail";
22
	$l_title = "Inscripción por e-mail";
23
	$l_Email = "dirección de e-mail : *";
23
	$l_Email = "dirección de e-mail : *";
24
	$l_mandatory = "* Campos requeridos";
24
	$l_mandatory = "* Campos requeridos";
25
	$l_inscription = "Inscripción";
25
	$l_inscription = "Inscripción";
26
	$l_mail_success = "Se ha enviado una contraseña a su dirección de correo electrónico.\\nVRevise su correo no deseado o spam, si no ve este correo en su bandeja de entrada.";
26
	$l_mail_success = "Se ha enviado una contraseña a su dirección de correo electrónico.\\nVRevise su correo no deseado o spam, si no ve este correo en su bandeja de entrada.";
27
	$l_mail_error = "Se ha producido un error. Por favor, renueve su registro o póngase en contacto con su administrador.";
27
	$l_mail_error = "Se ha producido un error. Por favor, renueve su registro o póngase en contacto con su administrador.";
28
} else if ($Language === 'pt') {	// Portuguese
28
} else if ($Language === 'pt') {	// Portuguese
29
	$l_title = "inscrição de e-mail";
29
	$l_title = "inscrição de e-mail";
30
	$l_Email = "endereço de e-mail : *";
30
	$l_Email = "endereço de e-mail : *";
31
	$l_mandatory = "* Campos obrigatórios";
31
	$l_mandatory = "* Campos obrigatórios";
32
	$l_inscription = "Inscrição";
32
	$l_inscription = "Inscrição";
33
	$l_mail_success = "Foi enviada uma senha para o seu endereço electrónico.\\nVerifique o seu spam ou lixo electrónico, se não vir este e-mail na sua caixa de entrada.";
33
	$l_mail_success = "Foi enviada uma senha para o seu endereço electrónico.\\nVerifique o seu spam ou lixo electrónico, se não vir este e-mail na sua caixa de entrada.";
34
	$l_mail_error = "Ocorreu um erro. Por favor, renove o seu registo ou contacte o seu administrador.";
34
	$l_mail_error = "Ocorreu um erro. Por favor, renove o seu registo ou contacte o seu administrador.";
35
} else if ($Language === 'de') {	// German
35
} else if ($Language === 'de') {	// German
36
	$l_title = "E-Mail-Anschrift";
36
	$l_title = "E-Mail-Anschrift";
37
	$l_Email = "e-mail adress : *";
37
	$l_Email = "e-mail adress : *";
38
	$l_mandatory = "* Erforderliche Felder";
38
	$l_mandatory = "* Erforderliche Felder";
39
	$l_inscription = "Aufschrift";
39
	$l_inscription = "Aufschrift";
40
	$l_mail_success = "Ein Passwort wurde an Ihre E-Mail-Adresse gesendet.\\nPrüfen Sie Ihre Spam- oder Junk-Mail, wenn Sie diese E-Mail nicht in Ihrem Posteingang finden.";
40
	$l_mail_success = "Ein Passwort wurde an Ihre E-Mail-Adresse gesendet.\\nPrüfen Sie Ihre Spam- oder Junk-Mail, wenn Sie diese E-Mail nicht in Ihrem Posteingang finden.";
41
	$l_mail_error = "Es ist ein Fehler aufgetreten. Bitte erneuern Sie Ihre Registrierung oder kontaktieren Sie Ihren Administrator.";
41
	$l_mail_error = "Es ist ein Fehler aufgetreten. Bitte erneuern Sie Ihre Registrierung oder kontaktieren Sie Ihren Administrator.";
42
} else if ($Language === 'nl') {	// Dutch
42
} else if ($Language === 'nl') {	// Dutch
43
	$l_title = "e-mail inscriptie";
43
	$l_title = "e-mail inscriptie";
44
	$l_Email = "e-mailadres : *";
44
	$l_Email = "e-mailadres : *";
45
	$l_mandatory = "* Verplichte velden";
45
	$l_mandatory = "* Verplichte velden";
46
	$l_inscription = "Opschrift";
46
	$l_inscription = "Opschrift";
47
	$l_mail_success = "Er is een wachtwoord naar uw e-mail adres gestuurd.\\nControleer uw spam of junk mail, als u deze e-mail niet in uw inbox ziet.";
47
	$l_mail_success = "Er is een wachtwoord naar uw e-mail adres gestuurd.\\nControleer uw spam of junk mail, als u deze e-mail niet in uw inbox ziet.";
48
	$l_mail_error = "Er is een fout opgetreden. Vernieuw uw registratie of neem contact op met uw beheerder.";
48
	$l_mail_error = "Er is een fout opgetreden. Vernieuw uw registratie of neem contact op met uw beheerder.";
49
} else if ($Language === 'zh') {	// Chinese
49
} else if ($Language === 'zh') {	// Chinese
50
	$l_title = "电子邮件题词";
50
	$l_title = "电子邮件题词";
51
	$l_Email = "电子邮件地址 : *";
51
	$l_Email = "电子邮件地址 : *";
52
	$l_mandatory = "* 必须填写";
52
	$l_mandatory = "* 必须填写";
53
	$l_inscription = "铭文";
53
	$l_inscription = "铭文";
54
	$l_mail_success = "一个密码已经发送到你的邮箱。\\n如果你在收件箱中没有看到这封邮件,请检查你的垃圾邮件或垃圾邮件。";
54
	$l_mail_success = "一个密码已经发送到你的邮箱。\\n如果你在收件箱中没有看到这封邮件,请检查你的垃圾邮件或垃圾邮件。";
55
	$l_mail_error = "发生了一个错误。请更新您的注册或联系您的管理员。";
55
	$l_mail_error = "发生了一个错误。请更新您的注册或联系您的管理员。";
56
} else if ($Language === 'ar') {	// Arabic
56
} else if ($Language === 'ar') {	// Arabic
57
	$l_title = "تسجيل البريد الإلكتروني";
57
	$l_title = "تسجيل البريد الإلكتروني";
58
	$l_Email = "عنوان البريد الالكترونى : *";
58
	$l_Email = "عنوان البريد الالكترونى : *";
59
	$l_mandatory = "* الحقول المطلوبة";
59
	$l_mandatory = "* الحقول المطلوبة";
60
	$l_inscription = "التسجيل";
60
	$l_inscription = "التسجيل";
61
	$l_mail_success = "تم إرسال كلمة المرور إلى عنوان البريد الإلكتروني الخاص بك.\\nتحقق من البريد العشوائي أو البريد غير الهام ، إذا كنت لا ترى هذا البريد الإلكتروني في صندوق الوارد الخاص بك.";
61
	$l_mail_success = "تم إرسال كلمة المرور إلى عنوان البريد الإلكتروني الخاص بك.\\nتحقق من البريد العشوائي أو البريد غير الهام ، إذا كنت لا ترى هذا البريد الإلكتروني في صندوق الوارد الخاص بك.";
62
	$l_mail_error = "الرجاء تجديد التسجيل الخاص بك أو الاتصال بالمسؤول.";
62
	$l_mail_error = "الرجاء تجديد التسجيل الخاص بك أو الاتصال بالمسؤول.";
63
} else if ($Language === 'fr') {
63
} else if ($Language === 'fr') {
64
	$l_title = "Inscription par e-mail";
64
	$l_title = "Inscription par e-mail";
65
	$l_Email = "Adresse e-mail : *";
65
	$l_Email = "Adresse e-mail : *";
66
	$l_mandatory = "* Champs obligatoires";
66
	$l_mandatory = "* Champs requis";
67
	$l_inscription = "Inscription";
67
	$l_inscription = "Inscription";
68
	$l_mail_success = "Un mot de passe vient d'être envoyé à votre adresse e-mail.\\nVérifier vos spams ou courriers indésirables, si vous ne voyez pas cet e-mail dans votre boîte de réception.";
68
	$l_mail_success = "Un mot de passe vient d'être envoyé à votre adresse e-mail.\\nVérifier vos spams ou courriers indésirables, si vous ne voyez pas cet e-mail dans votre boîte de réception.";
69
	$l_mail_error = "Une erreur s'est produite. Veuillez renouveler votre inscription ou contacter votre administrateur.";
69
	$l_mail_error = "Une erreur s'est produite. Veuillez renouveler votre inscription ou contacter votre administrateur.";
70
} else { // english
70
} else { // english
71
	$l_title = "e-mail inscription";
71
	$l_title = "e-mail inscription";
72
	$l_Email = "e-mail address : *";
72
	$l_Email = "e-mail address : *";
73
	$l_mandatory = "* Required fields";
73
	$l_mandatory = "* Required fields";
74
	$l_inscription = "Inscription";
74
	$l_inscription = "Inscription";
75
	$l_mail_success = "A password has been sent to your e-mail address.\\nCheck your spam or junk mail, if you don't see this e-mail in your inbox.";
75
	$l_mail_success = "A password has been sent to your e-mail address.\\nCheck your spam or junk mail, if you don't see this e-mail in your inbox.";
76
	$l_mail_error = "An error has occurred. Please renew your registration or contact your administrator.";
76
	$l_mail_error = "An error has occurred. Please renew your registration or contact your administrator.";
77
}
77
}
78
?>
78
?>
79
<!DOCTYPE html>
79
<!DOCTYPE html>
80
<html>
80
<html>
81
<head>
81
<head>
82
	<meta charset="UTF-8">
82
	<meta charset="UTF-8">
83
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
83
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
84
	<title>ALCASAR - <?=$l_title ?></title>
84
	<title>ALCASAR - <?=$l_title ?></title>
85
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
85
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
86
	<link rel="stylesheet" type="text/css" href="css/pass.css">
86
	<link rel="stylesheet" type="text/css" href="css/pass.css">
87
	<link rel="icon" href="images/favicon-48.ico" type="image/ico">
87
	<link rel="icon" href="images/favicon-48.ico" type="image/ico">
88
	<script type="text/javascript" src="js/jquery.min.js"></script>
88
	<script type="text/javascript" src="js/jquery.min.js"></script>
89
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
89
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
90
</head>
90
</head>
91
<body>
91
<body>
92
	<div class="col-12 col-lg-10 offset-lg-1">
92
	<div class="col-12 col-lg-10 offset-lg-1">
93
		<?php require_once(__DIR__.'/header.php'); ?>
93
		<?php require_once(__DIR__.'/header.php'); ?>
94
		<section id="inscription" class="row">
94
		<section id="inscription" class="row">
95
			<form name="master" id="contenu_acces" onsubmit="return false;" class="col-12 offset-lg-1 col-lg-10">
95
			<form name="master" id="contenu_acces" onsubmit="return false;" class="col-12 offset-lg-1 col-lg-10">
96
				<div class="row input_row">
96
				<div class="row input_row">
97
					<div class="label_name col-3 col-lg-4"><?=$l_Email?></div>
97
					<div class="label_name col-3 col-lg-4"><?=$l_Email?></div>
98
					<div class="col-6 col-lg-4">
98
					<div class="col-6 col-lg-4">
99
					<input type="email" placeholder="User@exemple.com" id="email" name="email" required class="form-control"/>
99
					<input type="email" placeholder="User@exemple.com" id="email" name="email" required class="form-control"/>
100
					</div>
100
					</div>
101
					<small id="output_email" class="row"></small>
101
					<small id="output_email" class="row"></small>
102
				</div>
102
				</div>
103
				<div id="status">
103
				<div id="status">
104
					<?=$l_mandatory?>
104
					<?=$l_mandatory?>
105
				</div>
105
				</div>
106
				<div class="row input_row">
106
				<div class="row input_row">
107
					<div class="col-5 offset-xs-1 col-md-4 offset-md-2">
107
					<div class="col-5 offset-xs-1 col-md-4 offset-md-2">
108
						<input id="buttons" class="btn btn-default" value="Annuler" onclick="window.location.href = 'index.php';">
108
						<input id="buttons" class="btn btn-default" value="Annuler" onclick="window.location.href = 'index.php';">
109
					</div>
109
					</div>
110
					<div class="col-5 col-md-4">
110
				<div class="col-5 col-md-4">
111
						<button type="submit" class="btn btn-primary btn-lg" id="buttons" ><?=$l_inscription?></button>
111
						<button type="submit" class="btn btn-primary btn-lg" id="buttons" ><?=$l_inscription?></button>
112
					</div>
112
					</div>
113
				</div>
113
				</div>
114
			</form>
114
			</form>
115
		</section>
115
		</section>
116
		<script>
116
		<script>
117
			$(document).ready(function(){
117
			jQuery(document).ready(function($){
118
				$("#contenu_acces input").focus(function(){
118
				$("#contenu_acces input").focus(function(){
119
					$("#status").fadeOut(800);
119
					$("#status").fadeOut(800);
120
				});
120
				});
121
				$("#contenu_acces").submit(function(){
121
				$("#contenu_acces").submit(function(){
122
					var status = $("#status");
122
					var status = $("#status");
123
					var Fmail = $("#email").val();
123
					var Fmail = $("#email").val();
124
					$.ajax({
124
					$.ajax({
125
						type: "post",
125
						type: "post",
126
						url:  "email_registration_back.php",
126
						url:  "email_registration_back.php",
127
						data: {
127
						data: {
128
							'Fmail' : Fmail,
128
							'Fmail' : Fmail,
129
						},
129
						},
130
						beforeSend: function(){
130
						beforeSend: function(){
131
							$("#status").attr("value", "Traitement en cours...");
131
							$("#status").attr("value", "Traitement en cours...");
132
						},
132
						},
133
						success: function(data){
133
						success: function(data){
134
							if (data.match("success")) {
134
							if (data.match("success")) {
135
								status.html(data).fadeIn(400);
135
								status.html(data).fadeIn(400);
136
								alert("<?=$l_mail_success?>");
136
								alert("<?=$l_mail_success?>");
137
								document.location.href="index.php";
137
								document.location.href="index.php";
138
							} else {
138
							} else {
139
							console.log(data);
139
							console.log(data);
140
								alert("<?=$l_mail_error?>");
140
								alert("<?=$l_mail_error?>");
141
								status.css("color", "red").html(data).fadeIn(400);
141
								status.css("color", "red").html(data).fadeIn(400);
142
							}
142
							}
143
						}
143
						}
144
					});
144
					});
145
				});
145
				});
146
			});
146
			});
147
		</script>
147
		</script>
148
	</div>
148
	</div>
149
</body>
149
</body>
150
</html>
150
</html>
151
 
151