예제 #1
0
function NpcNameMatch($var, $gm)
{
    global $page_main;
    $ret = Lan_NPC_SearchByDisplayName($var["str_match"]);
    echo "<select name=\"npc_name\">\n";
    echo "<option>" . $page_main["select_action"] . "</option>\n";
    foreach ($ret as $item) {
        printf("<option value=\"%s\">%s</option>\n", $item["RealName"], $item["DisplayName"] . "(" . Base642UTF8($item["RealName"]) . ")");
    }
    printf("</select>");
    return true;
}
예제 #2
0
function GetNPCCfg($var, $gm)
{
    global $page_main, $tbl_sys_msg;
    $name = $var["name"];
    $js_str = <<<_js_str
<script>
function ondetail(name){
\tdocument.form1.action_name.value = '46';
\tdocument.form1.npc_name.value = name;
\tdocument.form1.submit();
}
</script>
_js_str;
    echo $js_str . "\n";
    form($var, $gm);
    echo "<input type='hidden' name='npc_name' />\n";
    echo "</form>\n";
    echo "<table class='list_table'>\n";
    printf("<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>\n", $page_main["real_name"], "Base 64", $page_main["display_name"], $tbl_sys_msg["detail"]);
    $param = array();
    if ($var["type"] == "display_name") {
        $ret = Lan_NPC_SearchByDisplayName($name);
    } else {
        if ($var["type"] == "base64") {
            $name = base642UTF8($name);
        }
        $ret = Lan_NPC_SearchByRealName($name);
    }
    foreach ($ret as $item) {
        printf("<tr><td>%s</td><td>%s</td><td>%s</td><td><button onclick='ondetail(\"%2\$s\")'>%s</button></td></tr>\n", Base642UTF8($item["RealName"]), $item["RealName"], $item["DisplayName"], $tbl_sys_msg["detail"]);
    }
    echo "</table>\n";
    return true;
}