Modif affichage des curseurs de page
This commit is contained in:
parent
9268151af3
commit
9c7405eef5
@ -837,8 +837,6 @@ else
|
||||
$sortfield="f.datef";
|
||||
}
|
||||
|
||||
print_barre_liste("Factures",$page,$PHP_SELF,"&socidp=$socidp",$sortfield,$sortorder);
|
||||
|
||||
$sql = "SELECT s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid";
|
||||
$sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp";
|
||||
|
||||
@ -857,48 +855,50 @@ else
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $db->plimit( $limit ,$offset);
|
||||
$sql .= $db->plimit($limit + 1,$offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
|
||||
$i = 0;
|
||||
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print '<TR class="liste_titre">';
|
||||
print '<TD>Numéro</TD>';
|
||||
print '<td>';
|
||||
print_liste_field_titre("Société",$PHP_SELF,"s.nom","","&socidp=$socidp");
|
||||
print '</td><TD align="right">';
|
||||
print_liste_field_titre("Date",$PHP_SELF,"f.datef","","&socidp=$socidp");
|
||||
print '</td><TD align="right">Montant</TD>';
|
||||
print '<td> </td>';
|
||||
print "</TR>\n";
|
||||
|
||||
if ($num > 0) {
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
|
||||
print "<TR $bc[$var]>";
|
||||
print "<td><a href=\"facture.php3?facid=$objp->facid\">";
|
||||
if ($objp->paye)
|
||||
{
|
||||
print $objp->facnumber;
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<b>'.$objp->facnumber.'</b>';
|
||||
}
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
print_barre_liste("Factures",$page,$PHP_SELF,"&socidp=$socidp",$sortfield,$sortorder,'',$num);
|
||||
|
||||
$i = 0;
|
||||
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print '<TR class="liste_titre">';
|
||||
print '<TD>Numéro</TD>';
|
||||
print '<td>';
|
||||
print_liste_field_titre("Société",$PHP_SELF,"s.nom","","&socidp=$socidp");
|
||||
print '</td><TD align="right">';
|
||||
print_liste_field_titre("Date",$PHP_SELF,"f.datef","","&socidp=$socidp");
|
||||
print '</td><TD align="right">Montant</TD>';
|
||||
print '<td> </td>';
|
||||
print "</TR>\n";
|
||||
|
||||
if ($num > 0) {
|
||||
$var=True;
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
|
||||
print "<TR $bc[$var]>";
|
||||
print "<td><a href=\"facture.php3?facid=$objp->facid\">";
|
||||
if ($objp->paye)
|
||||
{
|
||||
print $objp->facnumber;
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<b>'.$objp->facnumber.'</b>';
|
||||
}
|
||||
print "</a></TD>\n";
|
||||
print "<TD><a href=\"fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
||||
|
||||
|
||||
if ($objp->df > 0 ) {
|
||||
print "<TD align=\"right\">";
|
||||
$y = strftime("%Y",$objp->df);
|
||||
$m = strftime("%m",$objp->df);
|
||||
|
||||
|
||||
print strftime("%d",$objp->df)."\n";
|
||||
print " <a href=\"facture.php3?year=$y&month=$m\">";
|
||||
print strftime("%B",$objp->df)."</a>\n";
|
||||
|
||||
@ -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 "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print '<TR class="liste_titre">';
|
||||
@ -396,7 +397,7 @@ if ($propalid)
|
||||
print_liste_field_titre_new ("Statut",$PHP_SELF,"p.fk_statut","","",'align="center"',$sortfield);
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < $num)
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
|
||||
|
||||
@ -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 '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print "<TR class=\"liste_titre\">";
|
||||
|
||||
@ -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 '<table width="100%" border="0" cellpadding="3" cellspacing="0">';
|
||||
|
||||
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 '<a href="'.$file.'?page='.($page-1).$options.'"><img alt="Page précédente" src="/theme/'.$conf->theme.'/img/1leftarrow.png" border="0"></a>';
|
||||
}
|
||||
print '<a href="'.$file.'?page='.($page+1).$options.'"><img alt="Page suivante" src="/theme/'.$conf->theme.'/img/1rightarrow.png" border="0"></a>';
|
||||
*/
|
||||
|
||||
print_fleche_navigation($page,$file,$options, $nextpage);
|
||||
|
||||
print '</td></tr></table><p>';
|
||||
}
|
||||
|
||||
@ -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 '<a href="'.$file.'?page='.($page-1).$options.'"><img alt="Page précédente" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1leftarrow.png" border="0"></a>';
|
||||
}
|
||||
print '<a href="'.$file.'?page='.($page+1).$options.'"><img alt="Page suivante" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1rightarrow.png" border="0"></a>';
|
||||
|
||||
if ($nextpage > 0)
|
||||
{
|
||||
print '<a href="'.$file.'?page='.($page+1).$options.'"><img alt="Page suivante" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1rightarrow.png" border="0"></a>';
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user