forked from Mahin077/EducationUnlocked
-
Notifications
You must be signed in to change notification settings - Fork 0
/
userDetails.php
123 lines (95 loc) · 5.1 KB
/
userDetails.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
<?php
include 'nav.php';
include 'connect.php';
if ($_SESSION['user_name']!='admin') {
header("Location:index.php");
}
$id = $_GET['_userid'];
$sql = "select *from user where userid='$id'";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result);
$uname = $row['username'];
$eml = $row['email'];
$age= $row['age'];
$school= $row['school'];
$gender= $row['gender'];
$type = $row['type'];
if(isset($_POST['edit']))
{
$newtype = $_POST['typ'];
$sql1 = "update user set type='$newtype' where userid='$id'";
$result1 =mysqli_query($conn,$sql1);
if($result1)
{
echo "<script>alert('updated');location.href='adminDonate.php';</script>";
}
else{
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/reg.css">
<title>Profile</title>
</head>
<body>
<div class="container" style="width: 450px;text-align: center;margin-top:170px;margin-bottom:100px;height:730px;background-color:white;box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);border-radius:5px;">
<!-- User Profile Card Section -->
<div class="card">
<form action="" method="POST" class="">
<p class="login-text" style="font-size: 2rem; font-weight: 800;margin-top:20px;margin-bottom:55px;">User Profile </p>
<div class="input-group" style="margin-bottom: 30px;">
<label style="margin-right: 70px;margin-left:20px;font-size:20px;font-weight:bold;">Username<b style="color: red;">*</b></label>
<input style="border-radius: 5px;font-size:15px;font-weight:bold;" type="text" placeholder="Username" name="username" value="<?php echo $uname ?>" readonly>
</div>
<div class="input-group" style="margin-bottom: 30px;">
<label style="margin-right: 119px;margin-left:20px;font-size:20px;font-weight:bold;">Email<b style="color: red;">*</b></label>
<input style="border-radius: 5px;font-size:15px;font-weight:bold;" type="email" placeholder="Email" name="email" value="<?php echo $eml ?>" readonly>
</div>
<div class="input-group" style="margin-bottom: 40px;">
<label style="margin-right: 144px;margin-left:20px;font-size:20px;font-weight:bold;">Age</label>
<input style="border-radius: 5px;font-size:15px;font-weight:bold;" type="number" placeholder="Age" name="age" value="<?php echo $age ?>" readonly>
</div>
<div class="input-group" style="margin-bottom: 40px;">
<label style="margin-right: 37px;margin-left:20px;font-size:20px;font-weight:bold;">School Name:</label>
<input style="border-radius: 5px;font-size:15px;font-weight:bold;" type="text" placeholder="School name" name="school" value="<?php echo $school ?>" readonly>
</div>
<div class="input-group" style="margin-bottom: 40px;">
<label for="gender"> <label style="margin-right: 108px;margin-left:20px;font-size:20px;font-weight:bold;">Gender</label></label>
<select name="gen">
<?php
if($gender=="Male")
{
?>
<option value="Male" selected>Male</option>
<option value="Female">Female</option>
<?php
}else{
?>
<option value="Male">Male</option>
<option value="Female" selected>Female</option>
<?php
}
?>
</select>
</div>
<div class="input-group" style="margin-bottom: 40px;">
<label style="margin-right: 85px;margin-left:20px;font-size:20px;font-weight:bold;">User type</label>
<select name="typ">
<option value="normal">Normal</option>
<option value="special">Special</option>
</select>
</div>
<div class="input-group d-flex justify-content-center" style="margin-top: 55px;">
<button name="edit" class="btn btn-success btn-lg btn-block">Edit</button>
</div>
</form>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj" crossorigin="anonymous"></script>
</body>
</html>