$code = $_POST['code']; $password = $_POST['password']; $true = LoginTo::dataCheck($code, $password, false); } else { $true = false; } } if ($true) { $s = new StudentManagement($_SESSION['id']); if (date('n') == 9 or date('n') == 10 or date('n') == 11 or date('n') == 12) { $currentYear = date("Y"); } else { $currentYear = date("Y") - 1; } require_once "header.php"; $color = $s->getMisses() > 10 ? "style='background: #e74c3c;'" : ""; ?> <div class="panel panel-default" id="container"> <div class="panel-body"> <h3>Online napló</h3> <?php echo $s->getStudentInfo(); ?> <div id="makrs"> <?php $s->getStudentMarks($currentYear); ?> </div>
$true = false; } if ($true) { $year = $_POST['year']; $class = $_POST['class']; $students = TeacherManagement::getStudentsFromClass($year, $class); //var_dump($students); if ($students[0] == 'none') { echo 'Ebben az osztályban nincs diák!'; } else { echo '<table class="table table-striped table-bordered">'; echo '<thead>'; echo '<tr style="text-align: center;">'; echo '<td><strong>Diák neve</strong></td>'; echo '<td><strong>Hiányzott órák száma</strong></td>'; echo '<td><strong>Plusz egy hiányzás</strong></td>'; echo '<td><strong>Minusz egy hiányzás</strong></td>'; echo '</tr>'; echo '</thead>'; for ($i = 0; $i < count($students); $i++) { $s = new StudentManagement($students[$i]['id']); echo '<tr>'; echo '<td>' . $s->getName() . '</td>'; echo '<td style="text-align: center;">' . $s->getMisses() . ' óra </td>'; echo '<td style="text-align: center; cursor: pointer;" onclick="addMiss(' . $s->getId() . ',1)"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></td>'; echo '<td style="text-align: center; cursor: pointer;" onclick="addMiss(' . $s->getId() . ',-1)"><span class="glyphicon glyphicon-minus" aria-hidden="true"></span></td>'; echo '</tr>'; } echo '</table>'; } }