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

"
echo -n ""; . ../common/common.sh 
echo -n "
<script type=\"text/javascript\" src=\"/img/common.js\"></script>
<script languate=\"javascript\">
function Validate(frm)
{
	var ttl = document.getElementsByName(\"ipttl\")[0];
	ttl.value = TrimAll(ttl.value);
	if (ttl.value == \"\" || !IsDigit(ttl.value)) {
		alert(\"ʱ!\");
		ttl.select();
		return false;
	}
	if (ttl.value < 60) {
		alert(\"ʱ䲻С60!\");
		ttl.select();
		return false;
	}
	return true;
}
</script>
"; 
if [ "${REQUEST_METHOD}" = "POST" ]; then
	operator_check "/cgi-bin/Setup/natip_config"
	errmsg=`${FLOWEYE} appobj config natip_ttl=${CGI_natip_ttl}` 
	if [ "$?" != "0" ]; then
		afm_dialog_msg "ִ: ${errmsg}"
	else
		afm_dialog_msg "ɹ!"
	fi
fi
for nameval in `${FLOWEYE} appobj stat`
do
	eval "CGI_${nameval}"
done

echo -n "
<body>
"; cgi_show_title "->û" 
echo -n "
<br>
<form method=post onsubmit=\"return Validate(this)\" action=\"/cgi-bin/Setup/natip_config\">
<table width=600 border=0 cellspacing=0 cellpadding=3 bgcolor=\"#ffffff\">
<tr id=row1>
	<td></td>
        <td align=left>ûʱ</td>
	<td width=* align=left>
		<input type=text name=natip_ttl style=\"width:100px\" value=\"${CGI_natip_ttl}\"></input>&nbsp;(,ϵͳԶɾʱ䳬ֵĹû)</td>
</tr>
</table>
<table style=\"width:600; border-bottom:1px #787882 solid; color:#0000ff\">
<tr><td align=right>&nbsp;</td></tr>
</table>
<table style=\"width:600\"> 
<tr>
        <td align=right>
		<input type=submit style=\"width:80\" value=\"ύ\"></input>
	</td>
</tr>
</table>
</form>
</body>
</html>
";