01.
02.
$table
=
'tbl_customer'
;
03.
04.
$primaryKey
=
'cust_id'
;
05.
06.
$columns
=
array
(
07.
array
(
'db'
=>
'cust_id'
,
'dt'
=> 0 ),
08.
array
(
'db'
=>
'fullname'
,
'dt'
=> 1 ),
09.
array
(
'db'
=>
'tel1'
,
'dt'
=> 2 ),
10.
array
(
'db'
=>
'employee_id'
,
'dt'
=> 3 ),
11.
array
(
12.
'db'
=>
'cust_id'
,
13.
'dt'
=> 5,
14.
'formatter'
=>
function
(
$d
,
$row
) {
15.
return
'<button type="button" class="btn btn-sm btn-warning" data-toggle="modal" data-target="#exampleModal" data-whatever="'
.
$d
.
'">แก้ไข</button>'
;
16.
}
17.
),
18.
array
(
19.
'db'
=>
'cust_id'
,
20.
'dt'
=> 6,
21.
'formatter'
=>
function
(
$d
,
$row
) {
22.
return
'<button onclick="deleteRow('
.
$d
.
')" class="btn btn-sm btn-danger">ลบ</button>'
;
23.
}
24.
)
25.
);
26.
27.
28.
$sql_details
=
array
(
29.
'user'
=>
'root'
,
30.
'pass'
=>
''
,
31.
'db'
=>
'cms_data'
,
32.
'host'
=>
'localhost'
33.
);
34.
35.
require
(
'ssp.class.php'
);
36.
37.
38.
echo
json_encode(
39.
SSP::simple(
$_GET
,
$sql_details
,
$table
,
$primaryKey
,
$columns
)
40.
);