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