From 6767e506f59b131a3e9c6ac0e3461baca6bf7858 Mon Sep 17 00:00:00 2001 From: nathantschultz Date: Mon, 17 Feb 2014 18:10:05 -0700 Subject: [PATCH] Insert, Update and Delete posts, links and users. --- .htaccess | 5 + 400.php | 8 + 400.shtml | 8 + 401.php | 7 + 401.shtml | 7 + 403.php | 7 + 403.shtml | 7 + 404.php | 7 + 404.shtml | 7 + 500.php | 7 + 500.shtml | 7 + css/style.css | 5 +- error_page.php | 6 + helpers.php | 92 ++++++- index.php | 443 +++++++++++++++++++++++++++++++++- js/jquery.validate.min.js | 2 + js/registrationRules.js | 51 ++++ model.php | 493 ++++++++++++++++++++++++++++++++++++++ view/assignments.php | 21 +- view/blank.php | 16 ++ view/confirm.php | 22 ++ view/confirm_user.php | 25 ++ view/create.php | 51 ++++ view/createAccount.php | 38 +++ view/edit.php | 64 +++++ view/edit_user.php | 59 +++++ view/header.php | 19 +- view/list.php | 21 ++ view/login.php | 50 ++++ view/profile.php | 35 +++ website/error_log | 23 -- website/view/profile.php | 12 +- 32 files changed, 1571 insertions(+), 54 deletions(-) create mode 100644 .htaccess create mode 100644 400.php create mode 100644 400.shtml create mode 100644 401.php create mode 100644 401.shtml create mode 100644 403.php create mode 100644 403.shtml create mode 100644 404.php create mode 100644 404.shtml create mode 100644 500.php create mode 100644 500.shtml create mode 100644 error_page.php create mode 100755 js/jquery.validate.min.js create mode 100644 js/registrationRules.js create mode 100644 view/blank.php create mode 100644 view/confirm.php create mode 100644 view/confirm_user.php create mode 100644 view/create.php create mode 100644 view/createAccount.php create mode 100644 view/edit.php create mode 100644 view/edit_user.php create mode 100644 view/list.php create mode 100644 view/login.php create mode 100644 view/profile.php delete mode 100644 website/error_log diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..5f3ffe9 --- /dev/null +++ b/.htaccess @@ -0,0 +1,5 @@ +ErrorDocument 400 /400.php +ErrorDocument 401 /401.php +ErrorDocument 403 /403.php +ErrorDocument 404 /404.php +ErrorDocument 500 /500.php \ No newline at end of file diff --git a/400.php b/400.php new file mode 100644 index 0000000..e945dae --- /dev/null +++ b/400.php @@ -0,0 +1,8 @@ + + +

400 Error:

+

Bad request

+ \ No newline at end of file diff --git a/400.shtml b/400.shtml new file mode 100644 index 0000000..e945dae --- /dev/null +++ b/400.shtml @@ -0,0 +1,8 @@ + + +

400 Error:

+

Bad request

+ \ No newline at end of file diff --git a/401.php b/401.php new file mode 100644 index 0000000..44a383c --- /dev/null +++ b/401.php @@ -0,0 +1,7 @@ + + +

401 Error:

+

Authorization required

diff --git a/401.shtml b/401.shtml new file mode 100644 index 0000000..44a383c --- /dev/null +++ b/401.shtml @@ -0,0 +1,7 @@ + + +

401 Error:

+

Authorization required

diff --git a/403.php b/403.php new file mode 100644 index 0000000..ce85bd7 --- /dev/null +++ b/403.php @@ -0,0 +1,7 @@ + + +

403 Error:

+

Forbidden

diff --git a/403.shtml b/403.shtml new file mode 100644 index 0000000..ce85bd7 --- /dev/null +++ b/403.shtml @@ -0,0 +1,7 @@ + + +

403 Error:

+

Forbidden

diff --git a/404.php b/404.php new file mode 100644 index 0000000..ccbcfe4 --- /dev/null +++ b/404.php @@ -0,0 +1,7 @@ + + +

404 Error:

+

Page not found

diff --git a/404.shtml b/404.shtml new file mode 100644 index 0000000..ccbcfe4 --- /dev/null +++ b/404.shtml @@ -0,0 +1,7 @@ + + +

404 Error:

+

Page not found

diff --git a/500.php b/500.php new file mode 100644 index 0000000..3cea3f5 --- /dev/null +++ b/500.php @@ -0,0 +1,7 @@ + + +

500 Error:

+

Internal server error

diff --git a/500.shtml b/500.shtml new file mode 100644 index 0000000..3cea3f5 --- /dev/null +++ b/500.shtml @@ -0,0 +1,7 @@ + + +

500 Error:

+

Internal server error

diff --git a/css/style.css b/css/style.css index f5833ab..84a293f 100644 --- a/css/style.css +++ b/css/style.css @@ -66,6 +66,7 @@ a:active { /* selected link */ #c1 { background: url(/images/home.jpeg) fixed no-repeat; background-size: cover; + font-size: 6em; } .content p { @@ -89,7 +90,3 @@ img { height: auto; box-shadow: 5px 5px 25px black; } - -#welcome{ - font-size: 6em; -} \ No newline at end of file diff --git a/error_page.php b/error_page.php new file mode 100644 index 0000000..8ed065d --- /dev/null +++ b/error_page.php @@ -0,0 +1,6 @@ + + +

404 Error: Page not found

diff --git a/helpers.php b/helpers.php index 7294fbb..3c67db0 100644 --- a/helpers.php +++ b/helpers.php @@ -1,5 +1,11 @@ "; + foreach ($headers as $head){ + $navigation .= "
  • ". $head['title'] . "

    Edit Delete
  • "; + } + $navigation .= ""; + + } else { + $navigation = 'Sorry, a critical error occurred.'; + } + return $navigation; + + +} + +function buildUserProfile($id){ + $people = getPeople(); + $content = null; + $admin = null; + + foreach ($people as $person){ + if ($person['user_id'] == $id){ + if($person['admin']){ + $admin = "YES"; + } else { + $admin = "NO"; + } + $content .= "

    ".$person['name']."

    "; + } + } + + return $content; +} + +function buildAdminProfile(){ + + + //display content list link + + //display list of users with editing abilitiy for each part + $people = getPeople(); + $content = "

    EDIT CONTENT

    USERS: