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
+5
View File
@@ -163,6 +163,11 @@ class adresse extends basis_db
/**
* Laedt alle Adressen zu der Firma die uebergeben wird
*
* ACHTUNG: Diese Funktion wird nur mehr fuer Lehrauftraege benoetigt.
* Die Adresse zu einer Firma wird nun ueber die Tabelle Standort hergestellt!
*
* @deprec 2.0
* @param $firma_id ID der Firma zu der die Adressen geladen werden sollen
* @return true wenn ok, false im Fehlerfall
*/
+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
+1 -1
View File
@@ -186,7 +186,7 @@ class standort extends basis_db
}
//Lesen der Daten aus der Datenbank
$qry = "SELECT * FROM public.tbl_standort WHERE firma_id='".addslashes($firma_id)."'";
$qry = "SELECT * FROM public.tbl_standort WHERE firma_id='".addslashes($firma_id)."' ORDER BY standort_id";
if(!$this->db_query($qry))
{
+2 -1
View File
@@ -61,7 +61,8 @@ $menu=array
),
'Firma'=>array
(
'name'=>'Firma anlegen', 'link'=>'firma.php?method=new', 'target'=>'content',
'name'=>'Firma', 'link'=>'firma.php', 'target'=>'content','permissions'=>array('wawi/firma'),
'FirmaNeu'=>array('name'=>'Neu', 'link'=>'firma.php?method=new', 'target'=>'content'),
)
),
'Auswertungen'=> array