01.
<form id=
"form1"
action=
"process.php"
method=
"post"
>
02.
<table id=
"example"
class
=
"table table-bordered table-hover"
>
03.
04.
<thead>
05.
<tr>
06.
<th>No</th>
07.
<th>Code</th>
08.
<th>Description</th>
09.
<th>Action</th>
10.
</tr>
11.
</thead>
12.
<tbody>
13.
<?php
14.
$sql
=
"SELECT count(id_data ) FROM t_data WHERE (name = '$name') "
;
15.
$query
=odbc_exec(
$link
,
$sql
);
16.
$num
=odbc_result(
$query
,1);
17.
18.
$sql_a
=
"SELECT * FROM t_data WHERE (name = '$name') "
;
19.
$query1
=odbc_exec(
$link
,
$sql_a
);
20.
for
(
$p
=1;
$p
<=
$num
;
$p
++) {
21.
$rows
=odbc_fetch_array(
$query1
);
22.
$id
=
$rows
[
'id'
];
23.
$id_a
=
$rows
[
'id_a'
];
24.
$txt
=
$rows
[
'txt'
];
25.
$name
=
$rows
[
'name'
];
26.
?>
27.
<tr>
28.
<td> </td>
29.
<td><?php
echo
$id
; ?></td>
30.
<td><?php
echo
$name
; ?></td>
31.
<td align =
"center"
><input type=
"checkbox"
name=
"r2[]"
id=
"r2[]"
value=
"<?php echo $id_a; ?>"
></td>
32.
<input type=
"hidden"
name=
"user"
id=
"user"
value=
"<?php echo $user; ?>"
>
33.
</tr>
34.
<?php
35.
}
36.
?>
37.
</tbody>
38.
</table>
39.
<button type=
"submit"
id=
"submit"
name=
"submit"
class
=
"btn btn-success "
>
40.
</form>
41.
<script>
42.
$(
function
() {
43.
$(
'#example'
).DataTable({
44.
"paging"
: true,
45.
"lengthChange"
: false,
46.
"searching"
: false,
47.
"ordering"
: true,
48.
"info"
: true,
49.
"autoWidth"
: false,
50.
"responsive"
: true,
51.
52.
});
53.
54.
});
55.
</script>