mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-25 10:13:22 +01:00
Nouveaux fichiers
This commit is contained in:
100
htdocs/commande/commande.class.php
Normal file
100
htdocs/commande/commande.class.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?PHP
|
||||
/* 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$
|
||||
*
|
||||
*/
|
||||
|
||||
class Commande {
|
||||
var $db ;
|
||||
|
||||
var $id ;
|
||||
var $client_name ;
|
||||
|
||||
Function Commande($DB, $id=0) {
|
||||
$this->db = $DB;
|
||||
$this->id = $id ;
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
Function fetch ($id) {
|
||||
|
||||
$sql = "SELECT o.orders_id, o.customers_name, o.orders_status FROM ".DB_NAME_OSC.".orders as o";
|
||||
|
||||
$sql .= " WHERE o.orders_id = $id";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
if ( $result ) {
|
||||
$result = $this->db->fetch_array();
|
||||
|
||||
$this->id = $result["rowid"];
|
||||
$this->client_name = $result["customers_name"];
|
||||
|
||||
$this->nom_url = '<a href="/commande/fiche.php?id='.$result["rowid"].'">'.$result["nom"].'</a>';
|
||||
|
||||
}
|
||||
$this->db->free();
|
||||
|
||||
return $result;
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
Function liste_products ()
|
||||
{
|
||||
$ga = array();
|
||||
|
||||
$sql = "SELECT a.rowid, a.title FROM llx_album as a, llx_album_to_groupart as l";
|
||||
$sql .= " WHERE a.rowid = l.fk_album AND l.fk_groupart = ".$this->id;
|
||||
$sql .= " ORDER BY a.title";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
$nump = $this->db->num_rows();
|
||||
|
||||
if ($nump)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($i);
|
||||
|
||||
$ga[$obj->rowid] = $obj->title;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $ga;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user