 <?php

 require_once(__DIR__."/../xpanel/inc/vt.php");
 session_start();
 if(!isset($_SESSION["sepet"])){
    $_SESSION["sepet"] = array();
}

$useragent=$_SERVER['HTTP_USER_AGENT'];
function isMobile(){
    $useragent=$_SERVER['HTTP_USER_AGENT'];
    if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($useragent,0,4))){
        return true;

    }
    return false;
}
function seo($s) { 

    $tr = array('ş','Ş','ı','I','İ','ğ','Ğ','ü','Ü','ö','Ö','Ç','ç','(',')','/',':',',');

    $eng = array('s','s','i','i','i','g','g','u','u','o','o','c','c','','','-','-','');

    $s = str_replace($tr,$eng,$s);

    $s = strtolower($s);

    $s = preg_replace('/&amp;amp;amp;amp;amp;amp;amp;amp;amp;.+?;/', '', $s);

    $s = preg_replace('/\s+/', '-', $s);

    $s = preg_replace('|-+|', '-', $s);

    $s = preg_replace('/#/', '', $s);

    $s = str_replace('.', '', $s);

    $s = trim($s, '-');

    return $s;

}

if (!$_SESSION["dil"]){
        $_SESSION["dil"]="tr";
    }
 
    require("includes/dil/".$_SESSION["dil"].".php");
  
    $dilicon["tr"]="https://i.hizliresim.com/sJSLhz.png";
    $dilicon["en"]="https://i.hizliresim.com/JVQVZ3.png"; 
    $dilicon["ru"]="https://i.hizliresim.com/yFKsaX.png";
    $dilicon["ar"]="https://i.hizliresim.com/qb8cmN.png";
    
?> 



<?php
$ayar = $dbh->query("SELECT * FROM general_settings WHERE id = 1 ", PDO::FETCH_ASSOC);
if ($ayar->rowCount()) {
    foreach ($ayar as $ayar) {
    }
}
$ayar = cevir("general_settings",$ayar,$_SESSION["dil"]); 
?>

<?php
$hakkimizda = $dbh->query("SELECT * FROM about_us WHERE id = 1 ", PDO::FETCH_ASSOC);
if ($hakkimizda->rowCount()) {
    foreach ($hakkimizda as $hakkimizda) {
    }
}
?>

<?php
$seo = $dbh->query("SELECT * FROM page_seo WHERE id = 1 ", PDO::FETCH_ASSOC);
if ($seo->rowCount()) {
    foreach ($seo as $seo) {
    }
}
$seo = cevir("page_seo",$seo,$_SESSION["dil"]); 
?>

<!doctype html>
<html lang="tr">
<head> 
    <meta charset="utf-8">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon" href="img/<?=$ayar['home_favicon'];?>" />
    <link rel="apple-touch-startup-image" href="img/<?=$ayar['home_favicon'];?>"> 
    <link rel="Shortcut Icon"  href="img/<?=$ayar['home_favicon'];?>"  type="image/x-icon">
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">

    <!-- Bootstrap CSS -->
    <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,900" rel="stylesheet">

    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/swiper.css">
    <link rel="stylesheet" href="css/extra.css">
    <link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
    <link href="css/style.css" type="text/css" rel="stylesheet">
    <!-- Responsive CSS -->
    <link href="css/responsive.css" type="text/css" rel="stylesheet">
    <!-- Font CSS -->
    <link href="css/gogle_sans_font.css" type="text/css" rel="stylesheet">
    <!--  For icon -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
    <link rel="stylesheet" href="css/owl.carousel.min.css">
    <link rel="stylesheet" href="css/owl.theme.default.css">
    <link rel="stylesheet" href="css/fancybox/jquery.fancybox.css"></link>

    <!-- Slick CSS -->
    <link rel="stylesheet" type="text/css" href="js/slick/slick.css">
    <link rel="stylesheet" type="text/css" href="js/slick/slick-theme.css">

    <script type="text/javascript" src="js/sweetalert2.all.min.js"></script>
    
    <link rel="stylesheet" type="text/css" href="../assets/sweetalert/sweetalert.css">

</head>


<div class="site_wrapper">

    <div class="header">
        <div class="logo w-full p-0">
            <a href="anasayfa"><img class="white_menu" src="img/<?=$ayar['foto'];?>" alt="Logo">
                <img class="black_menu" src="img/<?=$ayar['foto_dark'];?>" alt="Logo">
            </a>
        </div>
        <div class="menu col-auto">
            <nav>
                <ul>
                    <li class="col only_desktop">
                        <a href="sepetim">
                            <img class="white_menu" src="images/icons/white/market.svg">
                            <img class="black_menu" src="images/icons/market.svg">
                            <span class="market_count" id="market_count">

                                <?php 

                                foreach ($_SESSION['sepet'] as $siparis => $siparisdetay) {
                                    $array=$siparisdetay;
                                    $adet+=$array['qty'];
                                }
                                if(empty( $adet)){
                                   $adet=0;
                               }

                               ?>

                               <?php 
                               echo  $adet;
                               ?>

                           </span>
                       </a>
                   </li>
                   <li class="col only_desktop">
                    <a href="#" class="showclick" data-dismiss="showby" data-class="flex" data-target="#menu_box">
                        <img class="white_menu" src="images/icons/white/search.svg">
                        <img class="black_menu" src="images/icons/search.svg">

                    </a>
                </li>
                <li class="col only_desktop">
                    <div class="dropdown dropdown-alpha languageDropdownBtn">
                        <a id="languageDropdownBtn" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            <img class="white_menu" src="images/icons/white/language.svg">
                            <img class="black_menu" src="images/icons/language.svg">
                        </a>
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="languageDropdownBtn">
                            <a class="dropdown-item dropdown-alpha-item" rel="nofollow" href="dil.php?dil=tr">
                                <div class="dropdown-alpha-item__icon dropdown-alpha-item__icon-sm w-8"><img src="https://i.hizliresim.com/sJSLhz.png" alt="en"></div>
                                <div>
                                    <div class="dropdown-alpha-item__title">
                                        <?php echo $dil['005'];?>
                                        <i class="fas fa-check-circle"></i>
                                    </div>
                                    <div class="dropdown-alpha-item__desc">
                                    Türkçe görüntüleyin
                                    </div>
                                </div>
                            </a>
                            <a class="dropdown-item dropdown-alpha-item" rel="nofollow" href="dil.php?dil=en">
                                <div class="dropdown-alpha-item__icon dropdown-alpha-item__icon-sm w-8"><img src="https://i.hizliresim.com/JVQVZ3.png" alt="en"></div>
                                <div>
                                    <div class="dropdown-alpha-item__title">
                                        <?php echo $dil['006'];?>
                                    </div>
                                    <div class="dropdown-alpha-item__desc">
                                       Parstech in English
                                    </div>
                                </div>
                            </a>
                            <!--<a class="dropdown-item dropdown-alpha-item" rel="nofollow" href="dil.php?dil=ru">
                                <div class="dropdown-alpha-item__icon dropdown-alpha-item__icon-sm w-8"><img src="https://i.hizliresim.com/yFKsaX.png" alt="ru"></div>
                                <div>
                                    <div class="dropdown-alpha-item__title">
                                        Russian
                                    </div>
                                    <div class="dropdown-alpha-item__desc">
                                        Просмотреть Parstech на турецком языке
                                    </div>
                                </div>
                            </a>
                            <a class="dropdown-item dropdown-alpha-item" rel="nofollow" href="dil.php?dil=ar">
                                <div class="dropdown-alpha-item__icon dropdown-alpha-item__icon-sm w-8"><img src="https://i.hizliresim.com/qb8cmN.png" alt="ar"></div>
                                <div>
                                    <div class="dropdown-alpha-item__title">
                                        Arabic
                                    </div>
                                    <div class="dropdown-alpha-item__desc">
                                        مشاهدة ملف Parstech باللغة التركية
                                    </div>
                                </div>
                            </a>-->
                        </div>
                    </div>
                </li>
                <li class="col only_desktop">
                    <a href="#"  class="showclick" data-dismiss="showby" data-class="flex" data-target=".menu_large">
                        <img class="white_menu" src="images/icons/white/menu.svg">
                        <img class="black_menu" src="images/icons/menu.svg">
                    </a>
                </li>
                <div class="toggle_switch col relative">
                    <div class="radio-container"> <input type="checkbox" name="theme" id="radio-1"> <label for="radio-1"><span class="radio">Coffee</span></label> </div>
                </div>
            </ul>
        </nav>
    </div>
</div>
<div class="menu_large">
    <div class="menu_large_bg hideclick" data-dismiss="hideby" data-target=".menu_large"></div>
    <div class="menu_large_content">
        <div class="menu_large_close hideclick" data-dismiss="hideby" data-target=".menu_large"><i class="zmdi zmdi-close"></i></div>

        <div class="logo col-auto">
            <a href="/"><img class="white_menu" src="images/logo.png" alt="Parstech">
                <img class="black_menu" src="images/logo_black.png" alt="Parstech">
            </a>
        </div>
        <ul>
            <li><a href="anasayfa"><img src="images/icons/white/home.png" alt="" title=""><span><?php echo $dil['001'];?></span></a></li>
            <li><a href="menu"><img src="images/icons/white/food.png" alt="" title=""><span><?php echo $dil['007'];?></span></a></li>
            <?php if(!$_SESSION['user']){ ?>
                <li><a href="giris"><img src="images/icons/white/users.png" alt="" title=""><span><?php echo $dil['008'];?></span></a></li>
                <li><a href="kayit-ol"><img src="images/icons/white/reg.png" alt="" title=""><span><?php echo $dil['009'];?></span></a></li>
            <?php }else{ ?>
                <li><a href="hesabim"><img src="images/icons/white/usss.png" alt="" title=""><span><?php echo $dil['010'];?></span></a></li>

            <?php } ?>
            <li><a href="garson-cagir"><img src="images/icons/white/favorites.png" alt="" title=""><span><?php echo $dil['011'];?></span></a></li>
            <li><a href="hesap-iste"><img src="images/icons/white/search.png" alt="" title=""><span><?php echo $dil['012'];?></span></a></li>
            <li><a href="siparis-durumu"><img src="images/icons/white/stat.png" alt="" title=""><span><?php echo $dil['013'];?></span></a></li>
            <li><a href="hakkimizda"><img src="images/icons/white/about.png" alt="" title=""><span><?php echo $dil['014'];?></span></a></li>
            <li><a href="bize-ulasin"><img src="images/icons/white/contact.png" alt="" title=""><span><?php echo $dil['015'];?></span></a></li>
            <li><a href="sosyal-medya"><img src="images/icons/white/social.png" alt="" title=""><span><?php echo $dil['016'];?></span></a></li> 
        </ul>
    </div>
</div>