Skip to content
Snippets Groups Projects
Commit a294282f authored by PavelBegunkov's avatar PavelBegunkov
Browse files

no message

parent 28574724
Branches
Tags
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
-- http://www.phpmyadmin.net -- http://www.phpmyadmin.net
-- --
-- Хост: 127.0.0.1:3306 -- Хост: 127.0.0.1:3306
-- Время создания: Июл 29 2014 г., 13:54 -- Время создания: Авг 04 2014 г., 18:58
-- Версия сервера: 5.5.37-log -- Версия сервера: 5.5.37-log
-- Версия PHP: 5.3.28 -- Версия PHP: 5.3.28
...@@ -205,6 +205,9 @@ CREATE TABLE IF NOT EXISTS `disciplines` ( ...@@ -205,6 +205,9 @@ CREATE TABLE IF NOT EXISTS `disciplines` (
`AuthorID` int(11) NOT NULL, `AuthorID` int(11) NOT NULL,
`ExamType` enum('exam','credit') NOT NULL, `ExamType` enum('exam','credit') NOT NULL,
`SemesterID` int(11) NOT NULL, `SemesterID` int(11) NOT NULL,
`PracticeCount` int(11) NOT NULL DEFAULT '0',
`LectionCount` int(11) NOT NULL DEFAULT '0',
`Type` enum('general','special','choosen') NOT NULL DEFAULT 'general',
PRIMARY KEY (`ID`), PRIMARY KEY (`ID`),
KEY `SubjectID` (`SubjectID`), KEY `SubjectID` (`SubjectID`),
KEY `TeacherID` (`AuthorID`), KEY `TeacherID` (`AuthorID`),
...@@ -215,11 +218,11 @@ CREATE TABLE IF NOT EXISTS `disciplines` ( ...@@ -215,11 +218,11 @@ CREATE TABLE IF NOT EXISTS `disciplines` (
-- Дамп данных таблицы `disciplines` -- Дамп данных таблицы `disciplines`
-- --
INSERT INTO `disciplines` (`ID`, `Name`, `Grade`, `SubjectID`, `AuthorID`, `ExamType`, `SemesterID`) VALUES INSERT INTO `disciplines` (`ID`, `Name`, `Grade`, `SubjectID`, `AuthorID`, `ExamType`, `SemesterID`, `PracticeCount`, `LectionCount`, `Type`) VALUES
(1, 'Матан1', 1, 1, 3, 'exam', 2), (1, 'Матан1', 1, 1, 3, 'exam', 2, 0, 0, 'general'),
(2, 'Диф-ры 1', 1, 2, 3, 'credit', 2), (2, 'Диф-ры 1', 1, 2, 3, 'credit', 2, 0, 0, 'general'),
(3, 'Оси 1', 2, 3, 5, 'exam', 2), (3, 'Оси 1', 2, 3, 5, 'exam', 2, 0, 0, 'general'),
(4, 'Топология 1', 1, 4, 3, 'exam', 2); (4, 'Топология 1', 1, 4, 3, 'exam', 2, 0, 0, 'general');
-- -------------------------------------------------------- -- --------------------------------------------------------
...@@ -402,8 +405,9 @@ INSERT INTO `rating_table` (`ID`, `StudentID`, `TeacherID`, `SubmoduleID`, `Rate ...@@ -402,8 +405,9 @@ INSERT INTO `rating_table` (`ID`, `StudentID`, `TeacherID`, `SubmoduleID`, `Rate
CREATE TABLE IF NOT EXISTS `requests` ( CREATE TABLE IF NOT EXISTS `requests` (
`ID` int(11) NOT NULL AUTO_INCREMENT, `ID` int(11) NOT NULL AUTO_INCREMENT,
`AccountID` int(11) DEFAULT NULL, `AccountID` int(11) DEFAULT NULL,
`Text` text NOT NULL, `Information` text NOT NULL,
`Date` date NOT NULL, `Date` date NOT NULL,
`Status` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`), PRIMARY KEY (`ID`),
KEY `AccountID` (`AccountID`) KEY `AccountID` (`AccountID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
-- http://www.phpmyadmin.net -- http://www.phpmyadmin.net
-- --
-- Хост: 127.0.0.1:3306 -- Хост: 127.0.0.1:3306
-- Время создания: Июл 29 2014 г., 13:55 -- Время создания: Авг 04 2014 г., 18:59
-- Версия сервера: 5.5.37-log -- Версия сервера: 5.5.37-log
-- Версия PHP: 5.3.28 -- Версия PHP: 5.3.28
...@@ -138,6 +138,9 @@ CREATE TABLE IF NOT EXISTS `disciplines` ( ...@@ -138,6 +138,9 @@ CREATE TABLE IF NOT EXISTS `disciplines` (
`AuthorID` int(11) NOT NULL, `AuthorID` int(11) NOT NULL,
`ExamType` enum('exam','credit') NOT NULL, `ExamType` enum('exam','credit') NOT NULL,
`SemesterID` int(11) NOT NULL, `SemesterID` int(11) NOT NULL,
`PracticeCount` int(11) NOT NULL DEFAULT '0',
`LectionCount` int(11) NOT NULL DEFAULT '0',
`Type` enum('general','special','choosen') NOT NULL DEFAULT 'general',
PRIMARY KEY (`ID`), PRIMARY KEY (`ID`),
KEY `SubjectID` (`SubjectID`), KEY `SubjectID` (`SubjectID`),
KEY `TeacherID` (`AuthorID`), KEY `TeacherID` (`AuthorID`),
...@@ -261,8 +264,9 @@ CREATE TABLE IF NOT EXISTS `rating_table` ( ...@@ -261,8 +264,9 @@ CREATE TABLE IF NOT EXISTS `rating_table` (
CREATE TABLE IF NOT EXISTS `requests` ( CREATE TABLE IF NOT EXISTS `requests` (
`ID` int(11) NOT NULL AUTO_INCREMENT, `ID` int(11) NOT NULL AUTO_INCREMENT,
`AccountID` int(11) DEFAULT NULL, `AccountID` int(11) DEFAULT NULL,
`Text` text NOT NULL, `Information` text NOT NULL,
`Date` date NOT NULL, `Date` date NOT NULL,
`Status` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`), PRIMARY KEY (`ID`),
KEY `AccountID` (`AccountID`) KEY `AccountID` (`AccountID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
......
...@@ -661,7 +661,7 @@ END // ...@@ -661,7 +661,7 @@ END //
DROP FUNCTION IF EXISTS InternalOccurrenceChecker ; // DROP FUNCTION IF EXISTS InternalOccurrenceChecker ; //
CREATE FUNCTION `InternalOccurrenceChecker` ( `StudentID` INT, CREATE FUNCTION `InternalOccurrenceChecker` ( `StudentID` INT,
`AG_ID` INT ) `AG_ID` INT )
RETURNS boolean RETURNS int(11)
NO SQL NO SQL
BEGIN BEGIN
...@@ -679,7 +679,7 @@ BEGIN ...@@ -679,7 +679,7 @@ BEGIN
) )
LIMIT 1; LIMIT 1;
RETURN (mID>0); RETURN mID;
END // END //
...@@ -706,12 +706,15 @@ BEGIN ...@@ -706,12 +706,15 @@ BEGIN
students.FirstName, students.FirstName,
students.SecondName, students.SecondName,
study_groups.Grade, study_groups.Grade,
study_groups.Group study_groups.Group,
(attending_groups_pool.StudentID IS NOT NULL) AS 'isAttached'
FROM `disciplines_teachers` FROM `disciplines_teachers`
INNER JOIN `disciplines` ON disciplines.ID = disciplines_teachers.DisciplineID INNER JOIN `disciplines` ON disciplines.ID = disciplines_teachers.DisciplineID
CROSS JOIN `lessons` ON lessons.DisciplineTeacherID = disciplines_teachers.ID CROSS JOIN `lessons` ON lessons.DisciplineTeacherID = disciplines_teachers.ID
INNER JOIN `attending_groups` ON attending_groups.ID = lessons.AttendingGroupID INNER JOIN `attending_groups` ON attending_groups.ID = lessons.AttendingGroupID
CROSS JOIN `students` ON InternalOccurrenceChecker(students.ID, attending_groups.ID) = TRUE CROSS JOIN `students` ON InternalOccurrenceChecker(students.ID, attending_groups.ID) > 0
LEFT JOIN `attending_groups_pool` ON attending_groups_pool.AttendingGroupID = attending_groups.ID AND attending_groups_pool.StudentID = students.ID
INNER JOIN `study_groups` ON students.StudyGroupID = study_groups.ID INNER JOIN `study_groups` ON students.StudyGroupID = study_groups.ID
WHERE disciplines_teachers.TeacherID = TeacherID AND WHERE disciplines_teachers.TeacherID = TeacherID AND
disciplines_teachers.DisciplineID = DisciplineID disciplines_teachers.DisciplineID = DisciplineID
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment