echo '<tr><th style="padding:9px 0"><input type="checkbox" value="1" name="knews_subscribers_mass" id="knews_subscribers_mass"></th>'; echo '<th colspan="' . $colspan . '" style="padding-left:7px;">'; if ($filtered_users != $total_users) { echo sprintf(__('Select the %s filtered subscribers to perform a massive action', 'knews'), $filtered_users); } else { echo sprintf(__('Select all your subscribers (%s) to perform a massive action', 'knews'), $filtered_users); } echo '</th></tr>'; } //fi pro echo '</tbody><tfoot><tr><th class="manage-column column-cb check-column"><input type="checkbox" /></th>'; knews_th_orderable('E-mail', 'email', 'asc'); reset($extra_fields); foreach ($extra_fields as $ef) { if ($ef->show_table == 1) { knews_th_orderable($ef->name, $ef->name, 'asc'); } } echo '<th>' . __('Language', 'knews') . '</th><th>' . __('State', 'knews') . '</th><th>' . __('Subscriptions', 'knews') . '</th><th>' . __('Stats', 'knews') . '</th></tr></tfoot>'; echo '</table>'; ?> <div class="tablenav bottom"> <div class="alignleft actions"> <select name="action" id="batch_action"> <option selected="selected" value=""><?php _e('Batch actions', 'knews'); ?> </option> <option value="delete_users"><?php _e('Delete', 'knews'); ?>
function knews_print_mailinglists() { global $Knews_plugin, $wpdb; $order_by = $Knews_plugin->get_safe('orderby', 'orderlist'); $order = $Knews_plugin->get_safe('order', 'asc'); $query = "SELECT id, name FROM " . KNEWS_LISTS . " ORDER BY " . $order_by . " " . $order; $lists_name = $wpdb->get_results($query); //$col=count($lists_name)+1; $n = 0; if (count($lists_name) > 8) { echo '<table class="widefat"><thead><tr><th class="manage-column column-cb check-column"><input type="checkbox"></th>'; knews_th_orderable(__('Name list', 'knews'), 'name', 'asc', 'padding-right:60px'); echo '<th> </th><th> </th>'; knews_th_orderable(__('Name list', 'knews'), 'name', 'asc', 'padding-right:60px'); echo '<th> </th><th> </th>'; knews_th_orderable(__('Name list', 'knews'), 'name', 'asc', 'padding-right:60px'); echo '<th> </th></tr></thead><tbody><tr class="alt">'; //$col = ceil($col / 3); } else { echo '<table class="widefat" style="width:480px"><thead><tr><th class="manage-column column-cb check-column"><input type="checkbox"></th>'; knews_th_orderable(__('Name list', 'knews'), 'name', 'asc', 'padding-right:60px'); echo '<th> </th></tr></thead><tbody><tr class="alt">'; } $alt = false; foreach ($lists_name as $ln) { $query = "SELECT COUNT(" . KNEWS_USERS . ".id) AS HOW_MANY FROM " . KNEWS_USERS . ", " . KNEWS_USERS_PER_LISTS . " WHERE " . KNEWS_USERS_PER_LISTS . ".id_user="******".id AND " . KNEWS_USERS . ".state='2' AND " . KNEWS_USERS_PER_LISTS . ".id_list=" . $ln->id; $count = $wpdb->get_results($query); $query = "SELECT COUNT(" . KNEWS_USERS . ".id) AS HOW_MANY FROM " . KNEWS_USERS . ", " . KNEWS_USERS_PER_LISTS . " WHERE " . KNEWS_USERS_PER_LISTS . ".id_user="******".id AND " . KNEWS_USERS . ".state<>'2' AND " . KNEWS_USERS_PER_LISTS . ".id_list=" . $ln->id; $count2 = $wpdb->get_results($query); if (count($lists_name) < 9) { if ($n != 0) { echo '</tr><tr' . ($alt ? ' class="alt"' : '') . '>'; if ($alt) { $alt = false; } else { $alt = true; } } } elseif ($n % 3 == 0) { echo '</tr><tr' . ($alt ? ' class="alt"' : '') . '>'; if ($alt) { $alt = false; } else { $alt = true; } } $n++; echo '<th class="check-column" style="padding:9px 0 4px 0;"><input type="checkbox" value="1" name="list_' . $ln->id . '" id="list_' . $ln->id . '" class="checklist"></td><td style="padding:7px 60px 0px 7px;">' . $ln->name . '</td><td><strong style="color:#25c500">' . $count[0]->HOW_MANY . '</strong> / ' . $count2[0]->HOW_MANY . '</td>'; } if (count($lists_name) > 8) { while ($n % 3 != 0) { echo '<td> </td><td> </td>'; $n++; } echo '</tr>'; echo '<tfoot><tr><th class="manage-column column-cb check-column"><input type="checkbox"></th>'; knews_th_orderable(__('Name list', 'knews'), 'name', 'asc', 'padding-right:60px'); echo '<th> </th><th> </th>'; knews_th_orderable(__('Name list', 'knews'), 'name', 'asc', 'padding-right:60px'); echo '<th> </th><th> </th>'; knews_th_orderable(__('Name list', 'knews'), 'name', 'asc', 'padding-right:60px'); echo '<th> </th></tr></tfoot><table>'; //$col = ceil($col / 3); } else { echo '</tr>'; echo '<tfoot><tr><th class="manage-column column-cb check-column"><input type="checkbox"></th>'; knews_th_orderable(__('Name list', 'knews'), 'name', 'asc', 'padding-right:60px'); echo '<th> </th></tr></tfoot></table>'; } }