#!/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 language=\"javascript\">
function beforeAddGroup(frm)
{
	var grp;
	grp = document.getElementsByName(\"grpname\")[0];
	grp.value = TrimAll(grp.value);
	if (!IsName(grp.value)) {
		alert(\"вܰ&ַ!\");
		grp.select();
		return false;
	}
	return true;
}
</script>
";
if [ "${REQUEST_METHOD}" = "POST" ]; then
	errmsg=`${FLOWEYE} table add ${CGI_grpname}`
	if [ "$?" != "0" ]; then
		afm_dialog_msg "ʧ:${errmsg}"
	else
		afm_dialog_msg "ɹ!"
		ipgrp=`${FLOWEYE} table list | grep " ${CGI_grpname}" | awk '{print $1}'`
		afm_load_page 0 "/cgi-bin/Protocol/ipgrp_list?ipgrp=${ipgrp}"
		exit 0
	fi
fi

echo -n "
<body> 
"; cgi_show_title "Զ->IPȺ->Ⱥ" 
echo -n "
<br>
<table width=\"76%\" border=0 cellspacing=0 cellpadding=3 bgcolor=\"#ffffff\">
<form method=post onsubmit=\"return beforeAddGroup(this)\" action=\"/cgi-bin/Protocol/ipgrp_add\">
<tr id=row1>
	<td width=40></td>
	<td width=120 align=left>IPȺ</td>
	<td width=200 align=left>
		<input type=text class=text name=grpname style=\"width:100%\" size=32></input>
	</td>
	<td align=right width=120px><input type=submit style=\"width:100\" value=\"Ⱥ\"></input>
	<td width=*></td>
</tr>
</table>
</form>
</table>
</center>
</body>
</html>
";