diff --git a/assets/placeholder.png b/assets/placeholder.png new file mode 100644 index 0000000..db22339 Binary files /dev/null and b/assets/placeholder.png differ diff --git a/catalog.php b/catalog.php index 7899122..a5c703b 100644 --- a/catalog.php +++ b/catalog.php @@ -75,20 +75,49 @@ $getitstarted->header();
- + prepare(str_replace('allStar', 'count(*)', $sql)); + $q->execute(); + $numberOfItems = $q->fetchColumn(); + $q = $con->prepare(str_replace('allStar', '*', $sql)); + $q->execute(); + if ($numberOfItems >= 1) { + while ($item = $q->fetch()) { + $qq = $con->prepare("SELECT * FROM users WHERE id = :id"); + $qq->bindParam(':id', $item["creator"], PDO::PARAM_INT); + $qq->execute(); + $creator = $qq->fetch(); + if(!$creator) { + $creator = [ + "id" => 0, + "username" => "[ unknown user ]" + ]; + } + $x = 40; + for ($i = 1; $i <= $x; $i++) { + ?>
- + ">" class="card-img-top">

Limited'; }; ?>

- $1 + $
-
Minion
+

- By someone + By " class="btn-link">

-
+ +
diff --git a/core/classes/user.php b/core/classes/user.php index df6547c..20e34c3 100644 --- a/core/classes/user.php +++ b/core/classes/user.php @@ -17,7 +17,7 @@ class User { public function getMoney($short) { if ($short == "true") { - $money = $this->$query->sqlData["money"]; + $money = $this->sqlData["money"]; if ($money < 1000000) { // Anything less than a million @@ -31,7 +31,7 @@ class User { } } else { - return $this->$query->sqlData["money"]; + return $this->sqlData["money"]; } } diff --git a/games.php b/games.php index fde6bdb..890daa8 100644 --- a/games.php +++ b/games.php @@ -41,7 +41,7 @@ $getitstarted->header(); for ($i = 1; $i <= $x; $i++) { ?>
" style="text-decoration: none; text-align: left; margin-bottom: 9px;"> - " class="card-img-top rounded-top" alt=""> + " class="card-img-top rounded-top" alt="">

diff --git a/grublox.sql b/grublox.sql index 2eb3bd9..3fd8f11 100644 --- a/grublox.sql +++ b/grublox.sql @@ -1,10 +1,11 @@ -- nolanwhy + -- phpMyAdmin SQL Dump -- version 5.2.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 --- Generation Time: Feb 04, 2023 at 10:58 PM +-- Generation Time: Feb 05, 2023 at 10:10 AM -- Server version: 10.4.27-MariaDB -- PHP Version: 8.0.25 @@ -18,6 +19,23 @@ SET time_zone = "+00:00"; -- -------------------------------------------------------- +-- +-- Table structure for table `catalog` +-- + +CREATE TABLE `catalog` ( + `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, + `thumbnail` mediumtext NOT NULL, + `date` datetime NOT NULL DEFAULT current_timestamp(), + `lastupdated` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +-- -------------------------------------------------------- + -- -- Table structure for table `games` -- @@ -28,7 +46,8 @@ CREATE TABLE `games` ( `description` varchar(255) NOT NULL, `creator` int(11) NOT NULL, `date` datetime NOT NULL DEFAULT current_timestamp(), - `updateddate` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() + `updateddate` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `thumbnail` mediumtext NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -------------------------------------------------------- @@ -51,6 +70,12 @@ CREATE TABLE `users` ( -- Indexes for dumped tables -- +-- +-- Indexes for table `catalog` +-- +ALTER TABLE `catalog` + ADD PRIMARY KEY (`id`); + -- -- Indexes for table `games` -- @@ -67,6 +92,12 @@ ALTER TABLE `users` -- AUTO_INCREMENT for dumped tables -- +-- +-- AUTO_INCREMENT for table `catalog` +-- +ALTER TABLE `catalog` + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; + -- -- AUTO_INCREMENT for table `games` -- @@ -78,4 +109,4 @@ ALTER TABLE `games` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -COMMIT; \ No newline at end of file +COMMIT; diff --git a/login.php b/login.php index b9f2090..264ab56 100644 --- a/login.php +++ b/login.php @@ -22,9 +22,10 @@ if(isset($_POST['submit'])) { $query->execute(); $result = $query->fetchColumn(); if ($result > 0) { - if (password_verify($password, $user->getPassword($con, $username))) { + if (password_verify($password, $user->getPassword())) { $_SESSION["user"] = $user->getID($con, $username); header("Location: /home"); + header('location: /home'); //echo $_SESSION["user"]; } else { $passwordiswrong = true;