diff --git a/public/forum/categories.php b/public/forum/categories.php
new file mode 100644
index 0000000..8dc662e
--- /dev/null
+++ b/public/forum/categories.php
@@ -0,0 +1,49 @@
+ PDO::ERRMODE_EXCEPTION
+ ));
+}catch (Exception $e){
+ die("Error : ".$e->getMessage());
+}
+$req = $db->prepare('SELECT * FROM `categories`');
+$req->execute();
+$rows = $req->fetchAll(PDO::FETCH_ASSOC);
+?>
+
Categories
+
+
+
+ Title |
+ Description |
+
+
+
+
+
+ =$row['cat_name']?> |
+ =$row['cat_description']?> |
+
+
+
+Create a category
+
diff --git a/public/forum/createcategory.php b/public/forum/createcategory.php
new file mode 100644
index 0000000..8632867
--- /dev/null
+++ b/public/forum/createcategory.php
@@ -0,0 +1,62 @@
+ PDO::ERRMODE_EXCEPTION
+ ));
+ }catch (Exception $e){
+ die("Error : ".$e->getMessage());
+ }
+ $req = $db->prepare('INSERT INTO `categories` (cat_name, cat_description) VALUES (:cat_name, :cat_description)');
+ $req->execute(array(
+ "cat_name"=>$name,
+ "cat_description"=>$description
+ ));
+}
+
+ini_set('display_errors', 1);
+ini_set('display_startup_errors', 1);
+error_reporting(E_ALL);
+session_start();
+
+$_SESSION['error_msg'] = "";
+if (isset($_POST['submit']))
+{
+ if (isset($_SESSION['username'])) {
+ if (isset($_POST['title']))
+ {
+ $name = $_POST['title'];
+ } else
+ {
+ $_SESSION['error_msg'] .= "You did not enter a proper category title. \n";
+ }
+ if (isset($_POST['description']))
+ {
+ $description = $_POST['description'];
+ } else
+ {
+ $_SESSION['error_msg'] .= "You did not enter a proper category description. \n";
+ }
+ } else {
+ $_SESSION['error_msg'] .= "You did not log in.\n";
+ header('Location: '."/auth/login/");
+ }
+} else
+{
+ $_SESSION['error_msg'] .= "You did not sumit the category creation form.\n";
+}
+
+if ($_SESSION['error_msg'] == "")
+{
+ create_category($name, $description);
+ header('Location: '."/forum");
+} else {
+ header('Location: '."/auth/login/");
+}
+?>
\ No newline at end of file
diff --git a/public/forum/index.php b/public/forum/index.php
new file mode 100644
index 0000000..0912984
--- /dev/null
+++ b/public/forum/index.php
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+ Chiro - Canto
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/home/last-uploaded-file.php b/public/home/last-uploaded-file.php
new file mode 100644
index 0000000..7e8445f
--- /dev/null
+++ b/public/home/last-uploaded-file.php
@@ -0,0 +1,32 @@
+ PDO::ERRMODE_EXCEPTION
+ ));
+} catch (Exception $e) {
+ die("Error : ".$e->getMessage());
+}
+
+$req = $db->prepare('SELECT id, recordist_name, file_name, license, species, sound_type, date, time FROM `records` ORDER BY `entry_timestamp` ASC LIMIT 1');
+$req->execute();
+if ($data = $req->fetch())
+{
+ ?>
+
+
=$data['file_name']?>
+
=$data['species']?>
+
Recorded on =$data['date']?> at =$data['time']?>
+
+
=$data['license']?> =$data['recordist_name']?>
+
+
\ No newline at end of file
diff --git a/public/index.php b/public/index.php
index ad5c9f3..c5db3f4 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1,8 +1,10 @@
@@ -19,6 +21,7 @@ session_start();