@extends('layouts.app')

@section('content')
    <div class="row container">
        <div class="card card-primary">
            <aside class="panel panel-default">
                <div class="panel-heading">
                    <a href="{{url('admin/products')}}" class="btn btn-raised btn-primary">Products</a>
                    <a href="{{url('admin/createProducts')}}" class="btn btn-raised btn-primary">
                        New Products &nbsp; &nbsp;
                        <i class="fa fa-plus"></i>
                    </a>

                    <hr/>
                    <h3 class="text-center">Details</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-4">
                                    <h5>Name</h5>
                                </div>
                                <div class="col-md-8">
                                    <p class="no-mt">{{$prod->name}}</p>
                                </div>
                            </div>

                            <hr>

                            <div class="row">
                                <div class="col-md-4">
                                    <h5>Brand</h5>
                                </div>
                                <div class="col-md-8">
                                    <a href="javascript:void(0)">{{$prod->brand->name}}</a>
                                </div>
                            </div>

                            <hr>

                            <div class="row">
                                <div class="col-md-2">
                                    <h5>Description</h5>
                                </div>
                                <div class="col-md-10">
                                    <div class="row">
                                        <div class="col-md-3"><h6>Title</h6>
                                            <span class="">{{ $prod->description->title}}</span>
                                        </div>
                                        <div class="col-md-9"><h6>Body</h6>
                                            <span class="">{!! $prod->description->body !!} </span>
                                        </div>
                                    </div>

                                    <hr/>

                                    <div class="row">
                                        <div class="col-md-2"><h6>Meta Title</h6>
                                            <span class="">{{ $prod->description->meta_title}}</span>
                                        </div>
                                        <div class="col-md-6"><h6>Meta Description</h6>
                                            <span class="">{!! $prod->description->meta_description !!}</span>
                                        </div>
                                        <div class="col-md-3"><h6>Meta Keywords</h6>
                                            <span class="">{{ $prod->description->meta_keywords}}</span>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        <hr/>

                        <div class="row">
                            <div class="col-md-2">
                                <h5>Image</h5>
                            </div>
                            <div class="col-md-10">
                                <img src="{{asset('assets/img/productThumbImage/'.$prod->image)}}" alt=""
                                     class="img-responsive mb-4">
                            </div>
                        </div>

                        <hr>

                        <div class="row">
                            <div class="col-md-2">
                                <h5>Weight</h5>
                            </div>
                            <div class="col-md-10">
                                <p style="text-align:justify;">{!! $prod->weight !!}KG</p>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-2">
                                <h5>Color</h5>
                            </div>
                            <div class="col-md-10">
                                    <span class="alert"
                                          style="background: {!!$prod->color!!}; width: 50px; height:30px;"></span>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-4">
                                <h5>Country</h5>
                            </div>
                            <div class="col-md-8">
                                <p style="text-align:justify;">{!! $prod->country !!}</p>
                            </div>
                        </div>
                        <div class="row">
                        <div class="col-md-4">
                        <h5>Quantity in Stock</h5>
                        </div>
                        <div class="col-md-8">
                        <p style="text-align:justify;">
                            <?php if ($stock !== null) echo $stock[0]['quantity']; ?>
                            <?php if ($metric !== null) echo $metric[0]['symbol']; ?>
                        </p>
                        </div>
                        </div>

                    </div>

                </div>

                <div class="btn-group">
                    <button type="button" class="btn btn-primary btn-raised">Action</button>
                    <button type="button" class="btn btn-primary btn-raised dropdown-toggle" data-toggle="dropdown"
                            aria-haspopup="true" aria-expanded="false">
                        <i class="zmdi zmdi-chevron-down right only"></i>
                    </button>
                    <ul class="dropdown-menu dropdown-menu-primary">
                        <li class="">
                            <a href="{{url('admin/'.$prod->id.'/edit')}}">Edit</a>
                        </li>
                        <li>

                            <a href="{{url('admin/'.$prod->id.'/delete')}}" id="delete-btn"
                               onclick="return confirm('Are you sure you want to delete the post?')"
                               data-action="{{'/post/'.$prod->id.'/delete'}}">Delete</a>
                        </li>
                        <li>
                            <a href="{{url('admin/'.$prod->id.'/details')}}">Details</a>
                        </li>
                        <li role="separator" class="divider"></li>
                        <li>
                        </li>
                    </ul>
                </div>
        </div>

        <div class="panel-footer"></div>
        </aside>
    </div>
    </div>

@endsection