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