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

totally replace @CurrentSemesterID with session var

parent ffa94642
Branches
Tags
No related merge requests found
...@@ -243,16 +243,6 @@ END // ...@@ -243,16 +243,6 @@ END //
# Label: semesters # Label: semesters
# ------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------
# TODO: deprecated
# set current(for user) semester, life time - db session
DROP FUNCTION IF EXISTS SetSemesterID//
CREATE FUNCTION `SetSemesterID` (`pSemesterID` INT) RETURNS int(11)
NO SQL
BEGIN
SET @CurrentSemesterID := pSemesterID;
RETURN 0;
END //
# ------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------
......
...@@ -82,10 +82,7 @@ class Kohana_User implements ArrayAccess ...@@ -82,10 +82,7 @@ class Kohana_User implements ArrayAccess
} }
public function SetSemester($semesterID) { public function SetSemester($semesterID) {
$res = $this->_model->SetSemesterID($semesterID); $this->_session->set("SemesterID", "$semesterID");
if ($res >= 0) {
$this->_session->set("SemesterID", "$semesterID");
}
} }
......
...@@ -242,15 +242,4 @@ class Model_Kohana_Account extends Model ...@@ -242,15 +242,4 @@ class Model_Kohana_Account extends Model
return $id; return $id;
} }
public function SetSemesterID($semesterID)
{
$sql = "SELECT `SetSemesterID`('$semesterID') AS `Num`; ";
$res = DB::query(Database::SELECT, $sql)->execute();
$id = 0;
foreach ($res as $value) {
$id = $value['Num'];
}
return $id;
}
} }
\ No newline at end of file
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