const $ = (id) => document.getElementById(id);

const tableau_carnet = new Tabulator("#tableau-carnet", {
    columns: [
        {"title": "Date", "field": "date"},
        {"title": "Nom de la station-service", "field": "nom_station"},
        {"title": "Type de carburant", "field": "type_carburant"},
        {"title": "Litres", "field": "litre"},
        {"title": "Litre/Prix (GNF)", "field": "prix"},
        {"title": "Montant total (GNF)", "field": "montant_total"},
        {"title": "Kilometrage", "field": "kilometrage"},
        {"title": "Observation", "field": "observation"},
        {"title": "Nom du chauffeur", "field": "nom_chauffeur"},
    ]
})

$("filtreMois").addEventListener("change", function () {
    tableau_carnet.setData(
        `${$("filtreMois").dataset.url}`, 
        {
            "id_vehicule": $("id_vehicule").value,
            "mois": this.value
        }
    )
})