private function calcTotalPrice() { $data =& $this->terms; $transportation = Agenda::getTransports(); foreach ($this->transportTerms as $term) { if (empty($data[$term])) { continue; } $transport = json_decode($data[$term]); $data[$term] = []; $price = 0; foreach ($transport as $mean) { if (isset($transportation[$mean])) { $data[$term][$mean] = $transportation[$mean]; $price += $transportation[$mean]['price']; } } $this->totalPrice += $price; } }
<?php require 'Global.lib.php'; require 'api/class.agenda.php'; $month = !empty($_GET['month']) ? $_GET['month'] : null; $year = !empty($_GET['year']) ? $_GET['year'] : null; $agenda = new Agenda($month, $year); $days = $agenda->getDays(); $transports = $agenda->getTransports(); $prevMonth = $agenda->month - 1; $nextMonth = $agenda->month + 1; $prevYear = $nextYear = $agenda->year; if ($prevMonth <= 0) { $prevMonth = 12; $prevYear--; } if ($agenda->month + 1 > 12) { $nextMonth = 1; $nextYear++; } $title = sprintf('יומן עבודה - %s %d', DTime::$hebMonths[$agenda->month - 1], $agenda->year); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title><?php echo $title; ?> </title>