-
Notifications
You must be signed in to change notification settings - Fork 1
/
profile.php
215 lines (166 loc) · 8.49 KB
/
profile.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
<?php
session_start();
$_SESSION['username'];
if(isset($_POST['submit'])){
move_uploaded_file($_FILES['file']['tmp_name'],"pic/".$_FILES['file']['name']);
$con = mysqli_connect("rts2ucom.ipagemysql.com","adminjs","js931110","dblogin") or die("im done");
$q = mysqli_query($con,"UPDATE login_member SET Member_Profilepic = '".$_FILES['file']['name']."' WHERE Member_Username = '".$_SESSION['username']."'") or die("im fucked");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Dashboard">
<meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
<title>My Profile</title>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<!--external css-->
<link href="assets/assets3/font-awesome/css/font-awesome.css" rel="stylesheet" />
<!-- Custom styles for this template -->
<link href="assets/assets3/css/style.css" rel="stylesheet">
<link href="assets/assets3/css/style-responsive.css" rel="stylesheet">
</head>
<body>
<?php
session_start();
$username=$_SESSION['username'];
$sql1=mysql_connect("rts2ucom.ipagemysql.com","adminjs","js931110");
mysql_select_db("dblogin")or die("cannot select DB");
$query = "SELECT * FROM login_member WHERE Member_Username='$username'";
$results = mysql_query($query) or die ("Error reading from database");
$profile = mysql_fetch_array($results);
?>
<section id="container" >
<!--header start-->
<header class="header black-bg">
<div class="sidebar-toggle-box">
<div class="fa fa-bars tooltips" data-placement="right" data-original-title="Toggle Navigation"></div>
</div>
<!--logo start-->
<a class="logo"><b>Profile</b></a>
<!--logo end-->
<div class="nav notify-row" id="top_menu">
<!-- notification start -->
<ul class="nav top-menu">
<!-- settings start -->
<!-- settings end -->
<!-- inbox dropdown start-->
<li id="header_inbox_bar" class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="index.html#">
<i class="fa fa-envelope-o"></i>
<span class="badge bg-theme">5</span>
</a>
</li>
<!-- inbox dropdown end -->
</ul>
<!-- notification end -->
</div>
<div class="top-menu">
<ul class="nav pull-right top-menu">
<li><a href="ghome" class="logo"><b>Home</b></a></li>
<li><a class="logout" href="logout">Logout</a></li>
</ul>
</div>
</header>
</section>
<!--header end-->
<!-- **********************************************************************************************************************************************************
MAIN SIDEBAR MENU
*********************************************************************************************************************************************************** -->
<!--sidebar start-->
<section id="container" >
<aside>
<div id="sidebar" class="nav-collapse">
<!-- sidebar menu start-->
<ul class="sidebar-menu" id="nav-accordion">
<p class="centered"><?php
$con = mysqli_connect("rts2ucom.ipagemysql.com","adminjs","js931110","dblogin");
$q = mysqli_query($con,"SELECT * FROM login_member WHERE Member_Username='".$_SESSION['username']."'") or die("damn");
while($row = mysqli_fetch_assoc($q)){
if($row['Member_Profilepic'] == "/pic/default.png"){
echo "<img width='250' height='250' src='pic/default.png' alt='Default Profile Pic'>";
} else {
echo "<img width='250' height='250' src='pic/".$row['Member_Profilepic']."' alt='Profile Pic'>";
}
echo "<br>";
}
?></p>
<br><form action="" method="post" enctype="multipart/form-data">
<input type="file" name="file">
<br> <input type="submit" class="btn btn-info" name="submit" value="Upload New Profile Pic">
</form>
<br><br><li class="sub-menu">
<a class="active" href="javascript:;" >
<i class="fa fa-tasks"></i>
<span>Privacy</span>
</a>
<ul class="sub">
<li class="active"><a href="profile">Edit Info</a></li>
<li class=><a href="profile_password">Edit Password</a></li>
</ul>
</li>
</ul>
<!-- sidebar menu end-->
</div>
</aside>
</section>
<!--sidebar end-->
<!-- **********************************************************************************************************************************************************
MAIN CONTENT
*********************************************************************************************************************************************************** -->
<!--main content start-->
<!-- NAVBAR CODE END -->
<section id="main-content">
<div class = "wrapper">
<div style="width:500px; margin:0 auto;">
<h3>Edit Profile</h3>
<!-- BASIC FORM ELELEMNTS -->
<div class="row mt">
<div>
<form action="profileedit.php" method="post">
<div class="form-panel">
<h4><Edit Info</h4>
<label>Name</label>
<input type="text" class="form-control" name="new_name" placeholder="<?php echo $profile['Member_Name']?>">
<label>Email</label>
<input type="text" class="form-control" placeholder="<?php echo $profile['Member_Email']?>" readonly>
<label>Phone Number</label>
<input type="text" class="form-control" name="new_phone" placeholder="<?php echo $profile['Member_Phone']?>">
<label>Address</label>
<input type="text" class="form-control" name="new_address" placeholder="<?php echo $profile['Member_Address']?>">
<label>City</label>
<input type="text" class="form-control" name="new_city" placeholder="<?php echo $profile['Member_City']?>">
<br>
<input type="submit" class="btn btn-success submit" value="Save Changes" /><a href ="check_edit"</a>
</div>
</form>
</div>
</div>
</div>
</div>
<!--main content end-->
</section>
<!-- js placed at the end of the document so the pages load faster -->
<script src="assets/assets3/js/jquery.js"></script>
<script src="assets/assets3/js/jquery-1.8.3.min.js"></script>
<script src="assets/assets3/js/bootstrap.min.js"></script>
<script class="include" type="text/javascript" src="assets/assets3/js/jquery.dcjqaccordion.2.7.js"></script>
<script src="assets/assets3/js/jquery.scrollTo.min.js"></script>
<script src="assets/assets3/js/jquery.nicescroll.js" type="text/javascript"></script>
<!--common script for all pages-->
<script src="assets/assets3/js/common-scripts.js"></script>
<!--script for this page-->
<script type="application/javascript">
function myNavFunction(id) {
$("#date-popover").hide();
var nav = $("#" + id).data("navigation");
var to = $("#" + id).data("to");
console.log('nav ' + nav + ' to: ' + to.month + '/' + to.year);
}
</script>
</body>
</html>