forked from TinggTechnologies/Florierenparklaneis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin-manage-student-profile.php
170 lines (139 loc) · 7.17 KB
/
admin-manage-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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?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){
$rows = $result->fetch_assoc();
}
if(isset($_POST['delete-user'])){
$student_id = $_POST['student_id'];
$sql = "DELETE FROM users WHERE student_id=?";
$stmt = $conn->prepare($sql);
$stmt->bind_param('s', $student_id);
if($stmt->execute()){
echo "<script>location.href = 'delete-student.php';</script>";
}
}
?>
<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 $rows['image']; ?>" alt="Profile" class="rounded-circle">
<h2 class="text-center"><?php echo $rows['lastname'] .' '. $rows['firstname']; ?></h2>
<p><?php echo $rows['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">
<h6>You can approve students here</h6>
<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(($rows['about']) !== ""){
echo $rows['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 $rows['lastname'] .' '. $rows['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 $rows['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 $rows['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 $rows['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(($rows['home_address']) !== "" ){
echo $rows['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(($rows['state_of_origin']) !== ""){
echo $rows['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(($rows['date_of_birth']) !== ""){
echo $rows['date_of_birth'];
} else {
echo '<div class="text-danger">The user has not updated date of birth</div>';
}?></div>
</div>
<div class="row mb-3">
<label for="profileImage" class="col-md-4 col-lg-3 col-form-label">Parent Image</label>
<div class="col-md-8 col-lg-9">
<img src="uploads/<?php echo $rows['parent_image']; ?>" style="width: 7rem; height: 5rem;" alt="Profile">
</div>
</div>
<div class="row">
<div class="col-lg-3 col-md-4 label">Father Names</div>
<div class="col-lg-9 col-md-8"><?php if(($rows['father_name']) !== ""){
echo $rows['father_name'];
} else {
echo '<div class="text-danger">The user has not updated fathers name</div>';
}?></div>
</div>
<div class="row">
<div class="col-lg-3 col-md-4 label">Mother Names </div>
<div class="col-lg-9 col-md-8"><?php if(($rows['mother_name']) !== ""){
echo $rows['mother_name'];
} else {
echo '<div class="text-danger">The user has not updated mothers name</div>';
}?></div>
</div>
<div class="row">
<div class="col-lg-3 col-md-4 label">Year Of Admission</div>
<div class="col-lg-9 col-md-8"><?php if(($rows['year_of_admission']) !== ""){
echo $rows['year_of_admission'];
} else {
echo '<div class="text-danger">The user has not updated year of admission</div>';
}?></div>
</div>
</div>
<div class="row">
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="post">
<div class="col-lg-9 col-md-8">
<input type="hidden" name="student_id" value="<?php echo $student_id; ?>">
<input type="hidden" name="email" value="<?php echo $rows['email']; ?>">
<input type="hidden" name="firstname" value="<?php echo $rows['firstname']; ?>">
<input type="hidden" name="lastname" value="<?php echo $rows['lastname']; ?>">
<button type="submit" name="admin-approve-student" class="btn btn-success px-5 mb-3 mb-lg-0" style="border-radius: 15px;">Approve Student</button>
<button type="submit" name="delete-user" class="btn btn-danger px-5 mb-3" style="border-radius: 15px;">Delete Student</button>
<a href="admin-update-student-image.php">Upload Image</a>
</div>
</form>
</div>
<?php require "main-footer.php"; ?>