echo "\n</table>"; print "{$rowsFound}"; } else { echo "\n\n Your search criteria did not match any data in the database"; } } if (!($connection = @mysql_connect(DB_HOST, DB_USER, DB_PW))) { die("Could not connect"); } $query = "SELECT wine_name, variety, year, winery_name,region_name,cost, on_hand\n,sum(qty),sum(price)\nFROM wine,winery,region,grape_variety,wine_variety,inventory, items\nWHERE wine.winery_id = winery.winery_id\nAND winery.region_id = region.region_id\nAND wine.wine_id = wine_variety.wine_id\nAND wine_variety.variety_id = grape_variety.variety_id\nAND wine.wine_id = inventory.wine_id\nAND wine.wine_id = items.wine_id\n"; if (isset($wine_name) && $wine_name != "") { $query .= " AND wine_name LIKE '{$wine_name}'"; } if (isset($winery_name) && $winery_name != "") { $query .= " AND winery_name LIKE '{$winery_name}'"; } if (isset($region) && $region != "All") { $query .= " AND region_name = '{$region}'"; } if (isset($variety) && $variety != "All") { $query .= " AND variety = '{$variety}'"; } if (isset($start) && isset($end)) { $query .= " AND year BETWEEN '{$start}' AND '{$end}'"; } if (isset($base_price) && isset($max_price)) { $query .= " AND cost BETWEEN '{$base_price}' AND '{$max_price}'"; } $query .= " GROUP BY wine_name, variety, year, \nwinery_name,region_name,cost"; displayList($connection, $query, $wine_name);
<?php $top_rating_movies = $db->query('SELECT id, title FROM movies ORDER BY rating DESC LIMIT 5')->fetchAll(); $most_recent_movies = $db->query('SELECT id, title FROM movies ORDER BY year DESC LIMIT 5')->fetchAll(); $random_movies = $db->query('SELECT id, title FROM movies ORDER BY RAND() LIMIT 5')->fetchAll(); $last_news = $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 displayList($top_rating_movies, 'Les 5 films les mieux notés', 'movie.php', 'primary'); echo displayList($most_recent_movies, 'Les 5 films les plus récents', 'movie.php', 'info'); echo displayList($random_movies, '5 films au hasard', 'movie.php', 'warning'); echo displayList($last_news, 'Les dernières actualités', 'article.php'); ?> </div> <!-- END SIDEBAR -->
<?php $same_genres_movies = getSimilarMovies($movie, 'genres'); $same_actors_movies = getSimilarMovies($movie, 'actors'); $same_directors_movies = getSimilarMovies($movie, 'directors'); $same_writers_movies = getSimilarMovies($movie, 'writers'); ?> <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar"> <?php echo displayList($same_genres_movies, 'Films des mêmes genres', 'movie.php', 'primary'); echo displayList($same_actors_movies, 'Films des mêmes acteurs', 'movie.php', 'info'); echo displayList($same_directors_movies, 'Films des mêmes réalisateurs', 'movie.php', 'default'); echo displayList($same_writers_movies, 'Films des mêmes auteurs', 'movie.php', 'warning'); ?> </div><!-- #sidebar -->
if ($_POST['mode'] == "test") { echo "Test successful. User="******"add") { echo addScore($_GET['user'], $_GET['score'], $_GET['desc']); } elseif ($_POST['mode'] == "add") { echo addScore($_POST['user'], $_POST['score'], $_POST['desc']); } elseif ($_GET['mode'] == "rss") { echoRSS(); } else { ?> <html> <head> <title>Scourge High Scores</title> <link rel=StyleSheet href="scourge.css" type="text/css"> </head> <body> <?php # save the version of scourge sent: # echo $_SERVER['HTTP_USER_AGENT']; displayList(); ?> </body> </html> <?php } } } ?>
function displayDetail($layout_def) { return displayList($layout_def); }