public function __construct($timetable, $params) { parent::__construct($params); if (isset($params['url'])) { $this->url = $params['url']; } else { $this->url = $_SERVER['PHP_SELF']; } $this->url .= sprintf('?f=Daily&y=%d&m=%d&d=%d', $timetable->year, $timetable->month, $timetable->day); if (isset($params['uri'])) { $this->url .= '&' . $params['uri']; } }
public function __construct($timetable, $params) { parent::__construct($params); if (isset($params['url'])) { $this->url = $params['url']; } else { $this->url = $_SERVER['PHP_SELF']; } if ($timetable->format == 'Monthly') { $day = $timetable->toArray($timetable->nextMonth('timestamp')); } elseif ($timetable->format == 'Weekly') { $day = $timetable->toArray($timetable->nextWeek('timestamp')); } else { $day = $timetable->toArray($timetable->nextDay('timestamp')); } $this->url .= sprintf('?f=%s&y=%d&m=%d&d=%d', $timetable->format, $day['year'], $day['month'], $day['day']); if (isset($params['uri'])) { $this->url .= '&' . $params['uri']; } }
public function __construct($timetable, $params) { parent::__construct($params); $this->url = 'javascript:window.print();'; }