<%@ page contentType="text/html;charset=utf-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
 <meta http-equiv="X-UA-Compatible" content="IE=8">
 <link rel='stylesheet' type='text/css' href='${ctxStatic}/iSignature/css/iWebProduct.css' />
 <script language="javascript">
  function CheckActiveX(){
    var mObject=true;
    try{
      var newAct = iWebPDF2018.Documents;
      if(newAct == undefined ){
       mObject=false;
      }
    }catch(e){
      mObject=false;
    }
    newAct = null;
    if(mObject){
	  activex_install.innerHTML = "已经安装iWebPDF2018中间件！";
	  activex_install.style.color="#FFFFFF";
    }else{
      //控件无法加载
      activex_install.innerHTML = "请注意，未检测到iWebPDF2018中间件！请查看说明，并按说明的要求检查您使用的环境。";
	  activex_install.style.color="#FF0000";
    }
    return mObject;
  }

  function init(){
    document.getElementById('showtr').style.height = getHeight('maintable')- 100 +"px";
    document.getElementById('showlist').style.height = getHeight('showtr')- 120 +"px";
    document.getElementById('showlist').style.width = document.getElementById('titleTable').offsetWidth;
  }
  //获取id的高度
  function  getHeight(id){
    return document.getElementById(id).offsetHeight;
  }

  function ShowExplain(){
    window.showModalDialog("${ctxStatic}/iSignature/UserExplain.html",window,"dialogWidth=780px;dialogHeight=300px");
  }


  function ShowNewPage(){

     window.location.href='${ctx}/isignature/iSignatureDocument/edit?subject=&recordId=';

  }
  function isEmpty(obj) {
      if(obj==null || obj==undefined || obj=="" || obj.length ==0){
          return true;
      }
      return false ;
  }
 </script>
</head>
<body onload="init()" onresize="init()" style="overflow-y:hidden;overflow-x:hidden">
<table id="maintable"  cellspacing='0' cellpadding='0' >
 <!-- head -->
 <tr><td height="34px" class="title" ><span id="activex_install" style="color: #FF0000">请注意，未检测到iWebPDF2018中间件！请查看说明，并按说明的要求检查您使用的环境。</span>
    <a href="#" onclick="ShowExplain()">[说明]</a>
    <div id="obj" style="display:none">
		<table width="100%"><tr><td id="addPDF" height="22"><script src="${ctxStatic}/iSignature/js/iWebPDF2018.js"></script></td></tr></table>
   </div>

 </td></tr>
 <!-- end head -->

 <!-- showList -->
 <tr><td id="showtr" >
  <table><tr><td valign="top" align="center" >
    <img id="loading" src="${ctxStatic}/iSignature/css/load.gif" alt="" />
    <div style="display: none;" id="loaded">
    <table id="innerTable" border=0  cellspacing='0' cellpadding='0'>
     <tr>
       <td align="left" style="border: 0" height="50px" colspan="6">
           <span>请输入主题：<input type=text id="subject" name=subject value="" class="InputLine" /></span>
	       <span style="padding-left: 30px;">当前用户：${fns:getUser().name}</span>
       </td>
       <td style="border: 0"><a href="#" onclick="ShowNewPage()">新建文档</a></td>
     </tr>   
    </table>
   <table id="titleTable" cellspacing='0' cellpadding='0' align="center"  style="height: 42px;">
	 <tr>
	  <td width="20%">编号</td>
	  <td width="20%">主题</td>
	  <td width="10%">作者</td>
	  <td width="10%">类型</td>
	  <td width="20%">保存时间</td>
	  <td width="10%">操作</td>
	
	</tr> 
   </table>
   <div id="showlist" style="vertical-align: top;">
	    <table align="center"  cellspacing='0' cellpadding='0' width="20px">
            <c:if test="${empty iSignatureDocumentList}">
                <tr>
                    <h3 align="center">暂无数据</h3>
                </tr>
            </c:if>
            <c:if test="${not empty iSignatureDocumentList}">
                <c:forEach items="${iSignatureDocumentList}" var="iSignatureDocument" varStatus="varStatus">
                    <tr>
                        <td width="20%" class="TD0">${iSignatureDocument.recordId}</td>
                        <td width="20%" class="TD0">${iSignatureDocument.subject}</td>
                        <td width="10%" class="TD0">${fns:getUserById(iSignatureDocument.createBy.id).name}</td>
                        <td width="10%" class="TD0">${iSignatureDocument.type}</td>
                        <td width="20%" class="TD0">
                            <fmt:formatDate value="${iSignatureDocument.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td width="10%"  align=center class="TD0">
                            <a href="${ctx}/isignature/iSignatureDocument/edit?id=${iSignatureDocument.id}">阅读</a>
                        </td>
                    </tr>
                </c:forEach>
            </c:if>
		    <tr><td style='border:none;'></td><tr>
	  </table>
   </div>   
    </div>
 </td></tr></table>
 
 </td></tr>

</table>
</body> 
</html>
<script language="javascript" type="text/javascript">
 var checkActiveX  = CheckActiveX();
 if(checkActiveX){
 document.getElementById('loading').style.display = "none";
 document.getElementById('loaded').style.display = "";
 }else{
  document.getElementById('loading').style.display = "none";
  document.getElementById('loaded').style.display = "";
 }

 
</script>