From f4141facb00bf17ef1c14644cbce04c6be8dc454 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 14 Oct 2003 09:40:54 +0000 Subject: [PATCH] Ajout liste des dernieres propales --- htdocs/comm/index.php | 58 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 2c8716873d3..d9fd2154bed 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -199,6 +199,64 @@ else print $db->error(); } +/* + * Dernières propales + * + */ + +$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid"; +$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 AND p.fk_statut > 0"; + +if ($socidp) +{ + $sql .= " AND s.idp = $socidp"; +} + +$sql .= " ORDER BY p.rowid DESC"; +$sql .= $db->plimit(5, 0); + +if ( $db->query($sql) ) + { + $num = $db->num_rows(); + + $i = 0; + print ''; + print ''; + $var=True; + + while ($i < $num) + { + $objp = $db->fetch_object( $i); + + $var=!$var; + print ""; + print "\n"; + print "\n"; + + $now = time(); + $lim = 3600 * 24 * 15 ; + + if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) + { + print ""; + } + else + { + print ""; + } + + print "\n"; + print "\n"; + print "\n"; + print "\n"; + $i++; + } + + print "
Dernières propositions commerciales
propalid\">$objp->refidp\">$objp->nom > 15 jours "; + print strftime("%d %B %Y",$objp->dp)."".price($objp->price)."$objp->statut
"; + $db->free(); + } + print '';