<!doctype html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="shortcut icon" href="{{ base() }}favicon.ico" type="image/x-icon">
        {{ titleHtml() }}
        <script type="text/javascript">
            var separateur = 'debut-----fin';
            var messageAttention = '{{ 'Non bloquant' | trad }}';
        </script>
        {{ skinCode() }}
        
        {% include '@GlobalApplication/Template/_script.twig' %}

        
        <meta charset="utf-8">
    </head>
    
    <body>
        {# utilisé pour les tooltip boostrap vue qu'on a pas les versions récente, on ne peut pas appliquer de class directement dessus #}
        {# DO NOT MOVE #}
        <div id="div_tooltip"></div>
        <div id='loader' style='display:none;'>
            <div id='picto_loader'>
            </div>
        </div>

        <div id="myModal" class="modal" tabindex="-1" role="dialog">

            <div id="modal-content" class="modal-content" style="z-index:99999">
                <div class="modal-header">
                    <span class="modal-close">&times;</span>
                    <h3 id="modal-title"></h3>
                </div>
                <div id="modal-body" style="z-index:99999;padding: 15px;">
                </div>
            </div>
        </div>

       <script> 
            	{% if post.ErreurValid or ErreurValid != '' %}
                    activePopupErreur("{{ path('Ajax.Erreur.popupErreurValid') }}", "{{'Erreur lors de la validation !' | trad }} " , "{{ErreurValid | raw}}");
    		    {% endif %}
	   </script>
	   <style>
       .dragIcon
       {
           margin-left: -6px;
       }
       .checkbox
       {
           top: 7px;
           left:6px;
       }
       #file-wrapuploadImageSignature
       {
           margin-top :16px;
       }
       .sans_hover:hover
       {
           border-color: transparent !important;
           background-color: transparent !important;
           cursor: default;
       }
       
       </style>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

        {{ bandeauOxaproc() }}

			<div class="contenu clearfix"  id="post">
                <h1>{{'Formulaire de demande de création de compte OXA.PROC' | trad }}</h1>
      			<ul class='nav nav-tabs sous_onglet'>
       				<li id="subAr1" class='active'><a class='onglet_ephemere' >{{'Coordonnées' | trad }}</a></li>
                    {% if param.AffichageAboProfil %}
                        <li id="subAr2"><a class='onglet_ephemere sans_hover' >{{'Abonnements' | trad }}</a></li>
                    {% endif %}
                    <li id="subAr3"><a class='onglet_ephemere sans_hover' >{{'Mots de passe' | trad }}</a></li>
        		</ul>
                	<div id="nouveau_post" class="clearfix padding-Vert15">
                    	<form method="post" name="formCreationCompte" id="formCreationCompte" class="box-form" enctype="multipart/form-data">	
                            {# Debut bloc coordonée #}
                                {% include '@index/creationCompte/coordonee.twig' %}
                            {# fin bloc coordonnée #} 

                            {# Début bloc Abonnements #}
                            {% if param.AffichageAboProfil %}
                                {% include '@index/creationCompte/abonnements.twig' %}
                            {% endif %}
                            {# fin bloc abonnement #} 
                            
                            {# Début bloc Mots de passe #}
                                {% include '@index/creationCompte/motDePasse.twig' %}
                            {# fin bloc Mot de passe #} 

                       </form>
                    </div>
        <script>var baseUrl ='{{ baseUrl() }}';</script>
        <script type="text/javascript" src="{{ baseUrl('js/menu.js') }}"></script>
        <script type="text/javascript" src="{{ baseUrl('js/parametre.js') }}" id="parametreJS"></script>
        <script type="text/javascript" src="{{ baseUrl('ext/bootstrap-notify-3.1.3/js/bootstrap-notify.min.js') }}"></script>
    
        <div id="footer" class="container-fluid footer clearfix">
        	<div>
        		{{ piedDePage() }}
            	<a href='https://www.oxalys.com' target='_blank'><img src="{{ baseUrl('IconeV2/Misc/logo-oxalys_50.png') }}"  style="width:75px;margin-top:10px"/></a>
           </div>
        </div>
                    </div>
            </div>
        </div>
    </div>
 </body>

<script>

function check(idField)
{ 
    var selected = [];
    
    $('#' + idField).find("input[type='checkbox']").each(function(ev) 
    {
        if(ev != 0)
        {
            selected.push($(this).attr('name'));
        }

        if ($(this).is(':checked')== true)
        {
            $('#' + $(this)[0]['id'] ).click();
        } 
        else  
        {
            $('#' + $(this)[0]['id']).click();
        }

    });
}

function testSmtp()
{
    $.ajax({
        url: {{ path('Index.CreationCompte.testeSMTP') | json }},
        type: 'POST',
        data: {
            login: $('#input_CODE_UTILISATEUR').val(), 
            password: $('#input_MessagerieMdp').val(), 
            email: $('#input_MAIL').val(),
        },
        success: function (data) {
            desactiveLoader();
            activePopupInfo(
                {{ 'Informations' | trad | json }},
                data,
                'modal_small'
            );
        },
        error: function(xhr) {
            desactiveLoader();
            activePopupError(
                {{ 'Erreur validation' | trad | json }},
                xhr.responseText,
                'modal_small'
            );
        }
    });
}




 function manageAffiche(blocActive, idBlocHidding1, idBlocHidding2)
 {
     $('#' + idBlocHidding1).css('display', 'none');
     $('#' + idBlocHidding2).css('display', 'none');
     $('#' + blocActive).attr('style', ''); 
 }

 function checkAbonnement(idField)
 { 
 	var valueCheck;
 	$('#'+idField).find('input').each(function(ev){
 		if(ev=='0')
 		{
     		valueCheck = $(this).is(':checked');
 		}
 		else
 		{
 			if(valueCheck)
 			{
 				$(this).attr('disabled', false);

 				
 				if( $(this).is('input:checkbox') ) {
     				$(this).click();
 				}
 				else
 				{					
     				$(this).parent().find('span').show();
 				}
 			}
 			else
 			{
 				if( $(this).is('input:checkbox') ) {
     				$(this).click();
 				}
 				else
 				{
     				$(this).parent().find('span').hide();
 				}
 				$(this).attr('disabled', true);
 			}
 		}
 	});
 }
 
 </script>
 
 </html>