diff --git a/.hta_404.php b/.hta_404.php index c453172..c804d9f 100644 --- a/.hta_404.php +++ b/.hta_404.php @@ -39,7 +39,7 @@ if (isset($content[0]['content']) && $content[0]['content']) { $pageContent = ' -
+

' . htmlspecialchars($content[0]['title']) . '

@@ -50,7 +50,7 @@ saveHtmlFile($fileName, $headerContent, $pageContent); } else { $pageContent = ' -
+

Page not found (404).

Back to home
'; diff --git a/.hta_admin_header.php b/.hta_admin_header.php new file mode 100644 index 0000000..b8942f0 --- /dev/null +++ b/.hta_admin_header.php @@ -0,0 +1,20 @@ + + \ No newline at end of file diff --git a/admin/add-content.php b/admin/add-content.php new file mode 100644 index 0000000..27cf906 --- /dev/null +++ b/admin/add-content.php @@ -0,0 +1,143 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Set the PDO error mode to exception + $stmt = $db->prepare("INSERT INTO scc24 (date_created, type, title, slug, content) VALUES (:date_created, :type, :title, :slug, :content)"); + $stmt->bindParam(':date_created', $current_date_time); + $stmt->bindParam(':type', $_POST['type']); + $stmt->bindParam(':title', $_POST['title']); + $stmt->bindParam(':slug', $_POST['slug']); + $stmt->bindParam(':content', $_POST['content']); + if ($stmt->execute()) { + echo 'New '.$_POST['type'].' created.'; + } else { + echo "Error executing statement: " . $stmt->errorInfo()[2]; // need to implement this Err. check specially for new entry to mariaDB + } + + }catch (PDOException $e) { + // echo 'errorID:3001: "New Registration Server" busy!'; + echo "Error: " . $e->getMessage(); + }; + } +?> + +
+

Create New Page or Notice

+
+ +
+
+
+ +
+
+ + + + + + +
+
+ + + + + \ No newline at end of file diff --git a/admin/edit-content.php b/admin/edit-content.php new file mode 100644 index 0000000..9365e77 --- /dev/null +++ b/admin/edit-content.php @@ -0,0 +1,149 @@ + + + + + +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $conn->prepare("UPDATE scc24 SET `type` = :type, `title` = :title, `slug` = :slug, `content` = :content WHERE `id` = :getID"); + $stmt->bindParam(':getID', $getID); + $stmt->bindParam(':type', $_POST['type']); + $stmt->bindParam(':title', $_POST['title']); + $stmt->bindParam(':slug', $_POST['slug']); + $stmt->bindParam(':content', $_POST['content']); + $stmt->execute(); + // echo ""; + } catch (PDOException $e) { + echo "Err: " . $e->getMessage(); + } + } + +?> +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $db->prepare("SELECT * FROM scc24 WHERE `id` = :id"); + $stmt->bindParam(':id', $getID); + $stmt->execute(); + $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); + foreach($rows as $row){ + echo '
+

Edit New Page or Notice

+
+ '; + ?> +
+ Page Title:
+
+ +
+ + +
+
'; + echo ''; + }; + + // exit(); +} catch (PDOException $e) { + echo json_encode(array('success' => false, 'message' => 'Database error: ' . $e->getMessage())); +} +?> + \ No newline at end of file diff --git a/admin/file-list.php b/admin/file-list.php new file mode 100644 index 0000000..4975239 --- /dev/null +++ b/admin/file-list.php @@ -0,0 +1,324 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $conn->prepare("INSERT INTO scc_files (link, alt, file_name) VALUES (:link, :alt, :file_name)"); + $stmt->bindParam(':link', $file_url); + $stmt->bindParam(':alt', $desc_txt); + $stmt->bindParam(':file_name', $file_name); + $stmt->execute(); + echo "File uploaded and record saved successfully."; + } catch (PDOException $e) { + echo "Database Error: " . $e->getMessage(); + } + } else { + echo "Error: Could not move the uploaded file."; + } + } else { + echo "Error: Uploaded file is missing."; + } + } else { + switch ($_FILES['file']['error']) { + case UPLOAD_ERR_NO_FILE: + echo "No file was uploaded."; + break; + default: + echo "Unknown error occurred during file upload."; + break; + } + } + } + +?> +
+
+

Files List & Add New Files

+
+
+ +
+
+
+
+ No file selected + +
+ + +
+ +
+
+
+
+ +
+ + + + + + + + + + setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $conn->prepare("SELECT * FROM `scc_files` ORDER BY id DESC "); + $stmt->execute(); + $content = $stmt->fetchAll(PDO::FETCH_ASSOC); + foreach($content as $pageData){ ?> + + + + + + + +
IDFile LinkAction
+
+ + Copied! + View +
+
+
+ + + + \ No newline at end of file diff --git a/admin/page-list.php b/admin/page-list.php new file mode 100644 index 0000000..94bfab3 --- /dev/null +++ b/admin/page-list.php @@ -0,0 +1,82 @@ + +

Page Content List

+
+ + + + + + + + + + + setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $conn->prepare("SELECT * FROM `scc24` WHERE type != 'faculty' ORDER BY id DESC "); + $stmt->execute(); + $content = $stmt->fetchAll(PDO::FETCH_ASSOC); + foreach($content as $pageData){ ?> + + + + + + + + +
IDTypeTitleAction
+
+ Edit   + View +
+
+
+ + \ No newline at end of file diff --git a/assets/pell.css b/assets/pell.css new file mode 100644 index 0000000..0ee1ce5 --- /dev/null +++ b/assets/pell.css @@ -0,0 +1 @@ +.pell{border:1px solid hsla(0,0%,4%,.1)}.pell,.pell-content{box-sizing:border-box}.pell-content{height:450px;outline:0;overflow-y:auto;padding:10px}.pell-actionbar{background-color:#fff;border-bottom:1px solid hsla(0,0%,4%,.1)}.pell-button{background-color:transparent;border:none;cursor:pointer;height:30px;outline:0;width:30px;vertical-align:bottom}.pell-button-selected{background-color:#f0f0f0} \ No newline at end of file diff --git a/assets/pell.js b/assets/pell.js new file mode 100644 index 0000000..60ee7fb --- /dev/null +++ b/assets/pell.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.pell={})}(this,function(t){"use strict";var e=Object.assign||function(t){for(var e=1;eB",title:"Bold",state:function(){return n("bold")},result:function(){return f("bold")}},italic:{icon:"I",title:"Italic",state:function(){return n("italic")},result:function(){return f("italic")}},underline:{icon:"U",title:"Underline",state:function(){return n("underline")},result:function(){return f("underline")}},strikethrough:{icon:"S",title:"Strike-through",state:function(){return n("strikeThrough")},result:function(){return f("strikeThrough")}},heading1:{icon:"H1",title:"Heading 1",result:function(){return f(l,"

")}},heading2:{icon:"H2",title:"Heading 2",result:function(){return f(l,"

")}},paragraph:{icon:"¶",title:"Paragraph",result:function(){return f(l,"

")}},quote:{icon:"“ ”",title:"Quote",result:function(){return f(l,"

")}},olist:{icon:"#",title:"Ordered List",result:function(){return f("insertOrderedList")}},ulist:{icon:"•",title:"Unordered List",result:function(){return f("insertUnorderedList")}},code:{icon:"</>",title:"Code",result:function(){return f(l,"
")}},line:{icon:"―",title:"Horizontal Line",result:function(){return f("insertHorizontalRule")}},link:{icon:"🔗",title:"Link",result:function(){var t=window.prompt("Enter the link URL");t&&f("createLink",t)}},image:{icon:"📷",title:"Image",result:function(){var t=window.prompt("Enter the image URL");t&&f("insertImage",t)}}},m={actionbar:"pell-actionbar",button:"pell-button",content:"pell-content",selected:"pell-button-selected"},r=function(n){var t=n.actions?n.actions.map(function(t){return"string"==typeof t?p[t]:p[t.name]?e({},p[t.name],t):t}):Object.keys(p).map(function(t){return p[t]}),r=e({},m,n.classes),i=n[c]||"div",o=d("div");o.className=r.actionbar,s(n.element,o);var u=n.element.content=d("div");return u.contentEditable=!0,u.className=r.content,u.oninput=function(t){var e=t.target.firstChild;e&&3===e.nodeType?f(l,"<"+i+">"):"
"===u.innerHTML&&(u.innerHTML=""),n.onChange(u.innerHTML)},u.onkeydown=function(t){var e;"Enter"===t.key&&"blockquote"===(e=l,document.queryCommandValue(e))&&setTimeout(function(){return f(l,"<"+i+">")},0)},s(n.element,u),t.forEach(function(t){var e=d("button");if(e.className=r.button,e.innerHTML=t.icon,e.title=t.title,e.setAttribute("type","button"),e.onclick=function(){return t.result()&&u.focus()},t.state){var n=function(){return e.classList[t.state()?"add":"remove"](r.selected)};a(u,"keyup",n),a(u,"mouseup",n),a(e,"click",n)}s(o,e)}),n.styleWithCSS&&f("styleWithCSS"),f(c,i),n.element},i={exec:f,init:r};t.exec=f,t.init=r,t.default=i,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/assets/upload.svg b/assets/upload.svg new file mode 100644 index 0000000..b6862d7 --- /dev/null +++ b/assets/upload.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/uploaded-file/logo (1).png b/assets/uploaded-file/logo (1).png new file mode 100644 index 0000000..77335ea Binary files /dev/null and b/assets/uploaded-file/logo (1).png differ diff --git a/assets/uploaded-file/school-image-3.png b/assets/uploaded-file/school-image-3.png new file mode 100644 index 0000000..acc848a Binary files /dev/null and b/assets/uploaded-file/school-image-3.png differ