· 5 years ago · Aug 17, 2020, 01:46 AM
1//**************************************************Cau hinh *************************************//
2var AddressUrl = document.location.protocol +'//'+ document.location.host; //Lay ten domain
3//*********************************************** End cau hinh **************************************//
4//***************************************************Xoa hoc phan***********************//
5function DeleteHocPhanDangKi(MaHocPhan, intLoai) {
6 ProgressShow();
7 var mypath = AddressUrl;
8 try {
9 var kt = confirm('Xác nhận xóa học phần vừa chọn ?')
10 if (kt) {
11 $.ajax({
12 type: 'GET',
13 url: mypath + '/Home/DeleteHocPhanDangKi/' + MaHocPhan + "?t=" + Math.random(),
14 async: true,
15 dataType: 'html',
16 success: function (html) {
17 DanhSachHocPhanDaDangKi(intLoai);
18 ProgressHide();
19 DialogAlert("Thông báo", html, "info");
20 },
21 })
22 .fail(
23 function (jqXHR, textStatus, err) {
24 ProgressHide();
25 DialogAlert("Lỗi kết nối", "Vui lòng đăng nhập lại !", "error");
26 });
27 }
28 else {
29 ProgressHide();
30 }
31 }
32 catch (err_) {
33 ProgressHide();
34 }
35}
36
37function XoaHocPhan(MaHocPhan) {
38 ProgressShow();
39 var mypath = AddressUrl;
40 try {
41 $.ajax({
42 type: 'GET',
43 url: mypath + '/DangKiThanhCong/DeleteHocPhan/' + MaHocPhan + "?t=" + Math.random(),
44 async: true,
45 dataType: 'html',
46 success: function (html) {
47 DanhSachHocPhanDaDangKi();
48 ProgressHide();
49 DialogAlert("Thông báo", html, "info");
50 },
51 })
52 .fail(
53 function (jqXHR, textStatus, err) {
54 ProgressHide();
55 DialogAlert("Lỗi kết nối", "Kết nối không thành công :"+ err, "error");
56 });
57 }
58 catch (err_) {
59 ProgressHide();
60 }
61
62}
63//********************************************** Danh sach hoc phan da dang ki ********************************//
64function DanhSachHocPhanDaDangKi() {
65 var mypath = AddressUrl;
66 $("#DanhSachHocPhanDaDangKi").html('Đang tải dử liệu ....');
67 var url_ = '/dangkithanhcong'; //KiemTraLoaiDangKi(loai);
68 try{
69 $.ajax({
70 type: 'GET',
71 url: mypath + url_ + "?t=" + Math.random(),
72 async: true,
73 dataType: 'html',
74 success: function (html) {
75 jQuery("#DanhSachHocPhanDaDangKi").html(html);
76 },
77 })
78 .fail(
79 function (jqXHR, textStatus, err) {
80 $('#DanhSachHocPhanDaDangKi').text('Thời gian chờ quá lâu vui lòng đăng nhập lại ! ');
81 DialogAlert("Thông báo", "Thời gian chờ quá lâu vui lòng đăng nhập lại ! ", "error");
82 });
83 }
84 catch (err_) {
85 $('#DanhSachHocPhanDaDangKi').text('Lỗi xảy ra : ' + err_);
86 }
87}
88
89//************************************************** AjaxChonMonHocNhanVien.cshtml **********************************************************//
90function GetdanhsachmonNhanVien(StudyUnitID) {
91 ProgressShow();
92 $('#DanhSachChon').show('1000');
93 var mypath = AddressUrl;
94 jQuery("#DanhSachChon").html("Đang tải dử liệu .....");
95 $.ajax({
96 type: 'GET',
97 url: mypath + '/NhanVien/AjaxChonMonHocNhanVien?StudyUnitID=' + StudyUnitID + '&StudentID=' + '&t=' + Math.random(),
98 async: true,
99 dataType: 'html',
100 success: function (html) {
101 jQuery("#DanhSachChon").html(html);
102 $("#DanhSachLop").hide("1000")
103 ProgressHide();
104 }
105 })
106.fail(
107 function (jqXHR, textStatus, err) {
108 $('#DanhSachChon').text('Error: ' + err);
109 ProgressHide();
110 DialogAlert("Lỗi kết nối","Thời gian chờ quá lâu .Vui lòng đăng nhập lại !", "error");
111 });
112}
113function ShowHide_NV() {
114 $('#DanhSachLop').show('1000');
115 $('#DanhSachChon').hide('1000');
116}
117function GetdanhsachhocphanNhanVien() {
118 ProgressShow(); jQuery("#DanhSachLop").html("Đang tải dử liệu....");
119 var Loai = $('input[name=radioDK]:checked').val();
120 var StudyProgramID = $("#dllStudyProgrameID").val();
121 var mypath = AddressUrl;
122 $.ajax({
123 type: 'GET',
124 url: mypath + '/NhanVien/AjaxDanhSachHocPhan/' + StudyProgramID + '?LoaiDK='+Loai+'&t=' + Math.random(),
125 async: true,
126 dataType: 'html',
127 success: function (html) {
128 jQuery("#DanhSachLop").html(html);
129 ShowHide_NV();
130 ProgressHide();
131 }
132 })
133.fail(
134 function (jqXHR, textStatus, err) {
135 $('#DanhSachLop').text('Error: ' + err);
136 ProgressHide();
137 DialogAlert("Lỗi kết nối", "Thời gian chờ quá lâu .Vui lòng đăng nhập lại !", "error");
138 });
139}
140//************************************************** AjaxChonMonHocNhanVien.cshtml **********************************************************//
141
142//************************************************** AjaxChonMonHoc.cshtml **********************************************************//
143function AjaxDangKiHocPhan() {
144 ProgressShow();
145 var mypath = AddressUrl;
146 var hideval = $('#chk_hidden').val();
147 var StudyUnitID = $('#StudyUnitID').val();
148 var CurriculumID = $('#CurriculumID').val();
149 $.ajax({
150 type: 'GET',
151 url: mypath + '/DangKiHocPhan?StudyUnitID=' + StudyUnitID + '&CurriculumID=' + CurriculumID + '&Hide=' + hideval + '&t=' + Math.random(),
152 async: true,
153 dataType: 'html',
154 success: function (html) {
155 DanhSachHocPhanDaDangKi();
156 ProgressHide();
157 DialogAlert("Thông báo", html, "info");
158
159 }
160 })
161.fail(
162 function (jqXHR, textStatus, err) {
163 ProgressHide();
164 DialogAlert("Lỗi kết nối", "Vui lòng đăng nhập lại !"+ err, "error");
165
166 });
167}
168
169function doSubmit() {
170 document.forms.Frm.hdID.value = "";
171 for (var i = 0; i < document.forms.Frm.elements.length; i++) {
172 if (document.forms.Frm.elements[i].type == "radio") {
173 if (document.forms.Frm.elements[i].checked == true) {
174 document.forms.Frm.hdID.value += document.forms.Frm.elements[i].id + "|";
175 }
176 }
177 }
178}
179function doSubmit_2() {
180 document.forms.frmform.hdID.value = "";
181 for (var i = 0; i < document.forms.frmform.elements.length; i++) {
182 if (document.forms.frmform.elements[i].type == "radio") {
183 if (document.forms.frmform.elements[i].checked == true) {
184 document.forms.frmform.hdID.value += document.forms.frmform.elements[i].id + "|";
185 }
186 }
187 }
188}
189function doSubmit_check() {
190 document.forms.Frm.chk_hidden.value = "";
191 for (var i = 0; i < document.forms.Frm.elements.length; i++) {
192 if (document.forms.Frm.elements[i].type == "checkbox") {
193 if (document.forms.Frm.elements[i].checked == true) {
194 document.forms.Frm.chk_hidden.value += document.forms.Frm.elements[i].id + "|";
195 }
196 }
197 }
198}
199
200function Close() {
201 window.close();
202}
203//Submit ajax
204function ShowHide() {
205 $('#DanhSachLop').show('200');
206 $('#DanhSachChon').hide('200');
207 $('#lblthongbao').hide();
208}
209
210//************************************************** END AjaxChonMonHoc.cshtml **********************************************************//
211//************************************************** AjaxChonMonHocCaiThien.cshtml **********************************************************//
212function AjaxDangKiHocPhanCaiThien_() {
213 ProgressShow();
214 var mypath = AddressUrl;
215 var hideval = $('#hdID').val();
216 var StudyUnitID = $('#StudyUnitID').val();
217 $.ajax({
218 type: 'GET',
219 url: mypath + '/Home/AjaxDangKiHocPhanCaiThien?StudyUnitID=' + StudyUnitID + '&Hide=' + hideval + '&t=' + Math.random(),
220 async: true,
221 dataType: 'html',
222 success: function (html) {
223 DanhSachHocPhanDaDangKi(3);
224 ProgressHide();
225 DialogAlert("Thông báo", html, "info");
226 },
227 })
228.fail(
229 function (jqXHR, textStatus, err) {
230 ProgressHide();
231 DialogAlert("Lỗi kết nối ", "Thời gian chờ quá lâu .Vui lòng đăng nhập lại !", "error");
232 });
233}
234
235//************************************************** END AjaxChonMonHocCaiThien.cshtml **********************************************************//
236//************************************************** AjaxChonMonHocHocLai.cshtml **********************************************************//
237function AjaxDangKiHocPhanHocLai() {
238 ProgressShow();
239 var mypath = AddressUrl;
240 var hideval = $('#hdID').val();
241 var StudyUnitID = $('#StudyUnitID').val();
242 $.ajax({
243 type: 'GET',
244 url: mypath + '/Home/AjaxDangKiHocPhanHocLai?StudyUnitID=' + StudyUnitID + '&Hide=' + hideval + '&t=' + Math.random(),
245 async: true,
246 dataType: 'html',
247 success: function (html) {
248 DanhSachHocPhanDaDangKi('');
249 ProgressHide();
250 DialogAlert("Thông báo", html, "info");
251 },
252 })
253.fail(
254 function (jqXHR, textStatus, err) {
255 DialogAlert("Lỗi kết nối ", "Thời gian chờ quá lâu .Vui lòng đăng nhập lại !", "error");
256 document.getElementById('id_div_loading_admin').style.display = 'none';
257 });
258}
259//************************************************** ENd AjaxChonMonHocHocLai.cshtml **********************************************************//
260
261//************************************************** Begin DangKiHocCaiThien.cshtml **********************************************************//
262function GetdanhsachmonCaiThien(StudyUnitID) {
263 ProgressShow();
264 $('#DanhSachChon').show('1000');
265 var mypath = AddressUrl;
266 jQuery("#DanhSachChon").html("Đang tải dử liệu .....");
267 $.ajax({
268 type: 'GET',
269 url: mypath + '/Home/AjaxChonMonHocCaiThien?StudyUnitID=' + StudyUnitID + '&StudentID=' + '&t=' + Math.random(),
270 async: true,
271 dataType: 'html',
272 success: function (html) {
273 jQuery("#DanhSachChon").html(html);
274 $("#DanhSachLop").hide("1000")
275 ProgressHide();
276 },
277 })
278.fail(
279 function (jqXHR, textStatus, err) {
280 ProgressHide();
281 DialogAlert("Lỗi kết nối", "Thời gian chờ quá lâu .Vui lòng đăng nhập lại !", "error");
282 });
283}
284//************************************************** End DangKiHocCaiThien.cshtml **********************************************************//
285//************************************************** Begin DangKiHocLai.cshtml **********************************************************//
286function Getdanhsachmonhoclai(StudyUnitID) {
287 ProgressShow();
288 $('#DanhSachChon').show('1000');
289 var mypath = AddressUrl;
290 jQuery("#DanhSachChon").html("Đang tải dử liệu .....");
291 $.ajax({
292 type: 'GET',
293 url: mypath + '/Home/AjaxChonMonHocHocLai?StudyUnitID=' + StudyUnitID + '&StudentID=' + '&t=' + Math.random(),
294 async: true,
295 dataType: 'html',
296 success: function (html) {
297 jQuery("#DanhSachChon").html(html);
298 $("#DanhSachLop").hide("1000")
299 ProgressHide();
300 },
301 })
302.fail(
303 function (jqXHR, textStatus, err) {
304 ProgressHide();
305 DialogAlert("Lỗi kêt nối", "Thời gian chờ quá lâu .Vui lòng đăng nhập lại !", "error");
306 });
307}
308//************************************************** End DangKiHocLai.cshtml **********************************************************//
309//************************************************** End DangKiTheoKeHoach.cshtml**********************************************************//
310function Getdanhsachmon(StudyUnitID) {
311 ProgressShow();
312 $('#DanhSachChon').show('1000');
313 var mypath = AddressUrl;
314 jQuery("#DanhSachChon").html("Đang tải dử liệu .....");
315 $.ajax({
316 type: 'GET',
317 url: mypath + '/Home/AjaxChonMonHoc?StudyUnitID=' + StudyUnitID + '&StudentID=' + '&t=' + Math.random(),
318 async: true,
319 dataType: 'html',
320 success: function (html) {
321 jQuery("#DanhSachChon").html(html);
322 $("#DanhSachLop").hide("1000")
323 ProgressHide();
324 }
325 })
326.fail(
327 function (jqXHR, textStatus, err) {
328 $('#DanhSachChon').text("Thời gian chờ quá lâu .Vui lòng refesh lại website");
329 ProgressHide();
330 DialogAlert("Lỗi kết nối","Thời gian chờ quá lâu .Vui lòng đăng nhập lại !","error");
331 });
332}
333//************************************************** End DangKiTheoKeHoach.cshtml **********************************************************//
334//************************************************** AjaxDanhSachHocPhanDangKiLai.cshtml **********************************************************//
335function AjaxChonHocPhanDangKiLai(StudyUnitID,ScheduleStudyUnit) {
336 ProgressShow();
337 $('#DanhSachChon').show('1000');
338 var mypath = AddressUrl;
339 $.ajax({
340 type: 'GET',
341 url: mypath + '/Home/AjaxDanhSachHocPhanDangKiLai?StudyUnitID=' + StudyUnitID +'&ScheduleStudyUnit=' + ScheduleStudyUnit + '&t=' + Math.random(),
342 async: true,
343 dataType: 'html',
344 success: function (html) {
345 jQuery("#DanhSachChon").html(html);
346 $("#DanhSachLop").hide("1000")
347 ProgressHide();
348 },
349 })
350.fail(
351 function (jqXHR, textStatus, err) {
352 ProgressHide();
353 DialogAlert("Lỗi kết nối ", err, "error");
354 });
355}
356function AjaxDangKiHocPhanTre() {
357 ProgressShow();
358 var mypath = AddressUrl;
359 var hideval = $('#chk_hidden').val();
360 var StudyUnitID = $('#StudyUnitID').val();
361 var OldScheduleStudyUnit = $('#ScheduleStudyUnitOld').val();
362 $.ajax({
363 type: 'GET',
364 url: mypath + '/DangKiTre/AjaxLuuHocPhanDangKiTre?StudyUnitID=' + StudyUnitID + '&Hide=' + hideval + '&OldScheduleStudyUnit=' + OldScheduleStudyUnit + '&t=' + Math.random(),
365 async: true,
366 dataType: 'html',
367 success: function (html) {
368 DanhSachHocPhanDaDangKi(1);
369 ProgressHide();
370 DialogAlert("Thông báo", html, "info");
371
372 }
373 })
374.fail(
375 function (jqXHR, textStatus, err) {
376 ProgressHide();
377 DialogAlert("Lỗi kết nối", err, "error");
378
379 });
380}
381//************************************************** END AjaxDanhSachHocPhanDangKiLai.cshtml **********************************************************//
382
383//************************************************** Dialog Jquery ui ***********************************************//
384function DialogAlert(Title, Messages, type) { //type : '',error,info,question,warning
385 $.messager.alert(Title, Messages,type);
386}
387//confirm delete dialog :
388function ConfirmDelete(MaHocPhan) {
389 $.messager.confirm("Lưu ý ", "Bạn có muốn xóa học phần '"+MaHocPhan+"' không ?", function (r) {
390 if (r) {
391 XoaHocPhan(MaHocPhan);
392 }
393 else {
394 //false
395 }
396 });
397}
398function ConfirmAlert(thongbao) {
399 $.messager.confirm("Lưu ý ", thongbao, function (r) {
400 if (r) {
401 return true;
402 }
403 else {
404 return false
405 }
406 });
407}
408
409function AlertMessage(thongbao) {
410 $.messager.alert("Thông báo", thongbao, function (r) {
411 if (r) {
412 return true;
413 }
414 else {
415 return false
416 }
417 });
418}
419
420//Show progresss , show screen right-botton
421
422function Slide(Title_,Messages,time) {//Hien thị goc phai bên duoi man minh trong time giay .
423 $.messager.show({
424 title: Title_,
425 msg: Messages,
426 timeout: time,
427 showType: 'slide'
428 });
429}
430function Fade(Title_, Messages) { //Hien thi như slide nhưng ko tự động close
431 $.messager.show({
432 title: Title_,
433 msg:Messages,
434 timeout: 0,
435 showType: 'fade'
436 });
437}
438function ProgressShow() {
439 var win = $.messager.progress({
440 title: 'Please waiting...',
441 msg: 'Đang xử lý . vui lòng đợi ...',
442 interval: 4000
443 });
444}
445function ProgressHide() {
446 $.messager.progress('close');
447}
448//************************************************** End Dialog Jquery ui ***********************************************//
449//************************************************** Ajax load hoc ky ***********************************************//
450
451function GetThongTinCTDT() {
452 var mypath = AddressUrl;
453 ProgressShow();
454 $("#content_CTDT").html('');
455 var MaHK = $("#ddlHocKy").val();
456 var TenHK = $("#ddlHocKy :selected").text();
457 var url_ = '/ChuongTrinhDaoTao/AjaxIndex'; //KiemTraLoaiDangKi(loai);
458 try {
459 $.ajax({
460 type: 'GET',
461 url: mypath + url_ +'?MaHK='+MaHK+'&TenHK='+TenHK +'&t=' + Math.random(),
462 async: true,
463 dataType: 'html',
464 success: function (html) {
465 jQuery("#content_CTDT").html(html);
466 ProgressHide();
467 },
468 })
469 .fail(
470 function (jqXHR, textStatus, err) {
471 $('#content_CTDT').text("Thời gian chờ quá lâu vui lòng đăng nhập lại !");
472 ProgressHide();
473 });
474 }
475 catch (err_) {
476 $('#content_CTDT').text('Lỗi xảy ra : ' + err_);
477 ProgressHide();
478 }
479}
480//************************************************** END Ajax load hoc ky ***********************************************//
481/*************************************************** PHẦN NÀY CHO UTE ****************************************************/
482function PopupDanhSachLop(StudyUnitID, CurriculumID) {
483 window.open(AddressUrl + '/' + 'DangKiNgoaiKeHoach/DanhSachLopHocPhan/' + StudyUnitID + "?CurriculumID=" + CurriculumID + "&t=" + Math.random(), '_blank', 'scrollbars=1,status=1,width=800,height=600,');
484}
485function PopupDanhSachLopTheoNhom(StudyUnitID, CurriculumID) {
486 window.open(AddressUrl + '/' + 'DangKiNgoaiKeHoachPhanNhom/DanhSachLopHocPhanTheoNhom/' + StudyUnitID + "?CurriculumID=" + CurriculumID + "&t=" + Math.random(), '_blank', 'scrollbars=1,status=1,width=800,height=600,');
487}
488function PopupDanhSachLopDKT(StudyUnitID , ScheduleStudyUnit) {//Đang ký trể
489 window.open(AddressUrl + '/' + 'DangKiTre/index/?StudyUnitID=' + StudyUnitID + "&ScheduleStudyUnit=" + ScheduleStudyUnit + "&t=" + Math.random(), '_blank', 'scrollbars=1,status=1,width=900,height=600,');
490}
491function PopupThongbaoKhan() {
492 window.open(AddressUrl + '/' + 'Home/Thongbao?t=' + Math.random(), '_blank', 'scrollbars=1,status=1,width=900,height=600,');
493}
494function PupupWindow() {
495}
496/*************************************************** Lấy kết quả học tập *****************************************************/
497function Getketquahoctap() {
498 var StudyProgram = $('#StudyProgram').val();
499 var YearStudy = $('#YearStudy').val();
500 var TermID = $('#TermID').val();
501 var Mark = $('#Mark').val();
502 var mypath = AddressUrl;
503 jQuery("#divHienthiKQHT").html("<b style='color:red'>Đang tải dử liệu .....</b>");
504 $.ajax({
505 type: 'GET',
506 url: mypath + '/KetQuaHocTap/HienThiKetQua?StudyProgram=' + StudyProgram + '&YearStudy=' + YearStudy + '&TermID=' + TermID + '&Mark=' + Mark + '&t=' + Math.random(),
507 async: true,
508 dataType: 'html',
509 success: function (html) {
510 jQuery("#divHienthiKQHT").html(html);
511 },
512 })
513.fail(
514 function (jqXHR, textStatus, err) {
515 ProgressHide();
516 DialogAlert("Lỗi kết nối", "Vui lòng đăng nhập lại !", "error");
517 });
518}
519
520function GetChuongTrinhDTChuaTichLuy() {
521 var StudyProgram = $('#StudyProgram').val();
522 var YearStudy = $('#YearStudy').val();
523 var TermID = $('#TermID').val();
524 var Mark = $('#Mark').val();
525 var mypath = AddressUrl;
526 jQuery("#divHienChuongTrinhDaoTaoChuaTichLuy").html("<b style='color:red'>Đang tải dử liệu .....</b>");
527 $.ajax({
528 type: 'GET',
529 url: mypath + '/KetQuaHocTap/GetChuongTrinhDTChuaTichLuy?StudyProgram=' + StudyProgram + '&YearStudy=' + YearStudy + '&TermID=' + TermID + '&Mark=' + Mark + '&t=' + Math.random(),
530 async: true,
531 dataType: 'html',
532 success: function (html) {
533 jQuery("#divHienChuongTrinhDaoTaoChuaTichLuy").html(html);
534 },
535 })
536.fail(
537 function (jqXHR, textStatus, err) {
538 ProgressHide();
539 DialogAlert("Lỗi kết nối", "Vui lòng đăng nhập lại !", "error");
540 });
541}
542
543
544//Xem CTDT
545function XemDiemTheoChuongTrinhDaoTao() {
546 var StudyProgram = $('#StudyProgram').val();
547 var mypath = AddressUrl;
548 jQuery("#divHienThiDiemTheoChuongTrinh").html("<b style='color:red'>Đang tải dử liệu .....</b>");
549 $.ajax({
550 type: 'GET',
551 url: mypath + '/KetQuaHocTap/XemDiemTheoChuongTrinhDaoTao?StudyProgram=' + StudyProgram + '&t=' + Math.random(),
552 async: true,
553 dataType: 'html',
554 success: function (html) {
555 jQuery("#divHienThiDiemTheoChuongTrinh").html(html);
556
557 },
558 })
559.fail(
560 function (jqXHR, textStatus, err) {
561 ProgressHide();
562 DialogAlert("Lỗi kết nối", "Vui lòng đăng nhập lại !", "error");
563 });
564}
565
566function KiemtrachontatcaNamHoc() {
567 var YearStudy = $('#YearStudy').val();
568 if (YearStudy == "0") {
569 document.getElementById("TermID").value = "0";
570 document.getElementById("TermID").disabled = true;
571 }
572 else {
573 document.getElementById("TermID").disabled = false;
574 }
575}
576
577function PopupChiTietDiem(StudyUnitID) {//Đang ký trể
578 window.open(AddressUrl + '/' + 'KetQuaHocTap/DiemChiTiet/' + StudyUnitID + "?t=" + Math.random(), '_blank', 'scrollbars=1,status=1,width=700,height=500,');
579}
580/*************************************************** End Lấy kết quả học tập *****************************************************/
581/*************************************************** Lay Thoi Khoa Bieu *****************************************************/
582function GetThoiKhoaBieu() {
583 ProgressShow();
584 var mypath = AddressUrl;
585 var YearStudy = $('#YearStudy').val();
586 var TermID = $('#TermID').val();
587 var Week = $('#Week').val();
588 var typeID = $('#TypeID').val();
589 var adr = mypath + '/ThoiKhoaBieu/HienthiTKB?YearStudy=' + YearStudy + '&TermID=' + TermID + '&Week=' + Week + '&t=' + Math.random();
590 if (typeID == "1")
591 adr = mypath + '/ThoiKhoaBieu/HienthiTKBTheoMon?YearStudy=' + YearStudy + '&TermID=' + TermID + '&Week=' + Week + '&t=' + Math.random();
592 jQuery("#divThoiKhoiBieu").html("<b style='color:red'>Đang tải dử liệu .....</b>");
593 $.ajax({
594 type: 'GET',
595 url: adr,
596 async: true,
597 dataType: 'html',
598 success: function (html) {
599 jQuery("#divThoiKhoiBieu").html(html);
600 ProgressHide();
601 },
602 })
603.fail(
604 function (jqXHR, textStatus, err) {
605 ProgressHide();
606 DialogAlert("Lỗi kết nối", "Vui lòng refesh lại website !", "error");
607 });
608}
609/*************************************************** End Lay Thoi Khoa Bieu *****************************************************/
610/*************************************************** Lay Lich thi *****************************************************/
611function GetLichThi() {
612 ProgressShow();
613 var mypath = AddressUrl;
614 var YearStudy = $('#ddlYearStudy').val();
615 var TermID = $('#dllTermID').val();
616 var adr = mypath + '/LichThi/HienThiKetQua?YearStudy=' + YearStudy + '&TermID=' + TermID + '&t=' + Math.random();
617 jQuery("#divHienthilichthi").html("<b style='color:red'>Đang tải dử liệu .....</b>");
618 $.ajax({
619 type: 'GET',
620 url: adr,
621 async: true,
622 dataType: 'html',
623 success: function (html) {
624 jQuery("#divHienthilichthi").html(html);
625 ProgressHide();
626 },
627 })
628.fail(
629 function (jqXHR, textStatus, err) {
630 ProgressHide();
631 DialogAlert("Lỗi kết nối", "Vui lòng refesh lại website !", "error");
632 });
633}
634/*************************************************** End Lay Lich Thi *****************************************************/
635/*************************************************** Lay tai khoan sinh vien *****************************************************/
636function GetTaiKhoanSinhVien() {
637 ProgressShow();
638 var mypath = AddressUrl;
639 var YearStudy = $('#ddlYearStudy').val();
640 var TermID = $('#dllTermID').val();
641 var adr = mypath + '/TaiKhoanSinhVien/HienThiTaiKhoan?YearStudy=' + YearStudy + '&TermID=' + TermID + '&t=' + Math.random();
642 jQuery("#divHienThiTK").html("<b style='color:red'>Đang tải dử liệu .....</b>");
643 $.ajax({
644 type: 'GET',
645 url: adr,
646 async: true,
647 dataType: 'html',
648 success: function (html) {
649 jQuery("#divHienThiTK").html(html);
650 ProgressHide();
651 },
652 })
653.fail(
654 function (jqXHR, textStatus, err) {
655 ProgressHide();
656 DialogAlert("Lỗi kết nối", "Vui lòng refesh lại website !", "error");
657 });
658}
659/*************************************************** End tai khoan sinh vien *****************************************************/
660
661
662/*************************************************** END PHẦN NÀY CHO UTE ****************************************************/
663/**********************************/
664function AnhiendsChon(machon) {
665 if (machon == 0 || machon == 1) {
666 $('#ddldsChon').hide();
667 $('#txtFilter').show();
668 }
669 else {
670 $('#ddldsChon').show();
671 $('#txtFilter').hide();
672 Getketselectoption(machon);
673 }
674}
675/*********************************/
676function Getketselectoption(id) {
677 ProgressShow();
678 //var id = $('#dsLoai').val();
679 var mypath = AddressUrl;
680 $.ajax({
681 type: 'GET',
682 url: mypath + '/DangKiTheokeHoach/AjaxDschon?id=' + id + '&t=' + Math.random(),
683 async: true,
684 dataType: 'html',
685 success: function (html) {
686 jQuery("#ddldsChon").html(html);
687 ProgressHide();
688 },
689 })
690.fail(
691 function (jqXHR, textStatus, err) {
692 ProgressHide();
693 DialogAlert("Lỗi kết nối", "Thời gian chờ quá lâu .Vui lòng đăng nhập lại !", "error");
694 });
695}
696
697function Checklichmacdinh() {
698 var Ischeck = $('#chkcheck').attr('checked') ? "True" : "False";
699 if (Ischeck == "True") {
700 $('#btnFilter').hide();
701 }
702 else {
703 $('#btnFilter').show();
704 }
705}
706
707function AjaxDanhSachLopTheoKeHoach() {
708 ProgressShow();
709 var Type = $('#dsLoai').val();
710 var ddldsChon = $('#ddldsChon').val();
711 var txtFilter = $('#txtFilter').val();
712 var mypath = AddressUrl;
713 jQuery("#divHienthiKQHT").html("<b style='color:red'>Đang tải dử liệu .....</b>");
714 $.ajax({
715 type: 'GET',
716 url: mypath + '/DangKiTheoKeHoach/AjaxDanhSachLop?type=' + Type + '&class=' + ddldsChon + '&search=' + txtFilter + '&t=' + Math.random(),
717 async: true,
718 dataType: 'html',
719 success: function (html) {
720 jQuery("#divHienthiKQHT").html(html);
721 ProgressHide();
722 },
723 })
724.fail(
725 function (jqXHR, textStatus, err) {
726 ProgressHide();
727 DialogAlert("Lỗi kết nối", "Thời gian chờ quá lâu .Vui lòng đăng nhập lại !", "error");
728 });
729}
730
731function GetIDButton_Click(val) {
732 document.getElementById("buttonID").value = val;
733
734}
735
736/************************************************** API **********************************************************/
737var apiUrl = AddressUrl+'/ThoiKhoaBieu/GetTuanTheoNamHocHocKy';
738
739function LoadWeek() {
740 var NamHoc = $('#YearStudy').val();
741 var HocKy = $('#TermID').val();
742 var i = 0;
743 // Send an AJAX request
744 $.getJSON(apiUrl + "/" + NamHoc + "$" + HocKy)
745 .done(function (data) {
746 $("#Week").empty();
747 // On success, 'data' contains a list of products.
748 $.each(data, function (key, item) {
749 // Add a list item for the product.
750 $("<option value=" + item.Week + ">" + item.DisPlayWeek + " </option>").appendTo($('#Week'));
751 });
752 GetThoiKhoaBieu();
753 });
754}
755
756function GetHistoryLog() {
757 ProgressShow();
758 var mypath = AddressUrl;
759 //var YearStudy = $('#YearStudy').val();
760 //var TermID = $('#TermID').val();
761 var adr = mypath + '/GetLog/GetHistory';
762
763 jQuery("#divHistoryLog").html("<b style='color:red'>Đang tải dử liệu .....</b>");
764 $.ajax({
765 type: 'GET',
766 url: adr,
767 async: true,
768 dataType: 'html',
769 success: function (html) {
770 jQuery("#divHistoryLog").html(html);
771 ProgressHide();
772 },
773 })
774.fail(
775 function (jqXHR, textStatus, err) {
776 ProgressHide();
777 DialogAlert("Lỗi kết nối", "Vui lòng refesh lại website !", "error");
778 });
779}
780
781
782
783