";
- print "facid\">";
- if ($objp->paye)
- {
- print $objp->facnumber;
- }
- else
- {
- print ''.$objp->facnumber.'';
- }
+ if ($result)
+ {
+ $num = $db->num_rows();
+ print_barre_liste("Factures",$page,$PHP_SELF,"&socidp=$socidp",$sortfield,$sortorder,'',$num);
+
+ $i = 0;
+ print "";
+ print '';
+ print '| Numéro | ';
+ print '';
+ print_liste_field_titre("Société",$PHP_SELF,"s.nom","","&socidp=$socidp");
+ print ' | ';
+ print_liste_field_titre("Date",$PHP_SELF,"f.datef","","&socidp=$socidp");
+ print ' | Montant | ';
+ print ' | ';
+ print " \n";
+
+ if ($num > 0) {
+ $var=True;
+ while ($i < $num) {
+ $objp = $db->fetch_object( $i);
+ $var=!$var;
+
+ print "";
+ print "| facid\">";
+ if ($objp->paye)
+ {
+ print $objp->facnumber;
+ }
+ else
+ {
+ print ''.$objp->facnumber.'';
+ }
print " | \n";
print "idp\">$objp->nom | \n";
-
+
if ($objp->df > 0 ) {
print "";
$y = strftime("%Y",$objp->df);
$m = strftime("%m",$objp->df);
-
+
print strftime("%d",$objp->df)."\n";
print " ";
print strftime("%B",$objp->df)."\n";
diff --git a/htdocs/compta/propal.php3 b/htdocs/compta/propal.php3
index 705fe433cbc..24d5d70b96b 100644
--- a/htdocs/compta/propal.php3
+++ b/htdocs/compta/propal.php3
@@ -354,8 +354,6 @@ if ($propalid)
$limit = $conf->liste_limit;
$offset = $limit * $page ;
- 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 ";
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut in(2,4)";
@@ -381,11 +379,14 @@ if ($propalid)
}
$sql .= " ORDER BY $sortfield $sortorder ";
- $sql .= $db->plimit($limit ,$offset);
+ $sql .= $db->plimit($limit + 1,$offset);
if ( $db->query($sql) )
{
$num = $db->num_rows();
+
+ print_barre_liste("Propositions commerciales", $page, $PHP_SELF,"&socidp=$socidp",$sortfield,$sortorder,'',$num);
+
$i = 0;
print "";
print '';
@@ -396,7 +397,7 @@ if ($propalid)
print_liste_field_titre_new ("Statut",$PHP_SELF,"p.fk_statut","","",'align="center"',$sortfield);
print " \n";
- while ($i < $num)
+ while ($i < min($num, $limit))
{
$objp = $db->fetch_object( $i);
diff --git a/htdocs/fichinter/index.php3 b/htdocs/fichinter/index.php3
index 35c6479f725..99689dabaab 100644
--- a/htdocs/fichinter/index.php3
+++ b/htdocs/fichinter/index.php3
@@ -47,9 +47,6 @@ $offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
-
-print_barre_liste("Liste des fiches d'intervention", $page, $PHP_SELF,"&socidp=$socidp",$sortfield,$sortorder);
-
$sql = "SELECT s.nom,s.idp, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.duree";
$sql .= " FROM llx_societe as s, llx_fichinter as f ";
$sql .= " WHERE f.fk_soc = s.idp ";
@@ -59,11 +56,13 @@ if ($user->societe_id > 0)
$sql .= " AND s.idp = " . $user->societe_id;
}
-$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit ,$offset);
+$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit + 1 ,$offset);
if ( $db->query($sql) )
{
$num = $db->num_rows();
+ print_barre_liste("Liste des fiches d'intervention", $page, $PHP_SELF,"&socidp=$socidp",$sortfield,$sortorder,'',$num);
+
$i = 0;
print '';
print "";
diff --git a/htdocs/lib/functions.inc.php3 b/htdocs/lib/functions.inc.php3
index 889da91e238..dbf605f09c2 100644
--- a/htdocs/lib/functions.inc.php3
+++ b/htdocs/lib/functions.inc.php3
@@ -311,9 +311,19 @@ function block_access()
*
*/
-function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $form='')
+function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $form='', $num=-1)
{
global $conf;
+
+ if ($num > $conf->liste_limit or $num == -1)
+ {
+ $nextpage = 1;
+ }
+ else
+ {
+ $nextpage = 0;
+ }
+
print '';
if ($page > 0)
@@ -343,14 +353,9 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
}
// affichage des fleches de navigation
- print_fleche_navigation($page,$file,$options);
- /*
- if ($page > 0)
- {
- print ' ';
- }
- print ' ';
- */
+
+ print_fleche_navigation($page,$file,$options, $nextpage);
+
print ' ';
}
@@ -358,14 +363,18 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
* fonction servant a afficher les fleches de navigation dans les
* pages de liste
*/
-function print_fleche_navigation($page,$file,$options='')
+function print_fleche_navigation($page,$file,$options='', $nextpage)
{
global $conf;
if ($page > 0)
{
print ' ';
}
- print ' ';
+
+ if ($nextpage > 0)
+ {
+ print ' ';
+ }
}
/*
*
| |