Subversion Repositories ALCASAR

Rev

Rev 3003 | Rev 3011 | 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
*																	*
7
*	By K@M3L 1101130512.1901090409 & T3RRY @ La Plateforme_			*
8
*	V 1.0 June 2021.												*
9
*																	*
10
*	Partie front de la page d'inscription des utilisateurs			*
11
*	elle envoi les infos à traiter à la page de traitement			*
3009 rexy 12
*	via AJAX (email_registration_back)								*
2990 rexy 13
*																	*
14
/********************************************************************/
15
 
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
}
21
if ($Language === 'fr') {		// French
3009 rexy 22
	$l_home = " Accueil";
3003 rexy 23
	$l_title = "Inscription par Email";
24
	$l_login = "Connexion";
3009 rexy 25
	$l_Email = "Adresse électronique: *";
26
	$l_mandatory = "* Remplir tous les champs obligatoires";
3003 rexy 27
} else {	// English
3009 rexy 28
	$l_home = " Home";
29
	$l_title = "Email inscription";
3003 rexy 30
	$l_login = "Login";
3009 rexy 31
	$l_Email = "Email address: *";
32
	$l_mandatory = "* Fill in all mandatory fields";
3003 rexy 33
}
2990 rexy 34
?>
35
<!DOCTYPE html>
36
<html>
37
<head>
38
	<meta charset="UTF-8">
39
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
40
	<title>ALCASAR - <?=$l_title ?></title>
41
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
42
	<link rel="stylesheet" type="text/css" href="css/pass.css">
43
	<link rel="icon" href="images/favicon-48.ico" type="image/ico">
44
	<script type="text/javascript" src="js/jquery.min.js"></script>
45
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
46
</head>
47
<body>
48
<nav class="navbar navbar navbar-inverse" style="margin-bottom:0px;">
49
	<div class="container-fluid">
50
		<div class="navbar-header">
3009 rexy 51
			<a href="index.php"><img src="images/logo-alcasar_70.png" width="50" ><font color=red><b><?=$l_home ?></b></font></a>
2990 rexy 52
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
53
				<span class="sr-only">Toggle navigation</span>
54
				<span class="icon-bar"></span>
55
				<span class="icon-bar"></span>
56
				<span class="icon-bar"></span>
57
			</button>
58
		</div>
59
		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
60
			<ul class="nav navbar-nav">
61
				<li>
3003 rexy 62
					<a href="index.php?url=www.euronews.com"><?=$l_login ?></a>
2990 rexy 63
				</li>
64
				<li>
3003 rexy 65
					<a href="email_registration_front.php"><?=$l_title ?></a>
2990 rexy 66
				</li>
67
			</ul>
68
			<ul class="nav navbar-nav navbar-right">
69
				<a href="contact.php" class="navbar-brand">Contact</a>
70
				<a href="contact.php"><img src="images/organisme.png" width="40"></a>
71
			</ul>
72
		</div>
73
	</div>
74
</nav>
75
	<div class="col-xs-12 col-md-10 col-md-offset-1"> 
76
		<!-- HeaderBox -->
77
		<div class="row banner">
78
			<!-- Logo box -->
79
			<div class="hidden-xs col-sm-3 col-md-2 col-lg-2"> 
80
				<img class="img-responsive img-A" src="images/organisme.png">
81
			</div>
82
			<!-- Title -->
83
			<div id="cadre_titre" class="titre_banner col-xs-12 col-sm-8">
84
				<div class="row">
85
					<p id="acces_controle" class="titre_controle"><?= $l_title ?></p>
86
				</div>
87
<!--				<div class="row">
88
				<?php if (isset($changePasswordMessage)): ?>
89
					<?= $changePasswordMessage ?>
90
				<?php endif; ?>
91
				</div>-->
92
			</div>
93
			<!-- Logo box -->
94
			<div class="img_banner hidden-xs col-sm-3 col-md-2 col-lg-2">
95
				<img class="img-responsive img-organisme" src="images/logo-alcasar_70.png">
96
			</div>
97
		</div>
98
 
99
		<section id="inscription" class="row">
100
			<form name="master" id="contenu_acces" onsubmit="return false;" class="col-xs-12 col-sm-12 col-md-offset-1 col-md-10">
101
				<div class="row input_row">
3009 rexy 102
					<div class="label_name col-xs-3 col-sm-3 col-md-4"><?=$l_Email?></div>
2990 rexy 103
					<div class="col-xs-6 col-sm-6 col-md-4">
104
					<input type="email" placeholder="User@exemple.com" id="email" name="email" required class="form-control"/>
105
					</div>
106
					<small id="output_email" class="row"></small>
107
				</div>
108
				<div id="status">
3009 rexy 109
					<?=$l_mandatory?>
2990 rexy 110
				</div>
111
				<div class="row input_row">
112
					<div class="col-xs-5 col-xs-offset-1 col-sm-4 col-sm-offset-2">
113
						<input id="buttons" class="btn btn-default" value="Annuler" onclick="window.location.href = 'index.php';">
114
					</div>
115
					<div class="col-xs-5 col-sm-4">
116
						<button type="submit" class="btn btn-primary btn-lg" id="buttons" >Inscription</button>
117
					</div>
118
				</div>
119
			</form>
120
		</section>
121
 
122
		<script type="text/javascript" src="js/jquery.min.js"></script>
123
		<script>
124
			$(document).ready(function(){
125
				$("#contenu_acces input").focus(function(){
126
					$("#status").fadeOut(800);
127
				});
128
 
129
				//Traitement du formulaire d'inscription
130
				$("#contenu_acces").submit(function(){
131
					var status = $("#status");
132
					var Fmail = $("#email").val();
133
 
134
					$.ajax({
135
						type: "post",
3009 rexy 136
						url:  "email_registration_back.php",
2990 rexy 137
						data: {
138
							'Fmail' : Fmail,
139
						},
140
						beforeSend: function(){
141
							$("#status").attr("value", "Traitement en cours...");
142
						},
143
						success: function(data){
144
							if (data.match("success")) {
145
								status.html(data).fadeIn(400);
3009 rexy 146
								alert("Encore une dernière étape!\n\nUn mot de passe temporaire vient de vous être envoyé à votre adresse électronique.\n Veuillez changer votre mot de passe.\n\n(Pensez à vérifier vos spams ou courriers indésirables, si vous ne voyez pas ce mail dans votre boîte de réception).\n\nSi vous ne recevez pas le mail dans les 24 heures contactez votre administrateur.")
2990 rexy 147
								 document.location.href="index.php";
148
							} else {
149
							console.log(data);
3009 rexy 150
								alert("Une erreur s'est produite.\n\nVeuillez renouveler votre inscription ou contactez votre administrateur.");
2990 rexy 151
								status.css("color", "red").html(data).fadeIn(400);
152
							}
153
						}
154
					});
155
				});
156
			});
157
		</script>
158
	</div>
159
</body>
160
</html>