From 7febb32dfdec2b94418c7f369cba0bbad45d3661 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 23 Nov 2005 15:45:40 +0000 Subject: [PATCH] Ajout des deux derniers commentaires --- htdocs/telephonie/client/fiche.php | 32 ++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/htdocs/telephonie/client/fiche.php b/htdocs/telephonie/client/fiche.php index 51295facafa..a94d29b20b0 100644 --- a/htdocs/telephonie/client/fiche.php +++ b/htdocs/telephonie/client/fiche.php @@ -130,10 +130,38 @@ if ($_GET["id"]) print '
'; - print ''; + /* Commentaires */ + $sql = "SELECT c.commentaire"; + $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_commentaire as c"; + $sql .= " WHERE c.fk_soc = ".$soc->id; + $sql .= " ORDER BY c.datec DESC LIMIT 2"; + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + if ($num > 0) + { + print '
'; + print ''; + while ($obj = $db->fetch_object($resql)) + { + $var=!$var; + print "\n"; + print "\n"; + } + print "
2 Derniers commentaires
"; + print stripslashes($obj->commentaire)."

"; + } + $db->free($resql); + } + else + { + print $db->error() . ' ' . $sql; + } + /* Contrats */ - + print ''; $sql = "SELECT count(l.rowid) as cc, c.rowid, c.ref, c.statut"; $sql .= ", ss.nom as agence, ss.code_client, ss.ville"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l";