cms.event-salaries.php 915 B

1234567891011121314151617181920212223
  1. <?php
  2. db::query("SELECT "
  3. . "" . DB_T_SALARIES . ".id, "
  4. . "" . DB_T_SALARIES . ".loginId, "
  5. . "" . DB_T_SALARIES . ".nom, "
  6. . "" . DB_T_SALARIES . ".prenom, "
  7. . "" . DB_T_SALARIES . ".sexe, "
  8. . "" . DB_T_SALARIES . ".contrat, "
  9. . "" . DB_T_SALARIES . ".lieu, "
  10. . "" . DB_T_SALARIES . ".actif, "
  11. . "IF(" . DB_T_EVENTS_INSCRITS . ".id_salarie IS NOT NULL, 1, 0) AS inscrit, "
  12. . "" . DB_T_EVENTS_INSCRITS . ".present "
  13. . "FROM " . DB_T_SALARIES . " "
  14. . "LEFT JOIN " . DB_T_EVENTS_INSCRITS . " ON " . DB_T_SALARIES . ".id = " . DB_T_EVENTS_INSCRITS . ".id_salarie "
  15. . "AND " . DB_T_EVENTS_INSCRITS . ".id_evenement = " . core::getGet("id"));
  16. $row = db::resultset();
  17. if (!empty($row)) {
  18. echo json_encode($row);
  19. exit();
  20. } else {
  21. exit();
  22. }