Subversion Repositories ALCASAR

Rev

Rev 3037 | Rev 3139 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
2990 rexy 1
<?php
2
 
3
/********************************************************************
4
*																	*
5
*			ALCASAR EMAIL INSCRIPTION								*
6
*																	*
3011 rexy 7
*	By K@M3L & T3RRY @ La Plateforme_								*
3038 rexy 8
*	By Rexy															*
2990 rexy 9
*	Partie front de la page d'inscription des utilisateurs			*
10
*	elle envoi les infos à traiter à la page de traitement			*
3009 rexy 11
*	via AJAX (email_registration_back)								*
2990 rexy 12
*																	*
13
/********************************************************************/
14
 
3026 rexy 15
$page = "email_registration";
3003 rexy 16
$Language = 'en';
17
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
18
	$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
19
	$Language = strtolower(substr(chop($Langue[0]), 0, 2));
20
}
3038 rexy 21
if ($Language === 'es') {	// Spanish
22
	$l_title = "Inscripción por e-mail";
23
	$l_Email = "dirección de e-mail : *";
24
	$l_mandatory = "* Campos requeridos";
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.";
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
29
	$l_title = "inscrição de e-mail";
30
	$l_Email = "endereço de e-mail : *";
31
	$l_mandatory = "* Campos obrigatórios";
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.";
34
	$l_mail_error = "Ocorreu um erro. Por favor, renove o seu registo ou contacte o seu administrador.";
35
} else if ($Language === 'de') {	// German
36
	$l_title = "E-Mail-Anschrift";
37
	$l_Email = "e-mail adress : *";
38
	$l_mandatory = "* Erforderliche Felder";
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.";
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
43
	$l_title = "e-mail inscriptie";
44
	$l_Email = "e-mailadres : *";
45
	$l_mandatory = "* Verplichte velden";
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.";
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
50
	$l_title = "电子邮件题词";
51
	$l_Email = "电子邮件地址 : *";
52
	$l_mandatory = "* 必须填写";
53
	$l_inscription = "铭文";
54
	$l_mail_success = "一个密码已经发送到你的邮箱。\\n如果你在收件箱中没有看到这封邮件,请检查你的垃圾邮件或垃圾邮件。";
55
	$l_mail_error = "发生了一个错误。请更新您的注册或联系您的管理员。";
56
} else if ($Language === 'ar') {	// Arabic
57
	$l_title = "تسجيل البريد الإلكتروني";
58
	$l_Email = "عنوان البريد الالكترونى : *";
59
	$l_mandatory = "* الحقول المطلوبة";
60
	$l_inscription = "التسجيل";
61
	$l_mail_success = "تم إرسال كلمة المرور إلى عنوان البريد الإلكتروني الخاص بك.\\nتحقق من البريد العشوائي أو البريد غير الهام ، إذا كنت لا ترى هذا البريد الإلكتروني في صندوق الوارد الخاص بك.";
62
	$l_mail_error = "الرجاء تجديد التسجيل الخاص بك أو الاتصال بالمسؤول.";
63
} else if ($Language === 'fr') {
64
	$l_title = "Inscription par e-mail";
65
	$l_Email = "Adresse e-mail : *";
66
	$l_mandatory = "* Champs obligatoires";
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.";
69
	$l_mail_error = "Une erreur s'est produite. Veuillez renouveler votre inscription ou contacter votre administrateur.";
70
} else { // english
71
	$l_title = "e-mail inscription";
72
	$l_Email = "e-mail address : *";
73
	$l_mandatory = "* Required fields";
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.";
76
	$l_mail_error = "An error has occurred. Please renew your registration or contact your administrator.";
3003 rexy 77
}
2990 rexy 78
?>
79
<!DOCTYPE html>
80
<html>
81
<head>
82
	<meta charset="UTF-8">
83
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
84
	<title>ALCASAR - <?=$l_title ?></title>
85
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
86
	<link rel="stylesheet" type="text/css" href="css/pass.css">
87
	<link rel="icon" href="images/favicon-48.ico" type="image/ico">
88
	<script type="text/javascript" src="js/jquery.min.js"></script>
89
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
90
</head>
91
<body>
3026 rexy 92
	<div class="col-12 col-lg-10 offset-lg-1">
93
		<?php require_once(__DIR__.'/header.php'); ?>
2990 rexy 94
		<section id="inscription" class="row">
3026 rexy 95
			<form name="master" id="contenu_acces" onsubmit="return false;" class="col-12 offset-lg-1 col-lg-10">
2990 rexy 96
				<div class="row input_row">
3026 rexy 97
					<div class="label_name col-3 col-lg-4"><?=$l_Email?></div>
98
					<div class="col-6 col-lg-4">
2990 rexy 99
					<input type="email" placeholder="User@exemple.com" id="email" name="email" required class="form-control"/>
100
					</div>
101
					<small id="output_email" class="row"></small>
102
				</div>
103
				<div id="status">
3009 rexy 104
					<?=$l_mandatory?>
2990 rexy 105
				</div>
106
				<div class="row input_row">
3026 rexy 107
					<div class="col-5 offset-xs-1 col-md-4 offset-md-2">
2990 rexy 108
						<input id="buttons" class="btn btn-default" value="Annuler" onclick="window.location.href = 'index.php';">
109
					</div>
3026 rexy 110
					<div class="col-5 col-md-4">
3038 rexy 111
						<button type="submit" class="btn btn-primary btn-lg" id="buttons" ><?=$l_inscription?></button>
2990 rexy 112
					</div>
113
				</div>
114
			</form>
115
		</section>
116
		<script>
117
			$(document).ready(function(){
118
				$("#contenu_acces input").focus(function(){
119
					$("#status").fadeOut(800);
120
				});
121
				$("#contenu_acces").submit(function(){
122
					var status = $("#status");
123
					var Fmail = $("#email").val();
124
					$.ajax({
125
						type: "post",
3009 rexy 126
						url:  "email_registration_back.php",
2990 rexy 127
						data: {
128
							'Fmail' : Fmail,
129
						},
130
						beforeSend: function(){
131
							$("#status").attr("value", "Traitement en cours...");
132
						},
133
						success: function(data){
134
							if (data.match("success")) {
135
								status.html(data).fadeIn(400);
3038 rexy 136
								alert("<?=$l_mail_success?>");
3037 rexy 137
								document.location.href="index.php";
2990 rexy 138
							} else {
139
							console.log(data);
3038 rexy 140
								alert("<?=$l_mail_error?>");
2990 rexy 141
								status.css("color", "red").html(data).fadeIn(400);
142
							}
143
						}
144
					});
145
				});
146
			});
147
		</script>
148
	</div>
149
</body>
150
</html>