#!/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
myself="/cgi-bin/Protocol/`basename $0`"

echo -n "
<script languate=\"javascript\">
function Validate(frm)
{
	var dbfile = document.getElementsByName(\"cfgfile\")[0];
	if (dbfile.value == \"\") {
		alert(\"ļ·!\");
		return false;
	}
	if (confirm(\"ȷҪϴļ?\"))
		return true;
	else
		return false;
}
</script>
";
if [ "${REQUEST_METHOD}" = "POST" ]; then
	operator_check "${myself}"
	errmsg=`${FLOWEYE} ipobj loadname ${CGI_cfgfile}`
	if [ "$?" != "0" ]; then
		afm_dialog_msg ":${errmsg}"
	else
		afm_dialog_msg "ɹļ!"
	fi
	rm -f ${CGI_cfgfile}
	sync
fi

echo -n "
<body>
"; 
cgi_show_title "->IPʶ->ļ"

echo -n "
<br>
<table width=700 border=0 cellspacing=1 cellpadding=1 bgcolor=\"#ffffff\">
<form method=post onsubmit=\"return Validate(this)\" action=\"${myself}\" enctype=\"multipart/form-data\">
<tr height=22>
	<td width=20></td>
	<td width=160 style=\"font:13px bold\" align=left>ļ·:</td>
	<td width=* class=cssTDArial align=left>
		<input type=file name=cfgfile style=\"width:430px\">
	</td>
	<td align=right>
		<input type=submit style=\"width:90\" value=\"ļ\"></input>
	</td>
</tr>
</form>
</table>
</body>
</html>
";