<?php 
    $dateData = get::jsonDateDataExcelProweb();
    $date = ($dateData != NULL) ? " (au " . core::convertDate($dateData) . ")" : "";
?>
<header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
    <h2 class="bd-title" id="content">
        <span>Base ProWeb : Liste des salariés<?php echo $date ?></span>
        <a href="proweb-salaries-upload.html" style="position: absolute; right: 0; margin: 0 40px 0 0;"><button type="submit" class="btn btn-outline-success btn-sm"><span data-feather="file-plus"></span> Importer un fichier Excel</button></a>
    </h2> 
</header>
<?php   
        echo core::filAriane(array(
            "current" => "Liste des salariés", 
            "arbo" => array( 
                "Proweb" => NULL,
                "Liste des salariés" => "proweb-salaries.html")
        )); 
?>
<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-search="true"
        data-show-columns-toggle-all="true"
        data-url="/json.php?file=salaries-proweb">
        <thead>
            <tr>
                <th data-sortable="true" data-field="idProweb" data-filter-control="input" data-formatter="selectFicheProweb" data-width="35">#</th>
                <th data-sortable="true" data-field="loginId" data-filter-control="input">Identifiant Proweb</th>
                <th data-sortable="true" data-field="loginIdRH" data-filter-control="input">Dif. RH</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="jourEntree" data-filter-control="input">Entrée Proweb</th>
                <th data-sortable="true" data-field="jourEntreeRH" data-filter-control="input">Entrée RH</th>
                <th data-sortable="true" data-field="jourSortie" data-filter-control="input">Sortie</th>
                <th data-sortable="true" data-field="lieu" data-filter-control="select">Localité</th>
                <th data-sortable="true" data-field="contrat" data-filter-control="select">Contrat</th>
                <th data-sortable="true" data-field="actif" data-filter-control="select">Actif</th>
                <th data-sortable="true" data-field="RHBase" data-filter-control="select">Base RH</th>
                <th data-sortable="true" data-field="error" data-filter-control="select">Erreur</th>
                <th data-sortable="true" data-field="errorJson" data-filter-control="input">Erreur info</th>
            </tr>
        </thead>
    </table> 
</div>

<script>
        function selectFicheProweb(value, row) { 
            return '<a href="<?php echo FICHE_SALARIE_PROWEB ?>' + row.idProweb + '" target="_blank" class="btn btn-secondary btn-sm" style="width:60px;">' + row.idProweb + '</a>'; 
        }
</script>