diff --git a/.gitignore b/.gitignore index 49adb33..9479d1a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - +.idea/* # User-specific stuff: .idea/workspace.xml .idea/tasks.xml diff --git a/website/mysql_config.xml b/website/mysql_config.xml deleted file mode 100644 index de2d929..0000000 --- a/website/mysql_config.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - localhost - myhyvesbookplus - mhbp - qdtboXhCHJyL2szC - \ No newline at end of file diff --git a/website/public/.htaccess b/website/public/.htaccess new file mode 100644 index 0000000..f08898a --- /dev/null +++ b/website/public/.htaccess @@ -0,0 +1,12 @@ +Options +FollowSymLinks +RewriteEngine On + +ErrorDocument 404 /error404.jpg + +RewriteCond %{SCRIPT_FILENAME} !-d +RewriteCond %{SCRIPT_FILENAME} !-f + +# Resolve .php file for extensionless php urls +RewriteRule ^([^/.]+)$ $1.php [L] + +RewriteRule ^profile/([A-z0-9]+)$ profile.php?username=$1 [NC] \ No newline at end of file diff --git a/website/public/API/loadMessages.php b/website/public/API/loadMessages.php new file mode 100644 index 0000000..e30acc8 --- /dev/null +++ b/website/public/API/loadMessages.php @@ -0,0 +1,13 @@ + @import url("styles/chat.css"); + \ +
\ + ' + messages[i].content + '\ +
\ + \ + '); + } +} + +function switchUser(userID) { + $(".chat-field").show(); + $(".destinationID").val(userID); + $("#chat-history").html(""); + $("#lastID").val(""); + $(".chat-left .friend-item").removeClass("active-friend-chat"); + $(".chat-left #friend-item-" + userID).addClass("active-friend-chat"); +} + +function sayEmpty() { + $("#chat-history").html("Begin nu met chatten!"); +} \ No newline at end of file diff --git a/website/public/js/header.js b/website/public/js/header.js index 797c56c..093cc91 100644 --- a/website/public/js/header.js +++ b/website/public/js/header.js @@ -1,7 +1,33 @@ $(document).ready(function() { + // Hide notification center. $("#profile-menu-popup").hide(); + + // $("#own-profile-picture").click(function() { + // $("#profile-menu-popup").toggle(); + // $("#profile-hello-popup").toggle(); + // }); + $("#own-profile-picture").click(function() { - $("#profile-menu-popup").toggle(); - $("#profile-hello-popup").toggle(); + if($("#notification-center").css('right') == "-256px") { + $(".content").animate({ + marginRight: "256px" + }, 500); + $(".chat-right").animate({ + width: "100%" + }, 500); + $("#notification-center").animate({ + right: "0px" + }, 500); + } else { + $(".chat-right").animate({ + width: "100%" + }, 500); + $(".content").animate({ + marginRight: "0px" + }, 500); + $("#notification-center").animate({ + right: "-256px" + }, 500); + } }); }); diff --git a/website/public/js/menu.js b/website/public/js/menu.js index d4471eb..32b048a 100644 --- a/website/public/js/menu.js +++ b/website/public/js/menu.js @@ -6,7 +6,7 @@ $(document).ready(function() { $("#more-friends-click").click(function() { // Show only friends $("#groups-menu-section").slideUp(); - $("#friends-menu-section a").show(); + $("#friends-menu-section li").show(); // Change buttons $("#more-friends-click").hide(); @@ -17,7 +17,7 @@ $(document).ready(function() { $("#more-groups-click").click(function() { // Show only groups $("#friends-menu-section").slideUp(); - $("#groups-menu-section a").show(); + $("#groups-menu-section li").show(); // Change buttons $("#more-groups-click").hide(); diff --git a/website/public/js/notifications.js b/website/public/js/notifications.js new file mode 100644 index 0000000..cb013b8 --- /dev/null +++ b/website/public/js/notifications.js @@ -0,0 +1,34 @@ +function showNotifications(notifications, id) { + $("#friendrequestslist").html(""); + for (i in notifications) { + $("#friendrequestslist").append(" \ +
  • \ +
    \ + \ +
    \ +
  • \ + "); + } +} + +function loadNotifications() { + $.post( + "API/loadNotifications.php" + ).done(function(data) { + if (data && data != "[]") { + showNotifications(JSON.parse(data), "friendrequestslist"); + } + }); + + setTimeout(loadNotifications, 10000); +} + +loadNotifications(); + diff --git a/website/public/js/registerAndLogin.js b/website/public/js/registerAndLogin.js new file mode 100644 index 0000000..0452d15 --- /dev/null +++ b/website/public/js/registerAndLogin.js @@ -0,0 +1,8 @@ +function checkLoggedIn() { + if (confirm("You are already logged in!\nDo you want to logout?\nPress ok to logout.") == true) { + window.location.href = "logout.php"; + } else { + window.location.href = "profile.php"; + } + document.getElementById("demo").innerHTML = x; +} diff --git a/website/public/login.php b/website/public/login.php index 82570a6..0d07413 100644 --- a/website/public/login.php +++ b/website/public/login.php @@ -2,13 +2,20 @@ + window.onload=checkLoggedIn(); + "; + } + // Define variables and set to empty values $uname = $psw =""; $loginErr =""; @@ -21,15 +28,15 @@ } else { - $uname=strtolower($_POST["uname"]); - $psw=$_POST["psw"]; - $hash=hashPassword()["password"]; - $userid=hashPassword()["userID"]; - + $uname = strtolower(test_input($_POST["uname"])); + $psw = test_input($_POST["psw"]); + $hash = getUser()["password"]; + $userid = getUser()["userID"]; + // If there's an account, go to the profile page - if(password_verify($psw.$uname, $hash)) { + if(password_verify($psw, $hash)) { $_SESSION["userID"] = $userid; - header("location: /profile.php"); + header("location: profile.php"); } else { $loginErr = "Inloggegevens zijn niet correct"; diff --git a/website/public/logout.php b/website/public/logout.php new file mode 100644 index 0000000..6a2ba5d --- /dev/null +++ b/website/public/logout.php @@ -0,0 +1,15 @@ + + + + + + + diff --git a/website/public/profile.php b/website/public/profile.php index d82fe48..e4f1452 100644 --- a/website/public/profile.php +++ b/website/public/profile.php @@ -2,12 +2,28 @@ + diff --git a/website/public/search.php b/website/public/search.php index c314791..6cfadd8 100644 --- a/website/public/search.php +++ b/website/public/search.php @@ -1,7 +1,11 @@ - + diff --git a/website/public/settings.php b/website/public/settings.php index 2f91690..06d17c0 100644 --- a/website/public/settings.php +++ b/website/public/settings.php @@ -14,6 +14,7 @@ "settings-message-angry", - "message" => "Deze functie werkt nog niet :(" - ); + $result = changeEmail(); break; case "picture": - $result = array ( - "type" => "settings-message-angry", - "message" => "Deze functie werkt nog niet :(" - ); + updateProfilePicture(); + $result = new settingsMessage("happy", "Deze melding doet nog niks nuttigs."); break; } } diff --git a/website/public/styles/adminpanel.css b/website/public/styles/adminpanel.css index e761592..4c5356f 100644 --- a/website/public/styles/adminpanel.css +++ b/website/public/styles/adminpanel.css @@ -6,22 +6,26 @@ .admin-title { margin: 10px; padding-bottom: 5px; - border-bottom: 4px solid #845663; + border-bottom: 4px solid #FBC02D; } .admin-panel input[type="radio"], input[type="checkbox"] { height: auto; } -.admin-actions { +.admin-batchactions, .admin-groupbatchactions { display: inline-block; padding: 8px; vertical-align: top; border-radius: 10px; - border: 4px solid #845663; + border: 4px solid #FBC02D; box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); } +.admin-searchform { + display: inline-block; +} + .admin-searchbar { display: inline-block; margin: 10px; @@ -32,17 +36,38 @@ margin-bottom: 10px; } -.admin-filter { +.admin-filter, .admin-filtertype, .admin-groupfilter { display: inline-block; margin: 10px; vertical-align: top; - margin-right: 100px; + margin-right: 50px; + margin-left: 50px; +} + +.admin-filter, .admin-groupfilter { + width: 120px; } .admin-users { margin: 10px; } +.admin-userheading { + width: auto; + float: left; +} + +.admin-pageui { + text-align: right; + float: right; + width: auto; + margin-bottom: 20px; +} + +.usertitle { + width: 150px; +} + .usertable { width: 100%; } diff --git a/website/public/styles/chat.css b/website/public/styles/chat.css index 8f486bb..f6060dd 100644 --- a/website/public/styles/chat.css +++ b/website/public/styles/chat.css @@ -83,9 +83,14 @@ .chat-field input[type="submit"] { width: auto; float: right; - background-color: #845663; + background-color: #FBC02D; color: white; padding: 5px 10px; border-radius: 0 10px 10px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); +} + +.active-friend-chat { + background: aquamarine; + color: #333; } \ No newline at end of file diff --git a/website/public/styles/header.css b/website/public/styles/header.css index 84f308c..e39f204 100644 --- a/website/public/styles/header.css +++ b/website/public/styles/header.css @@ -8,21 +8,23 @@ header { width: 100%; color: white; - background-color: rgba(132,86,99, 0.98); + background-color: #FBC02D; box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); } +#header-logo { + padding-left: 42px; +} #header-logo, #header-logo img { height: 80px; vertical-align: middle; line-height: 80px; - padding-left: 5px; } #header-search { - padding-left: 48px; + padding-left: 42px; } @@ -33,32 +35,12 @@ header { header div { display: inline-block; } - -#open-chat { - font-size: 32px; - line-height: 80px; - margin-right: 50px; -} - -.profile-menu { - font-size: 21px; -} - .profile-menu img { padding: 8px; height: 64px; width: 64px; } -#own-profile-picture, #profile-menu-popup span { +#own-profile-picture { cursor: pointer; } - -#profile-menu-popup { - padding: 5px; - - background: white; - color: #666; - - border-radius: 3px; -} diff --git a/website/public/styles/index.css b/website/public/styles/index.css index a368066..6c12823 100644 --- a/website/public/styles/index.css +++ b/website/public/styles/index.css @@ -1,23 +1,7 @@ -::selection { - background: #845663; - color: white; -} - -::-moz-selection { - background: #845663; - color: white; -} - -a, a:link, a:visited, a:hover, a:active { - color: inherit; - text-decoration: none; -} - a.button { - background-color: #845663; - border: 2px solid black; - border-radius: 12px; - color: white; + background-color: #C8CABD; + border-radius: 10px; + color: black; cursor: pointer; height: 50%; margin: 8px 0; @@ -27,64 +11,19 @@ a.button { font-size: 16px; } -a[data-title]:hover:after, img[data-title]:hover:after, span[data-title]:hover:after, -div[data-title]:hover:after{ - content: attr(data-title); - padding: 4px 4px; - color: #FFFFFF; - position: absolute; - left: 0; - top: 100%; - z-index: 20; - white-space: nowrap; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - -moz-box-shadow: 0px 0px 4px #222; - -webkit-box-shadow: 0px 0px 4px #222; - box-shadow: 0px 0px 4px #222; - background-color: #333; - font-size: 15px; - line-height: normal; - font-family: Arial, sans-serif; -} - -/* Add Zoom Animation */ -.animate { - animation: animatezoom 0.6s - -webkit-animation: animatezoom 0.6s; -} - /* Body */ body { height: 900px; + background-color: #C8CABD; + /*background-image: url(http://play.pokemonshowdown.com/fx/client-bg-shaymin.jpg); + background-size: cover; + background-attachment: fixed;*/ - background-image: url(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTEnqKdVtLbxjKuNsCSCxFRhTOpp3Gm0gsU8bMgA_MeUYyzrUFy); - background-size: contain; - background-repeat: repeat-x; - background-attachment: fixed; - - /*background-color: #B78996;*/ + /*background-color: #EEE;*/ color: #333; - font-family: Arial, sans-serif; } -/* stijl voor alle buttons */ -button { - background-color: #845663; - border: 2px solid black; - border-radius: 12px; - color: white; - cursor: pointer; - height: 50%; - margin: 8px 0; - padding: 14px 20px; - width: 25%; - font-family: Arial; - font-size: 16px; -} - /* The Close Button */ .close { /* Position it in the top right corner outside of the modal */ @@ -106,20 +45,18 @@ button { /* inlogform */ form { /*background-color: #a87a87;*/ - border: 5px solid #325da3; - background-color: #a87a87; border-radius: 12px; - height: 57%; - margin: 8px auto; - width: 45%; - overflow: auto; + height: 80%; + margin: auto; + width: 70%; + overflow-y:auto; } /* inlog titel */ h1 { - padding: 16px; + padding: 8px; text-align: center; - font-size: 2.2em; + font-size: 1.5em; } /* registreer titel*/ @@ -129,37 +66,67 @@ h2 { font-size: 2.0em; } + input[type=text], input[type=password], input[type=email], input[type="date"] { - border-radius: 12px; - border: 5px solid #ccc; box-sizing: border-box; + border-color: #C8CABD; display: inline-block; - height: 50%; - padding: 12px 20px; - margin: 8px 0; - width: 50%; + height: 60%; + padding: 8px 20px; + margin: 4px 0; + width: 70%; +} +/* +input[type=text], input[type=password], input[type=email], input[type="date"] { + border: 0px; + border-bottom: 4px solid lightgray; + border-radius: 0px; +}*/ + +button[type=submit] { + background-color: #C8CABD; + color: black ; + cursor: pointer; font-family: Arial; font-size: 16px; + width: 50%; } -input[type=submit] { - background-color: #845663; - border: 2px solid black; - border-radius: 12px; - color: white; - cursor: pointer; - height: 50%; - margin: 8px 0; - padding: 14px 20px; - width: 50%; +.error { font-family: Arial; - font-size: 16px; + font-size: 15px; + color: red; } label { display: block; } +.left-arrow { + display: inline-block; + position: relative; + background-color: #C8CABD; + height: 30px; + width: 90px; + padding: 3px 3px 3px 0px; + text-align: center; + border-radius: 0px 10px 10px 0px; + font-size: 24px; + +} +.left-arrow:after { + content: ''; + display: block; + position: absolute; + right: 100%; + top: 0; + bottom: 0; + border-top: 15px solid transparent; + border-right: 20px solid #C8CABD; + border-bottom: 15px solid transparent; + border-left: 0px solid transparent; +} + /* padding voor registreer container */ .login_containerregister { padding: 16px; @@ -168,7 +135,7 @@ label { /* padding voor login_containers */ .login_containerlogin { - padding: 16px; + padding:25px; text-align: center; } @@ -179,52 +146,31 @@ label { color: red; } -/* The Modal (background) */ -.modal { - background-color: rgb(0,0,0); /* Fallback color */ - background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ - display: none; /* Hidden by default */ - height: 100%; - left: 0; - margin: auto; - overflow: auto; /* Enable scroll if needed */ - padding-top: 60px; - position: fixed; /* Stay in place */ - top: 0; - width: 100%; /* Full width */ - z-index: 1; /* Sit on top */ -} - -/* Modal Content/Box */ -.modal-content { - background-color: #B78996; - border: 5px solid #325da3; - margin: 5px auto; /* 15% from the top and centered */ - overflow-y: auto; - width: 40%; /* Could be more or less, depending on screen size */ - height: 60%; - -} - @keyframes animatezoom { from {transform: scale(0)} to {transform: scale(1)} } -/* datepicker */ -select { - border-radius: 12px; - border: 5px solid #ccc; - box-sizing: border-box; - display: inline-block; - height: 50%; - padding: 12px 20px; - margin: 8px 0; - width: 18%; - font-family: Arial; - font-size: 16px; +/* White boxes (squares) */ +.platform { + background-color: #FFFFFF; + /*background-image: url(http://www.planwallpaper.com/static/images/518071-background-hd_xO1TwRc.jpg); + background-size: cover; + background-repeat: repeat-x; + background-attachment: fixed;*/ + box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); + height: 550px; + margin: 34px auto; + overflow-y: auto; + padding: 20px; + width: 50%; } +/*.platform { + width: 40%; + margin: 34px auto; +}*/ + @-webkit-keyframes animatezoom { from {-webkit-transform: scale(0)} to {-webkit-transform: scale(1)} diff --git a/website/public/styles/main.css b/website/public/styles/main.css index 014d05b..062d5d9 100644 --- a/website/public/styles/main.css +++ b/website/public/styles/main.css @@ -18,7 +18,7 @@ html { body { height: 100%; - background-color: #B78996; + background-color: #EEE; color: #333; font-family: Arial, sans-serif; } @@ -37,11 +37,12 @@ h3 { } h4 { - font-size: 1.6em; + font-size: 1.2em; } h5 { - font-size: 1.4em; + font-size: 1.0em; + color: #666; } ul { @@ -54,12 +55,12 @@ p { /* Selection colors */ ::selection { - background: #845663; + background: #FBC02D; color: white; } ::-moz-selection { - background: #845663; + background: #FBC02D; color: white; } @@ -75,7 +76,7 @@ p { .platform { padding: 20px; margin-bottom: 10px; - border-radius: 10px; + border-radius: 5px; background-color: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); } @@ -143,7 +144,7 @@ button, input, select { cursor: pointer; border: none; font-size: 16px; - border-radius: 7px; + transition-duration: 250ms; } /* All textinput and sections */ @@ -151,19 +152,53 @@ textarea, input, select { padding: 0 5px; background: white; color: #333333; - border: 1px solid #845663; - border-radius: 7px; + border-radius: 5px; + border-bottom: 1px solid #4CAF50; font-size: 16px; + outline: none; + transition-duration: 250ms; +} + +textarea { + padding: 5px; + resize: none; +} + +textarea:hover, input:hover, select:hover { + border-radius: 10px; +} + +textarea:focus, input:focus, select:focus { + border-radius: 10px; + box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); } /* All buttons */ button, input[type="submit"], input[type="reset"] { - background-color: #845663; + background-color: #FBC02D; color: white; padding: 0 10px; border: none; + border-radius: 5px; +} + +button:focus, +input[type="submit"]:focus, +input[type="reset"]:focus { + outline: none; +} + +button:active, +input[type="submit"]:active, +input[type="reset"]:active { + outline: none; + box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24) +} + +input[type="radio"] { + border-radius: 100%; } /* Tables */ @@ -190,19 +225,17 @@ img[data-title]:hover:after, span[data-title]:hover:after, div[data-title]:hover:after { content: attr(data-title); - padding: 4px 4px; + padding: 7px 7px; color: #FFFFFF; position: absolute; left: 0; - top: 100%; - z-index: 20; + top: 150%; + z-index: 200; white-space: nowrap; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - -moz-box-shadow: 0 0 4px #222; - -webkit-box-shadow: 0 0 4px #222; - box-shadow: 0 0 4px #222; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22); background-color: #333; font-size: 15px; line-height: normal; diff --git a/website/public/styles/menu.css b/website/public/styles/menu.css index 7778545..215b073 100644 --- a/website/public/styles/menu.css +++ b/website/public/styles/menu.css @@ -1,12 +1,19 @@ .menu { position: fixed; z-index: 50; + overflow-y: auto; left: 0; top: 80px; height: calc(100% - 80px); width: 256px; + background-color: #EEE; + /*box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);*/ +} + +.menu section { + margin: 0 5px 10px 5px; background-color: white; box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); } @@ -25,3 +32,39 @@ font-size: 14px; cursor: pointer; } + +.friend-item, .group-item { + cursor: pointer; + transition-duration: 250ms; +} + +.friend-item:hover, .group-item:hover { + background: #FBC02D; + color: white; +} + +.menu button { + background: none; + color: inherit; + width: 100%; + height: 100%; + padding: 0; + text-align: left; +} + +#notification-center { + left: auto; + width: 256px; + right: -256px; +} + +#quick-links { + text-align: center; + box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); +} + +#quick-links i { + color: #4CAF50; + font-size: 42px; + padding: 7px; +} \ No newline at end of file diff --git a/website/public/styles/profile.css b/website/public/styles/profile.css index af1ed58..f5dd6b1 100644 --- a/website/public/styles/profile.css +++ b/website/public/styles/profile.css @@ -10,9 +10,12 @@ margin: 0 20px 20px 0; } -.profile-box .profile-username { +.profile-box h1.profile-username { padding-top: 50px; } +.profile-box h5.profile-username { + padding: 0 0 10px 0; +} div.posts { padding-top: 20px; @@ -25,6 +28,15 @@ div.posts div.post { margin: 20px 0 0 0; padding: 10px; width: calc(100% - 40px); + cursor: pointer; + transition-duration: 250ms; +} + +div.posts div.post:hover { + /*margin: 15px 0 0 -5px;*/ + /*padding: 15px;*/ + /*z-index: 20;*/ + box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); } div.posts div.post img { @@ -37,23 +49,18 @@ div.posts .post p.subscript { font-size: 8pt; } -/*.posts {*/ - /*z-index: -1;*/ - /*margin-right: 0;*/ - /*width: calc(100% + 15px);*/ -/*}*/ +div.posts .post form input, div.posts .post form textarea { + width: calc(100% - 15px); +} -/*.post-box {*/ - /*display: inline-flex;*/ - /*margin: 20px 15px 0 0;*/ - /*padding: 25px;*/ - /*background-color: #FFFFFF;*/ -/*}*/ +div.posts .post form input[type="submit"] { + width: 100%; +} -/*!* fullscreen *!*/ -/*.post-box {*/ - /*width: calc(25% - 69px);*/ -/*}*/ +div.posts .post form textarea.newpost { + margin: 15px 0 15px 0; + height: 100px; +} @media only screen and (max-width: 1500px) { .post-box { @@ -68,14 +75,6 @@ div.posts .post p.subscript { } } -.post { - width: 100%; -} - -.post img { - width: 100%; -} - .post .post-date { float: right; color: #aaaaaa; @@ -86,11 +85,12 @@ div.posts .post p.subscript { float: right; padding: 10px; border-radius: 5px; - background-color: #845663; + background-color: #4CAF50; color: #FFFFFF; transition-duration: 250ms; + cursor: pointer; } .profile-button:hover { - background-color: #B78996; + box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); } \ No newline at end of file diff --git a/website/public/styles/search.css b/website/public/styles/search.css index 4b2281c..b54723d 100644 --- a/website/public/styles/search.css +++ b/website/public/styles/search.css @@ -9,4 +9,9 @@ #search-friends-output { margin-right: 10px; +} + +.searchleft, .searchright { + display: inline-block; + vertical-align: top; } \ No newline at end of file diff --git a/website/public/template_sql.php b/website/public/template_sql.php index b918f6a..ed4ff99 100644 --- a/website/public/template_sql.php +++ b/website/public/template_sql.php @@ -7,7 +7,7 @@ include_once("../queries/connect.php"); include_once("../queries/friendship.php"); -$friends = selectAllFriends($db, 666); +$friends = selectAllFriends(666); while($friend = $friends->fetch(PDO::FETCH_ASSOC)) { echo $friend['username'].' '.$friend['onlinestatus'] . "
    "; } diff --git a/website/queries/checkInput.php b/website/queries/checkInput.php new file mode 100644 index 0000000..f711676 --- /dev/null +++ b/website/queries/checkInput.php @@ -0,0 +1,105 @@ + diff --git a/website/queries/friendship.php b/website/queries/friendship.php index 56ce274..0deba63 100644 --- a/website/queries/friendship.php +++ b/website/queries/friendship.php @@ -1,25 +1,63 @@ query(" - SELECT - `user`.`username`, - `user`.`profilepicture`, - `user`.`onlinestatus`, - `user`.`role` - FROM - `user` - INNER JOIN - `friendship` - WHERE - `friendship`.`user1ID` = $userID AND - `friendship`.`user2ID` = `user`.`userID` OR - `friendship`.`user2ID` = $userID AND - `friendship`.`user1ID` = `user`.`userID` AND - `user`.`role` != 3 +function selectAllFriends($userID) { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + `userID`, + `username`, + IFNULL( + `profilepicture`, + '../img/notbad.jpg' + ) AS profilepicture, + `onlinestatus`, + `role` + FROM + `user` + INNER JOIN + `friendship` + + WHERE + (`friendship`.`user1ID` = :userID AND + `friendship`.`user2ID` = `user`.`userID` OR + `friendship`.`user2ID` = :userID AND + `friendship`.`user1ID` = `user`.`userID`) AND + `role` != 5 AND + `status` = 1 "); + + $stmt->bindParam(':userID', $userID, PDO::PARAM_INT); + $stmt->execute(); + + return $stmt; } +function selectAllFriendRequests() { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + `userID`, + `username`, + IFNULL( + `profilepicture`, + '../img/notbad.jpg' + ) AS profilepicture, + `onlinestatus`, + `role` + FROM + `user` + INNER JOIN + `friendship` + + WHERE + (`friendship`.`user1ID` = :userID AND + `friendship`.`user2ID` = `user`.`userID` OR + `friendship`.`user2ID` = :userID AND + `friendship`.`user1ID` = `user`.`userID`) AND + `role` != 5 AND + `status` = 0 + "); + $stmt->bindParam(':userID', $_SESSION["userID"], PDO::PARAM_INT); + $stmt->execute(); -?> \ No newline at end of file + return json_encode($stmt->fetchAll()); +} \ No newline at end of file diff --git a/website/queries/group_member.php b/website/queries/group_member.php index 824a33b..f8a9002 100644 --- a/website/queries/group_member.php +++ b/website/queries/group_member.php @@ -1,7 +1,7 @@ query(" +function selectAllGroupsFromUser($userID) { + return $GLOBALS["db"]->query(" SELECT `group_page`.`name`, `group_page`.`picture` @@ -15,7 +15,3 @@ function selectAllGroupsFromUser($db, $userID) { `group_page`.`status` != 0 "); } - - - -?> \ No newline at end of file diff --git a/website/queries/group_page.php b/website/queries/group_page.php index d8bab8f..d704e8c 100644 --- a/website/queries/group_page.php +++ b/website/queries/group_page.php @@ -1,7 +1,7 @@ query(" +function selectGroupById($groupID) { + $q = $GLOBALS["db"]->prepare(" SELECT `group_page`.`name`, `group_page`.`picture`, @@ -11,12 +11,16 @@ function selectGroupById($db, $groupID) { FROM `group_page` WHERE - `group_page`.`groupID` = $groupID + `group_page`.`groupID` = :groupID "); + + $q->bindParam(':groupID', $groupID); + $q->execute(); + return $q; } -function select20GroupsFromN($db, $n) { - return $db->query(" +function select20GroupsFromN($n) { + $q = $GLOBALS["db"]->prepare(" SELECT `group_page`.`groupID`, `group_page`.`name`, @@ -29,12 +33,16 @@ function select20GroupsFromN($db, $n) { ORDER BY `group_page`.`name` ASC LIMIT - $n, 20 + :n, 20 "); + + $q->bindParam(':n', $n); + $q->execute(); + return $q; } -function select20GroupsByStatusFromN($db, $n, $status) { - return $db->query(" +function select20GroupsByStatusFromN($n, $status) { + $q = $GLOBALS["db"]->prepare(" SELECT `group_page`.`groupID`, `group_page`.`name`, @@ -45,12 +53,145 @@ function select20GroupsByStatusFromN($db, $n, $status) { FROM `group_page` WHERE - `group_page`.`status` = $status + `group_page`.`status` = :status ORDER BY `group_page`.`name` ASC LIMIT - $n, 20 + :n, 20 "); + + $q->bindParam(':status', $status); + $q->bindParam(':n', $n); + $q->execute(); + return $q; } +function search20GroupsFromNByStatus($n, $keyword, $status) { + $q = $GLOBALS["db"]->prepare(" + SELECT + `groupID`, + `name`, + `status`, + `description` + FROM + `group_page` + WHERE + `name` LIKE :keyword AND + FIND_IN_SET (`status`, :statuses) + ORDER BY + `name` + LIMIT + :n, 20 + "); + + $keyword = "%$keyword%"; + $q->bindParam(':keyword', $keyword); + $q->bindParam(':n', $n, PDO::PARAM_INT); + $statuses = implode(',', $status); + $q->bindParam(':statuses', $statuses); + $q->execute(); + return $q; +} + +function searchSomeGroupsByStatus($n, $m, $keyword, $status) { + $q = $GLOBALS['db']->prepare(" + SELECT + `groupID`, + `name`, + `status`, + `description` + FROM + `group_page` + WHERE + `name` LIKE :keyword AND + FIND_IN_SET (`status`, :statuses) + ORDER BY + `name` + LIMIT + :n, :m + "); + + $keyword = "%$keyword%"; + $q->bindParam(':keyword', $keyword); + $q->bindParam(':n', $n, PDO::PARAM_INT); + $q->bindParam(':m', $m, PDO::PARAM_INT); + $statuses = implode(',', $status); + $q->bindParam(':statuses', $statuses); + $q->execute(); + return $q; +} + +function countSomeGroupsByStatus($keyword, $status) { + $q = $GLOBALS['db']->prepare(" + SELECT + COUNT(*) + FROM + `group_page` + WHERE + `name` LIKE :keyword AND + FIND_IN_SET (`status`, :statuses) + ORDER BY + `name` + "); + + $keyword = "%$keyword%"; + $q->bindParam(':keyword', $keyword); + $statuses = implode(',', $status); + $q->bindParam(':statuses', $statuses); + $q->execute(); + return $q; +} + +function changeGroupStatusByID($id, $status) { + $q = $GLOBALS["db"]->query(" + UPDATE + `group_page` + SET + `status` = $status + WHERE + `groupID` = $id + "); + + return $q; +} + +function changeMultipleGroupStatusByID($ids, $status) { + $q = $GLOBALS['db']->prepare(" + UPDATE + `group_page` + SET + `status` = :status + WHERE + FIND_IN_SET (`groupID`, :ids) + "); + + $ids = implode(',', $ids); + $q->bindParam(':ids', $ids); + $q->bindParam(':status', $status); + $q->execute(); + return $q; +} + +function searchSomeGroups($n, $m, $search) { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + `name`, + `picture` + FROM + `group_page` + WHERE + `name` LIKE :keyword + ORDER BY + `name` + LIMIT + :n, :m + "); + + $search = "%$search%"; + $stmt->bindParam(':keyword', $search); + $stmt->bindParam(':n', $n, PDO::PARAM_INT); + $stmt->bindParam(':m', $m, PDO::PARAM_INT); + $stmt->execute(); + return $stmt; +} ?> \ No newline at end of file diff --git a/website/queries/header.php b/website/queries/header.php new file mode 100644 index 0000000..e6bc8ac --- /dev/null +++ b/website/queries/header.php @@ -0,0 +1,21 @@ +prepare(" + SELECT + `fname`, + `lname`, + IFNULL( + `profilepicture`, + 'img/notbad.jpg' + ) AS profilepicture + FROM + `user` + WHERE + `userID` = :userID + "); + + $stmt->bindParam(":userID", $_SESSION["userID"]); + $stmt->execute(); + + return $stmt->fetch(); +} diff --git a/website/queries/login.php b/website/queries/login.php index c710833..180b431 100644 --- a/website/queries/login.php +++ b/website/queries/login.php @@ -1,6 +1,6 @@ prepare(" SELECT `password`, @@ -15,5 +15,3 @@ function hashPassword() { $stmt->execute(); return $stmt->fetch(PDO::FETCH_ASSOC); } - -?> diff --git a/website/queries/nicetime.php b/website/queries/nicetime.php new file mode 100644 index 0000000..4db6cbd --- /dev/null +++ b/website/queries/nicetime.php @@ -0,0 +1,39 @@ + $unix_date) { +$difference = $now - $unix_date; +$tense = "geleden"; +} else { +$difference = $unix_date - $now; +$tense = "vanaf nu"; +} + +for($i = 0; $difference >= $lengths[$i] && $i < count($lengths) - 1; $i++) { +$difference /= $lengths[$i]; +} + +$difference = round($difference); + +if($difference != 1) { +$period = $multiple_periods[$i]; +} else { +$period = $single_periods[$i]; +} + +return "$difference $period $tense"; +} \ No newline at end of file diff --git a/website/queries/private_message.php b/website/queries/private_message.php new file mode 100644 index 0000000..46c21a3 --- /dev/null +++ b/website/queries/private_message.php @@ -0,0 +1,76 @@ +prepare(" + SELECT + * + FROM + `private_message` + WHERE + `origin` = :user1 AND + `destination` = :user2 OR + `origin` = :user2 AND + `destination` = :user1 + ORDER BY + `messageID` ASC + "); + + $stmt->bindParam(":user1", $user1ID); + $stmt->bindParam(":user2", $user2ID); + + $stmt->execute(); + + return json_encode($stmt->fetchAll()); +} + +function sendMessage($destination, $content) { + $stmt = $GLOBALS["db"]->prepare(" + INSERT INTO + `private_message` + ( + `origin`, + `destination`, + `content` + ) + VALUES + ( + :origin, + :destination, + :content + ) + "); + + return $stmt->execute(array( + "origin" => $_SESSION["userID"], + "destination" => $destination, + "content" => $content + )); +} + +function getNewChatMessages($lastID, $destination) { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + * + FROM + `private_message` + WHERE + ( + `origin` = :user1 AND + `destination` = :user2 OR + `origin` = :user2 AND + `destination` = :user1) AND + `messageID` > :lastID + ORDER BY + `messageID` ASC + "); + + $stmt->bindParam(':user1', $_SESSION["userID"]); + $stmt->bindParam(':user2', $destination); + $stmt->bindParam(':lastID', $lastID); + + $stmt->execute(); + + return json_encode($stmt->fetchAll()); +} diff --git a/website/queries/register.php b/website/queries/register.php index 9881872..4700e72 100644 --- a/website/queries/register.php +++ b/website/queries/register.php @@ -18,12 +18,18 @@ function getExistingUsername() { function getExistingEmail() { $stmt = $GLOBALS["db"]->prepare(" - SELECT * FROM `user` WHERE `email` = :email + SELECT + `email` + FROM + `user` + WHERE + `email` LIKE :email "); $stmt->bindParam(":email", $_POST["email"]); $stmt->execute(); return $stmt->rowCount(); + } function registerAccount() { @@ -46,7 +52,7 @@ function registerAccount() { :email )"); - $hash=password_hash($_POST["password"].(strtolower($_POST["username"])), PASSWORD_DEFAULT); + $hash=password_hash($_POST["password"], PASSWORD_DEFAULT); $stmt->bindParam(":fname", $_POST["name"]); $stmt->bindParam(":lname", $_POST["surname"]); @@ -54,7 +60,7 @@ function registerAccount() { $stmt->bindParam(":username", $_POST["username"]); $stmt->bindParam(":password", $hash); $stmt->bindParam(":location", $_POST["location"]); - $stmt->bindParam(":email", $_POST["email"]); + $stmt->bindParam(":email", (strtolower($_POST["email"]))); $stmt->execute(); $stmt->rowCount(); diff --git a/website/queries/settings.php b/website/queries/settings.php index c59ff7f..543adb9 100644 --- a/website/queries/settings.php +++ b/website/queries/settings.php @@ -1,5 +1,42 @@ message = $message; + switch ($type) { + case "happy": + $this->class = "settings-message-happy"; + break; + case "angry": + $this->class = "settings-message-angry"; + break; + default: + $this->class = "settings-message"; + break; + } + } + + public function getClass() { + return $this->class; + } + + public function getMessage() { + return $this->message; + } +} + +/** + * Gets the settings form the database. + * @return mixed Setting as an array. + */ function getSettings() { $stmt = $GLOBALS["db"]->prepare(" SELECT @@ -50,49 +87,36 @@ function updateSettings() { `userID` = :userID "); - $stmt->bindParam(":fname", $_POST["fname"]); - $stmt->bindParam(":lname", $_POST["lname"]); - $stmt->bindParam(":location", $_POST["location"]); - $stmt->bindParam(":bday", $_POST["bday"]); - $stmt->bindParam(":bio", $_POST["bio"]); - $stmt->bindParam(":userID", $_SESSION["userID"]); - + $stmt->bindValue(":fname", test_input($_POST["fname"])); + $stmt->bindValue(":lname", test_input($_POST["lname"])); + $stmt->bindValue(":location", test_input($_POST["location"])); + $stmt->bindValue(":bday", test_input($_POST["bday"])); + $stmt->bindValue(":bio", test_input($_POST["bio"])); + $stmt->bindValue(":userID", $_SESSION["userID"]); $stmt->execute(); - return array ( - "type" => "settings-message-happy", - "message" => "Instellingen zijn opgeslagen." - ); + return new settingsMessage("happy", "Instellingen zijn opgeslagen."); } -function updatePassword() { +function changePassword() { $user = getPasswordHash(); - if (password_verify($_POST["password-old"].strtolower($user["username"]), $user["password"])) { + if (password_verify($_POST["password-old"], $user["password"])) { if ($_POST["password-new"] == $_POST["password-confirm"] && (strlen($_POST["password-new"]) >= 8)) { - if (changePassword($user)) { - return array ("type" => "settings-message-happy", - "message" => "Wachtwoord gewijzigd."); + if (doChangePassword()) { + return new settingsMessage("happy", "Wachtwoord gewijzigd."); } else { - return array ( - "type" => "settings-message-angry", - "message" => "Er is iets mis gegaan."); + return new settingsMessage("angry", "Er is iets mis gegaan."); } } else { - return array ( - "type" => "settings-message-angry", - "message" => "Wachtwoorden komen niet oveeen." - ); + return new settingsMessage("angry", "Wachtwoorden komen niet oveen."); } } else { - return array( - "type" => "settings-message-angry", - "message" => "Oud wachtwoord niet correct." - ); + return new settingsMessage("angry", "Oud wachtwoord niet correct."); } } -function changePassword($user) { - $stmt =$GLOBALS["db"]->prepare(" +function doChangePassword() { + $stmt = $GLOBALS["db"]->prepare(" UPDATE `user` SET @@ -101,9 +125,90 @@ function changePassword($user) { `userID` = :userID "); - $hashed_password = password_hash($_POST["password-new"].strtolower($user["username"]), PASSWORD_DEFAULT); + $hashed_password = password_hash($_POST["password-new"], PASSWORD_DEFAULT); $stmt->bindParam(":new_password", $hashed_password); $stmt->bindParam(":userID", $_SESSION["userID"]); $stmt->execute(); return $stmt->rowCount(); +} + +function changeEmail() { + + if ($_POST["email"] == $_POST["email-confirm"]) { + $email = strtolower($_POST["email"]); + if (filter_var($email, FILTER_VALIDATE_EMAIL)) { + //check if email exists + if (emailIsAvailableInDatabase($email)) { + if (doChangeEmail($email)) { + return new settingsMessage("happy", "Emailadres is veranderd."); + } else { + return new settingsMessage("angry", "Er is iets mis gegaan."); + } + } else { + return new settingsMessage("angry", "Emailadres bestaat al."); + } + } else { + return new settingsMessage("angry", "Geef een geldig emailadres."); + } + } else { + return new settingsMessage("angry", "Emailadressen komen niet overeen."); + } +} + +function emailIsAvailableInDatabase($email) { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + `email` + FROM + `user` + WHERE + `email` = :email + "); + + $stmt->bindParam(":email", $email); + $stmt->execute(); + return !$stmt->rowCount(); +} + +function doChangeEmail($email) { + $stmt = $GLOBALS["db"]->prepare(" + UPDATE + `user` + SET + `email` = :email + WHERE + `userID` = :userID + "); + $stmt->bindParam(":email", $email); + $stmt->bindParam(":userID", $_SESSION["userID"]); + $stmt->execute(); + return $stmt->rowCount(); +} + +function updateProfilePicture() { + $profilePictureDir = "/var/www/html/public/"; + $relativePath = "uploads/profilepictures/" . $_SESSION["userID"] . "_" . basename($_FILES["pp"]["name"]); +// removeOldProfilePicture(); + move_uploaded_file($_FILES['pp']['tmp_name'], $profilePictureDir . $relativePath); + setProfilePictureToDatabase("../" . $relativePath); +} + +//function removeOldProfilePicture() { +// +// unlink("/var/www/html/public/uploads/profilepictures/" . $_SESSION["userID"] . "_*"); +//} + +function setProfilePictureToDatabase($url) { + $stmt = $GLOBALS["db"]->prepare(" + UPDATE + `user` + SET + `profilepicture` = :profilePicture + WHERE + `userID` = :userID + "); + + $stmt->bindParam(":profilePicture", $url); + $stmt->bindParam(":userID", $_SESSION["userID"]); + $stmt->execute(); } \ No newline at end of file diff --git a/website/queries/user.php b/website/queries/user.php new file mode 100644 index 0000000..114d673 --- /dev/null +++ b/website/queries/user.php @@ -0,0 +1,303 @@ +prepare(" + SELECT + `userID` + FROM + `user` + WHERE + LOWER(`username`) = LOWER(:username) + "); + + $stmt->bindParam(':username', $username, PDO::PARAM_STR); + $stmt->execute(); + return $stmt->fetch()["userID"]; +} + +function selectUser($userID) { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + `username`, + IFNULL( + `profilepicture`, + '../img/notbad.jpg' + ) AS profilepicture, + `bio`, + `role`, + `onlinestatus`, + `loggedin`, + `fname`, + `lname` + FROM + `user` + WHERE + `userID` = :userID + "); + + $stmt->bindParam(':userID', $userID, PDO::PARAM_INT); + $stmt->execute(); + return $stmt->fetch(); +} + +function selectAllUserGroups($userID) { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + `group_page`.`groupID`, + `name`, + `picture`, + `userID` + FROM + `group_page` + INNER JOIN + `group_member` + ON + `group_page`.`groupID` = `group_member`.`groupID` + WHERE + `userID` = :userID AND + `role` = 1 + "); + + $stmt->bindParam(':userID', $userID, PDO::PARAM_INT); + $stmt->execute(); + return $stmt; +} + +function selectAllUserPosts($userID) { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + `postID`, + `author`, + `title`, + `content`, + `creationdate` + FROM + `post` + WHERE + `author` = :userID AND + `groupID` IS NULL + ORDER BY + `creationdate` DESC + "); + + $stmt->bindParam(':userID', $userID, PDO::PARAM_INT); + $stmt->execute(); + return $stmt; +} + +function select20UsersFromN($n) { + $q = $GLOBALS["db"]->prepare(" + SELECT + `userID`, + `username`, + `role`, + `bancomment` + FROM + `user` + ORDER BY + `role`, + `username` + LIMIT + :n, 20 + "); + + $q->bindParam(':n', $n); + $q->execute(); + return $q; +} + +function search20UsersFromN($n, $keyword) { + $q = $GLOBALS["db"]->prepare(" + SELECT + `userID`, + `username`, + `role`, + `bancomment` + FROM + `user` + WHERE + `username` LIKE :keyword + ORDER BY + `username` + LIMIT + :n, 20 + "); + + $keyword = "%$keyword%"; + $q->bindParam(':keyword', $keyword); + $q->bindParam(':n', $n, PDO::PARAM_INT); + $q->execute(); + return $q; +} + +function search20UsersFromNByStatus($n, $keyword, $status) { + $q = $GLOBALS["db"]->prepare(" + SELECT + `userID`, + `username`, + `role`, + `bancomment` + FROM + `user` + WHERE + `username` LIKE :keyword AND + FIND_IN_SET (`role`, :statuses) + ORDER BY + `role`, + `username` + LIMIT + :n, 20 + "); + + $keyword = "%$keyword%"; + $q->bindParam(':keyword', $keyword); + $q->bindParam(':n', $n, PDO::PARAM_INT); + $statuses = implode(',', $status); + $q->bindParam(':statuses', $statuses); + $q->execute(); + return $q; +} + +function searchSomeUsersByStatus($n, $m, $keyword, $status) { + $q = $GLOBALS["db"]->prepare(" + SELECT + `userID`, + `username`, + `role`, + `bancomment` + FROM + `user` + WHERE + `username` LIKE :keyword AND + FIND_IN_SET (`role`, :statuses) + ORDER BY + `role`, + `username` + LIMIT + :n, :m + "); + + $keyword = "%$keyword%"; + $q->bindParam(':keyword', $keyword); + $q->bindParam(':n', $n, PDO::PARAM_INT); + $q->bindParam(':m', $m, PDO::PARAM_INT); + $statuses = implode(',', $status); + $q->bindParam(':statuses', $statuses); + $q->execute(); + return $q; +} + +function countSomeUsersByStatus($keyword, $status) { + $q = $GLOBALS["db"]->prepare(" + SELECT + COUNT(*) + FROM + `user` + WHERE + `username` LIKE :keyword AND + FIND_IN_SET (`role`, :statuses) + ORDER BY + `role`, + `username` + "); + + $keyword = "%$keyword%"; + $q->bindParam(':keyword', $keyword); + $statuses = implode(',', $status); + $q->bindParam(':statuses', $statuses); + $q->execute(); + return $q; +} + + +function changeUserStatusByID($id, $status) { + $q = $GLOBALS["db"]->prepare(" + UPDATE + `user` + SET + `role` = :status + WHERE + `userID` = :id + "); + + $q->bindParam(':status', $status); + $q->bindParam(':id', $id); + $q->execute(); + return $q; +} + +function changeMultipleUserStatusByID($ids, $status) { + $q = $GLOBALS["db"]->prepare(" + UPDATE + `user` + SET + `role` = :status + WHERE + FIND_IN_SET (`userID`, :ids) + "); + + $ids = implode(',', $ids); + $q->bindParam(':ids', $ids); + $q->bindParam(':status', $status); + $q->execute(); + return $q; +} + +function selectRandomNotFriendUser($userID) { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + `user`.`username` + FROM + `user` + WHERE + `userID` NOT IN (SELECT + `user1ID` + FROM + `friendship` + WHERE `user1ID` = :userID) OR + `userID` NOT IN (SELECT + `user2ID` + FROM + `friendship` + WHERE `user2ID` = :userID) + ORDER BY + RAND() + LIMIT + 1 + "); + + $stmt->bindParam(':userID', $userID, PDO::PARAM_INT); + $stmt->execute(); + return $stmt->fetch(); +} + +function searchSomeUsers($n, $m, $search) { + $stmt = $GLOBALS["db"]->prepare(" + SELECT + `username`, + `profilepicture`, + `fname`, + `lname` + FROM + `user` + WHERE + `username` LIKE :keyword OR + `fname` LIKE :keyword OR + `lname` LIKE :keyword + ORDER BY + `fname`, + `lname`, + `username` + LIMIT + :n, :m + "); + + $search = "%$search%"; + $stmt->bindParam(':keyword', $search); + $stmt->bindParam(':n', $n, PDO::PARAM_INT); + $stmt->bindParam(':m', $m, PDO::PARAM_INT); + $stmt->execute(); + return $stmt; +} diff --git a/website/views/adminpanel.php b/website/views/adminpanel.php index b789aad..e53d679 100644 --- a/website/views/adminpanel.php +++ b/website/views/adminpanel.php @@ -1,98 +1,312 @@ - - - Admin Panel - + + + - for (var i = 0; i < checkboxes.length; i++) { - if (checkboxes[i].type == 'checkbox') { - checkboxes[i].checked = allbox.checked; - } - } - } - - - -
    -
    -
    -

    User Management Panel

    -

    -
    -
    - - -
    -

    Show users:

    - Active
    - Muted
    - Banned -
    + + + +
    +
    +
    +

    User Management Panel

    +

    +
    + " + method="get"> + + +
    +

    Show:

    + + > +
    + > +
    + > +
    + > +
    + > +
    + > + +
    + +
    +

    Show:

    + + > +
    + > +
    + > +
    +
    + +
    +

    Page Type:

    + + onchange="changeFilter()"> +
    + + onchange="changeFilter()"> + +
    + + +
    +

    Batch Actions:

    +
    + +
    + +
    + +

    +
    -
    -

    Batch Actions:

    - Mute
    - Ban
    - Unban

    - -
    -
    -
    -
    -

    Users:

    - - - - - - - - - - - - - - - - - - - - - - -
    - - UserStatusCommentAction
    John SmithBannedunregulated time travel -
    - - -
    -
    poey jokeaimBannedl33t h4xx -
    - - -
    -
    -
    - +
    + +
    +

    Batch Actions:

    +
    + +
    + +
    + +

    + +
    +
    -
    - +
    + +
    +
    +
    +

    Users:

    +
    +
    + fetchColumn(); + $mincount = min($listm, $countresults); + $minlist = min($listn + 1, $countresults); + ?> +

    Current page:

    +
    + +
    +

    + +

    +

    + + + + + + + + + + + + fetch(PDO::FETCH_ASSOC)) { + $userID = $user['userID']; + $username = $user['username']; + $role = $user['role']; + $bancomment = $user['bancomment']; + $thispage = htmlspecialchars(basename($_SERVER['REQUEST_URI'])); + $function = "checkCheckAll(document.getElementById('checkall'))"; + + echo(" + + + + + + + + "); + } + } else { + $q = searchSomeGroupsByStatus($listn, $listm, $search, $groupstatus); + + while ($group = $q->fetch(PDO::FETCH_ASSOC)) { + $groupID = $group['groupID']; + $name = $group['name']; + $role = $group['status']; + $description = $group['description']; + $thispage = htmlspecialchars(basename($_SERVER['REQUEST_URI'])); + $function = "checkCheckAll(document.getElementById('checkall'))"; + + echo(" + + + + + + + + "); + } + } + ?> +
    + + UserStatusCommentAction
    + $username$role$bancomment +
    + + + +
    +
    + $name$role$description +
    + + + +
    +
    +
    +
    +
    + diff --git a/website/views/chat-view.php b/website/views/chat-view.php index a23a1c5..549a5ff 100644 --- a/website/views/chat-view.php +++ b/website/views/chat-view.php @@ -1,52 +1,74 @@
    -