*** empty log message ***

This commit is contained in:
Rodolphe Quiedeville 2002-05-04 15:27:52 +00:00
parent 19fbbc7401
commit 1bb8eb5b8e

View File

@ -1,7 +1,8 @@
<?PHP <?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Class Product *
* $Id$ * $Id$
* $Source$
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,30 +21,35 @@
*/ */
class Product { class Product {
var $id ;
var $price ;
var $db ; var $db ;
var $id ;
var $ref;
var $label;
var $description;
var $price ;
Function Product($DB, $id=0) { Function Product($DB, $id=0) {
$this->db = $DB; $this->db = $DB;
$this->id = $id ; $this->id = $id ;
$this->price = $price ;
} }
Function fetch () { Function fetch ($id) {
$sql = "SELECT rowid, price FROM llx_product WHERE rowid = $this->id"; $sql = "SELECT rowid, ref, label, description, price FROM llx_product WHERE rowid = $id";
$result = $this->db->query($sql) ; $result = $this->db->query($sql) ;
if ( $result ) { if ( $result ) {
$result = $this->db->fetch_array(); $result = $this->db->fetch_array();
$this->price = $result["price"]; $this->id = $result["rowid"];
$this->id = $result["rowid"]; $this->ref = $result["ref"];
$this->label = $result["label"];
$this->description = $result["description"];
$this->price = $result["price"];
} }
return $result; return $result;
} }