diff --git a/htdocs/boutique/client/class/client.class.php b/htdocs/boutique/client/class/boutiqueclient.class.php similarity index 96% rename from htdocs/boutique/client/class/client.class.php rename to htdocs/boutique/client/class/boutiqueclient.class.php index 5c00b14295d..47622512c7f 100644 --- a/htdocs/boutique/client/class/client.class.php +++ b/htdocs/boutique/client/class/boutiqueclient.class.php @@ -20,7 +20,7 @@ */ /** - * \file htdocs/boutique/client/client.class.php + * \file htdocs/boutique/client/class/boutiqueclient.class.php * \brief Classe permettant de gerer des clients de la boutique online * \author Rodolphe Quiedeville * \version $Revision$ @@ -30,7 +30,6 @@ * \class BoutiqueClient * \brief Classe permettant de gerer des clients de la boutique online */ - class BoutiqueClient { var $db ; diff --git a/htdocs/boutique/client/fiche.php b/htdocs/boutique/client/fiche.php index 869a062bd84..f4b1b1e3e05 100644 --- a/htdocs/boutique/client/fiche.php +++ b/htdocs/boutique/client/fiche.php @@ -28,7 +28,7 @@ */ require("../../main.inc.php"); -include_once(DOL_DOCUMENT_ROOT.'/boutique/client/client.class.php'); +include_once(DOL_DOCUMENT_ROOT.'/boutique/client/class/boutiqueclient.class.php'); /* diff --git a/htdocs/boutique/commande/class/commande.class.php b/htdocs/boutique/commande/class/boutiquecommande.class.php similarity index 90% rename from htdocs/boutique/commande/class/commande.class.php rename to htdocs/boutique/commande/class/boutiquecommande.class.php index 61d8c348b7a..a4accf0fc74 100644 --- a/htdocs/boutique/commande/class/commande.class.php +++ b/htdocs/boutique/commande/class/boutiquecommande.class.php @@ -18,27 +18,29 @@ */ /** - \file htdocs/boutique/commande/commande.class.php - \ingroup osc - \brief Fichier de la classe des commandes OSC - \version $Id$ + * \file htdocs/boutique/commande/class/boutiquecommande.class.php + * \ingroup osc + * \brief Fichier de la classe des commandes de la boutique online + * \version $Id$ */ require_once(DOL_DOCUMENT_ROOT ."/core/address.class.php"); +include_once(DOL_DOCUMENT_ROOT.'/boutique/commande/class/boutiquecommande.class.php'); /** - \class Commande - \brief Classe permettant la gestion des commandes OSC + * \class BoutiqueCommande + * \brief Classe permettant la gestion des commandes OSC */ -class Commande +class BoutiqueCommande { var $db ; var $id ; var $nom; - function Commande($DB, $id=0) { + function BoutiqueCommande($DB, $id=0) + { $this->db = $DB; $this->id = $id ; diff --git a/htdocs/boutique/commande/fiche.php b/htdocs/boutique/commande/fiche.php index d3189c17c03..4624cfeb915 100644 --- a/htdocs/boutique/commande/fiche.php +++ b/htdocs/boutique/commande/fiche.php @@ -22,57 +22,61 @@ */ /** - \file htdocs/boutique/commande/fiche.php - \ingroup boutique - \brief Page fiche commande OSCommerce - \version $Revision$ -*/ + \file htdocs/boutique/commande/fiche.php + \ingroup boutique + \brief Page fiche commande OSCommerce + \version $Revision$ + */ require("../../main.inc.php"); +include_once(DOL_DOCUMENT_ROOT.'/boutique/commande/class/boutiquecommande.class.php'); $langs->load("products"); +/* + * View + */ + llxHeader(); if ($_GET['id']) { - $commande = new Commande($db); - $result = $commande->fetch($_GET['id']); - if ( $result ) - { - - print '
Fiche Commande : '.$commande->id.'

'; - - print ''; - print ''; - print ''; - - print ''; - - print ""; - - print ""; - print ""; - print ""; - - print "
Date'.$commande->date.'
Client'.$commande->client_name.'
Paiement'.$commande->payment_method.'
AdressesLivraisonFacturation
 ".$commande->delivery_adr->name."
".$commande->delivery_adr->street."
".$commande->delivery_adr->cp."
".$commande->delivery_adr->city."
".$commande->delivery_adr->country."
".$commande->billing_adr->name."
".$commande->billing_adr->street."
".$commande->billing_adr->cp."
".$commande->billing_adr->city."
".$commande->billing_adr->country."
"; - - print "
"; - - /* - * Produits - * - */ - $sql = "SELECT orders_id, products_id, products_model, products_name, products_price, final_price, products_quantity"; - $sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_products"; - $sql .= " WHERE orders_id = " . $_GET['id']; -//$commande->id; -// echo $sql; - if ( $dbosc->query($sql) ) + $commande = new BoutiqueCommande($db); + $result = $commande->fetch($_GET['id']); + if ( $result ) { + print '
'.$langs->trans("OrderCard").': '.$commande->id.'

'; + + print ''; + print ''; + print ''; + + print ''; + + print ""; + + print ""; + print ""; + print ""; + + print "
Date'.$commande->date.'
Client'.$commande->client_name.'
Paiement'.$commande->payment_method.'
AdressesLivraisonFacturation
 ".$commande->delivery_adr->name."
".$commande->delivery_adr->street."
".$commande->delivery_adr->cp."
".$commande->delivery_adr->city."
".$commande->delivery_adr->country."
".$commande->billing_adr->name."
".$commande->billing_adr->street."
".$commande->billing_adr->cp."
".$commande->billing_adr->city."
".$commande->billing_adr->country."
"; + + print "
"; + + /* + * Produits + * + */ + $sql = "SELECT orders_id, products_id, products_model, products_name, products_price, final_price, products_quantity"; + $sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_products"; + $sql .= " WHERE orders_id = " . $_GET['id']; + //$commande->id; + // echo $sql; + if ( $dbosc->query($sql) ) + { $num = $dbosc->num_rows(); $i = 0; print ''; @@ -81,54 +85,54 @@ if ($_GET['id']) print "\n"; $var=True; while ($i < $num) - { - $objp = $dbosc->fetch_object(); - $var=!$var; - print ""; - print '"; + print '"; + print ''.$objp->products_name.''; + print ""; - print '\n"; - print "\n"; - print "\n"; + print '\n"; + print "\n"; + print "\n"; - print "\n"; - $i++; - } + print "\n"; + $i++; + } print "
'; - print 'Fiche livre'; + { + $objp = $dbosc->fetch_object(); + $var=!$var; + print "
'; + print 'Fiche livre'; - print ''.$objp->products_name.''; - print "$objp->products_quantityrowid\">".price($objp->products_price)."rowid\">".price($objp->final_price)."$objp->products_quantityrowid\">".price($objp->products_price)."rowid\">".price($objp->final_price)."
"; $dbosc->free(); - } - else - { + } + else + { print $dbosc->error(); + } + + /* + * + * + */ + print "
"; + + print ''; + print ""; + print ''; + print ''; + print "
Frais d\'expeditions'.price($commande->total_ot_shipping).' EUR
'.$langs->trans("Lastname").''.price($commande->total_ot_total).' EUR
"; + + + + } + else + { + print "Fetch failed"; } - - /* - * - * - */ - print "
"; - - print ''; - print ""; - print ''; - print ''; - print "
Frais d\'expeditions'.price($commande->total_ot_shipping).' EUR
'.$langs->trans("Lastname").''.price($commande->total_ot_total).' EUR
"; - - - - } - else - { - print "Fetch failed"; - } } else { - print "Error"; + print "Error"; }