
{% extends '@ajax-layout/layout.twig' %}

{% block body %}

<div id="stats_incidents">
    
    <form method="post" name="form_stats-incidents" id="form_stats-incidents" class="box-form">
    	<fieldset class="scheduler-border">
    		<legend class="scheduler-border">{{ "Saisie du trimestre d'origine" | trad }}</legend>
        	<div class="row">
        		<label>{{ 'A partir du trimestre' | trad }} :</label>
        		{{ inputSelect("","trim_debut", trimestre, '','','','','','','','',false) }}
        		{{ inputSelect("","annee_debut", annee, '','','','','','','','',false) }}
        	</div>
        	<div class="row">
        		<label>{{ "Jusqu'au trimestre" | trad }}</label>
                {{ inputSelect("","trim_fin", trimestre, '','','','','','','','',false) }}
                {{ inputSelect("","annee_fin", annee, '','','','','','','','',false) }}
        	</div>
    	</fieldset>
    	<div class="modal-footer">
             <button type="button" class="button secondaire" onClick='desactivePopup();'>{{ 'Fermer' | trad }}</button>
             <button type="button" class="button principal" onClick='statsIncident("{{ path('Fournisseur.popupHistorique.statsIncident', {id:id}) }}");'>{{ 'Valider' | trad }}</button>
    	</div>
	</form>
	
</div>   

<script>

function statsIncident(path)
{
	activeLoader();
	$.ajax({
	  	dataType : 'html',
    	url: path,
    	data: $('#form_stats-incidents').serialize(),
    	type: "POST",
    	success: function(result){
    		desactivePopup();
    		desactiveLoader();
    		window.open(result);
    	}
    });
}

</script>

{% endblock %}