diff --git a/htdocs/boutique/auteur/auteur.class.php b/htdocs/boutique/auteur/auteur.class.php index 53f4d3d1aa2..e2719b29fd0 100644 --- a/htdocs/boutique/auteur/auteur.class.php +++ b/htdocs/boutique/auteur/auteur.class.php @@ -108,12 +108,23 @@ class Auteur { * * */ - Function liste_livre() + Function liste_livre($id_type='', $status=0) { $ga = array(); - - $sql = "SELECT a.rowid, a.title FROM llx_livre as a, llx_livre_to_auteur as l"; + if ($id_type == 'oscid') + { + $sql = "SELECT a.oscid, "; + } + else + { + $sql = "SELECT a.rowid, "; + } + $sql .= " a.title FROM llx_livre as a, llx_livre_to_auteur as l"; $sql .= " WHERE a.rowid = l.fk_livre AND l.fk_auteur = ".$this->id; + if ($status) + { + $sql .= " AND a.status = 1"; + } $sql .= " ORDER BY a.title"; if ($this->db->query($sql) ) @@ -125,9 +136,9 @@ class Auteur { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $row = $this->db->fetch_row($i); - $ga[$obj->rowid] = $obj->title; + $ga[$row[0]] = $row[1]; $i++; } } diff --git a/htdocs/boutique/commande/commande.class.php b/htdocs/boutique/commande/commande.class.php index 281d8b513f2..d232a761695 100644 --- a/htdocs/boutique/commande/commande.class.php +++ b/htdocs/boutique/commande/commande.class.php @@ -32,6 +32,9 @@ class Commande { $this->billing_adr = New Address(); $this->delivry_adr = New Address(); + + $this->total_ot_subtotal = 0; + $this->total_ot_shipping = 0; } /* * @@ -49,13 +52,54 @@ class Commande { if ( $result ) { - $result = $this->db->fetch_array(); + $array = $this->db->fetch_array(); - $this->id = $result["orders_id"]; - $this->client_id = stripslashes($result["customers_id"]); - $this->client_name = stripslashes($result["customers_name"]); + $this->id = $array["orders_id"]; + $this->client_id = stripslashes($array["customers_id"]); + $this->client_name = stripslashes($array["customers_name"]); + + $this->delivery_adr->name = stripslashes($array["delivery_name"]); + $this->delivery_adr->street = stripslashes($array["delivery_street_address"]); + $this->delivery_adr->cp = stripslashes($array["delivery_postcode"]); + $this->delivery_adr->city = stripslashes($array["delivery_city"]); + $this->delivery_adr->country = stripslashes($array["delivery_country"]); + + $this->billing_adr->name = stripslashes($array["billing_name"]); + $this->billing_adr->street = stripslashes($array["billing_street_address"]); + $this->billing_adr->cp = stripslashes($array["billing_postcode"]); + $this->billing_adr->city = stripslashes($array["billing_city"]); + $this->billing_adr->country = stripslashes($array["billing_country"]); + $this->db->free(); + + /* + * Totaux + */ + $sql = "SELECT value, class "; + $sql .= " FROM ".DB_NAME_OSC.".orders_total WHERE orders_id = $id"; + + $result = $this->db->query($sql) ; + + if ( $result ) + { + $num = $this->db->num_rows(); + + while ($i < $num) + { + $array = $this->db->fetch_array($i); + if ($array["class"] == 'ot_total') + { + $this->total_ot_total = $array["value"]; + } + $i++; + } + } + else + { + print $this->db->error(); + } + } else { diff --git a/htdocs/boutique/commande/fiche.php b/htdocs/boutique/commande/fiche.php index a2379f9585a..a1eccda44af 100644 --- a/htdocs/boutique/commande/fiche.php +++ b/htdocs/boutique/commande/fiche.php @@ -44,8 +44,16 @@ if ($id) print ''; print ""; - print ''; - print ''; + print ''; + print ''; + + print ""; + + print ""; + print ""; + print ""; + + print "
Numéro'.$commande->id.'
Client'.$commande->client_name.'
Numéro'.$commande->id.'
Client'.$commande->client_name.'
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."
"; /* @@ -60,12 +68,10 @@ if ($id) { $num = $db->num_rows(); $i = 0; - print "

"; - print ""; - print ""; - print ""; - print ''; - print "\n"; + print "

ProduitNombrePrixPrix final
"; + print ''; + print ''; + print "\n"; $var=True; while ($i < $num) { $objp = $db->fetch_object( $i); @@ -76,7 +82,7 @@ if ($id) print "rowid\">$objp->products_name\n"; - print "\n"; + print '\n"; print "\n"; print "\n"; @@ -91,6 +97,16 @@ if ($id) print $db->error(); } + /* + * + * + */ + print "
"; + print '
ProduitsNombrePrixPrix final
rowid\">$objp->products_quantity$objp->products_quantityrowid\">".price($objp->products_price)."rowid\">".price($objp->final_price)."
'; + print ""; + print ''; + print "
Total'.price($commande->total_ot_total).'
"; + } diff --git a/htdocs/boutique/commande/index.php b/htdocs/boutique/commande/index.php index 4d513c44ebe..b5736ba7e11 100644 --- a/htdocs/boutique/commande/index.php +++ b/htdocs/boutique/commande/index.php @@ -34,18 +34,16 @@ if ($sortorder == "") $sortorder="DESC"; } - if ($page == -1) { $page = 0 ; } $limit = $conf->liste_limit; $offset = $limit * $page ; print_barre_liste("Liste des commandes", $page, $PHP_SELF); - $sql = "SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified,".$db->pdate("date_purchased")." as date_purchased, orders_status, orders_date_finished, currency, currency_value"; - - -$sql .= " FROM ".DB_NAME_OSC.".orders"; + $sql = "SELECT o.orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified,".$db->pdate("date_purchased")." as date_purchased, orders_status, orders_date_finished, currency, currency_value, t.value"; +$sql .= " FROM ".DB_NAME_OSC.".orders as o, ".DB_NAME_OSC.".orders_total as t"; +$sql .= " WHERE o.orders_id = t.orders_id AND t.class = 'ot_total'"; $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit( $limit ,$offset); @@ -56,8 +54,9 @@ if ( $db->query($sql) ) print "

"; print "'; + print ''; + // print ''; + // print ''; print "\n"; $var=True; while ($i < $num) @@ -69,9 +68,9 @@ if ( $db->query($sql) ) print ''; print '\n"; - print ''; - - print ''; + print ''; + // print ''; + // print ''; print "\n"; $i++; } diff --git a/htdocs/boutique/livre/fiche.php b/htdocs/boutique/livre/fiche.php index c4c764268e5..943e36fa5aa 100644 --- a/htdocs/boutique/livre/fiche.php +++ b/htdocs/boutique/livre/fiche.php @@ -86,7 +86,12 @@ if ($action == 'update' && !$cancel) { $livre->editeurid = $editeurid; $livre->description = $desc; - if (!$livre->update($id, $user)) + if ($livre->update($id, $user)) + { + $result = $livre->fetch($id); + $livre->updateosc($user); + } + else { $action = 'edit'; } @@ -313,7 +318,8 @@ else } print ''; -print ''; +//print ''; +print ''; print ''; print ''; print '
Date"; print_liste_field_titre("Client",$PHP_SELF, "customers_name"); - print "Statut"; - print 'TotalStatut
Fiche '; print strftime("%d %B %Y",$objp->date_purchased).''.$objp->customers_name."'.$objp->orders_status.''.$objp->orders_date_finished.''.price($objp->value).''.$objp->orders_status.''.$objp->orders_date_finished.'
-[Update Osc][Update Osc]---

';