Skip to content
Snippets Groups Projects
Commit 6aa69dd6 authored by Anton's avatar Anton
Browse files

new

parent fe9b499d
Branches
Tags
No related merge requests found
......@@ -396,15 +396,18 @@ class Controller_Handler_Map extends Controller_Handler {
public function action_SearchStudents() {
$this->post -> rule('Grade', 'digit')
-> rule('GroupN', 'digit')
-> rule('FacultyID', 'digit');
-> rule('FacultyID', 'digit')
-> rule('DisciplineID', 'not_empty')
-> rule('DisciplineID', 'digit');
if($this->post->check()) {
$SeResult = $this->model->SearchStudents(
$SeResult = $this->model->SearchStudentsNew(
$this->post->offsetGet('Grade'),
$this->post->offsetGet('GroupN'),
$this->post->offsetGet('FacultyID'),
$this->post->offsetGet('Last'),
$this->post->offsetGet('First'),
$this->post->offsetGet('Second')
$this->post->offsetGet('Second'),
$this->post->offsetGet('DisciplineID')
);
$SearchResult = array();
$i = 0;
......@@ -478,14 +481,17 @@ class Controller_Handler_Map extends Controller_Handler {
// Поиск преподавателей
public function action_SearchTeachers() {
$this->post -> rule('DepartmentID', 'digit');
$this->post -> rule('DepartmentID', 'digit')
-> rule('DisciplineID', 'not_empty')
-> rule('DisciplineID', 'digit');
if($this->post->check()) {
$SeResult = $this->model->SearchTeachers(
$SeResult = $this->model->SearchTeacherNew(
$this->post->offsetGet('FacultyID'),
$this->post->offsetGet('DepartmentID'),
$this->post->offsetGet('Last'),
$this->post->offsetGet('First'),
$this->post->offsetGet('Second')
$this->post->offsetGet('Second'),
$this->post->offsetGet('DisciplineID')
);
$SearchResult = array();
$i = 0;
......
......@@ -113,39 +113,41 @@ class Controller_Teacher_Map extends Controller_UserEnvi {
$twig->BindTeachersList = $this->GetTeachersForDiscipline($db, $id);
$twig->FacultiesList = $this->GetFaculties($db);
$twig->Departments = $this->GetDepartments($db, $twig->Discipline['FacultyID']);
$twig->TeachersList = $this->GetTeachersByDepartment($db, $twig->Discipline['DepID']);
//$twig->TeachersList = $this->GetTeachersByDepartment($db, $twig->Discipline['DepID']);
$this->response->body($twig);
}
private function getMapInfo($map) {
echo Debug::vars($map);
$mapHandled = array();
$maxRate = 0; $i = 0; $module = 0;
foreach($map as $row)
{
if($row['ModuleID'] != $module)
{
$i++;
$module = $row['ModuleID'];
if($row['ModuleID'] != $module)
{
$i++;
$module = $row['ModuleID'];
$mapHandled[$i]['ModuleID'] = $row['ModuleID'];
$mapHandled[$i]['CurrentControl'] = 0;
$mapHandled[$i]['LandmarkControl'] = 0;
}
if(!isset($mapHandled[$i]['SubmodulesCount']))
{
$mapHandled[$i]['SubmodulesCount'] = 0;
$mapHandled[$i]['MaxRate'] = 0;
}
$j = $mapHandled[$i]['SubmodulesCount'] += 1;
$mapHandled[$i]['MaxRate'] += (int) $row['MaxRate'];
$mapHandled[$i]['ModuleTitle'] = $row['ModuleName'];
}
if(!isset($mapHandled[$i]['SubmodulesCount']))
{
$mapHandled[$i]['SubmodulesCount'] = 0;
$mapHandled[$i]['MaxRate'] = 0;
}
$j = $mapHandled[$i]['SubmodulesCount'] += 1;
$mapHandled[$i]['MaxRate'] += (int) $row['MaxRate'];
$mapHandled[$i]['ModuleTitle'] = $row['ModuleName'];
$mapHandled[$i][$j]['SubmoduleID'] = $row['SubmoduleID'];
$mapHandled[$i][$j]['Title'] = $row['SubModuleName'];
$mapHandled[$i][$j]['Description'] = $row['SubmoduleDescription'];
$mapHandled[$i][$j]['Title'] = $row['SubModuleName'];
$mapHandled[$i][$j]['Description'] = $row['SubmoduleDescription'];
$mapHandled[$i][$j]['SubmoduleControl'] = $row['SubmoduleControl'];
$mapHandled[$i][$j]['MaxRate'] = (int) $row['MaxRate'];
$maxRate += $row['MaxRate'];
$mapHandled[$i][$j]['MaxRate'] = (int) $row['MaxRate'];
$maxRate += $row['MaxRate'];
if ($row['SubmoduleControl'] == 'CurrentControl')
$mapHandled[$i]['CurrentControl'] += (int) $row['MaxRate'];
if ($row['SubmoduleControl'] == 'LandmarkControl')
......
......@@ -212,8 +212,19 @@ class Model_Teacher_Map extends Model
return DB::query(Database::SELECT, $sql)->execute();
}
public function SearchStudentsNew($Grade, $GroupN, $FacultyID, $Last, $First, $Second, $DisciplineID)
{
$sql = "CALL `SearchStudentsNew`('$Grade', '$GroupN', '$FacultyID', '$Last', '$First', '$Second', '$DisciplineID'); ";
return DB::query(Database::SELECT, $sql)->execute();
}
public function SearchTeachers($FacultyID, $DepartmentID, $Last, $First, $Second) {
$sql = "CALL `SearchTeachers`('$FacultyID', '$DepartmentID', '$Last', '$First', '$Second'); ";
return DB::query(Database::SELECT, $sql)->execute();
}
public function SearchTeacherNew($FacultyID, $DepartmentID, $Last, $First, $Second, $DisciplineID) {
$sql = "CALL `SearchTeacherNew`('$FacultyID', '$DepartmentID', '$Last', '$First', '$Second', '$DisciplineID'); ";
return DB::query(Database::SELECT, $sql)->execute();
}
}
......@@ -15,7 +15,7 @@
<div class="moduleGroup" id="{{ Map[i].ModuleID }}">
<div class="moduleHead">
<div class="name">
<input type="text" class="inputName ModuleName" value="{{ Map[i].ModuleTitle }}">
<input type="text" class="inputName ModuleName" value="{{ Map[i].ModuleTitle }}" >
</div>
<div class="currentControl">{{ Map[i].CurrentControl }}</div>
<div class="landmarkControl">{{ Map[i].LandmarkControl }}</div>
......
......@@ -25,13 +25,13 @@
display: inline;
float: left;
margin: 2px 3px 2px 0px;
}
.tabs .tab a:link{
}
.tabs .tab a {
display: block;
background: #EEEEEE;
padding: 5px 12px;
font-size: 13px;
color: #333;
color: #0183ce;
}
.tabs .tab a:hover {
background-color: #3399CC;
......
......@@ -524,7 +524,8 @@ function CallSearchStudents() {
'FacultyID': FacultyID,
'Last': Name[0],
'First': Name[1],
'Second': Name[2]
'Second': Name[2],
'DisciplineID': DisciplineID
},
function(data){
SearchResult = $.parseJSON(data);
......@@ -571,6 +572,13 @@ $('.InputStudentName').focusout(function(){
CallSearchStudents();
});
$('.SelectGrade').focusout(function(){
$('.SelectGrade').trigger('change');
});
$('.SelectStudyGroup').focusout(function(){
$('.SelectStudyGroup').trigger('change');
});
// Прикрепить студента
$('.StudentsList').on('click', '.Action_BindStudent', function(){
$(this)
......@@ -649,7 +657,8 @@ function CallSearchTeachers(){
'DepartmentID': $('.SelectDepartment').val(),
'Last': Name[0],
'First': Name[1],
'Second': Name[2]
'Second': Name[2],
'DisciplineID': DisciplineID
},
function(data){
SearchResult = $.parseJSON(data);
......@@ -696,6 +705,14 @@ $('.SelectDepartment ').change(function(){
$('.InputTeacherName').focusout(function(){
CallSearchTeachers();
});
$('.SelectFaculty').focusout(function(){
$('.SelectFaculty').trigger('change');
});
$('.SelectDepartment').focusout(function(){
$('.SelectDepartment').trigger('change');
});
// Конец поиска преподавателей
// Отсоединить преподавателя
......
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