Admin page with SQL table creation and insertion
diff --git a/admin/createtable.php b/admin/createtable.php
new file mode 100644
index 0000000..027788c
--- /dev/null
+++ b/admin/createtable.php
@@ -0,0 +1,19 @@
+<?php
+ require '../credentials.php';
+ require '../php/utils.php';
+
+ $dbname = $_GET['dbname'];
+
+ $create = "CREATE TABLE `".$dbname."` (
+ `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ `nom` varchar(100) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL,
+ `curs` tinyint(1) NOT NULL,
+ `grau` tinyint(1) NOT NULL,
+ `quimata` int(11) NOT NULL,
+ `requested` tinyint(1) NOT NULL DEFAULT 0,
+ `mort` tinyint(1) NOT NULL DEFAULT 0,
+ `password` varchar(100) NOT NULL DEFAULT ''
+ )";
+
+ if (query($create)) header("Location: ./index.php?dbname=".$dbname);
+?>