<?php if (!session('user_id')) : ?>


    <!doctype html>
    <html lang="en">

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <?php if (@$meta) : ?>
            <title><?php if ($meta['title']) : ?><?= $meta['title'] ?><?php else : ?>{PAGE_TITLE} | {SITE_TITLE}<?php endif; ?></title>
            <meta name="description" content="<?php if ($meta['desc']) : ?><?= $meta['desc'] ?><?php else : ?>{SITE_DESC}<?php endif; ?>" />
            <meta name="keywords" content="<?php if ($meta['keyw']) : ?><?= $meta['keyw'] ?><?php else : ?>{SITE_KEYW}<?php endif; ?>" />
        <?php else : ?>
            <title>{PAGE_TITLE} | {SITE_TITLE}</title>
            <meta name="description" content="{SITE_DESC}" />
            <meta name="keywords" content="{SITE_KEYW}" />
        <?php endif; ?>
        <link rel="shortcut icon" href="{SITE_FAVO}" />
        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css">
        <link href="<?= theme("assets/css/bootstrap.min.css"); ?>?v=<?= time() ?>" rel="stylesheet">
        <link href="<?= theme("assets/css/main.min.css"); ?>?v=<?= time() ?>" rel="stylesheet">
        <link rel="stylesheet" href="<?= public_url("system/css/alertify.css"); ?>">
        <script src="https://www.google.com/recaptcha/api.js" async defer></script>
        <script type="text/javascript">
            var _url = "{LINK_POST}";
        </script>
        <?= htmlspecialchars_decode($settings['header_code']); ?>

    </head>



    <body>
        <!-- start body -->

        <div class="preloader">
            <!-- start preloader -->
            <div class="preloader-container">
                <svg version="1.1" id="L5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
                    <circle fill="#675cda" stroke="none" cx="6" cy="50" r="6">
                        <animateTransform attributeName="transform" dur="1s" type="translate" values="0 15 ; 0 -15; 0 15" repeatCount="indefinite" begin="0.1" />
                    </circle>
                    <circle fill="#675cda" stroke="none" cx="30" cy="50" r="6">
                        <animateTransform attributeName="transform" dur="1s" type="translate" values="0 10 ; 0 -10; 0 10" repeatCount="indefinite" begin="0.2" />
                    </circle>
                    <circle fill="#675cda" stroke="none" cx="54" cy="50" r="6">
                        <animateTransform attributeName="transform" dur="1s" type="translate" values="0 5 ; 0 -5; 0 5" repeatCount="indefinite" begin="0.3" />
                    </circle>
                </svg>
                <span>Yükleniyor</span>
            </div>
        </div><!-- end preloader -->

        <div id="coodiv-header" class="d-flex mx-auto flex-column moon-edition">
            <!-- start header -->
            <div class="bg_overlay_header">
                <div id="particles-bg"></div>
                <div class="bg-img-header-new-moon">&nbsp;</div>
                <span class="header-shapes shape-01"></span>
                <span class="header-shapes shape-02"></span>
                <span class="header-shapes shape-03"></span>
            </div>
            <!-- Fixed navbar -->
            <nav id="coodiv-navbar-header" class="navbar navbar-expand-md fixed-header-layout">
                <div class="container main-header-coodiv-s">
                    <a class="navbar-brand" href="../">
                        <img class="w-logo" src="{SITE_LOGO}" alt="" />
                        <img class="b-logo" src="{SITE_DARKLOGO}" alt="" />
                    </a>
                    <button class="navbar-toggle offcanvas-toggle menu-btn-span-bar ml-auto" data-toggle="offcanvas" data-target="#offcanvas-menu-home">
                        <span></span>
                        <span></span>
                        <span></span>
                    </button>
                    <div class="collapse navbar-collapse navbar-offcanvas" id="offcanvas-menu-home">
                        <ul class="navbar-nav ml-auto">
                           <?php foreach($mainmenus as $row): if($row['menu_type'] == 2): ?>
                        <?php
                        
                                ?>
                                        <li>
                                            <a class="nav-link" href="<?=isset($siteLinks[$row['menu_link']]['url']) ? $siteLinks[$row['menu_link']]['url'] : $row['menu_link'] ?>"><?=$row['menu_title']?></a>
                                        </li>

					<?php endif; endforeach; ?>
                        </ul>
                    </div>
                    <ul class="header-user-info-coodiv">
                        <li class="dropdown"><a id="header-login-dropdown" href="../register">Kayıt Ol</a></li>
                    </ul>
                </div>
            </nav>
            <div class="mt-auto header-top-height"></div>
            <main class="container mb-auto">
                <div class="row">
                    <div class="col-md-12 d-flex mx-auto flex-column">
                        <div class="mb-auto"></div>
                        <h3 class="mt-3 main-header-text-title"><span>{SITE_TITLE}</span>SERVİSLER</h3>
                    </div>
                    <div style="text-align: center;margin: auto;">
                        <a style="background: white;border-radius: 100px;padding:13px 18px;font-size:25px;color: #f64c50;" href="#services"><i class="fas fa-arrow-down"></i></a>
                    </div>
                </div>

            </main>
            <div class="mt-auto"></div>
        </div>

        <section id="services" class="padding-100-0-10 position-relative">
            <div class="container">


                <div class="banner-servers-box">
                    <div class="counter-placeholder"></div>
                    <div class="banner-text-left">
                        <h5>{SITE_TITLE}<strong>Servisler</strong></h5>
                        <p>En hızlı ve uygun fiyatlı servislerimize göz atın.</p>
                    </div>
                    <a class="benchmarks-link" href="#">Servisler</a>
                </div>

                
                <?php
                foreach ($categories as $category) {



                    $query = $db->from('services')

                        ->where('category_id', $category['category_id'])

                        ->where('service_status', 1)

                        ->orderby('service_number', 'ASC')

                        ->all();



                    if ($query) {

                        $category_name = json_decode($category["category_name"], true);

                        foreach ($category_name as $details) {

                            if ($details["lang"] == 1) {

                                $category_name = $details["name"];
                            }

                            if ($details["lang"] == $lang) {

                                $category_name = $details["name"];

                                break;
                            }
                        }

                        /* Kategori Buraya */

                        echo '<div class="row justify-content-left server-tabls-head" style="background: #ffc107;text-transform: none;font-weight: bold;font-size: 22px;">
                <div class="col-md-12 text-center">' . $category_name . '</div>
            </div>';

                        $services = $query;

                        foreach ($services as $service) {

                            $service_name = json_decode($service["service_name"], true);

                            foreach ($service_name as $details) {

                                if ($details["lang"] == 1) {

                                    $service_name = $details["name"];
                                }

                                if ($details["lang"] == $lang) {

                                    $service_name = $details["name"];

                                    break;
                                }
                            }

                            $service_desc = json_decode($service["service_desc"], true);

                            foreach ($service_desc as $details) {

                                if ($details["lang"] == 1) {

                                    $service_desc = $details["name"];
                                }

                                if ($details["lang"] == $lang) {

                                    $service_desc = $details["name"];

                                    break;
                                }
                            }

                            $charge = offer($service);

                            /* Servisler Buraya */

                            echo "

				<div class='server-tabls-body'>
                    <div class='row justify-content-left server-tabls-row best-one'>
                        <div class='col-md-1'><span class='server-spects-for-mobile'>ID</span><b>#</b>$service[service_id]</div>
    
    					<div class='col-md-6'><span class='server-spects-for-mobile'>Servis</span><span style='text-align:right;'>$service_name</span></div>
    
    					<div class='col-md-2'><span class='server-spects-for-mobile'>Ücret</span>{CURRENCY_SYMBOL}$charge</div>
    
    					<div class='col-md-1'><span class='server-spects-for-mobile'>Minimum</span>$service[service_min]</div>
    
    					<div class='col-md-1'><span class='server-spects-for-mobile'>Maksimum</span>$service[service_max]</div>";

                            if ($settings['service_speed'] == 1) :

                                echo '<div class="col-md-1"><span class="server-spects-for-mobile">Ortalama Süre</span>".getservicetime(' . $service["service_id"] . ')."</div>';

                            endif;

                            echo "<div class='col-md-1'><span class='server-spects-for-mobile'>Açıklama</span><button style='background: #d4d4d4;border-color: #9a9a9a;padding: 0 5px;' class='btn btn-primary btn-xs' data-toggle='collapse' id='desc_$service[service_id]' onclick='openDesc($service[service_id])' data-desc='" . htmlspecialchars_decode($service_desc) . "'>&#128065;</button></div>
    
    				</div>
				</div>";
                        }
                    }
                }
                ?>
            </div>
        </section>

        <div id="descModal" style="top:150px;" class="modal fade" role="dialog">
            <div class="modal-dialog">

                <!-- Modal content-->
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title">{SERVICES_DESC}</h4>
                        <button type="button" class="close" data-dismiss="modal">&times;</button>

                    </div>
                    <div class="modal-body" id="modalContent"></div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    </div>
                </div>

            </div>
        </div>
        <section class="footer-section">
            <div class="container">
                <div class="row">
                    <div class="col-md-8 quiq-links-footer">
                        <h5 class="quiq-links-footer-title text-center">Hızlı Linkler</h5>
                        <div class="row">
                            <ul class="col-md-4 quiq-links-footer-ul text-center nolist">
                                <li><a href="../">Instagram Takipçi Satın Al</a></li>
                                <li><a href="../">Instagram Beğeni Satın Al</a></li>
                                <li><a href="../">Instagram İzlenme Satın Al</a></li>
                                <li><a href="../">Instagram Yorum Satın Al</a></li>
                            </ul>
                            <ul class="col-md-4 quiq-links-footer-ul text-center nolist">
                                <li><a href="../">YouTube Abone Satın Al</a></li>
                                <li><a href="../">YouTube Beğeni Satın Al</a></li>
                                <li><a href="../">YouTube İzlenme Satın Al</a></li>
                                <li><a href="../">YouTube Yorum Satın Al</a></li>
                            </ul>
                            <ul class="col-md-4 quiq-links-footer-ul text-center nolist">
                                <li><a href="../">Twitter Takipçi Satın Al</a></li>
                                <li><a href="../">Twitter ReTweet Satın Al</a></li>
                                <li><a href="../">Twitter Fav Satın Al</a></li>
                                <li><a href="../">Twitter TT Satın Al</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <h5 class="quiq-links-footer-title text-center">İletişim</h5>
                        <div class="mailbox"><strong>E-Posta: </strong><?= $settings['admin_iletisim'] ?></div>
                        <div class="phonebox"><strong>Telefon Numarası: </strong><?= $settings['admin_phone'] ?></div>
                    </div>

                </div>


                <div class="row justify-content-between final-footer-area mr-tp-40">
                    <div class="final-footer-area-text text-center" style="margin: auto;">
                        © Copyright 2021 | {SITE_TITLE}
                    </div>
                </div>
            </div>
        </section>
        <?= htmlspecialchars_decode($settings['footer_code']); ?>
        <script type="text/javascript">
            var messages = {
                UNKNOWN_ERROR: "{UNKNOWN_ERROR}",
                PROCESS_ERROR: "{PROCESS_ERROR}"
            };
        </script>
        <script src="<?= theme("assets/js/jquery.min.js"); ?>"></script>
        <script src="<?= theme("assets/js/popper.min.js"); ?>"></script>
        <script src="<?= theme("assets/js/bootstrap.min.js"); ?>"></script>
        <script src="<?= theme("assets/js/template-scripts.js"); ?>"></script>
        <script src="<?= theme("assets/js/flickity.pkgd.min.js"); ?>"></script>
        <script src="<?= theme("assets/owlcarousel/owl.carousel.min.js"); ?>"></script>
        <script src="<?= theme("assets/js/parallax.min.js"); ?>"></script>
        <script src="<?= theme("assets/js/mailchamp.js"); ?>"></script>
        <script src="<?= theme("assets/js/bootstrap.offcanvas.min.js"); ?>"></script>
        <script src="<?= theme("assets/js/jquery.touchSwipe.min.js"); ?>"></script>
        <script src="<?= theme("assets/js/particles-code.js"); ?>"></script>
        <script src="<?= theme("assets/js/particles.js"); ?>"></script>
        <script src="<?= theme("assets/js/smoothscroll.js"); ?>"></script>
        <script src="<?= public_url("system/js/bootstrap-datepicker.min.js"); ?>"></script>
        <script src="<?= public_url("system/js/alertify.js"); ?>?v=<?= time() ?>"></script>
        <script src="<?= public_url("system/js/main.js"); ?>"></script>
    </body>

    </html>

<?php else : ?>
    <?php require view('theme/header'); ?>
    <div class="page">
        
            <style>
                    .well {
	min-height: 20px;
	padding: 19px;
	margin-bottom: 20px;
	
	border: 1px solid #dadada;
	color: #636363;
	-webkit-box-shadow: inset 0 1px 1px rgb(255 255 255 / 18%);
	box-shadow: inset 0 1px 1px rgb(0 0 0 / 12%);
}

body {
	font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
}

.wellhead {
	background: #f6f6f8;
	border-top: 1px solid #dadada;
	border-left: 1px solid #dadada;
	border-right: 1px solid #dadada;
	padding: 5px;
	text-align: center;
	font-weight: 600;
	border-top-left-radius: 10px;
	border-top-right-radius: 10px;
	font-size: 19px;
}
            
                
                .well.mo {
                    border-radius: 10px;
                    box-shadow: 0px 0px 8px 1px rgb(0 0 0 / 38%);
                    background-color: #f6f6f8;
                }

                @media only screen and (min-width: 728px) {

                    .well.mo,
                    .text-center.wellmo {
                        display: none;
                    }
                }

                @media only screen and (max-width: 728px) {
                    .well.do {
                        display: none;
                    }
                }

                .well.mo span {
                    float: right;
                    color: crimson;
                }
            </style>
            <div class="card">
                <?= htmlspecialchars_decode($page_content['page_content']) ?>
            </div>
            
            
            {SERVICES_LIST2}
            <div class="well do">
                <div class="orders-btn py-3">

							<div class="col-md-12">
								<div class="services-search">
									<input type="text" id="searchService" placeholder="Ara" class="form-control">
								</div>
							</div>

				</div>
				<hr style="size:6px">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th class="text-center">#</th>
                            <th>{SERVICES_NAME}</th>
                            <th>{SERVICES_CHARGE}</th>
                            <th class="text-center">{SERVICES_MIN}</th>
                            <th class="text-center">{SERVICES_MAX}</th>
                            <?php if ($settings['service_speed'] == 1) : ?>
                                <th class="text-center">Ortalama Süre</th>
                            <?php endif; ?>
                            <th class="text-center">{SERVICES_DESC}</th>
                        </tr>
                    </thead>
                    <tbody id="myTable" class="servicestableclass">
                        {SERVICES_LIST}
                    </tbody>
                </table>
            </div>
        

    </div>

    <div id="descModal" class="modal fade" role="dialog">
        <div class="modal-dialog">

            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">{SERVICES_DESC}</h4>
                </div>
                <div class="modal-body" id="modalContent"></div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div>

        </div>
    </div>



<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>
	$(document).ready(function() {
		$("#searchService").on("keyup", function() {
			var value = $(this).val().toLowerCase();
			$(".servicestableclass tr").filter(function() {
				$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
			});
		});
	});
</script>


    <?php require view('theme/footer'); ?>
<?php endif; ?>