-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuniversal_js.js
175 lines (156 loc) · 5.1 KB
/
universal_js.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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
function addCourse(button) {
var id = parseInt(button.id, 10);
var table = document.getElementById("table");
var rowCollection = table.rows.item(id).cells;
var courseSlot = rowCollection.item(4).innerText;
var course_id = rowCollection.item(1).innerText;
$.ajax({
type: "POST",
url: "insert2.php",
data: {query: 'select * from courses', add_course: "1", course_id: course_id, course_slot: courseSlot},
success: function (OUTPUT) {
alert(OUTPUT);
OUT = OUTPUT;
},
complete: function () {
}
});
}
function dropCourse(button) {
var id = parseInt(button.id, 10);
var table = document.getElementById("table");
var rowCollection = table.rows.item(id).cells;
var course_id = rowCollection.item(1).innerText;
//alert(course_id);
$.ajax({
type: "POST",
url: "drop_s_course.php",
data: {query: 'select * from courses', drop_course: "1", course_id: course_id},
success: function (OUTPUT) {
OUT = OUTPUT;
alert("drop success")
},
complete: function () {
}
});
}
function studentTranscript() {
var id = document.getElementById("course_id").value;
// alert(id.value);
$.ajax({
type: "POST",
url: "studentTranscript.php",
data: {student_id: id},
success: function (OUTPUT) {
// alert(OUTPUT);
OUT = OUTPUT;
},
complete: function () {
document.getElementById("studentTranscriptTable").innerHTML = OUT;
}
});
console.log(id);
}
function ticketApprove(button) {
var button_id = parseInt(button.id, 10);
var table = document.getElementById("table-ticket-faculty");
// alert(table.id);
var rowCollection = table.rows.item(button_id).cells;
var student_id = rowCollection.item(1).innerText;
var faculty_id = rowCollection.item(2).innerText;
var course_id = rowCollection.item(3).innerText;
console.log(student_id + " " + faculty_id + " " + course_id);
$.ajax({
type: "POST",
url: "faculty_tick_a.php",
data: {student_id: student_id, faculty_id: faculty_id, course_id: course_id},
success: function (OUTPUT) {
//alert(OUTPUT);
OUT = OUTPUT;
button.closest('tr').remove();
alert(OUTPUT);
},
complete: function () {
}
});
}
function ticketDisapprove(button) {
var button_id = parseInt(button.id, 10);
var table = document.getElementById("table-ticket-faculty");
// alert(table.id);
var rowCollection = table.rows.item(button_id).cells;
var student_id = rowCollection.item(1).innerText;
var faculty_id = rowCollection.item(2).innerText;
var course_id = rowCollection.item(3).innerText;
console.log(student_id + " " + faculty_id + " " + course_id);
$.ajax({
type: "POST",
url: "faculty_tick_da.php",
data: {student_id: student_id, faculty_id: faculty_id, course_id: course_id},
success: function (OUTPUT) {
alert(OUTPUT);
OUT = OUTPUT;
},
complete: function () {
}
});
}
function D_TicketDisapprove(button) {
var button_id = parseInt(button.id, 10);
var table = document.getElementById("table-ticket-faculty");
// alert(table.id);
var rowCollection = table.rows.item(button_id).cells;
var student_id = rowCollection.item(1).innerText;
var faculty_id = rowCollection.item(2).innerText;
var course_id = rowCollection.item(3).innerText;
console.log(student_id + " " + faculty_id + " " + course_id);
$.ajax({
type: "POST",
url: "dean_tick_da.php",
data: {student_id: student_id, faculty_id: faculty_id, course_id: course_id},
success: function (OUTPUT) {
alert(OUTPUT);
OUT = OUTPUT;
},
complete: function () {
}
});
}
function D_ticketApprove(button) {
var button_id = parseInt(button.id, 10);
var table = document.getElementById("table-ticket-faculty");
// alert(table.id);
var rowCollection = table.rows.item(button_id).cells;
var student_id = rowCollection.item(1).innerText;
var faculty_id = rowCollection.item(2).innerText;
var course_id = rowCollection.item(3).innerText;
console.log(student_id + " " + faculty_id + " " + course_id);
$.ajax({
type: "POST",
url: "dean_tick_a.php",
data: {student_id: student_id, faculty_id: faculty_id, course_id: course_id},
success: function (OUTPUT) {
//alert(OUTPUT);
OUT = OUTPUT;
button.closest('tr').remove();
alert(OUTPUT);
},
complete: function () {
}
});
}
function viewCourses() {
var OUT;
$.ajax({
type: "POST",
url: "queryExecutor.php",
data: {query: 'select * from courses'},
success: function (OUTPUT) {
alert(OUTPUT);
OUT = OUTPUT;
},
complete: function () {
document.getElementById("thisdiv").innerHTML = OUT;
}
});
}