From ae7517fe44068fc3a83049d9f3e79dc6be0f3187 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 21 Jun 2003 12:58:04 +0000 Subject: [PATCH] Nouvelle mise en forme du tableau pour gagner de la place Ajout de filtre dans le mode liste --- htdocs/comm/propal.php3 | 188 +++++++++++++++++++++------------------- 1 file changed, 98 insertions(+), 90 deletions(-) diff --git a/htdocs/comm/propal.php3 b/htdocs/comm/propal.php3 index 7be363d7ceb..d445bbbd10c 100644 --- a/htdocs/comm/propal.php3 +++ b/htdocs/comm/propal.php3 @@ -73,9 +73,7 @@ if ($action == 'add') $id = $propal->create(); /* - * * Generation - * */ if ($id) { @@ -215,10 +213,19 @@ if ($propalid) { print ""; print ''; - print ""; - - print ''; + print ''; + print ''; + + print ''; + + print ""; + + print '"; + if ($obj->fk_projet) { $projet = new Project($db); @@ -227,7 +234,7 @@ if ($propalid) { print ''; print $projet->title.''; } - print ""; + /* * */ @@ -249,18 +256,11 @@ if ($propalid) { /* * */ - print ''; + /* * */ - print ""; - - print ''; - print "
Société'.$obj->nom.'Note :
". nl2br($obj->note)."
Date'.strftime("%A %d %B %Y",$obj->dp).'
Statut :'.$obj->lst.'
Date'.strftime("%A %d %B %Y",$obj->dp).'Auteur'; + $author = new User($db, $obj->fk_user_author); + $author->fetch(''); + print $author->fullname.'
Destinataire$obj->firstname $obj->name <$obj->email>Note :
'. nl2br($obj->note)."
Destinataire$obj->firstname $obj->name <$obj->email>
Auteur'; - $author = new User($db, $obj->fk_user_author); - $author->fetch(''); - print $author->fullname.'
Statut :$obj->lst
"; @@ -639,93 +639,101 @@ if ($propalid) { $offset = $limit * $page ; $pageprev = $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 .= " 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) { - $sql .= " AND s.idp = $socidp"; - } - - if ($viewstatut <> '') { - $sql .= " AND c.id = $viewstatut"; - } - - if ($month > 0) { - $sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'"; - } - if ($year > 0) { - $sql .= " AND date_format(p.datep, '%Y') = $year"; - } + if ($socidp) + { + $sql .= " AND s.idp = $socidp"; + } + + if ($viewstatut <> '') + { + $sql .= " AND c.id = $viewstatut"; + } + + if ($month > 0) + { + $sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'"; + } + if ($year > 0) + { + $sql .= " AND date_format(p.datep, '%Y') = $year"; + } $sql .= " ORDER BY $sortfield $sortorder"; + $sql .= $db->plimit( $limit ,$offset); - if ( $db->query($sql) ) { - $num = $db->num_rows(); - $i = 0; - print ""; + if ( $db->query($sql) ) + { + $num = $db->num_rows(); + $i = 0; + print "
"; - print ''; - print "'; - print "\n"; - $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 ''; + print "\n"; + $var=True; - print "\n"; - - print "\n"; - print "\n"; - print "\n"; - - $total = $total + $objp->price; - $subtotal = $subtotal + $objp->price; - - $i++; + 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"; + + $total = $total + $objp->price; + $subtotal = $subtotal + $objp->price; + + $i++; + } + + + print "
"; - print_liste_field_titre ("Réf",$PHP_SELF,"p.ref"); - print ""; - print_liste_field_titre ("Société",$PHP_SELF,"s.nom"); - print ''; - print_liste_field_titre ("Date",$PHP_SELF,"p.datep"); - print ''; - print_liste_field_titre ("Prix",$PHP_SELF,"p.price"); - print "Statut statutid\">"; - print '
propalid\">$objp->refidp\">$objp->nom > 15 jours 
"; + print_liste_field_titre ("Réf",$PHP_SELF,"p.ref"); + print ""; + print_liste_field_titre ("Société",$PHP_SELF,"s.nom"); + print ''; + print_liste_field_titre ("Date",$PHP_SELF,"p.datep"); + print ''; + print_liste_field_titre ("Prix",$PHP_SELF,"p.price"); + print ""; + print_liste_field_titre ("Statut",$PHP_SELF,"p.fk_statut"); + print "
"; - $y = strftime("%Y",$objp->dp); - $m = strftime("%m",$objp->dp); - - print strftime("%d",$objp->dp)."\n"; - print " "; - print strftime("%B",$objp->dp)."\n"; - print " "; - print strftime("%Y",$objp->dp)."".price($objp->price)."$objp->statut
propalid\">$objp->refidp\">$objp->nom > 15 jours "; + $y = strftime("%Y",$objp->dp); + $m = strftime("%m",$objp->dp); + + print strftime("%d",$objp->dp)."\n"; + print " "; + print strftime("%B",$objp->dp)."\n"; + print " "; + print strftime("%Y",$objp->dp)."".price($objp->price)."$objp->statut
"; + $db->free(); } - - - print ""; - $db->free(); - } else { print $db->error();