{if $categoryDetails.id}
{*	<div class="popupTitle">{$_LANG.reportsGeneration.reportsList.reportsTitle} - {$categoryDetails.name}</div> *}
{/if}

{showMessage}

{if $reportsList}

	<table class="list" style="margin:0px;display:block;">

		{******************************************************************************************}
		{********************************* TABLE HEADER *******************************************}
		{******************************************************************************************}

		<tr>
			<th width="1%">#</th>
			<th class="nowrap {if $orderBy=="name"}sel {if $orderDirection!="DESC"}asc{else}desc{/if}{/if}">
				<a href="#;"
					onclick="
						ajaxIframe(
							'reportsListDiv',
							'reportsList.php',
							'currentPage=0&orderBy=name&orderDirection={if $orderBy=="name"}{if $orderDirection=="ASC"}DESC{else}ASC{/if}{else}DESC{/if}',
							{ loadingMask:true }
						);
					"
				>{$_LANG.reportsGeneration.reportsList.th.reportDetails}</a>
			</th>
			<th class="{if $orderBy=="addTime"}sel {if $orderDirection!="DESC"}asc{else}desc{/if}{/if}">
				<a href="#;"
					onclick="
						ajaxIframe(
							'reportsListDiv',
							'reportsList.php',
							'currentPage=0&orderBy=addTime&orderDirection={if $orderBy=="addTime"}{if $orderDirection=="ASC"}DESC{else}ASC{/if}{else}DESC{/if}',
							{ loadingMask:true }
						);
					"
				>{$_LANG.reportsGeneration.reportsList.th.addTime}</a>
			</th>
			<th>{$_LANG.reportsGeneration.reportsList.th.status}</th>
			<th class="right" width="1%">{$_LANG.reportsGeneration.reportsList.th.options}</th>
		</tr>


		{******************************************************************************************}
		{*********************************** TABLE INFO *******************************************}
		{******************************************************************************************}

		{counter name=resultsCount start=$pages.currentPage*$pages.resultsPerPage print=false}

		{foreach from=$reportsList key=key item=report}
			<tr class="{cycle values="odd,even"}">

				<td>{counter name=resultsCount assign="currentResult" print=true}.</td>
				<td {if $orderBy=="name"}class="sel"{/if}>
					<div>
						<span class="reportsListDisplayName">{$report.name}</span>
						<span class="reportsListDisplaySource">({$_LANG.reports.source.name[$report.source]})</span>
					</div>
					<div class="reportsListDisplayDescription">{$report.description}</div>
				</td>
				<td {if $orderBy=="addTime"}class="sel"{/if}>{$report.addTime|dateTimeFormat}</td>
				<td style="width:360px;">
					{foreach from=$report.notViewedReports item=reportGenerating key=key}
						<div id="reportStatus_{$report.id}_{$reportGenerating.id}" style="margin-bottom:2px;"></div>
						<script language="javascript">
							refreshReportStatus('reportStatus_{$report.id}_{$reportGenerating.id}', '{$reportGenerating.id}', '');
						</script>
					{foreachelse}
						-
					{/foreach}
				</td>
				<td class="right nowrap">

					<table class="options">
						<tr>
							<td>
								<a href="#;" class="icon-reportView" tooltip="{$_LANG.reportsGeneration.reportsList.viewReportsTooltip}"
									onclick="
										overlib('{$_LANG.loading}', LEFT, BELOW, STICKY, WIDTH, 300, MOUSEOFF, 600);
										overlibAjax('viewReportsList.php?idReport={$report.id}', LEFT, BELOW, STICKY, WIDTH, 300, MOUSEOFF, 600);
									"
								></a>
							</td>
							<td>
								<a href="#;" class="icon-reportGenerate" tooltip="{$_LANG.reportsGeneration.reportsList.generateReportTooltip}"
									onclick="startReport('{$report.id}');"
								></a>
							</td>
						</tr>
					</table>

				</td>

			</tr>
		{/foreach}
	</table>

	{pageControls pagesData=$pages	method="get"}

{/if}
