Exemplo n.º 1
0
            $to = $ag['g_schedTo'];
            $is_closed = $ag['g_isClosed'];
            if ($is_closed or $now > $to and $ag['g_isClosed'] == 0) {
                $games[] = $ag;
            }
        }
        $data = filterAllGames($games, $sort, $cat);
    } else {
        // live
        foreach ($all_games as $ag) {
            $now = time();
            $from = $ag['g_schedFrom'];
            $to = $ag['g_schedTo'];
            $is_closed = $ag['g_isClosed'];
            if (!$is_closed and $now > $from and $now < $to) {
                $games[] = $ag;
            }
        }
        $data = filterAllGames($games, $sort, $cat);
    }
    // sort it
    $data = sortGames($data, $sort);
}
// if $all_games
$total_data = count($data);
if ($user_id) {
    $user_coins = getUserCoins2($user_id);
    // how much coins does the user have?
    $_SESSION['user_coins'] = $user_coins;
}
include $basedir . '/views/index_v.php';
Exemplo n.º 2
0
    $stmt->execute();
    return $stmt->fetch();
}
//Gets piblishers, genres and ratings
$gamePublishers = getList('game_publishers', 'publisherName');
$gameGenres = getList('game_genres', 'genreName');
$gameRatings = getList('game_ratings', 'ratingName');
//Checks which filter button was submitted and gets appropriate list
if (isset($_POST['filterGenre'])) {
    $gameNames = filterGames('gameGenre', $_POST['genreId']);
} elseif (isset($_POST['filterPublisher'])) {
    $gameNames = filterGames('gamePublisher', $_POST['publisherId']);
} elseif (isset($_POST['filterRatings'])) {
    $gameNames = filterGames('gameRating', $_POST['ratingId']);
} elseif (isset($_POST['sortGames'])) {
    $gameNames = sortGames($_POST['sortingMethod']);
} else {
    $gameNames = getGames();
}
?>

<!DOCTYPE html>
<html lang="en">
	<head>
		<title>GAME STOP</title>
		<link rel="stylesheet" type="text/css" href="main.css" />
		<link href='https://fonts.googleapis.com/css?family=Black+Ops+One' rel='stylesheet' type='text/css'>
	</head>
	<body>
		<div id="wrapper">
			<header>