{* HEADER *}
{* BODY *}
[`Marketing costs`]
{$_groupby = waRequest::request("groupby", "days")}
{$_timeframe = waRequest::get("timeframe", "30")}
{$_from = waRequest::request("from", null)}
{$_to = waRequest::request("to", null)}
{$_time_filters = [
"30" => [
"id" => "30",
"name" => _w('Last %d day', 'Last %d days', 30),
"uri" => "`$marketing_url`costs/?timeframe=30&groupby=days"
],
"90" => [
"id" => "90",
"name" => _w('Last %d day', 'Last %d days', 90),
"uri" => "`$marketing_url`costs/?timeframe=90&groupby=days"
],
"365" => [
"id" => "365",
"name" => _w('Last %d day', 'Last %d days', 365),
"uri" => "`$marketing_url`costs/?timeframe=365&groupby=months"
],
"all" => [
"id" => "all",
"name" => _w("All time"),
"uri" => "`$marketing_url`costs/?timeframe=all&groupby=months"
],
"custom" => [
"id" => "custom",
"name" => _w("Select dates..."),
"uri" => "javascript:void(0);"
]
]}
{$_active_time_filter = $_time_filters["90"]}
{if !empty($_timeframe) && !empty($_time_filters[$_timeframe])}
{$_active_time_filter = $_time_filters[$_timeframe]}
{/if}
[`Add your marketing expenses to automate ROI (Return On Investment) calculation by traffic source and campaign.`]
{* CHART *}
{* EDITOR *}
{* ADD *}
{* BOTTOM TABLE *}
{if count($expenses)}
{include file="./MarketingCostRows.html" inline}
{else}
{/if}