updates to overview
Showing
2 changed files
with
88 additions
and
35 deletions
| ... | @@ -451,6 +451,10 @@ class AccountValidation extends Common\Validation { | ... | @@ -451,6 +451,10 @@ class AccountValidation extends Common\Validation { |
| 451 | } | 451 | } |
| 452 | } | 452 | } |
| 453 | 453 | ||
| 454 | public function membership_valid_until($val) { | ||
| 455 | update_user_meta($_POST['uid'], 'membership_valid_until',$val); | ||
| 456 | } | ||
| 457 | |||
| 454 | } | 458 | } |
| 455 | 459 | ||
| 456 | class CreateValidation extends Common\Validation { | 460 | class CreateValidation extends Common\Validation { | ... | ... |
| ... | @@ -14,7 +14,7 @@ use Tz\WordPress\Tools\Notifications; | ... | @@ -14,7 +14,7 @@ use Tz\WordPress\Tools\Notifications; |
| 14 | use Exception, StdClass; | 14 | use Exception, StdClass; |
| 15 | use WP_User, WP_Roles; | 15 | use WP_User, WP_Roles; |
| 16 | 16 | ||
| 17 | $uid = $user->ID; | 17 | $uid = $_GET['uid']; |
| 18 | $account = new User\Account($uid); | 18 | $account = new User\Account($uid); |
| 19 | 19 | ||
| 20 | $pp = get_user_meta($uid, 'profile_preference', true).'_'; | 20 | $pp = get_user_meta($uid, 'profile_preference', true).'_'; |
| ... | @@ -49,6 +49,7 @@ use WP_User, WP_Roles; | ... | @@ -49,6 +49,7 @@ use WP_User, WP_Roles; |
| 49 | ?> | 49 | ?> |
| 50 | 50 | ||
| 51 | <div style="padding:10px 10px 0px 10px; min-width:760px;"> | 51 | <div style="padding:10px 10px 0px 10px; min-width:760px;"> |
| 52 | <form method="post" id="overview_form"> | ||
| 52 | <h2 style="margin-bottom:10px;padding-bottom:0px;">Overview of Users' Account...</h2> | 53 | <h2 style="margin-bottom:10px;padding-bottom:0px;">Overview of Users' Account...</h2> |
| 53 | <div style="float:left; width:300px;margin-right:50px;"> | 54 | <div style="float:left; width:300px;margin-right:50px;"> |
| 54 | 55 | ||
| ... | @@ -95,39 +96,8 @@ use WP_User, WP_Roles; | ... | @@ -95,39 +96,8 @@ use WP_User, WP_Roles; |
| 95 | 96 | ||
| 96 | </tbody> | 97 | </tbody> |
| 97 | </table> | 98 | </table> |
| 98 | </div> | 99 | |
| 99 | <div style="float:left; width:360px; border-left: 1px solid #ccc;"> | 100 | <h3 style="margin-bottom:5px; padding-bottom:0px;">Change User Password:</h3> |
| 100 | <div style="margin-left:20px; margin-bottom:20px;"> | ||
| 101 | |||
| 102 | <!-- coming soon... | ||
| 103 | <h3 style="margin-bottom:5px; padding-bottom:0px;">Account Balance:</h3> | ||
| 104 | <div style="color:red; font-size:18px;">-$130.00</div> | ||
| 105 | --> | ||
| 106 | |||
| 107 | <form method="post" id="overview_form"> | ||
| 108 | <input type="hidden" name="uid" value="<?php echo $uid; ?>" /> | ||
| 109 | <input type="hidden" name="section" value="account" /> | ||
| 110 | |||
| 111 | <h3 style="margin-bottom:5px; padding-bottom:0px;">Account Status:</h3> | ||
| 112 | <select name="status"> | ||
| 113 | <option value="active" <?php echo ($status=="active") ? "selected" : ""; ?>>Active</option> | ||
| 114 | <option value="suspended" <?php echo ($status=="suspended") ? "selected" : ""; ?>>Suspended</option> | ||
| 115 | <option value="terminated" <?php echo ($status=="terminated") ? "selected" : ""; ?>>Terminated</option> | ||
| 116 | </select> | ||
| 117 | |||
| 118 | <div style="clear:both;"></div> | ||
| 119 | |||
| 120 | <?php if($role!="administrator"):?> | ||
| 121 | <h3 style="margin-bottom:5px; padding-bottom:0px;">Account Type:</h3> | ||
| 122 | <select name="user_role" id="user_role"> | ||
| 123 | <?php foreach($roles as $roled=>$name):?> | ||
| 124 | <option value="<?php echo $roled;?>" <?php echo ($roled==$role) ? "selected" : "";?>><?php echo $name;?></option> | ||
| 125 | <?php endforeach;?> | ||
| 126 | </select> | ||
| 127 | <div style="clear:both;"></div> | ||
| 128 | <?php endif; ?> | ||
| 129 | |||
| 130 | <h3 style="margin-bottom:5px; padding-bottom:0px;">Change User Password:</h3> | ||
| 131 | <table cellpadding="0" cellspacing="0" border="0"> | 101 | <table cellpadding="0" cellspacing="0" border="0"> |
| 132 | <tbody> | 102 | <tbody> |
| 133 | <tr> | 103 | <tr> |
| ... | @@ -180,6 +150,84 @@ use WP_User, WP_Roles; | ... | @@ -180,6 +150,84 @@ use WP_User, WP_Roles; |
| 180 | <div style="clear:both;"></div> | 150 | <div style="clear:both;"></div> |
| 181 | </div> | 151 | </div> |
| 182 | 152 | ||
| 153 | |||
| 154 | |||
| 155 | </div> | ||
| 156 | <div style="float:left; width:360px; border-left: 1px solid #ccc;"> | ||
| 157 | <div style="margin-left:20px; margin-bottom:20px;"> | ||
| 158 | |||
| 159 | <!-- coming soon... | ||
| 160 | <h3 style="margin-bottom:5px; padding-bottom:0px;">Account Balance:</h3> | ||
| 161 | <div style="color:red; font-size:18px;">-$130.00</div> | ||
| 162 | --> | ||
| 163 | |||
| 164 | |||
| 165 | <input type="hidden" name="uid" value="<?php echo $uid; ?>" /> | ||
| 166 | <input type="hidden" name="section" value="account" /> | ||
| 167 | |||
| 168 | <h3 style="margin-bottom:5px; padding-bottom:0px;">Account:</h3> | ||
| 169 | |||
| 170 | <table cellpadding="0" cellspacing="0" width="100%" border="0"> | ||
| 171 | <tbody> | ||
| 172 | <tr> | ||
| 173 | <td width="100">Status:</td> | ||
| 174 | <td> | ||
| 175 | <select name="status" style="width:150px;"> | ||
| 176 | <option value="active" <?php echo ($status=="active") ? "selected" : ""; ?>>Active</option> | ||
| 177 | <option value="suspended" <?php echo ($status=="suspended") ? "selected" : ""; ?>>Suspended</option> | ||
| 178 | <option value="terminated" <?php echo ($status=="terminated") ? "selected" : ""; ?>>Terminated</option> | ||
| 179 | </select> | ||
| 180 | </td> | ||
| 181 | </tr> | ||
| 182 | |||
| 183 | <?php if($role!="administrator"):?> | ||
| 184 | <tr> | ||
| 185 | <td>Type:</td> | ||
| 186 | <td> | ||
| 187 | <select name="user_role" id="user_role" style="width:150px;"> | ||
| 188 | <?php foreach($roles as $roled=>$name):?> | ||
| 189 | <option value="<?php echo $roled;?>" <?php echo ($roled==$role) ? "selected" : "";?>><?php echo $name;?></option> | ||
| 190 | <?php endforeach;?> | ||
| 191 | </select> | ||
| 192 | </td> | ||
| 193 | </tr> | ||
| 194 | <?php endif; ?> | ||
| 195 | |||
| 196 | |||
| 197 | <?php | ||
| 198 | $mau = get_user_meta($_GET['uid'], 'membership_valid_until', true); | ||
| 199 | if ( !empty($mau) ) { | ||
| 200 | $current_mau = $mau; | ||
| 201 | } else { | ||
| 202 | $current_mau = ""; | ||
| 203 | } | ||
| 204 | ?> | ||
| 205 | <tr> | ||
| 206 | <td>Active Until</td> | ||
| 207 | <td> | ||
| 208 | <select name="membership_valid_until" id="membership_valid_until" style="width:150px;"> | ||
| 209 | <option value="" <?php echo ($current_mau=="") ? "selected" : ""; ?>>Select ...</option> | ||
| 210 | |||
| 211 | <?php if ( !empty($current_mau) ): ?> | ||
| 212 | <option value="<?php echo $current_mau;?>" selected><?php echo $current_mau;?></option> | ||
| 213 | <?php endif; ?> | ||
| 214 | |||
| 215 | <optgroup label="Change to:"> | ||
| 216 | <?php | ||
| 217 | $max_avail_mau = ((int) date("Y") + 3); | ||
| 218 | for($mi = (int) date("Y"); $mi <= $max_avail_mau;$mi++) { | ||
| 219 | echo '<option value="'.$mi.'">'.$mi.'</option>'; | ||
| 220 | } | ||
| 221 | ?> | ||
| 222 | </optgroup> | ||
| 223 | </select> | ||
| 224 | </td> | ||
| 225 | </tr> | ||
| 226 | |||
| 227 | </tbody> | ||
| 228 | </table> | ||
| 229 | |||
| 230 | <div style="clear:both;"></div> | ||
| 183 | <div> | 231 | <div> |
| 184 | <h3>Groups:</h3> | 232 | <h3>Groups:</h3> |
| 185 | <ul> | 233 | <ul> |
| ... | @@ -204,13 +252,14 @@ use WP_User, WP_Roles; | ... | @@ -204,13 +252,14 @@ use WP_User, WP_Roles; |
| 204 | <br /> | 252 | <br /> |
| 205 | <input type="submit" value="Update Account" /><span class="update-placeholder"></span> | 253 | <input type="submit" value="Update Account" /><span class="update-placeholder"></span> |
| 206 | 254 | ||
| 207 | </form> | 255 | |
| 208 | 256 | ||
| 209 | 257 | ||
| 210 | </div> | 258 | </div> |
| 211 | <div style="clear:both;"></div> | 259 | <div style="clear:both;"></div> |
| 212 | </div> | 260 | </div> |
| 213 | <div style="clear:both;"></div> | 261 | <div style="clear:both;"></div> |
| 262 | </form> | ||
| 214 | </div> | 263 | </div> |
| 215 | 264 | ||
| 216 | <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script> | 265 | <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script> | ... | ... |
-
Please register or sign in to post a comment