From 716dea87b2f0aa97d72e5db3c2f0d2a5b65b88d2 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 14 Jan 2022 07:43:31 +0100 Subject: [PATCH] Commit some shit --- app/class/DatabaseHandler.php | 23 ++++ app/class/Template.php | 24 ++++ app/common.php | 9 ++ app/template/footer.php | 14 ++ app/template/header.php | 80 +++++++++++ index.php | 3 + public/example.php | 15 +++ public/index.php | 13 ++ public/login.php | 25 ++++ public/logout.php | 16 +++ .../img/cropped-kf-propell-ikon-32x32.png | Bin 0 -> 1791 bytes public/static/style/main.css | 126 ++++++++++++++++++ public/subdir/index.php | 15 +++ 13 files changed, 363 insertions(+) create mode 100644 app/class/DatabaseHandler.php create mode 100644 app/class/Template.php create mode 100644 app/common.php create mode 100644 app/template/footer.php create mode 100644 app/template/header.php create mode 100644 index.php create mode 100644 public/example.php create mode 100644 public/index.php create mode 100644 public/login.php create mode 100644 public/logout.php create mode 100644 public/static/img/cropped-kf-propell-ikon-32x32.png create mode 100644 public/static/style/main.css create mode 100644 public/subdir/index.php diff --git a/app/class/DatabaseHandler.php b/app/class/DatabaseHandler.php new file mode 100644 index 0000000..dbbda55 --- /dev/null +++ b/app/class/DatabaseHandler.php @@ -0,0 +1,23 @@ + true, + ]; + try { + return new PDO($dsn, $user, $pass, $options); + } catch (PDOException $e) { + throw new PDOException($e->getMessage(), (int)$e->getCode()); + } + } +} \ No newline at end of file diff --git a/app/class/Template.php b/app/class/Template.php new file mode 100644 index 0000000..913d6e3 --- /dev/null +++ b/app/class/Template.php @@ -0,0 +1,24 @@ + 1)) { + $url = htmlspecialchars($url . '/'); + } + + + //FUUUUUCKKK + echo($_SERVER['DOCUMENT_ROOT'] . ' ' . __DIR__); + die(); + return($url.$path); + } + + public function render($name): void + { + require(__DIR__ . '/../template/' . $name . '.php'); + } +} \ No newline at end of file diff --git a/app/common.php b/app/common.php new file mode 100644 index 0000000..62b6aa6 --- /dev/null +++ b/app/common.php @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/app/template/header.php b/app/template/header.php new file mode 100644 index 0000000..e86d03c --- /dev/null +++ b/app/template/header.php @@ -0,0 +1,80 @@ + + + + + + + <?=htmlspecialchars($this->params["title"]);?> – Stafett for livet + + + + + +
+ +
+ + +
+
+ Logg ut +
Inlogget som:
+
+
+ + +
+ +
+ +
+ +
+ 0)) { + foreach ($_SESSION['alert'] as $alert) { + switch ($alert[0]) { + case 'success': + $prefix = 'Suksess –'; + break; + + case 'info': + $prefix = 'Info –'; + break; + + case 'warning': + $prefix = 'Varsel –'; + break; + + case 'danger': + $prefix = 'Error –'; + break; + + default: + $alert[0] = 'danger'; + $prefix = 'Ukjent –'; + break; + } + echo('
'.$prefix.' '.$alert[1].'
'); + } + $_SESSION['alert'] = []; + } + ?> +
diff --git a/index.php b/index.php new file mode 100644 index 0000000..6cb74c3 --- /dev/null +++ b/index.php @@ -0,0 +1,3 @@ +render("header"); +?> + +

Eksempel side

+

Dette er en eksempel side

+ +render("footer"); +?> \ No newline at end of file diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..f34af34 --- /dev/null +++ b/public/index.php @@ -0,0 +1,13 @@ +render("header"); +?> + +

Forsida!

+

Vi planlegger for Kreftforeningens Stafett for livet Kristiansand i juni 2021 og håper du blir med.

+

Stafettene i 2021 tilpasses nasjonale og lokale smittevernsråd, og det vil være lokale variasjoner i hvordan stafettene gjennomføres. Men målet er likt: Vi skal hedre fighterne, vise vår støtte, minnes de vi har mistet, gi håp og feire livet.

+ +render("footer"); +?> \ No newline at end of file diff --git a/public/login.php b/public/login.php new file mode 100644 index 0000000..c61f294 --- /dev/null +++ b/public/login.php @@ -0,0 +1,25 @@ +render("header"); +?> + +

Logg inn

+

Fyll ut legitimasjonen din for å logge inn.

+ +
+ +
+ +
+ +
+ +
+
+ +
+ +render("footer"); +?> \ No newline at end of file diff --git a/public/logout.php b/public/logout.php new file mode 100644 index 0000000..f196f4e --- /dev/null +++ b/public/logout.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/public/static/img/cropped-kf-propell-ikon-32x32.png b/public/static/img/cropped-kf-propell-ikon-32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..10f4bac65a6a424562cacfede794de1bf8e4aa12 GIT binary patch literal 1791 zcmVHkN*nR#HuCMeR$JiZPVf*xC|nikLBCez0gq%h(GQuBcmiH}Igb24hTr_osj@ zmj%$9it!BF_#I2O%jUcdc7IdJ~51fz!EYO1WB8neAJ% z;mg~Pe8sos77_Wnh}`$;oU8gePIfF;)v?Cp0gNfEKav)aKM3+m;Gs(bXb)o|g-V4K zEDfx=-lFYQ^=dZ_gQV-0x+1d#zQ^Ewh?sL5u;9X9f!8h>peGw`kDM-cs>BLTp+rGd@vSNS*fX!x7bUUQ zo^QVhsg%dO8*6uun^5xnf@#01Z+&O~nCzKM(t4&dC`z;h$;7)s5d3l0mY=ou>&ajM zHtd*yl_QCS?-d6=<$6L>%U5 zdTS?VT8`r<1N=mQANY8_-~Z`6-~XNO2M^sqHI>^;KQ{=T2E+@eB$NEHAI8+B&YbN3w>STke^e!A=CF(^y_ zb$pS7;Jy0NRVT|*Q)`a*MP!}QJrXg{G_eLb8&OnIL|o#dxtIYjDL{ry-XQ?$^ot6= zKtajUd*(-^idT@fbICfrfIQfogG_{GLcEG1C{68iojtFB1R@dvhd&j-DNa>U1$E#w zhn`tWS@Jk%{l$bj;;K=9_&r+pe}ro?Bqx?qGrxXTa%%0`^!<1IdZZe8YWqzSRJk5> znmVpgb_wCp4>LCO_ecP5ObOrb54mJ#Ic^sC{ijbN^upp@E@H+7vu5bi0j(^ z!IGxmQube;kDjU{OGFK z(f%w;rH#7d+#CYT3l~oh<){wwQ5KJKjp}VthT606=a)$Y-CIFAV zdBgN5(ih@bZ;T=(jwy&baycazDU+@o$E^D47@)YVjp{?qR3H8~xjsiCT}=6u&ysBz zN7u#_5iz00gae%DA$v^Gy4%?3&T|0Z$G7i#|GTfvnHNPmJC}2d!cb@Da&DZeEv+c7 z?3p?3+7oqSrZiR_*psf=({Qit>L!YnTm-7no#~^ZxDx%aIO8Fu{jG`SJ1o2_Cq~3` zfL%iX0DgY=Zh*ao928s0d}mV1DF@X-ta)Koa1O#Sf<$qsC%t=&xXm6WFD`{2g;s18lr3j{bW++Gjvh3BDiz)uyteI znr0)i#KVLh_D_TFU(6DqaIY$6fH=UzGhS^yaG| a { + color: #f8f8f8; +} + +.footer { + background: #d8d8d8; + border-top: 1px solid #aaa; + padding: 12px; + max-width: 888px; + margin: 0 auto; +} +.grid-container { + background: #fff; + + display: grid; + grid-template-columns: max-content auto; + grid-gap: 12px; + + max-width: 888px; + margin: 0 auto; + padding: 12px; +} + +.grid-container main img { + display: block; + max-width: 100%; + height: auto; + border: 1px solid #aaa; +} + +.grid-container .nav-links { + background: #eee; + border: 1px solid #aaa; + padding: 12px; +} +.grid-container .nav-links ul { + margin: 0; + padding-left: 12px; +} + +a { + color: rgb(0, 0, 255); +} + +@media only screen and (max-width: 600px) { + .grid-container { + grid-template-columns: auto; + } +} + +.alert { + padding: 8px; + margin-bottom: 8px; + border: 1px solid transparent; + border-radius: 2px; +} +.alert-info { + color: #0c5460; + background-color: #d1ecf1; + border-color: #62b1bd; + background: linear-gradient(0deg, rgba(167,223,232,1) 0%, rgba(209,236,241,1) 100%); +} +.alert-success { + color: #155724; + background-color: #d4edda; + border-color: #56bf6e; + background: linear-gradient(0deg, rgba(165,227,180,1) 0%, rgba(212,237,218,1) 100%); +} +.alert-danger { + color: #721c24; + background-color: #f8d7da; + border-color: #c8848c; + background: linear-gradient(0deg, rgb(249, 180, 186) 0%, rgb(248, 215, 218) 100%); +} +.alert-warning { + color: #856404; + background: #fff3cd; + border-color: #dfc678; + background: linear-gradient(0deg, rgb(251, 229, 161) 0%, rgb(255, 243, 205) 100%); +} \ No newline at end of file diff --git a/public/subdir/index.php b/public/subdir/index.php new file mode 100644 index 0000000..532b273 --- /dev/null +++ b/public/subdir/index.php @@ -0,0 +1,15 @@ +render("header"); +?> + +

Eksempel side

+

Dette er en eksempel side

+ +render("footer"); +?> \ No newline at end of file