/
infochange.html
369 lines (354 loc) · 18.5 KB
/
infochange.html
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改个人信息</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet"
media="screen">
<link href="css/font-awesome.min.css" rel="stylesheet" media="screen">
<link href="css/common.css" rel="stylesheet" media="screen">
<link href="css/infochange.css" rel="stylesheet" media="screen">
</head>
<body>
<?php
session_start();
$username=$_SESSION['UserName'];
$userid=$_SESSION['UserId'];
require 'source/UserOperation.php';
$image="<img class='img-rounded' src='img/logo.png'> ";
if($userid==null)
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=index.html\">";
else{
$useropera=new UserOperation();
$useropera->Init('localhost', 'root', 'root');
$user=$useropera->getuser($userid);
if($user->name==null)
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=index.html\">";
}
$session_id=$userid;// Session ID
$path = "upload/";
$valid_formats = array("jpg", "png", "gif", "bmp");
if(isset($_POST['submit']))
{
$name = $_FILES['photoimg']['name'];
$size = $_FILES['photoimg']['size'];
if(strlen($name))
{
list($txt, $ext) = explode(".", $name);
if(in_array($ext,$valid_formats) && $size<(250*1024))
{
$actual_image_name = time().substr($txt, 5).".".$ext;
$tmp = $_FILES['photoimg']['tmp_name'];
if(move_uploaded_file($tmp, $path.$actual_image_name))
{
$pathall=$path.$actual_image_name;
// $useropera->updatepicforuser($session_id,$pathall);
// mysql_query("UPDATE users SET profile_image='$actual_image_name' WHERE uid='$session_id'");
$image="<img style='' class='img-rounded' src='upload/".$actual_image_name."' id=\"photo\" >";
}
else
echo "failed";
}
else
echo "Invalid file formats..!";
}
else
echo "Please select image..!";
}
?>
<!--------------------------- navigation bar -------------------------->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner navBack">
<div>
<a class="btn btn-navbar" data-toggle="collapse"
data-target=".nav-collapse"> <span class="icon-bar"></span> <span
class="icon-bar"></span> <span class="icon-bar"></span> </a> <a
class="brand" href="#"><img src="img/websiteTitle.png"
class="websiteTitleInNav" /> </a>
<div class="nav-collapse collapse">
<ul class="nav" id="navUl">
<li class="active">
<a href="personal.html">首页</a>
</li>
<li>
<a href="allusertopic.html">我的小组</a>
</li>
<li>
<a href="groupclass.html">发现小组</a>
</li>
<li>
<a href="thingclass.html">发现东西</a>
</li>
<li>
<a href="inoutbox.html">消息</a>
</li>
</ul>
<div class="searchinfo">
<ul class="nav" id="navU2">
<li class="dropdown">
<a class="dropdown-toggle" id="drop5" role="button" data-toggle="dropdown" href="#"><?php echo $username;?><b class="caret"></b></a>
<ul id="menu3" class="dropdown-menu" role="menu" aria-labelledby="drop5">
<li role="presentation"><a role="menuitem" tabindex="-1" href="personal.html">我的主页</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="infochange.html">我的账号</a></li>
<li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="source/loginout.php">退出</a></li>
</ul>
</li>
<li><form class="form-search searchFormInNav" action="source/search.php" method="POST">
<input type="text" id="inp-query" class="input-medium search-query" name="searchinputvalue"
placeholder="搜索你要的">
<button type="submit" class="btn">
<i class="icon-search"></i>
</button>
</form></li>
</div>
</div>
</div>
</div>
</div>
<div class="messageDiv templateMsgDiv">
<i class="icon icon-circle"></i>
<p>恭喜您中了5000万超级大奖</p>
</div>
<div class="messagesDiv"></div>
<!--------------------------- mailinfo page -------------------------->
<div id="mainWindow" class="container-fluid">
<div class="row-fluid">
<div class="span8 content">
<div class="infoChange">
<h3>修改个人信息</h3>
<form action="source/infochange.php" method="POST">
<div class="control-group userNameControl">
<label class="control-label">昵称:</label>
<div class="controls">
<?php echo "<input type='text' value='".$user->name."' id='userNameInputR' placeholder='昵称' name='registerFormname'>";?>
</div>
</div>
<div class="control-group passwordRControl">
<label class="control-label" for="inputPassword">密码:</label>
<div class="controls">
<?php echo "<input type='hidden' name='hidden_photourl' value='".$pathall."'>"?>
<input type="password" id="passwordInputR" placeholder="密码" name="registerFormpassword">
</div>
</div>
<div class="control-group passwordR2Control">
<label class="control-label" for="inputPassword">确认密码:</label>
<div class="controls">
<input type="password" id="passwordInputR2" placeholder="确认密码" name="registerFormpasswordr">
</div>
</div>
<!-- <div class="thingInput-href">
<label>头像:</label>-->
<!--</div>-->
<div style="margin-top: 60px;" class="control-group">
<button class="btn" type="submit">确认修改</button>
</div>
</form>
<!-- <form style=" display: block;padding-top: -40px; margin-top: -100px;" id="cropimage" method="post" enctype="multipart/form-data">
上传头像:<input style="margin-left: 10px;" type="file" name="photoimg" id="photoimg" />
<input type="hidden" name="image_name" id="image_name" value="" />
<input type="submit" name="submit" value="提交" /> <br />
<div style="margin-left: 80px;font-size:11px">最大 250 KB</div>
</form> -->
</div>
</div>
<div class="span4 aside">
<div class="mainLink">
<div class="mainLink-div"><a href="personal.html">>返回我的主页</a></div>
</div>
</div>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/common.js"></script>
<script src="js/infochange.js"></script>
</body>
<!-- <table background = "registPic/userExtendInfoBg.gif"
cellspacing = 0 cellpadding = 0
id = changeHeadIcon
style = "border:1px solid #98bf21;
left:39%;top:0px;width:300px;height:325px;position:absolute;">
<tr style = " font-weight:bold;background-color:#A7C942" height = 10% >
<td >
修改头像照片
</td>
<td align = right>
<input id = "closeRegistWindow" type="image" src="img/error.png" width="20" height="20" >
</td>
</tr>
<tr height = 10% valign = bottom >
<td >
<button id = uploadMenu style= "color:black;font-size:13px ;
font-weight:bold; background-color: grey;
border-style: none; "/>选择上传</button>
<button id = draguploadMenu style= "color:grey;font-size:13px ;
font-weight:bold; background-color: #E8E8E8;
border-style: none; ">拖拽上传</button>
</td>
<td>
</td>
</tr >
<tr valign = top>
<td colspan ="2" >
<table id = uploadtable width = 298px height = 260px style="border-top: 2px solid grey; ">
<tr height = 25% valign = bottom>
<td colspan ="2" align = "center" style = "color:grey" >
点击从电脑选择一张图片:
</td>
</tr>
<tr height = 30% valign = center>
<td colspan ="2" align = "center">
<form id = test method = POST ENCTYPE = "multipart/form-data" action = "functionPHP/uploadTempHeadIcon.php">
<input type = file id = upfile name = upfile style="color:black;
font:bold 12px '黑体';height:18px;width:160px"
accept="image/*">
<br>
<br>
</form>
<button id = submitPic>提交</button>
</td>
</tr>
<tr valign =top >
<td colspan ="2" align = "center" style = "color:#CD853F">
<br>支持JPG,JPEG,PNG等格式,
<br>大小不超过2MB
</td>
</tr>
<tr >
</tr>
</table>
<td>
</tr>
<tr >
<td colspan ="2" align = center>
<table id = draguploadtable width = 298px height = 260px style="border-top: 2px solid grey;display:none">
<tr height = 25% valign = bottom >
<td colspan ="2" style = "color:grey"align = "center">
<div id="dropBox" style="float:left;width:200px;
height:150px;margin:10px 0 0 40px;
border:1px solid #015EAC;
color:#666;overflow:hidden;clear:left;font-size:16px;">
拖拽图片到这里!
</div>
</td>
</tr>
<tr>
<td colspan ="2" align = "center" >
<button id = dragUploadButton >编辑</button>
</td>
</tr>
<tr>
<td colspan ="2" align = "center" style = "color:#CD853F" valign = "top">
<br>支持JPG,JPEG,PNG等格式,
<br>大小任意
</td>
</tr>
<tr >
</tr>
</table>
<td>
</tr>
</table>
<table background = "registPic/userExtendInfoBg.gif"
cellspacing = 0 cellpadding = 0
id = dealHeadIcon
style = "border:1px solid #98bf21;
left:39%;top:120px;width:300px;height:325px;position:absolute;display:none">
<tr style = " font-weight:bold;background-color:#A7C942" height = 10% >
<td >
修改头像照片
</td>
<td align = right>
<input id = "closeHeadIconWindow" type="image" src="registPic/error.png" width="20" height="20" >
</td>
</tr>
<tr height = 10% valign = bottom >
<td >
 
<input id = bigger type="image" src="cutHeadIcon/big.png" width="20" height="20" id = "big" >
<lable style="font-size:13;color:grey">放大</lable>
<input id = smaller type="image" src="cutHeadIcon/small.png" width="20" height="20" id = "big" >
<lable style="font-size:13;color:grey">缩小</lable>
<input id = leftRotate type="image" src="cutHeadIcon/right.png" width="20" height="20" id = "big" >
<lable style="font-size:13;color:grey">右转</lable>
<input id = rightRotate type="image" src="cutHeadIcon/left.png" width="20" height="20" id = "big" >
<lable style="font-size:13;color:grey">左转</lable>
</td>
</td>
</tr >
<tr valign = top >
<td colspan ="2" >
<table id = dealPic width = 298px height = 260px style="border-top: 2px solid grey; ">
<tr height = 90%>
<td align = left valign = top >
<div style="float:left;width:270px;left:0;top:0;position:relative;
height:226px;margin:0px 0 0 10px;
border:1px solid #015EAC;
color:#666;overflow:hidden;clear:left;">
<canvas id="headCanvas"height=226 style="position:absolute;">
</canvas>
<image src = "cutHeadIcon/background0.jpg" width = 276 height = 276 ></image>
<div style="float:left;width:272px;left:0;top:0;position:absolute;
height:73px;margin:0px 0 0 0px;
color:#666;overflow:hidden;clear:left;">
<image src = "cutHeadIcon/middle.png" width = 276 height = 73></image>
</div>
<div style="float:left;width:272px;left:0;top:153;position:absolute;
height:75px;margin:0px 0 0 0px;
color:#666;overflow:hidden;clear:left;">
<image src = "cutHeadIcon/middle.png" width = 276 height = 75></image>
</div>
<div style="float:left;width:100px;left:0;top:73;position:absolute;
height:80px;margin:0px 0 0 0px;
color:#666;overflow:hidden;clear:left;">
<image src = "cutHeadIcon/middle.png" width = 100 height = 80></image>
</div>
<div style="float:left;width:102px;left:170;top:73;position:absolute;
height:80px;margin:0px 0 0 0px;
color:#666;overflow:hidden;clear:left;">
<image src = "cutHeadIcon/middle.png" width = 276 height = 80></image>
</div>
<div style="float:left;width:70px;left:100;top:73;position:absolute;
height:0px;margin:0px 0 0 0px;
border:1px solid #015EAC;
color:#666;overflow:hidden;clear:left;">
</div>
<div style="float:left;width:70px;left:100;top:153;position:absolute;
height:0px;margin:0px 0 0 0px;
border:1px solid #015EAC;
color:#666;overflow:hidden;clear:left;">
</div>
<div style="float:left;width:0px;left:100;top:73;position:absolute;
height:80px;margin:0px 0 0 0px;
border:1px solid #015EAC;
color:#666;overflow:hidden;clear:left;">
</div>
<div style="float:left;width:0px;left:170;top:73;position:absolute;
height:80px;margin:0px 0 0 0px;
border:1px solid #015EAC;
color:#666;overflow:hidden;clear:left;">
</div>
</div>
</td>
</tr>
<tr valign =middle >
<td colspan ="2" align = "center" style = "color:#CD853F">
<button id = rechoose style= "color:black;font-size:13px ;
font-weight:bold; background-color: grey;
border-style: none; "/>重选照片</button>
<button id = saveHeadIcon style= "color:black;font-size:13px ;
font-weight:bold; background-color: grey;
border-style: none; "/>保存头像</button>
</td>
</tr>
<tr >
</tr>
</table>
<td>
</tr>
</table>
<canvas id = forSaveHeadIcon width = 70 height = 80 style ="display: none"></canvas>-->
</html>