{% extends 'layout.twig' %}

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

{% block css %}
	<link rel="stylesheet" href="../vendor/almasaeed2010/adminlte/plugins/summernote/summernote-bs5.min.css">
	<link rel="stylesheet" href="../vendor/almasaeed2010/adminlte/plugins/toastr/toastr.min.css">
{% endblock %}

{% block content %}
	<div class="row">
        <div class="col col-12 col-sm-12">
            <div class="card card-primary card-outline card-tabs">
              <div class="card-header p-0 pt-1 border-bottom-0">
                <ul class="nav nav-tabs" id="custom-tabs-three-tab" role="tablist">
                  <li class="nav-item">
                    <a class="nav-link" id="custom-tabs-three-home-tab" href="?p=admin_config">{{ trad.admin_config1 }}</a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link" id="custom-tabs-three-profile-tab" href="?p=admin_config6">{{ trad.admin_config6 }}</a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link" id="custom-tabs-three-messages-tab" href="?p=admin_config2">{{ trad.admin_config2 }}</a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link" id="custom-tabs-three-settings-tab" href="?p=admin_config3">{{ trad.admin_config3 }}</a>
                  </li>
				  <li class="nav-item">
                    <a class="nav-link active" id="custom-tabs-three-profile-tab" href="?p=admin_config7">{{ trad.admin_config7 }}</a>
                  </li>
				  <li class="nav-item">
                    <a class="nav-link" id="custom-tabs-three-settings-tab" href="?p=admin_config4">{{ trad.admin_config4 }}</a>
                  </li>
				  <li class="nav-item">
                    <a class="nav-link" id="custom-tabs-three-settings-tab" href="?p=admin_config5" >{{ trad.admin_config5 }}</a>
                  </li>
                </ul>
              </div>
              <div class="card-body">
				  <div class="tab-pane active" id="fa-icons">
					<form action="?p=admin_config7" id="nom_formulaire" method="post">
						<input type="hidden" name="p" value="admin_config7" />


						<div class="card-body">
							<div class="row">
								<div class="col col-5 col-sm-3">
									<div class="nav flex-column nav-tabs h-100" id="vert-tabs-tab" role="tablist" aria-orientation="vertical">
										<a class="nav-link active" id="vert-tabs-divers-tab" data-bs-toggle="pill" href="#vert-tabs-divers" role="tab" aria-controls="vert-tabs-divers" aria-selected="true">Divers</a>
										<a class="nav-link" id="vert-tabs-formresa-tab" data-bs-toggle="pill" href="#vert-tabs-formresa" role="tab" aria-controls="vert-tabs-formresa" aria-selected="true">{{ trad.display_mail_etat_destinataire }}</a>
										<a class="nav-link" id="vert-tabs-creacompte-tab" data-bs-toggle="pill" href="#vert-tabs-creacompte" role="tab" aria-controls="vert-tabs-creacompte" aria-selected="false">Demande de création de compte</a>
										<a class="nav-link" id="vert-tabs-performance-tab" data-bs-toggle="pill" href="#vert-tabs-performance" role="tab" aria-controls="vert-tabs-performance" aria-selected="false">Performance</a>
									</div>
								</div>
								<div class="col col-7 col-sm-9">
									<div class="tab-content" id="vert-tabs-tabContent">

										<!-- Divers -->
										<div class="tab-pane text-left fade active show" id="vert-tabs-divers" role="tabpanel" aria-labelledby="vert-tabs-divers-tab">

											<!-- Périodicité -->
											<div class="form-group row row col-sm-12">
												<label class="col col-sm-6" for="periodicite">{{ trad.periodicite_msg }}</label>
												<div class="col col-sm-6 control-label">
													<input type="checkbox" name="periodicite" {% if settings.periodicite == 'y' %}checked{% endif %} data-bootstrap-switch>
												</div>
											</div>

											<hr>

											<!-- Gestion par courrier -->
											<div class="form-group row row col-sm-12">
												<label class="col col-sm-6" for="show_courrier">{{ trad.courrier_msg }}</label>
												<div class="col col-sm-6 control-label">
													<input type="checkbox" name="show_courrier" {% if settings.show_courrier == 'y' %}checked{% endif %} data-bootstrap-switch>
												</div>
											</div>

											<hr>

											<!-- Fonction échange réservation -->
											<div class="form-group row row col-sm-12">
												<label class="col col-sm-6" for="fct_echange_resa">{{ trad.swapentry }}</label>
												<div class="col col-sm-6 control-label">
													<input type="checkbox" name="fct_echange_resa" {% if settings.fct_echange_resa == 'y' %}checked{% endif %} data-bootstrap-switch>
												</div>
											</div>
										</div>

										<!-- Formulaire de contact réservation -->
										<div class="tab-pane fade" id="vert-tabs-formresa" role="tabpanel" aria-labelledby="vert-tabs-formresa-tab">
											<h4 class="page-header">{{ trad.display_mail_etat_destinataire }} </h4>
											<p>{{ trad.display_mail_etat_destinataire_1 }}</p>
											<input type="radio" name="mail_etat_destinataire" value="0" id="label_0a" {% if settings.mail_etat_destinataire == '0' %} checked {% endif %} /> <label for="label_0a">{{ trad.display_mail_etat_destinataire_2 }}</label><br>
											<input type="radio" name="mail_etat_destinataire" value="1" id="label_0b" {% if settings.mail_etat_destinataire == '1' %} checked {% endif %} /> <label for="label_0b">{{ trad.display_mail_etat_destinataire_3 }}</label><br>
											<input type="radio" name="mail_etat_destinataire" value="2" id="label_0c" {% if settings.mail_etat_destinataire == '2' %} checked {% endif %} /> <label for="label_0c">{{ trad.display_mail_etat_destinataire_4 }}</label><br>
											{{ form.input('mail_destinataire', trad.display_mail_destinataire, settings.mail_destinataire, {classGroup: 'col-sm-12', classLabel: 'col-sm-6', classInput: 'col-sm-6 control-label'}) }}
											<input type="checkbox" name="mail_user_destinataire" value="y" id="label_0z" {% if settings.mail_user_destinataire == 'y' %} checked {% endif %} /> <label for="label_0z">{{ trad.mail_user_destinataire }}</label><br>
											<input type="checkbox" name="mail_contact_resa_captcha" value="y" id="label_0y" {% if settings.mail_contact_resa_captcha == 'y' %} checked {% endif %} /> <label for="label_0z">{{ trad.captcha_utiliser }}</label><br>
											<br><br>
											<h5>Texte avant le formulaire :</h5>
											<br>
											<textarea id="summernote" name="textecontactresa" rows="100" cols="80">{{ d.contactresa[1] }}</textarea>
										
										</div>

										<!-- Demandes de création de compte -->
										<div class="tab-pane fade" id="vert-tabs-creacompte" role="tabpanel" aria-labelledby="vert-tabs-creacompte-tab">
											<div class="form-group row row col-sm-12">
												<label class="col-sm-6" for="fct_crea_cpt"><h4 class="page-header">Demande de création de compte</h4></label>
												<div class="col-sm-6 control-label">
													<input type="checkbox" name="fct_crea_cpt" {% if settings.fct_crea_cpt == 'y' %}checked{% endif %} data-bootstrap-switch>
												</div>
											</div>

											<p>Permettre aux personnes non connectées de demander la création d'un compte. L'utilisateur devra renseigner son nom, prénom, email et mot de passe, une fois. Le gestionnaire d'utilisateur ou l'administrateur pourra valider ou non la demande en lui assignant un identifiant et un statut.</p>
						
											<p class="text-danger"><b>Avertissement :</b> Il est conseillé d'activer l'envoi de mails, dans le cas contraire l'utilisateur ne pourrait recevoir son identifiant.</p>

											<div class="form-group row row col-sm-12">
												<label class="col-sm-6" for="fct_creation_compte_identifiant"><p>Par défaut l'identifiant est sous le format :</p></label>
												<div class="col-sm-6 control-label">
													<select class="form-control" name="fct_crea_cpt_login">
														<option value="1" {% if settings.fct_crea_cpt_login == '1' %} selected {% endif %}>NOM</option>
														<option value="2" {% if settings.fct_crea_cpt_login == '2' %} selected {% endif %}>NOM.PRENOM</option>
														<option value="3" {% if settings.fct_crea_cpt_login == '3' %} selected {% endif %}>NOMPRENOM</option>
														<option value="4" {% if settings.fct_crea_cpt_login == '4' %} selected {% endif %}>PRENOM</option>
														<option value="5" {% if settings.fct_crea_cpt_login == '5' %} selected {% endif %}>P.NOM</option>
														<option value="6" {% if settings.fct_crea_cpt_login == '6' %} selected {% endif %}>PNOM</option>
														<option value="7" {% if settings.fct_crea_cpt_login == '7' %} selected {% endif %}>PR.NOM</option>
														<option value="8" {% if settings.fct_crea_cpt_login == '8' %} selected {% endif %}>PRENOM.NOM</option>
														<option value="9" {% if settings.fct_crea_cpt_login == '9' %} selected {% endif %}>PRENOMNOM</option>
														<option value="9" {% if settings.fct_crea_cpt_login == '9' %} selected {% endif %}>E-Mail</option>
													</select>
												</div>
											</div>


											<div class="form-group row row col-sm-12">
												<label class="col-sm-6" for="fct_creation_compte_statut"><p>Statut par défaut :</p></label>
												<div class="col-sm-6 control-label">
													<select class="form-control" name="fct_crea_cpt_statut">
														<option value="1" {% if settings.fct_crea_cpt_statut == '1' %} selected {% endif %}>Visiteur</option>
														<option value="2" {% if settings.fct_crea_cpt_statut == '2' %} selected {% endif %}>Usager</option>
													</select>
												</div>
											</div>
											<input type="checkbox" name="fct_crea_cpt_captcha" value="y" id="label_3y" {% if settings.fct_crea_cpt_captcha == 'y' %} checked {% endif %} /> <label for="label_0z">{{ trad.captcha_utiliser }}</label><br>

										</div><!---->

										<!-- Performance -->
										<div class="tab-pane fade" id="vert-tabs-performance" role="tabpanel" aria-labelledby="vert-tabs-performance-tab">

											<!-- Calcul plage libre vue semaine_all -->
											<div class="form-group row row col-sm-12">
												<label class="col col-sm-6" for="calcul_plus_semaine_all">Calcul plage libre vue semaine ALL</label>
												<div class="col col-sm-6 control-label">
													<input type="checkbox" name="calcul_plus_semaine_all" {% if settings.calcul_plus_semaine_all == 'y' %}checked{% endif %} data-bootstrap-switch>
												</div>
											</div>

											<!-- Calcul plage libre vue mois -->
											<div class="form-group row row col-sm-12">
												<label class="col col-sm-6" for="calcul_plus_mois">Calcul plage libre vue mois</label>
												<div class="col col-sm-6 control-label">
													<input type="checkbox" name="calcul_plus_mois" {% if settings.calcul_plus_mois == 'y' %}checked{% endif %} data-bootstrap-switch>
												</div>
											</div>

											<!-- Calcul plage libre vue mois2_all -->
											<div class="form-group row row col-sm-12">
												<label class="col col-sm-6" for="calcul_plus_mois2_all">Calcul plage libre vue mois ALL</label>
												<div class="col col-sm-6 control-label">
													<input type="checkbox" name="calcul_plus_mois2_all" {% if settings.calcul_plus_mois2_all == 'y' %}checked{% endif %} data-bootstrap-switch>
												</div>
											</div>

											<hr>



										</div>

									</div>
								</div>
							</div>
						</div>

						<hr>

						<div style="text-align:center;">
							<input class="btn btn-primary" type="submit" name="ok" value="{{ trad.save }}" />
						</div>
					</form>
				  </div><!-- /.tab-pan -->
			  </div><!-- /.card-body -->

			</div><!-- /.card-primary -->
		</div><!-- /.col -->
	</div><!-- /.row -->
{% endblock %}

{% block javascript %}
	<script src="../vendor/almasaeed2010/adminlte/plugins/summernote/summernote-bs5.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/toastr/toastr.min.js"></script>
	<script src="../vendor/almasaeed2010/adminlte/plugins/bootstrap-switch/js/bootstrap-switch.min.js"></script>
	<script type="text/javascript">

		$(function(){
			// Summernote
			$('#summernote').summernote({
				toolbar: [
					// [groupName, [list of button]]
					['style', ['style']],
					['style', ['bold', 'italic', 'underline', 'clear']],
					['font', ['strikethrough', 'superscript', 'subscript']],
					['fontsize', ['fontsize']],
					['color', ['color']],
					['para', ['ul', 'ol', 'paragraph']],
					['height', ['height']],
					['fontname', ['fontname']],
					['table', ['table']],
					['insert', ['link', 'picture', 'video']],
					['view', ['fullscreen', 'codeview', 'help']]
				]
			});

			$("input[data-bootstrap-switch]").each(function(){
   			  $(this).bootstrapSwitch('state', $(this).prop('checked'));
  			})

			{%if d.enregistrement%}
				{%if d.enregistrement == 1 %}
					toastr.success("{{trad.message_records}}")
				{% else %}
					toastr.warning("{{d.enregistrement|raw}}")
				{%endif%}
			{%endif%}
		})

	</script>

{% endblock %}