<?php if($aliases_arr[1] == 'vacations'){?>

		<div class="btn-group btn-group-justified" style="margin-bottom: 20px;">
			<?php if(isset($_GET["new"])){ ?>
			<a href="/<?php echo $folder; ?>/vacations" class="btn btn-md btn-info" style="color:#fff;">График отпусков</a>
			<? } else { ?>
			<a href="/<?php echo $folder; ?>/vacations/?new" class="btn btn-md btn-info" style="color:#fff;">Заявление</a>
			<? } ?>
			<a href="/<?php echo $folder; ?>/timeline" class="btn btn-md btn-default">График загрузки</a>
		</div>  
		
		<?php if(!isset($_GET["new"])){?>
		<div class="filters">
			<form method="POST" id="filter-list">
				<div class="input-group" style="margin-bottom:20px;">
					<span class="input-group-addon">
						<input type="checkbox" name="checkYear" id="checkYear" checked />
						<label for="checkYear"><label>
					</span>
					<?php 
					$YearStart	= date("Y");
					$YearEnd	= date("Y",strtotime("-15 years"));
					$yearArray = range($YearStart, $YearEnd);
					?>
					<select class="form-control" name="selectYear">
						<?php if ( $aliases_arr[1] == 'all-deals') {?><option value="">-- год не указан --</option><?php } ?>
						<?
						$keys = array_keys($yearArray);
						for($i=0;$i<count($keys);$i++) {
							$value = date("Y",strtotime("- $i years"));
							echo '<option value="-'.$i.' years">за '.$value.' год</option>';
						}
						?>
					</select>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title"><i class="fa fa-fw fa-user"></i> Фильтр по сотруднику</h3>
					</div>
					<div class="panel-body">
						<ul class="filter-list">
							<?php 
							$dom = new DOMDocument;
							$dom->load($baseU);
							$xpath = new DOMXPath($dom);
							$users = $xpath->query('/users/user');
							
							foreach ($users as $user) {
								$uLogin 		= $user->getAttribute('login');
								echo '<li><input type="radio" name="radioUser" id="radioUser'.$uLogin.'" value="'.$uLogin.'"/><label for="radioUser'.$uLogin.'">'.get_user_name_login($uLogin, 'small').'</label><b><span class="filter-list-num">'.multi_count_vacation($selectType, '', $uLogin, '', $sel_year).'</span></b></li>';
							}
							?>
						</ul>
					</div>
				</div>
				
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title"><i class="fa fa-fw fa-exclamation-triangle"></i> Фильтр по типу</h3>
					</div>
					<div class="panel-body">
						<ul class="filter-list">
							<li>
								<input type="radio" name="radioType" id="vac-1" value="vac-1"/>
								<label for="vac-1"><i class="fa fa-fw fa-bookmark clr_vlow"></i> Оплачиваемый отпуск</label>
								<b><span class="filter-list-num">
									<?php echo multi_count_vacation('vac-1', '', $selectUser, '', $sel_year); ?>
								</span></b>
							</li>
							<li>
								<input type="radio" name="radioType" id="vac-2" value="vac-2"/>
								<label for="vac-2"><i class="fa fa-fw fa-bookmark clr_high"></i> Неоплачиваемый отпуск</label>
								<b><span class="filter-list-num">
									<?php echo multi_count_vacation('vac-2', '', $selectUser, '', $sel_year); ?>
								</span></b>
							</li>
							<li>
								<input type="radio" name="radioType" id="vac-3" value="vac-3"/>
								<label for="vac-3"><i class="fa fa-fw fa-bookmark clr_vhigh"></i> Отпуск по беременности</label>
								<b><span class="filter-list-num">
									<?php echo multi_count_vacation('vac-3', '', $selectUser, '', $sel_year); ?>
								</span></b>
							</li>
							<li>
								<input type="radio" name="radioType" id="vac-4" value="vac-4"/>
								<label for="vac-4"><i class="fa fa-fw fa-bookmark clr_medium"></i> Отпуск по уходу</label>
								<b><span class="filter-list-num">
									<?php echo multi_count_vacation('vac-4', '', $selectUser, '', $sel_year); ?>
								</span></b>
							</li>
							<li>
								<input type="radio" name="radioType" id="vac-5" value="vac-5"/>
								<label for="vac-5"><i class="fa fa-fw fa-bookmark clr_low"></i> Учебный отпуск</label>
								<b><span class="filter-list-num">
									<?php echo multi_count_vacation('vac-5', '', $selectUser, '', $sel_year); ?>
								</span></b>
							</li>
							<li>
								<input type="radio" name="radioType" id="vac-6" value="vac-6"/>
								<label for="vac-6"><i class="fa fa-fw fa-bookmark clr_none"></i> Отпуск по переработкам</label>
								<b><span class="filter-list-num">
									<?php echo multi_count_vacation('vac-6', '', $selectUser, '', $sel_year); ?>
								</span></b>
							</li>
						</ul>
					</div>
				</div>
				
				<div class="btn-group btn-group-justified filter-buttons">
					<input type="submit" class="btn-filter btn btn-md btn-success" value="Фильтровать" name="VacationsFilter" />
					<input type="submit" class="btn-freset btn btn-md btn-default" value="Сбросить" />
				</div>
				
			</form>
		</div>
		<?php } ?>
	<?php } ?>

	<?php if($aliases_arr[1] == 'users'){?>
		<div class="btn-group btn-group-justified" style="margin-bottom: 20px;">
			<?php if($GroupCheck != 'guest' and $GroupCheck != 'user' and $nCRMureg =='on' or $GroupCheck == 'admin' ) { ?>
			<a href="/<?php echo $folder; ?>/users/?new" class="btn btn-md btn-info add-user" style="color:#fff;">Добавить</a>
			<?php } else { ?>
			<a href="javascript:;" class="btn btn-md btn-info disabled">Добавить</a>
			<?php } ?>
			<a href="/<?php echo $folder; ?>/timeline" class="btn btn-md btn-default">График загрузки</a>
		</div>  
		
		<a href="/<?php echo $folder; ?>/vacations" class="btn btn-md btn-block btn-default" style="color:#333;margin-bottom:20px;">График отпусков</a>
		
		<div class="filters">
			<form method="POST" id="filter-list">
			
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title"><i class="fa fa-fw fa-group"></i> Фильтр по группе</h3>
					</div>
					<div class="panel-body">
						<ul class="filter-list">
							<li>
								<input type="radio" name="radioGroup" id="radioGroupadmin" value="admin"/>
								<label for="radioGroupadmin"><i class="fa fa-fw fa-bookmark clr_high"></i> <?php echo $nCRMgradmin; ?></label>
								<b><span class="filter-list-num"><?php echo count_user('group', 'admin'); ?></span></b>
							</li>
							<li>
								<input type="radio" name="radioGroup" id="radioGroupmanager" value="manager"/>
								<label for="radioGroupmanager"><i class="fa fa-fw fa-bookmark clr_medium"></i> <?php echo $nCRMgrmanager; ?></label>
								<b><span class="filter-list-num"><?php echo count_user('group', 'manager'); ?></span></b>
							</li>
							<li>
								<input type="radio" name="radioGroup" id="radioGroupuser" value="user"/>
								<label for="radioGroupuser"><i class="fa fa-fw fa-bookmark clr_vlow"></i> <?php echo $nCRMgruser; ?></label>
								<b><span class="filter-list-num"><?php echo count_user('group', 'user'); ?></span></b>
							</li>
							<li>
								<input type="radio" name="radioGroup" id="radioGroupguest" value="guest"/>
								<label for="radioGroupguest"><i class="fa fa-fw fa-bookmark clr_none"></i> <?php echo $nCRMgrguest; ?></label>
								<b><span class="filter-list-num"><?php echo count_user('group', 'guest'); ?></span></b>
							</li>
						</ul>
					</div>
				</div>
				
				<div class="btn-group btn-group-justified filter-buttons">
					<input type="submit" class="btn-filter btn btn-md btn-success" value="Фильтровать" name="UserFilter" />
					<input type="submit" class="btn-freset btn btn-md btn-default" value="Сбросить" />
				</div>
				
			</form>
		</div>

		<?php 
		if(file_exists($baseQ) AND file_exists($fileQ)){
			require_once(ROOT . 'modules/users/func-qchat.php');
		}
		?>
	<?php } ?>