@extends('yonetim.yonetim_master')

@section('chartcss')
    <link rel="stylesheet" href="{{asset('yonetim/assets/bundles/jqvmap/dist/jqvmap.min.css')}}">

@endsection

@section('main')






    <section class="section">
        <div class="row">
            <div class="col-xl-3 col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="card">
                    <div class="card-statistic-4">
                        <div class="align-items-center justify-content-between">
                            <div class="row ">

                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pr-0 pt-3">
                                    <div class="card-content">
                                        <h5 class="font-15">Kazanç Miktarı</h5>
                                        <h2 class="mb-3 font-18">{{$istatistik->toplamkazanc}}₺</h2>
                                    </div>
                                </div>
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pl-0">
                                    <div class="banner-img">
                                        <img src="{{asset('yonetim/assets/img/banner/1.png')}}" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="card">
                    <div class="card-statistic-4">
                        <div class="align-items-center justify-content-between">
                            <div class="row ">
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pr-0 pt-3">
                                    <div class="card-content">
                                        <h5 class="font-15"> Toplam Sipariş</h5>
                                        <h2 class="mb-3 font-18">{{$istatistik->toplamsiparis}}</h2>
                                    </div>
                                </div>
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pl-0">
                                    <div class="banner-img">
                                        <img src="{{asset('yonetim/assets/img/banner/2.png')}}" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="card">
                    <div class="card-statistic-4">
                        <div class="align-items-center justify-content-between">
                            <div class="row ">
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pr-0 pt-3">
                                    <div class="card-content">
                                        <h5 class="font-15">Toplam Müşteri</h5>
                                        <h2 class="mb-3 font-18">{{$istatistik->toplammusteri}}</h2>
                                    </div>
                                </div>
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pl-0">
                                    <div class="banner-img">
                                        <img src="{{asset('yonetim/assets/img/banner/3.png')}}" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="card">
                    <div class="card-statistic-4">
                        <div class="align-items-center justify-content-between">
                            <div class="row ">
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pr-0 pt-3">
                                    <div class="card-content">
                                        <h5 class="font-15">Bayi Sayısı</h5>
                                        <h2 class="mb-3 font-18">{{$istatistik->toplambayi}}</h2>
                                    </div>
                                </div>
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pl-0">
                                    <div class="banner-img">
                                        <img src="{{asset('yonetim/assets/img/banner/4.png')}}" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xl-3 col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="card">
                    <div class="card-statistic-4">
                        <div class="align-items-center justify-content-between">
                            <div class="row ">
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pr-0 pt-3">
                                    <div class="card-content">
                                        <h5 class="font-15">Yazılım Sayısı</h5>
                                        <h2 class="mb-3 font-18">{{$istatistik->toplamscript}}</h2>
                                    </div>
                                </div>
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pl-0">
                                    <div class="banner-img">
                                        <img src="{{asset('yonetim/assets/img/banner/5.png')}}" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="card">
                    <div class="card-statistic-4">
                        <div class="align-items-center justify-content-between">
                            <div class="row ">
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pr-0 pt-3">
                                    <div class="card-content">
                                        <h5 class="font-15"> Bekleyen Talep </h5>
                                        <h2 class="mb-3 font-18">{{$istatistik->bekleyentalep}}</h2>
                                    </div>
                                </div>
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pl-0">
                                    <div class="banner-img">
                                        <img src="{{asset('yonetim/assets/img/banner/6.png')}}" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="card">
                    <div class="card-statistic-4">
                        <div class="align-items-center justify-content-between">
                            <div class="row ">
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pr-0 pt-3">
                                    <div class="card-content">
                                        <h5 class="font-15">Bekleyen Sipariş</h5>
                                        <h2 class="mb-3 font-18">{{$istatistik->bekleyensiparis}}</h2>
                                    </div>
                                </div>
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pl-0">
                                    <div class="banner-img">
                                        <img src="{{asset('yonetim/assets/img/banner/7.png')}}" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="card">
                    <div class="card-statistic-4">
                        <div class="align-items-center justify-content-between">
                            <div class="row ">
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pr-0 pt-3">
                                    <div class="card-content">
                                        <h5 class="font-15">Gelen Mailler</h5>
                                        <h2 class="mb-3 font-18">{{$istatistik->gelenmail}}</h2>
                                    </div>
                                </div>
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pl-0">
                                    <div class="banner-img">
                                        <img src="{{asset('yonetim/assets/img/banner/8.png')}}" alt="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>







        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div style="display: inline" class="card-header">
                        <h4 style="float: left">Son 5 Sipariş</h4>

                        <h4 style="text-align: right" class="float-right">
                            <a href="{{route('siparis.all')}}" class="btn btn-primary small">Tümünü Göster</a>
                        </h4>

                    </div>
                    <div class="card-body">

                        <div class="table-responsive">
                            <table class="table table-striped" id="table-1">
                                <thead>
                                <tr>

                                    <th>Siparis İd</th>
                                    <th>Alan Kullanıcı</th>
                                    <th>Fiyat</th>
                                    <th>Tarih</th>
                                    <th>Durum</th>
                                    <th>İşlemler</th>
                                </tr>
                                </thead>
                                <tbody>

                                @foreach($sonsiparisler as $veri)
                                    <tr>

                                        <td>{{$veri->id}}</td>
                                        <td>
                                            @php

                                                @endphp
                                            <a href=" {{route('uyeler.uyedetay',$veri->kullanici_id)}}">
                                                {{$veri->useradi->name}} {{$veri->useradi->surname}}

                                            </a>
                                        </td>

                                        <td>{{$veri->toplamsepetfiyat}}₺</td>

                                        <td>{{ \Carbon\Carbon::parse($veri->created_at)->format('d.m.Y H:i') }}</td>

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

                                                <span class="badge badge-success">Tamamlandı</span>

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

                                            @elseif($veri->siparisdurum==4)
                                                <span class="badge badge-primary">İade İşlemi</span>
                                            @elseif($veri->siparisdurum==7)
                                                <span class="badge badge-success p-2">Ödeme Başarılı</span>

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

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

                                            @endif
                                        </td>




                                        <td>
                                            <a href="{{ route('siparis.veriupdate',$veri->id)}}" class="btn btn-warning"><i class="fa fa-edit"></i> Sipariş Detayı</a>
                                        </td>
                                    </tr>
                                @endforeach





                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6 col-lg-12 col-xl-6">
                <!-- Support tickets -->
                <div style="" class="card border-bottom">
                    <div style="width: 100%;display: inline" class="card-header">
                        <h4 style="float: left">Son Destek talepleri
                        </h4>
                        <h4 style="text-align: right" class="float-right">
                                <a href="{{route('talepler.all')}}" class="btn btn-primary small">Tümünü Göster</a>
                            </h4>

                    </div>

                    <div class="card-body mt-4">

                        @foreach($sontalepler as $talep)
                            <div class="support-ticket media pb-1 mb-3 border-bottom">
                                <div style="cursor: pointer" onclick=location.href="{{route('talepler.mesajgonder',$talep->id)}}" class="media-body ml-3">

                                    @if($talep->statu==1)
                                        <div class="badge badge-pill badge-success mb-1 float-right">Beklemede</div>

                                    @elseif($talep->statu==2)
                                        <div class="badge badge-pill badge-secondary mb-1 float-right">Yanıtlandınız</div>

                                    @elseif($talep->statu==4)
                                        <div class="badge badge-pill badge-danger mb-1 float-right">Kapatıldı</div>


                                    @else
                                        <div class="badge badge-pill badge-warning mb-1 float-right">Mesaj Gönderdiniz</div>

                                    @endif

                                    <span class="font-weight-bold">#{{$talep->id}}</span>
                                    <span class="font-weight-bold">Konu : {{$talep->talepadi}}</span>
                                    <p class="my-1">{{substr($talep->talepadi,0,50)}}....</p>
                                    <small class="text-muted">Gönderilme Tarihi : <span class="font-weight-bold font-13">{{$talep->created_at}}</small>
                                </div>
                            </div>
                        @endforeach


                    </div>
                </div>
                <!-- Support tickets -->
            </div>
            <div class="col-md-6 col-lg-12 col-xl-6">
                <div class="card">
                    <div style="width: 100%;display: inline" class="card-header">
                        <h4 style="float: left">Gelen Son Mailler</h4>
                        <h4 style="text-align: right" class="float-right">
                            <a href="{{route('contact.all')}}" class="btn btn-primary small">Tümünü Göster</a>
                        </h4>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-hover mb-0">
                                <thead>
                                <tr>
                                    <th>İd</th>
                                    <th>Gönderen Adı</th>
                                    <th>Detay</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($sonmailler as $mailler)
                                    <tr>
                                        <td>{{$mailler->id}}</td>
                                        <td>{{$mailler->name}}</td>
                                        <td><a href="{{ route('contact.details',$mailler->id)}}" class="btn btn-primary"><i class="fa fa-book-open"></i> Detay</a></td>
                                    </tr>
                                @endforeach

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

@endsection

