Correction nom de table societe -> llx_societe

This commit is contained in:
Rodolphe Quiedeville 2003-06-19 12:15:40 +00:00
parent 759982f862
commit e2edb56ff0
5 changed files with 66 additions and 54 deletions

View File

@ -25,7 +25,7 @@ require("./propal.class.php3");
$db = new Db(); $db = new Db();
$sql = "SELECT s.nom, s.idp, s.prefix_comm FROM societe as s WHERE s.idp = $socidp;"; $sql = "SELECT s.nom, s.idp, s.prefix_comm FROM llx_societe as s WHERE s.idp = $socidp;";
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)

View File

@ -1,8 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -18,6 +15,9 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id$
* $Source$
*
*/ */
require("./pre.inc.php3"); require("./pre.inc.php3");
@ -30,20 +30,22 @@ if ($sortfield == "") {
$sortfield="idp"; $sortfield="idp";
} }
$yn["t"] = "oui"; $yn["t"] = "oui";
$yn["f"] = "non"; $yn["f"] = "non";
$ynn["1"] = "oui"; $ynn["1"] = "oui";
$ynn["0"] = "non"; $ynn["0"] = "non";
if ($action == 'add') { if ($action == 'add')
{
$sql = "INSERT INTO llx_bookmark (fk_soc, dateb, author) VALUES ($socidp, now(),'". $GLOBALS["REMOTE_USER"]."');"; $sql = "INSERT INTO llx_bookmark (fk_soc, dateb, author) VALUES ($socidp, now(),'". $GLOBALS["REMOTE_USER"]."');";
if (! $db->query($sql) ) { if (! $db->query($sql) )
{
print $db->error(); print $db->error();
} }
} }
if ($action == 'delete') {
if ($action == 'delete')
{
$sql = "DELETE FROM llx_bookmark WHERE rowid=$bid AND author = '". $GLOBALS["REMOTE_USER"]."'"; $sql = "DELETE FROM llx_bookmark WHERE rowid=$bid AND author = '". $GLOBALS["REMOTE_USER"]."'";
$result = $db->query($sql); $result = $db->query($sql);
} }
@ -58,19 +60,23 @@ $pagenext = $page + 1;
print '<div class="titre">Bookmark</div>'; print '<div class="titre">Bookmark</div>';
$sql = "SELECT s.idp, s.nom, ".$db->pdate("b.dateb")." as dateb, st.libelle as stcomm, b.rowid as bid, b.author"; $sql = "SELECT s.idp, s.nom, ".$db->pdate("b.dateb")." as dateb, st.libelle as stcomm, b.rowid as bid, b.author";
$sql .= " FROM societe as s, c_stcomm as st, llx_bookmark as b"; $sql .= " FROM llx_societe as s, c_stcomm as st, llx_bookmark as b";
$sql .= " WHERE b.fk_soc = s.idp AND s.fk_stcomm = st.id AND s.datea is not null"; $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); $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset);
if ( $db->query($sql) ) { if ( $db->query($sql) )
{
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $i = 0;
if ($sortorder == "DESC") { if ($sortorder == "DESC")
{
$sortorder="ASC"; $sortorder="ASC";
} else { }
else
{
$sortorder="DESC"; $sortorder="DESC";
} }
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
@ -86,15 +92,19 @@ if ( $db->query($sql) ) {
print "<TD>&nbsp;</TD>"; print "<TD>&nbsp;</TD>";
print "</TR>\n"; print "</TR>\n";
$var=True; $var=True;
while ($i < $num) { while ($i < $num)
{
$obj = $db->fetch_object( $i); $obj = $db->fetch_object( $i);
$var=!$var; $var=!$var;
$bc1="bgcolor=\"#90c090\""; $bc1="bgcolor=\"#90c090\"";
$bc2="bgcolor=\"#b0e0b0\""; $bc2="bgcolor=\"#b0e0b0\"";
if (!$var) { if (!$var)
{
$bc=$bc1; $bc=$bc1;
} else { }
else
{
$bc=$bc2; $bc=$bc2;
} }
print "<TR $bc>"; print "<TR $bc>";
@ -111,7 +121,9 @@ if ( $db->query($sql) ) {
} }
print "</TABLE>"; print "</TABLE>";
$db->free(); $db->free();
} else { }
else
{
print $db->error(); print $db->error();
} }

View File

@ -1,8 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -18,6 +15,9 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id$
* $Source$
*
*/ */
require("./pre.inc.php3"); require("./pre.inc.php3");
@ -68,7 +68,7 @@ if ($action == 'add') {
} elseif ($action == 'create') { } elseif ($action == 'create') {
$sql = "SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.tva, p.total, p.ref, ".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst"; $sql = "SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.tva, p.total, p.ref, ".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst";
$sql .= " FROM societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id"; $sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
$sql .= " AND p.rowid = $propalid"; $sql .= " AND p.rowid = $propalid";
@ -161,7 +161,7 @@ if ($action == 'add') {
print "</tr>\n"; print "</tr>\n";
$sql = "SELECT s.nom, s.idp, f.facnumber, f.amount,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid "; $sql = "SELECT s.nom, s.idp, f.facnumber, f.amount,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp ORDER BY f.datec DESC "; $sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp ORDER BY f.datec DESC ";
if ( $db->query($sql) ) { if ( $db->query($sql) ) {
$num = $db->num_rows(); $num = $db->num_rows();
@ -214,7 +214,7 @@ if ($action == 'add') {
if ($facid) { if ($facid) {
$sql = "SELECT s.nom,s.idp, f.amount, f.facnumber, f.rowid"; $sql = "SELECT s.nom,s.idp, f.amount, f.facnumber, f.rowid";
$sql .= " FROM societe as s, llx_facture as f WHERE f.fk_soc = s.idp"; $sql .= " FROM llx_societe as s, llx_facture as f WHERE f.fk_soc = s.idp";
$sql .= " AND f.rowid = $facid"; $sql .= " AND f.rowid = $facid";
$result = $db->query($sql); $result = $db->query($sql);

View File

@ -73,7 +73,7 @@ if ($action == 'create')
{ {
$sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber"; $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 llx_societe as s, llx_facture as f WHERE f.fk_soc = s.idp";
$sql .= " AND f.rowid = $facid"; $sql .= " AND f.rowid = $facid";
$result = $db->query($sql); $result = $db->query($sql);

View File

@ -1,8 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -18,6 +15,9 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id$
* $Source$
*
*/ */
require("./pre.inc.php3"); require("./pre.inc.php3");
@ -75,7 +75,7 @@ print "</div>";
$sql = "SELECT s.idp, s.nom, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email, p.phone "; $sql = "SELECT s.idp, s.nom, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email, p.phone ";
$sql .= "FROM societe as s, socpeople as p, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.idp = p.fk_soc"; $sql .= "FROM llx_societe as s, socpeople as p, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.idp = p.fk_soc";
if (strlen($stcomm)) { if (strlen($stcomm)) {
$sql .= " AND s.fk_stcomm=$stcomm"; $sql .= " AND s.fk_stcomm=$stcomm";