Skip to content
Snippets Groups Projects
Forked from it-lab / grade
Source project has a limited visibility.
Students.php 1.77 KiB
<?php defined('SYSPATH') or die('No direct script access.');
  
class Model_DataArr_Students extends Model
{
    public function getStudentsByStudyGroups($groupID)
    {
        $sql = "CALL `GetStudentsByStudyGroups`('$groupID'); ";
        return DB::query(Database::SELECT, $sql)->execute();
    }    
    
    public function getStudentsByFaculty($facultyID)
    {
        $sql = "CALL `GetStudentsByFaculty`('$facultyID'); ";
        return DB::query(Database::SELECT, $sql)->execute();
    }
    
    public function getStudentsByGradeID($facultyID, $gradeID)
    {
        $sql = "CALL `GetStudentsByFaculty`('$facultyID'); ";
        return DB::query(Database::SELECT, $sql)->execute();
    }

    public function getStudentsForDiscipline($teacherID, $disciplineID)
    {
        $sql = "CALL `getStudentsForDiscipline`('$teacherID', '$disciplineID'); ";
        return DB::query(Database::SELECT, $sql)->execute();
    }


    // public function searchStudents($Grade, $GroupN, $FacultyID, $Last, $First, $Second)
    // {
    //     $sql = "CALL `SearchStudents`('$Grade', '$GroupN', '$FacultyID', '$Last', '$First', '$Second'); ";
    //     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 SearchStudents($GradeID, $GroupID, $FacultyID, $Name, $DisciplineID)
    {
        $sql = "CALL `SearchStudents`('$GradeID', '$GroupID', '$FacultyID', '$Name', '$DisciplineID'); ";
        return DB::query(Database::SELECT, $sql)->execute();
    }
}