WIP
This commit is contained in:
49
dist/pvv_postgresql.sql
vendored
Normal file
49
dist/pvv_postgresql.sql
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
CREATE TABLE events (
|
||||
id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
name TEXT,
|
||||
start TEXT,
|
||||
stop TEXT,
|
||||
organiser TEXT,
|
||||
location TEXT,
|
||||
description TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE projects (
|
||||
id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
name TEXT,
|
||||
description TEXT,
|
||||
active BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE projectmembers (
|
||||
projectid INTEGER,
|
||||
name TEXT,
|
||||
uname TEXT,
|
||||
mail TEXT,
|
||||
role TEXT,
|
||||
lead BOOLEAN DEFAULT FALSE,
|
||||
owner BOOLEAN DEFAULT FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE users (
|
||||
uname TEXT,
|
||||
groups INT DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE motd (
|
||||
id INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
title TEXT,
|
||||
content TEXT
|
||||
);
|
||||
|
||||
-- INSERT example
|
||||
-- INSERT INTO motd (title, content)
|
||||
-- VALUES ('MOTD ./dev.sh', 'du kan endre motd i admin panelet');
|
||||
|
||||
CREATE TABLE door (
|
||||
time INTEGER PRIMARY KEY,
|
||||
open BOOLEAN
|
||||
);
|
||||
|
||||
INSERT INTO door (time, open)
|
||||
VALUES (0, FALSE);
|
||||
@@ -33,7 +33,7 @@ $desc = $_POST['desc'];
|
||||
$name = $_POST['organisername'];
|
||||
$uname = $_POST['organiser'];
|
||||
$mail = $_POST['organiseremail'];
|
||||
$active = ($_POST['active'] ?? 0);
|
||||
$active = ($_POST['active'] ?? false);
|
||||
|
||||
|
||||
if ($id == 0) {
|
||||
@@ -42,7 +42,7 @@ if ($id == 0) {
|
||||
|
||||
$statement->bindParam(':title', $title, PDO::PARAM_STR);
|
||||
$statement->bindParam(':desc', $desc, PDO::PARAM_STR);
|
||||
$statement->bindParam(':active', $active, PDO::PARAM_INT);
|
||||
$statement->bindParam(':active', $active, PDO::PARAM_BOOL);
|
||||
|
||||
$statement->execute();
|
||||
|
||||
@@ -59,7 +59,7 @@ if ($id == 0) {
|
||||
|
||||
$statement->bindParam(':title', $title, PDO::PARAM_STR);
|
||||
$statement->bindParam(':desc', $desc, PDO::PARAM_STR);
|
||||
$statement->bindParam(':active', $active, PDO::PARAM_INT);
|
||||
$statement->bindParam(':active', $active, PDO::PARAM_BOOL);
|
||||
$statement->bindParam(':id', $id, PDO::PARAM_INT);
|
||||
|
||||
$statement->execute();
|
||||
@@ -77,4 +77,4 @@ if ($id == 0) {
|
||||
header('Location: .');
|
||||
?>
|
||||
|
||||
<a href=".?page=1">Om du ikke ble automatisk omdirigert tilbake klikk her</a>
|
||||
<a href=".?page=1">Om du ikke ble automatisk omdirigert tilbake klikk her</a>
|
||||
|
||||
Reference in New Issue
Block a user