-
Notifications
You must be signed in to change notification settings - Fork 4
/
invites.php
54 lines (53 loc) · 1.8 KB
/
invites.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
session_start();
require "config/config.php";
if (!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true) {
header("location: login.php?redirect_link=invites.php");
exit;
}
$user_id = $_GET['id'];
if (empty($user_id)) {
header("location: home.php");
}
$sql = "SELECT * FROM users WHERE id='$user_id'";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
$name = $row['username'];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height">
<title>Invited Users</title>
<link rel="shortcut icon" href="logos/logo.png" type="image/x-icon">
<link rel="stylesheet" href="css/general2.css?v=<?php echo time(); ?>">
</head>
<body>
<?php require_once("header.php"); ?>
<div style="margin: 20px;">
<h1>Users invited by <?php echo $name; ?></h1>
<?php
$invited_users = 0;
$sql = "SELECT * FROM users WHERE invited_by='$user_id'";
$query = mysqli_query($link, $sql);
if (mysqli_num_rows($query) > 0) {
while ($row = mysqli_fetch_assoc($query)) {
$file = $row['file'];
$id = $row['id'];
$username = $row['username'];
echo "
<div class='boxes'>
<img id='image' src='$file' alt='Profile'>
<a id='link-profile' href='profile.php?id=$id'>$username</a>
</div><br>
";
$invited_users++;
}
}
echo "<div class='boxes'><span style='color: black;'>Total invited users: $invited_users</span></div>";
?>
</div>
</body>
</html>