fix sum shit
This commit is contained in:
parent
25beda842c
commit
4b9d67e22b
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
74
catalog.php
74
catalog.php
|
|
@ -38,20 +38,30 @@ $possibleFilters = [
|
|||
];
|
||||
|
||||
if(isset($_GET["filter"])) {
|
||||
$page = $_GET["filter"];
|
||||
if(!in_array($page,$possibleFilters)) {
|
||||
$filter = $_GET["filter"];
|
||||
if(!in_array($filter,$possibleFilters)) {
|
||||
header('location: /error?err=404');
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$page = null;
|
||||
$filter = null;
|
||||
}
|
||||
if(isset($_GET['p'])) {
|
||||
$page = $_GET['p'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
$limit = 18;
|
||||
$page -= 1;
|
||||
$offset = $page * $limit;
|
||||
|
||||
$sql = "SELECT allStar FROM catalog ORDER BY RAND() LIMIT 1";
|
||||
$q = $con->prepare(str_replace('allStar', 'name', $sql));
|
||||
$q->execute();
|
||||
$random_search_array = $q->fetch();
|
||||
if($random_search_array || is_array($random_search_array)) {
|
||||
$random_search = array_rand($random_search_array, 1);
|
||||
}
|
||||
|
||||
$getitstarted = new PartyStarter;
|
||||
$getitstarted->header();
|
||||
|
|
@ -63,8 +73,8 @@ $getitstarted->header();
|
|||
<br>
|
||||
<form role="search" class="float-end" style="width: 45%;">
|
||||
<div class="input-group mb-3 shadow-sm">
|
||||
<input class="form-control rounded-end-0" type="search" placeholder="<?php echo htmlspecialchars($random_search_array[$random_search]) ?? "Search an item..."; ?>" name="search" aria-label="Search">
|
||||
<button id="search" type="submit" class="btn btn-primary rounded-start-0">Search</button>
|
||||
<input class="form-control rounded-end-0" type="search" placeholder="<?php if(is_array($random_search_array)) { echo htmlspecialchars($random_search_array[$random_search]); } else { echo "Search an item..."; }; ?>" name="search" aria-label="Search">
|
||||
<button id="search" type="submit" class="btn btn-primary rounded-start-0"><i class="bi bi-search"></i> Search</button>
|
||||
</div>
|
||||
</form>
|
||||
<h2>Catalog</h2>
|
||||
|
|
@ -75,32 +85,32 @@ $getitstarted->header();
|
|||
<br>
|
||||
<h4>Category</h4>
|
||||
</li>
|
||||
<a href="/catalog" class="list-group-item<?php if($page == null) { ?> active<?php } ?>" aria-current="true">All categories</a>
|
||||
<a href="?filter=hats" class="list-group-item<?php if($page == "hats") { ?> active<?php } ?>">Hats</a>
|
||||
<a href="?filter=shirts" class="list-group-item<?php if($page == "shirts") { ?> active<?php } ?>">Shirts</a>
|
||||
<a href="?filter=tshirts" class="list-group-item<?php if($page == "tshirts") { ?> active<?php } ?>">T-shirts</a>
|
||||
<a href="?filter=pants" class="list-group-item<?php if($page == "pants") { ?> active<?php } ?>">Pants</a>
|
||||
<a href="?filter=gears" class="list-group-item<?php if($page == "gears") { ?> active<?php } ?>">Gears</a>
|
||||
<a href="?filter=packages" class="list-group-item<?php if($page == "packages") { ?> active<?php } ?>">Packages</a>
|
||||
<button class="list-group-item text-start<?php if($page == "heads" || $page == "torso" || $page == "leftarm" || $page == "rightarm" || $page == "leftleg" || $page == "rightleg") { ?> active<?php } ?>" type="button" data-bs-toggle="dropdown" aria-expanded="false">Body parts</button>
|
||||
<a href="/catalog" class="list-group-item<?php if($filter == null) { ?> active<?php } ?>" aria-current="true">All categories</a>
|
||||
<a href="?filter=hats" class="list-group-item<?php if($filter == "hats") { ?> active<?php } ?>">Hats</a>
|
||||
<a href="?filter=shirts" class="list-group-item<?php if($filter == "shirts") { ?> active<?php } ?>">Shirts</a>
|
||||
<a href="?filter=tshirts" class="list-group-item<?php if($filter == "tshirts") { ?> active<?php } ?>">T-shirts</a>
|
||||
<a href="?filter=pants" class="list-group-item<?php if($filter == "pants") { ?> active<?php } ?>">Pants</a>
|
||||
<a href="?filter=gears" class="list-group-item<?php if($filter == "gears") { ?> active<?php } ?>">Gears</a>
|
||||
<a href="?filter=packages" class="list-group-item<?php if($filter == "packages") { ?> active<?php } ?>">Packages</a>
|
||||
<button class="list-group-item text-start<?php if($filter == "heads" || $filter == "torso" || $filter == "leftarm" || $filter == "rightarm" || $filter == "leftleg" || $filter == "rightleg") { ?> active<?php } ?>" type="button" data-bs-toggle="dropdown" aria-expanded="false">Body parts</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a class="dropdown-item<?php if($page == "heads") { ?> active<?php } ?>" href="?filter=heads">Heads</a>
|
||||
<a class="dropdown-item<?php if($filter == "heads") { ?> active<?php } ?>" href="?filter=heads">Heads</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item<?php if($page == "torso") { ?> active<?php } ?>" href="?filter=torso">Torso</a>
|
||||
<a class="dropdown-item<?php if($filter == "torso") { ?> active<?php } ?>" href="?filter=torso">Torso</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item<?php if($page == "leftarm") { ?> active<?php } ?>" href="?filter=leftarm">Left arm</a>
|
||||
<a class="dropdown-item<?php if($filter == "leftarm") { ?> active<?php } ?>" href="?filter=leftarm">Left arm</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item<?php if($page == "rightarm") { ?> active<?php } ?>" href="?filter=rightarm">Right arm</a>
|
||||
<a class="dropdown-item<?php if($filter == "rightarm") { ?> active<?php } ?>" href="?filter=rightarm">Right arm</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item<?php if($page == "leftleg") { ?> active<?php } ?>" href="?filter=leftleg">Left leg</a>
|
||||
<a class="dropdown-item<?php if($filter == "leftleg") { ?> active<?php } ?>" href="?filter=leftleg">Left leg</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item<?php if($page == "rightleg") { ?> active<?php } ?>" href="?filter=rightleg">Right leg</a>
|
||||
<a class="dropdown-item<?php if($filter == "rightleg") { ?> active<?php } ?>" href="?filter=rightleg">Right leg</a>
|
||||
</li>
|
||||
</ul>
|
||||
<li class="list-group-item">
|
||||
|
|
@ -126,7 +136,8 @@ $getitstarted->header();
|
|||
$q = $con->prepare(str_replace('allStar', '*', $sql));
|
||||
$q->execute();
|
||||
if ($numberOfItems >= 1) {
|
||||
foreach ($q->fetchAll() as $item) {
|
||||
$rows = array_slice($q->fetchAll(), $offset, $limit);
|
||||
foreach ($rows as $item) {
|
||||
$query = $con->prepare('SELECT COUNT(id) FROM users WHERE id=:id');
|
||||
$query->bindParam(':id', $_SESSION['user'], PDO::PARAM_INT);
|
||||
$query->execute();
|
||||
|
|
@ -166,6 +177,29 @@ $getitstarted->header();
|
|||
echo "</div> <h4 class='text-muted text-center'><i class='bi bi-egg-fried' style='font-size: 6rem;'></i><br> Looks like there are no items in the catalog yet...</h4>";} ?>
|
||||
<br>
|
||||
</div>
|
||||
<?php if(is_array($random_search_array)) { ?>
|
||||
<div class="d-flex flex-row justify-content-center mb-3">
|
||||
<ul class="pagination mt-3">
|
||||
<li class="page-item"><a class="page-link" href="?p=<?php if($page > 0) { echo $page; } else { echo 1; } ?>">Previous</a></li>
|
||||
<?php
|
||||
$numberOfPages = ceil($numberOfItems / $limit);
|
||||
for ($i=1; $i<=$numberOfPages; $i++) {
|
||||
if($page == $i){
|
||||
$class = 'active';
|
||||
}else{
|
||||
$class = '';
|
||||
}
|
||||
|
||||
if ($page > -1) {
|
||||
$i - 1;
|
||||
echo "<li class='page-item'><a class='page-link' href='?p=$i'>$i</a></li>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<li class="page-item"><a class="page-link" href="?p=<?php if($page < $numberOfPages - 1) { echo $page + 2; } else { echo $numberOfPages; } ?>">Next</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class PartyStarter {
|
|||
<button class="nav-link border-0 text-dark dropdown-toggle bg-transparent" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<img height=32 width=32 class="rounded-5" src="/assets/renders/user/headshot?userId='.(int)htmlspecialchars($_SESSION['user']).'">
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-lg-end profile-dropdown" style="z-index: -2;">
|
||||
<ul class="dropdown-menu dropdown-menu-lg-end anim-dropdown" style="z-index: -2;">
|
||||
<li><a class="nav-link ms-2" href="/user"><span class="bi bi-person-circle"></span> Profile</a></li>
|
||||
<li><a class="nav-link ms-2" href="/settings"><span class="bi bi-gear"></span> Settings</a></li>
|
||||
<li><a class="nav-link ms-2" href="/logout"><span class="bi bi-box-arrow-right"></span> Logout</a></li>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,13 @@
|
|||
@font-face {
|
||||
/* da japan font, we wont use this but yes
|
||||
@font-face {
|
||||
font-family: newrodin;
|
||||
src: url(../assets/font/NewRodin.otf);
|
||||
}
|
||||
* {
|
||||
font-family: newrodin;
|
||||
}*/
|
||||
|
||||
@font-face {
|
||||
font-family: grufont;
|
||||
src: url(../assets/font/GruFont.ttf);
|
||||
}
|
||||
|
|
@ -12,27 +21,12 @@
|
|||
.gotham {
|
||||
font-family: gotham;
|
||||
}
|
||||
body {
|
||||
animation: startpageload 0.4s ease 0s 1 forwards;
|
||||
}
|
||||
|
||||
@keyframes startpageload {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(-65px);
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
.anim-dropdown {
|
||||
animation: dropdown-anim 0.3s ease 0s 1 normal none;
|
||||
}
|
||||
|
||||
.profile-dropdown {
|
||||
animation: profile-dropdown-anim 0.3s ease 0s 1 normal none;
|
||||
}
|
||||
|
||||
@keyframes profile-dropdown-anim {
|
||||
@keyframes dropdown-anim {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px);
|
||||
|
|
@ -44,6 +38,22 @@ animation: profile-dropdown-anim 0.3s ease 0s 1 normal none;
|
|||
}
|
||||
}
|
||||
|
||||
.anim-dropdown-2 {
|
||||
animation: dropdown-anim-2 0.3s ease 0s 1 normal none;
|
||||
}
|
||||
|
||||
@keyframes dropdown-anim-2 {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px);
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(40px);
|
||||
}
|
||||
}
|
||||
|
||||
.nav-animated:hover {
|
||||
animation: hover-nav-link 0.4s ease 0s 1 normal forwards;
|
||||
}
|
||||
|
|
|
|||
68
games.php
68
games.php
|
|
@ -8,20 +8,31 @@ session_start();
|
|||
|
||||
require_once 'core/classes.php';
|
||||
require_once 'core/classes/user.php';
|
||||
if (isset($_SESSION['user'])) {
|
||||
if(isset($_SESSION['user'])) {
|
||||
$user = new User($con, $_SESSION['user']);
|
||||
$loggedIn = true;
|
||||
} else {
|
||||
$user = new User($con, 0);
|
||||
$loggedIn = false;
|
||||
}
|
||||
$getitstarted = new PartyStarter;
|
||||
$getitstarted->header();
|
||||
|
||||
if(isset($_GET['p'])) {
|
||||
$page = $_GET['p'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
$limit = 18;
|
||||
$page -= 1;
|
||||
$offset = $page * $limit;
|
||||
|
||||
$sql = "SELECT allStar FROM games ORDER BY RAND() LIMIT 1";
|
||||
$q = $con->prepare(str_replace('allStar', 'name', $sql));
|
||||
$q->execute();
|
||||
$random_search_array = $q->fetch();
|
||||
if($random_search_array || is_array($random_search_array)) {
|
||||
$random_search = array_rand($random_search_array, 1);
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<title><?php echo $pagename; ?> | <?php echo $sitename; ?></title>
|
||||
|
|
@ -32,22 +43,39 @@ $random_search = array_rand($random_search_array, 1);
|
|||
<h3 class="text-white">Games</h3>
|
||||
<form role="search" style="width: 45%;">
|
||||
<div class="input-group shadow-sm mt-1">
|
||||
<input class="form-control rounded-end-0" type="search" placeholder="<?php echo htmlspecialchars($random_search_array[$random_search]) ?? "Search a game..."; ?>" name="search" aria-label="Search">
|
||||
<button id="search" type="submit" class="btn btn-primary rounded-start-0">Search</button>
|
||||
<input class="form-control rounded-end-0" type="search" placeholder="<?php if(is_array($random_search_array)) { echo htmlspecialchars($random_search_array[$random_search]); } else { echo "Search a game..."; }; ?>" name="search" aria-label="Search">
|
||||
<button id="search" type="submit" class="btn btn-primary rounded-start-0"><i class="bi bi-search"></i> Search</button>
|
||||
</div>
|
||||
</form>
|
||||
<a href="/create_game" class="btn btn-success text-decoration-none align-self-end shadow-sm">Create a game <i class="bi bi-plus-lg"></i></a>
|
||||
<?php
|
||||
if($loggedIn) {
|
||||
echo '
|
||||
<div class="btn-group" role="group" aria-label="hihhihihhihifgdfogfiogdfjgiogdfhdjgiodfkl">
|
||||
<div class="dropdown mt-1">
|
||||
<button class="btn btn-secondary dropdown-toggle border-end-0 rounded-end-0" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
Downloads
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-lg-end anim-dropdown-2">
|
||||
<li><a class="dropdown-item" href="/download?client=2016&type=player">Download client <i class="bi bi-download"></i></a></li>
|
||||
<li><a class="dropdown-item" href="/download?client=2016&type=studio">Download studio <i class="bi bi-download"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a href="/develop" class="btn btn-success text-decoration-none align-self-end shadow-sm">Develop <i class="bi bi-plus-lg"></i></a>
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="row row-cols-xs-2 row-cols-sm-3 row-cols-md-4 row-cols-lg-5 row-cols-xl-6 g-4">
|
||||
<?php
|
||||
$sql = "SELECT allStar FROM games LIMIT 20";
|
||||
$sql = "SELECT allStar FROM games";
|
||||
$q = $con->prepare(str_replace('allStar', 'count(*)', $sql));
|
||||
$q->execute();
|
||||
$numberOfGames = $q->fetchColumn();
|
||||
$q = $con->prepare(str_replace('allStar', '*', $sql));
|
||||
$q->execute();
|
||||
if ($numberOfGames >= 1) {
|
||||
while ($game = $q->fetch()) {
|
||||
$rows = array_slice($q->fetchAll(), $offset, $limit);
|
||||
foreach($rows as $game) {
|
||||
$playingCount = 69;
|
||||
?>
|
||||
<div class="col">
|
||||
|
|
@ -70,8 +98,32 @@ $random_search = array_rand($random_search_array, 1);
|
|||
}
|
||||
echo "</div>";
|
||||
} else {
|
||||
echo "</div> <h4 class='text-muted text-center'><i class='bi bi-egg-fried' style='font-size: 6rem;'></i><br> Looks like there are no games, sad.</h4>";} ?>
|
||||
echo "</div> <br><br><h4 class='text-muted text-center'><i class='bi bi-egg-fried' style='font-size: 6rem;'></i><br> Looks like there are no games, sad.</h4>";} ?>
|
||||
<?php
|
||||
$numberOfPages = ceil($numberOfGames / $limit);
|
||||
?>
|
||||
<?php if(is_array($random_search_array)) { ?>
|
||||
<div class="d-flex flex-row justify-content-center mb-3">
|
||||
<ul class="pagination mt-3">
|
||||
<li class="page-item"><a class="page-link" href="?p=<?php if($page > 0) { echo $page; } else { echo 1; } ?>">Previous</a></li>
|
||||
<?php
|
||||
for ($i=1; $i<=$numberOfPages; $i++) {
|
||||
if($page == $i){
|
||||
$class = 'active';
|
||||
}else{
|
||||
$class = '';
|
||||
}
|
||||
|
||||
if ($page > -1) {
|
||||
$i - 1;
|
||||
echo "<li class='page-item'><a class='page-link' href='?p=$i'>$i</a></li>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<li class="page-item"><a class="page-link" href="?p=<?php if($page < $numberOfPages) { echo $page + 2; } else { echo $numberOfPages; } ?>">Next</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
147
grublox.sql
147
grublox.sql
|
|
@ -1,91 +1,152 @@
|
|||
-- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 5.2.0
|
||||
-- https://www.phpmyadmin.net/
|
||||
--
|
||||
-- Host: localhost Database: grublox
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 5.5.5-10.4.21-MariaDB-log
|
||||
-- Host: localhost
|
||||
-- Generation Time: Feb 12, 2023 at 10:52 AM
|
||||
-- Server version: 10.4.21-MariaDB-log
|
||||
-- PHP Version: 8.0.27
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
START TRANSACTION;
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!50503 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
|
||||
--
|
||||
-- Database: `grublox`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `catalog`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `catalog`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `catalog` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id` int(11) NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`description` varchar(255) NOT NULL,
|
||||
`creator` int(11) NOT NULL,
|
||||
`price` int(11) NOT NULL,
|
||||
`type` varchar(100) DEFAULT 'hats',
|
||||
`sales` int(11) NOT NULL DEFAULT 0,
|
||||
`thumbnail` mediumtext NOT NULL,
|
||||
`date` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`lastupdated` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
`limited` int(1) DEFAULT 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
`stock` int(11) NOT NULL DEFAULT 0
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `comments`
|
||||
--
|
||||
|
||||
CREATE TABLE `comments` (
|
||||
`id` int(11) NOT NULL,
|
||||
`user` int(11) NOT NULL,
|
||||
`type` varchar(250) NOT NULL,
|
||||
`text` varchar(500) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `games`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `games`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `games` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id` int(11) NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`description` varchar(255) NOT NULL,
|
||||
`creator` int(11) NOT NULL,
|
||||
`accessKey` varchar(250) NOT NULL COMMENT 'NEVER SHARE THIS WITH ANYONE! ONLY RCC.',
|
||||
`date` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`updateddate` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
`thumbnail` mediumtext NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
`thumbnail` mediumtext NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!50503 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id` int(11) NOT NULL,
|
||||
`username` varchar(20) NOT NULL,
|
||||
`password` varchar(450) NOT NULL,
|
||||
`date` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`token` varchar(25) DEFAULT NULL COMMENT 'Token for joining. Useful to secure joining to prevent unauthorized users to use other names.',
|
||||
`description` varchar(250) DEFAULT NULL,
|
||||
`money` int(11) NOT NULL DEFAULT 0,
|
||||
`admin` int(1) DEFAULT 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
`money` int(11) NOT NULL DEFAULT 10,
|
||||
`lastPaid` timestamp NULL DEFAULT NULL,
|
||||
`admin` int(1) NOT NULL DEFAULT 0
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
--
|
||||
-- Dumping routines for database 'grublox'
|
||||
-- Indexes for dumped tables
|
||||
--
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
--
|
||||
-- Indexes for table `catalog`
|
||||
--
|
||||
ALTER TABLE `catalog`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `comments`
|
||||
--
|
||||
ALTER TABLE `comments`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `games`
|
||||
--
|
||||
ALTER TABLE `games`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `users`
|
||||
--
|
||||
ALTER TABLE `users`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `catalog`
|
||||
--
|
||||
ALTER TABLE `catalog`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `comments`
|
||||
--
|
||||
ALTER TABLE `comments`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `games`
|
||||
--
|
||||
ALTER TABLE `games`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `users`
|
||||
--
|
||||
ALTER TABLE `users`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
COMMIT;
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2023-02-05 21:24:51
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ $background = "$arraybackground[$countofarray]";
|
|||
$getthecount = rand(0, count($youtubefunnies)-1);
|
||||
$youtubevideo = "$youtubefunnies[$getthecount]";
|
||||
?>
|
||||
<link rel="stylesheet" href="/css/global.css">
|
||||
<link rel="stylesheet" href="css/index.css">
|
||||
<style>
|
||||
body {
|
||||
|
|
@ -24,11 +25,13 @@ body {
|
|||
margin-right: auto;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
</style>
|
||||
<title><?php echo $pagename; ?> | <?php echo $sitename; ?></title>
|
||||
<body data-bs-theme="dark">
|
||||
<div class="position-absolute top-50 start-50 translate-middle col d-flex justify-content-center align-middle">
|
||||
<div class="card shadow-sm bg-dark text-white text-center">
|
||||
<div style="transform: translateY(20%);"class="col d-flex justify-content-center align-middle">
|
||||
|
||||
<div class="card shadow-sm bg-dark text-white text-center z-2">
|
||||
<div class="card-body">
|
||||
<h1><?php echo $sitename; ?></h1>
|
||||
<h3>the funny website with</h3>
|
||||
|
|
@ -40,5 +43,6 @@ src="https://www.youtube.com/embed/<?php echo $youtubevideo; ?>">
|
|||
</iframe></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
|||
10
item.php
10
item.php
|
|
@ -70,14 +70,14 @@ $getitstarted->header();
|
|||
<span class="float-end badge bg-success">Limited</span>'; }; ?> </h3>
|
||||
<div class="card-body mx-md-auto mx-xl-0">
|
||||
<div class="row g-2">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-6 align-self-center d-block text-center">
|
||||
<img height=300 width=300 class="img-thumbnail border-0" src="
|
||||
<?php if (!empty($item["thumbnail"])) {echo htmlspecialchars($item["thumbnail"]);} else {echo "assets/placeholder.png";} ?>">
|
||||
</div>
|
||||
<div class="col p-4 mt-md-2 ms-md-0 ms-lg-4 mt-lg-0 border-0 rounded-2">
|
||||
<a href="user?id=<?php echo $item['creator']; ?>" class="text-decoration-none">
|
||||
<div class="col p-4 mt-md-2 ms-md-0 ms-lg-4 mt-lg-0 border-0 rounded-2 align-self-center">
|
||||
<a href="user?id=<?php echo $item['creator']; ?>" class="text-decoration-none d-flex">
|
||||
<img class="float-start border border-1 rounded-1 me-2" width=64 height=64 alt="<?php echo htmlspecialchars($item["name"]); ?>" src="<?php if (!empty($itemUser->getAvatar())) {echo htmlspecialchars($itemUser->getAvatar()); } ?>">
|
||||
<p class="text-white"> <?php echo $itemUser->getUsername(); ?> </p>
|
||||
<p class="text-white align-self-center fs-5 mt-2"> <?php echo $itemUser->getUsername(); ?> </p>
|
||||
</a>
|
||||
<br>
|
||||
<p>Price: <span class="text-success">
|
||||
|
|
@ -89,7 +89,7 @@ $getitstarted->header();
|
|||
</p>
|
||||
<p>Sales: <span class="text-white"> <?php echo ucfirst(htmlspecialchars($item["sales"])); ?> </span>
|
||||
</p>
|
||||
<button class="btn btn-success fs-4 <?php if($loggedIn == false) { echo "disabled"; } ?>" data-bs-toggle="modal" data-bs-target="#exampleModal" style="width: 13rem;">Buy with <span class="grufont fs-3">@</span>
|
||||
<button class="btn btn-success fs-4 w-100 <?php if($loggedIn == false) { echo "disabled"; } ?>" data-bs-toggle="modal" data-bs-target="#exampleModal">Buy with <span class="grufont fs-3">@</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
22
place.php
22
place.php
|
|
@ -43,16 +43,6 @@ if(!$item) {
|
|||
exit;
|
||||
}
|
||||
|
||||
if($loggedIn == true) {
|
||||
if($_POST['submit'] ?? "No" == "Yes") {
|
||||
if($user->getMoney('false') >= htmlspecialchars($item["price"])) {
|
||||
$q = $con->prepare("UPDATE users SET money=money-:price WHERE id=:id");
|
||||
$q->bindParam(':id',$_SESSION['user'],PDO::PARAM_INT);
|
||||
$q->bindParam(':price',$item['price'],PDO::PARAM_INT);
|
||||
$q->execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html data-bs-theme="dark">
|
||||
|
|
@ -72,15 +62,15 @@ $getitstarted->header();
|
|||
<h3 class="card-header text-start"> <?php echo htmlspecialchars($item["name"]); ?> </h3>
|
||||
<div class="card-body mx-md-auto mx-xl-0">
|
||||
<div class="row g-2">
|
||||
<div class="col-md-6 h-100">
|
||||
<div class="col-md-6 h-100 align-self-center d-block text-center">
|
||||
<img class="img-thumbnail border-0" height=300 width=500 src="
|
||||
<?php if (!empty($item["thumbnail"])) {echo htmlspecialchars($item["thumbnail"]);} else {echo "assets/placeholder2.png";} ?>">
|
||||
</div>
|
||||
|
||||
<div class="col p-4 mt-md-2 ms-md-0 ms-lg-4 mt-lg-0 border-0 rounded-2 h-100">
|
||||
<a href="user?id=<?php echo $item['creator']; ?>" class="text-decoration-none">
|
||||
<img class="float-start border border-1 rounded-1 me-2" width=64 height=64 alt="<?php echo htmlspecialchars($item["name"]); ?>" src="<?php if (!empty($itemUser->getAvatar())) {echo htmlspecialchars($itemUser->getAvatar()); } else { echo "/assets/placeholder.png"; } ?>">
|
||||
<p class="text-white"> <?php echo $itemUser->getUsername(); ?> </p>
|
||||
<div class="col p-4 mt-md-2 ms-md-0 ms-lg-4 mt-lg-0 border-0 rounded-2 align-self-center">
|
||||
<a href="user?id=<?php echo $item['creator']; ?>" class="text-decoration-none d-flex">
|
||||
<img class="float-start border border-1 rounded-1 me-2" width=64 height=64 alt="<?php echo htmlspecialchars($item["name"]); ?>" src="<?php if (!empty($itemUser->getAvatar())) {echo htmlspecialchars($itemUser->getAvatar()); } ?>">
|
||||
<p class="text-white align-self-center fs-5 mt-2"> <?php echo $itemUser->getUsername(); ?> </p>
|
||||
</a>
|
||||
<br>
|
||||
<p>Description: <span class="text-white"> <?php echo htmlspecialchars($item["description"]); ?> </span>
|
||||
|
|
@ -105,12 +95,14 @@ $getitstarted->header();
|
|||
<ul class="nav nav-tabs card-header-tabs nav-fill">
|
||||
<li class="nav-item"> <button class="nav-link active" id="comments-tab" data-bs-toggle="pill" data-bs-target="#comments" type="button" role="tab" aria-controls="comments" aria-selected="true">Comments</button> </li>
|
||||
<li class="nav-item"> <button class="nav-link" id="trades-tab" data-bs-toggle="pill" data-bs-target="#trades" type="button" role="tab" aria-controls="trades" aria-selected="false">Gamepasses</button> </li>
|
||||
<li class="nav-item"> <button class="nav-link" id="servers-tab" data-bs-toggle="pill" data-bs-target="#servers" type="button" role="tab" aria-controls="servers" aria-selected="false">Servers</button> </li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<div class="tab-content" id="v-pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="comments" role="tabpanel" aria-labelledby="comments-tab" tabindex="0">soon commentz</div>
|
||||
<div class="tab-pane fade" id="trades" role="tabpanel" aria-labelledby="trades-tab" tabindex="0">gampeas</div>
|
||||
<div class="tab-pane fade" id="servers" role="tabpanel" aria-labelledby="servers-tab" tabindex="0">servdrsdad</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
session_start();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="dark">
|
||||
<head>
|
||||
<?php
|
||||
|
||||
require_once 'core/classes.php';
|
||||
require_once 'core/classes/user.php';
|
||||
$user = new User($con, $_SESSION['user'] ?? 0);
|
||||
if(!$user->isLoggedIn()) {
|
||||
header('location: /login');
|
||||
exit;
|
||||
}
|
||||
|
||||
$getitstarted = new PartyStarter;
|
||||
$getitstarted->header();
|
||||
?>
|
||||
</head>
|
||||
<title><?php echo $pagename; ?> | <?php echo $sitename; ?></title>
|
||||
<body>
|
||||
<main class="container text-white" style="width: 100%;">
|
||||
<br><br>
|
||||
<h1>yo soon</h1>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
21
user.php
21
user.php
|
|
@ -54,18 +54,12 @@ $getitstarted->header();
|
|||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<ul class="nav justify-content-center">
|
||||
<li class="nav-item fs-5" style="margin-right: 25%">
|
||||
<a class="nav-link text-white" href="#about">About</a>
|
||||
</li>
|
||||
<li class="nav-item fs-5" style="margin-left: 25%">
|
||||
<a class="nav-link text-white" href="#games">Creations</a>
|
||||
</li>
|
||||
<ul class="nav nav-tabs nav-fill">
|
||||
<li class="nav-item"> <button class="nav-link active" id="comments-tab" data-bs-toggle="pill" data-bs-target="#comments" type="button" role="tab" aria-controls="comments" aria-selected="true">Profile</button> </li>
|
||||
<li class="nav-item"> <button class="nav-link" id="trades-tab" data-bs-toggle="pill" data-bs-target="#trades" type="button" role="tab" aria-controls="trades" aria-selected="false">Creations</button> </li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content" id="v-pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="comments" role="tabpanel" aria-labelledby="comments-tab" tabindex="0">
|
||||
<h3 class="mt-3">About</h3>
|
||||
|
||||
<div class="card shadow-sm">
|
||||
|
|
@ -93,6 +87,10 @@ $getitstarted->header();
|
|||
</div>
|
||||
</div>
|
||||
!-->
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="trades" role="tabpanel" aria-labelledby="trades-tab" tabindex="0">gampeas</div>
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body d-flex d-flex-row mx-auto">
|
||||
|
|
@ -111,7 +109,6 @@ $getitstarted->header();
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3" />
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Reference in New Issue