2990 |
rexy |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/********************************************************************
|
|
|
4 |
* *
|
|
|
5 |
* ALCASAR EMAIL INSCRIPTION *
|
|
|
6 |
* *
|
3011 |
rexy |
7 |
* By K@M3L & T3RRY @ La Plateforme_ *
|
2990 |
rexy |
8 |
* *
|
|
|
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 |
}
|
3011 |
rexy |
21 |
if ($Language === 'fr') {
|
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";
|
3011 |
rexy |
27 |
} else {
|
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 |
?>
|
3026 |
rexy |
35 |
|
2990 |
rexy |
36 |
<!DOCTYPE html>
|
|
|
37 |
<html>
|
|
|
38 |
<head>
|
|
|
39 |
<meta charset="UTF-8">
|
|
|
40 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
41 |
<title>ALCASAR - <?=$l_title ?></title>
|
|
|
42 |
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
|
|
|
43 |
<link rel="stylesheet" type="text/css" href="css/pass.css">
|
|
|
44 |
<link rel="icon" href="images/favicon-48.ico" type="image/ico">
|
|
|
45 |
<script type="text/javascript" src="js/jquery.min.js"></script>
|
|
|
46 |
<script type="text/javascript" src="js/bootstrap.min.js"></script>
|
|
|
47 |
</head>
|
|
|
48 |
<body>
|
3026 |
rexy |
49 |
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
|
50 |
<a class="navbar-brand" href="index.php"><img src="images/logo-alcasar_70.png" width="50" ><font color=red><b><?=$l_home ?></b></font></a>
|
|
|
51 |
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarC" aria-controls="navbarC" aria-expanded="false" aria-label="Toggle navigation">
|
|
|
52 |
<span class="navbar-toggler-icon"></span>
|
|
|
53 |
</button>
|
|
|
54 |
<div class="collapse navbar-collapse" id="navbarC">
|
|
|
55 |
<ul class="navbar-nav mr-auto">
|
|
|
56 |
<li class="nav-item">
|
|
|
57 |
<a class="nav-link" href="index.php?url=www.euronews.com"><?=$l_login ?></a>
|
|
|
58 |
</li>
|
|
|
59 |
<li class="nav-item">
|
|
|
60 |
<a class="nav-link" href="email_registration_front.php"><?=$l_title ?></a>
|
|
|
61 |
</li>
|
|
|
62 |
</ul>
|
|
|
63 |
<span class="navbar-text">
|
|
|
64 |
<a href="contact.php" class="navbar-brand">Contact</a>
|
|
|
65 |
<a href="contact.php"><img src="images/organisme.png" width="40"></a>
|
|
|
66 |
</span>
|
|
|
67 |
</div>
|
2990 |
rexy |
68 |
</nav>
|
3026 |
rexy |
69 |
<div class="col-12 col-lg-10 offset-lg-1">
|
|
|
70 |
|
|
|
71 |
<?php require_once(__DIR__.'/header.php'); ?>
|
2990 |
rexy |
72 |
|
|
|
73 |
<section id="inscription" class="row">
|
3026 |
rexy |
74 |
<form name="master" id="contenu_acces" onsubmit="return false;" class="col-12 offset-lg-1 col-lg-10">
|
2990 |
rexy |
75 |
<div class="row input_row">
|
3026 |
rexy |
76 |
<div class="label_name col-3 col-lg-4"><?=$l_Email?></div>
|
|
|
77 |
<div class="col-6 col-lg-4">
|
2990 |
rexy |
78 |
<input type="email" placeholder="User@exemple.com" id="email" name="email" required class="form-control"/>
|
|
|
79 |
</div>
|
|
|
80 |
<small id="output_email" class="row"></small>
|
|
|
81 |
</div>
|
|
|
82 |
<div id="status">
|
3009 |
rexy |
83 |
<?=$l_mandatory?>
|
2990 |
rexy |
84 |
</div>
|
|
|
85 |
<div class="row input_row">
|
3026 |
rexy |
86 |
<div class="col-5 offset-xs-1 col-md-4 offset-md-2">
|
2990 |
rexy |
87 |
<input id="buttons" class="btn btn-default" value="Annuler" onclick="window.location.href = 'index.php';">
|
|
|
88 |
</div>
|
3026 |
rexy |
89 |
<div class="col-5 col-md-4">
|
2990 |
rexy |
90 |
<button type="submit" class="btn btn-primary btn-lg" id="buttons" >Inscription</button>
|
|
|
91 |
</div>
|
|
|
92 |
</div>
|
|
|
93 |
</form>
|
|
|
94 |
</section>
|
|
|
95 |
|
|
|
96 |
<script>
|
|
|
97 |
$(document).ready(function(){
|
|
|
98 |
$("#contenu_acces input").focus(function(){
|
|
|
99 |
$("#status").fadeOut(800);
|
|
|
100 |
});
|
|
|
101 |
|
|
|
102 |
//Traitement du formulaire d'inscription
|
|
|
103 |
$("#contenu_acces").submit(function(){
|
|
|
104 |
var status = $("#status");
|
|
|
105 |
var Fmail = $("#email").val();
|
|
|
106 |
|
|
|
107 |
$.ajax({
|
|
|
108 |
type: "post",
|
3009 |
rexy |
109 |
url: "email_registration_back.php",
|
2990 |
rexy |
110 |
data: {
|
|
|
111 |
'Fmail' : Fmail,
|
|
|
112 |
},
|
|
|
113 |
beforeSend: function(){
|
|
|
114 |
$("#status").attr("value", "Traitement en cours...");
|
|
|
115 |
},
|
|
|
116 |
success: function(data){
|
|
|
117 |
if (data.match("success")) {
|
|
|
118 |
status.html(data).fadeIn(400);
|
3009 |
rexy |
119 |
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 |
120 |
document.location.href="index.php";
|
|
|
121 |
} else {
|
|
|
122 |
console.log(data);
|
3026 |
rexy |
123 |
alert("Une erreur s'est produite.\n\nVeuillez renouveler votre inscription ou contacter votre administrateur.");
|
2990 |
rexy |
124 |
status.css("color", "red").html(data).fadeIn(400);
|
|
|
125 |
}
|
|
|
126 |
}
|
|
|
127 |
});
|
|
|
128 |
});
|
|
|
129 |
});
|
|
|
130 |
</script>
|
|
|
131 |
</div>
|
|
|
132 |
</body>
|
|
|
133 |
</html>
|