Firmenverwaltung klein für WaWi

This commit is contained in:
Andreas Österreicher
2011-01-13 13:56:49 +00:00
parent e375353658
commit 78c6d4e88d
8 changed files with 378 additions and 54 deletions
+35
View File
@@ -392,6 +392,41 @@ class kontakt extends basis_db
return $this->result;
}
/**
* Laedt einen Kontakt eines Standortes
* Es wird nur der erste Eintrag zurueckgeliefert!
*
* @param $standort_id
* @param $kontakttyp
*/
public function loadFirmaKontakttyp($standort_id, $kontakttyp)
{
if(!is_numeric($standort_id))
{
$this->errormsg='StandortID ist ungueltig';
return false;
}
$qry = "SELECT * FROM public.tbl_kontakt WHERE standort_id='".addslashes($standort_id)."' AND kontakttyp='".addslashes($kontakttyp)."' ORDER BY kontakt_id LIMIT 1";
if($result = $this->db_query($qry))
{
if($row = $this->db_fetch_object($result))
{
$this->kontakt = $row->kontakt;
$this->kontakt_id = $row->kontakt_id;
return true;
}
else
return false;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
/**
* Laedt alle Kontakttypen
* @return true wenn ok