<?php
error_reporting(7);
ini_set("display_errors",false);

$conf_basedir   = "../../";	//相对主目录的位置
$conf_where = "admin";	//选择调用相应模块
$directory  = basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
include_once($conf_basedir."base.inc.php");

if( $actiontype == 'getstreet' )
{
    $district = mb_convert_encoding(urldecode($district),"gb2312","utf-8");
    $arr_street = street_cache($district);

    $street = array ();
    $i = 0;
    if( isset($arr_street) && !empty($arr_street) )
    {
        foreach($arr_street as $key=>$value)
        {
            $street[$i]['streetid'] = $key;
            $street[$i]['streetname'] = iconv('GB2312', 'UTF-8', $value);
            $i++;
        }
    }
    else
    {
        $street[$i]['streetid'] = 0;
        $street[$i]['streetname'] = iconv('GB2312', 'UTF-8', '无板块信息');
    }
    print json_encode($street);
    exit;
}

if( $actiontype == 'get_qa_class' )
{   
    $fid = intval($fid);
    
    if( $fid > 0)
    {
        $qa_type = q_type_cache(1,$fid);
    }
    
    $type_arr = array ();
    $i = 0;
    if( isset($qa_type) && !empty($qa_type) )
    {
        foreach($qa_type as $key=>$value)
        {
            $type_arr[$i]['t_id'] = $key;
            $type_arr[$i]['t_name'] = iconv('GB2312', 'UTF-8', $value);
            $i++;
        }
    }
    else
    {
        $type_arr[$i]['t_id'] = 0;
        $type_arr[$i]['t_name'] = iconv('GB2312', 'UTF-8', '无分类信息');
    }
    print json_encode($type_arr);
 
    exit;
}

/* End of file ajax_action.php */
/* Location: /esfadmin/module/user_center/ajax_action.php*/

