Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Plugin Name: B2BKing User Management - COMPLETE v4.0
- * Description: Panel kompletny z sortowaniem, popupami i WooCommerce
- * Version: 4.0.0
- */
- if (!defined('ABSPATH')) exit;
- add_action('admin_menu', function() {
- add_menu_page('Zarządzanie Użytkownikami', 'Zarządzanie Użytkownikami', 'manage_options', 'b2bking-users', function() { display_users_page(); }, 'dashicons-businessperson', 30);
- add_submenu_page('b2bking-users', 'Ustawienia Kredytów', 'Ustawienia Kredytów', 'manage_options', 'b2bking-credits-settings', function() { display_credits_settings(); });
- add_submenu_page('b2bking-users', 'Ustawienia Statusów', 'Ustawienia Statusów', 'manage_options', 'b2bking-status-settings', function() { display_status_settings(); });
- });
- add_action('admin_enqueue_scripts', function() {
- if (isset($_GET['page']) && strpos($_GET['page'], 'b2bking') !== false) {
- wp_enqueue_script('jquery');
- echo '<style>
- .b2bking-table { width: 100%; border-collapse: collapse; margin-top: 20px; background: #fff; box-shadow: 0 1px 3px; }
- .b2bking-table th { background: #f6f7f7; padding: 12px; text-align: left; font-weight: 600; border-bottom: 2px solid #ddd; cursor: pointer; user-select: none; }
- .b2bking-table th:hover { background: #e8e8e8; }
- .b2bking-table th.sortable::after { content: " ↕"; }
- .b2bking-table th.sorted-asc::after { content: " ↑"; }
- .b2bking-table th.sorted-desc::after { content: " ↓"; }
- .b2bking-table td { padding: 12px; border-bottom: 1px solid #eee; }
- .b2bking-table tr.expired { background: #fff3cd !important; }
- .b2bking-table tr.blocked { background: #f8d7da !important; }
- .btn { padding: 6px 12px; background: #0073aa; color: #fff; border: none; border-radius: 3px; cursor: pointer; font-size: 12px; margin-right: 4px; text-decoration: none; display: inline-block; }
- .btn:hover { background: #005177; }
- .btn.red { background: #dc3545; }
- .btn.red:hover { background: #c82333; }
- .btn.green { background: #28a745; }
- .btn.green:hover { background: #218838; }
- .btn.orange { background: #fd7e14; }
- .btn.orange:hover { background: #e46c0a; }
- .badge { display: inline-block; padding: 4px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
- .badge.active { background: #d4edda; color: #155724; }
- .badge.expired { background: #fff3cd; color: #856404; }
- .badge.blocked { background: #f8d7da; color: #721c24; }
- .stats { display: flex; gap: 20px; margin: 20px 0; flex-wrap: wrap; }
- .stat { background: #fff; padding: 20px; border-left: 4px solid #0073aa; box-shadow: 0 1px 3px; flex: 1; min-width: 150px; }
- .stat-num { font-size: 28px; font-weight: 700; color: #0073aa; }
- .stat-label { color: #666; font-size: 13px; margin-top: 5px; }
- .form-group { margin: 20px 0; padding: 20px; background: #fff; border-left: 4px solid #0073aa; }
- .form-group label { display: block; font-weight: 600; margin-bottom: 10px; font-size: 14px; }
- .form-group input, .form-group textarea, .form-group select { width: 100%; max-width: 500px; padding: 10px; border: 1px solid #ddd; border-radius: 3px; box-sizing: border-box; }
- .inline-edit { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
- .inline-edit input { flex: 0.8; min-width: 80px; padding: 4px; border: 1px solid #ddd; }
- .inline-edit select { flex: 0.9; padding: 4px; border: 1px solid #ddd; }
- .info-box { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; padding: 15px; border-radius: 3px; margin: 20px 0; }
- .info-box.warning { background: #fff3cd; border-color: #ffeeba; color: #856404; }
- .section-title { font-size: 18px; font-weight: 600; margin: 30px 0 20px 0; border-bottom: 2px solid #0073aa; padding-bottom: 10px; }
- </style>';
- }
- });
- // FRONTEND - POPUP ALERT
- add_action('wp_footer', function() {
- if (is_user_logged_in()) {
- $user_id = get_current_user_id();
- $status = get_user_meta($user_id, '_b2bking_status', true);
- if ($status === 'blocked' || $status === 'expired') {
- $block_page = get_option('b2bking_block_page_url', '');
- $message = get_option('b2bking_status_message_expired', 'Konto jest zablokowane');
- ?>
- <script>
- jQuery(document).ready(function() {
- if (window.location.href.includes('/checkout')) {
- alert('<?php echo esc_js($message); ?>');
- <?php if ($block_page): ?>
- window.location.href = '<?php echo esc_url($block_page); ?>';
- <?php endif; ?>
- }
- });
- </script>
- <?php
- }
- }
- });
- // SAVE CREDIT SETTINGS
- add_action('admin_post_b2bking_save_credits', function() {
- if (!current_user_can('manage_options')) wp_die('Brak uprawnień');
- check_admin_referer('b2bking_nonce');
- update_option('b2bking_default_credit', floatval($_POST['default_credit'] ?? 0));
- update_option('b2bking_credit_message', sanitize_textarea_field($_POST['credit_message'] ?? ''));
- wp_redirect(admin_url('admin.php?page=b2bking-credits-settings&msg=saved'));
- exit;
- });
- // SAVE STATUS SETTINGS
- add_action('admin_post_b2bking_save_statuses', function() {
- if (!current_user_can('manage_options')) wp_die('Brak uprawnień');
- check_admin_referer('b2bking_nonce');
- update_option('b2bking_block_days', intval($_POST['block_days'] ?? 30));
- update_option('b2bking_status_paid', sanitize_text_field($_POST['status_paid'] ?? 'Po zapłaceniu'));
- update_option('b2bking_status_expired', sanitize_text_field($_POST['status_expired'] ?? 'Po zakończeniu'));
- update_option('b2bking_status_message_paid', sanitize_textarea_field($_POST['message_paid'] ?? ''));
- update_option('b2bking_status_message_expired', sanitize_textarea_field($_POST['message_expired'] ?? ''));
- update_option('b2bking_deduct_on_status', sanitize_text_field($_POST['deduct_on_status'] ?? 'completed'));
- update_option('b2bking_block_page_url', esc_url_raw($_POST['block_page_url'] ?? ''));
- wp_redirect(admin_url('admin.php?page=b2bking-status-settings&msg=saved'));
- exit;
- });
- // UPDATE USER
- add_action('admin_post_b2bking_update_user', function() {
- if (!current_user_can('manage_options')) wp_die('Brak uprawnień');
- check_admin_referer('b2bking_nonce');
- $user_id = intval($_POST['user_id'] ?? 0);
- $credit = floatval($_POST['credit'] ?? 0);
- $status = sanitize_text_field($_POST['status'] ?? 'paid');
- update_user_meta($user_id, 'b2bking_user_credit_limit', $credit);
- update_user_meta($user_id, '_b2bking_status', $status);
- if ($status === 'paid') {
- update_user_meta($user_id, '_b2bking_credit_date', date('Y-m-d'));
- }
- wp_redirect(admin_url('admin.php?page=b2bking-users&msg=updated'));
- exit;
- });
- // BLOCK USER
- add_action('admin_post_b2bking_block_user', function() {
- if (!current_user_can('manage_options')) wp_die('Brak uprawnień');
- check_admin_referer('b2bking_nonce');
- $user_id = intval($_POST['user_id'] ?? 0);
- update_user_meta($user_id, '_b2bking_status', 'blocked');
- update_user_meta($user_id, '_b2bking_block_date', date('Y-m-d H:i:s'));
- wp_redirect(admin_url('admin.php?page=b2bking-users&msg=blocked'));
- exit;
- });
- // UNBLOCK USER
- add_action('admin_post_b2bking_unblock_user', function() {
- if (!current_user_can('manage_options')) wp_die('Brak uprawnień');
- check_admin_referer('b2bking_nonce');
- $user_id = intval($_POST['user_id'] ?? 0);
- update_user_meta($user_id, '_b2bking_status', 'paid');
- wp_redirect(admin_url('admin.php?page=b2bking-users&msg=unblocked'));
- exit;
- });
- // RESTORE
- add_action('admin_post_b2bking_restore', function() {
- if (!current_user_can('manage_options')) wp_die('Brak uprawnień');
- check_admin_referer('b2bking_nonce');
- $user_id = intval($_POST['user_id'] ?? 0);
- update_user_meta($user_id, '_b2bking_status', 'paid');
- update_user_meta($user_id, '_b2bking_credit_date', date('Y-m-d'));
- wp_redirect(admin_url('admin.php?page=b2bking-users&msg=restored'));
- exit;
- });
- // WOOCOMMERCE - DEDUCT CREDITS ON COMPLETED
- add_action('woocommerce_order_status_changed', function($order_id, $old_status, $new_status) {
- $deduct_on = get_option('b2bking_deduct_on_status', 'completed');
- // Sprawdź czy to status na którym odbijać
- if ($new_status !== $deduct_on) return;
- $order = wc_get_order($order_id);
- if (!$order) return;
- $user_id = $order->get_customer_id();
- if (!$user_id) return;
- $payment_method = $order->get_payment_method();
- if ($payment_method !== 'b2bking-credit-gateway') return;
- // Sprawdź czy już było odbite
- if (get_post_meta($order_id, '_b2bking_credit_deducted', true)) {
- return; // Już odbite
- }
- $order_total = floatval($order->get_total());
- // Pobierz obecny consumed balance
- $consumed = floatval(get_user_meta($user_id, 'b2bking_user_credit_consumed_balance', true) ?: 0);
- $new_consumed = $consumed + $order_total;
- // Zaktualizuj consumed balance
- update_user_meta($user_id, 'b2bking_user_credit_consumed_balance', $new_consumed);
- // Oznacz że już odbite
- update_post_meta($order_id, '_b2bking_credit_deducted', true);
- }, 10, 3);
- // CHECK IF USER IS BLOCKED - PREVENT CHECKOUT
- add_action('woocommerce_after_checkout_validation', function($posted_data, $errors) {
- $user_id = get_current_user_id();
- if (!$user_id) return;
- $status = get_user_meta($user_id, '_b2bking_status', true);
- if ($status === 'blocked' || $status === 'expired') {
- $message = get_option('b2bking_status_message_expired', 'Konto jest zablokowane');
- $errors->add('b2bking_blocked', '❌ ' . $message);
- }
- }, 10, 2);
- function get_user_status($user_id) {
- $custom = get_user_meta($user_id, '_b2bking_status', true);
- if ($custom === 'blocked') return 'blocked';
- if ($custom === 'expired') return 'expired';
- $paid_date = get_user_meta($user_id, '_b2bking_credit_date', true);
- $block_days = intval(get_option('b2bking_block_days', 30));
- if ($paid_date && time() > strtotime($paid_date . ' +' . $block_days . ' days')) {
- update_user_meta($user_id, '_b2bking_status', 'expired');
- return 'expired';
- }
- return 'paid';
- }
- function get_days_left($user_id) {
- $paid_date = get_user_meta($user_id, '_b2bking_credit_date', true);
- $block_days = intval(get_option('b2bking_block_days', 30));
- if (!$paid_date) return -1;
- $expiry = strtotime($paid_date . ' +' . $block_days . ' days');
- return ceil(($expiry - time()) / 86400);
- }
- function display_users_page() {
- if (!current_user_can('manage_options')) wp_die('Brak uprawnień');
- if (isset($_GET['msg'])) {
- $msgs = ['updated' => '✓ Zaktualizowano', 'restored' => '✓ Przywrócono', 'blocked' => '✓ Zablokowano', 'unblocked' => '✓ Odblokowano'];
- if (isset($msgs[$_GET['msg']])) echo '<div class="notice notice-success"><p>' . $msgs[$_GET['msg']] . '</p></div>';
- }
- $all = count_users();
- $total = $all['total_users'];
- $paid_q = new WP_User_Query(['meta_key' => '_b2bking_status', 'meta_value' => 'paid', 'fields' => 'ID']);
- $paid = $paid_q->get_total();
- $expired_q = new WP_User_Query(['meta_key' => '_b2bking_status', 'meta_value' => 'expired', 'fields' => 'ID']);
- $expired = $expired_q->get_total();
- $blocked_q = new WP_User_Query(['meta_key' => '_b2bking_status', 'meta_value' => 'blocked', 'fields' => 'ID']);
- $blocked = $blocked_q->get_total();
- $nonce = wp_create_nonce('b2bking_nonce');
- $status_paid_label = get_option('b2bking_status_paid', 'Po zapłaceniu');
- $status_expired_label = get_option('b2bking_status_expired', 'Po zakończeniu');
- ?>
- <div class="wrap">
- <h1>Zarządzanie Użytkownikami B2BKing</h1>
- <div class="stats">
- <div class="stat"><div class="stat-num"><?php echo $total; ?></div><div class="stat-label">Wszyscy</div></div>
- <div class="stat"><div class="stat-num"><?php echo $paid; ?></div><div class="stat-label"><?php echo esc_html($status_paid_label); ?></div></div>
- <div class="stat"><div class="stat-num"><?php echo $expired; ?></div><div class="stat-label"><?php echo esc_html($status_expired_label); ?></div></div>
- <div class="stat"><div class="stat-num"><?php echo $blocked; ?></div><div class="stat-label">Zablokowani</div></div>
- </div>
- <table class="b2bking-table" id="b2bkingTable">
- <thead>
- <tr>
- <th class="sortable" data-column="id">ID</th>
- <th class="sortable" data-column="login">Użytkownik</th>
- <th class="sortable" data-column="email">Email</th>
- <th class="sortable" data-column="limit">Limit</th>
- <th class="sortable" data-column="consumed">Zużyto</th>
- <th class="sortable" data-column="available">Dostępne</th>
- <th class="sortable" data-column="status">Status</th>
- <th class="sortable" data-column="days">Dni</th>
- <th>Akcje</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $users = get_users(['number' => 500, 'orderby' => 'registered', 'order' => 'DESC']);
- $rows = array();
- foreach ($users as $user) {
- $limit = floatval(get_user_meta($user->ID, 'b2bking_user_credit_limit', true) ?: 0);
- $consumed = floatval(get_user_meta($user->ID, 'b2bking_user_credit_consumed_balance', true) ?: 0);
- $available = $limit - $consumed;
- $status = get_user_status($user->ID);
- $days = get_days_left($user->ID);
- $status_badge = ($status === 'paid') ? '<span class="badge active">✓ '.$status_paid_label.'</span>' : (($status === 'expired') ? '<span class="badge expired">⏰ '.$status_expired_label.'</span>' : '<span class="badge blocked">🔒 Zablokowany</span>');
- $row_class = ($status === 'blocked') ? 'blocked' : (($status === 'expired') ? 'expired' : '');
- $rows[] = array(
- 'id' => $user->ID,
- 'login' => $user->user_login,
- 'email' => $user->user_email,
- 'limit' => $limit,
- 'consumed' => $consumed,
- 'available' => $available,
- 'status_num' => ($status === 'paid') ? 0 : (($status === 'expired') ? 1 : 2),
- 'status' => $status,
- 'days' => ($days > 0) ? $days : -999,
- 'status_badge' => $status_badge,
- 'row_class' => $row_class,
- 'user' => $user
- );
- }
- foreach ($rows as $row) {
- ?>
- <tr class="<?php echo $row['row_class']; ?>">
- <td><?php echo $row['id']; ?></td>
- <td><strong><?php echo esc_html($row['login']); ?></strong></td>
- <td><?php echo esc_html($row['email']); ?></td>
- <td><?php echo number_format($row['limit'], 2); ?> zł</td>
- <td><?php echo number_format($row['consumed'], 2); ?> zł</td>
- <td><?php echo number_format($row['available'], 2); ?> zł</td>
- <td><?php echo $row['status_badge']; ?></td>
- <td><?php echo ($row['days'] > 0) ? $row['days'] . ' dni' : 'WYGASŁO'; ?></td>
- <td>
- <form method="post" action="<?php echo admin_url('admin-post.php'); ?>" style="display: inline;">
- <input type="hidden" name="action" value="b2bking_update_user">
- <input type="hidden" name="user_id" value="<?php echo $row['user']->ID; ?>">
- <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>">
- <div class="inline-edit">
- <input type="number" step="0.01" name="credit" value="<?php echo $row['limit']; ?>" placeholder="Limit">
- <select name="status">
- <option value="paid" <?php selected($row['status'], 'paid'); ?>>✓ <?php echo esc_html($status_paid_label); ?></option>
- <option value="expired" <?php selected($row['status'], 'expired'); ?>>⏰ <?php echo esc_html($status_expired_label); ?></option>
- <option value="blocked" <?php selected($row['status'], 'blocked'); ?>>🔒 Zablokowany</option>
- </select>
- <button type="submit" class="btn">OK</button>
- </div>
- </form>
- <?php if ($row['status'] !== 'blocked'): ?>
- <form method="post" action="<?php echo admin_url('admin-post.php'); ?>" style="display: inline;">
- <input type="hidden" name="action" value="b2bking_block_user">
- <input type="hidden" name="user_id" value="<?php echo $row['user']->ID; ?>">
- <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>">
- <button type="submit" class="btn red" onclick="return confirm('Zablokować?')">Zablokuj</button>
- </form>
- <?php else: ?>
- <form method="post" action="<?php echo admin_url('admin-post.php'); ?>" style="display: inline;">
- <input type="hidden" name="action" value="b2bking_unblock_user">
- <input type="hidden" name="user_id" value="<?php echo $row['user']->ID; ?>">
- <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>">
- <button type="submit" class="btn green">Odblokuj</button>
- </form>
- <?php endif; ?>
- <?php if ($row['status'] === 'expired'): ?>
- <form method="post" action="<?php echo admin_url('admin-post.php'); ?>" style="display: inline;">
- <input type="hidden" name="action" value="b2bking_restore">
- <input type="hidden" name="user_id" value="<?php echo $row['user']->ID; ?>">
- <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>">
- <button type="submit" class="btn orange">Przywróć</button>
- </form>
- <?php endif; ?>
- </td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
- </div>
- <script>
- jQuery(document).ready(function($) {
- let currentSort = { column: 'id', order: 'asc' };
- $('th.sortable').on('click', function() {
- let column = $(this).data('column');
- let order = (currentSort.column === column && currentSort.order === 'asc') ? 'desc' : 'asc';
- $('th.sortable').removeClass('sorted-asc sorted-desc');
- $(this).addClass('sorted-' + order);
- currentSort = { column: column, order: order };
- sortTable(column, order);
- });
- function sortTable(column, order) {
- let rows = $('#b2bkingTable tbody tr').get();
- rows.sort(function(a, b) {
- let aVal = $(a).find('td').eq(getColumnIndex(column)).text();
- let bVal = $(b).find('td').eq(getColumnIndex(column)).text();
- // Numeric sort
- if (column === 'id' || column === 'limit' || column === 'consumed' || column === 'available' || column === 'days') {
- aVal = parseFloat(aVal) || 0;
- bVal = parseFloat(bVal) || 0;
- }
- if (order === 'asc') {
- return aVal > bVal ? 1 : -1;
- } else {
- return aVal < bVal ? 1 : -1;
- }
- });
- $.each(rows, function(index, row) {
- $('#b2bkingTable tbody').append(row);
- });
- }
- function getColumnIndex(column) {
- let columns = { id: 0, login: 1, email: 2, limit: 3, consumed: 4, available: 5, status: 6, days: 7 };
- return columns[column] || 0;
- }
- });
- </script>
- <?php
- }
- function display_credits_settings() {
- if (!current_user_can('manage_options')) wp_die('Brak uprawnień');
- if (isset($_GET['msg']) && $_GET['msg'] === 'saved') echo '<div class="notice notice-success"><p>✓ Ustawienia kredytów zapisane</p></div>';
- $default = floatval(get_option('b2bking_default_credit', 0));
- $message = get_option('b2bking_credit_message', '');
- $nonce = wp_create_nonce('b2bking_nonce');
- ?>
- <div class="wrap">
- <h1>⚙️ Ustawienia Kredytów</h1>
- <form method="post" action="<?php echo admin_url('admin-post.php'); ?>">
- <input type="hidden" name="action" value="b2bking_save_credits">
- <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>">
- <div class="form-group">
- <label for="default_credit"><strong>📊 Domyślna ilość kredytów:</strong></label>
- <input type="number" id="default_credit" name="default_credit" value="<?php echo $default; ?>" step="0.01">
- </div>
- <div class="form-group">
- <label for="credit_message"><strong>💬 Wiadomość o kredytach:</strong></label>
- <textarea id="credit_message" name="credit_message" rows="5"><?php echo esc_textarea($message); ?></textarea>
- </div>
- <button type="submit" class="btn">💾 Zapisz</button>
- </form>
- </div>
- <?php
- }
- function display_status_settings() {
- if (!current_user_can('manage_options')) wp_die('Brak uprawnień');
- if (isset($_GET['msg']) && $_GET['msg'] === 'saved') echo '<div class="notice notice-success"><p>✓ Ustawienia statusów zapisane</p></div>';
- $block_days = intval(get_option('b2bking_block_days', 30));
- $status_paid = get_option('b2bking_status_paid', 'Po zapłaceniu');
- $status_expired = get_option('b2bking_status_expired', 'Po zakończeniu');
- $message_paid = get_option('b2bking_status_message_paid', 'Konto aktywne');
- $message_expired = get_option('b2bking_status_message_expired', 'Kredyty wygasły');
- $deduct_on = get_option('b2bking_deduct_on_status', 'completed');
- $block_page = get_option('b2bking_block_page_url', '');
- $nonce = wp_create_nonce('b2bking_nonce');
- $pages = get_pages();
- ?>
- <div class="wrap">
- <h1>⚙️ Ustawienia Statusów</h1>
- <form method="post" action="<?php echo admin_url('admin-post.php'); ?>">
- <input type="hidden" name="action" value="b2bking_save_statuses">
- <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>">
- <div class="section-title">🕐 Ustawienia czasowe</div>
- <div class="form-group">
- <label for="block_days"><strong>Liczba dni do wygaśnięcia:</strong></label>
- <input type="number" id="block_days" name="block_days" value="<?php echo $block_days; ?>" min="1" max="365">
- </div>
- <div class="form-group">
- <label for="deduct_on_status"><strong>💰 Odejmuj kredyty na statusie:</strong></label>
- <select id="deduct_on_status" name="deduct_on_status">
- <option value="completed" <?php selected($deduct_on, 'completed'); ?>>Completed (Ukończone)</option>
- <option value="processing" <?php selected($deduct_on, 'processing'); ?>>Processing (Przetwarzane)</option>
- </select>
- <p class="description">Na jakim statusie będą odbijane kredyty z konta</p>
- </div>
- <div class="form-group">
- <label for="block_page_url"><strong>🔗 Strona do której kierować zablokowanych użytkowników:</strong></label>
- <select id="block_page_url" name="block_page_url">
- <option value="">-- Bez redirekcji --</option>
- <?php foreach ($pages as $page): ?>
- <option value="<?php echo get_page_link($page->ID); ?>" <?php selected($block_page, get_page_link($page->ID)); ?>>
- <?php echo esc_html($page->post_title); ?>
- </option>
- <?php endforeach; ?>
- </select>
- <p class="description">Użytkownik z zablokowanym kontem będzie przekierowany na tę stronę przy próbie wejścia do checkoutu</p>
- </div>
- <div class="section-title">✓ Status 1: Po zapłaceniu</div>
- <div class="form-group">
- <label for="status_paid"><strong>Nazwa statusu:</strong></label>
- <input type="text" id="status_paid" name="status_paid" value="<?php echo esc_attr($status_paid); ?>">
- </div>
- <div class="form-group">
- <label for="message_paid"><strong>Wiadomość:</strong></label>
- <textarea id="message_paid" name="message_paid" rows="4"><?php echo esc_textarea($message_paid); ?></textarea>
- </div>
- <div class="section-title">⏰ Status 2: Po zakończeniu</div>
- <div class="form-group">
- <label for="status_expired"><strong>Nazwa statusu:</strong></label>
- <input type="text" id="status_expired" name="status_expired" value="<?php echo esc_attr($status_expired); ?>">
- </div>
- <div class="form-group">
- <label for="message_expired"><strong>Wiadomość/Alert:</strong></label>
- <textarea id="message_expired" name="message_expired" rows="4" placeholder="Ta wiadomość będzie wyświetlana w popupie..."><?php echo esc_textarea($message_expired); ?></textarea>
- </div>
- <button type="submit" class="btn">💾 Zapisz</button>
- </form>
- <div class="info-box warning" style="margin-top: 40px;">
- <h3>✅ System w pełni automatyczny:</h3>
- <ol>
- <li>Kredyty odejmują się automatycznie na wybranym statusie (Completed)</li>
- <li>Popup alert pokazuje się gdy ktoś próbuje wejść do checkoutu ze zblokowanym kontem</li>
- <li>Kierowanie na wybraną stronę (np. "Skontaktuj się z nami")</li>
- <li>Wszystko działa bez klikania!</li>
- </ol>
- </div>
- </div>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment