-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathedit.php
More file actions
148 lines (130 loc) · 7.06 KB
/
edit.php
File metadata and controls
148 lines (130 loc) · 7.06 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<?php include_once "dashboard.php"; ?>
<form method="post" action="?controller=user&action=update">
<div class="center">
<div class="profile">
<div class="title-header">MY PROFILE</div>
<!-- First Name -->
<div class="grey-box">
<div class="grey-label">First Name</div>
</div>
<div class="white-box">
<input type="text" class="form-control" id="fname" name="fname" autocomplete="off" value="<?php echo htmlspecialchars($_SESSION['user']->fname); ?>" required>
</div>
<!-- Last Name -->
<div class="grey-box">
<div class="grey-label">Last Name</div>
</div>
<div class="white-box">
<input type="text" class="form-control" id="lname" name="lname" autocomplete="off" value="<?php echo htmlspecialchars($_SESSION['user']->lname); ?>" required>
</div>
<!-- Age -->
<div class="grey-box">
<div class="grey-label">Age</div>
</div>
<div class="white-box">
<input type="text" class="form-control" id="age" name="age" autocomplete="off" value="<?php echo htmlspecialchars($_SESSION['user']->age); ?>">
</div>
<!-- Gender -->
<div class="grey-box">
<div class="grey-label">Gender</div>
</div>
<div class="white-box">
<table>
<td>
<label class="label-input">
<input type="radio" name="gender" value="Male" <?php echo ($_SESSION['user']->gender === 'Male') ? 'checked' : ''; ?>>Male
</label>
</td>
<td>
<label class="label-input">
<input type="radio" name="gender" value="Female" <?php echo ($_SESSION['user']->gender === 'Female') ? 'checked' : ''; ?>>Female
</label>
</td>
<td>
<label class="label-input">
<input type="radio" name="gender" value=""<?php echo ($_SESSION['user']->gender === 'Prefer to not say') ? 'checked' : ''; ?>>Prefer to not say
</label>
</td>
</table>
</div>
<!-- Weight -->
<div class="grey-box">
<div class="grey-label">Weight</div>
</div>
<div class="white-box">
<input type="text" class="form-control" id="weight" name="weight" autocomplete="off" value="<?php echo htmlspecialchars($_SESSION['user']->weight); ?>">
<!-- NEED TO RETRIEVE WEIGHT UNIT -->
<select id="weightUnit" name="weightUnit">
<option value="" disabled selected>Weight Unit</option>
<option value="kg" <?php echo ($_SESSION['user']->weight_unit === 'kg') ? 'selected' : ''; ?>>Kilograms (kg)</option>
<option value="lbs" <?php echo ($_SESSION['user']->weight_unit === 'lbs') ? 'selected' : ''; ?>>Pounds (lbs)</option>
<option value="g" <?php echo ($_SESSION['user']->weight_unit === 'g') ? 'selected' : ''; ?>>Grams (g)</option>
</select>
</div>
<!-- Height -->
<div class="grey-box">
<div class="grey-label">Height</div>
</div>
<div class="white-box">
<input type="text" class="form-control" id="height" name="height" autocomplete="off" value="<?php echo htmlspecialchars($_SESSION['user']->height); ?>">
<!-- NEED TO RETRIEVE HEIGHT UNIT -->
<select id="heightUnit" name="heightUnit">
<option value="" disabled selected>Height Unit</option>
<option value="cm" <?php echo ($_SESSION['user']->height_unit === 'cm') ? 'selected' : ''; ?>>Centimeters (cm)</option>
<option value="in" <?php echo ($_SESSION['user']->height_unit === 'in') ? 'selected' : ''; ?>>Inches (in)</option>
<option value="m" <?php echo ($_SESSION['user']->height_unit === 'm') ? 'selected' : ''; ?>>Meters (m)</option>
</select>
</div>
<!-- Email -->
<div class="grey-box">
<div class="grey-label">Email</div>
</div>
<div class="white-box">
<input type="text" class="form-control" id="email" name="email" autocomplete="off" value="<?php echo htmlspecialchars($_SESSION['user']->email); ?>" required>
</div>
<!-- Phone Number -->
<div class="grey-box">
<div class="grey-label">Phone Number</div>
</div>
<div class="white-box">
<input type="text" class="form-control" id="phone" name="phone" autocomplete="off" value="<?php echo htmlspecialchars($_SESSION['user']->phone); ?>">
</div>
<!-- Password -->
<div class="grey-box">
<div class="grey-label">Password</div>
</div>
<div class="white-box">
<input type="password" class="form-control" id="password" name="password" autocomplete="off" value="<?php echo htmlspecialchars($_SESSION['user']->password); ?>" required>
</div>
<!-- Additional Note -->
<div class="grey-box">
<table>
<td><label class="grey-label">Additional Note</label></td>
<td><p class="subtext">[Share any relevant information about your medical conditions, injuries, allergies, meds, past fitness, and goals]</p></td>
</table>
</div>
<div class="white-box">
<textarea class="form-control" id="note" name="note" autocomplete="off"><?php echo htmlspecialchars($_SESSION['user']->additional_note); ?></textarea>
</div>
<!-- Buttons -->
<table>
<td>
<button type="button" class="default-button" name="back" onclick="window.history.back();">Back</button>
</td>
<td>
<button type="submit" class="default-button" name="update">Save Changes</button>
</td>
</table>
</div>
</div>
</form>
<?php include_once "footer.php"; ?>
</body>
</html>