diff options
-rw-r--r-- | include/home.php | 4 |
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(), |