#!/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 "";
. ../common/common.sh 
myself="/cgi-bin/Route/`basename $0`"

echo -n "
<script type=\"text/javascript\" src=\"/img/common.js\"></script>
<script language=\"javascript\">
function beforeCommit(frm)
{
	return true;
}
</script>
";
if [ "${REQUEST_METHOD}" = "POST" ]; then
	cmdargs="${cmdargs} enable=${CGI_enable}"
	cmdargs="${cmdargs} ipmac_enable=${CGI_ipmac_enable}"
	errmsg=`${FLOWEYE} dhcpsvr config ${cmdargs}`
	if [ "$?" != "0" ]; then 
		afm_dialog_msg "ʧ:${errmsg}"
	fi
fi
for nameval in `${FLOWEYE} dhcpsvr stat`
do
	eval "CGI_${nameval}"
done

echo -n "
<body>
"; cgi_show_title "DHCP->" 
echo -n "
<br>
<form method=post onsubmit=\"return beforeCommit(this)\" action=\"${myself}\">
<table width=700 border=0 cellspacing=0 cellpadding=3 bgcolor=\"#ffffff\">
<tr id=row1>
	<td width=40></td>
	<td width=120 align=left>DHCP</td>
	<td width=* align=left>
		<select style=\"width:100px\" name=enable value=${CGI_enable}>
		";
			if [ ${CGI_enable} -eq 0 ]; then
				echo "<option value=1></option>"
				echo "<option value=0 selected>ر</option>" 
			else 
				echo "<option value=1 selected></option>"
				echo "<option value=0>ر</option>" 
			fi
		
echo -n "
		</select>
	</td>
</tr>
<tr id=row1>
	<td width=40></td>
	<td width=120 align=left>IPMAC</td>
	<td width=* align=left>
		<select style=\"width:100px\" name=ipmac_enable value=${CGI_ipmac_enable}>
		";
			if [ "${CGI_ipmac_enable}" = "1" ]; then
				echo "<option value=1 selected></option>"
				echo "<option value=0>ر</option>" 
			else 
				echo "<option value=1></option>"
				echo "<option value=0 selected>ر</option>" 
			fi
		
echo -n "
		</select>&nbsp;(úڸͻIPַ󣬻ԶͻIPMAC)
	</td>
</tr>
</table>
<table style=\"width:700; border-bottom:1px #787882 solid; color:#0000ff\">
<tr><td align=right>&nbsp;</td></tr>
</table>
<table style=\"width:700\"> 
<tr><td align=right><input type=submit style=\"width:80\" value=\"ύ\" /></td></tr>
</table>
</form>
</body>
</html>
";