Use new code style
This commit is contained in:
@ -11,29 +11,29 @@
|
||||
|
||||
<?php
|
||||
|
||||
$data = array();
|
||||
$slug = 'signup_countries';
|
||||
$data = array();
|
||||
$slug = 'signup_countries';
|
||||
$headers = array(
|
||||
__('Country', 'wp-ultimo'),
|
||||
__('Customer Count', 'wp-ultimo'),
|
||||
__('Country', 'wp-ultimo'),
|
||||
__('Customer Count', 'wp-ultimo'),
|
||||
);
|
||||
|
||||
foreach ($countries as $country_code => $count) {
|
||||
$line = array(
|
||||
wu_get_country_name($country_code),
|
||||
$count,
|
||||
);
|
||||
|
||||
$line = array(
|
||||
wu_get_country_name($country_code),
|
||||
$count,
|
||||
);
|
||||
|
||||
$data[] = $line;
|
||||
|
||||
$data[] = $line;
|
||||
} // end foreach;
|
||||
|
||||
$page->render_csv_button(array(
|
||||
'headers' => $headers,
|
||||
'data' => $data,
|
||||
'slug' => $slug,
|
||||
));
|
||||
$page->render_csv_button(
|
||||
array(
|
||||
'headers' => $headers,
|
||||
'data' => $data,
|
||||
'slug' => $slug,
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
@ -41,77 +41,81 @@ $page->render_csv_button(array(
|
||||
|
||||
</div>
|
||||
|
||||
<?php if (!empty($countries)) : ?>
|
||||
<?php if ( ! empty($countries)) : ?>
|
||||
|
||||
<div class="wu-advanced-filters wu--mx-3 wu--mb-3 wu-mt-3">
|
||||
<div class="wu-advanced-filters wu--mx-3 wu--mb-3 wu-mt-3">
|
||||
|
||||
<table class="wp-list-table widefat fixed striped wu-border-t-0 wu-border-l-0 wu-border-r-0">
|
||||
<table class="wp-list-table widefat fixed striped wu-border-t-0 wu-border-l-0 wu-border-r-0">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php _e('Country', 'wp-ultimo'); ?></th>
|
||||
<th class="wu-text-right"><?php _e('Customer Count', 'wp-ultimo'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php _e('Country', 'wp-ultimo'); ?></th>
|
||||
<th class="wu-text-right"><?php _e('Customer Count', 'wp-ultimo'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($countries as $country_code => $count) : ?>
|
||||
<?php foreach ($countries as $country_code => $count) : ?>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
printf('<span class="wu-flag-icon wu-flag-icon-%s wu-w-5 wu-mr-1" %s></span>',
|
||||
strtolower($country_code),
|
||||
wu_tooltip_text(wu_get_country_name($country_code))
|
||||
);
|
||||
printf(
|
||||
'<span class="wu-flag-icon wu-flag-icon-%s wu-w-5 wu-mr-1" %s></span>',
|
||||
strtolower($country_code),
|
||||
wu_tooltip_text(wu_get_country_name($country_code))
|
||||
);
|
||||
|
||||
?>
|
||||
<?php echo wu_get_country_name($country_code); ?>
|
||||
</td>
|
||||
<td class="wu-text-right"><?php echo $count; ?></td>
|
||||
</tr>
|
||||
?>
|
||||
<?php echo wu_get_country_name($country_code); ?>
|
||||
</td>
|
||||
<td class="wu-text-right"><?php echo $count; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
$state_list = wu_get_states_of_customers($country_code);
|
||||
$_state_count = 0;
|
||||
$state_list = wu_get_states_of_customers($country_code);
|
||||
$_state_count = 0;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<?php foreach ($state_list as $state => $state_count) : $_state_count = $_state_count + $state_count; ?>
|
||||
<?php
|
||||
foreach ($state_list as $state => $state_count) :
|
||||
$_state_count = $_state_count + $state_count;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td class="wu-text-xs">|⟶ <?php echo $state; ?></td>
|
||||
<td class="wu-text-right"><?php echo $state_count; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="wu-text-xs">|⟶ <?php echo $state; ?></td>
|
||||
<td class="wu-text-right"><?php echo $state_count; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if ($state_list && $count - $_state_count >= 0) : ?>
|
||||
<?php if ($state_list && $count - $_state_count >= 0) : ?>
|
||||
|
||||
<tr>
|
||||
<td class="wu-text-xs">|⟶ <?php _e('Other', 'wp-ultimo') ?></td>
|
||||
<td class="wu-text-right"><?php echo $count - $_state_count; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="wu-text-xs">|⟶ <?php _e('Other', 'wp-ultimo'); ?></td>
|
||||
<td class="wu-text-right"><?php echo $count - $_state_count; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tbody>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="wu-bg-gray-100 wu-p-4 wu-rounded wu-mt-6">
|
||||
<div class="wu-bg-gray-100 wu-p-4 wu-rounded wu-mt-6">
|
||||
|
||||
<?php _e('No countries registered yet.', 'wp-ultimo'); ?>
|
||||
<?php _e('No countries registered yet.', 'wp-ultimo'); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
Reference in New Issue
Block a user