<div id="selStats" class="clsStats">
	{if $myobj->getFormField('mode') == 'audio'}
	<h2 class="clsForumTitle">{$LANG.audio_statistics}</h2>
	{else}
	<h2 class="clsForumTitle">{$LANG.video_statistics}</h2>
	{/if}
{if $myobj->isShowPageBlock('form_search')}
	<div id="selShowSearchGroup">
		{if $myobj->getFormField('mode') == 'audio'}
		<form name="form_search" id="form_search" method="post" action="{$CFG.site.relative_url}manageStats.php?mode=audio" autocomplete="off">
		{else}
		<form name="form_search" id="form_search" method="post" action="{$CFG.site.relative_url}manageStats.php" autocomplete="off">
		{/if}
			<table border="0" cellspacing="0" summary="{$LANG.statssearch_tbl_summary}">
				<tr>
					<td class="{$myobj->getCSSFormLabelCellClass('srch_stats_cnt')}"><label for="srch_stats_cnt">{$LANG.stats_views}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('srch_stats_cnt')}">
						<select name="stats_condition" id="stats_condition" tabindex="{smartyTabIndex}" >
							{$myobj->generalPopulateArray($myobj->populateConditionOperators_arr, $myobj->getFormField('stats_condition'))}
						</select>
						<input type="text" class="clsTextBox clsMediumTextBox" name="srch_stats_cnt" id="srch_stats_cnt" value="{$myobj->getFormField('srch_stats_cnt')}" tabindex="{smartyTabIndex}"/>{$myobj->getFormFieldElementErrorTip('srch_stats_cnt')}
					</td>
				</tr>
				<tr class="clsStatsRow">
				  	<td class="{$myobj->getCSSFormLabelCellClass('srch_date_added_from')}">
						<label for="srch_date_added_from">{$LANG.stats_search_date_from}</label>{$myobj->ShowHelpTip('stats_search_date_from', 'srch_date_added_from')}
				 	</td>
				 	<td>
				 		<input type="text" class="clsTextBox" name="srch_date_added_from" id="srch_date_added_from" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('srch_date_added_from')}"  readonly />
						<button class="clsSubmitButton" type="reset" id="f_trigger_start_date">...</button>
						{$myobj->populateCalendar('srch_date_added_from', 'f_trigger_start_date', true)}{$myobj->getFormFieldElementErrorTip('srch_date_added_from')}
				 	</td>
				</tr>
				<tr class="clsStatsRow">
				  	<td class="{$myobj->getCSSFormLabelCellClass('srch_date_added_to')}">
						<label for="srch_date_added_to">{$LANG.stats_search_date_to}</label>{$myobj->ShowHelpTip('stats_search_date_to', 'srch_date_added_to')}
				  	</td>
				  	<td>
				 		<input type="text"  class="clsTextBox" name="srch_date_added_to" id="srch_date_added_to" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('srch_date_added_to')}" readonly />
                 		<button class="clsSubmitButton" type="reset" id="f_trigger_end_date">...</button>{$myobj->populateCalendar('srch_date_added_to', 'f_trigger_end_date', true)}{$myobj->getFormFieldElementErrorTip('srch_date_added_to')}
				 	</td>
			    </tr>
				<tr>
					<td></td>
					<td class="{$myobj->getCSSFormFieldCellClass('stats_search')}">
						<input type="submit" class="clsSubmitButton" value="{$LANG.search}" id="stats_search" name="stats_search" tabindex="{smartyTabIndex}"/>
						<input type="submit" class="clsSubmitButton" value="{$LANG.common_reset}" id="stats_reset" name="stats_reset" tabindex="{smartyTabIndex}"/>
					</td>
				</tr>
			</table>
			{$myobj->populateHiddenFormFields($myobj->form_search.hidden_arr)}
		</form>
	</div>
{/if}

{if $myobj->isShowPageBlock('form_default_stats')}
	{if $myobj->getFormField('mode') == 'audio'}
		<h2>{$LANG.overall_audio_stats}</h2>
	{else}
		<h2>{$LANG.overall_video_stats}</h2>
	{/if}
	<table border="1" cellspacing="0" summary="{$LANG.stats_tbl_summary}"  class="clsForumTbl clsStatTbl">
		<tr>
		   <td><h3>{if $myobj->getFormField('mode') == 'audio'}{$LANG.number_of_audios_in_last_seven_days}{else}{$LANG.number_of_videos_in_last_seven_days}{/if}</h3></td>
		   <td><span class="clsStatCount">{if $myobj->getFormField('mode') == 'audio'}{$audios_for_seven_days}{else}{$videos_for_seven_days}{/if}</span></td>
		</tr>
		<tr>
			<td><h3>{if $myobj->getFormField('mode') == 'audio'}{$LANG.number_of_times_audios_viewed_in_last_seven_days}{else}{$LANG.number_of_times_videos_viewed_in_last_seven_days}{/if} </h3></td>
			<td><span class="clsStatCount">{if $myobj->getFormField('mode') == 'audio'}{if $audio_views_for_seven_days == '' }0 {else}{$audio_views_for_seven_days}{/if}{else}{if $video_views_for_seven_days == ''}0{else} {$video_views_for_seven_days}{/if}{/if}</span></td>
		</tr>
		<tr>
			<td><h3>{if $myobj->getFormField('mode') == 'audio'}{$LANG.number_of_audios_added_from} {$since_date_audio|date_format}  {$LANG.to} {$date_audio_to|date_format}{else}{$LANG.number_of_videos_added_from} {$since_date_video|date_format} {$LANG.to} {$date_video_to|date_format}{/if}</h3></td>
			<td><span class="clsStatCount">{if $myobj->getFormField('mode') == 'audio'}{if $total_audios ==''} 0 {else}{$total_audios}{/if}{else}{if $total_videos == ''} 0 {else}{$total_videos}{/if}{/if}</span></td>
		</tr>
		<tr>
			<td><h3>{if $myobj->getFormField('mode') == 'audio'}{$LANG.number_of_times_audio_heard_from} {$since_date_audio|date_format} {$LANG.to} {$date_audio_to|date_format} {else}{$LANG.number_of_times_video_viewed_from}  {$since_date_video|date_format} {$LANG.to} {$date_video_to|date_format}{/if}</h3></td>
			<td><span class="clsStatCount">{if $myobj->getFormField('mode') == 'audio'}{if $total_audio_views == ''}0 {else}{$total_audio_views}{/if}{else}{if $total_video_views == ''}0 {else}{$total_video_views}{/if}{/if}</span></td>
		</tr>
	</table>
{/if}

{if $myobj->isShowPageBlock('form_show_stats')}
	<div id="selShowVideoStats">
		{if $myobj->getFormField('mode') == 'audio'}
			<h2>{$LANG.audio_content_stats}</h2>
		{else}
			<h2>{$LANG.video_content_stats}</h2>
		{/if}
	 	{if $myobj->isResultsFound()}
			{if $CFG.admin.navigation.top}
				{include file='pagination.tpl'}
			{/if}
	 		<form name="selStats" id="selStats">
				<table border="1" cellspacing="0" summary="{$LANG.stats_tbl_summary}"  class="clsForumTbl">
					<tr>
						<th>{$LANG.content_for}</th>
						<th>{$LANG.content}</th>
						<th>{$LANG.stats_views}</th>
						<th>{$LANG.preview}</th>
					</tr>
					{foreach key=fssKey item=fssValue from=$myobj->form_show_stats.video_stats}
					 	<tr>
							<td>{$fssValue.record.content_for}</td>
							<td>{if $fssValue.record.content_for == 'Question'}<a href="{$CFG.site.url}admin/{$CFG.admin.index.anova_module}/viewAnswers.php?qid={$fssValue.video_details.ques_id}">{$fssValue.video_details.question}</a>{else}<a href="{$CFG.site.url}admin/{$CFG.admin.index.anova_module}/viewAnswers.php?qid={$fssValue.video_details.ques_id}#{$fssValue.video_details.ans_id}">{$fssValue.video_details.answer}{/if}</a></td>
							<td>{$fssValue.record.total_views} </td>
							{if $myobj->getFormField('mode') == 'audio'}
								<td>{if $fssValue.record.content_for == 'Question'}<span><a id="{$fssValue.video_details.stats_video_id}" href="{$CFG.site.url}{$CFG.admin.index.anova_module}/ansViewAudio.php?pg=Question_{$fssValue.video_details.stats_video_id}" onClick="{$myobj->getBrowser($fssValue.video_details.stats_video_id)}"><img src="{$CFG.site.url}design/templates/{$CFG.html.template.default}/images/popular_audio.jpg" alt="{$LANG.click_here}" /></a></span>{else}<span><a id="{$fssValue.video_details.audio_id}" href="{$CFG.site.url}{$CFG.admin.index.anova_module}/ansViewAudio.php?pg=Answer_{$fssValue.video_details.stats_video_id}" onClick="{$myobj->getBrowser($fssValue.video_details.stats_video_id)}"><img src="{$CFG.site.url}design/templates/{$CFG.html.template.default}/images/popular_audio.jpg" alt="{$LANG.click_here}" /></a></span>{/if}</td>
							{else}
								<td>{if $fssValue.record.content_for == 'Question'}<span><a id="{$fssValue.video_details.stats_video_id}" href="{$CFG.site.url}{$CFG.admin.index.anova_module}/ansViewVideo.php?pg=Question_{$fssValue.video_details.stats_video_id}" onClick="{$myobj->getBrowser($fssValue.video_details.stats_video_id)}"><img src="{$fssValue.video_details.imgSrc}" alt="{$LANG.click_here}" /></a></span>{else}<span><a id="{$fssValue.video_details.video_id}" href="{$CFG.site.url}{$CFG.admin.index.anova_module}/ansViewVideo.php?pg=Answer_{$fssValue.video_details.video_id}" onClick="{$myobj->getBrowser($fssValue.video_details.video_id)}"><img src="{$fssValue.video_details.imgSrc}" alt="{$LANG.click_here}" /></a></span>{/if}</td>
							{/if}
					 	</tr>
					{/foreach}
				</table>
				{if $CFG.admin.navigation.bottom}
					{include file='pagination.tpl'}
				{/if}
			</form>
		{else}
			<div id="selMsgAlert">
				<p>{$LANG.common_no_records_found}</p>
			</div>
		{/if}
	</div>
{/if}