@extend('admin.layout')
@section('headerinclude')
<title>Kullanıcı #{{ $user['uid'] }}</title>
<style>
.tabs .tab {
    display: none;
}
.tabs .tab.active {
    display: block;
}
</style>
@endsection
@section('content')
<div class="post d-flex flex-column-fluid" id="kt_post">
    <div id="kt_content_container" class="container-xxl">
        <div class="d-flex flex-column flex-lg-row">
            <div class="flex-column flex-lg-row-auto w-lg-250px w-xl-350px mb-10">
                <div class="card mb-5 mb-xl-8">
                    <div class="card-body">
                        <div class="d-flex flex-center flex-column py-5">
                            <a href="#" class="fs-3 text-gray-800 text-hover-primary fw-bold mb-3">
                                {{ $user['username'] }}
                            </a>
                            <div class="mb-9 mt-5">
                                <div class="badge badge-lg badge-light-primary d-inline">{{ $usergroup['ugname'] }}</div>
                            </div>
                            <div class="mb-9 mt-5">
                                <a class="btn btn-primary beLoginAdmin" data-uid="{{ $user['uid'] }}">Müşteri Olarak Giriş Yap</a>
                            </div>
                        </div>
                        <div class="d-flex flex-stack fs-4 py-3">
                            <div class="fw-bold rotate collapsible" data-bs-toggle="collapse" href="#detaylar" role="button" aria-expanded="false" aria-controls="kt_user_view_details">
                                Detaylar
                                <span class="ms-2 rotate-180">
                                    <span class="svg-icon svg-icon-3">
                                        <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                        <path d="M11.4343 12.7344L7.25 8.55005C6.83579 8.13583 6.16421 8.13584 5.75 8.55005C5.33579 8.96426 5.33579 9.63583 5.75 10.05L11.2929 15.5929C11.6834 15.9835 12.3166 15.9835 12.7071 15.5929L18.25 10.05C18.6642 9.63584 18.6642 8.96426 18.25 8.55005C17.8358 8.13584 17.1642 8.13584 16.75 8.55005L12.5657 12.7344C12.2533 13.0468 11.7467 13.0468 11.4343 12.7344Z" fill="currentColor"></path>
                                        </svg>
                                    </span>
                                </span>
                            </div>
                            <span data-bs-toggle="tooltip" data-bs-trigger="hover" data-bs-original-title="Edit customer details" data-kt-initialized="1">
                                <a href="#" class="btn btn-sm btn-light-primary" data-bs-toggle="modal" data-bs-target="#beUpdateUser">
                                    Düzenle
                                </a>
                            </span>
                        </div>
                        <div class="separator"></div>
                        <div id="detaylar" class="collapse show">
                        <div class="pb-5 fs-6">
                            <div class="fw-bold mt-5">Hesap ID</div>
                            <div class="text-gray-600"># {{ $user['uid'] }}</div>
                            <div class="fw-bold mt-5">Email</div>
                            <div class="text-gray-600"><a href="mail:{{ $user['email'] }}" class="text-gray-600 text-hover-primary">{{ $user['email'] }}</a></div>
                            <div class="fw-bold mt-5">Para Birimi</div>
                            <div class="text-gray-600">{{ $usercurrencie['cname'] }}</div>
                            <div class="fw-bold mt-5">Dil</div>
                            <div class="text-gray-600">{{ $userlanguage['lname'] }}</div>
                            <div class="fw-bold mt-5">Kayıt Tarihi</div>
                            <div class="text-gray-600">{{ date('d.m.Y',$user['regdate']) }}</div>
                        </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="flex-lg-row-fluid ms-lg-15">
                <ul class="nav nav-custom nav-tabs nav-line-tabs nav-line-tabs-2x border-0 fs-4 fw-semibold mb-8" role="tablist">
                    <li class="nav-item" role="presentation">
                        <a class="nav-link text-active-primary pb-4 active" data-bs-toggle="tab" href="#beGlobal" aria-selected="true" role="tab">Genel</a>
                    </li>
                    <li class="nav-item" role="presentation">
                        <a class="nav-link text-active-primary pb-4" data-kt-countup-tabs="true" data-bs-toggle="tab" href="#beSettings" data-kt-initialized="1" aria-selected="false" role="tab" tabindex="-1">Ayarlar</a>
                    </li>
                    <li class="nav-item" role="presentation">
                        <a class="nav-link text-active-primary pb-4" data-kt-countup-tabs="true" data-bs-toggle="tab" href="#beOrders" data-type="Order" data-kt-initialized="1" aria-selected="false" role="tab" tabindex="-1">Hizmetler</a>
                    </li>
                    <li class="nav-item" role="presentation">
                        <a class="nav-link text-active-primary pb-4" data-kt-countup-tabs="true" data-bs-toggle="tab" href="#beInvoices" data-type="Invoice" data-kt-initialized="1" aria-selected="false" role="tab" tabindex="-1">Faturalar</a>
                    </li>
                    <li class="nav-item" role="presentation">
                        <a class="nav-link text-active-primary pb-4" data-kt-countup-tabs="true" data-bs-toggle="tab" href="#beTickets" data-type="Ticket" data-kt-initialized="1" aria-selected="false" role="tab" tabindex="-1">Destek Sistemi</a>
                    </li>
                    <li class="nav-item" role="presentation">
                        <a class="nav-link text-active-primary pb-4" data-kt-countup-tabs="true" data-bs-toggle="tab" href="#beOrderLogs" data-type="OrderLog" data-kt-initialized="1" aria-selected="false" role="tab" tabindex="-1">Ürün Kayıtları</a>
                    </li>
                    <li class="nav-item" role="presentation">
                        <a class="nav-link text-active-primary pb-4" data-kt-countup-tabs="true" data-bs-toggle="tab" href="#beLogs" data-type="Log" data-kt-initialized="1" aria-selected="false" role="tab" tabindex="-1">Kayıtlar</a>
                    </li>
                    @foreach($tabs as $key => $value)
                    <li class="nav-item" role="presentation">
                        <a class="nav-link text-active-primary pb-4" data-kt-countup-tabs="true" data-bs-toggle="tab" href="#{{ $key }}" data-kt-initialized="1" aria-selected="false" role="tab" tabindex="-1">{{ $value['name'] }}</a>
                    </li>
                    @endforeach
                </ul>
                <div class="tab-content" id="myTabContent">
                    <div class="tab-pane fade active show" id="beGlobal" role="tabpanel">
                        <div class="card pt-4 mb-6 mb-xl-9">
                            <div class="card-header border-0">
                                <div class="card-title flex-column">
                                    <h2 class="mb-1">Kullanıcı Bakiyesi</h2>
                                    <div class="fs-6 fw-semibold text-muted">Kullanıcının bakiye ile ilgili işlemlerini ayarlayın</div>
                                </div>
                                <div class="card-toolbar">
                                    <button type="button" class="btn btn-light-primary btn-sm" data-bs-toggle="modal" data-bs-target="#beUserMoney">
                                        <span class="svg-icon svg-icon-3">
                                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                                <path opacity="0.3" d="M21 10.7192H3C2.4 10.7192 2 11.1192 2 11.7192C2 12.3192 2.4 12.7192 3 12.7192H6V14.7192C6 18.0192 8.7 20.7192 12 20.7192C15.3 20.7192 18 18.0192 18 14.7192V12.7192H21C21.6 12.7192 22 12.3192 22 11.7192C22 11.1192 21.6 10.7192 21 10.7192Z" fill="currentColor"></path>
                                                <path d="M11.6 21.9192C11.4 21.9192 11.2 21.8192 11 21.7192C10.6 21.4192 10.5 20.7191 10.8 20.3191C11.7 19.1191 12.3 17.8191 12.7 16.3191C12.8 15.8191 13.4 15.4192 13.9 15.6192C14.4 15.7192 14.8 16.3191 14.6 16.8191C14.2 18.5191 13.4 20.1192 12.4 21.5192C12.2 21.7192 11.9 21.9192 11.6 21.9192ZM8.7 19.7192C10.2 18.1192 11 15.9192 11 13.7192V8.71917C11 8.11917 11.4 7.71917 12 7.71917C12.6 7.71917 13 8.11917 13 8.71917V13.0192C13 13.6192 13.4 14.0192 14 14.0192C14.6 14.0192 15 13.6192 15 13.0192V8.71917C15 7.01917 13.7 5.71917 12 5.71917C10.3 5.71917 9 7.01917 9 8.71917V13.7192C9 15.4192 8.4 17.1191 7.2 18.3191C6.8 18.7191 6.9 19.3192 7.3 19.7192C7.5 19.9192 7.7 20.0192 8 20.0192C8.3 20.0192 8.5 19.9192 8.7 19.7192ZM6 16.7192C6.5 16.7192 7 16.2192 7 15.7192V8.71917C7 8.11917 7.1 7.51918 7.3 6.91918C7.5 6.41918 7.2 5.8192 6.7 5.6192C6.2 5.4192 5.59999 5.71917 5.39999 6.21917C5.09999 7.01917 5 7.81917 5 8.71917V15.7192V15.8191C5 16.3191 5.5 16.7192 6 16.7192ZM9 4.71917C9.5 4.31917 10.1 4.11918 10.7 3.91918C11.2 3.81918 11.5 3.21917 11.4 2.71917C11.3 2.21917 10.7 1.91916 10.2 2.01916C9.4 2.21916 8.59999 2.6192 7.89999 3.1192C7.49999 3.4192 7.4 4.11916 7.7 4.51916C7.9 4.81916 8.2 4.91918 8.5 4.91918C8.6 4.91918 8.8 4.81917 9 4.71917ZM18.2 18.9192C18.7 17.2192 19 15.5192 19 13.7192V8.71917C19 5.71917 17.1 3.1192 14.3 2.1192C13.8 1.9192 13.2 2.21917 13 2.71917C12.8 3.21917 13.1 3.81916 13.6 4.01916C15.6 4.71916 17 6.61917 17 8.71917V13.7192C17 15.3192 16.8 16.8191 16.3 18.3191C16.1 18.8191 16.4 19.4192 16.9 19.6192C17 19.6192 17.1 19.6192 17.2 19.6192C17.7 19.6192 18 19.3192 18.2 18.9192Z" fill="currentColor"></path>
                                            </svg>
                                        </span>
                                        Bakiye Ayarları
                                    </button>
                                </div>
                            </div>
                            <div class="card-body pb-5">
                                <div class="d-flex flex-stack">
                                    <div class="d-flex flex-column">
                                        <span>Bakiye</span>
                                        <span class="text-muted fs-6">{{ $user['money'] }} {{ $usercurrencie['cicon'] }}</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="card card-flush mb-6 mb-xl-9">
                            <div class="card-header mt-6">
                                <div class="card-title flex-column">
                                    <h2 class="mb-1">Notlar</h2>
                                </div>
                            </div>
                            <form id="noteForm" class="card-body">
                                <div class="row">
                                    <div class="col-12 mb-9">
                                        <textarea class="form-control" name="note" rows="7">{{ $userinfo['uinote'] }}</textarea>
                                    </div>
                                    <div class="col-12">
                                        <button class="btn btn-success d-block m-auto noteSaveForm">Kaydet</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="tab-pane fade" id="beSettings" role="tabpanel">
                        <div class="card pt-4 mb-6 mb-xl-9">
                            <div class="card-header border-0">
                                <div class="card-title">
                                    Seçenekler
                                </div>
                            </div>
                            <form id="settingForm" class="card-body">
                                <div class="row">
                                    <div class="col-xl-6">
                                        <div class="row">
                                            <div class="col-12 mb-9">
                                                <label class="fs-6 fw-semibold mb-2 d-block">SMS Bilgilendirmesi</label>
                                                <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Kullanıcılara satın alım vs gibi durumlarda sms yollar.</label>
                                                <div class="form-check form-switch">
                                                    <input type="hidden" name="sms_alert" value="0">
                                                    <input class="form-check-input" type="checkbox" role="switch" name="sms_alert" value="1"{{ $uisettings['sms_alert'] == 1 ? ' checked':'' }}>
                                                </div>
                                            </div>
                                            <div class="col-12 mb-9">
                                                <label class="fs-6 fw-semibold mb-2 d-block">Mail Bilgilendirmesi</label>
                                                <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Kullanıcılara satın alım vs gibi durumlarda mail yollar.</label>
                                                <div class="form-check form-switch">
                                                    <input type="hidden" name="mail_alert" value="0">
                                                    <input class="form-check-input" type="checkbox" role="switch" name="mail_alert" value="1"{{ $uisettings['mail_alert'] == 1 ? ' checked':'' }}>
                                                </div>
                                            </div>
                                            <div class="col-12 mb-9">
                                                <label class="fs-6 fw-semibold mb-2 d-block">Bildirim Bilgilendirmesi</label>
                                                <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Kullanıcılara satın alım vs gibi durumlarda bildirim yollar.</label>
                                                <div class="form-check form-switch">
                                                    <input type="hidden" name="notification_alert" value="0">
                                                    <input class="form-check-input" type="checkbox" role="switch" name="notification_alert" value="1"{{ $uisettings['notification_alert'] == 1 ? ' checked':'' }}>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-xl-6">
                                        <div class="row">
                                            <div class="col-12 mb-9">
                                                <label class="fs-6 fw-semibold mb-2 d-block">Otomatik Ödeme İzni</label>
                                                <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Kullanıcının otomatik ödemeyi açıp açamayacağını belirler!</label>
                                                <div class="form-check form-switch">
                                                    <input type="hidden" name="order_auto_pay" value="0">
                                                    <input class="form-check-input" type="checkbox" role="switch" name="order_auto_pay" value="1"{{ $uisettings['order_auto_pay'] == 1 ? ' checked':'' }}>
                                                </div>
                                            </div>
                                            <div class="col-12 mb-9">
                                                <label class="fs-6 fw-semibold mb-2 d-block">Vergi Muafiyeti</label>
                                                <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Kullanıcıdan faturalar için katma değer vergisi ödememesini sağlar.</label>
                                                <div class="form-check form-switch">
                                                    <input type="hidden" name="invoice_tax_exemption" value="0">
                                                    <input class="form-check-input" type="checkbox" role="switch" name="invoice_tax_exemption" value="1"{{ $uisettings['invoice_tax_exemption'] == 1 ? ' checked':'' }}>
                                                </div>
                                            </div>
                                            <div class="col-12 mb-9">
                                                <label class="fs-6 fw-semibold mb-2 d-block">Fatura Gecikme Ücreti</label>
                                                <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Fatura ödemesi geçtiğinde faturayı zamlandır</label>
                                                <div class="form-check form-switch">
                                                    <input type="hidden" name="invoice_latefee" value="0">
                                                    <input class="form-check-input" type="checkbox" role="switch" name="invoice_latefee" value="1"{{ $uisettings['invoice_latefee'] == 1 ? ' checked':'' }}>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-xl-12">
                                        <hr>
                                    </div>
                                    <div class="col-xl-6">
                                        <div class="row">
                                            <div class="col-12 mb-9">
                                                <label class="fs-6 fw-semibold mb-2 d-block">Askıya Alma</label>
                                                <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Kullanıcının hiç bir siparişi süre aşımı yapılsa bile askıya alınmaz!</label>
                                                <div class="form-check form-switch">
                                                    <input type="hidden" name="never_suspend" value="0">
                                                    <input class="form-check-input" type="checkbox" role="switch" name="never_suspend" value="1"{{ $uisettings['never_suspend'] == 1 ? ' checked':'' }}>
                                                </div>
                                            </div>
                                            <div class="col-12 mb-9">
                                                <label class="fs-6 fw-semibold mb-2 d-block">İptal Etme</label>
                                                <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Kullanıcının hiç bir siparişi süre aşımı yapılsa bile iptal edilmez!</label>
                                                <div class="form-check form-switch">
                                                    <input type="hidden" name="never_terminate" value="0">
                                                    <input class="form-check-input" type="checkbox" role="switch" name="never_terminate" value="1"{{ $uisettings['never_terminate'] == 1 ? ' checked':'' }}>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-xl-12">
                                        <hr>
                                    </div>
                                    <div class="col-xl-6">
                                        <div class="row">
                                            <div class="col-12 mb-9">
                                                <label class="fs-6 fw-semibold mb-2 d-block">Destek Talebi</label>
                                                <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Kullanıcı destek talebi açabilir.</label>
                                                <div class="form-check form-switch">
                                                    <input type="hidden" name="ticket_create" value="0">
                                                    <input class="form-check-input" type="checkbox" role="switch" name="ticket_create" value="1"{{ $uisettings['ticket_create'] == 1 ? ' checked':'' }}>
                                                </div>
                                            </div>
                                            <div class="col-12 mb-9">
                                                <label class="fs-6 fw-semibold mb-2 d-block">Tek Destek Talebi</label>
                                                <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Bu kullanıcının aynı anda tek bir destek talebi olabilir</label>
                                                <div class="form-check form-switch">
                                                    <input type="hidden" name="ticket_onlyone" value="0">
                                                    <input class="form-check-input" type="checkbox" role="switch" name="ticket_onlyone" value="1"{{ $uisettings['ticket_onlyone'] == 1 ? ' checked':'' }}>
                                                </div>
                                            </div>
                                            <div class="col-12 mb-9">
                                                <label class="fs-6 fw-semibold mb-2 d-block">Destek Dosyası</label>
                                                <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Kullanıcı taleplere dosya yükleyebilir</label>
                                                <div class="form-check form-switch">
                                                    <input type="hidden" name="ticket_files" value="0">
                                                    <input class="form-check-input" type="checkbox" role="switch" name="ticket_files" value="1"{{ $uisettings['ticket_files'] == 1 ? ' checked':'' }}>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-12">
                                        <button class="btn btn-success d-block m-auto settingSaveForm">Kaydet</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="tab-pane fade" id="beOrders" role="tabpanel">
                        <div class="card mb-4">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-2">
                                        <label class="fs-6 fw-semibold mb-2">Durum</label>
                                        <select class="form-control form-control-select" id="searchOrderStatus">
                                            <option value="-2">Hepsi</option>
                                            <option value="2">Aktif</option>
                                            <option value="1">Aktif(Kurulum Öncesi)</option>
                                            <option value="0">Beklemede</option>
                                            <option value="-1">İptal Edilmişler</option>
                                        </select>
                                    </div>
                                    <div class="col-2">
                                        <label class="fs-6 fw-semibold mb-2">Ürün</label>
                                        <select class="form-control form-control-select" id="searchOrderProduct">
                                            <option value="0">Seçiniz</option>
                                            @foreach($products as $pid => $product)
                                                <option value="{{ $pid }}">{{ $product }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                    <div class="col-2">
                                        <label class="fs-6 fw-semibold mb-2">Ürün Verisi</label>
                                        <input type="text" class="form-control" id="searchOrderData" placeholder="Aramak istediğiniz ürünün verisini giriniz">
                                    </div>
                                    <div class="col-2">
                                        <label class="fs-6 fw-semibold mb-2">Opsiyonlar</label>
                                        <select class="form-control form-control-select" id="searchOrderOptions">
                                            <option value="0">Seçiniz</option>
                                            <option value="1">Kalan Süre</option>
                                            <option value="2">Yenileme Fiyatı</option>
                                        </select>
                                    </div>
                                    <div class="col-2">
                                        <label class="fs-6 fw-semibold mb-2">Sıralama Türü</label>
                                        <select class="form-control form-control-select" id="searchOrderSort">
                                            <option value="1">Sondan Başa</option>
                                            <option value="2">Baştan Sona</option>
                                        </select>
                                    </div>
                                    <div class="col-12 d-flex justify-content-center mt-5">
                                        <a data-bs-toggle="tooltip" href="#" class="btn btnFindOrder btn-primary mx-2">
                                            <i class="fonticon-equalizer fs-4 me-1"></i>
                                            Ara
                                        </a>
                                        <a data-bs-toggle="tooltip" href="#" class="btn btnFindOrderEmpty btn-warning mx-2">
                                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="15" fill="currentColor"><path fill="none" d="M0 0h24v24H0z"></path><path d="M7 4V2h10v2h5v2h-2v15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6H2V4h5zM6 6v14h12V6H6zm3 3h2v8H9V9zm4 0h2v8h-2V9z"></path></svg>
                                            Temizle
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="card pt-4 mb-6 mb-xl-9">
                            <div class="card-header border-0">
                                <div class="card-title">
                                    Kullanıcı Ürünleri
                                </div>
                            </div>
                            <div class="table-responsive">
                                <table class="table w-100 table-rounded table-striped border gy-7 gs-7 mb-0">
                                    <thead>
                                        <tr class="fw-semibold fs-6 text-gray-800 border-bottom border-gray-200">
                                            <th class="text-center align-middle">#</th>
                                            <th class="text-center align-middle">Ürün</th>
                                            <th class="text-center align-middle">Sahip</th>
                                            <th class="text-center align-middle">Durum</th>
                                            <th class="text-center align-middle">Yenlieme Fiyatı</th>
                                            <th class="text-center align-middle">Tarihler</th>
                                            <th class="text-center align-middle">Düzenle</th>
                                        </tr>
                                    </thead>
                                    <tbody id="orderList">

                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="card mb-4">
                            <div class="card-body">
                                <div class="row paganation paganationOrder">
                                    
                                </div>
                            </div>
                        </div>
                        <div class="card mb-4">
                            <div class="card-header">
                                <div class="card-title">
                                    Toplu İşlemler
                                </div>
                            </div>
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-12 mb-9">
                                        <label class="fs-6 fw-semibold mb-2 d-block">Modül Etkileşimi</label>
                                        <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">İşlem yapılan siparişlerde eğer modül üzerinde işlem yapılabiliyorsa işlemi gerçekleştir.</label>
                                        <div class="form-check form-switch">
                                            <input class="form-check-input" type="checkbox" role="switch" id="orderTotalOnModule">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="card-body">
                                <a href="#" class="btn btn-success beActionOrderAll" data-status="2">Toplu Aktif Et</a>
                                <a href="#" class="btn btn-primary beActionOrderAll" data-status="1">Toplu Aktif(K.Ö) Yap</a>
                                <a href="#" class="btn btn-info beActionOrderAll" data-status="0">Toplu Beklemeye Al</a>
                                <a href="#" class="btn btn-danger beActionOrderAll" data-status="-1">Toplu İptal Et</a>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane fade" id="beInvoices" role="tabpanel">
                        <div class="d-flex justify-content-end">
                            <a href="{{ beGetRoute('admin.invoice.add') }}?user={{ $user['uid'] }}" class="d-inline-flex align-items-center btn btn-primary mb-5 mx-3">
                                <span class="svg-icon svg-icon-muted d-flex align-items-center">
                                    <svg width="23" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                        <rect opacity="0.3" x="2" y="2" width="20" height="20" rx="5" fill="currentColor"></rect>
                                        <rect x="10.8891" y="17.8033" width="12" height="2" rx="1" transform="rotate(-90 10.8891 17.8033)" fill="currentColor"></rect>
                                        <rect x="6.01041" y="10.9247" width="12" height="2" rx="1" fill="currentColor"></rect>
                                    </svg>
                                </span>
                                Yeni Fatura Oluştur
                            </a>
                        </div>
                        <div class="card mb-4">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-2">
                                        <label class="fs-6 fw-semibold mb-2">Fatura Adı</label>
                                        <input type="text" class="form-control" id="searchInvoiceName" placeholder="Aramak istediğiniz faturanın adını giriniz">
                                    </div>
                                    <div class="col-2">
                                        <label class="fs-6 fw-semibold mb-2">Durum</label>
                                        <select class="form-control form-control-select" id="searchInvoiceStatus">
                                            <option value="-2">Hepsi</option>
                                            <option value="1">Ödenmiş</option>
                                            <option value="0">Beklemede</option>
                                            <option value="-1">İptal Edilmiş</option>
                                        </select>
                                    </div>
                                    <div class="col-2">
                                        <label class="fs-6 fw-semibold mb-2">Fatura Tipi</label>
                                        <select class="form-control form-control-select" id="searchInvoiceType">
                                            <option value="-1">Seçiniz</option>
                                            <option value="4">Özel Fatura</option>
                                            <option value="3">Bakiye Yükleme Faturası</option>
                                            <option value="2">Sipariş Uzatım Faturası</option>
                                            <option value="1">Sipariş Faturası</option>
                                        </select>
                                    </div>
                                    <div class="col-2">
                                        <label class="fs-6 fw-semibold mb-2">Fatura Durumu</label>
                                        <select class="form-control form-control-select" id="searchInvoiceBill">
                                            <option value="-1">Seçiniz</option>
                                            <option value="1">Fatura Kesilmiş</option>
                                            <option value="0">Fatura Kesilmemiş</option>
                                        </select>
                                    </div>
                                    <div class="col-2">
                                        <label class="fs-6 fw-semibold mb-2">Sıralama Tipi</label>
                                        <select class="form-control form-control-select" id="searchInvoiceOrderType">
                                            <option value="iid">Fatura Numarası</option>
                                            <option value="ipaydate">Ödenme Tarihi</option>
                                            <option value="iprice">Ödenme Tutarı</option>
                                        </select>
                                    </div>
                                    <div class="col-2">
                                        <label class="fs-6 fw-semibold mb-2">Sıralama Türü</label>
                                        <select class="form-control form-control-select" id="searchInvoiceSort">
                                            <option value="1">Sondan Başa</option>
                                            <option value="2">Baştan Sona</option>
                                        </select>
                                    </div>
                                    <div class="col-12 d-flex justify-content-center mt-5">
                                        <a data-bs-toggle="tooltip" href="#" class="btn btnFindInvoice btn-primary mx-2">
                                            <i class="fonticon-equalizer fs-4 me-1"></i>
                                            Ara
                                        </a>
                                        <a data-bs-toggle="tooltip" href="#" class="btn btnFindInvoiceEmpty btn-warning mx-2">
                                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="15" fill="currentColor"><path fill="none" d="M0 0h24v24H0z"></path><path d="M7 4V2h10v2h5v2h-2v15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6H2V4h5zM6 6v14h12V6H6zm3 3h2v8H9V9zm4 0h2v8h-2V9z"></path></svg>
                                            Temizle
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="card pt-4 mb-6 mb-xl-9">
                            <div class="card-header border-0">
                                <div class="card-title">
                                    Kullanıcı Faturaları
                                </div>
                            </div>
                            <div class="table-responsive">
                                <table class="table w-100 table-rounded table-striped border gy-7 gs-7 mb-0">
                                    <thead>
                                        <tr class="fw-semibold fs-6 text-gray-800 border-bottom border-gray-200">
                                            <th class="text-center align-middle">#</th>
                                            <th class="text-center align-middle">Sahip</th>
                                            <th class="text-center align-middle">Açıklama</th>
                                            <th class="text-center align-middle">Durum</th>
                                            <th class="text-center align-middle">Fatura Tipi</th>
                                            <th class="text-center align-middle">Fatura Durumu</th>
                                            <th class="text-center align-middle">Tutar</th>
                                            <th class="text-center align-middle">KDV</th>
                                            <th class="text-center align-middle">İndirim</th>
                                            <th class="text-center align-middle">Toplam</th>
                                            <th class="text-center align-middle">Ödenme Methodu</th>
                                            <th class="text-center align-middle">Bitiş Tarihi</th>
                                            <th class="text-center align-middle">Oluşturulma Tarihi</th>
                                            <th class="text-center align-middle">Düzenle</th>
                                        </tr>
                                    </thead>
                                    <tbody id="invoiceList">

                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="card mb-4">
                            <div class="card-body">
                                <div class="row paganation paganationInvoice">
                                    
                                </div>
                            </div>
                        </div>
                        <div class="card mb-4">
                            <div class="card-header">
                                <div class="card-title">
                                    Toplu İşlemler
                                </div>
                            </div>
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-12 mb-9">
                                        <label class="fs-6 fw-semibold mb-2 d-block">Aksiyon Etkileşimi</label>
                                        <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Onaylanan faturalar eğer aksiyona bağlıysa işlemi gerçekleştir.</label>
                                        <div class="form-check form-switch">
                                            <input class="form-check-input" type="checkbox" role="switch" id="invoiceTotalOnContent">
                                        </div>
                                    </div>
                                    <div class="col-12 mb-9">
                                        <label class="fs-6 fw-semibold mb-2 d-block">Muhasebe Etkileşimi</label>
                                        <label class="fs-7 fw-semibold mb-2 d-block text-gray-700">Onaylanan faturaların tutarlarını muhasebeye girdi olarak ekle.</label>
                                        <div class="form-check form-switch">
                                            <input class="form-check-input" type="checkbox" role="switch" id="invoiceTotalOnAccounting">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="card-body">
                                <a href="#" class="btn btn-primary beActionInvoiceAll" data-status="1">Toplu Onayla</a>
                                <a href="#" class="btn btn-info beActionInvoiceAll" data-status="0">Toplu Beklemeye Al</a>
                                <a href="#" class="btn btn-danger beActionInvoiceAll" data-status="-1">Toplu İptal Et</a>
                                <a href="#" class="btn btn-warning beInvoiceMerge">Toplu Birleştir</a>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane fade" id="beTickets" role="tabpanel">
                        @if($ticketadminsignatures)
                        <div class="card mb-10">
                            <div class="table-responsive">
                                <table class="table w-100 table-rounded table-striped border gy-7 gs-7 mb-0">
                                    <thead>
                                        <tr class="fw-semibold fs-6 text-gray-800 border-bottom border-gray-200">
                                            <th class="text-center align-middle">#</th>
                                            <th class="text-center align-middle">Dil</th>
                                            <th class="text-center align-middle">Aralık</th>
                                            <th class="text-center align-middle">Tarih</th>
                                            <th class="text-center align-middle"></th>
                                        </tr>
                                    </thead>
                                    <tbody id="ticketSignatureList">
                                        @foreach($ticketadminsignatures as $ticketadminsignature)
                                        <tr id="{{ $ticketadminsignature['tasid'] }}Row">
                                            <td class="text-center align-middle">{{ $ticketadminsignature['tasid'] }}</td>
                                            <td class="text-center align-middle">{{ $languages[$ticketadminsignature['lid']]['lname'] }}</td>
                                            <td class="text-center align-middle"><span class="badge badge-{{ $ticketadminsignaturestypes[$ticketadminsignature['tastime']][1] }}">{{ $ticketadminsignaturestypes[$ticketadminsignature['tastime']][0] }}</span></td>
                                            <td class="text-center align-middle">{{ beSpecialTime($ticketadminsignature['tasdateline']) }}</td>
                                            <td class="text-center align-middle">
                                                <a data-bs-toggle="tooltip" title="Düzenle" href="{{ beGetRoute('admin.ticket.adminsignature.edit',['tasid' => $ticketadminsignature['tasid']]) }}" class="btn btn-primary">Düzenle</a>
                                                <a data-bs-toggle="tooltip" title="Sil" class="btn btn-danger btnDelete" data-tasid="{{ $ticketadminsignature['tasid'] }}">
                                                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="15" fill="currentColor"><path fill="none" d="M0 0h24v24H0z"/><path d="M7 4V2h10v2h5v2h-2v15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6H2V4h5zM6 6v14h12V6H6zm3 3h2v8H9V9zm4 0h2v8h-2V9z"/></svg>
                                                </a>
                                            </td>
                                        </tr>
                                        @endforeach
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        @endif
                        @if(beCheckPermission('admin_ticket_message_add',$user['group']['ugid']))
                        <div class="card mb-10">
                            <div class="card-header">
                                <div class="card-title">
                                    Destek İmzası Ekle
                                </div>
                            </div>
                            <div class="card-body">
                                <form id="signatureForm">
                                    <div class="row">
                                        <div class="col-6 mb-9">
                                            <label class="fs-6 fw-semibold mb-2">Aralık</label>
                                            <select class="form-control form-control-select" name="type">
                                                @foreach($ticketadminsignaturestypes as $key => $signaturestype)
                                                <option value="{{ $key }}">{{ $signaturestype[0] }}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                        <div class="col-6 mb-9">
                                            <label class="fs-6 fw-semibold mb-2">Dil</label>
                                            <select class="form-control form-control-select" name="language">
                                                @foreach($languages as $language)
                                                    <option value="{{ $language['lid'] }}">{{ $language['lname'] }}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                        <div class="col-12 mb-9">
                                            <label class="fs-6 fw-semibold mb-2">Mesaj</label>
                                            <textarea class="form-control form-control-flush mb-3" rows="5" placeholder="Lütfen mesajınızı yazınız" id="messageArea"></textarea>
                                        </div>
                                        <div class="col-12">
                                            <button class="btn btn-success d-block m-auto addSignature">Kaydet</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        @endif
                        <div class="card pt-4 my-6 my-xl-9">
                            <div class="card-header border-0">
                                <div class="card-title">
                                    Destek Talepleri
                                </div>
                            </div>
                            <div class="table-responsive">
                                <table class="table w-100 table-rounded table-striped border gy-7 gs-7 mb-0">
                                    <thead>
                                        <tr class="fw-semibold fs-6 text-gray-800 border-bottom border-gray-200">
                                            <th class="text-center align-middle">#</th>
                                            <th class="text-center align-middle">Sahip</th>
                                            <th class="text-center align-middle">Başlık</th>
                                            <th class="text-center align-middle">Durum</th>
                                            <th class="text-center align-middle">Son Cevap</th>
                                            <th class="text-center align-middle">Departman</th>
                                            <th class="text-center align-middle">Sorumlu</th>
                                            <th class="text-center align-middle">Etkilenen Hizmetler</th>
                                            <th class="text-center align-middle">Oluşturulma Tarihi</th>
                                            <th class="text-center align-middle">Düzenle</th>
                                        </tr>
                                    </thead>
                                    <tbody id="ticketList">

                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="card mb-4">
                            <div class="card-body">
                                <div class="row paganation paganationTicket">
                                    
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane fade" id="beOrderLogs" role="tabpanel">
                        <div class="card pt-4 mb-6 mb-xl-9">
                            <div class="card-header border-0">
                                <div class="card-title">
                                    Kullanıcı Kayıtları
                                </div>
                            </div>
                            <div class="table-responsive">
                                <table class="table w-100 table-rounded table-striped border gy-7 gs-7 mb-0">
                                    <thead>
                                        <tr class="fw-semibold fs-6 text-gray-800 border-bottom border-gray-200">
                                            <th class="text-center align-middle">#</th>
                                            <th class="text-center align-middle">Sipariş</th>
                                            <th class="text-center align-middle">Başlık</th>
                                            <th class="text-center align-middle">IP Adresi</th>
                                            <th class="text-center align-middle">Tarih</th>
                                        </tr>
                                    </thead>
                                    <tbody id="orderLogList">

                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="card mb-4">
                            <div class="card-body">
                                <div class="row paganation paganationOrderLog">
                                    
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane fade" id="beLogs" role="tabpanel">
                        <div class="card pt-4 mb-6 mb-xl-9">
                            <div class="card-header border-0">
                                <div class="card-title">
                                    Kullanıcı Kayıtları
                                </div>
                            </div>
                            <div class="table-responsive">
                                <table class="table w-100 table-rounded table-striped border gy-7 gs-7 mb-0">
                                    <thead>
                                        <tr class="fw-semibold fs-6 text-gray-800 border-bottom border-gray-200">
                                            <th class="text-center align-middle">#</th>
                                            <th class="text-center align-middle">Başlık</th>
                                            <th class="text-center align-middle">IP Adresi</th>
                                            <th class="text-center align-middle">Tarih</th>
                                        </tr>
                                    </thead>
                                    <tbody id="userLogList">

                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="card mb-4">
                            <div class="card-body">
                                <div class="row paganation paganationLog">
                                    
                                </div>
                            </div>
                        </div>
                    </div>
                    @foreach($tabs as $key => $value)
                    <div class="tab-pane fade" id="{{ $key }}" role="tabpanel">
                        {{ $value['template'] }}
                    </div>
                    @endforeach
                </div>
            </div>
        </div>
        <div class="modal fade" id="beUpdateUser" tabindex="-1" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered mw-650px">
                <div class="modal-content">
                    <form class="form" id="userForm">
                        <div class="modal-header">
                            <h2 class="fw-bold">Kullanıcı Düzenle</h2>
                            <div class="btn btn-icon btn-sm btn-active-icon-primary" data-bs-dismiss="modal">
                                <span class="svg-icon svg-icon-1">
                                    <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                        <rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="currentColor"/>
                                        <rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="currentColor"/>
                                    </svg>
                                </span>
                            </div>
                        </div>
                        <div class="modal-body py-10 px-lg-17">
                            <div class="d-flex flex-column scroll-y me-n7 pe-7" id="kt_modal_update_user_scroll" data-kt-scroll="true" data-kt-scroll-activate="{default: false, lg: true}" data-kt-scroll-max-height="auto" data-kt-scroll-dependencies="#kt_modal_update_user_header" data-kt-scroll-wrappers="#kt_modal_update_user_scroll" data-kt-scroll-offset="300px">
                                <div class="fw-bolder fs-3 rotate collapsible mb-7" data-bs-toggle="collapse" href="#kt_modal_update_user_user_info" role="button" aria-expanded="false" aria-controls="kt_modal_update_user_user_info">
                                    Kullanıcı Bilgileri
                                    <span class="ms-2 rotate-180">
                                        <span class="svg-icon svg-icon-3">
                                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                                <path d="M11.4343 12.7344L7.25 8.55005C6.83579 8.13583 6.16421 8.13584 5.75 8.55005C5.33579 8.96426 5.33579 9.63583 5.75 10.05L11.2929 15.5929C11.6834 15.9835 12.3166 15.9835 12.7071 15.5929L18.25 10.05C18.6642 9.63584 18.6642 8.96426 18.25 8.55005C17.8358 8.13584 17.1642 8.13584 16.75 8.55005L12.5657 12.7344C12.2533 13.0468 11.7467 13.0468 11.4343 12.7344Z" fill="currentColor"/>
                                            </svg>
                                        </span>
                                    </span>
                                </div>
                                <div id="kt_modal_update_user_user_info" class="collapse show">
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">Ad</label>
                                        <input type="text" class="form-control form-control-solid" placeholder="" name="name" value="{{ $user['name'] }}" />
                                    </div>
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">Soyad</label>
                                        <input type="text" class="form-control form-control-solid" placeholder="" name="surname" value="{{ $user['surname'] }}" />
                                    </div>
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">
                                            <span>Mail</span>
                                            <i class="fas fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" title="Lütfen kullanılabilir bir mail adresi girin"></i>
                                        </label>
                                        <input type="email" class="form-control form-control-solid" placeholder="" name="email" value="{{ $user['email'] }}" />
                                    </div>
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">
                                            <span>Şifre</span>
                                            <i class="fas fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" title="Lütfen şifreyi girdikten sonra kontrol ediniz"></i>
                                        </label>
                                        <input type="text" class="form-control form-control-solid" placeholder="*****" name="password" value="" />
                                    </div>
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">Yetki</label>
                                        <select class="form-control form-control-select" name="usergroup">
                                            @foreach($usergroups as $usergroup)
                                                <option value="{{ $usergroup['ugid'] }}"{{ $user['usergroup'] == $usergroup['ugid'] ? ' selected':'' }}>{{ $usergroup['ugname'] }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">Ülke</label>
                                        <select class="form-control form-control-select" name="country">
                                            @foreach($countries as $country)
                                                <option value="{{ $country['acid'] }}"{{ $userinfo['acid'] == $country['acid'] ? ' selected':'' }}>{{ $country['acname'] }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">Dil</label>
                                        <select class="form-control form-control-select" name="language">
                                            @foreach($languages as $language)
                                                <option value="{{ $language['lid'] }}"{{ $user['lid'] == $language['lid'] ? ' selected':'' }}>{{ $language['lname'] }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">Para Birimi</label>
                                        <select class="form-control form-control-select" name="currencie">
                                            @foreach($currencies as $currencie)
                                                <option value="{{ $currencie['cid'] }}"{{ $user['cid'] == $currencie['cid'] ? ' selected':'' }}>{{ $currencie['cname'] }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                </div>
                                <div class="fw-bolder fs-3 rotate collapsible mb-7" data-bs-toggle="collapse" href="#kt_modal_update_user_address" role="button" aria-expanded="false" aria-controls="kt_modal_update_user_address">
                                    Kullanıcı Detayları
                                    <span class="ms-2 rotate-180">
                                        <span class="svg-icon svg-icon-3">
                                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                                <path d="M11.4343 12.7344L7.25 8.55005C6.83579 8.13583 6.16421 8.13584 5.75 8.55005C5.33579 8.96426 5.33579 9.63583 5.75 10.05L11.2929 15.5929C11.6834 15.9835 12.3166 15.9835 12.7071 15.5929L18.25 10.05C18.6642 9.63584 18.6642 8.96426 18.25 8.55005C17.8358 8.13584 17.1642 8.13584 16.75 8.55005L12.5657 12.7344C12.2533 13.0468 11.7467 13.0468 11.4343 12.7344Z" fill="currentColor"/>
                                            </svg>
                                        </span>
                                    </span>
                                </div>
                                <div id="kt_modal_update_user_address" class="collapse show">
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">Telefon Ülke Kodu</label>
                                        <input type="text" class="form-control form-control-solid" placeholder="" name="dial" value="{{ $userinfo['uidial'] }}" />
                                    </div>
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">Telefon Numarası</label>
                                        <input type="text" class="form-control form-control-solid" placeholder="" name="phone" value="{{ $userinfo['uiphone'] }}" />
                                    </div>
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">Adres</label>
                                        <textarea class="form-control" name="address" rows="7">{{ $userinfo['uiaddress'] }}</textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer flex-center">
                            <button type="reset" class="btn btn-light me-3" data-bs-dismiss="modal">
                                İptal
                            </button>
                            <button class="btn btn-primary userSaveForm">Kaydet</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="modal fade" id="beUserMoney" tabindex="-1" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered mw-650px">
                <div class="modal-content">
                    <form class="form" id="userMoneyForm">
                        <div class="modal-header">
                            <h2 class="fw-bold">Kullanıcı Bakiye İşlemleri</h2>
                            <div class="btn btn-icon btn-sm btn-active-icon-primary" data-bs-dismiss="modal">
                                <span class="svg-icon svg-icon-1">
                                    <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                        <rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="currentColor"/>
                                        <rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="currentColor"/>
                                    </svg>
                                </span>
                            </div>
                        </div>
                        <div class="modal-body py-10 px-lg-17">
                            <div class="d-flex flex-column scroll-y me-n7 pe-7" id="kt_modal_update_user_scroll" data-kt-scroll="true" data-kt-scroll-activate="{default: false, lg: true}" data-kt-scroll-max-height="auto" data-kt-scroll-dependencies="#kt_modal_update_user_header" data-kt-scroll-wrappers="#kt_modal_update_user_scroll" data-kt-scroll-offset="300px">
                                <div class="fw-bolder fs-3 rotate collapsible mb-7" data-bs-toggle="collapse" href="#beUserMoneySet" role="button" aria-expanded="false" aria-controls="beUserMoneySet">
                                    Kullanıcı Bakiye İşlemleri
                                    <span class="ms-2 rotate-180">
                                        <span class="svg-icon svg-icon-3">
                                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                                <path d="M11.4343 12.7344L7.25 8.55005C6.83579 8.13583 6.16421 8.13584 5.75 8.55005C5.33579 8.96426 5.33579 9.63583 5.75 10.05L11.2929 15.5929C11.6834 15.9835 12.3166 15.9835 12.7071 15.5929L18.25 10.05C18.6642 9.63584 18.6642 8.96426 18.25 8.55005C17.8358 8.13584 17.1642 8.13584 16.75 8.55005L12.5657 12.7344C12.2533 13.0468 11.7467 13.0468 11.4343 12.7344Z" fill="currentColor"/>
                                            </svg>
                                        </span>
                                    </span>
                                </div>
                                <div id="beUserMoneySet" class="collapse show">
                                    <div class="row mb-7">
                                        <div class="col-md-6 mb-9">
                                            <label class="fs-6 fw-semibold mb-2">Tutar</label>
                                            <input type="text" class="form-control form-control-solid" placeholder="" name="amount"/>
                                        </div>
                                        <div class="col-md-6 mb-9">
                                            <label class="fs-6 fw-semibold mb-2">Para Birimi</label>
                                            <select class="form-control form-control-select" name="currencie">
                                                @foreach($currencies as $currencie)
                                                    <option value="{{ $currencie['cid'] }}"{{ $usercurrencie['cid'] == $currencie['cid'] ? ' selected':'' }}>{{ $currencie['cname'] }}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                        <div class="col-md-12">
                                            <label class="fs-6 fw-semibold mb-2">Türü</label>
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <div class="form-check form-check-custom form-check-solid">
                                                        <input class="form-check-input" type="radio" name="type" value="1" id="beAddMoney" checked="checked" />
                                                        <label class="form-check-label" for="beAddMoney">
                                                            Ekle
                                                        </label>
                                                    </div>
                                                </div>
                                                <div class="col-md-6">
                                                    <div class="form-check form-check-custom form-check-solid">
                                                        <input class="form-check-input" type="radio" name="type" value="-1" id="beRemoveMoney"/>
                                                        <label class="form-check-label" for="beRemoveMoney">
                                                            Çıkar
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="fv-row mb-7">
                                        <label class="fs-6 fw-semibold mb-2">Açıklama</label>
                                        <textarea class="form-control" name="description" rows="7"></textarea>
                                    </div>
                                </div>
                                <div class="fw-bolder fs-3 rotate collapsible mb-7" data-bs-toggle="collapse" href="#beUserMoneyLogs" role="button" aria-expanded="false" aria-controls="beUserMoneyLogs">
                                    İşlem Kayıtları
                                    <span class="ms-2 rotate-180">
                                        <span class="svg-icon svg-icon-3">
                                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                                <path d="M11.4343 12.7344L7.25 8.55005C6.83579 8.13583 6.16421 8.13584 5.75 8.55005C5.33579 8.96426 5.33579 9.63583 5.75 10.05L11.2929 15.5929C11.6834 15.9835 12.3166 15.9835 12.7071 15.5929L18.25 10.05C18.6642 9.63584 18.6642 8.96426 18.25 8.55005C17.8358 8.13584 17.1642 8.13584 16.75 8.55005L12.5657 12.7344C12.2533 13.0468 11.7467 13.0468 11.4343 12.7344Z" fill="currentColor"/>
                                            </svg>
                                        </span>
                                    </span>
                                </div>
                                <div id="beUserMoneyLogs" class="collapse show">
                                    <div class="fv-row mb-7">
                                        <div class="table-responsive">
                                            <table class="table w-100 table-rounded table-striped border gy-7 gs-7 mb-0">
                                                <thead>
                                                    <tr class="fw-semibold fs-6 text-gray-800 border-bottom border-gray-200">
                                                        <th class="text-center align-middle">#</th>
                                                        <th class="text-center align-middle">İşlem</th>
                                                        <th class="text-center align-middle">Tarih</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    @foreach($userlogs as $userlog)
                                                    @if($userlog['ltype'] != 'money_change')
                                                        @continue
                                                    @endif
                                                    <tr>
                                                        <td class="text-center align-middle">{{ $userlog['lid'] }}</td>
                                                        <td class="text-center align-middle">{{ $userlog['lmessage'] }}</td>
                                                        <td class="text-center align-middle">{{ beSpecialTime($userlog['ldateline']) }}</td>
                                                    </tr>
                                                    @endforeach
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer flex-center">
                            <button type="reset" class="btn btn-light me-3" data-bs-dismiss="modal">
                                İptal
                            </button>
                            <button class="btn btn-primary userMoneySaveForm">Kaydet</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
@section('js')
<script src="assets/plugins/custom/tinymce/tinymce.bundle.js"></script>
<script>
    var orderpage = 1,invoicepage = 1;
    $(document).ready(function(){
        $(".form-control-select").select2();
        var options = {selector:"#messageArea",height:"480",entity_encoding:"raw",verify_html:false,plugins:'code searchreplace autolink directionality visualblocks visualchars image link media codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap emoticons autosave fullscreen',toolbar: "undo redo print spellcheckdialog formatpainter | blocks fontfamily fontsize | bold italic underline forecolor backcolor | link image | alignleft aligncenter alignright alignjustify | code"};
        if(KTThemeMode.getMode() === "dark"){
            options["skin"] = "oxide-dark";
            options["content_css"] = "dark";
        }
        tinymce.init(options);
    });
    $(".beLoginAdmin").on("click",function(){
        var uid = $(this).data("uid");
        $.ajax({
            url: "{{ beGetRoute('admin.user.loginfromadmin.post') }}",
            type: "post",
            async: true,
            data: {uid:uid},
            dataType: "json",
            crossDomain: true,
            success: function(response){
                if(response.status){
                    Swal.fire("Başarılı",response.message,"success");
                    setTimeout(function(){
                        window.location.href = response.url;
                    },1000);
                }
                else{
                    Swal.fire("Bir Hata Oluştu",response.message,"error");
                }
            }
        });
    });
    var wait1 = false;
    var wait2 = false;
    $(".nameSaveForm").on("click",function(){
        if(!wait2){
            wait2 = true;
            $(".nameSaveForm").html('Bekleyin <span class="spinner-border spinner-border-sm align-middle ms-2"></span>');
            $.ajax({
                url: "{{ beGetRoute('admin.user.name.save.post') }}",
                type: "post",
                async: true,
                data: $("#nameForm").serialize()+"&uid={{ $user['uid'] }}",
                dataType: "json",
                crossDomain: true,
                success: function(response){
                    wait2 = false;
                    $(".nameSaveForm").html("Kaydet");
                    if(response.status){
                        Swal.fire("Başarılı",response.message,"success");
                    }
                    else{
                        Swal.fire("Bir Hata Oluştu",response.message,"error");
                    }
                }
            });
        }
        else{
            Swal.fire("Bir Hata Oluştu","Lütfen işlemin tamamlanmasını bekleyin","error");
        }
        return false;
    });
    $(".phoneSaveForm").on("click",function(){
        if(!wait2){
            wait2 = true;
            $(".phoneSaveForm").html('Bekleyin <span class="spinner-border spinner-border-sm align-middle ms-2"></span>');
            $.ajax({
                url: "{{ beGetRoute('admin.user.phone.save.post') }}",
                type: "post",
                async: true,
                data: $("#phoneForm").serialize()+"&uid={{ $user['uid'] }}",
                dataType: "json",
                crossDomain: true,
                success: function(response){
                    wait2 = false;
                    $(".phoneSaveForm").html("Kaydet");
                    if(response.status){
                        Swal.fire("Başarılı",response.message,"success");
                    }
                    else{
                        Swal.fire("Bir Hata Oluştu",response.message,"error");
                    }
                }
            });
        }
        else{
            Swal.fire("Bir Hata Oluştu","Lütfen işlemin tamamlanmasını bekleyin","error");
        }
        return false;
    });
    $(".noteSaveForm").on("click",function(){
        if(!wait2){
            wait2 = true;
            $(".noteSaveForm").html('Bekleyin <span class="spinner-border spinner-border-sm align-middle ms-2"></span>');
            $.ajax({
                url: "{{ beGetRoute('admin.user.note.save.post') }}",
                type: "post",
                async: true,
                data: $("#noteForm").serialize()+"&uid={{ $user['uid'] }}",
                dataType: "json",
                crossDomain: true,
                success: function(response){
                    wait2 = false;
                    $(".noteSaveForm").html("Kaydet");
                    if(response.status){
                        Swal.fire("Başarılı",response.message,"success");
                    }
                    else{
                        Swal.fire("Bir Hata Oluştu",response.message,"error");
                    }
                }
            });
        }
        else{
            Swal.fire("Bir Hata Oluştu","Lütfen işlemin tamamlanmasını bekleyin","error");
        }
        return false;
    });
    var wait3 = false;
    $(".settingSaveForm").on("click",function(){
        if(!wait3){
            wait3 = true;
            $(".settingSaveForm").html('Bekleyin <span class="spinner-border spinner-border-sm align-middle ms-2"></span>');
            $.ajax({
                url: "{{ beGetRoute('admin.user.setting.save.post') }}",
                type: "post",
                async: true,
                data: $("#settingForm").serialize()+"&uid={{ $user['uid'] }}",
                dataType: "json",
                crossDomain: true,
                success: function(response){
                    wait3 = false;
                    $(".settingSaveForm").html("Kaydet");
                    if(response.status){
                        Swal.fire("Başarılı",response.message,"success");
                    }
                    else{
                        Swal.fire("Bir Hata Oluştu",response.message,"error");
                    }
                }
            });
        }
        else{
            Swal.fire("Bir Hata Oluştu","Lütfen işlemin tamamlanmasını bekleyin","error");
        }
        return false;
    });
    var wait4 = false;
    $(".userSaveForm").on("click",function(){
        if(!wait4){
            wait4 = true;
            $(".userSaveForm").html('Bekleyin <span class="spinner-border spinner-border-sm align-middle ms-2"></span>');
            $.ajax({
                url: "{{ beGetRoute('admin.user.save.post') }}",
                type: "post",
                async: true,
                data: $("#userForm").serialize()+"&uid={{ $user['uid'] }}",
                dataType: "json",
                crossDomain: true,
                success: function(response){
                    wait4 = false;
                    $(".userSaveForm").html("Kaydet");
                    $("#beUpdateUser").modal("hide");
                    if(response.status){
                        Swal.fire("Başarılı",response.message,"success");
                    }
                    else{
                        Swal.fire("Bir Hata Oluştu",response.message,"error");
                    }
                }
            });
        }
        else{
            Swal.fire("Bir Hata Oluştu","Lütfen işlemin tamamlanmasını bekleyin","error");
        }
        return false;
    });
    var wait5 = false;
    $(".userMoneySaveForm").on("click",function(){
        if(!wait4){
            wait4 = true;
            $(".userMoneySaveForm").html('Bekleyin <span class="spinner-border spinner-border-sm align-middle ms-2"></span>');
            $.ajax({
                url: "{{ beGetRoute('admin.user.money.update.post') }}",
                type: "post",
                async: true,
                data: $("#userMoneyForm").serialize()+"&uid={{ $user['uid'] }}",
                dataType: "json",
                crossDomain: true,
                success: function(response){
                    wait4 = false;
                    $(".userMoneySaveForm").html("Kaydet");
                    $("#beUserMoney").modal("hide");
                    if(response.status){
                        Swal.fire("Başarılı",response.message,"success");
                    }
                    else{
                        Swal.fire("Bir Hata Oluştu",response.message,"error");
                    }
                }
            });
        }
        else{
            Swal.fire("Bir Hata Oluştu","Lütfen işlemin tamamlanmasını bekleyin","error");
        }
        return false;
    });
    var wait6 = false;
    $(".addSignature").on("click",function(){
        if(!wait6){
            $(".addSignature").html('Bekleyin <span class="spinner-border spinner-border-sm align-middle ms-2"></span>');
            wait6 = true;
            var message = tinymce.activeEditor.getContent();
            $.ajax({
                url: "{{ beGetRoute('admin.ticket.adminsignature.add.post') }}",
                type: "post",
                async: true,
                data: $("#signatureForm").serialize()+"&message="+message+"&user={{ $user['uid'] }}",
                dataType: "json",
                crossDomain: true,
                success: function(response){
                    wait6 = false;
                    $(".addSignature").html('Kaydet');
                    if(response.status){
                        tinymce.remove();
                        Swal.fire("Başarılı",response.message,"success");
                        setTimeout(function(){
                            location.reload();
                        },1000)
                    }
                    else{
                        Swal.fire("Bir Hata Oluştu",response.message,"error");
                    }
                }
            });	
        }	
        else{
            Swal.fire("Bir Hata Oluştu","Lütfen işlemin tamamlanmasını bekleyin","error");
        }
        return false;
    });
    $(document).ready(function(){
        beSearchOrder(-2,0,"",0,0);
        beSearchInvoice("",-2,-1,-1,"",0,"iid");
        $.ajax({
            url: "{{ beGetRoute('admin.ticket.search.post') }}",
            type: "post",
            data: {status:"all",uid:{{ $user['uid'] }},page:0,pageitems:20},
            dataType: "json",
            crossDomain: true,
            success: function(response){
                if(response.status){
                    $("#ticketList").empty().append(response.html);
                    $(".paganationTicket").empty().append(response.paganation);
                }
                else{
                    Swal.fire("Bir Hata Oluştu",response.message,"error");
                }
            }
        });
        $.ajax({
            url: "{{ beGetRoute('admin.order.logs.search.post') }}",
            type: "post",
            data: {uid:{{ $user['uid'] }},sort:0,page:0,pageitems:40},
            dataType: "json",
            crossDomain: true,
            success: function(response){
                if(response.status){
                    $("#orderLogList").empty().append(response.html);
                    $(".paganationOrderLog").empty().append(response.paganation);
                }
                else{
                    Swal.fire("Bir Hata Oluştu",response.message,"error");
                }
            }
        });
        $.ajax({
            url: "{{ beGetRoute('admin.user.logs.search.post') }}",
            type: "post",
            data: {uid:{{ $user['uid'] }},sort:0,page:0,pageitems:40},
            dataType: "json",
            crossDomain: true,
            success: function(response){
                if(response.status){
                    $("#userLogList").empty().append(response.html);
                    $(".paganationLog").empty().append(response.paganation);
                }
                else{
                    Swal.fire("Bir Hata Oluştu",response.message,"error");
                }
            }
        });
    });
    $("#orderList").on("click",".btnDelete",function(){
        var upid = $(this).data("upid");
        Swal.fire({
            html: "Bu siparişi silmek istediğinize emin misiniz ?",
            icon: "info",
            buttonsStyling: false,
            showCancelButton: true,
            confirmButtonText: "Onaylıyorum",
            cancelButtonText: "Vazgeçtim",
            customClass: {
                confirmButton: "btn btn-primary",
                cancelButton: "btn btn-danger"
            }
        }).then((result) => {
            if(result.isConfirmed) {
                $.ajax({
                    url: "{{ beGetRoute('admin.order.delete.post') }}",
                    type: "post",
                    data: {upid:upid},
                    dataType: "json",
                    crossDomain: true,
                    success: function(response){
                        if(response.status){
                            $("#"+upid+"Row").remove();
                            Swal.fire("Başarılı",response.message,"success");
            
                        }
                        else{
                            Swal.fire("Bir Hata Oluştu",response.message,"error");
                        }
                    }
                });	
            }
        });
        return false;
    });
    $(".beActionOrderAll").on("click",function(){
        var status = parseInt($(this).data("status"));
        var upids = [];
        $(".beOrderCheckbox").each(function(index){
            if($(this).is(":checked")){
                upids.push($(this).data("upid"))
            }
        });
        var onmodule = $("#orderTotalOnModule").is(":checked") == true ? 1:0
        $.ajax({
            url: "{{ beGetRoute('admin.order.status.save.post') }}",
            type: "post",
            async: true,
            data: {upids:upids,status:status,onmodule:onmodule},
            dataType: "json",
            crossDomain: true,
            success: function(response){
                wait1 = false;
                if(response.status){
                    Swal.fire("Başarılı",response.message,"success");
                }
                else{
                    Swal.fire("Bir Hata Oluştu",response.message,"error");
                }
            }
        });
        return false;
    });
    $("#ticketSignatureList").on("click",".btnDelete",function(){
        var tasid = $(this).data("tasid");
        Swal.fire({
            html: "Bu imzayı silmek istediğinize emin misiniz ?",
            icon: "info",
            buttonsStyling: false,
            showCancelButton: true,
            confirmButtonText: "Onaylıyorum",
            cancelButtonText: "Vazgeçtim",
            customClass: {
                confirmButton: "btn btn-primary",
                cancelButton: "btn btn-danger"
            }
        }).then((result) => {
            if(result.isConfirmed) {
                $.ajax({
                    url: "{{ beGetRoute('admin.ticket.adminsignature.delete.post') }}",
                    type: "post",
                    data: {tasid:tasid},
                    dataType: "json",
                    crossDomain: true,
                    success: function(response){
                        if(response.status){
                            $("#ticketSignatureList > #"+tasid+"Row").remove();
                            Swal.fire("Başarılı",response.message,"success");
            
                        }
                        else{
                            Swal.fire("Bir Hata Oluştu",response.message,"error");
                        }
                    }
                });	
            }
        });
        return false;
    });
    $("#invoiceList").on("click",".btnDelete",function(){
        var iid = $(this).data("iid");
        Swal.fire({
            html: "Bu faturayı silmek istediğinize emin misiniz ?",
            icon: "info",
            buttonsStyling: false,
            showCancelButton: true,
            confirmButtonText: "Onaylıyorum",
            cancelButtonText: "Vazgeçtim",
            customClass: {
                confirmButton: "btn btn-primary",
                cancelButton: "btn btn-danger"
            }
        }).then((result) => {
            if(result.isConfirmed) {
                $.ajax({
                    url: "{{ beGetRoute('admin.invoice.delete.post') }}",
                    type: "post",
                    data: {iid:iid},
                    dataType: "json",
                    crossDomain: true,
                    success: function(response){
                        if(response.status){
                            $("#invoiceList > #"+iid+"Row").remove();
                            Swal.fire("Başarılı",response.message,"success");
            
                        }
                        else{
                            Swal.fire("Bir Hata Oluştu",response.message,"error");
                        }
                    }
                });	
            }
        });
        return false;
    });
    $(".beActionInvoiceAll").on("click",function(){
        if(!wait1){
            wait1 = true;
            var status = parseInt($(this).data("status"));
            var iids = [];
            $(".beInvoiceCheckbox").each(function(index){
                if($(this).is(":checked")){
                    iids.push($(this).data("iid"))
                }
            });
            var oncontent = $("#invoiceTotalOnContent").is(":checked") == true ? 1:0
            var onaccounting = $("#invoiceTotalOnAccounting").is(":checked") == true ? 1:0
            $.ajax({
                url: "{{ beGetRoute('admin.invoice.status.save.post') }}",
                type: "post",
                async: true,
                data: {iids:iids,status:status,oncontent:oncontent,onaccounting:onaccounting},
                dataType: "json",
                crossDomain: true,
                success: function(response){
                    wait1 = false;
                    if(response.status){
                        Swal.fire("Başarılı",response.message,"success");
                    }
                    else{
                        Swal.fire("Bir Hata Oluştu",response.message,"error");
                    }
                }
            });
        }
        else{
            Swal.fire("Bir Hata Oluştu","Lütfen işlemin tamamlanmasını bekleyin","error");
        }
        return false;
    });
    $(".beInvoiceMerge").on("click",function(){
        if(!wait1){
            wait1 = true;
            var iids = [];
            $(".beInvoiceCheckbox").each(function(index){
                if($(this).is(":checked")){
                    iids.push($(this).data("iid"))
                }
            });
            $.ajax({
                url: "{{ beGetRoute('admin.invoice.merge.post') }}",
                type: "post",
                async: true,
                data: {iids:iids},
                dataType: "json",
                crossDomain: true,
                success: function(response){
                    wait1 = false;
                    if(response.status){
                        Swal.fire("Başarılı",response.message,"success");
                        setTimeout(function(){
                            location.reload();
                        },1000);
                    }
                    else{
                        Swal.fire("Bir Hata Oluştu",response.message,"error");
                    }
                }
            });
        }
        else{
            Swal.fire("Bir Hata Oluştu","Lütfen işlemin tamamlanmasını bekleyin","error");
        }
        return false;
    });
    $("#ticketList").on("click",".btnDelete",function(){
        var tid = $(this).data("tid");
        Swal.fire({
            html: "Bu talebi silmek istediğinize emin misiniz ?",
            icon: "info",
            buttonsStyling: false,
            showCancelButton: true,
            confirmButtonText: "Onaylıyorum",
            cancelButtonText: "Vazgeçtim",
            customClass: {
                confirmButton: "btn btn-primary",
                cancelButton: "btn btn-danger"
            }
        }).then((result) => {
            if(result.isConfirmed) {
                $.ajax({
                    url: "{{ beGetRoute('admin.ticket.delete.post') }}",
                    type: "post",
                    data: {tid:tid},
                    dataType: "json",
                    crossDomain: true,
                    success: function(response){
                        if(response.status){
                            $("#ticketList > #"+tid+"Row").remove();
                            Swal.fire("Başarılı",response.message,"success");
            
                        }
                        else{
                            Swal.fire("Bir Hata Oluştu",response.message,"error");
                        }
                    }
                });	
            }
        });
        return false;
    });
    $(".paganation").on("click",".goPaganation",function(){
        var type = $(".nav-link.active").data("type");
        var page = parseInt($(this).data("page"));
        switch(type){
            case "Order" :
                orderpage = page;
                $(".btnFindOrder").trigger("click");
                break;
            case "Invoice" :
                invoicepage = page;
                $(".btnFindInvoice").trigger("click");
                break;
            case "Ticket" :
                $.ajax({
                    url: "{{ beGetRoute('admin.ticket.search.post') }}",
                    type: "post",
                    data: {status:"all",uid:{{ $user['uid'] }},page:page,pageitems:20},
                    dataType: "json",
                    crossDomain: true,
                    success: function(response){
                        if(response.status){
                            $("#ticketList").empty().append(response.html);
                            $(".paganationTicket").empty().append(response.paganation);
                        }
                        else{
                            Swal.fire("Bir Hata Oluştu",response.message,"error");
                        }
                    }
                });
                break;
            case "OrderLog" :
                $.ajax({
                    url: "{{ beGetRoute('admin.order.logs.search.post') }}",
                    type: "post",
                    data: {uid:{{ $user['uid'] }},sort:0,page:page,pageitems:40},
                    dataType: "json",
                    crossDomain: true,
                    success: function(response){
                        if(response.status){
                            $("#orderLogList").empty().append(response.html);
                            $(".paganationOrderLog").empty().append(response.paganation);
                        }
                        else{
                            Swal.fire("Bir Hata Oluştu",response.message,"error");
                        }
                    }
                });
                break;
            case "Log" :
                $.ajax({
                    url: "{{ beGetRoute('admin.user.logs.search.post') }}",
                    type: "post",
                    data: {uid:{{ $user['uid'] }},sort:0,page:page,pageitems:40},
                    dataType: "json",
                    crossDomain: true,
                    success: function(response){
                        if(response.status){
                            $("#userLogList").empty().append(response.html);
                            $(".paganationLog").empty().append(response.paganation);
                        }
                        else{
                            Swal.fire("Bir Hata Oluştu",response.message,"error");
                        }
                    }
                });
                break;
        }
        return false;
    });
    $(".btnFindOrder").on("click",function(){
        var status = $("#searchOrderStatus").val();
        if(status < 0 || status > 2){
            status = -2;
        }
        var product = $("#searchOrderProduct").val();
        if(!product){
            product = 0;
        }
        var data = $("#searchOrderData").val();
        var options = $("#searchOrderOptions").val();
        if(!options){
            options = 0;
        }
        var sort = $("#searchOrderSort").val();
        if(!sort){
            sort = 0;
        }
        beSearchOrder(status,product,data,options,sort);
        return false;
    });
    $(".btnFindOrderEmpty").on("click",function(){
        $("#searchOrderStatus option:first").attr("selected","selected");
        $("#searchOrderProduct option:first").attr("selected","selected");
        $("#searchOrderData").val("");
        $("#searchOrderOptions option:first").attr("selected","selected");
        $("#searchOrderSort option:first").attr("selected","selected");
        beSearchOrder(-2,0,"",0,0);
        return false;
    });
    function beSearchOrder(status,product,data,options,sort){
        $.ajax({
            url: "{{ beGetRoute('admin.order.search.post') }}",
            type: "post",
            data: {status:status,product:product,user:{{ $user['uid'] }},data:data,options:options,sort:sort,page:orderpage},
            dataType: "json",
            crossDomain: true,
            success: function(response){
                if(response.status){
                    $(".paganationOrder").empty().append(response.paganation);
                    $("#orderList").empty().append(response.html);
                }
                else{
                    Swal.fire("Bir Hata Oluştu",response.message,"error");
                }
            }
        });
    }
    $(".btnFindInvoice").on("click",function(){
        var name = $("#searchInvoiceName").val();
        var status = $("#searchInvoiceStatus").val();
        if(status < 0 || status > 2){
            status = -2;
        }
        var type = $("#searchInvoiceType").val();
        if(!type){
            type = -1;
        }
        var bill = $("#searchInvoiceBill").val();
        if(!bill){
            bill = -1;
        }
        var ordertype = $("#searchInvoiceOrderType").val();
        var sort = $("#searchInvoiceSort").val();
        if(!sort){
            sort = 0;
        }
        beSearchInvoice(name,status,type,bill,sort,ordertype);
        return false;
    });
    $(".btnFindInvoiceEmpty").on("click",function(){
        $("#searchInvoiceName").val("");
        $("#searchInvoiceStatus option:first").attr("selected","selected");
        $("#searchInvoiceType option:first").attr("selected","selected");
        $("#searchInvoiceBill option:first").attr("selected","selected");
        $("#searchInvoiceSort option:first").attr("selected","selected");
        $("#searchInvoiceOrderType option:first").attr("selected","selected");
        beSearchInvoice("",-2,-1,-1,0,"iid");
        return false;
    });
    function beSearchInvoice(name,status,type,bill,sort,ordertype){
        $.ajax({
            url: "{{ beGetRoute('admin.invoice.search.post') }}",
            type: "post",
            data: {name:name,status:status,type:type,bill:bill,user:{{ $user['uid'] }},sort:sort,ordertype:ordertype,page:invoicepage},
            dataType: "json",
            crossDomain: true,
            success: function(response){
                if(response.status){
                    $(".paganationInvoice").empty().append(response.paganation);
                    $("#invoiceList").empty().append(response.html);
                }
                else{
                    Swal.fire("Bir Hata Oluştu",response.message,"error");
                }
            }
        });
    }
</script>
@endsection