<%@ 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");
    String  cardNumber      =   company.getCardNumber();
    Job     job             =   (Job) process.getAttribute("Job");
    Boolean ppj             =   (Boolean) process.getAttribute("PPJ");
%>
<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="<%= company.getStripeBrand().equals("MasterCard") ? "images/master.svg" : "images/visa.svg" %>" style="width:60px;"/>
            <label><%= cardNumber %></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)
                                                                .mapEntry("procParams", CollectionUtils.mapEntry("Job", job)
                                                                .mapEntry("PPJ", ppj).toMap())
                                                                .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)
                                                                .mapEntry("procParams", CollectionUtils.mapEntry("Job", job)
                                                                .mapEntry("PPJ", ppj).toMap())
                                                                .toMap() %>">
                Replace Card
            </oneit:button>                                                    
        </div>
    </div>
</oneit:dynIncluded>

