-
Notifications
You must be signed in to change notification settings - Fork 0
/
myprofile.php
277 lines (220 loc) · 8.24 KB
/
myprofile.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Plan It</title>
<meta name="description" content="Free Bootstrap Theme by BootstrapMade.com">
<meta name="keywords" content="free website templates, free bootstrap themes, free template, free bootstrap, free website template">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Satisfy|Bree+Serif|Candal|PT+Sans">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<!-- =======================================================
Theme Name: Delicious
Theme URL: https://bootstrapmade.com/delicious-free-restaurant-bootstrap-theme/
Author: BootstrapMade.com
Author URL: https://bootstrapmade.com
======================================================= -->
<?php
// echo "hi".$_SERVER['DOCUMENT_ROOT'];
require $_SERVER['DOCUMENT_ROOT']."/planit/dbconnection/dbconnect.php";
include 'model/profile_model.php';
include 'model/friends_model.php';
include 'model/event_model.php';
include 'model/task_model.php';
$uploads_dir = "http://127.0.0.1:8887/htdocs/planit/uploads/";
$prof = getProfile($_SESSION['username']);
$friendArray = getFriends($_SESSION['username']);
$eventArray = getEvents($_SESSION['username']);
$taskArray = getTasksByUsername($_SESSION['username']);
// echo $prof->email;
?>
<script>
$( function () {
$( '#profile-image1' ).on( 'click', function () {
$( '#profile-image-upload' ).click();
} );
} );
</script>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.easing.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/custom.js"></script>
<script src="contactform/contactform.js"></script>
<script>
$( document ).ready( function () {
console.log( "on ready" );
} );
function saveChanges() {
// var newFullName = $( '#fullname' ).html();
var newEmail = $( '#email' ).val();
var newPhone = $( '#phone' ).val();
console.log( newEmail + " " + newPhone );
}
function readURL(input, id, size) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
$("#" + id).attr("src", e.target.result);
// $("#" + id).attr("width", size);
};
reader.readAsDataURL(input.files[0]);
}
}
</script>
</head>
<body>
<!--banner-->
<section id="banner2">
<div class="bg-color2">
<header id="header">
<div class="container">
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="index.php">Home</a>
<a href="create-event.php">Create Event</a>
<!-- Can allow this only after login -->
<a href="myprofile.php">Manage Profile</a>
<!-- Can allow this only after login -->
<a href="search-people.php">Invite Friends</a>
<a href="controller/logout_controller.php">Logout</a>
</div>
<!-- Use any element to open the sidenav -->
<span onclick="openNav()" class="pull-right menu-icon">☰</span>
<div class="inner text-center">
<h1 class="logo-name2">Plan It</h1>
</div>
</div>
</header>
</section>
<div class="container">
<div class="row">
<br>
<div class="col-md-12">
<!-- <div class="panel panel-default">-->
<div class="panel panel-warning">
<div class="panel-heading">
<h4 class="heading">My Profile</h4>
</div>
<form action="controller/profile_controller.php" method="post" role="form" enctype="multipart/form-data">
<div class="panel-body">
<div class="box box-info">
<div class="box-body">
<div class="col-sm-12">
<div align="center"> <img alt="User Pic" src="<?php echo $uploads_dir . $prof->profile_image ?>" id="profile-image1" class="img-circle img-responsive">
<input type="file" id="profile-image-upload" name="profile_image" class="hidden"
onchange="readURL(this , 'profile-image1','200px');">
<div style="color:#999;">Click here to change profile image</div>
<!--Upload Image Js And Css-->
<h4 style="color:#00b1b1;" >
<div >
<?php echo $prof->fullname ?>
</div>
</h4>
</div>
<br>
<!-- /input-group -->
</div>
<div class="col-sm-6">
</span>
</div>
<div class="clearfix"></div>
<hr style="margin:5px 0 5px 0;">
<div class="col-sm-5 col-xs-6 form-group ">Username:</div>
<div id="username" name="username" class="col-sm-7 form-group">
<?php echo $prof->username ?>
</div>
<div class="clearfix"></div>
<div class="bot-border"></div>
<div class="col-sm-5 col-xs-6 form-group ">Email:</div>
<div class="col-sm-7" >
<input id="email" name="email" type="text" class="form-control" id="email" value="<?php echo $prof->email ?>"</input>
</div>
<div class="clearfix"></div>
<div class="bot-border"></div>
<div class="col-sm-5 col-xs-6 form-group ">Phone Number:</div>
<div class="col-sm-7" contenteditable="true">
<input id="phone" name="phone" type="text" class="form-control" id="phone" value="<?php echo $prof->phone ?>"</input>
</div>
<div class="clearfix"></div>
<div class="bot-border"></div>
<button type="submit" style="align:center" >Save Changes</button>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</form>
</div>
<!-- <div style="display: flex">-->
<div class="panel-body">
<div class="box box-info">
<div class="box-body">
<div class="col-sm-12">
<div class="panel panel-warning" id="result_panel">
<div class="panel-heading">
<h5 class="heading">My Friends</h3>
</div>
<div class="panel-body">
<ul class="list-group">
<?php foreach ($friendArray as $friend) {
?> <li class="list-group-item"><strong><?php echo $friend->fname;} ?></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="box box-info">
<div class="box-body">
<div class="col-sm-12">
<div class="panel panel-warning" id="result_panel">
<div class="panel-heading">
<h5 class="heading">My Tasks</h3>
</div>
<div class="panel-body">
<ul class="list-group">
<?php foreach ($taskArray as $task) {
?> <li class="list-group-item"><strong><?php echo $task->title;} ?></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="box box-info">
<div class="box-body">
<div class="col-sm-12">
<div class="panel panel-warning" id="result_panel">
<div class="panel-heading">
<h5 class="heading">My Events</h3>
</div>
<div class="panel-body">
<ul class="list-group">
<?php foreach ($eventArray as $event) {
?> <li class="list-group-item"><strong><a href="events-details.php?eventid=<?php echo $event->eventid; ?>"><?php echo $event->ename;}?></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</button>
</div>
</div>
</body>
</html>