{% extends 'base_frontend.html.twig' %}

{% block title %} Mon Profile {% endblock %}

{% block content %}
<!-- ============================================== HEADER : END ============================================== -->
<div class="breadcrumb">
	<div class="container">
		<div class="breadcrumb-inner">
			<ul class="list-inline list-unstyled">
				<li><a href="{{ path('frontend_home_index') }}">Profile</a></li>
				<li class='active'>Modifier </li>
			</ul>
		</div><!-- /.breadcrumb-inner -->
	</div><!-- /.container -->
</div><!-- /.breadcrumb -->

<div class="body-content">
	<div class="container">
		<div class="sign-in-page">
			<div class="row">
				<div class="col-md-12 col-sm-12">
                    
                    {{ form_start(formInfoPerso, {'attr': {'class': 'register-form outer-top-xs'}}) }}

                       <h3 class="">Vos informations personnelles</h3>

                       {% set formErrors = formInfoPerso.vars.errors.form.getErrors(true) %}
                        {% if formErrors|length %}
                            <div class="alert alert-danger">
                                <ul>
                                    {% for key,error in formErrors %}
                                        <li><strong>{{ error.message }}</strong></li>
                                    {% endfor %}
                                </ul>
                            </div>
                        {% endif %}

                        <br>
                            <div class="row">
                                <div class="col-md-3 col-sm-3">
                                    <div class="form-group">
                                        <label class="info-title">{{ form_label(formInfoPerso.firstname) }} <span>*</span></label>
                                        {{ form_widget(formInfoPerso.firstname, {'attr': {'class': 'form-control unicase-form-control text-input'}}) }}
                                        <span class="help-block">{{ form_errors(formInfoPerso.firstname) }}</span>
                                    </div>
                                </div>
                                <div class="col-md-3 col-sm-3">
                                    <div class="form-group">
                                        <label class="info-title">{{ form_label(formInfoPerso.lastname) }} <span>*</span></label>
                                        {{ form_widget(formInfoPerso.lastname, {'attr': {'class': 'form-control unicase-form-control text-input'}}) }}
                                        <span class="help-block">{{ form_errors(formInfoPerso.lastname) }}</span>
                                    </div>
                                </div>
                                <div class="col-md-3 col-sm-3"></div>
                            </div>

                            <div class="row">
                                <div class="col-md-3 col-sm-3">
                                    <div class="form-group">
                                        <label class="info-title">{{ form_label(formInfoPerso.gender) }} <span>*</span></label>
                                        {{ form_widget(formInfoPerso.gender, {'attr': {'class': 'form-control unicase-form-control text-input'}}) }}
                                        <span class="help-block">{{ form_errors(formInfoPerso.gender) }}</span>
                                    </div>
                                </div>
                                <div class="col-md-3 col-sm-3">
                                    <div class="form-group">
                                        <label class="info-title">{{ form_label(formInfoPerso.birthdate) }} <span>*</span></label>
                                        {{ form_widget(formInfoPerso.birthdate, {'attr': {'placeholder': 'dd/mm/yyyy'}}) }} 
                                        <span class="help-block">{{ form_errors(formInfoPerso.birthdate) }}</span>
                                    </div>
                                </div>
                                <div class="col-md-3 col-sm-3">
                                    <div class="form-group">
                                        <label class="info-title">{{ form_label(formInfoPerso.phoneNumber) }} <span>*</span></label>
                                        {{ form_widget(formInfoPerso.phoneNumber, {'attr': {'class': 'form-control unicase-form-control text-input'}}) }}
                                        <span class="help-block">{{ form_errors(formInfoPerso.phoneNumber) }}</span>
                                    </div>
                                </div>
                                
                                <div class="col-md-3 col-sm-3">
                                    {{ form_row(formInfoPerso.save, { 'label': "valider", 'attr': {'class': 'btn btn-primary'} }) }}
                                </div>
                            </div>
                        
                    {{ form_end(formInfoPerso) }}	

                </div>
                <!-- Sign-in -->		
            </div><!-- /.row -->
		</div>
        
    </div>
</div>

<br><br>
<div class="body-content ">
	<div class="container">
		<div class="sign-in-page">
			<div class="row">
				<!-- Sign-in -->			
                <div class="col-md-12 col-sm-12">
                    
                    {{ form_start(formInfoAdress, {'attr': {'class': 'register-form outer-top-xs'}}) }}

                        <h3 class="">Informations d'Adresse</h3>
                        
                        
                        {% set formErrorsAdress = formInfoAdress.vars.errors.form.getErrors(true) %}
                        {% if formErrorsAdress|length %}
                            <div class="alert alert-danger">
                                <ul>
                                    {% for key,error in formErrorsAdress %}
                                        <li><strong>{{ error.message }}</strong></li>
                                    {% endfor %}
                                </ul>
                            </div>
                        {% endif %}
                        <br>
                        <div class="row">
                            <div class="col-md-2 col-sm-2">
                                <div class="form-group">
                                    <label class="info-title">{{ form_label(formInfoAdress.country) }}<span>*</span></label>
                                    {{ form_widget(formInfoAdress.country, {'attr': {'class': 'form-control unicase-form-control text-input'}}) }}
                                    <span class="help-block">{{ form_errors(formInfoAdress.country) }}</span>
                                </div>
                           </div>
                            <div class="col-md-4 col-sm-4 col-md-offset-1">
                                <div class="form-group">
                                    <label class="info-title">{{ form_label(formInfoAdress.zip) }}<span>*</span></label>
                                    {{ form_widget(formInfoAdress.zip, {'attr': {'class': 'form-control unicase-form-control text-input'}}) }}
                                    <span class="help-block">{{ form_errors(formInfoAdress.zip) }}</span>
                                </div>
                            </div>
                            <div class="col-md-2 col-sm-2"></div>
                            <div class="col-md-8 col-sm-8">
                                <div class="form-group">
                                    <label class="info-title">{{ form_label(formInfoAdress.adresse) }}<span>*</span></label>
                                    {{ form_widget(formInfoAdress.adresse, {'attr': {'class': 'form-control unicase-form-control text-input'}}) }}
                                    <span class="help-block">{{ form_errors(formInfoAdress.adresse) }}</span>
                                </div>
                            </div>
                            <div class="col-md-2 col-sm-2 col-md-offset-1">
                                {{ form_row(formInfoAdress.save, { 'label': "valider", 'attr': {'class': 'btn btn-primary'} }) }}
                            </div>
                            
                        </div>

                            
                    {{ form_end(formInfoAdress) }}	


                </div>
                <!-- Sign-in -->		
            </div><!-- /.row -->
		</div><!-- /.sigin-in-->
        
    </div>
</div>

<br><br>
<div class="body-content ">
	<div class="container">
		<div class="sign-in-page">
			<div class="row">
				<!-- Sign-in -->			
                <div class="col-md-12 col-sm-12">
                    
                    {{ form_start(formInfoCnx, {'attr': {'class': 'register-form outer-top-xs'}}) }}

                        <h3 class="">Vos informations de connexion au site</h3>
                        
                        {% set formErrorsAdress = formInfoCnx.vars.errors.form.getErrors(true) %}
                        {% if formErrorsAdress|length %}
                            <div class="alert alert-danger">
                                <ul>
                                    {% for key,error in formErrorsAdress %}
                                        <li><strong>{{ error.message }}</strong></li>
                                    {% endfor %}
                                </ul>
                            </div>
                        {% endif %}
                        <br>
                        <div class="row">
                            <div class="col-md-4 col-sm-4">
                                <div class="form-group">
                                    <label class="info-title">{{ form_label(formInfoCnx.pseudo) }}</label>
                                    {{ form_widget(formInfoCnx.pseudo, {'attr': {'class': 'form-control unicase-form-control text-input'}}) }}
                                    <span class="help-block">{{ form_errors(formInfoCnx.pseudo) }}</span>
                                </div>
                           </div>
                            <div class="col-md-4 col-sm-4">
                                <div class="form-group">
                                <label class="info-title">{{ form_label(formInfoCnx.email) }} <span>*</span></label>
                                {{ form_widget(formInfoCnx.email, {'attr': {'class': 'form-control unicase-form-control text-input'}}) }}
                                <span class="help-block">{{ form_errors(formInfoCnx.email) }}</span>
                            </div>
                            </div>
                            <div class="col-md-2 col-sm-2 col-md-offset-1">
                                {{ form_row(formInfoCnx.save, { 'label': "valider", 'attr': {'class': 'btn btn-primary'} }) }}
                            </div>
                            
                        </div>

                    {{ form_end(formInfoCnx) }}	

                </div>
                <!-- Sign-in -->		
            </div><!-- /.row -->
		</div><!-- /.sigin-in-->
        
    </div>
</div>
<br><br>
<div class="body-content ">
	<div class="container">
		<div class="sign-in-page">
			<div class="row">
				<!-- Sign-in -->			
                <div class="col-md-12 col-sm-12">
                    <h3 class="">Gestion de votre compte</h3>
                    <br>
                    <div class="row">
                        <div class="col-md-12 col-sm-12">
                            <font size="4">
                                <p class="text">
                                    Nous nous engagons à protéger vos données personnelles et à ne pas en faire un usage commercial sans votre accord. 
                                    Notre politique en matière de données personnelles est disponible en <b><a href="{{ path('frontend_footer_mentionslegales') }}">cliquant ici</a></b>. 
                                </p>
                            </font>
                            <br>
                       </div>
                       
                        <div class="col-md-4 col-sm-4">
                            <a href="{{ path('frontend_user_update_password', {id:app.user.id} ) }}" class="btn btn-info btn-lg">Changer de mot de passe</a>
                        </div>
                        <div class="col-md-4 col-sm-4">
                            <button class="btn btn-danger btn-lg" data-toggle="modal" data-target="#ModalRemoveUser">Supprimer mon compte</button>
                        </div>
                    </div>
                </div>
                <!-- Sign-in -->		
            </div><!-- /.row -->
		</div><!-- /.sigin-in-->
        
    </div>
</div>
<br><br>

<div class="modal fade" tabindex="-1" role="dialog" id="ModalRemoveUser">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Supprimer mon compte</h5>
            </div>
            <div class="modal-body">
                <p>Êtes-vous sûr de vouloir supprimer votre compte ?</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
                <a href="{{ path ('frontend_user_delete') }}" class="btn btn-danger">Supprimer mon compte</a>
                
            </div>
        </div>
    </div>
</div>
{% endblock %}