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

Students upload fix

parent a6b2e093
Branches
Tags
No related merge requests found
......@@ -33,7 +33,9 @@ class Controller_Office_Students extends Controller_Environment_Office
$errors = [];
if (!empty($_FILES['students']) && $this->request->method() == 'POST') {
$facultyID = User::instance()->Faculty->ID;
$facultyID = ($this->user->isAdmin()) ?
$_POST['facultyID'] :
$this->user->Faculty->ID;
$file = $_FILES['students']['tmp_name'];
$errors = FileParser::uploadStudents($file, $facultyID);
}
......
......@@ -19,6 +19,17 @@
<p><pre>ФИО;Курс;Группа;Уровень подготовки;Специальность</pre></p>
<p>Уровень подготовки - одно из следующих значений: Бакалавр, Специалист, Магистр</p>
<form enctype="multipart/form-data" action="" method="POST">
{% if User.isAdmin %}
<div class="goodClearFix defaultForm marginBetween">
<select id="facultySelect" name="facultyID" class="defaultForm">
<option value="0" selected="selected">— Выберите подразделение ЮФУ —</option>
{% for row in Faculties %}
<option value="{{ row.ID }}">{{ row.Name }} ({{ row.Abbr }})</option>
{% endfor %}
</select>
</div>
{% endif %}
<div class="goodClearFix">
<div class="defaultForm FLeft"><input name="students" class="defaultForm FullWidth" type="file"></div>
<div class="defaultForm FRight"><input type="submit" class="defaultForm GreenButton P2Width noMargin" value="Загрузить"></div>
......
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