} if (!isset($_SESSION['date_from']) or $_SESSION['date_from'] == '') { $_SESSION['date_from'] = date("d.m.Y", strtotime('-10 days', time())); } if (!isset($_SESSION['date_to']) or $_SESSION['date_to'] == '') { $_SESSION['date_to'] = date("d.m.Y"); } $date_from = implode('-', array_reverse(explode('.', $_SESSION['date_from']))); $date_to = implode('-', array_reverse(explode('.', $_SESSION['date_to']))); $template_name = 'class_lessons.html'; $renderArray = array('date_from' => $_SESSION['date_from'], 'date_to' => $_SESSION['date_to'], 'ui_theme' => $config['ui']['theme']); $renderArray['subject_id'] = $subject_id; $renderArray['queryResult'] = $queryResult; if ($fromAjax) { $template_name = 'class_lessons_ajax.html'; $subject = get_lesson_subject($subject_id); $lessons = get_lessons($subject_id, $date_from, $date_to); $lessons_count = count($lessons); $students_list = get_student_classes_list($subject['class_id'], 0); $active_leson = false; foreach ($students_list as $key => $student) { $students_list[$key]['grades'] = get_student_lesson_grades($student['student_id'], $subject_id, $date_from, $date_to); } $renderArray['lessons'] = $lessons; $renderArray['lessons_count'] = $lessons_count; $renderArray['students_list'] = $students_list; } else { $renderArray['lesson_types'] = get_lesson_types(); } $template = $twig->loadTemplate('teachers/' . $template_name); echo $template->render($renderArray);
<table width="100%"> <tr><td width="50%" valign="top"> <span class="head_top">Список учеников:</span> <table id="rounded-corner"> <thead> <tr> <th class="rounded-left">№</th> <th>Имя</th> <th> </th> <th class="rounded-right"> </th> </tr> </thead> <?php $students_list = get_student_classes_list($_GET['class_id']); $n = 1; foreach ($students_list as $student) { echo "<tr><td>{$n}</td><td>{$student['student_name']}</td><td>\n <a href=\"student.php?class_id={$_GET['class_id']}&student_id={$student['student_id']}&" . uniqid('') . "&keepThis=true&TB_iframe=true&height=450&width=770&modal=true\" title=\"Редактирвание ученика\" class=\"thickbox\">Редактировать</a></td>"; echo "<td><a href=\"class.php?class_id={$_GET['class_id']}&student_id={$student['student_id']}&action=expel\" title=\"Отчислить ученика\">Отчислить</a></td></tr>"; $n++; } ?> <tfoot> <tr> <td colspan="2" class="rounded-foot-left"> </td> <td> <a href="" onClick="javascript: tb_show('Добавить', 'student.php?class_id=<?php echo $_GET['class_id']; ?> &<?php