From a1b7ab16d3789b95e8a67f68929ec6b7354f2635 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Feb 2004 01:33:59 +0000 Subject: [PATCH] =?UTF-8?q?Prefix=20en=20dur=20"llx=5F"=20remplac=E9=20par?= =?UTF-8?q?=20constante=20"MAIN=5FDB=5FPREFIX".?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/boutique/editeur/index.php | 2 +- htdocs/boutique/livre/index.php | 2 +- htdocs/boutique/livre/livre.class.php | 16 ++++++++-------- htdocs/boutique/livre/vignettes.php | 2 +- htdocs/boutique/newsletter/index.php | 2 +- .../boutique/newsletter/newsletter.class.php | 14 +++++++------- .../notification/notification.class.php | 10 +++++----- htdocs/comm/addpropal.php | 10 +++++----- htdocs/comm/bookmark.php | 4 ++-- htdocs/comm/people.php | 6 +++--- htdocs/comm/propal/stats/index.php | 2 +- .../comm/propal/stats/propalestats.class.php | 8 ++++---- htdocs/comm/propal_model_pdf.class.php | 2 +- htdocs/product/album/album.class.php | 12 ++++++------ htdocs/product/album/index.php | 2 +- htdocs/product/categorie/categorie.class.php | 8 ++++---- htdocs/product/categorie/index.php | 2 +- htdocs/product/concert/concert.class.php | 8 ++++---- htdocs/product/concert/index.php | 2 +- htdocs/product/concert/lieuconcert.class.php | 8 ++++---- htdocs/product/concert/salles.php | 2 +- htdocs/product/fiche.php | 8 ++++---- htdocs/product/groupart/groupart.class.php | 12 ++++++------ htdocs/product/groupart/index.php | 2 +- htdocs/product/index.php | 6 +++--- htdocs/product/liste.php | 6 +++--- htdocs/product/popuprop.php | 2 +- htdocs/product/promotion/promotion.class.php | 4 ++-- htdocs/product/stats/commandestats.class.php | 8 ++++---- htdocs/product/stats/facture.php | 2 +- htdocs/product/stats/index.php | 2 +- htdocs/product/stock/entrepot.class.php | 8 ++++---- htdocs/product/stock/index.php | 2 +- htdocs/product/stock/mouvementstock.class.php | 4 ++-- htdocs/product/stock/product.php | 8 ++++---- htdocs/projet/index.php | 2 +- htdocs/projet/project.class.php | 18 +++++++++--------- htdocs/public/adherents/index.php | 2 +- htdocs/public/adherents/new.php | 2 +- htdocs/public/adherents/priv_edit.php | 4 ++-- htdocs/public/adherents/priv_liste.php | 4 ++-- htdocs/public/dons/bplc.php | 2 +- htdocs/public/dons/depenses_code.php | 2 +- htdocs/public/dons/donateurs_code.php | 2 +- htdocs/societe/notify/fiche.php | 10 +++++----- htdocs/societe/notify/index.php | 2 +- htdocs/user/fiche.php | 6 +++--- htdocs/user/index.php | 2 +- 48 files changed, 128 insertions(+), 128 deletions(-) diff --git a/htdocs/boutique/editeur/index.php b/htdocs/boutique/editeur/index.php index a1efdec813e..abbb8ee015c 100644 --- a/htdocs/boutique/editeur/index.php +++ b/htdocs/boutique/editeur/index.php @@ -38,7 +38,7 @@ $offset = $limit * $page ; print_barre_liste("Liste des Editeurs", $page, $PHP_SELF); -$sql = "SELECT e.rowid, e.nom FROM llx_editeur as e"; +$sql = "SELECT e.rowid, e.nom FROM ".MAIN_DB_PREFIX."editeur as e"; $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit( $limit ,$offset); diff --git a/htdocs/boutique/livre/index.php b/htdocs/boutique/livre/index.php index 55124d1d842..7938827e00d 100644 --- a/htdocs/boutique/livre/index.php +++ b/htdocs/boutique/livre/index.php @@ -46,7 +46,7 @@ $form = '
'. print_barre_liste("Liste des Livres", $page, $PHP_SELF, "", $sortfield, $sortorder, $form); -$sql = "SELECT l.rowid, l.title, l.oscid, l.ref, l.status FROM llx_livre as l"; +$sql = "SELECT l.rowid, l.title, l.oscid, l.ref, l.status FROM ".MAIN_DB_PREFIX."livre as l"; if ($searchvalue) { diff --git a/htdocs/boutique/livre/livre.class.php b/htdocs/boutique/livre/livre.class.php index 5b79587cb14..5a0ea46112e 100644 --- a/htdocs/boutique/livre/livre.class.php +++ b/htdocs/boutique/livre/livre.class.php @@ -69,7 +69,7 @@ class Livre { if ($this->db->query($sql) ) { - $sql = "INSERT INTO llx_livre (oscid, fk_user_author, date_ajout) VALUES ($idosc, ".$user->id.", now())"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."livre (oscid, fk_user_author, date_ajout) VALUES ($idosc, ".$user->id.", now())"; if ($this->db->query($sql) ) { @@ -113,7 +113,7 @@ class Livre { Function linkga($id, $gaid) { - $sql = "INSERT INTO llx_livre_to_auteur (fk_livre, fk_auteur) values ($id, $gaid)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."livre_to_auteur (fk_livre, fk_auteur) values ($id, $gaid)"; if ( $this->db->query($sql) ) { @@ -132,7 +132,7 @@ class Livre { { $ga = array(); - $sql = "SELECT a.rowid, a.nom FROM llx_auteur as a, llx_livre_to_auteur as l"; + $sql = "SELECT a.rowid, a.nom FROM ".MAIN_DB_PREFIX."auteur as a, ".MAIN_DB_PREFIX."livre_to_auteur as l"; $sql .= " WHERE a.rowid = l.fk_auteur AND l.fk_livre = ".$this->id; $sql .= " ORDER BY a.nom"; @@ -165,7 +165,7 @@ class Livre { Function auteur_unlink($auteur_id) { - $sql = "DELETE FROM llx_livre_to_auteur "; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."livre_to_auteur "; $sql .= " WHERE fk_livre=".$this->id; $sql .= " AND fk_auteur=".$auteur_id; @@ -289,7 +289,7 @@ class Livre { if ( $this->db->query($sql) ) { - $sql = "UPDATE llx_livre "; + $sql = "UPDATE ".MAIN_DB_PREFIX."livre "; $sql .= " SET status = ".$status; $sql .= " WHERE rowid = " . $this->id; @@ -442,7 +442,7 @@ class Livre { $this->annee = 0; } - $sql = "UPDATE llx_livre "; + $sql = "UPDATE ".MAIN_DB_PREFIX."livre "; $sql .= " SET title = '" . trim($this->titre) ."'"; $sql .= ", ref = '" . trim($this->ref) ."'"; $sql .= ", prix = " . ereg_replace(",",".",$this->price).""; @@ -469,7 +469,7 @@ class Livre { */ Function fetch ($id, $oscid=0) { - $sql = "SELECT rowid, fk_editeur, ref, prix, annee, oscid, title, description, frais_de_port FROM llx_livre"; + $sql = "SELECT rowid, fk_editeur, ref, prix, annee, oscid, title, description, frais_de_port FROM ".MAIN_DB_PREFIX."livre"; if ($id) { $sql .= " WHERE rowid = $id"; @@ -561,7 +561,7 @@ class Livre { $result = $this->db->query($sql) ; $sql = "DELETE FROM ".DB_NAME_OSC.".products_description WHERE products_id = ".$this->oscid; $result = $this->db->query($sql) ; - $sql = "DELETE FROM llx_livre WHERE rowid = ".$this->id; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."livre WHERE rowid = ".$this->id; $result = $this->db->query($sql) ; } diff --git a/htdocs/boutique/livre/vignettes.php b/htdocs/boutique/livre/vignettes.php index f1ed6124411..d5c86788999 100644 --- a/htdocs/boutique/livre/vignettes.php +++ b/htdocs/boutique/livre/vignettes.php @@ -46,7 +46,7 @@ $form = ''. print_barre_liste("Liste des vignettes manquantes", $page, $PHP_SELF, "", $sortfield, $sortorder, $form); -$sql = "SELECT l.rowid, l.title, l.oscid, l.ref, l.status FROM llx_livre as l"; +$sql = "SELECT l.rowid, l.title, l.oscid, l.ref, l.status FROM ".MAIN_DB_PREFIX."livre as l"; if ($searchvalue) { diff --git a/htdocs/boutique/newsletter/index.php b/htdocs/boutique/newsletter/index.php index 16908ff1cd5..d1919ea3d10 100644 --- a/htdocs/boutique/newsletter/index.php +++ b/htdocs/boutique/newsletter/index.php @@ -39,7 +39,7 @@ $offset = $limit * $page ; print_barre_liste("Liste des Newsletter", $page, $PHP_SELF); $sql = "SELECT rowid, email_subject, email_from_name, email_from_email, email_replyto, email_body, target, sql_target, status, date_send_request, date_send_begin, date_send_end, nbsent"; -$sql .= " FROM llx_newsletter"; +$sql .= " FROM ".MAIN_DB_PREFIX."newsletter"; $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit( $limit ,$offset); diff --git a/htdocs/boutique/newsletter/newsletter.class.php b/htdocs/boutique/newsletter/newsletter.class.php index c8eeb7f7d72..b8d9c5d7771 100644 --- a/htdocs/boutique/newsletter/newsletter.class.php +++ b/htdocs/boutique/newsletter/newsletter.class.php @@ -48,7 +48,7 @@ class Newsletter { */ Function create($user) { - $sql = "INSERT INTO llx_newsletter (fk_user_author, datec, nbsent) VALUES (".$user->id.",now(), 0)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."newsletter (fk_user_author, datec, nbsent) VALUES (".$user->id.",now(), 0)"; if ($this->db->query($sql) ) { @@ -76,7 +76,7 @@ class Newsletter { $this->target_sql = $this->build_sql($this->target); - $sql = "UPDATE llx_newsletter "; + $sql = "UPDATE ".MAIN_DB_PREFIX."newsletter "; $sql .= " SET email_subject = '" . trim($this->email_subject) ."'"; $sql .= ", email_from_name = '" . trim($this->email_from_name) ."'"; $sql .= ", email_from_email = '" . trim($this->email_from_email) ."'"; @@ -100,7 +100,7 @@ class Newsletter { Function fetch ($id) { $sql = "SELECT rowid, email_subject, email_from_name, email_from_email, email_replyto, email_body, target, sql_target, status, date_send_request,".$this->db->pdate("date_send_begin")." as date_send_begin,".$this->db->pdate("date_send_end")." as date_send_end, nbsent, nberror"; - $sql .= " FROM llx_newsletter WHERE rowid=$id"; + $sql .= " FROM ".MAIN_DB_PREFIX."newsletter WHERE rowid=$id"; $result = $this->db->query($sql) ; @@ -140,7 +140,7 @@ class Newsletter { { $ga = array(); - $sql = "SELECT rowid, nom FROM llx_editeur ORDER BY nom"; + $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."editeur ORDER BY nom"; if ($this->db->query($sql) ) { @@ -172,7 +172,7 @@ class Newsletter { */ Function validate($user) { - $sql = "UPDATE llx_newsletter SET status=1, fk_user_valid = $user->id WHERE rowid = $this->id"; + $sql = "UPDATE ".MAIN_DB_PREFIX."newsletter SET status=1, fk_user_valid = $user->id WHERE rowid = $this->id"; $return = $this->db->query($sql) ; } @@ -182,7 +182,7 @@ class Newsletter { */ Function send($user) { - $sql = "UPDATE llx_newsletter SET status=2, date_send_request=now() WHERE rowid = $this->id"; + $sql = "UPDATE ".MAIN_DB_PREFIX."newsletter SET status=2, date_send_request=now() WHERE rowid = $this->id"; $return = $this->db->query($sql) ; } @@ -209,7 +209,7 @@ class Newsletter { */ Function delete() { - $sql = "DELETE FROM llx_newsletter WHERE rowid = $this->id "; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."newsletter WHERE rowid = $this->id "; $return = $this->db->query($sql) ; } diff --git a/htdocs/boutique/notification/notification.class.php b/htdocs/boutique/notification/notification.class.php index 8453be3d0d0..014704a1fb2 100644 --- a/htdocs/boutique/notification/notification.class.php +++ b/htdocs/boutique/notification/notification.class.php @@ -37,7 +37,7 @@ class Editeur { */ Function create($user) { - $sql = "INSERT INTO llx_editeur (fk_user_author) VALUES (".$user->id.")"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."editeur (fk_user_author) VALUES (".$user->id.")"; if ($this->db->query($sql) ) { @@ -59,7 +59,7 @@ class Editeur { { $ga = array(); - $sql = "SELECT rowid, nom FROM llx_editeur ORDER BY nom"; + $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."editeur ORDER BY nom"; if ($this->db->query($sql) ) { @@ -92,7 +92,7 @@ class Editeur { Function update($id, $user) { - $sql = "UPDATE llx_editeur "; + $sql = "UPDATE ".MAIN_DB_PREFIX."editeur "; $sql .= " SET nom = '" . trim($this->nom) ."'"; $sql .= " WHERE rowid = " . $id; @@ -110,7 +110,7 @@ class Editeur { */ Function fetch ($id) { - $sql = "SELECT rowid, nom FROM llx_editeur WHERE rowid = $id"; + $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."editeur WHERE rowid = $id"; $result = $this->db->query($sql) ; @@ -144,7 +144,7 @@ class Editeur { $sql = "DELETE FROM ".DB_NAME_OSC.".products_description WHERE products_id = $idosc"; - $sql = "DELETE FROM llx_livre WHERE rowid = $id"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."livre WHERE rowid = $id"; } diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 5b346fb6f17..1197595e43e 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -27,7 +27,7 @@ if (defined("PROPALE_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/module require(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php"); } -$sql = "SELECT s.nom, s.idp, s.prefix_comm FROM llx_societe as s WHERE s.idp = $socidp;"; +$sql = "SELECT s.nom, s.idp, s.prefix_comm FROM ".MAIN_DB_PREFIX."societe as s WHERE s.idp = $socidp;"; $result = $db->query($sql); if ($result) @@ -54,7 +54,7 @@ if ($action == 'create') $obj = PROPALE_ADDON; $modPropale = new $obj; $numpr = $modPropale->propale_get_num(); - $sql = "SELECT count(*) FROM llx_propal WHERE ref like '$numpr%'"; + $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."propal WHERE ref like '$numpr%'"; if ( $db->query($sql) ) { @@ -92,7 +92,7 @@ if ($action == 'create') * */ print "Contact'; print ''; - $sql = "SELECT p.rowid, p.title FROM llx_projet as p WHERE p.fk_soc = $socidp"; + $sql = "SELECT p.rowid, p.title FROM ".MAIN_DB_PREFIX."projet as p WHERE p.fk_soc = $socidp"; if ( $db->query($sql) ) { @@ -168,7 +168,7 @@ if ($action == 'create') * Liste des elements * */ - $sql = "SELECT p.rowid,p.label,p.ref,p.price FROM llx_product as p "; + $sql = "SELECT p.rowid,p.label,p.ref,p.price FROM ".MAIN_DB_PREFIX."product as p "; $sql .= " WHERE envente = 1"; $sql .= " ORDER BY ref DESC"; if ( $db->query($sql) ) diff --git a/htdocs/comm/bookmark.php b/htdocs/comm/bookmark.php index ec5b19555d4..4acecbcc99f 100644 --- a/htdocs/comm/bookmark.php +++ b/htdocs/comm/bookmark.php @@ -37,7 +37,7 @@ $ynn["0"] = "non"; if ($action == 'add') { - $sql = "INSERT INTO llx_bookmark (fk_soc, dateb, author) VALUES ($socidp, now(),'". $GLOBALS["REMOTE_USER"]."');"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, author) VALUES ($socidp, now(),'". $GLOBALS["REMOTE_USER"]."');"; if (! $db->query($sql) ) { print $db->error(); @@ -46,7 +46,7 @@ if ($action == 'add') if ($action == 'delete') { - $sql = "DELETE FROM llx_bookmark WHERE rowid=$bid AND author = '". $GLOBALS["REMOTE_USER"]."'"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=$bid AND author = '". $GLOBALS["REMOTE_USER"]."'"; $result = $db->query($sql); } diff --git a/htdocs/comm/people.php b/htdocs/comm/people.php index 49ca6eb5e1e..38f2ddd77b5 100644 --- a/htdocs/comm/people.php +++ b/htdocs/comm/people.php @@ -34,7 +34,7 @@ if ($action == 'add') if (strlen(trim($name)) + strlen(trim($firstname)) > 0) { - $sql = "INSERT INTO llx_socpeople (datec, fk_soc,name, firstname, poste, phone,fax,email) "; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (datec, fk_soc,name, firstname, poste, phone,fax,email) "; $sql .= " VALUES (now(),$socid,'$name','$firstname','$poste','$phone','$fax','$email')"; $result = $db->query($sql); if ($result) @@ -125,7 +125,7 @@ if ($socid > 0) print "FaxEmail"; $sql = "SELECT p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.fk_user "; - $sql .= " FROM llx_socpeople as p WHERE p.fk_soc = $objsoc->idp"; + $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.fk_soc = $objsoc->idp"; if ($contactid) { @@ -188,7 +188,7 @@ if ($socid > 0) if ($action == 'editcontact') { $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; - $sql .= " FROM llx_socpeople as p WHERE p.idp = $contactid"; + $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p WHERE p.idp = $contactid"; $result = $db->query($sql); $num = $db->num_rows(); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index ffa96f9234b..f6eedc3ab48 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -43,7 +43,7 @@ $px->SetHeight(280); $px->draw(DOL_DOCUMENT_ROOT.$filev, $data, $year); -$sql = "SELECT count(*), date_format(datep,'%Y') as dm, sum(price) FROM llx_propal WHERE fk_statut > 0 GROUP BY dm DESC "; +$sql = "SELECT count(*), date_format(datep,'%Y') as dm, sum(price) FROM ".MAIN_DB_PREFIX."propal WHERE fk_statut > 0 GROUP BY dm DESC "; if ($db->query($sql)) { $num = $db->num_rows(); diff --git a/htdocs/comm/propal/stats/propalestats.class.php b/htdocs/comm/propal/stats/propalestats.class.php index 1091213abd4..c897fdef91c 100644 --- a/htdocs/comm/propal/stats/propalestats.class.php +++ b/htdocs/comm/propal/stats/propalestats.class.php @@ -38,7 +38,7 @@ class PropaleStats extends Stats */ Function getNbByMonth($year) { - $sql = "SELECT date_format(datep,'%m') as dm, count(*) FROM llx_propal"; + $sql = "SELECT date_format(datep,'%m') as dm, count(*) FROM ".MAIN_DB_PREFIX."propal"; $sql .= " WHERE date_format(datep,'%Y') = $year AND fk_statut > 0"; $sql .= " GROUP BY dm DESC"; @@ -51,7 +51,7 @@ class PropaleStats extends Stats */ Function getNbByYear() { - $sql = "SELECT date_format(datep,'%Y') as dm, count(*) FROM llx_propal GROUP BY dm DESC WHERE fk_statut > 0"; + $sql = "SELECT date_format(datep,'%Y') as dm, count(*) FROM ".MAIN_DB_PREFIX."propal GROUP BY dm DESC WHERE fk_statut > 0"; return $this->_getNbByYear($sql); } @@ -61,7 +61,7 @@ class PropaleStats extends Stats */ Function getAmountByMonth($year) { - $sql = "SELECT date_format(datep,'%m') as dm, sum(price) FROM llx_propal"; + $sql = "SELECT date_format(datep,'%m') as dm, sum(price) FROM ".MAIN_DB_PREFIX."propal"; $sql .= " WHERE date_format(datep,'%Y') = $year AND fk_statut > 0"; $sql .= " GROUP BY dm DESC"; @@ -73,7 +73,7 @@ class PropaleStats extends Stats */ Function getAverageByMonth($year) { - $sql = "SELECT date_format(datep,'%m') as dm, avg(price) FROM llx_propal"; + $sql = "SELECT date_format(datep,'%m') as dm, avg(price) FROM ".MAIN_DB_PREFIX."propal"; $sql .= " WHERE date_format(datep,'%Y') = $year AND fk_statut > 0"; $sql .= " GROUP BY dm DESC"; diff --git a/htdocs/comm/propal_model_pdf.class.php b/htdocs/comm/propal_model_pdf.class.php index 6dd2eb69f98..5a77033e51b 100644 --- a/htdocs/comm/propal_model_pdf.class.php +++ b/htdocs/comm/propal_model_pdf.class.php @@ -38,7 +38,7 @@ class Propal_Model_Pdf { { $projets = array(); - $sql = "SELECT nom FROM llx_propal_model_pdf"; + $sql = "SELECT nom FROM ".MAIN_DB_PREFIX."propal_model_pdf"; if ($this->db->query($sql) ) { diff --git a/htdocs/product/album/album.class.php b/htdocs/product/album/album.class.php index 723e088fd1f..cc19fdec5d8 100644 --- a/htdocs/product/album/album.class.php +++ b/htdocs/product/album/album.class.php @@ -65,7 +65,7 @@ class Album { if ($this->db->query($sql) ) { - $sql = "INSERT INTO llx_album (osc_id, fk_user_author) VALUES ($idosc, ".$user->id.")"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."album (osc_id, fk_user_author) VALUES ($idosc, ".$user->id.")"; if ($this->db->query($sql) ) { @@ -109,7 +109,7 @@ class Album { Function linkga($id, $gaid) { - $sql = "INSERT INTO llx_album_to_groupart (fk_album, fk_groupart) values ($id, $gaid)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."album_to_groupart (fk_album, fk_groupart) values ($id, $gaid)"; if ( $this->db->query($sql) ) { return 1; @@ -125,7 +125,7 @@ class Album { { $ga = array(); - $sql = "SELECT g.rowid, g.nom FROM llx_groupart as g, llx_album_to_groupart as l"; + $sql = "SELECT g.rowid, g.nom FROM ".MAIN_DB_PREFIX."groupart as g, ".MAIN_DB_PREFIX."album_to_groupart as l"; $sql .= " WHERE g.rowid = l.fk_groupart AND l.fk_album = ".$this->id; $sql .= " ORDER BY g.nom"; @@ -232,7 +232,7 @@ class Album { $this->annee = 0; } - $sql = "UPDATE llx_album "; + $sql = "UPDATE ".MAIN_DB_PREFIX."album "; $sql .= " SET title = '" . trim($this->titre) ."'"; $sql .= ", ref = '" . trim(strtoupper($this->ref)) ."'"; $sql .= ", annee = " . $this->annee ; @@ -253,7 +253,7 @@ class Album { */ Function fetch ($id) { - $sql = "SELECT rowid, ref, annee, osc_id, title, description FROM llx_album WHERE rowid = $id"; + $sql = "SELECT rowid, ref, annee, osc_id, title, description FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id"; $result = $this->db->query($sql) ; @@ -311,7 +311,7 @@ class Album { $sql = "DELETE FROM ".DB_NAME_OSC.".products_description WHERE products_id = $idosc"; - $sql = "DELETE FROM llx_album WHERE rowid = $id"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id"; } diff --git a/htdocs/product/album/index.php b/htdocs/product/album/index.php index 3a9ab9ca7db..f207adc8c23 100644 --- a/htdocs/product/album/index.php +++ b/htdocs/product/album/index.php @@ -41,7 +41,7 @@ $offset = $limit * $page ; print_barre_liste("Liste des albums", $page, $PHP_SELF); -$sql = "SELECT a.rowid, a.title, a.osc_id FROM llx_album as a"; +$sql = "SELECT a.rowid, a.title, a.osc_id FROM ".MAIN_DB_PREFIX."album as a"; $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit( $limit ,$offset); diff --git a/htdocs/product/categorie/categorie.class.php b/htdocs/product/categorie/categorie.class.php index e56c358c5d8..6f5c0709445 100644 --- a/htdocs/product/categorie/categorie.class.php +++ b/htdocs/product/categorie/categorie.class.php @@ -43,7 +43,7 @@ class Categorie { */ Function create($user) { - $sql = "INSERT INTO llx_album (osc_id, fk_user_author) VALUES ($idosc, ".$user->id.")"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."album (osc_id, fk_user_author) VALUES ($idosc, ".$user->id.")"; if ($this->db->query($sql) ) { @@ -68,7 +68,7 @@ class Categorie { Function linkga($id, $gaid) { - $sql = "INSERT INTO llx_album_to_groupart (fk_album, fk_groupart) values ($id, $gaid)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."album_to_groupart (fk_album, fk_groupart) values ($id, $gaid)"; if ( $this->db->query($sql) ) { return 1; @@ -194,7 +194,7 @@ class Categorie { Function update($id, $user) { - $sql = "UPDATE llx_album "; + $sql = "UPDATE ".MAIN_DB_PREFIX."album "; $sql .= " SET title = '" . trim($this->titre) ."'"; $sql .= ",description = '" . trim($this->description) ."'"; @@ -247,7 +247,7 @@ class Categorie { $sql = "DELETE FROM ".DB_NAME_OSC.".products_description WHERE products_id = $idosc"; - $sql = "DELETE FROM llx_album WHERE rowid = $id"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id"; } diff --git a/htdocs/product/categorie/index.php b/htdocs/product/categorie/index.php index ab74047dab4..c81b11d05d5 100644 --- a/htdocs/product/categorie/index.php +++ b/htdocs/product/categorie/index.php @@ -60,7 +60,7 @@ if ($id) if ($numprod) { - $sql = "SELECT l.rowid, l.title, l.oscid, l.ref, l.status FROM llx_livre as l"; + $sql = "SELECT l.rowid, l.title, l.oscid, l.ref, l.status FROM ".MAIN_DB_PREFIX."livre as l"; $sql .= " WHERE l.oscid in $wc"; if ( $db->query($sql) ) diff --git a/htdocs/product/concert/concert.class.php b/htdocs/product/concert/concert.class.php index d4b71f79c6e..3f4d34e70ac 100644 --- a/htdocs/product/concert/concert.class.php +++ b/htdocs/product/concert/concert.class.php @@ -41,7 +41,7 @@ class Concert { Function create($user) { - $sql = "INSERT INTO llx_concert (fk_user_author) VALUES (".$user->id.")"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."concert (fk_user_author) VALUES (".$user->id.")"; if ($this->db->query($sql) ) { @@ -67,7 +67,7 @@ class Concert { Function update($id, $user) { - $sql = "UPDATE llx_concert "; + $sql = "UPDATE ".MAIN_DB_PREFIX."concert "; $sql .= " SET date_concert = '" . $this->date ."'"; $sql .= ", fk_groupart = '" . $this->groupartid ."'"; $sql .= ", fk_lieu_concert = '" . $this->lieuid ."'"; @@ -89,7 +89,7 @@ class Concert { 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"; + $sql .= " FROM ".MAIN_DB_PREFIX."concert WHERE rowid = $id"; $result = $this->db->query($sql) ; @@ -123,7 +123,7 @@ class Concert { { $ga = array(); - $sql = "SELECT g.rowid, g.nom FROM llx_groupart as g, llx_album_to_groupart as l"; + $sql = "SELECT g.rowid, g.nom FROM ".MAIN_DB_PREFIX."groupart as g, ".MAIN_DB_PREFIX."album_to_groupart as l"; $sql .= " WHERE g.rowid = l.fk_groupart AND l.fk_album = ".$this->id; $sql .= " ORDER BY g.nom"; diff --git a/htdocs/product/concert/index.php b/htdocs/product/concert/index.php index 206053f491e..596e0c7eb0c 100644 --- a/htdocs/product/concert/index.php +++ b/htdocs/product/concert/index.php @@ -40,7 +40,7 @@ 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 = "SELECT c.rowid, c.date_concert as dc, c.fk_groupart, c.fk_lieu_concert, ga.nom, lc.nom as lieu, lc.ville"; -$sql .= " FROM llx_concert as c, llx_groupart as ga, llx_lieu_concert as lc"; +$sql .= " FROM ".MAIN_DB_PREFIX."concert as c, ".MAIN_DB_PREFIX."groupart as ga, ".MAIN_DB_PREFIX."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); diff --git a/htdocs/product/concert/lieuconcert.class.php b/htdocs/product/concert/lieuconcert.class.php index 4f2c61299b9..ea4300971af 100644 --- a/htdocs/product/concert/lieuconcert.class.php +++ b/htdocs/product/concert/lieuconcert.class.php @@ -41,7 +41,7 @@ class LieuConcert { Function create($user) { - $sql = "INSERT INTO llx_lieu_concert (fk_user_author) VALUES (".$user->id.")"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."lieu_concert (fk_user_author) VALUES (".$user->id.")"; if ($this->db->query($sql) ) { @@ -67,7 +67,7 @@ class LieuConcert { Function update($id, $user) { - $sql = "UPDATE llx_lieu_concert "; + $sql = "UPDATE ".MAIN_DB_PREFIX."lieu_concert "; $sql .= " SET nom = '" . trim($this->nom) ."'"; $sql .= ",ville = '" . trim($this->ville) ."'"; $sql .= ",description = '" . trim($this->description) ."'"; @@ -87,7 +87,7 @@ class LieuConcert { */ Function fetch ($id) { - $sql = "SELECT rowid, nom, ville, description FROM llx_lieu_concert WHERE rowid = $id"; + $sql = "SELECT rowid, nom, ville, description FROM ".MAIN_DB_PREFIX."lieu_concert WHERE rowid = $id"; $result = $this->db->query($sql) ; @@ -126,7 +126,7 @@ class LieuConcert { { $ga = array(); - $sql = "SELECT rowid, nom, ville, description FROM llx_lieu_concert"; + $sql = "SELECT rowid, nom, ville, description FROM ".MAIN_DB_PREFIX."lieu_concert"; $sql .= " ORDER BY ville, nom"; if ($this->db->query($sql) ) { diff --git a/htdocs/product/concert/salles.php b/htdocs/product/concert/salles.php index ae47bb47ed7..00cd18e2259 100644 --- a/htdocs/product/concert/salles.php +++ b/htdocs/product/concert/salles.php @@ -38,7 +38,7 @@ $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 = "SELECT lc.rowid, lc.nom, lc.ville FROM ".MAIN_DB_PREFIX."lieu_concert as lc"; $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit( $limit ,$offset); diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 7d8e6b7ae2e..3e7f6baa755 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -274,7 +274,7 @@ else print 'Fournisseurs [Ajouter]'; $sql = "SELECT s.nom, s.idp"; - $sql .= " FROM llx_societe as s, llx_product_fournisseur as pf"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur as pf"; $sql .=" WHERE pf.fk_soc = s.idp AND pf.fk_product =$id"; $sql .= " ORDER BY lower(s.nom)"; @@ -372,7 +372,7 @@ else print ''; print ''; print "".''; print "".'\n"; -$sql = "select p.rowid, p.label, p.ref, count(*) as c from llx_propaldet as pd, llx_product as p where p.rowid = pd.fk_product group by (p.rowid)"; +$sql = "select p.rowid, p.label, p.ref, count(*) as c from ".MAIN_DB_PREFIX."propaldet as pd, ".MAIN_DB_PREFIX."product as p where p.rowid = pd.fk_product group by (p.rowid)"; $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit( $limit ,$offset); diff --git a/htdocs/product/promotion/promotion.class.php b/htdocs/product/promotion/promotion.class.php index de78f4ed6a3..b1d01391d8c 100644 --- a/htdocs/product/promotion/promotion.class.php +++ b/htdocs/product/promotion/promotion.class.php @@ -81,7 +81,7 @@ class Promotion { */ Function update($id, $user) { - $sql = "UPDATE llx_album "; + $sql = "UPDATE ".MAIN_DB_PREFIX."album "; $sql .= " SET title = '" . trim($this->titre) ."'"; $sql .= ",description = '" . trim($this->description) ."'"; @@ -168,7 +168,7 @@ class Promotion { $sql = "DELETE FROM ".DB_NAME_OSC.".products_description WHERE products_id = $idosc"; - $sql = "DELETE FROM llx_album WHERE rowid = $id"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id"; } diff --git a/htdocs/product/stats/commandestats.class.php b/htdocs/product/stats/commandestats.class.php index 5592745ace0..4d2b2d86fbb 100644 --- a/htdocs/product/stats/commandestats.class.php +++ b/htdocs/product/stats/commandestats.class.php @@ -35,7 +35,7 @@ class CommandeStats Function getNbCommandeByYear() { $result = array(); - $sql = "SELECT date_format(date_commande,'%Y') as dm, count(*) FROM llx_commande GROUP BY dm DESC WHERE fk_statut > 0"; + $sql = "SELECT date_format(date_commande,'%Y') as dm, count(*) FROM ".MAIN_DB_PREFIX."commande GROUP BY dm DESC WHERE fk_statut > 0"; if ($this->db->query($sql)) { $num = $this->db->num_rows(); @@ -58,7 +58,7 @@ class CommandeStats Function getNbCommandeByMonth($year) { $result = array(); - $sql = "SELECT date_format(date_commande,'%m') as dm, count(*) FROM llx_commande"; + $sql = "SELECT date_format(date_commande,'%m') as dm, count(*) FROM ".MAIN_DB_PREFIX."commande"; $sql .= " WHERE date_format(date_commande,'%Y') = $year AND fk_statut > 0"; $sql .= " GROUP BY dm DESC"; @@ -90,7 +90,7 @@ class CommandeStats Function getCommandeAmountByMonth($year) { $result = array(); - $sql = "SELECT date_format(date_commande,'%m') as dm, sum(total_ht) FROM llx_commande"; + $sql = "SELECT date_format(date_commande,'%m') as dm, sum(total_ht) FROM ".MAIN_DB_PREFIX."commande"; $sql .= " WHERE date_format(date_commande,'%Y') = $year AND fk_statut > 0"; $sql .= " GROUP BY dm DESC"; @@ -122,7 +122,7 @@ class CommandeStats Function getCommandeAverageByMonth($year) { $result = array(); - $sql = "SELECT date_format(date_commande,'%m') as dm, avg(total_ht) FROM llx_commande"; + $sql = "SELECT date_format(date_commande,'%m') as dm, avg(total_ht) FROM ".MAIN_DB_PREFIX."commande"; $sql .= " WHERE date_format(date_commande,'%Y') = $year AND fk_statut > 0"; $sql .= " GROUP BY dm DESC"; diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index bca95f9978d..3566f31c143 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -71,7 +71,7 @@ if ($id) print_barre_liste("Factures",$page,$PHP_SELF,"&id=$id",$sortfield,$sortorder); $sql = "SELECT distinct(f.rowid), s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid"; - $sql .= " FROM llx_societe as s,llx_facture as f, llx_facturedet as d WHERE f.fk_soc = s.idp"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as d WHERE f.fk_soc = s.idp"; $sql .= " AND d.fk_facture = f.rowid AND d.fk_product =".$id; $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit( $limit ,$offset); diff --git a/htdocs/product/stats/index.php b/htdocs/product/stats/index.php index 956fc121018..19e7b0f8168 100644 --- a/htdocs/product/stats/index.php +++ b/htdocs/product/stats/index.php @@ -34,7 +34,7 @@ print_fiche_titre('Statistiques commandes', $mesg); print '
Fournisseurs
'; $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.ref,".$db->pdate("p.datep")." as dp"; - $sql .= " FROM llx_societe as s, llx_propal as p"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; $sql .=" WHERE p.fk_soc = s.idp AND p.fk_statut = 0 AND p.fk_user_author = ".$user->id; $sql .= " ORDER BY p.datec DESC, tms DESC"; @@ -629,7 +629,7 @@ if ($id && $action == '' && $product->envente) print '
'; $sql = "SELECT s.nom, s.idp, f.rowid as factureid, f.facnumber,".$db->pdate("f.datef")." as df"; - $sql .= " FROM llx_societe as s, llx_facture as f"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; $sql .=" WHERE f.fk_soc = s.idp AND f.fk_statut = 0 AND f.fk_user_author = ".$user->id; $sql .= " ORDER BY f.datec DESC, f.rowid DESC"; diff --git a/htdocs/product/groupart/groupart.class.php b/htdocs/product/groupart/groupart.class.php index 3992f2ec088..d72d6ad8115 100644 --- a/htdocs/product/groupart/groupart.class.php +++ b/htdocs/product/groupart/groupart.class.php @@ -40,7 +40,7 @@ class Groupart { */ Function create($user) { - $sql = "INSERT INTO llx_groupart (fk_user_author) VALUES (".$user->id.")"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."groupart (fk_user_author) VALUES (".$user->id.")"; if ($this->db->query($sql) ) @@ -67,7 +67,7 @@ class Groupart { Function update($id, $user) { - $sql = "UPDATE llx_groupart "; + $sql = "UPDATE ".MAIN_DB_PREFIX."groupart "; $sql .= " SET nom = '" . trim($this->nom) ."'"; $sql .= " , description = '" . trim($this->desc) ."'"; $sql .= " , groupart = '" . trim($this->grar) ."'"; @@ -86,7 +86,7 @@ class Groupart { */ Function fetch ($id) { - $sql = "SELECT rowid, nom, groupart, description FROM llx_groupart WHERE rowid = $id"; + $sql = "SELECT rowid, nom, groupart, description FROM ".MAIN_DB_PREFIX."groupart WHERE rowid = $id"; $result = $this->db->query($sql) ; @@ -113,7 +113,7 @@ class Groupart { { $ga = array(); - $sql = "SELECT a.rowid, a.title FROM llx_album as a, llx_album_to_groupart as l"; + $sql = "SELECT a.rowid, a.title FROM ".MAIN_DB_PREFIX."album as a, ".MAIN_DB_PREFIX."album_to_groupart as l"; $sql .= " WHERE a.rowid = l.fk_album AND l.fk_groupart = ".$this->id; $sql .= " ORDER BY a.title"; @@ -163,7 +163,7 @@ class Groupart { { $ga = array(); - $sql = "SELECT rowid, nom FROM llx_groupart ORDER BY nom"; + $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."groupart ORDER BY nom"; if ($this->db->query($sql) ) { @@ -204,7 +204,7 @@ class Groupart { $sql = "DELETE FROM ".DB_NAME_OSC.".products_description WHERE products_id = $idosc"; - $sql = "DELETE FROM llx_album WHERE rowid = $id"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id"; } diff --git a/htdocs/product/groupart/index.php b/htdocs/product/groupart/index.php index 268407ad250..75af7d124f7 100644 --- a/htdocs/product/groupart/index.php +++ b/htdocs/product/groupart/index.php @@ -40,7 +40,7 @@ $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 = "SELECT g.rowid, g.nom, groupart FROM ".MAIN_DB_PREFIX."groupart as g"; $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit( $limit ,$offset); diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 4d5bb801833..8b2965eb012 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -27,7 +27,7 @@ if (!$user->rights->produit->lire) if ($action == 'update') { - $sql = "UPDATE llx_product SET description='$desc' where rowid = $rowid"; + $sql = "UPDATE ".MAIN_DB_PREFIX."product SET description='$desc' where rowid = $rowid"; $db->query($sql); } @@ -47,7 +47,7 @@ print '
'; /* * Produits en ventes et hors vente */ -$sql = "SELECT count(*), fk_product_type FROM llx_product as p WHERE envente = 0 GROUP BY fk_product_type"; +$sql = "SELECT count(*), fk_product_type FROM ".MAIN_DB_PREFIX."product as p WHERE envente = 0 GROUP BY fk_product_type"; if ($db->query($sql)) { $num = $db->num_rows(); @@ -78,7 +78,7 @@ print ''; /* * Derniers produits */ -$sql = "SELECT p.rowid, p.label, p.price, p.ref FROM llx_product as p WHERE envente=1"; +$sql = "SELECT p.rowid, p.label, p.price, p.ref FROM ".MAIN_DB_PREFIX."product as p WHERE envente=1"; $sql .= " ORDER BY p.datec DESC "; $sql .= $db->plimit(15 ,0); $result = $db->query($sql) ; diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 5a7076431e8..9572f44e8f1 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -27,7 +27,7 @@ if (!$user->rights->produit->lire) if ($action == 'update') { - $sql = "UPDATE llx_product SET description='$desc' where rowid = $rowid"; + $sql = "UPDATE ".MAIN_DB_PREFIX."product SET description='$desc' where rowid = $rowid"; $db->query($sql); } @@ -51,11 +51,11 @@ if ($sortorder == "") } $sql = "SELECT p.rowid, p.label, p.price, p.ref"; -$sql .= " FROM llx_product as p"; +$sql .= " FROM ".MAIN_DB_PREFIX."product as p"; if ($fourn_id > 0) { - $sql .= ", llx_product_fournisseur as pf"; + $sql .= ", ".MAIN_DB_PREFIX."product_fournisseur as pf"; } if ($HTTP_POST_VARS["sall"]) diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index eede0449d5f..c1ef79547d8 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -49,7 +49,7 @@ print ""; print_liste_field_titre("Nb. de proposition",$PHP_SELF, "c"); print "
'; print ''; -$sql = "SELECT count(*), date_format(date_commande,'%Y') as dm, sum(total_ht) FROM llx_commande WHERE fk_statut > 0 GROUP BY dm DESC "; +$sql = "SELECT count(*), date_format(date_commande,'%Y') as dm, sum(total_ht) FROM ".MAIN_DB_PREFIX."commande WHERE fk_statut > 0 GROUP BY dm DESC "; if ($db->query($sql)) { $num = $db->num_rows(); diff --git a/htdocs/product/stock/entrepot.class.php b/htdocs/product/stock/entrepot.class.php index c2783c341da..a50d1029b04 100644 --- a/htdocs/product/stock/entrepot.class.php +++ b/htdocs/product/stock/entrepot.class.php @@ -46,7 +46,7 @@ class Entrepot if ($this->db->query("BEGIN") ) { - $sql = "INSERT INTO llx_entrepot (datec, fk_user_author)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (datec, fk_user_author)"; $sql .= " VALUES (now(),".$user->id.")"; if ($this->db->query($sql) ) @@ -82,7 +82,7 @@ class Entrepot { if (strlen(trim($this->libelle))) { - $sql = "UPDATE llx_entrepot "; + $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; $sql .= " SET label = '" . trim($this->libelle) ."'"; $sql .= ",description = '" . trim($this->description) ."'"; $sql .= ",statut = " . $this->statut ; @@ -112,7 +112,7 @@ class Entrepot Function fetch ($id) { $sql = "SELECT rowid, label, description, statut"; - $sql .= " FROM llx_entrepot WHERE rowid = $id"; + $sql .= " FROM ".MAIN_DB_PREFIX."entrepot WHERE rowid = $id"; $result = $this->db->query($sql) ; @@ -143,7 +143,7 @@ class Entrepot { $liste = array(); - $sql = "SELECT rowid, label FROM llx_entrepot WHERE statut = 1"; + $sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."entrepot WHERE statut = 1"; $result = $this->db->query($sql) ; $i = 0; diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 01df43c901f..116bb2bbd9b 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -33,7 +33,7 @@ print_titre("Stocks"); print '
AnnéeNb de commandeSomme des commandes
'; print '
'; -$sql = "SELECT e.label, e.rowid, e.statut FROM llx_entrepot as e"; +$sql = "SELECT e.label, e.rowid, e.statut FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql .= " ORDER BY e.statut DESC "; $sql .= $db->plimit(15 ,0); $result = $db->query($sql) ; diff --git a/htdocs/product/stock/mouvementstock.class.php b/htdocs/product/stock/mouvementstock.class.php index ce420a0b4ee..3e2de8f9ca1 100644 --- a/htdocs/product/stock/mouvementstock.class.php +++ b/htdocs/product/stock/mouvementstock.class.php @@ -37,13 +37,13 @@ class MouvementStock if ($this->db->begin($transaction) ) { - $sql = "INSERT INTO llx_stock_mouvement (datem, fk_product, fk_entrepot, value, type_mouvement, fk_user_author)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."stock_mouvement (datem, fk_product, fk_entrepot, value, type_mouvement, fk_user_author)"; $sql .= " VALUES (now(), $product_id, $entrepot_id, $qty, $type, $user->id)"; if ($this->db->query($sql)) { - $sql = "UPDATE llx_product_stock SET reel = reel + $qty WHERE fk_entrepot = $entrepot_id AND fk_product = $product_id"; + $sql = "UPDATE ".MAIN_DB_PREFIX."product_stock SET reel = reel + $qty WHERE fk_entrepot = $entrepot_id AND fk_product = $product_id"; if ($this->db->query($sql)) { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 8e91dadb409..7cddc4a547e 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -93,7 +93,7 @@ if ($id) print 'Fournisseurs [Ajouter]'; $sql = "SELECT s.nom, s.idp"; - $sql .= " FROM llx_societe as s, llx_product_fournisseur as pf"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur as pf"; $sql .=" WHERE pf.fk_soc = s.idp AND pf.fk_product =$id"; $sql .= " ORDER BY lower(s.nom)"; @@ -127,7 +127,7 @@ if ($id) */ print '
'; print ''; - $sql = "SELECT e.rowid, e.label, ps.reel FROM llx_entrepot as e, llx_product_stock as ps"; + $sql = "SELECT e.rowid, e.label, ps.reel FROM ".MAIN_DB_PREFIX."entrepot as e, ".MAIN_DB_PREFIX."product_stock as ps"; $sql .= " WHERE ps.fk_entrepot = e.rowid AND ps.fk_product = $product->id"; $sql .= " ORDER BY lower(e.label)"; @@ -161,7 +161,7 @@ if ($id) print '
EntrepôtValeur du stock
'; print '
Entrepôt'; print '\n"; $sql = "SELECT s.nom, s.idp, p.rowid as projectid, p.ref, p.title,".$db->pdate("p.dateo")." as do"; -$sql .= " FROM llx_societe as s, llx_projet as p"; +$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."projet as p"; $sql .= " WHERE p.fk_soc = s.idp"; if ($socidp) diff --git a/htdocs/projet/project.class.php b/htdocs/projet/project.class.php index 4be6718c9af..a97d536370e 100644 --- a/htdocs/projet/project.class.php +++ b/htdocs/projet/project.class.php @@ -41,7 +41,7 @@ class Project { Function create($creatorid) { - $sql = "INSERT INTO llx_projet (ref, title, fk_soc, fk_user_creat, dateo) "; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet (ref, title, fk_soc, fk_user_creat, dateo) "; $sql .= " VALUES ('$this->ref', '$this->title', $this->socidp, $creatorid, now()) ;"; if (!$this->db->query($sql) ) @@ -56,7 +56,7 @@ class Project { */ Function update() { - $sql = "UPDATE llx_projet "; + $sql = "UPDATE ".MAIN_DB_PREFIX."projet "; $sql .= " SET ref = '$this->ref', title = '$this->title'"; $sql .= " WHERE rowid = $this->id"; @@ -71,14 +71,14 @@ class Project { */ Function delete() { - $sql = "DELETE FROM llx_projet WHERE rowid = $this->id"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."projet WHERE rowid = $this->id"; if ($this->db->query($sql) ) { - $sql = "UPDATE llx_propal SET fk_projet = 0 WHERE fk_projet = $this->id"; + $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fk_projet = 0 WHERE fk_projet = $this->id"; if ($this->db->query($sql) ) { - $sql = "UPDATE llx_facture SET fk_projet = 0 WHERE fk_projet = $this->id"; + $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET fk_projet = 0 WHERE fk_projet = $this->id"; if ($this->db->query($sql) ) { @@ -95,7 +95,7 @@ class Project { Function fetch($rowid) { - $sql = "SELECT fk_soc, title, ref FROM llx_projet WHERE rowid=$rowid;"; + $sql = "SELECT fk_soc, title, ref FROM ".MAIN_DB_PREFIX."projet WHERE rowid=$rowid;"; if ($this->db->query($sql) ) { @@ -124,7 +124,7 @@ class Project { Function get_propal_list() { $propales = array(); - $sql = "SELECT rowid FROM llx_propal WHERE fk_projet=$this->id;"; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."propal WHERE fk_projet=$this->id;"; if ($this->db->query($sql) ) { @@ -160,7 +160,7 @@ class Project { Function get_facture_list() { $factures = array(); - $sql = "SELECT rowid FROM llx_facture WHERE fk_projet=$this->id;"; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE fk_projet=$this->id;"; if ($this->db->query($sql) ) { @@ -196,7 +196,7 @@ class Project { Function get_commande_list() { $commandes = array(); - $sql = "SELECT rowid FROM llx_commande WHERE fk_projet=$this->id;"; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande WHERE fk_projet=$this->id;"; if ($this->db->query($sql) ) { diff --git a/htdocs/public/adherents/index.php b/htdocs/public/adherents/index.php index d99b9d671a6..c03cf44ca60 100644 --- a/htdocs/public/adherents/index.php +++ b/htdocs/public/adherents/index.php @@ -39,7 +39,7 @@ print "\n"; $var=True; -$sql = "SELECT count(*) as somme , t.libelle FROM llx_adherent as d, llx_adherent_type as t"; +$sql = "SELECT count(*) as somme , t.libelle FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; $sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 GROUP BY t.libelle"; $result = $db->query($sql); diff --git a/htdocs/public/adherents/new.php b/htdocs/public/adherents/new.php index 8c248af4344..7adcff596cf 100644 --- a/htdocs/public/adherents/new.php +++ b/htdocs/public/adherents/new.php @@ -39,7 +39,7 @@ if ($_POST["action"] == 'add') $error+=1; $errmsg .="Login $login vide. Veuillez en positionner un
\n"; } - $sql = "SELECT login FROM llx_adherent WHERE login='".$login."';"; + $sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$login."';"; $result = $db->query($sql); if ($result) { $num = $db->num_rows(); diff --git a/htdocs/public/adherents/priv_edit.php b/htdocs/public/adherents/priv_edit.php index d170217d210..298f4acb387 100644 --- a/htdocs/public/adherents/priv_edit.php +++ b/htdocs/public/adherents/priv_edit.php @@ -46,7 +46,7 @@ if ($action == 'update') // test some values // test si le login existe deja - $sql = "SELECT rowid,login FROM llx_adherent WHERE login='$login';"; + $sql = "SELECT rowid,login FROM ".MAIN_DB_PREFIX."adherent WHERE login='$login';"; $result = $db->query($sql); if ($result) { $num = $db->num_rows(); @@ -140,7 +140,7 @@ if (isset($_SERVER["REMOTE_USER"])){ $adho->fetch_optionals(); $sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber"; - $sql .= " FROM societe as s, llx_facture as f WHERE f.fk_soc = s.idp"; + $sql .= " FROM societe as s, ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.idp"; $sql .= " AND f.rowid = $facid"; $result = $db->query($sql); diff --git a/htdocs/public/adherents/priv_liste.php b/htdocs/public/adherents/priv_liste.php index 1aa8abc59c6..4d01a14708b 100644 --- a/htdocs/public/adherents/priv_liste.php +++ b/htdocs/public/adherents/priv_liste.php @@ -34,9 +34,9 @@ $offset = $conf->liste_limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -$sql = "select rowid,prenom,nom, societe, cp,ville,email,naiss,photo from llx_adherent where statut=1 ORDER BY $sortfield $sortorder ". $db->plimit($conf->liste_limit, $offset); +$sql = "select rowid,prenom,nom, societe, cp,ville,email,naiss,photo from ".MAIN_DB_PREFIX."adherent where statut=1 ORDER BY $sortfield $sortorder ". $db->plimit($conf->liste_limit, $offset); //$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, cp, ville, d.email, t.libelle as type, d.morphy, d.statut, t.cotisation"; -//$sql .= " FROM llx_adherent as d, llx_adherent_type as t"; +//$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; //$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = $statut"; //$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); diff --git a/htdocs/public/dons/bplc.php b/htdocs/public/dons/bplc.php index 156db6a3074..60126bd1b94 100644 --- a/htdocs/public/dons/bplc.php +++ b/htdocs/public/dons/bplc.php @@ -78,7 +78,7 @@ if($return) $don_id = strstr($retbplc->ref_commande, 0, strlen($retbplc->ref_commande) -2); - // 5 correspond au paiement en ligne voir table c_paiement + // 5 correspond au paiement en ligne voir table llx_c_paiement $don->set_paye($don_id, 5); diff --git a/htdocs/public/dons/depenses_code.php b/htdocs/public/dons/depenses_code.php index 8d5207c315c..fc6dc43e3c8 100644 --- a/htdocs/public/dons/depenses_code.php +++ b/htdocs/public/dons/depenses_code.php @@ -26,7 +26,7 @@ $conf = new Conf(); $db = new DoliDb(); $a = setlocale(LC_TIME, "fr_FR"); $sql = "SELECT ".$db->pdate("f.datef")." as datef, s.nom, f.total, f.note, f.paye"; -$sql .= " FROM llx_facture_fourn as f, llx_societe as s"; +$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE f.fk_soc = s.idp ORDER BY f.datef DESC"; if ( $db->query( $sql) ) diff --git a/htdocs/public/dons/donateurs_code.php b/htdocs/public/dons/donateurs_code.php index fd5f67a0edc..622214e5674 100644 --- a/htdocs/public/dons/donateurs_code.php +++ b/htdocs/public/dons/donateurs_code.php @@ -25,7 +25,7 @@ $conf = new Conf(); $db = new DoliDb(); $a = setlocale(LC_TIME, "fr_FR"); $sql = "SELECT ".$db->pdate("d.datedon")." as datedon, d.nom, d.prenom, d.amount, d.public, d.societe"; -$sql .= " FROM llx_don as d"; +$sql .= " FROM ".MAIN_DB_PREFIX."don as d"; $sql .= " WHERE d.fk_don_projet = 1 AND d.fk_statut in (2, 3) ORDER BY d.datedon DESC"; if ( $db->query( $sql) ) diff --git a/htdocs/societe/notify/fiche.php b/htdocs/societe/notify/fiche.php index b3cc5f9b64b..2379a8cfeb9 100644 --- a/htdocs/societe/notify/fiche.php +++ b/htdocs/societe/notify/fiche.php @@ -32,11 +32,11 @@ llxHeader(); if ($HTTP_POST_VARS["action"] == 'add') { - $sql = "DELETE FROM llx_notify_def"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; $sql .= " WHERE fk_soc=".$socid." AND fk_contact=".$HTTP_POST_VARS["contactid"]." AND fk_action=".$HTTP_POST_VARS["actionid"]; if ($db->query($sql)) { - $sql = "INSERT INTO llx_notify_def (datec,fk_soc, fk_contact, fk_action)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)"; $sql .= " VALUES (now(),$socid,".$HTTP_POST_VARS["contactid"].",".$HTTP_POST_VARS["actionid"].")"; if ($db->query($sql)) @@ -56,7 +56,7 @@ if ($HTTP_POST_VARS["action"] == 'add') if ($action == "delete") { - $sql = "DELETE FROM llx_notify_def"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; $sql .= " WHERE rowid = $actid"; if ($db->query($sql)) @@ -121,7 +121,7 @@ if ( $soc->fetch($socid) ) print ''; print ''; - $sql = "SELECT c.name, c.firstname, a.titre,n.rowid FROM llx_socpeople as c, llx_action_def as a, llx_notify_def as n"; + $sql = "SELECT c.name, c.firstname, a.titre,n.rowid FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n"; $sql .= " WHERE n.fk_contact = c.idp AND a.rowid = n.fk_action AND n.fk_soc = ".$soc->id; if ($db->query($sql)) @@ -149,7 +149,7 @@ if ( $soc->fetch($socid) ) * */ - $sql = "SELECT a.rowid, a.titre FROM llx_action_def as a"; + $sql = "SELECT a.rowid, a.titre FROM ".MAIN_DB_PREFIX."action_def as a"; if ($db->query($sql)) { diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php index 92fe2ad86bc..ff97bda7034 100644 --- a/htdocs/societe/notify/index.php +++ b/htdocs/societe/notify/index.php @@ -55,7 +55,7 @@ $pagenext = $page + 1; */ print_barre_liste("Liste des societes", $page, $PHP_SELF); -$sql = "SELECT s.nom, s.idp, c.name, c.firstname, a.titre,n.rowid FROM llx_socpeople as c, llx_action_def as a, llx_notify_def as n, llx_societe as s"; +$sql = "SELECT s.nom, s.idp, c.name, c.firstname, a.titre,n.rowid FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n, ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE n.fk_contact = c.idp AND a.rowid = n.fk_action"; $sql .= " AND n.fk_soc = s.idp"; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index cd5712a802e..a95cdf318ef 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -199,7 +199,7 @@ else print "".'
Entrepôt
 
'; print ''; - $sql = "SELECT r.id, r.libelle, r.module FROM llx_rights_def as r ORDER BY r.id ASC"; + $sql = "SELECT r.id, r.libelle, r.module FROM ".MAIN_DB_PREFIX."rights_def as r ORDER BY r.id ASC"; if ($db->query($sql)) { @@ -227,7 +227,7 @@ else * Droits */ print '
'; - $sql = "SELECT r.id, r.libelle, r.module FROM llx_rights_def as r, llx_user_rights as ur"; + $sql = "SELECT r.id, r.libelle, r.module FROM ".MAIN_DB_PREFIX."rights_def as r, ".MAIN_DB_PREFIX."user_rights as ur"; $sql .= " WHERE ur.fk_id = r.id AND ur.fk_user = ".$fuser->id. " ORDER BY r.id ASC"; $var = True; if ($db->query($sql)) @@ -279,7 +279,7 @@ else * Droits */ print '
'; - $sql = "SELECT r.libelle, r.module FROM llx_rights_def as r, llx_user_rights as ur"; + $sql = "SELECT r.libelle, r.module FROM ".MAIN_DB_PREFIX."rights_def as r, ".MAIN_DB_PREFIX."user_rights as ur"; $sql .= " WHERE ur.fk_id = r.id AND ur.fk_user = ".$fuser->id. " ORDER BY r.id ASC"; $var = True; if ($db->query($sql)) diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 7c65ecaaa1d..93c7e6635fc 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -26,7 +26,7 @@ llxHeader(); print_titre("Liste des utilisateurs"); $sql = "SELECT u.rowid, u.name, u.firstname, u.code, u.login, u.module_comm, u.module_compta"; -$sql .= " FROM llx_user as u"; +$sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " ORDER BY u.name"; $result = $db->query($sql);