var groups_spisok = "<p class='q'>"+groupsList.ID_Task+ "</p>";
groups_spisok += "<p class='q'>"+groupsList.Text+ "</p>";
groups_spisok += "<p class='q'>"+groupsList.Difficulty_Level+ "</p>";
var answer = groupsList.Answer;
for(var i=0; i<answer.length; i++) {
groups_spisok += "<label>"+answer[i].text_answer+ "</label>";
}
$("#example").html(groups_spisok);
studentsHTML += " <a href=\"#\" "+"onclick=\"redStudent("+studentsList[i].ID_Stud+"); return false;\">Редактировать</a>";
usersHTML = "<tbody>";
function getStudents() {
$.ajax({
url: 'getUser.php',
dataType: "json",
}).done(function(usersList ){
var usersHTML = "<table>";
usersHTML += "<thead>";
usersHTML += "<tr>";
usersHTML += "<th>#</th>";
usersHTML += "<th>Фамилия</th>";
usersHTML += "<th>Имя</th>";
usersHTML += "<th>Отчество</th>";
usersHTML += "</tr>";
usersHTML += "</thead>";
usersHTML = "<tbody>";
for(var i=0; i<usersList.length; i++){
usersHTML += "<tr>";
usersHTML += "<td>" + usersList[i].Surname + "</td>";
usersHTML += "<td>" + usersList[i].Name + "</td>";
usersHTML += "<td>" + usersList[i].Patronymic + "</td>";
usersHTML +="</tr>";
}
usersHTML += "</tbody>";
usersHTML += "</table>";
$("#users").html(usersHTML);
}).fail(function(){
alert('Ошибка запроса к серверу!');
});
}
getStudents();
Файл functions.php - выборка из БД тестов:
Страница авторизации - index.php: тут как раз таки перенаправление на LK.php