<?php
/**
 * @package WordPress
 * @subpackage Campoal
 */

global $post;

$give_prefix 		= '_give_';

$post_type = get_post_type($post->ID);
if ($post_type != 'give_forms') {
    $form_id = get_post_meta($post->ID, $post_type . '_post_id', true);
} else {
    $form_id = $post->ID;
}

$petition_id        = get_post_meta($form_id, $give_prefix . 'petition_id', true);

// check user has purchases
$user_contribute    = conikal_user_purchased_donation($form_id);

$reveal_label 		= get_post_meta($form_id, '_give_reveal_label', true);
?>

<div class="ui sticky mobile-sign-btn display-mobile only" id="mobile-sign-btn<?php echo esc_attr($form_id) ?>" data-id="<?php echo esc_attr($form_id) ?>">
    <div class="ui attached segment">
        <div class="ui grid mobile only">
            <div class="sixteen wide column">
                <a href="#donate-sticky<?php echo esc_attr($form_id) ?>" class="ui primary fluid large button">
                    <?php if ($user_contribute == false ) : ?>
                        <?php echo conikal_custom_icon('donate') ?>
                        <?php echo sprintf(esc_html__('%s to Project', 'campoal'), $reveal_label) ?>
                    <?php else : ?>
                        <?php echo conikal_custom_icon('share') ?>
                        <?php esc_html_e('Share this Project', 'campoal') ?>
                    <?php endif; ?>
                </a>
            </div>
        </div>
    </div>
</div>
