1+
2+ <?php
3+ if ($ erremail !='' ){
4+ $ erremail ='<div style="color:red"> ' .$ erremail .'</div> ' ;
5+ }
6+ if ($ erruser !='' ){
7+ $ erruser ='<div style="color:red"> ' .$ erruser .'</div> ' ;
8+ }
9+
10+ ?>
11+ <div class="link-mobile">
12+ <a href="#">Trang chủ </a>
13+ <i class="fa fa-chevron-right" aria-hidden="true"></i>
14+ <a href="#">Áo thun</a>
15+ </div>
16+ <form action="index.php?pg=account" method="post" enctype="multipart/form-data">
17+ <section class="account">
18+ <div class="container">
19+ <h2 class="title-mobile">Hồ sơ của tôi</h2>
20+ <div class="account-main">
21+ <div class="account-left">
22+ <div class="account-info">
23+ <div class="account-avatar">
24+ <?php
25+ if (check_img ($ img )=="" ){
26+ $ img2 ='<img src="view/layout/assets/images/avatar.png" alt="" /> ' ;
27+ }else {
28+ $ img2 =check_img ($ img );
29+ }
30+ ?>
31+ <?= $ img2?>
32+ </div>
33+ <div class="account-body">
34+ <div class="account-name"><?= $ user?> </div>
35+ <div class="account-edit">
36+ <i class="fa fa-pencil-square-o" aria-hidden="true"></i>
37+ Sửa hồ sơ
38+ </div>
39+ </div>
40+ </div>
41+ <ul class="contact-menu account-menu">
42+ <li class="contact-list account-list" id="myaccount">
43+ <a href="#" class="contact-link account-link active" data-tab="1">
44+ <i class="fa fa-user" aria-hidden="true"></i>Tài khoản của tôi</a
45+ >
46+ </li>
47+ <li class="contact-list account-list" id="history">
48+ <a href="#" class="contact-link account-link" data-tab="2">
49+ <i class="fa fa-calendar-check-o" aria-hidden="true"></i>Lịch sử mua hàng</a
50+ >
51+ </li>
52+ <li class="contact-list account-list" style="display:none" id="history-order">
53+ <a href="#" class="contact-link account-link" data-tab="2">
54+ <i class="fa fa-product-hunt" aria-hidden="true"></i>Đơn hàng</a
55+ >
56+ </li>
57+ <li class="contact-list account-list">
58+ <a href="index.php?pg=logoutuser" class="contact-link account-link">
59+ <i class="fas fa-sign-out-alt"></i>Đăng xuất</a
60+ >
61+ </li>
62+ </ul>
63+ </div>
64+
65+ <div class="account-right active tab-content" data-tab="1">
66+
67+ <div class="account-box">
68+ <h2>Hồ sơ của tôi</h2>
69+ <p>Quản lý thông tin hồ sơ để bảo mật tài khoản</p>
70+ <div class="account-group">
71+ <label for="">Tên đăng nhập:</label> <br />
72+ <input name="user" type="text" value="<?= $ user?> " />
73+ </div>
74+ <?= $ erruser?>
75+ <input name="pass" type="hidden" value="<?= $ pass?> " />
76+ <div class="account-group">
77+ <label for="">Họ và tên:</label> <br />
78+ <input name="name" type="text" value="<?= $ name?> " />
79+ </div>
80+ <div class="account-group">
81+ <label for="">Email:</label> <br />
82+ <input name="email" type="text" value="<?= $ email?> " />
83+ </div>
84+ <?= $ erremail?>
85+ <div class="account-group">
86+ <label for="">Số điện thoại:</label> <br />
87+ <input name="sdt" type="text" value="<?= $ sdt?> " />
88+ </div>
89+ <div class="account-group">
90+ <label for="">Ngày sinh:</label> <br />
91+ <input name="ngaysinh" type="date" value="<?= $ ngaysinh?> " />
92+ </div>
93+ <div class="account-group">
94+ <label for="">Địa chỉ</label> <br />
95+ <input name="diachi" type="text" value="<?= $ diachi?> " />
96+ </div>
97+ <div class="product-btn account-btn">
98+ <button name="update_account" class="button-primary">Cập nhật tài khoản</button>
99+ <button name="del_account" class="button-primary button-del">Xoá tài khoản</button>
100+ </div>
101+ </div>
102+
103+ <div class="account-right-image">
104+ <div class="account-right-avatar">
105+ <input type="hidden" name="hinhcu" value=<?= $ img?> >
106+ <?php
107+ if (check_img ($ img )=="" ){
108+ $ img ='<img id="img-preview" src="view/layout/assets/images/avatar.png" alt="" /> ' ;
109+ }else {
110+ $ img =substr_replace (check_img ($ img ), ' id="img-preview" ' , 5 , 0 );
111+ }
112+ ?>
113+ <?= $ img?>
114+ <input name="img" id="file-input" type="file" accept="image/*"/>
115+ </div>
116+ <script>
117+ var input = document.getElementById("file-input");
118+ var image = document.getElementById("img-preview");
119+
120+ input.addEventListener("change", (e) => {
121+ if (e.target.files.length) {
122+ const src = URL.createObjectURL(e.target.files[0]);
123+ image.src = src;
124+ }
125+ });
126+ </script>
127+ </div>
128+ </div>
129+
130+ <div class="account-history tab-content" data-tab="2">
131+ <p class="account-history-title">Lịch sử mua hàng</p>
132+ <div>Quản lý thông tin mua hàng</div>
133+ <table class="history-order" border="1">
134+ <thead>
135+ <tr>
136+ <th>STT</th>
137+ <th>Mã đơn hàng</th>
138+ <th>Mã khách hàng</th>
139+ <th>Ngày đặt hàng</th>
140+ <th>Thành tiền</th>
141+ <th>Trạng thái</th>
142+ <th>Thao tác</th>
143+ </tr>
144+ </thead>
145+ <tbody>
146+ <?php
147+ if (isset ($ _SESSION ['iduser ' ]) && isset ($ _SESSION ['role ' ]) && $ _SESSION ['role ' ]==0 ){
148+ $ listdonhang ;
149+ $ html_donhang ='' ;
150+ $ i =0 ;
151+ foreach ($ listdonhang as $ item ) {
152+ $ i ++;
153+ extract ($ item );
154+ $ html_donhang .='<tr>
155+ <td> ' .$ i .'</td>
156+ <td> ' .$ ma_donhang .'</td>
157+ <td> ' .$ iduser .'</td>
158+ <td> ' .$ ngaylap .'</td>
159+ <td> ' .number_format ($ tongtien ,0 ,'. ' ,', ' ).'</td>
160+ <td> ' .$ trangthai .'</td>
161+ <td>
162+ <a href="index.php?pg=account&id= ' .$ id .'" class="del">Hủy</a>
163+ </td>
164+ </tr> ' ;
165+ }
166+ }
167+ echo $ html_donhang ;
168+ ?>
169+ </tbody>
170+ </table>
171+ </div>
172+ <div class="order-history tab-content" data-tab="2">
173+ <p class="account-history-title">ĐƠN HÀNG</p>
174+ <div>Quản lý thông tin chi tiết đơn hàng</div>
175+ <table class="history-order" border="1">
176+ <thead>
177+ <tr>
178+ <th>STT</th>
179+ <th>Mã đơn hàng</th>
180+ <th>Mã sản phẩm</th>
181+ <th>Đơn giá</th>
182+ <th>Số lượng</th>
183+ <th>Thành tiền</th>
184+ </tr>
185+ </thead>
186+ <tbody>
187+ <tr>
188+ <td>1</td>
189+ <td>ZSTYLE120</td>
190+ <td>GUEST123</td>
191+ <td>12-08-2023</td>
192+ <td class="green">Thành công</td>
193+ <td>Xem - Hủy</td>
194+ </tr>
195+ <tr>
196+ <td>2</td>
197+ <td>ZSTYLE120</td>
198+ <td>GUEST123</td>
199+ <td>12-08-2023</td>
200+ <td class="green">Thành công</td>
201+ <td>Xem - Hủy</td>
202+ </tr>
203+ <tr>
204+ <td>3</td>
205+ <td>ZSTYLE120</td>
206+ <td>GUEST123</td>
207+ <td>12-08-2023</td>
208+ <td class="green">Thành công</td>
209+ <td>Xem - Hủy</td>
210+ </tr>
211+ </tbody>
212+ </table>
213+ </div>
214+ </div>
215+ </div>
216+ </section>
217+ </form>
0 commit comments