<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/displaytag-12.tld" prefix="display" %>
<%@ taglib uri="http://ajaxtags.org/tags/ajax" prefix="ajax" %>
<jsp:include page="/ampiere/jsp/common/includeYAHOOUI.jsp" flush="true" /> 
<html>
<head>
<title><bean:write name="searchInfoFormBPartner" property="title"/></title>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/ampiere/css/import.css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/ampiere/ajax/js/prototype-1.4.0.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/ampiere/ajax/js/scriptaculous.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/ampiere/ajax/js/overlibmws.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/ampiere/ajax/js/ajaxtags-1.2-beta1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/ampiere/js/window.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/ampiere/js/search.js"></script>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/ampiere/css/window.css"/>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/ampiere/css/displaytag.css" />
<%@ page import="com.ampiere.util.AmpiereUtil" %>
<%!
String getColTitle(Object obj, int idx) {
	if (obj == null) { return "&nbsp;"; } else { String s = AmpiereUtil.sanitizing(((com.ampiere.search.ColBean)obj).getColTitle(idx)); if (s == null || "".equals(s) || " ".equals(s)) { return "&nbsp;"; } else { return s; } }
}
String getColData(Object obj, int idx) {
	if (obj == null) { return "&nbsp;"; } else { Object o = (((com.ampiere.search.ColBean)obj).getColData(idx)); if (o == null) { return "&nbsp;"; } else { String s = AmpiereUtil.sanitizing(o.toString()); if (s == null || "".equals(s) || " ".equals(s)) { return "&nbsp;"; } else { return s; } } }
}
%>
</head>

<!-- header -->
<body id="popup" <% if ("1".equals(request.getAttribute("doQuery"))) { %> onload="doQuery();" <% } %> onunload="closeMyChildren();">

	<table width="100%" >
	<tr>
	<td>
<div id="header">
		<h1><bean:write name="searchInfoFormBPartner" property="title"/></h1>
</div>
	</td>
    <td valign="top" width="18">
    <div id="progressMsg" style="padding-top:1px;display:none;"><img src="${pageContext.request.contextPath}/ampiere/images/Loading-0.gif" /></div>
    </td>
    </tr>
	</table>

<!-- header -->


<!-- body -->
<div id="body" >
<div class="search-box">

    <html:form styleId="infoLookupForm" target="_self" action="/ampiere/InfoBPartnerSearchAction.do" enctype="application/x-www-form-urlencoded" focus="value">
    	<div>
    	<html:hidden name="searchInfoFormBPartner" property="windowNo"/>
    	<html:hidden name="searchInfoFormBPartner" property="columnName"/>
    	<html:hidden name="searchInfoFormBPartner" property="column_ID"/>
		</div>
        <table class="popupInfoTable" align="center">
        <tr>
            <th scope="row"><bean:write name="searchInfoFormBPartner" property="valueLabel"/></th>
            <td><html:text name="searchInfoFormBPartner" property="value" styleClass="w165"/></td>
            <th><bean:write name="searchInfoFormBPartner" property="contactLabel"/></th>
            <td><html:text name="searchInfoFormBPartner" property="contact" styleClass="w165"/></td>
            <th><bean:write name="searchInfoFormBPartner" property="phoneLabel"/></th>
            <td><html:text name="searchInfoFormBPartner" property="phone" styleClass="w165"/></td>
            <td><html:checkbox name="searchInfoFormBPartner" property="checkCustomerStatus"><bean:write name="searchInfoFormBPartner" property="checkCustomer"/></html:checkbox></td>
        </tr>
        <tr>
            <th scope="row"><bean:write name="searchInfoFormBPartner" property="nameLabel"/></th>
            <td><html:text name="searchInfoFormBPartner" property="name" styleClass="w165"/></td>
            <th><bean:write name="searchInfoFormBPartner" property="emailLabel"/></th>
            <td><html:text name="searchInfoFormBPartner" property="email" styleClass="w165"/></td>
            <th><bean:write name="searchInfoFormBPartner" property="postalLabel"/></th>
            <td><html:text name="searchInfoFormBPartner" property="postal" styleClass="w165"/></td>
            <td><html:checkbox name="searchInfoFormBPartner" property="checkANDStatus"><bean:write name="searchInfoFormBPartner" property="checkAND"/></html:checkbox></td>
        </tr>
        <tr>
            <td colspan="7" class="button-box align-right" scope="row">
            <html:button property="search" onclick="doQuery();"><bean:write name="searchInfoFormBPartner" property="searchBtnTitle"/></html:button>
            </td>
        </tr>
        </table>
    </html:form>

</div>

<!-- displayTagFrame -->

    <ajax:displayTag id="displayTagFrame" ajaxFlag="displayAjax">
      <display:table id="oneObject" name="searchResultBPartner" class="displaytag" pagesize="10" scope="session"
        defaultsort="2" defaultorder="ascending" export="true" excludedParams="ajax" sort="list" cellpadding="0" cellspacing="0">
        <display:column title="<%=getColTitle(oneObject, 0)%>" media="html" class="align-center" sortable="false">
            <input type="radio" id="radioSelect" name="radioSelect" value="<bean:write name='oneObject' property='colId'/>________<bean:write name='oneObject' property='colName'/>" ondblclick="updateInfo('<bean:write name="searchInfoFormBPartner" property="columnName"/>');return false;"/>
        </display:column>
        <%-- Key --%>
        <display:column title="<%="&nbsp;" + getColTitle(oneObject, 1) + "&nbsp;"%>" sortable="true" headerClass="sortable"><%=getColData(oneObject, 1)%></display:column>
        <%-- Name --%>
        <display:column title="<%="&nbsp;" + getColTitle(oneObject, 2) + "&nbsp;"%>" sortable="true" headerClass="sortable"><%=getColData(oneObject, 2)%></display:column>
        <%-- Contact --%>
        <display:column title="<%="&nbsp;" + getColTitle(oneObject, 3) + "&nbsp;"%>" sortable="true" headerClass="sortable"><%=getColData(oneObject, 3)%></display:column>
        <%-- Credit available --%>
        <display:column title="<%=getColTitle(oneObject, 4)%>" class="rightalign"><%=getColData(oneObject, 4)%></display:column>
        <%-- Credit used --%>
        <display:column title="<%=getColTitle(oneObject, 5)%>" class="rightalign"><%=getColData(oneObject, 5)%></display:column>
        <%-- Phone --%>
        <display:column title="<%=getColTitle(oneObject, 6)%>"><%=getColData(oneObject, 6)%></display:column>
        <%-- ZIP --%>
        <display:column title="<%=getColTitle(oneObject, 7)%>"><%=getColData(oneObject, 7)%></display:column>
        <%-- City --%>
        <display:column title="<%=getColTitle(oneObject, 8)%>"><%=getColData(oneObject, 8)%></display:column>
        <%-- Open Balance --%>
        <display:column title="<%=getColTitle(oneObject, 9)%>" class="rightalign"><%=getColData(oneObject, 9)%></display:column>
        <%-- Revenue --%>
        <display:column title="<%=getColTitle(oneObject, 10)%>" class="rightalign"><%=getColData(oneObject, 10)%></display:column>
      </display:table>
    </ajax:displayTag>

<!-- body-footer -->
<div class="bottomMenuRight">
<table>
	<tr>
	<td>
	<font color="#EE0000"><i><bean:write name='searchInfoFormBPartner' property='largeRecords'/></i></font>
	</td>
	<td class="lbl" style="padding-right:5px;">
	<input id="ok" type="image" src="${pageContext.request.contextPath}/ampiere/images/Ok32.png" onclick="updateInfo('<bean:write name="searchInfoFormBPartner" property="columnName"/>');return false;" alt="<bean:write name='searchInfoFormBPartner' property='submitBtnTitle'/>"/>
	<span>OK</span>	
	<input id="cancel" type="image" src="${pageContext.request.contextPath}/ampiere/images/Cancel32.png" onclick="window.close();return false;" alt="<bean:write name='searchInfoFormBPartner' property='closeBtnTitle'/>"/>
	<span>キャンセル</span>	
	</td>
	</tr>
	</table>
</div>
<!-- /body-footer -->
</div>
<!-- /body -->
</body>
</html>
