diff options
Diffstat (limited to 'nav.php')
-rw-r--r-- | nav.php | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -46,7 +46,7 @@ <ul class="dropdown-menu dropdown-tasks"> <?php $offers = Offer::search($_pdo, ["`accepted`=1", "`start_date` <= CURDATE()", "`end_date` >= CURDATE()"]); - $list = array(); + $list = []; foreach ($offers as $offer) { $start = BusinessAdmin::formatDate($offer->start_date, false); $end = BusinessAdmin::formatDate($offer->end_date, false); @@ -55,14 +55,14 @@ $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->start_date] = array( + $list[str_pad($percentage, 3, '0', STR_PAD_LEFT) . $offer->start_date] = [ 'start' => $start, 'end' => $end, 'id' => $offer->id, 'contactClientName' => $offer->getContact()->getClient()->name, 'percentage' => $percentage, 'price' => Constants::invoice_valuta . $offer->calculate(Calculatable::SUBTOTAL) - ); + ]; } krsort($list, SORT_STRING); foreach ($list as $item) { |