<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.tool.SzDateHelp" %>
<%@ page import="net.sz600.database.SzPageInfo" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.docEngine.*" %>
<%@ include file="/sessionInfo.jsp"%>
<%@ include file="/docEngine/docEngineSession.jsp"%>
<%
  String strLevel = "../../";
%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
    //获取提交的参数
    String sType = SzConvert.toZeroStr(request.getParameter("type"));
    String sPKEY = SzConvert.toZeroStr(request.getParameter("PKEY"));
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
    String sSearchName = SzConvert.strWriteData(request.getParameter("txtSearchName"));

    String sTable_type = "SZKC_CPFL";

    String sOPERATOR = request.getParameter("OPERATOR");
    String sKEY =  SzConvert.toZeroStr(request.getParameter("KEY"));

    //读取数据
    //读取数据
    WdyqDocInfo wdyqDocInfo = null;
    WdyqDoc wdyqDoc = new WdyqDoc(moduleId);
    
    SzRead szRead = new SzRead(readDocEngineXml.getReadTable(moduleId));
    SzReadInfo szReadInfo = null;
    String sCond = "YDXX=" + sKEY;
    if (!sPKEY.equals("0")) {
        sCond += "";
    }
    String sSortField = SzConvert.toSpaceStr(request.getParameter("txtSortField"));
    int iSortOrder    = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("txtSortOrder")));
    if (sSortField.equals("XXID")) {
      sSortField = "";
      sPage = "1";
    }
    if (sSortField.equals("")) {
      sSortField = "YDID";
      iSortOrder = SzProperties.I_SortOrder_DESC;
    }
    int iCurrentPage = 1;
    try {
        iCurrentPage =  Integer.parseInt(sPage);
    }catch(Exception e) {
    }

    Iterator iter = szRead.getArrayList(sCond, sSortField, iSortOrder, iCurrentPage, sSearch).iterator();

    SzPageInfo pageInfo = szRead.getPageInfo();
    int iPageCount = pageInfo.getPageCount();
    int iRecordCount = pageInfo.getRecordCount();
    iCurrentPage = pageInfo.getCurrentPage();
    int i = 0;

%>

<body>
<!-----上面的工具栏------>
<form name="formUpdate" method="post"  ENCTYPE="multipart/form-data">
  <input type="hidden" name="PKEY" value="<%=sPKEY%>">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>">
  <input type="hidden" name="type" value="<%=sType%>">
<%@ include file="/docEngine/title.jsp"%>
<table width="100%">
  <tr>
    <td>
      <%=SzPageHelp.saveButton()%>
      <%=SzPageHelp.button("返回","FormSubmit(formHidden, 'index.jsp');")%>
    </td>
  </tr>
</table>

<!-----信息维护------>
<table width="650" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <tr>
    <td class="tdClassTitle">反馈内容</td>
    <td colspan="3">
      <textarea name="YDFK" class="areaClass2"></textarea>
    </td>
  </tr>
  <% if (docEngineInfo.getStat().equals("1") && 1>1) {%>
  <tr>
    <td class="tdClassTitle">附件</td>
    <td><%=SzPageHelp.updateAnnex(readDocEngineXml.getReadAnnexTable(moduleId), "0")%>    
  </tr>
  <% } %>
</form>

<table width="650" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <form name="formList" method="post" >
  <input type="hidden" name="page" value="<%=iCurrentPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>">
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">
  <input type="hidden" name="txtSearchName" value="<%=sSearchName%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>">  
  <tr class="trClassTitle">
    <td width="80"><%=SzPageHelp.sortTitle("人员部门", "YDBMMC", sSortField, iSortOrder)%></td>
    <td width="80"><%=SzPageHelp.sortTitle("人员名称", "YDDLXM", sSortField, iSortOrder)%></td>
    <td width="120"><%=SzPageHelp.sortTitle("阅读时间", "YDSJ", sSortField, iSortOrder)%></td>
    <td><%=SzPageHelp.sortTitle("反馈内容", "YDFK", sSortField, iSortOrder)%></td>
  </tr>
<%
    String sTemp = "";
    while (iter != null && iter.hasNext()) {
        szReadInfo = (SzReadInfo)iter.next();
        i++;
        sTemp = szReadInfo.getYDFK();
        sTemp = sTemp.replaceFirst("<br>", "");
%>
  <tr>
    <td><%=szReadInfo.getYDBMMC()%>&nbsp;</td>
    <td><%=szReadInfo.getYDDLXM()%>&nbsp;</td>
    <td><%=szReadInfo.getYDSJ()%>&nbsp;</td>
    <td><%=sTemp%>&nbsp;</td>
  </tr>
  <% if (docEngineInfo.getStat().equals("1") && 1>1) {%>
  <tr>
    <td>&nbsp;</td>
    <td colspan="4"><%=SzPageHelp.detailAnnex(readDocEngineXml.getReadAnnexTable(moduleId), "" + szReadInfo.getYDID())%></td>
  </tr>  
  <% } %>
<%
    }
%>
  </form>
</table>


<table width="650">
  <form name="formPage" method="post">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="txtSearchName" value="<%=sSearchName%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>">
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>">
  <tr>
    <td align="right">
      <!----翻页---->
      <% if (iCurrentPage>1) { %>
      <a href="#" OnClick="javascript:FormSubmit(formPage,'feedback.jsp?page=1');">首页</a>
      <a href="#" OnClick="javascript:FormSubmit(formPage,'feedback.jsp?page=<%=iCurrentPage-1%>');">上页</a>
      <% }%>
      <% if (iCurrentPage<iPageCount) { %>
      <a href="#" OnClick="javascript:FormSubmit(formPage,'feedback.jsp?page=<%=iCurrentPage+1%>');">下页</a>
      <a href="#" OnClick="javascript:FormSubmit(formPage,'feedback.jsp?page=<%=iPageCount%>');">尾页</a>
      <% } %>
      第<input type="text" name="page" class="txtClassPage" value="<%=iCurrentPage%>" size="2">页
      <input type="button" name="btnGoPage" class="btnClass" value="确定" OnClick="javascript:FormSubmit(formPage,'feedback.jsp');">
      共&nbsp;<%=iPageCount%>&nbsp;页/共&nbsp;<%=iRecordCount%>&nbsp;记录&nbsp;
      <!----快速查找---->
      <input type="text" name="txtSearch" class="txtClassSearch" value="<%=sSearch%>" size="10">
      <input type="button" name="btnSearch"  class="btnClass" value="快速查找" OnClick="javascript:FormSubmit(formPage,'feedback.jsp');">&nbsp;
    </td>
  </tr>
  </form>
</table>
<% if (docEngineInfo.getStat().equals("1")) {%>
<table width="650">
  <tr>
    <td width="120"><b>未阅读人员:</b></td>
    <td align="left"><%=wdyqDoc.getUnReadUser("0", SzConvert.toInt(sKEY)) %></td>
  </tr>
</table>
<% } %>
<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>">
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>">  
</form>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript">

  function FormSave(formName, url) {
    if (!notSpace(formName.YDFK, "反馈内容")) {
      return false;
    }

    formName.action = url;
    formName.submit();
  }
</script>
</body>
