Пример #1
0
 public function render_payment_option($value, $amount, $selected)
 {
     $attrs = array('class' => 'required', 'id' => $value, 'type' => 'radio', 'name' => 'payment_term', 'value' => $value);
     if ($value == $selected) {
         $attrs['checked'] = 'checked';
     }
     $html = sprintf('<input %s>', awpcp_render_attributes($attrs));
     $html .= sprintf('&nbsp;<label for="%s">%s</label>', esc_attr($value), esc_html($amount));
     return $html;
 }
if ($show_payment_terms) {
    ?>
    <h3><?php 
    _e('Please select a payment term for your Ad', 'AWPCP');
    ?>
</h3>

    <?php 
    echo awpcp_form_error('payment-term', $form_errors);
    ?>
    <?php 
    echo $table->render();
    ?>

    <?php 
    echo $this->render_credit_plans_table($transaction);
} else {
    ?>
    <?php 
    $items = $table->get_items();
    ?>
    <?php 
    $value = $table->item_id($items[0], array_shift($accepted_payment_types));
    ?>
    <?php 
    $attrs = array('type' => 'hidden', 'name' => 'payment_term', 'value' => $value);
    ?>
    <?php 
    echo sprintf('<input %s>', awpcp_render_attributes($attrs));
}