-
Notifications
You must be signed in to change notification settings - Fork 2
/
google_shipping_country.php
45 lines (42 loc) · 1.82 KB
/
google_shipping_country.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
global $wpdb;
?>
<div class="wrap">
<h2><?php echo __('Google Shipping Country', 'wpsc');?></h2>
<form action='' method='post'>
<?php
$google_shipping_country = get_option("google_shipping_country");
$country_data = $wpdb->get_results("SELECT * FROM `".WPSC_TABLE_CURRENCY_LIST."` ORDER BY `country` ASC",ARRAY_A);
$country_data = array_chunk($country_data, 50);
echo "<table>\n\r";
echo "<tr>\n\r";
foreach($country_data as $country_col)
{
echo "<td style='vertical-align: top; padding-right: 3em;'>\n\r";
echo "<table>\n\r";
foreach($country_col as $country) {
if (in_array($country['id'], (array)$google_shipping_country)) {
$checked="checked='checked'";
} else {
$checked="";
}
echo " <tr>\n\r";
echo " <td><input $checked type='checkbox' id='google_shipping_".$country['id']."' name='google_shipping[".$country['id']."]'/></td>\n\r";
if($country['id'] == $base_country){
echo " <td><label for='google_shipping_".$country['id']."' style='text-decoration: underline;'>".$country['country'].":</label></td>\n\r";
} else {
echo " <td><label for='google_shipping_".$country['id']."'>".$country['country']."</label></td>\n\r";
}
echo " </tr>\n\r";
}
echo "</table>\n\r";
echo " </td>\n\r";
}
echo " </tr>\n\r";
echo "</table>\n\r";
?>
<a style="cursor:pointer;" onclick="jQuery('input[type=\'checkbox\']').each(function() {this.checked = true; });">Select All</a>  <a style="cursor:pointer;" onclick="jQuery('input[type=\'checkbox\']').each(function() {this.checked = false; });">Unselect All</a><br /><br />
<input type='hidden' name='wpsc_admin_action' value='google_shipping_settings' />
<input class='button-secondary' type='submit' name='submit' value='<?php echo __('Save Changes', 'wpsc');?>' /> <a href='?page=<?=$_GET['page']?>'>Go Back</a>
</form>
</div>