<%@ page contentType="text/html;charset=Shift_JIS" language="java" %>
<%-- 共通ページヘッダ --%>
<%@ include file="/jsp/common/PageHeader.inc" %>
<%-- bean --%>
<jsp:useBean id="countBug" scope="session" type="BugCount" />

<html:html locale="true">
<head>
  <title><bean:message key="info.title.displayname" /></title>
<html:base/>
<LINK rel="stylesheet" href="style.css">
</head>
<body>
<!--======================= メニュー１ ==============================-->
<%@ include file="/jsp/common/Menu1.inc" %>
<!--======================= メニュー１ end ==========================-->
<br>
<table border="0" cellspacing="2" cellpadding="3">
  <tr> 
    <td class="label3"><bean:message key="information.displayname" />
    </td>
    <td class="label3"><bean:message key="info.last20.displayname" />
    </td>
  </tr>
  <tr> 
  	<!-- お知らせ -->
    <td class="label1a" valign="top" >
      <bean:write name="sysconf" property="sysinfoString" filter="false" />
    </td>
      <!-- 直近の故障一覧 -->
    <td class="bak1a" align="left" valign="top" rowspan="3">
      <table border="0" cellspacing="2" cellpadding="3">
         <tr class="bak2" > 
          <td><bean:message key="updateDateTime.displayname" /></td>
          <td><bean:message key="bno.displayname" /></td>
          <td><bean:message key="title.displayname" /></td>
          <td><bean:message key="severity.displayname" /></td>
          <td><bean:message key="status.displayname" /></td>
          <td><bean:message key="functionName.displayname" /></td>
          <td><bean:message key="assign.displayname" /></td>
        </tr>
        <logic:iterate id="bug" name="updateBug" scope="session" type="InfoBug" length="20">
           <tr class="bak1a" > 
             <td><bean:write name="bug" property="updateDateString" /></td>
             <td>
               <html:link forward="/showAll" name="bug" property="mapping">
                 <bean:write name="bug" property="bnoString" />
               </html:link>
             </td>
             <td><bean:write name="bug" property="shortTitle" /></td>
             <td><bean:write name="bug" property="severityString" /></td>
             <td><bean:write name="bug" property="statusString" /></td>
             <td><bean:write name="bug" property="functionLabel" /></td>
             <td><bean:write name="bug" property="dispatchName" /></td>
             <!-- <td><img src="images/title_icon.gif" alt="<%= bug.getTitle()%>" ></td> -->
           </tr>
        </logic:iterate>
      </table>
    </td>
  </tr>
  <tr>
    <td  class="label3"><bean:message key="info.shortCut.displayname" />
    </td>
  </tr>
  <tr>
    <td class="label1a" valign="top"> 
        <!-- 現在の故障数 -->
        <bean:message key="count1.displayname" /><b>
        <bean:write name="countBug" property="count" />
        </b><bean:message key="count2.displayname" /><br>
        <br>
    	<!-- 前回ログオフ後に更新された故障(直近20件) -->
        <b><bean:message key="info.newbug.displayname" /></b><br>
          <a href="../serch.do?action=submit&issuDate=on&amp;pastDate=0">[<bean:message key="info.today.displayname" />]</a>
          <a href="../serch.do?action=submit&issuDate=on&amp;pastDate=1">[<bean:message key="info.last1.displayname" />]</a>
          <a href="../serch.do?action=submit&issuDate=on&amp;pastDate=2">[<bean:message key="info.last2.displayname" />]</a>
          <a href="../serch.do?action=submit&issuDate=on&amp;pastDate=7">[<bean:message key="info.last7.displayname" />]</a>
        <br>
    	<!-- 修正が完了した故障 -->
        <b><bean:message key="info.update.displayname" /></b><br>
          <a href="../serch.do?action=submit&bugUpdateDate=on&pastDate=0">[<bean:message key="info.today.displayname" />]</a>
          <a href="../serch.do?action=submit&bugUpdateDate=on&pastDate=1">[<bean:message key="info.last1.displayname" />]</a>
          <a href="../serch.do?action=submit&bugUpdateDate=on&pastDate=2">[<bean:message key="info.last2.displayname" />]</a>
          <a href="../serch.do?action=submit&bugUpdateDate=on&pastDate=7">[<bean:message key="info.last7.displayname" />]</a>
        <br><br>
    	<!-- 方針決定待ちの故障 -->
        <a href="../serch.do?action=submit&status=1&status=6"><bean:message key="status6.displayname" /></a><br><br>
    	<!-- 修正が完了していない故障 -->
        <b><bean:message key="status4.displayname" /></b><br>
        <a href="../serch.do?action=submit&severity=01&severity=02&status=1&status=3&status=4&status=5&status=6">[大以上]</a> <a href="../serch.do?action=submit&severity=01&severity=02&severity=03&severity=04&status=1&status=3&status=4&status=5&status=6">[小以上]</a> <a href="../serch.do?action=submit&status=1&status=3&status=4&status=5&status=6">[全部]</a><br>
        <br>
    	<!-- 範囲指定 -->
        <b><bean:message key="range.displayname" /></b><br>
<%
    int count = (int)countBug.getCount();
    int loop = (count/50) + 1;	//loop回数算出
    java.text.NumberFormat nf = new java.text.DecimalFormat("0000");
    for (int i = 0; i < loop; i++) {
	    if ((i != 0) && (i%4 == 0)) {
		    out.print("<br>");
	    }
	    int start = i*50+1;
	    int end = (i == loop-1 ? count : (i+1)*50);
	    StringBuffer sb = new StringBuffer();
	    sb.append("<a href=\"../serch.do?action=quick&choiceBno=");
	    sb.append(start + "-" + end + "\">");
	    sb.append("[" + nf.format(start) + "- ]");
	    sb.append("</a>  ");
	    out.print(sb.toString());
	}
%>
        <br>
    </td>
  </tr>
</table>
<%-- 共通ページフッダ --%>
<%@ include file="/jsp/common/PageFooter.inc" %>
</body>
</html:html>
