<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="rep" section="in-commerce:reports" pagination="1" title_preset="report_results"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%">
<tbody>
	<tr>
  	<td>
			<script type="text/javascript">
				function edit()
				{
					// do nothing
				}

				a_toolbar = new ToolBar();
				a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Back" escape="1"/>', function() {
//							window.location = '<inp2:m_t t="../../plugins/reports/admin_templates/reports" "pass"="m,rep" "rep_event="OnNew"/>'
							window.location = '<inp2:m_Link template="in-commerce/reports/reports" pass="m,rep" rep_event="OnNew" no_amp="1" />';
							return true;
						}
				 ) );

				 a_toolbar.AddButton( new ToolBarSeparator('sep1') );

				 a_toolbar.AddButton( new ToolBarButton('print', '<inp2:m_phrase label="la_ToolTip_Print" escape="1"/>', function() {
				 			window.print();
						}
				 ) );

				 a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
								show_viewmenu(a_toolbar,'view');
							}
					) );

				 a_toolbar.AddButton( new ToolBarButton('export', '<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>', function() {
								submit_event('rep','OnExportReport');
							}
					) );

				<inp2:m_if check="rep.metric_ReportTypeEquals" value="2">
					// By Users report have no chart
				<inp2:m_else/>
					// Only PHP5 have chart
					<inp2:m_if check="rep_IsPHPxOrGreater" version="5">
						// Chart window open button
						 a_toolbar.AddButton( new ToolBarButton('in-commerce:view_chart', '<inp2:m_phrase label="la_ToolTip_View_Chart" escape="1"/>', function() {
								openSelector('rep', '<inp2:m_Link template="in-commerce/reports/chart" pass="all" js_escape="1"/>');
							}
							) );
					</inp2:m_if>

				</inp2:m_if>

				a_toolbar.Render();
			</script>
		</td>

	  	<inp2:m_RenderElement name="search_main_toolbar" prefix="rep" grid="Default"/>
	</tr>
</tbody>
</table>

<inp2:m_RenderElement name="grid" PrefixSpecial="rep" IdField="CategoryId" grid="Default" totals_render_as="grid_total_row"/>
<script type="text/javascript">
	Grids['rep'].SetDependantToolbarButtons( new Array() );
</script>

<inp2:m_include t="incs/footer"/>