<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title><%site_title%>: Payment</title>
<%include include_common_head.html%>
</head>
<body id="payment">
<%include include_accessibility.html%>
  <div id="wrapper">
<%include include_header.html%>
<%include include_contentheader.html%>
    <div id="ocwrapper" class="clear">
      <div id="icwrapper" class="clear">
<%include include_leftsidebar.html%>
        <div id="contentwrapper" class="shadowleft">
<%include include_contentwrapper_top.html%>
          <div class="shadowtop"><div class="shadowtopleft"></div><div class="shadowtopright"></div></div>
          <div class="shadowright">
            <div id="content">
<%include include_content_top.html%>

<div class="crumb"><%Links::Utils::format_title($main_title_loop, separator => $crumb_separator, no_escape_separator => $no_escape_crumb_separator, include_home => 1, link_type => 2)%></div>
<h2>Payment</h2>

<%include link.html%>

<p>
<%~if payment_mode == 2%>
  You have the option of paying to have your link displayed at the top of this category.  Choose a payment selection listed below, or choose to submit it as a free link, and click "Next".
<%~else%>
  You are required to make a payment to add a link to this category.  Choose one of the payment methods listed below and click "Next" to make a payment.
<%~endif%>
</p>

<p>
  <%if Payment_Description%><%Payment_Description%><%else%><%payment_description%><%endif%>
</p>

<%if discount_description~%>
<p>
  <em><%discount_description%></em>
</p>
<%~elsif discount_percent%>
<p>
  <em>Payment costs have been discounted by <%discount_percent%>% for this link.</em>
</p>
<%~endif%>

<form action="<%config.db_cgi_url%>/<%if modify%>modify<%else%>add<%endif%>.cgi" method="post">
  <input type="hidden" name="process_payment" value="1" />
  <input type="hidden" name="do" value="payment_method" />
  <input type="hidden" name="last_step" value="term" />
  <input type="hidden" name="last_page" value="payment" />
  <input type="hidden" name="cat_id" value="<%escape_html cat_id%>" />
  <input type="hidden" name="link_id" value="<%escape_html link_id%>" />
  <%if modify%><input type="hidden" name="modify" value="1" /><%endif%>

<%if signup and not wasPaid%>
  <p>
    <strong>
    <%~if renewal_differs%>
      Initial payment:
    <%~else%>
      Single Payment:
    <%~endif%>
    </strong><br />
  <%~loop signup%>
    <input type="radio" id="payment_term-<%term%>" name="payment_term" value="<%escape_html term%>"<%if last_chosen and last_chosen eq $term and not last_recurring%> checked="checked"<%endif%> class="radio" />
    <label for="payment_term-<%term%>"><%Links::Payment::currency($cost)%>: <%if term_num and term_unit%><%term_num%> <%term_unit%><%else%>Lifetime<%endif%></label><br />
  <%~endloop%>
  </p>
<%endif%>

<%if renewal_differs or wasPaid%>
  <p>
  <%~if wasPaid%>
    <strong>Renewal payment:</strong><br />
  <%~elsif recurring and Links::Payment::recurring_enabled%>
    If using a single payment, the following renewal options are available after making the initial payment:<br />
  <%~else%>
    The following renewal options are available after making the initial payment:<br />
  <%~endif%>

<%~loop renewal%>
  <%if wasPaid%><input type="radio" id="payment_term-<%term%>" name="payment_term" value="<%escape_html term%>"<%if last_chosen and last_chosen eq $term and not last_recurring%> checked="checked"<%endif%> class="radio" /><%endif%>
  <%if wasPaid%><label for="payment_term-<%term%>"><%endif%><%Links::Payment::currency($cost)%>: <%if term_num and term_unit%><%term_num%> <%term_unit%><%else%>Lifetime<%endif%><%if wasPaid%></label><%endif%><br />
<%~endloop%>
  </p>
<%endif%>

<%if recurring and Links::Payment::recurring_enabled%>
  <p>
    <strong>Automatically recurring payments:</strong><br />
  <%~loop recurring%>
    <input type="radio" id="payment_term-<%term%>-rec" name="payment_term" value="<%escape_html term%>-rec"<%if last_chosen and last_chosen eq $term and last_recurring%> checked="checked"<%endif%> class="radio" />
    <label for="payment_term-<%term%>-rec"><%Links::Payment::currency($cost)%> <%if term_num == 1%>per <%term_unit%><%else%> every <%term_num%> <%term_unit%><%endif%></label><br />
  <%~endloop%>
  </p>
<%endif%>

<%if payment_mode == 2%>
  <p>
    No thanks, submit this as a free link<br />
    <input type="radio" id="payment_term-free" name="payment_term" value="free" class="radio" />
    <label for="payment_term-free">Free</label>
  </p>
<%endif%>

  <div class="formsubmit">
    <input type="submit" name="next" value="Next" class="submit" />
  </div>
</form>

<%include include_content_bottom.html%>
            </div>
          </div>
          <div class="shadowbottom"><div class="shadowbottomleft"></div><div class="shadowbottomright"></div></div>
<%include include_contentwrapper_bottom.html%>
        </div>
<%include include_rightsidebar.html%>
      </div>
    </div>
<%include include_contentfooter.html%>
<%include include_footer.html%>
  </div>
</body>
</html>
