#!/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/Setup/`basename $0`"

echo -n "
<script languate=\"javascript\">
function Validate(frm)
{
	var dbfile = document.getElementsByName(\"ipmacfile\")[0];
	if (dbfile.value == \"\") {
		alert(\"ļ·!\");
		return false;
	}
	return true;
}
</script>
";
if [ "${REQUEST_METHOD}" = "POST" ]; then
	operator_check "${myself}"
	errmsg=`${FLOWEYE} ipmac loadfile file=${CGI_ipmacfile}`
	if [ "$?" != "0" ]; then
		afm_dialog_msg "ִ:${errmsg}"
		rm -rf ${CGI_ipmacfile}
	else
		afm_dialog_msg "ɹ!"
		afm_load_page 0 "/cgi-bin/Setup/ipmac_list"
		rm -rf ${CGI_ipmacfile}
		exit 0
	fi
fi

echo -n "
<body>
"; cgi_show_title "MACܿ->ļ" 
echo -n "
<br>
<table width=\"700\" border=0 cellspacing=1 cellpadding=3>
<tr>
    <td width=40></td>
    <td style=\"font:13px bold\" width=*>(1) ļΪıļ</td>
</tr>
<tr>
    <td></td>
    <td style=\"font:13px bold\" width=*>(2) ļÿиʽΪ\"xxx.xxx.xxx.xxx nn:nn:nn:nn:nn:nn(nn-nn-nn-nn-nn-nn)\"</td>
</tr>
</table>
<br>
<form method=post onsubmit=\"return Validate(this)\" action=\"${myself}\" enctype=\"multipart/form-data\">
<table width=700 border=0 cellspacing=1 cellpadding=1 bgcolor=\"#ffffff\">
<tr height=22>
	<td width=20></td>
	<td width=140 style=\"font:14px bold\" align=left><b>ļ·:</b></td>
	<td width=* class=cssTDArial align=left>
		<input type=file name=ipmacfile style=\"width:450px\">
	</td>
	<td align=right><input type=submit style=\"width:90\" value=\"\"></input></td>
</tr>
</table>
</form>
</body>
</html>
";