From d64e8457f61058e9b758aa59a11505f5baa38f4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 May 2005 15:12:15 +0000 Subject: [PATCH] =?UTF-8?q?Look:=20Modifications=20esth=E9tiques=20mineure?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/index.php | 128 ++++++++++++++++++++++-------------------- 1 file changed, 66 insertions(+), 62 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index bb9c7d9c5cf..68f8cb44c53 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -115,38 +115,42 @@ if ($conf->contrat->enabled) { /* * Liste des propal brouillons */ -if ($conf->propal->enabled && $user->rights->propale->lire) { - $sql = "SELECT p.rowid, p.ref, p.price, s.nom"; - $sql .= " FROM ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."societe as s"; - $sql .= " WHERE p.fk_statut = 0 and p.fk_soc = s.idp"; - - if ( $db->query($sql) ) - { - $total = 0; - $num = $db->num_rows(); - $i = 0; - $var=true; - if ($num > 0 ) - { - print ''; - print ""; - print ""; - - while ($i < $num) - { - $obj = $db->fetch_object(); - $var=!$var; - print '"; - $i++; - $total += $obj->price; - } - if ($total>0) { - $var=!$var; - print '"; - } - print "
".$langs->trans("ProposalsDraft")."
'."rowid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref."".$obj->nom."".price($obj->price)."
".$langs->trans("Total")."".price($total)."

"; - } - } +if ($conf->propal->enabled && $user->rights->propale->lire) +{ + $sql = "SELECT p.rowid, p.ref, p.price, s.nom"; + $sql .= " FROM ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."societe as s"; + $sql .= " WHERE p.fk_statut = 0 and p.fk_soc = s.idp"; + + $resql=$db->query($sql); + if ($resql) + { + $var=true; + + $total = 0; + $num = $db->num_rows($resql); + $i = 0; + if ($num > 0) + { + print ''; + print ""; + print ""; + + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $var=!$var; + print '"; + $i++; + $total += $obj->price; + } + if ($total>0) { + $var=!$var; + print '"; + } + print "
".$langs->trans("ProposalsDraft")."
'."rowid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref."".$obj->nom."".price($obj->price)."
'.$langs->trans("Total")."".price($total)."

"; + } + $db->free($resql); + } } /* @@ -393,48 +397,48 @@ if ($conf->contrat->enabled && 0) // \todo A REFAIRE DEPUIS NOUVEAU CONTRAT * Dernières propales ouvertes * */ -if ($conf->propal->enabled && $user->rights->propale->lire) { - +if ($conf->propal->enabled && $user->rights->propale->lire) +{ $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 ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut = 1"; - if ($socidp) $sql .= " AND s.idp = $socidp"; + if ($socidp) $sql .= " AND s.idp = $socidp"; $sql .= " ORDER BY p.rowid DESC"; $result=$db->query($sql); if ($result) { - $total = 0; - $num = $db->num_rows($result); - $i = 0; - if ($num > 0) - { - print ''; - print ''; - $var=false; - while ($i < $num) - { - $obj = $db->fetch_object($result); - print ""; - print "\n"; - print "\n"; - print "\n"; - $var=!$var; - $i++; - $total += $obj->price; - } - if ($total>0) { - print ""; - } - print "
'.$langs->trans("ProposalsOpened").'
propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref."idp\">".img_object($langs->trans("ShowCompany"),"company")." ".$obj->nom.""; - print strftime("%d %b %Y",$obj->dp)."".price($obj->price)."
".$langs->trans("Total")."".price($total)."

"; - } + $total = 0; + $num = $db->num_rows($result); + $i = 0; + if ($num > 0) + { + $var=true; + + print ''; + print ''; + while ($i < $num) + { + $obj = $db->fetch_object($result); + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + $i++; + $total += $obj->price; + } + if ($total>0) { + print '"; + } + print "
'.$langs->trans("ProposalsOpened").'
propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref."idp\">".img_object($langs->trans("ShowCompany"),"company")." ".$obj->nom.""; + print dolibarr_print_date($obj->dp)."".price($obj->price)."
'.$langs->trans("Total")."".price($total)."

"; + } } - else + else { dolibarr_print_error($db); } - } /*