{% extends 'layout.twig' %}

{% import 'messagesysteme.twig' as msgSyst %}
{% import 'champs.twig' as form %}

{% block css %}
{% endblock %}

{% block content %}

<div id="page-resa" class="col-lg-12 col-md-12 col-xs-12">
	<div class="container">

		{% if d.msgErreur %}
			<div class="alert alert-danger" role="alert">
				{{d.msgErreur|raw}}
			</div>
		{% endif %}

		{% if d.msgOk %}
		<div class="alert alert-success" role="alert">
			{{d.msgOk|raw}}
		</div>
		{% endif %}

		<form id="frmContact" method="post" action="?p=creationcompte">
			<div id="formContact">

				<h2>Demande de création de compte</h2>
				<p>Vous pouvez demander la création d'un compte. Celui-ci sera actif uniquement après validation du gestionnaire.</p>

				<!-- Ligne nom prénom -->
				<div class="row">
					<div class="col-lg-6 col-md-6 col-xs-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon"><i class="fa-solid fa-user"></i></div>
								<input class="form-control" type="text" id="nom"  size="8" name="nom" placeholder="Votre nom" required />
							</div>
						</div>
					</div>
					<div class="col-lg-6 col-md-6 col-xs-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon"><i class="fa-solid fa-user"></i></div>
								<input class="form-control" type="text" size="8" id="prenom"  name="prenom" placeholder="Votre prénom" required />
							</div>
						</div>
					</div>
				</div>


				<!-- Email / Tel  -->
				<div class="row">
					<div class="col-lg-6 col-md-6 col-xs-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon"><i class="fa-solid fa-at"></i></div>
								<input class="form-control" type="email" id="email" size="8" name="email" placeholder="Votre adresse de courriel" required />
							</div>
						</div>
					</div>
					<div class="col-lg-6 col-md-6 col-xs-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon"><i class="fa-solid fa-phone"></i></div>
								<input class="form-control" type="text" size="8" maxlength="14" id="telephone" name="telephone" placeholder="Votre numéro de téléphone"/>
							</div>
						</div>
					</div>
				</div>


				<!-- Ligne password -->
				<div class="row">
					<div class="col-lg-6 col-md-6 col-xs-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon"><i class="fa-solid fa-lock"></i></div>
								<input class="form-control" type="password" size="8" maxlength="20" id="telephone" name="mdp1" placeholder="Choisisser un mot de passe {{d.caractMini}}" required/>
							</div>
						</div>
					</div>
					<div class="col-lg-6 col-md-6 col-xs-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon"><i class="fa-solid fa-lock"></i></div>
								<input class="form-control" type="password" size="8" maxlength="20" id="telephone" name="mdp2" placeholder="Re-saisir mot de passe" required/>
							</div>
						</div>
					</div>
				</div>
				<div>
					{{trad.pwd_toot_short}} 
					{% if settings.pass_nb_min == 1 %}, {{settings.pass_nb_min}} {{trad.pass_x_min}}{% endif %}
					{% if settings.pass_nb_min > 1 %}, {{settings.pass_nb_min}}  {{trad.pass_x_mins}}{% endif %}
					{% if settings.pass_nb_maj == 1 %}, {{settings.pass_nb_maj}} {{trad.pass_x_maj}}{% endif %}
					{% if settings.pass_nb_maj > 1 %}, {{settings.pass_nb_maj}} {{trad.pass_x_majs}}{% endif %}
					{% if settings.pass_nb_ch == 1 %}, {{settings.pass_nb_ch}}  {{trad.pass_x_ch}}{% endif %}
					{% if settings.pass_nb_ch > 1 %}, {{settings.pass_nb_ch}}  {{trad.pass_x_chs}}{% endif %}
					{% if settings.pass_nb_sp == 1 %}, {{settings.pass_nb_sp}} {{trad.pass_x_sp}}{% endif %}
					{% if settings.pass_nb_sp > 1 %}, {{settings.pass_nb_sp}} {{trad.pass_x_sps}}{% endif %}
				</div>

				<!-- Commentaire pour le gestionnaire -->
				<div class="row">
					<label for="commentaire">Commentaire pour le gestionnaire :</label>
					<textarea class="form-control" id="commentaire" name="commentaire" cols="30" rows="4"></textarea><br/>
				</div>

				{% if settings.fct_crea_cpt_captcha == 'y' %}
				<div class="row">
					<img src="./include/captcha.inc.php" />
					<input type="text" name="captcha" required />
					<br><br>
				</div>
				{% endif %}

				<!-- Boutons -->
				<div class="row">	
					<div class="col-lg-6 col-md-6 col-xs-12">
						<div class="form-group">
							<div>
								<input class="btn btn-primary" type="submit" name="submit" value="Envoyer la demande de création de compte">
								<input class="btn btn-danger" type="button" name="retouraccueil" value="Retour" onClick="javascript:location.href='javascript:history.go(-1)'">
							</div>
						</div>
					</div>
				</div>
			</div>
		 </form>
	</div>
</div>

{% endblock %}

{% block javascript %}
{% endblock %}