Skip to content
Snippets Groups Projects
Commit 256e79e4 authored by PavelBegunkov's avatar PavelBegunkov
Browse files

opt

parent 1f523a32
Branches
Tags
No related merge requests found
...@@ -3,27 +3,28 @@ $(function() { ...@@ -3,27 +3,28 @@ $(function() {
// Изменения базовых параметров дисциплины // Изменения базовых параметров дисциплины
$(".AddDiscipline").click(function(){ $(".AddDiscipline").click(function(){
$('.AddDiscipline').attr("disabled", "disabled"); $(this).attr("disabled", true);
var BonusRate = $(".BonusRate").prop("checked"); var main = $(".main_content");
var BonusRate = main.find(".BonusRate").prop("checked");
$.post( $.post(
URLdir + 'handler/map/AddDiscipline', URLdir + 'handler/map/AddDiscipline',
{ {
'Grade': $('.SelectGrade').val(), 'Grade': main.find('.SelectGrade').val(),
'SubjectID': $('.SelectSubject').val(), 'SubjectID': main.find('.SelectSubject').val(),
'BonusRate': BonusRate, 'BonusRate': BonusRate,
'ExamType': $('input:radio[name=ExamType]:checked').val(), 'ExamType': main.find('input:radio[name=ExamType]:checked').val(),
'LectionCount': $('.InputLectionCount').val(), 'LectionCount': main.find('.InputLectionCount').val(),
'PracticeCount': $('.InputPracticeCount').val(), 'PracticeCount': main.find('.InputPracticeCount').val(),
'FacultyID': $('.SelectFaculty').val() 'FacultyID': main.find('.SelectFaculty').val()
}, },
function(data){ function(data){
data = $.parseJSON(data); data = $.parseJSON(data);
if(data.success === true) { if(data.success === true) {
$('.AddDiscipline').hide(); $(this).hide();
EventInspector_ShowMsg('Дисциплина добавлена', 'success'); EventInspector_ShowMsg('Дисциплина добавлена', 'success');
setTimeout('location.replace("'+URLdir+'discipline/structure/'+data.DisciplineID+'")',1000); setTimeout('location.replace("'+URLdir+'discipline/structure/'+data.DisciplineID+'")',1000);
} else { } else {
$(".AddDiscipline").removeAttr('disabled'); $(this).removeAttr('disabled');
EventInspector_ShowMsg('Ошибка при добавление дисциплины', 'error'); EventInspector_ShowMsg('Ошибка при добавление дисциплины', 'error');
} }
} }
......
...@@ -119,9 +119,4 @@ $(function() { ...@@ -119,9 +119,4 @@ $(function() {
} }
// if ($('div').is('.HiddenInputFacultyID'))
// {
// FacultyID = $('.HiddenInputFacultyID').val(); // Факультет, к которой привязана дисциплина
// $('.HiddenInputFacultyID').remove(); // Тут даже Шерлок Холмс бессилен
// }
}) })
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment