$res2 = db_query("SELECT grade, discipline\nFROM students_on_lesson\nINNER JOIN lessons ON lessons.lesson_id = students_on_lesson.lesson_id\nINNER JOIN subjects ON lessons.subject_id = subjects.subject_id\nINNER JOIN disciplines ON disciplines.discipline_id = subjects.discipline_id\nWHERE lessons.lesson_date = '" . implode('-', array_reverse(explode('.', $_REQUEST['date_send']))) . "' AND student_id={$student_id};"); while ($grade = mysql_fetch_assoc($res2)) { $text .= "{$grade['discipline']}: {$grade['grade']}\n"; } if ($student['email'] != '') { mail($student['email'], "Оценки за {$student['last_name']} {$student['last_name']} {$student['last_name']} за " . $_REQUEST['date_send'], $text, $headers); } } } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'sendtosms') { require_once '../lib/epochtasms.Class.php'; $epochtasms = new epochtasms(); $res = db_query($sql = "SELECT student_id FROM students_on_lesson INNER JOIN lessons ON lessons.lesson_id=students_on_lesson.lesson_id WHERE lessons.lesson_date='" . implode('-', array_reverse(explode('.', $_REQUEST['date_send']))) . "' GROUP BY student_id"); while ($student_id = mysql_fetch_assoc($res)) { $student_id = array_pop($student_id); $student = db_get_first_row("SELECT * FROM students WHERE student_id={$student_id};"); $text = "Оценки {$student['last_name']} {$student['last_name']} {$student['last_name']} за " . $_REQUEST['date_send'] . ":"; $res2 = db_query("SELECT grade, discipline\nFROM students_on_lesson\nINNER JOIN lessons ON lessons.lesson_id = students_on_lesson.lesson_id\nINNER JOIN subjects ON lessons.subject_id = subjects.subject_id\nINNER JOIN disciplines ON disciplines.discipline_id = subjects.discipline_id\nWHERE lessons.lesson_date = '" . implode('-', array_reverse(explode('.', $_REQUEST['date_send']))) . "' AND student_id={$student_id};"); while ($grade = mysql_fetch_assoc($res2)) { $text .= "{$grade['discipline']}: {$grade['grade']}, "; } if ($student['smsphone'] != '') { $text = htmlspecialchars($text); $result = $epochtasms->SendTextMessage($config['epochtasms']['login'], $config['epochtasms']['passwd'], $student['smsphone'], $text, $config['epochtasms']['from']); } } $smssend = true; } include 'header.php'; $nums_grade = db_get_cell("SELECT COUNT(grade) FROM students_on_lesson INNER JOIN lessons ON lessons.lesson_id=students_on_lesson.lesson_id WHERE lessons.lesson_date='" . date('Y-m-d') . "';"); ?>
?> <body> <?php if ($subject_id == 0 && $mode == '') { $mode = 'add'; } elseif ($subject_id != 0 && $mode == '') { $mode = 'update'; } if ($mode == 'success_update') { echo '<center>Информация об ученике успешно обновлена.<br /><br />'; echo '<input type="button" value=" Закрыть " onclick="self.parent.tb_remove();self.parent.location.reload();" /></center>'; } elseif ($mode == 'success_add') { echo 'Новый дисциплина успешно добавлена.<br /><br />'; echo '<input type="button" value=" Закрыть " onclick="self.parent.tb_remove();self.parent.location.reload();" />'; } elseif ($mode == 'update') { $subject = db_get_first_row('SELECT * FROM subjects WHERE subject_id=' . $subject_id); outSubjectForm($subject); } elseif ($mode == 'add') { outSubjectForm(); } function outSubjectForm($subject = null) { global $class_id, $subject_id; $res = db_query('SELECT * FROM disciplines'); $disciplines = array(); while ($row = mysql_fetch_array($res)) { $disciplines[] = $row; } $res = db_query('SELECT * FROM teachers'); $teachers = array(); while ($row = mysql_fetch_array($res)) {
header('Location: user.php?mode=success_update'); exit; } } include '../header_dialog.php'; ?> <body> <?php if ($mode == 'success_update') { echo '<center>Информация о пользователе успешно обновлена.<br /><br />'; echo '<input type="button" value=" Закрыть " onclick="self.parent.tb_remove();self.parent.location.reload();" />'; } elseif ($mode == 'success_add') { echo '<center>Новый пользователь успешно добавлен.<br /><br />'; echo '<input type="button" value=" Закрыть " onclick="self.parent.tb_remove();self.parent.location.reload();" /></center>'; } elseif ($mode == 'update') { $user = db_get_first_row('SELECT * FROM users WHERE user_id=' . $user_id); outUserForm($user); } elseif ($mode == 'add') { outUserForm(); } function outUserForm($user = null) { global $class_id, $student_id; echo ' <form action="user.php" method="post">'; if (is_null($user)) { echo '<input type="hidden" name="action" value="add" />'; } else { echo '<input type="hidden" name="action" value="update" />'; } echo '<input type="hidden" name="user_id" value="' . $user['user_id'] . '" />
} include '../header_dialog.php'; if ($student_id == 0 && $mode == '') { $mode = 'add'; } elseif ($student_id != 0 && $mode == '') { $mode = 'update'; } if ($mode == 'success_update') { echo '<center>Информация об ученике успешно обновлена.<br /><br />'; echo '<input type="button" value=" Закрыть " onclick="self.parent.tb_remove();self.parent.location.reload();" />'; } elseif ($mode == 'success_add') { echo '<center>Новый ученик успешно добавлен.<br /><br />'; echo '<input type="button" value=" Закрыть " onclick="self.parent.tb_remove();self.parent.location.reload();" /> <input type="button" value=" Продолжить " onclick="document.location=\'student.php?mode=add&class_id=' . $class_id . '\'" /></center>'; } elseif ($mode == 'update') { $student = db_get_first_row('SELECT * FROM students WHERE student_id=' . $student_id); outStudentForm($student); } elseif ($mode == 'add') { outStudentForm(); } function outStudentForm($student = null) { global $class_id, $student_id; echo ' <script type="text/javascript"> jQuery(function($){ $.mask.definitions[\'~\']=\'[01]\'; $.mask.definitions[\'a\']=\'[0123]\'; $.mask.definitions[\'b\']=\'[12]\';
title:'Редактирование', modal:true, height:470, width:700, buttons: {'Закрыть': function() { $(this).dialog('close'); }}}) }); } </script> <?php $class_id = $_REQUEST['class_id']; $class = db_get_first_row('SELECT * FROM classes WHERE class_id=' . $class_id); $teacher = db_get_first_row('SELECT * FROM teachers WHERE teacher_id=' . $class['teacher_id']); ?> Класс <b><?php echo "{$class['class']}{$class['letter']}"; ?> </b> Классный руководитель: <b><?php echo "{$teacher['last_name']} {$teacher['first_name']} {$teacher['middle_name']}"; ?> </b><br /> <?php echo $class['school_year'] . '-' . ($class['school_year'] + 1); ?> год обучения<br /> <table width="100%">
exit; } } include '../header_dialog.php'; ?> <body> <?php if ($mode == 'success_update') { echo '<center>Информация о дисциплине успешно обновлена.<br /><br />'; echo '<input type="button" value=" Закрыть " onclick="self.parent.tb_remove();self.parent.location.reload();" /></center>'; } elseif ($mode == 'success_add') { echo 'Новая дисциплина успешно добавлена.<br /><br />'; echo '<center><input type="button" value=" Закрыть " onclick="self.parent.tb_remove();self.parent.location.reload();" /> <input type="button" value=" Продолжить " onclick="document.location=\'discipline.php\'" /></center>'; } elseif ($mode == 'update') { $discipline = db_get_first_row('SELECT * FROM disciplines WHERE discipline_id=' . $discipline_id); outDisciplineForm($discipline); } elseif ($mode == 'add') { outDisciplineForm(); } function outDisciplineForm($discipline = null) { echo '<form action="discipline.php" method="post"> <input type="hidden" name="discipline_id" value="' . $discipline['discipline_id'] . '" />'; if (isset($discipline)) { echo '<input type="hidden" name="action" value="update" />'; } else { echo '<input type="hidden" name="action" value="add" />'; } echo ' <table width="100%"
return validForm; } </script> <body style="margin-left: 0px; margin-right: 0px;"> <?php if ($mode == 'success_update') { echo '<center>Информация об учителе успешно обновлена.<br /><br />'; echo '<input type="button" value=" Закрыть " onclick="self.parent.tb_remove();self.parent.location.reload();" /></center>'; } elseif ($mode == 'success_add') { echo '<center>Новый учитель успешно добавлен.<br /><br />'; echo '<input type="button" value=" Закрыть " onclick="self.parent.tb_remove();self.parent.location.reload();" /> <input type="button" value=" Продолжить " onclick="document.location=\'teacher.php\'" /></center>'; } elseif ($mode == 'update') { $teacher = db_get_first_row('SELECT * FROM teachers WHERE teacher_id=' . $teacher_id); outTeacherForm($teacher); } elseif ($mode == 'add') { outTeacherForm(); } function outTeacherForm($teacher = null) { global $teacher_id; echo ' <form action="teacher.php" method="post">'; if (isset($teacher)) { echo '<input type="hidden" name="action" value="update" />'; echo '<input type="hidden" name="teacher_id" value="' . $teacher_id . '" />'; } else { echo '<input type="hidden" name="action" value="add" />'; }