C标签判断使用

来源:互联网 发布:校园网络建设 编辑:程序博客网 时间:2024/05/16 06:46
         <tbody>
<c:if test="${empty plist}">
<tr><td colspan="7">暂时没有等待审核的用户</td></tr>
</c:if>
<c:forEach items="${plist}" var="p" varStatus="x">
<tr id="tr_${p.id}">
<td>${x.index+1}</td>
<td>${p.customer.name}</td>
<td>${p.title}</td>
<td>
<fmt:formatDate value="${p.pubTime}" pattern="yyyy年MM月dd日"/>
</td>
<td>
 <c:if test="${p.state eq 1}">未开始</c:if>
 <c:if test="${p.state eq 2}">调查开始</c:if>
 <c:if test="${p.state eq 3}">调查结束</c:if>
 <c:if test="${p.state eq 4}">完成报告</c:if>
</td>
<td>
  <c:if test="${p.state eq 1}">计划未开始</c:if>

  <c:if test="${p.state eq 2}">
  <fmt:formatDate value="${p.startDate}" pattern="yyyy年MM月dd日"/>
   -
  <fmt:formatDate value="${p.endDate}" pattern="yyyy年MM月dd日"/>
  </c:if>
  <c:if test="${p.state eq 3}">调查结束</c:if>
 <c:if test="${p.state eq 4}">完成报告</c:if>
</td>
<td align="center" id="td_${p.id}">
    <c:if test="${p.state eq 1}">
       <button class="show" onclick="window.location='<%=path %>/paper.do?method=ShowPaper&pid=${p.id}'">预览</button>
       <button class="plan" onclick="makeplan('${p.id}')">制定调查计划</button>
       <button class="show" onclick="window.location='<%=path %>/customerMgr.do?method=BackPaper&pid=${p.id}'">返回</button>
    </c:if>   
    <c:if test="${p.state eq 2}">
       <button class="show" onclick="window.location='<%=path %>/paper.do?method=ShowPaper&pid=${p.id}'">预览</button>
       <button class="result" onclick="window.location='<%=path %>/paper.do?method=voteResult&pid=${p.id}'">调查数据</button>
       <button class="stop" onclick="stopVote('${p.id}','${p.title}')">停止调查</button>
       <button class="address" onclick="getURL('${p.id}')">获取调查地址</button>
    </c:if>   
    <c:if test="${p.state eq 3}">
       <button class="show" onclick="window.location='<%=path %>/paper.do?method=ShowPaper&pid=${p.id}'">预览</button>
       <button class="result" onclick="window.location='<%=path %>/paper.do?method=voteResult&pid=${p.id}'">调查数据</button>
       <button class="wirte" onclick="window.location='<%=path %>/front/paper/writeResult.jsp?pid=${p.id}'">撰写调查 报告</button>
    </c:if>   
      <c:if test="${p.state eq 4}">
       <button class="show" onclick="window.location='<%=path %>/paper.do?method=ShowPaper&pid=${p.id}'">预览</button>
       <button class="showwirte">查看报告</button>
    </c:if>   
</td>
</tr>
</c:forEach>
</tbody>
原创粉丝点击