-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile_edit.php
181 lines (114 loc) · 5.62 KB
/
profile_edit.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
<!DOCTYPE html>
<html lang="en">
<link rel="icon" href="img\index\logo.png">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php
include('include/importcss.php');
?>
<title>เเก้ไขประวัติ</title>
<?php
require_once('php/condbbook.php');
if (!isset($_SESSION["ID"])) {
header('location:index.php');
}
$sql = "SELECT * FROM `user` WHERE `User_ID`= '" . $_SESSION["ID"] . "'";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
if (!$result->num_rows) {
header('location:index.php');
}
include('include/navber.php');
$sql = "SELECT * FROM `user` WHERE `User_ID`= '" . $_SESSION["ID"] . "'";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
?>
</head>
<body>
<div class="container">
<div class="jumbotron jumbotron-fluid ">
<div class="container my-5">
<h1 class="display-4 text-center">ประวัติส่วนตัว</h1>
</div>
</div>
</div>
<div class="container">
<div class="py-3">
<img src="img\profile\<?php echo $row['User_Photo']; ?>" alt="profile.png"
class="img-profile rounded-circle ">
<button type="button" class="btn mx-auto d-block btn-primary" data-toggle="modal"
data-target="#exampleModal">
เปลี่ยนรูปภาพ
</button>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">อัพโหลดรูปภาพ</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form action="php/updatephoto.php" method="POST" enctype="multipart/form-data">
<div class="modal-body">
<div class="custom-file " data-callback=" PhotoChcallback">
<input type="file" class="custom-file-input profile-input" id="file"
aria-describedby="inputGroupFileAddon01" name="file">
<label class=" custom-file-label" for="inputGroupFile01">เลือกไฟล์</label>
</div>
<figure class="figure d-none ">
<img id="imgprofile" alt="profile.png"
class="figure-img img-fluid rounded-circle mr-auto">
</figure>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" name="submitphoto" id="submitphoto" class="btn btn-primary"
disabled>Save
changes</button>
</div>
</form>
</div>
</div>
</div>
</div>
<form class="form" id="Formupdatauser" method="post" action="php/updatauser.php">
<label class="textprofile ">ชื่อของคุณ</label>
<div class="row ">
<div class="col">
<input type="text" class="form-control" placeholder="ชื่อ" maxlength="30"
value="<?php echo $row['User_Firstname']; ?>" name="fname" id="fname">
</div>
<div class="col">
<input type="text" class="form-control" placeholder="นามสกุล" id="lname"
value="<?php echo $row['User_Lastname']; ?>" name="lname" maxlength="30">
</div>
</div>
<div class="form-group">
<label class="textprofile">เบอร์โทร</label>
<input type="tel" class="form-control" id="phone" name="phone" placeholder="เบอร์โทร"
value="<?php echo $row['User_Telephonenumber']; ?>">
</input>
<div class=" form-group ">
<label class=" textprofile">อีเมล</label>
<input type="email" class="form-control" id="email" name="email"
value="<?php echo $row['User_Email']; ?> " placeholder="email@example.com">
</div>
<div class="container">
<div class="row py-4 ">
<button type="submit" name="submitUpdateUser"
class="btn btn-primary btn-lg col float-left">บันทึก</button>
<div class="col"></div>
<a href="profile.php" class="btn btn-secondary btn-lg col float-right">
ยกเลิก
</a>
</div>
</div>
</form>
<?php
include('include/importjavascript.php');
?>
</body>
</html>