<div class="bottom-menu-small">
	<div>
		<!-- Раздел основного меню -->
		<div class="btn-group">
			<?php if(Auth::user()->hasRole(Role::ROLE_BUDGET_SALARY_MANAGMENT)): ?>
			<div class="btn-group">
					<a href="#" class="btn btn-info dropdown-toggle <?php if( Request::is('budget/salary/users*') || Request::is('budget/salary/registration*')): ?>active <?php endif; ?>" data-toggle="dropdown"><?php if( !Request::is('budget/salary/users*') && !Request::is('budget/salary/registration*')): ?><i class="fa fa-cogs"></i><?php endif; ?> Настройки <b class="caret"></b> </a>
					<ul class="dropdown-menu">
						<!--1--><li class="<?php if(Request::is('budget/salary/users*')): ?> active <?php endif; ?>"><a href="/budget/salary/users"><h5></h5> <?php if( !Request::is('budget/salary/users*') ): ?><i class="fa fa-user"></i> <?php endif; ?> Сотрудники <h5></h5></a></li>
		        <li class="<?php if(Request::is('budget/salary/registration')): ?> active <?php endif; ?>"><a href="/budget/salary/registration"><h5></h5> <?php if( !Request::is('budget/salary/registration') ): ?><i class="fa fa-link"></i> <?php endif; ?> Регистрация <h5></h5></a></li>
					</ul>
				</div>
			<?php endif; ?>
			<?php if(Auth::user()->hasAnyRole(array(Role::ROLE_BUDGET_OUTCOMING_REQUEST, Role::ROLE_BUDGET_CFO, Role::ROLE_BUDGET_ACCOUNTANT, Role::ROLE_BUDGET_ACC_SECRETARY))): ?>
			<!--2--><a role="button" href="/budget/salary/costsrequests" class="btn btn-info pull-left <?php if( Request::is('budget/salary/costsrequests*') ): ?> active <?php endif; ?>"><?php if( !Request::is('budget/salary/costsrequests*') ): ?><i class="fa fa-pencil"></i> <?php endif; ?> З/п заявки<?php if( Request::is('budget/salary/costsrequests*') ): ?>: <?php endif; ?> </a>
			<?php endif; ?>
			<!--3--><a role="button" href="/budget/salary/stat?monthRange=1" class="btn btn-info pull-left <?php if( Request::is('budget/salary/stat*') ): ?> active <?php endif; ?>" style="margin-right:10px"><?php if( !Request::is('budget/salary/stat*') ): ?><i class="fa fa-calendar"></i> <?php endif; ?> Статистика<?php if( Request::is('budget/salary/stat*') ): ?>: <?php endif; ?> </a>

			<!-- Доп. кнопки к выбранному разделу основного меню -->
		  <!--1-->
		  <?php if(Request::is('budget/salary/users*')): ?>
				<div class="pull-right">
					<a href="<?php echo URL::to('budget/salary/users/all'); ?>" class="btn btn-default <?php if(Request::is('budget/salary/users/all')): ?> active <?php endif; ?>"> Все сотрудники</a>
					<a href="<?php echo URL::to('budget/salary/users'); ?>" class="btn btn-default <?php if(Request::is('budget/salary/users')): ?> active <?php endif; ?>"> В проекте</a>
				</div>
			<!--2-->
			<?php elseif(Request::is('budget/salary/costsrequests*')): ?>
					<a href="<?php echo URL::to('budget/salary/costsrequests'); ?>" class=" pull-left btn btn-default <?php if(Request::is('budget/salary/costsrequests*')): ?> active <?php endif; ?>" style="margin-right:10px"> В проекте </a>
					<?php echo $__env->make('budget/salary/costsrequests/btns', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
			<!--3-->
			<?php elseif(Request::is('budget/salary/stat*')): ?>
				<?php if( Request::is('budget/salary/stat') || Request::is('budget/salary/stat/all') ): ?>
				<div class="widget-toolbar smart-form search-input pull-right">
					<label class="input">
						<i class="btn-search-clear icon-append glyphicon glyphicon-remove-circle"></i>
						<input id="pageSeachInTableString" type="text">
					</label>
			  </div>
				<div class="btn-group pull-right">
				  <a role="button" class="btn link-white btn-default <?php if(Input::get('monthRange') == 1 || (Request::is('budget/salary/stat') && !Input::get('monthRange'))): ?> active <?php else: ?> bg-color-blueLight <?php endif; ?>" href="?monthRange=1"> Текущий период </a>
				  <a role="button" class="btn link-white btn-default <?php if(Input::get('monthRange') == 4): ?> active <?php else: ?> bg-color-blueLight <?php endif; ?>" href="?monthRange=4"> Пол года </a>
				  <a role="button" class="btn link-white btn-default <?php if(Input::get('monthRange') == 10): ?> active <?php else: ?> bg-color-blueLight <?php endif; ?>" href="?monthRange=10"> Год </a>
				</div>
				<?php endif; ?>
				<?php if(Request::is('budget/salary/stat/operations*')): ?>
				<div class="btn-group form-inline pull-right">
					З/п за:
					<input id="startDate" name="startDate" class="input-sm" value="<?php echo $startDate; ?>">
					<input id="endDate" name="endDate" class="input-sm" value="<?php echo $endDate; ?>">
					<select class="form-control" name="monthSelect" id="monthSelect">
					</select>
				</div>
				<?php endif; ?>
				<div class="pull-right">
					<a href="<?php echo action('BudgetSalaryController@stat').'?monthRange=1'; ?>" class="btn btn-default <?php if(Request::is('budget/salary/stat')): ?> active <?php endif; ?>"> Общая </a>
          <?php if(Auth::user()->isAdmin()): ?>
					<a href="<?php echo action('BudgetSalaryController@allstat').'?monthRange=1'; ?>" class="btn btn-default <?php if(Request::is('budget/salary/stat/all')): ?> active <?php endif; ?>" <?php if(!Auth::user()->hasAnyRole(array(Role::ROLE_BUDGET, Role::ROLE_BUDGET_ACCOUNTANT))): ?> style="margin-right:10px" <?php endif; ?>>Общая (все проекты)</a>
					<?php endif; ?>
                    <?php
					  $salaryUserId = Session::get('salaryUserId');
					  if($salaryUserId == 'all'){
							$url = URL::to('budget/salary/stat/operations');
						}else if($salaryUserId != 0){
							$url = URL::to('budget/salary/stat/operations/'.$salaryUserId);
						}else{
							$defaultUser = $workProject->salaryUsers()->orderBy('last_name')->first();
							if($defaultUser != null){
								$url = URL::to('budget/salary/stat/operations/'.$defaultUser->id);
							}else{
								$url = URL::to('budget/salary/stat/operations');
							}
						}
					?>
					<?php if(Auth::user()->hasAnyRole(array(Role::ROLE_BUDGET, Role::ROLE_BUDGET_ACCOUNTANT))): ?>

					<a href="<?php echo $url; ?>" class="btn btn-default <?php if(Request::is('budget/salary/stat/operations*')): ?> active <?php endif; ?>" style="margin-right:10px"> З/п операции </a>
					<?php endif; ?>
				</div>
			<?php endif; ?>
		</div>
	</div>
</div>