%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /disk/www/wwwroot/test-lingceed.echineselearning.biz/wp-content/plugins/newsletter/users/
Upload File :
Create Path :
Current File : /disk/www/wwwroot/test-lingceed.echineselearning.biz/wp-content/plugins/newsletter/users/edit.php

<?php
// phpcs:disable WordPress.WP.EnqueuedResources.NonEnqueuedScript

/** @var NewsletterUsersAdmin $this */
/** @var NewsletterControls $controls */
/** @var NewsletterLogger $logger */

defined('ABSPATH') || exit;

$user = $this->get_user((int) $_GET['id'] ?? -1);

if (!$user) {
    echo 'Subscriber not found.';
    return;
}

if ($controls->is_action('save')) {

    $controls->data = wp_kses_post_deep($controls->data);

    $email = $this->sanitize_email($controls->data['email']);
    if (empty($email)) {
        $controls->errors = esc_html__('Wrong email address', 'newsletter');
    } else {
        $controls->data['email'] = $email;
    }


    if (empty($controls->errors)) {
        $u = $this->get_user($controls->data['email']);
        if ($u && $u->id != $user->id) {
            $controls->errors = esc_html__('The email address is already in use', 'newsletter');
        }
    }

    if (empty($controls->errors)) {
        // For unselected preferences, force the zero value
        for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
            if (!isset($controls->data['list_' . $i])) {
                $controls->data['list_' . $i] = 0;
            }
        }

        if (empty($controls->data['token'])) {
            $controls->data['token'] = $this->get_token();
        }

        $controls->data['id'] = $user->id;

        // Sanitize
        $controls->data['name'] = $this->sanitize_name($controls->data['name']);
        $controls->data['surname'] = $this->sanitize_name($controls->data['surname']);
        $controls->data['wp_user_id'] = (int) $controls->data['wp_user_id'];

        for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
            if (isset($controls->data['profile_' . $i])) {
                $controls->data['profile_' . $i] = $this->sanitize_user_field($controls->data['profile_' . $i]);
            }
        }

        $user = $this->save_user($controls->data);
        $this->add_user_log($user, 'edit');
        //$this->save_user_meta($id, 'ip', $controls->data['ip']);
        if ($user === false) {
            $controls->errors = esc_html__('Error. Check the log files.', 'newsletter');
        } else {
            $controls->add_toast_saved();
            $controls->data = (array) $user;
        }
    }
}

if ($controls->is_action('delete')) {
    $this->delete_user($user->id);
    $controls->js_redirect($this->get_admin_page_url('index'));
    return;
}

if (!$controls->is_action()) {
    $controls->data = (array) $user;
}

$options_profile = NewsletterSubscription::instance()->get_options('customfields');

function percent($value, $total) {
    if ($total == 0) {
        return '-';
    }
    return sprintf("%.2f", $value / $total * 100) . '%';
}

function percentValue($value, $total) {
    if ($total == 0) {
        return 0;
    }
    return round($value / $total * 100);
}
?>

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
    google.charts.load('current', {'packages': ['corechart', 'geomap']});
</script>

<div class="wrap tnp-users tnp-users-edit" id="tnp-wrap">

    <?php include NEWSLETTER_ADMIN_HEADER ?>

    <div id="tnp-heading">
        <?php $controls->title_help('/subscribers-and-management/') ?>
        <h2><?php echo esc_html($user->email) ?></h2>
        <?php include __DIR__ . '/edit-nav.php' ?>
    </div>

    <div id="tnp-body">

        <?php $controls->show(); ?>

        <form method="post" action="">
            <?php $controls->init(); ?>

            <div id="tabs">

                <ul>
                    <li><a href="#tabs-general"><?php esc_html_e('Main', 'newsletter') ?></a></li>
                    <li><a href="#tabs-preferences"><?php esc_html_e('Lists', 'newsletter') ?></a></li>
                    <li><a href="#tabs-profile"><?php esc_html_e('Custom fields', 'newsletter') ?></a></li>
                    <li class="tnp-tabs-advanced"><a href="#tabs-other"><?php esc_html_e('Advanced', 'newsletter') ?></a></li>
                    <?php if (NEWSLETTER_DEBUG) { ?>
                        <li><a href="#tabs-meta">Meta</a></li>
                    <?php } ?>
                </ul>

                <div id="tabs-general" class="tnp-tab">

                    <?php do_action('newsletter_users_edit_general', $user->id, $controls) ?>

                    <table class="form-table">

                        <tr>
                            <th><?php esc_html_e('Email', 'newsletter'); ?></th>
                            <td>
                                <?php $controls->text_email('email', 60); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('First name', 'newsletter'); ?></th>
                            <td>
                                <?php $controls->text('name', 50); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('Last name', 'newsletter'); ?></th>
                            <td>
                                <?php $controls->text('surname', 50); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('Gender', 'newsletter'); ?></th>
                            <td>
                                <?php $controls->gender('sex'); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('Status', 'newsletter'); ?></th>
                            <td>
                                <?php $controls->user_status() ?>
                                <span class="description"><a href="?page=newsletter_users_logs&id=<?php echo esc_attr($user->id); ?>">Status change history</a></span>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('Language', 'newsletter'); ?></th>
                            <td>
                                <?php $controls->language('language', __('None', 'newsletter')); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('Test subscriber', 'newsletter'); ?>
                                <br><?php $controls->help('https://www.thenewsletterplugin.com/documentation/subscribers#test-subscribers') ?></th>
                            <td>
                                <?php $controls->yesno('test'); ?>
                            </td>
                        </tr>

                        <?php do_action('newsletter_user_edit_extra', $controls); ?>

                    </table>
                </div>

                <div id="tabs-preferences" class="tnp-tab">
                    <p>
                        <a href="?page=newsletter_subscription_lists" target="_blank"><?php esc_html_e('Configure', 'newsletter') ?></a>
                    </p>

                    <table class="form-table">
                        <tr>
                            <th>
                                <?php esc_html_e('Lists', 'newsletter') ?>
                                <br>
                                <?php $controls->help('https://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences') ?></th>
                            <td>
                                <?php $controls->preferences('list'); ?>
                            </td>
                        </tr>
                    </table>
                </div>

                <div id="tabs-profile" class="tnp-tab">

                    <p>
                        <a href="?page=newsletter_subscription_customfields" target="_blank"><?php esc_html_e('Configure', 'newsletter') ?></a>
                    </p>

                    <table class="widefat">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th><?php esc_html_e('Name', 'newsletter'); ?></th>
                                <th><?php esc_html_e('Value', 'newsletter'); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            foreach ($this->get_all_customfields() as $customfield) {
                                echo '<tr><td>';
                                echo (int) $customfield->id;
                                echo '</td><td>';
                                echo esc_html($customfield->name);
                                echo '</td><td>';
                                if ($customfield->is_text()) {
                                    $controls->text('profile_' . $customfield->id, 70);
                                } else {
                                    $controls->select('profile_' . $customfield->id, $customfield->options);
                                }
                                echo '</td></tr>';
                            }
                            ?>
                        </tbody>
                    </table>
                </div>

                <div id="tabs-other" class="tnp-tab">

                    <table class="form-table">
                        <tr>
                            <th>ID</th>
                            <td>
                                <?php $controls->value('id'); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('Created', 'newsletter') ?></th>
                            <td>
                                <?php $controls->echo_date(strtotime($controls->data['created'])); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('Referrer', 'newsletter') ?></th>
                            <td>
                                <?php $controls->value('referrer'); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('HTTP Referrer', 'newsletter') ?></th>
                            <td>
                                <?php $controls->value('http_referer'); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('Last activity', 'newsletter') ?></th>
                            <td>
                                <?php $controls->echo_date($controls->data['last_activity']); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('WP user ID', 'newsletter') ?></th>
                            <td>
                                <?php $controls->text('wp_user_id'); ?>
                                <span class="description">ID of the WP user connected with this subscriber. Install
                                    <a href="<?php echo esc_attr(\Newsletter\Integrations::get_addon_url('wpusers')); ?>">WP Users Addon</a> for automated integration.</span>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('IP address', 'newsletter'); ?></th>
                            <td>
                                <?php $controls->value('ip'); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('Secret token', 'newsletter'); ?></th>
                            <td>
                                <?php $controls->text('token', 50); ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('Profile URL', 'newsletter'); ?></th>
                            <td>
                                <?php $profile_url = NewsletterProfile::instance()->get_profile_url($user) ?>
                                <a href='<?php echo esc_attr($profile_url) ?>' target="_blank"><?php echo esc_html($profile_url) ?></a>
                                <?php if (NEWSLETTER_DEBUG) { ?>
                                    <br>
                                    <?php $profile_page_url = NewsletterProfile::instance()->get_profile_page_url($user) ?>
                                    <a href='<?php echo esc_attr($profile_page_url) ?>' target="_blank"><?php echo esc_html($profile_page_url) ?></a>
                                <?php } ?>
                            </td>
                        </tr>
                        <tr>
                            <th><?php esc_html_e('Unsubscribe URL', 'newsletter'); ?></th>
                            <td>
                                <?php $unsubscribe_url = NewsletterUnsubscription::instance()->get_unsubscribe_url($user) ?>
                                <a href='<?php echo esc_attr($unsubscribe_url) ?>' target="_blank"><?php echo esc_html($unsubscribe_url) ?></a>
                            </td>
                        </tr>

                    </table>
                </div>

                <?php if (NEWSLETTER_DEBUG) { ?>
                    <div id="tabs-meta" class="tnp-tab">

                        <p>
                            Dump of the meta data only for debug.
                        </p>

                        <table class="widefat" style="width: auto">
                            <thead>
                                <tr>
                                    <th><?php esc_html_e('Name', 'newsletter'); ?></th>
                                    <th><?php esc_html_e('Value', 'newsletter'); ?></th>
                                </tr>
                            </thead>
                            <tbody>

                                <tr>
                                    <td>Welcome email ID</td>
                                    <td>
                                        <?php echo esc_html($this->get_user_meta($user->id, 'welcome_email_id')); ?>
                                    </td>
                                </tr>

                            </tbody>
                        </table>
                    </div>
                <?php } ?>

            </div>

            <p>
                <?php $controls->button_save(); ?>
                <?php $controls->button_delete(); ?>
            </p>

        </form>
    </div>

    <?php include NEWSLETTER_ADMIN_FOOTER ?>

</div>

Zerion Mini Shell 1.0
在线中文学校 7/24,专为华裔青少儿设计,教学经验丰富|灵犀中文
一对一在线课程
一对一在线辅导
灵犀中文 ── 学有”灵犀”一点通

1对1在线中文课程

  • 专为3-18岁华裔青少儿打造
  • 涵盖IB、AP、Alevel、IGCSE等考试辅导
  • 24/7都可以上课!

免费领取价值600元的中文学习大礼包

ft pic 3
国家/地区
search
 

search no result

 
ft pic 4
 
点击立即领取按钮,即表示您同意我们的服务条款和隐私保护。

banner ft gift

1对1个性化教学,专注于青少儿中文学习

华裔孩子学中文,1对1个性化教学
1对1个性化教学

因材施教,根据每个孩子的情况量身定制教学内容。

华裔孩子学中文,专属班主任
专属班主任
班主任全程跟踪,及时给家长反馈孩子学习情况,全方位保障孩子学有所成。
华裔孩子学中文,灵活的上课时间
灵活的上课时间
灵活的上课时间 ( 7*24 ),随时随地在线学中文。
华裔孩子学中文,多样化的趣味互动练习
多样化的趣味互动练习
各种趣味互动游戏,让孩子爱上学中文。

趣味互动课件,让孩子爱上学中文

互动性高
学生不仅可以和课件互动,还能加强和老师的互动。学生、教师和课件三位一体,互动性空前提升,让老师对学生的学习效果把控地更加准确,教学更有效。
趣味性高
通过非常丰富的互动体验和精美的趣味元素设计,让孩子更能记住所学的内容,真正做到寓教于乐,让学生能够快乐地学好中文。
科学性强
灵犀中文的教研团队深耕行业多年,深谙华裔孩子中文学习的特点。课件专业针对华裔青少儿中文学习的特点制作,让孩子的学习更加科学。

高效中文考试辅导课程,助力考生取得高分

多种课程类型
覆盖面广
覆盖多种中文考试课程,包括IB中文、AP中文、A-Level中文、O-Level中文和DSE中文,满足不同中文考试辅导的需求。
华裔孩子学中文,课程针对性强
针对性强
所有考试辅导皆为1对1名师教学,根据考生的水平制定个性化备考课程计划,针对弱项快速补强。
高提分率
高提分率
灵犀的老师有着丰富的考试辅导经验,深谙各中文考试的大纲和重点,帮助学生超越自我,考取高分。

为什么选择灵犀中文

为什么选择灵犀中文

免费领取1对1体验课

ft pic 3
国家/地区
search
 

search no result

 
ft pic 4
 
点击立即领取按钮,即表示您同意我们的服务条款和隐私保护。

17年教学经验沉淀,打造每一堂好课

灵犀中文掌握华裔青少儿中文教学的精髓,让您的孩子快乐高效地学好中文!
华裔孩子学中文,1对1个性化教学
为每个孩子定制个性化课程
华裔孩子学中文,教师教学经验丰富
教师经验丰富,擅于教授华裔青少儿
练习充分,讲练比例1:4,全面提升听说读写,让孩子真正学会中文
练习充分,讲练比例1:4,全面提升听说读写,让孩子真正学会中文
趣味课堂互动,锻炼孩子语言交际能力,激发孩子中文学习兴趣
趣味课堂互动,锻炼孩子语言交际能力,激发孩子中文学习兴趣

专业的师资团队,做最好的中文教育

专业的师资团队,做最好的中文教育
严格的教师筛选标准,只选2%最优秀的老师
严格的教师筛选标准,只选2%最优秀的老师
教师选择众多,保证选到最适合孩子的老师
教师选择众多,保证选到最适合孩子的老师
采用情景式及TPR教学法,课堂教学生动有趣
采用情景式及TPR教学法,课堂教学生动有趣
耐心热情,亦师亦友
耐心热情,亦师亦友

媒体报道

如何参加免费体验课

免费领取1对1体验课
点击下方按钮领取
预约体验课
我们会有专人在1个工作日内跟您联系,预约上课时间
上免费体验课
进入上课教室,体验1对1免费课
滚动至顶部