diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index cd88f814a..a97c9ef38 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -297,6 +297,13 @@ class InfoCenter extends Auth_Controller } $persondata = $this->_loadPersonData($person_id); + + $checkPerson = $this->PersonModel->checkDuplicate($person_id); + + if (isError($checkPerson)) show_error(getError($checkPerson)); + + $duplicate = array('duplicated' => getData($checkPerson)); + $prestudentdata = $this->_loadPrestudentData($person_id); $this->DokumentModel->addOrder('bezeichnung'); @@ -305,7 +312,8 @@ class InfoCenter extends Auth_Controller $data = array_merge( $persondata, $prestudentdata, - $dokumentdata + $dokumentdata, + $duplicate ); $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 085c3f826..ec5522674 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -265,4 +265,19 @@ class Person_model extends DB_Model return success($result->vorname. ' '. $result->nachname); } + + public function checkDuplicate($person_id) + { + $qry = "SELECT sp.person_id + FROM public.tbl_person p + LEFT JOIN public.tbl_person sp ON p.vorname = sp.vorname + AND p.nachname = sp.nachname + AND p.gebdatum = sp.gebdatum + JOIN public.tbl_prestudent ps ON sp.person_id = ps.person_id + JOIN public.tbl_prestudentstatus pss ON ps.prestudent_id = pss.prestudent_id + WHERE p.person_id = ? AND sp.person_id != ? AND pss.status_kurzbz = ?"; + + + return $this->execQuery($qry, array($person_id, $person_id, 'Abbrecher')); + } } diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 30acb8617..76a371c11 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -101,6 +101,22 @@ + +