Subversion-Projekte lars-tiefland.inventar

Revision

Revision 22 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<?php

        //$Id: hardware.class.php 6 2008-05-10 16:29:22Z lars $

        /**
         * @package     Inventar Datenbank
         * @author Lars Tiefland <ltiefland@gmail.com>
         * @copyright 2008
         **/

        class computer_hardware
        {
                private $id;
                private $comp_id;
                private $hardware_id;
                private $value;

                function __construct($id=0)
                {
                        if($id)
                        {
                                $res=$GLOBALS["db"]->query("SELECT * FROM computer_hardware WHERE id=$id");
                                $this->id=$id;
                                $row=$res->fetchRow();
                                $this->comp_id=$row["comp_id"]; 
                                $this->hardware_id=$row["hardware_id"]; 
                                $this->value=$row["value"];     
                        }       
                        else
                        {
                                $this->id=0;
                                $this->value='';
                                $this->hardware_id=0;
                                $this->comp_id=0;
                        }
                }
        }

?>