-
Notifications
You must be signed in to change notification settings - Fork 1
/
admin-view-student-profile.php
122 lines (97 loc) · 4.86 KB
/
admin-view-student-profile.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php require "admin-header.php"; ?>
<main id="main" class="main">
<?php
if(isset($_GET['student_id'])){
$student_id = $_GET['student_id'];
}
$sql = "SELECT * FROM users WHERE student_id=?";
$stmt = $conn->prepare($sql);
$stmt->bind_param('s', $student_id);
$stmt->execute();
$result = $stmt->get_result();
if($result->num_rows > 0){
$row = $result->fetch_assoc();
}
?>
<section class="section profile">
<div class="row">
<div class="col-xl-4">
<div class="card">
<div class="card-body profile-card pt-4 d-flex flex-column align-items-center">
<img src="uploads/<?php echo $row['image']; ?>" alt="Profile" class="rounded-circle">
<h2><?php echo $row['lastname'] .' '. $row['firstname']; ?></h2>
<p><?php echo $row['student_id']; ?></p>
</div>
</div>
</div>
<div class="col-xl-8">
<div class="card">
<div class="card-body pt-3">
<!-- Bordered Tabs -->
<ul class="nav nav-tabs nav-tabs-bordered">
<li class="nav-item">
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#profile-overview">Profile Overview</button>
</li>
</ul>
<div class="tab-content pt-2">
<div class="tab-pane fade show active profile-overview" id="profile-overview">
<h5 class="card-title">About</h5>
<p class="small fst-italic"><?php if(($row['about']) !== ""){
echo $row['about'];
} else {
echo '<div class="text-danger">The user has not updated his/her profile</div>';
}?></p>
<h5 class="card-title">Profile Details</h5>
<div class="row">
<div class="col-lg-3 col-md-4 label ">Full Name</div>
<div class="col-lg-9 col-md-8"><?php echo $row['lastname'] .' '. $row['firstname']; ?></div>
</div>
<div class="row">
<div class="col-lg-3 col-md-4 label">Email</div>
<div class="col-lg-9 col-md-8"><?php echo $row['email']; ?></div>
</div>
<div class="row">
<div class="col-lg-3 col-md-4 label">Telephone</div>
<div class="col-lg-9 col-md-8"><?php echo $row['telephone']; ?></div>
</div>
<div class="row">
<div class="col-lg-3 col-md-4 label">Class</div>
<div class="col-lg-9 col-md-8"><?php echo $row['class']; ?></div>
</div>
<div class="row">
<div class="col-lg-3 col-md-4 label">Home Address</div>
<div class="col-lg-9 col-md-8"><?php if(($row['home_address']) !== "" ){
echo $row['home_address'];
} else {
echo '<div class="text-danger">The user has not updated home address</div>';
}?></div>
</div>
<div class="row">
<div class="col-lg-3 col-md-4 label">State of Origin</div>
<div class="col-lg-9 col-md-8"><?php if(($row['state_of_origin']) !== ""){
echo $row['state_of_origin'];
} else {
echo '<div class="text-danger">The user has not updated state of origin</div>';
}?></div>
</div>
<div class="row">
<div class="col-lg-3 col-md-4 label">Date of Birth</div>
<div class="col-lg-9 col-md-8"><?php if(($row['date_of_birth']) !== ""){
echo $row['date_of_birth'];
} else {
echo '<div class="text-danger">The user has not updated date of birth</div>';
}?></div>
</div>
</div>
<div class="row">
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="post">
<div class="col-lg-3 col-md-4 label">
<a style="background: green; color: white; padding: 7px 10px; border-radius: 15px;" href="admin-update-student-image.php?student_id=<?= $row['student_id']; ?>">Update Picture</a>
</div>
<div class="col-lg-9 col-md-8">
<input type="hidden" name="student_id" value="<?php echo $student_id; ?>">
<button type="submit" name="admin-delete-student" class="btn btn-danger my-2 px-5 mb-5" style="border-radius: 15px;">Delete Student Record</button>
</div>
</form>
</div>
<?php require "main-footer.php"; ?>