<%@ page extends="oneit.servlets.jsp.JSPInclude" %>

<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>

<%
    Company company         =  (Company) getData(request, "Company"); 
    boolean isReplace       =  (boolean) getData(request, "IsReplace"); 
    boolean isEdit          =  (boolean) getData(request, "IsEdit"); 
    String  replaceCardPage =   WebUtils.getSamePageInRenderMode(request, "ReplaceCard");
    String  editCardPage    =   WebUtils.getSamePageInRenderMode(request, "EditCard");
    Card    card            =   company.getCard();
%>
<oneit:dynIncluded>
    <div class="form-group row">
        <div class="col-lg-3 col-md-3 col-sm-3">
            <label>Card on file</label>
        </div>
        <div class="col-lg-5 col-md-5 col-sm-5" style="margin-top: -20px;">
            <img src="<%= card.getBrand() == "MasterCard" ? "images/master.svg" : "images/visa.svg" %>" style="width:60px;"/>
            <label><%= company.getCardNumber(card) %></label>
        </div>
        <div class="col-lg-2 col-md-2 col-sm-2">
            <oneit:button   value=" "    name="gotoPage"  skin="link" cssClass="<%= "edit-card-link " + (isEdit ? "" : "deselected-link")%>"
                            requestAttribs="<%= CollectionUtils.mapEntry("nextPage", editCardPage)
                                                                .toMap() %>">
                Edit Card
            </oneit:button>                                                    
        </div>
        <div class="col-lg-2 col-md-2 col-sm-2">
            <oneit:button   value=" "    name="gotoPage"  skin="link" cssClass="<%= "edit-card-link " + (isReplace ? "" : "deselected-link")%>"
                            requestAttribs="<%= CollectionUtils.mapEntry("nextPage", replaceCardPage)
                                                                .toMap() %>">
                Replace Card
            </oneit:button>                                                    
        </div>
    </div>
</oneit:dynIncluded>

