@extends('tema.layout.home_master')

@section('title')
    <title>Siparişler</title>
@endsection

@section('cssler')
    <link rel="stylesheet" href="{{asset('assets/izitoast/css/iziToast.min.css')}}">

<style>
    .table {
        width: 100%;
        margin-bottom: 1rem;
        color: #212529;
    }
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table:not(.table-sm):not(.table-md):not(.dataTable) td, .table:not(.table-sm):not(.table-md):not(.dataTable) th {
        padding: 0 10px;
        height: 60px;
        vertical-align: middle;
    }
    .table:not(.table-sm):not(.table-md):not(.dataTable) td, .table:not(.table-sm):not(.table-md):not(.dataTable) th {
        padding: 0 10px;
        height: 60px;
        vertical-align: middle;
    }

</style>

@endsection
@section('main')


    @include('tema.layout.uyebanner')


    <section style="background-color: rgba(232, 226, 226, 0.59);padding: 50px 0">
        <div class="container">
            <div class="row">
                @include('tema.layout.uyemenu')


                <div style="background-color: white;border-radius: 5px" class="col-md-9">

                     <div style="padding: 10px" class="table-responsive-sm">
                            <h3 class="mb-3 mt-3">Siparişler</h3>
                         <div class="flash-message"></div>




                         <table class="table table-hover table-responsive-sm table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th>Sipariş İd</th>
                                    <th>Fiyat</th>
                                    <th>Sipariş Tarihi</th>
                                    <th>Durum</th>
                                    <th>İşlemler</th>
                                </tr>
                                </thead>
                                <tbody>
                                @php
                                    $count=1;
                                @endphp


                                @foreach($siparisler as $veri)
                                    <tr>
                                        <th>{{$veri->id}}</th>
                                        <td>{{$veri->toplamsepetfiyat}}₺</td>
                                        <td>{{ Carbon\Carbon::parse($veri->created_at)->diffForHumans() }}</td>




                                        <td>
                                            @if($veri->siparisdurum==1)
                                                <span class="badge badge-warning p-2">Bekliyor</span>
                                            @elseif($veri->siparisdurum==2)

                                                <span class="badge badge-success p-2">Onaylandı</span>

                                            @elseif($veri->siparisdurum==3)
                                                <span class="badge badge-danger p-2">İptal Edildi</span>

                                            @elseif($veri->siparisdurum==4)
                                                <span class="badge badge-primary p-2">İade İşlemi</span>


                                            @elseif($veri->siparisdurum==7)
                                                <span class="badge badge-success p-2">Sipariş Hazırlanıyor</span>

                                            @elseif($veri->siparisdurum==8)
                                                <span class="badge badge-danger p-2">Başarısız İşlem</span>

                                            @else
                                                <span class="badge badge-warning p-2">Tanımsız</span>

                                            @endif
                                        </td>



                                        <td><a style="padding: 4px 20px" href="{{route('uye.siparisdetay',$veri->id)}}" class="thm-btn main-nav__btn">Detay</a></td>
                                    </tr>
                                @endforeach


                                </tbody>
                            </table>



                        </div>


                </div>
            </div>
        </div>
    </section>


@endsection



