diff --git a/htdocs/admin/adherent.php b/htdocs/admin/adherent.php
index fad6472365e..02f2870afbc 100644
--- a/htdocs/admin/adherent.php
+++ b/htdocs/admin/adherent.php
@@ -42,9 +42,9 @@ $var=True;
if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add')
{
if (isset($HTTP_POST_VARS["consttype"]) && $HTTP_POST_VARS["consttype"] != ''){
- $sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='".$typeconst[$HTTP_POST_VARS["consttype"]]."',visible=0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='".$typeconst[$HTTP_POST_VARS["consttype"]]."',visible=0";
}else{
- $sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."',visible=0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."',visible=0";
}
if ($db->query($sql))
@@ -63,7 +63,7 @@ if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add')
if ($action == 'set')
{
- $sql = "REPLACE INTO llx_const SET name = '$name', value='".$value."', visible=0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '$name', value='".$value."', visible=0";
if ($db->query($sql))
{
@@ -73,7 +73,7 @@ if ($action == 'set')
if ($action == 'unset')
{
- $sql = "DELETE FROM llx_const WHERE name = '$name'";
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = '$name'";
if ($db->query($sql))
{
@@ -267,7 +267,7 @@ function form_constantes($tableau){
$var=True;
foreach($tableau as $const){
- $sql = "SELECT rowid, name, value, type, note FROM llx_const WHERE name='$const'";
+ $sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const WHERE name='$const'";
$result = $db->query($sql);
if ($result && ($db->num_rows() == 1)) {
$obj = $db->fetch_object(0);
diff --git a/htdocs/admin/boutique-special-all.php b/htdocs/admin/boutique-special-all.php
index 8d7becb13dc..5a5beee92f1 100644
--- a/htdocs/admin/boutique-special-all.php
+++ b/htdocs/admin/boutique-special-all.php
@@ -30,7 +30,7 @@ llxHeader();
print_barre_liste("Mise a jour de tous les livres", $page, $PHP_SELF);
-$sql = "SELECT l.rowid FROM llx_livre as l";
+$sql = "SELECT l.rowid FROM ".MAIN_DB_PREFIX."livre as l";
if ( $db->query($sql) )
{
diff --git a/htdocs/admin/boutique-update-all.php b/htdocs/admin/boutique-update-all.php
index cc4edad91b6..94dc7aeac9c 100644
--- a/htdocs/admin/boutique-update-all.php
+++ b/htdocs/admin/boutique-update-all.php
@@ -29,7 +29,7 @@ llxHeader();
print_barre_liste("Mise a jour de tous les livres", $page, $PHP_SELF);
-$sql = "SELECT l.rowid FROM llx_livre as l";
+$sql = "SELECT l.rowid FROM ".MAIN_DB_PREFIX."livre as l";
if ( $db->query($sql) )
{
diff --git a/htdocs/admin/boutique.php b/htdocs/admin/boutique.php
index cd1a486ba2b..95555e843a5 100644
--- a/htdocs/admin/boutique.php
+++ b/htdocs/admin/boutique.php
@@ -48,7 +48,7 @@ $modules["BOUTIQUE_ALBUM"][3] = "Module de gestion des albums";
if ($action == 'set')
{
- $sql = "REPLACE INTO llx_const SET name = '".$value."', value='1', visible = 0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '".$value."', value='1', visible = 0";
if ($db->query($sql))
{
@@ -58,7 +58,7 @@ if ($action == 'set')
if ($action == 'reset')
{
- $sql = "REPLACE INTO llx_const SET name = '".$value."', value='0', visible = 0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '".$value."', value='0', visible = 0";
if ($db->query($sql))
{
diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php
index 132638a9bba..2cc3267493c 100644
--- a/htdocs/admin/boxes.php
+++ b/htdocs/admin/boxes.php
@@ -27,14 +27,14 @@ print_titre("Boites affich
if ($HTTP_POST_VARS["action"] == 'add')
{
- $sql = "INSERT INTO llx_boxes (box_id, position) values (".$HTTP_POST_VARS["rowid"].",".$HTTP_POST_VARS["constvalue"].");";
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id, position) values (".$HTTP_POST_VARS["rowid"].",".$HTTP_POST_VARS["constvalue"].");";
$result = $db->query($sql);
}
if ($action == 'delete')
{
- $sql = "DELETE FROM llx_boxes WHERE rowid=$rowid";
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes WHERE rowid=$rowid";
$result = $db->query($sql);
}
@@ -51,7 +51,7 @@ $pos[0] = "Homepage";
print '
';
-$sql = "SELECT b.rowid, b.box_id, b.position, d.name FROM llx_boxes as b, llx_boxes_def as d where b.box_id = d.rowid";
+$sql = "SELECT b.rowid, b.box_id, b.position, d.name FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as d where b.box_id = d.rowid";
$result = $db->query($sql);
if ($result)
{
@@ -85,7 +85,7 @@ print "
";
print_titre("Boites disponibles");
print '
';
-$sql = "SELECT rowid, name, file FROM llx_boxes_def";
+$sql = "SELECT rowid, name, file FROM ".MAIN_DB_PREFIX."boxes_def";
$result = $db->query($sql);
if ($result)
{
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index efbdc8ca4e6..ae1c05a8213 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -39,7 +39,7 @@ $commande_addon_var = COMMANDE_ADDON;
if ($action == 'setmod')
{
- $sql = "REPLACE INTO llx_const SET name = 'COMMANDE_ADDON', value='".$value."', visible=0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'COMMANDE_ADDON', value='".$value."', visible=0";
if ($db->query($sql))
{
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index c76a8ec5b11..3dac16c33bf 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -22,7 +22,7 @@ require("./pre.inc.php");
if ($action == 'nbprod' && $user->admin)
{
- $sql = "REPLACE INTO llx_const SET name = 'EXPEDITION_NEW_FORM_NB_PRODUCT', value='".$value."', visible=0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'EXPEDITION_NEW_FORM_NB_PRODUCT', value='".$value."', visible=0";
if ($db->query($sql))
{
@@ -41,7 +41,7 @@ if (!$user->admin)
if ($action == 'set')
{
- $sql = "INSERT INTO llx_propal_model_pdf (nom) VALUES ('".$value."')";
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$value."')";
if ($db->query($sql))
{
@@ -50,7 +50,7 @@ if ($action == 'set')
}
if ($action == 'del')
{
- $sql = "DELETE FROM llx_propal_model_pdf WHERE nom='".$value."'";
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_model_pdf WHERE nom='".$value."'";
if ($db->query($sql))
{
@@ -64,7 +64,7 @@ $expedition_addon_var_pdf = EXPEDITION_ADDON_PDF;
if ($action == 'setpdf')
{
- $sql = "REPLACE INTO llx_const SET name = 'EXPEDITION_ADDON_PDF', value='".$value."', visible=0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'EXPEDITION_ADDON_PDF', value='".$value."', visible=0";
if ($db->query($sql))
{
@@ -75,7 +75,7 @@ if ($action == 'setpdf')
/*
* On la set active
*/
- $sql = "INSERT INTO llx_propal_model_pdf (nom) VALUES ('".$value."')";
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$value."')";
if ($db->query($sql))
{
@@ -87,7 +87,7 @@ $expedition_addon_var = EXPEDITION_ADDON;
if ($action == 'setmod')
{
- $sql = "REPLACE INTO llx_const SET name = 'EXPEDITION_ADDON', value='".$value."', visible=0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'EXPEDITION_ADDON', value='".$value."', visible=0";
if ($db->query($sql))
{
@@ -161,7 +161,7 @@ print '
';
$def = array();
-$sql = "SELECT nom FROM llx_propal_model_pdf";
+$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."propal_model_pdf";
if ($db->query($sql))
{
$i = 0;
diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php
index 82b6d10934b..3c5767d95db 100644
--- a/htdocs/admin/external_rss.php
+++ b/htdocs/admin/external_rss.php
@@ -42,9 +42,9 @@ if ($action == 'save')
if(isset($$external_rss_url)) {
$external_rss_title = "external_rss_title_" . $i;
$external_rss_urlrss = "external_rss_urlrss_" . $i;
- $sql = "REPLACE INTO llx_const SET name = '" . "EXTERNAL_RSS_URL_" . $i . "', value='".$$external_rss_url."', visible=0";
- $sql1 = "REPLACE INTO llx_const SET name = '" . "EXTERNAL_RSS_TITLE_" . $i . "', value='".$$external_rss_title."', visible=0";
- $sql2 = "REPLACE INTO llx_const SET name = '" . "EXTERNAL_RSS_URLRSS_" . $i . "', value='".$$external_rss_urlrss."', visible=0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '" . "EXTERNAL_RSS_URL_" . $i . "', value='".$$external_rss_url."', visible=0";
+ $sql1 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '" . "EXTERNAL_RSS_TITLE_" . $i . "', value='".$$external_rss_title."', visible=0";
+ $sql2 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = '" . "EXTERNAL_RSS_URLRSS_" . $i . "', value='".$$external_rss_urlrss."', visible=0";
if ($db->query($sql) && $db->query($sql1) && $db->query($sql2))
{
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index db072d0179c..c77579af54c 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -37,7 +37,7 @@ $facture_rib_number_var = FACTURE_RIB_NUMBER;
if ($action == 'set')
{
- $sql = "REPLACE INTO llx_const SET name = 'FACTURE_ADDON', value='".$value."', visible=0, type='chaine'";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'FACTURE_ADDON', value='".$value."', visible=0, type='chaine'";
if ($db->query($sql))
{
@@ -49,7 +49,7 @@ if ($action == 'set')
if ($action == 'setrib')
{
- $sql = "REPLACE INTO llx_const SET name = 'FACTURE_RIB_NUMBER', value='".$value."', visible=0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'FACTURE_RIB_NUMBER', value='".$value."', visible=0";
if ($db->query($sql))
{
@@ -61,7 +61,7 @@ if ($action == 'setrib')
if ($action == 'setpdf')
{
- $sql = "REPLACE INTO llx_const SET name = 'FACTURE_ADDON_PDF', value='".$value."', visible=0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'FACTURE_ADDON_PDF', value='".$value."', visible=0";
if ($db->query($sql))
{
@@ -192,7 +192,7 @@ print '
';
print "\n";
print '
';
$def = array();
-$sql = "SELECT nom FROM llx_propal_model_pdf";
+$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."propal_model_pdf";
if ($db->query($sql))
{
$i = 0;
diff --git a/htdocs/admin/sqltables.php b/htdocs/admin/sqltables.php
index 62647c1103d..cd4a1328fe2 100644
--- a/htdocs/admin/sqltables.php
+++ b/htdocs/admin/sqltables.php
@@ -26,7 +26,7 @@ llxHeader();
print_barre_liste("Liste des tables", $page, $PHP_SELF);
-$sql = "SELECT name, loaded FROM llx_sqltables";
+$sql = "SELECT name, loaded FROM ".MAIN_DB_PREFIX."sqltables";
print "
";
print '
';
diff --git a/htdocs/admin/system/const.php b/htdocs/admin/system/const.php
index 52c10611690..298de50440d 100644
--- a/htdocs/admin/system/const.php
+++ b/htdocs/admin/system/const.php
@@ -43,9 +43,9 @@ if ($user->admin)
{
if (isset($HTTP_POST_VARS["consttype"]) && $HTTP_POST_VARS["consttype"] != ''){
- $sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='".$typeconst[$HTTP_POST_VARS["consttype"]]."'";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='".$typeconst[$HTTP_POST_VARS["consttype"]]."'";
}else{
- $sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."'";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."'";
}
@@ -58,7 +58,7 @@ if ($user->admin)
if ($action == 'delete')
{
- $sql = "DELETE FROM llx_const WHERE rowid='$rowid'";
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE rowid='$rowid'";
$result = $db->query($sql);
if (!$result)
@@ -69,9 +69,9 @@ if ($user->admin)
}
if ($all==1){
- $sql = "SELECT rowid, name, value, type, note FROM llx_const ORDER BY name ASC";
+ $sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const ORDER BY name ASC";
}else{
- $sql = "SELECT rowid, name, value, type, note FROM llx_const WHERE visible = 1 ORDER BY name ASC";
+ $sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const WHERE visible = 1 ORDER BY name ASC";
}
$result = $db->query($sql);
if ($result)
diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php
index ebe5a8b255d..fa26ce8c2c5 100644
--- a/htdocs/admin/system/constall.php
+++ b/htdocs/admin/system/constall.php
@@ -30,7 +30,7 @@ print '
Nom
';
print '
Valeur
';
print "
\n";
-$sql = "SELECT rowid, name, value, type, note FROM llx_const ORDER BY name ASC";
+$sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const ORDER BY name ASC";
$result = $db->query($sql);
if ($result)
{
diff --git a/htdocs/admin/system/gen-commande.php b/htdocs/admin/system/gen-commande.php
index ed1b37d8b57..36c1cc3f8cb 100644
--- a/htdocs/admin/system/gen-commande.php
+++ b/htdocs/admin/system/gen-commande.php
@@ -22,12 +22,12 @@ require("./pre.inc.php");
llxHeader();
-$sql = "SELECT rowid FROM llx_product"; $productsid = array();
+$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
if ($db->query($sql)) {
$num = $db->num_rows(); $i = 0;
while ($i < $num) { $row = $db->fetch_row($i); $productsid[$i] = $row[0]; $i++; } }
-$sql = "SELECT idp FROM llx_societe"; $societesid = array();
+$sql = "SELECT idp FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
while ($i < $num) { $row = $db->fetch_row($i); $societesid[$i] = $row[0]; $i++; } } else { print "err"; }
diff --git a/htdocs/admin/system/gendata.php b/htdocs/admin/system/gendata.php
index 42ee5570ab5..350cc6e7742 100644
--- a/htdocs/admin/system/gendata.php
+++ b/htdocs/admin/system/gendata.php
@@ -38,16 +38,16 @@ include_once "../../product.class.php";
include_once "../../paiement.class.php";
include_once "../../contrat/contrat.class.php";
-$sql = "SELECT rowid FROM llx_product"; $productsid = array();
+$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
if ($db->query($sql)) {
$num = $db->num_rows(); $i = 0;
while ($i < $num) { $row = $db->fetch_row($i); $productsid[$i] = $row[0]; $i++; } }
-$sql = "SELECT idp FROM llx_societe"; $societesid = array();
+$sql = "SELECT idp FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
while ($i < $num) { $row = $db->fetch_row($i); $societesid[$i] = $row[0]; $i++; } } else { print "err"; }
-$sql = "SELECT rowid FROM llx_commande"; $commandesid = array();
+$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
if ($db->query($sql)) { $num = $db->num_rows(); $i = 0;
while ($i < $num) { $row = $db->fetch_row($i); $commandesid[$i] = $row[0]; $i++; } } else { print "err"; }
diff --git a/htdocs/admin/system/update.php b/htdocs/admin/system/update.php
index ba7071ecff3..a7a4d99d2dd 100644
--- a/htdocs/admin/system/update.php
+++ b/htdocs/admin/system/update.php
@@ -49,7 +49,7 @@ $err = 0;
/*
* Factures
*/
-$sql = "SELECT rowid FROM llx_facture";
+$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture";
if ($db->query($sql))
{
$num = $db->num_rows();
@@ -85,7 +85,7 @@ else
$err++;
}
-$sql = "DELETE FROM llx_const WHERE name = 'MAIN_NEED_UPDATE'";
+$sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'MAIN_NEED_UPDATE'";
if (! $db->query($sql))
{
print "Erreur #100";
diff --git a/htdocs/admin/webcalendar.php b/htdocs/admin/webcalendar.php
index 6d4c737caba..5e33fbaa4f0 100644
--- a/htdocs/admin/webcalendar.php
+++ b/htdocs/admin/webcalendar.php
@@ -36,12 +36,12 @@ $def = array();
if ($action == 'save')
{
if(trim($phpwebcalendar_pass) == trim($phpwebcalendar_pass2)) {
- $sql = "REPLACE INTO llx_const SET name = 'PHPWEBCALENDAR_URL', value='".$phpwebcalendar_url."', visible=0";
+ $sql = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_URL', value='".$phpwebcalendar_url."', visible=0";
- $sql1 = "REPLACE INTO llx_const SET name = 'PHPWEBCALENDAR_HOST', value='".$phpwebcalendar_host."', visible=0";
- $sql2 = "REPLACE INTO llx_const SET name = 'PHPWEBCALENDAR_DBNAME', value='".$phpwebcalendar_dbname."', visible=0";
- $sql3 = "REPLACE INTO llx_const SET name = 'PHPWEBCALENDAR_USER', value='".$phpwebcalendar_user."', visible=0";
- $sql4 = "REPLACE INTO llx_const SET name = 'PHPWEBCALENDAR_PASS', value='".$phpwebcalendar_pass."', visible=0";
+ $sql1 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_HOST', value='".$phpwebcalendar_host."', visible=0";
+ $sql2 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_DBNAME', value='".$phpwebcalendar_dbname."', visible=0";
+ $sql3 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_USER', value='".$phpwebcalendar_user."', visible=0";
+ $sql4 = "REPLACE INTO ".MAIN_DB_PREFIX."const SET name = 'PHPWEBCALENDAR_PASS', value='".$phpwebcalendar_pass."', visible=0";
if ($db->query($sql) && $db->query($sql1) && $db->query($sql2) && $db->query($sql3) && $db->query($sql4))
{
diff --git a/htdocs/boutique/auteur/auteur.class.php b/htdocs/boutique/auteur/auteur.class.php
index e2719b29fd0..e761cddc499 100644
--- a/htdocs/boutique/auteur/auteur.class.php
+++ b/htdocs/boutique/auteur/auteur.class.php
@@ -37,7 +37,7 @@ class Auteur {
*/
Function create($user) {
- $sql = "INSERT INTO llx_auteur (fk_user_author) VALUES (".$user->id.")";
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."auteur (fk_user_author) VALUES (".$user->id.")";
if ($this->db->query($sql) )
{
@@ -59,7 +59,7 @@ class Auteur {
{
$ga = array();
- $sql = "SELECT rowid, nom FROM llx_auteur ORDER BY nom";
+ $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."auteur ORDER BY nom";
if ($this->db->query($sql) )
{
@@ -92,7 +92,7 @@ class Auteur {
Function update($id, $user)
{
- $sql = "UPDATE llx_auteur ";
+ $sql = "UPDATE ".MAIN_DB_PREFIX."auteur ";
$sql .= " SET nom = '" . trim($this->nom) ."'";
$sql .= " WHERE rowid = " . $id;
@@ -119,7 +119,7 @@ class Auteur {
{
$sql = "SELECT a.rowid, ";
}
- $sql .= " a.title FROM llx_livre as a, llx_livre_to_auteur as l";
+ $sql .= " a.title FROM ".MAIN_DB_PREFIX."livre as a, ".MAIN_DB_PREFIX."livre_to_auteur as l";
$sql .= " WHERE a.rowid = l.fk_livre AND l.fk_auteur = ".$this->id;
if ($status)
{
@@ -156,7 +156,7 @@ class Auteur {
*/
Function fetch ($id) {
- $sql = "SELECT rowid, nom FROM llx_auteur WHERE rowid = $id";
+ $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."auteur WHERE rowid = $id";
$result = $this->db->query($sql) ;
@@ -188,7 +188,7 @@ class Auteur {
if (sizeof($livres) == 0)
{
- $sql = "DELETE FROM llx_auteur WHERE rowid = $this->id ";
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."auteur WHERE rowid = $this->id ";
$return = $this->db->query($sql) ;
}
diff --git a/htdocs/boutique/auteur/index.php b/htdocs/boutique/auteur/index.php
index f0aad6c2201..27b2a5fd6db 100644
--- a/htdocs/boutique/auteur/index.php
+++ b/htdocs/boutique/auteur/index.php
@@ -38,7 +38,7 @@ $offset = $limit * $page ;
print_barre_liste("Liste des Auteurs", $page, $PHP_SELF);
-$sql = "SELECT e.rowid, e.nom FROM llx_auteur as e";
+$sql = "SELECT e.rowid, e.nom FROM ".MAIN_DB_PREFIX."auteur as e";
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit( $limit ,$offset);
diff --git a/htdocs/boutique/editeur/editeur.class.php b/htdocs/boutique/editeur/editeur.class.php
index 60e66b3ba72..602f9a89a72 100644
--- a/htdocs/boutique/editeur/editeur.class.php
+++ b/htdocs/boutique/editeur/editeur.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) ;
@@ -139,7 +139,7 @@ class Editeur {
{
$ga = array();
- $sql = "SELECT a.rowid, a.title FROM llx_livre as a";
+ $sql = "SELECT a.rowid, a.title FROM ".MAIN_DB_PREFIX."livre as a";
$sql .= " WHERE a.fk_editeur = ".$this->id;
$sql .= " ORDER BY a.title";
@@ -175,7 +175,7 @@ class Editeur {
if (sizeof($livres) == 0)
{
- $sql = "DELETE FROM llx_editeur WHERE rowid = $this->id ";
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."editeur WHERE rowid = $this->id ";
$return = $this->db->query($sql) ;
}
diff --git a/htdocs/comm/bookmark.php b/htdocs/comm/bookmark.php
index 51c455eab15..ec5b19555d4 100644
--- a/htdocs/comm/bookmark.php
+++ b/htdocs/comm/bookmark.php
@@ -60,7 +60,7 @@ $pagenext = $page + 1;
print '
Bookmark
';
$sql = "SELECT s.idp, s.nom, ".$db->pdate("b.dateb")." as dateb, st.libelle as stcomm, b.rowid as bid, b.author";
-$sql .= " FROM llx_societe as s, c_stcomm as st, llx_bookmark as b";
+$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st, ".MAIN_DB_PREFIX."bookmark as b";
$sql .= " WHERE b.fk_soc = s.idp AND s.fk_stcomm = st.id AND s.datea is not null";
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset);
diff --git a/htdocs/comm/people.php b/htdocs/comm/people.php
index fac0aea5f9c..49ca6eb5e1e 100644
--- a/htdocs/comm/people.php
+++ b/htdocs/comm/people.php
@@ -84,7 +84,8 @@ llxHeader();
if ($socid > 0)
{
- $sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.cp,s.ville, s.note FROM llx_societe as s, c_stcomm as st ";
+ $sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.cp,s.ville, s.note";
+ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st ";
$sql .= " WHERE s.fk_stcomm=st.id";
$sql .= " AND s.idp = $socid";
@@ -233,7 +234,7 @@ if ($socid > 0)
print "
Fax
Email
";
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
- $sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_user as u ";
+ $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
$sql .= " WHERE a.fk_soc = $objsoc->idp ";
$sql .= " AND u.rowid = a.fk_user_author";
$sql .= " AND c.id=a.fk_action ";
diff --git a/htdocs/compta/caisse/annuel.php b/htdocs/compta/caisse/annuel.php
index 09ec43f13e5..f1d9b6bdd58 100644
--- a/htdocs/compta/caisse/annuel.php
+++ b/htdocs/compta/caisse/annuel.php
@@ -38,7 +38,7 @@ if ($user->societe_id > 0)
print_titre("Caisse");
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%Y-%m') as dm";
-$sql .= " FROM llx_paiement as f";
+$sql .= " FROM ".MAIN_DB_PREFIX."paiement as f";
if ($socidp)
{
@@ -59,7 +59,7 @@ if ($db->query($sql))
}
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%Y-%m') as dm";
-$sql .= " FROM llx_paiementfourn as f";
+$sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as f";
if ($socidp)
{
diff --git a/htdocs/compta/caisse/index.php b/htdocs/compta/caisse/index.php
index 967739dc49f..b270a0b29a5 100644
--- a/htdocs/compta/caisse/index.php
+++ b/htdocs/compta/caisse/index.php
@@ -52,7 +52,7 @@ $titre_mois = strftime("%B %Y", $time);
print_fiche_titre("Journal de caisse");
$sql = "SELECT f.amount, date_format(f.datep,'%Y-%m') as dm";
-$sql .= " FROM llx_paiement as f";
+$sql .= " FROM ".MAIN_DB_PREFIX."paiement as f";
$sql .= " WHERE date_format(f.datep,'%Y%m') = ".$annee.$mois;
if ($socidp)
@@ -73,7 +73,7 @@ if ($db->query($sql))
}
$sql = "SELECT sum(f.amount) as amount , date_format(f.datep,'%d') as dm";
-$sql .= " FROM llx_paiementfourn as f";
+$sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as f";
if ($socidp)
{
diff --git a/htdocs/compta/deplacement/deplacement.class.php b/htdocs/compta/deplacement/deplacement.class.php
index b9909c029da..0e132979360 100644
--- a/htdocs/compta/deplacement/deplacement.class.php
+++ b/htdocs/compta/deplacement/deplacement.class.php
@@ -41,7 +41,7 @@ class Deplacement
*/
Function create($user)
{
- $sql = "INSERT INTO llx_deplacement (datec, fk_user_author) VALUES (now(), $user->id)";
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."deplacement (datec, fk_user_author) VALUES (now(), $user->id)";
$result = $this->db->query($sql);
if ($result)
@@ -61,7 +61,7 @@ class Deplacement
if (strlen($this->km)==0)
$this->km = 0;
- $sql = "UPDATE llx_deplacement ";
+ $sql = "UPDATE ".MAIN_DB_PREFIX."deplacement ";
$sql .= " SET km = $this->km";
$sql .= " , dated = '".$this->db->idate($this->date)."'";
$sql .= " , fk_user = $this->userid";
@@ -86,7 +86,7 @@ class Deplacement
Function fetch ($id)
{
$sql = "SELECT rowid, fk_user, km, fk_soc,".$this->db->pdate("dated")." as dated";
- $sql .= " FROM llx_deplacement WHERE rowid = $id";
+ $sql .= " FROM ".MAIN_DB_PREFIX."deplacement WHERE rowid = $id";
$result = $this->db->query($sql) ;
@@ -107,7 +107,7 @@ class Deplacement
*/
Function delete($id)
{
- $sql = "DELETE FROM llx_deplacement WHERE rowid = $id";
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."deplacement WHERE rowid = $id";
$result = $this->db->query($sql);
if ($result)
diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php
index 0ca4dec5dd6..17647c0d37c 100644
--- a/htdocs/compta/deplacement/index.php
+++ b/htdocs/compta/deplacement/index.php
@@ -54,7 +54,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
$sql = "SELECT s.nom,s.idp, d.km,".$db->pdate("d.dated")." as dd, u.name, u.firstname, d.rowid";
-$sql .= " FROM llx_societe as s, llx_deplacement as d, llx_user as u ";
+$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."deplacement as d, ".MAIN_DB_PREFIX."user as u ";
$sql .= " WHERE d.fk_soc = s.idp AND d.fk_user = u.rowid";
if ($user->societe_id > 0)
diff --git a/htdocs/compta/dons/edit.php b/htdocs/compta/dons/edit.php
index 110ff886d1d..52940abd5c9 100644
--- a/htdocs/compta/dons/edit.php
+++ b/htdocs/compta/dons/edit.php
@@ -73,7 +73,7 @@ if ($rowid)
$don->fetch($rowid);
$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/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php
index 72a0e056895..5740146a819 100644
--- a/htdocs/compta/dons/fiche.php
+++ b/htdocs/compta/dons/fiche.php
@@ -110,7 +110,7 @@ llxHeader();
if ($action == 'create') {
$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);
@@ -144,7 +144,7 @@ if ($action == 'create') {
print "