From 9aa77faa153071e227d10b301a3c2d11797d6963 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 29 Aug 2003 19:16:15 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20du=20libell=E9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/action/index.php | 115 ++++++++++------------------------- 1 file changed, 33 insertions(+), 82 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 410d32a7e7a..940960023ae 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -125,94 +125,44 @@ if ($sortfield == "") $sortfield="a.datea"; } +$sql = "SELECT s.nom as societe, s.idp as socidp,a.id,".$db->pdate("a.datea")." as da, a.datea, c.libelle, u.code, a.fk_contact "; +$sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_societe as s, llx_user as u"; +$sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.rowid AND a.percent = 100"; + +if ($type) +{ + $sql .= " AND c.id = $type"; +} if ($socid) { - $societe = new Societe($db); - $societe->fetch($socid); - - $sql = "SELECT a.id,".$db->pdate("a.datea")." as da, c.libelle, u.code, a.note, u.name, u.firstname, a.fk_contact "; - $sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_user as u"; - $sql .= " WHERE a.fk_soc = $socid AND c.id=a.fk_action AND a.fk_user_author = u.rowid AND a.percent = 100"; - - if ($type) - { - $sql .= " AND c.id = $type"; - } - - $sql .= " ORDER BY $sortfield $sortorder, rowid DESC "; - $sql .= $db->plimit($limit + 1,$offset); - - if ( $db->query($sql) ) - { - $num = $db->num_rows(); - print_barre_liste("Liste des actions commerciales effectuées sur " . $societe->nom,$page, $PHP_SELF,'',$sortfield,$sortorder,'',$num); - $i = 0; - print ''; - print ''; - print ''; - print ""; - print ''; - print "\n"; - $var=True; - - while ($i < min($num,$limit)) - { - $obj = $db->fetch_object( $i); - - $var=!$var; - - print ""; - print "\n"; - print ''; - print ''; - print "\n"; - - $i++; - } - print "
DateActionContact
" .strftime("%Y %b %d %H:%M",$obj->da)."'.$obj->libelle.''; - if ($obj->fk_contact) - { - $cont = new Contact($db); - $cont->fetch($obj->fk_contact); - print ''.$cont->fullname.''; - } - else - { - print " "; - } - print '
"; - $db->free(); - } else { - print $db->error() . '
' . $sql; - } - + $sql .= " AND s.idp = $socid"; } -else + +$sql .= " ORDER BY a.datea DESC"; +$sql .= $db->plimit( $limit + 1, $offset); + + +if ( $db->query($sql) ) { - $sql = "SELECT s.nom as societe, s.idp as socidp,a.id,".$db->pdate("a.datea")." as da, a.datea, c.libelle, u.code, a.fk_contact "; - $sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_societe as s, llx_user as u"; - $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.rowid AND a.percent = 100"; - - if ($type) + $num = $db->num_rows(); + if ($socid) { - $sql .= " AND c.id = $type"; + $societe = new Societe($db); + $societe->fetch($socid); + + print_barre_liste("Liste des actions commerciales effectuées sur " . $societe->nom, $page, $PHP_SELF,'',$sortfield,$sortorder,'',$num); } - - $sql .= " ORDER BY a.datea DESC"; - $sql .= $db->plimit( $limit + 1, $offset); - - - if ( $db->query($sql) ) - { - $num = $db->num_rows(); - print_barre_liste("Liste des actions commerciales effectuées sur " . $societe->nom,$page, $PHP_SELF,'',$sortfield,$sortorder,'',$num); - $i = 0; - print ""; - print ''; - print ''; - print ''; - print ''; + else + { + print_barre_liste("Liste des actions commerciales", $page, $PHP_SELF,'',$sortfield,$sortorder,'',$num); + } + $i = 0; + print "
DateSociétéAction
"; + print ''; + print ''; + print ''; + print ''; print ''; print ""; print "\n"; @@ -270,6 +220,7 @@ else /* * */ + print ''; print "\n"; print "\n"; @@ -282,7 +233,7 @@ else { print $db->error() . ' ' . $sql ; } -} + $db->close();
DateSociétéActionContactAuteur
'.$obj->libelle.'$obj->code