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