Nouvelle mise en forme du tableau pour gagner de la place

Ajout de filtre dans le mode liste
This commit is contained in:
Rodolphe Quiedeville 2003-06-21 12:58:04 +00:00
parent 2a3a5d0ecc
commit ae7517fe44

View File

@ -73,9 +73,7 @@ if ($action == 'add')
$id = $propal->create(); $id = $propal->create();
/* /*
*
* Generation * Generation
*
*/ */
if ($id) if ($id)
{ {
@ -215,9 +213,18 @@ if ($propalid) {
print "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\">"; print "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\">";
print '<tr><td>Société</td><td colspan="2"><a href="fiche.php3?socid='.$obj->idp.'">'.$obj->nom.'</a></td>'; print '<tr><td>Société</td><td colspan="2"><a href="fiche.php3?socid='.$obj->idp.'">'.$obj->nom.'</a></td>';
print "<td valign=\"top\" width=\"50%\" rowspan=\"9\">Note :<br>". nl2br($obj->note)."</td></tr>"; print '<td>Statut :</td><td colspan=2 align=center><b>'.$obj->lst.'</b></td></tr>';
print '<tr><td>Date</td><td colspan="2">'.strftime("%A %d %B %Y",$obj->dp).'</td></tr>'; print '<tr><td>Date</td><td colspan="2">'.strftime("%A %d %B %Y",$obj->dp).'</td>';
print '<td>Auteur</td><td colspan="2">';
$author = new User($db, $obj->fk_user_author);
$author->fetch('');
print $author->fullname.'</td></tr>';
print "<tr><td>Destinataire</td><td colspan=\"2\">$obj->firstname $obj->name &lt;$obj->email&gt;</td>";
print '<td valign="top" colspan="2" width="50%" rowspan="7">Note :<br>'. nl2br($obj->note)."</td></tr>";
if ($obj->fk_projet) if ($obj->fk_projet)
{ {
@ -227,7 +234,7 @@ if ($propalid) {
print '<a href="projet/fiche.php3?id='.$projet->id.'">'; print '<a href="projet/fiche.php3?id='.$projet->id.'">';
print $projet->title.'</a></td></tr>'; print $projet->title.'</a></td></tr>';
} }
print "<tr><td>Destinataire</td><td colspan=\"2\">$obj->firstname $obj->name &lt;$obj->email&gt;</td></tr>";
/* /*
* *
*/ */
@ -249,18 +256,11 @@ if ($propalid) {
/* /*
* *
*/ */
print '<tr><td>Auteur</td><td colspan="2">';
$author = new User($db, $obj->fk_user_author);
$author->fetch('');
print $author->fullname.'</td></tr>';
/* /*
* *
*/ */
print "<tr bgcolor=\"#f0f0f0\"><td>Statut :</td><td colspan=2 align=center><b>$obj->lst</b></td>";
print '</tr>';
print "</table>"; print "</table>";
@ -639,30 +639,38 @@ if ($propalid) {
$offset = $limit * $page ; $offset = $limit * $page ;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$limit = $conf->liste_limit;
$offset = $limit * $page ;
print_titre("Propositions commerciales"); print_barre_liste("Propositions commerciales", $page, $PHP_SELF,"&socidp=$socidp",$sortfield,$sortorder);
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price - p.remise as price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid"; $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price - p.remise as 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"; $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";
if ($socidp) { if ($socidp)
{
$sql .= " AND s.idp = $socidp"; $sql .= " AND s.idp = $socidp";
} }
if ($viewstatut <> '') { if ($viewstatut <> '')
{
$sql .= " AND c.id = $viewstatut"; $sql .= " AND c.id = $viewstatut";
} }
if ($month > 0) { if ($month > 0)
{
$sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'"; $sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'";
} }
if ($year > 0) { if ($year > 0)
{
$sql .= " AND date_format(p.datep, '%Y') = $year"; $sql .= " AND date_format(p.datep, '%Y') = $year";
} }
$sql .= " ORDER BY $sortfield $sortorder"; $sql .= " ORDER BY $sortfield $sortorder";
$sql .= $db->plimit( $limit ,$offset);
if ( $db->query($sql) ) { if ( $db->query($sql) )
{
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $i = 0;
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
@ -676,9 +684,9 @@ if ($propalid) {
print_liste_field_titre ("Date",$PHP_SELF,"p.datep"); print_liste_field_titre ("Date",$PHP_SELF,"p.datep");
print '</td><TD align="right">'; print '</td><TD align="right">';
print_liste_field_titre ("Prix",$PHP_SELF,"p.price"); print_liste_field_titre ("Prix",$PHP_SELF,"p.price");
print "</td><TD align=\"center\">Statut <a href=\"$PHP_SELF?viewstatut=$objp->statutid\">"; print "</td><TD align=\"center\">";
print '<img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a></td>'; print_liste_field_titre ("Statut",$PHP_SELF,"p.fk_statut");
print "</TR>\n"; print "</td></tr>\n";
$var=True; $var=True;
while ($i < $num) while ($i < $num)