LoadTemplate('../html/tbs_index.html') ; $NbParticipants = $Db->GetVal("SELECT COUNT(*) FROM DIM_PARTICIPANT WHERE PARTICIPE = 1"); $TBS->MergeBlock ( 'blkPays,blkPays2', $Db->TbsKey, "SELECT CASE WHEN PAYS IS NULL THEN 'xx' ELSE LCASE(PAYS) END AS 'COUNTRY', COUNT(*) AS 'NB' FROM DIM_PARTICIPANT WHERE PARTICIPE = 1 GROUP BY PAYS ORDER BY 1" ); $TBS->MergeBlock ( 'blkPrevious', $Db->TbsKey, "SELECT ANNEE, count( DISTINCT PERE ) AS 'NB' FROM LIEN_PARTICIPANT_PREVIOUS GROUP BY ANNEE ORDER BY 1 ASC" ); $TBS->MergeBlock ( 'blkTotaux', $Db->TbsKey, "SELECT COUNT(*) AS 'NB', SUM(JEU_TROUVE) AS 'TROUVE', SUM(JEU_EXPEDIE) AS 'EXPEDIE', SUM(JEU_RECEPTIONNE) AS 'RECU' FROM `LIEN_PARTICIPANTS` "); $TBS->MergeBlock ( 'blkCadeaux', $Db->TbsKey, "SELECT CONCAT(CADEAUX, ', ') AS 'CAD' FROM LIEN_PARTICIPANT_PREVIOUS WHERE ANNEE = $annee AND CADEAUX != '' ORDER BY CADEAUX ASC" ); $Db->Close(); $TBS->Show() ; ?>