🍻 Did some more stuff

Signed-off-by: Luke Tainton <luke@tainton.uk>
This commit is contained in:
2020-08-04 22:34:00 +01:00
parent eb3caf6a41
commit 4b3b8c89e0
5 changed files with 361 additions and 115 deletions

View File

@@ -45,3 +45,18 @@ function create_alert($type, $msg) {
$thisAlert = array($type, $msg);
array_push($_SESSION['alerts'], $thisAlert);
}
function get_user_name($db, $user_uuid) {
try {
$stmt = "SELECT given_name, family_name FROM users WHERE uuid=:uuid";
$sql = $db->prepare($stmt);
$sql->bindParam(':uuid', $user_uuid);
$sql->execute();
$sql->setFetchMode(PDO::FETCH_ASSOC);
$result = $sql->fetchAll();
$usr = $result[0]['given_name'] . " " . $result[0]['family_name'];
} catch (PDOException $e) {
echo("Error: " . $e->getMessage());
}
return $usr;
}