<?php if (session("user_id")) { ?>
    <div class="app-rightbar sticky-header">
        <div class="app-rightbar-header">
            <div class="pt-5 pb-4 px-4">
                <div class="row align-items-center">
                    <div class="col">
                        <h3 class="rm-title">Hızlı Menü</h3>
                    </div>
                    <div class="col-auto">
                        <button class="btn ahbtn bs-3" onclick="javascript:rightMenuToggle();">
                            <i class="fas fa-times"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <div class="app-rb-content">
            <div class="app-rb-body">

                <div class="app-rh-nav mt-4 pt-1 mb-4">
                    <ul class="nav nav-tabs nav-custom" role="tablist">
                        <!--<li class="nav-item active">
                            <button class="nav-link active" id="nav-updatesR-tab" data-bs-toggle="tab" data-bs-target="#nav-updatesR" type="button" role="tab" aria-controls="nav-updatesR" aria-selected="true">Güncellemeler</button>
                        </li>-->
                        <li class="nav-item active">
                            <button class="nav-link active" aria-current="page" id="nav-newsR-tab" data-bs-toggle="tab" data-bs-target="#nav-newsR" type="button" role="tab" aria-controls="nav-newsR" aria-selected="false">Duyurular</button>
                        </li>
                        <li class="nav-item">
                            <button class="nav-link" id="nav-sssR-tab" data-bs-toggle="tab" data-bs-target="#nav-sssR" type="button" role="tab" aria-controls="nav-sssR" aria-selected="false">S.S.S</button>
                        </li>
                    </ul>
                </div>

                <div class="tab-content" id="nav-tabContent">


                    <!--<div class="tab-pane fade show active" id="nav-updatesR" role="tabpanel" aria-labelledby="nav-updatesR-tab">

                        <div class="card card-updates can-up">
                            <div class="can-content">
                                <div class="can-top">
                                    <div class="can-cat">
                                        <span>Fiyat Yükseldi</span>
                                    </div>
                                    <div class="can-time">
                                        <i class="far fa-clock icon"></i>
                                        <span>2021-05-10 17:57:01</span>
                                    </div>
                                </div>
                                <div class="can-head">
                                    <h2 class="can-title">142 - Telegram Görüntüleme</h2>
                                </div>
                            </div>
                        </div>

                        <div class="card card-updates can-down">
                            <div class="can-content">
                                <div class="can-top">
                                    <div class="can-cat">
                                        <span>Fiyat Düştü</span>
                                    </div>
                                    <div class="can-time">
                                        <i class="far fa-clock icon"></i>
                                        <span>2021-05-10 17:57:01</span>
                                    </div>
                                </div>
                                <div class="can-head">
                                    <h2 class="can-title">299 - Instagram Kaydetme | Max 5K</h2>
                                </div>
                            </div>
                        </div>

                        <div class="card card-updates can-del">
                            <div class="can-content">
                                <div class="can-top">
                                    <div class="can-cat">
                                        <span>Servis Silindi</span>
                                    </div>
                                    <div class="can-time">
                                        <i class="far fa-clock icon"></i>
                                        <span>2021-05-10 17:57:01</span>
                                    </div>
                                </div>
                                <div class="can-head">
                                    <h2 class="can-title">299 - Instagram Kaydetme | Max 5K</h2>
                                </div>
                            </div>
                        </div>

                        <div class="card card-updates can-add">
                            <div class="can-content">
                                <div class="can-top">
                                    <div class="can-cat">
                                        <span>Servis Eklendi</span>
                                    </div>
                                    <div class="can-time">
                                        <i class="far fa-clock icon"></i>
                                        <span>2021-05-10 17:57:01</span>
                                    </div>
                                </div>
                                <div class="can-head">
                                    <h2 class="can-title">299 - Instagram Kaydetme | Max 5K</h2>
                                </div>
                            </div>
                        </div>


                    </div>--><!-- tab 2 -->

                    <div class="tab-pane fade show active" id="nav-newsR" role="tabpanel" aria-labelledby="nav-newsR-tab">

                        <?php if ($duyurular) :
                            foreach ($duyurular as $duyuru) : ?>
                                <div class="card card-announce">
                                    <div class="can-content">
                                        <div class="can-top">
                                            <div class="can-cat" style="background: <?= $duyuru['duyuru_daire_color'] ?>; color: <?= $duyuru['duyuru_icon_color'] ?>;">
                                                <i class="<?= $duyuru['duyuru_icon'] ?>"></i>
                                                <span>Genel</span>
                                            </div>
                                            <div class="can-time">
                                                <i class="far fa-clock icon"></i>
                                                <span><?= str_date($duyuru['duyuru_date']) ?></span>
                                            </div>
                                        </div>
                                        <div class="can-head">
                                            <h2 class="can-title"><?= $duyuru['duyuru_title'] ?></h2>
                                        </div>
                                        <div class="can-body">
                                            <div class="can-text">
                                                <?= htmlspecialchars_decode($duyuru['duyuru_content']) ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            <?php endforeach;
                        else : ?>
                            <p>Henüz duyuru eklenmemiş.</p>
                        <?php endif; ?>

                    </div><!-- tab-content -->

                    <div class="tab-pane fade" id="nav-sssR" role="tabpanel" aria-labelledby="nav-sssR-tab">
                        <div class="faq-ss-tabs">
                            <div class="home-ss-tab">
                                <div class="ss-tab-head">
                                    <div class="row">
                                        <div class="col">
                                            Takipçilerim Düşüyor Ne Yapmalıyım?
                                        </div>
                                        <div class="col-auto align-self-center right-p">
                                            <i class="fas fa-plus"></i>
                                            <i class="fas fa-minus"></i>
                                        </div>
                                    </div>
                                </div>
                                <div class="ss-tab-content">
                                    Hesaplarınıza gönderdiğimiz takipçiler tamamen kişisel hesaplardan oluşmaktadır ve gönderilen hesapların takipten çıkma özgürlüğü bulunmaktadır. Bir örnek verecek olursak; siz nasıl ki tanımadığınız kişileri takip etmek istemezsiniz bu durumda aynıdır takip edenler sizleri tanımadığı için takibi geri çekmektedir.
                                </div>
                            </div>
                            <!-- home-ss-tab end -->

                            <div class="home-ss-tab">
                                <div class="ss-tab-head">
                                    <div class="row">
                                        <div class="col">
                                            API Nedir?
                                        </div>
                                        <div class="col-auto align-self-center right-p">
                                            <i class="fas fa-plus"></i>
                                            <i class="fas fa-minus"></i>
                                        </div>
                                    </div>
                                </div>
                                <div class="ss-tab-content">
                                    Application Programming Interface olarak bilinen programlar arası haberleşmeyi sağlayan bir ara yüzdür. Sitemizde bulunan API dokümanımız yardımı ile kendi internet sitenize bizim API’mizi bağlayıp satış yapabilirsiniz. Bunun için basit programlama bilgisi sahibi olmanız gerekir. Eğer bir SMM panel sahibiyseniz SMM sağlayıcınız ile iletişime geçerek bizim API’mizi bağlatabilirsiniz. API bağlantıları konusunda teknik destek sağlamamaktayız.
                                </div>
                            </div>
                            <!-- home-ss-tab end -->

                            <div class="home-ss-tab">
                                <div class="ss-tab-head">
                                    <div class="row">
                                        <div class="col">
                                            Nasıl Bakiye Yüklerim?
                                        </div>
                                        <div class="col-auto align-self-center right-p">
                                            <i class="fas fa-plus"></i>
                                            <i class="fas fa-minus"></i>
                                        </div>
                                    </div>
                                </div>
                                <div class="ss-tab-content">
                                    Panelimiz üzerinde tek bir bakiye yükleme yöntemi bulunur. Sisteme entegreli olan PayTR alt yapısı ile 7/24 otomatik olarak bakiye yükleyebilirsiniz. PayTR ile iki farklı seçeneğiniz vardır. Birincisi kredi kartı ile otomatik yükleme yapmak, ikincisi havale yöntemi ile yükleme yapmak. Eğer havale yöntemi ile PayTR üzerinden ödeme yapmak isterseniz havale gönderimini PayTR hesaplarına gönderdikten sonra havale bildirimi yapmanız gerekir.
                                </div>
                            </div>
                            <!-- home-ss-tab end -->

                        </div>
                    </div><!-- tab 3 -->
                </div>




            </div><!-- app-rb-body -->
        </div>
    </div><!-- rightbar-end -->





    </div>
    <div class="bs-toast">
        <div class="bs-toast-content">
            <div class="toast-text">Panoya kopyalandı</div>
            <button class="toast-times" onclick="removeToast();"><i class="fas fa-times"></i></button>
        </div>
    </div>

    <div class="app-navbar">
        <div class="row">
            <div class="col text-center align-self-center">
                <a href="/">
                    <i class="fal fa-home navbar-icon"></i>
                </a>
            </div>
            <div class="col text-center align-self-center">
                <a href="/orders" class="active">
                    <i class="fal fa-chart-pie-alt navbar-icon"></i>
                </a>
            </div>
            <div class="col text-center align-self-center">
                <a href="/">
                    <img src="<?= theme("assets/images"); ?>/nav-btn.svg" class="navbar-mid-icon" alt="">
                </a>
            </div>
            <div class="col text-center align-self-center">
                <a href="/tickets">
                    <i class="fal fa-comment-lines navbar-icon"></i>
                </a>
            </div>
            <div class="col text-center align-self-center">
                <a href="/account">
                    <i class="fal fa-cog navbar-icon"></i>
                </a>
            </div>
        </div>
    </div>
<?php } else { ?>
    
    <footer class="smmspot-na-footer">
        <div class="smmspot-ftop">
            <div class="container">
                <div class="row">
                    <div class="col-md-auto text-center text-md-start mb-4 mb-md-0">
                        <a href="/">
                            <img src="{SITE_LOGO}" alt="{SITE_TITLE}" width="190" title="{SITE_TITLE}">
                        </a>
                    </div>
                    <div class="col-md mt-4 mt-md-0 text-lg-end text-md-end text-center">
                        <ul class="smmspot-fmenu">
                            <li><a href="/">Ana Sayfa</a></li>
                            <li><a href="/services">Servisler</a></li>
                            <li><a href="/api">Api</a></li>
                            <li><a href="/blog">Blog</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="smmspot-fbot text-center">
            <div class="container">
                <div class="row">
                    <div class="smmspot-fb-title mb-5">
                        <h3>Sosyal Medya’da bugünden yükselmeye<br /> başlamaya hazırmısın ?</h3>
                    </div>

                    <div class="smmspot-fb-btn d-flex justify-content-center mb-5">
                        <div class="row">
                            <div class="col-md-auto col-12 mb-4 mb-lg-0">
                                <a href="/services" class="btn btn-secondary btn-border btn-block">
                                    Servisleri Gör
                                </a>
                            </div>
                            <div class="col-md-auto col-12">
                                <a href="/register" class="btn btn-primary btn-border btn-block">
                                    Kayıt Ol
                                </a>
                            </div>
                        </div>
                    </div>

                    <div class="smmspot-fb-copy">
                        © Copyright 2021 | Theme by <span>Elinsoft - Smmspot</span> | All Rights Reserved | Powered by <span>Moon Panel</span>
                    </div>
                </div>
            </div>
        </div>
    </footer><!-- ./footer -->

    <div class="modal fade" id="login" tabindex="-1" aria-labelledby="loginModalLabel" aria-hidden="true">
   <div class="modal-dialog modal-xl">
		 <div class="modal-content">
		 
			 <div class="container">
				 <div class="row align-self-center">
					 <div class="col-lg-10 offset-lg-1">

						<div class="login-box">
							<div class="row">
								<div class="col-lg-6">
									<div class="login-form">
										<div class="hlb-header mb-5">
											<div class="row text-center">
												<div class="col-auto mx-auto login-logo d-flex align-items-center">
													
													  <img src="{SITE_LOGO}" alt="{SITE_TITLE}" width="190" title="{SITE_TITLE}">
													
													<span>'a hoşgeldiniz.</span>
												</div>
											</div>
										</div>
										<form id="login" onsubmit="return false;" action="toggle" class="#login">
										  
											<div class="form-group">
												<div class="fga mb-4">
												<label class="fla">Kullanıcı Adı</label>
													<div class="fg">
														<div class="fg-icon">
															<i class="fal fa-user"></i>
														</div>
														<input type="text" class="fg-control" id="username" name="username">
													</div>
												</div>
											</div>

											<div class="form-group">
												<div class="fga mb-4">
												<label class="fla">Şifre</label>
													<div class="fg">
														<div class="fg-icon">
															<i class="fal fa-unlock-alt"></i>
														</div>
														<input type="password" class="fg-control" id="password" name="password">
													</div>
												</div>
											</div>

										   <div class="row mt-2">
											  <div class="col-6 py-2 mb-2">
												 <div class="form-check">
													<input type="checkbox" class="form-check-input" name="benihatirla" value="1" id="remember">
													<label class="form-check-label" for="remember">Beni Hatırla</label>                     
													<span class="checkpoint"></span>
												 </div>
											  </div>
											  <div class="col-6 py-2 text-right">
												 <a href="{LINK_FORGOT_PASSWORD}" class="frgpass">Şifremi Unuttum?</a>
											  </div>
										   </div>
										   
										   <div class="form-group">
										      
												<div class="fga mb-4">
												<?php 
												    	$dcq = $db->from('integrations')->where('app_id', 1)->first();
                                                    	$recaptcha = json_decode($dcq['app_data'], true);
                                                    	$recaptcha_text = "";
                                                    	if ($recaptcha["login_page"]) {
                                                    		$recaptcha_text = '<div class="form-group"><div class="g-recaptcha" data-sitekey="' . $recaptcha["site_key"] . '"></div></div>';
                                                    	}
												?>
												<?=$recaptcha_text?>
												</div>
											</div>
											  
											<button type="submit" class="btn btn-primary btn-xl btn-block mt-4">Giriş Yap</button>
										</form>
										<div class="log-bottom mt-5">
											<span>Hesabınız yok mu? <a href="../register">Kayıt Olun.</a></span>
										</div>
									</div>
								</div>
								<div class="col-lg-6">
									<div class="login-left">
										<div class="p-1">
											<img src=" <?= theme("assets/images"); ?>/login-card.png" class="img-fluid" />
											<div class="p-4 text-center">
												<h1>Harcadıkça Siz Kazanın!</h1>
												<p>Lorem Ipsum, dizgi ve baskı endüstrisinde kullanılan mıgır metinlerdir.</p>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>

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

      </div>
   </div>
</div>
<?php } ?>




<script src="<?= theme("assets/js/selectbox.js"); ?>"></script>

<script>
    function HideEverything() {
        $('.ordernumbers').hide();
        $('.transactionid').hide();
    }
    $(document).ready(function() {
        $('.subject').change(function() {
            HideEverything();
            if ($(this).val() == 'Sipariş') {
                $('.ordernumbers').show();
                $('#requestRefill').prop('checked', true);
                $('#paymentPaypal').prop('checked', false);
            }
            if ($(this).val() == 'Ödeme') {
                $('.transactionid').show();
                $('#paymentPaypal').prop('checked', true);
                $('#requestRefill').prop('checked', false);
            }
        });
        $('#submit').click(function(e) {
            e.preventDefault();
            console.log('working');
            $TheSubject = $('.subject:checked').val();
            $TheRequest = $('.second-options:checked').val();
            if ($TheSubject == 'Sipariş') {
                $final = 'Sipariş No: ' + $('#ordernumbers').val() + '\n\n' + $('#message').val();
            } else if ($TheSubject == 'Ödeme') {
                $final = 'Ödeme No:' + $('#transactionid').val() + '\n\n' + $('#message').val();

            } else {
                $final = $('#message').val();
            }
            $('#alldata').val($final);
            $('.subject:checked').val($TheSubject);
            //submit
            $('#submit').submit();
        });
    });
</script>



<script>
    $(window).bind('load', function() {
        $("div#order_link").html('' +
            '<div class="fga mb-4">' +
            '<label class="fla" for="orderLink">{{lang('neworder.link')}}</label>' +
            '<div class="fg">' +
            '<div class="fg-icon"><i class="far fa-link"></i></div>' +
            '<input class="fg-control" name="OrderForm[link]" value="" type="text" id="field-orderform-fields-link">' +
            '</div>' +
            '</div>');

        $("div#order_quantity").html('' +
            '<div class="fga mb-4">' +
            '<label class="fla" for="orderQuantitiy">{{lang('neworder.quantity')}}</label>' +
            '<div class="fg">' +
            '<div class="fg-icon"><i class="far fa-sort-numeric-up-alt"></i></div>' +
            '<input class="fg-control" name="OrderForm[quantity]" value="" type="number" id="field-orderform-fields-quantity">' +
            '</div>' +
            '</div>');

        $("div#order_phone").html('' +
            '<div class="fga mb-4">' +
            '<label class="fla" for="orderQuantitiy">{{lang('addfunds.phone')}}</label>' +
            '<div class="fg">' +
            '<div class="fg-icon"><i class="far fa-mobile-android-alt"></i></div>' +
            '<input class="fg-control" name="AddFoundsForm[fields][phone]" value="" type="text" id="field-phone">' +
            '</div>' +
            '</div>');

    });
</script>
<?= htmlspecialchars_decode($settings['footer_code']); ?>

<script type="text/javascript">
    var messages = {
        UNKNOWN_ERROR: "{UNKNOWN_ERROR}",
        PROCESS_ERROR: "{PROCESS_ERROR}"
    };
</script>





</body>

</html>




<script type="text/javascript" src="<?= theme("assets/smmspot/js/jquery.min.js"); ?>"></script>
<script type="text/javascript" src="<?= theme("assets/smmspot/js/global/flpbonhmkq9tsp29.js"); ?>"></script>
<script type="text/javascript" src="<?= theme("assets/smmspot/js/global/a4kdpfesx15uh7ae.js"); ?>"></script>
<script type="text/javascript" src="<?= theme("assets/smmspot/js/global/596z6ya3isgxcipy.js"); ?>"></script>
<script type="text/javascript" src="<?= theme("assets/smmspot/js/global/4etkgu7ilwdsbob4.js"); ?>"></script>
<script type="text/javascript" src="<?= theme("assets/smmspot/js/global/wnzsoolloslhfumj.js"); ?>"></script>
<script type="text/javascript" src="<?= theme("assets/smmspot/js/global/sbgf5yc3n0rddhlm.js"); ?>"></script>
<script type="text/javascript" src="<?= theme("assets/smmspot/js/global/20q6laa252m5mpth.js"); ?>"></script>
<!--<script type="text/javascript" >
     window.modules.layouts = {"theme_id":3,"auth":0};   </script>
  <script type="text/javascript" >
     window.modules.signin = [];   </script>
  <script type="text/javascript" >
      </script>-->

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/jquery.inputmask.bundle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script src="<?= public_url("system/js/bootstrap-datepicker.min.js"); ?>"></script>
<script src="<?= public_url("system/js/alertify.js"); ?>"></script>
<script src="<?= public_url("system/js/main.js"); ?>"></script>
{INTEGRATIONS}
<script>
    $("#phone").inputmask({
        "mask": "09999999999"
    });
</script>

<script>
    $("#refill-time-btn").click(function() {
        var btn = $(this);
        var data_time = btn.attr('data-time');
        alert(data_time);
    });
</script>



<script>
    var hash = location.hash;
    var loginModal = new bootstrap.Modal(document.getElementById('login'));

    if (loginModal) {
        document.getElementById('login').addEventListener('hide.bs.modal', (event) => {
            setTimeout(function() {
                history.replaceState("", document.title, window.location.pathname);
            }, 1);
        });

        document.getElementById('login').addEventListener('show.bs.modal', event => {
            window.location.hash = 'login';
        })

    }

    if (hash === '#login') {
        loginModal.show();
    }
</script>


<script>
    function getUrlParameter(sParam) {
        var sPageURL = decodeURIComponent(window.location.search.substring(1));
        var sURLVariables = sPageURL.split('&');
        var sParameterName;
        var i;
        for (i = 0; i < sURLVariables.length; i++) {
            sParameterName = sURLVariables[i].split('=');
            if (sParameterName[0] === sParam) {
                return sParameterName[1] === undefined ? true : sParameterName[1];
            }
        }
    }



    var select_service_id = getUrlParameter("service_id");
    if (select_service_id) {
        var selectSerCatID = window.modules.siteOrder.service[select_service_id].cid;
        let orderCat = document.getElementById('category');
        let orderSer = document.getElementById('service');

        $(function() {
            orderCat.querySelector('[selected]').removeAttribute('selected');
            console.log(selectSerCatID);
            orderCat.querySelector('[value="' + selectSerCatID + '"]').setAttribute('selected', 'selected');
            orderCat.value = selectSerCatID;

            var event = document.createEvent('HTMLEvents');
            event.initEvent('change', true, false);
            orderCat.dispatchEvent(event);

            setTimeout(() => {
                let controlSel = orderSer.querySelector('[selected]')
                if (controlSel) {
                    controlSel.removeAttribute('selected');
                }
                console.log(select_service_id);
                orderSer.querySelector('[value="' + select_service_id + '"]').setAttribute('selected', 'selected');
                orderSer.value = select_service_id;
                orderSer.dispatchEvent(event);

            }, 500);
        });
    }
</script>



<!---------------------------------------------------------------------------------->