예제 #1
0
 /**
  * @param attcontrol $att
  * @param bool $isexport
  * @param null $studentid
  */
 public function __construct(attcontrol $att, $isexport = false, $studentid = null)
 {
     global $CFG;
     $this->perm = $att->perm;
     $this->pageparams = $att->pageparams;
     if ($studentid) {
         $this->pageparams->set_current_student($studentid);
     }
     //Populate pagination parameters
     if (!$isexport) {
         $this->page = optional_param('page', 0, PARAM_INT);
         $this->perpage = get_user_preferences('attcontrol_perpage', 10);
         $this->offset = $this->page * $this->perpage;
     }
     $this->currentstudent = $this->pageparams->get_current_student();
     if ($isexport) {
         $this->logs = $att->get_individual_report($this->currentstudent);
     } else {
         $this->logs = $att->get_individual_report($this->currentstudent, $this->offset, $this->perpage);
         $this->total = $att->get_individual_report_count($this->currentstudent);
     }
     if ($this->currentstudent != att_individualreport_page_params::SELSTUDENT_NONE) {
         $this->studentinfo = $att->get_student_info($this->currentstudent);
     }
     $this->statuses = $att->get_statuses();
     $this->att = $att;
 }