<div class="bottom-menu-small">
	<div>
		<!-- Раздел основного меню -->
		<div class="btn-group">
			@if (Auth::user()->hasRole(Role::ROLE_BUDGET_SALARY_MANAGMENT))
			<div class="btn-group">
					<a href="#" class="btn btn-info dropdown-toggle @if( Request::is('budget/salary/users*') || Request::is('budget/salary/registration*'))active @endif" data-toggle="dropdown">@if( !Request::is('budget/salary/users*') && !Request::is('budget/salary/registration*'))<i class="fa fa-cogs"></i>@endif Настройки <b class="caret"></b> </a>
					<ul class="dropdown-menu">
						<!--1--><li class="@if(Request::is('budget/salary/users*')) active @endif"><a href="/budget/salary/users"><h5></h5> @if( !Request::is('budget/salary/users*') )<i class="fa fa-user"></i> @endif Сотрудники <h5></h5></a></li>
		        <li class="@if(Request::is('budget/salary/registration')) active @endif"><a href="/budget/salary/registration"><h5></h5> @if( !Request::is('budget/salary/registration') )<i class="fa fa-link"></i> @endif Регистрация <h5></h5></a></li>
					</ul>
				</div>
			@endif
			@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 @if( Request::is('budget/salary/costsrequests*') ) active @endif">@if( !Request::is('budget/salary/costsrequests*') )<i class="fa fa-pencil"></i> @endif З/п заявки@if( Request::is('budget/salary/costsrequests*') ): @endif </a>
			@endif
			<!--3--><a role="button" href="/budget/salary/stat?monthRange=1" class="btn btn-info pull-left @if( Request::is('budget/salary/stat*') ) active @endif" style="margin-right:10px">@if( !Request::is('budget/salary/stat*') )<i class="fa fa-calendar"></i> @endif Статистика@if( Request::is('budget/salary/stat*') ): @endif </a>

			<!-- Доп. кнопки к выбранному разделу основного меню -->
		  <!--1-->
		  @if(Request::is('budget/salary/users*'))
				<div class="pull-right">
					<a href="{{ URL::to('budget/salary/users/all') }}" class="btn btn-default @if (Request::is('budget/salary/users/all')) active @endif"> Все сотрудники</a>
					<a href="{{ URL::to('budget/salary/users') }}" class="btn btn-default @if (Request::is('budget/salary/users')) active @endif"> В проекте</a>
				</div>
			<!--2-->
			@elseif(Request::is('budget/salary/costsrequests*'))
					<a href="{{ URL::to('budget/salary/costsrequests') }}" class=" pull-left btn btn-default @if (Request::is('budget/salary/costsrequests*')) active @endif" style="margin-right:10px"> В проекте </a>
					@include('budget/salary/costsrequests/btns')
			<!--3-->
			@elseif(Request::is('budget/salary/stat*'))
				@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 @if(Input::get('monthRange') == 1 || (Request::is('budget/salary/stat') && !Input::get('monthRange'))) active @else bg-color-blueLight @endif" href="?monthRange=1"> Текущий период </a>
				  <a role="button" class="btn link-white btn-default @if(Input::get('monthRange') == 4) active @else bg-color-blueLight @endif" href="?monthRange=4"> Пол года </a>
				  <a role="button" class="btn link-white btn-default @if(Input::get('monthRange') == 10) active @else bg-color-blueLight @endif" href="?monthRange=10"> Год </a>
				</div>
				@endif
				@if(Request::is('budget/salary/stat/operations*'))
				<div class="btn-group form-inline pull-right">
					З/п за:
					<input id="startDate" name="startDate" class="input-sm" value="{{ $startDate }}">
					<input id="endDate" name="endDate" class="input-sm" value="{{ $endDate }}">
					<select class="form-control" name="monthSelect" id="monthSelect">
					</select>
				</div>
				@endif
				<div class="pull-right">
					<a href="{{ action('BudgetSalaryController@stat').'?monthRange=1' }}" class="btn btn-default @if (Request::is('budget/salary/stat')) active @endif"> Общая </a>
          @if (Auth::user()->isAdmin())
					<a href="{{ action('BudgetSalaryController@allstat').'?monthRange=1' }}" class="btn btn-default @if (Request::is('budget/salary/stat/all')) active @endif" @if (!Auth::user()->hasAnyRole(array(Role::ROLE_BUDGET, Role::ROLE_BUDGET_ACCOUNTANT))) style="margin-right:10px" @endif>Общая (все проекты)</a>
					@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');
							}
						}
					?>
					@if (Auth::user()->hasAnyRole(array(Role::ROLE_BUDGET, Role::ROLE_BUDGET_ACCOUNTANT)))

					<a href="{{ $url }}" class="btn btn-default @if (Request::is('budget/salary/stat/operations*')) active @endif" style="margin-right:10px"> З/п операции </a>
					@endif
				</div>
			@endif
		</div>
	</div>
</div>