Subversion-Projekte lars-tiefland.shop_ns

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
<?php
2
 
3
    /**
4
     * @author Lars Tiefland
5
     * @copyright 2012
6
     */
7
 
8
    namespace Weban;
9
    class hersteller
10
    {
11
        public function __construct( $id )
12
        {
13
            $sql = "SELECT
14
                    id,
15
                    name,
16
                    logo,
17
                    homepage
18
                FROM
19
                    hersteller
20
                WHERE
21
                    id = $id
22
            ";
23
            $res = $GLOBALS["db"]->query( $sql );
24
            $row = $res->fetchRow();
25
            $this->id = $row["id"];
26
            $this->name = $row["name"];
27
            $this->logo = $row["logo"];
28
            $this->homepage = $row["homepage"];
29
        }
30
 
31
        public static function Liste()
32
        {
33
            $sql = "SELECT
34
                    id
35
                FROM
36
                    hersteller
37
            ";
38
            $res = $GLOBALS["db"]->query( $sql );
39
            while ( $row = $res->fetchRow() )
40
            {
41
                $ret[] = new hersteller( $row["id"] );
42
            }
43
            return $ret;
44
        }
45
    }
46
?>