-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
217 lines (192 loc) · 7.86 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
216
<?php
session_start();
if(!isset($_SESSION['userBiasa']) && !isset($_SESSION['pass'])) {
echo "<script>location.href='index.php'</script>";
}
include "config.php";
?>
<!doctype html>
<html>
<head>
<title>PROFILE</title>
<!-- load stlye dari 23 -->
<link rel="stylesheet" type="text/css" href="css/w3.css"/>
<link rel="stylesheet" type="text/css" href="css/warna.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- load bootsrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
<style>
/** lain lain **/
html, body {
height: 100%;
width: 100%;
}
google-map {
height: 700px;
width: 100%;
}
#map {
height: 100%;
}
.limitTampil {
display: none;
}
</style>
</head>
<body>
<!-- membuat bar -->
<div class="w3-top">
<div class="w3-bar w3-xlarge w3-theme-d4">
<button href="javascript:void(0)" onclick="myFunction()" class="w3-hide-large w3-hide-medium w3-bar-item w3-button w3-hover-theme">
<b><i class="fa fa-bars" aria-hidden="true"></i></b>
</button>
<div class="w3-bar-item"><b>KOS-Q</b>
</div>
<button onclick="location.href='index.php'" class="w3-hide-small w3-bar-item w3-button w3-hover-theme">
<b><i class="fa fa-home" aria-hidden="true"></i></b>
</button>
<button onclick="location.href='banding.php'" class="w3-hide-small w3-bar-item w3-button w3-hover-theme">
<b>BANDINGKAN</b>
</button>
<button onclick="location.href='logout.php'" class="w3-hode-small w3-bar-item w3-button w3-hover-theme w3-right">
<i class="fa fa-sign-out" aria-hidden="true"></i> Logout
</button>
</div>
<div id="demo" class="w3-bar-block w3-theme-d4 w3-hide w3-hide-large w3-hide-medium">
<button onclick="location.href='index.php'" class="w3-bar-item w3-button w3-hover-theme">
<i class="fa fa-home" aria-hidden="true"></i> Home
</button>
<button onclick="location.href='banding.php'" class="w3-bar-item w3-button">
<i class="fa fa-exchange" aria-hidden="true"></i> Bandingkan
</button>
</div>
</div>
<div class="w3-bar w3-xlarge w3-theme-d4">
<div class="w3-bar-item"><b>KOS-Q</b>
</div>
</div>
<?php
include "profileUpdate.php";
$yhb = mysql_query("SELECT * FROM userBiasa WHERE userBiasa = '$_SESSION[userBiasa]'");
$nmf = mysql_fetch_array($yhb);
$yka = mysql_query("SELECT *, COUNT(*) AS jumlah FROM reviewKost WHERE idUser = $nmf[id]");
$nme = mysql_fetch_array($yka);
$hash = md5(strtolower(trim($nmf['email'])));
$size = 200;
$gravatar = "http://www.gravatar.com/avatar/" . $hash . "?s=" . $size;
?>
<div class="w3-content">
<div class="w3-container">
<div class="w3-col l2 m2 s12"> </div>
<div class="w3-col l8 m8 s12 w3-margin-bottom">
<div class="w3-row">
<div class="w3-col l3 m3 s3"> </div>
<div class="w3-col l6 m6 s6">
<div class="w3-padding">
<img src="<?=$gravatar?>" class="w3-image w3-margin-top w3-circle" style="width: 100%"/>
</div>
</div>
<div class="w3-col l6 m6 s6"> </div>
</div>
<div class="w3-xxlarge w3-margin-top w3-center">
<b>
<?=$nmf['depan']?> <?=$nmf['belakang']?>
</b>
</div>
<form method="POST">
<div class="w3-row w3-section">
<div class="w3-large w3-margin-top w3-margin-bottom">
<b>Data user:</b>
</div>
<label>Username:</label>
<input class="w3-input w3-border" type="text" name="userBiasa" value="<?=$nmf['userBiasa']?>" disabled/>
</div>
<div class="w3-row w3-section">
<label>Kost:</label>
<input class="w3-input w3-border" type="text" name="namaKost" placeholder="<?=$nmf['namaKost']?>" id="namaKost" disabled/>
</div>
<div class="w3-row w3-section">
<label>Nama depan:</label>
<input class="w3-input w3-border" type="text" name="depan" placeholder="<?=$nmf['depan']?>" id="depan"/>
</div>
<div class="w3-row w3-section">
<label>Nama belakang:</label>
<input class="w3-input w3-border" type="text" name="belakang" placeholder="<?=$nmf['belakang']?>"/>
</div>
<div class="w3-row w3-section">
<label>Email:</label>
<input class="w3-input w3-border" type="text" name="email" placeholder="<?=$nmf['email']?>"/>
</div>
<div class="w3-row w3-section">
<div class="w3-large w3-margin-top w3-margin-bottom">
<b>Ganti password:</b>
</div>
<input class="w3-input w3-border" type="password" name="password1" placeholder="Password baru" />
</div>
<div class="w3-row w3-section">
<input class="w3-input w3-border" type="password" name="password2" placeholder="Konfirmasi Password baru"/>
</div>
<div class="w3-row w3-section">
<div class="w3-large w3-margin-top w3-margin-bottom">
<b>Masukan password untuk menyimpan:</b>
</div>
<input class="w3-input w3-border" type="password" name="oldpass" placeholder="Password lama" required/>
</div>
<input class="w3-right w3-border w3-button w3-theme-dark w3-hover-theme" type="submit" name="updateProfile" value="UPDATE"/>
</form>
<?php
if($nme['jumlah'] == 1) {
?>
<button onclick="location.href='tampil.php?id=<?=$nme['idKost']?>'" class="w3-margin-right w3-right w3-border w3-button w3-flat-pomegranate w3-hover-red">TAMPILKAN REVIEW SAYA</button>
<?php
}
?>
</div>
<div class="w3-col l2 m2 s12"> </div>
</div>
</div>
<!-- bar bawah waktu gede -->
<div class="w3-bar w3-theme-light w3-center w3-border-top w3-border-theme w3-hide-small">
<div class="w3-xxlarge w3-margin">
<b class="w3-text-theme">KOS-Q</b>
</div>
<div class="w3-row w3-margin-bottom">
<i onclick="window.open('//twitter.com/mykosq')" class="fa fa-twitter w3-xlarge w3-button w3-padding w3-hover-theme" aria-hidden="true"></i>
<i onclick="window.open('//fb.me/mykosq')" class="fa fa-facebook w3-xlarge w3-button w3-padding w3-hover-theme" aria-hidden="true"></i>
<i onclick="window.open('//www.instagram.com/mykosq/')" class="fa fa-instagram w3-xlarge w3-button w3-padding w3-hover-theme" aria-hidden="true"></i>
</div>
<div class="w3-row w3-margin-bottom">
<i class="fa fa-envelope-o" aria-hidden="true"></i> [email protected]
<i class="fa fa-whatsapp" aria-hidden="true"></i> +6281234567890
<i class="fa fa-weixin" aria-hidden="true"></i> kosqkosq
</div>
</div>
<!-- bar waktu kecil -->
<div class="w3-bar w3-theme-light w3-center w3-border-top w3-border-theme w3-hide-medium w3-hide-large">
<div class="w3-large">
<b class="w3-text-theme">KOS-Q</b>
</div>
<div class="w3-row">
<i onclick="window.open('//twitter.com/mykosq')" class="fa fa-twitter w3-large w3-button w3-padding w3-hover-theme" aria-hidden="true"></i>
<i onclick="window.open('//fb.me/mykosq')" class="fa fa-facebook w3-large w3-button w3-padding w3-hover-theme" aria-hidden="true"></i>
<i onclick="window.open('//www.instagram.com/mykosq/')" class="fa fa-instagram w3-large w3-button w3-padding w3-hover-theme" aria-hidden="true"></i>
</div>
<div class="w3-row w3-margin-bottom w3-small">
<i class="fa fa-envelope-o" aria-hidden="true"></i> [email protected]
<i class="fa fa-whatsapp" aria-hidden="true"></i> +6281234567890
<i class="fa fa-weixin" aria-hidden="true"></i> kosqkosq
</div>
</div>
<script type="text/javascript">
function myFunction() {
var x = document.getElementById("demo");
if (x.className.indexOf("w3-show") == -1) {
x.className += " w3-show";
} else {
x.className = x.className.replace(" w3-show", "");
}
}
</script>
</body>
</html>