actions new, update and delete aufnahmetermine

This commit is contained in:
ma0068
2025-04-25 16:15:27 +02:00
parent 2ab01132b1
commit bf0cd8e8e3
6 changed files with 556 additions and 161 deletions
@@ -550,4 +550,37 @@ class Reihungstest_model extends DB_Model
return $this->execQuery($query, array($person_id));
}
/**
* Loads all placement tests
* @return array Returns object array with data of placement tests
*/
//TODO(Manu) finish Details
public function getAllReihungstests()
{
$query = '
SELECT * FROM public.tbl_reihungstest
JOIN public.tbl_studiengang ON tbl_reihungstest.studiengang_kz = tbl_studiengang.studiengang_kz
-- JOIN lehre.tbl_studienplan sp USING(studienplan_id)
-- JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
ORDER BY datum DESC NULLS LAST, uhrzeit
';
return $this->execQuery($query);
}
public function getReihungstestsPs($prestudent_id)
{
$query = '
SELECT * FROM public.tbl_reihungstest
JOIN public.tbl_studiengang ON tbl_reihungstest.studiengang_kz = tbl_studiengang.studiengang_kz
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
ORDER BY datum DESC, uhrzeit
';
return $this->execQuery($query);
}
}
@@ -134,4 +134,17 @@ class Studienplan_model extends DB_Model
'prestudent_id' => $prestudent_id
]);
}
public function getStudienplaeneForPerson($person_id)
{
$this->addDistinct();
$this->addSelect($this->dbTable . '.*');
$this->addSelect('ps.*');
$this->addJoin('public.tbl_prestudentstatus pss', 'studienplan_id');
$this->addJoin('public.tbl_prestudent ps', 'prestudent_id');
return $this->loadWhere([
'person_id' => $person_id
]);
}
}