@if (isset($packing))
	<div class="row">
		<div class="col-md-6 col-md-offset-3">
			<div class="panel panel-default panel-production">
				<div class="panel-heading">
					<h3>В ожидании</h3>
				</div>
				<div class="panel-body">
					<table class="table table-striped table-hover">
						<thead>
							<th>Номер</th>
							<th>Заказ</th>
						</thead>
						<tbody>
							@foreach ($partners as $partner)
							<tr>
								<td>
									<h4>№{{ $partner->id }}</h4>
								</td>
								<td class="project-name">
									@if ($partner->getCart())
										@foreach ($partner->getCart() as $item)
											@foreach ($item as $item2)
												@if($item2['quant'] > 0)
													<h4>{{ $item2['name'] }} {{ $item2['quant'] }} компл.</h4>
												@endif
											@endforeach
										@endforeach
									@endif
									<button class="btn btn-lg btn-primary btn-production-packed" data-action="{{ action('ProductionController@packed') }}" data-id="{{ $partner->id }}"><span class="glyphicon glyphicon-ok"></span> Упаковано</button>
									<br/><br/>
									{{ $partner->name }}<br/>передана в производство <span class="date-to-humanize" data-date="{{ $partner->datetime_of_agree }}">{{ $partner->datetime_of_agree }}</span><br/>
								</td>
							</tr>
							@endforeach
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
@else
	<div class="row">
		<div class="col-md-6">
			<div class="panel panel-default panel-production">
				<div class="panel-heading">
					<h3>В ожидании</h3>
				</div>
				<div class="panel-body">
					<table class="table table-striped table-hover">
						<thead>
							<th>Номер</th>
							<th>Заказ</th>
						</thead>
						<tbody>
							@foreach ($productions1 as $production)
							<tr>
								<td>
									<h4 class="cart">№{{ $production->order_id }}</h4>
								</td>
								<td class="project-name">
									<div>
										<h4>{{ $production->name }}</h4>
										<p>{{ $production->partner->comment_to_production }}</p>
									</div>
									<button class="btn btn-lg btn-primary btn-production-process" data-action="{{ action('ProductionController@process') }}" data-print-url="{{ action('ProductionController@productionPrint', array($production->id)) }}" data-id="{{ $production->id }}" data-order-id="{{ $production->order_id }}"><span class="glyphicon glyphicon-play"></span> Взять в работу</button>
									<button class="btn btn-lg btn-warning btn-production-sizing" data-action="{{ action('ProductionController@sizing') }}" data-print-url="{{ action('ProductionController@productionPrint', array($production->id)) }}" data-id="{{ $production->id }}" data-order-id="{{ $production->order_id }}"><span class="glyphicon glyphicon-play"></span> Нет размера</button>
									<br/><br/>
									@if($production->partner->is_franchisees_order) <span class="label label-danger" style="font-size:18px">для франчайзи</span> @endif
									{{--
									{{ $production->partner->name }}<br/>передана в производство <span class="date-to-humanize" data-date="{{ $production->partner->datetime_of_agree }}">{{ $production->partner->datetime_of_agree }}</span><br/>
									--}}
								</td>
							</tr>
							@endforeach
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<div class="col-md-6">
			<div class="panel panel-default panel-production">
				<div class="panel-heading">
					<h3>В работе</h3>
				</div>
				<div class="panel-body">
					<table class="table table-striped table-hover">
						<thead>
							<th>Номер</th>
							<th>Заказ</th>
						</thead>
						<tbody>
							@foreach ($productions2 as $production)
							<tr>
								<td>
									<h4 class="cart">№{{ $production->order_id }}</h4>
								</td>
								<td class="project-name">
									<h4>{{ $production->name }}</h4>
									<p>{{ $production->partner->comment_to_production }}</p>
									<button class="btn btn-lg btn-success btn-production-success" data-action="{{ action('ProductionController@success') }}" data-print-url="{{ action('ProductionController@productionPrintSuccess', array($production->id)) }}" data-id="{{ $production->id }}" data-order-id="{{ $production->order_id }}"><span class="glyphicon glyphicon-ok"></span> Готово</button>
									@if($production->production_master_id === 0 || $production->production_master_id === '0')
										<button class="btn btn-lg btn-warning btn-production-nostorage" data-action="{{ action('ProductionController@noStorage') }}" data-print-url="{{ action('ProductionController@productionPrintSuccess', array($production->id)) }}" data-id="{{ $production->id }}" data-order-id="{{ $production->order_id }}"><span class="glyphicon glyphicon-ok"></span> Нет на складе</button>
										<span class="label label-info">Взять со склада</span>
									@endif
									<br/><br/>
									@if($production->partner->is_franchisees_order) <span class="label label-danger" style="font-size:18px">для франчайзи</span> @endif
									{{--
									{{ $production->partner->name }}<br/>передана в производство <span class="date-to-humanize" data-date="{{ $production->partner->datetime_of_agree }}">{{ $production->partner->datetime_of_agree }}</span><br/>
									--}}
								</td>
							</tr>
							@endforeach
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
@endif