- •Постановка завдання
- •1. Опис використаних технологій
- •1.2. JavaScript
- •1.3. Jquery
- •1.4. Html
- •1.7. Ajax
- •2. Діаграми uml об’єктної моделі системи
- •2.1 Діаграма варіантів використання
- •2.2 Діаграма дій
- •2.3 Діаграма послідовності
- •2.4. Діаграма кооперацій
- •2.5. Діаграми класів
- •2.6. Діаграми станів
- •3. Опис програмної реалізації
- •3.1. Опис серверної частини проекту
- •3.2. Опис клієнтської частини проекту
- •If(!groupInfo.CheckError)
- •If(checkNullUndefined(group))
- •3.3 Реалізація бази даних
- •3.4. Опис реалізованого функціоналу
- •Висновок
- •Список використаної літератури:
- •If(checkNullUndefined(groupId))
- •If(!groupInfo.CheckError)
- •If(!groupInfo.CheckError)
- •If(checkNullUndefined(groupId) && checkNullUndefined(newGroupId))
- •If(checkNullUndefined(groupId))
- •If(checkNullUndefined(studentId))
- •If(checkNullUndefined(studentId))
- •If(checkNullUndefined(studentId))
- •If(!studentInfo.CheckError)
- •If(!studentInfo.CheckError)
- •If(checkNullUndefined(studentId))
- •If(checkNullUndefined(group))
- •If(checkNullUndefined(group))
- •If(checkNullUndefined(student))
- •If(checkNullUndefined)
- •If(item.ClassList.Contains('popupWrapBox'))
If(checkNullUndefined(groupId))
{
this.GroupModel.deleteGroup(
{groupId},
() => this.render()
);
}
};
this.createGroup = () =>
{
var inputsBox = document.getElementById('createGroup').querySelectorAll('input, select'),
allSpecialityKeys = this.GroupModel.getAllSpecialityKeysArr(),
groupInfo = {},
groupObj = {};
groupInfo = this.groupBoxGetInputParams(inputsBox, allSpecialityKeys);
groupObj = groupInfo.data;
If(!groupInfo.CheckError)
{
this.GroupModel.createGroup(
groupObj,
() => this.render()
);
}
};
this.editGroup = () =>
{
var inputsBox = document.getElementById('editGroup').querySelectorAll('input, select'),
allSpecialityKeys = this.GroupModel.getAllSpecialityKeysArr(),
groupId = parseInt(document.getElementById('editGroup').getAttribute('data-groupid')),
groupInfo = {},
groupObj = {};
groupInfo = this.groupBoxGetInputParams(inputsBox, allSpecialityKeys);
groupObj = groupInfo.data;
If(!groupInfo.CheckError)
{
groupObj.groupId = groupId;
this.GroupModel.editGroup(
groupObj,
() => this.render()
);
}
};
this.exchangeGroupStudents = () =>
{
var exchangeGroupBox = document.getElementById('exchangeGroup'),
groupId = parseInt(exchangeGroupBox.getAttribute('data-groupid')),
newGroupId = parseInt(exchangeGroupBox.getElementsByTagName('select')[0].value);
If(checkNullUndefined(groupId) && checkNullUndefined(newGroupId))
{
this.GroupModel.exchangeGroupStudents(
{groupId, newGroupId},
() =>
{
this.StudentModel.replaceGroupStudents(groupId, newGroupId);
this.render();
}
);
}
};
this.emptyGroup = () =>
{
var groupId = parseInt(document.getElementById('emptyGroup').getAttribute('data-groupid'));
If(checkNullUndefined(groupId))
{
this.GroupModel.emptyGroup(
{groupId},
() =>
{
this.StudentModel.replaceGroupStudents(groupId, null);
this.render();
}
);
}
};
}
/assets/js/controllers/StudentController.js
function StudentController({GroupModel, StudentModel}, View)
{
this.View = View;
this.GroupModel = GroupModel;
this.StudentModel = StudentModel;
this.showAllStudents= () =>
{
var allStudents = this.StudentModel.getAllStudents(),
allGroups = this.GroupModel.getAllGroupsArr();
this.View.renderStudentTable(allStudents, allGroups);
};
this.showCreateStudentBox = () =>
{
var allGroupsArr = this.GroupModel.getAllGroupsArr();
this.View.renderCreateStudentBox(allGroupsArr);
};
this.showStudentInfo = (studentRow) =>
{
var studentId = parseInt(studentRow.getAttribute('data-studentid')),
student = {};
