Example #1
0
        if (!isset($_SESSION['nbResultats'])) {
            $_SESSION['nbResultats'] = count($dao->findBySeason($_SESSION['selectedSeason']));
        }
        $liste = $dao->findBySeason($_SESSION['selectedSeason'], $page, $taillePage);
        break;
    case "cs":
        //category and season only
        if (!isset($_SESSION['nbResultats'])) {
            $_SESSION['nbResultats'] = count($dao->findBySeasonAndCategory($_SESSION['selectedCategory'], $_SESSION['selectedSeason']));
        }
        $liste = $dao->findBySeasonAndCategory($_SESSION['selectedCategory'], $_SESSION['selectedSeason'], $page, $taillePage);
        break;
    default:
        //none of them
        if (!isset($_SESSION['nbResultats'])) {
            $_SESSION['nbResultats'] = count($dao->findAll());
        }
        $liste = $dao->findAll($page, $taillePage);
}
$nbPages = (int) (($_SESSION['nbResultats'] - 1) / $taillePage) + 1;
if (count($categories) > 1) {
    $selectedCategory = isset($_SESSION['selectedCategory']) ? $_SESSION['selectedCategory'] : null;
    ?>
                            <select name="photosCategory" onchange="this.form.submit()">
                    <option value='all'>Toutes les cat&eacute;gories</option>

<?php 
    foreach ($categories as $value) {
        echo "<option value='" . $value . "' " . ($selectedCategory == $value ? $selected : "") . ">" . $value . "</option>";
    }
    ?>
Example #2
0
        case 'save':
            //TODO$p=$dao->findById($_REQUEST['id']);
            break;
        case 'hide':
            $dao->hide($_REQUEST['id']);
            break;
        case 'show':
            $dao->show($_REQUEST['id']);
            break;
        case 'del':
            $dao->delete($_REQUEST['id']);
            //TODO$p=$dao->findById($_REQUEST['id']);
    }
}
if ($afficheListe) {
    $liste = $dao->findAll(0, 0, 0);
    ?>
                 <table id="tListePhotos">
<?php 
    $cpt = 0;
    foreach ($liste as $v) {
        if ($cpt % 3 == 0) {
            echo "<tr class='photo'>";
        }
        echo "<td><img height='80' src='./" . $v->getLink() . "'" . ($v->isHidden() ? " class='cachee'" : "") . " />";
        ?>
                     <br /><a href="?action=edit&what=photo&id=<?php 
        echo $v->getId();
        ?>
"><img height="20" title="editer" src="images/edit.png" /></a>
<?php