<%
__header("Content-Type","text/html; charset=gb2312");
var serr="{\"op\":\"op err\"}";
var iupd=-1;
db_Open("/NandFlash/dbCfg.db3");
if (op==1)
  db_QryAdv("select * from tbSysCfg");
else
  iupd=db_UpdAdv("update tbSysCfg set LastUpd=datetime(CURRENT_TIMESTAMP,'localtime'),SmtpSvr='" + server + "', SmtpAcc='" + account + "', SmtpPwd='" + pwd + "', SmtpPort=" + port + ", SmtpSubject='" + title + "'", 1);
db_Close();
if (iupd<0 && iupd!=-1)
  write(serr);
if (iupd>=0)
  write("{\"op\":\"ok\"}");
%>