<?php

if (core::ifPost("from") AND core::getPost("from") == "rh-excel-to-temp") {
    // Nettoyage de la table temporaire des salairés
    salaries::clean_tmp();
    salaries::create_tmp(core::getPost("excel"));
    salaries::excel_update_in_progress(core::getPost("excel"), 1);
    $new_salaries = salaries::get_excel_array(core::getPost("excel"));

    if (isset($new_salaries)) {
        salaries::update_temp_salaries($new_salaries, core::getPost("excel"));
        salaries::update_inactive_temp_salarie();
    }
    header("Location: /rh-import-to-temp.html");
    exit();
} else {
    header('HTTP/1.0 401 Unauthorized');
    exit();
}

