diff options
author | Camil Staps | 2016-07-27 21:29:57 +0200 |
---|---|---|
committer | Camil Staps | 2016-07-27 21:29:57 +0200 |
commit | 2acc7787e73c966c3fc1794d77dd758a3f56b566 (patch) | |
tree | 1def501ec9502dee79f0f54a470434a3b322f6a2 /nav.php | |
parent | Contact: use Model (diff) |
Offer: use Model
Diffstat (limited to 'nav.php')
-rw-r--r-- | nav.php | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -46,17 +46,17 @@ $offers = BusinessAdmin::getOffers($_pdo, array("`accepted`=1", "`start_date` <= CURDATE()", "`end_date` >= CURDATE()")); $list = array(); foreach ($offers as $offer) { - $start = BusinessAdmin::formatDate($offer->getStartDate(), false); - $end = BusinessAdmin::formatDate($offer->getEndDate(), false); - $since = mktime(0,0,0,date("n"),date("j"),date("Y")) - $offer->getStartDate(); - $total = $offer->getEndDate() - $offer->getStartDate(); + $start = BusinessAdmin::formatDate($offer->start_date, false); + $end = BusinessAdmin::formatDate($offer->end_date, false); + $since = mktime(0,0,0,date("n"),date("j"),date("Y")) - $offer->start_date; + $total = $offer->end_date - $offer->start_date; $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( + $list[str_pad($percentage, 3, '0', STR_PAD_LEFT) . $offer->start_date] = array( 'start' => $start, 'end' => $end, - 'id' => $offer->getId(), + 'id' => $offer->id, 'contactClientName' => $offer->getContact()->getClient()->name, 'percentage' => $percentage, 'price' => Constants::invoice_valuta . $offer->calculate(offer::SUBTOTAL) |