<?php
if (!defined('ABSPATH')) {
  exit;
}
$current_currency = CHAMA_CURRENCY;
$current_symbol = CHAMA_SYMBOL;
$donation_min_limit = get_option('chama_donation_min_limit');
$donation_min_limit_cents = $donation_min_limit * CHAMA_CURRENCY_MINIMUM;
$display_min_limit = chama_get_formatted_price($donation_min_limit_cents);
$display_membership_page = get_option('chama_display_membership');
?>
<div class="chama-donation-wrapper right-col">
<div class="chama-card chama-donation-card ">
<div class="chama-card-body">
  <?php if($display_membership_page): ?>
    <h4 class="chama-item-title">Support</h4>
    <!--switch start-->
<div class="chama-tab-switch-wrapper">
    <div class="chama-tab-switch left chama-text-center">
      <div class="chama-tab active" tab-direction="left" tab="chama-one-time">One time</div><!--
      --><div class="chama-tab" tab-direction="right" tab="chama-membership">Membership</div>
    </div>
  </div>
  <!-- switch end -->
   <?php else: ?>
    <h4 class="chama-item-title">Make a one-time donation</h4>
  <?php endif; ?>
   <!--tab content start-->
   <div id="chama-tabs-content">
    <div id="chama-one-time" class="chama-tab-content">
    <?php
// show any error messages after form submission
chama_show_error_messages();?>
      <!--one-time donation-->
      <form class="chama-form chama-donation-form" action="" method="POST">
      <div class="chama-input-wrapper">
		                <div class="chama-input-prepend">
		                                    <span class="chama-input-prepend-text">
                                            <?php echo esc_html("$current_symbol"); ?>
		                                  </span>
		                                </div>
		                <input type="number" min="<?php echo esc_attr($donation_min_limit); ?>" max="999999" maxlength="7" pattern="[-+]?[0-9]*[.,]?[0-9]+" step="any" name="one_time_amount" id="one_time_amount" value="0" size="30" required class="required" data-msg-min="You must donate at least <?php echo esc_attr($display_min_limit) ?>!">
		                </div>
                    <?php if (CHAMA_PAYMENT_URL): ?>
                      <input type="hidden" name="chama_action" value="one-time"/>
                      <input type="hidden" id="chama_base_rest_url" name="chama_base_rest_url" value="<?php echo esc_url(get_rest_url(null, '/')); ?>" />                
					<input type="hidden" name="chama_one_time_nonce" value="<?php echo esc_attr(wp_create_nonce('chama-one-time-nonce')); ?>"/>
					<input type="submit" class="chama-button chama-button-medium chama-block chama-donate-button" value="<?php esc_attr_e('Donate' , 'chama');?>"/>

                        <?php endif;?>
      </form>
      <!--./one-time donation-->
    </div>
    <div id="chama-membership" class="chama-tab-content">
          <!--tiers-->
          <?php
$templates = new Chama_Template_Loader;
$templates->get_template_part('content', 'tiers');
?>
      <!--./tiers-->
    </div>
  </div>
   <!--tab content end -->
</div>
</div>
</div>



