├── .gitignore ├── README.md ├── sql └── mvc_db.sql └── src ├── .htaccess ├── config └── config.php ├── controller ├── About.php ├── Auth.php ├── Category.php ├── Contact.php ├── Dashboard.php ├── Home.php └── Navbar.php ├── index.php ├── info.php ├── lib ├── Application.php ├── Controller.php ├── Database.php ├── Debug.php ├── File.php ├── Helper.php ├── Message.php ├── Model.php ├── Session.php └── View.php ├── model ├── About_Model.php ├── Auth_Model.php ├── Category_Model.php ├── Contact_Model.php ├── Dashboard_Model.php ├── Home_Model.php └── Navbar_Model.php ├── partial ├── debug.php ├── footer.php ├── footer_end.php ├── footer_essentials.php ├── header.php ├── message.php ├── navbar.php └── sidebar.php ├── public ├── css │ ├── main.css │ ├── main.css.map │ ├── main.scss │ └── styles.css ├── img │ ├── default.jpg │ └── header-bg.jpg ├── js │ ├── pagination.js │ ├── scripts.js │ └── validation.js └── lib │ ├── bootstrap │ ├── bootstrap.css │ └── bootstrap.min.js │ ├── jquery │ ├── jquery-3.1.1.min.js │ └── jquery.min.js │ ├── popper │ └── popper.min.js │ └── tinymce │ ├── skins │ └── lightgray │ │ ├── content.inline.min.css │ │ ├── content.min.css │ │ ├── content.mobile.min.css │ │ ├── fonts │ │ ├── tinymce-mobile.woff │ │ ├── tinymce-small.eot │ │ ├── tinymce-small.svg │ │ ├── tinymce-small.ttf │ │ ├── tinymce-small.woff │ │ ├── tinymce.eot │ │ ├── tinymce.svg │ │ ├── tinymce.ttf │ │ └── tinymce.woff │ │ ├── img │ │ ├── anchor.gif │ │ ├── loader.gif │ │ ├── object.gif │ │ └── trans.gif │ │ ├── skin.min.css │ │ └── skin.mobile.min.css │ ├── themes │ ├── inlite │ │ └── theme.min.js │ ├── mobile │ │ └── theme.min.js │ └── modern │ │ └── theme.min.js │ └── tinymce-4.8.1.min.js ├── uploads └── images │ └── 2018 │ └── 09 │ ├── 14 │ ├── 1536913237-9845-thumb.jpg │ ├── 1536913237-9845.jpg │ ├── 1536913290-2706-thumb.jpg │ ├── 1536913290-2706.jpg │ ├── 1536913366-496-thumb.jpg │ ├── 1536913366-496.jpg │ ├── 1536913444-6969-thumb.jpg │ ├── 1536913444-6969.jpg │ ├── 1536913542-2102-thumb.jpg │ ├── 1536913542-2102.jpg │ ├── 1536913621-853-thumb.jpg │ ├── 1536913621-853.jpg │ ├── 1536913750-4448-thumb.jpg │ ├── 1536913750-4448.jpg │ ├── 1536913812-1393-thumb.jpg │ ├── 1536913812-1393.jpg │ ├── 1536913867-9338-thumb.jpg │ ├── 1536913867-9338.jpg │ ├── 1536913916-1177-thumb.jpg │ ├── 1536913916-1177.jpg │ ├── 1536913959-433-thumb.jpg │ ├── 1536913959-433.jpg │ ├── 1536914158-4046-thumb.jpg │ ├── 1536914158-4046.jpg │ ├── 1536914198-2443-thumb.jpg │ ├── 1536914198-2443.jpg │ ├── 1536914235-9919-thumb.jpg │ ├── 1536914235-9919.jpg │ ├── 1536914287-4434-thumb.jpg │ ├── 1536914287-4434.jpg │ ├── 1536914350-9139-thumb.jpg │ ├── 1536914350-9139.jpg │ ├── 1536914403-733-thumb.jpg │ ├── 1536914403-733.jpg │ ├── 1536914458-6646-thumb.jpg │ ├── 1536914458-6646.jpg │ ├── 1536914627-6200-thumb.jpg │ ├── 1536914627-6200.jpg │ ├── 1536914686-1449-thumb.jpg │ ├── 1536914686-1449.jpg │ ├── 1536914771-9762-thumb.jpg │ ├── 1536914771-9762.jpg │ ├── 1536916312-385-thumb.jpg │ ├── 1536916312-385.jpg │ ├── 1536916346-337-thumb.jpg │ └── 1536916346-337.jpg │ └── 18 │ ├── 1537266729-4155-thumb.jpg │ └── 1537266729-4155.jpg └── view ├── about └── index.php ├── auth ├── login.php └── register.php ├── category ├── show.php └── showAll.php ├── contact └── index.php ├── dashboard ├── add.php ├── allUserPosts.php ├── allUsers.php ├── category.php ├── edit.php ├── editProfile.php └── view.php └── home └── index.php /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Ignore .idea folder 3 | 4 | .idea/ 5 | /docs -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHP CMS – Blog 2 | 3 | > This project is a university task 👨‍🎓 4 | 5 | ## Task 6 | Create a CMS with own Fronted and Backend using PHP & MYSQL. The Website should have multiple pages and some private pages that can be only accessed when logged in. The logged in user should be able to do all CRUD functionalities with the posts. Make sure the data are persistent and stored in the database. 7 | 8 | ## Blog Features 9 | 10 | * Image upload Drag & Drop 11 | * Categories 12 | * Comments 13 | * CRUD Functionality 14 | * Form Validation 15 | * Pagination 16 | * Register/Login 17 | * Responsive Design 18 | * Search 19 | * Text Limit for Blogpost Preview 20 | * Text Styling with TinyMCE 21 | * User Ban-System 22 | * User Management (Admin, Editor...) 23 | * User Profile Editing (Read & Update) with individual User Images 24 | -------------------------------------------------------------------------------- /src/.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | 3 | RewriteCond %{REQUEST_FILENAME} !-d 4 | RewriteCond %{REQUEST_FILENAME} !-f 5 | RewriteCond %{REQUEST_FILENAME} !-l 6 | 7 | # Comment 8 | RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] 9 | -------------------------------------------------------------------------------- /src/config/config.php: -------------------------------------------------------------------------------- 1 | view->render('about/index'); 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /src/controller/Auth.php: -------------------------------------------------------------------------------- 1 | model->getUserFromEmail($user['email']); 12 | 13 | // Save all emails 14 | $error = array(); 15 | 16 | //Validate Email 17 | if (!filter_var($user['email'], FILTER_VALIDATE_EMAIL)) { 18 | $error['email_err'] = 'Not a valid mail'; 19 | } 20 | 21 | // Check if Mail already exists 22 | if ($userEntry) { 23 | $error['email_err'] = 'E-Mail already exists'; 24 | } 25 | 26 | // Validate Name 27 | if(empty($user['firstname'])){ 28 | $error['name_err'] = 'Please enter first name'; 29 | } 30 | 31 | // Validate Name 32 | if(empty($user['lastname'])){ 33 | $error['lastname_err'] = 'Please enter last name'; 34 | } 35 | 36 | // Validate Password 37 | if(empty($user['password'])){ 38 | $error['password_err'] = 'Please enter password'; 39 | } elseif(strlen($user['password']) < 6){ 40 | $error['password_err'] = 'Password must be at least 6 characters'; 41 | } 42 | 43 | // Validate Confirm Password 44 | if(empty($user['confirm_password'])){ 45 | $error['confirm_password_err'] = 'Please confirm password'; 46 | } else { 47 | if($user['password'] != $user['confirm_password']){ 48 | $error['confirm_password_err'] = 'Passwords do not match'; 49 | } 50 | } 51 | 52 | // Check for error - if no error register 53 | if($error) { 54 | $this->view->error = $error; 55 | $this->view->formData = $user; 56 | 57 | $this->view->render('auth/register'); 58 | } else { 59 | Message::add('You are registered and can now log in'); 60 | $this->model->registerUser($user); 61 | 62 | // Change location (goto login) 63 | header('Location: ' . URL . 'auth/login'); 64 | } 65 | 66 | } 67 | 68 | public function doLogin() { 69 | //Get credentials from POST 70 | $user = $_POST; 71 | 72 | // Init data 73 | $user['email'] = trim($user['email']); 74 | $user['password'] = trim($user['password']); 75 | 76 | // Empty check 77 | if(empty($user['email']) || empty($user['password'])) { 78 | $this->view->email_err = 'Filling out the form would be a good start'; 79 | return $this->login(); 80 | } 81 | 82 | // Adds +1 to the login attempts if login is false 83 | $this->model->recordLoginAttempt($user['email']); 84 | 85 | // Get User Entry, Check if exists & Verify Password 86 | $userEntry = $this->model->loginUser($user); 87 | 88 | // Checking user entry + attempted logins 89 | if($userEntry && $userEntry['login_attempts'] < MAXIMUM_LOGINS) { 90 | Session::set('user', $userEntry); 91 | Session::set('user_image', $userEntry['image']); 92 | 93 | // Resets login attempts to 0 if login successfull 94 | $resetAttempts = $this->model->resetLoginAttempts($user['email']); 95 | header('Location: ' . URL . 'home'); 96 | return; 97 | } 98 | 99 | // Gets the attempted logins from the Database 100 | $checkLoginAttempts = $this->model->checkLoginAttempts($user['email']); 101 | 102 | // Check if login Attempts exceeded max logins. 103 | if($checkLoginAttempts >= MAXIMUM_LOGINS) { 104 | $this->view->email_err = 'Contact Admin. You\'re blocked.'; 105 | return $this->login(); 106 | } 107 | 108 | $this->view->email_err = 'Username or Password wrong.'; 109 | $this->login(); 110 | } 111 | 112 | public function logout() { 113 | // Remove userEntry from Session 114 | Session::remove('user'); 115 | session_destroy(); 116 | 117 | // Change location (goto home) 118 | header('Location: ' . URL . 'home'); 119 | } 120 | 121 | # ***************** 122 | # Render functions 123 | # ***************** 124 | 125 | public function login() { 126 | $this->view->render('auth/login'); 127 | } 128 | 129 | public function register() { 130 | //Render register view 131 | $this->view->render('auth/register'); 132 | } 133 | 134 | public function index() { 135 | $this->view->render('auth/register'); 136 | } 137 | 138 | } -------------------------------------------------------------------------------- /src/controller/Category.php: -------------------------------------------------------------------------------- 1 | model->getPostsByCategoryId($id, $search); 15 | $this->view->posts = $result; 16 | 17 | $this->view->render('category/showAll'); 18 | } 19 | 20 | 21 | # ********************** 22 | # Comment functionality 23 | # ********************** 24 | 25 | public function insertComment() { 26 | $comment = $_POST; 27 | # Split URL to get Id parameter 28 | $getId = explode("/", $_GET['url']); 29 | $postId = $getId[2]; 30 | # User input into comment field 31 | $user_comment = $comment['user_comment']; 32 | 33 | $this->model->userComment($user_comment, $postId); 34 | 35 | # Redirect to same page after comment has been submitted 36 | header("Location: " . URL . "category/show/$postId"); 37 | } 38 | 39 | # ************************ 40 | # Show Post Functionality 41 | # ************************ 42 | 43 | public function show($id) { 44 | # Get all Data needed for post 45 | $data = $this->model->getPostById($id); 46 | $comments = $this->model->getAllCommentsById($id); 47 | 48 | # Passing it into the view 49 | $this->view->data = $data; 50 | $this->view->comments = $comments; 51 | 52 | $this->view->render('category/show'); 53 | } 54 | 55 | # ************************ 56 | # Standard Index Render 57 | # ************************ 58 | 59 | public function index() { 60 | $this->view->render('category/digitalminimalism'); 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /src/controller/Contact.php: -------------------------------------------------------------------------------- 1 | view->render('contact/index'); 6 | } 7 | } -------------------------------------------------------------------------------- /src/controller/Dashboard.php: -------------------------------------------------------------------------------- 1 | model->addPost($category_id, $userId, $post_header, $post_content, $uploadedFile); 18 | 19 | Message::add('Perfect! New post has been added to your blog'); 20 | 21 | header('Location: ' . URL . 'dashboard/add'); 22 | } 23 | 24 | # Rendering the add Page - Only accessible if Admin status 25 | public function add() { 26 | if(Session::get('user')['permission'] == "Admin") { 27 | $data = $this->model->getCategories(); 28 | $this->view->data = $data; 29 | $this->view->render('dashboard/add'); 30 | } else { 31 | header('Location: ' . URL . 'dashboard'); 32 | } 33 | } 34 | 35 | # **************** 36 | # User Management 37 | # **************** 38 | 39 | public function allUsers() { 40 | $allPermissions = $this->model->getAllPermissions(); 41 | $allUsers = $this->model->getAllUsers(); 42 | $this->view->allUsers = $allUsers; 43 | $this->view->allPermissions = $allPermissions; 44 | $this->view->render('dashboard/allUsers'); 45 | } 46 | 47 | public function unbanUser() { 48 | $userEmail = explode("/", $_GET["url"]); 49 | $this->model->unbanUser($userEmail[2]); 50 | header("Location: " . URL . "dashboard/allUsers"); 51 | } 52 | 53 | public function banUser() { 54 | $userEmail = explode("/", $_GET["url"]); 55 | $this->model->banUser($userEmail[2]); 56 | header("Location: " . URL . "dashboard/allUsers"); 57 | } 58 | 59 | public function updatePermission() { 60 | $permission = $_POST['permission_id']; 61 | $userEmail = explode("/", $_GET["url"]); 62 | $this->model->updatePermission($permission ,$userEmail[2]); 63 | header("Location: " . URL . "dashboard/allUsers"); 64 | } 65 | 66 | # ********************** 67 | # Category functionality 68 | # *********************** 69 | 70 | public function category() { 71 | if(!(Session::get('user'))) { 72 | header("Location: " . URL . "home"); 73 | } else { 74 | $this->view->render('dashboard/category'); 75 | 76 | } 77 | } 78 | 79 | public function addCategory() { 80 | $getCategory = $_POST['category']; 81 | $this->model->insertCategory($getCategory); 82 | header("Location: " . URL . "dashboard/category"); 83 | } 84 | 85 | # ****************** 86 | # Edit User Profile 87 | # ****************** 88 | 89 | public function editProfile() { 90 | if(!(Session::get('user'))) { 91 | Header("Location: " . URL . "home"); 92 | } else { 93 | $userEmail = Session::get('user')['email']; 94 | $userImgThumb = Session::get('user')['thumb']; 95 | 96 | $userData = $this->model->getUserFromEmail($userEmail); 97 | $this->view->userData = $userData; 98 | $this->view->userImg = $userImgThumb; 99 | $this->view->render('dashboard/editProfile'); 100 | } 101 | } 102 | 103 | public function doUpdateUser() { 104 | $post = $_POST; 105 | $post_firstname = $_POST['firstname']; 106 | $user = Session::get('user'); 107 | $user_id = $user['id']; 108 | $post_lastname = $_POST['lastname']; 109 | $post_email = $_POST['email']; 110 | $post_password = $_POST['password']; 111 | $file_id = $_POST['file_id']; 112 | $new_foto = $_FILES['new_foto']; 113 | $userEmail = $user['email']; 114 | $userData = $this->model->getUserFromEmail($userEmail); 115 | $this->view->userData = $userData; 116 | 117 | if (!$new_foto['error']) { 118 | 119 | $uploadedFile = File::uploadImg($new_foto); 120 | 121 | if(!empty($user['image'])) { 122 | File::delete($user['thumb']); 123 | File::delete($user['image']); 124 | } 125 | 126 | if($user['file_id'] === NULL) { 127 | $this->model->uploadUserImage($user_id, $uploadedFile); 128 | } else { 129 | $this->model->updateFile($file_id, $uploadedFile); 130 | } 131 | } 132 | 133 | $this->view->post = $post; 134 | $this->model->editProfile($user_id, $post_firstname, $post_lastname, $post_email, $post_password); 135 | $updatedUser = $this->model->getUserById($user['id']); 136 | // Debug::add($updatedUser); 137 | Session::set("user", $updatedUser); 138 | // $this->view->render('dashboard/editProfile'); 139 | header('Location: ' . URL . 'dashboard/editProfile'); 140 | } 141 | 142 | # ************************************* 143 | # CRUD Functionality for View Posts 144 | # ************************************* 145 | 146 | public function view() { 147 | if(!(Session::get('user'))) { 148 | Header("Location: " . URL . "home"); 149 | } else { 150 | $posts = $this->model->getPosts(); 151 | $this->view->posts = $posts; 152 | $this->view->render('dashboard/view'); 153 | } 154 | } 155 | 156 | public function edit($id) { 157 | if(!(Session::get('user'))) { 158 | Header("Location: " . URL . "home"); 159 | } else { 160 | $posts = $this->model->getPostById($id); 161 | $this->view->posts = $posts; 162 | $this->view->render('dashboard/edit'); 163 | } 164 | } 165 | 166 | public function doEdit($id) { 167 | $post = $_POST; 168 | $posts = $this->model->getPostById($id); 169 | $post['id'] = $id; 170 | $post['header'] = trim($post['header']); 171 | $post['content'] = trim($post['content']); 172 | $file_id = $_POST['file_id']; 173 | $new_foto = $_FILES['new_foto']; 174 | 175 | if(empty($post['header']) || empty($post['content'])) { 176 | $this->view->post_err = 'Please fill out the complete form'; 177 | return $this->edit(); 178 | } 179 | 180 | if (!$new_foto['error']) { 181 | $uploadedFile = File::uploadImg($new_foto); 182 | 183 | File::delete($posts[0]->thumb); 184 | File::delete($posts[0]->image); 185 | 186 | $this->model->updateFile($file_id, $uploadedFile); 187 | } 188 | 189 | $this->view->post = $post; 190 | $this->model->updatePost($post); 191 | Message::add('Post updated'); 192 | 193 | header('Location: ' . URL . 'home'); 194 | } 195 | 196 | public function delete($id) { 197 | $post = $this->model->getPostById($id); 198 | $file_id = $post[0]->file_id; 199 | 200 | $this->model->deleteFile($file_id); 201 | $this->model->deletePost($id); 202 | File::delete($post[0]->image); 203 | File::delete($post[0]->thumb); 204 | 205 | Message::add('Post deleted', 'danger'); 206 | header('Location: ' . URL . 'home'); 207 | } 208 | 209 | public function allUserPosts() { 210 | $allPosts = $this->model->getPostsByEmail(); 211 | $this->view->allPosts = $allPosts; 212 | $this->view->render('dashboard/allUserPosts'); 213 | } 214 | 215 | public function index() { 216 | if(!(Session::get('user'))) { 217 | Header("Location: " . URL . "home"); 218 | } else { 219 | $this->view(); 220 | } 221 | } 222 | } -------------------------------------------------------------------------------- /src/controller/Home.php: -------------------------------------------------------------------------------- 1 | model->getPosts(); 10 | 11 | $this->view->post = $data; 12 | $this->view->render('home/index'); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /src/controller/Navbar.php: -------------------------------------------------------------------------------- 1 | model->getAllCategories(); 6 | $newCategories = array(); 7 | 8 | foreach($categories as $category) { 9 | $newCategories[$category['id']] = $category['category_name']; 10 | } 11 | 12 | Session::set('categories', $newCategories); 13 | Session::set('activeCategory', 'null'); 14 | } 15 | 16 | public function index () { 17 | // Nothing to do here 18 | } 19 | } -------------------------------------------------------------------------------- /src/index.php: -------------------------------------------------------------------------------- 1 | loadModel(); 25 | $navbarController->initCategories(); 26 | 27 | //------------------------------------------------------ 28 | // Autoload controller 29 | 30 | $file = 'controller/' . $url[0] . '.php'; 31 | if (file_exists($file)) { 32 | require $file; 33 | } else { 34 | echo "(404) No \"$url[0]\" controller found
"; 35 | } 36 | 37 | $controller = new $url[0]; 38 | 39 | 40 | 41 | //------------------------------------------------------ 42 | // Load a Model (if exists) 43 | $controller->loadModel(); 44 | 45 | //------------------------------------------------------ 46 | // Calling Controller-Methods 47 | if (isset($url[2])) { 48 | if (method_exists($controller, $url[1])) { 49 | $controller->{$url[1]}($url[2]); 50 | } else { 51 | echo "Echo calling method with param $url[1]($url[2])"; 52 | } 53 | } else { 54 | if (isset($url[1])) { 55 | if (method_exists($controller, $url[1])) { 56 | $controller->{$url[1]}(); 57 | } else { 58 | echo "Error calling method $url[1]()
"; 59 | } 60 | } 61 | } 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | //--------------------------------------------------------- 74 | // Rendering 75 | $controller->index(); 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | } 84 | 85 | } -------------------------------------------------------------------------------- /src/lib/Controller.php: -------------------------------------------------------------------------------- 1 | view = new View(); 11 | 12 | Session::set('controller_name', get_class($this)); 13 | } 14 | 15 | public function loadModel() { 16 | 17 | $model_name = get_class($this) . '_Model'; 18 | $model_file = 'model/' . $model_name . '.php'; 19 | 20 | // Load a Model-File only if it exists 21 | if (file_exists($model_file)) { 22 | require $model_file; 23 | $this->model = new $model_name; 24 | } 25 | 26 | } 27 | 28 | //TODO make function index abstract 29 | //abstract function index(); 30 | 31 | } -------------------------------------------------------------------------------- /src/lib/Database.php: -------------------------------------------------------------------------------- 1 | getMessage(); 18 | } 19 | 20 | } 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/lib/Debug.php: -------------------------------------------------------------------------------- 1 | $img_ratio){ 75 | $thumb_height = $height; 76 | $thumb_width = (int) $height * $img_ratio; 77 | } else { 78 | $thumb_height = (int) $width / $img_ratio; 79 | $thumb_width = $width; 80 | } 81 | 82 | $gd_thumb = imagecreatetruecolor($thumb_width, $thumb_height); 83 | 84 | imagecopyresampled($gd_thumb, $gd_img, 0, 0, 0, 0, $thumb_width, $thumb_height, $img_width, $img_height); 85 | imagejpeg($gd_thumb, $thumb_path, 90); 86 | 87 | imagedestroy($gd_img); 88 | imagedestroy($gd_thumb); 89 | 90 | return true; 91 | } 92 | 93 | /** 94 | * Get type of an image 95 | * @access private 96 | * @param string $tempImgFile 97 | * @return string 98 | * @since 1.0.0 99 | * @author nbe 100 | */ 101 | private static function getImgType($tempImgFile){ 102 | list( , , $tempImgFile) = getimagesize($tempImgFile); 103 | switch($tempImgFile){ 104 | case IMAGETYPE_GIF: 105 | return '.gif'; 106 | case IMAGETYPE_ICO: 107 | return '.ico'; 108 | case IMAGETYPE_JPEG: 109 | return '.jpg'; 110 | case IMAGETYPE_PNG: 111 | return '.png'; 112 | default: 113 | return false; 114 | } 115 | } 116 | 117 | /** 118 | * Move Uploaded File 119 | * @access public 120 | * @param string $file 121 | * @param string $destination 122 | * @return bool 123 | * @since 1.0.0 124 | * @author nbe 125 | */ 126 | public static function moveUploadedFile($file, $destination){ 127 | return (boolean) move_uploaded_file($file, $destination); 128 | } 129 | 130 | /** 131 | * Delete file 132 | * @access public 133 | * @param string $file 134 | * @return bool 135 | * @since 1.0.0 136 | * @author nbe 137 | */ 138 | public static function delete($file) { 139 | return (boolean) unlink($file); 140 | } 141 | 142 | /** 143 | * Upload Img 144 | * @access public 145 | * @param array $fileArray 146 | * @param string $path 147 | * @param array $thumb 148 | * @return mixed 149 | * @since 1.0.0 150 | * @author nbe 151 | */ 152 | public static function uploadImg($fileArray, $path = '', array $thumb = array(IMAGE_THUMB_WIDTH, IMAGE_THUMB_HEIGHT)) { 153 | 154 | $temp_img_id = $fileArray['name']; 155 | $temp_img_file = $fileArray['tmp_name']; 156 | $temp_img_type = '.'.explode('.', $temp_img_id)[1]; 157 | $temp_img_size = $fileArray['size']; 158 | 159 | $img_name = time().'-'.rand(100,9999); 160 | $img_type = self::getImgType($temp_img_file); 161 | 162 | if (!$img_type && !$temp_img_type) 163 | $img_type = IMAGE_DEFAULT_EXT; 164 | else 165 | $img_type = $temp_img_type; 166 | 167 | $inner_path = implode('/', explode('/', $path)).'/'; 168 | $coded_path = self::createDateCodedPath(); 169 | $img_dir = IMAGE_UPLOADS_PATH."{$inner_path}{$coded_path}"; 170 | 171 | $img_path = "{$img_dir}{$img_name}{$img_type}"; 172 | $thumb_path = "{$img_dir}{$img_name}".IMAGE_THUMB_EXT."{$img_type}"; 173 | 174 | // TODO: ForLoop if more then one thumb-size 175 | if (!empty($thumb)) { 176 | $thumb_height = $thumb[1]; 177 | $thumb_width = $thumb[0]; 178 | } 179 | 180 | if (!self::createFolder($img_dir)) 181 | $error['upload'] = _('Missing User-Rights'); 182 | if (!self::moveUploadedFile($temp_img_file, $img_path)) 183 | $error['upload'] = _('Error while uploading file'); 184 | if (empty($thumb) && !self::createImgThumbnail($img_path, $thumb_path, $thumb_width, $thumb_height) || !empty($thumb) && !self::createImgThumbnail($img_path, $thumb_path, $thumb_width, $thumb_height)) 185 | $error['upload'] = _('Error while generating Thumbnails'); 186 | 187 | if (!isset($error)) 188 | return array('name' => $temp_img_id, 'image' => $img_path, 'thumb' => $thumb_path, 'size' => $temp_img_size); 189 | else { 190 | return false; 191 | } 192 | 193 | 194 | } 195 | 196 | 197 | } -------------------------------------------------------------------------------- /src/lib/Helper.php: -------------------------------------------------------------------------------- 1 | "; 7 | var_dump($data); 8 | echo ""; 9 | } 10 | 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/lib/Message.php: -------------------------------------------------------------------------------- 1 | $text, 'class' => $class, 'time' => $now, 'duration' => $duration)); 11 | 12 | Session::set('allMessages', $allMessages); 13 | } 14 | 15 | public static function getAll() { 16 | return (Session::get('allMessages')) ? Session::get('allMessages') : array(); 17 | } 18 | 19 | public static function remove($index) { 20 | $allMessages = self::getAll(); 21 | 22 | unset($allMessages[$index]); 23 | 24 | Session::set('allMessages', $allMessages); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /src/lib/Model.php: -------------------------------------------------------------------------------- 1 | db = new Database(); 10 | 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/lib/Session.php: -------------------------------------------------------------------------------- 1 | rendered) { 12 | 13 | //Prevent double rendering 14 | $this->rendered = true; 15 | 16 | require 'partial/header.php'; 17 | 18 | require 'partial/navbar.php'; 19 | 20 | require 'partial/message.php'; 21 | 22 | require 'view/' . $name . '.php'; 23 | 24 | if(Session::get('controller_name') !== 'Dashboard') { 25 | require 'partial/footer.php'; 26 | } 27 | 28 | // Check DEBUG_MODE (config) 29 | if (DEBUG_MODE) { 30 | //Draw Debug-View 31 | require 'partial/debug.php'; 32 | } 33 | 34 | require 'partial/footer_essentials.php'; 35 | 36 | } 37 | 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /src/model/About_Model.php: -------------------------------------------------------------------------------- 1 | db->prepare($sql); 15 | 16 | $obj->execute(array( 17 | 'firstname' => $user['firstname'], 18 | 'lastname' => $user['lastname'], 19 | 'email' => $user['email'], 20 | 'password' => $user['password'] 21 | )); 22 | } 23 | 24 | public function loginUser($user) { 25 | 26 | //Get userEntry from DB 27 | $userEntry = $this->getUserFromEmail($user['email']); 28 | 29 | //Check if user exists (and early return if not) 30 | if (!$userEntry) return false; 31 | 32 | //Get password and hash 33 | $password = $user['password']; 34 | $hash = $userEntry['password']; 35 | 36 | //Remove hashed password from $userEntry 37 | unset($userEntry['password']); 38 | 39 | //Add users fullname to $userEntry 40 | $userEntry['fullname'] = $userEntry['firstname'] . ' ' . $userEntry['lastname']; 41 | 42 | //Verify password 43 | if (password_verify($password, $hash)) return $userEntry; 44 | 45 | //Otherwise return false 46 | return false; 47 | } 48 | 49 | public function getUserFromEmail($email) { 50 | $sql = 'SELECT user.*, user_permission.permission, file.thumb, file.image FROM user 51 | LEFT JOIN user_permission ON permission_id = user_permission.id 52 | LEFT JOIN file ON file_id = file.id WHERE email = :email LIMIT 1'; 53 | 54 | $obj = $this->db->prepare($sql); 55 | 56 | $obj->execute(array( 57 | 'email' => $email 58 | )); 59 | 60 | $result = $obj->fetch(PDO::FETCH_ASSOC); 61 | 62 | return $result; 63 | } 64 | 65 | public function recordLoginAttempt($email) { 66 | # +1 login attempts on every false password input 67 | $sql = 'UPDATE user SET login_attempts = login_attempts + 1 WHERE email = :email '; 68 | $obj = $this->db->prepare($sql); 69 | 70 | $result = $obj->execute(array( 71 | 'email' => $email 72 | )); 73 | 74 | return $result; 75 | } 76 | 77 | public function resetLoginAttempts($email) { 78 | # if login correct reset attempts to 0 79 | $sql = 'UPDATE user SET login_attempts = 0 WHERE email = :email'; 80 | $obj = $this->db->prepare($sql); 81 | 82 | $result = $obj->execute(array( 83 | 'email' => $email 84 | )); 85 | 86 | return $result; 87 | } 88 | 89 | public function checkLoginAttempts($email) { 90 | # Check login attempts and see if exceeded the amount of false logins 91 | $sql = 'SELECT login_attempts FROM user WHERE email = :email'; 92 | 93 | $obj = $this->db->prepare($sql); 94 | 95 | $obj->execute(array( 96 | 'email' => $email 97 | )); 98 | 99 | if($obj->rowCount() > 0) { 100 | $result = $obj->fetch(PDO::FETCH_ASSOC); 101 | return $result['login_attempts']; 102 | } 103 | 104 | return false; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/model/Category_Model.php: -------------------------------------------------------------------------------- 1 | db->prepare($sql); 15 | 16 | $obj->execute(); 17 | 18 | if ($obj->rowCount() > 0) { 19 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 20 | return $data; 21 | } 22 | 23 | return false; 24 | } 25 | 26 | // public function searchFunction($post_id = null, $search = null) { 27 | // $sql1 = 'SELECT user.firstname, user.lastname, file.image, file.thumb, category.category_name, posts.* 28 | // FROM user 29 | // JOIN posts 30 | // ON user.id = posts.user_id 31 | // JOIN file 32 | // ON file.id = posts.file_id 33 | // JOIN category 34 | // ON category.id = posts.category_id'; 35 | 36 | // $sql2 = ' WHERE post.id = :id '; 37 | 38 | // // Always needed! 39 | // $sql3 = 'GROUP BY posts.id;'; 40 | 41 | // // Concat $sql1 and $sql3 42 | // $sql = $sql1 . $sql3; 43 | 44 | // $excute_array = array(); 45 | 46 | // if ($post_id) { 47 | // $sql = $sql1 . $sql2 . $sql3; 48 | 49 | // $excute_array = array( 50 | // ':id' => $post_id 51 | // ); 52 | // } 53 | 54 | // if ($search) { 55 | // $sql = $sql1 . " WHERE posts.header LIKE :search " . $sql3; 56 | // $excute_array = array( 57 | // ':search' => '%'.$search.'%' 58 | // ); 59 | // } 60 | 61 | // $obj = $this->db->prepare($sql); 62 | 63 | // $result = $obj->execute($excute_array); 64 | 65 | // Debug::add($result, '$result'); 66 | 67 | // if ($result) { 68 | // $data = $obj->fetchAll(PDO::FETCH_OBJ); 69 | // return $data; 70 | // } 71 | 72 | // return false; 73 | // } 74 | 75 | public function getPostById($id) { 76 | $sql = 'SELECT user.firstname, user.lastname, file.image, file.thumb, category.category_name, posts.* 77 | FROM user 78 | JOIN posts 79 | ON user.id = posts.user_id 80 | JOIN file 81 | ON file.id = posts.file_id 82 | JOIN category 83 | ON category.id = posts.category_id WHERE posts.id = :id'; 84 | 85 | $obj = $this->db->prepare($sql); 86 | 87 | $obj->execute(array( 88 | ":id" => $id 89 | )); 90 | 91 | if($obj->rowCount() > 0) { 92 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 93 | return $data; 94 | } 95 | 96 | return false; 97 | } 98 | 99 | public function getPostsByCategoryId($id, $search) { 100 | $sql = 'SELECT user.firstname, user.lastname, file.image, file.thumb, category.category_name, posts.* 101 | FROM user 102 | JOIN posts 103 | ON user.id = posts.user_id 104 | JOIN file 105 | ON file.id = posts.file_id 106 | JOIN category 107 | ON category.id = posts.category_id 108 | WHERE category.id = :id AND posts.header LIKE :search'; 109 | 110 | $obj = $this->db->prepare($sql); 111 | 112 | $result = $obj->execute(array( 113 | ":id" => $id, 114 | ':search' => '%'.$search.'%' 115 | )); 116 | 117 | if ($result) { 118 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 119 | return $data; 120 | } 121 | 122 | return false; 123 | } 124 | 125 | // public function getPostsByCategory($category) { 126 | // $sql = 'SELECT user.firstname, user.lastname, file.image, file.thumb, category.category_name, posts.* 127 | // FROM user 128 | // JOIN posts 129 | // ON user.id = posts.user_id 130 | // JOIN file 131 | // ON file.id = posts.file_id 132 | // JOIN category 133 | // ON category.id = posts.category_id 134 | // WHERE category.category_name = :category'; 135 | 136 | // $obj = $this->db->prepare($sql); 137 | 138 | // $obj->execute(array( 139 | // ":category" => $category 140 | // )); 141 | 142 | // if ($obj->rowCount() > 0) { 143 | // $data = $obj->fetchAll(PDO::FETCH_OBJ); 144 | // return $data; 145 | // } 146 | 147 | // return false; 148 | // } 149 | 150 | # ********************** 151 | # Comment feature SQL 152 | # ********************** 153 | 154 | public function getAllCommentsById($id) { 155 | $sql = 'SELECT 156 | USER.firstname, 157 | USER.lastname, 158 | comments.* 159 | FROM 160 | comments 161 | LEFT JOIN USER ON USER.id = comments.user_id 162 | WHERE post_id = :post_id'; 163 | 164 | $obj = $this->db->prepare($sql); 165 | 166 | $obj->execute(array( 167 | ":post_id" => $id 168 | )); 169 | 170 | if ($obj->rowCount() > 0) { 171 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 172 | return $data; 173 | } 174 | 175 | return false; 176 | } 177 | 178 | public function userComment($user_comment, $postId) { 179 | $sql = 'INSERT INTO comments(comment_content, user_id, post_id) VALUES (:comment_content, :user_id, :post_id)'; 180 | $obj = $this->db->prepare($sql); 181 | $obj->execute(array( 182 | ":comment_content" => $user_comment, 183 | ':user_id' => Session::get('user')['id'], 184 | ":post_id" => $postId 185 | )); 186 | } 187 | 188 | } -------------------------------------------------------------------------------- /src/model/Contact_Model.php: -------------------------------------------------------------------------------- 1 | db->prepare($sql); 9 | 10 | $result1 = $obj->execute(array( 11 | ':name' => $uploadedFile['name'], 12 | ':image' => $uploadedFile['image'], 13 | ':thumb' => $uploadedFile['thumb'], 14 | ':size' => $uploadedFile['size'], 15 | )); 16 | 17 | // Remember the id of the new file entry 18 | $file_id = $this->db->lastInsertId(); 19 | 20 | 21 | // 2. Step: insert Post ---------------------------------------------------------------------------------------------- 22 | 23 | $sql = 'INSERT INTO posts(header, content, user_id, file_id, category_id) VALUES (:header, :content, :user_id, :file_id, :category_id)'; 24 | 25 | $obj = $this->db->prepare($sql); 26 | 27 | $result2 = $obj->execute(array( 28 | ":header" => $post_header, 29 | ":content" => $post_content, 30 | ":user_id" => $userId, 31 | ":file_id" => $file_id, 32 | ":category_id" => $category_id, 33 | )); 34 | 35 | return $result1 && $result2; 36 | } 37 | 38 | public function uploadUserImage($userId, $uploadedFile) { 39 | // 1. Step: insert File ---------------------------------------------------------------------------------------------- 40 | $sql = 'INSERT INTO file (name, image, thumb, size) VALUES (:name, :image, :thumb, :size)'; 41 | 42 | $obj = $this->db->prepare($sql); 43 | 44 | $result1 = $obj->execute(array( 45 | ':name' => $uploadedFile['name'], 46 | ':image' => $uploadedFile['image'], 47 | ':thumb' => $uploadedFile['thumb'], 48 | ':size' => $uploadedFile['size'], 49 | )); 50 | 51 | // Remember the id of the new file entry 52 | $file_id = $this->db->lastInsertId(); 53 | 54 | // 2. Step: insert Post ---------------------------------------------------------------------------------------------- 55 | 56 | $sql = "UPDATE user SET file_id = :file_id WHERE id = :id"; 57 | 58 | $obj = $this->db->prepare($sql); 59 | 60 | $result2 = $obj->execute(array( 61 | ":id" => $userId, 62 | ":file_id" => $file_id, 63 | )); 64 | 65 | return $result1 && $result2; 66 | } 67 | 68 | public function updateFile($file_id, $file) { 69 | $sql = 'UPDATE file SET name=:name, image=:image, thumb=:thumb, size=:size WHERE id=:file_id'; 70 | 71 | $obj = $this->db->prepare($sql); 72 | 73 | $result = $obj->execute(array( 74 | ':file_id' => $file_id, 75 | ':name' => $file['name'], 76 | ':image' => $file['image'], 77 | ':thumb' => $file['thumb'], 78 | ':size' => $file['size'], 79 | )); 80 | 81 | // Return result 82 | return $result; 83 | } 84 | 85 | // public function updateUser($user) { 86 | // $password = $user['password']; 87 | // $hashPassword = password_hash($password, PASSWORD_DEFAULT); 88 | // $user['password'] = $hashPassword; 89 | 90 | // $sql = "UPDATE user SET firstname = :firstname, lastname = :lastname, email = :email, password = :password WHERE id = :id"; 91 | // $obj = $this->db->prepare($sql); 92 | 93 | // $obj->execute(array( 94 | // ":firstname" => $user['firstname'], 95 | // ":lastname" => $user['lastname'], 96 | // ":email" => $user['email'], 97 | // ":email" => $user['email'], 98 | // ":password" => $user['password'], 99 | // ":id" => Session::get('user')['id'] 100 | // )); 101 | 102 | // } 103 | 104 | 105 | public function editProfile($user_id, $post_firstname, $post_lastname, $post_email, $post_password) { 106 | 107 | $sql = "UPDATE user SET firstname = :firstname, lastname = :lastname, email = :email WHERE id = :id"; 108 | 109 | $executeArray = array( 110 | ":firstname" => $post_firstname, 111 | ":lastname" => $post_lastname, 112 | ":email" => $post_email, 113 | ":id" => $user_id 114 | ); 115 | 116 | if(!empty($post_password)) { 117 | $sql = "UPDATE user SET firstname = :firstname, lastname = :lastname, email = :email, password = :password WHERE id = :id"; 118 | $password = $post_password; 119 | $hashPassword = password_hash($password, PASSWORD_DEFAULT); 120 | $post_password = $hashPassword; 121 | 122 | $executeArray[':password'] = $post_password; 123 | } 124 | 125 | $obj = $this->db->prepare($sql); 126 | 127 | $result1 = $obj->execute($executeArray); 128 | 129 | return $result1; 130 | } 131 | 132 | public function getPosts() { 133 | $sql = 'SELECT user.firstname, user.lastname, file.image, file.thumb, category.category_name, posts.* 134 | FROM user 135 | JOIN posts 136 | ON user.id = posts.user_id 137 | JOIN file 138 | ON file.id = posts.file_id 139 | JOIN category 140 | ON category.id = posts.category_id ORDER BY timestamp DESC'; 141 | 142 | $obj = $this->db->prepare($sql); 143 | 144 | $obj->execute(); 145 | 146 | if ($obj->rowCount() > 0) { 147 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 148 | return $data; 149 | } 150 | 151 | return false; 152 | } 153 | 154 | public function getPostById($id) { 155 | $sql = "SELECT user.firstname, user.lastname, file.image, file.thumb, category.category_name, posts.* 156 | FROM user 157 | JOIN posts 158 | ON user.id = posts.user_id 159 | JOIN file 160 | ON file.id = posts.file_id 161 | JOIN category 162 | ON category.id = posts.category_id WHERE posts.id = :id"; 163 | 164 | $obj = $this->db->prepare($sql); 165 | 166 | $obj->execute(array( 167 | ":id" => $id 168 | )); 169 | 170 | if($obj->rowCount() > 0) { 171 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 172 | return $data; 173 | } 174 | 175 | return false; 176 | } 177 | 178 | public function getFileById($id) { 179 | $sql = "SELECT * FROM file WHERE id = :id"; 180 | $obj = $this->db->prepare($sql); 181 | 182 | $obj->execute(array( 183 | ":id" => $id 184 | )); 185 | 186 | if($obj->rowCount() > 0) { 187 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 188 | return $data; 189 | } 190 | 191 | return false; 192 | } 193 | 194 | public function getPostsByEmail() { 195 | $sql = 'SELECT user.firstname, user.lastname, file.image, file.thumb, category.category_name, posts.* 196 | FROM user 197 | JOIN posts 198 | ON user.id = posts.user_id 199 | JOIN file 200 | ON file.id = posts.file_id 201 | JOIN category 202 | ON category.id = posts.category_id 203 | WHERE user.email = :email'; 204 | 205 | $obj = $this->db->prepare($sql); 206 | 207 | $obj->execute(array( 208 | ":email" => Session::get('user')['email'] 209 | )); 210 | 211 | if ($obj->rowCount() > 0) { 212 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 213 | return $data; 214 | } 215 | 216 | return false; 217 | } 218 | 219 | public function getUserById($id) { 220 | $sql = 'SELECT u.id, u.firstname, u.lastname, u.email, u.login_attempts, u.permission_id, u.file_id, file.image, file.thumb, p.permission 221 | FROM user as u 222 | LEFT JOIN file ON file.id = u.file_id 223 | LEFT JOIN user_permission AS p ON u.permission_id = p.id 224 | WHERE u.id = :id'; 225 | 226 | $obj = $this->db->prepare($sql); 227 | 228 | $obj->execute(array( 229 | ":id" => $id 230 | )); 231 | 232 | if ($obj->rowCount() > 0) { 233 | $data = $obj->fetch(PDO::FETCH_ASSOC); 234 | return $data; 235 | } 236 | 237 | return false; 238 | } 239 | 240 | public function getUserFromEmail($email) { 241 | $sql = 'SELECT user.*, user_permission.permission FROM user LEFT JOIN user_permission ON permission_id = user_permission.id WHERE email = :email LIMIT 1'; 242 | $obj = $this->db->prepare($sql); 243 | 244 | $obj->execute(array( 245 | 'email' => $email 246 | )); 247 | 248 | $result = $obj->fetch(PDO::FETCH_ASSOC); 249 | 250 | return $result; 251 | } 252 | 253 | public function updatePost($data) { 254 | $sql = "UPDATE posts SET header = :header, content = :content WHERE id = :id"; 255 | 256 | $obj = $this->db->prepare($sql); 257 | 258 | $obj->execute(array( 259 | ":id" => $data["id"], 260 | ":header" => $data["header"], 261 | ":content" => $data["content"] 262 | )); 263 | } 264 | 265 | public function getCategories() { 266 | $sql = "SELECT * FROM category WHERE 1"; 267 | $obj = $this->db->prepare($sql); 268 | 269 | $obj->execute(); 270 | 271 | if($obj->rowCount() > 0) { 272 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 273 | return $data; 274 | } 275 | 276 | return false; 277 | } 278 | 279 | public function insertCategory($categoryName) { 280 | $sql = "INSERT INTO category(category_name) VALUES (:category_name)"; 281 | $obj = $this->db->prepare($sql); 282 | 283 | $obj->execute(array( 284 | ":category_name" => $categoryName 285 | )); 286 | 287 | if($obj->rowCount() > 0) { 288 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 289 | return $data; 290 | } 291 | 292 | return false; 293 | } 294 | 295 | public function getAllUsers() { 296 | $sql = 'SELECT user.*, user_permission.permission FROM user LEFT JOIN user_permission ON permission_id = user_permission.id ORDER BY user.email ASC'; 297 | $obj = $this->db->prepare($sql); 298 | 299 | $obj->execute(); 300 | 301 | $result = $obj->fetchAll(PDO::FETCH_OBJ); 302 | 303 | return $result; 304 | } 305 | 306 | public function updatePermission($permission, $userEmail) { 307 | $sql = "UPDATE `user` SET permission_id = :permission WHERE email = :email"; 308 | 309 | $obj = $this->db->prepare($sql); 310 | 311 | $obj->execute(array( 312 | ":permission" => $permission, 313 | ":email" => $userEmail 314 | )); 315 | } 316 | 317 | public function getAllPermissions() { 318 | $sql = "SELECT * FROM user_permission"; 319 | $obj = $this->db->prepare($sql); 320 | $obj->execute(); 321 | 322 | $result = $obj->fetchAll(PDO::FETCH_OBJ); 323 | 324 | return $result; 325 | } 326 | 327 | # ******************** 328 | # Ban/Unban Functions 329 | # ******************** 330 | 331 | public function unbanUser($userEmail) { 332 | $sql = 'UPDATE user SET login_attempts = 0 WHERE email = :email'; 333 | $obj = $this->db->prepare($sql); 334 | 335 | $result = $obj->execute(array( 336 | ":email" => $userEmail 337 | )); 338 | 339 | return $result; 340 | } 341 | 342 | public function banUser($userEmail) { 343 | $sql = 'UPDATE user SET login_attempts = 3 WHERE email = :email'; 344 | $obj = $this->db->prepare($sql); 345 | 346 | $result = $obj->execute(array( 347 | ":email" => $userEmail 348 | )); 349 | 350 | return $result; 351 | } 352 | 353 | # ***************** 354 | # Delete Functions 355 | # ***************** 356 | 357 | public function deleteFile($file_id) { 358 | 359 | $sql = 'DELETE FROM file WHERE id = :file_id'; 360 | 361 | $obj = $this->db->prepare($sql); 362 | 363 | $result = $obj->execute(array( 364 | ':file_id' => $file_id 365 | )); 366 | 367 | return $result; 368 | } 369 | 370 | public function deletePost($id) { 371 | 372 | $sql = 'DELETE FROM posts WHERE id = :id LIMIT 1;'; 373 | 374 | $obj = $this->db->prepare($sql); 375 | 376 | $result = $obj->execute(array( 377 | ':id' => $id 378 | )); 379 | 380 | return $result; 381 | } 382 | 383 | } -------------------------------------------------------------------------------- /src/model/Home_Model.php: -------------------------------------------------------------------------------- 1 | db->prepare($sql); 17 | 18 | $obj->execute(); 19 | 20 | if ($obj->rowCount() > 0) { 21 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 22 | return $data; 23 | } 24 | 25 | return false; 26 | } 27 | 28 | public function getPostsTotal() { 29 | $sql = 'SELECT * FROM posts'; 30 | 31 | $obj = $this->db->prepare($sql); 32 | 33 | $obj->execute(); 34 | 35 | $data = $obj->rowCount(); 36 | return $data; 37 | 38 | 39 | return false; 40 | } 41 | 42 | public function paginationCount($limit, $offset) { 43 | $sql = 'SELECT * FROM posts LIMIT = :limit OFFSET = :offset'; 44 | 45 | $obj = $this->db->prepare($sql); 46 | 47 | $obj->execute(array( 48 | ":limit" => $limit, 49 | ":offset" => $offset 50 | )); 51 | 52 | // Do we have any results? 53 | if ($obj->rowCount() > 0) { 54 | // Define how we want to fetch the results 55 | $data = $obj->fetchAll(PDO::FETCH_OBJ); 56 | Debug::add($data); 57 | $iterator = new IteratorIterator($data); 58 | 59 | // Display the results 60 | foreach ($iterator as $row) { 61 | echo '

', $row['name'], '

'; 62 | } 63 | } 64 | } 65 | 66 | } -------------------------------------------------------------------------------- /src/model/Navbar_Model.php: -------------------------------------------------------------------------------- 1 | db->prepare($sql); 7 | $result = $obj->execute(); 8 | 9 | if($result) { 10 | $data = $obj->fetchAll(PDO::FETCH_ASSOC); 11 | return $data; 12 | } 13 | 14 | return false; 15 | } 16 | } -------------------------------------------------------------------------------- /src/partial/debug.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 |
7 | 8 | 37 | 38 | 39 | 40 |
41 | 42 |
43 | 44 |
45 | 46 |
47 | 48 |
49 | 50 | 51 |
52 | 53 |
54 | 55 | 56 |
57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 | $value): ?> 69 |
70 | 71 |
72 | 73 |
74 | 75 | 76 |
77 |
-------------------------------------------------------------------------------- /src/partial/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 44 | 45 |
46 | 47 |
48 | 75 |
76 | -------------------------------------------------------------------------------- /src/partial/footer_end.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/partial/footer_end.php -------------------------------------------------------------------------------- /src/partial/footer_essentials.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/partial/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Daniel OOP MVC 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/partial/message.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | $value) : ?> 8 |
9 |
10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/partial/navbar.php: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/partial/sidebar.php: -------------------------------------------------------------------------------- 1 |
2 | 45 | 46 |
47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/public/css/main.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css?family=Playfair+Display|Roboto:400,700,900"); 2 | body { 3 | padding-top: 5rem; 4 | font-family: 'roboto', sans-serif; 5 | } 6 | 7 | .alert-success { 8 | z-index: 999; 9 | width: 90%; 10 | } 11 | 12 | .alert-danger { 13 | z-index: 999; 14 | width: 90%; 15 | } 16 | 17 | .card-title { 18 | font-family: 'Playfair', serif; 19 | font-size: 36px; 20 | } 21 | 22 | h1 { 23 | font-family: 'Playfair', serif; 24 | font-size: 75px; 25 | } 26 | 27 | .invalid-feedback { 28 | display: block; 29 | } 30 | 31 | iframe { 32 | border: 0; 33 | } 34 | 35 | .landscape-img img { 36 | width: 100%; 37 | height: 100%; 38 | -o-object-fit: cover; 39 | object-fit: cover; 40 | } 41 | 42 | section { 43 | padding-top: 8rem; 44 | padding-bottom: 8rem; 45 | } 46 | 47 | .landscape-img { 48 | height: 350px; 49 | width: 100%; 50 | } 51 | 52 | .card-body a { 53 | color: #007bff; 54 | } 55 | 56 | #mainNav { 57 | background-color: #000; 58 | } 59 | 60 | a { 61 | color: black; 62 | } 63 | 64 | td .btn { 65 | width: 100%; 66 | } 67 | 68 | .activeNav { 69 | background-color: black; 70 | color: #fff; 71 | } 72 | 73 | /* Footer */ 74 | footer ul li { 75 | list-style-type: none; 76 | } 77 | 78 | footer ul li a { 79 | text-decoration: none; 80 | color: rgba(255, 255, 255, 0.7); 81 | } 82 | 83 | footer ul li a:hover { 84 | color: #fff; 85 | text-decoration: none; 86 | } 87 | 88 | .bg-dark { 89 | background-color: #19191E !important; 90 | } 91 | 92 | .navbar { 93 | padding: .5rem 0rem !important; 94 | } 95 | 96 | h2 a { 97 | color: #fff; 98 | text-decoration: underline; 99 | } 100 | 101 | h2 a:hover { 102 | color: rgba(255, 255, 255, 0.7); 103 | text-decoration: underline; 104 | } 105 | 106 | .text-faded { 107 | color: rgba(0, 0, 0, 0.7); 108 | } 109 | 110 | hr { 111 | max-width: 50px; 112 | border-width: 3px; 113 | border-color: #f05f40; 114 | } 115 | 116 | hr.light { 117 | border-color: #fff; 118 | } 119 | 120 | hr.dark { 121 | border-color: #000; 122 | } 123 | 124 | .inputDnD .form-control-file { 125 | position: relative; 126 | width: 100%; 127 | height: 100%; 128 | min-height: 6em; 129 | outline: none; 130 | visibility: hidden; 131 | cursor: pointer; 132 | background-color: #c61c23; 133 | -webkit-box-shadow: 0 0 5px solid currentColor; 134 | box-shadow: 0 0 5px solid currentColor; 135 | } 136 | 137 | .text-upload { 138 | color: #ced4da; 139 | } 140 | 141 | .section-bg { 142 | background-color: #F5F5FA; 143 | } 144 | 145 | .inputDnD .form-control-file:before { 146 | content: attr(data-title); 147 | position: absolute; 148 | top: 0.5em; 149 | left: 0; 150 | width: 100%; 151 | min-height: 6em; 152 | line-height: 2em; 153 | padding-top: 1.5em; 154 | opacity: 1; 155 | visibility: visible; 156 | text-align: center; 157 | border: 3px dashed currentColor; 158 | -webkit-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 159 | transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 160 | overflow: hidden; 161 | } 162 | 163 | .inputDnD .form-control-file:hover:before { 164 | border-style: solid; 165 | -webkit-box-shadow: inset 0px 0px 0px 0.25em currentColor; 166 | box-shadow: inset 0px 0px 0px 0.25em currentColor; 167 | } 168 | 169 | header.masthead { 170 | text-align: left; 171 | color: #fff; 172 | background-image: url(../img/header-bg.jpg); 173 | background-repeat: no-repeat; 174 | background-attachment: scroll; 175 | background-position: center center; 176 | background-size: cover; 177 | margin-top: -70px; 178 | } 179 | 180 | header.masthead .intro-text { 181 | padding-top: 150px; 182 | padding-bottom: 100px; 183 | } 184 | 185 | header.masthead .intro-text .intro-lead-in { 186 | font-size: 22px; 187 | font-style: italic; 188 | line-height: 22px; 189 | margin-bottom: 25px; 190 | } 191 | 192 | header.masthead .intro-text .intro-heading { 193 | font-size: 50px; 194 | font-weight: 700; 195 | line-height: 50px; 196 | margin-bottom: 25px; 197 | } 198 | 199 | @media (min-width: 768px) { 200 | header.masthead .intro-text { 201 | padding-top: 300px; 202 | padding-bottom: 200px; 203 | } 204 | header.masthead .intro-text .intro-lead-in { 205 | font-size: 40px; 206 | font-style: italic; 207 | line-height: 40px; 208 | margin-bottom: 25px; 209 | } 210 | header.masthead .intro-text .intro-heading { 211 | font-size: 75px; 212 | font-weight: 700; 213 | line-height: 75px; 214 | margin-bottom: 50px; 215 | } 216 | } 217 | 218 | .negativeMargin { 219 | margin-top: -30px; 220 | padding: 2rem 0; 221 | padding-left: 25px; 222 | position: fixed; 223 | height: 100vh; 224 | z-index: 3; 225 | } 226 | 227 | .nav-link { 228 | cursor: pointer !important; 229 | } 230 | 231 | #intro-text { 232 | font-size: 1.3rem; 233 | font-weight: 400; 234 | line-height: 1.8; 235 | } 236 | 237 | p { 238 | line-height: 1.9; 239 | } 240 | 241 | @media (min-width: 34em) { 242 | .card-columns { 243 | -webkit-column-count: 2; 244 | column-count: 2; 245 | } 246 | } 247 | 248 | @media (min-width: 64em) { 249 | .card-columns { 250 | -webkit-column-count: 3; 251 | column-count: 3; 252 | } 253 | } 254 | /*# sourceMappingURL=main.css.map */ -------------------------------------------------------------------------------- /src/public/css/main.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "mappings": "AAAA,OAAO,CAAC,kFAAI;AAIZ,AAAA,IAAI,CAAC;EACD,WAAW,EAAE,IAAI;EACjB,WAAW,EAAE,oBAAoB;CACpC;;AAED,AAAA,cAAc,CAAC;EACX,OAAO,EAAE,GAAG;EACZ,KAAK,EAAE,GAAG;CACb;;AAED,AAAA,aAAa,CAAC;EACV,OAAO,EAAE,GAAG;EACZ,KAAK,EAAE,GAAG;CACb;;AAGD,AAAA,WAAW,CAAC;EACR,WAAW,EAAE,iBAAiB;EAC9B,SAAS,EAAE,IAAI;CAClB;;AAED,AAAA,EAAE,CAAC;EACC,WAAW,EAAE,iBAAiB;EAC9B,SAAS,EAAE,IAAI;CAClB;;AAED,AAAA,iBAAiB,CAAC;EACd,OAAO,EAAE,KAAK;CACjB;;AAED,AAAA,MAAM,CAAC;EACH,MAAM,EAAE,CAAC;CACZ;;AAED,AAAA,cAAc,CAAC,GAAG,CAAC;EACf,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,UAAU,EAAE,KAAK;CACpB;;AAED,AAAA,OAAO,CAAC;EACJ,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;CACvB;;AAED,AAAA,cAAc,CAAC;EACX,MAAM,EAAE,KAAK;EACb,KAAK,EAAE,IAAI;CACd;;AAED,AAEI,UAFM,CAEN,CAAC,CAAC;EACE,KAAK,EAvDG,OAAO;CAwDlB;;AAGL,AAAA,QAAQ,CAAC;EACL,gBAAgB,EAAE,IAAI;CACzB;;AAED,AAAA,CAAC,CAAC;EACE,KAAK,EAAC,KAAK;CACd;;AAED,AAAA,EAAE,CAAC,IAAI,CAAC;EACJ,KAAK,EAAE,IAAI;CACd;;AAED,AAAA,UAAU,CAAC;EACP,gBAAgB,EAAE,KAAK;EACvB,KAAK,EAAE,IAAI;CACd;;AAED,YAAY;AAEZ,AAAA,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;EACT,eAAe,EAAE,IAAI;CACxB;;AAED,AAAA,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;EACX,eAAe,EAAE,IAAI;EACrB,KAAK,EAAE,wBAAoB;CAC9B;;AAED,AAAA,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,AAAA,MAAM,CAAC;EACjB,KAAK,EAAE,IAAI;EACX,eAAe,EAAE,IAAI;CACxB;;AAED,AAAA,QAAQ,CAAC;EACL,gBAAgB,EAAE,kBAAkB;CACvC;;AAED,AAAA,OAAO,CAAC;EACJ,OAAO,EAAE,qBAAqB;CACjC;;AAED,AAAA,EAAE,CAAC,CAAC,CAAC;EACD,KAAK,EAAE,IAAI;EACX,eAAe,EAAE,SAAS;CAC7B;;AAED,AAAA,EAAE,CAAC,CAAC,AAAA,MAAM,CAAC;EACP,KAAK,EAAE,wBAAoB;EAC3B,eAAe,EAAE,SAAS;CAC7B;;AAED,AAAA,WAAW,CAAC;EACR,KAAK,EAAE,kBAAc;CACxB;;AAED,AAAA,EAAE,CAAC;EACC,SAAS,EAAE,IAAI;EACf,YAAY,EAAE,GAAG;EACjB,YAAY,EAAE,OAAO;CACxB;;AAED,AAAA,EAAE,AAAA,MAAM,CAAC;EACL,YAAY,EAAE,IAAI;CACrB;;AAED,AAAA,EAAE,AAAA,KAAK,CAAC;EACJ,YAAY,EAAE,IAAI;CACrB;;AAED,AAAA,SAAS,CAAC,kBAAkB,CAAC;EACzB,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,UAAU,EAAE,GAAG;EACf,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,MAAM;EAClB,MAAM,EAAE,OAAO;EACf,gBAAgB,EAAE,OAAO;EACzB,UAAU,EAAE,0BAA0B;CACzC;;AAED,AAAA,YAAY,CAAC;EACT,KAAK,EAAE,OAAO;CACjB;;AAED,AAAA,WAAW,CAAC;EACR,gBAAgB,EAAE,OAAO;CAC5B;;AAED,AAAA,SAAS,CAAC,kBAAkB,AAAA,OAAO,CAAC;EAChC,OAAO,EAAE,gBAAgB;EACzB,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,KAAK;EACV,IAAI,EAAE,CAAC;EACP,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,GAAG;EACf,WAAW,EAAE,GAAG;EAChB,WAAW,EAAE,KAAK;EAClB,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,OAAO;EACnB,UAAU,EAAE,MAAM;EAClB,MAAM,EAAE,uBAAuB;EAC/B,UAAU,EAAE,GAAG,CAAC,IAAI,CAAC,gCAAgC;EACrD,QAAQ,EAAE,MAAM;CACnB;;AAED,AAAA,SAAS,CAAC,kBAAkB,AAAA,MAAM,AAAA,OAAO,CAAC;EACtC,YAAY,EAAE,KAAK;EACnB,UAAU,EAAE,qCAAqC;CACpD;;AAED,AAAA,MAAM,AAAA,SAAS,CAAC;EACZ,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,IAAI;EACX,gBAAgB,EAAE,yBAAyB;EAC3C,iBAAiB,EAAE,SAAS;EAC5B,qBAAqB,EAAE,MAAM;EAC7B,mBAAmB,EAAE,aAAa;EAClC,uBAAuB,EAAE,KAAK;EAC9B,oBAAoB,EAAE,KAAK;EAC3B,kBAAkB,EAAE,KAAK;EACzB,eAAe,EAAE,KAAK;EACtB,UAAU,EAAE,KAAK;CACpB;;AAED,AAAA,MAAM,AAAA,SAAS,CAAC,WAAW,CAAC;EACxB,WAAW,EAAE,KAAK;EAClB,cAAc,EAAE,KACpB;CAAC;;AAED,AAAA,MAAM,AAAA,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC;EACvC,SAAS,EAAE,IAAI;EACf,UAAU,EAAE,MAAM;EAClB,WAAW,EAAE,IAAI;EACjB,aAAa,EAAE,IAAI;CACtB;;AAED,AAAA,MAAM,AAAA,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC;EACvC,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,GAAG;EAChB,WAAW,EAAE,IAAI;EACjB,aAAa,EAAE,IAAI;CACtB;;AAED,MAAM,EAAE,SAAS,EAAE,KAAK;EACpB,AAAA,MAAM,AAAA,SAAS,CAAC,WAAW,CAAC;IACxB,WAAW,EAAE,KAAK;IAClB,cAAc,EAAE,KACpB;GAAC;EACD,AAAA,MAAM,AAAA,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC;IACvC,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;GACtB;EACD,AAAA,MAAM,AAAA,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC;IACvC,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,GAAG;IAChB,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;GACtB;;;AAGL,AAAA,eAAe,CAAC;EACZ,UAAU,EAAE,KAAK;EACjB,OAAO,EAAE,MAAM;EACf,YAAY,EAAE,IAAI;EAClB,QAAQ,EAAE,KAAK;EACf,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,CAAC;CACb;;AAED,AAAA,SAAS,CAAC;EACN,MAAM,EAAE,kBAAkB;CAC7B;;AAED,AAAA,WAAW,CAAC;EACR,SAAS,EAAE,MAAM;EACjB,WAAW,EAAE,GAAG;EAChB,WAAW,EAAE,GACjB;CAAC;;AAED,AAAA,CAAC,CAAC;EACE,WAAW,EAAE,GAAG;CAEnB;;AAED,MAAM,EAAE,SAAS,EAAE,IAAI;EACnB,AAAA,aAAa,CAAC;IACV,oBAAoB,EAAE,CAAC;IACvB,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,CAAC;GAClB;;;AAGL,MAAM,EAAE,SAAS,EAAE,IAAI;EACnB,AAAA,aAAa,CAAC;IACV,oBAAoB,EAAE,CAAC;IACvB,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,CAAC;GAClB", 4 | "sources": [ 5 | "main.scss" 6 | ], 7 | "names": [], 8 | "file": "main.css" 9 | } -------------------------------------------------------------------------------- /src/public/css/main.scss: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=Playfair+Display|Roboto:400,700,900'); 2 | 3 | $primary-color: #007bff; 4 | 5 | body { 6 | padding-top: 5rem; 7 | font-family: 'roboto', sans-serif; 8 | } 9 | 10 | .alert-success { 11 | z-index: 999; 12 | width: 90%; 13 | } 14 | 15 | .alert-danger { 16 | z-index: 999; 17 | width: 90%; 18 | } 19 | 20 | 21 | .card-title { 22 | font-family: 'Playfair', serif; 23 | font-size: 36px; 24 | } 25 | 26 | h1 { 27 | font-family: 'Playfair', serif; 28 | font-size: 75px; 29 | } 30 | 31 | .invalid-feedback { 32 | display: block; 33 | } 34 | 35 | iframe { 36 | border: 0; 37 | } 38 | 39 | .landscape-img img { 40 | width: 100%; 41 | height: 100%; 42 | object-fit: cover; 43 | } 44 | 45 | section { 46 | padding-top: 8rem; 47 | padding-bottom: 8rem; 48 | } 49 | 50 | .landscape-img { 51 | height: 350px; 52 | width: 100%; 53 | } 54 | 55 | .card-body { 56 | 57 | a { 58 | color: $primary-color; 59 | } 60 | } 61 | 62 | #mainNav { 63 | background-color: #000; 64 | } 65 | 66 | a { 67 | color:black; 68 | } 69 | 70 | td .btn { 71 | width: 100%; 72 | } 73 | 74 | .activeNav { 75 | background-color: black; 76 | color: #fff; 77 | } 78 | 79 | /* Footer */ 80 | 81 | footer ul li { 82 | list-style-type: none; 83 | } 84 | 85 | footer ul li a { 86 | text-decoration: none; 87 | color: rgba(255,255,255,.7); 88 | } 89 | 90 | footer ul li a:hover { 91 | color: #fff; 92 | text-decoration: none; 93 | } 94 | 95 | .bg-dark { 96 | background-color: #19191E !important; 97 | } 98 | 99 | .navbar { 100 | padding: .5rem 0rem !important; 101 | } 102 | 103 | h2 a { 104 | color: #fff; 105 | text-decoration: underline; 106 | } 107 | 108 | h2 a:hover { 109 | color: rgba(255,255,255,.7); 110 | text-decoration: underline; 111 | } 112 | 113 | .text-faded { 114 | color: rgba(0,0,0,.7); 115 | } 116 | 117 | hr { 118 | max-width: 50px; 119 | border-width: 3px; 120 | border-color: #f05f40; 121 | } 122 | 123 | hr.light { 124 | border-color: #fff; 125 | } 126 | 127 | hr.dark { 128 | border-color: #000; 129 | } 130 | 131 | .inputDnD .form-control-file { 132 | position: relative; 133 | width: 100%; 134 | height: 100%; 135 | min-height: 6em; 136 | outline: none; 137 | visibility: hidden; 138 | cursor: pointer; 139 | background-color: #c61c23; 140 | box-shadow: 0 0 5px solid currentColor; 141 | } 142 | 143 | .text-upload { 144 | color: #ced4da; 145 | } 146 | 147 | .section-bg { 148 | background-color: #F5F5FA; 149 | } 150 | 151 | .inputDnD .form-control-file:before { 152 | content: attr(data-title); 153 | position: absolute; 154 | top: 0.5em; 155 | left: 0; 156 | width: 100%; 157 | min-height: 6em; 158 | line-height: 2em; 159 | padding-top: 1.5em; 160 | opacity: 1; 161 | visibility: visible; 162 | text-align: center; 163 | border: 3px dashed currentColor; 164 | transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 165 | overflow: hidden; 166 | } 167 | 168 | .inputDnD .form-control-file:hover:before { 169 | border-style: solid; 170 | box-shadow: inset 0px 0px 0px 0.25em currentColor; 171 | } 172 | 173 | header.masthead { 174 | text-align: left; 175 | color: #fff; 176 | background-image: url(../img/header-bg.jpg); 177 | background-repeat: no-repeat; 178 | background-attachment: scroll; 179 | background-position: center center; 180 | -webkit-background-size: cover; 181 | -moz-background-size: cover; 182 | -o-background-size: cover; 183 | background-size: cover; 184 | margin-top: -70px; 185 | } 186 | 187 | header.masthead .intro-text { 188 | padding-top: 150px; 189 | padding-bottom: 100px 190 | } 191 | 192 | header.masthead .intro-text .intro-lead-in { 193 | font-size: 22px; 194 | font-style: italic; 195 | line-height: 22px; 196 | margin-bottom: 25px; 197 | } 198 | 199 | header.masthead .intro-text .intro-heading { 200 | font-size: 50px; 201 | font-weight: 700; 202 | line-height: 50px; 203 | margin-bottom: 25px; 204 | } 205 | 206 | @media (min-width:768px) { 207 | header.masthead .intro-text { 208 | padding-top: 300px; 209 | padding-bottom: 200px 210 | } 211 | header.masthead .intro-text .intro-lead-in { 212 | font-size: 40px; 213 | font-style: italic; 214 | line-height: 40px; 215 | margin-bottom: 25px; 216 | } 217 | header.masthead .intro-text .intro-heading { 218 | font-size: 75px; 219 | font-weight: 700; 220 | line-height: 75px; 221 | margin-bottom: 50px; 222 | } 223 | } 224 | 225 | .negativeMargin { 226 | margin-top: -30px; 227 | padding: 2rem 0; 228 | padding-left: 25px; 229 | position: fixed; 230 | height: 100vh; 231 | z-index: 3; 232 | } 233 | 234 | .nav-link { 235 | cursor: pointer !important; 236 | } 237 | 238 | #intro-text { 239 | font-size: 1.3rem; 240 | font-weight: 400; 241 | line-height: 1.8 242 | } 243 | 244 | p { 245 | line-height: 1.9; 246 | 247 | } 248 | 249 | @media (min-width: 34em) { 250 | .card-columns { 251 | -webkit-column-count: 2; 252 | -moz-column-count: 2; 253 | column-count: 2; 254 | } 255 | } 256 | 257 | @media (min-width: 64em) { 258 | .card-columns { 259 | -webkit-column-count: 3; 260 | -moz-column-count: 3; 261 | column-count: 3; 262 | } 263 | } 264 | -------------------------------------------------------------------------------- /src/public/css/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 5rem; 3 | } 4 | 5 | .invalid-feedback { 6 | display: block; 7 | } 8 | 9 | .landscape-img img { 10 | width: 100%; 11 | height: 100%; 12 | object-fit: cover; 13 | } 14 | 15 | section { 16 | padding-top: 8rem; 17 | padding-bottom: 8rem; 18 | } 19 | 20 | .landscape-img { 21 | height: 350px; 22 | width: 100%; 23 | } 24 | 25 | 26 | #mainNav { 27 | background-color: #000; 28 | } 29 | 30 | a { 31 | color:black; 32 | } 33 | 34 | td .btn { 35 | width: 100%; 36 | } 37 | 38 | .activeNav { 39 | background-color: black; 40 | color: #fff; 41 | } 42 | 43 | /* Footer */ 44 | 45 | footer ul li { 46 | list-style-type: none; 47 | } 48 | 49 | footer ul li a { 50 | text-decoration: none; 51 | color: rgba(255,255,255,.7); 52 | } 53 | 54 | footer ul li a:hover { 55 | color: #fff; 56 | text-decoration: none; 57 | } 58 | 59 | .bg-dark { 60 | background-color: #19191E !important; 61 | } 62 | 63 | .navbar { 64 | padding: .5rem 0rem !important; 65 | } 66 | 67 | h2 a { 68 | color: #fff; 69 | text-decoration: underline; 70 | } 71 | 72 | h2 a:hover { 73 | color: rgba(255,255,255,.7); 74 | text-decoration: underline; 75 | } 76 | 77 | .text-faded { 78 | color: rgba(0,0,0,.7); 79 | } 80 | 81 | hr { 82 | max-width: 50px; 83 | border-width: 3px; 84 | border-color: #f05f40; 85 | } 86 | 87 | hr.light { 88 | border-color: #fff; 89 | } 90 | 91 | hr.dark { 92 | border-color: #000; 93 | } 94 | 95 | .inputDnD .form-control-file { 96 | position: relative; 97 | width: 100%; 98 | height: 100%; 99 | min-height: 6em; 100 | outline: none; 101 | visibility: hidden; 102 | cursor: pointer; 103 | background-color: #c61c23; 104 | box-shadow: 0 0 5px solid currentColor; 105 | } 106 | 107 | .text-upload { 108 | color: #ced4da; 109 | } 110 | 111 | .section-bg { 112 | background-color: #F5F5FA; 113 | } 114 | 115 | .inputDnD .form-control-file:before { 116 | content: attr(data-title); 117 | position: absolute; 118 | top: 0.5em; 119 | left: 0; 120 | width: 100%; 121 | min-height: 6em; 122 | line-height: 2em; 123 | padding-top: 1.5em; 124 | opacity: 1; 125 | visibility: visible; 126 | text-align: center; 127 | border: 3px dashed currentColor; 128 | transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 129 | overflow: hidden; 130 | } 131 | 132 | .inputDnD .form-control-file:hover:before { 133 | border-style: solid; 134 | box-shadow: inset 0px 0px 0px 0.25em currentColor; 135 | } 136 | 137 | header.masthead { 138 | text-align: left; 139 | color: #fff; 140 | background-image: url(../img/header-bg.jpg); 141 | background-repeat: no-repeat; 142 | background-attachment: scroll; 143 | background-position: center center; 144 | -webkit-background-size: cover; 145 | -moz-background-size: cover; 146 | -o-background-size: cover; 147 | background-size: cover; 148 | margin-top: -70px; 149 | } 150 | 151 | header.masthead .intro-text { 152 | padding-top: 150px; 153 | padding-bottom: 100px 154 | } 155 | 156 | header.masthead .intro-text .intro-lead-in { 157 | font-size: 22px; 158 | font-style: italic; 159 | line-height: 22px; 160 | margin-bottom: 25px; 161 | } 162 | 163 | header.masthead .intro-text .intro-heading { 164 | font-size: 50px; 165 | font-weight: 700; 166 | line-height: 50px; 167 | margin-bottom: 25px; 168 | } 169 | 170 | @media (min-width:768px) { 171 | header.masthead .intro-text { 172 | padding-top: 300px; 173 | padding-bottom: 200px 174 | } 175 | header.masthead .intro-text .intro-lead-in { 176 | font-size: 40px; 177 | font-style: italic; 178 | line-height: 40px; 179 | margin-bottom: 25px; 180 | } 181 | header.masthead .intro-text .intro-heading { 182 | font-size: 75px; 183 | font-weight: 700; 184 | line-height: 75px; 185 | margin-bottom: 50px; 186 | } 187 | } 188 | 189 | .negativeMargin { 190 | margin-top: -30px; 191 | padding: 2rem 0; 192 | padding-left: 25px; 193 | position: fixed; 194 | height: 100vh; 195 | z-index: 3; 196 | } 197 | 198 | .nav-link { 199 | cursor: pointer !important; 200 | } 201 | -------------------------------------------------------------------------------- /src/public/img/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/public/img/default.jpg -------------------------------------------------------------------------------- /src/public/img/header-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/public/img/header-bg.jpg -------------------------------------------------------------------------------- /src/public/js/pagination.js: -------------------------------------------------------------------------------- 1 | const allCards = document.querySelectorAll('.card-columns .card'); 2 | const paginationPlaceholder = document.querySelector('#cardPagination'); 3 | 4 | // let activePage = 0; 5 | // let cardsPerPage = 6; 6 | 7 | let length = allCards.length; 8 | 9 | let pages = Math.ceil(length/cardsPerPage); 10 | 11 | init(); 12 | 13 | showPage(activePage); 14 | 15 | function init() { 16 | let paginationCode = ``; 17 | 18 | for(let i = 0; i < pages; i++) { 19 | paginationCode += `
  • `; 20 | } 21 | 22 | 23 | paginationCode += ``; 24 | paginationPlaceholder.innerHTML = paginationCode; 25 | 26 | } 27 | 28 | function hideAll() { 29 | allCards.forEach(function(item) { 30 | item.classList.add('d-none'); 31 | }) 32 | } 33 | 34 | function nextPage() { 35 | showPage(activePage + 1); 36 | } 37 | 38 | function prevPage() { 39 | showPage(activePage - 1); 40 | } 41 | 42 | 43 | function showPage(index) { 44 | 45 | hideAll(); 46 | let start = index * cardsPerPage; 47 | let stop = index * cardsPerPage + cardsPerPage; 48 | 49 | stop = (stop < allCards.length) ? stop : allCards.length - 1; 50 | 51 | for(let i = start; i < stop; i++) { 52 | allCards[i].classList.remove('d-none'); 53 | } 54 | 55 | activePage = index; 56 | 57 | 58 | const prevButton = document.querySelector('#prev'); 59 | const nextButon = document.querySelector('#next'); 60 | 61 | if(activePage === 0) { 62 | prevButton.classList.add('disabled'); 63 | } else { 64 | prevButton.classList.remove('disabled'); 65 | } 66 | 67 | if(activePage === pages-1) { 68 | nextButon.classList.add('disabled'); 69 | } else { 70 | nextButon.classList.remove('disabled'); 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /src/public/js/scripts.js: -------------------------------------------------------------------------------- 1 | 2 | // Wait for document loaded (in jQuery) 3 | $(document).ready(function() { 4 | 5 | // TinyMCE init 6 | tinymce.init({ 7 | // Disable script-tags 8 | invalid_elements : "script", 9 | 10 | // Enable tinyMCE on id: post_text 11 | selector: '#post_text', 12 | branding: false, 13 | statusbar: false 14 | }); 15 | 16 | 17 | }); 18 | 19 | 20 | function readUrl(input) { 21 | if (input.files && input.files[0]) { 22 | let reader = new FileReader(); 23 | 24 | reader.addEventListener('load', () => { 25 | let imgName = input.files[0].name; 26 | document.querySelector('.text-upload').classList.add("text-success"); 27 | input.setAttribute("data-title", imgName); 28 | }); 29 | 30 | reader.readAsDataURL(input.files[0]); 31 | } 32 | } 33 | 34 | let selectInputs = document.querySelectorAll('.selectInput'); 35 | let buttonClose = document.querySelectorAll('.buttonClose'); 36 | 37 | buttonClose.forEach(function(e) { 38 | e.addEventListener('click', close); 39 | }); 40 | 41 | selectInputs.forEach(function(e) { 42 | e.addEventListener('click', selector); 43 | }) 44 | 45 | function selector(e) { 46 | let permissionDisplay = e.target.classList.add('d-none'); 47 | let selector = e.target.nextSibling.nextSibling.classList.remove('d-none'); 48 | } 49 | 50 | function close(e) { 51 | let displayPermission = e.target.parentNode.parentNode.parentNode.parentNode.parentNode.childNodes[1]; 52 | let removeSelectOptions = e.target.parentNode.parentNode.parentNode.parentNode; 53 | 54 | displayPermission.classList.remove('d-none'); 55 | removeSelectOptions.classList.add('d-none'); 56 | } -------------------------------------------------------------------------------- /src/public/js/validation.js: -------------------------------------------------------------------------------- 1 | // Select all Buttons and Forms 2 | let submitBtn = document.querySelector("#submitBtn"); 3 | 4 | // Select all text Inputs 5 | let firstnameInput = document.forms["myForm"]["firstname"]; 6 | let lastnameInput = document.forms["myForm"]["lastname"]; 7 | let emailInput = document.forms["myForm"]["email"]; 8 | let passwordInput = document.forms["myForm"]["password"]; 9 | let confirmPasswordInput = document.forms["myForm"]["confirm_password"]; 10 | 11 | let errorMsg = document.querySelectorAll('.invalid-feedback'); 12 | let labelMsg = document.querySelectorAll('label'); 13 | 14 | firstnameInput.addEventListener("input", checkFirstnameInput); 15 | lastnameInput.addEventListener("input", checkLastnameInput); 16 | emailInput.addEventListener("input", checkEmailInput); 17 | passwordInput.addEventListener("input", checkPassword); 18 | confirmPasswordInput.addEventListener("input", checkConfirmPassword); 19 | 20 | 21 | // check if firstname is empty 22 | function checkFirstnameInput() { 23 | if(firstnameInput.value == "") { 24 | firstnameInput.style.borderColor = "#E0B4B4"; 25 | firstnameInput.style.background = "#FFF6F6"; 26 | errorMsg[0].textContent = "Please enter first name"; 27 | labelMsg[0].style.color = "#9F3A38"; 28 | } else { 29 | firstnameInput.style.border = "1px solid rgba(34, 36, 38, 0.15)"; 30 | firstnameInput.style.background = "#fff"; 31 | firstnameInput.style.color = "#000"; 32 | errorMsg[0].textContent = " "; 33 | labelMsg[0].style.color = "#000"; 34 | } 35 | } 36 | 37 | // check if lastname is empty 38 | function checkLastnameInput() { 39 | if(lastnameInput.value == "") { 40 | lastnameInput.style.borderColor = "#E0B4B4"; 41 | lastnameInput.style.background = "#FFF6F6"; 42 | errorMsg[1].textContent = "Please enter last name"; 43 | labelMsg[1].style.color = "#9F3A38"; 44 | } else { 45 | lastnameInput.style.border = "1px solid rgba(34, 36, 38, 0.15)"; 46 | lastnameInput.style.background = "#fff"; 47 | lastnameInput.style.color = "#000"; 48 | errorMsg[1].textContent = " "; 49 | labelMsg[1].style.color = "#000"; 50 | } 51 | } 52 | 53 | // check if lastname is empty 54 | function checkEmailInput() { 55 | if(emailInput.value == "") { 56 | emailInput.style.borderColor = "#E0B4B4"; 57 | emailInput.style.background = "#FFF6F6"; 58 | errorMsg[2].textContent = "Please enter email"; 59 | labelMsg[2].style.color = "#9F3A38"; 60 | } else { 61 | emailInput.style.border = "1px solid rgba(34, 36, 38, 0.15)"; 62 | emailInput.style.background = "#fff"; 63 | emailInput.style.color = "#000"; 64 | errorMsg[2].textContent = " "; 65 | labelMsg[2].style.color = "#000"; 66 | } 67 | } 68 | 69 | // check if lastname is empty 70 | function checkPassword() { 71 | if(passwordInput.value == "") { 72 | passwordInput.style.borderColor = "#E0B4B4"; 73 | passwordInput.style.background = "#FFF6F6"; 74 | errorMsg[3].textContent = "Please enter password"; 75 | labelMsg[3].style.color = "#9F3A38"; 76 | } else { 77 | passwordInput.style.border = "1px solid rgba(34, 36, 38, 0.15)"; 78 | passwordInput.style.background = "#fff"; 79 | passwordInput.style.color = "#000"; 80 | errorMsg[3].textContent = " "; 81 | labelMsg[3].style.color = "#000"; 82 | } 83 | } 84 | 85 | // check if lastname is empty 86 | function checkConfirmPassword() { 87 | if(confirmPasswordInput.value == "") { 88 | confirmPasswordInput.style.borderColor = "#E0B4B4"; 89 | confirmPasswordInput.style.background = "#FFF6F6"; 90 | errorMsg[4].textContent = "Please confirm password"; 91 | labelMsg[4].style.color = "#9F3A38"; 92 | } else { 93 | confirmPasswordInput.style.border = "1px solid rgba(34, 36, 38, 0.15)"; 94 | confirmPasswordInput.style.background = "#fff"; 95 | confirmPasswordInput.style.color = "#000"; 96 | errorMsg[4].textContent = " "; 97 | labelMsg[4].style.color = "#000"; 98 | } 99 | } -------------------------------------------------------------------------------- /src/public/lib/popper/popper.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) Federico Zivolo 2018 3 | Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). 4 | */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=getComputedStyle(e,null);return t?o[t]:o}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function r(e){return 11===e?re:10===e?pe:re||pe}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1=o.clientWidth&&n>=o.clientHeight}),l=0a[e]&&!t.escapeWithReference&&(n=J(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!q(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-us[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,y=t(e.instance.popper),w=parseFloat(y['margin'+f],10),E=parseFloat(y['border'+f+'Width'],10),v=b-e.offsets.popper[m]-w-E;return v=$(J(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,Q(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case he.FLIP:p=[n,i];break;case he.CLOCKWISE:p=z(n);break;case he.COUNTERCLOCKWISE:p=z(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)f(l.top)||'bottom'===n&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,y=-1!==['top','bottom'].indexOf(n),w=!!t.flipVariations&&(y&&'start'===r&&h||y&&'end'===r&&c||!y&&'start'===r&&g||!y&&'end'===r&&u);(m||b||w)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),w&&(r=G(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!q(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.right 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/public/lib/tinymce/skins/lightgray/fonts/tinymce-small.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/public/lib/tinymce/skins/lightgray/fonts/tinymce-small.ttf -------------------------------------------------------------------------------- /src/public/lib/tinymce/skins/lightgray/fonts/tinymce-small.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/public/lib/tinymce/skins/lightgray/fonts/tinymce-small.woff -------------------------------------------------------------------------------- /src/public/lib/tinymce/skins/lightgray/fonts/tinymce.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/public/lib/tinymce/skins/lightgray/fonts/tinymce.eot -------------------------------------------------------------------------------- /src/public/lib/tinymce/skins/lightgray/fonts/tinymce.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/public/lib/tinymce/skins/lightgray/fonts/tinymce.ttf -------------------------------------------------------------------------------- /src/public/lib/tinymce/skins/lightgray/fonts/tinymce.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/public/lib/tinymce/skins/lightgray/fonts/tinymce.woff -------------------------------------------------------------------------------- /src/public/lib/tinymce/skins/lightgray/img/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/public/lib/tinymce/skins/lightgray/img/anchor.gif -------------------------------------------------------------------------------- /src/public/lib/tinymce/skins/lightgray/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/public/lib/tinymce/skins/lightgray/img/loader.gif -------------------------------------------------------------------------------- /src/public/lib/tinymce/skins/lightgray/img/object.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/public/lib/tinymce/skins/lightgray/img/object.gif -------------------------------------------------------------------------------- /src/public/lib/tinymce/skins/lightgray/img/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/public/lib/tinymce/skins/lightgray/img/trans.gif -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913237-9845-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913237-9845-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913237-9845.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913237-9845.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913290-2706-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913290-2706-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913290-2706.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913290-2706.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913366-496-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913366-496-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913366-496.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913366-496.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913444-6969-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913444-6969-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913444-6969.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913444-6969.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913542-2102-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913542-2102-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913542-2102.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913542-2102.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913621-853-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913621-853-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913621-853.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913621-853.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913750-4448-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913750-4448-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913750-4448.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913750-4448.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913812-1393-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913812-1393-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913812-1393.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913812-1393.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913867-9338-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913867-9338-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913867-9338.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913867-9338.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913916-1177-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913916-1177-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913916-1177.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913916-1177.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913959-433-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913959-433-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536913959-433.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536913959-433.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914158-4046-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914158-4046-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914158-4046.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914158-4046.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914198-2443-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914198-2443-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914198-2443.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914198-2443.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914235-9919-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914235-9919-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914235-9919.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914235-9919.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914287-4434-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914287-4434-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914287-4434.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914287-4434.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914350-9139-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914350-9139-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914350-9139.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914350-9139.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914403-733-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914403-733-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914403-733.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914403-733.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914458-6646-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914458-6646-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914458-6646.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914458-6646.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914627-6200-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914627-6200-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914627-6200.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914627-6200.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914686-1449-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914686-1449-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914686-1449.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914686-1449.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914771-9762-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914771-9762-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536914771-9762.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536914771-9762.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536916312-385-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536916312-385-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536916312-385.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536916312-385.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536916346-337-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536916346-337-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/14/1536916346-337.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/14/1536916346-337.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/18/1537266729-4155-thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/18/1537266729-4155-thumb.jpg -------------------------------------------------------------------------------- /src/uploads/images/2018/09/18/1537266729-4155.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielzeitler/PHP-MVC-Blog/3eac79087d0ab815c882271504adbad9922b930d/src/uploads/images/2018/09/18/1537266729-4155.jpg -------------------------------------------------------------------------------- /src/view/about/index.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 | 4 |

    Learn More About Us

    5 | 6 |
    7 | our cosy office 8 |
    9 | 10 |

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Amet est, numquam animi inventore quia nesciunt quisquam quod voluptates. Quam ducimus illo quasi velit reiciendis aut distinctio dolor recusandae eius. Ab obcaecati ad illo laboriosam eaque inventore blanditiis ex adipisci, suscipit, modi rerum ipsa hic enim aliquid eveniet fuga, commodi ratione!

    11 |

    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fuga voluptatem vitae doloribus quaerat id minus quae nostrum, ut delectus ad laboriosam expedita ducimus! Libero, nemo maiores? Expedita voluptates tempora delectus, in recusandae vero, quas dignissimos suscipit sapiente id minus explicabo quod harum accusamus reprehenderit blanditiis mollitia beatae, est a commodi perspiciatis. Accusantium culpa odit nostrum deleniti? Quae eos facere temporibus inventore enim vitae nisi aliquid voluptatum dolorum excepturi atque nihil architecto illo distinctio molestias quos ea nulla explicabo, reprehenderit nesciunt magnam voluptates. Reiciendis totam maiores soluta voluptatem nesciunt praesentium, hic suscipit illum esse, quas dolor. Dolor, reprehenderit, dolore sit reiciendis facere, similique saepe vero aspernatur architecto autem officiis illum ut ipsa. Vel, totam, voluptate sit adipisci reiciendis dolores dolor, repellat tempora soluta dignissimos ab possimus minus corrupti? Doloribus aliquid magnam doloremque amet ut vel accusamus pariatur corporis fuga saepe, quod debitis voluptates at dolorem odio dolores voluptatem. Neque, voluptas obcaecati?

    12 | 13 |
    14 |
    15 |
    Who We Are
    16 |

    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam similique cumque quod natus quos distinctio ullam nulla beatae iusto, vero, laboriosam est doloremque nesciunt, optio numquam ab. Alias, temporibus labore.

    17 |
    18 | 19 |
    20 |
    Our Mission
    21 |

    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam similique cumque quod natus quos distinctio ullam nulla beatae iusto, vero, laboriosam est doloremque nesciunt, optio numquam ab. Alias, temporibus labore.

    22 |
    23 |
    24 | 25 |
    26 |
    27 |
    Our Vision
    28 |

    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam similique cumque quod natus quos distinctio ullam nulla beatae iusto, vero, laboriosam est doloremque nesciunt, optio numquam ab. Alias, temporibus labore.

    29 |
    30 | 31 |
    32 |
    Our Values
    33 |

    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam similique cumque quod natus quos distinctio ullam nulla beatae iusto, vero, laboriosam est doloremque nesciunt, optio numquam ab. Alias, temporibus labore.

    34 |
    35 |
    36 |
    37 | 38 | -------------------------------------------------------------------------------- /src/view/auth/login.php: -------------------------------------------------------------------------------- 1 | email_err) ? true : false; 3 | $emailErrorMsg = isset($this->email_err) ? $this->email_err : ''; 4 | ?> 5 |
    6 |
    7 |
    8 |
    9 | 10 | 11 | 12 | 18 | 19 | 20 |

    Login

    21 |

    Please fill in your credentials to log in

    22 |
    23 |
    24 | 25 | 26 |
    27 | 28 |
    29 | 30 | 31 |
    32 | 33 |
    34 |
    35 | 36 |
    37 | 40 |
    41 |
    42 |
    43 |
    44 |
    45 |
    -------------------------------------------------------------------------------- /src/view/auth/register.php: -------------------------------------------------------------------------------- 1 | error) ? 'error' : ''; 4 | 5 | $firstnameData = isset($this->formData['firstname']) ? $this->formData['firstname'] : ''; 6 | $lastnameData = isset($this->formData['lastname']) ? $this->formData['lastname'] : ''; 7 | $emailData = isset($this->formData['email']) ? $this->formData['email'] : ''; 8 | $passwordData = isset($this->formData['password']) ? $this->formData['password'] : ''; 9 | $confirmPasswordData = isset($this->formData['confirm_data']) ? $this->formData['confirm_data'] : ''; 10 | 11 | $firstnameErr = isset($this->error['firstname']) ? 'is-invalid' : ''; 12 | $lastNameErr = isset($this->error['lastname']) ? 'is-invalid' : ''; 13 | $emailErr = isset($this->error['email']) ? 'is-invalid' : ''; 14 | $passwordErr = isset($this->error['password']) ? 'is-invalid' : ''; 15 | $confirmPasswordErr = isset($this->error['confirm_password']) ? 'is-invalid' : ''; 16 | 17 | $nameErrorMsg = isset($this->error['name_err']) ? $this->error['name_err'] : ''; 18 | $lastNameErrorMsg = isset($this->error['lastname_err']) ? $this->error['lastname_err'] : ''; 19 | $emailErrorMsg = isset($this->error['email_err']) ? $this->error['email_err'] : ''; 20 | $passwordErrorMsg = isset($this->error['password_err']) ? $this->error['password_err'] : ''; 21 | $confirmPasswordErrorMsg = isset($this->error['confirm_password_err']) ? $this->error['confirm_password_err'] : ''; 22 | 23 | ?> 24 | 25 |
    26 |
    27 |
    28 |
    29 |

    Create An Account

    30 |

    Please fill out this form to register with us

    31 |
    32 | 33 |
    34 | 35 | 36 | 37 |
    38 | 39 | 40 |
    41 | 42 | 43 | 44 |
    45 | 46 |
    47 | 48 | 49 | 50 |
    51 | 52 | 53 |
    54 | 55 | 56 | 57 |
    58 | 59 |
    60 | 61 | 62 | 63 |
    64 | 65 |
    66 |
    67 | 68 |
    69 | 72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 |
    -------------------------------------------------------------------------------- /src/view/category/show.php: -------------------------------------------------------------------------------- 1 | data; 3 | $user = Session::get('user'); 4 | ?> 5 | 6 |
    7 | 8 | 9 |

    header; ?>

    10 |
    11 | Article posted on timestamp ?> in Category category_name; ?> 12 |
    13 | 14 |
    15 | 16 |
    17 | 18 |

    content; ?>

    19 | 20 | 21 | 22 |
    23 |
    24 | 25 | 26 |
    27 | 28 |
    29 | 30 | 31 | 32 | 33 | comments)): ?> 34 |
    35 |

    No comment has been submitted yet.

    36 |
    37 | 38 | comments as $comment) : ?> 39 |
    40 |

    firstname ?> wrote:

    41 |

    comment_content ?>

    42 | timestamp ?> 43 |
    44 | 45 | 46 |
    47 | -------------------------------------------------------------------------------- /src/view/category/showAll.php: -------------------------------------------------------------------------------- 1 | 9 | 10 |
    11 |

    Category:

    12 |

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Corrupti non inventore vitae erunt quaerat earum. Perspiciatis commodi necessitatibus quasi voluptatum quisquam incidunt qui, quia ipsam, voluptatibus eligendi aperiam reprehenderit sunt ratione alias vel, corrupti laborum deserunt? Culpa, ut minus.

    13 | 14 |
    15 | 16 | 17 |
    18 |
    19 | 20 |
    21 | 22 |
    23 |
    24 |
    25 | 26 | 27 |
    28 | posts as $item) : ?> 29 |
    30 | 31 | Card image cap 32 | 33 |
    34 | 35 |

    category_name ?>

    36 | 37 |
    header ?>
    38 |

    content, 0, 100) ?>...read more

    39 |
    40 |
    41 |

    timestamp ?>

    42 |
    43 | 44 |
    45 |

    Posted by:
    firstname . ' ' . $item->lastname?>

    46 |
    47 |
    48 |
    49 |
    50 | 51 |
    52 | 53 | 54 |
    -------------------------------------------------------------------------------- /src/view/contact/index.php: -------------------------------------------------------------------------------- 1 | 2 |
    3 | 4 |

    Feel Free To Contact Us

    5 | 6 | 7 | 8 | 9 |

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Amet est, numquam animi inventore quia nesciunt quisquam quod voluptates. Quam ducimus illo quasi velit reiciendis aut distinctio dolor recusandae eius. Ab obcaecati ad illo laboriosam eaque inventore blanditiis ex adipisci, suscipit, modi rerum ipsa hic enim aliquid eveniet fuga, commodi ratione!

    10 |

    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fuga voluptatem vitae doloribus quaerat id minus quae nostrum, ut delectus ad laboriosam expedita ducimus! Libero, nemo maiores? Expedita voluptates tempora delectus, in recusandae vero, quas dignissimos suscipit sapiente id minus explicabo quod harum accusamus reprehenderit blanditiis mollitia beatae, est a commodi perspiciatis. Accusantium culpa odit nostrum deleniti? Quae eos facere temporibus inventore enim vitae nisi aliquid voluptatum dolorum excepturi atque nihil architecto illo distinctio molestias quos ea nulla explicabo, reprehenderit nesciunt magnam voluptates. Reiciendis totam maiores soluta voluptatem nesciunt praesentium, hic suscipit illum esse, quas dolor. Dolor, reprehenderit, dolore sit reiciendis facere, similique saepe vero aspernatur architecto autem officiis illum ut ipsa. Vel, totam, voluptate sit adipisci reiciendis dolores dolor, repellat tempora soluta dignissimos ab possimus minus corrupti? Doloribus aliquid magnam doloremque amet ut vel accusamus pariatur corporis fuga saepe, quod debitis voluptates at dolorem odio dolores voluptatem. Neque, voluptas obcaecati?

    11 | 12 |
    13 |
    14 |
    Where to find us
    15 |
    16 |

    Musterstraße 31

    17 |

    20535 Hamburg

    18 |

    Deutschland

    19 |
    20 |
    21 | 22 |
    23 |
    Contact info
    24 |
    25 |

    contact@taleofmind.com

    26 |

    info@taleofmind.com

    27 |

    Phone: +49 0152 123456

    28 |
    29 |
    30 |
    31 |
    32 | 33 | -------------------------------------------------------------------------------- /src/view/dashboard/add.php: -------------------------------------------------------------------------------- 1 | 2 | post_err) ? true : false; 5 | $postErrMsg = isset($this->post_err) ? $this->post_err : ''; 6 | 7 | ?> 8 | 9 |
    10 |
    11 | 12 |

    Add post

    13 | 14 | 15 |
    16 | 17 | 23 | 24 | 25 |
    26 |
    27 | 28 | 29 |
    30 | 31 |
    32 | 33 | 38 |
    39 | 40 |
    41 | 42 |
    43 | 44 |
    45 | 46 | 47 |
    48 | 49 |
    50 | 51 | 52 |
    53 | 54 |
    55 |
    56 | 57 |
    58 |
    59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/view/dashboard/allUserPosts.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 |
    5 | 6 |

    Your Posts

    7 | 8 | 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | allPosts)): ?> 21 |

    No post submitted yet

    22 | 23 | allPosts as $post) : ?> 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
    TitleCategoryAuthorPost Options
    header ?>category_name ?>firstname . ' ' . $post->lastname?>ViewEditDelete
    36 |
    37 |
    38 |
    39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/view/dashboard/allUsers.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 |
    5 | 6 |

    Dashboard

    7 | 8 | 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | allUsers as $user) : ?> 21 | 22 | 23 | 24 | 48 | 49 | 50 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 |
    EmailLogin AttemptsPermissionStatus
    email ?>login_attempts ?> 25 | 26 | 27 |
    28 |
    29 |
    30 |
    31 | 36 | 37 |
    38 |
    39 |
    40 | 41 |
    42 | 43 | 44 | 45 |
    46 |
    47 |
    51 | login_attempts >= 3): ?> 52 |
    53 | 54 |
    55 |
    65 |
    66 |
    67 |
    68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/view/dashboard/category.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 |
    5 | 6 | 7 |

    Add Category

    8 |
    9 |
    10 | 11 |
    12 | 13 | 14 |
    15 | 16 | 17 |
    18 | 19 |
    20 |
    21 |
    22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/view/dashboard/edit.php: -------------------------------------------------------------------------------- 1 | 2 | post_err) ? true : false; 5 | $postErrMsg = isset($this->post_err) ? $this->post_err : ''; 6 | 7 | ?> 8 | 9 | 10 |
    11 |
    12 | 13 |

    Add post

    14 | 15 | 16 |
    17 | 18 | 24 | 25 | 26 | posts as $post) : ?> 27 |
    28 | 29 |
    30 | 31 | 32 |
    33 | 34 |
    35 | 36 | 41 |
    42 | 43 | 44 | 45 |
    46 | 47 |
    48 | 49 |
    50 | 51 |
    52 | Card image cap 53 |
    54 |
    55 | 56 |
    57 | 58 | 59 |
    60 | 61 |
    62 | 63 | 64 |
    65 | 66 |
    67 |
    68 | 69 |
    70 |
    71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/view/dashboard/editProfile.php: -------------------------------------------------------------------------------- 1 | error) ? 'error' : ''; 3 | 4 | $firstnameData = isset($this->formData['firstname']) ? $this->formData['firstname'] : ''; 5 | $lastnameData = isset($this->formData['lastname']) ? $this->formData['lastname'] : ''; 6 | $emailData = isset($this->formData['email']) ? $this->formData['email'] : ''; 7 | $passwordData = isset($this->formData['password']) ? $this->formData['password'] : ''; 8 | $confirmPasswordData = isset($this->formData['confirm_data']) ? $this->formData['confirm_data'] : ''; 9 | 10 | $firstnameErr = isset($this->error['firstname']) ? 'is-invalid' : ''; 11 | $lastNameErr = isset($this->error['lastname']) ? 'is-invalid' : ''; 12 | $emailErr = isset($this->error['email']) ? 'is-invalid' : ''; 13 | $passwordErr = isset($this->error['password']) ? 'is-invalid' : ''; 14 | $confirmPasswordErr = isset($this->error['confirm_password']) ? 'is-invalid' : ''; 15 | 16 | $nameErrorMsg = isset($this->error['name_err']) ? $this->error['name_err'] : ''; 17 | $lastNameErrorMsg = isset($this->error['lastname_err']) ? $this->error['lastname_err'] : ''; 18 | $emailErrorMsg = isset($this->error['email_err']) ? $this->error['email_err'] : ''; 19 | $passwordErrorMsg = isset($this->error['password_err']) ? $this->error['password_err'] : ''; 20 | $confirmPasswordErrorMsg = isset($this->error['confirm_password_err']) ? $this->error['confirm_password_err'] : ''; 21 | ?> 22 | 23 | 24 | 25 |
    26 |
    27 |

    Edit Profile

    28 | 29 | 30 |
    31 | 32 | 33 |
    34 | 35 | 36 | 37 |
    38 | 39 |
    40 | 41 |
    42 | 43 | 44 |
    45 | 46 |
    47 | 48 | 49 | 50 |
    51 | 52 |
    53 | 54 | 55 | 56 |
    57 | 58 |
    59 | 60 | 61 | 62 |
    63 | 64 |
    65 | 66 | 67 | 68 |
    69 | 70 |
    71 | 72 | 73 | 74 |
    75 | 76 | 77 |
    78 | 79 |
    80 |
    81 |
    82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /src/view/dashboard/view.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 |
    5 | 6 |

    Dashboard

    7 | 8 | 9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | posts as $post) : ?> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
    TitleCategoryAuthorPost Options
    header ?>category_name ?>firstname . ' ' . $post->lastname?>ViewEditDeleteViewEditView
    39 |
    40 |
    41 |
    42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/view/home/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 |
    5 |
    6 |

    Get started with digital mindfulness

    7 |
    Great technology creates focus, joy, and human
    connection. Find out how.
    8 | Read More 9 |
    10 |
    11 |
    12 | 13 |
    14 |
    15 |
    16 |
    17 |

    What is Tale Of Mind?

    18 |
    19 |

    Tale of Mind is for the passionate, the fearless, and the dreamers who believe. For those who are smart, curious, and conscious, with an open mind, a love for learning, and a deep desire to live a brilliant and vibrant life.

    20 |
    21 |
    22 |
    23 |
    24 | 25 | 26 |
    27 | 28 | 29 |
    30 |
    31 | 32 | post as $item) : ?> 33 |
    34 | 35 | Card image cap 36 | 37 |
    38 | 39 |

    category_name ?>

    40 | 41 |
    header ?>
    42 |

    content, 0, 100) ?>...read more

    43 |
    44 |
    45 |

    timestamp ?>

    46 |
    47 | 48 |
    49 |

    Posted by:
    firstname . ' ' . $item->lastname?>

    50 |
    51 |
    52 |
    53 |
    54 | 55 | 56 |
    57 | 58 | 59 | 60 |
    61 | 66 |
    67 |
    68 | 72 | 73 | --------------------------------------------------------------------------------