<div class="row-fluid">
	<div class="span1 hidden-phone"></div>
	<div class="span10">
		<ul id="msgops">
			<li id="addfilter">${h.link_to(_('Apply Filters'), url(controller='reports', action='index', anchor='form-area'))}</li>
			<li>${h.link_to(_('Download PDF'), url(controller='reports', action='display', reportid=c.reportid) + '.pdf')}</li>
			<li>${h.link_to(_('Download CSV'), url(controller='reports', action='display', reportid=c.reportid) + '.csv')}</li>
		</ul>
	</div>
	<div class="span1 hidden-phone"></div>
</div>
<div class="space-6"></div>
${forms.form()}
<div class="space-6"></div>
${forms.select_filter('reports')}\
<div class="space-6"></div>
<div class="row-fluid">
	<div class="span1 hidden-phone"></div>
	<div class="span10">
		<table class="table table-bordered table-condensed table-hover table-striped">
		<thead>
		<tr>
			<td colspan="7">
			<div id="chart">
				<noscript>
					% if c.top_items:
							<img src="${url(controller='reports', action='display', reportid=request.environ['pylons.routes_dict']['reportid'])}.png" alt="graph" />
					% endif
				</noscript>
			</div>
			</td>	
		</tr>
		<tr>
			<th>
				${_('Date')}
			</th>
			<th>
				${_('Mail')}
			</th>
			<th>
				${_('Virii')}
			</th>
			<th class="hidden-phone">
				${_('Virii %')}
			</th>
			<th>
				${_('Spam')}
			</th>
			<th class="hidden-phone">
				${_('Spam %')}
			</th>
			<th>
				${_('Volume')}
			</th>
		</tr>
		</thead>
		<tbody id="chartbody">
		% for i, row in enumerate(c.top_items):
		<tr>
			<td>
				${row.ldate}
			</td>
			<td>
				${row.mail_total}
			</td>
			<td>
				${row.virus_total}
			</td>
			<td class="hidden-phone">
				${"%.1f" % ((1.0 * row.virus_total / row.mail_total) * 100)}%
			</td>
			<td>
				${row.spam_total}
			</td>
			<td class="hidden-phone">
				${"%.1f" % ((1.0 * row.spam_total / row.mail_total) * 100)}%
			</td>
			<td>
				${h.format_byte_size(row.total_size)}
			</td>
		</tr>
		% endfor
		% if not c.top_items:
		<tr><td class="spanrow" colspan="7">${_('No records found')}</td></tr>
		% endif
		</tbody>
		</table>
	</div>
	<div class="span1 hidden-phone"></div>
</div>
<%def name="headers()">\
<script type="text/javascript">
var rdata = ${c.chart_data|n};
</script>
</%def>

<%def name="title()">${c.report_title}</%def>
<%def name="heading()">${c.report_title}</%def>
<%def name="submenu()"></%def>
<%def name="localscripts()">\
${h.stylesheet_link(h.media_url() + 'css/vendor/datepicker.css')}
${h.javascript_link(h.media_url() + 'js/vendor/jquery.clearform.min.js',
h.media_url() + 'js/vendor/jquery.maskedinput.min.js',
h.media_url() + 'js/vendor/bootstrap-datepicker.min.js',
h.media_url() + 'js/vendor/jquery.flot.min.js',
h.media_url() + 'js/vendor/jquery.flot.time.min.js',
h.media_url() + 'js/vendor/jquery.flot.orderBars.js',
h.media_url() + 'js/vendor/jquery.flot.resize.min.js',
h.media_url() + 'js/baruwa/reports.common.min.js',
h.media_url() + 'js/baruwa/reports.listings.min.js')}
</%def>
<%namespace name="forms" file="../reports/form.html"/>
<%inherit file="../base.html"/>
