<%@ page contentType="text/html; charset=GBK"  errorPage="../error.jsp" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser"%>
<%@ page import = "zr.zrpower.common.util.SysPreperty"%>
<%@page import="zr.zrpower.queryengine.service.QueryConfig"%>

<%@ page import = "zr.zrpower.ejb.sys.UIService"%>

<html>
<head>
<%
  request.setCharacterEncoding("GBK");
  response.setContentType("text/html; charset=GBK");

  SessionUser user = (SessionUser)session.getAttribute("userinfo");
  QueryConfig queryConfig = new QueryConfig();
  UIService userUI =new UIService();

  String id = request.getParameter("id");
  String field = request.getParameter("field");

  //得到当前字段的设置情况---
  String svalue = queryConfig.getPrecision(id,field);
  String T1 = svalue.split(",")[0];
  String T2 = svalue.split(",")[1];
  String T3 = svalue.split(",")[2];
  String T4 = svalue.split(",")[3];
  if (T4.equals("0"))
  {
     T4 = "";
  }

%>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>是否精确查询和是否必填设置</title>
<link REL="stylesheet" type="text/css" href="../../zrsysmanage/css/<%=user.getUserCSS()%>">
<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/script/Public.js"></SCRIPT>
<script language="JavaScript" type="text/JavaScript">
function save()
{
    var id = document.recordfrm.id.value;
    var field = document.recordfrm.field.value;
    var T1 = document.recordfrm.ISPRECISION.value;
    var T2 = document.recordfrm.ISMUST.value;
    var T3 = document.recordfrm.ISDAY.value;
    if (T3==""){T3="0";}
    var T4 = document.recordfrm.DVALUE.value;
    if (T4==""){T4="0";}
    document.recordfrm.svalue.value = T1+","+T2+","+T3+","+T4;
    document.recordfrm.submit();

    //document.location.href = "saveprecision.jsp?id="+id+"&field="+field+"&svalue="+T1+","+T2+","+T3+","+T4;
}
function numberInput(){
  if (event.keyCode < 48 || event.keyCode > 57) {
    event.returnValue = false;
  }
}
</script>
</head>
<BODY class="BodyMain">
<FORM method="post" name="recordfrm" action="saveprecision.jsp">
<input type="hidden" name="id" value="<%=id%>">
<input type="hidden" name="field" value="<%=field%>">
<input type="hidden" name="ISPRECISION" value="<%=T1%>">
<input type="hidden" name="ISMUST" value="<%=T2%>">
<input type="hidden" name="svalue" value="">




<TABLE border="0" width="95%" cellpadding=0 cellspacing=0>
     <TR>
      <TD height="80" align="center" valign="middle">

      <fieldset style="width: 99%">
      <legend>字符类型查询字段设置</legend>
      查询:
      <input type="radio" onclick="document.recordfrm.ISPRECISION.value='0';" name="PRECISION" value=0 <% if (T1.equals("0")) {out.print("checked");}%> >
       模糊查询
      <input type="radio" onclick="document.recordfrm.ISPRECISION.value='1';" name="PRECISION" value=1 <%if (T1.equals("1")) {out.print("checked");}%>>
       精确查询
       <br>
       是否必填:
      <input type="radio" onclick="document.recordfrm.ISMUST.value='0';" name="MUST" value=0 <% if (T2.equals("0")) {out.print("checked");}%> >
       否
      <input type="radio" onclick="document.recordfrm.ISMUST.value='1';" name="MUST" value=1 <%if (T2.equals("1")) {out.print("checked");}%>>
       是
       <br><br>
       </fieldset>

       <fieldset style="width: 99%">
       <legend>日期类型查询字段设置</legend>
       查询日期范围:
       <input class="text" type="text" name="ISDAY" onKeyPress="numberInput()" size="4" maxlength="3" value="<%=T3%>">天。
       <br><br>
       </fieldset>
       <br>
       默认值：
       <input class="text" type="text" name="DVALUE" size="32" maxlength="50" value="<%=T4%>">
       <br>
       说明：{YYYY-MM-DD}-7表示前7天的日期。
       <br>
       {YYYY-MM-DD HH:MM:SS}-30表示30分钟前。
       <br>
       <center>
          <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton1("确定","save();","buttonSure.gif",user.getUserImage())%>
                 <%=userUI.ClickButton1("关闭","window.close();","buttonClose.gif",user.getUserImage())%>
         </tr></table>
         </center>
      </td></tr>

</TABLE>
</form>
</body>
</html>
<%
//清空相关对象
user = null;
userUI = null;
%>
