Пример #1
0
 public function actionId($id)
 {
     $data = $this->model->get($id);
     $this->setTitle("Třída " . $data->shortname);
     $this->template->data = $data;
     $studentsGrid = $this["studentsGrid"];
     $studentsGrid->setModel($this->studentsModel->getSelection()->where(array("class_id" => $id))->orderBy("catalog_number"));
     $groupsGrid = $this["groupsGrid"];
     $groupsGrid->setModel($this->groupsModel->getSelection()->where(array("sch_class_id" => $id)));
 }
Пример #2
0
 public function actionId($user_id)
 {
     $data = $this->model->get($user_id);
     $this->setTitle("Student " . $data->firstname . " " . $data->lastname);
     $this->template->data = $data;
     $groupsGrid = $this["groupsGrid"];
     $groupsGrid->setModel($this->groupsModel->getSelection()->where(array("sch_group_membership.user_id" => $user_id)));
     $studentGroups = $this->membershipModel->getStudentsGroupsId($user_id);
     $studentGroupList = array();
     foreach ($studentGroups as $gr) {
         $studentGroupList[] = $gr->sch_group_id;
     }
     $studentGroupString = implode(",", $studentGroupList);
     $loadsGrid = $this["loadsGrid"];
     if ($studentGroupList) {
         $loadsGrid->setModel($this->loadsModel->getSelection()->where("sch_group_id IN(" . $studentGroupString . ")"));
     } else {
         $loadsGrid->setModel($this->loadsModel->getSelection()->where("sch_group_id = 0"));
     }
 }