Mise jour des noms de tables

This commit is contained in:
Rodolphe Quiedeville 2003-05-25 16:15:51 +00:00
parent 62b6801bea
commit 87f0958e60
4 changed files with 18 additions and 19 deletions

View File

@ -55,7 +55,7 @@ class ActionComm
*/
Function add($author)
{
$sql = "INSERT INTO actioncomm (datea, fk_action, fk_soc, fk_user_author, fk_user_action, fk_contact, percent, note,priority) ";
$sql = "INSERT INTO llx_actioncomm (datea, fk_action, fk_soc, fk_user_author, fk_user_action, fk_contact, percent, note,priority) ";
$sql .= " VALUES ('$this->date',$this->type,$this->societe, $author->id,";
$sql .= $this->user->id . ", $this->contact, $this->percent, '$this->note', $this->priority);";
@ -77,7 +77,7 @@ class ActionComm
{
$sql = "SELECT ".$this->db->pdate("a.datea")." as da, a.note,c.libelle, fk_soc, fk_user_author, fk_contact ";
$sql .= "FROM actioncomm as a, c_actioncomm as c WHERE a.id=$id AND a.fk_action=c.id;";
$sql .= "FROM llx_actioncomm as a, c_actioncomm as c WHERE a.id=$id AND a.fk_action=c.id;";
if ($this->db->query($sql) )
{
@ -112,7 +112,7 @@ class ActionComm
Function delete($id)
{
$sql = "DELETE FROM actioncomm WHERE id=$id;";
$sql = "DELETE FROM llx_actioncomm WHERE id=$id;";
if ($this->db->query($sql) ) {

View File

@ -98,7 +98,7 @@ if ($action == 'recontact')
if ($action == 'note')
{
$sql = "UPDATE societe SET note='$note' WHERE idp=$socid";
$sql = "UPDATE llx_societe SET note='$note' WHERE idp=$socid";
$result = $db->query($sql);
}
@ -112,7 +112,7 @@ if ($action == 'stcomm')
if ($result)
{
$sql = "UPDATE societe SET fk_stcomm=$stcommid WHERE idp=$socid";
$sql = "UPDATE llx_societe SET fk_stcomm=$stcommid WHERE idp=$socid";
$result = $db->query($sql);
}
else
@ -123,7 +123,7 @@ if ($action == 'stcomm')
if ($actioncommid)
{
$sql = "INSERT INTO actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')";
$sql = "INSERT INTO llx_actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')";
$result = @$db->query($sql);
if (!$result)
@ -140,7 +140,7 @@ if ($action == 'stcomm')
*/
if ($mode == 'search') {
if ($mode-search == 'soc') {
$sql = "SELECT s.idp FROM societe as s ";
$sql = "SELECT s.idp FROM llx_societe as s ";
$sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'";
}
@ -169,7 +169,7 @@ $pagenext = $page + 1;
*/
print_barre_liste("Liste des clients", $page, $PHP_SELF,"",$sortfield,$sortorder);
$sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm FROM societe as s, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.client=1";
$sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm FROM llx_societe as s, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.client=1";
if (strlen($stcomm))
{

View File

@ -55,7 +55,7 @@ class Societe {
print $this->url;
$sql = "INSERT INTO societe (nom, datec, datea, client) ";
$sql = "INSERT INTO llx_societe (nom, datec, datea, client) ";
$sql .= " VALUES ('".trim($this->nom)."', now(), now(), $this->client);";
if ($this->db->query($sql) ) {
@ -74,7 +74,7 @@ class Societe {
Function update($id)
{
$sql = "UPDATE societe ";
$sql = "UPDATE llx_societe ";
$sql .= " SET nom = '" . trim($this->nom) ."'";
$sql .= ",address = '" . trim($this->adresse) ."'";
$sql .= ",cp = '" . trim($this->cp) ."'";
@ -132,12 +132,11 @@ class Societe {
Function fetch($socid) {
$this->id = $socid;
$sql = "SELECT s.idp, s.nom, s.address,".$this->db->pdate("s.datec")." as dc,";
$sql .= " s.tel, s.fax, s.url,s.cp,s.ville, s.note, s.siren, client, fournisseur";
$sql .= " FROM societe as s";
$sql .= " FROM llx_societe as s";
$sql .= " WHERE s.idp = ".$this->id;
$result = $this->db->query($sql);
@ -176,7 +175,7 @@ class Societe {
Function attribute_prefix()
{
$sql = "SELECT nom FROM societe WHERE idp = $this->id";
$sql = "SELECT nom FROM llx_societe WHERE idp = $this->id";
if ( $this->db->query( $sql) )
{
if ( $this->db->num_rows() )
@ -186,7 +185,7 @@ class Societe {
$prefix = strtoupper(substr($nom, 0, 2));
$sql = "SELECT count(*) FROM societe WHERE prefix_comm = '$prefix'";
$sql = "SELECT count(*) FROM llx_societe WHERE prefix_comm = '$prefix'";
if ( $this->db->query( $sql) )
{
if ( $this->db->result(0, 0) )
@ -197,7 +196,7 @@ class Societe {
{
$this->db->free();
$sql = "UPDATE societe set prefix_comm='$prefix' WHERE idp=$this->id";
$sql = "UPDATE llx_societe set prefix_comm='$prefix' WHERE idp=$this->id";
if ( $this->db->query( $sql) )
{
@ -230,7 +229,7 @@ class Societe {
Function get_nom($id)
{
$sql = "SELECT nom FROM societe WHERE idp=$id;";
$sql = "SELECT nom FROM llx_societe WHERE idp=$id;";
$result = $this->db->query($sql);

View File

@ -1,5 +1,5 @@
<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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
@ -49,7 +49,7 @@ $pagenext = $page + 1;
*/
if ($mode == 'search') {
if ($mode-search == 'soc') {
$sql = "SELECT s.idp FROM societe as s ";
$sql = "SELECT s.idp FROM llx_societe as s ";
$sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'";
}
@ -72,7 +72,7 @@ if ($mode == 'search') {
print_barre_liste("Liste des societes", $page, $PHP_SELF);
$sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur";
$sql .= " FROM societe as s, c_stcomm as st WHERE s.fk_stcomm = st.id";
$sql .= " FROM llx_societe as s, c_stcomm as st WHERE s.fk_stcomm = st.id";
if ($user->societe_id > 0) {
$sql .= " AND s.idp = " . $user->societe_id;