<?php
include(BASE);
if(!empty($_SESSION['lang'])){
   $lang = $_SESSION['lang'];
      }else{        
        $lang = $set['dlang'];
 }
$getlangdb = $dbc->query("SELECT * FROM `languages` WHERE `lang_code`='".$lang."'");

if($getlangdb->num_rows > 0){    
   $resgetlang = $getlangdb->fetch_assoc();
  
   $_SESSION['lang'] = $resgetlang['lang_code'];
   
   $gcfl = $dbc->query("SELECT * FROM `lang_content` 
                        WHERE `lang_id`='{$resgetlang['lang_id']}'");
   while($rlng = $gcfl->fetch_assoc()){           
           $lng[$rlng['name']] = $rlng['value'];
          }   
   
   }

$dbc->close();