#!/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
. /etc/PG.conf
myself="/cgi-bin/Maintain/`basename $0`"

echo -n "
<script languate=\"javascript\">
	function Validate(frm) {
		var dbfile = document.getElementsByName(\"IPMAC_FILE\")[0];
		if (dbfile.value == \"\") {
			alert(\"ļ·!\");
			return false;
		}
		return true;
	}
	function onCancel() {
		window.location.href = \"/cgi-bin/Maintain/dhcp_static\";
	}
</script>
";
touch ${PGETC}/dhcpd.conf
touch ${PGETC}/dhcpd.static
.     ${PGETC}/dhcpd.conf
touch ${DATAPATH}/dhcpd.lease
if [ "${REQUEST_METHOD}" = "POST" ]; then
	operator_check "${myself}"
	if [ "X$DHCP_ENABLE" = "XYES" ]; then
		errmsg=`${PGPATH}/bin/ipe_dhctl load static $CGI_IPMAC_FILE`
	fi
	afm_dialog_msg "ɹ!"
	afm_load_page 0 "/cgi-bin/Maintain/dhcp_static"
fi
echo "<body>"
cgi_show_title "DHCP->ļ" 

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) ļÿиʽΪ \"nn:nn:nn:nn:nn:nn ( nn-nn-nn-nn-nn-nn) xxx.xxx.xxx.xxx ע\"</td>
</tr>
</table>
<br>
<form method=post onsubmit=\"return Validate(this)\"
";
echo -n "action=\"${myself}\""

echo -n "
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=\"IPMAC_FILE\" style=\"width:450px\">
	</td>
	<td align=right>
		<input type=submit name=\"SUBMIT\" style=\"width:90\" value=\"\"/>&nbsp;
		<input type=button style=\"width:80\" value=\"ȡ\" onclick=\"onCancel()\"/>
	</td>
</tr>
</table>
</form>
</body>
</html>
";