示例#1
0
" role="button">Voir la fiche du film &raquo;</a></p>
						</div>
					</div>
					<!-- END BLOCK RANDOM MOVIE -->
					<?php 
}
?>

				</div><!-- .marketing -->

				<?php 
if (!empty($_SESSION['movies'])) {
    $movie_ids_array = array_keys($_SESSION['movies']);
    $movie_ids = implode(', ', $movie_ids_array);
    $movie_ids_order = 'ORDER BY id = ' . implode(' DESC, id = ', $movie_ids_array) . ' DESC';
    $visited_movies = Movie::_getList($db->query('SELECT * FROM movies WHERE id IN (' . $movie_ids . ') ' . $movie_ids_order)->fetchAll());
    /*
    $result = $db->query('SELECT * FROM movies WHERE id IN ('.$movie_ids.')')->fetchAll();
    $visited_movies = $_SESSION['movies'];
    foreach($result as $key => $movie) {
    	$visited_movies[$movie->id] = $movie;
    }
    */
    ?>
				<hr>

				<h1>Les derniers films visités</h1>

				<div id="visited-movies" class="row">

					<?php 
示例#2
0
			<?php 
$top_rating_movies = Movie::getList(5, 'rating DESC', 'id, title');
$most_recent_movies = Movie::getList(5, 'year DESC', 'id, title');
$random_movies = Movie::getList(5, 'RAND()', 'id, title');
$last_news = Movie::_getList($db->query('SELECT news_id as id, news_title as title FROM news ORDER BY news_date DESC LIMIT 5')->fetchAll());
?>

			<!-- SIDEBAR -->
			<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
				<?php 
echo Utils::displayList($top_rating_movies, 'Les 5 films les mieux notés', 'movie.php', 'primary');
echo Utils::displayList($most_recent_movies, 'Les 5 films les plus récents', 'movie.php', 'info');
echo Utils::displayList($random_movies, '5 films au hasard', 'movie.php', 'warning');
echo Utils::displayList($last_news, 'Les dernières actualités', 'article.php');
?>
			</div>
			<!-- END SIDEBAR -->