#!/bin/sh
#This script is created by ssparser automatically. The parser first created by MaoShouyan
printf "Content-type: text/html;charset=gb2312
Cache-Control: no-cache

"
echo -n "";
if [ "${PALANG}" = "en" ]; then
	LANG_001="IP location query"
	LANG_002="Query"
	LANG_003="Upgrade"
	LANG_004="IP addr"
	LANG_005="Submit"
	LANG_006="Query results"
fi
CGI_browsertitle="${LANG_001:=IPλòѯ}"
. ../../common/common.sh
apppath="/cgi-bin/App/ipdb"
myself="${apppath}/`basename $0`"
MOD_TAB_LIST="${LANG_002:=IPѯ}#${apppath}/webmain ${LANG_003:=}#${apppath}/update"
APPCTRL=/usr/ramdisk/app/ipdb/appctrl
if [ "${REQUEST_METHOD}" = "POST" ]; then
	operator_check "${myself}"
	for tagval in `${FLOWEYE} ipdb get ip=${CGI_ip}`
	do
		eval "${tagval}"
	done
	if [ "${isp}" = "" ]; then
		result="${location}"
	else
		result="${location}|${isp}"
	fi
fi

echo -n "
<script language=\"javascript\">
function beforeCommit(frm)
{
	return true;
}
</script>
<body>
"; cgi_print_mod_header "${LANG_002:=IPѯ}" "100%" 
echo -n "
</br>
<form method=post action=\"${myself}\">
<table width=100% border=0 cellspacing=0 cellpadding=3 bgcolor=\"#ffffff\">
<tr id=row1>
	<td width=20></td>
	<td align=left>
		<input type=\"text\" value=\"${CGI_ip}\" name=\"ip\" placeholder=\"${LANG_004:=IPַ}\" style=\"width:200px\" />&nbsp;
		<input type=submit style=\"width:80\" value=\"${LANG_005:=ύ}\" class=\"btns\" />
	</td>
</tr>
</table>
</form>
"; if [ "${result}" != "" ]; then 
echo -n "
<table width=100% border=0 cellspacing=0 cellpadding=3 bgcolor=\"#ffffff\">
<tr id=row1>
	<td width=20></td>
	<td align=left>${LANG_006:=ѯ}:&nbsp;${result}</td>
</tr>
</table>
"; fi 
echo -n "
</body>
</html>
";