-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathuserprofile.php
58 lines (46 loc) · 1.4 KB
/
userprofile.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
55
56
57
58
<?php
include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
};
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>home</title>
<!-- custom css file link -->
<link rel="stylesheet" href="usercss/userprofile.css">
</head>
<body>
<?php include 'header.php'; ?>
<div class="heading">
<h3>User Profile</h3>
<p> <a href="home.php">home</a> / user profile </p>
</div>
<div class="container">
<div class="profile">
<?php
$select = mysqli_query($conn, "SELECT * FROM `users` WHERE id = '$user_id'") or die('query failed');
if(mysqli_num_rows($select) > 0){
$fetch = mysqli_fetch_assoc($select);
}
if($fetch['image'] == ''){
echo '<img src="image/default-avatar.png">';
}else{
echo '<img src="uploaded_img/'.$fetch['image'].'">';
}
?>
<h3><?php echo $fetch['name']; ?></h3>
<a href="update_profile.php" class="btn">update profile</a>
<a href="logout.php" class="delete-btn">logout</a>
</div>
</div>
<?php include 'orderstatustest.php'; ?>
<?php include 'footer.php'; ?>
</body>
</html>