function search()
{
    if (!isset($_POST['s_content'])) {
        return Receive::send_ms("lack the post variables.");
    }
    if (empty($_POST['s_content'])) {
        return Receive::send_ms("输入内容后再搜搜。");
    }
    $content = addcslashes(trim($_POST['s_content']), specialcharacter);
    if ($_POST['client'] == '1') {
        $receive = new Receive($content, '', '', false, true);
    } else {
        $receive = new Receive($content, '', '', false);
    }
    return Receive::send_ms($receive->search());
}
if (!isset($_SESSION['TOKEN'])) {
    header('location:../index.php');
    exit;
}
include 'wsdls.php';
include 'Bapi.php';
ini_set("default_socket_timeout", 400);
$Iguid = $_REQUEST['Iguid'];
try {
    $Bapi = new Bapi();
    $Bapi->bapiCall($bapiname['registration_approval']);
    $BapiImport = new BapiImport();
    $BapiImport->setImport('TOKEN', $_SESSION['TOKEN']);
    $BapiImport->setImport('IGUID', $Iguid);
    $BapiImport->setImport('ACTION', 'READ');
    $Receive = new Receive();
    $Receive->getResult();
    $ResponseExport = new ResponseExport();
    $rp = $ResponseExport->export('OCUSTOMER');
    foreach ($rp as $keys => $val) {
        $rp[$keys] = mb_convert_encoding($val, "EUC-JP", "auto");
    }
} catch (Exception $e) {
    echo $msg = 'Message:- ' . $e->getMessage();
    exit;
}
//var_dump($rp);
//exit;
echo $json_en = json_encode($rp);
//$table_as=json_decode($json_en,true);
//$_SESSION['table_reg_list']=$table_as;
    return Receive::send_ms("nothing...");
}
if (empty($_POST['method']) || empty($_POST['user'])) {
    return Receive::send_ms("the variable cannot be blank.");
}
$user = addcslashes(trim($_POST['user']), specialcharacter);
$method = addcslashes(trim($_POST['method']), specialcharacter);
switch ($method) {
    case 'get':
        $receive = new Receive('', '', $user, true);
        return stripcslashes($receive->rec_challenge());
        break;
    case 'post':
        if (!isset($_POST['content'])) {
            return Receive::send_ms("no post content.");
        }
        if (empty($content = addcslashes(trim($_POST['content']), specialcharacter))) {
            return Receive::send_ms("the variable cannot be blank.");
        }
        $receive = new Receive($content, '', $user, true);
        // echo $content;
        if ($receive->new_challenge()) {
            return Receive::send_ms("提交成功。");
        } else {
            return Receive::send_ms("提交失败。");
        }
        break;
    default:
        return Receive::send_ms("unknown method.");
        break;
}