bd69a0c6 by Chris Boden

Removed UserManager from repository

1 parent 7eb0331b
1 /*
2 Masked Input plugin for jQuery
3 Copyright (c) 2007-2010 Josh Bush (digitalbush.com)
4 Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
5 Version: 1.2.3
6 */
7 (function($) {
8 var pasteEventName = ($.browser.msie ? 'paste' : 'input') + ".mask";
9 var iPhone = (window.orientation != undefined);
10
11 $.mask = {
12 //Predefined character definitions
13 definitions: {
14 '9': "[0-9]",
15 'a': "[A-Za-z]",
16 '*': "[A-Za-z0-9]"
17 }
18 };
19
20 $.fn.extend({
21 //Helper Function for Caret positioning
22 caret: function(begin, end) {
23 if (this.length == 0) return;
24 if (typeof begin == 'number') {
25 end = (typeof end == 'number') ? end : begin;
26 return this.each(function() {
27 if (this.setSelectionRange) {
28 this.focus();
29 this.setSelectionRange(begin, end);
30 } else if (this.createTextRange) {
31 var range = this.createTextRange();
32 range.collapse(true);
33 range.moveEnd('character', end);
34 range.moveStart('character', begin);
35 range.select();
36 }
37 });
38 } else {
39 if (this[0].setSelectionRange) {
40 begin = this[0].selectionStart;
41 end = this[0].selectionEnd;
42 } else if (document.selection && document.selection.createRange) {
43 var range = document.selection.createRange();
44 begin = 0 - range.duplicate().moveStart('character', -100000);
45 end = begin + range.text.length;
46 }
47 return { begin: begin, end: end };
48 }
49 },
50 unmask: function() { return this.trigger("unmask"); },
51 mask: function(mask, settings) {
52 if (!mask && this.length > 0) {
53 var input = $(this[0]);
54 var tests = input.data("tests");
55 return $.map(input.data("buffer"), function(c, i) {
56 return tests[i] ? c : null;
57 }).join('');
58 }
59 settings = $.extend({
60 placeholder: "_",
61 completed: null
62 }, settings);
63
64 var defs = $.mask.definitions;
65 var tests = [];
66 var partialPosition = mask.length;
67 var firstNonMaskPos = null;
68 var len = mask.length;
69
70 $.each(mask.split(""), function(i, c) {
71 if (c == '?') {
72 len--;
73 partialPosition = i;
74 } else if (defs[c]) {
75 tests.push(new RegExp(defs[c]));
76 if(firstNonMaskPos==null)
77 firstNonMaskPos = tests.length - 1;
78 } else {
79 tests.push(null);
80 }
81 });
82
83 return this.each(function() {
84 var input = $(this);
85 var buffer = $.map(mask.split(""), function(c, i) { if (c != '?') return defs[c] ? settings.placeholder : c });
86 var ignore = false; //Variable for ignoring control keys
87 var focusText = input.val();
88
89 input.data("buffer", buffer).data("tests", tests);
90
91 function seekNext(pos) {
92 while (++pos <= len && !tests[pos]);
93 return pos;
94 };
95
96 function shiftL(pos) {
97 while (!tests[pos] && --pos >= 0);
98 for (var i = pos; i < len; i++) {
99 if (tests[i]) {
100 buffer[i] = settings.placeholder;
101 var j = seekNext(i);
102 if (j < len && tests[i].test(buffer[j])) {
103 buffer[i] = buffer[j];
104 } else
105 break;
106 }
107 }
108 writeBuffer();
109 input.caret(Math.max(firstNonMaskPos, pos));
110 };
111
112 function shiftR(pos) {
113 for (var i = pos, c = settings.placeholder; i < len; i++) {
114 if (tests[i]) {
115 var j = seekNext(i);
116 var t = buffer[i];
117 buffer[i] = c;
118 if (j < len && tests[j].test(t))
119 c = t;
120 else
121 break;
122 }
123 }
124 };
125
126 function keydownEvent(e) {
127 var pos = $(this).caret();
128 var k = e.keyCode;
129 ignore = (k < 16 || (k > 16 && k < 32) || (k > 32 && k < 41));
130
131 //delete selection before proceeding
132 if ((pos.begin - pos.end) != 0 && (!ignore || k == 8 || k == 46))
133 clearBuffer(pos.begin, pos.end);
134
135 //backspace, delete, and escape get special treatment
136 if (k == 8 || k == 46 || (iPhone && k == 127)) {//backspace/delete
137 shiftL(pos.begin + (k == 46 ? (tests[pos.begin]?0:1) : -1));
138 return false;
139 } else if (k == 27) {//escape
140 input.val(focusText);
141 input.caret(0, checkVal());
142 return false;
143 }
144 };
145
146 function keypressEvent(e) {
147 if (ignore) {
148 ignore = false;
149 //Fixes Mac FF bug on backspace
150 return (e.keyCode == 8) ? false : null;
151 }
152 e = e || window.event;
153 var k = e.charCode || e.keyCode || e.which;
154 var pos = $(this).caret();
155
156 if (e.ctrlKey || e.altKey || e.metaKey) {//Ignore
157 return true;
158 } else if ((k >= 32 && k <= 125) || k > 186) {//typeable characters
159 var p = seekNext(pos.begin - 1);
160 if (p < len) {
161 var c = String.fromCharCode(k);
162 if (tests[p].test(c)) {
163 shiftR(p);
164 buffer[p] = c;
165 writeBuffer();
166 var next = seekNext(p);
167 $(this).caret(next);
168 if (settings.completed && next >= len)
169 settings.completed.call(input);
170 }
171 }
172 }
173 return false;
174 };
175
176 function clearBuffer(start, end) {
177 for (var i = start; i < end && i < len; i++) {
178 if (tests[i])
179 buffer[i] = settings.placeholder;
180 }
181 };
182
183 function writeBuffer() { return input.val(buffer.join('')).val(); };
184
185 function checkVal(allow) {
186 //try to place characters where they belong
187 var test = input.val();
188 var lastMatch = -1;
189 for (var i = 0, pos = 0; i < len; i++) {
190 if (tests[i]) {
191 buffer[i] = settings.placeholder;
192 while (pos++ < test.length) {
193 var c = test.charAt(pos - 1);
194 if (tests[i].test(c)) {
195 buffer[i] = c;
196 lastMatch = i;
197 break;
198 }
199 }
200 if (pos > test.length)
201 break;
202 } else if (buffer[i] == test.charAt(pos) && i!=partialPosition) {
203 pos++;
204 lastMatch = i;
205 }
206 }
207 if (!allow && lastMatch + 1 < partialPosition) {
208 input.val("");
209 clearBuffer(0, len);
210 } else if (allow || lastMatch + 1 >= partialPosition) {
211 writeBuffer();
212 if (!allow) input.val(input.val().substring(0, lastMatch + 1));
213 }
214 return (partialPosition ? i : firstNonMaskPos);
215 };
216
217 if (!input.attr("readonly"))
218 input
219 .one("unmask", function() {
220 input
221 .unbind(".mask")
222 .removeData("buffer")
223 .removeData("tests");
224 })
225 .bind("focus.mask", function() {
226 focusText = input.val();
227 var pos = checkVal();
228 writeBuffer();
229 setTimeout(function() {
230 if (pos == mask.length)
231 input.caret(0, pos);
232 else
233 input.caret(pos);
234 }, 0);
235 })
236 .bind("blur.mask", function() {
237 checkVal();
238 if (input.val() != focusText)
239 input.change();
240 })
241 .bind("keydown.mask", keydownEvent)
242 .bind("keypress.mask", keypressEvent)
243 .bind(pasteEventName, function() {
244 setTimeout(function() { input.caret(checkVal(true)); }, 0);
245 });
246
247 checkVal(); //Perform initial check for existing values
248 });
249 }
250 });
251 })(jQuery);
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 namespace Tz\WordPress\Tools\UserManager;
3
4 use Tz, Tz\Common;
5 use Tz\WordPress\CBV;
6 use Tz\WordPress\UAM;
7 use Tz\WordPress\Tools;
8 use Tz\WordPress\Tools\HTML;
9 use Exception, StdClass;
10 use WP_User, WP_Roles;
11
12 Tools\import('HTML');
13
14 $rc = new WP_Roles();
15 $roles = $rc->role_names;
16 ksort($roles);
17 unset($rc, $roles['administrator']);
18
19 ?>
20
21 <style>
22
23 #post-body {
24 -moz-border-radius-bottomleft:6px;
25 -moz-border-radius-bottomright:6px;
26 -moz-border-radius-topright:6px;
27 -moz-border-radius-topleft:6px;
28 background:none repeat scroll 0 0 #FFFFFF;
29 border-width:1px 1px 1px 1px;
30 padding:10px;
31 margin-top:20px;
32 }
33 #nav-menu-header, #post-body,#post-header {
34 border-color:#CCCCCC;
35 border-style:solid;
36 }
37
38 #menu-management .nav-tab {
39 background:none repeat scroll 0 0 #F4F4F4;
40 }
41
42 #menu-management .nav-tab-active {
43 background:none repeat scroll 0 0 #fff;
44 border-bottom-color:#fff;
45 }
46
47 </style>
48 <div id="" class="wrap">
49 <div id="icon-users" class="icon32"><br /></div>
50 <h2>Creating a new CBV User...</h2>
51
52 <div id="post-body">
53 <div style="padding:10px 10px 0px 10px; min-width:760px;">
54 <form method="post" id="admin-new-user-form">
55
56 <table cellpadding="0" cellspacing="0" border="0" class="my-profile-table" style="float:left; width:350px;">
57 <tbody>
58 <tr>
59 <th width="120px;">Username:</th>
60 <td><input type="text" name="username" required /></td>
61 </tr>
62 <tr>
63 <th>First Name:</th>
64 <td><input type="text" name="first_name" required /></td>
65 </tr>
66 <tr>
67 <th>Last Name:</th>
68 <td><input type="text" name="last_name" id="create_last_name" required /></td>
69 </tr>
70 <tr><td colspan="2">&nbsp;</td></tr>
71 <tr>
72 <th>&nbsp;</th>
73 <td><select name="profile_preference" id="profile_preference"><option value="Home">Home&nbsp;</option><option value="Work">Work&nbsp;</option></select></td>
74 </tr>
75 <tr>
76 <th>Email:</th>
77 <td><input type="text" name="email" required /></td>
78 </tr>
79 <tr>
80 <th>Country:</th>
81 <td><?php echo HTML\form_dropdown('country', HTML\Vars::$countries, '', "id='country'"); ?></td>
82 </tr>
83 <tr>
84 <th>Province:</th>
85 <td><?php echo HTML\form_linked_dropdown('province', 'country', HTML\Vars::$provinces,'', ''); ?></td>
86 </tr>
87 </tbody>
88 </table>
89
90 <table cellpadding="0" cellspacing="0" border="0" class="my-profile-table" style="float:left; width:350px;">
91 <tbody>
92 <tr>
93 <th>User Type:</th>
94 <td>
95 <select name="user_role" id="create_user_role">
96 <?php foreach($roles as $roled=>$name):?>
97 <option value="<?php echo $roled;?>" <?php echo ($roled=="guest") ? "selected" : "";?>><?php echo $name;?></option>
98 <?php endforeach;?>
99 </select>
100 </td>
101 </tr>
102 <tr id="create_member_id">
103 <th class="member_id_label">Member ID:</th>
104 <td><input type="text" name="member_id" id="member_id" readonly="readonly" /></td>
105 </tr>
106 <tr><td colspan="2">&nbsp;</td></tr>
107 <tr>
108 <th>Password (twice):</th>
109 <td><input type="password" name="password" required /></td>
110 </tr>
111 <tr>
112 <th>&nbsp;</th>
113 <td><input type="password" name="password2" required /></td>
114 </tr>
115 </tbody>
116 </table>
117
118 <div style="clear:both;"></div>
119
120 <div class="validation-errors" style="display:none;margin-top:10px;"><div class="error-wrap"><h6>OOPS...</h6><ul></ul></div></div>
121
122 <div style="margin-top:10px;padding-top:5px; border-top:1px solid #e8e8e8;">
123 <input type="submit" value="Create User" />
124 </div>
125
126 </form>
127 </div>
128
129 </div>
130
131 </div>
132
133 <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
134 <script type="text/javascript">
135 var $ = jQuery;
136
137 var $role_selector = $('#create_user_role');
138 var $member_id_container = $('#create_member_id');
139 var $member_id_label = $('.member_id_label');
140 var $member_id_field = $('#member_id');
141 var $form = $('#admin-new-user-form');
142 var $last_name_field = $('#create_last_name');
143
144 function changedUserRole() {
145 if ($role_selector.val() == "member" || $role_selector.val()=="student") {
146 if ($role_selector.val() == "member") {
147 $member_id_label.html('Member ID:');
148 } else {
149 $member_id_label.html('Student ID:');
150 }
151 updateMemberID();
152 $member_id_container.show();
153 } else {
154 $member_id_container.hide();
155 }
156 }
157
158 function updateMemberID() {
159 /*
160 var lname = $last_name_field.val();
161 if ($role_selector.val() == "member") {
162 $.ajax({
163 url: '/wp-admin/admin-ajax.php'
164 , data: ({ajax:"yes", action: 'admin_create_member_id', last_name: lname})
165 , dataType: 'json'
166 , type: 'post'
167 , success: function(data) {
168 $member_id_field.val(data.member_id);
169 }
170 });
171 }
172 */
173 $member_id_field.removeAttr('readonly');
174 }
175
176 $(function() {
177 changedUserRole();
178
179 $('#create_last_name').blur(function() {
180 updateMemberID();
181 });
182
183 $role_selector.change(function() {
184 changedUserRole();
185 });
186
187 var options = {
188 url: '/wp-admin/admin-ajax.php'
189 , dataType: 'json'
190 , type: 'post'
191 , data: ({ajax:"yes", action: 'admin_create_user', section: 'create'})
192 , beforeSubmit: function(formData, jqForm, options) {
193 var $error_container = jQuery('.validation-errors');
194 $error_container.hide();
195 }
196 , success: function(data) {
197 if (data.success == "true") {
198 document.location.href=data.edit_profile
199 } else {
200 var $error_container = jQuery('.validation-errors');
201 jQuery('h6',$error_container).html("OOPS...");
202 jQuery('ul',$error_container).html(data.msg);
203 $error_container.show();
204 }
205
206 }
207 };
208 $form.ajaxForm(options);
209
210 });
211
212
213 </script>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 namespace Tz\WordPress\Tools\UserManager;
3
4 use Tz, Tz\Common;
5 use Tz\WordPress\CBV;
6 use Tz\WordPress\CBV\CEHours;
7 use Tz\WordPress\CBV\Events;
8 use Tz\WordPress\UAM;
9
10 use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
11 use Tz\WordPress\Tools\Notifications;
12
13 use Exception, StdClass;
14 use WP_User;
15
16 ini_set('display_errors', 1);
17
18 $records_per_page = 20;
19
20 $filter_role = isset($_GET['role']) ? $_GET['role'] : null;
21 $pagenum = isset($_GET['pagenum']) ? $_GET['pagenum'] : 1;
22 $search = isset($_GET['search_criteria']) ? $_GET['search_criteria'] : null;
23
24 $site_users = get_users($filter_role, $pagenum, $records_per_page, false, $search);
25 $rows = $site_users->countTotal();
26
27 $last = ceil($rows/$records_per_page);
28 if ($last < 1) {
29 $last = 1;
30 }
31
32 if ($pagenum < 1) {
33 $pagenum = 1;
34 } elseif ($pagenum > $last) {
35 $pagenum = $last;
36 }
37
38 if ($filter_role) {
39 $url = $_SERVER['PHP_SELF']."?page=cbv_users&role=$filter_role&pagenum=";
40 } elseif ($search) {
41 $url = $_SERVER['PHP_SELF']."?page=cbv_users&search_criteria=$search&pagenum=";
42 } else {
43 $url = $_SERVER['PHP_SELF']."?page=cbv_users&pagenum=";
44 }
45
46 // Pager section
47 $loop_test = 0;
48 $loop_initial = 0;
49
50 $show_ellipsis_limit = 7;
51 $ellipsis_before = '';
52 $ellipsis_after = '';
53 $ellipsis_common = '...';
54
55 $tag = '[pagenum]';
56 $template = '<a href="' . $url . $tag . '">' . $tag . '</a>';
57 $template_with_class = '<a href="' . $url . $tag . '" class="active">' . $tag . '</a>';
58
59 $prev_link = ($pagenum == 1) ? '' : ' <a href="' . $url . ($pagenum - 1) . '">Prev</a> ';
60 $next_link = ($pagenum == $last) ? '' : ' <a href="' . $url . ($pagenum + 1) . '">Next</a> ';
61 $first_link = ' <a href="' . $url . '1">First</a> ';
62 $last_link = ' <a href="' . $url . $last . '">Last</a> ';
63
64 $pager = '';
65
66 // Style: 1...5 6 7...100
67 if ($last > 1) {
68 $pager = ' | Pages: ';
69
70 // Set options
71
72 // ...31 32 33...
73 if ($last > $show_ellipsis_limit) {
74 // 1 2 3 4...last
75 if ($pagenum > 0 && $pagenum < 4) {
76 $loop_initial = 2;
77 $loop_test = 5;
78 $ellipsis_after = $ellipsis_common;
79 // 4 5 6...last
80 } elseif ($pagenum > 3 && $pagenum < ($last - 1)) {
81 $loop_initial = $pagenum - 1;
82 $loop_test = $pagenum + 2;
83 $ellipsis_before = $ellipsis_common;
84
85 // This is to eliminate the $ellipsis when we're on the 3rd last page
86 if ($pagenum < ($last - 2)) {
87 $ellipsis_after = $ellipsis_common;
88 }
89 // 8 9 10(last)
90 } else {
91 $loop_initial = $pagenum - 2;
92 $loop_test = $last;
93 $ellipsis_before = $ellipsis_common;
94 }
95 // 1 2 3 4 5 6 7
96 } else {
97 $loop_initial = 2;
98 $loop_test = $last;
99 }
100
101 // Now start building html
102
103 // Start with 'First' link, then previous page link
104 if ($last > $show_ellipsis_limit && $pagenum != 1) {
105 $pager .= $first_link . $prev_link;
106 }
107
108 // Set active template to highlight page 1 if that's what we're on
109 if ($pagenum == 1) {
110 $pager .= str_ireplace($tag, 1, $template_with_class);
111 } else {
112 $pager .= str_ireplace($tag, 1, $template);
113 }
114
115 // Implement middle loops
116 $pager .= $ellipsis_before;
117 for ($i = $loop_initial; $i < $loop_test; $i++) {
118 if ($pagenum == $i) {
119 $pager .= str_ireplace($tag, $i, $template_with_class);
120 } else {
121 $pager .= str_ireplace($tag, $i, $template);
122 }
123 }
124 $pager .= $ellipsis_after;
125
126 // Set active template to highlight page 1 if that's what we're on
127 if ($pagenum == $last) {
128 $pager .= str_ireplace($tag, $last, $template_with_class);
129 } else {
130 $pager .= str_ireplace($tag, $last, $template);
131 }
132
133 // Finish with next page link, then 'Last' link
134 if ($last > $show_ellipsis_limit && $pagenum != $last) {
135 $pager .= $next_link;
136 $pager .= $last_link;
137 }
138 }
139
140 ?>
141 <div id="" class="wrap">
142 <div id="icon-users" class="icon32"><br /></div>
143 <h2>CBV User Manager <a href="/wp-admin/admin.php?page=cbv_users_create" class="button add-new-h2">Add New</a></h2>
144 <p style="display:none;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam iaculis convallis nisi eu dignissim. Quisque malesuada augue in mi blandit at blandit tortor sollicitudin. Cras at justo mi, vel mollis est. Donec orci erat, blandit varius vehicula vitae, volutpat at lorem. Etiam tincidunt bibendum ante, non tincidunt purus faucibus sed. Suspendisse eget facilisis tellus. Nulla imperdiet leo placerat diam sollicitudin nec mattis neque mattis. Cras id lacus tellus. Phasellus volutpat vehicula porttitor. Praesent erat felis, pharetra mollis egestas sit amet, rhoncus eget nisl. Morbi interdum sapien vitae nibh pharetra scelerisque. Mauris porta accumsan velit ac aliquam. Sed sit amet dictum felis. Fusce tempus vulputate nulla, quis tincidunt velit mattis eu.</p>
145
146 <div class="users-role-bar">
147 <?php if (isset($_GET['search_criteria'])):?>
148 <div style="margin-bottom:10px;display:block;"><strong>Searched for: </strong> <?php echo strip_tags($_GET['search_criteria']); ?> <a href="/wp-admin/admin.php?page=cbv_users" class="button">Clear Search</a></div>
149 <?php else: ?>
150 <strong>Filter</strong>:
151 <?php $users = count_users(); ?>
152 <a href="/wp-admin/admin.php?page=cbv_users" <?php echo (!isset($_GET['role']) ? "class='active'" : ""); ?>>All</a>
153 <?php
154 if (isset($users['avail_roles'])) {
155 foreach($users['avail_roles'] as $role=>$counted) {
156 print ' | <a href="/wp-admin/admin.php?page=cbv_users&role='.$role.'" '.( (isset($_GET['role']) && $_GET['role']==$role) ? "class='active'" : "").'>'.ucwords($role).'</a>';
157 }
158 }
159
160 ?>
161 <form method="GET" action="<?php echo $_SERVER['PHP_SELF']."?page=cbv_users"; ?>"><input type="hidden" name="page" value="cbv_users" /><div style="margin-top:3px;display:block;"><em>or</em> <strong>Search</strong>: <input type="text" name="search_criteria" value="" /><input type="submit" value="Go" /></div></form>
162 <?php endif;?>
163 </div>
164
165 <div class="TzPaginateResults">
166 <?php
167 echo "Users: $rows ";
168 echo $pager;
169 ?>
170 </div>
171 <div style="clear:both"></div>
172 <table cellspacing="0" class="widefat post fixed">
173 <thead>
174 <tr>
175 <th scope="col" class="manage-column">Name</th>
176 <th scope="col" width="180" class="manage-column">Member ID</th>
177 <th scope="col" width="250" class="manage-column">Email</th>
178 <th scope="col" width="200" class="manage-column">Role</th>
179 <th scope="col" width="100" class="manage-column">Status</th>
180
181 <th scope="col" width="100" class="manage-column">&nbsp;</th>
182
183 </tr>
184 </thead>
185 <tbody>
186 <?php
187 foreach ($site_users as $user):
188 $pref = strtolower($user->email_address_preference);
189 if (!in_array($pref, Array('home', 'work'))) {
190
191 $pref = strtolower($user->profile_preference);
192 if (!in_array($pref, Array('home', 'work'))) {
193 $email = $user->user_email;
194 } else {
195 $email = $user->{$pref . '_email'};
196 }
197
198 //$pref = (empty($user->home_email) ? 'work' : 'home');
199 } else {
200 $email = $user->{$pref . '_email'};
201 }
202 ?>
203 <tr>
204 <td><a href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $user->id; ?>"><?php echo $user->last_name . ', ' . $user->first_name; ?></a></td>
205 <td><a href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $user->id; ?>"><?php echo $user->member_id; ?></a></td>
206 <td><?php echo $email ?></td>
207 <td><?php echo current(array_keys($user->wp_capabilities)); ?></td>
208 <td><?php echo ucwords($user->status);?></td>
209
210 <td><a href="/wp-admin/admin-ajax.php?ajax=yes&action=build_user_remove&uid=<?php echo $user->user_id;?>" class="remove-user" rel="<?php echo $user->user_id;?>">Remove User</a></td>
211
212 </tr>
213 <?php endforeach; ?>
214 </body>
215 </table>
216
217 <div class="TzPaginateResults" style="margin-top:10px;">
218 <?php
219 echo "Users: $rows ";
220 echo $pager;
221 ?>
222 </div>
223 <div style="clear:both;"></div>
224
225 </div>
226 <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 namespace Tz\WordPress\Tools\UserManager;
3
4 use Tz, Tz\Common;
5 use Tz\WordPress\CBV;
6 use Tz\WordPress\CBV\CEHours;
7 use Tz\WordPress\CBV\Events;
8 use Tz\WordPress\CBV\User;
9
10 use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
11 use Tz\WordPress\Tools\Notifications;
12
13 use Exception, StdClass;
14
15 $user = new CBV\User\Account($_GET['uid']);
16 $suser = new CBV\User\CurrentAccount();
17
18 $role = $user->getRole();
19
20 $fname = $user->first_name;
21 $lname = $user->last_name;
22
23 if (empty($fname) || empty($lname)) {
24 $name = $user->user_login;
25 } else {
26 $name = $fname . " " . $lname;
27 }
28
29 $section = isset($_GET['section']) ? $_GET['section'] : "overview";
30
31 call_user_func(function() {
32 CBV\load('Events');
33 });
34 ?>
35 <style>
36
37 #post-body {
38 -moz-border-radius-bottomleft:6px;
39 -moz-border-radius-bottomright:6px;
40 -moz-border-radius-topright:6px;
41 background:none repeat scroll 0 0 #FFFFFF;
42 border-width:1px 1px 1px;
43 padding:10px;
44 }
45 #nav-menu-header, #post-body,#post-header {
46 border-color:#CCCCCC;
47 border-style:solid;
48 }
49
50 #menu-management .nav-tab {
51 background:none repeat scroll 0 0 #F4F4F4;
52 }
53
54 #menu-management .nav-tab-active {
55 background:none repeat scroll 0 0 #fff;
56 border-bottom-color:#fff;
57 }
58
59 </style>
60
61 <script type="text/javascript">var user_id = <?php echo $_GET['uid'];?>;</script>
62
63 <div id="" class="wrap">
64 <div id="icon-users" class="icon32"><br /></div>
65 <h2>Editing: <?php echo $name; ?>
66 <?php if (!empty($user->member_id)) { echo '<span class="admin-member-id"> (' . $user->member_id . ')</span>'; }?>
67 <?php if (in_array($suser->getRole(), Array('administrator', 'cbv_admin'))): ?>
68 (<a href="<?php echo get_author_posts_url($user->ID); ?>?sulogin=1">Login</a>)
69 <?php endif; ?>
70 </h2>
71
72 <p style="display:none;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam iaculis convallis nisi eu dignissim. Quisque malesuada augue in mi blandit at blandit tortor sollicitudin. Cras at justo mi, vel mollis est. Donec orci erat, blandit varius vehicula vitae, volutpat at lorem. Etiam tincidunt bibendum ante, non tincidunt purus faucibus sed. Suspendisse eget facilisis tellus. Nulla imperdiet leo placerat diam sollicitudin nec mattis neque mattis. Cras id lacus tellus. Phasellus volutpat vehicula porttitor. Praesent erat felis, pharetra mollis egestas sit amet, rhoncus eget nisl. Morbi interdum sapien vitae nibh pharetra scelerisque. Mauris porta accumsan velit ac aliquam. Sed sit amet dictum felis. Fusce tempus vulputate nulla, quis tincidunt velit mattis eu.</p>
73
74 <div id="menu-management" style="margin-top:25px;">
75 <div class="nav-tabs-nav">
76 <div class="nav-tabs-wrapper" class="section-<?php echo @$_GET['section'];?>">
77 <div class="nav-tabs" style="padding: 0px; margin-left: 0px;">
78 <a id="overview" class="nav-tab hide-if-no-js <?php echo ($section=="overview") ? "nav-tab-active" : ""; ?>" href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $_GET['uid']; ?>&section=overview">Overview</a>
79 <a id="profile" class="nav-tab hide-if-no-js <?php echo ($section=="profile") ? "nav-tab-active" : ""; ?>" href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $_GET['uid']; ?>&section=profile">Profile</a>
80 <a id="events" class="nav-tab hide-if-no-js <?php echo ($section=="events") ? "nav-tab-active" : ""; ?>" href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $_GET['uid']; ?>&section=events">Events</a>
81 <a id="courses" class="nav-tab hide-if-no-js <?php echo ($section=="courses") ? "nav-tab-active" : ""; ?>" href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $_GET['uid']; ?>&section=courses">Courses</a>
82 <?php if ($role=="member"): ?>
83 <a id="cehours" class="nav-tab hide-if-no-js <?php echo ($section=="cehours") ? "nav-tab-active" : ""; ?>" href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $_GET['uid']; ?>&section=cehours">Continuing Ed.</a>
84 <?php endif; ?>
85 <a id="payhistory" class="nav-tab hide-if-no-js <?php echo ($section=="payhistory") ? "nav-tab-active" : ""; ?>" href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $_GET['uid']; ?>&section=payhistory">Invoice/Receipts</a>
86 <a id="notes" class="nav-tab hide-if-no-js <?php echo ($section=="notes") ? "nav-tab-active" : ""; ?>" href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $_GET['uid']; ?>&section=notes">Admin Notes</a>
87 </div>
88 </div>
89 </div>
90
91 <div id="post-body" style="padding:0px 10px 15px 10px;">
92 <?php require_once('edit_user_' . $section . '.php'); ?>
93 </div>
94
95 </div>
96
97 </div>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 namespace Tz\WordPress\Tools\UserManager;
3
4 use Tz, Tz\Common;
5 use Tz\WordPress\CBV;
6 use Tz\WordPress\CBV\CEHours;
7 use Tz\WordPress\UAM;
8
9 use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
10 use Tz\WordPress\Tools\Notifications;
11
12 use Exception, StdClass;
13 use WP_User;
14
15 $uid = $_GET['uid'];
16
17 CBV\load('CEHours');
18 $cehours = CEHours\get_user_cehours($uid);
19
20 ?>
21 <div style="padding:10px 10px 0px 10px; min-width:760px;">
22 <h2 style="margin-bottom:10px;padding-bottom:0px;">Continuing Education Hours... <a href="/wp-admin/admin-ajax.php?ajax=yes&post_action=create&action=build_cehour_form&uid=<?php echo $uid?>&indexed=0" id="admin_add_new_cehours" class="button add-new-h2">Add New</a></h2>
23
24 <?php
25 if (empty($cehours)) :
26 print "<p>No CE Hours recorded.</p>";
27 else:
28
29 ?>
30
31 <table cellspacing="0" class="widefat post fixed" style="margin-top:0px;">
32 <thead>
33 <tr>
34 <th scope="col" width="150">Date Recorded</th>
35 <th scope="col" width="150">Type</th>
36 <th scope="col">Activity</th>
37 <th scope="col" width="150">Structured</th>
38 <th scope="col" width="100">Unstructured</th>
39 <th scope="col" width="100">&nbsp;</th>
40 </tr>
41 </thead>
42 <tbody>
43 <?php foreach($cehours as $index=>$ce):
44 $ce_date = date('F j, Y',$ce['date']);
45 ?>
46 <tr>
47 <td><?php echo $ce_date; ?></td>
48 <td><?php echo ucwords($ce['subtype']); ?></td>
49 <td><?php echo $ce['activity']; ?></td>
50 <td><?php echo ($ce['type']=="structured") ? $ce['hours'] : 0;?></td>
51 <td><?php echo ($ce['type']=="unstructured") ? $ce['hours'] : 0;?></td>
52 <td class="cehours-remove-td"><a href="/wp-admin/admin-ajax.php?ajax=yes&action=build_cehour_form&uid=<?php echo $uid?>&indexed=<?php echo $index;?>" class="cehours-edit" rel="<?php echo $index;?>">edit</a> | <a href="#" class="cehours-remove" rel="<?php echo $index;?>">remove</a></td>
53 </tr>
54 <?php endforeach; ?>
55 </tbody>
56 </table>
57 <?php
58 endif;
59
60 ?>
61 </div>
62 <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 namespace Tz\WordPress\Tools\UserManager;
3 use Tz, Tz\Common;
4 use Tz\WordPress\Tools;
5 use Tz\WordPress\CBV;
6 use Tz\WordPress\CBV\Courses, Tz\WordPress\CBV\Courses\Registration;
7 use Tz\WordPress\CBV\User;
8 use Tz\WordPress\UAM;
9 use WP_Query;
10
11 // check to see if user is eligible for course (is member/student)
12
13 CBV\load('Courses');
14 $user = new User\Account($_GET['uid']);
15 $courses = Courses\getActiveCourses();
16 $lookup = Array();
17 foreach ($courses as $course) {
18 $lookup[$course->getTemplateID()] = $course;
19 }
20
21 $fn_cd = function($tid, $key) use ($courses, $lookup) {
22 if (!isset($lookup[$tid])) {
23 return 'Not Available';
24 }
25
26 return date('Y-m-d', $courses[$lookup[$tid]->getID()]->{$key});
27 };
28 ?>
29 <div style="padding:10px 10px 0px 10px; min-width:760px;">
30 <div id="Tz4QContainer">
31 <?php if ($user->course_4q_approvals == 'P'): ?>
32 <h2>Security Question Status</h2>
33 <ul>
34 <?php
35 CBV\load('Courses\Registration');
36 $four_questions = Registration\get_four_questions();
37 foreach ($user->four_security_questions as $key => $yesno) {
38 if ($yesno == 1) {
39 echo "<li>Q: {$four_questions[$key]} (yes)</li>";
40 }
41 }
42 ?>
43 </ul>
44
45 <p style="padding: 0 1em;"><em>&quot;<?php echo nl2br(htmlspecialchars($user->four_security_explanation)); ?>&quot;</em></p>
46
47 <p id="TzFQActions">
48 <input type="button" value=" Approve " />
49 <input type="button" value=" Decline " />
50 </p>
51 <?php endif; ?>
52 </div>
53
54 <h2 style="margin-bottom:10px;padding-bottom:0px;">Current Courses</h2>
55
56 <table class="clean-lines widefat post fixed">
57 <thead><tr>
58 <th>Course</th>
59 <th width="85">Type</th>
60 <th width="100">Latest Mark</th>
61 <th>Registration Deadline</th>
62 <th>Semester Runs</th>
63 <th>Register</th>
64 </tr></thead>
65 <tbody>
66 <?php
67 $templates = new WP_Query(Array(
68 'post_type' => CBV\PCT_COURSETEMPLATE
69 , 'posts_per_page' => 0
70 ));
71 while ($templates->have_posts()):
72 $templates->the_post();
73 ?>
74 <tr>
75 <td><?php echo get_the_title(); ?></td>
76 <td><?php echo get_post_meta(get_the_ID(), 'course_type', true); ?></td>
77 <td><?php echo $user->getMark(get_the_ID()); ?></td>
78 <td><?php echo $fn_cd(get_the_ID(), 'course_regi_close'); ?>
79 <td><?php echo $fn_cd(get_the_ID(), 'course_start') . '&nbsp;-&nbsp;' . $fn_cd(get_the_ID(), 'course_end'); ?></td>
80 <td>
81 <?php if (isset($lookup[get_the_ID()]) && $lookup[get_the_ID()]->registrationOpen()): ?>
82 <?php if ($user->courseApprovalStatus($lookup[get_the_ID()]->getID()) == $user::CAS_APPROVED): ?>
83 Registered
84 <?php else: ?>
85 <a href="/wp-admin/admin-ajax.php?ajax=yes&action=build_course_form&post_action=create&uid=<?php echo $user->ID; ?>&course_id=<?php echo $lookup[get_the_ID()]->getID();?>" class="course-edit" rel="<?php echo get_the_id();?>">Register</a>
86 <?php endif; ?>
87 <?php endif; ?>
88 </td>
89 </tr>
90 <?php
91 endwhile;
92 _reset_postdata();
93 ?>
94 </tbody>
95 </table>
96
97 <h2>Course History</h2>
98 <table class="clean-lines widefat post fixed" id="mark_history">
99 <thead><tr>
100 <th>Course</th>
101 <th>Type</th>
102 <th>Mark</th>
103 <th>Semester</th>
104 <th>Date Achieved</th>
105 </tr></thead>
106
107 <tbody>
108 <?php
109 foreach ($user->marks['history'] as $data):
110 $course = new Courses\Course($data['course_id']);
111 ?>
112 <tr>
113 <td><?php echo $course->post_title; ?></td>
114 <td><?php echo $course->course_type; ?></td>
115 <td><a href="#" id="edit_mark_<?php echo $course->ID; ?>" data-mark="editable" data-course-id="<?php echo $course->ID; ?>" data-mark-value="<?php echo $data['mark']; ?>"><?php echo $data['mark']; ?></a></td>
116 <td><?php echo $course->getSemester(); ?></td>
117 <td><?php echo date('Y-m-d', $data['added']); ?></td>
118 </tr>
119 <?php endforeach; ?>
120 </tbody>
121 </table>
122
123 </div>
124 <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 namespace Tz\WordPress\Tools\UserManager;
3
4 use Tz, Tz\Common;
5 use Tz\WordPress\CBV;
6 use Tz\WordPress\CBV\CEHours;
7 use Tz\WordPress\CBV\Events;
8 use Tz\WordPress\UAM;
9
10 use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
11 use Tz\WordPress\Tools\Notifications;
12
13 use Exception, StdClass;
14 use WP_User;
15
16 $uid = $_GET['uid'];
17
18 CBV\load('Events');
19 $events = get_user_meta($user->ID, 'events', true);
20 ?>
21 <div style="padding:10px 10px 0px 10px; min-width:760px;">
22 <?php
23 if (empty($events) || count($events) < 1):
24 echo '<h2 style="margin-bottom:10px;padding-bottom:0px;">'.$name.' is not registered for any events...</h2>';
25 else: ?>
26
27 <h2 style="margin-bottom:10px;padding-bottom:0px;">Registered for Events...</h2>
28
29 <table cellspacing="0" class="widefat post fixed">
30 <thead>
31 <tr>
32 <th scope="col">Event Name</th>
33 <th scope="col" width="150">Event Date</th>
34 <th scope="col" width="150">Registered</th>
35 <th scope="col" width="100">&nbsp;</th>
36 </tr>
37 </thead>
38 <tbody>
39 <?php foreach($user->events as $event):
40 $e = Events\get_event($event['event_id']);
41
42 if ( empty($e->ID) OR $e->ID < 1) { continue; }
43
44 $event_date = get_post_meta($e->ID, 'event_date', true);
45 ?>
46 <tr>
47 <td><?php echo $e->post_title;?></td>
48 <td><?php echo date('F j, Y',$event_date);?></td>
49 <td><?php echo date('F j, Y',$event['register_date']);?></td>
50 <td class="event-cancel-td"><a href="/wp-admin/admin-ajax.php?ajax=yes&action=build_event_form&uid=<?php echo $uid?>&event_id=<?php echo $e->ID;?>" class="event-edit" rel="<?php echo $e->ID;?>">edit</a> | <a href="#" class="event-cancel" rel="<?php echo $e->ID;?>">cancel</a></td>
51 </tr>
52 <?php endforeach; ?>
53 </tbody>
54 </table>
55
56 <h4 style="margin-bottom:5px;padding-bottom:0px; padding-left:10px;"><em>Events not registered for...</em></h4>
57 <?php endif; ?>
58 <?php
59 $posts = query_posts(Array(
60 'post_type' => 'events'
61 , 'posts_per_page' => -1
62 , 'paged' => (get_query_var('paged') ? get_query_var('paged') : 1)
63
64 , 'meta_key' => 'event_date'
65 /*
66 , 'meta_compare' => '>'
67 , 'meta_value' => (time() + (60*60*24)) // event date + 1 day, so that they can register the day of...
68 */
69 , 'orderby' => 'meta_value'
70
71 , 'order' => 'DESC'
72 ));
73 ?>
74
75 <table cellspacing="0" class="widefat post fixed">
76 <thead>
77 <tr>
78 <th scope="col">Event Name</th>
79 <th scope="col" width="150">Event Date</th>
80 <th scope="col" width="150">Register By</th>
81 <th scope="col" width="100">Cost</th>
82 <th scope="col" width="100">&nbsp;</th>
83 </tr>
84 </thead>
85 <tbody>
86 <?php foreach($posts as $post):
87 if (!Events\is_attending($post->ID, $uid) && UAM\can_user_access($post->ID, $uid)):
88
89
90 // get categories....
91 $event_term_slugs = array();
92 $terms = get_the_terms($post->ID,'event_type');
93
94 $external_only = false;
95 if (!empty($terms)) {
96 foreach($terms as $types) {
97 $event_term_slugs[$types->slug] = $types->name;
98 if ($types->slug == "externalevent") {
99 $external_only = true;
100 }
101 }
102 }
103
104 if ($external_only) {
105 continue;
106 }
107
108 $event_date = get_post_meta($post->ID, 'event_date', true);
109
110 if (isset($event_term_slugs['webinar'])) {
111 $is_archived = get_post_meta($post->ID, 'is_archived_webinar', true);
112 /*if (!$is_archived == "on") { continue; }*/
113 } else {
114
115 if ($event_date < (current_time('timestamp') - (60*60*24))) {
116 continue;
117 }
118
119 }
120
121
122
123
124 $event_date = get_post_meta($post->ID, 'event_date', true);
125 $register_date = get_post_meta($post->ID, 'reg_deadline', true);
126 $cost = get_post_meta($post->ID,'cost',true);
127 if (empty($cost) || $cost < 1 || strtolower($cost)=="free") { $cost = 0; }
128 ?>
129 <tr>
130 <td><?php echo $post->post_title;?><br />
131 <?php foreach($terms as $the_term) { echo $the_term->name; } ?>
132 </td>
133 <td><?php echo date('F j, Y',$event_date);?></td>
134 <td><?php echo date('F j, Y',$register_date);?></td>
135 <td>$<?php echo number_format($cost,2);?></td>
136 <td><a href="/wp-admin/admin-ajax.php?ajax=yes&action=build_event_form&post_action=create&uid=<?php echo $uid?>&event_id=<?php echo $post->ID;?>" class="event-edit" rel="<?php echo $post->ID;?>">Register</a></td>
137 </tr>
138 <?php endif; endforeach; ?>
139 </tbody>
140 </table>
141
142 </div>
143 <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 namespace Tz\WordPress\Tools\UserManager;
3
4 use Tz, Tz\Common;
5 use Tz\WordPress\CBV;
6 use Tz\WordPress\CBV\CEHours;
7 use Tz\WordPress\CBV\Invoice;
8 use Tz\WordPress\CBV\Events;
9 use Tz\WordPress\UAM;
10
11 use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
12 use Tz\WordPress\Tools\Notifications;
13
14 use Exception, StdClass;
15 use WP_User;
16 ?>
17 <div style="padding:10px 10px 0px 10px; min-width:760px;position:relative;">
18 <h2 style="margin-bottom:10px;padding-bottom:0px;">Admin notes...</h2>
19
20 <form id="edit_user_notes">
21 <input type="hidden" name="uid" value="<?php echo $_GET['uid']; ?>" />
22 <textarea style="width:99%" rows="10" id="note" name="note"><?php echo get_user_meta($_GET['uid'], 'admin_notes',true);?></textarea>
23 <div style="margin-top:15px;"><input type="submit" value="Update Notes" /><span class="update-placeholder"></span></div>
24 </form>
25
26
27 </div>
28 <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 namespace Tz\WordPress\Tools\UserManager;
3
4 use Tz, Tz\Common;
5 use Tz\WordPress\CBV;
6 use Tz\WordPress\CBV\CEHours;
7 use Tz\WordPress\CBV\Invoice;
8 use Tz\WordPress\CBV\Events;
9 use Tz\WordPress\UAM;
10
11 use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
12 use Tz\WordPress\Tools\Notifications;
13
14 use Exception, StdClass;
15 use WP_User;
16 ?>
17 <div style="padding:10px 10px 0px 10px; min-width:760px;position:relative;">
18
19 <h2 style="margin-bottom:10px;padding-bottom:0px;">Users' Invoice/Receipts...
20 <?php if (!isset($_GET['view'])):?>
21 <a href="#" class="button add-new-h2" id="creditNotBtn">Create new Invoice/Credit Note</a>
22 <?php endif; ?>
23 </h2>
24
25 <div id="credit_note" style="display:none;">
26 <div style="border:1px solid #e8e8e8; background-color:#f5f5f5;padding:10px;">
27 <form id="creditForm" method="POST">
28 <input type="hidden" name="uid" value="<?php echo $_GET['uid']; ?>" />
29 <h3 style="margin:0;padding:0;">Invoice/Credit Note...</h3>
30 <table width="100%" style="margin-top:10px;">
31 <tbody>
32 <tr>
33 <td width="130">Type</td>
34 <td>
35 <select name="invoice_type" id="invoice_type">
36 <option value="invoice">Invoice</option>
37 <option value="membership">Membership Fees</option>
38 <option value="credit">Credit Note</option>
39 </select>
40 </td>
41 </tr>
42 <tr class="invoice_credit_only">
43 <td>Description</td>
44 <td><input type="text" name="title" style="width:400px" /></td>
45 </tr>
46 <tr class="invoice_credit_only">
47 <td>Amount ($)</td>
48 <td><input type="text" name="amount" /></td>
49 </tr>
50 <tr class="invoice_only">
51 <td>Paid?</td>
52 <td><input type="checkbox" name="paid" value="on" /></td>
53 </tr>
54 <tr class="invoice_only">
55 <td>Paid By</td>
56 <td>
57 <select name="paid_by">
58 <option value="">Select payment type...</option>
59 <option value="PPV">Pre-paid with Visa</option>
60 <option value="PPMC">Pre-paid with Mastercard</option>
61 <option value="PPAMEX">Pre-paid with American Express</option>
62 <option value="CHEQUE">Paid by Cheque</option>
63 </select>
64 </td>
65 </tr>
66 <tr>
67 <td colspan="4" style="padding-top:5px;"><input type="submit" value="Apply Invoice/Credit Note" /></td>
68 </tr>
69 </tbody>
70 </table>
71 </form>
72 </div>
73 </div>
74
75 <?php
76 if ( isset($_GET['view']) ) {
77 $invoice = get_post($_GET['view']);
78
79 $invoice->items = get_post_meta($invoice->ID, 'items',true);
80 $invoice->payment = get_post_meta($invoice->ID, 'payment',true);
81
82 $date = strtotime($invoice->post_date);
83 $date = date("F j, Y",$date);
84
85 if ( ($invoice->post_author !== Tools\getCurrentUser()->ID) AND !is_admin()) {
86 print "<div style='color:#DF1C24;font-weight:bold;'>YOU CAN ONLY VIEW YOUR OWN INVOICES.</div>";
87
88 } else {
89
90 $html = '<p><a href="/wp-admin/admin.php?page=cbv_users&action=edit&uid='.$_GET['uid'].'&section=payhistory">Show all invoices</a></p>';
91
92
93
94 $html .= '<div style="text-align:right;margin-bottom:5px;"><a href="/invoices/?view='.$invoice->ID.'&pagename=invoice-preview" class="glabel label-black-print print-invoice-handler" target="_blank"></a></div>';
95
96 $html .= Invoice\DrawInvoice($invoice,true);
97
98 $html .= '<div style="text-align:right;margin-top:5px;"><a href="/invoices/?view='.$_GET['view'].'&pagename=invoice-preview" class="glabel label-black-print print-invoice-handler" target="_blank"></a></div>';
99
100
101 print $html;
102 }
103
104 } else {
105 Invoice\showMyInvoices($_GET['uid'], "/wp-admin/admin.php?page=cbv_users&action=edit&uid=".$_GET['uid']."&section=payhistory&view=");
106 }
107 ?>
108
109 <?php if (!isset($_GET['view']) && !isset($_GET['pay'])): ?>
110 <div id="tax_receipts" style="margin-top:40px;">
111 <h3>T2202a Receipts</h3>
112 <table cellpadding="0" cellspacing="0" border="0">
113 <tbody>
114
115 <?php
116
117 $t2202a = get_user_meta($_GET['uid'], 't2202a', true);
118 if ( empty ($t2202a) ) {
119 echo '<tr><td colspan="2">No t2202a\'s available.</td></tr>';
120 } else {
121 foreach ($t2202a as $year => $file) {
122 ?>
123 <tr>
124 <td width="120"><strong><?php echo $year; ?></strong></td>
125 <td><a href="<?php echo "/wp-content/uploads/t2202a/".$file; ?>">Download 2010 <?php echo ucwords(strtolower('TUITION, EDUCATION, AND TEXTBOOK AMOUNTS CERTIFICATE'));?></a></td>
126 </tr>
127 <?php
128 }
129 }
130 ?>
131 </tbody>
132 </table>
133 </div>
134 <?php endif; ?>
135
136
137
138
139 </div>
140 <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
141 <script type="text/javascript">
142 jQuery(document).ready(function($) {
143
144
145
146 $('#invoice-table').dataTable({
147 "sPaginationType": "full_numbers"
148 , "bFilter": false
149 , "bLengthChange": false
150 , "aaSorting": [[ 0, "desc" ]]
151 , "iDisplayLength": 20
152 , "oLanguage": {
153 "sZeroRecords": "No matching records found"
154 , "sEmptyTable": "No invoices/receipts available"
155 , "sInfo": "Showing _START_ to _END_ of _TOTAL_ invoices/receipts"
156 , "sInfoEmpty": "Showing 0 to 0 of 0 invoices/receipts"
157 , "sInfoFiltered": "(filtered from _MAX_ total invoices/receipts)"
158 }
159 });
160
161
162 });
163 </script>
1 <?php
2 namespace Tz\WordPress\Tools\UserManager;
3
4 use Tz, Tz\Common;
5 use Tz\WordPress\CBV;
6 use Tz\WordPress\CBV\User;
7 use Tz\WordPress\UAM;
8 use Tz\WordPress\Tools;
9 use Tz\WordPress\Tools\Auth;
10 use Exception, StdClass;
11 use WP_User;
12
13 global $wpdb;
14
15 // Get the original timezone (so we can set it back) and figure out the
16 // timestamp for March 1 UTC
17 $original_timezone = date_default_timezone_get();
18 date_default_timezone_set('UTC');
19 $begin_date = strtotime('March 1');
20 // Set the timezone back to original setting
21 date_default_timezone_set($original_timezone);
22
23 if (! empty($_POST['do_fix']) && $_POST['do_fix'] == 'y') {
24 $count_result = mysql_query("SELECT COUNT(*) FROM `{$wpdb->users}`", $wpdb->dbh);
25 list($num) = mysql_fetch_row($count_result);
26 $max = 1000;
27
28 for ($ui = 0; $ui < $num; $ui += $max) {
29 $users = $wpdb->get_results("SELECT `ID` FROM `{$wpdb->users}` LIMIT {$ui}, {$max}");
30 foreach ($users as $user) {
31 $invoices = get_user_meta($user->ID, 'invoices', TRUE);
32 foreach ($invoices as $invoice_id) {
33 // Get the transaction status
34 $trans_status = get_post_meta($invoice_id, 'trans_status', TRUE);
35 // Don't do anything unless the status is 'unpaid'
36 if ($trans_status != 'unpaid') {
37 continue;
38 }
39 // Get the invoice and check if it's newer than March 1 UTC
40 $invoice = get_post($invoice_id);
41 if (strtotime($invoice->post_date) < $begin_date) {
42 continue;
43 }
44
45 // Here's the heavy work: get the payment data and add appropriate taxes
46 $payment = get_post_meta($invoice_id, 'payment', TRUE);
47 $trans_amount = get_post_meta($invoice_id, 'trans_amount', TRUE);
48
49 $pp = get_user_meta($user->ID, 'profile_preference', true);
50 // Get the user's profile preference and use it to get the tax percent
51 if (!empty($pp)) {
52 $preference = strtolower($pp) . '_province';
53 $tax_percent = getTaxesByProvince(get_user_meta($user->ID, $preference, true)) * .01;
54 } else {
55 $tax_percent = getTaxesByProvince($payment['bt_province']) * .01;
56 }
57
58 $payment['total_taxes'] = $payment['total_cost'] * $tax_percent;
59 $payment['total'] = number_format($payment['total_cost'] - $payment['total_discounts'] + $payment['total_taxes'], 2);
60 $trans_amount = $payment['total'];
61
62 // Now update the post
63 update_post_meta($invoice_id, 'payment', $payment);
64 update_post_meta($invoice_id, 'trans_amount', $trans_amount);
65 }
66 }
67 unset($users, $invoices);
68 }
69 }
70
71 ?>
72 <style>
73
74 h4 {
75 float: left;
76 padding-right: 1em;
77 }
78
79 .merge-users {
80 float: left;
81 padding-right: 2em;
82 }
83
84 .merge-users label {
85 float: left;
86 font-weight: bold;
87 padding-right: 1em;
88 }
89
90 .merge-users input {
91 float: left;
92 }
93
94 .clear {
95 float: left;
96 clear: both;
97 }
98
99 .user-list, .user-list li {
100 float: left;
101 clear: both;
102 }
103
104 .changed {
105 margin-top: 5px;
106 clear: both;
107 display: none;
108 }
109
110 .changed h6 {
111 padding: 0px;
112 margin: 0px 0px 10px 0px;
113 font-size: 11px;
114 text-transform: uppercase;
115 }
116
117 .changed ul {
118 margin: 0;
119 padding: 0;
120 }
121
122 .changed ul li {
123 margin: 0px 0px 3px 0px;
124 padding: 0px;
125 font-size: 11px;
126 background: none;
127 }
128 .merge-table td { padding:10px;}
129 </style>
130
131 <div class="wrap">
132
133 <div id="icon-users" class="icon32"><br /></div>
134 <h2>Fix Unpaid Invoices</h2>
135
136 <div class="validation-errors" style="display:none; margin: 10px 0px 10px;">
137 <div class="error-wrap">
138 <ul></ul>
139 </div>
140 </div>
141
142 <div id="post-body" style="padding:10px 0px 15px 0px;">
143 <form method="post" id="fix_unpaid_invoices">
144 <!--<table cellspacing="0" class="widefat post fixed merge-table">
145 <thead>
146 <tr>
147 <th width="50%"><label for="search_user_from">Merge <strong><em>FROM</em></strong> User:</label></th>
148 <th width="50%"><label for="search_user_to">Merge <strong><em>TO</em></strong> User:</label></th>
149 </tr>
150 </thead>
151 <tbody>
152 <tr>
153 <td>
154 <div class="merge-users">
155 <input class="clear" type="text" name="search_user_from" value="<?php echo $_POST['search_user_from'] ?>" />
156 <input type="button" name="btn_user_from" value="Search" />&nbsp;<img id="search_user_from_spinner" class="spinners" src="/wp-content/tz-tools/com/Branding/images/spinner.gif" style="display:none;" />
157
158 </div>
159 </td>
160 <td>
161 <div class="merge-users">
162 <input class="clear" type="text" name="search_user_to" value="<?php echo $_POST['search_user_to'] ?>" />
163 <input type="button" name="btn_user_to" value="Search" />&nbsp;<img id="search_user_to_spinner" class="spinners" src="/wp-content/tz-tools/com/Branding/images/spinner.gif" style="display:none;" />
164 </div>
165 </td>
166 </tr>
167 <tr>
168 <td><div id="user-list-from"></div></td>
169 <td><div id="user-list-to"></div></td>
170 </tr>
171 </tbody>
172 </table>-->
173
174 <div id="field-list" class="changed">
175 <table cellspacing="0" class="widefat post fixed merge-table"></table>
176 </div>
177
178 <div style="clear:both;"></div>
179
180 <div style="margin-top:10px;">
181 <input type="hidden" name="do_fix" value="y" />
182 <input type="submit" value="Do It" />
183 </div>
184
185 </form>
186
187 </div>
188
189 </div>
1 <?php
2 namespace Tz\WordPress\Tools\UserManager;
3
4 use Tz, Tz\Common;
5 use Tz\WordPress\CBV;
6 use Tz\WordPress\CBV\User;
7 use Tz\WordPress\UAM;
8 use Tz\WordPress\Tools;
9 use Tz\WordPress\Tools\Auth;
10 use Exception, StdClass;
11 use WP_User;
12
13 // Make sure some defaults are set because we use these values as is in the input boxes
14 if (! isset($_POST['search_user_from'])) {
15 $_POST['search_user_from'] = '';
16 }
17 if (! isset($_POST['search_user_to'])) {
18 $_POST['search_user_to'] = '';
19 }
20
21 ?>
22 <style>
23
24
25
26 h4 {
27 float: left;
28 padding-right: 1em;
29 }
30
31 .merge-users {
32 float: left;
33 padding-right: 2em;
34 }
35
36 .merge-users label {
37 float: left;
38 font-weight: bold;
39 padding-right: 1em;
40 }
41
42 .merge-users input {
43 float: left;
44 }
45
46 .clear {
47 float: left;
48 clear: both;
49 }
50
51 .user-list, .user-list li {
52 float: left;
53 clear: both;
54 }
55
56 .changed {
57 margin-top: 5px;
58 clear: both;
59 display: none;
60 }
61
62 .changed h6 {
63 padding: 0px;
64 margin: 0px 0px 10px 0px;
65 font-size: 11px;
66 text-transform: uppercase;
67 }
68
69 .changed ul {
70 margin: 0;
71 padding: 0;
72 }
73
74 .changed ul li {
75 margin: 0px 0px 3px 0px;
76 padding: 0px;
77 font-size: 11px;
78 background: none;
79 }
80 .merge-table td { padding:10px;}
81 </style>
82
83 <div class="wrap">
84
85 <div id="icon-users" class="icon32"><br /></div>
86 <h2>Merge CBV Users...</h2>
87
88 <div class="validation-errors" style="display:none; margin: 10px 0px 10px;">
89 <div class="error-wrap">
90 <ul></ul>
91 </div>
92 </div>
93
94 <div id="post-body" style="padding:10px 0px 15px 0px;">
95 <form method="post" id="admin-search-merge-form">
96 <table cellspacing="0" class="widefat post fixed merge-table">
97 <thead>
98 <tr>
99 <th width="50%"><label for="search_user_from">Merge <strong><em>FROM</em></strong> User:</label></th>
100 <th width="50%"><label for="search_user_to">Merge <strong><em>TO</em></strong> User:</label></th>
101 </tr>
102 </thead>
103 <tbody>
104 <tr>
105 <td>
106 <div class="merge-users">
107 <input class="clear" type="text" name="search_user_from" value="<?php echo $_POST['search_user_from'] ?>" />
108 <input type="button" name="btn_user_from" value="Search" />&nbsp;<img id="search_user_from_spinner" class="spinners" src="/wp-content/tz-tools/com/Branding/images/spinner.gif" style="display:none;" />
109
110 </div>
111 </td>
112 <td>
113 <div class="merge-users">
114 <input class="clear" type="text" name="search_user_to" value="<?php echo $_POST['search_user_to'] ?>" />
115 <input type="button" name="btn_user_to" value="Search" />&nbsp;<img id="search_user_to_spinner" class="spinners" src="/wp-content/tz-tools/com/Branding/images/spinner.gif" style="display:none;" />
116 </div>
117 </td>
118 </tr>
119 <tr>
120 <td><div id="user-list-from"></div></td>
121 <td><div id="user-list-to"></div></td>
122 </tr>
123 </tbody>
124 </table>
125
126 <div id="field-list" class="changed">
127 <table cellspacing="0" class="widefat post fixed merge-table"></table>
128 </div>
129
130 <div style="clear:both;"></div>
131
132 <div style="margin-top:10px;">
133 <input type="hidden" value="from" name="which_user_search" />
134 <input type="hidden" value="no" name="do_search" />
135 <input type="hidden" value="no" name="do_merge" />
136 <input type="button" value="Merge Users" name="btn_merge" />
137 </div>
138
139 </form>
140
141 </div>
142
143 </div>
144
145 <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
146 <script type="text/javascript">
147 var $ = jQuery;
148 var $which_user_search = $('[name=which_user_search]');
149 var $do_search = $('[name=do_search]');
150 var $do_merge = $('[name=do_merge]');
151 var $form = $('#admin-search-merge-form');
152 var $field_list = $('#field-list');
153 var $error_container = $('.validation-errors');
154
155 var $from_spinner = $('#search_user_from_spinner');
156 var $to_spinner = $('#search_user_to_spinner');
157
158 $('[name=btn_user_from]').click(function() {
159 $from_spinner.show();
160 $which_user_search.val("from");
161 $do_search.val("yes");
162 $form.submit();
163 });
164
165 $('[name=btn_user_to]').click(function() {
166 $to_spinner.show();
167 $which_user_search.val("to");
168 $do_search.val("yes");
169 $form.submit();
170 });
171
172 $('[name=btn_merge]').click(function() {
173 $do_search.val("no");
174 $do_merge.val("yes");
175
176 if (confirm('Are you sure you want to merge users? This action is NOT reversible!')) {
177 $form.submit();
178 }
179 });
180
181 $(function() {
182
183 var options = {
184 url: ajaxurl,
185 dataType: 'json',
186 type: 'post',
187 data: ({ajax:"yes", action: 'admin_search_merge_users'}),
188 success: function(data) {
189 $('.spinners').hide();
190 if (data.success == "false") {
191 $('h6', $error_container).html("OOPS...");
192 $('ul', $error_container).html(data.msg);
193 $field_list.hide();
194 $error_container.show();
195 } else {
196 $error_container.hide();
197 if (data.fields === undefined) {
198 $('#user-list-' + data.direction).html(data.html);
199 $field_list.hide();
200 } else {
201 $('#user-list-from').html("");
202 $('#user-list-to').html("");
203 $('table', $field_list).html(data.fields);
204 $field_list.show();
205 }
206 }
207 }
208 };
209 $form.ajaxForm(options);
210
211 });
212
213 </script>
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
8 <title>Edit CE Hours</title>
9 <style type="text/css">
10
11 html, body { margin:0px; padding:0;}
12 .title-link {
13 color:#f7bd55;
14 font-size: 12px;
15 font-weight: bold;
16 text-align: left;
17 line-height: 1.75em;
18 background: #3b0d32;
19 border: solid 1px #FFF;
20 border-bottom: solid 1px #999;
21 cursor: default;
22 padding: 0em; padding:3px 10px 3px 10px;
23 margin: 0em;
24
25 }
26
27
28 form {
29 display: block;
30 margin-right:20px;
31 }
32
33 .dashboard-section-title { font-weight:bold; color:#3b0d32; }
34 </style>
35 </head>
36
37 <body>
38
39 <div style="display:block; width:750px; margin-bottom:10px;">
40
41 <div class="title-link" style="display:block;color:#f7bd55; font-size: 12px;font-weight: bold;text-align: left;line-height: 1.75em; background-color: #3b0d32; border: solid 1px #FFF; border-bottom: solid 1px #999; cursor: default; padding: 0em; padding:3px 10px 3px 10px; margin: 0em;">Edit <?php echo $name; ?>'s CE Hours:</div>
42
43 <form method="post" action="" id="edit-cehours-form">
44 <input type="hidden" name="uid" value="<?php echo $uid; ?>" />
45 <input type="hidden" name="indexed" value="<?php echo $indexed; ?>" />
46 <input type="hidden" name="action" value="<?php echo $action; ?>" />
47
48
49 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
50 <div class="dashboard-section-links"></div>
51 <div class="dashboard-section-content small">
52 <table class="clean no-left-padding">
53 <tbody>
54 <tr class="top-td">
55 <td width="140"><select style="width:120px;" name="type"><option value="structured" <?php echo ($type=="structured") ? "selected" : ""; ?>>Structured</option><option value="unstructured" <?php echo ($type=="unstructured") ? "selected" : ""; ?>>Unstructured</option></select></td>
56 <th>Date:</th>
57 <td width="150"><input type="text" name="date" readonly class="datepicker" style="width:120px;" value="<?php echo $date;?>" /></td>
58 <th>Activity Type:</th>
59 <td><select style="width:120px;" name="subtype" class="subtype" id="subtype"><option value="none" <?php echo ($subtype=="") ? "selected" : ""?>>Non Specific</option><option value="event" <?php echo ($subtype=="event") ? "selected" : ""?>>External Event</option><option value="lump" <?php echo ($subtype=="lump") ? "selected" : ""?>>Lump Sum</option><option value="compliance" <?php echo ($subtype=="compliance") ? "selected" : ""?>>Compliance</option></select></td>
60 <th>Hours:</th>
61 <td style="width:50px;"><input type="text" name="hours" style="width:45px;" maxlength="4" value="<?php echo $hours;?>" /></td>
62 </tr>
63 <tr class="activity_row bottom-border-td">
64 <th colspan="7" style="text-align:left;"><label style="padding-right:10px;">Activity:</label><input type="text" name="activity" style="width:450px;" value="<?php echo $activity;?>" /></th>
65 </tr>
66 <tr>
67 <td colspan="7"><div><input type="submit" value="Apply" /></div></td>
68 </tr>
69 </tbody>
70 </table>
71
72 </div>
73 </div>
74
75
76 </form>
77 </div>
78
79 <script type="text/javascript">
80 var $ = jQuery;
81
82 function updateCEType(obj) {
83 var $selectbox = $(obj);
84 var $table = $(obj).parent().parent().parent();
85 var $activity_row = $('tr.activity_row', $table);
86
87 switch($selectbox.val()) {
88 case 'event':
89 var r = '<th colspan="7" style="text-align:left;"><label style="padding-right:10px;">Activity:</label><input type="text" name="activity" style="width:200px;" value="<?php echo $activity;?>" />&nbsp;&nbsp;<label style="padding-right:10px;">Institution:</label><input type="text" name="institution" style="width:200px;" value="<?php echo $institute;?>" />&nbsp;&nbsp;<input type="checkbox" name="attended" value="on" <?php echo ($attended=="yes") ? 'checked="checked"' : ''; ?> />&nbsp;They Attended</th>';
90 break;
91 case 'lump':
92 var r = '<th colspan="7" style="text-align:left;"><input type="hidden" name="activity" style="width:450px;" value="Lump Sum Entry" />For the date, choose any date within the year for which you are reporting.</th>';
93 break;
94 default:
95 var r = '<th colspan="7" style="text-align:left;"><label style="padding-right:10px;">Activity:</label><input type="text" name="activity" style="width:450px;" value="<?php echo $activity;?>" /></th>';
96 }
97
98 $activity_row.html(r);
99 }
100
101
102 jQuery(function($) {
103 $('.subtype').live('change', function() {
104 updateCEType(this);
105 });
106
107 updateCEType($('.subtype'));
108
109 });
110
111 </script>
112
113 </body>
114 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 $enrolments = $course->getEnrolments($user->ID);
3 ?>
4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
7 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8 <head>
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
10
11 <title>Edit Course</title>
12 <style type="text/css">
13
14 html, body { margin:0px; padding:0;}
15 .title-link {
16 color:#f7bd55;
17 font-size: 12px;
18 font-weight: bold;
19 text-align: left;
20 line-height: 1.75em;
21 background: #3b0d32;
22 border: solid 1px #FFF;
23 border-bottom: solid 1px #999;
24 cursor: default;
25 padding: 0em; padding:3px 10px 3px 10px;
26 margin: 0em;
27 }
28
29 form {
30 display: block;
31 margin-right:20px;
32 }
33
34 .dashboard-section-title { font-weight:bold; color:#3b0d32; }
35 </style>
36 </head>
37
38 <body>
39 <form method="post" id="edit-course-form">
40 <input type="hidden" name="course_id" value="<?php echo $course->getID(); ?>" />
41 <input type="hidden" name="user_id" value="<?php echo $user->ID; ?>" />
42
43 <div class="title-link" style="display:block;color:#f7bd55; font-size: 12px;font-weight: bold;text-align: left;line-height: 1.75em; background-color: #3b0d32; border: solid 1px #FFF; border-bottom: solid 1px #999; cursor: default; padding: 0em; padding:3px 10px 3px 10px; margin: 0em;"><?php echo $course->post_title;?></div>
44
45 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
46 <div class="dashboard-section-title">HOW TO PROCESS THE REGISTRATION:</div>
47 <div class="dashboard-section-links"></div>
48 <div class="dashboard-section-content small">
49 <select name="paid_by">
50 <?php /*
51 <option value="unpaid">Invoice User</option>
52 <option value="complementary">Complementary</option>
53 */ ?>
54 <option value="visa">Paid by Prepaid Visa</option>
55 <option value="mc">Paid by Prepaid Mastercard</option>
56 <option value="amex">Paid by Prepaid American Express</option>
57 <option value="cheque">Paid by Cheque</option>
58 </select>
59 </div>
60 </div>
61
62 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
63 <div class="dashboard-section-title">ENROLMENT TYPE</div>
64 <div class="dashboard-section-links"></div>
65 <div class="dashboard-section-content small">
66 <select name="enrolltype">
67 <?php foreach ($enrolments as $key => $display): ?>
68 <option value="<?php echo $key; ?>"><?php echo $display; ?></option>
69 <?php endforeach; ?>
70 </select>
71 </div>
72 </div>
73
74 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
75 <div class="dashboard-section-title">
76 <input type="checkbox" name="exam" id="exam" value="1" checked />
77 <label for="exam">WRITING EXAM?</label>
78 </div>
79 </div>
80
81 <?php if ($user->isStudentFeeDue()): ?>
82 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
83 <div class="dashboard-section-title">
84 <input type="checkbox" name="studentfee" id="studentfee" value="1" checked />
85 <label for="studentfee">PAID ANNUAL REGISTRATION FEE?</label>
86 </div>
87 </div>
88 <?php endif; ?>
89
90 <?php if (!$user->isMemberOf('Casebook')): ?>
91 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
92 <div class="dashboard-section-title">
93 <input type="checkbox" name="casebook" id="casebook" value="1" checked />
94 <label for="casebook">PURCHASED CASEBOOK?</label>
95 </div>
96 </div>
97 <?php endif; ?>
98
99 <?php if ($user->isOverseas()): ?>
100 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
101 <div class="dashboard-section-title">
102 <input type="checkbox" name="overseas" id="overseas" value="1" checked />
103 <label for="overseas">PAID OVERSEAS SURCHARGE?</label>
104 </div>
105 </div>
106 <?php endif; ?>
107
108 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
109 <div class="dashboard-section-title"></div>
110 <div class="dashboard-section-links"></div>
111 <div class="dashboard-section-content small">
112 <div><input type="submit" value="Register" /></div>
113 </div>
114 </div>
115
116 </body>
117 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
8 <title>Edit Event</title>
9 <style type="text/css">
10
11 html, body { margin:0px; padding:0;}
12 .title-link {
13 color:#f7bd55;
14 font-size: 12px;
15 font-weight: bold;
16 text-align: left;
17 line-height: 1.75em;
18 background: #3b0d32;
19 border: solid 1px #FFF;
20 border-bottom: solid 1px #999;
21 cursor: default;
22 padding: 0em; padding:3px 10px 3px 10px;
23 margin: 0em;
24 }
25
26 form {
27 display: block;
28 margin-right:20px;
29 }
30
31 .dashboard-section-title { font-weight:bold; color:#3b0d32; }
32 </style>
33 </head>
34
35 <body>
36
37 <div class="title-link" style="display:block;color:#f7bd55; font-size: 12px;font-weight: bold;text-align: left;line-height: 1.75em; background-color: #3b0d32; border: solid 1px #FFF; border-bottom: solid 1px #999; cursor: default; padding: 0em; padding:3px 10px 3px 10px; margin: 0em;">Mark Invoice Paid:</div>
38
39
40 <div style="padding: 0px 0px 10px 0px;">
41 <form method="post" action="" id="edit-invoice-form">
42
43 <input type="hidden" name="uid" value="<?php echo $_GET['uid']; ?>" />
44 <input type="hidden" name="invoice_id" value="<?php echo $_GET['invoice_id']; ?>" />
45
46 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
47 <div class="dashboard-section-content small">
48 <select name="paid_by">
49 <option value="">Select payment type...</option>
50 <option value="PPV">Pre-paid with Visa</option>
51 <option value="PPMC">Pre-paid with Mastercard</option>
52 <option value="PPAMEX">Pre-paid with American Express</option>
53 <option value="CHEQUE">Paid by Cheque</option>
54 </select>
55 </div>
56 </div>
57
58
59 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
60 <div class="dashboard-section-title"></div>
61 <div class="dashboard-section-links"></div>
62 <div class="dashboard-section-content small">
63 <div><input type="submit" value="Update" /></div>
64 </div>
65 </div>
66
67 </form>
68 </div>
69 </body>
70 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5
6 <title>Refund: <?php echo $invoice->getTitle(); ?></title>
7
8 </head>
9
10 <body class="invoice-refund">
11 <style type="text/css">
12 html, body { margin:0px; padding:0;}
13 .title-link {
14 color: #F7BD55;
15 font-size: 12px;
16 font-weight: bold;
17 text-align: left;
18 line-height: 1.75em;
19 background: #3B0D32;
20 border: 1px solid #FFF;
21 border-bottom: 1px solid #999;
22 cursor: default;
23 padding: 3px 10px 3px 10px;
24 margin: 0em;
25 }
26
27 form {
28 display: block;
29 margin-right: 20px;
30 }
31
32 table.item-listings tr th { text-align: left; border-bottom: 1px solid #CCC; }
33 table.item-listings tr td { text-aling: left; border-bottom: 1px solid #CCC; }
34
35 table.item-listings tbody tr.odd td { background-color: #F5F5F5; }
36
37 table.item-listings tr th,
38 table.item-listings tr td { padding: 4px 5px; }
39 table.item-listings thead tr th { padding-bottom: 10px; }
40
41 table { border-collapse:collapse; }
42
43 .dashboard-section-title { font-weight:bold; color:#3b0d32; }
44
45 label.amount {
46 color: #999;
47 font-size: 11px;
48 }
49
50 .part-wrapper {
51 display: block;
52 width: 750px;
53 margin-bottom: 0;
54 }
55 </style>
56
57 <div class="part-wrapper">
58 <div class="title-link">Refund: <?php echo $invoice->getTitle(); ?></div>
59 <div style="padding:10px;">
60
61 <form id="invoice_refund_form">
62
63 <table cellpadding="0" cellspacing="0" width="100%" border="0" class="item-listings">
64 <thead><tr>
65 <th>Item Description</th>
66 <th width="140">Refund?</th>
67 <th width="140">Cancel Fee?</th>
68 </tr></thead>
69
70 <tbody>
71 <?php
72 $i = 0;
73 foreach ($invoice as $key => $item):
74 $unq = "keys[{$key}]";
75 ?>
76 <tr class="<?php echo (++$i & 1 ? 'odd' : 'even'); ?>">
77 <td><label for="<?php echo $unq; ?>"><?php echo $item->getDescription(); ?></label></td>
78 <td>
79 <input type="checkbox" checked="checked" value="1" id="<?php echo $unq; ?>" name="<?php echo $unq; ?>" />
80 <label for="<?php echo $unq; ?>" class="amount">(-$<?php echo $item->getTotal(true); ?>)</label>
81 </td>
82 <td>
83 <input type="checkbox" checked="checked" value="1" id="force_cancellation_fee" name="force_cancellation_fee" />
84 <label for="<?php echo $unq; ?>" class="amount">(+<?php echo '$150.00'; ?>)</label>
85 </td>
86 </tr>
87 <?php endforeach; ?>
88 </tbody></table>
89
90 <div style="padding-top:8px; margin-top:25px;">
91 <table cellpadding="0" cellspacing="0" width="100%" border="0">
92 <tr>
93 <td width="400" style="text-align:right;">
94 <input type="submit" value="Apply Changes" /> <input type="button" value="Cancel Changes" id="refund_cancel_btn" />
95 </td>
96 </tr>
97 </table>
98 </div>
99 </form>
100 </div>
101 </div>
102 </body>
103 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
8 <title>Remove User</title>
9 <style type="text/css">
10
11 html, body { margin:0px; padding:0;}
12 .title-link {
13 display:block;
14 color:#f7bd55;
15 font-size: 12px;
16 font-weight: bold;
17 text-align: left;
18 line-height: 1.75em;
19 background-color: #3b0d32;
20 border: solid 1px #FFF;
21 border-bottom: solid 1px #999;
22 cursor: default;
23 padding: 0em; padding:3px 10px 3px 10px;
24 margin: 0em;
25 }
26
27 form {
28 display: block;
29 margin-right:20px;
30 }
31
32 .dashboard-section-title { font-weight:bold; color:#3b0d32; }
33 </style>
34 </head>
35
36 <body>
37
38 <div class="title-link" style="display:block;color:#f7bd55; font-size: 12px;font-weight: bold;text-align: left;line-height: 1.75em; background-color: #3b0d32; border: solid 1px #FFF; border-bottom: solid 1px #999; cursor: default; padding: 0em; padding:3px 10px 3px 10px; margin: 0em;">Are you sure you want to remove this user?</div>
39
40 <form method="post" action="" id="remove-user-form">
41 <input type="hidden" name="uid" value="<?php echo $uid; ?>" />
42
43 <div class="dashboard-section" style="margin-left:5px;margin-top:10px;">
44 <div class="dashboard-section-links"></div>
45 <div class="dashboard-section-content small" style="padding:10px;">
46 <table width="300" cellpadding="0" cellspacing="0" border="0">
47 <tbody>
48 <tr>
49 <td width="20" valign="top"><input type="radio" name="remove_action" value="remove_all" id="remove_all" /></td>
50 <td><label for="remove_all">Yes, remove user and all related registrations, posts and comments.<br /><span style="font-size:11px; color:#999;"><em>(not recommended)</em></span></label></td>
51 </tr>
52 <tr><td colspan="2">&nbsp;</td></tr>
53 <tr>
54 <td width="20" valign="top"><input type="radio" name="remove_action" value="terminate" id="terminate" checked="checked" /></td>
55 <td><label for="terminate">Yes, but I just want to terminate them, and remove their access to the site.</label></td>
56 </tr>
57 <tr><td valign="middle" colspan="2" class="confirm-delete" style="color:red; font-size:10px;height:25px;">&nbsp;</td></tr>
58 <tr>
59 <td colspan="2"><input type="submit" value="&nbsp;I'm sure; Proceed!&nbsp;" /></td>
60 </tr>
61 </tbody>
62 </table>
63 </div>
64 </div>
65
66
67 </form>
68 <script type="text/javascript">
69 var $ = jQuery;
70 $('#remove_all').click(function() {
71 $('.confirm-delete').html('This action cannot be undone. Proceed with caution.');
72 });
73 $('#terminate').click(function() {
74 $('.confirm-delete').empty();
75 });
76 </script>
77 </body>
78 </html>
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 namespace Tz\WordPress\Tools\UserManager;
3
4 use Tz, Tz\Common;
5 use Tz\WordPress\CBV;
6 use Exception, StdClass;
7
8 $users = _get_signups();
9
10
11
12
13 ?>
14 <div id="" class="wrap">
15 <div id="icon-users" class="icon32"><br /></div>
16 <h2>Users awaiting validation</h2>
17 <p style="display:none;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam iaculis convallis nisi eu dignissim. Quisque malesuada augue in mi blandit at blandit tortor sollicitudin. Cras at justo mi, vel mollis est. Donec orci erat, blandit varius vehicula vitae, volutpat at lorem. Etiam tincidunt bibendum ante, non tincidunt purus faucibus sed. Suspendisse eget facilisis tellus. Nulla imperdiet leo placerat diam sollicitudin nec mattis neque mattis. Cras id lacus tellus. Phasellus volutpat vehicula porttitor. Praesent erat felis, pharetra mollis egestas sit amet, rhoncus eget nisl. Morbi interdum sapien vitae nibh pharetra scelerisque. Mauris porta accumsan velit ac aliquam. Sed sit amet dictum felis. Fusce tempus vulputate nulla, quis tincidunt velit mattis eu.</p>
18
19 <table cellspacing="0" class="widefat post fixed" style="margin-top:20px;">
20 <thead>
21 <tr>
22 <th width="200">Login</th>
23 <th>Email</th>
24 <th width="200">Date Registered</th>
25 <th width="200">&nbsp;</th>
26 </tr>
27 </thead>
28 <tbody>
29 <?php foreach($users as $user): ?>
30 <tr>
31 <td><?php echo $user->user_login; ?></td>
32 <td><a href="mailto:<?php echo $user->user_email; ?>"><?php echo $user->user_email; ?></a></td>
33 <td><?php echo date("M j, Y @ h:ia",strtotime($user->registered)); ?></td>
34 <td style="text-align:right;"><a href="#" class="activate" rel="<?php echo $user->activation_key;?>">Activate</a> | <a href="#" class="remove" rel="<?php echo $user->activation_key;?>">Remove</a></td>
35 </tr>
36 <?php endforeach;?>
37 </tbody>
38 </table>
39 </div>
40
41 <script type="text/javascript">
42 jQuery(document).ready(function($) {
43
44 $('.activate').click(function(e) {
45 var activation_key = $(this).attr('rel');
46
47 $.ajax({
48 url: '/wp-admin/admin-ajax.php'
49 , dataType: 'json'
50 , type: 'POST'
51 , data: ({ajax:"yes", action: 'override_activate', akey: activation_key})
52 , success: function(date) {
53 document.location.href = document.location.href;
54 }
55 });
56 e.preventDefault();
57 return false;
58 });
59
60 $('.remove').click(function(e) {
61 var activation_key = $(this).attr('rel');
62
63 $.ajax({
64 url: '/wp-admin/admin-ajax.php'
65 , dataType: 'json'
66 , type: 'POST'
67 , data: ({ajax:"yes", action: 'override_remove', akey: activation_key})
68 , success: function(date) {
69 document.location.href = document.location.href;
70 }
71 });
72 e.preventDefault();
73 return false;
74 });
75
76 });
77 </script>
...\ No newline at end of file ...\ No newline at end of file