Skip to content
Snippets Groups Projects
Commit 25eaaa2b authored by xamgore's avatar xamgore
Browse files

Removed all unused files from the DataArr folder

parent d6aba19f
Branches
Tags
No related merge requests found
Showing
with 0 additions and 534 deletions
<?php
/** @deprecated use Model_Departments instead. */
class DataArr_Departments {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Departments;
}
/** @deprecated */
public function byFaculty($facultyID)
{
if($facultyID != 0)
{
$departaments = $this->model->getDepartmentsByFaculty($facultyID);
$departamentsHandled = array(); $i = 0;
foreach($departaments as $row)
{
$i++;
$departamentsHandled[$i]['ID'] = $row['ID'];
if($row['Name'] != null)
{
$departamentsHandled[$i]['Name'] = $row['Name'];
}
else {
$departamentsHandled[$i]['Name'] = '<служебная кафедра>';
}
}
return new DataArray_Result($departamentsHandled);
}
}
}
<?php
/** @deprecated use Model_Disciplines instead. */
class DataArr_Disciplines {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Disciplines;
}
/** @deprecated */
public function forGroup($GroupID) {
$teacherModel = new Model_Teacher_Rating;
$Disciplines = $teacherModel->getDisciplinesForGroup($GroupID);
$DisciplinesHandled = array();
$i = 0;
foreach($Disciplines as $row) {
$i++;
$DisciplinesHandled[$i]['DisciplineID'] = $row['DisciplineID'];
$DisciplinesHandled[$i]['SubjectName'] = $row['SubjectName'];
$DisciplinesHandled[$i]['ExamType'] = $row['ExamType'];
}
return new DataArray_Result($DisciplinesHandled);
}
// Методы для получения списка дисциплин
}
\ No newline at end of file
<?php
/** @deprecated use Model_Faculties instead. */
class DataArr_Faculties {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Faculties;
}
/** @deprecated */
public function common() {
$list = $this->model->GetFaculties();
$FacList = array(); $i = 0;
foreach ($list as $row) {
$i++;
$FacList[$i]['ID'] = $row['ID'];
$FacList[$i]['Name'] = $row['Name'];
$FacList[$i]['Abbr'] = $row['Abbr'];
}
return new DataArray_Result($FacList);
}
// Метод для получения факультетов
}
\ No newline at end of file
<?php
/** @deprecated use Model_Grades instead. */
class DataArr_Grades {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Grades;
}
/** @deprecated */
public function common() {
$GradeList = $this->model->GetGrades();
$Grade = array(); $i = 0;
foreach ($GradeList as $row){
$i++;
$Grade[$i]['ID'] = $row['ID'];
$Grade[$i]['Num'] = $row['Num'];
$Grade[$i]['Degree'] = $row['Degree'];
if ($row['Degree'] == 'bachelor' || $row['Degree'] == 'specialist')
$Grade[$i]['Title'] = 'Курс '.$row['Num'];
if ($row['Degree'] == 'master')
$Grade[$i]['Title'] = 'Магистратура '.$row['Num'];
}
return new DataArray_Result($Grade);
}
/** @deprecated */
public function structured() {
$grades = $this->common()->asArray();
$gradesHandled = array(); $i = $j = 0; $degree = 'null';
foreach($grades as $row)
{
if($degree != $row['Degree'])
{
$degree = $row['Degree'] ;
$i++; $j = 0;
}
$j++;
$gradesHandled[$i]['Title'] = Model_Grades::getDegreeTitle($row['Degree']);
$gradesHandled[$i]['Grades'][$j]['ID'] = $row['ID'];
$gradesHandled[$i]['Grades'][$j]['Num'] = $row['Num'];
}
return new DataArray_Result($gradesHandled);
}
}
<?php
/** @deprecated use Model_Groups instead. */
class DataArr_Groups {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Groups;
}
/** @deprecated */
public function forDiscipline($DisciplineID) {
$Groups = $this->model->getGroupsForDiscipline($DisciplineID);
$GroupsHandled = array();
$i = 0;
foreach($Groups as $row) {
$i++;
$GroupsHandled[$i]['ID'] = $row['ID'];
$GroupsHandled[$i]['GradeNum'] = $row['GradeNum'];
$GroupsHandled[$i]['GroupNum'] = $row['GroupNum'];
$GroupsHandled[$i]['SpecName'] = $row['SpecName'];
$GroupsHandled[$i]['SpecAbbr'] = $row['SpecAbbr'];
}
return new DataArray_Result($GroupsHandled);
}
/** @deprecated */
public function ordByGroups($GradeID, $FacultyID) {
$Groups = $this->model->getGroups($GradeID, $FacultyID);
$GroupsHandled = array();
$i = 0;
foreach($Groups as $row) {
$i++;
$GroupsHandled[$i]['ID'] = $row['ID'];
$GroupsHandled[$i]['GroupNum'] = $row['GroupNum'];
$GroupsHandled[$i]['SpecID'] = $row['SpecID'];
$GroupsHandled[$i]['SpecName'] = $row['SpecName'];
$GroupsHandled[$i]['SpecAbbr'] = $row['SpecAbbr'];
}
return new DataArray_Result($GroupsHandled);
}
// Методы для получения списка учебных групп
}
\ No newline at end of file
<?php
/** @deprecated */
class DataArr_JobPositions {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_JobPositions;
}
// Метод для получения должностных позиций
}
<?php
/** @deprecated use Model_Semesters instead. */
class DataArr_Semesters {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Semesters;
}
/** @deprecated */
public function bySemester($SemesterID){
$departaments = $this->model->getSemesterInfo($SemesterID);
return new DataArray_Result($departaments);
}
/** @deprecated */
public function getList()
{
$semesters = $this->model->getSemesters();
$semestersHandled = array(); $i = 0;
foreach($semesters as $value)
{
$semestersHandled[$i] = $value;
$semestersHandled[$i]['Num'] = $value['Num'] == 1 ? 'Осенний' : 'Весенний';
$i++;
}
return $semestersHandled;
}
}
<?php
/** @deprecated */
class DataArr_Specializations {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Specializations;
}
// Метод для получения списка специализаций
}
\ No newline at end of file
<?php
/*
attach - прикреплен
detach - откреплен
NULL - в основной группе
*/
/** @deprecated use Model_Students instead. */
class DataArr_Students {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Students;
}
/** @deprecated */
public function byStudyGroup($groupID)
{
$students = $this->model->getStudentsByGroups($groupID);
return new DataArray_Result($this->generateArray($students));
}
/** @deprecated */
public function byFaculty($facultyID, $gradeID, $groupID)
{
$students = $this->model->getStudentsByFaculty($facultyID, $gradeID, $groupID);
return new DataArray_Result($this->generateArray($students));
}
/** @deprecated */
public function byGrade($gradeID)
{
$students = $this->model->getStudentsByGrade($gradeID);
return new DataArray_Result($this->generateArray($students));
}
/** @deprecated */
public function getDegreeTitle($degree)
{
return Model_Grades::getDegreeTitle($degree);
}
/** @deprecated */
protected function generateArray($students)
{
$studentsHandled = array(); $i = 0;
foreach($students as $row)
{
$i++;
$studentsHandled[$i]['ID'] = $row['ID'];
$studentsHandled[$i]['LastName'] = $row['LastName'];
$studentsHandled[$i]['FirstName'] = $row['FirstName'];
$studentsHandled[$i]['SecondName'] = $row['SecondName'];
$studentsHandled[$i]['GroupID'] = $row['GroupID'];
$studentsHandled[$i]['GroupNum'] = $row['GroupNum'];
$studentsHandled[$i]['GradeID'] = $row['GradeID']; // ID курса
$studentsHandled[$i]['GradeNum'] = $row['GradeNum']; // НОМЕР курса, а не ID... ID почти всегда <> НОМЕРУ курса
$studentsHandled[$i]['Degree'] = $this->getDegreeTitle($row['Degree']);
}
return $studentsHandled;
}
/** @deprecated */
public function NotAttendingDiscipline($GradeID, $GroupID, $FacultyID, $Name, $DisciplineID)
{
$students = $this->model->SearchStudents($GradeID, $GroupID, $FacultyID, $Name, $DisciplineID);
//echo Debug::vars($students);
return new DataArray_Result($this->generateArray($students));
}
}
<?php
/** @deprecated use Model_Subjects instead. */
class DataArr_Subjects {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Subjects;
}
/** @deprecated */
public function byFaculty($FacultyID) {
$list = $this->model->getSubjects($FacultyID);
$SubjectsList = array(); $i = 0;
foreach ($list as $row) {
$i++;
$SubjectsList[$i]['ID'] = $row['ID'];
$SubjectsList[$i]['Title'] = $row['Name'];
$SubjectsList[$i]['Abbr'] = $row['Abbr'];
}
return new DataArray_Result($SubjectsList);
}
}
<?php
/** @deprecated use Model_Teachers instead. */
class DataArr_Teachers {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Teachers;
}
/** @deprecated */
public function byFaculty($facultyID)
{
if($facultyID != 0)
{
$teachers = $this->model->getTeachersByFaculty($facultyID);
$i = 0;
foreach($teachers as $row)
{
$i++;
$teachersHandled[$i]['ID'] = $row['ID'];
$teachersHandled[$i]['AccountID'] = $row['AccountID'];
$teachersHandled[$i]['FirstName'] = $row['FirstName'];
$teachersHandled[$i]['SecondName'] = $row['SecondName'];
$teachersHandled[$i]['LastName'] = $row['LastName'];
$teachersHandled[$i]['JobPositionName'] = $row['JobPositionName'];
$teachersHandled[$i]['DepartmentID'] = $row['DepID'];
$teachersHandled[$i]['DepartmentName'] = $row['DepName'];
}
}
return new DataArray_Result($teachersHandled);
}
/** @deprecated */
public function byDepartment($departmentID)
{
$teachers = $this->model->getTeachersByDepartment($departmentID);
$i = 0;
foreach($teachers as $row)
{
$i++;
$teachersHandled[$i]['ID'] = $row['ID'];
$teachersHandled[$i]['AccountID'] = $row['AccountID'];
$teachersHandled[$i]['FirstName'] = $row['FirstName'];
$teachersHandled[$i]['SecondName'] = $row['SecondName'];
$teachersHandled[$i]['LastName'] = $row['LastName'];
$teachersHandled[$i]['JobPositionName'] = $row['JobPositionName'];
$teachersHandled[$i]['DepartmentName'] = $row['DepName'];
}
return new DataArray_Result($teachersHandled);
}
/** @deprecated */
public function forDiscipline($disciplineID, $asConcat = false, $asInitials = false)
{
$teachers = $this->model->getTeachersForDiscipline($disciplineID);
$teachersHandled = array(); $i = 0;
foreach ($teachers as $teacher)
{
$i++; $tchr = array();
$tchr['IsAuthor'] = $teacher['IsAuthor'];
$tchr['ID'] = $teacher['ID'];
$tchr['LastName'] = $teacher['LastName'];
$tchr['FirstName'] = $asInitials ?
UTF8::substr($teacher['FirstName'], 0, 1).'. ' : $teacher['FirstName'];
if(!empty($teacher['SecondName']))
$tchr['SecondName'] = $asInitials ?
UTF8::substr($teacher['SecondName'], 0, 1).'. ' : $teacher['SecondName'];
if($asConcat)
$teachersHandled[$i] = $tchr['LastName'].$tchr['FirstName'].$tchr['SecondName'];
else
$teachersHandled[$i] = $tchr;
}
return new DataArray_Result($teachersHandled);
}
}
<?php
/** @deprecated */
class DataArr_Tickets {
protected $model;
public function __construct() {
$this->model = new Model_DataArr_Tickets;
}
/** @deprecated */
public function forAccount($accountID)
{
}
/** @deprecated */
public function forAdministrator()
{
}
}
Все файлы в этой директории устарели и запрещены к использованию (deprecated).
Вместо них есть аналогичные классы в папке `Models`.
\ No newline at end of file
<?php defined('SYSPATH') or die('No direct script access.');
/** @deprecated */
class DataArray
{
/** @deprecated */
public static function factory($type = NULL) {
if($type == NULL)
return false;
else
{
$className = 'DataArr_'.$type;
return new $className();
}
}
}
\ No newline at end of file
<?php defined('SYSPATH') or die('No direct script access.');
/** @deprecated use Model_Departments instead. */
class Model_DataArr_Departments extends Model
{
/** @deprecated */
public function getDepartmentsByFaculty($facultyID)
{
$sql = "CALL `GetDepartments`('$facultyID'); ";
return DB::query(Database::SELECT, $sql)->execute();
}
}
<?php defined('SYSPATH') or die('No direct script access.');
/** @deprecated use Model_Disciplines instead. */
class Model_DataArr_Disciplines extends Model
{
}
<?php defined('SYSPATH') or die('No direct script access.');
/** @deprecated use Model_Faculties instead. */
class Model_DataArr_Faculties extends Model
{
/** @deprecated */
public function getFaculties()
{
$sql = "CALL `GetFaculties`(); ";
return DB::query(Database::SELECT, $sql)->execute();
}
}
<?php defined('SYSPATH') or die('No direct script access.');
/** @deprecated use Model_Grades instead. */
class Model_DataArr_Grades extends Model
{
/** @deprecated */
public function getGrades()
{
$sql = "CALL `GetGrades`();";
return DB::query(Database::SELECT, $sql)->execute();
}
}
<?php defined('SYSPATH') or die('No direct script access.');
/** @deprecated use Model_Groups instead. */
class Model_DataArr_Groups extends Model
{
/** @deprecated */
public function getGroupsForDiscipline($disciplineID)
{
$sql = "CALL `GetGroupsForDiscipline`('$disciplineID'); ";
return DB::query(Database::SELECT, $sql)->execute();
}
/** @deprecated */
public function getGroups($grade, $facultyID)
{
$sql = "CALL `GetGroups`('$grade', '$facultyID'); ";
return DB::query(Database::SELECT, $sql)->execute();
}
}
<?php defined('SYSPATH') or die('No direct script access.');
/** @deprecated */
class Model_DataArr_JobPositions extends Model
{
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment