@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user