Merge branch 'master' into lars-algemeen

This commit is contained in:
Lars van Hijfte
2017-01-23 16:25:18 +01:00
5 changed files with 22 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 65 KiB

View File

@@ -2,7 +2,7 @@
<html>
<head>
<?php
include("../views/head.php");
include_once("../views/head.php");
include_once("../queries/connect.php");
include_once("../queries/settings.php");
?>
@@ -12,8 +12,6 @@
</head>
<body>
<?php
include("../views/main.php");
$notImplemented = new settingsMessage("angry", "Deze functie werkt nog niet :(");
if ($_SERVER["REQUEST_METHOD"] == "POST") {
@@ -33,6 +31,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
break;
}
}
include("../views/main.php");
include("../views/settings-view.php");

View File

@@ -13,7 +13,7 @@ a.button {
/* Body */
body {
height: 900px;
height: 100%;
background-color: #C8CABD;
/*background-image: url(http://play.pokemonshowdown.com/fx/client-bg-shaymin.jpg);
background-size: cover;
@@ -46,7 +46,7 @@ body {
form {
/*background-color: #a87a87;*/
border-radius: 12px;
height: 80%;
height: 70%;
margin: auto;
width: 70%;
overflow-y:auto;
@@ -159,7 +159,7 @@ label {
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;
height: 500px;
margin: 34px auto;
overflow-y: auto;
padding: 20px;

View File

@@ -188,15 +188,25 @@ function doChangeEmail($email) {
function updateProfilePicture() {
$profilePictureDir = "/var/www/html/public/";
$relativePath = "uploads/profilepictures/" . $_SESSION["userID"] . "_" . basename($_FILES["pp"]["name"]);
// removeOldProfilePicture();
removeOldProfilePicture();
move_uploaded_file($_FILES['pp']['tmp_name'], $profilePictureDir . $relativePath);
setProfilePictureToDatabase("../" . $relativePath);
}
//function removeOldProfilePicture() {
//
// unlink("/var/www/html/public/uploads/profilepictures/" . $_SESSION["userID"] . "_*");
//}
function removeOldProfilePicture() {
$stmt = $GLOBALS["db"]->prepare("
SELECT
`profilepicture`
FROM
`user`
WHERE
`userID` = :userID
");
$stmt->bindParam(":userID", $_SESSION["userID"]);
$stmt->execute();
$old_avatar = $stmt->fetch()["profilepicture"];
unlink("/var/www/html/public/uploads/" . $old_avatar);
}
function setProfilePictureToDatabase($url) {
$stmt = $GLOBALS["db"]->prepare("

View File

@@ -7,6 +7,6 @@
<link rel="stylesheet"
type="text/css"
href="styles/index.css">
<script src="jqeury.js"></script>
<script src="registerAndLogin.js"></script>
<script src="/js/jqeury.js"></script>
<script src="/js/registerAndLogin.js"></script>
</head>