@extends('layouts.default')

@section('title')
@parent
Редактирование статьи расходов для "{{ $workProject->name }}"
@stop

@section('content')
<div class="row">
	<div class="col-md-6 col-md-offset-3">
		{{ Form::open(array('action' => array('BudgetCostsController@update', $budgetCost->id), 'method' => 'put')) }}
		<h2>Редактирование статьи расходов для "{{ $workProject->name }}"</h2>

		<div class="form-group {{ ($errors->has('budget_cost_group_id')) ? 'has-error' : '' }}">
			{{ Form::label( 'budget_cost_group_id', 'Группа расходов:', array('class' => 'control-label') ) }}
			{{ Form::select('budget_cost_group_id', $budgetCostGroups, $budgetCost->budget_cost_group_id, array('class' => 'form-control', 'autofocus')) }}
			{{ ($errors->has('budget_cost_group_id') ? $errors->first('budget_cost_group_id') : '') }}
		</div>
		
		<div class="form-group {{ ($errors->has('name')) ? 'has-error' : '' }}">
			{{ Form::label( 'name', 'Название:', array('class' => 'control-label') ) }}
			{{ Form::text('name', $budgetCost->name, array('class' => 'form-control', 'placeholder' => 'Название')) }}
			{{ ($errors->has('name') ? $errors->first('name') : '') }}
		</div>

		{{ Form::label('Степень управляемости') }}
		<div class="form-group">
			<label class="radio-inline">
				{{ Form::radio('managed', BudgetCost::MANAGED_FULL, ($budgetCost->managed == BudgetCost::MANAGED_FULL) ? 1 : 0) }} Полностью управляемые
			</label>
			<br/>
			<label class="radio-inline">
				{{ Form::radio('managed', BudgetCost::MANAGED_HALF, ($budgetCost->managed == BudgetCost::MANAGED_HALF) ? 1 : 0) }} Частично управляемые
			</label>
			<br/>
			<label class="radio-inline">
				{{ Form::radio('managed', BudgetCost::MANAGED_NONE, ($budgetCost->managed == BudgetCost::MANAGED_NONE) ? 1 : 0) }} Неуправляемые
			</label>
		</div>

		<div class="form-group {{ ($errors->has('plan_amount')) ? 'has-error' : '' }}">
			{{ Form::label( 'plan_amount', 'Планируемая сумма расходов за месяц:', array('class' => 'control-label') ) }}
			{{ Form::text('plan_amount', $budgetCost->plan_amount, array('class' => 'form-control', 'placeholder' => 'Планируемая сумма расходов за месяц')) }}
			{{ ($errors->has('plan_amount') ? $errors->first('plan_amount') : '') }}
		</div>

		<div class="form-group {{ ($errors->has('template')) ? 'has-error' : '' }}">
			{{ Form::label( 'template', 'Шаблоны для поиска в назначении платежа:', array('class' => 'control-label') ) }}
			{{ Form::textarea('template', $budgetCost->template, array('class' => 'form-control', 'placeholder' => 'Шаблоны для поиска в назначении платежа')) }}
			{{ ($errors->has('template') ? $errors->first('template') : '') }}
		</div>

		{{ Form::submit('Сохранить статью расходов', array('class' => 'btn btn-primary')) }}
		{{ Form::button('Отмена', array('class' => 'btn btn-default', 'onclick'=>'location="'.URL::to('budget/costs').'"')) }}

    {{ Form::close() }}
	</div>
</div>

@stop