@extends('tema.layout.home_master')

@section('title')
    <title>Müşteri Paneli</title>
@endsection


@section('cssler')
    <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;
        }
        .blink {
            animation: colorchange 2s infinite;
            transition: background-color 1s;
        }

        @keyframes colorchange {
            0% { background-color: #086e16; }
            50% { background-color: #0ab044; color: white; }
            100% { background-color: #04621f; }
        }

    </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" class="col-md-9">

                <div class="row mt-4">

                    <div class="col-xl-4 col-lg-6 col-md-6 col-sm-6 col-xs-12">
                        <div class="card p-2">
                            <div class="card bg-success">
                                <div class="align-items-center justify-content-between">
                                    <div class="row ">

                                        <div class="col-lg-6 col-md-6 col-sm-6 col-6 pr-0 pt-3">
                                            <div class="card-content">
                                                <h5 class="font-15 text-white text-center">Toplam Siparişiniz</h5>
                                                <h2 class="mb-3 font-18 text-white text-center">{{$siparisler}}</h2>
                                            </div>
                                        </div>
                                        <div class="col-lg-6 col-md-6 col-sm-6 col-6 pl-0">
                                            <div class="banner-img">
                                                <img style="width: 100%;" src="{{asset('upload/banner/7.png')}}" alt="">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>




                    <div class="col-xl-4 col-lg-6 col-md-6 col-sm-6 col-xs-12">
                        <div class="card p-2">
                            <div class="card bg-warning">
                                <div class="align-items-center justify-content-between">
                                    <div class="row ">

                                        <div class="col-lg-6 col-md-6 col-sm-6 col-6 pr-0 pt-3">
                                            <div class="card-content">
                                                <h5 class="font-15 text-white text-center">Destek Talebi</h5>
                                                <h2 class="mb-3 font-18 text-white text-center">{{$talepler}}</h2>
                                            </div>
                                        </div>
                                        <div class="col-lg-6 col-md-6 col-sm-6 col-6 pl-0">
                                            <div class="banner-img">
                                                <img style="width: 100%" src="{{asset('upload/banner/6.png')}}" alt="">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="col-xl-4 col-lg-6 col-md-6 col-sm-6 col-xs-12">
                        <div class="card p-2">
                            <div class="card bg-primary">
                                <div class="align-items-center justify-content-between">
                                    <div class="row ">

                                        <div class="col-lg-6 col-md-6 col-6 col-xs-6 pr-0 pt-3">
                                            <div class="card-content">
                                                <h5 class="font-15 text-white text-center">Toplam Bakiyeniz</h5>
                                                <h2 class="mb-3 font-18 text-white text-center">{{$uyedetayi->bakiye}}₺</h2>
                                            </div>
                                        </div>
                                        <div class="col-lg-6 col-md-6 col-6 col-xs-6 pl-0">
                                            <div class="banner-img">
                                                <img style="width: 100%" src="{{asset('upload/banner/1.png')}}" alt="">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                </div>

                <div class="row">
                    <div class="col-md-12">
                        <h3 class="ml-2 mt-3">Bildirimleriniz</h3>



                        @if($bildirimler->count()>0 || $ozelbildirimler->count()>0)

                            @foreach($ozelbildirimler as $ozel)
                                <div class="mt-2">
                                    <a style="color: rgb(4,17,51)" href="{{route('uye.ozelbildirimdetay',$ozel->id)}}"><span class="blink badge badge-success">{{$ozel->tipi}}
                                    </span> {{$ozel->baslik}}</a>
                                </div>


                            @endforeach


                            @foreach($bildirimler as $bildirim)
                                <div class="mt-2">
                                    <a style="color: rgb(4,17,51)" href="{{route('uye.bildirimdetay',$bildirim->id)}}"><span class="blink badge badge-success">{{$bildirim->tipi}}
                                    </span> {{$bildirim->baslik}}</a>
                                </div>


                            @endforeach
                        @else
                            <p class="ml-2">Henüz Bildiriminiz Yoktur</p>

                        @endif

                    </div>

                    <div class="col-md-12">
                        <div style="padding: 10px" class="table-responsive-sm">
                            <h3 class="mb-3 mt-3">Son Siparişiniz</h3>
                            <div class="flash-message"></div>
                            <table class="table table-hover 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>



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

                                        @if($veri->siparisdurum==1)
                                            <td>Beklemede</td>
                                        @elseif($veri->siparisdurum==2)
                                            <td>Tamamlandı</td>
                                        @elseif($veri->siparisdurum==3)
                                            <td>İptal Edildi</td>
                                        @endif

                                        <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 class="col-md-12">
                        <div style="padding: 10px" class="table-responsive-sm">
                            <h3 class="mb-3 mt-3">Son Destek Talebiniz <a href="{{route('uye.talepac')}}" class="btn btn-primary">Talep Aç</a></h3>
                            <div class="flash-message"></div>

                            <table class="table table-hover table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th scope="col">Sıra</th>
                                    <th scope="col">Talep Konusu</th>
                                    <th scope="col">Durum</th>
                                    <th scope="col">İşlemler</th>
                                </tr>
                                </thead>
                                <tbody>
                                @php
                                    $count=1;
                                @endphp


                                @foreach($sontalepler as $veri)
                                    <tr>
                                        <th>{{$count++}}</th>
                                        <td>{{$veri->talepadi}}</td>
                                        @if($veri->statu==1)
                                            <td><span class="badge badge-success">Gönderildi</span></td>

                                        @elseif($veri->statu==3)
                                            <td><span class="badge badge-success">Yönetimden Mesaj</span></td>

                                        @elseif($veri->statu==4)
                                            <td><span class="badge badge-danger">Kapandı</span></td>
                                        @else
                                            <td><span class="badge badge-secondary">Cevaplandı</span></td>

                                        @endif

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


                                </tbody>
                            </table>


                        </div>

                    </div>


                </div>



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


@endsection


