# double-opt-in/2.13/templates/list-optins.php

Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification, version 2.13. 138 lines.

- Page: https://pluginprobe.com/plugins/double-opt-in/2.13/code/templates/list-optins.php
- Raw: https://pluginprobe.com/plugins/double-opt-in/2.13/raw/templates/list-optins.php
- Modified: 2022-12-16T11:04:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/double-opt-in/2.13/code/templates/list-optins.php#L10-L20`.

```php
<?php
/**
 * @var string                                           $domain
 * @var array<forge12\contactform7\CF7DoubleOptIn\OptIn> $listOfOptIns
 * @var int                                              $numberOfPages
 * @var int                                              $currentPage
 * @var string                                           $slug
 */
?>
<form action="" method="get">
    <input type="hidden" name="page" value="<?php esc_attr_e(sanitize_text_field($_GET['page'])); ?>"/>
    <input type="hidden" name="pageNum" value="<?php esc_attr_e($currentPage); ?>"/>
    <?php if (isset($_GET['id'])): ?>
        <input type="hidden" name="id" value="<?php esc_attr_e((int)$_GET['id']); ?>"/>
    <?php endif; ?>
    <ul class="ui-table-filter">
        <?php do_action('f12_cf7_doubleoptin_ui_table_filter'); ?>
    </ul>
</form>

<form action="" method="post">
    <table>
        <tr>
            <th></th>
            <th>
                <?php _e('ID', 'double-opt-in'); ?>
            </th>
            <th>
                <?php _e('Hash', 'double-opt-in'); ?>
            </th>
            <th>
                <?php _e('E-Mail', 'double-opt-in'); ?>
            </th>
            <th>
                <?php _e('Category', 'double-opt-in'); ?>
            </th>
            <th>
                <?php _e('Form ID', 'double-opt-in'); ?>
            </th>
            <th>
                <?php _e('Confirmed ? ', 'double-opt-in'); ?>
            </th>
            <th>
                <?php _e('Registration Date', 'double-opt-in'); ?>
            </th>
        </tr>
        <?php foreach ($listOfOptIns as $OptIn/** @var OptIn $OptIn */) : ?>
            <tr>
                <td>
                    <input type="checkbox" name="optin-id[]" value="<?php esc_attr_e($OptIn->get_id()); ?>"/>
                </td>
                <td>
                    <div class="f12-cf7-details" data-hash="<?php esc_attr_e($OptIn->get_hash()); ?>">
                        <?php echo esc_html($OptIn->get_id()); ?>
                    </div>
                </td>
                <td>
                    <a href="javascript:void(0)" class="f12-cf7-details"
                       data-hash="<?php esc_attr_e($OptIn->get_hash()); ?>"
                       title="<?php _e('Show details', 'double-opt-in'); ?>"><?php esc_attr_e($OptIn->get_hash()); ?></a>
                    <div class="on-hover">
                        <a href="<?php echo admin_url('admin.php?page=f12-cf7-doubleoptin_optin_view&hash=' . esc_attr($OptIn->get_hash())); ?>"><?php _e('Details', 'double-opt-in'); ?></a>
                    </div>
                </td>
                <td>
                    <div class="f12-cf7-details" >
                        <?php echo esc_html($OptIn->get_email()); ?>
                    </div>
                </td>
                <td>
                    <?php
                    if (0 === $OptIn->get_category()) {
                        echo '---';
                    } else {
                        $Category = \forge12\contactform7\CF7DoubleOptIn\Category::get_by_id($OptIn->get_category());

                        if (null === $Category) {
                            echo '---';
                        } else {
                            $link = admin_url('admin.php') . '?page=f12-cf7-doubleoptin_categories_view&id=' . esc_attr($Category->get_id());
                            echo '<a href="' . esc_url_raw($link) . '">' . esc_attr($Category->get_name()) . '</a>';
                        }
                    }
                    ?>
                </td>
                <td>
                    <?php
                    $form = '';
                    if ($OptIn->isType('cf7')) {
                        $formObject = \WPCF7_ContactForm::get_instance($OptIn->get_cf_form_id());
                        if ($formObject) {
                            $form = '<a href="admin.php?page=wpcf7&post=' . esc_attr($formObject->id()) . '&action=edit" target="_blank" rel="noopener noreferrer"> ' . esc_html($formObject->title()) . '</a>';
                        }
                    }
                    if ($OptIn->isType('avada')) {
                        $formObject = get_post($OptIn->get_cf_form_id());
                        if ($formObject) {
                            $form = '<a href="admin.php?page=wpcf7&post=' . esc_attr($formObject->ID) . '&action=edit" target="_blank" rel="noopener noreferrer"> ' . esc_html($formObject->post_title) . '</a>';
                        }
                    }
                    echo wp_kses($form, array('a' => array('href' => array(), 'target' => '', 'rel' => '')));
                    ?>
                </td>
                <td>
                    <?php if($OptIn->is_confirmed()):?>
                        <div class="dashicons dashicons-yes"></div>
                    <?php else:?>
                        <div class="dashicons dashicons-no"></div>
                    <?php endif;?>

                    <?php ($OptIn->is_confirmed()) ? _e('Yes', 'double-opt-in') : _e('No', 'double-opt-in'); ?>
                </td>
                <td>
                    <?php
                    /**
                     * Compatibility < 1.3.2
                     */
                    echo esc_html($OptIn->get_createtime('formatted'));
                    ?>
                </td>
            </tr>
        <?php endforeach; ?>
    </table>
    <ul class="ui-table-options">
        <?php do_action('f12_cf7_doubleoptin_ui_table_options'); ?>
        <?php wp_nonce_field('f12_cf7_doubleoptin_ui_table_options_action', 'f12_cf7_doubleoptin_ui_table_options_nonce'); ?>
    </ul>
</form>
<div class="tablenav-pages">
    <?php for ($i = 1; $i <= $numberOfPages; $i++):
        $link = apply_filters('f12_cf7_doubleoptin_pagination_link', admin_url('admin.php'), array('page' => sanitize_text_field($_GET['page']), 'pageNum' => $i));
        ?>
        <a href="<?php echo esc_url($link); ?>"
           class="button <?php echo ($currentPage) == $i ? 'active' : ''; ?>">
            <?php echo esc_html($i); ?>
        </a>
    <?php endfor; ?>
</div>
```
