jsp
乾電池 2013-03-12 01:47:30 <%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="/tags/struts-logic" prefix="l"%>
<%@ taglib uri="/tags/struts-bean" prefix="b"%>
<%@ taglib uri="/tags/struts-nested" prefix="n"%>
<%@ taglib uri="/tags/struts-html" prefix="h"%>
<%@ taglib uri="/tags/seriola-s2struts-html" prefix="sh"%>
<%@ page import="jp.co.ogis_ri.seriola.s2struts.action.MessageCategory"%>
<sh:javaScript src="/js/seriola-s2struts.js" charset="shift_jis"></sh:javaScript>
<sh:css href="/css/common.css" charset="shift_jis"></sh:css>
<sh:css href="/css/Header.css" charset="shift_jis"></sh:css>
<sh:css href="/css/Dashboard.css" charset="shift_jis"></sh:css>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
<title>ダッシュボード画面</title>
</head>
<body>
<n:form action="/dashboardSearch" enctype="multipart/form-data">
<div id="dashboard_wrap" class="wrap">
<div id="header">
<jsp:include page="/WEB-INF/jsp/Header.jsp"></jsp:include>
</div>
<table>
<tr>
<td id="message">
<sh:message category="<%=MessageCategory.PROPERTY_ERROR %>"
styleClass="errorMsgStyle" />
<sh:message category="<%=MessageCategory.PROPERTY_INFO %>"
styleClass="infoMsgStyle" />
</td>
</tr>
</table>
<div id="search">
<div id="lsearch">
<div class="frame">
<span class="title">スレッドを表示</span><br/>
<span class="condition">問い合わせID:
<h:text name="dashboardForm" property="threadID" size="5"></h:text>
</span>
<span class="condition">製品:
<h:select name="dashboardForm" property="productShowID" styleClass="required " tabindex="2" style="width:150px;" >
<h:option value=""></h:option>
<n:iterate id="product" name="dashboardForm" property="products">
<h:option value="${product.id }"><b:write name="product" property="name"/></h:option>
</n:iterate>
</h:select>
</span>
<span class="button"><input type="button" value="表示" onclick="performShowthread();"></input></span>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div class="frame">
<span class="title">ステータスで検索</span><br/>
<span class="condition">製品:
<h:select name="dashboardForm" property="productSearchStatusID" styleClass="required " tabindex="2" style="width:150px;" >
<h:option value=""></h:option>
<n:iterate id="product" name="dashboardForm" property="products">
<h:option value="${product.id }"><b:write name="product" property="name"/></h:option>
</n:iterate>
</h:select>
</span>
<span class="condition">ステータス:
<h:select name="dashboardForm" property="statusID" tabindex="2" >
<h:option value="" style="select"></h:option>
<n:iterate id="statu" name="dashboardForm" property="status">
<h:option value="${statu.id }"><b:write name="statu" property="name"/></h:option>
</n:iterate>
</h:select>
</span>
<span class="button"><input type="button" value="検索" onclick="performSearchByStatus();"></input></span>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div class="frame">
<span class="title">受付期間で検索</span><br/>
<span class="condition">製品:
<h:select name="dashboardForm" property="productSearchDateID" styleClass="required " tabindex="2" style="width:150px;" >
<h:option value=""></h:option>
<n:iterate id="product" name="dashboardForm" property="products">
<h:option value="${product.id }"><b:write name="product" property="name"/></h:option>
</n:iterate>
</h:select>
</span>
<span class="condition">
<select id="startYear">
<h:hidden name="dashboardForm" property="startYear"/>
</select>
<select id="startMonth">
<h:hidden name="dashboardForm" property="startMonth"/>
</select>
<select id="startDay">
<h:hidden name="dashboardForm" property="startDay"/>
</select> ~<br/>
<select class="endDate" id="endYear">
<h:hidden name="dashboardForm" property="endYear"/>
</select>
<select class="endDate" id="endMonth">
<h:hidden name="dashboardForm" property="endMonth"/>
</select>
<select class="endDate" id="endDay">
<h:hidden name="dashboardForm" property="endDay"/>
</select>
</span>
<span class="sbutton"><input type="button" value="検索" onclick="performSearchByDate();"></input></span>
<div class="clear"></div>
</div>
</div>
<div id="rsearch">
<div class="frame">
<span class="title">連絡事項</span><br/>
<textarea id="communityContent"></textarea>
</div>
<div id="status" class="frame">
<span class="title">状態</span><br/>
<table id="title">
<tr>
<td width="40%">製品</td>
<td width="20%">新規</td>
<td width="20%">着手</td>
<td width="20%">保留</td>
</tr>
</table>
<div>
<table id="statuContent">
<tr>
<td width="40%">Palamida</td>
<td width="20%">2</td>
<td width="20%">1</td>
<td width="20%">0</td>
</tr>
<tr>
<td width="40%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
</tr>
<tr>
<td width="40%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div id="result">
<span>スレッド一覧</span><br/>
<div id="title_area">
<table id="title" cellspacing="0" cellpadding="0">
<tr>
<td width="10%">ID</td>
<td width="10%">ステータス</td>
<td width="20%">日時</td>
<td width="50%">Subject</td>
<td width="10%" id="endtd">コメント</td>
</tr>
</table>
</div>
<div id="content_area">
<l:notEmpty name="dashboardForm" property="threads">
<table id="content" cellspacing="0" cellpadding="0">
<n:iterate id="threads" name="dashboardForm" property="threads" >
<tr ondblclick="forword('${threads.id}')" >
<td width="10%">
<h:hidden name="threads" property="id"/>
<b:write name="threads" property="productID"></b:write></td>
<td width="10%"> <b:write name="threads" property="statusName"></b:write></td>
<td width="20%"> <b:write name="threads" property="date"></b:write></td>
<td width="50%">
<a href="#" onclick="forword('${threads.id}')">
<b:write name="threads" property="subject"></b:write></a></td>
<td width="10%"> <b:write name="threads" property="comment"></b:write></td>
</tr>
</n:iterate>
</table>
</l:notEmpty>
</div>
</div>
</div>
</n:form>
</body>
<script type="text/javascript">
initYearOption(document.getElementById("startYear"), document.getElementsByName("startYear")[0].value);
initYearOption(document.getElementById("endYear"), document.getElementsByName("endYear")[0].value);
initMonthOption(document.getElementById("startMonth"), document.getElementsByName("startMonth")[0].value);
initMonthOption(document.getElementById("endMonth"), document.getElementsByName("endMonth")[0].value);
initDayOption(document.getElementById("startDay"), document.getElementsByName("startDay")[0].value);
initDayOption(document.getElementById("endDay"), document.getElementsByName("endDay")[0].value);
function initYearOption(yearSelect, defaultYear)
{
if(defaultYear == null || defaultYear == "")
{
var date = new Date();
defaultYear = date.getFullYear();
}
var year = 1900;
for(var i=0; i < 200; i++)
{
var theOption = document.createElement("option");
theOption.innerHTML = year + 1;
theOption.value= year + 1;
yearSelect.appendChild(theOption);
year = (year + 1);
if(year == defaultYear)
{
theOption.selected = true;
}
}
}
function initMonthOption(monthSelect, defaultMonth)
{
if(defaultMonth == null || defaultMonth == "")
{
var date = new Date();
defaultMonth = date.getMonth()+1;
}
for(var i=0; i < 12; i++)
{
var theOption = document.createElement("option");
theOption.innerHTML = i + 1;
theOption.value= i + 1;
monthSelect.appendChild(theOption);
if((i+1) == defaultMonth)
{
theOption.selected = true;
}
}
}
function initDayOption(daySelect,defaultDay)
{
if(defaultDay == null || defaultDay == "")
{
var date = new Date();
defaultDay = date.getDate();
}
for(var i=0; i < 31; i++)
{
var theOption = document.createElement("option");
theOption.innerHTML = i + 1;
theOption.value= i + 1;
daySelect.appendChild(theOption);
if((i+1) == defaultDay)
{
theOption.selected = true;
}
}
}
function performShowthread() {
document.dashboardForm.action = './dashboardSearch.do?dispatch=performCheck';
document.dashboardForm.submit();
}
function performSearchByStatus() {
document.dashboardForm.action = './dashboardSearch.do?dispatch=performSearchByStatus';
document.dashboardForm.submit();
}
function performSearchByDate() {
var startYear = document.getElementById("startYear").value;
var startMonth = document.getElementById("startMonth").value;
var startDay = document.getElementById("startDay").value;
var endYear = document.getElementById("endYear").value;
var endMonth = document.getElementById("endMonth").value;
var endDay = document.getElementById("endDay").value;
var date = "&startYear="+startYear;
date = date + "&startMonth="+startMonth;
date = date + "&startDay="+startDay;
date = date + "&endYear="+endYear;
date = date + "&endMonth="+endMonth;
date = date + "&endDay="+endDay;
document.dashboardForm.action = './dashboardSearch.do?dispatch=performSearchByDate' + date;
document.dashboardForm.submit();
}
function forword(id){
document.dashboardForm.action = './showThread.do?dispatch=show&id='+id;
document.dashboardForm.submit();
}
</script>
</html>