aboutsummaryrefslogtreecommitdiff
path: root/nav.php
diff options
context:
space:
mode:
authorCamil Staps2016-07-27 21:29:57 +0200
committerCamil Staps2016-07-27 21:29:57 +0200
commit2acc7787e73c966c3fc1794d77dd758a3f56b566 (patch)
tree1def501ec9502dee79f0f54a470434a3b322f6a2 /nav.php
parentContact: use Model (diff)
Offer: use Model
Diffstat (limited to 'nav.php')
-rw-r--r--nav.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/nav.php b/nav.php
index 29fd1b2..027b4b1 100644
--- a/nav.php
+++ b/nav.php
@@ -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)