- 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
+26 -16
View File
@@ -23,10 +23,16 @@
* Klasse ort (FAS-Online)
* @create 04-12-2006
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
require_once(dirname(__FILE__).'/datum.class.php');
class ort extends basis_db
// CI
require_once(dirname(__FILE__).'/../ci_hack.php');
require_once(dirname(__FILE__).'/../application/models/ressource/Ort_model.php');
class ort extends Ort_model
{
use db_extra; //CI Hack
public $new; // boolean
public $result = array(); // ort Objekt
@@ -72,29 +78,33 @@ class ort extends basis_db
* Laedt alle verfuegbaren Orte
* @return true wenn ok, false im Fehlerfall
*/
public function getAll($raumtyp_kurzbz=null)
public function getAll($raumtyp_kurzbz = null)
{
$qry = 'SELECT * FROM public.tbl_ort ORDER BY ort_kurzbz;';
if(!is_null($raumtyp_kurzbz) && $raumtyp_kurzbz!='')
parent::addOrder('ort_kurzbz');
if (!is_null($raumtyp_kurzbz) && $raumtyp_kurzbz != '')
{
$qry = '
SELECT
tbl_ort.*
FROM
public.tbl_ort
JOIN public.tbl_ortraumtyp USING(ort_kurzbz)
WHERE raumtyp_kurzbz='.$this->db_add_param($raumtyp_kurzbz).'
ORDER BY ort_kurzbz;';
$result = parent::addJoin('public.tbl_ortraumtyp', 'ort_kurzbz');
if ($result->error == EXIT_SUCCESS)
{
$result = parent::loadWhere(array('raumtyp_kurzbz' => $raumtyp_kurzbz));
}
}
if(!$this->db_query($qry))
else
{
$result = parent::loadWhole();
}
if (!is_object($result) || (is_object($result) && ($result->error != EXIT_SUCCESS || !is_array($result->retval))))
{
$this->errormsg = 'Fehler beim Laden der Datensaetze';
return false;
}
while($row = $this->db_fetch_object())
for ($i = 0; $i < count($result->retval); $i++)
{
$row = $result->retval[$i];
$ort_obj = new ort();
$ort_obj->ort_kurzbz = $row->ort_kurzbz;