N'affiche pas les infos de propale sur le module n'est pas actif.

This commit is contained in:
Laurent Destailleur 2004-01-24 20:51:31 +00:00
parent 7525d5847e
commit fdbe141f93

View File

@ -75,24 +75,25 @@ print '<table border="0" width="100%" cellspacing="0" cellpadding="4">';
print '<tr><td valign="top" width="30%">';
print '<form method="post" action="propal.php">';
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print '<tr class="liste_titre"><td colspan="2">Rechercher une proposition</td></tr>';
print "<tr $bc[1]><td>";
print 'Num. : <input type="text" name="sf_ref"><input type="submit" value="Rechercher" class="flat"></td></tr>';
print "</table></form>\n";
if ($conf->propal->enabled) {
print '<form method="post" action="propal.php">';
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print '<tr class="liste_titre"><td colspan="2">Rechercher une proposition</td></tr>';
print "<tr $bc[1]><td>";
print 'Num. : <input type="text" name="sf_ref"><input type="submit" value="Rechercher" class="flat"></td></tr>';
print "</table></form><br>\n";
$sql = "SELECT p.rowid, p.ref";
$sql .= " FROM llx_propal as p";
$sql .= " WHERE p.fk_statut = 0";
$sql = "SELECT p.rowid, p.ref";
$sql .= " FROM llx_propal as p";
$sql .= " WHERE p.fk_statut = 0";
if ( $db->query($sql) )
{
if ( $db->query($sql) )
{
$num = $db->num_rows();
$i = 0;
if ($num > 0 )
{
print '<br><table border="0" cellspacing="0" cellpadding="3" width="100%">';
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print "<TR class=\"liste_titre\">";
print "<td colspan=\"2\">Propositions commerciales brouillons</td></tr>";
@ -105,6 +106,7 @@ if ( $db->query($sql) )
}
print "</table><br>";
}
}
}
/*
@ -248,23 +250,24 @@ if ( $db->query($sql) )
}
}
/*
* 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 > 1";
if ($socidp)
{
if ($conf->propal->enabled) {
$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 > 1";
if ($socidp)
{
$sql .= " AND s.idp = $socidp";
}
}
$sql .= " ORDER BY p.rowid DESC";
$sql .= $db->plimit(5, 0);
$sql .= " ORDER BY p.rowid DESC";
$sql .= $db->plimit(5, 0);
if ( $db->query($sql) )
if ( $db->query($sql) )
{
$num = $db->num_rows();
@ -305,7 +308,7 @@ if ( $db->query($sql) )
print "</table>";
$db->free();
}
}
print '</td></tr>';
@ -314,6 +317,5 @@ print '</table>';
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>