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 '
| Numéro | '.$commande->id.' | Client | '.$commande->client_name.' | '; + print 'Numéro | '.$commande->id.' | '; + print 'Client | '.$commande->client_name.' | '; + + print "
| Adresses | Livraison | Facturation | ".$commande->delivery_adr->name." ".$commande->delivery_adr->street." ".$commande->delivery_adr->cp." ".$commande->delivery_adr->city." ".$commande->delivery_adr->country." | ";
+ print "".$commande->billing_adr->name." ".$commande->billing_adr->street." ".$commande->billing_adr->cp." ".$commande->billing_adr->city." ".$commande->billing_adr->country." | ";
+ print "";
+
+
print "
| Produit | "; - print "Nombre | "; - print "Prix | "; - print 'Prix final | '; - print "
| Produits | '; + print 'Nombre | Prix | Prix final | '; + print "rowid\">$objp->products_quantity | \n"; + print '$objp->products_quantity | \n"; print "rowid\">".price($objp->products_price)." | \n"; print "rowid\">".price($objp->final_price)." | \n"; @@ -91,6 +97,16 @@ if ($id) print $db->error(); } + /* + * + * + */ + print "
| Total | '.price($commande->total_ot_total).' |
| Date | "; print_liste_field_titre("Client",$PHP_SELF, "customers_name"); - print " | Statut"; - print ' | '; + print ' | Total | '; + // print 'Statut | '; + // print ''; print " | ';
print strftime("%d %B %Y",$objp->date_purchased).' | ';
print ''.$objp->customers_name." | \n"; - print ''.$objp->orders_status.' | '; - - print ''.$objp->orders_date_finished.' | '; + print ''.price($objp->value).' | '; + // print ''.$objp->orders_status.' | '; + // print ''.$objp->orders_date_finished.' | '; 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 '[Update Osc] | '; +//print '[Update Osc] | '; +print '- | '; print '- | '; print '- | '; print '