#!/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/Maintain/`basename $0`"
IPE_DDNS=${PGBIN}/ipe_ddns 
MOD_TAB_LIST="#/cgi-bin/Maintain/ddns_config DDNSб#/cgi-bin/Maintain/ddns_list"

echo -n "
<script type=\"text/javascript\" src=\"/img/common.js\"></script>
<script language=\"javascript\">
function onCancel() 
{
        window.location.href = \"${returl}\";
}
function onreboot()
{
        window.location.href = \"${myself}?act=reboot\";
}
</script>
";
if [ "${REQUEST_METHOD}" = "POST" ]; then
        operator_check "${myself}"
        errmsg=`${IPE_DDNS} -e ${CGI_enable}`
        if [ "$?" != "0" ]; then
				afm_dialog_msg "ʧ:${errmsg}"
		fi
elif [ "${CGI_act}" = "reboot" ]; then
		err="`${IPE_DDNS} -k`"
		CGI_enable=`${IPE_DDNS} -e`
else
		CGI_enable=`${IPE_DDNS} -e`
fi

echo -n "
<body>
"; cgi_show_title "->DDNS" 
echo -n "
<br>
"; cgi_print_mod_header "" 700 
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=120 align=left><b>DDNS</b></td>
        <td width=* align=left>
                <select name=enable value=${CGI_enable} style=\"width:100\">
";
                        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>
</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>
";