<%
__header("Content-Type","text/html; charset=gb2312");
var serr="{\"op\":\"op err\"}";
if (op=="")
  write(serr);
else
{
db_Open("/NandFlash/dbCfg.db3");
var sql="";
if (op=="qry")
{
  sql="select * from tbPort where Type="+port+" order by Type,Name";
  db_QryAdv(sql);
}
if (op=="qryok")
{
  sql="select * from tbPort where Type="+port+" and Val not in(select SerType from tbSM where State=0";
  if (port==3) sql=sql+" and SerAddr=0"
  sql=sql+") order by Type,Name";
  db_QryAdv(sql);
}
db_Close();
}
%>