diff --git a/include/wawi_tags.class.php b/include/wawi_tags.class.php new file mode 100644 index 000000000..5a3a6fb42 --- /dev/null +++ b/include/wawi_tags.class.php @@ -0,0 +1,101 @@ +, + * Andreas Oesterreicher and + * Karl Burkhart . + */ +/** + * Klasse WaWi Tags + */ + +require_once(dirname(__FILE__).'/basis_db.class.php'); +require_once(dirname(__FILE__).'/sprache.class.php'); + +class wawi_tags extends basis_db +{ + public $result = array(); // Konto Objekt + + //Tabellenspalten + public $tag; // integer + public $bestellung_id; // string + public $insertamum; // timestamp + public $insertvon; // string + + + + + /** + * Konstruktor + * @param $konto_id ID des Kontos das geladen werden soll (Default=null) + */ + public function __construct($tag=null) + { + parent::__construct(); + + if(!is_null($tag)) + $this->load($tag); + } + + public function GetTagsByBestellung($bestellung_id) + { + if(!is_numeric($bestellung_id)) + { + $this->errormsg = "Ungültige Bestellung ID"; + return false; + } + + $qry = "Select * from wawi.tbl_bestellungtag where bestellung_id = ".$bestellung_id.";"; + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $bestelltag = new wawi_tags(); + + $bestelltag->tag = $row->tag; + $bestelltag->bestellung_id = $row->bestellung_id; + $bestelltag->insertamum = $row->insertamum; + $bestelltag->insertvon = $row->insertvon; + + $this->result[] = $bestelltag; + } + } + else + { + $this->errormsg = "Fehler bei Abfrage aufgetreten."; + return false; + } + return true; + } + + public function GetStringTags() + { + $string = ''; + foreach($this->result as $row) + { + if($string!='') + $string.='; '; + $string.=($row->tag); + } + return $string; + } +} + + + +