2004-10-19 21:31:11 +02:00
< ? php
2003-03-24 22:50:34 +01:00
/* Copyright ( C ) 2003 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
*
* 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
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*
* $Id $
* $Source $
*
*/
2005-08-24 18:37:10 +02:00
/**
\file htdocs / boutique / client / client . class . php
\brief Classe permettant de g<EFBFBD> rer des clients de la boutique online
\author Rodolphe Quiedeville
\version $Revision $
2004-07-28 21:36:48 +02:00
*/
2009-01-31 02:17:53 +01:00
/**
2005-08-24 18:37:10 +02:00
\class Client
\brief Classe permettant de g<EFBFBD> rer des clients de la boutique online
2004-07-28 21:36:48 +02:00
*/
2005-08-24 18:37:10 +02:00
class Client
{
var $db ;
2003-03-24 22:50:34 +01:00
2005-08-24 18:37:10 +02:00
var $id ;
var $nom ;
2003-03-24 22:50:34 +01:00
2005-08-24 18:37:10 +02:00
function Client ( $DB , $id = 0 )
{
$this -> db = $DB ;
$this -> id = $id ;
}
2004-07-28 21:36:48 +02:00
2005-08-24 18:37:10 +02:00
/**
2005-09-02 23:56:45 +02:00
\brief Fonction permettant de recup<EFBFBD> rer les informations d ' un clients de la boutique
\param id Id du client
2005-08-24 18:37:10 +02:00
*/
function fetch ( $id )
{
2009-01-31 02:17:53 +01:00
global $conf ;
2005-08-24 18:37:10 +02:00
2009-01-31 02:17:53 +01:00
$sql = " SELECT customers_id, customers_lastname, customers_firstname FROM " . $conf -> global -> OSC_DB_NAME . " . " . $conf -> global -> OSC_DB_TABLE_PREFIX . " customers WHERE customers_id = $id " ;
2005-08-24 18:37:10 +02:00
$result = $this -> db -> query ( $sql ) ;
2004-07-28 21:36:48 +02:00
2005-08-24 18:37:10 +02:00
if ( $result )
{
$result = $this -> db -> fetch_array ();
2003-03-24 22:50:34 +01:00
2005-08-24 18:37:10 +02:00
$this -> id = $result [ " customers_id " ];
$this -> name = stripslashes ( $result [ " customers_firstname " ]) . " " . stripslashes ( $result [ " customers_lastname " ]);
2003-03-24 22:50:34 +01:00
2005-08-24 18:37:10 +02:00
$this -> db -> free ();
}
else
{
print $this -> db -> error ();
}
2003-03-24 22:50:34 +01:00
2005-08-24 18:37:10 +02:00
return $result ;
}
2003-03-24 22:50:34 +01:00
}
?>