';
+
+
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/product/categorie/index.php b/htdocs/product/categorie/index.php
new file mode 100644
index 00000000000..fa9726739c8
--- /dev/null
+++ b/htdocs/product/categorie/index.php
@@ -0,0 +1,106 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+
+require("./pre.inc.php");
+
+llxHeader();
+
+$db = new Db();
+if ($sortfield == "") {
+ $sortfield="lower(cd.categories_name)";
+}
+if ($sortorder == "") {
+ $sortorder="ASC";
+}
+
+if ($page == -1) { $page = 0 ; }
+$limit = $conf->liste_limit;
+$offset = $limit * $page ;
+
+print_barre_liste("Liste des catégories", $page, $PHP_SELF);
+
+$sql = "SELECT c.categories_id, cd.categories_name ";
+$sql .= " FROM ".DB_NAME_OSC.".categories as c,".DB_NAME_OSC.".categories_description as cd";
+$sql .= " WHERE c.categories_id = cd.categories_id AND cd.language_id = ".OSC_LANGUAGE_ID;
+$sql .= " AND c.parent_id = 0";
+$sql .= " ORDER BY $sortfield $sortorder ";
+$sql .= $db->plimit( $limit ,$offset);
+
+if ( $db->query($sql) )
+{
+ $num = $db->num_rows();
+ $i = 0;
+ print "
\n";
+
+ $childs = array();
+ $childs = $cat->liste_childs_array();
+ if (sizeof($childs))
+ {
+ foreach($childs as $key => $value)
+ {
+ printc($key,$db, $level+1);
+ }
+ }
+
+}
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/product/categorie/pre.inc.php b/htdocs/product/categorie/pre.inc.php
new file mode 100644
index 00000000000..2c16ba50455
--- /dev/null
+++ b/htdocs/product/categorie/pre.inc.php
@@ -0,0 +1,80 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+require("../../main.inc.php3");
+require("../groupart/groupart.class.php");
+require("../categorie/categorie.class.php");
+
+function llxHeader($head = "", $urlp = "") {
+ global $user, $conf;
+
+ /*
+ *
+ *
+ */
+ top_menu($head);
+
+ $menu = new Menu();
+
+ if ($conf->boutique->livre->enabled)
+ {
+ $menu->add("/boutique/livre/", "Livres");
+
+ $menu->add_submenu("/boutique/livre/fiche.php?&action=create","Nouvel ouvrage");
+
+ $menu->add("/boutique/editeur/", "Editeurs");
+
+ $menu->add_submenu("/boutique/editeur/fiche.php?&action=create","Nouvel éditeur");
+
+ }
+
+ $menu->add("/product/categorie/", "Catégories");
+
+ if ($conf->boutique->album->enabled)
+ {
+ $menu->add("/product/album/", "Albums");
+
+ $menu->add_submenu("../osc-liste.php", "Osc");
+ $menu->add_submenu("../osc-liste.php?reqstock=epuise", "Produits Epuisés");
+
+ $menu->add_submenu("/product/album/fiche.php?&action=create","Nouvel album");
+
+ $menu->add("/product/groupart/", "Artistes/Groupes");
+
+ $menu->add_submenu("/product/groupart/fiche.php?&action=create","Nouvel Artiste/Groupe");
+
+ $menu->add("/product/concert/", "Concerts");
+
+ $menu->add_submenu("/product/concert/fiche.php?&action=create","Nouveau concert");
+
+ $menu->add("../osc-reviews.php", "Critiques");
+
+ $menu->add_submenu("../osc-productsbyreviews.php", "Meilleurs produits");
+ }
+
+ left_menu($menu->liste);
+ /*
+ *
+ *
+ */
+
+}
+?>
diff --git a/htdocs/product/concert/concert.class.php b/htdocs/product/concert/concert.class.php
new file mode 100644
index 00000000000..d4b71f79c6e
--- /dev/null
+++ b/htdocs/product/concert/concert.class.php
@@ -0,0 +1,155 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+
+class Concert {
+ var $db ;
+
+ var $id ;
+ var $date ;
+ var $groupartid;
+ var $lieuid;
+ var $description;
+
+ Function Concert($DB, $id=0) {
+ $this->db = $DB;
+ $this->id = $id ;
+ }
+ /*
+ *
+ *
+ *
+ */
+ Function create($user)
+ {
+
+ $sql = "INSERT INTO llx_concert (fk_user_author) VALUES (".$user->id.")";
+
+ if ($this->db->query($sql) )
+ {
+ $id = $this->db->last_insert_id();
+
+ if ( $this->update($id, $user) )
+ {
+ return $id;
+ }
+ }
+ else
+ {
+ print $this->db->error() . ' in ' . $sql;
+ }
+
+ }
+
+ /*
+ *
+ *
+ *
+ */
+ Function update($id, $user)
+ {
+
+ $sql = "UPDATE llx_concert ";
+ $sql .= " SET date_concert = '" . $this->date ."'";
+ $sql .= ", fk_groupart = '" . $this->groupartid ."'";
+ $sql .= ", fk_lieu_concert = '" . $this->lieuid ."'";
+ $sql .= ",description = '" . trim($this->description) ."'";
+
+ $sql .= " WHERE rowid = " . $id;
+
+ if ( $this->db->query($sql) ) {
+ return 1;
+ } else {
+ print $this->db->error() . ' in ' . $sql;
+ }
+ }
+ /*
+ *
+ *
+ *
+ */
+ Function fetch ($id) {
+
+ $sql = "SELECT rowid,".$this->db->pdate("date_concert")." as dc, description, fk_groupart, fk_lieu_concert";
+ $sql .= " FROM llx_concert WHERE rowid = $id";
+
+ $result = $this->db->query($sql) ;
+
+ if ( $result ) {
+ $result = $this->db->fetch_array();
+
+ $this->id = $result["rowid"];
+ $this->date = $result["dc"];
+ $this->titre = $result["title"];
+ $this->description = $result["description"];
+ $this->groupartid = $result["fk_groupart"];
+ $this->lieuid = $result["fk_lieu_concert"];
+ }
+ $this->db->free();
+
+ return $result;
+ }
+
+
+ /*
+ *
+ *
+ */
+
+
+ /*
+ *
+ *
+ */
+ Function liste_groupart()
+ {
+ $ga = array();
+
+ $sql = "SELECT g.rowid, g.nom FROM llx_groupart as g, llx_album_to_groupart as l";
+ $sql .= " WHERE g.rowid = l.fk_groupart AND l.fk_album = ".$this->id;
+ $sql .= " ORDER BY g.nom";
+
+ 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->nom;
+ $i++;
+ }
+ }
+ return $ga;
+ }
+ else
+ {
+ print $this->db->error();
+ }
+ }
+
+
+}
+?>
diff --git a/htdocs/product/concert/fiche.php b/htdocs/product/concert/fiche.php
new file mode 100644
index 00000000000..26869b4c2bb
--- /dev/null
+++ b/htdocs/product/concert/fiche.php
@@ -0,0 +1,187 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+
+require("./pre.inc.php");
+
+llxHeader();
+
+$db = new Db();
+
+if ($action == 'add') {
+ $concert = new Concert($db);
+
+ $concert->groupartid = $HTTP_POST_VARS["ga"];
+ $concert->lieuid = $HTTP_POST_VARS["lc"];
+ $concert->date = $db->idate(mktime(12, 0 , 0, $remonth, $reday, $reyear));
+ $concert->description = $desc;
+
+ $id = $concert->create($user);
+}
+
+if ($action == 'update') {
+ $concert = new Concert($db);
+
+ $concert->groupartid = $HTTP_POST_VARS["ga"];
+ $concert->lieuid = $HTTP_POST_VARS["lc"];
+ $concert->date = $db->idate(mktime(12, 0 , 0, $remonth, $reday, $reyear));
+ $concert->description = $desc;
+
+ $concert->update($id, $user);
+}
+
+if ($action == 'updateosc') {
+ $concert = new Concert($db);
+ $result = $concert->fetch($id);
+
+ $concert->updateosc($user);
+}
+
+/*
+ *
+ *
+ */
+if ($action == 'create')
+{
+
+ print "
';
+
+
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/product/concert/fichelieu.php b/htdocs/product/concert/fichelieu.php
new file mode 100644
index 00000000000..1918e3e4388
--- /dev/null
+++ b/htdocs/product/concert/fichelieu.php
@@ -0,0 +1,155 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+
+require("./pre.inc.php");
+
+llxHeader();
+
+$db = new Db();
+
+if ($action == 'add') {
+ $lieuconcert = new LieuConcert($db);
+
+ $lieuconcert->nom = $nom;
+ $lieuconcert->ville = $ville;
+ $lieuconcert->description = $desc;
+
+ $id = $lieuconcert->create($user);
+}
+
+if ($action == 'update') {
+ $lieuconcert = new LieuConcert($db);
+
+ $lieuconcert->nom = $nom;
+ $lieuconcert->ville = $ville;
+ $lieuconcert->description = $desc;
+
+ $lieuconcert->update($id, $user);
+}
+
+if ($action == 'updateosc') {
+ $lieuconcert = new LieuConcert($db);
+ $result = $lieuconcert->fetch($id);
+
+ $lieuconcert->updateosc($user);
+}
+
+/*
+ *
+ *
+ */
+if ($action == 'create')
+{
+
+ print "
';
+
+
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/product/concert/index.php b/htdocs/product/concert/index.php
new file mode 100644
index 00000000000..343c209a098
--- /dev/null
+++ b/htdocs/product/concert/index.php
@@ -0,0 +1,83 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+
+require("./pre.inc.php");
+
+llxHeader();
+
+$db = new Db();
+if ($sortfield == "") {
+ $sortfield="c.date_concert";
+}
+if ($sortorder == "") {
+ $sortorder="DESC";
+}
+
+
+if ($page == -1) { $page = 0 ; }
+$limit = $conf->liste_limit;
+$offset = $limit * $page ;
+
+print_barre_liste("Liste des concerts", $page, $PHP_SELF);
+
+$sql = "SELECT c.rowid, c.date_concert as dc, ga.nom, lc.nom as lieu, lc.ville";
+$sql .= " FROM llx_concert as c, llx_groupart as ga, llx_lieu_concert as lc";
+$sql .= " WHERE c.fk_groupart = ga.rowid AND c.fk_lieu_concert = lc.rowid";
+$sql .= " ORDER BY $sortfield $sortorder ";
+$sql .= $db->plimit( $limit ,$offset);
+
+if ( $db->query($sql) ) {
+ $num = $db->num_rows();
+ $i = 0;
+ print "
";
+ $db->free();
+}
+
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/product/concert/lieuconcert.class.php b/htdocs/product/concert/lieuconcert.class.php
new file mode 100644
index 00000000000..f3b7b6836f0
--- /dev/null
+++ b/htdocs/product/concert/lieuconcert.class.php
@@ -0,0 +1,155 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+
+class LieuConcert {
+ var $db ;
+ var $id ;
+ var $nom;
+ var $ville;
+ var $description;
+
+ Function LieuConcert($DB, $id=0)
+ {
+ $this->db = $DB;
+ $this->id = $id ;
+ }
+ /*
+ *
+ *
+ *
+ */
+ Function create($user)
+ {
+
+ $sql = "INSERT INTO llx_lieu_concert (fk_user_author) VALUES (".$user->id.")";
+
+ if ($this->db->query($sql) )
+ {
+ $id = $this->db->last_insert_id();
+
+ if ( $this->update($id, $user) )
+ {
+ return $id;
+ }
+ }
+ else
+ {
+ print $this->db->error() . ' in ' . $sql;
+ }
+
+ }
+
+ /*
+ *
+ *
+ *
+ */
+ Function update($id, $user)
+ {
+
+ $sql = "UPDATE llx_lieu_concert ";
+ $sql .= " SET nom = '" . trim($this->nom) ."'";
+ $sql .= ",ville = '" . trim($this->ville) ."'";
+ $sql .= ",description = '" . trim($this->description) ."'";
+
+ $sql .= " WHERE rowid = " . $id;
+
+ if ( $this->db->query($sql) ) {
+ return 1;
+ } else {
+ print $this->db->error() . ' in ' . $sql;
+ }
+ }
+ /*
+ *
+ *
+ *
+ */
+ Function fetch ($id) {
+
+ $sql = "SELECT rowid, nom, ville, description FROM llx_lieu_concert WHERE rowid = $id";
+
+ $result = $this->db->query($sql) ;
+
+ if ( $result ) {
+ $result = $this->db->fetch_array();
+
+ $this->id = $result["rowid"];
+ $this->nom = $result["nom"];
+ $this->ville = $result["ville"];
+ $this->description = $result["description"];
+
+ $this->nom_url = ''.$result["nom"].'';
+ }
+ $this->db->free();
+
+ return $result;
+ }
+
+
+ /*
+ *
+ *
+ */
+ Function delete($user) {
+
+
+
+ }
+
+
+ /*
+ *
+ *
+ */
+ Function liste()
+ {
+ $ga = array();
+
+ $sql = "SELECT rowid, nom, ville, description FROM llx_lieu_concert";
+ $sql .= " ORDER BY ville, nom";
+ 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->ville . " - " .$obj->nom;
+ $i++;
+ }
+ }
+ return $ga;
+ }
+ else
+ {
+ print $this->db->error();
+ }
+ }
+
+
+}
+?>
diff --git a/htdocs/product/concert/pre.inc.php b/htdocs/product/concert/pre.inc.php
new file mode 100644
index 00000000000..69b6320844e
--- /dev/null
+++ b/htdocs/product/concert/pre.inc.php
@@ -0,0 +1,67 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+require("../../main.inc.php3");
+require("./concert.class.php");
+require("./lieuconcert.class.php");
+require("../groupart/groupart.class.php");
+
+function llxHeader($head = "", $urlp = "") {
+ global $user, $conf;
+
+ /*
+ *
+ *
+ */
+ top_menu($head);
+
+ $menu = new Menu();
+
+ $menu->add("/product/album/", "Albums");
+
+ $menu->add_submenu("/product/album/fiche.php?&action=create","Nouvel album");
+
+ $menu->add("/product/groupart/", "Artistes/Groupes");
+
+ $menu->add_submenu("/product/groupart/fiche.php?&action=create","Nouvel Artiste/Groupe");
+
+
+ $menu->add("/product/concert/", "Concerts");
+
+ $menu->add_submenu("/product/concert/fiche.php?&action=create","Nouveau concert");
+
+ $menu->add("/product/concert/salles.php", "Salles");
+
+ $menu->add_submenu("/product/concert/fichelieu.php?&action=create","Nouveau lieu de concert");
+
+
+ $menu->add("../osc-reviews.php", "Critiques");
+
+ $menu->add_submenu("../osc-productsbyreviews.php", "Meilleurs produits");
+
+ left_menu($menu->liste);
+ /*
+ *
+ *
+ */
+
+}
+?>
diff --git a/htdocs/product/concert/salles.php b/htdocs/product/concert/salles.php
new file mode 100644
index 00000000000..63a523fc5ee
--- /dev/null
+++ b/htdocs/product/concert/salles.php
@@ -0,0 +1,76 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+
+require("./pre.inc.php");
+
+llxHeader();
+
+$db = new Db();
+if ($sortfield == "") {
+ $sortfield="lower(lc.nom)";
+}
+if ($sortorder == "") {
+ $sortorder="ASC";
+}
+
+
+if ($page == -1) { $page = 0 ; }
+$limit = $conf->liste_limit;
+$offset = $limit * $page ;
+
+print_barre_liste("Liste des concerts", $page, $PHP_SELF);
+
+$sql = "SELECT lc.rowid, lc.nom, lc.ville FROM llx_lieu_concert as lc";
+
+$sql .= " ORDER BY $sortfield $sortorder ";
+$sql .= $db->plimit( $limit ,$offset);
+
+if ( $db->query($sql) ) {
+ $num = $db->num_rows();
+ $i = 0;
+ print "
";
+ $db->free();
+}
+
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/product/groupart/fiche.php b/htdocs/product/groupart/fiche.php
new file mode 100644
index 00000000000..d01d337e6f2
--- /dev/null
+++ b/htdocs/product/groupart/fiche.php
@@ -0,0 +1,157 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+
+require("./pre.inc.php");
+
+llxHeader();
+
+$db = new Db();
+
+if ($action == 'add') {
+ $groupart = new Groupart($db);
+
+ $groupart->nom = $nom;
+
+ $id = $groupart->create($user);
+}
+
+if ($action == 'update') {
+ $groupart = new Groupart($db);
+
+ $groupart->nom = $nom;
+
+ $groupart->update($id, $user);
+}
+
+if ($action == 'updateosc') {
+ $groupart = new Groupart($db);
+ $result = $groupart->fetch($id);
+
+ $groupart->updateosc($user);
+}
+
+/*
+ *
+ *
+ */
+if ($action == 'create')
+{
+
+ print "
';
+
+
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/product/groupart/groupart.class.php b/htdocs/product/groupart/groupart.class.php
new file mode 100644
index 00000000000..51ed216dd40
--- /dev/null
+++ b/htdocs/product/groupart/groupart.class.php
@@ -0,0 +1,206 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+
+class Groupart {
+ var $db ;
+
+ var $id ;
+ var $nom ;
+
+ Function Groupart($DB, $id=0) {
+ $this->db = $DB;
+ $this->id = $id ;
+ }
+ /*
+ *
+ *
+ *
+ */
+ Function create($user) {
+
+ $sql = "INSERT INTO llx_groupart (fk_user_author) VALUES (".$user->id.")";
+
+ if ($this->db->query($sql) )
+ {
+ $id = $this->db->last_insert_id();
+
+ if ( $this->update($id, $user) )
+ {
+ return $id;
+ }
+ }
+ else
+ {
+ print $this->db->error() . ' in ' . $sql;
+ }
+ }
+
+ /*
+ *
+ *
+ *
+ */
+ Function update($id, $user)
+ {
+
+ $sql = "UPDATE llx_groupart ";
+ $sql .= " SET nom = '" . trim($this->nom) ."'";
+
+ $sql .= " WHERE rowid = " . $id;
+
+ if ( $this->db->query($sql) ) {
+ return 1;
+ } else {
+ print $this->db->error() . ' in ' . $sql;
+ }
+ }
+ /*
+ *
+ *
+ *
+ */
+ Function fetch ($id) {
+
+ $sql = "SELECT rowid, nom FROM llx_groupart WHERE rowid = $id";
+
+ $result = $this->db->query($sql) ;
+
+ if ( $result ) {
+ $result = $this->db->fetch_array();
+
+ $this->id = $result["rowid"];
+ $this->nom = $result["nom"];
+
+ $this->nom_url = ''.$result["nom"].'';
+
+ }
+ $this->db->free();
+
+ return $result;
+ }
+ /*
+ *
+ *
+ */
+ Function liste_albums ()
+ {
+ $ga = array();
+
+ $sql = "SELECT a.rowid, a.title FROM llx_album as a, llx_album_to_groupart as l";
+ $sql .= " WHERE a.rowid = l.fk_album AND l.fk_groupart = ".$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();
+ }
+ }
+ /*
+ *
+ *
+ */
+ Function updateosc()
+ {
+ $albs = array();
+ $albs = $this->liste_albums();
+
+ foreach($albs as $key => $value)
+ {
+ $alb = new Album($this->db);
+ $alb->fetch($key);
+ $alb->updateosc();
+ }
+ }
+ /*
+ *
+ *
+ */
+ Function liste_array ()
+ {
+ $ga = array();
+
+ $sql = "SELECT rowid, nom FROM llx_groupart ORDER BY nom";
+
+ 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->nom;
+ $i++;
+ }
+ }
+ return $ga;
+ }
+ else
+ {
+ print $this->db->error();
+ }
+
+ }
+
+
+
+
+ /*
+ *
+ *
+ */
+ Function delete($user) {
+
+ $sql = "DELETE FROM ".DB_NAME_OSC.".products WHERE products_id = $idosc ";
+
+ $sql = "DELETE FROM ".DB_NAME_OSC.".products_to_categories WHERE products_id = $idosc";
+
+ $sql = "DELETE FROM ".DB_NAME_OSC.".products_description WHERE products_id = $idosc";
+
+ $sql = "DELETE FROM llx_album WHERE rowid = $id";
+
+
+ }
+
+
+}
+?>
diff --git a/htdocs/product/groupart/index.php b/htdocs/product/groupart/index.php
new file mode 100644
index 00000000000..2f0863302eb
--- /dev/null
+++ b/htdocs/product/groupart/index.php
@@ -0,0 +1,75 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+
+require("./pre.inc.php");
+
+llxHeader();
+
+$db = new Db();
+if ($sortfield == "") {
+ $sortfield="lower(g.nom)";
+}
+if ($sortorder == "") {
+ $sortorder="ASC";
+}
+
+
+if ($page == -1) { $page = 0 ; }
+$limit = $conf->liste_limit;
+$offset = $limit * $page ;
+
+
+print_barre_liste("Liste des Artistes/Groupes", $page, $PHP_SELF);
+
+$sql = "SELECT g.rowid, g.nom, groupart FROM llx_groupart as g";
+
+$sql .= " ORDER BY $sortfield $sortorder ";
+$sql .= $db->plimit( $limit ,$offset);
+
+if ( $db->query($sql) ) {
+ $num = $db->num_rows();
+ $i = 0;
+ print "
";
+ $db->free();
+}
+
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/product/groupart/pre.inc.php b/htdocs/product/groupart/pre.inc.php
new file mode 100644
index 00000000000..d2cba065442
--- /dev/null
+++ b/htdocs/product/groupart/pre.inc.php
@@ -0,0 +1,59 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ *
+ */
+require("../../main.inc.php3");
+require("./groupart.class.php");
+require("../album/album.class.php");
+
+function llxHeader($head = "", $urlp = "") {
+ global $user, $conf;
+
+ /*
+ *
+ *
+ */
+ top_menu($head);
+
+ $menu = new Menu();
+
+ $menu->add("/product/album/", "Albums");
+
+ $menu->add_submenu("../album/fiche.php?&action=create","Nouvel album");
+
+ $menu->add("/product/groupart/", "Artistes/Groupes");
+
+ $menu->add_submenu("/product/groupart/fiche.php?&action=create","Nouvel Artiste/Groupe");
+
+ $menu->add("/product/concert/", "Concerts");
+
+ $menu->add_submenu("/product/concert/fiche.php?&action=create","Nouveau concert");
+
+ $menu->add("../osc-reviews.php", "Critiques");
+
+
+ left_menu($menu->liste);
+ /*
+ *
+ *
+ */
+
+}
+?>
diff --git a/htdocs/product/pre.inc.php3 b/htdocs/product/pre.inc.php3
index c53743a7e7f..c3a3e3c2504 100644
--- a/htdocs/product/pre.inc.php3
+++ b/htdocs/product/pre.inc.php3
@@ -1,5 +1,5 @@
+/* Copyright (C) 2001-2003 Rodolphe Quiedeville
*
* 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
@@ -33,7 +33,22 @@ function llxHeader($head = "", $urlp = "") {
$menu = new Menu();
$menu->add("/product/index.php3", "Produits");
+
$menu->add_submenu("fiche.php3?&action=create","Nouveau produit");
+
+ $menu->add_submenu("osc-liste.php", "Osc");
+ $menu->add_submenu("osc-liste.php?reqstock=epuise", "Produits Epuisés");
+
+
+ $menu->add("osc-reviews.php", "Critiques");
+
+ $menu->add_submenu("osc-productsbyreviews.php", "Meilleurs produits");
+
+ $menu->add("/product/album/", "Albums");
+ $menu->add("/product/groupart/", "Groupes/Artistes");
+
+ $menu->add("/product/categorie/", "Catégories");
+
$menu->add("/service/index.php3", "Services");
$menu->add("/comm/clients.php3", "Clients");
@@ -43,6 +58,7 @@ function llxHeader($head = "", $urlp = "") {
$menu->add_submenu("/soc.php3?&action=create","Nouvelle sociétée");
$menu->add_submenu("contact.php3","Contacts");
+
left_menu($menu->liste);
/*
*