- Moved old libraries to CI

- Extended Controllers functionalities
- Added controls to ueberbuchung.php, zeitwuensche.php and funktion_det.php
pages to avoid warnings and notices, especially when no data are in DB
- Removed fhcdb_helper.php because it's no more needed
This commit is contained in:
paolo
2016-06-07 17:55:31 +02:00
parent 0dc605df3c
commit 3955d4b395
11 changed files with 176 additions and 544 deletions
+16 -31
View File
@@ -20,8 +20,6 @@
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once(dirname(__FILE__).'/datum.class.php');
// require_once(dirname(__FILE__).'/person.class.php');
// require_once(dirname(__FILE__).'/log.class.php');
// CI
require_once(dirname(__FILE__).'/../ci_hack.php');
@@ -108,20 +106,20 @@ class prestudent extends Prestudent_model
*/
public function load($prestudent_id)
{
if(!is_numeric($prestudent_id))
if (!is_numeric($prestudent_id))
{
$this->errormsg = 'ID ist ungueltig';
return false;
}
$qry = 'SELECT * '
. 'FROM public.tbl_prestudent '
. 'WHERE prestudent_id = '.$this->db_add_param($prestudent_id, FHC_INTEGER);
$result = parent::load($prestudent_id);
if($this->db_query($qry))
if (is_object($result) && $result->error == EXIT_SUCCESS && is_array($result->retval))
{
if($row = $this->db_fetch_object())
if (count($result->retval) > 0)
{
$row = $result->retval[0];
$this->prestudent_id = $row->prestudent_id;
$this->aufmerksamdurch_kurzbz = $row->aufmerksamdurch_kurzbz;
$this->studiengang_kz = $row->studiengang_kz;
@@ -156,10 +154,8 @@ class prestudent extends Prestudent_model
$this->zgvdoktordatum = $row->zgvdoktordatum;
$this->zgvdoktornation = $row->zgvdoktornation;
if(!person::load($row->person_id))
return false;
else
return true;
$person = new person();
return $person->load($row->person_id);
}
else
{
@@ -974,33 +970,22 @@ class prestudent extends Prestudent_model
* @param $studiensemester_kurzbz
* @return boolean
*/
public function getLastStatus($prestudent_id, $studiensemester_kurzbz='', $status_kurzbz = '')
public function getLastStatus($prestudent_id, $studiensemester_kurzbz = '', $status_kurzbz = '')
{
if($prestudent_id=='' || !is_numeric($prestudent_id))
if ($prestudent_id == '' || !is_numeric($prestudent_id))
{
$this->errormsg = 'Prestudent_id ist ungueltig';
return false;
}
$qry = "SELECT tbl_prestudentstatus.*, bezeichnung AS studienplan_bezeichnung,
tbl_status.bezeichnung_mehrsprachig
FROM public.tbl_prestudentstatus
LEFT JOIN lehre.tbl_studienplan USING (studienplan_id)
JOIN public.tbl_status USING (status_kurzbz)
WHERE tbl_status.status_kurzbz = tbl_prestudentstatus.status_kurzbz
AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER);
if($studiensemester_kurzbz!='')
$qry.=" AND studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
if($status_kurzbz !='')
$qry.= " AND status_kurzbz =".$this->db_add_param($status_kurzbz);
$qry.=" ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1";
if($this->db_query($qry))
$result = parent::getLastStatus($prestudent_id, $studiensemester_kurzbz, $status_kurzbz);
if (is_object($result) && $result->error != EXIT_SUCCESS && is_array($result->retval))
{
if($row = $this->db_fetch_object())
if (count($result->retval) > 0)
{
$row = $result->retval[0];
$this->prestudent_id = $row->prestudent_id;
$this->status_kurzbz = $row->status_kurzbz;
$this->status_mehrsprachig = $this->db_parse_lang_array($row->bezeichnung_mehrsprachig);