+
+
+
diff --git a/pages/edit/index.php b/pages/edit/index.php
new file mode 100644
index 0000000..759d7ac
--- /dev/null
+++ b/pages/edit/index.php
@@ -0,0 +1,94 @@
+ 0)
+ {
+ $varRows = $c->query("SELECT * from post where id = ?", $strId);
+
+ if (count($varRows) !== 1)
+ {
+ BootstrapRender::message("Zero or more than one row returned", "danger");
+ }
+
+ $varRow = $varRows[0];
+ $strPath = $varRow["path"];
+ $strContent = $varRow["content"];
+ }
+
+
+ if (Request::posts("path", "content"))
+ {
+ $strPath = Request::getPosted("path");
+ $strContent = Request::getPosted("content");
+
+ if ($strId == null || strlen($strId) < 1)
+ {
+ $c->query(
+ "INSERT into post (author, path, content)
+ values (?, ?, ?)",
+ "caharkness@gmail.com",
+ $strPath,
+ $strContent);
+
+ $strId = $c->query("SELECT * from post where rowid = last_insert_rowid()")[0]["id"];
+ }
+
+ $c->query(
+ "UPDATE post
+ set
+ path = ?,
+ content = ?,
+ updated = current_timestamp",
+ $strPath,
+ $strContent);
+
+ Respond::redirect("/edit/{$strId}");
+ }
+
+ if (strlen($strId) > 0)
+ {
+ $varRows = $c->query("SELECT * from post where id = ?", $strId);
+
+
+
+
+
+ }
+?>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/index.php b/pages/index.php
new file mode 100644
index 0000000..fe8f119
--- /dev/null
+++ b/pages/index.php
@@ -0,0 +1,39 @@
+query(
+ "CREATE table if not exists post (
+ id integer primary key autoincrement,
+ author text not null,
+ path text not null,
+ content text not null,
+ created timestamp not null default current_timestamp,
+ updated timestamp not null default current_timestamp)");
+
+ $varPosts = $c->query(
+ "SELECT *
+ from post
+ where
+ path like ?
+ or path like '*'",
+ $strPath);
+
+ $varParsedown = new Parsedown();
+?>
+
+
+