-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
49 lines (39 loc) · 1.12 KB
/
admin.php
File metadata and controls
49 lines (39 loc) · 1.12 KB
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
<?php
include 'common/dbconnect.php';
include 'common/functions.php';
sec_session_start();
// Set current user name in variable so header.php works properly
$curuser = "";
if(login_check($mysqli) == true) {
if(isset($_SESSION['username'])) {
$curuser = $_SESSION['username'];
// Test for errors
if(mysqli_connect_errno()){
echo mysqli_connect_error();
}
$query = "SELECT * FROM administrators WHERE username = '$curuser'";
$result = $mysqli->query($query);
if($result){
// Cycle through results
while ($row = $result->fetch_assoc()) {
$id = $row['id'];
$timestamp = date('F j, Y',$row['timestamp']);
$email = $row['email'];
$position = $row['position'];
$address = $row['address'];
$description = $row['description'];
$image = $row['image'];
$firstname = $row['firstname'];
$lastname = $row['lastname'];
$contact_display = $row['contact_display'];
}
}
$query2 = "SELECT * FROM categories WHERE creator = '$curuser'";
$query3 = "SELECT * FROM solutions WHERE creator = '$curuser'";
include 'views/admin.php';
}
}
else {
header('Location: login.php');
}
?>