    <?php Fun::lang() ?>
<div class="print_this_form">
    <div class="container-fluid">
        <div class="top-content">
            <div class="row1">
                <div class="col-sm-12 col-xs-12">
                    <h2 class="show-product">{{__('administrator.info_detail')}} </h2>
                    <hr>
                </div>
            </div>
        </div>
        <hr>
        <hr>
        <div class="summary-header">
            <table>
                <tr>
                    <td>
                        <table class="text-left">
                            <tr>
                                <td>
                                    {{__('administrator.item_name')}}
                                </td>
                                <td>
                                    : {{$data['product_name']}}
                                </td>
                            </tr>
                            <tr>
                                <td>{{__('administrator.code')}}</td>
                                <td> : {{$data['barcode']}}</td>
                            </tr>
                            <tr>
                                <td>{{__('administrator.category')}}</td>
                                <td> : {{$data['category']}}</td>
                            </tr>
                            <tr>
                                <td>{{__('administrator.brands')}}</td>
                                <td> : {{$data['brand']}}</td>
                            </tr>
                            <tr>
                                <td>{{__('administrator.created_at')}}</td>
                                <td> : {{date('d-m-Y',strtotime($data['created_at']))}} </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <hr>
        <div class="wrapper-table">
            <table class="table table-striped table-hover ">
                <thead>
                <tr>
                    <th>#</th>
                    <th>{{__('administrator.barcode')}}</th>
                    <th>{{__('administrator.unit_name')}}</th>
                    <th>{{__('administrator.size')}}</th>
                    <th>{{__('administrator.color')}}</th>
                    @can('Show Purchase Item Price')
                        <th>{{__('administrator.cost')}}</th>
                    @endcan
                    <th>{{__('administrator.barcode')}}</th>
                    <th>{{__('administrator.image')}}</th>
                </tr>
                </thead>
                <tbody>
                @foreach($product_unit as $key => $value)
                    @php
                        $size = DB::table('nso007_product_size')->where('code',$value->size_code)->first();
                        $color = DB::table('nso007_product_color')->where('code',$value->color_code)->first();
                    @endphp

                    <tr>
                        <td>{{$key+1}}</td>
                        <td>{{$value->barcode}} </td>
                        <td>{{findUnit($value-> unit_id)->unit??''}} </td>
                        <td>{{$size->size??''}} </td>
                        <td>{{$color->name??''}} <span class="fa fa-circle" style="color: {{$color->color??'white'}}"></span></td>
                        @can('Show Purchase Item Price')
                            <td>{!!  '៛'.number_format($value->cost_riel,2).'<br>$'.number_format($value->cost_usd,2)  !!}</td>
                        @endcan
                        <td class="print_barcode text-center" style="font-size: 12px">
                            @if($value->barcode)
                                <p>
                                    {{$data['product_name']}}
                                </p>
                                <p style="margin-top: -5px"><br>
                                    {{__('administrator.size').' : ('.($size->size??'').'-'.($color->name??'').')'}}
                                </p>
                                {!! DNS1D::getBarcodeSVG($value->barcode, 'C128',1,50) !!}
                            @endif
                        </td>
                        <td>
                            <?php
                            $img = \App\Model\product\ProductImageModel::where('item_code',$data['barcode']??'')->first()->images??'';
                            ?>
                            <img width="100px" src="{{findImg($img)}}">
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
    </div>
</div>
