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

FIX: session vars

parent 4977a8e4
Branches
Tags
No related merge requests found
......@@ -207,7 +207,7 @@ DROP FUNCTION IF EXISTS SetSemesterID//
CREATE FUNCTION `SetSemesterID` (`pSemesterID` INT) RETURNS int(11)
NO SQL
BEGIN
SET @CurrentSemesterID = pSemesterID;
SET @CurrentSemesterID := pSemesterID;
RETURN 0;
END //
......@@ -327,7 +327,7 @@ BEGIN
accounts.EMail = pEMail,
accounts.ActivationCode = NULL
WHERE accounts.ActivationCode = pCode AND
(@vAccountID = accounts.ID) > 0 # save accountID
(@vAccountID := accounts.ID) > 0 # save accountID
LIMIT 1;
IF (ROW_COUNT() = 0) THEN
......@@ -1887,12 +1887,12 @@ BEGIN
END IF;
# add rate, or update old
SET @tmp = -1;
SET @tmp = 0;
INSERT INTO `rating_table`
(StudentID, TeacherID, SubmoduleID, Rate, Date)
VALUES ( pStudentID, pTeacherID, pSubmoduleID, pRate, CURDATE())
ON DUPLICATE KEY UPDATE
rating_table.TeacherID = (@tmp = pTeacherID),
rating_table.TeacherID = (@tmp := pTeacherID),
rating_table.Rate = pRate,
rating_table.Date = CURDATE();
......@@ -1900,7 +1900,7 @@ BEGIN
INSERT INTO `logs_rating`
(StudentID, SubmoduleID, TeacherID, Rate, Action )
VALUES (pStudentID, pSubModuleID, pTeacherID, pRate,
CASE WHEN @tmp >= 0 THEN 'add' ELSE 'change' END);
CASE WHEN @tmp > 0 THEN 'add' ELSE 'change' END);
# lock discipline for structure editing
IF NOT vIsLocked THEN
......
......@@ -23,7 +23,6 @@ class Controller_Handler_Rating extends Controller_Handler
$this->post->offsetGet('student'),
$this->post->offsetGet('submodule'),
$this->post->offsetGet('rate'));
echo $result[0]['Num'];
$data['success'] = ($result[0]['Num'] == 0);
}
$this->response->body(json_encode($data));
......
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