-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
93 lines (75 loc) · 2.63 KB
/
Copy pathprofile.php
File metadata and controls
93 lines (75 loc) · 2.63 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
include("vendor/autoload.php");
use Helpers\Auth;
$auth = Auth::check();
?>
<!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>Profile | User Management</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Bootstrap JS -->
<script src="js/bootstrap.bundle.min.js" defer></script>
</head>
<body>
<div class="container">
<h1 class="mt-5 mb-4">
<?= $auth->name ?>
<span class="fw-normal text-muted">
( <?= $auth->role ?> )
</span>
</h1>
<?php if(isset($_GET['update'])) : ?>
<div class="alert alert-success alert-dismissible fade show">
Account updated successfully.
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
<?php endif ?>
<?php if(isset($_GET['password'])) : ?>
<div class="alert alert-success alert-dismissible fade show">
Password changed successfully.
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
<?php endif ?>
<?php if(isset($_GET['error'])) : ?>
<div class="alert alert-warning alert-dismissible fade show">
Cannot upload file !
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
<?php endif ?>
<?php if($auth->photo) : ?>
<img src="_actions/photos/<?= $auth->photo ?>" alt="Profile Picture" class="img-thumbnail mb-3" width="200">
<?php else : ?>
<img src="_actions/photos/default-image.png" alt="Profile Picture" class="img-thumbnail mb-3" width="200">
<?php endif ?>
<form action="_actions/upload_photo.php" method="post" enctype="multipart/form-data">
<div class="input-group mb-3">
<input type="file" name="photo" class="form-control">
<button type="submit" class="btn btn-secondary">Upload</button>
</div>
</form>
<ul class="list-group">
<li class="list-group-item">
<span class="fw-bold">Email: </span>
<?= $auth->email ?>
</li>
<li class="list-group-item">
<span class="fw-bold">Phone: </span>
<?= $auth->phone ?>
</li>
<li class="list-group-item">
<span class="fw-bold">Address: </span>
<?= $auth->address ?>
</li>
</ul>
<br>
<a href="admin.php" class="btn btn-warning">Manage Users</a>
<a href="edit.php" class="btn btn-info">Edit Profile</a>
<a href="_actions/logout.php" class="btn btn-danger">Logout</a>
</div>
</body>
</html>