
$(document).ready( function () {
    $('.datatable').DataTable( {
        "scrollX": true,
        "pageLength": 25,
        "dom": 'Bfrtip',
        buttons: [{
		            extend: 'pdf',
		            title: 'Rapport de contrôle'
        		  },
          		  {
		            extend: 'excel',
		            title: 'Rapport de contrôle'
        		  }]
    } );
    
    $('#submit-form').submit(function(e) {
    	 e.preventDefault();
    	 
    	 $("body").addClass("loading");
    	 
    	 $('.error').html("");
    	 
    	 $("#submit-form > .please-wait").show();
    	 
    	 $(this).unbind("submit");
    	 $(this).submit();
	});
    
    $('select').niceSelect();    
} );
