<!-- Page Heading -->
@extends('template.index')
@section('content')
    <!-- Content Row -->
    <div class="card">
        <div class="card-body">
            <div class="clearfix mb-3">
                <div class="float-left">
                    <h5>Hasil</h5>
                </div>
                <div class="float-right">
                    {{-- <a href="" data-target="#add" data-toggle="modal" class="btn btn-primary text-white"><i class="fa fa-plus"></i>  Tambah</a> --}}
                </div>
            </div>
            <hr>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label for="">Pilih Kategori</label>
                    <input type="text" class="form-control" readonly=""
                        value="{{ $category_to_compare->nama_kategori }}">
                </div>
                <div class="col-md-6 form-group">
                    <label for="">Pilih Sub Kategori</label>
                    <input type="text" class="form-control" readonly="" value="{{ $sub_category_to_compare->nama_sub_kategori }}">
                </div>
                <div class="col-md-6 form-group">
                    <label for="">Part/Item Name</label>
                    <input type="text" class="form-control" readonly="" value="{{ $item_to_compare->nama_barang }}">
                </div>
                <div class="col-md-6 form-group">
                    <label for="">Part/Item No</label>
                    <input type="text" class="form-control" readonly="" value="{{ $item_to_compare->nomor_barang }}">
                </div>
                <div class="col-md-6">
                    <div class="card mt-3">
                        <div class="card-header bg-primary text-white">
                            <label for=""><b> Standart Material </b></label>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table">
                                    <thead>
                                        <tr class="">
                                            <th scope="col">Composition</th>
                                            <th scope="col">Portion (%)</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @foreach ($component_to_compare as $comp)
                                            <tr>
                                                <td>{{ $comp->nama_komponen }}</td>
                                                <td>{{ $comp->komponen_portion }} %</td>
                                            </tr>
                                        @endforeach
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="card mt-3">
                        <div class="card-header bg-secondary text-white">
                            <label for=""><b> Foreign Material </b></label>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table">
                                    <thead>
                                        <tr class="">
                                            <th scope="col">Composition</th>
                                            <th scope="col">Portion (%)</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @foreach ($foreign_component as $f_comp)
                                            <tr>
                                                <td>{{ $f_comp->nama_komponen }}</td>
                                                <td>{{ $f_comp->komponen_portion }} %</td>
                                            </tr>
                                        @endforeach
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-12 form-group text-right mt-3">
                    <a href="{{ url('admin/compare') }}" class="btn btn-danger"><i class="fa fa-arrow-left"></i>
                        Kembali</a>
                    <a href="{{ url('admin/compare/show') }}" class="btn btn-success"><i class="fa fa-save"></i>
                        Simpan</a>
                </div>
            </div>
        </div>
    </div>
@endsection
