public function actionId($user_id) { $data = $this->model->get($user_id); $this->setTitle("Učitel " . $data->firstname . " " . $data->lastname); $this->template->data = $data; $loadsGrid = $this["loadsGrid"]; $loadsGrid->setModel($this->loadsModel->getSelection()->where(array("sch_teacher_id" => $user_id))); }
public function actionId($id) { $data = $this->model->get($id); $this->setTitle("Vyučovací předmět " . $data->name); $this->template->data = $data; $loadsGrid = $this["loadsGrid"]; $loadsGrid->setModel($this->loadsModel->getSelection()->where(array("sch_subject_id" => $id))); }
public function actionId($id) { $get = $this->request->getParameters(); if (isset($get["sch_group_id"])) { $id = $get["sch_group_id"]; } $data = $this->model->get($id); $this->setTitle("Studijní skupina " . $data->shortname . " ze třídy " . $data->class); $this->template->data = $data; $membersGrid = $this["membersGrid"]; $membersGrid->setModel($this->membersModel->getSelection()->where(array("sch_group_id" => $id))->orderBy("firstname, lastname")); $loadsGrid = $this["loadsGrid"]; $loadsGrid->setModel($this->loadsModel->getSelection()->where(array("sch_group_id" => $id))); }
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")); } }