aboutsummaryrefslogtreecommitdiff
path: root/include/home.php
diff options
context:
space:
mode:
authorCamil Staps2015-12-17 12:34:20 +0000
committerCamil Staps2015-12-17 12:34:20 +0000
commitb9ecd4fbcd1711b310731f3ee6033722495eabd9 (patch)
treed7302ad227a985cbe3fd6cbd1785e3c9ff9ee388 /include/home.php
parentFix deleting offers (diff)
Fixed a bug where some offers aren't shown in active offers if they have similar attributes
Diffstat (limited to 'include/home.php')
-rw-r--r--include/home.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/home.php b/include/home.php
index 9d99dac..644f2ae 100644
--- a/include/home.php
+++ b/include/home.php
@@ -155,7 +155,9 @@ require('header.php');
$percentage = ($total == 0) ? 100 : round($since / $total * 100);
// We want to sort on percentage (DESC) and secondly end date (ASC) so start date (DESC)
- $list[str_pad($percentage, 3, '0', STR_PAD_LEFT) . $offer->getStartDate()] = array(
+ $base = str_pad($percentage, 3, '0', STR_PAD_LEFT) . $offer->getStartDate();
+ for ($i = 0; isset($list["$base-$i"]); $i++);
+ $list["$base-$i"] = array(
'start' => $start,
'end' => $end,
'id' => $offer->getId(),