<?php 
    $dateData = get::jsonDateDataExcel();
    $date = ($dateData != NULL) ? " (au " . core::convertDate($dateData, FALSE) . ")" : "";

    $jsonTarget = "/json.php?file=salaries";
    if(debug::isFile("debug")){
        debug::log(debug::getBadge($jsonTarget, "OUVRIR LE JSON : ".$jsonTarget), "JSON chargé en arrière plan");
    } 
?>
<header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
    <h2 class="bd-title" id="content">
        <span>RH : Liste des salariés<?php echo $date ?></span>
    </h2>
    <?php if(access::ifAccesss("rh-upload-excel")){ ?>
    <div class="fix-container-button-nav">
        <a href="/rh-upload-excel.html" class="fix-button-nav"><button type="submit" class="btn btn-outline-success btn-sm"><?php icon::getFont(["icon" => "bi bi-file-earmark-plus"]) ?> Importer un fichier Excel</button></a>
    </div>
    <?php } ?>
</header>
<?php   
        echo core::filAriane(array(
            "current" => "Liste des salariés", 
            "arbo" => array( 
                "Salariés" => NULL, 
                "Liste des salariés" => "/")
        )); 
?>
<div>
    <table
        id="table"
        class="table-striped table-hover table-sm" 
        data-page-size="25"
        data-toggle="table"
        data-show-columns="true"
        data-search="true"
        data-buttons-align="left"
        data-pagination="true"
        data-filter-control="true"
        data-flat="true"
        data-url="<?php echo $jsonTarget ?>">
        <thead>
            <tr>
                <th data-sortable="true" data-field="idLocal" data-filter-control="input">Id Capgemini</th>
                <th data-sortable="true" data-field="loginId" data-filter-control="input">Identifiant</th>
                <th data-sortable="true" data-field="nom" data-filter-control="input">Nom</th>
                <th data-sortable="true" data-field="prenom" data-filter-control="input">Prénom</th>
                <th data-sortable="true" data-field="sexe" data-filter-control="select">Sexe</th>
                <th data-sortable="true" data-field="texteContrat" data-filter-control="select">Statut Contrat</th>
                <th data-sortable="true" data-field="jourEntree" data-filter-control="input">Date d'entrée</th>
                <th data-sortable="true" data-field="repriseContrat" data-filter-control="input">Date de reprise</th>
                <th data-sortable="true" data-field="jourSortie" data-filter-control="input">Date de sortie</th>
                <th data-sortable="true" data-field="lieu" data-filter-control="select">Localité</th>
                <th data-sortable="true" data-field="texteActif" data-filter-control="select">Actif</th>
            </tr>
        </thead>
    </table> 
</div>


