<?php 
// Expires on any date in the past.
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Last modified at the current date and time.
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// For HTTP 1.1:
header ("Cache-Control: no-store, no-cache, must-revalidate");
header ("Cache-Control: post-check=0, pre-check=0", false);
// For HTTP 1.0:
header ("Pragma: no-cache");
header("Content-Type: text/html;charset=UTF-8");
header('x-powered-by: AdyDev.com');
// Start output buffering.
ob_start();
// Initialize a session.
session_start();
// include languages session
include(LANG);

echo '<!DOCTYPE html>';
echo '<!--[if IE 8 ]>';
echo '<html class="ie8" lang="<?=$lang?>" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">';
echo '<![endif]-->';
echo '<!--[if IE 9 ]>';
echo '<html class="ie9" lang="'.$lang.'" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">';
echo '<![endif]-->';
echo '<!--[if (gte IE 10)|!(IE)]><!-->';
echo '<html xmlns="//w3.org/1999/xhtml" lang="'.$lang.'" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">';
echo '<!--<![endif]-->';

echo '<head>';

echo '<title>'.$title.'</title>';

echo '<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>';

echo '<meta http-equiv="X-UA-Compatible" content="IE=edge"/>';

echo '<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>';

echo '<link rel="canonical" href="'.BASE_URL.$_SERVER["REQUEST_URI"].'"/>';

echo '<meta name="description" content="'.$description.'"/>';

//echo '<meta name="keywords" content="'.$keyords.'"/>';

// OPENGRAPH (Facebook)
echo '<meta property="og:title" content="'.$title.'"/>';
echo '<meta property="og:description" content="'.$description.'"/>';
echo '<meta property="og:keywords" content="'.$keyords.'"/>';
echo '<meta property="og:locale" content="ro_RO" />';
echo '<meta property="og:url" content="'.BASE_URL.$_SERVER["REQUEST_URI"].'"/>';
echo '<meta property="og:site_name" content="'.BASE_NAME.'"/>';

if($rimg->num_rows == 1){
    $rwimg = $rimg->fetch_assoc();
  if(!empty($rwimg['file_name'])){
    echo '<meta name="og:image" content="'.BASE_URL.'/images/'.$rwimg['file_name'].'"/>';
       }else{
        echo '<meta name="og:image" content="'.BASE_URL.'/themes/'.$set['theme'].'/img/logo.png"/>';
       }
    }elseif($rimg->num_rows > 1){
  while($rwimg = $rimg->fetch_assoc()){
     echo '<meta name="og:image" content="'.BASE_URL.'/imagini/'.$rwimg['file_name'].'"/>';
      }   
   }else{
     echo '<meta name="og:image" content="'.BASE_URL.'/themes/'.$set['theme'].'/img/logo.png"/>';    
   }

echo '<meta property="og:image:type" content="image/jpeg"/>';
echo '<meta property="og:image:type" content="image/jpg"/>';
echo '<meta property="og:image:type" content="image/png"/>';
echo '<meta property="og:image:type" content="image/gif"/>';
echo '<meta property="og:image:width" content="1600" />';
echo '<meta property="og:image:height" content="1067" />';
echo '<meta property="og:image:alt" content="'.$title.'" />';
echo '<meta name="og:type" content="website" />';

// OPENGRAPH (Twitter)
echo '<meta name="twitter:card" content="summary"/>';
echo '<meta name="twitter:title" content="'.$title.'"/>';
echo '<meta name="twitter:description" content="'.$description.'"/>';

/*
if($rimg->num_rows == 1){
    $rwimg = $rimg->fetch_assoc();    
    echo '<meta name="twitter:image" content="'.BASE_URL.'/imagini/'.$rwimg['nume_fisier'].'"/>';
    }elseif($rimg->num_rows > 1){
      while($rwimg = $rimg->fetch_assoc()){
      echo '<meta name="twitter:image" content="'.BASE_URL.'/imagini/'.$rwimg['nume_fisier'].'"/>';
      }   
   }else{
    echo '<meta name="twitter:image" content="'.BASE_URL.'/libs/img/logo.png"/>';
   } */

echo '<meta name="twitter:image:width" content="200"/>';
echo '<meta name="twitter:image:height" content="200"/>';

if(!empty($set['robots'])){
    echo '<meta name="robots" content="'.$set['robots'].'"/>';}
if(!empty($set['revisit'])){
    echo '<meta name="revisit-after" content="'.$set['revisit'].'"/>';}

if(!empty($set['wgoogle'])){
    echo '<meta name="google-site-verification" content="'.$set['wgoogle'].'"/>';}
if(!empty($set['wbing'])){
    echo '<meta name="msvalidate.01" content="'.$set['wbing'].'"/>';}
if(!empty($set['wyandex'])){
    echo '<meta name="yandex-verification" content="'.$set['wyandex'].'"/>';}

if(!empty($set['wwot'])){
    echo '<meta name="wot-verification" content="'.$set['wwot'].'"/>';}
if(!empty($set['wnorton'])){
    echo '<meta name="norton-safeweb-site-verification" content="'.$set['wnorton'].'"/>';}
    
if(!empty($set['c_head'])){
    echo $set['c_head'];
    }

echo '<link rel="apple-touch-icon" sizes="57x57" href="'.PATH.'themes/'.$set['theme'].'/img/apple-icon-57x57.png"/>';

echo '<link rel="apple-touch-icon" sizes="60x60" href="'.PATH.'themes/'.$set['theme'].'/img/apple-icon-60x60.png"/>';

echo '<link rel="apple-touch-icon" sizes="72x72" href="'.PATH.'themes/'.$set['theme'].'/img/apple-icon-72x72.png"/>';

echo '<link rel="apple-touch-icon" sizes="76x76" href="'.PATH.'themes/'.$set['theme'].'/img/apple-icon-76x76.png"/>';

echo '<link rel="apple-touch-icon" sizes="114x114" href="'.PATH.'themes/'.$set['theme'].'/img/apple-icon-114x114.png"/>';

echo '<link rel="apple-touch-icon" sizes="120x120" href="'.PATH.'themes/'.$set['theme'].'/img/apple-icon-120x120.png"/>';

echo '<link rel="apple-touch-icon" sizes="144x144" href="'.PATH.'themes/'.$set['theme'].'/img/apple-icon-144x144.png"/>';

echo '<link rel="apple-touch-icon" sizes="152x152" href="'.PATH.'themes/'.$set['theme'].'/img/apple-icon-152x152.png"/>';

echo '<link rel="apple-touch-icon" sizes="180x180" href="'.PATH.'themes/'.$set['theme'].'/img/apple-icon-180x180.png"/>';

echo '<link rel="icon" type="image/png" sizes="192x192"  href="'.PATH.'themes/'.$set['theme'].'/img/android-icon-192x192.png"/>';

echo '<link rel="icon" type="image/png" sizes="32x32" href="'.PATH.'themes/'.$set['theme'].'/img/favicon-32x32.png"/>';

echo '<link rel="icon" type="image/png" sizes="96x96" href="'.PATH.'themes/'.$set['theme'].'/img/favicon-96x96.png"/>';

echo '<link rel="icon" type="image/png" sizes="16x16" href="'.PATH.'themes/'.$set['theme'].'/img/favicon-16x16.png"/>';

echo '<link rel="manifest" href="'.PATH.'themes/'.$set['theme'].'/img/manifest.json"/>';

echo '<meta name="msapplication-TileColor" content="#ffffff"/>';

echo '<meta name="msapplication-TileImage" content="'.PATH.'themes/'.$set['theme'].'/img/ms-icon-144x144.png"/>';

echo '<meta name="theme-color" content="#ffffff"/>';

//echo '<link href="'.BASE_URL.'/feed.xml" type="application/atom+xml" rel="alternate" title="Atom Feed"/>';

// Own CSS Style
echo '<link rel="stylesheet" href="'.CSS.'style.css"/>';

echo '<link rel="stylesheet" href="'.CSS.'custom.css"/>';

echo '<link rel="stylesheet" type="text/css" href="'.CSS.'cookieconsent.min.css" />';

// External CSS Style and Font
echo '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>';

echo '</head>';

echo '<body id="topsus">';

echo '<div class="w3-margin-top w3-hide-small w3-hide">&nbsp;</div>';

echo '<div class="w3-content w3-card layoutcust" style="max-width:1431px;">';

include THM.$set['theme'].'/meniu.php';

echo '<div class="" style="margin-top:15px;margin-bottom:0px;width:100%;max-width:1431px;">';
?>