Limit number of lines in statistics table
This commit is contained in:
parent
64ac113761
commit
2eed48e091
@ -227,10 +227,8 @@ $sql = "SELECT c.subscription, c.dateadh as dateh";
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
||||||
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
|
$sql.= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||||
$sql.= " AND d.rowid = c.fk_adherent";
|
$sql.= " AND d.rowid = c.fk_adherent";
|
||||||
if(isset($date_select) && $date_select != '')
|
|
||||||
{
|
|
||||||
$sql .= " AND c.dateadh LIKE '".$date_select."%'";
|
|
||||||
}
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@ -251,21 +249,33 @@ if ($result)
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th>'.$langs->trans("Subscriptions").'</th>';
|
print '<th>'.$langs->trans("Year").'</th>';
|
||||||
print '<th class="right">'.$langs->trans("Number").'</th>';
|
print '<th class="right">'.$langs->trans("Subscriptions").'</th>';
|
||||||
print '<th class="right">'.$langs->trans("AmountTotal").'</th>';
|
print '<th class="right">'.$langs->trans("AmountTotal").'</th>';
|
||||||
print '<th class="right">'.$langs->trans("AmountAverage").'</th>';
|
print '<th class="right">'.$langs->trans("AmountAverage").'</th>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
krsort($Total);
|
krsort($Total);
|
||||||
|
$i = 0;
|
||||||
foreach ($Total as $key=>$value)
|
foreach ($Total as $key=>$value)
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
if ($i >= 8)
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print "<td>...</td>";
|
||||||
|
print "<td class=\"right\"></td>";
|
||||||
|
print "<td class=\"right\"></td>";
|
||||||
|
print "<td class=\"right\"></td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
print '<tr class="oddeven">';
|
||||||
print "<td><a href=\"./subscription/list.php?date_select=$key\">$key</a></td>";
|
print "<td><a href=\"./subscription/list.php?date_select=$key\">$key</a></td>";
|
||||||
print "<td class=\"right\">".$Number[$key]."</td>";
|
print "<td class=\"right\">".$Number[$key]."</td>";
|
||||||
print "<td class=\"right\">".price($value)."</td>";
|
print "<td class=\"right\">".price($value)."</td>";
|
||||||
print "<td class=\"right\">".price(price2num($value/$Number[$key], 'MT'))."</td>";
|
print "<td class=\"right\">".price(price2num($value/$Number[$key], 'MT'))."</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Total
|
// Total
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user