Skip to content

Commit 9678c25

Browse files
committed
add Birthday Column in Customer and text center some fields
1 parent 60d06f8 commit 9678c25

File tree

14 files changed

+65
-27
lines changed

14 files changed

+65
-27
lines changed

.htaccess

-2
This file was deleted.

admin/Asset/js/myScript.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ $(document).on('click', '.add_customer', function(){
2121
var name = $('#name').val();
2222
var phone = $('#phone').val();
2323
var email = $('#email').val();
24+
var birth = $('#birth').val();
2425

25-
$.post('Server/Customer/add_customer.php', { name: name, phone: phone, email: email }, function(data){
26+
$.post('Server/Customer/add_customer.php', { name: name, phone: phone, email: email, birth: birth }, function(data){
2627

2728
$(".modal:visible").modal('toggle');
2829
$('body').removeClass('modal-open');

admin/Controller/Customer/Customer_c_ajax.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public function removeCustomer($id) {
1515
return $this->customer->removeCustomer($id);
1616
}
1717

18-
public function addCustomer($name,$showroom_id, $phone, $email){
18+
public function addCustomer($name,$showroom_id, $phone, $email, $birth){
1919

20-
return $this->customer->addCustomer($name, $showroom_id, $phone, $email);
20+
return $this->customer->addCustomer($name, $showroom_id, $phone, $email, $birth);
2121

2222
}
2323

admin/Controller/Product/Product_c.php

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public function createOrder () {
4444
}
4545
$rows = join($table);
4646
$this->product->sendMail($customer['email'], $customer['Tên khách hàng'], $rows, $total);
47+
$this->product->sendSMS($customer['phone'], $customer['Tên khách hàng']);
4748
}
4849
if ($user_id_care == $user_id_buy) {
4950
$add6 = $this->product->addBonus6($user_id_care);

admin/Model/Customer/Customer_m_ajax.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ function __construct()
1010
}
1111

1212
//Thêm khách hàng vào bảng tbl_customer
13-
protected function addCustomer($name,$showroom_id, $phone, $email){
14-
$sql = "INSERT INTO tbl_customer (name,showroom_id, phone, email) VALUES (:name, :showroom_id, :phone, :email)";
13+
protected function addCustomer($name,$showroom_id, $phone, $email, $birth){
14+
$sql = "INSERT INTO tbl_customer (name,showroom_id, phone, email, birth) VALUES (:name, :showroom_id, :phone, :email, :birth)";
1515
$pre = $this->pdo->prepare($sql);
1616

1717
$pre->bindParam(':name', $name);
1818
$pre->bindParam(':showroom_id', $showroom_id);
1919
$pre->bindParam(':phone', $phone);
2020
$pre->bindParam(':email', $email);
21+
$pre->bindParam(':birth', $birth);
2122

2223
return $pre->execute();
2324

admin/Model/Product/Product_m.php

+26-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ protected function getId ($id) {
4141
tbl_customer.name AS 'Tên khách hàng',
4242
tbl_user.name AS 'NV chăm sóc',
4343
title,
44-
tbl_customer.email
44+
tbl_customer.email,
45+
tbl_customer.phone
4546
FROM
4647
tbl_customer,
4748
tbl_care,
@@ -252,6 +253,30 @@ protected function sendMail($email, $name, $rows, $total){
252253
}
253254
}
254255

256+
// START xử lý gửi tin nhắn cho khách
257+
protected function sendSMS($phone, $customer_name){
258+
$url = 'http://183.91.2.4:6543/mp/brandname?wsdl'; // Link API
259+
260+
$client = new SoapClient($url); // Khởi tạo đối tưởng SoapClient
261+
262+
$brandname = 'DHCH STORE'; // không thay đổi để nguyên
263+
//$phone = '0373263978'; // Đưa số điện thoại của khách cần gửi vào đây
264+
$content = '[TEST]'. ' Chao '.$customer_name.' Don hang cua ban da duoc xac nhan. Tai khoan cua ban: '.$phone.', Mat khau: 123456. Vui long dang nhap trang chu Millennium Watch de doi mat khau va tra cuu lich su mua hang: https://datgautedy.xyz/'; // Nội dung gửi tin nhắn cho khách
265+
266+
$params = array(
267+
'username' => 'dhchapi',
268+
'password' => 'dhchapi@123',
269+
'msgcontent' => $content,
270+
'brandname' => $brandname,
271+
'listuser' => $phone,
272+
'type' => '2',
273+
'templateid' => 'MP001'
274+
);
275+
276+
var_dump($client->SendSMS($params));
277+
}
278+
//END xử lý gửi tin nhắn cho khách
279+
255280
//Hiện danh sách hóa đơn theo customer_id
256281
protected function getOrderHistory ($customer_id) {
257282

admin/Server/Customer/add_customer.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
$user_id = $_SESSION['id'];
1212
$phone = $_POST['phone'];
1313
$email = $_POST['email'];
14+
$birth = $_POST['birth'];
1415

1516
$num = count($customer->checkEmailPhone($phone, $email));
1617
if ($num == 0 && $name != '' && $phone != '' && $email !=''){
17-
$add1 = $customer->addCustomer($name, $showroom_id, $phone, $email);
18+
$add1 = $customer->addCustomer($name, $showroom_id, $phone, $email, $birth);
1819
$add2 = $customer_care->addCustomerCare($user_id);
1920
if ($add1 == true && $add2 == true) {
2021
?>

admin/View/Customer/list_customer.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<th>Showroom</th>
1616
<th>Phone</th>
1717
<th>Email</th>
18+
<th>Birthday</th>
1819
<th>Status</th>
1920
<th>Action</th>
2021
</tr>
@@ -28,10 +29,11 @@
2829
<tr>
2930
<td class="text-center"><?php echo $dem+=1; ?></td>
3031
<td><?php echo $value['name']; ?></td>
31-
<td><?php echo $value['title']; ?></td>
32-
<td><?php echo $value['phone']; ?></td>
32+
<td class="text-center"><?php echo $value['title']; ?></td>
33+
<td class="text-center"><?php echo $value['phone']; ?></td>
3334
<td><?php echo $value['email']; ?></td>
34-
<td><?php
35+
<td class="text-center"><?php echo $value['birth']; ?></td>
36+
<td class="text-center"><?php
3537
if ($value['status'] == 1) {
3638
echo "<p style='color: red;'>Busy</p>";
3739
}else if ($value['status'] == 2){

admin/View/CustomerCare/list_customer_care.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
<tr>
3636
<td class="text-center"><?= $count; ?></td>
3737
<td><?= $valueCustomerCare['name'] ?></td>
38-
<td><?= $valueCustomerCare['title'] ?></td>
39-
<td><?= $valueCustomerCare['phone'] ?></td>
38+
<td class="text-center"><?= $valueCustomerCare['title'] ?></td>
39+
<td class="text-center"><?= $valueCustomerCare['phone'] ?></td>
4040
<td><?= $valueCustomerCare['email'] ?></td>
4141
<td class="text-center">
4242
<?php
@@ -49,7 +49,7 @@
4949
}
5050
?>
5151
</td>
52-
<td><?= $valueCustomerCare['create_at'] ?></td>
52+
<td class="text-center"><?= $valueCustomerCare['create_at'] ?></td>
5353

5454
<td class="text-center">
5555
<a href="dashboard.php?page=detail_customer_care&id=<?= $valueCustomerCare['id']; ?>">

admin/View/CustomerCare/list_customer_care_all.php

+17-7
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@
7171
<input type="text" class="form-control" id="email" name="email">
7272
</div>
7373

74+
<div class="form-group">
75+
<label for="birth" class="col-form-label">Birthday:</label>
76+
<input type="date" class="form-control" id="birth" name="birth">
77+
</div>
78+
7479
<div class="modal-footer">
7580
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
7681
<button type="button" class="btn btn-primary add_customer">Add</button>
@@ -95,11 +100,11 @@
95100
<tr>
96101
<td class="text-center"><?= $count; ?></td>
97102
<td><?= $valueCustomerAll['Họ tên NV'] ?></td>
98-
<td><?= $valueCustomerAll['title'] ?></td>
103+
<td class="text-center"><?= $valueCustomerAll['title'] ?></td>
99104
<td><?= $valueCustomerAll['Họ tên khách'] ?></td>
100-
<td><?= $valueCustomerAll['phone'] ?></td>
105+
<td class="text-center"><?= $valueCustomerAll['phone'] ?></td>
101106
<td><?= $valueCustomerAll['Email Khách'] ?></td>
102-
<td><?= $valueCustomerAll['create_at'] ?></td>
107+
<td class="text-center"><?= $valueCustomerAll['create_at'] ?></td>
103108
<td class="text-center">
104109
<?php
105110
if ($valueCustomerAll['status'] == 1) {
@@ -163,6 +168,11 @@
163168
<input type="text" class="form-control" id="email" name="email">
164169
</div>
165170

171+
<div class="form-group">
172+
<label for="birth" class="col-form-label">Birthday:</label>
173+
<input type="date" class="form-control" id="birth" name="birth">
174+
</div>
175+
166176
<div class="modal-footer">
167177
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
168178
<button type="button" class="btn btn-primary add_customer">Add</button>
@@ -187,12 +197,12 @@
187197
<tr>
188198
<td class="text-center"><?= $count; ?></td>
189199
<td><?= $valueCustomerAll['Họ tên NV'] ?></td>
190-
<td><?= $valueCustomerAll['title'] ?></td>
200+
<td class="text-center"><?= $valueCustomerAll['title'] ?></td>
191201
<td><?= $valueCustomerAll['Họ tên khách'] ?></td>
192-
<td><?= $valueCustomerAll['phone'] ?></td>
202+
<td class="text-center"><?= $valueCustomerAll['phone'] ?></td>
193203
<td><?= $valueCustomerAll['Email Khách'] ?></td>
194-
<td><?= $valueCustomerAll['create_at'] ?></td>
195-
<td>
204+
<td class="text-center"><?= $valueCustomerAll['create_at'] ?></td>
205+
<td class="text-center">
196206
<?php
197207
if ($valueCustomerAll['status'] == 1) {
198208
echo "<p style='color: red;'>Busy</p>";

admin/View/User/list_all_user.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<tr>
8989
<td class="text-center"><?= $count_user; ?></td>
9090
<td><?= $valueUser['name'] ?></td>
91-
<td><?= $valueUser['title'] ?></td>
91+
<td class="text-center"><?= $valueUser['title'] ?></td>
9292
<td><?= $valueUser['email'] ?></td>
9393
<td class="text-center">
9494

admin/View/User/list_bonus.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<td><?= $value['Seller']; ?></td>
3939
<td><?= $value['User Care']; ?></td>
4040
<td><?= $value['Customer']; ?></td>
41-
<td><?= $value['phone']; ?></td>
41+
<td class="text-center"><?= $value['phone']; ?></td>
4242
<td class="text-center text-danger"><?= number_format($value['total']); ?></td>
4343
<td class="text-center text-success"><?= number_format($value['bonus']); ?></td>
4444
<td class="text-center"><?= $value['create_at']; ?></td>

admin/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@
5555
<!-- /#page-wrapper -->
5656

5757
<?php include("Includes/footer.php"); ?>
58-
<script src="Asset/js/myScript.js?<?php echo fileatime('Asset/js/myScript.js') ?>"></script>
58+
<script src="Asset/js/myScript.js?<?php echo fileatime('Asset/js/myScript.js') ?>"></script>

index.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,4 @@
5757
}
5858
?>
5959
<?php include_once 'includes/footer.php'; ?>
60-
<script src="assets/js/myScript.js?<?php echo fileatime('assets/js/myScript.js') ?>"></script>
61-
60+
<script src="assets/js/myScript.js?<?php echo fileatime('assets/js/myScript.js') ?>"></script>

0 commit comments

Comments
 (0)