56 lines
1.6 KiB
PHP
56 lines
1.6 KiB
PHP
<?php
|
|
require_once '_inc.php';
|
|
|
|
$gameId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
|
|
|
|
$getGame = $pdo->prepare('
|
|
SELECT *
|
|
FROM `col_games`
|
|
WHERE `game_id` = :game
|
|
');
|
|
$getGame->bindValue('game', $gameId);
|
|
$getGame->execute();
|
|
$game = $getGame->fetch(PDO::FETCH_OBJ);
|
|
|
|
if(empty($game)) {
|
|
http_response_code(404);
|
|
die('No such game.');
|
|
}
|
|
|
|
$getOwnership = $pdo->prepare('
|
|
SELECT *
|
|
FROM `col_games_ownership`
|
|
WHERE `game_id` = :game
|
|
');
|
|
$getOwnership->bindValue('game', $gameId);
|
|
$getOwnership->execute();
|
|
$ownership = $getOwnership->fetchAll(PDO::FETCH_OBJ);
|
|
?>
|
|
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<title>Game Collection</title>
|
|
<link href="assets/style.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript">
|
|
var _paq = window._paq || [];
|
|
_paq.push(['disableCookies']);
|
|
_paq.push(['trackPageView']);
|
|
_paq.push(['enableLinkTracking']);
|
|
(function() {
|
|
_paq.push(['setTrackerUrl', '//uiharu.railgun.sh/mtm']);
|
|
_paq.push(['setSiteId', 'w4PqjBGmOL5l']);
|
|
var g = document.createElement('script');
|
|
g.type = 'text/javascript'; g.async = true;
|
|
g.defer = true; g.src = '//uiharu.railgun.sh/mtm.js';
|
|
document.head.appendChild(g);
|
|
})();
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div class="wrapper">
|
|
<h1><a href="./">Game Collection</a></h1>
|
|
<?php var_dump($game, '<br/>', $ownership); ?>
|
|
</div>
|
|
</body>
|
|
</html>
|