-
Notifications
You must be signed in to change notification settings - Fork 0
/
setting.php
154 lines (144 loc) · 6.07 KB
/
setting.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
<?php include 'include/header.php'; ?>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="container-fluid">
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Data Profile</h1>
</div>
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Edit Profile</h6>
</div>
<div class="card-body">
<?php
if (isset($_GET['m'])) {
if ($_GET['m'] == 's_profile') {
echo "<div class='alert alert-success'>Profile berhasil diubah! <small>login ulang untuk melihat perubahan</small></div>";
} elseif ($_GET['m'] == 'r_profile') {
echo "<div class='alert alert-danger'>Profile gagal diubah! (Hint Salah)</div>";
}
}
?>
<form action="e_profile.php" method="post">
<div class="form-group">
<?php include 'include/config.php';
$id = $_SESSION['id'];
$d = mysqli_query($con, "select * from user where id='$id'");
$row = mysqli_fetch_assoc($d);
?>
<input type="hidden" name="id" class="form-control" placeholder="" value="<?= $row['id'] ?>">
<label>Nama Lengkap</label>
<input type="text" name="nama_lengkap" class="form-control" placeholder="" value="<?= $row['nama_lengkap'] ?>">
</div>
<div class="form-group">
<label>Email</label>
<input type="email" name="email" class="form-control" placeholder="" value="<?= $row['email'] ?>">
</div>
<div class="form-group">
<label>No. HP</label>
<input type="number" name="nohp" class="form-control" placeholder="" value="<?= $row['nohp'] ?>">
</div>
<div class="form-group">
<label>Alamat</label>
<textarea name="alamat" cols="30" rows="2" class="form-control"><?= $row['alamat'] ?></textarea>
</div>
<div class="form-group">
<label>Hint</label>
<input type="text" name="hint" class="form-control" placeholder="Siapakah nama ibu kandung anda?">
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary">
</div>
</form>
</div>
</div>
<div class="row">
<div class="col">
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Ganti Password</h6>
</div>
<div class="card-body">
<?php
if (isset($_GET['m'])) {
if ($_GET['m'] == 's_password') {
echo "<div class='alert alert-success'>Password berhasil diubah! <small>login ulang untuk melihat perubahan</small></div>";
} elseif ($_GET['m'] == 'r_password') {
echo "<div class='alert alert-danger'>Password gagal diubah!</div>";
}
}
?>
<form action="e_password.php" method="post">
<div class="form-group">
<label>Password Lama</label>
<input type="hidden" name="id" class="form-control" placeholder="" value="<?= $_SESSION['id'] ?>">
<input type="password" name="password_lama" class="form-control" placeholder="">
</div>
<div class="form-group">
<div class="row">
<div class="col">
<label>Password Baru</label>
<input type="password" name="password_baru1" class="form-control" placeholder="">
</div>
<div class="col">
<label>Repeat Password</label>
<input type="password" name="password_baru2" class="form-control" placeholder="">
</div>
</div>
</div>
<div class="form-group">
<label>Hint</label>
<input type="text" name="hint" class="form-control" placeholder="Siapakah nama ibu kandung anda?">
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
<div class="col">
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Ganti Photo</h6>
</div>
<div class="card-body">
<?php
if (isset($_GET['m'])) {
if ($_GET['m'] == 's_photo') {
echo "<div class='alert alert-success'>Photo berhasil diubah! <small>login ulang untuk melihat perubahan</small></div>";
} elseif ($_GET['m'] == 'r_photo') {
echo "<div class='alert alert-danger'>Photo gagal diubah!</div>";
} elseif ($_GET['m'] == 'r_photo_b') {
echo "<div class='alert alert-danger'>Photo gagal diubah! <small>Ukuran photo terlalu besar!</small></div>";
} elseif ($_GET['m'] == 'r_photo_x') {
echo "<div class='alert alert-danger'>Photo gagal diubah! <small>Ektensi file tidak diperbolehkan!</small></div>";
} elseif ($_GET['m'] == 'r_photo_h') {
echo "<div class='alert alert-danger'>Photo gagal diubah! <small>Hint tidak sesuai!</small></div>";
}
}
?>
<form action="e_photo.php" method="post" enctype="multipart/form-data">
<div class="form-group">
<label>Photo Baru</label>
<input type="hidden" name="id" class="form-control" placeholder="" value="<?= $_SESSION['id'] ?>">
<input type="file" name="file" class="form-control" placeholder="">
</div>
<div class="form-group">
<label>Hint</label>
<input type="text" name="hint" class="form-control" placeholder="Siapakah nama ibu kandung anda?">
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
<?php include 'include/footer.php'; ?>