📄 editcreditcard.jsp
字号:
<%
/**
* Title: Edit Credit Card Page
* Description: None
* Copyright (c) 2001 The Open For Business Project - www.ofbiz.org
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*@author David E. Jones
*@created Sep 1 2001
*@version 1.0
*/
%>
<%@ taglib uri="ofbizTags" prefix="ofbiz" %>
<%@ page import="java.util.*" %>
<%@ page import="org.ofbiz.base.util.*, org.ofbiz.content.webapp.pseudotag.*" %>
<%@ page import="org.ofbiz.entity.*, org.ofbiz.party.contact.*" %>
<%@ page import="org.ofbiz.accounting.payment.*" %>
<jsp:useBean id="security" type="org.ofbiz.security.Security" scope="request" />
<ofbiz:object name="userLogin" property="userLogin" type="org.ofbiz.entity.GenericValue" />
<%
String partyId = request.getParameter("party_id");
if (partyId == null) partyId = request.getParameter("partyId");
if (partyId == null) partyId = (String) request.getAttribute("partyId");
String donePage = request.getParameter("DONE_PAGE");
if(donePage == null || donePage.length() <= 0) donePage="viewprofile?partyId=" + partyId;
%>
<%PaymentWorker.getPaymentMethodAndRelated(pageContext, partyId,
"paymentMethod", "creditCard", "eftAccount", "paymentMethodId", "curContactMechId", "donePage", "tryEntity");%>
<%ContactMechWorker.getCurrentPostalAddress(pageContext, partyId,
(String) pageContext.getAttribute("curContactMechId"), "curPartyContactMech", "curContactMech",
"curPostalAddress", "curPartyContactMechPurposes");%>
<%ContactMechWorker.getPartyPostalAddresses(pageContext, partyId, (String) pageContext.getAttribute("curContactMechId"), "postalAddressInfos");%>
<%if (!security.hasEntityPermission("PAY_INFO", "_VIEW", session) && pageContext.getAttribute("creditCard") != null && pageContext.getAttribute("paymentMethod") != null &&
!userLogin.getString("partyId").equals(((GenericValue) pageContext.getAttribute("paymentMethod")).getString("partyId"))) {%>
<p><h3>The credit card specified does not belong to you, you may not view or edit it.</h3></p>
<a href='<ofbiz:url>/authview/<ofbiz:print attribute="donePage"/></ofbiz:url>' class="buttontext">[Back]</a>
<%} else {%>
<ofbiz:unless name="creditCard">
<p class="head1">Add New Credit Card</p>
<a href='<ofbiz:url>/authview/<%=donePage%></ofbiz:url>' class="buttontext">[Go Back]</a>
<%if (security.hasEntityPermission("PAY_INFO", "_CREATE", session)) {%>
<a href="javascript:document.editcreditcardform.submit()" class="buttontext">[Create]</a>
<%}%>
<form method="post" action='<ofbiz:url>/createCreditCard/<%=donePage%></ofbiz:url>' name="editcreditcardform" style='margin: 0;'>
<table width="90%" border="0" cellpadding="2" cellspacing="0">
</ofbiz:unless>
<ofbiz:if name="creditCard">
<p class="head1">Edit Credit Card</p>
<a href='<ofbiz:url>/authview/<%=donePage%></ofbiz:url>' class="buttontext">[Go Back]</a>
<%if (security.hasEntityPermission("PAY_INFO", "_UPDATE", session)) {%>
<a href="javascript:document.editcreditcardform.submit()" class="buttontext">[Save]</a>
<%}%>
<form method="post" action='<ofbiz:url>/updateCreditCard/<%=donePage%></ofbiz:url>' name="editcreditcardform" style='margin: 0;'>
<table width="90%" border="0" cellpadding="2" cellspacing="0">
<input type=hidden name='paymentMethodId' value='<ofbiz:print attribute="paymentMethodId"/>'>
</ofbiz:if>
<input type="hidden" name="partyId" value="<%=partyId%>">
<tr>
<td width="26%" align=right valign=top><div class="tabletext">Name on Card</div></td>
<td width="5"> </td>
<td width="74%">
<input type="text" class="inputBox" size="30" maxlength="60" <ofbiz:inputvalue field="nameOnCard" entityAttr="creditCard" tryEntityAttr="tryEntity" fullattrs="true"/>>
*</td>
</tr>
<tr>
<td width="26%" align=right valign=top><div class="tabletext">Company Name on Card</div></td>
<td width="5"> </td>
<td width="74%">
<input type="text" class="inputBox" size="30" maxlength="60" <ofbiz:inputvalue field="companyNameOnCard" entityAttr="creditCard" tryEntityAttr="tryEntity" fullattrs="true"/>>
</td>
</tr>
<tr>
<td width="26%" align=right valign=top><div class="tabletext">Card Type</div></td>
<td width="5"> </td>
<td width="74%">
<select name="cardType" class="selectBox">
<option><ofbiz:inputvalue field="cardType" entityAttr="creditCard" tryEntityAttr="tryEntity"/></option>
<option></option>
<option>Visa</option>
<option value='MasterCard'>Master Card</option>
<option value='AmericanExpress'>American Express</option>
<option value='DinersClub'>Diners Club</option>
<option>Discover</option>
<option>EnRoute</option>
<option>JCB</option>
</select>
*</td>
</tr>
<tr>
<td width="26%" align=right valign=top><div class="tabletext">Card Number</div></td>
<td width="5"> </td>
<td width="74%">
<input type="text" class="inputBox" size="20" maxlength="30" <ofbiz:inputvalue field="cardNumber" entityAttr="creditCard" tryEntityAttr="tryEntity" fullattrs="true"/>>
*</td>
</tr>
<%-- Should not be storing this
<tr>
<td width="26%" align="right" valign="top"><div class="tabletext">Card Security Code</div></td>
<td width="5"> </td>
<td width="74%">
<input type="text" size="5" maxlength="10" <ofbiz:inputvalue field="cardSecurityCode" entityAttr="creditCard" tryEntityAttr="tryEntity" fullattrs="true"/>>
</td>
</tr>
--%>
<tr>
<td width="26%" align=right valign=top><div class="tabletext">Expiration Date</div></td>
<td width="5"> </td>
<td width="74%">
<%String expMonth = "";%>
<%String expYear = "";%>
<%if (pageContext.getAttribute("creditCard") != null) {%>
<%String expDate = ((GenericValue) pageContext.getAttribute("creditCard")).getString("expireDate");%>
<%if (expDate != null && expDate.indexOf('/') > 0){%>
<%expMonth = expDate.substring(0,expDate.indexOf('/'));%>
<%expYear = expDate.substring(expDate.indexOf('/')+1);%>
<%}%>
<%}%>
<select name="expMonth" class="selectBox">
<option><ofbiz:if name="tryEntity"><%=UtilFormatOut.checkNull(expMonth)%></ofbiz:if><ofbiz:unless name="tryEntity"><%=UtilFormatOut.checkNull(request.getParameter("expMonth"))%></ofbiz:unless></option>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -