-
Notifications
You must be signed in to change notification settings - Fork 0
/
pemilik-account.php
237 lines (227 loc) · 8.57 KB
/
pemilik-account.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
<?php
require 'functions.php';
session_start();
//ambil data di url
$id_pemilik_kos = $_COOKIE['id_pemilik'];
//query data kos
$pemilik = query("SELECT * FROM `pemilik_kos` WHERE `id_pemilik_kos`=$id_pemilik_kos")[0];
// cek tombol submit ditekan
if (isset($_POST["submit"])) {
// cek data berhasil diubah atau tidak
if (updatePemilikAccount($_POST) > 0){
echo "<script>
alert('Profil Berhasil Diubah');
document.location.href = 'pemilik-account.php';
</script>";
} else {
echo "Data Kos Gagal Diubah";
}
}
if (isset($_POST["submit_delete"])) {
// cek data berhasil diubah atau tidak
if (deleteKos() > 0){
echo "<script>
alert('Data Kos Berhasil Dihapus');
document.location.href = 'pemilik-iklan.php';
</script>";
} else {
echo "Data Kos Gagal Diubah";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="description" content="" />
<meta name="author" content="" />
<title>Dashboard - Your Best Marketplace</title>
<link href="https://unpkg.com/[email protected]/dist/aos.css" rel="stylesheet" />
<link href="style/main.css" rel="stylesheet" />
</head>
<body>
<div class="page-dashboard">
<div class="d-flex" id="wrapper" data-aos="fade-right">
<!-- Sidebar -->
<div class="border-right" id="sidebar-wrapper">
<div class="sidebar-heading text-center">
<img src="images/logo.png" alt="" class="my-4" />
</div>
<div class="list-group list-group-flush">
<a
href="pemilik-dashboard.php"
class="list-group-item list-group-item-action"
>Dashboard</a
>
<a
href="pemilik-iklan.php"
class="list-group-item list-group-item-action"
>List Kos</a
>
<a
href="buat-iklan.php"
class="list-group-item list-group-item-action"
>Buat Iklan</a
>
<a
href="pemilik-account.php"
class="list-group-item list-group-item-action active"
>My Account</a
>
</div>
</div>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<?php
include('template/_navbar-pemilik.php');
?>
<div
class="section-content section-dashboard-home"
data-aos="fade-up"
>
<div class="container-fluid">
<div class="dashboard-heading">
<h2 class="dashboard-title">My Account</h2>
<p class="dashboard-subtitle">
Update profil kamu
</p>
</div>
<div class="dashboard-content">
<div class="row">
<div class="col-12">
<form action="" method="post">
<div class="card">
<div class="card-body">
<div class="row mb-2">
<div class="col-md-6">
<div class="form-group">
<label for="name">Nama</label>
<input
type="text"
class="form-control"
id="name"
aria-describedby="emailHelp"
name="name"
value="<?= $pemilik["name"] ?>"
/>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="email">Email</label>
<input
type="email"
class="form-control"
id="email"
aria-describedby="emailHelp"
name="email"
value="<?= $pemilik["email"] ?>"
/>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="address">Alamat</label>
<input
type="text"
class="form-control"
id="addressOne"
aria-describedby="emailHelp"
name="address"
value="<?= $pemilik["address"] ?>"
/>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="city">Kabupaten atau Kota</label>
<input
type="text"
class="form-control"
id="addressOne"
aria-describedby="emailHelp"
name="regencies"
value="<?= $pemilik["regencies"] ?>"
/>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="mobile">No Telpon</label>
<input
type="text"
class="form-control"
id="mobile"
name="no_hp"
value="<?= $pemilik["no_hp"] ?>"
/>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="zip_code">Kode Pos</label>
<input
type="text"
class="form-control"
id="zip_code"
name="zip_code"
value="<?= $pemilik["zip_code"] ?>"
/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Tanggal Lahir</label>
<input
type="date"
class="form-control"
name="birth_date"
value="<?= $pemilik["birth_date"] ?>"
/>
</div>
</div>
</div>
<div class="row">
<div class="col text-right">
<button
type="submit"
name="submit"
class="btn btn-success px-5"
>
Ubah Profil
</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /#page-content-wrapper -->
</div>
</div>
<!-- Bootstrap core JavaScript -->
<script src="/vendor/jquery/jquery.slim.min.js"></script>
<script src="/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aos.js"></script>
<script>
AOS.init();
</script>
<!-- Menu Toggle Script -->
<script>
$("#menu-toggle").click(function (e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
</script>
</body>
</html>