@extends('layouts.app')

@section('content')
    <div class="row nomargins">
        <div class="card card-primary">
            <aside class="panel panel-default">
                <div class="panel-heading">
                    <a href="{{route('storeOrders')}}" class="btn btn-raised btn-primary">Orders</a>
                    <h3 class="text-center">Order ISSUE</h3>
                </div>

                <div class="panel-body">
                    <div class="card animated fadeInLeftTiny animation-delay-5">
                        <div class="card-block card-block-big">
                            <div class="row">
                                <div class="col-md-2">
                                    <h5>Member</h5>
                                </div>
                                <div class="col-md-10">
                                    <p class="no-mt">{{$order->membership_id}}</p>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-2">
                                    <h5>Collection Center</h5>
                                </div>
                                <div class="col-md-10">
                                    <span href="javascript:void(0)">{{$order->store->name}}</span>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-2">
                                    <h5>Team</h5>
                                </div>
                                <div class="col-md-10">
                                    <div class="">
                                        <span class="">{{ $order->team}}</span>
                                    </div>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-2">
                                    <h5>Amount</h5>
                                </div>
                                <div class="col-md-10">
                                    <p style="text-align:justify;">{!! $order->amount !!}</p>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-2">
                                    <h5>Items Ordered</h5>
                                </div>

                                <div class="col-md-10">
                                    <div class="row">
                                        <?php $n = 0; $ident = ""; ?>
                                        @foreach($items as $item)
                                            <div class="col-sm-4">
                                                <span>
                                                 {{$item->name}}
                                                </span>
                                            </div>

                                            <div class="col-sm-4">
                                                <span>
                                                    {{$item->quantity}}
                                                </span>
                                            </div>

                                            <div class="col-sm-4">
                                                <div class="checkbox">
                                                    <label><input type="checkbox" {{$item->status === 0? '':'disabled title="Collected"'}} value="{{$item->id}}">{{$item->name}}</label>
                                                </div>
                                            </div>
                                    </div>
                                    @endforeach
                                </div>
                            </div>

                        </div>

                        <a href="{{route('storeOrderIssue', auth()->user()->store_id)}}" class="btn btn-raised btn-primary pull-right">Issue Items</a>
                    </div>
                </div>
            </aside>
        </div>
    </div>

@endsection