<?php 
/** 
 * @package JREALTIMEANALYTICS::SERVERSTATS::administrator::components::com_jrealtimeanalytics
 * @subpackage views
 * @subpackage serverstats
 * @subpackage tmpl
 * @author Joomla! Extensions Store
 * @copyright (C) 2013 - Joomla! Extensions Store
 * @license GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html 
 */
defined ( '_JEXEC' ) or die ( 'Restricted access' );
use Joomla\CMS\Language\Text;
?>
<form action="index.php" method="post" id="adminForm" name="adminForm">
	<table class="headerlist">
		<tr>
			<td class="left">
				<div class="input-group input-group-date active">
					<span class="input-group-text" aria-label="<?php echo Text::_('COM_JREALTIME_FILTER_BY_DATE_FROM');?>"><span class="icon-calendar" aria-hidden="true"></span> <?php echo Text::_('COM_JREALTIME_FILTER_BY_DATE_FROM' ); ?>:</span>
					<input type="text" name="fromperiod" id="fromPeriod" data-role="calendar" autocomplete="off" value="<?php echo $this->dates['start'];?>" class="text_area"/>
				</div>
				
				<div class="input-group input-group-date active">
					<span class="input-group-text" aria-label="<?php echo Text::_('COM_JREALTIME_FILTER_BY_DATE_TO');?>"><span class="icon-calendar" aria-hidden="true"></span> <?php echo Text::_('COM_JREALTIME_FILTER_BY_DATE_TO' ); ?>:</span>
					<input type="text" name="toperiod" id="toPeriod" data-role="calendar" autocomplete="off" value="<?php echo $this->dates['to'];?>" class="text_area"/>
				</div>
				<button class="btn btn-primary btn-sm" onclick="this.form.submit();"><?php echo Text::_('COM_JREALTIME_GO' ); ?></button>
			</td>
			<td class="right d-flex justify-content-end">
				<div class="input-group d-none d-md-flex flex-end">
					<span class="input-group-text" aria-label="<?php echo Text::_('COM_JREALTIME_GRAPH_THEME');?>"><span class="icon-filter" aria-hidden="true"></span> <?php echo Text::_('COM_JREALTIME_GRAPH_THEME' ); ?>:</span>
					<?php echo $this->lists['graphTheme'];?> 
				</div>
			</td>
		</tr>
	</table>
	 
	<div class="row tablestats no-margin">
		<?php if($this->cparams->get('details_stats', true)): ?>
			<div class="col-md-6 ps-0 mb-2 span6">
				<div class="card card-default accordion-group responsivestats">
					<div class="card-header p-0 accordion-heading opened">
						<div class="accordion-toggle accordion_lightblue noaccordion">
							<h3 class="card-title m-3 accordion-title"><span class="icon-chart" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_SERVERSTATS_DETAILS' ); ?></h3>
						</div>
					</div>
					<div class="card-body card-block ps-3 accordion-body accordion-inner"><?php echo $this->loadTemplate('details');?></div>
				</div>
			</div>
		<?php endif;?>
	
		<?php if($this->cparams->get('geolocation_stats', true)): ?>
			<div class="col-md-6 ps-0 span6">
				<div class="card card-default accordion-group responsivestats">
					<div class="card-header p-0 accordion-heading opened">
						<div class="accordion-toggle accordion_lightblue noaccordion">
							<h3 class="card-title m-3 accordion-title">
								<span class="icon-picture" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_SERVERSTATS_GEOLOCATION' ); ?>
								<button id="open_visualmap" class="btn btn-primary btn-sm pull-right" href="#fancybox_visualmap">
									<span class="icon-chart" aria-hidden="true"></span>
									<?php echo Text::_('COM_JREALTIME_VISUALMAP_OPEN' ); ?>
								</button>
							</h3>
						</div>
					</div>
					<div class="card-body card-block ps-3 accordion-body accordion-inner"><?php echo $this->loadTemplate('geolocation');?></div>
				</div>
			</div>
		<?php endif;?>
	</div>
	
	<div class="row tablestats no-margin">
		<?php if($this->cparams->get('os_stats', true)): ?>
			<div class="col-md-4 ps-0 mb-2 span4">
				<div class="card card-default accordion-group responsivestats">
					<div class="card-header p-0 accordion-heading opened">
						<div class="accordion-toggle accordion_lightblue noaccordion">
							<h3 class="card-title m-3 accordion-title"><span class="icon-cog" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_SERVERSTATS_OS' ); ?></h3>
						</div>
					</div>
					<div class="card-body card-block ps-3 accordion-body accordion-inner"><?php echo $this->loadTemplate('os');?></div>
				</div>
			</div>
		<?php endif;?>
	
		<?php if($this->cparams->get('browser_stats', true)): ?>
			<div class="col-md-4 ps-0 mb-2 span4">
				<div class="card card-default accordion-group responsivestats">
					<div class="card-header p-0 accordion-heading opened">
						<div class="accordion-toggle accordion_lightblue noaccordion">
							<h3 class="card-title m-3 accordion-title"><span class="icon-compass" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_SERVERSTATS_BROWSER' ); ?></h3>
						</div>
					</div>
					<div class="card-body card-block ps-3 accordion-body accordion-inner"><?php echo $this->loadTemplate('browser');?></div>
				</div>
			</div>
		<?php endif;?>
		
		<?php if($this->cparams->get('device_stats', true)): ?>
			<div class="col-md-4 ps-0 span4">
				<div class="card card-default accordion-group responsivestats">
					<div class="card-header p-0 accordion-heading opened">
						<div class="accordion-toggle accordion_lightblue noaccordion">
							<h3 class="card-title m-3 accordion-title"><span class="icon-screen" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_SERVERSTATS_DEVICE' ); ?></h3>
						</div>
					</div>
					<div class="card-body card-block ps-3 accordion-body accordion-inner"><?php echo $this->loadTemplate('device');?></div>
				</div>
			</div>
		<?php endif;?>
	</div>
	
	<div class="row tablestats no-margin">
		<?php if($this->cparams->get('landing_stats', true)): ?>
			<div class="col-md-6 ps-0 mb-2 span6">
				<div class="card card-default accordion-group responsivestats">
					<div class="card-header accordion-heading accordion_lightblue opened">
						<div class="accordion-toggle accordion_lightblue noaccordion accordion_filtered">
							<h3 class="card-title accordion-title"><span class="icon-copy" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_LANDING_PAGES' ); ?></h3>
						</div>
						<input type="text" data-role="filter" data-field="1" placeholder="<?php echo Text::_('COM_JREALTIME_FILTER_BY_PAGE' );?>"/>
						<button data-role="reset-filter" class="btn btn-secondary btn-sm"><?php echo Text::_('COM_JREALTIME_RESET' ); ?></button>
					</div>
					<div class="card-body card-block accordion-body noaccordion accordion-inner"><?php echo $this->loadTemplate('landing');?></div>
				</div>
			</div>
		<?php endif; ?>
	
		<?php if($this->cparams->get('leaveoff_stats', true)): ?>
			<div class="col-md-6 ps-0 span6">
				<div class="card card-default accordion-group responsivestats">
					<div class="card-header accordion-heading accordion_lightblue opened">
						<div class="accordion-toggle accordion_lightblue noaccordion accordion_filtered">
							<h3 class="card-title accordion-title"><span class="icon-copy" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_LEAVEOFF_PAGES' ); ?></h3>
						</div>
						<input type="text" data-role="filter" data-field="1" placeholder="<?php echo Text::_('COM_JREALTIME_FILTER_BY_PAGE' );?>"/>
						<button data-role="reset-filter" class="btn btn-secondary btn-sm"><?php echo Text::_('COM_JREALTIME_RESET' ); ?></button>
					</div>
					<div class="card-body card-block accordion-body noaccordion accordion-inner"><?php echo $this->loadTemplate('leaved');?></div>
				</div>
			</div>
		<?php endif; ?>
	</div>
	
	
	
	<div class="accordion" id="jrealtime_serverstats_accordion">
		<?php if($this->cparams->get('visitsbypage_stats', true)): ?>
		<div class="row tablestats no-margin">
			<div class="col-md-12 ps-0 span12">
				<div class="card card-default accordion-group">
					<div class="card-header accordion-heading accordion_lightblue">
						<div class="accordion-toggle accordion_lightblue accordion_filtered" data-bs-toggle="collapse" data-bs-target="#jrealtime_serverstats_pages">
							<h3 class="card-title accordion-title"><span class="icon-copy" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_SERVERSTATS_PAGES' ); ?></h3>
						</div>
						<input type="text" data-role="filter" data-field="1" placeholder="<?php echo Text::_('COM_JREALTIME_FILTER_BY_PAGE' );?>"/>
						<button data-role="reset-filter" class="btn btn-secondary btn-sm"><?php echo Text::_('COM_JREALTIME_RESET' ); ?></button>
					</div>
					<div id="jrealtime_serverstats_pages" class="card-body card-block accordion-body accordion-inner collapse" data-height="350">
						<?php echo $this->loadTemplate('pages');?>
					</div>
				</div>
			</div>
		</div>
		<?php endif; ?>
		
		<?php if($this->cparams->get('visitsbyuser_stats', true)): ?>
		<div class="row tablestats no-margin">
			<div class="col-md-12 ps-0 span12">
				<div class="card card-default accordion-group">
					<div class="card-header accordion-heading accordion_lightblue">
						<div class="accordion-toggle accordion_lightblue accordion_filtered" data-bs-toggle="collapse" data-bs-target="#jrealtime_serverstats_visitors">
							<h3 class="card-title accordion-title"><span class="icon-users" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_SERVERSTATS_USERS' ); ?></h3>
						</div>
						<input type="text" data-role="filter" data-field="1" placeholder="<?php echo Text::_('COM_JREALTIME_FILTER_BY_NAME' );?>"/>
						<?php if($this->cparams->get('show_usergroup', 0)):?>
							<input type="text" data-role="filter" data-field="2" placeholder="<?php echo Text::_('COM_JREALTIME_FILTER_BY_GROUP' );?>"/>
						<?php endif;?>
						<button data-role="reset-filter" class="btn btn-secondary btn-sm"><?php echo Text::_('COM_JREALTIME_RESET' ); ?></button>
					</div>
					<div id="jrealtime_serverstats_visitors" class="card-body card-block accordion-body accordion-inner collapse" data-height="350">
						<?php echo $this->loadTemplate('visitors');?>
					</div>
				</div>
			</div>
		</div>
		<?php endif; ?>
		
		<?php if($this->cparams->get('visitsbyip_stats', true)): ?>
		<div class="row tablestats no-margin">
			<div class="col-md-12 ps-0 span12">
				<div class="card card-default accordion-group">
					<div class="card-header accordion-heading accordion_lightblue">
						<div class="accordion-toggle accordion_lightblue accordion_filtered" data-bs-toggle="collapse" data-bs-target="#jrealtime_serverstats_ipaddress">
							<h3 class="card-title accordion-title"><span class="icon-location" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_SERVERSTATS_VISITSBY_IPADDRESS' ); ?></h3>
						</div>
						<input type="text" data-role="filter" data-field="1" placeholder="<?php echo Text::_('COM_JREALTIME_FILTER_BY_IPADDRESS' );?>"/>
						<button data-role="reset-filter" class="btn btn-secondary btn-sm"><?php echo Text::_('COM_JREALTIME_RESET' ); ?></button>
					</div>
					<div id="jrealtime_serverstats_ipaddress" class="card-body card-block accordion-body accordion-inner collapse" data-height="350">
						<?php echo $this->loadTemplate('ipaddress');?>
					</div>
				</div>
			</div>
		</div>
		<?php endif; ?>
		
		<?php if($this->cparams->get('referral_stats', true)): ?>
		<div class="row tablestats no-margin">
			<div class="col-md-12 ps-0 span12">
				<div class="card card-default accordion-group">
					<div class="card-header accordion-heading accordion_lightblue">
						<div class="accordion-toggle accordion_lightblue accordion_filtered" data-bs-toggle="collapse" data-bs-target="#jrealtime_serverstats_referral">
							<h3 class="card-title accordion-title"><span class="icon-contract" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_SERVERSTATS_REFERRAL' ); ?></h3>
						</div>
						<input type="text" data-role="filter" data-field="1" placeholder="<?php echo Text::_('COM_JREALTIME_FILTER_BY_SOURCE' );?>"/>
						<input type="text" data-role="filter" data-field="2" placeholder="<?php echo Text::_('COM_JREALTIME_FILTER_BY_IPADDRESS' );?>"/>
						<button data-role="reset-filter" class="btn btn-secondary btn-sm"><?php echo Text::_('COM_JREALTIME_RESET' ); ?></button>
					</div>
					<div id="jrealtime_serverstats_referral" class="card-body card-block accordion-body accordion-inner collapse" data-height="350">
						<?php echo $this->loadTemplate('referral');?>
					</div>
				</div>
			</div>
		</div>
		<?php endif; ?>
		
		<?php if($this->cparams->get('searchkeys_stats', true)): ?>
		<div class="row tablestats no-margin">
			<div class="col-md-12 ps-0 span12">
				<div class="card card-default accordion-group">
					<div class="card-header accordion-heading accordion_lightblue">
						<div class="accordion-toggle accordion_lightblue accordion_filtered" data-bs-toggle="collapse" data-bs-target="#jrealtime_serverstats_searches">
							<h3 class="card-title accordion-title"><span class="icon-search" aria-hidden="true"></span><?php echo Text::_('COM_JREALTIME_SERVERSTATS_SEARCHES' ); ?></h3>
						</div>
						<input type="text" data-role="filter" data-field="1" placeholder="<?php echo Text::_('COM_JREALTIME_FILTER_BY_KEYWORDS' );?>"/>
						<button data-role="reset-filter" class="btn btn-secondary btn-sm"><?php echo Text::_('COM_JREALTIME_RESET' ); ?></button>
					</div>
					<div id="jrealtime_serverstats_searches" class="card-body card-block accordion-body accordion-inner collapse" data-height="350">
						<?php echo $this->loadTemplate('searches');?>
					</div>
				</div>
			</div>
		</div>
		<?php endif; ?>
	</div>
	
	<input type="hidden" name="option" value="<?php echo $this->option;?>" />
	<input type="hidden" name="boxchecked" value="1"/>
	<input type="hidden" name="statsreport" value="<?php echo $this->getModel()->getState('statsReport', 'full');?>" />
	<input type="hidden" name="task" value="serverstats.display" />
</form>

<div class="fancybox geomap">
	<div id="fancybox_visualmap" data-bind="geomap"></div>
</div>

<!-- Go to bottom -->
<div class="badge bg-secondary" id="gobottom">
	<span class="icon-arrow-down" aria-hidden="true"></span> <?php echo Text::_('COM_JREALTIME_GO_TO_BOTTOM');?>
</div>

<!-- Back to top -->
<div class="badge bg-secondary" id="backtop">
	<span class="icon-arrow-up" aria-hidden="true"></span> <?php echo Text::_('COM_JREALTIME_BACK_TO_TOP');?>
</div>

<div class="modal fade jrealtime-ai-modal" id="jrealtimeAiAnalysisModal" tabindex="-1" aria-hidden="true">
	<div class="modal-dialog modal-xl modal-dialog-scrollable modal-dialog-centered">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title"><?php echo Text::_('COM_JREALTIME_AI_MANUAL_ANALYSIS_TITLE');?></h5>
				<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
			</div>
			<div class="modal-body jrealtime-ai-modal-body" id="jrealtimeAiAnalysisModalBody"></div>
		</div>
	</div>
</div>