commit e6d5e206f6c50eed507886fb2855871f159b04d6 Author: テクニカル諏訪子 Date: Sun May 8 02:56:47 2022 +0900 最初のコミット diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..335a04c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +include/config.php +img/* +!img/.suwawa +!img/nowprinting.jpg diff --git a/cart.php b/cart.php new file mode 100644 index 0000000..91d8e1b --- /dev/null +++ b/cart.php @@ -0,0 +1,74 @@ + + + + $name, + 'slug' => $slug, + 'language' => $booklang, + 'author' => $author, + 'price' => $price, + 'filename' => $filename, + 'count' => 1 + ]; + else $items[$c]['count']++; + } + } + + mysqli_close($sql); +?> + + + + + + + + + + + + + + + + + + + +
<?php echo $fname; ?> +
+
+
+
+ +
+ + +
+
XMR
XMR
+ + diff --git a/img/.suwawa b/img/.suwawa new file mode 100644 index 0000000..e69de29 diff --git a/img/nowprinting.jpg b/img/nowprinting.jpg new file mode 100644 index 0000000..50b2d0c Binary files /dev/null and b/img/nowprinting.jpg differ diff --git a/include/config.sample.php b/include/config.sample.php new file mode 100644 index 0000000..4e1262a --- /dev/null +++ b/include/config.sample.php @@ -0,0 +1,18 @@ + diff --git a/include/footer.php b/include/footer.php new file mode 100644 index 0000000..b05f220 --- /dev/null +++ b/include/footer.php @@ -0,0 +1,8 @@ + + + + + diff --git a/include/god.php b/include/god.php new file mode 100644 index 0000000..271fd7a --- /dev/null +++ b/include/god.php @@ -0,0 +1,47 @@ + $v) { + if ($v == $_POST['item']) { unset($cart[$k]); break; } + } + $cart = array_values($cart); + $cart = implode(',', $cart).','; + setcookie('cart', $cart); + unset($_POST['item']); + unset($_POST['cart-minus']); + header('Location: /cart.php'); + } + + if (isset($_POST['cart-plus'])) { + $cart = null !== $_COOKIE['cart'] ? $_COOKIE['cart'] : ''; + $cart .= $_POST['item'].','; + setcookie('cart', $cart); + unset($_POST['item']); + unset($_POST['cart-minus']); + header('Location: /cart.php'); + } + + $eigo = null !== $_COOKIE['lang'] && $_COOKIE['lang'] == 'en'; + $cart = null !== $_COOKIE['cart'] && $_COOKIE['cart'] != 0; + $styles = ['style']; +?> diff --git a/include/header.php b/include/header.php new file mode 100644 index 0000000..4a6e8d3 --- /dev/null +++ b/include/header.php @@ -0,0 +1,43 @@ + + + + + <?php echo $eigo ? STORE_NAME_EN : STORE_NAME_JA; ?> + + + + + +
+ +
+ +

+
+
+ +
+

+ + + +
diff --git a/include/helper.php b/include/helper.php new file mode 100644 index 0000000..24e0173 --- /dev/null +++ b/include/helper.php @@ -0,0 +1,23 @@ +'; + var_dump($val); + echo ''; + die(); + } + + function uuid () { + return sprintf( + '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', + mt_rand(0, 0xffff), mt_rand(0, 0xffff), // 32bitlow + mt_rand(0, 0xffff), // 16bitmid + mt_rand(0, 0x0fff) | 0x4000, // 16bithigh + mt_rand(0, 0x3fff) | 0x8000, // 16bit|8bithigh|low + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff) // 48bitnode + ); + } +?> diff --git a/index.php b/index.php new file mode 100644 index 0000000..d2f9e66 --- /dev/null +++ b/index.php @@ -0,0 +1,46 @@ + $name, + 'slug' => $slug, + 'author' => $author, + 'price' => $price, + 'quantity' => $quantity, + 'filename' => $filename + ]; + } + mysqli_stmt_close($stmt); + } + + mysqli_close($sql); +?> + + + + + + + diff --git a/item.php b/item.php new file mode 100644 index 0000000..a909772 --- /dev/null +++ b/item.php @@ -0,0 +1,51 @@ + + + +
+ +
<?php echo $fname; ?>
+
+
+
+
XMR
+
+
+
+ +

+ +

+
+ + +
+
+
+ + diff --git a/static/git.png b/static/git.png new file mode 100644 index 0000000..df3afde Binary files /dev/null and b/static/git.png differ diff --git a/static/item.css b/static/item.css new file mode 100644 index 0000000..c4f44dc --- /dev/null +++ b/static/item.css @@ -0,0 +1,62 @@ +.item-container { + display: flex; +} + +.item-photo { + width: 40%; +} + +.item-photo > img { + width: 300px; +} + +@media (max-width: 800px) { + .item-photo { + display: contents; + } + + .item-photo > img { + width: 200px; + } +} + +@media (max-width: 800px) { + .item-photo > img { + width: 100px; + height: 150px; + } +} + +.item-main { + text-align: left; + width: 60%; +} + +.item-header-container { + clear: both; + max-width: 800px; + display: flex; +} + +.item-header-title, .item-header-price { + color: #abab00; + line-height: 1.2; +} + +.item-header-title { + width: 80%; + font-size: xx-large; +} + +.item-header-price { + font-size: x-large; + text-align: right; +} + +.item-author, .item-language { + font-size: large; +} + +.item-author { + color: #4d4d4d; +} diff --git a/static/monero.png b/static/monero.png new file mode 100644 index 0000000..b07d718 Binary files /dev/null and b/static/monero.png differ diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..af9bfba --- /dev/null +++ b/static/style.css @@ -0,0 +1,171 @@ +body { + background: #232629; + color: #fcfcfc; +} + +.clear { + clear: both; +} + +.jswarning { + background-color: rgb(170, 170, 0); + color: rgb(252, 252, 252); + display: none; + padding: 10px; + z-index: 5000; + position: fixed; + top: 0px; + left: 0px; + right: 0px; + border: 4px #dde22d ridge; +} + +h1, .footer { + text-align: center; +} + +.footer { + padding-top: 16px; +} + +hr { + border-color: #8800dd; + box-shadow: 2px 2px 10px #9900ff; + width: 100%; + max-width: 1700px; +} + +a { + color: #ffeb3b; +} + +.container { + width: 100%; + text-align: center; +} + +.anarchy, .nav { + padding: 8px 0; + background-color: #16170b; + border: 1px #ffeb3b groove; + color: #d5de5c; +} + +.anarchy { + max-width: 1400px; + margin: 0 auto; +} + +.langchange { + background-color: #31363b; + color: #fcfcfc; +} + +.item-card { + display: inline-block; + background: #4d4d4d; + border: 1px solid #fcfcfc; + border-radius: 10px; + padding: 8px; + margin: 0 8px; + width: 220px; +} + +.item-card > a > img { + width: 200px; + height: 284px; +} + +.nav { + text-align: left; +} + +.nav ul { + padding: 0; + margin: .5em; +} + +.nav li { + list-style: none; + background: #4d4d4d; + border-radius: 10px; + padding: .5em; + max-width: 7em; +} + +.nav li:hover { + background: #bdc3c7; + color: #232629; +} + +.cart { + text-align: left; + width: 100%; + background: #31363b; + margin: 8px auto; + border-radius: 10px; +} + +.cart-total { + background: #eff0f1; + color: #232629; +} + +.cart-count { + background: #da4453; + color: #fcfcfc; + border-radius: 50%; + width: 10px; + height: 10px; + padding: 4px; + text-align: center; + cursor: default; + display: inline-block; + font-size: xx-small; +} + +@media (min-width: 1200px) and (max-width: 1399px) { + .anarchy { + max-width: 800px; + } +} + +@media (min-width: 1400px) and (max-width: 1599px) { + .anarchy { + max-width: 1000px; + } +} + +@media (min-width: 1600px) and (max-width: 1799px) { + .anarchy { + max-width: 1000px; + } +} + +@media (min-width: 1200px) { + .nav { + float: left; + width: 175px; + position: fixed; + } + + .nav li { + display: block; + text-align: center; + margin: .5em auto; + } +} + +@media (max-width: 1199px) { + .nav { + text-align: center; + clear: both; + max-width: 850px; + margin: auto; + margin-bottom: 20px; + } + + .nav li { + display: inline-block; + } +} diff --git a/tbl b/tbl new file mode 100644 index 0000000..e700e94 --- /dev/null +++ b/tbl @@ -0,0 +1,58 @@ +DROP DATABASE IF EXISTS `honya_db`; +CREATE DATABASE `honya_db` CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; + +DROP TABLE IF EXISTS `item`; +CREATE TABLE `item` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `slug` varchar(100) NOT NULL, + `author` varchar(100), + `language` varchar(2) NOT NULL, + `description` text, + `price` float(10, 8) NOT NULL, + `quantity` int(10) NOT NULL, + `filename` varchar(100) NOT NULL, + `pagecount` int(10) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + +DROP TABLE IF EXISTS `item_img`; +CREATE TABLE `item_img` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `item_id` int(10) NOT NULL, + `filename` varchar(100) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + +DROP TABLE IF EXISTS `author`; +CREATE TABLE `author` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `slug` varchar(100) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + +DROP TABLE IF EXISTS `shipping`; +CREATE TABLE `shipping` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `slug` varchar(100) NOT NULL, + `zip` varchar(100) NOT NULL, + `housenr` varchar(100) NOT NULL, + `address1` varchar(100) NOT NULL, + `address2` varchar(100), + `country` varchar(100) NOT NULL, + `email` varchar(100) NOT NULL, + `shipped` int(1), + `shippedtime` int(10), + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; + +DROP TABLE IF EXISTS `orders`; +CREATE TABLE `orders` ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `item_id` int(10) NOT NULL, + `shipping_id` int(10) NOT NULL, + `payment_id` varchar(100) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;