@extends('layouts.app')

@section('content')
    <div class="card card-primary">
        <div class="panel panel-black">
            <div class="panel-heading">
                <a href="{{url('admin/products')}}" class="btn btn-raised btn-primary">Products</a>
                <a href="{{url('admin/allInventory')}}" class="btn btn-raised btn-primary">Inventories</a>
                <a href="{{route('stockTransfer')}}" class="btn btn-raised btn-primary">Transfers</a>

                <hr/>
                <h3 class="text-center">Assign Stock</h3>
            </div>

            <div class="panel-body">
                @include('includes.flash')

                <form class="form-horizontal" method="post" action="{{ route('assignInventory')}}">
                    {!! csrf_field() !!}
                    <div class="form-group required">
                        <label class="col-sm-2 control-label" for="productID">Stock</label>
                        <div class="col-sm-6">
                            <select name="productID" id="productID" onchange="getDetails()" class="form-control">
                                @foreach ($products as $product)
                                    <option value="{!! $product->id !!}">{!!   $product->name !!}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>

                    <div class="form-group required">
                        <label class="col-sm-2 control-label" for="storeID">Store</label>
                        <div class="col-sm-6">
                            <select name="storeID" id="storeID" onchange="getStoreDetails()" class="form-control">
                                @foreach ($stores as $store)
                                    <option value="{!! $store->id !!}">{!! $store->name !!}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>

                    <div class="form-group required">
                        <label class="col-sm-2 control-label" for="quantity">Quantity</label>
                        <div class="col-sm-6">
                            <input type="number" name="quantity" required min="1" class="form-control" {{old('quantity')}} />
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-2"></div>
                        <div class="col-md-6 ">
                            <button type="submit" class="btn btn-success clear-fix" >Assign</button>
                        </div>
                    </div>
                </form>

            </div>

            <div class="panel-footer">
            </div>
        </div>
    </div>
@endsection










