52 行
1.9 KiB
PHP
52 行
1.9 KiB
PHP
<?php
|
|
include('include/god.php');
|
|
$item = 'sasa';
|
|
$pagetitle = ($eigo ? 'Item: ' : '商品:').$item;
|
|
$styles[] = 'item';
|
|
$books = [];
|
|
|
|
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
|
|
|
|
$sql = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
|
if (mysqli_connect_errno()) {
|
|
printf("Connect failed: %s\n", mysqli_connect_error());
|
|
exit();
|
|
}
|
|
|
|
if ($stmt = mysqli_prepare($sql, 'SELECT name, slug, language, author, description, price, filename, pagecount FROM item WHERE slug = ?')) {
|
|
mysqli_stmt_bind_param($stmt, 's', $_GET['slug']);
|
|
mysqli_stmt_execute($stmt);
|
|
mysqli_stmt_bind_result($stmt, $name, $slug, $language, $author, $description, $price, $filename, $pagecount);
|
|
mysqli_stmt_fetch($stmt);
|
|
mysqli_stmt_close($stmt);
|
|
}
|
|
|
|
$booklang = $language == 'en' ? ($eigo ? 'English' : '英語') : ($eigo ? 'Japanese' : '日本語');
|
|
|
|
mysqli_close($sql);
|
|
?>
|
|
<?php require_once('include/header.php'); ?>
|
|
|
|
<div class="item-container">
|
|
<?php $fname = null !== $filename ? $filename : 'nowprinting.png'; ?>
|
|
<div class="item-photo"><img src="/img/<?php echo $fname; ?>" alt="<?php echo $fname; ?>" /></div>
|
|
<div class="item-main">
|
|
<div class="item-header-container">
|
|
<div class="item-header-title"><?php echo $name; ?></div>
|
|
<div class="item-header-price"><img src="/static/monero.png" alt="XMR" /> <?php echo $price; ?></div>
|
|
</div>
|
|
<div class="item-author"><?php echo $author; ?></div>
|
|
<div class="item-language"><?php echo $booklang; ?></div>
|
|
|
|
<p><?php echo $description; ?></p>
|
|
|
|
<p><?php echo $pagecount.($eigo ? ' pages' : 'ページ'); ?></p>
|
|
<form method="post" action="/cart.php">
|
|
<input type="hidden" name="item" value="<?php echo $slug; ?>" />
|
|
<input type="submit" name="addtocart" value="<?php echo $eigo ? 'Add to cart' : 'カートに追加'; ?>" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<?php require_once('include/footer.php'); ?>
|