new drop downs for province/country
Showing
3 changed files
with
18 additions
and
95 deletions
This diff is collapsed.
Click to expand it.
| ... | @@ -16,18 +16,20 @@ use WP_User, WP_Roles; | ... | @@ -16,18 +16,20 @@ use WP_User, WP_Roles; |
| 16 | 16 | ||
| 17 | $uid = $user->ID; | 17 | $uid = $user->ID; |
| 18 | $account = new User\Account($uid); | 18 | $account = new User\Account($uid); |
| 19 | |||
| 20 | $pp = get_user_meta($uid, 'profile_preference', true).'_'; | ||
| 19 | 21 | ||
| 20 | $first_name = get_user_meta($uid, 'first_name', true); | 22 | $first_name = get_user_meta($uid, 'first_name', true); |
| 21 | $last_name = get_user_meta($uid, 'last_name', true); | 23 | $last_name = get_user_meta($uid, 'last_name', true); |
| 22 | 24 | ||
| 23 | // contact info. | 25 | // contact info. |
| 24 | $country = get_user_meta($uid, 'country', true); | 26 | $country = get_user_meta($uid, $pp.'country', true); |
| 25 | $mobile = get_user_meta($uid, 'mobile', true); | 27 | $mobile = get_user_meta($uid, 'mobile', true); |
| 26 | $email = $user->user_email;//get_user_meta($uid, 'email', true); | 28 | $email = $user->user_email;//get_user_meta($uid, 'email', true); |
| 27 | 29 | ||
| 28 | // professional stuff | 30 | // professional stuff |
| 29 | $title = get_user_meta($uid, 'title', true); | 31 | $title = get_user_meta($uid, 'title', true); |
| 30 | $company = get_user_meta($uid, 'company', true); | 32 | $company = get_user_meta($uid, 'company_name', true); |
| 31 | 33 | ||
| 32 | // status | 34 | // status |
| 33 | $status = get_user_meta($uid, 'status', true); | 35 | $status = get_user_meta($uid, 'status', true); |
| ... | @@ -80,54 +82,7 @@ use WP_User, WP_Roles; | ... | @@ -80,54 +82,7 @@ use WP_User, WP_Roles; |
| 80 | </tr> | 82 | </tr> |
| 81 | <?php endif; ?> | 83 | <?php endif; ?> |
| 82 | 84 | ||
| 83 | <?php if (!empty($address)): ?> | ||
| 84 | <tr> | ||
| 85 | <th>Address:</th> | ||
| 86 | <td><?php echo $address; if (!empty($address2)) { echo "<br />".$address2; }?></td> | ||
| 87 | </tr> | ||
| 88 | <?php endif; ?> | ||
| 89 | |||
| 90 | <?php if (!empty($city)): ?> | ||
| 91 | <tr> | ||
| 92 | <th>City:</th> | ||
| 93 | <td><?php echo $city; ?></td> | ||
| 94 | </tr> | ||
| 95 | <?php endif; ?> | ||
| 96 | |||
| 97 | <?php if (!empty($province)): ?> | ||
| 98 | <tr> | ||
| 99 | <th>Province:</th> | ||
| 100 | <td><?php echo $province; ?></td> | ||
| 101 | </tr> | ||
| 102 | <?php endif; ?> | ||
| 103 | 85 | ||
| 104 | <?php if (!empty($country)): ?> | ||
| 105 | <tr> | ||
| 106 | <th>Country:</th> | ||
| 107 | <td><?php echo $country; ?></td> | ||
| 108 | </tr> | ||
| 109 | <?php endif; ?> | ||
| 110 | |||
| 111 | <?php if (!empty($phone)): ?> | ||
| 112 | <tr> | ||
| 113 | <th>Phone:</th> | ||
| 114 | <td><?php echo $phone; ?></td> | ||
| 115 | </tr> | ||
| 116 | <?php endif; ?> | ||
| 117 | |||
| 118 | <?php if (!empty($fax)): ?> | ||
| 119 | <tr> | ||
| 120 | <th>Fax:</th> | ||
| 121 | <td><?php echo $fax; ?></td> | ||
| 122 | </tr> | ||
| 123 | <?php endif; ?> | ||
| 124 | |||
| 125 | <?php if (!empty($mobile)): ?> | ||
| 126 | <tr> | ||
| 127 | <th>Mobile:</th> | ||
| 128 | <td><?php echo $mobile; ?></td> | ||
| 129 | </tr> | ||
| 130 | <?php endif; ?> | ||
| 131 | 86 | ||
| 132 | <?php if (!empty($email)): ?> | 87 | <?php if (!empty($email)): ?> |
| 133 | <tr> | 88 | <tr> |
| ... | @@ -136,12 +91,7 @@ use WP_User, WP_Roles; | ... | @@ -136,12 +91,7 @@ use WP_User, WP_Roles; |
| 136 | </tr> | 91 | </tr> |
| 137 | <?php endif; ?> | 92 | <?php endif; ?> |
| 138 | 93 | ||
| 139 | <?php if (!empty($website)): ?> | 94 | |
| 140 | <tr> | ||
| 141 | <th>Website:</th> | ||
| 142 | <td><?php echo $website; ?></td> | ||
| 143 | </tr> | ||
| 144 | <?php endif; ?> | ||
| 145 | 95 | ||
| 146 | </tbody> | 96 | </tbody> |
| 147 | </table> | 97 | </table> | ... | ... |
| ... | @@ -131,32 +131,18 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true); | ... | @@ -131,32 +131,18 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true); |
| 131 | <td><input type="text" name="home_city" value="<?php echo get_user_meta($_GET['uid'], 'home_city', true);?>" /></td> | 131 | <td><input type="text" name="home_city" value="<?php echo get_user_meta($_GET['uid'], 'home_city', true);?>" /></td> |
| 132 | </tr> | 132 | </tr> |
| 133 | <tr> | 133 | <tr> |
| 134 | <th>Country:</th> | ||
| 135 | <td><?php echo HTML\form_dropdown('home_country', HTML\Vars::$countries, get_user_meta($_GET['uid'], 'home_country', true), "id='home_country'"); ?></td> | ||
| 136 | </tr> | ||
| 137 | <tr> | ||
| 134 | <th>State/Province:</th> | 138 | <th>State/Province:</th> |
| 135 | <td> | 139 | <td><?php echo HTML\form_linked_dropdown('home_province', 'home_country', HTML\Vars::$provinces,get_user_meta($_GET['uid'], 'home_country', true), get_user_meta($_GET['uid'], 'home_province', true)); ?></td> |
| 136 | <select name="home_province"> | ||
| 137 | <option disabled value="">Select a State/Province</option> | ||
| 138 | <optgroup label="Canada"> | ||
| 139 | <?php HTML\select_opts_provinces(get_user_meta($_GET['uid'], 'home_province', true)); ?> | ||
| 140 | </optgroup> | ||
| 141 | |||
| 142 | <optgroup label="United States"> | ||
| 143 | <?php HTML\select_opts_states(get_user_meta($_GET['uid'], 'home_province', true)); ?> | ||
| 144 | </optgroup> | ||
| 145 | </select> | ||
| 146 | </td> | ||
| 147 | </tr> | 140 | </tr> |
| 148 | <tr> | 141 | <tr> |
| 149 | <th>Postal:</th> | 142 | <th>Postal:</th> |
| 150 | <td><input type="text" name="home_postal" value="<?php echo get_user_meta($_GET['uid'], 'home_postal', true); ?>" /></td> | 143 | <td><input type="text" name="home_postal" value="<?php echo get_user_meta($_GET['uid'], 'home_postal', true); ?>" /></td> |
| 151 | </tr> | 144 | </tr> |
| 152 | <tr> | 145 | |
| 153 | <th>Country:</th> | ||
| 154 | <td> | ||
| 155 | <select name="home_country"> | ||
| 156 | <?php HTML\select_opts_countries(get_user_meta($_GET['uid'], 'home_country', true)); ?> | ||
| 157 | </select> | ||
| 158 | </td> | ||
| 159 | </tr> | ||
| 160 | <tr> | 146 | <tr> |
| 161 | <th>Phone:</th> | 147 | <th>Phone:</th> |
| 162 | <td><input type="text" name="home_phone" value="<?php echo get_user_meta($_GET['uid'], 'home_phone', true);?>" rel="mask-phone" /></td> | 148 | <td><input type="text" name="home_phone" value="<?php echo get_user_meta($_GET['uid'], 'home_phone', true);?>" rel="mask-phone" /></td> |
| ... | @@ -200,32 +186,19 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true); | ... | @@ -200,32 +186,19 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true); |
| 200 | <td><input type="text" name="work_city" value="<?php echo get_user_meta($_GET['uid'], 'work_city', true);?>" /></td> | 186 | <td><input type="text" name="work_city" value="<?php echo get_user_meta($_GET['uid'], 'work_city', true);?>" /></td> |
| 201 | </tr> | 187 | </tr> |
| 202 | <tr> | 188 | <tr> |
| 189 | <th>Country:</th> | ||
| 190 | <td><?php echo HTML\form_dropdown('work_country', HTML\Vars::$countries, get_user_meta($_GET['uid'], 'work_country', true), "id='work_country'"); ?></td> | ||
| 191 | </tr> | ||
| 192 | <tr> | ||
| 203 | <th>State/Province:</th> | 193 | <th>State/Province:</th> |
| 204 | <td> | 194 | <td><?php echo HTML\form_linked_dropdown('work_province', 'work_country', HTML\Vars::$provinces,get_user_meta($_GET['uid'], 'work_country', true), get_user_meta($_GET['uid'], 'work_province', true)); ?></td> |
| 205 | <select name="work_province"> | ||
| 206 | <option disabled value="">Select a State/Province</option> | ||
| 207 | <optgroup label="Canada"> | ||
| 208 | <?php HTML\select_opts_provinces(get_user_meta($_GET['uid'], 'work_province', true)); ?> | ||
| 209 | </optgroup> | ||
| 210 | |||
| 211 | <optgroup label="United States"> | ||
| 212 | <?php HTML\select_opts_states(get_user_meta($_GET['uid'], 'work_province', true)); ?> | ||
| 213 | </optgroup> | ||
| 214 | </select> | ||
| 215 | </td> | ||
| 216 | </tr> | 195 | </tr> |
| 196 | |||
| 217 | <tr> | 197 | <tr> |
| 218 | <th>Postal:</th> | 198 | <th>Postal:</th> |
| 219 | <td><input type="text" name="work_postal" value="<?php echo get_user_meta($_GET['uid'], 'work_postal', true); ?>" /></td> | 199 | <td><input type="text" name="work_postal" value="<?php echo get_user_meta($_GET['uid'], 'work_postal', true); ?>" /></td> |
| 220 | </tr> | 200 | </tr> |
| 221 | <tr> | 201 | |
| 222 | <th>Country:</th> | ||
| 223 | <td> | ||
| 224 | <select name="work_country"> | ||
| 225 | <?php HTML\select_opts_countries(get_user_meta($_GET['uid'], 'work_country', true)); ?> | ||
| 226 | </select> | ||
| 227 | </td> | ||
| 228 | </tr> | ||
| 229 | <tr> | 202 | <tr> |
| 230 | <th>Phone:</th> | 203 | <th>Phone:</th> |
| 231 | <td><input type="text" name="work_phone" value="<?php echo get_user_meta($_GET['uid'], 'work_phone', true);?>" rel="mask-phone" /></td> | 204 | <td><input type="text" name="work_phone" value="<?php echo get_user_meta($_GET['uid'], 'work_phone', true);?>" rel="mask-phone" /></td> | ... | ... |
-
Please register or sign in to post a comment