/** * Copyright: dtbaker 2012 * Licence: Please check CodeCanyon.net for licence details. * More licence clarification available here: http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca * Package Date: 2015-11-25 02:55:20 * IP Address: 67.79.165.254 */ header('Content-type: text/calendar; charset=utf-8'); header('Content-Disposition: inline; filename="cal.ics"'); $show_previous_weeks = module_config::c('dashboard_income_previous_weeks', 7); $date_start = date('Y-m-d', mktime(1, 0, 0, date('m'), date('d') - date('w') - ($show_previous_weeks + 2) * 7 + 1, date('Y'))); $date_end = date('Y-m-d', strtotime('-1 day', mktime(1, 0, 0, date('m'), date('d') + (6 - date('w')) - 2 * 7 + 2, date('Y')))); $result = module_finance::get_finance_summary($date_start, $date_end, 7, $show_previous_weeks); /* print_r($result); echo 'BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Ultimate Client Manager/Calendar Plugin v1.0//EN CALSCALE:GREGORIAN X-WR-CALNAME:'._l('Dashboard Summary').' X-WR-TIMEZONE:UTC '; //$local_timezone_string = date('e'); //$local_timezone = new DateTimeZone($local_timezone_string); //$local_time = new DateTime("now", $local_timezone); $timezone_hours = module_config::c('timezone_hours',0); $time = strtotime($timezone_hours.' hours',strtotime($alert['date'])); echo 'BEGIN:VEVENT