
{% extends 'layout.twig' %}

{% block body %}
<script>

        
        function disableFieldOnbyOneById (id)
        {
			
            if($('#'+id+'_switch').is(':checked') )
            {
            	 $('#input_'+id).removeAttr("disabled");
            	 
            }else
            {

              	$('#input_'+ id).val('');
           
      		  	$('#input_'+id).attr("disabled", "disabled");
      		
      
            }


      }

</script>

                 <div class="contenu clearfix"  id="marche">
                    <h1>{{'Marché' | trad }}</h1>
                    
                    <ul class="nav nav-tabs">
                        <li><a href="{{ path('Contrat.marche.index') }}">{{'Marché' | trad }}</a></li>
                         <li class="active"><a class="onglet_ephemere" data-toggle="tab" href="#utilisateurs-autorises">{{'Utilisateurs autorisés' | trad }}</a></li>
					</ul>

                    <div class="tab-content">
                          <div id="utilisateurs-autorises" class="tab-pane fade in active">
                            <h2>
                                {{'Utilisateurs autorisés' | trad }}, {{ title.LIBELLE }} ({{ idMarche }})
{#                                 <a href="javascript:void(0)" class="button ajout principal " onclick="ajaxPopup ('{{ path('Contrat.utilisateur-autorise.ajoutNouvelleUtilisateur',  { 'idMarche' : idMarche }) }}', 'Ajouter un nouvel utilisateur', 'name', 'name')">Nouvel Utilisateur</a>#}
 							</h2>

                            <div class="tab-content">
                            	<div id="utilisateurs-criteres" class="tab-pane fade in active padding15">
                            
                                    <form method="post" id="form_import_critere" name="form_import_critere" class="box-form clearfix">
                                      	<div class="row">
                                      		<div class="colonne2">
                                      			<label>{{'Société' | trad }} :</label>
                                      			<label class="switch">
                                                    <input type="checkbox" name="CODESOC_switch" id="CODESOC_switch" onchange ="disableFieldOnbyOneById('CODESOC')" checked>
                                                    <span class="slider round" id="slider_societe"></span>
                                                    <span class="value_switch" id="value_switch">{{'Oui' | trad}}</span>
                                                </label>
                                      		</div>
                                      		<div class="colonne2 last">
												{{ inputZoom('', 'CODESOC', path('Ajax.liste.SocieteUtilisateurAutorise'), 'Société' | trad ,'Societe',post.CODESOC, '', '', '', '', '', '',
												"{'codeMarche' : '"~idMarche~"','codeSte' : '"~societeByMarche.STEMARCHE ?? ''~"'}", 'form-control full') }}	
                                      		</div>
                                      	</div>
                                      	<div class="row">
                                      		<div class="colonne2">
                                      			<label>{{'Centre émetteur' | trad }} :</label>
                                      			<label class="switch">
                                                    <input type="checkbox" name="CENTREMETTEUR_switch" id="CENTREMETTEUR_switch" onchange ="disableFieldOnbyOneById('CENTREMETTEUR')" checked >
                                                    <span class="slider round" id="slider_emetteur"></span>
                                                    <span class="value_switch" id="value_switch">{{'Oui' | trad}}</span>
                                                </label>
                                      		</div>
                                      		<div class="colonne2 last">
												{{ inputZoom('', 'CENTREMETTEUR', path('Ajax.liste.centreEmetteurUtilisateurAutorise'),'Centre Emetteur' | trad ,'Centre Emetteur',post.CENTREMETTEUR
												,'', '', '', '', '', '', "{'codeMarche' : '"~idMarche~"','codeSte' : '"~societeByMarche.STEMARCHE ?? ''~"', 'steSelected': document.getElementById('input_CODESOC').value}", 'form-control full') }}
                                      		</div>
                                      	</div>
                                      	<div class="row">
                                      		<div class="colonne2">
                                      			<label>{{'Centre de livraison' | trad}} :</label>
                                      			<label class="switch">
                                                    <input type="checkbox" name="" id="CENTRELIV_switch" onchange ="disableFieldOnbyOneById('CENTRELIV')" checked>
                                                    <span class="slider round" id="slider_centreDeLivraison"></span>
                                                    <span class="value_switch" id="value_switch">{{'Oui' |trad}}</span>
                                                </label>
                                      		</div>
                                      		<div class="colonne2 last">
												{{ inputZoom('', 'CENTRELIV', path('Ajax.liste.centreLivraisonUtilisateurAutorise'),'Centre Livraison' | trad,'Centre Livraison',post.CENTRELIV
													, '', '', '', '', '', '',"{'codeMarche' : '"~idMarche~"','codeSte' : '"~societeByMarche.STEMARCHE ?? ''~"', 'steSelected': document.getElementById('input_CODESOC').value}", 'form-control full') }}
                                      		</div>
                                      	</div>
                                      	<div class="row">
                                      		<div class="colonne2">
                                      			<label>{{'Section d\'imputation' | trad}} :</label>
                                      			<label class="switch">
                                                    <input type="checkbox" name="" id="SECTIMPU_switch" onchange ="disableFieldOnbyOneById('SECTIMPU')" checked >
                                                    <span class="slider round" id="slider_sectionImputation"></span>
                                                    <span class="value_switch" id="value_switch">{{'Oui' | trad }}</span>
                                                </label>
                                      		</div>
                                      		<div class="colonne2 last">
												{{ inputZoom('', 'SECTIMPU', path('Ajax.liste.sectionImpuUtilisateurAutorise'), 'Section d\'imputation' | trad |e('js')|raw,'Section d imputation',post.SECTIMPU
												, '', '', '', '', '', '', "{'codeMarche' : '"~idMarche~"','codeSte' : '"~societeByMarche.STEMARCHE ?? ''~"', 'steSelected': document.getElementById('input_CODESOC').value}", 'form-control full') }}
                                      		</div>
                                      	</div>
                                      	<div class="row">
                                      		<div class="colonne2">
                                      			<label>{{'Code complémentaire' | trad}} : </label>
                                      			<label class="switch">
                                                    <input type="checkbox" name="" id="CODECOMP_switch" onchange ="disableFieldOnbyOneById('CODECOMP')" checked>
                                                    <span class="slider round" id="slider_codeComp"></span>
                                                    <span class="value_switch" id="value_switch">{{'Oui' | trad }}</span>
                                                </label>
                                      		</div>
                                      		<div class="colonne2 last">
												{{ inputZoom('', 'CODECOMP', path('Ajax.liste.codeCompUtilisateurAutorise'),'Code complémentaire' | trad ,'Code completementaire'
												,post.CODECOMP, '', '', '', '', '', '', "{'codeMarche' : '"~idMarche~"','codeSte' : '"~societeByMarche.STEMARCHE ?? ''~"', 'steSelected': document.getElementById('input_CODESOC').value}", 'form-control full') }}
                                      		</div>
                                      	</div>
                                      	<div class="row">
                                      		<div class="colonne2">
                                      			<label>{{'Sous-compte d\'analyse' | trad}} :</label>
                                      			<label class="switch">
                                                    <input type="checkbox" name="" id="SOUSCOMPTANA_switch" onchange ="disableFieldOnbyOneById('SOUSCOMPTANA')" checked>
                                                    <span class="slider round" id="slider_sousCompteAna"></span>
                                                    <span class="value_switch" id="value_switch">{{'Oui' | trad }}</span>
                                                </label>
                                      		</div>
                                      		<div class="colonne2 last">
												{{ inputZoom('', 'SOUSCOMPTANA', path('Ajax.liste.sousCompteAnaUtilisateurAutorise'),'Sous-compte d\'analyse' | trad ,'Sous Compte d analyse'
												,post.SOUSCOMPTANA, '', '', '', '', '', '', "{'codeMarche' : '"~idMarche~"','codeSte' : '"~societeByMarche.STEMARCHE ?? ''~"', 'steSelected': document.getElementById('input_CODESOC').value}", 'form-control full') }}
                                      		</div>
                                      	</div>
                                      	<div class="row">
                                      		<div class="colonne2">
                                      			<label>{{'Centre d\'analyse' | trad}} :</label>
                                      			<label class="switch">
                                                    <input type="checkbox" name="" id="CENTREANA_switch" onchange ="disableFieldOnbyOneById('CENTREANA')" checked >
                                                    <span class="slider round" id="slider_centreAna"></span>
                                                    <span class="value_switch" id="value_switch">{{'Oui' | trad}}</span>
                                                </label>
                                      		</div>
                                      		<div class="colonne2 last">
												{{ inputZoom('', 'CENTREANA', path('Ajax.liste.centreAnalyseUtilisateurAutorise'),'Centre d\'analyse' | trad ,'Centre d\'analyse' | trad
												,post.CENTREANA, '', '', '', '', '', '',"{'codeMarche' : '"~idMarche~"','codeSte' : '"~societeByMarche.STEMARCHE ?? ''~"', 'steSelected': document.getElementById('input_CODESOC').value}", 'form-control full') }}
                                      		</div>
                                      	</div>
                                      	<div class="row">
                                      		<div class="colonne2">
                                      			<label>{{'Multi-société' | trad }} :</label>
                                      			<label class="switch">
                                                    <input type="checkbox" name="" id="MULTISOC_switch" onchange ="disableFieldOnbyOneById('MULTISOC')" checked>
                                                    <span class="slider round" id="slider_multiSoc"></span>
                                                    <span class="value_switch" id="value_switch">{{'Oui' | trad }}</span>
                                                </label>
                                      		</div>
                                      		<div class="colonne2 last">
												{{ inputSelect("","MULTISOC", critereMultiSociete, '', '','','','','','','full', false) }}
                                      		</div>
                                      	</div>
                                      	<div class="row border-top clearfix">
                                      		<button href="" type ="submit" class="button principal button_right">{{'Importer' | trad }}</a>
                                      		<button href="{{ Contrat.utilisateur-autorise.index }}" class="button secondaire button_right">{{'Annuler' | trad }}</button>
                                      	</div>
        							</form>
        						</div>
        					</div>
                          </div>
                    </div>
                </div>
            

{% endblock %}