This repository was archived by the owner on Dec 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs.js
More file actions
101 lines (78 loc) · 2.58 KB
/
js.js
File metadata and controls
101 lines (78 loc) · 2.58 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//派發系統
function showModal() {
$('#category').modal('show');
}
function get_cat(id){
$('.btn-group .btn').click(function(){
var cat_id = '#cat_btn_' + id.toString();
var cat_status_id = '#cat_status_' + id.toString();
$(cat_id + ' button').html($(event.target).val());
if($(event.target).val() == '選擇分類'){
$('#cat_status_' + id.toString()).html('no');
$('#cat_status_' + id.toString()).css('color', 'red');
}
else{
$('#cat_status_' + id.toString()).html('yes');
$('#cat_status_' + id.toString()).css('color', 'green');
}
$('#category').modal('hide');
var cat_title_id = $('#cat_title_'+ id.toString()).text();
var cat_btn_id = $('#cat_btn_'+ id.toString()+' .btn').text()
id = 0;
cat_id = 0;
$.ajax({
type: "POST",
url: "cat_ajax.php",
data: {
'cat_title_id' : cat_title_id,
'cat_btn_id' : cat_btn_id,
},
dataType: "json",
error: function (xhr) {
//alert("錯誤"+xhr.responseText);
//return false;
},
success: function(data){
//alert(data.rcode);
}
});
})
}
$('.cat_btn').click(function(){
var id = $(event.target).val();
get_cat(id);
})
//search
function search(id){
$('.btn-group .btn').click(function(){
var search_title_id = '#search_title_' + id.toString();
var search_change_cat_btn_id = '#search_change_cat_btn_' + id.toString();
var search_title = $(search_title_id).text();
var search_change_cat = $(event.target).val();
$(search_change_cat_btn_id + ' button').html($(event.target).val());
$('#category').modal('hide');
id = 0
search_title_id = 0
search_change_cat_btn_id = 0
$.ajax({
type: "POST",
url: "search_ajax.php",
data: {
'search_title' : search_title,
'search_change_cat' : search_change_cat,
},
dataType: "json",
error: function (xhr) {
//alert("錯誤"+xhr.responseText);
//return false;
},
success: function(data){
//alert(data.rcode);
}
});
})
}
$('.search_change_cat_btn').click(function(){
var id = $(event.target).val();
search(id)
})