From 480d4218a82fcdabe4a23321f8e21e696ab2b892 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 12 Mar 2003 01:08:39 +0000 Subject: [PATCH] Ajout d'une fonction qui liste les livres de l'auteur --- htdocs/boutique/auteur/auteur.class.php | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/htdocs/boutique/auteur/auteur.class.php b/htdocs/boutique/auteur/auteur.class.php index 8b9e2ac1498..8e92376386b 100644 --- a/htdocs/boutique/auteur/auteur.class.php +++ b/htdocs/boutique/auteur/auteur.class.php @@ -103,6 +103,41 @@ class Auteur { print $this->db->error() . ' in ' . $sql; } } + /* + * + * + * + */ + Function liste_livre() + { + $ga = array(); + + $sql = "SELECT a.rowid, 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; + $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(); + } + } /* * *