@extends('layouts.masterHome2')

@section('content')

@if (session()->has('message'))
<div class="row">
        <!-- left column -->
        <div class="col-md-2"></div>
        <div class="col-md-4 alert alert-success alert-dismissible" style="font-size:18px;font-weight:bold;width:400px;margin-left:15px">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                {!! session('message') !!}
        </div>
</div> 
@endif

<div class="row" style="padding:10px">
<div class="col-md-1" style="margin-left:18px"></div>
<div class="col-md-6" style="margin-left:18px">
      <div class="card card-info">
          <div class="card-header">
            <h3 class="card-title">Edit Invoice Item </h3>
          </div>
          <!-- /.card-header -->
          <!-- form start -->
          <form  role="form" method="POST" action="{{ url('/invoice/edititem/edit') }}">
                        {{ csrf_field() }}
          <div class="box-body">
            <div class="card-body">

            <div class="form-group">
                  <label> Product Name  </label>
                  <select class="form-control select2 select2-hidden-accessible"   style="width: 100%;text-align:right" name="sell_store_id" id="sell_store_id" required>
                    @foreach( $sell_stores as $sell_store ) 
                    <option value="{{ $sell_store->id }}" {{ $item->sell_store_id == $sell_store->id ? 'selected' : '' }} >{{$sell_store->store->sell_name}} </option>
                    @endforeach
                  </select>
            </div>

                <div class="form-group">
                  <label for="exampleInputPassword1">Price  </label>
                  <input type="text"  id="item_price" name="item_price" value="{{$item->item_price }}" class="form-control"  placeholder="Price " required>
                </div>
                
                <div class="form-group">
                  <label for="exampleInputPassword1">Quantity  </label>
                  <input type="text"  id="item_amount" name="item_amount" value="{{$item->item_amount }}" class="form-control"  placeholder="Quantity " required>
                </div>

                <input type="hidden" name="item_id" value="{{$item->id}}" class="form-control"  placeholder="" required>
                <input type="hidden" name="invoice_id" value="{{$item->invoice_id}}" class="form-control"  placeholder="" required>
                
                <div class="card-footer">
                  <button type="submit" class="btn btn-info">Save</button>
                </div>  
              </div>
          </div>


          </form>
      </div>


    </div>
  </div>





@endsection