@extends('client.layouts.app-main')
<style>

</style>
@section('content')
    @if (session('success'))
        <div class="alert alert-success alert-dismissable fade show">
            <button class="close" data-dismiss="alert" aria-label="Close">×</button>
            {{ session('success') }}
        </div>
    @endif
    <!-- row -->
    <div class="row row-sm">
        <div class="col-xl-12">
            <div class="card">
                <div class="card-header pb-0">
                    <div class="d-flex justify-content-between">
                        <div class="col-lg-12 margin-tb">
                            <a class="btn pull-left btn-danger btn-sm"
                               href="{{ route('client.products.index') }}"> عودة للخلف </a>
                            <h5 class="pull-right alert alert-sm alert-info"> عرض تفاصيل المنتج </h5>
                        </div>
                        <br>
                    </div>
                </div>
                <div class="card-body p-3">
                    <div class="col-lg-4 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            المخزن :
                            {{$product->store->store_name}}
                        </p>
                    </div>
                    <div class="col-lg-4 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            الفئة :
                            {{$product->category->category_name}}
                        </p>
                    </div>

                    <div class="clearfix"></div>

                    <div class="col-lg-4 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            الكود العالمى :
                            {{$product->code_universal}}
                        </p>
                    </div>
                    <div class="col-lg-4 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            اسم المنتج :
                            {{$product->product_name}}
                        </p>
                    </div>
                    <div class="col-lg-4 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            موديل المنتج :
                            {{$product->product_model}}
                        </p>
                    </div>
                    <div class="clearfix"></div>

                    <div class="col-lg-4 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            وصف المنتج :
                            {{$product->description}}
                        </p>
                    </div>
                    <div class="col-lg-4 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            رصيد مخزون :
                            {{floatval( $product->first_balance  )}}
                            @if(!empty($product->unit_id))
                                {{$product->unit->unit_name}}
                            @endif
                        </p>
                    </div>
                    <div class="col-lg-4 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            رصيد حد ادنى المخزن :
                            {{floatval( $product->min_balance  )}}
                        </p>
                    </div>
                    <div class="clearfix"></div>

                    <div class="col-lg-4 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            سعر التكلفة :
                            {{floatval( $product->purchasing_price  )}}
                        </p>
                    </div>
                    <div class="col-lg-4 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            سعر البيع جملة :
                            {{floatval( $product->wholesale_price  )}}
                        </p>
                    </div>
                    <div class="col-lg-4 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            سعر البيع قطاعى :
                            {{floatval( $product->sector_price  )}}
                        </p>
                    </div>
                    <div class="clearfix"></div>
                    <div class="col-lg-6 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            المقاسات :
                            @if(!$product->sizes->isEmpty())
                                @foreach($product->sizes as $size)
                                    <span class="badge badge-success">{{$size->size}}</span>
                                @endforeach
                            @endif
                        </p>
                    </div>
                    <div class="col-lg-6 pull-right p-2">
                        <p class="alert alert-secondary alert-sm" dir="rtl">
                            الالوان :
                            @if(!$product->colors->isEmpty())
                                @foreach($product->colors as $color)
                                    <span class="badge badge-danger">{{$color->color}}</span>
                                @endforeach
                            @endif
                        </p>
                    </div>
                    <div class="clearfix"></div>
                    <div class="col-lg-12 text-center p-5">
                        <img src="{{asset($product->product_pic)}}" alt="">
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
