Skip to content
Snippets Groups Projects
Commit 2697aadb authored by Антон Шалимов's avatar Антон Шалимов
Browse files

fix загрузка студентов

parent 1de71173
Branches
Tags
No related merge requests found
...@@ -17,7 +17,8 @@ class FileParser ...@@ -17,7 +17,8 @@ class FileParser
list($lastName, $firstName, $secondName) = self::parsePeopleName($line[0]); list($lastName, $firstName, $secondName) = self::parsePeopleName($line[0]);
// Курс, степень подготовки // Курс, степень подготовки
$studentGradeNum = $line[1]; $studentGradeNum = $line[1];
switch($line[2]) $studentGroupNum = $line[2];
switch($line[3])
{ {
case 'Бакалавр': case 'Бакалавр':
$studentDegree = 'bachelor'; $studentDegree = 'bachelor';
...@@ -29,10 +30,13 @@ class FileParser ...@@ -29,10 +30,13 @@ class FileParser
$studentDegree = 'master'; $studentDegree = 'master';
break; break;
} }
$studentGroupNum = $line[3]; $studentSpec = $line[4];
$studentGradeID = $model->getGradeID($studentGradeNum, $studentDegree); $activationCode = Text::random('hexdec', 10);
Account::instance()->createStudent($lastName, $firstName, $secondName, //$studentGradeID = $model->getGradeID($studentGradeNum, $studentDegree);
$studentGradeID, $studentGroupNum, $facultyID); //Account::instance()->createStudent($lastName, $firstName, $secondName,
// $studentGradeID, $studentGroupNum, $facultyID);
Account::instance()->createStudentEx($lastName, $firstName, $secondName,
$studentGradeNum, $studentGroupNum, $studentDegree, $studentSpec, $facultyID, $activationCode);
} }
$i++; $i++;
} }
......
...@@ -48,6 +48,13 @@ class Model_Kohana_Account extends Model ...@@ -48,6 +48,13 @@ class Model_Kohana_Account extends Model
$sql = "SELECT `CreateStudent`('$lastName', '$firstName', '$secondName', '$grade', '$groupNum', '$facultyID', '$activationCode') AS `UserID`;"; $sql = "SELECT `CreateStudent`('$lastName', '$firstName', '$secondName', '$grade', '$groupNum', '$facultyID', '$activationCode') AS `UserID`;";
$key = DB::query(Database::SELECT, $sql)->execute(); $key = DB::query(Database::SELECT, $sql)->execute();
return $key->get('UserID'); return $key->get('UserID');
}
public function createStudentEx($lastName, $firstName, $secondName, $gradeNum, $groupNum, $degree, $specialization, $facultyID, $activationCode)
{
$sql = "SELECT `CreateStudentEx`('$lastName', '$firstName', '$secondName', '$grade', '$groupNum', '$degree', '$specialization', '$facultyID', '$activationCode') AS `UserID`;";
$key = DB::query(Database::SELECT, $sql)->execute();
return $key->get('UserID');
} }
public function getPersonalInfoByID($id) public function getPersonalInfoByID($id)
......
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