|
13 | 13 | $stmt = $pdo->prepare("SELECT * FROM user_status_log where user_Id = :usr"); |
14 | 14 | $stmt->execute(array(':usr' => $_SESSION['user_id'])); |
15 | 15 | $user_status_log = $stmt->fetch(); |
16 | | - |
| 16 | + $pfpsrc_default = './assets/images/default-user-square.png'; |
17 | 17 | |
18 | 18 | if ($user[0]['pfp'] != null) { |
19 | 19 | $userpfp = $user[0]['pfp']; |
|
47 | 47 | </head> |
48 | 48 |
|
49 | 49 | <body> |
50 | | - <nav class="navbar navbar-expand-lg bg-dark" data-bs-theme="dark"> |
| 50 | + <nav class="navbar fixed-top navbar-expand-lg bg-dark" data-bs-theme="dark"> |
51 | 51 | <div class="container-fluid"> |
52 | | - <a class="navbar-brand" href="#"> |
| 52 | + <a class="navbar-brand" href="./index.php"> |
53 | 53 | <img src="./assets/images/g4o2.jpeg" alt="Logo" width="24" height="24" class="d-inline-block align-text-top"> |
54 | 54 | G4o2 Chat |
55 | 55 | </a> |
|
66 | 66 | </li> |
67 | 67 | <li class="nav-item dropdown"> |
68 | 68 | <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"> |
69 | | - Dropdown |
| 69 | + Links |
70 | 70 | </a> |
71 | 71 | <ul class="dropdown-menu"> |
72 | | - <li><a class="dropdown-item" href="#">Action</a></li> |
73 | | - <li><a class="dropdown-item" href="#">Another action</a></li> |
| 72 | + <li><a class="dropdown-item" href="#">Chat</a></li> |
| 73 | + <li><a class="dropdown-item" href="#">User Profile</a></li> |
74 | 74 | <li> |
75 | 75 | <hr class="dropdown-divider"> |
76 | 76 | </li> |
77 | | - <li><a class="dropdown-item" href="#">Something else here</a></li> |
| 77 | + <li><a class="dropdown-item" href="#">Account Settings</a></li> |
78 | 78 | </ul> |
79 | 79 | </li> |
80 | 80 | <li class="nav-item"> |
81 | | - <a class="nav-link disabled">Account</a> |
| 81 | + <a class="nav-link disabled">Private Messaging (coming soon)</a> |
82 | 82 | </li> |
83 | 83 | </ul> |
84 | | - <a class="btn btn-outline-success" href="./login.php">Login</a> |
| 84 | + <a class="btn btn-outline-success" href="./login.php"><?= isset($_SESSION['user_id']) ? 'Logout' : 'Login' ?></a> |
85 | 85 | </div> |
86 | 86 | </div> |
87 | 87 | </nav> |
88 | 88 | <main> |
89 | 89 | <?php |
90 | 90 | echo ' |
91 | 91 | <table class="table"> |
92 | | - <thead> |
| 92 | + <thead class="thead-dark"> |
93 | 93 | <tr> |
94 | 94 | <th scope="col">#</th> |
95 | 95 | <th scope="col">Name</th> |
96 | 96 | <th scope="col">Email</th> |
97 | 97 | <th scope="col">Last active</th> |
98 | 98 | </tr> |
99 | | - </thead><tbody>'; |
| 99 | + </thead> |
| 100 | + <tbody>'; |
100 | 101 | foreach ($accounts as $account) { |
101 | 102 | if ($account['pfp'] != null) { |
102 | 103 | $pfpsrc = $account['pfp']; |
|
109 | 110 | $statement = $pdo->prepare("SELECT * FROM user_status_log where user_Id = :usr"); |
110 | 111 | $statement->execute(array(':usr' => $account['user_id'])); |
111 | 112 | $user_status_log = $statement->fetch(); |
112 | | - |
113 | | - $userStatus = "Undefined"; |
114 | | - if ($user_status_log != null) { |
115 | | - $userStatus = $user_status_log['last_active_date_time']; |
116 | | - } |
117 | | - |
| 113 | + $userStatus = ($user_status_log != null) ? $user_status_log['last_active_date_time'] : "Undefined";; |
118 | 114 |
|
119 | 115 | if ($userStatus === "Undefined") { |
120 | 116 | $diff = "<p class='text-danger'>Null</p>"; |
|
149 | 145 | echo ("</th><td>"); |
150 | 146 | echo "<a href='./profile.php?user={$account['user_id']}' >" . $account['name'] . "</a>"; |
151 | 147 | echo "<td>"; |
152 | | - if ($account['show_email'] === "True") { |
153 | | - echo ($account['email']); |
154 | | - } else { |
155 | | - echo "<p class='text-warning'>Hidden</p>"; |
156 | | - } |
| 148 | + echo ($account['show_email'] === "True") ? "<p class='text-black'>" . $account['email'] . "</p>" : "<p class='text-warning'>Hidden</p>"; |
157 | 149 | echo ("</td><td>"); |
158 | 150 | echo $diff; |
159 | 151 | echo ("</td></tr>\n"); |
|
185 | 177 | <a href="#" class="me-4 text-reset text-decoration-none" target="_blank"> |
186 | 178 | <i class="fab fa-linkedin"></i> |
187 | 179 | </a> |
188 | | - <a href="#" class="me-4 text-reset text-decoration-none" target="_blank"> |
| 180 | + <a href="https://github.com/g4o2" class="me-4 text-reset text-decoration-none" target="_blank"> |
189 | 181 | <i class="fab fa-github"></i> |
190 | 182 | </a> |
191 | 183 | </div> |
|
208 | 200 | pages |
209 | 201 | </h6> |
210 | 202 | <p> |
211 | | - <a href="#" class="text-reset">Home</a> |
| 203 | + <a href="./index.php" class="text-reset">Home</a> |
212 | 204 | </p> |
213 | 205 | <p> |
214 | 206 | <a href="#" class="text-reset">Chat</a> |
|
0 commit comments