diff --git a/htdocs/boutique/client/fiche.php b/htdocs/boutique/client/fiche.php index 9c4a3f21442..896bfb971b9 100644 --- a/htdocs/boutique/client/fiche.php +++ b/htdocs/boutique/client/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2003 Éric Seigne + * Copyright (C) 2003-2005 Éric Seigne * * 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 @@ -24,18 +24,9 @@ require("./pre.inc.php"); llxHeader(); -if ($action == 'addga') { - $client = new Client($db); - - $client->linkga($id, $ga); -} - - if ($action == 'update' && !$cancel) { $client = new Client($db); - $client->nom = $nom; - $client->update($id, $user); } @@ -43,72 +34,72 @@ if ($action == 'update' && !$cancel) { * * */ +if ($_GET['id']) +{ + + $client = new Client($db); + $result = $client->fetch($_GET['id']); + if ( $result ) + { + print '
Fiche Client : '.$client->name.'

'; - if ($id) - { - - $client = new Client($db); - $result = $client->fetch($id); - - if ( $result ) - { - - print '
Fiche Client : '.$client->name.'

'; - - print ''; - print ""; - print ''; + print '
Nom'.$client->name.'
'; + print ""; + print ''; + print "
Nom'.$client->name.'
"; + + + /* + * Commandes + * + */ + $sql = "SELECT o.orders_id, o.customers_id,".$db->pdate("date_purchased")." as date_purchased, t.value as total"; + $sql .= " FROM ".DB_NAME_OSC.".orders as o, ".DB_NAME_OSC.".orders_total as t";; + $sql .= " WHERE o.customers_id = " . $client->id; + $sql .= " AND o.orders_id = t.orders_id AND t.class = 'ot_total'"; + if ( $db->query($sql) ) + { + $num = $db->num_rows(); + $i = 0; + print ''; + print ""; + print "\n"; + $var=True; + while ($i < $num) { + $objp = $db->fetch_object(); + $var=!$var; + print ""; + + print '\n"; + print "\n"; + $i++; + } print "
Commandes
Fiche '; + + print strftime("%d %B %Y",$objp->date_purchased)."\n"; + print $objp->total . "
"; - - - /* - * Commandes - * - */ - $sql = "SELECT orders_id, customers_id,".$db->pdate("date_purchased")." as date_purchased"; - $sql .= " FROM ".DB_NAME_OSC.".orders"; - $sql .= " WHERE customers_id = " . $client->id; - - if ( $db->query($sql) ) - { - $num = $db->num_rows(); - $i = 0; - print ''; - print ""; - print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object(); - $var=!$var; - print ""; - - print '\n"; - - print "\n"; - $i++; - } - print "
Commandes
Fiche '; - - print "orders_id\">".strftime("%d %B %Y",$objp->date_purchased)."
"; - $db->free(); - } - else - { - dolibarr_print_error($db); - } - + $db->free(); } else { - dolibarr_print_error($db); + print "

ERROR 1

\n"; + dolibarr_print_error($db); } - - + } else { - print "Error"; + print "

ERROR 1

\n"; + dolibarr_print_error($db); } + + +} +else +{ + print "

ERROR 1

\n"; + print "Error"; +} /* ************************************************************************** */ diff --git a/htdocs/boutique/commande/fiche.php b/htdocs/boutique/commande/fiche.php index 34f7762c467..9f843bea3e0 100644 --- a/htdocs/boutique/commande/fiche.php +++ b/htdocs/boutique/commande/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2003 Éric Seigne + * Copyright (C) 2003-2005 Éric Seigne * Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -33,15 +33,14 @@ llxHeader(); * */ -if ($id) +if ($_GET['id']) { - $commande = new Commande($db); - $result = $commande->fetch($id); + $result = $commande->fetch($_GET['id']); if ( $result ) { - + print '
Fiche Commande : '.$commande->id.'

'; print ''; @@ -83,9 +82,9 @@ if ($id) $var=!$var; print ""; print '"; print '\n";
'; - print 'Fiche livre'; + print 'Fiche livre'; - print ''.$objp->products_name.''; + print ''.$objp->products_name.''; print "$objp->products_quantity