-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdvanced_Car.js
72 lines (65 loc) · 2.09 KB
/
Advanced_Car.js
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
$(document).ready(function () {
$('#infoTable').on('click', 'tbody tr', function (event) {
$(this).addClass('highlight').siblings().removeClass('highlight');
console.log(this);
$("td", this).each(function (j) {
console.log(j);
});
});
$("#filter-form").submit(function (event) {
$(".help-block").remove();
const formData = {
year: $('#year-filter').val(),
color: $('#color-filter').val(),
model: $('#model-filter').val(),
office: $('#office-filter').val(),
price: $('#price-filter').val(),
status: $('#status-filter').val(),
louza : $('#CarID').val(),
};
console.log(formData);
$.ajax({
type: "POST",
url: 'Advanced_Filter_Car.php',
data: formData,
dataType: "json",
encode: true,
})
.done(function (data) {
// console.log(data);
$('#infoTable').bootstrapTable({
toggle: true,
pagination: true,
striped: true,
pageSize: 10,
clickToSelect: true,
columns: [{
field: 'id',
title: 'Car_ID'
},{
field: 'm',
title: 'Model'
}, {
field: 'y',
title: 'Year'
}, {
field: 'c',
title: 'Color'
},{
field: 's',
title: 'Status'
},{
field: 'o',
title: 'Office ID'
},{
field: 'p',
title: 'price/day'
}],
data: data
});
})
.fail(function (data) {
});
event.preventDefault();
});
});