Example #1
0
<?php

// deuxième page
include 'include_dao.php';
session_start();
// on precise le repertoire ou se trouve les fichiers templates et le répèrtoire ou on met les fichiers compilés (cache)
$template = new Template('template', 'cache');
$template->assign_var('LOG', FALSE);
$template->assign_var('LICENCE', FALSE);
// on precise la variable langage
$template->set_language_var($lang);
page_header('Gérer mes licences', 'Gérer mes licences', 'GERERLICENCES');
page_footer();
$template->set_filenames(array('body' => 'gererlicence.html'));
$adherents = new AdherentMySqlDAO();
if (isset($_SESSION['Nom'])) {
    $template->assign_var('LOG', TRUE);
    $adherentsQuery = $adherents->queryByIdDemandeur($_SESSION['idDemandeur']);
    if (is_null($adherentsQuery) == false) {
        $template->assign_var('LICENCE', TRUE);
        $clubs = new ClubMySqlDAO();
        $clubQuery = $clubs->queryAll();
        $ligue = new LigueMySqlDAO();
        $ligueQuery = $ligue->queryAll();
        foreach ($adherentsQuery as $key => $value) {
            $template->assign_block_vars('adherents', array('ID' => $value->idAdherent, 'NOM' => $value->nom, 'PRENOM' => $value->prenom, 'CLUB' => $clubQuery[$value->idCLub - 1]->nom, 'LIGUE' => $ligueQuery[$clubQuery[$value->idCLub - 1]->idLigue - 1]->libelle, 'NUMLICENCE' => $value->numLicence, 'ID' => $value->idAdherent));
        }
    } else {
        $template->assign_var('MESSAGE', "Aucune licence enregistrée, veuillez vous rendre <a href='ajouterlicence.php'>ici</a> afin d'en ajouter une.");
    }
} else {