<?php

if(core::ifPost("event") AND core::ifPost("from")){
    
    db::query("DELETE FROM " . DB_T_EVENTS_INSCRITS . " WHERE id_evenement = :id_evenement AND id_salarie = :id_salarie");
    db::bind(':id_evenement', core::getPost("event"));
    db::bind(':id_salarie', core::getPost("salarie"));
    db::execute();
    
    alert::recSuccess("Désinscription de ". core::getPost("texte"));
    alert::recTab("inscrits-tab");
    
    header("Location: /evenement-" . core::getPost("event").".html");
    exit();
}
