
<?php $__env->startSection('title'); ?>
@parent
Редактировать группу продукта
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="row">
	<div class="col-md-8 col-md-offset-2">
		<?php echo Form::open(array('action' => array('ProductsGroupController@update', $project->id, $productGroup->id), 'method' => 'put')); ?>
		<h2>Редактировать группу продукта
    <?php echo Form::hidden('id', $productGroup->id); ?>
		<?php echo Form::submit('Сохранить изменения', array('class' => 'btn btn-primary')); ?>
		<?php echo Form::button('Отмена', array('class' => 'btn btn-default', 'onclick'=>'location="'.URL::to('projects').'/'.$project->id.'/products/group"')); ?>
		</h2>
		
		<div class="form-group <?php echo ($errors->has('name')) ? 'has-error' : ''; ?>">
			<?php echo Form::label( 'name', 'Название:', array('class' => 'control-label') ); ?>
			<?php echo Form::text('name', $productGroup->name, array('class' => 'form-control', 'autofocus')); ?>
			<?php echo ($errors->has('name') ? $errors->first('name') : ''); ?>
		</div>

		<?php echo Form::label('Продукты в группе:'); ?>
		<div class="form-group">
			<?php foreach ($currProducts as $currProduct): ?>
			<label class="checkbox-inline">
				<input type="checkbox" name="curr-product[<?php echo $currProduct->id; ?>]" value='1' checked="checked"> <?php echo $currProduct->mark; ?> <?php echo $currProduct->model; ?>, <?php echo $currProduct->productType; ?>
			</label>
			<br/>
			<?php endforeach; ?>
		</div>
		
		<label for="Остальные продукты:">Остальные продукты:</label>
		<?php /*<br>
		<button class="btn btn-danger ladda-button active" data-product-type-id="0"> Все </button>
		<div class="btn-group">
			<?php foreach ($productTypes as $productType): ?>
			  <button class="btn btn-primary ladda-button" data-product-type-id="<?php echo $productType->id; ?>"><?php echo $productType->name; ?></button>
			<?php endforeach; ?>
		</div>*/ ?>
		<?php echo Form::open(); ?>

		<div class="form-group">
			<?php foreach ($anotherProducts as $anotherProduct): ?>
			<div class="qwerty-<?php echo $anotherProduct->productTypeId; ?>">
				<label class="checkbox-inline">
					<input type="checkbox" name="another-product[<?php echo $anotherProduct->id; ?>]" class="product-type-id-<?php echo $anotherProduct->productTypeId; ?>" value='1'> 
					<span><?php echo $anotherProduct->mark; ?> <?php echo $anotherProduct->model; ?>, <?php echo $anotherProduct->productType; ?></span> <span class="badge"><?php echo $anotherProduct->productGroupName; ?></span>
				</label>
			  <br/>
			</div>
			<?php endforeach; ?>
		</div>

    <?php echo Form::close(); ?>
	</div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
	<script src="<?php echo asset('js/products.js'); ?>"></script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.default', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>