sdsfopsk;gfl;]

This commit is contained in:
ui0ppk 2023-02-18 16:27:52 +02:00
parent d77cba7ad4
commit e48ecd5117
2 changed files with 9 additions and 9 deletions

View File

@ -21,7 +21,7 @@ SET time_zone = "+00:00";
-- Table structure for table `catalog` -- Table structure for table `catalog`
-- --
CREATE TABLE `catalog` ( CREATE TABLE IF NOT EXISTS `catalog` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`name` varchar(50) NOT NULL, `name` varchar(50) NOT NULL,
`description` varchar(255) NOT NULL, `description` varchar(255) NOT NULL,
@ -43,7 +43,7 @@ CREATE TABLE `catalog` (
-- Table structure for table `comments` -- Table structure for table `comments`
-- --
CREATE TABLE `comments` ( CREATE TABLE IF NOT EXISTS `comments` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`user` int(11) NOT NULL, `user` int(11) NOT NULL,
`type` varchar(250) NOT NULL, `type` varchar(250) NOT NULL,
@ -56,7 +56,7 @@ CREATE TABLE `comments` (
-- Table structure for table `friends` -- Table structure for table `friends`
-- --
CREATE TABLE `friends` ( CREATE TABLE IF NOT EXISTS `friends` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`user` int(11) NOT NULL, `user` int(11) NOT NULL,
`state` varchar(50) NOT NULL DEFAULT 'pending', `state` varchar(50) NOT NULL DEFAULT 'pending',
@ -69,7 +69,7 @@ CREATE TABLE `friends` (
-- Table structure for table `friendships` -- Table structure for table `friendships`
-- --
CREATE TABLE `friendships` ( CREATE TABLE IF NOT EXISTS `friendships` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`user1` int(11) NOT NULL, `user1` int(11) NOT NULL,
`user2` int(11) NOT NULL, `user2` int(11) NOT NULL,
@ -82,7 +82,7 @@ CREATE TABLE `friendships` (
-- Table structure for table `games` -- Table structure for table `games`
-- --
CREATE TABLE `games` ( CREATE TABLE IF NOT EXISTS `games` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`name` varchar(50) NOT NULL, `name` varchar(50) NOT NULL,
`description` varchar(255) NOT NULL, `description` varchar(255) NOT NULL,
@ -101,7 +101,7 @@ CREATE TABLE `games` (
-- Table structure for table `jobs` -- Table structure for table `jobs`
-- --
CREATE TABLE `jobs` ( CREATE TABLE IF NOT EXISTS `jobs` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`jobid` varchar(50) NOT NULL, `jobid` varchar(50) NOT NULL,
`placeid` int(11) NOT NULL, `placeid` int(11) NOT NULL,
@ -115,7 +115,7 @@ CREATE TABLE `jobs` (
-- Table structure for table `tokens` -- Table structure for table `tokens`
-- --
CREATE TABLE `tokens` ( CREATE TABLE IF NOT EXISTS `tokens` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`token` varchar(500) NOT NULL, `token` varchar(500) NOT NULL,
`placeid` int(11) NOT NULL, `placeid` int(11) NOT NULL,
@ -130,7 +130,7 @@ CREATE TABLE `tokens` (
-- Table structure for table `users` -- Table structure for table `users`
-- --
CREATE TABLE `users` ( CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`username` varchar(20) NOT NULL, `username` varchar(20) NOT NULL,
`password` varchar(450) NOT NULL, `password` varchar(450) NOT NULL,

View File

@ -54,7 +54,7 @@ $getitstarted->header();
</img> </img>
<div style="margin-bottom: 50px;"></div> <div style="margin-bottom: 50px;"></div>
<div class="d-flex flex-row justify-content-between mb-3"> <div class="d-flex flex-row justify-content-between mb-3">
<h4 class=" card-title">Friends (<?php $q=$con->prepare("SELECT count(*) FROM friends WHERE user=:id AND state='approved'"); $q->bindParam(':id',$_SESSION['user'],PDO::PARAM_INT); $q->execute(); $numberOfFriends = $q->fetchColumn(); echo $numberOfFriends; ?>)</h4> <h4 class=" card-title">Friends (<?php $q=$con->prepare("SELECT count(*) FROM friendships WHERE user1=:id AND isAccepted=1"); $q->bindParam(':id',$_SESSION['user'],PDO::PARAM_INT); $q->execute(); $numberOfFriends = $q->fetchColumn(); echo $numberOfFriends; ?>)</h4>
<a href="/friends" class="btn btn-link text-decoration-none align-self-end">See all <i class="bi bi-caret-right"></i></a> <a href="/friends" class="btn btn-link text-decoration-none align-self-end">See all <i class="bi bi-caret-right"></i></a>
</div> </div>
<div class="card mb-3 shadow-sm" style="height: 11.75rem;"> <div class="card mb-3 shadow-sm" style="height: 11.75rem;">