Update Funktion getPrestudentIdFromBenutzerId

This commit is contained in:
ma0068
2021-11-02 15:14:00 +01:00
parent f37161dcc2
commit b549fc1edd
3 changed files with 38 additions and 38 deletions
@@ -46,7 +46,7 @@ require_once ('../../../../include/notenschluessel.class.php');
require_once ('../../../../include/studienplan.class.php');
require_once ('../../../../include/addon.class.php');
require_once ('../../../../include/mobilitaet.class.php');
require_once ('../../../../include/prestudent.class.php');
require_once ('../../../../include/student.class.php');
$summe_stud = 0;
$summe_t2 = 0;
@@ -1133,8 +1133,8 @@ if (defined("CIS_GESAMTNOTE_PRUEFUNG_MOODLE_LE_NOTE") && CIS_GESAMTNOTE_PRUEFUNG
$grades[$row_stud->uid]['vorname'] = $row_stud->vorname;
$grades[$row_stud->uid]['nachname'] = $row_stud->nachname;
$ps = new prestudent();
$prestudent_id = $ps->getPrestudentFromBenutzer($row_stud->uid, $stg_obj->studiengang_kz, $stsem);
$ps = new student();
$prestudent_id = $ps->getPrestudentIdFromBenutzerId($row_stud->uid, $stg_obj->studiengang_kz);
$mobility = new mobilitaet();
$mobility->loadPrestudent($prestudent_id);
$output = $mobility->result;
-34
View File
@@ -2463,38 +2463,4 @@ class prestudent extends person
return false;
}
}
/**
* Ermittelt den Prestudenten mithilfe der UID, des Studiengangs und des Semesters
* @param string $uid UID des Benutzers (zum Beispiel se15m007).
* @param int $stg_kz Kennzeichen Studiengang (zum Beispiel 299).
* @return int prestudent_id
*/
public function getPrestudentFromBenutzer($uid, $stg_kz)
{
$qry = "SELECT
prestudent_id
FROM public.tbl_student
WHERE student_uid = ".$this->db_add_param($uid)."
AND studiengang_kz = ".$this->db_add_param($stg_kz, FHC_INTEGER).";";
if ($this->db_query($qry))
{
if ($row = $this->db_fetch_object())
{
$prestudent_id = $row->prestudent_id;
return $prestudent_id;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}
+35 -1
View File
@@ -571,7 +571,7 @@ class student extends benutzer
{
$qry = "SELECT tbl_student.* FROM public.tbl_benutzer JOIN public.tbl_student ON(uid=student_uid)
WHERE person_id=".$this->db_add_param($person_id, FHC_INTEGER);
if($studiengang_kz != '')
{
$qry .= " AND studiengang_kz=".$this->db_add_param($studiengang_kz, FHC_INTEGER);
@@ -896,4 +896,38 @@ class student extends benutzer
return null;
}
}
/**
* Ermittelt den Prestudenten mithilfe der UID, des Studiengangs und des Semesters
* @param string $uid UID des Benutzers (zum Beispiel se15m007).
* @param int $stg_kz Kennzeichen Studiengang (zum Beispiel 299).
* @return int prestudent_id
*/
public function getPrestudentIdFromBenutzerId($uid, $stg_kz)
{
$qry = "SELECT
prestudent_id
FROM public.tbl_student
WHERE student_uid = ".$this->db_add_param($uid)."
AND studiengang_kz = ".$this->db_add_param($stg_kz, FHC_INTEGER).";";
if ($this->db_query($qry))
{
if ($row = $this->db_fetch_object())
{
$prestudent_id = $row->prestudent_id;
return $prestudent_id;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}