Your IP : 216.73.217.6


Current Path : /home/smartconb/www/armencom33/acv2026/
Upload File :
Current File : /home/smartconb/www/armencom33/acv2026/language.php

<?php
/**
 * User: zaven
 * Date: 13.11.2018
 * Time: 18:14
 * Project: acv
 **/

require_once('includes/init.inc.php');
require_once(INCLUDES_DIR . 'security.inc.php');

$data = array();
$data['id'] = '';

foreach ($data as $key => $value) {
    if (array_key_exists($key, $_REQUEST))
        $data[$key] = $_REQUEST[$key];
}

if ($data['id'] > 0) {
    $sql = "SELECT * FROM #__language WHERE language_id='" . db_real_escape_string($data['id']) . "' AND language_active=1";
    $result = db_query($sql);
    if ($result !== false && db_num_rows($result) > 0) {
        $row = db_fetch_assoc($result);
        $_SESSION['ac']['INTERFACE_LANGUAGE'] = $row['language_abbr'];
    }
}

if (isset($_SERVER['HTTP_REFERER'])) {
    header('location: ' . $_SERVER['HTTP_REFERER']);
} else {
    header('location: ./');
}