function menuleftgetall($id, $token)
{
    $returnvalue = '';
    $sql = 'SELECT `cacheall` FROM `user` WHERE `token` = "' . $token . '" AND `ID` = ' . $id . ' AND `flag_change` = 0';
    $result = mysql_query($sql) or die('0');
    if (mysql_num_rows($result)) {
        $rows = mysql_num_rows($result);
        if ($rows == 1) {
            while ($rsl = mysql_fetch_array($result)) {
                $val = $rsl['cacheall'];
            }
            $returnvalue = $val;
        } else {
            $returnvalue = json_encode(updatecache($id, $token));
            $menu = amrupdatecache($id, $token);
        }
    } else {
        $returnvalue = json_encode(updatecache($id, $token));
        $menu = amrupdatecache($id, $token);
    }
    return $returnvalue;
}
require "libs/common_functions.php";
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
$token = isset($_REQUEST['token']) ? $_REQUEST['token'] : '';
$value = isset($_REQUEST['value']) ? $_REQUEST['value'] : '';
CONNECT_DB();
mysql_query("SET NAMES utf8");
$sql = 'SELECT `cacheall` FROM `user` WHERE `token` = "' . $token . '" AND `ID` = ' . $id . ' AND `flag_change` = 0';
$result = mysql_query($sql) or die('0');
if (mysql_num_rows($result)) {
    $rows = mysql_num_rows($result);
    if ($rows == 1) {
        while ($rsl = mysql_fetch_array($result)) {
            $val = $rsl['cacheall'];
        }
        echo $val;
    } else {
        include 'menuleftfncall.php';
        echo $menu = json_encode(updatecache($id, $token));
        include 'menuleftfnc.php';
        $menu = amrupdatecache($id, $token);
    }
} else {
    include 'menuleftfncall.php';
    echo $menu = json_encode(updatecache($id, $token));
    include 'menuleftfnc.php';
    $menu = amrupdatecache($id, $token);
}
CLOSE_DB();
unset($sql, $result, $rs);
?>
 
require "libs/common_functions.php";
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
$token = isset($_REQUEST['token']) ? $_REQUEST['token'] : '';
$value = isset($_REQUEST['value']) ? $_REQUEST['value'] : '';
CONNECT_DB();
mysql_query("SET NAMES utf8");
$sql = 'SELECT `cache` FROM `user` WHERE `token` = "' . $token . '" AND `ID` = ' . $id . ' AND `flag_change` = 0';
$result = mysql_query($sql) or die('0');
if (mysql_num_rows($result)) {
    $rows = mysql_num_rows($result);
    if ($rows == 1) {
        while ($rsl = mysql_fetch_array($result)) {
            $val = $rsl['cache'];
        }
        echo $val;
    } else {
        include 'menuleftfnc.php';
        echo $menu = json_encode(amrupdatecache($id, $token));
        include 'menuleftfncall.php';
        $menu = updatecache($id, $token);
    }
} else {
    include 'menuleftfnc.php';
    echo $menu = json_encode(amrupdatecache($id, $token));
    include 'menuleftfncall.php';
    $menu = updatecache($id, $token);
}
CLOSE_DB();
unset($sql, $result, $rs);
?>