<!DOCTYPE html PUBLIC>
<html lang="vi" itemscope itemtype="http://schema.org/WebPage">
<head>
    <meta charset="UTF-8">
    <base href="<?=$Protocol.$config_url?>/">
    <link id="favicon" rel="shortcut icon" href="<?=_upload_hinhanh_l.$favicon['thumb_'.$lang]?>" type="image/x-icon" />
    <link rel="canonical" href="<?=getCurrentPageURL();?>" />
    <?php if($com!='index' && empty($id)){
        $seo_page = fetch_array("select * from #_component where name='$com' ");
        $seo_title = empty($seo_page["title"])?$title_detail:$seo_page["title"];
        $seo_description = empty($seo_page["description"])?$title_detail:$seo_page["description"];
        $seo_keywords = empty($seo_page["keywords"])?seoKeywords($title_detail):$seo_page["keywords"];
        echo '<title>'.$seo_title.'</title>';
        echo '<meta name="description" content="'.strip_tags($seo_description).'">';
        echo '<meta name="keywords" content="'.$seo_keywords.'">';
    }else{ ?>
        <title><?php if (!empty($row_detail["title"])) {
            echo $row_detail["title"];
        } else {
            echo $row_setting['title'];
        }
        ?></title>
        <meta name="description" content="<?php if (!empty($row_detail["description"])) {
            echo $row_detail["description"];
            } else {
                echo $row_setting['description'];
            }
            ?>">
            <meta name="keywords" content="<?php if (!empty($row_detail["keywords"])) {
                echo $row_detail["title"];
                } else {
                    echo $row_setting['keywords'];
                }
                ?>">
            <?php } ?>
            <?php include _lib."web_schema.php";?>
            <meta name="theme-color" content="#005600">
            <meta name="robots" content="noodp,index,follow" />
            <meta name="google" content="notranslate" />
            <meta name='revisit-after' content='1 days' />
            <meta name="geo.placename" content="<?=$row_setting['diachi_'.$lang]?>">
            <meta name="author" content="<?=$row_setting['ten_'.$lang]?>">
            <!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
            <?php if($config_responsive){ ?>
                <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=1" />
            <?php }else ?>
            <meta name="viewport" content="width=1366" />
            <?php if(empty($share_facebook)){ ?>
                <meta property="og:type" content="website" />
                <meta property="og:image" content="<?php if(!empty($img_share)) echo $img_share; else echo 'upload/hinhanh/'.$row_logo["photo_vi"] ?>" />
                <meta property="og:title" content="<?php if(!empty($seo_title)) echo $seo_title; else echo $row_setting['title']; ?>" />
                <meta property="og:site_name" content="<?=$row_setting['ten_'.$lang]?>" />
                <meta property="og:url" content="<?php if(!empty($url_share)) echo $url_share; else echo getCurrentPageURL(); ?>" />
                <meta property="og:description" content="<?php if(!empty($seo_description)) echo $seo_description; else echo $row_setting['description']; ?>" />
                <!-- Share Image Facebook -->
                <meta property="og:image:width" content="675" />
                <meta property="og:image:height" content="1000" />
            <?php }else echo $share_facebook; ?>
            <!-- Twitter Card -->
            <meta name="twitter:card" content="summary" />
            <meta name="twitter:title" content="<?php if(!empty($seo_title)) echo $seo_title; else echo $row_setting['title']; ?>" />
            <meta name="twitter:description" content="<?php if(!empty($seo_description)) echo $seo_description; else echo $row_setting['description']; ?>" />
            <!-- Canonical -->
            <!-- Chống đổi màu trên IOS -->
            <meta name="format-detection" content="telephone=no">
            <link rel="stylesheet" href="assets/css/bulma.css">
            <link rel="stylesheet" href="assets/css/style.css">
            <link rel="stylesheet" href="assets/js/swiper/swiper.min.css">
            <link type="text/css" href="assets/css/magiczoomplus.css" media="all" rel="stylesheet" />
            <link type="text/css" href="assets/css/magicscroll.css" media="all" rel="stylesheet" />
            <link href="https://fonts.googleapis.com/css?family=Jura:700&display=swap&subset=vietnamese" rel="stylesheet">
            <script src="assets/js/jquery-3.4.1.min.js"></script>
            
            <?=$row_setting['scriptcode']?>
             <script src="https://www.google.com/recaptcha/api.js?render=<?=$config['gv3_client']?>"></script>
            
        </head>
        <body class="<?=$com?> <?=$template?>">
            <?php include _template."layout/header.php";?> 
            <?php include _template."layout/slider.php";?>
            <div class="content <?=$template?>">
                <?php include _template.$template."_tpl.php";?>
            </div>     
            <?php include _template."layout/footer.php";?>   
            <script src="assets/js/swiper/swiper.min.js"></script>
            <script src="assets/js/script.js" defer></script>
            <?=$row_setting['bodycode']?>
            <?php if($com=='album'){ ?>
                <script>
                    $('#lightgallery').photobox('a', { thumbs:true, loop:false });
                </script>
            <?php } ?>
            <script type="text/javascript" src="assets/js/magiczoomplus.js"></script>
            <script type="text/javascript" src="assets/js/magicscroll.js"></script>
            <script src="https://sp.zalo.me/plugins/sdk.js"></script>
            <script>
        grecaptcha.ready(function () {
        grecaptcha.execute('<?=$config['gv3_server']?>', { action: 'nindex' }).then(function (token) {
        var recaptchaResponse = document.getElementsByClassName('recaptchaResponse');
        for(var i = 0; i < recaptchaResponse.length; i++) {
        recaptchaResponse[i].value = token;
        }
        });
        });
        </script>
        <?php include _template."layout/support-online.php";?> 
        </body>
        </html>