-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditprofile.php
More file actions
111 lines (109 loc) · 4.93 KB
/
Copy patheditprofile.php
File metadata and controls
111 lines (109 loc) · 4.93 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
<!DOCTYPE html>
<html>
<head>
<link href="css/editprofile.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="img/main/favicon.ico"/>
<title>Showtime - Edit Profile</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<?php
include('page-elements/header.php');
if(UserController::getSessionUserId()) {
$user = UserController::getLoggedInUser();
$user_id = $user->id;
}
else {
header("Location:notFound.php");
}
?>
<main>
<div id="all">
<div id="editl">
<div id="changeA">
<?php
$avatar = 'img/user-avatars/' . $user_id . '.jpg';
if (!file_exists($avatar)) {
$avatar = 'img/misc/placeholder-avatar.png';
}
?>
<img id="profile-img" src="<?php echo $avatar?>" alt="Avatar"/>
<form method="post" enctype="multipart/form-data">
<input type="file" name="userAvatar" id="fileToUpload"/>
<br/>
<input id="img-upload-btn" class="upload-button" type="submit" value="Change Avatar" name="img-upload"/>
</form>
</div>
<form method="post">
<br/>
<label>Current Password</label>
<br/>
<input class="in" type="password" name="currentpass"/>
<br/>
<label>Enter New Password</label>
<br/>
<input class="in" type="password" name="newpass"/>
<br/>
<label>Confirm New Password</label>
<br/>
<input class="in" type="password" name="confirmpass"/>
<br/>
<br/>
<input class="button" type="submit" name="save-password" value="Save"/>
</form>
</div>
<div id="editr">
<form method="post">
<br/>
<label>Current Email</label>
<br/>
<input class="in" type="email" name="currentemail"/>
<br/>
<label>Enter New Email</label>
<br/>
<input class="in" type="email" name="newemail"/>
<br/>
<label>Confirm New Email</label>
<br/>
<input class="in" type="email" name="confirmemail"/>
<br/>
<br/>
<input class="button" type="submit" name="save-email" value="Save"/>
</form>
<form method="post">
<br/>
<label>First Name</label>
<br/>
<input class="in" type="text" name="first_name" value="<?php if(isset(UserController::getLoggedInUser()->first_name)) {echo UserController::getLoggedInUser()->first_name;}?>"/>
<br/>
<label>Last Name</label>
<br/>
<input class="in" type="text" name="last_name" value="<?php if(isset(UserController::getLoggedInUser()->last_name)) {echo UserController::getLoggedInUser()->last_name;}?>"/>
<br/>
<label>Birthdate</label>
<br/>
<input class="in" type="date" name="birthdate" value="<?php if(isset(UserController::getLoggedInUser()->birthdate)) {echo UserController::getLoggedInUser()->birthdate;}?>"/>
<br/>
<label>Country</label>
<br/>
<select class="in" name="country">
<option value="disabled" name="country">Country</option>
<?php
$aux = new Country();
$country_list = $aux->getAll();
foreach ($country_list as $id=>$name) {?>
<option value="<?php echo $id?>"><?php echo $name?></option><?php
}
?>
</select>
<br/>
<input class="button" type="submit" name="save-personalinfo" value="Save"/>
</form>
</div>
</div>
</main>
<?php
include('page-elements/footer.php');
?>
</body>